@inertiaui/modal-react 0.6.4 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/inertiaui-modal.js +1018 -1009
- package/dist/inertiaui-modal.umd.cjs +13 -13
- package/package.json +1 -1
- package/src/ModalRoot.jsx +18 -11
- package/src/helpers.js +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(L,f){typeof exports=="object"&&typeof module<"u"?f(exports,require("react"),require("axios"),require("@inertiajs/react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","axios","@inertiajs/react","react-dom"],f):(L=typeof globalThis<"u"?globalThis:L||self,f(L.InertiaUIModal={},L.React,L.Axios,L.react,L.ReactDOM))})(this,function(L,f,ve,Ue,
|
|
1
|
+
(function(L,f){typeof exports=="object"&&typeof module<"u"?f(exports,require("react"),require("axios"),require("@inertiajs/react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","axios","@inertiajs/react","react-dom"],f):(L=typeof globalThis<"u"?globalThis:L||self,f(L.InertiaUIModal={},L.React,L.Axios,L.react,L.ReactDOM))})(this,function(L,f,ve,Ue,Qo){"use strict";var oc=Object.defineProperty;var ac=(L,f,ve)=>f in L?oc(L,f,{enumerable:!0,configurable:!0,writable:!0,value:ve}):L[f]=ve;var le=(L,f,ve)=>ac(L,typeof f!="symbol"?f+"":f,ve);function Zo(r){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const t in r)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(r,t);Object.defineProperty(e,t,n.get?n:{enumerable:!0,get:()=>r[t]})}}return e.default=r,Object.freeze(e)}const tr=Zo(f),nr={type:"modal",navigate:!1,modal:{closeButton:!0,closeExplicitly:!1,maxWidth:"2xl",paddingClasses:"p-4 sm:p-6",panelClasses:"bg-white rounded",position:"center"},slideover:{closeButton:!0,closeExplicitly:!1,maxWidth:"md",paddingClasses:"p-4 sm:p-6",panelClasses:"bg-white min-h-screen",position:"right"}};class ea{constructor(){this.config={},this.reset()}reset(){this.config=JSON.parse(JSON.stringify(nr))}put(e,t){if(typeof e=="object"){this.config={type:e.type??nr.type,navigate:e.navigate??nr.navigate,modal:{...nr.modal,...e.modal??{}},slideover:{...nr.slideover,...e.slideover??{}}};return}const n=e.split(".");let o=this.config;for(let a=0;a<n.length-1;a++)o=o[n[a]]=o[n[a]]||{};o[n[n.length-1]]=t}get(e){if(typeof e>"u")return this.config;const t=e.split(".");let n=this.config;for(const o of t){if(n[o]===void 0)return null;n=n[o]}return n}}const Pr=new ea,ra=()=>Pr.reset(),ta=(r,e)=>Pr.put(r,e),Ar=r=>Pr.get(r),Be=(r,e)=>Pr.get(r?`slideover.${e}`:`modal.${e}`);var Zr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function na(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}function oa(r){if(r.__esModule)return r;var e=r.default;if(typeof e=="function"){var t=function n(){return this instanceof n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(r).forEach(function(n){var o=Object.getOwnPropertyDescriptor(r,n);Object.defineProperty(t,n,o.get?o:{enumerable:!0,get:function(){return r[n]}})}),t}var et={exports:{}},or={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-jsx-runtime.production.min.js
|
|
4
4
|
*
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var
|
|
9
|
+
*/var Zt;function aa(){if(Zt)return or;Zt=1;var r=f,e=Symbol.for("react.element"),t=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,o=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function l(u,i,d){var s,b={},v=null,E=null;d!==void 0&&(v=""+d),i.key!==void 0&&(v=""+i.key),i.ref!==void 0&&(E=i.ref);for(s in i)n.call(i,s)&&!a.hasOwnProperty(s)&&(b[s]=i[s]);if(u&&u.defaultProps)for(s in i=u.defaultProps,i)b[s]===void 0&&(b[s]=i[s]);return{$$typeof:e,type:u,key:v,ref:E,props:b,_owner:o.current}}return or.Fragment=t,or.jsx=l,or.jsxs=l,or}var ar={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.development.js
|
|
12
12
|
*
|
|
@@ -14,25 +14,25 @@
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var
|
|
18
|
-
`+Le+c}}var we=!1,
|
|
17
|
+
*/var en;function ia(){return en||(en=1,process.env.NODE_ENV!=="production"&&function(){var r=f,e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),l=Symbol.for("react.provider"),u=Symbol.for("react.context"),i=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),s=Symbol.for("react.suspense_list"),b=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),E=Symbol.for("react.offscreen"),p=Symbol.iterator,m="@@iterator";function y(c){if(c===null||typeof c!="object")return null;var S=p&&c[p]||c[m];return typeof S=="function"?S:null}var h=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function g(c){{for(var S=arguments.length,O=new Array(S>1?S-1:0),A=1;A<S;A++)O[A-1]=arguments[A];w("error",c,O)}}function w(c,S,O){{var A=h.ReactDebugCurrentFrame,N=A.getStackAddendum();N!==""&&(S+="%s",O=O.concat([N]));var W=O.map(function(I){return String(I)});W.unshift("Warning: "+S),Function.prototype.apply.call(console[c],console,W)}}var x=!1,P=!1,D=!1,_=!1,U=!1,H;H=Symbol.for("react.module.reference");function j(c){return!!(typeof c=="string"||typeof c=="function"||c===n||c===a||U||c===o||c===d||c===s||_||c===E||x||P||D||typeof c=="object"&&c!==null&&(c.$$typeof===v||c.$$typeof===b||c.$$typeof===l||c.$$typeof===u||c.$$typeof===i||c.$$typeof===H||c.getModuleId!==void 0))}function z(c,S,O){var A=c.displayName;if(A)return A;var N=S.displayName||S.name||"";return N!==""?O+"("+N+")":O}function V(c){return c.displayName||"Context"}function C(c){if(c==null)return null;if(typeof c.tag=="number"&&g("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof c=="function")return c.displayName||c.name||null;if(typeof c=="string")return c;switch(c){case n:return"Fragment";case t:return"Portal";case a:return"Profiler";case o:return"StrictMode";case d:return"Suspense";case s:return"SuspenseList"}if(typeof c=="object")switch(c.$$typeof){case u:var S=c;return V(S)+".Consumer";case l:var O=c;return V(O._context)+".Provider";case i:return z(c,c.render,"ForwardRef");case b:var A=c.displayName||null;return A!==null?A:C(c.type)||"Memo";case v:{var N=c,W=N._payload,I=N._init;try{return C(I(W))}catch{return null}}}return null}var T=Object.assign,k=0,oe,se,me,Z,ce,q,Ne;function J(){}J.__reactDisabledLog=!0;function Gt(){{if(k===0){oe=console.log,se=console.info,me=console.warn,Z=console.error,ce=console.group,q=console.groupCollapsed,Ne=console.groupEnd;var c={configurable:!0,enumerable:!0,value:J,writable:!0};Object.defineProperties(console,{info:c,log:c,warn:c,error:c,group:c,groupCollapsed:c,groupEnd:c})}k++}}function je(){{if(k--,k===0){var c={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:T({},c,{value:oe}),info:T({},c,{value:se}),warn:T({},c,{value:me}),error:T({},c,{value:Z}),group:T({},c,{value:ce}),groupCollapsed:T({},c,{value:q}),groupEnd:T({},c,{value:Ne})})}k<0&&g("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var Sr=h.ReactCurrentDispatcher,Le;function be(c,S,O){{if(Le===void 0)try{throw Error()}catch(N){var A=N.stack.trim().match(/\n( *(at )?)/);Le=A&&A[1]||""}return`
|
|
18
|
+
`+Le+c}}var we=!1,Xr;{var _s=typeof WeakMap=="function"?WeakMap:Map;Xr=new _s}function Lo(c,S){if(!c||we)return"";{var O=Xr.get(c);if(O!==void 0)return O}var A;we=!0;var N=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var W;W=Sr.current,Sr.current=null,Gt();try{if(S){var I=function(){throw Error()};if(Object.defineProperty(I.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(I,[])}catch(ne){A=ne}Reflect.construct(c,[],I)}else{try{I.call()}catch(ne){A=ne}c.call(I.prototype)}}else{try{throw Error()}catch(ne){A=ne}c()}}catch(ne){if(ne&&A&&typeof ne.stack=="string"){for(var M=ne.stack.split(`
|
|
19
19
|
`),re=A.stack.split(`
|
|
20
20
|
`),G=M.length-1,Y=re.length-1;G>=1&&Y>=0&&M[G]!==re[Y];)Y--;for(;G>=1&&Y>=0;G--,Y--)if(M[G]!==re[Y]){if(G!==1||Y!==1)do if(G--,Y--,Y<0||M[G]!==re[Y]){var ie=`
|
|
21
|
-
`+M[G].replace(" at new "," at ");return c.displayName&&ie.includes("<anonymous>")&&(ie=ie.replace("<anonymous>",c.displayName)),typeof c=="function"&&
|
|
21
|
+
`+M[G].replace(" at new "," at ");return c.displayName&&ie.includes("<anonymous>")&&(ie=ie.replace("<anonymous>",c.displayName)),typeof c=="function"&&Xr.set(c,ie),ie}while(G>=1&&Y>=0);break}}}finally{we=!1,Sr.current=W,je(),Error.prepareStackTrace=N}var rr=c?c.displayName||c.name:"",We=rr?be(rr):"";return typeof c=="function"&&Xr.set(c,We),We}function Ds(c,S,O){return Lo(c,!1)}function ks(c){var S=c.prototype;return!!(S&&S.isReactComponent)}function Jr(c,S,O){if(c==null)return"";if(typeof c=="function")return Lo(c,ks(c));if(typeof c=="string")return be(c);switch(c){case d:return be("Suspense");case s:return be("SuspenseList")}if(typeof c=="object")switch(c.$$typeof){case i:return Ds(c.render);case b:return Jr(c.type,S,O);case v:{var A=c,N=A._payload,W=A._init;try{return Jr(W(N),S,O)}catch{}}}return""}var xr=Object.prototype.hasOwnProperty,Wo={},Uo=h.ReactDebugCurrentFrame;function Qr(c){if(c){var S=c._owner,O=Jr(c.type,c._source,S?S.type:null);Uo.setExtraStackFrame(O)}else Uo.setExtraStackFrame(null)}function Ns(c,S,O,A,N){{var W=Function.call.bind(xr);for(var I in c)if(W(c,I)){var M=void 0;try{if(typeof c[I]!="function"){var re=Error((A||"React class")+": "+O+" type `"+I+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof c[I]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw re.name="Invariant Violation",re}M=c[I](S,I,A,O,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(G){M=G}M&&!(M instanceof Error)&&(Qr(N),g("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",A||"React class",O,I,typeof M),Qr(null)),M instanceof Error&&!(M.message in Wo)&&(Wo[M.message]=!0,Qr(N),g("Failed %s type: %s",O,M.message),Qr(null))}}}var js=Array.isArray;function zt(c){return js(c)}function Ls(c){{var S=typeof Symbol=="function"&&Symbol.toStringTag,O=S&&c[Symbol.toStringTag]||c.constructor.name||"Object";return O}}function Ws(c){try{return Bo(c),!1}catch{return!0}}function Bo(c){return""+c}function Ro(c){if(Ws(c))return g("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Ls(c)),Bo(c)}var Or=h.ReactCurrentOwner,Us={key:!0,ref:!0,__self:!0,__source:!0},Ho,Vo,Yt;Yt={};function Bs(c){if(xr.call(c,"ref")){var S=Object.getOwnPropertyDescriptor(c,"ref").get;if(S&&S.isReactWarning)return!1}return c.ref!==void 0}function Rs(c){if(xr.call(c,"key")){var S=Object.getOwnPropertyDescriptor(c,"key").get;if(S&&S.isReactWarning)return!1}return c.key!==void 0}function Hs(c,S){if(typeof c.ref=="string"&&Or.current&&S&&Or.current.stateNode!==S){var O=C(Or.current.type);Yt[O]||(g('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',C(Or.current.type),c.ref),Yt[O]=!0)}}function Vs(c,S){{var O=function(){Ho||(Ho=!0,g("%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://reactjs.org/link/special-props)",S))};O.isReactWarning=!0,Object.defineProperty(c,"key",{get:O,configurable:!0})}}function qs(c,S){{var O=function(){Vo||(Vo=!0,g("%s: `ref` 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://reactjs.org/link/special-props)",S))};O.isReactWarning=!0,Object.defineProperty(c,"ref",{get:O,configurable:!0})}}var Gs=function(c,S,O,A,N,W,I){var M={$$typeof:e,type:c,key:S,ref:O,props:I,_owner:W};return M._store={},Object.defineProperty(M._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(M,"_self",{configurable:!1,enumerable:!1,writable:!1,value:A}),Object.defineProperty(M,"_source",{configurable:!1,enumerable:!1,writable:!1,value:N}),Object.freeze&&(Object.freeze(M.props),Object.freeze(M)),M};function zs(c,S,O,A,N){{var W,I={},M=null,re=null;O!==void 0&&(Ro(O),M=""+O),Rs(S)&&(Ro(S.key),M=""+S.key),Bs(S)&&(re=S.ref,Hs(S,N));for(W in S)xr.call(S,W)&&!Us.hasOwnProperty(W)&&(I[W]=S[W]);if(c&&c.defaultProps){var G=c.defaultProps;for(W in G)I[W]===void 0&&(I[W]=G[W])}if(M||re){var Y=typeof c=="function"?c.displayName||c.name||"Unknown":c;M&&Vs(I,Y),re&&qs(I,Y)}return Gs(c,M,re,N,A,Or.current,I)}}var Kt=h.ReactCurrentOwner,qo=h.ReactDebugCurrentFrame;function er(c){if(c){var S=c._owner,O=Jr(c.type,c._source,S?S.type:null);qo.setExtraStackFrame(O)}else qo.setExtraStackFrame(null)}var Xt;Xt=!1;function Jt(c){return typeof c=="object"&&c!==null&&c.$$typeof===e}function Go(){{if(Kt.current){var c=C(Kt.current.type);if(c)return`
|
|
22
22
|
|
|
23
|
-
Check the render method of \``+c+"`."}return""}}function
|
|
23
|
+
Check the render method of \``+c+"`."}return""}}function Ys(c){return""}var zo={};function Ks(c){{var S=Go();if(!S){var O=typeof c=="string"?c:c.displayName||c.name;O&&(S=`
|
|
24
24
|
|
|
25
|
-
Check the top-level render call using <`+O+">.")}return S}}function
|
|
25
|
+
Check the top-level render call using <`+O+">.")}return S}}function Yo(c,S){{if(!c._store||c._store.validated||c.key!=null)return;c._store.validated=!0;var O=Ks(S);if(zo[O])return;zo[O]=!0;var A="";c&&c._owner&&c._owner!==Kt.current&&(A=" It was passed a child from "+C(c._owner.type)+"."),er(c),g('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',O,A),er(null)}}function Ko(c,S){{if(typeof c!="object")return;if(zt(c))for(var O=0;O<c.length;O++){var A=c[O];Jt(A)&&Yo(A,S)}else if(Jt(c))c._store&&(c._store.validated=!0);else if(c){var N=y(c);if(typeof N=="function"&&N!==c.entries)for(var W=N.call(c),I;!(I=W.next()).done;)Jt(I.value)&&Yo(I.value,S)}}}function Xs(c){{var S=c.type;if(S==null||typeof S=="string")return;var O;if(typeof S=="function")O=S.propTypes;else if(typeof S=="object"&&(S.$$typeof===i||S.$$typeof===b))O=S.propTypes;else return;if(O){var A=C(S);Ns(O,c.props,"prop",A,c)}else if(S.PropTypes!==void 0&&!Xt){Xt=!0;var N=C(S);g("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",N||"Unknown")}typeof S.getDefaultProps=="function"&&!S.getDefaultProps.isReactClassApproved&&g("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Js(c){{for(var S=Object.keys(c.props),O=0;O<S.length;O++){var A=S[O];if(A!=="children"&&A!=="key"){er(c),g("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",A),er(null);break}}c.ref!==null&&(er(c),g("Invalid attribute `ref` supplied to `React.Fragment`."),er(null))}}var Xo={};function Jo(c,S,O,A,N,W){{var I=j(c);if(!I){var M="";(c===void 0||typeof c=="object"&&c!==null&&Object.keys(c).length===0)&&(M+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var re=Ys();re?M+=re:M+=Go();var G;c===null?G="null":zt(c)?G="array":c!==void 0&&c.$$typeof===e?(G="<"+(C(c.type)||"Unknown")+" />",M=" Did you accidentally export a JSX literal instead of a component?"):G=typeof c,g("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",G,M)}var Y=zs(c,S,O,N,W);if(Y==null)return Y;if(I){var ie=S.children;if(ie!==void 0)if(A)if(zt(ie)){for(var rr=0;rr<ie.length;rr++)Ko(ie[rr],c);Object.freeze&&Object.freeze(ie)}else g("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 Ko(ie,c)}if(xr.call(S,"key")){var We=C(c),ne=Object.keys(S).filter(function(nc){return nc!=="key"}),Qt=ne.length>0?"{key: someKey, "+ne.join(": ..., ")+": ...}":"{key: someKey}";if(!Xo[We+Qt]){var tc=ne.length>0?"{"+ne.join(": ..., ")+": ...}":"{}";g(`A props object containing a "key" prop is being spread into JSX:
|
|
26
26
|
let props = %s;
|
|
27
27
|
<%s {...props} />
|
|
28
28
|
React keys must be passed directly to JSX without using spread:
|
|
29
29
|
let props = %s;
|
|
30
|
-
<%s key={someKey} {...props} />`,Jt,We,rc,We),Ko[We+Jt]=!0}}return c===n?Xs(Y):Ks(Y),Y}}function Js(c,S,O){return Xo(c,S,O,!0)}function Qs(c,S,O){return Xo(c,S,O,!1)}var Zs=Qs,ec=Js;ar.Fragment=n,ar.jsx=Zs,ar.jsxs=ec}()),ar}process.env.NODE_ENV==="production"?Zr.exports=oa():Zr.exports=aa();var $=Zr.exports;function ia(r,e){return Array.isArray(r)?r.filter(t=>!e.includes(t)):Object.keys(r).reduce((t,n)=>(e.includes(n)||(t[n]=r[n]),t),{})}function en(r,e){return Array.isArray(r)?r.filter(t=>e.includes(t)):e.reduce((t,n)=>(n in r&&(t[n]=r[n]),t),{})}function la(r){return Array.isArray(r)?r.filter(e=>e!==null):Object.keys(r).reduce((e,t)=>(t in r&&r[t]!==null&&(e[t]=r[t]),e),{})}function ua(r,e=3,t=10){return new Promise((n,o)=>{const a=r();if(a){n(a);return}let l=e*1e3/t;const u=setInterval(()=>{const i=r();i&&(clearInterval(u),n(i)),--l<=0&&(clearInterval(u),o(new Error("Condition not met in time")))},t)})}var sa=function(e){return ca(e)&&!fa(e)};function ca(r){return!!r&&typeof r=="object"}function fa(r){var e=Object.prototype.toString.call(r);return e==="[object RegExp]"||e==="[object Date]"||ya(r)}var da=typeof Symbol=="function"&&Symbol.for,pa=da?Symbol.for("react.element"):60103;function ya(r){return r.$$typeof===pa}function ma(r){return Array.isArray(r)?[]:{}}function ir(r,e){return e.clone!==!1&&e.isMergeableObject(r)?Re(ma(r),r,e):r}function va(r,e,t){return r.concat(e).map(function(n){return ir(n,t)})}function ha(r,e){if(!e.customMerge)return Re;var t=e.customMerge(r);return typeof t=="function"?t:Re}function ga(r){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(r).filter(function(e){return Object.propertyIsEnumerable.call(r,e)}):[]}function rn(r){return Object.keys(r).concat(ga(r))}function tn(r,e){try{return e in r}catch{return!1}}function ba(r,e){return tn(r,e)&&!(Object.hasOwnProperty.call(r,e)&&Object.propertyIsEnumerable.call(r,e))}function wa(r,e,t){var n={};return t.isMergeableObject(r)&&rn(r).forEach(function(o){n[o]=ir(r[o],t)}),rn(e).forEach(function(o){ba(r,o)||(tn(r,o)&&t.isMergeableObject(e[o])?n[o]=ha(o,t)(r[o],e[o],t):n[o]=ir(e[o],t))}),n}function Re(r,e,t){t=t||{},t.arrayMerge=t.arrayMerge||va,t.isMergeableObject=t.isMergeableObject||sa,t.cloneUnlessOtherwiseSpecified=ir;var n=Array.isArray(e),o=Array.isArray(r),a=n===o;return a?n?t.arrayMerge(r,e,t):wa(r,e,t):ir(e,t)}Re.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce(function(n,o){return Re(n,o,t)},{})};var Ea=Re,Sa=Ea;const xa=ta(Sa);var Oa=Error,Pa=EvalError,Aa=RangeError,Ta=ReferenceError,nn=SyntaxError,lr=TypeError,$a=URIError,Ca=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},t=Symbol("test"),n=Object(t);if(typeof t=="string"||Object.prototype.toString.call(t)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var o=42;e[t]=o;for(t in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var a=Object.getOwnPropertySymbols(e);if(a.length!==1||a[0]!==t||!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var l=Object.getOwnPropertyDescriptor(e,t);if(l.value!==o||l.enumerable!==!0)return!1}return!0},on=typeof Symbol<"u"&&Symbol,Fa=Ca,Ma=function(){return typeof on!="function"||typeof Symbol!="function"||typeof on("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:Fa()},et={__proto__:null,foo:{}},Ia=Object,_a=function(){return{__proto__:et}.foo===et.foo&&!(et instanceof Ia)},Da="Function.prototype.bind called on incompatible ",ka=Object.prototype.toString,Na=Math.max,ja="[object Function]",an=function(e,t){for(var n=[],o=0;o<e.length;o+=1)n[o]=e[o];for(var a=0;a<t.length;a+=1)n[a+e.length]=t[a];return n},La=function(e,t){for(var n=[],o=t,a=0;o<e.length;o+=1,a+=1)n[a]=e[o];return n},Wa=function(r,e){for(var t="",n=0;n<r.length;n+=1)t+=r[n],n+1<r.length&&(t+=e);return t},Ua=function(e){var t=this;if(typeof t!="function"||ka.apply(t)!==ja)throw new TypeError(Da+t);for(var n=La(arguments,1),o,a=function(){if(this instanceof o){var s=t.apply(this,an(n,arguments));return Object(s)===s?s:this}return t.apply(e,an(n,arguments))},l=Na(0,t.length-n.length),u=[],i=0;i<l;i++)u[i]="$"+i;if(o=Function("binder","return function ("+Wa(u,",")+"){ return binder.apply(this,arguments); }")(a),t.prototype){var d=function(){};d.prototype=t.prototype,o.prototype=new d,d.prototype=null}return o},Ba=Ua,rt=Function.prototype.bind||Ba,Ra=Function.prototype.call,Ha=Object.prototype.hasOwnProperty,Va=rt,qa=Va.call(Ra,Ha),F,Ga=Oa,za=Pa,Ya=Aa,Ka=Ta,He=nn,Ve=lr,Xa=$a,ln=Function,tt=function(r){try{return ln('"use strict"; return ('+r+").constructor;")()}catch{}},$e=Object.getOwnPropertyDescriptor;if($e)try{$e({},"")}catch{$e=null}var nt=function(){throw new Ve},Ja=$e?function(){try{return arguments.callee,nt}catch{try{return $e(arguments,"callee").get}catch{return nt}}}():nt,qe=Ma(),Qa=_a(),X=Object.getPrototypeOf||(Qa?function(r){return r.__proto__}:null),Ge={},Za=typeof Uint8Array>"u"||!X?F:X(Uint8Array),Ce={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?F:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?F:ArrayBuffer,"%ArrayIteratorPrototype%":qe&&X?X([][Symbol.iterator]()):F,"%AsyncFromSyncIteratorPrototype%":F,"%AsyncFunction%":Ge,"%AsyncGenerator%":Ge,"%AsyncGeneratorFunction%":Ge,"%AsyncIteratorPrototype%":Ge,"%Atomics%":typeof Atomics>"u"?F:Atomics,"%BigInt%":typeof BigInt>"u"?F:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?F:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?F:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?F:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Ga,"%eval%":eval,"%EvalError%":za,"%Float32Array%":typeof Float32Array>"u"?F:Float32Array,"%Float64Array%":typeof Float64Array>"u"?F:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?F:FinalizationRegistry,"%Function%":ln,"%GeneratorFunction%":Ge,"%Int8Array%":typeof Int8Array>"u"?F:Int8Array,"%Int16Array%":typeof Int16Array>"u"?F:Int16Array,"%Int32Array%":typeof Int32Array>"u"?F:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":qe&&X?X(X([][Symbol.iterator]())):F,"%JSON%":typeof JSON=="object"?JSON:F,"%Map%":typeof Map>"u"?F:Map,"%MapIteratorPrototype%":typeof Map>"u"||!qe||!X?F:X(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?F:Promise,"%Proxy%":typeof Proxy>"u"?F:Proxy,"%RangeError%":Ya,"%ReferenceError%":Ka,"%Reflect%":typeof Reflect>"u"?F:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?F:Set,"%SetIteratorPrototype%":typeof Set>"u"||!qe||!X?F:X(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?F:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":qe&&X?X(""[Symbol.iterator]()):F,"%Symbol%":qe?Symbol:F,"%SyntaxError%":He,"%ThrowTypeError%":Ja,"%TypedArray%":Za,"%TypeError%":Ve,"%Uint8Array%":typeof Uint8Array>"u"?F:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?F:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?F:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?F:Uint32Array,"%URIError%":Xa,"%WeakMap%":typeof WeakMap>"u"?F:WeakMap,"%WeakRef%":typeof WeakRef>"u"?F:WeakRef,"%WeakSet%":typeof WeakSet>"u"?F:WeakSet};if(X)try{null.error}catch(r){var ei=X(X(r));Ce["%Error.prototype%"]=ei}var ri=function r(e){var t;if(e==="%AsyncFunction%")t=tt("async function () {}");else if(e==="%GeneratorFunction%")t=tt("function* () {}");else if(e==="%AsyncGeneratorFunction%")t=tt("async function* () {}");else if(e==="%AsyncGenerator%"){var n=r("%AsyncGeneratorFunction%");n&&(t=n.prototype)}else if(e==="%AsyncIteratorPrototype%"){var o=r("%AsyncGenerator%");o&&X&&(t=X(o.prototype))}return Ce[e]=t,t},un={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},ur=rt,Ar=qa,ti=ur.call(Function.call,Array.prototype.concat),ni=ur.call(Function.apply,Array.prototype.splice),sn=ur.call(Function.call,String.prototype.replace),Tr=ur.call(Function.call,String.prototype.slice),oi=ur.call(Function.call,RegExp.prototype.exec),ai=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,ii=/\\(\\)?/g,li=function(e){var t=Tr(e,0,1),n=Tr(e,-1);if(t==="%"&&n!=="%")throw new He("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&t!=="%")throw new He("invalid intrinsic syntax, expected opening `%`");var o=[];return sn(e,ai,function(a,l,u,i){o[o.length]=u?sn(i,ii,"$1"):l||a}),o},ui=function(e,t){var n=e,o;if(Ar(un,n)&&(o=un[n],n="%"+o[0]+"%"),Ar(Ce,n)){var a=Ce[n];if(a===Ge&&(a=ri(n)),typeof a>"u"&&!t)throw new Ve("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:o,name:n,value:a}}throw new He("intrinsic "+e+" does not exist!")},ze=function(e,t){if(typeof e!="string"||e.length===0)throw new Ve("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof t!="boolean")throw new Ve('"allowMissing" argument must be a boolean');if(oi(/^%?[^%]*%?$/,e)===null)throw new He("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=li(e),o=n.length>0?n[0]:"",a=ui("%"+o+"%",t),l=a.name,u=a.value,i=!1,d=a.alias;d&&(o=d[0],ni(n,ti([0,1],d)));for(var s=1,g=!0;s<n.length;s+=1){var v=n[s],E=Tr(v,0,1),p=Tr(v,-1);if((E==='"'||E==="'"||E==="`"||p==='"'||p==="'"||p==="`")&&E!==p)throw new He("property names with quotes must have matching quotes");if((v==="constructor"||!g)&&(i=!0),o+="."+v,l="%"+o+"%",Ar(Ce,l))u=Ce[l];else if(u!=null){if(!(v in u)){if(!t)throw new Ve("base intrinsic for "+e+" exists, but the property is not available.");return}if($e&&s+1>=n.length){var m=$e(u,v);g=!!m,g&&"get"in m&&!("originalValue"in m.get)?u=m.get:u=u[v]}else g=Ar(u,v),u=u[v];g&&!i&&(Ce[l]=u)}}return u},cn={exports:{}},ot,fn;function at(){if(fn)return ot;fn=1;var r=ze,e=r("%Object.defineProperty%",!0)||!1;if(e)try{e({},"a",{value:1})}catch{e=!1}return ot=e,ot}var si=ze,$r=si("%Object.getOwnPropertyDescriptor%",!0);if($r)try{$r([],"length")}catch{$r=null}var dn=$r,pn=at(),ci=nn,Ye=lr,yn=dn,fi=function(e,t,n){if(!e||typeof e!="object"&&typeof e!="function")throw new Ye("`obj` must be an object or a function`");if(typeof t!="string"&&typeof t!="symbol")throw new Ye("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new Ye("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new Ye("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new Ye("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new Ye("`loose`, if provided, must be a boolean");var o=arguments.length>3?arguments[3]:null,a=arguments.length>4?arguments[4]:null,l=arguments.length>5?arguments[5]:null,u=arguments.length>6?arguments[6]:!1,i=!!yn&&yn(e,t);if(pn)pn(e,t,{configurable:l===null&&i?i.configurable:!l,enumerable:o===null&&i?i.enumerable:!o,value:n,writable:a===null&&i?i.writable:!a});else if(u||!o&&!a&&!l)e[t]=n;else throw new ci("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},it=at(),mn=function(){return!!it};mn.hasArrayLengthDefineBug=function(){if(!it)return null;try{return it([],"length",{value:1}).length!==1}catch{return!0}};var di=mn,pi=ze,vn=fi,yi=di(),hn=dn,gn=lr,mi=pi("%Math.floor%"),vi=function(e,t){if(typeof e!="function")throw new gn("`fn` is not a function");if(typeof t!="number"||t<0||t>4294967295||mi(t)!==t)throw new gn("`length` must be a positive 32-bit integer");var n=arguments.length>2&&!!arguments[2],o=!0,a=!0;if("length"in e&&hn){var l=hn(e,"length");l&&!l.configurable&&(o=!1),l&&!l.writable&&(a=!1)}return(o||a||!n)&&(yi?vn(e,"length",t,!0,!0):vn(e,"length",t)),e};(function(r){var e=rt,t=ze,n=vi,o=lr,a=t("%Function.prototype.apply%"),l=t("%Function.prototype.call%"),u=t("%Reflect.apply%",!0)||e.call(l,a),i=at(),d=t("%Math.max%");r.exports=function(v){if(typeof v!="function")throw new o("a function is required");var E=u(e,l,arguments);return n(E,1+d(0,v.length-(arguments.length-1)),!0)};var s=function(){return u(e,a,arguments)};i?i(r.exports,"apply",{value:s}):r.exports.apply=s})(cn);var hi=cn.exports,bn=ze,wn=hi,gi=wn(bn("String.prototype.indexOf")),bi=function(e,t){var n=bn(e,!!t);return typeof n=="function"&&gi(e,".prototype.")>-1?wn(n):n};const wi=na(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var lt=typeof Map=="function"&&Map.prototype,ut=Object.getOwnPropertyDescriptor&<?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Cr=lt&&ut&&typeof ut.get=="function"?ut.get:null,En=lt&&Map.prototype.forEach,st=typeof Set=="function"&&Set.prototype,ct=Object.getOwnPropertyDescriptor&&st?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Fr=st&&ct&&typeof ct.get=="function"?ct.get:null,Sn=st&&Set.prototype.forEach,Ei=typeof WeakMap=="function"&&WeakMap.prototype,sr=Ei?WeakMap.prototype.has:null,Si=typeof WeakSet=="function"&&WeakSet.prototype,cr=Si?WeakSet.prototype.has:null,xi=typeof WeakRef=="function"&&WeakRef.prototype,xn=xi?WeakRef.prototype.deref:null,Oi=Boolean.prototype.valueOf,Pi=Object.prototype.toString,Ai=Function.prototype.toString,Ti=String.prototype.match,ft=String.prototype.slice,Ee=String.prototype.replace,$i=String.prototype.toUpperCase,On=String.prototype.toLowerCase,Pn=RegExp.prototype.test,An=Array.prototype.concat,fe=Array.prototype.join,Ci=Array.prototype.slice,Tn=Math.floor,dt=typeof BigInt=="function"?BigInt.prototype.valueOf:null,pt=Object.getOwnPropertySymbols,yt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,Ke=typeof Symbol=="function"&&typeof Symbol.iterator=="object",Q=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===Ke||!0)?Symbol.toStringTag:null,$n=Object.prototype.propertyIsEnumerable,Cn=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(r){return r.__proto__}:null);function Fn(r,e){if(r===1/0||r===-1/0||r!==r||r&&r>-1e3&&r<1e3||Pn.call(/e/,e))return e;var t=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof r=="number"){var n=r<0?-Tn(-r):Tn(r);if(n!==r){var o=String(n),a=ft.call(e,o.length+1);return Ee.call(o,t,"$&_")+"."+Ee.call(Ee.call(a,/([0-9]{3})/g,"$&_"),/_$/,"")}}return Ee.call(e,t,"$&_")}var mt=wi,Mn=mt.custom,In=kn(Mn)?Mn:null,Fi=function r(e,t,n,o){var a=t||{};if(Se(a,"quoteStyle")&&a.quoteStyle!=="single"&&a.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Se(a,"maxStringLength")&&(typeof a.maxStringLength=="number"?a.maxStringLength<0&&a.maxStringLength!==1/0:a.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var l=Se(a,"customInspect")?a.customInspect:!0;if(typeof l!="boolean"&&l!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Se(a,"indent")&&a.indent!==null&&a.indent!==" "&&!(parseInt(a.indent,10)===a.indent&&a.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(Se(a,"numericSeparator")&&typeof a.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var u=a.numericSeparator;if(typeof e>"u")return"undefined";if(e===null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="string")return jn(e,a);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var i=String(e);return u?Fn(e,i):i}if(typeof e=="bigint"){var d=String(e)+"n";return u?Fn(e,d):d}var s=typeof a.depth>"u"?5:a.depth;if(typeof n>"u"&&(n=0),n>=s&&s>0&&typeof e=="object")return vt(e)?"[Array]":"[Object]";var g=Yi(a,n);if(typeof o>"u")o=[];else if(Nn(o,e)>=0)return"[Circular]";function v(C,T,k){if(T&&(o=Ci.call(o),o.push(T)),k){var oe={depth:a.depth};return Se(a,"quoteStyle")&&(oe.quoteStyle=a.quoteStyle),r(C,oe,n+1,o)}return r(C,a,n+1,o)}if(typeof e=="function"&&!Dn(e)){var E=Wi(e),p=Mr(e,v);return"[Function"+(E?": "+E:" (anonymous)")+"]"+(p.length>0?" { "+fe.call(p,", ")+" }":"")}if(kn(e)){var m=Ke?Ee.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):yt.call(e);return typeof e=="object"&&!Ke?fr(m):m}if(qi(e)){for(var y="<"+On.call(String(e.nodeName)),h=e.attributes||[],b=0;b<h.length;b++)y+=" "+h[b].name+"="+_n(Mi(h[b].value),"double",a);return y+=">",e.childNodes&&e.childNodes.length&&(y+="..."),y+="</"+On.call(String(e.nodeName))+">",y}if(vt(e)){if(e.length===0)return"[]";var w=Mr(e,v);return g&&!zi(w)?"["+gt(w,g)+"]":"[ "+fe.call(w,", ")+" ]"}if(_i(e)){var x=Mr(e,v);return!("cause"in Error.prototype)&&"cause"in e&&!$n.call(e,"cause")?"{ ["+String(e)+"] "+fe.call(An.call("[cause]: "+v(e.cause),x),", ")+" }":x.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+fe.call(x,", ")+" }"}if(typeof e=="object"&&l){if(In&&typeof e[In]=="function"&&mt)return mt(e,{depth:s-n});if(l!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(Ui(e)){var P=[];return En&&En.call(e,function(C,T){P.push(v(T,e,!0)+" => "+v(C,e))}),Ln("Map",Cr.call(e),P,g)}if(Hi(e)){var D=[];return Sn&&Sn.call(e,function(C){D.push(v(C,e))}),Ln("Set",Fr.call(e),D,g)}if(Bi(e))return ht("WeakMap");if(Vi(e))return ht("WeakSet");if(Ri(e))return ht("WeakRef");if(ki(e))return fr(v(Number(e)));if(ji(e))return fr(v(dt.call(e)));if(Ni(e))return fr(Oi.call(e));if(Di(e))return fr(v(String(e)));if(typeof window<"u"&&e===window)return"{ [object Window] }";if(typeof globalThis<"u"&&e===globalThis||typeof Qr<"u"&&e===Qr)return"{ [object globalThis] }";if(!Ii(e)&&!Dn(e)){var _=Mr(e,v),U=Cn?Cn(e)===Object.prototype:e instanceof Object||e.constructor===Object,H=e instanceof Object?"":"null prototype",j=!U&&Q&&Object(e)===e&&Q in e?ft.call(xe(e),8,-1):H?"Object":"",z=U||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",V=z+(j||H?"["+fe.call(An.call([],j||[],H||[]),": ")+"] ":"");return _.length===0?V+"{}":g?V+"{"+gt(_,g)+"}":V+"{ "+fe.call(_,", ")+" }"}return String(e)};function _n(r,e,t){var n=(t.quoteStyle||e)==="double"?'"':"'";return n+r+n}function Mi(r){return Ee.call(String(r),/"/g,""")}function vt(r){return xe(r)==="[object Array]"&&(!Q||!(typeof r=="object"&&Q in r))}function Ii(r){return xe(r)==="[object Date]"&&(!Q||!(typeof r=="object"&&Q in r))}function Dn(r){return xe(r)==="[object RegExp]"&&(!Q||!(typeof r=="object"&&Q in r))}function _i(r){return xe(r)==="[object Error]"&&(!Q||!(typeof r=="object"&&Q in r))}function Di(r){return xe(r)==="[object String]"&&(!Q||!(typeof r=="object"&&Q in r))}function ki(r){return xe(r)==="[object Number]"&&(!Q||!(typeof r=="object"&&Q in r))}function Ni(r){return xe(r)==="[object Boolean]"&&(!Q||!(typeof r=="object"&&Q in r))}function kn(r){if(Ke)return r&&typeof r=="object"&&r instanceof Symbol;if(typeof r=="symbol")return!0;if(!r||typeof r!="object"||!yt)return!1;try{return yt.call(r),!0}catch{}return!1}function ji(r){if(!r||typeof r!="object"||!dt)return!1;try{return dt.call(r),!0}catch{}return!1}var Li=Object.prototype.hasOwnProperty||function(r){return r in this};function Se(r,e){return Li.call(r,e)}function xe(r){return Pi.call(r)}function Wi(r){if(r.name)return r.name;var e=Ti.call(Ai.call(r),/^function\s*([\w$]+)/);return e?e[1]:null}function Nn(r,e){if(r.indexOf)return r.indexOf(e);for(var t=0,n=r.length;t<n;t++)if(r[t]===e)return t;return-1}function Ui(r){if(!Cr||!r||typeof r!="object")return!1;try{Cr.call(r);try{Fr.call(r)}catch{return!0}return r instanceof Map}catch{}return!1}function Bi(r){if(!sr||!r||typeof r!="object")return!1;try{sr.call(r,sr);try{cr.call(r,cr)}catch{return!0}return r instanceof WeakMap}catch{}return!1}function Ri(r){if(!xn||!r||typeof r!="object")return!1;try{return xn.call(r),!0}catch{}return!1}function Hi(r){if(!Fr||!r||typeof r!="object")return!1;try{Fr.call(r);try{Cr.call(r)}catch{return!0}return r instanceof Set}catch{}return!1}function Vi(r){if(!cr||!r||typeof r!="object")return!1;try{cr.call(r,cr);try{sr.call(r,sr)}catch{return!0}return r instanceof WeakSet}catch{}return!1}function qi(r){return!r||typeof r!="object"?!1:typeof HTMLElement<"u"&&r instanceof HTMLElement?!0:typeof r.nodeName=="string"&&typeof r.getAttribute=="function"}function jn(r,e){if(r.length>e.maxStringLength){var t=r.length-e.maxStringLength,n="... "+t+" more character"+(t>1?"s":"");return jn(ft.call(r,0,e.maxStringLength),e)+n}var o=Ee.call(Ee.call(r,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,Gi);return _n(o,"single",e)}function Gi(r){var e=r.charCodeAt(0),t={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return t?"\\"+t:"\\x"+(e<16?"0":"")+$i.call(e.toString(16))}function fr(r){return"Object("+r+")"}function ht(r){return r+" { ? }"}function Ln(r,e,t,n){var o=n?gt(t,n):fe.call(t,", ");return r+" ("+e+") {"+o+"}"}function zi(r){for(var e=0;e<r.length;e++)if(Nn(r[e],`
|
|
31
|
-
`)>=0)return!1;return!0}function
|
|
30
|
+
<%s key={someKey} {...props} />`,Qt,We,tc,We),Xo[We+Qt]=!0}}return c===n?Js(Y):Xs(Y),Y}}function Qs(c,S,O){return Jo(c,S,O,!0)}function Zs(c,S,O){return Jo(c,S,O,!1)}var ec=Zs,rc=Qs;ar.Fragment=n,ar.jsx=ec,ar.jsxs=rc}()),ar}process.env.NODE_ENV==="production"?et.exports=aa():et.exports=ia();var $=et.exports;function la(r,e){return Array.isArray(r)?r.filter(t=>!e.includes(t)):Object.keys(r).reduce((t,n)=>(e.includes(n)||(t[n]=r[n]),t),{})}function rn(r,e){return Array.isArray(r)?r.filter(t=>e.includes(t)):e.reduce((t,n)=>(n in r&&(t[n]=r[n]),t),{})}function ua(r){return Array.isArray(r)?r.filter(e=>e!==null):Object.keys(r).reduce((e,t)=>(t in r&&r[t]!==null&&(e[t]=r[t]),e),{})}function sa(r,e=3,t=10){return new Promise((n,o)=>{const a=r();if(a){n(a);return}let l=e*1e3/t;const u=setInterval(()=>{const i=r();i&&(clearInterval(u),n(i)),--l<=0&&(clearInterval(u),o(new Error("Condition not met in time")))},t)})}function ir(r){return r?(r=r.replace(/_/g,"-"),r=r.replace(/-+/g,"-"),/[A-Z]/.test(r)?(r=r.replace(/\s+/g,"").replace(/_/g,"").replace(/(?:^|\s|-)+([A-Za-z])/g,(e,t)=>t.toUpperCase()),r=r.replace(/(.)(?=[A-Z])/g,"$1-"),r.toLowerCase()):r):""}var ca=function(e){return fa(e)&&!da(e)};function fa(r){return!!r&&typeof r=="object"}function da(r){var e=Object.prototype.toString.call(r);return e==="[object RegExp]"||e==="[object Date]"||ma(r)}var pa=typeof Symbol=="function"&&Symbol.for,ya=pa?Symbol.for("react.element"):60103;function ma(r){return r.$$typeof===ya}function va(r){return Array.isArray(r)?[]:{}}function lr(r,e){return e.clone!==!1&&e.isMergeableObject(r)?Re(va(r),r,e):r}function ha(r,e,t){return r.concat(e).map(function(n){return lr(n,t)})}function ga(r,e){if(!e.customMerge)return Re;var t=e.customMerge(r);return typeof t=="function"?t:Re}function ba(r){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(r).filter(function(e){return Object.propertyIsEnumerable.call(r,e)}):[]}function tn(r){return Object.keys(r).concat(ba(r))}function nn(r,e){try{return e in r}catch{return!1}}function wa(r,e){return nn(r,e)&&!(Object.hasOwnProperty.call(r,e)&&Object.propertyIsEnumerable.call(r,e))}function Ea(r,e,t){var n={};return t.isMergeableObject(r)&&tn(r).forEach(function(o){n[o]=lr(r[o],t)}),tn(e).forEach(function(o){wa(r,o)||(nn(r,o)&&t.isMergeableObject(e[o])?n[o]=ga(o,t)(r[o],e[o],t):n[o]=lr(e[o],t))}),n}function Re(r,e,t){t=t||{},t.arrayMerge=t.arrayMerge||ha,t.isMergeableObject=t.isMergeableObject||ca,t.cloneUnlessOtherwiseSpecified=lr;var n=Array.isArray(e),o=Array.isArray(r),a=n===o;return a?n?t.arrayMerge(r,e,t):Ea(r,e,t):lr(e,t)}Re.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce(function(n,o){return Re(n,o,t)},{})};var Sa=Re,xa=Sa;const Oa=na(xa);var Pa=Error,Aa=EvalError,Ta=RangeError,$a=ReferenceError,on=SyntaxError,ur=TypeError,Ca=URIError,Fa=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},t=Symbol("test"),n=Object(t);if(typeof t=="string"||Object.prototype.toString.call(t)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var o=42;e[t]=o;for(t in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var a=Object.getOwnPropertySymbols(e);if(a.length!==1||a[0]!==t||!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var l=Object.getOwnPropertyDescriptor(e,t);if(l.value!==o||l.enumerable!==!0)return!1}return!0},an=typeof Symbol<"u"&&Symbol,Ma=Fa,Ia=function(){return typeof an!="function"||typeof Symbol!="function"||typeof an("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:Ma()},rt={__proto__:null,foo:{}},_a=Object,Da=function(){return{__proto__:rt}.foo===rt.foo&&!(rt instanceof _a)},ka="Function.prototype.bind called on incompatible ",Na=Object.prototype.toString,ja=Math.max,La="[object Function]",ln=function(e,t){for(var n=[],o=0;o<e.length;o+=1)n[o]=e[o];for(var a=0;a<t.length;a+=1)n[a+e.length]=t[a];return n},Wa=function(e,t){for(var n=[],o=t,a=0;o<e.length;o+=1,a+=1)n[a]=e[o];return n},Ua=function(r,e){for(var t="",n=0;n<r.length;n+=1)t+=r[n],n+1<r.length&&(t+=e);return t},Ba=function(e){var t=this;if(typeof t!="function"||Na.apply(t)!==La)throw new TypeError(ka+t);for(var n=Wa(arguments,1),o,a=function(){if(this instanceof o){var s=t.apply(this,ln(n,arguments));return Object(s)===s?s:this}return t.apply(e,ln(n,arguments))},l=ja(0,t.length-n.length),u=[],i=0;i<l;i++)u[i]="$"+i;if(o=Function("binder","return function ("+Ua(u,",")+"){ return binder.apply(this,arguments); }")(a),t.prototype){var d=function(){};d.prototype=t.prototype,o.prototype=new d,d.prototype=null}return o},Ra=Ba,tt=Function.prototype.bind||Ra,Ha=Function.prototype.call,Va=Object.prototype.hasOwnProperty,qa=tt,Ga=qa.call(Ha,Va),F,za=Pa,Ya=Aa,Ka=Ta,Xa=$a,He=on,Ve=ur,Ja=Ca,un=Function,nt=function(r){try{return un('"use strict"; return ('+r+").constructor;")()}catch{}},$e=Object.getOwnPropertyDescriptor;if($e)try{$e({},"")}catch{$e=null}var ot=function(){throw new Ve},Qa=$e?function(){try{return arguments.callee,ot}catch{try{return $e(arguments,"callee").get}catch{return ot}}}():ot,qe=Ia(),Za=Da(),X=Object.getPrototypeOf||(Za?function(r){return r.__proto__}:null),Ge={},ei=typeof Uint8Array>"u"||!X?F:X(Uint8Array),Ce={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?F:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?F:ArrayBuffer,"%ArrayIteratorPrototype%":qe&&X?X([][Symbol.iterator]()):F,"%AsyncFromSyncIteratorPrototype%":F,"%AsyncFunction%":Ge,"%AsyncGenerator%":Ge,"%AsyncGeneratorFunction%":Ge,"%AsyncIteratorPrototype%":Ge,"%Atomics%":typeof Atomics>"u"?F:Atomics,"%BigInt%":typeof BigInt>"u"?F:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?F:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?F:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?F:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":za,"%eval%":eval,"%EvalError%":Ya,"%Float32Array%":typeof Float32Array>"u"?F:Float32Array,"%Float64Array%":typeof Float64Array>"u"?F:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?F:FinalizationRegistry,"%Function%":un,"%GeneratorFunction%":Ge,"%Int8Array%":typeof Int8Array>"u"?F:Int8Array,"%Int16Array%":typeof Int16Array>"u"?F:Int16Array,"%Int32Array%":typeof Int32Array>"u"?F:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":qe&&X?X(X([][Symbol.iterator]())):F,"%JSON%":typeof JSON=="object"?JSON:F,"%Map%":typeof Map>"u"?F:Map,"%MapIteratorPrototype%":typeof Map>"u"||!qe||!X?F:X(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?F:Promise,"%Proxy%":typeof Proxy>"u"?F:Proxy,"%RangeError%":Ka,"%ReferenceError%":Xa,"%Reflect%":typeof Reflect>"u"?F:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?F:Set,"%SetIteratorPrototype%":typeof Set>"u"||!qe||!X?F:X(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?F:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":qe&&X?X(""[Symbol.iterator]()):F,"%Symbol%":qe?Symbol:F,"%SyntaxError%":He,"%ThrowTypeError%":Qa,"%TypedArray%":ei,"%TypeError%":Ve,"%Uint8Array%":typeof Uint8Array>"u"?F:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?F:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?F:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?F:Uint32Array,"%URIError%":Ja,"%WeakMap%":typeof WeakMap>"u"?F:WeakMap,"%WeakRef%":typeof WeakRef>"u"?F:WeakRef,"%WeakSet%":typeof WeakSet>"u"?F:WeakSet};if(X)try{null.error}catch(r){var ri=X(X(r));Ce["%Error.prototype%"]=ri}var ti=function r(e){var t;if(e==="%AsyncFunction%")t=nt("async function () {}");else if(e==="%GeneratorFunction%")t=nt("function* () {}");else if(e==="%AsyncGeneratorFunction%")t=nt("async function* () {}");else if(e==="%AsyncGenerator%"){var n=r("%AsyncGeneratorFunction%");n&&(t=n.prototype)}else if(e==="%AsyncIteratorPrototype%"){var o=r("%AsyncGenerator%");o&&X&&(t=X(o.prototype))}return Ce[e]=t,t},sn={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},sr=tt,Tr=Ga,ni=sr.call(Function.call,Array.prototype.concat),oi=sr.call(Function.apply,Array.prototype.splice),cn=sr.call(Function.call,String.prototype.replace),$r=sr.call(Function.call,String.prototype.slice),ai=sr.call(Function.call,RegExp.prototype.exec),ii=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,li=/\\(\\)?/g,ui=function(e){var t=$r(e,0,1),n=$r(e,-1);if(t==="%"&&n!=="%")throw new He("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&t!=="%")throw new He("invalid intrinsic syntax, expected opening `%`");var o=[];return cn(e,ii,function(a,l,u,i){o[o.length]=u?cn(i,li,"$1"):l||a}),o},si=function(e,t){var n=e,o;if(Tr(sn,n)&&(o=sn[n],n="%"+o[0]+"%"),Tr(Ce,n)){var a=Ce[n];if(a===Ge&&(a=ti(n)),typeof a>"u"&&!t)throw new Ve("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:o,name:n,value:a}}throw new He("intrinsic "+e+" does not exist!")},ze=function(e,t){if(typeof e!="string"||e.length===0)throw new Ve("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof t!="boolean")throw new Ve('"allowMissing" argument must be a boolean');if(ai(/^%?[^%]*%?$/,e)===null)throw new He("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=ui(e),o=n.length>0?n[0]:"",a=si("%"+o+"%",t),l=a.name,u=a.value,i=!1,d=a.alias;d&&(o=d[0],oi(n,ni([0,1],d)));for(var s=1,b=!0;s<n.length;s+=1){var v=n[s],E=$r(v,0,1),p=$r(v,-1);if((E==='"'||E==="'"||E==="`"||p==='"'||p==="'"||p==="`")&&E!==p)throw new He("property names with quotes must have matching quotes");if((v==="constructor"||!b)&&(i=!0),o+="."+v,l="%"+o+"%",Tr(Ce,l))u=Ce[l];else if(u!=null){if(!(v in u)){if(!t)throw new Ve("base intrinsic for "+e+" exists, but the property is not available.");return}if($e&&s+1>=n.length){var m=$e(u,v);b=!!m,b&&"get"in m&&!("originalValue"in m.get)?u=m.get:u=u[v]}else b=Tr(u,v),u=u[v];b&&!i&&(Ce[l]=u)}}return u},fn={exports:{}},at,dn;function it(){if(dn)return at;dn=1;var r=ze,e=r("%Object.defineProperty%",!0)||!1;if(e)try{e({},"a",{value:1})}catch{e=!1}return at=e,at}var ci=ze,Cr=ci("%Object.getOwnPropertyDescriptor%",!0);if(Cr)try{Cr([],"length")}catch{Cr=null}var pn=Cr,yn=it(),fi=on,Ye=ur,mn=pn,di=function(e,t,n){if(!e||typeof e!="object"&&typeof e!="function")throw new Ye("`obj` must be an object or a function`");if(typeof t!="string"&&typeof t!="symbol")throw new Ye("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new Ye("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new Ye("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new Ye("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new Ye("`loose`, if provided, must be a boolean");var o=arguments.length>3?arguments[3]:null,a=arguments.length>4?arguments[4]:null,l=arguments.length>5?arguments[5]:null,u=arguments.length>6?arguments[6]:!1,i=!!mn&&mn(e,t);if(yn)yn(e,t,{configurable:l===null&&i?i.configurable:!l,enumerable:o===null&&i?i.enumerable:!o,value:n,writable:a===null&&i?i.writable:!a});else if(u||!o&&!a&&!l)e[t]=n;else throw new fi("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},lt=it(),vn=function(){return!!lt};vn.hasArrayLengthDefineBug=function(){if(!lt)return null;try{return lt([],"length",{value:1}).length!==1}catch{return!0}};var pi=vn,yi=ze,hn=di,mi=pi(),gn=pn,bn=ur,vi=yi("%Math.floor%"),hi=function(e,t){if(typeof e!="function")throw new bn("`fn` is not a function");if(typeof t!="number"||t<0||t>4294967295||vi(t)!==t)throw new bn("`length` must be a positive 32-bit integer");var n=arguments.length>2&&!!arguments[2],o=!0,a=!0;if("length"in e&&gn){var l=gn(e,"length");l&&!l.configurable&&(o=!1),l&&!l.writable&&(a=!1)}return(o||a||!n)&&(mi?hn(e,"length",t,!0,!0):hn(e,"length",t)),e};(function(r){var e=tt,t=ze,n=hi,o=ur,a=t("%Function.prototype.apply%"),l=t("%Function.prototype.call%"),u=t("%Reflect.apply%",!0)||e.call(l,a),i=it(),d=t("%Math.max%");r.exports=function(v){if(typeof v!="function")throw new o("a function is required");var E=u(e,l,arguments);return n(E,1+d(0,v.length-(arguments.length-1)),!0)};var s=function(){return u(e,a,arguments)};i?i(r.exports,"apply",{value:s}):r.exports.apply=s})(fn);var gi=fn.exports,wn=ze,En=gi,bi=En(wn("String.prototype.indexOf")),wi=function(e,t){var n=wn(e,!!t);return typeof n=="function"&&bi(e,".prototype.")>-1?En(n):n};const Ei=oa(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var ut=typeof Map=="function"&&Map.prototype,st=Object.getOwnPropertyDescriptor&&ut?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Fr=ut&&st&&typeof st.get=="function"?st.get:null,Sn=ut&&Map.prototype.forEach,ct=typeof Set=="function"&&Set.prototype,ft=Object.getOwnPropertyDescriptor&&ct?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Mr=ct&&ft&&typeof ft.get=="function"?ft.get:null,xn=ct&&Set.prototype.forEach,Si=typeof WeakMap=="function"&&WeakMap.prototype,cr=Si?WeakMap.prototype.has:null,xi=typeof WeakSet=="function"&&WeakSet.prototype,fr=xi?WeakSet.prototype.has:null,Oi=typeof WeakRef=="function"&&WeakRef.prototype,On=Oi?WeakRef.prototype.deref:null,Pi=Boolean.prototype.valueOf,Ai=Object.prototype.toString,Ti=Function.prototype.toString,$i=String.prototype.match,dt=String.prototype.slice,Ee=String.prototype.replace,Ci=String.prototype.toUpperCase,Pn=String.prototype.toLowerCase,An=RegExp.prototype.test,Tn=Array.prototype.concat,fe=Array.prototype.join,Fi=Array.prototype.slice,$n=Math.floor,pt=typeof BigInt=="function"?BigInt.prototype.valueOf:null,yt=Object.getOwnPropertySymbols,mt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,Ke=typeof Symbol=="function"&&typeof Symbol.iterator=="object",Q=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===Ke||!0)?Symbol.toStringTag:null,Cn=Object.prototype.propertyIsEnumerable,Fn=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(r){return r.__proto__}:null);function Mn(r,e){if(r===1/0||r===-1/0||r!==r||r&&r>-1e3&&r<1e3||An.call(/e/,e))return e;var t=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof r=="number"){var n=r<0?-$n(-r):$n(r);if(n!==r){var o=String(n),a=dt.call(e,o.length+1);return Ee.call(o,t,"$&_")+"."+Ee.call(Ee.call(a,/([0-9]{3})/g,"$&_"),/_$/,"")}}return Ee.call(e,t,"$&_")}var vt=Ei,In=vt.custom,_n=Nn(In)?In:null,Mi=function r(e,t,n,o){var a=t||{};if(Se(a,"quoteStyle")&&a.quoteStyle!=="single"&&a.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Se(a,"maxStringLength")&&(typeof a.maxStringLength=="number"?a.maxStringLength<0&&a.maxStringLength!==1/0:a.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var l=Se(a,"customInspect")?a.customInspect:!0;if(typeof l!="boolean"&&l!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Se(a,"indent")&&a.indent!==null&&a.indent!==" "&&!(parseInt(a.indent,10)===a.indent&&a.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(Se(a,"numericSeparator")&&typeof a.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var u=a.numericSeparator;if(typeof e>"u")return"undefined";if(e===null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="string")return Ln(e,a);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var i=String(e);return u?Mn(e,i):i}if(typeof e=="bigint"){var d=String(e)+"n";return u?Mn(e,d):d}var s=typeof a.depth>"u"?5:a.depth;if(typeof n>"u"&&(n=0),n>=s&&s>0&&typeof e=="object")return ht(e)?"[Array]":"[Object]";var b=Ki(a,n);if(typeof o>"u")o=[];else if(jn(o,e)>=0)return"[Circular]";function v(C,T,k){if(T&&(o=Fi.call(o),o.push(T)),k){var oe={depth:a.depth};return Se(a,"quoteStyle")&&(oe.quoteStyle=a.quoteStyle),r(C,oe,n+1,o)}return r(C,a,n+1,o)}if(typeof e=="function"&&!kn(e)){var E=Ui(e),p=Ir(e,v);return"[Function"+(E?": "+E:" (anonymous)")+"]"+(p.length>0?" { "+fe.call(p,", ")+" }":"")}if(Nn(e)){var m=Ke?Ee.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):mt.call(e);return typeof e=="object"&&!Ke?dr(m):m}if(Gi(e)){for(var y="<"+Pn.call(String(e.nodeName)),h=e.attributes||[],g=0;g<h.length;g++)y+=" "+h[g].name+"="+Dn(Ii(h[g].value),"double",a);return y+=">",e.childNodes&&e.childNodes.length&&(y+="..."),y+="</"+Pn.call(String(e.nodeName))+">",y}if(ht(e)){if(e.length===0)return"[]";var w=Ir(e,v);return b&&!Yi(w)?"["+bt(w,b)+"]":"[ "+fe.call(w,", ")+" ]"}if(Di(e)){var x=Ir(e,v);return!("cause"in Error.prototype)&&"cause"in e&&!Cn.call(e,"cause")?"{ ["+String(e)+"] "+fe.call(Tn.call("[cause]: "+v(e.cause),x),", ")+" }":x.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+fe.call(x,", ")+" }"}if(typeof e=="object"&&l){if(_n&&typeof e[_n]=="function"&&vt)return vt(e,{depth:s-n});if(l!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(Bi(e)){var P=[];return Sn&&Sn.call(e,function(C,T){P.push(v(T,e,!0)+" => "+v(C,e))}),Wn("Map",Fr.call(e),P,b)}if(Vi(e)){var D=[];return xn&&xn.call(e,function(C){D.push(v(C,e))}),Wn("Set",Mr.call(e),D,b)}if(Ri(e))return gt("WeakMap");if(qi(e))return gt("WeakSet");if(Hi(e))return gt("WeakRef");if(Ni(e))return dr(v(Number(e)));if(Li(e))return dr(v(pt.call(e)));if(ji(e))return dr(Pi.call(e));if(ki(e))return dr(v(String(e)));if(typeof window<"u"&&e===window)return"{ [object Window] }";if(typeof globalThis<"u"&&e===globalThis||typeof Zr<"u"&&e===Zr)return"{ [object globalThis] }";if(!_i(e)&&!kn(e)){var _=Ir(e,v),U=Fn?Fn(e)===Object.prototype:e instanceof Object||e.constructor===Object,H=e instanceof Object?"":"null prototype",j=!U&&Q&&Object(e)===e&&Q in e?dt.call(xe(e),8,-1):H?"Object":"",z=U||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",V=z+(j||H?"["+fe.call(Tn.call([],j||[],H||[]),": ")+"] ":"");return _.length===0?V+"{}":b?V+"{"+bt(_,b)+"}":V+"{ "+fe.call(_,", ")+" }"}return String(e)};function Dn(r,e,t){var n=(t.quoteStyle||e)==="double"?'"':"'";return n+r+n}function Ii(r){return Ee.call(String(r),/"/g,""")}function ht(r){return xe(r)==="[object Array]"&&(!Q||!(typeof r=="object"&&Q in r))}function _i(r){return xe(r)==="[object Date]"&&(!Q||!(typeof r=="object"&&Q in r))}function kn(r){return xe(r)==="[object RegExp]"&&(!Q||!(typeof r=="object"&&Q in r))}function Di(r){return xe(r)==="[object Error]"&&(!Q||!(typeof r=="object"&&Q in r))}function ki(r){return xe(r)==="[object String]"&&(!Q||!(typeof r=="object"&&Q in r))}function Ni(r){return xe(r)==="[object Number]"&&(!Q||!(typeof r=="object"&&Q in r))}function ji(r){return xe(r)==="[object Boolean]"&&(!Q||!(typeof r=="object"&&Q in r))}function Nn(r){if(Ke)return r&&typeof r=="object"&&r instanceof Symbol;if(typeof r=="symbol")return!0;if(!r||typeof r!="object"||!mt)return!1;try{return mt.call(r),!0}catch{}return!1}function Li(r){if(!r||typeof r!="object"||!pt)return!1;try{return pt.call(r),!0}catch{}return!1}var Wi=Object.prototype.hasOwnProperty||function(r){return r in this};function Se(r,e){return Wi.call(r,e)}function xe(r){return Ai.call(r)}function Ui(r){if(r.name)return r.name;var e=$i.call(Ti.call(r),/^function\s*([\w$]+)/);return e?e[1]:null}function jn(r,e){if(r.indexOf)return r.indexOf(e);for(var t=0,n=r.length;t<n;t++)if(r[t]===e)return t;return-1}function Bi(r){if(!Fr||!r||typeof r!="object")return!1;try{Fr.call(r);try{Mr.call(r)}catch{return!0}return r instanceof Map}catch{}return!1}function Ri(r){if(!cr||!r||typeof r!="object")return!1;try{cr.call(r,cr);try{fr.call(r,fr)}catch{return!0}return r instanceof WeakMap}catch{}return!1}function Hi(r){if(!On||!r||typeof r!="object")return!1;try{return On.call(r),!0}catch{}return!1}function Vi(r){if(!Mr||!r||typeof r!="object")return!1;try{Mr.call(r);try{Fr.call(r)}catch{return!0}return r instanceof Set}catch{}return!1}function qi(r){if(!fr||!r||typeof r!="object")return!1;try{fr.call(r,fr);try{cr.call(r,cr)}catch{return!0}return r instanceof WeakSet}catch{}return!1}function Gi(r){return!r||typeof r!="object"?!1:typeof HTMLElement<"u"&&r instanceof HTMLElement?!0:typeof r.nodeName=="string"&&typeof r.getAttribute=="function"}function Ln(r,e){if(r.length>e.maxStringLength){var t=r.length-e.maxStringLength,n="... "+t+" more character"+(t>1?"s":"");return Ln(dt.call(r,0,e.maxStringLength),e)+n}var o=Ee.call(Ee.call(r,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,zi);return Dn(o,"single",e)}function zi(r){var e=r.charCodeAt(0),t={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return t?"\\"+t:"\\x"+(e<16?"0":"")+Ci.call(e.toString(16))}function dr(r){return"Object("+r+")"}function gt(r){return r+" { ? }"}function Wn(r,e,t,n){var o=n?bt(t,n):fe.call(t,", ");return r+" ("+e+") {"+o+"}"}function Yi(r){for(var e=0;e<r.length;e++)if(jn(r[e],`
|
|
31
|
+
`)>=0)return!1;return!0}function Ki(r,e){var t;if(r.indent===" ")t=" ";else if(typeof r.indent=="number"&&r.indent>0)t=fe.call(Array(r.indent+1)," ");else return null;return{base:t,prev:fe.call(Array(e+1),t)}}function bt(r,e){if(r.length===0)return"";var t=`
|
|
32
32
|
`+e.prev+e.base;return t+fe.call(r,","+t)+`
|
|
33
|
-
`+e.prev}function Mr(r,e){var t=vt(r),n=[];if(t){n.length=r.length;for(var o=0;o<r.length;o++)n[o]=Se(r,o)?e(r[o],r):""}var a=typeof pt=="function"?pt(r):[],l;if(Ke){l={};for(var u=0;u<a.length;u++)l["$"+a[u]]=a[u]}for(var i in r)Se(r,i)&&(t&&String(Number(i))===i&&i<r.length||Ke&&l["$"+i]instanceof Symbol||(Pn.call(/[^\w$]/,i)?n.push(e(i,r)+": "+e(r[i],r)):n.push(i+": "+e(r[i],r))));if(typeof pt=="function")for(var d=0;d<a.length;d++)$n.call(r,a[d])&&n.push("["+e(a[d])+"]: "+e(r[a[d]],r));return n}var Wn=ze,Xe=bi,Ki=Fi,Xi=lr,Ir=Wn("%WeakMap%",!0),_r=Wn("%Map%",!0),Ji=Xe("WeakMap.prototype.get",!0),Qi=Xe("WeakMap.prototype.set",!0),Zi=Xe("WeakMap.prototype.has",!0),el=Xe("Map.prototype.get",!0),rl=Xe("Map.prototype.set",!0),tl=Xe("Map.prototype.has",!0),bt=function(r,e){for(var t=r,n;(n=t.next)!==null;t=n)if(n.key===e)return t.next=n.next,n.next=r.next,r.next=n,n},nl=function(r,e){var t=bt(r,e);return t&&t.value},ol=function(r,e,t){var n=bt(r,e);n?n.value=t:r.next={key:e,next:r.next,value:t}},al=function(r,e){return!!bt(r,e)},il=function(){var e,t,n,o={assert:function(a){if(!o.has(a))throw new Xi("Side channel does not contain "+Ki(a))},get:function(a){if(Ir&&a&&(typeof a=="object"||typeof a=="function")){if(e)return Ji(e,a)}else if(_r){if(t)return el(t,a)}else if(n)return nl(n,a)},has:function(a){if(Ir&&a&&(typeof a=="object"||typeof a=="function")){if(e)return Zi(e,a)}else if(_r){if(t)return tl(t,a)}else if(n)return al(n,a);return!1},set:function(a,l){Ir&&a&&(typeof a=="object"||typeof a=="function")?(e||(e=new Ir),Qi(e,a,l)):_r?(t||(t=new _r),rl(t,a,l)):(n||(n={key:{},next:null}),ol(n,a,l))}};return o},ll=String.prototype.replace,ul=/%20/g,wt={RFC1738:"RFC1738",RFC3986:"RFC3986"},Et={default:wt.RFC3986,formatters:{RFC1738:function(r){return ll.call(r,ul,"+")},RFC3986:function(r){return String(r)}},RFC1738:wt.RFC1738,RFC3986:wt.RFC3986},sl=Et,St=Object.prototype.hasOwnProperty,Fe=Array.isArray,de=function(){for(var r=[],e=0;e<256;++e)r.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return r}(),cl=function(e){for(;e.length>1;){var t=e.pop(),n=t.obj[t.prop];if(Fe(n)){for(var o=[],a=0;a<n.length;++a)typeof n[a]<"u"&&o.push(n[a]);t.obj[t.prop]=o}}},Un=function(e,t){for(var n=t&&t.plainObjects?Object.create(null):{},o=0;o<e.length;++o)typeof e[o]<"u"&&(n[o]=e[o]);return n},fl=function r(e,t,n){if(!t)return e;if(typeof t!="object"){if(Fe(e))e.push(t);else if(e&&typeof e=="object")(n&&(n.plainObjects||n.allowPrototypes)||!St.call(Object.prototype,t))&&(e[t]=!0);else return[e,t];return e}if(!e||typeof e!="object")return[e].concat(t);var o=e;return Fe(e)&&!Fe(t)&&(o=Un(e,n)),Fe(e)&&Fe(t)?(t.forEach(function(a,l){if(St.call(e,l)){var u=e[l];u&&typeof u=="object"&&a&&typeof a=="object"?e[l]=r(u,a,n):e.push(a)}else e[l]=a}),e):Object.keys(t).reduce(function(a,l){var u=t[l];return St.call(a,l)?a[l]=r(a[l],u,n):a[l]=u,a},o)},dl=function(e,t){return Object.keys(t).reduce(function(n,o){return n[o]=t[o],n},e)},pl=function(r,e,t){var n=r.replace(/\+/g," ");if(t==="iso-8859-1")return n.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(n)}catch{return n}},xt=1024,yl=function(e,t,n,o,a){if(e.length===0)return e;var l=e;if(typeof e=="symbol"?l=Symbol.prototype.toString.call(e):typeof e!="string"&&(l=String(e)),n==="iso-8859-1")return escape(l).replace(/%u[0-9a-f]{4}/gi,function(E){return"%26%23"+parseInt(E.slice(2),16)+"%3B"});for(var u="",i=0;i<l.length;i+=xt){for(var d=l.length>=xt?l.slice(i,i+xt):l,s=[],g=0;g<d.length;++g){var v=d.charCodeAt(g);if(v===45||v===46||v===95||v===126||v>=48&&v<=57||v>=65&&v<=90||v>=97&&v<=122||a===sl.RFC1738&&(v===40||v===41)){s[s.length]=d.charAt(g);continue}if(v<128){s[s.length]=de[v];continue}if(v<2048){s[s.length]=de[192|v>>6]+de[128|v&63];continue}if(v<55296||v>=57344){s[s.length]=de[224|v>>12]+de[128|v>>6&63]+de[128|v&63];continue}g+=1,v=65536+((v&1023)<<10|d.charCodeAt(g)&1023),s[s.length]=de[240|v>>18]+de[128|v>>12&63]+de[128|v>>6&63]+de[128|v&63]}u+=s.join("")}return u},ml=function(e){for(var t=[{obj:{o:e},prop:"o"}],n=[],o=0;o<t.length;++o)for(var a=t[o],l=a.obj[a.prop],u=Object.keys(l),i=0;i<u.length;++i){var d=u[i],s=l[d];typeof s=="object"&&s!==null&&n.indexOf(s)===-1&&(t.push({obj:l,prop:d}),n.push(s))}return cl(t),e},vl=function(e){return Object.prototype.toString.call(e)==="[object RegExp]"},hl=function(e){return!e||typeof e!="object"?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},gl=function(e,t){return[].concat(e,t)},bl=function(e,t){if(Fe(e)){for(var n=[],o=0;o<e.length;o+=1)n.push(t(e[o]));return n}return t(e)},Bn={arrayToObject:Un,assign:dl,combine:gl,compact:ml,decode:pl,encode:yl,isBuffer:hl,isRegExp:vl,maybeMap:bl,merge:fl},Rn=il,Dr=Bn,dr=Et,wl=Object.prototype.hasOwnProperty,Hn={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},pe=Array.isArray,El=Array.prototype.push,Vn=function(r,e){El.apply(r,pe(e)?e:[e])},Sl=Date.prototype.toISOString,qn=dr.default,K={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:Dr.encode,encodeValuesOnly:!1,format:qn,formatter:dr.formatters[qn],indices:!1,serializeDate:function(e){return Sl.call(e)},skipNulls:!1,strictNullHandling:!1},xl=function(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="symbol"||typeof e=="bigint"},Ot={},Ol=function r(e,t,n,o,a,l,u,i,d,s,g,v,E,p,m,y,h,b){for(var w=e,x=b,P=0,D=!1;(x=x.get(Ot))!==void 0&&!D;){var _=x.get(e);if(P+=1,typeof _<"u"){if(_===P)throw new RangeError("Cyclic object value");D=!0}typeof x.get(Ot)>"u"&&(P=0)}if(typeof s=="function"?w=s(t,w):w instanceof Date?w=E(w):n==="comma"&&pe(w)&&(w=Dr.maybeMap(w,function(ce){return ce instanceof Date?E(ce):ce})),w===null){if(l)return d&&!y?d(t,K.encoder,h,"key",p):t;w=""}if(xl(w)||Dr.isBuffer(w)){if(d){var U=y?t:d(t,K.encoder,h,"key",p);return[m(U)+"="+m(d(w,K.encoder,h,"value",p))]}return[m(t)+"="+m(String(w))]}var H=[];if(typeof w>"u")return H;var j;if(n==="comma"&&pe(w))y&&d&&(w=Dr.maybeMap(w,d)),j=[{value:w.length>0?w.join(",")||null:void 0}];else if(pe(s))j=s;else{var z=Object.keys(w);j=g?z.sort(g):z}var V=i?t.replace(/\./g,"%2E"):t,C=o&&pe(w)&&w.length===1?V+"[]":V;if(a&&pe(w)&&w.length===0)return C+"[]";for(var T=0;T<j.length;++T){var k=j[T],oe=typeof k=="object"&&typeof k.value<"u"?k.value:w[k];if(!(u&&oe===null)){var se=v&&i?k.replace(/\./g,"%2E"):k,me=pe(w)?typeof n=="function"?n(C,se):C:C+(v?"."+se:"["+se+"]");b.set(e,P);var Z=Rn();Z.set(Ot,b),Vn(H,r(oe,me,n,o,a,l,u,i,n==="comma"&&y&&pe(w)?null:d,s,g,v,E,p,m,y,h,Z))}}return H},Pl=function(e){if(!e)return K;if(typeof e.allowEmptyArrays<"u"&&typeof e.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof e.encodeDotInKeys<"u"&&typeof e.encodeDotInKeys!="boolean")throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(e.encoder!==null&&typeof e.encoder<"u"&&typeof e.encoder!="function")throw new TypeError("Encoder has to be a function.");var t=e.charset||K.charset;if(typeof e.charset<"u"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var n=dr.default;if(typeof e.format<"u"){if(!wl.call(dr.formatters,e.format))throw new TypeError("Unknown format option provided.");n=e.format}var o=dr.formatters[n],a=K.filter;(typeof e.filter=="function"||pe(e.filter))&&(a=e.filter);var l;if(e.arrayFormat in Hn?l=e.arrayFormat:"indices"in e?l=e.indices?"indices":"repeat":l=K.arrayFormat,"commaRoundTrip"in e&&typeof e.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var u=typeof e.allowDots>"u"?e.encodeDotInKeys===!0?!0:K.allowDots:!!e.allowDots;return{addQueryPrefix:typeof e.addQueryPrefix=="boolean"?e.addQueryPrefix:K.addQueryPrefix,allowDots:u,allowEmptyArrays:typeof e.allowEmptyArrays=="boolean"?!!e.allowEmptyArrays:K.allowEmptyArrays,arrayFormat:l,charset:t,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:K.charsetSentinel,commaRoundTrip:e.commaRoundTrip,delimiter:typeof e.delimiter>"u"?K.delimiter:e.delimiter,encode:typeof e.encode=="boolean"?e.encode:K.encode,encodeDotInKeys:typeof e.encodeDotInKeys=="boolean"?e.encodeDotInKeys:K.encodeDotInKeys,encoder:typeof e.encoder=="function"?e.encoder:K.encoder,encodeValuesOnly:typeof e.encodeValuesOnly=="boolean"?e.encodeValuesOnly:K.encodeValuesOnly,filter:a,format:n,formatter:o,serializeDate:typeof e.serializeDate=="function"?e.serializeDate:K.serializeDate,skipNulls:typeof e.skipNulls=="boolean"?e.skipNulls:K.skipNulls,sort:typeof e.sort=="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:K.strictNullHandling}},Al=function(r,e){var t=r,n=Pl(e),o,a;typeof n.filter=="function"?(a=n.filter,t=a("",t)):pe(n.filter)&&(a=n.filter,o=a);var l=[];if(typeof t!="object"||t===null)return"";var u=Hn[n.arrayFormat],i=u==="comma"&&n.commaRoundTrip;o||(o=Object.keys(t)),n.sort&&o.sort(n.sort);for(var d=Rn(),s=0;s<o.length;++s){var g=o[s];n.skipNulls&&t[g]===null||Vn(l,Ol(t[g],g,u,i,n.allowEmptyArrays,n.strictNullHandling,n.skipNulls,n.encodeDotInKeys,n.encode?n.encoder:null,n.filter,n.sort,n.allowDots,n.serializeDate,n.format,n.formatter,n.encodeValuesOnly,n.charset,d))}var v=l.join(n.delimiter),E=n.addQueryPrefix===!0?"?":"";return n.charsetSentinel&&(n.charset==="iso-8859-1"?E+="utf8=%26%2310003%3B&":E+="utf8=%E2%9C%93&"),v.length>0?E+v:""},Je=Bn,Pt=Object.prototype.hasOwnProperty,Tl=Array.isArray,R={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:Je.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictNullHandling:!1},$l=function(r){return r.replace(/&#(\d+);/g,function(e,t){return String.fromCharCode(parseInt(t,10))})},Gn=function(r,e){return r&&typeof r=="string"&&e.comma&&r.indexOf(",")>-1?r.split(","):r},Cl="utf8=%26%2310003%3B",Fl="utf8=%E2%9C%93",Ml=function(e,t){var n={__proto__:null},o=t.ignoreQueryPrefix?e.replace(/^\?/,""):e;o=o.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var a=t.parameterLimit===1/0?void 0:t.parameterLimit,l=o.split(t.delimiter,a),u=-1,i,d=t.charset;if(t.charsetSentinel)for(i=0;i<l.length;++i)l[i].indexOf("utf8=")===0&&(l[i]===Fl?d="utf-8":l[i]===Cl&&(d="iso-8859-1"),u=i,i=l.length);for(i=0;i<l.length;++i)if(i!==u){var s=l[i],g=s.indexOf("]="),v=g===-1?s.indexOf("="):g+1,E,p;v===-1?(E=t.decoder(s,R.decoder,d,"key"),p=t.strictNullHandling?null:""):(E=t.decoder(s.slice(0,v),R.decoder,d,"key"),p=Je.maybeMap(Gn(s.slice(v+1),t),function(y){return t.decoder(y,R.decoder,d,"value")})),p&&t.interpretNumericEntities&&d==="iso-8859-1"&&(p=$l(p)),s.indexOf("[]=")>-1&&(p=Tl(p)?[p]:p);var m=Pt.call(n,E);m&&t.duplicates==="combine"?n[E]=Je.combine(n[E],p):(!m||t.duplicates==="last")&&(n[E]=p)}return n},Il=function(r,e,t,n){for(var o=n?e:Gn(e,t),a=r.length-1;a>=0;--a){var l,u=r[a];if(u==="[]"&&t.parseArrays)l=t.allowEmptyArrays&&(o===""||t.strictNullHandling&&o===null)?[]:[].concat(o);else{l=t.plainObjects?Object.create(null):{};var i=u.charAt(0)==="["&&u.charAt(u.length-1)==="]"?u.slice(1,-1):u,d=t.decodeDotInKeys?i.replace(/%2E/g,"."):i,s=parseInt(d,10);!t.parseArrays&&d===""?l={0:o}:!isNaN(s)&&u!==d&&String(s)===d&&s>=0&&t.parseArrays&&s<=t.arrayLimit?(l=[],l[s]=o):d!=="__proto__"&&(l[d]=o)}o=l}return o},_l=function(e,t,n,o){if(e){var a=n.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,l=/(\[[^[\]]*])/,u=/(\[[^[\]]*])/g,i=n.depth>0&&l.exec(a),d=i?a.slice(0,i.index):a,s=[];if(d){if(!n.plainObjects&&Pt.call(Object.prototype,d)&&!n.allowPrototypes)return;s.push(d)}for(var g=0;n.depth>0&&(i=u.exec(a))!==null&&g<n.depth;){if(g+=1,!n.plainObjects&&Pt.call(Object.prototype,i[1].slice(1,-1))&&!n.allowPrototypes)return;s.push(i[1])}if(i){if(n.strictDepth===!0)throw new RangeError("Input depth exceeded depth option of "+n.depth+" and strictDepth is true");s.push("["+a.slice(i.index)+"]")}return Il(s,t,n,o)}},Dl=function(e){if(!e)return R;if(typeof e.allowEmptyArrays<"u"&&typeof e.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof e.decodeDotInKeys<"u"&&typeof e.decodeDotInKeys!="boolean")throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(e.decoder!==null&&typeof e.decoder<"u"&&typeof e.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof e.charset<"u"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var t=typeof e.charset>"u"?R.charset:e.charset,n=typeof e.duplicates>"u"?R.duplicates:e.duplicates;if(n!=="combine"&&n!=="first"&&n!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var o=typeof e.allowDots>"u"?e.decodeDotInKeys===!0?!0:R.allowDots:!!e.allowDots;return{allowDots:o,allowEmptyArrays:typeof e.allowEmptyArrays=="boolean"?!!e.allowEmptyArrays:R.allowEmptyArrays,allowPrototypes:typeof e.allowPrototypes=="boolean"?e.allowPrototypes:R.allowPrototypes,allowSparse:typeof e.allowSparse=="boolean"?e.allowSparse:R.allowSparse,arrayLimit:typeof e.arrayLimit=="number"?e.arrayLimit:R.arrayLimit,charset:t,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:R.charsetSentinel,comma:typeof e.comma=="boolean"?e.comma:R.comma,decodeDotInKeys:typeof e.decodeDotInKeys=="boolean"?e.decodeDotInKeys:R.decodeDotInKeys,decoder:typeof e.decoder=="function"?e.decoder:R.decoder,delimiter:typeof e.delimiter=="string"||Je.isRegExp(e.delimiter)?e.delimiter:R.delimiter,depth:typeof e.depth=="number"||e.depth===!1?+e.depth:R.depth,duplicates:n,ignoreQueryPrefix:e.ignoreQueryPrefix===!0,interpretNumericEntities:typeof e.interpretNumericEntities=="boolean"?e.interpretNumericEntities:R.interpretNumericEntities,parameterLimit:typeof e.parameterLimit=="number"?e.parameterLimit:R.parameterLimit,parseArrays:e.parseArrays!==!1,plainObjects:typeof e.plainObjects=="boolean"?e.plainObjects:R.plainObjects,strictDepth:typeof e.strictDepth=="boolean"?!!e.strictDepth:R.strictDepth,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:R.strictNullHandling}},kl=function(r,e){var t=Dl(e);if(r===""||r===null||typeof r>"u")return t.plainObjects?Object.create(null):{};for(var n=typeof r=="string"?Ml(r,t):r,o=t.plainObjects?Object.create(null):{},a=Object.keys(n),l=0;l<a.length;++l){var u=a[l],i=_l(u,n[u],t,typeof r=="string");o=Je.merge(o,i,t)}return t.allowSparse===!0?o:Je.compact(o)},Nl=Al,jl=kl,Ll=Et,zn={formats:Ll,parse:jl,stringify:Nl},Wl={exports:{}};/* NProgress, (c) 2013, 2014 Rico Sta. Cruz - http://ricostacruz.com/nprogress
|
|
34
|
-
* @license MIT */(function(r,e){(function(t,n){r.exports=n()})(Qr,function(){var t={};t.version="0.2.0";var n=t.settings={minimum:.08,easing:"ease",positionUsing:"",speed:200,trickle:!0,trickleRate:.02,trickleSpeed:800,showSpinner:!0,barSelector:'[role="bar"]',spinnerSelector:'[role="spinner"]',parent:"body",template:'<div class="bar" role="bar"><div class="peg"></div></div><div class="spinner" role="spinner"><div class="spinner-icon"></div></div>'};t.configure=function(p){var m,y;for(m in p)y=p[m],y!==void 0&&p.hasOwnProperty(m)&&(n[m]=y);return this},t.status=null,t.set=function(p){var m=t.isStarted();p=o(p,n.minimum,1),t.status=p===1?null:p;var y=t.render(!m),h=y.querySelector(n.barSelector),b=n.speed,w=n.easing;return y.offsetWidth,u(function(x){n.positionUsing===""&&(n.positionUsing=t.getPositioningCSS()),i(h,l(p,b,w)),p===1?(i(y,{transition:"none",opacity:1}),y.offsetWidth,setTimeout(function(){i(y,{transition:"all "+b+"ms linear",opacity:0}),setTimeout(function(){t.remove(),x()},b)},b)):setTimeout(x,b)}),this},t.isStarted=function(){return typeof t.status=="number"},t.start=function(){t.status||t.set(0);var p=function(){setTimeout(function(){t.status&&(t.trickle(),p())},n.trickleSpeed)};return n.trickle&&p(),this},t.done=function(p){return!p&&!t.status?this:t.inc(.3+.5*Math.random()).set(1)},t.inc=function(p){var m=t.status;return m?(typeof p!="number"&&(p=(1-m)*o(Math.random()*m,.1,.95)),m=o(m+p,0,.994),t.set(m)):t.start()},t.trickle=function(){return t.inc(Math.random()*n.trickleRate)},function(){var p=0,m=0;t.promise=function(y){return!y||y.state()==="resolved"?this:(m===0&&t.start(),p++,m++,y.always(function(){m--,m===0?(p=0,t.done()):t.set((p-m)/p)}),this)}}(),t.render=function(p){if(t.isRendered())return document.getElementById("nprogress");s(document.documentElement,"nprogress-busy");var m=document.createElement("div");m.id="nprogress",m.innerHTML=n.template;var y=m.querySelector(n.barSelector),h=p?"-100":a(t.status||0),b=document.querySelector(n.parent),w;return i(y,{transition:"all 0 linear",transform:"translate3d("+h+"%,0,0)"}),n.showSpinner||(w=m.querySelector(n.spinnerSelector),w&&E(w)),b!=document.body&&s(b,"nprogress-custom-parent"),b.appendChild(m),m},t.remove=function(){g(document.documentElement,"nprogress-busy"),g(document.querySelector(n.parent),"nprogress-custom-parent");var p=document.getElementById("nprogress");p&&E(p)},t.isRendered=function(){return!!document.getElementById("nprogress")},t.getPositioningCSS=function(){var p=document.body.style,m="WebkitTransform"in p?"Webkit":"MozTransform"in p?"Moz":"msTransform"in p?"ms":"OTransform"in p?"O":"";return m+"Perspective"in p?"translate3d":m+"Transform"in p?"translate":"margin"};function o(p,m,y){return p<m?m:p>y?y:p}function a(p){return(-1+p)*100}function l(p,m,y){var h;return n.positionUsing==="translate3d"?h={transform:"translate3d("+a(p)+"%,0,0)"}:n.positionUsing==="translate"?h={transform:"translate("+a(p)+"%,0)"}:h={"margin-left":a(p)+"%"},h.transition="all "+m+"ms "+y,h}var u=function(){var p=[];function m(){var y=p.shift();y&&y(m)}return function(y){p.push(y),p.length==1&&m()}}(),i=function(){var p=["Webkit","O","Moz","ms"],m={};function y(x){return x.replace(/^-ms-/,"ms-").replace(/-([\da-z])/gi,function(P,D){return D.toUpperCase()})}function h(x){var P=document.body.style;if(x in P)return x;for(var D=p.length,_=x.charAt(0).toUpperCase()+x.slice(1),U;D--;)if(U=p[D]+_,U in P)return U;return x}function b(x){return x=y(x),m[x]||(m[x]=h(x))}function w(x,P,D){P=b(P),x.style[P]=D}return function(x,P){var D=arguments,_,U;if(D.length==2)for(_ in P)U=P[_],U!==void 0&&P.hasOwnProperty(_)&&w(x,_,U);else w(x,D[1],D[2])}}();function d(p,m){var y=typeof p=="string"?p:v(p);return y.indexOf(" "+m+" ")>=0}function s(p,m){var y=v(p),h=y+m;d(y,m)||(p.className=h.substring(1))}function g(p,m){var y=v(p),h;d(p,m)&&(h=y.replace(" "+m+" "," "),p.className=h.substring(1,h.length-1))}function v(p){return(" "+(p.className||"")+" ").replace(/\s+/gi," ")}function E(p){p&&p.parentNode&&p.parentNode.removeChild(p)}return t})})(Wl);function Ul(r,e,t,n="brackets"){let o=/^https?:\/\//.test(e.toString()),a=o||e.toString().startsWith("/"),l=!a&&!e.toString().startsWith("#")&&!e.toString().startsWith("?"),u=e.toString().includes("?")||r==="get"&&Object.keys(t).length,i=e.toString().includes("#"),d=new URL(e.toString(),"http://localhost");return r==="get"&&Object.keys(t).length&&(d.search=zn.stringify(xa(zn.parse(d.search,{ignoreQueryPrefix:!0}),t),{encodeValuesOnly:!0,arrayFormat:n}),t={}),[[o?`${d.protocol}//${d.host}`:"",a?d.pathname:"",l?d.pathname.substring(1):"",u?d.search:"",i?d.hash:""].join(""),t]}const kr=f.createContext(null);kr.displayName="ModalStackContext";let Yn=null,Kn=null,pr=null,At=null,Tt=[];const Xn=({children:r})=>{const[e,t]=f.useState([]),[n,o]=f.useState({}),a=m=>{t(y=>{const h=m([...y]),b=w=>{var x;return h.length<2?!0:((x=h.map(P=>({id:P.id,shouldRender:P.shouldRender})).reverse().find(P=>P.shouldRender))==null?void 0:x.id)===w};return h.forEach((w,x)=>{h[x].onTopOfStack=b(w.id),h[x].getParentModal=()=>x<1?null:h.slice(0,x).reverse().find(P=>P.isOpen),h[x].getChildModal=()=>x===h.length-1?null:h.slice(x+1).find(P=>P.isOpen)}),h})};f.useEffect(()=>{Tt=e},[e]);class l{constructor(y,h,b,w,x){le(this,"update",(y,h,b)=>{a(w=>w.map(x=>(x.id===this.id&&(x.config=y,x.onCloseCallback=h,x.afterLeaveCallback=b),x)))});le(this,"show",()=>{a(y=>y.map(h=>(h.id===this.id&&!h.isOpen&&(h.isOpen=!0,h.shouldRender=!0),h)))});le(this,"setOpen",y=>{y?this.show():this.close()});le(this,"close",()=>{a(y=>y.map(h=>{var b;return h.id===this.id&&h.isOpen&&(Object.keys(h.listeners).forEach(w=>{h.off(w)}),h.isOpen=!1,(b=h.onCloseCallback)==null||b.call(h)),h}))});le(this,"afterLeave",()=>{this.isOpen||a(y=>{const h=y.map(b=>{var w;return b.id===this.id&&!b.isOpen&&(b.shouldRender=!1,(w=b.afterLeaveCallback)==null||w.call(b),b.afterLeaveCallback=null),b});return this.index===0?[]:h})});le(this,"on",(y,h)=>{this.listeners[y]=this.listeners[y]??[],this.listeners[y].push(h)});le(this,"off",(y,h)=>{var b;h?this.listeners[y]=((b=this.listeners[y])==null?void 0:b.filter(w=>w!==h))??[]:delete this.listeners[y]});le(this,"emit",(y,...h)=>{var b;(b=this.listeners[y])==null||b.forEach(w=>w(...h))});le(this,"registerEventListenersFromProps",y=>{const h=[];return Object.keys(y).filter(b=>b.startsWith("on")).forEach(b=>{const w=b.replace(/^on/,"").replace(/^./,x=>x.toLowerCase()).replace(/([A-Z])/g,"-$1").toLowerCase();this.on(w,y[b]),h.push(()=>this.off(w,y[b]))}),()=>h.forEach(b=>b())});le(this,"reload",(y={})=>{var b;let h=Object.keys(this.response.props);y.only&&(h=en(h,y.only)),y.except&&(h=ia(h,y.except)),(b=this.response)!=null&&b.url&&ve.get(this.response.url,{headers:{Accept:"text/html, application/xhtml+xml","X-Inertia":!0,"X-Inertia-Partial-Component":this.response.component,"X-Inertia-Version":this.response.version,"X-Inertia-Partial-Data":h.join(","),"X-InertiaUI-Modal":!0,"X-InertiaUI-Modal-Use-Router":0,"X-InertiaUI-Modal-Base-Url":pr}}).then(w=>{this.updateProps(w.data.props)})});le(this,"updateProps",y=>{Object.assign(this.props,y),a(h=>h)});this.id=l.generateId(),this.isOpen=!1,this.shouldRender=!1,this.listeners={},this.component=y,this.props=h.props,this.response=h,this.config=b,this.onCloseCallback=w,this.afterLeaveCallback=x,this.index=-1,this.getParentModal=()=>null,this.getChildModal=()=>null,this.onTopOfStack=!0}static generateId(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?`inertiaui_modal_${crypto.randomUUID()}`:`inertiaui_modal_${Date.now().toString(36)}_${Math.random().toString(36).substr(2,9)}`}}const u=(m,y={},h=null,b=null)=>Kn(m.component).then(w=>i(w,m,y,h,b)),i=(m,y,h,b,w)=>{const x=new l(m,y,h,b,w);return x.index=e.length,a(P=>[...P,x]),x.show(),x};function d(m,y,h,b){if(!n[m])throw new Error(`The local modal "${m}" has not been registered.`);const w=i(null,{},y,h,b);return w.name=m,n[m].callback(w),w}const s=(m,y={})=>g(m,y.method??"get",y.data??{},y.headers??{},y.config??{},y.onClose,y.onAfterLeave,y.queryStringArrayFormat??"brackets",y.navigate??Pr("navigate")),g=(m,y,h={},b={},w={},x=null,P=null,D="brackets",_=!1)=>new Promise((U,H)=>{if(m.startsWith("#")){U(d(m.substring(1),w,x,P));return}const[j,z]=Ul(y,m||"",h,D);let V=_&&e.length===0;if(e.length===0&&(pr=typeof window<"u"?window.location.href:""),b={...b,Accept:"text/html, application/xhtml+xml","X-Requested-With":"XMLHttpRequest","X-Inertia":!0,"X-Inertia-Version":Yn,"X-InertiaUI-Modal":!0,"X-InertiaUI-Modal-Use-Router":V?1:0,"X-InertiaUI-Modal-Base-Url":pr},V)return At=null,Ue.router.visit(j,{method:y,data:z,headers:b,preserveScroll:!0,preserveState:!0,onError:H,onFinish:()=>{ua(()=>At).then(C=>{const T=C.onCloseCallback,k=C.afterLeaveCallback;C.update(w,()=>{x==null||x(),T==null||T()},()=>{P==null||P(),k==null||k()}),U(C)})}});ve({url:j,method:y,data:z,headers:b}).then(C=>U(u(C.data,w,x,P))).catch(C=>{H(C)})}),p={stack:e,localModals:n,push:i,pushFromResponseData:u,closeAll:()=>{Tt.reverse().forEach(m=>m.close())},reset:()=>a(()=>[]),visit:g,visitModal:s,registerLocalModal:(m,y)=>{o(h=>({...h,[m]:{name:m,callback:y}}))},removeLocalModal:m=>{o(y=>{const h={...y};return delete h[m],h})}};return $.jsx(kr.Provider,{value:p,children:r})},yr=()=>{const r=f.useContext(kr);if(r===null)throw new Error("useModalStack must be used within a ModalStackProvider");return r},Jn=["closeButton","closeExplicitly","maxWidth","paddingClasses","panelClasses","position","slideover"],Bl=(r,e)=>{e.initialPage&&(Yn=e.initialPage.version),e.resolveComponent&&(Kn=e.resolveComponent);const t=({Component:n,props:o,key:a})=>{const l=()=>{const u=f.createElement(n,{key:a,...o});return typeof n.layout=="function"?n.layout(u):Array.isArray(n.layout)?n.layout.concat(u).reverse().reduce((d,s)=>f.createElement(s,o,d)):u};return $.jsxs($.Fragment,{children:[l(),$.jsx(Qn,{})]})};return $.jsx(Xn,{children:$.jsx(r,{...e,children:t})})},Qn=({children:r})=>{var u;const e=f.useContext(kr);let t=!1,n=!1;f.useEffect(()=>Ue.router.on("start",()=>t=!0),[]),f.useEffect(()=>Ue.router.on("finish",()=>t=!1),[]),f.useEffect(()=>Ue.router.on("navigate",function(i){const d=i.detail.page.props._inertiaui_modal;if(!d){n&&e.closeAll();return}n=d,pr=d.baseUrl,e.pushFromResponseData(d,{},()=>{if(!d.baseUrl){console.error("No base url in modal response data so cannot navigate back");return}!t&&window.location.href!==d.baseUrl&&Ue.router.visit(d.baseUrl,{preserveScroll:!0,preserveState:!0})}).then(s=>{At=s})}),[]);const o=i=>(Tt.length&&(i.headers["X-InertiaUI-Modal-Base-Url"]=pr),i);f.useEffect(()=>(ve.interceptors.request.use(o),()=>ve.interceptors.request.eject(o)),[]);const a=Ue.usePage(),l=f.useRef();return f.useEffect(()=>{var s,g;const i=(s=a.props)==null?void 0:s._inertiaui_modal,d=l.current;l.current=i,i&&d&&i.component===d.component&&i.url===d.url&&((g=e.stack[0])==null||g.updateProps(i.props??{}))},[(u=a.props)==null?void 0:u._inertiaui_modal]),$.jsxs($.Fragment,{children:[r,e.stack.length>0&&$.jsx(Zn,{index:0})]})},$t=f.createContext(null);$t.displayName="ModalIndexContext";const Ct=()=>{const r=f.useContext($t);if(r===void 0)throw new Error("useModalIndex must be used within a ModalIndexProvider");return r},Zn=({index:r})=>{const{stack:e}=yr(),t=f.useMemo(()=>e[r],[e,r]);return(t==null?void 0:t.component)&&$.jsx($t.Provider,{value:r,children:$.jsx(t.component,{...t.props,onModalEvent:(...n)=>t.emit(...n)})})},Ft=f.forwardRef(({name:r,children:e,...t},n)=>{const o=Ct(),{stack:a,registerLocalModal:l,removeLocalModal:u}=yr(),[i,d]=f.useState(null),s=f.useMemo(()=>r?i:a[o],[r,i,o,a]),g=f.useMemo(()=>{var p;return(p=a.find(m=>m.shouldRender&&m.index>(s==null?void 0:s.index)))==null?void 0:p.index},[o,a]),v=f.useMemo(()=>(s==null?void 0:s.config.slideover)??t.slideover??Pr("type")==="slideover",[t.slideover]),E=f.useMemo(()=>({slideover:v,closeButton:t.closeButton??Be(v,"closeButton"),closeExplicitly:t.closeExplicitly??Be(v,"closeExplicitly"),maxWidth:t.maxWidth??Be(v,"maxWidth"),paddingClasses:t.paddingClasses??Be(v,"paddingClasses"),panelClasses:t.panelClasses??Be(v,"panelClasses"),position:t.position??Be(v,"position"),...s==null?void 0:s.config}),[t,s==null?void 0:s.config]);return f.useEffect(()=>{if(r){let p=null;return l(r,m=>{p=m.registerEventListenersFromProps(t),d(m)}),()=>{p==null||p(),p=null,u(r)}}return s.registerEventListenersFromProps(t)},[r]),f.useImperativeHandle(n,()=>({afterLeave:()=>s.afterLeave(),close:()=>s.close(),config:E,emit:(...p)=>s.emit(...p),getChildModal:()=>s.getChildModal(),getParentModal:()=>s.getParentModal(),id:s==null?void 0:s.id,index:s==null?void 0:s.index,isOpen:s==null?void 0:s.isOpen,modalContext:s,onTopOfStack:s==null?void 0:s.onTopOfStack,reload:()=>s.reload(),setOpen:()=>s.setOpen(),shouldRender:s==null?void 0:s.shouldRender}),[s]),(s==null?void 0:s.shouldRender)&&$.jsxs($.Fragment,{children:[typeof e=="function"?e({afterLeave:s.afterLeave,close:s.close,config:E,emit:s.emit,getChildModal:s.getChildModal,getParentModal:s.getParentModal,id:s.id,index:s.index,isOpen:s.isOpen,modalContext:s,onTopOfStack:s.onTopOfStack,reload:s.reload,setOpen:s.setOpen,shouldRender:s.shouldRender}):e,g&&$.jsx(Zn,{index:g})]})});Ft.displayName="HeadlessModal";function eo(r){var e,t,n="";if(typeof r=="string"||typeof r=="number")n+=r;else if(typeof r=="object")if(Array.isArray(r)){var o=r.length;for(e=0;e<o;e++)r[e]&&(t=eo(r[e]))&&(n&&(n+=" "),n+=t)}else for(t in r)r[t]&&(n&&(n+=" "),n+=t);return n}function Nr(){for(var r,e,t=0,n="",o=arguments.length;t<o;t++)(r=arguments[t])&&(e=eo(r))&&(n&&(n+=" "),n+=e);return n}var Rl=Object.defineProperty,Hl=(r,e,t)=>e in r?Rl(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Mt=(r,e,t)=>(Hl(r,typeof e!="symbol"?e+"":e,t),t);let Vl=class{constructor(){Mt(this,"current",this.detect()),Mt(this,"handoffState","pending"),Mt(this,"currentId",0)}set(e){this.current!==e&&(this.handoffState="pending",this.currentId=0,this.current=e)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return this.current==="server"}get isClient(){return this.current==="client"}detect(){return typeof window>"u"||typeof document>"u"?"server":"client"}handoff(){this.handoffState==="pending"&&(this.handoffState="complete")}get isHandoffComplete(){return this.handoffState==="complete"}},Me=new Vl;function jr(r){return Me.isServer?null:r instanceof Node?r.ownerDocument:r!=null&&r.hasOwnProperty("current")&&r.current instanceof Node?r.current.ownerDocument:document}function Lr(r){typeof queueMicrotask=="function"?queueMicrotask(r):Promise.resolve().then(r).catch(e=>setTimeout(()=>{throw e}))}function Oe(){let r=[],e={addEventListener(t,n,o,a){return t.addEventListener(n,o,a),e.add(()=>t.removeEventListener(n,o,a))},requestAnimationFrame(...t){let n=requestAnimationFrame(...t);return e.add(()=>cancelAnimationFrame(n))},nextFrame(...t){return e.requestAnimationFrame(()=>e.requestAnimationFrame(...t))},setTimeout(...t){let n=setTimeout(...t);return e.add(()=>clearTimeout(n))},microTask(...t){let n={current:!0};return Lr(()=>{n.current&&t[0]()}),e.add(()=>{n.current=!1})},style(t,n,o){let a=t.style.getPropertyValue(n);return Object.assign(t.style,{[n]:o}),this.add(()=>{Object.assign(t.style,{[n]:a})})},group(t){let n=Oe();return t(n),this.add(()=>n.dispose())},add(t){return r.includes(t)||r.push(t),()=>{let n=r.indexOf(t);if(n>=0)for(let o of r.splice(n,1))o()}},dispose(){for(let t of r.splice(0))t()}};return e}function It(){let[r]=f.useState(Oe);return f.useEffect(()=>()=>r.dispose(),[r]),r}let ee=(r,e)=>{Me.isServer?f.useEffect(r,e):f.useLayoutEffect(r,e)};function Ie(r){let e=f.useRef(r);return ee(()=>{e.current=r},[r]),e}let B=function(r){let e=Ie(r);return f.useCallback((...t)=>e.current(...t),[e])},ql=f.createContext(void 0);function Gl(){return f.useContext(ql)}function _t(...r){return Array.from(new Set(r.flatMap(e=>typeof e=="string"?e.split(" "):[]))).filter(Boolean).join(" ")}function Pe(r,e,...t){if(r in e){let o=e[r];return typeof o=="function"?o(...t):o}let n=new Error(`Tried to handle "${r}" but there is no handler defined. Only defined handlers are: ${Object.keys(e).map(o=>`"${o}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Pe),n}var Wr=(r=>(r[r.None=0]="None",r[r.RenderStrategy=1]="RenderStrategy",r[r.Static=2]="Static",r))(Wr||{}),Ae=(r=>(r[r.Unmount=0]="Unmount",r[r.Hidden=1]="Hidden",r))(Ae||{});function ae(){let r=Yl();return f.useCallback(e=>zl({mergeRefs:r,...e}),[r])}function zl({ourProps:r,theirProps:e,slot:t,defaultTag:n,features:o,visible:a=!0,name:l,mergeRefs:u}){u=u??Kl;let i=ro(e,r);if(a)return Ur(i,t,n,l,u);let d=o??0;if(d&2){let{static:s=!1,...g}=i;if(s)return Ur(g,t,n,l,u)}if(d&1){let{unmount:s=!0,...g}=i;return Pe(s?0:1,{0(){return null},1(){return Ur({...g,hidden:!0,style:{display:"none"}},t,n,l,u)}})}return Ur(i,t,n,l,u)}function Ur(r,e={},t,n,o){let{as:a=t,children:l,refName:u="ref",...i}=Dt(r,["unmount","static"]),d=r.ref!==void 0?{[u]:r.ref}:{},s=typeof l=="function"?l(e):l;"className"in i&&i.className&&typeof i.className=="function"&&(i.className=i.className(e)),i["aria-labelledby"]&&i["aria-labelledby"]===i.id&&(i["aria-labelledby"]=void 0);let g={};if(e){let v=!1,E=[];for(let[p,m]of Object.entries(e))typeof m=="boolean"&&(v=!0),m===!0&&E.push(p.replace(/([A-Z])/g,y=>`-${y.toLowerCase()}`));if(v){g["data-headlessui-state"]=E.join(" ");for(let p of E)g[`data-${p}`]=""}}if(a===f.Fragment&&(Object.keys(_e(i)).length>0||Object.keys(_e(g)).length>0))if(!f.isValidElement(s)||Array.isArray(s)&&s.length>1){if(Object.keys(_e(i)).length>0)throw new Error(['Passing props on "Fragment"!',"",`The current component <${n} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(_e(i)).concat(Object.keys(_e(g))).map(v=>` - ${v}`).join(`
|
|
33
|
+
`+e.prev}function Ir(r,e){var t=ht(r),n=[];if(t){n.length=r.length;for(var o=0;o<r.length;o++)n[o]=Se(r,o)?e(r[o],r):""}var a=typeof yt=="function"?yt(r):[],l;if(Ke){l={};for(var u=0;u<a.length;u++)l["$"+a[u]]=a[u]}for(var i in r)Se(r,i)&&(t&&String(Number(i))===i&&i<r.length||Ke&&l["$"+i]instanceof Symbol||(An.call(/[^\w$]/,i)?n.push(e(i,r)+": "+e(r[i],r)):n.push(i+": "+e(r[i],r))));if(typeof yt=="function")for(var d=0;d<a.length;d++)Cn.call(r,a[d])&&n.push("["+e(a[d])+"]: "+e(r[a[d]],r));return n}var Un=ze,Xe=wi,Xi=Mi,Ji=ur,_r=Un("%WeakMap%",!0),Dr=Un("%Map%",!0),Qi=Xe("WeakMap.prototype.get",!0),Zi=Xe("WeakMap.prototype.set",!0),el=Xe("WeakMap.prototype.has",!0),rl=Xe("Map.prototype.get",!0),tl=Xe("Map.prototype.set",!0),nl=Xe("Map.prototype.has",!0),wt=function(r,e){for(var t=r,n;(n=t.next)!==null;t=n)if(n.key===e)return t.next=n.next,n.next=r.next,r.next=n,n},ol=function(r,e){var t=wt(r,e);return t&&t.value},al=function(r,e,t){var n=wt(r,e);n?n.value=t:r.next={key:e,next:r.next,value:t}},il=function(r,e){return!!wt(r,e)},ll=function(){var e,t,n,o={assert:function(a){if(!o.has(a))throw new Ji("Side channel does not contain "+Xi(a))},get:function(a){if(_r&&a&&(typeof a=="object"||typeof a=="function")){if(e)return Qi(e,a)}else if(Dr){if(t)return rl(t,a)}else if(n)return ol(n,a)},has:function(a){if(_r&&a&&(typeof a=="object"||typeof a=="function")){if(e)return el(e,a)}else if(Dr){if(t)return nl(t,a)}else if(n)return il(n,a);return!1},set:function(a,l){_r&&a&&(typeof a=="object"||typeof a=="function")?(e||(e=new _r),Zi(e,a,l)):Dr?(t||(t=new Dr),tl(t,a,l)):(n||(n={key:{},next:null}),al(n,a,l))}};return o},ul=String.prototype.replace,sl=/%20/g,Et={RFC1738:"RFC1738",RFC3986:"RFC3986"},St={default:Et.RFC3986,formatters:{RFC1738:function(r){return ul.call(r,sl,"+")},RFC3986:function(r){return String(r)}},RFC1738:Et.RFC1738,RFC3986:Et.RFC3986},cl=St,xt=Object.prototype.hasOwnProperty,Fe=Array.isArray,de=function(){for(var r=[],e=0;e<256;++e)r.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return r}(),fl=function(e){for(;e.length>1;){var t=e.pop(),n=t.obj[t.prop];if(Fe(n)){for(var o=[],a=0;a<n.length;++a)typeof n[a]<"u"&&o.push(n[a]);t.obj[t.prop]=o}}},Bn=function(e,t){for(var n=t&&t.plainObjects?Object.create(null):{},o=0;o<e.length;++o)typeof e[o]<"u"&&(n[o]=e[o]);return n},dl=function r(e,t,n){if(!t)return e;if(typeof t!="object"){if(Fe(e))e.push(t);else if(e&&typeof e=="object")(n&&(n.plainObjects||n.allowPrototypes)||!xt.call(Object.prototype,t))&&(e[t]=!0);else return[e,t];return e}if(!e||typeof e!="object")return[e].concat(t);var o=e;return Fe(e)&&!Fe(t)&&(o=Bn(e,n)),Fe(e)&&Fe(t)?(t.forEach(function(a,l){if(xt.call(e,l)){var u=e[l];u&&typeof u=="object"&&a&&typeof a=="object"?e[l]=r(u,a,n):e.push(a)}else e[l]=a}),e):Object.keys(t).reduce(function(a,l){var u=t[l];return xt.call(a,l)?a[l]=r(a[l],u,n):a[l]=u,a},o)},pl=function(e,t){return Object.keys(t).reduce(function(n,o){return n[o]=t[o],n},e)},yl=function(r,e,t){var n=r.replace(/\+/g," ");if(t==="iso-8859-1")return n.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(n)}catch{return n}},Ot=1024,ml=function(e,t,n,o,a){if(e.length===0)return e;var l=e;if(typeof e=="symbol"?l=Symbol.prototype.toString.call(e):typeof e!="string"&&(l=String(e)),n==="iso-8859-1")return escape(l).replace(/%u[0-9a-f]{4}/gi,function(E){return"%26%23"+parseInt(E.slice(2),16)+"%3B"});for(var u="",i=0;i<l.length;i+=Ot){for(var d=l.length>=Ot?l.slice(i,i+Ot):l,s=[],b=0;b<d.length;++b){var v=d.charCodeAt(b);if(v===45||v===46||v===95||v===126||v>=48&&v<=57||v>=65&&v<=90||v>=97&&v<=122||a===cl.RFC1738&&(v===40||v===41)){s[s.length]=d.charAt(b);continue}if(v<128){s[s.length]=de[v];continue}if(v<2048){s[s.length]=de[192|v>>6]+de[128|v&63];continue}if(v<55296||v>=57344){s[s.length]=de[224|v>>12]+de[128|v>>6&63]+de[128|v&63];continue}b+=1,v=65536+((v&1023)<<10|d.charCodeAt(b)&1023),s[s.length]=de[240|v>>18]+de[128|v>>12&63]+de[128|v>>6&63]+de[128|v&63]}u+=s.join("")}return u},vl=function(e){for(var t=[{obj:{o:e},prop:"o"}],n=[],o=0;o<t.length;++o)for(var a=t[o],l=a.obj[a.prop],u=Object.keys(l),i=0;i<u.length;++i){var d=u[i],s=l[d];typeof s=="object"&&s!==null&&n.indexOf(s)===-1&&(t.push({obj:l,prop:d}),n.push(s))}return fl(t),e},hl=function(e){return Object.prototype.toString.call(e)==="[object RegExp]"},gl=function(e){return!e||typeof e!="object"?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},bl=function(e,t){return[].concat(e,t)},wl=function(e,t){if(Fe(e)){for(var n=[],o=0;o<e.length;o+=1)n.push(t(e[o]));return n}return t(e)},Rn={arrayToObject:Bn,assign:pl,combine:bl,compact:vl,decode:yl,encode:ml,isBuffer:gl,isRegExp:hl,maybeMap:wl,merge:dl},Hn=ll,kr=Rn,pr=St,El=Object.prototype.hasOwnProperty,Vn={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},pe=Array.isArray,Sl=Array.prototype.push,qn=function(r,e){Sl.apply(r,pe(e)?e:[e])},xl=Date.prototype.toISOString,Gn=pr.default,K={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:kr.encode,encodeValuesOnly:!1,format:Gn,formatter:pr.formatters[Gn],indices:!1,serializeDate:function(e){return xl.call(e)},skipNulls:!1,strictNullHandling:!1},Ol=function(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="symbol"||typeof e=="bigint"},Pt={},Pl=function r(e,t,n,o,a,l,u,i,d,s,b,v,E,p,m,y,h,g){for(var w=e,x=g,P=0,D=!1;(x=x.get(Pt))!==void 0&&!D;){var _=x.get(e);if(P+=1,typeof _<"u"){if(_===P)throw new RangeError("Cyclic object value");D=!0}typeof x.get(Pt)>"u"&&(P=0)}if(typeof s=="function"?w=s(t,w):w instanceof Date?w=E(w):n==="comma"&&pe(w)&&(w=kr.maybeMap(w,function(ce){return ce instanceof Date?E(ce):ce})),w===null){if(l)return d&&!y?d(t,K.encoder,h,"key",p):t;w=""}if(Ol(w)||kr.isBuffer(w)){if(d){var U=y?t:d(t,K.encoder,h,"key",p);return[m(U)+"="+m(d(w,K.encoder,h,"value",p))]}return[m(t)+"="+m(String(w))]}var H=[];if(typeof w>"u")return H;var j;if(n==="comma"&&pe(w))y&&d&&(w=kr.maybeMap(w,d)),j=[{value:w.length>0?w.join(",")||null:void 0}];else if(pe(s))j=s;else{var z=Object.keys(w);j=b?z.sort(b):z}var V=i?t.replace(/\./g,"%2E"):t,C=o&&pe(w)&&w.length===1?V+"[]":V;if(a&&pe(w)&&w.length===0)return C+"[]";for(var T=0;T<j.length;++T){var k=j[T],oe=typeof k=="object"&&typeof k.value<"u"?k.value:w[k];if(!(u&&oe===null)){var se=v&&i?k.replace(/\./g,"%2E"):k,me=pe(w)?typeof n=="function"?n(C,se):C:C+(v?"."+se:"["+se+"]");g.set(e,P);var Z=Hn();Z.set(Pt,g),qn(H,r(oe,me,n,o,a,l,u,i,n==="comma"&&y&&pe(w)?null:d,s,b,v,E,p,m,y,h,Z))}}return H},Al=function(e){if(!e)return K;if(typeof e.allowEmptyArrays<"u"&&typeof e.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof e.encodeDotInKeys<"u"&&typeof e.encodeDotInKeys!="boolean")throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(e.encoder!==null&&typeof e.encoder<"u"&&typeof e.encoder!="function")throw new TypeError("Encoder has to be a function.");var t=e.charset||K.charset;if(typeof e.charset<"u"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var n=pr.default;if(typeof e.format<"u"){if(!El.call(pr.formatters,e.format))throw new TypeError("Unknown format option provided.");n=e.format}var o=pr.formatters[n],a=K.filter;(typeof e.filter=="function"||pe(e.filter))&&(a=e.filter);var l;if(e.arrayFormat in Vn?l=e.arrayFormat:"indices"in e?l=e.indices?"indices":"repeat":l=K.arrayFormat,"commaRoundTrip"in e&&typeof e.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var u=typeof e.allowDots>"u"?e.encodeDotInKeys===!0?!0:K.allowDots:!!e.allowDots;return{addQueryPrefix:typeof e.addQueryPrefix=="boolean"?e.addQueryPrefix:K.addQueryPrefix,allowDots:u,allowEmptyArrays:typeof e.allowEmptyArrays=="boolean"?!!e.allowEmptyArrays:K.allowEmptyArrays,arrayFormat:l,charset:t,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:K.charsetSentinel,commaRoundTrip:e.commaRoundTrip,delimiter:typeof e.delimiter>"u"?K.delimiter:e.delimiter,encode:typeof e.encode=="boolean"?e.encode:K.encode,encodeDotInKeys:typeof e.encodeDotInKeys=="boolean"?e.encodeDotInKeys:K.encodeDotInKeys,encoder:typeof e.encoder=="function"?e.encoder:K.encoder,encodeValuesOnly:typeof e.encodeValuesOnly=="boolean"?e.encodeValuesOnly:K.encodeValuesOnly,filter:a,format:n,formatter:o,serializeDate:typeof e.serializeDate=="function"?e.serializeDate:K.serializeDate,skipNulls:typeof e.skipNulls=="boolean"?e.skipNulls:K.skipNulls,sort:typeof e.sort=="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:K.strictNullHandling}},Tl=function(r,e){var t=r,n=Al(e),o,a;typeof n.filter=="function"?(a=n.filter,t=a("",t)):pe(n.filter)&&(a=n.filter,o=a);var l=[];if(typeof t!="object"||t===null)return"";var u=Vn[n.arrayFormat],i=u==="comma"&&n.commaRoundTrip;o||(o=Object.keys(t)),n.sort&&o.sort(n.sort);for(var d=Hn(),s=0;s<o.length;++s){var b=o[s];n.skipNulls&&t[b]===null||qn(l,Pl(t[b],b,u,i,n.allowEmptyArrays,n.strictNullHandling,n.skipNulls,n.encodeDotInKeys,n.encode?n.encoder:null,n.filter,n.sort,n.allowDots,n.serializeDate,n.format,n.formatter,n.encodeValuesOnly,n.charset,d))}var v=l.join(n.delimiter),E=n.addQueryPrefix===!0?"?":"";return n.charsetSentinel&&(n.charset==="iso-8859-1"?E+="utf8=%26%2310003%3B&":E+="utf8=%E2%9C%93&"),v.length>0?E+v:""},Je=Rn,At=Object.prototype.hasOwnProperty,$l=Array.isArray,R={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:Je.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictNullHandling:!1},Cl=function(r){return r.replace(/&#(\d+);/g,function(e,t){return String.fromCharCode(parseInt(t,10))})},zn=function(r,e){return r&&typeof r=="string"&&e.comma&&r.indexOf(",")>-1?r.split(","):r},Fl="utf8=%26%2310003%3B",Ml="utf8=%E2%9C%93",Il=function(e,t){var n={__proto__:null},o=t.ignoreQueryPrefix?e.replace(/^\?/,""):e;o=o.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var a=t.parameterLimit===1/0?void 0:t.parameterLimit,l=o.split(t.delimiter,a),u=-1,i,d=t.charset;if(t.charsetSentinel)for(i=0;i<l.length;++i)l[i].indexOf("utf8=")===0&&(l[i]===Ml?d="utf-8":l[i]===Fl&&(d="iso-8859-1"),u=i,i=l.length);for(i=0;i<l.length;++i)if(i!==u){var s=l[i],b=s.indexOf("]="),v=b===-1?s.indexOf("="):b+1,E,p;v===-1?(E=t.decoder(s,R.decoder,d,"key"),p=t.strictNullHandling?null:""):(E=t.decoder(s.slice(0,v),R.decoder,d,"key"),p=Je.maybeMap(zn(s.slice(v+1),t),function(y){return t.decoder(y,R.decoder,d,"value")})),p&&t.interpretNumericEntities&&d==="iso-8859-1"&&(p=Cl(p)),s.indexOf("[]=")>-1&&(p=$l(p)?[p]:p);var m=At.call(n,E);m&&t.duplicates==="combine"?n[E]=Je.combine(n[E],p):(!m||t.duplicates==="last")&&(n[E]=p)}return n},_l=function(r,e,t,n){for(var o=n?e:zn(e,t),a=r.length-1;a>=0;--a){var l,u=r[a];if(u==="[]"&&t.parseArrays)l=t.allowEmptyArrays&&(o===""||t.strictNullHandling&&o===null)?[]:[].concat(o);else{l=t.plainObjects?Object.create(null):{};var i=u.charAt(0)==="["&&u.charAt(u.length-1)==="]"?u.slice(1,-1):u,d=t.decodeDotInKeys?i.replace(/%2E/g,"."):i,s=parseInt(d,10);!t.parseArrays&&d===""?l={0:o}:!isNaN(s)&&u!==d&&String(s)===d&&s>=0&&t.parseArrays&&s<=t.arrayLimit?(l=[],l[s]=o):d!=="__proto__"&&(l[d]=o)}o=l}return o},Dl=function(e,t,n,o){if(e){var a=n.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,l=/(\[[^[\]]*])/,u=/(\[[^[\]]*])/g,i=n.depth>0&&l.exec(a),d=i?a.slice(0,i.index):a,s=[];if(d){if(!n.plainObjects&&At.call(Object.prototype,d)&&!n.allowPrototypes)return;s.push(d)}for(var b=0;n.depth>0&&(i=u.exec(a))!==null&&b<n.depth;){if(b+=1,!n.plainObjects&&At.call(Object.prototype,i[1].slice(1,-1))&&!n.allowPrototypes)return;s.push(i[1])}if(i){if(n.strictDepth===!0)throw new RangeError("Input depth exceeded depth option of "+n.depth+" and strictDepth is true");s.push("["+a.slice(i.index)+"]")}return _l(s,t,n,o)}},kl=function(e){if(!e)return R;if(typeof e.allowEmptyArrays<"u"&&typeof e.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof e.decodeDotInKeys<"u"&&typeof e.decodeDotInKeys!="boolean")throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(e.decoder!==null&&typeof e.decoder<"u"&&typeof e.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof e.charset<"u"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var t=typeof e.charset>"u"?R.charset:e.charset,n=typeof e.duplicates>"u"?R.duplicates:e.duplicates;if(n!=="combine"&&n!=="first"&&n!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var o=typeof e.allowDots>"u"?e.decodeDotInKeys===!0?!0:R.allowDots:!!e.allowDots;return{allowDots:o,allowEmptyArrays:typeof e.allowEmptyArrays=="boolean"?!!e.allowEmptyArrays:R.allowEmptyArrays,allowPrototypes:typeof e.allowPrototypes=="boolean"?e.allowPrototypes:R.allowPrototypes,allowSparse:typeof e.allowSparse=="boolean"?e.allowSparse:R.allowSparse,arrayLimit:typeof e.arrayLimit=="number"?e.arrayLimit:R.arrayLimit,charset:t,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:R.charsetSentinel,comma:typeof e.comma=="boolean"?e.comma:R.comma,decodeDotInKeys:typeof e.decodeDotInKeys=="boolean"?e.decodeDotInKeys:R.decodeDotInKeys,decoder:typeof e.decoder=="function"?e.decoder:R.decoder,delimiter:typeof e.delimiter=="string"||Je.isRegExp(e.delimiter)?e.delimiter:R.delimiter,depth:typeof e.depth=="number"||e.depth===!1?+e.depth:R.depth,duplicates:n,ignoreQueryPrefix:e.ignoreQueryPrefix===!0,interpretNumericEntities:typeof e.interpretNumericEntities=="boolean"?e.interpretNumericEntities:R.interpretNumericEntities,parameterLimit:typeof e.parameterLimit=="number"?e.parameterLimit:R.parameterLimit,parseArrays:e.parseArrays!==!1,plainObjects:typeof e.plainObjects=="boolean"?e.plainObjects:R.plainObjects,strictDepth:typeof e.strictDepth=="boolean"?!!e.strictDepth:R.strictDepth,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:R.strictNullHandling}},Nl=function(r,e){var t=kl(e);if(r===""||r===null||typeof r>"u")return t.plainObjects?Object.create(null):{};for(var n=typeof r=="string"?Il(r,t):r,o=t.plainObjects?Object.create(null):{},a=Object.keys(n),l=0;l<a.length;++l){var u=a[l],i=Dl(u,n[u],t,typeof r=="string");o=Je.merge(o,i,t)}return t.allowSparse===!0?o:Je.compact(o)},jl=Tl,Ll=Nl,Wl=St,Yn={formats:Wl,parse:Ll,stringify:jl},Ul={exports:{}};/* NProgress, (c) 2013, 2014 Rico Sta. Cruz - http://ricostacruz.com/nprogress
|
|
34
|
+
* @license MIT */(function(r,e){(function(t,n){r.exports=n()})(Zr,function(){var t={};t.version="0.2.0";var n=t.settings={minimum:.08,easing:"ease",positionUsing:"",speed:200,trickle:!0,trickleRate:.02,trickleSpeed:800,showSpinner:!0,barSelector:'[role="bar"]',spinnerSelector:'[role="spinner"]',parent:"body",template:'<div class="bar" role="bar"><div class="peg"></div></div><div class="spinner" role="spinner"><div class="spinner-icon"></div></div>'};t.configure=function(p){var m,y;for(m in p)y=p[m],y!==void 0&&p.hasOwnProperty(m)&&(n[m]=y);return this},t.status=null,t.set=function(p){var m=t.isStarted();p=o(p,n.minimum,1),t.status=p===1?null:p;var y=t.render(!m),h=y.querySelector(n.barSelector),g=n.speed,w=n.easing;return y.offsetWidth,u(function(x){n.positionUsing===""&&(n.positionUsing=t.getPositioningCSS()),i(h,l(p,g,w)),p===1?(i(y,{transition:"none",opacity:1}),y.offsetWidth,setTimeout(function(){i(y,{transition:"all "+g+"ms linear",opacity:0}),setTimeout(function(){t.remove(),x()},g)},g)):setTimeout(x,g)}),this},t.isStarted=function(){return typeof t.status=="number"},t.start=function(){t.status||t.set(0);var p=function(){setTimeout(function(){t.status&&(t.trickle(),p())},n.trickleSpeed)};return n.trickle&&p(),this},t.done=function(p){return!p&&!t.status?this:t.inc(.3+.5*Math.random()).set(1)},t.inc=function(p){var m=t.status;return m?(typeof p!="number"&&(p=(1-m)*o(Math.random()*m,.1,.95)),m=o(m+p,0,.994),t.set(m)):t.start()},t.trickle=function(){return t.inc(Math.random()*n.trickleRate)},function(){var p=0,m=0;t.promise=function(y){return!y||y.state()==="resolved"?this:(m===0&&t.start(),p++,m++,y.always(function(){m--,m===0?(p=0,t.done()):t.set((p-m)/p)}),this)}}(),t.render=function(p){if(t.isRendered())return document.getElementById("nprogress");s(document.documentElement,"nprogress-busy");var m=document.createElement("div");m.id="nprogress",m.innerHTML=n.template;var y=m.querySelector(n.barSelector),h=p?"-100":a(t.status||0),g=document.querySelector(n.parent),w;return i(y,{transition:"all 0 linear",transform:"translate3d("+h+"%,0,0)"}),n.showSpinner||(w=m.querySelector(n.spinnerSelector),w&&E(w)),g!=document.body&&s(g,"nprogress-custom-parent"),g.appendChild(m),m},t.remove=function(){b(document.documentElement,"nprogress-busy"),b(document.querySelector(n.parent),"nprogress-custom-parent");var p=document.getElementById("nprogress");p&&E(p)},t.isRendered=function(){return!!document.getElementById("nprogress")},t.getPositioningCSS=function(){var p=document.body.style,m="WebkitTransform"in p?"Webkit":"MozTransform"in p?"Moz":"msTransform"in p?"ms":"OTransform"in p?"O":"";return m+"Perspective"in p?"translate3d":m+"Transform"in p?"translate":"margin"};function o(p,m,y){return p<m?m:p>y?y:p}function a(p){return(-1+p)*100}function l(p,m,y){var h;return n.positionUsing==="translate3d"?h={transform:"translate3d("+a(p)+"%,0,0)"}:n.positionUsing==="translate"?h={transform:"translate("+a(p)+"%,0)"}:h={"margin-left":a(p)+"%"},h.transition="all "+m+"ms "+y,h}var u=function(){var p=[];function m(){var y=p.shift();y&&y(m)}return function(y){p.push(y),p.length==1&&m()}}(),i=function(){var p=["Webkit","O","Moz","ms"],m={};function y(x){return x.replace(/^-ms-/,"ms-").replace(/-([\da-z])/gi,function(P,D){return D.toUpperCase()})}function h(x){var P=document.body.style;if(x in P)return x;for(var D=p.length,_=x.charAt(0).toUpperCase()+x.slice(1),U;D--;)if(U=p[D]+_,U in P)return U;return x}function g(x){return x=y(x),m[x]||(m[x]=h(x))}function w(x,P,D){P=g(P),x.style[P]=D}return function(x,P){var D=arguments,_,U;if(D.length==2)for(_ in P)U=P[_],U!==void 0&&P.hasOwnProperty(_)&&w(x,_,U);else w(x,D[1],D[2])}}();function d(p,m){var y=typeof p=="string"?p:v(p);return y.indexOf(" "+m+" ")>=0}function s(p,m){var y=v(p),h=y+m;d(y,m)||(p.className=h.substring(1))}function b(p,m){var y=v(p),h;d(p,m)&&(h=y.replace(" "+m+" "," "),p.className=h.substring(1,h.length-1))}function v(p){return(" "+(p.className||"")+" ").replace(/\s+/gi," ")}function E(p){p&&p.parentNode&&p.parentNode.removeChild(p)}return t})})(Ul);function Bl(r,e,t,n="brackets"){let o=/^https?:\/\//.test(e.toString()),a=o||e.toString().startsWith("/"),l=!a&&!e.toString().startsWith("#")&&!e.toString().startsWith("?"),u=e.toString().includes("?")||r==="get"&&Object.keys(t).length,i=e.toString().includes("#"),d=new URL(e.toString(),"http://localhost");return r==="get"&&Object.keys(t).length&&(d.search=Yn.stringify(Oa(Yn.parse(d.search,{ignoreQueryPrefix:!0}),t),{encodeValuesOnly:!0,arrayFormat:n}),t={}),[[o?`${d.protocol}//${d.host}`:"",a?d.pathname:"",l?d.pathname.substring(1):"",u?d.search:"",i?d.hash:""].join(""),t]}const Nr=f.createContext(null);Nr.displayName="ModalStackContext";let Kn=null,Xn=null,yr=null,Tt=null,$t=[];const Jn=({children:r})=>{const[e,t]=f.useState([]),[n,o]=f.useState({}),a=m=>{t(y=>{const h=m([...y]),g=w=>{var x;return h.length<2?!0:((x=h.map(P=>({id:P.id,shouldRender:P.shouldRender})).reverse().find(P=>P.shouldRender))==null?void 0:x.id)===w};return h.forEach((w,x)=>{h[x].onTopOfStack=g(w.id),h[x].getParentModal=()=>x<1?null:h.slice(0,x).reverse().find(P=>P.isOpen),h[x].getChildModal=()=>x===h.length-1?null:h.slice(x+1).find(P=>P.isOpen)}),h})};f.useEffect(()=>{$t=e},[e]);class l{constructor(y,h,g,w,x){le(this,"update",(y,h,g)=>{a(w=>w.map(x=>(x.id===this.id&&(x.config=y,x.onCloseCallback=h,x.afterLeaveCallback=g),x)))});le(this,"show",()=>{a(y=>y.map(h=>(h.id===this.id&&!h.isOpen&&(h.isOpen=!0,h.shouldRender=!0),h)))});le(this,"setOpen",y=>{y?this.show():this.close()});le(this,"close",()=>{a(y=>y.map(h=>{var g;return h.id===this.id&&h.isOpen&&(Object.keys(h.listeners).forEach(w=>{h.off(w)}),h.isOpen=!1,(g=h.onCloseCallback)==null||g.call(h)),h}))});le(this,"afterLeave",()=>{this.isOpen||a(y=>{const h=y.map(g=>{var w;return g.id===this.id&&!g.isOpen&&(g.shouldRender=!1,(w=g.afterLeaveCallback)==null||w.call(g),g.afterLeaveCallback=null),g});return this.index===0?[]:h})});le(this,"on",(y,h)=>{y=ir(y),this.listeners[y]=this.listeners[y]??[],this.listeners[y].push(h)});le(this,"off",(y,h)=>{var g;y=ir(y),h?this.listeners[y]=((g=this.listeners[y])==null?void 0:g.filter(w=>w!==h))??[]:delete this.listeners[y]});le(this,"emit",(y,...h)=>{var g;(g=this.listeners[ir(y)])==null||g.forEach(w=>w(...h))});le(this,"registerEventListenersFromProps",y=>{const h=[];return Object.keys(y).filter(g=>g.startsWith("on")).forEach(g=>{const w=ir(g).replace(/^on-/,"");this.on(w,y[g]),h.push(()=>this.off(w,y[g]))}),()=>h.forEach(g=>g())});le(this,"reload",(y={})=>{var g;let h=Object.keys(this.response.props);y.only&&(h=rn(h,y.only)),y.except&&(h=la(h,y.except)),(g=this.response)!=null&&g.url&&ve.get(this.response.url,{headers:{Accept:"text/html, application/xhtml+xml","X-Inertia":!0,"X-Inertia-Partial-Component":this.response.component,"X-Inertia-Version":this.response.version,"X-Inertia-Partial-Data":h.join(","),"X-InertiaUI-Modal":!0,"X-InertiaUI-Modal-Use-Router":0,"X-InertiaUI-Modal-Base-Url":yr}}).then(w=>{this.updateProps(w.data.props)})});le(this,"updateProps",y=>{Object.assign(this.props,y),a(h=>h)});this.id=l.generateId(),this.isOpen=!1,this.shouldRender=!1,this.listeners={},this.component=y,this.props=h.props,this.response=h,this.config=g,this.onCloseCallback=w,this.afterLeaveCallback=x,this.index=-1,this.getParentModal=()=>null,this.getChildModal=()=>null,this.onTopOfStack=!0}static generateId(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?`inertiaui_modal_${crypto.randomUUID()}`:`inertiaui_modal_${Date.now().toString(36)}_${Math.random().toString(36).substr(2,9)}`}}const u=(m,y={},h=null,g=null)=>Xn(m.component).then(w=>i(w,m,y,h,g)),i=(m,y,h,g,w)=>{const x=new l(m,y,h,g,w);return x.index=e.length,a(P=>[...P,x]),x.show(),x};function d(m,y,h,g){if(!n[m])throw new Error(`The local modal "${m}" has not been registered.`);const w=i(null,{},y,h,g);return w.name=m,n[m].callback(w),w}const s=(m,y={})=>b(m,y.method??"get",y.data??{},y.headers??{},y.config??{},y.onClose,y.onAfterLeave,y.queryStringArrayFormat??"brackets",y.navigate??Ar("navigate")).then(h=>{const g=y.listeners??{};return Object.keys(g).forEach(w=>{const x=ir(w);h.on(x,g[w])}),h}),b=(m,y,h={},g={},w={},x=null,P=null,D="brackets",_=!1)=>new Promise((U,H)=>{if(m.startsWith("#")){U(d(m.substring(1),w,x,P));return}const[j,z]=Bl(y,m||"",h,D);let V=_&&e.length===0;if(e.length===0&&(yr=typeof window<"u"?window.location.href:""),g={...g,Accept:"text/html, application/xhtml+xml","X-Requested-With":"XMLHttpRequest","X-Inertia":!0,"X-Inertia-Version":Kn,"X-InertiaUI-Modal":!0,"X-InertiaUI-Modal-Use-Router":V?1:0,"X-InertiaUI-Modal-Base-Url":yr},V)return Tt=null,Ue.router.visit(j,{method:y,data:z,headers:g,preserveScroll:!0,preserveState:!0,onError:H,onFinish:()=>{sa(()=>Tt).then(C=>{const T=C.onCloseCallback,k=C.afterLeaveCallback;C.update(w,()=>{x==null||x(),T==null||T()},()=>{P==null||P(),k==null||k()}),U(C)})}});ve({url:j,method:y,data:z,headers:g}).then(C=>U(u(C.data,w,x,P))).catch(C=>{H(C)})}),p={stack:e,localModals:n,push:i,pushFromResponseData:u,closeAll:()=>{$t.reverse().forEach(m=>m.close())},reset:()=>a(()=>[]),visit:b,visitModal:s,registerLocalModal:(m,y)=>{o(h=>({...h,[m]:{name:m,callback:y}}))},removeLocalModal:m=>{o(y=>{const h={...y};return delete h[m],h})}};return $.jsx(Nr.Provider,{value:p,children:r})},mr=()=>{const r=f.useContext(Nr);if(r===null)throw new Error("useModalStack must be used within a ModalStackProvider");return r},Qn=["closeButton","closeExplicitly","maxWidth","paddingClasses","panelClasses","position","slideover"],Rl=(r,e)=>{e.initialPage&&(Kn=e.initialPage.version),e.resolveComponent&&(Xn=e.resolveComponent);const t=({Component:n,props:o,key:a})=>{const l=()=>{const u=f.createElement(n,{key:a,...o});return typeof n.layout=="function"?n.layout(u):Array.isArray(n.layout)?n.layout.concat(u).reverse().reduce((d,s)=>f.createElement(s,o,d)):u};return $.jsxs($.Fragment,{children:[l(),$.jsx(Zn,{})]})};return $.jsx(Jn,{children:$.jsx(r,{...e,children:t})})},Zn=({children:r})=>{var u;const e=f.useContext(Nr);let t=!1,n=!1;f.useEffect(()=>Ue.router.on("start",()=>t=!0),[]),f.useEffect(()=>Ue.router.on("finish",()=>t=!1),[]),f.useEffect(()=>Ue.router.on("navigate",function(i){const d=i.detail.page.props._inertiaui_modal;if(!d){n&&e.closeAll();return}n=d,yr=d.baseUrl,e.pushFromResponseData(d,{},()=>{if(!d.baseUrl){console.error("No base url in modal response data so cannot navigate back");return}!t&&window.location.href!==d.baseUrl&&Ue.router.visit(d.baseUrl,{preserveScroll:!0,preserveState:!0})}).then(s=>{Tt=s})}),[]);const o=i=>($t.length&&(i.headers["X-InertiaUI-Modal-Base-Url"]=yr),i);f.useEffect(()=>(ve.interceptors.request.use(o),()=>ve.interceptors.request.eject(o)),[]);const a=Ue.usePage(),l=f.useRef();return f.useEffect(()=>{var s,b;const i=(s=a.props)==null?void 0:s._inertiaui_modal,d=l.current;l.current=i,i&&d&&i.component===d.component&&i.url===d.url&&((b=e.stack[0])==null||b.updateProps(i.props??{}))},[(u=a.props)==null?void 0:u._inertiaui_modal]),$.jsxs($.Fragment,{children:[r,e.stack.length>0&&$.jsx(eo,{index:0})]})},Ct=f.createContext(null);Ct.displayName="ModalIndexContext";const Ft=()=>{const r=f.useContext(Ct);if(r===void 0)throw new Error("useModalIndex must be used within a ModalIndexProvider");return r},eo=({index:r})=>{const{stack:e}=mr(),t=f.useMemo(()=>e[r],[e,r]);return(t==null?void 0:t.component)&&$.jsx(Ct.Provider,{value:r,children:$.jsx(t.component,{...t.props,onModalEvent:(...n)=>t.emit(...n)})})},Mt=f.forwardRef(({name:r,children:e,...t},n)=>{const o=Ft(),{stack:a,registerLocalModal:l,removeLocalModal:u}=mr(),[i,d]=f.useState(null),s=f.useMemo(()=>r?i:a[o],[r,i,o,a]),b=f.useMemo(()=>{var p;return(p=a.find(m=>m.shouldRender&&m.index>(s==null?void 0:s.index)))==null?void 0:p.index},[o,a]),v=f.useMemo(()=>(s==null?void 0:s.config.slideover)??t.slideover??Ar("type")==="slideover",[t.slideover]),E=f.useMemo(()=>({slideover:v,closeButton:t.closeButton??Be(v,"closeButton"),closeExplicitly:t.closeExplicitly??Be(v,"closeExplicitly"),maxWidth:t.maxWidth??Be(v,"maxWidth"),paddingClasses:t.paddingClasses??Be(v,"paddingClasses"),panelClasses:t.panelClasses??Be(v,"panelClasses"),position:t.position??Be(v,"position"),...s==null?void 0:s.config}),[t,s==null?void 0:s.config]);return f.useEffect(()=>{if(r){let p=null;return l(r,m=>{p=m.registerEventListenersFromProps(t),d(m)}),()=>{p==null||p(),p=null,u(r)}}return s.registerEventListenersFromProps(t)},[r]),f.useImperativeHandle(n,()=>({afterLeave:()=>s.afterLeave(),close:()=>s.close(),config:E,emit:(...p)=>s.emit(...p),getChildModal:()=>s.getChildModal(),getParentModal:()=>s.getParentModal(),id:s==null?void 0:s.id,index:s==null?void 0:s.index,isOpen:s==null?void 0:s.isOpen,modalContext:s,onTopOfStack:s==null?void 0:s.onTopOfStack,reload:()=>s.reload(),setOpen:()=>s.setOpen(),shouldRender:s==null?void 0:s.shouldRender}),[s]),(s==null?void 0:s.shouldRender)&&$.jsxs($.Fragment,{children:[typeof e=="function"?e({afterLeave:s.afterLeave,close:s.close,config:E,emit:s.emit,getChildModal:s.getChildModal,getParentModal:s.getParentModal,id:s.id,index:s.index,isOpen:s.isOpen,modalContext:s,onTopOfStack:s.onTopOfStack,reload:s.reload,setOpen:s.setOpen,shouldRender:s.shouldRender}):e,b&&$.jsx(eo,{index:b})]})});Mt.displayName="HeadlessModal";function ro(r){var e,t,n="";if(typeof r=="string"||typeof r=="number")n+=r;else if(typeof r=="object")if(Array.isArray(r)){var o=r.length;for(e=0;e<o;e++)r[e]&&(t=ro(r[e]))&&(n&&(n+=" "),n+=t)}else for(t in r)r[t]&&(n&&(n+=" "),n+=t);return n}function jr(){for(var r,e,t=0,n="",o=arguments.length;t<o;t++)(r=arguments[t])&&(e=ro(r))&&(n&&(n+=" "),n+=e);return n}var Hl=Object.defineProperty,Vl=(r,e,t)=>e in r?Hl(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,It=(r,e,t)=>(Vl(r,typeof e!="symbol"?e+"":e,t),t);let ql=class{constructor(){It(this,"current",this.detect()),It(this,"handoffState","pending"),It(this,"currentId",0)}set(e){this.current!==e&&(this.handoffState="pending",this.currentId=0,this.current=e)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return this.current==="server"}get isClient(){return this.current==="client"}detect(){return typeof window>"u"||typeof document>"u"?"server":"client"}handoff(){this.handoffState==="pending"&&(this.handoffState="complete")}get isHandoffComplete(){return this.handoffState==="complete"}},Me=new ql;function Lr(r){return Me.isServer?null:r instanceof Node?r.ownerDocument:r!=null&&r.hasOwnProperty("current")&&r.current instanceof Node?r.current.ownerDocument:document}function Wr(r){typeof queueMicrotask=="function"?queueMicrotask(r):Promise.resolve().then(r).catch(e=>setTimeout(()=>{throw e}))}function Oe(){let r=[],e={addEventListener(t,n,o,a){return t.addEventListener(n,o,a),e.add(()=>t.removeEventListener(n,o,a))},requestAnimationFrame(...t){let n=requestAnimationFrame(...t);return e.add(()=>cancelAnimationFrame(n))},nextFrame(...t){return e.requestAnimationFrame(()=>e.requestAnimationFrame(...t))},setTimeout(...t){let n=setTimeout(...t);return e.add(()=>clearTimeout(n))},microTask(...t){let n={current:!0};return Wr(()=>{n.current&&t[0]()}),e.add(()=>{n.current=!1})},style(t,n,o){let a=t.style.getPropertyValue(n);return Object.assign(t.style,{[n]:o}),this.add(()=>{Object.assign(t.style,{[n]:a})})},group(t){let n=Oe();return t(n),this.add(()=>n.dispose())},add(t){return r.includes(t)||r.push(t),()=>{let n=r.indexOf(t);if(n>=0)for(let o of r.splice(n,1))o()}},dispose(){for(let t of r.splice(0))t()}};return e}function _t(){let[r]=f.useState(Oe);return f.useEffect(()=>()=>r.dispose(),[r]),r}let ee=(r,e)=>{Me.isServer?f.useEffect(r,e):f.useLayoutEffect(r,e)};function Ie(r){let e=f.useRef(r);return ee(()=>{e.current=r},[r]),e}let B=function(r){let e=Ie(r);return f.useCallback((...t)=>e.current(...t),[e])},Gl=f.createContext(void 0);function zl(){return f.useContext(Gl)}function Dt(...r){return Array.from(new Set(r.flatMap(e=>typeof e=="string"?e.split(" "):[]))).filter(Boolean).join(" ")}function Pe(r,e,...t){if(r in e){let o=e[r];return typeof o=="function"?o(...t):o}let n=new Error(`Tried to handle "${r}" but there is no handler defined. Only defined handlers are: ${Object.keys(e).map(o=>`"${o}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Pe),n}var Ur=(r=>(r[r.None=0]="None",r[r.RenderStrategy=1]="RenderStrategy",r[r.Static=2]="Static",r))(Ur||{}),Ae=(r=>(r[r.Unmount=0]="Unmount",r[r.Hidden=1]="Hidden",r))(Ae||{});function ae(){let r=Kl();return f.useCallback(e=>Yl({mergeRefs:r,...e}),[r])}function Yl({ourProps:r,theirProps:e,slot:t,defaultTag:n,features:o,visible:a=!0,name:l,mergeRefs:u}){u=u??Xl;let i=to(e,r);if(a)return Br(i,t,n,l,u);let d=o??0;if(d&2){let{static:s=!1,...b}=i;if(s)return Br(b,t,n,l,u)}if(d&1){let{unmount:s=!0,...b}=i;return Pe(s?0:1,{0(){return null},1(){return Br({...b,hidden:!0,style:{display:"none"}},t,n,l,u)}})}return Br(i,t,n,l,u)}function Br(r,e={},t,n,o){let{as:a=t,children:l,refName:u="ref",...i}=kt(r,["unmount","static"]),d=r.ref!==void 0?{[u]:r.ref}:{},s=typeof l=="function"?l(e):l;"className"in i&&i.className&&typeof i.className=="function"&&(i.className=i.className(e)),i["aria-labelledby"]&&i["aria-labelledby"]===i.id&&(i["aria-labelledby"]=void 0);let b={};if(e){let v=!1,E=[];for(let[p,m]of Object.entries(e))typeof m=="boolean"&&(v=!0),m===!0&&E.push(p.replace(/([A-Z])/g,y=>`-${y.toLowerCase()}`));if(v){b["data-headlessui-state"]=E.join(" ");for(let p of E)b[`data-${p}`]=""}}if(a===f.Fragment&&(Object.keys(_e(i)).length>0||Object.keys(_e(b)).length>0))if(!f.isValidElement(s)||Array.isArray(s)&&s.length>1){if(Object.keys(_e(i)).length>0)throw new Error(['Passing props on "Fragment"!',"",`The current component <${n} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(_e(i)).concat(Object.keys(_e(b))).map(v=>` - ${v}`).join(`
|
|
35
35
|
`),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map(v=>` - ${v}`).join(`
|
|
36
36
|
`)].join(`
|
|
37
|
-
`))}else{let v=s.props,E=v==null?void 0:v.className,p=typeof E=="function"?(...h)=>_t(E(...h),i.className):_t(E,i.className),m=p?{className:p}:{},y=ro(s.props,_e(Dt(i,["ref"])));for(let h in g)h in y&&delete g[h];return f.cloneElement(s,Object.assign({},y,g,d,{ref:o(s.ref,d.ref)},m))}return f.createElement(a,Object.assign({},Dt(i,["ref"]),a!==f.Fragment&&d,a!==f.Fragment&&g),s)}function Yl(){let r=f.useRef([]),e=f.useCallback(t=>{for(let n of r.current)n!=null&&(typeof n=="function"?n(t):n.current=t)},[]);return(...t)=>{if(!t.every(n=>n==null))return r.current=t,e}}function Kl(...r){return r.every(e=>e==null)?void 0:e=>{for(let t of r)t!=null&&(typeof t=="function"?t(e):t.current=e)}}function ro(...r){if(r.length===0)return{};if(r.length===1)return r[0];let e={},t={};for(let n of r)for(let o in n)o.startsWith("on")&&typeof n[o]=="function"?(t[o]!=null||(t[o]=[]),t[o].push(n[o])):e[o]=n[o];if(e.disabled||e["aria-disabled"])for(let n in t)/^(on(?:Click|Pointer|Mouse|Key)(?:Down|Up|Press)?)$/.test(n)&&(t[n]=[o=>{var a;return(a=o==null?void 0:o.preventDefault)==null?void 0:a.call(o)}]);for(let n in t)Object.assign(e,{[n](o,...a){let l=t[n];for(let u of l){if((o instanceof Event||(o==null?void 0:o.nativeEvent)instanceof Event)&&o.defaultPrevented)return;u(o,...a)}}});return e}function te(r){var e;return Object.assign(f.forwardRef(r),{displayName:(e=r.displayName)!=null?e:r.name})}function _e(r){let e=Object.assign({},r);for(let t in e)e[t]===void 0&&delete e[t];return e}function Dt(r,e=[]){let t=Object.assign({},r);for(let n of e)n in t&&delete t[n];return t}let Xl="span";var Br=(r=>(r[r.None=1]="None",r[r.Focusable=2]="Focusable",r[r.Hidden=4]="Hidden",r))(Br||{});function Jl(r,e){var t;let{features:n=1,...o}=r,a={ref:e,"aria-hidden":(n&2)===2?!0:(t=o["aria-hidden"])!=null?t:void 0,hidden:(n&4)===4?!0:void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...(n&4)===4&&(n&2)!==2&&{display:"none"}}};return ae()({ourProps:a,theirProps:o,slot:{},defaultTag:Xl,name:"Hidden"})}let kt=te(Jl),to=Symbol();function Ql(r,e=!0){return Object.assign(r,{[to]:e})}function ye(...r){let e=f.useRef(r);f.useEffect(()=>{e.current=r},[r]);let t=B(n=>{for(let o of e.current)o!=null&&(typeof o=="function"?o(n):o.current=n)});return r.every(n=>n==null||(n==null?void 0:n[to]))?void 0:t}let Nt=f.createContext(null);Nt.displayName="DescriptionContext";function no(){let r=f.useContext(Nt);if(r===null){let e=new Error("You used a <Description /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(e,no),e}return r}function Zl(){let[r,e]=f.useState([]);return[r.length>0?r.join(" "):void 0,f.useMemo(()=>function(t){let n=B(a=>(e(l=>[...l,a]),()=>e(l=>{let u=l.slice(),i=u.indexOf(a);return i!==-1&&u.splice(i,1),u}))),o=f.useMemo(()=>({register:n,slot:t.slot,name:t.name,props:t.props,value:t.value}),[n,t.slot,t.name,t.props,t.value]);return f.createElement(Nt.Provider,{value:o},t.children)},[e])]}let eu="p";function ru(r,e){let t=f.useId(),n=Gl(),{id:o=`headlessui-description-${t}`,...a}=r,l=no(),u=ye(e);ee(()=>l.register(o),[o,l.register]);let i=n||!1,d=f.useMemo(()=>({...l.slot,disabled:i}),[l.slot,i]),s={ref:u,...l.props,id:o};return ae()({ourProps:s,theirProps:a,slot:d,defaultTag:eu,name:l.name||"Description"})}let tu=te(ru),nu=Object.assign(tu,{});var oo=(r=>(r.Space=" ",r.Enter="Enter",r.Escape="Escape",r.Backspace="Backspace",r.Delete="Delete",r.ArrowLeft="ArrowLeft",r.ArrowUp="ArrowUp",r.ArrowRight="ArrowRight",r.ArrowDown="ArrowDown",r.Home="Home",r.End="End",r.PageUp="PageUp",r.PageDown="PageDown",r.Tab="Tab",r))(oo||{});let ou=f.createContext(()=>{});function au({value:r,children:e}){return f.createElement(ou.Provider,{value:r},e)}let iu=class extends Map{constructor(e){super(),this.factory=e}get(e){let t=super.get(e);return t===void 0&&(t=this.factory(e),this.set(e,t)),t}};function ao(r,e){let t=r(),n=new Set;return{getSnapshot(){return t},subscribe(o){return n.add(o),()=>n.delete(o)},dispatch(o,...a){let l=e[o].call(t,...a);l&&(t=l,n.forEach(u=>u()))}}}function io(r){return f.useSyncExternalStore(r.subscribe,r.getSnapshot,r.getSnapshot)}let lu=new iu(()=>ao(()=>[],{ADD(r){return this.includes(r)?this:[...this,r]},REMOVE(r){let e=this.indexOf(r);if(e===-1)return this;let t=this.slice();return t.splice(e,1),t}}));function Qe(r,e){let t=lu.get(e),n=f.useId(),o=io(t);if(ee(()=>{if(r)return t.dispatch("ADD",n),()=>t.dispatch("REMOVE",n)},[t,r]),!r)return!1;let a=o.indexOf(n),l=o.length;return a===-1&&(a=l,l+=1),a===l-1}let jt=new Map,mr=new Map;function lo(r){var e;let t=(e=mr.get(r))!=null?e:0;return mr.set(r,t+1),t!==0?()=>uo(r):(jt.set(r,{"aria-hidden":r.getAttribute("aria-hidden"),inert:r.inert}),r.setAttribute("aria-hidden","true"),r.inert=!0,()=>uo(r))}function uo(r){var e;let t=(e=mr.get(r))!=null?e:1;if(t===1?mr.delete(r):mr.set(r,t-1),t!==1)return;let n=jt.get(r);n&&(n["aria-hidden"]===null?r.removeAttribute("aria-hidden"):r.setAttribute("aria-hidden",n["aria-hidden"]),r.inert=n.inert,jt.delete(r))}function uu(r,{allowed:e,disallowed:t}={}){let n=Qe(r,"inert-others");ee(()=>{var o,a;if(!n)return;let l=Oe();for(let i of(o=t==null?void 0:t())!=null?o:[])i&&l.add(lo(i));let u=(a=e==null?void 0:e())!=null?a:[];for(let i of u){if(!i)continue;let d=jr(i);if(!d)continue;let s=i.parentElement;for(;s&&s!==d.body;){for(let g of s.children)u.some(v=>g.contains(v))||l.add(lo(g));s=s.parentElement}}return l.dispose},[n,e,t])}function su(r,e,t){let n=Ie(o=>{let a=o.getBoundingClientRect();a.x===0&&a.y===0&&a.width===0&&a.height===0&&t()});f.useEffect(()=>{if(!r)return;let o=e===null?null:e instanceof HTMLElement?e:e.current;if(!o)return;let a=Oe();if(typeof ResizeObserver<"u"){let l=new ResizeObserver(()=>n.current(o));l.observe(o),a.add(()=>l.disconnect())}if(typeof IntersectionObserver<"u"){let l=new IntersectionObserver(()=>n.current(o));l.observe(o),a.add(()=>l.disconnect())}return()=>a.dispose()},[e,n,r])}let Rr=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map(r=>`${r}:not([tabindex='-1'])`).join(","),cu=["[data-autofocus]"].map(r=>`${r}:not([tabindex='-1'])`).join(",");var he=(r=>(r[r.First=1]="First",r[r.Previous=2]="Previous",r[r.Next=4]="Next",r[r.Last=8]="Last",r[r.WrapAround=16]="WrapAround",r[r.NoScroll=32]="NoScroll",r[r.AutoFocus=64]="AutoFocus",r))(he||{}),Lt=(r=>(r[r.Error=0]="Error",r[r.Overflow=1]="Overflow",r[r.Success=2]="Success",r[r.Underflow=3]="Underflow",r))(Lt||{}),fu=(r=>(r[r.Previous=-1]="Previous",r[r.Next=1]="Next",r))(fu||{});function du(r=document.body){return r==null?[]:Array.from(r.querySelectorAll(Rr)).sort((e,t)=>Math.sign((e.tabIndex||Number.MAX_SAFE_INTEGER)-(t.tabIndex||Number.MAX_SAFE_INTEGER)))}function pu(r=document.body){return r==null?[]:Array.from(r.querySelectorAll(cu)).sort((e,t)=>Math.sign((e.tabIndex||Number.MAX_SAFE_INTEGER)-(t.tabIndex||Number.MAX_SAFE_INTEGER)))}var so=(r=>(r[r.Strict=0]="Strict",r[r.Loose=1]="Loose",r))(so||{});function yu(r,e=0){var t;return r===((t=jr(r))==null?void 0:t.body)?!1:Pe(e,{0(){return r.matches(Rr)},1(){let n=r;for(;n!==null;){if(n.matches(Rr))return!0;n=n.parentElement}return!1}})}var mu=(r=>(r[r.Keyboard=0]="Keyboard",r[r.Mouse=1]="Mouse",r))(mu||{});typeof window<"u"&&typeof document<"u"&&(document.addEventListener("keydown",r=>{r.metaKey||r.altKey||r.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")},!0),document.addEventListener("click",r=>{r.detail===1?delete document.documentElement.dataset.headlessuiFocusVisible:r.detail===0&&(document.documentElement.dataset.headlessuiFocusVisible="")},!0));function ge(r){r==null||r.focus({preventScroll:!0})}let vu=["textarea","input"].join(",");function hu(r){var e,t;return(t=(e=r==null?void 0:r.matches)==null?void 0:e.call(r,vu))!=null?t:!1}function gu(r,e=t=>t){return r.slice().sort((t,n)=>{let o=e(t),a=e(n);if(o===null||a===null)return 0;let l=o.compareDocumentPosition(a);return l&Node.DOCUMENT_POSITION_FOLLOWING?-1:l&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function vr(r,e,{sorted:t=!0,relativeTo:n=null,skipElements:o=[]}={}){let a=Array.isArray(r)?r.length>0?r[0].ownerDocument:document:r.ownerDocument,l=Array.isArray(r)?t?gu(r):r:e&64?pu(r):du(r);o.length>0&&l.length>1&&(l=l.filter(E=>!o.some(p=>p!=null&&"current"in p?(p==null?void 0:p.current)===E:p===E))),n=n??a.activeElement;let u=(()=>{if(e&5)return 1;if(e&10)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),i=(()=>{if(e&1)return 0;if(e&2)return Math.max(0,l.indexOf(n))-1;if(e&4)return Math.max(0,l.indexOf(n))+1;if(e&8)return l.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),d=e&32?{preventScroll:!0}:{},s=0,g=l.length,v;do{if(s>=g||s+g<=0)return 0;let E=i+s;if(e&16)E=(E+g)%g;else{if(E<0)return 3;if(E>=g)return 1}v=l[E],v==null||v.focus(d),s+=u}while(v!==a.activeElement);return e&6&&hu(v)&&v.select(),2}function co(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function bu(){return/Android/gi.test(window.navigator.userAgent)}function wu(){return co()||bu()}function hr(r,e,t,n){let o=Ie(t);f.useEffect(()=>{if(!r)return;function a(l){o.current(l)}return document.addEventListener(e,a,n),()=>document.removeEventListener(e,a,n)},[r,e,n])}function fo(r,e,t,n){let o=Ie(t);f.useEffect(()=>{if(!r)return;function a(l){o.current(l)}return window.addEventListener(e,a,n),()=>window.removeEventListener(e,a,n)},[r,e,n])}const po=30;function Eu(r,e,t){let n=Qe(r,"outside-click"),o=Ie(t),a=f.useCallback(function(i,d){if(i.defaultPrevented)return;let s=d(i);if(s===null||!s.getRootNode().contains(s)||!s.isConnected)return;let g=function v(E){return typeof E=="function"?v(E()):Array.isArray(E)||E instanceof Set?E:[E]}(e);for(let v of g)if(v!==null&&(v.contains(s)||i.composed&&i.composedPath().includes(v)))return;return!yu(s,so.Loose)&&s.tabIndex!==-1&&i.preventDefault(),o.current(i,s)},[o,e]),l=f.useRef(null);hr(n,"pointerdown",i=>{var d,s;l.current=((s=(d=i.composedPath)==null?void 0:d.call(i))==null?void 0:s[0])||i.target},!0),hr(n,"mousedown",i=>{var d,s;l.current=((s=(d=i.composedPath)==null?void 0:d.call(i))==null?void 0:s[0])||i.target},!0),hr(n,"click",i=>{wu()||l.current&&(a(i,()=>l.current),l.current=null)},!0);let u=f.useRef({x:0,y:0});hr(n,"touchstart",i=>{u.current.x=i.touches[0].clientX,u.current.y=i.touches[0].clientY},!0),hr(n,"touchend",i=>{let d={x:i.changedTouches[0].clientX,y:i.changedTouches[0].clientY};if(!(Math.abs(d.x-u.current.x)>=po||Math.abs(d.y-u.current.y)>=po))return a(i,()=>i.target instanceof HTMLElement?i.target:null)},!0),fo(n,"blur",i=>a(i,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}function gr(...r){return f.useMemo(()=>jr(...r),[...r])}function yo(r,e,t,n){let o=Ie(t);f.useEffect(()=>{r=r??window;function a(l){o.current(l)}return r.addEventListener(e,a,n),()=>r.removeEventListener(e,a,n)},[r,e,n])}function Su(){let r;return{before({doc:e}){var t;let n=e.documentElement,o=(t=e.defaultView)!=null?t:window;r=Math.max(0,o.innerWidth-n.clientWidth)},after({doc:e,d:t}){let n=e.documentElement,o=Math.max(0,n.clientWidth-n.offsetWidth),a=Math.max(0,r-o);t.style(n,"paddingRight",`${a}px`)}}}function xu(){return co()?{before({doc:r,d:e,meta:t}){function n(o){return t.containers.flatMap(a=>a()).some(a=>a.contains(o))}e.microTask(()=>{var o;if(window.getComputedStyle(r.documentElement).scrollBehavior!=="auto"){let u=Oe();u.style(r.documentElement,"scrollBehavior","auto"),e.add(()=>e.microTask(()=>u.dispose()))}let a=(o=window.scrollY)!=null?o:window.pageYOffset,l=null;e.addEventListener(r,"click",u=>{if(u.target instanceof HTMLElement)try{let i=u.target.closest("a");if(!i)return;let{hash:d}=new URL(i.href),s=r.querySelector(d);s&&!n(s)&&(l=s)}catch{}},!0),e.addEventListener(r,"touchstart",u=>{if(u.target instanceof HTMLElement)if(n(u.target)){let i=u.target;for(;i.parentElement&&n(i.parentElement);)i=i.parentElement;e.style(i,"overscrollBehavior","contain")}else e.style(u.target,"touchAction","none")}),e.addEventListener(r,"touchmove",u=>{if(u.target instanceof HTMLElement){if(u.target.tagName==="INPUT")return;if(n(u.target)){let i=u.target;for(;i.parentElement&&i.dataset.headlessuiPortal!==""&&!(i.scrollHeight>i.clientHeight||i.scrollWidth>i.clientWidth);)i=i.parentElement;i.dataset.headlessuiPortal===""&&u.preventDefault()}else u.preventDefault()}},{passive:!1}),e.add(()=>{var u;let i=(u=window.scrollY)!=null?u:window.pageYOffset;a!==i&&window.scrollTo(0,a),l&&l.isConnected&&(l.scrollIntoView({block:"nearest"}),l=null)})})}}:{}}function Ou(){return{before({doc:r,d:e}){e.style(r.documentElement,"overflow","hidden")}}}function Pu(r){let e={};for(let t of r)Object.assign(e,t(e));return e}let De=ao(()=>new Map,{PUSH(r,e){var t;let n=(t=this.get(r))!=null?t:{doc:r,count:0,d:Oe(),meta:new Set};return n.count++,n.meta.add(e),this.set(r,n),this},POP(r,e){let t=this.get(r);return t&&(t.count--,t.meta.delete(e)),this},SCROLL_PREVENT({doc:r,d:e,meta:t}){let n={doc:r,d:e,meta:Pu(t)},o=[xu(),Su(),Ou()];o.forEach(({before:a})=>a==null?void 0:a(n)),o.forEach(({after:a})=>a==null?void 0:a(n))},SCROLL_ALLOW({d:r}){r.dispose()},TEARDOWN({doc:r}){this.delete(r)}});De.subscribe(()=>{let r=De.getSnapshot(),e=new Map;for(let[t]of r)e.set(t,t.documentElement.style.overflow);for(let t of r.values()){let n=e.get(t.doc)==="hidden",o=t.count!==0;(o&&!n||!o&&n)&&De.dispatch(t.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",t),t.count===0&&De.dispatch("TEARDOWN",t)}});function Au(r,e,t=()=>({containers:[]})){let n=io(De),o=e?n.get(e):void 0,a=o?o.count>0:!1;return ee(()=>{if(!(!e||!r))return De.dispatch("PUSH",e,t),()=>De.dispatch("POP",e,t)},[r,e]),a}function Tu(r,e,t=()=>[document.body]){let n=Qe(r,"scroll-lock");Au(n,e,o=>{var a;return{containers:[...(a=o.containers)!=null?a:[],t]}})}function $u(r=0){let[e,t]=f.useState(r),n=f.useCallback(i=>t(i),[e]),o=f.useCallback(i=>t(d=>d|i),[e]),a=f.useCallback(i=>(e&i)===i,[e]),l=f.useCallback(i=>t(d=>d&~i),[t]),u=f.useCallback(i=>t(d=>d^i),[t]);return{flags:e,setFlag:n,addFlag:o,hasFlag:a,removeFlag:l,toggleFlag:u}}var mo,vo;typeof process<"u"&&typeof globalThis<"u"&&typeof Element<"u"&&((mo=process==null?void 0:process.env)==null?void 0:mo.NODE_ENV)==="test"&&typeof((vo=Element==null?void 0:Element.prototype)==null?void 0:vo.getAnimations)>"u"&&(Element.prototype.getAnimations=function(){return console.warn(["Headless UI has polyfilled `Element.prototype.getAnimations` for your tests.","Please install a proper polyfill e.g. `jsdom-testing-mocks`, to silence these warnings.","","Example usage:","```js","import { mockAnimationsApi } from 'jsdom-testing-mocks'","mockAnimationsApi()","```"].join(`
|
|
38
|
-
`)),[]});var Cu=(r=>(r[r.None=0]="None",r[r.Closed=1]="Closed",r[r.Enter=2]="Enter",r[r.Leave=4]="Leave",r))(Cu||{});function Fu(r){let e={};for(let t in r)r[t]===!0&&(e[`data-${t}`]="");return e}function Mu(r,e,t,n){let[o,a]=f.useState(t),{hasFlag:l,addFlag:u,removeFlag:i}=$u(r&&o?3:0),d=f.useRef(!1),s=f.useRef(!1),g=It();return ee(()=>{var v;if(r){if(t&&a(!0),!e){t&&u(3);return}return(v=n==null?void 0:n.start)==null||v.call(n,t),Iu(e,{inFlight:d,prepare(){s.current?s.current=!1:s.current=d.current,d.current=!0,!s.current&&(t?(u(3),i(4)):(u(4),i(2)))},run(){s.current?t?(i(3),u(4)):(i(4),u(3)):t?i(1):u(1)},done(){var E;s.current&&typeof e.getAnimations=="function"&&e.getAnimations().length>0||(d.current=!1,i(7),t||a(!1),(E=n==null?void 0:n.end)==null||E.call(n,t))}})}},[r,t,e,g]),r?[o,{closed:l(1),enter:l(2),leave:l(4),transition:l(2)||l(4)}]:[t,{closed:void 0,enter:void 0,leave:void 0,transition:void 0}]}function Iu(r,{prepare:e,run:t,done:n,inFlight:o}){let a=Oe();return Du(r,{prepare:e,inFlight:o}),a.nextFrame(()=>{t(),a.requestAnimationFrame(()=>{a.add(_u(r,n))})}),a.dispose}function _u(r,e){var t,n;let o=Oe();if(!r)return o.dispose;let a=!1;o.add(()=>{a=!0});let l=(n=(t=r.getAnimations)==null?void 0:t.call(r).filter(u=>u instanceof CSSTransition))!=null?n:[];return l.length===0?(e(),o.dispose):(Promise.allSettled(l.map(u=>u.finished)).then(()=>{a||e()}),o.dispose)}function Du(r,{inFlight:e,prepare:t}){if(e!=null&&e.current){t();return}let n=r.style.transition;r.style.transition="none",t(),r.offsetHeight,r.style.transition=n}function Wt(r,e){let t=f.useRef([]),n=B(r);f.useEffect(()=>{let o=[...t.current];for(let[a,l]of e.entries())if(t.current[a]!==l){let u=n(e,o);return t.current=e,u}},[n,...e])}let Hr=f.createContext(null);Hr.displayName="OpenClosedContext";var ue=(r=>(r[r.Open=1]="Open",r[r.Closed=2]="Closed",r[r.Closing=4]="Closing",r[r.Opening=8]="Opening",r))(ue||{});function Vr(){return f.useContext(Hr)}function ku({value:r,children:e}){return f.createElement(Hr.Provider,{value:r},e)}function Nu({children:r}){return f.createElement(Hr.Provider,{value:null},r)}function ju(r){function e(){document.readyState!=="loading"&&(r(),document.removeEventListener("DOMContentLoaded",e))}typeof window<"u"&&typeof document<"u"&&(document.addEventListener("DOMContentLoaded",e),e())}let Te=[];ju(()=>{function r(e){if(!(e.target instanceof HTMLElement)||e.target===document.body||Te[0]===e.target)return;let t=e.target;t=t.closest(Rr),Te.unshift(t??e.target),Te=Te.filter(n=>n!=null&&n.isConnected),Te.splice(10)}window.addEventListener("click",r,{capture:!0}),window.addEventListener("mousedown",r,{capture:!0}),window.addEventListener("focus",r,{capture:!0}),document.body.addEventListener("click",r,{capture:!0}),document.body.addEventListener("mousedown",r,{capture:!0}),document.body.addEventListener("focus",r,{capture:!0})});function ho(r){let e=B(r),t=f.useRef(!1);f.useEffect(()=>(t.current=!1,()=>{t.current=!0,Lr(()=>{t.current&&e()})}),[e])}function Lu(){let r=typeof document>"u";return"useSyncExternalStore"in tr?(e=>e.useSyncExternalStore)(tr)(()=>()=>{},()=>!1,()=>!r):!1}function br(){let r=Lu(),[e,t]=tr.useState(Me.isHandoffComplete);return e&&Me.isHandoffComplete===!1&&t(!1),tr.useEffect(()=>{e!==!0&&t(!0)},[e]),tr.useEffect(()=>Me.handoff(),[]),r?!1:e}let go=f.createContext(!1);function Wu(){return f.useContext(go)}function bo(r){return f.createElement(go.Provider,{value:r.force},r.children)}function Uu(r){let e=Wu(),t=f.useContext(Eo),n=gr(r),[o,a]=f.useState(()=>{var l;if(!e&&t!==null)return(l=t.current)!=null?l:null;if(Me.isServer)return null;let u=n==null?void 0:n.getElementById("headlessui-portal-root");if(u)return u;if(n===null)return null;let i=n.createElement("div");return i.setAttribute("id","headlessui-portal-root"),n.body.appendChild(i)});return f.useEffect(()=>{o!==null&&(n!=null&&n.body.contains(o)||n==null||n.body.appendChild(o))},[o,n]),f.useEffect(()=>{e||t!==null&&a(t.current)},[t,a,e]),o}let wo=f.Fragment,Bu=te(function(r,e){let t=r,n=f.useRef(null),o=ye(Ql(g=>{n.current=g}),e),a=gr(n),l=Uu(n),[u]=f.useState(()=>{var g;return Me.isServer?null:(g=a==null?void 0:a.createElement("div"))!=null?g:null}),i=f.useContext(Ut),d=br();ee(()=>{!l||!u||l.contains(u)||(u.setAttribute("data-headlessui-portal",""),l.appendChild(u))},[l,u]),ee(()=>{if(u&&i)return i.register(u)},[i,u]),ho(()=>{var g;!l||!u||(u instanceof Node&&l.contains(u)&&l.removeChild(u),l.childNodes.length<=0&&((g=l.parentElement)==null||g.removeChild(l)))});let s=ae();return d?!l||!u?null:Jo.createPortal(s({ourProps:{ref:o},theirProps:t,slot:{},defaultTag:wo,name:"Portal"}),u):null});function Ru(r,e){let t=ye(e),{enabled:n=!0,...o}=r,a=ae();return n?f.createElement(Bu,{...o,ref:t}):a({ourProps:{ref:t},theirProps:o,slot:{},defaultTag:wo,name:"Portal"})}let Hu=f.Fragment,Eo=f.createContext(null);function Vu(r,e){let{target:t,...n}=r,o={ref:ye(e)},a=ae();return f.createElement(Eo.Provider,{value:t},a({ourProps:o,theirProps:n,defaultTag:Hu,name:"Popover.Group"}))}let Ut=f.createContext(null);function qu(){let r=f.useContext(Ut),e=f.useRef([]),t=B(a=>(e.current.push(a),r&&r.register(a),()=>n(a))),n=B(a=>{let l=e.current.indexOf(a);l!==-1&&e.current.splice(l,1),r&&r.unregister(a)}),o=f.useMemo(()=>({register:t,unregister:n,portals:e}),[t,n,e]);return[e,f.useMemo(()=>function({children:a}){return f.createElement(Ut.Provider,{value:o},a)},[o])]}let Gu=te(Ru),So=te(Vu),zu=Object.assign(Gu,{Group:So});function Yu(r,e=typeof document<"u"?document.defaultView:null,t){let n=Qe(r,"escape");yo(e,"keydown",o=>{n&&(o.defaultPrevented||o.key===oo.Escape&&t(o))})}function Ku(){var r;let[e]=f.useState(()=>typeof window<"u"&&typeof window.matchMedia=="function"?window.matchMedia("(pointer: coarse)"):null),[t,n]=f.useState((r=e==null?void 0:e.matches)!=null?r:!1);return ee(()=>{if(!e)return;function o(a){n(a.matches)}return e.addEventListener("change",o),()=>e.removeEventListener("change",o)},[e]),t}function Xu({defaultContainers:r=[],portals:e,mainTreeNode:t}={}){let n=gr(t),o=B(()=>{var a,l;let u=[];for(let i of r)i!==null&&(i instanceof HTMLElement?u.push(i):"current"in i&&i.current instanceof HTMLElement&&u.push(i.current));if(e!=null&&e.current)for(let i of e.current)u.push(i);for(let i of(a=n==null?void 0:n.querySelectorAll("html > *, body > *"))!=null?a:[])i!==document.body&&i!==document.head&&i instanceof HTMLElement&&i.id!=="headlessui-portal-root"&&(t&&(i.contains(t)||i.contains((l=t==null?void 0:t.getRootNode())==null?void 0:l.host))||u.some(d=>i.contains(d))||u.push(i));return u});return{resolveContainers:o,contains:B(a=>o().some(l=>l.contains(a)))}}let xo=f.createContext(null);function Oo({children:r,node:e}){let[t,n]=f.useState(null),o=Po(e??t);return f.createElement(xo.Provider,{value:o},r,o===null&&f.createElement(kt,{features:Br.Hidden,ref:a=>{var l,u;if(a){for(let i of(u=(l=jr(a))==null?void 0:l.querySelectorAll("html > *, body > *"))!=null?u:[])if(i!==document.body&&i!==document.head&&i instanceof HTMLElement&&i!=null&&i.contains(a)){n(i);break}}}}))}function Po(r=null){var e;return(e=f.useContext(xo))!=null?e:r}function Bt(){let r=f.useRef(!1);return ee(()=>(r.current=!0,()=>{r.current=!1}),[]),r}var wr=(r=>(r[r.Forwards=0]="Forwards",r[r.Backwards=1]="Backwards",r))(wr||{});function Ju(){let r=f.useRef(0);return fo(!0,"keydown",e=>{e.key==="Tab"&&(r.current=e.shiftKey?1:0)},!0),r}function Ao(r){if(!r)return new Set;if(typeof r=="function")return new Set(r());let e=new Set;for(let t of r.current)t.current instanceof HTMLElement&&e.add(t.current);return e}let Qu="div";var ke=(r=>(r[r.None=0]="None",r[r.InitialFocus=1]="InitialFocus",r[r.TabLock=2]="TabLock",r[r.FocusLock=4]="FocusLock",r[r.RestoreFocus=8]="RestoreFocus",r[r.AutoFocus=16]="AutoFocus",r))(ke||{});function Zu(r,e){let t=f.useRef(null),n=ye(t,e),{initialFocus:o,initialFocusFallback:a,containers:l,features:u=15,...i}=r;br()||(u=0);let d=gr(t);ns(u,{ownerDocument:d});let s=os(u,{ownerDocument:d,container:t,initialFocus:o,initialFocusFallback:a});as(u,{ownerDocument:d,container:t,containers:l,previousActiveElement:s});let g=Ju(),v=B(b=>{let w=t.current;w&&(x=>x())(()=>{Pe(g.current,{[wr.Forwards]:()=>{vr(w,he.First,{skipElements:[b.relatedTarget,a]})},[wr.Backwards]:()=>{vr(w,he.Last,{skipElements:[b.relatedTarget,a]})}})})}),E=Qe(!!(u&2),"focus-trap#tab-lock"),p=It(),m=f.useRef(!1),y={ref:n,onKeyDown(b){b.key=="Tab"&&(m.current=!0,p.requestAnimationFrame(()=>{m.current=!1}))},onBlur(b){if(!(u&4))return;let w=Ao(l);t.current instanceof HTMLElement&&w.add(t.current);let x=b.relatedTarget;x instanceof HTMLElement&&x.dataset.headlessuiFocusGuard!=="true"&&(To(w,x)||(m.current?vr(t.current,Pe(g.current,{[wr.Forwards]:()=>he.Next,[wr.Backwards]:()=>he.Previous})|he.WrapAround,{relativeTo:b.target}):b.target instanceof HTMLElement&&ge(b.target)))}},h=ae();return f.createElement(f.Fragment,null,E&&f.createElement(kt,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:v,features:Br.Focusable}),h({ourProps:y,theirProps:i,defaultTag:Qu,name:"FocusTrap"}),E&&f.createElement(kt,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:v,features:Br.Focusable}))}let es=te(Zu),rs=Object.assign(es,{features:ke});function ts(r=!0){let e=f.useRef(Te.slice());return Wt(([t],[n])=>{n===!0&&t===!1&&Lr(()=>{e.current.splice(0)}),n===!1&&t===!0&&(e.current=Te.slice())},[r,Te,e]),B(()=>{var t;return(t=e.current.find(n=>n!=null&&n.isConnected))!=null?t:null})}function ns(r,{ownerDocument:e}){let t=!!(r&8),n=ts(t);Wt(()=>{t||(e==null?void 0:e.activeElement)===(e==null?void 0:e.body)&&ge(n())},[t]),ho(()=>{t&&ge(n())})}function os(r,{ownerDocument:e,container:t,initialFocus:n,initialFocusFallback:o}){let a=f.useRef(null),l=Qe(!!(r&1),"focus-trap#initial-focus"),u=Bt();return Wt(()=>{if(r===0)return;if(!l){o!=null&&o.current&&ge(o.current);return}let i=t.current;i&&Lr(()=>{if(!u.current)return;let d=e==null?void 0:e.activeElement;if(n!=null&&n.current){if((n==null?void 0:n.current)===d){a.current=d;return}}else if(i.contains(d)){a.current=d;return}if(n!=null&&n.current)ge(n.current);else{if(r&16){if(vr(i,he.First|he.AutoFocus)!==Lt.Error)return}else if(vr(i,he.First)!==Lt.Error)return;if(o!=null&&o.current&&(ge(o.current),(e==null?void 0:e.activeElement)===o.current))return;console.warn("There are no focusable elements inside the <FocusTrap />")}a.current=e==null?void 0:e.activeElement})},[o,l,r]),a}function as(r,{ownerDocument:e,container:t,containers:n,previousActiveElement:o}){let a=Bt(),l=!!(r&4);yo(e==null?void 0:e.defaultView,"focus",u=>{if(!l||!a.current)return;let i=Ao(n);t.current instanceof HTMLElement&&i.add(t.current);let d=o.current;if(!d)return;let s=u.target;s&&s instanceof HTMLElement?To(i,s)?(o.current=s,ge(s)):(u.preventDefault(),u.stopPropagation(),ge(d)):ge(o.current)},!0)}function To(r,e){for(let t of r)if(t.contains(e))return!0;return!1}function $o(r){var e;return!!(r.enter||r.enterFrom||r.enterTo||r.leave||r.leaveFrom||r.leaveTo)||((e=r.as)!=null?e:Fo)!==f.Fragment||f.Children.count(r.children)===1}let qr=f.createContext(null);qr.displayName="TransitionContext";var is=(r=>(r.Visible="visible",r.Hidden="hidden",r))(is||{});function ls(){let r=f.useContext(qr);if(r===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return r}function us(){let r=f.useContext(Gr);if(r===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return r}let Gr=f.createContext(null);Gr.displayName="NestingContext";function zr(r){return"children"in r?zr(r.children):r.current.filter(({el:e})=>e.current!==null).filter(({state:e})=>e==="visible").length>0}function Co(r,e){let t=Ie(r),n=f.useRef([]),o=Bt(),a=It(),l=B((E,p=Ae.Hidden)=>{let m=n.current.findIndex(({el:y})=>y===E);m!==-1&&(Pe(p,{[Ae.Unmount](){n.current.splice(m,1)},[Ae.Hidden](){n.current[m].state="hidden"}}),a.microTask(()=>{var y;!zr(n)&&o.current&&((y=t.current)==null||y.call(t))}))}),u=B(E=>{let p=n.current.find(({el:m})=>m===E);return p?p.state!=="visible"&&(p.state="visible"):n.current.push({el:E,state:"visible"}),()=>l(E,Ae.Unmount)}),i=f.useRef([]),d=f.useRef(Promise.resolve()),s=f.useRef({enter:[],leave:[]}),g=B((E,p,m)=>{i.current.splice(0),e&&(e.chains.current[p]=e.chains.current[p].filter(([y])=>y!==E)),e==null||e.chains.current[p].push([E,new Promise(y=>{i.current.push(y)})]),e==null||e.chains.current[p].push([E,new Promise(y=>{Promise.all(s.current[p].map(([h,b])=>b)).then(()=>y())})]),p==="enter"?d.current=d.current.then(()=>e==null?void 0:e.wait.current).then(()=>m(p)):m(p)}),v=B((E,p,m)=>{Promise.all(s.current[p].splice(0).map(([y,h])=>h)).then(()=>{var y;(y=i.current.shift())==null||y()}).then(()=>m(p))});return f.useMemo(()=>({children:n,register:u,unregister:l,onStart:g,onStop:v,wait:d,chains:s}),[u,l,n,g,v,s,d])}let Fo=f.Fragment,Mo=Wr.RenderStrategy;function ss(r,e){var t,n;let{transition:o=!0,beforeEnter:a,afterEnter:l,beforeLeave:u,afterLeave:i,enter:d,enterFrom:s,enterTo:g,entered:v,leave:E,leaveFrom:p,leaveTo:m,...y}=r,[h,b]=f.useState(null),w=f.useRef(null),x=$o(r),P=ye(...x?[w,e,b]:e===null?[]:[e]),D=(t=y.unmount)==null||t?Ae.Unmount:Ae.Hidden,{show:_,appear:U,initial:H}=ls(),[j,z]=f.useState(_?"visible":"hidden"),V=us(),{register:C,unregister:T}=V;ee(()=>C(w),[C,w]),ee(()=>{if(D===Ae.Hidden&&w.current){if(_&&j!=="visible"){z("visible");return}return Pe(j,{hidden:()=>T(w),visible:()=>C(w)})}},[j,w,C,T,_,D]);let k=br();ee(()=>{if(x&&k&&j==="visible"&&w.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[w,j,k,x]);let oe=H&&!U,se=U&&_&&H,me=f.useRef(!1),Z=Co(()=>{me.current||(z("hidden"),T(w))},V),ce=B(Le=>{me.current=!0;let be=Le?"enter":"leave";Z.onStart(w,be,we=>{we==="enter"?a==null||a():we==="leave"&&(u==null||u())})}),q=B(Le=>{let be=Le?"enter":"leave";me.current=!1,Z.onStop(w,be,we=>{we==="enter"?l==null||l():we==="leave"&&(i==null||i())}),be==="leave"&&!zr(Z)&&(z("hidden"),T(w))});f.useEffect(()=>{x&&o||(ce(_),q(_))},[_,x,o]);let Ne=!(!o||!x||!k||oe),[,J]=Mu(Ne,h,_,{start:ce,end:q}),qt=_e({ref:P,className:((n=_t(y.className,se&&d,se&&s,J.enter&&d,J.enter&&J.closed&&s,J.enter&&!J.closed&&g,J.leave&&E,J.leave&&!J.closed&&p,J.leave&&J.closed&&m,!J.transition&&_&&v))==null?void 0:n.trim())||void 0,...Fu(J)}),je=0;j==="visible"&&(je|=ue.Open),j==="hidden"&&(je|=ue.Closed),J.enter&&(je|=ue.Opening),J.leave&&(je|=ue.Closing);let Er=ae();return f.createElement(Gr.Provider,{value:Z},f.createElement(ku,{value:je},Er({ourProps:qt,theirProps:y,defaultTag:Fo,features:Mo,visible:j==="visible",name:"Transition.Child"})))}function cs(r,e){let{show:t,appear:n=!1,unmount:o=!0,...a}=r,l=f.useRef(null),u=$o(r),i=ye(...u?[l,e]:e===null?[]:[e]);br();let d=Vr();if(t===void 0&&d!==null&&(t=(d&ue.Open)===ue.Open),t===void 0)throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[s,g]=f.useState(t?"visible":"hidden"),v=Co(()=>{t||g("hidden")}),[E,p]=f.useState(!0),m=f.useRef([t]);ee(()=>{E!==!1&&m.current[m.current.length-1]!==t&&(m.current.push(t),p(!1))},[m,t]);let y=f.useMemo(()=>({show:t,appear:n,initial:E}),[t,n,E]);ee(()=>{t?g("visible"):!zr(v)&&l.current!==null&&g("hidden")},[t,v]);let h={unmount:o},b=B(()=>{var P;E&&p(!1),(P=r.beforeEnter)==null||P.call(r)}),w=B(()=>{var P;E&&p(!1),(P=r.beforeLeave)==null||P.call(r)}),x=ae();return f.createElement(Gr.Provider,{value:v},f.createElement(qr.Provider,{value:y},x({ourProps:{...h,as:f.Fragment,children:f.createElement(Io,{ref:i,...h,...a,beforeEnter:b,beforeLeave:w})},theirProps:{},defaultTag:f.Fragment,features:Mo,visible:s==="visible",name:"Transition"})))}function fs(r,e){let t=f.useContext(qr)!==null,n=Vr()!==null;return f.createElement(f.Fragment,null,!t&&n?f.createElement(Rt,{ref:e,...r}):f.createElement(Io,{ref:e,...r}))}let Rt=te(cs),Io=te(ss),Ze=te(fs),_o=Object.assign(Rt,{Child:Ze,Root:Rt});var ds=(r=>(r[r.Open=0]="Open",r[r.Closed=1]="Closed",r))(ds||{}),ps=(r=>(r[r.SetTitleId=0]="SetTitleId",r))(ps||{});let ys={0(r,e){return r.titleId===e.id?r:{...r,titleId:e.id}}},Ht=f.createContext(null);Ht.displayName="DialogContext";function Yr(r){let e=f.useContext(Ht);if(e===null){let t=new Error(`<${r} /> is missing a parent <Dialog /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,Yr),t}return e}function ms(r,e){return Pe(e.type,ys,r,e)}let Do=te(function(r,e){let t=f.useId(),{id:n=`headlessui-dialog-${t}`,open:o,onClose:a,initialFocus:l,role:u="dialog",autoFocus:i=!0,__demoMode:d=!1,unmount:s=!1,...g}=r,v=f.useRef(!1);u=function(){return u==="dialog"||u==="alertdialog"?u:(v.current||(v.current=!0,console.warn(`Invalid role [${u}] passed to <Dialog />. Only \`dialog\` and and \`alertdialog\` are supported. Using \`dialog\` instead.`)),"dialog")}();let E=Vr();o===void 0&&E!==null&&(o=(E&ue.Open)===ue.Open);let p=f.useRef(null),m=ye(p,e),y=gr(p),h=o?0:1,[b,w]=f.useReducer(ms,{titleId:null,descriptionId:null,panelRef:f.createRef()}),x=B(()=>a(!1)),P=B(q=>w({type:0,id:q})),D=br()?h===0:!1,[_,U]=qu(),H={get current(){var q;return(q=b.panelRef.current)!=null?q:p.current}},j=Po(),{resolveContainers:z}=Xu({mainTreeNode:j,portals:_,defaultContainers:[H]}),V=E!==null?(E&ue.Closing)===ue.Closing:!1;uu(d||V?!1:D,{allowed:B(()=>{var q,Ne;return[(Ne=(q=p.current)==null?void 0:q.closest("[data-headlessui-portal]"))!=null?Ne:null]}),disallowed:B(()=>{var q;return[(q=j==null?void 0:j.closest("body > *:not(#headlessui-portal-root)"))!=null?q:null]})}),Eu(D,z,q=>{q.preventDefault(),x()}),Yu(D,y==null?void 0:y.defaultView,q=>{q.preventDefault(),q.stopPropagation(),document.activeElement&&"blur"in document.activeElement&&typeof document.activeElement.blur=="function"&&document.activeElement.blur(),x()}),Tu(d||V?!1:D,y,z),su(D,p,x);let[C,T]=Zl(),k=f.useMemo(()=>[{dialogState:h,close:x,setTitleId:P,unmount:s},b],[h,b,x,P,s]),oe=f.useMemo(()=>({open:h===0}),[h]),se={ref:m,id:n,role:u,tabIndex:-1,"aria-modal":d?void 0:h===0?!0:void 0,"aria-labelledby":b.titleId,"aria-describedby":C,unmount:s},me=!Ku(),Z=ke.None;D&&!d&&(Z|=ke.RestoreFocus,Z|=ke.TabLock,i&&(Z|=ke.AutoFocus),me&&(Z|=ke.InitialFocus));let ce=ae();return f.createElement(Nu,null,f.createElement(bo,{force:!0},f.createElement(zu,null,f.createElement(Ht.Provider,{value:k},f.createElement(So,{target:p},f.createElement(bo,{force:!1},f.createElement(T,{slot:oe},f.createElement(U,null,f.createElement(rs,{initialFocus:l,initialFocusFallback:p,containers:z,features:Z},f.createElement(au,{value:x},ce({ourProps:se,theirProps:g,slot:oe,defaultTag:vs,features:hs,visible:h===0,name:"Dialog"})))))))))))}),vs="div",hs=Wr.RenderStrategy|Wr.Static;function gs(r,e){let{transition:t=!1,open:n,...o}=r,a=Vr(),l=r.hasOwnProperty("open")||a!==null,u=r.hasOwnProperty("onClose");if(!l&&!u)throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!l)throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!u)throw new Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");if(!a&&typeof r.open!="boolean")throw new Error(`You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${r.open}`);if(typeof r.onClose!="function")throw new Error(`You provided an \`onClose\` prop to the \`Dialog\`, but the value is not a function. Received: ${r.onClose}`);return(n!==void 0||t)&&!o.static?f.createElement(Oo,null,f.createElement(_o,{show:n,transition:t,unmount:o.unmount},f.createElement(Do,{ref:e,...o}))):f.createElement(Oo,null,f.createElement(Do,{ref:e,open:n,...o}))}let bs="div";function ws(r,e){let t=f.useId(),{id:n=`headlessui-dialog-panel-${t}`,transition:o=!1,...a}=r,[{dialogState:l,unmount:u},i]=Yr("Dialog.Panel"),d=ye(e,i.panelRef),s=f.useMemo(()=>({open:l===0}),[l]),g=B(y=>{y.stopPropagation()}),v={ref:d,id:n,onClick:g},E=o?Ze:f.Fragment,p=o?{unmount:u}:{},m=ae();return f.createElement(E,{...p},m({ourProps:v,theirProps:a,slot:s,defaultTag:bs,name:"Dialog.Panel"}))}let Es="div";function Ss(r,e){let{transition:t=!1,...n}=r,[{dialogState:o,unmount:a}]=Yr("Dialog.Backdrop"),l=f.useMemo(()=>({open:o===0}),[o]),u={ref:e,"aria-hidden":!0},i=t?Ze:f.Fragment,d=t?{unmount:a}:{},s=ae();return f.createElement(i,{...d},s({ourProps:u,theirProps:n,slot:l,defaultTag:Es,name:"Dialog.Backdrop"}))}let xs="h2";function Os(r,e){let t=f.useId(),{id:n=`headlessui-dialog-title-${t}`,...o}=r,[{dialogState:a,setTitleId:l}]=Yr("Dialog.Title"),u=ye(e);f.useEffect(()=>(l(n),()=>l(null)),[n,l]);let i=f.useMemo(()=>({open:a===0}),[a]),d={ref:u,id:n};return ae()({ourProps:d,theirProps:o,slot:i,defaultTag:xs,name:"Dialog.Title"})}let Ps=te(gs),Vt=te(ws);te(Ss);let As=te(Os),Ts=Object.assign(Ps,{Panel:Vt,Title:As,Description:nu});function ko({onClick:r}){return $.jsxs("button",{type:"button",className:"im-close-button text-gray-400 hover:text-gray-500",onClick:r,children:[$.jsx("span",{className:"sr-only",children:"Close"}),$.jsx("svg",{className:"size-6",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor","aria-hidden":"true",children:$.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})]})}const $s=({modalContext:r,config:e,children:t})=>$.jsx("div",{className:"im-modal-container fixed inset-0 z-40 overflow-y-auto p-4",children:$.jsx("div",{className:Nr("im-modal-positioner flex min-h-full justify-center",{"items-start":e.position==="top","items-center":e.position==="center","items-end":e.position==="bottom"}),children:$.jsx(Ze,{enterFrom:"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",enterTo:"opacity-100 translate-y-0 sm:scale-100",leaveFrom:"opacity-100 translate-y-0 sm:scale-100",leaveTo:"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",afterLeave:r.afterLeave,className:Nr("im-modal-wrapper w-full transition duration-300 ease-in-out",r.onTopOfStack?"":"blur-sm",{"sm:max-w-sm":e.maxWidth==="sm","sm:max-w-md":e.maxWidth==="md","sm:max-w-md md:max-w-lg":e.maxWidth==="lg","sm:max-w-md md:max-w-xl":e.maxWidth==="xl","sm:max-w-md md:max-w-xl lg:max-w-2xl":e.maxWidth==="2xl","sm:max-w-md md:max-w-xl lg:max-w-3xl":e.maxWidth==="3xl","sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-4xl":e.maxWidth==="4xl","sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl":e.maxWidth==="5xl","sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl 2xl:max-w-6xl":e.maxWidth==="6xl","sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl 2xl:max-w-7xl":e.maxWidth==="7xl"}),children:$.jsxs(Vt,{className:`im-modal-content relative ${e.paddingClasses} ${e.panelClasses}`,children:[e.closeButton&&$.jsx("div",{className:"absolute right-0 top-0 pr-3 pt-3",children:$.jsx(ko,{onClick:r.close})}),typeof t=="function"?t({modalContext:r,config:e}):t]})})})}),Cs=({modalContext:r,config:e,children:t})=>$.jsx("div",{className:"im-slideover-container fixed inset-0 z-40 overflow-y-auto overflow-x-hidden",children:$.jsx("div",{className:Nr("im-slideover-positioner flex min-h-full items-center",{"justify-start":e.position==="left","justify-end":e.position==="right"}),children:$.jsx(Ze,{enterFrom:`opacity-0 ${e.position==="left"?"-translate-x-full":"translate-x-full"}`,enterTo:"opacity-100 translate-x-0",leaveFrom:"opacity-100 translate-x-0",leaveTo:`opacity-0 ${e.position==="left"?"-translate-x-full":"translate-x-full"}`,afterLeave:r.afterLeave,className:Nr("im-slideover-wrapper w-full transition duration-300 ease-in-out",r.onTopOfStack?"":"blur-sm",{"sm:max-w-sm":e.maxWidth==="sm","sm:max-w-md":e.maxWidth==="md","sm:max-w-md md:max-w-lg":e.maxWidth==="lg","sm:max-w-md md:max-w-xl":e.maxWidth==="xl","sm:max-w-md md:max-w-xl lg:max-w-2xl":e.maxWidth==="2xl","sm:max-w-md md:max-w-xl lg:max-w-3xl":e.maxWidth==="3xl","sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-4xl":e.maxWidth==="4xl","sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl":e.maxWidth==="5xl","sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl 2xl:max-w-6xl":e.maxWidth==="6xl","sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl 2xl:max-w-7xl":e.maxWidth==="7xl"}),children:$.jsxs(Vt,{className:`im-slideover-content relative ${e.paddingClasses} ${e.panelClasses}`,children:[e.closeButton&&$.jsx("div",{className:"absolute right-0 top-0 pr-3 pt-3",children:$.jsx(ko,{onClick:r.close})}),typeof t=="function"?t({modalContext:r,config:e}):t]})})})}),No=f.forwardRef(({name:r,children:e,...t},n)=>{const o=l=>typeof e=="function"?e(l):e,a=f.useRef(null);return f.useImperativeHandle(n,()=>a.current,[a]),$.jsx(Ft,{ref:a,name:r,...t,children:({afterLeave:l,close:u,config:i,emit:d,getChildModal:s,getParentModal:g,id:v,index:E,isOpen:p,modalContext:m,onTopOfStack:y,reload:h,setOpen:b,shouldRender:w})=>$.jsx(_o,{appear:!0,show:p??!1,children:$.jsxs(Ts,{as:"div",className:"im-dialog relative z-20",onClose:()=>i.closeExplicitly?null:u(),"data-inertiaui-modal-id":v,"data-inertiaui-modal-index":E,children:[E===0?$.jsx(Ze,{enter:"transition transform ease-in-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"transition transform ease-in-out duration-300",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:y?$.jsx("div",{className:"im-backdrop fixed inset-0 z-30 bg-black/75","aria-hidden":"true"}):$.jsx("div",{})}):null,E>0&&y?$.jsx("div",{className:"im-backdrop fixed inset-0 z-30 bg-black/75"}):null,i.slideover?$.jsx(Cs,{modalContext:m,config:i,children:o({afterLeave:l,close:u,config:i,emit:d,getChildModal:s,getParentModal:g,id:v,index:E,isOpen:p,modalContext:m,onTopOfStack:y,reload:h,setOpen:b,shouldRender:w})}):$.jsx($s,{modalContext:m,config:i,children:o({afterLeave:l,close:u,config:i,emit:d,getChildModal:s,getParentModal:g,id:v,index:E,isOpen:p,modalContext:m,onTopOfStack:y,reload:h,setOpen:b,shouldRender:w})})]})})})});No.displayName="Modal";const Fs=({href:r,method:e="get",data:t={},as:n="a",headers:o={},queryStringArrayFormat:a="brackets",onAfterLeave:l=null,onBlur:u=null,onClose:i=null,onError:d=null,onFocus:s=null,onStart:g=null,onSuccess:v=null,navigate:E=null,children:p,...m})=>{const[y,h]=f.useState(!1),[b,w]=f.useState(null),{stack:x,visit:P}=yr(),D=f.useMemo(()=>E??Pr("navigate"),[E]),_={},U={};Object.keys(m).forEach(T=>{Jn.includes(T)||(T.startsWith("on")&&typeof m[T]=="function"?T.toLowerCase()in window?_[T]=m[T]:U[T]=m[T]:_[T]=m[T])});const[H,j]=f.useState(!1);f.useEffect(()=>{b&&(b.onTopOfStack&&H?s==null||s():!b.onTopOfStack&&!H&&(u==null||u()),j(!b.onTopOfStack))},[x]);const z=f.useCallback(()=>{i==null||i()},[i]),V=f.useCallback(()=>{w(null),l==null||l()},[l]),C=f.useCallback(T=>{T==null||T.preventDefault(),!y&&(r.startsWith("#")||(h(!0),g==null||g()),P(r,e,t,o,la(en(m,Jn)),()=>z(x.length),V,a,D).then(k=>{w(k),k.registerEventListenersFromProps(U),v==null||v()}).catch(k=>{console.error(k),d==null||d(k)}).finally(()=>h(!1)))},[r,e,t,o,a,m,z,V]);return $.jsx(n,{..._,href:r,onClick:C,children:typeof p=="function"?p({loading:y}):p})};function Ms(){return yr().stack[Ct()]??null}L.HeadlessModal=Ft,L.Modal=No,L.ModalLink=Fs,L.ModalRoot=Qn,L.ModalStackProvider=Xn,L.getConfig=Pr,L.putConfig=ra,L.renderApp=Bl,L.resetConfig=ea,L.useModal=Ms,L.useModalIndex=Ct,L.useModalStack=yr,Object.defineProperty(L,Symbol.toStringTag,{value:"Module"})});
|
|
37
|
+
`))}else{let v=s.props,E=v==null?void 0:v.className,p=typeof E=="function"?(...h)=>Dt(E(...h),i.className):Dt(E,i.className),m=p?{className:p}:{},y=to(s.props,_e(kt(i,["ref"])));for(let h in b)h in y&&delete b[h];return f.cloneElement(s,Object.assign({},y,b,d,{ref:o(s.ref,d.ref)},m))}return f.createElement(a,Object.assign({},kt(i,["ref"]),a!==f.Fragment&&d,a!==f.Fragment&&b),s)}function Kl(){let r=f.useRef([]),e=f.useCallback(t=>{for(let n of r.current)n!=null&&(typeof n=="function"?n(t):n.current=t)},[]);return(...t)=>{if(!t.every(n=>n==null))return r.current=t,e}}function Xl(...r){return r.every(e=>e==null)?void 0:e=>{for(let t of r)t!=null&&(typeof t=="function"?t(e):t.current=e)}}function to(...r){if(r.length===0)return{};if(r.length===1)return r[0];let e={},t={};for(let n of r)for(let o in n)o.startsWith("on")&&typeof n[o]=="function"?(t[o]!=null||(t[o]=[]),t[o].push(n[o])):e[o]=n[o];if(e.disabled||e["aria-disabled"])for(let n in t)/^(on(?:Click|Pointer|Mouse|Key)(?:Down|Up|Press)?)$/.test(n)&&(t[n]=[o=>{var a;return(a=o==null?void 0:o.preventDefault)==null?void 0:a.call(o)}]);for(let n in t)Object.assign(e,{[n](o,...a){let l=t[n];for(let u of l){if((o instanceof Event||(o==null?void 0:o.nativeEvent)instanceof Event)&&o.defaultPrevented)return;u(o,...a)}}});return e}function te(r){var e;return Object.assign(f.forwardRef(r),{displayName:(e=r.displayName)!=null?e:r.name})}function _e(r){let e=Object.assign({},r);for(let t in e)e[t]===void 0&&delete e[t];return e}function kt(r,e=[]){let t=Object.assign({},r);for(let n of e)n in t&&delete t[n];return t}let Jl="span";var Rr=(r=>(r[r.None=1]="None",r[r.Focusable=2]="Focusable",r[r.Hidden=4]="Hidden",r))(Rr||{});function Ql(r,e){var t;let{features:n=1,...o}=r,a={ref:e,"aria-hidden":(n&2)===2?!0:(t=o["aria-hidden"])!=null?t:void 0,hidden:(n&4)===4?!0:void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...(n&4)===4&&(n&2)!==2&&{display:"none"}}};return ae()({ourProps:a,theirProps:o,slot:{},defaultTag:Jl,name:"Hidden"})}let Nt=te(Ql),no=Symbol();function Zl(r,e=!0){return Object.assign(r,{[no]:e})}function ye(...r){let e=f.useRef(r);f.useEffect(()=>{e.current=r},[r]);let t=B(n=>{for(let o of e.current)o!=null&&(typeof o=="function"?o(n):o.current=n)});return r.every(n=>n==null||(n==null?void 0:n[no]))?void 0:t}let jt=f.createContext(null);jt.displayName="DescriptionContext";function oo(){let r=f.useContext(jt);if(r===null){let e=new Error("You used a <Description /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(e,oo),e}return r}function eu(){let[r,e]=f.useState([]);return[r.length>0?r.join(" "):void 0,f.useMemo(()=>function(t){let n=B(a=>(e(l=>[...l,a]),()=>e(l=>{let u=l.slice(),i=u.indexOf(a);return i!==-1&&u.splice(i,1),u}))),o=f.useMemo(()=>({register:n,slot:t.slot,name:t.name,props:t.props,value:t.value}),[n,t.slot,t.name,t.props,t.value]);return f.createElement(jt.Provider,{value:o},t.children)},[e])]}let ru="p";function tu(r,e){let t=f.useId(),n=zl(),{id:o=`headlessui-description-${t}`,...a}=r,l=oo(),u=ye(e);ee(()=>l.register(o),[o,l.register]);let i=n||!1,d=f.useMemo(()=>({...l.slot,disabled:i}),[l.slot,i]),s={ref:u,...l.props,id:o};return ae()({ourProps:s,theirProps:a,slot:d,defaultTag:ru,name:l.name||"Description"})}let nu=te(tu),ou=Object.assign(nu,{});var ao=(r=>(r.Space=" ",r.Enter="Enter",r.Escape="Escape",r.Backspace="Backspace",r.Delete="Delete",r.ArrowLeft="ArrowLeft",r.ArrowUp="ArrowUp",r.ArrowRight="ArrowRight",r.ArrowDown="ArrowDown",r.Home="Home",r.End="End",r.PageUp="PageUp",r.PageDown="PageDown",r.Tab="Tab",r))(ao||{});let au=f.createContext(()=>{});function iu({value:r,children:e}){return f.createElement(au.Provider,{value:r},e)}let lu=class extends Map{constructor(e){super(),this.factory=e}get(e){let t=super.get(e);return t===void 0&&(t=this.factory(e),this.set(e,t)),t}};function io(r,e){let t=r(),n=new Set;return{getSnapshot(){return t},subscribe(o){return n.add(o),()=>n.delete(o)},dispatch(o,...a){let l=e[o].call(t,...a);l&&(t=l,n.forEach(u=>u()))}}}function lo(r){return f.useSyncExternalStore(r.subscribe,r.getSnapshot,r.getSnapshot)}let uu=new lu(()=>io(()=>[],{ADD(r){return this.includes(r)?this:[...this,r]},REMOVE(r){let e=this.indexOf(r);if(e===-1)return this;let t=this.slice();return t.splice(e,1),t}}));function Qe(r,e){let t=uu.get(e),n=f.useId(),o=lo(t);if(ee(()=>{if(r)return t.dispatch("ADD",n),()=>t.dispatch("REMOVE",n)},[t,r]),!r)return!1;let a=o.indexOf(n),l=o.length;return a===-1&&(a=l,l+=1),a===l-1}let Lt=new Map,vr=new Map;function uo(r){var e;let t=(e=vr.get(r))!=null?e:0;return vr.set(r,t+1),t!==0?()=>so(r):(Lt.set(r,{"aria-hidden":r.getAttribute("aria-hidden"),inert:r.inert}),r.setAttribute("aria-hidden","true"),r.inert=!0,()=>so(r))}function so(r){var e;let t=(e=vr.get(r))!=null?e:1;if(t===1?vr.delete(r):vr.set(r,t-1),t!==1)return;let n=Lt.get(r);n&&(n["aria-hidden"]===null?r.removeAttribute("aria-hidden"):r.setAttribute("aria-hidden",n["aria-hidden"]),r.inert=n.inert,Lt.delete(r))}function su(r,{allowed:e,disallowed:t}={}){let n=Qe(r,"inert-others");ee(()=>{var o,a;if(!n)return;let l=Oe();for(let i of(o=t==null?void 0:t())!=null?o:[])i&&l.add(uo(i));let u=(a=e==null?void 0:e())!=null?a:[];for(let i of u){if(!i)continue;let d=Lr(i);if(!d)continue;let s=i.parentElement;for(;s&&s!==d.body;){for(let b of s.children)u.some(v=>b.contains(v))||l.add(uo(b));s=s.parentElement}}return l.dispose},[n,e,t])}function cu(r,e,t){let n=Ie(o=>{let a=o.getBoundingClientRect();a.x===0&&a.y===0&&a.width===0&&a.height===0&&t()});f.useEffect(()=>{if(!r)return;let o=e===null?null:e instanceof HTMLElement?e:e.current;if(!o)return;let a=Oe();if(typeof ResizeObserver<"u"){let l=new ResizeObserver(()=>n.current(o));l.observe(o),a.add(()=>l.disconnect())}if(typeof IntersectionObserver<"u"){let l=new IntersectionObserver(()=>n.current(o));l.observe(o),a.add(()=>l.disconnect())}return()=>a.dispose()},[e,n,r])}let Hr=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map(r=>`${r}:not([tabindex='-1'])`).join(","),fu=["[data-autofocus]"].map(r=>`${r}:not([tabindex='-1'])`).join(",");var he=(r=>(r[r.First=1]="First",r[r.Previous=2]="Previous",r[r.Next=4]="Next",r[r.Last=8]="Last",r[r.WrapAround=16]="WrapAround",r[r.NoScroll=32]="NoScroll",r[r.AutoFocus=64]="AutoFocus",r))(he||{}),Wt=(r=>(r[r.Error=0]="Error",r[r.Overflow=1]="Overflow",r[r.Success=2]="Success",r[r.Underflow=3]="Underflow",r))(Wt||{}),du=(r=>(r[r.Previous=-1]="Previous",r[r.Next=1]="Next",r))(du||{});function pu(r=document.body){return r==null?[]:Array.from(r.querySelectorAll(Hr)).sort((e,t)=>Math.sign((e.tabIndex||Number.MAX_SAFE_INTEGER)-(t.tabIndex||Number.MAX_SAFE_INTEGER)))}function yu(r=document.body){return r==null?[]:Array.from(r.querySelectorAll(fu)).sort((e,t)=>Math.sign((e.tabIndex||Number.MAX_SAFE_INTEGER)-(t.tabIndex||Number.MAX_SAFE_INTEGER)))}var co=(r=>(r[r.Strict=0]="Strict",r[r.Loose=1]="Loose",r))(co||{});function mu(r,e=0){var t;return r===((t=Lr(r))==null?void 0:t.body)?!1:Pe(e,{0(){return r.matches(Hr)},1(){let n=r;for(;n!==null;){if(n.matches(Hr))return!0;n=n.parentElement}return!1}})}var vu=(r=>(r[r.Keyboard=0]="Keyboard",r[r.Mouse=1]="Mouse",r))(vu||{});typeof window<"u"&&typeof document<"u"&&(document.addEventListener("keydown",r=>{r.metaKey||r.altKey||r.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")},!0),document.addEventListener("click",r=>{r.detail===1?delete document.documentElement.dataset.headlessuiFocusVisible:r.detail===0&&(document.documentElement.dataset.headlessuiFocusVisible="")},!0));function ge(r){r==null||r.focus({preventScroll:!0})}let hu=["textarea","input"].join(",");function gu(r){var e,t;return(t=(e=r==null?void 0:r.matches)==null?void 0:e.call(r,hu))!=null?t:!1}function bu(r,e=t=>t){return r.slice().sort((t,n)=>{let o=e(t),a=e(n);if(o===null||a===null)return 0;let l=o.compareDocumentPosition(a);return l&Node.DOCUMENT_POSITION_FOLLOWING?-1:l&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function hr(r,e,{sorted:t=!0,relativeTo:n=null,skipElements:o=[]}={}){let a=Array.isArray(r)?r.length>0?r[0].ownerDocument:document:r.ownerDocument,l=Array.isArray(r)?t?bu(r):r:e&64?yu(r):pu(r);o.length>0&&l.length>1&&(l=l.filter(E=>!o.some(p=>p!=null&&"current"in p?(p==null?void 0:p.current)===E:p===E))),n=n??a.activeElement;let u=(()=>{if(e&5)return 1;if(e&10)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),i=(()=>{if(e&1)return 0;if(e&2)return Math.max(0,l.indexOf(n))-1;if(e&4)return Math.max(0,l.indexOf(n))+1;if(e&8)return l.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),d=e&32?{preventScroll:!0}:{},s=0,b=l.length,v;do{if(s>=b||s+b<=0)return 0;let E=i+s;if(e&16)E=(E+b)%b;else{if(E<0)return 3;if(E>=b)return 1}v=l[E],v==null||v.focus(d),s+=u}while(v!==a.activeElement);return e&6&&gu(v)&&v.select(),2}function fo(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function wu(){return/Android/gi.test(window.navigator.userAgent)}function Eu(){return fo()||wu()}function gr(r,e,t,n){let o=Ie(t);f.useEffect(()=>{if(!r)return;function a(l){o.current(l)}return document.addEventListener(e,a,n),()=>document.removeEventListener(e,a,n)},[r,e,n])}function po(r,e,t,n){let o=Ie(t);f.useEffect(()=>{if(!r)return;function a(l){o.current(l)}return window.addEventListener(e,a,n),()=>window.removeEventListener(e,a,n)},[r,e,n])}const yo=30;function Su(r,e,t){let n=Qe(r,"outside-click"),o=Ie(t),a=f.useCallback(function(i,d){if(i.defaultPrevented)return;let s=d(i);if(s===null||!s.getRootNode().contains(s)||!s.isConnected)return;let b=function v(E){return typeof E=="function"?v(E()):Array.isArray(E)||E instanceof Set?E:[E]}(e);for(let v of b)if(v!==null&&(v.contains(s)||i.composed&&i.composedPath().includes(v)))return;return!mu(s,co.Loose)&&s.tabIndex!==-1&&i.preventDefault(),o.current(i,s)},[o,e]),l=f.useRef(null);gr(n,"pointerdown",i=>{var d,s;l.current=((s=(d=i.composedPath)==null?void 0:d.call(i))==null?void 0:s[0])||i.target},!0),gr(n,"mousedown",i=>{var d,s;l.current=((s=(d=i.composedPath)==null?void 0:d.call(i))==null?void 0:s[0])||i.target},!0),gr(n,"click",i=>{Eu()||l.current&&(a(i,()=>l.current),l.current=null)},!0);let u=f.useRef({x:0,y:0});gr(n,"touchstart",i=>{u.current.x=i.touches[0].clientX,u.current.y=i.touches[0].clientY},!0),gr(n,"touchend",i=>{let d={x:i.changedTouches[0].clientX,y:i.changedTouches[0].clientY};if(!(Math.abs(d.x-u.current.x)>=yo||Math.abs(d.y-u.current.y)>=yo))return a(i,()=>i.target instanceof HTMLElement?i.target:null)},!0),po(n,"blur",i=>a(i,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}function br(...r){return f.useMemo(()=>Lr(...r),[...r])}function mo(r,e,t,n){let o=Ie(t);f.useEffect(()=>{r=r??window;function a(l){o.current(l)}return r.addEventListener(e,a,n),()=>r.removeEventListener(e,a,n)},[r,e,n])}function xu(){let r;return{before({doc:e}){var t;let n=e.documentElement,o=(t=e.defaultView)!=null?t:window;r=Math.max(0,o.innerWidth-n.clientWidth)},after({doc:e,d:t}){let n=e.documentElement,o=Math.max(0,n.clientWidth-n.offsetWidth),a=Math.max(0,r-o);t.style(n,"paddingRight",`${a}px`)}}}function Ou(){return fo()?{before({doc:r,d:e,meta:t}){function n(o){return t.containers.flatMap(a=>a()).some(a=>a.contains(o))}e.microTask(()=>{var o;if(window.getComputedStyle(r.documentElement).scrollBehavior!=="auto"){let u=Oe();u.style(r.documentElement,"scrollBehavior","auto"),e.add(()=>e.microTask(()=>u.dispose()))}let a=(o=window.scrollY)!=null?o:window.pageYOffset,l=null;e.addEventListener(r,"click",u=>{if(u.target instanceof HTMLElement)try{let i=u.target.closest("a");if(!i)return;let{hash:d}=new URL(i.href),s=r.querySelector(d);s&&!n(s)&&(l=s)}catch{}},!0),e.addEventListener(r,"touchstart",u=>{if(u.target instanceof HTMLElement)if(n(u.target)){let i=u.target;for(;i.parentElement&&n(i.parentElement);)i=i.parentElement;e.style(i,"overscrollBehavior","contain")}else e.style(u.target,"touchAction","none")}),e.addEventListener(r,"touchmove",u=>{if(u.target instanceof HTMLElement){if(u.target.tagName==="INPUT")return;if(n(u.target)){let i=u.target;for(;i.parentElement&&i.dataset.headlessuiPortal!==""&&!(i.scrollHeight>i.clientHeight||i.scrollWidth>i.clientWidth);)i=i.parentElement;i.dataset.headlessuiPortal===""&&u.preventDefault()}else u.preventDefault()}},{passive:!1}),e.add(()=>{var u;let i=(u=window.scrollY)!=null?u:window.pageYOffset;a!==i&&window.scrollTo(0,a),l&&l.isConnected&&(l.scrollIntoView({block:"nearest"}),l=null)})})}}:{}}function Pu(){return{before({doc:r,d:e}){e.style(r.documentElement,"overflow","hidden")}}}function Au(r){let e={};for(let t of r)Object.assign(e,t(e));return e}let De=io(()=>new Map,{PUSH(r,e){var t;let n=(t=this.get(r))!=null?t:{doc:r,count:0,d:Oe(),meta:new Set};return n.count++,n.meta.add(e),this.set(r,n),this},POP(r,e){let t=this.get(r);return t&&(t.count--,t.meta.delete(e)),this},SCROLL_PREVENT({doc:r,d:e,meta:t}){let n={doc:r,d:e,meta:Au(t)},o=[Ou(),xu(),Pu()];o.forEach(({before:a})=>a==null?void 0:a(n)),o.forEach(({after:a})=>a==null?void 0:a(n))},SCROLL_ALLOW({d:r}){r.dispose()},TEARDOWN({doc:r}){this.delete(r)}});De.subscribe(()=>{let r=De.getSnapshot(),e=new Map;for(let[t]of r)e.set(t,t.documentElement.style.overflow);for(let t of r.values()){let n=e.get(t.doc)==="hidden",o=t.count!==0;(o&&!n||!o&&n)&&De.dispatch(t.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",t),t.count===0&&De.dispatch("TEARDOWN",t)}});function Tu(r,e,t=()=>({containers:[]})){let n=lo(De),o=e?n.get(e):void 0,a=o?o.count>0:!1;return ee(()=>{if(!(!e||!r))return De.dispatch("PUSH",e,t),()=>De.dispatch("POP",e,t)},[r,e]),a}function $u(r,e,t=()=>[document.body]){let n=Qe(r,"scroll-lock");Tu(n,e,o=>{var a;return{containers:[...(a=o.containers)!=null?a:[],t]}})}function Cu(r=0){let[e,t]=f.useState(r),n=f.useCallback(i=>t(i),[e]),o=f.useCallback(i=>t(d=>d|i),[e]),a=f.useCallback(i=>(e&i)===i,[e]),l=f.useCallback(i=>t(d=>d&~i),[t]),u=f.useCallback(i=>t(d=>d^i),[t]);return{flags:e,setFlag:n,addFlag:o,hasFlag:a,removeFlag:l,toggleFlag:u}}var vo,ho;typeof process<"u"&&typeof globalThis<"u"&&typeof Element<"u"&&((vo=process==null?void 0:process.env)==null?void 0:vo.NODE_ENV)==="test"&&typeof((ho=Element==null?void 0:Element.prototype)==null?void 0:ho.getAnimations)>"u"&&(Element.prototype.getAnimations=function(){return console.warn(["Headless UI has polyfilled `Element.prototype.getAnimations` for your tests.","Please install a proper polyfill e.g. `jsdom-testing-mocks`, to silence these warnings.","","Example usage:","```js","import { mockAnimationsApi } from 'jsdom-testing-mocks'","mockAnimationsApi()","```"].join(`
|
|
38
|
+
`)),[]});var Fu=(r=>(r[r.None=0]="None",r[r.Closed=1]="Closed",r[r.Enter=2]="Enter",r[r.Leave=4]="Leave",r))(Fu||{});function Mu(r){let e={};for(let t in r)r[t]===!0&&(e[`data-${t}`]="");return e}function Iu(r,e,t,n){let[o,a]=f.useState(t),{hasFlag:l,addFlag:u,removeFlag:i}=Cu(r&&o?3:0),d=f.useRef(!1),s=f.useRef(!1),b=_t();return ee(()=>{var v;if(r){if(t&&a(!0),!e){t&&u(3);return}return(v=n==null?void 0:n.start)==null||v.call(n,t),_u(e,{inFlight:d,prepare(){s.current?s.current=!1:s.current=d.current,d.current=!0,!s.current&&(t?(u(3),i(4)):(u(4),i(2)))},run(){s.current?t?(i(3),u(4)):(i(4),u(3)):t?i(1):u(1)},done(){var E;s.current&&typeof e.getAnimations=="function"&&e.getAnimations().length>0||(d.current=!1,i(7),t||a(!1),(E=n==null?void 0:n.end)==null||E.call(n,t))}})}},[r,t,e,b]),r?[o,{closed:l(1),enter:l(2),leave:l(4),transition:l(2)||l(4)}]:[t,{closed:void 0,enter:void 0,leave:void 0,transition:void 0}]}function _u(r,{prepare:e,run:t,done:n,inFlight:o}){let a=Oe();return ku(r,{prepare:e,inFlight:o}),a.nextFrame(()=>{t(),a.requestAnimationFrame(()=>{a.add(Du(r,n))})}),a.dispose}function Du(r,e){var t,n;let o=Oe();if(!r)return o.dispose;let a=!1;o.add(()=>{a=!0});let l=(n=(t=r.getAnimations)==null?void 0:t.call(r).filter(u=>u instanceof CSSTransition))!=null?n:[];return l.length===0?(e(),o.dispose):(Promise.allSettled(l.map(u=>u.finished)).then(()=>{a||e()}),o.dispose)}function ku(r,{inFlight:e,prepare:t}){if(e!=null&&e.current){t();return}let n=r.style.transition;r.style.transition="none",t(),r.offsetHeight,r.style.transition=n}function Ut(r,e){let t=f.useRef([]),n=B(r);f.useEffect(()=>{let o=[...t.current];for(let[a,l]of e.entries())if(t.current[a]!==l){let u=n(e,o);return t.current=e,u}},[n,...e])}let Vr=f.createContext(null);Vr.displayName="OpenClosedContext";var ue=(r=>(r[r.Open=1]="Open",r[r.Closed=2]="Closed",r[r.Closing=4]="Closing",r[r.Opening=8]="Opening",r))(ue||{});function qr(){return f.useContext(Vr)}function Nu({value:r,children:e}){return f.createElement(Vr.Provider,{value:r},e)}function ju({children:r}){return f.createElement(Vr.Provider,{value:null},r)}function Lu(r){function e(){document.readyState!=="loading"&&(r(),document.removeEventListener("DOMContentLoaded",e))}typeof window<"u"&&typeof document<"u"&&(document.addEventListener("DOMContentLoaded",e),e())}let Te=[];Lu(()=>{function r(e){if(!(e.target instanceof HTMLElement)||e.target===document.body||Te[0]===e.target)return;let t=e.target;t=t.closest(Hr),Te.unshift(t??e.target),Te=Te.filter(n=>n!=null&&n.isConnected),Te.splice(10)}window.addEventListener("click",r,{capture:!0}),window.addEventListener("mousedown",r,{capture:!0}),window.addEventListener("focus",r,{capture:!0}),document.body.addEventListener("click",r,{capture:!0}),document.body.addEventListener("mousedown",r,{capture:!0}),document.body.addEventListener("focus",r,{capture:!0})});function go(r){let e=B(r),t=f.useRef(!1);f.useEffect(()=>(t.current=!1,()=>{t.current=!0,Wr(()=>{t.current&&e()})}),[e])}function Wu(){let r=typeof document>"u";return"useSyncExternalStore"in tr?(e=>e.useSyncExternalStore)(tr)(()=>()=>{},()=>!1,()=>!r):!1}function wr(){let r=Wu(),[e,t]=tr.useState(Me.isHandoffComplete);return e&&Me.isHandoffComplete===!1&&t(!1),tr.useEffect(()=>{e!==!0&&t(!0)},[e]),tr.useEffect(()=>Me.handoff(),[]),r?!1:e}let bo=f.createContext(!1);function Uu(){return f.useContext(bo)}function wo(r){return f.createElement(bo.Provider,{value:r.force},r.children)}function Bu(r){let e=Uu(),t=f.useContext(So),n=br(r),[o,a]=f.useState(()=>{var l;if(!e&&t!==null)return(l=t.current)!=null?l:null;if(Me.isServer)return null;let u=n==null?void 0:n.getElementById("headlessui-portal-root");if(u)return u;if(n===null)return null;let i=n.createElement("div");return i.setAttribute("id","headlessui-portal-root"),n.body.appendChild(i)});return f.useEffect(()=>{o!==null&&(n!=null&&n.body.contains(o)||n==null||n.body.appendChild(o))},[o,n]),f.useEffect(()=>{e||t!==null&&a(t.current)},[t,a,e]),o}let Eo=f.Fragment,Ru=te(function(r,e){let t=r,n=f.useRef(null),o=ye(Zl(b=>{n.current=b}),e),a=br(n),l=Bu(n),[u]=f.useState(()=>{var b;return Me.isServer?null:(b=a==null?void 0:a.createElement("div"))!=null?b:null}),i=f.useContext(Bt),d=wr();ee(()=>{!l||!u||l.contains(u)||(u.setAttribute("data-headlessui-portal",""),l.appendChild(u))},[l,u]),ee(()=>{if(u&&i)return i.register(u)},[i,u]),go(()=>{var b;!l||!u||(u instanceof Node&&l.contains(u)&&l.removeChild(u),l.childNodes.length<=0&&((b=l.parentElement)==null||b.removeChild(l)))});let s=ae();return d?!l||!u?null:Qo.createPortal(s({ourProps:{ref:o},theirProps:t,slot:{},defaultTag:Eo,name:"Portal"}),u):null});function Hu(r,e){let t=ye(e),{enabled:n=!0,...o}=r,a=ae();return n?f.createElement(Ru,{...o,ref:t}):a({ourProps:{ref:t},theirProps:o,slot:{},defaultTag:Eo,name:"Portal"})}let Vu=f.Fragment,So=f.createContext(null);function qu(r,e){let{target:t,...n}=r,o={ref:ye(e)},a=ae();return f.createElement(So.Provider,{value:t},a({ourProps:o,theirProps:n,defaultTag:Vu,name:"Popover.Group"}))}let Bt=f.createContext(null);function Gu(){let r=f.useContext(Bt),e=f.useRef([]),t=B(a=>(e.current.push(a),r&&r.register(a),()=>n(a))),n=B(a=>{let l=e.current.indexOf(a);l!==-1&&e.current.splice(l,1),r&&r.unregister(a)}),o=f.useMemo(()=>({register:t,unregister:n,portals:e}),[t,n,e]);return[e,f.useMemo(()=>function({children:a}){return f.createElement(Bt.Provider,{value:o},a)},[o])]}let zu=te(Hu),xo=te(qu),Yu=Object.assign(zu,{Group:xo});function Ku(r,e=typeof document<"u"?document.defaultView:null,t){let n=Qe(r,"escape");mo(e,"keydown",o=>{n&&(o.defaultPrevented||o.key===ao.Escape&&t(o))})}function Xu(){var r;let[e]=f.useState(()=>typeof window<"u"&&typeof window.matchMedia=="function"?window.matchMedia("(pointer: coarse)"):null),[t,n]=f.useState((r=e==null?void 0:e.matches)!=null?r:!1);return ee(()=>{if(!e)return;function o(a){n(a.matches)}return e.addEventListener("change",o),()=>e.removeEventListener("change",o)},[e]),t}function Ju({defaultContainers:r=[],portals:e,mainTreeNode:t}={}){let n=br(t),o=B(()=>{var a,l;let u=[];for(let i of r)i!==null&&(i instanceof HTMLElement?u.push(i):"current"in i&&i.current instanceof HTMLElement&&u.push(i.current));if(e!=null&&e.current)for(let i of e.current)u.push(i);for(let i of(a=n==null?void 0:n.querySelectorAll("html > *, body > *"))!=null?a:[])i!==document.body&&i!==document.head&&i instanceof HTMLElement&&i.id!=="headlessui-portal-root"&&(t&&(i.contains(t)||i.contains((l=t==null?void 0:t.getRootNode())==null?void 0:l.host))||u.some(d=>i.contains(d))||u.push(i));return u});return{resolveContainers:o,contains:B(a=>o().some(l=>l.contains(a)))}}let Oo=f.createContext(null);function Po({children:r,node:e}){let[t,n]=f.useState(null),o=Ao(e??t);return f.createElement(Oo.Provider,{value:o},r,o===null&&f.createElement(Nt,{features:Rr.Hidden,ref:a=>{var l,u;if(a){for(let i of(u=(l=Lr(a))==null?void 0:l.querySelectorAll("html > *, body > *"))!=null?u:[])if(i!==document.body&&i!==document.head&&i instanceof HTMLElement&&i!=null&&i.contains(a)){n(i);break}}}}))}function Ao(r=null){var e;return(e=f.useContext(Oo))!=null?e:r}function Rt(){let r=f.useRef(!1);return ee(()=>(r.current=!0,()=>{r.current=!1}),[]),r}var Er=(r=>(r[r.Forwards=0]="Forwards",r[r.Backwards=1]="Backwards",r))(Er||{});function Qu(){let r=f.useRef(0);return po(!0,"keydown",e=>{e.key==="Tab"&&(r.current=e.shiftKey?1:0)},!0),r}function To(r){if(!r)return new Set;if(typeof r=="function")return new Set(r());let e=new Set;for(let t of r.current)t.current instanceof HTMLElement&&e.add(t.current);return e}let Zu="div";var ke=(r=>(r[r.None=0]="None",r[r.InitialFocus=1]="InitialFocus",r[r.TabLock=2]="TabLock",r[r.FocusLock=4]="FocusLock",r[r.RestoreFocus=8]="RestoreFocus",r[r.AutoFocus=16]="AutoFocus",r))(ke||{});function es(r,e){let t=f.useRef(null),n=ye(t,e),{initialFocus:o,initialFocusFallback:a,containers:l,features:u=15,...i}=r;wr()||(u=0);let d=br(t);os(u,{ownerDocument:d});let s=as(u,{ownerDocument:d,container:t,initialFocus:o,initialFocusFallback:a});is(u,{ownerDocument:d,container:t,containers:l,previousActiveElement:s});let b=Qu(),v=B(g=>{let w=t.current;w&&(x=>x())(()=>{Pe(b.current,{[Er.Forwards]:()=>{hr(w,he.First,{skipElements:[g.relatedTarget,a]})},[Er.Backwards]:()=>{hr(w,he.Last,{skipElements:[g.relatedTarget,a]})}})})}),E=Qe(!!(u&2),"focus-trap#tab-lock"),p=_t(),m=f.useRef(!1),y={ref:n,onKeyDown(g){g.key=="Tab"&&(m.current=!0,p.requestAnimationFrame(()=>{m.current=!1}))},onBlur(g){if(!(u&4))return;let w=To(l);t.current instanceof HTMLElement&&w.add(t.current);let x=g.relatedTarget;x instanceof HTMLElement&&x.dataset.headlessuiFocusGuard!=="true"&&($o(w,x)||(m.current?hr(t.current,Pe(b.current,{[Er.Forwards]:()=>he.Next,[Er.Backwards]:()=>he.Previous})|he.WrapAround,{relativeTo:g.target}):g.target instanceof HTMLElement&&ge(g.target)))}},h=ae();return f.createElement(f.Fragment,null,E&&f.createElement(Nt,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:v,features:Rr.Focusable}),h({ourProps:y,theirProps:i,defaultTag:Zu,name:"FocusTrap"}),E&&f.createElement(Nt,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:v,features:Rr.Focusable}))}let rs=te(es),ts=Object.assign(rs,{features:ke});function ns(r=!0){let e=f.useRef(Te.slice());return Ut(([t],[n])=>{n===!0&&t===!1&&Wr(()=>{e.current.splice(0)}),n===!1&&t===!0&&(e.current=Te.slice())},[r,Te,e]),B(()=>{var t;return(t=e.current.find(n=>n!=null&&n.isConnected))!=null?t:null})}function os(r,{ownerDocument:e}){let t=!!(r&8),n=ns(t);Ut(()=>{t||(e==null?void 0:e.activeElement)===(e==null?void 0:e.body)&&ge(n())},[t]),go(()=>{t&&ge(n())})}function as(r,{ownerDocument:e,container:t,initialFocus:n,initialFocusFallback:o}){let a=f.useRef(null),l=Qe(!!(r&1),"focus-trap#initial-focus"),u=Rt();return Ut(()=>{if(r===0)return;if(!l){o!=null&&o.current&&ge(o.current);return}let i=t.current;i&&Wr(()=>{if(!u.current)return;let d=e==null?void 0:e.activeElement;if(n!=null&&n.current){if((n==null?void 0:n.current)===d){a.current=d;return}}else if(i.contains(d)){a.current=d;return}if(n!=null&&n.current)ge(n.current);else{if(r&16){if(hr(i,he.First|he.AutoFocus)!==Wt.Error)return}else if(hr(i,he.First)!==Wt.Error)return;if(o!=null&&o.current&&(ge(o.current),(e==null?void 0:e.activeElement)===o.current))return;console.warn("There are no focusable elements inside the <FocusTrap />")}a.current=e==null?void 0:e.activeElement})},[o,l,r]),a}function is(r,{ownerDocument:e,container:t,containers:n,previousActiveElement:o}){let a=Rt(),l=!!(r&4);mo(e==null?void 0:e.defaultView,"focus",u=>{if(!l||!a.current)return;let i=To(n);t.current instanceof HTMLElement&&i.add(t.current);let d=o.current;if(!d)return;let s=u.target;s&&s instanceof HTMLElement?$o(i,s)?(o.current=s,ge(s)):(u.preventDefault(),u.stopPropagation(),ge(d)):ge(o.current)},!0)}function $o(r,e){for(let t of r)if(t.contains(e))return!0;return!1}function Co(r){var e;return!!(r.enter||r.enterFrom||r.enterTo||r.leave||r.leaveFrom||r.leaveTo)||((e=r.as)!=null?e:Mo)!==f.Fragment||f.Children.count(r.children)===1}let Gr=f.createContext(null);Gr.displayName="TransitionContext";var ls=(r=>(r.Visible="visible",r.Hidden="hidden",r))(ls||{});function us(){let r=f.useContext(Gr);if(r===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return r}function ss(){let r=f.useContext(zr);if(r===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return r}let zr=f.createContext(null);zr.displayName="NestingContext";function Yr(r){return"children"in r?Yr(r.children):r.current.filter(({el:e})=>e.current!==null).filter(({state:e})=>e==="visible").length>0}function Fo(r,e){let t=Ie(r),n=f.useRef([]),o=Rt(),a=_t(),l=B((E,p=Ae.Hidden)=>{let m=n.current.findIndex(({el:y})=>y===E);m!==-1&&(Pe(p,{[Ae.Unmount](){n.current.splice(m,1)},[Ae.Hidden](){n.current[m].state="hidden"}}),a.microTask(()=>{var y;!Yr(n)&&o.current&&((y=t.current)==null||y.call(t))}))}),u=B(E=>{let p=n.current.find(({el:m})=>m===E);return p?p.state!=="visible"&&(p.state="visible"):n.current.push({el:E,state:"visible"}),()=>l(E,Ae.Unmount)}),i=f.useRef([]),d=f.useRef(Promise.resolve()),s=f.useRef({enter:[],leave:[]}),b=B((E,p,m)=>{i.current.splice(0),e&&(e.chains.current[p]=e.chains.current[p].filter(([y])=>y!==E)),e==null||e.chains.current[p].push([E,new Promise(y=>{i.current.push(y)})]),e==null||e.chains.current[p].push([E,new Promise(y=>{Promise.all(s.current[p].map(([h,g])=>g)).then(()=>y())})]),p==="enter"?d.current=d.current.then(()=>e==null?void 0:e.wait.current).then(()=>m(p)):m(p)}),v=B((E,p,m)=>{Promise.all(s.current[p].splice(0).map(([y,h])=>h)).then(()=>{var y;(y=i.current.shift())==null||y()}).then(()=>m(p))});return f.useMemo(()=>({children:n,register:u,unregister:l,onStart:b,onStop:v,wait:d,chains:s}),[u,l,n,b,v,s,d])}let Mo=f.Fragment,Io=Ur.RenderStrategy;function cs(r,e){var t,n;let{transition:o=!0,beforeEnter:a,afterEnter:l,beforeLeave:u,afterLeave:i,enter:d,enterFrom:s,enterTo:b,entered:v,leave:E,leaveFrom:p,leaveTo:m,...y}=r,[h,g]=f.useState(null),w=f.useRef(null),x=Co(r),P=ye(...x?[w,e,g]:e===null?[]:[e]),D=(t=y.unmount)==null||t?Ae.Unmount:Ae.Hidden,{show:_,appear:U,initial:H}=us(),[j,z]=f.useState(_?"visible":"hidden"),V=ss(),{register:C,unregister:T}=V;ee(()=>C(w),[C,w]),ee(()=>{if(D===Ae.Hidden&&w.current){if(_&&j!=="visible"){z("visible");return}return Pe(j,{hidden:()=>T(w),visible:()=>C(w)})}},[j,w,C,T,_,D]);let k=wr();ee(()=>{if(x&&k&&j==="visible"&&w.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[w,j,k,x]);let oe=H&&!U,se=U&&_&&H,me=f.useRef(!1),Z=Fo(()=>{me.current||(z("hidden"),T(w))},V),ce=B(Le=>{me.current=!0;let be=Le?"enter":"leave";Z.onStart(w,be,we=>{we==="enter"?a==null||a():we==="leave"&&(u==null||u())})}),q=B(Le=>{let be=Le?"enter":"leave";me.current=!1,Z.onStop(w,be,we=>{we==="enter"?l==null||l():we==="leave"&&(i==null||i())}),be==="leave"&&!Yr(Z)&&(z("hidden"),T(w))});f.useEffect(()=>{x&&o||(ce(_),q(_))},[_,x,o]);let Ne=!(!o||!x||!k||oe),[,J]=Iu(Ne,h,_,{start:ce,end:q}),Gt=_e({ref:P,className:((n=Dt(y.className,se&&d,se&&s,J.enter&&d,J.enter&&J.closed&&s,J.enter&&!J.closed&&b,J.leave&&E,J.leave&&!J.closed&&p,J.leave&&J.closed&&m,!J.transition&&_&&v))==null?void 0:n.trim())||void 0,...Mu(J)}),je=0;j==="visible"&&(je|=ue.Open),j==="hidden"&&(je|=ue.Closed),J.enter&&(je|=ue.Opening),J.leave&&(je|=ue.Closing);let Sr=ae();return f.createElement(zr.Provider,{value:Z},f.createElement(Nu,{value:je},Sr({ourProps:Gt,theirProps:y,defaultTag:Mo,features:Io,visible:j==="visible",name:"Transition.Child"})))}function fs(r,e){let{show:t,appear:n=!1,unmount:o=!0,...a}=r,l=f.useRef(null),u=Co(r),i=ye(...u?[l,e]:e===null?[]:[e]);wr();let d=qr();if(t===void 0&&d!==null&&(t=(d&ue.Open)===ue.Open),t===void 0)throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[s,b]=f.useState(t?"visible":"hidden"),v=Fo(()=>{t||b("hidden")}),[E,p]=f.useState(!0),m=f.useRef([t]);ee(()=>{E!==!1&&m.current[m.current.length-1]!==t&&(m.current.push(t),p(!1))},[m,t]);let y=f.useMemo(()=>({show:t,appear:n,initial:E}),[t,n,E]);ee(()=>{t?b("visible"):!Yr(v)&&l.current!==null&&b("hidden")},[t,v]);let h={unmount:o},g=B(()=>{var P;E&&p(!1),(P=r.beforeEnter)==null||P.call(r)}),w=B(()=>{var P;E&&p(!1),(P=r.beforeLeave)==null||P.call(r)}),x=ae();return f.createElement(zr.Provider,{value:v},f.createElement(Gr.Provider,{value:y},x({ourProps:{...h,as:f.Fragment,children:f.createElement(_o,{ref:i,...h,...a,beforeEnter:g,beforeLeave:w})},theirProps:{},defaultTag:f.Fragment,features:Io,visible:s==="visible",name:"Transition"})))}function ds(r,e){let t=f.useContext(Gr)!==null,n=qr()!==null;return f.createElement(f.Fragment,null,!t&&n?f.createElement(Ht,{ref:e,...r}):f.createElement(_o,{ref:e,...r}))}let Ht=te(fs),_o=te(cs),Ze=te(ds),Do=Object.assign(Ht,{Child:Ze,Root:Ht});var ps=(r=>(r[r.Open=0]="Open",r[r.Closed=1]="Closed",r))(ps||{}),ys=(r=>(r[r.SetTitleId=0]="SetTitleId",r))(ys||{});let ms={0(r,e){return r.titleId===e.id?r:{...r,titleId:e.id}}},Vt=f.createContext(null);Vt.displayName="DialogContext";function Kr(r){let e=f.useContext(Vt);if(e===null){let t=new Error(`<${r} /> is missing a parent <Dialog /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,Kr),t}return e}function vs(r,e){return Pe(e.type,ms,r,e)}let ko=te(function(r,e){let t=f.useId(),{id:n=`headlessui-dialog-${t}`,open:o,onClose:a,initialFocus:l,role:u="dialog",autoFocus:i=!0,__demoMode:d=!1,unmount:s=!1,...b}=r,v=f.useRef(!1);u=function(){return u==="dialog"||u==="alertdialog"?u:(v.current||(v.current=!0,console.warn(`Invalid role [${u}] passed to <Dialog />. Only \`dialog\` and and \`alertdialog\` are supported. Using \`dialog\` instead.`)),"dialog")}();let E=qr();o===void 0&&E!==null&&(o=(E&ue.Open)===ue.Open);let p=f.useRef(null),m=ye(p,e),y=br(p),h=o?0:1,[g,w]=f.useReducer(vs,{titleId:null,descriptionId:null,panelRef:f.createRef()}),x=B(()=>a(!1)),P=B(q=>w({type:0,id:q})),D=wr()?h===0:!1,[_,U]=Gu(),H={get current(){var q;return(q=g.panelRef.current)!=null?q:p.current}},j=Ao(),{resolveContainers:z}=Ju({mainTreeNode:j,portals:_,defaultContainers:[H]}),V=E!==null?(E&ue.Closing)===ue.Closing:!1;su(d||V?!1:D,{allowed:B(()=>{var q,Ne;return[(Ne=(q=p.current)==null?void 0:q.closest("[data-headlessui-portal]"))!=null?Ne:null]}),disallowed:B(()=>{var q;return[(q=j==null?void 0:j.closest("body > *:not(#headlessui-portal-root)"))!=null?q:null]})}),Su(D,z,q=>{q.preventDefault(),x()}),Ku(D,y==null?void 0:y.defaultView,q=>{q.preventDefault(),q.stopPropagation(),document.activeElement&&"blur"in document.activeElement&&typeof document.activeElement.blur=="function"&&document.activeElement.blur(),x()}),$u(d||V?!1:D,y,z),cu(D,p,x);let[C,T]=eu(),k=f.useMemo(()=>[{dialogState:h,close:x,setTitleId:P,unmount:s},g],[h,g,x,P,s]),oe=f.useMemo(()=>({open:h===0}),[h]),se={ref:m,id:n,role:u,tabIndex:-1,"aria-modal":d?void 0:h===0?!0:void 0,"aria-labelledby":g.titleId,"aria-describedby":C,unmount:s},me=!Xu(),Z=ke.None;D&&!d&&(Z|=ke.RestoreFocus,Z|=ke.TabLock,i&&(Z|=ke.AutoFocus),me&&(Z|=ke.InitialFocus));let ce=ae();return f.createElement(ju,null,f.createElement(wo,{force:!0},f.createElement(Yu,null,f.createElement(Vt.Provider,{value:k},f.createElement(xo,{target:p},f.createElement(wo,{force:!1},f.createElement(T,{slot:oe},f.createElement(U,null,f.createElement(ts,{initialFocus:l,initialFocusFallback:p,containers:z,features:Z},f.createElement(iu,{value:x},ce({ourProps:se,theirProps:b,slot:oe,defaultTag:hs,features:gs,visible:h===0,name:"Dialog"})))))))))))}),hs="div",gs=Ur.RenderStrategy|Ur.Static;function bs(r,e){let{transition:t=!1,open:n,...o}=r,a=qr(),l=r.hasOwnProperty("open")||a!==null,u=r.hasOwnProperty("onClose");if(!l&&!u)throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!l)throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!u)throw new Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");if(!a&&typeof r.open!="boolean")throw new Error(`You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${r.open}`);if(typeof r.onClose!="function")throw new Error(`You provided an \`onClose\` prop to the \`Dialog\`, but the value is not a function. Received: ${r.onClose}`);return(n!==void 0||t)&&!o.static?f.createElement(Po,null,f.createElement(Do,{show:n,transition:t,unmount:o.unmount},f.createElement(ko,{ref:e,...o}))):f.createElement(Po,null,f.createElement(ko,{ref:e,open:n,...o}))}let ws="div";function Es(r,e){let t=f.useId(),{id:n=`headlessui-dialog-panel-${t}`,transition:o=!1,...a}=r,[{dialogState:l,unmount:u},i]=Kr("Dialog.Panel"),d=ye(e,i.panelRef),s=f.useMemo(()=>({open:l===0}),[l]),b=B(y=>{y.stopPropagation()}),v={ref:d,id:n,onClick:b},E=o?Ze:f.Fragment,p=o?{unmount:u}:{},m=ae();return f.createElement(E,{...p},m({ourProps:v,theirProps:a,slot:s,defaultTag:ws,name:"Dialog.Panel"}))}let Ss="div";function xs(r,e){let{transition:t=!1,...n}=r,[{dialogState:o,unmount:a}]=Kr("Dialog.Backdrop"),l=f.useMemo(()=>({open:o===0}),[o]),u={ref:e,"aria-hidden":!0},i=t?Ze:f.Fragment,d=t?{unmount:a}:{},s=ae();return f.createElement(i,{...d},s({ourProps:u,theirProps:n,slot:l,defaultTag:Ss,name:"Dialog.Backdrop"}))}let Os="h2";function Ps(r,e){let t=f.useId(),{id:n=`headlessui-dialog-title-${t}`,...o}=r,[{dialogState:a,setTitleId:l}]=Kr("Dialog.Title"),u=ye(e);f.useEffect(()=>(l(n),()=>l(null)),[n,l]);let i=f.useMemo(()=>({open:a===0}),[a]),d={ref:u,id:n};return ae()({ourProps:d,theirProps:o,slot:i,defaultTag:Os,name:"Dialog.Title"})}let As=te(bs),qt=te(Es);te(xs);let Ts=te(Ps),$s=Object.assign(As,{Panel:qt,Title:Ts,Description:ou});function No({onClick:r}){return $.jsxs("button",{type:"button",className:"im-close-button text-gray-400 hover:text-gray-500",onClick:r,children:[$.jsx("span",{className:"sr-only",children:"Close"}),$.jsx("svg",{className:"size-6",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor","aria-hidden":"true",children:$.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})]})}const Cs=({modalContext:r,config:e,children:t})=>$.jsx("div",{className:"im-modal-container fixed inset-0 z-40 overflow-y-auto p-4",children:$.jsx("div",{className:jr("im-modal-positioner flex min-h-full justify-center",{"items-start":e.position==="top","items-center":e.position==="center","items-end":e.position==="bottom"}),children:$.jsx(Ze,{enterFrom:"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",enterTo:"opacity-100 translate-y-0 sm:scale-100",leaveFrom:"opacity-100 translate-y-0 sm:scale-100",leaveTo:"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",afterLeave:r.afterLeave,className:jr("im-modal-wrapper w-full transition duration-300 ease-in-out",r.onTopOfStack?"":"blur-sm",{"sm:max-w-sm":e.maxWidth==="sm","sm:max-w-md":e.maxWidth==="md","sm:max-w-md md:max-w-lg":e.maxWidth==="lg","sm:max-w-md md:max-w-xl":e.maxWidth==="xl","sm:max-w-md md:max-w-xl lg:max-w-2xl":e.maxWidth==="2xl","sm:max-w-md md:max-w-xl lg:max-w-3xl":e.maxWidth==="3xl","sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-4xl":e.maxWidth==="4xl","sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl":e.maxWidth==="5xl","sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl 2xl:max-w-6xl":e.maxWidth==="6xl","sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl 2xl:max-w-7xl":e.maxWidth==="7xl"}),children:$.jsxs(qt,{className:`im-modal-content relative ${e.paddingClasses} ${e.panelClasses}`,children:[e.closeButton&&$.jsx("div",{className:"absolute right-0 top-0 pr-3 pt-3",children:$.jsx(No,{onClick:r.close})}),typeof t=="function"?t({modalContext:r,config:e}):t]})})})}),Fs=({modalContext:r,config:e,children:t})=>$.jsx("div",{className:"im-slideover-container fixed inset-0 z-40 overflow-y-auto overflow-x-hidden",children:$.jsx("div",{className:jr("im-slideover-positioner flex min-h-full items-center",{"justify-start":e.position==="left","justify-end":e.position==="right"}),children:$.jsx(Ze,{enterFrom:`opacity-0 ${e.position==="left"?"-translate-x-full":"translate-x-full"}`,enterTo:"opacity-100 translate-x-0",leaveFrom:"opacity-100 translate-x-0",leaveTo:`opacity-0 ${e.position==="left"?"-translate-x-full":"translate-x-full"}`,afterLeave:r.afterLeave,className:jr("im-slideover-wrapper w-full transition duration-300 ease-in-out",r.onTopOfStack?"":"blur-sm",{"sm:max-w-sm":e.maxWidth==="sm","sm:max-w-md":e.maxWidth==="md","sm:max-w-md md:max-w-lg":e.maxWidth==="lg","sm:max-w-md md:max-w-xl":e.maxWidth==="xl","sm:max-w-md md:max-w-xl lg:max-w-2xl":e.maxWidth==="2xl","sm:max-w-md md:max-w-xl lg:max-w-3xl":e.maxWidth==="3xl","sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-4xl":e.maxWidth==="4xl","sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl":e.maxWidth==="5xl","sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl 2xl:max-w-6xl":e.maxWidth==="6xl","sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl 2xl:max-w-7xl":e.maxWidth==="7xl"}),children:$.jsxs(qt,{className:`im-slideover-content relative ${e.paddingClasses} ${e.panelClasses}`,children:[e.closeButton&&$.jsx("div",{className:"absolute right-0 top-0 pr-3 pt-3",children:$.jsx(No,{onClick:r.close})}),typeof t=="function"?t({modalContext:r,config:e}):t]})})})}),jo=f.forwardRef(({name:r,children:e,...t},n)=>{const o=l=>typeof e=="function"?e(l):e,a=f.useRef(null);return f.useImperativeHandle(n,()=>a.current,[a]),$.jsx(Mt,{ref:a,name:r,...t,children:({afterLeave:l,close:u,config:i,emit:d,getChildModal:s,getParentModal:b,id:v,index:E,isOpen:p,modalContext:m,onTopOfStack:y,reload:h,setOpen:g,shouldRender:w})=>$.jsx(Do,{appear:!0,show:p??!1,children:$.jsxs($s,{as:"div",className:"im-dialog relative z-20",onClose:()=>i.closeExplicitly?null:u(),"data-inertiaui-modal-id":v,"data-inertiaui-modal-index":E,children:[E===0?$.jsx(Ze,{enter:"transition transform ease-in-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"transition transform ease-in-out duration-300",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:y?$.jsx("div",{className:"im-backdrop fixed inset-0 z-30 bg-black/75","aria-hidden":"true"}):$.jsx("div",{})}):null,E>0&&y?$.jsx("div",{className:"im-backdrop fixed inset-0 z-30 bg-black/75"}):null,i.slideover?$.jsx(Fs,{modalContext:m,config:i,children:o({afterLeave:l,close:u,config:i,emit:d,getChildModal:s,getParentModal:b,id:v,index:E,isOpen:p,modalContext:m,onTopOfStack:y,reload:h,setOpen:g,shouldRender:w})}):$.jsx(Cs,{modalContext:m,config:i,children:o({afterLeave:l,close:u,config:i,emit:d,getChildModal:s,getParentModal:b,id:v,index:E,isOpen:p,modalContext:m,onTopOfStack:y,reload:h,setOpen:g,shouldRender:w})})]})})})});jo.displayName="Modal";const Ms=({href:r,method:e="get",data:t={},as:n="a",headers:o={},queryStringArrayFormat:a="brackets",onAfterLeave:l=null,onBlur:u=null,onClose:i=null,onError:d=null,onFocus:s=null,onStart:b=null,onSuccess:v=null,navigate:E=null,children:p,...m})=>{const[y,h]=f.useState(!1),[g,w]=f.useState(null),{stack:x,visit:P}=mr(),D=f.useMemo(()=>E??Ar("navigate"),[E]),_={},U={};Object.keys(m).forEach(T=>{Qn.includes(T)||(T.startsWith("on")&&typeof m[T]=="function"?T.toLowerCase()in window?_[T]=m[T]:U[T]=m[T]:_[T]=m[T])});const[H,j]=f.useState(!1);f.useEffect(()=>{g&&(g.onTopOfStack&&H?s==null||s():!g.onTopOfStack&&!H&&(u==null||u()),j(!g.onTopOfStack))},[x]);const z=f.useCallback(()=>{i==null||i()},[i]),V=f.useCallback(()=>{w(null),l==null||l()},[l]),C=f.useCallback(T=>{T==null||T.preventDefault(),!y&&(r.startsWith("#")||(h(!0),b==null||b()),P(r,e,t,o,ua(rn(m,Qn)),()=>z(x.length),V,a,D).then(k=>{w(k),k.registerEventListenersFromProps(U),v==null||v()}).catch(k=>{console.error(k),d==null||d(k)}).finally(()=>h(!1)))},[r,e,t,o,a,m,z,V]);return $.jsx(n,{..._,href:r,onClick:C,children:typeof p=="function"?p({loading:y}):p})};function Is(){return mr().stack[Ft()]??null}L.HeadlessModal=Mt,L.Modal=jo,L.ModalLink=Ms,L.ModalRoot=Zn,L.ModalStackProvider=Jn,L.getConfig=Ar,L.putConfig=ta,L.renderApp=Rl,L.resetConfig=ra,L.useModal=Is,L.useModalIndex=Ft,L.useModalStack=mr,Object.defineProperty(L,Symbol.toStringTag,{value:"Module"})});
|