@aarthiklabs/credit-sdk 0.0.3 → 0.0.4-1
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/components/layout/iframe.d.ts +2 -1
- package/dist/components/layout/shell.d.ts +1 -1
- package/dist/components/layout/types.d.ts +42 -14
- package/dist/components/layout/with-dialog.d.ts +1 -1
- package/dist/components/layout/with-drawer.d.ts +1 -1
- package/dist/core/auth/index.d.ts +1 -0
- package/dist/core/auth/token-manager.d.ts +51 -0
- package/dist/core/errors/errors.d.ts +9 -0
- package/dist/core/journey/index.d.ts +1 -0
- package/dist/core/journey/journey-manager.d.ts +39 -0
- package/dist/core/provisioning/borrower-provisioning-manager.d.ts +33 -0
- package/dist/core/provisioning/index.d.ts +1 -0
- package/dist/core/types/auth.d.ts +33 -0
- package/dist/core/types/errors.d.ts +1 -1
- package/dist/core/types/index.d.ts +3 -0
- package/dist/core/types/journey.d.ts +22 -0
- package/dist/core/types/provisioning.d.ts +18 -0
- package/dist/index.cjs +17 -17
- package/dist/index.d.cts +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +4677 -3185
- package/package.json +3 -2
package/dist/index.cjs
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const D=require("react"),ys=require("react-dom");function ws(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const l=ws(D),Jt=ws(ys);var ln={exports:{}},$t={};var co;function Ui(){if(co)return $t;co=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,o,s){var a=null;if(s!==void 0&&(a=""+s),o.key!==void 0&&(a=""+o.key),"key"in o){s={};for(var i in o)i!=="key"&&(s[i]=o[i])}else s=o;return o=s.ref,{$$typeof:e,type:r,key:a,ref:o!==void 0?o:null,props:s}}return $t.Fragment=t,$t.jsx=n,$t.jsxs=n,$t}var Bt={};var lo;function Vi(){return lo||(lo=1,process.env.NODE_ENV!=="production"&&(function(){function e(w){if(w==null)return null;if(typeof w=="function")return w.$$typeof===q?null:w.displayName||w.name||null;if(typeof w=="string")return w;switch(w){case v:return"Fragment";case E:return"Profiler";case y:return"StrictMode";case O:return"Suspense";case T:return"SuspenseList";case H:return"Activity"}if(typeof w=="object")switch(typeof w.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),w.$$typeof){case m:return"Portal";case b:return w.displayName||"Context";case R:return(w._context.displayName||"Context")+".Consumer";case C:var U=w.render;return w=w.displayName,w||(w=U.displayName||U.name||"",w=w!==""?"ForwardRef("+w+")":"ForwardRef"),w;case x:return U=w.displayName||null,U!==null?U:e(w.type)||"Memo";case I:U=w._payload,w=w._init;try{return e(w(U))}catch{}}return null}function t(w){return""+w}function n(w){try{t(w);var U=!1}catch{U=!0}if(U){U=console;var M=U.error,K=typeof Symbol=="function"&&Symbol.toStringTag&&w[Symbol.toStringTag]||w.constructor.name||"Object";return M.call(U,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",K),t(w)}}function r(w){if(w===v)return"<>";if(typeof w=="object"&&w!==null&&w.$$typeof===I)return"<...>";try{var U=e(w);return U?"<"+U+">":"<...>"}catch{return"<...>"}}function o(){var w=Q.A;return w===null?null:w.getOwner()}function s(){return Error("react-stack-top-frame")}function a(w){if(L.call(w,"key")){var U=Object.getOwnPropertyDescriptor(w,"key").get;if(U&&U.isReactWarning)return!1}return w.key!==void 0}function i(w,U){function M(){J||(J=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",U))}M.isReactWarning=!0,Object.defineProperty(w,"key",{get:M,configurable:!0})}function u(){var w=e(this.type);return te[w]||(te[w]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),w=this.props.ref,w!==void 0?w:null}function c(w,U,M,K,Ee,he){var P=M.ref;return w={$$typeof:g,type:w,key:U,props:M,_owner:K},(P!==void 0?P:null)!==null?Object.defineProperty(w,"ref",{enumerable:!1,get:u}):Object.defineProperty(w,"ref",{enumerable:!1,value:null}),w._store={},Object.defineProperty(w._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(w,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(w,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:Ee}),Object.defineProperty(w,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:he}),Object.freeze&&(Object.freeze(w.props),Object.freeze(w)),w}function d(w,U,M,K,Ee,he){var P=U.children;if(P!==void 0)if(K)if(ee(P)){for(K=0;K<P.length;K++)f(P[K]);Object.freeze&&Object.freeze(P)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else f(P);if(L.call(U,"key")){P=e(w);var j=Object.keys(U).filter(function(ye){return ye!=="key"});K=0<j.length?"{key: someKey, "+j.join(": ..., ")+": ...}":"{key: someKey}",re[P+K]||(j=0<j.length?"{"+j.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
2
2
|
let props = %s;
|
|
3
3
|
<%s {...props} />
|
|
4
4
|
React keys must be passed directly to JSX without using spread:
|
|
5
5
|
let props = %s;
|
|
6
|
-
<%s key={someKey} {...props} />`,q,B,W,B),xe[B+q]=!0)}if(B=null,L!==void 0&&(n(L),B=""+L),a(V)&&(n(V.key),B=""+V.key),"key"in V){L={};for(var de in V)de!=="key"&&(L[de]=V[de])}else L=V;return B&&i(L,typeof C=="function"?C.displayName||C.name||"Unknown":C),l(C,B,L,o(),ge,Re)}function f(C){p(C)?C._store&&(C._store.validated=1):typeof C=="object"&&C!==null&&C.$$typeof===I&&(C._payload.status==="fulfilled"?p(C._payload.value)&&C._payload.value._store&&(C._payload.value._store.validated=1):C._store&&(C._store.validated=1))}function p(C){return typeof C=="object"&&C!==null&&C.$$typeof===h}var g=k,h=Symbol.for("react.transitional.element"),m=Symbol.for("react.portal"),v=Symbol.for("react.fragment"),y=Symbol.for("react.strict_mode"),S=Symbol.for("react.profiler"),R=Symbol.for("react.consumer"),b=Symbol.for("react.context"),O=Symbol.for("react.forward_ref"),D=Symbol.for("react.suspense"),w=Symbol.for("react.suspense_list"),E=Symbol.for("react.memo"),I=Symbol.for("react.lazy"),z=Symbol.for("react.activity"),Y=Symbol.for("react.client.reference"),Z=g.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,_=Object.prototype.hasOwnProperty,te=Array.isArray,F=console.createTask?console.createTask:function(){return null};g={react_stack_bottom_frame:function(C){return C()}};var ee,re={},N=g.react_stack_bottom_frame.bind(g,s)(),ue=F(r(s)),xe={};Nt.Fragment=v,Nt.jsx=function(C,V,L){var q=1e4>Z.recentlyCreatedOwnerStacks++;return d(C,V,L,!1,q?Error("react-stack-top-frame"):N,q?F(r(C)):ue)},Nt.jsxs=function(C,V,L){var q=1e4>Z.recentlyCreatedOwnerStacks++;return d(C,V,L,!0,q?Error("react-stack-top-frame"):N,q?F(r(C)):ue)}})()),Nt}var Hr;function vi(){return Hr||(Hr=1,process.env.NODE_ENV==="production"?Kt.exports=gi():Kt.exports=hi()),Kt.exports}var x=vi();const $n=768;function bi(){const[e,t]=u.useState(void 0);return u.useEffect(()=>{const n=window.matchMedia(`(max-width: ${$n-1}px)`),r=()=>{t(window.innerWidth<$n)};return n.addEventListener("change",r),t(window.innerWidth<$n),()=>n.removeEventListener("change",r)},[]),!!e}function Dn(){return typeof window<"u"}function Nn(e){return Rr(e)?(e.nodeName||"").toLowerCase():"#document"}function Ve(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function yi(e){var t;return(t=(Rr(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Rr(e){return Dn()?e instanceof Node||e instanceof Ve(e).Node:!1}function at(e){return Dn()?e instanceof Element||e instanceof Ve(e).Element:!1}function ze(e){return Dn()?e instanceof HTMLElement||e instanceof Ve(e).HTMLElement:!1}function cr(e){return!Dn()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ve(e).ShadowRoot}const wi=new Set(["inline","contents"]);function In(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Cr(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!wi.has(o)}function Ei(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const xi=new Set(["html","body","#document"]);function mn(e){return xi.has(Nn(e))}function Cr(e){return Ve(e).getComputedStyle(e)}function qo(e){if(Nn(e)==="html")return e;const t=e.assignedSlot||e.parentNode||cr(e)&&e.host||yi(e);return cr(t)?t.host:t}function Ko(e){const t=qo(e);return mn(t)?e.ownerDocument?e.ownerDocument.body:e.body:ze(t)&&In(t)?t:Ko(t)}function Lt(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Ko(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),a=Ve(o);if(s){const i=Si(a);return t.concat(a,a.visualViewport||[],In(o)?o:[],i&&n?Lt(i):[])}return t.concat(o,Lt(o,[],n))}function Si(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const Gr={};function Ze(e,t){const n=u.useRef(Gr);return n.current===Gr&&(n.current=e(t)),n}const Vn=u[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],Ri=Vn&&Vn!==u.useLayoutEffect?Vn:e=>e();function se(e){const t=Ze(Ci).current;return t.next=e,Ri(t.effect),t.trampoline}function Ci(){const e={next:void 0,callback:Ti,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function Ti(){if(process.env.NODE_ENV!=="production")throw new Error("Base UI: Cannot call an event handler while rendering.")}let ur;process.env.NODE_ENV!=="production"&&(ur=new Set);function Yr(...e){if(process.env.NODE_ENV!=="production"){const t=e.join(" ");ur.has(t)||(ur.add(t),console.error(`Base UI: ${t}`))}}const Oi=()=>{},Ee=typeof document<"u"?u.useLayoutEffect:Oi;function dr(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}const jt={};function Xo(e,t,n,r,o){let s={...fr(e,jt)};return t&&(s=gn(s,t)),n&&(s=gn(s,n)),r&&(s=gn(s,r)),s}function ki(e){if(e.length===0)return jt;if(e.length===1)return fr(e[0],jt);let t={...fr(e[0],jt)};for(let n=1;n<e.length;n+=1)t=gn(t,e[n]);return t}function gn(e,t){return Zo(t)?t(e):Di(e,t)}function Di(e,t){if(!t)return e;for(const n in t){const r=t[n];switch(n){case"style":{e[n]=dr(e.style,r);break}case"className":{e[n]=Jo(e.className,r);break}default:Ni(n,r)?e[n]=Ii(e[n],r):e[n]=r}}return e}function Ni(e,t){const n=e.charCodeAt(0),r=e.charCodeAt(1),o=e.charCodeAt(2);return n===111&&r===110&&o>=65&&o<=90&&(typeof t=="function"||typeof t>"u")}function Zo(e){return typeof e=="function"}function fr(e,t){return Zo(e)?e(t):e??jt}function Ii(e,t){return t?e?n=>{if(Pi(n)){const o=n;pr(o);const s=t(o);return o.baseUIHandlerPrevented||e?.(o),s}const r=t(n);return e?.(n),r}:t:e}function pr(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function Jo(e,t){return t?e?t+" "+e:t:e}function Pi(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}function dt(e,...t){const n=new URL(`https://base-ui.com/production-error/${e}`);return t.forEach(r=>n.searchParams.append("args[]",r)),`Base UI error #${e}; visit ${n} for the full message.`}const Qo=u.createContext(void 0);process.env.NODE_ENV!=="production"&&(Qo.displayName="CompositeRootContext");function Ai(e=!1){const t=u.useContext(Qo);if(t===void 0&&!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: CompositeRootContext is missing. Composite parts must be placed within <Composite.Root>.":dt(16));return t}function _i(e){const{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:o=0,isNativeButton:s}=e,a=r&&t!==!1,i=r&&t===!1;return{props:u.useMemo(()=>{const l={onKeyDown(d){n&&t&&d.key!=="Tab"&&d.preventDefault()}};return r||(l.tabIndex=o,!s&&n&&(l.tabIndex=t?o:-1)),(s&&(t||a)||!s&&n)&&(l["aria-disabled"]=n),s&&(!t||i)&&(l.disabled=n),l},[r,n,t,a,i,s,o])}}function Tr(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:o=!0}=e,s=u.useRef(null),a=Ai(!0)!==void 0,i=se(()=>{const p=s.current;return!!(p?.tagName==="A"&&p?.href)}),{props:c}=_i({focusableWhenDisabled:n,disabled:t,composite:a,tabIndex:r,isNativeButton:o});process.env.NODE_ENV!=="production"&&u.useEffect(()=>{if(!s.current)return;const p=s.current.tagName==="BUTTON";o?p||Yr("A component that acts as a button was not rendered as a native <button>, which does not match the default. Ensure that the element passed to the `render` prop of the component is a real <button>, or set the `nativeButton` prop on the component to `false`."):p&&Yr("A component that acts as a button was rendered as a native <button>, which does not match the default. Ensure that the element passed to the `render` prop of the component is not a real <button>, or set the `nativeButton` prop on the component to `true`.")},[o]);const l=u.useCallback(()=>{const p=s.current;Mi(p)&&a&&t&&c.disabled===void 0&&p.disabled&&(p.disabled=!1)},[t,c.disabled,a]);Ee(l,[l]);const d=u.useCallback((p={})=>{const{onClick:g,onMouseDown:h,onKeyUp:m,onKeyDown:v,onPointerDown:y,...S}=p;return Xo({type:o?"button":void 0,onClick(b){if(t){b.preventDefault();return}g?.(b)},onMouseDown(b){t||h?.(b)},onKeyDown(b){if(t||(pr(b),v?.(b)),b.baseUIHandlerPrevented)return;const O=b.target===b.currentTarget&&!o&&!i()&&!t,D=b.key==="Enter",w=b.key===" ";O&&((w||D)&&b.preventDefault(),D&&g?.(b))},onKeyUp(b){t||(pr(b),m?.(b)),!b.baseUIHandlerPrevented&&b.target===b.currentTarget&&!o&&!t&&b.key===" "&&g?.(b)},onPointerDown(b){if(t){b.preventDefault();return}y?.(b)}},o?void 0:{role:"button"},c,S)},[t,c,o,i]),f=se(p=>{s.current=p,l()});return{getButtonProps:d,buttonRef:f}}function Mi(e){return ze(e)&&e.tagName==="BUTTON"}function bn(e,t,n,r){const o=Ze(es).current;return ji(o,e,t,n,r)&&ts(o,[e,t,n,r]),o.callback}function Li(e){const t=Ze(es).current;return Fi(t,e)&&ts(t,e),t.callback}function es(){return{callback:null,cleanup:null,refs:[]}}function ji(e,t,n,r,o){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==o}function Fi(e,t){return e.refs.length!==t.length||e.refs.some((n,r)=>n!==t[r])}function ts(e,t){if(e.refs=t,t.every(n=>n==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),n!=null){const r=Array(t.length).fill(null);for(let o=0;o<t.length;o+=1){const s=t[o];if(s!=null)switch(typeof s){case"function":{const a=s(n);typeof a=="function"&&(r[o]=a);break}case"object":{s.current=n;break}}}e.cleanup=()=>{for(let o=0;o<t.length;o+=1){const s=t[o];if(s!=null)switch(typeof s){case"function":{const a=r[o];typeof a=="function"?a():s(null);break}case"object":{s.current=null;break}}}}}}}const $i=parseInt(u.version,10);function Or(e){return $i>=e}function qr(e){if(!u.isValidElement(e))return null;const t=e,n=t.props;return(Or(19)?n?.ref:t.ref)??null}function Vi(e,t){const n={};for(const r in e){const o=e[r];if(t?.hasOwnProperty(r)){const s=t[r](o);s!=null&&Object.assign(n,s);continue}o===!0?n[`data-${r.toLowerCase()}`]="":o&&(n[`data-${r.toLowerCase()}`]=o.toString())}return n}function Bi(e,t){return typeof e=="function"?e(t):e}function Wi(e,t){return typeof e=="function"?e(t):e}function ns(){}const Ie=Object.freeze({}),rs="data-base-ui-click-trigger",zi={clipPath:"inset(50%)",position:"fixed",top:0,left:0};function Je(e,t,n={}){const r=t.render,o=Ui(t,n);if(n.enabled===!1)return null;const s=n.state??Ie;return Hi(e,r,o,s)}function Ui(e,t={}){const{className:n,style:r,render:o}=e,{state:s=Ie,ref:a,props:i,stateAttributesMapping:c,enabled:l=!0}=t,d=l?Bi(n,s):void 0,f=l?Wi(r,s):void 0,p=l?Vi(s,c):Ie,g=l?dr(p,Array.isArray(i)?ki(i):i)??Ie:Ie;return typeof document<"u"&&(l?Array.isArray(a)?g.ref=Li([g.ref,qr(o),...a]):g.ref=bn(g.ref,qr(o),a):bn(null,null)),l?(d!==void 0&&(g.className=Jo(g.className,d)),f!==void 0&&(g.style=dr(g.style,f)),g):Ie}function Hi(e,t,n,r){if(t){if(typeof t=="function")return t(n,r);const o=Xo(n,t.props);return o.ref=n.ref,u.cloneElement(t,o)}if(e&&typeof e=="string")return Gi(e,n);throw new Error(process.env.NODE_ENV!=="production"?"Base UI: Render element or function are not defined.":dt(8))}function Gi(e,t){return e==="button"?k.createElement("button",{type:"button",...t,key:t.key}):e==="img"?k.createElement("img",{alt:"",...t,key:t.key}):u.createElement(e,t)}const os=u.forwardRef(function(t,n){const{render:r,className:o,disabled:s=!1,focusableWhenDisabled:a=!1,nativeButton:i=!0,...c}=t,l=!!s,{getButtonProps:d,buttonRef:f}=Tr({disabled:l,focusableWhenDisabled:a,native:i}),p=u.useMemo(()=>({disabled:l}),[l]);return Je("button",t,{state:p,ref:[n,f],props:[c,d]})});process.env.NODE_ENV!=="production"&&(os.displayName="Button");function ss(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=ss(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function as(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=ss(e))&&(r&&(r+=" "),r+=t);return r}const Kr=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Xr=as,Yi=(e,t)=>n=>{var r;if(t?.variants==null)return Xr(e,n?.class,n?.className);const{variants:o,defaultVariants:s}=t,a=Object.keys(o).map(l=>{const d=n?.[l],f=s?.[l];if(d===null)return null;const p=Kr(d)||Kr(f);return o[l][p]}),i=n&&Object.entries(n).reduce((l,d)=>{let[f,p]=d;return p===void 0||(l[f]=p),l},{}),c=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((l,d)=>{let{class:f,className:p,...g}=d;return Object.entries(g).every(h=>{let[m,v]=h;return Array.isArray(v)?v.includes({...s,...i}[m]):{...s,...i}[m]===v})?[...l,f,p]:l},[]);return Xr(e,a,c,n?.class,n?.className)},qi=(e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r<e.length;r++)n[r]=e[r];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},Ki=(e,t)=>({classGroupId:e,validator:t}),is=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),yn="-",Zr=[],Xi="arbitrary..",Zi=e=>{const t=Qi(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:a=>{if(a.startsWith("[")&&a.endsWith("]"))return Ji(a);const i=a.split(yn),c=i[0]===""&&i.length>1?1:0;return ls(i,c,t)},getConflictingClassGroupIds:(a,i)=>{if(i){const c=r[a],l=n[a];return c?l?qi(l,c):c:l||Zr}return n[a]||Zr}}},ls=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const o=e[t],s=n.nextPart.get(o);if(s){const l=ls(e,t+1,s);if(l)return l}const a=n.validators;if(a===null)return;const i=t===0?e.join(yn):e.slice(t).join(yn),c=a.length;for(let l=0;l<c;l++){const d=a[l];if(d.validator(i))return d.classGroupId}},Ji=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?Xi+r:void 0})(),Qi=e=>{const{theme:t,classGroups:n}=e;return el(n,t)},el=(e,t)=>{const n=is();for(const r in e){const o=e[r];kr(o,n,r,t)}return n},kr=(e,t,n,r)=>{const o=e.length;for(let s=0;s<o;s++){const a=e[s];tl(a,t,n,r)}},tl=(e,t,n,r)=>{if(typeof e=="string"){nl(e,t,n);return}if(typeof e=="function"){rl(e,t,n,r);return}ol(e,t,n,r)},nl=(e,t,n)=>{const r=e===""?t:cs(t,e);r.classGroupId=n},rl=(e,t,n,r)=>{if(sl(e)){kr(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(Ki(n,e))},ol=(e,t,n,r)=>{const o=Object.entries(e),s=o.length;for(let a=0;a<s;a++){const[i,c]=o[a];kr(c,cs(t,i),n,r)}},cs=(e,t)=>{let n=e;const r=t.split(yn),o=r.length;for(let s=0;s<o;s++){const a=r[s];let i=n.nextPart.get(a);i||(i=is(),n.nextPart.set(a,i)),n=i}return n},sl=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,al=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const o=(s,a)=>{n[s]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(s){let a=n[s];if(a!==void 0)return a;if((a=r[s])!==void 0)return o(s,a),a},set(s,a){s in n?n[s]=a:o(s,a)}}},mr="!",Jr=":",il=[],Qr=(e,t,n,r,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:o}),ll=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=o=>{const s=[];let a=0,i=0,c=0,l;const d=o.length;for(let m=0;m<d;m++){const v=o[m];if(a===0&&i===0){if(v===Jr){s.push(o.slice(c,m)),c=m+1;continue}if(v==="/"){l=m;continue}}v==="["?a++:v==="]"?a--:v==="("?i++:v===")"&&i--}const f=s.length===0?o:o.slice(c);let p=f,g=!1;f.endsWith(mr)?(p=f.slice(0,-1),g=!0):f.startsWith(mr)&&(p=f.slice(1),g=!0);const h=l&&l>c?l-c:void 0;return Qr(s,g,p,h)};if(t){const o=t+Jr,s=r;r=a=>a.startsWith(o)?s(a.slice(o.length)):Qr(il,!1,a,void 0,!0)}if(n){const o=r;r=s=>n({className:s,parseClassName:o})}return r},cl=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let o=[];for(let s=0;s<n.length;s++){const a=n[s],i=a[0]==="[",c=t.has(a);i||c?(o.length>0&&(o.sort(),r.push(...o),o=[]),r.push(a)):o.push(a)}return o.length>0&&(o.sort(),r.push(...o)),r}},ul=e=>({cache:al(e.cacheSize),parseClassName:ll(e),sortModifiers:cl(e),...Zi(e)}),dl=/\s+/,fl=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o,sortModifiers:s}=t,a=[],i=e.trim().split(dl);let c="";for(let l=i.length-1;l>=0;l-=1){const d=i[l],{isExternal:f,modifiers:p,hasImportantModifier:g,baseClassName:h,maybePostfixModifierPosition:m}=n(d);if(f){c=d+(c.length>0?" "+c:c);continue}let v=!!m,y=r(v?h.substring(0,m):h);if(!y){if(!v){c=d+(c.length>0?" "+c:c);continue}if(y=r(h),!y){c=d+(c.length>0?" "+c:c);continue}v=!1}const S=p.length===0?"":p.length===1?p[0]:s(p).join(":"),R=g?S+mr:S,b=R+y;if(a.indexOf(b)>-1)continue;a.push(b);const O=o(y,v);for(let D=0;D<O.length;++D){const w=O[D];a.push(R+w)}c=d+(c.length>0?" "+c:c)}return c},pl=(...e)=>{let t=0,n,r,o="";for(;t<e.length;)(n=e[t++])&&(r=us(n))&&(o&&(o+=" "),o+=r);return o},us=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=us(e[r]))&&(n&&(n+=" "),n+=t);return n},ml=(e,...t)=>{let n,r,o,s;const a=c=>{const l=t.reduce((d,f)=>f(d),e());return n=ul(l),r=n.cache.get,o=n.cache.set,s=i,i(c)},i=c=>{const l=r(c);if(l)return l;const d=fl(c,n);return o(c,d),d};return s=a,(...c)=>s(pl(...c))},gl=[],ye=e=>{const t=n=>n[e]||gl;return t.isThemeGetter=!0,t},ds=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,fs=/^\((?:(\w[\w-]*):)?(.+)\)$/i,hl=/^\d+\/\d+$/,vl=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,bl=/\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$/,yl=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,wl=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,El=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,mt=e=>hl.test(e),X=e=>!!e&&!Number.isNaN(Number(e)),Ye=e=>!!e&&Number.isInteger(Number(e)),Bn=e=>e.endsWith("%")&&X(e.slice(0,-1)),We=e=>vl.test(e),xl=()=>!0,Sl=e=>bl.test(e)&&!yl.test(e),ps=()=>!1,Rl=e=>wl.test(e),Cl=e=>El.test(e),Tl=e=>!P(e)&&!A(e),Ol=e=>Rt(e,hs,ps),P=e=>ds.test(e),ot=e=>Rt(e,vs,Sl),Wn=e=>Rt(e,Pl,X),eo=e=>Rt(e,ms,ps),kl=e=>Rt(e,gs,Cl),Xt=e=>Rt(e,bs,Rl),A=e=>fs.test(e),It=e=>Ct(e,vs),Dl=e=>Ct(e,Al),to=e=>Ct(e,ms),Nl=e=>Ct(e,hs),Il=e=>Ct(e,gs),Zt=e=>Ct(e,bs,!0),Rt=(e,t,n)=>{const r=ds.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Ct=(e,t,n=!1)=>{const r=fs.exec(e);return r?r[1]?t(r[1]):n:!1},ms=e=>e==="position"||e==="percentage",gs=e=>e==="image"||e==="url",hs=e=>e==="length"||e==="size"||e==="bg-size",vs=e=>e==="length",Pl=e=>e==="number",Al=e=>e==="family-name",bs=e=>e==="shadow",_l=()=>{const e=ye("color"),t=ye("font"),n=ye("text"),r=ye("font-weight"),o=ye("tracking"),s=ye("leading"),a=ye("breakpoint"),i=ye("container"),c=ye("spacing"),l=ye("radius"),d=ye("shadow"),f=ye("inset-shadow"),p=ye("text-shadow"),g=ye("drop-shadow"),h=ye("blur"),m=ye("perspective"),v=ye("aspect"),y=ye("ease"),S=ye("animate"),R=()=>["auto","avoid","all","avoid-page","page","left","right","column"],b=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],O=()=>[...b(),A,P],D=()=>["auto","hidden","clip","visible","scroll"],w=()=>["auto","contain","none"],E=()=>[A,P,c],I=()=>[mt,"full","auto",...E()],z=()=>[Ye,"none","subgrid",A,P],Y=()=>["auto",{span:["full",Ye,A,P]},Ye,A,P],Z=()=>[Ye,"auto",A,P],_=()=>["auto","min","max","fr",A,P],te=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],F=()=>["start","end","center","stretch","center-safe","end-safe"],ee=()=>["auto",...E()],re=()=>[mt,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...E()],N=()=>[e,A,P],ue=()=>[...b(),to,eo,{position:[A,P]}],xe=()=>["no-repeat",{repeat:["","x","y","space","round"]}],C=()=>["auto","cover","contain",Nl,Ol,{size:[A,P]}],V=()=>[Bn,It,ot],L=()=>["","none","full",l,A,P],q=()=>["",X,It,ot],ge=()=>["solid","dashed","dotted","double"],Re=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],B=()=>[X,Bn,to,eo],W=()=>["","none",h,A,P],de=()=>["none",X,A,P],be=()=>["none",X,A,P],T=()=>[X,A,P],K=()=>[mt,"full",...E()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[We],breakpoint:[We],color:[xl],container:[We],"drop-shadow":[We],ease:["in","out","in-out"],font:[Tl],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[We],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[We],shadow:[We],spacing:["px",X],text:[We],"text-shadow":[We],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",mt,P,A,v]}],container:["container"],columns:[{columns:[X,P,A,i]}],"break-after":[{"break-after":R()}],"break-before":[{"break-before":R()}],"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:O()}],overflow:[{overflow:D()}],"overflow-x":[{"overflow-x":D()}],"overflow-y":[{"overflow-y":D()}],overscroll:[{overscroll:w()}],"overscroll-x":[{"overscroll-x":w()}],"overscroll-y":[{"overscroll-y":w()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:I()}],"inset-x":[{"inset-x":I()}],"inset-y":[{"inset-y":I()}],start:[{start:I()}],end:[{end:I()}],top:[{top:I()}],right:[{right:I()}],bottom:[{bottom:I()}],left:[{left:I()}],visibility:["visible","invisible","collapse"],z:[{z:[Ye,"auto",A,P]}],basis:[{basis:[mt,"full","auto",i,...E()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[X,mt,"auto","initial","none",P]}],grow:[{grow:["",X,A,P]}],shrink:[{shrink:["",X,A,P]}],order:[{order:[Ye,"first","last","none",A,P]}],"grid-cols":[{"grid-cols":z()}],"col-start-end":[{col:Y()}],"col-start":[{"col-start":Z()}],"col-end":[{"col-end":Z()}],"grid-rows":[{"grid-rows":z()}],"row-start-end":[{row:Y()}],"row-start":[{"row-start":Z()}],"row-end":[{"row-end":Z()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":_()}],"auto-rows":[{"auto-rows":_()}],gap:[{gap:E()}],"gap-x":[{"gap-x":E()}],"gap-y":[{"gap-y":E()}],"justify-content":[{justify:[...te(),"normal"]}],"justify-items":[{"justify-items":[...F(),"normal"]}],"justify-self":[{"justify-self":["auto",...F()]}],"align-content":[{content:["normal",...te()]}],"align-items":[{items:[...F(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...F(),{baseline:["","last"]}]}],"place-content":[{"place-content":te()}],"place-items":[{"place-items":[...F(),"baseline"]}],"place-self":[{"place-self":["auto",...F()]}],p:[{p:E()}],px:[{px:E()}],py:[{py:E()}],ps:[{ps:E()}],pe:[{pe:E()}],pt:[{pt:E()}],pr:[{pr:E()}],pb:[{pb:E()}],pl:[{pl:E()}],m:[{m:ee()}],mx:[{mx:ee()}],my:[{my:ee()}],ms:[{ms:ee()}],me:[{me:ee()}],mt:[{mt:ee()}],mr:[{mr:ee()}],mb:[{mb:ee()}],ml:[{ml:ee()}],"space-x":[{"space-x":E()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":E()}],"space-y-reverse":["space-y-reverse"],size:[{size:re()}],w:[{w:[i,"screen",...re()]}],"min-w":[{"min-w":[i,"screen","none",...re()]}],"max-w":[{"max-w":[i,"screen","none","prose",{screen:[a]},...re()]}],h:[{h:["screen","lh",...re()]}],"min-h":[{"min-h":["screen","lh","none",...re()]}],"max-h":[{"max-h":["screen","lh",...re()]}],"font-size":[{text:["base",n,It,ot]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,A,Wn]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Bn,P]}],"font-family":[{font:[Dl,P,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:[o,A,P]}],"line-clamp":[{"line-clamp":[X,"none",A,Wn]}],leading:[{leading:[s,...E()]}],"list-image":[{"list-image":["none",A,P]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",A,P]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:N()}],"text-color":[{text:N()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ge(),"wavy"]}],"text-decoration-thickness":[{decoration:[X,"from-font","auto",A,ot]}],"text-decoration-color":[{decoration:N()}],"underline-offset":[{"underline-offset":[X,"auto",A,P]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:E()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",A,P]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",A,P]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:ue()}],"bg-repeat":[{bg:xe()}],"bg-size":[{bg:C()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Ye,A,P],radial:["",A,P],conic:[Ye,A,P]},Il,kl]}],"bg-color":[{bg:N()}],"gradient-from-pos":[{from:V()}],"gradient-via-pos":[{via:V()}],"gradient-to-pos":[{to:V()}],"gradient-from":[{from:N()}],"gradient-via":[{via:N()}],"gradient-to":[{to:N()}],rounded:[{rounded:L()}],"rounded-s":[{"rounded-s":L()}],"rounded-e":[{"rounded-e":L()}],"rounded-t":[{"rounded-t":L()}],"rounded-r":[{"rounded-r":L()}],"rounded-b":[{"rounded-b":L()}],"rounded-l":[{"rounded-l":L()}],"rounded-ss":[{"rounded-ss":L()}],"rounded-se":[{"rounded-se":L()}],"rounded-ee":[{"rounded-ee":L()}],"rounded-es":[{"rounded-es":L()}],"rounded-tl":[{"rounded-tl":L()}],"rounded-tr":[{"rounded-tr":L()}],"rounded-br":[{"rounded-br":L()}],"rounded-bl":[{"rounded-bl":L()}],"border-w":[{border:q()}],"border-w-x":[{"border-x":q()}],"border-w-y":[{"border-y":q()}],"border-w-s":[{"border-s":q()}],"border-w-e":[{"border-e":q()}],"border-w-t":[{"border-t":q()}],"border-w-r":[{"border-r":q()}],"border-w-b":[{"border-b":q()}],"border-w-l":[{"border-l":q()}],"divide-x":[{"divide-x":q()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":q()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ge(),"hidden","none"]}],"divide-style":[{divide:[...ge(),"hidden","none"]}],"border-color":[{border:N()}],"border-color-x":[{"border-x":N()}],"border-color-y":[{"border-y":N()}],"border-color-s":[{"border-s":N()}],"border-color-e":[{"border-e":N()}],"border-color-t":[{"border-t":N()}],"border-color-r":[{"border-r":N()}],"border-color-b":[{"border-b":N()}],"border-color-l":[{"border-l":N()}],"divide-color":[{divide:N()}],"outline-style":[{outline:[...ge(),"none","hidden"]}],"outline-offset":[{"outline-offset":[X,A,P]}],"outline-w":[{outline:["",X,It,ot]}],"outline-color":[{outline:N()}],shadow:[{shadow:["","none",d,Zt,Xt]}],"shadow-color":[{shadow:N()}],"inset-shadow":[{"inset-shadow":["none",f,Zt,Xt]}],"inset-shadow-color":[{"inset-shadow":N()}],"ring-w":[{ring:q()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:N()}],"ring-offset-w":[{"ring-offset":[X,ot]}],"ring-offset-color":[{"ring-offset":N()}],"inset-ring-w":[{"inset-ring":q()}],"inset-ring-color":[{"inset-ring":N()}],"text-shadow":[{"text-shadow":["none",p,Zt,Xt]}],"text-shadow-color":[{"text-shadow":N()}],opacity:[{opacity:[X,A,P]}],"mix-blend":[{"mix-blend":[...Re(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Re()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[X]}],"mask-image-linear-from-pos":[{"mask-linear-from":B()}],"mask-image-linear-to-pos":[{"mask-linear-to":B()}],"mask-image-linear-from-color":[{"mask-linear-from":N()}],"mask-image-linear-to-color":[{"mask-linear-to":N()}],"mask-image-t-from-pos":[{"mask-t-from":B()}],"mask-image-t-to-pos":[{"mask-t-to":B()}],"mask-image-t-from-color":[{"mask-t-from":N()}],"mask-image-t-to-color":[{"mask-t-to":N()}],"mask-image-r-from-pos":[{"mask-r-from":B()}],"mask-image-r-to-pos":[{"mask-r-to":B()}],"mask-image-r-from-color":[{"mask-r-from":N()}],"mask-image-r-to-color":[{"mask-r-to":N()}],"mask-image-b-from-pos":[{"mask-b-from":B()}],"mask-image-b-to-pos":[{"mask-b-to":B()}],"mask-image-b-from-color":[{"mask-b-from":N()}],"mask-image-b-to-color":[{"mask-b-to":N()}],"mask-image-l-from-pos":[{"mask-l-from":B()}],"mask-image-l-to-pos":[{"mask-l-to":B()}],"mask-image-l-from-color":[{"mask-l-from":N()}],"mask-image-l-to-color":[{"mask-l-to":N()}],"mask-image-x-from-pos":[{"mask-x-from":B()}],"mask-image-x-to-pos":[{"mask-x-to":B()}],"mask-image-x-from-color":[{"mask-x-from":N()}],"mask-image-x-to-color":[{"mask-x-to":N()}],"mask-image-y-from-pos":[{"mask-y-from":B()}],"mask-image-y-to-pos":[{"mask-y-to":B()}],"mask-image-y-from-color":[{"mask-y-from":N()}],"mask-image-y-to-color":[{"mask-y-to":N()}],"mask-image-radial":[{"mask-radial":[A,P]}],"mask-image-radial-from-pos":[{"mask-radial-from":B()}],"mask-image-radial-to-pos":[{"mask-radial-to":B()}],"mask-image-radial-from-color":[{"mask-radial-from":N()}],"mask-image-radial-to-color":[{"mask-radial-to":N()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[X]}],"mask-image-conic-from-pos":[{"mask-conic-from":B()}],"mask-image-conic-to-pos":[{"mask-conic-to":B()}],"mask-image-conic-from-color":[{"mask-conic-from":N()}],"mask-image-conic-to-color":[{"mask-conic-to":N()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:ue()}],"mask-repeat":[{mask:xe()}],"mask-size":[{mask:C()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",A,P]}],filter:[{filter:["","none",A,P]}],blur:[{blur:W()}],brightness:[{brightness:[X,A,P]}],contrast:[{contrast:[X,A,P]}],"drop-shadow":[{"drop-shadow":["","none",g,Zt,Xt]}],"drop-shadow-color":[{"drop-shadow":N()}],grayscale:[{grayscale:["",X,A,P]}],"hue-rotate":[{"hue-rotate":[X,A,P]}],invert:[{invert:["",X,A,P]}],saturate:[{saturate:[X,A,P]}],sepia:[{sepia:["",X,A,P]}],"backdrop-filter":[{"backdrop-filter":["","none",A,P]}],"backdrop-blur":[{"backdrop-blur":W()}],"backdrop-brightness":[{"backdrop-brightness":[X,A,P]}],"backdrop-contrast":[{"backdrop-contrast":[X,A,P]}],"backdrop-grayscale":[{"backdrop-grayscale":["",X,A,P]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[X,A,P]}],"backdrop-invert":[{"backdrop-invert":["",X,A,P]}],"backdrop-opacity":[{"backdrop-opacity":[X,A,P]}],"backdrop-saturate":[{"backdrop-saturate":[X,A,P]}],"backdrop-sepia":[{"backdrop-sepia":["",X,A,P]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":E()}],"border-spacing-x":[{"border-spacing-x":E()}],"border-spacing-y":[{"border-spacing-y":E()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",A,P]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[X,"initial",A,P]}],ease:[{ease:["linear","initial",y,A,P]}],delay:[{delay:[X,A,P]}],animate:[{animate:["none",S,A,P]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[m,A,P]}],"perspective-origin":[{"perspective-origin":O()}],rotate:[{rotate:de()}],"rotate-x":[{"rotate-x":de()}],"rotate-y":[{"rotate-y":de()}],"rotate-z":[{"rotate-z":de()}],scale:[{scale:be()}],"scale-x":[{"scale-x":be()}],"scale-y":[{"scale-y":be()}],"scale-z":[{"scale-z":be()}],"scale-3d":["scale-3d"],skew:[{skew:T()}],"skew-x":[{"skew-x":T()}],"skew-y":[{"skew-y":T()}],transform:[{transform:[A,P,"","none","gpu","cpu"]}],"transform-origin":[{origin:O()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:K()}],"translate-x":[{"translate-x":K()}],"translate-y":[{"translate-y":K()}],"translate-z":[{"translate-z":K()}],"translate-none":["translate-none"],accent:[{accent:N()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:N()}],"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",A,P]}],"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":E()}],"scroll-mx":[{"scroll-mx":E()}],"scroll-my":[{"scroll-my":E()}],"scroll-ms":[{"scroll-ms":E()}],"scroll-me":[{"scroll-me":E()}],"scroll-mt":[{"scroll-mt":E()}],"scroll-mr":[{"scroll-mr":E()}],"scroll-mb":[{"scroll-mb":E()}],"scroll-ml":[{"scroll-ml":E()}],"scroll-p":[{"scroll-p":E()}],"scroll-px":[{"scroll-px":E()}],"scroll-py":[{"scroll-py":E()}],"scroll-ps":[{"scroll-ps":E()}],"scroll-pe":[{"scroll-pe":E()}],"scroll-pt":[{"scroll-pt":E()}],"scroll-pr":[{"scroll-pr":E()}],"scroll-pb":[{"scroll-pb":E()}],"scroll-pl":[{"scroll-pl":E()}],"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",A,P]}],fill:[{fill:["none",...N()]}],"stroke-w":[{stroke:[X,It,ot,Wn]}],stroke:[{stroke:["none",...N()]}],"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-x","border-w-y","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-x","border-color-y","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:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},Ml=ml(_l);function ke(...e){return Ml(as(e))}const Ll=Yi("focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 rounded-lg border border-transparent bg-clip-padding text-sm font-medium focus-visible:ring-[3px] aria-invalid:ring-[3px] [&_svg:not([class*='size-'])]:size-4 inline-flex items-center justify-center whitespace-nowrap transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none shrink-0 [&_svg]:shrink-0 outline-none group/button select-none",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",outline:"border-border bg-background hover:bg-muted hover:text-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50 aria-expanded:bg-muted aria-expanded:text-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",ghost:"hover:bg-muted hover:text-foreground dark:hover:bg-muted/50 aria-expanded:bg-muted aria-expanded:text-foreground",destructive:"bg-destructive/10 hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/20 text-destructive focus-visible:border-destructive/40 dark:hover:bg-destructive/30",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",xs:"h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",lg:"h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3",icon:"size-8","icon-xs":"size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg","icon-lg":"size-9"}},defaultVariants:{variant:"default",size:"default"}});function ct({className:e,variant:t="default",size:n="default",...r}){return x.jsx(os,{"data-slot":"button",className:ke(Ll({variant:t,size:n,className:e})),...r})}const Dr=u.createContext(void 0);process.env.NODE_ENV!=="production"&&(Dr.displayName="DialogRootContext");function Qe(e){const t=u.useContext(Dr);if(e===!1&&t===void 0)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: DialogRootContext is missing. Dialog parts must be placed within <Dialog.Root>.":dt(27));return t}let wn=(function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e})({});const jl={[wn.startingStyle]:""},Fl={[wn.endingStyle]:""},ys={transitionStatus(e){return e==="starting"?jl:e==="ending"?Fl:null}};let lt=(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=wn.startingStyle]="startingStyle",e[e.endingStyle=wn.endingStyle]="endingStyle",e.anchorHidden="data-anchor-hidden",e})({}),$l=(function(e){return e.popupOpen="data-popup-open",e.pressed="data-pressed",e})({});const Vl={[$l.popupOpen]:""},Bl={[lt.open]:""},Wl={[lt.closed]:""},zl={[lt.anchorHidden]:""},Ul={open(e){return e?Vl:null}},ws={open(e){return e?Bl:Wl},anchorHidden(e){return e?zl:null}},Hl={...ws,...ys},Es=u.forwardRef(function(t,n){const{render:r,className:o,forceRender:s=!1,...a}=t,{store:i}=Qe(),c=i.useState("open"),l=i.useState("nested"),d=i.useState("mounted"),f=i.useState("transitionStatus"),p=u.useMemo(()=>({open:c,transitionStatus:f}),[c,f]);return Je("div",t,{state:p,ref:[i.context.backdropRef,n],stateAttributesMapping:Hl,props:[{role:"presentation",hidden:!d,style:{userSelect:"none",WebkitUserSelect:"none"}},a],enabled:s||!l})});process.env.NODE_ENV!=="production"&&(Es.displayName="DialogBackdrop");const Gl="none",Ft="trigger-press",Yl="trigger-hover",xs="outside-press",ql="close-press",Ss="focus-out",Kl="escape-key",Xl="imperative-action";function Pe(e,t,n,r){let o=!1,s=!1;const a=Ie;return{reason:e,event:t??new Event("base-ui"),cancel(){o=!0},allowPropagation(){s=!0},get isCanceled(){return o},get isPropagationAllowed(){return s},trigger:n,...a}}const Nr=u.forwardRef(function(t,n){const{render:r,className:o,disabled:s=!1,nativeButton:a=!0,...i}=t,{store:c}=Qe(),l=c.useState("open");function d(h){l&&c.setOpen(!1,Pe(ql,h.nativeEvent))}const{getButtonProps:f,buttonRef:p}=Tr({disabled:s,native:a}),g=u.useMemo(()=>({disabled:s}),[s]);return Je("button",t,{state:g,ref:[n,p],props:[{onClick:d},i,f]})});process.env.NODE_ENV!=="production"&&(Nr.displayName="DialogClose");const Zl={...u};let no=0;function Jl(e,t="mui"){const[n,r]=u.useState(e),o=e||n;return u.useEffect(()=>{n==null&&(no+=1,r(`${t}-${no}`))},[n,t]),o}const ro=Zl.useId;function Pn(e,t){if(ro!==void 0){const n=ro();return e??(t?`${t}-${n}`:n)}return Jl(e,t)}function Ir(e){return Pn(e,"base-ui")}const Rs=u.forwardRef(function(t,n){const{render:r,className:o,id:s,...a}=t,{store:i}=Qe(),c=Ir(s);return i.useSyncedValueWithCleanup("descriptionElementId",c),Je("p",t,{ref:n,props:[{id:c},a]})});process.env.NODE_ENV!=="production"&&(Rs.displayName="DialogDescription");const Ql=[];function Cs(e){u.useEffect(e,Ql)}const Pt=0;class xt{static create(){return new xt}currentId=Pt;start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=Pt,n()},t)}isStarted(){return this.currentId!==Pt}clear=()=>{this.currentId!==Pt&&(clearTimeout(this.currentId),this.currentId=Pt)};disposeEffect=()=>this.clear}function Wt(){const e=Ze(xt.create).current;return Cs(e.disposeEffect),e}function Mt(e){const t=Ze(ec,e).current;return t.next=e,Ee(t.effect),t}function ec(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}const Tt=typeof navigator<"u",zn=sc(),Ts=ic(),Os=ac(),tc=typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter:none"),nc=zn.platform==="MacIntel"&&zn.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(zn.platform),rc=Tt&&/apple/i.test(navigator.vendor),gr=Tt&&/android/i.test(Ts)||/android/i.test(Os);Tt&&Ts.toLowerCase().startsWith("mac")&&navigator.maxTouchPoints;const oc=Os.includes("jsdom/");function sc(){if(!Tt)return{platform:"",maxTouchPoints:-1};const e=navigator.userAgentData;return e?.platform?{platform:e.platform,maxTouchPoints:navigator.maxTouchPoints}:{platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??-1}}function ac(){if(!Tt)return"";const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:t,version:n})=>`${t}/${n}`).join(" "):navigator.userAgent}function ic(){if(!Tt)return"";const e=navigator.userAgentData;return e?.platform?e.platform:navigator.platform??""}const hr="data-base-ui-focusable",ks="active",Ds="selected",lc="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function bt(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function he(e,t){if(!e||!t)return!1;const n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&cr(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function Me(e){return"composedPath"in e?e.composedPath()[0]:e.target}function _e(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function cc(e){return e.matches("html,body")}function Ne(e){return e?.ownerDocument||document}function Ns(e){return ze(e)&&e.matches(lc)}function oo(e){return e?e.getAttribute("role")==="combobox"&&Ns(e):!1}function vr(e){return e?e.hasAttribute(hr)?e:e.querySelector(`[${hr}]`)||e:null}function yt(e,t,n=!0){return e.filter(o=>o.parentId===t&&(!n||o.context?.open)).flatMap(o=>[o,...yt(e,o.id,n)])}function so(e,t){let n=[],r=e.find(o=>o.id===t)?.parentId;for(;r;){const o=e.find(s=>s.id===r);r=o?.parentId,o&&(n=n.concat(o))}return n}function uc(e){e.preventDefault(),e.stopPropagation()}function dc(e){return"nativeEvent"in e}function fc(e){return e.mozInputSource===0&&e.isTrusted?!0:gr&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function pc(e){return oc?!1:!gr&&e.width===0&&e.height===0||gr&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function ao(e,t){return["mouse","pen"].includes(e)}function Is(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}var mc=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],En=mc.join(","),Ps=typeof Element>"u",St=Ps?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,xn=!Ps&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e?.ownerDocument},Sn=function(t,n){var r;n===void 0&&(n=!0);var o=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"inert"),s=o===""||o==="true",a=s||n&&t&&(typeof t.closest=="function"?t.closest("[inert]"):Sn(t.parentNode));return a},gc=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},As=function(t,n,r){if(Sn(t))return[];var o=Array.prototype.slice.apply(t.querySelectorAll(En));return n&&St.call(t,En)&&o.unshift(t),o=o.filter(r),o},Rn=function(t,n,r){for(var o=[],s=Array.from(t);s.length;){var a=s.shift();if(!Sn(a,!1))if(a.tagName==="SLOT"){var i=a.assignedElements(),c=i.length?i:a.children,l=Rn(c,!0,r);r.flatten?o.push.apply(o,l):o.push({scopeParent:a,candidates:l})}else{var d=St.call(a,En);d&&r.filter(a)&&(n||!t.includes(a))&&o.push(a);var f=a.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(a),p=!Sn(f,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(a));if(f&&p){var g=Rn(f===!0?a.children:f.children,!0,r);r.flatten?o.push.apply(o,g):o.push({scopeParent:a,candidates:g})}else s.unshift.apply(s,a.children)}}return o},_s=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},Ms=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||gc(t))&&!_s(t)?0:t.tabIndex},hc=function(t,n){var r=Ms(t);return r<0&&n&&!_s(t)?0:r},vc=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},Ls=function(t){return t.tagName==="INPUT"},bc=function(t){return Ls(t)&&t.type==="hidden"},yc=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},wc=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},Ec=function(t){if(!t.name)return!0;var n=t.form||xn(t),r=function(i){return n.querySelectorAll('input[type="radio"][name="'+i+'"]')},o;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")o=r(window.CSS.escape(t.name));else try{o=r(t.name)}catch(a){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",a.message),!1}var s=wc(o,t.form);return!s||s===t},xc=function(t){return Ls(t)&&t.type==="radio"},Sc=function(t){return xc(t)&&!Ec(t)},Rc=function(t){var n,r=t&&xn(t),o=(n=r)===null||n===void 0?void 0:n.host,s=!1;if(r&&r!==t){var a,i,c;for(s=!!((a=o)!==null&&a!==void 0&&(i=a.ownerDocument)!==null&&i!==void 0&&i.contains(o)||t!=null&&(c=t.ownerDocument)!==null&&c!==void 0&&c.contains(t));!s&&o;){var l,d,f;r=xn(o),o=(l=r)===null||l===void 0?void 0:l.host,s=!!((d=o)!==null&&d!==void 0&&(f=d.ownerDocument)!==null&&f!==void 0&&f.contains(o))}}return s},io=function(t){var n=t.getBoundingClientRect(),r=n.width,o=n.height;return r===0&&o===0},Cc=function(t,n){var r=n.displayCheck,o=n.getShadowRoot;if(r==="full-native"&&"checkVisibility"in t){var s=t.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!s}if(getComputedStyle(t).visibility==="hidden")return!0;var a=St.call(t,"details>summary:first-of-type"),i=a?t.parentElement:t;if(St.call(i,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="full-native"||r==="legacy-full"){if(typeof o=="function"){for(var c=t;t;){var l=t.parentElement,d=xn(t);if(l&&!l.shadowRoot&&o(l)===!0)return io(t);t.assignedSlot?t=t.assignedSlot:!l&&d!==t.ownerDocument?t=d.host:t=l}t=c}if(Rc(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return io(t);return!1},Tc=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r<n.children.length;r++){var o=n.children.item(r);if(o.tagName==="LEGEND")return St.call(n,"fieldset[disabled] *")?!0:!o.contains(t)}return!0}n=n.parentElement}return!1},br=function(t,n){return!(n.disabled||bc(n)||Cc(n,t)||yc(n)||Tc(n))},yr=function(t,n){return!(Sc(n)||Ms(n)<0||!br(t,n))},Oc=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},js=function(t){var n=[],r=[];return t.forEach(function(o,s){var a=!!o.scopeParent,i=a?o.scopeParent:o,c=hc(i,a),l=a?js(o.candidates):i;c===0?a?n.push.apply(n,l):n.push(i):r.push({documentOrder:s,tabIndex:c,item:o,isScope:a,content:l})}),r.sort(vc).reduce(function(o,s){return s.isScope?o.push.apply(o,s.content):o.push(s.content),o},[]).concat(n)},An=function(t,n){n=n||{};var r;return n.getShadowRoot?r=Rn([t],n.includeContainer,{filter:yr.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:Oc}):r=As(t,n.includeContainer,yr.bind(null,n)),js(r)},kc=function(t,n){n=n||{};var r;return n.getShadowRoot?r=Rn([t],n.includeContainer,{filter:br.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):r=As(t,n.includeContainer,br.bind(null,n)),r},Fs=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return St.call(t,En)===!1?!1:yr(n,t)};const Gt=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function $s(e,t){const n=An(e,Gt()),r=n.length;if(r===0)return;const o=bt(Ne(e)),s=n.indexOf(o),a=s===-1?t===1?0:r-1:s+t;return n[a]}function Vs(e){return $s(Ne(e).body,1)||e}function Bs(e){return $s(Ne(e).body,-1)||e}function $t(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!he(n,r)}function Dc(e){An(e,Gt()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function lo(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}function Nc(){const e=new Map;return{emit(t,n){e.get(t)?.forEach(r=>r(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}const Ws=u.createContext(null);process.env.NODE_ENV!=="production"&&(Ws.displayName="FloatingNodeContext");const zs=u.createContext(null);process.env.NODE_ENV!=="production"&&(zs.displayName="FloatingTreeContext");const Us=()=>u.useContext(Ws)?.id||null,Hs=e=>{const t=u.useContext(zs);return e??t};function Cn(e){return`data-base-ui-${e}`}const Gs={clip:"rect(0 0 0 0)",overflow:"hidden",whiteSpace:"nowrap",position:"fixed",top:0,left:0,border:0,padding:0,width:1,height:1,margin:-1},Jt=null;let co=globalThis.requestAnimationFrame;class Ic{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=t=>{this.isScheduled=!1;const n=this.callbacks,r=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,r>0)for(let o=0;o<n.length;o+=1)n[o]?.(t)};request(t){const n=this.nextId;this.nextId+=1,this.callbacks.push(t),this.callbacksCount+=1;const r=process.env.NODE_ENV==="test"&&co!==requestAnimationFrame&&(co=requestAnimationFrame,!0);return(!this.isScheduled||r)&&(requestAnimationFrame(this.tick),this.isScheduled=!0),n}cancel(t){const n=t-this.startId;n<0||n>=this.callbacks.length||(this.callbacks[n]=null,this.callbacksCount-=1)}}const Qt=new Ic;class Fe{static create(){return new Fe}static request(t){return Qt.request(t)}static cancel(t){return Qt.cancel(t)}currentId=Jt;request(t){this.cancel(),this.currentId=Qt.request(()=>{this.currentId=Jt,t()})}cancel=()=>{this.currentId!==Jt&&(Qt.cancel(this.currentId),this.currentId=Jt)};disposeEffect=()=>this.cancel}function Pr(){const e=Ze(Fe.create).current;return Cs(e.disposeEffect),e}function _n(e){return e?.ownerDocument||document}const zt=u.forwardRef(function(t,n){const[r,o]=u.useState();Ee(()=>{rc&&o("button")},[]);const s={tabIndex:0,role:r};return x.jsx("span",{...t,ref:n,style:Gs,"aria-hidden":r?void 0:!0,...s,"data-base-ui-focus-guard":""})});process.env.NODE_ENV!=="production"&&(zt.displayName="FocusGuard");let uo=0;function Un(e,t={}){const{preventScroll:n=!1,cancelPrevious:r=!0,sync:o=!1}=t;r&&cancelAnimationFrame(uo);const s=()=>e?.focus({preventScroll:n});o?s():uo=requestAnimationFrame(s)}const wt={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function fo(e){return e==="inert"?wt.inert:e==="aria-hidden"?wt["aria-hidden"]:wt.none}let en=new WeakSet,tn={},Hn=0;const Ys=e=>e&&(e.host||Ys(e.parentNode)),Pc=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=Ys(n);return e.contains(r)?r:null}).filter(n=>n!=null);function Ac(e,t,n,r){const o="data-base-ui-inert",s=r?"inert":n?"aria-hidden":null,a=Pc(t,e),i=new Set,c=new Set(a),l=[];tn[o]||(tn[o]=new WeakMap);const d=tn[o];a.forEach(f),p(t),i.clear();function f(g){!g||i.has(g)||(i.add(g),g.parentNode&&f(g.parentNode))}function p(g){!g||c.has(g)||[].forEach.call(g.children,h=>{if(Nn(h)!=="script")if(i.has(h))p(h);else{const m=s?h.getAttribute(s):null,v=m!==null&&m!=="false",y=fo(s),S=(y.get(h)||0)+1,R=(d.get(h)||0)+1;y.set(h,S),d.set(h,R),l.push(h),S===1&&v&&en.add(h),R===1&&h.setAttribute(o,""),!v&&s&&h.setAttribute(s,s==="inert"?"":"true")}})}return Hn+=1,()=>{l.forEach(g=>{const h=fo(s),v=(h.get(g)||0)-1,y=(d.get(g)||0)-1;h.set(g,v),d.set(g,y),v||(!en.has(g)&&s&&g.removeAttribute(s),en.delete(g)),y||g.removeAttribute(o)}),Hn-=1,Hn||(wt.inert=new WeakMap,wt["aria-hidden"]=new WeakMap,wt.none=new WeakMap,en=new WeakSet,tn={})}}function _c(e,t=!1,n=!1){const r=Ne(e[0]).body;return Ac(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,t,n)}const Ar=u.createContext(null);process.env.NODE_ENV!=="production"&&(Ar.displayName="PortalContext");const qs=()=>u.useContext(Ar),Mc=Cn("portal");function Lc(e={}){const{ref:t,container:n,componentProps:r=Ie,elementProps:o,elementState:s}=e,a=Pn(),c=qs()?.portalNode,[l,d]=u.useState(null),[f,p]=u.useState(null),g=u.useRef(null);Ee(()=>{if(n===null){g.current&&(g.current=null,p(null),d(null));return}if(a==null)return;const v=(n&&(Rr(n)?n:n.current))??c??document.body;if(v==null){g.current&&(g.current=null,p(null),d(null));return}g.current!==v&&(g.current=v,p(null),d(v))},[n,c,a]);const h=Je("div",r,{ref:[t,p],state:s,props:[{id:a,[Mc]:""},o]});return{portalNode:f,portalSubtree:l&&h?Bt.createPortal(h,l):null}}const Ks=u.forwardRef(function(t,n){const{children:r,container:o,className:s,render:a,renderGuards:i,...c}=t,{portalNode:l,portalSubtree:d}=Lc({container:o,ref:n,componentProps:t,elementProps:c}),f=u.useRef(null),p=u.useRef(null),g=u.useRef(null),h=u.useRef(null),[m,v]=u.useState(null),y=m?.modal,S=m?.open,R=typeof i=="boolean"?i:!!m&&!m.modal&&m.open&&!!l;u.useEffect(()=>{if(!l||y)return;function O(D){l&&$t(D)&&(D.type==="focusin"?lo:Dc)(l)}return l.addEventListener("focusin",O,!0),l.addEventListener("focusout",O,!0),()=>{l.removeEventListener("focusin",O,!0),l.removeEventListener("focusout",O,!0)}},[l,y]),u.useEffect(()=>{!l||S||lo(l)},[S,l]);const b=u.useMemo(()=>({beforeOutsideRef:f,afterOutsideRef:p,beforeInsideRef:g,afterInsideRef:h,portalNode:l,setFocusManagerState:v}),[l]);return x.jsxs(u.Fragment,{children:[d,x.jsxs(Ar.Provider,{value:b,children:[R&&l&&x.jsx(zt,{"data-type":"outside",ref:f,onFocus:O=>{if($t(O,l))g.current?.focus();else{const D=m?m.domReference:null;Bs(D)?.focus()}}}),R&&l&&x.jsx("span",{"aria-owns":l.id,style:zi}),l&&Bt.createPortal(r,l),R&&l&&x.jsx(zt,{"data-type":"outside",ref:p,onFocus:O=>{if($t(O,l))h.current?.focus();else{const D=m?m.domReference:null;Vs(D)?.focus(),m?.closeOnFocusOut&&m?.onOpenChange(!1,Pe(Ss,O.nativeEvent))}}})]})]})});process.env.NODE_ENV!=="production"&&(Ks.displayName="FloatingPortal");function it(e){return e==null?e:"current"in e?e.current:e}function jc(e,t){const n=Ve(e.target);return e instanceof n.KeyboardEvent?"keyboard":e instanceof n.FocusEvent?t||"keyboard":"pointerType"in e?e.pointerType||"keyboard":"touches"in e?"touch":e instanceof n.MouseEvent?t||(e.detail===0?"keyboard":"mouse"):""}const po=20;let Ke=[];function _r(){Ke=Ke.filter(e=>e.isConnected)}function Fc(e){_r(),e&&Nn(e)!=="body"&&(Ke.push(e),Ke.length>po&&(Ke=Ke.slice(-po)))}function Gn(){return _r(),Ke[Ke.length-1]}function $c(e){if(!e)return null;const t=Gt();return Fs(e,t)?e:An(e,t)[0]||e}function Vc(e){return!e||!e.isConnected?!1:typeof e.checkVisibility=="function"?e.checkVisibility():Cr(e).display!=="none"}function mo(e,t){if(!t.current.includes("floating")&&!e.getAttribute("role")?.includes("dialog"))return;const n=Gt(),o=kc(e,n).filter(a=>{const i=a.getAttribute("data-tabindex")||"";return Fs(a,n)||a.hasAttribute("data-tabindex")&&!i.startsWith("-")}),s=e.getAttribute("tabindex");t.current.includes("floating")||o.length===0?s!=="0"&&e.setAttribute("tabindex","0"):(s!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}function Bc(e){const{context:t,children:n,disabled:r=!1,order:o=["content"],initialFocus:s=!0,returnFocus:a=!0,restoreFocus:i=!1,modal:c=!0,closeOnFocusOut:l=!0,openInteractionType:d="",getInsideElements:f=()=>[],nextFocusableElement:p,previousFocusableElement:g,beforeContentFocusGuardRef:h,externalTree:m}=e,v="rootStore"in t?t.rootStore:t,y=v.useState("open"),S=v.useState("domReferenceElement"),R=v.useState("floatingElement"),{events:b,dataRef:O}=v.context,D=se(()=>O.current.floatingContext?.nodeId),w=se(f),E=s===!1,I=oo(S)&&E,z=Mt(o),Y=Mt(s),Z=Mt(a),_=Mt(d),te=Hs(m),F=qs(),ee=u.useRef(null),re=u.useRef(null),N=u.useRef(!1),ue=u.useRef(!1),xe=u.useRef(!1),C=u.useRef(-1),V=u.useRef(""),L=u.useRef(""),q=Wt(),ge=Wt(),Re=Pr(),B=F!=null,W=vr(R),de=se((j=W)=>j?An(j,Gt()):[]),be=se(j=>{const H=de(j);return z.current.map(()=>H).filter(Boolean).flat()});u.useEffect(()=>{if(r||!c)return;function j(fe){fe.key==="Tab"&&he(W,bt(Ne(W)))&&de().length===0&&!I&&uc(fe)}const H=Ne(W);return H.addEventListener("keydown",j),()=>{H.removeEventListener("keydown",j)}},[r,S,W,c,z,I,de,be]),u.useEffect(()=>{if(r||!R)return;function j(H){const fe=Me(H),oe=de().indexOf(fe);oe!==-1&&(C.current=oe)}return R.addEventListener("focusin",j),()=>{R.removeEventListener("focusin",j)}},[r,R,de]),u.useEffect(()=>{if(r||!y)return;const j=Ne(W);function H(){xe.current=!1}function fe(oe){const M=Me(oe),J=he(R,M)||he(S,M)||he(F?.portalNode,M);xe.current=!J,L.current=oe.pointerType||"keyboard"}function ae(){L.current="keyboard"}return j.addEventListener("pointerdown",fe,!0),j.addEventListener("pointerup",H,!0),j.addEventListener("pointercancel",H,!0),j.addEventListener("keydown",ae,!0),()=>{j.removeEventListener("pointerdown",fe,!0),j.removeEventListener("pointerup",H,!0),j.removeEventListener("pointercancel",H,!0),j.removeEventListener("keydown",ae,!0)}},[r,R,S,W,y,F]),u.useEffect(()=>{if(r||!l)return;function j(){ue.current=!0,ge.start(0,()=>{ue.current=!1})}function H(M){const J=M.relatedTarget,Ce=M.currentTarget,Te=Me(M);queueMicrotask(()=>{const Be=D(),pt=v.context.triggerElements,Ot=!(he(S,J)||he(R,J)||he(J,R)||he(F?.portalNode,J)||J!=null&&pt.hasElement(J)||pt.hasMatchingElement(Se=>he(Se,J))||J?.hasAttribute(Cn("focus-guard"))||te&&(yt(te.nodesRef.current,Be).find(Se=>he(Se.context?.elements.floating,J)||he(Se.context?.elements.domReference,J))||so(te.nodesRef.current,Be).find(Se=>[Se.context?.elements.floating,vr(Se.context?.elements.floating)].includes(J)||Se.context?.elements.domReference===J)));if(Ce===S&&W&&mo(W,z),i&&Ce!==S&&!Vc(Te)&&bt(Ne(W))===Ne(W).body){if(ze(W)&&(W.focus(),i==="popup")){Re.request(()=>{W.focus()});return}const Se=C.current,tt=de(),nt=tt[Se]||tt[tt.length-1]||W;ze(nt)&&nt.focus()}if(O.current.insideReactTree){O.current.insideReactTree=!1;return}(I||!c)&&J&&Ot&&!ue.current&&(I||J!==Gn())&&(N.current=!0,v.setOpen(!1,Pe(Ss,M)))})}function fe(){xe.current||(O.current.insideReactTree=!0,q.start(0,()=>{O.current.insideReactTree=!1}))}const ae=ze(S)?S:null,oe=[];if(!(!R&&!ae))return ae&&(ae.addEventListener("focusout",H),ae.addEventListener("pointerdown",j),oe.push(()=>{ae.removeEventListener("focusout",H),ae.removeEventListener("pointerdown",j)})),R&&(R.addEventListener("focusout",H),F&&(R.addEventListener("focusout",fe,!0),oe.push(()=>{R.removeEventListener("focusout",fe,!0)})),oe.push(()=>{R.removeEventListener("focusout",H)})),()=>{oe.forEach(M=>{M()})}},[r,S,R,W,c,te,F,v,l,i,de,I,D,z,O,q,ge,Re]);const T=u.useRef(null),K=u.useRef(null),U=bn(T,h,F?.beforeInsideRef),$=bn(K,F?.afterInsideRef);u.useEffect(()=>{if(r||!R||!y)return;const j=Array.from(F?.portalNode?.querySelectorAll(`[${Cn("portal")}]`)||[]),fe=(te?so(te.nodesRef.current,D()):[]).find(M=>oo(M.context?.elements.domReference||null))?.context?.elements.domReference,ae=[R,fe,...j,...w(),ee.current,re.current,T.current,K.current,F?.beforeOutsideRef.current,F?.afterOutsideRef.current,it(g),it(p),I?S:null].filter(M=>M!=null),oe=_c(ae,c||I);return()=>{oe()}},[y,r,S,R,c,z,F,I,te,D,w,p,g]),Ee(()=>{if(!y||r||!ze(W))return;const j=Ne(W),H=bt(j);queueMicrotask(()=>{const fe=be(W),ae=Y.current,oe=typeof ae=="function"?ae(_.current||""):ae;if(oe===void 0||oe===!1)return;let M;oe===!0||oe===null?M=fe[0]||W:M=it(oe),M=M||fe[0]||W,!he(W,H)&&Un(M,{preventScroll:M===W})})},[r,y,W,E,be,Y,_]),Ee(()=>{if(r||!W)return;const j=Ne(W),H=bt(j);Fc(H);function fe(M){if(M.open||(V.current=jc(M.nativeEvent,L.current)),M.reason===Yl&&M.nativeEvent.type==="mouseleave"&&(N.current=!0),M.reason===xs)if(M.nested)N.current=!1;else if(fc(M.nativeEvent)||pc(M.nativeEvent))N.current=!1;else{let J=!1;document.createElement("div").focus({get preventScroll(){return J=!0,!1}}),J?N.current=!1:N.current=!0}}b.on("openchange",fe);const ae=j.createElement("span");ae.setAttribute("tabindex","-1"),ae.setAttribute("aria-hidden","true"),Object.assign(ae.style,Gs),B&&S&&S.insertAdjacentElement("afterend",ae);function oe(){const M=Z.current;let J=typeof M=="function"?M(V.current):M;if(J===void 0||J===!1)return null;if(J===null&&(J=!0),typeof J=="boolean"){const Te=S||Gn();return Te&&Te.isConnected?Te:ae}const Ce=S||Gn()||ae;return it(J)||Ce}return()=>{b.off("openchange",fe);const M=bt(j),J=he(R,M)||te&&yt(te.nodesRef.current,D(),!1).some(Te=>he(Te.context?.elements.floating,M)),Ce=oe();queueMicrotask(()=>{const Te=$c(Ce),Be=typeof Z.current!="boolean";Z.current&&!N.current&&ze(Te)&&(!(!Be&&Te!==M&&M!==j.body)||J)&&Te.focus({preventScroll:!0}),ae.remove()})}},[r,R,W,Z,O,b,te,B,S,D]),u.useEffect(()=>{queueMicrotask(()=>{N.current=!1})},[r]),u.useEffect(()=>{if(r||!y)return;function j(fe){Me(fe)?.closest(`[${rs}]`)&&(ue.current=!0)}const H=Ne(W);return H.addEventListener("pointerdown",j,!0),()=>{H.removeEventListener("pointerdown",j,!0)}},[r,y,W]),Ee(()=>{if(!r&&F)return F.setFocusManagerState({modal:c,closeOnFocusOut:l,open:y,onOpenChange:v.setOpen,domReference:S}),()=>{F.setFocusManagerState(null)}},[r,F,c,y,v,l,S]),Ee(()=>{if(!(r||!W))return mo(W,z),()=>{queueMicrotask(_r)}},[r,W,z]);const Q=!r&&(c?!I:!0)&&(B||c);return x.jsxs(u.Fragment,{children:[Q&&x.jsx(zt,{"data-type":"inside",ref:U,onFocus:j=>{if(c){const H=be();Un(H[H.length-1])}else F?.portalNode&&(N.current=!1,$t(j,F.portalNode)?Vs(S)?.focus():it(g??F.beforeOutsideRef)?.focus())}}),n,Q&&x.jsx(zt,{"data-type":"inside",ref:$,onFocus:j=>{c?Un(be()[0]):F?.portalNode&&(l&&(N.current=!0),$t(j,F.portalNode)?Bs(S)?.focus():it(p??F.afterOutsideRef)?.focus())}})]})}function Wc(e,t={}){const n="rootStore"in e?e.rootStore:e,r=n.context.dataRef,{enabled:o=!0,event:s="click",toggle:a=!0,ignoreMouse:i=!1,stickIfOpen:c=!0,touchOpenDelay:l=0}=t,d=u.useRef(void 0),f=Pr(),p=Wt(),g=u.useMemo(()=>({onPointerDown(h){d.current=h.pointerType},onMouseDown(h){const m=d.current,v=h.nativeEvent,y=n.select("open");if(h.button!==0||s==="click"||ao(m)&&i)return;const S=r.current.openEvent,R=S?.type,b=n.select("domReferenceElement")!==h.currentTarget,O=y&&b||!(y&&a&&(!(S&&c)||R==="click"||R==="mousedown"));if(Ns(v.target)){const w=Pe(Ft,v,v.target);O&&m==="touch"&&l>0?p.start(l,()=>{n.setOpen(!0,w)}):n.setOpen(O,w);return}const D=h.currentTarget;f.request(()=>{const w=Pe(Ft,v,D);O&&m==="touch"&&l>0?p.start(l,()=>{n.setOpen(!0,w)}):n.setOpen(O,w)})},onClick(h){if(s==="mousedown-only")return;const m=d.current;if(s==="mousedown"&&m){d.current=void 0;return}if(ao(m)&&i)return;const v=n.select("open"),y=r.current.openEvent,S=n.select("domReferenceElement")!==h.currentTarget,R=v&&S||!(v&&a&&(!(y&&c)||Is(y))),b=Pe(Ft,h.nativeEvent,h.currentTarget);R&&m==="touch"&&l>0?p.start(l,()=>{n.setOpen(!0,b)}):n.setOpen(R,b)},onKeyDown(){d.current=void 0}}),[r,s,i,n,c,a,f,p,l]);return u.useMemo(()=>o?{reference:g}:Ie,[o,g])}const zc={intentional:"onClick",sloppy:"onPointerDown"};function Uc(e){return{escapeKey:typeof e=="boolean"?e:e?.escapeKey??!1,outsidePress:typeof e=="boolean"?e:e?.outsidePress??!0}}function Hc(e,t={}){const n="rootStore"in e?e.rootStore:e,r=n.useState("open"),o=n.useState("floatingElement"),s=n.useState("referenceElement"),a=n.useState("domReferenceElement"),{onOpenChange:i,dataRef:c}=n.context,{enabled:l=!0,escapeKey:d=!0,outsidePress:f=!0,outsidePressEvent:p="sloppy",referencePress:g=!1,referencePressEvent:h="sloppy",ancestorScroll:m=!1,bubbles:v,externalTree:y}=t,S=Hs(y),R=se(typeof f=="function"?f:()=>!1),b=typeof f=="function"?R:f,O=u.useRef(!1),{escapeKey:D,outsidePress:w}=Uc(v),E=u.useRef(null),I=Wt(),z=Wt(),Y=se(()=>{z.clear(),c.current.insideReactTree=!1}),Z=u.useRef(!1),_=u.useRef(""),te=se(T=>{_.current=T.pointerType}),F=se(()=>{const T=_.current,K=T==="pen"||!T?"mouse":T,U=typeof p=="function"?p():p;return typeof U=="string"?U:U[K]}),ee=se(T=>{if(!r||!l||!d||T.key!=="Escape"||Z.current)return;const K=c.current.floatingContext?.nodeId,U=S?yt(S.nodesRef.current,K):[];if(!D&&U.length>0){let j=!0;if(U.forEach(H=>{H.context?.open&&!H.context.dataRef.current.__escapeKeyBubbles&&(j=!1)}),!j)return}const $=dc(T)?T.nativeEvent:T,Q=Pe(Kl,$);n.setOpen(!1,Q),!D&&!Q.isPropagationAllowed&&T.stopPropagation()}),re=se(T=>{const K=F();return K==="intentional"&&T.type!=="click"||K==="sloppy"&&T.type==="click"}),N=se(()=>{c.current.insideReactTree=!0,z.start(0,Y)}),ue=se((T,K=!1)=>{if(re(T)){Y();return}if(c.current.insideReactTree){Y();return}if(F()==="intentional"&&K||typeof b=="function"&&!b(T))return;const U=Me(T),$=`[${Cn("inert")}]`,Q=Ne(n.select("floatingElement")).querySelectorAll($),j=n.context.triggerElements;if(U&&(j.hasElement(U)||j.hasMatchingElement(M=>he(M,U))))return;let H=at(U)?U:null;for(;H&&!mn(H);){const M=qo(H);if(mn(M)||!at(M))break;H=M}if(Q.length&&at(U)&&!cc(U)&&!he(U,n.select("floatingElement"))&&Array.from(Q).every(M=>!he(H,M)))return;if(ze(U)&&!("touches"in T)){const M=mn(U),J=Cr(U),Ce=/auto|scroll/,Te=M||Ce.test(J.overflowX),Be=M||Ce.test(J.overflowY),pt=Te&&U.clientWidth>0&&U.scrollWidth>U.clientWidth,Ot=Be&&U.clientHeight>0&&U.scrollHeight>U.clientHeight,Se=J.direction==="rtl",tt=Ot&&(Se?T.offsetX<=U.offsetWidth-U.clientWidth:T.offsetX>U.clientWidth),nt=pt&&T.offsetY>U.clientHeight;if(tt||nt)return}const fe=c.current.floatingContext?.nodeId,ae=S&&yt(S.nodesRef.current,fe).some(M=>_e(T,M.context?.elements.floating));if(_e(T,n.select("floatingElement"))||_e(T,n.select("domReferenceElement"))||ae)return;const oe=S?yt(S.nodesRef.current,fe):[];if(oe.length>0){let M=!0;if(oe.forEach(J=>{J.context?.open&&!J.context.dataRef.current.__outsidePressBubbles&&(M=!1)}),!M)return}n.setOpen(!1,Pe(xs,T)),Y()}),xe=se(T=>{F()!=="sloppy"||T.pointerType==="touch"||!n.select("open")||!l||_e(T,n.select("floatingElement"))||_e(T,n.select("domReferenceElement"))||ue(T)}),C=se(T=>{if(F()!=="sloppy"||!n.select("open")||!l||_e(T,n.select("floatingElement"))||_e(T,n.select("domReferenceElement")))return;const K=T.touches[0];K&&(E.current={startTime:Date.now(),startX:K.clientX,startY:K.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},I.start(1e3,()=>{E.current&&(E.current.dismissOnTouchEnd=!1,E.current.dismissOnMouseDown=!1)}))}),V=se(T=>{const K=Me(T);function U(){C(T),K?.removeEventListener(T.type,U)}K?.addEventListener(T.type,U)}),L=se(T=>{const K=O.current;if(O.current=!1,I.clear(),T.type==="mousedown"&&E.current&&!E.current.dismissOnMouseDown)return;const U=Me(T);function $(){T.type==="pointerdown"?xe(T):ue(T,K),U?.removeEventListener(T.type,$)}U?.addEventListener(T.type,$)}),q=se(T=>{if(F()!=="sloppy"||!E.current||_e(T,n.select("floatingElement"))||_e(T,n.select("domReferenceElement")))return;const K=T.touches[0];if(!K)return;const U=Math.abs(K.clientX-E.current.startX),$=Math.abs(K.clientY-E.current.startY),Q=Math.sqrt(U*U+$*$);Q>5&&(E.current.dismissOnTouchEnd=!0),Q>10&&(ue(T),I.clear(),E.current=null)}),ge=se(T=>{const K=Me(T);function U(){q(T),K?.removeEventListener(T.type,U)}K?.addEventListener(T.type,U)}),Re=se(T=>{F()!=="sloppy"||!E.current||_e(T,n.select("floatingElement"))||_e(T,n.select("domReferenceElement"))||(E.current.dismissOnTouchEnd&&ue(T),I.clear(),E.current=null)}),B=se(T=>{const K=Me(T);function U(){Re(T),K?.removeEventListener(T.type,U)}K?.addEventListener(T.type,U)});u.useEffect(()=>{if(!r||!l)return;c.current.__escapeKeyBubbles=D,c.current.__outsidePressBubbles=w;const T=new xt;function K(H){n.setOpen(!1,Pe(Gl,H))}function U(){T.clear(),Z.current=!0}function $(){T.start(Ei()?5:0,()=>{Z.current=!1})}const Q=Ne(o);Q.addEventListener("pointerdown",te,!0),d&&(Q.addEventListener("keydown",ee),Q.addEventListener("compositionstart",U),Q.addEventListener("compositionend",$)),b&&(Q.addEventListener("click",L,!0),Q.addEventListener("pointerdown",L,!0),Q.addEventListener("touchstart",V,!0),Q.addEventListener("touchmove",ge,!0),Q.addEventListener("touchend",B,!0),Q.addEventListener("mousedown",L,!0));let j=[];return m&&(at(a)&&(j=Lt(a)),at(o)&&(j=j.concat(Lt(o))),!at(s)&&s&&s.contextElement&&(j=j.concat(Lt(s.contextElement)))),j=j.filter(H=>H!==Q.defaultView?.visualViewport),j.forEach(H=>{H.addEventListener("scroll",K,{passive:!0})}),()=>{Q.removeEventListener("pointerdown",te,!0),d&&(Q.removeEventListener("keydown",ee),Q.removeEventListener("compositionstart",U),Q.removeEventListener("compositionend",$)),b&&(Q.removeEventListener("click",L,!0),Q.removeEventListener("pointerdown",L,!0),Q.removeEventListener("touchstart",V,!0),Q.removeEventListener("touchmove",ge,!0),Q.removeEventListener("touchend",B,!0),Q.removeEventListener("mousedown",L,!0)),j.forEach(H=>{H.removeEventListener("scroll",K)}),T.clear()}},[c,o,s,a,d,b,r,i,m,l,D,w,ee,ue,L,xe,V,ge,B,te,n]),u.useEffect(Y,[b,Y]);const W=u.useMemo(()=>({onKeyDown:ee,...g&&{[zc[h]]:T=>{n.setOpen(!1,Pe(Ft,T.nativeEvent))},...h!=="intentional"&&{onClick(T){n.setOpen(!1,Pe(Ft,T.nativeEvent))}}}}),[ee,n,g,h]),de=se(T=>{const K=Me(T.nativeEvent);!he(n.select("floatingElement"),K)||T.button!==0||(O.current=!0)}),be=u.useMemo(()=>({onKeyDown:ee,onPointerDown:de,onMouseDown:de,onMouseUp:de,onClickCapture:N,onMouseDownCapture:N,onPointerDownCapture:N,onMouseUpCapture:N,onTouchEndCapture:N,onTouchMoveCapture:N}),[ee,de,N]);return u.useMemo(()=>l?{reference:W,floating:be,trigger:W}:{},[l,W,be])}var Gc=(e,t,n)=>{if(t.length===1&&t[0]===n){let r=!1;try{const o={};e(o)===o&&(r=!0)}catch{}if(r){let o;try{throw new Error}catch(s){({stack:o}=s)}console.warn(`The result function returned its own inputs without modification. e.g
|
|
6
|
+
<%s key={someKey} {...props} />`,K,P,j,P),re[P+K]=!0)}if(P=null,M!==void 0&&(n(M),P=""+M),a(U)&&(n(U.key),P=""+U.key),"key"in U){M={};for(var pe in U)pe!=="key"&&(M[pe]=U[pe])}else M=U;return P&&i(M,typeof w=="function"?w.displayName||w.name||"Unknown":w),c(w,P,M,o(),Ee,he)}function f(w){p(w)?w._store&&(w._store.validated=1):typeof w=="object"&&w!==null&&w.$$typeof===I&&(w._payload.status==="fulfilled"?p(w._payload.value)&&w._payload.value._store&&(w._payload.value._store.validated=1):w._store&&(w._store.validated=1))}function p(w){return typeof w=="object"&&w!==null&&w.$$typeof===g}var h=D,g=Symbol.for("react.transitional.element"),m=Symbol.for("react.portal"),v=Symbol.for("react.fragment"),y=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),R=Symbol.for("react.consumer"),b=Symbol.for("react.context"),C=Symbol.for("react.forward_ref"),O=Symbol.for("react.suspense"),T=Symbol.for("react.suspense_list"),x=Symbol.for("react.memo"),I=Symbol.for("react.lazy"),H=Symbol.for("react.activity"),q=Symbol.for("react.client.reference"),Q=h.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,L=Object.prototype.hasOwnProperty,ee=Array.isArray,N=console.createTask?console.createTask:function(){return null};h={react_stack_bottom_frame:function(w){return w()}};var J,te={},A=h.react_stack_bottom_frame.bind(h,s)(),ce=N(r(s)),re={};Bt.Fragment=v,Bt.jsx=function(w,U,M){var K=1e4>Q.recentlyCreatedOwnerStacks++;return d(w,U,M,!1,K?Error("react-stack-top-frame"):A,K?N(r(w)):ce)},Bt.jsxs=function(w,U,M){var K=1e4>Q.recentlyCreatedOwnerStacks++;return d(w,U,M,!0,K?Error("react-stack-top-frame"):A,K?N(r(w)):ce)}})()),Bt}var uo;function Wi(){return uo||(uo=1,process.env.NODE_ENV==="production"?ln.exports=Ui():ln.exports=Vi()),ln.exports}var S=Wi();const tr=768;function zi(){const[e,t]=l.useState(void 0);return l.useEffect(()=>{const n=window.matchMedia(`(max-width: ${tr-1}px)`),r=()=>{t(window.innerWidth<tr)};return n.addEventListener("change",r),t(window.innerWidth<tr),()=>n.removeEventListener("change",r)},[]),!!e}function zn(){return typeof window<"u"}function Hn(e){return Ur(e)?(e.nodeName||"").toLowerCase():"#document"}function Qe(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Hi(e){var t;return(t=(Ur(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Ur(e){return zn()?e instanceof Node||e instanceof Qe(e).Node:!1}function bt(e){return zn()?e instanceof Element||e instanceof Qe(e).Element:!1}function nt(e){return zn()?e instanceof HTMLElement||e instanceof Qe(e).HTMLElement:!1}function kr(e){return!zn()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Qe(e).ShadowRoot}const qi=new Set(["inline","contents"]);function qn(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Vr(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!qi.has(o)}function Ki(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Gi=new Set(["html","body","#document"]);function Cn(e){return Gi.has(Hn(e))}function Vr(e){return Qe(e).getComputedStyle(e)}function Es(e){if(Hn(e)==="html")return e;const t=e.assignedSlot||e.parentNode||kr(e)&&e.host||Hi(e);return kr(t)?t.host:t}function xs(e){const t=Es(e);return Cn(t)?e.ownerDocument?e.ownerDocument.body:e.body:nt(t)&&qn(t)?t:xs(t)}function qt(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=xs(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),a=Qe(o);if(s){const i=Yi(a);return t.concat(a,a.visualViewport||[],qn(o)?o:[],i&&n?qt(i):[])}return t.concat(o,qt(o,[],n))}function Yi(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const fo={};function dt(e,t){const n=l.useRef(fo);return n.current===fo&&(n.current=e(t)),n}const nr=l[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],Xi=nr&&nr!==l.useLayoutEffect?nr:e=>e();function me(e){const t=dt(Ji).current;return t.next=e,Xi(t.effect),t.trampoline}function Ji(){const e={next:void 0,callback:Zi,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function Zi(){if(process.env.NODE_ENV!=="production")throw new Error("Base UI: Cannot call an event handler while rendering.")}let Cr;process.env.NODE_ENV!=="production"&&(Cr=new Set);function po(...e){if(process.env.NODE_ENV!=="production"){const t=e.join(" ");Cr.has(t)||(Cr.add(t),console.error(`Base UI: ${t}`))}}const Qi=()=>{},De=typeof document<"u"?l.useLayoutEffect:Qi;function Or(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}const Kt={};function Ss(e,t,n,r,o){let s={...Ar(e,Kt)};return t&&(s=On(s,t)),n&&(s=On(s,n)),r&&(s=On(s,r)),s}function ec(e){if(e.length===0)return Kt;if(e.length===1)return Ar(e[0],Kt);let t={...Ar(e[0],Kt)};for(let n=1;n<e.length;n+=1)t=On(t,e[n]);return t}function On(e,t){return Ts(t)?t(e):tc(e,t)}function tc(e,t){if(!t)return e;for(const n in t){const r=t[n];switch(n){case"style":{e[n]=Or(e.style,r);break}case"className":{e[n]=Rs(e.className,r);break}default:nc(n,r)?e[n]=rc(e[n],r):e[n]=r}}return e}function nc(e,t){const n=e.charCodeAt(0),r=e.charCodeAt(1),o=e.charCodeAt(2);return n===111&&r===110&&o>=65&&o<=90&&(typeof t=="function"||typeof t>"u")}function Ts(e){return typeof e=="function"}function Ar(e,t){return Ts(e)?e(t):e??Kt}function rc(e,t){return t?e?n=>{if(oc(n)){const o=n;Dr(o);const s=t(o);return o.baseUIHandlerPrevented||e?.(o),s}const r=t(n);return e?.(n),r}:t:e}function Dr(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function Rs(e,t){return t?e?t+" "+e:t:e}function oc(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}function St(e,...t){const n=new URL(`https://base-ui.com/production-error/${e}`);return t.forEach(r=>n.searchParams.append("args[]",r)),`Base UI error #${e}; visit ${n} for the full message.`}const ks=l.createContext(void 0);process.env.NODE_ENV!=="production"&&(ks.displayName="CompositeRootContext");function sc(e=!1){const t=l.useContext(ks);if(t===void 0&&!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: CompositeRootContext is missing. Composite parts must be placed within <Composite.Root>.":St(16));return t}function ac(e){const{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:o=0,isNativeButton:s}=e,a=r&&t!==!1,i=r&&t===!1;return{props:l.useMemo(()=>{const c={onKeyDown(d){n&&t&&d.key!=="Tab"&&d.preventDefault()}};return r||(c.tabIndex=o,!s&&n&&(c.tabIndex=t?o:-1)),(s&&(t||a)||!s&&n)&&(c["aria-disabled"]=n),s&&(!t||i)&&(c.disabled=n),c},[r,n,t,a,i,s,o])}}function Wr(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:o=!0}=e,s=l.useRef(null),a=sc(!0)!==void 0,i=me(()=>{const p=s.current;return!!(p?.tagName==="A"&&p?.href)}),{props:u}=ac({focusableWhenDisabled:n,disabled:t,composite:a,tabIndex:r,isNativeButton:o});process.env.NODE_ENV!=="production"&&l.useEffect(()=>{if(!s.current)return;const p=s.current.tagName==="BUTTON";o?p||po("A component that acts as a button was not rendered as a native <button>, which does not match the default. Ensure that the element passed to the `render` prop of the component is a real <button>, or set the `nativeButton` prop on the component to `false`."):p&&po("A component that acts as a button was rendered as a native <button>, which does not match the default. Ensure that the element passed to the `render` prop of the component is not a real <button>, or set the `nativeButton` prop on the component to `true`.")},[o]);const c=l.useCallback(()=>{const p=s.current;ic(p)&&a&&t&&u.disabled===void 0&&p.disabled&&(p.disabled=!1)},[t,u.disabled,a]);De(c,[c]);const d=l.useCallback((p={})=>{const{onClick:h,onMouseDown:g,onKeyUp:m,onKeyDown:v,onPointerDown:y,...E}=p;return Ss({type:o?"button":void 0,onClick(b){if(t){b.preventDefault();return}h?.(b)},onMouseDown(b){t||g?.(b)},onKeyDown(b){if(t||(Dr(b),v?.(b)),b.baseUIHandlerPrevented)return;const C=b.target===b.currentTarget&&!o&&!i()&&!t,O=b.key==="Enter",T=b.key===" ";C&&((T||O)&&b.preventDefault(),O&&h?.(b))},onKeyUp(b){t||(Dr(b),m?.(b)),!b.baseUIHandlerPrevented&&b.target===b.currentTarget&&!o&&!t&&b.key===" "&&h?.(b)},onPointerDown(b){if(t){b.preventDefault();return}y?.(b)}},o?void 0:{role:"button"},u,E)},[t,u,o,i]),f=me(p=>{s.current=p,c()});return{getButtonProps:d,buttonRef:f}}function ic(e){return nt(e)&&e.tagName==="BUTTON"}function In(e,t,n,r){const o=dt(Cs).current;return lc(o,e,t,n,r)&&Os(o,[e,t,n,r]),o.callback}function cc(e){const t=dt(Cs).current;return uc(t,e)&&Os(t,e),t.callback}function Cs(){return{callback:null,cleanup:null,refs:[]}}function lc(e,t,n,r,o){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==o}function uc(e,t){return e.refs.length!==t.length||e.refs.some((n,r)=>n!==t[r])}function Os(e,t){if(e.refs=t,t.every(n=>n==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),n!=null){const r=Array(t.length).fill(null);for(let o=0;o<t.length;o+=1){const s=t[o];if(s!=null)switch(typeof s){case"function":{const a=s(n);typeof a=="function"&&(r[o]=a);break}case"object":{s.current=n;break}}}e.cleanup=()=>{for(let o=0;o<t.length;o+=1){const s=t[o];if(s!=null)switch(typeof s){case"function":{const a=r[o];typeof a=="function"?a():s(null);break}case"object":{s.current=null;break}}}}}}}const dc=parseInt(l.version,10);function zr(e){return dc>=e}function mo(e){if(!l.isValidElement(e))return null;const t=e,n=t.props;return(zr(19)?n?.ref:t.ref)??null}function fc(e,t){const n={};for(const r in e){const o=e[r];if(t?.hasOwnProperty(r)){const s=t[r](o);s!=null&&Object.assign(n,s);continue}o===!0?n[`data-${r.toLowerCase()}`]="":o&&(n[`data-${r.toLowerCase()}`]=o.toString())}return n}function pc(e,t){return typeof e=="function"?e(t):e}function mc(e,t){return typeof e=="function"?e(t):e}function As(){}const Be=Object.freeze({}),Ds="data-base-ui-click-trigger",hc={clipPath:"inset(50%)",position:"fixed",top:0,left:0};function ft(e,t,n={}){const r=t.render,o=gc(t,n);if(n.enabled===!1)return null;const s=n.state??Be;return vc(e,r,o,s)}function gc(e,t={}){const{className:n,style:r,render:o}=e,{state:s=Be,ref:a,props:i,stateAttributesMapping:u,enabled:c=!0}=t,d=c?pc(n,s):void 0,f=c?mc(r,s):void 0,p=c?fc(s,u):Be,h=c?Or(p,Array.isArray(i)?ec(i):i)??Be:Be;return typeof document<"u"&&(c?Array.isArray(a)?h.ref=cc([h.ref,mo(o),...a]):h.ref=In(h.ref,mo(o),a):In(null,null)),c?(d!==void 0&&(h.className=Rs(h.className,d)),f!==void 0&&(h.style=Or(h.style,f)),h):Be}function vc(e,t,n,r){if(t){if(typeof t=="function")return t(n,r);const o=Ss(n,t.props);return o.ref=n.ref,l.cloneElement(t,o)}if(e&&typeof e=="string")return bc(e,n);throw new Error(process.env.NODE_ENV!=="production"?"Base UI: Render element or function are not defined.":St(8))}function bc(e,t){return e==="button"?D.createElement("button",{type:"button",...t,key:t.key}):e==="img"?D.createElement("img",{alt:"",...t,key:t.key}):l.createElement(e,t)}const Is=l.forwardRef(function(t,n){const{render:r,className:o,disabled:s=!1,focusableWhenDisabled:a=!1,nativeButton:i=!0,...u}=t,c=!!s,{getButtonProps:d,buttonRef:f}=Wr({disabled:c,focusableWhenDisabled:a,native:i}),p=l.useMemo(()=>({disabled:c}),[c]);return ft("button",t,{state:p,ref:[n,f],props:[u,d]})});process.env.NODE_ENV!=="production"&&(Is.displayName="Button");function Ps(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=Ps(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Ns(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Ps(e))&&(r&&(r+=" "),r+=t);return r}const ho=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,go=Ns,yc=(e,t)=>n=>{var r;if(t?.variants==null)return go(e,n?.class,n?.className);const{variants:o,defaultVariants:s}=t,a=Object.keys(o).map(c=>{const d=n?.[c],f=s?.[c];if(d===null)return null;const p=ho(d)||ho(f);return o[c][p]}),i=n&&Object.entries(n).reduce((c,d)=>{let[f,p]=d;return p===void 0||(c[f]=p),c},{}),u=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,d)=>{let{class:f,className:p,...h}=d;return Object.entries(h).every(g=>{let[m,v]=g;return Array.isArray(v)?v.includes({...s,...i}[m]):{...s,...i}[m]===v})?[...c,f,p]:c},[]);return go(e,a,u,n?.class,n?.className)},wc=(e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r<e.length;r++)n[r]=e[r];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},Ec=(e,t)=>({classGroupId:e,validator:t}),_s=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Pn="-",vo=[],xc="arbitrary..",Sc=e=>{const t=Rc(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:a=>{if(a.startsWith("[")&&a.endsWith("]"))return Tc(a);const i=a.split(Pn),u=i[0]===""&&i.length>1?1:0;return Ms(i,u,t)},getConflictingClassGroupIds:(a,i)=>{if(i){const u=r[a],c=n[a];return u?c?wc(c,u):u:c||vo}return n[a]||vo}}},Ms=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const o=e[t],s=n.nextPart.get(o);if(s){const c=Ms(e,t+1,s);if(c)return c}const a=n.validators;if(a===null)return;const i=t===0?e.join(Pn):e.slice(t).join(Pn),u=a.length;for(let c=0;c<u;c++){const d=a[c];if(d.validator(i))return d.classGroupId}},Tc=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?xc+r:void 0})(),Rc=e=>{const{theme:t,classGroups:n}=e;return kc(n,t)},kc=(e,t)=>{const n=_s();for(const r in e){const o=e[r];Hr(o,n,r,t)}return n},Hr=(e,t,n,r)=>{const o=e.length;for(let s=0;s<o;s++){const a=e[s];Cc(a,t,n,r)}},Cc=(e,t,n,r)=>{if(typeof e=="string"){Oc(e,t,n);return}if(typeof e=="function"){Ac(e,t,n,r);return}Dc(e,t,n,r)},Oc=(e,t,n)=>{const r=e===""?t:Ls(t,e);r.classGroupId=n},Ac=(e,t,n,r)=>{if(Ic(e)){Hr(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(Ec(n,e))},Dc=(e,t,n,r)=>{const o=Object.entries(e),s=o.length;for(let a=0;a<s;a++){const[i,u]=o[a];Hr(u,Ls(t,i),n,r)}},Ls=(e,t)=>{let n=e;const r=t.split(Pn),o=r.length;for(let s=0;s<o;s++){const a=r[s];let i=n.nextPart.get(a);i||(i=_s(),n.nextPart.set(a,i)),n=i}return n},Ic=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,Pc=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const o=(s,a)=>{n[s]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(s){let a=n[s];if(a!==void 0)return a;if((a=r[s])!==void 0)return o(s,a),a},set(s,a){s in n?n[s]=a:o(s,a)}}},Ir="!",bo=":",Nc=[],yo=(e,t,n,r,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:o}),_c=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=o=>{const s=[];let a=0,i=0,u=0,c;const d=o.length;for(let m=0;m<d;m++){const v=o[m];if(a===0&&i===0){if(v===bo){s.push(o.slice(u,m)),u=m+1;continue}if(v==="/"){c=m;continue}}v==="["?a++:v==="]"?a--:v==="("?i++:v===")"&&i--}const f=s.length===0?o:o.slice(u);let p=f,h=!1;f.endsWith(Ir)?(p=f.slice(0,-1),h=!0):f.startsWith(Ir)&&(p=f.slice(1),h=!0);const g=c&&c>u?c-u:void 0;return yo(s,h,p,g)};if(t){const o=t+bo,s=r;r=a=>a.startsWith(o)?s(a.slice(o.length)):yo(Nc,!1,a,void 0,!0)}if(n){const o=r;r=s=>n({className:s,parseClassName:o})}return r},Mc=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let o=[];for(let s=0;s<n.length;s++){const a=n[s],i=a[0]==="[",u=t.has(a);i||u?(o.length>0&&(o.sort(),r.push(...o),o=[]),r.push(a)):o.push(a)}return o.length>0&&(o.sort(),r.push(...o)),r}},Lc=e=>({cache:Pc(e.cacheSize),parseClassName:_c(e),sortModifiers:Mc(e),...Sc(e)}),jc=/\s+/,Fc=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o,sortModifiers:s}=t,a=[],i=e.trim().split(jc);let u="";for(let c=i.length-1;c>=0;c-=1){const d=i[c],{isExternal:f,modifiers:p,hasImportantModifier:h,baseClassName:g,maybePostfixModifierPosition:m}=n(d);if(f){u=d+(u.length>0?" "+u:u);continue}let v=!!m,y=r(v?g.substring(0,m):g);if(!y){if(!v){u=d+(u.length>0?" "+u:u);continue}if(y=r(g),!y){u=d+(u.length>0?" "+u:u);continue}v=!1}const E=p.length===0?"":p.length===1?p[0]:s(p).join(":"),R=h?E+Ir:E,b=R+y;if(a.indexOf(b)>-1)continue;a.push(b);const C=o(y,v);for(let O=0;O<C.length;++O){const T=C[O];a.push(R+T)}u=d+(u.length>0?" "+u:u)}return u},$c=(...e)=>{let t=0,n,r,o="";for(;t<e.length;)(n=e[t++])&&(r=js(n))&&(o&&(o+=" "),o+=r);return o},js=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=js(e[r]))&&(n&&(n+=" "),n+=t);return n},Bc=(e,...t)=>{let n,r,o,s;const a=u=>{const c=t.reduce((d,f)=>f(d),e());return n=Lc(c),r=n.cache.get,o=n.cache.set,s=i,i(u)},i=u=>{const c=r(u);if(c)return c;const d=Fc(u,n);return o(u,d),d};return s=a,(...u)=>s($c(...u))},Uc=[],Oe=e=>{const t=n=>n[e]||Uc;return t.isThemeGetter=!0,t},Fs=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,$s=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Vc=/^\d+\/\d+$/,Wc=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,zc=/\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$/,Hc=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,qc=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Kc=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Rt=e=>Vc.test(e),se=e=>!!e&&!Number.isNaN(Number(e)),it=e=>!!e&&Number.isInteger(Number(e)),rr=e=>e.endsWith("%")&&se(e.slice(0,-1)),tt=e=>Wc.test(e),Gc=()=>!0,Yc=e=>zc.test(e)&&!Hc.test(e),Bs=()=>!1,Xc=e=>qc.test(e),Jc=e=>Kc.test(e),Zc=e=>!F(e)&&!$(e),Qc=e=>Mt(e,Ws,Bs),F=e=>Fs.test(e),gt=e=>Mt(e,zs,Yc),or=e=>Mt(e,ol,se),wo=e=>Mt(e,Us,Bs),el=e=>Mt(e,Vs,Jc),un=e=>Mt(e,Hs,Xc),$=e=>$s.test(e),Ut=e=>Lt(e,zs),tl=e=>Lt(e,sl),Eo=e=>Lt(e,Us),nl=e=>Lt(e,Ws),rl=e=>Lt(e,Vs),dn=e=>Lt(e,Hs,!0),Mt=(e,t,n)=>{const r=Fs.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Lt=(e,t,n=!1)=>{const r=$s.exec(e);return r?r[1]?t(r[1]):n:!1},Us=e=>e==="position"||e==="percentage",Vs=e=>e==="image"||e==="url",Ws=e=>e==="length"||e==="size"||e==="bg-size",zs=e=>e==="length",ol=e=>e==="number",sl=e=>e==="family-name",Hs=e=>e==="shadow",al=()=>{const e=Oe("color"),t=Oe("font"),n=Oe("text"),r=Oe("font-weight"),o=Oe("tracking"),s=Oe("leading"),a=Oe("breakpoint"),i=Oe("container"),u=Oe("spacing"),c=Oe("radius"),d=Oe("shadow"),f=Oe("inset-shadow"),p=Oe("text-shadow"),h=Oe("drop-shadow"),g=Oe("blur"),m=Oe("perspective"),v=Oe("aspect"),y=Oe("ease"),E=Oe("animate"),R=()=>["auto","avoid","all","avoid-page","page","left","right","column"],b=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],C=()=>[...b(),$,F],O=()=>["auto","hidden","clip","visible","scroll"],T=()=>["auto","contain","none"],x=()=>[$,F,u],I=()=>[Rt,"full","auto",...x()],H=()=>[it,"none","subgrid",$,F],q=()=>["auto",{span:["full",it,$,F]},it,$,F],Q=()=>[it,"auto",$,F],L=()=>["auto","min","max","fr",$,F],ee=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],N=()=>["start","end","center","stretch","center-safe","end-safe"],J=()=>["auto",...x()],te=()=>[Rt,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...x()],A=()=>[e,$,F],ce=()=>[...b(),Eo,wo,{position:[$,F]}],re=()=>["no-repeat",{repeat:["","x","y","space","round"]}],w=()=>["auto","cover","contain",nl,Qc,{size:[$,F]}],U=()=>[rr,Ut,gt],M=()=>["","none","full",c,$,F],K=()=>["",se,Ut,gt],Ee=()=>["solid","dashed","dotted","double"],he=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],P=()=>[se,rr,Eo,wo],j=()=>["","none",g,$,F],pe=()=>["none",se,$,F],ye=()=>["none",se,$,F],k=()=>[se,$,F],Y=()=>[Rt,"full",...x()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[tt],breakpoint:[tt],color:[Gc],container:[tt],"drop-shadow":[tt],ease:["in","out","in-out"],font:[Zc],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[tt],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[tt],shadow:[tt],spacing:["px",se],text:[tt],"text-shadow":[tt],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Rt,F,$,v]}],container:["container"],columns:[{columns:[se,F,$,i]}],"break-after":[{"break-after":R()}],"break-before":[{"break-before":R()}],"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:C()}],overflow:[{overflow:O()}],"overflow-x":[{"overflow-x":O()}],"overflow-y":[{"overflow-y":O()}],overscroll:[{overscroll:T()}],"overscroll-x":[{"overscroll-x":T()}],"overscroll-y":[{"overscroll-y":T()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:I()}],"inset-x":[{"inset-x":I()}],"inset-y":[{"inset-y":I()}],start:[{start:I()}],end:[{end:I()}],top:[{top:I()}],right:[{right:I()}],bottom:[{bottom:I()}],left:[{left:I()}],visibility:["visible","invisible","collapse"],z:[{z:[it,"auto",$,F]}],basis:[{basis:[Rt,"full","auto",i,...x()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[se,Rt,"auto","initial","none",F]}],grow:[{grow:["",se,$,F]}],shrink:[{shrink:["",se,$,F]}],order:[{order:[it,"first","last","none",$,F]}],"grid-cols":[{"grid-cols":H()}],"col-start-end":[{col:q()}],"col-start":[{"col-start":Q()}],"col-end":[{"col-end":Q()}],"grid-rows":[{"grid-rows":H()}],"row-start-end":[{row:q()}],"row-start":[{"row-start":Q()}],"row-end":[{"row-end":Q()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":L()}],"auto-rows":[{"auto-rows":L()}],gap:[{gap:x()}],"gap-x":[{"gap-x":x()}],"gap-y":[{"gap-y":x()}],"justify-content":[{justify:[...ee(),"normal"]}],"justify-items":[{"justify-items":[...N(),"normal"]}],"justify-self":[{"justify-self":["auto",...N()]}],"align-content":[{content:["normal",...ee()]}],"align-items":[{items:[...N(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...N(),{baseline:["","last"]}]}],"place-content":[{"place-content":ee()}],"place-items":[{"place-items":[...N(),"baseline"]}],"place-self":[{"place-self":["auto",...N()]}],p:[{p:x()}],px:[{px:x()}],py:[{py:x()}],ps:[{ps:x()}],pe:[{pe:x()}],pt:[{pt:x()}],pr:[{pr:x()}],pb:[{pb:x()}],pl:[{pl:x()}],m:[{m:J()}],mx:[{mx:J()}],my:[{my:J()}],ms:[{ms:J()}],me:[{me:J()}],mt:[{mt:J()}],mr:[{mr:J()}],mb:[{mb:J()}],ml:[{ml:J()}],"space-x":[{"space-x":x()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":x()}],"space-y-reverse":["space-y-reverse"],size:[{size:te()}],w:[{w:[i,"screen",...te()]}],"min-w":[{"min-w":[i,"screen","none",...te()]}],"max-w":[{"max-w":[i,"screen","none","prose",{screen:[a]},...te()]}],h:[{h:["screen","lh",...te()]}],"min-h":[{"min-h":["screen","lh","none",...te()]}],"max-h":[{"max-h":["screen","lh",...te()]}],"font-size":[{text:["base",n,Ut,gt]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,$,or]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",rr,F]}],"font-family":[{font:[tl,F,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:[o,$,F]}],"line-clamp":[{"line-clamp":[se,"none",$,or]}],leading:[{leading:[s,...x()]}],"list-image":[{"list-image":["none",$,F]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",$,F]}],"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:[...Ee(),"wavy"]}],"text-decoration-thickness":[{decoration:[se,"from-font","auto",$,gt]}],"text-decoration-color":[{decoration:A()}],"underline-offset":[{"underline-offset":[se,"auto",$,F]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:x()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",$,F]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",$,F]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:ce()}],"bg-repeat":[{bg:re()}],"bg-size":[{bg:w()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},it,$,F],radial:["",$,F],conic:[it,$,F]},rl,el]}],"bg-color":[{bg:A()}],"gradient-from-pos":[{from:U()}],"gradient-via-pos":[{via:U()}],"gradient-to-pos":[{to:U()}],"gradient-from":[{from:A()}],"gradient-via":[{via:A()}],"gradient-to":[{to:A()}],rounded:[{rounded:M()}],"rounded-s":[{"rounded-s":M()}],"rounded-e":[{"rounded-e":M()}],"rounded-t":[{"rounded-t":M()}],"rounded-r":[{"rounded-r":M()}],"rounded-b":[{"rounded-b":M()}],"rounded-l":[{"rounded-l":M()}],"rounded-ss":[{"rounded-ss":M()}],"rounded-se":[{"rounded-se":M()}],"rounded-ee":[{"rounded-ee":M()}],"rounded-es":[{"rounded-es":M()}],"rounded-tl":[{"rounded-tl":M()}],"rounded-tr":[{"rounded-tr":M()}],"rounded-br":[{"rounded-br":M()}],"rounded-bl":[{"rounded-bl":M()}],"border-w":[{border:K()}],"border-w-x":[{"border-x":K()}],"border-w-y":[{"border-y":K()}],"border-w-s":[{"border-s":K()}],"border-w-e":[{"border-e":K()}],"border-w-t":[{"border-t":K()}],"border-w-r":[{"border-r":K()}],"border-w-b":[{"border-b":K()}],"border-w-l":[{"border-l":K()}],"divide-x":[{"divide-x":K()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":K()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Ee(),"hidden","none"]}],"divide-style":[{divide:[...Ee(),"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:[...Ee(),"none","hidden"]}],"outline-offset":[{"outline-offset":[se,$,F]}],"outline-w":[{outline:["",se,Ut,gt]}],"outline-color":[{outline:A()}],shadow:[{shadow:["","none",d,dn,un]}],"shadow-color":[{shadow:A()}],"inset-shadow":[{"inset-shadow":["none",f,dn,un]}],"inset-shadow-color":[{"inset-shadow":A()}],"ring-w":[{ring:K()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:A()}],"ring-offset-w":[{"ring-offset":[se,gt]}],"ring-offset-color":[{"ring-offset":A()}],"inset-ring-w":[{"inset-ring":K()}],"inset-ring-color":[{"inset-ring":A()}],"text-shadow":[{"text-shadow":["none",p,dn,un]}],"text-shadow-color":[{"text-shadow":A()}],opacity:[{opacity:[se,$,F]}],"mix-blend":[{"mix-blend":[...he(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":he()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[se]}],"mask-image-linear-from-pos":[{"mask-linear-from":P()}],"mask-image-linear-to-pos":[{"mask-linear-to":P()}],"mask-image-linear-from-color":[{"mask-linear-from":A()}],"mask-image-linear-to-color":[{"mask-linear-to":A()}],"mask-image-t-from-pos":[{"mask-t-from":P()}],"mask-image-t-to-pos":[{"mask-t-to":P()}],"mask-image-t-from-color":[{"mask-t-from":A()}],"mask-image-t-to-color":[{"mask-t-to":A()}],"mask-image-r-from-pos":[{"mask-r-from":P()}],"mask-image-r-to-pos":[{"mask-r-to":P()}],"mask-image-r-from-color":[{"mask-r-from":A()}],"mask-image-r-to-color":[{"mask-r-to":A()}],"mask-image-b-from-pos":[{"mask-b-from":P()}],"mask-image-b-to-pos":[{"mask-b-to":P()}],"mask-image-b-from-color":[{"mask-b-from":A()}],"mask-image-b-to-color":[{"mask-b-to":A()}],"mask-image-l-from-pos":[{"mask-l-from":P()}],"mask-image-l-to-pos":[{"mask-l-to":P()}],"mask-image-l-from-color":[{"mask-l-from":A()}],"mask-image-l-to-color":[{"mask-l-to":A()}],"mask-image-x-from-pos":[{"mask-x-from":P()}],"mask-image-x-to-pos":[{"mask-x-to":P()}],"mask-image-x-from-color":[{"mask-x-from":A()}],"mask-image-x-to-color":[{"mask-x-to":A()}],"mask-image-y-from-pos":[{"mask-y-from":P()}],"mask-image-y-to-pos":[{"mask-y-to":P()}],"mask-image-y-from-color":[{"mask-y-from":A()}],"mask-image-y-to-color":[{"mask-y-to":A()}],"mask-image-radial":[{"mask-radial":[$,F]}],"mask-image-radial-from-pos":[{"mask-radial-from":P()}],"mask-image-radial-to-pos":[{"mask-radial-to":P()}],"mask-image-radial-from-color":[{"mask-radial-from":A()}],"mask-image-radial-to-color":[{"mask-radial-to":A()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[se]}],"mask-image-conic-from-pos":[{"mask-conic-from":P()}],"mask-image-conic-to-pos":[{"mask-conic-to":P()}],"mask-image-conic-from-color":[{"mask-conic-from":A()}],"mask-image-conic-to-color":[{"mask-conic-to":A()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:ce()}],"mask-repeat":[{mask:re()}],"mask-size":[{mask:w()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",$,F]}],filter:[{filter:["","none",$,F]}],blur:[{blur:j()}],brightness:[{brightness:[se,$,F]}],contrast:[{contrast:[se,$,F]}],"drop-shadow":[{"drop-shadow":["","none",h,dn,un]}],"drop-shadow-color":[{"drop-shadow":A()}],grayscale:[{grayscale:["",se,$,F]}],"hue-rotate":[{"hue-rotate":[se,$,F]}],invert:[{invert:["",se,$,F]}],saturate:[{saturate:[se,$,F]}],sepia:[{sepia:["",se,$,F]}],"backdrop-filter":[{"backdrop-filter":["","none",$,F]}],"backdrop-blur":[{"backdrop-blur":j()}],"backdrop-brightness":[{"backdrop-brightness":[se,$,F]}],"backdrop-contrast":[{"backdrop-contrast":[se,$,F]}],"backdrop-grayscale":[{"backdrop-grayscale":["",se,$,F]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[se,$,F]}],"backdrop-invert":[{"backdrop-invert":["",se,$,F]}],"backdrop-opacity":[{"backdrop-opacity":[se,$,F]}],"backdrop-saturate":[{"backdrop-saturate":[se,$,F]}],"backdrop-sepia":[{"backdrop-sepia":["",se,$,F]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":x()}],"border-spacing-x":[{"border-spacing-x":x()}],"border-spacing-y":[{"border-spacing-y":x()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",$,F]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[se,"initial",$,F]}],ease:[{ease:["linear","initial",y,$,F]}],delay:[{delay:[se,$,F]}],animate:[{animate:["none",E,$,F]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[m,$,F]}],"perspective-origin":[{"perspective-origin":C()}],rotate:[{rotate:pe()}],"rotate-x":[{"rotate-x":pe()}],"rotate-y":[{"rotate-y":pe()}],"rotate-z":[{"rotate-z":pe()}],scale:[{scale:ye()}],"scale-x":[{"scale-x":ye()}],"scale-y":[{"scale-y":ye()}],"scale-z":[{"scale-z":ye()}],"scale-3d":["scale-3d"],skew:[{skew:k()}],"skew-x":[{"skew-x":k()}],"skew-y":[{"skew-y":k()}],transform:[{transform:[$,F,"","none","gpu","cpu"]}],"transform-origin":[{origin:C()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Y()}],"translate-x":[{"translate-x":Y()}],"translate-y":[{"translate-y":Y()}],"translate-z":[{"translate-z":Y()}],"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",$,F]}],"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":x()}],"scroll-mx":[{"scroll-mx":x()}],"scroll-my":[{"scroll-my":x()}],"scroll-ms":[{"scroll-ms":x()}],"scroll-me":[{"scroll-me":x()}],"scroll-mt":[{"scroll-mt":x()}],"scroll-mr":[{"scroll-mr":x()}],"scroll-mb":[{"scroll-mb":x()}],"scroll-ml":[{"scroll-ml":x()}],"scroll-p":[{"scroll-p":x()}],"scroll-px":[{"scroll-px":x()}],"scroll-py":[{"scroll-py":x()}],"scroll-ps":[{"scroll-ps":x()}],"scroll-pe":[{"scroll-pe":x()}],"scroll-pt":[{"scroll-pt":x()}],"scroll-pr":[{"scroll-pr":x()}],"scroll-pb":[{"scroll-pb":x()}],"scroll-pl":[{"scroll-pl":x()}],"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",$,F]}],fill:[{fill:["none",...A()]}],"stroke-w":[{stroke:[se,Ut,gt,or]}],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-x","border-w-y","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-x","border-color-y","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:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},il=Bc(al);function Le(...e){return il(Ns(e))}const cl=yc("focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 rounded-lg border border-transparent bg-clip-padding text-sm font-medium focus-visible:ring-[3px] aria-invalid:ring-[3px] [&_svg:not([class*='size-'])]:size-4 inline-flex items-center justify-center whitespace-nowrap transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none shrink-0 [&_svg]:shrink-0 outline-none group/button select-none",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",outline:"border-border bg-background hover:bg-muted hover:text-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50 aria-expanded:bg-muted aria-expanded:text-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",ghost:"hover:bg-muted hover:text-foreground dark:hover:bg-muted/50 aria-expanded:bg-muted aria-expanded:text-foreground",destructive:"bg-destructive/10 hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/20 text-destructive focus-visible:border-destructive/40 dark:hover:bg-destructive/30",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",xs:"h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",lg:"h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3",icon:"size-8","icon-xs":"size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg","icon-lg":"size-9"}},defaultVariants:{variant:"default",size:"default"}});function rt({className:e,variant:t="default",size:n="default",...r}){return S.jsx(Is,{"data-slot":"button",className:Le(cl({variant:t,size:n,className:e})),...r})}const qr=l.createContext(void 0);process.env.NODE_ENV!=="production"&&(qr.displayName="DialogRootContext");function pt(e){const t=l.useContext(qr);if(e===!1&&t===void 0)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: DialogRootContext is missing. Dialog parts must be placed within <Dialog.Root>.":St(27));return t}let Nn=(function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e})({});const ll={[Nn.startingStyle]:""},ul={[Nn.endingStyle]:""},qs={transitionStatus(e){return e==="starting"?ll:e==="ending"?ul:null}};let wt=(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=Nn.startingStyle]="startingStyle",e[e.endingStyle=Nn.endingStyle]="endingStyle",e.anchorHidden="data-anchor-hidden",e})({}),dl=(function(e){return e.popupOpen="data-popup-open",e.pressed="data-pressed",e})({});const fl={[dl.popupOpen]:""},pl={[wt.open]:""},ml={[wt.closed]:""},hl={[wt.anchorHidden]:""},gl={open(e){return e?fl:null}},Ks={open(e){return e?pl:ml},anchorHidden(e){return e?hl:null}},vl={...Ks,...qs},Gs=l.forwardRef(function(t,n){const{render:r,className:o,forceRender:s=!1,...a}=t,{store:i}=pt(),u=i.useState("open"),c=i.useState("nested"),d=i.useState("mounted"),f=i.useState("transitionStatus"),p=l.useMemo(()=>({open:u,transitionStatus:f}),[u,f]);return ft("div",t,{state:p,ref:[i.context.backdropRef,n],stateAttributesMapping:vl,props:[{role:"presentation",hidden:!d,style:{userSelect:"none",WebkitUserSelect:"none"}},a],enabled:s||!c})});process.env.NODE_ENV!=="production"&&(Gs.displayName="DialogBackdrop");const bl="none",Gt="trigger-press",yl="trigger-hover",Ys="outside-press",wl="close-press",Xs="focus-out",El="escape-key",xl="imperative-action";function We(e,t,n,r){let o=!1,s=!1;const a=Be;return{reason:e,event:t??new Event("base-ui"),cancel(){o=!0},allowPropagation(){s=!0},get isCanceled(){return o},get isPropagationAllowed(){return s},trigger:n,...a}}const Kr=l.forwardRef(function(t,n){const{render:r,className:o,disabled:s=!1,nativeButton:a=!0,...i}=t,{store:u}=pt(),c=u.useState("open");function d(g){c&&u.setOpen(!1,We(wl,g.nativeEvent))}const{getButtonProps:f,buttonRef:p}=Wr({disabled:s,native:a}),h=l.useMemo(()=>({disabled:s}),[s]);return ft("button",t,{state:h,ref:[n,p],props:[{onClick:d},i,f]})});process.env.NODE_ENV!=="production"&&(Kr.displayName="DialogClose");const Sl={...l};let xo=0;function Tl(e,t="mui"){const[n,r]=l.useState(e),o=e||n;return l.useEffect(()=>{n==null&&(xo+=1,r(`${t}-${xo}`))},[n,t]),o}const So=Sl.useId;function Kn(e,t){if(So!==void 0){const n=So();return e??(t?`${t}-${n}`:n)}return Tl(e,t)}function Gr(e){return Kn(e,"base-ui")}const Js=l.forwardRef(function(t,n){const{render:r,className:o,id:s,...a}=t,{store:i}=pt(),u=Gr(s);return i.useSyncedValueWithCleanup("descriptionElementId",u),ft("p",t,{ref:n,props:[{id:u},a]})});process.env.NODE_ENV!=="production"&&(Js.displayName="DialogDescription");const Rl=[];function Zs(e){l.useEffect(e,Rl)}const Vt=0;class Nt{static create(){return new Nt}currentId=Vt;start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=Vt,n()},t)}isStarted(){return this.currentId!==Vt}clear=()=>{this.currentId!==Vt&&(clearTimeout(this.currentId),this.currentId=Vt)};disposeEffect=()=>this.clear}function Zt(){const e=dt(Nt.create).current;return Zs(e.disposeEffect),e}function Ht(e){const t=dt(kl,e).current;return t.next=e,De(t.effect),t}function kl(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}const jt=typeof navigator<"u",sr=Il(),Qs=Nl(),ea=Pl(),Cl=typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter:none"),Ol=sr.platform==="MacIntel"&&sr.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(sr.platform),Al=jt&&/apple/i.test(navigator.vendor),Pr=jt&&/android/i.test(Qs)||/android/i.test(ea);jt&&Qs.toLowerCase().startsWith("mac")&&navigator.maxTouchPoints;const Dl=ea.includes("jsdom/");function Il(){if(!jt)return{platform:"",maxTouchPoints:-1};const e=navigator.userAgentData;return e?.platform?{platform:e.platform,maxTouchPoints:navigator.maxTouchPoints}:{platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??-1}}function Pl(){if(!jt)return"";const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:t,version:n})=>`${t}/${n}`).join(" "):navigator.userAgent}function Nl(){if(!jt)return"";const e=navigator.userAgentData;return e?.platform?e.platform:navigator.platform??""}const Nr="data-base-ui-focusable",ta="active",na="selected",_l="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function At(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function Re(e,t){if(!e||!t)return!1;const n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&kr(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function qe(e){return"composedPath"in e?e.composedPath()[0]:e.target}function He(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function Ml(e){return e.matches("html,body")}function $e(e){return e?.ownerDocument||document}function ra(e){return nt(e)&&e.matches(_l)}function To(e){return e?e.getAttribute("role")==="combobox"&&ra(e):!1}function _r(e){return e?e.hasAttribute(Nr)?e:e.querySelector(`[${Nr}]`)||e:null}function Dt(e,t,n=!0){return e.filter(o=>o.parentId===t&&(!n||o.context?.open)).flatMap(o=>[o,...Dt(e,o.id,n)])}function Ro(e,t){let n=[],r=e.find(o=>o.id===t)?.parentId;for(;r;){const o=e.find(s=>s.id===r);r=o?.parentId,o&&(n=n.concat(o))}return n}function Ll(e){e.preventDefault(),e.stopPropagation()}function jl(e){return"nativeEvent"in e}function Fl(e){return e.mozInputSource===0&&e.isTrusted?!0:Pr&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function $l(e){return Dl?!1:!Pr&&e.width===0&&e.height===0||Pr&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function ko(e,t){return["mouse","pen"].includes(e)}function oa(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}var Bl=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],_n=Bl.join(","),sa=typeof Element>"u",_t=sa?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Mn=!sa&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e?.ownerDocument},Ln=function(t,n){var r;n===void 0&&(n=!0);var o=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"inert"),s=o===""||o==="true",a=s||n&&t&&(typeof t.closest=="function"?t.closest("[inert]"):Ln(t.parentNode));return a},Ul=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},aa=function(t,n,r){if(Ln(t))return[];var o=Array.prototype.slice.apply(t.querySelectorAll(_n));return n&&_t.call(t,_n)&&o.unshift(t),o=o.filter(r),o},jn=function(t,n,r){for(var o=[],s=Array.from(t);s.length;){var a=s.shift();if(!Ln(a,!1))if(a.tagName==="SLOT"){var i=a.assignedElements(),u=i.length?i:a.children,c=jn(u,!0,r);r.flatten?o.push.apply(o,c):o.push({scopeParent:a,candidates:c})}else{var d=_t.call(a,_n);d&&r.filter(a)&&(n||!t.includes(a))&&o.push(a);var f=a.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(a),p=!Ln(f,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(a));if(f&&p){var h=jn(f===!0?a.children:f.children,!0,r);r.flatten?o.push.apply(o,h):o.push({scopeParent:a,candidates:h})}else s.unshift.apply(s,a.children)}}return o},ia=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},ca=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||Ul(t))&&!ia(t)?0:t.tabIndex},Vl=function(t,n){var r=ca(t);return r<0&&n&&!ia(t)?0:r},Wl=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},la=function(t){return t.tagName==="INPUT"},zl=function(t){return la(t)&&t.type==="hidden"},Hl=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},ql=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},Kl=function(t){if(!t.name)return!0;var n=t.form||Mn(t),r=function(i){return n.querySelectorAll('input[type="radio"][name="'+i+'"]')},o;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")o=r(window.CSS.escape(t.name));else try{o=r(t.name)}catch(a){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",a.message),!1}var s=ql(o,t.form);return!s||s===t},Gl=function(t){return la(t)&&t.type==="radio"},Yl=function(t){return Gl(t)&&!Kl(t)},Xl=function(t){var n,r=t&&Mn(t),o=(n=r)===null||n===void 0?void 0:n.host,s=!1;if(r&&r!==t){var a,i,u;for(s=!!((a=o)!==null&&a!==void 0&&(i=a.ownerDocument)!==null&&i!==void 0&&i.contains(o)||t!=null&&(u=t.ownerDocument)!==null&&u!==void 0&&u.contains(t));!s&&o;){var c,d,f;r=Mn(o),o=(c=r)===null||c===void 0?void 0:c.host,s=!!((d=o)!==null&&d!==void 0&&(f=d.ownerDocument)!==null&&f!==void 0&&f.contains(o))}}return s},Co=function(t){var n=t.getBoundingClientRect(),r=n.width,o=n.height;return r===0&&o===0},Jl=function(t,n){var r=n.displayCheck,o=n.getShadowRoot;if(r==="full-native"&&"checkVisibility"in t){var s=t.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!s}if(getComputedStyle(t).visibility==="hidden")return!0;var a=_t.call(t,"details>summary:first-of-type"),i=a?t.parentElement:t;if(_t.call(i,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="full-native"||r==="legacy-full"){if(typeof o=="function"){for(var u=t;t;){var c=t.parentElement,d=Mn(t);if(c&&!c.shadowRoot&&o(c)===!0)return Co(t);t.assignedSlot?t=t.assignedSlot:!c&&d!==t.ownerDocument?t=d.host:t=c}t=u}if(Xl(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return Co(t);return!1},Zl=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r<n.children.length;r++){var o=n.children.item(r);if(o.tagName==="LEGEND")return _t.call(n,"fieldset[disabled] *")?!0:!o.contains(t)}return!0}n=n.parentElement}return!1},Mr=function(t,n){return!(n.disabled||zl(n)||Jl(n,t)||Hl(n)||Zl(n))},Lr=function(t,n){return!(Yl(n)||ca(n)<0||!Mr(t,n))},Ql=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},ua=function(t){var n=[],r=[];return t.forEach(function(o,s){var a=!!o.scopeParent,i=a?o.scopeParent:o,u=Vl(i,a),c=a?ua(o.candidates):i;u===0?a?n.push.apply(n,c):n.push(i):r.push({documentOrder:s,tabIndex:u,item:o,isScope:a,content:c})}),r.sort(Wl).reduce(function(o,s){return s.isScope?o.push.apply(o,s.content):o.push(s.content),o},[]).concat(n)},Gn=function(t,n){n=n||{};var r;return n.getShadowRoot?r=jn([t],n.includeContainer,{filter:Lr.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:Ql}):r=aa(t,n.includeContainer,Lr.bind(null,n)),ua(r)},eu=function(t,n){n=n||{};var r;return n.getShadowRoot?r=jn([t],n.includeContainer,{filter:Mr.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):r=aa(t,n.includeContainer,Mr.bind(null,n)),r},da=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return _t.call(t,_n)===!1?!1:Lr(n,t)};const nn=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function fa(e,t){const n=Gn(e,nn()),r=n.length;if(r===0)return;const o=At($e(e)),s=n.indexOf(o),a=s===-1?t===1?0:r-1:s+t;return n[a]}function pa(e){return fa($e(e).body,1)||e}function ma(e){return fa($e(e).body,-1)||e}function Yt(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!Re(n,r)}function tu(e){Gn(e,nn()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function Oo(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}function nu(){const e=new Map;return{emit(t,n){e.get(t)?.forEach(r=>r(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}const ha=l.createContext(null);process.env.NODE_ENV!=="production"&&(ha.displayName="FloatingNodeContext");const ga=l.createContext(null);process.env.NODE_ENV!=="production"&&(ga.displayName="FloatingTreeContext");const va=()=>l.useContext(ha)?.id||null,ba=e=>{const t=l.useContext(ga);return e??t};function Fn(e){return`data-base-ui-${e}`}const ya={clip:"rect(0 0 0 0)",overflow:"hidden",whiteSpace:"nowrap",position:"fixed",top:0,left:0,border:0,padding:0,width:1,height:1,margin:-1},fn=null;let Ao=globalThis.requestAnimationFrame;class ru{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=t=>{this.isScheduled=!1;const n=this.callbacks,r=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,r>0)for(let o=0;o<n.length;o+=1)n[o]?.(t)};request(t){const n=this.nextId;this.nextId+=1,this.callbacks.push(t),this.callbacksCount+=1;const r=process.env.NODE_ENV==="test"&&Ao!==requestAnimationFrame&&(Ao=requestAnimationFrame,!0);return(!this.isScheduled||r)&&(requestAnimationFrame(this.tick),this.isScheduled=!0),n}cancel(t){const n=t-this.startId;n<0||n>=this.callbacks.length||(this.callbacks[n]=null,this.callbacksCount-=1)}}const pn=new ru;class Xe{static create(){return new Xe}static request(t){return pn.request(t)}static cancel(t){return pn.cancel(t)}currentId=fn;request(t){this.cancel(),this.currentId=pn.request(()=>{this.currentId=fn,t()})}cancel=()=>{this.currentId!==fn&&(pn.cancel(this.currentId),this.currentId=fn)};disposeEffect=()=>this.cancel}function Yr(){const e=dt(Xe.create).current;return Zs(e.disposeEffect),e}function Yn(e){return e?.ownerDocument||document}const Qt=l.forwardRef(function(t,n){const[r,o]=l.useState();De(()=>{Al&&o("button")},[]);const s={tabIndex:0,role:r};return S.jsx("span",{...t,ref:n,style:ya,"aria-hidden":r?void 0:!0,...s,"data-base-ui-focus-guard":""})});process.env.NODE_ENV!=="production"&&(Qt.displayName="FocusGuard");let Do=0;function ar(e,t={}){const{preventScroll:n=!1,cancelPrevious:r=!0,sync:o=!1}=t;r&&cancelAnimationFrame(Do);const s=()=>e?.focus({preventScroll:n});o?s():Do=requestAnimationFrame(s)}const It={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function Io(e){return e==="inert"?It.inert:e==="aria-hidden"?It["aria-hidden"]:It.none}let mn=new WeakSet,hn={},ir=0;const wa=e=>e&&(e.host||wa(e.parentNode)),ou=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=wa(n);return e.contains(r)?r:null}).filter(n=>n!=null);function su(e,t,n,r){const o="data-base-ui-inert",s=r?"inert":n?"aria-hidden":null,a=ou(t,e),i=new Set,u=new Set(a),c=[];hn[o]||(hn[o]=new WeakMap);const d=hn[o];a.forEach(f),p(t),i.clear();function f(h){!h||i.has(h)||(i.add(h),h.parentNode&&f(h.parentNode))}function p(h){!h||u.has(h)||[].forEach.call(h.children,g=>{if(Hn(g)!=="script")if(i.has(g))p(g);else{const m=s?g.getAttribute(s):null,v=m!==null&&m!=="false",y=Io(s),E=(y.get(g)||0)+1,R=(d.get(g)||0)+1;y.set(g,E),d.set(g,R),c.push(g),E===1&&v&&mn.add(g),R===1&&g.setAttribute(o,""),!v&&s&&g.setAttribute(s,s==="inert"?"":"true")}})}return ir+=1,()=>{c.forEach(h=>{const g=Io(s),v=(g.get(h)||0)-1,y=(d.get(h)||0)-1;g.set(h,v),d.set(h,y),v||(!mn.has(h)&&s&&h.removeAttribute(s),mn.delete(h)),y||h.removeAttribute(o)}),ir-=1,ir||(It.inert=new WeakMap,It["aria-hidden"]=new WeakMap,It.none=new WeakMap,mn=new WeakSet,hn={})}}function au(e,t=!1,n=!1){const r=$e(e[0]).body;return su(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,t,n)}const Xr=l.createContext(null);process.env.NODE_ENV!=="production"&&(Xr.displayName="PortalContext");const Ea=()=>l.useContext(Xr),iu=Fn("portal");function cu(e={}){const{ref:t,container:n,componentProps:r=Be,elementProps:o,elementState:s}=e,a=Kn(),u=Ea()?.portalNode,[c,d]=l.useState(null),[f,p]=l.useState(null),h=l.useRef(null);De(()=>{if(n===null){h.current&&(h.current=null,p(null),d(null));return}if(a==null)return;const v=(n&&(Ur(n)?n:n.current))??u??document.body;if(v==null){h.current&&(h.current=null,p(null),d(null));return}h.current!==v&&(h.current=v,p(null),d(v))},[n,u,a]);const g=ft("div",r,{ref:[t,p],state:s,props:[{id:a,[iu]:""},o]});return{portalNode:f,portalSubtree:c&&g?Jt.createPortal(g,c):null}}const xa=l.forwardRef(function(t,n){const{children:r,container:o,className:s,render:a,renderGuards:i,...u}=t,{portalNode:c,portalSubtree:d}=cu({container:o,ref:n,componentProps:t,elementProps:u}),f=l.useRef(null),p=l.useRef(null),h=l.useRef(null),g=l.useRef(null),[m,v]=l.useState(null),y=m?.modal,E=m?.open,R=typeof i=="boolean"?i:!!m&&!m.modal&&m.open&&!!c;l.useEffect(()=>{if(!c||y)return;function C(O){c&&Yt(O)&&(O.type==="focusin"?Oo:tu)(c)}return c.addEventListener("focusin",C,!0),c.addEventListener("focusout",C,!0),()=>{c.removeEventListener("focusin",C,!0),c.removeEventListener("focusout",C,!0)}},[c,y]),l.useEffect(()=>{!c||E||Oo(c)},[E,c]);const b=l.useMemo(()=>({beforeOutsideRef:f,afterOutsideRef:p,beforeInsideRef:h,afterInsideRef:g,portalNode:c,setFocusManagerState:v}),[c]);return S.jsxs(l.Fragment,{children:[d,S.jsxs(Xr.Provider,{value:b,children:[R&&c&&S.jsx(Qt,{"data-type":"outside",ref:f,onFocus:C=>{if(Yt(C,c))h.current?.focus();else{const O=m?m.domReference:null;ma(O)?.focus()}}}),R&&c&&S.jsx("span",{"aria-owns":c.id,style:hc}),c&&Jt.createPortal(r,c),R&&c&&S.jsx(Qt,{"data-type":"outside",ref:p,onFocus:C=>{if(Yt(C,c))g.current?.focus();else{const O=m?m.domReference:null;pa(O)?.focus(),m?.closeOnFocusOut&&m?.onOpenChange(!1,We(Xs,C.nativeEvent))}}})]})]})});process.env.NODE_ENV!=="production"&&(xa.displayName="FloatingPortal");function yt(e){return e==null?e:"current"in e?e.current:e}function lu(e,t){const n=Qe(e.target);return e instanceof n.KeyboardEvent?"keyboard":e instanceof n.FocusEvent?t||"keyboard":"pointerType"in e?e.pointerType||"keyboard":"touches"in e?"touch":e instanceof n.MouseEvent?t||(e.detail===0?"keyboard":"mouse"):""}const Po=20;let lt=[];function Jr(){lt=lt.filter(e=>e.isConnected)}function uu(e){Jr(),e&&Hn(e)!=="body"&&(lt.push(e),lt.length>Po&&(lt=lt.slice(-Po)))}function cr(){return Jr(),lt[lt.length-1]}function du(e){if(!e)return null;const t=nn();return da(e,t)?e:Gn(e,t)[0]||e}function fu(e){return!e||!e.isConnected?!1:typeof e.checkVisibility=="function"?e.checkVisibility():Vr(e).display!=="none"}function No(e,t){if(!t.current.includes("floating")&&!e.getAttribute("role")?.includes("dialog"))return;const n=nn(),o=eu(e,n).filter(a=>{const i=a.getAttribute("data-tabindex")||"";return da(a,n)||a.hasAttribute("data-tabindex")&&!i.startsWith("-")}),s=e.getAttribute("tabindex");t.current.includes("floating")||o.length===0?s!=="0"&&e.setAttribute("tabindex","0"):(s!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}function pu(e){const{context:t,children:n,disabled:r=!1,order:o=["content"],initialFocus:s=!0,returnFocus:a=!0,restoreFocus:i=!1,modal:u=!0,closeOnFocusOut:c=!0,openInteractionType:d="",getInsideElements:f=()=>[],nextFocusableElement:p,previousFocusableElement:h,beforeContentFocusGuardRef:g,externalTree:m}=e,v="rootStore"in t?t.rootStore:t,y=v.useState("open"),E=v.useState("domReferenceElement"),R=v.useState("floatingElement"),{events:b,dataRef:C}=v.context,O=me(()=>C.current.floatingContext?.nodeId),T=me(f),x=s===!1,I=To(E)&&x,H=Ht(o),q=Ht(s),Q=Ht(a),L=Ht(d),ee=ba(m),N=Ea(),J=l.useRef(null),te=l.useRef(null),A=l.useRef(!1),ce=l.useRef(!1),re=l.useRef(!1),w=l.useRef(-1),U=l.useRef(""),M=l.useRef(""),K=Zt(),Ee=Zt(),he=Yr(),P=N!=null,j=_r(R),pe=me((V=j)=>V?Gn(V,nn()):[]),ye=me(V=>{const B=pe(V);return H.current.map(()=>B).filter(Boolean).flat()});l.useEffect(()=>{if(r||!u)return;function V(ve){ve.key==="Tab"&&Re(j,At($e(j)))&&pe().length===0&&!I&&Ll(ve)}const B=$e(j);return B.addEventListener("keydown",V),()=>{B.removeEventListener("keydown",V)}},[r,E,j,u,H,I,pe,ye]),l.useEffect(()=>{if(r||!R)return;function V(B){const ve=qe(B),ue=pe().indexOf(ve);ue!==-1&&(w.current=ue)}return R.addEventListener("focusin",V),()=>{R.removeEventListener("focusin",V)}},[r,R,pe]),l.useEffect(()=>{if(r||!y)return;const V=$e(j);function B(){re.current=!1}function ve(ue){const _=qe(ue),ne=Re(R,_)||Re(E,_)||Re(N?.portalNode,_);re.current=!ne,M.current=ue.pointerType||"keyboard"}function le(){M.current="keyboard"}return V.addEventListener("pointerdown",ve,!0),V.addEventListener("pointerup",B,!0),V.addEventListener("pointercancel",B,!0),V.addEventListener("keydown",le,!0),()=>{V.removeEventListener("pointerdown",ve,!0),V.removeEventListener("pointerup",B,!0),V.removeEventListener("pointercancel",B,!0),V.removeEventListener("keydown",le,!0)}},[r,R,E,j,y,N]),l.useEffect(()=>{if(r||!c)return;function V(){ce.current=!0,Ee.start(0,()=>{ce.current=!1})}function B(_){const ne=_.relatedTarget,Ce=_.currentTarget,Ie=qe(_);queueMicrotask(()=>{const Ve=O(),et=v.context.triggerElements,G=!(Re(E,ne)||Re(R,ne)||Re(ne,R)||Re(N?.portalNode,ne)||ne!=null&&et.hasElement(ne)||et.hasMatchingElement(ae=>Re(ae,ne))||ne?.hasAttribute(Fn("focus-guard"))||ee&&(Dt(ee.nodesRef.current,Ve).find(ae=>Re(ae.context?.elements.floating,ne)||Re(ae.context?.elements.domReference,ne))||Ro(ee.nodesRef.current,Ve).find(ae=>[ae.context?.elements.floating,_r(ae.context?.elements.floating)].includes(ne)||ae.context?.elements.domReference===ne)));if(Ce===E&&j&&No(j,H),i&&Ce!==E&&!fu(Ie)&&At($e(j))===$e(j).body){if(nt(j)&&(j.focus(),i==="popup")){he.request(()=>{j.focus()});return}const ae=w.current,Z=pe(),be=Z[ae]||Z[Z.length-1]||j;nt(be)&&be.focus()}if(C.current.insideReactTree){C.current.insideReactTree=!1;return}(I||!u)&&ne&&G&&!ce.current&&(I||ne!==cr())&&(A.current=!0,v.setOpen(!1,We(Xs,_)))})}function ve(){re.current||(C.current.insideReactTree=!0,K.start(0,()=>{C.current.insideReactTree=!1}))}const le=nt(E)?E:null,ue=[];if(!(!R&&!le))return le&&(le.addEventListener("focusout",B),le.addEventListener("pointerdown",V),ue.push(()=>{le.removeEventListener("focusout",B),le.removeEventListener("pointerdown",V)})),R&&(R.addEventListener("focusout",B),N&&(R.addEventListener("focusout",ve,!0),ue.push(()=>{R.removeEventListener("focusout",ve,!0)})),ue.push(()=>{R.removeEventListener("focusout",B)})),()=>{ue.forEach(_=>{_()})}},[r,E,R,j,u,ee,N,v,c,i,pe,I,O,H,C,K,Ee,he]);const k=l.useRef(null),Y=l.useRef(null),z=In(k,g,N?.beforeInsideRef),W=In(Y,N?.afterInsideRef);l.useEffect(()=>{if(r||!R||!y)return;const V=Array.from(N?.portalNode?.querySelectorAll(`[${Fn("portal")}]`)||[]),ve=(ee?Ro(ee.nodesRef.current,O()):[]).find(_=>To(_.context?.elements.domReference||null))?.context?.elements.domReference,le=[R,ve,...V,...T(),J.current,te.current,k.current,Y.current,N?.beforeOutsideRef.current,N?.afterOutsideRef.current,yt(h),yt(p),I?E:null].filter(_=>_!=null),ue=au(le,u||I);return()=>{ue()}},[y,r,E,R,u,H,N,I,ee,O,T,p,h]),De(()=>{if(!y||r||!nt(j))return;const V=$e(j),B=At(V);queueMicrotask(()=>{const ve=ye(j),le=q.current,ue=typeof le=="function"?le(L.current||""):le;if(ue===void 0||ue===!1)return;let _;ue===!0||ue===null?_=ve[0]||j:_=yt(ue),_=_||ve[0]||j,!Re(j,B)&&ar(_,{preventScroll:_===j})})},[r,y,j,x,ye,q,L]),De(()=>{if(r||!j)return;const V=$e(j),B=At(V);uu(B);function ve(_){if(_.open||(U.current=lu(_.nativeEvent,M.current)),_.reason===yl&&_.nativeEvent.type==="mouseleave"&&(A.current=!0),_.reason===Ys)if(_.nested)A.current=!1;else if(Fl(_.nativeEvent)||$l(_.nativeEvent))A.current=!1;else{let ne=!1;document.createElement("div").focus({get preventScroll(){return ne=!0,!1}}),ne?A.current=!1:A.current=!0}}b.on("openchange",ve);const le=V.createElement("span");le.setAttribute("tabindex","-1"),le.setAttribute("aria-hidden","true"),Object.assign(le.style,ya),P&&E&&E.insertAdjacentElement("afterend",le);function ue(){const _=Q.current;let ne=typeof _=="function"?_(U.current):_;if(ne===void 0||ne===!1)return null;if(ne===null&&(ne=!0),typeof ne=="boolean"){const Ie=E||cr();return Ie&&Ie.isConnected?Ie:le}const Ce=E||cr()||le;return yt(ne)||Ce}return()=>{b.off("openchange",ve);const _=At(V),ne=Re(R,_)||ee&&Dt(ee.nodesRef.current,O(),!1).some(Ie=>Re(Ie.context?.elements.floating,_)),Ce=ue();queueMicrotask(()=>{const Ie=du(Ce),Ve=typeof Q.current!="boolean";Q.current&&!A.current&&nt(Ie)&&(!(!Ve&&Ie!==_&&_!==V.body)||ne)&&Ie.focus({preventScroll:!0}),le.remove()})}},[r,R,j,Q,C,b,ee,P,E,O]),l.useEffect(()=>{queueMicrotask(()=>{A.current=!1})},[r]),l.useEffect(()=>{if(r||!y)return;function V(ve){qe(ve)?.closest(`[${Ds}]`)&&(ce.current=!0)}const B=$e(j);return B.addEventListener("pointerdown",V,!0),()=>{B.removeEventListener("pointerdown",V,!0)}},[r,y,j]),De(()=>{if(!r&&N)return N.setFocusManagerState({modal:u,closeOnFocusOut:c,open:y,onOpenChange:v.setOpen,domReference:E}),()=>{N.setFocusManagerState(null)}},[r,N,u,y,v,c,E]),De(()=>{if(!(r||!j))return No(j,H),()=>{queueMicrotask(Jr)}},[r,j,H]);const oe=!r&&(u?!I:!0)&&(P||u);return S.jsxs(l.Fragment,{children:[oe&&S.jsx(Qt,{"data-type":"inside",ref:z,onFocus:V=>{if(u){const B=ye();ar(B[B.length-1])}else N?.portalNode&&(A.current=!1,Yt(V,N.portalNode)?pa(E)?.focus():yt(h??N.beforeOutsideRef)?.focus())}}),n,oe&&S.jsx(Qt,{"data-type":"inside",ref:W,onFocus:V=>{u?ar(ye()[0]):N?.portalNode&&(c&&(A.current=!0),Yt(V,N.portalNode)?ma(E)?.focus():yt(p??N.afterOutsideRef)?.focus())}})]})}function mu(e,t={}){const n="rootStore"in e?e.rootStore:e,r=n.context.dataRef,{enabled:o=!0,event:s="click",toggle:a=!0,ignoreMouse:i=!1,stickIfOpen:u=!0,touchOpenDelay:c=0}=t,d=l.useRef(void 0),f=Yr(),p=Zt(),h=l.useMemo(()=>({onPointerDown(g){d.current=g.pointerType},onMouseDown(g){const m=d.current,v=g.nativeEvent,y=n.select("open");if(g.button!==0||s==="click"||ko(m)&&i)return;const E=r.current.openEvent,R=E?.type,b=n.select("domReferenceElement")!==g.currentTarget,C=y&&b||!(y&&a&&(!(E&&u)||R==="click"||R==="mousedown"));if(ra(v.target)){const T=We(Gt,v,v.target);C&&m==="touch"&&c>0?p.start(c,()=>{n.setOpen(!0,T)}):n.setOpen(C,T);return}const O=g.currentTarget;f.request(()=>{const T=We(Gt,v,O);C&&m==="touch"&&c>0?p.start(c,()=>{n.setOpen(!0,T)}):n.setOpen(C,T)})},onClick(g){if(s==="mousedown-only")return;const m=d.current;if(s==="mousedown"&&m){d.current=void 0;return}if(ko(m)&&i)return;const v=n.select("open"),y=r.current.openEvent,E=n.select("domReferenceElement")!==g.currentTarget,R=v&&E||!(v&&a&&(!(y&&u)||oa(y))),b=We(Gt,g.nativeEvent,g.currentTarget);R&&m==="touch"&&c>0?p.start(c,()=>{n.setOpen(!0,b)}):n.setOpen(R,b)},onKeyDown(){d.current=void 0}}),[r,s,i,n,u,a,f,p,c]);return l.useMemo(()=>o?{reference:h}:Be,[o,h])}const hu={intentional:"onClick",sloppy:"onPointerDown"};function gu(e){return{escapeKey:typeof e=="boolean"?e:e?.escapeKey??!1,outsidePress:typeof e=="boolean"?e:e?.outsidePress??!0}}function vu(e,t={}){const n="rootStore"in e?e.rootStore:e,r=n.useState("open"),o=n.useState("floatingElement"),s=n.useState("referenceElement"),a=n.useState("domReferenceElement"),{onOpenChange:i,dataRef:u}=n.context,{enabled:c=!0,escapeKey:d=!0,outsidePress:f=!0,outsidePressEvent:p="sloppy",referencePress:h=!1,referencePressEvent:g="sloppy",ancestorScroll:m=!1,bubbles:v,externalTree:y}=t,E=ba(y),R=me(typeof f=="function"?f:()=>!1),b=typeof f=="function"?R:f,C=l.useRef(!1),{escapeKey:O,outsidePress:T}=gu(v),x=l.useRef(null),I=Zt(),H=Zt(),q=me(()=>{H.clear(),u.current.insideReactTree=!1}),Q=l.useRef(!1),L=l.useRef(""),ee=me(k=>{L.current=k.pointerType}),N=me(()=>{const k=L.current,Y=k==="pen"||!k?"mouse":k,z=typeof p=="function"?p():p;return typeof z=="string"?z:z[Y]}),J=me(k=>{if(!r||!c||!d||k.key!=="Escape"||Q.current)return;const Y=u.current.floatingContext?.nodeId,z=E?Dt(E.nodesRef.current,Y):[];if(!O&&z.length>0){let V=!0;if(z.forEach(B=>{B.context?.open&&!B.context.dataRef.current.__escapeKeyBubbles&&(V=!1)}),!V)return}const W=jl(k)?k.nativeEvent:k,oe=We(El,W);n.setOpen(!1,oe),!O&&!oe.isPropagationAllowed&&k.stopPropagation()}),te=me(k=>{const Y=N();return Y==="intentional"&&k.type!=="click"||Y==="sloppy"&&k.type==="click"}),A=me(()=>{u.current.insideReactTree=!0,H.start(0,q)}),ce=me((k,Y=!1)=>{if(te(k)){q();return}if(u.current.insideReactTree){q();return}if(N()==="intentional"&&Y||typeof b=="function"&&!b(k))return;const z=qe(k),W=`[${Fn("inert")}]`,oe=$e(n.select("floatingElement")).querySelectorAll(W),V=n.context.triggerElements;if(z&&(V.hasElement(z)||V.hasMatchingElement(_=>Re(_,z))))return;let B=bt(z)?z:null;for(;B&&!Cn(B);){const _=Es(B);if(Cn(_)||!bt(_))break;B=_}if(oe.length&&bt(z)&&!Ml(z)&&!Re(z,n.select("floatingElement"))&&Array.from(oe).every(_=>!Re(B,_)))return;if(nt(z)&&!("touches"in k)){const _=Cn(z),ne=Vr(z),Ce=/auto|scroll/,Ie=_||Ce.test(ne.overflowX),Ve=_||Ce.test(ne.overflowY),et=Ie&&z.clientWidth>0&&z.scrollWidth>z.clientWidth,G=Ve&&z.clientHeight>0&&z.scrollHeight>z.clientHeight,ae=ne.direction==="rtl",Z=G&&(ae?k.offsetX<=z.offsetWidth-z.clientWidth:k.offsetX>z.clientWidth),be=et&&k.offsetY>z.clientHeight;if(Z||be)return}const ve=u.current.floatingContext?.nodeId,le=E&&Dt(E.nodesRef.current,ve).some(_=>He(k,_.context?.elements.floating));if(He(k,n.select("floatingElement"))||He(k,n.select("domReferenceElement"))||le)return;const ue=E?Dt(E.nodesRef.current,ve):[];if(ue.length>0){let _=!0;if(ue.forEach(ne=>{ne.context?.open&&!ne.context.dataRef.current.__outsidePressBubbles&&(_=!1)}),!_)return}n.setOpen(!1,We(Ys,k)),q()}),re=me(k=>{N()!=="sloppy"||k.pointerType==="touch"||!n.select("open")||!c||He(k,n.select("floatingElement"))||He(k,n.select("domReferenceElement"))||ce(k)}),w=me(k=>{if(N()!=="sloppy"||!n.select("open")||!c||He(k,n.select("floatingElement"))||He(k,n.select("domReferenceElement")))return;const Y=k.touches[0];Y&&(x.current={startTime:Date.now(),startX:Y.clientX,startY:Y.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},I.start(1e3,()=>{x.current&&(x.current.dismissOnTouchEnd=!1,x.current.dismissOnMouseDown=!1)}))}),U=me(k=>{const Y=qe(k);function z(){w(k),Y?.removeEventListener(k.type,z)}Y?.addEventListener(k.type,z)}),M=me(k=>{const Y=C.current;if(C.current=!1,I.clear(),k.type==="mousedown"&&x.current&&!x.current.dismissOnMouseDown)return;const z=qe(k);function W(){k.type==="pointerdown"?re(k):ce(k,Y),z?.removeEventListener(k.type,W)}z?.addEventListener(k.type,W)}),K=me(k=>{if(N()!=="sloppy"||!x.current||He(k,n.select("floatingElement"))||He(k,n.select("domReferenceElement")))return;const Y=k.touches[0];if(!Y)return;const z=Math.abs(Y.clientX-x.current.startX),W=Math.abs(Y.clientY-x.current.startY),oe=Math.sqrt(z*z+W*W);oe>5&&(x.current.dismissOnTouchEnd=!0),oe>10&&(ce(k),I.clear(),x.current=null)}),Ee=me(k=>{const Y=qe(k);function z(){K(k),Y?.removeEventListener(k.type,z)}Y?.addEventListener(k.type,z)}),he=me(k=>{N()!=="sloppy"||!x.current||He(k,n.select("floatingElement"))||He(k,n.select("domReferenceElement"))||(x.current.dismissOnTouchEnd&&ce(k),I.clear(),x.current=null)}),P=me(k=>{const Y=qe(k);function z(){he(k),Y?.removeEventListener(k.type,z)}Y?.addEventListener(k.type,z)});l.useEffect(()=>{if(!r||!c)return;u.current.__escapeKeyBubbles=O,u.current.__outsidePressBubbles=T;const k=new Nt;function Y(B){n.setOpen(!1,We(bl,B))}function z(){k.clear(),Q.current=!0}function W(){k.start(Ki()?5:0,()=>{Q.current=!1})}const oe=$e(o);oe.addEventListener("pointerdown",ee,!0),d&&(oe.addEventListener("keydown",J),oe.addEventListener("compositionstart",z),oe.addEventListener("compositionend",W)),b&&(oe.addEventListener("click",M,!0),oe.addEventListener("pointerdown",M,!0),oe.addEventListener("touchstart",U,!0),oe.addEventListener("touchmove",Ee,!0),oe.addEventListener("touchend",P,!0),oe.addEventListener("mousedown",M,!0));let V=[];return m&&(bt(a)&&(V=qt(a)),bt(o)&&(V=V.concat(qt(o))),!bt(s)&&s&&s.contextElement&&(V=V.concat(qt(s.contextElement)))),V=V.filter(B=>B!==oe.defaultView?.visualViewport),V.forEach(B=>{B.addEventListener("scroll",Y,{passive:!0})}),()=>{oe.removeEventListener("pointerdown",ee,!0),d&&(oe.removeEventListener("keydown",J),oe.removeEventListener("compositionstart",z),oe.removeEventListener("compositionend",W)),b&&(oe.removeEventListener("click",M,!0),oe.removeEventListener("pointerdown",M,!0),oe.removeEventListener("touchstart",U,!0),oe.removeEventListener("touchmove",Ee,!0),oe.removeEventListener("touchend",P,!0),oe.removeEventListener("mousedown",M,!0)),V.forEach(B=>{B.removeEventListener("scroll",Y)}),k.clear()}},[u,o,s,a,d,b,r,i,m,c,O,T,J,ce,M,re,U,Ee,P,ee,n]),l.useEffect(q,[b,q]);const j=l.useMemo(()=>({onKeyDown:J,...h&&{[hu[g]]:k=>{n.setOpen(!1,We(Gt,k.nativeEvent))},...g!=="intentional"&&{onClick(k){n.setOpen(!1,We(Gt,k.nativeEvent))}}}}),[J,n,h,g]),pe=me(k=>{const Y=qe(k.nativeEvent);!Re(n.select("floatingElement"),Y)||k.button!==0||(C.current=!0)}),ye=l.useMemo(()=>({onKeyDown:J,onPointerDown:pe,onMouseDown:pe,onMouseUp:pe,onClickCapture:A,onMouseDownCapture:A,onPointerDownCapture:A,onMouseUpCapture:A,onTouchEndCapture:A,onTouchMoveCapture:A}),[J,pe,A]);return l.useMemo(()=>c?{reference:j,floating:ye,trigger:j}:{},[c,j,ye])}var bu=(e,t,n)=>{if(t.length===1&&t[0]===n){let r=!1;try{const o={};e(o)===o&&(r=!0)}catch{}if(r){let o;try{throw new Error}catch(s){({stack:o}=s)}console.warn(`The result function returned its own inputs without modification. e.g
|
|
7
7
|
\`createSelector([state => state.todos], todos => todos)\`
|
|
8
8
|
This could lead to inefficient memoization and unnecessary re-renders.
|
|
9
|
-
Ensure transformation logic is in the result function, and extraction logic is in the input selectors.`,{stack:o})}}},
|
|
9
|
+
Ensure transformation logic is in the result function, and extraction logic is in the input selectors.`,{stack:o})}}},yu=(e,t,n)=>{const{memoize:r,memoizeOptions:o}=t,{inputSelectorResults:s,inputSelectorResultsCopy:a}=e,i=r(()=>({}),...o);if(!(i.apply(null,s)===i.apply(null,a))){let c;try{throw new Error}catch(d){({stack:c}=d)}console.warn(`An input selector returned a different result when passed same arguments.
|
|
10
10
|
This means your output selector will likely run more frequently than intended.
|
|
11
11
|
Avoid returning a new reference inside your input selector, e.g.
|
|
12
|
-
\`createSelector([state => state.todos.map(todo => todo.id)], todoIds => todoIds.length)\``,{arguments:n,firstInputs:s,secondInputs:a,stack:l})}},qc={inputStabilityCheck:"once",identityFunctionCheck:"once"},Tn=Symbol("NOT_FOUND");function Kc(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function Xc(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function Zc(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(n=>typeof n=="function")){const n=e.map(r=>typeof r=="function"?`function ${r.name||"unnamed"}()`:typeof r).join(", ");throw new TypeError(`${t}[${n}]`)}}var go=e=>Array.isArray(e)?e:[e];function Jc(e){const t=Array.isArray(e[0])?e[0]:e;return Zc(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function ho(e,t){const n=[],{length:r}=e;for(let o=0;o<r;o++)n.push(e[o].apply(null,t));return n}var Qc=(e,t)=>{const{identityFunctionCheck:n,inputStabilityCheck:r}={...qc,...t};return{identityFunctionCheck:{shouldRun:n==="always"||n==="once"&&e,run:Gc},inputStabilityCheck:{shouldRun:r==="always"||r==="once"&&e,run:Yc}}};function eu(e){let t;return{get(n){return t&&e(t.key,n)?t.value:Tn},put(n,r){t={key:n,value:r}},getEntries(){return t?[t]:[]},clear(){t=void 0}}}function tu(e,t){let n=[];function r(i){const c=n.findIndex(l=>t(i,l.key));if(c>-1){const l=n[c];return c>0&&(n.splice(c,1),n.unshift(l)),l.value}return Tn}function o(i,c){r(i)===Tn&&(n.unshift({key:i,value:c}),n.length>e&&n.pop())}function s(){return n}function a(){n=[]}return{get:r,put:o,getEntries:s,clear:a}}var nu=(e,t)=>e===t;function ru(e){return function(n,r){if(n===null||r===null||n.length!==r.length)return!1;const{length:o}=n;for(let s=0;s<o;s++)if(!e(n[s],r[s]))return!1;return!0}}function ou(e,t){const n=typeof t=="object"?t:{equalityCheck:t},{equalityCheck:r=nu,maxSize:o=1,resultEqualityCheck:s}=n,a=ru(r);let i=0;const c=o<=1?eu(a):tu(o,a);function l(){let d=c.get(arguments);if(d===Tn){if(d=e.apply(null,arguments),i++,s){const p=c.getEntries().find(g=>s(g.value,d));p&&(d=p.value,i!==0&&i--)}c.put(arguments,d)}return d}return l.clearCache=()=>{c.clear(),l.resetResultsCount()},l.resultsCount=()=>i,l.resetResultsCount=()=>{i=0},l}var su=class{constructor(e){this.value=e}deref(){return this.value}},au=typeof WeakRef<"u"?WeakRef:su,iu=0,vo=1;function nn(){return{s:iu,v:void 0,o:null,p:null}}function Xs(e,t={}){let n=nn();const{resultEqualityCheck:r}=t;let o,s=0;function a(){let i=n;const{length:c}=arguments;for(let f=0,p=c;f<p;f++){const g=arguments[f];if(typeof g=="function"||typeof g=="object"&&g!==null){let h=i.o;h===null&&(i.o=h=new WeakMap);const m=h.get(g);m===void 0?(i=nn(),h.set(g,i)):i=m}else{let h=i.p;h===null&&(i.p=h=new Map);const m=h.get(g);m===void 0?(i=nn(),h.set(g,i)):i=m}}const l=i;let d;if(i.s===vo)d=i.v;else if(d=e.apply(null,arguments),s++,r){const f=o?.deref?.()??o;f!=null&&r(f,d)&&(d=f,s!==0&&s--),o=typeof d=="object"&&d!==null||typeof d=="function"?new au(d):d}return l.s=vo,l.v=d,d}return a.clearCache=()=>{n=nn(),a.resetResultsCount()},a.resultsCount=()=>s,a.resetResultsCount=()=>{s=0},a}function Zs(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,r=(...o)=>{let s=0,a=0,i,c={},l=o.pop();typeof l=="object"&&(c=l,l=o.pop()),Kc(l,`createSelector expects an output function after the inputs, but received: [${typeof l}]`);const d={...n,...c},{memoize:f,memoizeOptions:p=[],argsMemoize:g=Xs,argsMemoizeOptions:h=[],devModeChecks:m={}}=d,v=go(p),y=go(h),S=Jc(o),R=f(function(){return s++,l.apply(null,arguments)},...v);let b=!0;const O=g(function(){a++;const w=ho(S,arguments);if(i=R.apply(null,w),process.env.NODE_ENV!=="production"){const{identityFunctionCheck:E,inputStabilityCheck:I}=Qc(b,m);if(E.shouldRun&&E.run(l,w,i),I.shouldRun){const z=ho(S,arguments);I.run({inputSelectorResults:w,inputSelectorResultsCopy:z},{memoize:f,memoizeOptions:v},arguments)}b&&(b=!1)}return i},...y);return Object.assign(O,{resultFunc:l,memoizedResultFunc:R,dependencies:S,dependencyRecomputations:()=>a,resetDependencyRecomputations:()=>{a=0},lastResult:()=>i,recomputations:()=>s,resetRecomputations:()=>{s=0},memoize:f,argsMemoize:g})};return Object.assign(r,{withTypes:()=>r}),r}var lu=Zs(Xs),cu=Object.assign((e,t=lu)=>{Xc(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);const n=Object.keys(e),r=n.map(s=>e[s]);return t(r,(...s)=>s.reduce((a,i,c)=>(a[n[c]]=i,a),{}))},{withTypes:()=>cu});Zs({memoize:ou,memoizeOptions:{maxSize:1,equalityCheck:Object.is}});const le=(e,t,n,r,o,s,...a)=>{if(a.length>0)throw new Error(process.env.NODE_ENV!=="production"?"Unsupported number of selectors":dt(1));let i;if(e)i=e;else throw new Error("Missing arguments");return i};var rn={exports:{}},Yn={};var bo;function uu(){if(bo)return Yn;bo=1;var e=k;function t(f,p){return f===p&&(f!==0||1/f===1/p)||f!==f&&p!==p}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,o=e.useEffect,s=e.useLayoutEffect,a=e.useDebugValue;function i(f,p){var g=p(),h=r({inst:{value:g,getSnapshot:p}}),m=h[0].inst,v=h[1];return s(function(){m.value=g,m.getSnapshot=p,c(m)&&v({inst:m})},[f,g,p]),o(function(){return c(m)&&v({inst:m}),f(function(){c(m)&&v({inst:m})})},[f]),a(g),g}function c(f){var p=f.getSnapshot;f=f.value;try{var g=p();return!n(f,g)}catch{return!0}}function l(f,p){return p()}var d=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?l:i;return Yn.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:d,Yn}var qn={};var yo;function du(){return yo||(yo=1,process.env.NODE_ENV!=="production"&&(function(){function e(g,h){return g===h&&(g!==0||1/g===1/h)||g!==g&&h!==h}function t(g,h){d||o.startTransition===void 0||(d=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var m=h();if(!f){var v=h();s(m,v)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),f=!0)}v=a({inst:{value:m,getSnapshot:h}});var y=v[0].inst,S=v[1];return c(function(){y.value=m,y.getSnapshot=h,n(y)&&S({inst:y})},[g,m,h]),i(function(){return n(y)&&S({inst:y}),g(function(){n(y)&&S({inst:y})})},[g]),l(m),m}function n(g){var h=g.getSnapshot;g=g.value;try{var m=h();return!s(g,m)}catch{return!0}}function r(g,h){return h()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var o=k,s=typeof Object.is=="function"?Object.is:e,a=o.useState,i=o.useEffect,c=o.useLayoutEffect,l=o.useDebugValue,d=!1,f=!1,p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?r:t;qn.useSyncExternalStore=o.useSyncExternalStore!==void 0?o.useSyncExternalStore:p,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),qn}var wo;function Mr(){return wo||(wo=1,process.env.NODE_ENV==="production"?rn.exports=uu():rn.exports=du()),rn.exports}var fu=Mr(),on={exports:{}},Kn={};var Eo;function pu(){if(Eo)return Kn;Eo=1;var e=k,t=Mr();function n(l,d){return l===d&&(l!==0||1/l===1/d)||l!==l&&d!==d}var r=typeof Object.is=="function"?Object.is:n,o=t.useSyncExternalStore,s=e.useRef,a=e.useEffect,i=e.useMemo,c=e.useDebugValue;return Kn.useSyncExternalStoreWithSelector=function(l,d,f,p,g){var h=s(null);if(h.current===null){var m={hasValue:!1,value:null};h.current=m}else m=h.current;h=i(function(){function y(D){if(!S){if(S=!0,R=D,D=p(D),g!==void 0&&m.hasValue){var w=m.value;if(g(w,D))return b=w}return b=D}if(w=b,r(R,D))return w;var E=p(D);return g!==void 0&&g(w,E)?(R=D,w):(R=D,b=E)}var S=!1,R,b,O=f===void 0?null:f;return[function(){return y(d())},O===null?void 0:function(){return y(O())}]},[d,f,p,g]);var v=o(l,h[0],h[1]);return a(function(){m.hasValue=!0,m.value=v},[v]),c(v),v},Kn}var Xn={};var xo;function mu(){return xo||(xo=1,process.env.NODE_ENV!=="production"&&(function(){function e(l,d){return l===d&&(l!==0||1/l===1/d)||l!==l&&d!==d}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=k,n=Mr(),r=typeof Object.is=="function"?Object.is:e,o=n.useSyncExternalStore,s=t.useRef,a=t.useEffect,i=t.useMemo,c=t.useDebugValue;Xn.useSyncExternalStoreWithSelector=function(l,d,f,p,g){var h=s(null);if(h.current===null){var m={hasValue:!1,value:null};h.current=m}else m=h.current;h=i(function(){function y(D){if(!S){if(S=!0,R=D,D=p(D),g!==void 0&&m.hasValue){var w=m.value;if(g(w,D))return b=w}return b=D}if(w=b,r(R,D))return w;var E=p(D);return g!==void 0&&g(w,E)?(R=D,w):(R=D,b=E)}var S=!1,R,b,O=f===void 0?null:f;return[function(){return y(d())},O===null?void 0:function(){return y(O())}]},[d,f,p,g]);var v=o(l,h[0],h[1]);return a(function(){m.hasValue=!0,m.value=v},[v]),c(v),v},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),Xn}var So;function gu(){return So||(So=1,process.env.NODE_ENV==="production"?on.exports=pu():on.exports=mu()),on.exports}var hu=gu();const vu=Or(19),bu=vu?wu:Eu;function yu(e,t,n,r,o){return bu(e,t,n,r,o)}function wu(e,t,n,r,o){const s=u.useCallback(()=>t(e.getSnapshot(),n,r,o),[e,t,n,r,o]);return fu.useSyncExternalStore(e.subscribe,s,s)}function Eu(e,t,n,r,o){return hu.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,s=>t(s,n,r,o))}class Vt{constructor(t){this.state=t,this.listeners=new Set,this.updateTick=0}subscribe=t=>(this.listeners.add(t),()=>{this.listeners.delete(t)});getSnapshot=()=>this.state;setState(t){if(this.state===t)return;this.state=t,this.updateTick+=1;const n=this.updateTick;for(const r of this.listeners){if(n!==this.updateTick)return;r(t)}}update(t){for(const n in t)if(!Object.is(this.state[n],t[n])){Vt.prototype.setState.call(this,{...this.state,...t});return}}set(t,n){Object.is(this.state[t],n)||Vt.prototype.setState.call(this,{...this.state,[t]:n})}notifyAll(){const t={...this.state};Vt.prototype.setState.call(this,t)}}class Js extends Vt{constructor(t,n={},r){super(t),this.context=n,this.selectors=r}controlledValues=new Map;useSyncedValue(t,n){u.useDebugValue(t),Ee(()=>{this.state[t]!==n&&this.set(t,n)},[t,n])}useSyncedValueWithCleanup(t,n){Ee(()=>(this.state[t]!==n&&this.set(t,n),()=>{this.set(t,void 0)}),[t,n])}useSyncedValues(t){if(process.env.NODE_ENV!=="production"){u.useDebugValue(t,s=>Object.keys(s));const r=u.useRef(Object.keys(t)).current,o=Object.keys(t);(r.length!==o.length||r.some((s,a)=>s!==o[a]))&&console.error("ReactStore.useSyncedValues expects the same prop keys on every render. Keys should be stable.")}const n=Object.values(t);Ee(()=>{this.update(t)},n)}useControlledProp(t,n,r){u.useDebugValue(t);const o=n!==void 0;if(process.env.NODE_ENV!=="production"){const s=this.controlledValues.get(t);s!==void 0&&s!==o&&console.error(`A component is changing the ${o?"":"un"}controlled state of ${t.toString()} to be ${o?"un":""}controlled. Elements should not switch from uncontrolled to controlled (or vice versa).`)}this.controlledValues.has(t)||(this.controlledValues.set(t,o),!o&&!Object.is(this.state[t],r)&&super.setState({...this.state,[t]:r})),Ee(()=>{o&&!Object.is(this.state[t],n)&&super.setState({...this.state,[t]:n})},[t,n,r,o])}set(t,n){this.controlledValues.get(t)!==!0&&super.set(t,n)}update(t){const n={...t};for(const r in n)if(Object.hasOwn(n,r)&&this.controlledValues.get(r)===!0){delete n[r];continue}super.update(n)}setState(t){const n={...t};for(const r in n)if(Object.hasOwn(n,r)&&this.controlledValues.get(r)===!0){delete n[r];continue}super.setState({...this.state,...n})}select=(t,n,r,o)=>{const s=this.selectors[t];return s(this.state,n,r,o)};useState=(t,n,r,o)=>{u.useDebugValue(t);const s=this.selectors[t];return yu(this,s,n,r,o)};useContextCallback(t,n){u.useDebugValue(t);const r=se(n??ns);this.context[t]=r}useStateSetter(t){const n=u.useRef(void 0);return n.current===void 0&&(n.current=r=>{this.set(t,r)}),n.current}observe(t,n){let r;typeof t=="function"?r=t:r=this.selectors[t];let o=r(this.state);return n(o,o,this),this.subscribe(s=>{const a=r(s);if(!Object.is(o,a)){const i=o;o=a,n(a,i,this)}})}}const xu={open:le(e=>e.open),domReferenceElement:le(e=>e.domReferenceElement),referenceElement:le(e=>e.positionReference??e.referenceElement),floatingElement:le(e=>e.floatingElement),floatingId:le(e=>e.floatingId)};class Qs extends Js{constructor(t){const{nested:n,noEmit:r,onOpenChange:o,triggerElements:s,...a}=t;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:o,dataRef:{current:{}},events:Nc(),nested:n,noEmit:r,triggerElements:s},xu)}setOpen=(t,n)=>{if((!t||!this.state.open||Is(n.event))&&(this.context.dataRef.current.openEvent=t?n.event:void 0),!this.context.noEmit){const r={open:t,reason:n.reason,nativeEvent:n.event,nested:this.context.nested,triggerElement:n.trigger};this.context.events.emit("openchange",r)}this.context.onOpenChange?.(t,n)}}function Su(e,t=!1,n=!1){const[r,o]=u.useState(e&&t?"idle":void 0),[s,a]=u.useState(e);return e&&!s&&(a(!0),o("starting")),!e&&s&&r!=="ending"&&!n&&o("ending"),!e&&!s&&r==="ending"&&o(void 0),Ee(()=>{if(!e&&s&&r!=="ending"&&n){const i=Fe.request(()=>{o("ending")});return()=>{Fe.cancel(i)}}},[e,s,r,n]),Ee(()=>{if(!e||t)return;const i=Fe.request(()=>{o(void 0)});return()=>{Fe.cancel(i)}},[t,e]),Ee(()=>{if(!e||!t)return;e&&s&&r!=="idle"&&o("starting");const i=Fe.request(()=>{o("idle")});return()=>{Fe.cancel(i)}},[t,e,s,o,r]),u.useMemo(()=>({mounted:s,setMounted:a,transitionStatus:r}),[s,r])}function Ru(e,t=!1,n=!0){const r=Pr();return se((o,s=null)=>{r.cancel();const a=it(e);a!=null&&(typeof a.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED?o():r.request(()=>{function i(){a&&Promise.all(a.getAnimations().map(c=>c.finished)).then(()=>{s!=null&&s.aborted||Bt.flushSync(o)}).catch(()=>{if(n){if(s!=null&&s.aborted)return;Bt.flushSync(o)}else a.getAnimations().length>0&&a.getAnimations().some(c=>c.pending||c.playState!=="finished")&&i()})}t?r.request(i):i()}))})}function ea(e){const{enabled:t=!0,open:n,ref:r,onComplete:o}=e,s=Mt(n),a=se(o),i=Ru(r,n);u.useEffect(()=>{t&&i(()=>{n===s.current&&a()})},[t,n,a,i,s])}function Cu(e,t){const n=u.useRef(null);return u.useCallback(r=>{e!==void 0&&(n.current!==null&&(t.context.triggerElements.delete(n.current),n.current=null),r!==null&&(n.current=e,t.context.triggerElements.add(e,r)))},[t,e])}function Tu(e,t,n,r){const o=n.useState("isMountedByTrigger",e),s=Cu(e,n),a=se(i=>{s(i),i!==null&&n.select("open")&&n.select("activeTriggerId")==null&&n.update({activeTriggerId:e,activeTriggerElement:i,...r})});return Ee(()=>{o&&n.update({activeTriggerElement:t.current,...r})},[o,n,t,...Object.values(r)]),{registerTrigger:a,isMountedByThisTrigger:o}}function Ou(e){const t=e.useState("open");Ee(()=>{if(t&&!e.select("activeTriggerId")&&e.context.triggerElements.size===1){const n=e.context.triggerElements.entries().next();if(!n.done){const[r,o]=n.value;e.update({activeTriggerId:r,activeTriggerElement:o})}}},[t,e])}function ku(e,t,n){const{mounted:r,setMounted:o,transitionStatus:s}=Su(e);t.useSyncedValues({mounted:r,transitionStatus:s});const a=se(()=>{o(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)}),i=t.useState("preventUnmountingOnClose");return ea({enabled:!i,open:e,ref:t.context.popupRef,onComplete(){e||a()}}),{forceUnmount:a,transitionStatus:s}}class ta{constructor(){this.elements=new Set,this.idMap=new Map}add(t,n){const r=this.idMap.get(t);if(r!==n&&(r!==void 0&&this.elements.delete(r),this.elements.add(n),this.idMap.set(t,n),process.env.NODE_ENV!=="production"&&this.elements.size!==this.idMap.size))throw new Error(process.env.NODE_ENV!=="production"?"Base UI: A trigger element cannot be registered under multiple IDs in PopupTriggerMap.":dt(87))}delete(t){const n=this.idMap.get(t);n&&(this.elements.delete(n),this.idMap.delete(t))}hasElement(t){return this.elements.has(t)}hasMatchingElement(t){for(const n of this.elements)if(t(n))return!0;return!1}getById(t){return this.idMap.get(t)}entries(){return this.idMap.entries()}get size(){return this.idMap.size}}function Du(){return new Qs({open:!1,floatingElement:null,referenceElement:null,triggerElements:new ta,floatingId:"",nested:!1,noEmit:!1,onOpenChange:void 0})}function Nu(){return{open:!1,mounted:!1,transitionStatus:"idle",floatingRootContext:Du(),preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,popupElement:null,positionerElement:null,activeTriggerProps:Ie,inactiveTriggerProps:Ie,popupProps:Ie}}const Iu={open:le(e=>e.open),mounted:le(e=>e.mounted),transitionStatus:le(e=>e.transitionStatus),floatingRootContext:le(e=>e.floatingRootContext),preventUnmountingOnClose:le(e=>e.preventUnmountingOnClose),payload:le(e=>e.payload),activeTriggerId:le(e=>e.activeTriggerId),activeTriggerElement:le(e=>e.mounted?e.activeTriggerElement:null),isTriggerActive:le((e,t)=>t!==void 0&&e.activeTriggerId===t),isOpenedByTrigger:le((e,t)=>t!==void 0&&e.activeTriggerId===t&&e.open),isMountedByTrigger:le((e,t)=>t!==void 0&&e.activeTriggerId===t&&e.mounted),triggerProps:le((e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps),popupProps:le(e=>e.popupProps),popupElement:le(e=>e.popupElement),positionerElement:le(e=>e.positionerElement)};function Pu(e){const{popupStore:t,noEmit:n=!1,treatPopupAsFloatingElement:r=!1,onOpenChange:o}=e,s=Pn(),a=Us()!=null,i=t.useState("open"),c=t.useState("activeTriggerElement"),l=t.useState(r?"popupElement":"positionerElement"),d=t.context.triggerElements,f=Ze(()=>new Qs({open:i,referenceElement:c,floatingElement:l,triggerElements:d,onOpenChange:o,floatingId:s,nested:a,noEmit:n})).current;return Ee(()=>{const p={open:i,floatingId:s,referenceElement:c,floatingElement:l};at(c)&&(p.domReferenceElement=c),f.update(p)},[i,s,c,l,f]),f.context.onOpenChange=o,f.context.nested=a,f.context.noEmit=n,f}function na(e=[]){const t=e.map(l=>l?.reference),n=e.map(l=>l?.floating),r=e.map(l=>l?.item),o=e.map(l=>l?.trigger),s=u.useCallback(l=>sn(l,e,"reference"),t),a=u.useCallback(l=>sn(l,e,"floating"),n),i=u.useCallback(l=>sn(l,e,"item"),r),c=u.useCallback(l=>sn(l,e,"trigger"),o);return u.useMemo(()=>({getReferenceProps:s,getFloatingProps:a,getItemProps:i,getTriggerProps:c}),[s,a,i,c])}function sn(e,t,n){const r=new Map,o=n==="item",s={};n==="floating"&&(s.tabIndex=-1,s[hr]="");for(const a in e)o&&e&&(a===ks||a===Ds)||(s[a]=e[a]);for(let a=0;a<t.length;a+=1){let i;const c=t[a]?.[n];typeof c=="function"?i=e?c(e):null:i=c,i&&Ro(s,i,o,r)}return Ro(s,e,o,r),s}function Ro(e,t,n,r){for(const o in t){const s=t[o];n&&(o===ks||o===Ds)||(o.startsWith("on")?(r.has(o)||r.set(o,[]),typeof s=="function"&&(r.get(o)?.push(s),e[o]=(...a)=>r.get(o)?.map(i=>i(...a)).find(i=>i!==void 0))):e[o]=s)}}const Au=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function _u(e,t={}){const n="rootStore"in e?e.rootStore:e,r=n.useState("open"),o=n.useState("floatingId"),s=n.useState("domReferenceElement"),a=n.useState("floatingElement"),{enabled:i=!0,role:c="dialog"}=t,l=Pn(),d=s?.id||l,f=u.useMemo(()=>vr(a)?.id||o,[a,o]),p=Au.get(c)??c,h=Us()!=null,m=u.useMemo(()=>p==="tooltip"||c==="label"?Ie:{"aria-haspopup":p==="alertdialog"?"dialog":p,"aria-expanded":"false",...p==="listbox"&&{role:"combobox"},...p==="menu"&&h&&{role:"menuitem"},...c==="select"&&{"aria-autocomplete":"none"},...c==="combobox"&&{"aria-autocomplete":"list"}},[p,h,c]),v=u.useMemo(()=>p==="tooltip"||c==="label"?{[`aria-${c==="label"?"labelledby":"describedby"}`]:r?f:void 0}:{...m,"aria-expanded":r?"true":"false","aria-controls":r?f:void 0,...p==="menu"&&{id:d}},[p,f,r,d,c,m]),y=u.useMemo(()=>{const R={id:f,...p&&{role:p}};return p==="tooltip"||c==="label"?R:{...R,...p==="menu"&&{"aria-labelledby":d}}},[p,f,d,c]),S=u.useCallback(({active:R,selected:b})=>{const O={role:"option",...R&&{id:`${f}-fui-option`}};switch(c){case"select":case"combobox":return{...O,"aria-selected":b}}return{}},[f,c]);return u.useMemo(()=>i?{reference:v,floating:y,item:S,trigger:m}:{},[i,v,y,m,S])}let Mu=(function(e){return e.nestedDialogs="--nested-dialogs",e})({}),Lu=(function(e){return e[e.open=lt.open]="open",e[e.closed=lt.closed]="closed",e[e.startingStyle=lt.startingStyle]="startingStyle",e[e.endingStyle=lt.endingStyle]="endingStyle",e.nested="data-nested",e.nestedDialogOpen="data-nested-dialog-open",e})({});const Lr=u.createContext(void 0);process.env.NODE_ENV!=="production"&&(Lr.displayName="DialogPortalContext");function ju(){const e=u.useContext(Lr);if(e===void 0)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: <Dialog.Portal> is missing.":dt(26));return e}const ra="ArrowUp",oa="ArrowDown",sa="ArrowLeft",aa="ArrowRight",ia="Home",la="End",Fu=new Set([sa,aa]),$u=new Set([ra,oa]),Vu=new Set([...Fu,...$u]);[...Vu];const Bu=new Set([ra,oa,sa,aa,ia,la]),Wu={...ws,...ys,nestedDialogOpen(e){return e?{[Lu.nestedDialogOpen]:""}:null}},ca=u.forwardRef(function(t,n){const{className:r,finalFocus:o,initialFocus:s,render:a,...i}=t,{store:c}=Qe(),l=c.useState("descriptionElementId"),d=c.useState("disablePointerDismissal"),f=c.useState("floatingRootContext"),p=c.useState("popupProps"),g=c.useState("modal"),h=c.useState("mounted"),m=c.useState("nested"),v=c.useState("nestedOpenDialogCount"),y=c.useState("open"),S=c.useState("openMethod"),R=c.useState("titleElementId"),b=c.useState("transitionStatus"),O=c.useState("role");ju(),ea({open:y,ref:c.context.popupRef,onComplete(){y&&c.context.onOpenChangeComplete?.(!0)}});function D(Y){return Y==="touch"?c.context.popupRef.current:!0}const w=s===void 0?D:s,E=v>0,I=u.useMemo(()=>({open:y,nested:m,transitionStatus:b,nestedDialogOpen:E}),[y,m,b,E]),z=Je("div",t,{state:I,props:[p,{"aria-labelledby":R??void 0,"aria-describedby":l??void 0,role:O,tabIndex:-1,hidden:!h,onKeyDown(Y){Bu.has(Y.key)&&Y.stopPropagation()},style:{[Mu.nestedDialogs]:v}},i],ref:[n,c.context.popupRef,c.useStateSetter("popupElement")],stateAttributesMapping:Wu});return x.jsx(Bc,{context:f,openInteractionType:S,disabled:!h,closeOnFocusOut:!d,initialFocus:w,returnFocus:o,modal:g!==!1,restoreFocus:"popup",children:z})});process.env.NODE_ENV!=="production"&&(ca.displayName="DialogPopup");function zu(e){return Or(19)?e:e?"true":void 0}const ua=u.forwardRef(function(t,n){const{cutout:r,...o}=t;let s;if(r){const a=r?.getBoundingClientRect();s=`polygon(
|
|
12
|
+
\`createSelector([state => state.todos.map(todo => todo.id)], todoIds => todoIds.length)\``,{arguments:n,firstInputs:s,secondInputs:a,stack:c})}},wu={inputStabilityCheck:"once",identityFunctionCheck:"once"},$n=Symbol("NOT_FOUND");function Eu(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function xu(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function Su(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(n=>typeof n=="function")){const n=e.map(r=>typeof r=="function"?`function ${r.name||"unnamed"}()`:typeof r).join(", ");throw new TypeError(`${t}[${n}]`)}}var _o=e=>Array.isArray(e)?e:[e];function Tu(e){const t=Array.isArray(e[0])?e[0]:e;return Su(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function Mo(e,t){const n=[],{length:r}=e;for(let o=0;o<r;o++)n.push(e[o].apply(null,t));return n}var Ru=(e,t)=>{const{identityFunctionCheck:n,inputStabilityCheck:r}={...wu,...t};return{identityFunctionCheck:{shouldRun:n==="always"||n==="once"&&e,run:bu},inputStabilityCheck:{shouldRun:r==="always"||r==="once"&&e,run:yu}}};function ku(e){let t;return{get(n){return t&&e(t.key,n)?t.value:$n},put(n,r){t={key:n,value:r}},getEntries(){return t?[t]:[]},clear(){t=void 0}}}function Cu(e,t){let n=[];function r(i){const u=n.findIndex(c=>t(i,c.key));if(u>-1){const c=n[u];return u>0&&(n.splice(u,1),n.unshift(c)),c.value}return $n}function o(i,u){r(i)===$n&&(n.unshift({key:i,value:u}),n.length>e&&n.pop())}function s(){return n}function a(){n=[]}return{get:r,put:o,getEntries:s,clear:a}}var Ou=(e,t)=>e===t;function Au(e){return function(n,r){if(n===null||r===null||n.length!==r.length)return!1;const{length:o}=n;for(let s=0;s<o;s++)if(!e(n[s],r[s]))return!1;return!0}}function Du(e,t){const n=typeof t=="object"?t:{equalityCheck:t},{equalityCheck:r=Ou,maxSize:o=1,resultEqualityCheck:s}=n,a=Au(r);let i=0;const u=o<=1?ku(a):Cu(o,a);function c(){let d=u.get(arguments);if(d===$n){if(d=e.apply(null,arguments),i++,s){const p=u.getEntries().find(h=>s(h.value,d));p&&(d=p.value,i!==0&&i--)}u.put(arguments,d)}return d}return c.clearCache=()=>{u.clear(),c.resetResultsCount()},c.resultsCount=()=>i,c.resetResultsCount=()=>{i=0},c}var Iu=class{constructor(e){this.value=e}deref(){return this.value}},Pu=typeof WeakRef<"u"?WeakRef:Iu,Nu=0,Lo=1;function gn(){return{s:Nu,v:void 0,o:null,p:null}}function Sa(e,t={}){let n=gn();const{resultEqualityCheck:r}=t;let o,s=0;function a(){let i=n;const{length:u}=arguments;for(let f=0,p=u;f<p;f++){const h=arguments[f];if(typeof h=="function"||typeof h=="object"&&h!==null){let g=i.o;g===null&&(i.o=g=new WeakMap);const m=g.get(h);m===void 0?(i=gn(),g.set(h,i)):i=m}else{let g=i.p;g===null&&(i.p=g=new Map);const m=g.get(h);m===void 0?(i=gn(),g.set(h,i)):i=m}}const c=i;let d;if(i.s===Lo)d=i.v;else if(d=e.apply(null,arguments),s++,r){const f=o?.deref?.()??o;f!=null&&r(f,d)&&(d=f,s!==0&&s--),o=typeof d=="object"&&d!==null||typeof d=="function"?new Pu(d):d}return c.s=Lo,c.v=d,d}return a.clearCache=()=>{n=gn(),a.resetResultsCount()},a.resultsCount=()=>s,a.resetResultsCount=()=>{s=0},a}function Ta(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,r=(...o)=>{let s=0,a=0,i,u={},c=o.pop();typeof c=="object"&&(u=c,c=o.pop()),Eu(c,`createSelector expects an output function after the inputs, but received: [${typeof c}]`);const d={...n,...u},{memoize:f,memoizeOptions:p=[],argsMemoize:h=Sa,argsMemoizeOptions:g=[],devModeChecks:m={}}=d,v=_o(p),y=_o(g),E=Tu(o),R=f(function(){return s++,c.apply(null,arguments)},...v);let b=!0;const C=h(function(){a++;const T=Mo(E,arguments);if(i=R.apply(null,T),process.env.NODE_ENV!=="production"){const{identityFunctionCheck:x,inputStabilityCheck:I}=Ru(b,m);if(x.shouldRun&&x.run(c,T,i),I.shouldRun){const H=Mo(E,arguments);I.run({inputSelectorResults:T,inputSelectorResultsCopy:H},{memoize:f,memoizeOptions:v},arguments)}b&&(b=!1)}return i},...y);return Object.assign(C,{resultFunc:c,memoizedResultFunc:R,dependencies:E,dependencyRecomputations:()=>a,resetDependencyRecomputations:()=>{a=0},lastResult:()=>i,recomputations:()=>s,resetRecomputations:()=>{s=0},memoize:f,argsMemoize:h})};return Object.assign(r,{withTypes:()=>r}),r}var _u=Ta(Sa),Mu=Object.assign((e,t=_u)=>{xu(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);const n=Object.keys(e),r=n.map(s=>e[s]);return t(r,(...s)=>s.reduce((a,i,u)=>(a[n[u]]=i,a),{}))},{withTypes:()=>Mu});Ta({memoize:Du,memoizeOptions:{maxSize:1,equalityCheck:Object.is}});const ge=(e,t,n,r,o,s,...a)=>{if(a.length>0)throw new Error(process.env.NODE_ENV!=="production"?"Unsupported number of selectors":St(1));let i;if(e)i=e;else throw new Error("Missing arguments");return i};var vn={exports:{}},lr={};var jo;function Lu(){if(jo)return lr;jo=1;var e=D;function t(f,p){return f===p&&(f!==0||1/f===1/p)||f!==f&&p!==p}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,o=e.useEffect,s=e.useLayoutEffect,a=e.useDebugValue;function i(f,p){var h=p(),g=r({inst:{value:h,getSnapshot:p}}),m=g[0].inst,v=g[1];return s(function(){m.value=h,m.getSnapshot=p,u(m)&&v({inst:m})},[f,h,p]),o(function(){return u(m)&&v({inst:m}),f(function(){u(m)&&v({inst:m})})},[f]),a(h),h}function u(f){var p=f.getSnapshot;f=f.value;try{var h=p();return!n(f,h)}catch{return!0}}function c(f,p){return p()}var d=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?c:i;return lr.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:d,lr}var ur={};var Fo;function ju(){return Fo||(Fo=1,process.env.NODE_ENV!=="production"&&(function(){function e(h,g){return h===g&&(h!==0||1/h===1/g)||h!==h&&g!==g}function t(h,g){d||o.startTransition===void 0||(d=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var m=g();if(!f){var v=g();s(m,v)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),f=!0)}v=a({inst:{value:m,getSnapshot:g}});var y=v[0].inst,E=v[1];return u(function(){y.value=m,y.getSnapshot=g,n(y)&&E({inst:y})},[h,m,g]),i(function(){return n(y)&&E({inst:y}),h(function(){n(y)&&E({inst:y})})},[h]),c(m),m}function n(h){var g=h.getSnapshot;h=h.value;try{var m=g();return!s(h,m)}catch{return!0}}function r(h,g){return g()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var o=D,s=typeof Object.is=="function"?Object.is:e,a=o.useState,i=o.useEffect,u=o.useLayoutEffect,c=o.useDebugValue,d=!1,f=!1,p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?r:t;ur.useSyncExternalStore=o.useSyncExternalStore!==void 0?o.useSyncExternalStore:p,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),ur}var $o;function Zr(){return $o||($o=1,process.env.NODE_ENV==="production"?vn.exports=Lu():vn.exports=ju()),vn.exports}var Fu=Zr(),bn={exports:{}},dr={};var Bo;function $u(){if(Bo)return dr;Bo=1;var e=D,t=Zr();function n(c,d){return c===d&&(c!==0||1/c===1/d)||c!==c&&d!==d}var r=typeof Object.is=="function"?Object.is:n,o=t.useSyncExternalStore,s=e.useRef,a=e.useEffect,i=e.useMemo,u=e.useDebugValue;return dr.useSyncExternalStoreWithSelector=function(c,d,f,p,h){var g=s(null);if(g.current===null){var m={hasValue:!1,value:null};g.current=m}else m=g.current;g=i(function(){function y(O){if(!E){if(E=!0,R=O,O=p(O),h!==void 0&&m.hasValue){var T=m.value;if(h(T,O))return b=T}return b=O}if(T=b,r(R,O))return T;var x=p(O);return h!==void 0&&h(T,x)?(R=O,T):(R=O,b=x)}var E=!1,R,b,C=f===void 0?null:f;return[function(){return y(d())},C===null?void 0:function(){return y(C())}]},[d,f,p,h]);var v=o(c,g[0],g[1]);return a(function(){m.hasValue=!0,m.value=v},[v]),u(v),v},dr}var fr={};var Uo;function Bu(){return Uo||(Uo=1,process.env.NODE_ENV!=="production"&&(function(){function e(c,d){return c===d&&(c!==0||1/c===1/d)||c!==c&&d!==d}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=D,n=Zr(),r=typeof Object.is=="function"?Object.is:e,o=n.useSyncExternalStore,s=t.useRef,a=t.useEffect,i=t.useMemo,u=t.useDebugValue;fr.useSyncExternalStoreWithSelector=function(c,d,f,p,h){var g=s(null);if(g.current===null){var m={hasValue:!1,value:null};g.current=m}else m=g.current;g=i(function(){function y(O){if(!E){if(E=!0,R=O,O=p(O),h!==void 0&&m.hasValue){var T=m.value;if(h(T,O))return b=T}return b=O}if(T=b,r(R,O))return T;var x=p(O);return h!==void 0&&h(T,x)?(R=O,T):(R=O,b=x)}var E=!1,R,b,C=f===void 0?null:f;return[function(){return y(d())},C===null?void 0:function(){return y(C())}]},[d,f,p,h]);var v=o(c,g[0],g[1]);return a(function(){m.hasValue=!0,m.value=v},[v]),u(v),v},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),fr}var Vo;function Uu(){return Vo||(Vo=1,process.env.NODE_ENV==="production"?bn.exports=$u():bn.exports=Bu()),bn.exports}var Vu=Uu();const Wu=zr(19),zu=Wu?qu:Ku;function Hu(e,t,n,r,o){return zu(e,t,n,r,o)}function qu(e,t,n,r,o){const s=l.useCallback(()=>t(e.getSnapshot(),n,r,o),[e,t,n,r,o]);return Fu.useSyncExternalStore(e.subscribe,s,s)}function Ku(e,t,n,r,o){return Vu.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,s=>t(s,n,r,o))}class Xt{constructor(t){this.state=t,this.listeners=new Set,this.updateTick=0}subscribe=t=>(this.listeners.add(t),()=>{this.listeners.delete(t)});getSnapshot=()=>this.state;setState(t){if(this.state===t)return;this.state=t,this.updateTick+=1;const n=this.updateTick;for(const r of this.listeners){if(n!==this.updateTick)return;r(t)}}update(t){for(const n in t)if(!Object.is(this.state[n],t[n])){Xt.prototype.setState.call(this,{...this.state,...t});return}}set(t,n){Object.is(this.state[t],n)||Xt.prototype.setState.call(this,{...this.state,[t]:n})}notifyAll(){const t={...this.state};Xt.prototype.setState.call(this,t)}}class Ra extends Xt{constructor(t,n={},r){super(t),this.context=n,this.selectors=r}controlledValues=new Map;useSyncedValue(t,n){l.useDebugValue(t),De(()=>{this.state[t]!==n&&this.set(t,n)},[t,n])}useSyncedValueWithCleanup(t,n){De(()=>(this.state[t]!==n&&this.set(t,n),()=>{this.set(t,void 0)}),[t,n])}useSyncedValues(t){if(process.env.NODE_ENV!=="production"){l.useDebugValue(t,s=>Object.keys(s));const r=l.useRef(Object.keys(t)).current,o=Object.keys(t);(r.length!==o.length||r.some((s,a)=>s!==o[a]))&&console.error("ReactStore.useSyncedValues expects the same prop keys on every render. Keys should be stable.")}const n=Object.values(t);De(()=>{this.update(t)},n)}useControlledProp(t,n,r){l.useDebugValue(t);const o=n!==void 0;if(process.env.NODE_ENV!=="production"){const s=this.controlledValues.get(t);s!==void 0&&s!==o&&console.error(`A component is changing the ${o?"":"un"}controlled state of ${t.toString()} to be ${o?"un":""}controlled. Elements should not switch from uncontrolled to controlled (or vice versa).`)}this.controlledValues.has(t)||(this.controlledValues.set(t,o),!o&&!Object.is(this.state[t],r)&&super.setState({...this.state,[t]:r})),De(()=>{o&&!Object.is(this.state[t],n)&&super.setState({...this.state,[t]:n})},[t,n,r,o])}set(t,n){this.controlledValues.get(t)!==!0&&super.set(t,n)}update(t){const n={...t};for(const r in n)if(Object.hasOwn(n,r)&&this.controlledValues.get(r)===!0){delete n[r];continue}super.update(n)}setState(t){const n={...t};for(const r in n)if(Object.hasOwn(n,r)&&this.controlledValues.get(r)===!0){delete n[r];continue}super.setState({...this.state,...n})}select=(t,n,r,o)=>{const s=this.selectors[t];return s(this.state,n,r,o)};useState=(t,n,r,o)=>{l.useDebugValue(t);const s=this.selectors[t];return Hu(this,s,n,r,o)};useContextCallback(t,n){l.useDebugValue(t);const r=me(n??As);this.context[t]=r}useStateSetter(t){const n=l.useRef(void 0);return n.current===void 0&&(n.current=r=>{this.set(t,r)}),n.current}observe(t,n){let r;typeof t=="function"?r=t:r=this.selectors[t];let o=r(this.state);return n(o,o,this),this.subscribe(s=>{const a=r(s);if(!Object.is(o,a)){const i=o;o=a,n(a,i,this)}})}}const Gu={open:ge(e=>e.open),domReferenceElement:ge(e=>e.domReferenceElement),referenceElement:ge(e=>e.positionReference??e.referenceElement),floatingElement:ge(e=>e.floatingElement),floatingId:ge(e=>e.floatingId)};class ka extends Ra{constructor(t){const{nested:n,noEmit:r,onOpenChange:o,triggerElements:s,...a}=t;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:o,dataRef:{current:{}},events:nu(),nested:n,noEmit:r,triggerElements:s},Gu)}setOpen=(t,n)=>{if((!t||!this.state.open||oa(n.event))&&(this.context.dataRef.current.openEvent=t?n.event:void 0),!this.context.noEmit){const r={open:t,reason:n.reason,nativeEvent:n.event,nested:this.context.nested,triggerElement:n.trigger};this.context.events.emit("openchange",r)}this.context.onOpenChange?.(t,n)}}function Yu(e,t=!1,n=!1){const[r,o]=l.useState(e&&t?"idle":void 0),[s,a]=l.useState(e);return e&&!s&&(a(!0),o("starting")),!e&&s&&r!=="ending"&&!n&&o("ending"),!e&&!s&&r==="ending"&&o(void 0),De(()=>{if(!e&&s&&r!=="ending"&&n){const i=Xe.request(()=>{o("ending")});return()=>{Xe.cancel(i)}}},[e,s,r,n]),De(()=>{if(!e||t)return;const i=Xe.request(()=>{o(void 0)});return()=>{Xe.cancel(i)}},[t,e]),De(()=>{if(!e||!t)return;e&&s&&r!=="idle"&&o("starting");const i=Xe.request(()=>{o("idle")});return()=>{Xe.cancel(i)}},[t,e,s,o,r]),l.useMemo(()=>({mounted:s,setMounted:a,transitionStatus:r}),[s,r])}function Xu(e,t=!1,n=!0){const r=Yr();return me((o,s=null)=>{r.cancel();const a=yt(e);a!=null&&(typeof a.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED?o():r.request(()=>{function i(){a&&Promise.all(a.getAnimations().map(u=>u.finished)).then(()=>{s!=null&&s.aborted||Jt.flushSync(o)}).catch(()=>{if(n){if(s!=null&&s.aborted)return;Jt.flushSync(o)}else a.getAnimations().length>0&&a.getAnimations().some(u=>u.pending||u.playState!=="finished")&&i()})}t?r.request(i):i()}))})}function Ca(e){const{enabled:t=!0,open:n,ref:r,onComplete:o}=e,s=Ht(n),a=me(o),i=Xu(r,n);l.useEffect(()=>{t&&i(()=>{n===s.current&&a()})},[t,n,a,i,s])}function Ju(e,t){const n=l.useRef(null);return l.useCallback(r=>{e!==void 0&&(n.current!==null&&(t.context.triggerElements.delete(n.current),n.current=null),r!==null&&(n.current=e,t.context.triggerElements.add(e,r)))},[t,e])}function Zu(e,t,n,r){const o=n.useState("isMountedByTrigger",e),s=Ju(e,n),a=me(i=>{s(i),i!==null&&n.select("open")&&n.select("activeTriggerId")==null&&n.update({activeTriggerId:e,activeTriggerElement:i,...r})});return De(()=>{o&&n.update({activeTriggerElement:t.current,...r})},[o,n,t,...Object.values(r)]),{registerTrigger:a,isMountedByThisTrigger:o}}function Qu(e){const t=e.useState("open");De(()=>{if(t&&!e.select("activeTriggerId")&&e.context.triggerElements.size===1){const n=e.context.triggerElements.entries().next();if(!n.done){const[r,o]=n.value;e.update({activeTriggerId:r,activeTriggerElement:o})}}},[t,e])}function ed(e,t,n){const{mounted:r,setMounted:o,transitionStatus:s}=Yu(e);t.useSyncedValues({mounted:r,transitionStatus:s});const a=me(()=>{o(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)}),i=t.useState("preventUnmountingOnClose");return Ca({enabled:!i,open:e,ref:t.context.popupRef,onComplete(){e||a()}}),{forceUnmount:a,transitionStatus:s}}class Oa{constructor(){this.elements=new Set,this.idMap=new Map}add(t,n){const r=this.idMap.get(t);if(r!==n&&(r!==void 0&&this.elements.delete(r),this.elements.add(n),this.idMap.set(t,n),process.env.NODE_ENV!=="production"&&this.elements.size!==this.idMap.size))throw new Error(process.env.NODE_ENV!=="production"?"Base UI: A trigger element cannot be registered under multiple IDs in PopupTriggerMap.":St(87))}delete(t){const n=this.idMap.get(t);n&&(this.elements.delete(n),this.idMap.delete(t))}hasElement(t){return this.elements.has(t)}hasMatchingElement(t){for(const n of this.elements)if(t(n))return!0;return!1}getById(t){return this.idMap.get(t)}entries(){return this.idMap.entries()}get size(){return this.idMap.size}}function td(){return new ka({open:!1,floatingElement:null,referenceElement:null,triggerElements:new Oa,floatingId:"",nested:!1,noEmit:!1,onOpenChange:void 0})}function nd(){return{open:!1,mounted:!1,transitionStatus:"idle",floatingRootContext:td(),preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,popupElement:null,positionerElement:null,activeTriggerProps:Be,inactiveTriggerProps:Be,popupProps:Be}}const rd={open:ge(e=>e.open),mounted:ge(e=>e.mounted),transitionStatus:ge(e=>e.transitionStatus),floatingRootContext:ge(e=>e.floatingRootContext),preventUnmountingOnClose:ge(e=>e.preventUnmountingOnClose),payload:ge(e=>e.payload),activeTriggerId:ge(e=>e.activeTriggerId),activeTriggerElement:ge(e=>e.mounted?e.activeTriggerElement:null),isTriggerActive:ge((e,t)=>t!==void 0&&e.activeTriggerId===t),isOpenedByTrigger:ge((e,t)=>t!==void 0&&e.activeTriggerId===t&&e.open),isMountedByTrigger:ge((e,t)=>t!==void 0&&e.activeTriggerId===t&&e.mounted),triggerProps:ge((e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps),popupProps:ge(e=>e.popupProps),popupElement:ge(e=>e.popupElement),positionerElement:ge(e=>e.positionerElement)};function od(e){const{popupStore:t,noEmit:n=!1,treatPopupAsFloatingElement:r=!1,onOpenChange:o}=e,s=Kn(),a=va()!=null,i=t.useState("open"),u=t.useState("activeTriggerElement"),c=t.useState(r?"popupElement":"positionerElement"),d=t.context.triggerElements,f=dt(()=>new ka({open:i,referenceElement:u,floatingElement:c,triggerElements:d,onOpenChange:o,floatingId:s,nested:a,noEmit:n})).current;return De(()=>{const p={open:i,floatingId:s,referenceElement:u,floatingElement:c};bt(u)&&(p.domReferenceElement=u),f.update(p)},[i,s,u,c,f]),f.context.onOpenChange=o,f.context.nested=a,f.context.noEmit=n,f}function Aa(e=[]){const t=e.map(c=>c?.reference),n=e.map(c=>c?.floating),r=e.map(c=>c?.item),o=e.map(c=>c?.trigger),s=l.useCallback(c=>yn(c,e,"reference"),t),a=l.useCallback(c=>yn(c,e,"floating"),n),i=l.useCallback(c=>yn(c,e,"item"),r),u=l.useCallback(c=>yn(c,e,"trigger"),o);return l.useMemo(()=>({getReferenceProps:s,getFloatingProps:a,getItemProps:i,getTriggerProps:u}),[s,a,i,u])}function yn(e,t,n){const r=new Map,o=n==="item",s={};n==="floating"&&(s.tabIndex=-1,s[Nr]="");for(const a in e)o&&e&&(a===ta||a===na)||(s[a]=e[a]);for(let a=0;a<t.length;a+=1){let i;const u=t[a]?.[n];typeof u=="function"?i=e?u(e):null:i=u,i&&Wo(s,i,o,r)}return Wo(s,e,o,r),s}function Wo(e,t,n,r){for(const o in t){const s=t[o];n&&(o===ta||o===na)||(o.startsWith("on")?(r.has(o)||r.set(o,[]),typeof s=="function"&&(r.get(o)?.push(s),e[o]=(...a)=>r.get(o)?.map(i=>i(...a)).find(i=>i!==void 0))):e[o]=s)}}const sd=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function ad(e,t={}){const n="rootStore"in e?e.rootStore:e,r=n.useState("open"),o=n.useState("floatingId"),s=n.useState("domReferenceElement"),a=n.useState("floatingElement"),{enabled:i=!0,role:u="dialog"}=t,c=Kn(),d=s?.id||c,f=l.useMemo(()=>_r(a)?.id||o,[a,o]),p=sd.get(u)??u,g=va()!=null,m=l.useMemo(()=>p==="tooltip"||u==="label"?Be:{"aria-haspopup":p==="alertdialog"?"dialog":p,"aria-expanded":"false",...p==="listbox"&&{role:"combobox"},...p==="menu"&&g&&{role:"menuitem"},...u==="select"&&{"aria-autocomplete":"none"},...u==="combobox"&&{"aria-autocomplete":"list"}},[p,g,u]),v=l.useMemo(()=>p==="tooltip"||u==="label"?{[`aria-${u==="label"?"labelledby":"describedby"}`]:r?f:void 0}:{...m,"aria-expanded":r?"true":"false","aria-controls":r?f:void 0,...p==="menu"&&{id:d}},[p,f,r,d,u,m]),y=l.useMemo(()=>{const R={id:f,...p&&{role:p}};return p==="tooltip"||u==="label"?R:{...R,...p==="menu"&&{"aria-labelledby":d}}},[p,f,d,u]),E=l.useCallback(({active:R,selected:b})=>{const C={role:"option",...R&&{id:`${f}-fui-option`}};switch(u){case"select":case"combobox":return{...C,"aria-selected":b}}return{}},[f,u]);return l.useMemo(()=>i?{reference:v,floating:y,item:E,trigger:m}:{},[i,v,y,m,E])}let id=(function(e){return e.nestedDialogs="--nested-dialogs",e})({}),cd=(function(e){return e[e.open=wt.open]="open",e[e.closed=wt.closed]="closed",e[e.startingStyle=wt.startingStyle]="startingStyle",e[e.endingStyle=wt.endingStyle]="endingStyle",e.nested="data-nested",e.nestedDialogOpen="data-nested-dialog-open",e})({});const Qr=l.createContext(void 0);process.env.NODE_ENV!=="production"&&(Qr.displayName="DialogPortalContext");function ld(){const e=l.useContext(Qr);if(e===void 0)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: <Dialog.Portal> is missing.":St(26));return e}const Da="ArrowUp",Ia="ArrowDown",Pa="ArrowLeft",Na="ArrowRight",_a="Home",Ma="End",ud=new Set([Pa,Na]),dd=new Set([Da,Ia]),fd=new Set([...ud,...dd]);[...fd];const pd=new Set([Da,Ia,Pa,Na,_a,Ma]),md={...Ks,...qs,nestedDialogOpen(e){return e?{[cd.nestedDialogOpen]:""}:null}},La=l.forwardRef(function(t,n){const{className:r,finalFocus:o,initialFocus:s,render:a,...i}=t,{store:u}=pt(),c=u.useState("descriptionElementId"),d=u.useState("disablePointerDismissal"),f=u.useState("floatingRootContext"),p=u.useState("popupProps"),h=u.useState("modal"),g=u.useState("mounted"),m=u.useState("nested"),v=u.useState("nestedOpenDialogCount"),y=u.useState("open"),E=u.useState("openMethod"),R=u.useState("titleElementId"),b=u.useState("transitionStatus"),C=u.useState("role");ld(),Ca({open:y,ref:u.context.popupRef,onComplete(){y&&u.context.onOpenChangeComplete?.(!0)}});function O(q){return q==="touch"?u.context.popupRef.current:!0}const T=s===void 0?O:s,x=v>0,I=l.useMemo(()=>({open:y,nested:m,transitionStatus:b,nestedDialogOpen:x}),[y,m,b,x]),H=ft("div",t,{state:I,props:[p,{"aria-labelledby":R??void 0,"aria-describedby":c??void 0,role:C,tabIndex:-1,hidden:!g,onKeyDown(q){pd.has(q.key)&&q.stopPropagation()},style:{[id.nestedDialogs]:v}},i],ref:[n,u.context.popupRef,u.useStateSetter("popupElement")],stateAttributesMapping:md});return S.jsx(pu,{context:f,openInteractionType:E,disabled:!g,closeOnFocusOut:!d,initialFocus:T,returnFocus:o,modal:h!==!1,restoreFocus:"popup",children:H})});process.env.NODE_ENV!=="production"&&(La.displayName="DialogPopup");function hd(e){return zr(19)?e:e?"true":void 0}const ja=l.forwardRef(function(t,n){const{cutout:r,...o}=t;let s;if(r){const a=r?.getBoundingClientRect();s=`polygon(
|
|
13
13
|
0% 0%,
|
|
14
14
|
100% 0%,
|
|
15
15
|
100% 100%,
|
|
@@ -20,12 +20,12 @@ Avoid returning a new reference inside your input selector, e.g.
|
|
|
20
20
|
${a.right}px ${a.bottom}px,
|
|
21
21
|
${a.right}px ${a.top}px,
|
|
22
22
|
${a.left}px ${a.top}px
|
|
23
|
-
)`}return x.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...o,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:s}})});process.env.NODE_ENV!=="production"&&(ua.displayName="InternalBackdrop");const da=u.forwardRef(function(t,n){const{keepMounted:r=!1,...o}=t,{store:s}=Qe(),a=s.useState("mounted"),i=s.useState("modal");return a||r?x.jsx(Lr.Provider,{value:r,children:x.jsxs(Ks,{ref:n,...o,children:[a&&i===!0&&x.jsx(ua,{ref:s.context.internalBackdropRef,inert:zu(!open)}),t.children]})}):null});process.env.NODE_ENV!=="production"&&(da.displayName="DialogPortal");let Co={},To={},Oo="";function Uu(e){if(typeof document>"u")return!1;const t=_n(e);return Ve(t).innerWidth-t.documentElement.clientWidth>0}function Hu(e){const t=_n(e),n=t.documentElement,r=t.body,o=In(n)?n:r,s=o.style.overflow;return o.style.overflow="hidden",()=>{o.style.overflow=s}}function Gu(e){const t=_n(e),n=t.documentElement,r=t.body,o=Ve(n);let s=0,a=0;const i=Fe.create(),c=typeof CSS<"u"&&CSS.supports?.("scrollbar-gutter","stable");if(tc&&(o.visualViewport?.scale??1)!==1)return()=>{};function l(){const p=o.getComputedStyle(n),g=o.getComputedStyle(r),v=(p.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";s=n.scrollTop,a=n.scrollLeft,Co={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},Oo=n.style.scrollBehavior,To={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};const y=n.scrollHeight>n.clientHeight,S=n.scrollWidth>n.clientWidth,R=p.overflowY==="scroll"||g.overflowY==="scroll",b=p.overflowX==="scroll"||g.overflowX==="scroll",O=Math.max(0,o.innerWidth-n.clientWidth),D=Math.max(0,o.innerHeight-n.clientHeight),w=parseFloat(g.marginTop)+parseFloat(g.marginBottom),E=parseFloat(g.marginLeft)+parseFloat(g.marginRight),I=In(n)?n:r;if(c){n.style.scrollbarGutter=v,I.style.overflowY="hidden",I.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:v,overflowY:"hidden",overflowX:"hidden"}),(y||R)&&(n.style.overflowY="scroll"),(S||b)&&(n.style.overflowX="scroll"),Object.assign(r.style,{position:"relative",height:w||D?`calc(100dvh - ${w+D}px)`:"100dvh",width:E||O?`calc(100vw - ${E+O}px)`:"100vw",boxSizing:"border-box",overflow:"hidden",scrollBehavior:"unset"}),r.scrollTop=s,r.scrollLeft=a,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function d(){Object.assign(n.style,Co),Object.assign(r.style,To),c||(n.scrollTop=s,n.scrollLeft=a,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=Oo)}function f(){d(),i.request(l)}return l(),o.addEventListener("resize",f),()=>{i.cancel(),d(),typeof o.removeEventListener=="function"&&o.removeEventListener("resize",f)}}class Yu{lockCount=0;restore=null;timeoutLock=xt.create();timeoutUnlock=xt.create();acquire(t){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(t)),this.release}release=()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(t){if(this.lockCount===0||this.restore!==null)return;const r=_n(t).documentElement,o=Ve(r).getComputedStyle(r).overflowY;if(o==="hidden"||o==="clip"){this.restore=ns;return}const s=nc||!Uu(t);this.restore=s?Hu(t):Gu(t)}}const qu=new Yu;function Ku(e=!0,t=null){Ee(()=>{if(e)return qu.acquire(t)},[e,t])}function Xu(e){const t=u.useRef(""),n=u.useCallback(o=>{o.defaultPrevented||(t.current=o.pointerType,e(o,o.pointerType))},[e]);return{onClick:u.useCallback(o=>{if(o.detail===0){e(o,"keyboard");return}"pointerType"in o&&e(o,o.pointerType),e(o,t.current),t.current=""},[e]),onPointerDown:n}}function Zu(e){const[t,n]=u.useState(null),r=se((i,c)=>{e||n(c)}),o=u.useCallback(()=>{n(null)},[]),{onClick:s,onPointerDown:a}=Xu(r);return u.useMemo(()=>({openMethod:t,reset:o,triggerProps:{onClick:s,onPointerDown:a}}),[t,o,s,a])}function Ju(e){const{store:t,parentContext:n,actionsRef:r}=e,o=t.useState("open"),s=t.useState("disablePointerDismissal"),a=t.useState("modal"),i=t.useState("popupElement"),{openMethod:c,triggerProps:l,reset:d}=Zu(o);Ou(t);const{forceUnmount:f}=ku(o,t,()=>{d()}),p=se(z=>{const Y=Pe(z);return Y.preventUnmountOnClose=()=>{t.set("preventUnmountingOnClose",!0)},Y}),g=u.useCallback(()=>{t.setOpen(!1,p(Xl))},[t,p]);u.useImperativeHandle(r,()=>({unmount:f,close:g}),[f,g]);const h=Pu({popupStore:t,onOpenChange:t.setOpen,treatPopupAsFloatingElement:!0,noEmit:!0}),[m,v]=u.useState(0),y=m===0,S=_u(h),R=Hc(h,{outsidePressEvent(){return t.context.internalBackdropRef.current||t.context.backdropRef.current?"intentional":{mouse:a==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(z){if("button"in z&&z.button!==0||"touches"in z&&z.touches.length!==1)return!1;const Y=Me(z);if(y&&!s){const Z=Y;return a&&(t.context.internalBackdropRef.current||t.context.backdropRef.current)?t.context.internalBackdropRef.current===Z||t.context.backdropRef.current===Z||he(Z,i)&&!Z?.hasAttribute("data-base-ui-portal"):!0}return!1},escapeKey:y});Ku(o&&a===!0,i);const{getReferenceProps:b,getFloatingProps:O,getTriggerProps:D}=na([S,R]);t.useContextCallback("onNestedDialogOpen",z=>{v(z+1)}),t.useContextCallback("onNestedDialogClose",()=>{v(0)}),u.useEffect(()=>(n?.onNestedDialogOpen&&o&&n.onNestedDialogOpen(m),n?.onNestedDialogClose&&!o&&n.onNestedDialogClose(),()=>{n?.onNestedDialogClose&&o&&n.onNestedDialogClose()}),[o,n,m]);const w=u.useMemo(()=>b(l),[b,l]),E=u.useMemo(()=>D(l),[D,l]),I=u.useMemo(()=>O(),[O]);t.useSyncedValues({openMethod:c,activeTriggerProps:w,inactiveTriggerProps:E,popupProps:I,floatingRootContext:h,nestedOpenDialogCount:m})}const Qu={...Iu,modal:le(e=>e.modal),nested:le(e=>e.nested),nestedOpenDialogCount:le(e=>e.nestedOpenDialogCount),disablePointerDismissal:le(e=>e.disablePointerDismissal),openMethod:le(e=>e.openMethod),descriptionElementId:le(e=>e.descriptionElementId),titleElementId:le(e=>e.titleElementId),viewportElement:le(e=>e.viewportElement),role:le(e=>e.role)};class ed extends Js{constructor(t){super(td(t),{popupRef:u.createRef(),backdropRef:u.createRef(),internalBackdropRef:u.createRef(),triggerElements:new ta,onOpenChange:void 0,onOpenChangeComplete:void 0},Qu)}setOpen=(t,n)=>{if(n.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!t&&n.trigger==null&&this.state.activeTriggerId!=null&&(n.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(t,n),n.isCanceled)return;const r={open:t,nativeEvent:n.event,reason:n.reason,nested:this.state.nested};this.state.floatingRootContext.context.events?.emit("openchange",r);const o={open:t},s=n.trigger?.id??null;(s||t)&&(o.activeTriggerId=s,o.activeTriggerElement=n.trigger??null),this.update(o)}}function td(e={}){return{...Nu(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,role:"dialog",...e}}function nd(e){const{children:t,open:n,defaultOpen:r=!1,onOpenChange:o,onOpenChangeComplete:s,disablePointerDismissal:a=!1,modal:i=!0,actionsRef:c,handle:l,triggerId:d,defaultTriggerId:f=null}=e,p=Qe(!0),g=!!p,h=Ze(()=>l?.store??new ed({open:n??r,activeTriggerId:d!==void 0?d:f,modal:i,disablePointerDismissal:a,nested:g})).current;h.useControlledProp("open",n,r),h.useControlledProp("activeTriggerId",d,f),h.useSyncedValues({disablePointerDismissal:a,nested:g,modal:i}),h.useContextCallback("onOpenChange",o),h.useContextCallback("onOpenChangeComplete",s);const m=h.useState("payload");Ju({store:h,actionsRef:c,parentContext:p?.store.context});const v=u.useMemo(()=>({store:h}),[h]);return x.jsx(Dr.Provider,{value:v,children:typeof t=="function"?t({payload:m}):t})}const fa=u.forwardRef(function(t,n){const{render:r,className:o,id:s,...a}=t,{store:i}=Qe(),c=Ir(s);return i.useSyncedValueWithCleanup("titleElementId",c),Je("h2",t,{ref:n,props:[{id:c},a]})});process.env.NODE_ENV!=="production"&&(fa.displayName="DialogTitle");const pa=u.forwardRef(function(t,n){const{render:r,className:o,disabled:s=!1,nativeButton:a=!0,id:i,payload:c,handle:l,...d}=t,f=Qe(!0),p=l?.store??f?.store;if(!p)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: <Dialog.Trigger> must be used within <Dialog.Root> or provided with a handle.":dt(79));const g=Ir(i),h=p.useState("floatingRootContext"),m=p.useState("isOpenedByTrigger",g),v=u.useRef(null),{registerTrigger:y,isMountedByThisTrigger:S}=Tu(g,v,p,{payload:c}),{getButtonProps:R,buttonRef:b}=Tr({disabled:s,native:a}),O=Wc(h,{enabled:h!=null}),D=na([O]),w=u.useMemo(()=>({disabled:s,open:m}),[s,m]),E=p.useState("triggerProps",S);return Je("button",t,{state:w,ref:[b,n,y,v],props:[D.getReferenceProps(),E,{[rs]:"",id:g},d,R],stateAttributesMapping:Ul})});process.env.NODE_ENV!=="production"&&(pa.displayName="DialogTrigger");const rd=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),od=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),ko=e=>{const t=od(e);return t.charAt(0).toUpperCase()+t.slice(1)},ma=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),sd=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var ad={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const id=k.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:s,iconNode:a,...i},c)=>k.createElement("svg",{ref:c,...ad,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:ma("lucide",o),...!s&&!sd(i)&&{"aria-hidden":"true"},...i},[...a.map(([l,d])=>k.createElement(l,d)),...Array.isArray(s)?s:[s]]));const Mn=(e,t)=>{const n=k.forwardRef(({className:r,...o},s)=>k.createElement(id,{ref:s,iconNode:t,className:ma(`lucide-${rd(ko(e))}`,`lucide-${e}`,r),...o}));return n.displayName=ko(e),n};const ld=[["path",{d:"m15 15 6 6",key:"1s409w"}],["path",{d:"m15 9 6-6",key:"ko1vev"}],["path",{d:"M21 16v5h-5",key:"1ck2sf"}],["path",{d:"M21 8V3h-5",key:"1qoq8a"}],["path",{d:"M3 16v5h5",key:"1t08am"}],["path",{d:"m3 21 6-6",key:"wwnumi"}],["path",{d:"M3 8V3h5",key:"1ln10m"}],["path",{d:"M9 9 3 3",key:"v551iv"}]],ga=Mn("expand",ld);const cd=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],ud=Mn("loader-circle",cd);const dd=[["path",{d:"m15 15 6 6m-6-6v4.8m0-4.8h4.8",key:"17vawe"}],["path",{d:"M9 19.8V15m0 0H4.2M9 15l-6 6",key:"chjx8e"}],["path",{d:"M15 4.2V9m0 0h4.8M15 9l6-6",key:"lav6yq"}],["path",{d:"M9 4.2V9m0 0H4.2M9 9 3 3",key:"1pxi2q"}]],ha=Mn("shrink",dd);const fd=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],pd=Mn("x",fd);function md({...e}){return x.jsx(nd,{"data-slot":"dialog",...e})}function gd({...e}){return x.jsx(pa,{"data-slot":"dialog-trigger",...e})}function hd({...e}){return x.jsx(da,{"data-slot":"dialog-portal",...e})}function vd({className:e,...t}){return x.jsx(Es,{"data-slot":"dialog-overlay",className:ke("data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs fixed inset-0 isolate z-50",e),...t})}function bd({className:e,children:t,showCloseButton:n=!0,...r}){return x.jsxs(hd,{children:[x.jsx(vd,{}),x.jsxs(ca,{"data-slot":"dialog-content",className:ke("bg-background data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 ring-foreground/10 grid max-w-[calc(100%-2rem)] gap-4 rounded-xl p-4 text-sm ring-1 duration-100 sm:max-w-sm fixed top-1/2 left-1/2 z-50 w-full -translate-x-1/2 -translate-y-1/2 outline-none",e),...r,children:[t,n&&x.jsxs(Nr,{"data-slot":"dialog-close",render:x.jsx(ct,{variant:"ghost",className:"absolute top-2 right-2",size:"icon-sm"}),children:[x.jsx(pd,{}),x.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function yd({className:e,...t}){return x.jsx("div",{"data-slot":"dialog-header",className:ke("gap-2 flex flex-col",e),...t})}function wd({className:e,showCloseButton:t=!1,children:n,...r}){return x.jsxs("div",{"data-slot":"dialog-footer",className:ke("bg-muted/50 -mx-4 -mb-4 rounded-b-xl border-t p-4 flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...r,children:[n,t&&x.jsx(Nr,{render:x.jsx(ct,{variant:"outline"}),children:"Close"})]})}function Ed({className:e,...t}){return x.jsx(fa,{"data-slot":"dialog-title",className:ke("text-sm leading-none font-medium",e),...t})}function xd({className:e,...t}){return x.jsx(Rs,{"data-slot":"dialog-description",className:ke("text-muted-foreground *:[a]:hover:text-foreground text-sm *:[a]:underline *:[a]:underline-offset-3",e),...t})}function va({className:e,...t}){return x.jsx(ud,{role:"status","aria-label":"Loading",className:ke("size-4 animate-spin",e),...t})}const Sd="min-w-full w-full max-w-full min-h-full h-full max-h-full",Rd="min-w-full w-full max-w-full min-h-full h-full max-h-full",Cd="md:min-w-lg md:w-min-w-lg md:max-w-min-w-lg md:min-h-11/12 md:h-11/12 md:max-h-11/12 md:aspect-9/16 lg:min-w-3xl lg:w-3xl lg:max-w-3xl lg:min-h-11/12 lg:h-11/12 lg:max-h-11/12 lg:aspect-video xl:min-w-3xl xl:w-3xl xl:max-w-3xl xl:min-h-11/12 xl:h-11/12 xl:max-h-11/12 xl:aspect-video 2xl:min-w-5xl 2xl:w-5xl 2xl:max-w-5xl 2xl:min-h-11/12 2xl:h-11/12 2xl:max-h-11/12 2xl:aspect-video",Td="min-w-full w-full max-w-full min-h-11/12 h-11/12 max-h-11/12",On={styles:{dialog:{expanded:Sd,compacted:Cd},drawer:{expanded:Rd,compacted:Td}}};function ba({className:e}){return x.jsx("iframe",{className:ke("w-full h-full flex flex-col items-center justify-center rounded-xl",e),src:"https://aarthikbandhu.com"})}function Od({open:e,setOpen:t,loading:n,setLoading:r,isFullScreen:o,setIsFullScreen:s,triggerProperties:{label:a,component:i=void 0},title:c}){return k.useEffect(()=>{setTimeout(()=>{r(!1)},5e3)},[r]),x.jsxs(md,{open:e,onOpenChange:t,children:[x.jsx(gd,{children:i||x.jsx(ct,{variant:"default",children:a})}),x.jsxs(bd,{showCloseButton:!1,className:`shadow-2xl shadow-foreground p-0.5 m-0 flex flex-col items-center justify-center gap-0 bg-background ${o?On.styles.dialog.expanded:On.styles.dialog.compacted}`,children:[x.jsxs(yd,{className:"absolute top-0 left-0 right-0 border-0 bg-background min-h-8 h-8 max-h-8 min-w-full w-full max-w-full shrink grow-0 flex flex-row items-center justify-center gap-0 rounded-t-xl px-1 py-0 mx-0 my-0",children:[x.jsx(Ed,{className:"rounded-xl text-lg leading-none min-w-1/2 w-1/2 max-w-/12 h-full flex flex-row items-center justify-start",children:c}),x.jsx(xd,{className:"rounded-xl text-xs leading-none min-w-1/2 w-1/2 max-w-1/2 h-full flex flex-row items-center justify-end",children:x.jsx(ct,{variant:"outline",size:"icon-sm",className:"rounded-lg",onClick:()=>s(l=>!l),children:o?x.jsx(ha,{}):x.jsx(ga,{})})})]}),x.jsx("div",{className:"min-w-full w-full max-w-full mt-8 mb-4 mx-0 rounded-xl border shadow-inner grow shrink-0",children:n?x.jsx("div",{className:"w-full h-full flex flex-col items-center justify-center",children:x.jsx(va,{})}):x.jsx(ba,{})}),x.jsx(wd,{className:"absolute bottom-0 left-0 right-0 border-0 bg-background min-h-4 h-4 max-h-4 min-w-full w-full max-w-full shrink grow-0 flex flex-row items-center justify-center rounded-b-xl px-2 py-2 mx-0 my-0",children:x.jsx("div",{className:"text-xs text-foreground",children:"Powered by Aarthik Labs"})})]})]})}function Xe(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e?.(o),n===!1||!o.defaultPrevented)return t?.(o)}}function Do(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function ya(...e){return t=>{let n=!1;const r=e.map(o=>{const s=Do(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():Do(e[o],null)}}}}function ft(...e){return u.useCallback(ya(...e),e)}function kd(e,t){const n=u.createContext(t),r=s=>{const{children:a,...i}=s,c=u.useMemo(()=>i,Object.values(i));return x.jsx(n.Provider,{value:c,children:a})};r.displayName=e+"Provider";function o(s){const a=u.useContext(n);if(a)return a;if(t!==void 0)return t;throw new Error(`\`${s}\` must be used within \`${e}\``)}return[r,o]}function Dd(e,t=[]){let n=[];function r(s,a){const i=u.createContext(a),c=n.length;n=[...n,a];const l=f=>{const{scope:p,children:g,...h}=f,m=p?.[e]?.[c]||i,v=u.useMemo(()=>h,Object.values(h));return x.jsx(m.Provider,{value:v,children:g})};l.displayName=s+"Provider";function d(f,p){const g=p?.[e]?.[c]||i,h=u.useContext(g);if(h)return h;if(a!==void 0)return a;throw new Error(`\`${f}\` must be used within \`${s}\``)}return[l,d]}const o=()=>{const s=n.map(a=>u.createContext(a));return function(i){const c=i?.[e]||s;return u.useMemo(()=>({[`__scope${e}`]:{...i,[e]:c}}),[i,c])}};return o.scopeName=e,[r,Nd(o,...t)]}function Nd(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const a=r.reduce((i,{useScope:c,scopeName:l})=>{const f=c(s)[`__scope${l}`];return{...i,...f}},{});return u.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}var Ut=globalThis?.document?u.useLayoutEffect:()=>{},Id=u[" useId ".trim().toString()]||(()=>{}),Pd=0;function Zn(e){const[t,n]=u.useState(Id());return Ut(()=>{n(r=>r??String(Pd++))},[e]),e||(t?`radix-${t}`:"")}var Ad=u[" useInsertionEffect ".trim().toString()]||Ut;function _d({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,s,a]=Md({defaultProp:t,onChange:n}),i=e!==void 0,c=i?e:o;{const d=u.useRef(e!==void 0);u.useEffect(()=>{const f=d.current;f!==i&&console.warn(`${r} is changing from ${f?"controlled":"uncontrolled"} to ${i?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),d.current=i},[i,r])}const l=u.useCallback(d=>{if(i){const f=Ld(d)?d(e):d;f!==e&&a.current?.(f)}else s(d)},[i,e,s,a]);return[c,l]}function Md({defaultProp:e,onChange:t}){const[n,r]=u.useState(e),o=u.useRef(n),s=u.useRef(t);return Ad(()=>{s.current=t},[t]),u.useEffect(()=>{o.current!==n&&(s.current?.(n),o.current=n)},[n,o]),[n,r,s]}function Ld(e){return typeof e=="function"}function wa(e){const t=jd(e),n=u.forwardRef((r,o)=>{const{children:s,...a}=r,i=u.Children.toArray(s),c=i.find($d);if(c){const l=c.props.children,d=i.map(f=>f===c?u.Children.count(l)>1?u.Children.only(null):u.isValidElement(l)?l.props.children:null:f);return x.jsx(t,{...a,ref:o,children:u.isValidElement(l)?u.cloneElement(l,void 0,d):null})}return x.jsx(t,{...a,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function jd(e){const t=u.forwardRef((n,r)=>{const{children:o,...s}=n;if(u.isValidElement(o)){const a=Bd(o),i=Vd(s,o.props);return o.type!==u.Fragment&&(i.ref=r?ya(r,a):a),u.cloneElement(o,i)}return u.Children.count(o)>1?u.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Fd=Symbol("radix.slottable");function $d(e){return u.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Fd}function Vd(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...i)=>{const c=s(...i);return o(...i),c}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function Bd(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Wd=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ue=Wd.reduce((e,t)=>{const n=wa(`Primitive.${t}`),r=u.forwardRef((o,s)=>{const{asChild:a,...i}=o,c=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),x.jsx(c,{...i,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function zd(e,t){e&&Bt.flushSync(()=>e.dispatchEvent(t))}function Ht(e){const t=u.useRef(e);return u.useEffect(()=>{t.current=e}),u.useMemo(()=>(...n)=>t.current?.(...n),[])}function Ud(e,t=globalThis?.document){const n=Ht(e);u.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var Hd="DismissableLayer",wr="dismissableLayer.update",Gd="dismissableLayer.pointerDownOutside",Yd="dismissableLayer.focusOutside",No,Ea=u.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),xa=u.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:a,onDismiss:i,...c}=e,l=u.useContext(Ea),[d,f]=u.useState(null),p=d?.ownerDocument??globalThis?.document,[,g]=u.useState({}),h=ft(t,w=>f(w)),m=Array.from(l.layers),[v]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),y=m.indexOf(v),S=d?m.indexOf(d):-1,R=l.layersWithOutsidePointerEventsDisabled.size>0,b=S>=y,O=Xd(w=>{const E=w.target,I=[...l.branches].some(z=>z.contains(E));!b||I||(o?.(w),a?.(w),w.defaultPrevented||i?.())},p),D=Zd(w=>{const E=w.target;[...l.branches].some(z=>z.contains(E))||(s?.(w),a?.(w),w.defaultPrevented||i?.())},p);return Ud(w=>{S===l.layers.size-1&&(r?.(w),!w.defaultPrevented&&i&&(w.preventDefault(),i()))},p),u.useEffect(()=>{if(d)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(No=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(d)),l.layers.add(d),Io(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=No)}},[d,p,n,l]),u.useEffect(()=>()=>{d&&(l.layers.delete(d),l.layersWithOutsidePointerEventsDisabled.delete(d),Io())},[d,l]),u.useEffect(()=>{const w=()=>g({});return document.addEventListener(wr,w),()=>document.removeEventListener(wr,w)},[]),x.jsx(Ue.div,{...c,ref:h,style:{pointerEvents:R?b?"auto":"none":void 0,...e.style},onFocusCapture:Xe(e.onFocusCapture,D.onFocusCapture),onBlurCapture:Xe(e.onBlurCapture,D.onBlurCapture),onPointerDownCapture:Xe(e.onPointerDownCapture,O.onPointerDownCapture)})});xa.displayName=Hd;var qd="DismissableLayerBranch",Kd=u.forwardRef((e,t)=>{const n=u.useContext(Ea),r=u.useRef(null),o=ft(t,r);return u.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),x.jsx(Ue.div,{...e,ref:o})});Kd.displayName=qd;function Xd(e,t=globalThis?.document){const n=Ht(e),r=u.useRef(!1),o=u.useRef(()=>{});return u.useEffect(()=>{const s=i=>{if(i.target&&!r.current){let c=function(){Sa(Gd,n,l,{discrete:!0})};const l={originalEvent:i};i.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=c,t.addEventListener("click",o.current,{once:!0})):c()}else t.removeEventListener("click",o.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",s),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Zd(e,t=globalThis?.document){const n=Ht(e),r=u.useRef(!1);return u.useEffect(()=>{const o=s=>{s.target&&!r.current&&Sa(Yd,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Io(){const e=new CustomEvent(wr);document.dispatchEvent(e)}function Sa(e,t,n,{discrete:r}){const o=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?zd(o,s):o.dispatchEvent(s)}var Jn="focusScope.autoFocusOnMount",Qn="focusScope.autoFocusOnUnmount",Po={bubbles:!1,cancelable:!0},Jd="FocusScope",Ra=u.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:s,...a}=e,[i,c]=u.useState(null),l=Ht(o),d=Ht(s),f=u.useRef(null),p=ft(t,m=>c(m)),g=u.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;u.useEffect(()=>{if(r){let m=function(R){if(g.paused||!i)return;const b=R.target;i.contains(b)?f.current=b:qe(f.current,{select:!0})},v=function(R){if(g.paused||!i)return;const b=R.relatedTarget;b!==null&&(i.contains(b)||qe(f.current,{select:!0}))},y=function(R){if(document.activeElement===document.body)for(const O of R)O.removedNodes.length>0&&qe(i)};document.addEventListener("focusin",m),document.addEventListener("focusout",v);const S=new MutationObserver(y);return i&&S.observe(i,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",v),S.disconnect()}}},[r,i,g.paused]),u.useEffect(()=>{if(i){_o.add(g);const m=document.activeElement;if(!i.contains(m)){const y=new CustomEvent(Jn,Po);i.addEventListener(Jn,l),i.dispatchEvent(y),y.defaultPrevented||(Qd(of(Ca(i)),{select:!0}),document.activeElement===m&&qe(i))}return()=>{i.removeEventListener(Jn,l),setTimeout(()=>{const y=new CustomEvent(Qn,Po);i.addEventListener(Qn,d),i.dispatchEvent(y),y.defaultPrevented||qe(m??document.body,{select:!0}),i.removeEventListener(Qn,d),_o.remove(g)},0)}}},[i,l,d,g]);const h=u.useCallback(m=>{if(!n&&!r||g.paused)return;const v=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,y=document.activeElement;if(v&&y){const S=m.currentTarget,[R,b]=ef(S);R&&b?!m.shiftKey&&y===b?(m.preventDefault(),n&&qe(R,{select:!0})):m.shiftKey&&y===R&&(m.preventDefault(),n&&qe(b,{select:!0})):y===S&&m.preventDefault()}},[n,r,g.paused]);return x.jsx(Ue.div,{tabIndex:-1,...a,ref:p,onKeyDown:h})});Ra.displayName=Jd;function Qd(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(qe(r,{select:t}),document.activeElement!==n)return}function ef(e){const t=Ca(e),n=Ao(t,e),r=Ao(t.reverse(),e);return[n,r]}function Ca(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Ao(e,t){for(const n of e)if(!tf(n,{upTo:t}))return n}function tf(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 nf(e){return e instanceof HTMLInputElement&&"select"in e}function qe(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&nf(e)&&t&&e.select()}}var _o=rf();function rf(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=Mo(e,t),e.unshift(t)},remove(t){e=Mo(e,t),e[0]?.resume()}}}function Mo(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function of(e){return e.filter(t=>t.tagName!=="A")}var sf="Portal",Ta=u.forwardRef((e,t)=>{const{container:n,...r}=e,[o,s]=u.useState(!1);Ut(()=>s(!0),[]);const a=n||o&&globalThis?.document?.body;return a?Go.createPortal(x.jsx(Ue.div,{...r,ref:t}),a):null});Ta.displayName=sf;function af(e,t){return u.useReducer((n,r)=>t[n][r]??n,e)}var Ln=e=>{const{present:t,children:n}=e,r=lf(t),o=typeof n=="function"?n({present:r.isPresent}):u.Children.only(n),s=ft(r.ref,cf(o));return typeof n=="function"||r.isPresent?u.cloneElement(o,{ref:s}):null};Ln.displayName="Presence";function lf(e){const[t,n]=u.useState(),r=u.useRef(null),o=u.useRef(e),s=u.useRef("none"),a=e?"mounted":"unmounted",[i,c]=af(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return u.useEffect(()=>{const l=an(r.current);s.current=i==="mounted"?l:"none"},[i]),Ut(()=>{const l=r.current,d=o.current;if(d!==e){const p=s.current,g=an(l);e?c("MOUNT"):g==="none"||l?.display==="none"?c("UNMOUNT"):c(d&&p!==g?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,c]),Ut(()=>{if(t){let l;const d=t.ownerDocument.defaultView??window,f=g=>{const m=an(r.current).includes(CSS.escape(g.animationName));if(g.target===t&&m&&(c("ANIMATION_END"),!o.current)){const v=t.style.animationFillMode;t.style.animationFillMode="forwards",l=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=v)})}},p=g=>{g.target===t&&(s.current=an(r.current))};return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{d.clearTimeout(l),t.removeEventListener("animationstart",p),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(i),ref:u.useCallback(l=>{r.current=l?getComputedStyle(l):null,n(l)},[])}}function an(e){return e?.animationName||"none"}function cf(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var er=0;function uf(){u.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Lo()),document.body.insertAdjacentElement("beforeend",e[1]??Lo()),er++,()=>{er===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),er--}},[])}function Lo(){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 n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},$e.apply(this,arguments)};function Oa(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function df(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,s;r<o;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))}var hn="right-scroll-bar-position",vn="width-before-scroll-bar",ff="with-scroll-bars-hidden",pf="--removed-body-scroll-bar-size";function tr(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function mf(e,t){var n=k.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var gf=typeof window<"u"?u.useLayoutEffect:u.useEffect,jo=new WeakMap;function hf(e,t){var n=mf(null,function(r){return e.forEach(function(o){return tr(o,r)})});return gf(function(){var r=jo.get(n);if(r){var o=new Set(r),s=new Set(e),a=n.current;o.forEach(function(i){s.has(i)||tr(i,null)}),s.forEach(function(i){o.has(i)||tr(i,a)})}jo.set(n,e)},[e]),n}function vf(e){return e}function bf(e,t){t===void 0&&(t=vf);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(s){var a=t(s,r);return n.push(a),function(){n=n.filter(function(i){return i!==a})}},assignSyncMedium:function(s){for(r=!0;n.length;){var a=n;n=[],a.forEach(s)}n={push:function(i){return s(i)},filter:function(){return n}}},assignMedium:function(s){r=!0;var a=[];if(n.length){var i=n;n=[],i.forEach(s),a=n}var c=function(){var d=a;a=[],d.forEach(s)},l=function(){return Promise.resolve().then(c)};l(),n={push:function(d){a.push(d),l()},filter:function(d){return a=a.filter(d),n}}}};return o}function yf(e){e===void 0&&(e={});var t=bf(null);return t.options=$e({async:!0,ssr:!1},e),t}var ka=function(e){var t=e.sideCar,n=Oa(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return u.createElement(r,$e({},n))};ka.isSideCarExport=!0;function wf(e,t){return e.useMedium(t),ka}var Da=yf(),nr=function(){},jn=u.forwardRef(function(e,t){var n=u.useRef(null),r=u.useState({onScrollCapture:nr,onWheelCapture:nr,onTouchMoveCapture:nr}),o=r[0],s=r[1],a=e.forwardProps,i=e.children,c=e.className,l=e.removeScrollBar,d=e.enabled,f=e.shards,p=e.sideCar,g=e.noRelative,h=e.noIsolation,m=e.inert,v=e.allowPinchZoom,y=e.as,S=y===void 0?"div":y,R=e.gapMode,b=Oa(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),O=p,D=hf([n,t]),w=$e($e({},b),o);return u.createElement(u.Fragment,null,d&&u.createElement(O,{sideCar:Da,removeScrollBar:l,shards:f,noRelative:g,noIsolation:h,inert:m,setCallbacks:s,allowPinchZoom:!!v,lockRef:n,gapMode:R}),a?u.cloneElement(u.Children.only(i),$e($e({},w),{ref:D})):u.createElement(S,$e({},w,{className:c,ref:D}),i))});jn.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};jn.classNames={fullWidth:vn,zeroRight:hn};var Ef=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function xf(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Ef();return t&&e.setAttribute("nonce",t),e}function Sf(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Rf(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Cf=function(){var e=0,t=null;return{add:function(n){e==0&&(t=xf())&&(Sf(t,n),Rf(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Tf=function(){var e=Cf();return function(t,n){u.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Na=function(){var e=Tf(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},Of={left:0,top:0,right:0,gap:0},rr=function(e){return parseInt(e||"",10)||0},kf=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[rr(n),rr(r),rr(o)]},Df=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Of;var t=kf(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Nf=Na(),Et="data-scroll-locked",If=function(e,t,n,r){var o=e.left,s=e.top,a=e.right,i=e.gap;return n===void 0&&(n="margin"),`
|
|
24
|
-
.`.concat(
|
|
23
|
+
)`}return S.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...o,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:s}})});process.env.NODE_ENV!=="production"&&(ja.displayName="InternalBackdrop");const Fa=l.forwardRef(function(t,n){const{keepMounted:r=!1,...o}=t,{store:s}=pt(),a=s.useState("mounted"),i=s.useState("modal");return a||r?S.jsx(Qr.Provider,{value:r,children:S.jsxs(xa,{ref:n,...o,children:[a&&i===!0&&S.jsx(ja,{ref:s.context.internalBackdropRef,inert:hd(!open)}),t.children]})}):null});process.env.NODE_ENV!=="production"&&(Fa.displayName="DialogPortal");let zo={},Ho={},qo="";function gd(e){if(typeof document>"u")return!1;const t=Yn(e);return Qe(t).innerWidth-t.documentElement.clientWidth>0}function vd(e){const t=Yn(e),n=t.documentElement,r=t.body,o=qn(n)?n:r,s=o.style.overflow;return o.style.overflow="hidden",()=>{o.style.overflow=s}}function bd(e){const t=Yn(e),n=t.documentElement,r=t.body,o=Qe(n);let s=0,a=0;const i=Xe.create(),u=typeof CSS<"u"&&CSS.supports?.("scrollbar-gutter","stable");if(Cl&&(o.visualViewport?.scale??1)!==1)return()=>{};function c(){const p=o.getComputedStyle(n),h=o.getComputedStyle(r),v=(p.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";s=n.scrollTop,a=n.scrollLeft,zo={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},qo=n.style.scrollBehavior,Ho={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};const y=n.scrollHeight>n.clientHeight,E=n.scrollWidth>n.clientWidth,R=p.overflowY==="scroll"||h.overflowY==="scroll",b=p.overflowX==="scroll"||h.overflowX==="scroll",C=Math.max(0,o.innerWidth-n.clientWidth),O=Math.max(0,o.innerHeight-n.clientHeight),T=parseFloat(h.marginTop)+parseFloat(h.marginBottom),x=parseFloat(h.marginLeft)+parseFloat(h.marginRight),I=qn(n)?n:r;if(u){n.style.scrollbarGutter=v,I.style.overflowY="hidden",I.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:v,overflowY:"hidden",overflowX:"hidden"}),(y||R)&&(n.style.overflowY="scroll"),(E||b)&&(n.style.overflowX="scroll"),Object.assign(r.style,{position:"relative",height:T||O?`calc(100dvh - ${T+O}px)`:"100dvh",width:x||C?`calc(100vw - ${x+C}px)`:"100vw",boxSizing:"border-box",overflow:"hidden",scrollBehavior:"unset"}),r.scrollTop=s,r.scrollLeft=a,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function d(){Object.assign(n.style,zo),Object.assign(r.style,Ho),u||(n.scrollTop=s,n.scrollLeft=a,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=qo)}function f(){d(),i.request(c)}return c(),o.addEventListener("resize",f),()=>{i.cancel(),d(),typeof o.removeEventListener=="function"&&o.removeEventListener("resize",f)}}class yd{lockCount=0;restore=null;timeoutLock=Nt.create();timeoutUnlock=Nt.create();acquire(t){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(t)),this.release}release=()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(t){if(this.lockCount===0||this.restore!==null)return;const r=Yn(t).documentElement,o=Qe(r).getComputedStyle(r).overflowY;if(o==="hidden"||o==="clip"){this.restore=As;return}const s=Ol||!gd(t);this.restore=s?vd(t):bd(t)}}const wd=new yd;function Ed(e=!0,t=null){De(()=>{if(e)return wd.acquire(t)},[e,t])}function xd(e){const t=l.useRef(""),n=l.useCallback(o=>{o.defaultPrevented||(t.current=o.pointerType,e(o,o.pointerType))},[e]);return{onClick:l.useCallback(o=>{if(o.detail===0){e(o,"keyboard");return}"pointerType"in o&&e(o,o.pointerType),e(o,t.current),t.current=""},[e]),onPointerDown:n}}function Sd(e){const[t,n]=l.useState(null),r=me((i,u)=>{e||n(u)}),o=l.useCallback(()=>{n(null)},[]),{onClick:s,onPointerDown:a}=xd(r);return l.useMemo(()=>({openMethod:t,reset:o,triggerProps:{onClick:s,onPointerDown:a}}),[t,o,s,a])}function Td(e){const{store:t,parentContext:n,actionsRef:r}=e,o=t.useState("open"),s=t.useState("disablePointerDismissal"),a=t.useState("modal"),i=t.useState("popupElement"),{openMethod:u,triggerProps:c,reset:d}=Sd(o);Qu(t);const{forceUnmount:f}=ed(o,t,()=>{d()}),p=me(H=>{const q=We(H);return q.preventUnmountOnClose=()=>{t.set("preventUnmountingOnClose",!0)},q}),h=l.useCallback(()=>{t.setOpen(!1,p(xl))},[t,p]);l.useImperativeHandle(r,()=>({unmount:f,close:h}),[f,h]);const g=od({popupStore:t,onOpenChange:t.setOpen,treatPopupAsFloatingElement:!0,noEmit:!0}),[m,v]=l.useState(0),y=m===0,E=ad(g),R=vu(g,{outsidePressEvent(){return t.context.internalBackdropRef.current||t.context.backdropRef.current?"intentional":{mouse:a==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(H){if("button"in H&&H.button!==0||"touches"in H&&H.touches.length!==1)return!1;const q=qe(H);if(y&&!s){const Q=q;return a&&(t.context.internalBackdropRef.current||t.context.backdropRef.current)?t.context.internalBackdropRef.current===Q||t.context.backdropRef.current===Q||Re(Q,i)&&!Q?.hasAttribute("data-base-ui-portal"):!0}return!1},escapeKey:y});Ed(o&&a===!0,i);const{getReferenceProps:b,getFloatingProps:C,getTriggerProps:O}=Aa([E,R]);t.useContextCallback("onNestedDialogOpen",H=>{v(H+1)}),t.useContextCallback("onNestedDialogClose",()=>{v(0)}),l.useEffect(()=>(n?.onNestedDialogOpen&&o&&n.onNestedDialogOpen(m),n?.onNestedDialogClose&&!o&&n.onNestedDialogClose(),()=>{n?.onNestedDialogClose&&o&&n.onNestedDialogClose()}),[o,n,m]);const T=l.useMemo(()=>b(c),[b,c]),x=l.useMemo(()=>O(c),[O,c]),I=l.useMemo(()=>C(),[C]);t.useSyncedValues({openMethod:u,activeTriggerProps:T,inactiveTriggerProps:x,popupProps:I,floatingRootContext:g,nestedOpenDialogCount:m})}const Rd={...rd,modal:ge(e=>e.modal),nested:ge(e=>e.nested),nestedOpenDialogCount:ge(e=>e.nestedOpenDialogCount),disablePointerDismissal:ge(e=>e.disablePointerDismissal),openMethod:ge(e=>e.openMethod),descriptionElementId:ge(e=>e.descriptionElementId),titleElementId:ge(e=>e.titleElementId),viewportElement:ge(e=>e.viewportElement),role:ge(e=>e.role)};class kd extends Ra{constructor(t){super(Cd(t),{popupRef:l.createRef(),backdropRef:l.createRef(),internalBackdropRef:l.createRef(),triggerElements:new Oa,onOpenChange:void 0,onOpenChangeComplete:void 0},Rd)}setOpen=(t,n)=>{if(n.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!t&&n.trigger==null&&this.state.activeTriggerId!=null&&(n.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(t,n),n.isCanceled)return;const r={open:t,nativeEvent:n.event,reason:n.reason,nested:this.state.nested};this.state.floatingRootContext.context.events?.emit("openchange",r);const o={open:t},s=n.trigger?.id??null;(s||t)&&(o.activeTriggerId=s,o.activeTriggerElement=n.trigger??null),this.update(o)}}function Cd(e={}){return{...nd(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,role:"dialog",...e}}function Od(e){const{children:t,open:n,defaultOpen:r=!1,onOpenChange:o,onOpenChangeComplete:s,disablePointerDismissal:a=!1,modal:i=!0,actionsRef:u,handle:c,triggerId:d,defaultTriggerId:f=null}=e,p=pt(!0),h=!!p,g=dt(()=>c?.store??new kd({open:n??r,activeTriggerId:d!==void 0?d:f,modal:i,disablePointerDismissal:a,nested:h})).current;g.useControlledProp("open",n,r),g.useControlledProp("activeTriggerId",d,f),g.useSyncedValues({disablePointerDismissal:a,nested:h,modal:i}),g.useContextCallback("onOpenChange",o),g.useContextCallback("onOpenChangeComplete",s);const m=g.useState("payload");Td({store:g,actionsRef:u,parentContext:p?.store.context});const v=l.useMemo(()=>({store:g}),[g]);return S.jsx(qr.Provider,{value:v,children:typeof t=="function"?t({payload:m}):t})}const $a=l.forwardRef(function(t,n){const{render:r,className:o,id:s,...a}=t,{store:i}=pt(),u=Gr(s);return i.useSyncedValueWithCleanup("titleElementId",u),ft("h2",t,{ref:n,props:[{id:u},a]})});process.env.NODE_ENV!=="production"&&($a.displayName="DialogTitle");const Ba=l.forwardRef(function(t,n){const{render:r,className:o,disabled:s=!1,nativeButton:a=!0,id:i,payload:u,handle:c,...d}=t,f=pt(!0),p=c?.store??f?.store;if(!p)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: <Dialog.Trigger> must be used within <Dialog.Root> or provided with a handle.":St(79));const h=Gr(i),g=p.useState("floatingRootContext"),m=p.useState("isOpenedByTrigger",h),v=l.useRef(null),{registerTrigger:y,isMountedByThisTrigger:E}=Zu(h,v,p,{payload:u}),{getButtonProps:R,buttonRef:b}=Wr({disabled:s,native:a}),C=mu(g,{enabled:g!=null}),O=Aa([C]),T=l.useMemo(()=>({disabled:s,open:m}),[s,m]),x=p.useState("triggerProps",E);return ft("button",t,{state:T,ref:[b,n,y,v],props:[O.getReferenceProps(),x,{[Ds]:"",id:h},d,R],stateAttributesMapping:gl})});process.env.NODE_ENV!=="production"&&(Ba.displayName="DialogTrigger");const Ad=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Dd=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),Ko=e=>{const t=Dd(e);return t.charAt(0).toUpperCase()+t.slice(1)},Ua=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),Id=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var Pd={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const Nd=D.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:s,iconNode:a,...i},u)=>D.createElement("svg",{ref:u,...Pd,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Ua("lucide",o),...!s&&!Id(i)&&{"aria-hidden":"true"},...i},[...a.map(([c,d])=>D.createElement(c,d)),...Array.isArray(s)?s:[s]]));const Xn=(e,t)=>{const n=D.forwardRef(({className:r,...o},s)=>D.createElement(Nd,{ref:s,iconNode:t,className:Ua(`lucide-${Ad(Ko(e))}`,`lucide-${e}`,r),...o}));return n.displayName=Ko(e),n};const _d=[["path",{d:"m15 15 6 6",key:"1s409w"}],["path",{d:"m15 9 6-6",key:"ko1vev"}],["path",{d:"M21 16v5h-5",key:"1ck2sf"}],["path",{d:"M21 8V3h-5",key:"1qoq8a"}],["path",{d:"M3 16v5h5",key:"1t08am"}],["path",{d:"m3 21 6-6",key:"wwnumi"}],["path",{d:"M3 8V3h5",key:"1ln10m"}],["path",{d:"M9 9 3 3",key:"v551iv"}]],Va=Xn("expand",_d);const Md=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Ld=Xn("loader-circle",Md);const jd=[["path",{d:"m15 15 6 6m-6-6v4.8m0-4.8h4.8",key:"17vawe"}],["path",{d:"M9 19.8V15m0 0H4.2M9 15l-6 6",key:"chjx8e"}],["path",{d:"M15 4.2V9m0 0h4.8M15 9l6-6",key:"lav6yq"}],["path",{d:"M9 4.2V9m0 0H4.2M9 9 3 3",key:"1pxi2q"}]],Wa=Xn("shrink",jd);const Fd=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],$d=Xn("x",Fd);function Bd({...e}){return S.jsx(Od,{"data-slot":"dialog",...e})}function Ud({...e}){return S.jsx(Ba,{"data-slot":"dialog-trigger",...e})}function Vd({...e}){return S.jsx(Fa,{"data-slot":"dialog-portal",...e})}function Wd({className:e,...t}){return S.jsx(Gs,{"data-slot":"dialog-overlay",className:Le("data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs fixed inset-0 isolate z-50",e),...t})}function zd({className:e,children:t,showCloseButton:n=!0,...r}){return S.jsxs(Vd,{children:[S.jsx(Wd,{}),S.jsxs(La,{"data-slot":"dialog-content",className:Le("bg-background data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 ring-foreground/10 grid max-w-[calc(100%-2rem)] gap-4 rounded-xl p-4 text-sm ring-1 duration-100 sm:max-w-sm fixed top-1/2 left-1/2 z-50 w-full -translate-x-1/2 -translate-y-1/2 outline-none",e),...r,children:[t,n&&S.jsxs(Kr,{"data-slot":"dialog-close",render:S.jsx(rt,{variant:"ghost",className:"absolute top-2 right-2",size:"icon-sm"}),children:[S.jsx($d,{}),S.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function Hd({className:e,...t}){return S.jsx("div",{"data-slot":"dialog-header",className:Le("gap-2 flex flex-col",e),...t})}function qd({className:e,showCloseButton:t=!1,children:n,...r}){return S.jsxs("div",{"data-slot":"dialog-footer",className:Le("bg-muted/50 -mx-4 -mb-4 rounded-b-xl border-t p-4 flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...r,children:[n,t&&S.jsx(Kr,{render:S.jsx(rt,{variant:"outline"}),children:"Close"})]})}function Kd({className:e,...t}){return S.jsx($a,{"data-slot":"dialog-title",className:Le("text-sm leading-none font-medium",e),...t})}function Gd({className:e,...t}){return S.jsx(Js,{"data-slot":"dialog-description",className:Le("text-muted-foreground *:[a]:hover:text-foreground text-sm *:[a]:underline *:[a]:underline-offset-3",e),...t})}function za({className:e,...t}){return S.jsx(Ld,{role:"status","aria-label":"Loading",className:Le("size-4 animate-spin",e),...t})}const Yd="min-w-full w-full max-w-full min-h-full h-full max-h-full",Xd="min-w-full w-full max-w-full min-h-full h-full max-h-full",Jd="md:min-w-lg md:w-min-w-lg md:max-w-min-w-lg md:min-h-11/12 md:h-11/12 md:max-h-11/12 md:aspect-9/16 lg:min-w-3xl lg:w-3xl lg:max-w-3xl lg:min-h-11/12 lg:h-11/12 lg:max-h-11/12 lg:aspect-video xl:min-w-3xl xl:w-3xl xl:max-w-3xl xl:min-h-11/12 xl:h-11/12 xl:max-h-11/12 xl:aspect-video 2xl:min-w-5xl 2xl:w-5xl 2xl:max-w-5xl 2xl:min-h-11/12 2xl:h-11/12 2xl:max-h-11/12 2xl:aspect-video",Zd="min-w-full w-full max-w-full min-h-11/12 h-11/12 max-h-11/12",Bn={styles:{dialog:{expanded:Yd,compacted:Jd},drawer:{expanded:Xd,compacted:Zd}}},eo=D.forwardRef(({className:e,...t},n)=>S.jsx("iframe",{ref:n,className:Le("w-full h-full flex flex-col items-center justify-center rounded-xl",e),...t}));eo.displayName="IFrame";function Qd({open:e,setOpen:t,isLoading:n,error:r,onRetry:o,iframeURL:s,iframeRef:a,isFullScreen:i,setIsFullScreen:u,triggerProperties:{label:c,component:d=void 0},title:f}){return S.jsxs(Bd,{open:e,onOpenChange:t,children:[S.jsx(Ud,{render:d||S.jsx(rt,{variant:"default",children:c})}),S.jsxs(zd,{showCloseButton:!1,className:`shadow-2xl shadow-foreground p-0.5 m-0 flex flex-col items-center justify-center gap-0 bg-background ${i?Bn.styles.dialog.expanded:Bn.styles.dialog.compacted}`,children:[S.jsxs(Hd,{className:"absolute top-0 left-0 right-0 border-0 bg-background min-h-8 h-8 max-h-8 min-w-full w-full max-w-full shrink grow-0 flex flex-row items-center justify-center gap-0 rounded-t-xl px-1 py-0 mx-0 my-0",children:[S.jsx(Kd,{className:"rounded-xl text-lg leading-none min-w-1/2 w-1/2 max-w-/12 h-full flex flex-row items-center justify-start",children:f}),S.jsx(Gd,{className:"rounded-xl text-xs leading-none min-w-1/2 w-1/2 max-w-1/2 h-full flex flex-row items-center justify-end",children:S.jsx(rt,{variant:"outline",size:"icon-sm",className:"rounded-lg",onClick:()=>u(p=>!p),children:i?S.jsx(Wa,{}):S.jsx(Va,{})})})]}),S.jsxs("div",{className:"relative min-w-full w-full max-w-full mt-8 mb-4 mx-0 rounded-xl border shadow-inner grow shrink-0 overflow-hidden",children:[S.jsx(eo,{ref:a,title:f,src:s||"about:blank",className:"w-full h-full"}),n?S.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center gap-3 bg-background/80",children:[S.jsx(za,{className:"size-5"}),S.jsx("div",{className:"text-sm text-foreground",children:"Loading..."})]}):null,r?S.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center gap-3 bg-background/90 px-6 text-center",children:[S.jsx("div",{className:"text-sm font-medium text-foreground",children:"We couldn't start the session."}),S.jsx("div",{className:"text-xs text-muted-foreground",children:r.message||"Please try again."}),S.jsx(rt,{variant:"outline",size:"sm",onClick:o,children:"Retry"})]}):null]}),S.jsx(qd,{className:"absolute bottom-0 left-0 right-0 border-0 bg-background min-h-4 h-4 max-h-4 min-w-full w-full max-w-full shrink grow-0 flex flex-row items-center justify-center rounded-b-xl px-2 py-2 mx-0 my-0",children:S.jsx("div",{className:"text-xs text-foreground",children:"Powered by Aarthik Labs"})})]})]})}function ut(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e?.(o),n===!1||!o.defaultPrevented)return t?.(o)}}function Go(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Ha(...e){return t=>{let n=!1;const r=e.map(o=>{const s=Go(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():Go(e[o],null)}}}}function Tt(...e){return l.useCallback(Ha(...e),e)}function ef(e,t){const n=l.createContext(t),r=s=>{const{children:a,...i}=s,u=l.useMemo(()=>i,Object.values(i));return S.jsx(n.Provider,{value:u,children:a})};r.displayName=e+"Provider";function o(s){const a=l.useContext(n);if(a)return a;if(t!==void 0)return t;throw new Error(`\`${s}\` must be used within \`${e}\``)}return[r,o]}function tf(e,t=[]){let n=[];function r(s,a){const i=l.createContext(a),u=n.length;n=[...n,a];const c=f=>{const{scope:p,children:h,...g}=f,m=p?.[e]?.[u]||i,v=l.useMemo(()=>g,Object.values(g));return S.jsx(m.Provider,{value:v,children:h})};c.displayName=s+"Provider";function d(f,p){const h=p?.[e]?.[u]||i,g=l.useContext(h);if(g)return g;if(a!==void 0)return a;throw new Error(`\`${f}\` must be used within \`${s}\``)}return[c,d]}const o=()=>{const s=n.map(a=>l.createContext(a));return function(i){const u=i?.[e]||s;return l.useMemo(()=>({[`__scope${e}`]:{...i,[e]:u}}),[i,u])}};return o.scopeName=e,[r,nf(o,...t)]}function nf(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const a=r.reduce((i,{useScope:u,scopeName:c})=>{const f=u(s)[`__scope${c}`];return{...i,...f}},{});return l.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}var en=globalThis?.document?l.useLayoutEffect:()=>{},rf=l[" useId ".trim().toString()]||(()=>{}),of=0;function pr(e){const[t,n]=l.useState(rf());return en(()=>{n(r=>r??String(of++))},[e]),e||(t?`radix-${t}`:"")}var sf=l[" useInsertionEffect ".trim().toString()]||en;function af({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,s,a]=cf({defaultProp:t,onChange:n}),i=e!==void 0,u=i?e:o;{const d=l.useRef(e!==void 0);l.useEffect(()=>{const f=d.current;f!==i&&console.warn(`${r} is changing from ${f?"controlled":"uncontrolled"} to ${i?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),d.current=i},[i,r])}const c=l.useCallback(d=>{if(i){const f=lf(d)?d(e):d;f!==e&&a.current?.(f)}else s(d)},[i,e,s,a]);return[u,c]}function cf({defaultProp:e,onChange:t}){const[n,r]=l.useState(e),o=l.useRef(n),s=l.useRef(t);return sf(()=>{s.current=t},[t]),l.useEffect(()=>{o.current!==n&&(s.current?.(n),o.current=n)},[n,o]),[n,r,s]}function lf(e){return typeof e=="function"}function qa(e){const t=uf(e),n=l.forwardRef((r,o)=>{const{children:s,...a}=r,i=l.Children.toArray(s),u=i.find(ff);if(u){const c=u.props.children,d=i.map(f=>f===u?l.Children.count(c)>1?l.Children.only(null):l.isValidElement(c)?c.props.children:null:f);return S.jsx(t,{...a,ref:o,children:l.isValidElement(c)?l.cloneElement(c,void 0,d):null})}return S.jsx(t,{...a,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function uf(e){const t=l.forwardRef((n,r)=>{const{children:o,...s}=n;if(l.isValidElement(o)){const a=mf(o),i=pf(s,o.props);return o.type!==l.Fragment&&(i.ref=r?Ha(r,a):a),l.cloneElement(o,i)}return l.Children.count(o)>1?l.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var df=Symbol("radix.slottable");function ff(e){return l.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===df}function pf(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...i)=>{const u=s(...i);return o(...i),u}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function mf(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var hf=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ot=hf.reduce((e,t)=>{const n=qa(`Primitive.${t}`),r=l.forwardRef((o,s)=>{const{asChild:a,...i}=o,u=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),S.jsx(u,{...i,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function gf(e,t){e&&Jt.flushSync(()=>e.dispatchEvent(t))}function tn(e){const t=l.useRef(e);return l.useEffect(()=>{t.current=e}),l.useMemo(()=>(...n)=>t.current?.(...n),[])}function vf(e,t=globalThis?.document){const n=tn(e);l.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var bf="DismissableLayer",jr="dismissableLayer.update",yf="dismissableLayer.pointerDownOutside",wf="dismissableLayer.focusOutside",Yo,Ka=l.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Ga=l.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:a,onDismiss:i,...u}=e,c=l.useContext(Ka),[d,f]=l.useState(null),p=d?.ownerDocument??globalThis?.document,[,h]=l.useState({}),g=Tt(t,T=>f(T)),m=Array.from(c.layers),[v]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),y=m.indexOf(v),E=d?m.indexOf(d):-1,R=c.layersWithOutsidePointerEventsDisabled.size>0,b=E>=y,C=Sf(T=>{const x=T.target,I=[...c.branches].some(H=>H.contains(x));!b||I||(o?.(T),a?.(T),T.defaultPrevented||i?.())},p),O=Tf(T=>{const x=T.target;[...c.branches].some(H=>H.contains(x))||(s?.(T),a?.(T),T.defaultPrevented||i?.())},p);return vf(T=>{E===c.layers.size-1&&(r?.(T),!T.defaultPrevented&&i&&(T.preventDefault(),i()))},p),l.useEffect(()=>{if(d)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(Yo=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(d)),c.layers.add(d),Xo(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=Yo)}},[d,p,n,c]),l.useEffect(()=>()=>{d&&(c.layers.delete(d),c.layersWithOutsidePointerEventsDisabled.delete(d),Xo())},[d,c]),l.useEffect(()=>{const T=()=>h({});return document.addEventListener(jr,T),()=>document.removeEventListener(jr,T)},[]),S.jsx(ot.div,{...u,ref:g,style:{pointerEvents:R?b?"auto":"none":void 0,...e.style},onFocusCapture:ut(e.onFocusCapture,O.onFocusCapture),onBlurCapture:ut(e.onBlurCapture,O.onBlurCapture),onPointerDownCapture:ut(e.onPointerDownCapture,C.onPointerDownCapture)})});Ga.displayName=bf;var Ef="DismissableLayerBranch",xf=l.forwardRef((e,t)=>{const n=l.useContext(Ka),r=l.useRef(null),o=Tt(t,r);return l.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),S.jsx(ot.div,{...e,ref:o})});xf.displayName=Ef;function Sf(e,t=globalThis?.document){const n=tn(e),r=l.useRef(!1),o=l.useRef(()=>{});return l.useEffect(()=>{const s=i=>{if(i.target&&!r.current){let u=function(){Ya(yf,n,c,{discrete:!0})};const c={originalEvent:i};i.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=u,t.addEventListener("click",o.current,{once:!0})):u()}else t.removeEventListener("click",o.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",s),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Tf(e,t=globalThis?.document){const n=tn(e),r=l.useRef(!1);return l.useEffect(()=>{const o=s=>{s.target&&!r.current&&Ya(wf,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Xo(){const e=new CustomEvent(jr);document.dispatchEvent(e)}function Ya(e,t,n,{discrete:r}){const o=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?gf(o,s):o.dispatchEvent(s)}var mr="focusScope.autoFocusOnMount",hr="focusScope.autoFocusOnUnmount",Jo={bubbles:!1,cancelable:!0},Rf="FocusScope",Xa=l.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:s,...a}=e,[i,u]=l.useState(null),c=tn(o),d=tn(s),f=l.useRef(null),p=Tt(t,m=>u(m)),h=l.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;l.useEffect(()=>{if(r){let m=function(R){if(h.paused||!i)return;const b=R.target;i.contains(b)?f.current=b:ct(f.current,{select:!0})},v=function(R){if(h.paused||!i)return;const b=R.relatedTarget;b!==null&&(i.contains(b)||ct(f.current,{select:!0}))},y=function(R){if(document.activeElement===document.body)for(const C of R)C.removedNodes.length>0&&ct(i)};document.addEventListener("focusin",m),document.addEventListener("focusout",v);const E=new MutationObserver(y);return i&&E.observe(i,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",v),E.disconnect()}}},[r,i,h.paused]),l.useEffect(()=>{if(i){Qo.add(h);const m=document.activeElement;if(!i.contains(m)){const y=new CustomEvent(mr,Jo);i.addEventListener(mr,c),i.dispatchEvent(y),y.defaultPrevented||(kf(If(Ja(i)),{select:!0}),document.activeElement===m&&ct(i))}return()=>{i.removeEventListener(mr,c),setTimeout(()=>{const y=new CustomEvent(hr,Jo);i.addEventListener(hr,d),i.dispatchEvent(y),y.defaultPrevented||ct(m??document.body,{select:!0}),i.removeEventListener(hr,d),Qo.remove(h)},0)}}},[i,c,d,h]);const g=l.useCallback(m=>{if(!n&&!r||h.paused)return;const v=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,y=document.activeElement;if(v&&y){const E=m.currentTarget,[R,b]=Cf(E);R&&b?!m.shiftKey&&y===b?(m.preventDefault(),n&&ct(R,{select:!0})):m.shiftKey&&y===R&&(m.preventDefault(),n&&ct(b,{select:!0})):y===E&&m.preventDefault()}},[n,r,h.paused]);return S.jsx(ot.div,{tabIndex:-1,...a,ref:p,onKeyDown:g})});Xa.displayName=Rf;function kf(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(ct(r,{select:t}),document.activeElement!==n)return}function Cf(e){const t=Ja(e),n=Zo(t,e),r=Zo(t.reverse(),e);return[n,r]}function Ja(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Zo(e,t){for(const n of e)if(!Of(n,{upTo:t}))return n}function Of(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 Af(e){return e instanceof HTMLInputElement&&"select"in e}function ct(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Af(e)&&t&&e.select()}}var Qo=Df();function Df(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=es(e,t),e.unshift(t)},remove(t){e=es(e,t),e[0]?.resume()}}}function es(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function If(e){return e.filter(t=>t.tagName!=="A")}var Pf="Portal",Za=l.forwardRef((e,t)=>{const{container:n,...r}=e,[o,s]=l.useState(!1);en(()=>s(!0),[]);const a=n||o&&globalThis?.document?.body;return a?ys.createPortal(S.jsx(ot.div,{...r,ref:t}),a):null});Za.displayName=Pf;function Nf(e,t){return l.useReducer((n,r)=>t[n][r]??n,e)}var Jn=e=>{const{present:t,children:n}=e,r=_f(t),o=typeof n=="function"?n({present:r.isPresent}):l.Children.only(n),s=Tt(r.ref,Mf(o));return typeof n=="function"||r.isPresent?l.cloneElement(o,{ref:s}):null};Jn.displayName="Presence";function _f(e){const[t,n]=l.useState(),r=l.useRef(null),o=l.useRef(e),s=l.useRef("none"),a=e?"mounted":"unmounted",[i,u]=Nf(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return l.useEffect(()=>{const c=wn(r.current);s.current=i==="mounted"?c:"none"},[i]),en(()=>{const c=r.current,d=o.current;if(d!==e){const p=s.current,h=wn(c);e?u("MOUNT"):h==="none"||c?.display==="none"?u("UNMOUNT"):u(d&&p!==h?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,u]),en(()=>{if(t){let c;const d=t.ownerDocument.defaultView??window,f=h=>{const m=wn(r.current).includes(CSS.escape(h.animationName));if(h.target===t&&m&&(u("ANIMATION_END"),!o.current)){const v=t.style.animationFillMode;t.style.animationFillMode="forwards",c=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=v)})}},p=h=>{h.target===t&&(s.current=wn(r.current))};return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{d.clearTimeout(c),t.removeEventListener("animationstart",p),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(i),ref:l.useCallback(c=>{r.current=c?getComputedStyle(c):null,n(c)},[])}}function wn(e){return e?.animationName||"none"}function Mf(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var gr=0;function Lf(){l.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??ts()),document.body.insertAdjacentElement("beforeend",e[1]??ts()),gr++,()=>{gr===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),gr--}},[])}function ts(){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 Je=function(){return Je=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},Je.apply(this,arguments)};function Qa(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function jf(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,s;r<o;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))}var An="right-scroll-bar-position",Dn="width-before-scroll-bar",Ff="with-scroll-bars-hidden",$f="--removed-body-scroll-bar-size";function vr(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Bf(e,t){var n=D.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var Uf=typeof window<"u"?l.useLayoutEffect:l.useEffect,ns=new WeakMap;function Vf(e,t){var n=Bf(null,function(r){return e.forEach(function(o){return vr(o,r)})});return Uf(function(){var r=ns.get(n);if(r){var o=new Set(r),s=new Set(e),a=n.current;o.forEach(function(i){s.has(i)||vr(i,null)}),s.forEach(function(i){o.has(i)||vr(i,a)})}ns.set(n,e)},[e]),n}function Wf(e){return e}function zf(e,t){t===void 0&&(t=Wf);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(s){var a=t(s,r);return n.push(a),function(){n=n.filter(function(i){return i!==a})}},assignSyncMedium:function(s){for(r=!0;n.length;){var a=n;n=[],a.forEach(s)}n={push:function(i){return s(i)},filter:function(){return n}}},assignMedium:function(s){r=!0;var a=[];if(n.length){var i=n;n=[],i.forEach(s),a=n}var u=function(){var d=a;a=[],d.forEach(s)},c=function(){return Promise.resolve().then(u)};c(),n={push:function(d){a.push(d),c()},filter:function(d){return a=a.filter(d),n}}}};return o}function Hf(e){e===void 0&&(e={});var t=zf(null);return t.options=Je({async:!0,ssr:!1},e),t}var ei=function(e){var t=e.sideCar,n=Qa(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return l.createElement(r,Je({},n))};ei.isSideCarExport=!0;function qf(e,t){return e.useMedium(t),ei}var ti=Hf(),br=function(){},Zn=l.forwardRef(function(e,t){var n=l.useRef(null),r=l.useState({onScrollCapture:br,onWheelCapture:br,onTouchMoveCapture:br}),o=r[0],s=r[1],a=e.forwardProps,i=e.children,u=e.className,c=e.removeScrollBar,d=e.enabled,f=e.shards,p=e.sideCar,h=e.noRelative,g=e.noIsolation,m=e.inert,v=e.allowPinchZoom,y=e.as,E=y===void 0?"div":y,R=e.gapMode,b=Qa(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),C=p,O=Vf([n,t]),T=Je(Je({},b),o);return l.createElement(l.Fragment,null,d&&l.createElement(C,{sideCar:ti,removeScrollBar:c,shards:f,noRelative:h,noIsolation:g,inert:m,setCallbacks:s,allowPinchZoom:!!v,lockRef:n,gapMode:R}),a?l.cloneElement(l.Children.only(i),Je(Je({},T),{ref:O})):l.createElement(E,Je({},T,{className:u,ref:O}),i))});Zn.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Zn.classNames={fullWidth:Dn,zeroRight:An};var Kf=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Gf(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Kf();return t&&e.setAttribute("nonce",t),e}function Yf(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Xf(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Jf=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Gf())&&(Yf(t,n),Xf(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Zf=function(){var e=Jf();return function(t,n){l.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},ni=function(){var e=Zf(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},Qf={left:0,top:0,right:0,gap:0},yr=function(e){return parseInt(e||"",10)||0},ep=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[yr(n),yr(r),yr(o)]},tp=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Qf;var t=ep(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},np=ni(),Pt="data-scroll-locked",rp=function(e,t,n,r){var o=e.left,s=e.top,a=e.right,i=e.gap;return n===void 0&&(n="margin"),`
|
|
24
|
+
.`.concat(Ff,` {
|
|
25
25
|
overflow: hidden `).concat(r,`;
|
|
26
26
|
padding-right: `).concat(i,"px ").concat(r,`;
|
|
27
27
|
}
|
|
28
|
-
body[`).concat(
|
|
28
|
+
body[`).concat(Pt,`] {
|
|
29
29
|
overflow: hidden `).concat(r,`;
|
|
30
30
|
overscroll-behavior: contain;
|
|
31
31
|
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
@@ -38,32 +38,32 @@ Avoid returning a new reference inside your input selector, e.g.
|
|
|
38
38
|
`),n==="padding"&&"padding-right: ".concat(i,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
.`).concat(
|
|
41
|
+
.`).concat(An,` {
|
|
42
42
|
right: `).concat(i,"px ").concat(r,`;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
.`).concat(
|
|
45
|
+
.`).concat(Dn,` {
|
|
46
46
|
margin-right: `).concat(i,"px ").concat(r,`;
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
.`).concat(
|
|
49
|
+
.`).concat(An," .").concat(An,` {
|
|
50
50
|
right: 0 `).concat(r,`;
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
-
.`).concat(
|
|
53
|
+
.`).concat(Dn," .").concat(Dn,` {
|
|
54
54
|
margin-right: 0 `).concat(r,`;
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
-
body[`).concat(
|
|
58
|
-
`).concat(
|
|
57
|
+
body[`).concat(Pt,`] {
|
|
58
|
+
`).concat($f,": ").concat(i,`px;
|
|
59
59
|
}
|
|
60
|
-
`)},
|
|
60
|
+
`)},rs=function(){var e=parseInt(document.body.getAttribute(Pt)||"0",10);return isFinite(e)?e:0},op=function(){l.useEffect(function(){return document.body.setAttribute(Pt,(rs()+1).toString()),function(){var e=rs()-1;e<=0?document.body.removeAttribute(Pt):document.body.setAttribute(Pt,e.toString())}},[])},sp=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;op();var s=l.useMemo(function(){return tp(o)},[o]);return l.createElement(np,{styles:rp(s,!t,o,n?"":"!important")})},Fr=!1;if(typeof window<"u")try{var En=Object.defineProperty({},"passive",{get:function(){return Fr=!0,!0}});window.addEventListener("test",En,En),window.removeEventListener("test",En,En)}catch{Fr=!1}var kt=Fr?{passive:!1}:!1,ap=function(e){return e.tagName==="TEXTAREA"},ri=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!ap(e)&&n[t]==="visible")},ip=function(e){return ri(e,"overflowY")},cp=function(e){return ri(e,"overflowX")},os=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=oi(e,r);if(o){var s=si(e,r),a=s[1],i=s[2];if(a>i)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},lp=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},up=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},oi=function(e,t){return e==="v"?ip(t):cp(t)},si=function(e,t){return e==="v"?lp(t):up(t)},dp=function(e,t){return e==="h"&&t==="rtl"?-1:1},fp=function(e,t,n,r,o){var s=dp(e,window.getComputedStyle(t).direction),a=s*r,i=n.target,u=t.contains(i),c=!1,d=a>0,f=0,p=0;do{if(!i)break;var h=si(e,i),g=h[0],m=h[1],v=h[2],y=m-v-s*g;(g||y)&&oi(e,i)&&(f+=y,p+=g);var E=i.parentNode;i=E&&E.nodeType===Node.DOCUMENT_FRAGMENT_NODE?E.host:E}while(!u&&i!==document.body||u&&(t.contains(i)||t===i));return(d&&Math.abs(f)<1||!d&&Math.abs(p)<1)&&(c=!0),c},xn=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},ss=function(e){return[e.deltaX,e.deltaY]},as=function(e){return e&&"current"in e?e.current:e},pp=function(e,t){return e[0]===t[0]&&e[1]===t[1]},mp=function(e){return`
|
|
61
61
|
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
62
62
|
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
63
|
-
`)},
|
|
63
|
+
`)},hp=0,Ct=[];function gp(e){var t=l.useRef([]),n=l.useRef([0,0]),r=l.useRef(),o=l.useState(hp++)[0],s=l.useState(ni)[0],a=l.useRef(e);l.useEffect(function(){a.current=e},[e]),l.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var m=jf([e.lockRef.current],(e.shards||[]).map(as),!0).filter(Boolean);return m.forEach(function(v){return v.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),m.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var i=l.useCallback(function(m,v){if("touches"in m&&m.touches.length===2||m.type==="wheel"&&m.ctrlKey)return!a.current.allowPinchZoom;var y=xn(m),E=n.current,R="deltaX"in m?m.deltaX:E[0]-y[0],b="deltaY"in m?m.deltaY:E[1]-y[1],C,O=m.target,T=Math.abs(R)>Math.abs(b)?"h":"v";if("touches"in m&&T==="h"&&O.type==="range")return!1;var x=window.getSelection(),I=x&&x.anchorNode,H=I?I===O||I.contains(O):!1;if(H)return!1;var q=os(T,O);if(!q)return!0;if(q?C=T:(C=T==="v"?"h":"v",q=os(T,O)),!q)return!1;if(!r.current&&"changedTouches"in m&&(R||b)&&(r.current=C),!C)return!0;var Q=r.current||C;return fp(Q,v,m,Q==="h"?R:b)},[]),u=l.useCallback(function(m){var v=m;if(!(!Ct.length||Ct[Ct.length-1]!==s)){var y="deltaY"in v?ss(v):xn(v),E=t.current.filter(function(C){return C.name===v.type&&(C.target===v.target||v.target===C.shadowParent)&&pp(C.delta,y)})[0];if(E&&E.should){v.cancelable&&v.preventDefault();return}if(!E){var R=(a.current.shards||[]).map(as).filter(Boolean).filter(function(C){return C.contains(v.target)}),b=R.length>0?i(v,R[0]):!a.current.noIsolation;b&&v.cancelable&&v.preventDefault()}}},[]),c=l.useCallback(function(m,v,y,E){var R={name:m,delta:v,target:y,should:E,shadowParent:vp(y)};t.current.push(R),setTimeout(function(){t.current=t.current.filter(function(b){return b!==R})},1)},[]),d=l.useCallback(function(m){n.current=xn(m),r.current=void 0},[]),f=l.useCallback(function(m){c(m.type,ss(m),m.target,i(m,e.lockRef.current))},[]),p=l.useCallback(function(m){c(m.type,xn(m),m.target,i(m,e.lockRef.current))},[]);l.useEffect(function(){return Ct.push(s),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:p}),document.addEventListener("wheel",u,kt),document.addEventListener("touchmove",u,kt),document.addEventListener("touchstart",d,kt),function(){Ct=Ct.filter(function(m){return m!==s}),document.removeEventListener("wheel",u,kt),document.removeEventListener("touchmove",u,kt),document.removeEventListener("touchstart",d,kt)}},[]);var h=e.removeScrollBar,g=e.inert;return l.createElement(l.Fragment,null,g?l.createElement(s,{styles:mp(o)}):null,h?l.createElement(sp,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function vp(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const bp=qf(ti,gp);var ai=l.forwardRef(function(e,t){return l.createElement(Zn,Je({},e,{ref:t,sideCar:bp}))});ai.classNames=Zn.classNames;var yp=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Ot=new WeakMap,Sn=new WeakMap,Tn={},wr=0,ii=function(e){return e&&(e.host||ii(e.parentNode))},wp=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=ii(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},Ep=function(e,t,n,r){var o=wp(t,Array.isArray(e)?e:[e]);Tn[n]||(Tn[n]=new WeakMap);var s=Tn[n],a=[],i=new Set,u=new Set(o),c=function(f){!f||i.has(f)||(i.add(f),c(f.parentNode))};o.forEach(c);var d=function(f){!f||u.has(f)||Array.prototype.forEach.call(f.children,function(p){if(i.has(p))d(p);else try{var h=p.getAttribute(r),g=h!==null&&h!=="false",m=(Ot.get(p)||0)+1,v=(s.get(p)||0)+1;Ot.set(p,m),s.set(p,v),a.push(p),m===1&&g&&Sn.set(p,!0),v===1&&p.setAttribute(n,"true"),g||p.setAttribute(r,"true")}catch(y){console.error("aria-hidden: cannot operate on ",p,y)}})};return d(t),i.clear(),wr++,function(){a.forEach(function(f){var p=Ot.get(f)-1,h=s.get(f)-1;Ot.set(f,p),s.set(f,h),p||(Sn.has(f)||f.removeAttribute(r),Sn.delete(f)),h||f.removeAttribute(n)}),wr--,wr||(Ot=new WeakMap,Ot=new WeakMap,Sn=new WeakMap,Tn={})}},xp=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=yp(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),Ep(r,o,n,"aria-hidden")):function(){return null}},Qn="Dialog",[ci]=tf(Qn),[Sp,Ke]=ci(Qn),li=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:s,modal:a=!0}=e,i=l.useRef(null),u=l.useRef(null),[c,d]=af({prop:r,defaultProp:o??!1,onChange:s,caller:Qn});return S.jsx(Sp,{scope:t,triggerRef:i,contentRef:u,contentId:pr(),titleId:pr(),descriptionId:pr(),open:c,onOpenChange:d,onOpenToggle:l.useCallback(()=>d(f=>!f),[d]),modal:a,children:n})};li.displayName=Qn;var ui="DialogTrigger",di=l.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Ke(ui,n),s=Tt(t,o.triggerRef);return S.jsx(ot.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":ro(o.open),...r,ref:s,onClick:ut(e.onClick,o.onOpenToggle)})});di.displayName=ui;var to="DialogPortal",[Tp,fi]=ci(to,{forceMount:void 0}),pi=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,s=Ke(to,t);return S.jsx(Tp,{scope:t,forceMount:n,children:l.Children.map(r,a=>S.jsx(Jn,{present:n||s.open,children:S.jsx(Za,{asChild:!0,container:o,children:a})}))})};pi.displayName=to;var Un="DialogOverlay",mi=l.forwardRef((e,t)=>{const n=fi(Un,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,s=Ke(Un,e.__scopeDialog);return s.modal?S.jsx(Jn,{present:r||s.open,children:S.jsx(kp,{...o,ref:t})}):null});mi.displayName=Un;var Rp=qa("DialogOverlay.RemoveScroll"),kp=l.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Ke(Un,n);return S.jsx(ai,{as:Rp,allowPinchZoom:!0,shards:[o.contentRef],children:S.jsx(ot.div,{"data-state":ro(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Et="DialogContent",hi=l.forwardRef((e,t)=>{const n=fi(Et,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,s=Ke(Et,e.__scopeDialog);return S.jsx(Jn,{present:r||s.open,children:s.modal?S.jsx(Cp,{...o,ref:t}):S.jsx(Op,{...o,ref:t})})});hi.displayName=Et;var Cp=l.forwardRef((e,t)=>{const n=Ke(Et,e.__scopeDialog),r=l.useRef(null),o=Tt(t,n.contentRef,r);return l.useEffect(()=>{const s=r.current;if(s)return xp(s)},[]),S.jsx(gi,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ut(e.onCloseAutoFocus,s=>{s.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:ut(e.onPointerDownOutside,s=>{const a=s.detail.originalEvent,i=a.button===0&&a.ctrlKey===!0;(a.button===2||i)&&s.preventDefault()}),onFocusOutside:ut(e.onFocusOutside,s=>s.preventDefault())})}),Op=l.forwardRef((e,t)=>{const n=Ke(Et,e.__scopeDialog),r=l.useRef(!1),o=l.useRef(!1);return S.jsx(gi,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{e.onCloseAutoFocus?.(s),s.defaultPrevented||(r.current||n.triggerRef.current?.focus(),s.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:s=>{e.onInteractOutside?.(s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const a=s.target;n.triggerRef.current?.contains(a)&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&o.current&&s.preventDefault()}})}),gi=l.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:s,...a}=e,i=Ke(Et,n),u=l.useRef(null),c=Tt(t,u);return Lf(),S.jsxs(S.Fragment,{children:[S.jsx(Xa,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:s,children:S.jsx(Ga,{role:"dialog",id:i.contentId,"aria-describedby":i.descriptionId,"aria-labelledby":i.titleId,"data-state":ro(i.open),...a,ref:c,onDismiss:()=>i.onOpenChange(!1)})}),S.jsxs(S.Fragment,{children:[S.jsx(Ap,{titleId:i.titleId}),S.jsx(Ip,{contentRef:u,descriptionId:i.descriptionId})]})]})}),no="DialogTitle",vi=l.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Ke(no,n);return S.jsx(ot.h2,{id:o.titleId,...r,ref:t})});vi.displayName=no;var bi="DialogDescription",yi=l.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Ke(bi,n);return S.jsx(ot.p,{id:o.descriptionId,...r,ref:t})});yi.displayName=bi;var wi="DialogClose",Ei=l.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Ke(wi,n);return S.jsx(ot.button,{type:"button",...r,ref:t,onClick:ut(e.onClick,()=>o.onOpenChange(!1))})});Ei.displayName=wi;function ro(e){return e?"open":"closed"}var xi="DialogTitleWarning",[Jm,Si]=ef(xi,{contentName:Et,titleName:no,docsSlug:"dialog"}),Ap=({titleId:e})=>{const t=Si(xi),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
64
64
|
|
|
65
65
|
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
66
66
|
|
|
67
|
-
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return
|
|
67
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return l.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},Dp="DialogDescriptionWarning",Ip=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Si(Dp).contentName}}.`;return l.useEffect(()=>{const o=e.current?.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},Pp=li,Np=di,_p=pi,Mp=mi,Lp=hi,jp=vi,Fp=yi,$p=Ei;function Bp(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}const Ti=D.createContext({drawerRef:{current:null},overlayRef:{current:null},onPress:()=>{},onRelease:()=>{},onDrag:()=>{},onNestedDrag:()=>{},onNestedOpenChange:()=>{},onNestedRelease:()=>{},openProp:void 0,dismissible:!1,isOpen:!1,isDragging:!1,keyboardIsOpen:{current:!1},snapPointsOffset:null,snapPoints:null,handleOnly:!1,modal:!1,shouldFade:!1,activeSnapPoint:null,onOpenChange:()=>{},setActiveSnapPoint:()=>{},closeDrawer:()=>{},direction:"bottom",shouldAnimate:{current:!0},shouldScaleBackground:!1,setBackgroundColorOnScale:!0,noBodyStyles:!1,container:null,autoFocus:!1}),rn=()=>{const e=D.useContext(Ti);if(!e)throw new Error("useDrawerContext must be used within a Drawer.Root");return e};Bp(`[data-vaul-drawer]{touch-action:none;will-change:transform;transition:transform .5s cubic-bezier(.32, .72, 0, 1);animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=open]{animation-name:slideFromBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=closed]{animation-name:slideToBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=open]{animation-name:slideFromTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=closed]{animation-name:slideToTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=open]{animation-name:slideFromLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=closed]{animation-name:slideToLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=open]{animation-name:slideFromRight}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=closed]{animation-name:slideToRight}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--initial-transform,100%),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--initial-transform,100%),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-overlay][data-vaul-snap-points=false]{animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-overlay][data-vaul-snap-points=false][data-state=open]{animation-name:fadeIn}[data-vaul-overlay][data-state=closed]{animation-name:fadeOut}[data-vaul-animate=false]{animation:none!important}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:0;transition:opacity .5s cubic-bezier(.32, .72, 0, 1)}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:1}[data-vaul-drawer]:not([data-vaul-custom-container=true])::after{content:'';position:absolute;background:inherit;background-color:inherit}[data-vaul-drawer][data-vaul-drawer-direction=top]::after{top:initial;bottom:100%;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=bottom]::after{top:100%;bottom:initial;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=left]::after{left:initial;right:100%;top:0;bottom:0;width:200%}[data-vaul-drawer][data-vaul-drawer-direction=right]::after{left:100%;right:initial;top:0;bottom:0;width:200%}[data-vaul-overlay][data-vaul-snap-points=true]:not([data-vaul-snap-points-overlay=true]):not(
|
|
68
68
|
[data-state=closed]
|
|
69
|
-
){opacity:0}[data-vaul-overlay][data-vaul-snap-points-overlay=true]{opacity:1}[data-vaul-handle]{display:block;position:relative;opacity:.7;background:#e2e2e4;margin-left:auto;margin-right:auto;height:5px;width:32px;border-radius:1rem;touch-action:pan-y}[data-vaul-handle]:active,[data-vaul-handle]:hover{opacity:1}[data-vaul-handle-hitarea]{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:max(100%,2.75rem);height:max(100%,2.75rem);touch-action:inherit}@media (hover:hover) and (pointer:fine){[data-vaul-drawer]{user-select:none}}@media (pointer:fine){[data-vaul-handle-hitarea]:{width:100%;height:100%}}@keyframes fadeIn{from{opacity:0}to{opacity:1}}@keyframes fadeOut{to{opacity:0}}@keyframes slideFromBottom{from{transform:translate3d(0,var(--initial-transform,100%),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToBottom{to{transform:translate3d(0,var(--initial-transform,100%),0)}}@keyframes slideFromTop{from{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToTop{to{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}}@keyframes slideFromLeft{from{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToLeft{to{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}}@keyframes slideFromRight{from{transform:translate3d(var(--initial-transform,100%),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToRight{to{transform:translate3d(var(--initial-transform,100%),0,0)}}`);function gp(){const e=navigator.userAgent;return typeof window<"u"&&(/Firefox/.test(e)&&/Mobile/.test(e)||/FxiOS/.test(e))}function hp(){return Vr(/^Mac/)}function vp(){return Vr(/^iPhone/)}function Wo(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function bp(){return Vr(/^iPad/)||hp()&&navigator.maxTouchPoints>1}function Qa(){return vp()||bp()}function Vr(e){return typeof window<"u"&&window.navigator!=null?e.test(window.navigator.platform):void 0}const yp=24,wp=typeof window<"u"?k.useLayoutEffect:k.useEffect;function zo(...e){return(...t)=>{for(let n of e)typeof n=="function"&&n(...t)}}const sr=typeof document<"u"&&window.visualViewport;function Uo(e){let t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function ei(e){for(Uo(e)&&(e=e.parentElement);e&&!Uo(e);)e=e.parentElement;return e||document.scrollingElement||document.documentElement}const Ep=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);let fn=0,ar;function xp(e={}){let{isDisabled:t}=e;wp(()=>{if(!t)return fn++,fn===1&&Qa()&&(ar=Sp()),()=>{fn--,fn===0&&ar?.()}},[t])}function Sp(){let e,t=0,n=f=>{e=ei(f.target),!(e===document.documentElement&&e===document.body)&&(t=f.changedTouches[0].pageY)},r=f=>{if(!e||e===document.documentElement||e===document.body){f.preventDefault();return}let p=f.changedTouches[0].pageY,g=e.scrollTop,h=e.scrollHeight-e.clientHeight;h!==0&&((g<=0&&p>t||g>=h&&p<t)&&f.preventDefault(),t=p)},o=f=>{let p=f.target;xr(p)&&p!==document.activeElement&&(f.preventDefault(),p.style.transform="translateY(-2000px)",p.focus(),requestAnimationFrame(()=>{p.style.transform=""}))},s=f=>{let p=f.target;xr(p)&&(p.style.transform="translateY(-2000px)",requestAnimationFrame(()=>{p.style.transform="",sr&&(sr.height<window.innerHeight?requestAnimationFrame(()=>{Ho(p)}):sr.addEventListener("resize",()=>Ho(p),{once:!0}))}))},a=()=>{window.scrollTo(0,0)},i=window.pageXOffset,c=window.pageYOffset,l=zo(Rp(document.documentElement,"paddingRight",`${window.innerWidth-document.documentElement.clientWidth}px`));window.scrollTo(0,0);let d=zo(At(document,"touchstart",n,{passive:!1,capture:!0}),At(document,"touchmove",r,{passive:!1,capture:!0}),At(document,"touchend",o,{passive:!1,capture:!0}),At(document,"focus",s,!0),At(window,"scroll",a));return()=>{l(),d(),window.scrollTo(i,c)}}function Rp(e,t,n){let r=e.style[t];return e.style[t]=n,()=>{e.style[t]=r}}function At(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function Ho(e){let t=document.scrollingElement||document.documentElement;for(;e&&e!==t;){let n=ei(e);if(n!==document.documentElement&&n!==document.body&&n!==e){let r=n.getBoundingClientRect().top,o=e.getBoundingClientRect().top,s=e.getBoundingClientRect().bottom;const a=n.getBoundingClientRect().bottom+yp;s>a&&(n.scrollTop+=o-r)}e=n.parentElement}}function xr(e){return e instanceof HTMLInputElement&&!Ep.has(e.type)||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable}function Cp(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function Tp(...e){return t=>e.forEach(n=>Cp(n,t))}function ti(...e){return u.useCallback(Tp(...e),e)}const ni=new WeakMap;function we(e,t,n=!1){if(!e||!(e instanceof HTMLElement))return;let r={};Object.entries(t).forEach(([o,s])=>{if(o.startsWith("--")){e.style.setProperty(o,s);return}r[o]=e.style[o],e.style[o]=s}),!n&&ni.set(e,r)}function Op(e,t){if(!e||!(e instanceof HTMLElement))return;let n=ni.get(e);n&&(e.style[t]=n[t])}const ve=e=>{switch(e){case"top":case"bottom":return!0;case"left":case"right":return!1;default:return e}};function pn(e,t){if(!e)return null;const n=window.getComputedStyle(e),r=n.transform||n.webkitTransform||n.mozTransform;let o=r.match(/^matrix3d\((.+)\)$/);return o?parseFloat(o[1].split(", ")[ve(t)?13:12]):(o=r.match(/^matrix\((.+)\)$/),o?parseFloat(o[1].split(", ")[ve(t)?5:4]):null)}function kp(e){return 8*(Math.log(e+1)-2)}function ir(e,t){if(!e)return()=>{};const n=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=n}}function Dp(...e){return(...t)=>{for(const n of e)typeof n=="function"&&n(...t)}}const pe={DURATION:.5,EASE:[.32,.72,0,1]},ri=.4,Np=.25,Ip=100,oi=8,st=16,Sr=26,lr="vaul-dragging";function si(e){const t=k.useRef(e);return k.useEffect(()=>{t.current=e}),k.useMemo(()=>(...n)=>t.current==null?void 0:t.current.call(t,...n),[])}function Pp({defaultProp:e,onChange:t}){const n=k.useState(e),[r]=n,o=k.useRef(r),s=si(t);return k.useEffect(()=>{o.current!==r&&(s(r),o.current=r)},[r,o,s]),n}function ai({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=Pp({defaultProp:t,onChange:n}),s=e!==void 0,a=s?e:r,i=si(n),c=k.useCallback(l=>{if(s){const f=typeof l=="function"?l(e):l;f!==e&&i(f)}else o(l)},[s,e,o,i]);return[a,c]}function Ap({activeSnapPointProp:e,setActiveSnapPointProp:t,snapPoints:n,drawerRef:r,overlayRef:o,fadeFromIndex:s,onSnapPointChange:a,direction:i="bottom",container:c,snapToSequentialPoint:l}){const[d,f]=ai({prop:e,defaultProp:n?.[0],onChange:t}),[p,g]=k.useState(typeof window<"u"?{innerWidth:window.innerWidth,innerHeight:window.innerHeight}:void 0);k.useEffect(()=>{function w(){g({innerWidth:window.innerWidth,innerHeight:window.innerHeight})}return window.addEventListener("resize",w),()=>window.removeEventListener("resize",w)},[]);const h=k.useMemo(()=>d===n?.[n.length-1]||null,[n,d]),m=k.useMemo(()=>{var w;return(w=n?.findIndex(E=>E===d))!=null?w:null},[n,d]),v=n&&n.length>0&&(s||s===0)&&!Number.isNaN(s)&&n[s]===d||!n,y=k.useMemo(()=>{const w=c?{width:c.getBoundingClientRect().width,height:c.getBoundingClientRect().height}:typeof window<"u"?{width:window.innerWidth,height:window.innerHeight}:{width:0,height:0};var E;return(E=n?.map(I=>{const z=typeof I=="string";let Y=0;if(z&&(Y=parseInt(I,10)),ve(i)){const _=z?Y:p?I*w.height:0;return p?i==="bottom"?w.height-_:-w.height+_:_}const Z=z?Y:p?I*w.width:0;return p?i==="right"?w.width-Z:-w.width+Z:Z}))!=null?E:[]},[n,p,c]),S=k.useMemo(()=>m!==null?y?.[m]:null,[y,m]),R=k.useCallback(w=>{var E;const I=(E=y?.findIndex(z=>z===w))!=null?E:null;a(I),we(r.current,{transition:`transform ${pe.DURATION}s cubic-bezier(${pe.EASE.join(",")})`,transform:ve(i)?`translate3d(0, ${w}px, 0)`:`translate3d(${w}px, 0, 0)`}),y&&I!==y.length-1&&s!==void 0&&I!==s&&I<s?we(o.current,{transition:`opacity ${pe.DURATION}s cubic-bezier(${pe.EASE.join(",")})`,opacity:"0"}):we(o.current,{transition:`opacity ${pe.DURATION}s cubic-bezier(${pe.EASE.join(",")})`,opacity:"1"}),f(n?.[Math.max(I,0)])},[r.current,n,y,s,o,f]);k.useEffect(()=>{if(d||e){var w;const E=(w=n?.findIndex(I=>I===e||I===d))!=null?w:-1;y&&E!==-1&&typeof y[E]=="number"&&R(y[E])}},[d,e,n,y,R]);function b({draggedDistance:w,closeDrawer:E,velocity:I,dismissible:z}){if(s===void 0)return;const Y=i==="bottom"||i==="right"?(S??0)-w:(S??0)+w,Z=m===s-1,_=m===0,te=w>0;if(Z&&we(o.current,{transition:`opacity ${pe.DURATION}s cubic-bezier(${pe.EASE.join(",")})`}),!l&&I>2&&!te){z?E():R(y[0]);return}if(!l&&I>2&&te&&y&&n){R(y[n.length-1]);return}const F=y?.reduce((re,N)=>typeof re!="number"||typeof N!="number"?re:Math.abs(N-Y)<Math.abs(re-Y)?N:re),ee=ve(i)?window.innerHeight:window.innerWidth;if(I>ri&&Math.abs(w)<ee*.4){const re=te?1:-1;if(re>0&&h&&n){R(y[n.length-1]);return}if(_&&re<0&&z&&E(),m===null)return;R(y[m+re]);return}R(F)}function O({draggedDistance:w}){if(S===null)return;const E=i==="bottom"||i==="right"?S-w:S+w;(i==="bottom"||i==="right")&&E<y[y.length-1]||(i==="top"||i==="left")&&E>y[y.length-1]||we(r.current,{transform:ve(i)?`translate3d(0, ${E}px, 0)`:`translate3d(${E}px, 0, 0)`})}function D(w,E){if(!n||typeof m!="number"||!y||s===void 0)return null;const I=m===s-1;if(m>=s&&E)return 0;if(I&&!E)return 1;if(!v&&!I)return null;const Y=I?m+1:m-1,Z=I?y[Y]-y[Y-1]:y[Y+1]-y[Y],_=w/Math.abs(Z);return I?1-_:_}return{isLastSnapPoint:h,activeSnapPoint:d,shouldFade:v,getPercentageDragged:D,setActiveSnapPoint:f,activeSnapPointIndex:m,onRelease:b,onDrag:O,snapPointsOffset:y}}const _p=()=>()=>{};function Mp(){const{direction:e,isOpen:t,shouldScaleBackground:n,setBackgroundColorOnScale:r,noBodyStyles:o}=Yt(),s=k.useRef(null),a=k.useMemo(()=>document.body.style.backgroundColor,[]);function i(){return(window.innerWidth-Sr)/window.innerWidth}k.useEffect(()=>{if(t&&n){s.current&&clearTimeout(s.current);const c=document.querySelector("[data-vaul-drawer-wrapper]")||document.querySelector("[vaul-drawer-wrapper]");if(!c)return;Dp(r&&!o?ir(document.body,{background:"black"}):_p,ir(c,{transformOrigin:ve(e)?"top":"left",transitionProperty:"transform, border-radius",transitionDuration:`${pe.DURATION}s`,transitionTimingFunction:`cubic-bezier(${pe.EASE.join(",")})`}));const l=ir(c,{borderRadius:`${oi}px`,overflow:"hidden",...ve(e)?{transform:`scale(${i()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`}:{transform:`scale(${i()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`}});return()=>{l(),s.current=window.setTimeout(()=>{a?document.body.style.background=a:document.body.style.removeProperty("background")},pe.DURATION*1e3)}}},[t,n,a])}let _t=null;function Lp({isOpen:e,modal:t,nested:n,hasBeenOpened:r,preventScrollRestoration:o,noBodyStyles:s}){const[a,i]=k.useState(()=>typeof window<"u"?window.location.href:""),c=k.useRef(0),l=k.useCallback(()=>{if(Wo()&&_t===null&&e&&!s){_t={position:document.body.style.position,top:document.body.style.top,left:document.body.style.left,height:document.body.style.height,right:"unset"};const{scrollX:f,innerHeight:p}=window;document.body.style.setProperty("position","fixed","important"),Object.assign(document.body.style,{top:`${-c.current}px`,left:`${-f}px`,right:"0px",height:"auto"}),window.setTimeout(()=>window.requestAnimationFrame(()=>{const g=p-window.innerHeight;g&&c.current>=p&&(document.body.style.top=`${-(c.current+g)}px`)}),300)}},[e]),d=k.useCallback(()=>{if(Wo()&&_t!==null&&!s){const f=-parseInt(document.body.style.top,10),p=-parseInt(document.body.style.left,10);Object.assign(document.body.style,_t),window.requestAnimationFrame(()=>{if(o&&a!==window.location.href){i(window.location.href);return}window.scrollTo(p,f)}),_t=null}},[a]);return k.useEffect(()=>{function f(){c.current=window.scrollY}return f(),window.addEventListener("scroll",f),()=>{window.removeEventListener("scroll",f)}},[]),k.useEffect(()=>{if(t)return()=>{typeof document>"u"||document.querySelector("[data-vaul-drawer]")||d()}},[t,d]),k.useEffect(()=>{n||!r||(e?(!window.matchMedia("(display-mode: standalone)").matches&&l(),t||window.setTimeout(()=>{d()},500)):d())},[e,r,a,t,n,l,d]),{restorePositionSetting:d}}function jp({open:e,onOpenChange:t,children:n,onDrag:r,onRelease:o,snapPoints:s,shouldScaleBackground:a=!1,setBackgroundColorOnScale:i=!0,closeThreshold:c=Np,scrollLockTimeout:l=Ip,dismissible:d=!0,handleOnly:f=!1,fadeFromIndex:p=s&&s.length-1,activeSnapPoint:g,setActiveSnapPoint:h,fixed:m,modal:v=!0,onClose:y,nested:S,noBodyStyles:R=!1,direction:b="bottom",defaultOpen:O=!1,disablePreventScroll:D=!0,snapToSequentialPoint:w=!1,preventScrollRestoration:E=!1,repositionInputs:I=!0,onAnimationEnd:z,container:Y,autoFocus:Z=!1}){var _,te;const[F=!1,ee]=ai({defaultProp:O,prop:e,onChange:G=>{t?.(G),!G&&!S&&Ot(),setTimeout(()=>{z?.(G)},pe.DURATION*1e3),G&&!v&&typeof window<"u"&&window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"}),G||(document.body.style.pointerEvents="auto")}}),[re,N]=k.useState(!1),[ue,xe]=k.useState(!1),[C,V]=k.useState(!1),L=k.useRef(null),q=k.useRef(null),ge=k.useRef(null),Re=k.useRef(null),B=k.useRef(null),W=k.useRef(!1),de=k.useRef(null),be=k.useRef(0),T=k.useRef(!1),K=k.useRef(!O),U=k.useRef(0),$=k.useRef(null),Q=k.useRef(((_=$.current)==null?void 0:_.getBoundingClientRect().height)||0),j=k.useRef(((te=$.current)==null?void 0:te.getBoundingClientRect().width)||0),H=k.useRef(0),fe=k.useCallback(G=>{s&&G===Ce.length-1&&(q.current=new Date)},[]),{activeSnapPoint:ae,activeSnapPointIndex:oe,setActiveSnapPoint:M,onRelease:J,snapPointsOffset:Ce,onDrag:Te,shouldFade:Be,getPercentageDragged:pt}=Ap({snapPoints:s,activeSnapPointProp:g,setActiveSnapPointProp:h,drawerRef:$,fadeFromIndex:p,overlayRef:L,onSnapPointChange:fe,direction:b,container:Y,snapToSequentialPoint:w});xp({isDisabled:!F||ue||!v||C||!re||!I||!D});const{restorePositionSetting:Ot}=Lp({isOpen:F,modal:v,nested:S??!1,hasBeenOpened:re,preventScrollRestoration:E,noBodyStyles:R});function Se(){return(window.innerWidth-Sr)/window.innerWidth}function tt(G){var ie,ce;!d&&!s||$.current&&!$.current.contains(G.target)||(Q.current=((ie=$.current)==null?void 0:ie.getBoundingClientRect().height)||0,j.current=((ce=$.current)==null?void 0:ce.getBoundingClientRect().width)||0,xe(!0),ge.current=new Date,Qa()&&window.addEventListener("touchend",()=>W.current=!1,{once:!0}),G.target.setPointerCapture(G.pointerId),be.current=ve(b)?G.pageY:G.pageX)}function nt(G,ie){var ce;let ne=G;const me=(ce=window.getSelection())==null?void 0:ce.toString(),De=$.current?pn($.current,b):null,Oe=new Date;if(ne.tagName==="SELECT"||ne.hasAttribute("data-vaul-no-drag")||ne.closest("[data-vaul-no-drag]"))return!1;if(b==="right"||b==="left")return!0;if(q.current&&Oe.getTime()-q.current.getTime()<500)return!1;if(De!==null&&(b==="bottom"?De>0:De<0))return!0;if(me&&me.length>0)return!1;if(B.current&&Oe.getTime()-B.current.getTime()<l&&De===0||ie)return B.current=Oe,!1;for(;ne;){if(ne.scrollHeight>ne.clientHeight){if(ne.scrollTop!==0)return B.current=new Date,!1;if(ne.getAttribute("role")==="dialog")return!0}ne=ne.parentNode}return!0}function ci(G){if($.current&&ue){const ie=b==="bottom"||b==="right"?1:-1,ce=(be.current-(ve(b)?G.pageY:G.pageX))*ie,ne=ce>0,me=s&&!d&&!ne;if(me&&oe===0)return;const De=Math.abs(ce),Oe=document.querySelector("[data-vaul-drawer-wrapper]"),He=b==="bottom"||b==="top"?Q.current:j.current;let Ae=De/He;const rt=pt(De,ne);if(rt!==null&&(Ae=rt),me&&Ae>=1||!W.current&&!nt(G.target,ne))return;if($.current.classList.add(lr),W.current=!0,we($.current,{transition:"none"}),we(L.current,{transition:"none"}),s&&Te({draggedDistance:ce}),ne&&!s){const je=kp(ce),qt=Math.min(je*-1,0)*ie;we($.current,{transform:ve(b)?`translate3d(0, ${qt}px, 0)`:`translate3d(${qt}px, 0, 0)`});return}const Ge=1-Ae;if((Be||p&&oe===p-1)&&(r?.(G,Ae),we(L.current,{opacity:`${Ge}`,transition:"none"},!0)),Oe&&L.current&&a){const je=Math.min(Se()+Ae*(1-Se()),1),qt=8-Ae*8,Wr=Math.max(0,14-Ae*14);we(Oe,{borderRadius:`${qt}px`,transform:ve(b)?`scale(${je}) translate3d(0, ${Wr}px, 0)`:`scale(${je}) translate3d(${Wr}px, 0, 0)`,transition:"none"},!0)}if(!s){const je=De*ie;we($.current,{transform:ve(b)?`translate3d(0, ${je}px, 0)`:`translate3d(${je}px, 0, 0)`})}}}k.useEffect(()=>{window.requestAnimationFrame(()=>{K.current=!0})},[]),k.useEffect(()=>{var G;function ie(){if(!$.current||!I)return;const ce=document.activeElement;if(xr(ce)||T.current){var ne;const me=((ne=window.visualViewport)==null?void 0:ne.height)||0,De=window.innerHeight;let Oe=De-me;const He=$.current.getBoundingClientRect().height||0,Ae=He>De*.8;H.current||(H.current=He);const rt=$.current.getBoundingClientRect().top;if(Math.abs(U.current-Oe)>60&&(T.current=!T.current),s&&s.length>0&&Ce&&oe){const Ge=Ce[oe]||0;Oe+=Ge}if(U.current=Oe,He>me||T.current){const Ge=$.current.getBoundingClientRect().height;let je=Ge;Ge>me&&(je=me-(Ae?rt:Sr)),m?$.current.style.height=`${Ge-Math.max(Oe,0)}px`:$.current.style.height=`${Math.max(je,me-rt)}px`}else gp()||($.current.style.height=`${H.current}px`);s&&s.length>0&&!T.current?$.current.style.bottom="0px":$.current.style.bottom=`${Math.max(Oe,0)}px`}}return(G=window.visualViewport)==null||G.addEventListener("resize",ie),()=>{var ce;return(ce=window.visualViewport)==null?void 0:ce.removeEventListener("resize",ie)}},[oe,s,Ce]);function kt(G){ui(),y?.(),G||ee(!1),setTimeout(()=>{s&&M(s[0])},pe.DURATION*1e3)}function Br(){if(!$.current)return;const G=document.querySelector("[data-vaul-drawer-wrapper]"),ie=pn($.current,b);we($.current,{transform:"translate3d(0, 0, 0)",transition:`transform ${pe.DURATION}s cubic-bezier(${pe.EASE.join(",")})`}),we(L.current,{transition:`opacity ${pe.DURATION}s cubic-bezier(${pe.EASE.join(",")})`,opacity:"1"}),a&&ie&&ie>0&&F&&we(G,{borderRadius:`${oi}px`,overflow:"hidden",...ve(b)?{transform:`scale(${Se()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`,transformOrigin:"top"}:{transform:`scale(${Se()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`,transformOrigin:"left"},transitionProperty:"transform, border-radius",transitionDuration:`${pe.DURATION}s`,transitionTimingFunction:`cubic-bezier(${pe.EASE.join(",")})`},!0)}function ui(){!ue||!$.current||($.current.classList.remove(lr),W.current=!1,xe(!1),Re.current=new Date)}function di(G){if(!ue||!$.current)return;$.current.classList.remove(lr),W.current=!1,xe(!1),Re.current=new Date;const ie=pn($.current,b);if(!G||!nt(G.target,!1)||!ie||Number.isNaN(ie)||ge.current===null)return;const ce=Re.current.getTime()-ge.current.getTime(),ne=be.current-(ve(b)?G.pageY:G.pageX),me=Math.abs(ne)/ce;if(me>.05&&(V(!0),setTimeout(()=>{V(!1)},200)),s){J({draggedDistance:ne*(b==="bottom"||b==="right"?1:-1),closeDrawer:kt,velocity:me,dismissible:d}),o?.(G,!0);return}if(b==="bottom"||b==="right"?ne>0:ne<0){Br(),o?.(G,!0);return}if(me>ri){kt(),o?.(G,!1);return}var De;const Oe=Math.min((De=$.current.getBoundingClientRect().height)!=null?De:0,window.innerHeight);var He;const Ae=Math.min((He=$.current.getBoundingClientRect().width)!=null?He:0,window.innerWidth),rt=b==="left"||b==="right";if(Math.abs(ie)>=(rt?Ae:Oe)*c){kt(),o?.(G,!1);return}o?.(G,!0),Br()}k.useEffect(()=>(F&&(we(document.documentElement,{scrollBehavior:"auto"}),q.current=new Date),()=>{Op(document.documentElement,"scrollBehavior")}),[F]);function fi(G){const ie=G?(window.innerWidth-st)/window.innerWidth:1,ce=G?-st:0;de.current&&window.clearTimeout(de.current),we($.current,{transition:`transform ${pe.DURATION}s cubic-bezier(${pe.EASE.join(",")})`,transform:ve(b)?`scale(${ie}) translate3d(0, ${ce}px, 0)`:`scale(${ie}) translate3d(${ce}px, 0, 0)`}),!G&&$.current&&(de.current=setTimeout(()=>{const ne=pn($.current,b);we($.current,{transition:"none",transform:ve(b)?`translate3d(0, ${ne}px, 0)`:`translate3d(${ne}px, 0, 0)`})},500))}function pi(G,ie){if(ie<0)return;const ce=(window.innerWidth-st)/window.innerWidth,ne=ce+ie*(1-ce),me=-st+ie*st;we($.current,{transform:ve(b)?`scale(${ne}) translate3d(0, ${me}px, 0)`:`scale(${ne}) translate3d(${me}px, 0, 0)`,transition:"none"})}function mi(G,ie){const ce=ve(b)?window.innerHeight:window.innerWidth,ne=ie?(ce-st)/ce:1,me=ie?-st:0;ie&&we($.current,{transition:`transform ${pe.DURATION}s cubic-bezier(${pe.EASE.join(",")})`,transform:ve(b)?`scale(${ne}) translate3d(0, ${me}px, 0)`:`scale(${ne}) translate3d(${me}px, 0, 0)`})}return k.useEffect(()=>{v||window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"})},[v]),k.createElement(ap,{defaultOpen:O,onOpenChange:G=>{!d&&!G||(G?N(!0):kt(!0),ee(G))},open:F},k.createElement(Ja.Provider,{value:{activeSnapPoint:ae,snapPoints:s,setActiveSnapPoint:M,drawerRef:$,overlayRef:L,onOpenChange:t,onPress:tt,onRelease:di,onDrag:ci,dismissible:d,shouldAnimate:K,handleOnly:f,isOpen:F,isDragging:ue,shouldFade:Be,closeDrawer:kt,onNestedDrag:pi,onNestedOpenChange:fi,onNestedRelease:mi,keyboardIsOpen:T,modal:v,snapPointsOffset:Ce,activeSnapPointIndex:oe,direction:b,shouldScaleBackground:a,setBackgroundColorOnScale:i,noBodyStyles:R,container:Y,autoFocus:Z}},n))}const ii=k.forwardRef(function({...e},t){const{overlayRef:n,snapPoints:r,onRelease:o,shouldFade:s,isOpen:a,modal:i,shouldAnimate:c}=Yt(),l=ti(t,n),d=r&&r.length>0;if(!i)return null;const f=k.useCallback(p=>o(p),[o]);return k.createElement(cp,{onMouseUp:f,ref:l,"data-vaul-overlay":"","data-vaul-snap-points":a&&d?"true":"false","data-vaul-snap-points-overlay":a&&s?"true":"false","data-vaul-animate":c?.current?"true":"false",...e})});ii.displayName="Drawer.Overlay";const li=k.forwardRef(function({onPointerDownOutside:e,style:t,onOpenAutoFocus:n,...r},o){const{drawerRef:s,onPress:a,onRelease:i,onDrag:c,keyboardIsOpen:l,snapPointsOffset:d,activeSnapPointIndex:f,modal:p,isOpen:g,direction:h,snapPoints:m,container:v,handleOnly:y,shouldAnimate:S,autoFocus:R}=Yt(),[b,O]=k.useState(!1),D=ti(o,s),w=k.useRef(null),E=k.useRef(null),I=k.useRef(!1),z=m&&m.length>0;Mp();const Y=(_,te,F=0)=>{if(I.current)return!0;const ee=Math.abs(_.y),re=Math.abs(_.x),N=re>ee,ue=["bottom","right"].includes(te)?1:-1;if(te==="left"||te==="right"){if(!(_.x*ue<0)&&re>=0&&re<=F)return N}else if(!(_.y*ue<0)&&ee>=0&&ee<=F)return!N;return I.current=!0,!0};k.useEffect(()=>{z&&window.requestAnimationFrame(()=>{O(!0)})},[]);function Z(_){w.current=null,I.current=!1,i(_)}return k.createElement(up,{"data-vaul-drawer-direction":h,"data-vaul-drawer":"","data-vaul-delayed-snap-points":b?"true":"false","data-vaul-snap-points":g&&z?"true":"false","data-vaul-custom-container":v?"true":"false","data-vaul-animate":S?.current?"true":"false",...r,ref:D,style:d&&d.length>0?{"--snap-point-height":`${d[f??0]}px`,...t}:t,onPointerDown:_=>{y||(r.onPointerDown==null||r.onPointerDown.call(r,_),w.current={x:_.pageX,y:_.pageY},a(_))},onOpenAutoFocus:_=>{n?.(_),R||_.preventDefault()},onPointerDownOutside:_=>{if(e?.(_),!p||_.defaultPrevented){_.preventDefault();return}l.current&&(l.current=!1)},onFocusOutside:_=>{if(!p){_.preventDefault();return}},onPointerMove:_=>{if(E.current=_,y||(r.onPointerMove==null||r.onPointerMove.call(r,_),!w.current))return;const te=_.pageY-w.current.y,F=_.pageX-w.current.x,ee=_.pointerType==="touch"?10:2;Y({x:F,y:te},h,ee)?c(_):(Math.abs(F)>ee||Math.abs(te)>ee)&&(w.current=null)},onPointerUp:_=>{r.onPointerUp==null||r.onPointerUp.call(r,_),w.current=null,I.current=!1,i(_)},onPointerOut:_=>{r.onPointerOut==null||r.onPointerOut.call(r,_),Z(E.current)},onContextMenu:_=>{r.onContextMenu==null||r.onContextMenu.call(r,_),E.current&&Z(E.current)}})});li.displayName="Drawer.Content";const Fp=250,$p=120,Vp=k.forwardRef(function({preventCycle:e=!1,children:t,...n},r){const{closeDrawer:o,isDragging:s,snapPoints:a,activeSnapPoint:i,setActiveSnapPoint:c,dismissible:l,handleOnly:d,isOpen:f,onPress:p,onDrag:g}=Yt(),h=k.useRef(null),m=k.useRef(!1);function v(){if(m.current){R();return}window.setTimeout(()=>{y()},$p)}function y(){if(s||e||m.current){R();return}if(R(),!a||a.length===0){l||o();return}if(i===a[a.length-1]&&l){o();return}const O=a.findIndex(w=>w===i);if(O===-1)return;const D=a[O+1];c(D)}function S(){h.current=window.setTimeout(()=>{m.current=!0},Fp)}function R(){h.current&&window.clearTimeout(h.current),m.current=!1}return k.createElement("div",{onClick:v,onPointerCancel:R,onPointerDown:b=>{d&&p(b),S()},onPointerMove:b=>{d&&g(b)},ref:r,"data-vaul-drawer-visible":f?"true":"false","data-vaul-handle":"","aria-hidden":"true",...n},k.createElement("span",{"data-vaul-handle-hitarea":"","aria-hidden":"true"},t))});Vp.displayName="Drawer.Handle";function Bp(e){const t=Yt(),{container:n=t.container,...r}=e;return k.createElement(lp,{container:n,...r})}const et={Root:jp,Content:li,Overlay:ii,Trigger:ip,Portal:Bp,Close:pp,Title:dp,Description:fp};function Wp({...e}){return x.jsx(et.Root,{"data-slot":"drawer",...e})}function zp({...e}){return x.jsx(et.Trigger,{"data-slot":"drawer-trigger",...e})}function Up({...e}){return x.jsx(et.Portal,{"data-slot":"drawer-portal",...e})}function Hp({...e}){return x.jsx(et.Close,{"data-slot":"drawer-close",...e})}function Gp({className:e,...t}){return x.jsx(et.Overlay,{"data-slot":"drawer-overlay",className:ke("data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 bg-black/10 supports-backdrop-filter:backdrop-blur-xs fixed inset-0 z-50",e),...t})}function Yp({className:e,children:t,...n}){return x.jsxs(Up,{"data-slot":"drawer-portal",children:[x.jsx(Gp,{}),x.jsxs(et.Content,{"data-slot":"drawer-content",className:ke("bg-background flex h-auto flex-col text-sm data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-xl data-[vaul-drawer-direction=bottom]:border-t data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:rounded-r-xl data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:rounded-l-xl data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-xl data-[vaul-drawer-direction=top]:border-b data-[vaul-drawer-direction=left]:sm:max-w-sm data-[vaul-drawer-direction=right]:sm:max-w-sm group/drawer-content fixed z-50",e),...n,children:[x.jsx("div",{className:"bg-muted mx-auto mt-4 hidden h-1 w-25 shrink-0 rounded-full group-data-[vaul-drawer-direction=bottom]/drawer-content:block"}),t]})]})}function qp({className:e,...t}){return x.jsx("div",{"data-slot":"drawer-header",className:ke("gap-0.5 p-4 group-data-[vaul-drawer-direction=bottom]/drawer-content:text-center group-data-[vaul-drawer-direction=top]/drawer-content:text-center md:gap-0.5 md:text-left flex flex-col",e),...t})}function Kp({className:e,...t}){return x.jsx("div",{"data-slot":"drawer-footer",className:ke("gap-2 p-4 mt-auto flex flex-col",e),...t})}function Xp({className:e,...t}){return x.jsx(et.Title,{"data-slot":"drawer-title",className:ke("text-foreground text-base font-medium",e),...t})}function Zp({className:e,...t}){return x.jsx(et.Description,{"data-slot":"drawer-description",className:ke("text-muted-foreground text-sm",e),...t})}function Jp({open:e,setOpen:t,loading:n,setLoading:r,isFullScreen:o,setIsFullScreen:s,triggerProperties:{label:a,component:i=void 0},title:c}){return k.useEffect(()=>{setTimeout(()=>{r(!1)},5e3)},[r]),x.jsxs(Wp,{open:e,onOpenChange:t,modal:!0,direction:"bottom",handleOnly:!0,children:[x.jsx(zp,{asChild:!0,children:i||x.jsx(ct,{variant:"default",children:a})}),x.jsxs(Yp,{className:`shadow-2xl shadow-foreground ${o?On.styles.drawer.expanded:On.styles.drawer.compacted}`,children:[x.jsxs(qp,{className:"text-left",children:[x.jsx(Xp,{children:c}),x.jsx(Zp,{children:x.jsx(ct,{variant:"outline",size:"icon-sm",className:"rounded-lg",onClick:()=>s(l=>!l),children:o?x.jsx(ha,{}):x.jsx(ga,{})})})]}),n?x.jsx("div",{className:"w-full h-full flex flex-col items-center justify-center",children:x.jsx(va,{})}):x.jsx(ba,{}),x.jsx(Kp,{className:"pt-2",children:x.jsx(Hp,{asChild:!0,children:x.jsx(ct,{variant:"default",children:"Cancel"})})})]})]})}function Qp({triggerProperties:e,title:t,fullscreen:n="none"}){const[r,o]=u.useState(!1),s=bi(),[a,i]=u.useState(!0),[c,l]=u.useState(n==="all"||n==="mobile-only"&&s||n==="desktop-only"&&!s);return s?x.jsx(Jp,{open:r,setOpen:o,loading:a,setLoading:i,isFullScreen:c,setIsFullScreen:l,title:t,triggerProperties:e},"with-drawer"):x.jsx(Od,{open:r,setOpen:o,loading:a,setLoading:i,isFullScreen:c,setIsFullScreen:l,title:t,triggerProperties:e},"with-dialog")}exports.AarthikShell=Qp;
|
|
69
|
+
){opacity:0}[data-vaul-overlay][data-vaul-snap-points-overlay=true]{opacity:1}[data-vaul-handle]{display:block;position:relative;opacity:.7;background:#e2e2e4;margin-left:auto;margin-right:auto;height:5px;width:32px;border-radius:1rem;touch-action:pan-y}[data-vaul-handle]:active,[data-vaul-handle]:hover{opacity:1}[data-vaul-handle-hitarea]{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:max(100%,2.75rem);height:max(100%,2.75rem);touch-action:inherit}@media (hover:hover) and (pointer:fine){[data-vaul-drawer]{user-select:none}}@media (pointer:fine){[data-vaul-handle-hitarea]:{width:100%;height:100%}}@keyframes fadeIn{from{opacity:0}to{opacity:1}}@keyframes fadeOut{to{opacity:0}}@keyframes slideFromBottom{from{transform:translate3d(0,var(--initial-transform,100%),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToBottom{to{transform:translate3d(0,var(--initial-transform,100%),0)}}@keyframes slideFromTop{from{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToTop{to{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}}@keyframes slideFromLeft{from{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToLeft{to{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}}@keyframes slideFromRight{from{transform:translate3d(var(--initial-transform,100%),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToRight{to{transform:translate3d(var(--initial-transform,100%),0,0)}}`);function Up(){const e=navigator.userAgent;return typeof window<"u"&&(/Firefox/.test(e)&&/Mobile/.test(e)||/FxiOS/.test(e))}function Vp(){return oo(/^Mac/)}function Wp(){return oo(/^iPhone/)}function is(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function zp(){return oo(/^iPad/)||Vp()&&navigator.maxTouchPoints>1}function Ri(){return Wp()||zp()}function oo(e){return typeof window<"u"&&window.navigator!=null?e.test(window.navigator.platform):void 0}const Hp=24,qp=typeof window<"u"?D.useLayoutEffect:D.useEffect;function cs(...e){return(...t)=>{for(let n of e)typeof n=="function"&&n(...t)}}const Er=typeof document<"u"&&window.visualViewport;function ls(e){let t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function ki(e){for(ls(e)&&(e=e.parentElement);e&&!ls(e);)e=e.parentElement;return e||document.scrollingElement||document.documentElement}const Kp=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);let Rn=0,xr;function Gp(e={}){let{isDisabled:t}=e;qp(()=>{if(!t)return Rn++,Rn===1&&Ri()&&(xr=Yp()),()=>{Rn--,Rn===0&&xr?.()}},[t])}function Yp(){let e,t=0,n=f=>{e=ki(f.target),!(e===document.documentElement&&e===document.body)&&(t=f.changedTouches[0].pageY)},r=f=>{if(!e||e===document.documentElement||e===document.body){f.preventDefault();return}let p=f.changedTouches[0].pageY,h=e.scrollTop,g=e.scrollHeight-e.clientHeight;g!==0&&((h<=0&&p>t||h>=g&&p<t)&&f.preventDefault(),t=p)},o=f=>{let p=f.target;$r(p)&&p!==document.activeElement&&(f.preventDefault(),p.style.transform="translateY(-2000px)",p.focus(),requestAnimationFrame(()=>{p.style.transform=""}))},s=f=>{let p=f.target;$r(p)&&(p.style.transform="translateY(-2000px)",requestAnimationFrame(()=>{p.style.transform="",Er&&(Er.height<window.innerHeight?requestAnimationFrame(()=>{us(p)}):Er.addEventListener("resize",()=>us(p),{once:!0}))}))},a=()=>{window.scrollTo(0,0)},i=window.pageXOffset,u=window.pageYOffset,c=cs(Xp(document.documentElement,"paddingRight",`${window.innerWidth-document.documentElement.clientWidth}px`));window.scrollTo(0,0);let d=cs(Wt(document,"touchstart",n,{passive:!1,capture:!0}),Wt(document,"touchmove",r,{passive:!1,capture:!0}),Wt(document,"touchend",o,{passive:!1,capture:!0}),Wt(document,"focus",s,!0),Wt(window,"scroll",a));return()=>{c(),d(),window.scrollTo(i,u)}}function Xp(e,t,n){let r=e.style[t];return e.style[t]=n,()=>{e.style[t]=r}}function Wt(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function us(e){let t=document.scrollingElement||document.documentElement;for(;e&&e!==t;){let n=ki(e);if(n!==document.documentElement&&n!==document.body&&n!==e){let r=n.getBoundingClientRect().top,o=e.getBoundingClientRect().top,s=e.getBoundingClientRect().bottom;const a=n.getBoundingClientRect().bottom+Hp;s>a&&(n.scrollTop+=o-r)}e=n.parentElement}}function $r(e){return e instanceof HTMLInputElement&&!Kp.has(e.type)||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable}function Jp(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function Zp(...e){return t=>e.forEach(n=>Jp(n,t))}function Ci(...e){return l.useCallback(Zp(...e),e)}const Oi=new WeakMap;function Ae(e,t,n=!1){if(!e||!(e instanceof HTMLElement))return;let r={};Object.entries(t).forEach(([o,s])=>{if(o.startsWith("--")){e.style.setProperty(o,s);return}r[o]=e.style[o],e.style[o]=s}),!n&&Oi.set(e,r)}function Qp(e,t){if(!e||!(e instanceof HTMLElement))return;let n=Oi.get(e);n&&(e.style[t]=n[t])}const ke=e=>{switch(e){case"top":case"bottom":return!0;case"left":case"right":return!1;default:return e}};function kn(e,t){if(!e)return null;const n=window.getComputedStyle(e),r=n.transform||n.webkitTransform||n.mozTransform;let o=r.match(/^matrix3d\((.+)\)$/);return o?parseFloat(o[1].split(", ")[ke(t)?13:12]):(o=r.match(/^matrix\((.+)\)$/),o?parseFloat(o[1].split(", ")[ke(t)?5:4]):null)}function em(e){return 8*(Math.log(e+1)-2)}function Sr(e,t){if(!e)return()=>{};const n=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=n}}function tm(...e){return(...t)=>{for(const n of e)typeof n=="function"&&n(...t)}}const Se={DURATION:.5,EASE:[.32,.72,0,1]},Ai=.4,nm=.25,rm=100,Di=8,vt=16,Br=26,Tr="vaul-dragging";function Ii(e){const t=D.useRef(e);return D.useEffect(()=>{t.current=e}),D.useMemo(()=>(...n)=>t.current==null?void 0:t.current.call(t,...n),[])}function om({defaultProp:e,onChange:t}){const n=D.useState(e),[r]=n,o=D.useRef(r),s=Ii(t);return D.useEffect(()=>{o.current!==r&&(s(r),o.current=r)},[r,o,s]),n}function Pi({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=om({defaultProp:t,onChange:n}),s=e!==void 0,a=s?e:r,i=Ii(n),u=D.useCallback(c=>{if(s){const f=typeof c=="function"?c(e):c;f!==e&&i(f)}else o(c)},[s,e,o,i]);return[a,u]}function sm({activeSnapPointProp:e,setActiveSnapPointProp:t,snapPoints:n,drawerRef:r,overlayRef:o,fadeFromIndex:s,onSnapPointChange:a,direction:i="bottom",container:u,snapToSequentialPoint:c}){const[d,f]=Pi({prop:e,defaultProp:n?.[0],onChange:t}),[p,h]=D.useState(typeof window<"u"?{innerWidth:window.innerWidth,innerHeight:window.innerHeight}:void 0);D.useEffect(()=>{function T(){h({innerWidth:window.innerWidth,innerHeight:window.innerHeight})}return window.addEventListener("resize",T),()=>window.removeEventListener("resize",T)},[]);const g=D.useMemo(()=>d===n?.[n.length-1]||null,[n,d]),m=D.useMemo(()=>{var T;return(T=n?.findIndex(x=>x===d))!=null?T:null},[n,d]),v=n&&n.length>0&&(s||s===0)&&!Number.isNaN(s)&&n[s]===d||!n,y=D.useMemo(()=>{const T=u?{width:u.getBoundingClientRect().width,height:u.getBoundingClientRect().height}:typeof window<"u"?{width:window.innerWidth,height:window.innerHeight}:{width:0,height:0};var x;return(x=n?.map(I=>{const H=typeof I=="string";let q=0;if(H&&(q=parseInt(I,10)),ke(i)){const L=H?q:p?I*T.height:0;return p?i==="bottom"?T.height-L:-T.height+L:L}const Q=H?q:p?I*T.width:0;return p?i==="right"?T.width-Q:-T.width+Q:Q}))!=null?x:[]},[n,p,u]),E=D.useMemo(()=>m!==null?y?.[m]:null,[y,m]),R=D.useCallback(T=>{var x;const I=(x=y?.findIndex(H=>H===T))!=null?x:null;a(I),Ae(r.current,{transition:`transform ${Se.DURATION}s cubic-bezier(${Se.EASE.join(",")})`,transform:ke(i)?`translate3d(0, ${T}px, 0)`:`translate3d(${T}px, 0, 0)`}),y&&I!==y.length-1&&s!==void 0&&I!==s&&I<s?Ae(o.current,{transition:`opacity ${Se.DURATION}s cubic-bezier(${Se.EASE.join(",")})`,opacity:"0"}):Ae(o.current,{transition:`opacity ${Se.DURATION}s cubic-bezier(${Se.EASE.join(",")})`,opacity:"1"}),f(n?.[Math.max(I,0)])},[r.current,n,y,s,o,f]);D.useEffect(()=>{if(d||e){var T;const x=(T=n?.findIndex(I=>I===e||I===d))!=null?T:-1;y&&x!==-1&&typeof y[x]=="number"&&R(y[x])}},[d,e,n,y,R]);function b({draggedDistance:T,closeDrawer:x,velocity:I,dismissible:H}){if(s===void 0)return;const q=i==="bottom"||i==="right"?(E??0)-T:(E??0)+T,Q=m===s-1,L=m===0,ee=T>0;if(Q&&Ae(o.current,{transition:`opacity ${Se.DURATION}s cubic-bezier(${Se.EASE.join(",")})`}),!c&&I>2&&!ee){H?x():R(y[0]);return}if(!c&&I>2&&ee&&y&&n){R(y[n.length-1]);return}const N=y?.reduce((te,A)=>typeof te!="number"||typeof A!="number"?te:Math.abs(A-q)<Math.abs(te-q)?A:te),J=ke(i)?window.innerHeight:window.innerWidth;if(I>Ai&&Math.abs(T)<J*.4){const te=ee?1:-1;if(te>0&&g&&n){R(y[n.length-1]);return}if(L&&te<0&&H&&x(),m===null)return;R(y[m+te]);return}R(N)}function C({draggedDistance:T}){if(E===null)return;const x=i==="bottom"||i==="right"?E-T:E+T;(i==="bottom"||i==="right")&&x<y[y.length-1]||(i==="top"||i==="left")&&x>y[y.length-1]||Ae(r.current,{transform:ke(i)?`translate3d(0, ${x}px, 0)`:`translate3d(${x}px, 0, 0)`})}function O(T,x){if(!n||typeof m!="number"||!y||s===void 0)return null;const I=m===s-1;if(m>=s&&x)return 0;if(I&&!x)return 1;if(!v&&!I)return null;const q=I?m+1:m-1,Q=I?y[q]-y[q-1]:y[q+1]-y[q],L=T/Math.abs(Q);return I?1-L:L}return{isLastSnapPoint:g,activeSnapPoint:d,shouldFade:v,getPercentageDragged:O,setActiveSnapPoint:f,activeSnapPointIndex:m,onRelease:b,onDrag:C,snapPointsOffset:y}}const am=()=>()=>{};function im(){const{direction:e,isOpen:t,shouldScaleBackground:n,setBackgroundColorOnScale:r,noBodyStyles:o}=rn(),s=D.useRef(null),a=D.useMemo(()=>document.body.style.backgroundColor,[]);function i(){return(window.innerWidth-Br)/window.innerWidth}D.useEffect(()=>{if(t&&n){s.current&&clearTimeout(s.current);const u=document.querySelector("[data-vaul-drawer-wrapper]")||document.querySelector("[vaul-drawer-wrapper]");if(!u)return;tm(r&&!o?Sr(document.body,{background:"black"}):am,Sr(u,{transformOrigin:ke(e)?"top":"left",transitionProperty:"transform, border-radius",transitionDuration:`${Se.DURATION}s`,transitionTimingFunction:`cubic-bezier(${Se.EASE.join(",")})`}));const c=Sr(u,{borderRadius:`${Di}px`,overflow:"hidden",...ke(e)?{transform:`scale(${i()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`}:{transform:`scale(${i()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`}});return()=>{c(),s.current=window.setTimeout(()=>{a?document.body.style.background=a:document.body.style.removeProperty("background")},Se.DURATION*1e3)}}},[t,n,a])}let zt=null;function cm({isOpen:e,modal:t,nested:n,hasBeenOpened:r,preventScrollRestoration:o,noBodyStyles:s}){const[a,i]=D.useState(()=>typeof window<"u"?window.location.href:""),u=D.useRef(0),c=D.useCallback(()=>{if(is()&&zt===null&&e&&!s){zt={position:document.body.style.position,top:document.body.style.top,left:document.body.style.left,height:document.body.style.height,right:"unset"};const{scrollX:f,innerHeight:p}=window;document.body.style.setProperty("position","fixed","important"),Object.assign(document.body.style,{top:`${-u.current}px`,left:`${-f}px`,right:"0px",height:"auto"}),window.setTimeout(()=>window.requestAnimationFrame(()=>{const h=p-window.innerHeight;h&&u.current>=p&&(document.body.style.top=`${-(u.current+h)}px`)}),300)}},[e]),d=D.useCallback(()=>{if(is()&&zt!==null&&!s){const f=-parseInt(document.body.style.top,10),p=-parseInt(document.body.style.left,10);Object.assign(document.body.style,zt),window.requestAnimationFrame(()=>{if(o&&a!==window.location.href){i(window.location.href);return}window.scrollTo(p,f)}),zt=null}},[a]);return D.useEffect(()=>{function f(){u.current=window.scrollY}return f(),window.addEventListener("scroll",f),()=>{window.removeEventListener("scroll",f)}},[]),D.useEffect(()=>{if(t)return()=>{typeof document>"u"||document.querySelector("[data-vaul-drawer]")||d()}},[t,d]),D.useEffect(()=>{n||!r||(e?(!window.matchMedia("(display-mode: standalone)").matches&&c(),t||window.setTimeout(()=>{d()},500)):d())},[e,r,a,t,n,c,d]),{restorePositionSetting:d}}function lm({open:e,onOpenChange:t,children:n,onDrag:r,onRelease:o,snapPoints:s,shouldScaleBackground:a=!1,setBackgroundColorOnScale:i=!0,closeThreshold:u=nm,scrollLockTimeout:c=rm,dismissible:d=!0,handleOnly:f=!1,fadeFromIndex:p=s&&s.length-1,activeSnapPoint:h,setActiveSnapPoint:g,fixed:m,modal:v=!0,onClose:y,nested:E,noBodyStyles:R=!1,direction:b="bottom",defaultOpen:C=!1,disablePreventScroll:O=!0,snapToSequentialPoint:T=!1,preventScrollRestoration:x=!1,repositionInputs:I=!0,onAnimationEnd:H,container:q,autoFocus:Q=!1}){var L,ee;const[N=!1,J]=Pi({defaultProp:C,prop:e,onChange:X=>{t?.(X),!X&&!E&&G(),setTimeout(()=>{H?.(X)},Se.DURATION*1e3),X&&!v&&typeof window<"u"&&window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"}),X||(document.body.style.pointerEvents="auto")}}),[te,A]=D.useState(!1),[ce,re]=D.useState(!1),[w,U]=D.useState(!1),M=D.useRef(null),K=D.useRef(null),Ee=D.useRef(null),he=D.useRef(null),P=D.useRef(null),j=D.useRef(!1),pe=D.useRef(null),ye=D.useRef(0),k=D.useRef(!1),Y=D.useRef(!C),z=D.useRef(0),W=D.useRef(null),oe=D.useRef(((L=W.current)==null?void 0:L.getBoundingClientRect().height)||0),V=D.useRef(((ee=W.current)==null?void 0:ee.getBoundingClientRect().width)||0),B=D.useRef(0),ve=D.useCallback(X=>{s&&X===Ce.length-1&&(K.current=new Date)},[]),{activeSnapPoint:le,activeSnapPointIndex:ue,setActiveSnapPoint:_,onRelease:ne,snapPointsOffset:Ce,onDrag:Ie,shouldFade:Ve,getPercentageDragged:et}=sm({snapPoints:s,activeSnapPointProp:h,setActiveSnapPointProp:g,drawerRef:W,fadeFromIndex:p,overlayRef:M,onSnapPointChange:ve,direction:b,container:q,snapToSequentialPoint:T});Gp({isDisabled:!N||ce||!v||w||!te||!I||!O});const{restorePositionSetting:G}=cm({isOpen:N,modal:v,nested:E??!1,hasBeenOpened:te,preventScrollRestoration:x,noBodyStyles:R});function ae(){return(window.innerWidth-Br)/window.innerWidth}function Z(X){var ie,we;!d&&!s||W.current&&!W.current.contains(X.target)||(oe.current=((ie=W.current)==null?void 0:ie.getBoundingClientRect().height)||0,V.current=((we=W.current)==null?void 0:we.getBoundingClientRect().width)||0,re(!0),Ee.current=new Date,Ri()&&window.addEventListener("touchend",()=>j.current=!1,{once:!0}),X.target.setPointerCapture(X.pointerId),ye.current=ke(b)?X.pageY:X.pageX)}function be(X,ie){var we;let fe=X;const Te=(we=window.getSelection())==null?void 0:we.toString(),je=W.current?kn(W.current,b):null,Me=new Date;if(fe.tagName==="SELECT"||fe.hasAttribute("data-vaul-no-drag")||fe.closest("[data-vaul-no-drag]"))return!1;if(b==="right"||b==="left")return!0;if(K.current&&Me.getTime()-K.current.getTime()<500)return!1;if(je!==null&&(b==="bottom"?je>0:je<0))return!0;if(Te&&Te.length>0)return!1;if(P.current&&Me.getTime()-P.current.getTime()<c&&je===0||ie)return P.current=Me,!1;for(;fe;){if(fe.scrollHeight>fe.clientHeight){if(fe.scrollTop!==0)return P.current=new Date,!1;if(fe.getAttribute("role")==="dialog")return!0}fe=fe.parentNode}return!0}function de(X){if(W.current&&ce){const ie=b==="bottom"||b==="right"?1:-1,we=(ye.current-(ke(b)?X.pageY:X.pageX))*ie,fe=we>0,Te=s&&!d&&!fe;if(Te&&ue===0)return;const je=Math.abs(we),Me=document.querySelector("[data-vaul-drawer-wrapper]"),st=b==="bottom"||b==="top"?oe.current:V.current;let ze=je/st;const ht=et(je,fe);if(ht!==null&&(ze=ht),Te&&ze>=1||!j.current&&!be(X.target,fe))return;if(W.current.classList.add(Tr),j.current=!0,Ae(W.current,{transition:"none"}),Ae(M.current,{transition:"none"}),s&&Ie({draggedDistance:we}),fe&&!s){const Ye=em(we),cn=Math.min(Ye*-1,0)*ie;Ae(W.current,{transform:ke(b)?`translate3d(0, ${cn}px, 0)`:`translate3d(${cn}px, 0, 0)`});return}const at=1-ze;if((Ve||p&&ue===p-1)&&(r?.(X,ze),Ae(M.current,{opacity:`${at}`,transition:"none"},!0)),Me&&M.current&&a){const Ye=Math.min(ae()+ze*(1-ae()),1),cn=8-ze*8,io=Math.max(0,14-ze*14);Ae(Me,{borderRadius:`${cn}px`,transform:ke(b)?`scale(${Ye}) translate3d(0, ${io}px, 0)`:`scale(${Ye}) translate3d(${io}px, 0, 0)`,transition:"none"},!0)}if(!s){const Ye=je*ie;Ae(W.current,{transform:ke(b)?`translate3d(0, ${Ye}px, 0)`:`translate3d(${Ye}px, 0, 0)`})}}}D.useEffect(()=>{window.requestAnimationFrame(()=>{Y.current=!0})},[]),D.useEffect(()=>{var X;function ie(){if(!W.current||!I)return;const we=document.activeElement;if($r(we)||k.current){var fe;const Te=((fe=window.visualViewport)==null?void 0:fe.height)||0,je=window.innerHeight;let Me=je-Te;const st=W.current.getBoundingClientRect().height||0,ze=st>je*.8;B.current||(B.current=st);const ht=W.current.getBoundingClientRect().top;if(Math.abs(z.current-Me)>60&&(k.current=!k.current),s&&s.length>0&&Ce&&ue){const at=Ce[ue]||0;Me+=at}if(z.current=Me,st>Te||k.current){const at=W.current.getBoundingClientRect().height;let Ye=at;at>Te&&(Ye=Te-(ze?ht:Br)),m?W.current.style.height=`${at-Math.max(Me,0)}px`:W.current.style.height=`${Math.max(Ye,Te-ht)}px`}else Up()||(W.current.style.height=`${B.current}px`);s&&s.length>0&&!k.current?W.current.style.bottom="0px":W.current.style.bottom=`${Math.max(Me,0)}px`}}return(X=window.visualViewport)==null||X.addEventListener("resize",ie),()=>{var we;return(we=window.visualViewport)==null?void 0:we.removeEventListener("resize",ie)}},[ue,s,Ce]);function xe(X){Ge(),y?.(),X||J(!1),setTimeout(()=>{s&&_(s[0])},Se.DURATION*1e3)}function Pe(){if(!W.current)return;const X=document.querySelector("[data-vaul-drawer-wrapper]"),ie=kn(W.current,b);Ae(W.current,{transform:"translate3d(0, 0, 0)",transition:`transform ${Se.DURATION}s cubic-bezier(${Se.EASE.join(",")})`}),Ae(M.current,{transition:`opacity ${Se.DURATION}s cubic-bezier(${Se.EASE.join(",")})`,opacity:"1"}),a&&ie&&ie>0&&N&&Ae(X,{borderRadius:`${Di}px`,overflow:"hidden",...ke(b)?{transform:`scale(${ae()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`,transformOrigin:"top"}:{transform:`scale(${ae()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`,transformOrigin:"left"},transitionProperty:"transform, border-radius",transitionDuration:`${Se.DURATION}s`,transitionTimingFunction:`cubic-bezier(${Se.EASE.join(",")})`},!0)}function Ge(){!ce||!W.current||(W.current.classList.remove(Tr),j.current=!1,re(!1),he.current=new Date)}function on(X){if(!ce||!W.current)return;W.current.classList.remove(Tr),j.current=!1,re(!1),he.current=new Date;const ie=kn(W.current,b);if(!X||!be(X.target,!1)||!ie||Number.isNaN(ie)||Ee.current===null)return;const we=he.current.getTime()-Ee.current.getTime(),fe=ye.current-(ke(b)?X.pageY:X.pageX),Te=Math.abs(fe)/we;if(Te>.05&&(U(!0),setTimeout(()=>{U(!1)},200)),s){ne({draggedDistance:fe*(b==="bottom"||b==="right"?1:-1),closeDrawer:xe,velocity:Te,dismissible:d}),o?.(X,!0);return}if(b==="bottom"||b==="right"?fe>0:fe<0){Pe(),o?.(X,!0);return}if(Te>Ai){xe(),o?.(X,!1);return}var je;const Me=Math.min((je=W.current.getBoundingClientRect().height)!=null?je:0,window.innerHeight);var st;const ze=Math.min((st=W.current.getBoundingClientRect().width)!=null?st:0,window.innerWidth),ht=b==="left"||b==="right";if(Math.abs(ie)>=(ht?ze:Me)*u){xe(),o?.(X,!1);return}o?.(X,!0),Pe()}D.useEffect(()=>(N&&(Ae(document.documentElement,{scrollBehavior:"auto"}),K.current=new Date),()=>{Qp(document.documentElement,"scrollBehavior")}),[N]);function Ft(X){const ie=X?(window.innerWidth-vt)/window.innerWidth:1,we=X?-vt:0;pe.current&&window.clearTimeout(pe.current),Ae(W.current,{transition:`transform ${Se.DURATION}s cubic-bezier(${Se.EASE.join(",")})`,transform:ke(b)?`scale(${ie}) translate3d(0, ${we}px, 0)`:`scale(${ie}) translate3d(${we}px, 0, 0)`}),!X&&W.current&&(pe.current=setTimeout(()=>{const fe=kn(W.current,b);Ae(W.current,{transition:"none",transform:ke(b)?`translate3d(0, ${fe}px, 0)`:`translate3d(${fe}px, 0, 0)`})},500))}function sn(X,ie){if(ie<0)return;const we=(window.innerWidth-vt)/window.innerWidth,fe=we+ie*(1-we),Te=-vt+ie*vt;Ae(W.current,{transform:ke(b)?`scale(${fe}) translate3d(0, ${Te}px, 0)`:`scale(${fe}) translate3d(${Te}px, 0, 0)`,transition:"none"})}function an(X,ie){const we=ke(b)?window.innerHeight:window.innerWidth,fe=ie?(we-vt)/we:1,Te=ie?-vt:0;ie&&Ae(W.current,{transition:`transform ${Se.DURATION}s cubic-bezier(${Se.EASE.join(",")})`,transform:ke(b)?`scale(${fe}) translate3d(0, ${Te}px, 0)`:`scale(${fe}) translate3d(${Te}px, 0, 0)`})}return D.useEffect(()=>{v||window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"})},[v]),D.createElement(Pp,{defaultOpen:C,onOpenChange:X=>{!d&&!X||(X?A(!0):xe(!0),J(X))},open:N},D.createElement(Ti.Provider,{value:{activeSnapPoint:le,snapPoints:s,setActiveSnapPoint:_,drawerRef:W,overlayRef:M,onOpenChange:t,onPress:Z,onRelease:on,onDrag:de,dismissible:d,shouldAnimate:Y,handleOnly:f,isOpen:N,isDragging:ce,shouldFade:Ve,closeDrawer:xe,onNestedDrag:sn,onNestedOpenChange:Ft,onNestedRelease:an,keyboardIsOpen:k,modal:v,snapPointsOffset:Ce,activeSnapPointIndex:ue,direction:b,shouldScaleBackground:a,setBackgroundColorOnScale:i,noBodyStyles:R,container:q,autoFocus:Q}},n))}const Ni=D.forwardRef(function({...e},t){const{overlayRef:n,snapPoints:r,onRelease:o,shouldFade:s,isOpen:a,modal:i,shouldAnimate:u}=rn(),c=Ci(t,n),d=r&&r.length>0;if(!i)return null;const f=D.useCallback(p=>o(p),[o]);return D.createElement(Mp,{onMouseUp:f,ref:c,"data-vaul-overlay":"","data-vaul-snap-points":a&&d?"true":"false","data-vaul-snap-points-overlay":a&&s?"true":"false","data-vaul-animate":u?.current?"true":"false",...e})});Ni.displayName="Drawer.Overlay";const _i=D.forwardRef(function({onPointerDownOutside:e,style:t,onOpenAutoFocus:n,...r},o){const{drawerRef:s,onPress:a,onRelease:i,onDrag:u,keyboardIsOpen:c,snapPointsOffset:d,activeSnapPointIndex:f,modal:p,isOpen:h,direction:g,snapPoints:m,container:v,handleOnly:y,shouldAnimate:E,autoFocus:R}=rn(),[b,C]=D.useState(!1),O=Ci(o,s),T=D.useRef(null),x=D.useRef(null),I=D.useRef(!1),H=m&&m.length>0;im();const q=(L,ee,N=0)=>{if(I.current)return!0;const J=Math.abs(L.y),te=Math.abs(L.x),A=te>J,ce=["bottom","right"].includes(ee)?1:-1;if(ee==="left"||ee==="right"){if(!(L.x*ce<0)&&te>=0&&te<=N)return A}else if(!(L.y*ce<0)&&J>=0&&J<=N)return!A;return I.current=!0,!0};D.useEffect(()=>{H&&window.requestAnimationFrame(()=>{C(!0)})},[]);function Q(L){T.current=null,I.current=!1,i(L)}return D.createElement(Lp,{"data-vaul-drawer-direction":g,"data-vaul-drawer":"","data-vaul-delayed-snap-points":b?"true":"false","data-vaul-snap-points":h&&H?"true":"false","data-vaul-custom-container":v?"true":"false","data-vaul-animate":E?.current?"true":"false",...r,ref:O,style:d&&d.length>0?{"--snap-point-height":`${d[f??0]}px`,...t}:t,onPointerDown:L=>{y||(r.onPointerDown==null||r.onPointerDown.call(r,L),T.current={x:L.pageX,y:L.pageY},a(L))},onOpenAutoFocus:L=>{n?.(L),R||L.preventDefault()},onPointerDownOutside:L=>{if(e?.(L),!p||L.defaultPrevented){L.preventDefault();return}c.current&&(c.current=!1)},onFocusOutside:L=>{if(!p){L.preventDefault();return}},onPointerMove:L=>{if(x.current=L,y||(r.onPointerMove==null||r.onPointerMove.call(r,L),!T.current))return;const ee=L.pageY-T.current.y,N=L.pageX-T.current.x,J=L.pointerType==="touch"?10:2;q({x:N,y:ee},g,J)?u(L):(Math.abs(N)>J||Math.abs(ee)>J)&&(T.current=null)},onPointerUp:L=>{r.onPointerUp==null||r.onPointerUp.call(r,L),T.current=null,I.current=!1,i(L)},onPointerOut:L=>{r.onPointerOut==null||r.onPointerOut.call(r,L),Q(x.current)},onContextMenu:L=>{r.onContextMenu==null||r.onContextMenu.call(r,L),x.current&&Q(x.current)}})});_i.displayName="Drawer.Content";const um=250,dm=120,fm=D.forwardRef(function({preventCycle:e=!1,children:t,...n},r){const{closeDrawer:o,isDragging:s,snapPoints:a,activeSnapPoint:i,setActiveSnapPoint:u,dismissible:c,handleOnly:d,isOpen:f,onPress:p,onDrag:h}=rn(),g=D.useRef(null),m=D.useRef(!1);function v(){if(m.current){R();return}window.setTimeout(()=>{y()},dm)}function y(){if(s||e||m.current){R();return}if(R(),!a||a.length===0){c||o();return}if(i===a[a.length-1]&&c){o();return}const C=a.findIndex(T=>T===i);if(C===-1)return;const O=a[C+1];u(O)}function E(){g.current=window.setTimeout(()=>{m.current=!0},um)}function R(){g.current&&window.clearTimeout(g.current),m.current=!1}return D.createElement("div",{onClick:v,onPointerCancel:R,onPointerDown:b=>{d&&p(b),E()},onPointerMove:b=>{d&&h(b)},ref:r,"data-vaul-drawer-visible":f?"true":"false","data-vaul-handle":"","aria-hidden":"true",...n},D.createElement("span",{"data-vaul-handle-hitarea":"","aria-hidden":"true"},t))});fm.displayName="Drawer.Handle";function pm(e){const t=rn(),{container:n=t.container,...r}=e;return D.createElement(_p,{container:n,...r})}const mt={Root:lm,Content:_i,Overlay:Ni,Trigger:Np,Portal:pm,Close:$p,Title:jp,Description:Fp};function mm({...e}){return S.jsx(mt.Root,{"data-slot":"drawer",...e})}function hm({...e}){return S.jsx(mt.Trigger,{"data-slot":"drawer-trigger",...e})}function gm({...e}){return S.jsx(mt.Portal,{"data-slot":"drawer-portal",...e})}function vm({...e}){return S.jsx(mt.Close,{"data-slot":"drawer-close",...e})}function bm({className:e,...t}){return S.jsx(mt.Overlay,{"data-slot":"drawer-overlay",className:Le("data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 bg-black/10 supports-backdrop-filter:backdrop-blur-xs fixed inset-0 z-50",e),...t})}function ym({className:e,children:t,...n}){return S.jsxs(gm,{"data-slot":"drawer-portal",children:[S.jsx(bm,{}),S.jsxs(mt.Content,{"data-slot":"drawer-content",className:Le("bg-background flex h-auto flex-col text-sm data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-xl data-[vaul-drawer-direction=bottom]:border-t data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:rounded-r-xl data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:rounded-l-xl data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-xl data-[vaul-drawer-direction=top]:border-b data-[vaul-drawer-direction=left]:sm:max-w-sm data-[vaul-drawer-direction=right]:sm:max-w-sm group/drawer-content fixed z-50",e),...n,children:[S.jsx("div",{className:"bg-muted mx-auto mt-4 hidden h-1 w-25 shrink-0 rounded-full group-data-[vaul-drawer-direction=bottom]/drawer-content:block"}),t]})]})}function wm({className:e,...t}){return S.jsx("div",{"data-slot":"drawer-header",className:Le("gap-0.5 p-4 group-data-[vaul-drawer-direction=bottom]/drawer-content:text-center group-data-[vaul-drawer-direction=top]/drawer-content:text-center md:gap-0.5 md:text-left flex flex-col",e),...t})}function Em({className:e,...t}){return S.jsx("div",{"data-slot":"drawer-footer",className:Le("gap-2 p-4 mt-auto flex flex-col",e),...t})}function xm({className:e,...t}){return S.jsx(mt.Title,{"data-slot":"drawer-title",className:Le("text-foreground text-base font-medium",e),...t})}function Sm({className:e,...t}){return S.jsx(mt.Description,{"data-slot":"drawer-description",className:Le("text-muted-foreground text-sm",e),...t})}function Tm({open:e,setOpen:t,isLoading:n,error:r,onRetry:o,iframeURL:s,iframeRef:a,isFullScreen:i,setIsFullScreen:u,triggerProperties:{label:c,component:d=void 0},title:f}){return S.jsxs(mm,{open:e,onOpenChange:t,modal:!0,direction:"bottom",handleOnly:!0,children:[S.jsx(hm,{asChild:!0,children:d||S.jsx(rt,{variant:"default",children:c})}),S.jsxs(ym,{className:`shadow-2xl shadow-foreground ${i?Bn.styles.drawer.expanded:Bn.styles.drawer.compacted}`,children:[S.jsxs(wm,{className:"text-left",children:[S.jsx(xm,{children:f}),S.jsx(Sm,{children:S.jsx(rt,{variant:"outline",size:"icon-sm",className:"rounded-lg",onClick:()=>u(p=>!p),children:i?S.jsx(Wa,{}):S.jsx(Va,{})})})]}),S.jsxs("div",{className:"relative w-full h-full overflow-hidden px-4 pb-4",children:[S.jsx(eo,{ref:a,title:f,src:s||"about:blank",className:"w-full h-full"}),n?S.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center gap-3 bg-background/80",children:[S.jsx(za,{className:"size-5"}),S.jsx("div",{className:"text-sm text-foreground",children:"Loading..."})]}):null,r?S.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center gap-3 bg-background/90 px-6 text-center",children:[S.jsx("div",{className:"text-sm font-medium text-foreground",children:"We couldn't start the session."}),S.jsx("div",{className:"text-xs text-muted-foreground",children:r.message||"Please try again."}),S.jsx(rt,{variant:"outline",size:"sm",onClick:o,children:"Retry"})]}):null]}),S.jsx(Em,{className:"pt-2",children:S.jsx(vm,{asChild:!0,children:S.jsx(rt,{variant:"default",children:"Cancel"})})})]})]})}class Ze extends Error{code;meta;constructor(t,n,r){super(n,r?.cause?{cause:r.cause}:void 0),this.name="AarthikError",this.code=t,this.meta=r?.meta}}class Ue extends Ze{constructor(t,n){super("CONFIG_ERROR",t,{meta:n}),this.name="AarthikConfigurationError"}}class Fe extends Ze{constructor(t,n){super("AUTH_ERROR",t,{meta:n}),this.name="AarthikAuthError"}}class Vn extends Ze{constructor(t,n){super("AUTH_REQUIRES_BOOTSTRAP",t,{cause:n?.cause,meta:n?.meta}),this.name="AarthikRebootstrapRequiredError"}}class Rm extends Ze{constructor(t,n,r){super("NETWORK_ERROR",t,{cause:n,meta:r}),this.name="AarthikNetworkError"}}class km extends Ze{constructor(t,n){super("TIMEOUT",`Request timed out after ${t}ms`,{meta:{timeoutMs:t,...n}}),this.name="AarthikTimeOutError"}}class Wn extends Ze{constructor(t="Request was aborted",n,r){super("ABORTED",t,{cause:n,meta:r}),this.name="AarthikAbortedError"}}class Ne extends Ze{constructor(t,n,r){super("PARSE_ERROR",t,{cause:n,meta:r}),this.name="AarthikParseError"}}class so extends Ze{status;statusText;URL;method;responseBody;constructor(t){const n=`HTTP ${t.status} ${t.statusText} for ${t.method} ${t.URL}`;super("HTTP_ERROR",n,{meta:{status:t.status,statusText:t.statusText,URL:t.URL,method:t.method,...t.meta}}),this.name="AarthikHTTPError",this.status=t.status,this.statusText=t.statusText,this.URL=t.URL,this.method=t.method,this.responseBody=t.responseBody}}function ao(e){return!e||typeof e!="object"?!1:e.name==="AarthikAbortedError"}function Cm(e){return e instanceof Ze?e:ao(e)?new Wn("Request aborted",e):new Ze("UNKNOWN_ERROR","Unknown error",{cause:e})}function Mi(){const e=globalThis;if(e.crypto?.randomUUID)return e.crypto.randomUUID();if(e.crypto?.getRandomValues){const t=new Uint8Array(16);e.crypto.getRandomValues(t),t[6]=t[6]&15|64,t[8]=t[8]&63|128;const n=[...t].map(r=>r.toString(16).padStart(2,"0")).join("");return[n.slice(0,8),n.slice(8,12),n.slice(12,16),n.slice(16,20),n.slice(20)].join("-")}return`rid_${Math.random().toString(16).slice(2)}_${Date.now().toString(16)}`}function Om(...e){const t=new Headers;for(const n of e){if(!n)continue;if(n instanceof Headers){n.forEach((o,s)=>t.set(s,o));continue}if(typeof n=="object"&&!Array.isArray(n)){for(const[o,s]of Object.entries(n))s!=null&&t.set(o,String(s));continue}new Headers(n).forEach((o,s)=>t.set(s,o))}return t}function Am(e){const t=new URLSearchParams;if(!e)return t;for(const[n,r]of Object.entries(e)){if(Array.isArray(r)){for(const o of r)o!=null&&t.append(n,String(o));continue}r!=null&&t.set(n,String(r))}return t}function Li(e,t){const n=e.replace(/\/+$/,""),r=t.replace(/^\/+/,"");return r?`${n}/${r}`:n}function ds(e,t){return new Promise((n,r)=>{if(t?.aborted){r(new Wn("Sleep aborted",t.reason));return}const o=setTimeout(()=>{a(),n()},e),s=()=>{a(),r(new Wn("Sleep aborted",t?.reason))};function a(){clearTimeout(o),t?.removeEventListener("abort",s)}t?.addEventListener("abort",s,{once:!0})})}function fs(e){const t=e.baseDelayMs*Math.pow(2,Math.max(0,e.attempt-1)),n=Math.min(e.maxDelayMs,t);return e.jitter?Math.floor(Math.random()*n):n}function ji(e){if(!e)return!1;const t=e.toLowerCase();return t.includes("application/json")||t.includes("+json")}function er(e){if(!e.baseURL||typeof e.baseURL!="string")throw new Ue("createClient: baseURL must be a non-empty string");const t=e.fetch??globalThis.fetch;if(typeof t!="function")throw new Ue("createClient: fetch is not available in this environment. Provide options.fetch.");const n={maxAttempts:1,baseDelayMs:200,maxDelayMs:2e3,jitter:!0,retryableMethods:["GET","HEAD","OPTIONS"],retryableStatusCodes:[408,429,500,502,503,504],retryOnNetworkError:!0};return{baseURL:e.baseURL,fetch:t,timeoutMs:e.timeoutMs??3e4,retry:{...n,...e.retry??{}},tenant:{...e.tenant,headerName:e.tenant?.headerName??"x-tenant-id"},auth:{...e.auth,headerName:e.auth?.headerName??"authorization",scheme:e.auth?.scheme??"Bearer"},correlation:{...e.correlation,headerName:e.correlation?.headerName??"x-correlation-id",generate:e.correlation?.generate??Mi},idempotency:{...e.idempotency,headerName:e.idempotency?.headerName??"idempotency-key"},clientInformation:{headerName:e.clientInformation?.headerName??"x-client-info",value:e.clientInformation?.value},headers:e.headers,hooks:e.hooks,logger:e.logger}}function ps(e){const{configuration:t,method:n,attempt:r,response:o,error:s}=e;return r>=t.retry.maxAttempts||!t.retry.retryableMethods.includes(n)?!1:o?t.retry.retryableStatusCodes.includes(o.status):s?!(!t.retry.retryOnNetworkError||ao(s)):!1}async function Dm(e,t){if(t)return t;if(e.tenant.resolveTenantID){const n=await e.tenant.resolveTenantID();if(n)return n}return e.tenant.defaultTenantID}async function Im(e){return e.auth.getToken?await e.auth.getToken()??void 0:e.auth.token??void 0}function Pm(e,t){const n=e.scheme??"Bearer";return n?`${n} ${t}`:t}async function ms(e,t){if(e)return typeof e=="function"?await e(t):e}function Nm(e){async function t(r,o={},s){const a=o.method??"GET",i=e.correlation.generate(),u=Li(e.baseURL,r),c=Am(o.query),d=c.toString()?`${u}?${c.toString()}`:u,f=o.timeoutMs??e.timeoutMs,p=await Dm(e,o.tenantID??s),h=await Im(e);for(let g=1;g<=e.retry.maxAttempts;g++){const m=i,v={method:a,URL:d,path:r,attempt:g,correlationID:m,tenantID:p},y=await ms(e.headers,v),E=await ms(o.headers,v);let R;const b=o.body!==void 0&&o.body!==null,C=typeof o.body=="string"||o.body instanceof Blob||o.body instanceof ArrayBuffer||o.body instanceof FormData||o.body instanceof URLSearchParams||o.body instanceof ReadableStream;b&&(R=C?o.body:JSON.stringify(o.body));const O=b&&!C?{"content-type":"application/json"}:void 0,T={accept:"application/json"},x=h?{[e.auth.headerName]:Pm(e.auth,h)}:void 0,I=p?{[e.tenant.headerName]:p}:void 0,H={[e.correlation.headerName]:m},q=e.clientInformation.value?{[e.clientInformation.headerName]:e.clientInformation.value}:void 0,Q=o.idempotencyKey&&a!=="GET"&&a!=="HEAD"?{[e.idempotency.headerName]:o.idempotencyKey}:void 0,L=Om(T,O,y,E,x,I,H,q,Q),ee=new AbortController,N=o.signal;let J=!1;const te=setTimeout(()=>{J=!0,ee.abort()},f),A=()=>ee.abort();N&&(N.aborted?ee.abort():N.addEventListener("abort",A,{once:!0}));const ce={...v,headers:L};try{await e.hooks?.beforeRequest?.(ce);const re=performance?.now?.()??Date.now(),w=await e.fetch(d,{method:a,headers:L,body:R,signal:ee.signal}),U=(performance?.now?.()??Date.now())-re,M={...ce,response:w,durationMs:U};if(await e.hooks?.afterResponse?.(M),!w.ok){const he=await Mm(w).catch(()=>{});if(ps({configuration:e,method:a,attempt:g,response:w})){const j=fs({attempt:g,baseDelayMs:e.retry.baseDelayMs,maxDelayMs:e.retry.maxDelayMs,jitter:e.retry.jitter});e.logger?.warning?.(`[sdk] retrying ${a} ${d} (attempt ${g}/${e.retry.maxAttempts}) in ${j}ms`,{status:w.status,correlationId:m}),await ds(j,ee.signal).catch(()=>{});continue}return{data:null,error:new so({status:w.status,statusText:w.statusText,URL:d,method:a,responseBody:he,meta:{correlationId:m,tenantId:p}}),status:w.status,correlationID:m,headers:w.headers}}return{data:await(o.parse??_m)(w),error:null,status:w.status,correlationID:m,headers:w.headers}}catch(re){const w=J,U=ao(re),M=w?new km(f,{correlationId:m,tenantId:p,url:d,method:a}):U?new Wn("Request aborted",re,{correlationId:m,tenantId:p,url:d,method:a}):new Rm("Network request failed",re,{correlationId:m,tenantId:p,url:d,method:a});if(ps({configuration:e,method:a,attempt:g,error:re})){const K=fs({attempt:g,baseDelayMs:e.retry.baseDelayMs,maxDelayMs:e.retry.maxDelayMs,jitter:e.retry.jitter});e.logger?.warning?.(`[sdk] retrying ${a} ${d} after error (attempt ${g}/${e.retry.maxAttempts}) in ${K}ms`,{correlationId:m,error:M}),await ds(K,ee.signal).catch(()=>{});continue}return{data:null,error:Cm(M),correlationID:m}}finally{clearTimeout(te),N?.removeEventListener?.("abort",A)}}return{data:null,error:new Ue("Retry loop exited unexpectedly"),correlationID:i}}async function n(r,o,s){const a=await t(r,o,s);if(a.error)throw a.error;return a.data}return{request:t,requestOrThrow:n}}async function _m(e){if(e.status===204)return;const t=e.headers.get("content-type");if(ji(t))try{return await e.json()}catch(n){throw new Ne("Failed to parse JSON response",n)}return await e.text()}async function Mm(e){const t=e.headers.get("content-type");return ji(t)?await e.json():await e.text()}class xt{config;http;plugins;tenantOverride;constructor(t,n=[],r){const o="fetch"in t&&typeof t.fetch=="function"?t:er(t);this.config=Object.freeze(o),this.http=Nm(this.config),this.plugins=n,this.tenantOverride=r;for(const s of n){const a=s(this);Object.assign(this,a)}}withTenant(t){return new xt(this.config,this.plugins,t)}extend(t){const n=[...this.plugins,t];return new xt(this.config,n,this.tenantOverride)}request(t,n){return this.http.request(t,n,this.tenantOverride)}requestOrThrow(t,n){return this.http.requestOrThrow(t,n,this.tenantOverride)}get(t,n){return this.request(t,{...n,method:"GET"})}post(t,n,r){return this.request(t,{...r,method:"POST",body:n})}}const Lm=60;class Fi{client;bootstrapTokenProvider;parentOrigin;accessTokenLeewayMs;now;logger;tokenState;exchangePromise;refreshPromise;constructor(t){const n=er({baseURL:t.baseURL,fetch:t.fetch,logger:t.logger});this.client=new xt(n),this.bootstrapTokenProvider=this.resolveBootstrapProvider(t.bootstrapToken),this.parentOrigin=t.parentOrigin,this.accessTokenLeewayMs=(t.accessTokenLeewaySeconds??Lm)*1e3,this.now=t.now??(()=>Date.now()),this.logger=t.logger}getState(){return this.tokenState?{...this.tokenState}:null}clear(){this.tokenState=void 0}async getSession(){const t=await this.ensureValidSession();return this.toAuthSession(t)}async getAccessToken(){return(await this.ensureValidSession()).accessToken}async exchange(){if(this.exchangePromise)return this.exchangePromise;const t=this.performExchange();this.exchangePromise=t;try{const n=await t;return this.tokenState=n,n}finally{this.exchangePromise=void 0}}async refresh(){if(this.refreshPromise)return this.refreshPromise;if(!this.tokenState?.refreshToken)throw new Fe("Refresh token is missing",{action:"REBOOTSTRAP"});const t=this.performRefresh(this.tokenState.refreshToken);this.refreshPromise=t;try{const n=await t;return this.tokenState=n,n}finally{this.refreshPromise=void 0}}async ensureValidSession(){return this.tokenState?this.isRefreshTokenExpired(this.tokenState)?(this.logger?.warning?.("[sdk] refresh token expired; re-bootstrap"),this.clear(),await this.exchange()):this.isAccessTokenExpiring(this.tokenState)?await this.refresh():this.tokenState:await this.exchange()}resolveBootstrapProvider(t){return typeof t=="function"?t:()=>t}async performExchange(){const t=await this.bootstrapTokenProvider();if(!t)throw new Fe("Bootstrap token is required",{action:"RETRY_BOOTSTRAP"});const n={bootstrap_token:t,...this.parentOrigin?{parent_origin:this.parentOrigin}:void 0},r=await this.client.requestOrThrow("/api/auth/exchange",{method:"POST",body:n});return this.buildTokenStateFromExchange(r)}async performRefresh(t){const n={refresh_token:t};try{const r=await this.client.requestOrThrow("/api/auth/refresh",{method:"POST",body:n});if(!this.tokenState)throw new Fe("Token state missing during refresh",{action:"REBOOTSTRAP"});return this.buildTokenStateFromRefresh(this.tokenState,r)}catch(r){throw this.requiresRebootstrap(r)?(this.clear(),new Vn("Refresh token rejected; re-bootstrap required",{cause:r,meta:{action:"REBOOTSTRAP"}})):r}}buildTokenStateFromExchange(t){const n=this.now();return{tokenType:t.token_type,accessToken:t.access_token,scope:t.scope,expiresIn:t.expires_in,accessTokenExpiresAt:n+t.expires_in*1e3,refreshToken:t.refresh_token,refreshTokenExpiresAt:this.parseExpiresAt(t.refresh_expires_at),sessionID:t.session_id}}buildTokenStateFromRefresh(t,n){const r=this.now();return{tokenType:n.token_type,accessToken:n.access_token,scope:n.scope,expiresIn:n.expires_in,accessTokenExpiresAt:r+n.expires_in*1e3,refreshToken:n.refresh_token,refreshTokenExpiresAt:this.parseExpiresAt(n.refresh_expires_at),sessionID:t.sessionID}}parseExpiresAt(t){const n=Date.parse(t);return Number.isNaN(n)?this.now():n}isAccessTokenExpiring(t){return t.accessTokenExpiresAt-this.now()<=this.accessTokenLeewayMs}isRefreshTokenExpired(t){return t.refreshTokenExpiresAt<=this.now()}toAuthSession(t){return{tokenType:t.tokenType,accessToken:t.accessToken,scope:t.scope,expiresIn:t.expiresIn,sessionID:t.sessionID,accessTokenExpiresAt:t.accessTokenExpiresAt,refreshTokenExpiresAt:t.refreshTokenExpiresAt}}requiresRebootstrap(t){if(t instanceof Vn)return!0;if(t instanceof so){if([401,403].includes(t.status))return!0;const n=t.responseBody;if(n&&typeof n=="object"){const r=n,o=typeof r.code=="string"?r.code:typeof r.error=="string"?r.error:void 0;if(o&&/TOKEN|SESSION|BOOTSTRAP/i.test(o))return!0}}return!1}}class $i{client;getAccessToken;state;provisionPromise;constructor(t){if(typeof t.getAccessToken!="function")throw new Ue("getAccessToken is required for borrower provisioning");this.getAccessToken=t.getAccessToken;const n=er({baseURL:t.baseURL,fetch:t.fetch,logger:t.logger,auth:{getToken:()=>this.getAccessToken()}});this.client=new xt(n)}getState(){return this.state?{...this.state,journeys:[...this.state.journeys],journeyIDs:[...this.state.journeyIDs]}:null}clear(){this.state=void 0}async provisionBorrower(t){if(this.provisionPromise)return this.provisionPromise;const n=this.performProvision(t);this.provisionPromise=n;try{const r=await n;return this.state=r,r}finally{this.provisionPromise=void 0}}async performProvision(t){if(!t?.borrowerProviderID)throw new Ue("borrowerProviderID is required to provision a borrower");if(!t?.contactNumber)throw new Ue("contactNumber is required to provision a borrower");const n={borrower_provider_id:t.borrowerProviderID,contact_number:t.contactNumber},r=await this.client.requestOrThrow("/api/sdk/provision",{method:"POST",body:n});return this.toProvisioningState(r)}toProvisioningState(t){const n=t.borrower;if(!n||typeof n!="object")throw new Ne("Provision response missing borrower data");const r=typeof n.borrower_id=="string"?n.borrower_id:void 0;if(!r)throw new Ne("Provision response missing borrower_id");const o=typeof t.access_token=="string"?t.access_token:"";if(!o)throw new Ne("Provision response missing access_token");const s=typeof t.scope=="string"?t.scope:"";if(!s)throw new Ne("Provision response missing scope");const a=t.expires_in;if(typeof a!="number"||!Number.isFinite(a))throw new Ne("Provision response missing expires_in");const i=Array.isArray(t.journeys)?t.journeys:[],u=i.map(c=>typeof c?.journey_id=="string"?c.journey_id:void 0).filter(c=>!!c);return{borrower:n,borrowerID:r,journeys:i,journeyIDs:u,attached:!!t.attached,accessToken:o,scope:s,expiresIn:a}}}class Bi{client;getAccessToken;state;attachPromise;constructor(t){if(typeof t.getAccessToken!="function")throw new Ue("getAccessToken is required for journey selection");this.getAccessToken=t.getAccessToken;const n=er({baseURL:t.baseURL,fetch:t.fetch,logger:t.logger,auth:{getToken:()=>this.getAccessToken()}});this.client=new xt(n)}getState(){return this.state?{...this.state,journey:this.state.journey?{...this.state.journey}:void 0}:null}clear(){this.state=void 0}async selectOrCreateJourney(t={}){if(this.attachPromise)return this.attachPromise;const n=this.performSelectOrCreate(t);this.attachPromise=n;try{const r=await n;return this.state=r,r}finally{this.attachPromise=void 0}}async selectJourney(t){return this.selectOrCreateJourney({journeyID:t})}async createJourney(t){return this.selectOrCreateJourney({metadata:t})}async performSelectOrCreate(t){const n=this.resolveJourneyID(t);return n?await this.performSelect(n):await this.performCreate(t.metadata)}resolveJourneyID(t){if(t.journeyID!==void 0){if(typeof t.journeyID!="string"||!t.journeyID)throw new Ue("journeyID is required to select a journey");return t.journeyID}if(Array.isArray(t.journeyIDs)){const n=t.journeyIDs.find(r=>typeof r=="string"&&r);if(n)return n}}async performSelect(t){const n={journey_id:t},r=await this.client.requestOrThrow("/api/sdk/journey/select",{method:"POST",body:n});return this.toStateFromSelect(r,t)}async performCreate(t){if(t!==void 0&&(!t||typeof t!="object"||Array.isArray(t)))throw new Ue("metadata must be a non-null object when creating a journey");const n=t!==void 0?{metadata:t}:{},r=await this.client.requestOrThrow("/api/sdk/journey/create",{method:"POST",body:n});return this.toStateFromCreate(r)}toStateFromSelect(t,n){const r=typeof t.token_type=="string"?t.token_type:"";if(!r)throw new Ne("Journey select response missing token_type");const o=typeof t.access_token=="string"?t.access_token:"";if(!o)throw new Ne("Journey select response missing access_token");const s=typeof t.scope=="string"?t.scope:"";if(!s)throw new Ne("Journey select response missing scope");const a=t.expires_in;if(typeof a!="number"||!Number.isFinite(a))throw new Ne("Journey select response missing expires_in");return{journeyID:n,tokenType:r,accessToken:o,scope:s,expiresIn:a,created:!1}}toStateFromCreate(t){const n=t.journey;if(!n||typeof n!="object"||Array.isArray(n))throw new Ne("Journey create response missing journey");const r=typeof n.journey_id=="string"?n.journey_id:"";if(!r)throw new Ne("Journey create response missing journey_id");const o=typeof t.token_type=="string"?t.token_type:"";if(!o)throw new Ne("Journey create response missing token_type");const s=typeof t.access_token=="string"?t.access_token:"";if(!s)throw new Ne("Journey create response missing access_token");const a=typeof t.scope=="string"?t.scope:"";if(!a)throw new Ne("Journey create response missing scope");const i=t.expires_in;if(typeof i!="number"||!Number.isFinite(i))throw new Ne("Journey create response missing expires_in");return{journey:n,journeyID:r,tokenType:o,accessToken:s,scope:a,expiresIn:i,created:!0}}}const jm="https://credit.aarthiklabs.com",Fm="Aarthik Shell",hs=60,gs="v1",vs=2e3,$m=3,Bm={label:"Open"},Um=/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$/;function _e(e){return typeof e=="string"&&e.trim().length>0}function bs(e){return Um.test(e)}function Vm(e){return e.startsWith("jbt.")}function Wm(e,t){return _e(t)?t:Li(e,"lab")}function zm(e){const t=e.labURL.replace(/\/+$/,""),n=[e.tenantID,e.applicationID,e.borrowerProviderID].map(o=>encodeURIComponent(o)).join("/"),r=new URLSearchParams({contactNumber:e.borrowerContactNumber});return`${t}/${n}?${r.toString()}`}function Hm(e){const t=e.created??e.created_at;if(typeof t=="number"&&Number.isFinite(t))return t;if(typeof t=="string"){const n=Date.parse(t);if(!Number.isNaN(n))return n}return null}function qm(e){const t=e.status;if(typeof t=="string")return/active/i.test(t);const n=e.is_active;return typeof n=="boolean"?n:!1}function Rr(e){if(!e.length)return;const t=e.map(n=>({journey:n,timestamp:Hm(n)})).filter(n=>n.timestamp!==null);return t.length?t.reduce((n,r)=>(r.timestamp??0)>(n.timestamp??0)?r:n).journey:e[0]}function Km(e,t){if(!e.length)return;if(typeof t=="function")return t(e);if(t==="first")return e[0];if(t==="most-recent")return Rr(e);const n=e.filter(qm);return n.length?Rr(n):Rr(e)}function Gm(e){const t=[];return(!_e(e.tenantID)||!bs(e.tenantID))&&t.push("tenantID must be a valid UUID."),(!_e(e.applicationID)||!bs(e.applicationID))&&t.push("applicationID must be a valid UUID."),_e(e.borrowerProviderID)||t.push("borrowerProviderID is required."),_e(e.borrowerContactNumber)||t.push("borrowerContactNumber is required."),_e(e.baseURL)||t.push("baseURL must be a non-empty URL."),_e(e.labURL)||t.push("labURL must be a non-empty URL."),t.length?new Ue(t.join(" ")):null}function Ym(e){return _e(e)?Vm(e)?null:new Ue('bootstrapToken must start with "jbt.".'):new Ue("bootstrapToken is required.")}function Xm({tenantID:e,applicationID:t,bootstrapToken:n,borrowerProviderID:r,borrowerContactNumber:o,baseURL:s=jm,labURL:a,onReady:i,onError:u,onAuthStateChange:c,getBootstrapToken:d,onBootstrapExpired:f,onSessionEnd:p,persistSession:h=!1,journeySelectionStrategy:g,triggerProperties:m,title:v=Fm,fullscreen:y="none"}){const[E,R]=l.useState(!1),b=zi(),[C,O]=l.useState(!1),[T,x]=l.useState(null),[I,H]=l.useState(0),q=l.useRef(null),Q=l.useRef(null),L=l.useRef(null),ee=l.useRef(null),N=l.useRef(null),J=l.useRef(null),te=l.useRef(null),A=l.useRef(null),ce=l.useRef(!1),re=l.useRef(n),w=l.useRef(0),U=l.useRef(void 0),M=l.useRef(null),K=l.useMemo(()=>Wm(s,a),[s,a]),Ee=l.useMemo(()=>zm({labURL:K,tenantID:e,applicationID:t,borrowerProviderID:r,borrowerContactNumber:o}),[K,e,t,r,o]),he=l.useMemo(()=>{try{return new URL(K).origin}catch{return null}},[K]),P=l.useCallback(G=>{c?.(G)},[c]),j=l.useCallback(()=>{te.current?.timeoutID&&window.clearTimeout(te.current.timeoutID),te.current=null},[]),pe=l.useCallback(()=>{U.current&&window.clearTimeout(U.current),U.current=void 0},[]),ye=l.useCallback(()=>{ce.current=!1,j(),A.current=null},[j]),k=l.useCallback(G=>{x(G),O(!1),P("error"),u?.(G)},[u,P]),Y=l.useCallback((G,ae)=>{const Z=q.current?.contentWindow;if(!Z||!he)return null;const be={type:G,version:gs,request_id:Mi(),timestamp:new Date().toISOString(),payload:ae};return Z.postMessage(be,he),be},[he]),z=l.useCallback(G=>{const ae=Y("AARTHIK_SDK_AUTH",G);if(!ae)return;j(),te.current={attempts:1,message:ae};const Z=()=>{if(!te.current)return;if(te.current.attempts>=$m){j(),k(new Fe("Iframe did not acknowledge auth payload",{action:"RETRY_BOOTSTRAP"}));return}te.current.attempts+=1;const be=te.current.message,de=q.current?.contentWindow;de&&he&&de.postMessage(be,he),te.current.timeoutID=window.setTimeout(Z,vs)};te.current.timeoutID=window.setTimeout(Z,vs)},[he,j,k,Y]),W=l.useCallback(G=>{const ae=Y("AARTHIK_SDK_TOKEN_UPDATE",G);ae&&(A.current={message:ae})},[Y]),oe=l.useCallback(G=>{Y("AARTHIK_SDK_LOGOUT",{reason:G})},[Y]),V=l.useCallback(async G=>{if(G==="initial"&&_e(re.current))return re.current;if(d)return await d();if(_e(re.current))return re.current;throw new Fe("Bootstrap token is required",{action:"RETRY_BOOTSTRAP"})},[d]),B=l.useCallback(()=>{Q.current?.clear(),L.current?.clear(),ee.current?.clear(),N.current=null,J.current=null,ye(),pe()},[pe,ye]),ve=l.useCallback(async G=>{if(!p)return;const Z=Q.current?.getState(),be=G?.accessToken??Z?.accessToken,de=G?.refreshToken??Z?.refreshToken;if(!be){p();return}try{await new xt({baseURL:s,auth:{token:be}}).requestOrThrow("/api/auth/logout",{method:"POST",body:de?{refresh_token:de}:{}})}catch(xe){u?.(xe)}finally{p()}},[s,u,p]),le=l.useCallback(G=>{if(pe(),!Number.isFinite(G)||G<=0)return;const ae=Math.max(0,G*1e3-hs*1e3);U.current=window.setTimeout(async()=>{if(Q.current){P("refreshing");try{const Z=await Q.current.refresh();if(!N.current)return;N.current={...N.current,tokenType:Z.tokenType,accessToken:Z.accessToken,scope:Z.scope,expiresIn:Z.expiresIn};const be={token_type:Z.tokenType,access_token:Z.accessToken,scope:Z.scope,expires_in:Z.expiresIn,session_id:N.current.sessionID,borrower_id:N.current.borrowerID,journey_id:N.current.journeyID};J.current=be,W(be),P("ready"),le(Z.expiresIn)}catch(Z){if(Z instanceof Vn){const be=new Fe("Session expired, re-bootstrap required",{action:"REBOOTSTRAP"});if(d)try{const de=await d();if(_e(de)){re.current=de,await M.current?.("rebootstrap",de);return}}catch(de){k(de instanceof Error?de:be)}k(be),P("awaiting-bootstrap"),f?.(),B();return}if(Z instanceof Fe){const be=Z.meta?.action;if(be==="REBOOTSTRAP"||be==="RETRY_BOOTSTRAP"){if(d)try{const de=await d();if(_e(de)){re.current=de,await M.current?.("rebootstrap",de);return}}catch(de){k(de instanceof Error?de:Z)}k(new Fe("Session expired, re-bootstrap required",{action:"REBOOTSTRAP"})),P("awaiting-bootstrap"),f?.(),B();return}}k(Z instanceof Error?Z:new Error("Token refresh failed"))}}},ae)},[pe,B,d,k,f,W,P]),ue=l.useCallback(G=>{N.current=G,J.current={token_type:G.tokenType,access_token:G.accessToken,scope:G.scope,expires_in:G.expiresIn,session_id:G.sessionID,borrower_id:G.borrowerID,journey_id:G.journeyID},le(G.expiresIn)},[le]),_=l.useCallback(async(G="initial",ae)=>{const Z=w.current+1;if(w.current=Z,h&&G==="initial"&&!ae&&N.current&&J.current){ye(),H(Z),x(null),O(!0),ce.current&&J.current&&z(J.current);return}if(B(),H(Z),x(null),O(!0),!he){k(new Ue("labURL must be a valid URL with a secure origin"));return}const be=Gm({tenantID:e,applicationID:t,borrowerProviderID:r,borrowerContactNumber:o,baseURL:s,labURL:K});if(be){k(be);return}P("exchanging");try{const de=ae??await V(G),xe=Ym(de);if(xe){k(xe);return}re.current=de;const Pe=new Fi({baseURL:s,bootstrapToken:()=>re.current,parentOrigin:window.location.origin,accessTokenLeewaySeconds:hs});if(Q.current=Pe,await Pe.exchange(),w.current!==Z)return;const Ge=await Pe.getSession();P("provisioning");const on=new $i({baseURL:s,getAccessToken:()=>Pe.getAccessToken()});L.current=on;const Ft=await on.provisionBorrower({borrowerProviderID:r,contactNumber:o});if(w.current!==Z)return;P("selecting");const sn=new Bi({baseURL:s,getAccessToken:()=>Ft.accessToken});ee.current=sn;const an=Km(Ft.journeys,g),X=typeof an?.journey_id=="string"?an.journey_id:void 0,ie=await sn.selectOrCreateJourney(X?{journeyID:X}:{});if(w.current!==Z)return;ue({sessionID:Ge.sessionID,borrowerID:Ft.borrowerID,journeyID:ie.journeyID,tokenType:ie.tokenType,accessToken:ie.accessToken,scope:ie.scope,expiresIn:ie.expiresIn}),ce.current&&J.current&&z(J.current)}catch(de){if(w.current!==Z)return;if(de instanceof Vn){if(d)try{const xe=await d();if(_e(xe)){re.current=xe,await _("rebootstrap",xe);return}}catch(xe){k(xe instanceof Error?xe:new Error("Bootstrap refresh failed"));return}k(new Fe("Bootstrap token expired. Please retry.",{action:"REBOOTSTRAP"})),P("awaiting-bootstrap"),f?.();return}if(de instanceof Fe){const xe=de.meta?.action;if(xe==="RETRY_BOOTSTRAP"||xe==="REBOOTSTRAP"){if(d)try{const Pe=await d();if(_e(Pe)){re.current=Pe,await _("rebootstrap",Pe);return}}catch(Pe){k(Pe instanceof Error?Pe:new Error("Bootstrap refresh failed"));return}k(new Fe("Bootstrap token expired. Please retry.",{action:"REBOOTSTRAP"})),P("awaiting-bootstrap"),f?.();return}}if(de instanceof so){const xe=de.responseBody,Pe=xe?.code??xe?.error;if(Pe&&/BOOTSTRAP|TOKEN|SESSION/i.test(Pe)){if(d)try{const Ge=await d();if(_e(Ge)){re.current=Ge,await _("rebootstrap",Ge);return}}catch(Ge){k(Ge instanceof Error?Ge:new Error("Bootstrap refresh failed"));return}k(new Fe("Bootstrap token expired. Please retry.",{action:"REBOOTSTRAP"})),P("awaiting-bootstrap"),f?.();return}}k(de instanceof Error?de:new Error("Failed to start the session"))}},[he,t,s,o,r,B,V,ue,k,d,g,f,h,K,ye,z,P,e]);l.useEffect(()=>{M.current=_},[_]);const ne=l.useCallback(async()=>{if(d){const G=await d();if(_e(G)){re.current=G,await _("rebootstrap",G);return}}await _("initial")},[d,_]),Ce=l.useCallback(G=>{if(!E||!he||G.origin!==he||G.source!==q.current?.contentWindow||!G.data||typeof G.data!="object")return;const ae=G.data;if(ae.version!==gs){Y("AARTHIK_SDK_AUTH_ACK",{status:"error",error:{code:"UNSUPPORTED_VERSION"}});return}switch(ae.type){case"AARTHIK_SDK_READY":{ce.current=!0,J.current&&z(J.current);break}case"AARTHIK_SDK_AUTH_ACK":{const Z=ae.payload;Z.status==="ok"?(j(),O(!1),P("ready"),i?.()):(j(),k(new Fe(Z.error?.message??"Iframe rejected auth payload",{action:"RETRY_BOOTSTRAP"})));break}case"AARTHIK_SDK_TOKEN_ACK":{const Z=ae.payload;Z.status==="error"&&k(new Fe(Z.error?.message??"Iframe rejected token update")),A.current=null;break}case"AARTHIK_SDK_EVENT":{ae.payload.name==="JOURNEY_CLOSED"&&!h&&B();break}}},[he,j,B,k,i,E,h,z,Y,P]);l.useEffect(()=>{if(E)return window.addEventListener("message",Ce),()=>window.removeEventListener("message",Ce)},[Ce,E]),l.useEffect(()=>()=>{B()},[B]),l.useEffect(()=>{E&&_("initial")},[E,_]),l.useEffect(()=>{E&&re.current!==n&&(re.current=n,_("rebootstrap",n))},[n,E,_]),l.useEffect(()=>{if(!E&&(O(!1),x(null),P("idle"),ye(),!h)){const G=Q.current?.getState();oe("USER_LOGOUT"),ve({accessToken:G?.accessToken,refreshToken:G?.refreshToken}),B()}},[B,E,ve,h,ye,oe,P]);const[Ie,Ve]=l.useState(y==="all"||y==="mobile-only"&&b||y==="desktop-only"&&!b),et=m??Bm;return b?S.jsx(Tm,{open:E,setOpen:R,isLoading:C,error:T,onRetry:ne,iframeURL:Ee,iframeRef:q,isFullScreen:Ie,setIsFullScreen:Ve,title:v,triggerProperties:et},`with-drawer-${I}`):S.jsx(Qd,{open:E,setOpen:R,isLoading:C,error:T,onRetry:ne,iframeURL:Ee,iframeRef:q,isFullScreen:Ie,setIsFullScreen:Ve,title:v,triggerProperties:et},`with-dialog-${I}`)}exports.AarthikShell=Xm;exports.SDKBorrowerProvisioningManager=$i;exports.SDKJourneyManager=Bi;exports.SDKTokenManager=Fi;
|