@sledge-app/react-instant-search 0.0.64 → 0.0.65
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./vendor-024ba8ae.cjs"),t=require("react"),s=require("@sledge-app/core");require("react-dom");const i="https://sledge-api-preprod.offstack.io",n="sledge-auth-app",l="sledge-instant-search-auth-app",r="sledge-wishlist-setting",o="sledge-product-review-setting",d="sledge-instant-search-setting",a="/pages/search-result",u={ELEMENT_WIDGET:"product-review-widget"},c=e=>{if(!e)return"";let t=String(e);if(t.includes("shopify")&&t.includes("/")){let e=t.split("/");return e[e.length-1]||t}return t},x=e=>"function"==typeof e,p=(e,t)=>{if(e){var s=(null==e?void 0:e.getBoundingClientRect().top)+window.scrollY-t;window.scrollTo({top:s,behavior:"smooth"})}},m=({trigger:s,content:i,isOpen:n,setIsOpen:l,hideCloseIcon:r,align:o,className:d,withOpenState:a=!0,withArrow:u=!0,customArrow:c="",sideOffset:x=5,alignOffset:p=0})=>{const[m,h]=t.useState(!!a&&n);return t.useEffect((()=>{var e;let t=null==(e=null==document?void 0:document.querySelector(".PopoverArrow"))?void 0:e.parentElement;t&&(null==c?void 0:c.length)&&(t.style.display="inline-flex",t.innerHTML=c)}),[m]),e.jsxRuntimeExports.jsxs(e.$cb5cc270b50c6fcd$export$be92b6f5f03c0fe9,{...a&&{open:n},...l&&{onOpenChange:e=>{h(e),l(e)}},children:[e.jsxRuntimeExports.jsx(e.$cb5cc270b50c6fcd$export$41fb9f06171c75f4,{asChild:!0,children:s}),e.jsxRuntimeExports.jsx(e.$cb5cc270b50c6fcd$export$602eac185826482c,{children:e.jsxRuntimeExports.jsxs(e.$cb5cc270b50c6fcd$export$7c6e2c02157bb7d2,{className:`sledge__popover-content ${d||""}`,sideOffset:x,alignOffset:p,align:o,...l&&{onOpenAutoFocus:()=>l(!0),onCloseAutoFocus:()=>l(!1)},children:[i,!r&&e.jsxRuntimeExports.jsx(e.$cb5cc270b50c6fcd$export$f39c2d165cd861fe,{className:"PopoverClose","aria-label":"Close",children:e.jsxRuntimeExports.jsx("svg",{width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsxRuntimeExports.jsx("path",{d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})}),u?e.jsxRuntimeExports.jsx(e.$cb5cc270b50c6fcd$export$21b07c8f274aebd5,{className:"PopoverArrow"}):null]})})]})},h=({value:s,total:i,fillColor:n="",outlineColor:l=""})=>{const[r,o]=t.useState(0);return t.useEffect((()=>{const e=setTimeout((()=>o(+s/i*100)),150);return()=>clearTimeout(e)}),[]),e.jsxRuntimeExports.jsx(e.$67824d98245208a0$export$be92b6f5f03c0fe9,{className:"sledge__progress",value:r,style:l?{borderWidth:"1px",borderStyle:"solid",borderColor:l}:{},children:e.jsxRuntimeExports.jsx(e.$67824d98245208a0$export$adb584737d712b70,{className:"ProgressIndicator",style:{transform:`translateX(-${100-r}%)`,...n&&{backgroundColor:n}}})})},g=({id:t,name:s,value:i,required:n,label:l,defaultChecked:r,labelStyle:o={},onClick:d})=>e.jsxRuntimeExports.jsxs("div",{className:"sledge__checkbox-wrapper",children:[e.jsxRuntimeExports.jsx(e.$e698a72e93240346$export$be92b6f5f03c0fe9,{className:"sledge__checkbox-root",defaultChecked:r,id:t,name:s,value:i,required:n,onClick:d,children:e.jsxRuntimeExports.jsx(e.$e698a72e93240346$export$adb584737d712b70,{className:"sledge__checkbox-indicator",children:e.jsxRuntimeExports.jsx("svg",{width:10,height:8,viewBox:"0 0 10 8",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.72318 0.237414C10.0707 0.574491 10.0942 1.14584 9.77561 1.51356L4.40976 7.70711C4.25243 7.88871 4.03181 7.99443 3.79903 7.99979C3.56625 8.00514 3.3415 7.90965 3.17686 7.73545L0.250031 4.63868C-0.0833435 4.28595 -0.0833435 3.71406 0.250031 3.36133C0.583405 3.00859 1.12391 3.00859 1.45729 3.36133L3.75367 5.79105L8.51706 0.292899C8.83564 -0.0748211 9.37564 -0.0996624 9.72318 0.237414Z",fill:"white"})})})}),l&&e.jsxRuntimeExports.jsx("label",{className:"sledge__checkbox-label",htmlFor:t,style:o,children:l})]}),j=s=>{const{defaultValue:i,min:n,max:l,step:r=1,setValueCommit:o,setValueChange:d}=s,[a,u]=t.useState(i);return e.jsxRuntimeExports.jsx("form",{children:e.jsxRuntimeExports.jsxs(e.$faa2e61a3361514f$export$be92b6f5f03c0fe9,{className:"sledge__SliderRoot",defaultValue:i,min:n,max:l,step:r,"aria-label":"Volume",onValueCommit:e=>{o&&o(e),u(e)},onValueChange:e=>{d&&d(e),u(e)},children:[e.jsxRuntimeExports.jsx(e.$faa2e61a3361514f$export$13921ac0cc260818,{className:"sledge__SliderTrack",children:e.jsxRuntimeExports.jsx(e.$faa2e61a3361514f$export$9a58ef0d7ad3278c,{className:"sledge__SliderRange"})}),e.jsxRuntimeExports.jsx(G,{content:a[0],customArrow:'<svg width="19" height="5" viewBox="0 0 19 5" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M9 4.99998C9 9.48298e-05 16.4996 1.99678e-05 18.4999 0L9 2.2985e-06L0.5 2.04891e-06C9 2.2985e-06 9 4.99998 9 4.99998Z" fill="#23BC45"/></svg>',wrapTrigger:!1,children:e.jsxRuntimeExports.jsx(e.$faa2e61a3361514f$export$6521433ed15a34db,{className:"sledge__SliderThumb"})}),e.jsxRuntimeExports.jsx(G,{content:a[1],customArrow:'<svg width="19" height="5" viewBox="0 0 19 5" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M9 4.99998C9 9.48298e-05 16.4996 1.99678e-05 18.4999 0L9 2.2985e-06L0.5 2.04891e-06C9 2.2985e-06 9 4.99998 9 4.99998Z" fill="#23BC45"/></svg>',wrapTrigger:!1,children:e.jsxRuntimeExports.jsx(e.$faa2e61a3361514f$export$6521433ed15a34db,{className:"sledge__SliderThumb"})})]})})},v=({currentPage:t,totalPage:s,totalResult:i,onChange:n})=>{const l=1===t,r=t===s;return e.jsxRuntimeExports.jsxs("div",{className:"sledge__pagination",children:[e.jsxRuntimeExports.jsx("button",{type:"button",className:"sledge__pagination-navigation",...l?{disabled:!0}:{onClick:()=>n(t-1)},children:e.jsxRuntimeExports.jsx(y,{width:17,height:17,color:"black"})}),e.jsxRuntimeExports.jsxs("span",{children:["Page ",t," of ",s," - total ",i," result"]}),e.jsxRuntimeExports.jsx("button",{type:"button",className:"sledge__pagination-navigation",...r?{disabled:!0}:{onClick:()=>n(t+1)},children:e.jsxRuntimeExports.jsx(b,{width:17,height:17,color:"black"})})]})},_=({id:t,name:s,required:i,defaultValue:n,items:l,labelStyle:r={},onValueChange:o})=>e.jsxRuntimeExports.jsx("div",{className:"sledge__radio-group-wrapper",children:e.jsxRuntimeExports.jsx("form",{children:e.jsxRuntimeExports.jsx(e.$f99a8c78507165f7$export$be92b6f5f03c0fe9,{className:"sledge__radio-group-root","aria-label":"View density",defaultValue:n,id:t,name:s,required:i,onValueChange:o,children:l.map(((s,i)=>{const{label:n,value:l}=s;return e.jsxRuntimeExports.jsxs("div",{className:"sledge__radio-group-item-flex",children:[e.jsxRuntimeExports.jsx(e.$f99a8c78507165f7$export$6d08773d2e66f8f2,{className:"sledge__radio-group-item",value:l,id:`${t}${i}`,children:e.jsxRuntimeExports.jsx(e.$f99a8c78507165f7$export$adb584737d712b70,{className:"sledge__radio-group-indicator"})}),e.jsxRuntimeExports.jsx("label",{className:"sledge__radio-group-label",htmlFor:`${t}${i}`,style:r,children:n})]},i)}))})})}),w=({id:t,name:s,value:i,rgb:n,image:l,required:r,defaultChecked:o,onClick:d})=>{const a={...(null==l?void 0:l.length)?{backgroundImage:`url(${l})`}:{backgroundColor:n}};return e.jsxRuntimeExports.jsx("div",{className:"sledge__color-swatch-wrapper",children:e.jsxRuntimeExports.jsx(e.$e698a72e93240346$export$be92b6f5f03c0fe9,{className:"sledge__color-swatch-root",defaultChecked:o,id:t,name:s,value:i,required:r,onClick:d,style:a})})},f=({name:t,placeholder:s,required:i,defaultValue:n,items:l,labelStyle:r={},onValueChange:o})=>e.jsxRuntimeExports.jsx("div",{className:"sledge__select-wrapper",children:e.jsxRuntimeExports.jsxs(e.$cc7e05a45900e73f$export$be92b6f5f03c0fe9,{name:t,required:i,onValueChange:o,children:[e.jsxRuntimeExports.jsxs(e.$cc7e05a45900e73f$export$41fb9f06171c75f4,{className:"sledge__select-trigger",children:[e.jsxRuntimeExports.jsx(e.$cc7e05a45900e73f$export$4c8d1a57a761ef94,{placeholder:s}),e.jsxRuntimeExports.jsx(e.$cc7e05a45900e73f$export$f04a61298a47a40f,{className:"sledge__select-icon",children:e.jsxRuntimeExports.jsx("svg",{width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsxRuntimeExports.jsx("path",{d:"M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})})]}),e.jsxRuntimeExports.jsx(e.$cc7e05a45900e73f$export$602eac185826482c,{children:e.jsxRuntimeExports.jsxs(e.$cc7e05a45900e73f$export$7c6e2c02157bb7d2,{className:"sledge__select-content",children:[e.jsxRuntimeExports.jsx(e.$cc7e05a45900e73f$export$2f60d3ec9ad468f2,{className:"sledge__select-scroll-button",children:e.jsxRuntimeExports.jsx("svg",{width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsxRuntimeExports.jsx("path",{d:"M3.13523 8.84197C3.3241 9.04343 3.64052 9.05363 3.84197 8.86477L7.5 5.43536L11.158 8.86477C11.3595 9.05363 11.6759 9.04343 11.8648 8.84197C12.0536 8.64051 12.0434 8.32409 11.842 8.13523L7.84197 4.38523C7.64964 4.20492 7.35036 4.20492 7.15803 4.38523L3.15803 8.13523C2.95657 8.32409 2.94637 8.64051 3.13523 8.84197Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})}),e.jsxRuntimeExports.jsx(e.$cc7e05a45900e73f$export$d5c6c08dc2d3ca7,{className:"sledge__select-viewport",children:l.map(((t,s)=>{const{label:i,value:n}=t;return e.jsxRuntimeExports.jsx(R,{value:n,children:i},s)}))}),e.jsxRuntimeExports.jsx(e.$cc7e05a45900e73f$export$bf1aedc3039c8d63,{className:"sledge__select-scroll-button",children:e.jsxRuntimeExports.jsx("svg",{width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsxRuntimeExports.jsx("path",{d:"M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})})]})})]})}),R=t.forwardRef((({children:t,className:s="",...i},n)=>e.jsxRuntimeExports.jsxs(e.$cc7e05a45900e73f$export$6d08773d2e66f8f2,{className:`sledge__select-item ${s}`,...i,ref:n,children:[e.jsxRuntimeExports.jsx(e.$cc7e05a45900e73f$export$d6e5bf9c43ea9319,{children:t}),e.jsxRuntimeExports.jsx(e.$cc7e05a45900e73f$export$c3468e2714d175fa,{className:"sledge__select-item-indicator",children:e.jsxRuntimeExports.jsx("svg",{width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsxRuntimeExports.jsx("path",{d:"M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})})]}))),E=({width:t,height:s,type:i,color:n})=>e.jsxRuntimeExports.jsx("span",{className:"sledge-icon__heart",children:"outline"===i?e.jsxRuntimeExports.jsx("svg",{width:t,height:s,id:"sledge-icon-heart-line",viewBox:"0 0 18 17",fill:n,children:e.jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.19515 0.86581C10.5501 0.00914308 12.3501 -0.227524 13.9051 0.27081C17.2876 1.36164 18.3376 5.04914 17.3985 7.98331C15.9493 12.5916 9.76015 16.0291 9.49765 16.1733C9.40431 16.225 9.30098 16.2508 9.19765 16.2508C9.09431 16.2508 8.99181 16.2258 8.89848 16.175C8.63765 16.0325 2.49348 12.6458 0.995979 7.98414L0.995146 7.98331C0.0551462 5.04831 1.10181 1.35998 4.48098 0.27081C6.06765 -0.242524 7.79681 -0.0166903 9.19515 0.86581ZM4.86431 1.46081C2.13015 2.34248 1.44348 5.28331 2.18598 7.60248C3.35431 11.2375 7.97015 14.1766 9.19681 14.9041C10.4276 14.1691 15.0768 11.1975 16.2076 7.60581C16.9501 5.28414 16.261 2.34331 13.5226 1.46081C12.196 1.03498 10.6485 1.29414 9.58015 2.12081C9.35681 2.29248 9.04681 2.29581 8.82181 2.12581C7.69015 1.27498 6.21181 1.02581 4.86431 1.46081ZM12.7226 3.11573C13.8585 3.48323 14.6543 4.48906 14.7518 5.67823C14.7793 6.02239 14.5235 6.32406 14.1793 6.35156C14.1618 6.35323 14.1451 6.35406 14.1276 6.35406C13.8051 6.35406 13.5318 6.10656 13.5051 5.77989C13.4501 5.09489 12.9918 4.51656 12.3393 4.30573C12.0101 4.19906 11.8301 3.84656 11.936 3.51906C12.0435 3.19073 12.3926 3.01239 12.7226 3.11573Z"})}):e.jsxRuntimeExports.jsx("svg",{width:t,height:s,id:"sledge-icon-heart-fill",viewBox:"0 0 18 17",fill:n,children:e.jsxRuntimeExports.jsx("path",{d:"M5.89936 0.0838691C6.42436 0.0998355 6.9327 0.191502 7.4252 0.359002H7.47436C7.5077 0.374836 7.5327 0.392336 7.54936 0.408169C7.73353 0.467336 7.9077 0.534002 8.07436 0.625669L8.39103 0.767336C8.51603 0.834002 8.66603 0.958169 8.74936 1.009C8.8327 1.05817 8.92436 1.109 8.99936 1.1665C9.9252 0.459002 11.0494 0.0756688 12.2077 0.0838691C12.7335 0.0838691 13.2585 0.158169 13.7577 0.325669C16.8335 1.32567 17.9419 4.70067 17.016 7.65067C16.491 9.15817 15.6327 10.534 14.5085 11.6582C12.8994 13.2165 11.1335 14.5998 9.2327 15.7915L9.02436 15.9173L8.8077 15.7832C6.9002 14.5998 5.12436 13.2165 3.5002 11.6498C2.38353 10.5257 1.52436 9.15817 0.991029 7.65067C0.0493627 4.70067 1.1577 1.32567 4.26686 0.308169C4.50853 0.224836 4.7577 0.166502 5.0077 0.134002H5.1077C5.34186 0.0998355 5.57436 0.0838691 5.8077 0.0838691H5.89936ZM13.3244 2.71734C12.9827 2.59984 12.6077 2.784 12.4827 3.134C12.366 3.484 12.5494 3.86734 12.8994 3.9915C13.4335 4.1915 13.791 4.71734 13.791 5.29984V5.32567C13.7752 5.5165 13.8327 5.70067 13.9494 5.84234C14.066 5.984 14.241 6.0665 14.4244 6.084C14.766 6.07484 15.0577 5.80067 15.0827 5.44984V5.35067C15.1077 4.18317 14.4002 3.12567 13.3244 2.71734Z"})})}),C=({width:t,height:s,color:i})=>e.jsxRuntimeExports.jsx("span",{className:"sledge-icon__arrow-down",children:e.jsxRuntimeExports.jsx("svg",{width:t,height:s,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsxRuntimeExports.jsx("g",{id:"Arrow - Down 2",children:e.jsxRuntimeExports.jsx("g",{id:"Iconly/Light-Outline/Arrow---Down-2",children:e.jsxRuntimeExports.jsx("g",{id:"Arrow---Down-2",children:e.jsxRuntimeExports.jsx("path",{id:"Stroke-1",d:"M3.72407 6.6414C3.94596 6.41951 4.29318 6.39934 4.53786 6.58089L4.60796 6.6414L9.99935 12.0325L15.3907 6.6414C15.6126 6.41951 15.9598 6.39934 16.2045 6.58089L16.2746 6.6414C16.4965 6.86329 16.5167 7.21051 16.3351 7.45519L16.2746 7.52529L10.4413 13.3586C10.2194 13.5805 9.87218 13.6007 9.62751 13.4191L9.55741 13.3586L3.72407 7.52529C3.48 7.28121 3.48 6.88548 3.72407 6.6414Z",fill:i})})})})})}),y=({width:t,height:s,color:i})=>e.jsxRuntimeExports.jsx("span",{className:"sledge-icon__arrow-left",children:e.jsxRuntimeExports.jsx("svg",{width:t,height:s,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsxRuntimeExports.jsx("path",{d:"M10.6875 2.97945C10.865 3.15697 10.8812 3.43474 10.7359 3.63048L10.6875 3.68656L6.37465 7.99967L10.6875 12.3128C10.865 12.4903 10.8812 12.7681 10.7359 12.9638L10.6875 13.0199C10.51 13.1974 10.2323 13.2135 10.0365 13.0683L9.98043 13.0199L5.31377 8.35323C5.13625 8.17572 5.12012 7.89794 5.26535 7.7022L5.31377 7.64612L9.98043 2.97945C10.1757 2.78419 10.4923 2.78419 10.6875 2.97945Z",fill:i})})}),b=({width:t,height:s,color:i})=>e.jsxRuntimeExports.jsx("span",{className:"sledge-icon__arrow-right",children:e.jsxRuntimeExports.jsx("svg",{width:t,height:s,viewBox:"0 0 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsxRuntimeExports.jsx("path",{d:"M5.60738 13.1302C5.42987 12.9527 5.41374 12.675 5.55897 12.4792L5.60738 12.4231L9.92027 8.11002L5.60738 3.79691C5.42987 3.6194 5.41374 3.34162 5.55897 3.14588L5.60738 3.0898C5.7849 2.91229 6.06267 2.89615 6.25841 3.04139L6.31449 3.0898L10.9812 7.75647C11.1587 7.93398 11.1748 8.21175 11.0296 8.4075L10.9812 8.46357L6.31449 13.1302C6.11923 13.3255 5.80265 13.3255 5.60738 13.1302Z",fill:i})})}),N=({width:t,height:s,color:i})=>e.jsxRuntimeExports.jsx("span",{className:"sledge-icon__bag",children:e.jsxRuntimeExports.jsx("svg",{width:t,height:s,viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M19.6334 3.33398C23.9899 3.33398 27.5887 6.65342 28.0324 10.8989L28.1562 10.9003C30.5729 10.9003 33.5112 12.5053 34.5029 17.007L35.8179 27.1853C36.2896 30.4703 35.6996 33.1053 34.0612 34.9953C32.4312 36.8753 29.8512 37.8703 26.5996 37.8703H12.6862C9.11458 37.8703 6.62625 36.9953 5.07792 35.197C3.52292 33.3936 3.00292 30.6886 3.53292 27.1586L4.82625 17.1153C5.67625 12.5103 8.78458 10.9003 11.1912 10.9003C11.399 8.98444 12.2629 7.16182 13.6334 5.79565C15.2084 4.23065 17.3801 3.33398 19.5984 3.33398H19.6334ZM28.1562 13.4003H11.1912C10.4562 13.4003 7.99958 13.697 7.29458 17.5036L6.00792 27.5036C5.58958 30.3086 5.91292 32.3386 6.97125 33.567C8.01625 34.7803 9.88625 35.3703 12.6862 35.3703H26.5996C28.3462 35.3703 30.7312 35.022 32.1712 33.3586C33.3146 32.0403 33.7079 30.077 33.3412 27.522L32.0429 17.4353C31.4896 14.9503 30.0296 13.4003 28.1562 13.4003ZM24.4942 18.0405C25.1842 18.0405 25.7826 18.6005 25.7826 19.2905C25.7826 19.9805 25.2609 20.5405 24.5709 20.5405H24.4942C23.8042 20.5405 23.2442 19.9805 23.2442 19.2905C23.2442 18.6005 23.8042 18.0405 24.4942 18.0405ZM14.7774 18.0405C15.4674 18.0405 16.0657 18.6005 16.0657 19.2905C16.0657 19.9805 15.5424 20.5405 14.8524 20.5405H14.7774C14.0874 20.5405 13.5274 19.9805 13.5274 19.2905C13.5274 18.6005 14.0874 18.0405 14.7774 18.0405ZM19.6284 5.83398H19.6034C18.0351 5.83398 16.5067 6.46565 15.3984 7.56732C14.4956 8.46609 13.9051 9.64764 13.7141 10.8995L25.5129 10.9C25.0846 8.03628 22.6082 5.83398 19.6284 5.83398Z",fill:i})})}),S=({width:t,height:s,color:i})=>e.jsxRuntimeExports.jsx("span",{className:"sledge-icon__search",children:e.jsxRuntimeExports.jsx("svg",{width:t,height:s,viewBox:"0 0 20 21",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.78283 2.16669C14.2578 2.16669 17.8978 5.80669 17.8978 10.2817C17.8978 12.393 17.0876 14.3186 15.7617 15.7638L18.3707 18.3673C18.6148 18.6114 18.6157 19.0064 18.3715 19.2506C18.2498 19.3739 18.089 19.4348 17.929 19.4348C17.7698 19.4348 17.6098 19.3739 17.4873 19.2523L14.8469 16.6192C13.4579 17.7316 11.6967 18.3975 9.78283 18.3975C5.30783 18.3975 1.66699 14.7567 1.66699 10.2817C1.66699 5.80669 5.30783 2.16669 9.78283 2.16669ZM9.78283 3.41669C5.99699 3.41669 2.91699 6.49585 2.91699 10.2817C2.91699 14.0675 5.99699 17.1475 9.78283 17.1475C13.5678 17.1475 16.6478 14.0675 16.6478 10.2817C16.6478 6.49585 13.5678 3.41669 9.78283 3.41669Z",fill:i})})}),L=t.forwardRef(((t,s)=>{const{className:i="",children:n,colorType:l="light",fullWidth:r=!1,elementType:o="button",link:d="",...a}=t;return"hyperlink"===o&&(null==d?void 0:d.length)?e.jsxRuntimeExports.jsx("a",{href:d,className:`sledge__button ${i||""}`,"data-button-color-type":l,"data-button-full-width":r,ref:s,...a,children:n}):e.jsxRuntimeExports.jsx("button",{className:`sledge__button ${i||""}`,"data-button-color-type":l,"data-button-full-width":r,ref:s,...a,children:n})})),$=s=>{const{className:i="",icon:n,value:l="",withClearField:r,onChange:o,onResetField:d,fieldRef:a,...u}=s,[c,x]=t.useState(!1);return t.useEffect((()=>{x(Boolean(l))}),[l]),e.jsxRuntimeExports.jsxs("div",{className:`sledge__search-input-field-wrapper ${i||""}`,children:[n?e.jsxRuntimeExports.jsx("div",{className:"sledge__search-input-field-icon",children:n}):null,e.jsxRuntimeExports.jsx("input",{className:"sledge__search-input-field",value:l,onChange:e=>(e=>{o&&o({value:e.target.value})})(e),ref:a,...u}),c&&r?e.jsxRuntimeExports.jsx("div",{className:"sledge__clear-field-wrapper",children:e.jsxRuntimeExports.jsx("button",{className:"sledge__clear-field",type:"button",onClick:()=>{(null==a?void 0:a.current)&&a.current.focus(),o&&o({value:""}),d&&d()},children:e.jsxRuntimeExports.jsx("svg",{viewBox:"0 0 20 20",focusable:"false","aria-hidden":"true",width:14,height:14,children:e.jsxRuntimeExports.jsx("path",{d:"m11.414 10 6.293-6.293a1 1 0 1 0-1.414-1.414l-6.293 6.293-6.293-6.293a1 1 0 0 0-1.414 1.414l6.293 6.293-6.293 6.293a1 1 0 1 0 1.414 1.414l6.293-6.293 6.293 6.293a.998.998 0 0 0 1.707-.707.999.999 0 0 0-.293-.707l-6.293-6.293z"})})})}):null]})},k=s=>{var i;const{className:n="",placeholder:l=null,prefixLabel:r=null,prefixSelectedLabel:o="",align:d="end",onChange:a,value:u="",options:c=[]}=s,[x,p]=t.useState(!1),h=(null==(i=null==c?void 0:c.filter((({value:e})=>e===u))[0])?void 0:i.label)||l;return e.jsxRuntimeExports.jsx("div",{className:`sledge__select-field-wrapper ${n||""}`,children:e.jsxRuntimeExports.jsx(m,{trigger:e.jsxRuntimeExports.jsxs("button",{type:"button",className:"sledge__button sledge__select-field","data-button-color-type":"light","data-button-full-width":"true",children:[r?e.jsxRuntimeExports.jsx("span",{className:"sledge__select-field-icon",children:r}):null,e.jsxRuntimeExports.jsx("span",{children:(null==o?void 0:o.length)?`${o} ${h}`:h})]}),content:e.jsxRuntimeExports.jsx("ul",{className:"sledge__select-field-option",children:null==c?void 0:c.map(((t,s)=>{const{label:i,value:n}=t;return e.jsxRuntimeExports.jsx("li",{onClick:()=>((e,t)=>{a&&a({label:e,value:t}),p(!1)})(i,n),...n===u&&{"data-selected":!0},children:i},s)}))}),isOpen:x,setIsOpen:p,hideCloseIcon:!0,align:d,className:"sledge__select-field-option-content",withArrow:!1})})},A=l=>{var o,d,a;const{data:u,forceActive:x=!1,hidden:p=!1,onAfterAddWishlist:m,onAfterRemoveWishlist:h}=l,{productId:g,productVariantId:j}=u||{},{isRenderApp:v,triggerRenderMultipleComponent:_,sledgeAnonymId:w}=t.useContext(s.SledgeContext),f="#767676",R="outline",C="#F85538",y="fill",[b,N]=t.useState(f),[S,L]=t.useState(R),[$,k]=t.useState(!1),[A,I]=t.useState(!0),[T,P]=t.useState({}),[W,B]=t.useState({onAfterAddWishlist:m,onAfterRemoveWishlist:h}),[O,F]=t.useState(!1),{is_required_login:M}=(null==(o=null==T?void 0:T.display)?void 0:o.global)||{},{show:V,location:D}=(null==(d=null==T?void 0:T.display)?void 0:d.notification)||{},{title_added_to_wishlist:H,text_added_to_wishlist:q,title_removed_to_wishlist:z,text_removed_to_wishlist:Z}=(null==(a=null==T?void 0:T.languages)?void 0:a.notification)||{},J=async()=>{let e;e=await(async(e,t)=>{let s=c(e),l=t?c(t):"",r=localStorage.getItem(n),o="?"+new URLSearchParams({variant_id:l}).toString();var d=new Headers;d.append("Authorization",`Bearer ${r}`);var a={method:"GET",headers:d,redirect:"follow"};return await fetch(`${i}/wishlist/check/${s}${o}`,a).then((e=>e.json())).then((e=>Boolean(e.data))).catch((()=>{}))})(g,j),k(x||e)},U=async t=>{var s,l,r,o,d,a;if(t.preventDefault(),t.stopPropagation(),O)return void("undefined"!=typeof window&&window.sledgeConfirmationPopup&&window.sledgeConfirmationPopup({title:"Login required!",message:"Please login to save your wishlist across devices.",textSubmit:"Login",textCancel:"Cancel",buttonSubmitType:"info",onSubmit:()=>window.location.href="/account/login"}));k(!$);let x=await(async e=>{const{productId:t,productVariantId:s,productName:l,productVendor:r,productSku:o,productVariantName:d,productLink:a,productImage:u,productCurrency:x,productPrice:p}=e;let m=localStorage.getItem(n);var h=new Headers;h.append("Authorization",`Bearer ${m}`),h.append("Content-Type","application/json");var g={method:"POST",headers:h,body:JSON.stringify({product:{id:c(t),variant_id:c(s),name:l,vendor:r,sku:o,variant_name:d,url:a,image_url:u,currency:x,price:p}}),redirect:"follow"};return await fetch(`${i}/wishlist`,g).then((e=>e.json())).then((e=>e)).catch((()=>{}))})(u);const{status:p,data:m}=x||{},{code:h}=p||{};200===h?("undefined"!=typeof window&&(window.sledgeWishlistBadgeUpdate&&((null==(l=null==(s=null==_?void 0:_.wishlist)?void 0:s.badge)?void 0:l.trigger)&&(null==(a=null==(r=null==_?void 0:_.wishlist)?void 0:r.badge)||a.trigger(!(null==(d=null==(o=null==_?void 0:_.wishlist)?void 0:o.badge)?void 0:d.value))),window.sledgeWishlistBadgeUpdate()),window.sledgeWishlistWidgetListUpdate&&window.sledgeWishlistWidgetListUpdate(),window.sledgeWishlistButtonDetailUpdate&&window.sledgeWishlistButtonDetailUpdate()),J(),$?W.onAfterRemoveWishlist&&W.onAfterRemoveWishlist("success"):W.onAfterAddWishlist&&W.onAfterAddWishlist("success"),"undefined"!=typeof window&&window.sledgeToastNotification&&V&&window.sledgeToastNotification({title:$?z:H,message:$?Z:q,location:D,type:"success",icon:e.jsxRuntimeExports.jsx(E,{width:40,height:40,color:"black",type:"outline"})})):($?W.onAfterRemoveWishlist&&W.onAfterRemoveWishlist("failed"):W.onAfterAddWishlist&&W.onAfterAddWishlist("failed"),"undefined"!=typeof window&&window.sledgeToastNotification&&V&&window.sledgeToastNotification({title:"Failed",message:"failed add to wishlist",location:D,type:"failed",icon:e.jsxRuntimeExports.jsx(E,{width:40,height:40,color:"black",type:"outline"})}))};t.useEffect((()=>{(null==v?void 0:v.wishlist)&&("undefined"!=typeof window&&(window.sledgeWishlistTriggerUpdate=()=>{J()}),(async e=>{let t;I(!0);let s=!1;if(t=JSON.parse(e),!t)return;const{status:i,data:n}=t,{code:l}=i;s=200===l||!1,s&&(P(n),I(!1))})(localStorage.getItem(r)||""))}),[v]),t.useEffect((()=>{F(w&&M)}),[w]),t.useEffect((()=>{J()}),[j]);const G=($||x)&&!O;return t.useEffect((()=>{G?(N(C),L(y)):(N(f),L(R))}),[$]),e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:!A&&!p&&e.jsxRuntimeExports.jsx("div",{className:"sledge-wishlist__trigger-block",children:e.jsxRuntimeExports.jsx("span",{className:"sledge-wishlist__trigger",onClick:e=>U(e),onMouseEnter:()=>{G||(N(C),L(y))},onMouseLeave:()=>{G||(N(f),L(R))},children:e.jsxRuntimeExports.jsx(E,{width:16.67,height:15.83,type:S,color:b})})})})},I=({isFirstLoading:s,...i})=>e.jsxRuntimeExports.jsx("div",{className:"sledge-wishlist__widget-header",children:s?e.jsxRuntimeExports.jsxs("div",{style:{display:"flex",gap:"8px",width:"100%",justifyContent:"space-between"},children:[e.jsxRuntimeExports.jsx(X.Item,{width:"190px",height:"46px",color:"grey-100",rounded:"md"}),e.jsxRuntimeExports.jsxs("div",{style:{display:"flex",gap:"8px"},children:[e.jsxRuntimeExports.jsx(X.Item,{width:"440px",height:"46px",color:"grey-100",rounded:"md"}),e.jsxRuntimeExports.jsx(X.Item,{width:"132px",height:"46px",color:"grey-100",rounded:"md"}),e.jsxRuntimeExports.jsx(X.Item,{width:"136px",height:"46px",color:"grey-100",rounded:"md"})]}),e.jsxRuntimeExports.jsxs("div",{style:{display:"flex",gap:"26px"},children:[e.jsxRuntimeExports.jsx(X.Item,{width:"190px",height:"46px",color:"grey-100",rounded:"md"}),e.jsxRuntimeExports.jsx(X.Item,{width:"190px",height:"46px",color:"grey-100",rounded:"md"})]})]}):t.Children.count(i.children)&&t.Children.map(i.children,(e=>t.cloneElement(e,{...i})))});I.Title=({text:t,dataSettings:s})=>{var i,n,l;const{color:r,font_size:o,font_weight:d,text_transform:a}=(null==(n=null==(i=null==s?void 0:s.display)?void 0:i.widget)?void 0:n.header_title)||{},{header_title:u}=(null==(l=null==s?void 0:s.languages)?void 0:l.widget)||{},c={...r&&{color:r},...o&&{fontSize:o},...d&&{fontWeight:d},...a&&{textTransform:a}};return e.jsxRuntimeExports.jsx("div",{className:"sledge-wishlist__widget-header-item",children:e.jsxRuntimeExports.jsx("h1",{style:c,children:u||(t||"My Wishlist")})})},I.SearchForm=({setIsLoading:i,setKeyword:n,keyword:l,placeholder:r,dataSettings:o})=>{var d,a;const{sledgeAnonymId:u}=t.useContext(s.SledgeContext),{is_required_login:c}=(null==(d=null==o?void 0:o.display)?void 0:d.global)||{},{search_form_placeholder:x}=(null==(a=null==o?void 0:o.languages)?void 0:a.widget)||{},[p,m]=t.useState(!1),h=t.useRef(null);return t.useEffect((()=>{m(u&&c)}),[u]),e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:!p&&e.jsxRuntimeExports.jsx($,{type:"text",icon:e.jsxRuntimeExports.jsx(S,{width:18,height:18,color:"#868686"}),placeholder:x||(r||"Search product..."),value:l,fieldRef:h,onChange:({value:e})=>(e=>{n&&n(e)})(e),onResetField:()=>{var e;i&&i(!0),n&&n(""),null==(e=null==h?void 0:h.current)||e.focus()},className:"sledge-wishlist__widget-search-form",withClearField:!0})})},I.ShareTrigger=({wishlistData:l,buttonText:r,showShareTrigger:o,shareLink:d,shareId:a,dataSettings:u,isFirstLoading:x})=>{var p,m,h,g,j,v;const{triggerRenderMultipleComponent:_,sledgeAnonymId:w}=t.useContext(s.SledgeContext),{is_required_login:f}=(null==(p=null==u?void 0:u.display)?void 0:p.global)||{},{text_color:R,border_color:E,border_radius:C,padding_top:y,padding_bottom:b,padding_left:N,padding_right:S,background_color:$,font_size:k,font_weight:A,text_transform:I}=(null==(h=null==(m=null==u?void 0:u.display)?void 0:m.widget)?void 0:h.button_share)||{},{title_share_wishlist:T}=(null==(g=null==u?void 0:u.languages)?void 0:g.popup)||{},{button_share:P}=(null==(j=null==u?void 0:u.languages)?void 0:j.widget)||{},{title_added_all_to_wishlist:W,text_added_all_to_wishlist:B}=(null==(v=null==u?void 0:u.languages)?void 0:v.notification)||{},[O,F]=t.useState(!1),M={...R&&{color:R},...E&&{borderColor:E},...C&&{borderRadius:C},...y&&{paddingTop:y},...b&&{paddingBottom:b},...N&&{paddingLeft:N},...S&&{paddingRight:S},...$&&{backgroundColor:$},...k&&{fontSize:k},...A&&{fontWeight:A},...I&&{textTransform:I}},[V,D]=t.useState(!1);let H='<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M15 17V20C15 20.2652 14.8946 20.5196 14.7071 20.7071C14.5196 20.8946 14.2652 21 14 21H4C3.73478 21 3.48043 20.8946 3.29289 20.7071C3.10536 20.5196 3 20.2652 3 20V8C3 7.73478 3.10536 7.48043 3.29289 7.29289C3.48043 7.10536 3.73478 7 4 7H7" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>\n <path d="M18 3H8C7.44772 3 7 3.44772 7 4V16C7 16.5523 7.44772 17 8 17H18C18.5523 17 19 16.5523 19 16V4C19 3.44772 18.5523 3 18 3Z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>\n </svg>';const q=async()=>{var e,t,s,r,o,d,a;D(!0);let u=l.map((e=>{const{id:t,variant_id:s,name:i,variant_name:n,url:l,image_url:r,currency:o,price:d}=e.product;return{productId:t,productVariantId:s,productName:i,productVariantName:n,productLink:l,productImage:r,productCurrency:o,productPrice:d}})),x=await(async e=>{let t=localStorage.getItem(n);var s=new Headers;s.append("Authorization",`Bearer ${t}`),s.append("Content-Type","application/json");let l=e.map((e=>{const{productId:t,productVariantId:s,productName:i,productVariantName:n,productLink:l,productImage:r,productCurrency:o,productPrice:d}=e;return{id:c(t),variant_id:c(s),name:i,variant_name:n,url:l,image_url:r,currency:o,price:d}}));var r={method:"POST",headers:s,body:JSON.stringify({products:l}),redirect:"follow"};return await fetch(`${i}/wishlist/bulk`,r).then((e=>e.json())).then((e=>e)).catch((()=>{}))})(u);200===(null==(e=null==x?void 0:x.status)?void 0:e.code)?("undefined"!=typeof window&&(window.sledgeWishlistBadgeUpdate&&((null==(s=null==(t=null==_?void 0:_.wishlist)?void 0:t.badge)?void 0:s.trigger)&&(null==(a=null==(r=null==_?void 0:_.wishlist)?void 0:r.badge)||a.trigger(!(null==(d=null==(o=null==_?void 0:_.wishlist)?void 0:o.badge)?void 0:d.value))),window.sledgeWishlistBadgeUpdate()),window.sledgeInfoPopup&&window.sledgeInfoPopup({title:W,message:B,textCancel:"Cancel"})),D(!1)):"undefined"!=typeof window&&window.sledgeInfoPopup&&window.sledgeInfoPopup({title:"Failed",message:"Failed add to wishlist, please try again",textCancel:"Cancel"})};return t.useEffect((()=>{F(w&&f)}),[w]),e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:!O&&e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:o&&e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:x?e.jsxRuntimeExports.jsx(X.Item,{width:"136px",height:"46px",color:"grey-100",rounded:"md"}):e.jsxRuntimeExports.jsx("div",{className:"sledge-wishlist__widget-header-item sledge-wishlist__widget-header-share-trigger",children:e.jsxRuntimeExports.jsx(L,{type:"button",style:M,...a&&!l.length||V?{disabled:!0}:{onClick:async()=>{a&&l.length?window.sledgeConfirmationPopup({title:"Are you sure want to add this to your wishlist item?",message:`This action cannot be undone. This will adding <strong>${l.length}</strong> item to your wishlist page.`,textSubmit:"Add to your wishlist",textCancel:"Cancel",buttonSubmitType:"info",onSubmit:q||{}}):"undefined"!=typeof window&&window.sledgeInfoPopup&&(window.sledgeInfoPopup({title:T,message:d?`<div class="sledge-wishlist__widget-box-copy">\n <div class="sledge-wishlist__widget-box-copy-icon" title="Copy to clipboard">\n ${H}\n </div>\n <div class="sledge-wishlist__widget-box-copy-content">${d}</div>\n </div>`:"",textCancel:"Cancel"}),(()=>{let e=!0;document.body.addEventListener("DOMNodeInserted",(()=>{if(document.querySelector(".sledge-wishlist__widget-box-copy")&&e){e=!1;let t=document.querySelector(".sledge-wishlist__widget-box-copy-icon");null==t||t.addEventListener("click",(()=>{var e;let s=null==(e=document.querySelector(".sledge-wishlist__widget-box-copy-content"))?void 0:e.textContent;s&&(navigator.clipboard.writeText(s),t&&(t.classList.add("active"),t.innerHTML='<svg width="20" height="20" viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z" fill="currentColor" fill-rule="evenodd" clip-rule="evenodd"></path></svg>',setTimeout((()=>{t&&(t.classList.remove("active"),t.innerHTML=H)}),2500)))}))}}))})())}},children:a?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("span",{className:"sledge-wishlist__badge-counter sledge-wishlist__badge-counter-top-right",children:l.length}),V?"Adding...":"Add to your wishlist"]}):P||(r||"Share Wishlist")})})})})})},I.ClearTrigger=({buttonText:i,shareId:n,dataSettings:l,isFirstLoading:r})=>{var o,d,a,u,c;const{sledgeAnonymId:x}=t.useContext(s.SledgeContext),{is_required_login:p}=(null==(o=null==l?void 0:l.display)?void 0:o.global)||{},{text_color:m,border_color:h,border_radius:g,padding_top:j,padding_bottom:v,padding_left:_,padding_right:w,background_color:f,font_size:R,font_weight:E,text_transform:C}=(null==(a=null==(d=null==l?void 0:l.display)?void 0:d.widget)?void 0:a.button_clear_all)||{},{title_confirm_clear_all_wishlist:y,text_confirm_clear_all_wishlist:b,button_submit_confirm_clear_all_wishlist:N,button_cancel_confirm_clear_all_wishlist:S}=(null==(u=null==l?void 0:l.languages)?void 0:u.popup)||{},{button_clear_all:$}=(null==(c=null==l?void 0:l.languages)?void 0:c.widget)||{},[k,A]=t.useState(!1),I={...m&&{color:m},...h&&{borderColor:h},...g&&{borderRadius:g},...j&&{paddingTop:j},...v&&{paddingBottom:v},..._&&{paddingLeft:_},...w&&{paddingRight:w},...f&&{backgroundColor:f},...R&&{fontSize:R},...E&&{fontWeight:E},...C&&{textTransform:C}};t.useEffect((()=>{A(x&&p)}),[x]);return e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:!k&&e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:!n&&e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:r?e.jsxRuntimeExports.jsx(X.Item,{width:"132px",height:"46px",color:"grey-100",rounded:"md"}):e.jsxRuntimeExports.jsx("div",{className:"sledge-wishlist__widget-header-item",children:e.jsxRuntimeExports.jsx(L,{type:"button",colorType:"danger",onClick:()=>{"undefined"!=typeof window&&window.sledgeConfirmationPopup&&window.sledgeConfirmationPopup({title:y,message:b,textSubmit:N,textCancel:S,buttonSubmitType:"danger",onSubmit:window.sledgeWishlistWidgetClearList||{}})},style:I,children:$||(i||"Clear Wishlist")})})})})})},I.Sort=({wishlistSort:i,selectedSort:n,setSelectedSort:l,setIsRefreshWidgetList:r,dataSettings:o})=>{var d,a;const{sledgeAnonymId:u}=t.useContext(s.SledgeContext),{is_required_login:c}=(null==(d=null==o?void 0:o.display)?void 0:d.global)||{},[x,p]=t.useState(!1);return t.useEffect((()=>{p(u&&c)}),[u]),e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:!x&&e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:i&&Boolean(null==i?void 0:i.length)&&e.jsxRuntimeExports.jsx("div",{className:"sledge-wishlist__widget-header-item",children:e.jsxRuntimeExports.jsx(k,{align:"end",options:i.map((e=>{const{name:t,value:s}=e;return{label:t,value:s}})),value:n||(null==(a=i[0])?void 0:a.value),onChange:({value:e})=>(e=>{l&&l(e),r&&r(!0)})(e)})})})})},I.Limit=({options:i,defaultLimitOptions:n,selectedLimit:l,setSelectedLimit:r,setIsRefreshWidgetList:o,dataSettings:d})=>{var a;const{sledgeAnonymId:u}=t.useContext(s.SledgeContext),{is_required_login:c}=(null==(a=null==d?void 0:d.display)?void 0:a.global)||{},[x,p]=t.useState(!1);let m=i||n;return t.useEffect((()=>{p(u&&c)}),[u]),e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:!x&&e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:m&&Boolean(null==m?void 0:m.length)&&e.jsxRuntimeExports.jsx("div",{className:"sledge-wishlist__widget-header-item",children:e.jsxRuntimeExports.jsx(k,{align:"end",options:m.map((e=>({label:e,value:e}))),value:l||m[0],onChange:({value:e})=>(e=>{r&&r(e),o&&o(!0)})(e)})})})})};const T=e=>{const s=t.useRef();return t.useEffect((()=>{s.current=e})),s.current},P=async e=>{let t=c(e),s=localStorage.getItem(n);var l=new Headers;l.append("Authorization",`Bearer ${s}`);var r={method:"GET",headers:l,redirect:"follow"};return await fetch(`${i}/review/info/${t}`,r).then((e=>e.json())).then((e=>e)).catch((()=>{}))},W=i=>{var n;const{value:l,size:r="md",data:d,withSkeletonLoading:a=!0,isScrollToElementWidget:c=!0}=i,{productId:x}=d||{},{isRenderApp:m,triggerRenderMultipleComponent:h}=t.useContext(s.SledgeContext),[g,j]=t.useState(!0),[v,_]=t.useState(!0),[w,f]=t.useState({width:0,height:0}),[R,E]=t.useState(0),[C,y]=t.useState("0"),[b,N]=t.useState({}),S=T({productId:x}),{fill_color:L,outline_color:$}=(null==(n=null==b?void 0:b.display)?void 0:n.rating)||{},k=async()=>{l&&!d?(y(l),_(!1)):(async e=>{var t;let s,i,n=!1,l=0;if(s=await P(e),!s)return;const{status:r,data:o}=s,{code:d}=r;n=200===d||!1,l=(null==o?void 0:o.review_count)?o.review_count:0,i=(null==(t=null==o?void 0:o.rating)?void 0:t.average)?o.rating.average:0,n&&(E(l),y(i),_(!1),j(!1))})(x)};return t.useEffect((()=>{if(!(null==m?void 0:m.productReview))return;"undefined"!=typeof window&&(window.sledgeProductReviewRatingUpdate=()=>{_(!0),k()}),f("xs"===r?{width:14.4,height:14.4}:"sm"===r?{width:18,height:18}:{width:28.8,height:28.8}),Boolean(S&&(null==S?void 0:S.productId)!==x)&&j(!0),(async e=>{let t;_(!0);let s=!1;if(t=JSON.parse(e),!t)return;const{status:i,data:n}=t,{code:l}=i;s=200===l||!1,s&&(N(n),await k())})(localStorage.getItem(o)||"")}),[m,x,h]),e.jsxRuntimeExports.jsx("div",{className:"sledge-product-review__rating",onClick:()=>{c&&setTimeout((()=>{p(document.getElementById(u.ELEMENT_WIDGET),50)}),200)},children:g&&a?e.jsxRuntimeExports.jsx(X.Item,{width:"230px",height:"28px",color:"grey-100",rounded:"md"}):e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",style:{display:"none"},id:"sledge-product-review-rating-icon-svg-store",children:[e.jsxRuntimeExports.jsx("symbol",{id:"sledge-product-review-icons-rating-icon-fill",viewBox:"0 0 30 29",fill:L||"#23BC45",children:e.jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.00014 17.7L1.20174 12.9C0.107339 12.0248 0.587339 10.2648 1.97614 10.0664L10.2001 9.69998L13.7121 0.895176C13.9569 0.407176 14.4545 0.0999756 15.0001 0.0999756C15.5457 0.0999756 16.0433 0.408776 16.2881 0.895176L19.8001 9.69998L28.0241 10.0664C29.4129 10.2648 29.8929 12.0248 28.7985 12.9L23.0001 17.7L24.5825 27.0712C24.7649 28.3496 23.4369 29.3064 22.2833 28.7288L15.0001 24.1L7.71694 28.7272C6.56174 29.3048 5.23534 28.348 5.41774 27.0696L7.00014 17.7Z"})}),e.jsxRuntimeExports.jsx("symbol",{id:"sledge-product-review-icons-rating-icon-line",viewBox:"0 0 30 29",stroke:$||"#8D9196",fill:"none",children:e.jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.00014 17.7L1.20174 12.9C0.107339 12.0248 0.587339 10.2648 1.97614 10.0664L10.2001 9.69998L13.7121 0.895176C13.9569 0.407176 14.4545 0.0999756 15.0001 0.0999756C15.5457 0.0999756 16.0433 0.408776 16.2881 0.895176L19.8001 9.69998L28.0241 10.0664C29.4129 10.2648 29.8929 12.0248 28.7985 12.9L23.0001 17.7L24.5825 27.0712C24.7649 28.3496 23.4369 29.3064 22.2833 28.7288L15.0001 24.1L7.71694 28.7272C6.56174 29.3048 5.23534 28.348 5.41774 27.0696L7.00014 17.7Z",strokeWidth:"1.4"})}),e.jsxRuntimeExports.jsx("defs",{children:e.jsxRuntimeExports.jsxs("g",{id:"sledge-product-review-icons-rating-icon",children:[e.jsxRuntimeExports.jsx("use",{href:"#sledge-product-review-icons-rating-icon-line",className:"sledge-product-review__rating-icon-line"}),e.jsxRuntimeExports.jsx("use",{href:"#sledge-product-review-icons-rating-icon-fill",className:"sledge-product-review__rating-icon-fill"})]})})]}),!v&&e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[[1,2,3,4,5].map(((s,i)=>{let n=Math.floor(parseFloat(C)),l=String(C).includes(",")?String(C).split(","):[],r=String(C).includes(".")?String(C).split("."):[],o=l.length||r.length?l[1]||r[1]:0,d="fill-0";return s>n&&n+1===s&&(d=`fill-${o}`),t.createElement("svg",{...w,viewBox:"0 0 30 29","data-product-review-rating-fill":s<=n?"full":d,key:i},e.jsxRuntimeExports.jsx("use",{href:"#sledge-product-review-icons-rating-icon"}))})),!l&&d?e.jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__rating-summary-total",children:["(",R,")"]}):e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{})]})]})})},B={open:{rotate:180},closed:{rotate:0},transition:{type:"spring",duration:.2}},O={hidden:{opacity:0,scale:0},visible:e=>{const{duration:t}=e||{};return{opacity:1,scale:1,transition:{type:"spring",duration:t||.7}}}},F=s=>{const[i,n]=t.useState(!0);return t.useEffect((()=>{n(!1)}),[]),e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:!i&&e.jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-header",children:t.Children.count(s.children)&&t.Children.map(s.children,(e=>t.cloneElement(e,{...s})))})})};F.Sort=({isFirstLoading:s,productReviewSort:i,dataSettings:n,setSelectedSort:l,setIsRefreshWidgetList:r})=>{var o,d;const{default_sort:a,show_sorting_options:u}=(null==(o=null==n?void 0:n.display)?void 0:o.widget)||{},[c,x]=t.useState(a||null),p=c||(null==(d=i[0])?void 0:d.value);return e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:u?e.jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-header-item",children:s?e.jsxRuntimeExports.jsx(X.Item,{width:"134px",height:"42px",rounded:"lg",color:"grey-100"}):e.jsxRuntimeExports.jsx(k,{align:"end",prefixLabel:e.jsxRuntimeExports.jsx("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.5919 9.13869C12.7359 9.13869 13.6666 10.0647 13.6666 11.2027C13.6666 12.3407 12.7359 13.2667 11.5919 13.2667C10.4473 13.2667 9.51593 12.3407 9.51593 11.2027C9.51593 10.0647 10.4473 9.13869 11.5919 9.13869ZM11.5919 10.1387C10.9986 10.1387 10.5159 10.616 10.5159 11.2027C10.5159 11.79 10.9986 12.2667 11.5919 12.2667C12.1846 12.2667 12.6666 11.79 12.6666 11.2027C12.6666 10.616 12.1846 10.1387 11.5919 10.1387ZM6.7202 10.7286C6.9962 10.7286 7.2202 10.9526 7.2202 11.2286C7.2202 11.5046 6.9962 11.7286 6.7202 11.7286H2.51953C2.24353 11.7286 2.01953 11.5046 2.01953 11.2286C2.01953 10.9526 2.24353 10.7286 2.51953 10.7286H6.7202ZM4.07533 2.66669C5.22 2.66669 6.15067 3.59335 6.15067 4.73135C6.15067 5.86935 5.22 6.79469 4.07533 6.79469C2.93133 6.79469 2 5.86935 2 4.73135C2 3.59335 2.93133 2.66669 4.07533 2.66669ZM4.07533 3.66669C3.48267 3.66669 3 4.14402 3 4.73135C3 5.31802 3.48267 5.79469 4.07533 5.79469C4.66867 5.79469 5.15067 5.31802 5.15067 4.73135C5.15067 4.14402 4.66867 3.66669 4.07533 3.66669ZM12.7941 4.26695C13.0701 4.26695 13.2941 4.49095 13.2941 4.76695C13.2941 5.04295 13.0701 5.26695 12.7941 5.26695H8.59407C8.31807 5.26695 8.09407 5.04295 8.09407 4.76695C8.09407 4.49095 8.31807 4.26695 8.59407 4.26695H12.7941Z",fill:"currentColor"})}),prefixSelectedLabel:"Sort by",options:i.map((e=>{const{name:t,value:s}=e;return{label:t,value:s}})),value:p,onChange:({value:e})=>(e=>{x(e),r&&r(!0),l&&l(e)})(e)})}):null})},F.AddTrigger=({isFirstLoading:t,text:s,dataSettings:i,data:n,onAfterAddReview:l})=>{var r,o,d;const{text_color:a,border_color:u,border_radius:c,padding_top:x,padding_bottom:p,padding_left:m,padding_right:h,background_color:g,font_size:j,font_weight:v,text_transform:_}=(null==(o=null==(r=null==i?void 0:i.display)?void 0:r.widget)?void 0:o.button_write_review)||{},{button_write_review:w}=(null==(d=null==i?void 0:i.languages)?void 0:d.widget)||{},f={...a&&{color:a},...u&&{borderColor:u},...c&&{borderRadius:c},...x&&{paddingTop:x},...p&&{paddingBottom:p},...m&&{paddingLeft:m},...h&&{paddingRight:h},...g&&{backgroundColor:g},...j&&{fontSize:j},...v&&{fontWeight:v},..._&&{textTransform:_}};return e.jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-header-item",children:t?e.jsxRuntimeExports.jsx(X.Item,{width:"134px",height:"42px",rounded:"lg",color:"grey-100"}):e.jsxRuntimeExports.jsxs(L,{type:"button",colorType:"success",onClick:()=>"undefined"!=typeof window&&window.sledgeProductReviewWidgetFormAdd&&window.sledgeProductReviewWidgetFormAdd(n,l),style:f,children:[e.jsxRuntimeExports.jsx("svg",{width:16,height:17,viewBox:"0 0 16 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M13.8323 14.1264C14.1083 14.1264 14.3323 14.3504 14.3323 14.6264C14.3323 14.9024 14.1083 15.1264 13.8323 15.1264H8.99701C8.72101 15.1264 8.49701 14.9024 8.49701 14.6264C8.49701 14.3504 8.72101 14.1264 8.99701 14.1264H13.8323ZM10.7429 2.93576C10.7762 2.96176 11.8915 3.82843 11.8915 3.82843C12.2969 4.06976 12.6135 4.5011 12.7335 5.01176C12.8529 5.5171 12.7662 6.03843 12.4882 6.47909C12.4864 6.48203 12.4845 6.48494 12.4781 6.49358L12.4731 6.50025C12.4279 6.55972 12.2318 6.80776 11.2417 8.04815C11.2325 8.06441 11.2221 8.07963 11.2107 8.09443C11.1941 8.11624 11.1759 8.13628 11.1565 8.15453C11.089 8.23956 11.0176 8.3289 10.9426 8.42283L10.7907 8.61313C10.4772 9.00579 10.1053 9.47139 9.66407 10.0236L9.43764 10.3071C8.58586 11.3732 7.49499 12.7382 6.09755 14.4864C5.79155 14.8678 5.33288 15.0898 4.84021 15.0958L2.41421 15.1264H2.40755C2.17621 15.1264 1.97488 14.9678 1.92088 14.7418L1.37488 12.4278C1.26221 11.9484 1.37421 11.4538 1.68155 11.0698L7.96155 3.2151C7.96421 3.21243 7.96621 3.2091 7.96888 3.20643C8.65755 2.3831 9.90288 2.26176 10.7429 2.93576ZM7.26136 5.69133L2.46221 11.6944C2.34821 11.8371 2.30621 12.0211 2.34821 12.1978L2.80221 14.1211L4.82821 14.0958C5.02088 14.0938 5.19888 14.0078 5.31688 13.8611C5.92454 13.1008 6.68825 12.1452 7.47345 11.1627L7.75125 10.815L8.02952 10.4668C8.76591 9.54526 9.4934 8.63471 10.1021 7.87258L7.26136 5.69133ZM8.73888 3.84443L7.88603 4.91L10.7265 7.09062C11.2733 6.4058 11.633 5.95476 11.6662 5.91176C11.7755 5.73443 11.8182 5.48376 11.7609 5.24243C11.7022 4.9951 11.5482 4.78509 11.3262 4.65109C11.2789 4.61843 10.1555 3.74643 10.1209 3.71909C9.69821 3.38043 9.08155 3.4391 8.73888 3.84443Z",fill:"currentColor"})}),s||(w||"Add review")]})})},F.Summary=s=>{var i,n,l;const{data:r,dataSettings:o}=s,{productId:d}=r||{},{fill_color:a,outline_color:u}=(null==(n=null==(i=null==o?void 0:o.display)?void 0:i.widget)?void 0:n.summary_bar)||{},{review_singular:c,review_plural:x}=(null==(l=null==o?void 0:o.languages)?void 0:l.widget)||{},[p,g]=t.useState(!0),[j,v]=t.useState(!0),[_,w]=t.useState(!0),[f,R]=t.useState(!0),[E,C]=t.useState(!1),[y,b]=t.useState(0),[N,S]=t.useState({5:0,4:0,3:0,2:0,1:0}),[L,$]=t.useState("0"),k=T({productId:d}),A=async()=>{var e;let t,s,i,n=!1,l=0;if(t=await P(d),!t)return;const{status:r,data:o}=t,{code:a}=r;n=200===a||!1,l=(null==o?void 0:o.review_count)?o.review_count:0,s=(null==o?void 0:o.rating)?{5:o.rating[5]||0,4:o.rating[4]||0,3:o.rating[3]||0,2:o.rating[2]||0,1:o.rating[1]||0}:N,i=(null==(e=null==o?void 0:o.rating)?void 0:e.average)?o.rating.average:"0",n&&(b(l),S(s),$(i),w(!1),R(!1),g(!1),E&&v(!1))};return t.useEffect((()=>{"undefined"!=typeof window&&(window.sledgeProductReviewWidgetSummaryUpdate=()=>{R(!0),A()}),Boolean(k&&(null==k?void 0:k.productId)!==d)&&g(!0),A()}),[E,d]),e.jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-summary",children:p?e.jsxRuntimeExports.jsx(X.Item,{width:"630px",height:"42px",color:"grey-100",rounded:"md",animationDuration:"5s"}):_?null:e.jsxRuntimeExports.jsx(m,{trigger:e.jsxRuntimeExports.jsxs(e.motion.div,{initial:!1,animate:E?"open":"closed",className:"sledge-product-review__widget-summary-trigger",children:[e.jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-summary-average",children:L}),e.jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-summary-rating",children:!f&&e.jsxRuntimeExports.jsx(W,{value:String(L),size:"md",withSkeletonLoading:!1,isScrollToElementWidget:!1})}),e.jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__widget-summary-total",children:[y," ",y>1?x||"Reviews":c||"Review"]}),e.jsxRuntimeExports.jsx(e.motion.div,{variants:B,className:"summary-trigger-icon",children:e.jsxRuntimeExports.jsx("svg",{width:20,height:20,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsxRuntimeExports.jsx("path",{d:"M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})})]}),content:j?e.jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-summary-dist-progress",children:[5,4,3,2,1].map((t=>e.jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__widget-summary-dist-progress-item",children:[e.jsxRuntimeExports.jsx(X.Item,{width:"108px",height:"22px",color:"grey-100",rounded:"md",animationDuration:"15s"}),e.jsxRuntimeExports.jsx(X.Item,{width:"128px",height:"22px",color:"grey-100",rounded:"md",animationDuration:"13s",style:{marginLeft:"13px",marginRight:"12px"}}),e.jsxRuntimeExports.jsx(X.Item,{width:"38px",height:"22px",color:"grey-100",rounded:"md",animationDuration:"42s"})]},t)))}):e.jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-summary-dist",children:e.jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-summary-dist-progress",children:[5,4,3,2,1].map(((t,s)=>e.jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__widget-summary-dist-progress-item",children:[e.jsxRuntimeExports.jsx(W,{value:t,size:"sm",withSkeletonLoading:!1,isScrollToElementWidget:!1}),e.jsxRuntimeExports.jsx(h,{value:String(N[t]),total:y,fillColor:a,outlineColor:u}),e.jsxRuntimeExports.jsxs("small",{children:["(",N[t],")"]})]},s)))})}),setIsOpen:C,hideCloseIcon:!0,align:"end",alignOffset:-170,className:"sledge-product-review__widget-summary-content",withArrow:!1})})};const M=async(e,t,s)=>{let i=localStorage.getItem(l);var n=new Headers;n.append("Authorization",`Bearer ${i}`),n.append("Content-Type","application/json");var r={method:t,headers:n,redirect:"follow",...s&&{body:JSON.stringify(s)}};return await fetch(`https://instant-search-engine.offstack.io${e}`,r).then((e=>e.json())).then((e=>e)).catch((()=>{}))},V=async(e,t)=>await M(`/indexes/${e}/search`,"POST",t),D=async e=>await M("/multi-search","POST",e),H=async e=>{const{keyword:t,resultCount:s}=e;let l=localStorage.getItem(n);var r=new Headers;r.append("Authorization",`Bearer ${l}`),r.append("Content-Type","application/json");var o={method:"POST",headers:r,body:JSON.stringify({keyword:t,result_count:s}),redirect:"follow"};return await fetch(`${i}/instantsearch/statistics/search`,o).then((e=>e.json())).then((e=>e)).catch((()=>{}))},q=async e=>{const{productId:t}=e;let s=localStorage.getItem(n);var l=new Headers;l.append("Authorization",`Bearer ${s}`),l.append("Content-Type","application/json");var r={method:"POST",headers:l,body:JSON.stringify({product:{id:c(t)}}),redirect:"follow"};return await fetch(`${i}/instantsearch/statistics/click`,r).then((e=>e.json())).then((e=>e)).catch((()=>{}))},z=({type:s,className:l="",data:r,setting:o,showOptionOutOfStock:d=!1,triggerPropAdditional:a,sourceApp:u=null,isComponentJsVersion:x=!1,cards:p,onAfterAddToCart:m,onAfterAddWishlist:h,onAfterRemoveWishlist:g,onAfterRenderProduct:j,showPopupComponent:v,setShowPopupComponent:_})=>{const{show_vendor:w=!0,show_sku:f=!0,show_price:R=!0,show_add_to_cart:E=!0,redirect_add_to_cart:C=!0,language_button_add_to_cart:y="Add To Cart",display_product_name_style:b={},display_price_style:S={},display_button_add_to_cart_style:$={}}=o||{},[k,I]=t.useState(null),T=async t=>{var s;const{id:l,quantity:r}=t;I(l);let o=await(async e=>{var t,s=new Headers;s.append("Content-Type","application/json");let i=[];e.map((e=>{const{id:t,quantity:s}=e;i.push({id:t,quantity:s})}));var n={method:"POST",headers:s,body:JSON.stringify({items:i}),redirect:"follow"};if(null==(t=null==window?void 0:window.Shopify)?void 0:t.routes)return await fetch(`${window.Shopify.routes.root}cart/add.js`,n).then((e=>e.json())).then((e=>e)).catch((()=>{}))})([{id:l,quantity:r}]);(null==(s=null==o?void 0:o.items)?void 0:s.length)?("wishlist"===u?await(async e=>{const{productId:t}=e;let s=localStorage.getItem(n);var l=new Headers;l.append("Authorization",`Bearer ${s}`),l.append("Content-Type","application/json");var r={method:"POST",headers:l,body:JSON.stringify({product:{id:c(t)}}),redirect:"follow"};return await fetch(`${i}/wishlist/cart`,r).then((e=>e.json())).then((e=>e)).catch((()=>{}))})({productId:l}):"instant-search"===u&&await(async e=>{const{productId:t}=e;let s=localStorage.getItem(n);var l=new Headers;l.append("Authorization",`Bearer ${s}`),l.append("Content-Type","application/json");var r={method:"POST",headers:l,body:JSON.stringify({product:{id:c(t)}}),redirect:"follow"};return await fetch(`${i}/instantsearch/statistics/cart`,r).then((e=>e.json())).then((e=>e)).catch((()=>{}))})({productId:l}),I(null),m&&m("success"),C?window.location.href="/cart":window.sledgeToastNotification({title:"Cart added",message:"Successfully added to wishlist",type:"success",icon:e.jsxRuntimeExports.jsx(N,{width:40,height:40,color:"black"})})):(m&&m("failed"),setTimeout((()=>{var t;I(null),"undefined"!=typeof window&&window.sledgeToastNotification&&window.sledgeToastNotification({title:"Failed",message:(null==(t=null==o?void 0:o.description)?void 0:t.length)?o.description:"failed add to cart, please try again",type:"failed",icon:e.jsxRuntimeExports.jsx(N,{width:40,height:40,color:"black"})})}),1e3))};return t.useEffect((()=>{j&&j("success")}),[]),e.jsxRuntimeExports.jsx("div",{className:`sledge__product-grid ${l}`,"data-grid-type":s,children:null==r?void 0:r.map(((s,n)=>{const{product:l,variants:r}=s||{},{id:o,title:c,image:m,url:j,vendor:C="",currency:N}=l||{},{id:I="",title:P="",price:B="",sku:O=""}=(null==r?void 0:r.length)?r[0]:{};let F=k==I,M=!(!(null==r?void 0:r.length)||!Object.hasOwn(r[0],"inventory_quantity"))&&(!r[0].inventory_quantity&&d);const V=p?p({product:{...l,variants:r.map(((e,t)=>{const{inventory_quantity:s}=e||{};return{...e,is_out_of_stock:!!Object.hasOwn(r[t],"inventory_quantity")&&!s}}))},showPopupComponent:v,setShowPopupComponent:_}):null;return p?e.jsxRuntimeExports.jsx(t.Fragment,{children:x?e.jsxRuntimeExports.jsx("div",{dangerouslySetInnerHTML:{__html:V}}):V},n):e.jsxRuntimeExports.jsxs("div",{className:"sledge__product-grid-card",children:[e.jsxRuntimeExports.jsxs("div",{className:"sledge__product-grid-content",children:[e.jsxRuntimeExports.jsxs("div",{className:"sledge__product-grid-card-image",children:[e.jsxRuntimeExports.jsxs("a",{href:j,onClick:()=>"instant-search"===u&&q({productId:o}),children:[e.jsxRuntimeExports.jsx(A,{data:{productId:o,productVariantId:I,productName:c,productVendor:C,productSku:O,productVariantName:P,productLink:j,productImage:(null==m?void 0:m.src)||`${i}/img/blank-image.png`,productCurrency:N,productPrice:B},...a,onAfterAddWishlist:h,onAfterRemoveWishlist:g}),e.jsxRuntimeExports.jsx("img",{src:(null==m?void 0:m.src)||"",alt:"sledge-product-card-image",loading:"lazy",onError:e=>e.currentTarget.src=`${i}/img/blank-image.png`})]}),M?e.jsxRuntimeExports.jsx("div",{className:"sledge__product-grid-card-out-of-stock",children:"Sold out"}):null]}),e.jsxRuntimeExports.jsxs("div",{className:"sledge__product-grid-card-desc",children:[e.jsxRuntimeExports.jsxs("div",{className:"sledge__product-grid-card-title",children:[c?e.jsxRuntimeExports.jsx("a",{href:j,onClick:()=>"instant-search"===u&&q({productId:o}),children:e.jsxRuntimeExports.jsx("h3",{style:b,children:c})}):null,R?e.jsxRuntimeExports.jsx("div",{className:"sledge__product-grid-card-price",children:e.jsxRuntimeExports.jsxs("p",{style:S,children:[N,B]})}):null]}),e.jsxRuntimeExports.jsxs("div",{className:"sledge__product-grid-card-text",children:[e.jsxRuntimeExports.jsx("div",{children:P}),e.jsxRuntimeExports.jsxs("div",{children:[e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:w?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:["Vendor: ",C]}):null}),e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:" | "}),e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:f?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:["SKU: ",O]}):null})]})]}),e.jsxRuntimeExports.jsx("div",{className:"sledge__product-grid-card-rating",children:e.jsxRuntimeExports.jsx(W,{data:{productId:o},size:"xs",withSkeletonLoading:!1,isScrollToElementWidget:!1})})]})]}),E?e.jsxRuntimeExports.jsx("div",{className:"sledge__product-grid-button-wrapper",children:e.jsxRuntimeExports.jsx(L,{type:"button",colorType:"light",style:{...$,...F&&{cursor:"wait"}},...F||M?{disabled:!0}:{onClick:()=>T({id:I,quantity:1})},children:F?"Adding...":M?"Sold out":e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("svg",{width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.83562 1.50023C10.796 1.50023 12.4155 2.99397 12.6152 4.90442L12.6709 4.90507C13.7584 4.90507 15.0806 5.62732 15.5269 7.65307L16.1186 12.2333C16.3309 13.7116 16.0654 14.8973 15.3281 15.7478C14.5946 16.5938 13.4336 17.0416 11.9704 17.0416H5.7094C4.10215 17.0416 2.9824 16.6478 2.28565 15.8386C1.5859 15.0271 1.3519 13.8098 1.5904 12.2213L2.1724 7.70182C2.5549 5.62957 3.95365 4.90507 5.03665 4.90507C5.13014 4.04293 5.51889 3.22275 6.13562 2.60797C6.84437 1.90372 7.82162 1.50023 8.81987 1.50023H8.83562ZM12.6709 6.03007H5.03665C4.7059 6.03007 3.6004 6.16357 3.28315 7.87657L2.70415 12.3766C2.5159 13.6388 2.6614 14.5523 3.13765 15.1051C3.6079 15.6511 4.4494 15.9166 5.7094 15.9166H11.9704C12.7564 15.9166 13.8296 15.7598 14.4776 15.0113C14.9921 14.4181 15.1691 13.5346 15.0041 12.3848L14.4199 7.84582C14.1709 6.72757 13.5139 6.03007 12.6709 6.03007ZM11.023 8.11815C11.3335 8.11815 11.6027 8.37015 11.6027 8.68065C11.6027 8.99115 11.368 9.24315 11.0575 9.24315H11.023C10.7125 9.24315 10.4605 8.99115 10.4605 8.68065C10.4605 8.37015 10.7125 8.11815 11.023 8.11815ZM6.65042 8.11815C6.96092 8.11815 7.23017 8.37015 7.23017 8.68065C7.23017 8.99115 6.99467 9.24315 6.68417 9.24315H6.65042C6.33992 9.24315 6.08792 8.99115 6.08792 8.68065C6.08792 8.37015 6.33992 8.11815 6.65042 8.11815ZM8.83337 2.62522H8.82212C8.11637 2.62522 7.42862 2.90947 6.92987 3.40522C6.5236 3.80967 6.25789 4.34137 6.17193 4.90472L11.4814 4.90493C11.2887 3.61626 10.1743 2.62522 8.83337 2.62522Z",fill:"#393D4E"})}),e.jsxRuntimeExports.jsx("span",{children:y||"Add To Cart"})]})})}):null]},n)}))})},Z=({className:t="",data:s})=>e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:(null==s?void 0:s.length)?e.jsxRuntimeExports.jsx("div",{className:`sledge__collection-grid ${t}`,children:s.map(((t,s)=>{const{id:n,title:l,description:r,url:o,image:d}=t;return e.jsxRuntimeExports.jsxs("div",{className:"sledge__collection-grid-card",children:[e.jsxRuntimeExports.jsx("div",{className:"sledge__collection-grid-card-image",children:e.jsxRuntimeExports.jsx("img",{src:d||`${i}/img/blank-image.png`,alt:"sledge-product-card-image",loading:"lazy",onError:e=>e.currentTarget.src=`${i}/img/blank-image.png`})}),e.jsxRuntimeExports.jsxs("div",{className:"sledge__collection-grid-card-content",children:[e.jsxRuntimeExports.jsxs("div",{className:"sledge__collection-grid-card-text",children:[e.jsxRuntimeExports.jsx("div",{className:"sledge__collection-grid-card-content-title",children:l}),e.jsxRuntimeExports.jsx("div",{className:"sledge__collection-grid-card-content-description",children:r})]}),e.jsxRuntimeExports.jsx("div",{className:"sledge__collection-grid-card-content-button-wrapper",children:e.jsxRuntimeExports.jsx(L,{type:"button",colorType:"success",elementType:"hyperlink",link:o,children:"Shop Now"})})]})]},s)}))}):null}),J=({className:t="",data:s})=>e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:(null==s?void 0:s.length)?e.jsxRuntimeExports.jsx("div",{className:`sledge__page-grid ${t}`,children:s.map(((t,s)=>{const{id:n,title:l,description:r,url:o,image:d}=t;return e.jsxRuntimeExports.jsx("a",{href:o,children:e.jsxRuntimeExports.jsxs("div",{className:"sledge__page-grid-card",children:[e.jsxRuntimeExports.jsx("div",{className:"sledge__page-grid-card-image",children:e.jsxRuntimeExports.jsx("img",{src:d||`${i}/img/blank-image.png`,alt:"sledge-product-card-image",loading:"lazy",onError:e=>e.currentTarget.src=`${i}/img/blank-image.png`})}),e.jsxRuntimeExports.jsxs("div",{className:"sledge__page-grid-card-content",children:[e.jsxRuntimeExports.jsx("div",{className:"sledge__page-grid-card-content-title",children:l}),e.jsxRuntimeExports.jsx("div",{className:"sledge__page-grid-card-content-description",children:r})]})]})},s)}))}):null}),U=({className:t="",data:s})=>e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:(null==s?void 0:s.length)?e.jsxRuntimeExports.jsx("div",{className:`sledge__blog-grid ${t}`,children:null==s?void 0:s.map(((t,s)=>{const{id:n,title:l,date:r,description:o,url:d,image:a}=t;return e.jsxRuntimeExports.jsxs("div",{className:"sledge__blog-grid-card",children:[e.jsxRuntimeExports.jsxs("div",{className:"sledge__blog-grid-content",children:[e.jsxRuntimeExports.jsx("div",{className:"sledge__blog-grid-card-image",children:e.jsxRuntimeExports.jsx("a",{href:d,children:e.jsxRuntimeExports.jsx("img",{src:a||`${i}/img/blank-image.png`,alt:"sledge-blog-card-image",loading:"lazy",onError:e=>e.currentTarget.src=`${i}/img/blank-image.png`})})}),e.jsxRuntimeExports.jsxs("div",{className:"sledge__blog-grid-card-desc",children:[e.jsxRuntimeExports.jsx("div",{className:"sledge__blog-grid-card-title",children:e.jsxRuntimeExports.jsx("div",{children:e.jsxRuntimeExports.jsx("a",{href:d,children:e.jsxRuntimeExports.jsx("div",{children:l})})})}),(null==r?void 0:r.length)?e.jsxRuntimeExports.jsx("div",{className:"sledge__blog-grid-card-date",children:r}):null,e.jsxRuntimeExports.jsx("div",{className:"sledge__blog-grid-card-text",children:o})]})]}),e.jsxRuntimeExports.jsx("div",{className:"sledge__blog-grid-button-wrapper",children:e.jsxRuntimeExports.jsx(L,{type:"button",colorType:"light",elementType:"hyperlink",link:d,children:"Learn More"})})]},s)}))}):null}),G=({children:s,content:i,withArrow:n=!0,customArrow:l="",sideOffset:r=5,alignOffset:o=0,wrapTrigger:d=!0})=>{const[a,u]=t.useState(!1);return t.useEffect((()=>{var e;let t=null==(e=null==document?void 0:document.querySelector(".sledge__tooltip-arrow"))?void 0:e.parentElement;t&&(null==l?void 0:l.length)&&(t.classList.add("sledge__tooltip-arrow-parent"),t.innerHTML=l)}),[a]),e.jsxRuntimeExports.jsx(e.$a093c7e1ec25a057$export$2881499e37b75b9a,{delayDuration:0,children:e.jsxRuntimeExports.jsxs(e.$a093c7e1ec25a057$export$be92b6f5f03c0fe9,{onOpenChange:u,children:[e.jsxRuntimeExports.jsx(e.$a093c7e1ec25a057$export$41fb9f06171c75f4,{asChild:!0,children:d?e.jsxRuntimeExports.jsx("span",{children:s}):s}),e.jsxRuntimeExports.jsx(e.$a093c7e1ec25a057$export$602eac185826482c,{children:e.jsxRuntimeExports.jsxs(e.$a093c7e1ec25a057$export$7c6e2c02157bb7d2,{className:"sledge__tooltip-content",sideOffset:r,alignOffset:o,children:[i,n?e.jsxRuntimeExports.jsx(e.$a093c7e1ec25a057$export$21b07c8f274aebd5,{className:"sledge__tooltip-arrow"}):null]})})]})})},K=({children:t,isLoading:s=!1,className:i="",withCorner:n=!0})=>e.jsxRuntimeExports.jsxs(e.$57acba87d6e25586$export$be92b6f5f03c0fe9,{className:`sledge__scroll-area-root ${i}`,children:[e.jsxRuntimeExports.jsx(e.$57acba87d6e25586$export$d5c6c08dc2d3ca7,{className:"sledge__scroll-area-viewport "+(s?"sledge__scroll-area-viewport-loading":""),children:t}),!s&&e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(e.$57acba87d6e25586$export$9a4e88b92edfce6b,{className:"sledge__scroll-area-scrollbar",orientation:"vertical",children:e.jsxRuntimeExports.jsx(e.$57acba87d6e25586$export$6521433ed15a34db,{className:"sledge__scroll-area-thumb"})}),e.jsxRuntimeExports.jsx(e.$57acba87d6e25586$export$9a4e88b92edfce6b,{className:"sledge__scroll-area-scrollbar",orientation:"horizontal",children:e.jsxRuntimeExports.jsx(e.$57acba87d6e25586$export$6521433ed15a34db,{className:"sledge__scroll-area-thumb"})}),n&&e.jsxRuntimeExports.jsx(e.$57acba87d6e25586$export$ac61190d9fc311a9,{className:"sledge__scroll-area-corner"})]})]}),Y=({width:t,height:s,rounded:i,color:n,animationDuration:l="8s",disableAnimation:r=!1,style:o={},className:d="",...a})=>e.jsxRuntimeExports.jsx("div",{className:`sledge__skeleton-item ${d} ${r?"":"sledge__skeleton-item-animation"}`,style:{width:t,height:s,WebkitAnimationDuration:l,animationDuration:l,...o},"data-skeleton-rounded":i,"data-skeleton-color":n,...a}),X={Item:Y,ReviewGrid:({count:t,type:s,gridItemHeights:i=[]})=>{let n=[];for(let l=0;l<t;l++)n.push(e.jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-review-card",children:e.jsxRuntimeExports.jsx(Y,{width:"100%",height:"list"===s||"grid"===s&&!(null==i?void 0:i.length)?"111px":i[l],color:"grey-100",rounded:"md",animationDuration:"list"===s?"2.5s":"8s"})},l));return e.jsxRuntimeExports.jsx(e.MasonryResponsive,{columnsCountBreakPoints:"grid"===s?{350:1,750:3,1024:4}:{350:1},className:"sledge-product-review__widget-review-grid sledge__skeleton-review-grid sledge__skeleton-pointer-events-none",children:e.jsxRuntimeExports.jsx(e.Masonry,{gutter:"30px",children:n})})},ProductGrid:({count:t,type:s})=>{let i=[];for(let n=0;n<t;n++)i.push(e.jsxRuntimeExports.jsxs("div",{className:"sledge__product-grid-card",children:[e.jsxRuntimeExports.jsxs("div",{className:"sledge__product-grid-content",children:[e.jsxRuntimeExports.jsxs("div",{className:"sledge__product-grid-card-image sledge__skeleton-product-grid-card-image",children:[e.jsxRuntimeExports.jsx("div",{className:"sledge-wishlist__trigger-block",children:e.jsxRuntimeExports.jsx(Y,{width:"40px",height:"40px",color:"grey-300",rounded:"sm",disableAnimation:!0})}),e.jsxRuntimeExports.jsx(Y,{width:"100%",height:"100%",color:"grey-100",rounded:"md"})]}),e.jsxRuntimeExports.jsxs("div",{className:"sledge__product-grid-card-desc",children:[e.jsxRuntimeExports.jsxs("div",{className:"sledge__product-grid-card-title",children:[e.jsxRuntimeExports.jsx(Y,{width:"134px",height:"28px",color:"grey-100",rounded:"md",animationDuration:"15s"}),e.jsxRuntimeExports.jsx(Y,{width:"80px",height:"28px",color:"grey-100",rounded:"md",animationDuration:"20s"})]}),e.jsxRuntimeExports.jsx("div",{className:"sledge__product-grid-card-text",children:e.jsxRuntimeExports.jsx(Y,{width:"190px",height:"46px",color:"grey-100",rounded:"md",animationDuration:"13s",style:{marginBottom:"16px"}})})]})]}),e.jsxRuntimeExports.jsx("div",{className:"sledge__product-grid-button-wrapper",children:e.jsxRuntimeExports.jsx(Y,{width:"117px",height:"40px",color:"grey-100",rounded:"md",animationDuration:"15s"})})]},n));return e.jsxRuntimeExports.jsx("div",{className:"sledge__product-grid sledge__skeleton-product-grid sledge__skeleton-pointer-events-none","data-grid-type":s,children:i})},CollectionGrid:({count:t})=>{let s=[];for(let i=0;i<t;i++)s.push(e.jsxRuntimeExports.jsxs("div",{className:"sledge__collection-grid-card",children:[e.jsxRuntimeExports.jsx("div",{className:"sledge__collection-grid-card-image",children:e.jsxRuntimeExports.jsx(Y,{width:"246px",height:"246px",color:"grey-300",rounded:"md"})}),e.jsxRuntimeExports.jsxs("div",{className:"sledge__collection-grid-card-content",children:[e.jsxRuntimeExports.jsxs("div",{className:"sledge__collection-grid-card-text",children:[e.jsxRuntimeExports.jsx("div",{className:"sledge__collection-grid-card-content-title",children:e.jsxRuntimeExports.jsx(Y,{width:"100%",height:"70px",color:"grey-300",rounded:"lg"})}),e.jsxRuntimeExports.jsx("div",{className:"sledge__collection-grid-card-content-description",children:e.jsxRuntimeExports.jsx(Y,{width:"100%",height:"47px",color:"grey-300",rounded:"md",style:{maxWidth:"357px"}})})]}),e.jsxRuntimeExports.jsx("div",{className:"sledge__collection-grid-card-content-button-wrapper",children:e.jsxRuntimeExports.jsx(Y,{width:"100%",height:"40px",color:"grey-300",rounded:"md",animationDuration:"20s",style:{maxWidth:"117px"}})})]})]},i));return e.jsxRuntimeExports.jsx("div",{className:"sledge__collection-grid sledge__skeleton-collection-grid sledge__skeleton-pointer-events-none",children:s})},PageGrid:({count:t})=>{let s=[];for(let i=0;i<t;i++)s.push(e.jsxRuntimeExports.jsxs("div",{className:"sledge__page-grid-card",children:[e.jsxRuntimeExports.jsx("div",{className:"sledge__page-grid-card-image",children:e.jsxRuntimeExports.jsx(Y,{width:"100%",height:"100%",color:"grey-300",rounded:"md",animationDuration:"13s",style:{borderTopRightRadius:0,borderBottomRightRadius:0}})}),e.jsxRuntimeExports.jsxs("div",{className:"sledge__page-grid-card-content",children:[e.jsxRuntimeExports.jsx("div",{className:"sledge__page-grid-card-content-title",children:e.jsxRuntimeExports.jsx(Y,{width:"100%",height:"40px",color:"grey-300",rounded:"md",animationDuration:"6s"})}),e.jsxRuntimeExports.jsx("div",{className:"sledge__page-grid-card-content-description",children:e.jsxRuntimeExports.jsx(Y,{width:"100%",height:"40px",color:"grey-300",rounded:"md",animationDuration:"17s",style:{maxWidth:"115px"}})})]})]},i));return e.jsxRuntimeExports.jsx("div",{className:"sledge__page-grid sledge__skeleton-page-grid sledge__skeleton-pointer-events-none",children:s})},BlogGrid:({count:t})=>{let s=[];for(let i=0;i<t;i++)s.push(e.jsxRuntimeExports.jsx("div",{className:"sledge__blog-grid-card",children:e.jsxRuntimeExports.jsxs("div",{className:"sledge__blog-grid-content",children:[e.jsxRuntimeExports.jsx("div",{className:"sledge__blog-grid-card-image",children:e.jsxRuntimeExports.jsx(Y,{width:"100%",height:"100%",color:"grey-100",rounded:"md",animationDuration:"10s"})}),e.jsxRuntimeExports.jsxs("div",{className:"sledge__blog-grid-card-desc",children:[e.jsxRuntimeExports.jsx(Y,{width:"100%",height:"28px",color:"grey-100",rounded:"md",style:{maxWidth:"242px",marginTop:"26px",marginBottom:"12px"}}),e.jsxRuntimeExports.jsx(Y,{width:"100%",height:"28px",color:"grey-100",rounded:"md",animationDuration:"23s",style:{maxWidth:"80px",marginBottom:"27px"}}),e.jsxRuntimeExports.jsx(Y,{width:"100%",height:"80px",color:"grey-100",rounded:"md",animationDuration:"13s",style:{maxWidth:"190px",marginBottom:"27px"}}),e.jsxRuntimeExports.jsx(Y,{width:"100%",height:"40px",color:"grey-100",rounded:"md",animationDuration:"20s",style:{maxWidth:"117px"}})]})]})},i));return e.jsxRuntimeExports.jsx("div",{className:"sledge__blog-grid sledge__skeleton-blog-grid sledge__skeleton-pointer-events-none",children:s})}},Q=({listsComponent:t,name:s,items:i,isComponentJsVersion:n,showPopupComponent:l,setShowPopupComponent:r})=>{const o=t?t({name:s,items:i,showPopupComponent:l,setShowPopupComponent:r}):null;return t?n?e.jsxRuntimeExports.jsx("div",{dangerouslySetInnerHTML:{__html:o}}):o:e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__icon-widget-search-form-result-title",children:s}),(null==i?void 0:i.length)?e.jsxRuntimeExports.jsx("ul",{className:"sledge-instant-search__icon-widget-search-form-result-list",children:i.map(((t,s)=>{const{title:i,url:n}=t;return e.jsxRuntimeExports.jsx("li",{children:e.jsxRuntimeExports.jsx("a",{href:n,className:"sledge-instant-search__icon-widget-search-form-result-list-link",children:i})},s)}))}):e.jsxRuntimeExports.jsx("ul",{className:"sledge-instant-search__icon-widget-search-form-result-list",children:e.jsxRuntimeExports.jsxs("li",{className:"sledge-instant-search__icon-widget-search-form-result-item-disabled",children:["No ",null==s?void 0:s.toLowerCase()," were found"]})})]})},ee=({listsComponent:t,keywords:s,isComponentJsVersion:i=!1,showPopupComponent:n,setShowPopupComponent:l})=>{const r=t?t({keywords:s,showPopupComponent:n,setShowPopupComponent:l}):null;return t?i?e.jsxRuntimeExports.jsx("div",{dangerouslySetInnerHTML:{__html:r}}):r:e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__icon-widget-search-form-result-title",children:"Suggestions"}),e.jsxRuntimeExports.jsx("ul",{className:"sledge-instant-search__icon-widget-search-form-result-list",children:null==s?void 0:s.map(((t,s)=>e.jsxRuntimeExports.jsx("li",{children:e.jsxRuntimeExports.jsxs("a",{href:`${a}?q=${t}`,className:"sledge-instant-search__icon-widget-search-form-result-list-link sledge-instant-search__icon-widget-search-form-result-list-link-suggestion",children:[e.jsxRuntimeExports.jsx(S,{width:12,height:12,color:"#677487"})," ",t]})},s)))})]})},te=({component:t,keyword:s,isComponentJsVersion:i=!1,showPopupComponent:n,setShowPopupComponent:l})=>{const r=t?t({keyword:s,showPopupComponent:n,setShowPopupComponent:l}):null;return t?i?e.jsxRuntimeExports.jsx("div",{dangerouslySetInnerHTML:{__html:r}}):r:e.jsxRuntimeExports.jsx("a",{href:`${a}?q=${s}`,className:"sledge-instant-search__icon-widget-button-more",children:"View More Result"})},se=i=>{var n,l,r,o,a,u,c,p,m,h;const{isRenderApp:g,isJsVersion:j}=t.useContext(s.SledgeContext),{layoutType:v="default",query:_,data:w,children:f,onAfterAddToCart:R,onAfterAddWishlist:E,onAfterRemoveWishlist:C,onAfterRenderProduct:y}=i,{keyword:b=""}=_||{},{collectionId:N}=w||{};let S=null;t.Children.map(f,(e=>{if(t.isValidElement(e)&&x(e.type)){const{productCard:t}=(null==e?void 0:e.props)||{};t&&x(t)&&(S=t)}}));const[L,$]=t.useState(!0),[k,A]=t.useState(!0),[I,P]=t.useState(""),[W,B]=t.useState(null),[O,F]=t.useState(),[M,V]=t.useState(e.jsxRuntimeExports.jsx(ie,{})),[H,q]=t.useState(!0),[z,Z]=t.useState([]),[J,U]=t.useState([]),[G,K]=t.useState([]),[Y,Q]=t.useState([]),[ee,te]=t.useState(""),[se,le]=t.useState({}),[re,oe]=t.useState([]),[de,ae]=t.useState({}),[ue,ce]=t.useState([]),[xe,pe]=t.useState(""),[me,he]=t.useState(!1),ge=t.useRef(null),je=T({keyword:I}),ve=async(e,t)=>{const{filters:s,tabs:i,suffix_index_product:n,hidden_tags:l,display:r,show_out_of_stock:o}=e;let d,a={queries:("product-filter"===v?i.filter((({index:e})=>null==e?void 0:e.includes(n))):i).map((e=>{const{index:i}=e;let r=!1,d=r?[]:null==s?void 0:s.map((e=>{const{collections:t,items:s}=e;return N&&(null==t?void 0:t.includes(Number(N)))||(null==t?void 0:t.includes("all"))?(r=!0,null==s?void 0:s.map((({value:e})=>e))):void 0})),a=i.includes(n),u=a&&d.length,c=[];return(null==l?void 0:l.length)&&c.push(`tags NOT IN [${l}]`),o||c.push("variants.inventory_quantity > 0"),N&&c.push(`collections.id = '${N}'`),u&&Q(d[0]),{indexUid:i,q:"default"===t?"":I,hitsPerPage:1,facets:u?d[0]:[],filter:a?c.join(" AND "):""}}))};if(d=await D(a),!d)return;const{results:u}=d;if($(!1),q(!1),A(!1),"totalDataPerIndex"===t)K(null==i?void 0:i.map((e=>{const{index:t}=e,{totalHits:s}=(null==u?void 0:u.find((({indexUid:e})=>e===t)))||{};return{...e,total:s}})));else{const{facetDistribution:e,facetStats:t}=(null==u?void 0:u.find((({indexUid:e})=>e.includes(n))))||{};le(e?Object.fromEntries(Object.entries(e).map((s=>{let i=s[0],n=[];return"variants.inventory_quantity"===i?(Object.keys(e[i]).map((t=>Boolean(Number(t))?e[i][t]:0)),n=[{name:"In Stock",value:"> 0"}]):n="variants.price"===i?t[i]:Object.keys(e[i]).map((t=>({name:t,value:t,total:e[i][t]||0}))),[i,n]}))):{})}};t.useEffect((()=>{if(!(null==g?void 0:g.instantSearch))return;const e=new URLSearchParams(document.location.search);P((null==e?void 0:e.get(b))||""),(async e=>{let t;q(!0);let s,i=!1;if(t=JSON.parse(e),!t)return;const{status:n,data:l}=t,{code:r}=n,{allowed_sorts:o,default_sort:d,filters:a,tabs:u,suffix_index_product:c,hidden_tags:x,display:p,colors:m,show_out_of_stock:h}=l;i=200===r||!1,i&&(Z((null==o?void 0:o.length)?o:[]),U((null==a?void 0:a.length)?a:[]),te(c),oe(x),ae(p),ce(m),pe(d),he(h),s=u.find((({index:e})=>e.includes(c))),Object.keys(s).length&&(B(s.index),F(s.name)),await ve(l,"default"),"default"===v&&await ve(l,"totalDataPerIndex"))})(localStorage.getItem(d)||"")}),[g]),t.useEffect((()=>{if(Boolean(je&&(null==je?void 0:je.keyword)!==I)&&"default"===v){const e=setTimeout((()=>{ve({filters:J,tabs:G,suffix_index_product:ee,hidden_tags:re,display:de,colors:ue,show_out_of_stock:me},"totalDataPerIndex")}),500);return()=>clearTimeout(e)}}),[I]);const _e="default"===v?e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-tab-list sledge-instant-search__result-tab-list-skeleton",children:[1,2,3,4,5].map((t=>e.jsxRuntimeExports.jsx(X.Item,{width:"122px",height:"28px",rounded:"md",color:"grey-100",animationDuration:"15s"},t)))}):null,we=(null==(n=null==de?void 0:de.filter)?void 0:n.enable_on_search)&&"horizontal"===(null==(l=null==de?void 0:de.filter)?void 0:l.layout)?e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-filter-horizontal-skeleton",children:[1,2,3,4,5,6,7].map((t=>e.jsxRuntimeExports.jsx(X.Item,{width:"106px",height:"42px",rounded:"md",color:"grey-100",animationDuration:"13s"},t)))}):null,fe=(null==(r=null==de?void 0:de.filter)?void 0:r.enable_on_search)&&"vertical"===(null==(o=null==de?void 0:de.filter)?void 0:o.layout)?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsxs("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:"8px",justifyContent:"space-between",marginBottom:"23px"},children:[e.jsxRuntimeExports.jsx(X.Item,{width:"117px",height:"28px",color:"grey-100",rounded:"md",animationDuration:"15s"}),e.jsxRuntimeExports.jsx(X.Item,{width:"80px",height:"28px",color:"grey-100",rounded:"md",animationDuration:"15s"})]}),e.jsxRuntimeExports.jsx(X.Item,{width:"100%",height:"28px",color:"grey-100",rounded:"md",style:{maxWidth:"270px",marginBottom:"18px"}}),[1,2,3].map((t=>e.jsxRuntimeExports.jsx(X.Item,{width:"100%",height:"28px",color:"grey-100",rounded:"md",style:{maxWidth:"163px",marginBottom:"9px"}},t))),e.jsxRuntimeExports.jsx(X.Item,{width:"100%",height:"28px",color:"grey-100",rounded:"md",style:{maxWidth:"163px",marginBottom:"18px"}}),e.jsxRuntimeExports.jsx(X.Item,{width:"100%",height:"28px",color:"grey-100",rounded:"md",style:{maxWidth:"270px",marginBottom:"14px"}}),e.jsxRuntimeExports.jsx(X.Item,{width:"100%",height:"28px",color:"grey-100",rounded:"md",style:{maxWidth:"163px",marginBottom:"9px"}}),e.jsxRuntimeExports.jsx(X.Item,{width:"100%",height:"28px",color:"grey-100",rounded:"md",style:{maxWidth:"163px",marginBottom:"17px"}}),e.jsxRuntimeExports.jsx(X.Item,{width:"100%",height:"28px",color:"grey-100",rounded:"md",style:{maxWidth:"270px",marginBottom:"38px"}}),e.jsxRuntimeExports.jsx(X.Item,{width:"100%",height:"28px",color:"grey-100",rounded:"md",style:{maxWidth:"270px",marginBottom:"35px"}}),e.jsxRuntimeExports.jsx(X.Item,{width:"100%",height:"28px",color:"grey-100",rounded:"md",style:{maxWidth:"270px",marginBottom:"12px"}}),e.jsxRuntimeExports.jsx(X.Item,{width:"100%",height:"28px",color:"grey-100",rounded:"md",style:{maxWidth:"163px",marginBottom:"9px"}}),e.jsxRuntimeExports.jsx(X.Item,{width:"100%",height:"28px",color:"grey-100",rounded:"md",style:{maxWidth:"163px",marginBottom:"20px"}}),e.jsxRuntimeExports.jsx(X.Item,{width:"100%",height:"28px",color:"grey-100",rounded:"md",style:{maxWidth:"270px",marginBottom:"12px"}}),[1,2,3].map((t=>e.jsxRuntimeExports.jsx(X.Item,{width:"100%",height:"28px",color:"grey-100",rounded:"md",style:{maxWidth:"163px",marginBottom:"9px"}},t))),e.jsxRuntimeExports.jsx(X.Item,{width:"100%",height:"28px",color:"grey-100",rounded:"md",style:{maxWidth:"270px",marginBottom:"11px"}}),e.jsxRuntimeExports.jsx("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:"12px"},children:[1,2,3,4,5,6,7,8,9].map((t=>e.jsxRuntimeExports.jsx(X.Item,{width:"34px",height:"34px",color:"grey-100",rounded:"full",animationDuration:"40s"},t)))})]}):null,Re=e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[(null==(a=null==de?void 0:de.filter)?void 0:a.show_total_products)&&"vertical"===(null==(u=null==de?void 0:de.filter)?void 0:u.layout)?e.jsxRuntimeExports.jsx(X.Item,{width:"117px",height:"28px",color:"grey-100",rounded:"md",animationDuration:"13s",style:{marginBottom:"21px"}}):null,e.jsxRuntimeExports.jsx(X.ProductGrid,{count:12,type:"large"})]}),Ee=e.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-data-keyword",children:[(null==(c=null==de?void 0:de.filter)?void 0:c.show_total_products)&&"horizontal"===(null==(p=null==de?void 0:de.filter)?void 0:p.layout)?e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-data-summary sledge-instant-search__result-data-summary-filter-horizontal",children:e.jsxRuntimeExports.jsx(X.Item,{width:"117px",height:"28px",color:"grey-100",rounded:"md",animationDuration:"13s"})}):null,e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-data-keyword-form",children:e.jsxRuntimeExports.jsx(X.Item,{width:"100%",height:"42px",color:"grey-100",rounded:"lg",style:{maxWidth:"630px"}})}),e.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-data-summary-item sledge-instant-search__result-data-summary-select-field",children:[e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-data-summary-select-field-item",children:e.jsxRuntimeExports.jsx(X.Item,{width:"150px",height:"42px",color:"grey-100",rounded:"lg"})}),e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-data-summary-select-field-item",children:e.jsxRuntimeExports.jsx(X.Item,{width:"150px",height:"42px",color:"grey-100",rounded:"lg"})})]})]});return e.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-container",ref:ge,children:[L?null:e.jsxRuntimeExports.jsx("div",{className:""+("default"===v&&(null==G?void 0:G.length)?"sledge-instant-search__result-tab":"sledge-instant-search__result-tab-no-index"),children:"default"===v&&(null==G?void 0:G.length)?e.jsxRuntimeExports.jsx("ul",{className:"sledge-instant-search__result-tab-list",children:G.map((t=>{const{name:s,index:i,total:n}=t;let l=W===i;return e.jsxRuntimeExports.jsxs("li",{onClick:t=>((t,s,i)=>{B(t),F(s),V(t.includes(ee)?e.jsxRuntimeExports.jsx(ie,{}):e.jsxRuntimeExports.jsx(ne,{}))})(i,s),className:""+(l?"sledge-instant-search__result-tab-list-item-active":""),children:[s,e.jsxRuntimeExports.jsx("span",{className:"sledge-instant-search__result-tab-total",children:n||0})]},i)}))}):null}),L&&(null==v?void 0:v.length)?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[_e,we,e.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-wrapper sledge-instant-search__result-wrapper-skeleton",children:[(null==(m=null==de?void 0:de.filter)?void 0:m.enable_on_search)&&"vertical"===(null==(h=null==de?void 0:de.filter)?void 0:h.layout)?e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-filter",children:fe}):null,e.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-data",children:[Ee,Re]})]})]}):t.cloneElement(M,{isLoading:k,keyword:I,clickedTabIndexId:W,clickedTabIndexName:O,isLoadingSetting:H,allowedSorts:z,allowedFilters:J,facets:Y,searchResultFacets:se,hiddenTags:re,displaySettings:de,colorSwatches:ue,defaultSort:xe,showOutOfStock:me,query:_,data:w,isJsVersion:j,productCardsComponent:S,onAfterAddToCart:R,onAfterAddWishlist:E,onAfterRemoveWishlist:C,onAfterRenderProduct:y,setIsLoading:A,setKeyword:P,filterHorizontalSkeleton:we,filterVerticalSkeleton:fe,productGridSkeleton:Re,searchAndSelectOptionSkeleton:Ee,searchResultContainerRef:ge})]})},ie=s=>{var i,n,l,r,o,d,a,u,c,x,h,R,E,y,b,N,A,I,P,W;const{keyword:O,clickedTabIndexId:F,isLoadingSetting:M,allowedSorts:D,allowedFilters:q,facets:Z,searchResultFacets:J,hiddenTags:U,displaySettings:G,colorSwatches:K,defaultSort:Y,showOutOfStock:X,query:Q,data:ee,isJsVersion:te,productCardsComponent:se,setKeyword:ie,filterHorizontalSkeleton:ne,filterVerticalSkeleton:re,productGridSkeleton:oe,searchAndSelectOptionSkeleton:de,onAfterAddToCart:ae,onAfterAddWishlist:ue,onAfterRemoveWishlist:ce,onAfterRenderProduct:xe,searchResultContainerRef:pe}=s||{},{keyword:me=""}=Q||{},{collectionId:he}=ee||{},[ge,je]=t.useState(!0),[ve,_e]=t.useState(!0),[we,fe]=t.useState(!1),[Re,Ee]=t.useState(!1),[Ce,ye]=t.useState(Y||""),[be,Ne]=t.useState(D&&Boolean(null==D?void 0:D.length)?null==(i=D.find((({value:e})=>e===Y)))?void 0:i.label:""),[Se,Le]=t.useState((null==(n=null==G?void 0:G.search)?void 0:n.limit)||10),[$e,ke]=t.useState(null),[Ae,Ie]=t.useState({...X?{}:{"variants.inventory_quantity":"> 0"}}),[Te,Pe]=t.useState(!1),[We,Be]=t.useState([]),[Oe,Fe]=t.useState(0),[Me,Ve]=t.useState(1),[De,He]=t.useState(0),[qe,ze]=t.useState(0),[Ze,Je]=t.useState([]),[Ue,Ge]=t.useState([]),[Ke,Ye]=t.useState(!1),[Xe,Qe]=t.useState(null),et=T({keyword:O,clickedLimitId:Se,clickedFacets:Ae}),{color:tt,font_size:st,font_weight:it,text_transform:nt}=(null==(l=null==G?void 0:G.filter)?void 0:l.title)||{},{color:lt,font_size:rt,font_weight:ot,text_transform:dt}=(null==(r=null==G?void 0:G.filter)?void 0:r.option)||{},{text_color:at,border_color:ut,border_radius:ct,padding_top:xt,padding_bottom:pt,padding_left:mt,padding_right:ht,background_color:gt,font_size:jt,font_weight:vt,text_transform:_t}=(null==(o=null==G?void 0:G.filter)?void 0:o.button)||{},wt={...tt&&{color:tt},...st&&{fontSize:st},...it&&{fontWeight:it},...nt&&{textTransform:nt}},ft={...lt&&{color:lt},...rt&&{fontSize:rt},...ot&&{fontWeight:ot},...dt&&{textTransform:dt}},Rt=e=>{var t;const s=new URLSearchParams(document.location.search),i=Object.fromEntries(s);let n={};for(const r in i){(null==Z?void 0:Z.length)&&!Z.includes(r)&&(n[r]=i[r])}for(const r in e)(null==(t=e[r])?void 0:t.length)&&(n[r]=e[r]);const l=new URLSearchParams({...n}).toString();window.history.pushState(null,"",`${document.location.pathname}${(null==l?void 0:l.length)?`?${l}`:""}`)},Et=e=>{ke(e===$e?"":e)},Ct=()=>{Ye(!0),Ie({}),Pe(!Te),Rt({}),Je([]),setTimeout((()=>{Ye(!1)}),10)},yt=(e,t,s=!1)=>{var i;Ye(!0);let n=[t],l=["variants.price"].includes(e);Ae&&(s?n=[t]:(null==(i=Ae[e])?void 0:i.includes(t))?n=Ae[e].filter((e=>e!==t)):l?(Ae[e],Ae[e]===t?(n=[],Je([])):n=t):n=Ae[e]?[...Ae[e],t]:[t]);let r={...Ae,[e]:n};Rt(r),Ie(r),Pe(!Te),setTimeout((()=>{Ye(!1)}),10)},bt=async(t=!1,s=!1)=>{if(!F)return;t&&Ve(1),_e(!0);let i,n=(e=>{const t=new URLSearchParams(document.location.search),s=Object.fromEntries(t);for(const i in s)(null==Z?void 0:Z.length)&&Z.includes(i)&&(e[i]=s[i].split(","));return Object.keys(e).length&&Ie(e),e})(Ae),l=Object.entries(n).map((e=>{var t,s;if((null==e?void 0:e.length)&&e[1].length){let i=e[0],n=["variants.inventory_quantity"].includes(i),l=["variants.price"].includes(i),r=["tags"].includes(i);return Array.isArray(e[1])&&(null==(t=e[1])?void 0:t.length)>1?l?`${i} >= ${e[1][0]} AND ${i} <= ${e[1][1]}`:r?`${i} IN [${e[1]}]`:null==(s=e[1])?void 0:s.map((e=>n?`${i} ${e}`:`${i} = '${e}'`)).join(" OR "):n?`${i} ${e[1]}`:r?`${i} IN [${e[1]}]`:`${i} = '${e[1]}'`}return null})).filter((e=>e));(null==U?void 0:U.length)&&l.push(`tags NOT IN [${U}]`),he&&l.push(`collections.id = '${he}'`);let r={q:O,sort:Ce?[Ce]:[],page:t?1:Me,hitsPerPage:Se,facets:Z,filter:l.join(" AND ")};i=await V(F,r),((t,s)=>{var i;if(!t)return;const{hits:n,processingTimeMs:l,totalHits:r,totalPages:o}=t;s&&(null==O?void 0:O.length)&&H({keyword:O,resultCount:r||0}),je(!1),_e(!1),Be(n),Fe(l||0),He(o),ze(r||0),Qe(e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-data-summary-item",children:(null==(i=null==G?void 0:G.filter)?void 0:i.show_total_products)?e.jsxRuntimeExports.jsxs("span",{className:"sledge-instant-search__result-data-summary-text",children:[r," result"," ",(null==O?void 0:O.length)?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:["for ",e.jsxRuntimeExports.jsxs("span",{className:"sledge-instant-search__result-data-summary-text-keyword",children:['"',O,'"']})]}):null]}):null}))})(i,s)},Nt=e=>{const t=new URLSearchParams(document.location.search);t.set(me,e),ie&&ie(e),window.history.pushState(null,"",`${document.location.pathname}?${t.toString()}`)};t.useEffect((()=>{let e=Boolean(et&&((null==et?void 0:et.keyword)!==O||(null==et?void 0:et.clickedLimitId)!==Se||(null==et?void 0:et.clickedFacets)!==Ae));if(Boolean(et&&(null==et?void 0:et.keyword)!==O)){const e=setTimeout((()=>{bt(!0,!0)}),500);return()=>clearTimeout(e)}bt(e)}),[Ce,Se,Te,O,Me,F]),t.useEffect((()=>{(()=>{var e,t;if(!(null==(e=null==G?void 0:G.filter)?void 0:e.enable_on_search)||(null==(t=null==G?void 0:G.filter)?void 0:t.hide_when_one_value)&&qe<=1)return;let s=!1;s||null==q||q.map((e=>{const{collections:t,items:i}=e;(he&&(null==t?void 0:t.includes(Number(he)))||(null==t?void 0:t.includes("all")))&&(s=!0,Ge(i))}))})()}),[q,J,qe]);const St=({label:t,name:s,value:i,index:n})=>{var l;let r=i;return["variants.price"].includes(s)&&(r=null==i?void 0:i.join(" - ")),e.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-filter-item-refine-selected",style:ft,children:[e.jsxRuntimeExports.jsxs("span",{className:"sledge-instant-search__result-filter-item-title-refine-list",children:[t,": ",null==(l=String(r))?void 0:l.replaceAll("_"," ")]}),e.jsxRuntimeExports.jsx("span",{className:"sledge-instant-search__result-filter-item-refine-title-clear",onClick:()=>yt(s,i),children:e.jsxRuntimeExports.jsx("svg",{width:12,height:12,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsxRuntimeExports.jsx("path",{d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})})]},n)},Lt=t=>{var s,i;const{value:n,label:l,display:r}=t;let o=null,d=J[n],a=null==(s=null==G?void 0:G.filter)?void 0:s.show_number_matching_product;return"slider"===r.toLowerCase()?o=e.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-filter-item-list-slider",children:[e.jsxRuntimeExports.jsx(j,{defaultValue:[Ze[0]||(null==d?void 0:d.min),Ze[1]||(null==d?void 0:d.max)],min:null==d?void 0:d.min,max:null==d?void 0:d.max,step:1,setValueCommit:e=>yt(n,e),setValueChange:e=>Je(e)}),e.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-filter-item-list-slider-minmax",children:[e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-filter-minmax-field",children:Ze[0]||(null==d?void 0:d.min)}),e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-filter-minmax-field",children:Ze[1]||(null==d?void 0:d.max)})]})]}):"checkbox"===r.toLowerCase()&&(null==d?void 0:d.length)?o=e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:null==d?void 0:d.map(((t,s)=>{var i;return e.jsxRuntimeExports.jsx("li",{children:e.jsxRuntimeExports.jsx(g,{id:`${n}_${s}`,name:n,value:t.value,label:`${t.name}${void 0!==t.total&&a?` (${t.total})`:""}`,onClick:e=>yt(n,e.currentTarget.value),defaultChecked:Ae&&(null==(i=Ae[n])?void 0:i.includes(t.value)),labelStyle:ft})},s)}))}):"radio"===r.toLowerCase()&&(null==d?void 0:d.length)?o=e.jsxRuntimeExports.jsx("li",{children:e.jsxRuntimeExports.jsx(_,{id:n,name:n,onValueChange:e=>yt(n,e,!0),items:null==d?void 0:d.map((e=>{const{name:t,value:s,total:i}=e;return{label:`${t} ${void 0!==i&&a?` (${i})`:""}`,value:s}})),defaultValue:Ae&&(null==(i=Ae[n])?void 0:i.length)?Ae[n][0]:"",labelStyle:ft})}):"select"===r.toLowerCase()&&(null==d?void 0:d.length)?o=e.jsxRuntimeExports.jsx("li",{children:e.jsxRuntimeExports.jsx(f,{placeholder:`Select ${l}`,name:n,onValueChange:e=>yt(n,e,!0),items:null==d?void 0:d.map((e=>{const{name:t,value:s,total:i}=e;return{label:`${t} ${void 0!==i&&a?` (${i})`:""}`,value:s}})),labelStyle:ft})}):"swatch"===r.toLowerCase()&&(null==d?void 0:d.length)&&(o=e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:null==d?void 0:d.map(((t,s)=>{var i;let l=(null==K?void 0:K.filter((({name:e})=>null==e?void 0:e.includes(t.value)))[0])||{};return e.jsxRuntimeExports.jsx("li",{children:e.jsxRuntimeExports.jsx(w,{id:`${n}_${s}`,name:n,value:t.value,rgb:null==l?void 0:l.rgb,image:null==l?void 0:l.image,onClick:e=>yt(n,e.currentTarget.value),defaultChecked:Ae&&(null==(i=Ae[n])?void 0:i.includes(t.value))})},s)}))})),o},$t=Ue.map(((t,s)=>{const{value:i,label:n,display:l}=t;let r=$e===i,o=J[i],d=Boolean("slider"===l.toLowerCase()?o:null==o?void 0:o.length),a=["select"].includes(l.toLowerCase())&&(null==o?void 0:o.length),u=["sledge-instant-search__result-filter-item-list"],c=Lt(t);return"swatch"===l.toLowerCase()&&(null==o?void 0:o.length)&&u.push("sledge-instant-search__result-filter-item-color-swatches"),d?e.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-filter-item",children:[e.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-filter-item-title",onClick:()=>Et(i),children:[e.jsxRuntimeExports.jsx("span",{className:"sledge-instant-search__result-filter-title",style:wt,children:n}),e.jsxRuntimeExports.jsx(e.motion.div,{initial:!1,animate:r?"open":"closed",variants:B,children:e.jsxRuntimeExports.jsx(C,{width:15,height:15,color:"#000000"})})]}),r&&e.jsxRuntimeExports.jsx("ul",{className:u.join(" "),children:a?c:Ke?null:c})]},s):null})),kt=Ue.map(((t,s)=>{const{value:i,label:n,display:l}=t;let r=$e===i,o=J[i],d=Boolean("slider"===l.toLowerCase()?o:null==o?void 0:o.length),a=["radio","select"].includes(l.toLowerCase())&&(null==o?void 0:o.length),u=["sledge-instant-search__result-filter-item-list"],c=Lt(t);return"swatch"===l.toLowerCase()&&(null==o?void 0:o.length)&&u.push("sledge-instant-search__result-filter-item-color-swatches"),d?e.jsxRuntimeExports.jsx("div",{className:"",children:e.jsxRuntimeExports.jsx(m,{trigger:e.jsxRuntimeExports.jsxs(L,{type:"button",onClick:()=>Et(i),children:[n,e.jsxRuntimeExports.jsx(e.motion.div,{initial:"closed",animate:r?"open":"closed",variants:B,className:"sort-trigger-icon",children:e.jsxRuntimeExports.jsx(C,{width:20,height:20,color:"#000000"})})]}),content:e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-filter-horizontal-facet",children:r&&e.jsxRuntimeExports.jsx("ul",{className:u.join(" "),children:a?c:Ke?null:c})}),withOpenState:!1,setIsOpen:e=>ke(e?i:""),hideCloseIcon:!0,align:"center",className:"sledge-instant-search__filter-horizontal-facet-content",customArrow:'<svg style="transform: rotate(180deg); margin-bottom: 3px; stroke-dasharray: 0,0,36;" width="44" height="12" viewBox="0 0 44 12" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M23.2222 1.99825e-06C23.2222 11.9998 4.88979 11.9999 0.000354767 12L23.2222 12L44 12C23.2222 12 23.2222 1.99825e-06 23.2222 1.99825e-06Z" fill="white" stroke="#393d4e" stroke-width="1px" /></svg>'})},s):null}));let At=[];Object.entries(Ae).map((e=>{var t,s;if((null==e?void 0:e.length)&&e[1].length){let i=e[0];if(["variants.inventory_quantity"].includes(i))return;let n=["variants.price"].includes(i),l=Ue.filter((({value:e})=>null==e?void 0:e.includes(i))),r=(null==l?void 0:l.length)?l[0].label:i;return Array.isArray(e[1])&&(null==(t=e[1])?void 0:t.length)>1?n?At.push({label:r,name:i,value:e[1]}):null==(s=e[1])?void 0:s.map((e=>{At.push({label:r,name:i,value:e})})):At.push({label:r,name:i,value:e[1][0]})}}));const It=e.jsxRuntimeExports.jsx(v,{currentPage:Me,totalPage:De,totalResult:qe,onChange:e=>(e=>{Ve(e),setTimeout((()=>{p(pe.current,50)}),200)})(e)});return e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[(null==(d=null==G?void 0:G.filter)?void 0:d.enable_on_search)&&"horizontal"===(null==(a=null==G?void 0:G.filter)?void 0:a.layout)?e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:ge?ne:e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:M?e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-filter-horizontal-loading",children:ne}):kt.every((e=>!e))?null:e.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-filter-horizontal-wrapper",children:[e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-filter-horizontal",children:kt}),Boolean((null==At?void 0:At.length)&&(null==(u=null==G?void 0:G.filter)?void 0:u.show_refine_by_block))?e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:Boolean(At.every((e=>!e)))?null:e.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-filter-horizontal",children:[e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-filter-horizontal-refine-item sledge-instant-search__result-filter-horizontal-refine-item-clear-all",onClick:Ct,children:"Clear All"}),At.map(((e,t)=>{const{label:s,name:i,value:n}=e;return St({label:s,name:i,value:n,index:t})}))]})}):null]})})}):null,e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-wrapper","data-filter-layout":null==(c=null==G?void 0:G.filter)?void 0:c.layout,children:e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[(null==(x=null==G?void 0:G.filter)?void 0:x.enable_on_search)&&"vertical"===(null==(h=null==G?void 0:G.filter)?void 0:h.layout)?ge?e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-filter",children:re}):$t.every((e=>!e))?null:e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-filter",children:M?re:e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[Boolean((null==At?void 0:At.length)&&(null==(R=null==G?void 0:G.filter)?void 0:R.show_refine_by_block))?Boolean(At.every((e=>!e)))?null:e.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-filter-item",children:[e.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-filter-item-title-refine",children:[e.jsxRuntimeExports.jsx("strong",{className:"sledge-instant-search__result-filter-item-title-refine-heading",children:"Filter"}),e.jsxRuntimeExports.jsx("span",{className:"sledge-instant-search__result-filter-item-title-refine-clear",onClick:Ct,children:"Clear All"})]}),e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-filter-item-refine-selected-flex",children:At.map(((e,t)=>{const{label:s,name:i,value:n}=e;return St({label:s,name:i,value:n,index:t})}))})]}):null,$t]})}):null,e.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-data",children:[ge?de:e.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-data-keyword",children:["horizontal"===(null==(E=null==G?void 0:G.filter)?void 0:E.layout)&&e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-data-summary sledge-instant-search__result-data-summary-filter-horizontal",children:Xe}),e.jsxRuntimeExports.jsx($,{type:"text",icon:e.jsxRuntimeExports.jsx(S,{width:18,height:18,color:"#868686"}),placeholder:"Search products...",value:O,onChange:({value:e})=>Nt(e),onResetField:()=>Nt(""),className:"sledge-instant-search__result-data-keyword-form",withClearField:!0}),e.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-data-summary-item sledge-instant-search__result-data-summary-select-field",children:[e.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-data-summary-select-field-item",children:[e.jsxRuntimeExports.jsx("span",{children:"Sort by:"}),D&&Boolean(null==D?void 0:D.length)&&e.jsxRuntimeExports.jsx(k,{align:"end",prefixLabel:e.jsxRuntimeExports.jsx("svg",{width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsxRuntimeExports.jsx("path",{d:"M12.6296 4.34737C12.9144 4.34737 13.1497 4.55898 13.1869 4.83354L13.1921 4.90987L13.192 13.7599L15.2892 11.6543C15.5083 11.4341 15.8645 11.4333 16.0847 11.6525C16.2848 11.8517 16.3037 12.1641 16.1408 12.3847L16.0865 12.4479L13.0282 15.5204C13.0097 15.5386 12.991 15.555 12.9712 15.5701L13.0282 15.5204C13.0006 15.5482 12.9708 15.5724 12.9394 15.5932C12.9285 15.6 12.9171 15.607 12.9055 15.6135C12.8946 15.62 12.8837 15.6258 12.8725 15.6311C12.8615 15.6359 12.8504 15.6408 12.8391 15.6454C12.8247 15.6515 12.8099 15.6568 12.795 15.6613C12.7862 15.6637 12.7772 15.6662 12.7681 15.6685C12.7519 15.673 12.7357 15.6763 12.7193 15.6789C12.7116 15.6798 12.7036 15.6809 12.6955 15.6819C12.677 15.6844 12.6587 15.6857 12.6404 15.686C12.6368 15.6857 12.6332 15.6857 12.6296 15.6857L12.6186 15.686C12.6003 15.6857 12.582 15.6844 12.5637 15.6823L12.6296 15.6857C12.5989 15.6857 12.5689 15.6833 12.5396 15.6785C12.5233 15.6763 12.5071 15.673 12.4909 15.6689C12.4824 15.6663 12.4738 15.6639 12.4654 15.6614C12.4493 15.6569 12.4332 15.6512 12.4174 15.6448C12.4088 15.6408 12.4005 15.6372 12.3922 15.6333C12.3793 15.6278 12.3663 15.6211 12.3535 15.6139C12.342 15.6069 12.3307 15.6 12.3196 15.5926C12.3109 15.5875 12.3024 15.5815 12.294 15.5752L12.288 15.5701C12.2682 15.555 12.2494 15.5386 12.2318 15.5209L12.2308 15.5204L9.1725 12.4479C8.95334 12.2278 8.95416 11.8716 9.17434 11.6525C9.3745 11.4532 9.68704 11.4358 9.90687 11.5997L9.96983 11.6543L12.067 13.7614L12.0671 4.90987C12.0671 4.59921 12.3189 4.34737 12.6296 4.34737ZM5.18325 2.3122L5.19421 2.31189C5.21254 2.31224 5.23085 2.31348 5.24908 2.31562L5.18325 2.3122C5.21389 2.3122 5.24396 2.31465 5.27328 2.31937C5.28931 2.32156 5.3054 2.32487 5.32136 2.32889C5.33074 2.33164 5.3403 2.33433 5.34975 2.33725C5.36452 2.34142 5.37882 2.34648 5.39293 2.35213C5.40313 2.35668 5.41346 2.36119 5.42362 2.366C5.4357 2.37123 5.4476 2.37737 5.45931 2.38397C5.46933 2.39014 5.47926 2.39616 5.48898 2.40246C5.49898 2.40841 5.50899 2.41537 5.51882 2.42269L5.582 2.47746L8.64033 5.54996C8.85949 5.77013 8.85867 6.12629 8.63849 6.34545C8.43833 6.54469 8.12579 6.56212 7.90596 6.39822L7.843 6.34361L5.74525 4.23564L5.74575 13.088C5.74575 13.3987 5.49391 13.6505 5.18325 13.6505C4.89848 13.6505 4.66313 13.4389 4.62588 13.1644L4.62075 13.088L4.62025 4.23639L2.52367 6.34361C2.32443 6.54377 2.01197 6.56265 1.79139 6.39977L1.72817 6.34545C1.52801 6.14621 1.50914 5.83376 1.67202 5.61317L1.72633 5.54996L4.78467 2.47746L4.81779 2.44709C4.82557 2.44043 4.83353 2.43399 4.84167 2.42776L4.78467 2.47746C4.81226 2.44974 4.84202 2.42549 4.87341 2.40473C4.88436 2.39791 4.89574 2.39094 4.90738 2.38438C4.91819 2.37787 4.92917 2.37215 4.9403 2.36682C4.95128 2.36196 4.96242 2.35706 4.97375 2.35251C4.98814 2.34636 5.00289 2.34115 5.0178 2.33657C5.02687 2.33414 5.03616 2.33154 5.04555 2.32918C5.06066 2.32503 5.07593 2.32186 5.09129 2.31932C5.10053 2.31817 5.10959 2.31691 5.11871 2.31586C5.13607 2.31348 5.15388 2.31227 5.17171 2.3119C5.17564 2.31224 5.17944 2.3122 5.18325 2.3122Z",fill:"black"})}),options:D.map((e=>{const{label:t,value:s}=e;return{label:t,value:s}})),value:Ce,onChange:({label:e,value:t})=>((e,t)=>{fe(!1),Ne(e),ye(t)})(e,t)})]}),e.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-data-summary-select-field-item",children:[e.jsxRuntimeExports.jsx("span",{children:"Limit:"}),(null==(y=null==G?void 0:G.search)?void 0:y.allowed_limit)&&Boolean(null==(N=null==(b=null==G?void 0:G.search)?void 0:b.allowed_limit)?void 0:N.length)&&e.jsxRuntimeExports.jsx(k,{align:"end",options:G.search.allowed_limit.map((e=>({label:e,value:e}))),value:Se,onChange:({value:e})=>(e=>{Ee(!1),Le(e)})(e)})]})]})]}),ve?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[oe,(null==We?void 0:We.length)?It:null]}):e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:["vertical"===(null==(A=null==G?void 0:G.filter)?void 0:A.layout)&&e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-data-summary sledge-instant-search__result-data-summary-filter-vertical",children:Xe}),(null==We?void 0:We.length)?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(z,{sourceApp:"instant-search",type:"large",data:We.map((e=>{const{variants:t,...s}=e||{};return{product:s,variants:t}})),setting:{show_vendor:null==(I=null==G?void 0:G.search)?void 0:I.show_vendor,show_sku:null==(P=null==G?void 0:G.search)?void 0:P.show_sku,show_price:null==(W=null==G?void 0:G.search)?void 0:W.show_price},isComponentJsVersion:te,cards:se,showOptionOutOfStock:!0,onAfterAddToCart:ae,onAfterAddWishlist:ue,onAfterRemoveWishlist:ce,onAfterRenderProduct:xe}),It]}):e.jsxRuntimeExports.jsx(le,{})]})]})]})})]})},ne=s=>{var i,n,l,r;const{keyword:o,clickedTabIndexId:d,clickedTabIndexName:a,setKeyword:u,searchResultContainerRef:c}=s||{},[x,m]=t.useState(!0),[h,g]=t.useState(!0),[j,_]=t.useState(""),[w,f]=t.useState([]),[R,E]=t.useState(0),[C,y]=t.useState(1),[b,N]=t.useState(0),[L,k]=t.useState(0),[A,I]=t.useState(null),P=T({keyword:o}),W=async()=>{if(!d)return;let t;g(!0);let s={q:o,sort:j?[j]:[],page:C,hitsPerPage:12};t=await V(d,s),(t=>{if(!t)return;const{hits:s,processingTimeMs:i,totalHits:n,totalPages:l}=t;m(!1),g(!1),f(s),E(i||0),N(l),k(n||0),I(e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-data-summary-item",children:e.jsxRuntimeExports.jsxs("span",{className:"sledge-instant-search__result-data-summary-text",children:[n," result"," ",(null==o?void 0:o.length)?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:["for ",e.jsxRuntimeExports.jsxs("span",{className:"sledge-instant-search__result-data-summary-text-keyword",children:['"',o,'"']})]}):null]})}))})(t)};t.useEffect((()=>{if(Boolean(P&&(null==P?void 0:P.keyword)!==o)){const e=setTimeout((()=>{W()}),500);return()=>clearTimeout(e)}W()}),[j,o,C,d]);const B=e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-data-keyword sledge-instant-search__result-data-keyword-category",children:e.jsxRuntimeExports.jsx($,{type:"text",icon:e.jsxRuntimeExports.jsx(S,{width:18,height:18,color:"#868686"}),placeholder:`Search ${a?a.toLowerCase():""}...`,value:o,onChange:({value:e})=>u&&u(e),onResetField:()=>u&&u(""),className:"sledge-instant-search__result-data-keyword-form",withClearField:!0})}),O=e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-data-summary",children:e.jsxRuntimeExports.jsx(X.Item,{width:"117px",height:"28px",color:"grey-100",rounded:"md",animationDuration:"18s"})}),F=(null==(i=String(d))?void 0:i.includes("collection"))?e.jsxRuntimeExports.jsx(X.CollectionGrid,{count:3}):(null==(n=String(d))?void 0:n.includes("page"))?e.jsxRuntimeExports.jsx(X.PageGrid,{count:12}):(null==(l=String(d))?void 0:l.includes("blog"))||(null==(r=String(d))?void 0:r.includes("article"))?e.jsxRuntimeExports.jsx(X.BlogGrid,{count:12}):null,M=()=>e.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-data-category-wrapper",children:[B,O,F]}),D=()=>e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[B,O,F]}),H=t=>{var s,i,n,l;return(null==(s=String(d))?void 0:s.includes("collection"))?e.jsxRuntimeExports.jsx(Z,{...t}):(null==(i=String(d))?void 0:i.includes("page"))?e.jsxRuntimeExports.jsx(J,{...t}):(null==(n=String(d))?void 0:n.includes("blog"))||(null==(l=String(d))?void 0:l.includes("article"))?e.jsxRuntimeExports.jsx(U,{...t}):null};return e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-wrapper",children:x?e.jsxRuntimeExports.jsx(M,{}):e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-data-category-wrapper",children:h?e.jsxRuntimeExports.jsx(D,{}):e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[B,e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-data-summary",children:A}),(null==w?void 0:w.length)?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(H,{data:w.map((e=>{const{id:t,title:s,url:i}=e;return{id:t,title:s,description:`${s}${a?` ${a.toLowerCase()}`:""}`,url:i,image:""}}))}),e.jsxRuntimeExports.jsx(v,{currentPage:C,totalPage:b,totalResult:L,onChange:e=>(e=>{y(e),setTimeout((()=>{p(c.current,50)}),200)})(e)})]}):e.jsxRuntimeExports.jsx(le,{})]})})})},le=s=>{const[i,n]=t.useState(""),[l,r]=t.useState("");return t.useEffect((()=>{n("No results found"),r("Your search did not match any results. <br/> Please try again")}),[]),e.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-empty",children:[e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-empty-title",dangerouslySetInnerHTML:{__html:i}}),e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-empty-description",dangerouslySetInnerHTML:{__html:l}})]})};exports.ProductFilterWidget=t=>e.jsxRuntimeExports.jsx(se,{layoutType:"product-filter",...t}),exports.SearchIconWidget=i=>{const{isRenderApp:n,isJsVersion:l}=t.useContext(s.SledgeContext),{size:r="sm",children:o,onAfterAddToCart:d,onAfterAddWishlist:a,onAfterRemoveWishlist:u,onAfterRenderProduct:c}=i||{};let p=null,m=null,h=null,g=null;t.Children.map(o,(e=>{if(t.isValidElement(e)&&x(e.type)){const{productCard:t,suggestionKeywordList:s,otherIndexList:i,searchViewMoreResult:n}=(null==e?void 0:e.props)||{};t&&x(t)&&(p=t),s&&x(s)&&(m=s),i&&x(i)&&(h=i),n&&x(n)&&(g=n)}}));const[j,v]=t.useState({width:0,height:0});t.useEffect((()=>{(null==n?void 0:n.instantSearch)&&v("xs"===r?{width:14,height:14}:"sm"===r?{width:20,height:20}:{width:25,height:25})}),[n]);return e.jsxRuntimeExports.jsx("span",{className:"sledge-instant-search__icon-widget",onClick:()=>{"undefined"!=typeof window&&window.sledgeInstantSearchIconWidgetPopup&&window.sledgeInstantSearchIconWidgetPopup({onAfterAddToCart:d,onAfterAddWishlist:a,onAfterRemoveWishlist:u,onAfterRenderProduct:c,isJsVersion:l,productCardsComponent:p,suggestionKeywordListsComponent:m,otherIndexListsComponent:h,searchViewMoreResultComponent:g})},children:e.jsxRuntimeExports.jsx(S,{...j,color:"currentColor"})})},exports.SearchIconWidgetPopup=()=>{var s,i,n,l,r,o,a,u,c,x,p,m,h,g,j,v,_,w,f,R,E,C;const[y,b]=t.useState(!0),[N,L]=t.useState(!1),[k,A]=t.useState(""),[I,P]=t.useState(""),[W,B]=t.useState([]),[O,F]=t.useState([]),[M,V]=t.useState([]),[q,Z]=t.useState([]),[J,U]=t.useState({}),[G,Y]=t.useState({}),[se,ie]=t.useState(""),[ne,le]=t.useState({onAfterAddToCart:e=>{},onAfterAddWishlist:e=>{},onAfterRemoveWishlist:e=>{},onAfterRenderProduct:e=>{},isJsVersion:null,productCardsComponent:null,suggestionKeywordListsComponent:null,otherIndexListsComponent:null,searchViewMoreResultComponent:null}),re=t.useRef(null),oe=T({keyword:k}),de=async(e,t=!1)=>{var s,i,n,l,r,o,d,a,u,c,x;if(!N)return;b(!0);const{tabs:p,suffix_index_product:m,hidden_tags:h,display:g}=e,j=(null==(s=null==g?void 0:g.search)?void 0:s.suggestion)||{};let v,_={queries:p.map((e=>{var t;const{index:s}=e;let i=s.includes(m),n=[];return(null==h?void 0:h.length)&&n.push(`tags NOT IN [${h}]`),(null==(t=null==g?void 0:g.filter)?void 0:t.show_out_of_stock)||n.push("variants.inventory_quantity > 0"),{indexUid:s,q:k,hitsPerPage:i?6:4,filter:i?n.join(" AND "):""}}))};if(v=await D(_),!v)return;const{results:w}=v;let f=null==w?void 0:w.filter((({indexUid:e})=>null==e?void 0:e.includes(m)));t&&(null==k?void 0:k.length)&&H({keyword:k,resultCount:(null==(i=f[0])?void 0:i.totalHits)||0});let R=(null==(n=null==w?void 0:w.filter((({indexUid:e})=>!(null==e?void 0:e.includes(m)))))?void 0:n.map((e=>{const{indexUid:t}=e,{name:s}=null==p?void 0:p.find((({index:e})=>e.includes(t)));return{...e,name:s||""}})))||[],E=(null==f?void 0:f.length)?null==(l=f[0])?void 0:l.hits:[],C=k.length?(null==E?void 0:E.length)?"":"no_result":"zero_character",y=Boolean(!k.length&&Object.keys(j).length&&(null==(o=null==(r=j[C])?void 0:r.products)?void 0:o.active)&&(null==(u=null==(a=null==(d=j[C])?void 0:d.products)?void 0:a.list)?void 0:u.length));B(y?null==(x=null==(c=j[C])?void 0:c.products)?void 0:x.list:E),F(R),ie(C),b(!1)};return t.useEffect((()=>{"undefined"!=typeof window&&(window.sledgeInstantSearchIconWidgetPopup=({onAfterAddToCart:e=(()=>{}),onAfterAddWishlist:t=(()=>{}),onAfterRemoveWishlist:s=(()=>{}),onAfterRenderProduct:i=(()=>{}),isJsVersion:n=null,productCardsComponent:l=(()=>{}),suggestionKeywordListsComponent:r=(()=>{}),otherIndexListsComponent:o=(()=>{}),searchViewMoreResultComponent:d=(()=>{})})=>{L(!0),le({onAfterAddToCart:e,onAfterAddWishlist:t,onAfterRemoveWishlist:s,onAfterRenderProduct:i,isJsVersion:n,productCardsComponent:l,suggestionKeywordListsComponent:r,otherIndexListsComponent:o,searchViewMoreResultComponent:d}),setTimeout((()=>{(null==re?void 0:re.current)&&(re.current.focus(),re.current.value=k)}),500)}),(async e=>{var t;if(!N)return;let s,i=!1;if(s=JSON.parse(e),!s)return;const{status:n,data:l}=s,{code:r}=n,{tabs:o,suffix_index_product:d,hidden_tags:a,display:u}=l;i=200===r||!1,i&&(V(o),P(d),Z(a),U(u),Y(null==(t=null==u?void 0:u.search)?void 0:t.suggestion),await de(l))})(localStorage.getItem(d)||"")}),[N]),t.useEffect((()=>{if(Boolean(oe&&(null==oe?void 0:oe.keyword)!==k)){const e=setTimeout((()=>{de({tabs:M,suffix_index_product:I,hidden_tags:q,display:J},!0)}),500);return()=>clearTimeout(e)}}),[k]),e.jsxRuntimeExports.jsx(e.$5d3850c4d0b4e6c7$export$be92b6f5f03c0fe9,{open:N,onOpenChange:L,children:e.jsxRuntimeExports.jsxs(e.$5d3850c4d0b4e6c7$export$602eac185826482c,{children:[e.jsxRuntimeExports.jsx(e.$5d3850c4d0b4e6c7$export$c6fdb837b070b4ff,{className:"sledge__popup-overlay"}),e.jsxRuntimeExports.jsx(e.$5d3850c4d0b4e6c7$export$c6fdb837b070b4ff,{className:"sledge__popup-overlay-blur"}),e.jsxRuntimeExports.jsxs(e.$5d3850c4d0b4e6c7$export$7c6e2c02157bb7d2,{className:"sledge-instant-search__icon-widget-popup-detail-content","data-layout-type":(null==(s=null==J?void 0:J.search)?void 0:s.layout)||"",children:[e.jsxRuntimeExports.jsx($,{type:"text",icon:e.jsxRuntimeExports.jsx(S,{width:20,height:20,color:"#000000"}),placeholder:"Search anything...",value:k,fieldRef:re,onChange:({value:e})=>A(e),className:"sledge-instant-search__icon-widget-search-form-field",withClearField:!0}),e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__icon-widget-search-form-result",children:y?e.jsxRuntimeExports.jsx(K,{children:e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__icon-widget-search-form-result-wrapper",children:e.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__icon-widget-search-form-result-flex",children:[e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__icon-widget-search-form-result-flex-item-other sledge-instant-search__icon-widget-search-form-result-flex-item-other-skeleton",children:[0,1,2].map((s=>e.jsxRuntimeExports.jsxs(t.Fragment,{children:[e.jsxRuntimeExports.jsx(X.Item,{width:"100%",height:"42px",color:"grey-100",rounded:"md",...Boolean(s)&&{style:{marginTop:"12px"}}}),e.jsxRuntimeExports.jsx("div",{style:{display:"flex",flexDirection:"column",justifyContent:"center",gap:"12px",marginTop:"12px"},children:[1,2,3].map((t=>e.jsxRuntimeExports.jsx(X.Item,{width:"100%",height:"28px",color:"grey-100",rounded:"md",animationDuration:"13s",style:{maxWidth:"140px"}},t)))})]},s)))}),e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__icon-widget-search-form-result-flex-item-product",children:e.jsxRuntimeExports.jsx(X.ProductGrid,{count:6,type:"medium"})})]})})}):e.jsxRuntimeExports.jsx(K,{children:e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__icon-widget-search-form-result-wrapper",children:e.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__icon-widget-search-form-result-flex",children:[e.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__icon-widget-search-form-result-flex-item-other",children:[Object.keys(G).length&&(null==(n=null==(i=G[se])?void 0:i.keywords)?void 0:n.active)&&(null==(o=null==(r=null==(l=G[se])?void 0:l.keywords)?void 0:r.list)?void 0:o.length)?e.jsxRuntimeExports.jsx(ee,{listsComponent:ne.suggestionKeywordListsComponent,keywords:G[se].keywords.list,isComponentJsVersion:ne.isJsVersion,showPopupComponent:N,setShowPopupComponent:L}):null,O&&O.map(((s,i)=>{const{hits:n,name:l}=s;return e.jsxRuntimeExports.jsx(t.Fragment,{children:e.jsxRuntimeExports.jsx(Q,{listsComponent:ne.otherIndexListsComponent,name:l,items:n,isComponentJsVersion:ne.isJsVersion,showPopupComponent:N,setShowPopupComponent:L})},i)}))]}),e.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__icon-widget-search-form-result-flex-item-product",children:[(null==W?void 0:W.length)?e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__icon-widget-search-form-result-product",children:e.jsxRuntimeExports.jsx(z,{sourceApp:"instant-search",type:"medium",data:W.map((e=>{const{variants:t,...s}=e||{};return{product:s,variants:t}})),setting:{show_vendor:null==(a=null==J?void 0:J.search)?void 0:a.show_vendor,show_sku:null==(u=null==J?void 0:J.search)?void 0:u.show_sku,show_price:null==(c=null==J?void 0:J.search)?void 0:c.show_price},showOptionOutOfStock:!0,isComponentJsVersion:ne.isJsVersion,cards:ne.productCardsComponent,onAfterAddToCart:ne.onAfterAddToCart,onAfterAddWishlist:ne.onAfterAddWishlist,onAfterRemoveWishlist:ne.onAfterRemoveWishlist,onAfterRenderProduct:ne.onAfterRenderProduct,showPopupComponent:N,setShowPopupComponent:L})}):Object.keys(G).length&&(null==(p=null==(x=G[se])?void 0:x.products)?void 0:p.active)&&(null==(g=null==(h=null==(m=G[se])?void 0:m.products)?void 0:h.list)?void 0:g.length)?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__icon-widget-search-form-result-product-suggestion-no-result-text",children:[e.jsxRuntimeExports.jsx("span",{children:"Sorry"}),", nothing found for ",e.jsxRuntimeExports.jsx("span",{children:k}),". Did you mean:"]}),e.jsxRuntimeExports.jsx(z,{sourceApp:"instant-search",type:"medium",data:G[se].products.list.map((e=>{const{variants:t,...s}=e||{};return{product:s,variants:t}})),setting:{show_vendor:null==(j=null==J?void 0:J.search)?void 0:j.show_vendor,show_sku:null==(v=null==J?void 0:J.search)?void 0:v.show_sku,show_price:null==(_=null==J?void 0:J.search)?void 0:_.show_price},showOptionOutOfStock:!0,isComponentJsVersion:ne.isJsVersion,cards:ne.productCardsComponent,onAfterAddToCart:ne.onAfterAddToCart,onAfterAddWishlist:ne.onAfterAddWishlist,onAfterRemoveWishlist:ne.onAfterRemoveWishlist,onAfterRenderProduct:ne.onAfterRenderProduct,showPopupComponent:N,setShowPopupComponent:L})]}):e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__icon-widget-search-form-result-title",children:"Products"}),e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__icon-widget-search-form-result-item-disabled",children:"No product were found"})]}),(null==W?void 0:W.length)||Object.keys(G).length&&(null==(f=null==(w=G[se])?void 0:w.products)?void 0:f.active)&&(null==(C=null==(E=null==(R=G[se])?void 0:R.products)?void 0:E.list)?void 0:C.length)?e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__icon-widget-button-more-wrapper",children:e.jsxRuntimeExports.jsx(te,{component:ne.searchViewMoreResultComponent,keyword:k,isComponentJsVersion:ne.isJsVersion,showPopupComponent:N,setShowPopupComponent:L})}):null]})]})})})})]})]})})},exports.SearchResultWidget=se,exports.SearchWidget=i=>{var n,l,r,o,a,u,c,p,m,h,g,j,v,_,w,f,R,E,C,y,b;const{isRenderApp:N,isJsVersion:L}=t.useContext(s.SledgeContext),{width:k="400px",children:A,onAfterAddToCart:I,onAfterAddWishlist:P,onAfterRemoveWishlist:W,onAfterRenderProduct:B}=i;let F=null,M=null,V=null,q=null;t.Children.map(A,(e=>{if(t.isValidElement(e)&&x(e.type)){const{productCard:t,suggestionKeywordList:s,otherIndexList:i,searchViewMoreResult:n}=(null==e?void 0:e.props)||{};t&&x(t)&&(F=t),s&&x(s)&&(M=s),i&&x(i)&&(V=i),n&&x(n)&&(q=n)}}));const[Z,J]=t.useState(!0),[U,G]=t.useState(""),[Y,se]=t.useState(""),[ie,ne]=t.useState([]),[le,re]=t.useState([]),[oe,de]=t.useState([]),[ae,ue]=t.useState([]),[ce,xe]=t.useState({}),[pe,me]=t.useState({}),[he,ge]=t.useState(""),je=T({keyword:U}),ve=async(e,t=!1)=>{var s,i,n,l,r,o,d,a,u,c,x;if(!U.length)return;J(!0);const{tabs:p,suffix_index_product:m,hidden_tags:h,display:g}=e,j=(null==(s=null==g?void 0:g.search)?void 0:s.suggestion)||{};let v,_={queries:p.map((e=>{var t;const{index:s}=e;let i=s.includes(m),n=[];return(null==h?void 0:h.length)&&n.push(`tags NOT IN [${h}]`),(null==(t=null==g?void 0:g.filter)?void 0:t.show_out_of_stock)||n.push("variants.inventory_quantity > 0"),{indexUid:s,q:U,hitsPerPage:i?6:4,filter:i?n.join(" AND "):""}}))};if(v=await D(_),!v)return;const{results:w}=v;let f=null==w?void 0:w.filter((({indexUid:e})=>null==e?void 0:e.includes(m)));t&&(null==U?void 0:U.length)&&H({keyword:U,resultCount:(null==(i=f[0])?void 0:i.totalHits)||0});let R=(null==(n=null==w?void 0:w.filter((({indexUid:e})=>!(null==e?void 0:e.includes(m)))))?void 0:n.map((e=>{const{indexUid:t}=e,{name:s}=null==p?void 0:p.find((({index:e})=>e.includes(t)));return{...e,name:s||""}})))||[],E=(null==f?void 0:f.length)?null==(l=f[0])?void 0:l.hits:[],C=U.length?(null==E?void 0:E.length)?"":"no_result":"zero_character",y=Boolean(!U.length&&Object.keys(j).length&&(null==(o=null==(r=j[C])?void 0:r.products)?void 0:o.active)&&(null==(u=null==(a=null==(d=j[C])?void 0:d.products)?void 0:a.list)?void 0:u.length));ne(y?null==(x=null==(c=j[C])?void 0:c.products)?void 0:x.list:E),re(R),ge(C),J(!1)};t.useEffect((()=>{(null==N?void 0:N.instantSearch)&&(async e=>{var t;if(!U.length)return;let s,i=!1;if(s=JSON.parse(e),!s)return;const{status:n,data:l}=s,{code:r}=n,{tabs:o,suffix_index_product:d,hidden_tags:a,display:u}=l;i=200===r||!1,i&&(de(o),se(d),ue(a),xe(u),me(null==(t=null==u?void 0:u.search)?void 0:t.suggestion),await ve(l))})(localStorage.getItem(d)||"")}),[U]),t.useEffect((()=>{if(Boolean(je&&(null==je?void 0:je.keyword)!==U)){const e=setTimeout((()=>{ve({tabs:oe,suffix_index_product:Y,hidden_tags:ae,display:ce},!0)}),500);return()=>clearTimeout(e)}}),[U]);const _e={maxWidth:k};return e.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__widget-search-form-wrapper",style:_e,children:[e.jsxRuntimeExports.jsx($,{type:"text",icon:e.jsxRuntimeExports.jsx(S,{width:18,height:18,color:"#868686"}),placeholder:"Search anything",value:U,onChange:({value:e})=>G(e),onResetField:()=>G(""),withClearField:!0}),e.jsxRuntimeExports.jsx(e.motion.div,{initial:"hidden",animate:U.length?"visible":"hidden",variants:O,className:"sledge-instant-search__widget-search-form-result",children:Z?e.jsxRuntimeExports.jsx(K,{children:e.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__widget-search-form-result-flex",children:[e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__widget-search-form-result-flex-item-other sledge-instant-search__widget-search-form-result-flex-item-other-skeleton",children:[0,1,2].map((s=>e.jsxRuntimeExports.jsxs(t.Fragment,{children:[e.jsxRuntimeExports.jsx(X.Item,{width:"100%",height:"42px",color:"grey-100",rounded:"md",...Boolean(s)&&{style:{marginTop:"12px"}}}),e.jsxRuntimeExports.jsx("div",{style:{display:"flex",flexDirection:"column",justifyContent:"center",gap:"12px",marginTop:"12px"},children:[1,2,3].map((t=>e.jsxRuntimeExports.jsx(X.Item,{width:"100%",height:"28px",color:"grey-100",rounded:"md",animationDuration:"13s",style:{maxWidth:"140px"}},t)))})]},s)))}),e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__widget-search-form-result-flex-item-product",children:e.jsxRuntimeExports.jsx(X.ProductGrid,{count:6,type:"small"})})]})}):e.jsxRuntimeExports.jsx(K,{isLoading:Z,withCorner:!1,children:e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__widget-search-form-result-flex",children:[e.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__widget-search-form-result-flex-item-other",children:[Object.keys(pe).length&&(null==(l=null==(n=pe[he])?void 0:n.keywords)?void 0:l.active)&&(null==(a=null==(o=null==(r=pe[he])?void 0:r.keywords)?void 0:o.list)?void 0:a.length)?e.jsxRuntimeExports.jsx(ee,{listsComponent:M,keywords:pe[he].keywords.list,isComponentJsVersion:L}):null,le.map(((s,i)=>{const{hits:n,name:l}=s;return e.jsxRuntimeExports.jsx(t.Fragment,{children:e.jsxRuntimeExports.jsx(Q,{listsComponent:V,name:l,items:n,isComponentJsVersion:L})},i)}))]}),e.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__widget-search-form-result-flex-item-product",children:[e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__widget-search-form-result-title-product",children:"Products"}),(null==ie?void 0:ie.length)?e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__widget-search-form-result-product",children:e.jsxRuntimeExports.jsx(z,{sourceApp:"instant-search",type:"small",data:ie.map((e=>{const{variants:t,...s}=e||{};return{product:s,variants:t}})),setting:{show_vendor:null==(u=null==ce?void 0:ce.search)?void 0:u.show_vendor,show_sku:null==(c=null==ce?void 0:ce.search)?void 0:c.show_sku,show_price:null==(p=null==ce?void 0:ce.search)?void 0:p.show_price},showOptionOutOfStock:!0,isComponentJsVersion:L,cards:F,onAfterAddToCart:I,onAfterAddWishlist:P,onAfterRemoveWishlist:W,onAfterRenderProduct:B})}):Object.keys(pe).length&&(null==(h=null==(m=pe[he])?void 0:m.products)?void 0:h.active)&&(null==(v=null==(j=null==(g=pe[he])?void 0:g.products)?void 0:j.list)?void 0:v.length)?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__widget-search-form-result-product-suggestion-no-result-text",children:[e.jsxRuntimeExports.jsx("span",{children:"Sorry, nothing found for"})," ",e.jsxRuntimeExports.jsx("strong",{children:U}),". ",e.jsxRuntimeExports.jsx("span",{children:"Did you mean:"})]}),e.jsxRuntimeExports.jsx(z,{sourceApp:"instant-search",type:"small",data:pe[he].products.list.map((e=>{const{variants:t,...s}=e||{};return{product:s,variants:t}})),setting:{show_vendor:null==(_=null==ce?void 0:ce.search)?void 0:_.show_vendor,show_sku:null==(w=null==ce?void 0:ce.search)?void 0:w.show_sku,show_price:null==(f=null==ce?void 0:ce.search)?void 0:f.show_price},showOptionOutOfStock:!0,isComponentJsVersion:L,cards:F,onAfterAddToCart:I,onAfterAddWishlist:P,onAfterRemoveWishlist:W,onAfterRenderProduct:B})]}):e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__widget-search-form-result-product-disabled",children:"No product were found"})]})]}),(null==ie?void 0:ie.length)||Object.keys(pe).length&&(null==(E=null==(R=pe[he])?void 0:R.products)?void 0:E.active)&&(null==(b=null==(y=null==(C=pe[he])?void 0:C.products)?void 0:y.list)?void 0:b.length)?e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__widget-button-more-wrapper",children:e.jsxRuntimeExports.jsx(te,{component:q,keyword:U,isComponentJsVersion:L})}):null]})})})]})};
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./vendor-024ba8ae.cjs"),t=require("react"),s=require("@sledge-app/core");require("react-dom");const i="https://sledge-api-preprod.offstack.io",n="sledge-auth-app",l="sledge-instant-search-auth-app",r="sledge-wishlist-setting",o="sledge-product-review-setting",d="sledge-instant-search-setting",a="/pages/search-result",u={ELEMENT_WIDGET:"product-review-widget"},c=e=>{if(!e)return"";let t=String(e);if(t.includes("shopify")&&t.includes("/")){let e=t.split("/");return e[e.length-1]||t}return t},x=e=>"function"==typeof e,p=(e,t)=>{if(e){var s=(null==e?void 0:e.getBoundingClientRect().top)+window.scrollY-t;window.scrollTo({top:s,behavior:"smooth"})}},m=({trigger:s,content:i,isOpen:n,setIsOpen:l,hideCloseIcon:r,align:o,className:d,withOpenState:a=!0,withArrow:u=!0,customArrow:c="",sideOffset:x=5,alignOffset:p=0})=>{const[m,h]=t.useState(!!a&&n);return t.useEffect((()=>{var e;let t=null==(e=null==document?void 0:document.querySelector(".PopoverArrow"))?void 0:e.parentElement;t&&(null==c?void 0:c.length)&&(t.style.display="inline-flex",t.innerHTML=c)}),[m]),e.jsxRuntimeExports.jsxs(e.$cb5cc270b50c6fcd$export$be92b6f5f03c0fe9,{...a&&{open:n},...l&&{onOpenChange:e=>{h(e),l(e)}},children:[e.jsxRuntimeExports.jsx(e.$cb5cc270b50c6fcd$export$41fb9f06171c75f4,{asChild:!0,children:s}),e.jsxRuntimeExports.jsx(e.$cb5cc270b50c6fcd$export$602eac185826482c,{children:e.jsxRuntimeExports.jsxs(e.$cb5cc270b50c6fcd$export$7c6e2c02157bb7d2,{className:`sledge__popover-content ${d||""}`,sideOffset:x,alignOffset:p,align:o,...l&&{onOpenAutoFocus:()=>l(!0),onCloseAutoFocus:()=>l(!1)},children:[i,!r&&e.jsxRuntimeExports.jsx(e.$cb5cc270b50c6fcd$export$f39c2d165cd861fe,{className:"PopoverClose","aria-label":"Close",children:e.jsxRuntimeExports.jsx("svg",{width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsxRuntimeExports.jsx("path",{d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})}),u?e.jsxRuntimeExports.jsx(e.$cb5cc270b50c6fcd$export$21b07c8f274aebd5,{className:"PopoverArrow"}):null]})})]})},h=({value:s,total:i,fillColor:n="",outlineColor:l=""})=>{const[r,o]=t.useState(0);return t.useEffect((()=>{const e=setTimeout((()=>o(+s/i*100)),150);return()=>clearTimeout(e)}),[]),e.jsxRuntimeExports.jsx(e.$67824d98245208a0$export$be92b6f5f03c0fe9,{className:"sledge__progress",value:r,style:l?{borderWidth:"1px",borderStyle:"solid",borderColor:l}:{},children:e.jsxRuntimeExports.jsx(e.$67824d98245208a0$export$adb584737d712b70,{className:"ProgressIndicator",style:{transform:`translateX(-${100-r}%)`,...n&&{backgroundColor:n}}})})},g=({id:t,name:s,value:i,required:n,label:l,defaultChecked:r,labelStyle:o={},onClick:d})=>e.jsxRuntimeExports.jsxs("div",{className:"sledge__checkbox-wrapper",children:[e.jsxRuntimeExports.jsx(e.$e698a72e93240346$export$be92b6f5f03c0fe9,{className:"sledge__checkbox-root",defaultChecked:r,id:t,name:s,value:i,required:n,onClick:d,children:e.jsxRuntimeExports.jsx(e.$e698a72e93240346$export$adb584737d712b70,{className:"sledge__checkbox-indicator",children:e.jsxRuntimeExports.jsx("svg",{width:10,height:8,viewBox:"0 0 10 8",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.72318 0.237414C10.0707 0.574491 10.0942 1.14584 9.77561 1.51356L4.40976 7.70711C4.25243 7.88871 4.03181 7.99443 3.79903 7.99979C3.56625 8.00514 3.3415 7.90965 3.17686 7.73545L0.250031 4.63868C-0.0833435 4.28595 -0.0833435 3.71406 0.250031 3.36133C0.583405 3.00859 1.12391 3.00859 1.45729 3.36133L3.75367 5.79105L8.51706 0.292899C8.83564 -0.0748211 9.37564 -0.0996624 9.72318 0.237414Z",fill:"white"})})})}),l&&e.jsxRuntimeExports.jsx("label",{className:"sledge__checkbox-label",htmlFor:t,style:o,children:l})]}),j=s=>{const{defaultValue:i,min:n,max:l,step:r=1,setValueCommit:o,setValueChange:d}=s,[a,u]=t.useState(i);return e.jsxRuntimeExports.jsx("form",{children:e.jsxRuntimeExports.jsxs(e.$faa2e61a3361514f$export$be92b6f5f03c0fe9,{className:"sledge__SliderRoot",defaultValue:i,min:n,max:l,step:r,"aria-label":"Volume",onValueCommit:e=>{o&&o(e),u(e)},onValueChange:e=>{d&&d(e),u(e)},children:[e.jsxRuntimeExports.jsx(e.$faa2e61a3361514f$export$13921ac0cc260818,{className:"sledge__SliderTrack",children:e.jsxRuntimeExports.jsx(e.$faa2e61a3361514f$export$9a58ef0d7ad3278c,{className:"sledge__SliderRange"})}),e.jsxRuntimeExports.jsx(G,{content:a[0],customArrow:'<svg width="19" height="5" viewBox="0 0 19 5" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M9 4.99998C9 9.48298e-05 16.4996 1.99678e-05 18.4999 0L9 2.2985e-06L0.5 2.04891e-06C9 2.2985e-06 9 4.99998 9 4.99998Z" fill="#23BC45"/></svg>',wrapTrigger:!1,children:e.jsxRuntimeExports.jsx(e.$faa2e61a3361514f$export$6521433ed15a34db,{className:"sledge__SliderThumb"})}),e.jsxRuntimeExports.jsx(G,{content:a[1],customArrow:'<svg width="19" height="5" viewBox="0 0 19 5" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M9 4.99998C9 9.48298e-05 16.4996 1.99678e-05 18.4999 0L9 2.2985e-06L0.5 2.04891e-06C9 2.2985e-06 9 4.99998 9 4.99998Z" fill="#23BC45"/></svg>',wrapTrigger:!1,children:e.jsxRuntimeExports.jsx(e.$faa2e61a3361514f$export$6521433ed15a34db,{className:"sledge__SliderThumb"})})]})})},v=({currentPage:t,totalPage:s,totalResult:i,onChange:n})=>{const l=1===t,r=t===s;return e.jsxRuntimeExports.jsxs("div",{className:"sledge__pagination",children:[e.jsxRuntimeExports.jsx("button",{type:"button",className:"sledge__pagination-navigation",...l?{disabled:!0}:{onClick:()=>n(t-1)},children:e.jsxRuntimeExports.jsx(y,{width:17,height:17,color:"black"})}),e.jsxRuntimeExports.jsxs("span",{children:["Page ",t," of ",s," - total ",i," result"]}),e.jsxRuntimeExports.jsx("button",{type:"button",className:"sledge__pagination-navigation",...r?{disabled:!0}:{onClick:()=>n(t+1)},children:e.jsxRuntimeExports.jsx(b,{width:17,height:17,color:"black"})})]})},_=({id:t,name:s,required:i,defaultValue:n,items:l,labelStyle:r={},onValueChange:o})=>e.jsxRuntimeExports.jsx("div",{className:"sledge__radio-group-wrapper",children:e.jsxRuntimeExports.jsx("form",{children:e.jsxRuntimeExports.jsx(e.$f99a8c78507165f7$export$be92b6f5f03c0fe9,{className:"sledge__radio-group-root","aria-label":"View density",defaultValue:n,id:t,name:s,required:i,onValueChange:o,children:l.map(((s,i)=>{const{label:n,value:l}=s;return e.jsxRuntimeExports.jsxs("div",{className:"sledge__radio-group-item-flex",children:[e.jsxRuntimeExports.jsx(e.$f99a8c78507165f7$export$6d08773d2e66f8f2,{className:"sledge__radio-group-item",value:l,id:`${t}${i}`,children:e.jsxRuntimeExports.jsx(e.$f99a8c78507165f7$export$adb584737d712b70,{className:"sledge__radio-group-indicator"})}),e.jsxRuntimeExports.jsx("label",{className:"sledge__radio-group-label",htmlFor:`${t}${i}`,style:r,children:n})]},i)}))})})}),w=({id:t,name:s,value:i,rgb:n,image:l,required:r,defaultChecked:o,onClick:d})=>{const a={...(null==l?void 0:l.length)?{backgroundImage:`url(${l})`}:{backgroundColor:n}};return e.jsxRuntimeExports.jsx("div",{className:"sledge__color-swatch-wrapper",children:e.jsxRuntimeExports.jsx(e.$e698a72e93240346$export$be92b6f5f03c0fe9,{className:"sledge__color-swatch-root",defaultChecked:o,id:t,name:s,value:i,required:r,onClick:d,style:a})})},f=({name:t,placeholder:s,required:i,defaultValue:n,items:l,labelStyle:r={},onValueChange:o})=>e.jsxRuntimeExports.jsx("div",{className:"sledge__select-wrapper",children:e.jsxRuntimeExports.jsxs(e.$cc7e05a45900e73f$export$be92b6f5f03c0fe9,{name:t,required:i,onValueChange:o,children:[e.jsxRuntimeExports.jsxs(e.$cc7e05a45900e73f$export$41fb9f06171c75f4,{className:"sledge__select-trigger",children:[e.jsxRuntimeExports.jsx(e.$cc7e05a45900e73f$export$4c8d1a57a761ef94,{placeholder:s}),e.jsxRuntimeExports.jsx(e.$cc7e05a45900e73f$export$f04a61298a47a40f,{className:"sledge__select-icon",children:e.jsxRuntimeExports.jsx("svg",{width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsxRuntimeExports.jsx("path",{d:"M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})})]}),e.jsxRuntimeExports.jsx(e.$cc7e05a45900e73f$export$602eac185826482c,{children:e.jsxRuntimeExports.jsxs(e.$cc7e05a45900e73f$export$7c6e2c02157bb7d2,{className:"sledge__select-content",children:[e.jsxRuntimeExports.jsx(e.$cc7e05a45900e73f$export$2f60d3ec9ad468f2,{className:"sledge__select-scroll-button",children:e.jsxRuntimeExports.jsx("svg",{width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsxRuntimeExports.jsx("path",{d:"M3.13523 8.84197C3.3241 9.04343 3.64052 9.05363 3.84197 8.86477L7.5 5.43536L11.158 8.86477C11.3595 9.05363 11.6759 9.04343 11.8648 8.84197C12.0536 8.64051 12.0434 8.32409 11.842 8.13523L7.84197 4.38523C7.64964 4.20492 7.35036 4.20492 7.15803 4.38523L3.15803 8.13523C2.95657 8.32409 2.94637 8.64051 3.13523 8.84197Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})}),e.jsxRuntimeExports.jsx(e.$cc7e05a45900e73f$export$d5c6c08dc2d3ca7,{className:"sledge__select-viewport",children:l.map(((t,s)=>{const{label:i,value:n}=t;return e.jsxRuntimeExports.jsx(R,{value:n,children:i},s)}))}),e.jsxRuntimeExports.jsx(e.$cc7e05a45900e73f$export$bf1aedc3039c8d63,{className:"sledge__select-scroll-button",children:e.jsxRuntimeExports.jsx("svg",{width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsxRuntimeExports.jsx("path",{d:"M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})})]})})]})}),R=t.forwardRef((({children:t,className:s="",...i},n)=>e.jsxRuntimeExports.jsxs(e.$cc7e05a45900e73f$export$6d08773d2e66f8f2,{className:`sledge__select-item ${s}`,...i,ref:n,children:[e.jsxRuntimeExports.jsx(e.$cc7e05a45900e73f$export$d6e5bf9c43ea9319,{children:t}),e.jsxRuntimeExports.jsx(e.$cc7e05a45900e73f$export$c3468e2714d175fa,{className:"sledge__select-item-indicator",children:e.jsxRuntimeExports.jsx("svg",{width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsxRuntimeExports.jsx("path",{d:"M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})})]}))),E=({width:t,height:s,type:i,color:n})=>e.jsxRuntimeExports.jsx("span",{className:"sledge-icon__heart",children:"outline"===i?e.jsxRuntimeExports.jsx("svg",{width:t,height:s,id:"sledge-icon-heart-line",viewBox:"0 0 18 17",fill:n,children:e.jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.19515 0.86581C10.5501 0.00914308 12.3501 -0.227524 13.9051 0.27081C17.2876 1.36164 18.3376 5.04914 17.3985 7.98331C15.9493 12.5916 9.76015 16.0291 9.49765 16.1733C9.40431 16.225 9.30098 16.2508 9.19765 16.2508C9.09431 16.2508 8.99181 16.2258 8.89848 16.175C8.63765 16.0325 2.49348 12.6458 0.995979 7.98414L0.995146 7.98331C0.0551462 5.04831 1.10181 1.35998 4.48098 0.27081C6.06765 -0.242524 7.79681 -0.0166903 9.19515 0.86581ZM4.86431 1.46081C2.13015 2.34248 1.44348 5.28331 2.18598 7.60248C3.35431 11.2375 7.97015 14.1766 9.19681 14.9041C10.4276 14.1691 15.0768 11.1975 16.2076 7.60581C16.9501 5.28414 16.261 2.34331 13.5226 1.46081C12.196 1.03498 10.6485 1.29414 9.58015 2.12081C9.35681 2.29248 9.04681 2.29581 8.82181 2.12581C7.69015 1.27498 6.21181 1.02581 4.86431 1.46081ZM12.7226 3.11573C13.8585 3.48323 14.6543 4.48906 14.7518 5.67823C14.7793 6.02239 14.5235 6.32406 14.1793 6.35156C14.1618 6.35323 14.1451 6.35406 14.1276 6.35406C13.8051 6.35406 13.5318 6.10656 13.5051 5.77989C13.4501 5.09489 12.9918 4.51656 12.3393 4.30573C12.0101 4.19906 11.8301 3.84656 11.936 3.51906C12.0435 3.19073 12.3926 3.01239 12.7226 3.11573Z"})}):e.jsxRuntimeExports.jsx("svg",{width:t,height:s,id:"sledge-icon-heart-fill",viewBox:"0 0 18 17",fill:n,children:e.jsxRuntimeExports.jsx("path",{d:"M5.89936 0.0838691C6.42436 0.0998355 6.9327 0.191502 7.4252 0.359002H7.47436C7.5077 0.374836 7.5327 0.392336 7.54936 0.408169C7.73353 0.467336 7.9077 0.534002 8.07436 0.625669L8.39103 0.767336C8.51603 0.834002 8.66603 0.958169 8.74936 1.009C8.8327 1.05817 8.92436 1.109 8.99936 1.1665C9.9252 0.459002 11.0494 0.0756688 12.2077 0.0838691C12.7335 0.0838691 13.2585 0.158169 13.7577 0.325669C16.8335 1.32567 17.9419 4.70067 17.016 7.65067C16.491 9.15817 15.6327 10.534 14.5085 11.6582C12.8994 13.2165 11.1335 14.5998 9.2327 15.7915L9.02436 15.9173L8.8077 15.7832C6.9002 14.5998 5.12436 13.2165 3.5002 11.6498C2.38353 10.5257 1.52436 9.15817 0.991029 7.65067C0.0493627 4.70067 1.1577 1.32567 4.26686 0.308169C4.50853 0.224836 4.7577 0.166502 5.0077 0.134002H5.1077C5.34186 0.0998355 5.57436 0.0838691 5.8077 0.0838691H5.89936ZM13.3244 2.71734C12.9827 2.59984 12.6077 2.784 12.4827 3.134C12.366 3.484 12.5494 3.86734 12.8994 3.9915C13.4335 4.1915 13.791 4.71734 13.791 5.29984V5.32567C13.7752 5.5165 13.8327 5.70067 13.9494 5.84234C14.066 5.984 14.241 6.0665 14.4244 6.084C14.766 6.07484 15.0577 5.80067 15.0827 5.44984V5.35067C15.1077 4.18317 14.4002 3.12567 13.3244 2.71734Z"})})}),C=({width:t,height:s,color:i})=>e.jsxRuntimeExports.jsx("span",{className:"sledge-icon__arrow-down",children:e.jsxRuntimeExports.jsx("svg",{width:t,height:s,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsxRuntimeExports.jsx("g",{id:"Arrow - Down 2",children:e.jsxRuntimeExports.jsx("g",{id:"Iconly/Light-Outline/Arrow---Down-2",children:e.jsxRuntimeExports.jsx("g",{id:"Arrow---Down-2",children:e.jsxRuntimeExports.jsx("path",{id:"Stroke-1",d:"M3.72407 6.6414C3.94596 6.41951 4.29318 6.39934 4.53786 6.58089L4.60796 6.6414L9.99935 12.0325L15.3907 6.6414C15.6126 6.41951 15.9598 6.39934 16.2045 6.58089L16.2746 6.6414C16.4965 6.86329 16.5167 7.21051 16.3351 7.45519L16.2746 7.52529L10.4413 13.3586C10.2194 13.5805 9.87218 13.6007 9.62751 13.4191L9.55741 13.3586L3.72407 7.52529C3.48 7.28121 3.48 6.88548 3.72407 6.6414Z",fill:i})})})})})}),y=({width:t,height:s,color:i})=>e.jsxRuntimeExports.jsx("span",{className:"sledge-icon__arrow-left",children:e.jsxRuntimeExports.jsx("svg",{width:t,height:s,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsxRuntimeExports.jsx("path",{d:"M10.6875 2.97945C10.865 3.15697 10.8812 3.43474 10.7359 3.63048L10.6875 3.68656L6.37465 7.99967L10.6875 12.3128C10.865 12.4903 10.8812 12.7681 10.7359 12.9638L10.6875 13.0199C10.51 13.1974 10.2323 13.2135 10.0365 13.0683L9.98043 13.0199L5.31377 8.35323C5.13625 8.17572 5.12012 7.89794 5.26535 7.7022L5.31377 7.64612L9.98043 2.97945C10.1757 2.78419 10.4923 2.78419 10.6875 2.97945Z",fill:i})})}),b=({width:t,height:s,color:i})=>e.jsxRuntimeExports.jsx("span",{className:"sledge-icon__arrow-right",children:e.jsxRuntimeExports.jsx("svg",{width:t,height:s,viewBox:"0 0 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsxRuntimeExports.jsx("path",{d:"M5.60738 13.1302C5.42987 12.9527 5.41374 12.675 5.55897 12.4792L5.60738 12.4231L9.92027 8.11002L5.60738 3.79691C5.42987 3.6194 5.41374 3.34162 5.55897 3.14588L5.60738 3.0898C5.7849 2.91229 6.06267 2.89615 6.25841 3.04139L6.31449 3.0898L10.9812 7.75647C11.1587 7.93398 11.1748 8.21175 11.0296 8.4075L10.9812 8.46357L6.31449 13.1302C6.11923 13.3255 5.80265 13.3255 5.60738 13.1302Z",fill:i})})}),N=({width:t,height:s,color:i})=>e.jsxRuntimeExports.jsx("span",{className:"sledge-icon__bag",children:e.jsxRuntimeExports.jsx("svg",{width:t,height:s,viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M19.6334 3.33398C23.9899 3.33398 27.5887 6.65342 28.0324 10.8989L28.1562 10.9003C30.5729 10.9003 33.5112 12.5053 34.5029 17.007L35.8179 27.1853C36.2896 30.4703 35.6996 33.1053 34.0612 34.9953C32.4312 36.8753 29.8512 37.8703 26.5996 37.8703H12.6862C9.11458 37.8703 6.62625 36.9953 5.07792 35.197C3.52292 33.3936 3.00292 30.6886 3.53292 27.1586L4.82625 17.1153C5.67625 12.5103 8.78458 10.9003 11.1912 10.9003C11.399 8.98444 12.2629 7.16182 13.6334 5.79565C15.2084 4.23065 17.3801 3.33398 19.5984 3.33398H19.6334ZM28.1562 13.4003H11.1912C10.4562 13.4003 7.99958 13.697 7.29458 17.5036L6.00792 27.5036C5.58958 30.3086 5.91292 32.3386 6.97125 33.567C8.01625 34.7803 9.88625 35.3703 12.6862 35.3703H26.5996C28.3462 35.3703 30.7312 35.022 32.1712 33.3586C33.3146 32.0403 33.7079 30.077 33.3412 27.522L32.0429 17.4353C31.4896 14.9503 30.0296 13.4003 28.1562 13.4003ZM24.4942 18.0405C25.1842 18.0405 25.7826 18.6005 25.7826 19.2905C25.7826 19.9805 25.2609 20.5405 24.5709 20.5405H24.4942C23.8042 20.5405 23.2442 19.9805 23.2442 19.2905C23.2442 18.6005 23.8042 18.0405 24.4942 18.0405ZM14.7774 18.0405C15.4674 18.0405 16.0657 18.6005 16.0657 19.2905C16.0657 19.9805 15.5424 20.5405 14.8524 20.5405H14.7774C14.0874 20.5405 13.5274 19.9805 13.5274 19.2905C13.5274 18.6005 14.0874 18.0405 14.7774 18.0405ZM19.6284 5.83398H19.6034C18.0351 5.83398 16.5067 6.46565 15.3984 7.56732C14.4956 8.46609 13.9051 9.64764 13.7141 10.8995L25.5129 10.9C25.0846 8.03628 22.6082 5.83398 19.6284 5.83398Z",fill:i})})}),S=({width:t,height:s,color:i})=>e.jsxRuntimeExports.jsx("span",{className:"sledge-icon__search",children:e.jsxRuntimeExports.jsx("svg",{width:t,height:s,viewBox:"0 0 20 21",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.78283 2.16669C14.2578 2.16669 17.8978 5.80669 17.8978 10.2817C17.8978 12.393 17.0876 14.3186 15.7617 15.7638L18.3707 18.3673C18.6148 18.6114 18.6157 19.0064 18.3715 19.2506C18.2498 19.3739 18.089 19.4348 17.929 19.4348C17.7698 19.4348 17.6098 19.3739 17.4873 19.2523L14.8469 16.6192C13.4579 17.7316 11.6967 18.3975 9.78283 18.3975C5.30783 18.3975 1.66699 14.7567 1.66699 10.2817C1.66699 5.80669 5.30783 2.16669 9.78283 2.16669ZM9.78283 3.41669C5.99699 3.41669 2.91699 6.49585 2.91699 10.2817C2.91699 14.0675 5.99699 17.1475 9.78283 17.1475C13.5678 17.1475 16.6478 14.0675 16.6478 10.2817C16.6478 6.49585 13.5678 3.41669 9.78283 3.41669Z",fill:i})})}),L=t.forwardRef(((t,s)=>{const{className:i="",children:n,colorType:l="light",fullWidth:r=!1,elementType:o="button",link:d="",...a}=t;return"hyperlink"===o&&(null==d?void 0:d.length)?e.jsxRuntimeExports.jsx("a",{href:d,className:`sledge__button ${i||""}`,"data-button-color-type":l,"data-button-full-width":r,ref:s,...a,children:n}):e.jsxRuntimeExports.jsx("button",{className:`sledge__button ${i||""}`,"data-button-color-type":l,"data-button-full-width":r,ref:s,...a,children:n})})),$=s=>{const{className:i="",icon:n,value:l="",withClearField:r,onChange:o,onResetField:d,fieldRef:a,...u}=s,[c,x]=t.useState(!1);return t.useEffect((()=>{x(Boolean(l))}),[l]),e.jsxRuntimeExports.jsxs("div",{className:`sledge__search-input-field-wrapper ${i||""}`,children:[n?e.jsxRuntimeExports.jsx("div",{className:"sledge__search-input-field-icon",children:n}):null,e.jsxRuntimeExports.jsx("input",{className:"sledge__search-input-field",value:l,onChange:e=>(e=>{o&&o({value:e.target.value})})(e),ref:a,...u}),c&&r?e.jsxRuntimeExports.jsx("div",{className:"sledge__clear-field-wrapper",children:e.jsxRuntimeExports.jsx("button",{className:"sledge__clear-field",type:"button",onClick:()=>{(null==a?void 0:a.current)&&a.current.focus(),o&&o({value:""}),d&&d()},children:e.jsxRuntimeExports.jsx("svg",{viewBox:"0 0 20 20",focusable:"false","aria-hidden":"true",width:14,height:14,children:e.jsxRuntimeExports.jsx("path",{d:"m11.414 10 6.293-6.293a1 1 0 1 0-1.414-1.414l-6.293 6.293-6.293-6.293a1 1 0 0 0-1.414 1.414l6.293 6.293-6.293 6.293a1 1 0 1 0 1.414 1.414l6.293-6.293 6.293 6.293a.998.998 0 0 0 1.707-.707.999.999 0 0 0-.293-.707l-6.293-6.293z"})})})}):null]})},k=s=>{var i;const{className:n="",placeholder:l=null,prefixLabel:r=null,prefixSelectedLabel:o="",align:d="end",onChange:a,value:u="",options:c=[]}=s,[x,p]=t.useState(!1),h=(null==(i=null==c?void 0:c.filter((({value:e})=>e===u))[0])?void 0:i.label)||l;return e.jsxRuntimeExports.jsx("div",{className:`sledge__select-field-wrapper ${n||""}`,children:e.jsxRuntimeExports.jsx(m,{trigger:e.jsxRuntimeExports.jsxs("button",{type:"button",className:"sledge__button sledge__select-field","data-button-color-type":"light","data-button-full-width":"true",children:[r?e.jsxRuntimeExports.jsx("span",{className:"sledge__select-field-icon",children:r}):null,e.jsxRuntimeExports.jsx("span",{children:(null==o?void 0:o.length)?`${o} ${h}`:h})]}),content:e.jsxRuntimeExports.jsx("ul",{className:"sledge__select-field-option",children:null==c?void 0:c.map(((t,s)=>{const{label:i,value:n}=t;return e.jsxRuntimeExports.jsx("li",{onClick:()=>((e,t)=>{a&&a({label:e,value:t}),p(!1)})(i,n),...n===u&&{"data-selected":!0},children:i},s)}))}),isOpen:x,setIsOpen:p,hideCloseIcon:!0,align:d,className:"sledge__select-field-option-content",withArrow:!1})})},A=l=>{var o,d,a;const{data:u,forceActive:x=!1,hidden:p=!1,onAfterAddWishlist:m,onAfterRemoveWishlist:h}=l,{productId:g,productVariantId:j}=u||{},{isRenderApp:v,triggerRenderMultipleComponent:_,sledgeAnonymId:w}=t.useContext(s.SledgeContext),f="#767676",R="outline",C="#F85538",y="fill",[b,N]=t.useState(f),[S,L]=t.useState(R),[$,k]=t.useState(!1),[A,I]=t.useState(!0),[T,P]=t.useState({}),[W,B]=t.useState({onAfterAddWishlist:m,onAfterRemoveWishlist:h}),[O,F]=t.useState(!1),{is_required_login:M}=(null==(o=null==T?void 0:T.display)?void 0:o.global)||{},{show:V,location:D}=(null==(d=null==T?void 0:T.display)?void 0:d.notification)||{},{title_added_to_wishlist:H,text_added_to_wishlist:q,title_removed_to_wishlist:z,text_removed_to_wishlist:Z}=(null==(a=null==T?void 0:T.languages)?void 0:a.notification)||{},J=async()=>{let e;e=await(async(e,t)=>{let s=c(e),l=t?c(t):"",r=localStorage.getItem(n),o="?"+new URLSearchParams({variant_id:l}).toString();var d=new Headers;d.append("Authorization",`Bearer ${r}`);var a={method:"GET",headers:d,redirect:"follow"};return await fetch(`${i}/wishlist/check/${s}${o}`,a).then((e=>e.json())).then((e=>Boolean(e.data))).catch((()=>{}))})(g,j),k(x||e)},U=async t=>{var s,l,r,o,d,a;if(t.preventDefault(),t.stopPropagation(),O)return void("undefined"!=typeof window&&window.sledgeConfirmationPopup&&window.sledgeConfirmationPopup({title:"Login required!",message:"Please login to save your wishlist across devices.",textSubmit:"Login",textCancel:"Cancel",buttonSubmitType:"info",onSubmit:()=>window.location.href="/account/login"}));k(!$);let x=await(async e=>{const{productId:t,productVariantId:s,productName:l,productVendor:r,productSku:o,productVariantName:d,productLink:a,productImage:u,productCurrency:x,productPrice:p}=e;let m=localStorage.getItem(n);var h=new Headers;h.append("Authorization",`Bearer ${m}`),h.append("Content-Type","application/json");var g={method:"POST",headers:h,body:JSON.stringify({product:{id:c(t),variant_id:c(s),name:l,vendor:r,sku:o,variant_name:d,url:a,image_url:u,currency:x,price:p}}),redirect:"follow"};return await fetch(`${i}/wishlist`,g).then((e=>e.json())).then((e=>e)).catch((()=>{}))})(u);const{status:p,data:m}=x||{},{code:h}=p||{};200===h?("undefined"!=typeof window&&(window.sledgeWishlistBadgeUpdate&&((null==(l=null==(s=null==_?void 0:_.wishlist)?void 0:s.badge)?void 0:l.trigger)&&(null==(a=null==(r=null==_?void 0:_.wishlist)?void 0:r.badge)||a.trigger(!(null==(d=null==(o=null==_?void 0:_.wishlist)?void 0:o.badge)?void 0:d.value))),window.sledgeWishlistBadgeUpdate()),window.sledgeWishlistWidgetListUpdate&&window.sledgeWishlistWidgetListUpdate(),window.sledgeWishlistButtonDetailUpdate&&window.sledgeWishlistButtonDetailUpdate()),J(),$?W.onAfterRemoveWishlist&&W.onAfterRemoveWishlist("success"):W.onAfterAddWishlist&&W.onAfterAddWishlist("success"),"undefined"!=typeof window&&window.sledgeToastNotification&&V&&window.sledgeToastNotification({title:$?z:H,message:$?Z:q,location:D,type:"success",icon:e.jsxRuntimeExports.jsx(E,{width:40,height:40,color:"black",type:"outline"})})):($?W.onAfterRemoveWishlist&&W.onAfterRemoveWishlist("failed"):W.onAfterAddWishlist&&W.onAfterAddWishlist("failed"),"undefined"!=typeof window&&window.sledgeToastNotification&&V&&window.sledgeToastNotification({title:"Failed",message:"failed add to wishlist",location:D,type:"failed",icon:e.jsxRuntimeExports.jsx(E,{width:40,height:40,color:"black",type:"outline"})}))};t.useEffect((()=>{(null==v?void 0:v.wishlist)&&("undefined"!=typeof window&&(window.sledgeWishlistTriggerUpdate=()=>{J()}),(async e=>{let t;I(!0);let s=!1;if(t=JSON.parse(e),!t)return;const{status:i,data:n}=t,{code:l}=i;s=200===l||!1,s&&(P(n),I(!1))})(localStorage.getItem(r)||""))}),[v]),t.useEffect((()=>{F(w&&M)}),[w]),t.useEffect((()=>{(null==v?void 0:v.wishlist)&&J()}),[v,j]);const G=($||x)&&!O;return t.useEffect((()=>{G?(N(C),L(y)):(N(f),L(R))}),[$]),e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:!A&&!p&&e.jsxRuntimeExports.jsx("div",{className:"sledge-wishlist__trigger-block",children:e.jsxRuntimeExports.jsx("span",{className:"sledge-wishlist__trigger",onClick:e=>U(e),onMouseEnter:()=>{G||(N(C),L(y))},onMouseLeave:()=>{G||(N(f),L(R))},children:e.jsxRuntimeExports.jsx(E,{width:16.67,height:15.83,type:S,color:b})})})})},I=({isFirstLoading:s,...i})=>e.jsxRuntimeExports.jsx("div",{className:"sledge-wishlist__widget-header",children:s?e.jsxRuntimeExports.jsxs("div",{style:{display:"flex",gap:"8px",width:"100%",justifyContent:"space-between"},children:[e.jsxRuntimeExports.jsx(X.Item,{width:"190px",height:"46px",color:"grey-100",rounded:"md"}),e.jsxRuntimeExports.jsxs("div",{style:{display:"flex",gap:"8px"},children:[e.jsxRuntimeExports.jsx(X.Item,{width:"440px",height:"46px",color:"grey-100",rounded:"md"}),e.jsxRuntimeExports.jsx(X.Item,{width:"132px",height:"46px",color:"grey-100",rounded:"md"}),e.jsxRuntimeExports.jsx(X.Item,{width:"136px",height:"46px",color:"grey-100",rounded:"md"})]}),e.jsxRuntimeExports.jsxs("div",{style:{display:"flex",gap:"26px"},children:[e.jsxRuntimeExports.jsx(X.Item,{width:"190px",height:"46px",color:"grey-100",rounded:"md"}),e.jsxRuntimeExports.jsx(X.Item,{width:"190px",height:"46px",color:"grey-100",rounded:"md"})]})]}):t.Children.count(i.children)&&t.Children.map(i.children,(e=>t.cloneElement(e,{...i})))});I.Title=({text:t,dataSettings:s})=>{var i,n,l;const{color:r,font_size:o,font_weight:d,text_transform:a}=(null==(n=null==(i=null==s?void 0:s.display)?void 0:i.widget)?void 0:n.header_title)||{},{header_title:u}=(null==(l=null==s?void 0:s.languages)?void 0:l.widget)||{},c={...r&&{color:r},...o&&{fontSize:o},...d&&{fontWeight:d},...a&&{textTransform:a}};return e.jsxRuntimeExports.jsx("div",{className:"sledge-wishlist__widget-header-item",children:e.jsxRuntimeExports.jsx("h1",{style:c,children:u||(t||"My Wishlist")})})},I.SearchForm=({setIsLoading:i,setKeyword:n,keyword:l,placeholder:r,dataSettings:o})=>{var d,a;const{sledgeAnonymId:u}=t.useContext(s.SledgeContext),{is_required_login:c}=(null==(d=null==o?void 0:o.display)?void 0:d.global)||{},{search_form_placeholder:x}=(null==(a=null==o?void 0:o.languages)?void 0:a.widget)||{},[p,m]=t.useState(!1),h=t.useRef(null);return t.useEffect((()=>{m(u&&c)}),[u]),e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:!p&&e.jsxRuntimeExports.jsx($,{type:"text",icon:e.jsxRuntimeExports.jsx(S,{width:18,height:18,color:"#868686"}),placeholder:x||(r||"Search product..."),value:l,fieldRef:h,onChange:({value:e})=>(e=>{n&&n(e)})(e),onResetField:()=>{var e;i&&i(!0),n&&n(""),null==(e=null==h?void 0:h.current)||e.focus()},className:"sledge-wishlist__widget-header-item sledge-wishlist__widget-search-form",withClearField:!0})})},I.ShareTrigger=({wishlistData:l,buttonText:r,showShareTrigger:o,shareLink:d,shareId:a,dataSettings:u,isFirstLoading:x})=>{var p,m,h,g,j,v;const{triggerRenderMultipleComponent:_,sledgeAnonymId:w}=t.useContext(s.SledgeContext),{is_required_login:f}=(null==(p=null==u?void 0:u.display)?void 0:p.global)||{},{text_color:R,border_color:E,border_radius:C,padding_top:y,padding_bottom:b,padding_left:N,padding_right:S,background_color:$,font_size:k,font_weight:A,text_transform:I}=(null==(h=null==(m=null==u?void 0:u.display)?void 0:m.widget)?void 0:h.button_share)||{},{title_share_wishlist:T}=(null==(g=null==u?void 0:u.languages)?void 0:g.popup)||{},{button_share:P}=(null==(j=null==u?void 0:u.languages)?void 0:j.widget)||{},{title_added_all_to_wishlist:W,text_added_all_to_wishlist:B}=(null==(v=null==u?void 0:u.languages)?void 0:v.notification)||{},[O,F]=t.useState(!1),M={...R&&{color:R},...E&&{borderColor:E},...C&&{borderRadius:C},...y&&{paddingTop:y},...b&&{paddingBottom:b},...N&&{paddingLeft:N},...S&&{paddingRight:S},...$&&{backgroundColor:$},...k&&{fontSize:k},...A&&{fontWeight:A},...I&&{textTransform:I}},[V,D]=t.useState(!1);let H='<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M15 17V20C15 20.2652 14.8946 20.5196 14.7071 20.7071C14.5196 20.8946 14.2652 21 14 21H4C3.73478 21 3.48043 20.8946 3.29289 20.7071C3.10536 20.5196 3 20.2652 3 20V8C3 7.73478 3.10536 7.48043 3.29289 7.29289C3.48043 7.10536 3.73478 7 4 7H7" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>\n <path d="M18 3H8C7.44772 3 7 3.44772 7 4V16C7 16.5523 7.44772 17 8 17H18C18.5523 17 19 16.5523 19 16V4C19 3.44772 18.5523 3 18 3Z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>\n </svg>';const q=async()=>{var e,t,s,r,o,d,a;D(!0);let u=l.map((e=>{const{id:t,variant_id:s,name:i,variant_name:n,url:l,image_url:r,currency:o,price:d}=e.product;return{productId:t,productVariantId:s,productName:i,productVariantName:n,productLink:l,productImage:r,productCurrency:o,productPrice:d}})),x=await(async e=>{let t=localStorage.getItem(n);var s=new Headers;s.append("Authorization",`Bearer ${t}`),s.append("Content-Type","application/json");let l=e.map((e=>{const{productId:t,productVariantId:s,productName:i,productVariantName:n,productLink:l,productImage:r,productCurrency:o,productPrice:d}=e;return{id:c(t),variant_id:c(s),name:i,variant_name:n,url:l,image_url:r,currency:o,price:d}}));var r={method:"POST",headers:s,body:JSON.stringify({products:l}),redirect:"follow"};return await fetch(`${i}/wishlist/bulk`,r).then((e=>e.json())).then((e=>e)).catch((()=>{}))})(u);200===(null==(e=null==x?void 0:x.status)?void 0:e.code)?("undefined"!=typeof window&&(window.sledgeWishlistBadgeUpdate&&((null==(s=null==(t=null==_?void 0:_.wishlist)?void 0:t.badge)?void 0:s.trigger)&&(null==(a=null==(r=null==_?void 0:_.wishlist)?void 0:r.badge)||a.trigger(!(null==(d=null==(o=null==_?void 0:_.wishlist)?void 0:o.badge)?void 0:d.value))),window.sledgeWishlistBadgeUpdate()),window.sledgeInfoPopup&&window.sledgeInfoPopup({title:W,message:B,textCancel:"Cancel"})),D(!1)):"undefined"!=typeof window&&window.sledgeInfoPopup&&window.sledgeInfoPopup({title:"Failed",message:"Failed add to wishlist, please try again",textCancel:"Cancel"})};return t.useEffect((()=>{F(w&&f)}),[w]),e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:!O&&e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:o&&e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:x?e.jsxRuntimeExports.jsx(X.Item,{width:"136px",height:"46px",color:"grey-100",rounded:"md"}):e.jsxRuntimeExports.jsx("div",{className:"sledge-wishlist__widget-header-item sledge-wishlist__widget-header-share-trigger",children:e.jsxRuntimeExports.jsx(L,{type:"button",style:M,...a&&!l.length||V?{disabled:!0}:{onClick:async()=>{a&&l.length?window.sledgeConfirmationPopup({title:"Are you sure want to add this to your wishlist item?",message:`This action cannot be undone. This will adding <strong>${l.length}</strong> item to your wishlist page.`,textSubmit:"Add to your wishlist",textCancel:"Cancel",buttonSubmitType:"info",onSubmit:q||{}}):"undefined"!=typeof window&&window.sledgeInfoPopup&&(window.sledgeInfoPopup({title:T,message:d?`<div class="sledge-wishlist__widget-box-copy">\n <div class="sledge-wishlist__widget-box-copy-icon" title="Copy to clipboard">\n ${H}\n </div>\n <div class="sledge-wishlist__widget-box-copy-content">${d}</div>\n </div>`:"",textCancel:"Cancel"}),(()=>{let e=!0;document.body.addEventListener("DOMNodeInserted",(()=>{if(document.querySelector(".sledge-wishlist__widget-box-copy")&&e){e=!1;let t=document.querySelector(".sledge-wishlist__widget-box-copy-icon");null==t||t.addEventListener("click",(()=>{var e;let s=null==(e=document.querySelector(".sledge-wishlist__widget-box-copy-content"))?void 0:e.textContent;s&&(navigator.clipboard.writeText(s),t&&(t.classList.add("active"),t.innerHTML='<svg width="20" height="20" viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z" fill="currentColor" fill-rule="evenodd" clip-rule="evenodd"></path></svg>',setTimeout((()=>{t&&(t.classList.remove("active"),t.innerHTML=H)}),2500)))}))}}))})())}},children:a?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("span",{className:"sledge-wishlist__badge-counter sledge-wishlist__badge-counter-top-right",children:l.length}),V?"Adding...":"Add to your wishlist"]}):P||(r||"Share Wishlist")})})})})})},I.ClearTrigger=({buttonText:i,shareId:n,dataSettings:l,isFirstLoading:r})=>{var o,d,a,u,c;const{sledgeAnonymId:x}=t.useContext(s.SledgeContext),{is_required_login:p}=(null==(o=null==l?void 0:l.display)?void 0:o.global)||{},{text_color:m,border_color:h,border_radius:g,padding_top:j,padding_bottom:v,padding_left:_,padding_right:w,background_color:f,font_size:R,font_weight:E,text_transform:C}=(null==(a=null==(d=null==l?void 0:l.display)?void 0:d.widget)?void 0:a.button_clear_all)||{},{title_confirm_clear_all_wishlist:y,text_confirm_clear_all_wishlist:b,button_submit_confirm_clear_all_wishlist:N,button_cancel_confirm_clear_all_wishlist:S}=(null==(u=null==l?void 0:l.languages)?void 0:u.popup)||{},{button_clear_all:$}=(null==(c=null==l?void 0:l.languages)?void 0:c.widget)||{},[k,A]=t.useState(!1),I={...m&&{color:m},...h&&{borderColor:h},...g&&{borderRadius:g},...j&&{paddingTop:j},...v&&{paddingBottom:v},..._&&{paddingLeft:_},...w&&{paddingRight:w},...f&&{backgroundColor:f},...R&&{fontSize:R},...E&&{fontWeight:E},...C&&{textTransform:C}};t.useEffect((()=>{A(x&&p)}),[x]);return e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:!k&&e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:!n&&e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:r?e.jsxRuntimeExports.jsx(X.Item,{width:"132px",height:"46px",color:"grey-100",rounded:"md"}):e.jsxRuntimeExports.jsx("div",{className:"sledge-wishlist__widget-header-item",children:e.jsxRuntimeExports.jsx(L,{type:"button",colorType:"danger",onClick:()=>{"undefined"!=typeof window&&window.sledgeConfirmationPopup&&window.sledgeConfirmationPopup({title:y,message:b,textSubmit:N,textCancel:S,buttonSubmitType:"danger",onSubmit:window.sledgeWishlistWidgetClearList||{}})},style:I,children:$||(i||"Clear Wishlist")})})})})})},I.Sort=({wishlistSort:i,selectedSort:n,setSelectedSort:l,setIsRefreshWidgetList:r,dataSettings:o})=>{var d,a;const{sledgeAnonymId:u}=t.useContext(s.SledgeContext),{is_required_login:c}=(null==(d=null==o?void 0:o.display)?void 0:d.global)||{},[x,p]=t.useState(!1);return t.useEffect((()=>{p(u&&c)}),[u]),e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:!x&&e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:i&&Boolean(null==i?void 0:i.length)&&e.jsxRuntimeExports.jsx("div",{className:"sledge-wishlist__widget-header-item",children:e.jsxRuntimeExports.jsx(k,{align:"end",options:i.map((e=>{const{name:t,value:s}=e;return{label:t,value:s}})),value:n||(null==(a=i[0])?void 0:a.value),onChange:({value:e})=>(e=>{l&&l(e),r&&r(!0)})(e)})})})})},I.Limit=({options:i,defaultLimitOptions:n,selectedLimit:l,setSelectedLimit:r,setIsRefreshWidgetList:o,dataSettings:d})=>{var a;const{sledgeAnonymId:u}=t.useContext(s.SledgeContext),{is_required_login:c}=(null==(a=null==d?void 0:d.display)?void 0:a.global)||{},[x,p]=t.useState(!1);let m=i||n;return t.useEffect((()=>{p(u&&c)}),[u]),e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:!x&&e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:m&&Boolean(null==m?void 0:m.length)&&e.jsxRuntimeExports.jsx("div",{className:"sledge-wishlist__widget-header-item",children:e.jsxRuntimeExports.jsx(k,{align:"end",options:m.map((e=>({label:e,value:e}))),value:l||m[0],onChange:({value:e})=>(e=>{r&&r(e),o&&o(!0)})(e)})})})})};const T=e=>{const s=t.useRef();return t.useEffect((()=>{s.current=e})),s.current},P=async e=>{let t=c(e),s=localStorage.getItem(n);var l=new Headers;l.append("Authorization",`Bearer ${s}`);var r={method:"GET",headers:l,redirect:"follow"};return await fetch(`${i}/review/info/${t}`,r).then((e=>e.json())).then((e=>e)).catch((()=>{}))},W=i=>{var n;const{value:l,size:r="md",data:d,withSkeletonLoading:a=!0,isScrollToElementWidget:c=!0}=i,{productId:x}=d||{},{isRenderApp:m,triggerRenderMultipleComponent:h}=t.useContext(s.SledgeContext),[g,j]=t.useState(!0),[v,_]=t.useState(!0),[w,f]=t.useState({width:0,height:0}),[R,E]=t.useState(0),[C,y]=t.useState("0"),[b,N]=t.useState({}),S=T({productId:x}),{fill_color:L,outline_color:$}=(null==(n=null==b?void 0:b.display)?void 0:n.rating)||{},k=async()=>{l&&!d?(y(l),_(!1)):(async e=>{var t;let s,i,n=!1,l=0;if(s=await P(e),!s)return;const{status:r,data:o}=s,{code:d}=r;n=200===d||!1,l=(null==o?void 0:o.review_count)?o.review_count:0,i=(null==(t=null==o?void 0:o.rating)?void 0:t.average)?o.rating.average:0,n&&(E(l),y(i),_(!1),j(!1))})(x)};return t.useEffect((()=>{if(!(null==m?void 0:m.productReview))return;"undefined"!=typeof window&&(window.sledgeProductReviewRatingUpdate=()=>{_(!0),k()}),f("xs"===r?{width:14.4,height:14.4}:"sm"===r?{width:18,height:18}:{width:28.8,height:28.8}),Boolean(S&&(null==S?void 0:S.productId)!==x)&&j(!0),(async e=>{let t;_(!0);let s=!1;if(t=JSON.parse(e),!t)return;const{status:i,data:n}=t,{code:l}=i;s=200===l||!1,s&&(N(n),await k())})(localStorage.getItem(o)||"")}),[m,x,h]),e.jsxRuntimeExports.jsx("div",{className:"sledge-product-review__rating",onClick:()=>{c&&setTimeout((()=>{p(document.getElementById(u.ELEMENT_WIDGET),50)}),200)},children:g&&a?e.jsxRuntimeExports.jsx(X.Item,{width:"230px",height:"28px",color:"grey-100",rounded:"md"}):e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",style:{display:"none"},id:"sledge-product-review-rating-icon-svg-store",children:[e.jsxRuntimeExports.jsx("symbol",{id:"sledge-product-review-icons-rating-icon-fill",viewBox:"0 0 30 29",fill:L||"#23BC45",children:e.jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.00014 17.7L1.20174 12.9C0.107339 12.0248 0.587339 10.2648 1.97614 10.0664L10.2001 9.69998L13.7121 0.895176C13.9569 0.407176 14.4545 0.0999756 15.0001 0.0999756C15.5457 0.0999756 16.0433 0.408776 16.2881 0.895176L19.8001 9.69998L28.0241 10.0664C29.4129 10.2648 29.8929 12.0248 28.7985 12.9L23.0001 17.7L24.5825 27.0712C24.7649 28.3496 23.4369 29.3064 22.2833 28.7288L15.0001 24.1L7.71694 28.7272C6.56174 29.3048 5.23534 28.348 5.41774 27.0696L7.00014 17.7Z"})}),e.jsxRuntimeExports.jsx("symbol",{id:"sledge-product-review-icons-rating-icon-line",viewBox:"0 0 30 29",stroke:$||"#8D9196",fill:"none",children:e.jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.00014 17.7L1.20174 12.9C0.107339 12.0248 0.587339 10.2648 1.97614 10.0664L10.2001 9.69998L13.7121 0.895176C13.9569 0.407176 14.4545 0.0999756 15.0001 0.0999756C15.5457 0.0999756 16.0433 0.408776 16.2881 0.895176L19.8001 9.69998L28.0241 10.0664C29.4129 10.2648 29.8929 12.0248 28.7985 12.9L23.0001 17.7L24.5825 27.0712C24.7649 28.3496 23.4369 29.3064 22.2833 28.7288L15.0001 24.1L7.71694 28.7272C6.56174 29.3048 5.23534 28.348 5.41774 27.0696L7.00014 17.7Z",strokeWidth:"1.4"})}),e.jsxRuntimeExports.jsx("defs",{children:e.jsxRuntimeExports.jsxs("g",{id:"sledge-product-review-icons-rating-icon",children:[e.jsxRuntimeExports.jsx("use",{href:"#sledge-product-review-icons-rating-icon-line",className:"sledge-product-review__rating-icon-line"}),e.jsxRuntimeExports.jsx("use",{href:"#sledge-product-review-icons-rating-icon-fill",className:"sledge-product-review__rating-icon-fill"})]})})]}),!v&&e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[[1,2,3,4,5].map(((s,i)=>{let n=Math.floor(parseFloat(C)),l=String(C).includes(",")?String(C).split(","):[],r=String(C).includes(".")?String(C).split("."):[],o=l.length||r.length?l[1]||r[1]:0,d="fill-0";return s>n&&n+1===s&&(d=`fill-${o}`),t.createElement("svg",{...w,viewBox:"0 0 30 29","data-product-review-rating-fill":s<=n?"full":d,key:i},e.jsxRuntimeExports.jsx("use",{href:"#sledge-product-review-icons-rating-icon"}))})),!l&&d?e.jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__rating-summary-total",children:["(",R,")"]}):e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{})]})]})})},B={open:{rotate:180},closed:{rotate:0},transition:{type:"spring",duration:.2}},O={hidden:{opacity:0,scale:0},visible:e=>{const{duration:t}=e||{};return{opacity:1,scale:1,transition:{type:"spring",duration:t||.7}}}},F=s=>{const[i,n]=t.useState(!0);return t.useEffect((()=>{n(!1)}),[]),e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:!i&&e.jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-header",children:t.Children.count(s.children)&&t.Children.map(s.children,(e=>t.cloneElement(e,{...s})))})})};F.Sort=({isFirstLoading:s,productReviewSort:i,dataSettings:n,setSelectedSort:l,setIsRefreshWidgetList:r})=>{var o,d;const{default_sort:a,show_sorting_options:u}=(null==(o=null==n?void 0:n.display)?void 0:o.widget)||{},[c,x]=t.useState(a||null),p=c||(null==(d=i[0])?void 0:d.value);return e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:u?e.jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-header-item",children:s?e.jsxRuntimeExports.jsx(X.Item,{width:"134px",height:"42px",rounded:"lg",color:"grey-100"}):e.jsxRuntimeExports.jsx(k,{align:"end",prefixLabel:e.jsxRuntimeExports.jsx("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.5919 9.13869C12.7359 9.13869 13.6666 10.0647 13.6666 11.2027C13.6666 12.3407 12.7359 13.2667 11.5919 13.2667C10.4473 13.2667 9.51593 12.3407 9.51593 11.2027C9.51593 10.0647 10.4473 9.13869 11.5919 9.13869ZM11.5919 10.1387C10.9986 10.1387 10.5159 10.616 10.5159 11.2027C10.5159 11.79 10.9986 12.2667 11.5919 12.2667C12.1846 12.2667 12.6666 11.79 12.6666 11.2027C12.6666 10.616 12.1846 10.1387 11.5919 10.1387ZM6.7202 10.7286C6.9962 10.7286 7.2202 10.9526 7.2202 11.2286C7.2202 11.5046 6.9962 11.7286 6.7202 11.7286H2.51953C2.24353 11.7286 2.01953 11.5046 2.01953 11.2286C2.01953 10.9526 2.24353 10.7286 2.51953 10.7286H6.7202ZM4.07533 2.66669C5.22 2.66669 6.15067 3.59335 6.15067 4.73135C6.15067 5.86935 5.22 6.79469 4.07533 6.79469C2.93133 6.79469 2 5.86935 2 4.73135C2 3.59335 2.93133 2.66669 4.07533 2.66669ZM4.07533 3.66669C3.48267 3.66669 3 4.14402 3 4.73135C3 5.31802 3.48267 5.79469 4.07533 5.79469C4.66867 5.79469 5.15067 5.31802 5.15067 4.73135C5.15067 4.14402 4.66867 3.66669 4.07533 3.66669ZM12.7941 4.26695C13.0701 4.26695 13.2941 4.49095 13.2941 4.76695C13.2941 5.04295 13.0701 5.26695 12.7941 5.26695H8.59407C8.31807 5.26695 8.09407 5.04295 8.09407 4.76695C8.09407 4.49095 8.31807 4.26695 8.59407 4.26695H12.7941Z",fill:"currentColor"})}),prefixSelectedLabel:"Sort by",options:i.map((e=>{const{name:t,value:s}=e;return{label:t,value:s}})),value:p,onChange:({value:e})=>(e=>{x(e),r&&r(!0),l&&l(e)})(e)})}):null})},F.AddTrigger=({isFirstLoading:t,text:s,dataSettings:i,data:n,onAfterAddReview:l})=>{var r,o,d;const{text_color:a,border_color:u,border_radius:c,padding_top:x,padding_bottom:p,padding_left:m,padding_right:h,background_color:g,font_size:j,font_weight:v,text_transform:_}=(null==(o=null==(r=null==i?void 0:i.display)?void 0:r.widget)?void 0:o.button_write_review)||{},{button_write_review:w}=(null==(d=null==i?void 0:i.languages)?void 0:d.widget)||{},f={...a&&{color:a},...u&&{borderColor:u},...c&&{borderRadius:c},...x&&{paddingTop:x},...p&&{paddingBottom:p},...m&&{paddingLeft:m},...h&&{paddingRight:h},...g&&{backgroundColor:g},...j&&{fontSize:j},...v&&{fontWeight:v},..._&&{textTransform:_}};return e.jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-header-item",children:t?e.jsxRuntimeExports.jsx(X.Item,{width:"134px",height:"42px",rounded:"lg",color:"grey-100"}):e.jsxRuntimeExports.jsxs(L,{type:"button",colorType:"success",onClick:()=>"undefined"!=typeof window&&window.sledgeProductReviewWidgetFormAdd&&window.sledgeProductReviewWidgetFormAdd(n,l),style:f,children:[e.jsxRuntimeExports.jsx("svg",{width:16,height:17,viewBox:"0 0 16 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M13.8323 14.1264C14.1083 14.1264 14.3323 14.3504 14.3323 14.6264C14.3323 14.9024 14.1083 15.1264 13.8323 15.1264H8.99701C8.72101 15.1264 8.49701 14.9024 8.49701 14.6264C8.49701 14.3504 8.72101 14.1264 8.99701 14.1264H13.8323ZM10.7429 2.93576C10.7762 2.96176 11.8915 3.82843 11.8915 3.82843C12.2969 4.06976 12.6135 4.5011 12.7335 5.01176C12.8529 5.5171 12.7662 6.03843 12.4882 6.47909C12.4864 6.48203 12.4845 6.48494 12.4781 6.49358L12.4731 6.50025C12.4279 6.55972 12.2318 6.80776 11.2417 8.04815C11.2325 8.06441 11.2221 8.07963 11.2107 8.09443C11.1941 8.11624 11.1759 8.13628 11.1565 8.15453C11.089 8.23956 11.0176 8.3289 10.9426 8.42283L10.7907 8.61313C10.4772 9.00579 10.1053 9.47139 9.66407 10.0236L9.43764 10.3071C8.58586 11.3732 7.49499 12.7382 6.09755 14.4864C5.79155 14.8678 5.33288 15.0898 4.84021 15.0958L2.41421 15.1264H2.40755C2.17621 15.1264 1.97488 14.9678 1.92088 14.7418L1.37488 12.4278C1.26221 11.9484 1.37421 11.4538 1.68155 11.0698L7.96155 3.2151C7.96421 3.21243 7.96621 3.2091 7.96888 3.20643C8.65755 2.3831 9.90288 2.26176 10.7429 2.93576ZM7.26136 5.69133L2.46221 11.6944C2.34821 11.8371 2.30621 12.0211 2.34821 12.1978L2.80221 14.1211L4.82821 14.0958C5.02088 14.0938 5.19888 14.0078 5.31688 13.8611C5.92454 13.1008 6.68825 12.1452 7.47345 11.1627L7.75125 10.815L8.02952 10.4668C8.76591 9.54526 9.4934 8.63471 10.1021 7.87258L7.26136 5.69133ZM8.73888 3.84443L7.88603 4.91L10.7265 7.09062C11.2733 6.4058 11.633 5.95476 11.6662 5.91176C11.7755 5.73443 11.8182 5.48376 11.7609 5.24243C11.7022 4.9951 11.5482 4.78509 11.3262 4.65109C11.2789 4.61843 10.1555 3.74643 10.1209 3.71909C9.69821 3.38043 9.08155 3.4391 8.73888 3.84443Z",fill:"currentColor"})}),s||(w||"Add review")]})})},F.Summary=s=>{var i,n,l;const{data:r,dataSettings:o}=s,{productId:d}=r||{},{fill_color:a,outline_color:u}=(null==(n=null==(i=null==o?void 0:o.display)?void 0:i.widget)?void 0:n.summary_bar)||{},{review_singular:c,review_plural:x}=(null==(l=null==o?void 0:o.languages)?void 0:l.widget)||{},[p,g]=t.useState(!0),[j,v]=t.useState(!0),[_,w]=t.useState(!0),[f,R]=t.useState(!0),[E,C]=t.useState(!1),[y,b]=t.useState(0),[N,S]=t.useState({5:0,4:0,3:0,2:0,1:0}),[L,$]=t.useState("0"),k=T({productId:d}),A=async()=>{var e;let t,s,i,n=!1,l=0;if(t=await P(d),!t)return;const{status:r,data:o}=t,{code:a}=r;n=200===a||!1,l=(null==o?void 0:o.review_count)?o.review_count:0,s=(null==o?void 0:o.rating)?{5:o.rating[5]||0,4:o.rating[4]||0,3:o.rating[3]||0,2:o.rating[2]||0,1:o.rating[1]||0}:N,i=(null==(e=null==o?void 0:o.rating)?void 0:e.average)?o.rating.average:"0",n&&(b(l),S(s),$(i),w(!1),R(!1),g(!1),E&&v(!1))};return t.useEffect((()=>{"undefined"!=typeof window&&(window.sledgeProductReviewWidgetSummaryUpdate=()=>{R(!0),A()}),Boolean(k&&(null==k?void 0:k.productId)!==d)&&g(!0),A()}),[E,d]),e.jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-summary",children:p?e.jsxRuntimeExports.jsx(X.Item,{width:"630px",height:"42px",color:"grey-100",rounded:"md",animationDuration:"5s"}):_?null:e.jsxRuntimeExports.jsx(m,{trigger:e.jsxRuntimeExports.jsxs(e.motion.div,{initial:!1,animate:E?"open":"closed",className:"sledge-product-review__widget-summary-trigger",children:[e.jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-summary-average",children:L}),e.jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-summary-rating",children:!f&&e.jsxRuntimeExports.jsx(W,{value:String(L),size:"md",withSkeletonLoading:!1,isScrollToElementWidget:!1})}),e.jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__widget-summary-total",children:[y," ",y>1?x||"Reviews":c||"Review"]}),e.jsxRuntimeExports.jsx(e.motion.div,{variants:B,className:"summary-trigger-icon",children:e.jsxRuntimeExports.jsx("svg",{width:20,height:20,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsxRuntimeExports.jsx("path",{d:"M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})})]}),content:j?e.jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-summary-dist-progress",children:[5,4,3,2,1].map((t=>e.jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__widget-summary-dist-progress-item",children:[e.jsxRuntimeExports.jsx(X.Item,{width:"108px",height:"22px",color:"grey-100",rounded:"md",animationDuration:"15s"}),e.jsxRuntimeExports.jsx(X.Item,{width:"128px",height:"22px",color:"grey-100",rounded:"md",animationDuration:"13s",style:{marginLeft:"13px",marginRight:"12px"}}),e.jsxRuntimeExports.jsx(X.Item,{width:"38px",height:"22px",color:"grey-100",rounded:"md",animationDuration:"42s"})]},t)))}):e.jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-summary-dist",children:e.jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-summary-dist-progress",children:[5,4,3,2,1].map(((t,s)=>e.jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__widget-summary-dist-progress-item",children:[e.jsxRuntimeExports.jsx(W,{value:t,size:"sm",withSkeletonLoading:!1,isScrollToElementWidget:!1}),e.jsxRuntimeExports.jsx(h,{value:String(N[t]),total:y,fillColor:a,outlineColor:u}),e.jsxRuntimeExports.jsxs("small",{children:["(",N[t],")"]})]},s)))})}),setIsOpen:C,hideCloseIcon:!0,align:"end",alignOffset:-170,className:"sledge-product-review__widget-summary-content",withArrow:!1})})};const M=async(e,t,s)=>{let i=localStorage.getItem(l);var n=new Headers;n.append("Authorization",`Bearer ${i}`),n.append("Content-Type","application/json");var r={method:t,headers:n,redirect:"follow",...s&&{body:JSON.stringify(s)}};return await fetch(`https://instant-search-engine.offstack.io${e}`,r).then((e=>e.json())).then((e=>e)).catch((()=>{}))},V=async(e,t)=>await M(`/indexes/${e}/search`,"POST",t),D=async e=>await M("/multi-search","POST",e),H=async e=>{const{keyword:t,resultCount:s}=e;let l=localStorage.getItem(n);var r=new Headers;r.append("Authorization",`Bearer ${l}`),r.append("Content-Type","application/json");var o={method:"POST",headers:r,body:JSON.stringify({keyword:t,result_count:s}),redirect:"follow"};return await fetch(`${i}/instantsearch/statistics/search`,o).then((e=>e.json())).then((e=>e)).catch((()=>{}))},q=async e=>{const{productId:t}=e;let s=localStorage.getItem(n);var l=new Headers;l.append("Authorization",`Bearer ${s}`),l.append("Content-Type","application/json");var r={method:"POST",headers:l,body:JSON.stringify({product:{id:c(t)}}),redirect:"follow"};return await fetch(`${i}/instantsearch/statistics/click`,r).then((e=>e.json())).then((e=>e)).catch((()=>{}))},z=({type:s,className:l="",data:r,setting:o,showOptionOutOfStock:d=!1,triggerPropAdditional:a,sourceApp:u=null,isComponentJsVersion:x=!1,cards:p,onAfterAddToCart:m,onAfterAddWishlist:h,onAfterRemoveWishlist:g,onAfterRenderProduct:j,showPopupComponent:v,setShowPopupComponent:_})=>{const{show_vendor:w=!0,show_sku:f=!0,show_price:R=!0,show_add_to_cart:E=!0,redirect_add_to_cart:C=!0,language_button_add_to_cart:y="Add To Cart",display_product_name_style:b={},display_price_style:S={},display_button_add_to_cart_style:$={}}=o||{},[k,I]=t.useState(null),T=async t=>{var s;const{id:l,quantity:r}=t;I(l);let o=await(async e=>{var t,s=new Headers;s.append("Content-Type","application/json");let i=[];e.map((e=>{const{id:t,quantity:s}=e;i.push({id:t,quantity:s})}));var n={method:"POST",headers:s,body:JSON.stringify({items:i}),redirect:"follow"};if(null==(t=null==window?void 0:window.Shopify)?void 0:t.routes)return await fetch(`${window.Shopify.routes.root}cart/add.js`,n).then((e=>e.json())).then((e=>e)).catch((()=>{}))})([{id:l,quantity:r}]);(null==(s=null==o?void 0:o.items)?void 0:s.length)?("wishlist"===u?await(async e=>{const{productId:t}=e;let s=localStorage.getItem(n);var l=new Headers;l.append("Authorization",`Bearer ${s}`),l.append("Content-Type","application/json");var r={method:"POST",headers:l,body:JSON.stringify({product:{id:c(t)}}),redirect:"follow"};return await fetch(`${i}/wishlist/cart`,r).then((e=>e.json())).then((e=>e)).catch((()=>{}))})({productId:l}):"instant-search"===u&&await(async e=>{const{productId:t}=e;let s=localStorage.getItem(n);var l=new Headers;l.append("Authorization",`Bearer ${s}`),l.append("Content-Type","application/json");var r={method:"POST",headers:l,body:JSON.stringify({product:{id:c(t)}}),redirect:"follow"};return await fetch(`${i}/instantsearch/statistics/cart`,r).then((e=>e.json())).then((e=>e)).catch((()=>{}))})({productId:l}),I(null),m&&m("success"),C?window.location.href="/cart":window.sledgeToastNotification({title:"Cart added",message:"Successfully added to wishlist",type:"success",icon:e.jsxRuntimeExports.jsx(N,{width:40,height:40,color:"black"})})):(m&&m("failed"),setTimeout((()=>{var t;I(null),"undefined"!=typeof window&&window.sledgeToastNotification&&window.sledgeToastNotification({title:"Failed",message:(null==(t=null==o?void 0:o.description)?void 0:t.length)?o.description:"failed add to cart, please try again",type:"failed",icon:e.jsxRuntimeExports.jsx(N,{width:40,height:40,color:"black"})})}),1e3))};return t.useEffect((()=>{j&&j("success")}),[]),e.jsxRuntimeExports.jsx("div",{className:`sledge__product-grid ${l}`,"data-grid-type":s,children:null==r?void 0:r.map(((s,n)=>{const{product:l,variants:r}=s||{},{id:o,title:c,image:m,url:j,vendor:C="",currency:N}=l||{},{id:I="",title:P="",price:B="",sku:O=""}=(null==r?void 0:r.length)?r[0]:{};let F=k==I,M=!(!(null==r?void 0:r.length)||!Object.hasOwn(r[0],"inventory_quantity"))&&(!r[0].inventory_quantity&&d);const V=p?p({product:{...l,variants:r.map(((e,t)=>{const{inventory_quantity:s}=e||{};return{...e,is_out_of_stock:!!Object.hasOwn(r[t],"inventory_quantity")&&!s}}))},showPopupComponent:v,setShowPopupComponent:_}):null;return p?e.jsxRuntimeExports.jsx(t.Fragment,{children:x?e.jsxRuntimeExports.jsx("div",{dangerouslySetInnerHTML:{__html:V}}):V},n):e.jsxRuntimeExports.jsxs("div",{className:"sledge__product-grid-card",children:[e.jsxRuntimeExports.jsxs("div",{className:"sledge__product-grid-content",children:[e.jsxRuntimeExports.jsxs("div",{className:"sledge__product-grid-card-image",children:[e.jsxRuntimeExports.jsxs("a",{href:j,onClick:()=>"instant-search"===u&&q({productId:o}),children:[e.jsxRuntimeExports.jsx(A,{data:{productId:o,productVariantId:I,productName:c,productVendor:C,productSku:O,productVariantName:P,productLink:j,productImage:(null==m?void 0:m.src)||`${i}/img/blank-image.png`,productCurrency:N,productPrice:B},...a,onAfterAddWishlist:h,onAfterRemoveWishlist:g}),e.jsxRuntimeExports.jsx("img",{src:(null==m?void 0:m.src)||"",alt:"sledge-product-card-image",loading:"lazy",onError:e=>e.currentTarget.src=`${i}/img/blank-image.png`})]}),M?e.jsxRuntimeExports.jsx("div",{className:"sledge__product-grid-card-out-of-stock",children:"Sold out"}):null]}),e.jsxRuntimeExports.jsxs("div",{className:"sledge__product-grid-card-desc",children:[e.jsxRuntimeExports.jsxs("div",{className:"sledge__product-grid-card-title",children:[c?e.jsxRuntimeExports.jsx("a",{href:j,onClick:()=>"instant-search"===u&&q({productId:o}),children:e.jsxRuntimeExports.jsx("h3",{style:b,children:c})}):null,R?e.jsxRuntimeExports.jsx("div",{className:"sledge__product-grid-card-price",children:e.jsxRuntimeExports.jsxs("p",{style:S,children:[N,B]})}):null]}),e.jsxRuntimeExports.jsxs("div",{className:"sledge__product-grid-card-text",children:[e.jsxRuntimeExports.jsx("div",{children:P}),e.jsxRuntimeExports.jsxs("div",{children:[e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:w?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:["Vendor: ",C]}):null}),e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:" | "}),e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:f?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:["SKU: ",O]}):null})]})]}),e.jsxRuntimeExports.jsx("div",{className:"sledge__product-grid-card-rating",children:e.jsxRuntimeExports.jsx(W,{data:{productId:o},size:"xs",withSkeletonLoading:!1,isScrollToElementWidget:!1})})]})]}),E?e.jsxRuntimeExports.jsx("div",{className:"sledge__product-grid-button-wrapper",children:e.jsxRuntimeExports.jsx(L,{type:"button",colorType:"light",style:{...$,...F&&{cursor:"wait"}},...F||M?{disabled:!0}:{onClick:()=>T({id:I,quantity:1})},children:F?"Adding...":M?"Sold out":e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("svg",{width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.83562 1.50023C10.796 1.50023 12.4155 2.99397 12.6152 4.90442L12.6709 4.90507C13.7584 4.90507 15.0806 5.62732 15.5269 7.65307L16.1186 12.2333C16.3309 13.7116 16.0654 14.8973 15.3281 15.7478C14.5946 16.5938 13.4336 17.0416 11.9704 17.0416H5.7094C4.10215 17.0416 2.9824 16.6478 2.28565 15.8386C1.5859 15.0271 1.3519 13.8098 1.5904 12.2213L2.1724 7.70182C2.5549 5.62957 3.95365 4.90507 5.03665 4.90507C5.13014 4.04293 5.51889 3.22275 6.13562 2.60797C6.84437 1.90372 7.82162 1.50023 8.81987 1.50023H8.83562ZM12.6709 6.03007H5.03665C4.7059 6.03007 3.6004 6.16357 3.28315 7.87657L2.70415 12.3766C2.5159 13.6388 2.6614 14.5523 3.13765 15.1051C3.6079 15.6511 4.4494 15.9166 5.7094 15.9166H11.9704C12.7564 15.9166 13.8296 15.7598 14.4776 15.0113C14.9921 14.4181 15.1691 13.5346 15.0041 12.3848L14.4199 7.84582C14.1709 6.72757 13.5139 6.03007 12.6709 6.03007ZM11.023 8.11815C11.3335 8.11815 11.6027 8.37015 11.6027 8.68065C11.6027 8.99115 11.368 9.24315 11.0575 9.24315H11.023C10.7125 9.24315 10.4605 8.99115 10.4605 8.68065C10.4605 8.37015 10.7125 8.11815 11.023 8.11815ZM6.65042 8.11815C6.96092 8.11815 7.23017 8.37015 7.23017 8.68065C7.23017 8.99115 6.99467 9.24315 6.68417 9.24315H6.65042C6.33992 9.24315 6.08792 8.99115 6.08792 8.68065C6.08792 8.37015 6.33992 8.11815 6.65042 8.11815ZM8.83337 2.62522H8.82212C8.11637 2.62522 7.42862 2.90947 6.92987 3.40522C6.5236 3.80967 6.25789 4.34137 6.17193 4.90472L11.4814 4.90493C11.2887 3.61626 10.1743 2.62522 8.83337 2.62522Z",fill:"#393D4E"})}),e.jsxRuntimeExports.jsx("span",{children:y||"Add To Cart"})]})})}):null]},n)}))})},Z=({className:t="",data:s})=>e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:(null==s?void 0:s.length)?e.jsxRuntimeExports.jsx("div",{className:`sledge__collection-grid ${t}`,children:s.map(((t,s)=>{const{id:n,title:l,description:r,url:o,image:d}=t;return e.jsxRuntimeExports.jsxs("div",{className:"sledge__collection-grid-card",children:[e.jsxRuntimeExports.jsx("div",{className:"sledge__collection-grid-card-image",children:e.jsxRuntimeExports.jsx("img",{src:d||`${i}/img/blank-image.png`,alt:"sledge-product-card-image",loading:"lazy",onError:e=>e.currentTarget.src=`${i}/img/blank-image.png`})}),e.jsxRuntimeExports.jsxs("div",{className:"sledge__collection-grid-card-content",children:[e.jsxRuntimeExports.jsxs("div",{className:"sledge__collection-grid-card-text",children:[e.jsxRuntimeExports.jsx("div",{className:"sledge__collection-grid-card-content-title",children:l}),e.jsxRuntimeExports.jsx("div",{className:"sledge__collection-grid-card-content-description",children:r})]}),e.jsxRuntimeExports.jsx("div",{className:"sledge__collection-grid-card-content-button-wrapper",children:e.jsxRuntimeExports.jsx(L,{type:"button",colorType:"success",elementType:"hyperlink",link:o,children:"Shop Now"})})]})]},s)}))}):null}),J=({className:t="",data:s})=>e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:(null==s?void 0:s.length)?e.jsxRuntimeExports.jsx("div",{className:`sledge__page-grid ${t}`,children:s.map(((t,s)=>{const{id:n,title:l,description:r,url:o,image:d}=t;return e.jsxRuntimeExports.jsx("a",{href:o,children:e.jsxRuntimeExports.jsxs("div",{className:"sledge__page-grid-card",children:[e.jsxRuntimeExports.jsx("div",{className:"sledge__page-grid-card-image",children:e.jsxRuntimeExports.jsx("img",{src:d||`${i}/img/blank-image.png`,alt:"sledge-product-card-image",loading:"lazy",onError:e=>e.currentTarget.src=`${i}/img/blank-image.png`})}),e.jsxRuntimeExports.jsxs("div",{className:"sledge__page-grid-card-content",children:[e.jsxRuntimeExports.jsx("div",{className:"sledge__page-grid-card-content-title",children:l}),e.jsxRuntimeExports.jsx("div",{className:"sledge__page-grid-card-content-description",children:r})]})]})},s)}))}):null}),U=({className:t="",data:s})=>e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:(null==s?void 0:s.length)?e.jsxRuntimeExports.jsx("div",{className:`sledge__blog-grid ${t}`,children:null==s?void 0:s.map(((t,s)=>{const{id:n,title:l,date:r,description:o,url:d,image:a}=t;return e.jsxRuntimeExports.jsxs("div",{className:"sledge__blog-grid-card",children:[e.jsxRuntimeExports.jsxs("div",{className:"sledge__blog-grid-content",children:[e.jsxRuntimeExports.jsx("div",{className:"sledge__blog-grid-card-image",children:e.jsxRuntimeExports.jsx("a",{href:d,children:e.jsxRuntimeExports.jsx("img",{src:a||`${i}/img/blank-image.png`,alt:"sledge-blog-card-image",loading:"lazy",onError:e=>e.currentTarget.src=`${i}/img/blank-image.png`})})}),e.jsxRuntimeExports.jsxs("div",{className:"sledge__blog-grid-card-desc",children:[e.jsxRuntimeExports.jsx("div",{className:"sledge__blog-grid-card-title",children:e.jsxRuntimeExports.jsx("div",{children:e.jsxRuntimeExports.jsx("a",{href:d,children:e.jsxRuntimeExports.jsx("div",{children:l})})})}),(null==r?void 0:r.length)?e.jsxRuntimeExports.jsx("div",{className:"sledge__blog-grid-card-date",children:r}):null,e.jsxRuntimeExports.jsx("div",{className:"sledge__blog-grid-card-text",children:o})]})]}),e.jsxRuntimeExports.jsx("div",{className:"sledge__blog-grid-button-wrapper",children:e.jsxRuntimeExports.jsx(L,{type:"button",colorType:"light",elementType:"hyperlink",link:d,children:"Learn More"})})]},s)}))}):null}),G=({children:s,content:i,withArrow:n=!0,customArrow:l="",sideOffset:r=5,alignOffset:o=0,wrapTrigger:d=!0})=>{const[a,u]=t.useState(!1);return t.useEffect((()=>{var e;let t=null==(e=null==document?void 0:document.querySelector(".sledge__tooltip-arrow"))?void 0:e.parentElement;t&&(null==l?void 0:l.length)&&(t.classList.add("sledge__tooltip-arrow-parent"),t.innerHTML=l)}),[a]),e.jsxRuntimeExports.jsx(e.$a093c7e1ec25a057$export$2881499e37b75b9a,{delayDuration:0,children:e.jsxRuntimeExports.jsxs(e.$a093c7e1ec25a057$export$be92b6f5f03c0fe9,{onOpenChange:u,children:[e.jsxRuntimeExports.jsx(e.$a093c7e1ec25a057$export$41fb9f06171c75f4,{asChild:!0,children:d?e.jsxRuntimeExports.jsx("span",{children:s}):s}),e.jsxRuntimeExports.jsx(e.$a093c7e1ec25a057$export$602eac185826482c,{children:e.jsxRuntimeExports.jsxs(e.$a093c7e1ec25a057$export$7c6e2c02157bb7d2,{className:"sledge__tooltip-content",sideOffset:r,alignOffset:o,children:[i,n?e.jsxRuntimeExports.jsx(e.$a093c7e1ec25a057$export$21b07c8f274aebd5,{className:"sledge__tooltip-arrow"}):null]})})]})})},K=({children:t,isLoading:s=!1,className:i="",withCorner:n=!0})=>e.jsxRuntimeExports.jsxs(e.$57acba87d6e25586$export$be92b6f5f03c0fe9,{className:`sledge__scroll-area-root ${i}`,children:[e.jsxRuntimeExports.jsx(e.$57acba87d6e25586$export$d5c6c08dc2d3ca7,{className:"sledge__scroll-area-viewport "+(s?"sledge__scroll-area-viewport-loading":""),children:t}),!s&&e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(e.$57acba87d6e25586$export$9a4e88b92edfce6b,{className:"sledge__scroll-area-scrollbar",orientation:"vertical",children:e.jsxRuntimeExports.jsx(e.$57acba87d6e25586$export$6521433ed15a34db,{className:"sledge__scroll-area-thumb"})}),e.jsxRuntimeExports.jsx(e.$57acba87d6e25586$export$9a4e88b92edfce6b,{className:"sledge__scroll-area-scrollbar",orientation:"horizontal",children:e.jsxRuntimeExports.jsx(e.$57acba87d6e25586$export$6521433ed15a34db,{className:"sledge__scroll-area-thumb"})}),n&&e.jsxRuntimeExports.jsx(e.$57acba87d6e25586$export$ac61190d9fc311a9,{className:"sledge__scroll-area-corner"})]})]}),Y=({width:t,height:s,rounded:i,color:n,animationDuration:l="8s",disableAnimation:r=!1,style:o={},className:d="",...a})=>e.jsxRuntimeExports.jsx("div",{className:`sledge__skeleton-item ${d} ${r?"":"sledge__skeleton-item-animation"}`,style:{width:t,height:s,WebkitAnimationDuration:l,animationDuration:l,...o},"data-skeleton-rounded":i,"data-skeleton-color":n,...a}),X={Item:Y,ReviewGrid:({count:t,type:s,gridItemHeights:i=[]})=>{let n=[];for(let l=0;l<t;l++)n.push(e.jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-review-card",children:e.jsxRuntimeExports.jsx(Y,{width:"100%",height:"list"===s||"grid"===s&&!(null==i?void 0:i.length)?"111px":i[l],color:"grey-100",rounded:"md",animationDuration:"list"===s?"2.5s":"8s"})},l));return e.jsxRuntimeExports.jsx(e.MasonryResponsive,{columnsCountBreakPoints:"grid"===s?{350:1,750:3,1024:4}:{350:1},className:"sledge-product-review__widget-review-grid sledge__skeleton-review-grid sledge__skeleton-pointer-events-none",children:e.jsxRuntimeExports.jsx(e.Masonry,{gutter:"30px",children:n})})},ProductGrid:({count:t,type:s})=>{let i=[];for(let n=0;n<t;n++)i.push(e.jsxRuntimeExports.jsxs("div",{className:"sledge__product-grid-card",children:[e.jsxRuntimeExports.jsxs("div",{className:"sledge__product-grid-content",children:[e.jsxRuntimeExports.jsxs("div",{className:"sledge__product-grid-card-image sledge__skeleton-product-grid-card-image",children:[e.jsxRuntimeExports.jsx("div",{className:"sledge-wishlist__trigger-block",children:e.jsxRuntimeExports.jsx(Y,{width:"40px",height:"40px",color:"grey-300",rounded:"sm",disableAnimation:!0})}),e.jsxRuntimeExports.jsx(Y,{width:"100%",height:"100%",color:"grey-100",rounded:"md"})]}),e.jsxRuntimeExports.jsxs("div",{className:"sledge__product-grid-card-desc",children:[e.jsxRuntimeExports.jsxs("div",{className:"sledge__product-grid-card-title",children:[e.jsxRuntimeExports.jsx(Y,{width:"134px",height:"28px",color:"grey-100",rounded:"md",animationDuration:"15s"}),e.jsxRuntimeExports.jsx(Y,{width:"80px",height:"28px",color:"grey-100",rounded:"md",animationDuration:"20s"})]}),e.jsxRuntimeExports.jsx("div",{className:"sledge__product-grid-card-text",children:e.jsxRuntimeExports.jsx(Y,{width:"190px",height:"46px",color:"grey-100",rounded:"md",animationDuration:"13s",style:{marginBottom:"16px"}})})]})]}),e.jsxRuntimeExports.jsx("div",{className:"sledge__product-grid-button-wrapper",children:e.jsxRuntimeExports.jsx(Y,{width:"117px",height:"40px",color:"grey-100",rounded:"md",animationDuration:"15s"})})]},n));return e.jsxRuntimeExports.jsx("div",{className:"sledge__product-grid sledge__skeleton-product-grid sledge__skeleton-pointer-events-none","data-grid-type":s,children:i})},CollectionGrid:({count:t})=>{let s=[];for(let i=0;i<t;i++)s.push(e.jsxRuntimeExports.jsxs("div",{className:"sledge__collection-grid-card",children:[e.jsxRuntimeExports.jsx("div",{className:"sledge__collection-grid-card-image",children:e.jsxRuntimeExports.jsx(Y,{width:"246px",height:"246px",color:"grey-300",rounded:"md"})}),e.jsxRuntimeExports.jsxs("div",{className:"sledge__collection-grid-card-content",children:[e.jsxRuntimeExports.jsxs("div",{className:"sledge__collection-grid-card-text",children:[e.jsxRuntimeExports.jsx("div",{className:"sledge__collection-grid-card-content-title",children:e.jsxRuntimeExports.jsx(Y,{width:"100%",height:"70px",color:"grey-300",rounded:"lg"})}),e.jsxRuntimeExports.jsx("div",{className:"sledge__collection-grid-card-content-description",children:e.jsxRuntimeExports.jsx(Y,{width:"100%",height:"47px",color:"grey-300",rounded:"md",style:{maxWidth:"357px"}})})]}),e.jsxRuntimeExports.jsx("div",{className:"sledge__collection-grid-card-content-button-wrapper",children:e.jsxRuntimeExports.jsx(Y,{width:"100%",height:"40px",color:"grey-300",rounded:"md",animationDuration:"20s",style:{maxWidth:"117px"}})})]})]},i));return e.jsxRuntimeExports.jsx("div",{className:"sledge__collection-grid sledge__skeleton-collection-grid sledge__skeleton-pointer-events-none",children:s})},PageGrid:({count:t})=>{let s=[];for(let i=0;i<t;i++)s.push(e.jsxRuntimeExports.jsxs("div",{className:"sledge__page-grid-card",children:[e.jsxRuntimeExports.jsx("div",{className:"sledge__page-grid-card-image",children:e.jsxRuntimeExports.jsx(Y,{width:"100%",height:"100%",color:"grey-300",rounded:"md",animationDuration:"13s",style:{borderTopRightRadius:0,borderBottomRightRadius:0}})}),e.jsxRuntimeExports.jsxs("div",{className:"sledge__page-grid-card-content",children:[e.jsxRuntimeExports.jsx("div",{className:"sledge__page-grid-card-content-title",children:e.jsxRuntimeExports.jsx(Y,{width:"100%",height:"40px",color:"grey-300",rounded:"md",animationDuration:"6s"})}),e.jsxRuntimeExports.jsx("div",{className:"sledge__page-grid-card-content-description",children:e.jsxRuntimeExports.jsx(Y,{width:"100%",height:"40px",color:"grey-300",rounded:"md",animationDuration:"17s",style:{maxWidth:"115px"}})})]})]},i));return e.jsxRuntimeExports.jsx("div",{className:"sledge__page-grid sledge__skeleton-page-grid sledge__skeleton-pointer-events-none",children:s})},BlogGrid:({count:t})=>{let s=[];for(let i=0;i<t;i++)s.push(e.jsxRuntimeExports.jsx("div",{className:"sledge__blog-grid-card",children:e.jsxRuntimeExports.jsxs("div",{className:"sledge__blog-grid-content",children:[e.jsxRuntimeExports.jsx("div",{className:"sledge__blog-grid-card-image",children:e.jsxRuntimeExports.jsx(Y,{width:"100%",height:"100%",color:"grey-100",rounded:"md",animationDuration:"10s"})}),e.jsxRuntimeExports.jsxs("div",{className:"sledge__blog-grid-card-desc",children:[e.jsxRuntimeExports.jsx(Y,{width:"100%",height:"28px",color:"grey-100",rounded:"md",style:{maxWidth:"242px",marginTop:"26px",marginBottom:"12px"}}),e.jsxRuntimeExports.jsx(Y,{width:"100%",height:"28px",color:"grey-100",rounded:"md",animationDuration:"23s",style:{maxWidth:"80px",marginBottom:"27px"}}),e.jsxRuntimeExports.jsx(Y,{width:"100%",height:"80px",color:"grey-100",rounded:"md",animationDuration:"13s",style:{maxWidth:"190px",marginBottom:"27px"}}),e.jsxRuntimeExports.jsx(Y,{width:"100%",height:"40px",color:"grey-100",rounded:"md",animationDuration:"20s",style:{maxWidth:"117px"}})]})]})},i));return e.jsxRuntimeExports.jsx("div",{className:"sledge__blog-grid sledge__skeleton-blog-grid sledge__skeleton-pointer-events-none",children:s})}},Q=({listsComponent:t,name:s,items:i,isComponentJsVersion:n,showPopupComponent:l,setShowPopupComponent:r})=>{const o=t?t({name:s,items:i,showPopupComponent:l,setShowPopupComponent:r}):null;return t?n?e.jsxRuntimeExports.jsx("div",{dangerouslySetInnerHTML:{__html:o}}):o:e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__icon-widget-search-form-result-title",children:s}),(null==i?void 0:i.length)?e.jsxRuntimeExports.jsx("ul",{className:"sledge-instant-search__icon-widget-search-form-result-list",children:i.map(((t,s)=>{const{title:i,url:n}=t;return e.jsxRuntimeExports.jsx("li",{children:e.jsxRuntimeExports.jsx("a",{href:n,className:"sledge-instant-search__icon-widget-search-form-result-list-link",children:i})},s)}))}):e.jsxRuntimeExports.jsx("ul",{className:"sledge-instant-search__icon-widget-search-form-result-list",children:e.jsxRuntimeExports.jsxs("li",{className:"sledge-instant-search__icon-widget-search-form-result-item-disabled",children:["No ",null==s?void 0:s.toLowerCase()," were found"]})})]})},ee=({listsComponent:t,keywords:s,isComponentJsVersion:i=!1,showPopupComponent:n,setShowPopupComponent:l})=>{const r=t?t({keywords:s,showPopupComponent:n,setShowPopupComponent:l}):null;return t?i?e.jsxRuntimeExports.jsx("div",{dangerouslySetInnerHTML:{__html:r}}):r:e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__icon-widget-search-form-result-title",children:"Suggestions"}),e.jsxRuntimeExports.jsx("ul",{className:"sledge-instant-search__icon-widget-search-form-result-list",children:null==s?void 0:s.map(((t,s)=>e.jsxRuntimeExports.jsx("li",{children:e.jsxRuntimeExports.jsxs("a",{href:`${a}?q=${t}`,className:"sledge-instant-search__icon-widget-search-form-result-list-link sledge-instant-search__icon-widget-search-form-result-list-link-suggestion",children:[e.jsxRuntimeExports.jsx(S,{width:12,height:12,color:"#677487"})," ",t]})},s)))})]})},te=({component:t,keyword:s,isComponentJsVersion:i=!1,showPopupComponent:n,setShowPopupComponent:l})=>{const r=t?t({keyword:s,showPopupComponent:n,setShowPopupComponent:l}):null;return t?i?e.jsxRuntimeExports.jsx("div",{dangerouslySetInnerHTML:{__html:r}}):r:e.jsxRuntimeExports.jsx("a",{href:`${a}?q=${s}`,className:"sledge-instant-search__icon-widget-button-more",children:"View More Result"})},se=i=>{var n,l,r,o,a,u,c,p,m,h;const{isRenderApp:g,isJsVersion:j}=t.useContext(s.SledgeContext),{layoutType:v="default",query:_,data:w,children:f,onAfterAddToCart:R,onAfterAddWishlist:E,onAfterRemoveWishlist:C,onAfterRenderProduct:y}=i,{keyword:b=""}=_||{},{collectionId:N}=w||{};let S=null;t.Children.map(f,(e=>{if(t.isValidElement(e)&&x(e.type)){const{productCard:t}=(null==e?void 0:e.props)||{};t&&x(t)&&(S=t)}}));const[L,$]=t.useState(!0),[k,A]=t.useState(!0),[I,P]=t.useState(""),[W,B]=t.useState(null),[O,F]=t.useState(),[M,V]=t.useState(e.jsxRuntimeExports.jsx(ie,{})),[H,q]=t.useState(!0),[z,Z]=t.useState([]),[J,U]=t.useState([]),[G,K]=t.useState([]),[Y,Q]=t.useState([]),[ee,te]=t.useState(""),[se,le]=t.useState({}),[re,oe]=t.useState([]),[de,ae]=t.useState({}),[ue,ce]=t.useState([]),[xe,pe]=t.useState(""),[me,he]=t.useState(!1),ge=t.useRef(null),je=T({keyword:I}),ve=async(e,t)=>{const{filters:s,tabs:i,suffix_index_product:n,hidden_tags:l,display:r,show_out_of_stock:o}=e;let d,a={queries:("product-filter"===v?i.filter((({index:e})=>null==e?void 0:e.includes(n))):i).map((e=>{const{index:i}=e;let r=!1,d=r?[]:null==s?void 0:s.map((e=>{const{collections:t,items:s}=e;return N&&(null==t?void 0:t.includes(Number(N)))||(null==t?void 0:t.includes("all"))?(r=!0,null==s?void 0:s.map((({value:e})=>e))):void 0})),a=i.includes(n),u=a&&d.length,c=[];return(null==l?void 0:l.length)&&c.push(`tags NOT IN [${l}]`),o||c.push("variants.inventory_quantity > 0"),N&&c.push(`collections.id = '${N}'`),u&&Q(d[0]),{indexUid:i,q:"default"===t?"":I,hitsPerPage:1,facets:u?d[0]:[],filter:a?c.join(" AND "):""}}))};if(d=await D(a),!d)return;const{results:u}=d;if($(!1),q(!1),A(!1),"totalDataPerIndex"===t)K(null==i?void 0:i.map((e=>{const{index:t}=e,{totalHits:s}=(null==u?void 0:u.find((({indexUid:e})=>e===t)))||{};return{...e,total:s}})));else{const{facetDistribution:e,facetStats:t}=(null==u?void 0:u.find((({indexUid:e})=>e.includes(n))))||{};le(e?Object.fromEntries(Object.entries(e).map((s=>{let i=s[0],n=[];return"variants.inventory_quantity"===i?(Object.keys(e[i]).map((t=>Boolean(Number(t))?e[i][t]:0)),n=[{name:"In Stock",value:"> 0"}]):n="variants.price"===i?t[i]:Object.keys(e[i]).map((t=>({name:t,value:t,total:e[i][t]||0}))),[i,n]}))):{})}};t.useEffect((()=>{if(!(null==g?void 0:g.instantSearch))return;const e=new URLSearchParams(document.location.search);P((null==e?void 0:e.get(b))||""),(async e=>{let t;q(!0);let s,i=!1;if(t=JSON.parse(e),!t)return;const{status:n,data:l}=t,{code:r}=n,{allowed_sorts:o,default_sort:d,filters:a,tabs:u,suffix_index_product:c,hidden_tags:x,display:p,colors:m,show_out_of_stock:h}=l;i=200===r||!1,i&&(Z((null==o?void 0:o.length)?o:[]),U((null==a?void 0:a.length)?a:[]),te(c),oe(x),ae(p),ce(m),pe(d),he(h),s=u.find((({index:e})=>e.includes(c))),Object.keys(s).length&&(B(s.index),F(s.name)),await ve(l,"default"),"default"===v&&await ve(l,"totalDataPerIndex"))})(localStorage.getItem(d)||"")}),[g]),t.useEffect((()=>{if(Boolean(je&&(null==je?void 0:je.keyword)!==I)&&"default"===v){const e=setTimeout((()=>{ve({filters:J,tabs:G,suffix_index_product:ee,hidden_tags:re,display:de,colors:ue,show_out_of_stock:me},"totalDataPerIndex")}),500);return()=>clearTimeout(e)}}),[I]);const _e="default"===v?e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-tab-list sledge-instant-search__result-tab-list-skeleton",children:[1,2,3,4,5].map((t=>e.jsxRuntimeExports.jsx(X.Item,{width:"122px",height:"28px",rounded:"md",color:"grey-100",animationDuration:"15s"},t)))}):null,we=(null==(n=null==de?void 0:de.filter)?void 0:n.enable_on_search)&&"horizontal"===(null==(l=null==de?void 0:de.filter)?void 0:l.layout)?e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-filter-horizontal-skeleton",children:[1,2,3,4,5,6,7].map((t=>e.jsxRuntimeExports.jsx(X.Item,{width:"106px",height:"42px",rounded:"md",color:"grey-100",animationDuration:"13s"},t)))}):null,fe=(null==(r=null==de?void 0:de.filter)?void 0:r.enable_on_search)&&"vertical"===(null==(o=null==de?void 0:de.filter)?void 0:o.layout)?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsxs("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:"8px",justifyContent:"space-between",marginBottom:"23px"},children:[e.jsxRuntimeExports.jsx(X.Item,{width:"117px",height:"28px",color:"grey-100",rounded:"md",animationDuration:"15s"}),e.jsxRuntimeExports.jsx(X.Item,{width:"80px",height:"28px",color:"grey-100",rounded:"md",animationDuration:"15s"})]}),e.jsxRuntimeExports.jsx(X.Item,{width:"100%",height:"28px",color:"grey-100",rounded:"md",style:{maxWidth:"270px",marginBottom:"18px"}}),[1,2,3].map((t=>e.jsxRuntimeExports.jsx(X.Item,{width:"100%",height:"28px",color:"grey-100",rounded:"md",style:{maxWidth:"163px",marginBottom:"9px"}},t))),e.jsxRuntimeExports.jsx(X.Item,{width:"100%",height:"28px",color:"grey-100",rounded:"md",style:{maxWidth:"163px",marginBottom:"18px"}}),e.jsxRuntimeExports.jsx(X.Item,{width:"100%",height:"28px",color:"grey-100",rounded:"md",style:{maxWidth:"270px",marginBottom:"14px"}}),e.jsxRuntimeExports.jsx(X.Item,{width:"100%",height:"28px",color:"grey-100",rounded:"md",style:{maxWidth:"163px",marginBottom:"9px"}}),e.jsxRuntimeExports.jsx(X.Item,{width:"100%",height:"28px",color:"grey-100",rounded:"md",style:{maxWidth:"163px",marginBottom:"17px"}}),e.jsxRuntimeExports.jsx(X.Item,{width:"100%",height:"28px",color:"grey-100",rounded:"md",style:{maxWidth:"270px",marginBottom:"38px"}}),e.jsxRuntimeExports.jsx(X.Item,{width:"100%",height:"28px",color:"grey-100",rounded:"md",style:{maxWidth:"270px",marginBottom:"35px"}}),e.jsxRuntimeExports.jsx(X.Item,{width:"100%",height:"28px",color:"grey-100",rounded:"md",style:{maxWidth:"270px",marginBottom:"12px"}}),e.jsxRuntimeExports.jsx(X.Item,{width:"100%",height:"28px",color:"grey-100",rounded:"md",style:{maxWidth:"163px",marginBottom:"9px"}}),e.jsxRuntimeExports.jsx(X.Item,{width:"100%",height:"28px",color:"grey-100",rounded:"md",style:{maxWidth:"163px",marginBottom:"20px"}}),e.jsxRuntimeExports.jsx(X.Item,{width:"100%",height:"28px",color:"grey-100",rounded:"md",style:{maxWidth:"270px",marginBottom:"12px"}}),[1,2,3].map((t=>e.jsxRuntimeExports.jsx(X.Item,{width:"100%",height:"28px",color:"grey-100",rounded:"md",style:{maxWidth:"163px",marginBottom:"9px"}},t))),e.jsxRuntimeExports.jsx(X.Item,{width:"100%",height:"28px",color:"grey-100",rounded:"md",style:{maxWidth:"270px",marginBottom:"11px"}}),e.jsxRuntimeExports.jsx("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:"12px"},children:[1,2,3,4,5,6,7,8,9].map((t=>e.jsxRuntimeExports.jsx(X.Item,{width:"34px",height:"34px",color:"grey-100",rounded:"full",animationDuration:"40s"},t)))})]}):null,Re=e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[(null==(a=null==de?void 0:de.filter)?void 0:a.show_total_products)&&"vertical"===(null==(u=null==de?void 0:de.filter)?void 0:u.layout)?e.jsxRuntimeExports.jsx(X.Item,{width:"117px",height:"28px",color:"grey-100",rounded:"md",animationDuration:"13s",style:{marginBottom:"21px"}}):null,e.jsxRuntimeExports.jsx(X.ProductGrid,{count:12,type:"large"})]}),Ee=e.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-data-keyword",children:[(null==(c=null==de?void 0:de.filter)?void 0:c.show_total_products)&&"horizontal"===(null==(p=null==de?void 0:de.filter)?void 0:p.layout)?e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-data-summary sledge-instant-search__result-data-summary-filter-horizontal",children:e.jsxRuntimeExports.jsx(X.Item,{width:"117px",height:"28px",color:"grey-100",rounded:"md",animationDuration:"13s"})}):null,e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-data-keyword-form",children:e.jsxRuntimeExports.jsx(X.Item,{width:"100%",height:"42px",color:"grey-100",rounded:"lg",style:{maxWidth:"630px"}})}),e.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-data-summary-item sledge-instant-search__result-data-summary-select-field",children:[e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-data-summary-select-field-item",children:e.jsxRuntimeExports.jsx(X.Item,{width:"150px",height:"42px",color:"grey-100",rounded:"lg"})}),e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-data-summary-select-field-item",children:e.jsxRuntimeExports.jsx(X.Item,{width:"150px",height:"42px",color:"grey-100",rounded:"lg"})})]})]});return e.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-container",ref:ge,children:[L?null:e.jsxRuntimeExports.jsx("div",{className:""+("default"===v&&(null==G?void 0:G.length)?"sledge-instant-search__result-tab":"sledge-instant-search__result-tab-no-index"),children:"default"===v&&(null==G?void 0:G.length)?e.jsxRuntimeExports.jsx("ul",{className:"sledge-instant-search__result-tab-list",children:G.map((t=>{const{name:s,index:i,total:n}=t;let l=W===i;return e.jsxRuntimeExports.jsxs("li",{onClick:t=>((t,s,i)=>{B(t),F(s),V(t.includes(ee)?e.jsxRuntimeExports.jsx(ie,{}):e.jsxRuntimeExports.jsx(ne,{}))})(i,s),className:""+(l?"sledge-instant-search__result-tab-list-item-active":""),children:[s,e.jsxRuntimeExports.jsx("span",{className:"sledge-instant-search__result-tab-total",children:n||0})]},i)}))}):null}),L&&(null==v?void 0:v.length)?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[_e,we,e.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-wrapper sledge-instant-search__result-wrapper-skeleton",children:[(null==(m=null==de?void 0:de.filter)?void 0:m.enable_on_search)&&"vertical"===(null==(h=null==de?void 0:de.filter)?void 0:h.layout)?e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-filter",children:fe}):null,e.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-data",children:[Ee,Re]})]})]}):t.cloneElement(M,{isLoading:k,keyword:I,clickedTabIndexId:W,clickedTabIndexName:O,isLoadingSetting:H,allowedSorts:z,allowedFilters:J,facets:Y,searchResultFacets:se,hiddenTags:re,displaySettings:de,colorSwatches:ue,defaultSort:xe,showOutOfStock:me,query:_,data:w,isJsVersion:j,productCardsComponent:S,onAfterAddToCart:R,onAfterAddWishlist:E,onAfterRemoveWishlist:C,onAfterRenderProduct:y,setIsLoading:A,setKeyword:P,filterHorizontalSkeleton:we,filterVerticalSkeleton:fe,productGridSkeleton:Re,searchAndSelectOptionSkeleton:Ee,searchResultContainerRef:ge})]})},ie=s=>{var i,n,l,r,o,d,a,u,c,x,h,R,E,y,b,N,A,I,P,W;const{keyword:O,clickedTabIndexId:F,isLoadingSetting:M,allowedSorts:D,allowedFilters:q,facets:Z,searchResultFacets:J,hiddenTags:U,displaySettings:G,colorSwatches:K,defaultSort:Y,showOutOfStock:X,query:Q,data:ee,isJsVersion:te,productCardsComponent:se,setKeyword:ie,filterHorizontalSkeleton:ne,filterVerticalSkeleton:re,productGridSkeleton:oe,searchAndSelectOptionSkeleton:de,onAfterAddToCart:ae,onAfterAddWishlist:ue,onAfterRemoveWishlist:ce,onAfterRenderProduct:xe,searchResultContainerRef:pe}=s||{},{keyword:me=""}=Q||{},{collectionId:he}=ee||{},[ge,je]=t.useState(!0),[ve,_e]=t.useState(!0),[we,fe]=t.useState(!1),[Re,Ee]=t.useState(!1),[Ce,ye]=t.useState(Y||""),[be,Ne]=t.useState(D&&Boolean(null==D?void 0:D.length)?null==(i=D.find((({value:e})=>e===Y)))?void 0:i.label:""),[Se,Le]=t.useState((null==(n=null==G?void 0:G.search)?void 0:n.limit)||10),[$e,ke]=t.useState(null),[Ae,Ie]=t.useState({...X?{}:{"variants.inventory_quantity":"> 0"}}),[Te,Pe]=t.useState(!1),[We,Be]=t.useState([]),[Oe,Fe]=t.useState(0),[Me,Ve]=t.useState(1),[De,He]=t.useState(0),[qe,ze]=t.useState(0),[Ze,Je]=t.useState([]),[Ue,Ge]=t.useState([]),[Ke,Ye]=t.useState(!1),[Xe,Qe]=t.useState(null),et=T({keyword:O,clickedLimitId:Se,clickedFacets:Ae}),{color:tt,font_size:st,font_weight:it,text_transform:nt}=(null==(l=null==G?void 0:G.filter)?void 0:l.title)||{},{color:lt,font_size:rt,font_weight:ot,text_transform:dt}=(null==(r=null==G?void 0:G.filter)?void 0:r.option)||{},{text_color:at,border_color:ut,border_radius:ct,padding_top:xt,padding_bottom:pt,padding_left:mt,padding_right:ht,background_color:gt,font_size:jt,font_weight:vt,text_transform:_t}=(null==(o=null==G?void 0:G.filter)?void 0:o.button)||{},wt={...tt&&{color:tt},...st&&{fontSize:st},...it&&{fontWeight:it},...nt&&{textTransform:nt}},ft={...lt&&{color:lt},...rt&&{fontSize:rt},...ot&&{fontWeight:ot},...dt&&{textTransform:dt}},Rt=e=>{var t;const s=new URLSearchParams(document.location.search),i=Object.fromEntries(s);let n={};for(const r in i){(null==Z?void 0:Z.length)&&!Z.includes(r)&&(n[r]=i[r])}for(const r in e)(null==(t=e[r])?void 0:t.length)&&(n[r]=e[r]);const l=new URLSearchParams({...n}).toString();window.history.pushState(null,"",`${document.location.pathname}${(null==l?void 0:l.length)?`?${l}`:""}`)},Et=e=>{ke(e===$e?"":e)},Ct=()=>{Ye(!0),Ie({}),Pe(!Te),Rt({}),Je([]),setTimeout((()=>{Ye(!1)}),10)},yt=(e,t,s=!1)=>{var i;Ye(!0);let n=[t],l=["variants.price"].includes(e);Ae&&(s?n=[t]:(null==(i=Ae[e])?void 0:i.includes(t))?n=Ae[e].filter((e=>e!==t)):l?(Ae[e],Ae[e]===t?(n=[],Je([])):n=t):n=Ae[e]?[...Ae[e],t]:[t]);let r={...Ae,[e]:n};Rt(r),Ie(r),Pe(!Te),setTimeout((()=>{Ye(!1)}),10)},bt=async(t=!1,s=!1)=>{if(!F)return;t&&Ve(1),_e(!0);let i,n=(e=>{const t=new URLSearchParams(document.location.search),s=Object.fromEntries(t);for(const i in s)(null==Z?void 0:Z.length)&&Z.includes(i)&&(e[i]=s[i].split(","));return Object.keys(e).length&&Ie(e),e})(Ae),l=Object.entries(n).map((e=>{var t,s;if((null==e?void 0:e.length)&&e[1].length){let i=e[0],n=["variants.inventory_quantity"].includes(i),l=["variants.price"].includes(i),r=["tags"].includes(i);return Array.isArray(e[1])&&(null==(t=e[1])?void 0:t.length)>1?l?`${i} >= ${e[1][0]} AND ${i} <= ${e[1][1]}`:r?`${i} IN [${e[1]}]`:null==(s=e[1])?void 0:s.map((e=>n?`${i} ${e}`:`${i} = '${e}'`)).join(" OR "):n?`${i} ${e[1]}`:r?`${i} IN [${e[1]}]`:`${i} = '${e[1]}'`}return null})).filter((e=>e));(null==U?void 0:U.length)&&l.push(`tags NOT IN [${U}]`),he&&l.push(`collections.id = '${he}'`);let r={q:O,sort:Ce?[Ce]:[],page:t?1:Me,hitsPerPage:Se,facets:Z,filter:l.join(" AND ")};i=await V(F,r),((t,s)=>{var i;if(!t)return;const{hits:n,processingTimeMs:l,totalHits:r,totalPages:o}=t;s&&(null==O?void 0:O.length)&&H({keyword:O,resultCount:r||0}),je(!1),_e(!1),Be(n),Fe(l||0),He(o),ze(r||0),Qe(e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-data-summary-item",children:(null==(i=null==G?void 0:G.filter)?void 0:i.show_total_products)?e.jsxRuntimeExports.jsxs("span",{className:"sledge-instant-search__result-data-summary-text",children:[r," result"," ",(null==O?void 0:O.length)?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:["for ",e.jsxRuntimeExports.jsxs("span",{className:"sledge-instant-search__result-data-summary-text-keyword",children:['"',O,'"']})]}):null]}):null}))})(i,s)},Nt=e=>{const t=new URLSearchParams(document.location.search);t.set(me,e),ie&&ie(e),window.history.pushState(null,"",`${document.location.pathname}?${t.toString()}`)};t.useEffect((()=>{let e=Boolean(et&&((null==et?void 0:et.keyword)!==O||(null==et?void 0:et.clickedLimitId)!==Se||(null==et?void 0:et.clickedFacets)!==Ae));if(Boolean(et&&(null==et?void 0:et.keyword)!==O)){const e=setTimeout((()=>{bt(!0,!0)}),500);return()=>clearTimeout(e)}bt(e)}),[Ce,Se,Te,O,Me,F]),t.useEffect((()=>{(()=>{var e,t;if(!(null==(e=null==G?void 0:G.filter)?void 0:e.enable_on_search)||(null==(t=null==G?void 0:G.filter)?void 0:t.hide_when_one_value)&&qe<=1)return;let s=!1;s||null==q||q.map((e=>{const{collections:t,items:i}=e;(he&&(null==t?void 0:t.includes(Number(he)))||(null==t?void 0:t.includes("all")))&&(s=!0,Ge(i))}))})()}),[q,J,qe]);const St=({label:t,name:s,value:i,index:n})=>{var l;let r=i;return["variants.price"].includes(s)&&(r=null==i?void 0:i.join(" - ")),e.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-filter-item-refine-selected",style:ft,children:[e.jsxRuntimeExports.jsxs("span",{className:"sledge-instant-search__result-filter-item-title-refine-list",children:[t,": ",null==(l=String(r))?void 0:l.replaceAll("_"," ")]}),e.jsxRuntimeExports.jsx("span",{className:"sledge-instant-search__result-filter-item-refine-title-clear",onClick:()=>yt(s,i),children:e.jsxRuntimeExports.jsx("svg",{width:12,height:12,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsxRuntimeExports.jsx("path",{d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})})]},n)},Lt=t=>{var s,i;const{value:n,label:l,display:r}=t;let o=null,d=J[n],a=null==(s=null==G?void 0:G.filter)?void 0:s.show_number_matching_product;return"slider"===r.toLowerCase()?o=e.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-filter-item-list-slider",children:[e.jsxRuntimeExports.jsx(j,{defaultValue:[Ze[0]||(null==d?void 0:d.min),Ze[1]||(null==d?void 0:d.max)],min:null==d?void 0:d.min,max:null==d?void 0:d.max,step:1,setValueCommit:e=>yt(n,e),setValueChange:e=>Je(e)}),e.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-filter-item-list-slider-minmax",children:[e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-filter-minmax-field",children:Ze[0]||(null==d?void 0:d.min)}),e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-filter-minmax-field",children:Ze[1]||(null==d?void 0:d.max)})]})]}):"checkbox"===r.toLowerCase()&&(null==d?void 0:d.length)?o=e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:null==d?void 0:d.map(((t,s)=>{var i;return e.jsxRuntimeExports.jsx("li",{children:e.jsxRuntimeExports.jsx(g,{id:`${n}_${s}`,name:n,value:t.value,label:`${t.name}${void 0!==t.total&&a?` (${t.total})`:""}`,onClick:e=>yt(n,e.currentTarget.value),defaultChecked:Ae&&(null==(i=Ae[n])?void 0:i.includes(t.value)),labelStyle:ft})},s)}))}):"radio"===r.toLowerCase()&&(null==d?void 0:d.length)?o=e.jsxRuntimeExports.jsx("li",{children:e.jsxRuntimeExports.jsx(_,{id:n,name:n,onValueChange:e=>yt(n,e,!0),items:null==d?void 0:d.map((e=>{const{name:t,value:s,total:i}=e;return{label:`${t} ${void 0!==i&&a?` (${i})`:""}`,value:s}})),defaultValue:Ae&&(null==(i=Ae[n])?void 0:i.length)?Ae[n][0]:"",labelStyle:ft})}):"select"===r.toLowerCase()&&(null==d?void 0:d.length)?o=e.jsxRuntimeExports.jsx("li",{children:e.jsxRuntimeExports.jsx(f,{placeholder:`Select ${l}`,name:n,onValueChange:e=>yt(n,e,!0),items:null==d?void 0:d.map((e=>{const{name:t,value:s,total:i}=e;return{label:`${t} ${void 0!==i&&a?` (${i})`:""}`,value:s}})),labelStyle:ft})}):"swatch"===r.toLowerCase()&&(null==d?void 0:d.length)&&(o=e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:null==d?void 0:d.map(((t,s)=>{var i;let l=(null==K?void 0:K.filter((({name:e})=>null==e?void 0:e.includes(t.value)))[0])||{};return e.jsxRuntimeExports.jsx("li",{children:e.jsxRuntimeExports.jsx(w,{id:`${n}_${s}`,name:n,value:t.value,rgb:null==l?void 0:l.rgb,image:null==l?void 0:l.image,onClick:e=>yt(n,e.currentTarget.value),defaultChecked:Ae&&(null==(i=Ae[n])?void 0:i.includes(t.value))})},s)}))})),o},$t=Ue.map(((t,s)=>{const{value:i,label:n,display:l}=t;let r=$e===i,o=J[i],d=Boolean("slider"===l.toLowerCase()?o:null==o?void 0:o.length),a=["select"].includes(l.toLowerCase())&&(null==o?void 0:o.length),u=["sledge-instant-search__result-filter-item-list"],c=Lt(t);return"swatch"===l.toLowerCase()&&(null==o?void 0:o.length)&&u.push("sledge-instant-search__result-filter-item-color-swatches"),d?e.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-filter-item",children:[e.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-filter-item-title",onClick:()=>Et(i),children:[e.jsxRuntimeExports.jsx("span",{className:"sledge-instant-search__result-filter-title",style:wt,children:n}),e.jsxRuntimeExports.jsx(e.motion.div,{initial:!1,animate:r?"open":"closed",variants:B,children:e.jsxRuntimeExports.jsx(C,{width:15,height:15,color:"#000000"})})]}),r&&e.jsxRuntimeExports.jsx("ul",{className:u.join(" "),children:a?c:Ke?null:c})]},s):null})),kt=Ue.map(((t,s)=>{const{value:i,label:n,display:l}=t;let r=$e===i,o=J[i],d=Boolean("slider"===l.toLowerCase()?o:null==o?void 0:o.length),a=["radio","select"].includes(l.toLowerCase())&&(null==o?void 0:o.length),u=["sledge-instant-search__result-filter-item-list"],c=Lt(t);return"swatch"===l.toLowerCase()&&(null==o?void 0:o.length)&&u.push("sledge-instant-search__result-filter-item-color-swatches"),d?e.jsxRuntimeExports.jsx("div",{className:"",children:e.jsxRuntimeExports.jsx(m,{trigger:e.jsxRuntimeExports.jsxs(L,{type:"button",onClick:()=>Et(i),children:[n,e.jsxRuntimeExports.jsx(e.motion.div,{initial:"closed",animate:r?"open":"closed",variants:B,className:"sort-trigger-icon",children:e.jsxRuntimeExports.jsx(C,{width:20,height:20,color:"#000000"})})]}),content:e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-filter-horizontal-facet",children:r&&e.jsxRuntimeExports.jsx("ul",{className:u.join(" "),children:a?c:Ke?null:c})}),withOpenState:!1,setIsOpen:e=>ke(e?i:""),hideCloseIcon:!0,align:"center",className:"sledge-instant-search__filter-horizontal-facet-content",customArrow:'<svg style="transform: rotate(180deg); margin-bottom: 3px; stroke-dasharray: 0,0,36;" width="44" height="12" viewBox="0 0 44 12" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M23.2222 1.99825e-06C23.2222 11.9998 4.88979 11.9999 0.000354767 12L23.2222 12L44 12C23.2222 12 23.2222 1.99825e-06 23.2222 1.99825e-06Z" fill="white" stroke="#393d4e" stroke-width="1px" /></svg>'})},s):null}));let At=[];Object.entries(Ae).map((e=>{var t,s;if((null==e?void 0:e.length)&&e[1].length){let i=e[0];if(["variants.inventory_quantity"].includes(i))return;let n=["variants.price"].includes(i),l=Ue.filter((({value:e})=>null==e?void 0:e.includes(i))),r=(null==l?void 0:l.length)?l[0].label:i;return Array.isArray(e[1])&&(null==(t=e[1])?void 0:t.length)>1?n?At.push({label:r,name:i,value:e[1]}):null==(s=e[1])?void 0:s.map((e=>{At.push({label:r,name:i,value:e})})):At.push({label:r,name:i,value:e[1][0]})}}));const It=e.jsxRuntimeExports.jsx(v,{currentPage:Me,totalPage:De,totalResult:qe,onChange:e=>(e=>{Ve(e),setTimeout((()=>{p(pe.current,50)}),200)})(e)});return e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[(null==(d=null==G?void 0:G.filter)?void 0:d.enable_on_search)&&"horizontal"===(null==(a=null==G?void 0:G.filter)?void 0:a.layout)?e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:ge?ne:e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:M?e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-filter-horizontal-loading",children:ne}):kt.every((e=>!e))?null:e.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-filter-horizontal-wrapper",children:[e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-filter-horizontal",children:kt}),Boolean((null==At?void 0:At.length)&&(null==(u=null==G?void 0:G.filter)?void 0:u.show_refine_by_block))?e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:Boolean(At.every((e=>!e)))?null:e.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-filter-horizontal",children:[e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-filter-horizontal-refine-item sledge-instant-search__result-filter-horizontal-refine-item-clear-all",onClick:Ct,children:"Clear All"}),At.map(((e,t)=>{const{label:s,name:i,value:n}=e;return St({label:s,name:i,value:n,index:t})}))]})}):null]})})}):null,e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-wrapper","data-filter-layout":null==(c=null==G?void 0:G.filter)?void 0:c.layout,children:e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[(null==(x=null==G?void 0:G.filter)?void 0:x.enable_on_search)&&"vertical"===(null==(h=null==G?void 0:G.filter)?void 0:h.layout)?ge?e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-filter",children:re}):$t.every((e=>!e))?null:e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-filter",children:M?re:e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[Boolean((null==At?void 0:At.length)&&(null==(R=null==G?void 0:G.filter)?void 0:R.show_refine_by_block))?Boolean(At.every((e=>!e)))?null:e.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-filter-item",children:[e.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-filter-item-title-refine",children:[e.jsxRuntimeExports.jsx("strong",{className:"sledge-instant-search__result-filter-item-title-refine-heading",children:"Filter"}),e.jsxRuntimeExports.jsx("span",{className:"sledge-instant-search__result-filter-item-title-refine-clear",onClick:Ct,children:"Clear All"})]}),e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-filter-item-refine-selected-flex",children:At.map(((e,t)=>{const{label:s,name:i,value:n}=e;return St({label:s,name:i,value:n,index:t})}))})]}):null,$t]})}):null,e.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-data",children:[ge?de:e.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-data-keyword",children:["horizontal"===(null==(E=null==G?void 0:G.filter)?void 0:E.layout)&&e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-data-summary sledge-instant-search__result-data-summary-filter-horizontal",children:Xe}),e.jsxRuntimeExports.jsx($,{type:"text",icon:e.jsxRuntimeExports.jsx(S,{width:18,height:18,color:"#868686"}),placeholder:"Search products...",value:O,onChange:({value:e})=>Nt(e),onResetField:()=>Nt(""),className:"sledge-instant-search__result-data-keyword-form",withClearField:!0}),e.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-data-summary-item sledge-instant-search__result-data-summary-select-field",children:[e.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-data-summary-select-field-item",children:[e.jsxRuntimeExports.jsx("span",{children:"Sort by:"}),D&&Boolean(null==D?void 0:D.length)&&e.jsxRuntimeExports.jsx(k,{align:"end",prefixLabel:e.jsxRuntimeExports.jsx("svg",{width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsxRuntimeExports.jsx("path",{d:"M12.6296 4.34737C12.9144 4.34737 13.1497 4.55898 13.1869 4.83354L13.1921 4.90987L13.192 13.7599L15.2892 11.6543C15.5083 11.4341 15.8645 11.4333 16.0847 11.6525C16.2848 11.8517 16.3037 12.1641 16.1408 12.3847L16.0865 12.4479L13.0282 15.5204C13.0097 15.5386 12.991 15.555 12.9712 15.5701L13.0282 15.5204C13.0006 15.5482 12.9708 15.5724 12.9394 15.5932C12.9285 15.6 12.9171 15.607 12.9055 15.6135C12.8946 15.62 12.8837 15.6258 12.8725 15.6311C12.8615 15.6359 12.8504 15.6408 12.8391 15.6454C12.8247 15.6515 12.8099 15.6568 12.795 15.6613C12.7862 15.6637 12.7772 15.6662 12.7681 15.6685C12.7519 15.673 12.7357 15.6763 12.7193 15.6789C12.7116 15.6798 12.7036 15.6809 12.6955 15.6819C12.677 15.6844 12.6587 15.6857 12.6404 15.686C12.6368 15.6857 12.6332 15.6857 12.6296 15.6857L12.6186 15.686C12.6003 15.6857 12.582 15.6844 12.5637 15.6823L12.6296 15.6857C12.5989 15.6857 12.5689 15.6833 12.5396 15.6785C12.5233 15.6763 12.5071 15.673 12.4909 15.6689C12.4824 15.6663 12.4738 15.6639 12.4654 15.6614C12.4493 15.6569 12.4332 15.6512 12.4174 15.6448C12.4088 15.6408 12.4005 15.6372 12.3922 15.6333C12.3793 15.6278 12.3663 15.6211 12.3535 15.6139C12.342 15.6069 12.3307 15.6 12.3196 15.5926C12.3109 15.5875 12.3024 15.5815 12.294 15.5752L12.288 15.5701C12.2682 15.555 12.2494 15.5386 12.2318 15.5209L12.2308 15.5204L9.1725 12.4479C8.95334 12.2278 8.95416 11.8716 9.17434 11.6525C9.3745 11.4532 9.68704 11.4358 9.90687 11.5997L9.96983 11.6543L12.067 13.7614L12.0671 4.90987C12.0671 4.59921 12.3189 4.34737 12.6296 4.34737ZM5.18325 2.3122L5.19421 2.31189C5.21254 2.31224 5.23085 2.31348 5.24908 2.31562L5.18325 2.3122C5.21389 2.3122 5.24396 2.31465 5.27328 2.31937C5.28931 2.32156 5.3054 2.32487 5.32136 2.32889C5.33074 2.33164 5.3403 2.33433 5.34975 2.33725C5.36452 2.34142 5.37882 2.34648 5.39293 2.35213C5.40313 2.35668 5.41346 2.36119 5.42362 2.366C5.4357 2.37123 5.4476 2.37737 5.45931 2.38397C5.46933 2.39014 5.47926 2.39616 5.48898 2.40246C5.49898 2.40841 5.50899 2.41537 5.51882 2.42269L5.582 2.47746L8.64033 5.54996C8.85949 5.77013 8.85867 6.12629 8.63849 6.34545C8.43833 6.54469 8.12579 6.56212 7.90596 6.39822L7.843 6.34361L5.74525 4.23564L5.74575 13.088C5.74575 13.3987 5.49391 13.6505 5.18325 13.6505C4.89848 13.6505 4.66313 13.4389 4.62588 13.1644L4.62075 13.088L4.62025 4.23639L2.52367 6.34361C2.32443 6.54377 2.01197 6.56265 1.79139 6.39977L1.72817 6.34545C1.52801 6.14621 1.50914 5.83376 1.67202 5.61317L1.72633 5.54996L4.78467 2.47746L4.81779 2.44709C4.82557 2.44043 4.83353 2.43399 4.84167 2.42776L4.78467 2.47746C4.81226 2.44974 4.84202 2.42549 4.87341 2.40473C4.88436 2.39791 4.89574 2.39094 4.90738 2.38438C4.91819 2.37787 4.92917 2.37215 4.9403 2.36682C4.95128 2.36196 4.96242 2.35706 4.97375 2.35251C4.98814 2.34636 5.00289 2.34115 5.0178 2.33657C5.02687 2.33414 5.03616 2.33154 5.04555 2.32918C5.06066 2.32503 5.07593 2.32186 5.09129 2.31932C5.10053 2.31817 5.10959 2.31691 5.11871 2.31586C5.13607 2.31348 5.15388 2.31227 5.17171 2.3119C5.17564 2.31224 5.17944 2.3122 5.18325 2.3122Z",fill:"black"})}),options:D.map((e=>{const{label:t,value:s}=e;return{label:t,value:s}})),value:Ce,onChange:({label:e,value:t})=>((e,t)=>{fe(!1),Ne(e),ye(t)})(e,t)})]}),e.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-data-summary-select-field-item",children:[e.jsxRuntimeExports.jsx("span",{children:"Limit:"}),(null==(y=null==G?void 0:G.search)?void 0:y.allowed_limit)&&Boolean(null==(N=null==(b=null==G?void 0:G.search)?void 0:b.allowed_limit)?void 0:N.length)&&e.jsxRuntimeExports.jsx(k,{align:"end",options:G.search.allowed_limit.map((e=>({label:e,value:e}))),value:Se,onChange:({value:e})=>(e=>{Ee(!1),Le(e)})(e)})]})]})]}),ve?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[oe,(null==We?void 0:We.length)?It:null]}):e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:["vertical"===(null==(A=null==G?void 0:G.filter)?void 0:A.layout)&&e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-data-summary sledge-instant-search__result-data-summary-filter-vertical",children:Xe}),(null==We?void 0:We.length)?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(z,{sourceApp:"instant-search",type:"large",data:We.map((e=>{const{variants:t,...s}=e||{};return{product:s,variants:t}})),setting:{show_vendor:null==(I=null==G?void 0:G.search)?void 0:I.show_vendor,show_sku:null==(P=null==G?void 0:G.search)?void 0:P.show_sku,show_price:null==(W=null==G?void 0:G.search)?void 0:W.show_price},isComponentJsVersion:te,cards:se,showOptionOutOfStock:!0,onAfterAddToCart:ae,onAfterAddWishlist:ue,onAfterRemoveWishlist:ce,onAfterRenderProduct:xe}),It]}):e.jsxRuntimeExports.jsx(le,{})]})]})]})})]})},ne=s=>{var i,n,l,r;const{keyword:o,clickedTabIndexId:d,clickedTabIndexName:a,setKeyword:u,searchResultContainerRef:c}=s||{},[x,m]=t.useState(!0),[h,g]=t.useState(!0),[j,_]=t.useState(""),[w,f]=t.useState([]),[R,E]=t.useState(0),[C,y]=t.useState(1),[b,N]=t.useState(0),[L,k]=t.useState(0),[A,I]=t.useState(null),P=T({keyword:o}),W=async()=>{if(!d)return;let t;g(!0);let s={q:o,sort:j?[j]:[],page:C,hitsPerPage:12};t=await V(d,s),(t=>{if(!t)return;const{hits:s,processingTimeMs:i,totalHits:n,totalPages:l}=t;m(!1),g(!1),f(s),E(i||0),N(l),k(n||0),I(e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-data-summary-item",children:e.jsxRuntimeExports.jsxs("span",{className:"sledge-instant-search__result-data-summary-text",children:[n," result"," ",(null==o?void 0:o.length)?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:["for ",e.jsxRuntimeExports.jsxs("span",{className:"sledge-instant-search__result-data-summary-text-keyword",children:['"',o,'"']})]}):null]})}))})(t)};t.useEffect((()=>{if(Boolean(P&&(null==P?void 0:P.keyword)!==o)){const e=setTimeout((()=>{W()}),500);return()=>clearTimeout(e)}W()}),[j,o,C,d]);const B=e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-data-keyword sledge-instant-search__result-data-keyword-category",children:e.jsxRuntimeExports.jsx($,{type:"text",icon:e.jsxRuntimeExports.jsx(S,{width:18,height:18,color:"#868686"}),placeholder:`Search ${a?a.toLowerCase():""}...`,value:o,onChange:({value:e})=>u&&u(e),onResetField:()=>u&&u(""),className:"sledge-instant-search__result-data-keyword-form",withClearField:!0})}),O=e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-data-summary",children:e.jsxRuntimeExports.jsx(X.Item,{width:"117px",height:"28px",color:"grey-100",rounded:"md",animationDuration:"18s"})}),F=(null==(i=String(d))?void 0:i.includes("collection"))?e.jsxRuntimeExports.jsx(X.CollectionGrid,{count:3}):(null==(n=String(d))?void 0:n.includes("page"))?e.jsxRuntimeExports.jsx(X.PageGrid,{count:12}):(null==(l=String(d))?void 0:l.includes("blog"))||(null==(r=String(d))?void 0:r.includes("article"))?e.jsxRuntimeExports.jsx(X.BlogGrid,{count:12}):null,M=()=>e.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-data-category-wrapper",children:[B,O,F]}),D=()=>e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[B,O,F]}),H=t=>{var s,i,n,l;return(null==(s=String(d))?void 0:s.includes("collection"))?e.jsxRuntimeExports.jsx(Z,{...t}):(null==(i=String(d))?void 0:i.includes("page"))?e.jsxRuntimeExports.jsx(J,{...t}):(null==(n=String(d))?void 0:n.includes("blog"))||(null==(l=String(d))?void 0:l.includes("article"))?e.jsxRuntimeExports.jsx(U,{...t}):null};return e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-wrapper",children:x?e.jsxRuntimeExports.jsx(M,{}):e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-data-category-wrapper",children:h?e.jsxRuntimeExports.jsx(D,{}):e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[B,e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-data-summary",children:A}),(null==w?void 0:w.length)?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(H,{data:w.map((e=>{const{id:t,title:s,url:i}=e;return{id:t,title:s,description:`${s}${a?` ${a.toLowerCase()}`:""}`,url:i,image:""}}))}),e.jsxRuntimeExports.jsx(v,{currentPage:C,totalPage:b,totalResult:L,onChange:e=>(e=>{y(e),setTimeout((()=>{p(c.current,50)}),200)})(e)})]}):e.jsxRuntimeExports.jsx(le,{})]})})})},le=s=>{const[i,n]=t.useState(""),[l,r]=t.useState("");return t.useEffect((()=>{n("No results found"),r("Your search did not match any results. <br/> Please try again")}),[]),e.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-empty",children:[e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-empty-title",dangerouslySetInnerHTML:{__html:i}}),e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-empty-description",dangerouslySetInnerHTML:{__html:l}})]})};exports.ProductFilterWidget=t=>e.jsxRuntimeExports.jsx(se,{layoutType:"product-filter",...t}),exports.SearchIconWidget=i=>{const{isRenderApp:n,isJsVersion:l}=t.useContext(s.SledgeContext),{size:r="sm",children:o,onAfterAddToCart:d,onAfterAddWishlist:a,onAfterRemoveWishlist:u,onAfterRenderProduct:c}=i||{};let p=null,m=null,h=null,g=null;t.Children.map(o,(e=>{if(t.isValidElement(e)&&x(e.type)){const{productCard:t,suggestionKeywordList:s,otherIndexList:i,searchViewMoreResult:n}=(null==e?void 0:e.props)||{};t&&x(t)&&(p=t),s&&x(s)&&(m=s),i&&x(i)&&(h=i),n&&x(n)&&(g=n)}}));const[j,v]=t.useState({width:0,height:0});t.useEffect((()=>{(null==n?void 0:n.instantSearch)&&v("xs"===r?{width:14,height:14}:"sm"===r?{width:20,height:20}:{width:25,height:25})}),[n]);return e.jsxRuntimeExports.jsx("span",{className:"sledge-instant-search__icon-widget",onClick:()=>{"undefined"!=typeof window&&window.sledgeInstantSearchIconWidgetPopup&&window.sledgeInstantSearchIconWidgetPopup({onAfterAddToCart:d,onAfterAddWishlist:a,onAfterRemoveWishlist:u,onAfterRenderProduct:c,isJsVersion:l,productCardsComponent:p,suggestionKeywordListsComponent:m,otherIndexListsComponent:h,searchViewMoreResultComponent:g})},children:e.jsxRuntimeExports.jsx(S,{...j,color:"currentColor"})})},exports.SearchIconWidgetPopup=()=>{var s,i,n,l,r,o,a,u,c,x,p,m,h,g,j,v,_,w,f,R,E,C;const[y,b]=t.useState(!0),[N,L]=t.useState(!1),[k,A]=t.useState(""),[I,P]=t.useState(""),[W,B]=t.useState([]),[O,F]=t.useState([]),[M,V]=t.useState([]),[q,Z]=t.useState([]),[J,U]=t.useState({}),[G,Y]=t.useState({}),[se,ie]=t.useState(""),[ne,le]=t.useState({onAfterAddToCart:e=>{},onAfterAddWishlist:e=>{},onAfterRemoveWishlist:e=>{},onAfterRenderProduct:e=>{},isJsVersion:null,productCardsComponent:null,suggestionKeywordListsComponent:null,otherIndexListsComponent:null,searchViewMoreResultComponent:null}),re=t.useRef(null),oe=T({keyword:k}),de=async(e,t=!1)=>{var s,i,n,l,r,o,d,a,u,c,x;if(!N)return;b(!0);const{tabs:p,suffix_index_product:m,hidden_tags:h,display:g}=e,j=(null==(s=null==g?void 0:g.search)?void 0:s.suggestion)||{};let v,_={queries:p.map((e=>{var t;const{index:s}=e;let i=s.includes(m),n=[];return(null==h?void 0:h.length)&&n.push(`tags NOT IN [${h}]`),(null==(t=null==g?void 0:g.filter)?void 0:t.show_out_of_stock)||n.push("variants.inventory_quantity > 0"),{indexUid:s,q:k,hitsPerPage:i?6:4,filter:i?n.join(" AND "):""}}))};if(v=await D(_),!v)return;const{results:w}=v;let f=null==w?void 0:w.filter((({indexUid:e})=>null==e?void 0:e.includes(m)));t&&(null==k?void 0:k.length)&&H({keyword:k,resultCount:(null==(i=f[0])?void 0:i.totalHits)||0});let R=(null==(n=null==w?void 0:w.filter((({indexUid:e})=>!(null==e?void 0:e.includes(m)))))?void 0:n.map((e=>{const{indexUid:t}=e,{name:s}=null==p?void 0:p.find((({index:e})=>e.includes(t)));return{...e,name:s||""}})))||[],E=(null==f?void 0:f.length)?null==(l=f[0])?void 0:l.hits:[],C=k.length?(null==E?void 0:E.length)?"":"no_result":"zero_character",y=Boolean(!k.length&&Object.keys(j).length&&(null==(o=null==(r=j[C])?void 0:r.products)?void 0:o.active)&&(null==(u=null==(a=null==(d=j[C])?void 0:d.products)?void 0:a.list)?void 0:u.length));B(y?null==(x=null==(c=j[C])?void 0:c.products)?void 0:x.list:E),F(R),ie(C),b(!1)};return t.useEffect((()=>{"undefined"!=typeof window&&(window.sledgeInstantSearchIconWidgetPopup=({onAfterAddToCart:e=(()=>{}),onAfterAddWishlist:t=(()=>{}),onAfterRemoveWishlist:s=(()=>{}),onAfterRenderProduct:i=(()=>{}),isJsVersion:n=null,productCardsComponent:l=(()=>{}),suggestionKeywordListsComponent:r=(()=>{}),otherIndexListsComponent:o=(()=>{}),searchViewMoreResultComponent:d=(()=>{})})=>{L(!0),le({onAfterAddToCart:e,onAfterAddWishlist:t,onAfterRemoveWishlist:s,onAfterRenderProduct:i,isJsVersion:n,productCardsComponent:l,suggestionKeywordListsComponent:r,otherIndexListsComponent:o,searchViewMoreResultComponent:d}),setTimeout((()=>{(null==re?void 0:re.current)&&(re.current.focus(),re.current.value=k)}),500)}),(async e=>{var t;if(!N)return;let s,i=!1;if(s=JSON.parse(e),!s)return;const{status:n,data:l}=s,{code:r}=n,{tabs:o,suffix_index_product:d,hidden_tags:a,display:u}=l;i=200===r||!1,i&&(V(o),P(d),Z(a),U(u),Y(null==(t=null==u?void 0:u.search)?void 0:t.suggestion),await de(l))})(localStorage.getItem(d)||"")}),[N]),t.useEffect((()=>{if(Boolean(oe&&(null==oe?void 0:oe.keyword)!==k)){const e=setTimeout((()=>{de({tabs:M,suffix_index_product:I,hidden_tags:q,display:J},!0)}),500);return()=>clearTimeout(e)}}),[k]),e.jsxRuntimeExports.jsx(e.$5d3850c4d0b4e6c7$export$be92b6f5f03c0fe9,{open:N,onOpenChange:L,children:e.jsxRuntimeExports.jsxs(e.$5d3850c4d0b4e6c7$export$602eac185826482c,{children:[e.jsxRuntimeExports.jsx(e.$5d3850c4d0b4e6c7$export$c6fdb837b070b4ff,{className:"sledge__popup-overlay"}),e.jsxRuntimeExports.jsx(e.$5d3850c4d0b4e6c7$export$c6fdb837b070b4ff,{className:"sledge__popup-overlay-blur"}),e.jsxRuntimeExports.jsxs(e.$5d3850c4d0b4e6c7$export$7c6e2c02157bb7d2,{className:"sledge-instant-search__icon-widget-popup-detail-content","data-layout-type":(null==(s=null==J?void 0:J.search)?void 0:s.layout)||"",children:[e.jsxRuntimeExports.jsx($,{type:"text",icon:e.jsxRuntimeExports.jsx(S,{width:20,height:20,color:"#000000"}),placeholder:"Search anything...",value:k,fieldRef:re,onChange:({value:e})=>A(e),className:"sledge-instant-search__icon-widget-search-form-field",withClearField:!0}),e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__icon-widget-search-form-result",children:y?e.jsxRuntimeExports.jsx(K,{children:e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__icon-widget-search-form-result-wrapper",children:e.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__icon-widget-search-form-result-flex",children:[e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__icon-widget-search-form-result-flex-item-other sledge-instant-search__icon-widget-search-form-result-flex-item-other-skeleton",children:[0,1,2].map((s=>e.jsxRuntimeExports.jsxs(t.Fragment,{children:[e.jsxRuntimeExports.jsx(X.Item,{width:"100%",height:"42px",color:"grey-100",rounded:"md",...Boolean(s)&&{style:{marginTop:"12px"}}}),e.jsxRuntimeExports.jsx("div",{style:{display:"flex",flexDirection:"column",justifyContent:"center",gap:"12px",marginTop:"12px"},children:[1,2,3].map((t=>e.jsxRuntimeExports.jsx(X.Item,{width:"100%",height:"28px",color:"grey-100",rounded:"md",animationDuration:"13s",style:{maxWidth:"140px"}},t)))})]},s)))}),e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__icon-widget-search-form-result-flex-item-product",children:e.jsxRuntimeExports.jsx(X.ProductGrid,{count:6,type:"medium"})})]})})}):e.jsxRuntimeExports.jsx(K,{children:e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__icon-widget-search-form-result-wrapper",children:e.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__icon-widget-search-form-result-flex",children:[e.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__icon-widget-search-form-result-flex-item-other",children:[Object.keys(G).length&&(null==(n=null==(i=G[se])?void 0:i.keywords)?void 0:n.active)&&(null==(o=null==(r=null==(l=G[se])?void 0:l.keywords)?void 0:r.list)?void 0:o.length)?e.jsxRuntimeExports.jsx(ee,{listsComponent:ne.suggestionKeywordListsComponent,keywords:G[se].keywords.list,isComponentJsVersion:ne.isJsVersion,showPopupComponent:N,setShowPopupComponent:L}):null,O&&O.map(((s,i)=>{const{hits:n,name:l}=s;return e.jsxRuntimeExports.jsx(t.Fragment,{children:e.jsxRuntimeExports.jsx(Q,{listsComponent:ne.otherIndexListsComponent,name:l,items:n,isComponentJsVersion:ne.isJsVersion,showPopupComponent:N,setShowPopupComponent:L})},i)}))]}),e.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__icon-widget-search-form-result-flex-item-product",children:[(null==W?void 0:W.length)?e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__icon-widget-search-form-result-product",children:e.jsxRuntimeExports.jsx(z,{sourceApp:"instant-search",type:"medium",data:W.map((e=>{const{variants:t,...s}=e||{};return{product:s,variants:t}})),setting:{show_vendor:null==(a=null==J?void 0:J.search)?void 0:a.show_vendor,show_sku:null==(u=null==J?void 0:J.search)?void 0:u.show_sku,show_price:null==(c=null==J?void 0:J.search)?void 0:c.show_price},showOptionOutOfStock:!0,isComponentJsVersion:ne.isJsVersion,cards:ne.productCardsComponent,onAfterAddToCart:ne.onAfterAddToCart,onAfterAddWishlist:ne.onAfterAddWishlist,onAfterRemoveWishlist:ne.onAfterRemoveWishlist,onAfterRenderProduct:ne.onAfterRenderProduct,showPopupComponent:N,setShowPopupComponent:L})}):Object.keys(G).length&&(null==(p=null==(x=G[se])?void 0:x.products)?void 0:p.active)&&(null==(g=null==(h=null==(m=G[se])?void 0:m.products)?void 0:h.list)?void 0:g.length)?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__icon-widget-search-form-result-product-suggestion-no-result-text",children:[e.jsxRuntimeExports.jsx("span",{children:"Sorry"}),", nothing found for ",e.jsxRuntimeExports.jsx("span",{children:k}),". Did you mean:"]}),e.jsxRuntimeExports.jsx(z,{sourceApp:"instant-search",type:"medium",data:G[se].products.list.map((e=>{const{variants:t,...s}=e||{};return{product:s,variants:t}})),setting:{show_vendor:null==(j=null==J?void 0:J.search)?void 0:j.show_vendor,show_sku:null==(v=null==J?void 0:J.search)?void 0:v.show_sku,show_price:null==(_=null==J?void 0:J.search)?void 0:_.show_price},showOptionOutOfStock:!0,isComponentJsVersion:ne.isJsVersion,cards:ne.productCardsComponent,onAfterAddToCart:ne.onAfterAddToCart,onAfterAddWishlist:ne.onAfterAddWishlist,onAfterRemoveWishlist:ne.onAfterRemoveWishlist,onAfterRenderProduct:ne.onAfterRenderProduct,showPopupComponent:N,setShowPopupComponent:L})]}):e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__icon-widget-search-form-result-title",children:"Products"}),e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__icon-widget-search-form-result-item-disabled",children:"No product were found"})]}),(null==W?void 0:W.length)||Object.keys(G).length&&(null==(f=null==(w=G[se])?void 0:w.products)?void 0:f.active)&&(null==(C=null==(E=null==(R=G[se])?void 0:R.products)?void 0:E.list)?void 0:C.length)?e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__icon-widget-button-more-wrapper",children:e.jsxRuntimeExports.jsx(te,{component:ne.searchViewMoreResultComponent,keyword:k,isComponentJsVersion:ne.isJsVersion,showPopupComponent:N,setShowPopupComponent:L})}):null]})]})})})})]})]})})},exports.SearchResultWidget=se,exports.SearchWidget=i=>{var n,l,r,o,a,u,c,p,m,h,g,j,v,_,w,f,R,E,C,y,b;const{isRenderApp:N,isJsVersion:L}=t.useContext(s.SledgeContext),{width:k="400px",children:A,onAfterAddToCart:I,onAfterAddWishlist:P,onAfterRemoveWishlist:W,onAfterRenderProduct:B}=i;let F=null,M=null,V=null,q=null;t.Children.map(A,(e=>{if(t.isValidElement(e)&&x(e.type)){const{productCard:t,suggestionKeywordList:s,otherIndexList:i,searchViewMoreResult:n}=(null==e?void 0:e.props)||{};t&&x(t)&&(F=t),s&&x(s)&&(M=s),i&&x(i)&&(V=i),n&&x(n)&&(q=n)}}));const[Z,J]=t.useState(!0),[U,G]=t.useState(""),[Y,se]=t.useState(""),[ie,ne]=t.useState([]),[le,re]=t.useState([]),[oe,de]=t.useState([]),[ae,ue]=t.useState([]),[ce,xe]=t.useState({}),[pe,me]=t.useState({}),[he,ge]=t.useState(""),je=T({keyword:U}),ve=async(e,t=!1)=>{var s,i,n,l,r,o,d,a,u,c,x;if(!U.length)return;J(!0);const{tabs:p,suffix_index_product:m,hidden_tags:h,display:g}=e,j=(null==(s=null==g?void 0:g.search)?void 0:s.suggestion)||{};let v,_={queries:p.map((e=>{var t;const{index:s}=e;let i=s.includes(m),n=[];return(null==h?void 0:h.length)&&n.push(`tags NOT IN [${h}]`),(null==(t=null==g?void 0:g.filter)?void 0:t.show_out_of_stock)||n.push("variants.inventory_quantity > 0"),{indexUid:s,q:U,hitsPerPage:i?6:4,filter:i?n.join(" AND "):""}}))};if(v=await D(_),!v)return;const{results:w}=v;let f=null==w?void 0:w.filter((({indexUid:e})=>null==e?void 0:e.includes(m)));t&&(null==U?void 0:U.length)&&H({keyword:U,resultCount:(null==(i=f[0])?void 0:i.totalHits)||0});let R=(null==(n=null==w?void 0:w.filter((({indexUid:e})=>!(null==e?void 0:e.includes(m)))))?void 0:n.map((e=>{const{indexUid:t}=e,{name:s}=null==p?void 0:p.find((({index:e})=>e.includes(t)));return{...e,name:s||""}})))||[],E=(null==f?void 0:f.length)?null==(l=f[0])?void 0:l.hits:[],C=U.length?(null==E?void 0:E.length)?"":"no_result":"zero_character",y=Boolean(!U.length&&Object.keys(j).length&&(null==(o=null==(r=j[C])?void 0:r.products)?void 0:o.active)&&(null==(u=null==(a=null==(d=j[C])?void 0:d.products)?void 0:a.list)?void 0:u.length));ne(y?null==(x=null==(c=j[C])?void 0:c.products)?void 0:x.list:E),re(R),ge(C),J(!1)};t.useEffect((()=>{(null==N?void 0:N.instantSearch)&&(async e=>{var t;if(!U.length)return;let s,i=!1;if(s=JSON.parse(e),!s)return;const{status:n,data:l}=s,{code:r}=n,{tabs:o,suffix_index_product:d,hidden_tags:a,display:u}=l;i=200===r||!1,i&&(de(o),se(d),ue(a),xe(u),me(null==(t=null==u?void 0:u.search)?void 0:t.suggestion),await ve(l))})(localStorage.getItem(d)||"")}),[U]),t.useEffect((()=>{if(Boolean(je&&(null==je?void 0:je.keyword)!==U)){const e=setTimeout((()=>{ve({tabs:oe,suffix_index_product:Y,hidden_tags:ae,display:ce},!0)}),500);return()=>clearTimeout(e)}}),[U]);const _e={maxWidth:k};return e.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__widget-search-form-wrapper",style:_e,children:[e.jsxRuntimeExports.jsx($,{type:"text",icon:e.jsxRuntimeExports.jsx(S,{width:18,height:18,color:"#868686"}),placeholder:"Search anything",value:U,onChange:({value:e})=>G(e),onResetField:()=>G(""),withClearField:!0}),e.jsxRuntimeExports.jsx(e.motion.div,{initial:"hidden",animate:U.length?"visible":"hidden",variants:O,className:"sledge-instant-search__widget-search-form-result",children:Z?e.jsxRuntimeExports.jsx(K,{children:e.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__widget-search-form-result-flex",children:[e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__widget-search-form-result-flex-item-other sledge-instant-search__widget-search-form-result-flex-item-other-skeleton",children:[0,1,2].map((s=>e.jsxRuntimeExports.jsxs(t.Fragment,{children:[e.jsxRuntimeExports.jsx(X.Item,{width:"100%",height:"42px",color:"grey-100",rounded:"md",...Boolean(s)&&{style:{marginTop:"12px"}}}),e.jsxRuntimeExports.jsx("div",{style:{display:"flex",flexDirection:"column",justifyContent:"center",gap:"12px",marginTop:"12px"},children:[1,2,3].map((t=>e.jsxRuntimeExports.jsx(X.Item,{width:"100%",height:"28px",color:"grey-100",rounded:"md",animationDuration:"13s",style:{maxWidth:"140px"}},t)))})]},s)))}),e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__widget-search-form-result-flex-item-product",children:e.jsxRuntimeExports.jsx(X.ProductGrid,{count:6,type:"small"})})]})}):e.jsxRuntimeExports.jsx(K,{isLoading:Z,withCorner:!1,children:e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__widget-search-form-result-flex",children:[e.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__widget-search-form-result-flex-item-other",children:[Object.keys(pe).length&&(null==(l=null==(n=pe[he])?void 0:n.keywords)?void 0:l.active)&&(null==(a=null==(o=null==(r=pe[he])?void 0:r.keywords)?void 0:o.list)?void 0:a.length)?e.jsxRuntimeExports.jsx(ee,{listsComponent:M,keywords:pe[he].keywords.list,isComponentJsVersion:L}):null,le.map(((s,i)=>{const{hits:n,name:l}=s;return e.jsxRuntimeExports.jsx(t.Fragment,{children:e.jsxRuntimeExports.jsx(Q,{listsComponent:V,name:l,items:n,isComponentJsVersion:L})},i)}))]}),e.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__widget-search-form-result-flex-item-product",children:[e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__widget-search-form-result-title-product",children:"Products"}),(null==ie?void 0:ie.length)?e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__widget-search-form-result-product",children:e.jsxRuntimeExports.jsx(z,{sourceApp:"instant-search",type:"small",data:ie.map((e=>{const{variants:t,...s}=e||{};return{product:s,variants:t}})),setting:{show_vendor:null==(u=null==ce?void 0:ce.search)?void 0:u.show_vendor,show_sku:null==(c=null==ce?void 0:ce.search)?void 0:c.show_sku,show_price:null==(p=null==ce?void 0:ce.search)?void 0:p.show_price},showOptionOutOfStock:!0,isComponentJsVersion:L,cards:F,onAfterAddToCart:I,onAfterAddWishlist:P,onAfterRemoveWishlist:W,onAfterRenderProduct:B})}):Object.keys(pe).length&&(null==(h=null==(m=pe[he])?void 0:m.products)?void 0:h.active)&&(null==(v=null==(j=null==(g=pe[he])?void 0:g.products)?void 0:j.list)?void 0:v.length)?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__widget-search-form-result-product-suggestion-no-result-text",children:[e.jsxRuntimeExports.jsx("span",{children:"Sorry, nothing found for"})," ",e.jsxRuntimeExports.jsx("strong",{children:U}),". ",e.jsxRuntimeExports.jsx("span",{children:"Did you mean:"})]}),e.jsxRuntimeExports.jsx(z,{sourceApp:"instant-search",type:"small",data:pe[he].products.list.map((e=>{const{variants:t,...s}=e||{};return{product:s,variants:t}})),setting:{show_vendor:null==(_=null==ce?void 0:ce.search)?void 0:_.show_vendor,show_sku:null==(w=null==ce?void 0:ce.search)?void 0:w.show_sku,show_price:null==(f=null==ce?void 0:ce.search)?void 0:f.show_price},showOptionOutOfStock:!0,isComponentJsVersion:L,cards:F,onAfterAddToCart:I,onAfterAddWishlist:P,onAfterRemoveWishlist:W,onAfterRenderProduct:B})]}):e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__widget-search-form-result-product-disabled",children:"No product were found"})]})]}),(null==ie?void 0:ie.length)||Object.keys(pe).length&&(null==(E=null==(R=pe[he])?void 0:R.products)?void 0:E.active)&&(null==(b=null==(y=null==(C=pe[he])?void 0:C.products)?void 0:y.list)?void 0:b.length)?e.jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__widget-button-more-wrapper",children:e.jsxRuntimeExports.jsx(te,{component:q,keyword:U,isComponentJsVersion:L})}):null]})})})]})};
|
|
2
2
|
//# sourceMappingURL=sledge-react-instant-search.cjs.map
|