PageSourceSearch

https://theelephantstrunk.com/_next/static/chunks/pages/search-838da386bbae2f1e.js

js theelephantstrunk.com collected 2026-10-06 13:26:27 UTC 16,875 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[603],{14905:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/search",function(){return t(5533)}])},86582:function(e,n,t){"use strict";function a(e,n){for(var t=[];e>t.length;)t.push(n(t.length));return t}t.d(n,{Z:function(){return a}})},5533:function(e,n,t){"use strict";t.r(n),t.d(n,{__N_SSG:function(){return Y},default:function(){return Q}});var a=t(5341),r=t(24246),i=t(38944),l=t(79894),c=t.n(l),s=t(27378),o=t(86677),d=t(19981),u=t(17599),h=t(85034),m=t(28502),g=t.n(m),v=t(38579),x=t.n(v),p=t(23842),f=t(70169),b=t(31373),j=t(59312),_=t(73500),w=t(99358);var N=function(){return async(e={})=>(0,s.useCallback)((async function(){return Promise.resolve()}),[])},y=t(54153);var k=function e(n,t){const a=({includeProducts:e}={})=>({data:null});return a.extend=e,a}();var C=function(e){return async({id:e})=>(0,s.useCallback)((async function(){return Promise.resolve()}),[])},Z=t(99202),P=t.n(Z),I=function(e){var n,t,a=e.productId,l=e.variant,c=e.className,o=(0,b.Z)(e,["productId","variant","className"]),d=k().data,m=N(),g=C(),v=(0,y.Z)().data,x=(0,_.l8)(),Z=x.openModal,I=x.setModalView,S=(0,s.useState)(!1),q=S[0],B=S[1],E=null===d||void 0===d||null===(n=d.items)||void 0===n?void 0:n.find((function(e){return e.product_id===Number(a)&&e.variant_id===Number(l.id)})),L=function(){var e=(0,p.Z)((function(e){return(0,j.__generator)(this,(function(n){switch(n.label){case 0:if(e.preventDefault(),q)return[2];if(!v)return I("LOGIN_VIEW"),[2,Z()];B(!0),n.label=1;case 1:return n.trys.push([1,6,,7]),E?[4,g({id:E.id})]:[3,3];case 2:return n.sent(),[3,5];case 3:return[4,m({productId:a,variantId:null===l||void 0===l?void 0:l.id})];case 4:n.sent(),n.label=5;case 5:return B(!1),[3,7];case 6:return n.sent(),B(!1),[3,7];case 7:return[2]}}
1))}));return function(n){return e.apply(this,arguments)}}();return(0,r.jsx)("button",(0,f.Z)((0,h.Z)({"aria-label":"Add to wishlist",className:(0,i.Z)(P().root,c),onClick:L},o),{children:(0,r.jsx)(w.Z,{className:(0,i.Z)(P().icon,(t={},(0,u.Z)(t,P().loading,q),(0,u.Z)(t,P().inWishlist,E),t))})}))},S=t(34398),q=t(96028),B=t.n(q),E=function(e){var n=e.name,t=e.price,a=e.className,l=void 0===a?"":a,c=e.fontSize,s=void 0===c?32:c;return(0,r.jsxs)("div",{className:(0,i.Z)(B().root,l),children:[(0,r.jsx)("h3",{className:B().name,children:(0,r.jsx)("span",{className:(0,i.Z)((0,u.Z)({},B().fontsizing,s<32)),style:{fontSize:"".concat(s,"px"),lineHeight:"".concat(s,"px")},children:n})}),(0,r.jsx)("div",{className:B().price,children:t})]})},L=t(14284),R="/product-img-placeholder.svg",T=function(e){var n,t,a,l,s,o,d=e.product,m=e.imgProps,v=e.className,p=e.noNameTag,f=void 0!==p&&p,b=e.variant,j=void 0===b?"default":b,_=(0,S.ZP)({amount:d.price.value,baseAmount:d.price.retailPrice,currencyCode:d.price.currencyCode}).price,w=(0,i.Z)(g().root,(o={},(0,u.Z)(o,g().slim,"slim"===j),(0,u.Z)(o,g().simple,"simple"===j),o),v);return(0,r.jsx)(c(),{href:"/product/".concat(d.slug),children:(0,r.jsxs)("a",{className:w,"aria-label":d.name,children:["slim"===j&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:g().header,children:(0,r.jsx)("span",{children:d.name})}),(null===d||void 0===d?void 0:d.images)&&(0,r.jsx)("div",{children:(0,r.jsx)(x(),(0,h.Z)({quality:"85",src:(null===(n=d.images[0])||void 0===n?void 0:n.url)||R,alt:d.name||"Product Image",height:320,width:320,layout:"fixed"},m))})]}),"simple"===j&&(0,r.jsxs)(r.Fragment,{children:[L.env.COMMERCE_WISHLIST_ENABLED&&(0,r.jsx)(I,{className:g().wishlistButton,productId:d.id,variant:d.variants[0]}),!f&&(0,r.jsxs)("div",{className:g().header,children:[(0,r.jsx)("h3",{className:g().name,children:(0,r.jsx)("span",{children:d.name})}),(0,r.jsx)("div",{className:g().price,children:"".concat(_," ").concat(null===(t=d.price)||void 0===t?void 0:t.currencyCode)})]}),(0,r.jsx)("div",{className:g().imageContainer,children:(null===d||void 0===d?void 0:d.images)&&(0,r.jsx)("div",{children:(0,r.jsx)(x(),(0,h.Z)({alt:d.name||"Product Image",className:g().productImage,src:(null===(a=d.images[0])||void 0===a?void 0:a.url)||R,height:540,width:540,quality:"85",layout:"responsive"},m))})})]}),"default"===j&&(0,r.jsxs)(r.Fragment,{children:[L.env.COMMERCE_WISHLIST_ENABLED&&(0,r.jsx)(I,{className:g().wishlistButton,productId:d.id,variant:d.variants[0]}),(0,r.jsx)(E,{name:d.name,price:"".concat(_," ").concat(null===(l=d.price)||void 0===l?void 0:l.currencyCode)}),(0,r.jsx)("div",{className:g().imageContainer,children:(null===d||void 0===d?void 0:d.images)&&(0,r.jsx)("div",{children:(0,r.jsx)(x(),(0,h.Z)({alt:d.name||"Product Image",className:g().productImage,src:(null===(s=d.images[0])||void 0===s?void 0:s.url)||R,height:540,width:540,quality:"85",layout:"responsive"},m))})})]})]})})},z=t(88102),M=function(e){return"number"===typeof e?"".concat(e,"px"):e},W=t(82178),F=t.n(W),H=function(e){var n,t=e.style,a=e.width,l=e.height,c=e.children,s=e.className,o=e.show,d=void 0===o||o,m=e.boxHeight,g=void 0===m?l:m,v=!!c&&!(a||l);return a=a||24,l=l||24,g=g||l,(0,r.jsx)("span",{className:(0,i.Z)(F().skeleton,s,(n={},(0,u.Z)(n,F().show,d),(0,u.Z)(n,F().wrapper,v),(0,u.Z)(n,F().loaded,!v&&!!c),n)),style:v?{}:(0,h.Z)({minWidth:M(a),minHeight:M(l),marginBottom:"calc(".concat(M(g)," - ").concat(M(l),")")},t),children:c})},A=t(97828),O=function(e){return e.replace(/^\/|\/$/g,"")},D=t(86582);var K=function(e){return Object.keys(e).reduce((function(n,t){var a;return(null===(a=e[t])||void 0===a?void 0:a.length)&&(n[t]=e[t]),n}),{})},X=function(e,n){var t=O(e);return"/search".concat(n?"/designers/".concat(n):"").concat(t?"/".concat(t):"")},G=function(e,n){var t=O(e).replace(/^brands/,"designers");return"/search".concat(t?"/".concat(t):"").concat(n?"/".concat(n):"")},J={"trending-desc":"Trending","latest-desc":"Latest arrivals","price-asc":"Price: Low to high","price-desc":"Price: High to low"};
1function V(e){var n,t=e.categories,l=e.brands,d=(0,s.useState)(""),u=d[0],h=d[1],m=(0,s.useState)(!1),g=m[0],v=m[1],x=(0,o.useRouter)(),p=x.asPath,f=x.locale,b=x.query,j=b.q,_=b.sort,w=K({sort:_}),N=function(e){var n=(0,s.useState)("/search"),t=n[0],a=n[1],r=(0,s.useState)(),i=r[0],l=r[1],c=(0,s.useState)(),o=c[0],d=c[1];return(0,s.useEffect)((function(){var n=e.split("?")[0],r=n.split("/"),c=r[2],s=r[3];"designers"===c&&(c=r[4]),n!==t&&a(n),c!==i&&l(c),s!==o&&d(s)}),[e,t,i,o]),{pathname:t,category:i,brand:o}}(p),y=N.pathname,k=N.category,C=N.brand,Z=t.find((function(e){return e.slug===k})),P=null===(n=l.find((function(e){return O(e.node.path)==="brands/".concat(C)})))||void 0===n?void 0:n.node,I=(0,A.Z)({search:"string"===typeof j?j:"",categoryId:null===Z||void 0===Z?void 0:Z.id,brandId:null===P||void 0===P?void 0:P.entityId,sort:"string"===typeof _?_:"",locale:f}).data,S=function(e,n){v(n!==u||!g),h(n)};return(0,r.jsx)(z.Z,{children:(0,r.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-12 gap-4 mt-3 mb-20",children:[(0,r.jsxs)("div",{className:"col-span-8 lg:col-span-2 order-1 lg:order-none",children:[(0,r.jsxs)("div",{className:"relative inline-block w-full",children:[(0,r.jsx)("div",{className:"lg:hidden",children:(0,r.jsx)("span",{className:"rounded-md shadow-sm",children:(0,r.jsxs)("button",{type:"button",onClick:function(e){return S(0,"categories")},className:"flex justify-between w-full rounded-sm border border-accent-3 px-4 py-3 bg-accent-0 text-sm leading-5 font-medium text-accent-4 hover:text-accent-5 focus:outline-none focus:border-blue-300 focus:shadow-outline-normal active:bg-accent-1 active:text-accent-8 transition ease-in-out duration-150",id:"options-menu","aria-haspopup":"true","aria-expanded":"true",children:[(null===Z||void 0===Z?void 0:Z.name)?"Category: ".concat(null===Z||void 0===Z?void 0:Z.name):"All Categories",(0,r.jsx)("svg",{className:"-mr-1 ml-2 h-5 w-5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",children:(0,r.jsx)("path",{fillRule:"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z",clipRule:"evenodd"})})]})})}),(0,r.jsx)("div",{className:"origin-top-left absolute lg:relative left-0 mt-2 w-full rounded-md shadow-lg lg:shadow-none z-10 mb-10 lg:block ".concat("categories"!==u||!0!==g?"hidden":""),children:(0,r.jsx)("div",{className:"rounded-sm bg-accent-0 shadow-xs lg:bg-none lg:shadow-none",children:(0,r.jsx)("div",{role:"menu","aria-orientation":"vertical","aria-labelledby":"options-menu",children:(0,r.jsxs)("ul",{children:[(0,r.jsx)("li",{className:(0,i.Z)("block text-sm leading-5 text-accent-4 lg:text-base lg:no-underline lg:font-bold lg:tracking-wide hover:bg-accent-1 lg:hover:bg-transparent hover:text-accent-8 focus:outline-none focus:bg-accent-1 focus:text-accent-8",{underline:!(null===Z||void 0===Z?void 0:Z.name)}),children:(0,r.jsx)(c(),{href:{pathname:X("",C),query:w},children:(0,r.jsx)("a",{onClick:function(e){return S(0,"categories")},className:"block lg:inline-block px-4 py-2 lg:p-0 lg:my-2 lg:mx-4",children:"All Categories"})})}),t.map((function(e){return(0,r.jsx)("li",{className:(0,i.Z)("block text-sm leading-5 text-accent-4 hover:bg-accent-1 lg:hover:bg-transparent hover:text-accent-8 focus:outline-none focus:bg-accent-1 focus:text-accent-8",{underline:(null===Z||void 0===Z?void 0:Z.id)===e.id}),children:(0,r.jsx)(c(),{href:{pathname:X(e.path,C),query:w},children:(0,r.jsx)("a",{onClick:function(e){return S(0,"categories")},className:"block lg:inline-block px-4 py-2 lg:p-0 lg:my-2 lg:mx-4",children:e.name})})},e.path)}))]})})})})]}),(0,r.jsxs)("div",{className:"relative inline-block w-full",children:[(0,r.jsx)("div",{className:"lg:hidden mt-3",children:(0,r.jsx)("span",{className:"rounded-md shadow-sm",children:(0,r.jsxs)("button",{type:"button",onClick:function(e){return S(0,"brands")},className:"flex justify-between w-full rounded-sm border border-accent-3 px-4 py-3 bg-accent-0 text-sm leading-5 font-medium text-accent-8 hover:text-accent-5 focus:outline-none focus:border-blue-300 focus:shadow-outline-normal active:bg-accent-1 active:text-accent-8 transition ease-in-out duration-150",id:"options-menu","aria-haspopup":"true","aria-expanded":"true",children:[(null===P||void 0===P?void 0:P.name)?"Design: ".concat(null===P||void 0===P?void 0:P.name):"All Designs",(0,r.jsx)("svg",{className:"-mr-1 ml-2 h-5 w-5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",children:(0,r.jsx)("path",{fillRule:"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z",clipRule:"evenodd"})})]})})}),(0,r.jsx)("div",{className:"origin-top-left absolute lg:relative left-0 mt-2 w-full rounded-md shadow-lg lg:shadow-none z-10 mb-10 lg:block ".concat("brands"!==u||!0!==g?"hidden":""),children:(0,r.jsx)("div",{className:"rounded-sm bg-accent-0 shadow-xs lg:bg-none lg:shadow-none",children:(0,r.jsx)("div",{role:"menu","aria-orientation":"vertical","aria-labelledby":"options-menu",children:(0,r.jsxs)("ul",{children:[(0,r.jsx)("li",{className:(0,i.Z)("block text-sm leading-5 text-accent-4 lg:text-base lg:no-underline lg:font-bold lg:tracking-wide hover:bg-accent-1 lg:hover:bg-transparent hover:text-accent-8 focus:outline-none focus:bg-accent-1 focus:text-accent-8",{underline:!(null===P||void 0===P?void 0:P.name)}),children:(0,r.jsx)(c(),{href:{pathname:G("",k),query:w},children:(0,r.jsx)("a",{onClick:function(e){return S(0,"brands")},className:"block lg:inline-block px-4 py-2 lg:p-0 lg:my-2 lg:mx-4",children:"All Designers"})})}),l.flatMap((function(e){var n=e.node;return(0,r.jsx)("li",{className:(0,i.Z)("block text-sm leading-5 text-accent-4 hover:bg-accent-1 lg:hover:bg-transparent hover:text-accent-8 focus:outline-none focus:bg-accent-1 focus:text-accent-8",{underline:(null===P||void 0===P?void 0:P.entityId)===n.entity
1Id}),children:(0,r.jsx)(c(),{href:{pathname:G(n.path,k),query:w},children:(0,r.jsx)("a",{onClick:function(e){return S(0,"brands")},className:"block lg:inline-block px-4 py-2 lg:p-0 lg:my-2 lg:mx-4",children:n.name})})},n.path)}))]})})})})]})]}),(0,r.jsxs)("div",{className:"col-span-8 order-3 lg:order-none",children:[(j||Z||P)&&(0,r.jsx)("div",{className:"mb-12 transition ease-in duration-75",children:I?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("span",{className:(0,i.Z)("animated",{fadeIn:I.found,hidden:!I.found}),children:["Showing ",I.products.length," results"," ",j&&(0,r.jsxs)(r.Fragment,{children:['for "',(0,r.jsx)("strong",{children:j}),'"']})]}),(0,r.jsx)("span",{className:(0,i.Z)("animated",{fadeIn:!I.found,hidden:I.found}),children:j?(0,r.jsxs)(r.Fragment,{children:['There are no products that match "',(0,r.jsx)("strong",{children:j}),'"']}):(0,r.jsx)(r.Fragment,{children:"There are no products that match the selected category."})})]}):j?(0,r.jsxs)(r.Fragment,{children:['Searching for: "',(0,r.jsx)("strong",{children:j}),'"']}):(0,r.jsx)(r.Fragment,{children:"Searching..."})}),I?(0,r.jsx)("div",{className:"grid grid-cols-1 gap-6 sm:grid-cols-2 lg:grid-cols-3",children:I.products.map((function(e){return(0,r.jsx)(T,{variant:"simple",className:"animated fadeIn",product:e,imgProps:{width:480,height:480}},e.path)}))}):(0,r.jsx)("div",{className:"grid grid-cols-1 gap-6 sm:grid-cols-2 lg:grid-cols-3",children:(0,D.Z)(12,(function(e){return(0,r.jsx)(H,{children:(0,r.jsx)("div",{className:"w-60 h-60"})},e)}))})," "]}),(0,r.jsx)("div",{className:"col-span-8 lg:col-span-2 order-2 lg:order-none",children:(0,r.jsxs)("div",{className:"relative inline-block w-full",children:[(0,r.jsx)("div",{className:"lg:hidden",children:(0,r.jsx)("span",{className:"rounded-md shadow-sm",children:(0,r.jsxs)("button",{type:"button",onClick:function(e){return S(0,"sort")},className:"flex justify-between w-full rounded-sm border border-accent-3 px-4 py-3 bg-accent-0 text-sm leading-5 font-medium text-accent-4 hover:text-accent-5 focus:outline-none focus:border-blue-300 focus:shadow-outline-normal active:bg-accent-1 active:text-accent-8 transition ease-in-out duration-150",id:"options-menu","aria-haspopup":"true","aria-expanded":"true",children:[_?J[_]:"Relevance",(0,r.jsx)("svg",{className:"-mr-1 ml-2 h-5 w-5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",children:(0,r.jsx)("path",{fillRule:"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z",clipRule:"evenodd"})})]})})}),(0,r.jsx)("div",{className:"origin-top-left absolute lg:relative left-0 mt-2 w-full rounded-md shadow-lg lg:shadow-none z-10 mb-10 lg:block ".concat("sort"!==u||!0!==g?"hidden":""),children:(0,r.jsx)("div",{className:"rounded-sm bg-accent-0 shadow-xs lg:bg-none lg:shadow-none",children:(0,r.jsx)("div",{role:"menu","aria-orientation":"vertical","aria-labelledby":"options-menu",children:(0,r.jsxs)("ul",{children:[(0,r.jsx)("li",{className:(0,i.Z)("block text-sm leading-5 text-accent-4 lg:text-base lg:no-underline lg:font-bold lg:tracking-wide hover:bg-accent-1 lg:hover:bg-transparent hover:text-accent-8 focus:outline-none focus:bg-accent-1 focus:text-accent-8",{underline:!_}),children:(0,r.jsx)(c(),{href:{pathname:y,query:K({q:j})},children:(0,r.jsx)("a",{onClick:function(e){return S(0,"sort")},className:"block lg:inline-block px-4 py-2 lg:p-0 lg:my-2 lg:mx-4",children:"Relevance"})})}),Object.entries(J).map((function(e){var n=(0,a.Z)(e,2),t=n[0],l=n[1];return(0,r.jsx)("li",{className:(0,i.Z)("block text-sm leading-5 text-accent-4 hover:bg-accent-1 lg:hover:bg-transparent hover:text-accent-8 focus:outline-none focus:bg-accent-1 focus:text-accent-8",{underline:_===t}),children:(0,r.jsx)(c(),{href:{pathname:y,query:K({q:j,sort:t})},children:(0,r.jsx)("a",{onClick:function(e){return S(0,"sort")},className:"block lg:inline-block px-4 py-2 lg:p-0 lg:my-2 lg:mx-4",children:l})})},t)}))]})})})})]})})]})})}V.Layout=d.Z;var Y=!0,Q=V},28502:function(e){e.exports={root:"ProductCard_root__HqXTt",productImage:"ProductCard_productImage__nbfNy",header:"ProductCard_header__qlwPO",name:"ProductCard_name__YciuQ",price:"ProductCard_price___JB_V",wishlistButton:"ProductCard_wishlistButton__jS6Lf",imageContainer:"ProductCard_imageContainer__G6HoR",simple:"ProductCard_simple__HMkuK",slim:"ProductCard_slim__nclhL"}},96028:function(e){e.exports={root:"ProductTag_root__Nxivt",name:"ProductTag_name__C_niq",fontsizing:"ProductTag_fontsizing__XnIPn",price:"ProductTag_price__RDK06"}}
1,82178:function(e){e.exports={skeleton:"Skeleton_skeleton__5r66i",loading:"Skeleton_loading__rv977",wrapper:"Skeleton_wrapper__KY8KJ",show:"Skeleton_show__wL69o"}},99202:function(e){e.exports={root:"WishlistButton_root__crSyc",icon:"WishlistButton_icon__J690_",loading:"WishlistButton_loading__BcgF9",inWishlist:"WishlistButton_inWishlist__uwrZI"}}},function(e){e.O(0,[716,104,393,449,774,888,179],(function(){return n=14905,e(e.s=n);var n}));var n=e.O();_N_E=n}]);

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.