"use strict";(self.webpackChunk_woocommerce_storybook=self.webpackChunk_woocommerce_storybook||[]).push([[6],{"../../packages/js/components/src/flag/index.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>__WEBPACK_DEFAULT_EXPORT__});var classnames__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("../../node_modules/.pnpm/classnames@2.3.2/node_modules/classnames/index.js"),classnames__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__),prop_types__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("../../node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/index.js"),prop_types__WEBPACK_IMPORTED_MODULE_4___default=__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_4__),emoji_flags__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("../../node_modules/.pnpm/emoji-flags@1.3.0/node_modules/emoji-flags/index.js"),emoji_flags__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(emoji_flags__WEBPACK_IMPORTED_MODULE_1__),lodash__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/lodash.js"),_wordpress_element__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("../../node_modules/.pnpm/react@18.3.1/node_modules/react/index.js"),Flag=function Flag(_ref){var code=_ref.code,order=_ref.order,className=_ref.className,size=_ref.size,hideFromScreenReader=_ref.hideFromScreenReader,classes=classnames__WEBPACK_IMPORTED_MODULE_0___default()("woocommerce-flag",className),_code=code||"unknown";order&&order.shipping&&order.shipping.country?_code=order.shipping.country:order&&order.billing&&order.billing.country&&(_code=order.billing.country);var inlineStyles={fontSize:size},emoji=(0,lodash__WEBPACK_IMPORTED_MODULE_2__.get)(emoji_flags__WEBPACK_IMPORTED_MODULE_1___default().countryCode(_code),"emoji");return(0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.createElement)("div",{className:classes,style:inlineStyles,"aria-hidden":hideFromScreenReader},emoji&&(0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.createElement)("span",null,emoji),!emoji&&(0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.createElement)("span",{className:"woocommerce-flag__fallback"},"Invalid country flag"))};Flag.propTypes={code:prop_types__WEBPACK_IMPORTED_MODULE_4___default().string,order:prop_types__WEBPACK_IMPORTED_MODULE_4___default().object,className:prop_types__WEBPACK_IMPORTED_MODULE_4___default().string,size:prop_types__WEBPACK_IMPORTED_MODULE_4___default().number};const __WEBPACK_DEFAULT_EXPORT__=Flag},"../../packages/js/components/src/product-image/index.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>product_image});var esm_extends=__webpack_require__("../../node_modules/.pnpm/@babel+runtime@7.23.5/node_modules/@babel/runtime/helpers/esm/extends.js"),objectWithoutProperties=__webpack_require__("../../node_modules/.pnpm/@babel+runtime@7.23.5/node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js"),react=__webpack_require__("../../node_modules/.pnpm/react@18.3.1/node_modules/react/index.js"),classnames=__webpack_require__("../../node_modules/.pnpm/classnames@2.3.2/node_modules/classnames/index.js"),classnames_default=__webpack_require__.n(classnames),lodash=__webpack_require__("../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/lodash.js"),_excluded=["product","width","height","className","alt"];const product_image=function ProductImage(_ref){var product=_ref.product,_ref$width=_ref.width,width=void 0===_ref$width?33:_ref$width,_ref$height=_ref.height,height=void 0===_ref$height?33:_ref$height,_ref$className=_ref.className,className=void 0===_ref$className?"":_ref$className,alt=_ref.alt,props=(0,objectWithoutProperties.A)(_ref,_excluded),productImage=(0,lodash.get)(product,["images",0])||(0,lodash.get)(product,["image"]),src=productImage&&productImage.src||!1,altText=alt||productImage&&productImage.alt||"",classes=classnames_default()("woocommerce-product-image",className,{"is-placeholder":!src});return(0,react.createElement)("img",(0,esm_extends.A)({className:classes,src:src||"data:image/svg+xml;utf8,%3Csvg width='421' height='421' xmlns='http://www.w3.org/2000/svg' xmlns:svg='http://www.w3.org/2000/svg'%3E%3Cstyle type='text/css'%3E.st0%7Bfill:url(%23SVGID_1_);stroke:%23717275;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10%7D .st1%7Bfill:%23FFFFFF;%7D .st2%7Bfill:%23717275;%7D .st3%7Bfill:%23DCDDE0;stroke:%23717275;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;%7D%3C/style%3E%3CradialGradient cx='105.8248' cy='287.7805' gradientUnits='userSpaceOnUse' id='SVGID_1_' r='372.6935'%3E%3Cstop offset='0.2613' stop-color='%23DCDDE0'/%3E%3Cstop offset='0.633' stop-color='%23D8DADD'/%3E%3Cstop offset='0.9665' stop-color='%23CECFD3'/%3E%3Cstop offset='1' stop-color='%23CCCED2'/%3E%3C/radialGradient%3E%3Cg class='layer' display='inline'%3E%3Ctitle%3ELayer 2%3C/title%3E%3Crect fill='%23ffffff' height='417.99996' id='svg_7' stroke-dasharray='null' stroke-linecap='null' stroke-linejoin='null' stroke-width='null' width='417.99996' x='1.50002' y='1.5'/%3E%3C/g%3E%3Cg class='layer' display='inline'%3E%3Ctitle%3ELayer 1%3C/title%3E%3Cg id='svg_2'/%3E%3Cg id='svg_6'%3E%3Cpath class='st0' d='m330.44409,336.12693c-0.12194,0.36582 0,0.67068 0.30485,0.79262c1.40232,-0.79262 3.17047,-1.0365 4.63377,-0.48776c0.67068,-1.46329 0.12194,-2.43882 0.06097,-3.90212c-0.91456,-15.66945 -0.73165,-31.9486 -0.73165,-47.73998c0,-16.34012 -0.30485,-32.74121 0.54874,-48.9594c0.79262,-15.9743 1.89009,-31.5218 1.28038,-47.55707c-0.60971,-15.79139 -0.06097,-31.70471 0.73165,-47.37416c0.36582,-8.04812 0.79262,-15.66945 0.36582,-23.77854c-0.48776,-9.08462 -0.36582,-21.88845 -0.36582,-30.97307c0,-1.0365 0.18291,-1.82912 -0.79262,-2.43882c-0.79262,-0.48776 -1.52427,-0.42679 -2.43882,-0.42679c-2.49979,0 -4.87765,-0.36582 -7.37744,-0.36582c-1.52427,0 -2.86562,0 -4.32891,0.30485c-0.79262,0.12194 -1.52427,0.06097 -2.31688,0.06097c-0.85359,0 -1.52427,0.18291 -2.31688,0.36582c-6.88968,1.15844 -15.73042,2.49979 -22.62009,1.76815c-6.88968,-0.73165 -13.71839,-0.67068 -20.54709,-2.01203c-6.46288,-1.28038 -12.92577,-0.42679 -19.38865,-0.42679c-4.146,0 -8.23103,0 -12.37703,0c-3.96309,0 -7.80424,-0.73165 -11.8283,-0.73165c-6.52385,0.06097 -13.10868,0.12194 -19.63253,0.36582c-4.51182,0.18291 -8.84074,0 -13.35256,0.42679c-6.82871,0.60971 -13.77936,1.09747 -20.66903,1.0365c-3.59727,0 -7.07259,0.24388 -10.60889,-0.42679c-3.17047,-0.60971 -6.58483,-0.12194 -9.7553,0.18291c-3.96309,0.36582 -7.86521,1.0365 -11.8283,1.0365c-3.84115,-0.06097 -7.74327,-0.85359 -11.58441,-0.85359c-4.38988,-0.12194 -8.59686,0.42679 -12.98674,0.12194c-5.36541,-0.36582 -10.60889,-0.06097 -15.91333,-0.12194c-0.91456,0 -1.34135,0.24388 -2.13397,0.36582c-0.79262,0.12194 -1.40232,0.36582 -2.19494,0.36582c-0.85359,0 -1.34135,-0.30485 -2.13397,-0.36582c-1.64621,-0.18291 -5.91415,-0.06097 -7.49938,-0.48776c-1.70718,-0.42679 -3.41435,-0.91456 -5.12153,-1.34135c-1.40232,1.34135 -1.52427,3.5363 -1.64621,5.48735c-0.85359,21.58359 -0.73165,43.16719 -0.60971,64.75078c0,4.99959 0.06097,9.99918 0.60971,14.9378c0.42679,3.84115 1.15844,7.6823 1.46329,11.52344c0.48776,6.219 -0.06097,12.49897 -0.36582,18.71798c-0.36582,7.31647 -0.36582,14.63295 0.06097,21.94942c0.97553,18.90089 -0.48776,40.30157 -0.79262,59.20246c-0.36582,18.41312 -0.67068,37.1311 3.90212,54.99549c4.63377,-1.82912 17.13274,1.15844 22.55912,1.40232c5.85318,0.24388 11.8283,0.30485 17.74245,0.30485c6.76774,0 13.59644,-0.36582 20.30321,0c8.47491,0.42679 16.09624,2.31688 24.63212,1.82912c4.146,-0.24388 8.65783,0.36582 12.68189,0.36582c3.29241,0 9.87724,-1.09747 12.25509,0.73165c8.77977,0 20.18127,0.12194 28.90007,-0.73165c9.08462,-0.85359 19.38865,-1.21941 28.47327,-0.36582c7.37744,0.73165 14.45003,1.34135 21.82748,0.36582c4.63377,-0.60971 9.14559,-1.09747 13.9013,-1.09747c4.32891,0 8.292,-1.58524 12.49897,-1.46329c4.63377,0.12194 9.38947,1.40232 14.02324,1.89009c3.04853,0.30485 9.63336,-2.49979 12.49897,-1.21941l-0.00003,-0.00001z' fill='black' id='svg_1'/%3E%3Cpath class='st1' d='m313.79912,275.40021c-1.09747,0 -3.90212,-4.20697 -4.99959,-5.85318c-0.42679,-0.67068 -0.79262,-1.21941 -1.0365,-1.52427c-1.76815,-2.25591 -4.02406,-4.51182 -6.219,-6.6458c-0.67068,-0.67068 -1.40232,-1.40232 -2.073,-2.073c-3.5363,-3.59727 -9.02365,-7.98715 -13.16965,-9.51141c-1.40232,-0.48776 -2.56077,-1.21941 -3.71921,-1.82912c-2.19494,-1.28038 -4.20697,-2.43882 -7.49938,-2.49979c-0.30485,0 -0.67068,0 -0.97553,0c-3.78018,0 -7.49938,0.48776 -11.34053,1.09747c-7.19453,1.09747 -16.82789,7.49938 -21.52262,14.32809c-0.73165,1.09747 -1.15844,2.31688 -1.21941,3.5363c-2.31688,-0.54874 -5.6093,-3.17047 -7.62133,-4.75571c-0.30485,-0.24388 -0.60971,-0.48776 -0.85359,-0.67068c-2.74368,-2.13397 -4.75571,-4.5728 -6.95065,-7.2555c-1.28038,-1.52427 -2.62174,-3.1095 -4.08503,-4.63377c-7.92618,-8.17006 -16.88886,-15.48653 -25.54668,-22.55912c-4.51182,-3.65824 -9.14559,-7.43841 -13.59644,-11.27956c-5.79221,-4.99959 -10.365,-9.81627 -14.45003,-15.12071c-0.42679,-0.54874 -0.85359,-1.09747 -1.21941,-1.64621c-1.58524,-2.13397 -3.23144,-4.26794 -5.12153,-6.15803c-0.67068,-0.67068 -2.31688,-1.89009 -4.20697,-3.23144c-2.98756,-2.19494 -7.56035,-5.48735 -7.92618,-6.70677c-0.42679,-1.40232 -3.5363,-3.5363 -3.59727,-3.5363c-0.85359,-0.48776 -1.76815,-1.40232 -1.82912,-2.62174l-0.06097,-0.85359l-0.79262,0.36582c-2.86562,1.34135 -4.93862,3.41435 -7.07259,5.6093c-0.36582,0.36582 -0.67068,0.73165 -1.0365,1.0365c-5.67027,5.73124 -11.15762,11.64539 -16.27915,17.49856c-2.49979,2.86562 -5.12153,6.03609 -7.31647,9.38947c-0.60971,0.91456 -1.15844,2.01203 -1.70718,3.17047c-0.91456,1.89009 -1.89009,3.84115 -3.04853,4.99959c-0.36582,-0.54874 -0.73165,-1.64621 -0.91456,-2.13397c-0.06097,-0.18291 -0.12194,-0.42679 -0.18291,-0.54874c-1.28038,-3.17047 -0.79262,-6.52385 -0.30485,-10.06015c0.36582,-2.49979 0.73165,-4.99959 0.48776,-7.62133c-0.12194,-0.97553 -0.30485,-2.01203 -0.48776,-3.04853c-0.60971,-3.47532 -1.21941,-7.01162 -0.73165,-10.24306c1.21941,-9.63336 2.43882,-19.51059 3.04853,-29.32686c0.97553,-9.69433 0.42679,-18.83992 -0.18291,-28.53424c-0.12194,-2.43882 -0.30485,-4.99959 -0.42679,-7.49938c0,-1.0365 -0.06097,-2.13397 -0.06097,-3.17047c-0.12194,-3.17047 -0.24388,-6.219 0.60971,-9.20656c0.18291,-0.12194 0.48776,-0.30485 0.85359,-0.36582l2.37785,1.0365c2.25591,0.91456 5.1825,1.40232 8.90171,1.40232c3.41435,0 7.01162,-0.36582 10.54791,-0.73165c3.23144,-0.30485 6.34094,-0.60971 9.02365,-0.60971c0.67068,0 1.28038,0 1.89009,0.06097c1.52427,0.12194 3.04853,0.30485 4.51182,0.48776c2.13397,0.24388 4.38988,0.54874 6.58483,0.54874c0.54874,0 1.09747,0 1.58524,0c3.90212,0 7.92618,-0.18291 11.76733,-0.36582c3.17047,-0.12194 6.46288,-0.30485 9.69433,-0.36582c5.48735,-0.06097 11.09665,-0.36582 16.46206,-0.60971c2.25591,-0.12194 4.45085,-0.24388 6.70677,-0.30485c4.38988,-0.18291 8.90171,-0.18291 13.23062,-0.18291c3.1095,0 6.34094,0 9.57238,-0.06097c6.6458,-0.18291 13.35256,-0.54874 19.81545,-0.97553c6.88968,-0.42679 14.08421,-0.85359 21.09583,-0.97553c1.76815,-0.06097 3.5363,-0.06097 5.24347,-0.06097c3.84115,-0.06097 7.80424,-0.06097 11.76733,-0.30485c2.25591,-0.12194 4.5728,-0.36582 6.82871,-0.54874c3.78018,-0.36582 7.74327,-0.67068 11.58441,-0.67068c1.40232,0 2.74368,0.06097 4.02406,0.12194c1.89009,0.12194 3.78018,0.48776 5.79221,0.85359c2.62174,0.48776 5.30444,0.91456 7.92618,0.91456c0.67068,0 1.34135,-0.06097 1.95106,-0.12194c-0.73165,1.40232 -0.73165,3.17047 -0.67068,4.08503c0.12194,2.31688 0.12194,4.81668 0.12194,7.19453c0,9.38947 -0.97553,18.29118 -2.01203,27.74163c-0.36582,3.23144 -0.73165,6.6458 -1.0365,9.99918c-0.60971,13.65742 0,28.10745 0.60971,40.8503l0,4.63377c0.30485,4.146 0,8.23103 -0.30485,12.13315c-0.30485,3.90212 -0.60971,7.92618 -0.30485,11.95024c1.28038,12.07218 1.82912,23.71757 1.64621,34.6313l0.42679,10.60889l0.06097,0.06097c0.48776,1.34135 0.97553,6.95065 -0.24388,8.77977c-0.36582,0.42679 -0.60971,0.48776 -0.79262,0.48776l0,0l-0.00004,0.00002z' id='svg_3'/%3E%3Cpath class='st2' d='m296.54444,101.02428c1.40232,0 2.68271,0.06097 3.96309,0.12194c1.82912,0.12194 3.71921,0.48776 5.73124,0.79262c2.62174,0.48776 5.36541,0.97553 8.04812,0.97553c0.36582,0 0.67068,0 1.0365,0c-0.36582,1.21941 -0.36582,2.49979 -0.36582,3.41435c0.12194,2.31688 0.12194,4.75571 0.12194,7.13356c0,9.38947 -0.97553,18.29118 -2.01203,27.68065c-0.36582,3.29241 -0.73165,6.6458 -1.0365,9.99918l0,0l0,0c-0.60971,13.59644 0,28.10745 0.60971,40.8503l0,4.63377l0,0.06097l0,0.06097c0.30485,4.02406 0,8.10909 -0.30485,12.01121c-0.30485,3.90212 -0.60971,7.98715 -0.30485,12.01121l0,0l0,0c1.28038,12.01121 1.82912,23.65659 1.64621,34.50936l0,0.06097l0,0.06097l0.42679,10.48694l0,0.18291l0.06097,0.18291c0.48776,1.34135 0.85359,6.70677 -0.18291,8.292c-0.06097,0.06097 -0.12194,0.18291 -0.18291,0.18291c-1.0365,-0.36582 -3.65824,-4.26794 -4.51182,-5.54833c-0.48776,-0.67068 -0.79262,-1.21941 -1.09747,-1.58524c-1.82912,-2.31688 -4.08503,-4.51182 -6.219,-6.70677c-0.67068,-0.67068 -1.40232,-1.34135 -2.073,-2.073c-3.59727,-3.65824 -9.14559,-8.04812 -13.41353,-9.63336c-1.34135,-0.48776 -2.49979,-1.15844 -3.59727,-1.82912c-2.13397,-1.21941 -4.32891,-2.49979 -7.80424,-2.62174c-0.30485,0 -0.67068,0 -0.97553,0c-3.84115,0 -7.56035,0.48776 -11.46247,1.09747c-7.37744,1.09747 -17.19371,7.62133 -21.94942,14.57197c-0.67068,0.97553 -1.09747,2.01203 -1.28038,3.1095c-2.13397,-0.79262 -4.93862,-3.04853 -6.70677,-4.45085c-0.30485,-0.24388 -0.60971,-0.48776 -0.85359,-0.67068c-2.68271,-2.073 -4.69474,-4.51182 -6.88968,-7.13356c-1.28038,-1.52427 -2.62174,-3.1095 -4.08503,-4.69474c-7.92618,-8.17006 -16.88886,-15.48653 -25.60765,-22.55912c-4.51182,-3.65824 -9.14559,-7.43841 -13.53547,-11.27956c-5.73124,-4.99959 -10.30403,-9.7553 -14.38906,-15.05974c-0.42679,-0.54874 -0.85359,-1.09747 -1.21941,-1.64621c-1.58524,-2.13397 -3.29241,-4.32891 -5.1825,-6.219c-0.73165,-0.73165 -2.31688,-1.89009 -4.26794,-3.29241c-2.37785,-1.70718 -7.31647,-5.30444 -7.6823,-6.40191c-0.48776,-1.70718 -3.84115,-3.90212 -3.84115,-3.90212c-0.67068,-0.42679 -1.46329,-1.15844 -1.52427,-2.13397l-0.12194,-1.70718l-1.58524,0.73165c-2.98756,1.34135 -5.1825,3.59727 -7.2555,5.73124c-0.36582,0.36582 -0.67068,0.73165 -1.0365,1.0365c-5.67027,5.73124 -11.15762,11.64539 -16.27915,17.49856c-2.56077,2.92659 -5.1825,6.09706 -7.37744,9.45044c-0.60971,0.91456 -1.15844,2.073 -1.76815,3.29241c-0.73165,1.46329 -1.46329,3.04853 -2.37785,4.146c-0.18291,-0.48776 -0.42679,-0.97553 -0.48776,-1.28038c-0.06097,-0.24388 -0.18291,-0.42679 -0.24388,-0.54874c-1.21941,-2.98756 -0.79262,-6.27997 -0.24388,-9.69433c0.36582,-2.49979 0.73165,-5.12153 0.48776,-7.74327l0,0l0,0c-0.12194,-0.97553 -0.30485,-1.95106 -0.48776,-2.98756c-0.60971,-3.41435 -1.15844,-6.95065 -0.73165,-10.06015c1.21941,-9.63336 2.43882,-19.51059 3.04853,-29.32686c0.97553,-9.7553 0.42679,-18.90089 -0.18291,-28.65618c-0.12194,-2.43882 -0.30485,-4.93862 -0.42679,-7.43841c0,-1.09747 -0.06097,-2.13397 -0.06097,-3.23144c-0.12194,-3.04853 -0.18291,-5.97512 0.54874,-8.84074c0.06097,-0.06097 0.18291,-0.06097 0.24388,-0.12194l2.25591,0.97553c2.31688,0.97553 5.30444,1.46329 9.14559,1.46329c3.41435,0 7.07259,-0.36582 10.60889,-0.73165c3.23144,-0.30485 6.27997,-0.60971 8.96268,-0.60971c0.67068,0 1.28038,0 1.82912,0.06097c1.46329,0.12194 2.98756,0.30485 4.45085,0.42679c2.19494,0.24388 4.38988,0.54874 6.6458,0.54874c0.54874,0 1.09747,0 1.58524,0c3.96309,0 7.92618,-0.18291 11.76733,-0.36582c3.17047,-0.12194 6.46288,-0.30485 9.69433,-0.36582c5.48735,-0.06097 11.09665,-0.36582 16.46206,-0.60971c2.25591,-0.12194 4.45085,-0.24388 6.70677,-0.30485c4.38988,-0.18291 8.84074,-0.18291 13.16965,-0.18291c3.1095,0 6.40191,0 9.57238,-0.06097c6.6458,-0.18291 13.35256,-0.54874 19.87642,-0.97553c6.88968,-0.42679 14.02324,-0.85359 21.09583,-0.97553c1.76815,-0.06097 3.5363,-0.06097 5.24347,-0.06097c3.84115,-0.06097 7.86521,-0.06097 11.76733,-0.30485c2.31688,-0.12194 4.63377,-0.36582 6.88968,-0.54874c3.78018,-0.30485 7.74327,-0.67068 11.52344,-0.67068l0,0m0,-1.21941c-6.15803,0 -12.31606,0.85359 -18.47409,1.21941c-5.67027,0.30485 -11.34053,0.24388 -16.94983,0.36582c-13.65742,0.24388 -27.25386,1.58524 -40.97225,1.95106c-7.62133,0.18291 -15.18168,-0.06097 -22.80301,0.30485c-7.74327,0.30485 -15.42556,0.79262 -23.16883,0.91456c-7.13356,0.12194 -14.26712,0.73165 -21.46165,0.73165c-0.54874,0 -1.0365,0 -1.58524,0c-3.71921,-0.06097 -7.37744,-0.73165 -11.03568,-1.0365c-0.60971,-0.06097 -1.21941,-0.06097 -1.89009,-0.06097c-5.6093,0 -13.04771,1.34135 -19.51059,1.34135c-3.23144,0 -6.27997,-0.30485 -8.7188,-1.34135l-2.49979,-1.09747c-0.91456,0 -1.52427,0.60971 -1.52427,0.60971c-1.21941,4.26794 -0.60971,8.53588 -0.60971,12.80383c0.60971,12.19412 1.82912,23.77854 0.60971,35.97266c-0.60971,9.7553 -1.82912,19.51059 -3.04853,29.26589c-0.60971,4.26794 0.60971,9.14559 1.21941,13.41353c0.60971,6.09706 -2.43882,12.19412 -0.12194,17.80342c0.30485,0.73165 0.97553,2.80465 1.64621,3.29241c2.31688,-1.70718 3.65824,-6.15803 5.30444,-8.7188c2.13397,-3.29241 4.75571,-6.46288 7.2555,-9.3285c5.24347,-5.97512 10.66986,-11.8283 16.21818,-17.43759c2.49979,-2.49979 4.69474,-5.06056 7.92618,-6.58483c0.12194,1.34135 1.0365,2.43882 2.13397,3.1095c0.24388,0.12194 2.98756,2.073 3.29241,3.17047c0.60971,2.19494 10.42597,8.35297 12.25509,10.24306c2.37785,2.37785 4.32891,5.12153 6.34094,7.74327c4.38988,5.67027 9.14559,10.54791 14.57197,15.24265c12.98674,11.27956 27.07095,21.40068 39.08216,33.77771c3.90212,4.02406 6.6458,8.47491 11.09665,11.88927c2.31688,1.82912 6.6458,5.48735 9.51141,5.67027c-0.12194,-1.40232 0.36582,-2.74368 1.15844,-3.90212c4.32891,-6.34094 13.65742,-12.92577 21.09583,-14.08421c3.65824,-0.54874 7.49938,-1.09747 11.27956,-1.09747c0.30485,0 0.60971,0 0.97553,0c4.81668,0.12194 6.95065,2.80465 10.97471,4.32891c4.26794,1.58524 9.69433,6.03609 12.98674,9.38947c2.74368,2.80465 5.85318,5.67027 8.17006,8.65783c0.97553,1.28038 4.63377,7.56035 6.52385,7.56035c0,0 0.06097,0 0.06097,0c2.74368,-0.18291 2.073,-8.41394 1.46329,-10.12112l-0.42679,-10.48694c0.18291,-11.52344 -0.42679,-23.10786 -1.64621,-34.69227c-0.60971,-7.92618 1.21941,-15.85236 0.60971,-24.02242l0,-4.69474c-0.60971,-13.35256 -1.21941,-27.3758 -0.60971,-40.78933c1.21941,-12.80383 3.04853,-24.99795 3.04853,-37.80177c0,-2.43882 0,-4.87765 -0.12194,-7.19453c-0.06097,-1.58524 0.12194,-3.84115 1.52427,-4.87765c-1.09747,0.24388 -2.25591,0.30485 -3.41435,0.30485c-4.5728,0 -9.26753,-1.46329 -13.65742,-1.76815c-1.34135,0.12194 -2.68271,0.06097 -4.08503,0.06097l0,0l0.00003,0zm22.80301,1.09747c-0.67068,0 -1.21941,0.18291 -1.64621,0.48776c0.60971,-0.12194 1.21941,-0.30485 1.82912,-0.48776c-0.06097,0 -0.12194,0 -0.18291,0l0,0z' id='svg_4'/%3E%3Cpath class='st3' d='m235.75674,146.69126c-3.1095,3.41435 -4.38988,9.81627 -4.81668,14.20615c-0.60971,6.03609 -1.46329,10.97471 2.74368,15.66945c4.63377,5.12153 12.55994,9.87724 19.20574,11.64539c3.47532,0.97553 7.49938,-0.73165 10.7918,-1.40232c7.92618,-1.70718 11.95024,-6.52385 15.42556,-13.9013c4.20697,-8.77977 0.67068,-15.73042 -2.86562,-23.96145c-3.84115,-8.90171 -15.5475,-12.92577 -24.81504,-11.70636c-3.78018,0.48776 -5.91415,2.80465 -8.90171,4.87765c-1.64621,1.15844 -6.52385,2.80465 -6.76774,4.5728l0.00001,-0.00001z' id='svg_5'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E",width,height,alt:altText},props))}},"../../packages/js/components/src/search/index.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>search});__webpack_require__("../../node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/es.reflect.construct.js");var toConsumableArray=__webpack_require__("../../node_modules/.pnpm/@babel+runtime@7.23.5/node_modules/@babel/runtime/helpers/esm/toConsumableArray.js"),asyncToGenerator=__webpack_require__("../../node_modules/.pnpm/@babel+runtime@7.23.5/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js"),esm_typeof=__webpack_require__("../../node_modules/.pnpm/@babel+runtime@7.23.5/node_modules/@babel/runtime/helpers/esm/typeof.js"),classCallCheck=__webpack_require__("../../node_modules/.pnpm/@babel+runtime@7.23.5/node_modules/@babel/runtime/helpers/esm/classCallCheck.js"),createClass=__webpack_require__("../../node_modules/.pnpm/@babel+runtime@7.23.5/node_modules/@babel/runtime/helpers/esm/createClass.js"),assertThisInitialized=__webpack_require__("../../node_modules/.pnpm/@babel+runtime@7.23.5/node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js"),inherits=__webpack_require__("../../node_modules/.pnpm/@babel+runtime@7.23.5/node_modules/@babel/runtime/helpers/esm/inherits.js"),possibleConstructorReturn=__webpack_require__("../../node_modules/.pnpm/@babel+runtime@7.23.5/node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"),getPrototypeOf=__webpack_require__("../../node_modules/.pnpm/@babel+runtime@7.23.5/node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"),defineProperty=__webpack_require__("../../node_modules/.pnpm/@babel+runtime@7.23.5/node_modules/@babel/runtime/helpers/esm/defineProperty.js"),react=__webpack_require__("../../node_modules/.pnpm/react@18.3.1/node_modules/react/index.js"),regenerator=__webpack_require__("../../node_modules/.pnpm/@babel+runtime@7.23.5/node_modules/@babel/runtime/regenerator/index.js"),regenerator_default=__webpack_require__.n(regenerator),lodash=(__webpack_require__("../../node_modules/.pnpm/regenerator-runtime@0.13.11/node_modules/regenerator-runtime/runtime.js"),__webpack_require__("../../node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/es.function.bind.js"),__webpack_require__("../../node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/es.array.for-each.js"),__webpack_require__("../../node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/es.object.to-string.js"),__webpack_require__("../../node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/web.dom-collections.for-each.js"),__webpack_require__("../../node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/es.array.filter.js"),__webpack_require__("../../node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/es.promise.js"),__webpack_require__("../../node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/es.array.map.js"),__webpack_require__("../../node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/es.array.concat.js"),__webpack_require__("../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/lodash.js")),prop_types=__webpack_require__("../../node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/index.js"),prop_types_default=__webpack_require__.n(prop_types),classnames=__webpack_require__("../../node_modules/.pnpm/classnames@2.3.2/node_modules/classnames/index.js"),classnames_default=__webpack_require__.n(classnames),select_control=__webpack_require__("../../packages/js/components/src/select-control/index.tsx"),build_module=(__webpack_require__("../../node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/es.function.name.js"),__webpack_require__("../../node_modules/.pnpm/@wordpress+i18n@4.6.1/node_modules/@wordpress/i18n/build-module/index.js")),add_query_args=__webpack_require__("../../node_modules/.pnpm/@wordpress+url@3.7.1/node_modules/@wordpress/url/build-module/add-query-args.js"),api_fetch_build_module=__webpack_require__("../../node_modules/.pnpm/@wordpress+api-fetch@6.3.1/node_modules/@wordpress/api-fetch/build-module/index.js"),esm=__webpack_require__("../../node_modules/.pnpm/@automattic+interpolate-components@1.2.1_@types+react@17.0.71_react@17.0.2/node_modules/@automattic/interpolate-components/dist/esm/index.js"),html_entities_build_module=(__webpack_require__("../../node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/es.array.index-of.js"),__webpack_require__("../../node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/es.array.join.js"),__webpack_require__("../../node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/es.string.trim.js"),__webpack_require__("../../node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/es.date.to-string.js"),__webpack_require__("../../node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/es.regexp.to-string.js"),__webpack_require__("../../node_modules/.pnpm/@wordpress+html-entities@3.6.1/node_modules/@wordpress/html-entities/build-module/index.js"));function computeSuggestionMatch(suggestion,query){if(!query)return null;var indexOfMatch=suggestion.toLocaleLowerCase().indexOf(query.toLocaleLowerCase());return{suggestionBeforeMatch:(0,html_entities_build_module.S)(suggestion.substring(0,indexOfMatch)),suggestionMatch:(0,html_entities_build_module.S)(suggestion.substring(indexOfMatch,indexOfMatch+query.length)),suggestionAfterMatch:(0,html_entities_build_module.S)(suggestion.substring(indexOfMatch+query.length))}}function getTaxCode(tax){return[tax.country,tax.state,tax.name||(0,build_module.__)("TAX","woocommerce"),tax.priority].filter(Boolean).map((function(item){return null==item?void 0:item.toString().toUpperCase().trim()})).join("-")}var completer={name:"attributes",className:"woocommerce-search__product-result",options:function options(search){var query=search?{search,per_page:10,orderby:"count"}:{};return(0,api_fetch_build_module.A)({path:(0,add_query_args.F)("/wc-analytics/products/attributes",query)})},isDebounced:!0,getOptionIdentifier:function getOptionIdentifier(attribute){return attribute.id},getOptionKeywords:function getOptionKeywords(attribute){return[attribute.name]},getFreeTextOptions:function getFreeTextOptions(query){return[{key:"name",label:(0,react.createElement)("span",{key:"name",className:"woocommerce-search__result-name"},(0,esm.A)({mixedString:(0,build_module.__)("All attributes with names that include {{query /}}","woocommerce"),components:{query:(0,react.createElement)("strong",{className:"components-form-token-field__suggestion-match"},query)}})),value:{id:query,name:query}}]},getOptionLabel:function getOptionLabel(attribute,query){var match=computeSuggestionMatch(attribute.name,query);return(0,react.createElement)("span",{key:"name",className:"woocommerce-search__result-name","aria-label":attribute.name},null==match?void 0:match.suggestionBeforeMatch,(0,react.createElement)("strong",{className:"components-form-token-field__suggestion-match"},null==match?void 0:match.suggestionMatch),null==match?void 0:match.suggestionAfterMatch)},getOptionCompletion:function getOptionCompletion(attribute){return{key:attribute.id,label:attribute.name}}};const attributes=completer;var categories_completer={name:"categories",className:"woocommerce-search__product-result",options:function options(search){var query=search?{search,per_page:10,orderby:"count"}:{};return(0,api_fetch_build_module.A)({path:(0,add_query_args.F)("/wc-analytics/products/categories",query)})},isDebounced:!0,getOptionIdentifier:function getOptionIdentifier(category){return category.id},getOptionKeywords:function getOptionKeywords(cat){return[cat.name]},getFreeTextOptions:function getFreeTextOptions(query){return[{key:"title",label:(0,react.createElement)("span",{key:"name",className:"woocommerce-search__result-name"},(0,esm.A)({mixedString:(0,build_module.__)("All categories with titles that include {{query /}}","woocommerce"),components:{query:(0,react.createElement)("strong",{className:"components-form-token-field__suggestion-match"},query)}})),value:{id:query,name:query}}]},getOptionLabel:function getOptionLabel(cat,query){var match=computeSuggestionMatch(cat.name,query);return(0,react.createElement)("span",{key:"name",className:"woocommerce-search__result-name","aria-label":cat.name},null==match?void 0:match.suggestionBeforeMatch,(0,react.createElement)("strong",{className:"components-form-token-field__suggestion-match"},null==match?void 0:match.suggestionMatch),null==match?void 0:match.suggestionAfterMatch)},getOptionCompletion:function getOptionCompletion(cat){return{key:cat.id,label:cat.name}}};const categories=categories_completer;__webpack_require__("../../node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/es.array.is-array.js");var flag=__webpack_require__("../../packages/js/components/src/flag/index.js"),allCountries=null;const countries={name:"countries",className:"woocommerce-search__country-result",isDebounced:!0,options:function options(){return allCountries?Promise.resolve(allCountries):(0,api_fetch_build_module.A)({path:"/wc-analytics/data/countries"}).then((function(result){return function isCountries(value){return Array.isArray(value)&&value.length>0&&"object"===(0,esm_typeof.A)(value[0])&&"string"==typeof value[0].code&&"string"==typeof value[0].name}(result)?allCountries=result:(console.warn("Invalid countries response",result),[])}))},getOptionIdentifier:function getOptionIdentifier(country){return country.code},getSearchExpression:function getSearchExpression(query){return"^"+query},getOptionKeywords:function getOptionKeywords(country){return[country.code,(0,html_entities_build_module.S)(country.name)]},getOptionLabel:function getOptionLabel(country,query){var name=(0,html_entities_build_module.S)(country.name),match=computeSuggestionMatch(name,query);return(0,react.createElement)(react.Fragment,null,(0,react.createElement)(flag.A,{key:"thumbnail",className:"woocommerce-search__result-thumbnail",code:country.code,size:18,hideFromScreenReader:!0}),(0,react.createElement)("span",{key:"name",className:"woocommerce-search__result-name","aria-label":name},query?(0,react.createElement)(react.Fragment,null,null==match?void 0:match.suggestionBeforeMatch,(0,react.createElement)("strong",{className:"components-form-token-field__suggestion-match"},null==match?void 0:match.suggestionMatch),null==match?void 0:match.suggestionAfterMatch):name))},getOptionCompletion:function getOptionCompletion(country){return{key:country.code,label:(0,html_entities_build_module.S)(country.name)}}};var coupons_completer={name:"coupons",className:"woocommerce-search__coupon-result",options:function options(search){var query=search?{search,per_page:10}:{};return(0,api_fetch_build_module.A)({path:(0,add_query_args.F)("/wc-analytics/coupons",query)})},isDebounced:!0,getOptionIdentifier:function getOptionIdentifier(coupon){return coupon.id},getOptionKeywords:function getOptionKeywords(coupon){return[coupon.code]},getFreeTextOptions:function getFreeTextOptions(query){return[{key:"code",label:(0,react.createElement)("span",{key:"name",className:"woocommerce-search__result-name"},(0,esm.A)({mixedString:(0,build_module.__)("All coupons with codes that include {{query /}}","woocommerce"),components:{query:(0,react.createElement)("strong",{className:"components-form-token-field__suggestion-match"},query)}})),value:{id:query,code:query}}]},getOptionLabel:function getOptionLabel(coupon,query){var match=computeSuggestionMatch(coupon.code,query);return(0,react.createElement)("span",{key:"name",className:"woocommerce-search__result-name","aria-label":coupon.code},null==match?void 0:match.suggestionBeforeMatch,(0,react.createElement)("strong",{className:"components-form-token-field__suggestion-match"},null==match?void 0:match.suggestionMatch),null==match?void 0:match.suggestionAfterMatch)},getOptionCompletion:function getOptionCompletion(coupon){return{key:coupon.id,label:coupon.code}}};const coupons=coupons_completer;const customers={name:"customers",className:"woocommerce-search__customers-result",options:function options(name){var query=name?{search:name,searchby:"name",per_page:10}:{};return(0,api_fetch_build_module.A)({path:(0,add_query_args.F)("/wc-analytics/customers",query)})},isDebounced:!0,getOptionIdentifier:function getOptionIdentifier(customer){return customer.id},getOptionKeywords:function getOptionKeywords(customer){return[customer.name]},getFreeTextOptions:function getFreeTextOptions(query){return[{key:"name",label:(0,react.createElement)("span",{key:"name",className:"woocommerce-search__result-name"},(0,esm.A)({mixedString:(0,build_module.__)("All customers with names that include {{query /}}","woocommerce"),components:{query:(0,react.createElement)("strong",{className:"components-form-token-field__suggestion-match"},query)}})),value:{id:query,name:query}}]},getOptionLabel:function getOptionLabel(customer,query){var match=computeSuggestionMatch(customer.name,query);return(0,react.createElement)("span",{key:"name",className:"woocommerce-search__result-name","aria-label":customer.name},null==match?void 0:match.suggestionBeforeMatch,(0,react.createElement)("strong",{className:"components-form-token-field__suggestion-match"},null==match?void 0:match.suggestionMatch),null==match?void 0:match.suggestionAfterMatch)},getOptionCompletion:function getOptionCompletion(customer){return{key:customer.id,label:customer.name}}};const download_ips={name:"download-ips",className:"woocommerce-search__download-ip-result",options:function options(match){var query=match?{match}:{};return(0,api_fetch_build_module.A)({path:(0,add_query_args.F)("/wc-analytics/data/download-ips",query)})},isDebounced:!0,getOptionIdentifier:function getOptionIdentifier(download){return download.user_ip_address},getOptionKeywords:function getOptionKeywords(download){return[download.user_ip_address]},getOptionLabel:function getOptionLabel(download,query){var match=computeSuggestionMatch(download.user_ip_address,query);return(0,react.createElement)("span",{key:"name",className:"woocommerce-search__result-name","aria-label":download.user_ip_address},null==match?void 0:match.suggestionBeforeMatch,(0,react.createElement)("strong",{className:"components-form-token-field__suggestion-match"},null==match?void 0:match.suggestionMatch),null==match?void 0:match.suggestionAfterMatch)},getOptionCompletion:function getOptionCompletion(download){return{key:download.user_ip_address,label:download.user_ip_address}}};var emails_completer={name:"emails",className:"woocommerce-search__emails-result",options:function options(search){var query=search?{search,searchby:"email",per_page:10}:{};return(0,api_fetch_build_module.A)({path:(0,add_query_args.F)("/wc-analytics/customers",query)})},isDebounced:!0,getOptionIdentifier:function getOptionIdentifier(customer){return customer.id},getOptionKeywords:function getOptionKeywords(customer){return[customer.email]},getOptionLabel:function getOptionLabel(customer,query){var match=computeSuggestionMatch(customer.email,query);return(0,react.createElement)("span",{key:"name",className:"woocommerce-search__result-name","aria-label":customer.email},null==match?void 0:match.suggestionBeforeMatch,(0,react.createElement)("strong",{className:"components-form-token-field__suggestion-match"},null==match?void 0:match.suggestionMatch),null==match?void 0:match.suggestionAfterMatch)},getOptionCompletion:function getOptionCompletion(customer){return{key:customer.id,label:customer.email}}};const emails=emails_completer;var orders_completer={name:"orders",className:"woocommerce-search__order-result",options:function options(search){var query=search?{number:search,per_page:10}:{};return(0,api_fetch_build_module.A)({path:(0,add_query_args.F)("/wc-analytics/orders",query)})},isDebounced:!0,getOptionIdentifier:function getOptionIdentifier(order){return order.id},getOptionKeywords:function getOptionKeywords(order){return["#"+order.number]},getOptionLabel:function getOptionLabel(order,query){var match=computeSuggestionMatch("#"+order.number,query);return(0,react.createElement)("span",{key:"name",className:"woocommerce-search__result-name","aria-label":"#"+order.number},null==match?void 0:match.suggestionBeforeMatch,(0,react.createElement)("strong",{className:"components-form-token-field__suggestion-match"},null==match?void 0:match.suggestionMatch),null==match?void 0:match.suggestionAfterMatch)},getOptionCompletion:function getOptionCompletion(order){return{key:order.id,label:"#"+order.number}}};const orders=orders_completer;var product_image=__webpack_require__("../../packages/js/components/src/product-image/index.tsx"),product_completer={name:"products",className:"woocommerce-search__product-result",options:function options(search){var query=search?{search,per_page:10,orderby:"popularity"}:{};return(0,api_fetch_build_module.A)({path:(0,add_query_args.F)("/wc-analytics/products",query)})},isDebounced:!0,getOptionIdentifier:function getOptionIdentifier(product){return product.id},getOptionKeywords:function getOptionKeywords(product){return[product.name,product.sku]},getFreeTextOptions:function getFreeTextOptions(query){return[{key:"title",label:(0,react.createElement)("span",{key:"name",className:"woocommerce-search__result-name"},(0,esm.A)({mixedString:(0,build_module.__)("All products with titles that include {{query /}}","woocommerce"),components:{query:(0,react.createElement)("strong",{className:"components-form-token-field__suggestion-match"},query)}})),value:{id:query,name:query}}]},getOptionLabel:function getOptionLabel(product,query){var match=computeSuggestionMatch(product.name,query);return(0,react.createElement)(react.Fragment,null,(0,react.createElement)(product_image.A,{key:"thumbnail",className:"woocommerce-search__result-thumbnail",product,width:18,height:18,alt:""}),(0,react.createElement)("span",{key:"name",className:"woocommerce-search__result-name","aria-label":product.name},null==match?void 0:match.suggestionBeforeMatch,(0,react.createElement)("strong",{className:"components-form-token-field__suggestion-match"},null==match?void 0:match.suggestionMatch),null==match?void 0:match.suggestionAfterMatch))},getOptionCompletion:function getOptionCompletion(product){return{key:product.id,label:product.name}}};const product=product_completer;var taxes_completer={name:"taxes",className:"woocommerce-search__tax-result",options:function options(search){var query=search?{code:search,per_page:10}:{};return(0,api_fetch_build_module.A)({path:(0,add_query_args.F)("/wc-analytics/taxes",query)})},isDebounced:!0,getOptionIdentifier:function getOptionIdentifier(tax){return tax.id},getOptionKeywords:function getOptionKeywords(tax){return[tax.id,getTaxCode(tax)]},getFreeTextOptions:function getFreeTextOptions(query){return[{key:"code",label:(0,react.createElement)("span",{key:"name",className:"woocommerce-search__result-name"},(0,esm.A)({mixedString:(0,build_module.__)("All taxes with codes that include {{query /}}","woocommerce"),components:{query:(0,react.createElement)("strong",{className:"components-form-token-field__suggestion-match"},query)}})),value:{id:query,name:query}}]},getOptionLabel:function getOptionLabel(tax,query){var match=computeSuggestionMatch(getTaxCode(tax),query);return(0,react.createElement)("span",{key:"name",className:"woocommerce-search__result-name","aria-label":tax.code},null==match?void 0:match.suggestionBeforeMatch,(0,react.createElement)("strong",{className:"components-form-token-field__suggestion-match"},null==match?void 0:match.suggestionMatch),null==match?void 0:match.suggestionAfterMatch)},getOptionCompletion:function getOptionCompletion(tax){return{key:tax.id,label:getTaxCode(tax)}}};const taxes=taxes_completer;var usernames_completer={name:"usernames",className:"woocommerce-search__usernames-result",options:function options(search){var query=search?{search,searchby:"username",per_page:10}:{};return(0,api_fetch_build_module.A)({path:(0,add_query_args.F)("/wc-analytics/customers",query)})},isDebounced:!0,getOptionIdentifier:function getOptionIdentifier(customer){return customer.id},getOptionKeywords:function getOptionKeywords(customer){return[customer.username]},getOptionLabel:function getOptionLabel(customer,query){var match=computeSuggestionMatch(customer.username,query);return(0,react.createElement)("span",{key:"name",className:"woocommerce-search__result-name","aria-label":customer.username},null==match?void 0:match.suggestionBeforeMatch,(0,react.createElement)("strong",{className:"components-form-token-field__suggestion-match"},null==match?void 0:match.suggestionMatch),null==match?void 0:match.suggestionAfterMatch)},getOptionCompletion:function getOptionCompletion(customer){return{key:customer.id,label:customer.username}}};const usernames=usernames_completer;__webpack_require__("../../node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/es.object.keys.js"),__webpack_require__("../../node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/es.symbol.js"),__webpack_require__("../../node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/es.object.get-own-property-descriptor.js"),__webpack_require__("../../node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/es.object.get-own-property-descriptors.js"),__webpack_require__("../../node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/es.object.define-properties.js"),__webpack_require__("../../node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/es.object.define-property.js");function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,o)}return t}function _objectSpread(e){for(var r=1;r-1)return name;var attributeList=attributes.map((function(_ref2){return _ref2.option})).join(", ");return attributeList?name+separator+attributeList:name}var variations_completer={name:"variations",className:"woocommerce-search__product-result",options:function options(search){var query=search?{search,per_page:30,_fields:["attributes","description","id","name","sku"]}:{},product=(0,src.$Z)().products;return product?(product.includes(",")&&console.warn("Invalid product id supplied to Variations autocompleter"),(0,api_fetch_build_module.A)({path:(0,add_query_args.F)("/wc-analytics/products/".concat(product,"/variations"),query)})):(0,api_fetch_build_module.A)({path:(0,add_query_args.F)("/wc-analytics/variations",query)})},isDebounced:!0,getOptionIdentifier:function getOptionIdentifier(variation){return variation.id},getOptionKeywords:function getOptionKeywords(variation){return[getVariationName(variation),variation.sku]},getOptionLabel:function getOptionLabel(variation,query){var match=computeSuggestionMatch(getVariationName(variation),query);return(0,react.createElement)(react.Fragment,null,(0,react.createElement)(product_image.A,{key:"thumbnail",className:"woocommerce-search__result-thumbnail",product:variation,width:18,height:18,alt:""}),(0,react.createElement)("span",{key:"name",className:"woocommerce-search__result-name","aria-label":variation.description},null==match?void 0:match.suggestionBeforeMatch,(0,react.createElement)("strong",{className:"components-form-token-field__suggestion-match"},null==match?void 0:match.suggestionMatch),null==match?void 0:match.suggestionAfterMatch))},getOptionCompletion:function getOptionCompletion(variation){return{key:variation.id,label:getVariationName(variation)}}};const variations=variations_completer;function _createSuper(Derived){var hasNativeReflectConstruct=function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=(0,getPrototypeOf.A)(Derived);if(hasNativeReflectConstruct){var NewTarget=(0,getPrototypeOf.A)(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return(0,possibleConstructorReturn.A)(this,result)}}var Search=function(_Component){(0,inherits.A)(Search,_Component);var _super=_createSuper(Search);function Search(props){var _this;return(0,classCallCheck.A)(this,Search),(_this=_super.call(this,props)).state={options:[]},_this.appendFreeTextSearch=_this.appendFreeTextSearch.bind((0,assertThisInitialized.A)(_this)),_this.fetchOptions=_this.fetchOptions.bind((0,assertThisInitialized.A)(_this)),_this.updateSelected=_this.updateSelected.bind((0,assertThisInitialized.A)(_this)),_this}return(0,createClass.A)(Search,[{key:"getAutocompleter",value:function getAutocompleter(){switch(this.props.type){case"attributes":return attributes;case"categories":return categories;case"countries":return countries;case"coupons":return coupons;case"customers":return customers;case"downloadIps":return download_ips;case"emails":return emails;case"orders":return orders;case"products":return product;case"taxes":return taxes;case"usernames":return usernames;case"variableProducts":return variable_product;case"variations":return variations;case"custom":if(!this.props.autocompleter||"object"!==(0,esm_typeof.A)(this.props.autocompleter))throw new Error("Invalid autocompleter provided to Search component, it requires a completer object when using 'custom' type.");return this.props.autocompleter;default:throw new Error("No autocompleter found for type: ".concat(this.props.type))}}},{key:"getFormattedOptions",value:function getFormattedOptions(options,query){var autocompleter=this.getAutocompleter(),formattedOptions=[];return options.forEach((function(option){var formattedOption={key:autocompleter.getOptionIdentifier(option),label:autocompleter.getOptionLabel(option,query),keywords:autocompleter.getOptionKeywords(option).filter(Boolean),value:option};formattedOptions.push(formattedOption)})),formattedOptions}},{key:"fetchOptions",value:function fetchOptions(previousOptions,query){var _this2=this;if(!query)return[];var autocompleterOptions=this.getAutocompleter().options;return Promise.resolve("function"==typeof autocompleterOptions?autocompleterOptions(query):autocompleterOptions||[]).then(function(){var _ref=(0,asyncToGenerator.A)(regenerator_default().mark((function _callee(response){var options;return regenerator_default().wrap((function _callee$(_context){for(;;)switch(_context.prev=_context.next){case 0:return options=_this2.getFormattedOptions(response,query),_this2.setState({options}),_context.abrupt("return",options);case 3:case"end":return _context.stop()}}),_callee)})));return function(_x){return _ref.apply(this,arguments)}}())}},{key:"updateSelected",value:function updateSelected(selected){var _this$props$onChange=this.props.onChange,onChange=void 0===_this$props$onChange?function(_option){}:_this$props$onChange,autocompleter=this.getAutocompleter();onChange(selected.map((function(option){return option.value?autocompleter.getOptionCompletion(option.value):option})))}},{key:"appendFreeTextSearch",value:function appendFreeTextSearch(options,query){var allowFreeTextSearch=this.props.allowFreeTextSearch;if(!query||!query.length)return[];var autocompleter=this.getAutocompleter();return allowFreeTextSearch&&"function"==typeof autocompleter.getFreeTextOptions?[].concat((0,toConsumableArray.A)(autocompleter.getFreeTextOptions(query)),(0,toConsumableArray.A)(options)):options}},{key:"render",value:function render(){var autocompleter=this.getAutocompleter(),_this$props=this.props,className=_this$props.className,inlineTags=_this$props.inlineTags,placeholder=_this$props.placeholder,selected=_this$props.selected,showClearButton=_this$props.showClearButton,staticResults=_this$props.staticResults,disabled=_this$props.disabled,multiple=_this$props.multiple,options=this.state.options,inputType=autocompleter.inputType?autocompleter.inputType:"text";return(0,react.createElement)("div",null,(0,react.createElement)(select_control.A,{className:classnames_default()("woocommerce-search",className,{"is-static-results":staticResults}),disabled,hideBeforeSearch:!0,inlineTags,isSearchable:!0,getSearchExpression:autocompleter.getSearchExpression,multiple,placeholder,onChange:this.updateSelected,onFilter:this.appendFreeTextSearch,onSearch:this.fetchOptions,options,searchDebounceTime:500,searchInputType:inputType,selected,showClearButton}))}}]),Search}(react.Component);(0,defineProperty.A)(Search,"propTypes",{allowFreeTextSearch:prop_types_default().bool,className:prop_types_default().string,onChange:prop_types_default().func,type:prop_types_default().oneOf(["attributes","categories","countries","coupons","customers","downloadIps","emails","orders","products","taxes","usernames","variableProducts","variations","custom"]).isRequired,autocompleter:prop_types_default().object,placeholder:prop_types_default().string,selected:prop_types_default().oneOfType([prop_types_default().string,prop_types_default().arrayOf(prop_types_default().shape({key:prop_types_default().oneOfType([prop_types_default().number,prop_types_default().string]).isRequired,label:prop_types_default().string}))]),inlineTags:prop_types_default().bool,showClearButton:prop_types_default().bool,staticResults:prop_types_default().bool,disabled:prop_types_default().bool,multiple:prop_types_default().bool}),(0,defineProperty.A)(Search,"defaultProps",{allowFreeTextSearch:!1,onChange:lodash.noop,selected:[],inlineTags:!1,showClearButton:!1,staticResults:!1,disabled:!1,multiple:!0});const search=Search;try{Search.displayName="Search",Search.__docgenInfo={description:"A search box which autocompletes results while typing, allowing for the user to select an existing object\n(product, order, customer, etc). Currently only products are supported.",displayName:"Search",props:{type:{defaultValue:null,description:"",name:"type",required:!0,type:{name:"enum",value:[{value:'"products"'},{value:'"countries"'},{value:'"categories"'},{value:'"custom"'},{value:'"attributes"'},{value:'"coupons"'},{value:'"customers"'},{value:'"downloadIps"'},{value:'"emails"'},{value:'"orders"'},{value:'"taxes"'},{value:'"usernames"'},{value:'"variableProducts"'},{value:'"variations"'}]}},allowFreeTextSearch:{defaultValue:{value:"false"},description:"",name:"allowFreeTextSearch",required:!1,type:{name:"boolean"}},className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},onChange:{defaultValue:null,description:"",name:"onChange",required:!1,type:{name:"((value: Option | OptionCompletionValue[]) => void)"}},autocompleter:{defaultValue:null,description:"",name:"autocompleter",required:!1,type:{name:"AutoCompleter"}},placeholder:{defaultValue:null,description:"",name:"placeholder",required:!1,type:{name:"string"}},selected:{defaultValue:{value:"[]"},description:"",name:"selected",required:!1,type:{name:"string | { key: string | number; label?: string; }[]"}},inlineTags:{defaultValue:{value:"false"},description:"",name:"inlineTags",required:!1,type:{name:"boolean"}},showClearButton:{defaultValue:{value:"false"},description:"",name:"showClearButton",required:!1,type:{name:"boolean"}},staticResults:{defaultValue:{value:"false"},description:"",name:"staticResults",required:!1,type:{name:"boolean"}},disabled:{defaultValue:{value:"false"},description:"",name:"disabled",required:!1,type:{name:"boolean"}},multiple:{defaultValue:{value:"true"},description:"",name:"multiple",required:!1,type:{name:"boolean"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["../../packages/js/components/src/search/index.tsx#Search"]={docgenInfo:Search.__docgenInfo,name:"Search",path:"../../packages/js/components/src/search/index.tsx#Search"})}catch(__react_docgen_typescript_loader_error){}}}]);