PageSourceSearch

https://www.osklen.com/_frsh/js/c33a80b927ce0f73d6590843ba6c3d00ee6e0e25/chunk-AG2LNDEG.js

js osklen.com collected 2026-09-26 00:37:28 UTC 8,912 bytes, 5 lines download raw bytes

1import{a as M}from"./chunk-RGZ2P4N7.js";import{a as D}from"./chunk-PHNIBYWZ.js";import{a as P}from"./chunk-ZDDWF6RS.js";import{a as Q}from"./chunk-DRYCNM6C.js";import{b as O}from"./chunk-YLJ4X2HY.js";import{a as F}from"./chunk-WH47EIOV.js";import{a as E}from"./chunk-MF2PTXOS.js";import{f as k}from"./chunk-2WDDCXLQ.js";import{a as e}from"./chunk-X6IOVEKU.js";import{a as u,b as x,d as B}from"./chunk-ZDLMJVT4.js";import{d as y}from"./chunk-6QKRXUVD.js";function N({placeholder:t="Type your search",action:n="/s",name:r="q",loader:c,isEmpty:p=!1,query:d,emptySearch:o=!1}){let{setQuery:s,payload:l,loading:a}=O(c??{}),i=B(null),{suggestions:b,query:w}=l.value??{},[g,m]=u(!0),v=g?[]:b?.products,[I,h]=u(!1),A=()=>{let f=i.current;f&&(f.value="",s(""))};return x(()=>{h(!g&&w?.length>3&&v?.length===0)},[v,w,g]),x(()=>{let f=i.current;if(!f)return;p&&h(!0),globalThis?.window.innerWidth>1024&&setTimeout(()=>{f.focus()},300);let L=document.getElementById("close-search"),C=document.getElementById("clearSearch"),S=V=>{V.stopPropagation(),f.value="",s(""),i.current?.focus()};L?.addEventListener("click",S),C?.addEventListener("click",S);let T=()=>{m(!1),s(f.value)};return f.addEventListener("input",T),()=>{f.removeEventListener("input",T),L?.removeEventListener("click",S),C?.removeEventListener("click",S)}},[p,g,s]),{isNotFound:I,setIsNotFound:h,query:w??"",defaultQuery:d,setQuery:s,loading:a.value,searchInputRef:i,placeholder:t,action:n,name:r,loader:c,isEmpty:p,emptySearch:o,firstLoad:g,
1setFirstLoad:m,products:v,suggestions:b,clearSearch:A}}function R({term:t}){return e(y,{children:e("script",{type:"text/javascript",async:!0,dangerouslySetInnerHTML:{__html:`
2        (window["rrApiOnReady"] = window["rrApiOnReady"] || []).push(function() {
3          rrApi.search('${t}');
4        });
5      `}})})}var _=()=>{let t=Array(5).fill(null);return e("div",{class:"flex flex-col itesm-start gap-[16px] lg:gap-[27px] -mt-0.5 lg:mt-0",children:[e($,{query:"#"}),e("div",{children:e("div",{class:"flex lg:gap-1 flex-col overflow-x-auto no-native-scroll",children:t?.map((n,r)=>e("div",{class:"flex",children:e("div",{class:"w-[318px] lg:w-[380px] flex gap-3 items-start py-[5px] lg:pl-1.5 lg:pr-3  rounded-md transition-all duration-500 ease-in-out xl:hover:bg-black/20 ",children:[e("div",{class:"min-w-[57] w-[57px] h-[77px]  skeleton",children:e("div",{width:57,height:76,class:"w-full h-full rounded overflow-hidden object-cover"})}),e("div",{class:"flex flex-col gap-2.5 lg:gap-[3px] mt-[3px] lg:mt-0",children:[e("span",{class:"skeleton w-[192px] h-[22.5px] -mt-0.5 lg:mt-0 ",children:"\xA0"}),e("span",{class:"skeleton w-[172px] h-[15px]",children:"\xA0"})]})]})},r))})})]})},$=({query:t,sendSearchQueryEvent:n})=>e("div",{class:"relative flex w-full items-start justify-between pl-0.5 lg:pr-3 xll:px-0",children:[e("span",{class:"font-suisse font-normal lg:font-medium text-[13px] lg:text-sm !leading-[83.412%] !-tracking-[0.02em] text-black xll:-mr-[0.5px]",children:"Suggested Products"}),e("a",{href:`/s?q=${t}`,class:"fixed font-suisse text-[13px] font-normal leading-extra-2 -tracking-[0.02em] bg-white text-[#1D1D1D] px-2.5 py-[7px] gap-2.5 rounded-md w-[156px] h-[34px]s hidden lg:flex items-center justify-center right-3",title:"See all results",children:"See all results"})]});function q({query:t,products:n,loading:r,sendSearchQueryEvent:c,sendSearchClickEvent:p}){let[d,o]=u(!1),[,s]=u(!1);return x(()=>{if(!t&&!r){o(!1),s(!1);return}if(r||t?.length&&t.length<4){o(!0),s(!1);return}!r&&t?.length>=4&&(c?.(),setTimeout(()=>{o(!1),s(!0)},2e3))},[r,t]),e("div",{id:"searchResults",class:`${t?.length===0?"hidden":"flex gap-[22px] lg:gap-8 pl-3.5 lg:pl-0 lg:pt-[5px]"} flex-col no-native-scroll`,children:[t&&e(R,{term:t}),d||t?.length&&t.length<4||!n||n?.length===0?e(_,{}):e("div",{id:"searchResultContent",class:"flex flex-col itesm-start gap-[16px] lg:gap-[27px] -mt-0.5 lg:mt-0",children:[e($,{query:t??"#",sendSearchQueryEvent:c}),e("div",{class:"flex lg:gap-1 flex-col overflow-x-auto no-native-scroll",children:n?.map((l,a)=>e("div",{class:"flex",children:e("a",{class:"w-[318px] lg:w-[380px] flex gap-[13px] lg:gap-3 items-start py-[5px] lg:pl-1.5 lg:pr-3  rounded-md transition-all duration-500 ease-in-out xl:hover:bg-black/20 ",href:l?.url,title:l?.isVariantOf?.name??l?.name,onClick:()=>p?.({id:l.productID,name:l?.isVariantOf?.name??l?.name,index:a}),children:[e("div",{class:"min-w-[57] w-[57px] h-[77px]",children:e(k,{...P,src:l?.image?.[0]?.url??"",alt:l?.image?.[0]?.alternateName,width:57,height:0,class:"w-full h-full rounded overflow-hidden object-cover"})}),e("div",{class:"flex flex-col gap-[5px] lg:gap-[3px] mt-[5px] lg:mt-0",children:[e("span",{class:"font-suisse font-normal leading-extra-2 lg:-tracking-[0.02em] text-[13px] lg:text-sm text-black-2 -mt-0.5 lg:mt-0",children:D(l?.isVariantOf?.name??l?.name??"")}),e("span",{class:"font-suisse font-normal leading-extra-2 -tracking-[0.02em] text-[10px] text-gray-2",children:l?.category?.replace(">"," / ")})]})]})}))})]})]})}var se=q;function H({trendingItems:t,sendSearchQueryEvent:n}){return e("div",{class:"relative flex",children:e("div",{class:"md:fixed flex flex-col gap-[22px] lg:gap-[51px] pl-2.5 pr-[9px] lg:p-0",children:[e("span",{class:"w-fit p-[0.9px_5.3px] lg:p-0 font-suisse font-medium text-[13px] lg:text-sm leading-[83.412%] -tracking-[0.26px] lg:-tracking-[0.28px] text-black",children:"Most searched"}),e("div",{class:"flex flex-wrap gap-1 gap-y-1.5 transition-opacity duration-500 ease-in-out -mt-px",children:t?.map(r=>e("div",{class:"flex items-center justify-center",children:e("a",{href:`/s?q=${r.label}`,class:"flex items-center justify-center w-fit px-2.5 h-[34px] rounded-md font-suisse text-[13px] font-normal bg-white text-black-1 !leading-extra-2 !-tracking-[0.26px] text-center border border-transparent transition-all duration-300 hover:border-gray-2",title:r.label,onClick:()=>{n?.(r.label)},children:r.label})},r.url))})]})})}var oe=H;function W({product:t}){let{url:n,name:r,image:c,offers:p,isVariantOf:d}=t,[o]=c??[],{listPrice:s,lowPrice:l}=M(p),a="USD",i=s!==l;return e("div",{class:"relative flex flex-col gap-[8.48px] lg:gap-[8.55px]",children:[e(k,{...P,src:o?.url??"",alt:o?.alternateName,width:140,height:0,class:"rounded-[10px] w-[133.323px] h-[173.516px] overflow-hidden object-cover"}),e("div",{class:"flex flex-col gap-[7px]",children:[e("h3",{class:"font-suisse font-medium text-[10px] leading-[90%] -tracking-[0.02em] text-black -ml-[0.5px]",children:d?.name||r}),e("span",{class:"inline-flex font-neue font-medium leading-[7.3px] -tracking-[0.02em] text-[8.12px] text-gray-2 gap-1",children:[E(i?l:s,a),i&&e("span",{class:"line-through	text-[#BCAD97]",children:E(s,a)})]})]}),e("a",{href:n,class:"absolute inset-0",children:e("span",{class:"sr-only font-suisse",children:d?.name||r})})]})}var j=W;function z({products:t,interval:n,loading:r}){if(!t)return null;let[c,p]=u(0),[d,o]=u(!1),s=133.323,l=6;return x(()=>{let a=()=>{o(globalThis?.window.innerWidth<=768)};return a(),globalThis?.window.addEventListener("resize",a),()=>globalThis?.window.removeEventListener("resize",a)},[]),x(()=>
5{if(!d){let a=setInterval(()=>{p(i=>i+l>=t.length?0:i+1)},n??3e3);return()=>clearInterval(a)}},[d,t.length,l]),e(y,{children:!r&&e("div",{class:"flex flex-col gap-[27px] lg:gap-[22px] pb-28 lg:pb-0 pl-[9px] lg:pl-0",children:[e("span",{class:"font-suisse font-medium text-[13px] lg:text-sm leading-[83.412%] -tracking-[0.02em] text-black pr-1.5 relative left-1.5 top-px lg:static lg:left-0 lg:top-0 lg:-ml-px",children:"Suggested Products"}),e("div",{class:"md:min-h-0 flex gap-2 overflow-auto overflow-y-clip [&::-webkit-scrollbar]:hidden no-native-scroll",children:e("div",{class:"relative w-full overflow-auto overflow-y-clip [&::-webkit-scrollbar]:hidden no-native-scroll",children:e("div",{class:"flex min-w-full gap-[7.52px] transition-transform duration-500 ease-in-out",style:{transform:`translateX(-${c*s}px)`},children:t?.map(a=>e("div",{class:"flex-shrink-0",style:{width:`${s}px`},children:e(j,{product:a})},a?.productID))})})})]})})}var ve=z;function U({searchBar:t,styles:n,isOpen:r,formRef:c}){let{loader:p,emptySearch:d}=t??{},{name:o,placeholder:s,defaultQuery:l,action:a,setIsNotFound:i,firstLoad:b,setFirstLoad:w,setQuery:g,searchInputRef:m,query:v}=N({loader:p,emptySearch:d});return globalThis?.window.innerWidth<1024&&(r||m.current?.value?m.current?.focus():m.current?.blur()),e("form",{ref:m.current?.value?c:void 0,action:a,class:n?.form,role:"search",children:[e("input",{ref:m,id:"search-input",class:n?.input,type:"text",name:o,defaultValue:l,onInput:I=>{let h=I.currentTarget.value;i(!1),b&&g(""),h.length>=4&&(F({name:"search",params:{search_term:h}}),g(h)),w(!1)},placeholder:s,role:"combobox","aria-controls":"search-suggestion",autoComplete:"off",autoFocus:!!r}),v&&e(Q,{term:v??""})]})}var Pe=U;export{N as a,se as b,oe as c,ve as d,Pe as e};

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.