UNPKG

@getontime/cli

Version:

Time keeping for live events

2 lines 71.7 kB
System.register(["./jsx-runtime-legacy-DMkDNnVj.js","./useSocket-legacy-C772wu7w.js","./constants-legacy-CvecvM28.js"],function(e,t){var n,r,o,i,s,c,u,l,a,d,f,p,g,h,m,b,v,y,w,_,S,x,E,C,k,R,I,T,O,P,A,M,D,N,j,F,B,L,W,H,$,U,q,Y,X,z,V,K,G,Q,J,Z,ee,te,ne,re,oe,ie,se,ce,ue,le,ae,de,fe,pe,ge,he,me,be,ve,ye,we,_e,Se,xe,Ee,Ce,ke,Re,Ie,Te,Oe,Pe,Ae,Me,De,Ne,je,Fe,Be,Le,We,He,$e,Ue,qe,Ye,Xe,ze,Ve,Ke,Ge,Qe,Je,Ze,et,tt,nt,rt,ot,it,st,ct,ut,lt,at,dt,ft,pt,gt,ht,mt,bt,vt,yt,wt,_t,St,xt,Et,Ct,kt,Rt,It,Tt,Ot,Pt,At,Mt,Dt,Nt;function jt(e,t){const n=d.useRef(f);return n.current===f&&(n.current=e(t)),n}function Ft(e){const t=(t,n)=>{const r=jt(Bt).current;let o;try{g=r;for(const e of p)e.before(r);o=e(t,n);for(const e of p)e.after(r);r.didInitialize=!0}finally{g=void 0}return o};return t.displayName=e.displayName||e.name,t}function Bt(){return{didInitialize:!1}}function Lt(e){d.useEffect(e,v)}function Wt(e){return Wt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Wt(e)}function Ht(e){var t=function(e,t){if("object"!=Wt(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Wt(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Wt(t)?t:t+""}function $t(e,t,n){return(t=Ht(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ut(){const e=jt(y.create).current;return Lt(e.disposeEffect),e}function qt(e){e.preventDefault(),e.stopPropagation()}function Yt(e){return!(""!==e.pointerType||!e.isTrusted)||(R&&e.pointerType?"click"===e.type&&1===e.buttons:0===e.detail&&!e.pointerType)}function Xt(e){return!A&&(!R&&0===e.width&&0===e.height||R&&1===e.width&&1===e.height&&0===e.pressure&&0===e.detail&&"mouse"===e.pointerType||e.width<1&&e.height<1&&0===e.pressure&&0===e.detail&&"touch"===e.pointerType)}function zt(){return"undefined"!=typeof window}function Vt(e){return Qt(e)?(e.nodeName||"").toLowerCase():"#document"}function Kt(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function Gt(e){var t;return null==(t=(Qt(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function Qt(e){return!!zt()&&(e instanceof Node||e instanceof Kt(e).Node)}function Jt(e){return!!zt()&&(e instanceof Element||e instanceof Kt(e).Element)}function Zt(e){return!!zt()&&(e instanceof HTMLElement||e instanceof Kt(e).HTMLElement)}function en(e){return!(!zt()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof Kt(e).ShadowRoot)}function tn(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=cn(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&"inline"!==o&&"contents"!==o}function nn(e){try{if(e.matches(":popover-open"))return!0}catch(t){}try{return e.matches(":modal")}catch(t){return!1}}function rn(e){const t=Jt(e)?cn(e):e;return N(t.transform)||N(t.translate)||N(t.scale)||N(t.rotate)||N(t.perspective)||!on()&&(N(t.backdropFilter)||N(t.filter))||M.test(t.willChange||"")||D.test(t.contain||"")}function on(){return null==j&&(j="undefined"!=typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),j}function sn(e){return/^(html|body|#document)$/.test(Vt(e))}function cn(e){return Kt(e).getComputedStyle(e)}function un(e){if("html"===Vt(e))return e;const t=e.assignedSlot||e.parentNode||en(e)&&e.host||Gt(e);return en(t)?t.host:t}function ln(e){const t=un(e);return sn(t)?e.ownerDocument?e.ownerDocument.body:e.body:Zt(t)&&tn(t)?t:ln(t)}function an(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function dn(e){let t=e.activeElement;for(;null!=t?.shadowRoot?.activeElement;)t=t.shadowRoot.activeElement;return t}function fn(e,t){if(!e||!t)return!1;const n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&en(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function pn(e){return"composedPath"in e?e.composedPath()[0]:e.target}function gn(e,t){if(null==t)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return null!=n.target&&t.contains(n.target)}function hn(e){return Zt(e)&&e.matches("input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])")}function mn(e){return!!e&&"combobox"===e.getAttribute("role")&&hn(e)}function bn(e){return e?e.hasAttribute("data-base-ui-focusable")?e:e.querySelector("[data-base-ui-focusable]")||e:null}function vn(){}function yn(e,t,n,r){let o=!1,i=!1;const s=r??L;return{reason:e,event:t??new Event("base-ui"),cancel(){o=!0},allowPropagation(){i=!0},get isCanceled(){return o},get isPropagationAllowed(){return i},trigger:n,...s}}function wn(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function _n(...e){return()=>{for(let t=0;t<e.length;t+=1){const n=e[t];n&&n()}}}function Sn(e,t,n,r){const o=jt(xn).current;return function(e,t,n,r,o){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==o}(o,e,t,n,r)&&En(o,[e,t,n,r]),o.callback}function xn(){return{callback:null,cleanup:null,refs:[]}}function En(e,t){e.refs=t,t.every(e=>null==e)?e.callback=null:e.callback=n=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),null!=n){const r=Array(t.length).fill(null);for(let e=0;e<t.length;e+=1){const o=t[e];if(null!=o)switch(typeof o){case"function":{const t=o(n);"function"==typeof t&&(r[e]=t);break}case"object":o.current=n}}e.cleanup=()=>{for(let e=0;e<t.length;e+=1){const n=t[e];if(null!=n)switch(typeof n){case"function":{const t=r[e];"function"==typeof t?t():n(null);break}case"object":n.current=null}}}}}}function Cn(e){const t=jt(kn,e).current;return t.next=e,m(t.effect),t}function kn(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}function Rn(e){const t=jt(In).current;return t.next=e,K(t.effect),t.trampoline}function In(){const e={next:void 0,callback:Tn,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function Tn(){}function On(){const e=jt(J.create).current;return Lt(e.disposeEffect),e}function Pn(e){return e?.ownerDocument||document}function An(e){return e.split("-")[0]}function Mn(e){return e.split("-")[1]}function Dn(e){return"x"===e?"y":"x"}function Nn(e){return"y"===e?"height":"width"}function jn(e){const t=e[0];return"t"===t||"b"===t?"y":"x"}function Fn(e){return Dn(jn(e))}function Bn(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}function Ln(e){const t=An(e);return se[t]+e.slice(t.length)}function Wn(e,t,n){return Math.floor(e/t)!==n}function Hn(e,t){return t<0||t>=e.length}function $n(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:o=1}={}){let i=t;do{i+=n?-o:o}while(i>=0&&i<=e.length-1&&Un(e,i,r));return i}function Un(e,t,n){if("function"==typeof n?n(t):n?.includes(t))return!0;const r=e[t];return!!r&&(!qn(r)||!n&&(r.hasAttribute("disabled")||"true"===r.getAttribute("aria-disabled")))}function qn(e,t=(e?cn(e):null)){return!(!(e&&e.isConnected&&t)||function(e){return"hidden"===e.visibility||"collapse"===e.visibility}(t))&&("function"==typeof e.checkVisibility?e.checkVisibility():"none"!==t.display&&"contents"!==t.display)}function Yn(e){const t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;const n=e.getRootNode();return en(n)?n.host:null}function Xn(e){for(const t of Array.from(e.children))if("summary"===Vt(t))return t;return null}function zn(e,t){const n=Xn(t);return!!n&&(e===n||fn(n,e))}function Vn(e){const t=e?Vt(e):"";return null!=e&&e.matches(de)&&("summary"!==t||null!=e.parentElement&&"details"===Vt(e.parentElement)&&Xn(e.parentElement)===e)&&("details"!==t||null==Xn(e))&&("input"!==t||"hidden"!==e.type)}function Kn(e){if(!Vn(e)||!e.isConnected||e.matches(":disabled"))return!1;for(let t=e;t;t=Yn(t)){const n=t!==e,r="slot"===Vt(t);if(t.hasAttribute("inert"))return!1;if(n&&"details"===Vt(t)&&!t.open&&!zn(e,t)||t.hasAttribute("hidden")||!r&&!Gn(t,n))return!1}return!0}function Gn(e,t){const n=cn(e);return t?"none"!==n.display:qn(e,n)}function Qn(e){const t=e.tabIndex;if(t<0){const t=Vt(e);if("details"===t||"audio"===t||"video"===t||Zt(e)&&e.isContentEditable)return 0}return t}function Jn(e){if("input"!==Vt(e))return null;const t=e;return"radio"===t.type&&""!==t.name?t:null}function Zn(e){if(Zt(e)&&"slot"===Vt(e)){const t=e.assignedElements({flatten:!0});if(t.length>0)return t}return Zt(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function er(e,t){Zn(e).forEach(e=>{Vn(e)&&t.push(e),er(e,t)})}function tr(e,t,n){Zn(e).forEach(e=>{Zt(e)&&e.matches(t)&&n.push(e),tr(e,t,n)})}function nr(e){return Kn(e)&&Qn(e)>=0}function rr(e){const t=[];return er(e,t),t.filter(Kn)}function or(e){const t=rr(e);return t.filter(e=>Qn(e)>=0&&function(e,t){const n=Jn(e);if(!n)return!0;const r=t.find(e=>{const t=Jn(e);return t?.name===n.name&&t.form===n.form&&t.checked});return r?r===n:t.find(e=>{const t=Jn(e);return t?.name===n.name&&t.form===n.form})===n}(e,t))}function ir(e,t){const n=or(e),r=n.length;if(0===r)return;const o=dn(Pn(e)),i=n.indexOf(o);return n[-1===i?1===t?0:r-1:i+t]}function sr(e){return ir(Pn(e).body,1)||e}function cr(e){return ir(Pn(e).body,-1)||e}function ur(e,t){if(!e)return null;const n=or(Pn(e).body),r=n.length;if(0===r)return null;const o=n.indexOf(e);return-1===o?null:n[(o+t+r)%r]}function lr(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!fn(n,r)}function ar(e){const t=[];tr(e,"[data-tabindex]",t),t.forEach(e=>{const t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute("tabindex",t):e.removeAttribute("tabindex")})}function dr(e,t,n=!0){return e.filter(e=>e.parentId===t).flatMap(t=>[...!n||t.context?.open?[t]:[],...dr(e,t.id,n)])}function fr(e,t){let n=[],r=e.find(e=>e.id===t)?.parentId;for(;r;){const t=e.find(e=>e.id===r);r=t?.parentId,t&&(n=n.concat(t))}return n}function pr(e){return`data-base-ui-${e}`}function gr(e,t={}){const{preventScroll:n=!1,sync:r=!1,shouldFocus:o}=t;function i(){o&&!o()||e?.focus({preventScroll:n})}if(cancelAnimationFrame(fe),r)return i(),vn;const s=requestAnimationFrame(i);return fe=s,()=>{fe===s&&(cancelAnimationFrame(s),fe=0)}}function hr(e){return e?en(e)?e.host:hr(e.parentNode):null}function mr(e,t,n,r,{mark:o=!0}){let i=null;r?i="inert":n&&(i="aria-hidden");let s=null,c=null;const u=ve(t,e),l=o?we(t,ye(u),new Set(u)):[],a=[],d=[];if(i){const e=pe[i],n=function(e){return he[e]}(i);c=n,s=e;const r=ve(t,Array.from(t.querySelectorAll("[aria-live]"))),o=u.concat(r);we(t,ye(o),new Set(o)).forEach(t=>{const r=t.getAttribute(i),o=null!==r&&"false"!==r,s=(e.get(t)||0)+1;e.set(t,s),a.push(t),1===s&&o&&n.add(t),o||t.setAttribute(i,"inert"===i?"":"true")})}return o&&l.forEach(e=>{const t=(me.get(e)||0)+1;me.set(e,t),d.push(e),1===t&&e.setAttribute(ge,"")}),be+=1,()=>{s&&a.forEach(e=>{const t=(s.get(e)||0)-1;s.set(e,t),t||(!c?.has(e)&&i&&e.removeAttribute(i),c?.delete(e))}),o&&d.forEach(e=>{const t=(me.get(e)||0)-1;me.set(e,t),t||e.removeAttribute(ge)}),(be-=1)||(pe.inert=new WeakMap,pe["aria-hidden"]=new WeakMap,he.inert=new WeakSet,he["aria-hidden"]=new WeakSet,me=new WeakMap)}}function br(e,t={}){const{ariaHidden:n=!1,inert:r=!1,mark:o=!0}=t;return mr(e,Pn(e[0]).body,n,r,{mark:o})}function vr(e,t){if(void 0!==Se){const n=Se();return e??(t?`${t}-${n}`:n)}return function(e,t="mui"){const[n,r]=d.useState(e),o=e||n;return d.useEffect(()=>{null==n&&r(`${t}-${_e+=1}`)},[n,t]),o}(e,t)}function yr(e){return xe>=e}function wr(e){if(!d.isValidElement(e))return null;const t=e,n=t.props;return(yr(19)?n?.ref:t.ref)??null}function _r(e,t){return e&&!t?e:!e&&t?t:e||t?{...e,...t}:void 0}function Sr(e,t,n,r,o){if(!(n||r||o||e))return xr(t);let i=xr(e);return t&&(i=Er(i,t)),n&&(i=Er(i,n)),r&&(i=Er(i,r)),o&&(i=Er(i,o)),i}function xr(e){return kr(e)?{...Rr(e,Ee)}:function(e){const t={...e};for(const n in t){const e=t[n];Cr(n,e)&&(t[n]=Tr(e))}return t}(e)}function Er(e,t){return kr(t)?Rr(t,e):function(e,t){if(!t)return e;for(const n in t){const r=t[n];switch(n){case"style":e[n]=_r(e.style,r);break;case"className":e[n]=Pr(e.className,r);break;default:Cr(n,r)?e[n]=Ir(e[n],r):e[n]=r}}return e}(e,t)}function Cr(e,t){const n=e.charCodeAt(0),r=e.charCodeAt(1),o=e.charCodeAt(2);return 111===n&&110===r&&o>=65&&o<=90&&("function"==typeof t||void 0===t)}function kr(e){return"function"==typeof e}function Rr(e,t){return kr(e)?e(t):e??Ee}function Ir(e,t){return t?e?(...n)=>{const r=n[0];if(Ar(r)){const o=r;Or(o);const i=t(...n);return o.baseUIHandlerPrevented||e?.(...n),i}const o=t(...n);return e?.(...n),o}:Tr(t):e}function Tr(e){return e?(...t)=>{const n=t[0];return Ar(n)&&Or(n),e(...t)}:e}function Or(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function Pr(e,t){return t?e?t+" "+e:t:e}function Ar(e){return null!=e&&"object"==typeof e&&"nativeEvent"in e}function Mr(e,t,n={}){const r=t.render,o=function(e,t={}){const{className:n,style:r,render:o}=e,{state:i=L,ref:s,props:c,stateAttributesMapping:u,enabled:l=!0}=t,a=l?function(e,t){return"function"==typeof e?e(t):e}(n,i):void 0,d=l?function(e,t){return"function"==typeof e?e(t):e}(r,i):void 0,f=l?function(e,t){const n={};for(const r in e){const o=e[r];if(t?.hasOwnProperty(r)){const e=t[r](o);null!=e&&Object.assign(n,e);continue}!0===o?n[`data-${r.toLowerCase()}`]="":o&&(n[`data-${r.toLowerCase()}`]=o.toString())}return n}(i,u):L,p=l&&c?function(e){return Array.isArray(e)?function(e){if(0===e.length)return Ee;if(1===e.length)return xr(e[0]);let t=xr(e[0]);for(let n=1;n<e.length;n+=1)t=Er(t,e[n]);return t}(e):Sr(void 0,e)}(c):void 0,g=l?_r(f,p)??{}:L;return"undefined"!=typeof document&&(l?Array.isArray(s)?g.ref=function(e){const t=jt(xn).current;return function(e,t){return e.refs.length!==t.length||e.refs.some((e,n)=>e!==t[n])}(t,e)&&En(t,e),t.callback}([g.ref,wr(o),...s]):g.ref=Sn(g.ref,wr(o),s):Sn(null,null)),l?(void 0!==a&&(g.className=Pr(g.className,a)),void 0!==d&&(g.style=_r(g.style,d)),g):L}(t,n);return!1===n.enabled?null:function(e,t,n,r){if(t){if("function"==typeof t)return t(n,r);const e=Sr(n,t.props);e.ref=n.ref;let o=t;return o?.$$typeof===Ce&&(o=d.Children.toArray(t)[0]),d.cloneElement(o,e)}if(e&&"string"==typeof e)return function(e,t){return"button"===e?(0,d.createElement)("button",{type:"button",...t,key:t.key}):"img"===e?(0,d.createElement)("img",{alt:"",...t,key:t.key}):d.createElement(e,t)}(e,n);throw new Error(b(8))}(e,r,o,n.state??L)}function Dr(e={}){const{ref:t,container:n,componentProps:r=L,elementProps:o}=e,i=vr(),s=Te()?.portalNode,[c,u]=d.useState(null),[l,a]=d.useState(null),f=Rn(e=>{null!==e&&a(e)}),p=d.useRef(null);m(()=>{if(null===n)return void(p.current&&(p.current=null,a(null),u(null)));if(null==i)return;const e=(n&&(Qt(n)?n:n.current))??s??document.body;null!=e?p.current!==e&&(p.current=e,a(null),u(e)):p.current&&(p.current=null,a(null),u(null))},[n,s,i]);const g=Mr("div",r,{ref:[t,f],props:[{id:i,[Oe]:""},o]});return{portalNode:l,portalSubtree:c&&g?Re.createPortal(g,c):null}}function Nr(){const e=new Map;return{emit(t,n){e.get(t)?.forEach(e=>e(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)}}}function jr(e){return null==e?e:"current"in e?e.current:e}function Fr(){Be=Be.filter(e=>e.deref()?.isConnected)}function Br(e){Fr(),e&&"body"!==Vt(e)&&(Be.push(new WeakRef(e)),Be.length>Fe&&(Be=Be.slice(-Fe)))}function Lr(){return Fr(),Be[Be.length-1]?.deref()}function Wr(e){if(e.hasAttribute("tabindex")&&!e.hasAttribute("data-tabindex"))return;if(!e.getAttribute("role")?.includes("dialog"))return;const t=rr(e).filter(e=>{const t=e.getAttribute("data-tabindex")||"";return nr(e)||e.hasAttribute("data-tabindex")&&!t.startsWith("-")}),n=e.getAttribute("tabindex");0===t.length?"0"!==n&&(e.setAttribute("tabindex","0"),e.setAttribute("data-tabindex","0")):("-1"!==n||e.hasAttribute("data-tabindex")&&"-1"!==e.getAttribute("data-tabindex"))&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}function Hr(e){const{context:t,children:n,disabled:r=!1,initialFocus:o=!0,returnFocus:i=!0,restoreFocus:s=!1,modal:c=!0,closeOnFocusOut:u=!0,openInteractionType:l="",nextFocusableElement:a,previousFocusableElement:f,beforeContentFocusGuardRef:p,externalTree:g,getInsideElements:h}=e,b="rootStore"in t?t.rootStore:t,v=b.useState("open"),y=b.useState("domReferenceElement"),w=b.useState("floatingElement"),{events:_,dataRef:S}=b.context,x=Rn(()=>S.current.floatingContext?.nodeId),E=!1===o,C=mn(y)&&E,k=Cn(o),R=Cn(i),I=Cn(l),T=Cn(v),P=je(g),A=Te(),M=d.useRef(!1),D=d.useRef(!1),N=d.useRef(!1),j=d.useRef(null),F=d.useRef(""),B=d.useRef(""),L=d.useRef(null),W=d.useRef(null),H=Sn(L,p,A?.beforeInsideRef),$=Sn(W,A?.afterInsideRef),U=Ut(),Y=Ut(),X=On(),z=null!=A,V=bn(w),K=Rn((e=V)=>e?or(e):[]),G=Rn(()=>h?.().filter(e=>null!=e)??[]);d.useEffect(()=>{if(!r&&c)return wn(Pn(V),"keydown",function(e){"Tab"===e.key&&fn(V,dn(Pn(V)))&&0===K().length&&!C&&qt(e)})},[r,V,c,C,K]),d.useEffect(()=>{if(r||!v)return;const e=Pn(V);function t(){N.current=!1}return _n(wn(e,"pointerdown",function(e){const t=pn(e),n=G();N.current=!(fn(w,t)||fn(y,t)||fn(A?.portalNode,t)||n.some(e=>e===t||fn(e,t))),B.current=e.pointerType||"keyboard",t?.closest("[data-base-ui-click-trigger]")&&(D.current=!0,Y.start(0,()=>{D.current=!1}))},!0),wn(e,"pointerup",t,!0),wn(e,"pointercancel",t,!0),wn(e,"keydown",function(){B.current="keyboard"},!0),t)},[r,w,y,V,v,A,Y,G]),d.useEffect(()=>{if(r||!u)return;const e=Pn(V);function t(t){const n=t.relatedTarget,r=t.currentTarget,o=pn(t);c&&null==n&&null!=o&&fn(w,o)&&Br(o),queueMicrotask(()=>{const i=x(),u=b.context.triggerElements,l=G(),d=n?.hasAttribute(pr("focus-guard"))&&[L.current,W.current,A?.beforeInsideRef.current,A?.afterInsideRef.current,A?.beforeOutsideRef.current,A?.afterOutsideRef.current,jr(f),jr(a)].includes(n),p=!(fn(y,n)||fn(w,n)||fn(n,w)||fn(A?.portalNode,n)||l.some(e=>e===n||fn(e,n))||null!=n&&u.hasElement(n)||u.hasMatchingElement(e=>fn(e,n))||d||P&&(dr(P.nodesRef.current,i).find(e=>fn(e.context?.elements.floating,n)||fn(e.context?.elements.domReference,n))||fr(P.nodesRef.current,i).find(e=>[e.context?.elements.floating,bn(e.context?.elements.floating)].includes(n)||e.context?.elements.domReference===n)));if(r===y&&V&&Wr(V),s&&r!==y&&!qn(o)&&dn(e)===e.body){if(Zt(V)&&(V.focus(),"popup"===s))return void X.request(()=>{V.focus()});const e=K(),t=j.current,n=(t&&e.includes(t)?t:null)||e[e.length-1]||V;Zt(n)&&n.focus()}S.current.insideReactTree?S.current.insideReactTree=!1:!C&&c||!n||!p||D.current||!C&&n===Lr()||(M.current=!0,b.setOpen(!1,yn(q,t)))})}const n=Zt(y)?y:null;return w||n?_n(n&&wn(n,"focusout",t),n&&wn(n,"pointerdown",function(){D.current=!0,Y.start(0,()=>{D.current=!1})}),w&&wn(w,"focusin",function(e){const t=pn(e);nr(t)&&(j.current=t)}),w&&wn(w,"focusout",t),w&&A&&wn(w,"focusout",function(){N.current||(S.current.insideReactTree=!0,U.start(0,()=>{S.current.insideReactTree=!1}))},!0)):void 0},[r,y,w,V,c,P,A,b,u,s,K,C,x,S,U,Y,X,a,f,G]),d.useEffect(()=>{if(r||!w||!v)return;const e=Array.from(A?.portalNode?.querySelectorAll(`[${pr("portal")}]`)||[]),t=(P?fr(P.nodesRef.current,x()):[]).find(e=>mn(e.context?.elements.domReference||null))?.context?.elements.domReference,n=br([w,...e,L.current,W.current,A?.beforeOutsideRef.current,A?.afterOutsideRef.current,...G(),t,jr(f),jr(a),C?y:null].filter(e=>null!=e),{ariaHidden:c||C,mark:!1}),o=br([w,...e].filter(e=>null!=e));return()=>{o(),n()}},[v,r,y,w,c,A,C,P,x,a,f,G]),m(()=>{if(!v||r||!Zt(V))return;const e=Pn(V),t=dn(e);queueMicrotask(()=>{const n=k.current,r="function"==typeof n?n(I.current||""):n;if(void 0===r||!1===r)return;if(fn(V,t))return;let o=null;const i=()=>(null==o&&(o=K(V)),o[0]||V);let s;s=!0===r||null===r?i():jr(r),s=s||i();const c=fn(V,dn(e));gr(s,{preventScroll:s===V,shouldFocus(){if(!T.current)return!1;if(c)return!0;const t=dn(e);return!(t!==s&&fn(V,t))}})})},[r,v,V,K,k,I,T]),m(()=>{if(r||!V)return;const e=Pn(V),t=dn(e),n=null==I.current;function o(e){if(e.open||(F.current=function(e,t){const n=Kt(pn(e));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||(0===e.detail?"keyboard":"mouse"):""}(e.nativeEvent,B.current)),"trigger-hover"===e.reason&&"mouseleave"===e.nativeEvent.type&&(M.current=!0),"outside-press"===e.reason)if(e.nested)M.current=!1;else if(Yt(e.nativeEvent)||Xt(e.nativeEvent))M.current=!1;else{let e=!1;Pn(V).createElement("div").focus({get preventScroll(){return e=!0,!1}}),M.current=!e}}return Br(t),_.on("openchange",o),()=>{_.off("openchange",o);const r=dn(e),i=G(),s=fn(w,r)||i.some(e=>e===r||fn(e,r))||P&&dr(P.nodesRef.current,x(),!1).some(e=>fn(e.context?.elements.floating,r)),c=R.current,u=function(){const e=R.current;let r="function"==typeof e?e(F.current):e;if(void 0===r||!1===r)return null;null===r&&(r=!0);const o=y?.isConnected?y:null,i=t?.isConnected&&"body"!==Vt(t)?t:null;let s=n?i||o:o||i;return s||(s=Lr()||null),"boolean"==typeof r?s:jr(r)||s||null}();queueMicrotask(()=>{const t=(n=u)?nr(n)?n:or(n)[0]||n:null;var n;const o="boolean"!=typeof c;c&&!M.current&&Zt(t)&&(o||t===r||r===e.body||s)&&t.focus({preventScroll:!0}),M.current=!1})}},[r,w,V,R,I,_,P,y,x,G]),m(()=>{if(!O||v||!w)return;const e=dn(Pn(w));Zt(e)&&hn(e)&&fn(w,e)&&e.blur()},[v,w]),m(()=>{if(!r&&A)return A.setFocusManagerState({modal:c,closeOnFocusOut:u,open:v,onOpenChange:b.setOpen,domReference:y}),()=>{A.setFocusManagerState(null)}},[r,A,c,v,b,u,y]),m(()=>{if(!r&&V)return Wr(V),()=>{queueMicrotask(Fr)}},[r,V]);const Q=!r&&(!c||!C)&&(z||c);return(0,te.jsxs)(d.Fragment,{children:[Q&&(0,te.jsx)(ne,{"data-type":"inside",ref:H,onFocus:e=>{if(c){const e=K();gr(e[e.length-1])}else A?.portalNode&&(M.current=!1,lr(e,A.portalNode)?sr(y)?.focus():jr(f??A.beforeOutsideRef)?.focus())}}),n,Q&&(0,te.jsx)(ne,{"data-type":"inside",ref:$,onFocus:e=>{c?gr(K()[0]):A?.portalNode&&(u&&(M.current=!0),lr(e,A.portalNode)?cr(y)?.focus():jr(a??A.afterOutsideRef)?.focus())}})]})}function $r(){return!1}function Ur(e,t={}){const{enabled:n=!0,escapeKey:r=!0,outsidePress:o=!0,outsidePressEvent:i="sloppy",referencePress:s=$r,bubbles:c,externalTree:u}=t,l="rootStore"in e?e.rootStore:e,a=l.useState("open"),f=l.useState("floatingElement"),{dataRef:p}=l.context,g=je(u),h=Rn("function"==typeof o?o:()=>!1),m="function"==typeof o?h:o,b=!1!==m,v=Rn(()=>i),{escapeKey:w,outsidePress:_}={escapeKey:"boolean"==typeof(S=c)?S:S?.escapeKey??!1,outsidePress:"boolean"==typeof S?S:S?.outsidePress??!0};var S;const x=d.useRef(!1),E=d.useRef(!1),C=d.useRef(!1),k=d.useRef(!1),R=d.useRef(""),I=d.useRef(null),T=Ut(),P=Ut(),A=Rn(()=>{P.clear(),p.current.insideReactTree=!1}),M=Rn(e=>{const t=p.current.floatingContext?.nodeId;return(g?dr(g.nodesRef.current,t):[]).some(t=>t.context?.open&&!t.context.dataRef.current[e])}),D=Rn(e=>gn(e,l.select("floatingElement"))||gn(e,l.select("domReferenceElement"))),N=Rn(e=>{s()&&l.setOpen(!1,yn(H,e.nativeEvent))}),j=Rn(e=>{if(!a||!n||!r||"Escape"!==e.key)return;if(k.current)return;if(!w&&M("__escapeKeyBubbles"))return;const t=function(e){return"nativeEvent"in e}(e)?e.nativeEvent:e,o=yn(Y,t);l.setOpen(!1,o),o.isCanceled||e.preventDefault(),w||o.isPropagationAllowed||e.stopPropagation()}),F=Rn(()=>{p.current.insideReactTree=!0,P.start(0,A)}),B=Rn(e=>{if(!a||!n||0!==e.button)return;const t=pn(e.nativeEvent);fn(l.select("floatingElement"),t)&&(x.current||(x.current=!0,E.current=!1))}),L=Rn(e=>{a&&n&&(e.defaultPrevented||e.nativeEvent.defaultPrevented)&&x.current&&(E.current=!0)});d.useEffect(()=>{if(!a||!n)return;p.current.__escapeKeyBubbles=w,p.current.__outsidePressBubbles=_;const e=new y,t=new y;function o(){C.current=!0,t.start(0,()=>{C.current=!1})}function i(){x.current=!1,E.current=!1}function s(){const e=R.current,t="pen"!==e&&e?e:"mouse",n=v(),r="function"==typeof n?n():n;return"string"==typeof r?r:r[t]}function c(e){const t=p.current.floatingContext?.nodeId,n=g&&dr(g.nodesRef.current,t).some(t=>gn(e,t.context?.elements.floating));return D(e)||n}function u(e){if(function(e){const t=s();return"intentional"===t&&"click"!==e.type||"sloppy"===t&&"click"===e.type}(e))return"click"===e.type||D(e)||(t.clear(),C.current=!1),void A();if(p.current.insideReactTree)return void A();const n=pn(e),r=`[${pr("inert")}]`,o=Jt(n)?n.getRootNode():null,i=Array.from((en(o)?o:Pn(l.select("floatingElement"))).querySelectorAll(r)),u=l.context.triggerElements;if(n&&(u.hasElement(n)||u.hasMatchingElement(e=>fn(e,n))))return;let a=Jt(n)?n:null;for(;a&&!sn(a);){const e=un(a);if(sn(e)||!Jt(e))break;a=e}if(!i.length||!Jt(n)||n.matches("html,body")||fn(n,l.select("floatingElement"))||!i.every(e=>!fn(a,e))){if(Zt(n)&&!("touches"in e)){const t=sn(n),r=cn(n),o=/auto|scroll/,i=t||o.test(r.overflowX),s=t||o.test(r.overflowY),c=i&&n.clientWidth>0&&n.scrollWidth>n.clientWidth,u=s&&n.clientHeight>0&&n.scrollHeight>n.clientHeight,l="rtl"===r.direction,a=u&&(l?e.offsetX<=n.offsetWidth-n.clientWidth:e.offsetX>n.clientWidth),d=c&&e.offsetY>n.clientHeight;if(a||d)return}if(!c(e))return"intentional"===s()&&C.current?(t.clear(),void(C.current=!1)):void(("function"!=typeof m||m(e))&&(M("__outsidePressBubbles")||(l.setOpen(!1,yn(U,e)),A())))}}function d(e){if("sloppy"!==s()||!l.select("open")||!n||D(e))return;const t=e.touches[0];t&&(I.current={startTime:Date.now(),startX:t.clientX,startY:t.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},T.start(1e3,()=>{I.current&&(I.current.dismissOnTouchEnd=!1,I.current.dismissOnMouseDown=!1)}))}function h(e,t){const n=pn(e);if(!n)return;const r=wn(n,e.type,()=>{t(e),r()})}function S(e){T.clear(),"pointerdown"===e.type&&(R.current=e.pointerType),"mousedown"===e.type&&I.current&&!I.current.dismissOnMouseDown||h(e,e=>{"pointerdown"===e.type?function(e){"sloppy"===s()&&"touch"!==e.pointerType&&l.select("open")&&n&&!D(e)&&u(e)}(e):u(e)})}function P(e){if(!x.current)return;const n=E.current;i(),"intentional"===s()&&("pointercancel"!==e.type?c(e)||(n?o():("function"!=typeof m||m(e))&&(t.clear(),C.current=!0,A())):n&&o())}function N(e){if("sloppy"!==s()||!I.current||D(e))return;const t=e.touches[0];if(!t)return;const n=Math.abs(t.clientX-I.current.startX),r=Math.abs(t.clientY-I.current.startY),o=Math.sqrt(n*n+r*r);o>5&&(I.current.dismissOnTouchEnd=!0),o>10&&(u(e),T.clear(),I.current=null)}function F(e){"sloppy"===s()&&I.current&&!D(e)&&(I.current.dismissOnTouchEnd&&u(e),T.clear(),I.current=null)}const B=Pn(f),L=_n(r&&_n(wn(B,"keydown",j),wn(B,"compositionstart",function(){e.clear(),k.current=!0}),wn(B,"compositionend",function(){e.start(O?5:0,()=>{k.current=!1})})),b&&_n(wn(B,"click",S,!0),wn(B,"pointerdown",S,!0),wn(B,"pointerup",P,!0),wn(B,"pointercancel",P,!0),wn(B,"mousedown",S,!0),wn(B,"mouseup",P,!0),wn(B,"touchstart",function(e){R.current="touch",h(e,d)},!0),wn(B,"touchmove",function(e){h(e,N)},!0),wn(B,"touchend",function(e){h(e,F)},!0)));return()=>{L(),e.clear(),t.clear(),i(),C.current=!1}},[p,f,r,b,m,a,n,w,_,j,A,v,M,D,g,l,T]),d.useEffect(A,[m,A]);const W=d.useMemo(()=>({onKeyDown:j,onPointerDown:N,onClick:N}),[j,N]),$=d.useMemo(()=>({onKeyDown:j,onPointerDown:L,onMouseDown:L,onClickCapture:F,onMouseDownCapture(e){F(),B(e)},onPointerDownCapture(e){F(),B(e)},onMouseUpCapture:F,onTouchEndCapture:F,onTouchMoveCapture:F}),[j,F,B,L]);return d.useMemo(()=>n?{reference:W,floating:$,trigger:W}:{},[n,W,$])}function qr(e){const t=d.useRef(!0);t.current&&(t.current=!1,e())}function Yr(e,t,n,r,o){return $e(e,t,n,r,o)}function Xr(e,t,n,r,o){const i=g;if(!i)return function(e,t,n,r,o){const i=d.useCallback(()=>t(e.getSnapshot(),n,r,o),[e,t,n,r,o]);return(0,We.useSyncExternalStore)(e.subscribe,i,i)}(e,t,n,r,o);const s=i.syncIndex;let c;return i.syncIndex+=1,i.didInitialize?(c=i.syncHooks[s],c.store===e&&c.selector===t&&Object.is(c.a1,n)&&Object.is(c.a2,r)&&Object.is(c.a3,o)||(c.store!==e&&(i.didChangeStore=!0),c.store=e,c.selector=t,c.a1=n,c.a2=r,c.a3=o,c.value=t(e.getSnapshot(),n,r,o))):(c={store:e,selector:t,a1:n,a2:r,a3:o,value:t(e.getSnapshot(),n,r,o)},i.syncHooks.push(c)),c.value}function zr(e,t,n,r,o){return(0,He.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,o))}function Vr(e){const{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:o,nested:i,onOpenChange:s}=e,c=t.useState("open"),u=t.useState("activeTriggerElement"),l=t.useState(n?"popupElement":"positionerElement"),a=t.context.triggerElements,f=s,p=d.useRef(null);void 0===r&&null===p.current&&(p.current=new Xe({open:c,transitionStatus:void 0,referenceElement:u,floatingElement:l,triggerElements:a,onOpenChange:f,floatingId:o,syncOnly:!0,nested:i}));const g=r??p.current;return t.useSyncedValue("floatingId",o),m(()=>{const e={open:c,floatingId:o,referenceElement:u,floatingElement:l};Jt(u)&&(e.domReferenceElement=u),g.state.positionReference===g.state.referenceElement&&(e.positionReference=u),g.update(e)},[c,o,u,l,g]),g.context.onOpenChange=f,g.context.nested=i,g}function Kr(e,t=!1,n=!1){const[r,o]=d.useState(e&&t?"idle":void 0),[i,s]=d.useState(e);return e&&!i&&(s(!0),o("starting")),e||!i||"ending"===r||n||o("ending"),e||i||"ending"!==r||o(void 0),m(()=>{if(!e&&i&&"ending"!==r&&n){const e=J.request(()=>{o("ending")});return()=>{J.cancel(e)}}},[e,i,r,n]),m(()=>{if(!e||t)return;const n=J.request(()=>{o(void 0)});return()=>{J.cancel(n)}},[t,e]),m(()=>{if(!e||!t)return;e&&i&&"idle"!==r&&o("starting");const n=J.request(()=>{o("idle")});return()=>{J.cancel(n)}},[t,e,i,r]),{mounted:i,setMounted:s,transitionStatus:r}}function Gr(e,t=!1,n=!0){const r=On();return Rn((o,i=null)=>{r.cancel();const s=jr(e);if(null==s)return;const c=s,u=()=>{Re.flushSync(o)};if("function"!=typeof c.getAnimations||globalThis.BASE_UI_ANIMATIONS_DISABLED)o();else{if(t){const e=ze.startingStyle;if(!c.hasAttribute(e))return void r.request(l);const t=new MutationObserver(()=>{c.hasAttribute(e)||(t.disconnect(),l())});return t.observe(c,{attributes:!0,attributeFilter:[e]}),void i?.addEventListener("abort",()=>t.disconnect(),{once:!0})}r.request(l)}function l(){Promise.all(c.getAnimations().map(e=>e.finished)).then(()=>{i?.aborted||u()}).catch(()=>{if(n)return void(i?.aborted||u());const e=c.getAnimations();!i?.aborted&&e.length>0&&e.some(e=>e.pending||"finished"!==e.playState)&&l()})}})}function Qr(e){const{enabled:t=!0,open:n,ref:r,onComplete:o}=e,i=Rn(o),s=Gr(r,n,!1);d.useEffect(()=>{if(!t)return;const e=new AbortController;return s(i,e.signal),()=>{e.abort()}},[t,n,i,s])}function Jr(e){return t=>"touch"!==t||e.current}function Zr(e,t,n=!1){const r=vr(),o=null!=Ne(),i=d.useRef(null);void 0===e&&null===i.current&&(i.current=t(r,o));const s=e??i.current;return Vr({popupStore:s,treatPopupAsFloatingElement:n,floatingRootContext:s.state.floatingRootContext,floatingId:r,nested:o,onOpenChange:s.setOpen}),{store:s,internalStore:i.current}}function eo(e,t,n,r=!1){t?e.preventUnmountingOnClose=!1:r&&(e.preventUnmountingOnClose=!0);const o=n?.id??null;(o||t)&&(e.activeTriggerId=o,e.activeTriggerElement=n??null)}function to(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function no(e,t={}){const{closeOnActiveTriggerUnmount:n=!1}=t,r=e.useState("open");m(()=>{if(!r)return void(0!==e.state.triggerCount&&e.set("triggerCount",0));const t=e.context.triggerElements.size,o={};e.state.triggerCount!==t&&(o.triggerCount=t);const i=e.select("activeTriggerId");let s=null;if(i){const t=e.context.triggerElements.getById(i);t?t!==e.state.activeTriggerElement&&(o.activeTriggerElement=t):s=i}if(!s&&!i&&1===t){const t=e.context.triggerElements.entries().next();if(!t.done){const[e,n]=t.value;o.activeTriggerId=e,o.activeTriggerElement=n}}void 0===o.triggerCount&&void 0===o.activeTriggerId&&void 0===o.activeTriggerElement||e.update(o),s&&n&&queueMicrotask(()=>{if(e.select("open")&&e.select("activeTriggerId")===s&&!e.context.triggerElements.getById(s)){const t=yn(W);e.setOpen(!1,t),t.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[r,e,e.useState("triggerCount"),n])}function ro(e,t,n){const{mounted:r,setMounted:o,transitionStatus:i}=Kr(e),s=t.useState("preventUnmountingOnClose"),c=!e&&s;t.useSyncedValues({mounted:r,transitionStatus:i,preventUnmountingOnClose:c});const u=Rn(()=>{o(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)});return Qr({enabled:r&&!e&&!c,open:e,ref:t.context.popupRef,onComplete(){e||u()}}),{forceUnmount:u,transitionStatus:i}}function oo(e,t){e.useSyncedValues(t),m(()=>()=>{e.update({activeTriggerProps:L,inactiveTriggerProps:L,popupProps:L})},[e])}function io(e,t){m(()=>{t||null===e.state.openMethod||e.set("openMethod",null)},[t,e]),m(()=>()=>{null!==e.state.openMethod&&e.set("openMethod",null)},[e])}function so(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new Xe({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:new Je,floatingId:void 0,syncOnly:!1,nested:!1,onOpenChange:void 0}),floatingId:void 0,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:L,inactiveTriggerProps:L,popupProps:L}}function co(e,t,n=!1){return new Xe({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0})}function uo(e,t){return void 0!==t&&et(e)&&Ze(e)===t}function lo(e){return vr(e,"base-ui")}function ao(e){return yr(19)?e:e?"true":void 0}function fo(e){const t=d.useContext(ft);if(!1===e&&void 0===t)throw new Error(b(27));return t}function po(e,t,n){const r="left"===n?"offsetLeft":"offsetTop";let o=0;for(;t.offsetParent&&(o+=t[r],t.offsetParent!==e);)t=t.offsetParent;return o}function go(e){const t=getComputedStyle(e);return{scrollMarginTop:parseFloat(t.scrollMarginTop)||0,scrollMarginRight:parseFloat(t.scrollMarginRight)||0,scrollMarginBottom:parseFloat(t.scrollMarginBottom)||0,scrollMarginLeft:parseFloat(t.scrollMarginLeft)||0,scrollPaddingTop:parseFloat(t.scrollPaddingTop)||0,scrollPaddingRight:parseFloat(t.scrollPaddingRight)||0,scrollPaddingBottom:parseFloat(t.scrollPaddingBottom)||0,scrollPaddingLeft:parseFloat(t.scrollPaddingLeft)||0}}function ho(e){const t=Pn(e),n=t.documentElement,r=t.body,o=Kt(n);let i=0,s=0,c=!1;const u=J.create();if(O&&1!==(o.visualViewport?.scale??1))return()=>{};function l(){const t=o.getComputedStyle(n),u=o.getComputedStyle(r),l=(t.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";i=n.scrollTop,s=n.scrollLeft,It={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},Ot=n.style.scrollBehavior,Tt={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 a=n.scrollHeight>n.clientHeight,d=n.scrollWidth>n.clientWidth,f="scroll"===t.overflowY||"scroll"===u.overflowY,p="scroll"===t.overflowX||"scroll"===u.overflowX,g=Math.max(0,o.innerWidth-r.clientWidth),h=Math.max(0,o.innerHeight-r.clientHeight),m=parseFloat(u.marginTop)+parseFloat(u.marginBottom),b=parseFloat(u.marginLeft)+parseFloat(u.marginRight),v=tn(n)?n:r;if(c=function(e){if("undefined"==typeof CSS||!CSS.supports||!CSS.supports("scrollbar-gutter","stable")||"undefined"==typeof document)return!1;const t=Pn(e),n=t.documentElement,r=t.body,o=tn(n)?n:r,i=o.style.overflowY,s=n.style.scrollbarGutter;n.style.scrollbarGutter="stable",o.style.overflowY="scroll";const c=o.offsetWidth;o.style.overflowY="hidden";const u=o.offsetWidth;return o.style.overflowY=i,n.style.scrollbarGutter=s,c===u}(e),c)return n.style.scrollbarGutter=l,v.style.overflowY="hidden",void(v.style.overflowX="hidden");Object.assign(n.style,{scrollbarGutter:l,overflowY:"hidden",overflowX:"hidden"}),(a||f)&&(n.style.overflowY="scroll"),(d||p)&&(n.style.overflowX="scroll"),Object.assign(r.style,{position:"relative",height:m||h?`calc(100dvh - ${m+h}px)`:"100dvh",width:b||g?`calc(100vw - ${b+g}px)`:"100vw",boxSizing:"border-box",overflow:"hidden",scrollBehavior:"unset"}),r.scrollTop=i,r.scrollLeft=s,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function a(){Object.assign(n.style,It),Object.assign(r.style,Tt),c||(n.scrollTop=i,n.scrollLeft=s,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=Ot)}l();const d=wn(o,"resize",function(){a(),u.request(l)});return()=>{u.cancel(),a(),"function"==typeof o.removeEventListener&&d()}}function mo(e=!0,t=null){m(()=>{if(e)return Pt.acquire(t)},[e,t])}function bo({store:e,parentContext:t,isDrawer:n}){const r=e.useState("open"),o=e.useState("disablePointerDismissal"),i=e.useState("modal"),s=e.useState("popupElement"),c=e.useState("floatingRootContext"),[u,l]=d.useState(0),[a,f]=d.useState(0),p=0===u,g=Ur(c,{outsidePressEvent:()=>e.context.internalBackdropRef.current||e.context.backdropRef.current?"intentional":{mouse:"trap-focus"===i?"sloppy":"intentional",touch:"sloppy"},outsidePress(t){if(!e.context.outsidePressEnabledRef.current)return!1;if("button"in t&&0!==t.button)return!1;if("touches"in t&&1!==t.touches.length)return!1;const n=pn(t);return!(!p||o)&&(!i||!e.context.internalBackdropRef.current&&!e.context.backdropRef.current||e.context.internalBackdropRef.current===n||e.context.backdropRef.current===n||fn(n,s)&&!n?.hasAttribute("data-base-ui-portal"))},escapeKey:p});return mo(r&&!0===i,s),e.useContextCallback("onNestedDialogOpen",(e,t)=>{l(e),f(t)}),e.useContextCallback("onNestedDialogClose",()=>{l(0),f(0)}),d.useEffect(()=>(t?.onNestedDialogOpen&&r&&t.onNestedDialogOpen(u+1,a+(n?1:0)),t?.onNestedDialogClose&&!r&&t.onNestedDialogClose(),()=>{t?.onNestedDialogClose&&r&&t.onNestedDialogClose()}),[n,r,u,a,t]),oo(e,{activeTriggerProps:g.reference??L,inactiveTriggerProps:g.trigger??L,popupProps:g.floating??L,nestedOpenDialogCount:u,nestedOpenDrawerCount:a}),null}function vo(e,t="dialog"){const{children:n,open:r,defaultOpen:o=!1,onOpenChange:i,onOpenChangeComplete:s,disablePointerDismissal:c=!1,modal:u=!0,actionsRef:l,handle:a,triggerId:f,defaultTriggerId:p=null}=e,g="drawer"===t,h="alert-dialog"===t,m=!!h||u,b=h||c,v=h?"alertdialog":"dialog",y=fo(!0),w={modal:m,disablePointerDismissal:b,nested:Boolean(y),role:v},_=Mt.useStore(a?.store,{open:o,openProp:r,activeTriggerId:p,triggerIdProp:f,...w});qr(()=>{const e=void 0===r&&!1===_.state.open&&!0===o?{open:!0,activeTriggerId:p}:null;h?_.update(e?{...w,...e}:w):e&&_.update(e)}),_.useControlledProp("openProp",r),_.useControlledProp("triggerIdProp",f),_.useSyncedValues(w),_.useContextCallback("onOpenChange",i),_.useContextCallback("onOpenChangeComplete",s);const S=_.useState("open"),x=_.useState("mounted"),E=_.useState("payload");!function(e){const{store:t,actionsRef:n}=e,r=t.useState("open");io(t,r),no(t);const{forceUnmount:o}=ro(r,t),i=d.useCallback(()=>{t.setOpen(!1,yn(X))},[t]);d.useImperativeHandle(n,()=>({unmount:o,close:i}),[o,i])}({store:_,actionsRef:l});const C=S||x,k=d.useMemo(()=>({store:_}),[_]);return(0,te.jsx)(dt.Provider,{value:!1,children:(0,te.jsxs)(ft.Provider,{value:k,children:[C&&(0,te.jsx)(bo,{store:_,parentContext:y?.store.context,isDrawer:g}),"function"==typeof n?n({payload:E}):n]})})}return e({$n:function(e){return Jt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}},A:so,At:function(e,t){return $n(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})},B:function(e,t,n,r){qr(()=>{void 0===t&&!1===e.state.open&&n&&(e.state={...e.state,open:!0,activeTriggerId:r,preventUnmountingOnClose:!1})})},Bn:function(e){if(!e||A)return!0;try{return e.matches(":focus-visible")}catch(t){return!0}},Bt:Fn,Cr:$t,Ct:dr,Dr:Ft,Dt:lr,Et:function(e){return ur(e,-1)},F:function(e,t,n,r={}){const o=n.reason,i=o===$,s=t&&"trigger-focus"===o,c=!t&&("trigger-press"===o||"escape-key"===o),u=to(n);if(e.context.onOpenChange?.(t,n),n.isCanceled)return;r.onBeforeDispatch?.(),e.state.floatingRootContext.dispatchOpenChange(t,n);const l=()=>{const o={...r.extraState,open:t};s?o.instantType="focus":c?o.instantType="dismiss":i&&(o.instantType=void 0),eo(o,t,n.trigger,u()),e.update(o)};i?Re.flushSync(l):l()},Fn:bn,Ft:function(e,t,n){return oe(e,re(t,n))},G:function(e,t,n,r){const o=n.useState("isMountedByTrigger",e),i=function(e,t){const n=d.useRef(null),r=d.useRef(null);return d.useCallback(o=>{if(void 0===e)return;let i=!1;if(null!==n.current){const e=n.current,o=r.current,s=t.context.triggerElements.getById(e);o&&s===o&&(t.context.triggerElements.delete(e),i=!0),n.current=null,r.current=null}if(null!==o&&(n.current=e,r.current=o,t.context.triggerElements.add(e,o),i=!0),i){const e=t.context.triggerElements.size;t.select("open")&&t.state.triggerCount!==e&&t.set("triggerCount",e)}},[t,e])}(e,n),s=Rn(t=>{if(i(t),!t)return;const o=n.select("open"),s=n.select("activeTriggerId");s!==e?null==s&&o&&n.update({activeTriggerId:e,activeTriggerElement:t,...r}):n.update({activeTriggerElement:t,...o?r:null})});return m(()=>{o&&n.update({activeTriggerElement:t.current,...r})},[o,n,t,...Object.values(r)]),{registerTrigger:s,isMountedByThisTrigger:o}},Gt:function(e,t,n,r){const o=Mn(e);let i=function(e,t,n){switch(e){case"top":case"bottom":return n?t?ue:ce:t?ce:ue;case"left":case"right":return t?le:ae;default:return[]}}(An(e),"start"===n,r);return o&&(i=i.map(e=>e+"-"+o),t&&(i=i.concat(i.map(Bn)))),i},H:oo,Hn:fn,Ht:Nn,I:to,In:function(e){return null!=e?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${B}`)},Jn:cn,Jt:An,K:Qr,Kt:Ln,L:Jr,Ln:function(e,t){if(!Jt(e))return!1;const n=e;if(t.hasElement(n))return!n.hasAttribute("data-trigger-disabled");for(const[,r]of t.entries())if(fn(r,n))return!r.hasAttribute("data-trigger-disabled");return!1},Lt:function(e,t){return"function"==typeof e?e(t):e},Mt:qn,Nt:Hn,Or:function(e){return d.forwardRef(Ft(e))},Ot:$n,Pn:vn,Pt:Un,Qn:Vt,Qt:function(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}},R:eo,Rn:mn,S:function(e,t,n,r){if(!e||!t||!t.scrollTo)return;let o=e.scrollLeft,i=e.scrollTop;const s=e.clientWidth<e.scrollWidth,c=e.clientHeight<e.scrollHeight;if(s&&"vertical"!==r){const r=po(e,t,"left"),i=go(e),s=go(t);"ltr"===n&&(r+t.offsetWidth+s.scrollMarginRight>e.scrollLeft+e.clientWidth-i.scrollPaddingRight?o=r+t.offsetWidth+s.scrollMarginRight-e.clientWidth+i.scrollPaddingRight:r-s.scrollMarginLeft<e.scrollLeft+i.scrollPaddingLeft&&(o=r-s.scrollMarginLeft-i.scrollPaddingLeft)),"rtl"===n&&(r-s.scrollMarginRight<e.scrollLeft+i.scrollPaddingLeft?o=r-s.scrollMarginLeft-i.scrollPaddingLeft:r+t.offsetWidth+s.scrollMarginRight>e.scrollLeft+e.clientWidth-i.scrollPaddingRight&&(o=r+t.offsetWidth+s.scrollMarginRight-e.clientWidth+i.scrollPaddingRight))}if(c&&"horizontal"!==r){const n=po(e,t,"top"),r=go(e),o=go(t);n-o.scrollMarginTop<e.scrollTop+r.scrollPaddingTop?i=n-o.scrollMarginTop-r.scrollPaddingTop:n+t.offsetHeight+o.scrollMarginBottom>e.scrollTop+e.clientHeight-r.scrollPaddingBottom&&(i=n+t.offsetHeight+o.scrollMarginBottom-e.clientHeight+r.scrollPaddingBottom)}e.scrollTo({left:o,top:i,behavior:"auto"})},Sr:Ut,St:pr,T:lo,Tt:function(e){return ur(e,1)},U:io,Un:pn,Ut:function(e){const t=Ln(e);return[Bn(e),t,Bn(t)]},V:ro,Vn:dn,Vt:function(e,t,n){void 0===n&&(n=!1);const r=Mn(e),o=Fn(e),i=Nn(o);let s="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=Ln(s)),[s,Ln(s)]},W:Zr,Wt:Dn,X:Vr,Xn:Gt,Y:Kr,Yn:function(e){let t=un(e);for(;Zt(t)&&!sn(t);){if(rn(t))return t;if(nn(t))return null;t=un(t)}return null},Yt:jn,Zn:an,_t:Mr,an:On,ar:Zt,at:function(e){const{children:t,id:n}=e,r=Ne();return(0,te.jsx)(Me.Provider,{value:d.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})},bt:vr,cn:Sn,cr:function(e){return/^(table|td|th)$/.test(Vt(e))},dn:yn,dr:function(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)},er:function e(t,n,r){var o;void 0===n&&(n=[]),void 0===r&&(r=!0);const i=ln(t),s=i===(null==(o=t.ownerDocument)?void 0:o.body),c=Kt(i);if(s){const t=an(c);return n.concat(c,c.visualViewport||[],tn(i)?i:[],t&&r?e(t):[])}return n.concat(i,e(i,[],r))},et:Yr,fn:function(e,t,n){const r=n??L;return{reason:e,event:t??new Event("base-ui"),...r}},fr:Yt,ft:Dr,i:mo,in:Pn,ir:Jt,it:Hr,j:co,jt:function(e,t){return $n(e.current,{disabledIndices:t})},kr:jt,kt:function(e,{event:t,orientation:n,loopFocus:r,onLoop:o,rtl:i,cols:s,disabledIndices:c,minIndex:u,maxIndex:l,prevIndex:a,stopEvent:d=!1}){let f,p=a;if("ArrowUp"===t.key?f="up":"ArrowDown"===t.key&&(f="down"),f){const n=[],i=[];let g=!1,h=0;{let t=null,r=-1;e.forEach((e,o)=>{if(null==e)return;h+=1;const s=e.closest('[role="row"]');s&&(g=!0),s===t&&-1!==r||(t=s,r+=1,n[r]=[]),n[r].push(o),i[o]=r})}let m=!1,b=0;if(g)for(const e of n){const t=e.length;t>b&&(b=t),t!==s&&(m=!0)}const v=m&&h<e.length,y=b||s,w=s=>{if(!m||-1===a)return;const u=i[a];if(null==u)return;const l=n[u].indexOf(a),d="up"===s?-1:1;for(let f=u+d,p=0;p<n.length;p+=1,f+=d){if(f<0||f>=n.length){if(!r||v)return;if(f=f<0?n.length-1:0,o){const e=Math.min(l,n[f].length-1);f=i[o(t,a,n[f][e]??n[f][0])]??f}}const s=n[f];for(let t=Math.min(l,s.length-1);t>=0;t-=1){const n=s[t];if(!Un(e,n,c))return n}}},_=t=>{if(!v||-1===a)return;const n=a%y,o="up"===t?-y:y,i=l-l%y,s=ie(l/y)+1;for(let u=a-n+o,d=0;d<s;d+=1,u+=o){if(u<0||u>l){if(!r)return;u=u<0?i:0}const t=Math.min(u+y-1,l);for(let r=Math.min(u+n,t);r>=u;r-=1)if(!Un(e,r,c))return r}};d&&qt(t);const S=w(f)??_(f);if(void 0!==S)p=S;else if(-1===a)p="up"===f?l:u;else if(p=$n(e,{startingIndex:a,amount:y,decrement:"up"===f,disabledIndices:c}),r){if("up"===f&&(a-y<u||p<0)){const e=a%y,n=l%y,r=l-(n-e);p=n===e?l:n>e?r:r-y,o&&(p=o(t,a,p))}"down"===f&&a+y>l&&(p=$n(e,{startingIndex:a%y-y,amount:y,disabledIndices:c}),o&&(p=o(t,a,p)))}Hn(e,p)&&(p=a)}if("both"===n){const n=ie(a/s);t.key===(i?"ArrowLeft":"ArrowRight")&&(d&&qt(t),a%s!==s-1?(p=$n(e,{startingIndex:a,disabledIndices:c}),r&&Wn(p,s,n)&&(p=$n(e,{startingIndex:a-a%s-1,disabledIndices:c}),o&&(p=o(t,a,p)))):r&&(p=$n(e,{startingIndex:a-a%s-1,disabledIndices:c}),o&&(p=o(t,a,p))),Wn(p,s,n)&&(p=a)),t.key===(i?"ArrowRight":"ArrowLeft")&&(d&&qt(t),a%s!==0?(p=$n(e,{startingIndex:a,decrement:!0,disabledIndices:c}),r&&Wn(p,s,n)&&(p=$n(e,{startingIndex:a+(s-a%s),decrement:!0,disabledIndices:c}),o&&(p=o(t,a,p)))):r&&(p=$n(e,{startingIndex:a+(s-a%s),decrement:!0,disabledIndices:c}),o&&(p=o(t,a,p))),Wn(p,s,n)&&(p=a));const u=ie(l/s)===n;Hn(e,p)&&(r&&u?(p=t.key===(i?"ArrowRight":"ArrowLeft")?l:$n(e,{startingIndex:a-a%s-1,disabledIndices:c}),o&&(p=o(t,a,p))):p=a)}return p},ln:_n,lr:nn,mr:qt,nr:Kt,nt:qr,on:Rn,or:sn,ot:function(e){const{children:t,externalTree:n}=e,r=jt(()=>n??new Ae).current;return(0,te.jsx)(De.Provider,{value:r,children:t})},pr:Xt,q:Gr,qt:function(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}},r:function(e){return vo(e,d.useContext(dt)?"drawer":"dialog")},rr:rn,rt:Ur,sn:Cn,sr:tn,st:function(e){const t=vr(),n=je(e),r=Ne();return m(()=>{if(!t)return;const e={id:t,parentId:r};return n?.addNode(e),()=>{n?.removeNode(e)}},[n,t,r]),t},tr:un,un:wn,ur:on,vt:Or,w:ao,wr:Lt,wt:sr,x:function(e){return!(!function(e){return Zt(e)&&"INPUT"===e.tagName}(e)||null==e.selectionStart)||!(!Zt(e)||"TEXTAREA"!==e.tagName)},xt:gr,yt:Sr,z:no,zn:hn,zt:Mn}),{setters:[function(e){n=e.a,r=e.n,o=e.t},function(e){i=e.$t,s=e.Qt,c=e.en},function(e){u=e.K,l=e.Tt}],execute:function(){var t,j,jt;(a=document.createElement("style")).textContent="._blink_150ot_1{animation:1s step-start infinite _blink_150ot_1}@keyframes _blink_150ot_1{0%{opacity:1}50%{opacity:.2}}._fourtyfive_150ot_13{transform:rotate(45deg)}._mirror_150ot_17{transform:rotate(180deg)}._subtle_150ot_21{color:#779be7;background:#303030;line-height:1em}._subtle_150ot_21:hover:not(:disabled):not(:active){color:#578af4;background:#404040}._subtle_150ot_21:active:not(:disabled){background:#2d2d2d;border-color:#202020}._subtle-white_150ot_35{color:#f6f6f6;background:#303030}._subtle-white_150ot_35:hover:not(:disabled):not(:active){color:#f6f6f6;background:#404040}._subtle-white_150ot_35:active:not(:disabled){background:#2d2d2d;border-color:#202020}._subtle-white_150ot_35:disabled{background:#303030}._primary_150ot_51{color:#f6f6f6;background:#2b5abc}._primary_150ot_51:hover:not(:disabled):not(:active){background:#3e75e8}._primary_150ot_51:active:not(:disabled){background:#0a43b9;border-color:#0036a6}._primary_150ot_51:disabled{opacity:.6}._destructive_150ot_66{color:#f6f6f6;background:#d20300}._destructive_150ot_66:hover:not(:disabled):not(:active){color:#f6f6f6;background:#ed3333}._destructive_150ot_66:active:not(:disabled){background:#c10000;border-color:#b20000}._subtle-destructive_150ot_79{color:#ff7878;background:#303030}._subtle-destructive_150ot_79:hover:not(:disabled):not(:active){color:#fa5656;background:#404040}._subtle-destructive_150ot_79:active:not(:disabled){background:#2d2d2d;border-color:#202020}._ghosted_150ot_92{color:#578af4;background:0 0}._ghosted_150ot_92:hover:not(:disabled):not(:active){color:#578af4;background:#404040}._ghosted_150ot_92:active:not(:disabled){background:#2d2d2d;border-color:#202020}._ghosted_150ot_92:disabled{opacity:.4}._ghosted-white_150ot_108{color:#f6f6f6;background:0 0}._ghosted-white_150ot_108:hover:not(:disabled):not(:active){color:#f6f6f6;background:#404040}._ghosted-white_150ot_108:active:not(:disabled){background:#2d2d2d;border-color:#202020}._ghosted-white_150ot_108:disabled{opacity:.4}._ghosted-destructive_150ot_124{color:#fa5656;background:0 0}._ghosted-destructive_150ot_124:hover:not(:disabled):not(:active){color:#fa5656;background:#404040}._ghosted-destructive_150ot_124:active:not(:disabled){background:#2d2d2d;border-color:#202020}._ghosted-destructive_150ot_124:disabled{opacity:.4}._baseButton_150ot_140{white-space:nowrap;cursor:pointer;border:1px solid transparent;border-radius:3px;justify-content:center;align-items:center;gap:.5em;width:fit-content;padding-left:1em;padding-right:1em;display:flex;position:relative}._baseButton_150ot_140:disabled{opacity:.4;cursor:not-allowed}._baseButton_150ot_140:focus-visible{outline-offset:2px;outline:2px solid #578af4}._baseButton_150ot_140._loading_150ot_161{cursor:wait}._baseButton_150ot_140._loading_150ot_161 ._content_150ot_164{opacity:0}._content_150ot_164{align-items:center;gap:inherit;display:flex}._loadingOverlay_150ot_174{place-content:center;display:grid;position:absolute}._spinner_150ot_180{stroke-dasharray:8;animation:1s linear infinite _spin_150ot_180}@keyframes _spin_150ot_180{to{transform:rotate(360deg)}}._small_150ot_190{height:1.5rem;font-size:calc(1rem - 3px)}._medium_150ot_195{height:2rem;font-size:calc(1rem - 2px)}._large_150ot_200{height:2.5rem;font-weight:600}._xlarge_150ot_205{height:3rem;font-weight:600}._fluid_150ot_210{width:100%}\n/*$vite$:1*/",document.head.appendChild(a),function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};e.SENTRY_RELEASE={id:"f14ad0099eab1969fdd065b56af5fdd3cf530de6"};var t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="cd9a4a2b-78e7-4c45-8f75-143044048ea0",e._sentryDebugIdIdentifier="sentry-dbid-cd9a4a2b-78e7-4c45-8f75-143044048ea0")}catch(e){}}(),d=n(r(),1),f={},p=[],g=void 0,h=()=>{},e("Er",m="undefined"!=typeof document?d.useLayoutEffect:h),e("Tr",(t="https://base-ui.com/production-error",j="Base UI",b=function(e,...n){const r=new URL(t);return r.searchParams.set("code",e.toString()),n.forEach(e=>r.searchParams.append("args[]",e)),`${j} error #${e}; visit ${r} for the full message.`})),v=[],e("xr",y=class e{constructor(){$t(this,"currentId",0),$t(this,"clear",()=>{0!==this.currentId&&(clearTimeout(this.currentId),this.currentId=0)}),$t(this,"disposeEffect",()=>this.clear)}static create(){return new e}start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=0,t()},e)}isStarted(){return 0!==this.currentId}}),({userAgent:w,platform:_,maxTouchPoints:S}="undefined"==typeof navigator?{userAgent:"",platform:"",maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??0}),x=w.toLowerCase(),E=_.toLowerCase(),e("yr",C=/^i(os$|p)/.test(E)||"macintel"===E&&S>1),e("vr",R=E===(k="android")||x.includes(k)),e("br",I=!C&&E.startsWith("mac")),E.startsWith("win"),!R&&/^(linux|chrome os)/.test(E),T=I||C,e("_r",O="undefined"!=typeof CSS&&!!CSS.supports?.("-webkit-backdrop-filter:none")),e("gr",!O&&x.includes("firefox")),!O&&x.includes("chrom"),P=T,e("hr",A=/jsdom|happydom/.test(x)),M=/transform|translate|scale|rotate|perspective|filter/,D=/paint|layout|strict|content/,N=e=>!!e&&"none"!==e,F="data-base-ui-focusable",B="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",e("Gn","ArrowLeft"),e("Kn","ArrowRight"),e("qn","ArrowUp"),e("Wn","ArrowDown"),e("Mn",Object.freeze([])),e("Nn",L=Object.freeze({})),e("wn",W="none"),e("An",H="trigger-press"),e("kn",$="trigger-hover"),e("On","trigger-focus"),e("Tn",U="outside-press"),e("Sn","item-press"),e("mn","close-press"),e("yn","input-change"),e("bn","input-clear"),e("xn","input-press"),e("_n",q="focus-out"),e("gn",Y="escape-key"),e("Cn","list-navigation"),e("En","pointer"),e("pn","cancel-open"),e("Dn","sibling-open"),e("hn","disabled"),e("vn",X="imperative-action"),e("jn","window-resize"),z={...d},V=z.useInsertionEffect,K=V&&V!==z.useLayoutEffect?V:e=>e(),G=null,globalThis.requestAnimationFrame,Q=new class{constructor(){$t(this,"callbacks",[]),$t(this,"callbacksCount",0),$t(this,"nextId",1),$t(this,"startId",1),$t(this,"isScheduled",!1),$t(this,"tick",e=>{this.isScheduled=!1;const t=this.callbacks,n=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,n>0)for(let r=0;r<t.length;r+=1)t[r]?.(e)})}request(e){const t=this.nextId;return this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1,this.isScheduled||(requestAnimationFrame(this.tick),this.isScheduled=!0),t}cancel(e){const t=e-this.startId;t<0||t>=this.callbacks.length||(this.callbacks[t]=null,this.callbacksCount-=1)}},J=class e{constructor(){$t(this,"currentId",G),$t(this,"cancel",()=>{this.currentId!==G&&(Q.cancel(this.currentId),this.currentId=G)}),$t(this,"disposeEffect",()=>this.cancel)}static create(){return new e}static request(e){return Q.request(e)}static cancel(e){return Q.cancel(e)}request(e){this.cancel(),this.currentId=Q.request(()=>{this.currentId=G,e()})}},Z={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},e("nn",ee={...Z,position:"fixed",top:0,left:0}),e("rn",{...Z,position:"absolute"}),te=o(),e("tn",ne=d.forwardRef(function(e,t){const[n,r]=d.useState();m(()=>{P&&O&&r("button")},[]);const o={tabIndex:0,role:n};return(0,te.jsx)("span",{...e,ref:t,style:ee,"aria-hidden":!n||void 0,...o,"data-base-ui-focus-guard":""})})),e("en",["top","right","bottom","left"]),e("Zt",re=Math.min),e("Xt",oe=Math.max),e("$t",Math.round),e("Rt",ie=Math.floor),e("It",e=>({x:e,y:e})),se={left:"right",right:"left",bottom:"top",top:"bottom"},ce=["left","right"],ue=["right","left"],le=["top","bottom"],ae=["bottom","top"],de='a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]',fe=0,pe={inert:new WeakMap,"aria-hidden":new WeakMap},ge="data-base-ui-inert",he={inert:new WeakSet,"aria-hidden":new WeakSet},me=new WeakMap,be=0,ve=(e,t)=>t.map(t=>{if(e.contains(t))return t;const n=hr(t);return e.contains(n)?n:null}).filter(e=>null!=e),ye=e=>{const t=new Set;return e.forEach(e=>{let n=e;for(;n&&!t.has(n);)t.add(n),n=n.parentNode}),t},we=(e,t,n)=>{const r=[],o=e=>{e&&!n.has(e)&&Array.from(e.children).forEach(e=>{"script"!==Vt(e)&&(t.has(e)?o(e):r.push(e))})};return o(e),r},_e=0,Se=z.useId,xe=parseInt("19.2.7",10),Ee={},Ce=Symbol.for("react.lazy"),e("mt",{style:{transition:"none"}}),e("pt","data-base-ui-click-trigger"),e("ht",{fallbackAxisSide:"none"}),e("gt",{fallbackAxisSide:"end"}),ke={clipPath:"inset(50%)",position:"fixed",top:0,left:0},Re=n(c(),1),Ie=d.createContext(null),Te=()=>d.useContext(Ie),Oe=pr("portal"),e("dt",Pe=d.forwardRef(function(e,t){const{render:n,className:r,style:o,children:i,container:s,renderGuards:c,...u}=e,{portalNode:l,portalSubtree:a}=Dr({container:s,ref:t,componentProps:e,elementProps:u}),f=d.useRef(null),p=d.useRef(null),g=d.useRef(null),h=d.useRef(null),[b,v]=d.useState(null),y=d.useRef(!1),w=b?.modal,_=b?.open,S="boolean"==typeof c?c:!!b&&!b.modal&&b.open&&!!l;d.useEffect(()=>{if(l&&!w)return _n(wn(l,"focusin",e,!0),wn(l,"focusout",e,!0));function e(e){l&&e.relatedTarget&&lr(e)&&("focusin"===e.type?y.current&&(ar(l),y.current=!1):(function(e){or(e).forEach(e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")})}(l),y.current=!0))}},[l,w]),m(()=>{l&&!0===_&&y.current&&(ar(l),y.current=!1)},[_,l]);const x=d.useMemo(()=>({beforeOutsideRef:f,afterOutsideRef:p,beforeInsideRef:g,afterInsideRef:h,portalNode:l,setFocusManagerState:v}),[l]);return(0,te.jsxs)(d.Fragment,{children:[a,(0,te.jsxs)(Ie.Provider,{value:x,children:[S&&l&&(0,te.jsx)(ne,{"data-type":"outside",ref:f,onFocus:e=>{lr(e,l)?g.current?.focus():cr(b?b.domReference:null)?.focus()}}),S&&l&&(0,te.jsx)("span",{"aria-owns":l.id,style:ke}),l&&Re.createPortal(i,l),S&&l&&(0,te.jsx)(ne,{"data-type":"outside",ref:p,onFocus:e=>{lr(e,l)?h.current?.focus():(sr(b?b.domReference:null)?.focus(),b?.closeOnFocusOut&&b?.onOpenChange(!1,yn("focus-out",e.nativeEvent)))}})]})]})})),e("ut",Ae=class{constructor(){$t(this,"nodesRef",{current:[]}),$t(this,"events",Nr())}addNode(e){this.nodesRef.current.push(e)}removeNode(e){const t=this.nodesRef.current.findIndex(t=>t===e);-1!==t&&this.nodesRef.current.splice(t,1)}}),Me=d.createContext(null),De=d.createContext(null),e("ct",Ne=()=>d.useContext(Me)?.id||null),e("lt",je=e=>{const t=d.useContext(De);return e??t}),Fe=20,Be=[],e("tt",Le=(e,t,n,r,o,i,...s)=>{if(s.length>0)throw new Error(b(1));let c;if(e&&t&&n&&r&&o&&i)c=(s,c,u,l)=>i(e(s,c,u,l),t(s,c,u,l),n(s,c,u,l),r(s,c,u,l),o(s,c,u,l),c,u,l);else if(e&&t&&n&&r&&o)c=(i,s,c,u)=>o(e(i,s,c,u),t(i,s,c,u),n(i,s,c,u),r(i,s,c,u),s,c,u);else if(e&&t&&n&&r)c=(o,i,s,c)=>r(e(o,i,s,c),t(o,i,s,c),n(o,i,s,c),i,s,c);else if(e&&t&&n)c=(r,o,i,s)=>n(e(r,o,i,s),t(r,o,i,s),o,i,s);else if(e&&t)c=(n,r,o,i)=>t(e(n,r,o,i),r,o,i);else{if(!e)throw new Error("Missing arguments");c=e}return c}),We=i(),He=n(s(),1),$e=yr(19)?Xr:zr,jt={before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){const r=e.syncHooks[n],o=r.selector(r.store.state,r.a1,r.a2,r.a3);Object.is(r.value,o)||(t=!0,r.value=o)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{const n=new Set;for(const o of e.syncHooks)n.add(o.store);const r=[];for(const e of n)r.push(e.subscribe(t));return()=>{for(const e of r)e()}}),(0,We.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}},p.push(jt),e("$",Ue=class{constructor(e){$t(this,"subscribe",e=>(this.listeners.add(e),()=>{this.listeners.delete(e)})),$t(this,"getSnapshot",()=>this.state),this.state=e,this.listeners=new Set,this.updateTick=0}setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;const t=this.updateTick;for(const n of this.listeners){if(t!==this.updateTick)return;n(e)}}update(e){for(const t in e)if(!Object.is(this.state[t],e[t]))return void this.setState({...this.state,...e})}set(e,t){Object.is(this.state[e],t)||this.setState({...this.state,[e]:t})}notifyAll(){const e={...this.state};this.setState(e)}use(e,t,n,r){return Yr(this,e,t,n,r)}}),e("Q",qe=class extends Ue{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}useSyncedValue(e,t){d.useDebugValue(e);const n=this;m(()=>{n.state[e]!==t&&n.set(e,t)},[n,e,t])}useSyncedValueWithCleanup(e,t){const n=this;m(()=>(n.state[e]!==t&&n.set(e,t),()=>{n.set(e,void 0)}),[n,e,t])}useSyncedValues(e){const t=this;m(()=>{t.update(e)},[t,...Object.values(e)])}useControlledProp(e,t){d.useDebugValue(e);const n=this,r=void 0!==t;m(()=>{r&&!Object.is(n.state[e],t)&&n.setState({...n.state,[e]:t})},[n,e,t,r])}select(e,t,n,r){return(0,this.selectors[e])(this.state,t,n,r)}useState(e,t,n,r){return d.useDebugValue(e),Yr(this,this.selectors[e],t,n,r)}useContextCallback(e,t){d.useDebugValue(e);const n=Rn(t??vn);this.context[e]=n}useStateSetter(e){const t=d.useRef(void 0);return void 0===t.current&&(t.current=t=>{this.set(e,t)}),t.current}observe(e,t){let n;n="function"==typeof e?e:this.selectors[e];let r=n(this.state);return t(r,r,this),this.subscribe(e=>{const o=n(e);if(!Object.is(r,o)){const e=r;r=o,t(o,e,this)}})}}),Ye={open:Le(e=>e.open),transitionStatus:Le(e=>e.transitionStatus),domReferenceElement:Le(e=>e.domReferenceElement),referenceElement:Le(e=>e.positionReference??e.referenceElement),floatingElement:Le(e=>e.floatingElement),floatingId:Le(e=>e.floatingId)},e("Z",Xe=class extends qe{constructor(e){const{syncOnly:t,nested:n,onOpenChange:r,triggerElements:o,...i}=e;super({...i,positionReference:i.referenceElement,domReferenceElement:i.referenceElement},{onOpenChange:r,dataRef:{current:{}},events:Nr(),nested:n,triggerElements:o},Ye),$t(this,"syncOpenEvent",(e,t)=>{(!e||!this.state.open||null!=t&&function(e){const t=e.type;return"click"===t||"mousedown"===t||"keydown"===t||"keyup"===t}(t))&&(this.context.dataRef.current.openEvent=e?t:void 0)}),$t(this,"dispatchOpenChange",(e,t)=>{this.syncOpenEvent(e,t.event);const n={open:e,reason:t.reason,nativeEvent:t.event,nested:this.context.nested,triggerElement:t.trigger};this.context.events.emit("openchange",n)}),$t(this,"setOpen",(e,t)=>{this.syncOnly||this.dispatchOpenChange(e,t),this.context.onOpenChange?.(e,t)}),this.syncOnly=t}}),ze=function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e}({}),Ve={[ze.startingStyle]:""},Ke={[ze.endingStyle]:""},e("J",Ge={transitionStatus:e=>"starting"===e?Ve:"ending"===e?Ke:null}),e("P",Qe={tabIndex:-1,[F]:""}),e("N",Je=class{constructor(){this.elementsSet=new Set,this.idMap=new Map}add(e,t){const n=this.idMap.get(e);n!==t&&(void 0!==n&&this.elementsSet.delete(n),this.elementsSet.add(t),this.idMap.set(e,t))}delete(e){const t=this.idMap.get(e);t&&(this.elementsSet.delete(t),this.idMap.delete(e))}hasElement(e){return this.elementsSet.has(e)}hasMatchingElement(e){for(const t of this.elementsSet)if(e(t))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}elements(){return this.elementsSet.values()}get size(){return this.idMap.size}}),Ze=Le(e=>e.triggerIdProp??e.activeTriggerId),et=Le(e=>e.openProp??e.open),tt=Le(e=>(e.popupElement?.id??e.floatingId)||void 0),e("M",nt={open:et,mounted:Le(e=>e.mounted),transitionStatus:Le(e=>e.transitionStatus),floatingRootContext:Le(e=>e.floatingRootContext),triggerCount:Le(e=>e.triggerCount),preventUnmountingOnClose:Le(e=>e.preventUnmountingOnClose),payload:Le(e=>e.payload),activeTriggerId:Ze,activeTriggerElement:Le(e=>e.mounted?e.activeTriggerElement:null),popupId:tt,isTriggerActive:Le((e,t)=>void 0!==t&&Ze(e)===t),isOpenedByTrigger:Le((e,t)=>uo(e,t)),isMountedByTrigger:Le((e,t)=>void 0!==t&&Ze(e)===t&&e.mounted),triggerProps:Le((e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps),triggerPopupId:Le((e,t)=>function(e,t){return!!uo(e,t)||void 0!==t&&et(e)&&null==Ze(e)&&1===e.triggerCount}(e,t)?tt(e):void 0),popupProps:Le(e=>e.popupProps),popupElement:Le(e=>e.popupElement),positionerElement:Le(e=>e.positionerElement)}),rt=function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=ze.startingStyle]="startingStyle",e[e.endingStyle=ze.endingStyle]="endingStyle",e.anchorHidden="data-anchor-hidden",e.side="data-side",e.align="data-align",e}({}),e("E",ot=function(e){return e.popupOpen="data-popup-open",e.pressed="data-pressed",e}({})),it={[ot.popupOpen]:""},st={[ot.popupOpen]:"",[ot.pressed]:""},ct={[rt.open]:""},ut={[rt.closed]:""},lt={[rt.anchorHidden]:""},e("k",{open:e=>e?it:null}),e("O",{open:e=>e?st:null}),e("D",at={open:e=>e?ct:ut,anchorHidden:e=>e?lt:null}),dt=d.createContext(!1),ft=d.createContext(void 0),pt={...at,...Ge},e("C",d.forwardRef(function(e,t){const{render:n,className:r,style:o,forceRender:i=!1,...s}=e,{store:c}=fo(),u=c.useState("open"),l=c.useState("nested"),a=c.useState("mounted");return Mr("div",e,{state:{open:u,transitionStatus:c.useState("transitionStatus")},ref:[c.context.backdropRef,t],stateAttributesMapping:pt,props:[{role:"presentation",hidden:!a,style:{userSelect:"none",WebkitUserSelect:"none"}},s],enabled:i||!l})})),gt=function(e){return e.nestedDialogs="--nested-dialogs",e}({}),ht=function(e){return e[e.open=rt.open]="open",e[e.closed=rt.closed]="closed",e[e.startingStyle=rt.startingStyle]="startingStyle",e[e.endingStyle=rt.endingStyle]="endingStyle",e.nested="data-nested",e.nestedDialogOpen="data-nested-dialog-open",e}({}),mt=d.createContext(void 0),e("f",bt="ArrowUp"),e("c",vt="ArrowDown"),e("u",yt="ArrowLeft"),e("d",wt="ArrowRight"),e("m",_t="Home"),e("h",St=new Set([yt,wt])),e("g",new Set([yt,wt,_t,"End"])),e("y",xt=new Set([bt,vt])),e("b",new Set([bt,vt,_t,"End"])),e("l",Et=new Set([...St,...xt])),e("p",Ct=new Set([...Et,_t,"End"])),e("v","Shift"),e("_",new Set(["Shift","Control","Alt","Meta"])),kt={...at,...Ge,nestedDialogOpen:e=>e?{[ht.nestedDialogOpen]:""}:null},e("s",d.forwardRef(function(e,t){const{render:n,className:r,style:o,finalFocus:i,initialFocus:s,...c}=e,{store:u}=fo(),l=u.useState("descriptionElementId"),a=u.useState("disablePointerDismissal"),f=u.useState("floatingRootContext"),p=u.useState("popupProps"),g=u.useState("modal"),h=u.useState("mounted"),m=u.useState("nested"),v=u.useState("nestedOpenDialogCount"),y=u.useState("open"),w=u.useState("openMethod"),_=u.useState("titleElementId"),S=u.useState("transitionStatus"),x=u.useState("role"),E=f.useState("floatingId"),C=c.id??E;!function(){const e=d.useContext(mt);if(void 0===e)throw new Error(b(26))}(),Qr({open:y,ref:u.context.popupRef,onComplete(){y&&u.context.onOpenChangeComplete?.(!0)}});const k=void 0===s?Jr(u.context.popupRef):s,R=v>0,I=u.useStateSetter("popupElement"),T=Mr("div",e,{state:{open:y,nested:m,transitionStatus:S,nestedDialogOpen:R},props:[p,{id:C,"aria-labelledby":_??void 0,"aria-describedby":l??void 0,role:x,...Qe,hidden:!h,onKeyDown(e){Ct.has(e.key)&&e.stopPropagation()},style:{[gt.nestedDialogs]:v}},c],ref:[t,u.context.popupRef,I],stateAttributesMapping:kt});return(0,te.jsx)(Hr,{context:f,openInteractionType:w,disabled:!h,closeOnFocusOut:!a,initialFocus:k,returnFocus:i,modal:!1!==g,restoreFocus:"popup",children:T})})),e("o",Rt=d.forwardRef(function(e,t){const{cutout:n,...r}=e;let o;if(n){const e=n.getBoundingClientRect();o=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${e.left}px ${e.top}px,${e.left}px ${e.bottom}px,${e.right}px ${e.bottom}px,${e.right}px ${e.top}px,${e.left}px ${e.top}px)`}return(0,te.jsx)("div",{ref:t,role:"presentation","data-base-ui-inert":"",...r,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:o}})})),e("a",d.forwardRef(function(e,t){const{keepMounted:n=!1,...r}=e,{store:o}=fo(),i=o.useState("mounted"),s=o.useState("modal"),c=o.useState("open");return i||n?(0,te.jsx)(mt.Provider,{value:n,children:(0,te.jsxs)(Pe,{ref:t,...r,children:[i&&!0===s&&(0,te.jsx)(Rt,{ref:o.context.internalBackdropRef,inert:ao(!c)}),e.children]})}):null})),It={},Tt={},Ot="",Pt=new class{constructor(){$t(this,"lockCount",0),$t(this,"restore",null),$t(this,"timeoutLock",y.create()),$t(this,"timeoutUnlock",y.create()),$t(this,"release",()=>{this.lockCount-=1,0===this.lockCount&&this.restore&&this.timeoutUnlock.start(0,this.unlock)}),$t(this,"unlock",()=>{0===this.lockCount&&this.restore&&(this.restore?.(),this.restore=null)})}acquire(e){return this.lockCount+=1,1===this.lockCount&&null===this.restore&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}lock(e){if(0===this.lockCount||null!==this.restore)return;const t=Pn(e).documentElement,n=Kt(t).getComputedStyle(t).overflowY;this.restore="hidden"!==n&&"clip"!==n?C||!function(e){if("undefined"==typeof document)return!1;const t=Pn(e);return Kt(t).innerWidth-t.documentElement.clientWidth>0}(e)?function(e){const t=Pn(e),n=t.documentElement,r=t.body,o=tn(n)?n:r,i={overflowY:o.style.overflowY,overflowX:o.style.overflowX};return Object.assign(o.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(o.style,i)}}(e):ho(e):vn}},At={...nt,modal:Le(e=>e.modal),nested:Le(e=>e.nested),nestedOpenDialogCount:Le(e=>e.nestedOpenDialogCount),nestedOpenDrawerCount:Le(e=>e.nestedOpenDrawerCount),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)},Mt=class e extends qe{constructor(e,t,n=!1){const r=new Je,o=function(e={}){return{...so(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:"dialog",...e}}(e);o.floatingRootContext=co(r,t,n),super(o,{popupRef:d.createRef(),backdropRef:d.createRef(),internalBackdropRef:d.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:r,onOpenChange:void 0,onOpenChangeComplete:void 0},At),$t(this,"setOpen",(e,t)=>{if(t.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},e||null!=t.trigger||null==this.state.activeTriggerId||(t.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(e,t),t.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,t);const n={open:e};eo(n,e,t.trigger),this.update(n)})}static useStore(t,n){return Zr(t,(t,r)=>new e(n,t,r),!0).store}},e("n",d.forwardRef(function(e,t){const{render:n,className:r,style:o,id:i,...s}=e,{store:c}=fo(),u=lo(i);return c.useSyncedValueWithCleanup("titleElementId",u),Mr("h2",e,{ref:t,props:[{id:u},s]})})),Dt={blink:"_blink_150ot_1",fourtyfive:"_fourtyfive_150ot_13",mirror:"_mirror_150ot_17",subtle:"_subtle_150ot_21","subtle-white":"_subtle-white_150ot_35",primary:"_primary_150ot_51",destructive:"_destructive_150ot_66","subtle-destructive":"_subtle-destructive_150ot_79",ghosted:"_ghosted_150ot_92","ghosted-white":"_ghosted-white_150ot_108","ghosted-destructive":"_ghosted-destructive_150ot_124",baseButton:"_baseButton_150ot_140",loading:"_loading_150ot_161",content:"_content_150ot_164",loadingOverlay:"_loadingOverlay_150ot_174",spinner:"_spinner_150ot_180",spin:"_spin_150ot_180",small:"_small_150ot_190",medium:"_medium_150ot_195",large:"_large_150ot_200",xlarge:"_xlarge_150ot_205",fluid:"_fluid_150ot_210"},e("t",Nt=(0,d.forwardRef)(({className:e,children:t,variant:n="subtle",size:r="medium",fluid:o,loading:i,...s},c)=>(0,te.jsxs)("button",{ref:c,className:u([Dt.baseButton,Dt[n],Dt[r],o&&Dt.fluid,i&&Dt.loading,e]),type:"button",disabled:i||s.disabled,...s,children:[(0,te.jsx)("span",{className:Dt.content,children:t}),i&&(0,te.jsx)("div",{className:Dt.loadingOverlay,children:(0,te.jsx)(l,{className:Dt.spinner})})]}))),Nt.displayName="Button"}}});
//# sourceMappingURL=Button-legacy-DpgzgT04.js.map