randmarcomps 1.83.0 → 1.85.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/randmarcomps.d.ts +9 -66
- package/dist/randmarcomps.js +915 -881
- package/dist/randmarcomps.umd.cjs +6 -6
- package/package.json +2 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(S,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("react/jsx-runtime"),require("react"),require("react-dom"),require("react-router-dom")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","react-dom","react-router-dom"],o):(S=typeof globalThis<"u"?globalThis:S||self,o(S.randmarcomps={},S.jsxRuntime,S.React,S.ReactDOM,S["react-router-dom"]))})(this,function(S,o,H,wo,Ar){"use strict";function yo(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const i=yo(H),_r=yo(wo);var Qc=Object.defineProperty,
|
|
1
|
+
(function(S,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("react/jsx-runtime"),require("react"),require("react-dom"),require("react-router-dom")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","react-dom","react-router-dom"],o):(S=typeof globalThis<"u"?globalThis:S||self,o(S.randmarcomps={},S.jsxRuntime,S.React,S.ReactDOM,S["react-router-dom"]))})(this,function(S,o,H,wo,Ar){"use strict";function yo(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const i=yo(H),_r=yo(wo);var Qc=Object.defineProperty,Zc=Object.defineProperties,Jc=Object.getOwnPropertyDescriptors,Bt=Object.getOwnPropertySymbols,xo=Object.prototype.hasOwnProperty,No=Object.prototype.propertyIsEnumerable,Co=(e,t,r)=>t in e?Qc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Rc=(e,t)=>{for(var r in t||(t={}))xo.call(t,r)&&Co(e,r,t[r]);if(Bt)for(var r of Bt(t))No.call(t,r)&&Co(e,r,t[r]);return e},el=(e,t)=>Zc(e,Jc(t)),tl=(e,t)=>{var r={};for(var n in e)xo.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Bt)for(var n of Bt(e))t.indexOf(n)<0&&No.call(e,n)&&(r[n]=e[n]);return r};function rl(e){let t=setTimeout(e,0),r=setTimeout(e,10),n=setTimeout(e,50);return[t,r,n]}function nl(e){let t=i.useRef();return i.useEffect(()=>{t.current=e}),t.current}var ol=18,So=40,al=`${So}px`,sl=["[data-lastpass-icon-root]","com-1password-button","[data-dashlanecreated]",'[style$="2147483647 !important;"]'].join(",");function il({containerRef:e,inputRef:t,pushPasswordManagerStrategy:r,isFocused:n}){let[a,s]=i.useState(!1),[c,l]=i.useState(!1),[u,d]=i.useState(!1),f=i.useMemo(()=>r==="none"?!1:(r==="increase-width"||r==="experimental-no-flickering")&&a&&c,[a,c,r]),p=i.useCallback(()=>{let h=e.current,m=t.current;if(!h||!m||u||r==="none")return;let b=h,g=b.getBoundingClientRect().left+b.offsetWidth,w=b.getBoundingClientRect().top+b.offsetHeight/2,v=g-ol,y=w;document.querySelectorAll(sl).length===0&&document.elementFromPoint(v,y)===h||(s(!0),d(!0))},[e,t,u,r]);return i.useEffect(()=>{let h=e.current;if(!h||r==="none")return;function m(){let g=window.innerWidth-h.getBoundingClientRect().right;l(g>=So)}m();let b=setInterval(m,1e3);return()=>{clearInterval(b)}},[e,r]),i.useEffect(()=>{let h=n||document.activeElement===t.current;if(r==="none"||!h)return;let m=setTimeout(p,0),b=setTimeout(p,2e3),g=setTimeout(p,5e3),w=setTimeout(()=>{d(!0)},6e3);return()=>{clearTimeout(m),clearTimeout(b),clearTimeout(g),clearTimeout(w)}},[t,n,r,p]),{hasPWMBadge:a,willPushPWMBadge:f,PWM_BADGE_SPACE_WIDTH:al}}var Eo=i.createContext({}),To=i.forwardRef((e,t)=>{var r=e,{value:n,onChange:a,maxLength:s,textAlign:c="left",pattern:l,placeholder:u,inputMode:d="numeric",onComplete:f,pushPasswordManagerStrategy:p="increase-width",pasteTransformer:h,containerClassName:m,noScriptCSSFallback:b=cl,render:g,children:w}=r,v=tl(r,["value","onChange","maxLength","textAlign","pattern","placeholder","inputMode","onComplete","pushPasswordManagerStrategy","pasteTransformer","containerClassName","noScriptCSSFallback","render","children"]),y,x,N,E,C;let[T,$]=i.useState(typeof v.defaultValue=="string"?v.defaultValue:""),O=n??T,B=nl(O),K=i.useCallback(W=>{a==null||a(W),$(W)},[a]),F=i.useMemo(()=>l?typeof l=="string"?new RegExp(l):l:null,[l]),L=i.useRef(null),P=i.useRef(null),V=i.useRef({value:O,onChange:K,isIOS:typeof window<"u"&&((x=(y=window==null?void 0:window.CSS)==null?void 0:y.supports)==null?void 0:x.call(y,"-webkit-touch-callout","none"))}),A=i.useRef({prev:[(N=L.current)==null?void 0:N.selectionStart,(E=L.current)==null?void 0:E.selectionEnd,(C=L.current)==null?void 0:C.selectionDirection]});i.useImperativeHandle(t,()=>L.current,[]),i.useEffect(()=>{let W=L.current,j=P.current;if(!W||!j)return;V.current.value!==W.value&&V.current.onChange(W.value),A.current.prev=[W.selectionStart,W.selectionEnd,W.selectionDirection];function ue(){if(document.activeElement!==W){ee(null),ne(null);return}let R=W.selectionStart,we=W.selectionEnd,Pr=W.selectionDirection,Ae=W.maxLength,et=W.value,$e=A.current.prev,Ke=-1,Ye=-1,tt;if(et.length!==0&&R!==null&&we!==null){let Ig=R===we,kg=R===et.length&&et.length<Ae;if(Ig&&!kg){let rt=R;if(rt===0)Ke=0,Ye=1,tt="forward";else if(rt===Ae)Ke=rt-1,Ye=rt,tt="backward";else if(Ae>1&&et.length>1){let bo=0;if($e[0]!==null&&$e[1]!==null){tt=rt<$e[1]?"backward":"forward";let Og=$e[0]===$e[1]&&$e[0]<Ae;tt==="backward"&&!Og&&(bo=-1)}Ke=bo+rt,Ye=bo+rt+1}}Ke!==-1&&Ye!==-1&&Ke!==Ye&&L.current.setSelectionRange(Ke,Ye,tt)}let qc=Ke!==-1?Ke:R,Xc=Ye!==-1?Ye:we,Dg=tt??Pr;ee(qc),ne(Xc),A.current.prev=[qc,Xc,Dg]}if(document.addEventListener("selectionchange",ue,{capture:!0}),ue(),document.activeElement===W&&Y(!0),!document.getElementById("input-otp-style")){let R=document.createElement("style");if(R.id="input-otp-style",document.head.appendChild(R),R.sheet){let we="background: transparent !important; color: transparent !important; border-color: transparent !important; opacity: 0 !important; box-shadow: none !important; -webkit-box-shadow: none !important; -webkit-text-fill-color: transparent !important;";xt(R.sheet,"[data-input-otp]::selection { background: transparent !important; color: transparent !important; }"),xt(R.sheet,`[data-input-otp]:autofill { ${we} }`),xt(R.sheet,`[data-input-otp]:-webkit-autofill { ${we} }`),xt(R.sheet,"@supports (-webkit-touch-callout: none) { [data-input-otp] { letter-spacing: -.6em !important; font-weight: 100 !important; font-stretch: ultra-condensed; font-optical-sizing: none !important; left: -1px !important; right: 1px !important; } }"),xt(R.sheet,"[data-input-otp] + * { pointer-events: all !important; }")}}let ge=()=>{j&&j.style.setProperty("--root-height",`${W.clientHeight}px`)};ge();let ve=new ResizeObserver(ge);return ve.observe(W),()=>{document.removeEventListener("selectionchange",ue,{capture:!0}),ve.disconnect()}},[]);let[X,D]=i.useState(!1),[M,Y]=i.useState(!1),[Q,ee]=i.useState(null),[te,ne]=i.useState(null);i.useEffect(()=>{rl(()=>{var W,j,ue,ge;(W=L.current)==null||W.dispatchEvent(new Event("input"));let ve=(j=L.current)==null?void 0:j.selectionStart,R=(ue=L.current)==null?void 0:ue.selectionEnd,we=(ge=L.current)==null?void 0:ge.selectionDirection;ve!==null&&R!==null&&(ee(ve),ne(R),A.current.prev=[ve,R,we])})},[O,M]),i.useEffect(()=>{B!==void 0&&O!==B&&B.length<s&&O.length===s&&(f==null||f(O))},[s,f,B,O]);let se=il({containerRef:P,inputRef:L,pushPasswordManagerStrategy:p,isFocused:M}),le=i.useCallback(W=>{let j=W.currentTarget.value.slice(0,s);if(j.length>0&&F&&!F.test(j)){W.preventDefault();return}typeof B=="string"&&j.length<B.length&&document.dispatchEvent(new Event("selectionchange")),K(j)},[s,K,B,F]),ae=i.useCallback(()=>{var W;if(L.current){let j=Math.min(L.current.value.length,s-1),ue=L.current.value.length;(W=L.current)==null||W.setSelectionRange(j,ue),ee(j),ne(ue)}Y(!0)},[s]),Me=i.useCallback(W=>{var j,ue;let ge=L.current;if(!h&&(!V.current.isIOS||!W.clipboardData||!ge))return;let ve=W.clipboardData.getData("text/plain"),R=h?h(ve):ve;W.preventDefault();let we=(j=L.current)==null?void 0:j.selectionStart,Pr=(ue=L.current)==null?void 0:ue.selectionEnd,Ae=(we!==Pr?O.slice(0,we)+R+O.slice(Pr):O.slice(0,we)+R+O.slice(we)).slice(0,s);if(Ae.length>0&&F&&!F.test(Ae))return;ge.value=Ae,K(Ae);let et=Math.min(Ae.length,s-1),$e=Ae.length;ge.setSelectionRange(et,$e),ee(et),ne($e)},[s,K,F,O]),de=i.useMemo(()=>({position:"relative",cursor:v.disabled?"default":"text",userSelect:"none",WebkitUserSelect:"none",pointerEvents:"none"}),[v.disabled]),Pe=i.useMemo(()=>({position:"absolute",inset:0,width:se.willPushPWMBadge?`calc(100% + ${se.PWM_BADGE_SPACE_WIDTH})`:"100%",clipPath:se.willPushPWMBadge?`inset(0 ${se.PWM_BADGE_SPACE_WIDTH} 0 0)`:void 0,height:"100%",display:"flex",textAlign:c,opacity:"1",color:"transparent",pointerEvents:"all",background:"transparent",caretColor:"transparent",border:"0 solid transparent",outline:"0 solid transparent",boxShadow:"none",lineHeight:"1",letterSpacing:"-.5em",fontSize:"var(--root-height)",fontFamily:"monospace",fontVariantNumeric:"tabular-nums"}),[se.PWM_BADGE_SPACE_WIDTH,se.willPushPWMBadge,c]),G=i.useMemo(()=>i.createElement("input",el(Rc({autoComplete:v.autoComplete||"one-time-code"},v),{"data-input-otp":!0,"data-input-otp-placeholder-shown":O.length===0||void 0,"data-input-otp-mss":Q,"data-input-otp-mse":te,inputMode:d,pattern:F==null?void 0:F.source,"aria-placeholder":u,style:Pe,maxLength:s,value:O,ref:L,onPaste:W=>{var j;Me(W),(j=v.onPaste)==null||j.call(v,W)},onChange:le,onMouseOver:W=>{var j;D(!0),(j=v.onMouseOver)==null||j.call(v,W)},onMouseLeave:W=>{var j;D(!1),(j=v.onMouseLeave)==null||j.call(v,W)},onFocus:W=>{var j;ae(),(j=v.onFocus)==null||j.call(v,W)},onBlur:W=>{var j;Y(!1),(j=v.onBlur)==null||j.call(v,W)}})),[le,ae,Me,d,Pe,s,te,Q,v,F==null?void 0:F.source,O]),J=i.useMemo(()=>({slots:Array.from({length:s}).map((W,j)=>{var ue;let ge=M&&Q!==null&&te!==null&&(Q===te&&j===Q||j>=Q&&j<te),ve=O[j]!==void 0?O[j]:null,R=O[0]!==void 0?null:(ue=u==null?void 0:u[j])!=null?ue:null;return{char:ve,placeholderChar:R,isActive:ge,hasFakeCaret:ge&&ve===null}}),isFocused:M,isHovering:!v.disabled&&X}),[M,X,s,te,Q,v.disabled,O]),he=i.useMemo(()=>g?g(J):i.createElement(Eo.Provider,{value:J},w),[w,J,g]);return i.createElement(i.Fragment,null,b!==null&&i.createElement("noscript",null,i.createElement("style",null,b)),i.createElement("div",{ref:P,"data-input-otp-container":!0,style:de,className:m},he,i.createElement("div",{style:{position:"absolute",inset:0,pointerEvents:"none"}},G)))});To.displayName="Input";function xt(e,t){try{e.insertRule(t)}catch{console.error("input-otp could not insert CSS rule:",t)}}var cl=`
|
|
2
2
|
[data-input-otp] {
|
|
3
3
|
--nojs-bg: white !important;
|
|
4
4
|
--nojs-fg: black !important;
|
|
@@ -147,7 +147,7 @@
|
|
|
147
147
|
*
|
|
148
148
|
* This source code is licensed under the ISC license.
|
|
149
149
|
* See the LICENSE file in the root directory of this source tree.
|
|
150
|
-
*/const Ir=re("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function Io(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(r=Io(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function ko(){for(var e,t,r=0,n="",a=arguments.length;r<a;r++)(e=arguments[r])&&(t=Io(e))&&(n&&(n+=" "),n+=t);return n}const kr="-",Pl=e=>{const t=_l(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:c=>{const l=c.split(kr);return l[0]===""&&l.length!==1&&l.shift(),Oo(l,t)||Al(c)},getConflictingClassGroupIds:(c,l)=>{const u=r[c]||[];return l&&n[c]?[...u,...n[c]]:u}}},Oo=(e,t)=>{var c;if(e.length===0)return t.classGroupId;const r=e[0],n=t.nextPart.get(r),a=n?Oo(e.slice(1),n):void 0;if(a)return a;if(t.validators.length===0)return;const s=e.join(kr);return(c=t.validators.find(({validator:l})=>l(s)))==null?void 0:c.classGroupId},Lo=/^\[(.+)\]$/,Al=e=>{if(Lo.test(e)){const t=Lo.exec(e)[1],r=t==null?void 0:t.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},_l=e=>{const{theme:t,classGroups:r}=e,n={nextPart:new Map,validators:[]};for(const a in r)Or(r[a],n,a,t);return n},Or=(e,t,r,n)=>{e.forEach(a=>{if(typeof a=="string"){const s=a===""?t:Fo(t,a);s.classGroupId=r;return}if(typeof a=="function"){if(Dl(a)){Or(a(n),t,r,n);return}t.validators.push({validator:a,classGroupId:r});return}Object.entries(a).forEach(([s,c])=>{Or(c,Fo(t,s),r,n)})})},Fo=(e,t)=>{let r=e;return t.split(kr).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r},Dl=e=>e.isThemeGetter,Il=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,n=new Map;const a=(s,c)=>{r.set(s,c),t++,t>e&&(t=0,n=r,r=new Map)};return{get(s){let c=r.get(s);if(c!==void 0)return c;if((c=n.get(s))!==void 0)return a(s,c),c},set(s,c){r.has(s)?r.set(s,c):a(s,c)}}},Lr="!",Fr=":",kl=Fr.length,Ol=e=>{const{prefix:t,experimentalParseClassName:r}=e;let n=a=>{const s=[];let c=0,l=0,u=0,d;for(let b=0;b<a.length;b++){let g=a[b];if(c===0&&l===0){if(g===Fr){s.push(a.slice(u,b)),u=b+kl;continue}if(g==="/"){d=b;continue}}g==="["?c++:g==="]"?c--:g==="("?l++:g===")"&&l--}const f=s.length===0?a:a.substring(u),p=Ll(f),h=p!==f,m=d&&d>u?d-u:void 0;return{modifiers:s,hasImportantModifier:h,baseClassName:p,maybePostfixModifierPosition:m}};if(t){const a=t+Fr,s=n;n=c=>c.startsWith(a)?s(c.substring(a.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:c,maybePostfixModifierPosition:void 0}}if(r){const a=n;n=s=>r({className:s,parseClassName:a})}return n},Ll=e=>e.endsWith(Lr)?e.substring(0,e.length-1):e.startsWith(Lr)?e.substring(1):e,Fl=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(n=>[n,!0]));return n=>{if(n.length<=1)return n;const a=[];let s=[];return n.forEach(c=>{c[0]==="["||t[c]?(a.push(...s.sort(),c),s=[]):s.push(c)}),a.push(...s.sort()),a}},$l=e=>({cache:Il(e.cacheSize),parseClassName:Ol(e),sortModifiers:Fl(e),...Pl(e)}),zl=/\s+/,Bl=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:a,sortModifiers:s}=t,c=[],l=e.trim().split(zl);let u="";for(let d=l.length-1;d>=0;d-=1){const f=l[d],{isExternal:p,modifiers:h,hasImportantModifier:m,baseClassName:b,maybePostfixModifierPosition:g}=r(f);if(p){u=f+(u.length>0?" "+u:u);continue}let w=!!g,v=n(w?b.substring(0,g):b);if(!v){if(!w){u=f+(u.length>0?" "+u:u);continue}if(v=n(b),!v){u=f+(u.length>0?" "+u:u);continue}w=!1}const y=s(h).join(":"),x=m?y+Lr:y,N=x+v;if(c.includes(N))continue;c.push(N);const E=a(v,w);for(let C=0;C<E.length;++C){const T=E[C];c.push(x+T)}u=f+(u.length>0?" "+u:u)}return u};function Wl(){let e=0,t,r,n="";for(;e<arguments.length;)(t=arguments[e++])&&(r=$o(t))&&(n&&(n+=" "),n+=r);return n}const $o=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=$o(e[n]))&&(r&&(r+=" "),r+=t);return r};function Vl(e,...t){let r,n,a,s=c;function c(u){const d=t.reduce((f,p)=>p(f),e());return r=$l(d),n=r.cache.get,a=r.cache.set,s=l,l(u)}function l(u){const d=n(u);if(d)return d;const f=Bl(u,r);return a(u,f),f}return function(){return s(Wl.apply(null,arguments))}}const ie=e=>{const t=r=>r[e]||[];return t.isThemeGetter=!0,t},zo=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Bo=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Gl=/^\d+\/\d+$/,Ul=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,jl=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Hl=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Kl=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Yl=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,nt=e=>Gl.test(e),Y=e=>!!e&&!Number.isNaN(Number(e)),qe=e=>!!e&&Number.isInteger(Number(e)),Wo=e=>e.endsWith("%")&&Y(e.slice(0,-1)),ze=e=>Ul.test(e),ql=()=>!0,Xl=e=>jl.test(e)&&!Hl.test(e),$r=()=>!1,Ql=e=>Kl.test(e),Rl=e=>Yl.test(e),Zl=e=>!I(e)&&!k(e),Jl=e=>ot(e,Uo,$r),I=e=>zo.test(e),Xe=e=>ot(e,jo,Xl),zr=e=>ot(e,dd,Y),ed=e=>ot(e,Vo,$r),td=e=>ot(e,Go,Rl),rd=e=>ot(e,$r,Ql),k=e=>Bo.test(e),Wt=e=>at(e,jo),nd=e=>at(e,ud),od=e=>at(e,Vo),ad=e=>at(e,Uo),sd=e=>at(e,Go),id=e=>at(e,fd,!0),ot=(e,t,r)=>{const n=zo.exec(e);return n?n[1]?t(n[1]):r(n[2]):!1},at=(e,t,r=!1)=>{const n=Bo.exec(e);return n?n[1]?t(n[1]):r:!1},Vo=e=>e==="position",cd=new Set(["image","url"]),Go=e=>cd.has(e),ld=new Set(["length","size","percentage"]),Uo=e=>ld.has(e),jo=e=>e==="length",dd=e=>e==="number",ud=e=>e==="family-name",fd=e=>e==="shadow",pd=Vl(()=>{const e=ie("color"),t=ie("font"),r=ie("text"),n=ie("font-weight"),a=ie("tracking"),s=ie("leading"),c=ie("breakpoint"),l=ie("container"),u=ie("spacing"),d=ie("radius"),f=ie("shadow"),p=ie("inset-shadow"),h=ie("drop-shadow"),m=ie("blur"),b=ie("perspective"),g=ie("aspect"),w=ie("ease"),v=ie("animate"),y=()=>["auto","avoid","all","avoid-page","page","left","right","column"],x=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],N=()=>["auto","hidden","clip","visible","scroll"],E=()=>["auto","contain","none"],C=()=>[k,I,u],T=()=>[nt,"full","auto",...C()],F=()=>[qe,"none","subgrid",k,I],O=()=>["auto",{span:["full",qe,k,I]},k,I],B=()=>[qe,"auto",k,I],z=()=>["auto","min","max","fr",k,I],W=()=>["start","end","center","between","around","evenly","stretch","baseline"],L=()=>["start","end","center","stretch"],P=()=>["auto",...C()],G=()=>[nt,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...C()],A=()=>[e,k,I],q=()=>[Wo,Xe],D=()=>["","none","full",d,k,I],M=()=>["",Y,Wt,Xe],K=()=>["solid","dashed","dotted","double"],X=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ee=()=>["","none",m,k,I],te=()=>["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",k,I],ne=()=>["none",Y,k,I],se=()=>["none",Y,k,I],le=()=>[Y,k,I],ae=()=>[nt,"full",...C()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[ze],breakpoint:[ze],color:[ql],container:[ze],"drop-shadow":[ze],ease:["in","out","in-out"],font:[Zl],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[ze],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[ze],shadow:[ze],spacing:["px",Y],text:[ze],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",nt,I,k,g]}],container:["container"],columns:[{columns:[Y,I,k,l]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...x(),I,k]}],overflow:[{overflow:N()}],"overflow-x":[{"overflow-x":N()}],"overflow-y":[{"overflow-y":N()}],overscroll:[{overscroll:E()}],"overscroll-x":[{"overscroll-x":E()}],"overscroll-y":[{"overscroll-y":E()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{start:T()}],end:[{end:T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:["visible","invisible","collapse"],z:[{z:[qe,"auto",k,I]}],basis:[{basis:[nt,"full","auto",l,...C()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Y,nt,"auto","initial","none",I]}],grow:[{grow:["",Y,k,I]}],shrink:[{shrink:["",Y,k,I]}],order:[{order:[qe,"first","last","none",k,I]}],"grid-cols":[{"grid-cols":F()}],"col-start-end":[{col:O()}],"col-start":[{"col-start":B()}],"col-end":[{"col-end":B()}],"grid-rows":[{"grid-rows":F()}],"row-start-end":[{row:O()}],"row-start":[{"row-start":B()}],"row-end":[{"row-end":B()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":z()}],"auto-rows":[{"auto-rows":z()}],gap:[{gap:C()}],"gap-x":[{"gap-x":C()}],"gap-y":[{"gap-y":C()}],"justify-content":[{justify:[...W(),"normal"]}],"justify-items":[{"justify-items":[...L(),"normal"]}],"justify-self":[{"justify-self":["auto",...L()]}],"align-content":[{content:["normal",...W()]}],"align-items":[{items:[...L(),"baseline"]}],"align-self":[{self:["auto",...L(),"baseline"]}],"place-content":[{"place-content":W()}],"place-items":[{"place-items":[...L(),"baseline"]}],"place-self":[{"place-self":["auto",...L()]}],p:[{p:C()}],px:[{px:C()}],py:[{py:C()}],ps:[{ps:C()}],pe:[{pe:C()}],pt:[{pt:C()}],pr:[{pr:C()}],pb:[{pb:C()}],pl:[{pl:C()}],m:[{m:P()}],mx:[{mx:P()}],my:[{my:P()}],ms:[{ms:P()}],me:[{me:P()}],mt:[{mt:P()}],mr:[{mr:P()}],mb:[{mb:P()}],ml:[{ml:P()}],"space-x":[{"space-x":C()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":C()}],"space-y-reverse":["space-y-reverse"],size:[{size:G()}],w:[{w:[l,"screen",...G()]}],"min-w":[{"min-w":[l,"screen","none",...G()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[c]},...G()]}],h:[{h:["screen",...G()]}],"min-h":[{"min-h":["screen","none",...G()]}],"max-h":[{"max-h":["screen",...G()]}],"font-size":[{text:["base",r,Wt,Xe]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,k,zr]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Wo,I]}],"font-family":[{font:[nd,I,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[a,k,I]}],"line-clamp":[{"line-clamp":[Y,"none",k,zr]}],leading:[{leading:[s,...C()]}],"list-image":[{"list-image":["none",k,I]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",k,I]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:A()}],"text-color":[{text:A()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...K(),"wavy"]}],"text-decoration-thickness":[{decoration:[Y,"from-font","auto",k,Xe]}],"text-decoration-color":[{decoration:A()}],"underline-offset":[{"underline-offset":[Y,"auto",k,I]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:C()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",k,I]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",k,I]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...x(),od,ed]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","space","round"]}]}],"bg-size":[{bg:["auto","cover","contain",ad,Jl]}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},qe,k,I],radial:["",k,I],conic:[qe,k,I]},sd,td]}],"bg-color":[{bg:A()}],"gradient-from-pos":[{from:q()}],"gradient-via-pos":[{via:q()}],"gradient-to-pos":[{to:q()}],"gradient-from":[{from:A()}],"gradient-via":[{via:A()}],"gradient-to":[{to:A()}],rounded:[{rounded:D()}],"rounded-s":[{"rounded-s":D()}],"rounded-e":[{"rounded-e":D()}],"rounded-t":[{"rounded-t":D()}],"rounded-r":[{"rounded-r":D()}],"rounded-b":[{"rounded-b":D()}],"rounded-l":[{"rounded-l":D()}],"rounded-ss":[{"rounded-ss":D()}],"rounded-se":[{"rounded-se":D()}],"rounded-ee":[{"rounded-ee":D()}],"rounded-es":[{"rounded-es":D()}],"rounded-tl":[{"rounded-tl":D()}],"rounded-tr":[{"rounded-tr":D()}],"rounded-br":[{"rounded-br":D()}],"rounded-bl":[{"rounded-bl":D()}],"border-w":[{border:M()}],"border-w-x":[{"border-x":M()}],"border-w-y":[{"border-y":M()}],"border-w-s":[{"border-s":M()}],"border-w-e":[{"border-e":M()}],"border-w-t":[{"border-t":M()}],"border-w-r":[{"border-r":M()}],"border-w-b":[{"border-b":M()}],"border-w-l":[{"border-l":M()}],"divide-x":[{"divide-x":M()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":M()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...K(),"hidden","none"]}],"divide-style":[{divide:[...K(),"hidden","none"]}],"border-color":[{border:A()}],"border-color-x":[{"border-x":A()}],"border-color-y":[{"border-y":A()}],"border-color-s":[{"border-s":A()}],"border-color-e":[{"border-e":A()}],"border-color-t":[{"border-t":A()}],"border-color-r":[{"border-r":A()}],"border-color-b":[{"border-b":A()}],"border-color-l":[{"border-l":A()}],"divide-color":[{divide:A()}],"outline-style":[{outline:[...K(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Y,k,I]}],"outline-w":[{outline:["",Y,Wt,Xe]}],"outline-color":[{outline:[e]}],shadow:[{shadow:["","none",f,id,rd]}],"shadow-color":[{shadow:A()}],"inset-shadow":[{"inset-shadow":["none",k,I,p]}],"inset-shadow-color":[{"inset-shadow":A()}],"ring-w":[{ring:M()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:A()}],"ring-offset-w":[{"ring-offset":[Y,Xe]}],"ring-offset-color":[{"ring-offset":A()}],"inset-ring-w":[{"inset-ring":M()}],"inset-ring-color":[{"inset-ring":A()}],opacity:[{opacity:[Y,k,I]}],"mix-blend":[{"mix-blend":[...X(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":X()}],filter:[{filter:["","none",k,I]}],blur:[{blur:ee()}],brightness:[{brightness:[Y,k,I]}],contrast:[{contrast:[Y,k,I]}],"drop-shadow":[{"drop-shadow":["","none",h,k,I]}],grayscale:[{grayscale:["",Y,k,I]}],"hue-rotate":[{"hue-rotate":[Y,k,I]}],invert:[{invert:["",Y,k,I]}],saturate:[{saturate:[Y,k,I]}],sepia:[{sepia:["",Y,k,I]}],"backdrop-filter":[{"backdrop-filter":["","none",k,I]}],"backdrop-blur":[{"backdrop-blur":ee()}],"backdrop-brightness":[{"backdrop-brightness":[Y,k,I]}],"backdrop-contrast":[{"backdrop-contrast":[Y,k,I]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Y,k,I]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Y,k,I]}],"backdrop-invert":[{"backdrop-invert":["",Y,k,I]}],"backdrop-opacity":[{"backdrop-opacity":[Y,k,I]}],"backdrop-saturate":[{"backdrop-saturate":[Y,k,I]}],"backdrop-sepia":[{"backdrop-sepia":["",Y,k,I]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":C()}],"border-spacing-x":[{"border-spacing-x":C()}],"border-spacing-y":[{"border-spacing-y":C()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",k,I]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Y,"initial",k,I]}],ease:[{ease:["linear","initial",w,k,I]}],delay:[{delay:[Y,k,I]}],animate:[{animate:["none",v,k,I]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[b,k,I]}],"perspective-origin":[{"perspective-origin":te()}],rotate:[{rotate:ne()}],"rotate-x":[{"rotate-x":ne()}],"rotate-y":[{"rotate-y":ne()}],"rotate-z":[{"rotate-z":ne()}],scale:[{scale:se()}],"scale-x":[{"scale-x":se()}],"scale-y":[{"scale-y":se()}],"scale-z":[{"scale-z":se()}],"scale-3d":["scale-3d"],skew:[{skew:le()}],"skew-x":[{"skew-x":le()}],"skew-y":[{"skew-y":le()}],transform:[{transform:[k,I,"","none","gpu","cpu"]}],"transform-origin":[{origin:te()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ae()}],"translate-x":[{"translate-x":ae()}],"translate-y":[{"translate-y":ae()}],"translate-z":[{"translate-z":ae()}],"translate-none":["translate-none"],accent:[{accent:A()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:A()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",k,I]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":C()}],"scroll-mx":[{"scroll-mx":C()}],"scroll-my":[{"scroll-my":C()}],"scroll-ms":[{"scroll-ms":C()}],"scroll-me":[{"scroll-me":C()}],"scroll-mt":[{"scroll-mt":C()}],"scroll-mr":[{"scroll-mr":C()}],"scroll-mb":[{"scroll-mb":C()}],"scroll-ml":[{"scroll-ml":C()}],"scroll-p":[{"scroll-p":C()}],"scroll-px":[{"scroll-px":C()}],"scroll-py":[{"scroll-py":C()}],"scroll-ps":[{"scroll-ps":C()}],"scroll-pe":[{"scroll-pe":C()}],"scroll-pt":[{"scroll-pt":C()}],"scroll-pr":[{"scroll-pr":C()}],"scroll-pb":[{"scroll-pb":C()}],"scroll-pl":[{"scroll-pl":C()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",k,I]}],fill:[{fill:["none",...A()]}],"stroke-w":[{stroke:[Y,Wt,Xe,zr]}],stroke:[{stroke:["none",...A()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["before","after","placeholder","file","marker","selection","first-line","first-letter","backdrop","*","**"]}});function _(...e){return pd(ko(e))}function hd({className:e,containerClassName:t,...r}){return o.jsx(To,{"data-slot":"input-otp",containerClassName:_("flex items-center gap-2 has-disabled:opacity-50",t),className:_("disabled:cursor-not-allowed",e),...r})}function gd({className:e,...t}){return o.jsx("div",{"data-slot":"input-otp-group",className:_("flex items-center",e),...t})}function vd({index:e,className:t,...r}){const n=i.useContext(Eo),{char:a,hasFakeCaret:s,isActive:c}=(n==null?void 0:n.slots[e])??{};return o.jsxs("div",{"data-slot":"input-otp-slot","data-active":c,className:_("border-input data-[active=true]:border-ring data-[active=true]:ring-ring/50 data-[active=true]:aria-invalid:ring-destructive/20 dark:data-[active=true]:aria-invalid:ring-destructive/40 aria-invalid:border-destructive data-[active=true]:aria-invalid:border-destructive relative flex h-9 w-9 items-center justify-center border-y border-r text-sm shadow-xs transition-all outline-none first:rounded-l-md first:border-l last:rounded-r-md data-[active=true]:z-10 data-[active=true]:ring-[3px]",t),...r,children:[a,s&&o.jsx("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center",children:o.jsx("div",{className:"animate-caret-blink bg-foreground h-4 w-px duration-1000"})})]})}function md({...e}){return o.jsx("div",{"data-slot":"input-otp-separator",role:"separator",...e,children:o.jsx(yl,{})})}function $(e,t,{checkForDefaultPrevented:r=!0}={}){return function(a){if(e==null||e(a),r===!1||!a.defaultPrevented)return t==null?void 0:t(a)}}function Ho(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Vt(...e){return t=>{let r=!1;const n=e.map(a=>{const s=Ho(a,t);return!r&&typeof s=="function"&&(r=!0),s});if(r)return()=>{for(let a=0;a<n.length;a++){const s=n[a];typeof s=="function"?s():Ho(e[a],null)}}}}function oe(...e){return i.useCallback(Vt(...e),e)}function bd(e,t){const r=i.createContext(t),n=s=>{const{children:c,...l}=s,u=i.useMemo(()=>l,Object.values(l));return o.jsx(r.Provider,{value:u,children:c})};n.displayName=e+"Provider";function a(s){const c=i.useContext(r);if(c)return c;if(t!==void 0)return t;throw new Error(`\`${s}\` must be used within \`${e}\``)}return[n,a]}function Be(e,t=[]){let r=[];function n(s,c){const l=i.createContext(c),u=r.length;r=[...r,c];const d=p=>{var v;const{scope:h,children:m,...b}=p,g=((v=h==null?void 0:h[e])==null?void 0:v[u])||l,w=i.useMemo(()=>b,Object.values(b));return o.jsx(g.Provider,{value:w,children:m})};d.displayName=s+"Provider";function f(p,h){var g;const m=((g=h==null?void 0:h[e])==null?void 0:g[u])||l,b=i.useContext(m);if(b)return b;if(c!==void 0)return c;throw new Error(`\`${p}\` must be used within \`${s}\``)}return[d,f]}const a=()=>{const s=r.map(c=>i.createContext(c));return function(l){const u=(l==null?void 0:l[e])||s;return i.useMemo(()=>({[`__scope${e}`]:{...l,[e]:u}}),[l,u])}};return a.scopeName=e,[n,wd(a,...t)]}function wd(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(s){const c=n.reduce((l,{useScope:u,scopeName:d})=>{const p=u(s)[`__scope${d}`];return{...l,...p}},{});return i.useMemo(()=>({[`__scope${t.scopeName}`]:c}),[c])}};return r.scopeName=t.scopeName,r}var We=globalThis!=null&&globalThis.document?i.useLayoutEffect:()=>{},yd=i.useId||(()=>{}),xd=0;function Oe(e){const[t,r]=i.useState(yd());return We(()=>{r(n=>n??String(xd++))},[e]),t?`radix-${t}`:""}function fe(e){const t=i.useRef(e);return i.useEffect(()=>{t.current=e}),i.useMemo(()=>(...r)=>{var n;return(n=t.current)==null?void 0:n.call(t,...r)},[])}function st({prop:e,defaultProp:t,onChange:r=()=>{}}){const[n,a]=Nd({defaultProp:t,onChange:r}),s=e!==void 0,c=s?e:n,l=fe(r),u=i.useCallback(d=>{if(s){const p=typeof d=="function"?d(e):d;p!==e&&l(p)}else a(d)},[s,e,a,l]);return[c,u]}function Nd({defaultProp:e,onChange:t}){const r=i.useState(e),[n]=r,a=i.useRef(n),s=fe(t);return i.useEffect(()=>{a.current!==n&&(s(n),a.current=n)},[n,a,s]),r}var ye=i.forwardRef((e,t)=>{const{children:r,...n}=e,a=i.Children.toArray(r),s=a.find(Cd);if(s){const c=s.props.children,l=a.map(u=>u===s?i.Children.count(c)>1?i.Children.only(null):i.isValidElement(c)?c.props.children:null:u);return o.jsx(Br,{...n,ref:t,children:i.isValidElement(c)?i.cloneElement(c,void 0,l):null})}return o.jsx(Br,{...n,ref:t,children:r})});ye.displayName="Slot";var Br=i.forwardRef((e,t)=>{const{children:r,...n}=e;if(i.isValidElement(r)){const a=Ed(r),s=Sd(n,r.props);return r.type!==i.Fragment&&(s.ref=t?Vt(t,a):a),i.cloneElement(r,s)}return i.Children.count(r)>1?i.Children.only(null):null});Br.displayName="SlotClone";var Ko=({children:e})=>o.jsx(o.Fragment,{children:e});function Cd(e){return i.isValidElement(e)&&e.type===Ko}function Sd(e,t){const r={...t};for(const n in t){const a=e[n],s=t[n];/^on[A-Z]/.test(n)?a&&s?r[n]=(...l)=>{s(...l),a(...l)}:a&&(r[n]=a):n==="style"?r[n]={...a,...s}:n==="className"&&(r[n]=[a,s].filter(Boolean).join(" "))}return{...e,...r}}function Ed(e){var n,a;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var Td=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Q=Td.reduce((e,t)=>{const r=i.forwardRef((n,a)=>{const{asChild:s,...c}=n,l=s?ye:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),o.jsx(l,{...c,ref:a})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Wr(e,t){e&&_r.flushSync(()=>e.dispatchEvent(t))}function Md(e,t=globalThis==null?void 0:globalThis.document){const r=fe(e);i.useEffect(()=>{const n=a=>{a.key==="Escape"&&r(a)};return t.addEventListener("keydown",n,{capture:!0}),()=>t.removeEventListener("keydown",n,{capture:!0})},[r,t])}var Pd="DismissableLayer",Vr="dismissableLayer.update",Ad="dismissableLayer.pointerDownOutside",_d="dismissableLayer.focusOutside",Yo,qo=i.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),yt=i.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:a,onFocusOutside:s,onInteractOutside:c,onDismiss:l,...u}=e,d=i.useContext(qo),[f,p]=i.useState(null),h=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,m]=i.useState({}),b=oe(t,T=>p(T)),g=Array.from(d.layers),[w]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),v=g.indexOf(w),y=f?g.indexOf(f):-1,x=d.layersWithOutsidePointerEventsDisabled.size>0,N=y>=v,E=Id(T=>{const F=T.target,O=[...d.branches].some(B=>B.contains(F));!N||O||(a==null||a(T),c==null||c(T),T.defaultPrevented||l==null||l())},h),C=kd(T=>{const F=T.target;[...d.branches].some(B=>B.contains(F))||(s==null||s(T),c==null||c(T),T.defaultPrevented||l==null||l())},h);return Md(T=>{y===d.layers.size-1&&(n==null||n(T),!T.defaultPrevented&&l&&(T.preventDefault(),l()))},h),i.useEffect(()=>{if(f)return r&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(Yo=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(f)),d.layers.add(f),Qo(),()=>{r&&d.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=Yo)}},[f,h,r,d]),i.useEffect(()=>()=>{f&&(d.layers.delete(f),d.layersWithOutsidePointerEventsDisabled.delete(f),Qo())},[f,d]),i.useEffect(()=>{const T=()=>m({});return document.addEventListener(Vr,T),()=>document.removeEventListener(Vr,T)},[]),o.jsx(Q.div,{...u,ref:b,style:{pointerEvents:x?N?"auto":"none":void 0,...e.style},onFocusCapture:$(e.onFocusCapture,C.onFocusCapture),onBlurCapture:$(e.onBlurCapture,C.onBlurCapture),onPointerDownCapture:$(e.onPointerDownCapture,E.onPointerDownCapture)})});yt.displayName=Pd;var Dd="DismissableLayerBranch",Xo=i.forwardRef((e,t)=>{const r=i.useContext(qo),n=i.useRef(null),a=oe(t,n);return i.useEffect(()=>{const s=n.current;if(s)return r.branches.add(s),()=>{r.branches.delete(s)}},[r.branches]),o.jsx(Q.div,{...e,ref:a})});Xo.displayName=Dd;function Id(e,t=globalThis==null?void 0:globalThis.document){const r=fe(e),n=i.useRef(!1),a=i.useRef(()=>{});return i.useEffect(()=>{const s=l=>{if(l.target&&!n.current){let u=function(){Ro(Ad,r,d,{discrete:!0})};const d={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",a.current),a.current=u,t.addEventListener("click",a.current,{once:!0})):u()}else t.removeEventListener("click",a.current);n.current=!1},c=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(c),t.removeEventListener("pointerdown",s),t.removeEventListener("click",a.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}function kd(e,t=globalThis==null?void 0:globalThis.document){const r=fe(e),n=i.useRef(!1);return i.useEffect(()=>{const a=s=>{s.target&&!n.current&&Ro(_d,r,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",a),()=>t.removeEventListener("focusin",a)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function Qo(){const e=new CustomEvent(Vr);document.dispatchEvent(e)}function Ro(e,t,r,{discrete:n}){const a=r.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&a.addEventListener(e,t,{once:!0}),n?Wr(a,s):a.dispatchEvent(s)}var Od=yt,Ld=Xo,Gr="focusScope.autoFocusOnMount",Ur="focusScope.autoFocusOnUnmount",Zo={bubbles:!1,cancelable:!0},Fd="FocusScope",jr=i.forwardRef((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:a,onUnmountAutoFocus:s,...c}=e,[l,u]=i.useState(null),d=fe(a),f=fe(s),p=i.useRef(null),h=oe(t,g=>u(g)),m=i.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;i.useEffect(()=>{if(n){let g=function(x){if(m.paused||!l)return;const N=x.target;l.contains(N)?p.current=N:Ve(p.current,{select:!0})},w=function(x){if(m.paused||!l)return;const N=x.relatedTarget;N!==null&&(l.contains(N)||Ve(p.current,{select:!0}))},v=function(x){if(document.activeElement===document.body)for(const E of x)E.removedNodes.length>0&&Ve(l)};document.addEventListener("focusin",g),document.addEventListener("focusout",w);const y=new MutationObserver(v);return l&&y.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",g),document.removeEventListener("focusout",w),y.disconnect()}}},[n,l,m.paused]),i.useEffect(()=>{if(l){ta.add(m);const g=document.activeElement;if(!l.contains(g)){const v=new CustomEvent(Gr,Zo);l.addEventListener(Gr,d),l.dispatchEvent(v),v.defaultPrevented||($d(Gd(Jo(l)),{select:!0}),document.activeElement===g&&Ve(l))}return()=>{l.removeEventListener(Gr,d),setTimeout(()=>{const v=new CustomEvent(Ur,Zo);l.addEventListener(Ur,f),l.dispatchEvent(v),v.defaultPrevented||Ve(g??document.body,{select:!0}),l.removeEventListener(Ur,f),ta.remove(m)},0)}}},[l,d,f,m]);const b=i.useCallback(g=>{if(!r&&!n||m.paused)return;const w=g.key==="Tab"&&!g.altKey&&!g.ctrlKey&&!g.metaKey,v=document.activeElement;if(w&&v){const y=g.currentTarget,[x,N]=zd(y);x&&N?!g.shiftKey&&v===N?(g.preventDefault(),r&&Ve(x,{select:!0})):g.shiftKey&&v===x&&(g.preventDefault(),r&&Ve(N,{select:!0})):v===y&&g.preventDefault()}},[r,n,m.paused]);return o.jsx(Q.div,{tabIndex:-1,...c,ref:h,onKeyDown:b})});jr.displayName=Fd;function $d(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(Ve(n,{select:t}),document.activeElement!==r)return}function zd(e){const t=Jo(e),r=ea(t,e),n=ea(t.reverse(),e);return[r,n]}function Jo(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const a=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||a?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function ea(e,t){for(const r of e)if(!Bd(r,{upTo:t}))return r}function Bd(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function Wd(e){return e instanceof HTMLInputElement&&"select"in e}function Ve(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&Wd(e)&&t&&e.select()}}var ta=Vd();function Vd(){let e=[];return{add(t){const r=e[0];t!==r&&(r==null||r.pause()),e=ra(e,t),e.unshift(t)},remove(t){var r;e=ra(e,t),(r=e[0])==null||r.resume()}}}function ra(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function Gd(e){return e.filter(t=>t.tagName!=="A")}var Ud="Portal",xt=i.forwardRef((e,t)=>{var l;const{container:r,...n}=e,[a,s]=i.useState(!1);We(()=>s(!0),[]);const c=r||a&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return c?wo.createPortal(o.jsx(Q.div,{...n,ref:t}),c):null});xt.displayName=Ud;function jd(e,t){return i.useReducer((r,n)=>t[r][n]??r,e)}var Ne=e=>{const{present:t,children:r}=e,n=Hd(t),a=typeof r=="function"?r({present:n.isPresent}):i.Children.only(r),s=oe(n.ref,Kd(a));return typeof r=="function"||n.isPresent?i.cloneElement(a,{ref:s}):null};Ne.displayName="Presence";function Hd(e){const[t,r]=i.useState(),n=i.useRef({}),a=i.useRef(e),s=i.useRef("none"),c=e?"mounted":"unmounted",[l,u]=jd(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return i.useEffect(()=>{const d=Gt(n.current);s.current=l==="mounted"?d:"none"},[l]),We(()=>{const d=n.current,f=a.current;if(f!==e){const h=s.current,m=Gt(d);e?u("MOUNT"):m==="none"||(d==null?void 0:d.display)==="none"?u("UNMOUNT"):u(f&&h!==m?"ANIMATION_OUT":"UNMOUNT"),a.current=e}},[e,u]),We(()=>{if(t){let d;const f=t.ownerDocument.defaultView??window,p=m=>{const g=Gt(n.current).includes(m.animationName);if(m.target===t&&g&&(u("ANIMATION_END"),!a.current)){const w=t.style.animationFillMode;t.style.animationFillMode="forwards",d=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=w)})}},h=m=>{m.target===t&&(s.current=Gt(n.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{f.clearTimeout(d),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",p),t.removeEventListener("animationend",p)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:i.useCallback(d=>{d&&(n.current=getComputedStyle(d)),r(d)},[])}}function Gt(e){return(e==null?void 0:e.animationName)||"none"}function Kd(e){var n,a;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var Hr=0;function na(){i.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??oa()),document.body.insertAdjacentElement("beforeend",e[1]??oa()),Hr++,()=>{Hr===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Hr--}},[])}function oa(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var _e=function(){return _e=Object.assign||function(t){for(var r,n=1,a=arguments.length;n<a;n++){r=arguments[n];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(t[s]=r[s])}return t},_e.apply(this,arguments)};function aa(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]]);return r}function Yd(e,t,r){if(r||arguments.length===2)for(var n=0,a=t.length,s;n<a;n++)(s||!(n in t))&&(s||(s=Array.prototype.slice.call(t,0,n)),s[n]=t[n]);return e.concat(s||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var Ut="right-scroll-bar-position",jt="width-before-scroll-bar",qd="with-scroll-bars-hidden",Xd="--removed-body-scroll-bar-size";function Kr(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Qd(e,t){var r=H.useState(function(){return{value:e,callback:t,facade:{get current(){return r.value},set current(n){var a=r.value;a!==n&&(r.value=n,r.callback(n,a))}}}})[0];return r.callback=t,r.facade}var Rd=typeof window<"u"?i.useLayoutEffect:i.useEffect,sa=new WeakMap;function Zd(e,t){var r=Qd(null,function(n){return e.forEach(function(a){return Kr(a,n)})});return Rd(function(){var n=sa.get(r);if(n){var a=new Set(n),s=new Set(e),c=r.current;a.forEach(function(l){s.has(l)||Kr(l,null)}),s.forEach(function(l){a.has(l)||Kr(l,c)})}sa.set(r,e)},[e]),r}function Jd(e){return e}function eu(e,t){t===void 0&&(t=Jd);var r=[],n=!1,a={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(s){var c=t(s,n);return r.push(c),function(){r=r.filter(function(l){return l!==c})}},assignSyncMedium:function(s){for(n=!0;r.length;){var c=r;r=[],c.forEach(s)}r={push:function(l){return s(l)},filter:function(){return r}}},assignMedium:function(s){n=!0;var c=[];if(r.length){var l=r;r=[],l.forEach(s),c=r}var u=function(){var f=c;c=[],f.forEach(s)},d=function(){return Promise.resolve().then(u)};d(),r={push:function(f){c.push(f),d()},filter:function(f){return c=c.filter(f),r}}}};return a}function tu(e){e===void 0&&(e={});var t=eu(null);return t.options=_e({async:!0,ssr:!1},e),t}var ia=function(e){var t=e.sideCar,r=aa(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw new Error("Sidecar medium not found");return i.createElement(n,_e({},r))};ia.isSideCarExport=!0;function ru(e,t){return e.useMedium(t),ia}var ca=tu(),Yr=function(){},Ht=i.forwardRef(function(e,t){var r=i.useRef(null),n=i.useState({onScrollCapture:Yr,onWheelCapture:Yr,onTouchMoveCapture:Yr}),a=n[0],s=n[1],c=e.forwardProps,l=e.children,u=e.className,d=e.removeScrollBar,f=e.enabled,p=e.shards,h=e.sideCar,m=e.noIsolation,b=e.inert,g=e.allowPinchZoom,w=e.as,v=w===void 0?"div":w,y=e.gapMode,x=aa(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),N=h,E=Zd([r,t]),C=_e(_e({},x),a);return i.createElement(i.Fragment,null,f&&i.createElement(N,{sideCar:ca,removeScrollBar:d,shards:p,noIsolation:m,inert:b,setCallbacks:s,allowPinchZoom:!!g,lockRef:r,gapMode:y}),c?i.cloneElement(i.Children.only(l),_e(_e({},C),{ref:E})):i.createElement(v,_e({},C,{className:u,ref:E}),l))});Ht.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Ht.classNames={fullWidth:jt,zeroRight:Ut};var nu=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function ou(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=nu();return t&&e.setAttribute("nonce",t),e}function au(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function su(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var iu=function(){var e=0,t=null;return{add:function(r){e==0&&(t=ou())&&(au(t,r),su(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},cu=function(){var e=iu();return function(t,r){i.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},la=function(){var e=cu(),t=function(r){var n=r.styles,a=r.dynamic;return e(n,a),null};return t},lu={left:0,top:0,right:0,gap:0},qr=function(e){return parseInt(e||"",10)||0},du=function(e){var t=window.getComputedStyle(document.body),r=t[e==="padding"?"paddingLeft":"marginLeft"],n=t[e==="padding"?"paddingTop":"marginTop"],a=t[e==="padding"?"paddingRight":"marginRight"];return[qr(r),qr(n),qr(a)]},uu=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return lu;var t=du(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},fu=la(),it="data-scroll-locked",pu=function(e,t,r,n){var a=e.left,s=e.top,c=e.right,l=e.gap;return r===void 0&&(r="margin"),`
|
|
150
|
+
*/const Ir=re("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function Io(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(r=Io(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function ko(){for(var e,t,r=0,n="",a=arguments.length;r<a;r++)(e=arguments[r])&&(t=Io(e))&&(n&&(n+=" "),n+=t);return n}const kr="-",Pl=e=>{const t=_l(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:c=>{const l=c.split(kr);return l[0]===""&&l.length!==1&&l.shift(),Oo(l,t)||Al(c)},getConflictingClassGroupIds:(c,l)=>{const u=r[c]||[];return l&&n[c]?[...u,...n[c]]:u}}},Oo=(e,t)=>{var c;if(e.length===0)return t.classGroupId;const r=e[0],n=t.nextPart.get(r),a=n?Oo(e.slice(1),n):void 0;if(a)return a;if(t.validators.length===0)return;const s=e.join(kr);return(c=t.validators.find(({validator:l})=>l(s)))==null?void 0:c.classGroupId},Lo=/^\[(.+)\]$/,Al=e=>{if(Lo.test(e)){const t=Lo.exec(e)[1],r=t==null?void 0:t.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},_l=e=>{const{theme:t,classGroups:r}=e,n={nextPart:new Map,validators:[]};for(const a in r)Or(r[a],n,a,t);return n},Or=(e,t,r,n)=>{e.forEach(a=>{if(typeof a=="string"){const s=a===""?t:Fo(t,a);s.classGroupId=r;return}if(typeof a=="function"){if(Dl(a)){Or(a(n),t,r,n);return}t.validators.push({validator:a,classGroupId:r});return}Object.entries(a).forEach(([s,c])=>{Or(c,Fo(t,s),r,n)})})},Fo=(e,t)=>{let r=e;return t.split(kr).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r},Dl=e=>e.isThemeGetter,Il=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,n=new Map;const a=(s,c)=>{r.set(s,c),t++,t>e&&(t=0,n=r,r=new Map)};return{get(s){let c=r.get(s);if(c!==void 0)return c;if((c=n.get(s))!==void 0)return a(s,c),c},set(s,c){r.has(s)?r.set(s,c):a(s,c)}}},Lr="!",Fr=":",kl=Fr.length,Ol=e=>{const{prefix:t,experimentalParseClassName:r}=e;let n=a=>{const s=[];let c=0,l=0,u=0,d;for(let b=0;b<a.length;b++){let g=a[b];if(c===0&&l===0){if(g===Fr){s.push(a.slice(u,b)),u=b+kl;continue}if(g==="/"){d=b;continue}}g==="["?c++:g==="]"?c--:g==="("?l++:g===")"&&l--}const f=s.length===0?a:a.substring(u),p=Ll(f),h=p!==f,m=d&&d>u?d-u:void 0;return{modifiers:s,hasImportantModifier:h,baseClassName:p,maybePostfixModifierPosition:m}};if(t){const a=t+Fr,s=n;n=c=>c.startsWith(a)?s(c.substring(a.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:c,maybePostfixModifierPosition:void 0}}if(r){const a=n;n=s=>r({className:s,parseClassName:a})}return n},Ll=e=>e.endsWith(Lr)?e.substring(0,e.length-1):e.startsWith(Lr)?e.substring(1):e,Fl=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(n=>[n,!0]));return n=>{if(n.length<=1)return n;const a=[];let s=[];return n.forEach(c=>{c[0]==="["||t[c]?(a.push(...s.sort(),c),s=[]):s.push(c)}),a.push(...s.sort()),a}},$l=e=>({cache:Il(e.cacheSize),parseClassName:Ol(e),sortModifiers:Fl(e),...Pl(e)}),zl=/\s+/,Bl=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:a,sortModifiers:s}=t,c=[],l=e.trim().split(zl);let u="";for(let d=l.length-1;d>=0;d-=1){const f=l[d],{isExternal:p,modifiers:h,hasImportantModifier:m,baseClassName:b,maybePostfixModifierPosition:g}=r(f);if(p){u=f+(u.length>0?" "+u:u);continue}let w=!!g,v=n(w?b.substring(0,g):b);if(!v){if(!w){u=f+(u.length>0?" "+u:u);continue}if(v=n(b),!v){u=f+(u.length>0?" "+u:u);continue}w=!1}const y=s(h).join(":"),x=m?y+Lr:y,N=x+v;if(c.includes(N))continue;c.push(N);const E=a(v,w);for(let C=0;C<E.length;++C){const T=E[C];c.push(x+T)}u=f+(u.length>0?" "+u:u)}return u};function Wl(){let e=0,t,r,n="";for(;e<arguments.length;)(t=arguments[e++])&&(r=$o(t))&&(n&&(n+=" "),n+=r);return n}const $o=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=$o(e[n]))&&(r&&(r+=" "),r+=t);return r};function Vl(e,...t){let r,n,a,s=c;function c(u){const d=t.reduce((f,p)=>p(f),e());return r=$l(d),n=r.cache.get,a=r.cache.set,s=l,l(u)}function l(u){const d=n(u);if(d)return d;const f=Bl(u,r);return a(u,f),f}return function(){return s(Wl.apply(null,arguments))}}const ie=e=>{const t=r=>r[e]||[];return t.isThemeGetter=!0,t},zo=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Bo=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Gl=/^\d+\/\d+$/,Ul=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,jl=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Hl=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Kl=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Yl=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,nt=e=>Gl.test(e),q=e=>!!e&&!Number.isNaN(Number(e)),qe=e=>!!e&&Number.isInteger(Number(e)),Wo=e=>e.endsWith("%")&&q(e.slice(0,-1)),ze=e=>Ul.test(e),ql=()=>!0,Xl=e=>jl.test(e)&&!Hl.test(e),$r=()=>!1,Ql=e=>Kl.test(e),Zl=e=>Yl.test(e),Jl=e=>!I(e)&&!k(e),Rl=e=>ot(e,Uo,$r),I=e=>zo.test(e),Xe=e=>ot(e,jo,Xl),zr=e=>ot(e,dd,q),ed=e=>ot(e,Vo,$r),td=e=>ot(e,Go,Zl),rd=e=>ot(e,$r,Ql),k=e=>Bo.test(e),Wt=e=>at(e,jo),nd=e=>at(e,ud),od=e=>at(e,Vo),ad=e=>at(e,Uo),sd=e=>at(e,Go),id=e=>at(e,fd,!0),ot=(e,t,r)=>{const n=zo.exec(e);return n?n[1]?t(n[1]):r(n[2]):!1},at=(e,t,r=!1)=>{const n=Bo.exec(e);return n?n[1]?t(n[1]):r:!1},Vo=e=>e==="position",cd=new Set(["image","url"]),Go=e=>cd.has(e),ld=new Set(["length","size","percentage"]),Uo=e=>ld.has(e),jo=e=>e==="length",dd=e=>e==="number",ud=e=>e==="family-name",fd=e=>e==="shadow",pd=Vl(()=>{const e=ie("color"),t=ie("font"),r=ie("text"),n=ie("font-weight"),a=ie("tracking"),s=ie("leading"),c=ie("breakpoint"),l=ie("container"),u=ie("spacing"),d=ie("radius"),f=ie("shadow"),p=ie("inset-shadow"),h=ie("drop-shadow"),m=ie("blur"),b=ie("perspective"),g=ie("aspect"),w=ie("ease"),v=ie("animate"),y=()=>["auto","avoid","all","avoid-page","page","left","right","column"],x=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],N=()=>["auto","hidden","clip","visible","scroll"],E=()=>["auto","contain","none"],C=()=>[k,I,u],T=()=>[nt,"full","auto",...C()],$=()=>[qe,"none","subgrid",k,I],O=()=>["auto",{span:["full",qe,k,I]},k,I],B=()=>[qe,"auto",k,I],K=()=>["auto","min","max","fr",k,I],F=()=>["start","end","center","between","around","evenly","stretch","baseline"],L=()=>["start","end","center","stretch"],P=()=>["auto",...C()],V=()=>[nt,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...C()],A=()=>[e,k,I],X=()=>[Wo,Xe],D=()=>["","none","full",d,k,I],M=()=>["",q,Wt,Xe],Y=()=>["solid","dashed","dotted","double"],Q=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ee=()=>["","none",m,k,I],te=()=>["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",k,I],ne=()=>["none",q,k,I],se=()=>["none",q,k,I],le=()=>[q,k,I],ae=()=>[nt,"full",...C()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[ze],breakpoint:[ze],color:[ql],container:[ze],"drop-shadow":[ze],ease:["in","out","in-out"],font:[Jl],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[ze],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[ze],shadow:[ze],spacing:["px",q],text:[ze],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",nt,I,k,g]}],container:["container"],columns:[{columns:[q,I,k,l]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...x(),I,k]}],overflow:[{overflow:N()}],"overflow-x":[{"overflow-x":N()}],"overflow-y":[{"overflow-y":N()}],overscroll:[{overscroll:E()}],"overscroll-x":[{"overscroll-x":E()}],"overscroll-y":[{"overscroll-y":E()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{start:T()}],end:[{end:T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:["visible","invisible","collapse"],z:[{z:[qe,"auto",k,I]}],basis:[{basis:[nt,"full","auto",l,...C()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[q,nt,"auto","initial","none",I]}],grow:[{grow:["",q,k,I]}],shrink:[{shrink:["",q,k,I]}],order:[{order:[qe,"first","last","none",k,I]}],"grid-cols":[{"grid-cols":$()}],"col-start-end":[{col:O()}],"col-start":[{"col-start":B()}],"col-end":[{"col-end":B()}],"grid-rows":[{"grid-rows":$()}],"row-start-end":[{row:O()}],"row-start":[{"row-start":B()}],"row-end":[{"row-end":B()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":K()}],"auto-rows":[{"auto-rows":K()}],gap:[{gap:C()}],"gap-x":[{"gap-x":C()}],"gap-y":[{"gap-y":C()}],"justify-content":[{justify:[...F(),"normal"]}],"justify-items":[{"justify-items":[...L(),"normal"]}],"justify-self":[{"justify-self":["auto",...L()]}],"align-content":[{content:["normal",...F()]}],"align-items":[{items:[...L(),"baseline"]}],"align-self":[{self:["auto",...L(),"baseline"]}],"place-content":[{"place-content":F()}],"place-items":[{"place-items":[...L(),"baseline"]}],"place-self":[{"place-self":["auto",...L()]}],p:[{p:C()}],px:[{px:C()}],py:[{py:C()}],ps:[{ps:C()}],pe:[{pe:C()}],pt:[{pt:C()}],pr:[{pr:C()}],pb:[{pb:C()}],pl:[{pl:C()}],m:[{m:P()}],mx:[{mx:P()}],my:[{my:P()}],ms:[{ms:P()}],me:[{me:P()}],mt:[{mt:P()}],mr:[{mr:P()}],mb:[{mb:P()}],ml:[{ml:P()}],"space-x":[{"space-x":C()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":C()}],"space-y-reverse":["space-y-reverse"],size:[{size:V()}],w:[{w:[l,"screen",...V()]}],"min-w":[{"min-w":[l,"screen","none",...V()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[c]},...V()]}],h:[{h:["screen",...V()]}],"min-h":[{"min-h":["screen","none",...V()]}],"max-h":[{"max-h":["screen",...V()]}],"font-size":[{text:["base",r,Wt,Xe]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,k,zr]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Wo,I]}],"font-family":[{font:[nd,I,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[a,k,I]}],"line-clamp":[{"line-clamp":[q,"none",k,zr]}],leading:[{leading:[s,...C()]}],"list-image":[{"list-image":["none",k,I]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",k,I]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:A()}],"text-color":[{text:A()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Y(),"wavy"]}],"text-decoration-thickness":[{decoration:[q,"from-font","auto",k,Xe]}],"text-decoration-color":[{decoration:A()}],"underline-offset":[{"underline-offset":[q,"auto",k,I]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:C()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",k,I]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",k,I]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...x(),od,ed]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","space","round"]}]}],"bg-size":[{bg:["auto","cover","contain",ad,Rl]}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},qe,k,I],radial:["",k,I],conic:[qe,k,I]},sd,td]}],"bg-color":[{bg:A()}],"gradient-from-pos":[{from:X()}],"gradient-via-pos":[{via:X()}],"gradient-to-pos":[{to:X()}],"gradient-from":[{from:A()}],"gradient-via":[{via:A()}],"gradient-to":[{to:A()}],rounded:[{rounded:D()}],"rounded-s":[{"rounded-s":D()}],"rounded-e":[{"rounded-e":D()}],"rounded-t":[{"rounded-t":D()}],"rounded-r":[{"rounded-r":D()}],"rounded-b":[{"rounded-b":D()}],"rounded-l":[{"rounded-l":D()}],"rounded-ss":[{"rounded-ss":D()}],"rounded-se":[{"rounded-se":D()}],"rounded-ee":[{"rounded-ee":D()}],"rounded-es":[{"rounded-es":D()}],"rounded-tl":[{"rounded-tl":D()}],"rounded-tr":[{"rounded-tr":D()}],"rounded-br":[{"rounded-br":D()}],"rounded-bl":[{"rounded-bl":D()}],"border-w":[{border:M()}],"border-w-x":[{"border-x":M()}],"border-w-y":[{"border-y":M()}],"border-w-s":[{"border-s":M()}],"border-w-e":[{"border-e":M()}],"border-w-t":[{"border-t":M()}],"border-w-r":[{"border-r":M()}],"border-w-b":[{"border-b":M()}],"border-w-l":[{"border-l":M()}],"divide-x":[{"divide-x":M()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":M()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Y(),"hidden","none"]}],"divide-style":[{divide:[...Y(),"hidden","none"]}],"border-color":[{border:A()}],"border-color-x":[{"border-x":A()}],"border-color-y":[{"border-y":A()}],"border-color-s":[{"border-s":A()}],"border-color-e":[{"border-e":A()}],"border-color-t":[{"border-t":A()}],"border-color-r":[{"border-r":A()}],"border-color-b":[{"border-b":A()}],"border-color-l":[{"border-l":A()}],"divide-color":[{divide:A()}],"outline-style":[{outline:[...Y(),"none","hidden"]}],"outline-offset":[{"outline-offset":[q,k,I]}],"outline-w":[{outline:["",q,Wt,Xe]}],"outline-color":[{outline:[e]}],shadow:[{shadow:["","none",f,id,rd]}],"shadow-color":[{shadow:A()}],"inset-shadow":[{"inset-shadow":["none",k,I,p]}],"inset-shadow-color":[{"inset-shadow":A()}],"ring-w":[{ring:M()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:A()}],"ring-offset-w":[{"ring-offset":[q,Xe]}],"ring-offset-color":[{"ring-offset":A()}],"inset-ring-w":[{"inset-ring":M()}],"inset-ring-color":[{"inset-ring":A()}],opacity:[{opacity:[q,k,I]}],"mix-blend":[{"mix-blend":[...Q(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Q()}],filter:[{filter:["","none",k,I]}],blur:[{blur:ee()}],brightness:[{brightness:[q,k,I]}],contrast:[{contrast:[q,k,I]}],"drop-shadow":[{"drop-shadow":["","none",h,k,I]}],grayscale:[{grayscale:["",q,k,I]}],"hue-rotate":[{"hue-rotate":[q,k,I]}],invert:[{invert:["",q,k,I]}],saturate:[{saturate:[q,k,I]}],sepia:[{sepia:["",q,k,I]}],"backdrop-filter":[{"backdrop-filter":["","none",k,I]}],"backdrop-blur":[{"backdrop-blur":ee()}],"backdrop-brightness":[{"backdrop-brightness":[q,k,I]}],"backdrop-contrast":[{"backdrop-contrast":[q,k,I]}],"backdrop-grayscale":[{"backdrop-grayscale":["",q,k,I]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[q,k,I]}],"backdrop-invert":[{"backdrop-invert":["",q,k,I]}],"backdrop-opacity":[{"backdrop-opacity":[q,k,I]}],"backdrop-saturate":[{"backdrop-saturate":[q,k,I]}],"backdrop-sepia":[{"backdrop-sepia":["",q,k,I]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":C()}],"border-spacing-x":[{"border-spacing-x":C()}],"border-spacing-y":[{"border-spacing-y":C()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",k,I]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[q,"initial",k,I]}],ease:[{ease:["linear","initial",w,k,I]}],delay:[{delay:[q,k,I]}],animate:[{animate:["none",v,k,I]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[b,k,I]}],"perspective-origin":[{"perspective-origin":te()}],rotate:[{rotate:ne()}],"rotate-x":[{"rotate-x":ne()}],"rotate-y":[{"rotate-y":ne()}],"rotate-z":[{"rotate-z":ne()}],scale:[{scale:se()}],"scale-x":[{"scale-x":se()}],"scale-y":[{"scale-y":se()}],"scale-z":[{"scale-z":se()}],"scale-3d":["scale-3d"],skew:[{skew:le()}],"skew-x":[{"skew-x":le()}],"skew-y":[{"skew-y":le()}],transform:[{transform:[k,I,"","none","gpu","cpu"]}],"transform-origin":[{origin:te()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ae()}],"translate-x":[{"translate-x":ae()}],"translate-y":[{"translate-y":ae()}],"translate-z":[{"translate-z":ae()}],"translate-none":["translate-none"],accent:[{accent:A()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:A()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",k,I]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":C()}],"scroll-mx":[{"scroll-mx":C()}],"scroll-my":[{"scroll-my":C()}],"scroll-ms":[{"scroll-ms":C()}],"scroll-me":[{"scroll-me":C()}],"scroll-mt":[{"scroll-mt":C()}],"scroll-mr":[{"scroll-mr":C()}],"scroll-mb":[{"scroll-mb":C()}],"scroll-ml":[{"scroll-ml":C()}],"scroll-p":[{"scroll-p":C()}],"scroll-px":[{"scroll-px":C()}],"scroll-py":[{"scroll-py":C()}],"scroll-ps":[{"scroll-ps":C()}],"scroll-pe":[{"scroll-pe":C()}],"scroll-pt":[{"scroll-pt":C()}],"scroll-pr":[{"scroll-pr":C()}],"scroll-pb":[{"scroll-pb":C()}],"scroll-pl":[{"scroll-pl":C()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",k,I]}],fill:[{fill:["none",...A()]}],"stroke-w":[{stroke:[q,Wt,Xe,zr]}],stroke:[{stroke:["none",...A()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["before","after","placeholder","file","marker","selection","first-line","first-letter","backdrop","*","**"]}});function _(...e){return pd(ko(e))}function hd({className:e,containerClassName:t,...r}){return o.jsx(To,{"data-slot":"input-otp",containerClassName:_("flex items-center gap-2 has-disabled:opacity-50",t),className:_("disabled:cursor-not-allowed",e),...r})}function gd({className:e,...t}){return o.jsx("div",{"data-slot":"input-otp-group",className:_("flex items-center",e),...t})}function vd({index:e,className:t,...r}){const n=i.useContext(Eo),{char:a,hasFakeCaret:s,isActive:c}=(n==null?void 0:n.slots[e])??{};return o.jsxs("div",{"data-slot":"input-otp-slot","data-active":c,className:_("border-input data-[active=true]:border-ring data-[active=true]:ring-ring/50 data-[active=true]:aria-invalid:ring-destructive/20 dark:data-[active=true]:aria-invalid:ring-destructive/40 aria-invalid:border-destructive data-[active=true]:aria-invalid:border-destructive relative flex h-9 w-9 items-center justify-center border-y border-r text-sm shadow-xs transition-all outline-none first:rounded-l-md first:border-l last:rounded-r-md data-[active=true]:z-10 data-[active=true]:ring-[3px]",t),...r,children:[a,s&&o.jsx("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center",children:o.jsx("div",{className:"animate-caret-blink bg-foreground h-4 w-px duration-1000"})})]})}function md({...e}){return o.jsx("div",{"data-slot":"input-otp-separator",role:"separator",...e,children:o.jsx(yl,{})})}function z(e,t,{checkForDefaultPrevented:r=!0}={}){return function(a){if(e==null||e(a),r===!1||!a.defaultPrevented)return t==null?void 0:t(a)}}function Ho(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Vt(...e){return t=>{let r=!1;const n=e.map(a=>{const s=Ho(a,t);return!r&&typeof s=="function"&&(r=!0),s});if(r)return()=>{for(let a=0;a<n.length;a++){const s=n[a];typeof s=="function"?s():Ho(e[a],null)}}}}function oe(...e){return i.useCallback(Vt(...e),e)}function bd(e,t){const r=i.createContext(t),n=s=>{const{children:c,...l}=s,u=i.useMemo(()=>l,Object.values(l));return o.jsx(r.Provider,{value:u,children:c})};n.displayName=e+"Provider";function a(s){const c=i.useContext(r);if(c)return c;if(t!==void 0)return t;throw new Error(`\`${s}\` must be used within \`${e}\``)}return[n,a]}function Be(e,t=[]){let r=[];function n(s,c){const l=i.createContext(c),u=r.length;r=[...r,c];const d=p=>{var v;const{scope:h,children:m,...b}=p,g=((v=h==null?void 0:h[e])==null?void 0:v[u])||l,w=i.useMemo(()=>b,Object.values(b));return o.jsx(g.Provider,{value:w,children:m})};d.displayName=s+"Provider";function f(p,h){var g;const m=((g=h==null?void 0:h[e])==null?void 0:g[u])||l,b=i.useContext(m);if(b)return b;if(c!==void 0)return c;throw new Error(`\`${p}\` must be used within \`${s}\``)}return[d,f]}const a=()=>{const s=r.map(c=>i.createContext(c));return function(l){const u=(l==null?void 0:l[e])||s;return i.useMemo(()=>({[`__scope${e}`]:{...l,[e]:u}}),[l,u])}};return a.scopeName=e,[n,wd(a,...t)]}function wd(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(s){const c=n.reduce((l,{useScope:u,scopeName:d})=>{const p=u(s)[`__scope${d}`];return{...l,...p}},{});return i.useMemo(()=>({[`__scope${t.scopeName}`]:c}),[c])}};return r.scopeName=t.scopeName,r}var We=globalThis!=null&&globalThis.document?i.useLayoutEffect:()=>{},yd=i.useId||(()=>{}),xd=0;function Oe(e){const[t,r]=i.useState(yd());return We(()=>{r(n=>n??String(xd++))},[e]),t?`radix-${t}`:""}function fe(e){const t=i.useRef(e);return i.useEffect(()=>{t.current=e}),i.useMemo(()=>(...r)=>{var n;return(n=t.current)==null?void 0:n.call(t,...r)},[])}function st({prop:e,defaultProp:t,onChange:r=()=>{}}){const[n,a]=Nd({defaultProp:t,onChange:r}),s=e!==void 0,c=s?e:n,l=fe(r),u=i.useCallback(d=>{if(s){const p=typeof d=="function"?d(e):d;p!==e&&l(p)}else a(d)},[s,e,a,l]);return[c,u]}function Nd({defaultProp:e,onChange:t}){const r=i.useState(e),[n]=r,a=i.useRef(n),s=fe(t);return i.useEffect(()=>{a.current!==n&&(s(n),a.current=n)},[n,a,s]),r}var ye=i.forwardRef((e,t)=>{const{children:r,...n}=e,a=i.Children.toArray(r),s=a.find(Cd);if(s){const c=s.props.children,l=a.map(u=>u===s?i.Children.count(c)>1?i.Children.only(null):i.isValidElement(c)?c.props.children:null:u);return o.jsx(Br,{...n,ref:t,children:i.isValidElement(c)?i.cloneElement(c,void 0,l):null})}return o.jsx(Br,{...n,ref:t,children:r})});ye.displayName="Slot";var Br=i.forwardRef((e,t)=>{const{children:r,...n}=e;if(i.isValidElement(r)){const a=Ed(r),s=Sd(n,r.props);return r.type!==i.Fragment&&(s.ref=t?Vt(t,a):a),i.cloneElement(r,s)}return i.Children.count(r)>1?i.Children.only(null):null});Br.displayName="SlotClone";var Ko=({children:e})=>o.jsx(o.Fragment,{children:e});function Cd(e){return i.isValidElement(e)&&e.type===Ko}function Sd(e,t){const r={...t};for(const n in t){const a=e[n],s=t[n];/^on[A-Z]/.test(n)?a&&s?r[n]=(...l)=>{s(...l),a(...l)}:a&&(r[n]=a):n==="style"?r[n]={...a,...s}:n==="className"&&(r[n]=[a,s].filter(Boolean).join(" "))}return{...e,...r}}function Ed(e){var n,a;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var Td=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Z=Td.reduce((e,t)=>{const r=i.forwardRef((n,a)=>{const{asChild:s,...c}=n,l=s?ye:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),o.jsx(l,{...c,ref:a})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Wr(e,t){e&&_r.flushSync(()=>e.dispatchEvent(t))}function Md(e,t=globalThis==null?void 0:globalThis.document){const r=fe(e);i.useEffect(()=>{const n=a=>{a.key==="Escape"&&r(a)};return t.addEventListener("keydown",n,{capture:!0}),()=>t.removeEventListener("keydown",n,{capture:!0})},[r,t])}var Pd="DismissableLayer",Vr="dismissableLayer.update",Ad="dismissableLayer.pointerDownOutside",_d="dismissableLayer.focusOutside",Yo,qo=i.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Nt=i.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:a,onFocusOutside:s,onInteractOutside:c,onDismiss:l,...u}=e,d=i.useContext(qo),[f,p]=i.useState(null),h=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,m]=i.useState({}),b=oe(t,T=>p(T)),g=Array.from(d.layers),[w]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),v=g.indexOf(w),y=f?g.indexOf(f):-1,x=d.layersWithOutsidePointerEventsDisabled.size>0,N=y>=v,E=Id(T=>{const $=T.target,O=[...d.branches].some(B=>B.contains($));!N||O||(a==null||a(T),c==null||c(T),T.defaultPrevented||l==null||l())},h),C=kd(T=>{const $=T.target;[...d.branches].some(B=>B.contains($))||(s==null||s(T),c==null||c(T),T.defaultPrevented||l==null||l())},h);return Md(T=>{y===d.layers.size-1&&(n==null||n(T),!T.defaultPrevented&&l&&(T.preventDefault(),l()))},h),i.useEffect(()=>{if(f)return r&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(Yo=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(f)),d.layers.add(f),Qo(),()=>{r&&d.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=Yo)}},[f,h,r,d]),i.useEffect(()=>()=>{f&&(d.layers.delete(f),d.layersWithOutsidePointerEventsDisabled.delete(f),Qo())},[f,d]),i.useEffect(()=>{const T=()=>m({});return document.addEventListener(Vr,T),()=>document.removeEventListener(Vr,T)},[]),o.jsx(Z.div,{...u,ref:b,style:{pointerEvents:x?N?"auto":"none":void 0,...e.style},onFocusCapture:z(e.onFocusCapture,C.onFocusCapture),onBlurCapture:z(e.onBlurCapture,C.onBlurCapture),onPointerDownCapture:z(e.onPointerDownCapture,E.onPointerDownCapture)})});Nt.displayName=Pd;var Dd="DismissableLayerBranch",Xo=i.forwardRef((e,t)=>{const r=i.useContext(qo),n=i.useRef(null),a=oe(t,n);return i.useEffect(()=>{const s=n.current;if(s)return r.branches.add(s),()=>{r.branches.delete(s)}},[r.branches]),o.jsx(Z.div,{...e,ref:a})});Xo.displayName=Dd;function Id(e,t=globalThis==null?void 0:globalThis.document){const r=fe(e),n=i.useRef(!1),a=i.useRef(()=>{});return i.useEffect(()=>{const s=l=>{if(l.target&&!n.current){let u=function(){Zo(Ad,r,d,{discrete:!0})};const d={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",a.current),a.current=u,t.addEventListener("click",a.current,{once:!0})):u()}else t.removeEventListener("click",a.current);n.current=!1},c=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(c),t.removeEventListener("pointerdown",s),t.removeEventListener("click",a.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}function kd(e,t=globalThis==null?void 0:globalThis.document){const r=fe(e),n=i.useRef(!1);return i.useEffect(()=>{const a=s=>{s.target&&!n.current&&Zo(_d,r,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",a),()=>t.removeEventListener("focusin",a)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function Qo(){const e=new CustomEvent(Vr);document.dispatchEvent(e)}function Zo(e,t,r,{discrete:n}){const a=r.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&a.addEventListener(e,t,{once:!0}),n?Wr(a,s):a.dispatchEvent(s)}var Od=Nt,Ld=Xo,Gr="focusScope.autoFocusOnMount",Ur="focusScope.autoFocusOnUnmount",Jo={bubbles:!1,cancelable:!0},Fd="FocusScope",jr=i.forwardRef((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:a,onUnmountAutoFocus:s,...c}=e,[l,u]=i.useState(null),d=fe(a),f=fe(s),p=i.useRef(null),h=oe(t,g=>u(g)),m=i.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;i.useEffect(()=>{if(n){let g=function(x){if(m.paused||!l)return;const N=x.target;l.contains(N)?p.current=N:Ve(p.current,{select:!0})},w=function(x){if(m.paused||!l)return;const N=x.relatedTarget;N!==null&&(l.contains(N)||Ve(p.current,{select:!0}))},v=function(x){if(document.activeElement===document.body)for(const E of x)E.removedNodes.length>0&&Ve(l)};document.addEventListener("focusin",g),document.addEventListener("focusout",w);const y=new MutationObserver(v);return l&&y.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",g),document.removeEventListener("focusout",w),y.disconnect()}}},[n,l,m.paused]),i.useEffect(()=>{if(l){ta.add(m);const g=document.activeElement;if(!l.contains(g)){const v=new CustomEvent(Gr,Jo);l.addEventListener(Gr,d),l.dispatchEvent(v),v.defaultPrevented||($d(Gd(Ro(l)),{select:!0}),document.activeElement===g&&Ve(l))}return()=>{l.removeEventListener(Gr,d),setTimeout(()=>{const v=new CustomEvent(Ur,Jo);l.addEventListener(Ur,f),l.dispatchEvent(v),v.defaultPrevented||Ve(g??document.body,{select:!0}),l.removeEventListener(Ur,f),ta.remove(m)},0)}}},[l,d,f,m]);const b=i.useCallback(g=>{if(!r&&!n||m.paused)return;const w=g.key==="Tab"&&!g.altKey&&!g.ctrlKey&&!g.metaKey,v=document.activeElement;if(w&&v){const y=g.currentTarget,[x,N]=zd(y);x&&N?!g.shiftKey&&v===N?(g.preventDefault(),r&&Ve(x,{select:!0})):g.shiftKey&&v===x&&(g.preventDefault(),r&&Ve(N,{select:!0})):v===y&&g.preventDefault()}},[r,n,m.paused]);return o.jsx(Z.div,{tabIndex:-1,...c,ref:h,onKeyDown:b})});jr.displayName=Fd;function $d(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(Ve(n,{select:t}),document.activeElement!==r)return}function zd(e){const t=Ro(e),r=ea(t,e),n=ea(t.reverse(),e);return[r,n]}function Ro(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const a=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||a?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function ea(e,t){for(const r of e)if(!Bd(r,{upTo:t}))return r}function Bd(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function Wd(e){return e instanceof HTMLInputElement&&"select"in e}function Ve(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&Wd(e)&&t&&e.select()}}var ta=Vd();function Vd(){let e=[];return{add(t){const r=e[0];t!==r&&(r==null||r.pause()),e=ra(e,t),e.unshift(t)},remove(t){var r;e=ra(e,t),(r=e[0])==null||r.resume()}}}function ra(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function Gd(e){return e.filter(t=>t.tagName!=="A")}var Ud="Portal",Ct=i.forwardRef((e,t)=>{var l;const{container:r,...n}=e,[a,s]=i.useState(!1);We(()=>s(!0),[]);const c=r||a&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return c?wo.createPortal(o.jsx(Z.div,{...n,ref:t}),c):null});Ct.displayName=Ud;function jd(e,t){return i.useReducer((r,n)=>t[r][n]??r,e)}var Ne=e=>{const{present:t,children:r}=e,n=Hd(t),a=typeof r=="function"?r({present:n.isPresent}):i.Children.only(r),s=oe(n.ref,Kd(a));return typeof r=="function"||n.isPresent?i.cloneElement(a,{ref:s}):null};Ne.displayName="Presence";function Hd(e){const[t,r]=i.useState(),n=i.useRef({}),a=i.useRef(e),s=i.useRef("none"),c=e?"mounted":"unmounted",[l,u]=jd(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return i.useEffect(()=>{const d=Gt(n.current);s.current=l==="mounted"?d:"none"},[l]),We(()=>{const d=n.current,f=a.current;if(f!==e){const h=s.current,m=Gt(d);e?u("MOUNT"):m==="none"||(d==null?void 0:d.display)==="none"?u("UNMOUNT"):u(f&&h!==m?"ANIMATION_OUT":"UNMOUNT"),a.current=e}},[e,u]),We(()=>{if(t){let d;const f=t.ownerDocument.defaultView??window,p=m=>{const g=Gt(n.current).includes(m.animationName);if(m.target===t&&g&&(u("ANIMATION_END"),!a.current)){const w=t.style.animationFillMode;t.style.animationFillMode="forwards",d=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=w)})}},h=m=>{m.target===t&&(s.current=Gt(n.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{f.clearTimeout(d),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",p),t.removeEventListener("animationend",p)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:i.useCallback(d=>{d&&(n.current=getComputedStyle(d)),r(d)},[])}}function Gt(e){return(e==null?void 0:e.animationName)||"none"}function Kd(e){var n,a;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var Hr=0;function na(){i.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??oa()),document.body.insertAdjacentElement("beforeend",e[1]??oa()),Hr++,()=>{Hr===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Hr--}},[])}function oa(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var _e=function(){return _e=Object.assign||function(t){for(var r,n=1,a=arguments.length;n<a;n++){r=arguments[n];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(t[s]=r[s])}return t},_e.apply(this,arguments)};function aa(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]]);return r}function Yd(e,t,r){if(r||arguments.length===2)for(var n=0,a=t.length,s;n<a;n++)(s||!(n in t))&&(s||(s=Array.prototype.slice.call(t,0,n)),s[n]=t[n]);return e.concat(s||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var Ut="right-scroll-bar-position",jt="width-before-scroll-bar",qd="with-scroll-bars-hidden",Xd="--removed-body-scroll-bar-size";function Kr(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Qd(e,t){var r=H.useState(function(){return{value:e,callback:t,facade:{get current(){return r.value},set current(n){var a=r.value;a!==n&&(r.value=n,r.callback(n,a))}}}})[0];return r.callback=t,r.facade}var Zd=typeof window<"u"?i.useLayoutEffect:i.useEffect,sa=new WeakMap;function Jd(e,t){var r=Qd(null,function(n){return e.forEach(function(a){return Kr(a,n)})});return Zd(function(){var n=sa.get(r);if(n){var a=new Set(n),s=new Set(e),c=r.current;a.forEach(function(l){s.has(l)||Kr(l,null)}),s.forEach(function(l){a.has(l)||Kr(l,c)})}sa.set(r,e)},[e]),r}function Rd(e){return e}function eu(e,t){t===void 0&&(t=Rd);var r=[],n=!1,a={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(s){var c=t(s,n);return r.push(c),function(){r=r.filter(function(l){return l!==c})}},assignSyncMedium:function(s){for(n=!0;r.length;){var c=r;r=[],c.forEach(s)}r={push:function(l){return s(l)},filter:function(){return r}}},assignMedium:function(s){n=!0;var c=[];if(r.length){var l=r;r=[],l.forEach(s),c=r}var u=function(){var f=c;c=[],f.forEach(s)},d=function(){return Promise.resolve().then(u)};d(),r={push:function(f){c.push(f),d()},filter:function(f){return c=c.filter(f),r}}}};return a}function tu(e){e===void 0&&(e={});var t=eu(null);return t.options=_e({async:!0,ssr:!1},e),t}var ia=function(e){var t=e.sideCar,r=aa(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw new Error("Sidecar medium not found");return i.createElement(n,_e({},r))};ia.isSideCarExport=!0;function ru(e,t){return e.useMedium(t),ia}var ca=tu(),Yr=function(){},Ht=i.forwardRef(function(e,t){var r=i.useRef(null),n=i.useState({onScrollCapture:Yr,onWheelCapture:Yr,onTouchMoveCapture:Yr}),a=n[0],s=n[1],c=e.forwardProps,l=e.children,u=e.className,d=e.removeScrollBar,f=e.enabled,p=e.shards,h=e.sideCar,m=e.noIsolation,b=e.inert,g=e.allowPinchZoom,w=e.as,v=w===void 0?"div":w,y=e.gapMode,x=aa(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),N=h,E=Jd([r,t]),C=_e(_e({},x),a);return i.createElement(i.Fragment,null,f&&i.createElement(N,{sideCar:ca,removeScrollBar:d,shards:p,noIsolation:m,inert:b,setCallbacks:s,allowPinchZoom:!!g,lockRef:r,gapMode:y}),c?i.cloneElement(i.Children.only(l),_e(_e({},C),{ref:E})):i.createElement(v,_e({},C,{className:u,ref:E}),l))});Ht.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Ht.classNames={fullWidth:jt,zeroRight:Ut};var nu=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function ou(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=nu();return t&&e.setAttribute("nonce",t),e}function au(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function su(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var iu=function(){var e=0,t=null;return{add:function(r){e==0&&(t=ou())&&(au(t,r),su(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},cu=function(){var e=iu();return function(t,r){i.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},la=function(){var e=cu(),t=function(r){var n=r.styles,a=r.dynamic;return e(n,a),null};return t},lu={left:0,top:0,right:0,gap:0},qr=function(e){return parseInt(e||"",10)||0},du=function(e){var t=window.getComputedStyle(document.body),r=t[e==="padding"?"paddingLeft":"marginLeft"],n=t[e==="padding"?"paddingTop":"marginTop"],a=t[e==="padding"?"paddingRight":"marginRight"];return[qr(r),qr(n),qr(a)]},uu=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return lu;var t=du(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},fu=la(),it="data-scroll-locked",pu=function(e,t,r,n){var a=e.left,s=e.top,c=e.right,l=e.gap;return r===void 0&&(r="margin"),`
|
|
151
151
|
.`.concat(qd,` {
|
|
152
152
|
overflow: hidden `).concat(n,`;
|
|
153
153
|
padding-right: `).concat(l,"px ").concat(n,`;
|
|
@@ -187,10 +187,10 @@
|
|
|
187
187
|
`)},da=function(){var e=parseInt(document.body.getAttribute(it)||"0",10);return isFinite(e)?e:0},hu=function(){i.useEffect(function(){return document.body.setAttribute(it,(da()+1).toString()),function(){var e=da()-1;e<=0?document.body.removeAttribute(it):document.body.setAttribute(it,e.toString())}},[])},gu=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,a=n===void 0?"margin":n;hu();var s=i.useMemo(function(){return uu(a)},[a]);return i.createElement(fu,{styles:pu(s,!t,a,r?"":"!important")})},Xr=!1;if(typeof window<"u")try{var Kt=Object.defineProperty({},"passive",{get:function(){return Xr=!0,!0}});window.addEventListener("test",Kt,Kt),window.removeEventListener("test",Kt,Kt)}catch{Xr=!1}var ct=Xr?{passive:!1}:!1,vu=function(e){return e.tagName==="TEXTAREA"},ua=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!vu(e)&&r[t]==="visible")},mu=function(e){return ua(e,"overflowY")},bu=function(e){return ua(e,"overflowX")},fa=function(e,t){var r=t.ownerDocument,n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var a=pa(e,n);if(a){var s=ha(e,n),c=s[1],l=s[2];if(c>l)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},wu=function(e){var t=e.scrollTop,r=e.scrollHeight,n=e.clientHeight;return[t,r,n]},yu=function(e){var t=e.scrollLeft,r=e.scrollWidth,n=e.clientWidth;return[t,r,n]},pa=function(e,t){return e==="v"?mu(t):bu(t)},ha=function(e,t){return e==="v"?wu(t):yu(t)},xu=function(e,t){return e==="h"&&t==="rtl"?-1:1},Nu=function(e,t,r,n,a){var s=xu(e,window.getComputedStyle(t).direction),c=s*n,l=r.target,u=t.contains(l),d=!1,f=c>0,p=0,h=0;do{var m=ha(e,l),b=m[0],g=m[1],w=m[2],v=g-w-s*b;(b||v)&&pa(e,l)&&(p+=v,h+=b),l instanceof ShadowRoot?l=l.host:l=l.parentNode}while(!u&&l!==document.body||u&&(t.contains(l)||t===l));return(f&&Math.abs(p)<1||!f&&Math.abs(h)<1)&&(d=!0),d},Yt=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},ga=function(e){return[e.deltaX,e.deltaY]},va=function(e){return e&&"current"in e?e.current:e},Cu=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Su=function(e){return`
|
|
188
188
|
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
189
189
|
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
190
|
-
`)},Eu=0,lt=[];function Tu(e){var t=i.useRef([]),r=i.useRef([0,0]),n=i.useRef(),a=i.useState(Eu++)[0],s=i.useState(la)[0],c=i.useRef(e);i.useEffect(function(){c.current=e},[e]),i.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(a));var g=Yd([e.lockRef.current],(e.shards||[]).map(va),!0).filter(Boolean);return g.forEach(function(w){return w.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),g.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(a))})}}},[e.inert,e.lockRef.current,e.shards]);var l=i.useCallback(function(g,w){if("touches"in g&&g.touches.length===2||g.type==="wheel"&&g.ctrlKey)return!c.current.allowPinchZoom;var v=Yt(g),y=r.current,x="deltaX"in g?g.deltaX:y[0]-v[0],N="deltaY"in g?g.deltaY:y[1]-v[1],E,C=g.target,T=Math.abs(x)>Math.abs(N)?"h":"v";if("touches"in g&&T==="h"&&C.type==="range")return!1;var
|
|
190
|
+
`)},Eu=0,lt=[];function Tu(e){var t=i.useRef([]),r=i.useRef([0,0]),n=i.useRef(),a=i.useState(Eu++)[0],s=i.useState(la)[0],c=i.useRef(e);i.useEffect(function(){c.current=e},[e]),i.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(a));var g=Yd([e.lockRef.current],(e.shards||[]).map(va),!0).filter(Boolean);return g.forEach(function(w){return w.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),g.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(a))})}}},[e.inert,e.lockRef.current,e.shards]);var l=i.useCallback(function(g,w){if("touches"in g&&g.touches.length===2||g.type==="wheel"&&g.ctrlKey)return!c.current.allowPinchZoom;var v=Yt(g),y=r.current,x="deltaX"in g?g.deltaX:y[0]-v[0],N="deltaY"in g?g.deltaY:y[1]-v[1],E,C=g.target,T=Math.abs(x)>Math.abs(N)?"h":"v";if("touches"in g&&T==="h"&&C.type==="range")return!1;var $=fa(T,C);if(!$)return!0;if($?E=T:(E=T==="v"?"h":"v",$=fa(T,C)),!$)return!1;if(!n.current&&"changedTouches"in g&&(x||N)&&(n.current=E),!E)return!0;var O=n.current||E;return Nu(O,w,g,O==="h"?x:N)},[]),u=i.useCallback(function(g){var w=g;if(!(!lt.length||lt[lt.length-1]!==s)){var v="deltaY"in w?ga(w):Yt(w),y=t.current.filter(function(E){return E.name===w.type&&(E.target===w.target||w.target===E.shadowParent)&&Cu(E.delta,v)})[0];if(y&&y.should){w.cancelable&&w.preventDefault();return}if(!y){var x=(c.current.shards||[]).map(va).filter(Boolean).filter(function(E){return E.contains(w.target)}),N=x.length>0?l(w,x[0]):!c.current.noIsolation;N&&w.cancelable&&w.preventDefault()}}},[]),d=i.useCallback(function(g,w,v,y){var x={name:g,delta:w,target:v,should:y,shadowParent:Mu(v)};t.current.push(x),setTimeout(function(){t.current=t.current.filter(function(N){return N!==x})},1)},[]),f=i.useCallback(function(g){r.current=Yt(g),n.current=void 0},[]),p=i.useCallback(function(g){d(g.type,ga(g),g.target,l(g,e.lockRef.current))},[]),h=i.useCallback(function(g){d(g.type,Yt(g),g.target,l(g,e.lockRef.current))},[]);i.useEffect(function(){return lt.push(s),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:h}),document.addEventListener("wheel",u,ct),document.addEventListener("touchmove",u,ct),document.addEventListener("touchstart",f,ct),function(){lt=lt.filter(function(g){return g!==s}),document.removeEventListener("wheel",u,ct),document.removeEventListener("touchmove",u,ct),document.removeEventListener("touchstart",f,ct)}},[]);var m=e.removeScrollBar,b=e.inert;return i.createElement(i.Fragment,null,b?i.createElement(s,{styles:Su(a)}):null,m?i.createElement(gu,{gapMode:e.gapMode}):null)}function Mu(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Pu=ru(ca,Tu);var Qr=i.forwardRef(function(e,t){return i.createElement(Ht,_e({},e,{ref:t,sideCar:Pu}))});Qr.classNames=Ht.classNames;var Au=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},dt=new WeakMap,qt=new WeakMap,Xt={},Zr=0,ma=function(e){return e&&(e.host||ma(e.parentNode))},_u=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=ma(r);return n&&e.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},Du=function(e,t,r,n){var a=_u(t,Array.isArray(e)?e:[e]);Xt[r]||(Xt[r]=new WeakMap);var s=Xt[r],c=[],l=new Set,u=new Set(a),d=function(p){!p||l.has(p)||(l.add(p),d(p.parentNode))};a.forEach(d);var f=function(p){!p||u.has(p)||Array.prototype.forEach.call(p.children,function(h){if(l.has(h))f(h);else try{var m=h.getAttribute(n),b=m!==null&&m!=="false",g=(dt.get(h)||0)+1,w=(s.get(h)||0)+1;dt.set(h,g),s.set(h,w),c.push(h),g===1&&b&&qt.set(h,!0),w===1&&h.setAttribute(r,"true"),b||h.setAttribute(n,"true")}catch(v){console.error("aria-hidden: cannot operate on ",h,v)}})};return f(t),l.clear(),Zr++,function(){c.forEach(function(p){var h=dt.get(p)-1,m=s.get(p)-1;dt.set(p,h),s.set(p,m),h||(qt.has(p)||p.removeAttribute(n),qt.delete(p)),m||p.removeAttribute(r)}),Zr--,Zr||(dt=new WeakMap,dt=new WeakMap,qt=new WeakMap,Xt={})}},ba=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),a=Au(e);return a?(n.push.apply(n,Array.from(a.querySelectorAll("[aria-live]"))),Du(n,a,r,"aria-hidden")):function(){return null}},Jr="Dialog",[wa,ov]=Be(Jr),[Iu,Ce]=wa(Jr),ya=e=>{const{__scopeDialog:t,children:r,open:n,defaultOpen:a,onOpenChange:s,modal:c=!0}=e,l=i.useRef(null),u=i.useRef(null),[d=!1,f]=st({prop:n,defaultProp:a,onChange:s});return o.jsx(Iu,{scope:t,triggerRef:l,contentRef:u,contentId:Oe(),titleId:Oe(),descriptionId:Oe(),open:d,onOpenChange:f,onOpenToggle:i.useCallback(()=>f(p=>!p),[f]),modal:c,children:r})};ya.displayName=Jr;var xa="DialogTrigger",Na=i.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,a=Ce(xa,r),s=oe(t,a.triggerRef);return o.jsx(Z.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":tn(a.open),...n,ref:s,onClick:z(e.onClick,a.onOpenToggle)})});Na.displayName=xa;var Rr="DialogPortal",[ku,Ca]=wa(Rr,{forceMount:void 0}),Sa=e=>{const{__scopeDialog:t,forceMount:r,children:n,container:a}=e,s=Ce(Rr,t);return o.jsx(ku,{scope:t,forceMount:r,children:i.Children.map(n,c=>o.jsx(Ne,{present:r||s.open,children:o.jsx(Ct,{asChild:!0,container:a,children:c})}))})};Sa.displayName=Rr;var Qt="DialogOverlay",Ea=i.forwardRef((e,t)=>{const r=Ca(Qt,e.__scopeDialog),{forceMount:n=r.forceMount,...a}=e,s=Ce(Qt,e.__scopeDialog);return s.modal?o.jsx(Ne,{present:n||s.open,children:o.jsx(Ou,{...a,ref:t})}):null});Ea.displayName=Qt;var Ou=i.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,a=Ce(Qt,r);return o.jsx(Qr,{as:ye,allowPinchZoom:!0,shards:[a.contentRef],children:o.jsx(Z.div,{"data-state":tn(a.open),...n,ref:t,style:{pointerEvents:"auto",...n.style}})})}),Qe="DialogContent",Ta=i.forwardRef((e,t)=>{const r=Ca(Qe,e.__scopeDialog),{forceMount:n=r.forceMount,...a}=e,s=Ce(Qe,e.__scopeDialog);return o.jsx(Ne,{present:n||s.open,children:s.modal?o.jsx(Lu,{...a,ref:t}):o.jsx(Fu,{...a,ref:t})})});Ta.displayName=Qe;var Lu=i.forwardRef((e,t)=>{const r=Ce(Qe,e.__scopeDialog),n=i.useRef(null),a=oe(t,r.contentRef,n);return i.useEffect(()=>{const s=n.current;if(s)return ba(s)},[]),o.jsx(Ma,{...e,ref:a,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:z(e.onCloseAutoFocus,s=>{var c;s.preventDefault(),(c=r.triggerRef.current)==null||c.focus()}),onPointerDownOutside:z(e.onPointerDownOutside,s=>{const c=s.detail.originalEvent,l=c.button===0&&c.ctrlKey===!0;(c.button===2||l)&&s.preventDefault()}),onFocusOutside:z(e.onFocusOutside,s=>s.preventDefault())})}),Fu=i.forwardRef((e,t)=>{const r=Ce(Qe,e.__scopeDialog),n=i.useRef(!1),a=i.useRef(!1);return o.jsx(Ma,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var c,l;(c=e.onCloseAutoFocus)==null||c.call(e,s),s.defaultPrevented||(n.current||(l=r.triggerRef.current)==null||l.focus(),s.preventDefault()),n.current=!1,a.current=!1},onInteractOutside:s=>{var u,d;(u=e.onInteractOutside)==null||u.call(e,s),s.defaultPrevented||(n.current=!0,s.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const c=s.target;((d=r.triggerRef.current)==null?void 0:d.contains(c))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&a.current&&s.preventDefault()}})}),Ma=i.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:a,onCloseAutoFocus:s,...c}=e,l=Ce(Qe,r),u=i.useRef(null),d=oe(t,u);return na(),o.jsxs(o.Fragment,{children:[o.jsx(jr,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:a,onUnmountAutoFocus:s,children:o.jsx(Nt,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":tn(l.open),...c,ref:d,onDismiss:()=>l.onOpenChange(!1)})}),o.jsxs(o.Fragment,{children:[o.jsx($u,{titleId:l.titleId}),o.jsx(Bu,{contentRef:u,descriptionId:l.descriptionId})]})]})}),en="DialogTitle",Pa=i.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,a=Ce(en,r);return o.jsx(Z.h2,{id:a.titleId,...n,ref:t})});Pa.displayName=en;var Aa="DialogDescription",_a=i.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,a=Ce(Aa,r);return o.jsx(Z.p,{id:a.descriptionId,...n,ref:t})});_a.displayName=Aa;var Da="DialogClose",Ia=i.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,a=Ce(Da,r);return o.jsx(Z.button,{type:"button",...n,ref:t,onClick:z(e.onClick,()=>a.onOpenChange(!1))})});Ia.displayName=Da;function tn(e){return e?"open":"closed"}var ka="DialogTitleWarning",[av,Oa]=bd(ka,{contentName:Qe,titleName:en,docsSlug:"dialog"}),$u=({titleId:e})=>{const t=Oa(ka),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
191
191
|
|
|
192
192
|
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
193
193
|
|
|
194
|
-
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return i.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},zu="DialogDescriptionWarning",Bu=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Oa(zu).contentName}}.`;return i.useEffect(()=>{var s;const a=(s=e.current)==null?void 0:s.getAttribute("aria-describedby");t&&a&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},rn=ya,La=Na,Fa=Sa,Rt=Ea,Zt=Ta,Jt=Pa,er=_a,tr=Ia;const Nt=({modal:e=!1,...t})=>o.jsx(rn,{modal:e,...t});Nt.displayName=rn.displayName;const nn=La,$a=Fa,on=tr,an=i.forwardRef(({className:e,...t},r)=>o.jsx(Rt,{ref:r,className:_("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));an.displayName=Rt.displayName;const Ct=i.forwardRef(({className:e,children:t,...r},n)=>o.jsxs($a,{children:[o.jsx(an,{}),o.jsxs(Zt,{ref:n,className:_("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-2xl shadow-primary duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...r,children:[t,o.jsxs(tr,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[o.jsx(Ir,{className:"h-4 w-4"}),o.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Ct.displayName=Zt.displayName;const rr=({className:e,...t})=>o.jsx("div",{className:_("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});rr.displayName="DialogHeader";const sn=({className:e,...t})=>o.jsx("div",{className:_("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});sn.displayName="DialogFooter";const nr=i.forwardRef(({className:e,...t},r)=>o.jsx(Jt,{ref:r,className:_("text-lg font-semibold leading-none tracking-tight",e),...t}));nr.displayName=Jt.displayName;const cn=i.forwardRef(({className:e,...t},r)=>o.jsx(er,{ref:r,className:_("text-sm text-muted-foreground",e),...t}));cn.displayName=er.displayName;function ln(e){const t=e+"CollectionProvider",[r,n]=Be(t),[a,s]=r(t,{collectionRef:{current:null},itemMap:new Map}),c=m=>{const{scope:b,children:g}=m,w=H.useRef(null),v=H.useRef(new Map).current;return o.jsx(a,{scope:b,itemMap:v,collectionRef:w,children:g})};c.displayName=t;const l=e+"CollectionSlot",u=H.forwardRef((m,b)=>{const{scope:g,children:w}=m,v=s(l,g),y=oe(b,v.collectionRef);return o.jsx(ye,{ref:y,children:w})});u.displayName=l;const d=e+"CollectionItemSlot",f="data-radix-collection-item",p=H.forwardRef((m,b)=>{const{scope:g,children:w,...v}=m,y=H.useRef(null),x=oe(b,y),N=s(d,g);return H.useEffect(()=>(N.itemMap.set(y,{ref:y,...v}),()=>void N.itemMap.delete(y))),o.jsx(ye,{[f]:"",ref:x,children:w})});p.displayName=d;function h(m){const b=s(e+"CollectionConsumer",m);return H.useCallback(()=>{const w=b.collectionRef.current;if(!w)return[];const v=Array.from(w.querySelectorAll(`[${f}]`));return Array.from(b.itemMap.values()).sort((N,E)=>v.indexOf(N.ref.current)-v.indexOf(E.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:c,Slot:u,ItemSlot:p},h,n]}var Wu=i.createContext(void 0);function za(e){const t=i.useContext(Wu);return e||t||"ltr"}const Vu=["top","right","bottom","left"],Ge=Math.min,me=Math.max,or=Math.round,ar=Math.floor,De=e=>({x:e,y:e}),Gu={left:"right",right:"left",bottom:"top",top:"bottom"},Uu={start:"end",end:"start"};function dn(e,t,r){return me(e,Ge(t,r))}function Le(e,t){return typeof e=="function"?e(t):e}function Fe(e){return e.split("-")[0]}function ut(e){return e.split("-")[1]}function un(e){return e==="x"?"y":"x"}function fn(e){return e==="y"?"height":"width"}function Ue(e){return["top","bottom"].includes(Fe(e))?"y":"x"}function pn(e){return un(Ue(e))}function ju(e,t,r){r===void 0&&(r=!1);const n=ut(e),a=pn(e),s=fn(a);let c=a==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(c=sr(c)),[c,sr(c)]}function Hu(e){const t=sr(e);return[hn(e),t,hn(t)]}function hn(e){return e.replace(/start|end/g,t=>Uu[t])}function Ku(e,t,r){const n=["left","right"],a=["right","left"],s=["top","bottom"],c=["bottom","top"];switch(e){case"top":case"bottom":return r?t?a:n:t?n:a;case"left":case"right":return t?s:c;default:return[]}}function Yu(e,t,r,n){const a=ut(e);let s=Ku(Fe(e),r==="start",n);return a&&(s=s.map(c=>c+"-"+a),t&&(s=s.concat(s.map(hn)))),s}function sr(e){return e.replace(/left|right|bottom|top/g,t=>Gu[t])}function qu(e){return{top:0,right:0,bottom:0,left:0,...e}}function Ba(e){return typeof e!="number"?qu(e):{top:e,right:e,bottom:e,left:e}}function ir(e){const{x:t,y:r,width:n,height:a}=e;return{width:n,height:a,top:r,left:t,right:t+n,bottom:r+a,x:t,y:r}}function Wa(e,t,r){let{reference:n,floating:a}=e;const s=Ue(t),c=pn(t),l=fn(c),u=Fe(t),d=s==="y",f=n.x+n.width/2-a.width/2,p=n.y+n.height/2-a.height/2,h=n[l]/2-a[l]/2;let m;switch(u){case"top":m={x:f,y:n.y-a.height};break;case"bottom":m={x:f,y:n.y+n.height};break;case"right":m={x:n.x+n.width,y:p};break;case"left":m={x:n.x-a.width,y:p};break;default:m={x:n.x,y:n.y}}switch(ut(t)){case"start":m[c]-=h*(r&&d?-1:1);break;case"end":m[c]+=h*(r&&d?-1:1);break}return m}const Xu=async(e,t,r)=>{const{placement:n="bottom",strategy:a="absolute",middleware:s=[],platform:c}=r,l=s.filter(Boolean),u=await(c.isRTL==null?void 0:c.isRTL(t));let d=await c.getElementRects({reference:e,floating:t,strategy:a}),{x:f,y:p}=Wa(d,n,u),h=n,m={},b=0;for(let g=0;g<l.length;g++){const{name:w,fn:v}=l[g],{x:y,y:x,data:N,reset:E}=await v({x:f,y:p,initialPlacement:n,placement:h,strategy:a,middlewareData:m,rects:d,platform:c,elements:{reference:e,floating:t}});f=y??f,p=x??p,m={...m,[w]:{...m[w],...N}},E&&b<=50&&(b++,typeof E=="object"&&(E.placement&&(h=E.placement),E.rects&&(d=E.rects===!0?await c.getElementRects({reference:e,floating:t,strategy:a}):E.rects),{x:f,y:p}=Wa(d,h,u)),g=-1)}return{x:f,y:p,placement:h,strategy:a,middlewareData:m}};async function St(e,t){var r;t===void 0&&(t={});const{x:n,y:a,platform:s,rects:c,elements:l,strategy:u}=e,{boundary:d="clippingAncestors",rootBoundary:f="viewport",elementContext:p="floating",altBoundary:h=!1,padding:m=0}=Le(t,e),b=Ba(m),w=l[h?p==="floating"?"reference":"floating":p],v=ir(await s.getClippingRect({element:(r=await(s.isElement==null?void 0:s.isElement(w)))==null||r?w:w.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(l.floating)),boundary:d,rootBoundary:f,strategy:u})),y=p==="floating"?{x:n,y:a,width:c.floating.width,height:c.floating.height}:c.reference,x=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l.floating)),N=await(s.isElement==null?void 0:s.isElement(x))?await(s.getScale==null?void 0:s.getScale(x))||{x:1,y:1}:{x:1,y:1},E=ir(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:y,offsetParent:x,strategy:u}):y);return{top:(v.top-E.top+b.top)/N.y,bottom:(E.bottom-v.bottom+b.bottom)/N.y,left:(v.left-E.left+b.left)/N.x,right:(E.right-v.right+b.right)/N.x}}const Qu=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:a,rects:s,platform:c,elements:l,middlewareData:u}=t,{element:d,padding:f=0}=Le(e,t)||{};if(d==null)return{};const p=Ba(f),h={x:r,y:n},m=pn(a),b=fn(m),g=await c.getDimensions(d),w=m==="y",v=w?"top":"left",y=w?"bottom":"right",x=w?"clientHeight":"clientWidth",N=s.reference[b]+s.reference[m]-h[m]-s.floating[b],E=h[m]-s.reference[m],C=await(c.getOffsetParent==null?void 0:c.getOffsetParent(d));let T=C?C[x]:0;(!T||!await(c.isElement==null?void 0:c.isElement(C)))&&(T=l.floating[x]||s.floating[b]);const F=N/2-E/2,O=T/2-g[b]/2-1,B=Ge(p[v],O),z=Ge(p[y],O),W=B,L=T-g[b]-z,P=T/2-g[b]/2+F,G=dn(W,P,L),A=!u.arrow&&ut(a)!=null&&P!==G&&s.reference[b]/2-(P<W?B:z)-g[b]/2<0,q=A?P<W?P-W:P-L:0;return{[m]:h[m]+q,data:{[m]:G,centerOffset:P-G-q,...A&&{alignmentOffset:q}},reset:A}}}),Ru=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:a,middlewareData:s,rects:c,initialPlacement:l,platform:u,elements:d}=t,{mainAxis:f=!0,crossAxis:p=!0,fallbackPlacements:h,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:g=!0,...w}=Le(e,t);if((r=s.arrow)!=null&&r.alignmentOffset)return{};const v=Fe(a),y=Ue(l),x=Fe(l)===l,N=await(u.isRTL==null?void 0:u.isRTL(d.floating)),E=h||(x||!g?[sr(l)]:Hu(l)),C=b!=="none";!h&&C&&E.push(...Yu(l,g,b,N));const T=[l,...E],F=await St(t,w),O=[];let B=((n=s.flip)==null?void 0:n.overflows)||[];if(f&&O.push(F[v]),p){const P=ju(a,c,N);O.push(F[P[0]],F[P[1]])}if(B=[...B,{placement:a,overflows:O}],!O.every(P=>P<=0)){var z,W;const P=(((z=s.flip)==null?void 0:z.index)||0)+1,G=T[P];if(G)return{data:{index:P,overflows:B},reset:{placement:G}};let A=(W=B.filter(q=>q.overflows[0]<=0).sort((q,D)=>q.overflows[1]-D.overflows[1])[0])==null?void 0:W.placement;if(!A)switch(m){case"bestFit":{var L;const q=(L=B.filter(D=>{if(C){const M=Ue(D.placement);return M===y||M==="y"}return!0}).map(D=>[D.placement,D.overflows.filter(M=>M>0).reduce((M,K)=>M+K,0)]).sort((D,M)=>D[1]-M[1])[0])==null?void 0:L[0];q&&(A=q);break}case"initialPlacement":A=l;break}if(a!==A)return{reset:{placement:A}}}return{}}}};function Va(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Ga(e){return Vu.some(t=>e[t]>=0)}const Zu=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:n="referenceHidden",...a}=Le(e,t);switch(n){case"referenceHidden":{const s=await St(t,{...a,elementContext:"reference"}),c=Va(s,r.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:Ga(c)}}}case"escaped":{const s=await St(t,{...a,altBoundary:!0}),c=Va(s,r.floating);return{data:{escapedOffsets:c,escaped:Ga(c)}}}default:return{}}}}};async function Ju(e,t){const{placement:r,platform:n,elements:a}=e,s=await(n.isRTL==null?void 0:n.isRTL(a.floating)),c=Fe(r),l=ut(r),u=Ue(r)==="y",d=["left","top"].includes(c)?-1:1,f=s&&u?-1:1,p=Le(t,e);let{mainAxis:h,crossAxis:m,alignmentAxis:b}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return l&&typeof b=="number"&&(m=l==="end"?b*-1:b),u?{x:m*f,y:h*d}:{x:h*d,y:m*f}}const ef=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:a,y:s,placement:c,middlewareData:l}=t,u=await Ju(t,e);return c===((r=l.offset)==null?void 0:r.placement)&&(n=l.arrow)!=null&&n.alignmentOffset?{}:{x:a+u.x,y:s+u.y,data:{...u,placement:c}}}}},tf=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:a}=t,{mainAxis:s=!0,crossAxis:c=!1,limiter:l={fn:w=>{let{x:v,y}=w;return{x:v,y}}},...u}=Le(e,t),d={x:r,y:n},f=await St(t,u),p=Ue(Fe(a)),h=un(p);let m=d[h],b=d[p];if(s){const w=h==="y"?"top":"left",v=h==="y"?"bottom":"right",y=m+f[w],x=m-f[v];m=dn(y,m,x)}if(c){const w=p==="y"?"top":"left",v=p==="y"?"bottom":"right",y=b+f[w],x=b-f[v];b=dn(y,b,x)}const g=l.fn({...t,[h]:m,[p]:b});return{...g,data:{x:g.x-r,y:g.y-n,enabled:{[h]:s,[p]:c}}}}}},rf=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:a,rects:s,middlewareData:c}=t,{offset:l=0,mainAxis:u=!0,crossAxis:d=!0}=Le(e,t),f={x:r,y:n},p=Ue(a),h=un(p);let m=f[h],b=f[p];const g=Le(l,t),w=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(u){const x=h==="y"?"height":"width",N=s.reference[h]-s.floating[x]+w.mainAxis,E=s.reference[h]+s.reference[x]-w.mainAxis;m<N?m=N:m>E&&(m=E)}if(d){var v,y;const x=h==="y"?"width":"height",N=["top","left"].includes(Fe(a)),E=s.reference[p]-s.floating[x]+(N&&((v=c.offset)==null?void 0:v[p])||0)+(N?0:w.crossAxis),C=s.reference[p]+s.reference[x]+(N?0:((y=c.offset)==null?void 0:y[p])||0)-(N?w.crossAxis:0);b<E?b=E:b>C&&(b=C)}return{[h]:m,[p]:b}}}},nf=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:a,rects:s,platform:c,elements:l}=t,{apply:u=()=>{},...d}=Le(e,t),f=await St(t,d),p=Fe(a),h=ut(a),m=Ue(a)==="y",{width:b,height:g}=s.floating;let w,v;p==="top"||p==="bottom"?(w=p,v=h===(await(c.isRTL==null?void 0:c.isRTL(l.floating))?"start":"end")?"left":"right"):(v=p,w=h==="end"?"top":"bottom");const y=g-f.top-f.bottom,x=b-f.left-f.right,N=Ge(g-f[w],y),E=Ge(b-f[v],x),C=!t.middlewareData.shift;let T=N,F=E;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(F=x),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(T=y),C&&!h){const B=me(f.left,0),z=me(f.right,0),W=me(f.top,0),L=me(f.bottom,0);m?F=b-2*(B!==0||z!==0?B+z:me(f.left,f.right)):T=g-2*(W!==0||L!==0?W+L:me(f.top,f.bottom))}await u({...t,availableWidth:F,availableHeight:T});const O=await c.getDimensions(l.floating);return b!==O.width||g!==O.height?{reset:{rects:!0}}:{}}}};function cr(){return typeof window<"u"}function ft(e){return Ua(e)?(e.nodeName||"").toLowerCase():"#document"}function be(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ie(e){var t;return(t=(Ua(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Ua(e){return cr()?e instanceof Node||e instanceof be(e).Node:!1}function Se(e){return cr()?e instanceof Element||e instanceof be(e).Element:!1}function ke(e){return cr()?e instanceof HTMLElement||e instanceof be(e).HTMLElement:!1}function ja(e){return!cr()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof be(e).ShadowRoot}function Et(e){const{overflow:t,overflowX:r,overflowY:n,display:a}=Ee(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!["inline","contents"].includes(a)}function of(e){return["table","td","th"].includes(ft(e))}function lr(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function gn(e){const t=vn(),r=Se(e)?Ee(e):e;return["transform","translate","scale","rotate","perspective"].some(n=>r[n]?r[n]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(n=>(r.willChange||"").includes(n))||["paint","layout","strict","content"].some(n=>(r.contain||"").includes(n))}function af(e){let t=je(e);for(;ke(t)&&!pt(t);){if(gn(t))return t;if(lr(t))return null;t=je(t)}return null}function vn(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function pt(e){return["html","body","#document"].includes(ft(e))}function Ee(e){return be(e).getComputedStyle(e)}function dr(e){return Se(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function je(e){if(ft(e)==="html")return e;const t=e.assignedSlot||e.parentNode||ja(e)&&e.host||Ie(e);return ja(t)?t.host:t}function Ha(e){const t=je(e);return pt(t)?e.ownerDocument?e.ownerDocument.body:e.body:ke(t)&&Et(t)?t:Ha(t)}function Tt(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const a=Ha(e),s=a===((n=e.ownerDocument)==null?void 0:n.body),c=be(a);if(s){const l=mn(c);return t.concat(c,c.visualViewport||[],Et(a)?a:[],l&&r?Tt(l):[])}return t.concat(a,Tt(a,[],r))}function mn(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Ka(e){const t=Ee(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const a=ke(e),s=a?e.offsetWidth:r,c=a?e.offsetHeight:n,l=or(r)!==s||or(n)!==c;return l&&(r=s,n=c),{width:r,height:n,$:l}}function bn(e){return Se(e)?e:e.contextElement}function ht(e){const t=bn(e);if(!ke(t))return De(1);const r=t.getBoundingClientRect(),{width:n,height:a,$:s}=Ka(t);let c=(s?or(r.width):r.width)/n,l=(s?or(r.height):r.height)/a;return(!c||!Number.isFinite(c))&&(c=1),(!l||!Number.isFinite(l))&&(l=1),{x:c,y:l}}const sf=De(0);function Ya(e){const t=be(e);return!vn()||!t.visualViewport?sf:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function cf(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==be(e)?!1:t}function Re(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const a=e.getBoundingClientRect(),s=bn(e);let c=De(1);t&&(n?Se(n)&&(c=ht(n)):c=ht(e));const l=cf(s,r,n)?Ya(s):De(0);let u=(a.left+l.x)/c.x,d=(a.top+l.y)/c.y,f=a.width/c.x,p=a.height/c.y;if(s){const h=be(s),m=n&&Se(n)?be(n):n;let b=h,g=mn(b);for(;g&&n&&m!==b;){const w=ht(g),v=g.getBoundingClientRect(),y=Ee(g),x=v.left+(g.clientLeft+parseFloat(y.paddingLeft))*w.x,N=v.top+(g.clientTop+parseFloat(y.paddingTop))*w.y;u*=w.x,d*=w.y,f*=w.x,p*=w.y,u+=x,d+=N,b=be(g),g=mn(b)}}return ir({width:f,height:p,x:u,y:d})}function wn(e,t){const r=dr(e).scrollLeft;return t?t.left+r:Re(Ie(e)).left+r}function qa(e,t,r){r===void 0&&(r=!1);const n=e.getBoundingClientRect(),a=n.left+t.scrollLeft-(r?0:wn(e,n)),s=n.top+t.scrollTop;return{x:a,y:s}}function lf(e){let{elements:t,rect:r,offsetParent:n,strategy:a}=e;const s=a==="fixed",c=Ie(n),l=t?lr(t.floating):!1;if(n===c||l&&s)return r;let u={scrollLeft:0,scrollTop:0},d=De(1);const f=De(0),p=ke(n);if((p||!p&&!s)&&((ft(n)!=="body"||Et(c))&&(u=dr(n)),ke(n))){const m=Re(n);d=ht(n),f.x=m.x+n.clientLeft,f.y=m.y+n.clientTop}const h=c&&!p&&!s?qa(c,u,!0):De(0);return{width:r.width*d.x,height:r.height*d.y,x:r.x*d.x-u.scrollLeft*d.x+f.x+h.x,y:r.y*d.y-u.scrollTop*d.y+f.y+h.y}}function df(e){return Array.from(e.getClientRects())}function uf(e){const t=Ie(e),r=dr(e),n=e.ownerDocument.body,a=me(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),s=me(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let c=-r.scrollLeft+wn(e);const l=-r.scrollTop;return Ee(n).direction==="rtl"&&(c+=me(t.clientWidth,n.clientWidth)-a),{width:a,height:s,x:c,y:l}}function ff(e,t){const r=be(e),n=Ie(e),a=r.visualViewport;let s=n.clientWidth,c=n.clientHeight,l=0,u=0;if(a){s=a.width,c=a.height;const d=vn();(!d||d&&t==="fixed")&&(l=a.offsetLeft,u=a.offsetTop)}return{width:s,height:c,x:l,y:u}}function pf(e,t){const r=Re(e,!0,t==="fixed"),n=r.top+e.clientTop,a=r.left+e.clientLeft,s=ke(e)?ht(e):De(1),c=e.clientWidth*s.x,l=e.clientHeight*s.y,u=a*s.x,d=n*s.y;return{width:c,height:l,x:u,y:d}}function Xa(e,t,r){let n;if(t==="viewport")n=ff(e,r);else if(t==="document")n=uf(Ie(e));else if(Se(t))n=pf(t,r);else{const a=Ya(e);n={x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}return ir(n)}function Qa(e,t){const r=je(e);return r===t||!Se(r)||pt(r)?!1:Ee(r).position==="fixed"||Qa(r,t)}function hf(e,t){const r=t.get(e);if(r)return r;let n=Tt(e,[],!1).filter(l=>Se(l)&&ft(l)!=="body"),a=null;const s=Ee(e).position==="fixed";let c=s?je(e):e;for(;Se(c)&&!pt(c);){const l=Ee(c),u=gn(c);!u&&l.position==="fixed"&&(a=null),(s?!u&&!a:!u&&l.position==="static"&&!!a&&["absolute","fixed"].includes(a.position)||Et(c)&&!u&&Qa(e,c))?n=n.filter(f=>f!==c):a=l,c=je(c)}return t.set(e,n),n}function gf(e){let{element:t,boundary:r,rootBoundary:n,strategy:a}=e;const c=[...r==="clippingAncestors"?lr(t)?[]:hf(t,this._c):[].concat(r),n],l=c[0],u=c.reduce((d,f)=>{const p=Xa(t,f,a);return d.top=me(p.top,d.top),d.right=Ge(p.right,d.right),d.bottom=Ge(p.bottom,d.bottom),d.left=me(p.left,d.left),d},Xa(t,l,a));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function vf(e){const{width:t,height:r}=Ka(e);return{width:t,height:r}}function mf(e,t,r){const n=ke(t),a=Ie(t),s=r==="fixed",c=Re(e,!0,s,t);let l={scrollLeft:0,scrollTop:0};const u=De(0);if(n||!n&&!s)if((ft(t)!=="body"||Et(a))&&(l=dr(t)),n){const h=Re(t,!0,s,t);u.x=h.x+t.clientLeft,u.y=h.y+t.clientTop}else a&&(u.x=wn(a));const d=a&&!n&&!s?qa(a,l):De(0),f=c.left+l.scrollLeft-u.x-d.x,p=c.top+l.scrollTop-u.y-d.y;return{x:f,y:p,width:c.width,height:c.height}}function yn(e){return Ee(e).position==="static"}function Ra(e,t){if(!ke(e)||Ee(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return Ie(e)===r&&(r=r.ownerDocument.body),r}function Za(e,t){const r=be(e);if(lr(e))return r;if(!ke(e)){let a=je(e);for(;a&&!pt(a);){if(Se(a)&&!yn(a))return a;a=je(a)}return r}let n=Ra(e,t);for(;n&&of(n)&&yn(n);)n=Ra(n,t);return n&&pt(n)&&yn(n)&&!gn(n)?r:n||af(e)||r}const bf=async function(e){const t=this.getOffsetParent||Za,r=this.getDimensions,n=await r(e.floating);return{reference:mf(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function wf(e){return Ee(e).direction==="rtl"}const yf={convertOffsetParentRelativeRectToViewportRelativeRect:lf,getDocumentElement:Ie,getClippingRect:gf,getOffsetParent:Za,getElementRects:bf,getClientRects:df,getDimensions:vf,getScale:ht,isElement:Se,isRTL:wf};function Ja(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function xf(e,t){let r=null,n;const a=Ie(e);function s(){var l;clearTimeout(n),(l=r)==null||l.disconnect(),r=null}function c(l,u){l===void 0&&(l=!1),u===void 0&&(u=1),s();const d=e.getBoundingClientRect(),{left:f,top:p,width:h,height:m}=d;if(l||t(),!h||!m)return;const b=ar(p),g=ar(a.clientWidth-(f+h)),w=ar(a.clientHeight-(p+m)),v=ar(f),x={rootMargin:-b+"px "+-g+"px "+-w+"px "+-v+"px",threshold:me(0,Ge(1,u))||1};let N=!0;function E(C){const T=C[0].intersectionRatio;if(T!==u){if(!N)return c();T?c(!1,T):n=setTimeout(()=>{c(!1,1e-7)},1e3)}T===1&&!Ja(d,e.getBoundingClientRect())&&c(),N=!1}try{r=new IntersectionObserver(E,{...x,root:a.ownerDocument})}catch{r=new IntersectionObserver(E,x)}r.observe(e)}return c(!0),s}function Nf(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:a=!0,ancestorResize:s=!0,elementResize:c=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:u=!1}=n,d=bn(e),f=a||s?[...d?Tt(d):[],...Tt(t)]:[];f.forEach(v=>{a&&v.addEventListener("scroll",r,{passive:!0}),s&&v.addEventListener("resize",r)});const p=d&&l?xf(d,r):null;let h=-1,m=null;c&&(m=new ResizeObserver(v=>{let[y]=v;y&&y.target===d&&m&&(m.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var x;(x=m)==null||x.observe(t)})),r()}),d&&!u&&m.observe(d),m.observe(t));let b,g=u?Re(e):null;u&&w();function w(){const v=Re(e);g&&!Ja(g,v)&&r(),g=v,b=requestAnimationFrame(w)}return r(),()=>{var v;f.forEach(y=>{a&&y.removeEventListener("scroll",r),s&&y.removeEventListener("resize",r)}),p==null||p(),(v=m)==null||v.disconnect(),m=null,u&&cancelAnimationFrame(b)}}const Cf=ef,Sf=tf,Ef=Ru,Tf=nf,Mf=Zu,es=Qu,Pf=rf,Af=(e,t,r)=>{const n=new Map,a={platform:yf,...r},s={...a.platform,_c:n};return Xu(e,t,{...a,platform:s})};var ur=typeof document<"u"?H.useLayoutEffect:H.useEffect;function fr(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let r,n,a;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;n--!==0;)if(!fr(e[n],t[n]))return!1;return!0}if(a=Object.keys(e),r=a.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(t,a[n]))return!1;for(n=r;n--!==0;){const s=a[n];if(!(s==="_owner"&&e.$$typeof)&&!fr(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function ts(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function rs(e,t){const r=ts(e);return Math.round(t*r)/r}function xn(e){const t=i.useRef(e);return ur(()=>{t.current=e}),t}function _f(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:a,elements:{reference:s,floating:c}={},transform:l=!0,whileElementsMounted:u,open:d}=e,[f,p]=i.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[h,m]=i.useState(n);fr(h,n)||m(n);const[b,g]=i.useState(null),[w,v]=i.useState(null),y=i.useCallback(D=>{D!==C.current&&(C.current=D,g(D))},[]),x=i.useCallback(D=>{D!==T.current&&(T.current=D,v(D))},[]),N=s||b,E=c||w,C=i.useRef(null),T=i.useRef(null),F=i.useRef(f),O=u!=null,B=xn(u),z=xn(a),W=xn(d),L=i.useCallback(()=>{if(!C.current||!T.current)return;const D={placement:t,strategy:r,middleware:h};z.current&&(D.platform=z.current),Af(C.current,T.current,D).then(M=>{const K={...M,isPositioned:W.current!==!1};P.current&&!fr(F.current,K)&&(F.current=K,_r.flushSync(()=>{p(K)}))})},[h,t,r,z,W]);ur(()=>{d===!1&&F.current.isPositioned&&(F.current.isPositioned=!1,p(D=>({...D,isPositioned:!1})))},[d]);const P=i.useRef(!1);ur(()=>(P.current=!0,()=>{P.current=!1}),[]),ur(()=>{if(N&&(C.current=N),E&&(T.current=E),N&&E){if(B.current)return B.current(N,E,L);L()}},[N,E,L,B,O]);const G=i.useMemo(()=>({reference:C,floating:T,setReference:y,setFloating:x}),[y,x]),A=i.useMemo(()=>({reference:N,floating:E}),[N,E]),q=i.useMemo(()=>{const D={position:r,left:0,top:0};if(!A.floating)return D;const M=rs(A.floating,f.x),K=rs(A.floating,f.y);return l?{...D,transform:"translate("+M+"px, "+K+"px)",...ts(A.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:M,top:K}},[r,l,A.floating,f.x,f.y]);return i.useMemo(()=>({...f,update:L,refs:G,elements:A,floatingStyles:q}),[f,L,G,A,q])}const Df=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:n,padding:a}=typeof e=="function"?e(r):e;return n&&t(n)?n.current!=null?es({element:n.current,padding:a}).fn(r):{}:n?es({element:n,padding:a}).fn(r):{}}}},If=(e,t)=>({...Cf(e),options:[e,t]}),kf=(e,t)=>({...Sf(e),options:[e,t]}),Of=(e,t)=>({...Pf(e),options:[e,t]}),Lf=(e,t)=>({...Ef(e),options:[e,t]}),Ff=(e,t)=>({...Tf(e),options:[e,t]}),$f=(e,t)=>({...Mf(e),options:[e,t]}),zf=(e,t)=>({...Df(e),options:[e,t]});var Bf="Arrow",ns=i.forwardRef((e,t)=>{const{children:r,width:n=10,height:a=5,...s}=e;return o.jsx(Q.svg,{...s,ref:t,width:n,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:o.jsx("polygon",{points:"0,0 30,0 15,10"})})});ns.displayName=Bf;var Wf=ns;function Vf(e){const[t,r]=i.useState(void 0);return We(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(a=>{if(!Array.isArray(a)||!a.length)return;const s=a[0];let c,l;if("borderBoxSize"in s){const u=s.borderBoxSize,d=Array.isArray(u)?u[0]:u;c=d.inlineSize,l=d.blockSize}else c=e.offsetWidth,l=e.offsetHeight;r({width:c,height:l})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}var Nn="Popper",[os,pr]=Be(Nn),[Gf,as]=os(Nn),ss=e=>{const{__scopePopper:t,children:r}=e,[n,a]=i.useState(null);return o.jsx(Gf,{scope:t,anchor:n,onAnchorChange:a,children:r})};ss.displayName=Nn;var is="PopperAnchor",cs=i.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...a}=e,s=as(is,r),c=i.useRef(null),l=oe(t,c);return i.useEffect(()=>{s.onAnchorChange((n==null?void 0:n.current)||c.current)}),n?null:o.jsx(Q.div,{...a,ref:l})});cs.displayName=is;var Cn="PopperContent",[Uf,jf]=os(Cn),ls=i.forwardRef((e,t)=>{var ae,Me,de,Pe,U,Z;const{__scopePopper:r,side:n="bottom",sideOffset:a=0,align:s="center",alignOffset:c=0,arrowPadding:l=0,avoidCollisions:u=!0,collisionBoundary:d=[],collisionPadding:f=0,sticky:p="partial",hideWhenDetached:h=!1,updatePositionStrategy:m="optimized",onPlaced:b,...g}=e,w=as(Cn,r),[v,y]=i.useState(null),x=oe(t,he=>y(he)),[N,E]=i.useState(null),C=Vf(N),T=(C==null?void 0:C.width)??0,F=(C==null?void 0:C.height)??0,O=n+(s!=="center"?"-"+s:""),B=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},z=Array.isArray(d)?d:[d],W=z.length>0,L={padding:B,boundary:z.filter(Kf),altBoundary:W},{refs:P,floatingStyles:G,placement:A,isPositioned:q,middlewareData:D}=_f({strategy:"fixed",placement:O,whileElementsMounted:(...he)=>Nf(...he,{animationFrame:m==="always"}),elements:{reference:w.anchor},middleware:[If({mainAxis:a+F,alignmentAxis:c}),u&&kf({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?Of():void 0,...L}),u&&Lf({...L}),Ff({...L,apply:({elements:he,rects:V,availableWidth:j,availableHeight:ue})=>{const{width:ge,height:ve}=V.reference,J=he.floating.style;J.setProperty("--radix-popper-available-width",`${j}px`),J.setProperty("--radix-popper-available-height",`${ue}px`),J.setProperty("--radix-popper-anchor-width",`${ge}px`),J.setProperty("--radix-popper-anchor-height",`${ve}px`)}}),N&&zf({element:N,padding:l}),Yf({arrowWidth:T,arrowHeight:F}),h&&$f({strategy:"referenceHidden",...L})]}),[M,K]=fs(A),X=fe(b);We(()=>{q&&(X==null||X())},[q,X]);const ee=(ae=D.arrow)==null?void 0:ae.x,te=(Me=D.arrow)==null?void 0:Me.y,ne=((de=D.arrow)==null?void 0:de.centerOffset)!==0,[se,le]=i.useState();return We(()=>{v&&le(window.getComputedStyle(v).zIndex)},[v]),o.jsx("div",{ref:P.setFloating,"data-radix-popper-content-wrapper":"",style:{...G,transform:q?G.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:se,"--radix-popper-transform-origin":[(Pe=D.transformOrigin)==null?void 0:Pe.x,(U=D.transformOrigin)==null?void 0:U.y].join(" "),...((Z=D.hide)==null?void 0:Z.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:o.jsx(Uf,{scope:r,placedSide:M,onArrowChange:E,arrowX:ee,arrowY:te,shouldHideArrow:ne,children:o.jsx(Q.div,{"data-side":M,"data-align":K,...g,ref:x,style:{...g.style,animation:q?void 0:"none"}})})})});ls.displayName=Cn;var ds="PopperArrow",Hf={top:"bottom",right:"left",bottom:"top",left:"right"},us=i.forwardRef(function(t,r){const{__scopePopper:n,...a}=t,s=jf(ds,n),c=Hf[s.placedSide];return o.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[c]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:o.jsx(Wf,{...a,ref:r,style:{...a.style,display:"block"}})})});us.displayName=ds;function Kf(e){return e!==null}var Yf=e=>({name:"transformOrigin",options:e,fn(t){var w,v,y;const{placement:r,rects:n,middlewareData:a}=t,c=((w=a.arrow)==null?void 0:w.centerOffset)!==0,l=c?0:e.arrowWidth,u=c?0:e.arrowHeight,[d,f]=fs(r),p={start:"0%",center:"50%",end:"100%"}[f],h=(((v=a.arrow)==null?void 0:v.x)??0)+l/2,m=(((y=a.arrow)==null?void 0:y.y)??0)+u/2;let b="",g="";return d==="bottom"?(b=c?p:`${h}px`,g=`${-u}px`):d==="top"?(b=c?p:`${h}px`,g=`${n.floating.height+u}px`):d==="right"?(b=`${-u}px`,g=c?p:`${m}px`):d==="left"&&(b=`${n.floating.width+u}px`,g=c?p:`${m}px`),{data:{x:b,y:g}}}});function fs(e){const[t,r="center"]=e.split("-");return[t,r]}var Sn=ss,ps=cs,hs=ls,gs=us,En="rovingFocusGroup.onEntryFocus",qf={bubbles:!1,cancelable:!0},hr="RovingFocusGroup",[Tn,vs,Xf]=ln(hr),[Qf,ms]=Be(hr,[Xf]),[Rf,Zf]=Qf(hr),bs=i.forwardRef((e,t)=>o.jsx(Tn.Provider,{scope:e.__scopeRovingFocusGroup,children:o.jsx(Tn.Slot,{scope:e.__scopeRovingFocusGroup,children:o.jsx(Jf,{...e,ref:t})})}));bs.displayName=hr;var Jf=i.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,orientation:n,loop:a=!1,dir:s,currentTabStopId:c,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:u,onEntryFocus:d,preventScrollOnEntryFocus:f=!1,...p}=e,h=i.useRef(null),m=oe(t,h),b=za(s),[g=null,w]=st({prop:c,defaultProp:l,onChange:u}),[v,y]=i.useState(!1),x=fe(d),N=vs(r),E=i.useRef(!1),[C,T]=i.useState(0);return i.useEffect(()=>{const F=h.current;if(F)return F.addEventListener(En,x),()=>F.removeEventListener(En,x)},[x]),o.jsx(Rf,{scope:r,orientation:n,dir:b,loop:a,currentTabStopId:g,onItemFocus:i.useCallback(F=>w(F),[w]),onItemShiftTab:i.useCallback(()=>y(!0),[]),onFocusableItemAdd:i.useCallback(()=>T(F=>F+1),[]),onFocusableItemRemove:i.useCallback(()=>T(F=>F-1),[]),children:o.jsx(Q.div,{tabIndex:v||C===0?-1:0,"data-orientation":n,...p,ref:m,style:{outline:"none",...e.style},onMouseDown:$(e.onMouseDown,()=>{E.current=!0}),onFocus:$(e.onFocus,F=>{const O=!E.current;if(F.target===F.currentTarget&&O&&!v){const B=new CustomEvent(En,qf);if(F.currentTarget.dispatchEvent(B),!B.defaultPrevented){const z=N().filter(A=>A.focusable),W=z.find(A=>A.active),L=z.find(A=>A.id===g),G=[W,L,...z].filter(Boolean).map(A=>A.ref.current);xs(G,f)}}E.current=!1}),onBlur:$(e.onBlur,()=>y(!1))})})}),ws="RovingFocusGroupItem",ys=i.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:a=!1,tabStopId:s,...c}=e,l=Oe(),u=s||l,d=Zf(ws,r),f=d.currentTabStopId===u,p=vs(r),{onFocusableItemAdd:h,onFocusableItemRemove:m}=d;return i.useEffect(()=>{if(n)return h(),()=>m()},[n,h,m]),o.jsx(Tn.ItemSlot,{scope:r,id:u,focusable:n,active:a,children:o.jsx(Q.span,{tabIndex:f?0:-1,"data-orientation":d.orientation,...c,ref:t,onMouseDown:$(e.onMouseDown,b=>{n?d.onItemFocus(u):b.preventDefault()}),onFocus:$(e.onFocus,()=>d.onItemFocus(u)),onKeyDown:$(e.onKeyDown,b=>{if(b.key==="Tab"&&b.shiftKey){d.onItemShiftTab();return}if(b.target!==b.currentTarget)return;const g=rp(b,d.orientation,d.dir);if(g!==void 0){if(b.metaKey||b.ctrlKey||b.altKey||b.shiftKey)return;b.preventDefault();let v=p().filter(y=>y.focusable).map(y=>y.ref.current);if(g==="last")v.reverse();else if(g==="prev"||g==="next"){g==="prev"&&v.reverse();const y=v.indexOf(b.currentTarget);v=d.loop?np(v,y+1):v.slice(y+1)}setTimeout(()=>xs(v))}})})})});ys.displayName=ws;var ep={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function tp(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function rp(e,t,r){const n=tp(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return ep[n]}function xs(e,t=!1){const r=document.activeElement;for(const n of e)if(n===r||(n.focus({preventScroll:t}),document.activeElement!==r))return}function np(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var op=bs,ap=ys,Mn=["Enter"," "],sp=["ArrowDown","PageUp","Home"],Ns=["ArrowUp","PageDown","End"],ip=[...sp,...Ns],cp={ltr:[...Mn,"ArrowRight"],rtl:[...Mn,"ArrowLeft"]},lp={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Mt="Menu",[Pt,dp,up]=ln(Mt),[Ze,Cs]=Be(Mt,[up,pr,ms]),At=pr(),Ss=ms(),[Es,He]=Ze(Mt),[fp,_t]=Ze(Mt),Ts=e=>{const{__scopeMenu:t,open:r=!1,children:n,dir:a,onOpenChange:s,modal:c=!0}=e,l=At(t),[u,d]=i.useState(null),f=i.useRef(!1),p=fe(s),h=za(a);return i.useEffect(()=>{const m=()=>{f.current=!0,document.addEventListener("pointerdown",b,{capture:!0,once:!0}),document.addEventListener("pointermove",b,{capture:!0,once:!0})},b=()=>f.current=!1;return document.addEventListener("keydown",m,{capture:!0}),()=>{document.removeEventListener("keydown",m,{capture:!0}),document.removeEventListener("pointerdown",b,{capture:!0}),document.removeEventListener("pointermove",b,{capture:!0})}},[]),o.jsx(Sn,{...l,children:o.jsx(Es,{scope:t,open:r,onOpenChange:p,content:u,onContentChange:d,children:o.jsx(fp,{scope:t,onClose:i.useCallback(()=>p(!1),[p]),isUsingKeyboardRef:f,dir:h,modal:c,children:n})})})};Ts.displayName=Mt;var pp="MenuAnchor",Pn=i.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e,a=At(r);return o.jsx(ps,{...a,...n,ref:t})});Pn.displayName=pp;var An="MenuPortal",[hp,Ms]=Ze(An,{forceMount:void 0}),Ps=e=>{const{__scopeMenu:t,forceMount:r,children:n,container:a}=e,s=He(An,t);return o.jsx(hp,{scope:t,forceMount:r,children:o.jsx(Ne,{present:r||s.open,children:o.jsx(xt,{asChild:!0,container:a,children:n})})})};Ps.displayName=An;var xe="MenuContent",[gp,_n]=Ze(xe),As=i.forwardRef((e,t)=>{const r=Ms(xe,e.__scopeMenu),{forceMount:n=r.forceMount,...a}=e,s=He(xe,e.__scopeMenu),c=_t(xe,e.__scopeMenu);return o.jsx(Pt.Provider,{scope:e.__scopeMenu,children:o.jsx(Ne,{present:n||s.open,children:o.jsx(Pt.Slot,{scope:e.__scopeMenu,children:c.modal?o.jsx(vp,{...a,ref:t}):o.jsx(mp,{...a,ref:t})})})})}),vp=i.forwardRef((e,t)=>{const r=He(xe,e.__scopeMenu),n=i.useRef(null),a=oe(t,n);return i.useEffect(()=>{const s=n.current;if(s)return ba(s)},[]),o.jsx(Dn,{...e,ref:a,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:$(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})}),mp=i.forwardRef((e,t)=>{const r=He(xe,e.__scopeMenu);return o.jsx(Dn,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})}),Dn=i.forwardRef((e,t)=>{const{__scopeMenu:r,loop:n=!1,trapFocus:a,onOpenAutoFocus:s,onCloseAutoFocus:c,disableOutsidePointerEvents:l,onEntryFocus:u,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:p,onInteractOutside:h,onDismiss:m,disableOutsideScroll:b,...g}=e,w=He(xe,r),v=_t(xe,r),y=At(r),x=Ss(r),N=dp(r),[E,C]=i.useState(null),T=i.useRef(null),F=oe(t,T,w.onContentChange),O=i.useRef(0),B=i.useRef(""),z=i.useRef(0),W=i.useRef(null),L=i.useRef("right"),P=i.useRef(0),G=b?Qr:i.Fragment,A=b?{as:ye,allowPinchZoom:!0}:void 0,q=M=>{var ae,Me;const K=B.current+M,X=N().filter(de=>!de.disabled),ee=document.activeElement,te=(ae=X.find(de=>de.ref.current===ee))==null?void 0:ae.textValue,ne=X.map(de=>de.textValue),se=Ap(ne,K,te),le=(Me=X.find(de=>de.textValue===se))==null?void 0:Me.ref.current;(function de(Pe){B.current=Pe,window.clearTimeout(O.current),Pe!==""&&(O.current=window.setTimeout(()=>de(""),1e3))})(K),le&&setTimeout(()=>le.focus())};i.useEffect(()=>()=>window.clearTimeout(O.current),[]),na();const D=i.useCallback(M=>{var X,ee;return L.current===((X=W.current)==null?void 0:X.side)&&Dp(M,(ee=W.current)==null?void 0:ee.area)},[]);return o.jsx(gp,{scope:r,searchRef:B,onItemEnter:i.useCallback(M=>{D(M)&&M.preventDefault()},[D]),onItemLeave:i.useCallback(M=>{var K;D(M)||((K=T.current)==null||K.focus(),C(null))},[D]),onTriggerLeave:i.useCallback(M=>{D(M)&&M.preventDefault()},[D]),pointerGraceTimerRef:z,onPointerGraceIntentChange:i.useCallback(M=>{W.current=M},[]),children:o.jsx(G,{...A,children:o.jsx(jr,{asChild:!0,trapped:a,onMountAutoFocus:$(s,M=>{var K;M.preventDefault(),(K=T.current)==null||K.focus({preventScroll:!0})}),onUnmountAutoFocus:c,children:o.jsx(yt,{asChild:!0,disableOutsidePointerEvents:l,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:p,onInteractOutside:h,onDismiss:m,children:o.jsx(op,{asChild:!0,...x,dir:v.dir,orientation:"vertical",loop:n,currentTabStopId:E,onCurrentTabStopIdChange:C,onEntryFocus:$(u,M=>{v.isUsingKeyboardRef.current||M.preventDefault()}),preventScrollOnEntryFocus:!0,children:o.jsx(hs,{role:"menu","aria-orientation":"vertical","data-state":Ys(w.open),"data-radix-menu-content":"",dir:v.dir,...y,...g,ref:F,style:{outline:"none",...g.style},onKeyDown:$(g.onKeyDown,M=>{const X=M.target.closest("[data-radix-menu-content]")===M.currentTarget,ee=M.ctrlKey||M.altKey||M.metaKey,te=M.key.length===1;X&&(M.key==="Tab"&&M.preventDefault(),!ee&&te&&q(M.key));const ne=T.current;if(M.target!==ne||!ip.includes(M.key))return;M.preventDefault();const le=N().filter(ae=>!ae.disabled).map(ae=>ae.ref.current);Ns.includes(M.key)&&le.reverse(),Mp(le)}),onBlur:$(e.onBlur,M=>{M.currentTarget.contains(M.target)||(window.clearTimeout(O.current),B.current="")}),onPointerMove:$(e.onPointerMove,It(M=>{const K=M.target,X=P.current!==M.clientX;if(M.currentTarget.contains(K)&&X){const ee=M.clientX>P.current?"right":"left";L.current=ee,P.current=M.clientX}}))})})})})})})});As.displayName=xe;var bp="MenuGroup",In=i.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return o.jsx(Q.div,{role:"group",...n,ref:t})});In.displayName=bp;var wp="MenuLabel",_s=i.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return o.jsx(Q.div,{...n,ref:t})});_s.displayName=wp;var gr="MenuItem",Ds="menu.itemSelect",vr=i.forwardRef((e,t)=>{const{disabled:r=!1,onSelect:n,...a}=e,s=i.useRef(null),c=_t(gr,e.__scopeMenu),l=_n(gr,e.__scopeMenu),u=oe(t,s),d=i.useRef(!1),f=()=>{const p=s.current;if(!r&&p){const h=new CustomEvent(Ds,{bubbles:!0,cancelable:!0});p.addEventListener(Ds,m=>n==null?void 0:n(m),{once:!0}),Wr(p,h),h.defaultPrevented?d.current=!1:c.onClose()}};return o.jsx(Is,{...a,ref:u,disabled:r,onClick:$(e.onClick,f),onPointerDown:p=>{var h;(h=e.onPointerDown)==null||h.call(e,p),d.current=!0},onPointerUp:$(e.onPointerUp,p=>{var h;d.current||(h=p.currentTarget)==null||h.click()}),onKeyDown:$(e.onKeyDown,p=>{const h=l.searchRef.current!=="";r||h&&p.key===" "||Mn.includes(p.key)&&(p.currentTarget.click(),p.preventDefault())})})});vr.displayName=gr;var Is=i.forwardRef((e,t)=>{const{__scopeMenu:r,disabled:n=!1,textValue:a,...s}=e,c=_n(gr,r),l=Ss(r),u=i.useRef(null),d=oe(t,u),[f,p]=i.useState(!1),[h,m]=i.useState("");return i.useEffect(()=>{const b=u.current;b&&m((b.textContent??"").trim())},[s.children]),o.jsx(Pt.ItemSlot,{scope:r,disabled:n,textValue:a??h,children:o.jsx(ap,{asChild:!0,...l,focusable:!n,children:o.jsx(Q.div,{role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":n||void 0,"data-disabled":n?"":void 0,...s,ref:d,onPointerMove:$(e.onPointerMove,It(b=>{n?c.onItemLeave(b):(c.onItemEnter(b),b.defaultPrevented||b.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:$(e.onPointerLeave,It(b=>c.onItemLeave(b))),onFocus:$(e.onFocus,()=>p(!0)),onBlur:$(e.onBlur,()=>p(!1))})})})}),yp="MenuCheckboxItem",ks=i.forwardRef((e,t)=>{const{checked:r=!1,onCheckedChange:n,...a}=e;return o.jsx(zs,{scope:e.__scopeMenu,checked:r,children:o.jsx(vr,{role:"menuitemcheckbox","aria-checked":mr(r)?"mixed":r,...a,ref:t,"data-state":Ln(r),onSelect:$(a.onSelect,()=>n==null?void 0:n(mr(r)?!0:!r),{checkForDefaultPrevented:!1})})})});ks.displayName=yp;var Os="MenuRadioGroup",[xp,Np]=Ze(Os,{value:void 0,onValueChange:()=>{}}),Ls=i.forwardRef((e,t)=>{const{value:r,onValueChange:n,...a}=e,s=fe(n);return o.jsx(xp,{scope:e.__scopeMenu,value:r,onValueChange:s,children:o.jsx(In,{...a,ref:t})})});Ls.displayName=Os;var Fs="MenuRadioItem",$s=i.forwardRef((e,t)=>{const{value:r,...n}=e,a=Np(Fs,e.__scopeMenu),s=r===a.value;return o.jsx(zs,{scope:e.__scopeMenu,checked:s,children:o.jsx(vr,{role:"menuitemradio","aria-checked":s,...n,ref:t,"data-state":Ln(s),onSelect:$(n.onSelect,()=>{var c;return(c=a.onValueChange)==null?void 0:c.call(a,r)},{checkForDefaultPrevented:!1})})})});$s.displayName=Fs;var kn="MenuItemIndicator",[zs,Cp]=Ze(kn,{checked:!1}),Bs=i.forwardRef((e,t)=>{const{__scopeMenu:r,forceMount:n,...a}=e,s=Cp(kn,r);return o.jsx(Ne,{present:n||mr(s.checked)||s.checked===!0,children:o.jsx(Q.span,{...a,ref:t,"data-state":Ln(s.checked)})})});Bs.displayName=kn;var Sp="MenuSeparator",Ws=i.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return o.jsx(Q.div,{role:"separator","aria-orientation":"horizontal",...n,ref:t})});Ws.displayName=Sp;var Ep="MenuArrow",Vs=i.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e,a=At(r);return o.jsx(gs,{...a,...n,ref:t})});Vs.displayName=Ep;var On="MenuSub",[Tp,Gs]=Ze(On),Us=e=>{const{__scopeMenu:t,children:r,open:n=!1,onOpenChange:a}=e,s=He(On,t),c=At(t),[l,u]=i.useState(null),[d,f]=i.useState(null),p=fe(a);return i.useEffect(()=>(s.open===!1&&p(!1),()=>p(!1)),[s.open,p]),o.jsx(Sn,{...c,children:o.jsx(Es,{scope:t,open:n,onOpenChange:p,content:d,onContentChange:f,children:o.jsx(Tp,{scope:t,contentId:Oe(),triggerId:Oe(),trigger:l,onTriggerChange:u,children:r})})})};Us.displayName=On;var Dt="MenuSubTrigger",js=i.forwardRef((e,t)=>{const r=He(Dt,e.__scopeMenu),n=_t(Dt,e.__scopeMenu),a=Gs(Dt,e.__scopeMenu),s=_n(Dt,e.__scopeMenu),c=i.useRef(null),{pointerGraceTimerRef:l,onPointerGraceIntentChange:u}=s,d={__scopeMenu:e.__scopeMenu},f=i.useCallback(()=>{c.current&&window.clearTimeout(c.current),c.current=null},[]);return i.useEffect(()=>f,[f]),i.useEffect(()=>{const p=l.current;return()=>{window.clearTimeout(p),u(null)}},[l,u]),o.jsx(Pn,{asChild:!0,...d,children:o.jsx(Is,{id:a.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":a.contentId,"data-state":Ys(r.open),...e,ref:Vt(t,a.onTriggerChange),onClick:p=>{var h;(h=e.onClick)==null||h.call(e,p),!(e.disabled||p.defaultPrevented)&&(p.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:$(e.onPointerMove,It(p=>{s.onItemEnter(p),!p.defaultPrevented&&!e.disabled&&!r.open&&!c.current&&(s.onPointerGraceIntentChange(null),c.current=window.setTimeout(()=>{r.onOpenChange(!0),f()},100))})),onPointerLeave:$(e.onPointerLeave,It(p=>{var m,b;f();const h=(m=r.content)==null?void 0:m.getBoundingClientRect();if(h){const g=(b=r.content)==null?void 0:b.dataset.side,w=g==="right",v=w?-5:5,y=h[w?"left":"right"],x=h[w?"right":"left"];s.onPointerGraceIntentChange({area:[{x:p.clientX+v,y:p.clientY},{x:y,y:h.top},{x,y:h.top},{x,y:h.bottom},{x:y,y:h.bottom}],side:g}),window.clearTimeout(l.current),l.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(p),p.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:$(e.onKeyDown,p=>{var m;const h=s.searchRef.current!=="";e.disabled||h&&p.key===" "||cp[n.dir].includes(p.key)&&(r.onOpenChange(!0),(m=r.content)==null||m.focus(),p.preventDefault())})})})});js.displayName=Dt;var Hs="MenuSubContent",Ks=i.forwardRef((e,t)=>{const r=Ms(xe,e.__scopeMenu),{forceMount:n=r.forceMount,...a}=e,s=He(xe,e.__scopeMenu),c=_t(xe,e.__scopeMenu),l=Gs(Hs,e.__scopeMenu),u=i.useRef(null),d=oe(t,u);return o.jsx(Pt.Provider,{scope:e.__scopeMenu,children:o.jsx(Ne,{present:n||s.open,children:o.jsx(Pt.Slot,{scope:e.__scopeMenu,children:o.jsx(Dn,{id:l.contentId,"aria-labelledby":l.triggerId,...a,ref:d,align:"start",side:c.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:f=>{var p;c.isUsingKeyboardRef.current&&((p=u.current)==null||p.focus()),f.preventDefault()},onCloseAutoFocus:f=>f.preventDefault(),onFocusOutside:$(e.onFocusOutside,f=>{f.target!==l.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:$(e.onEscapeKeyDown,f=>{c.onClose(),f.preventDefault()}),onKeyDown:$(e.onKeyDown,f=>{var m;const p=f.currentTarget.contains(f.target),h=lp[c.dir].includes(f.key);p&&h&&(s.onOpenChange(!1),(m=l.trigger)==null||m.focus(),f.preventDefault())})})})})})});Ks.displayName=Hs;function Ys(e){return e?"open":"closed"}function mr(e){return e==="indeterminate"}function Ln(e){return mr(e)?"indeterminate":e?"checked":"unchecked"}function Mp(e){const t=document.activeElement;for(const r of e)if(r===t||(r.focus(),document.activeElement!==t))return}function Pp(e,t){return e.map((r,n)=>e[(t+n)%e.length])}function Ap(e,t,r){const a=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,s=r?e.indexOf(r):-1;let c=Pp(e,Math.max(s,0));a.length===1&&(c=c.filter(d=>d!==r));const u=c.find(d=>d.toLowerCase().startsWith(a.toLowerCase()));return u!==r?u:void 0}function _p(e,t){const{x:r,y:n}=e;let a=!1;for(let s=0,c=t.length-1;s<t.length;c=s++){const l=t[s].x,u=t[s].y,d=t[c].x,f=t[c].y;u>n!=f>n&&r<(d-l)*(n-u)/(f-u)+l&&(a=!a)}return a}function Dp(e,t){if(!t)return!1;const r={x:e.clientX,y:e.clientY};return _p(r,t)}function It(e){return t=>t.pointerType==="mouse"?e(t):void 0}var Ip=Ts,kp=Pn,Op=Ps,Lp=As,Fp=In,$p=_s,zp=vr,Bp=ks,Wp=Ls,Vp=$s,Gp=Bs,Up=Ws,jp=Vs,Hp=Us,Kp=js,Yp=Ks,Fn="DropdownMenu",[qp,sv]=Be(Fn,[Cs]),pe=Cs(),[Xp,qs]=qp(Fn),Xs=e=>{const{__scopeDropdownMenu:t,children:r,dir:n,open:a,defaultOpen:s,onOpenChange:c,modal:l=!0}=e,u=pe(t),d=i.useRef(null),[f=!1,p]=st({prop:a,defaultProp:s,onChange:c});return o.jsx(Xp,{scope:t,triggerId:Oe(),triggerRef:d,contentId:Oe(),open:f,onOpenChange:p,onOpenToggle:i.useCallback(()=>p(h=>!h),[p]),modal:l,children:o.jsx(Ip,{...u,open:f,onOpenChange:p,dir:n,modal:l,children:r})})};Xs.displayName=Fn;var Qs="DropdownMenuTrigger",Rs=i.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,disabled:n=!1,...a}=e,s=qs(Qs,r),c=pe(r);return o.jsx(kp,{asChild:!0,...c,children:o.jsx(Q.button,{type:"button",id:s.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":s.open?"open":"closed","data-disabled":n?"":void 0,disabled:n,...a,ref:Vt(t,s.triggerRef),onPointerDown:$(e.onPointerDown,l=>{!n&&l.button===0&&l.ctrlKey===!1&&(s.onOpenToggle(),s.open||l.preventDefault())}),onKeyDown:$(e.onKeyDown,l=>{n||(["Enter"," "].includes(l.key)&&s.onOpenToggle(),l.key==="ArrowDown"&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(l.key)&&l.preventDefault())})})})});Rs.displayName=Qs;var Qp="DropdownMenuPortal",Zs=e=>{const{__scopeDropdownMenu:t,...r}=e,n=pe(t);return o.jsx(Op,{...n,...r})};Zs.displayName=Qp;var Js="DropdownMenuContent",ei=i.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,a=qs(Js,r),s=pe(r),c=i.useRef(!1);return o.jsx(Lp,{id:a.contentId,"aria-labelledby":a.triggerId,...s,...n,ref:t,onCloseAutoFocus:$(e.onCloseAutoFocus,l=>{var u;c.current||(u=a.triggerRef.current)==null||u.focus(),c.current=!1,l.preventDefault()}),onInteractOutside:$(e.onInteractOutside,l=>{const u=l.detail.originalEvent,d=u.button===0&&u.ctrlKey===!0,f=u.button===2||d;(!a.modal||f)&&(c.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});ei.displayName=Js;var Rp="DropdownMenuGroup",ti=i.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,a=pe(r);return o.jsx(Fp,{...a,...n,ref:t})});ti.displayName=Rp;var Zp="DropdownMenuLabel",ri=i.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,a=pe(r);return o.jsx($p,{...a,...n,ref:t})});ri.displayName=Zp;var Jp="DropdownMenuItem",ni=i.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,a=pe(r);return o.jsx(zp,{...a,...n,ref:t})});ni.displayName=Jp;var eh="DropdownMenuCheckboxItem",oi=i.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,a=pe(r);return o.jsx(Bp,{...a,...n,ref:t})});oi.displayName=eh;var th="DropdownMenuRadioGroup",ai=i.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,a=pe(r);return o.jsx(Wp,{...a,...n,ref:t})});ai.displayName=th;var rh="DropdownMenuRadioItem",si=i.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,a=pe(r);return o.jsx(Vp,{...a,...n,ref:t})});si.displayName=rh;var nh="DropdownMenuItemIndicator",ii=i.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,a=pe(r);return o.jsx(Gp,{...a,...n,ref:t})});ii.displayName=nh;var oh="DropdownMenuSeparator",ci=i.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,a=pe(r);return o.jsx(Up,{...a,...n,ref:t})});ci.displayName=oh;var ah="DropdownMenuArrow",sh=i.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,a=pe(r);return o.jsx(jp,{...a,...n,ref:t})});sh.displayName=ah;var ih=e=>{const{__scopeDropdownMenu:t,children:r,open:n,onOpenChange:a,defaultOpen:s}=e,c=pe(t),[l=!1,u]=st({prop:n,defaultProp:s,onChange:a});return o.jsx(Hp,{...c,open:l,onOpenChange:u,children:r})},ch="DropdownMenuSubTrigger",li=i.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,a=pe(r);return o.jsx(Kp,{...a,...n,ref:t})});li.displayName=ch;var lh="DropdownMenuSubContent",di=i.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,a=pe(r);return o.jsx(Yp,{...a,...n,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});di.displayName=lh;var dh=Xs,uh=Rs,ui=Zs,fi=ei,fh=ti,pi=ri,hi=ni,gi=oi,ph=ai,vi=si,mi=ii,bi=ci,hh=ih,wi=li,yi=di;const gh=dh,vh=uh,mh=fh,bh=ui,wh=hh,yh=ph,xi=i.forwardRef(({className:e,inset:t,children:r,...n},a)=>o.jsxs(wi,{ref:a,className:_("flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",t&&"pl-8",e),...n,children:[r,o.jsx(fl,{className:"ml-auto"})]}));xi.displayName=wi.displayName;const Ni=i.forwardRef(({className:e,...t},r)=>o.jsx(yi,{ref:r,className:_("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]",e),...t}));Ni.displayName=yi.displayName;const Ci=i.forwardRef(({className:e,sideOffset:t=4,...r},n)=>o.jsx(ui,{children:o.jsx(fi,{ref:n,sideOffset:t,className:_("z-50 max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]",e),...r})}));Ci.displayName=fi.displayName;const Si=i.forwardRef(({className:e,inset:t,...r},n)=>o.jsx(hi,{ref:n,className:_("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0",t&&"pl-8",e),...r}));Si.displayName=hi.displayName;const Ei=i.forwardRef(({className:e,children:t,checked:r,...n},a)=>o.jsxs(gi,{ref:a,className:_("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:r,...n,children:[o.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:o.jsx(mi,{children:o.jsx(Dr,{className:"h-4 w-4"})})}),t]}));Ei.displayName=gi.displayName;const Ti=i.forwardRef(({className:e,children:t,...r},n)=>o.jsxs(vi,{ref:n,className:_("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[o.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:o.jsx(mi,{children:o.jsx(hl,{className:"h-2 w-2 fill-current"})})}),t]}));Ti.displayName=vi.displayName;const Mi=i.forwardRef(({className:e,inset:t,...r},n)=>o.jsx(pi,{ref:n,className:_("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...r}));Mi.displayName=pi.displayName;const Pi=i.forwardRef(({className:e,...t},r)=>o.jsx(bi,{ref:r,className:_("-mx-1 my-1 h-px bg-muted",e),...t}));Pi.displayName=bi.displayName;const Ai=({className:e,...t})=>o.jsx("span",{className:_("ml-auto text-xs tracking-widest opacity-60",e),...t});Ai.displayName="DropdownMenuShortcut";function _i({inventory:e,showBinLocation:t}){const r=(v,y,x=!1,N=!0)=>o.jsxs("div",{className:`p-3 text-sm ${N&&y>0?"border-t":""} ${x?"border-r":""}`,children:[o.jsxs("div",{className:"flex justify-between font-medium",children:[o.jsx("span",{children:v.Name}),o.jsx("span",{children:v.AvailableQuantity})]}),o.jsxs("div",{className:"flex justify-between mt-1 text-xs text-gray-600",children:[o.jsx("span",{children:"Expecting"}),o.jsx("span",{children:v.PurchaseOrderQuantity||"-"})]}),t&&o.jsxs("div",{className:"flex justify-between mt-1 text-xs text-gray-600",children:[o.jsx("span",{children:"Bin Location"}),o.jsx("span",{children:v.BinLocation||"-"})]})]},`warehouse-${v.WarehouseId}`),n=["MTL","TOR"],a=["VAN","EDM"],s=[...e].sort((v,y)=>(v.Name||"").localeCompare(y.Name||"")),c=s.filter(v=>v.Country==="US"),l=s.filter(v=>v.Country==="CA"),u=s.filter(v=>a.includes(v.WarehouseId||"")),d=s.filter(v=>n.includes(v.WarehouseId||"")),f=l.filter(v=>!n.includes(v.WarehouseId||"")&&!a.includes(v.WarehouseId||"")),p=v=>v.reduce((y,x)=>y+(x.AvailableQuantity||0),0),h=p(l),m=p(d),b=p(u),g=p(c),w=h+g;return o.jsxs("div",{className:"border rounded-md overflow-hidden",children:[l.length>0&&c.length>0&&o.jsxs("div",{className:"grid grid-cols-2 border-b",children:[o.jsxs("div",{className:"p-3 font-semibold text-sm flex justify-between",children:[o.jsx("span",{children:"Total"}),o.jsx("span",{children:w})]}),o.jsx("div",{className:"p-3"})]}),l.length>0&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"grid grid-cols-2 border-b bg-gray-50",children:[o.jsxs("div",{className:"p-3 font-semibold text-sm flex justify-between",children:[o.jsx("span",{children:"Canada"}),o.jsx("span",{children:h})]}),o.jsx("div",{className:"p-3"})]}),o.jsxs("div",{className:"grid grid-cols-2",children:[o.jsxs("div",{className:"border-r",children:[o.jsxs("div",{className:"p-3 font-semibold text-sm flex justify-between",children:[o.jsx("span",{children:"West"}),o.jsx("span",{children:b})]}),u.map((v,y)=>r(v,y))]}),o.jsxs("div",{children:[o.jsxs("div",{className:"p-3 font-semibold text-sm flex justify-between",children:[o.jsx("span",{children:"East"}),o.jsx("span",{children:m})]}),d.map((v,y)=>r(v,y))]})]}),f.length>0&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"border-t p-3 font-semibold text-sm",children:o.jsx("span",{children:"Other"})}),o.jsx("div",{className:"grid grid-cols-2",children:f.map((v,y)=>r(v,y,y%2===0,!0))})]})]}),c.length>0&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"grid grid-cols-2 border-t bg-gray-50",children:[o.jsxs("div",{className:"p-3 font-semibold text-sm flex justify-between",children:[o.jsx("span",{children:"United States"}),o.jsx("span",{children:g})]}),o.jsx("div",{className:"p-3"})]}),o.jsx("div",{className:"grid grid-cols-2",children:c.map((v,y)=>r(v,y,y%2===0,!0))})]}),e.length===0&&o.jsx("div",{className:"p-6 text-center text-gray-500",children:"No inventory information available"})]})}const Di=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Ii=ko,kt=(e,t)=>r=>{var n;if((t==null?void 0:t.variants)==null)return Ii(e,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:a,defaultVariants:s}=t,c=Object.keys(a).map(d=>{const f=r==null?void 0:r[d],p=s==null?void 0:s[d];if(f===null)return null;const h=Di(f)||Di(p);return a[d][h]}),l=r&&Object.entries(r).reduce((d,f)=>{let[p,h]=f;return h===void 0||(d[p]=h),d},{}),u=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((d,f)=>{let{class:p,className:h,...m}=f;return Object.entries(m).every(b=>{let[g,w]=b;return Array.isArray(w)?w.includes({...s,...l}[g]):{...s,...l}[g]===w})?[...d,p,h]:d},[]);return Ii(e,c,u,r==null?void 0:r.class,r==null?void 0:r.className)},$n=kt("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 cursor-pointer",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-sm hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-xs hover:bg-destructive/90",outline:"border border-input bg-background shadow-xs hover:bg-accent hover:text-accent-foreground",defaultOutline:"border border-red-600/30 text-red-600 bg-background shadow-xs hover:bg-red-600/5 ",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline",blue:"bg-randmar-blue text-gray-100 shadow-sm hover:bg-randmar-blue/90",red:"bg-randmar-red text-gray-100 shadow-sm hover:bg-randmar-red/90",none:""},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),ce=i.forwardRef(({className:e,variant:t,size:r,asChild:n=!1,confirmationDialog:a,onClick:s,...c},l)=>{const u=n?ye:"button";if(!a)return o.jsx(u,{className:_($n({variant:t,size:r,className:e})),ref:l,onClick:s,...c});s&&console.warn("Button: You provided both onClick and confirmationDialog props. The onClick prop will be ignored. Use the onConfirm callback in confirmationDialog instead.");const{title:d,content:f,onConfirm:p,confirmText:h="Confirm",cancelText:m="Cancel"}=a,b=()=>{p()};return o.jsxs(Nt,{children:[o.jsx(nn,{asChild:!0,children:o.jsx(u,{className:_($n({variant:t,size:r,className:e})),ref:l,...c})}),o.jsxs(Ct,{children:[o.jsxs(rr,{children:[o.jsx(nr,{children:d}),o.jsx(cn,{children:f})]}),o.jsxs(sn,{className:"flex justify-end gap-2 pt-4",children:[o.jsx(on,{asChild:!0,children:o.jsx(ce,{variant:"outline",children:m})}),o.jsx(on,{asChild:!0,children:o.jsx(ce,{onClick:b,children:h})})]})]})]})});ce.displayName="Button";var xh="VisuallyHidden",br=i.forwardRef((e,t)=>o.jsx(Q.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));br.displayName=xh;var Nh=br,[wr,iv]=Be("Tooltip",[pr]),yr=pr(),ki="TooltipProvider",Ch=700,zn="tooltip.open",[Sh,Bn]=wr(ki),Oi=e=>{const{__scopeTooltip:t,delayDuration:r=Ch,skipDelayDuration:n=300,disableHoverableContent:a=!1,children:s}=e,[c,l]=i.useState(!0),u=i.useRef(!1),d=i.useRef(0);return i.useEffect(()=>{const f=d.current;return()=>window.clearTimeout(f)},[]),o.jsx(Sh,{scope:t,isOpenDelayed:c,delayDuration:r,onOpen:i.useCallback(()=>{window.clearTimeout(d.current),l(!1)},[]),onClose:i.useCallback(()=>{window.clearTimeout(d.current),d.current=window.setTimeout(()=>l(!0),n)},[n]),isPointerInTransitRef:u,onPointerInTransitChange:i.useCallback(f=>{u.current=f},[]),disableHoverableContent:a,children:s})};Oi.displayName=ki;var xr="Tooltip",[Eh,Ot]=wr(xr),Li=e=>{const{__scopeTooltip:t,children:r,open:n,defaultOpen:a=!1,onOpenChange:s,disableHoverableContent:c,delayDuration:l}=e,u=Bn(xr,e.__scopeTooltip),d=yr(t),[f,p]=i.useState(null),h=Oe(),m=i.useRef(0),b=c??u.disableHoverableContent,g=l??u.delayDuration,w=i.useRef(!1),[v=!1,y]=st({prop:n,defaultProp:a,onChange:T=>{T?(u.onOpen(),document.dispatchEvent(new CustomEvent(zn))):u.onClose(),s==null||s(T)}}),x=i.useMemo(()=>v?w.current?"delayed-open":"instant-open":"closed",[v]),N=i.useCallback(()=>{window.clearTimeout(m.current),m.current=0,w.current=!1,y(!0)},[y]),E=i.useCallback(()=>{window.clearTimeout(m.current),m.current=0,y(!1)},[y]),C=i.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>{w.current=!0,y(!0),m.current=0},g)},[g,y]);return i.useEffect(()=>()=>{m.current&&(window.clearTimeout(m.current),m.current=0)},[]),o.jsx(Sn,{...d,children:o.jsx(Eh,{scope:t,contentId:h,open:v,stateAttribute:x,trigger:f,onTriggerChange:p,onTriggerEnter:i.useCallback(()=>{u.isOpenDelayed?C():N()},[u.isOpenDelayed,C,N]),onTriggerLeave:i.useCallback(()=>{b?E():(window.clearTimeout(m.current),m.current=0)},[E,b]),onOpen:N,onClose:E,disableHoverableContent:b,children:r})})};Li.displayName=xr;var Wn="TooltipTrigger",Fi=i.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,a=Ot(Wn,r),s=Bn(Wn,r),c=yr(r),l=i.useRef(null),u=oe(t,l,a.onTriggerChange),d=i.useRef(!1),f=i.useRef(!1),p=i.useCallback(()=>d.current=!1,[]);return i.useEffect(()=>()=>document.removeEventListener("pointerup",p),[p]),o.jsx(ps,{asChild:!0,...c,children:o.jsx(Q.button,{"aria-describedby":a.open?a.contentId:void 0,"data-state":a.stateAttribute,...n,ref:u,onPointerMove:$(e.onPointerMove,h=>{h.pointerType!=="touch"&&!f.current&&!s.isPointerInTransitRef.current&&(a.onTriggerEnter(),f.current=!0)}),onPointerLeave:$(e.onPointerLeave,()=>{a.onTriggerLeave(),f.current=!1}),onPointerDown:$(e.onPointerDown,()=>{d.current=!0,document.addEventListener("pointerup",p,{once:!0})}),onFocus:$(e.onFocus,()=>{d.current||a.onOpen()}),onBlur:$(e.onBlur,a.onClose),onClick:$(e.onClick,a.onClose)})})});Fi.displayName=Wn;var Vn="TooltipPortal",[Th,Mh]=wr(Vn,{forceMount:void 0}),$i=e=>{const{__scopeTooltip:t,forceMount:r,children:n,container:a}=e,s=Ot(Vn,t);return o.jsx(Th,{scope:t,forceMount:r,children:o.jsx(Ne,{present:r||s.open,children:o.jsx(xt,{asChild:!0,container:a,children:n})})})};$i.displayName=Vn;var gt="TooltipContent",zi=i.forwardRef((e,t)=>{const r=Mh(gt,e.__scopeTooltip),{forceMount:n=r.forceMount,side:a="top",...s}=e,c=Ot(gt,e.__scopeTooltip);return o.jsx(Ne,{present:n||c.open,children:c.disableHoverableContent?o.jsx(Bi,{side:a,...s,ref:t}):o.jsx(Ph,{side:a,...s,ref:t})})}),Ph=i.forwardRef((e,t)=>{const r=Ot(gt,e.__scopeTooltip),n=Bn(gt,e.__scopeTooltip),a=i.useRef(null),s=oe(t,a),[c,l]=i.useState(null),{trigger:u,onClose:d}=r,f=a.current,{onPointerInTransitChange:p}=n,h=i.useCallback(()=>{l(null),p(!1)},[p]),m=i.useCallback((b,g)=>{const w=b.currentTarget,v={x:b.clientX,y:b.clientY},y=Ih(v,w.getBoundingClientRect()),x=kh(v,y),N=Oh(g.getBoundingClientRect()),E=Fh([...x,...N]);l(E),p(!0)},[p]);return i.useEffect(()=>()=>h(),[h]),i.useEffect(()=>{if(u&&f){const b=w=>m(w,f),g=w=>m(w,u);return u.addEventListener("pointerleave",b),f.addEventListener("pointerleave",g),()=>{u.removeEventListener("pointerleave",b),f.removeEventListener("pointerleave",g)}}},[u,f,m,h]),i.useEffect(()=>{if(c){const b=g=>{const w=g.target,v={x:g.clientX,y:g.clientY},y=(u==null?void 0:u.contains(w))||(f==null?void 0:f.contains(w)),x=!Lh(v,c);y?h():x&&(h(),d())};return document.addEventListener("pointermove",b),()=>document.removeEventListener("pointermove",b)}},[u,f,c,d,h]),o.jsx(Bi,{...e,ref:s})}),[Ah,_h]=wr(xr,{isInside:!1}),Bi=i.forwardRef((e,t)=>{const{__scopeTooltip:r,children:n,"aria-label":a,onEscapeKeyDown:s,onPointerDownOutside:c,...l}=e,u=Ot(gt,r),d=yr(r),{onClose:f}=u;return i.useEffect(()=>(document.addEventListener(zn,f),()=>document.removeEventListener(zn,f)),[f]),i.useEffect(()=>{if(u.trigger){const p=h=>{const m=h.target;m!=null&&m.contains(u.trigger)&&f()};return window.addEventListener("scroll",p,{capture:!0}),()=>window.removeEventListener("scroll",p,{capture:!0})}},[u.trigger,f]),o.jsx(yt,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:p=>p.preventDefault(),onDismiss:f,children:o.jsxs(hs,{"data-state":u.stateAttribute,...d,...l,ref:t,style:{...l.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[o.jsx(Ko,{children:n}),o.jsx(Ah,{scope:r,isInside:!0,children:o.jsx(Nh,{id:u.contentId,role:"tooltip",children:a||n})})]})})});zi.displayName=gt;var Wi="TooltipArrow",Dh=i.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,a=yr(r);return _h(Wi,r).isInside?null:o.jsx(gs,{...a,...n,ref:t})});Dh.displayName=Wi;function Ih(e,t){const r=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),a=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(r,n,a,s)){case s:return"left";case a:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function kh(e,t,r=5){const n=[];switch(t){case"top":n.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":n.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":n.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":n.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r});break}return n}function Oh(e){const{top:t,right:r,bottom:n,left:a}=e;return[{x:a,y:t},{x:r,y:t},{x:r,y:n},{x:a,y:n}]}function Lh(e,t){const{x:r,y:n}=e;let a=!1;for(let s=0,c=t.length-1;s<t.length;c=s++){const l=t[s].x,u=t[s].y,d=t[c].x,f=t[c].y;u>n!=f>n&&r<(d-l)*(n-u)/(f-u)+l&&(a=!a)}return a}function Fh(e){const t=e.slice();return t.sort((r,n)=>r.x<n.x?-1:r.x>n.x?1:r.y<n.y?-1:r.y>n.y?1:0),$h(t)}function $h(e){if(e.length<=1)return e.slice();const t=[];for(let n=0;n<e.length;n++){const a=e[n];for(;t.length>=2;){const s=t[t.length-1],c=t[t.length-2];if((s.x-c.x)*(a.y-c.y)>=(s.y-c.y)*(a.x-c.x))t.pop();else break}t.push(a)}t.pop();const r=[];for(let n=e.length-1;n>=0;n--){const a=e[n];for(;r.length>=2;){const s=r[r.length-1],c=r[r.length-2];if((s.x-c.x)*(a.y-c.y)>=(s.y-c.y)*(a.x-c.x))r.pop();else break}r.push(a)}return r.pop(),t.length===1&&r.length===1&&t[0].x===r[0].x&&t[0].y===r[0].y?t:t.concat(r)}var zh=Oi,Bh=Li,Wh=Fi,Vh=$i,Vi=zi;const vt=zh,mt=Bh,bt=Wh,Je=i.forwardRef(({className:e,sideOffset:t=4,...r},n)=>o.jsx(Vh,{children:o.jsx(Vi,{ref:n,sideOffset:t,className:_("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r})}));Je.displayName=Vi.displayName;const Nr=i.forwardRef(({className:e,type:t,mask:r,onChange:n,placeholder:a,...s},c)=>{const[l,u]=i.useState(!1),d=i.useRef(null),p=a||(r==="phone"?"(999) 999-9999":r==="postal-code-ca"?"A9A 9A9":r==="zip-code-us"?"99999":""),h=()=>r==="phone"?"Only enter numbers. Formatting will be added automatically.":r==="postal-code-ca"?"Enter letters and numbers only. Spacing will be applied automatically.":r==="zip-code-us"?"Only enter numbers. Formatting will be added automatically.":"",m=()=>{u(!0),d.current&&clearTimeout(d.current),d.current=setTimeout(()=>{u(!1)},3e3)};i.useEffect(()=>()=>{d.current&&clearTimeout(d.current)},[]);const b=g=>{if(r){const w=g.target.value;let v=w;if(w.length>0){const y=w[w.length-1];/[^a-zA-Z0-9]/.test(y)&&(console.log("Non-alphanumeric detected:",y),m())}if(r==="phone"){const y=w.replace(/\D/g,"");y.length<=3?v=y:y.length<=6?v=`(${y.slice(0,3)}) ${y.slice(3)}`:v=`(${y.slice(0,3)}) ${y.slice(3,6)}-${y.slice(6,10)}`}else if(r==="postal-code-ca"){const y=w.replace(/[^a-zA-Z0-9]/g,"").toUpperCase();let x="";for(let N=0;N<Math.min(y.length,6);N++){const E=y[N];N===0||N===2||N===4?/[A-Z]/.test(E)&&(x+=E):(N===1||N===3||N===5)&&/[0-9]/.test(E)&&(x+=E)}x.length<=3?v=x:v=`${x.slice(0,3)} ${x.slice(3,6)}`}else if(r==="zip-code-us"){const y=w.replace(/\D/g,"");y.length<=5?v=y:v=`${y.slice(0,5)}-${y.slice(5,9)}`}g.target.value=v}n==null||n(g)};return o.jsx(vt,{children:o.jsxs(mt,{open:l&&!!r,children:[o.jsx(bt,{asChild:!0,children:o.jsx("input",{type:t,className:_("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-xs transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),onChange:b,placeholder:p,ref:c,...s})}),o.jsx(Je,{side:"top",className:"bg-sidebar text-sidebar-foreground",children:h()})]})})});Nr.displayName="Input";var Gh="Separator",Gi="horizontal",Uh=["horizontal","vertical"],Ui=i.forwardRef((e,t)=>{const{decorative:r,orientation:n=Gi,...a}=e,s=jh(n)?n:Gi,l=r?{role:"none"}:{"aria-orientation":s==="vertical"?s:void 0,role:"separator"};return o.jsx(Q.div,{"data-orientation":s,...l,...a,ref:t})});Ui.displayName=Gh;function jh(e){return Uh.includes(e)}var ji=Ui;const Gn=i.forwardRef(({className:e,orientation:t="horizontal",decorative:r=!0,...n},a)=>o.jsx(ji,{ref:a,decorative:r,orientation:t,className:_("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...n}));Gn.displayName=ji.displayName;const Hi=rn,Hh=La,Kh=tr,Ki=Fa,Un=i.forwardRef(({className:e,...t},r)=>o.jsx(Rt,{className:_("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:r}));Un.displayName=Rt.displayName;const Yh=kt("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500 data-[state=open]:animate-in data-[state=closed]:animate-out",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),jn=i.forwardRef(({side:e="right",className:t,children:r,...n},a)=>o.jsxs(Ki,{children:[o.jsx(Un,{}),o.jsxs(Zt,{ref:a,className:_(Yh({side:e}),t),...n,children:[o.jsxs(tr,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[o.jsx(Ir,{className:"h-4 w-4"}),o.jsx("span",{className:"sr-only",children:"Close"})]}),r]})]}));jn.displayName=Zt.displayName;const Yi=({className:e,...t})=>o.jsx("div",{className:_("flex flex-col space-y-2 text-center sm:text-left",e),...t});Yi.displayName="SheetHeader";const qi=({className:e,...t})=>o.jsx("div",{className:_("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});qi.displayName="SheetFooter";const Xi=i.forwardRef(({className:e,...t},r)=>o.jsx(Jt,{ref:r,className:_("text-lg font-semibold text-foreground",e),...t}));Xi.displayName=Jt.displayName;const Qi=i.forwardRef(({className:e,...t},r)=>o.jsx(er,{ref:r,className:_("text-sm text-muted-foreground",e),...t}));Qi.displayName=er.displayName;function qh({onClick:e,publicName:t,applicationName:r,partnerId:n}){const a=`https://api.randmar.io/v4/Partner/${n}/Account/Logo?height=72&width=72`,[s,c]=H.useState(!1),l=()=>{c(!0)};return o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("div",{className:"flex h-9 w-9 items-center justify-center rounded-lg bg-muted "+(e!==void 0?"cursor-pointer":""),children:s?o.jsx(ce,{asChild:!0,size:"icon",onClick:e,children:o.jsx(Ml,{className:"h-5 w-5 text-muted-foreground !bg-sidebar"})}):o.jsx(ce,{asChild:!0,size:"icon",onClick:e,children:o.jsx("img",{src:a,alt:"Partner logo",className:"h-9 w-9 object-cover !bg-sidebar",onError:l})})}),o.jsxs("div",{className:"flex flex-1 flex-col",children:[o.jsx("span",{className:"text-sm font-medium",children:t||"Partner"}),o.jsx("span",{className:"text-xs text-neutral-400",children:r})]})]})}var Xh="Label",Ri=i.forwardRef((e,t)=>o.jsx(Q.label,{...e,ref:t,onMouseDown:r=>{var a;r.target.closest("button, input, select, textarea")||((a=e.onMouseDown)==null||a.call(e,r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));Ri.displayName=Xh;var Qh=Ri;function Rh({className:e,...t}){return o.jsx(Qh,{"data-slot":"label",className:_("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...t})}const Hn=1024;function Zi(){const[e,t]=i.useState(void 0);return i.useEffect(()=>{const r=window.matchMedia(`(max-width: ${Hn-1}px)`),n=()=>{t(window.innerWidth<Hn)};return r.addEventListener("change",n),t(window.innerWidth<Hn),()=>r.removeEventListener("change",n)},[]),!!e}function R({className:e,...t}){return o.jsx("div",{className:_("animate-pulse rounded-md bg-primary/20",e),...t})}const Zh="sidebar:state",Jh=60*60*24*7,eg="16rem",tg="18rem",rg="3rem",ng="b",Ji=i.createContext(null);function Lt(){const e=i.useContext(Ji);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}const Kn=i.forwardRef(({defaultOpen:e=!0,open:t,onOpenChange:r,className:n,style:a,children:s,...c},l)=>{const u=Zi(),[d,f]=i.useState(!1),[p,h]=i.useState(e),m=t??p,b=i.useCallback(y=>{const x=typeof y=="function"?y(m):y;r?r(x):h(x),document.cookie=`${Zh}=${x}; path=/; max-age=${Jh}`},[r,m]),g=i.useCallback(()=>u?f(y=>!y):b(y=>!y),[u,b,f]);i.useEffect(()=>{const y=x=>{x.key===ng&&(x.metaKey||x.ctrlKey)&&(x.preventDefault(),g())};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[g]);const w=m?"expanded":"collapsed",v=i.useMemo(()=>({state:w,open:m,setOpen:b,isMobile:u,openMobile:d,setOpenMobile:f,toggleSidebar:g}),[w,m,b,u,d,f,g]);return o.jsx(Ji.Provider,{value:v,children:o.jsx(vt,{delayDuration:0,children:o.jsx("div",{style:{"--sidebar-width":eg,"--sidebar-width-icon":rg,...a},className:_("group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar",n),ref:l,...c,children:s})})})});Kn.displayName="SidebarProvider";const Yn=i.forwardRef(({side:e="left",variant:t="sidebar",collapsible:r="offcanvas",className:n,children:a,...s},c)=>{const{isMobile:l,state:u,openMobile:d,setOpenMobile:f}=Lt();return r==="none"?o.jsx("div",{className:_("flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground",n),ref:c,...s,children:a}):l?o.jsx(Hi,{open:d,onOpenChange:f,...s,children:o.jsx(jn,{"data-sidebar":"sidebar","data-mobile":"true",className:"w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:{"--sidebar-width":tg},side:e,children:o.jsx("div",{className:"flex h-full w-full flex-col",children:a})})}):o.jsxs("div",{ref:c,className:"group peer hidden md:block text-sidebar-foreground","data-state":u,"data-collapsible":u==="collapsed"?r:"","data-variant":t,"data-side":e,children:[o.jsx("div",{className:_("duration-200 relative h-svh w-(--sidebar-width) bg-transparent transition-[width] ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",t==="floating"||t==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),o.jsx("div",{className:_("duration-200 fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] ease-linear md:flex",e==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",t==="floating"||t==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",n),...s,children:o.jsx("div",{"data-sidebar":"sidebar",className:"flex h-full w-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow-sm",children:a})})]})});Yn.displayName="Sidebar";const qn=i.forwardRef(({className:e,onClick:t,...r},n)=>{const{toggleSidebar:a}=Lt();return o.jsxs(ce,{ref:n,"data-sidebar":"trigger",variant:"ghost",size:"icon",className:_("h-7 w-7 text-sidebar-foreground",e),onClick:s=>{t==null||t(s),a()},...r,children:[o.jsx(xl,{}),o.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})});qn.displayName="SidebarTrigger";const ec=i.forwardRef(({className:e,...t},r)=>{const{toggleSidebar:n}=Lt();return o.jsx("button",{ref:r,"data-sidebar":"rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:n,title:"Toggle Sidebar",className:_("absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-sidebar-border group-data-[side=left]:-right-4 group-data-[side=right]:left-0 sm:flex","in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full hover:group-data-[collapsible=offcanvas]:bg-sidebar","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",e),...t})});ec.displayName="SidebarRail";const tc=i.forwardRef(({className:e,...t},r)=>o.jsx("main",{ref:r,className:_("relative flex min-h-svh flex-1 flex-col bg-background","peer-data-[variant=inset]:min-h-[calc(100svh-(--spacing(4)))] md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm",e),...t}));tc.displayName="SidebarInset";const rc=i.forwardRef(({className:e,...t},r)=>o.jsx(Nr,{ref:r,"data-sidebar":"input",className:_("h-8 w-full bg-background shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",e),...t}));rc.displayName="SidebarInput";const Xn=i.forwardRef(({className:e,...t},r)=>o.jsx("div",{ref:r,"data-sidebar":"header",className:_("flex flex-col gap-2 p-2",e),...t}));Xn.displayName="SidebarHeader";const Qn=i.forwardRef(({className:e,...t},r)=>o.jsx("div",{ref:r,"data-sidebar":"footer",className:_("flex flex-col gap-2 p-2",e),...t}));Qn.displayName="SidebarFooter";const nc=i.forwardRef(({className:e,...t},r)=>o.jsx(Gn,{ref:r,"data-sidebar":"separator",className:_("mx-2 w-auto bg-sidebar-border",e),...t}));nc.displayName="SidebarSeparator";const Rn=i.forwardRef(({className:e,...t},r)=>o.jsx("div",{ref:r,"data-sidebar":"content",className:_("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t}));Rn.displayName="SidebarContent";const oc=i.forwardRef(({className:e,...t},r)=>o.jsx("div",{ref:r,"data-sidebar":"group",className:_("relative flex w-full min-w-0 flex-col p-2",e),...t}));oc.displayName="SidebarGroup";const ac=i.forwardRef(({className:e,asChild:t=!1,...r},n)=>{const a=t?ye:"div";return o.jsx(a,{ref:n,"data-sidebar":"group-label",className:_("duration-200 flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 outline-hidden ring-sidebar-ring transition-[margin,opa] ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",e),...r})});ac.displayName="SidebarGroupLabel";const sc=i.forwardRef(({className:e,asChild:t=!1,...r},n)=>{const a=t?ye:"button";return o.jsx(a,{ref:n,"data-sidebar":"group-action",className:_("absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-hidden ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 md:after:hidden","group-data-[collapsible=icon]:hidden",e),...r})});sc.displayName="SidebarGroupAction";const ic=i.forwardRef(({className:e,...t},r)=>o.jsx("div",{ref:r,"data-sidebar":"group-content",className:_("w-full text-sm",e),...t}));ic.displayName="SidebarGroupContent";const Zn=i.forwardRef(({className:e,...t},r)=>o.jsx("ul",{ref:r,"data-sidebar":"menu",className:_("flex w-full min-w-0 flex-col gap-1",e),...t}));Zn.displayName="SidebarMenu";const Jn=i.forwardRef(({className:e,...t},r)=>o.jsx("li",{ref:r,"data-sidebar":"menu-item",className:_("group/menu-item relative",e),...t}));Jn.displayName="SidebarMenuItem";const og=kt("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}}),eo=i.forwardRef(({asChild:e=!1,isActive:t=!1,variant:r="default",size:n="default",tooltip:a,className:s,...c},l)=>{const u=e?ye:"button",{isMobile:d,state:f}=Lt(),p=o.jsx(u,{ref:l,"data-sidebar":"menu-button","data-size":n,"data-active":t,className:_(og({variant:r,size:n}),s),...c});return a?(typeof a=="string"&&(a={children:a}),o.jsxs(mt,{children:[o.jsx(bt,{asChild:!0,children:p}),o.jsx(Je,{side:"right",align:"center",hidden:f!=="collapsed"||d,...a})]})):p});eo.displayName="SidebarMenuButton";const cc=i.forwardRef(({className:e,asChild:t=!1,showOnHover:r=!1,...n},a)=>{const s=t?ye:"button";return o.jsx(s,{ref:a,"data-sidebar":"menu-action",className:_("absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-hidden ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 peer-hover/menu-button:text-sidebar-accent-foreground [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 md:after:hidden","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",r&&"group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 peer-data-[active=true]/menu-button:text-sidebar-accent-foreground md:opacity-0",e),...n})});cc.displayName="SidebarMenuAction";const lc=i.forwardRef(({className:e,...t},r)=>o.jsx("div",{ref:r,"data-sidebar":"menu-badge",className:_("absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums text-sidebar-foreground select-none pointer-events-none","peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",e),...t}));lc.displayName="SidebarMenuBadge";const dc=i.forwardRef(({className:e,showIcon:t=!1,...r},n)=>{const a=i.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return o.jsxs("div",{ref:n,"data-sidebar":"menu-skeleton",className:_("rounded-md h-8 flex gap-2 px-2 items-center",e),...r,children:[t&&o.jsx(R,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),o.jsx(R,{className:"h-4 flex-1 max-w-(--skeleton-width)","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":a}})]})});dc.displayName="SidebarMenuSkeleton";const uc=i.forwardRef(({className:e,...t},r)=>o.jsx("ul",{ref:r,"data-sidebar":"menu-sub",className:_("mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5","group-data-[collapsible=icon]:hidden",e),...t}));uc.displayName="SidebarMenuSub";const fc=i.forwardRef(({...e},t)=>o.jsx("li",{ref:t,...e}));fc.displayName="SidebarMenuSubItem";const pc=i.forwardRef(({asChild:e=!1,size:t="md",isActive:r,className:n,...a},s)=>{const c=e?ye:"a";return o.jsx(c,{ref:s,"data-sidebar":"menu-sub-button","data-size":t,"data-active":r,className:_("flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground outline-hidden ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",t==="sm"&&"text-xs",t==="md"&&"text-sm","group-data-[collapsible=icon]:hidden",n),...a})});pc.displayName="SidebarMenuSubButton";var to="ToastProvider",[ro,ag,sg]=ln("Toast"),[hc,cv]=Be("Toast",[sg]),[ig,Cr]=hc(to),gc=e=>{const{__scopeToast:t,label:r="Notification",duration:n=5e3,swipeDirection:a="right",swipeThreshold:s=50,children:c}=e,[l,u]=i.useState(null),[d,f]=i.useState(0),p=i.useRef(!1),h=i.useRef(!1);return r.trim()||console.error(`Invalid prop \`label\` supplied to \`${to}\`. Expected non-empty \`string\`.`),o.jsx(ro.Provider,{scope:t,children:o.jsx(ig,{scope:t,label:r,duration:n,swipeDirection:a,swipeThreshold:s,toastCount:d,viewport:l,onViewportChange:u,onToastAdd:i.useCallback(()=>f(m=>m+1),[]),onToastRemove:i.useCallback(()=>f(m=>m-1),[]),isFocusedToastEscapeKeyDownRef:p,isClosePausedRef:h,children:c})})};gc.displayName=to;var vc="ToastViewport",cg=["F8"],no="toast.viewportPause",oo="toast.viewportResume",mc=i.forwardRef((e,t)=>{const{__scopeToast:r,hotkey:n=cg,label:a="Notifications ({hotkey})",...s}=e,c=Cr(vc,r),l=ag(r),u=i.useRef(null),d=i.useRef(null),f=i.useRef(null),p=i.useRef(null),h=oe(t,p,c.onViewportChange),m=n.join("+").replace(/Key/g,"").replace(/Digit/g,""),b=c.toastCount>0;i.useEffect(()=>{const w=v=>{var x;n.length!==0&&n.every(N=>v[N]||v.code===N)&&((x=p.current)==null||x.focus())};return document.addEventListener("keydown",w),()=>document.removeEventListener("keydown",w)},[n]),i.useEffect(()=>{const w=u.current,v=p.current;if(b&&w&&v){const y=()=>{if(!c.isClosePausedRef.current){const C=new CustomEvent(no);v.dispatchEvent(C),c.isClosePausedRef.current=!0}},x=()=>{if(c.isClosePausedRef.current){const C=new CustomEvent(oo);v.dispatchEvent(C),c.isClosePausedRef.current=!1}},N=C=>{!w.contains(C.relatedTarget)&&x()},E=()=>{w.contains(document.activeElement)||x()};return w.addEventListener("focusin",y),w.addEventListener("focusout",N),w.addEventListener("pointermove",y),w.addEventListener("pointerleave",E),window.addEventListener("blur",y),window.addEventListener("focus",x),()=>{w.removeEventListener("focusin",y),w.removeEventListener("focusout",N),w.removeEventListener("pointermove",y),w.removeEventListener("pointerleave",E),window.removeEventListener("blur",y),window.removeEventListener("focus",x)}}},[b,c.isClosePausedRef]);const g=i.useCallback(({tabbingDirection:w})=>{const y=l().map(x=>{const N=x.ref.current,E=[N,...xg(N)];return w==="forwards"?E:E.reverse()});return(w==="forwards"?y.reverse():y).flat()},[l]);return i.useEffect(()=>{const w=p.current;if(w){const v=y=>{var E,C,T;const x=y.altKey||y.ctrlKey||y.metaKey;if(y.key==="Tab"&&!x){const F=document.activeElement,O=y.shiftKey;if(y.target===w&&O){(E=d.current)==null||E.focus();return}const W=g({tabbingDirection:O?"backwards":"forwards"}),L=W.findIndex(P=>P===F);io(W.slice(L+1))?y.preventDefault():O?(C=d.current)==null||C.focus():(T=f.current)==null||T.focus()}};return w.addEventListener("keydown",v),()=>w.removeEventListener("keydown",v)}},[l,g]),o.jsxs(Ld,{ref:u,role:"region","aria-label":a.replace("{hotkey}",m),tabIndex:-1,style:{pointerEvents:b?void 0:"none"},children:[b&&o.jsx(ao,{ref:d,onFocusFromOutsideViewport:()=>{const w=g({tabbingDirection:"forwards"});io(w)}}),o.jsx(ro.Slot,{scope:r,children:o.jsx(Q.ol,{tabIndex:-1,...s,ref:h})}),b&&o.jsx(ao,{ref:f,onFocusFromOutsideViewport:()=>{const w=g({tabbingDirection:"backwards"});io(w)}})]})});mc.displayName=vc;var bc="ToastFocusProxy",ao=i.forwardRef((e,t)=>{const{__scopeToast:r,onFocusFromOutsideViewport:n,...a}=e,s=Cr(bc,r);return o.jsx(br,{"aria-hidden":!0,tabIndex:0,...a,ref:t,style:{position:"fixed"},onFocus:c=>{var d;const l=c.relatedTarget;!((d=s.viewport)!=null&&d.contains(l))&&n()}})});ao.displayName=bc;var Sr="Toast",lg="toast.swipeStart",dg="toast.swipeMove",ug="toast.swipeCancel",fg="toast.swipeEnd",wc=i.forwardRef((e,t)=>{const{forceMount:r,open:n,defaultOpen:a,onOpenChange:s,...c}=e,[l=!0,u]=st({prop:n,defaultProp:a,onChange:s});return o.jsx(Ne,{present:r||l,children:o.jsx(gg,{open:l,...c,ref:t,onClose:()=>u(!1),onPause:fe(e.onPause),onResume:fe(e.onResume),onSwipeStart:$(e.onSwipeStart,d=>{d.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:$(e.onSwipeMove,d=>{const{x:f,y:p}=d.detail.delta;d.currentTarget.setAttribute("data-swipe","move"),d.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${f}px`),d.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${p}px`)}),onSwipeCancel:$(e.onSwipeCancel,d=>{d.currentTarget.setAttribute("data-swipe","cancel"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),d.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),d.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:$(e.onSwipeEnd,d=>{const{x:f,y:p}=d.detail.delta;d.currentTarget.setAttribute("data-swipe","end"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),d.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${f}px`),d.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${p}px`),u(!1)})})})});wc.displayName=Sr;var[pg,hg]=hc(Sr,{onClose(){}}),gg=i.forwardRef((e,t)=>{const{__scopeToast:r,type:n="foreground",duration:a,open:s,onClose:c,onEscapeKeyDown:l,onPause:u,onResume:d,onSwipeStart:f,onSwipeMove:p,onSwipeCancel:h,onSwipeEnd:m,...b}=e,g=Cr(Sr,r),[w,v]=i.useState(null),y=oe(t,P=>v(P)),x=i.useRef(null),N=i.useRef(null),E=a||g.duration,C=i.useRef(0),T=i.useRef(E),F=i.useRef(0),{onToastAdd:O,onToastRemove:B}=g,z=fe(()=>{var G;(w==null?void 0:w.contains(document.activeElement))&&((G=g.viewport)==null||G.focus()),c()}),W=i.useCallback(P=>{!P||P===1/0||(window.clearTimeout(F.current),C.current=new Date().getTime(),F.current=window.setTimeout(z,P))},[z]);i.useEffect(()=>{const P=g.viewport;if(P){const G=()=>{W(T.current),d==null||d()},A=()=>{const q=new Date().getTime()-C.current;T.current=T.current-q,window.clearTimeout(F.current),u==null||u()};return P.addEventListener(no,A),P.addEventListener(oo,G),()=>{P.removeEventListener(no,A),P.removeEventListener(oo,G)}}},[g.viewport,E,u,d,W]),i.useEffect(()=>{s&&!g.isClosePausedRef.current&&W(E)},[s,E,g.isClosePausedRef,W]),i.useEffect(()=>(O(),()=>B()),[O,B]);const L=i.useMemo(()=>w?Tc(w):null,[w]);return g.viewport?o.jsxs(o.Fragment,{children:[L&&o.jsx(vg,{__scopeToast:r,role:"status","aria-live":n==="foreground"?"assertive":"polite","aria-atomic":!0,children:L}),o.jsx(pg,{scope:r,onClose:z,children:_r.createPortal(o.jsx(ro.ItemSlot,{scope:r,children:o.jsx(Od,{asChild:!0,onEscapeKeyDown:$(l,()=>{g.isFocusedToastEscapeKeyDownRef.current||z(),g.isFocusedToastEscapeKeyDownRef.current=!1}),children:o.jsx(Q.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":s?"open":"closed","data-swipe-direction":g.swipeDirection,...b,ref:y,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:$(e.onKeyDown,P=>{P.key==="Escape"&&(l==null||l(P.nativeEvent),P.nativeEvent.defaultPrevented||(g.isFocusedToastEscapeKeyDownRef.current=!0,z()))}),onPointerDown:$(e.onPointerDown,P=>{P.button===0&&(x.current={x:P.clientX,y:P.clientY})}),onPointerMove:$(e.onPointerMove,P=>{if(!x.current)return;const G=P.clientX-x.current.x,A=P.clientY-x.current.y,q=!!N.current,D=["left","right"].includes(g.swipeDirection),M=["left","up"].includes(g.swipeDirection)?Math.min:Math.max,K=D?M(0,G):0,X=D?0:M(0,A),ee=P.pointerType==="touch"?10:2,te={x:K,y:X},ne={originalEvent:P,delta:te};q?(N.current=te,Er(dg,p,ne,{discrete:!1})):Mc(te,g.swipeDirection,ee)?(N.current=te,Er(lg,f,ne,{discrete:!1}),P.target.setPointerCapture(P.pointerId)):(Math.abs(G)>ee||Math.abs(A)>ee)&&(x.current=null)}),onPointerUp:$(e.onPointerUp,P=>{const G=N.current,A=P.target;if(A.hasPointerCapture(P.pointerId)&&A.releasePointerCapture(P.pointerId),N.current=null,x.current=null,G){const q=P.currentTarget,D={originalEvent:P,delta:G};Mc(G,g.swipeDirection,g.swipeThreshold)?Er(fg,m,D,{discrete:!0}):Er(ug,h,D,{discrete:!0}),q.addEventListener("click",M=>M.preventDefault(),{once:!0})}})})})}),g.viewport)})]}):null}),vg=e=>{const{__scopeToast:t,children:r,...n}=e,a=Cr(Sr,t),[s,c]=i.useState(!1),[l,u]=i.useState(!1);return wg(()=>c(!0)),i.useEffect(()=>{const d=window.setTimeout(()=>u(!0),1e3);return()=>window.clearTimeout(d)},[]),l?null:o.jsx(xt,{asChild:!0,children:o.jsx(br,{...n,children:s&&o.jsxs(o.Fragment,{children:[a.label," ",r]})})})},mg="ToastTitle",yc=i.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e;return o.jsx(Q.div,{...n,ref:t})});yc.displayName=mg;var bg="ToastDescription",xc=i.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e;return o.jsx(Q.div,{...n,ref:t})});xc.displayName=bg;var Nc="ToastAction",Cc=i.forwardRef((e,t)=>{const{altText:r,...n}=e;return r.trim()?o.jsx(Ec,{altText:r,asChild:!0,children:o.jsx(so,{...n,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${Nc}\`. Expected non-empty \`string\`.`),null)});Cc.displayName=Nc;var Sc="ToastClose",so=i.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e,a=hg(Sc,r);return o.jsx(Ec,{asChild:!0,children:o.jsx(Q.button,{type:"button",...n,ref:t,onClick:$(e.onClick,a.onClose)})})});so.displayName=Sc;var Ec=i.forwardRef((e,t)=>{const{__scopeToast:r,altText:n,...a}=e;return o.jsx(Q.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":n||void 0,...a,ref:t})});function Tc(e){const t=[];return Array.from(e.childNodes).forEach(n=>{if(n.nodeType===n.TEXT_NODE&&n.textContent&&t.push(n.textContent),yg(n)){const a=n.ariaHidden||n.hidden||n.style.display==="none",s=n.dataset.radixToastAnnounceExclude==="";if(!a)if(s){const c=n.dataset.radixToastAnnounceAlt;c&&t.push(c)}else t.push(...Tc(n))}}),t}function Er(e,t,r,{discrete:n}){const a=r.originalEvent.currentTarget,s=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:r});t&&a.addEventListener(e,t,{once:!0}),n?Wr(a,s):a.dispatchEvent(s)}var Mc=(e,t,r=0)=>{const n=Math.abs(e.x),a=Math.abs(e.y),s=n>a;return t==="left"||t==="right"?s&&n>r:!s&&a>r};function wg(e=()=>{}){const t=fe(e);We(()=>{let r=0,n=0;return r=window.requestAnimationFrame(()=>n=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(r),window.cancelAnimationFrame(n)}},[t])}function yg(e){return e.nodeType===e.ELEMENT_NODE}function xg(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const a=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||a?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function io(e){const t=document.activeElement;return e.some(r=>r===t?!0:(r.focus(),document.activeElement!==t))}var Ng=gc,Pc=mc,Ac=wc,_c=yc,Dc=xc,Ic=Cc,kc=so;const Oc=Ng,co=i.forwardRef(({className:e,...t},r)=>o.jsx(Pc,{ref:r,className:_("fixed top-0 z-100 flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",e),...t}));co.displayName=Pc.displayName;const Cg=kt("group pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-md border p-4 pr-6 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full sm:data-[state=open]:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground",success:"border-green-600 bg-green-600 text-white",warning:"border-yellow-500 bg-yellow-500 text-white",info:"border-blue-500 bg-blue-500 text-white",secondary:"border-secondary bg-secondary text-secondary-foreground",outline:"border-input bg-background text-foreground hover:bg-accent hover:text-accent-foreground"}},defaultVariants:{variant:"default"}}),lo=i.forwardRef(({className:e,variant:t,...r},n)=>o.jsx(Ac,{ref:n,className:_(Cg({variant:t}),e),...r}));lo.displayName=Ac.displayName;const Lc=i.forwardRef(({className:e,...t},r)=>o.jsx(Ic,{ref:r,className:_("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium transition-colors hover:bg-secondary focus:outline-hidden focus:ring-1 focus:ring-ring disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 hover:group-[.destructive]:border-destructive/30 hover:group-[.destructive]:bg-destructive hover:group-[.destructive]:text-destructive-foreground focus:group-[.destructive]:ring-destructive",e),...t}));Lc.displayName=Ic.displayName;const uo=i.forwardRef(({className:e,...t},r)=>o.jsx(kc,{ref:r,className:_("absolute right-1 top-1 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-hidden focus:ring-1 group-hover:opacity-100 group-[.destructive]:text-red-300 hover:group-[.destructive]:text-red-50 focus:group-[.destructive]:ring-red-400 focus:group-[.destructive]:ring-offset-red-600",e),"toast-close":"",...t,children:o.jsx(Ir,{className:"h-4 w-4"})}));uo.displayName=kc.displayName;const fo=i.forwardRef(({className:e,...t},r)=>o.jsx(_c,{ref:r,className:_("text-sm font-semibold [&+div]:text-xs",e),...t}));fo.displayName=_c.displayName;const po=i.forwardRef(({className:e,...t},r)=>o.jsx(Dc,{ref:r,className:_("text-sm opacity-90",e),...t}));po.displayName=Dc.displayName;const Sg=1,Eg=1e6;let ho=0;function Tg(){return ho=(ho+1)%Number.MAX_SAFE_INTEGER,ho.toString()}const go=new Map,Fc=e=>{if(go.has(e))return;const t=setTimeout(()=>{go.delete(e),Ft({type:"REMOVE_TOAST",toastId:e})},Eg);go.set(e,t)},Mg=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,Sg)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(r=>r.id===t.toast.id?{...r,...t.toast}:r)};case"DISMISS_TOAST":{const{toastId:r}=t;return r?Fc(r):e.toasts.forEach(n=>Fc(n.id)),{...e,toasts:e.toasts.map(n=>n.id===r||r===void 0?{...n,open:!1}:n)}}case"REMOVE_TOAST":return{...e,toasts:t.toastId?e.toasts.filter(r=>r.id!==t.toastId):[]}}},Tr=[];let Mr={toasts:[]};function Ft(e){Mr=Mg(Mr,e),Tr.forEach(t=>t(Mr))}function $c({...e}){const t=Tg(),r=a=>Ft({type:"UPDATE_TOAST",toast:{...a,id:t}}),n=()=>Ft({type:"DISMISS_TOAST",toastId:t});return Ft({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:a=>{a||n()}}}),{id:t,dismiss:n,update:r}}function vo(){const[e,t]=i.useState(Mr);return i.useEffect(()=>(Tr.push(t),()=>{const r=Tr.indexOf(t);r>-1&&Tr.splice(r,1)}),[]),{...e,toast:$c,dismiss:r=>Ft({type:"DISMISS_TOAST",toastId:r})}}function zc(){const{toasts:e}=vo();return o.jsxs(Oc,{children:[e.map(function({id:t,title:r,description:n,action:a,...s}){return o.jsxs(lo,{...s,children:[o.jsxs("div",{className:"grid gap-1",children:[r&&o.jsx(fo,{children:r}),n&&o.jsx(po,{children:n})]}),a,o.jsx(uo,{})]},t)}),o.jsx(co,{})]})}const mo=H.forwardRef(({onSignOut:e,handleValidSearch:t,rightMenu:r,searchPlaceholder:n},a)=>{const[s,c]=H.useState(""),l=Ar.useLocation(),{toast:u}=vo();H.useEffect(()=>{const h=new URLSearchParams(l.search).get("q");h&&c(h)},[l.search]);const d=()=>{const p=s.trim();if(!p||p.length<2){u({title:"Enter more characters to search",description:"At least 2 characters are needed to search products.",variant:"destructive",duration:5e3});return}t(p)},f=p=>{p.key==="Enter"&&d()};return o.jsxs("header",{className:"flex h-16 items-center gap-4 border-b sidebar-foreground bg-sidebar px-6 fixed top-0 right-0 z-50 lg:left-64 left-0 border-sidebar-border",children:[o.jsx(qn,{className:"lg:hidden",children:o.jsx(wl,{className:"h-6 w-6"})}),o.jsx("div",{className:"flex flex-1 items-center gap-4",children:o.jsx("div",{className:"relative w-full max-w-sm",children:o.jsxs("div",{children:[o.jsx("button",{type:"button",className:"absolute left-2 top-1/2 -translate-y-1/2",onClick:d,"aria-label":"Search",children:o.jsx(El,{className:"h-4 w-4 text-muted-foreground"})}),o.jsx(Nr,{placeholder:n??"Search...",className:"w-full pl-8 bg-white text-black",value:s,onChange:p=>c(p.target.value),onKeyDown:f,ref:a},"topbar-search")]})})}),r||o.jsx(o.Fragment,{}),e&&o.jsx("div",{className:"flex items-center gap-4",children:o.jsxs(ce,{variant:"ghost",size:"icon",className:"h-9 w-9",onClick:e,children:[o.jsx(bl,{className:"h-4 w-4 text-sidebar-foreground"}),o.jsx("span",{className:"sr-only",children:"Sign out"})]})})]})});mo.displayName="Topbar";const Bc=kt("inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground border border-input hover:bg-accent hover:text-accent-foreground",success:"bg-green-600 text-white hover:bg-green-700",warning:"bg-yellow-500 text-white hover:bg-yellow-600",info:"bg-blue-500 text-white hover:bg-blue-600",ghost:"bg-background hover:bg-accent hover:text-accent-foreground",randmarRed:"bg-randmar-red text-white hover:bg-randmar-red/80",randmarBlue:"bg-randmar-blue text-white hover:bg-randmar-blue/80",randmarPurple:"bg-randmar-purple text-white hover:bg-randmar-purple/80",randmarGreen:"bg-randmar-green text-black hover:bg-randmar-green/80",randmarBlack:"bg-randmar-black text-white hover:bg-randmar-black/80",randmarYellow:"bg-randmar-yellow text-black hover:bg-randmar-yellow/80"},size:{default:"h-6",sm:"h-5 text-[10px]",lg:"h-7 px-3"}},defaultVariants:{variant:"default",size:"default"}}),Te=i.forwardRef(({className:e,variant:t,size:r,icon:n,children:a,...s},c)=>o.jsxs("div",{ref:c,className:_(Bc({variant:t,size:r}),e),...s,children:[n&&o.jsx("span",{className:"mr-1",children:n}),a]}));Te.displayName="Badge";const $t=i.forwardRef(({className:e,...t},r)=>o.jsx("div",{ref:r,className:_("rounded-md border bg-card text-card-foreground shadow-sm",e),...t}));$t.displayName="Card";const Wc=i.forwardRef(({className:e,...t},r)=>o.jsx("div",{ref:r,className:_("flex flex-col space-y-1.5 p-6",e),...t}));Wc.displayName="CardHeader";const Vc=i.forwardRef(({className:e,...t},r)=>o.jsx("div",{ref:r,className:_("font-semibold leading-none tracking-tight",e),...t}));Vc.displayName="CardTitle";const Gc=i.forwardRef(({className:e,...t},r)=>o.jsx("div",{ref:r,className:_("text-sm text-muted-foreground",e),...t}));Gc.displayName="CardDescription";const zt=i.forwardRef(({className:e,...t},r)=>o.jsx("div",{ref:r,className:_("p-6 pt-0",e),...t}));zt.displayName="CardContent";const Uc=i.forwardRef(({className:e,...t},r)=>o.jsx("div",{ref:r,className:_("flex items-center p-6 pt-0",e),...t}));Uc.displayName="CardFooter";const jc=({countryCode:e,className:t=""})=>{const[r,n]=H.useState(null),[a,s]=H.useState(!1);return H.useEffect(()=>{if(!e)return;const l=`https://purecatamphetamine.github.io/country-flag-icons/3x2/${e.toUpperCase()}.svg`;fetch(l,{method:"HEAD"}).then(u=>{u.ok?(n(l),s(!1)):s(!0)}).catch(()=>{s(!0)})},[e]),a||!r?o.jsx("span",{className:t,children:e}):o.jsx("img",{src:r,alt:`${e} flag`,className:`inline-block ${t}`,style:{width:"24px",height:"auto"}})};function Hc({routes:e,footer:t,dashboardTitle:r}){const{appID:n}=Ar.useParams(),a=e.filter(s=>s.showInNav);return o.jsxs(Yn,{className:"border-r border-sidebar-border",children:[o.jsx(Xn,{className:"border-b border-sidebar-border px-6 h-16 justify-center bg-sidebar text-sidebar-foreground",children:o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("div",{className:"flex items-center justify-center",children:o.jsx("img",{src:"https://api.randmar.io/images/RandmarIcon.svg",alt:"Randmar Icon",className:"h-4 w-4 filter brightness-0 saturate-100 invert"})}),o.jsx("span",{className:"font-semibold text-lg",children:r})]})}),o.jsx(Rn,{className:"py-4 bg-sidebar text-sidebar-foreground",children:o.jsx(Zn,{children:a.map(s=>{const c=s.icon,l=`/${s.path.replace(":appID",n)}`;return o.jsx(Jn,{children:o.jsx(eo,{asChild:!0,children:o.jsxs(Ar.Link,{to:l,className:"transition-colors hover:bg-muted px-6",children:[c&&o.jsx(c,{className:"h-4 w-4"}),o.jsx("span",{children:s.label})]})})},s.key)})})}),o.jsx(Qn,{className:"border-t border-sidebar-border p-4 bg-sidebar-background text-sidebar-foreground",children:t})]})}const Kc=H.forwardRef(({children:e,rightMenu:t,routes:r,footer:n,handleValidSearch:a,dashboardTitle:s,onSignOut:c,searchPlaceholder:l},u)=>o.jsx(o.Fragment,{children:o.jsx(Kn,{children:o.jsxs("div",{className:"flex grow",children:[o.jsx(Hc,{routes:r,footer:n,dashboardTitle:s}),o.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[o.jsx(mo,{ref:u,onSignOut:c,rightMenu:t,handleValidSearch:a,searchPlaceholder:l}),o.jsx("main",{className:"flex-1 overflow-auto mt-16",children:e}),o.jsx(zc,{})]})]})})}));Kc.displayName="Layout";const Pg={sm:100,md:200,lg:300,xl:400};function Yc({randmarSKU:e,size:t="md",alt:r,secondaryContent:n}){const[a,s]=i.useState(!1),[c,l]=i.useState(!1),[u,d]=i.useState(!1),[f,p]=i.useState(!1),h=`https://api.randmar.io/Product/${e}/Video`;i.useEffect(()=>{(async()=>{try{const x=await(await fetch(h+"/Exists")).json();l(x)}catch(y){console.error("Error checking for video:",y),l(!1)}})()},[e,h]);async function m(){if(c){p(!0);try{const y=await(await fetch(h)).blob(),x=window.URL.createObjectURL(y),N=document.createElement("a");N.href=x,N.download=`${e||"product"}-video.mp4`,document.body.appendChild(N),N.click(),document.body.removeChild(N),window.URL.revokeObjectURL(x)}catch(v){console.error("Error downloading video:",v)}finally{p(!1)}}}function b(){navigator.clipboard.writeText(h),d(!0),setTimeout(()=>{d(!1)},2e3)}function g(){s(!0)}const w=Pg[t||"xl"];return o.jsxs(o.Fragment,{children:[o.jsx(Nt,{open:a,onOpenChange:s,children:o.jsx(Ct,{className:"max-w-4xl p-0 overflow-hidden",children:n?o.jsxs("div",{className:"flex flex-row",children:[o.jsxs("video",{className:"w-full rounded-l-lg max-h-[720px] object-contain",controls:!0,autoPlay:!0,muted:!0,loop:!0,children:[o.jsx("source",{src:h,type:"video/mp4"}),"Your browser does not support the video tag."]}),o.jsx("div",{className:"flex-grow min-w-[400px] h-[70vh] p-6",children:n})]}):o.jsxs("div",{className:"w-full relative",children:[o.jsxs("video",{className:"w-full max-h-[720px] object-contain",controls:!0,autoPlay:!0,children:[o.jsx("source",{src:h,type:"video/mp4"}),"Your browser does not support the video tag."]}),o.jsxs("div",{className:"absolute top-2 right-12 flex gap-1",children:[o.jsx(vt,{children:o.jsxs(mt,{children:[o.jsx(bt,{asChild:!0,children:o.jsx(ce,{variant:"secondary",size:"icon",onClick:b,children:u?o.jsx(Dr,{className:"h-4 w-4"}):o.jsx(gl,{className:"h-4 w-4"})})}),o.jsx(Je,{children:o.jsx("p",{children:"Copy video link"})})]})}),o.jsx(vt,{children:o.jsxs(mt,{children:[o.jsx(bt,{asChild:!0,children:o.jsx(ce,{variant:"secondary",size:"icon",onClick:m,disabled:f,children:o.jsx(vl,{className:"h-4 w-4"})})}),o.jsx(Je,{children:o.jsx("p",{children:"Download video"})})]})})]})]})})}),o.jsxs("div",{className:"relative w-max h-max",children:[o.jsx("img",{alt:r||`Product ${e}`,className:`rounded-md ${c?"cursor-pointer":""}`,onClick:c?g:void 0,src:`https://api.randmar.io/Product/${e}/Image?width=${w*1.5}&height=${w*1.5}`,width:w,height:w}),c&&o.jsx(vt,{children:o.jsxs(mt,{children:[o.jsx(bt,{asChild:!0,children:o.jsx(ce,{variant:"secondary",size:"icon",className:"absolute top-2 right-2",onClick:g,children:o.jsx(Nl,{className:"h-4 w-4"})})}),o.jsx(Je,{children:o.jsx("p",{children:"Play video"})})]})})]})]})}function Ag({item:e,addToCart:t=!1,syncToShopify:r=!1,customAction:n=o.jsx(o.Fragment,{}),defaultOpportunityNumber:a="",viewProductAction:s,addToCartAction:c,isAddToCartActionLoading:l=!1,syncToShopifyAction:u,isSyncToShopifyActionLoading:d=!1}){var M,K,X,ee,te,ne,se,le,ae,Me,de,Pe;const[f,p]=H.useState(1),[h,m]=H.useState(null),[b,g]=H.useState(0),[w,v]=H.useState(!1),y=((M=e==null?void 0:e.Distribution)==null?void 0:M.Cost)||0,x=((K=e==null?void 0:e.Distribution)==null?void 0:K.RegularPrice)||0,N=((X=e==null?void 0:e.Distribution)==null?void 0:X.Price)||0,[E,C]=H.useState(null),[T,F]=H.useState(!1);H.useEffect(()=>{const U=async()=>{if(e!=null&&e.ManufacturerId){F(!0);try{const Z=await fetch(`https://api.randmar.io/V4/Partner/${e.ManufacturerId}/Account/Logo?width=60&height=40`);if(Z.ok){const he=await Z.blob();C(URL.createObjectURL(he))}}catch(Z){console.error("Failed to load logo:",Z)}finally{F(!1)}}};e!=null&&e.ManufacturerId&&U()},[e==null?void 0:e.ManufacturerId]),H.useEffect(()=>{var U;if(e&&a){const Z=(U=e.Opportunities)==null?void 0:U.find(he=>he.BidNumber==a);Z&&m(Z)}},[e,a]),H.useEffect(()=>{if(!e)return;const U=h!=null&&h.Price?h.Price:N;g(x>0?Math.round((x-U)/x*100):0)},[e,h,N,x]),H.useEffect(()=>{l||p(1)},[l]);const O=U=>{if(U.Active!==!0)return!1;const Z=new Date().toISOString().split("T")[0];return!(U.EndDate&&U.EndDate<Z||U.StartDate&&U.StartDate>Z)};if(!e)return o.jsx($t,{className:"hover:shadow-lg transition-shadow",children:o.jsxs(zt,{className:"p-6",children:[o.jsxs("div",{className:"flex justify-between items-start mb-3",children:[o.jsx(R,{className:"h-7 w-3/4"}),o.jsx("div",{className:"h-10 w-24 flex items-center justify-end ml-4",children:o.jsx(R,{className:"h-10 w-24 rounded-md"})})]}),o.jsxs("div",{className:"flex flex-wrap gap-2 mb-4",children:[o.jsx(R,{className:"h-6 w-20 rounded-full"}),o.jsx(R,{className:"h-6 w-24 rounded-full"}),o.jsx(R,{className:"h-6 w-28 rounded-full"})]}),o.jsxs("div",{className:"flex gap-6",children:[o.jsxs("div",{className:"grid grid-cols-2 gap-x-4 gap-y-6 flex-1",children:[o.jsxs("div",{children:[o.jsx(R,{className:"h-4 w-12 mb-1"}),o.jsx(R,{className:"h-5 w-20"})]}),o.jsxs("div",{children:[o.jsx(R,{className:"h-4 w-12 mb-1"}),o.jsx(R,{className:"h-5 w-24"})]}),o.jsxs("div",{children:[o.jsx(R,{className:"h-4 w-20 mb-1"}),o.jsx(R,{className:"h-5 w-16"})]}),o.jsxs("div",{children:[o.jsx(R,{className:"h-4 w-12 mb-1"}),o.jsx(R,{className:"h-5 w-20"})]})]}),o.jsx("div",{className:"flex flex-col",children:o.jsx("div",{className:"w-60 h-40",children:o.jsx(R,{className:"w-full h-full rounded-lg"})})})]}),o.jsxs("div",{className:"flex gap-6 mt-4",children:[o.jsx("div",{className:"flex flex-1",children:o.jsxs("div",{className:"w-full",children:[o.jsx(R,{className:"h-4 w-24 mb-3"}),o.jsx(R,{className:"h-16 w-full rounded-md"})]})}),o.jsxs("div",{className:"flex flex-col items-center",children:[o.jsx(R,{className:"h-10 w-32 rounded-md"}),o.jsx(R,{className:"h-5 w-24 mt-4"})]})]}),o.jsxs("div",{className:"flex gap-6 mt-4",children:[o.jsxs("div",{className:"flex flex-col items-start gap-1 mb-2",children:[o.jsx(R,{className:"h-8 w-32"}),o.jsx(R,{className:"h-6 w-24"})]}),o.jsxs("div",{className:"flex flex-1 items-center gap-2",children:[o.jsx(R,{className:"h-10 w-24 rounded-md"}),o.jsx(R,{className:"h-10 flex-1 rounded-md"})]})]})]})});const B=(e==null?void 0:e.Opportunities)||[],z=B.length>0,W=()=>{if(f==null){p(1);return}f>1&&p(f-1)},L=()=>{if(f==null){p(1);return}p(f+1)},P=U=>{const Z=parseInt(U.target.value,10);if(!isNaN(Z)&&Z>0){p(Z);return}p(void 0)},G=()=>{(f==null||f<1)&&p(1)},A=((te=(ee=e.Distribution)==null?void 0:ee.Inventory)==null?void 0:te.reduce((U,Z)=>U+(Z.AvailableQuantity||0),0))||0,q=U=>{try{return new Date(U).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}catch(Z){return console.error(Z),U.split("T")[0]||"N/A"}},D=()=>{c&&c({quantity:f??1,bidNumber:(h==null?void 0:h.BidNumber)??null})};return o.jsx($t,{className:"hover:shadow-lg transition-shadow",children:o.jsxs(zt,{className:"p-6",children:[o.jsxs("div",{className:"flex justify-between items-start mb-3",children:[o.jsx("h3",{className:"font-semibold text-xl",children:e.Title||e.RandmarTitle}),o.jsx("div",{className:"h-10 w-24 flex items-center justify-end ml-4",children:T?o.jsx(R,{className:"h-10 w-24 rounded-md"}):E&&o.jsx("img",{src:E||"/placeholder.svg",alt:e.ManufacturerName,className:"max-h-10 max-w-24 object-contain"})})]}),o.jsxs("div",{className:"flex gap-6",children:[o.jsxs("div",{className:"flex-1",children:[o.jsxs("div",{className:"flex flex-wrap gap-2 mb-4",children:[e.State&&o.jsxs(Te,{variant:"outline",className:`rounded-full px-3 ${e.State==="Active"?"bg-green-50 text-green-700 hover:bg-green-50":"bg-red-50 text-red-700 hover:bg-red-50"}`,children:[o.jsx(Dr,{size:"12",className:"mr-1.5"})," ",e.State]}),o.jsxs(Te,{variant:"outline",className:`rounded-full px-3 ${e.SerialNumber?"bg-green-50 text-green-700 hover:bg-green-50":"bg-yellow-50 text-yellow-700 hover:bg-yellow-50"}`,children:[o.jsx(Cl,{size:"12",className:"mr-1.5"})," ",e.SerialNumber?"Serialized":"Unserialized"]}),e.TransparencyCode&&o.jsxs(Te,{variant:"outline",className:"rounded-full px-3 bg-green-50 text-green-700 hover:bg-green-50",children:[o.jsx(pl,{size:"12",className:"mr-1.5"})," Transparency Code"]}),e.AvailableToBuy===void 0?o.jsxs(Te,{variant:"outline",className:`rounded-full px-3 ${(ne=e.ManufacturerCategory)!=null&&ne.QualificationRequired?"bg-blue-50 text-blue-700 hover:bg-blue-50":"bg-neutral-50 text-neutral-700 hover:bg-neutral-50"}`,children:[o.jsx(Ao,{size:"12",className:"mr-1.5"})," ",(se=e.ManufacturerCategory)!=null&&se.QualificationRequired?"Qualification Enforced":"No Qualification Needed"]}):o.jsxs(Te,{variant:"outline",className:`rounded-full px-3 ${e.AvailableToBuy?"bg-green-50 text-green-700 hover:bg-green-50":"bg-red-50 text-red-700 hover:bg-red-50"}`,children:[o.jsx(Ao,{size:"12",className:"mr-1.5"})," ",(le=e.ManufacturerCategory)!=null&&le.QualificationRequired?e.AvailableToBuy?"Qualified":"Not Qualified":"No Qualification Required"]}),e.ManufacturerId&&o.jsxs(Te,{variant:"outline",className:`rounded-full px-3 ${e.AutoUpdate?"bg-green-50 text-green-700 hover:bg-green-50":"bg-red-50 text-red-700 hover:bg-red-50"}`,children:[o.jsx(Sl,{size:"12",className:"mr-1.5"})," ",e.AutoUpdate?`Automatic Reorder (${e.MasterCarton})`:"Manually Reorders"]}),o.jsxs(Te,{variant:"outline",className:`rounded-full px-3 ${e.BodyHTML&&e.Title&&e.MAP?"bg-green-50 text-green-700 hover:bg-green-50":"bg-red-50 text-red-700 hover:bg-red-50"}`,children:[o.jsx(Tl,{size:"12",className:"mr-1.5"})," ",e.BodyHTML&&e.Title&&e.MAP?"Shopify Ready":"Not Shopify Ready"]})]}),o.jsxs("div",{className:"grid grid-cols-2 gap-x-4 gap-y-4 flex-1",children:[o.jsxs("div",{children:[o.jsx("div",{className:"text-sm text-muted-foreground",children:"MPN"}),o.jsx("div",{className:"font-medium",children:e.MPN||"N/A"})]}),o.jsxs("div",{children:[o.jsx("div",{className:"text-sm text-muted-foreground",children:"UPC"}),o.jsx("div",{className:"font-medium",children:e.UPC||"N/A"})]}),o.jsxs("div",{children:[o.jsx("div",{className:"text-sm text-muted-foreground",children:"Unit Weight"}),o.jsx("div",{className:"font-medium",children:e.UnitWeight?`${e.UnitWeight} lbs`:"N/A"})]}),o.jsxs("div",{children:[o.jsx("div",{className:"text-sm text-muted-foreground",children:"MAP"}),o.jsx("div",{className:"font-medium",children:e.MAP?"$"+e.MAP.toFixed(2):"N/A"})]}),e.CountryCodeOfOrigin&&o.jsxs("div",{children:[o.jsx("div",{className:"text-sm text-muted-foreground",children:"Origin"}),o.jsxs("div",{className:"font-medium flex items-center",children:[o.jsx(jc,{countryCode:e.CountryCodeOfOrigin,className:"mr-2"}),e.CountryCodeOfOrigin]})]})]})]}),o.jsx("div",{className:"flex flex-col",children:o.jsx(Yc,{randmarSKU:e.RandmarSKU||"",alt:e.RandmarTitle||""})})]}),o.jsxs("div",{className:"flex gap-6 mt-4",children:[o.jsx("div",{className:"flex flex-1",children:z&&e.Distribution&&o.jsxs("div",{className:"w-full",children:[o.jsx("div",{className:"flex items-center",children:"You have "+B.length+(B.length>1?" opportunities":" opportunity")+" for this product:"}),o.jsx("div",{className:"space-y-2 max-h-[200px] overflow-y-auto p-2 mt-1",children:B.map((U,Z)=>{var he;return o.jsxs("div",{className:`flex justify-between items-center rounded-lg transition-colors py-2 px-4 bg-purple-100 border border-muted
|
|
195
|
-
${
|
|
196
|
-
`,onClick:()=>{O(U)&&m(U.BidNumber!=(h==null?void 0:h.BidNumber)?U:null)},children:[o.jsx("div",{className:"flex items-center",children:o.jsxs("div",{className:"flex flex-col",children:[o.jsx("span",{className:"font-medium text-sm",children:U.Opportunity}),o.jsxs("span",{className:"text-xs text-neutral-900",children:[U.BidNumber," ",!O(U)&&o.jsx(Te,{variant:"outline",className:"text-xs mx-1 h-5 bg-gray-100",children:"Currently unavailable"})]})]})}),o.jsxs("div",{className:"flex flex-col items-end",children:[o.jsxs("span",{className:"font-semibold",children:["$",(he=U.Price)==null?void 0:he.toFixed(2)]}),U.Rebate&&U.Rebate>0&&o.jsxs("span",{className:"text-xs text-green-600",children:["Rebate: $",U.Rebate.toFixed(2)]}),U.EndDate&&o.jsxs("span",{className:"text-xs text-neutral-600",children:["Ends: ",q(U.EndDate)]})]})]},Z)})})]})}),o.jsxs("div",{className:"flex flex-col items-center",children:[s&&o.jsxs(ce,{variant:"secondary",onClick:s,children:[o.jsx(ml,{className:"mr-2"}),"View Product"]}),((ae=e.Distribution)==null?void 0:ae.Inventory)&&o.jsx("div",{className:"mt-4",children:o.jsxs(Nt,{open:w,onOpenChange:v,children:[o.jsx(nn,{asChild:!0,children:o.jsxs(ce,{variant:"ghost",className:`flex items-center text-sm ${A>0?"text-green-700":"text-red-700"}`,children:[o.jsx(Do,{size:"16",className:"mr-2"}),A>0?o.jsxs(o.Fragment,{children:[A," in stock"]}):o.jsx(o.Fragment,{children:"Out of stock"})]})}),o.jsxs(Ct,{className:"max-w-4xl",children:[o.jsx(rr,{children:o.jsxs(nr,{className:"flex items-center",children:[o.jsx(Do,{className:"mr-2",size:18}),"Inventory Information"]})}),o.jsx(_i,{inventory:e.Distribution.Inventory})]})]})})]})]}),e.Distribution&&o.jsxs("div",{className:"flex justify-between items-end mt-4",children:[o.jsx("div",{className:"flex-shrink-1 flex flex-col items-start gap-1",children:y>0?o.jsx("div",{className:"flex items-center",children:o.jsxs("span",{className:"text-2xl font-bold whitespace-nowrap",children:[o.jsx("span",{children:"Cost: $"}),y.toFixed(2),o.jsx("span",{children:" CAD"})]})}):o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"flex items-center flex-wrap",children:[o.jsxs("span",{className:"text-2xl font-bold whitespace-nowrap",children:[o.jsx("span",{children:"$"}),h?(de=(Me=e.Opportunities)==null?void 0:Me.find(U=>U.BidNumber==h.BidNumber))==null?void 0:de.Price:N.toFixed(2),o.jsx("span",{children:" CAD"})]}),b>0&&o.jsxs("span",{className:"text-muted-foreground line-through ml-2 whitespace-nowrap",children:["$",x.toFixed(2)]})]}),b>0&&o.jsx("div",{className:"flex items-center",children:o.jsxs(Te,{variant:"outline",className:"bg-red-50 text-red-700 rounded-full px-3 whitespace-nowrap",children:[o.jsxs("span",{children:[b,"% OFF"]}),((Pe=e.InstantRebate)==null?void 0:Pe.EndDate)&&o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"mx-1.5",children:"●"})," Ends ",e.InstantRebate.EndDate.split("T")[0]]}),(h==null?void 0:h.EndDate)&&o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"mx-1.5",children:"●"})," Ends ",h.EndDate.split("T")[0]]})]})})]})}),o.jsxs("div",{className:"flex flex-shrink-0 gap-2 ml-4",children:[typeof t<"u"&&t&&o.jsxs("div",{className:"flex items-center border rounded-md",children:[o.jsx(ce,{variant:"ghost",size:"icon",className:"rounded-r-none",onClick:W,disabled:typeof f<"u"&&(f<=1||!e.AvailableToBuy||l||!c),children:"-"}),o.jsx("input",{value:f,onChange:P,onBlur:G,onClick:U=>U.currentTarget.select(),className:`w-12 text-center border-0 focus:ring-0 focus:outline-none ${!e.AvailableToBuy||l||!c?"text-gray-400":""}`,disabled:!e.AvailableToBuy||l||!c}),o.jsx(ce,{variant:"ghost",size:"icon",className:"rounded-l-none",onClick:L,disabled:!e.AvailableToBuy||l||!c,children:"+"})]}),typeof t<"u"&&t&&o.jsx(ce,{className:"gap-2 whitespace-nowrap",onClick:D,disabled:!e.AvailableToBuy||l||!c,children:l?o.jsxs(o.Fragment,{children:[o.jsx(Po,{className:"h-4 w-4 animate-spin"}),"Adding..."]}):o.jsxs(o.Fragment,{children:[o.jsx(_o,{className:"mr-2"}),"Add to Cart"]})}),r&&o.jsx(ce,{className:"gap-2 whitespace-nowrap bg-green-600 hover:bg-green-700",onClick:u,disabled:d||!u,children:d?o.jsxs(o.Fragment,{children:[o.jsx(Po,{className:"h-4 w-4 animate-spin"}),"Syncing..."]}):o.jsxs(o.Fragment,{children:[o.jsx(_o,{className:"mr-2"}),"Sync to Shopify"]})}),n]})]})]})})}function _g({id:e,name:t,about:r,voiceName:n,voiceStyle:a,sceneName:s,action:c}){const l=`https://api.randmar.io/V4/Partner/${e}/Account/Video`,u=`https://api.randmar.io/V4/Partner/${e}/Account/Video/Exists`,d=`https://api.randmar.io/V4/Partner/${e}/Account/Logo?width=64&height=64`,f=`https://api.randmar.io/V4/Partner/${e}/Account/Logo/Exists`,p=!!(n||a||s),[h,m]=H.useState(null),[b,g]=H.useState(!1),[w,v]=H.useState(!1),[y,x]=H.useState(!1),[N,E]=H.useState(!0);H.useEffect(()=>{if(!e)return;const T=async()=>{try{const z=await fetch(f);if(z.ok){const L=(await z.text()).toLowerCase()==="true";return v(L),L}return!1}catch(z){return console.error("Failed to check if logo exists:",z),v(!1),!1}},F=async()=>{g(!0);try{const z=await fetch(d);if(z.ok){const W=await z.blob();m(URL.createObjectURL(W))}}catch(z){console.error("Failed to load logo:",z)}finally{g(!1)}},O=async()=>{try{const z=await fetch(u);if(z.ok){const W=await z.text();x(W.toLowerCase()==="true")}}catch(z){console.error("Failed to check if video exists:",z),x(!1)}};(async()=>{await T()&&F(),O()})()},[e,d,f,u]);const C=()=>{E(!1)};return o.jsx($t,{className:"hover:shadow-lg transition-shadow",children:o.jsxs(zt,{className:"p-6",children:[o.jsxs("div",{className:"flex flex-col sm:flex-row justify-between items-start gap-4 mb-4",children:[o.jsxs("div",{className:"flex items-center",children:[w&&o.jsx("div",{className:"h-10 flex items-center justify-center mr-4",children:b?o.jsx(R,{className:"h-10 w-10 rounded-md"}):h&&o.jsx("img",{src:h,alt:`${t} logo`,className:"max-h-10 w-auto object-contain"})}),o.jsx("h3",{className:"font-semibold text-xl",children:t})]}),c&&o.jsx("div",{className:"w-full sm:w-auto",children:c})]}),o.jsxs("div",{className:"flex flex-col md:flex-row gap-6",children:[o.jsxs("div",{className:"flex-1 flex flex-col order-1 md:order-1",children:[o.jsx("div",{className:"prose prose-sm max-w-none",dangerouslySetInnerHTML:{__html:r}}),p&&o.jsx("div",{className:"mt-4 p-3 bg-slate-50 rounded-md",children:o.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-2",children:[n&&o.jsxs("div",{children:[o.jsx("div",{className:"text-sm text-muted-foreground",children:"Voice Name"}),o.jsx("div",{className:"font-medium",children:n})]}),a&&o.jsxs("div",{children:[o.jsx("div",{className:"text-sm text-muted-foreground",children:"Voice Style"}),o.jsx("div",{className:"font-medium",children:a})]}),s&&o.jsxs("div",{children:[o.jsx("div",{className:"text-sm text-muted-foreground",children:"Scene Name"}),o.jsx("div",{className:"font-medium",children:s})]})]})})]}),y&&o.jsx("div",{className:"flex flex-col order-1 md:order-1 md:w-auto",children:o.jsxs("div",{className:"w-[180px] h-[320px] rounded-md overflow-hidden",children:[N&&o.jsx(R,{className:"w-full h-full"}),o.jsx("video",{src:l,controls:!0,preload:"auto",playsInline:!0,className:`w-full h-full object-contain ${N?"invisible":"visible"}`,style:{objectPosition:"center",imageRendering:"auto"},onLoadedData:C,onError:()=>E(!1)})]})})]})]})})}S.AvatarFooter=qh,S.Badge=Te,S.Button=ce,S.Card=$t,S.CardContent=zt,S.CardDescription=Gc,S.CardFooter=Uc,S.CardHeader=Wc,S.CardTitle=Vc,S.CountryFlag=jc,S.Dialog=Nt,S.DialogClose=on,S.DialogContent=Ct,S.DialogDescription=cn,S.DialogFooter=sn,S.DialogHeader=rr,S.DialogOverlay=an,S.DialogPortal=$a,S.DialogTitle=nr,S.DialogTrigger=nn,S.DropdownMenu=gh,S.DropdownMenuCheckboxItem=Ei,S.DropdownMenuContent=Ci,S.DropdownMenuGroup=mh,S.DropdownMenuItem=Si,S.DropdownMenuLabel=Mi,S.DropdownMenuPortal=bh,S.DropdownMenuRadioGroup=yh,S.DropdownMenuRadioItem=Ti,S.DropdownMenuSeparator=Pi,S.DropdownMenuShortcut=Ai,S.DropdownMenuSub=wh,S.DropdownMenuSubContent=Ni,S.DropdownMenuSubTrigger=xi,S.DropdownMenuTrigger=vh,S.Input=Nr,S.InputOTP=hd,S.InputOTPGroup=gd,S.InputOTPSeparator=md,S.InputOTPSlot=vd,S.Label=Rh,S.Layout=Kc,S.Navbar=Hc,S.PartnerCard=_g,S.ProductCard=Ag,S.ProductImage=Yc,S.ProductInventoryGrid=_i,S.Separator=Gn,S.Sheet=Hi,S.SheetClose=Kh,S.SheetContent=jn,S.SheetDescription=Qi,S.SheetFooter=qi,S.SheetHeader=Yi,S.SheetOverlay=Un,S.SheetPortal=Ki,S.SheetTitle=Xi,S.SheetTrigger=Hh,S.Sidebar=Yn,S.SidebarContent=Rn,S.SidebarFooter=Qn,S.SidebarGroup=oc,S.SidebarGroupAction=sc,S.SidebarGroupContent=ic,S.SidebarGroupLabel=ac,S.SidebarHeader=Xn,S.SidebarInput=rc,S.SidebarInset=tc,S.SidebarMenu=Zn,S.SidebarMenuAction=cc,S.SidebarMenuBadge=lc,S.SidebarMenuButton=eo,S.SidebarMenuItem=Jn,S.SidebarMenuSkeleton=dc,S.SidebarMenuSub=uc,S.SidebarMenuSubButton=pc,S.SidebarMenuSubItem=fc,S.SidebarProvider=Kn,S.SidebarRail=ec,S.SidebarSeparator=nc,S.SidebarTrigger=qn,S.Skeleton=R,S.Toast=lo,S.ToastAction=Lc,S.ToastClose=uo,S.ToastDescription=po,S.ToastProvider=Oc,S.ToastTitle=fo,S.ToastViewport=co,S.Toaster=zc,S.Tooltip=mt,S.TooltipContent=Je,S.TooltipProvider=vt,S.TooltipTrigger=bt,S.Topbar=mo,S.badgeVariants=Bc,S.buttonVariants=$n,S.toast=$c,S.useIsMobile=Zi,S.useSidebar=Lt,S.useToast=vo,Object.defineProperty(S,Symbol.toStringTag,{value:"Module"})});
|
|
194
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return i.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},zu="DialogDescriptionWarning",Bu=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Oa(zu).contentName}}.`;return i.useEffect(()=>{var s;const a=(s=e.current)==null?void 0:s.getAttribute("aria-describedby");t&&a&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},rn=ya,La=Na,Fa=Sa,Zt=Ea,Jt=Ta,Rt=Pa,er=_a,tr=Ia;const St=({modal:e=!1,...t})=>o.jsx(rn,{modal:e,...t});St.displayName=rn.displayName;const nn=La,$a=Fa,on=tr,an=i.forwardRef(({className:e,...t},r)=>o.jsx(Zt,{ref:r,className:_("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));an.displayName=Zt.displayName;const Et=i.forwardRef(({className:e,children:t,...r},n)=>o.jsxs($a,{children:[o.jsx(an,{}),o.jsxs(Jt,{ref:n,className:_("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-2xl shadow-primary duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...r,children:[t,o.jsxs(tr,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[o.jsx(Ir,{className:"h-4 w-4"}),o.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Et.displayName=Jt.displayName;const rr=({className:e,...t})=>o.jsx("div",{className:_("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});rr.displayName="DialogHeader";const sn=({className:e,...t})=>o.jsx("div",{className:_("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});sn.displayName="DialogFooter";const nr=i.forwardRef(({className:e,...t},r)=>o.jsx(Rt,{ref:r,className:_("text-lg font-semibold leading-none tracking-tight",e),...t}));nr.displayName=Rt.displayName;const cn=i.forwardRef(({className:e,...t},r)=>o.jsx(er,{ref:r,className:_("text-sm text-muted-foreground",e),...t}));cn.displayName=er.displayName;function ln(e){const t=e+"CollectionProvider",[r,n]=Be(t),[a,s]=r(t,{collectionRef:{current:null},itemMap:new Map}),c=m=>{const{scope:b,children:g}=m,w=H.useRef(null),v=H.useRef(new Map).current;return o.jsx(a,{scope:b,itemMap:v,collectionRef:w,children:g})};c.displayName=t;const l=e+"CollectionSlot",u=H.forwardRef((m,b)=>{const{scope:g,children:w}=m,v=s(l,g),y=oe(b,v.collectionRef);return o.jsx(ye,{ref:y,children:w})});u.displayName=l;const d=e+"CollectionItemSlot",f="data-radix-collection-item",p=H.forwardRef((m,b)=>{const{scope:g,children:w,...v}=m,y=H.useRef(null),x=oe(b,y),N=s(d,g);return H.useEffect(()=>(N.itemMap.set(y,{ref:y,...v}),()=>void N.itemMap.delete(y))),o.jsx(ye,{[f]:"",ref:x,children:w})});p.displayName=d;function h(m){const b=s(e+"CollectionConsumer",m);return H.useCallback(()=>{const w=b.collectionRef.current;if(!w)return[];const v=Array.from(w.querySelectorAll(`[${f}]`));return Array.from(b.itemMap.values()).sort((N,E)=>v.indexOf(N.ref.current)-v.indexOf(E.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:c,Slot:u,ItemSlot:p},h,n]}var Wu=i.createContext(void 0);function za(e){const t=i.useContext(Wu);return e||t||"ltr"}const Vu=["top","right","bottom","left"],Ge=Math.min,me=Math.max,or=Math.round,ar=Math.floor,De=e=>({x:e,y:e}),Gu={left:"right",right:"left",bottom:"top",top:"bottom"},Uu={start:"end",end:"start"};function dn(e,t,r){return me(e,Ge(t,r))}function Le(e,t){return typeof e=="function"?e(t):e}function Fe(e){return e.split("-")[0]}function ut(e){return e.split("-")[1]}function un(e){return e==="x"?"y":"x"}function fn(e){return e==="y"?"height":"width"}function Ue(e){return["top","bottom"].includes(Fe(e))?"y":"x"}function pn(e){return un(Ue(e))}function ju(e,t,r){r===void 0&&(r=!1);const n=ut(e),a=pn(e),s=fn(a);let c=a==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(c=sr(c)),[c,sr(c)]}function Hu(e){const t=sr(e);return[hn(e),t,hn(t)]}function hn(e){return e.replace(/start|end/g,t=>Uu[t])}function Ku(e,t,r){const n=["left","right"],a=["right","left"],s=["top","bottom"],c=["bottom","top"];switch(e){case"top":case"bottom":return r?t?a:n:t?n:a;case"left":case"right":return t?s:c;default:return[]}}function Yu(e,t,r,n){const a=ut(e);let s=Ku(Fe(e),r==="start",n);return a&&(s=s.map(c=>c+"-"+a),t&&(s=s.concat(s.map(hn)))),s}function sr(e){return e.replace(/left|right|bottom|top/g,t=>Gu[t])}function qu(e){return{top:0,right:0,bottom:0,left:0,...e}}function Ba(e){return typeof e!="number"?qu(e):{top:e,right:e,bottom:e,left:e}}function ir(e){const{x:t,y:r,width:n,height:a}=e;return{width:n,height:a,top:r,left:t,right:t+n,bottom:r+a,x:t,y:r}}function Wa(e,t,r){let{reference:n,floating:a}=e;const s=Ue(t),c=pn(t),l=fn(c),u=Fe(t),d=s==="y",f=n.x+n.width/2-a.width/2,p=n.y+n.height/2-a.height/2,h=n[l]/2-a[l]/2;let m;switch(u){case"top":m={x:f,y:n.y-a.height};break;case"bottom":m={x:f,y:n.y+n.height};break;case"right":m={x:n.x+n.width,y:p};break;case"left":m={x:n.x-a.width,y:p};break;default:m={x:n.x,y:n.y}}switch(ut(t)){case"start":m[c]-=h*(r&&d?-1:1);break;case"end":m[c]+=h*(r&&d?-1:1);break}return m}const Xu=async(e,t,r)=>{const{placement:n="bottom",strategy:a="absolute",middleware:s=[],platform:c}=r,l=s.filter(Boolean),u=await(c.isRTL==null?void 0:c.isRTL(t));let d=await c.getElementRects({reference:e,floating:t,strategy:a}),{x:f,y:p}=Wa(d,n,u),h=n,m={},b=0;for(let g=0;g<l.length;g++){const{name:w,fn:v}=l[g],{x:y,y:x,data:N,reset:E}=await v({x:f,y:p,initialPlacement:n,placement:h,strategy:a,middlewareData:m,rects:d,platform:c,elements:{reference:e,floating:t}});f=y??f,p=x??p,m={...m,[w]:{...m[w],...N}},E&&b<=50&&(b++,typeof E=="object"&&(E.placement&&(h=E.placement),E.rects&&(d=E.rects===!0?await c.getElementRects({reference:e,floating:t,strategy:a}):E.rects),{x:f,y:p}=Wa(d,h,u)),g=-1)}return{x:f,y:p,placement:h,strategy:a,middlewareData:m}};async function Tt(e,t){var r;t===void 0&&(t={});const{x:n,y:a,platform:s,rects:c,elements:l,strategy:u}=e,{boundary:d="clippingAncestors",rootBoundary:f="viewport",elementContext:p="floating",altBoundary:h=!1,padding:m=0}=Le(t,e),b=Ba(m),w=l[h?p==="floating"?"reference":"floating":p],v=ir(await s.getClippingRect({element:(r=await(s.isElement==null?void 0:s.isElement(w)))==null||r?w:w.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(l.floating)),boundary:d,rootBoundary:f,strategy:u})),y=p==="floating"?{x:n,y:a,width:c.floating.width,height:c.floating.height}:c.reference,x=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l.floating)),N=await(s.isElement==null?void 0:s.isElement(x))?await(s.getScale==null?void 0:s.getScale(x))||{x:1,y:1}:{x:1,y:1},E=ir(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:y,offsetParent:x,strategy:u}):y);return{top:(v.top-E.top+b.top)/N.y,bottom:(E.bottom-v.bottom+b.bottom)/N.y,left:(v.left-E.left+b.left)/N.x,right:(E.right-v.right+b.right)/N.x}}const Qu=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:a,rects:s,platform:c,elements:l,middlewareData:u}=t,{element:d,padding:f=0}=Le(e,t)||{};if(d==null)return{};const p=Ba(f),h={x:r,y:n},m=pn(a),b=fn(m),g=await c.getDimensions(d),w=m==="y",v=w?"top":"left",y=w?"bottom":"right",x=w?"clientHeight":"clientWidth",N=s.reference[b]+s.reference[m]-h[m]-s.floating[b],E=h[m]-s.reference[m],C=await(c.getOffsetParent==null?void 0:c.getOffsetParent(d));let T=C?C[x]:0;(!T||!await(c.isElement==null?void 0:c.isElement(C)))&&(T=l.floating[x]||s.floating[b]);const $=N/2-E/2,O=T/2-g[b]/2-1,B=Ge(p[v],O),K=Ge(p[y],O),F=B,L=T-g[b]-K,P=T/2-g[b]/2+$,V=dn(F,P,L),A=!u.arrow&&ut(a)!=null&&P!==V&&s.reference[b]/2-(P<F?B:K)-g[b]/2<0,X=A?P<F?P-F:P-L:0;return{[m]:h[m]+X,data:{[m]:V,centerOffset:P-V-X,...A&&{alignmentOffset:X}},reset:A}}}),Zu=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:a,middlewareData:s,rects:c,initialPlacement:l,platform:u,elements:d}=t,{mainAxis:f=!0,crossAxis:p=!0,fallbackPlacements:h,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:g=!0,...w}=Le(e,t);if((r=s.arrow)!=null&&r.alignmentOffset)return{};const v=Fe(a),y=Ue(l),x=Fe(l)===l,N=await(u.isRTL==null?void 0:u.isRTL(d.floating)),E=h||(x||!g?[sr(l)]:Hu(l)),C=b!=="none";!h&&C&&E.push(...Yu(l,g,b,N));const T=[l,...E],$=await Tt(t,w),O=[];let B=((n=s.flip)==null?void 0:n.overflows)||[];if(f&&O.push($[v]),p){const P=ju(a,c,N);O.push($[P[0]],$[P[1]])}if(B=[...B,{placement:a,overflows:O}],!O.every(P=>P<=0)){var K,F;const P=(((K=s.flip)==null?void 0:K.index)||0)+1,V=T[P];if(V)return{data:{index:P,overflows:B},reset:{placement:V}};let A=(F=B.filter(X=>X.overflows[0]<=0).sort((X,D)=>X.overflows[1]-D.overflows[1])[0])==null?void 0:F.placement;if(!A)switch(m){case"bestFit":{var L;const X=(L=B.filter(D=>{if(C){const M=Ue(D.placement);return M===y||M==="y"}return!0}).map(D=>[D.placement,D.overflows.filter(M=>M>0).reduce((M,Y)=>M+Y,0)]).sort((D,M)=>D[1]-M[1])[0])==null?void 0:L[0];X&&(A=X);break}case"initialPlacement":A=l;break}if(a!==A)return{reset:{placement:A}}}return{}}}};function Va(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Ga(e){return Vu.some(t=>e[t]>=0)}const Ju=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:n="referenceHidden",...a}=Le(e,t);switch(n){case"referenceHidden":{const s=await Tt(t,{...a,elementContext:"reference"}),c=Va(s,r.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:Ga(c)}}}case"escaped":{const s=await Tt(t,{...a,altBoundary:!0}),c=Va(s,r.floating);return{data:{escapedOffsets:c,escaped:Ga(c)}}}default:return{}}}}};async function Ru(e,t){const{placement:r,platform:n,elements:a}=e,s=await(n.isRTL==null?void 0:n.isRTL(a.floating)),c=Fe(r),l=ut(r),u=Ue(r)==="y",d=["left","top"].includes(c)?-1:1,f=s&&u?-1:1,p=Le(t,e);let{mainAxis:h,crossAxis:m,alignmentAxis:b}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return l&&typeof b=="number"&&(m=l==="end"?b*-1:b),u?{x:m*f,y:h*d}:{x:h*d,y:m*f}}const ef=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:a,y:s,placement:c,middlewareData:l}=t,u=await Ru(t,e);return c===((r=l.offset)==null?void 0:r.placement)&&(n=l.arrow)!=null&&n.alignmentOffset?{}:{x:a+u.x,y:s+u.y,data:{...u,placement:c}}}}},tf=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:a}=t,{mainAxis:s=!0,crossAxis:c=!1,limiter:l={fn:w=>{let{x:v,y}=w;return{x:v,y}}},...u}=Le(e,t),d={x:r,y:n},f=await Tt(t,u),p=Ue(Fe(a)),h=un(p);let m=d[h],b=d[p];if(s){const w=h==="y"?"top":"left",v=h==="y"?"bottom":"right",y=m+f[w],x=m-f[v];m=dn(y,m,x)}if(c){const w=p==="y"?"top":"left",v=p==="y"?"bottom":"right",y=b+f[w],x=b-f[v];b=dn(y,b,x)}const g=l.fn({...t,[h]:m,[p]:b});return{...g,data:{x:g.x-r,y:g.y-n,enabled:{[h]:s,[p]:c}}}}}},rf=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:a,rects:s,middlewareData:c}=t,{offset:l=0,mainAxis:u=!0,crossAxis:d=!0}=Le(e,t),f={x:r,y:n},p=Ue(a),h=un(p);let m=f[h],b=f[p];const g=Le(l,t),w=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(u){const x=h==="y"?"height":"width",N=s.reference[h]-s.floating[x]+w.mainAxis,E=s.reference[h]+s.reference[x]-w.mainAxis;m<N?m=N:m>E&&(m=E)}if(d){var v,y;const x=h==="y"?"width":"height",N=["top","left"].includes(Fe(a)),E=s.reference[p]-s.floating[x]+(N&&((v=c.offset)==null?void 0:v[p])||0)+(N?0:w.crossAxis),C=s.reference[p]+s.reference[x]+(N?0:((y=c.offset)==null?void 0:y[p])||0)-(N?w.crossAxis:0);b<E?b=E:b>C&&(b=C)}return{[h]:m,[p]:b}}}},nf=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:a,rects:s,platform:c,elements:l}=t,{apply:u=()=>{},...d}=Le(e,t),f=await Tt(t,d),p=Fe(a),h=ut(a),m=Ue(a)==="y",{width:b,height:g}=s.floating;let w,v;p==="top"||p==="bottom"?(w=p,v=h===(await(c.isRTL==null?void 0:c.isRTL(l.floating))?"start":"end")?"left":"right"):(v=p,w=h==="end"?"top":"bottom");const y=g-f.top-f.bottom,x=b-f.left-f.right,N=Ge(g-f[w],y),E=Ge(b-f[v],x),C=!t.middlewareData.shift;let T=N,$=E;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&($=x),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(T=y),C&&!h){const B=me(f.left,0),K=me(f.right,0),F=me(f.top,0),L=me(f.bottom,0);m?$=b-2*(B!==0||K!==0?B+K:me(f.left,f.right)):T=g-2*(F!==0||L!==0?F+L:me(f.top,f.bottom))}await u({...t,availableWidth:$,availableHeight:T});const O=await c.getDimensions(l.floating);return b!==O.width||g!==O.height?{reset:{rects:!0}}:{}}}};function cr(){return typeof window<"u"}function ft(e){return Ua(e)?(e.nodeName||"").toLowerCase():"#document"}function be(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ie(e){var t;return(t=(Ua(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Ua(e){return cr()?e instanceof Node||e instanceof be(e).Node:!1}function Se(e){return cr()?e instanceof Element||e instanceof be(e).Element:!1}function ke(e){return cr()?e instanceof HTMLElement||e instanceof be(e).HTMLElement:!1}function ja(e){return!cr()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof be(e).ShadowRoot}function Mt(e){const{overflow:t,overflowX:r,overflowY:n,display:a}=Ee(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!["inline","contents"].includes(a)}function of(e){return["table","td","th"].includes(ft(e))}function lr(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function gn(e){const t=vn(),r=Se(e)?Ee(e):e;return["transform","translate","scale","rotate","perspective"].some(n=>r[n]?r[n]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(n=>(r.willChange||"").includes(n))||["paint","layout","strict","content"].some(n=>(r.contain||"").includes(n))}function af(e){let t=je(e);for(;ke(t)&&!pt(t);){if(gn(t))return t;if(lr(t))return null;t=je(t)}return null}function vn(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function pt(e){return["html","body","#document"].includes(ft(e))}function Ee(e){return be(e).getComputedStyle(e)}function dr(e){return Se(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function je(e){if(ft(e)==="html")return e;const t=e.assignedSlot||e.parentNode||ja(e)&&e.host||Ie(e);return ja(t)?t.host:t}function Ha(e){const t=je(e);return pt(t)?e.ownerDocument?e.ownerDocument.body:e.body:ke(t)&&Mt(t)?t:Ha(t)}function Pt(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const a=Ha(e),s=a===((n=e.ownerDocument)==null?void 0:n.body),c=be(a);if(s){const l=mn(c);return t.concat(c,c.visualViewport||[],Mt(a)?a:[],l&&r?Pt(l):[])}return t.concat(a,Pt(a,[],r))}function mn(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Ka(e){const t=Ee(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const a=ke(e),s=a?e.offsetWidth:r,c=a?e.offsetHeight:n,l=or(r)!==s||or(n)!==c;return l&&(r=s,n=c),{width:r,height:n,$:l}}function bn(e){return Se(e)?e:e.contextElement}function ht(e){const t=bn(e);if(!ke(t))return De(1);const r=t.getBoundingClientRect(),{width:n,height:a,$:s}=Ka(t);let c=(s?or(r.width):r.width)/n,l=(s?or(r.height):r.height)/a;return(!c||!Number.isFinite(c))&&(c=1),(!l||!Number.isFinite(l))&&(l=1),{x:c,y:l}}const sf=De(0);function Ya(e){const t=be(e);return!vn()||!t.visualViewport?sf:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function cf(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==be(e)?!1:t}function Ze(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const a=e.getBoundingClientRect(),s=bn(e);let c=De(1);t&&(n?Se(n)&&(c=ht(n)):c=ht(e));const l=cf(s,r,n)?Ya(s):De(0);let u=(a.left+l.x)/c.x,d=(a.top+l.y)/c.y,f=a.width/c.x,p=a.height/c.y;if(s){const h=be(s),m=n&&Se(n)?be(n):n;let b=h,g=mn(b);for(;g&&n&&m!==b;){const w=ht(g),v=g.getBoundingClientRect(),y=Ee(g),x=v.left+(g.clientLeft+parseFloat(y.paddingLeft))*w.x,N=v.top+(g.clientTop+parseFloat(y.paddingTop))*w.y;u*=w.x,d*=w.y,f*=w.x,p*=w.y,u+=x,d+=N,b=be(g),g=mn(b)}}return ir({width:f,height:p,x:u,y:d})}function wn(e,t){const r=dr(e).scrollLeft;return t?t.left+r:Ze(Ie(e)).left+r}function qa(e,t,r){r===void 0&&(r=!1);const n=e.getBoundingClientRect(),a=n.left+t.scrollLeft-(r?0:wn(e,n)),s=n.top+t.scrollTop;return{x:a,y:s}}function lf(e){let{elements:t,rect:r,offsetParent:n,strategy:a}=e;const s=a==="fixed",c=Ie(n),l=t?lr(t.floating):!1;if(n===c||l&&s)return r;let u={scrollLeft:0,scrollTop:0},d=De(1);const f=De(0),p=ke(n);if((p||!p&&!s)&&((ft(n)!=="body"||Mt(c))&&(u=dr(n)),ke(n))){const m=Ze(n);d=ht(n),f.x=m.x+n.clientLeft,f.y=m.y+n.clientTop}const h=c&&!p&&!s?qa(c,u,!0):De(0);return{width:r.width*d.x,height:r.height*d.y,x:r.x*d.x-u.scrollLeft*d.x+f.x+h.x,y:r.y*d.y-u.scrollTop*d.y+f.y+h.y}}function df(e){return Array.from(e.getClientRects())}function uf(e){const t=Ie(e),r=dr(e),n=e.ownerDocument.body,a=me(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),s=me(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let c=-r.scrollLeft+wn(e);const l=-r.scrollTop;return Ee(n).direction==="rtl"&&(c+=me(t.clientWidth,n.clientWidth)-a),{width:a,height:s,x:c,y:l}}function ff(e,t){const r=be(e),n=Ie(e),a=r.visualViewport;let s=n.clientWidth,c=n.clientHeight,l=0,u=0;if(a){s=a.width,c=a.height;const d=vn();(!d||d&&t==="fixed")&&(l=a.offsetLeft,u=a.offsetTop)}return{width:s,height:c,x:l,y:u}}function pf(e,t){const r=Ze(e,!0,t==="fixed"),n=r.top+e.clientTop,a=r.left+e.clientLeft,s=ke(e)?ht(e):De(1),c=e.clientWidth*s.x,l=e.clientHeight*s.y,u=a*s.x,d=n*s.y;return{width:c,height:l,x:u,y:d}}function Xa(e,t,r){let n;if(t==="viewport")n=ff(e,r);else if(t==="document")n=uf(Ie(e));else if(Se(t))n=pf(t,r);else{const a=Ya(e);n={x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}return ir(n)}function Qa(e,t){const r=je(e);return r===t||!Se(r)||pt(r)?!1:Ee(r).position==="fixed"||Qa(r,t)}function hf(e,t){const r=t.get(e);if(r)return r;let n=Pt(e,[],!1).filter(l=>Se(l)&&ft(l)!=="body"),a=null;const s=Ee(e).position==="fixed";let c=s?je(e):e;for(;Se(c)&&!pt(c);){const l=Ee(c),u=gn(c);!u&&l.position==="fixed"&&(a=null),(s?!u&&!a:!u&&l.position==="static"&&!!a&&["absolute","fixed"].includes(a.position)||Mt(c)&&!u&&Qa(e,c))?n=n.filter(f=>f!==c):a=l,c=je(c)}return t.set(e,n),n}function gf(e){let{element:t,boundary:r,rootBoundary:n,strategy:a}=e;const c=[...r==="clippingAncestors"?lr(t)?[]:hf(t,this._c):[].concat(r),n],l=c[0],u=c.reduce((d,f)=>{const p=Xa(t,f,a);return d.top=me(p.top,d.top),d.right=Ge(p.right,d.right),d.bottom=Ge(p.bottom,d.bottom),d.left=me(p.left,d.left),d},Xa(t,l,a));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function vf(e){const{width:t,height:r}=Ka(e);return{width:t,height:r}}function mf(e,t,r){const n=ke(t),a=Ie(t),s=r==="fixed",c=Ze(e,!0,s,t);let l={scrollLeft:0,scrollTop:0};const u=De(0);if(n||!n&&!s)if((ft(t)!=="body"||Mt(a))&&(l=dr(t)),n){const h=Ze(t,!0,s,t);u.x=h.x+t.clientLeft,u.y=h.y+t.clientTop}else a&&(u.x=wn(a));const d=a&&!n&&!s?qa(a,l):De(0),f=c.left+l.scrollLeft-u.x-d.x,p=c.top+l.scrollTop-u.y-d.y;return{x:f,y:p,width:c.width,height:c.height}}function yn(e){return Ee(e).position==="static"}function Za(e,t){if(!ke(e)||Ee(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return Ie(e)===r&&(r=r.ownerDocument.body),r}function Ja(e,t){const r=be(e);if(lr(e))return r;if(!ke(e)){let a=je(e);for(;a&&!pt(a);){if(Se(a)&&!yn(a))return a;a=je(a)}return r}let n=Za(e,t);for(;n&&of(n)&&yn(n);)n=Za(n,t);return n&&pt(n)&&yn(n)&&!gn(n)?r:n||af(e)||r}const bf=async function(e){const t=this.getOffsetParent||Ja,r=this.getDimensions,n=await r(e.floating);return{reference:mf(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function wf(e){return Ee(e).direction==="rtl"}const yf={convertOffsetParentRelativeRectToViewportRelativeRect:lf,getDocumentElement:Ie,getClippingRect:gf,getOffsetParent:Ja,getElementRects:bf,getClientRects:df,getDimensions:vf,getScale:ht,isElement:Se,isRTL:wf};function Ra(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function xf(e,t){let r=null,n;const a=Ie(e);function s(){var l;clearTimeout(n),(l=r)==null||l.disconnect(),r=null}function c(l,u){l===void 0&&(l=!1),u===void 0&&(u=1),s();const d=e.getBoundingClientRect(),{left:f,top:p,width:h,height:m}=d;if(l||t(),!h||!m)return;const b=ar(p),g=ar(a.clientWidth-(f+h)),w=ar(a.clientHeight-(p+m)),v=ar(f),x={rootMargin:-b+"px "+-g+"px "+-w+"px "+-v+"px",threshold:me(0,Ge(1,u))||1};let N=!0;function E(C){const T=C[0].intersectionRatio;if(T!==u){if(!N)return c();T?c(!1,T):n=setTimeout(()=>{c(!1,1e-7)},1e3)}T===1&&!Ra(d,e.getBoundingClientRect())&&c(),N=!1}try{r=new IntersectionObserver(E,{...x,root:a.ownerDocument})}catch{r=new IntersectionObserver(E,x)}r.observe(e)}return c(!0),s}function Nf(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:a=!0,ancestorResize:s=!0,elementResize:c=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:u=!1}=n,d=bn(e),f=a||s?[...d?Pt(d):[],...Pt(t)]:[];f.forEach(v=>{a&&v.addEventListener("scroll",r,{passive:!0}),s&&v.addEventListener("resize",r)});const p=d&&l?xf(d,r):null;let h=-1,m=null;c&&(m=new ResizeObserver(v=>{let[y]=v;y&&y.target===d&&m&&(m.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var x;(x=m)==null||x.observe(t)})),r()}),d&&!u&&m.observe(d),m.observe(t));let b,g=u?Ze(e):null;u&&w();function w(){const v=Ze(e);g&&!Ra(g,v)&&r(),g=v,b=requestAnimationFrame(w)}return r(),()=>{var v;f.forEach(y=>{a&&y.removeEventListener("scroll",r),s&&y.removeEventListener("resize",r)}),p==null||p(),(v=m)==null||v.disconnect(),m=null,u&&cancelAnimationFrame(b)}}const Cf=ef,Sf=tf,Ef=Zu,Tf=nf,Mf=Ju,es=Qu,Pf=rf,Af=(e,t,r)=>{const n=new Map,a={platform:yf,...r},s={...a.platform,_c:n};return Xu(e,t,{...a,platform:s})};var ur=typeof document<"u"?H.useLayoutEffect:H.useEffect;function fr(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let r,n,a;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;n--!==0;)if(!fr(e[n],t[n]))return!1;return!0}if(a=Object.keys(e),r=a.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(t,a[n]))return!1;for(n=r;n--!==0;){const s=a[n];if(!(s==="_owner"&&e.$$typeof)&&!fr(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function ts(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function rs(e,t){const r=ts(e);return Math.round(t*r)/r}function xn(e){const t=i.useRef(e);return ur(()=>{t.current=e}),t}function _f(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:a,elements:{reference:s,floating:c}={},transform:l=!0,whileElementsMounted:u,open:d}=e,[f,p]=i.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[h,m]=i.useState(n);fr(h,n)||m(n);const[b,g]=i.useState(null),[w,v]=i.useState(null),y=i.useCallback(D=>{D!==C.current&&(C.current=D,g(D))},[]),x=i.useCallback(D=>{D!==T.current&&(T.current=D,v(D))},[]),N=s||b,E=c||w,C=i.useRef(null),T=i.useRef(null),$=i.useRef(f),O=u!=null,B=xn(u),K=xn(a),F=xn(d),L=i.useCallback(()=>{if(!C.current||!T.current)return;const D={placement:t,strategy:r,middleware:h};K.current&&(D.platform=K.current),Af(C.current,T.current,D).then(M=>{const Y={...M,isPositioned:F.current!==!1};P.current&&!fr($.current,Y)&&($.current=Y,_r.flushSync(()=>{p(Y)}))})},[h,t,r,K,F]);ur(()=>{d===!1&&$.current.isPositioned&&($.current.isPositioned=!1,p(D=>({...D,isPositioned:!1})))},[d]);const P=i.useRef(!1);ur(()=>(P.current=!0,()=>{P.current=!1}),[]),ur(()=>{if(N&&(C.current=N),E&&(T.current=E),N&&E){if(B.current)return B.current(N,E,L);L()}},[N,E,L,B,O]);const V=i.useMemo(()=>({reference:C,floating:T,setReference:y,setFloating:x}),[y,x]),A=i.useMemo(()=>({reference:N,floating:E}),[N,E]),X=i.useMemo(()=>{const D={position:r,left:0,top:0};if(!A.floating)return D;const M=rs(A.floating,f.x),Y=rs(A.floating,f.y);return l?{...D,transform:"translate("+M+"px, "+Y+"px)",...ts(A.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:M,top:Y}},[r,l,A.floating,f.x,f.y]);return i.useMemo(()=>({...f,update:L,refs:V,elements:A,floatingStyles:X}),[f,L,V,A,X])}const Df=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:n,padding:a}=typeof e=="function"?e(r):e;return n&&t(n)?n.current!=null?es({element:n.current,padding:a}).fn(r):{}:n?es({element:n,padding:a}).fn(r):{}}}},If=(e,t)=>({...Cf(e),options:[e,t]}),kf=(e,t)=>({...Sf(e),options:[e,t]}),Of=(e,t)=>({...Pf(e),options:[e,t]}),Lf=(e,t)=>({...Ef(e),options:[e,t]}),Ff=(e,t)=>({...Tf(e),options:[e,t]}),$f=(e,t)=>({...Mf(e),options:[e,t]}),zf=(e,t)=>({...Df(e),options:[e,t]});var Bf="Arrow",ns=i.forwardRef((e,t)=>{const{children:r,width:n=10,height:a=5,...s}=e;return o.jsx(Z.svg,{...s,ref:t,width:n,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:o.jsx("polygon",{points:"0,0 30,0 15,10"})})});ns.displayName=Bf;var Wf=ns;function Vf(e){const[t,r]=i.useState(void 0);return We(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(a=>{if(!Array.isArray(a)||!a.length)return;const s=a[0];let c,l;if("borderBoxSize"in s){const u=s.borderBoxSize,d=Array.isArray(u)?u[0]:u;c=d.inlineSize,l=d.blockSize}else c=e.offsetWidth,l=e.offsetHeight;r({width:c,height:l})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}var Nn="Popper",[os,pr]=Be(Nn),[Gf,as]=os(Nn),ss=e=>{const{__scopePopper:t,children:r}=e,[n,a]=i.useState(null);return o.jsx(Gf,{scope:t,anchor:n,onAnchorChange:a,children:r})};ss.displayName=Nn;var is="PopperAnchor",cs=i.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...a}=e,s=as(is,r),c=i.useRef(null),l=oe(t,c);return i.useEffect(()=>{s.onAnchorChange((n==null?void 0:n.current)||c.current)}),n?null:o.jsx(Z.div,{...a,ref:l})});cs.displayName=is;var Cn="PopperContent",[Uf,jf]=os(Cn),ls=i.forwardRef((e,t)=>{var ae,Me,de,Pe,G,J;const{__scopePopper:r,side:n="bottom",sideOffset:a=0,align:s="center",alignOffset:c=0,arrowPadding:l=0,avoidCollisions:u=!0,collisionBoundary:d=[],collisionPadding:f=0,sticky:p="partial",hideWhenDetached:h=!1,updatePositionStrategy:m="optimized",onPlaced:b,...g}=e,w=as(Cn,r),[v,y]=i.useState(null),x=oe(t,he=>y(he)),[N,E]=i.useState(null),C=Vf(N),T=(C==null?void 0:C.width)??0,$=(C==null?void 0:C.height)??0,O=n+(s!=="center"?"-"+s:""),B=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},K=Array.isArray(d)?d:[d],F=K.length>0,L={padding:B,boundary:K.filter(Kf),altBoundary:F},{refs:P,floatingStyles:V,placement:A,isPositioned:X,middlewareData:D}=_f({strategy:"fixed",placement:O,whileElementsMounted:(...he)=>Nf(...he,{animationFrame:m==="always"}),elements:{reference:w.anchor},middleware:[If({mainAxis:a+$,alignmentAxis:c}),u&&kf({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?Of():void 0,...L}),u&&Lf({...L}),Ff({...L,apply:({elements:he,rects:W,availableWidth:j,availableHeight:ue})=>{const{width:ge,height:ve}=W.reference,R=he.floating.style;R.setProperty("--radix-popper-available-width",`${j}px`),R.setProperty("--radix-popper-available-height",`${ue}px`),R.setProperty("--radix-popper-anchor-width",`${ge}px`),R.setProperty("--radix-popper-anchor-height",`${ve}px`)}}),N&&zf({element:N,padding:l}),Yf({arrowWidth:T,arrowHeight:$}),h&&$f({strategy:"referenceHidden",...L})]}),[M,Y]=fs(A),Q=fe(b);We(()=>{X&&(Q==null||Q())},[X,Q]);const ee=(ae=D.arrow)==null?void 0:ae.x,te=(Me=D.arrow)==null?void 0:Me.y,ne=((de=D.arrow)==null?void 0:de.centerOffset)!==0,[se,le]=i.useState();return We(()=>{v&&le(window.getComputedStyle(v).zIndex)},[v]),o.jsx("div",{ref:P.setFloating,"data-radix-popper-content-wrapper":"",style:{...V,transform:X?V.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:se,"--radix-popper-transform-origin":[(Pe=D.transformOrigin)==null?void 0:Pe.x,(G=D.transformOrigin)==null?void 0:G.y].join(" "),...((J=D.hide)==null?void 0:J.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:o.jsx(Uf,{scope:r,placedSide:M,onArrowChange:E,arrowX:ee,arrowY:te,shouldHideArrow:ne,children:o.jsx(Z.div,{"data-side":M,"data-align":Y,...g,ref:x,style:{...g.style,animation:X?void 0:"none"}})})})});ls.displayName=Cn;var ds="PopperArrow",Hf={top:"bottom",right:"left",bottom:"top",left:"right"},us=i.forwardRef(function(t,r){const{__scopePopper:n,...a}=t,s=jf(ds,n),c=Hf[s.placedSide];return o.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[c]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:o.jsx(Wf,{...a,ref:r,style:{...a.style,display:"block"}})})});us.displayName=ds;function Kf(e){return e!==null}var Yf=e=>({name:"transformOrigin",options:e,fn(t){var w,v,y;const{placement:r,rects:n,middlewareData:a}=t,c=((w=a.arrow)==null?void 0:w.centerOffset)!==0,l=c?0:e.arrowWidth,u=c?0:e.arrowHeight,[d,f]=fs(r),p={start:"0%",center:"50%",end:"100%"}[f],h=(((v=a.arrow)==null?void 0:v.x)??0)+l/2,m=(((y=a.arrow)==null?void 0:y.y)??0)+u/2;let b="",g="";return d==="bottom"?(b=c?p:`${h}px`,g=`${-u}px`):d==="top"?(b=c?p:`${h}px`,g=`${n.floating.height+u}px`):d==="right"?(b=`${-u}px`,g=c?p:`${m}px`):d==="left"&&(b=`${n.floating.width+u}px`,g=c?p:`${m}px`),{data:{x:b,y:g}}}});function fs(e){const[t,r="center"]=e.split("-");return[t,r]}var Sn=ss,ps=cs,hs=ls,gs=us,En="rovingFocusGroup.onEntryFocus",qf={bubbles:!1,cancelable:!0},hr="RovingFocusGroup",[Tn,vs,Xf]=ln(hr),[Qf,ms]=Be(hr,[Xf]),[Zf,Jf]=Qf(hr),bs=i.forwardRef((e,t)=>o.jsx(Tn.Provider,{scope:e.__scopeRovingFocusGroup,children:o.jsx(Tn.Slot,{scope:e.__scopeRovingFocusGroup,children:o.jsx(Rf,{...e,ref:t})})}));bs.displayName=hr;var Rf=i.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,orientation:n,loop:a=!1,dir:s,currentTabStopId:c,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:u,onEntryFocus:d,preventScrollOnEntryFocus:f=!1,...p}=e,h=i.useRef(null),m=oe(t,h),b=za(s),[g=null,w]=st({prop:c,defaultProp:l,onChange:u}),[v,y]=i.useState(!1),x=fe(d),N=vs(r),E=i.useRef(!1),[C,T]=i.useState(0);return i.useEffect(()=>{const $=h.current;if($)return $.addEventListener(En,x),()=>$.removeEventListener(En,x)},[x]),o.jsx(Zf,{scope:r,orientation:n,dir:b,loop:a,currentTabStopId:g,onItemFocus:i.useCallback($=>w($),[w]),onItemShiftTab:i.useCallback(()=>y(!0),[]),onFocusableItemAdd:i.useCallback(()=>T($=>$+1),[]),onFocusableItemRemove:i.useCallback(()=>T($=>$-1),[]),children:o.jsx(Z.div,{tabIndex:v||C===0?-1:0,"data-orientation":n,...p,ref:m,style:{outline:"none",...e.style},onMouseDown:z(e.onMouseDown,()=>{E.current=!0}),onFocus:z(e.onFocus,$=>{const O=!E.current;if($.target===$.currentTarget&&O&&!v){const B=new CustomEvent(En,qf);if($.currentTarget.dispatchEvent(B),!B.defaultPrevented){const K=N().filter(A=>A.focusable),F=K.find(A=>A.active),L=K.find(A=>A.id===g),V=[F,L,...K].filter(Boolean).map(A=>A.ref.current);xs(V,f)}}E.current=!1}),onBlur:z(e.onBlur,()=>y(!1))})})}),ws="RovingFocusGroupItem",ys=i.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:a=!1,tabStopId:s,...c}=e,l=Oe(),u=s||l,d=Jf(ws,r),f=d.currentTabStopId===u,p=vs(r),{onFocusableItemAdd:h,onFocusableItemRemove:m}=d;return i.useEffect(()=>{if(n)return h(),()=>m()},[n,h,m]),o.jsx(Tn.ItemSlot,{scope:r,id:u,focusable:n,active:a,children:o.jsx(Z.span,{tabIndex:f?0:-1,"data-orientation":d.orientation,...c,ref:t,onMouseDown:z(e.onMouseDown,b=>{n?d.onItemFocus(u):b.preventDefault()}),onFocus:z(e.onFocus,()=>d.onItemFocus(u)),onKeyDown:z(e.onKeyDown,b=>{if(b.key==="Tab"&&b.shiftKey){d.onItemShiftTab();return}if(b.target!==b.currentTarget)return;const g=rp(b,d.orientation,d.dir);if(g!==void 0){if(b.metaKey||b.ctrlKey||b.altKey||b.shiftKey)return;b.preventDefault();let v=p().filter(y=>y.focusable).map(y=>y.ref.current);if(g==="last")v.reverse();else if(g==="prev"||g==="next"){g==="prev"&&v.reverse();const y=v.indexOf(b.currentTarget);v=d.loop?np(v,y+1):v.slice(y+1)}setTimeout(()=>xs(v))}})})})});ys.displayName=ws;var ep={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function tp(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function rp(e,t,r){const n=tp(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return ep[n]}function xs(e,t=!1){const r=document.activeElement;for(const n of e)if(n===r||(n.focus({preventScroll:t}),document.activeElement!==r))return}function np(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var op=bs,ap=ys,Mn=["Enter"," "],sp=["ArrowDown","PageUp","Home"],Ns=["ArrowUp","PageDown","End"],ip=[...sp,...Ns],cp={ltr:[...Mn,"ArrowRight"],rtl:[...Mn,"ArrowLeft"]},lp={ltr:["ArrowLeft"],rtl:["ArrowRight"]},At="Menu",[_t,dp,up]=ln(At),[Je,Cs]=Be(At,[up,pr,ms]),Dt=pr(),Ss=ms(),[Es,He]=Je(At),[fp,It]=Je(At),Ts=e=>{const{__scopeMenu:t,open:r=!1,children:n,dir:a,onOpenChange:s,modal:c=!0}=e,l=Dt(t),[u,d]=i.useState(null),f=i.useRef(!1),p=fe(s),h=za(a);return i.useEffect(()=>{const m=()=>{f.current=!0,document.addEventListener("pointerdown",b,{capture:!0,once:!0}),document.addEventListener("pointermove",b,{capture:!0,once:!0})},b=()=>f.current=!1;return document.addEventListener("keydown",m,{capture:!0}),()=>{document.removeEventListener("keydown",m,{capture:!0}),document.removeEventListener("pointerdown",b,{capture:!0}),document.removeEventListener("pointermove",b,{capture:!0})}},[]),o.jsx(Sn,{...l,children:o.jsx(Es,{scope:t,open:r,onOpenChange:p,content:u,onContentChange:d,children:o.jsx(fp,{scope:t,onClose:i.useCallback(()=>p(!1),[p]),isUsingKeyboardRef:f,dir:h,modal:c,children:n})})})};Ts.displayName=At;var pp="MenuAnchor",Pn=i.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e,a=Dt(r);return o.jsx(ps,{...a,...n,ref:t})});Pn.displayName=pp;var An="MenuPortal",[hp,Ms]=Je(An,{forceMount:void 0}),Ps=e=>{const{__scopeMenu:t,forceMount:r,children:n,container:a}=e,s=He(An,t);return o.jsx(hp,{scope:t,forceMount:r,children:o.jsx(Ne,{present:r||s.open,children:o.jsx(Ct,{asChild:!0,container:a,children:n})})})};Ps.displayName=An;var xe="MenuContent",[gp,_n]=Je(xe),As=i.forwardRef((e,t)=>{const r=Ms(xe,e.__scopeMenu),{forceMount:n=r.forceMount,...a}=e,s=He(xe,e.__scopeMenu),c=It(xe,e.__scopeMenu);return o.jsx(_t.Provider,{scope:e.__scopeMenu,children:o.jsx(Ne,{present:n||s.open,children:o.jsx(_t.Slot,{scope:e.__scopeMenu,children:c.modal?o.jsx(vp,{...a,ref:t}):o.jsx(mp,{...a,ref:t})})})})}),vp=i.forwardRef((e,t)=>{const r=He(xe,e.__scopeMenu),n=i.useRef(null),a=oe(t,n);return i.useEffect(()=>{const s=n.current;if(s)return ba(s)},[]),o.jsx(Dn,{...e,ref:a,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:z(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})}),mp=i.forwardRef((e,t)=>{const r=He(xe,e.__scopeMenu);return o.jsx(Dn,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})}),Dn=i.forwardRef((e,t)=>{const{__scopeMenu:r,loop:n=!1,trapFocus:a,onOpenAutoFocus:s,onCloseAutoFocus:c,disableOutsidePointerEvents:l,onEntryFocus:u,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:p,onInteractOutside:h,onDismiss:m,disableOutsideScroll:b,...g}=e,w=He(xe,r),v=It(xe,r),y=Dt(r),x=Ss(r),N=dp(r),[E,C]=i.useState(null),T=i.useRef(null),$=oe(t,T,w.onContentChange),O=i.useRef(0),B=i.useRef(""),K=i.useRef(0),F=i.useRef(null),L=i.useRef("right"),P=i.useRef(0),V=b?Qr:i.Fragment,A=b?{as:ye,allowPinchZoom:!0}:void 0,X=M=>{var ae,Me;const Y=B.current+M,Q=N().filter(de=>!de.disabled),ee=document.activeElement,te=(ae=Q.find(de=>de.ref.current===ee))==null?void 0:ae.textValue,ne=Q.map(de=>de.textValue),se=Ap(ne,Y,te),le=(Me=Q.find(de=>de.textValue===se))==null?void 0:Me.ref.current;(function de(Pe){B.current=Pe,window.clearTimeout(O.current),Pe!==""&&(O.current=window.setTimeout(()=>de(""),1e3))})(Y),le&&setTimeout(()=>le.focus())};i.useEffect(()=>()=>window.clearTimeout(O.current),[]),na();const D=i.useCallback(M=>{var Q,ee;return L.current===((Q=F.current)==null?void 0:Q.side)&&Dp(M,(ee=F.current)==null?void 0:ee.area)},[]);return o.jsx(gp,{scope:r,searchRef:B,onItemEnter:i.useCallback(M=>{D(M)&&M.preventDefault()},[D]),onItemLeave:i.useCallback(M=>{var Y;D(M)||((Y=T.current)==null||Y.focus(),C(null))},[D]),onTriggerLeave:i.useCallback(M=>{D(M)&&M.preventDefault()},[D]),pointerGraceTimerRef:K,onPointerGraceIntentChange:i.useCallback(M=>{F.current=M},[]),children:o.jsx(V,{...A,children:o.jsx(jr,{asChild:!0,trapped:a,onMountAutoFocus:z(s,M=>{var Y;M.preventDefault(),(Y=T.current)==null||Y.focus({preventScroll:!0})}),onUnmountAutoFocus:c,children:o.jsx(Nt,{asChild:!0,disableOutsidePointerEvents:l,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:p,onInteractOutside:h,onDismiss:m,children:o.jsx(op,{asChild:!0,...x,dir:v.dir,orientation:"vertical",loop:n,currentTabStopId:E,onCurrentTabStopIdChange:C,onEntryFocus:z(u,M=>{v.isUsingKeyboardRef.current||M.preventDefault()}),preventScrollOnEntryFocus:!0,children:o.jsx(hs,{role:"menu","aria-orientation":"vertical","data-state":Ys(w.open),"data-radix-menu-content":"",dir:v.dir,...y,...g,ref:$,style:{outline:"none",...g.style},onKeyDown:z(g.onKeyDown,M=>{const Q=M.target.closest("[data-radix-menu-content]")===M.currentTarget,ee=M.ctrlKey||M.altKey||M.metaKey,te=M.key.length===1;Q&&(M.key==="Tab"&&M.preventDefault(),!ee&&te&&X(M.key));const ne=T.current;if(M.target!==ne||!ip.includes(M.key))return;M.preventDefault();const le=N().filter(ae=>!ae.disabled).map(ae=>ae.ref.current);Ns.includes(M.key)&&le.reverse(),Mp(le)}),onBlur:z(e.onBlur,M=>{M.currentTarget.contains(M.target)||(window.clearTimeout(O.current),B.current="")}),onPointerMove:z(e.onPointerMove,Ot(M=>{const Y=M.target,Q=P.current!==M.clientX;if(M.currentTarget.contains(Y)&&Q){const ee=M.clientX>P.current?"right":"left";L.current=ee,P.current=M.clientX}}))})})})})})})});As.displayName=xe;var bp="MenuGroup",In=i.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return o.jsx(Z.div,{role:"group",...n,ref:t})});In.displayName=bp;var wp="MenuLabel",_s=i.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return o.jsx(Z.div,{...n,ref:t})});_s.displayName=wp;var gr="MenuItem",Ds="menu.itemSelect",vr=i.forwardRef((e,t)=>{const{disabled:r=!1,onSelect:n,...a}=e,s=i.useRef(null),c=It(gr,e.__scopeMenu),l=_n(gr,e.__scopeMenu),u=oe(t,s),d=i.useRef(!1),f=()=>{const p=s.current;if(!r&&p){const h=new CustomEvent(Ds,{bubbles:!0,cancelable:!0});p.addEventListener(Ds,m=>n==null?void 0:n(m),{once:!0}),Wr(p,h),h.defaultPrevented?d.current=!1:c.onClose()}};return o.jsx(Is,{...a,ref:u,disabled:r,onClick:z(e.onClick,f),onPointerDown:p=>{var h;(h=e.onPointerDown)==null||h.call(e,p),d.current=!0},onPointerUp:z(e.onPointerUp,p=>{var h;d.current||(h=p.currentTarget)==null||h.click()}),onKeyDown:z(e.onKeyDown,p=>{const h=l.searchRef.current!=="";r||h&&p.key===" "||Mn.includes(p.key)&&(p.currentTarget.click(),p.preventDefault())})})});vr.displayName=gr;var Is=i.forwardRef((e,t)=>{const{__scopeMenu:r,disabled:n=!1,textValue:a,...s}=e,c=_n(gr,r),l=Ss(r),u=i.useRef(null),d=oe(t,u),[f,p]=i.useState(!1),[h,m]=i.useState("");return i.useEffect(()=>{const b=u.current;b&&m((b.textContent??"").trim())},[s.children]),o.jsx(_t.ItemSlot,{scope:r,disabled:n,textValue:a??h,children:o.jsx(ap,{asChild:!0,...l,focusable:!n,children:o.jsx(Z.div,{role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":n||void 0,"data-disabled":n?"":void 0,...s,ref:d,onPointerMove:z(e.onPointerMove,Ot(b=>{n?c.onItemLeave(b):(c.onItemEnter(b),b.defaultPrevented||b.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:z(e.onPointerLeave,Ot(b=>c.onItemLeave(b))),onFocus:z(e.onFocus,()=>p(!0)),onBlur:z(e.onBlur,()=>p(!1))})})})}),yp="MenuCheckboxItem",ks=i.forwardRef((e,t)=>{const{checked:r=!1,onCheckedChange:n,...a}=e;return o.jsx(zs,{scope:e.__scopeMenu,checked:r,children:o.jsx(vr,{role:"menuitemcheckbox","aria-checked":mr(r)?"mixed":r,...a,ref:t,"data-state":Ln(r),onSelect:z(a.onSelect,()=>n==null?void 0:n(mr(r)?!0:!r),{checkForDefaultPrevented:!1})})})});ks.displayName=yp;var Os="MenuRadioGroup",[xp,Np]=Je(Os,{value:void 0,onValueChange:()=>{}}),Ls=i.forwardRef((e,t)=>{const{value:r,onValueChange:n,...a}=e,s=fe(n);return o.jsx(xp,{scope:e.__scopeMenu,value:r,onValueChange:s,children:o.jsx(In,{...a,ref:t})})});Ls.displayName=Os;var Fs="MenuRadioItem",$s=i.forwardRef((e,t)=>{const{value:r,...n}=e,a=Np(Fs,e.__scopeMenu),s=r===a.value;return o.jsx(zs,{scope:e.__scopeMenu,checked:s,children:o.jsx(vr,{role:"menuitemradio","aria-checked":s,...n,ref:t,"data-state":Ln(s),onSelect:z(n.onSelect,()=>{var c;return(c=a.onValueChange)==null?void 0:c.call(a,r)},{checkForDefaultPrevented:!1})})})});$s.displayName=Fs;var kn="MenuItemIndicator",[zs,Cp]=Je(kn,{checked:!1}),Bs=i.forwardRef((e,t)=>{const{__scopeMenu:r,forceMount:n,...a}=e,s=Cp(kn,r);return o.jsx(Ne,{present:n||mr(s.checked)||s.checked===!0,children:o.jsx(Z.span,{...a,ref:t,"data-state":Ln(s.checked)})})});Bs.displayName=kn;var Sp="MenuSeparator",Ws=i.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return o.jsx(Z.div,{role:"separator","aria-orientation":"horizontal",...n,ref:t})});Ws.displayName=Sp;var Ep="MenuArrow",Vs=i.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e,a=Dt(r);return o.jsx(gs,{...a,...n,ref:t})});Vs.displayName=Ep;var On="MenuSub",[Tp,Gs]=Je(On),Us=e=>{const{__scopeMenu:t,children:r,open:n=!1,onOpenChange:a}=e,s=He(On,t),c=Dt(t),[l,u]=i.useState(null),[d,f]=i.useState(null),p=fe(a);return i.useEffect(()=>(s.open===!1&&p(!1),()=>p(!1)),[s.open,p]),o.jsx(Sn,{...c,children:o.jsx(Es,{scope:t,open:n,onOpenChange:p,content:d,onContentChange:f,children:o.jsx(Tp,{scope:t,contentId:Oe(),triggerId:Oe(),trigger:l,onTriggerChange:u,children:r})})})};Us.displayName=On;var kt="MenuSubTrigger",js=i.forwardRef((e,t)=>{const r=He(kt,e.__scopeMenu),n=It(kt,e.__scopeMenu),a=Gs(kt,e.__scopeMenu),s=_n(kt,e.__scopeMenu),c=i.useRef(null),{pointerGraceTimerRef:l,onPointerGraceIntentChange:u}=s,d={__scopeMenu:e.__scopeMenu},f=i.useCallback(()=>{c.current&&window.clearTimeout(c.current),c.current=null},[]);return i.useEffect(()=>f,[f]),i.useEffect(()=>{const p=l.current;return()=>{window.clearTimeout(p),u(null)}},[l,u]),o.jsx(Pn,{asChild:!0,...d,children:o.jsx(Is,{id:a.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":a.contentId,"data-state":Ys(r.open),...e,ref:Vt(t,a.onTriggerChange),onClick:p=>{var h;(h=e.onClick)==null||h.call(e,p),!(e.disabled||p.defaultPrevented)&&(p.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:z(e.onPointerMove,Ot(p=>{s.onItemEnter(p),!p.defaultPrevented&&!e.disabled&&!r.open&&!c.current&&(s.onPointerGraceIntentChange(null),c.current=window.setTimeout(()=>{r.onOpenChange(!0),f()},100))})),onPointerLeave:z(e.onPointerLeave,Ot(p=>{var m,b;f();const h=(m=r.content)==null?void 0:m.getBoundingClientRect();if(h){const g=(b=r.content)==null?void 0:b.dataset.side,w=g==="right",v=w?-5:5,y=h[w?"left":"right"],x=h[w?"right":"left"];s.onPointerGraceIntentChange({area:[{x:p.clientX+v,y:p.clientY},{x:y,y:h.top},{x,y:h.top},{x,y:h.bottom},{x:y,y:h.bottom}],side:g}),window.clearTimeout(l.current),l.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(p),p.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:z(e.onKeyDown,p=>{var m;const h=s.searchRef.current!=="";e.disabled||h&&p.key===" "||cp[n.dir].includes(p.key)&&(r.onOpenChange(!0),(m=r.content)==null||m.focus(),p.preventDefault())})})})});js.displayName=kt;var Hs="MenuSubContent",Ks=i.forwardRef((e,t)=>{const r=Ms(xe,e.__scopeMenu),{forceMount:n=r.forceMount,...a}=e,s=He(xe,e.__scopeMenu),c=It(xe,e.__scopeMenu),l=Gs(Hs,e.__scopeMenu),u=i.useRef(null),d=oe(t,u);return o.jsx(_t.Provider,{scope:e.__scopeMenu,children:o.jsx(Ne,{present:n||s.open,children:o.jsx(_t.Slot,{scope:e.__scopeMenu,children:o.jsx(Dn,{id:l.contentId,"aria-labelledby":l.triggerId,...a,ref:d,align:"start",side:c.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:f=>{var p;c.isUsingKeyboardRef.current&&((p=u.current)==null||p.focus()),f.preventDefault()},onCloseAutoFocus:f=>f.preventDefault(),onFocusOutside:z(e.onFocusOutside,f=>{f.target!==l.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:z(e.onEscapeKeyDown,f=>{c.onClose(),f.preventDefault()}),onKeyDown:z(e.onKeyDown,f=>{var m;const p=f.currentTarget.contains(f.target),h=lp[c.dir].includes(f.key);p&&h&&(s.onOpenChange(!1),(m=l.trigger)==null||m.focus(),f.preventDefault())})})})})})});Ks.displayName=Hs;function Ys(e){return e?"open":"closed"}function mr(e){return e==="indeterminate"}function Ln(e){return mr(e)?"indeterminate":e?"checked":"unchecked"}function Mp(e){const t=document.activeElement;for(const r of e)if(r===t||(r.focus(),document.activeElement!==t))return}function Pp(e,t){return e.map((r,n)=>e[(t+n)%e.length])}function Ap(e,t,r){const a=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,s=r?e.indexOf(r):-1;let c=Pp(e,Math.max(s,0));a.length===1&&(c=c.filter(d=>d!==r));const u=c.find(d=>d.toLowerCase().startsWith(a.toLowerCase()));return u!==r?u:void 0}function _p(e,t){const{x:r,y:n}=e;let a=!1;for(let s=0,c=t.length-1;s<t.length;c=s++){const l=t[s].x,u=t[s].y,d=t[c].x,f=t[c].y;u>n!=f>n&&r<(d-l)*(n-u)/(f-u)+l&&(a=!a)}return a}function Dp(e,t){if(!t)return!1;const r={x:e.clientX,y:e.clientY};return _p(r,t)}function Ot(e){return t=>t.pointerType==="mouse"?e(t):void 0}var Ip=Ts,kp=Pn,Op=Ps,Lp=As,Fp=In,$p=_s,zp=vr,Bp=ks,Wp=Ls,Vp=$s,Gp=Bs,Up=Ws,jp=Vs,Hp=Us,Kp=js,Yp=Ks,Fn="DropdownMenu",[qp,sv]=Be(Fn,[Cs]),pe=Cs(),[Xp,qs]=qp(Fn),Xs=e=>{const{__scopeDropdownMenu:t,children:r,dir:n,open:a,defaultOpen:s,onOpenChange:c,modal:l=!0}=e,u=pe(t),d=i.useRef(null),[f=!1,p]=st({prop:a,defaultProp:s,onChange:c});return o.jsx(Xp,{scope:t,triggerId:Oe(),triggerRef:d,contentId:Oe(),open:f,onOpenChange:p,onOpenToggle:i.useCallback(()=>p(h=>!h),[p]),modal:l,children:o.jsx(Ip,{...u,open:f,onOpenChange:p,dir:n,modal:l,children:r})})};Xs.displayName=Fn;var Qs="DropdownMenuTrigger",Zs=i.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,disabled:n=!1,...a}=e,s=qs(Qs,r),c=pe(r);return o.jsx(kp,{asChild:!0,...c,children:o.jsx(Z.button,{type:"button",id:s.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":s.open?"open":"closed","data-disabled":n?"":void 0,disabled:n,...a,ref:Vt(t,s.triggerRef),onPointerDown:z(e.onPointerDown,l=>{!n&&l.button===0&&l.ctrlKey===!1&&(s.onOpenToggle(),s.open||l.preventDefault())}),onKeyDown:z(e.onKeyDown,l=>{n||(["Enter"," "].includes(l.key)&&s.onOpenToggle(),l.key==="ArrowDown"&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(l.key)&&l.preventDefault())})})})});Zs.displayName=Qs;var Qp="DropdownMenuPortal",Js=e=>{const{__scopeDropdownMenu:t,...r}=e,n=pe(t);return o.jsx(Op,{...n,...r})};Js.displayName=Qp;var Rs="DropdownMenuContent",ei=i.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,a=qs(Rs,r),s=pe(r),c=i.useRef(!1);return o.jsx(Lp,{id:a.contentId,"aria-labelledby":a.triggerId,...s,...n,ref:t,onCloseAutoFocus:z(e.onCloseAutoFocus,l=>{var u;c.current||(u=a.triggerRef.current)==null||u.focus(),c.current=!1,l.preventDefault()}),onInteractOutside:z(e.onInteractOutside,l=>{const u=l.detail.originalEvent,d=u.button===0&&u.ctrlKey===!0,f=u.button===2||d;(!a.modal||f)&&(c.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});ei.displayName=Rs;var Zp="DropdownMenuGroup",ti=i.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,a=pe(r);return o.jsx(Fp,{...a,...n,ref:t})});ti.displayName=Zp;var Jp="DropdownMenuLabel",ri=i.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,a=pe(r);return o.jsx($p,{...a,...n,ref:t})});ri.displayName=Jp;var Rp="DropdownMenuItem",ni=i.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,a=pe(r);return o.jsx(zp,{...a,...n,ref:t})});ni.displayName=Rp;var eh="DropdownMenuCheckboxItem",oi=i.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,a=pe(r);return o.jsx(Bp,{...a,...n,ref:t})});oi.displayName=eh;var th="DropdownMenuRadioGroup",ai=i.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,a=pe(r);return o.jsx(Wp,{...a,...n,ref:t})});ai.displayName=th;var rh="DropdownMenuRadioItem",si=i.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,a=pe(r);return o.jsx(Vp,{...a,...n,ref:t})});si.displayName=rh;var nh="DropdownMenuItemIndicator",ii=i.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,a=pe(r);return o.jsx(Gp,{...a,...n,ref:t})});ii.displayName=nh;var oh="DropdownMenuSeparator",ci=i.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,a=pe(r);return o.jsx(Up,{...a,...n,ref:t})});ci.displayName=oh;var ah="DropdownMenuArrow",sh=i.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,a=pe(r);return o.jsx(jp,{...a,...n,ref:t})});sh.displayName=ah;var ih=e=>{const{__scopeDropdownMenu:t,children:r,open:n,onOpenChange:a,defaultOpen:s}=e,c=pe(t),[l=!1,u]=st({prop:n,defaultProp:s,onChange:a});return o.jsx(Hp,{...c,open:l,onOpenChange:u,children:r})},ch="DropdownMenuSubTrigger",li=i.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,a=pe(r);return o.jsx(Kp,{...a,...n,ref:t})});li.displayName=ch;var lh="DropdownMenuSubContent",di=i.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,a=pe(r);return o.jsx(Yp,{...a,...n,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});di.displayName=lh;var dh=Xs,uh=Zs,ui=Js,fi=ei,fh=ti,pi=ri,hi=ni,gi=oi,ph=ai,vi=si,mi=ii,bi=ci,hh=ih,wi=li,yi=di;const gh=dh,vh=uh,mh=fh,bh=ui,wh=hh,yh=ph,xi=i.forwardRef(({className:e,inset:t,children:r,...n},a)=>o.jsxs(wi,{ref:a,className:_("flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",t&&"pl-8",e),...n,children:[r,o.jsx(fl,{className:"ml-auto"})]}));xi.displayName=wi.displayName;const Ni=i.forwardRef(({className:e,...t},r)=>o.jsx(yi,{ref:r,className:_("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]",e),...t}));Ni.displayName=yi.displayName;const Ci=i.forwardRef(({className:e,sideOffset:t=4,...r},n)=>o.jsx(ui,{children:o.jsx(fi,{ref:n,sideOffset:t,className:_("z-50 max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]",e),...r})}));Ci.displayName=fi.displayName;const Si=i.forwardRef(({className:e,inset:t,...r},n)=>o.jsx(hi,{ref:n,className:_("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0",t&&"pl-8",e),...r}));Si.displayName=hi.displayName;const Ei=i.forwardRef(({className:e,children:t,checked:r,...n},a)=>o.jsxs(gi,{ref:a,className:_("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:r,...n,children:[o.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:o.jsx(mi,{children:o.jsx(Dr,{className:"h-4 w-4"})})}),t]}));Ei.displayName=gi.displayName;const Ti=i.forwardRef(({className:e,children:t,...r},n)=>o.jsxs(vi,{ref:n,className:_("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[o.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:o.jsx(mi,{children:o.jsx(hl,{className:"h-2 w-2 fill-current"})})}),t]}));Ti.displayName=vi.displayName;const Mi=i.forwardRef(({className:e,inset:t,...r},n)=>o.jsx(pi,{ref:n,className:_("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...r}));Mi.displayName=pi.displayName;const Pi=i.forwardRef(({className:e,...t},r)=>o.jsx(bi,{ref:r,className:_("-mx-1 my-1 h-px bg-muted",e),...t}));Pi.displayName=bi.displayName;const Ai=({className:e,...t})=>o.jsx("span",{className:_("ml-auto text-xs tracking-widest opacity-60",e),...t});Ai.displayName="DropdownMenuShortcut";function _i({inventory:e,showBinLocation:t}){const r=(v,y,x=!1,N=!0)=>o.jsxs("div",{className:`p-3 text-sm ${N&&y>0?"border-t":""} ${x?"border-r":""}`,children:[o.jsxs("div",{className:"flex justify-between font-medium",children:[o.jsx("span",{children:v.Name}),o.jsx("span",{children:v.AvailableQuantity})]}),o.jsxs("div",{className:"flex justify-between mt-1 text-xs text-gray-600",children:[o.jsx("span",{children:"Expecting"}),o.jsx("span",{children:v.PurchaseOrderQuantity||"-"})]}),t&&o.jsxs("div",{className:"flex justify-between mt-1 text-xs text-gray-600",children:[o.jsx("span",{children:"Bin Location"}),o.jsx("span",{children:v.BinLocation||"-"})]})]},`warehouse-${v.WarehouseId}`),n=["MTL","TOR"],a=["VAN","EDM"],s=[...e].sort((v,y)=>(v.Name||"").localeCompare(y.Name||"")),c=s.filter(v=>v.Country==="US"),l=s.filter(v=>v.Country==="CA"),u=s.filter(v=>a.includes(v.WarehouseId||"")),d=s.filter(v=>n.includes(v.WarehouseId||"")),f=l.filter(v=>!n.includes(v.WarehouseId||"")&&!a.includes(v.WarehouseId||"")),p=v=>v.reduce((y,x)=>y+(x.AvailableQuantity||0),0),h=p(l),m=p(d),b=p(u),g=p(c),w=h+g;return o.jsxs("div",{className:"border rounded-md overflow-hidden",children:[l.length>0&&c.length>0&&o.jsxs("div",{className:"grid grid-cols-2 border-b",children:[o.jsxs("div",{className:"p-3 font-semibold text-sm flex justify-between",children:[o.jsx("span",{children:"Total"}),o.jsx("span",{children:w})]}),o.jsx("div",{className:"p-3"})]}),l.length>0&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"grid grid-cols-2 border-b bg-gray-50",children:[o.jsxs("div",{className:"p-3 font-semibold text-sm flex justify-between",children:[o.jsx("span",{children:"Canada"}),o.jsx("span",{children:h})]}),o.jsx("div",{className:"p-3"})]}),o.jsxs("div",{className:"grid grid-cols-2",children:[o.jsxs("div",{className:"border-r",children:[o.jsxs("div",{className:"p-3 font-semibold text-sm flex justify-between",children:[o.jsx("span",{children:"West"}),o.jsx("span",{children:b})]}),u.map((v,y)=>r(v,y))]}),o.jsxs("div",{children:[o.jsxs("div",{className:"p-3 font-semibold text-sm flex justify-between",children:[o.jsx("span",{children:"East"}),o.jsx("span",{children:m})]}),d.map((v,y)=>r(v,y))]})]}),f.length>0&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"border-t p-3 font-semibold text-sm",children:o.jsx("span",{children:"Other"})}),o.jsx("div",{className:"grid grid-cols-2",children:f.map((v,y)=>r(v,y,y%2===0,!0))})]})]}),c.length>0&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"grid grid-cols-2 border-t bg-gray-50",children:[o.jsxs("div",{className:"p-3 font-semibold text-sm flex justify-between",children:[o.jsx("span",{children:"United States"}),o.jsx("span",{children:g})]}),o.jsx("div",{className:"p-3"})]}),o.jsx("div",{className:"grid grid-cols-2",children:c.map((v,y)=>r(v,y,y%2===0,!0))})]}),e.length===0&&o.jsx("div",{className:"p-6 text-center text-gray-500",children:"No inventory information available"})]})}const Di=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Ii=ko,Lt=(e,t)=>r=>{var n;if((t==null?void 0:t.variants)==null)return Ii(e,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:a,defaultVariants:s}=t,c=Object.keys(a).map(d=>{const f=r==null?void 0:r[d],p=s==null?void 0:s[d];if(f===null)return null;const h=Di(f)||Di(p);return a[d][h]}),l=r&&Object.entries(r).reduce((d,f)=>{let[p,h]=f;return h===void 0||(d[p]=h),d},{}),u=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((d,f)=>{let{class:p,className:h,...m}=f;return Object.entries(m).every(b=>{let[g,w]=b;return Array.isArray(w)?w.includes({...s,...l}[g]):{...s,...l}[g]===w})?[...d,p,h]:d},[]);return Ii(e,c,u,r==null?void 0:r.class,r==null?void 0:r.className)},$n=Lt("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 cursor-pointer",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-sm hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-xs hover:bg-destructive/90",outline:"border border-input bg-background shadow-xs hover:bg-accent hover:text-accent-foreground",defaultOutline:"border border-red-600/30 text-red-600 bg-background shadow-xs hover:bg-red-600/5 ",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline",blue:"bg-randmar-blue text-gray-100 shadow-sm hover:bg-randmar-blue/90",red:"bg-randmar-red text-gray-100 shadow-sm hover:bg-randmar-red/90",none:""},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),ce=i.forwardRef(({className:e,variant:t,size:r,asChild:n=!1,confirmationDialog:a,onClick:s,...c},l)=>{const u=n?ye:"button";if(!a)return o.jsx(u,{className:_($n({variant:t,size:r,className:e})),ref:l,onClick:s,...c});s&&console.warn("Button: You provided both onClick and confirmationDialog props. The onClick prop will be ignored. Use the onConfirm callback in confirmationDialog instead.");const{title:d,content:f,onConfirm:p,confirmText:h="Confirm",cancelText:m="Cancel"}=a,b=()=>{p()};return o.jsxs(St,{children:[o.jsx(nn,{asChild:!0,children:o.jsx(u,{className:_($n({variant:t,size:r,className:e})),ref:l,...c})}),o.jsxs(Et,{children:[o.jsxs(rr,{children:[o.jsx(nr,{children:d}),o.jsx(cn,{children:f})]}),o.jsxs(sn,{className:"flex justify-end gap-2 pt-4",children:[o.jsx(on,{asChild:!0,children:o.jsx(ce,{variant:"outline",children:m})}),o.jsx(on,{asChild:!0,children:o.jsx(ce,{onClick:b,children:h})})]})]})]})});ce.displayName="Button";var xh="VisuallyHidden",br=i.forwardRef((e,t)=>o.jsx(Z.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));br.displayName=xh;var Nh=br,[wr,iv]=Be("Tooltip",[pr]),yr=pr(),ki="TooltipProvider",Ch=700,zn="tooltip.open",[Sh,Bn]=wr(ki),Oi=e=>{const{__scopeTooltip:t,delayDuration:r=Ch,skipDelayDuration:n=300,disableHoverableContent:a=!1,children:s}=e,[c,l]=i.useState(!0),u=i.useRef(!1),d=i.useRef(0);return i.useEffect(()=>{const f=d.current;return()=>window.clearTimeout(f)},[]),o.jsx(Sh,{scope:t,isOpenDelayed:c,delayDuration:r,onOpen:i.useCallback(()=>{window.clearTimeout(d.current),l(!1)},[]),onClose:i.useCallback(()=>{window.clearTimeout(d.current),d.current=window.setTimeout(()=>l(!0),n)},[n]),isPointerInTransitRef:u,onPointerInTransitChange:i.useCallback(f=>{u.current=f},[]),disableHoverableContent:a,children:s})};Oi.displayName=ki;var xr="Tooltip",[Eh,Ft]=wr(xr),Li=e=>{const{__scopeTooltip:t,children:r,open:n,defaultOpen:a=!1,onOpenChange:s,disableHoverableContent:c,delayDuration:l}=e,u=Bn(xr,e.__scopeTooltip),d=yr(t),[f,p]=i.useState(null),h=Oe(),m=i.useRef(0),b=c??u.disableHoverableContent,g=l??u.delayDuration,w=i.useRef(!1),[v=!1,y]=st({prop:n,defaultProp:a,onChange:T=>{T?(u.onOpen(),document.dispatchEvent(new CustomEvent(zn))):u.onClose(),s==null||s(T)}}),x=i.useMemo(()=>v?w.current?"delayed-open":"instant-open":"closed",[v]),N=i.useCallback(()=>{window.clearTimeout(m.current),m.current=0,w.current=!1,y(!0)},[y]),E=i.useCallback(()=>{window.clearTimeout(m.current),m.current=0,y(!1)},[y]),C=i.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>{w.current=!0,y(!0),m.current=0},g)},[g,y]);return i.useEffect(()=>()=>{m.current&&(window.clearTimeout(m.current),m.current=0)},[]),o.jsx(Sn,{...d,children:o.jsx(Eh,{scope:t,contentId:h,open:v,stateAttribute:x,trigger:f,onTriggerChange:p,onTriggerEnter:i.useCallback(()=>{u.isOpenDelayed?C():N()},[u.isOpenDelayed,C,N]),onTriggerLeave:i.useCallback(()=>{b?E():(window.clearTimeout(m.current),m.current=0)},[E,b]),onOpen:N,onClose:E,disableHoverableContent:b,children:r})})};Li.displayName=xr;var Wn="TooltipTrigger",Fi=i.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,a=Ft(Wn,r),s=Bn(Wn,r),c=yr(r),l=i.useRef(null),u=oe(t,l,a.onTriggerChange),d=i.useRef(!1),f=i.useRef(!1),p=i.useCallback(()=>d.current=!1,[]);return i.useEffect(()=>()=>document.removeEventListener("pointerup",p),[p]),o.jsx(ps,{asChild:!0,...c,children:o.jsx(Z.button,{"aria-describedby":a.open?a.contentId:void 0,"data-state":a.stateAttribute,...n,ref:u,onPointerMove:z(e.onPointerMove,h=>{h.pointerType!=="touch"&&!f.current&&!s.isPointerInTransitRef.current&&(a.onTriggerEnter(),f.current=!0)}),onPointerLeave:z(e.onPointerLeave,()=>{a.onTriggerLeave(),f.current=!1}),onPointerDown:z(e.onPointerDown,()=>{d.current=!0,document.addEventListener("pointerup",p,{once:!0})}),onFocus:z(e.onFocus,()=>{d.current||a.onOpen()}),onBlur:z(e.onBlur,a.onClose),onClick:z(e.onClick,a.onClose)})})});Fi.displayName=Wn;var Vn="TooltipPortal",[Th,Mh]=wr(Vn,{forceMount:void 0}),$i=e=>{const{__scopeTooltip:t,forceMount:r,children:n,container:a}=e,s=Ft(Vn,t);return o.jsx(Th,{scope:t,forceMount:r,children:o.jsx(Ne,{present:r||s.open,children:o.jsx(Ct,{asChild:!0,container:a,children:n})})})};$i.displayName=Vn;var gt="TooltipContent",zi=i.forwardRef((e,t)=>{const r=Mh(gt,e.__scopeTooltip),{forceMount:n=r.forceMount,side:a="top",...s}=e,c=Ft(gt,e.__scopeTooltip);return o.jsx(Ne,{present:n||c.open,children:c.disableHoverableContent?o.jsx(Bi,{side:a,...s,ref:t}):o.jsx(Ph,{side:a,...s,ref:t})})}),Ph=i.forwardRef((e,t)=>{const r=Ft(gt,e.__scopeTooltip),n=Bn(gt,e.__scopeTooltip),a=i.useRef(null),s=oe(t,a),[c,l]=i.useState(null),{trigger:u,onClose:d}=r,f=a.current,{onPointerInTransitChange:p}=n,h=i.useCallback(()=>{l(null),p(!1)},[p]),m=i.useCallback((b,g)=>{const w=b.currentTarget,v={x:b.clientX,y:b.clientY},y=Ih(v,w.getBoundingClientRect()),x=kh(v,y),N=Oh(g.getBoundingClientRect()),E=Fh([...x,...N]);l(E),p(!0)},[p]);return i.useEffect(()=>()=>h(),[h]),i.useEffect(()=>{if(u&&f){const b=w=>m(w,f),g=w=>m(w,u);return u.addEventListener("pointerleave",b),f.addEventListener("pointerleave",g),()=>{u.removeEventListener("pointerleave",b),f.removeEventListener("pointerleave",g)}}},[u,f,m,h]),i.useEffect(()=>{if(c){const b=g=>{const w=g.target,v={x:g.clientX,y:g.clientY},y=(u==null?void 0:u.contains(w))||(f==null?void 0:f.contains(w)),x=!Lh(v,c);y?h():x&&(h(),d())};return document.addEventListener("pointermove",b),()=>document.removeEventListener("pointermove",b)}},[u,f,c,d,h]),o.jsx(Bi,{...e,ref:s})}),[Ah,_h]=wr(xr,{isInside:!1}),Bi=i.forwardRef((e,t)=>{const{__scopeTooltip:r,children:n,"aria-label":a,onEscapeKeyDown:s,onPointerDownOutside:c,...l}=e,u=Ft(gt,r),d=yr(r),{onClose:f}=u;return i.useEffect(()=>(document.addEventListener(zn,f),()=>document.removeEventListener(zn,f)),[f]),i.useEffect(()=>{if(u.trigger){const p=h=>{const m=h.target;m!=null&&m.contains(u.trigger)&&f()};return window.addEventListener("scroll",p,{capture:!0}),()=>window.removeEventListener("scroll",p,{capture:!0})}},[u.trigger,f]),o.jsx(Nt,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:p=>p.preventDefault(),onDismiss:f,children:o.jsxs(hs,{"data-state":u.stateAttribute,...d,...l,ref:t,style:{...l.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[o.jsx(Ko,{children:n}),o.jsx(Ah,{scope:r,isInside:!0,children:o.jsx(Nh,{id:u.contentId,role:"tooltip",children:a||n})})]})})});zi.displayName=gt;var Wi="TooltipArrow",Dh=i.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,a=yr(r);return _h(Wi,r).isInside?null:o.jsx(gs,{...a,...n,ref:t})});Dh.displayName=Wi;function Ih(e,t){const r=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),a=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(r,n,a,s)){case s:return"left";case a:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function kh(e,t,r=5){const n=[];switch(t){case"top":n.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":n.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":n.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":n.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r});break}return n}function Oh(e){const{top:t,right:r,bottom:n,left:a}=e;return[{x:a,y:t},{x:r,y:t},{x:r,y:n},{x:a,y:n}]}function Lh(e,t){const{x:r,y:n}=e;let a=!1;for(let s=0,c=t.length-1;s<t.length;c=s++){const l=t[s].x,u=t[s].y,d=t[c].x,f=t[c].y;u>n!=f>n&&r<(d-l)*(n-u)/(f-u)+l&&(a=!a)}return a}function Fh(e){const t=e.slice();return t.sort((r,n)=>r.x<n.x?-1:r.x>n.x?1:r.y<n.y?-1:r.y>n.y?1:0),$h(t)}function $h(e){if(e.length<=1)return e.slice();const t=[];for(let n=0;n<e.length;n++){const a=e[n];for(;t.length>=2;){const s=t[t.length-1],c=t[t.length-2];if((s.x-c.x)*(a.y-c.y)>=(s.y-c.y)*(a.x-c.x))t.pop();else break}t.push(a)}t.pop();const r=[];for(let n=e.length-1;n>=0;n--){const a=e[n];for(;r.length>=2;){const s=r[r.length-1],c=r[r.length-2];if((s.x-c.x)*(a.y-c.y)>=(s.y-c.y)*(a.x-c.x))r.pop();else break}r.push(a)}return r.pop(),t.length===1&&r.length===1&&t[0].x===r[0].x&&t[0].y===r[0].y?t:t.concat(r)}var zh=Oi,Bh=Li,Wh=Fi,Vh=$i,Vi=zi;const vt=zh,mt=Bh,bt=Wh,Re=i.forwardRef(({className:e,sideOffset:t=4,...r},n)=>o.jsx(Vh,{children:o.jsx(Vi,{ref:n,sideOffset:t,className:_("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r})}));Re.displayName=Vi.displayName;const Nr=i.forwardRef(({className:e,type:t,mask:r,onChange:n,placeholder:a,...s},c)=>{const[l,u]=i.useState(!1),d=i.useRef(null),p=a||(r==="phone"?"(999) 999-9999":r==="postal-code-ca"?"A9A 9A9":r==="zip-code-us"?"99999":""),h=()=>r==="phone"?"Only enter numbers. Formatting will be added automatically.":r==="postal-code-ca"?"Enter letters and numbers only. Spacing will be applied automatically.":r==="zip-code-us"?"Only enter numbers. Formatting will be added automatically.":"",m=()=>{u(!0),d.current&&clearTimeout(d.current),d.current=setTimeout(()=>{u(!1)},3e3)};i.useEffect(()=>()=>{d.current&&clearTimeout(d.current)},[]);const b=g=>{if(r){const w=g.target.value;let v=w;if(w.length>0){const y=w[w.length-1];/[^a-zA-Z0-9]/.test(y)&&(console.log("Non-alphanumeric detected:",y),m())}if(r==="phone"){const y=w.replace(/\D/g,"");y.length<=3?v=y:y.length<=6?v=`(${y.slice(0,3)}) ${y.slice(3)}`:v=`(${y.slice(0,3)}) ${y.slice(3,6)}-${y.slice(6,10)}`}else if(r==="postal-code-ca"){const y=w.replace(/[^a-zA-Z0-9]/g,"").toUpperCase();let x="";for(let N=0;N<Math.min(y.length,6);N++){const E=y[N];N===0||N===2||N===4?/[A-Z]/.test(E)&&(x+=E):(N===1||N===3||N===5)&&/[0-9]/.test(E)&&(x+=E)}x.length<=3?v=x:v=`${x.slice(0,3)} ${x.slice(3,6)}`}else if(r==="zip-code-us"){const y=w.replace(/\D/g,"");y.length<=5?v=y:v=`${y.slice(0,5)}-${y.slice(5,9)}`}g.target.value=v}n==null||n(g)};return o.jsx(vt,{children:o.jsxs(mt,{open:l&&!!r,children:[o.jsx(bt,{asChild:!0,children:o.jsx("input",{type:t,className:_("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-xs transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),onChange:b,placeholder:p,ref:c,...s})}),o.jsx(Re,{side:"top",className:"bg-sidebar text-sidebar-foreground",children:h()})]})})});Nr.displayName="Input";var Gh="Separator",Gi="horizontal",Uh=["horizontal","vertical"],Ui=i.forwardRef((e,t)=>{const{decorative:r,orientation:n=Gi,...a}=e,s=jh(n)?n:Gi,l=r?{role:"none"}:{"aria-orientation":s==="vertical"?s:void 0,role:"separator"};return o.jsx(Z.div,{"data-orientation":s,...l,...a,ref:t})});Ui.displayName=Gh;function jh(e){return Uh.includes(e)}var ji=Ui;const Gn=i.forwardRef(({className:e,orientation:t="horizontal",decorative:r=!0,...n},a)=>o.jsx(ji,{ref:a,decorative:r,orientation:t,className:_("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...n}));Gn.displayName=ji.displayName;const Hi=rn,Hh=La,Kh=tr,Ki=Fa,Un=i.forwardRef(({className:e,...t},r)=>o.jsx(Zt,{className:_("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:r}));Un.displayName=Zt.displayName;const Yh=Lt("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500 data-[state=open]:animate-in data-[state=closed]:animate-out",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),jn=i.forwardRef(({side:e="right",className:t,children:r,...n},a)=>o.jsxs(Ki,{children:[o.jsx(Un,{}),o.jsxs(Jt,{ref:a,className:_(Yh({side:e}),t),...n,children:[o.jsxs(tr,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[o.jsx(Ir,{className:"h-4 w-4"}),o.jsx("span",{className:"sr-only",children:"Close"})]}),r]})]}));jn.displayName=Jt.displayName;const Yi=({className:e,...t})=>o.jsx("div",{className:_("flex flex-col space-y-2 text-center sm:text-left",e),...t});Yi.displayName="SheetHeader";const qi=({className:e,...t})=>o.jsx("div",{className:_("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});qi.displayName="SheetFooter";const Xi=i.forwardRef(({className:e,...t},r)=>o.jsx(Rt,{ref:r,className:_("text-lg font-semibold text-foreground",e),...t}));Xi.displayName=Rt.displayName;const Qi=i.forwardRef(({className:e,...t},r)=>o.jsx(er,{ref:r,className:_("text-sm text-muted-foreground",e),...t}));Qi.displayName=er.displayName;function qh({onClick:e,publicName:t,applicationName:r,partnerId:n}){const a=`https://api.randmar.io/v4/Partner/${n}/Account/Logo?height=72&width=72`,[s,c]=H.useState(!1),l=()=>{c(!0)};return o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("div",{className:"flex h-9 w-9 items-center justify-center rounded-lg bg-muted "+(e!==void 0?"cursor-pointer":""),children:s?o.jsx(ce,{asChild:!0,size:"icon",onClick:e,children:o.jsx(Ml,{className:"h-5 w-5 text-muted-foreground !bg-sidebar"})}):o.jsx(ce,{asChild:!0,size:"icon",onClick:e,children:o.jsx("img",{src:a,alt:"Partner logo",className:"h-9 w-9 object-cover !bg-sidebar",onError:l})})}),o.jsxs("div",{className:"flex flex-1 flex-col",children:[o.jsx("span",{className:"text-sm font-medium",children:t||"Partner"}),o.jsx("span",{className:"text-xs text-neutral-400",children:r})]})]})}var Xh="Label",Zi=i.forwardRef((e,t)=>o.jsx(Z.label,{...e,ref:t,onMouseDown:r=>{var a;r.target.closest("button, input, select, textarea")||((a=e.onMouseDown)==null||a.call(e,r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));Zi.displayName=Xh;var Qh=Zi;function Zh({className:e,...t}){return o.jsx(Qh,{"data-slot":"label",className:_("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...t})}const Hn=1024;function Ji(){const[e,t]=i.useState(void 0);return i.useEffect(()=>{const r=window.matchMedia(`(max-width: ${Hn-1}px)`),n=()=>{t(window.innerWidth<Hn)};return r.addEventListener("change",n),t(window.innerWidth<Hn),()=>r.removeEventListener("change",n)},[]),!!e}function U({className:e,...t}){return o.jsx("div",{className:_("animate-pulse rounded-md bg-primary/20",e),...t})}const Jh="sidebar:state",Rh=60*60*24*7,eg="16rem",tg="18rem",rg="3rem",ng="b",Ri=i.createContext(null);function $t(){const e=i.useContext(Ri);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}const Kn=i.forwardRef(({defaultOpen:e=!0,open:t,onOpenChange:r,className:n,style:a,children:s,...c},l)=>{const u=Ji(),[d,f]=i.useState(!1),[p,h]=i.useState(e),m=t??p,b=i.useCallback(y=>{const x=typeof y=="function"?y(m):y;r?r(x):h(x),document.cookie=`${Jh}=${x}; path=/; max-age=${Rh}`},[r,m]),g=i.useCallback(()=>u?f(y=>!y):b(y=>!y),[u,b,f]);i.useEffect(()=>{const y=x=>{x.key===ng&&(x.metaKey||x.ctrlKey)&&(x.preventDefault(),g())};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[g]);const w=m?"expanded":"collapsed",v=i.useMemo(()=>({state:w,open:m,setOpen:b,isMobile:u,openMobile:d,setOpenMobile:f,toggleSidebar:g}),[w,m,b,u,d,f,g]);return o.jsx(Ri.Provider,{value:v,children:o.jsx(vt,{delayDuration:0,children:o.jsx("div",{style:{"--sidebar-width":eg,"--sidebar-width-icon":rg,...a},className:_("group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar",n),ref:l,...c,children:s})})})});Kn.displayName="SidebarProvider";const Yn=i.forwardRef(({side:e="left",variant:t="sidebar",collapsible:r="offcanvas",className:n,children:a,...s},c)=>{const{isMobile:l,state:u,openMobile:d,setOpenMobile:f}=$t();return r==="none"?o.jsx("div",{className:_("flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground",n),ref:c,...s,children:a}):l?o.jsx(Hi,{open:d,onOpenChange:f,...s,children:o.jsx(jn,{"data-sidebar":"sidebar","data-mobile":"true",className:"w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:{"--sidebar-width":tg},side:e,children:o.jsx("div",{className:"flex h-full w-full flex-col",children:a})})}):o.jsxs("div",{ref:c,className:"group peer hidden md:block text-sidebar-foreground","data-state":u,"data-collapsible":u==="collapsed"?r:"","data-variant":t,"data-side":e,children:[o.jsx("div",{className:_("duration-200 relative h-svh w-(--sidebar-width) bg-transparent transition-[width] ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",t==="floating"||t==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),o.jsx("div",{className:_("duration-200 fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] ease-linear md:flex",e==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",t==="floating"||t==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",n),...s,children:o.jsx("div",{"data-sidebar":"sidebar",className:"flex h-full w-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow-sm",children:a})})]})});Yn.displayName="Sidebar";const qn=i.forwardRef(({className:e,onClick:t,...r},n)=>{const{toggleSidebar:a}=$t();return o.jsxs(ce,{ref:n,"data-sidebar":"trigger",variant:"ghost",size:"icon",className:_("h-7 w-7 text-sidebar-foreground",e),onClick:s=>{t==null||t(s),a()},...r,children:[o.jsx(xl,{}),o.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})});qn.displayName="SidebarTrigger";const ec=i.forwardRef(({className:e,...t},r)=>{const{toggleSidebar:n}=$t();return o.jsx("button",{ref:r,"data-sidebar":"rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:n,title:"Toggle Sidebar",className:_("absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-sidebar-border group-data-[side=left]:-right-4 group-data-[side=right]:left-0 sm:flex","in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full hover:group-data-[collapsible=offcanvas]:bg-sidebar","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",e),...t})});ec.displayName="SidebarRail";const tc=i.forwardRef(({className:e,...t},r)=>o.jsx("main",{ref:r,className:_("relative flex min-h-svh flex-1 flex-col bg-background","peer-data-[variant=inset]:min-h-[calc(100svh-(--spacing(4)))] md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm",e),...t}));tc.displayName="SidebarInset";const rc=i.forwardRef(({className:e,...t},r)=>o.jsx(Nr,{ref:r,"data-sidebar":"input",className:_("h-8 w-full bg-background shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",e),...t}));rc.displayName="SidebarInput";const Xn=i.forwardRef(({className:e,...t},r)=>o.jsx("div",{ref:r,"data-sidebar":"header",className:_("flex flex-col gap-2 p-2",e),...t}));Xn.displayName="SidebarHeader";const Qn=i.forwardRef(({className:e,...t},r)=>o.jsx("div",{ref:r,"data-sidebar":"footer",className:_("flex flex-col gap-2 p-2",e),...t}));Qn.displayName="SidebarFooter";const nc=i.forwardRef(({className:e,...t},r)=>o.jsx(Gn,{ref:r,"data-sidebar":"separator",className:_("mx-2 w-auto bg-sidebar-border",e),...t}));nc.displayName="SidebarSeparator";const Zn=i.forwardRef(({className:e,...t},r)=>o.jsx("div",{ref:r,"data-sidebar":"content",className:_("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t}));Zn.displayName="SidebarContent";const oc=i.forwardRef(({className:e,...t},r)=>o.jsx("div",{ref:r,"data-sidebar":"group",className:_("relative flex w-full min-w-0 flex-col p-2",e),...t}));oc.displayName="SidebarGroup";const ac=i.forwardRef(({className:e,asChild:t=!1,...r},n)=>{const a=t?ye:"div";return o.jsx(a,{ref:n,"data-sidebar":"group-label",className:_("duration-200 flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 outline-hidden ring-sidebar-ring transition-[margin,opa] ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",e),...r})});ac.displayName="SidebarGroupLabel";const sc=i.forwardRef(({className:e,asChild:t=!1,...r},n)=>{const a=t?ye:"button";return o.jsx(a,{ref:n,"data-sidebar":"group-action",className:_("absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-hidden ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 md:after:hidden","group-data-[collapsible=icon]:hidden",e),...r})});sc.displayName="SidebarGroupAction";const ic=i.forwardRef(({className:e,...t},r)=>o.jsx("div",{ref:r,"data-sidebar":"group-content",className:_("w-full text-sm",e),...t}));ic.displayName="SidebarGroupContent";const Jn=i.forwardRef(({className:e,...t},r)=>o.jsx("ul",{ref:r,"data-sidebar":"menu",className:_("flex w-full min-w-0 flex-col gap-1",e),...t}));Jn.displayName="SidebarMenu";const Rn=i.forwardRef(({className:e,...t},r)=>o.jsx("li",{ref:r,"data-sidebar":"menu-item",className:_("group/menu-item relative",e),...t}));Rn.displayName="SidebarMenuItem";const og=Lt("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}}),eo=i.forwardRef(({asChild:e=!1,isActive:t=!1,variant:r="default",size:n="default",tooltip:a,className:s,...c},l)=>{const u=e?ye:"button",{isMobile:d,state:f}=$t(),p=o.jsx(u,{ref:l,"data-sidebar":"menu-button","data-size":n,"data-active":t,className:_(og({variant:r,size:n}),s),...c});return a?(typeof a=="string"&&(a={children:a}),o.jsxs(mt,{children:[o.jsx(bt,{asChild:!0,children:p}),o.jsx(Re,{side:"right",align:"center",hidden:f!=="collapsed"||d,...a})]})):p});eo.displayName="SidebarMenuButton";const cc=i.forwardRef(({className:e,asChild:t=!1,showOnHover:r=!1,...n},a)=>{const s=t?ye:"button";return o.jsx(s,{ref:a,"data-sidebar":"menu-action",className:_("absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-hidden ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 peer-hover/menu-button:text-sidebar-accent-foreground [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 md:after:hidden","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",r&&"group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 peer-data-[active=true]/menu-button:text-sidebar-accent-foreground md:opacity-0",e),...n})});cc.displayName="SidebarMenuAction";const lc=i.forwardRef(({className:e,...t},r)=>o.jsx("div",{ref:r,"data-sidebar":"menu-badge",className:_("absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums text-sidebar-foreground select-none pointer-events-none","peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",e),...t}));lc.displayName="SidebarMenuBadge";const dc=i.forwardRef(({className:e,showIcon:t=!1,...r},n)=>{const a=i.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return o.jsxs("div",{ref:n,"data-sidebar":"menu-skeleton",className:_("rounded-md h-8 flex gap-2 px-2 items-center",e),...r,children:[t&&o.jsx(U,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),o.jsx(U,{className:"h-4 flex-1 max-w-(--skeleton-width)","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":a}})]})});dc.displayName="SidebarMenuSkeleton";const uc=i.forwardRef(({className:e,...t},r)=>o.jsx("ul",{ref:r,"data-sidebar":"menu-sub",className:_("mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5","group-data-[collapsible=icon]:hidden",e),...t}));uc.displayName="SidebarMenuSub";const fc=i.forwardRef(({...e},t)=>o.jsx("li",{ref:t,...e}));fc.displayName="SidebarMenuSubItem";const pc=i.forwardRef(({asChild:e=!1,size:t="md",isActive:r,className:n,...a},s)=>{const c=e?ye:"a";return o.jsx(c,{ref:s,"data-sidebar":"menu-sub-button","data-size":t,"data-active":r,className:_("flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground outline-hidden ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",t==="sm"&&"text-xs",t==="md"&&"text-sm","group-data-[collapsible=icon]:hidden",n),...a})});pc.displayName="SidebarMenuSubButton";var to="ToastProvider",[ro,ag,sg]=ln("Toast"),[hc,cv]=Be("Toast",[sg]),[ig,Cr]=hc(to),gc=e=>{const{__scopeToast:t,label:r="Notification",duration:n=5e3,swipeDirection:a="right",swipeThreshold:s=50,children:c}=e,[l,u]=i.useState(null),[d,f]=i.useState(0),p=i.useRef(!1),h=i.useRef(!1);return r.trim()||console.error(`Invalid prop \`label\` supplied to \`${to}\`. Expected non-empty \`string\`.`),o.jsx(ro.Provider,{scope:t,children:o.jsx(ig,{scope:t,label:r,duration:n,swipeDirection:a,swipeThreshold:s,toastCount:d,viewport:l,onViewportChange:u,onToastAdd:i.useCallback(()=>f(m=>m+1),[]),onToastRemove:i.useCallback(()=>f(m=>m-1),[]),isFocusedToastEscapeKeyDownRef:p,isClosePausedRef:h,children:c})})};gc.displayName=to;var vc="ToastViewport",cg=["F8"],no="toast.viewportPause",oo="toast.viewportResume",mc=i.forwardRef((e,t)=>{const{__scopeToast:r,hotkey:n=cg,label:a="Notifications ({hotkey})",...s}=e,c=Cr(vc,r),l=ag(r),u=i.useRef(null),d=i.useRef(null),f=i.useRef(null),p=i.useRef(null),h=oe(t,p,c.onViewportChange),m=n.join("+").replace(/Key/g,"").replace(/Digit/g,""),b=c.toastCount>0;i.useEffect(()=>{const w=v=>{var x;n.length!==0&&n.every(N=>v[N]||v.code===N)&&((x=p.current)==null||x.focus())};return document.addEventListener("keydown",w),()=>document.removeEventListener("keydown",w)},[n]),i.useEffect(()=>{const w=u.current,v=p.current;if(b&&w&&v){const y=()=>{if(!c.isClosePausedRef.current){const C=new CustomEvent(no);v.dispatchEvent(C),c.isClosePausedRef.current=!0}},x=()=>{if(c.isClosePausedRef.current){const C=new CustomEvent(oo);v.dispatchEvent(C),c.isClosePausedRef.current=!1}},N=C=>{!w.contains(C.relatedTarget)&&x()},E=()=>{w.contains(document.activeElement)||x()};return w.addEventListener("focusin",y),w.addEventListener("focusout",N),w.addEventListener("pointermove",y),w.addEventListener("pointerleave",E),window.addEventListener("blur",y),window.addEventListener("focus",x),()=>{w.removeEventListener("focusin",y),w.removeEventListener("focusout",N),w.removeEventListener("pointermove",y),w.removeEventListener("pointerleave",E),window.removeEventListener("blur",y),window.removeEventListener("focus",x)}}},[b,c.isClosePausedRef]);const g=i.useCallback(({tabbingDirection:w})=>{const y=l().map(x=>{const N=x.ref.current,E=[N,...xg(N)];return w==="forwards"?E:E.reverse()});return(w==="forwards"?y.reverse():y).flat()},[l]);return i.useEffect(()=>{const w=p.current;if(w){const v=y=>{var E,C,T;const x=y.altKey||y.ctrlKey||y.metaKey;if(y.key==="Tab"&&!x){const $=document.activeElement,O=y.shiftKey;if(y.target===w&&O){(E=d.current)==null||E.focus();return}const F=g({tabbingDirection:O?"backwards":"forwards"}),L=F.findIndex(P=>P===$);io(F.slice(L+1))?y.preventDefault():O?(C=d.current)==null||C.focus():(T=f.current)==null||T.focus()}};return w.addEventListener("keydown",v),()=>w.removeEventListener("keydown",v)}},[l,g]),o.jsxs(Ld,{ref:u,role:"region","aria-label":a.replace("{hotkey}",m),tabIndex:-1,style:{pointerEvents:b?void 0:"none"},children:[b&&o.jsx(ao,{ref:d,onFocusFromOutsideViewport:()=>{const w=g({tabbingDirection:"forwards"});io(w)}}),o.jsx(ro.Slot,{scope:r,children:o.jsx(Z.ol,{tabIndex:-1,...s,ref:h})}),b&&o.jsx(ao,{ref:f,onFocusFromOutsideViewport:()=>{const w=g({tabbingDirection:"backwards"});io(w)}})]})});mc.displayName=vc;var bc="ToastFocusProxy",ao=i.forwardRef((e,t)=>{const{__scopeToast:r,onFocusFromOutsideViewport:n,...a}=e,s=Cr(bc,r);return o.jsx(br,{"aria-hidden":!0,tabIndex:0,...a,ref:t,style:{position:"fixed"},onFocus:c=>{var d;const l=c.relatedTarget;!((d=s.viewport)!=null&&d.contains(l))&&n()}})});ao.displayName=bc;var Sr="Toast",lg="toast.swipeStart",dg="toast.swipeMove",ug="toast.swipeCancel",fg="toast.swipeEnd",wc=i.forwardRef((e,t)=>{const{forceMount:r,open:n,defaultOpen:a,onOpenChange:s,...c}=e,[l=!0,u]=st({prop:n,defaultProp:a,onChange:s});return o.jsx(Ne,{present:r||l,children:o.jsx(gg,{open:l,...c,ref:t,onClose:()=>u(!1),onPause:fe(e.onPause),onResume:fe(e.onResume),onSwipeStart:z(e.onSwipeStart,d=>{d.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:z(e.onSwipeMove,d=>{const{x:f,y:p}=d.detail.delta;d.currentTarget.setAttribute("data-swipe","move"),d.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${f}px`),d.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${p}px`)}),onSwipeCancel:z(e.onSwipeCancel,d=>{d.currentTarget.setAttribute("data-swipe","cancel"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),d.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),d.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:z(e.onSwipeEnd,d=>{const{x:f,y:p}=d.detail.delta;d.currentTarget.setAttribute("data-swipe","end"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),d.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${f}px`),d.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${p}px`),u(!1)})})})});wc.displayName=Sr;var[pg,hg]=hc(Sr,{onClose(){}}),gg=i.forwardRef((e,t)=>{const{__scopeToast:r,type:n="foreground",duration:a,open:s,onClose:c,onEscapeKeyDown:l,onPause:u,onResume:d,onSwipeStart:f,onSwipeMove:p,onSwipeCancel:h,onSwipeEnd:m,...b}=e,g=Cr(Sr,r),[w,v]=i.useState(null),y=oe(t,P=>v(P)),x=i.useRef(null),N=i.useRef(null),E=a||g.duration,C=i.useRef(0),T=i.useRef(E),$=i.useRef(0),{onToastAdd:O,onToastRemove:B}=g,K=fe(()=>{var V;(w==null?void 0:w.contains(document.activeElement))&&((V=g.viewport)==null||V.focus()),c()}),F=i.useCallback(P=>{!P||P===1/0||(window.clearTimeout($.current),C.current=new Date().getTime(),$.current=window.setTimeout(K,P))},[K]);i.useEffect(()=>{const P=g.viewport;if(P){const V=()=>{F(T.current),d==null||d()},A=()=>{const X=new Date().getTime()-C.current;T.current=T.current-X,window.clearTimeout($.current),u==null||u()};return P.addEventListener(no,A),P.addEventListener(oo,V),()=>{P.removeEventListener(no,A),P.removeEventListener(oo,V)}}},[g.viewport,E,u,d,F]),i.useEffect(()=>{s&&!g.isClosePausedRef.current&&F(E)},[s,E,g.isClosePausedRef,F]),i.useEffect(()=>(O(),()=>B()),[O,B]);const L=i.useMemo(()=>w?Tc(w):null,[w]);return g.viewport?o.jsxs(o.Fragment,{children:[L&&o.jsx(vg,{__scopeToast:r,role:"status","aria-live":n==="foreground"?"assertive":"polite","aria-atomic":!0,children:L}),o.jsx(pg,{scope:r,onClose:K,children:_r.createPortal(o.jsx(ro.ItemSlot,{scope:r,children:o.jsx(Od,{asChild:!0,onEscapeKeyDown:z(l,()=>{g.isFocusedToastEscapeKeyDownRef.current||K(),g.isFocusedToastEscapeKeyDownRef.current=!1}),children:o.jsx(Z.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":s?"open":"closed","data-swipe-direction":g.swipeDirection,...b,ref:y,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:z(e.onKeyDown,P=>{P.key==="Escape"&&(l==null||l(P.nativeEvent),P.nativeEvent.defaultPrevented||(g.isFocusedToastEscapeKeyDownRef.current=!0,K()))}),onPointerDown:z(e.onPointerDown,P=>{P.button===0&&(x.current={x:P.clientX,y:P.clientY})}),onPointerMove:z(e.onPointerMove,P=>{if(!x.current)return;const V=P.clientX-x.current.x,A=P.clientY-x.current.y,X=!!N.current,D=["left","right"].includes(g.swipeDirection),M=["left","up"].includes(g.swipeDirection)?Math.min:Math.max,Y=D?M(0,V):0,Q=D?0:M(0,A),ee=P.pointerType==="touch"?10:2,te={x:Y,y:Q},ne={originalEvent:P,delta:te};X?(N.current=te,Er(dg,p,ne,{discrete:!1})):Mc(te,g.swipeDirection,ee)?(N.current=te,Er(lg,f,ne,{discrete:!1}),P.target.setPointerCapture(P.pointerId)):(Math.abs(V)>ee||Math.abs(A)>ee)&&(x.current=null)}),onPointerUp:z(e.onPointerUp,P=>{const V=N.current,A=P.target;if(A.hasPointerCapture(P.pointerId)&&A.releasePointerCapture(P.pointerId),N.current=null,x.current=null,V){const X=P.currentTarget,D={originalEvent:P,delta:V};Mc(V,g.swipeDirection,g.swipeThreshold)?Er(fg,m,D,{discrete:!0}):Er(ug,h,D,{discrete:!0}),X.addEventListener("click",M=>M.preventDefault(),{once:!0})}})})})}),g.viewport)})]}):null}),vg=e=>{const{__scopeToast:t,children:r,...n}=e,a=Cr(Sr,t),[s,c]=i.useState(!1),[l,u]=i.useState(!1);return wg(()=>c(!0)),i.useEffect(()=>{const d=window.setTimeout(()=>u(!0),1e3);return()=>window.clearTimeout(d)},[]),l?null:o.jsx(Ct,{asChild:!0,children:o.jsx(br,{...n,children:s&&o.jsxs(o.Fragment,{children:[a.label," ",r]})})})},mg="ToastTitle",yc=i.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e;return o.jsx(Z.div,{...n,ref:t})});yc.displayName=mg;var bg="ToastDescription",xc=i.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e;return o.jsx(Z.div,{...n,ref:t})});xc.displayName=bg;var Nc="ToastAction",Cc=i.forwardRef((e,t)=>{const{altText:r,...n}=e;return r.trim()?o.jsx(Ec,{altText:r,asChild:!0,children:o.jsx(so,{...n,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${Nc}\`. Expected non-empty \`string\`.`),null)});Cc.displayName=Nc;var Sc="ToastClose",so=i.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e,a=hg(Sc,r);return o.jsx(Ec,{asChild:!0,children:o.jsx(Z.button,{type:"button",...n,ref:t,onClick:z(e.onClick,a.onClose)})})});so.displayName=Sc;var Ec=i.forwardRef((e,t)=>{const{__scopeToast:r,altText:n,...a}=e;return o.jsx(Z.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":n||void 0,...a,ref:t})});function Tc(e){const t=[];return Array.from(e.childNodes).forEach(n=>{if(n.nodeType===n.TEXT_NODE&&n.textContent&&t.push(n.textContent),yg(n)){const a=n.ariaHidden||n.hidden||n.style.display==="none",s=n.dataset.radixToastAnnounceExclude==="";if(!a)if(s){const c=n.dataset.radixToastAnnounceAlt;c&&t.push(c)}else t.push(...Tc(n))}}),t}function Er(e,t,r,{discrete:n}){const a=r.originalEvent.currentTarget,s=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:r});t&&a.addEventListener(e,t,{once:!0}),n?Wr(a,s):a.dispatchEvent(s)}var Mc=(e,t,r=0)=>{const n=Math.abs(e.x),a=Math.abs(e.y),s=n>a;return t==="left"||t==="right"?s&&n>r:!s&&a>r};function wg(e=()=>{}){const t=fe(e);We(()=>{let r=0,n=0;return r=window.requestAnimationFrame(()=>n=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(r),window.cancelAnimationFrame(n)}},[t])}function yg(e){return e.nodeType===e.ELEMENT_NODE}function xg(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const a=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||a?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function io(e){const t=document.activeElement;return e.some(r=>r===t?!0:(r.focus(),document.activeElement!==t))}var Ng=gc,Pc=mc,Ac=wc,_c=yc,Dc=xc,Ic=Cc,kc=so;const Oc=Ng,co=i.forwardRef(({className:e,...t},r)=>o.jsx(Pc,{ref:r,className:_("fixed top-0 z-100 flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",e),...t}));co.displayName=Pc.displayName;const Cg=Lt("group pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-md border p-4 pr-6 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full sm:data-[state=open]:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground",success:"border-green-600 bg-green-600 text-white",warning:"border-yellow-500 bg-yellow-500 text-white",info:"border-blue-500 bg-blue-500 text-white",secondary:"border-secondary bg-secondary text-secondary-foreground",outline:"border-input bg-background text-foreground hover:bg-accent hover:text-accent-foreground"}},defaultVariants:{variant:"default"}}),lo=i.forwardRef(({className:e,variant:t,...r},n)=>o.jsx(Ac,{ref:n,className:_(Cg({variant:t}),e),...r}));lo.displayName=Ac.displayName;const Lc=i.forwardRef(({className:e,...t},r)=>o.jsx(Ic,{ref:r,className:_("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium transition-colors hover:bg-secondary focus:outline-hidden focus:ring-1 focus:ring-ring disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 hover:group-[.destructive]:border-destructive/30 hover:group-[.destructive]:bg-destructive hover:group-[.destructive]:text-destructive-foreground focus:group-[.destructive]:ring-destructive",e),...t}));Lc.displayName=Ic.displayName;const uo=i.forwardRef(({className:e,...t},r)=>o.jsx(kc,{ref:r,className:_("absolute right-1 top-1 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-hidden focus:ring-1 group-hover:opacity-100 group-[.destructive]:text-red-300 hover:group-[.destructive]:text-red-50 focus:group-[.destructive]:ring-red-400 focus:group-[.destructive]:ring-offset-red-600",e),"toast-close":"",...t,children:o.jsx(Ir,{className:"h-4 w-4"})}));uo.displayName=kc.displayName;const fo=i.forwardRef(({className:e,...t},r)=>o.jsx(_c,{ref:r,className:_("text-sm font-semibold [&+div]:text-xs",e),...t}));fo.displayName=_c.displayName;const po=i.forwardRef(({className:e,...t},r)=>o.jsx(Dc,{ref:r,className:_("text-sm opacity-90",e),...t}));po.displayName=Dc.displayName;const Sg=1,Eg=1e6;let ho=0;function Tg(){return ho=(ho+1)%Number.MAX_SAFE_INTEGER,ho.toString()}const go=new Map,Fc=e=>{if(go.has(e))return;const t=setTimeout(()=>{go.delete(e),zt({type:"REMOVE_TOAST",toastId:e})},Eg);go.set(e,t)},Mg=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,Sg)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(r=>r.id===t.toast.id?{...r,...t.toast}:r)};case"DISMISS_TOAST":{const{toastId:r}=t;return r?Fc(r):e.toasts.forEach(n=>Fc(n.id)),{...e,toasts:e.toasts.map(n=>n.id===r||r===void 0?{...n,open:!1}:n)}}case"REMOVE_TOAST":return{...e,toasts:t.toastId?e.toasts.filter(r=>r.id!==t.toastId):[]}}},Tr=[];let Mr={toasts:[]};function zt(e){Mr=Mg(Mr,e),Tr.forEach(t=>t(Mr))}function $c({...e}){const t=Tg(),r=a=>zt({type:"UPDATE_TOAST",toast:{...a,id:t}}),n=()=>zt({type:"DISMISS_TOAST",toastId:t});return zt({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:a=>{a||n()}}}),{id:t,dismiss:n,update:r}}function vo(){const[e,t]=i.useState(Mr);return i.useEffect(()=>(Tr.push(t),()=>{const r=Tr.indexOf(t);r>-1&&Tr.splice(r,1)}),[]),{...e,toast:$c,dismiss:r=>zt({type:"DISMISS_TOAST",toastId:r})}}function zc(){const{toasts:e}=vo();return o.jsxs(Oc,{children:[e.map(function({id:t,title:r,description:n,action:a,...s}){return o.jsxs(lo,{...s,children:[o.jsxs("div",{className:"grid gap-1",children:[r&&o.jsx(fo,{children:r}),n&&o.jsx(po,{children:n})]}),a,o.jsx(uo,{})]},t)}),o.jsx(co,{})]})}const mo=H.forwardRef(({onSignOut:e,handleValidSearch:t,rightMenu:r,searchPlaceholder:n},a)=>{const[s,c]=H.useState(""),l=Ar.useLocation(),{toast:u}=vo();H.useEffect(()=>{const h=new URLSearchParams(l.search).get("q");h&&c(h)},[l.search]);const d=()=>{const p=s.trim();if(!p||p.length<2){u({title:"Enter more characters to search",description:"At least 2 characters are needed to search products.",variant:"destructive",duration:5e3});return}t(p)},f=p=>{p.key==="Enter"&&d()};return o.jsxs("header",{className:"flex h-16 items-center gap-4 border-b sidebar-foreground bg-sidebar px-6 fixed top-0 right-0 z-50 lg:left-64 left-0 border-sidebar-border",children:[o.jsx(qn,{className:"lg:hidden",children:o.jsx(wl,{className:"h-6 w-6"})}),o.jsx("div",{className:"flex flex-1 items-center gap-4",children:o.jsx("div",{className:"relative w-full max-w-sm",children:o.jsxs("div",{children:[o.jsx("button",{type:"button",className:"absolute left-2 top-1/2 -translate-y-1/2",onClick:d,"aria-label":"Search",children:o.jsx(El,{className:"h-4 w-4 text-muted-foreground"})}),o.jsx(Nr,{placeholder:n??"Search...",className:"w-full pl-8 bg-white text-black",value:s,onChange:p=>c(p.target.value),onKeyDown:f,ref:a},"topbar-search")]})})}),r||o.jsx(o.Fragment,{}),e&&o.jsx("div",{className:"flex items-center gap-4",children:o.jsxs(ce,{variant:"ghost",size:"icon",className:"h-9 w-9",onClick:e,children:[o.jsx(bl,{className:"h-4 w-4 text-sidebar-foreground"}),o.jsx("span",{className:"sr-only",children:"Sign out"})]})})]})});mo.displayName="Topbar";const Bc=Lt("inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground border border-input hover:bg-accent hover:text-accent-foreground",success:"bg-green-600 text-white hover:bg-green-700",warning:"bg-yellow-500 text-white hover:bg-yellow-600",info:"bg-blue-500 text-white hover:bg-blue-600",ghost:"bg-background hover:bg-accent hover:text-accent-foreground",randmarRed:"bg-randmar-red text-white hover:bg-randmar-red/80",randmarBlue:"bg-randmar-blue text-white hover:bg-randmar-blue/80",randmarPurple:"bg-randmar-purple text-white hover:bg-randmar-purple/80",randmarGreen:"bg-randmar-green text-black hover:bg-randmar-green/80",randmarBlack:"bg-randmar-black text-white hover:bg-randmar-black/80",randmarYellow:"bg-randmar-yellow text-black hover:bg-randmar-yellow/80"},size:{default:"h-6",sm:"h-5 text-[10px]",lg:"h-7 px-3"}},defaultVariants:{variant:"default",size:"default"}}),Te=i.forwardRef(({className:e,variant:t,size:r,icon:n,children:a,...s},c)=>o.jsxs("div",{ref:c,className:_(Bc({variant:t,size:r}),e),...s,children:[n&&o.jsx("span",{className:"mr-1",children:n}),a]}));Te.displayName="Badge";const wt=i.forwardRef(({className:e,...t},r)=>o.jsx("div",{ref:r,className:_("rounded-md border bg-card text-card-foreground shadow-sm",e),...t}));wt.displayName="Card";const Wc=i.forwardRef(({className:e,...t},r)=>o.jsx("div",{ref:r,className:_("flex flex-col space-y-1.5 p-6",e),...t}));Wc.displayName="CardHeader";const Vc=i.forwardRef(({className:e,...t},r)=>o.jsx("div",{ref:r,className:_("font-semibold leading-none tracking-tight",e),...t}));Vc.displayName="CardTitle";const Gc=i.forwardRef(({className:e,...t},r)=>o.jsx("div",{ref:r,className:_("text-sm text-muted-foreground",e),...t}));Gc.displayName="CardDescription";const yt=i.forwardRef(({className:e,...t},r)=>o.jsx("div",{ref:r,className:_("p-6 pt-0",e),...t}));yt.displayName="CardContent";const Uc=i.forwardRef(({className:e,...t},r)=>o.jsx("div",{ref:r,className:_("flex items-center p-6 pt-0",e),...t}));Uc.displayName="CardFooter";const jc=({countryCode:e,className:t=""})=>{const[r,n]=H.useState(null),[a,s]=H.useState(!1);return H.useEffect(()=>{if(!e)return;const l=`https://purecatamphetamine.github.io/country-flag-icons/3x2/${e.toUpperCase()}.svg`;fetch(l,{method:"HEAD"}).then(u=>{u.ok?(n(l),s(!1)):s(!0)}).catch(()=>{s(!0)})},[e]),a||!r?o.jsx("span",{className:t,children:e}):o.jsx("img",{src:r,alt:`${e} flag`,className:`inline-block ${t}`,style:{width:"24px",height:"auto"}})};function Hc({routes:e,footer:t,dashboardTitle:r}){const{appID:n}=Ar.useParams(),a=e.filter(s=>s.showInNav);return o.jsxs(Yn,{className:"border-r border-sidebar-border",children:[o.jsx(Xn,{className:"border-b border-sidebar-border px-6 h-16 justify-center bg-sidebar text-sidebar-foreground",children:o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("div",{className:"flex items-center justify-center",children:o.jsx("img",{src:"https://api.randmar.io/images/RandmarIcon.svg",alt:"Randmar Icon",className:"h-4 w-4 filter brightness-0 saturate-100 invert"})}),o.jsx("span",{className:"font-semibold text-lg",children:r})]})}),o.jsx(Zn,{className:"py-4 bg-sidebar text-sidebar-foreground",children:o.jsx(Jn,{children:a.map(s=>{const c=s.icon,l=`/${s.path.replace(":appID",n)}`;return o.jsx(Rn,{children:o.jsx(eo,{asChild:!0,children:o.jsxs(Ar.Link,{to:l,className:"transition-colors hover:bg-muted px-6",children:[c&&o.jsx(c,{className:"h-4 w-4"}),o.jsx("span",{children:s.label})]})})},s.key)})})}),o.jsx(Qn,{className:"border-t border-sidebar-border p-4 bg-sidebar-background text-sidebar-foreground",children:t})]})}const Kc=H.forwardRef(({children:e,rightMenu:t,routes:r,footer:n,handleValidSearch:a,dashboardTitle:s,onSignOut:c,searchPlaceholder:l},u)=>o.jsx(o.Fragment,{children:o.jsx(Kn,{children:o.jsxs("div",{className:"flex grow",children:[o.jsx(Hc,{routes:r,footer:n,dashboardTitle:s}),o.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[o.jsx(mo,{ref:u,onSignOut:c,rightMenu:t,handleValidSearch:a,searchPlaceholder:l}),o.jsx("main",{className:"flex-1 overflow-auto mt-16",children:e}),o.jsx(zc,{})]})]})})}));Kc.displayName="Layout";const Pg={sm:100,md:200,lg:300,xl:400};function Yc({randmarSKU:e,size:t="md",alt:r,secondaryContent:n}){const[a,s]=i.useState(!1),[c,l]=i.useState(!1),[u,d]=i.useState(!1),[f,p]=i.useState(!1),h=`https://api.randmar.io/Product/${e}/Video`;i.useEffect(()=>{(async()=>{try{const x=await(await fetch(h+"/Exists")).json();l(x)}catch(y){console.error("Error checking for video:",y),l(!1)}})()},[e,h]);async function m(){if(c){p(!0);try{const y=await(await fetch(h)).blob(),x=window.URL.createObjectURL(y),N=document.createElement("a");N.href=x,N.download=`${e||"product"}-video.mp4`,document.body.appendChild(N),N.click(),document.body.removeChild(N),window.URL.revokeObjectURL(x)}catch(v){console.error("Error downloading video:",v)}finally{p(!1)}}}function b(){navigator.clipboard.writeText(h),d(!0),setTimeout(()=>{d(!1)},2e3)}function g(){s(!0)}const w=Pg[t||"xl"];return o.jsxs(o.Fragment,{children:[o.jsx(St,{open:a,onOpenChange:s,children:o.jsx(Et,{className:"max-w-4xl p-0 overflow-hidden",children:n?o.jsxs("div",{className:"flex flex-row",children:[o.jsxs("video",{className:"w-full rounded-l-lg max-h-[720px] object-contain",controls:!0,autoPlay:!0,muted:!0,loop:!0,children:[o.jsx("source",{src:h,type:"video/mp4"}),"Your browser does not support the video tag."]}),o.jsx("div",{className:"flex-grow min-w-[400px] h-[70vh] p-6",children:n})]}):o.jsxs("div",{className:"w-full relative",children:[o.jsxs("video",{className:"w-full max-h-[720px] object-contain",controls:!0,autoPlay:!0,children:[o.jsx("source",{src:h,type:"video/mp4"}),"Your browser does not support the video tag."]}),o.jsxs("div",{className:"absolute top-2 right-12 flex gap-1",children:[o.jsx(vt,{children:o.jsxs(mt,{children:[o.jsx(bt,{asChild:!0,children:o.jsx(ce,{variant:"secondary",size:"icon",onClick:b,children:u?o.jsx(Dr,{className:"h-4 w-4"}):o.jsx(gl,{className:"h-4 w-4"})})}),o.jsx(Re,{children:o.jsx("p",{children:"Copy video link"})})]})}),o.jsx(vt,{children:o.jsxs(mt,{children:[o.jsx(bt,{asChild:!0,children:o.jsx(ce,{variant:"secondary",size:"icon",onClick:m,disabled:f,children:o.jsx(vl,{className:"h-4 w-4"})})}),o.jsx(Re,{children:o.jsx("p",{children:"Download video"})})]})})]})]})})}),o.jsxs("div",{className:"relative w-max h-max",children:[o.jsx("img",{alt:r||`Product ${e}`,className:`rounded-md ${c?"cursor-pointer":""}`,onClick:c?g:void 0,src:`https://api.randmar.io/Product/${e}/Image?width=${w*1.5}&height=${w*1.5}`,width:w,height:w}),c&&o.jsx(vt,{children:o.jsxs(mt,{children:[o.jsx(bt,{asChild:!0,children:o.jsx(ce,{variant:"secondary",size:"icon",className:"absolute top-2 right-2",onClick:g,children:o.jsx(Nl,{className:"h-4 w-4"})})}),o.jsx(Re,{children:o.jsx("p",{children:"Play video"})})]})})]})]})}function Ag({item:e,addToCart:t=!1,syncToShopify:r=!1,customAction:n=o.jsx(o.Fragment,{}),defaultOpportunityNumber:a="",viewProductAction:s,addToCartAction:c,isAddToCartActionLoading:l=!1,syncToShopifyAction:u,isSyncToShopifyActionLoading:d=!1}){var M,Y,Q,ee,te,ne,se,le,ae,Me,de,Pe;const[f,p]=H.useState(1),[h,m]=H.useState(null),[b,g]=H.useState(0),[w,v]=H.useState(!1),y=((M=e==null?void 0:e.Distribution)==null?void 0:M.Cost)||0,x=((Y=e==null?void 0:e.Distribution)==null?void 0:Y.RegularPrice)||0,N=((Q=e==null?void 0:e.Distribution)==null?void 0:Q.Price)||0,[E,C]=H.useState(null),[T,$]=H.useState(!1);H.useEffect(()=>{const G=async()=>{if(e!=null&&e.ManufacturerId){$(!0);try{const J=await fetch(`https://api.randmar.io/V4/Partner/${e.ManufacturerId}/Account/Logo?width=60&height=40`);if(J.ok){const he=await J.blob();C(URL.createObjectURL(he))}}catch(J){console.error("Failed to load logo:",J)}finally{$(!1)}}};e!=null&&e.ManufacturerId&&G()},[e==null?void 0:e.ManufacturerId]),H.useEffect(()=>{var G;if(e&&a){const J=(G=e.Opportunities)==null?void 0:G.find(he=>he.BidNumber==a);J&&m(J)}},[e,a]),H.useEffect(()=>{if(!e)return;const G=h!=null&&h.Price?h.Price:N;g(x>0?Math.round((x-G)/x*100):0)},[e,h,N,x]),H.useEffect(()=>{l||p(1)},[l]);const O=G=>{if(G.Active!==!0)return!1;const J=new Date().toISOString().split("T")[0];return!(G.EndDate&&G.EndDate<J||G.StartDate&&G.StartDate>J)};if(!e)return o.jsx(wt,{className:"hover:shadow-lg transition-shadow",children:o.jsxs(yt,{className:"p-6",children:[o.jsxs("div",{className:"flex justify-between items-start mb-3",children:[o.jsx(U,{className:"h-7 w-3/4"}),o.jsx("div",{className:"h-10 w-24 flex items-center justify-end ml-4",children:o.jsx(U,{className:"h-10 w-24 rounded-md"})})]}),o.jsxs("div",{className:"flex flex-wrap gap-2 mb-4",children:[o.jsx(U,{className:"h-6 w-20 rounded-full"}),o.jsx(U,{className:"h-6 w-24 rounded-full"}),o.jsx(U,{className:"h-6 w-28 rounded-full"})]}),o.jsxs("div",{className:"flex gap-6",children:[o.jsxs("div",{className:"grid grid-cols-2 gap-x-4 gap-y-6 flex-1",children:[o.jsxs("div",{children:[o.jsx(U,{className:"h-4 w-12 mb-1"}),o.jsx(U,{className:"h-5 w-20"})]}),o.jsxs("div",{children:[o.jsx(U,{className:"h-4 w-12 mb-1"}),o.jsx(U,{className:"h-5 w-24"})]}),o.jsxs("div",{children:[o.jsx(U,{className:"h-4 w-20 mb-1"}),o.jsx(U,{className:"h-5 w-16"})]}),o.jsxs("div",{children:[o.jsx(U,{className:"h-4 w-12 mb-1"}),o.jsx(U,{className:"h-5 w-20"})]})]}),o.jsx("div",{className:"flex flex-col",children:o.jsx("div",{className:"w-60 h-40",children:o.jsx(U,{className:"w-full h-full rounded-lg"})})})]}),o.jsxs("div",{className:"flex gap-6 mt-4",children:[o.jsx("div",{className:"flex flex-1",children:o.jsxs("div",{className:"w-full",children:[o.jsx(U,{className:"h-4 w-24 mb-3"}),o.jsx(U,{className:"h-16 w-full rounded-md"})]})}),o.jsxs("div",{className:"flex flex-col items-center",children:[o.jsx(U,{className:"h-10 w-32 rounded-md"}),o.jsx(U,{className:"h-5 w-24 mt-4"})]})]}),o.jsxs("div",{className:"flex gap-6 mt-4",children:[o.jsxs("div",{className:"flex flex-col items-start gap-1 mb-2",children:[o.jsx(U,{className:"h-8 w-32"}),o.jsx(U,{className:"h-6 w-24"})]}),o.jsxs("div",{className:"flex flex-1 items-center gap-2",children:[o.jsx(U,{className:"h-10 w-24 rounded-md"}),o.jsx(U,{className:"h-10 flex-1 rounded-md"})]})]})]})});const B=(e==null?void 0:e.Opportunities)||[],K=B.length>0,F=()=>{if(f==null){p(1);return}f>1&&p(f-1)},L=()=>{if(f==null){p(1);return}p(f+1)},P=G=>{const J=parseInt(G.target.value,10);if(!isNaN(J)&&J>0){p(J);return}p(void 0)},V=()=>{(f==null||f<1)&&p(1)},A=((te=(ee=e.Distribution)==null?void 0:ee.Inventory)==null?void 0:te.reduce((G,J)=>G+(J.AvailableQuantity||0),0))||0,X=G=>{try{return new Date(G).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}catch(J){return console.error(J),G.split("T")[0]||"N/A"}},D=()=>{c&&c({quantity:f??1,bidNumber:(h==null?void 0:h.BidNumber)??null})};return o.jsx(wt,{className:"hover:shadow-lg transition-shadow",children:o.jsxs(yt,{className:"p-6",children:[o.jsxs("div",{className:"flex justify-between items-start mb-3",children:[o.jsx("h3",{className:"font-semibold text-xl",children:e.Title||e.RandmarTitle}),o.jsx("div",{className:"h-10 w-24 flex items-center justify-end ml-4",children:T?o.jsx(U,{className:"h-10 w-24 rounded-md"}):E&&o.jsx("img",{src:E||"/placeholder.svg",alt:e.ManufacturerName??"",className:"max-h-10 max-w-24 object-contain"})})]}),o.jsxs("div",{className:"flex gap-6",children:[o.jsxs("div",{className:"flex-1",children:[o.jsxs("div",{className:"flex flex-wrap gap-2 mb-4",children:[e.State&&o.jsxs(Te,{variant:"outline",className:`rounded-full px-3 ${e.State==="Active"?"bg-green-50 text-green-700 hover:bg-green-50":"bg-red-50 text-red-700 hover:bg-red-50"}`,children:[o.jsx(Dr,{size:"12",className:"mr-1.5"})," ",e.State]}),o.jsxs(Te,{variant:"outline",className:`rounded-full px-3 ${e.SerialNumber?"bg-green-50 text-green-700 hover:bg-green-50":"bg-yellow-50 text-yellow-700 hover:bg-yellow-50"}`,children:[o.jsx(Cl,{size:"12",className:"mr-1.5"})," ",e.SerialNumber?"Serialized":"Unserialized"]}),e.TransparencyCode&&o.jsxs(Te,{variant:"outline",className:"rounded-full px-3 bg-green-50 text-green-700 hover:bg-green-50",children:[o.jsx(pl,{size:"12",className:"mr-1.5"})," Transparency Code"]}),e.AvailableToBuy===void 0?o.jsxs(Te,{variant:"outline",className:`rounded-full px-3 ${(ne=e.ManufacturerCategory)!=null&&ne.QualificationRequired?"bg-blue-50 text-blue-700 hover:bg-blue-50":"bg-neutral-50 text-neutral-700 hover:bg-neutral-50"}`,children:[o.jsx(Ao,{size:"12",className:"mr-1.5"})," ",(se=e.ManufacturerCategory)!=null&&se.QualificationRequired?"Qualification Enforced":"No Qualification Needed"]}):o.jsxs(Te,{variant:"outline",className:`rounded-full px-3 ${e.AvailableToBuy?"bg-green-50 text-green-700 hover:bg-green-50":"bg-red-50 text-red-700 hover:bg-red-50"}`,children:[o.jsx(Ao,{size:"12",className:"mr-1.5"})," ",(le=e.ManufacturerCategory)!=null&&le.QualificationRequired?e.AvailableToBuy?"Qualified":"Not Qualified":"No Qualification Required"]}),e.ManufacturerId&&o.jsxs(Te,{variant:"outline",className:`rounded-full px-3 ${e.AutoUpdate?"bg-green-50 text-green-700 hover:bg-green-50":"bg-red-50 text-red-700 hover:bg-red-50"}`,children:[o.jsx(Sl,{size:"12",className:"mr-1.5"})," ",e.AutoUpdate?`Automatic Reorder (${e.MasterCarton})`:"Manually Reorders"]}),o.jsxs(Te,{variant:"outline",className:`rounded-full px-3 ${e.BodyHTML&&e.Title&&e.MAP?"bg-green-50 text-green-700 hover:bg-green-50":"bg-red-50 text-red-700 hover:bg-red-50"}`,children:[o.jsx(Tl,{size:"12",className:"mr-1.5"})," ",e.BodyHTML&&e.Title&&e.MAP?"Shopify Ready":"Not Shopify Ready"]})]}),o.jsxs("div",{className:"grid grid-cols-2 gap-x-4 gap-y-4 flex-1",children:[o.jsxs("div",{children:[o.jsx("div",{className:"text-sm text-muted-foreground",children:"MPN"}),o.jsx("div",{className:"font-medium",children:e.MPN||"N/A"})]}),o.jsxs("div",{children:[o.jsx("div",{className:"text-sm text-muted-foreground",children:"UPC"}),o.jsx("div",{className:"font-medium",children:e.UPC||"N/A"})]}),o.jsxs("div",{children:[o.jsx("div",{className:"text-sm text-muted-foreground",children:"Unit Weight"}),o.jsx("div",{className:"font-medium",children:e.UnitWeight?`${e.UnitWeight} lbs`:"N/A"})]}),o.jsxs("div",{children:[o.jsx("div",{className:"text-sm text-muted-foreground",children:"MAP"}),o.jsx("div",{className:"font-medium",children:e.MAP?"$"+e.MAP.toFixed(2):"N/A"})]}),e.CountryCodeOfOrigin&&o.jsxs("div",{children:[o.jsx("div",{className:"text-sm text-muted-foreground",children:"Origin"}),o.jsxs("div",{className:"font-medium flex items-center",children:[o.jsx(jc,{countryCode:e.CountryCodeOfOrigin,className:"mr-2"}),e.CountryCodeOfOrigin]})]})]})]}),o.jsx("div",{className:"flex flex-col",children:o.jsx(Yc,{randmarSKU:e.RandmarSKU||"",alt:e.RandmarTitle||""})})]}),o.jsxs("div",{className:"flex gap-6 mt-4",children:[o.jsx("div",{className:"flex flex-1",children:K&&e.Distribution&&o.jsxs("div",{className:"w-full",children:[o.jsx("div",{className:"flex items-center",children:"You have "+B.length+(B.length>1?" opportunities":" opportunity")+" for this product:"}),o.jsx("div",{className:"space-y-2 max-h-[200px] overflow-y-auto p-2 mt-1",children:B.map((G,J)=>{var he;return o.jsxs("div",{className:`flex justify-between items-center rounded-lg transition-colors py-2 px-4 bg-purple-100 border border-muted
|
|
195
|
+
${G.BidNumber==(h==null?void 0:h.BidNumber)?"cursor-pointer border-2 border-purple-900":O(G)?"hover:bg-purple-200 cursor-pointer":"!bg-neutral-50"}
|
|
196
|
+
`,onClick:()=>{O(G)&&m(G.BidNumber!=(h==null?void 0:h.BidNumber)?G:null)},children:[o.jsx("div",{className:"flex items-center",children:o.jsxs("div",{className:"flex flex-col",children:[o.jsx("span",{className:"font-medium text-sm",children:G.Opportunity}),o.jsxs("span",{className:"text-xs text-neutral-900",children:[G.BidNumber," ",!O(G)&&o.jsx(Te,{variant:"outline",className:"text-xs mx-1 h-5 bg-gray-100",children:"Currently unavailable"})]})]})}),o.jsxs("div",{className:"flex flex-col items-end",children:[o.jsxs("span",{className:"font-semibold",children:["$",(he=G.Price)==null?void 0:he.toFixed(2)]}),G.Rebate&&G.Rebate>0&&o.jsxs("span",{className:"text-xs text-green-600",children:["Rebate: $",G.Rebate.toFixed(2)]}),G.EndDate&&o.jsxs("span",{className:"text-xs text-neutral-600",children:["Ends: ",X(G.EndDate)]})]})]},J)})})]})}),o.jsxs("div",{className:"flex flex-col items-center",children:[s&&o.jsxs(ce,{variant:"secondary",onClick:s,children:[o.jsx(ml,{className:"mr-2"}),"View Product"]}),((ae=e.Distribution)==null?void 0:ae.Inventory)&&o.jsx("div",{className:"mt-4",children:o.jsxs(St,{open:w,onOpenChange:v,children:[o.jsx(nn,{asChild:!0,children:o.jsxs(ce,{variant:"ghost",className:`flex items-center text-sm ${A>0?"text-green-700":"text-red-700"}`,children:[o.jsx(Do,{size:"16",className:"mr-2"}),A>0?o.jsxs(o.Fragment,{children:[A," in stock"]}):o.jsx(o.Fragment,{children:"Out of stock"})]})}),o.jsxs(Et,{className:"max-w-4xl",children:[o.jsx(rr,{children:o.jsxs(nr,{className:"flex items-center",children:[o.jsx(Do,{className:"mr-2",size:18}),"Inventory Information"]})}),o.jsx(_i,{inventory:e.Distribution.Inventory})]})]})})]})]}),e.Distribution&&o.jsxs("div",{className:"flex justify-between items-end mt-4",children:[o.jsx("div",{className:"flex-shrink-1 flex flex-col items-start gap-1",children:y>0?o.jsx("div",{className:"flex items-center",children:o.jsxs("span",{className:"text-2xl font-bold whitespace-nowrap",children:[o.jsx("span",{children:"Cost: $"}),y.toFixed(2),o.jsx("span",{children:" CAD"})]})}):o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"flex items-center flex-wrap",children:[o.jsxs("span",{className:"text-2xl font-bold whitespace-nowrap",children:[o.jsx("span",{children:"$"}),h?(de=(Me=e.Opportunities)==null?void 0:Me.find(G=>G.BidNumber==h.BidNumber))==null?void 0:de.Price:N.toFixed(2),o.jsx("span",{children:" CAD"})]}),b>0&&o.jsxs("span",{className:"text-muted-foreground line-through ml-2 whitespace-nowrap",children:["$",x.toFixed(2)]})]}),b>0&&o.jsx("div",{className:"flex items-center",children:o.jsxs(Te,{variant:"outline",className:"bg-red-50 text-red-700 rounded-full px-3 whitespace-nowrap",children:[o.jsxs("span",{children:[b,"% OFF"]}),((Pe=e.InstantRebate)==null?void 0:Pe.EndDate)&&o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"mx-1.5",children:"●"})," Ends ",e.InstantRebate.EndDate.split("T")[0]]}),(h==null?void 0:h.EndDate)&&o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"mx-1.5",children:"●"})," Ends ",h.EndDate.split("T")[0]]})]})})]})}),o.jsxs("div",{className:"flex flex-shrink-0 gap-2 ml-4",children:[typeof t<"u"&&t&&o.jsxs("div",{className:"flex items-center border rounded-md",children:[o.jsx(ce,{variant:"ghost",size:"icon",className:"rounded-r-none",onClick:F,disabled:typeof f<"u"&&(f<=1||!e.AvailableToBuy||l||!c),children:"-"}),o.jsx("input",{value:f,onChange:P,onBlur:V,onClick:G=>G.currentTarget.select(),className:`w-12 text-center border-0 focus:ring-0 focus:outline-none ${!e.AvailableToBuy||l||!c?"text-gray-400":""}`,disabled:!e.AvailableToBuy||l||!c}),o.jsx(ce,{variant:"ghost",size:"icon",className:"rounded-l-none",onClick:L,disabled:!e.AvailableToBuy||l||!c,children:"+"})]}),typeof t<"u"&&t&&o.jsx(ce,{className:"gap-2 whitespace-nowrap",onClick:D,disabled:!e.AvailableToBuy||l||!c,children:l?o.jsxs(o.Fragment,{children:[o.jsx(Po,{className:"h-4 w-4 animate-spin"}),"Adding..."]}):o.jsxs(o.Fragment,{children:[o.jsx(_o,{className:"mr-2"}),"Add to Cart"]})}),r&&o.jsx(ce,{className:"gap-2 whitespace-nowrap bg-green-600 hover:bg-green-700",onClick:u,disabled:d||!u,children:d?o.jsxs(o.Fragment,{children:[o.jsx(Po,{className:"h-4 w-4 animate-spin"}),"Syncing..."]}):o.jsxs(o.Fragment,{children:[o.jsx(_o,{className:"mr-2"}),"Sync to Shopify"]})}),n]})]})]})})}function _g({id:e,name:t,about:r,voiceName:n,voiceStyle:a,sceneName:s,action:c,loading:l=!1}){const u=`https://api.randmar.io/V4/Partner/${e}/Account/Video`,d=`https://api.randmar.io/V4/Partner/${e}/Account/Video/Exists`,f=`https://api.randmar.io/V4/Partner/${e}/Account/Logo?width=64&height=64`,p=`https://api.randmar.io/V4/Partner/${e}/Account/Logo/Exists`,h=!!(n||a||s),[m,b]=H.useState(null),[g,w]=H.useState(!1),[v,y]=H.useState(!1),[x,N]=H.useState(!1),[E,C]=H.useState(!0);H.useEffect(()=>{if(!e||l)return;const $=async()=>{try{const F=await fetch(p);if(F.ok){const P=(await F.text()).toLowerCase()==="true";return y(P),P}return!1}catch(F){return console.error("Failed to check if logo exists:",F),y(!1),!1}},O=async()=>{w(!0);try{const F=await fetch(f);if(F.ok){const L=await F.blob();b(URL.createObjectURL(L))}}catch(F){console.error("Failed to load logo:",F)}finally{w(!1)}},B=async()=>{try{const F=await fetch(d);if(F.ok){const L=await F.text();N(L.toLowerCase()==="true")}}catch(F){console.error("Failed to check if video exists:",F),N(!1)}};(async()=>{await $()&&O(),B()})()},[e,f,p,d,l]);const T=()=>{C(!1)};return l?o.jsx(wt,{className:"hover:shadow-lg transition-shadow",children:o.jsxs(yt,{className:"p-6",children:[o.jsxs("div",{className:"flex flex-col sm:flex-row justify-between items-start gap-4 mb-4",children:[o.jsxs("div",{className:"flex items-center",children:[o.jsx("div",{className:"h-10 flex items-center justify-center mr-4",children:o.jsx(U,{className:"h-10 w-10 rounded-md"})}),o.jsx(U,{className:"h-7 w-40"})]}),o.jsx("div",{className:"w-full sm:w-auto",children:o.jsx(U,{className:"h-9 w-24"})})]}),o.jsxs("div",{className:"flex flex-col md:flex-row gap-6",children:[o.jsxs("div",{className:"flex-1 flex flex-col order-1 md:order-1",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(U,{className:"h-4 w-full"}),o.jsx(U,{className:"h-4 w-full"}),o.jsx(U,{className:"h-4 w-3/4"}),o.jsx(U,{className:"h-4 w-5/6"})]}),o.jsx("div",{className:"mt-4 p-3 bg-slate-50 rounded-md",children:o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-2",children:[o.jsxs("div",{children:[o.jsx(U,{className:"h-3 w-20 mb-1"}),o.jsx(U,{className:"h-5 w-24"})]}),o.jsxs("div",{children:[o.jsx(U,{className:"h-3 w-20 mb-1"}),o.jsx(U,{className:"h-5 w-24"})]}),o.jsxs("div",{children:[o.jsx(U,{className:"h-3 w-20 mb-1"}),o.jsx(U,{className:"h-5 w-24"})]})]})})]}),o.jsx("div",{className:"flex flex-col order-1 md:order-1 md:w-auto",children:o.jsx("div",{className:"w-[180px] h-[320px] rounded-md overflow-hidden",children:o.jsx(U,{className:"w-full h-full"})})})]})]})}):o.jsx(wt,{className:"hover:shadow-lg transition-shadow",children:o.jsxs(yt,{className:"p-6",children:[o.jsxs("div",{className:"flex flex-col sm:flex-row justify-between items-start gap-4 mb-4",children:[o.jsxs("div",{className:"flex items-center",children:[v&&o.jsx("div",{className:"h-10 flex items-center justify-center mr-4",children:g?o.jsx(U,{className:"h-10 w-10 rounded-md"}):m&&o.jsx("img",{src:m||"/placeholder.svg",alt:`${t} logo`,className:"max-h-10 w-auto object-contain"})}),o.jsx("h3",{className:"font-semibold text-xl",children:t})]}),c&&o.jsx("div",{className:"w-full sm:w-auto",children:c})]}),o.jsxs("div",{className:"flex flex-col md:flex-row gap-6",children:[o.jsxs("div",{className:"flex-1 flex flex-col order-1 md:order-1",children:[o.jsx("div",{className:"prose prose-sm max-w-none",dangerouslySetInnerHTML:{__html:r}}),h&&o.jsx("div",{className:"mt-4 p-3 bg-slate-50 rounded-md",children:o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-2",children:[n&&o.jsxs("div",{children:[o.jsx("div",{className:"text-sm text-muted-foreground",children:"Voice Name"}),o.jsx("div",{className:"font-medium",children:n})]}),a&&o.jsxs("div",{children:[o.jsx("div",{className:"text-sm text-muted-foreground",children:"Voice Style"}),o.jsx("div",{className:"font-medium",children:a})]}),s&&o.jsxs("div",{children:[o.jsx("div",{className:"text-sm text-muted-foreground",children:"Scene Name"}),o.jsx("div",{className:"font-medium",children:s})]})]})})]}),x&&o.jsx("div",{className:"flex flex-col order-1 md:order-1 md:w-auto",children:o.jsxs("div",{className:"w-[180px] h-[320px] rounded-md overflow-hidden",children:[E&&o.jsx(U,{className:"w-full h-full"}),o.jsx("video",{src:u,controls:!0,preload:"auto",playsInline:!0,className:`w-full h-full object-contain ${E?"invisible":"visible"}`,style:{objectPosition:"center",imageRendering:"auto"},onLoadedData:T,onError:()=>C(!1)})]})})]})]})})}S.AvatarFooter=qh,S.Badge=Te,S.Button=ce,S.Card=wt,S.CardContent=yt,S.CardDescription=Gc,S.CardFooter=Uc,S.CardHeader=Wc,S.CardTitle=Vc,S.CountryFlag=jc,S.Dialog=St,S.DialogClose=on,S.DialogContent=Et,S.DialogDescription=cn,S.DialogFooter=sn,S.DialogHeader=rr,S.DialogOverlay=an,S.DialogPortal=$a,S.DialogTitle=nr,S.DialogTrigger=nn,S.DropdownMenu=gh,S.DropdownMenuCheckboxItem=Ei,S.DropdownMenuContent=Ci,S.DropdownMenuGroup=mh,S.DropdownMenuItem=Si,S.DropdownMenuLabel=Mi,S.DropdownMenuPortal=bh,S.DropdownMenuRadioGroup=yh,S.DropdownMenuRadioItem=Ti,S.DropdownMenuSeparator=Pi,S.DropdownMenuShortcut=Ai,S.DropdownMenuSub=wh,S.DropdownMenuSubContent=Ni,S.DropdownMenuSubTrigger=xi,S.DropdownMenuTrigger=vh,S.Input=Nr,S.InputOTP=hd,S.InputOTPGroup=gd,S.InputOTPSeparator=md,S.InputOTPSlot=vd,S.Label=Zh,S.Layout=Kc,S.Navbar=Hc,S.PartnerCard=_g,S.ProductCard=Ag,S.ProductImage=Yc,S.ProductInventoryGrid=_i,S.Separator=Gn,S.Sheet=Hi,S.SheetClose=Kh,S.SheetContent=jn,S.SheetDescription=Qi,S.SheetFooter=qi,S.SheetHeader=Yi,S.SheetOverlay=Un,S.SheetPortal=Ki,S.SheetTitle=Xi,S.SheetTrigger=Hh,S.Sidebar=Yn,S.SidebarContent=Zn,S.SidebarFooter=Qn,S.SidebarGroup=oc,S.SidebarGroupAction=sc,S.SidebarGroupContent=ic,S.SidebarGroupLabel=ac,S.SidebarHeader=Xn,S.SidebarInput=rc,S.SidebarInset=tc,S.SidebarMenu=Jn,S.SidebarMenuAction=cc,S.SidebarMenuBadge=lc,S.SidebarMenuButton=eo,S.SidebarMenuItem=Rn,S.SidebarMenuSkeleton=dc,S.SidebarMenuSub=uc,S.SidebarMenuSubButton=pc,S.SidebarMenuSubItem=fc,S.SidebarProvider=Kn,S.SidebarRail=ec,S.SidebarSeparator=nc,S.SidebarTrigger=qn,S.Skeleton=U,S.Toast=lo,S.ToastAction=Lc,S.ToastClose=uo,S.ToastDescription=po,S.ToastProvider=Oc,S.ToastTitle=fo,S.ToastViewport=co,S.Toaster=zc,S.Tooltip=mt,S.TooltipContent=Re,S.TooltipProvider=vt,S.TooltipTrigger=bt,S.Topbar=mo,S.badgeVariants=Bc,S.buttonVariants=$n,S.toast=$c,S.useIsMobile=Ji,S.useSidebar=$t,S.useToast=vo,Object.defineProperty(S,Symbol.toStringTag,{value:"Module"})});
|