1import{r as u,j as r,W as U,c3 as V,c4 as X,c5 as Y}from"./main-COI-4JT4.js";function i(...s){return X(Y(s))}function ne({options:s,value:m,onChange:_,placeholder:C="Select an option",ariaLabel:z,label:w,className:O,controlClassName:R,isLoading:c=!1,disabled:n=!1,searchable:f=!0,displayValue:W,onCreateOption:y,onOpen:v,variant:e="default",prefixLabel:d,maxLength:H,sanitizeInput:N,menuPortal:a=!1,menuClassName:I,autoFocus:L=!1}){const[l,p]=u.useState(!1),[x,h]=u.useState(""),[S,T]=u.useState(),k=u.useRef(null),A=u.useRef(null),D=s.find(t=>t.value===m)?.label||W||"",F=!!D,q=e==="listingDesign"&&d?`${d}: ${F?D:""}`:D,b=u.useMemo(()=>s.filter(t=>t.label.toLowerCase().includes(x.toLowerCase())),[s,x]);u.useEffect(()=>{if(typeof document>"u")return;const t=g=>{const o=g.target;!k.current?.contains(o)&&!A.current?.contains(o)&&p(!1)};return document.addEventListener("mousedown",t),()=>document.removeEventListener("mousedown",t)},[]),u.useEffect(()=>{n&&(p(!1),h(""))},[n]),u.useEffect(()=>{if(!a||!l||typeof window>"u")return;const t=()=>{const g=k.current;if(!g)return;const o=g.getBoundingClientRect(),B=8,G=4,E=window.innerHeight-o.bottom-B,$=o.top-B,M=E<220&&$>E,Q=Math.max(120,Math.min(300,M?$:E));T({left:o.left,width:o.width,maxHeight:Q,...M?{bottom:window.innerHeight-o.top+G}:{top:o.bottom+G}})};return t(),window.addEventListener("resize",t),window.addEventListener("scroll",t,!0),()=>{window.removeEventListener("resize",t),window.removeEventListener("scroll",t,!0)}},[l,a]);const J=t=>{c||n||t.disabled||(_(t.value),p(!1),h(""))},K=()=>{const t=x.trim();!t||!y||c||n||(y(t),p(!1),h(""))},j=l&&!n&&(!a||S)?r.jsxs("div",{ref:A,className:i(a?"fixed z-[2300]":"absolute z-50 mt-1","flex w-full flex-col overflow-hidden",e==="listingDesign"?"max-h-[420px] rounded-[12px] border border-[#E1E1E1] bg-white shadow-[0_6px_18px_rgba(0,0,0,0.08)]":e==="checkout"?"max-h-[320px] rounded-[10px] border border-[#D7DADF] bg-white shadow-[0_12px_24px_rgba(23,26,31,0.08)]":e==="valueGuide"?"max-h-[320px] rounded-[8px] border border-[#D9E6EF] bg-white shadow-[0_10px_22px_rgba(23,26,31,0.12)]":"max-h-[300px] rounded-xl border border-gray-200 bg-white shadow-xl",I),style:a?S:void 0,children:[r.jsx("div",{className:"flex-1 overflow-y-auto",children:c?r.jsx("div",{className:"px-4 py-8 text-center text-sm text-gray-400 italic",children:"Loading options..."}):b.length>0?b.map((t,g)=>{const o=t.value===m;return r.jsxs("div",{className:i("flex w-full cursor-pointer items-center justify-between gap-3 text-left transition-colors",e==="listingDesign"?"px-6 py-3.5 text-[14px] leading-[1.2] hover:bg-[#EFEFEF]":e==="checkout"?"px-4 py-3 text-[15px] hover:bg-[#F6F7F9]":e==="valueGuide"?"px-3 py-2.5 text-[13px] hover:bg-[#F4F8FC]":"px-4 py-2.5 text-sm hover:bg-gray-50",o&&(e==="listingDesign"?"font-semibold text-[#202325]":e==="checkout"?"bg-[#F6F7F9] font-semibold text-[#171A1F]":e==="valueGuide"?"bg-[#EAF4FB] font-semibold text-[#1F2530]":"text-bbb-blue bg-blue-50/30 font-semibold"),t.disabled&&"cursor-not-allowed opacity-45"),"aria-disabled":t.disabled||void 0,onClick:()=>J(t),children:[r.jsx("span",{className:"min-w-0 truncate",children:t.label}),o?r.jsx(U,{"aria-hidden":"true",className:i("h-4 w-4 shrink-0",e==="listingDesign"||e==="checkout"?"text-[#2257CC]":e==="valueGuide"?"text-[#2456CC]":"text-bbb-blue")}):null]},`${String(t.value)}-${t.label}-${g}`)}):x.trim()&&y?r.jsxs("button",{type:"button",onClick:K,className:i(e==="listingDesign"?"w-full px-6 py-3.5 text-left text-[14px] leading-[1.2] font-medium text-[#2257CC] transition-colors hover:bg-blue-50":"w-full px-4 py-3 text-left text-sm font-medium text-[#2257CC] transition-colors hover:bg-blue-50"),children:['Create "',x.trim(),'"']}):r.jsx("div",{className:"px-4 py-8 text-center text-sm text-gray-400 italic",children:"No results found"})}),r.jsx("div",{className:i("flex items-center justify-between",e==="listingDesign"?"border-t border-[#9A9A9A] bg-[#F8F8F8] px-6 py-3 text-[12px] leading-[1.2] text-[#6D6D6D]":e==="checkout"?"border-t border-[#E5E7EB] bg-white px-4 py-2.5 text-[12px] text-[#6B7280]":e==="valueGuide"?"border-t border-[#D9E6EF] bg-white px-3 py-2 text-[11px] text-[#6D6D6D]":"border-t border-gray-100 bg-white p-2.5 px-4 text-[12px] text-gray-400"),children:r.jsxs("span",{children:[b.length," options"]})})]},`${x}-${b.length}-${String(m??"")}`):null;return r.jsxs("div",{className:i("relative w-full",O),ref:k,children:[w&&r.jsx("label",{className:"mb-1.5 block text-[11px] font-bold text-gray-500",children:w}),r.jsxs("div",{className:i(e==="listingDesign"?"group flex w-full cursor-pointer items-center rounded-[12px] border border-[#9A9A9A] bg-white px-4 py-2 transition-all":e==="checkout"?"group flex w-full cursor-pointer items-center rounded-[10px] border border-[#D7DADF] bg-white px-4 py-[15p
1x] transition-all":e==="valueGuide"?"group flex w-full cursor-pointer items-center rounded-[8px] border border-[#D9E6EF] bg-[#EAF4FB] px-3 py-[10px] transition-all":"hover:border-bbb-blue group flex w-full cursor-pointer items-center rounded-lg border border-gray-200 bg-white px-3 py-2.5 transition-all",l&&(e==="listingDesign"?"border-[#7F7F7F]":e==="valueGuide"?"border-[#2456CC]":"ring-bbb-blue border-bbb-blue ring-1"),c&&"cursor-wait opacity-80",n&&"cursor-not-allowed opacity-55",R),"aria-disabled":n,onClick:()=>{if(n)return;const t=!l;p(t),t&&v?.()},children:[(e!=="listingDesign"||l&&f)&&e!=="checkout"&&e!=="valueGuide"&&r.jsx(Z,{className:e==="listingDesign"?"mr-3 size-4 flex-shrink-0 text-[#222222]":"mr-2 size-4 flex-shrink-0 text-gray-400"}),r.jsx("input",{type:"text",disabled:n,autoFocus:L,"aria-label":z??w,maxLength:H,className:i(e==="listingDesign"?"w-full cursor-pointer bg-transparent text-[14px] leading-7 outline-none":e==="checkout"?"w-full cursor-pointer bg-transparent text-[15px] font-medium text-[#171A1F] outline-none":e==="valueGuide"?"w-full cursor-pointer bg-transparent text-[13px] text-[#2B2F38] outline-none":"w-full cursor-pointer bg-transparent text-sm outline-none",F||e==="listingDesign"&&d?"text-gray-900":"placeholder:text-gray-300"),placeholder:c?e==="listingDesign"&&d?`${d}: Loading...`:"Loading...":F?"":e==="listingDesign"&&d?`${d}: ${C}`:C,value:l&&f&&!c?x:q,onChange:t=>{!f||n||(!l&&!c&&(p(!0),v?.()),h(N?N(t.target.value):t.target.value))},onClick:t=>{l&&t.stopPropagation()},readOnly:c||!f||n,"aria-haspopup":"listbox","aria-expanded":n?!1:l}),c?r.jsx(P,{className:i(e==="listingDesign"?"ml-3 h-5 w-5 text-[#222222]":e==="checkout"?"ml-3 h-4 w-4 text-[#171A1F]":e==="valueGuide"?"ml-2 h-3 w-3 text-[#586173]":"ml-2 h-3 w-3 text-gray-400")}):r.jsx(ee,{className:i(e==="listingDesign"?"ml-3 h-5 w-5 text-[#222222] transition-transform":e==="checkout"?"ml-3 h-4 w-4 text-[#171A1F] transition-transform":e==="valueGuide"?"ml-2 h-3 w-3 text-[#586173] transition-transform":"ml-2 h-3 w-3 text-gray-400 transition-transform",l&&"rotate-180")})]}),a&&j&&typeof document<"u"?V.createPortal(j,document.body):j]})}function Z({className:s}){return r.jsx("svg",{className:s,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2.5,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})})}function P({className:s}){return r.jsxs("svg",{className:i("animate-spin",s),viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[r.jsx("circle",{cx:"12",cy:"12",r:"9",stroke:"currentColor",strokeWidth:"2",opacity:"0.25"}),r.jsx("path",{d:"M21 12a9 9 0 0 0-9-9",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})]})}function ee({className:s}){return r.jsx("svg",{className:s,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2.5,d:"M19 9l-7 7-7-7"})})}export{ne as S};
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.