PageSourceSearch

https://store.padi.com/_next/static/chunks/5405.d4157b9e9c4af6d3.js

js padi.com collected 2026-09-24 08:38:31 UTC 6,876 bytes, 2 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5405],{54052:(e,t,r)=>{var a=0/0,l=/^\s+|\s+$/g,n=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,s=/^0o[0-7]+$/i,o=parseInt,c="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,u="object"==typeof self&&self&&self.Object===Object&&self,d=c||u||Function("return this")(),v=Object.prototype.toString,f=Math.max,m=Math.min,p=function(){return d.Date.now()};function h(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function b(e){if("number"==typeof e)return e;if("symbol"==typeof(t=e)||t&&"object"==typeof t&&"[object Symbol]"==v.call(t))return a;if(h(e)){var t,r="function"==typeof e.valueOf?e.valueOf():e;e=h(r)?r+"":r}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(l,"");var c=i.test(e);return c||s.test(e)?o(e.slice(2),c?2:8):n.test(e)?a:+e}e.exports=function(e,t,r){var a,l,n,i,s,o,c=0,u=!1,d=!1,v=!0;if("function"!=typeof e)throw TypeError("Expected a function");function x(t){var r=a,n=l;return a=l=void 0,c=t,i=e.apply(n,r)}function g(e){var r=e-o,a=e-c;return void 0===o||r>=t||r<0||d&&a>=n}function j(){var e,r,a,l=p();if(g(l))return y(l);s=setTimeout(j,(e=l-o,r=l-c,a=t-e,d?m(a,n-r):a))}function y(e){return(s=void 0,v&&a)?x(e):(a=l=void 0,i)}function k(){var e,r=p(),n=g(r);if(a=arguments,l=this,o=r,n){if(void 0===s)return c=e=o,s=setTimeout(j,t),u?x(e):i;if(d)return s=setTimeout(j,t),x(o)}return void 0===s&&(s=setTimeout(j,t)),i}return t=b(t)||0,h(r)&&(u=!!r.leading,n=(d="maxWait"in r)?f(b(r.maxWait)||0,t):n,v="trailing"in r?!!r.trailing:v),k.cancel=function(){void 0!==s&&clearTimeout(s),c=0,a=o=l=s=void 0},k.flush=function(){return void 0===s?i:y(p())},k}},75405:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>j});var a=r(95155),l=r(12115),n=r(35695),i=r(91659);let s=l.forwardRef(function(e,t){let{title:r,titleId:a,...n}=e;return l.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":a},n),r?l.createElement("title",{id:a},r):null,l.createElement("path",{fillRule:"evenodd",d:"M10.5 3.75a6.75 6.75 0 1 0 0 13.5 6.75 6.75 0 0 0 0-13.5ZM2.25 10.5a8.25 8.25 0 1 1 14.59 5.28l4.69 4.69a.75.75 0 1 1-1.06 1.06l-4.69-4.69A8.25 8.25 0 0 1 2.25 10.5Z",clipRule:"evenodd"}))});var o=r(23465),c=r(54052),u=r.n(c),d=r(63133),v=r(20603),f=r(16948),m=r(27712),p=r(1595),h=r(39981),b=r(64465);let x=e=>{var t;let{hit:r,categories:i,onClick:s}=e,o=(0,n.useRouter)(),c=(0,l.useMemo)(()=>i.find(e=>{var t,a;return e.categoryId===(null===(a=r.categories)||void 0===a?void 0:null===(t=a[0])||void 0===t?void 0:t.categoryId)}),[i,r]),u=(0,l.useMemo)(()=>{var e;return null===(e=r.variants)||void 0===e?void 0:e[0]},[r]),d=(0,l.useCallback)(()=>{var e;null==s||s(),gtag("event",p.DK,r),o.push(null!==(e=r._url)&&void 0!==e?e:"#")},[r,s,o]);return(0,a.jsx)(b.default,{link:r._url,onMouseUp:d,children:(0,a.jsxs)("div",{className:"flex items-center gap-12",children:[(0,a.jsx)("div",{className:"shrink-0 p-8",children:(0,a.jsx)("div",{className:"relative aspect-square h-40 w-40",children:(0,a.jsx)(h.A,{className:"h-auto w-full rounded-md object-cover object-center",src:null==u?void 0:null===(t=u.images)||void 0===t?void 0:t[0],fill:!0})})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-16 text-primary-black",children:r.name}),(0,a.jsx)("div",{className:"mt-5",children:(0,a.jsx)("span",{className:"text-14 text-secondary-black",children:null==c?void 0:c.name})})]})]})})};var g=r(28585);let j=l.memo(e=>{var t;let{categories:r,toggleSearchBar:c}=e,p=(0,l.useRef)(null),h=(0,l.useRef)(null),{query:b}=(0,m.Bj)(),[j,y]=(0,l.useState)([]),[k,w]=(0,l.useState)(!1),[N,C]=(0,l.useState)(!1),{formatMessage:E}=(0,v.t)({name:"common"}),{blockScroll:M}=(0,f.A)(),T=(0,n.useRouter)(),[S,O]=(0,l.useState)(""),[R,A]=(0,l.useState)(""),_=(0,l.useMemo)(()=>{let e;return r.forEach(t=>{if("product-definition"===t.slug){var r;e=null==t?void 0:null===(r=t.subCategories)||void 0===r?void 0:r.find(e=>"searchable-product-definition"===e.slug);return}}),e},[r]),D=null!==(t=null==_?void 0:_.categoryId)&&void 0!==t?t:"";(0,l.useEffect)(()=>{M(k)},[M,k]);let F=(0,l.useCallback)(async()=>{var e;C(!0);let t=await b({query:R,categories:[D],limit:6});t.isError||(y(null!==(e=t.data.items)&&void 0!==e?e:[]),C(!1))},[R,b,D]),I=(0,l.useCallback)(u()(e=>A(e),150),[]),q=(0,l.useCallback)(()=>{w(!0),F()},[F]);(0,l.useCallback)(()=>w(!1),[]);let $=(0,l.useCallback)(e=>{O(e.target.value),I(e.target.value)},[I]),z=(0,l.useCallback)(()=>{I(""),O("")},[I]),L=(0,l.useCallback)(e=>{var t;e.preventDefault(),S&&(T.push("/search?query=".concat(S)),null===(t=h.current)||void 0===t||t.blur())},[S,T]);return(0,l.useEffect)(()=>{k&&F()},[F,k]),(0,l.useEffect)(()=>{let e=e=>{e.target instanceof HTMLElement&&"search-input"!==e.target.id&&(null==c||c(!1))};return document.addEventListener("click",e),()=>{document.removeEventListener("click",e)}},[]),(0,a.jsxs)(a.Fragment,{children:[k&&(0,a.jsx)(g.A,{onClick:()=>null==c?void 0:c(!1)}),(0,a.jsxs)("div",{className:"relative z-[350]",children:[(0,a.jsx)("div",{className:"relative z-50 border-neutral-400 bg-white lg:rounded-sm lg:border ".concat(k?"border-b":"border"),children:(0,a.jsxs)("form",{className:"quick-search relative flex w-full items-stretch",ref:p,onSubmit:L,children:[(0,a.jsx)("input",{id:"search-input",ref:h,className:"box-content grow border-none px-12 pl-10 pr-34 transition placeholder:text-14 placeholder:text-secondary-black focus:outline-none",value:S,onChange:$,onF
1ocus:q,placeholder:"".concat(E({id:"search.placeholder",defaultMessage:"Type to search"}),"...")}),(0,a.jsx)("button",{type:"submit",title:E({id:"search",defaultMessage:"Search"}),className:"shrink-0 border-l border-neutral-400 px-16 py-10 transition ".concat(k?"bg-primary-black":"bg-white"),children:(0,a.jsx)(s,{className:"size-24 stroke-0 ".concat(k?"fill-white":"fill-secondary-black")})}),S&&(0,a.jsx)("button",{type:"reset",className:"absolute right-60 top-1/2 block -translate-y-1/2",onClick:z,onMouseDown:e=>e.preventDefault(),children:(0,a.jsx)(o.A,{className:"w-24 fill-primary-black"})})]})}),k&&(0,a.jsx)("div",{className:"absolute bottom-0 left-0 max-h-[60vh] w-full translate-y-full overflow-auto bg-white px-20 py-28 xl:max-h-[unset] xl:translate-y-[calc(100%-40px)] xl:rounded-md xl:pt-84",children:(0,a.jsx)(i.e,{show:k,enter:"transition duration-75",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"transition duration-150",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:N?(0,a.jsx)("div",{className:"grid grid-cols-1 bg-white",children:(0,a.jsx)("div",{className:"relative mb-20",children:(0,a.jsx)(d.A,{loading:!0,variant:"ghost"})})}):(0,a.jsx)("div",{className:"grid grid-cols-1 gap-30",children:j.slice(0,6).map(e=>(0,a.jsx)(x,{hit:e,categories:r},e.productId))})})})]})]})})}}]);
2//# sourceMappingURL=5405.d4157b9e9c4af6d3.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.