1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[30197],{30197:function(e,t,l){l.d(t,{k:function(){return f}});var s=l(85893),r=l(22069),n=l(48027),a=l(88860),i=l(86993),o=l(51614),c=l(18562),d=l(37320),m=l(55153),x=l(25675),u=l.n(x),h=l(67294);let f=e=>{let{isOpen:t,onClose:l,title:x,description:f,options:y=[],selectedValue:g,selectedValues:b=[],onSelect:w,onMultiSelect:p,isLoading:j=!1,isError:v=!1,errorMessage:N="Failed to load options",searchPlaceholder:C="Search...",emptyMessage:k="No options found",minHeight:E="400px",enableSearch:S=!0,multiSelect:L=!1,gridLayout:R=!1,imageKey:B="image",enableSeriesFilter:_=!1,seriesOptions:A=[],isSeriesLoading:M=!1,height:H}=e,[I,W]=(0,h.useState)(""),[z,D]=(0,h.useState)(""),[F,O]=(0,h.useState)([]),P=(0,h.useRef)([]),Z=(0,h.useCallback)((e,t)=>e.length===t.length&&e.every((e,l)=>e===t[l]),[]);(0,h.useEffect)(()=>{Z(b,P.current)||(O([...b]),P.current=[...b])},[b,Z]);let q=(0,h.useMemo)(()=>{let e=y;if(_&&z){let t=z.toLowerCase().replace(/\bseries\b/g,"").trim(),l=t.split(/\s+/).filter(e=>e.length>0);e=e.filter(e=>{let s=(e.model||e.name).toLowerCase();return!!s.includes(t)||l.every(e=>RegExp("\\b".concat(e,"|").concat(e,"\\d"),"i").test(s))})}if(I){let t=I.toLowerCase();e=e.filter(e=>e.name.toLowerCase().includes(t)||e.subtitle&&e.subtitle.toLowerCase().includes(t))}return 0===e.length&&x.includes("Area")?y.filter(e=>-1===e.id):e},[y,I,z,_,x]),G=(0,h.useCallback)(e=>{if(L){let t;let l=[...F];O(t=l.includes(e.id)?l.filter(t=>t!==e.id):[...l,e.id]),null==p||p(t)}else null==w||w(e),l(),W(""),D("")},[L,F,p,w,l]),J=(0,h.useCallback)(()=>{l(),W(""),D("")},[l]),K=(0,h.useCallback)(()=>{W(""),D("")},[]);if((0,h.useEffect)(()=>{t||K()},[t,K]),(0,i.y)(t),!t)return null;let Q=e=>e[B]||e.imagePath||e.image;return(0,s.jsx)(n.h,{children:(0,s.jsxs)("div",{className:"fixed inset-0 z-[99999] flex items-end justify-center sm:items-center",children:[(0,s.jsx)("div",{className:"absolute inset-0 bg-black bg-opacity-50 transition-all duration-500 ease-out",onClick:L?void 0:l}),(0,s.jsxs)("div",{className:(0,o.cn)("relative flex max-h-[90vh] w-full max-w-lg flex-col overflow-hidden rounded-t-2xl bg-white transition-all duration-500 ease-out sm:rounded-2xl",t?"translate-y-0 scale-100 opacity-100":"translate-y-full scale-95 opacity-0"),style:{height:H||"auto",minHeight:E},children:[(0,s.jsx)("div",{className:"sticky top-0 border-b border-yellow-200 bg-white p-4",children:(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("div",{className:"flex-1",children:[(0,s.jsx)("h2",{className:"text-lg font-semibold text-gray-900",children:x}),(0,s.jsx)("p",{className:"mt-1 text-sm text-gray-600",children:f}),x.includes("Area")&&(0,s.jsx)("p",{className:"mt-1 text-sm text-gray-700 underline",children:"If your area is not listed, please select 'Others'"}),L&&F.length>0&&(0,s.jsxs)("p",{className:"mt-1 text-xs text-yellow-600",children:[F.length," item",1!==F.length?"s":""," selected"]})]}),(0,s.jsx)("button",{onClick:J,className:"ml-4 rounded-full p-1 transition-colors hover:bg-gray-100",children:(0,s.jsx)(c.default,{className:"h-5 w-5 text-gray-500"})})]})}),(0,s.jsx)("div",{className:"overscroll-behavior-contain flex min-h-0 flex-1 flex-col overflow-y-auto",style:{minHeight:"calc(".concat(E," - ").concat(L?"160px":"100px",")"),paddingBottom:L?"80px":"0"},children:(0,s.jsxs)("div",{className:"flex flex-1 flex-col space-y-4 p-4",children:[_&&!M&&A&&A.length>1&&(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("h3",{className:"text-sm font-semibold text-gray-800",children:"Select Series"}),z?(0,s.jsxs)("div",{className:"flex w-fit items-center justify-between gap-2 rounded-lg bg-yellow-50 px-4 py-2 shadow-sm",children:[(0,s.jsx)("span",{className:"font-medium text-gray-800",children:z}),(0,s.jsx)("button",{onClick:()=>D(""),className:"text-gray-600 transition hover:text-yellow-600",children:"â"})]}):(0,s.jsx)("div",{className:"hideScrollbar grid grid-flow-col grid-rows-3 gap-2 overflow-x-auto pb-2",children:A.map(e=>(0,s.jsx)("button",{onClick:()=>D(e),className:"whitespace-nowrap rounded-lg border-2 border-solid border-yellow-500/50 bg-transparent px-4 py-2 text-sm font-medium text-gray-800 shadow-sm transition hover:bg-yellow-50",children:e},e))})]}),S&&!j&&!v&&y.length>0&&(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)(d.default,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 transform text-gray-400"}
1),(0,s.jsx)(a.I,{placeholder:C,value:I,onChange:e=>W(e.target.value),className:"border-yellow-300 pl-10 focus:border-transparent focus:ring-2 focus:ring-yellow-500"})]}),(0,s.jsx)("div",{className:"flex flex-1 flex-col",children:j?(0,s.jsxs)("div",{className:"flex flex-1 flex-col items-center justify-center py-12",children:[(0,s.jsx)(r.Z,{}),(0,s.jsx)("p",{className:"mt-4 text-sm text-gray-500",children:"Loading options..."})]}):v?(0,s.jsxs)("div",{className:"flex flex-1 flex-col items-center justify-center py-12",children:[(0,s.jsx)("div",{className:"mb-4 flex h-12 w-12 items-center justify-center rounded-full bg-red-50",children:(0,s.jsx)(c.default,{className:"h-6 w-6 text-red-500"})}),(0,s.jsx)("p",{className:"mb-2 font-medium text-red-600",children:"Something went wrong"}),(0,s.jsx)("p",{className:"text-center text-sm text-gray-500",children:N})]}):0===q.length?(0,s.jsxs)("div",{className:"flex flex-1 flex-col items-center justify-center py-12",children:[(0,s.jsx)("div",{className:"mb-4 flex h-12 w-12 items-center justify-center rounded-full bg-gray-50",children:(0,s.jsx)(d.default,{className:"h-6 w-6 text-gray-400"})}),(0,s.jsx)("p",{className:"text-sm text-gray-500",children:k})]}):R?(0,s.jsx)("div",{className:"grid grid-cols-3 gap-3 md:grid-cols-4",children:q.map(e=>{let t=L?F.includes(e.id):g===e.id||g===e.name,l=Q(e);return(0,s.jsxs)("button",{onClick:()=>G(e),className:(0,o.cn)("flex flex-col items-center rounded-lg border-2 p-3 transition-all",t?"border-yellow-500 bg-yellow-50":"border-gray-200 bg-white hover:border-yellow-300"),children:[l&&(0,s.jsx)(u(),{src:l,alt:e.name,width:60,height:60,className:"mb-2 object-contain"}),(0,s.jsx)("span",{className:"text-center text-xs font-medium text-gray-800",children:e.name}),e.subtitle&&(0,s.jsx)("span",{className:"mt-1 text-center text-xs text-gray-500",children:e.subt
1itle})]},e.id)})}):(0,s.jsxs)("div",{className:"flex flex-1 flex-col",children:[(0,s.jsx)("div",{className:"space-y-2",children:q.map(e=>{let t=L?F.includes(e.id):g===e.id||g===e.name;return(0,s.jsxs)("button",{onClick:()=>G(e),className:(0,o.cn)("flex w-full items-center rounded-lg border p-3 text-left transition-colors",t?"border-yellow-300 bg-yellow-100 font-medium text-yellow-700":"border-yellow-100 text-gray-700 hover:bg-gray-50"),children:[L&&(0,s.jsx)("div",{className:"mr-3 flex h-4 w-4 flex-shrink-0 items-center justify-center",children:(0,s.jsx)("div",{className:(0,o.cn)("flex h-4 w-4 items-center justify-center rounded border-2 transition-colors",t?"border-yellow-500 bg-yellow-500":"border-gray-300 bg-white"),children:t&&(0,s.jsx)(m.default,{className:"h-3 w-3 text-white"})})}),(0,s.jsxs)("div",{className:"flex-1",children:[(0,s.jsx)("div",{className:(0,o.cn)("font-medium",L&&t&&"font-semibold"),children:e.name}),e.subtitle&&(0,s.jsx)("div",{className:"text-sm text-gray-500",children:e.subtitle})]})]},e.id)})}),(0,s.jsx)("div",{className:"min-h-[200px] flex-1"})]})})]})}),L&&(0,s.jsx)("div",{className:"absolute bottom-0 left-0 right-0 border-t border-yellow-200 bg-white p-4 shadow-lg",children:(0,s.jsx)("div",{className:"float-right flex items-center gap-3",children:(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)("button",{onClick:()=>{O([]),null==p||p([])},className:"rounded-lg border border-yellow-300 px-4 py-2 text-sm font-medium text-yellow-700 transition-colors hover:bg-yellow-50 disabled:cursor-not-allowed disabled:opacity-50",disabled:0===F.length,children:"Clear All"}),(0,s.jsx)("button",{onClick:J,className:"rounded-lg bg-yellow-500 px-6 py-2 text-sm font-medium text-white shadow-sm transition-colors hover:bg-yellow-600 focus:outline-none focus:ring-2 focus:ring-yellow-500 focus:ring-offset-2",children:"Done"})]})})})]})]})})}},86993:function(e,t,l){l.d(t,{y:function(){return n}});var s=l(67294);let r=0,n=e=>{let t=(0,s.useRef)(!1);(0,s.useEffect)(()=>{if(e&&!t.current){if(t.current=!0,1==++r){let e=window.innerWidth-document.documentElement.clientWidth;document.documentElement.style.overflow="hidden",document.body.style.overflow="hidden",document.body.style.overscrollBehavior="none",e>0&&(document.body.style.paddingRight="".concat(e,"px"))}}else!e&&t.current&&(t.current=!1,0===(r=Math.max(0,r-1))&&(document.documentElement.style.overflow="",document.body.style.overflow="",document.body.style.overscrollBehavior="",document.body.style.paddingRight=""))},[e]),(0,s.useEffect)(()=>()=>{t.current&&(t.current=!1,0===(r=Math.max(0,r-1))&&(document.documentElement.style.overflow="",document.body.style.overflow="",document.body.style.overscrollBehavior="",document.body.style.paddingRight=""))},[])}}}]);
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.