@arudovwen/form-builder-react 1.0.1 → 1.0.2
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/form-builder.es.js +8439 -5834
- package/dist/form-builder.umd.js +29 -19
- package/dist/place.png +0 -0
- package/package.json +9 -3
package/dist/form-builder.umd.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(Nt,h){typeof exports=="object"&&typeof module<"u"?h(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],h):(Nt=typeof globalThis<"u"?globalThis:Nt||self,h(Nt.FormBuilder={},Nt.React,Nt.ReactDOM))})(this,function(Nt,h,St){"use strict";function Jo(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const F=Jo(h),$r=Jo(St);function Tf(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var jr={exports:{}},Un={};/**
|
|
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 Yo;function _f(){if(Yo)return Un;Yo=1;var e=h,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,i=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function o(a,l,u){var c,f={},m=null,p=null;u!==void 0&&(m=""+u),l.key!==void 0&&(m=""+l.key),l.ref!==void 0&&(p=l.ref);for(c in l)r.call(l,c)&&!s.hasOwnProperty(c)&&(f[c]=l[c]);if(a&&a.defaultProps)for(c in l=a.defaultProps,l)f[c]===void 0&&(f[c]=l[c]);return{$$typeof:t,type:a,key:m,ref:p,props:f,_owner:i.current}}return Un.Fragment=n,Un.jsx=o,Un.jsxs=o,Un}var Hn={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.development.js
|
|
12
12
|
*
|
|
@@ -14,21 +14,21 @@
|
|
|
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
|
-
|
|
19
|
-
`),
|
|
20
|
-
`),
|
|
21
|
-
`+
|
|
17
|
+
*/var Go;function Cf(){return Go||(Go=1,process.env.NODE_ENV!=="production"&&function(){var e=h,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),a=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),c=Symbol.for("react.suspense_list"),f=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),p=Symbol.for("react.offscreen"),d=Symbol.iterator,g="@@iterator";function v(E){if(E===null||typeof E!="object")return null;var D=d&&E[d]||E[g];return typeof D=="function"?D:null}var b=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function x(E){{for(var D=arguments.length,q=new Array(D>1?D-1:0),Q=1;Q<D;Q++)q[Q-1]=arguments[Q];w("error",E,q)}}function w(E,D,q){{var Q=b.ReactDebugCurrentFrame,le=Q.getStackAddendum();le!==""&&(D+="%s",q=q.concat([le]));var fe=q.map(function(se){return String(se)});fe.unshift("Warning: "+D),Function.prototype.apply.call(console[E],console,fe)}}var T=!1,C=!1,_=!1,O=!1,A=!1,N;N=Symbol.for("react.module.reference");function L(E){return!!(typeof E=="string"||typeof E=="function"||E===r||E===s||A||E===i||E===u||E===c||O||E===p||T||C||_||typeof E=="object"&&E!==null&&(E.$$typeof===m||E.$$typeof===f||E.$$typeof===o||E.$$typeof===a||E.$$typeof===l||E.$$typeof===N||E.getModuleId!==void 0))}function P(E,D,q){var Q=E.displayName;if(Q)return Q;var le=D.displayName||D.name||"";return le!==""?q+"("+le+")":q}function I(E){return E.displayName||"Context"}function R(E){if(E==null)return null;if(typeof E.tag=="number"&&x("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof E=="function")return E.displayName||E.name||null;if(typeof E=="string")return E;switch(E){case r:return"Fragment";case n:return"Portal";case s:return"Profiler";case i:return"StrictMode";case u:return"Suspense";case c:return"SuspenseList"}if(typeof E=="object")switch(E.$$typeof){case a:var D=E;return I(D)+".Consumer";case o:var q=E;return I(q._context)+".Provider";case l:return P(E,E.render,"ForwardRef");case f:var Q=E.displayName||null;return Q!==null?Q:R(E.type)||"Memo";case m:{var le=E,fe=le._payload,se=le._init;try{return R(se(fe))}catch{return null}}}return null}var z=Object.assign,Y=0,H,X,K,Z,ne,Ae,Pe;function W(){}W.__reactDisabledLog=!0;function ve(){{if(Y===0){H=console.log,X=console.info,K=console.warn,Z=console.error,ne=console.group,Ae=console.groupCollapsed,Pe=console.groupEnd;var E={configurable:!0,enumerable:!0,value:W,writable:!0};Object.defineProperties(console,{info:E,log:E,warn:E,error:E,group:E,groupCollapsed:E,groupEnd:E})}Y++}}function Se(){{if(Y--,Y===0){var E={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:z({},E,{value:H}),info:z({},E,{value:X}),warn:z({},E,{value:K}),error:z({},E,{value:Z}),group:z({},E,{value:ne}),groupCollapsed:z({},E,{value:Ae}),groupEnd:z({},E,{value:Pe})})}Y<0&&x("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var ae=b.ReactCurrentDispatcher,$e;function Te(E,D,q){{if($e===void 0)try{throw Error()}catch(le){var Q=le.stack.trim().match(/\n( *(at )?)/);$e=Q&&Q[1]||""}return`
|
|
18
|
+
`+$e+E}}var Le=!1,xt;{var _e=typeof WeakMap=="function"?WeakMap:Map;xt=new _e}function ie(E,D){if(!E||Le)return"";{var q=xt.get(E);if(q!==void 0)return q}var Q;Le=!0;var le=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var fe;fe=ae.current,ae.current=null,ve();try{if(D){var se=function(){throw Error()};if(Object.defineProperty(se.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(se,[])}catch(rt){Q=rt}Reflect.construct(E,[],se)}else{try{se.call()}catch(rt){Q=rt}E.call(se.prototype)}}else{try{throw Error()}catch(rt){Q=rt}E()}}catch(rt){if(rt&&Q&&typeof rt.stack=="string"){for(var re=rt.stack.split(`
|
|
19
|
+
`),Xe=Q.stack.split(`
|
|
20
|
+
`),Ce=re.length-1,ke=Xe.length-1;Ce>=1&&ke>=0&&re[Ce]!==Xe[ke];)ke--;for(;Ce>=1&&ke>=0;Ce--,ke--)if(re[Ce]!==Xe[ke]){if(Ce!==1||ke!==1)do if(Ce--,ke--,ke<0||re[Ce]!==Xe[ke]){var pt=`
|
|
21
|
+
`+re[Ce].replace(" at new "," at ");return E.displayName&&pt.includes("<anonymous>")&&(pt=pt.replace("<anonymous>",E.displayName)),typeof E=="function"&&xt.set(E,pt),pt}while(Ce>=1&&ke>=0);break}}}finally{Le=!1,ae.current=fe,Se(),Error.prepareStackTrace=le}var Bn=E?E.displayName||E.name:"",Cn=Bn?Te(Bn):"";return typeof E=="function"&&xt.set(E,Cn),Cn}function he(E,D,q){return ie(E,!1)}function je(E){var D=E.prototype;return!!(D&&D.isReactComponent)}function Ht(E,D,q){if(E==null)return"";if(typeof E=="function")return ie(E,je(E));if(typeof E=="string")return Te(E);switch(E){case u:return Te("Suspense");case c:return Te("SuspenseList")}if(typeof E=="object")switch(E.$$typeof){case l:return he(E.render);case f:return Ht(E.type,D,q);case m:{var Q=E,le=Q._payload,fe=Q._init;try{return Ht(fe(le),D,q)}catch{}}}return""}var qt=Object.prototype.hasOwnProperty,En={},S=b.ReactDebugCurrentFrame;function k(E){if(E){var D=E._owner,q=Ht(E.type,E._source,D?D.type:null);S.setExtraStackFrame(q)}else S.setExtraStackFrame(null)}function j(E,D,q,Q,le){{var fe=Function.call.bind(qt);for(var se in E)if(fe(E,se)){var re=void 0;try{if(typeof E[se]!="function"){var Xe=Error((Q||"React class")+": "+q+" type `"+se+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof E[se]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw Xe.name="Invariant Violation",Xe}re=E[se](D,se,Q,q,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(Ce){re=Ce}re&&!(re instanceof Error)&&(k(le),x("%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).",Q||"React class",q,se,typeof re),k(null)),re instanceof Error&&!(re.message in En)&&(En[re.message]=!0,k(le),x("Failed %s type: %s",q,re.message),k(null))}}}var B=Array.isArray;function V(E){return B(E)}function M(E){{var D=typeof Symbol=="function"&&Symbol.toStringTag,q=D&&E[Symbol.toStringTag]||E.constructor.name||"Object";return q}}function J(E){try{return G(E),!1}catch{return!0}}function G(E){return""+E}function ge(E){if(J(E))return x("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",M(E)),G(E)}var pe=b.ReactCurrentOwner,wt={key:!0,ref:!0,__self:!0,__source:!0},Vn,en,zt;zt={};function kr(E){if(qt.call(E,"ref")){var D=Object.getOwnPropertyDescriptor(E,"ref").get;if(D&&D.isReactWarning)return!1}return E.ref!==void 0}function Sn(E){if(qt.call(E,"key")){var D=Object.getOwnPropertyDescriptor(E,"key").get;if(D&&D.isReactWarning)return!1}return E.key!==void 0}function Fr(E,D){if(typeof E.ref=="string"&&pe.current&&D&&pe.current.stateNode!==D){var q=R(pe.current.type);zt[q]||(x('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',R(pe.current.type),E.ref),zt[q]=!0)}}function ye(E,D){{var q=function(){Vn||(Vn=!0,x("%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)",D))};q.isReactWarning=!0,Object.defineProperty(E,"key",{get:q,configurable:!0})}}function ze(E,D){{var q=function(){en||(en=!0,x("%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)",D))};q.isReactWarning=!0,Object.defineProperty(E,"ref",{get:q,configurable:!0})}}var Re=function(E,D,q,Q,le,fe,se){var re={$$typeof:t,type:E,key:D,ref:q,props:se,_owner:fe};return re._store={},Object.defineProperty(re._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(re,"_self",{configurable:!1,enumerable:!1,writable:!1,value:Q}),Object.defineProperty(re,"_source",{configurable:!1,enumerable:!1,writable:!1,value:le}),Object.freeze&&(Object.freeze(re.props),Object.freeze(re)),re};function We(E,D,q,Q,le){{var fe,se={},re=null,Xe=null;q!==void 0&&(ge(q),re=""+q),Sn(D)&&(ge(D.key),re=""+D.key),kr(D)&&(Xe=D.ref,Fr(D,le));for(fe in D)qt.call(D,fe)&&!wt.hasOwnProperty(fe)&&(se[fe]=D[fe]);if(E&&E.defaultProps){var Ce=E.defaultProps;for(fe in Ce)se[fe]===void 0&&(se[fe]=Ce[fe])}if(re||Xe){var ke=typeof E=="function"?E.displayName||E.name||"Unknown":E;re&&ye(se,ke),Xe&&ze(se,ke)}return Re(E,re,Xe,le,Q,pe.current,se)}}var Ve=b.ReactCurrentOwner,Ge=b.ReactDebugCurrentFrame;function Et(E){if(E){var D=E._owner,q=Ht(E.type,E._source,D?D.type:null);Ge.setExtraStackFrame(q)}else Ge.setExtraStackFrame(null)}var Ar;Ar=!1;function Tn(E){return typeof E=="object"&&E!==null&&E.$$typeof===t}function _n(){{if(Ve.current){var E=R(Ve.current.type);if(E)return`
|
|
22
22
|
|
|
23
|
-
Check the render method of \``+E+"`."}return""}}function
|
|
23
|
+
Check the render method of \``+E+"`."}return""}}function Wo(E){return""}var vf={};function Kx(E){{var D=_n();if(!D){var q=typeof E=="string"?E:E.displayName||E.name;q&&(D=`
|
|
24
24
|
|
|
25
|
-
Check the top-level render call using <`+
|
|
25
|
+
Check the top-level render call using <`+q+">.")}return D}}function xf(E,D){{if(!E._store||E._store.validated||E.key!=null)return;E._store.validated=!0;var q=Kx(D);if(vf[q])return;vf[q]=!0;var Q="";E&&E._owner&&E._owner!==Ve.current&&(Q=" It was passed a child from "+R(E._owner.type)+"."),Et(E),x('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',q,Q),Et(null)}}function wf(E,D){{if(typeof E!="object")return;if(V(E))for(var q=0;q<E.length;q++){var Q=E[q];Tn(Q)&&xf(Q,D)}else if(Tn(E))E._store&&(E._store.validated=!0);else if(E){var le=v(E);if(typeof le=="function"&&le!==E.entries)for(var fe=le.call(E),se;!(se=fe.next()).done;)Tn(se.value)&&xf(se.value,D)}}}function Jx(E){{var D=E.type;if(D==null||typeof D=="string")return;var q;if(typeof D=="function")q=D.propTypes;else if(typeof D=="object"&&(D.$$typeof===l||D.$$typeof===f))q=D.propTypes;else return;if(q){var Q=R(D);j(q,E.props,"prop",Q,E)}else if(D.PropTypes!==void 0&&!Ar){Ar=!0;var le=R(D);x("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",le||"Unknown")}typeof D.getDefaultProps=="function"&&!D.getDefaultProps.isReactClassApproved&&x("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Yx(E){{for(var D=Object.keys(E.props),q=0;q<D.length;q++){var Q=D[q];if(Q!=="children"&&Q!=="key"){Et(E),x("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",Q),Et(null);break}}E.ref!==null&&(Et(E),x("Invalid attribute `ref` supplied to `React.Fragment`."),Et(null))}}var Ef={};function Sf(E,D,q,Q,le,fe){{var se=L(E);if(!se){var re="";(E===void 0||typeof E=="object"&&E!==null&&Object.keys(E).length===0)&&(re+=" 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 Xe=Wo();Xe?re+=Xe:re+=_n();var Ce;E===null?Ce="null":V(E)?Ce="array":E!==void 0&&E.$$typeof===t?(Ce="<"+(R(E.type)||"Unknown")+" />",re=" Did you accidentally export a JSX literal instead of a component?"):Ce=typeof E,x("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",Ce,re)}var ke=We(E,D,q,le,fe);if(ke==null)return ke;if(se){var pt=D.children;if(pt!==void 0)if(Q)if(V(pt)){for(var Bn=0;Bn<pt.length;Bn++)wf(pt[Bn],E);Object.freeze&&Object.freeze(pt)}else x("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 wf(pt,E)}if(qt.call(D,"key")){var Cn=R(E),rt=Object.keys(D).filter(function(tw){return tw!=="key"}),Ko=rt.length>0?"{key: someKey, "+rt.join(": ..., ")+": ...}":"{key: someKey}";if(!Ef[Cn+Ko]){var ew=rt.length>0?"{"+rt.join(": ..., ")+": ...}":"{}";x(`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} />`,ns,hn,Rv,hn),Uu[hn+ns]=!0}}return E===r?jv(Se):Pv(Se),Se}}function Nv(E,P,U){return Hu(E,P,U,!0)}function Iv(E,P,U){return Hu(E,P,U,!1)}var Mv=Iv,Vv=Nv;kn.Fragment=r,kn.jsx=Mv,kn.jsxs=Vv}()),kn}var ss;function Ku(){return ss||(ss=1,process.env.NODE_ENV==="production"?pr.exports=zu():pr.exports=Wu()),pr.exports}var w=Ku();function as(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=as(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function rt(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=as(e))&&(r&&(r+=" "),r+=t);return r}function Yu(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.firstChild?t.insertBefore(n,t.firstChild):t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}Yu(`:root{--toastify-color-light: #fff;--toastify-color-dark: #121212;--toastify-color-info: #3498db;--toastify-color-success: #07bc0c;--toastify-color-warning: #f1c40f;--toastify-color-error: hsl(6, 78%, 57%);--toastify-color-transparent: rgba(255, 255, 255, .7);--toastify-icon-color-info: var(--toastify-color-info);--toastify-icon-color-success: var(--toastify-color-success);--toastify-icon-color-warning: var(--toastify-color-warning);--toastify-icon-color-error: var(--toastify-color-error);--toastify-container-width: fit-content;--toastify-toast-width: 320px;--toastify-toast-offset: 16px;--toastify-toast-top: max(var(--toastify-toast-offset), env(safe-area-inset-top));--toastify-toast-right: max(var(--toastify-toast-offset), env(safe-area-inset-right));--toastify-toast-left: max(var(--toastify-toast-offset), env(safe-area-inset-left));--toastify-toast-bottom: max(var(--toastify-toast-offset), env(safe-area-inset-bottom));--toastify-toast-background: #fff;--toastify-toast-padding: 14px;--toastify-toast-min-height: 64px;--toastify-toast-max-height: 800px;--toastify-toast-bd-radius: 6px;--toastify-toast-shadow: 0px 4px 12px rgba(0, 0, 0, .1);--toastify-font-family: sans-serif;--toastify-z-index: 9999;--toastify-text-color-light: #757575;--toastify-text-color-dark: #fff;--toastify-text-color-info: #fff;--toastify-text-color-success: #fff;--toastify-text-color-warning: #fff;--toastify-text-color-error: #fff;--toastify-spinner-color: #616161;--toastify-spinner-color-empty-area: #e0e0e0;--toastify-color-progress-light: linear-gradient(to right, #4cd964, #5ac8fa, #007aff, #34aadc, #5856d6, #ff2d55);--toastify-color-progress-dark: #bb86fc;--toastify-color-progress-info: var(--toastify-color-info);--toastify-color-progress-success: var(--toastify-color-success);--toastify-color-progress-warning: var(--toastify-color-warning);--toastify-color-progress-error: var(--toastify-color-error);--toastify-color-progress-bgo: .2}.Toastify__toast-container{z-index:var(--toastify-z-index);-webkit-transform:translate3d(0,0,var(--toastify-z-index));position:fixed;width:var(--toastify-container-width);box-sizing:border-box;color:#fff;display:flex;flex-direction:column}.Toastify__toast-container--top-left{top:var(--toastify-toast-top);left:var(--toastify-toast-left)}.Toastify__toast-container--top-center{top:var(--toastify-toast-top);left:50%;transform:translate(-50%);align-items:center}.Toastify__toast-container--top-right{top:var(--toastify-toast-top);right:var(--toastify-toast-right);align-items:end}.Toastify__toast-container--bottom-left{bottom:var(--toastify-toast-bottom);left:var(--toastify-toast-left)}.Toastify__toast-container--bottom-center{bottom:var(--toastify-toast-bottom);left:50%;transform:translate(-50%);align-items:center}.Toastify__toast-container--bottom-right{bottom:var(--toastify-toast-bottom);right:var(--toastify-toast-right);align-items:end}@media only screen and (max-width: 480px){.Toastify__toast-container{width:100vw;left:env(safe-area-inset-left);margin:0}.Toastify__toast-container--top-left,.Toastify__toast-container--top-center,.Toastify__toast-container--top-right{top:env(safe-area-inset-top);transform:translate(0)}.Toastify__toast-container--bottom-left,.Toastify__toast-container--bottom-center,.Toastify__toast-container--bottom-right{bottom:env(safe-area-inset-bottom);transform:translate(0)}.Toastify__toast-container--rtl{right:env(safe-area-inset-right);left:initial}.Toastify__toast{--toastify-toast-width: 100%;margin-bottom:0;border-radius:0}}.Toastify__toast{--y: 0;position:relative;touch-action:none;width:var(--toastify-toast-width);min-height:var(--toastify-toast-min-height);box-sizing:border-box;margin-bottom:1rem;padding:var(--toastify-toast-padding);border-radius:var(--toastify-toast-bd-radius);box-shadow:var(--toastify-toast-shadow);max-height:var(--toastify-toast-max-height);font-family:var(--toastify-font-family);z-index:0;display:flex;flex:1 auto;align-items:center;word-break:break-word}.Toastify__toast-container[data-stacked=true]{width:var(--toastify-toast-width)}.Toastify__toast--stacked{position:absolute;width:100%;transform:translate3d(0,var(--y),0) scale(var(--s));transition:transform .3s}.Toastify__toast--stacked[data-collapsed] .Toastify__toast-body,.Toastify__toast--stacked[data-collapsed] .Toastify__close-button{transition:opacity .1s}.Toastify__toast--stacked[data-collapsed=false]{overflow:visible}.Toastify__toast--stacked[data-collapsed=true]:not(:last-child)>*{opacity:0}.Toastify__toast--stacked:after{content:"";position:absolute;left:0;right:0;height:calc(var(--g) * 1px);bottom:100%}.Toastify__toast--stacked[data-pos=top]{top:0}.Toastify__toast--stacked[data-pos=bot]{bottom:0}.Toastify__toast--stacked[data-pos=bot].Toastify__toast--stacked:before{transform-origin:top}.Toastify__toast--stacked[data-pos=top].Toastify__toast--stacked:before{transform-origin:bottom}.Toastify__toast--stacked:before{content:"";position:absolute;left:0;right:0;bottom:0;height:100%;transform:scaleY(3);z-index:-1}.Toastify__toast--rtl{direction:rtl}.Toastify__toast--close-on-click{cursor:pointer}.Toastify__toast-icon{margin-inline-end:10px;width:22px;flex-shrink:0;display:flex}.Toastify--animate{animation-fill-mode:both;animation-duration:.5s}.Toastify--animate-icon{animation-fill-mode:both;animation-duration:.3s}.Toastify__toast-theme--dark{background:var(--toastify-color-dark);color:var(--toastify-text-color-dark)}.Toastify__toast-theme--light,.Toastify__toast-theme--colored.Toastify__toast--default{background:var(--toastify-color-light);color:var(--toastify-text-color-light)}.Toastify__toast-theme--colored.Toastify__toast--info{color:var(--toastify-text-color-info);background:var(--toastify-color-info)}.Toastify__toast-theme--colored.Toastify__toast--success{color:var(--toastify-text-color-success);background:var(--toastify-color-success)}.Toastify__toast-theme--colored.Toastify__toast--warning{color:var(--toastify-text-color-warning);background:var(--toastify-color-warning)}.Toastify__toast-theme--colored.Toastify__toast--error{color:var(--toastify-text-color-error);background:var(--toastify-color-error)}.Toastify__progress-bar-theme--light{background:var(--toastify-color-progress-light)}.Toastify__progress-bar-theme--dark{background:var(--toastify-color-progress-dark)}.Toastify__progress-bar--info{background:var(--toastify-color-progress-info)}.Toastify__progress-bar--success{background:var(--toastify-color-progress-success)}.Toastify__progress-bar--warning{background:var(--toastify-color-progress-warning)}.Toastify__progress-bar--error{background:var(--toastify-color-progress-error)}.Toastify__progress-bar-theme--colored.Toastify__progress-bar--info,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--success,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--warning,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--error{background:var(--toastify-color-transparent)}.Toastify__close-button{color:#fff;position:absolute;top:6px;right:6px;background:transparent;outline:none;border:none;padding:0;cursor:pointer;opacity:.7;transition:.3s ease;z-index:1}.Toastify__toast--rtl .Toastify__close-button{left:6px;right:unset}.Toastify__close-button--light{color:#000;opacity:.3}.Toastify__close-button>svg{fill:currentColor;height:16px;width:14px}.Toastify__close-button:hover,.Toastify__close-button:focus{opacity:1}@keyframes Toastify__trackProgress{0%{transform:scaleX(1)}to{transform:scaleX(0)}}.Toastify__progress-bar{position:absolute;bottom:0;left:0;width:100%;height:100%;z-index:1;opacity:.7;transform-origin:left}.Toastify__progress-bar--animated{animation:Toastify__trackProgress linear 1 forwards}.Toastify__progress-bar--controlled{transition:transform .2s}.Toastify__progress-bar--rtl{right:0;left:initial;transform-origin:right;border-bottom-left-radius:initial}.Toastify__progress-bar--wrp{position:absolute;overflow:hidden;bottom:0;left:0;width:100%;height:5px;border-bottom-left-radius:var(--toastify-toast-bd-radius);border-bottom-right-radius:var(--toastify-toast-bd-radius)}.Toastify__progress-bar--wrp[data-hidden=true]{opacity:0}.Toastify__progress-bar--bg{opacity:var(--toastify-color-progress-bgo);width:100%;height:100%}.Toastify__spinner{width:20px;height:20px;box-sizing:border-box;border:2px solid;border-radius:100%;border-color:var(--toastify-spinner-color-empty-area);border-right-color:var(--toastify-spinner-color);animation:Toastify__spin .65s linear infinite}@keyframes Toastify__bounceInRight{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(3000px,0,0)}60%{opacity:1;transform:translate3d(-25px,0,0)}75%{transform:translate3d(10px,0,0)}90%{transform:translate3d(-5px,0,0)}to{transform:none}}@keyframes Toastify__bounceOutRight{20%{opacity:1;transform:translate3d(-20px,var(--y),0)}to{opacity:0;transform:translate3d(2000px,var(--y),0)}}@keyframes Toastify__bounceInLeft{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(-3000px,0,0)}60%{opacity:1;transform:translate3d(25px,0,0)}75%{transform:translate3d(-10px,0,0)}90%{transform:translate3d(5px,0,0)}to{transform:none}}@keyframes Toastify__bounceOutLeft{20%{opacity:1;transform:translate3d(20px,var(--y),0)}to{opacity:0;transform:translate3d(-2000px,var(--y),0)}}@keyframes Toastify__bounceInUp{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(0,3000px,0)}60%{opacity:1;transform:translate3d(0,-20px,0)}75%{transform:translate3d(0,10px,0)}90%{transform:translate3d(0,-5px,0)}to{transform:translateZ(0)}}@keyframes Toastify__bounceOutUp{20%{transform:translate3d(0,calc(var(--y) - 10px),0)}40%,45%{opacity:1;transform:translate3d(0,calc(var(--y) + 20px),0)}to{opacity:0;transform:translate3d(0,-2000px,0)}}@keyframes Toastify__bounceInDown{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(0,-3000px,0)}60%{opacity:1;transform:translate3d(0,25px,0)}75%{transform:translate3d(0,-10px,0)}90%{transform:translate3d(0,5px,0)}to{transform:none}}@keyframes Toastify__bounceOutDown{20%{transform:translate3d(0,calc(var(--y) - 10px),0)}40%,45%{opacity:1;transform:translate3d(0,calc(var(--y) + 20px),0)}to{opacity:0;transform:translate3d(0,2000px,0)}}.Toastify__bounce-enter--top-left,.Toastify__bounce-enter--bottom-left{animation-name:Toastify__bounceInLeft}.Toastify__bounce-enter--top-right,.Toastify__bounce-enter--bottom-right{animation-name:Toastify__bounceInRight}.Toastify__bounce-enter--top-center{animation-name:Toastify__bounceInDown}.Toastify__bounce-enter--bottom-center{animation-name:Toastify__bounceInUp}.Toastify__bounce-exit--top-left,.Toastify__bounce-exit--bottom-left{animation-name:Toastify__bounceOutLeft}.Toastify__bounce-exit--top-right,.Toastify__bounce-exit--bottom-right{animation-name:Toastify__bounceOutRight}.Toastify__bounce-exit--top-center{animation-name:Toastify__bounceOutUp}.Toastify__bounce-exit--bottom-center{animation-name:Toastify__bounceOutDown}@keyframes Toastify__zoomIn{0%{opacity:0;transform:scale3d(.3,.3,.3)}50%{opacity:1}}@keyframes Toastify__zoomOut{0%{opacity:1}50%{opacity:0;transform:translate3d(0,var(--y),0) scale3d(.3,.3,.3)}to{opacity:0}}.Toastify__zoom-enter{animation-name:Toastify__zoomIn}.Toastify__zoom-exit{animation-name:Toastify__zoomOut}@keyframes Toastify__flipIn{0%{transform:perspective(400px) rotateX(90deg);animation-timing-function:ease-in;opacity:0}40%{transform:perspective(400px) rotateX(-20deg);animation-timing-function:ease-in}60%{transform:perspective(400px) rotateX(10deg);opacity:1}80%{transform:perspective(400px) rotateX(-5deg)}to{transform:perspective(400px)}}@keyframes Toastify__flipOut{0%{transform:translate3d(0,var(--y),0) perspective(400px)}30%{transform:translate3d(0,var(--y),0) perspective(400px) rotateX(-20deg);opacity:1}to{transform:translate3d(0,var(--y),0) perspective(400px) rotateX(90deg);opacity:0}}.Toastify__flip-enter{animation-name:Toastify__flipIn}.Toastify__flip-exit{animation-name:Toastify__flipOut}@keyframes Toastify__slideInRight{0%{transform:translate3d(110%,0,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInLeft{0%{transform:translate3d(-110%,0,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInUp{0%{transform:translate3d(0,110%,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInDown{0%{transform:translate3d(0,-110%,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideOutRight{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(110%,var(--y),0)}}@keyframes Toastify__slideOutLeft{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(-110%,var(--y),0)}}@keyframes Toastify__slideOutDown{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(0,500px,0)}}@keyframes Toastify__slideOutUp{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(0,-500px,0)}}.Toastify__slide-enter--top-left,.Toastify__slide-enter--bottom-left{animation-name:Toastify__slideInLeft}.Toastify__slide-enter--top-right,.Toastify__slide-enter--bottom-right{animation-name:Toastify__slideInRight}.Toastify__slide-enter--top-center{animation-name:Toastify__slideInDown}.Toastify__slide-enter--bottom-center{animation-name:Toastify__slideInUp}.Toastify__slide-exit--top-left,.Toastify__slide-exit--bottom-left{animation-name:Toastify__slideOutLeft;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--top-right,.Toastify__slide-exit--bottom-right{animation-name:Toastify__slideOutRight;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--top-center{animation-name:Toastify__slideOutUp;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--bottom-center{animation-name:Toastify__slideOutDown;animation-timing-function:ease-in;animation-duration:.3s}@keyframes Toastify__spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}
|
|
31
|
-
`);var $n=e=>typeof e=="number"&&!isNaN(e),Wt=e=>typeof e=="string",_t=e=>typeof e=="function",Gu=e=>Wt(e)||$n(e),ci=e=>Wt(e)||_t(e)?e:null,Xu=(e,t)=>e===!1||$n(e)&&e>0?e:t,fi=e=>h.isValidElement(e)||Wt(e)||_t(e)||$n(e);function Ju(e,t,n=300){let{scrollHeight:r,style:i}=e;requestAnimationFrame(()=>{i.minHeight="initial",i.height=r+"px",i.transition=`all ${n}ms`,requestAnimationFrame(()=>{i.height="0",i.padding="0",i.margin="0",setTimeout(t,n)})})}function Qu({enter:e,exit:t,appendPosition:n=!1,collapse:r=!0,collapseDuration:i=300}){return function({children:o,position:s,preventExitTransition:l,done:a,nodeRef:u,isIn:c,playToast:f}){let m=n?`${e}--${s}`:e,d=n?`${t}--${s}`:t,p=h.useRef(0);return h.useLayoutEffect(()=>{let v=u.current,b=m.split(" "),g=y=>{y.target===u.current&&(f(),v.removeEventListener("animationend",g),v.removeEventListener("animationcancel",g),p.current===0&&y.type!=="animationcancel"&&v.classList.remove(...b))};v.classList.add(...b),v.addEventListener("animationend",g),v.addEventListener("animationcancel",g)},[]),h.useEffect(()=>{let v=u.current,b=()=>{v.removeEventListener("animationend",b),r?Ju(v,a,i):a()};c||(l?b():(p.current=1,v.className+=` ${d}`,v.addEventListener("animationend",b)))},[c]),h.createElement(h.Fragment,null,o)}}function ls(e,t){return{content:us(e.content,e.props),containerId:e.props.containerId,id:e.props.toastId,theme:e.props.theme,type:e.props.type,data:e.props.data||{},isLoading:e.props.isLoading,icon:e.props.icon,reason:e.removalReason,status:t}}function us(e,t,n=!1){return h.isValidElement(e)&&!Wt(e.type)?h.cloneElement(e,{closeToast:t.closeToast,toastProps:t,data:t.data,isPaused:n}):_t(e)?e({closeToast:t.closeToast,toastProps:t,data:t.data,isPaused:n}):e}function Zu({closeToast:e,theme:t,ariaLabel:n="close"}){return h.createElement("button",{className:`Toastify__close-button Toastify__close-button--${t}`,type:"button",onClick:r=>{r.stopPropagation(),e(!0)},"aria-label":n},h.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},h.createElement("path",{fillRule:"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"})))}function ec({delay:e,isRunning:t,closeToast:n,type:r="default",hide:i,className:o,controlledProgress:s,progress:l,rtl:a,isIn:u,theme:c}){let f=i||s&&l===0,m={animationDuration:`${e}ms`,animationPlayState:t?"running":"paused"};s&&(m.transform=`scaleX(${l})`);let d=rt("Toastify__progress-bar",s?"Toastify__progress-bar--controlled":"Toastify__progress-bar--animated",`Toastify__progress-bar-theme--${c}`,`Toastify__progress-bar--${r}`,{"Toastify__progress-bar--rtl":a}),p=_t(o)?o({rtl:a,type:r,defaultClassName:d}):rt(d,o),v={[s&&l>=1?"onTransitionEnd":"onAnimationEnd"]:s&&l<1?null:()=>{u&&n()}};return h.createElement("div",{className:"Toastify__progress-bar--wrp","data-hidden":f},h.createElement("div",{className:`Toastify__progress-bar--bg Toastify__progress-bar-theme--${c} Toastify__progress-bar--${r}`}),h.createElement("div",{role:"progressbar","aria-hidden":f?"true":"false","aria-label":"notification timer",className:p,style:m,...v}))}var tc=1,cs=()=>`${tc++}`;function nc(e,t,n){let r=1,i=0,o=[],s=[],l=t,a=new Map,u=new Set,c=y=>(u.add(y),()=>u.delete(y)),f=()=>{s=Array.from(a.values()),u.forEach(y=>y())},m=({containerId:y,toastId:x,updateId:_})=>{let $=y?y!==e:e!==1,S=a.has(x)&&_==null;return $||S},d=(y,x)=>{a.forEach(_=>{var $;(x==null||x===_.props.toastId)&&(($=_.toggle)==null||$.call(_,y))})},p=y=>{var x,_;(_=(x=y.props)==null?void 0:x.onClose)==null||_.call(x,y.removalReason),y.isActive=!1},v=y=>{if(y==null)a.forEach(p);else{let x=a.get(y);x&&p(x)}f()},b=()=>{i-=o.length,o=[]},g=y=>{var x,_;let{toastId:$,updateId:S}=y.props,C=S==null;y.staleId&&a.delete(y.staleId),y.isActive=!0,a.set($,y),f(),n(ls(y,C?"added":"updated")),C&&((_=(x=y.props).onOpen)==null||_.call(x))};return{id:e,props:l,observe:c,toggle:d,removeToast:v,toasts:a,clearQueue:b,buildToast:(y,x)=>{if(m(x))return;let{toastId:_,updateId:$,data:S,staleId:C,delay:A}=x,L=$==null;L&&i++;let j={...l,style:l.toastStyle,key:r++,...Object.fromEntries(Object.entries(x).filter(([I,V])=>V!=null)),toastId:_,updateId:$,data:S,isIn:!1,className:ci(x.className||l.toastClassName),progressClassName:ci(x.progressClassName||l.progressClassName),autoClose:x.isLoading?!1:Xu(x.autoClose,l.autoClose),closeToast(I){a.get(_).removalReason=I,v(_)},deleteToast(){let I=a.get(_);if(I!=null){if(n(ls(I,"removed")),a.delete(_),i--,i<0&&(i=0),o.length>0){g(o.shift());return}f()}}};j.closeButton=l.closeButton,x.closeButton===!1||fi(x.closeButton)?j.closeButton=x.closeButton:x.closeButton===!0&&(j.closeButton=fi(l.closeButton)?l.closeButton:!0);let D={content:y,props:j,staleId:C};l.limit&&l.limit>0&&i>l.limit&&L?o.push(D):$n(A)?setTimeout(()=>{g(D)},A):g(D)},setProps(y){l=y},setToggle:(y,x)=>{let _=a.get(y);_&&(_.toggle=x)},isToastActive:y=>{var x;return(x=a.get(y))==null?void 0:x.isActive},getSnapshot:()=>s}}var Ue=new Map,On=[],di=new Set,rc=e=>di.forEach(t=>t(e)),fs=()=>Ue.size>0;function ic(){On.forEach(e=>ps(e.content,e.options)),On=[]}var oc=(e,{containerId:t})=>{var n;return(n=Ue.get(t||1))==null?void 0:n.toasts.get(e)};function ds(e,t){var n;if(t)return!!((n=Ue.get(t))!=null&&n.isToastActive(e));let r=!1;return Ue.forEach(i=>{i.isToastActive(e)&&(r=!0)}),r}function sc(e){if(!fs()){On=On.filter(t=>e!=null&&t.options.toastId!==e);return}if(e==null||Gu(e))Ue.forEach(t=>{t.removeToast(e)});else if(e&&("containerId"in e||"id"in e)){let t=Ue.get(e.containerId);t?t.removeToast(e.id):Ue.forEach(n=>{n.removeToast(e.id)})}}var ac=(e={})=>{Ue.forEach(t=>{t.props.limit&&(!e.containerId||t.id===e.containerId)&&t.clearQueue()})};function ps(e,t){fi(e)&&(fs()||On.push({content:e,options:t}),Ue.forEach(n=>{n.buildToast(e,t)}))}function lc(e){var t;(t=Ue.get(e.containerId||1))==null||t.setToggle(e.id,e.fn)}function hs(e,t){Ue.forEach(n=>{(t==null||!(t!=null&&t.containerId)||(t==null?void 0:t.containerId)===n.id)&&n.toggle(e,t==null?void 0:t.id)})}function uc(e){let t=e.containerId||1;return{subscribe(n){let r=nc(t,e,rc);Ue.set(t,r);let i=r.observe(n);return ic(),()=>{i(),Ue.delete(t)}},setProps(n){var r;(r=Ue.get(t))==null||r.setProps(n)},getSnapshot(){var n;return(n=Ue.get(t))==null?void 0:n.getSnapshot()}}}function cc(e){return di.add(e),()=>{di.delete(e)}}function fc(e){return e&&(Wt(e.toastId)||$n(e.toastId))?e.toastId:cs()}function An(e,t){return ps(e,t),t.toastId}function hr(e,t){return{...t,type:t&&t.type||e,toastId:fc(t)}}function mr(e){return(t,n)=>An(t,hr(e,n))}function ae(e,t){return An(e,hr("default",t))}ae.loading=(e,t)=>An(e,hr("default",{isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1,...t}));function dc(e,{pending:t,error:n,success:r},i){let o;t&&(o=Wt(t)?ae.loading(t,i):ae.loading(t.render,{...i,...t}));let s={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},l=(u,c,f)=>{if(c==null){ae.dismiss(o);return}let m={type:u,...s,...i,data:f},d=Wt(c)?{render:c}:c;return o?ae.update(o,{...m,...d}):ae(d.render,{...m,...d}),f},a=_t(e)?e():e;return a.then(u=>l("success",r,u)).catch(u=>l("error",n,u)),a}ae.promise=dc,ae.success=mr("success"),ae.info=mr("info"),ae.error=mr("error"),ae.warning=mr("warning"),ae.warn=ae.warning,ae.dark=(e,t)=>An(e,hr("default",{theme:"dark",...t}));function pc(e){sc(e)}ae.dismiss=pc,ae.clearWaitingQueue=ac,ae.isActive=ds,ae.update=(e,t={})=>{let n=oc(e,t);if(n){let{props:r,content:i}=n,o={delay:100,...r,...t,toastId:t.toastId||e,updateId:cs()};o.toastId!==e&&(o.staleId=e);let s=o.render||i;delete o.render,An(s,o)}},ae.done=e=>{ae.update(e,{progress:1})},ae.onChange=cc,ae.play=e=>hs(!0,e),ae.pause=e=>hs(!1,e);function hc(e){var t;let{subscribe:n,getSnapshot:r,setProps:i}=h.useRef(uc(e)).current;i(e);let o=(t=h.useSyncExternalStore(n,r,r))==null?void 0:t.slice();function s(l){if(!o)return[];let a=new Map;return e.newestOnTop&&o.reverse(),o.forEach(u=>{let{position:c}=u.props;a.has(c)||a.set(c,[]),a.get(c).push(u)}),Array.from(a,u=>l(u[0],u[1]))}return{getToastToRender:s,isToastActive:ds,count:o==null?void 0:o.length}}function mc(e){let[t,n]=h.useState(!1),[r,i]=h.useState(!1),o=h.useRef(null),s=h.useRef({start:0,delta:0,removalDistance:0,canCloseOnClick:!0,canDrag:!1,didMove:!1}).current,{autoClose:l,pauseOnHover:a,closeToast:u,onClick:c,closeOnClick:f}=e;lc({id:e.toastId,containerId:e.containerId,fn:n}),h.useEffect(()=>{if(e.pauseOnFocusLoss)return m(),()=>{d()}},[e.pauseOnFocusLoss]);function m(){document.hasFocus()||g(),window.addEventListener("focus",b),window.addEventListener("blur",g)}function d(){window.removeEventListener("focus",b),window.removeEventListener("blur",g)}function p(C){if(e.draggable===!0||e.draggable===C.pointerType){y();let A=o.current;s.canCloseOnClick=!0,s.canDrag=!0,A.style.transition="none",e.draggableDirection==="x"?(s.start=C.clientX,s.removalDistance=A.offsetWidth*(e.draggablePercent/100)):(s.start=C.clientY,s.removalDistance=A.offsetHeight*(e.draggablePercent===80?e.draggablePercent*1.5:e.draggablePercent)/100)}}function v(C){let{top:A,bottom:L,left:j,right:D}=o.current.getBoundingClientRect();C.nativeEvent.type!=="touchend"&&e.pauseOnHover&&C.clientX>=j&&C.clientX<=D&&C.clientY>=A&&C.clientY<=L?g():b()}function b(){n(!0)}function g(){n(!1)}function y(){s.didMove=!1,document.addEventListener("pointermove",_),document.addEventListener("pointerup",$)}function x(){document.removeEventListener("pointermove",_),document.removeEventListener("pointerup",$)}function _(C){let A=o.current;if(s.canDrag&&A){s.didMove=!0,t&&g(),e.draggableDirection==="x"?s.delta=C.clientX-s.start:s.delta=C.clientY-s.start,s.start!==C.clientX&&(s.canCloseOnClick=!1);let L=e.draggableDirection==="x"?`${s.delta}px, var(--y)`:`0, calc(${s.delta}px + var(--y))`;A.style.transform=`translate3d(${L},0)`,A.style.opacity=`${1-Math.abs(s.delta/s.removalDistance)}`}}function $(){x();let C=o.current;if(s.canDrag&&s.didMove&&C){if(s.canDrag=!1,Math.abs(s.delta)>s.removalDistance){i(!0),e.closeToast(!0),e.collapseAll();return}C.style.transition="transform 0.2s, opacity 0.2s",C.style.removeProperty("transform"),C.style.removeProperty("opacity")}}let S={onPointerDown:p,onPointerUp:v};return l&&a&&(S.onMouseEnter=g,e.stacked||(S.onMouseLeave=b)),f&&(S.onClick=C=>{c&&c(C),s.canCloseOnClick&&u(!0)}),{playToast:b,pauseToast:g,isRunning:t,preventExitTransition:r,toastRef:o,eventHandlers:S}}var gc=typeof window<"u"?h.useLayoutEffect:h.useEffect,gr=({theme:e,type:t,isLoading:n,...r})=>h.createElement("svg",{viewBox:"0 0 24 24",width:"100%",height:"100%",fill:e==="colored"?"currentColor":`var(--toastify-icon-color-${t})`,...r});function yc(e){return h.createElement(gr,{...e},h.createElement("path",{d:"M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z"}))}function vc(e){return h.createElement(gr,{...e},h.createElement("path",{d:"M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z"}))}function bc(e){return h.createElement(gr,{...e},h.createElement("path",{d:"M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z"}))}function xc(e){return h.createElement(gr,{...e},h.createElement("path",{d:"M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z"}))}function wc(){return h.createElement("div",{className:"Toastify__spinner"})}var pi={info:vc,warning:yc,success:bc,error:xc,spinner:wc},Ec=e=>e in pi;function Tc({theme:e,type:t,isLoading:n,icon:r}){let i=null,o={theme:e,type:t};return r===!1||(_t(r)?i=r({...o,isLoading:n}):h.isValidElement(r)?i=h.cloneElement(r,o):n?i=pi.spinner():Ec(t)&&(i=pi[t](o))),i}var Sc=e=>{let{isRunning:t,preventExitTransition:n,toastRef:r,eventHandlers:i,playToast:o}=mc(e),{closeButton:s,children:l,autoClose:a,onClick:u,type:c,hideProgressBar:f,closeToast:m,transition:d,position:p,className:v,style:b,progressClassName:g,updateId:y,role:x,progress:_,rtl:$,toastId:S,deleteToast:C,isIn:A,isLoading:L,closeOnClick:j,theme:D,ariaLabel:I}=e,V=rt("Toastify__toast",`Toastify__toast-theme--${D}`,`Toastify__toast--${c}`,{"Toastify__toast--rtl":$},{"Toastify__toast--close-on-click":j}),H=_t(v)?v({rtl:$,position:p,type:c,defaultClassName:V}):rt(V,v),Y=Tc(e),X=!!_||!a,G={closeToast:m,type:c,theme:D},z=null;return s===!1||(_t(s)?z=s(G):h.isValidElement(s)?z=h.cloneElement(s,G):z=Zu(G)),h.createElement(d,{isIn:A,done:C,position:p,preventExitTransition:n,nodeRef:r,playToast:o},h.createElement("div",{id:S,tabIndex:0,onClick:u,"data-in":A,className:H,...i,style:b,ref:r,...A&&{role:x,"aria-label":I}},Y!=null&&h.createElement("div",{className:rt("Toastify__toast-icon",{"Toastify--animate-icon Toastify__zoom-enter":!L})},Y),us(l,e,!t),z,!e.customProgressBar&&h.createElement(ec,{...y&&!X?{key:`p-${y}`}:{},rtl:$,theme:D,delay:a,isRunning:t,isIn:A,closeToast:m,hide:f,type:c,className:g,controlledProgress:X,progress:_||0})))},_c=(e,t=!1)=>({enter:`Toastify--animate Toastify__${e}-enter`,exit:`Toastify--animate Toastify__${e}-exit`,appendPosition:t}),Cc=Qu(_c("bounce",!0)),Fc={position:"top-right",transition:Cc,autoClose:5e3,closeButton:!0,pauseOnHover:!0,pauseOnFocusLoss:!0,draggable:"touch",draggablePercent:80,draggableDirection:"x",role:"alert",theme:"light","aria-label":"Notifications Alt+T",hotKeys:e=>e.altKey&&e.code==="KeyT"};function kc(e){let t={...Fc,...e},n=e.stacked,[r,i]=h.useState(!0),o=h.useRef(null),{getToastToRender:s,isToastActive:l,count:a}=hc(t),{className:u,style:c,rtl:f,containerId:m,hotKeys:d}=t;function p(b){let g=rt("Toastify__toast-container",`Toastify__toast-container--${b}`,{"Toastify__toast-container--rtl":f});return _t(u)?u({position:b,rtl:f,defaultClassName:g}):rt(g,ci(u))}function v(){n&&(i(!0),ae.play())}return gc(()=>{var b;if(n){let g=o.current.querySelectorAll('[data-in="true"]'),y=12,x=(b=t.position)==null?void 0:b.includes("top"),_=0,$=0;Array.from(g).reverse().forEach((S,C)=>{let A=S;A.classList.add("Toastify__toast--stacked"),C>0&&(A.dataset.collapsed=`${r}`),A.dataset.pos||(A.dataset.pos=x?"top":"bot");let L=_*(r?.2:1)+(r?0:y*C);A.style.setProperty("--y",`${x?L:L*-1}px`),A.style.setProperty("--g",`${y}`),A.style.setProperty("--s",`${1-(r?$:0)}`),_+=A.offsetHeight,$+=.025})}},[r,a,n]),h.useEffect(()=>{function b(g){var y;let x=o.current;d(g)&&((y=x.querySelector('[tabIndex="0"]'))==null||y.focus(),i(!1),ae.pause()),g.key==="Escape"&&(document.activeElement===x||x!=null&&x.contains(document.activeElement))&&(i(!0),ae.play())}return document.addEventListener("keydown",b),()=>{document.removeEventListener("keydown",b)}},[d]),h.createElement("section",{ref:o,className:"Toastify",id:m,onMouseEnter:()=>{n&&(i(!1),ae.pause())},onMouseLeave:v,"aria-live":"polite","aria-atomic":"false","aria-relevant":"additions text","aria-label":t["aria-label"]},s((b,g)=>{let y=g.length?{...c}:{...c,pointerEvents:"none"};return h.createElement("div",{tabIndex:-1,className:p(b),"data-stacked":n,style:y,key:`c-${b}`},g.map(({content:x,props:_})=>h.createElement(Sc,{..._,stacked:n,collapseAll:v,isIn:l(_.toastId,_.containerId),key:`t-${_.key}`},x)))}))}var Dn={},ms;function $c(){if(ms)return Dn;ms=1,Object.defineProperty(Dn,"__esModule",{value:!0}),Dn.parse=s,Dn.serialize=u;const e=/^[\u0021-\u003A\u003C\u003E-\u007E]+$/,t=/^[\u0021-\u003A\u003C-\u007E]*$/,n=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,r=/^[\u0020-\u003A\u003D-\u007E]*$/,i=Object.prototype.toString,o=(()=>{const m=function(){};return m.prototype=Object.create(null),m})();function s(m,d){const p=new o,v=m.length;if(v<2)return p;const b=(d==null?void 0:d.decode)||c;let g=0;do{const y=m.indexOf("=",g);if(y===-1)break;const x=m.indexOf(";",g),_=x===-1?v:x;if(y>_){g=m.lastIndexOf(";",y-1)+1;continue}const $=l(m,g,y),S=a(m,y,$),C=m.slice($,S);if(p[C]===void 0){let A=l(m,y+1,_),L=a(m,_,A);const j=b(m.slice(A,L));p[C]=j}g=_+1}while(g<v);return p}function l(m,d,p){do{const v=m.charCodeAt(d);if(v!==32&&v!==9)return d}while(++d<p);return p}function a(m,d,p){for(;d>p;){const v=m.charCodeAt(--d);if(v!==32&&v!==9)return d+1}return p}function u(m,d,p){const v=(p==null?void 0:p.encode)||encodeURIComponent;if(!e.test(m))throw new TypeError(`argument name is invalid: ${m}`);const b=v(d);if(!t.test(b))throw new TypeError(`argument val is invalid: ${d}`);let g=m+"="+b;if(!p)return g;if(p.maxAge!==void 0){if(!Number.isInteger(p.maxAge))throw new TypeError(`option maxAge is invalid: ${p.maxAge}`);g+="; Max-Age="+p.maxAge}if(p.domain){if(!n.test(p.domain))throw new TypeError(`option domain is invalid: ${p.domain}`);g+="; Domain="+p.domain}if(p.path){if(!r.test(p.path))throw new TypeError(`option path is invalid: ${p.path}`);g+="; Path="+p.path}if(p.expires){if(!f(p.expires)||!Number.isFinite(p.expires.valueOf()))throw new TypeError(`option expires is invalid: ${p.expires}`);g+="; Expires="+p.expires.toUTCString()}if(p.httpOnly&&(g+="; HttpOnly"),p.secure&&(g+="; Secure"),p.partitioned&&(g+="; Partitioned"),p.priority)switch(typeof p.priority=="string"?p.priority.toLowerCase():void 0){case"low":g+="; Priority=Low";break;case"medium":g+="; Priority=Medium";break;case"high":g+="; Priority=High";break;default:throw new TypeError(`option priority is invalid: ${p.priority}`)}if(p.sameSite)switch(typeof p.sameSite=="string"?p.sameSite.toLowerCase():p.sameSite){case!0:case"strict":g+="; SameSite=Strict";break;case"lax":g+="; SameSite=Lax";break;case"none":g+="; SameSite=None";break;default:throw new TypeError(`option sameSite is invalid: ${p.sameSite}`)}return g}function c(m){if(m.indexOf("%")===-1)return m;try{return decodeURIComponent(m)}catch{return m}}function f(m){return i.call(m)==="[object Date]"}return Dn}$c();/**
|
|
30
|
+
<%s key={someKey} {...props} />`,Ko,Cn,ew,Cn),Ef[Cn+Ko]=!0}}return E===r?Yx(ke):Jx(ke),ke}}function Gx(E,D,q){return Sf(E,D,q,!0)}function Xx(E,D,q){return Sf(E,D,q,!1)}var Qx=Xx,Zx=Gx;Hn.Fragment=r,Hn.jsx=Qx,Hn.jsxs=Zx}()),Hn}var Xo;function Of(){return Xo||(Xo=1,process.env.NODE_ENV==="production"?jr.exports=_f():jr.exports=Cf()),jr.exports}var y=Of();function Qo(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Qo(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function ut(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Qo(e))&&(r&&(r+=" "),r+=t);return r}function kf(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.firstChild?t.insertBefore(n,t.firstChild):t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}kf(`:root{--toastify-color-light: #fff;--toastify-color-dark: #121212;--toastify-color-info: #3498db;--toastify-color-success: #07bc0c;--toastify-color-warning: #f1c40f;--toastify-color-error: hsl(6, 78%, 57%);--toastify-color-transparent: rgba(255, 255, 255, .7);--toastify-icon-color-info: var(--toastify-color-info);--toastify-icon-color-success: var(--toastify-color-success);--toastify-icon-color-warning: var(--toastify-color-warning);--toastify-icon-color-error: var(--toastify-color-error);--toastify-container-width: fit-content;--toastify-toast-width: 320px;--toastify-toast-offset: 16px;--toastify-toast-top: max(var(--toastify-toast-offset), env(safe-area-inset-top));--toastify-toast-right: max(var(--toastify-toast-offset), env(safe-area-inset-right));--toastify-toast-left: max(var(--toastify-toast-offset), env(safe-area-inset-left));--toastify-toast-bottom: max(var(--toastify-toast-offset), env(safe-area-inset-bottom));--toastify-toast-background: #fff;--toastify-toast-padding: 14px;--toastify-toast-min-height: 64px;--toastify-toast-max-height: 800px;--toastify-toast-bd-radius: 6px;--toastify-toast-shadow: 0px 4px 12px rgba(0, 0, 0, .1);--toastify-font-family: sans-serif;--toastify-z-index: 9999;--toastify-text-color-light: #757575;--toastify-text-color-dark: #fff;--toastify-text-color-info: #fff;--toastify-text-color-success: #fff;--toastify-text-color-warning: #fff;--toastify-text-color-error: #fff;--toastify-spinner-color: #616161;--toastify-spinner-color-empty-area: #e0e0e0;--toastify-color-progress-light: linear-gradient(to right, #4cd964, #5ac8fa, #007aff, #34aadc, #5856d6, #ff2d55);--toastify-color-progress-dark: #bb86fc;--toastify-color-progress-info: var(--toastify-color-info);--toastify-color-progress-success: var(--toastify-color-success);--toastify-color-progress-warning: var(--toastify-color-warning);--toastify-color-progress-error: var(--toastify-color-error);--toastify-color-progress-bgo: .2}.Toastify__toast-container{z-index:var(--toastify-z-index);-webkit-transform:translate3d(0,0,var(--toastify-z-index));position:fixed;width:var(--toastify-container-width);box-sizing:border-box;color:#fff;display:flex;flex-direction:column}.Toastify__toast-container--top-left{top:var(--toastify-toast-top);left:var(--toastify-toast-left)}.Toastify__toast-container--top-center{top:var(--toastify-toast-top);left:50%;transform:translate(-50%);align-items:center}.Toastify__toast-container--top-right{top:var(--toastify-toast-top);right:var(--toastify-toast-right);align-items:end}.Toastify__toast-container--bottom-left{bottom:var(--toastify-toast-bottom);left:var(--toastify-toast-left)}.Toastify__toast-container--bottom-center{bottom:var(--toastify-toast-bottom);left:50%;transform:translate(-50%);align-items:center}.Toastify__toast-container--bottom-right{bottom:var(--toastify-toast-bottom);right:var(--toastify-toast-right);align-items:end}@media only screen and (max-width: 480px){.Toastify__toast-container{width:100vw;left:env(safe-area-inset-left);margin:0}.Toastify__toast-container--top-left,.Toastify__toast-container--top-center,.Toastify__toast-container--top-right{top:env(safe-area-inset-top);transform:translate(0)}.Toastify__toast-container--bottom-left,.Toastify__toast-container--bottom-center,.Toastify__toast-container--bottom-right{bottom:env(safe-area-inset-bottom);transform:translate(0)}.Toastify__toast-container--rtl{right:env(safe-area-inset-right);left:initial}.Toastify__toast{--toastify-toast-width: 100%;margin-bottom:0;border-radius:0}}.Toastify__toast{--y: 0;position:relative;touch-action:none;width:var(--toastify-toast-width);min-height:var(--toastify-toast-min-height);box-sizing:border-box;margin-bottom:1rem;padding:var(--toastify-toast-padding);border-radius:var(--toastify-toast-bd-radius);box-shadow:var(--toastify-toast-shadow);max-height:var(--toastify-toast-max-height);font-family:var(--toastify-font-family);z-index:0;display:flex;flex:1 auto;align-items:center;word-break:break-word}.Toastify__toast-container[data-stacked=true]{width:var(--toastify-toast-width)}.Toastify__toast--stacked{position:absolute;width:100%;transform:translate3d(0,var(--y),0) scale(var(--s));transition:transform .3s}.Toastify__toast--stacked[data-collapsed] .Toastify__toast-body,.Toastify__toast--stacked[data-collapsed] .Toastify__close-button{transition:opacity .1s}.Toastify__toast--stacked[data-collapsed=false]{overflow:visible}.Toastify__toast--stacked[data-collapsed=true]:not(:last-child)>*{opacity:0}.Toastify__toast--stacked:after{content:"";position:absolute;left:0;right:0;height:calc(var(--g) * 1px);bottom:100%}.Toastify__toast--stacked[data-pos=top]{top:0}.Toastify__toast--stacked[data-pos=bot]{bottom:0}.Toastify__toast--stacked[data-pos=bot].Toastify__toast--stacked:before{transform-origin:top}.Toastify__toast--stacked[data-pos=top].Toastify__toast--stacked:before{transform-origin:bottom}.Toastify__toast--stacked:before{content:"";position:absolute;left:0;right:0;bottom:0;height:100%;transform:scaleY(3);z-index:-1}.Toastify__toast--rtl{direction:rtl}.Toastify__toast--close-on-click{cursor:pointer}.Toastify__toast-icon{margin-inline-end:10px;width:22px;flex-shrink:0;display:flex}.Toastify--animate{animation-fill-mode:both;animation-duration:.5s}.Toastify--animate-icon{animation-fill-mode:both;animation-duration:.3s}.Toastify__toast-theme--dark{background:var(--toastify-color-dark);color:var(--toastify-text-color-dark)}.Toastify__toast-theme--light,.Toastify__toast-theme--colored.Toastify__toast--default{background:var(--toastify-color-light);color:var(--toastify-text-color-light)}.Toastify__toast-theme--colored.Toastify__toast--info{color:var(--toastify-text-color-info);background:var(--toastify-color-info)}.Toastify__toast-theme--colored.Toastify__toast--success{color:var(--toastify-text-color-success);background:var(--toastify-color-success)}.Toastify__toast-theme--colored.Toastify__toast--warning{color:var(--toastify-text-color-warning);background:var(--toastify-color-warning)}.Toastify__toast-theme--colored.Toastify__toast--error{color:var(--toastify-text-color-error);background:var(--toastify-color-error)}.Toastify__progress-bar-theme--light{background:var(--toastify-color-progress-light)}.Toastify__progress-bar-theme--dark{background:var(--toastify-color-progress-dark)}.Toastify__progress-bar--info{background:var(--toastify-color-progress-info)}.Toastify__progress-bar--success{background:var(--toastify-color-progress-success)}.Toastify__progress-bar--warning{background:var(--toastify-color-progress-warning)}.Toastify__progress-bar--error{background:var(--toastify-color-progress-error)}.Toastify__progress-bar-theme--colored.Toastify__progress-bar--info,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--success,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--warning,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--error{background:var(--toastify-color-transparent)}.Toastify__close-button{color:#fff;position:absolute;top:6px;right:6px;background:transparent;outline:none;border:none;padding:0;cursor:pointer;opacity:.7;transition:.3s ease;z-index:1}.Toastify__toast--rtl .Toastify__close-button{left:6px;right:unset}.Toastify__close-button--light{color:#000;opacity:.3}.Toastify__close-button>svg{fill:currentColor;height:16px;width:14px}.Toastify__close-button:hover,.Toastify__close-button:focus{opacity:1}@keyframes Toastify__trackProgress{0%{transform:scaleX(1)}to{transform:scaleX(0)}}.Toastify__progress-bar{position:absolute;bottom:0;left:0;width:100%;height:100%;z-index:1;opacity:.7;transform-origin:left}.Toastify__progress-bar--animated{animation:Toastify__trackProgress linear 1 forwards}.Toastify__progress-bar--controlled{transition:transform .2s}.Toastify__progress-bar--rtl{right:0;left:initial;transform-origin:right;border-bottom-left-radius:initial}.Toastify__progress-bar--wrp{position:absolute;overflow:hidden;bottom:0;left:0;width:100%;height:5px;border-bottom-left-radius:var(--toastify-toast-bd-radius);border-bottom-right-radius:var(--toastify-toast-bd-radius)}.Toastify__progress-bar--wrp[data-hidden=true]{opacity:0}.Toastify__progress-bar--bg{opacity:var(--toastify-color-progress-bgo);width:100%;height:100%}.Toastify__spinner{width:20px;height:20px;box-sizing:border-box;border:2px solid;border-radius:100%;border-color:var(--toastify-spinner-color-empty-area);border-right-color:var(--toastify-spinner-color);animation:Toastify__spin .65s linear infinite}@keyframes Toastify__bounceInRight{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(3000px,0,0)}60%{opacity:1;transform:translate3d(-25px,0,0)}75%{transform:translate3d(10px,0,0)}90%{transform:translate3d(-5px,0,0)}to{transform:none}}@keyframes Toastify__bounceOutRight{20%{opacity:1;transform:translate3d(-20px,var(--y),0)}to{opacity:0;transform:translate3d(2000px,var(--y),0)}}@keyframes Toastify__bounceInLeft{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(-3000px,0,0)}60%{opacity:1;transform:translate3d(25px,0,0)}75%{transform:translate3d(-10px,0,0)}90%{transform:translate3d(5px,0,0)}to{transform:none}}@keyframes Toastify__bounceOutLeft{20%{opacity:1;transform:translate3d(20px,var(--y),0)}to{opacity:0;transform:translate3d(-2000px,var(--y),0)}}@keyframes Toastify__bounceInUp{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(0,3000px,0)}60%{opacity:1;transform:translate3d(0,-20px,0)}75%{transform:translate3d(0,10px,0)}90%{transform:translate3d(0,-5px,0)}to{transform:translateZ(0)}}@keyframes Toastify__bounceOutUp{20%{transform:translate3d(0,calc(var(--y) - 10px),0)}40%,45%{opacity:1;transform:translate3d(0,calc(var(--y) + 20px),0)}to{opacity:0;transform:translate3d(0,-2000px,0)}}@keyframes Toastify__bounceInDown{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(0,-3000px,0)}60%{opacity:1;transform:translate3d(0,25px,0)}75%{transform:translate3d(0,-10px,0)}90%{transform:translate3d(0,5px,0)}to{transform:none}}@keyframes Toastify__bounceOutDown{20%{transform:translate3d(0,calc(var(--y) - 10px),0)}40%,45%{opacity:1;transform:translate3d(0,calc(var(--y) + 20px),0)}to{opacity:0;transform:translate3d(0,2000px,0)}}.Toastify__bounce-enter--top-left,.Toastify__bounce-enter--bottom-left{animation-name:Toastify__bounceInLeft}.Toastify__bounce-enter--top-right,.Toastify__bounce-enter--bottom-right{animation-name:Toastify__bounceInRight}.Toastify__bounce-enter--top-center{animation-name:Toastify__bounceInDown}.Toastify__bounce-enter--bottom-center{animation-name:Toastify__bounceInUp}.Toastify__bounce-exit--top-left,.Toastify__bounce-exit--bottom-left{animation-name:Toastify__bounceOutLeft}.Toastify__bounce-exit--top-right,.Toastify__bounce-exit--bottom-right{animation-name:Toastify__bounceOutRight}.Toastify__bounce-exit--top-center{animation-name:Toastify__bounceOutUp}.Toastify__bounce-exit--bottom-center{animation-name:Toastify__bounceOutDown}@keyframes Toastify__zoomIn{0%{opacity:0;transform:scale3d(.3,.3,.3)}50%{opacity:1}}@keyframes Toastify__zoomOut{0%{opacity:1}50%{opacity:0;transform:translate3d(0,var(--y),0) scale3d(.3,.3,.3)}to{opacity:0}}.Toastify__zoom-enter{animation-name:Toastify__zoomIn}.Toastify__zoom-exit{animation-name:Toastify__zoomOut}@keyframes Toastify__flipIn{0%{transform:perspective(400px) rotateX(90deg);animation-timing-function:ease-in;opacity:0}40%{transform:perspective(400px) rotateX(-20deg);animation-timing-function:ease-in}60%{transform:perspective(400px) rotateX(10deg);opacity:1}80%{transform:perspective(400px) rotateX(-5deg)}to{transform:perspective(400px)}}@keyframes Toastify__flipOut{0%{transform:translate3d(0,var(--y),0) perspective(400px)}30%{transform:translate3d(0,var(--y),0) perspective(400px) rotateX(-20deg);opacity:1}to{transform:translate3d(0,var(--y),0) perspective(400px) rotateX(90deg);opacity:0}}.Toastify__flip-enter{animation-name:Toastify__flipIn}.Toastify__flip-exit{animation-name:Toastify__flipOut}@keyframes Toastify__slideInRight{0%{transform:translate3d(110%,0,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInLeft{0%{transform:translate3d(-110%,0,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInUp{0%{transform:translate3d(0,110%,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInDown{0%{transform:translate3d(0,-110%,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideOutRight{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(110%,var(--y),0)}}@keyframes Toastify__slideOutLeft{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(-110%,var(--y),0)}}@keyframes Toastify__slideOutDown{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(0,500px,0)}}@keyframes Toastify__slideOutUp{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(0,-500px,0)}}.Toastify__slide-enter--top-left,.Toastify__slide-enter--bottom-left{animation-name:Toastify__slideInLeft}.Toastify__slide-enter--top-right,.Toastify__slide-enter--bottom-right{animation-name:Toastify__slideInRight}.Toastify__slide-enter--top-center{animation-name:Toastify__slideInDown}.Toastify__slide-enter--bottom-center{animation-name:Toastify__slideInUp}.Toastify__slide-exit--top-left,.Toastify__slide-exit--bottom-left{animation-name:Toastify__slideOutLeft;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--top-right,.Toastify__slide-exit--bottom-right{animation-name:Toastify__slideOutRight;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--top-center{animation-name:Toastify__slideOutUp;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--bottom-center{animation-name:Toastify__slideOutDown;animation-timing-function:ease-in;animation-duration:.3s}@keyframes Toastify__spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}
|
|
31
|
+
`);var qn=e=>typeof e=="number"&&!isNaN(e),tn=e=>typeof e=="string",Pt=e=>typeof e=="function",Ff=e=>tn(e)||qn(e),Vi=e=>tn(e)||Pt(e)?e:null,Af=(e,t)=>e===!1||qn(e)&&e>0?e:t,Bi=e=>h.isValidElement(e)||tn(e)||Pt(e)||qn(e);function $f(e,t,n=300){let{scrollHeight:r,style:i}=e;requestAnimationFrame(()=>{i.minHeight="initial",i.height=r+"px",i.transition=`all ${n}ms`,requestAnimationFrame(()=>{i.height="0",i.padding="0",i.margin="0",setTimeout(t,n)})})}function jf({enter:e,exit:t,appendPosition:n=!1,collapse:r=!0,collapseDuration:i=300}){return function({children:s,position:o,preventExitTransition:a,done:l,nodeRef:u,isIn:c,playToast:f}){let m=n?`${e}--${o}`:e,p=n?`${t}--${o}`:t,d=h.useRef(0);return h.useLayoutEffect(()=>{let g=u.current,v=m.split(" "),b=x=>{x.target===u.current&&(f(),g.removeEventListener("animationend",b),g.removeEventListener("animationcancel",b),d.current===0&&x.type!=="animationcancel"&&g.classList.remove(...v))};g.classList.add(...v),g.addEventListener("animationend",b),g.addEventListener("animationcancel",b)},[]),h.useEffect(()=>{let g=u.current,v=()=>{g.removeEventListener("animationend",v),r?$f(g,l,i):l()};c||(a?v():(d.current=1,g.className+=` ${p}`,g.addEventListener("animationend",v)))},[c]),h.createElement(h.Fragment,null,s)}}function Zo(e,t){return{content:ea(e.content,e.props),containerId:e.props.containerId,id:e.props.toastId,theme:e.props.theme,type:e.props.type,data:e.props.data||{},isLoading:e.props.isLoading,icon:e.props.icon,reason:e.removalReason,status:t}}function ea(e,t,n=!1){return h.isValidElement(e)&&!tn(e.type)?h.cloneElement(e,{closeToast:t.closeToast,toastProps:t,data:t.data,isPaused:n}):Pt(e)?e({closeToast:t.closeToast,toastProps:t,data:t.data,isPaused:n}):e}function Nf({closeToast:e,theme:t,ariaLabel:n="close"}){return h.createElement("button",{className:`Toastify__close-button Toastify__close-button--${t}`,type:"button",onClick:r=>{r.stopPropagation(),e(!0)},"aria-label":n},h.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},h.createElement("path",{fillRule:"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"})))}function Pf({delay:e,isRunning:t,closeToast:n,type:r="default",hide:i,className:s,controlledProgress:o,progress:a,rtl:l,isIn:u,theme:c}){let f=i||o&&a===0,m={animationDuration:`${e}ms`,animationPlayState:t?"running":"paused"};o&&(m.transform=`scaleX(${a})`);let p=ut("Toastify__progress-bar",o?"Toastify__progress-bar--controlled":"Toastify__progress-bar--animated",`Toastify__progress-bar-theme--${c}`,`Toastify__progress-bar--${r}`,{"Toastify__progress-bar--rtl":l}),d=Pt(s)?s({rtl:l,type:r,defaultClassName:p}):ut(p,s),g={[o&&a>=1?"onTransitionEnd":"onAnimationEnd"]:o&&a<1?null:()=>{u&&n()}};return h.createElement("div",{className:"Toastify__progress-bar--wrp","data-hidden":f},h.createElement("div",{className:`Toastify__progress-bar--bg Toastify__progress-bar-theme--${c} Toastify__progress-bar--${r}`}),h.createElement("div",{role:"progressbar","aria-hidden":f?"true":"false","aria-label":"notification timer",className:d,style:m,...g}))}var Lf=1,ta=()=>`${Lf++}`;function Df(e,t,n){let r=1,i=0,s=[],o=[],a=t,l=new Map,u=new Set,c=x=>(u.add(x),()=>u.delete(x)),f=()=>{o=Array.from(l.values()),u.forEach(x=>x())},m=({containerId:x,toastId:w,updateId:T})=>{let C=x?x!==e:e!==1,_=l.has(w)&&T==null;return C||_},p=(x,w)=>{l.forEach(T=>{var C;(w==null||w===T.props.toastId)&&((C=T.toggle)==null||C.call(T,x))})},d=x=>{var w,T;(T=(w=x.props)==null?void 0:w.onClose)==null||T.call(w,x.removalReason),x.isActive=!1},g=x=>{if(x==null)l.forEach(d);else{let w=l.get(x);w&&d(w)}f()},v=()=>{i-=s.length,s=[]},b=x=>{var w,T;let{toastId:C,updateId:_}=x.props,O=_==null;x.staleId&&l.delete(x.staleId),x.isActive=!0,l.set(C,x),f(),n(Zo(x,O?"added":"updated")),O&&((T=(w=x.props).onOpen)==null||T.call(w))};return{id:e,props:a,observe:c,toggle:p,removeToast:g,toasts:l,clearQueue:v,buildToast:(x,w)=>{if(m(w))return;let{toastId:T,updateId:C,data:_,staleId:O,delay:A}=w,N=C==null;N&&i++;let L={...a,style:a.toastStyle,key:r++,...Object.fromEntries(Object.entries(w).filter(([I,R])=>R!=null)),toastId:T,updateId:C,data:_,isIn:!1,className:Vi(w.className||a.toastClassName),progressClassName:Vi(w.progressClassName||a.progressClassName),autoClose:w.isLoading?!1:Af(w.autoClose,a.autoClose),closeToast(I){l.get(T).removalReason=I,g(T)},deleteToast(){let I=l.get(T);if(I!=null){if(n(Zo(I,"removed")),l.delete(T),i--,i<0&&(i=0),s.length>0){b(s.shift());return}f()}}};L.closeButton=a.closeButton,w.closeButton===!1||Bi(w.closeButton)?L.closeButton=w.closeButton:w.closeButton===!0&&(L.closeButton=Bi(a.closeButton)?a.closeButton:!0);let P={content:x,props:L,staleId:O};a.limit&&a.limit>0&&i>a.limit&&N?s.push(P):qn(A)?setTimeout(()=>{b(P)},A):b(P)},setProps(x){a=x},setToggle:(x,w)=>{let T=l.get(x);T&&(T.toggle=w)},isToastActive:x=>{var w;return(w=l.get(x))==null?void 0:w.isActive},getSnapshot:()=>o}}var Ke=new Map,zn=[],Ui=new Set,If=e=>Ui.forEach(t=>t(e)),na=()=>Ke.size>0;function Mf(){zn.forEach(e=>ia(e.content,e.options)),zn=[]}var Rf=(e,{containerId:t})=>{var n;return(n=Ke.get(t||1))==null?void 0:n.toasts.get(e)};function ra(e,t){var n;if(t)return!!((n=Ke.get(t))!=null&&n.isToastActive(e));let r=!1;return Ke.forEach(i=>{i.isToastActive(e)&&(r=!0)}),r}function Vf(e){if(!na()){zn=zn.filter(t=>e!=null&&t.options.toastId!==e);return}if(e==null||Ff(e))Ke.forEach(t=>{t.removeToast(e)});else if(e&&("containerId"in e||"id"in e)){let t=Ke.get(e.containerId);t?t.removeToast(e.id):Ke.forEach(n=>{n.removeToast(e.id)})}}var Bf=(e={})=>{Ke.forEach(t=>{t.props.limit&&(!e.containerId||t.id===e.containerId)&&t.clearQueue()})};function ia(e,t){Bi(e)&&(na()||zn.push({content:e,options:t}),Ke.forEach(n=>{n.buildToast(e,t)}))}function Uf(e){var t;(t=Ke.get(e.containerId||1))==null||t.setToggle(e.id,e.fn)}function sa(e,t){Ke.forEach(n=>{(t==null||!(t!=null&&t.containerId)||(t==null?void 0:t.containerId)===n.id)&&n.toggle(e,t==null?void 0:t.id)})}function Hf(e){let t=e.containerId||1;return{subscribe(n){let r=Df(t,e,If);Ke.set(t,r);let i=r.observe(n);return Mf(),()=>{i(),Ke.delete(t)}},setProps(n){var r;(r=Ke.get(t))==null||r.setProps(n)},getSnapshot(){var n;return(n=Ke.get(t))==null?void 0:n.getSnapshot()}}}function qf(e){return Ui.add(e),()=>{Ui.delete(e)}}function zf(e){return e&&(tn(e.toastId)||qn(e.toastId))?e.toastId:ta()}function Wn(e,t){return ia(e,t),t.toastId}function Nr(e,t){return{...t,type:t&&t.type||e,toastId:zf(t)}}function Pr(e){return(t,n)=>Wn(t,Nr(e,n))}function ue(e,t){return Wn(e,Nr("default",t))}ue.loading=(e,t)=>Wn(e,Nr("default",{isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1,...t}));function Wf(e,{pending:t,error:n,success:r},i){let s;t&&(s=tn(t)?ue.loading(t,i):ue.loading(t.render,{...i,...t}));let o={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},a=(u,c,f)=>{if(c==null){ue.dismiss(s);return}let m={type:u,...o,...i,data:f},p=tn(c)?{render:c}:c;return s?ue.update(s,{...m,...p}):ue(p.render,{...m,...p}),f},l=Pt(e)?e():e;return l.then(u=>a("success",r,u)).catch(u=>a("error",n,u)),l}ue.promise=Wf,ue.success=Pr("success"),ue.info=Pr("info"),ue.error=Pr("error"),ue.warning=Pr("warning"),ue.warn=ue.warning,ue.dark=(e,t)=>Wn(e,Nr("default",{theme:"dark",...t}));function Kf(e){Vf(e)}ue.dismiss=Kf,ue.clearWaitingQueue=Bf,ue.isActive=ra,ue.update=(e,t={})=>{let n=Rf(e,t);if(n){let{props:r,content:i}=n,s={delay:100,...r,...t,toastId:t.toastId||e,updateId:ta()};s.toastId!==e&&(s.staleId=e);let o=s.render||i;delete s.render,Wn(o,s)}},ue.done=e=>{ue.update(e,{progress:1})},ue.onChange=qf,ue.play=e=>sa(!0,e),ue.pause=e=>sa(!1,e);function Jf(e){var t;let{subscribe:n,getSnapshot:r,setProps:i}=h.useRef(Hf(e)).current;i(e);let s=(t=h.useSyncExternalStore(n,r,r))==null?void 0:t.slice();function o(a){if(!s)return[];let l=new Map;return e.newestOnTop&&s.reverse(),s.forEach(u=>{let{position:c}=u.props;l.has(c)||l.set(c,[]),l.get(c).push(u)}),Array.from(l,u=>a(u[0],u[1]))}return{getToastToRender:o,isToastActive:ra,count:s==null?void 0:s.length}}function Yf(e){let[t,n]=h.useState(!1),[r,i]=h.useState(!1),s=h.useRef(null),o=h.useRef({start:0,delta:0,removalDistance:0,canCloseOnClick:!0,canDrag:!1,didMove:!1}).current,{autoClose:a,pauseOnHover:l,closeToast:u,onClick:c,closeOnClick:f}=e;Uf({id:e.toastId,containerId:e.containerId,fn:n}),h.useEffect(()=>{if(e.pauseOnFocusLoss)return m(),()=>{p()}},[e.pauseOnFocusLoss]);function m(){document.hasFocus()||b(),window.addEventListener("focus",v),window.addEventListener("blur",b)}function p(){window.removeEventListener("focus",v),window.removeEventListener("blur",b)}function d(O){if(e.draggable===!0||e.draggable===O.pointerType){x();let A=s.current;o.canCloseOnClick=!0,o.canDrag=!0,A.style.transition="none",e.draggableDirection==="x"?(o.start=O.clientX,o.removalDistance=A.offsetWidth*(e.draggablePercent/100)):(o.start=O.clientY,o.removalDistance=A.offsetHeight*(e.draggablePercent===80?e.draggablePercent*1.5:e.draggablePercent)/100)}}function g(O){let{top:A,bottom:N,left:L,right:P}=s.current.getBoundingClientRect();O.nativeEvent.type!=="touchend"&&e.pauseOnHover&&O.clientX>=L&&O.clientX<=P&&O.clientY>=A&&O.clientY<=N?b():v()}function v(){n(!0)}function b(){n(!1)}function x(){o.didMove=!1,document.addEventListener("pointermove",T),document.addEventListener("pointerup",C)}function w(){document.removeEventListener("pointermove",T),document.removeEventListener("pointerup",C)}function T(O){let A=s.current;if(o.canDrag&&A){o.didMove=!0,t&&b(),e.draggableDirection==="x"?o.delta=O.clientX-o.start:o.delta=O.clientY-o.start,o.start!==O.clientX&&(o.canCloseOnClick=!1);let N=e.draggableDirection==="x"?`${o.delta}px, var(--y)`:`0, calc(${o.delta}px + var(--y))`;A.style.transform=`translate3d(${N},0)`,A.style.opacity=`${1-Math.abs(o.delta/o.removalDistance)}`}}function C(){w();let O=s.current;if(o.canDrag&&o.didMove&&O){if(o.canDrag=!1,Math.abs(o.delta)>o.removalDistance){i(!0),e.closeToast(!0),e.collapseAll();return}O.style.transition="transform 0.2s, opacity 0.2s",O.style.removeProperty("transform"),O.style.removeProperty("opacity")}}let _={onPointerDown:d,onPointerUp:g};return a&&l&&(_.onMouseEnter=b,e.stacked||(_.onMouseLeave=v)),f&&(_.onClick=O=>{c&&c(O),o.canCloseOnClick&&u(!0)}),{playToast:v,pauseToast:b,isRunning:t,preventExitTransition:r,toastRef:s,eventHandlers:_}}var Gf=typeof window<"u"?h.useLayoutEffect:h.useEffect,Lr=({theme:e,type:t,isLoading:n,...r})=>h.createElement("svg",{viewBox:"0 0 24 24",width:"100%",height:"100%",fill:e==="colored"?"currentColor":`var(--toastify-icon-color-${t})`,...r});function Xf(e){return h.createElement(Lr,{...e},h.createElement("path",{d:"M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z"}))}function Qf(e){return h.createElement(Lr,{...e},h.createElement("path",{d:"M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z"}))}function Zf(e){return h.createElement(Lr,{...e},h.createElement("path",{d:"M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z"}))}function ed(e){return h.createElement(Lr,{...e},h.createElement("path",{d:"M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z"}))}function td(){return h.createElement("div",{className:"Toastify__spinner"})}var Hi={info:Qf,warning:Xf,success:Zf,error:ed,spinner:td},nd=e=>e in Hi;function rd({theme:e,type:t,isLoading:n,icon:r}){let i=null,s={theme:e,type:t};return r===!1||(Pt(r)?i=r({...s,isLoading:n}):h.isValidElement(r)?i=h.cloneElement(r,s):n?i=Hi.spinner():nd(t)&&(i=Hi[t](s))),i}var id=e=>{let{isRunning:t,preventExitTransition:n,toastRef:r,eventHandlers:i,playToast:s}=Yf(e),{closeButton:o,children:a,autoClose:l,onClick:u,type:c,hideProgressBar:f,closeToast:m,transition:p,position:d,className:g,style:v,progressClassName:b,updateId:x,role:w,progress:T,rtl:C,toastId:_,deleteToast:O,isIn:A,isLoading:N,closeOnClick:L,theme:P,ariaLabel:I}=e,R=ut("Toastify__toast",`Toastify__toast-theme--${P}`,`Toastify__toast--${c}`,{"Toastify__toast--rtl":C},{"Toastify__toast--close-on-click":L}),z=Pt(g)?g({rtl:C,position:d,type:c,defaultClassName:R}):ut(R,g),Y=rd(e),H=!!T||!l,X={closeToast:m,type:c,theme:P},K=null;return o===!1||(Pt(o)?K=o(X):h.isValidElement(o)?K=h.cloneElement(o,X):K=Nf(X)),h.createElement(p,{isIn:A,done:O,position:d,preventExitTransition:n,nodeRef:r,playToast:s},h.createElement("div",{id:_,tabIndex:0,onClick:u,"data-in":A,className:z,...i,style:v,ref:r,...A&&{role:w,"aria-label":I}},Y!=null&&h.createElement("div",{className:ut("Toastify__toast-icon",{"Toastify--animate-icon Toastify__zoom-enter":!N})},Y),ea(a,e,!t),K,!e.customProgressBar&&h.createElement(Pf,{...x&&!H?{key:`p-${x}`}:{},rtl:C,theme:P,delay:l,isRunning:t,isIn:A,closeToast:m,hide:f,type:c,className:b,controlledProgress:H,progress:T||0})))},sd=(e,t=!1)=>({enter:`Toastify--animate Toastify__${e}-enter`,exit:`Toastify--animate Toastify__${e}-exit`,appendPosition:t}),od=jf(sd("bounce",!0)),ad={position:"top-right",transition:od,autoClose:5e3,closeButton:!0,pauseOnHover:!0,pauseOnFocusLoss:!0,draggable:"touch",draggablePercent:80,draggableDirection:"x",role:"alert",theme:"light","aria-label":"Notifications Alt+T",hotKeys:e=>e.altKey&&e.code==="KeyT"};function ld(e){let t={...ad,...e},n=e.stacked,[r,i]=h.useState(!0),s=h.useRef(null),{getToastToRender:o,isToastActive:a,count:l}=Jf(t),{className:u,style:c,rtl:f,containerId:m,hotKeys:p}=t;function d(v){let b=ut("Toastify__toast-container",`Toastify__toast-container--${v}`,{"Toastify__toast-container--rtl":f});return Pt(u)?u({position:v,rtl:f,defaultClassName:b}):ut(b,Vi(u))}function g(){n&&(i(!0),ue.play())}return Gf(()=>{var v;if(n){let b=s.current.querySelectorAll('[data-in="true"]'),x=12,w=(v=t.position)==null?void 0:v.includes("top"),T=0,C=0;Array.from(b).reverse().forEach((_,O)=>{let A=_;A.classList.add("Toastify__toast--stacked"),O>0&&(A.dataset.collapsed=`${r}`),A.dataset.pos||(A.dataset.pos=w?"top":"bot");let N=T*(r?.2:1)+(r?0:x*O);A.style.setProperty("--y",`${w?N:N*-1}px`),A.style.setProperty("--g",`${x}`),A.style.setProperty("--s",`${1-(r?C:0)}`),T+=A.offsetHeight,C+=.025})}},[r,l,n]),h.useEffect(()=>{function v(b){var x;let w=s.current;p(b)&&((x=w.querySelector('[tabIndex="0"]'))==null||x.focus(),i(!1),ue.pause()),b.key==="Escape"&&(document.activeElement===w||w!=null&&w.contains(document.activeElement))&&(i(!0),ue.play())}return document.addEventListener("keydown",v),()=>{document.removeEventListener("keydown",v)}},[p]),h.createElement("section",{ref:s,className:"Toastify",id:m,onMouseEnter:()=>{n&&(i(!1),ue.pause())},onMouseLeave:g,"aria-live":"polite","aria-atomic":"false","aria-relevant":"additions text","aria-label":t["aria-label"]},o((v,b)=>{let x=b.length?{...c}:{...c,pointerEvents:"none"};return h.createElement("div",{tabIndex:-1,className:d(v),"data-stacked":n,style:x,key:`c-${v}`},b.map(({content:w,props:T})=>h.createElement(id,{...T,stacked:n,collapseAll:g,isIn:a(T.toastId,T.containerId),key:`t-${T.key}`},w)))}))}var Kn={},oa;function ud(){if(oa)return Kn;oa=1,Object.defineProperty(Kn,"__esModule",{value:!0}),Kn.parse=o,Kn.serialize=u;const e=/^[\u0021-\u003A\u003C\u003E-\u007E]+$/,t=/^[\u0021-\u003A\u003C-\u007E]*$/,n=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,r=/^[\u0020-\u003A\u003D-\u007E]*$/,i=Object.prototype.toString,s=(()=>{const m=function(){};return m.prototype=Object.create(null),m})();function o(m,p){const d=new s,g=m.length;if(g<2)return d;const v=(p==null?void 0:p.decode)||c;let b=0;do{const x=m.indexOf("=",b);if(x===-1)break;const w=m.indexOf(";",b),T=w===-1?g:w;if(x>T){b=m.lastIndexOf(";",x-1)+1;continue}const C=a(m,b,x),_=l(m,x,C),O=m.slice(C,_);if(d[O]===void 0){let A=a(m,x+1,T),N=l(m,T,A);const L=v(m.slice(A,N));d[O]=L}b=T+1}while(b<g);return d}function a(m,p,d){do{const g=m.charCodeAt(p);if(g!==32&&g!==9)return p}while(++p<d);return d}function l(m,p,d){for(;p>d;){const g=m.charCodeAt(--p);if(g!==32&&g!==9)return p+1}return d}function u(m,p,d){const g=(d==null?void 0:d.encode)||encodeURIComponent;if(!e.test(m))throw new TypeError(`argument name is invalid: ${m}`);const v=g(p);if(!t.test(v))throw new TypeError(`argument val is invalid: ${p}`);let b=m+"="+v;if(!d)return b;if(d.maxAge!==void 0){if(!Number.isInteger(d.maxAge))throw new TypeError(`option maxAge is invalid: ${d.maxAge}`);b+="; Max-Age="+d.maxAge}if(d.domain){if(!n.test(d.domain))throw new TypeError(`option domain is invalid: ${d.domain}`);b+="; Domain="+d.domain}if(d.path){if(!r.test(d.path))throw new TypeError(`option path is invalid: ${d.path}`);b+="; Path="+d.path}if(d.expires){if(!f(d.expires)||!Number.isFinite(d.expires.valueOf()))throw new TypeError(`option expires is invalid: ${d.expires}`);b+="; Expires="+d.expires.toUTCString()}if(d.httpOnly&&(b+="; HttpOnly"),d.secure&&(b+="; Secure"),d.partitioned&&(b+="; Partitioned"),d.priority)switch(typeof d.priority=="string"?d.priority.toLowerCase():void 0){case"low":b+="; Priority=Low";break;case"medium":b+="; Priority=Medium";break;case"high":b+="; Priority=High";break;default:throw new TypeError(`option priority is invalid: ${d.priority}`)}if(d.sameSite)switch(typeof d.sameSite=="string"?d.sameSite.toLowerCase():d.sameSite){case!0:case"strict":b+="; SameSite=Strict";break;case"lax":b+="; SameSite=Lax";break;case"none":b+="; SameSite=None";break;default:throw new TypeError(`option sameSite is invalid: ${d.sameSite}`)}return b}function c(m){if(m.indexOf("%")===-1)return m;try{return decodeURIComponent(m)}catch{return m}}function f(m){return i.call(m)==="[object Date]"}return Kn}ud();/**
|
|
32
32
|
* react-router v7.1.1
|
|
33
33
|
*
|
|
34
34
|
* Copyright (c) Remix Software Inc.
|
|
@@ -37,21 +37,31 @@ React keys must be passed directly to JSX without using spread:
|
|
|
37
37
|
* LICENSE.md file in the root directory of this source tree.
|
|
38
38
|
*
|
|
39
39
|
* @license MIT
|
|
40
|
-
*/function
|
|
40
|
+
*/function De(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Lt(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function qi({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function zi(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function aa(e,t,n="/"){return cd(e,t,n,!1)}function cd(e,t,n,r){let i=typeof t=="string"?zi(t):t,s=nn(i.pathname||"/",n);if(s==null)return null;let o=la(e);fd(o);let a=null;for(let l=0;a==null&&l<o.length;++l){let u=Ed(s);a=xd(o[l],u,r)}return a}function la(e,t=[],n=[],r=""){let i=(s,o,a)=>{let l={relativePath:a===void 0?s.path||"":a,caseSensitive:s.caseSensitive===!0,childrenIndex:o,route:s};l.relativePath.startsWith("/")&&(De(l.relativePath.startsWith(r),`Absolute route path "${l.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),l.relativePath=l.relativePath.slice(r.length));let u=Dt([r,l.relativePath]),c=n.concat(l);s.children&&s.children.length>0&&(De(s.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${u}".`),la(s.children,t,c,u)),!(s.path==null&&!s.index)&&t.push({path:u,score:bd(u,s.index),routesMeta:c})};return e.forEach((s,o)=>{var a;if(s.path===""||!((a=s.path)!=null&&a.includes("?")))i(s,o);else for(let l of ua(s.path))i(s,o,l)}),t}function ua(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,i=n.endsWith("?"),s=n.replace(/\?$/,"");if(r.length===0)return i?[s,""]:[s];let o=ua(r.join("/")),a=[];return a.push(...o.map(l=>l===""?s:[s,l].join("/"))),i&&a.push(...o),a.map(l=>e.startsWith("/")&&l===""?"/":l)}function fd(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:vd(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var dd=/^:[\w-]+$/,pd=3,hd=2,md=1,gd=10,yd=-2,ca=e=>e==="*";function bd(e,t){let n=e.split("/"),r=n.length;return n.some(ca)&&(r+=yd),t&&(r+=hd),n.filter(i=>!ca(i)).reduce((i,s)=>i+(dd.test(s)?pd:s===""?md:gd),r)}function vd(e,t){return e.length===t.length&&e.slice(0,-1).every((r,i)=>r===t[i])?e[e.length-1]-t[t.length-1]:0}function xd(e,t,n=!1){let{routesMeta:r}=e,i={},s="/",o=[];for(let a=0;a<r.length;++a){let l=r[a],u=a===r.length-1,c=s==="/"?t:t.slice(s.length)||"/",f=Dr({path:l.relativePath,caseSensitive:l.caseSensitive,end:u},c),m=l.route;if(!f&&u&&n&&!r[r.length-1].route.index&&(f=Dr({path:l.relativePath,caseSensitive:l.caseSensitive,end:!1},c)),!f)return null;Object.assign(i,f.params),o.push({params:i,pathname:Dt([s,f.pathname]),pathnameBase:Cd(Dt([s,f.pathnameBase])),route:m}),f.pathnameBase!=="/"&&(s=Dt([s,f.pathnameBase]))}return o}function Dr(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=wd(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let s=i[0],o=s.replace(/(.)\/+$/,"$1"),a=i.slice(1);return{params:r.reduce((u,{paramName:c,isOptional:f},m)=>{if(c==="*"){let d=a[m]||"";o=s.slice(0,s.length-d.length).replace(/(.)\/+$/,"$1")}const p=a[m];return f&&!p?u[c]=void 0:u[c]=(p||"").replace(/%2F/g,"/"),u},{}),pathname:s,pathnameBase:o,pattern:e}}function wd(e,t=!1,n=!0){Lt(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,a,l)=>(r.push({paramName:a,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function Ed(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Lt(!1,`The URL path "${e}" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function nn(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function Sd(e,t="/"){let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?zi(e):e;return{pathname:n?n.startsWith("/")?n:Td(n,t):t,search:Od(r),hash:kd(i)}}function Td(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function Wi(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function _d(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function fa(e){let t=_d(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function da(e,t,n,r=!1){let i;typeof e=="string"?i=zi(e):(i={...e},De(!i.pathname||!i.pathname.includes("?"),Wi("?","pathname","search",i)),De(!i.pathname||!i.pathname.includes("#"),Wi("#","pathname","hash",i)),De(!i.search||!i.search.includes("#"),Wi("#","search","hash",i)));let s=e===""||i.pathname==="",o=s?"/":i.pathname,a;if(o==null)a=n;else{let f=t.length-1;if(!r&&o.startsWith("..")){let m=o.split("/");for(;m[0]==="..";)m.shift(),f-=1;i.pathname=m.join("/")}a=f>=0?t[f]:"/"}let l=Sd(i,a),u=o&&o!=="/"&&o.endsWith("/"),c=(s||o===".")&&n.endsWith("/");return!l.pathname.endsWith("/")&&(u||c)&&(l.pathname+="/"),l}var Dt=e=>e.join("/").replace(/\/\/+/g,"/"),Cd=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Od=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,kd=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function Fd(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}var pa=["POST","PUT","PATCH","DELETE"];new Set(pa);var Ad=["GET",...pa];new Set(Ad);var On=F.createContext(null);On.displayName="DataRouter";var Ir=F.createContext(null);Ir.displayName="DataRouterState";var ha=F.createContext({isTransitioning:!1});ha.displayName="ViewTransition";var $d=F.createContext(new Map);$d.displayName="Fetchers";var jd=F.createContext(null);jd.displayName="Await";var It=F.createContext(null);It.displayName="Navigation";var Ki=F.createContext(null);Ki.displayName="Location";var Mt=F.createContext({outlet:null,matches:[],isDataRoute:!1});Mt.displayName="Route";var Ji=F.createContext(null);Ji.displayName="RouteError";function Nd(e,{relative:t}={}){De(Mr(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=F.useContext(It),{hash:i,pathname:s,search:o}=Jn(e,{relative:t}),a=s;return n!=="/"&&(a=s==="/"?n:Dt([n,s])),r.createHref({pathname:a,search:o,hash:i})}function Mr(){return F.useContext(Ki)!=null}function rn(){return De(Mr(),"useLocation() may be used only in the context of a <Router> component."),F.useContext(Ki).location}var ma="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function ga(e){F.useContext(It).static||F.useLayoutEffect(e)}function Pd(){let{isDataRoute:e}=F.useContext(Mt);return e?Kd():Ld()}function Ld(){De(Mr(),"useNavigate() may be used only in the context of a <Router> component.");let e=F.useContext(On),{basename:t,navigator:n}=F.useContext(It),{matches:r}=F.useContext(Mt),{pathname:i}=rn(),s=JSON.stringify(fa(r)),o=F.useRef(!1);return ga(()=>{o.current=!0}),F.useCallback((l,u={})=>{if(Lt(o.current,ma),!o.current)return;if(typeof l=="number"){n.go(l);return}let c=da(l,JSON.parse(s),i,u.relative==="path");e==null&&t!=="/"&&(c.pathname=c.pathname==="/"?t:Dt([t,c.pathname])),(u.replace?n.replace:n.push)(c,u.state,u)},[t,n,s,i,e])}F.createContext(null);function Jn(e,{relative:t}={}){let{matches:n}=F.useContext(Mt),{pathname:r}=rn(),i=JSON.stringify(fa(n));return F.useMemo(()=>da(e,JSON.parse(i),r,t==="path"),[e,i,r,t])}function Dd(e,t,n,r){De(Mr(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:i}=F.useContext(It),{matches:s}=F.useContext(Mt),o=s[s.length-1],a=o?o.params:{},l=o?o.pathname:"/",u=o?o.pathnameBase:"/",c=o&&o.route;{let b=c&&c.path||"";ba(l,!c||b.endsWith("*")||b.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${l}" (under <Route path="${b}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
41
41
|
|
|
42
|
-
Please change the parent <Route path="${g}"> to <Route path="${g==="/"?"*":`${g}/*`}">.`)}let f=Yt(),m;m=f;let d=m.pathname||"/",p=d;if(u!=="/"){let g=u.replace(/^\//,"").split("/");p="/"+d.replace(/^\//,"").split("/").slice(g.length).join("/")}let v=gs(e,{pathname:p});return Ct(c||v!=null,`No routes matched location "${m.pathname}${m.search}${m.hash}" `),Ct(v==null||v[v.length-1].route.element!==void 0||v[v.length-1].route.Component!==void 0||v[v.length-1].route.lazy!==void 0,`Matched leaf route at location "${m.pathname}${m.search}${m.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`),lf(v&&v.map(g=>Object.assign({},g,{params:Object.assign({},l,g.params),pathname:Ft([u,i.encodeLocation?i.encodeLocation(g.pathname).pathname:g.pathname]),pathnameBase:g.pathnameBase==="/"?u:Ft([u,i.encodeLocation?i.encodeLocation(g.pathnameBase).pathname:g.pathnameBase])})),o,n,r)}function rf(){let e=pf(),t=Gc(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",i={padding:"0.5rem",backgroundColor:r},o={padding:"2px 4px",backgroundColor:r},s=null;return console.error("Error handled by React Router default ErrorBoundary:",e),s=k.createElement(k.Fragment,null,k.createElement("p",null,"💿 Hey developer 👋"),k.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",k.createElement("code",{style:o},"ErrorBoundary")," or"," ",k.createElement("code",{style:o},"errorElement")," prop on your route.")),k.createElement(k.Fragment,null,k.createElement("h2",null,"Unexpected Application Error!"),k.createElement("h3",{style:{fontStyle:"italic"}},t),n?k.createElement("pre",{style:i},n):null,s)}var of=k.createElement(rf,null),sf=class extends k.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return this.state.error!==void 0?k.createElement($t.Provider,{value:this.props.routeContext},k.createElement(vi.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function af({routeContext:e,match:t,children:n}){let r=k.useContext(mn);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),k.createElement($t.Provider,{value:e},n)}function lf(e,t=[],n=null,r=null){if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let i=e,o=n==null?void 0:n.errors;if(o!=null){let a=i.findIndex(u=>u.route.id&&(o==null?void 0:o[u.route.id])!==void 0);Le(a>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(",")}`),i=i.slice(0,Math.min(i.length,a+1))}let s=!1,l=-1;if(n)for(let a=0;a<i.length;a++){let u=i[a];if((u.route.HydrateFallback||u.route.hydrateFallbackElement)&&(l=a),u.route.id){let{loaderData:c,errors:f}=n,m=u.route.loader&&!c.hasOwnProperty(u.route.id)&&(!f||f[u.route.id]===void 0);if(u.route.lazy||m){s=!0,l>=0?i=i.slice(0,l+1):i=[i[0]];break}}}return i.reduceRight((a,u,c)=>{let f,m=!1,d=null,p=null;n&&(f=o&&u.route.id?o[u.route.id]:void 0,d=u.route.errorElement||of,s&&(l<0&&c===0?(Fs("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),m=!0,p=null):l===c&&(m=!0,p=u.route.hydrateFallbackElement||null)));let v=t.concat(i.slice(0,c+1)),b=()=>{let g;return f?g=d:m?g=p:u.route.Component?g=k.createElement(u.route.Component,null):u.route.element?g=u.route.element:g=a,k.createElement(af,{match:u,routeContext:{outlet:a,matches:v,isDataRoute:n!=null},children:g})};return n&&(u.route.ErrorBoundary||u.route.errorElement||c===0)?k.createElement(sf,{location:n.location,revalidation:n.revalidation,component:d,error:f,children:b(),routeContext:{outlet:null,matches:v,isDataRoute:!0}}):b()},null)}function bi(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function uf(e){let t=k.useContext(mn);return Le(t,bi(e)),t}function cf(e){let t=k.useContext(vr);return Le(t,bi(e)),t}function ff(e){let t=k.useContext($t);return Le(t,bi(e)),t}function xi(e){let t=ff(e),n=t.matches[t.matches.length-1];return Le(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function df(){return xi("useRouteId")}function pf(){var r;let e=k.useContext(vi),t=cf("useRouteError"),n=xi("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function hf(){let{router:e}=uf("useNavigate"),t=xi("useNavigate"),n=k.useRef(!1);return _s(()=>{n.current=!0}),k.useCallback(async(i,o={})=>{Ct(n.current,Ss),n.current&&(typeof i=="number"?e.navigate(i):await e.navigate(i,{fromRouteId:t,...o}))},[e,t])}var Cs={};function Fs(e,t,n){!t&&!Cs[e]&&(Cs[e]=!0,Ct(!1,n))}k.memo(mf);function mf({routes:e,future:t,state:n}){return nf(e,void 0,n,t)}var xr="get",wr="application/x-www-form-urlencoded";function Er(e){return e!=null&&typeof e.tagName=="string"}function gf(e){return Er(e)&&e.tagName.toLowerCase()==="button"}function yf(e){return Er(e)&&e.tagName.toLowerCase()==="form"}function vf(e){return Er(e)&&e.tagName.toLowerCase()==="input"}function bf(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function xf(e,t){return e.button===0&&(!t||t==="_self")&&!bf(e)}var Tr=null;function wf(){if(Tr===null)try{new FormData(document.createElement("form"),0),Tr=!1}catch{Tr=!0}return Tr}var Ef=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function wi(e){return e!=null&&!Ef.has(e)?(Ct(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${wr}"`),null):e}function Tf(e,t){let n,r,i,o,s;if(yf(e)){let l=e.getAttribute("action");r=l?Kt(l,t):null,n=e.getAttribute("method")||xr,i=wi(e.getAttribute("enctype"))||wr,o=new FormData(e)}else if(gf(e)||vf(e)&&(e.type==="submit"||e.type==="image")){let l=e.form;if(l==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let a=e.getAttribute("formaction")||l.getAttribute("action");if(r=a?Kt(a,t):null,n=e.getAttribute("formmethod")||l.getAttribute("method")||xr,i=wi(e.getAttribute("formenctype"))||wi(l.getAttribute("enctype"))||wr,o=new FormData(l,e),!wf()){let{name:u,type:c,value:f}=e;if(c==="image"){let m=u?`${u}.`:"";o.append(`${m}x`,"0"),o.append(`${m}y`,"0")}else u&&o.append(u,f)}}else{if(Er(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=xr,r=null,i=wr,s=e}return o&&i==="text/plain"&&(s=o,o=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:o,body:s}}function Ei(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}async function Sf(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function _f(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function Cf(e,t,n){let r=await Promise.all(e.map(async i=>{let o=t.routes[i.route.id];if(o){let s=await Sf(o,n);return s.links?s.links():[]}return[]}));return Of(r.flat(1).filter(_f).filter(i=>i.rel==="stylesheet"||i.rel==="preload").map(i=>i.rel==="stylesheet"?{...i,rel:"prefetch",as:"style"}:{...i,rel:"prefetch"}))}function ks(e,t,n,r,i,o){let s=(a,u)=>n[u]?a.route.id!==n[u].route.id:!0,l=(a,u)=>{var c;return n[u].pathname!==a.pathname||((c=n[u].route.path)==null?void 0:c.endsWith("*"))&&n[u].params["*"]!==a.params["*"]};return o==="assets"?t.filter((a,u)=>s(a,u)||l(a,u)):o==="data"?t.filter((a,u)=>{var f;let c=r.routes[a.route.id];if(!c||!c.hasLoader)return!1;if(s(a,u)||l(a,u))return!0;if(a.route.shouldRevalidate){let m=a.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:((f=n[0])==null?void 0:f.params)||{},nextUrl:new URL(e,window.origin),nextParams:a.params,defaultShouldRevalidate:!0});if(typeof m=="boolean")return m}return!0}):[]}function Ff(e,t){return kf(e.map(n=>{let r=t.routes[n.route.id];if(!r)return[];let i=[r.module];return r.imports&&(i=i.concat(r.imports)),i}).flat(1))}function kf(e){return[...new Set(e)]}function $f(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function Of(e,t){let n=new Set;return new Set(t),e.reduce((r,i)=>{let o=JSON.stringify($f(i));return n.has(o)||(n.add(o),r.push({key:o,link:i})),r},[])}function Af(e){let t=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return t.pathname==="/"?t.pathname="_root.data":t.pathname=`${t.pathname.replace(/\/$/,"")}.data`,t}function Df(){let e=k.useContext(mn);return Ei(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function Lf(){let e=k.useContext(vr);return Ei(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Ti=k.createContext(void 0);Ti.displayName="FrameworkContext";function $s(){let e=k.useContext(Ti);return Ei(e,"You must render this element inside a <HydratedRouter> element"),e}function Pf(e,t){let n=k.useContext(Ti),[r,i]=k.useState(!1),[o,s]=k.useState(!1),{onFocus:l,onBlur:a,onMouseEnter:u,onMouseLeave:c,onTouchStart:f}=t,m=k.useRef(null);k.useEffect(()=>{if(e==="render"&&s(!0),e==="viewport"){let v=g=>{g.forEach(y=>{s(y.isIntersecting)})},b=new IntersectionObserver(v,{threshold:.5});return m.current&&b.observe(m.current),()=>{b.disconnect()}}},[e]),k.useEffect(()=>{if(r){let v=setTimeout(()=>{s(!0)},100);return()=>{clearTimeout(v)}}},[r]);let d=()=>{i(!0)},p=()=>{i(!1),s(!1)};return n?e!=="intent"?[o,m,{}]:[o,m,{onFocus:Pn(l,d),onBlur:Pn(a,p),onMouseEnter:Pn(u,d),onMouseLeave:Pn(c,p),onTouchStart:Pn(f,d)}]:[!1,m,{}]}function Pn(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function jf({page:e,...t}){let{router:n}=Df(),r=k.useMemo(()=>gs(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?k.createElement(If,{page:e,matches:r,...t}):null}function Nf(e){let{manifest:t,routeModules:n}=$s(),[r,i]=k.useState([]);return k.useEffect(()=>{let o=!1;return Cf(e,t,n).then(s=>{o||i(s)}),()=>{o=!0}},[e,t,n]),r}function If({page:e,matches:t,...n}){let r=Yt(),{manifest:i,routeModules:o}=$s(),{loaderData:s,matches:l}=Lf(),a=k.useMemo(()=>ks(e,t,l,i,r,"data"),[e,t,l,i,r]),u=k.useMemo(()=>ks(e,t,l,i,r,"assets"),[e,t,l,i,r]),c=k.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let d=new Set,p=!1;if(t.forEach(b=>{var y;let g=i.routes[b.route.id];!g||!g.hasLoader||(!a.some(x=>x.route.id===b.route.id)&&b.route.id in s&&((y=o[b.route.id])!=null&&y.shouldRevalidate)||g.hasClientLoader?p=!0:d.add(b.route.id))}),d.size===0)return[];let v=Af(e);return p&&d.size>0&&v.searchParams.set("_routes",t.filter(b=>d.has(b.route.id)).map(b=>b.route.id).join(",")),[v.pathname+v.search]},[s,r,i,a,t,e,o]),f=k.useMemo(()=>Ff(u,i),[u,i]),m=Nf(u);return k.createElement(k.Fragment,null,c.map(d=>k.createElement("link",{key:d,rel:"prefetch",as:"fetch",href:d,...n})),f.map(d=>k.createElement("link",{key:d,rel:"modulepreload",href:d,...n})),m.map(({key:d,link:p})=>k.createElement("link",{key:d,...p})))}function Mf(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var Os=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Os&&(window.__reactRouterVersion="7.1.1")}catch{}var As=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Si=k.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:i,reloadDocument:o,replace:s,state:l,target:a,to:u,preventScrollReset:c,viewTransition:f,...m},d){let{basename:p}=k.useContext(kt),v=typeof u=="string"&&As.test(u),b,g=!1;if(typeof u=="string"&&v&&(b=u,Os))try{let L=new URL(window.location.href),j=u.startsWith("//")?new URL(L.protocol+u):new URL(u),D=Kt(j.pathname,p);j.origin===L.origin&&D!=null?u=D+j.search+j.hash:g=!0}catch{Ct(!1,`<Link to="${u}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let y=Zc(u,{relative:i}),[x,_,$]=Pf(r,m),S=Uf(u,{replace:s,state:l,target:a,preventScrollReset:c,relative:i,viewTransition:f});function C(L){t&&t(L),L.defaultPrevented||S(L)}let A=k.createElement("a",{...m,...$,href:b||y,onClick:g||o?t:C,ref:Mf(d,_),target:a,"data-discover":!v&&n==="render"?"true":void 0});return x&&!v?k.createElement(k.Fragment,null,A,k.createElement(jf,{page:y})):A});Si.displayName="Link";var Vf=k.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:i=!1,style:o,to:s,viewTransition:l,children:a,...u},c){let f=Ln(s,{relative:u.relative}),m=Yt(),d=k.useContext(vr),{navigator:p,basename:v}=k.useContext(kt),b=d!=null&&Kf(f)&&l===!0,g=p.encodeLocation?p.encodeLocation(f).pathname:f.pathname,y=m.pathname,x=d&&d.navigation&&d.navigation.location?d.navigation.location.pathname:null;n||(y=y.toLowerCase(),x=x?x.toLowerCase():null,g=g.toLowerCase()),x&&v&&(x=Kt(x,v)||x);const _=g!=="/"&&g.endsWith("/")?g.length-1:g.length;let $=y===g||!i&&y.startsWith(g)&&y.charAt(_)==="/",S=x!=null&&(x===g||!i&&x.startsWith(g)&&x.charAt(g.length)==="/"),C={isActive:$,isPending:S,isTransitioning:b},A=$?t:void 0,L;typeof r=="function"?L=r(C):L=[r,$?"active":null,S?"pending":null,b?"transitioning":null].filter(Boolean).join(" ");let j=typeof o=="function"?o(C):o;return k.createElement(Si,{...u,"aria-current":A,className:L,ref:c,style:j,to:s,viewTransition:l},typeof a=="function"?a(C):a)});Vf.displayName="NavLink";var Rf=k.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:o,method:s=xr,action:l,onSubmit:a,relative:u,preventScrollReset:c,viewTransition:f,...m},d)=>{let p=zf(),v=Wf(l,{relative:u}),b=s.toLowerCase()==="get"?"get":"post",g=typeof l=="string"&&As.test(l),y=x=>{if(a&&a(x),x.defaultPrevented)return;x.preventDefault();let _=x.nativeEvent.submitter,$=(_==null?void 0:_.getAttribute("formmethod"))||s;p(_||x.currentTarget,{fetcherKey:t,method:$,navigate:n,replace:i,state:o,relative:u,preventScrollReset:c,viewTransition:f})};return k.createElement("form",{ref:d,method:b,action:v,onSubmit:r?a:y,...m,"data-discover":!g&&e==="render"?"true":void 0})});Rf.displayName="Form";function Bf(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Ds(e){let t=k.useContext(mn);return Le(t,Bf(e)),t}function Uf(e,{target:t,replace:n,state:r,preventScrollReset:i,relative:o,viewTransition:s}={}){let l=ef(),a=Yt(),u=Ln(e,{relative:o});return k.useCallback(c=>{if(xf(c,t)){c.preventDefault();let f=n!==void 0?n:hi(a)===hi(u);l(e,{replace:f,state:r,preventScrollReset:i,relative:o,viewTransition:s})}},[a,l,u,n,r,t,e,i,o,s])}var Hf=0,qf=()=>`__${String(++Hf)}__`;function zf(){let{router:e}=Ds("useSubmit"),{basename:t}=k.useContext(kt),n=df();return k.useCallback(async(r,i={})=>{let{action:o,method:s,encType:l,formData:a,body:u}=Tf(r,t);if(i.navigate===!1){let c=i.fetcherKey||qf();await e.fetch(c,n,i.action||o,{preventScrollReset:i.preventScrollReset,formData:a,body:u,formMethod:i.method||s,formEncType:i.encType||l,flushSync:i.flushSync})}else await e.navigate(i.action||o,{preventScrollReset:i.preventScrollReset,formData:a,body:u,formMethod:i.method||s,formEncType:i.encType||l,replace:i.replace,state:i.state,fromRouteId:n,flushSync:i.flushSync,viewTransition:i.viewTransition})},[e,t,n])}function Wf(e,{relative:t}={}){let{basename:n}=k.useContext(kt),r=k.useContext($t);Le(r,"useFormAction must be used inside a RouteContext");let[i]=r.matches.slice(-1),o={...Ln(e||".",{relative:t})},s=Yt();if(e==null){o.search=s.search;let l=new URLSearchParams(o.search),a=l.getAll("index");if(a.some(c=>c==="")){l.delete("index"),a.filter(f=>f).forEach(f=>l.append("index",f));let c=l.toString();o.search=c?`?${c}`:""}}return(!e||e===".")&&i.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(o.pathname=o.pathname==="/"?n:Ft([n,o.pathname])),hi(o)}function Kf(e,t={}){let n=k.useContext(Ts);Le(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=Ds("useViewTransitionState"),i=Ln(e,{relative:t.relative});if(!n.isTransitioning)return!1;let o=Kt(n.currentLocation.pathname,r)||n.currentLocation.pathname,s=Kt(n.nextLocation.pathname,r)||n.nextLocation.pathname;return yr(i.pathname,s)!=null||yr(i.pathname,o)!=null}new TextEncoder;const Ls=Object.freeze({left:0,top:0,width:16,height:16}),Sr=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),_i=Object.freeze({...Ls,...Sr}),Ci=Object.freeze({..._i,body:"",hidden:!1});function Yf(e,t){const n={};!e.hFlip!=!t.hFlip&&(n.hFlip=!0),!e.vFlip!=!t.vFlip&&(n.vFlip=!0);const r=((e.rotate||0)+(t.rotate||0))%4;return r&&(n.rotate=r),n}function Ps(e,t){const n=Yf(e,t);for(const r in Ci)r in Sr?r in e&&!(r in n)&&(n[r]=Sr[r]):r in t?n[r]=t[r]:r in e&&(n[r]=e[r]);return n}function Gf(e,t){const n=e.icons,r=e.aliases||Object.create(null),i=Object.create(null);function o(s){if(n[s])return i[s]=[];if(!(s in i)){i[s]=null;const l=r[s]&&r[s].parent,a=l&&o(l);a&&(i[s]=[l].concat(a))}return i[s]}return Object.keys(n).concat(Object.keys(r)).forEach(o),i}function Xf(e,t,n){const r=e.icons,i=e.aliases||Object.create(null);let o={};function s(l){o=Ps(r[l]||i[l],o)}return s(t),n.forEach(s),Ps(e,o)}function js(e,t){const n=[];if(typeof e!="object"||typeof e.icons!="object")return n;e.not_found instanceof Array&&e.not_found.forEach(i=>{t(i,null),n.push(i)});const r=Gf(e);for(const i in r){const o=r[i];o&&(t(i,Xf(e,i,o)),n.push(i))}return n}const Jf={provider:"",aliases:{},not_found:{},...Ls};function Fi(e,t){for(const n in t)if(n in e&&typeof e[n]!=typeof t[n])return!1;return!0}function Ns(e){if(typeof e!="object"||e===null)return null;const t=e;if(typeof t.prefix!="string"||!e.icons||typeof e.icons!="object"||!Fi(e,Jf))return null;const n=t.icons;for(const i in n){const o=n[i];if(!i||typeof o.body!="string"||!Fi(o,Ci))return null}const r=t.aliases||Object.create(null);for(const i in r){const o=r[i],s=o.parent;if(!i||typeof s!="string"||!n[s]&&!r[s]||!Fi(o,Ci))return null}return t}const Is=/^[a-z0-9]+(-[a-z0-9]+)*$/,_r=(e,t,n,r="")=>{const i=e.split(":");if(e.slice(0,1)==="@"){if(i.length<2||i.length>3)return null;r=i.shift().slice(1)}if(i.length>3||!i.length)return null;if(i.length>1){const l=i.pop(),a=i.pop(),u={provider:i.length>0?i[0]:r,prefix:a,name:l};return t&&!Cr(u)?null:u}const o=i[0],s=o.split("-");if(s.length>1){const l={provider:r,prefix:s.shift(),name:s.join("-")};return t&&!Cr(l)?null:l}if(n&&r===""){const l={provider:r,prefix:"",name:o};return t&&!Cr(l,n)?null:l}return null},Cr=(e,t)=>e?!!((t&&e.prefix===""||e.prefix)&&e.name):!1,Ms=Object.create(null);function Qf(e,t){return{provider:e,prefix:t,icons:Object.create(null),missing:new Set}}function Gt(e,t){const n=Ms[e]||(Ms[e]=Object.create(null));return n[t]||(n[t]=Qf(e,t))}function ki(e,t){return Ns(t)?js(t,(n,r)=>{r?e.icons[n]=r:e.missing.add(n)}):[]}function Zf(e,t,n){try{if(typeof n.body=="string")return e.icons[t]={...n},!0}catch{}return!1}let jn=!1;function Vs(e){return typeof e=="boolean"&&(jn=e),jn}function Rs(e){const t=typeof e=="string"?_r(e,!0,jn):e;if(t){const n=Gt(t.provider,t.prefix),r=t.name;return n.icons[r]||(n.missing.has(r)?null:void 0)}}function ed(e,t){const n=_r(e,!0,jn);if(!n)return!1;const r=Gt(n.provider,n.prefix);return t?Zf(r,n.name,t):(r.missing.add(n.name),!0)}function td(e,t){if(typeof e!="object")return!1;if(typeof t!="string"&&(t=e.provider||""),jn&&!t&&!e.prefix){let i=!1;return Ns(e)&&(e.prefix="",js(e,(o,s)=>{ed(o,s)&&(i=!0)})),i}const n=e.prefix;if(!Cr({provider:t,prefix:n,name:"a"}))return!1;const r=Gt(t,n);return!!ki(r,e)}const Bs=Object.freeze({width:null,height:null}),Us=Object.freeze({...Bs,...Sr}),nd=/(-?[0-9.]*[0-9]+[0-9.]*)/g,rd=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function Hs(e,t,n){if(t===1)return e;if(n=n||100,typeof e=="number")return Math.ceil(e*t*n)/n;if(typeof e!="string")return e;const r=e.split(nd);if(r===null||!r.length)return e;const i=[];let o=r.shift(),s=rd.test(o);for(;;){if(s){const l=parseFloat(o);isNaN(l)?i.push(o):i.push(Math.ceil(l*t*n)/n)}else i.push(o);if(o=r.shift(),o===void 0)return i.join("");s=!s}}function id(e,t="defs"){let n="";const r=e.indexOf("<"+t);for(;r>=0;){const i=e.indexOf(">",r),o=e.indexOf("</"+t);if(i===-1||o===-1)break;const s=e.indexOf(">",o);if(s===-1)break;n+=e.slice(i+1,o).trim(),e=e.slice(0,r).trim()+e.slice(s+1)}return{defs:n,content:e}}function od(e,t){return e?"<defs>"+e+"</defs>"+t:t}function sd(e,t,n){const r=id(e);return od(r.defs,t+r.content+n)}const ad=e=>e==="unset"||e==="undefined"||e==="none";function ld(e,t){const n={..._i,...e},r={...Us,...t},i={left:n.left,top:n.top,width:n.width,height:n.height};let o=n.body;[n,r].forEach(v=>{const b=[],g=v.hFlip,y=v.vFlip;let x=v.rotate;g?y?x+=2:(b.push("translate("+(i.width+i.left).toString()+" "+(0-i.top).toString()+")"),b.push("scale(-1 1)"),i.top=i.left=0):y&&(b.push("translate("+(0-i.left).toString()+" "+(i.height+i.top).toString()+")"),b.push("scale(1 -1)"),i.top=i.left=0);let _;switch(x<0&&(x-=Math.floor(x/4)*4),x=x%4,x){case 1:_=i.height/2+i.top,b.unshift("rotate(90 "+_.toString()+" "+_.toString()+")");break;case 2:b.unshift("rotate(180 "+(i.width/2+i.left).toString()+" "+(i.height/2+i.top).toString()+")");break;case 3:_=i.width/2+i.left,b.unshift("rotate(-90 "+_.toString()+" "+_.toString()+")");break}x%2===1&&(i.left!==i.top&&(_=i.left,i.left=i.top,i.top=_),i.width!==i.height&&(_=i.width,i.width=i.height,i.height=_)),b.length&&(o=sd(o,'<g transform="'+b.join(" ")+'">',"</g>"))});const s=r.width,l=r.height,a=i.width,u=i.height;let c,f;s===null?(f=l===null?"1em":l==="auto"?u:l,c=Hs(f,a/u)):(c=s==="auto"?a:s,f=l===null?Hs(c,u/a):l==="auto"?u:l);const m={},d=(v,b)=>{ad(b)||(m[v]=b.toString())};d("width",c),d("height",f);const p=[i.left,i.top,a,u];return m.viewBox=p.join(" "),{attributes:m,viewBox:p,body:o}}const ud=/\sid="(\S+)"/g,cd="IconifyId"+Date.now().toString(16)+(Math.random()*16777216|0).toString(16);let fd=0;function dd(e,t=cd){const n=[];let r;for(;r=ud.exec(e);)n.push(r[1]);if(!n.length)return e;const i="suffix"+(Math.random()*16777216|Date.now()).toString(16);return n.forEach(o=>{const s=typeof t=="function"?t(o):t+(fd++).toString(),l=o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");e=e.replace(new RegExp('([#;"])('+l+')([")]|\\.[a-z])',"g"),"$1"+s+i+"$3")}),e=e.replace(new RegExp(i,"g"),""),e}const $i=Object.create(null);function pd(e,t){$i[e]=t}function Oi(e){return $i[e]||$i[""]}function Ai(e){let t;if(typeof e.resources=="string")t=[e.resources];else if(t=e.resources,!(t instanceof Array)||!t.length)return null;return{resources:t,path:e.path||"/",maxURL:e.maxURL||500,rotate:e.rotate||750,timeout:e.timeout||5e3,random:e.random===!0,index:e.index||0,dataAfterTimeout:e.dataAfterTimeout!==!1}}const Di=Object.create(null),Nn=["https://api.simplesvg.com","https://api.unisvg.com"],Fr=[];for(;Nn.length>0;)Nn.length===1||Math.random()>.5?Fr.push(Nn.shift()):Fr.push(Nn.pop());Di[""]=Ai({resources:["https://api.iconify.design"].concat(Fr)});function hd(e,t){const n=Ai(t);return n===null?!1:(Di[e]=n,!0)}function Li(e){return Di[e]}let qs=(()=>{let e;try{if(e=fetch,typeof e=="function")return e}catch{}})();function md(e,t){const n=Li(e);if(!n)return 0;let r;if(!n.maxURL)r=0;else{let i=0;n.resources.forEach(s=>{i=Math.max(i,s.length)});const o=t+".json?icons=";r=n.maxURL-i-n.path.length-o.length}return r}function gd(e){return e===404}const yd=(e,t,n)=>{const r=[],i=md(e,t),o="icons";let s={type:o,provider:e,prefix:t,icons:[]},l=0;return n.forEach((a,u)=>{l+=a.length+1,l>=i&&u>0&&(r.push(s),s={type:o,provider:e,prefix:t,icons:[]},l=a.length),s.icons.push(a)}),r.push(s),r};function vd(e){if(typeof e=="string"){const t=Li(e);if(t)return t.path}return"/"}const bd={prepare:yd,send:(e,t,n)=>{if(!qs){n("abort",424);return}let r=vd(t.provider);switch(t.type){case"icons":{const o=t.prefix,l=t.icons.join(","),a=new URLSearchParams({icons:l});r+=o+".json?"+a.toString();break}case"custom":{const o=t.uri;r+=o.slice(0,1)==="/"?o.slice(1):o;break}default:n("abort",400);return}let i=503;qs(e+r).then(o=>{const s=o.status;if(s!==200){setTimeout(()=>{n(gd(s)?"abort":"next",s)});return}return i=501,o.json()}).then(o=>{if(typeof o!="object"||o===null){setTimeout(()=>{o===404?n("abort",o):n("next",i)});return}setTimeout(()=>{n("success",o)})}).catch(()=>{n("next",i)})}};function xd(e){const t={loaded:[],missing:[],pending:[]},n=Object.create(null);e.sort((i,o)=>i.provider!==o.provider?i.provider.localeCompare(o.provider):i.prefix!==o.prefix?i.prefix.localeCompare(o.prefix):i.name.localeCompare(o.name));let r={provider:"",prefix:"",name:""};return e.forEach(i=>{if(r.name===i.name&&r.prefix===i.prefix&&r.provider===i.provider)return;r=i;const o=i.provider,s=i.prefix,l=i.name,a=n[o]||(n[o]=Object.create(null)),u=a[s]||(a[s]=Gt(o,s));let c;l in u.icons?c=t.loaded:s===""||u.missing.has(l)?c=t.missing:c=t.pending;const f={provider:o,prefix:s,name:l};c.push(f)}),t}function zs(e,t){e.forEach(n=>{const r=n.loaderCallbacks;r&&(n.loaderCallbacks=r.filter(i=>i.id!==t))})}function wd(e){e.pendingCallbacksFlag||(e.pendingCallbacksFlag=!0,setTimeout(()=>{e.pendingCallbacksFlag=!1;const t=e.loaderCallbacks?e.loaderCallbacks.slice(0):[];if(!t.length)return;let n=!1;const r=e.provider,i=e.prefix;t.forEach(o=>{const s=o.icons,l=s.pending.length;s.pending=s.pending.filter(a=>{if(a.prefix!==i)return!0;const u=a.name;if(e.icons[u])s.loaded.push({provider:r,prefix:i,name:u});else if(e.missing.has(u))s.missing.push({provider:r,prefix:i,name:u});else return n=!0,!0;return!1}),s.pending.length!==l&&(n||zs([e],o.id),o.callback(s.loaded.slice(0),s.missing.slice(0),s.pending.slice(0),o.abort))})}))}let Ed=0;function Td(e,t,n){const r=Ed++,i=zs.bind(null,n,r);if(!t.pending.length)return i;const o={id:r,icons:t,callback:e,abort:i};return n.forEach(s=>{(s.loaderCallbacks||(s.loaderCallbacks=[])).push(o)}),i}function Sd(e,t=!0,n=!1){const r=[];return e.forEach(i=>{const o=typeof i=="string"?_r(i,t,n):i;o&&r.push(o)}),r}var _d={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function Cd(e,t,n,r){const i=e.resources.length,o=e.random?Math.floor(Math.random()*i):e.index;let s;if(e.random){let S=e.resources.slice(0);for(s=[];S.length>1;){const C=Math.floor(Math.random()*S.length);s.push(S[C]),S=S.slice(0,C).concat(S.slice(C+1))}s=s.concat(S)}else s=e.resources.slice(o).concat(e.resources.slice(0,o));const l=Date.now();let a="pending",u=0,c,f=null,m=[],d=[];typeof r=="function"&&d.push(r);function p(){f&&(clearTimeout(f),f=null)}function v(){a==="pending"&&(a="aborted"),p(),m.forEach(S=>{S.status==="pending"&&(S.status="aborted")}),m=[]}function b(S,C){C&&(d=[]),typeof S=="function"&&d.push(S)}function g(){return{startTime:l,payload:t,status:a,queriesSent:u,queriesPending:m.length,subscribe:b,abort:v}}function y(){a="failed",d.forEach(S=>{S(void 0,c)})}function x(){m.forEach(S=>{S.status==="pending"&&(S.status="aborted")}),m=[]}function _(S,C,A){const L=C!=="success";switch(m=m.filter(j=>j!==S),a){case"pending":break;case"failed":if(L||!e.dataAfterTimeout)return;break;default:return}if(C==="abort"){c=A,y();return}if(L){c=A,m.length||(s.length?$():y());return}if(p(),x(),!e.random){const j=e.resources.indexOf(S.resource);j!==-1&&j!==e.index&&(e.index=j)}a="completed",d.forEach(j=>{j(A)})}function $(){if(a!=="pending")return;p();const S=s.shift();if(S===void 0){if(m.length){f=setTimeout(()=>{p(),a==="pending"&&(x(),y())},e.timeout);return}y();return}const C={status:"pending",resource:S,callback:(A,L)=>{_(C,A,L)}};m.push(C),u++,f=setTimeout($,e.rotate),n(S,t,C.callback)}return setTimeout($),g}function Ws(e){const t={..._d,...e};let n=[];function r(){n=n.filter(l=>l().status==="pending")}function i(l,a,u){const c=Cd(t,l,a,(f,m)=>{r(),u&&u(f,m)});return n.push(c),c}function o(l){return n.find(a=>l(a))||null}return{query:i,find:o,setIndex:l=>{t.index=l},getIndex:()=>t.index,cleanup:r}}function Ks(){}const Pi=Object.create(null);function Fd(e){if(!Pi[e]){const t=Li(e);if(!t)return;const n=Ws(t),r={config:t,redundancy:n};Pi[e]=r}return Pi[e]}function kd(e,t,n){let r,i;if(typeof e=="string"){const o=Oi(e);if(!o)return n(void 0,424),Ks;i=o.send;const s=Fd(e);s&&(r=s.redundancy)}else{const o=Ai(e);if(o){r=Ws(o);const s=e.resources?e.resources[0]:"",l=Oi(s);l&&(i=l.send)}}return!r||!i?(n(void 0,424),Ks):r.query(t,i,n)().abort}const Ys="iconify2",In="iconify",Gs=In+"-count",Xs=In+"-version",Js=36e5,$d=168,Od=50;function ji(e,t){try{return e.getItem(t)}catch{}}function Ni(e,t,n){try{return e.setItem(t,n),!0}catch{}}function Qs(e,t){try{e.removeItem(t)}catch{}}function Ii(e,t){return Ni(e,Gs,t.toString())}function Mi(e){return parseInt(ji(e,Gs))||0}const kr={local:!0,session:!0},Zs={local:new Set,session:new Set};let Vi=!1;function Ad(e){Vi=e}let $r=typeof window>"u"?{}:window;function ea(e){const t=e+"Storage";try{if($r&&$r[t]&&typeof $r[t].length=="number")return $r[t]}catch{}kr[e]=!1}function ta(e,t){const n=ea(e);if(!n)return;const r=ji(n,Xs);if(r!==Ys){if(r){const l=Mi(n);for(let a=0;a<l;a++)Qs(n,In+a.toString())}Ni(n,Xs,Ys),Ii(n,0);return}const i=Math.floor(Date.now()/Js)-$d,o=l=>{const a=In+l.toString(),u=ji(n,a);if(typeof u=="string"){try{const c=JSON.parse(u);if(typeof c=="object"&&typeof c.cached=="number"&&c.cached>i&&typeof c.provider=="string"&&typeof c.data=="object"&&typeof c.data.prefix=="string"&&t(c,l))return!0}catch{}Qs(n,a)}};let s=Mi(n);for(let l=s-1;l>=0;l--)o(l)||(l===s-1?(s--,Ii(n,s)):Zs[e].add(l))}function na(){if(!Vi){Ad(!0);for(const e in kr)ta(e,t=>{const n=t.data,r=t.provider,i=n.prefix,o=Gt(r,i);if(!ki(o,n).length)return!1;const s=n.lastModified||-1;return o.lastModifiedCached=o.lastModifiedCached?Math.min(o.lastModifiedCached,s):s,!0})}}function Dd(e,t){const n=e.lastModifiedCached;if(n&&n>=t)return n===t;if(e.lastModifiedCached=t,n)for(const r in kr)ta(r,i=>{const o=i.data;return i.provider!==e.provider||o.prefix!==e.prefix||o.lastModified===t});return!0}function Ld(e,t){Vi||na();function n(r){let i;if(!kr[r]||!(i=ea(r)))return;const o=Zs[r];let s;if(o.size)o.delete(s=Array.from(o).shift());else if(s=Mi(i),s>=Od||!Ii(i,s+1))return;const l={cached:Math.floor(Date.now()/Js),provider:e.provider,data:t};return Ni(i,In+s.toString(),JSON.stringify(l))}t.lastModified&&!Dd(e,t.lastModified)||Object.keys(t.icons).length&&(t.not_found&&(t=Object.assign({},t),delete t.not_found),n("local")||n("session"))}function ra(){}function Pd(e){e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout(()=>{e.iconsLoaderFlag=!1,wd(e)}))}function jd(e){const t=[],n=[];return e.forEach(r=>{(r.match(Is)?t:n).push(r)}),{valid:t,invalid:n}}function Mn(e,t,n,r){function i(){const o=e.pendingIcons;t.forEach(s=>{o&&o.delete(s),e.icons[s]||e.missing.add(s)})}if(n&&typeof n=="object")try{if(!ki(e,n).length){i();return}r&&Ld(e,n)}catch(o){console.error(o)}i(),Pd(e)}function ia(e,t){e instanceof Promise?e.then(n=>{t(n)}).catch(()=>{t(null)}):t(e)}function Nd(e,t){e.iconsToLoad?e.iconsToLoad=e.iconsToLoad.concat(t).sort():e.iconsToLoad=t,e.iconsQueueFlag||(e.iconsQueueFlag=!0,setTimeout(()=>{e.iconsQueueFlag=!1;const{provider:n,prefix:r}=e,i=e.iconsToLoad;if(delete e.iconsToLoad,!i||!i.length)return;const o=e.loadIcon;if(e.loadIcons&&(i.length>1||!o)){ia(e.loadIcons(i,r,n),c=>{Mn(e,i,c,!1)});return}if(o){i.forEach(c=>{const f=o(c,r,n);ia(f,m=>{const d=m?{prefix:r,icons:{[c]:m}}:null;Mn(e,[c],d,!1)})});return}const{valid:s,invalid:l}=jd(i);if(l.length&&Mn(e,l,null,!1),!s.length)return;const a=r.match(Is)?Oi(n):null;if(!a){Mn(e,s,null,!1);return}a.prepare(n,r,s).forEach(c=>{kd(n,c,f=>{Mn(e,c.icons,f,!0)})})}))}const Id=(e,t)=>{const n=Sd(e,!0,Vs()),r=xd(n);if(!r.pending.length){let a=!0;return t&&setTimeout(()=>{a&&t(r.loaded,r.missing,r.pending,ra)}),()=>{a=!1}}const i=Object.create(null),o=[];let s,l;return r.pending.forEach(a=>{const{provider:u,prefix:c}=a;if(c===l&&u===s)return;s=u,l=c,o.push(Gt(u,c));const f=i[u]||(i[u]=Object.create(null));f[c]||(f[c]=[])}),r.pending.forEach(a=>{const{provider:u,prefix:c,name:f}=a,m=Gt(u,c),d=m.pendingIcons||(m.pendingIcons=new Set);d.has(f)||(d.add(f),i[u][c].push(f))}),o.forEach(a=>{const u=i[a.provider][a.prefix];u.length&&Nd(a,u)}),t?Td(t,r,o):ra};function Md(e,t){const n={...e};for(const r in t){const i=t[r],o=typeof i;r in Bs?(i===null||i&&(o==="string"||o==="number"))&&(n[r]=i):o===typeof n[r]&&(n[r]=r==="rotate"?i%4:i)}return n}const Vd=/[\s,]+/;function Rd(e,t){t.split(Vd).forEach(n=>{switch(n.trim()){case"horizontal":e.hFlip=!0;break;case"vertical":e.vFlip=!0;break}})}function Bd(e,t=0){const n=e.replace(/^-?[0-9.]*/,"");function r(i){for(;i<0;)i+=4;return i%4}if(n===""){const i=parseInt(e);return isNaN(i)?0:r(i)}else if(n!==e){let i=0;switch(n){case"%":i=25;break;case"deg":i=90}if(i){let o=parseFloat(e.slice(0,e.length-n.length));return isNaN(o)?0:(o=o/i,o%1===0?r(o):0)}}return t}function Ud(e,t){let n=e.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const r in t)n+=" "+r+'="'+t[r]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+n+">"+e+"</svg>"}function Hd(e){return e.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/\s+/g," ")}function qd(e){return"data:image/svg+xml,"+Hd(e)}function zd(e){return'url("'+qd(e)+'")'}let Vn;function Wd(){try{Vn=window.trustedTypes.createPolicy("iconify",{createHTML:e=>e})}catch{Vn=null}}function Kd(e){return Vn===void 0&&Wd(),Vn?Vn.createHTML(e):e}const oa={...Us,inline:!1},Yd={xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":!0,role:"img"},Gd={display:"inline-block"},Ri={backgroundColor:"currentColor"},sa={backgroundColor:"transparent"},aa={Image:"var(--svg)",Repeat:"no-repeat",Size:"100% 100%"},la={WebkitMask:Ri,mask:Ri,background:sa};for(const e in la){const t=la[e];for(const n in aa)t[e+n]=aa[n]}const Xd={...oa,inline:!0};function ua(e){return e+(e.match(/^[-0-9.]+$/)?"px":"")}const Jd=(e,t,n)=>{const r=t.inline?Xd:oa,i=Md(r,t),o=t.mode||"svg",s={},l=t.style||{},a={...o==="svg"?Yd:{}};if(n){const b=_r(n,!1,!0);if(b){const g=["iconify"],y=["provider","prefix"];for(const x of y)b[x]&&g.push("iconify--"+b[x]);a.className=g.join(" ")}}for(let b in t){const g=t[b];if(g!==void 0)switch(b){case"icon":case"style":case"children":case"onLoad":case"mode":case"ssr":break;case"_ref":a.ref=g;break;case"className":a[b]=(a[b]?a[b]+" ":"")+g;break;case"inline":case"hFlip":case"vFlip":i[b]=g===!0||g==="true"||g===1;break;case"flip":typeof g=="string"&&Rd(i,g);break;case"color":s.color=g;break;case"rotate":typeof g=="string"?i[b]=Bd(g):typeof g=="number"&&(i[b]=g);break;case"ariaHidden":case"aria-hidden":g!==!0&&g!=="true"&&delete a["aria-hidden"];break;default:r[b]===void 0&&(a[b]=g)}}const u=ld(e,i),c=u.attributes;if(i.inline&&(s.verticalAlign="-0.125em"),o==="svg"){a.style={...s,...l},Object.assign(a,c);let b=0,g=t.id;return typeof g=="string"&&(g=g.replace(/-/g,"_")),a.dangerouslySetInnerHTML={__html:Kd(dd(u.body,g?()=>g+"ID"+b++:"iconifyReact"))},h.createElement("svg",a)}const{body:f,width:m,height:d}=e,p=o==="mask"||(o==="bg"?!1:f.indexOf("currentColor")!==-1),v=Ud(f,{...c,width:m+"",height:d+""});return a.style={...s,"--svg":zd(v),width:ua(c.width),height:ua(c.height),...Gd,...p?Ri:sa,...l},h.createElement("span",a)};if(Vs(!0),pd("",bd),typeof document<"u"&&typeof window<"u"){na();const e=window;if(e.IconifyPreload!==void 0){const t=e.IconifyPreload,n="Invalid IconifyPreload syntax.";typeof t=="object"&&t!==null&&(t instanceof Array?t:[t]).forEach(r=>{try{(typeof r!="object"||r===null||r instanceof Array||typeof r.icons!="object"||typeof r.prefix!="string"||!td(r))&&console.error(n)}catch{console.error(n)}})}if(e.IconifyProviders!==void 0){const t=e.IconifyProviders;if(typeof t=="object"&&t!==null)for(let n in t){const r="IconifyProviders["+n+"] is invalid.";try{const i=t[n];if(typeof i!="object"||!i||i.resources===void 0)continue;hd(n,i)||console.error(r)}catch{console.error(r)}}}}function ca(e){const[t,n]=h.useState(!!e.ssr),[r,i]=h.useState({});function o(d){if(d){const p=e.icon;if(typeof p=="object")return{name:"",data:p};const v=Rs(p);if(v)return{name:p,data:v}}return{name:""}}const[s,l]=h.useState(o(!!e.ssr));function a(){const d=r.callback;d&&(d(),i({}))}function u(d){if(JSON.stringify(s)!==JSON.stringify(d))return a(),l(d),!0}function c(){var d;const p=e.icon;if(typeof p=="object"){u({name:"",data:p});return}const v=Rs(p);if(u({name:p,data:v}))if(v===void 0){const b=Id([p],c);i({callback:b})}else v&&((d=e.onLoad)===null||d===void 0||d.call(e,p))}h.useEffect(()=>(n(!0),a),[]),h.useEffect(()=>{t&&c()},[e.icon,t]);const{name:f,data:m}=s;return m?Jd({..._i,...m},e,f):e.children?e.children:h.createElement("span",{})}const Qd=h.forwardRef((e,t)=>ca({...e,_ref:t}));h.forwardRef((e,t)=>ca({inline:!0,...e,_ref:t}));function He({icon:e,iconClass:t}){return w.jsx(w.Fragment,{children:w.jsx(Qd,{icon:e,className:t})})}const Rn=({text:e="",isDisabled:t=!1,isLoading:n=!1,btnClass:r="bg-primary-500 text-white",icon:i="",iconPosition:o="left",iconClass:s="text-[20px]",loadingClass:l="",link:a="",div:u=!1,type:c="button",onClick:f})=>{const m=`
|
|
42
|
+
Please change the parent <Route path="${b}"> to <Route path="${b==="/"?"*":`${b}/*`}">.`)}let f=rn(),m;m=f;let p=m.pathname||"/",d=p;if(u!=="/"){let b=u.replace(/^\//,"").split("/");d="/"+p.replace(/^\//,"").split("/").slice(b.length).join("/")}let g=aa(e,{pathname:d});return Lt(c||g!=null,`No routes matched location "${m.pathname}${m.search}${m.hash}" `),Lt(g==null||g[g.length-1].route.element!==void 0||g[g.length-1].route.Component!==void 0||g[g.length-1].route.lazy!==void 0,`Matched leaf route at location "${m.pathname}${m.search}${m.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`),Bd(g&&g.map(b=>Object.assign({},b,{params:Object.assign({},a,b.params),pathname:Dt([u,i.encodeLocation?i.encodeLocation(b.pathname).pathname:b.pathname]),pathnameBase:b.pathnameBase==="/"?u:Dt([u,i.encodeLocation?i.encodeLocation(b.pathnameBase).pathname:b.pathnameBase])})),s,n,r)}function Id(){let e=Wd(),t=Fd(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",i={padding:"0.5rem",backgroundColor:r},s={padding:"2px 4px",backgroundColor:r},o=null;return console.error("Error handled by React Router default ErrorBoundary:",e),o=F.createElement(F.Fragment,null,F.createElement("p",null,"💿 Hey developer 👋"),F.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",F.createElement("code",{style:s},"ErrorBoundary")," or"," ",F.createElement("code",{style:s},"errorElement")," prop on your route.")),F.createElement(F.Fragment,null,F.createElement("h2",null,"Unexpected Application Error!"),F.createElement("h3",{style:{fontStyle:"italic"}},t),n?F.createElement("pre",{style:i},n):null,o)}var Md=F.createElement(Id,null),Rd=class extends F.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return this.state.error!==void 0?F.createElement(Mt.Provider,{value:this.props.routeContext},F.createElement(Ji.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function Vd({routeContext:e,match:t,children:n}){let r=F.useContext(On);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),F.createElement(Mt.Provider,{value:e},n)}function Bd(e,t=[],n=null,r=null){if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let i=e,s=n==null?void 0:n.errors;if(s!=null){let l=i.findIndex(u=>u.route.id&&(s==null?void 0:s[u.route.id])!==void 0);De(l>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(s).join(",")}`),i=i.slice(0,Math.min(i.length,l+1))}let o=!1,a=-1;if(n)for(let l=0;l<i.length;l++){let u=i[l];if((u.route.HydrateFallback||u.route.hydrateFallbackElement)&&(a=l),u.route.id){let{loaderData:c,errors:f}=n,m=u.route.loader&&!c.hasOwnProperty(u.route.id)&&(!f||f[u.route.id]===void 0);if(u.route.lazy||m){o=!0,a>=0?i=i.slice(0,a+1):i=[i[0]];break}}}return i.reduceRight((l,u,c)=>{let f,m=!1,p=null,d=null;n&&(f=s&&u.route.id?s[u.route.id]:void 0,p=u.route.errorElement||Md,o&&(a<0&&c===0?(ba("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),m=!0,d=null):a===c&&(m=!0,d=u.route.hydrateFallbackElement||null)));let g=t.concat(i.slice(0,c+1)),v=()=>{let b;return f?b=p:m?b=d:u.route.Component?b=F.createElement(u.route.Component,null):u.route.element?b=u.route.element:b=l,F.createElement(Vd,{match:u,routeContext:{outlet:l,matches:g,isDataRoute:n!=null},children:b})};return n&&(u.route.ErrorBoundary||u.route.errorElement||c===0)?F.createElement(Rd,{location:n.location,revalidation:n.revalidation,component:p,error:f,children:v(),routeContext:{outlet:null,matches:g,isDataRoute:!0}}):v()},null)}function Yi(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Ud(e){let t=F.useContext(On);return De(t,Yi(e)),t}function Hd(e){let t=F.useContext(Ir);return De(t,Yi(e)),t}function qd(e){let t=F.useContext(Mt);return De(t,Yi(e)),t}function Gi(e){let t=qd(e),n=t.matches[t.matches.length-1];return De(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function zd(){return Gi("useRouteId")}function Wd(){var r;let e=F.useContext(Ji),t=Hd("useRouteError"),n=Gi("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function Kd(){let{router:e}=Ud("useNavigate"),t=Gi("useNavigate"),n=F.useRef(!1);return ga(()=>{n.current=!0}),F.useCallback(async(i,s={})=>{Lt(n.current,ma),n.current&&(typeof i=="number"?e.navigate(i):await e.navigate(i,{fromRouteId:t,...s}))},[e,t])}var ya={};function ba(e,t,n){!t&&!ya[e]&&(ya[e]=!0,Lt(!1,n))}F.memo(Jd);function Jd({routes:e,future:t,state:n}){return Dd(e,void 0,n,t)}var Rr="get",Vr="application/x-www-form-urlencoded";function Br(e){return e!=null&&typeof e.tagName=="string"}function Yd(e){return Br(e)&&e.tagName.toLowerCase()==="button"}function Gd(e){return Br(e)&&e.tagName.toLowerCase()==="form"}function Xd(e){return Br(e)&&e.tagName.toLowerCase()==="input"}function Qd(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Zd(e,t){return e.button===0&&(!t||t==="_self")&&!Qd(e)}var Ur=null;function ep(){if(Ur===null)try{new FormData(document.createElement("form"),0),Ur=!1}catch{Ur=!0}return Ur}var tp=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Xi(e){return e!=null&&!tp.has(e)?(Lt(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Vr}"`),null):e}function np(e,t){let n,r,i,s,o;if(Gd(e)){let a=e.getAttribute("action");r=a?nn(a,t):null,n=e.getAttribute("method")||Rr,i=Xi(e.getAttribute("enctype"))||Vr,s=new FormData(e)}else if(Yd(e)||Xd(e)&&(e.type==="submit"||e.type==="image")){let a=e.form;if(a==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let l=e.getAttribute("formaction")||a.getAttribute("action");if(r=l?nn(l,t):null,n=e.getAttribute("formmethod")||a.getAttribute("method")||Rr,i=Xi(e.getAttribute("formenctype"))||Xi(a.getAttribute("enctype"))||Vr,s=new FormData(a,e),!ep()){let{name:u,type:c,value:f}=e;if(c==="image"){let m=u?`${u}.`:"";s.append(`${m}x`,"0"),s.append(`${m}y`,"0")}else u&&s.append(u,f)}}else{if(Br(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Rr,r=null,i=Vr,o=e}return s&&i==="text/plain"&&(o=s,s=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:s,body:o}}function Qi(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}async function rp(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function ip(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function sp(e,t,n){let r=await Promise.all(e.map(async i=>{let s=t.routes[i.route.id];if(s){let o=await rp(s,n);return o.links?o.links():[]}return[]}));return up(r.flat(1).filter(ip).filter(i=>i.rel==="stylesheet"||i.rel==="preload").map(i=>i.rel==="stylesheet"?{...i,rel:"prefetch",as:"style"}:{...i,rel:"prefetch"}))}function va(e,t,n,r,i,s){let o=(l,u)=>n[u]?l.route.id!==n[u].route.id:!0,a=(l,u)=>{var c;return n[u].pathname!==l.pathname||((c=n[u].route.path)==null?void 0:c.endsWith("*"))&&n[u].params["*"]!==l.params["*"]};return s==="assets"?t.filter((l,u)=>o(l,u)||a(l,u)):s==="data"?t.filter((l,u)=>{var f;let c=r.routes[l.route.id];if(!c||!c.hasLoader)return!1;if(o(l,u)||a(l,u))return!0;if(l.route.shouldRevalidate){let m=l.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:((f=n[0])==null?void 0:f.params)||{},nextUrl:new URL(e,window.origin),nextParams:l.params,defaultShouldRevalidate:!0});if(typeof m=="boolean")return m}return!0}):[]}function op(e,t){return ap(e.map(n=>{let r=t.routes[n.route.id];if(!r)return[];let i=[r.module];return r.imports&&(i=i.concat(r.imports)),i}).flat(1))}function ap(e){return[...new Set(e)]}function lp(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function up(e,t){let n=new Set;return new Set(t),e.reduce((r,i)=>{let s=JSON.stringify(lp(i));return n.has(s)||(n.add(s),r.push({key:s,link:i})),r},[])}function cp(e){let t=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return t.pathname==="/"?t.pathname="_root.data":t.pathname=`${t.pathname.replace(/\/$/,"")}.data`,t}function fp(){let e=F.useContext(On);return Qi(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function dp(){let e=F.useContext(Ir);return Qi(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Zi=F.createContext(void 0);Zi.displayName="FrameworkContext";function xa(){let e=F.useContext(Zi);return Qi(e,"You must render this element inside a <HydratedRouter> element"),e}function pp(e,t){let n=F.useContext(Zi),[r,i]=F.useState(!1),[s,o]=F.useState(!1),{onFocus:a,onBlur:l,onMouseEnter:u,onMouseLeave:c,onTouchStart:f}=t,m=F.useRef(null);F.useEffect(()=>{if(e==="render"&&o(!0),e==="viewport"){let g=b=>{b.forEach(x=>{o(x.isIntersecting)})},v=new IntersectionObserver(g,{threshold:.5});return m.current&&v.observe(m.current),()=>{v.disconnect()}}},[e]),F.useEffect(()=>{if(r){let g=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(g)}}},[r]);let p=()=>{i(!0)},d=()=>{i(!1),o(!1)};return n?e!=="intent"?[s,m,{}]:[s,m,{onFocus:Yn(a,p),onBlur:Yn(l,d),onMouseEnter:Yn(u,p),onMouseLeave:Yn(c,d),onTouchStart:Yn(f,p)}]:[!1,m,{}]}function Yn(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function hp({page:e,...t}){let{router:n}=fp(),r=F.useMemo(()=>aa(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?F.createElement(gp,{page:e,matches:r,...t}):null}function mp(e){let{manifest:t,routeModules:n}=xa(),[r,i]=F.useState([]);return F.useEffect(()=>{let s=!1;return sp(e,t,n).then(o=>{s||i(o)}),()=>{s=!0}},[e,t,n]),r}function gp({page:e,matches:t,...n}){let r=rn(),{manifest:i,routeModules:s}=xa(),{loaderData:o,matches:a}=dp(),l=F.useMemo(()=>va(e,t,a,i,r,"data"),[e,t,a,i,r]),u=F.useMemo(()=>va(e,t,a,i,r,"assets"),[e,t,a,i,r]),c=F.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let p=new Set,d=!1;if(t.forEach(v=>{var x;let b=i.routes[v.route.id];!b||!b.hasLoader||(!l.some(w=>w.route.id===v.route.id)&&v.route.id in o&&((x=s[v.route.id])!=null&&x.shouldRevalidate)||b.hasClientLoader?d=!0:p.add(v.route.id))}),p.size===0)return[];let g=cp(e);return d&&p.size>0&&g.searchParams.set("_routes",t.filter(v=>p.has(v.route.id)).map(v=>v.route.id).join(",")),[g.pathname+g.search]},[o,r,i,l,t,e,s]),f=F.useMemo(()=>op(u,i),[u,i]),m=mp(u);return F.createElement(F.Fragment,null,c.map(p=>F.createElement("link",{key:p,rel:"prefetch",as:"fetch",href:p,...n})),f.map(p=>F.createElement("link",{key:p,rel:"modulepreload",href:p,...n})),m.map(({key:p,link:d})=>F.createElement("link",{key:p,...d})))}function yp(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var wa=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{wa&&(window.__reactRouterVersion="7.1.1")}catch{}var Ea=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,es=F.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:i,reloadDocument:s,replace:o,state:a,target:l,to:u,preventScrollReset:c,viewTransition:f,...m},p){let{basename:d}=F.useContext(It),g=typeof u=="string"&&Ea.test(u),v,b=!1;if(typeof u=="string"&&g&&(v=u,wa))try{let N=new URL(window.location.href),L=u.startsWith("//")?new URL(N.protocol+u):new URL(u),P=nn(L.pathname,d);L.origin===N.origin&&P!=null?u=P+L.search+L.hash:b=!0}catch{Lt(!1,`<Link to="${u}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let x=Nd(u,{relative:i}),[w,T,C]=pp(r,m),_=wp(u,{replace:o,state:a,target:l,preventScrollReset:c,relative:i,viewTransition:f});function O(N){t&&t(N),N.defaultPrevented||_(N)}let A=F.createElement("a",{...m,...C,href:v||x,onClick:b||s?t:O,ref:yp(p,T),target:l,"data-discover":!g&&n==="render"?"true":void 0});return w&&!g?F.createElement(F.Fragment,null,A,F.createElement(hp,{page:x})):A});es.displayName="Link";var bp=F.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:i=!1,style:s,to:o,viewTransition:a,children:l,...u},c){let f=Jn(o,{relative:u.relative}),m=rn(),p=F.useContext(Ir),{navigator:d,basename:g}=F.useContext(It),v=p!=null&&Cp(f)&&a===!0,b=d.encodeLocation?d.encodeLocation(f).pathname:f.pathname,x=m.pathname,w=p&&p.navigation&&p.navigation.location?p.navigation.location.pathname:null;n||(x=x.toLowerCase(),w=w?w.toLowerCase():null,b=b.toLowerCase()),w&&g&&(w=nn(w,g)||w);const T=b!=="/"&&b.endsWith("/")?b.length-1:b.length;let C=x===b||!i&&x.startsWith(b)&&x.charAt(T)==="/",_=w!=null&&(w===b||!i&&w.startsWith(b)&&w.charAt(b.length)==="/"),O={isActive:C,isPending:_,isTransitioning:v},A=C?t:void 0,N;typeof r=="function"?N=r(O):N=[r,C?"active":null,_?"pending":null,v?"transitioning":null].filter(Boolean).join(" ");let L=typeof s=="function"?s(O):s;return F.createElement(es,{...u,"aria-current":A,className:N,ref:c,style:L,to:o,viewTransition:a},typeof l=="function"?l(O):l)});bp.displayName="NavLink";var vp=F.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:s,method:o=Rr,action:a,onSubmit:l,relative:u,preventScrollReset:c,viewTransition:f,...m},p)=>{let d=Tp(),g=_p(a,{relative:u}),v=o.toLowerCase()==="get"?"get":"post",b=typeof a=="string"&&Ea.test(a),x=w=>{if(l&&l(w),w.defaultPrevented)return;w.preventDefault();let T=w.nativeEvent.submitter,C=(T==null?void 0:T.getAttribute("formmethod"))||o;d(T||w.currentTarget,{fetcherKey:t,method:C,navigate:n,replace:i,state:s,relative:u,preventScrollReset:c,viewTransition:f})};return F.createElement("form",{ref:p,method:v,action:g,onSubmit:r?l:x,...m,"data-discover":!b&&e==="render"?"true":void 0})});vp.displayName="Form";function xp(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Sa(e){let t=F.useContext(On);return De(t,xp(e)),t}function wp(e,{target:t,replace:n,state:r,preventScrollReset:i,relative:s,viewTransition:o}={}){let a=Pd(),l=rn(),u=Jn(e,{relative:s});return F.useCallback(c=>{if(Zd(c,t)){c.preventDefault();let f=n!==void 0?n:qi(l)===qi(u);a(e,{replace:f,state:r,preventScrollReset:i,relative:s,viewTransition:o})}},[l,a,u,n,r,t,e,i,s,o])}var Ep=0,Sp=()=>`__${String(++Ep)}__`;function Tp(){let{router:e}=Sa("useSubmit"),{basename:t}=F.useContext(It),n=zd();return F.useCallback(async(r,i={})=>{let{action:s,method:o,encType:a,formData:l,body:u}=np(r,t);if(i.navigate===!1){let c=i.fetcherKey||Sp();await e.fetch(c,n,i.action||s,{preventScrollReset:i.preventScrollReset,formData:l,body:u,formMethod:i.method||o,formEncType:i.encType||a,flushSync:i.flushSync})}else await e.navigate(i.action||s,{preventScrollReset:i.preventScrollReset,formData:l,body:u,formMethod:i.method||o,formEncType:i.encType||a,replace:i.replace,state:i.state,fromRouteId:n,flushSync:i.flushSync,viewTransition:i.viewTransition})},[e,t,n])}function _p(e,{relative:t}={}){let{basename:n}=F.useContext(It),r=F.useContext(Mt);De(r,"useFormAction must be used inside a RouteContext");let[i]=r.matches.slice(-1),s={...Jn(e||".",{relative:t})},o=rn();if(e==null){s.search=o.search;let a=new URLSearchParams(s.search),l=a.getAll("index");if(l.some(c=>c==="")){a.delete("index"),l.filter(f=>f).forEach(f=>a.append("index",f));let c=a.toString();s.search=c?`?${c}`:""}}return(!e||e===".")&&i.route.index&&(s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(s.pathname=s.pathname==="/"?n:Dt([n,s.pathname])),qi(s)}function Cp(e,t={}){let n=F.useContext(ha);De(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=Sa("useViewTransitionState"),i=Jn(e,{relative:t.relative});if(!n.isTransitioning)return!1;let s=nn(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=nn(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Dr(i.pathname,o)!=null||Dr(i.pathname,s)!=null}new TextEncoder;const Ta=Object.freeze({left:0,top:0,width:16,height:16}),Hr=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),ts=Object.freeze({...Ta,...Hr}),ns=Object.freeze({...ts,body:"",hidden:!1});function Op(e,t){const n={};!e.hFlip!=!t.hFlip&&(n.hFlip=!0),!e.vFlip!=!t.vFlip&&(n.vFlip=!0);const r=((e.rotate||0)+(t.rotate||0))%4;return r&&(n.rotate=r),n}function _a(e,t){const n=Op(e,t);for(const r in ns)r in Hr?r in e&&!(r in n)&&(n[r]=Hr[r]):r in t?n[r]=t[r]:r in e&&(n[r]=e[r]);return n}function kp(e,t){const n=e.icons,r=e.aliases||Object.create(null),i=Object.create(null);function s(o){if(n[o])return i[o]=[];if(!(o in i)){i[o]=null;const a=r[o]&&r[o].parent,l=a&&s(a);l&&(i[o]=[a].concat(l))}return i[o]}return Object.keys(n).concat(Object.keys(r)).forEach(s),i}function Fp(e,t,n){const r=e.icons,i=e.aliases||Object.create(null);let s={};function o(a){s=_a(r[a]||i[a],s)}return o(t),n.forEach(o),_a(e,s)}function Ca(e,t){const n=[];if(typeof e!="object"||typeof e.icons!="object")return n;e.not_found instanceof Array&&e.not_found.forEach(i=>{t(i,null),n.push(i)});const r=kp(e);for(const i in r){const s=r[i];s&&(t(i,Fp(e,i,s)),n.push(i))}return n}const Ap={provider:"",aliases:{},not_found:{},...Ta};function rs(e,t){for(const n in t)if(n in e&&typeof e[n]!=typeof t[n])return!1;return!0}function Oa(e){if(typeof e!="object"||e===null)return null;const t=e;if(typeof t.prefix!="string"||!e.icons||typeof e.icons!="object"||!rs(e,Ap))return null;const n=t.icons;for(const i in n){const s=n[i];if(!i||typeof s.body!="string"||!rs(s,ns))return null}const r=t.aliases||Object.create(null);for(const i in r){const s=r[i],o=s.parent;if(!i||typeof o!="string"||!n[o]&&!r[o]||!rs(s,ns))return null}return t}const ka=/^[a-z0-9]+(-[a-z0-9]+)*$/,qr=(e,t,n,r="")=>{const i=e.split(":");if(e.slice(0,1)==="@"){if(i.length<2||i.length>3)return null;r=i.shift().slice(1)}if(i.length>3||!i.length)return null;if(i.length>1){const a=i.pop(),l=i.pop(),u={provider:i.length>0?i[0]:r,prefix:l,name:a};return t&&!zr(u)?null:u}const s=i[0],o=s.split("-");if(o.length>1){const a={provider:r,prefix:o.shift(),name:o.join("-")};return t&&!zr(a)?null:a}if(n&&r===""){const a={provider:r,prefix:"",name:s};return t&&!zr(a,n)?null:a}return null},zr=(e,t)=>e?!!((t&&e.prefix===""||e.prefix)&&e.name):!1,Fa=Object.create(null);function $p(e,t){return{provider:e,prefix:t,icons:Object.create(null),missing:new Set}}function sn(e,t){const n=Fa[e]||(Fa[e]=Object.create(null));return n[t]||(n[t]=$p(e,t))}function is(e,t){return Oa(t)?Ca(t,(n,r)=>{r?e.icons[n]=r:e.missing.add(n)}):[]}function jp(e,t,n){try{if(typeof n.body=="string")return e.icons[t]={...n},!0}catch{}return!1}let Gn=!1;function Aa(e){return typeof e=="boolean"&&(Gn=e),Gn}function $a(e){const t=typeof e=="string"?qr(e,!0,Gn):e;if(t){const n=sn(t.provider,t.prefix),r=t.name;return n.icons[r]||(n.missing.has(r)?null:void 0)}}function Np(e,t){const n=qr(e,!0,Gn);if(!n)return!1;const r=sn(n.provider,n.prefix);return t?jp(r,n.name,t):(r.missing.add(n.name),!0)}function Pp(e,t){if(typeof e!="object")return!1;if(typeof t!="string"&&(t=e.provider||""),Gn&&!t&&!e.prefix){let i=!1;return Oa(e)&&(e.prefix="",Ca(e,(s,o)=>{Np(s,o)&&(i=!0)})),i}const n=e.prefix;if(!zr({provider:t,prefix:n,name:"a"}))return!1;const r=sn(t,n);return!!is(r,e)}const ja=Object.freeze({width:null,height:null}),Na=Object.freeze({...ja,...Hr}),Lp=/(-?[0-9.]*[0-9]+[0-9.]*)/g,Dp=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function Pa(e,t,n){if(t===1)return e;if(n=n||100,typeof e=="number")return Math.ceil(e*t*n)/n;if(typeof e!="string")return e;const r=e.split(Lp);if(r===null||!r.length)return e;const i=[];let s=r.shift(),o=Dp.test(s);for(;;){if(o){const a=parseFloat(s);isNaN(a)?i.push(s):i.push(Math.ceil(a*t*n)/n)}else i.push(s);if(s=r.shift(),s===void 0)return i.join("");o=!o}}function Ip(e,t="defs"){let n="";const r=e.indexOf("<"+t);for(;r>=0;){const i=e.indexOf(">",r),s=e.indexOf("</"+t);if(i===-1||s===-1)break;const o=e.indexOf(">",s);if(o===-1)break;n+=e.slice(i+1,s).trim(),e=e.slice(0,r).trim()+e.slice(o+1)}return{defs:n,content:e}}function Mp(e,t){return e?"<defs>"+e+"</defs>"+t:t}function Rp(e,t,n){const r=Ip(e);return Mp(r.defs,t+r.content+n)}const Vp=e=>e==="unset"||e==="undefined"||e==="none";function Bp(e,t){const n={...ts,...e},r={...Na,...t},i={left:n.left,top:n.top,width:n.width,height:n.height};let s=n.body;[n,r].forEach(g=>{const v=[],b=g.hFlip,x=g.vFlip;let w=g.rotate;b?x?w+=2:(v.push("translate("+(i.width+i.left).toString()+" "+(0-i.top).toString()+")"),v.push("scale(-1 1)"),i.top=i.left=0):x&&(v.push("translate("+(0-i.left).toString()+" "+(i.height+i.top).toString()+")"),v.push("scale(1 -1)"),i.top=i.left=0);let T;switch(w<0&&(w-=Math.floor(w/4)*4),w=w%4,w){case 1:T=i.height/2+i.top,v.unshift("rotate(90 "+T.toString()+" "+T.toString()+")");break;case 2:v.unshift("rotate(180 "+(i.width/2+i.left).toString()+" "+(i.height/2+i.top).toString()+")");break;case 3:T=i.width/2+i.left,v.unshift("rotate(-90 "+T.toString()+" "+T.toString()+")");break}w%2===1&&(i.left!==i.top&&(T=i.left,i.left=i.top,i.top=T),i.width!==i.height&&(T=i.width,i.width=i.height,i.height=T)),v.length&&(s=Rp(s,'<g transform="'+v.join(" ")+'">',"</g>"))});const o=r.width,a=r.height,l=i.width,u=i.height;let c,f;o===null?(f=a===null?"1em":a==="auto"?u:a,c=Pa(f,l/u)):(c=o==="auto"?l:o,f=a===null?Pa(c,u/l):a==="auto"?u:a);const m={},p=(g,v)=>{Vp(v)||(m[g]=v.toString())};p("width",c),p("height",f);const d=[i.left,i.top,l,u];return m.viewBox=d.join(" "),{attributes:m,viewBox:d,body:s}}const Up=/\sid="(\S+)"/g,Hp="IconifyId"+Date.now().toString(16)+(Math.random()*16777216|0).toString(16);let qp=0;function zp(e,t=Hp){const n=[];let r;for(;r=Up.exec(e);)n.push(r[1]);if(!n.length)return e;const i="suffix"+(Math.random()*16777216|Date.now()).toString(16);return n.forEach(s=>{const o=typeof t=="function"?t(s):t+(qp++).toString(),a=s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");e=e.replace(new RegExp('([#;"])('+a+')([")]|\\.[a-z])',"g"),"$1"+o+i+"$3")}),e=e.replace(new RegExp(i,"g"),""),e}const ss=Object.create(null);function Wp(e,t){ss[e]=t}function os(e){return ss[e]||ss[""]}function as(e){let t;if(typeof e.resources=="string")t=[e.resources];else if(t=e.resources,!(t instanceof Array)||!t.length)return null;return{resources:t,path:e.path||"/",maxURL:e.maxURL||500,rotate:e.rotate||750,timeout:e.timeout||5e3,random:e.random===!0,index:e.index||0,dataAfterTimeout:e.dataAfterTimeout!==!1}}const ls=Object.create(null),Xn=["https://api.simplesvg.com","https://api.unisvg.com"],Wr=[];for(;Xn.length>0;)Xn.length===1||Math.random()>.5?Wr.push(Xn.shift()):Wr.push(Xn.pop());ls[""]=as({resources:["https://api.iconify.design"].concat(Wr)});function Kp(e,t){const n=as(t);return n===null?!1:(ls[e]=n,!0)}function us(e){return ls[e]}let La=(()=>{let e;try{if(e=fetch,typeof e=="function")return e}catch{}})();function Jp(e,t){const n=us(e);if(!n)return 0;let r;if(!n.maxURL)r=0;else{let i=0;n.resources.forEach(o=>{i=Math.max(i,o.length)});const s=t+".json?icons=";r=n.maxURL-i-n.path.length-s.length}return r}function Yp(e){return e===404}const Gp=(e,t,n)=>{const r=[],i=Jp(e,t),s="icons";let o={type:s,provider:e,prefix:t,icons:[]},a=0;return n.forEach((l,u)=>{a+=l.length+1,a>=i&&u>0&&(r.push(o),o={type:s,provider:e,prefix:t,icons:[]},a=l.length),o.icons.push(l)}),r.push(o),r};function Xp(e){if(typeof e=="string"){const t=us(e);if(t)return t.path}return"/"}const Qp={prepare:Gp,send:(e,t,n)=>{if(!La){n("abort",424);return}let r=Xp(t.provider);switch(t.type){case"icons":{const s=t.prefix,a=t.icons.join(","),l=new URLSearchParams({icons:a});r+=s+".json?"+l.toString();break}case"custom":{const s=t.uri;r+=s.slice(0,1)==="/"?s.slice(1):s;break}default:n("abort",400);return}let i=503;La(e+r).then(s=>{const o=s.status;if(o!==200){setTimeout(()=>{n(Yp(o)?"abort":"next",o)});return}return i=501,s.json()}).then(s=>{if(typeof s!="object"||s===null){setTimeout(()=>{s===404?n("abort",s):n("next",i)});return}setTimeout(()=>{n("success",s)})}).catch(()=>{n("next",i)})}};function Zp(e){const t={loaded:[],missing:[],pending:[]},n=Object.create(null);e.sort((i,s)=>i.provider!==s.provider?i.provider.localeCompare(s.provider):i.prefix!==s.prefix?i.prefix.localeCompare(s.prefix):i.name.localeCompare(s.name));let r={provider:"",prefix:"",name:""};return e.forEach(i=>{if(r.name===i.name&&r.prefix===i.prefix&&r.provider===i.provider)return;r=i;const s=i.provider,o=i.prefix,a=i.name,l=n[s]||(n[s]=Object.create(null)),u=l[o]||(l[o]=sn(s,o));let c;a in u.icons?c=t.loaded:o===""||u.missing.has(a)?c=t.missing:c=t.pending;const f={provider:s,prefix:o,name:a};c.push(f)}),t}function Da(e,t){e.forEach(n=>{const r=n.loaderCallbacks;r&&(n.loaderCallbacks=r.filter(i=>i.id!==t))})}function eh(e){e.pendingCallbacksFlag||(e.pendingCallbacksFlag=!0,setTimeout(()=>{e.pendingCallbacksFlag=!1;const t=e.loaderCallbacks?e.loaderCallbacks.slice(0):[];if(!t.length)return;let n=!1;const r=e.provider,i=e.prefix;t.forEach(s=>{const o=s.icons,a=o.pending.length;o.pending=o.pending.filter(l=>{if(l.prefix!==i)return!0;const u=l.name;if(e.icons[u])o.loaded.push({provider:r,prefix:i,name:u});else if(e.missing.has(u))o.missing.push({provider:r,prefix:i,name:u});else return n=!0,!0;return!1}),o.pending.length!==a&&(n||Da([e],s.id),s.callback(o.loaded.slice(0),o.missing.slice(0),o.pending.slice(0),s.abort))})}))}let th=0;function nh(e,t,n){const r=th++,i=Da.bind(null,n,r);if(!t.pending.length)return i;const s={id:r,icons:t,callback:e,abort:i};return n.forEach(o=>{(o.loaderCallbacks||(o.loaderCallbacks=[])).push(s)}),i}function rh(e,t=!0,n=!1){const r=[];return e.forEach(i=>{const s=typeof i=="string"?qr(i,t,n):i;s&&r.push(s)}),r}var ih={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function sh(e,t,n,r){const i=e.resources.length,s=e.random?Math.floor(Math.random()*i):e.index;let o;if(e.random){let _=e.resources.slice(0);for(o=[];_.length>1;){const O=Math.floor(Math.random()*_.length);o.push(_[O]),_=_.slice(0,O).concat(_.slice(O+1))}o=o.concat(_)}else o=e.resources.slice(s).concat(e.resources.slice(0,s));const a=Date.now();let l="pending",u=0,c,f=null,m=[],p=[];typeof r=="function"&&p.push(r);function d(){f&&(clearTimeout(f),f=null)}function g(){l==="pending"&&(l="aborted"),d(),m.forEach(_=>{_.status==="pending"&&(_.status="aborted")}),m=[]}function v(_,O){O&&(p=[]),typeof _=="function"&&p.push(_)}function b(){return{startTime:a,payload:t,status:l,queriesSent:u,queriesPending:m.length,subscribe:v,abort:g}}function x(){l="failed",p.forEach(_=>{_(void 0,c)})}function w(){m.forEach(_=>{_.status==="pending"&&(_.status="aborted")}),m=[]}function T(_,O,A){const N=O!=="success";switch(m=m.filter(L=>L!==_),l){case"pending":break;case"failed":if(N||!e.dataAfterTimeout)return;break;default:return}if(O==="abort"){c=A,x();return}if(N){c=A,m.length||(o.length?C():x());return}if(d(),w(),!e.random){const L=e.resources.indexOf(_.resource);L!==-1&&L!==e.index&&(e.index=L)}l="completed",p.forEach(L=>{L(A)})}function C(){if(l!=="pending")return;d();const _=o.shift();if(_===void 0){if(m.length){f=setTimeout(()=>{d(),l==="pending"&&(w(),x())},e.timeout);return}x();return}const O={status:"pending",resource:_,callback:(A,N)=>{T(O,A,N)}};m.push(O),u++,f=setTimeout(C,e.rotate),n(_,t,O.callback)}return setTimeout(C),b}function Ia(e){const t={...ih,...e};let n=[];function r(){n=n.filter(a=>a().status==="pending")}function i(a,l,u){const c=sh(t,a,l,(f,m)=>{r(),u&&u(f,m)});return n.push(c),c}function s(a){return n.find(l=>a(l))||null}return{query:i,find:s,setIndex:a=>{t.index=a},getIndex:()=>t.index,cleanup:r}}function Ma(){}const cs=Object.create(null);function oh(e){if(!cs[e]){const t=us(e);if(!t)return;const n=Ia(t),r={config:t,redundancy:n};cs[e]=r}return cs[e]}function ah(e,t,n){let r,i;if(typeof e=="string"){const s=os(e);if(!s)return n(void 0,424),Ma;i=s.send;const o=oh(e);o&&(r=o.redundancy)}else{const s=as(e);if(s){r=Ia(s);const o=e.resources?e.resources[0]:"",a=os(o);a&&(i=a.send)}}return!r||!i?(n(void 0,424),Ma):r.query(t,i,n)().abort}const Ra="iconify2",Qn="iconify",Va=Qn+"-count",Ba=Qn+"-version",Ua=36e5,lh=168,uh=50;function fs(e,t){try{return e.getItem(t)}catch{}}function ds(e,t,n){try{return e.setItem(t,n),!0}catch{}}function Ha(e,t){try{e.removeItem(t)}catch{}}function ps(e,t){return ds(e,Va,t.toString())}function hs(e){return parseInt(fs(e,Va))||0}const Kr={local:!0,session:!0},qa={local:new Set,session:new Set};let ms=!1;function ch(e){ms=e}let Jr=typeof window>"u"?{}:window;function za(e){const t=e+"Storage";try{if(Jr&&Jr[t]&&typeof Jr[t].length=="number")return Jr[t]}catch{}Kr[e]=!1}function Wa(e,t){const n=za(e);if(!n)return;const r=fs(n,Ba);if(r!==Ra){if(r){const a=hs(n);for(let l=0;l<a;l++)Ha(n,Qn+l.toString())}ds(n,Ba,Ra),ps(n,0);return}const i=Math.floor(Date.now()/Ua)-lh,s=a=>{const l=Qn+a.toString(),u=fs(n,l);if(typeof u=="string"){try{const c=JSON.parse(u);if(typeof c=="object"&&typeof c.cached=="number"&&c.cached>i&&typeof c.provider=="string"&&typeof c.data=="object"&&typeof c.data.prefix=="string"&&t(c,a))return!0}catch{}Ha(n,l)}};let o=hs(n);for(let a=o-1;a>=0;a--)s(a)||(a===o-1?(o--,ps(n,o)):qa[e].add(a))}function Ka(){if(!ms){ch(!0);for(const e in Kr)Wa(e,t=>{const n=t.data,r=t.provider,i=n.prefix,s=sn(r,i);if(!is(s,n).length)return!1;const o=n.lastModified||-1;return s.lastModifiedCached=s.lastModifiedCached?Math.min(s.lastModifiedCached,o):o,!0})}}function fh(e,t){const n=e.lastModifiedCached;if(n&&n>=t)return n===t;if(e.lastModifiedCached=t,n)for(const r in Kr)Wa(r,i=>{const s=i.data;return i.provider!==e.provider||s.prefix!==e.prefix||s.lastModified===t});return!0}function dh(e,t){ms||Ka();function n(r){let i;if(!Kr[r]||!(i=za(r)))return;const s=qa[r];let o;if(s.size)s.delete(o=Array.from(s).shift());else if(o=hs(i),o>=uh||!ps(i,o+1))return;const a={cached:Math.floor(Date.now()/Ua),provider:e.provider,data:t};return ds(i,Qn+o.toString(),JSON.stringify(a))}t.lastModified&&!fh(e,t.lastModified)||Object.keys(t.icons).length&&(t.not_found&&(t=Object.assign({},t),delete t.not_found),n("local")||n("session"))}function Ja(){}function ph(e){e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout(()=>{e.iconsLoaderFlag=!1,eh(e)}))}function hh(e){const t=[],n=[];return e.forEach(r=>{(r.match(ka)?t:n).push(r)}),{valid:t,invalid:n}}function Zn(e,t,n,r){function i(){const s=e.pendingIcons;t.forEach(o=>{s&&s.delete(o),e.icons[o]||e.missing.add(o)})}if(n&&typeof n=="object")try{if(!is(e,n).length){i();return}r&&dh(e,n)}catch(s){console.error(s)}i(),ph(e)}function Ya(e,t){e instanceof Promise?e.then(n=>{t(n)}).catch(()=>{t(null)}):t(e)}function mh(e,t){e.iconsToLoad?e.iconsToLoad=e.iconsToLoad.concat(t).sort():e.iconsToLoad=t,e.iconsQueueFlag||(e.iconsQueueFlag=!0,setTimeout(()=>{e.iconsQueueFlag=!1;const{provider:n,prefix:r}=e,i=e.iconsToLoad;if(delete e.iconsToLoad,!i||!i.length)return;const s=e.loadIcon;if(e.loadIcons&&(i.length>1||!s)){Ya(e.loadIcons(i,r,n),c=>{Zn(e,i,c,!1)});return}if(s){i.forEach(c=>{const f=s(c,r,n);Ya(f,m=>{const p=m?{prefix:r,icons:{[c]:m}}:null;Zn(e,[c],p,!1)})});return}const{valid:o,invalid:a}=hh(i);if(a.length&&Zn(e,a,null,!1),!o.length)return;const l=r.match(ka)?os(n):null;if(!l){Zn(e,o,null,!1);return}l.prepare(n,r,o).forEach(c=>{ah(n,c,f=>{Zn(e,c.icons,f,!0)})})}))}const gh=(e,t)=>{const n=rh(e,!0,Aa()),r=Zp(n);if(!r.pending.length){let l=!0;return t&&setTimeout(()=>{l&&t(r.loaded,r.missing,r.pending,Ja)}),()=>{l=!1}}const i=Object.create(null),s=[];let o,a;return r.pending.forEach(l=>{const{provider:u,prefix:c}=l;if(c===a&&u===o)return;o=u,a=c,s.push(sn(u,c));const f=i[u]||(i[u]=Object.create(null));f[c]||(f[c]=[])}),r.pending.forEach(l=>{const{provider:u,prefix:c,name:f}=l,m=sn(u,c),p=m.pendingIcons||(m.pendingIcons=new Set);p.has(f)||(p.add(f),i[u][c].push(f))}),s.forEach(l=>{const u=i[l.provider][l.prefix];u.length&&mh(l,u)}),t?nh(t,r,s):Ja};function yh(e,t){const n={...e};for(const r in t){const i=t[r],s=typeof i;r in ja?(i===null||i&&(s==="string"||s==="number"))&&(n[r]=i):s===typeof n[r]&&(n[r]=r==="rotate"?i%4:i)}return n}const bh=/[\s,]+/;function vh(e,t){t.split(bh).forEach(n=>{switch(n.trim()){case"horizontal":e.hFlip=!0;break;case"vertical":e.vFlip=!0;break}})}function xh(e,t=0){const n=e.replace(/^-?[0-9.]*/,"");function r(i){for(;i<0;)i+=4;return i%4}if(n===""){const i=parseInt(e);return isNaN(i)?0:r(i)}else if(n!==e){let i=0;switch(n){case"%":i=25;break;case"deg":i=90}if(i){let s=parseFloat(e.slice(0,e.length-n.length));return isNaN(s)?0:(s=s/i,s%1===0?r(s):0)}}return t}function wh(e,t){let n=e.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const r in t)n+=" "+r+'="'+t[r]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+n+">"+e+"</svg>"}function Eh(e){return e.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/\s+/g," ")}function Sh(e){return"data:image/svg+xml,"+Eh(e)}function Th(e){return'url("'+Sh(e)+'")'}let er;function _h(){try{er=window.trustedTypes.createPolicy("iconify",{createHTML:e=>e})}catch{er=null}}function Ch(e){return er===void 0&&_h(),er?er.createHTML(e):e}const Ga={...Na,inline:!1},Oh={xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":!0,role:"img"},kh={display:"inline-block"},gs={backgroundColor:"currentColor"},Xa={backgroundColor:"transparent"},Qa={Image:"var(--svg)",Repeat:"no-repeat",Size:"100% 100%"},Za={WebkitMask:gs,mask:gs,background:Xa};for(const e in Za){const t=Za[e];for(const n in Qa)t[e+n]=Qa[n]}const Fh={...Ga,inline:!0};function el(e){return e+(e.match(/^[-0-9.]+$/)?"px":"")}const Ah=(e,t,n)=>{const r=t.inline?Fh:Ga,i=yh(r,t),s=t.mode||"svg",o={},a=t.style||{},l={...s==="svg"?Oh:{}};if(n){const v=qr(n,!1,!0);if(v){const b=["iconify"],x=["provider","prefix"];for(const w of x)v[w]&&b.push("iconify--"+v[w]);l.className=b.join(" ")}}for(let v in t){const b=t[v];if(b!==void 0)switch(v){case"icon":case"style":case"children":case"onLoad":case"mode":case"ssr":break;case"_ref":l.ref=b;break;case"className":l[v]=(l[v]?l[v]+" ":"")+b;break;case"inline":case"hFlip":case"vFlip":i[v]=b===!0||b==="true"||b===1;break;case"flip":typeof b=="string"&&vh(i,b);break;case"color":o.color=b;break;case"rotate":typeof b=="string"?i[v]=xh(b):typeof b=="number"&&(i[v]=b);break;case"ariaHidden":case"aria-hidden":b!==!0&&b!=="true"&&delete l["aria-hidden"];break;default:r[v]===void 0&&(l[v]=b)}}const u=Bp(e,i),c=u.attributes;if(i.inline&&(o.verticalAlign="-0.125em"),s==="svg"){l.style={...o,...a},Object.assign(l,c);let v=0,b=t.id;return typeof b=="string"&&(b=b.replace(/-/g,"_")),l.dangerouslySetInnerHTML={__html:Ch(zp(u.body,b?()=>b+"ID"+v++:"iconifyReact"))},h.createElement("svg",l)}const{body:f,width:m,height:p}=e,d=s==="mask"||(s==="bg"?!1:f.indexOf("currentColor")!==-1),g=wh(f,{...c,width:m+"",height:p+""});return l.style={...o,"--svg":Th(g),width:el(c.width),height:el(c.height),...kh,...d?gs:Xa,...a},h.createElement("span",l)};if(Aa(!0),Wp("",Qp),typeof document<"u"&&typeof window<"u"){Ka();const e=window;if(e.IconifyPreload!==void 0){const t=e.IconifyPreload,n="Invalid IconifyPreload syntax.";typeof t=="object"&&t!==null&&(t instanceof Array?t:[t]).forEach(r=>{try{(typeof r!="object"||r===null||r instanceof Array||typeof r.icons!="object"||typeof r.prefix!="string"||!Pp(r))&&console.error(n)}catch{console.error(n)}})}if(e.IconifyProviders!==void 0){const t=e.IconifyProviders;if(typeof t=="object"&&t!==null)for(let n in t){const r="IconifyProviders["+n+"] is invalid.";try{const i=t[n];if(typeof i!="object"||!i||i.resources===void 0)continue;Kp(n,i)||console.error(r)}catch{console.error(r)}}}}function tl(e){const[t,n]=h.useState(!!e.ssr),[r,i]=h.useState({});function s(p){if(p){const d=e.icon;if(typeof d=="object")return{name:"",data:d};const g=$a(d);if(g)return{name:d,data:g}}return{name:""}}const[o,a]=h.useState(s(!!e.ssr));function l(){const p=r.callback;p&&(p(),i({}))}function u(p){if(JSON.stringify(o)!==JSON.stringify(p))return l(),a(p),!0}function c(){var p;const d=e.icon;if(typeof d=="object"){u({name:"",data:d});return}const g=$a(d);if(u({name:d,data:g}))if(g===void 0){const v=gh([d],c);i({callback:v})}else g&&((p=e.onLoad)===null||p===void 0||p.call(e,d))}h.useEffect(()=>(n(!0),l),[]),h.useEffect(()=>{t&&c()},[e.icon,t]);const{name:f,data:m}=o;return m?Ah({...ts,...m},e,f):e.children?e.children:h.createElement("span",{})}const $h=h.forwardRef((e,t)=>tl({...e,_ref:t}));h.forwardRef((e,t)=>tl({inline:!0,...e,_ref:t}));function Be({icon:e,iconClass:t}){return y.jsx(y.Fragment,{children:y.jsx($h,{icon:e,className:t})})}const kn=({text:e="",isDisabled:t=!1,isLoading:n=!1,btnClass:r="bg-primary-500 text-white",icon:i="",iconPosition:s="left",iconClass:o="text-[20px]",loadingClass:a="",link:l="",div:u=!1,type:c="button",style:f,onClick:m})=>{const p=`
|
|
43
43
|
btn inline-flex justify-center
|
|
44
44
|
${n?" pointer-events-none":""}
|
|
45
45
|
${t?" opacity-40 cursor-not-allowed":""}
|
|
46
46
|
${r}
|
|
47
|
-
`,d=()=>n?w.jsxs(w.Fragment,{children:[w.jsxs("svg",{className:`animate-spin -ml-1 mr-3 h-5 w-5 ${l}`,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[w.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),w.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),"Loading..."]}):w.jsxs("span",{className:"flex items-center",children:[i&&o==="left"&&w.jsx("span",{className:`mr-2 ${s}`,children:w.jsx(He,{icon:i})}),e&&w.jsx("span",{children:e}),i&&o==="right"&&w.jsx("span",{className:`ml-2 ${s}`,children:w.jsx(He,{icon:i})})]});return u?w.jsx("div",{className:m,children:d()}):a?w.jsx(Si,{to:a,className:m,children:d()}):w.jsx("button",{disabled:t,type:c,className:m,"data-testid":"btn",onClick:f,children:d()})},Pe=[];for(let e=0;e<256;++e)Pe.push((e+256).toString(16).slice(1));function Zd(e,t=0){return(Pe[e[t+0]]+Pe[e[t+1]]+Pe[e[t+2]]+Pe[e[t+3]]+"-"+Pe[e[t+4]]+Pe[e[t+5]]+"-"+Pe[e[t+6]]+Pe[e[t+7]]+"-"+Pe[e[t+8]]+Pe[e[t+9]]+"-"+Pe[e[t+10]]+Pe[e[t+11]]+Pe[e[t+12]]+Pe[e[t+13]]+Pe[e[t+14]]+Pe[e[t+15]]).toLowerCase()}let Bi;const ep=new Uint8Array(16);function tp(){if(!Bi){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Bi=crypto.getRandomValues.bind(crypto)}return Bi(ep)}const fa={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Or(e,t,n){if(fa.randomUUID&&!t&&!e)return fa.randomUUID();e=e||{};const r=e.random||(e.rng||tp)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,Zd(r)}const Ot=h.createContext(void 0),da={title:"Section title",description:"",id:Or(),questionData:[]},np=({children:e})=>{const[t,n]=h.useState({}),[r,i]=h.useState([da]),[o,s]=h.useState(!1),l=()=>{},a=()=>{i([...r,{...da,id:Or()}])},u=b=>{i(r.filter(g=>g.id!==b))},c=(b,g)=>{i(y=>y.map(x=>x.id===g?{...x,questionData:x.questionData.filter(_=>_.id!==b)}:x))},f=(b,g)=>{i(y=>y.map(x=>x.id===g?{...x,questionData:b}:x))},m=(b,g)=>{i(y=>y.map(x=>x.id===g?{...x,questionData:[...x.questionData,b]}:x))},d=(b,g)=>{i(y=>y.map(x=>x.id===g?{...x,questionData:x.questionData.map(_=>_.id===b.id?{..._,...b}:_)}:x))},p=(b,g)=>{i(y=>y.map(x=>x.id===g?{...x,...b}:x))},v=h.useMemo(()=>({formData:r,setFormData:i,handleDragStop:l,removeElement:c,elementData:t,setElementData:n,updateElementPosition:f,addElement:m,updateElement:d,addSection:a,removeSection:u,updateSection:p,isDragging:o,setIsDragging:s}),[r,l,c,t,f,m,d,a,u,p,o]);return w.jsx(Ot.Provider,{value:v,children:e})};function rp(){const{formData:e}=h.useContext(Ot);function t(){console.log("🚀 ~ BottomBar ~ formData:",e),localStorage.setItem("formData",JSON.stringify(e)),ae.success("Saved successfully")}return w.jsx("div",{className:"px-[30px] py-8 flex justify-end items-center",children:w.jsx(Rn,{onClick:()=>t(),text:"Save Form",btnClass:"text-gray-700 border-[#98A2B3] !font-medium !py-[10px] px-10 bg-blue-600 text-white rounded-lg"})})}function pa({element:e,validationData:t}){const{register:n=()=>({})}=t||{};return w.jsx("input",{placeholder:e.placeholder,type:e.inputType,className:"input-control",...n(e.id)})}function Ar({element:e,validationData:t}){console.log("element",e);const{register:n=()=>({})}=t||{};return w.jsx("div",{children:w.jsx("input",{placeholder:(e==null?void 0:e.placeholder)||"",type:(e==null?void 0:e.inputType)||"text",className:"input-control",...n(e==null?void 0:e.id)})})}function ha({element:e,validationData:t}){return w.jsx("div",{children:"MultiSelectInput"})}function ma({element:e,validationData:t}){const{register:n=()=>({})}=t||{};return w.jsx("input",{placeholder:e.placeholder,type:e.inputType,className:"input-control",...n(e.id)})}var le=function(){return le=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},le.apply(this,arguments)};function ip(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function Qe(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var gt=function(e){return e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")},op={k:1e3,m:1e6,b:1e9},sp=function(e,t){t===void 0&&(t=".");var n=new RegExp("(\\d+(".concat(gt(t),"\\d*)?)([kmb])$"),"i"),r=e.match(n);if(r){var i=r[1],o=r[3],s=op[o.toLowerCase()];return Number(i.replace(t,"."))*s}},ap=function(e,t){t===void 0&&(t=",");var n=new RegExp(gt(t),"g");return e.replace(n,"")},lp=function(e,t){var n=gt(t.join("")),r=new RegExp("[^\\d".concat(n,"]"),"gi");return e.replace(r,"")},Ui=function(e){var t=e.value,n=e.groupSeparator,r=n===void 0?",":n,i=e.decimalSeparator,o=i===void 0?".":i,s=e.allowDecimals,l=s===void 0?!0:s,a=e.decimalsLimit,u=a===void 0?2:a,c=e.allowNegativeValue,f=c===void 0?!0:c,m=e.disableAbbreviations,d=m===void 0?!1:m,p=e.prefix,v=p===void 0?"":p,b=e.transformRawValue,g=b===void 0?function(ee){return ee}:b,y=g(t);if(y==="-")return y;var x=d?[]:["k","m","b"],_=new RegExp("((^|\\D)-\\d)|(-".concat(gt(v),")")),$=_.test(y),S=RegExp("(\\d+)-?".concat(gt(v))).exec(t)||[],C=S[0],A=S[1],L=v?C?y.replace(C,"").concat(A):y.replace(v,""):y,j=ap(L,r),D=lp(j,Qe([r,o],x,!0)),I=D;if(!d){if(x.some(function(ee){return ee===D.toLowerCase().replace(o,"")}))return"";var V=sp(D,o);V&&(I=String(V))}var H=$&&f?"-":"";if(o&&I.includes(o)){var Y=D.split(o),X=Y[0],G=Y[1],z=u&&G?G.slice(0,u):G,Q=l?"".concat(o).concat(z):"";return"".concat(H).concat(X).concat(Q)}return"".concat(H).concat(I)},up=function(e,t,n){if(n!==void 0&&e.length>1){if(n===0)return e.replace(t,"");if(e.includes(t)){var r=e.split(t),i=r[0],o=r[1];if(o.length===n)return e;if(o.length>n)return"".concat(i).concat(t).concat(o.slice(0,n))}var s=e.length>n?new RegExp("(\\d+)(\\d{".concat(n,"})")):new RegExp("(\\d)(\\d+)"),l=e.match(s);if(l){var i=l[1],o=l[2];return"".concat(i).concat(t).concat(o)}}return e},ga=function(e,t){var n=t.groupSeparator,r=n===void 0?",":n,i=t.decimalSeparator,o=i===void 0?".":i,s=new RegExp("\\d([^".concat(gt(r)).concat(gt(o),"0-9]+)")),l=e.match(s);return l?l[1]:void 0},Bn=function(e){var t=e.value,n=e.decimalSeparator,r=e.intlConfig,i=e.decimalScale,o=e.prefix,s=o===void 0?"":o,l=e.suffix,a=l===void 0?"":l;if(t===""||t===void 0)return"";if(t==="-")return"-";var u=new RegExp("^\\d?-".concat(s?"".concat(gt(s),"?"):"","\\d")).test(t),c=n!=="."?cp(t,n,u):t;n&&n!=="-"&&c.startsWith(n)&&(c="0"+c);var f={minimumFractionDigits:i||0,maximumFractionDigits:20},m=r?new Intl.NumberFormat(r.locale,r.currency?le(le({},f),{style:"currency",currency:r.currency}):f):new Intl.NumberFormat(void 0,f),d=m.formatToParts(Number(c)),p=fp(d,e),v=ga(p,le({},e)),b=t.slice(-1)===n?n:"",g=c.match(RegExp("\\d+\\.(\\d+)"))||[],y=g[1];return i===void 0&&y&&n&&(p.includes(n)?p=p.replace(RegExp("(\\d+)(".concat(gt(n),")(\\d+)"),"g"),"$1$2".concat(y)):v&&!a?p=p.replace(v,"".concat(n).concat(y).concat(v)):p="".concat(p).concat(n).concat(y)),a&&b?"".concat(p).concat(b).concat(a):v&&b?p.replace(v,"".concat(b).concat(v)):v&&a?p.replace(v,"".concat(b).concat(a)):[p,b,a].join("")},cp=function(e,t,n){var r=e;return t&&t!=="."&&(r=r.replace(RegExp(gt(t),"g"),"."),n&&t==="-"&&(r="-".concat(r.slice(1)))),r},fp=function(e,t){var n=t.prefix,r=t.groupSeparator,i=t.decimalSeparator,o=t.decimalScale,s=t.disableGroupSeparators,l=s===void 0?!1:s;return e.reduce(function(a,u,c){var f=u.type,m=u.value;return c===0&&n?f==="minusSign"?[m,n]:f==="currency"?Qe(Qe([],a,!0),[n],!1):[n,m]:f==="currency"?n?a:Qe(Qe([],a,!0),[m],!1):f==="group"?l?a:Qe(Qe([],a,!0),[r!==void 0?r:m],!1):f==="decimal"?o!==void 0&&o===0?a:Qe(Qe([],a,!0),[i!==void 0?i:m],!1):f==="fraction"?Qe(Qe([],a,!0),[o!==void 0?m.slice(0,o):m],!1):Qe(Qe([],a,!0),[m],!1)},[""]).join("")},dp={currencySymbol:"",groupSeparator:"",decimalSeparator:"",prefix:"",suffix:""},pp=function(e){var t=e||{},n=t.locale,r=t.currency,i=n?new Intl.NumberFormat(n,r?{currency:r,style:"currency"}:void 0):new Intl.NumberFormat;return i.formatToParts(1000.1).reduce(function(o,s,l){return s.type==="currency"?l===0?le(le({},o),{currencySymbol:s.value,prefix:s.value}):le(le({},o),{currencySymbol:s.value,suffix:s.value}):s.type==="group"?le(le({},o),{groupSeparator:s.value}):s.type==="decimal"?le(le({},o),{decimalSeparator:s.value}):o},dp)},ya=function(e){return RegExp(/\d/,"gi").test(e)},hp=function(e,t,n){if(t===void 0&&(t="."),n===void 0||e===""||e===void 0)return e;if(!e.match(/\d/g))return"";var r=e.split(t),i=r[0],o=r[1];if(n===0)return i;var s=o||"";if(s.length<n)for(;s.length<n;)s+="0";else s=s.slice(0,n);return"".concat(i).concat(t).concat(s)},mp=function(e){var t=e.selectionStart,n=e.value,r=e.lastKeyStroke,i=e.stateValue,o=e.groupSeparator,s=t,l=n;if(i&&s){var a=n.split("");return r==="Backspace"&&i[s]===o&&(a.splice(s-1,1),s-=1),r==="Delete"&&i[s]===o&&(a.splice(s,1),s+=1),l=a.join(""),{modifiedValue:l,cursorPosition:s}}return{modifiedValue:l,cursorPosition:t}},va=h.forwardRef(function(e,t){var n=e.allowDecimals,r=n===void 0?!0:n,i=e.allowNegativeValue,o=i===void 0?!0:i,s=e.id,l=e.name,a=e.className,u=e.customInput,c=e.decimalsLimit,f=e.defaultValue,m=e.disabled,d=m===void 0?!1:m,p=e.maxLength,v=e.value,b=e.onValueChange,g=e.fixedDecimalLength,y=e.placeholder,x=e.decimalScale,_=e.prefix,$=e.suffix,S=e.intlConfig,C=e.step,A=e.min,L=e.max,j=e.disableGroupSeparators,D=j===void 0?!1:j,I=e.disableAbbreviations,V=I===void 0?!1:I,H=e.decimalSeparator,Y=e.groupSeparator,X=e.onChange,G=e.onFocus,z=e.onBlur,Q=e.onKeyDown,ee=e.onKeyUp,Fe=e.transformRawValue,Ae=e.formatValueOnBlur,q=Ae===void 0?!0:Ae,ge=ip(e,["allowDecimals","allowNegativeValue","id","name","className","customInput","decimalsLimit","defaultValue","disabled","maxLength","value","onValueChange","fixedDecimalLength","placeholder","decimalScale","prefix","suffix","intlConfig","step","min","max","disableGroupSeparators","disableAbbreviations","decimalSeparator","groupSeparator","onChange","onFocus","onBlur","onKeyDown","onKeyUp","transformRawValue","formatValueOnBlur"]);if(H&&ya(H))throw new Error("decimalSeparator cannot be a number");if(Y&&ya(Y))throw new Error("groupSeparator cannot be a number");var be=h.useMemo(function(){return pp(S)},[S]),oe=H||be.decimalSeparator||"",ke=Y||be.groupSeparator||"";if(oe&&ke&&oe===ke&&D===!1)throw new Error("decimalSeparator cannot be the same as groupSeparator");var xe={decimalSeparator:oe,groupSeparator:ke,disableGroupSeparators:D,intlConfig:S,prefix:_||be.prefix,suffix:$},De={decimalSeparator:oe,groupSeparator:ke,allowDecimals:r,decimalsLimit:c||g||2,allowNegativeValue:o,disableAbbreviations:V,prefix:_||be.prefix,transformRawValue:Fe},dt=h.useState(function(){return f!=null?Bn(le(le({},xe),{decimalScale:x,value:String(f)})):v!=null?Bn(le(le({},xe),{decimalScale:x,value:String(v)})):""}),we=dt[0],ne=dt[1],de=h.useState(!1),$e=de[0],jt=de[1],Nt=h.useState(0),cn=Nt[0],T=Nt[1],F=h.useState(0),O=F[0],R=F[1],M=h.useState(null),N=M[0],W=M[1],K=h.useRef(null);h.useImperativeHandle(t,function(){return K.current});var he=function(me,Re){jt(!0);var Ne=mp({selectionStart:Re,value:me,lastKeyStroke:N,stateValue:we,groupSeparator:ke}),Be=Ne.modifiedValue,Ie=Ne.cursorPosition,We=Ui(le({value:Be},De));if(!(p&&We.replace(/-/g,"").length>p)){if(We===""||We==="-"||We===oe){b&&b(void 0,l,{float:null,formatted:"",value:""}),ne(We),T(1);return}var ht=oe?We.replace(oe,"."):We,fr=parseFloat(ht),dn=Bn(le({value:We},xe));if(Ie!=null){var pn=Ie+(dn.length-me.length);pn=pn<=0?_?_.length:0:pn,T(pn),R(O+1)}if(ne(dn),b){var ts={float:fr,formatted:dn,value:We};b(We,l,ts)}}},fe=function(me){var Re=me.target,Ne=Re.value,Be=Re.selectionStart;he(Ne,Be),X&&X(me)},pt=function(me){return G&&G(me),we?we.length:0},_n=function(me){var Re=me.target.value,Ne=Ui(le({value:Re},De));if(Ne==="-"||Ne===oe||!Ne){ne(""),z&&z(me);return}var Be=up(Ne,oe,g),Ie=hp(Be,oe,x!==void 0?x:g),We=parseFloat(Ie.replace(oe,".")),ht=Bn(le(le({},xe),{value:Ie}));b&&q&&b(Ie,l,{float:We,formatted:ht,value:Ie}),ne(ht),z&&z(me)},zt=function(me){var Re=me.key;if(W(Re),C&&(Re==="ArrowUp"||Re==="ArrowDown")){me.preventDefault(),T(we.length);var Ne=parseFloat(v!=null?String(v).replace(oe,"."):Ui(le({value:we},De)))||0,Be=Re==="ArrowUp"?Ne+C:Ne-C;if(A!==void 0&&Be<Number(A)||L!==void 0&&Be>Number(L))return;var Ie=String(C).includes(".")?Number(String(C).split(".")[1].length):void 0;he(String(Ie?Be.toFixed(Ie):Be).replace(".",oe))}Q&&Q(me)},It=function(me){var Re=me.key,Ne=me.currentTarget.selectionStart;if(Re!=="ArrowUp"&&Re!=="ArrowDown"&&we!=="-"){var Be=ga(we,{groupSeparator:ke,decimalSeparator:oe});if(Be&&Ne&&Ne>we.length-Be.length&&K.current){var Ie=we.length-Be.length;K.current.setSelectionRange(Ie,Ie)}}ee&&ee(me)};h.useEffect(function(){v==null&&f==null&&ne("")},[f,v]),h.useEffect(function(){$e&&we!=="-"&&K.current&&document.activeElement===K.current&&K.current.setSelectionRange(cn,cn)},[we,cn,K,$e,O]);var ur=function(){return v!=null&&we!=="-"&&(!oe||we!==oe)?Bn(le(le({},xe),{decimalScale:$e?void 0:x,value:String(v)})):we},fn=le({type:"text",inputMode:"decimal",id:s,name:l,className:a,onChange:fe,onBlur:_n,onFocus:pt,onKeyDown:zt,onKeyUp:It,placeholder:y,disabled:d,value:ur(),ref:K},ge);if(u){var cr=u;return h.createElement(cr,le({},fn))}return h.createElement("input",le({},fn))});va.displayName="CurrencyInput";const ye=({label:e,name:t,register:n,errors:r,className:i,type:o="text",placeholder:s="",isFloating:l})=>{var u,c,f,m;const a=n?{...n(t)}:{};return o==="amount"?w.jsxs("div",{className:"space-y-1.5 relative",children:[w.jsx("label",{className:`block text-sm font-medium text-[#344054] font-onest ${l?"z-[40] absolute block text-[#667085] bg-white py-[2px] px-1 -top-[10px] left-3 ":"relative"}`,children:e}),w.jsx(va,{...a,placeholder:s,className:`input-control ${r!=null&&r[t]?"border-red-300":"border-[#D0D5DD]"}`,decimalsLimit:2}),(r==null?void 0:r[t])&&w.jsx("p",{className:"mt-1 text-sm text-red-600",children:(u=r[t])==null?void 0:u.message})]}):["checkbox","radio"].includes(o)?w.jsxs("div",{children:[w.jsxs("label",{className:"flex items-center space-x-2",children:[w.jsx("input",{...a,type:o,className:"h-4 w-4 rounded border-gray-300"}),w.jsx("span",{className:"text-sm font-medium text-[#344054] font-onest",children:e})]}),(r==null?void 0:r[t])&&w.jsx("p",{className:"ml-2 text-sm text-red-600",children:(c=r[t])==null?void 0:c.message})]}):o==="textarea"?w.jsxs("div",{className:"space-y-1.5 relative",children:[w.jsx("label",{className:`block text-sm font-medium text-[#344054] font-onest ${l?"z-[40] absolute block text-[#667085] bg-white py-[2px] px-1 -top-[10px] left-3 ":"relative"}`,children:e}),w.jsx("textarea",{...a,className:`input-control ${r!=null&&r[t]?"border-red-300":"border-[#D0D5DD]"} ${i}`,placeholder:s}),(r==null?void 0:r[t])&&w.jsx("p",{className:"mt-1 text-sm text-red-600",children:(f=r[t])==null?void 0:f.message})]}):w.jsxs("div",{className:"space-y-1.5 relative",children:[w.jsx("label",{className:`block text-sm font-medium text-[#344054] font-onest ${l?"z-[40] absolute block text-[#667085] bg-white py-[2px] px-1 -top-[10px] left-3":"relative"}`,children:e}),w.jsx("input",{...a,type:o,className:`input-control ${r!=null&&r[t]?"border-red-300":"border-[#D0D5DD]"} ${i}`,placeholder:l?"":s}),(r==null?void 0:r[t])&&w.jsx("p",{className:"mt-1 text-sm text-red-600",children:(m=r[t])==null?void 0:m.message})]})};function ba({element:e,validationData:t}){return w.jsx(ye,{placeholder:e.placeholder,type:e.inputType,label:"",name:"",className:"file:bg-gray-600 file:text-white file:rounded-[6px] file:py-[6px] file:border-gray-100 !py-1 file:px-[10px] !px-1"})}const gp=({element:e})=>{const t=h.useMemo(()=>Array.from({length:e.grid},(n,r)=>r),[e.grid]);return w.jsx("div",{className:"grid p-3",style:{gridTemplateColumns:`repeat(${e.grid}, 1fr)`,gap:"8px"},children:t.map(n=>w.jsx("div",{className:"border rounded p-4 min-h-[80px] transition-colors hover:border-gray-400",children:n},n))})},xa=h.memo(gp);function wa({element:e,validationData:t}){const{register:n=()=>({})}=t||{};return w.jsx("input",{placeholder:e.placeholder,type:e.inputType,className:"input-control",...n(e.id)})}function Ea({element:e,validationData:t}){const{register:n=()=>({})}=t||{};return w.jsx("div",{className:"flex flex-wrap gap-y-4 gap-x-6",children:e==null?void 0:e.options.map(r=>w.jsx("div",{children:w.jsx(ye,{placeholder:e.placeholder,type:e.inputType,label:r==null?void 0:r.label,name:"",...n(e.id)})},r.id))})}function Ta({element:e,state:t}){return w.jsx("div",{children:"SectionInput"})}function Sa({element:e,validationData:t}){return w.jsx("div",{className:"flex flex-wrap gap-y-4 gap-x-6",children:e==null?void 0:e.options.map(n=>w.jsx("div",{children:w.jsx(ye,{placeholder:e.placeholder,type:e.inputType,label:n==null?void 0:n.label,name:""})},n.id))})}const _a=typeof document<"u"?h.useLayoutEffect:()=>{};function yp(e){const t=h.useRef(null);return _a(()=>{t.current=e},[e]),h.useCallback((...n)=>{const r=t.current;return r==null?void 0:r(...n)},[])}const Un=e=>{var t;return(t=e==null?void 0:e.ownerDocument)!==null&&t!==void 0?t:document},Xt=e=>e&&"window"in e&&e.window===e?e:Un(e).defaultView||window;function vp(e){var t;return typeof window>"u"||window.navigator==null?!1:((t=window.navigator.userAgentData)===null||t===void 0?void 0:t.brands.some(n=>e.test(n.brand)))||e.test(window.navigator.userAgent)}function bp(e){var t;return typeof window<"u"&&window.navigator!=null?e.test(((t=window.navigator.userAgentData)===null||t===void 0?void 0:t.platform)||window.navigator.platform):!1}function Ca(e){let t=null;return()=>(t==null&&(t=e()),t)}const xp=Ca(function(){return bp(/^Mac/i)}),wp=Ca(function(){return vp(/Android/i)});function Ep(e){return e.mozInputSource===0&&e.isTrusted?!0:wp()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}class Tp{isDefaultPrevented(){return this.nativeEvent.defaultPrevented}preventDefault(){this.defaultPrevented=!0,this.nativeEvent.preventDefault()}stopPropagation(){this.nativeEvent.stopPropagation(),this.isPropagationStopped=()=>!0}isPropagationStopped(){return!1}persist(){}constructor(t,n){this.nativeEvent=n,this.target=n.target,this.currentTarget=n.currentTarget,this.relatedTarget=n.relatedTarget,this.bubbles=n.bubbles,this.cancelable=n.cancelable,this.defaultPrevented=n.defaultPrevented,this.eventPhase=n.eventPhase,this.isTrusted=n.isTrusted,this.timeStamp=n.timeStamp,this.type=t}}function Fa(e){let t=h.useRef({isFocused:!1,observer:null});_a(()=>{const r=t.current;return()=>{r.observer&&(r.observer.disconnect(),r.observer=null)}},[]);let n=yp(r=>{e==null||e(r)});return h.useCallback(r=>{if(r.target instanceof HTMLButtonElement||r.target instanceof HTMLInputElement||r.target instanceof HTMLTextAreaElement||r.target instanceof HTMLSelectElement){t.current.isFocused=!0;let i=r.target,o=s=>{t.current.isFocused=!1,i.disabled&&n(new Tp("blur",s)),t.current.observer&&(t.current.observer.disconnect(),t.current.observer=null)};i.addEventListener("focusout",o,{once:!0}),t.current.observer=new MutationObserver(()=>{if(t.current.isFocused&&i.disabled){var s;(s=t.current.observer)===null||s===void 0||s.disconnect();let l=i===document.activeElement?null:document.activeElement;i.dispatchEvent(new FocusEvent("blur",{relatedTarget:l})),i.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:l}))}}),t.current.observer.observe(i,{attributes:!0,attributeFilter:["disabled"]})}},[n])}function Sp(e){let{isDisabled:t,onFocus:n,onBlur:r,onFocusChange:i}=e;const o=h.useCallback(a=>{if(a.target===a.currentTarget)return r&&r(a),i&&i(!1),!0},[r,i]),s=Fa(o),l=h.useCallback(a=>{const u=Un(a.target);a.target===a.currentTarget&&u.activeElement===a.target&&(n&&n(a),i&&i(!0),s(a))},[i,n,s]);return{focusProps:{onFocus:!t&&(n||i||r)?l:void 0,onBlur:!t&&(r||i)?o:void 0}}}let Hn=null,Hi=new Set,qn=new Map,Jt=!1,qi=!1;const _p={Tab:!0,Escape:!0};function zi(e,t){for(let n of Hi)n(e,t)}function Cp(e){return!(e.metaKey||!xp()&&e.altKey||e.ctrlKey||e.key==="Control"||e.key==="Shift"||e.key==="Meta")}function Dr(e){Jt=!0,Cp(e)&&(Hn="keyboard",zi("keyboard",e))}function it(e){Hn="pointer",(e.type==="mousedown"||e.type==="pointerdown")&&(Jt=!0,zi("pointer",e))}function ka(e){Ep(e)&&(Jt=!0,Hn="virtual")}function $a(e){e.target===window||e.target===document||(!Jt&&!qi&&(Hn="virtual",zi("virtual",e)),Jt=!1,qi=!1)}function Oa(){Jt=!1,qi=!0}function Wi(e){if(typeof window>"u"||qn.get(Xt(e)))return;const t=Xt(e),n=Un(e);let r=t.HTMLElement.prototype.focus;t.HTMLElement.prototype.focus=function(){Jt=!0,r.apply(this,arguments)},n.addEventListener("keydown",Dr,!0),n.addEventListener("keyup",Dr,!0),n.addEventListener("click",ka,!0),t.addEventListener("focus",$a,!0),t.addEventListener("blur",Oa,!1),typeof PointerEvent<"u"?(n.addEventListener("pointerdown",it,!0),n.addEventListener("pointermove",it,!0),n.addEventListener("pointerup",it,!0)):(n.addEventListener("mousedown",it,!0),n.addEventListener("mousemove",it,!0),n.addEventListener("mouseup",it,!0)),t.addEventListener("beforeunload",()=>{Aa(e)},{once:!0}),qn.set(t,{focus:r})}const Aa=(e,t)=>{const n=Xt(e),r=Un(e);t&&r.removeEventListener("DOMContentLoaded",t),qn.has(n)&&(n.HTMLElement.prototype.focus=qn.get(n).focus,r.removeEventListener("keydown",Dr,!0),r.removeEventListener("keyup",Dr,!0),r.removeEventListener("click",ka,!0),n.removeEventListener("focus",$a,!0),n.removeEventListener("blur",Oa,!1),typeof PointerEvent<"u"?(r.removeEventListener("pointerdown",it,!0),r.removeEventListener("pointermove",it,!0),r.removeEventListener("pointerup",it,!0)):(r.removeEventListener("mousedown",it,!0),r.removeEventListener("mousemove",it,!0),r.removeEventListener("mouseup",it,!0)),qn.delete(n))};function Fp(e){const t=Un(e);let n;return t.readyState!=="loading"?Wi(e):(n=()=>{Wi(e)},t.addEventListener("DOMContentLoaded",n)),()=>Aa(e,n)}typeof document<"u"&&Fp();function Da(){return Hn!=="pointer"}const kp=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function $p(e,t,n){var r;const i=typeof window<"u"?Xt(n==null?void 0:n.target).HTMLInputElement:HTMLInputElement,o=typeof window<"u"?Xt(n==null?void 0:n.target).HTMLTextAreaElement:HTMLTextAreaElement,s=typeof window<"u"?Xt(n==null?void 0:n.target).HTMLElement:HTMLElement,l=typeof window<"u"?Xt(n==null?void 0:n.target).KeyboardEvent:KeyboardEvent;return e=e||(n==null?void 0:n.target)instanceof i&&!kp.has(n==null||(r=n.target)===null||r===void 0?void 0:r.type)||(n==null?void 0:n.target)instanceof o||(n==null?void 0:n.target)instanceof s&&(n==null?void 0:n.target.isContentEditable),!(e&&t==="keyboard"&&n instanceof l&&!_p[n.key])}function Op(e,t,n){Wi(),h.useEffect(()=>{let r=(i,o)=>{$p(!!(n!=null&&n.isTextInput),i,o)&&e(Da())};return Hi.add(r),()=>{Hi.delete(r)}},t)}function Ap(e){let{isDisabled:t,onBlurWithin:n,onFocusWithin:r,onFocusWithinChange:i}=e,o=h.useRef({isFocusWithin:!1}),s=h.useCallback(u=>{o.current.isFocusWithin&&!u.currentTarget.contains(u.relatedTarget)&&(o.current.isFocusWithin=!1,n&&n(u),i&&i(!1))},[n,i,o]),l=Fa(s),a=h.useCallback(u=>{!o.current.isFocusWithin&&document.activeElement===u.target&&(r&&r(u),i&&i(!0),o.current.isFocusWithin=!0,l(u))},[r,i,l]);return t?{focusWithinProps:{onFocus:void 0,onBlur:void 0}}:{focusWithinProps:{onFocus:a,onBlur:s}}}let Lr=!1,Ki=0;function Yi(){Lr=!0,setTimeout(()=>{Lr=!1},50)}function La(e){e.pointerType==="touch"&&Yi()}function Dp(){if(!(typeof document>"u"))return typeof PointerEvent<"u"?document.addEventListener("pointerup",La):document.addEventListener("touchend",Yi),Ki++,()=>{Ki--,!(Ki>0)&&(typeof PointerEvent<"u"?document.removeEventListener("pointerup",La):document.removeEventListener("touchend",Yi))}}function Lp(e){let{onHoverStart:t,onHoverChange:n,onHoverEnd:r,isDisabled:i}=e,[o,s]=h.useState(!1),l=h.useRef({isHovered:!1,ignoreEmulatedMouseEvents:!1,pointerType:"",target:null}).current;h.useEffect(Dp,[]);let{hoverProps:a,triggerHoverEnd:u}=h.useMemo(()=>{let c=(d,p)=>{if(l.pointerType=p,i||p==="touch"||l.isHovered||!d.currentTarget.contains(d.target))return;l.isHovered=!0;let v=d.currentTarget;l.target=v,t&&t({type:"hoverstart",target:v,pointerType:p}),n&&n(!0),s(!0)},f=(d,p)=>{if(l.pointerType="",l.target=null,p==="touch"||!l.isHovered)return;l.isHovered=!1;let v=d.currentTarget;r&&r({type:"hoverend",target:v,pointerType:p}),n&&n(!1),s(!1)},m={};return typeof PointerEvent<"u"?(m.onPointerEnter=d=>{Lr&&d.pointerType==="mouse"||c(d,d.pointerType)},m.onPointerLeave=d=>{!i&&d.currentTarget.contains(d.target)&&f(d,d.pointerType)}):(m.onTouchStart=()=>{l.ignoreEmulatedMouseEvents=!0},m.onMouseEnter=d=>{!l.ignoreEmulatedMouseEvents&&!Lr&&c(d,"mouse"),l.ignoreEmulatedMouseEvents=!1},m.onMouseLeave=d=>{!i&&d.currentTarget.contains(d.target)&&f(d,"mouse")}),{hoverProps:m,triggerHoverEnd:f}},[t,n,r,i,l]);return h.useEffect(()=>{i&&u({currentTarget:l.target},l.pointerType)},[i]),{hoverProps:a,isHovered:o}}function Pp(e={}){let{autoFocus:t=!1,isTextInput:n,within:r}=e,i=h.useRef({isFocused:!1,isFocusVisible:t||Da()}),[o,s]=h.useState(!1),[l,a]=h.useState(()=>i.current.isFocused&&i.current.isFocusVisible),u=h.useCallback(()=>a(i.current.isFocused&&i.current.isFocusVisible),[]),c=h.useCallback(d=>{i.current.isFocused=d,s(d),u()},[u]);Op(d=>{i.current.isFocusVisible=d,u()},[],{isTextInput:n});let{focusProps:f}=Sp({isDisabled:r,onFocusChange:c}),{focusWithinProps:m}=Ap({isDisabled:!r,onFocusWithinChange:c});return{isFocused:o,isFocusVisible:l,focusProps:r?m:f}}var jp=Object.defineProperty,Np=(e,t,n)=>t in e?jp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Gi=(e,t,n)=>(Np(e,typeof t!="symbol"?t+"":t,n),n);let Ip=class{constructor(){Gi(this,"current",this.detect()),Gi(this,"handoffState","pending"),Gi(this,"currentId",0)}set(t){this.current!==t&&(this.handoffState="pending",this.currentId=0,this.current=t)}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"}},Qt=new Ip;function zn(e){return Qt.isServer?null:e instanceof Node?e.ownerDocument:e!=null&&e.hasOwnProperty("current")&&e.current instanceof Node?e.current.ownerDocument:document}function Pa(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t}))}function At(){let e=[],t={addEventListener(n,r,i,o){return n.addEventListener(r,i,o),t.add(()=>n.removeEventListener(r,i,o))},requestAnimationFrame(...n){let r=requestAnimationFrame(...n);return t.add(()=>cancelAnimationFrame(r))},nextFrame(...n){return t.requestAnimationFrame(()=>t.requestAnimationFrame(...n))},setTimeout(...n){let r=setTimeout(...n);return t.add(()=>clearTimeout(r))},microTask(...n){let r={current:!0};return Pa(()=>{r.current&&n[0]()}),t.add(()=>{r.current=!1})},style(n,r,i){let o=n.style.getPropertyValue(r);return Object.assign(n.style,{[r]:i}),this.add(()=>{Object.assign(n.style,{[r]:o})})},group(n){let r=At();return n(r),this.add(()=>r.dispose())},add(n){return e.includes(n)||e.push(n),()=>{let r=e.indexOf(n);if(r>=0)for(let i of e.splice(r,1))i()}},dispose(){for(let n of e.splice(0))n()}};return t}function Zt(){let[e]=h.useState(At);return h.useEffect(()=>()=>e.dispose(),[e]),e}let pe=(e,t)=>{Qt.isServer?h.useEffect(e,t):h.useLayoutEffect(e,t)};function en(e){let t=h.useRef(e);return pe(()=>{t.current=e},[e]),t}let Z=function(e){let t=en(e);return h.useCallback((...n)=>t.current(...n),[t])};function Mp(e){let t=e.width/2,n=e.height/2;return{top:e.clientY-n,right:e.clientX+t,bottom:e.clientY+n,left:e.clientX-t}}function Vp(e,t){return!(!e||!t||e.right<t.left||e.left>t.right||e.bottom<t.top||e.top>t.bottom)}function Rp({disabled:e=!1}={}){let t=h.useRef(null),[n,r]=h.useState(!1),i=Zt(),o=Z(()=>{t.current=null,r(!1),i.dispose()}),s=Z(l=>{if(i.dispose(),t.current===null){t.current=l.currentTarget,r(!0);{let a=zn(l.currentTarget);i.addEventListener(a,"pointerup",o,!1),i.addEventListener(a,"pointermove",u=>{if(t.current){let c=Mp(u);r(Vp(c,t.current.getBoundingClientRect()))}},!1),i.addEventListener(a,"pointercancel",o,!1)}}});return{pressed:n,pressProps:e?{}:{onPointerDown:s,onPointerUp:o,onClick:o}}}let Bp=h.createContext(void 0);function Xi(){return h.useContext(Bp)}function Ji(...e){return Array.from(new Set(e.flatMap(t=>typeof t=="string"?t.split(" "):[]))).filter(Boolean).join(" ")}function lt(e,t,...n){if(e in t){let i=t[e];return typeof i=="function"?i(...n):i}let r=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map(i=>`"${i}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,lt),r}var Pr=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(Pr||{}),Mt=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(Mt||{});function Ze(){let e=Hp();return h.useCallback(t=>Up({mergeRefs:e,...t}),[e])}function Up({ourProps:e,theirProps:t,slot:n,defaultTag:r,features:i,visible:o=!0,name:s,mergeRefs:l}){l=l??qp;let a=ja(t,e);if(o)return jr(a,n,r,s,l);let u=i??0;if(u&2){let{static:c=!1,...f}=a;if(c)return jr(f,n,r,s,l)}if(u&1){let{unmount:c=!0,...f}=a;return lt(c?0:1,{0(){return null},1(){return jr({...f,hidden:!0,style:{display:"none"}},n,r,s,l)}})}return jr(a,n,r,s,l)}function jr(e,t={},n,r,i){let{as:o=n,children:s,refName:l="ref",...a}=Qi(e,["unmount","static"]),u=e.ref!==void 0?{[l]:e.ref}:{},c=typeof s=="function"?s(t):s;"className"in a&&a.className&&typeof a.className=="function"&&(a.className=a.className(t)),a["aria-labelledby"]&&a["aria-labelledby"]===a.id&&(a["aria-labelledby"]=void 0);let f={};if(t){let m=!1,d=[];for(let[p,v]of Object.entries(t))typeof v=="boolean"&&(m=!0),v===!0&&d.push(p.replace(/([A-Z])/g,b=>`-${b.toLowerCase()}`));if(m){f["data-headlessui-state"]=d.join(" ");for(let p of d)f[`data-${p}`]=""}}if(o===h.Fragment&&(Object.keys(Vt(a)).length>0||Object.keys(Vt(f)).length>0))if(!h.isValidElement(c)||Array.isArray(c)&&c.length>1){if(Object.keys(Vt(a)).length>0)throw new Error(['Passing props on "Fragment"!',"",`The current component <${r} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(Vt(a)).concat(Object.keys(Vt(f))).map(m=>` - ${m}`).join(`
|
|
47
|
+
`,d=()=>n?y.jsxs(y.Fragment,{children:[y.jsxs("svg",{className:`animate-spin -ml-1 mr-3 h-5 w-5 ${a}`,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[y.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),y.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),"Loading..."]}):y.jsxs("span",{className:"flex items-center",children:[i&&s==="left"&&y.jsx("span",{className:`mr-2 ${o}`,children:y.jsx(Be,{icon:i})}),e&&y.jsx("span",{children:e}),i&&s==="right"&&y.jsx("span",{className:`ml-2 ${o}`,children:y.jsx(Be,{icon:i})})]});return u?y.jsx("div",{className:p,children:d()}):l?y.jsx(es,{to:l,className:p,children:d()}):y.jsx("button",{disabled:t,type:c,className:p,"data-testid":"btn",onClick:m,style:f,children:d()})},Ie=[];for(let e=0;e<256;++e)Ie.push((e+256).toString(16).slice(1));function jh(e,t=0){return(Ie[e[t+0]]+Ie[e[t+1]]+Ie[e[t+2]]+Ie[e[t+3]]+"-"+Ie[e[t+4]]+Ie[e[t+5]]+"-"+Ie[e[t+6]]+Ie[e[t+7]]+"-"+Ie[e[t+8]]+Ie[e[t+9]]+"-"+Ie[e[t+10]]+Ie[e[t+11]]+Ie[e[t+12]]+Ie[e[t+13]]+Ie[e[t+14]]+Ie[e[t+15]]).toLowerCase()}let ys;const Nh=new Uint8Array(16);function Ph(){if(!ys){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");ys=crypto.getRandomValues.bind(crypto)}return ys(Nh)}const nl={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function tr(e,t,n){if(nl.randomUUID&&!t&&!e)return nl.randomUUID();e=e||{};const r=e.random||(e.rng||Ph)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,jh(r)}const ht=h.createContext(void 0),rl={title:"",description:"",id:tr(),questionData:[]},Lh=({children:e})=>{const[t,n]=h.useState({}),[r,i]=h.useState([rl]),[s,o]=h.useState(!1),[a,l]=h.useState(null),u=h.useCallback(()=>{},[]),c=h.useCallback(()=>{const x=tr();i(w=>[...w,{...rl,id:x}]),l(x)},[]),f=h.useCallback(x=>{i(w=>w.filter(T=>T.id!==x))},[]),m=h.useCallback((x,w)=>{i(T=>T.map(C=>C.id===w?{...C,questionData:C.questionData.filter(_=>_.id!==x)}:C))},[]),p=h.useCallback((x,w)=>{i(T=>T.map(C=>C.id===w?{...C,questionData:x}:C))},[]),d=h.useCallback((x,w)=>{i(T=>T.map(C=>C.id===w?{...C,questionData:[...C.questionData,x]}:C))},[]),g=h.useCallback((x,w)=>{i(T=>T.map(C=>C.id===w?{...C,questionData:C.questionData.map(_=>_.id===x.id?{..._,...x}:_)}:C))},[]),v=h.useCallback((x,w)=>{i(T=>T.map(C=>C.id===w?{...C,...x}:C))},[]),b=h.useMemo(()=>({formData:r,setFormData:i,handleDragStop:u,removeElement:m,elementData:t,setElementData:n,updateElementPosition:p,addElement:d,updateElement:g,addSection:c,removeSection:f,updateSection:v,isDragging:s,setIsDragging:o,selectedSection:a,setSelectedSection:l}),[r,u,m,t,p,d,g,c,f,v,s,a]);return y.jsx(ht.Provider,{value:b,children:e})},bs=e=>{const t=typeof window<"u"?localStorage.getItem(e):"";try{return JSON.parse(t)}catch{return t}},il=(e,t)=>{const n=typeof t!="string"?JSON.stringify(t):t;return localStorage.setItem(e,n)};function Dh({onSubmit:e}){const{formData:t}=h.useContext(ht),n=bs("config");function r(){localStorage.setItem("formData",JSON.stringify(t)),e(t),ue.success("Saved successfully")}return y.jsx("div",{className:"px-[30px] py-8 flex justify-end items-center",children:y.jsx(kn,{onClick:()=>r(),text:"Save Form",style:{background:n.buttonColor},btnClass:"text-gray-700 border-[#98A2B3] !font-medium !py-[10px] px-10 bg-blue-600 text-white rounded-lg"})})}function sl({element:e,validationData:t}){const{register:n=()=>({})}=t||{};return y.jsx("input",{placeholder:e.placeholder,type:e.inputType,className:"input-control",...n(e.id)})}function Yr({element:e,validationData:t}){const{register:n=()=>({})}=t||{};return y.jsx("div",{children:y.jsx("input",{placeholder:(e==null?void 0:e.placeholder)||"",type:(e==null?void 0:e.inputType)||"text",className:"input-control",...n(e==null?void 0:e.id)})})}const ol=typeof document<"u"?h.useLayoutEffect:()=>{};function Ih(e){const t=h.useRef(null);return ol(()=>{t.current=e},[e]),h.useCallback((...n)=>{const r=t.current;return r==null?void 0:r(...n)},[])}const nr=e=>{var t;return(t=e==null?void 0:e.ownerDocument)!==null&&t!==void 0?t:document},on=e=>e&&"window"in e&&e.window===e?e:nr(e).defaultView||window;function Mh(e){var t;return typeof window>"u"||window.navigator==null?!1:((t=window.navigator.userAgentData)===null||t===void 0?void 0:t.brands.some(n=>e.test(n.brand)))||e.test(window.navigator.userAgent)}function Rh(e){var t;return typeof window<"u"&&window.navigator!=null?e.test(((t=window.navigator.userAgentData)===null||t===void 0?void 0:t.platform)||window.navigator.platform):!1}function al(e){let t=null;return()=>(t==null&&(t=e()),t)}const Vh=al(function(){return Rh(/^Mac/i)}),Bh=al(function(){return Mh(/Android/i)});function Uh(e){return e.mozInputSource===0&&e.isTrusted?!0:Bh()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}class Hh{isDefaultPrevented(){return this.nativeEvent.defaultPrevented}preventDefault(){this.defaultPrevented=!0,this.nativeEvent.preventDefault()}stopPropagation(){this.nativeEvent.stopPropagation(),this.isPropagationStopped=()=>!0}isPropagationStopped(){return!1}persist(){}constructor(t,n){this.nativeEvent=n,this.target=n.target,this.currentTarget=n.currentTarget,this.relatedTarget=n.relatedTarget,this.bubbles=n.bubbles,this.cancelable=n.cancelable,this.defaultPrevented=n.defaultPrevented,this.eventPhase=n.eventPhase,this.isTrusted=n.isTrusted,this.timeStamp=n.timeStamp,this.type=t}}function ll(e){let t=h.useRef({isFocused:!1,observer:null});ol(()=>{const r=t.current;return()=>{r.observer&&(r.observer.disconnect(),r.observer=null)}},[]);let n=Ih(r=>{e==null||e(r)});return h.useCallback(r=>{if(r.target instanceof HTMLButtonElement||r.target instanceof HTMLInputElement||r.target instanceof HTMLTextAreaElement||r.target instanceof HTMLSelectElement){t.current.isFocused=!0;let i=r.target,s=o=>{t.current.isFocused=!1,i.disabled&&n(new Hh("blur",o)),t.current.observer&&(t.current.observer.disconnect(),t.current.observer=null)};i.addEventListener("focusout",s,{once:!0}),t.current.observer=new MutationObserver(()=>{if(t.current.isFocused&&i.disabled){var o;(o=t.current.observer)===null||o===void 0||o.disconnect();let a=i===document.activeElement?null:document.activeElement;i.dispatchEvent(new FocusEvent("blur",{relatedTarget:a})),i.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:a}))}}),t.current.observer.observe(i,{attributes:!0,attributeFilter:["disabled"]})}},[n])}function qh(e){let{isDisabled:t,onFocus:n,onBlur:r,onFocusChange:i}=e;const s=h.useCallback(l=>{if(l.target===l.currentTarget)return r&&r(l),i&&i(!1),!0},[r,i]),o=ll(s),a=h.useCallback(l=>{const u=nr(l.target);l.target===l.currentTarget&&u.activeElement===l.target&&(n&&n(l),i&&i(!0),o(l))},[i,n,o]);return{focusProps:{onFocus:!t&&(n||i||r)?a:void 0,onBlur:!t&&(r||i)?s:void 0}}}let rr=null,vs=new Set,ir=new Map,an=!1,xs=!1;const zh={Tab:!0,Escape:!0};function ws(e,t){for(let n of vs)n(e,t)}function Wh(e){return!(e.metaKey||!Vh()&&e.altKey||e.ctrlKey||e.key==="Control"||e.key==="Shift"||e.key==="Meta")}function Gr(e){an=!0,Wh(e)&&(rr="keyboard",ws("keyboard",e))}function ct(e){rr="pointer",(e.type==="mousedown"||e.type==="pointerdown")&&(an=!0,ws("pointer",e))}function ul(e){Uh(e)&&(an=!0,rr="virtual")}function cl(e){e.target===window||e.target===document||(!an&&!xs&&(rr="virtual",ws("virtual",e)),an=!1,xs=!1)}function fl(){an=!1,xs=!0}function Es(e){if(typeof window>"u"||ir.get(on(e)))return;const t=on(e),n=nr(e);let r=t.HTMLElement.prototype.focus;t.HTMLElement.prototype.focus=function(){an=!0,r.apply(this,arguments)},n.addEventListener("keydown",Gr,!0),n.addEventListener("keyup",Gr,!0),n.addEventListener("click",ul,!0),t.addEventListener("focus",cl,!0),t.addEventListener("blur",fl,!1),typeof PointerEvent<"u"?(n.addEventListener("pointerdown",ct,!0),n.addEventListener("pointermove",ct,!0),n.addEventListener("pointerup",ct,!0)):(n.addEventListener("mousedown",ct,!0),n.addEventListener("mousemove",ct,!0),n.addEventListener("mouseup",ct,!0)),t.addEventListener("beforeunload",()=>{dl(e)},{once:!0}),ir.set(t,{focus:r})}const dl=(e,t)=>{const n=on(e),r=nr(e);t&&r.removeEventListener("DOMContentLoaded",t),ir.has(n)&&(n.HTMLElement.prototype.focus=ir.get(n).focus,r.removeEventListener("keydown",Gr,!0),r.removeEventListener("keyup",Gr,!0),r.removeEventListener("click",ul,!0),n.removeEventListener("focus",cl,!0),n.removeEventListener("blur",fl,!1),typeof PointerEvent<"u"?(r.removeEventListener("pointerdown",ct,!0),r.removeEventListener("pointermove",ct,!0),r.removeEventListener("pointerup",ct,!0)):(r.removeEventListener("mousedown",ct,!0),r.removeEventListener("mousemove",ct,!0),r.removeEventListener("mouseup",ct,!0)),ir.delete(n))};function Kh(e){const t=nr(e);let n;return t.readyState!=="loading"?Es(e):(n=()=>{Es(e)},t.addEventListener("DOMContentLoaded",n)),()=>dl(e,n)}typeof document<"u"&&Kh();function pl(){return rr!=="pointer"}const Jh=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function Yh(e,t,n){var r;const i=typeof window<"u"?on(n==null?void 0:n.target).HTMLInputElement:HTMLInputElement,s=typeof window<"u"?on(n==null?void 0:n.target).HTMLTextAreaElement:HTMLTextAreaElement,o=typeof window<"u"?on(n==null?void 0:n.target).HTMLElement:HTMLElement,a=typeof window<"u"?on(n==null?void 0:n.target).KeyboardEvent:KeyboardEvent;return e=e||(n==null?void 0:n.target)instanceof i&&!Jh.has(n==null||(r=n.target)===null||r===void 0?void 0:r.type)||(n==null?void 0:n.target)instanceof s||(n==null?void 0:n.target)instanceof o&&(n==null?void 0:n.target.isContentEditable),!(e&&t==="keyboard"&&n instanceof a&&!zh[n.key])}function Gh(e,t,n){Es(),h.useEffect(()=>{let r=(i,s)=>{Yh(!!(n!=null&&n.isTextInput),i,s)&&e(pl())};return vs.add(r),()=>{vs.delete(r)}},t)}function Xh(e){let{isDisabled:t,onBlurWithin:n,onFocusWithin:r,onFocusWithinChange:i}=e,s=h.useRef({isFocusWithin:!1}),o=h.useCallback(u=>{s.current.isFocusWithin&&!u.currentTarget.contains(u.relatedTarget)&&(s.current.isFocusWithin=!1,n&&n(u),i&&i(!1))},[n,i,s]),a=ll(o),l=h.useCallback(u=>{!s.current.isFocusWithin&&document.activeElement===u.target&&(r&&r(u),i&&i(!0),s.current.isFocusWithin=!0,a(u))},[r,i,a]);return t?{focusWithinProps:{onFocus:void 0,onBlur:void 0}}:{focusWithinProps:{onFocus:l,onBlur:o}}}let Xr=!1,Ss=0;function Ts(){Xr=!0,setTimeout(()=>{Xr=!1},50)}function hl(e){e.pointerType==="touch"&&Ts()}function Qh(){if(!(typeof document>"u"))return typeof PointerEvent<"u"?document.addEventListener("pointerup",hl):document.addEventListener("touchend",Ts),Ss++,()=>{Ss--,!(Ss>0)&&(typeof PointerEvent<"u"?document.removeEventListener("pointerup",hl):document.removeEventListener("touchend",Ts))}}function Zh(e){let{onHoverStart:t,onHoverChange:n,onHoverEnd:r,isDisabled:i}=e,[s,o]=h.useState(!1),a=h.useRef({isHovered:!1,ignoreEmulatedMouseEvents:!1,pointerType:"",target:null}).current;h.useEffect(Qh,[]);let{hoverProps:l,triggerHoverEnd:u}=h.useMemo(()=>{let c=(p,d)=>{if(a.pointerType=d,i||d==="touch"||a.isHovered||!p.currentTarget.contains(p.target))return;a.isHovered=!0;let g=p.currentTarget;a.target=g,t&&t({type:"hoverstart",target:g,pointerType:d}),n&&n(!0),o(!0)},f=(p,d)=>{if(a.pointerType="",a.target=null,d==="touch"||!a.isHovered)return;a.isHovered=!1;let g=p.currentTarget;r&&r({type:"hoverend",target:g,pointerType:d}),n&&n(!1),o(!1)},m={};return typeof PointerEvent<"u"?(m.onPointerEnter=p=>{Xr&&p.pointerType==="mouse"||c(p,p.pointerType)},m.onPointerLeave=p=>{!i&&p.currentTarget.contains(p.target)&&f(p,p.pointerType)}):(m.onTouchStart=()=>{a.ignoreEmulatedMouseEvents=!0},m.onMouseEnter=p=>{!a.ignoreEmulatedMouseEvents&&!Xr&&c(p,"mouse"),a.ignoreEmulatedMouseEvents=!1},m.onMouseLeave=p=>{!i&&p.currentTarget.contains(p.target)&&f(p,"mouse")}),{hoverProps:m,triggerHoverEnd:f}},[t,n,r,i,a]);return h.useEffect(()=>{i&&u({currentTarget:a.target},a.pointerType)},[i]),{hoverProps:l,isHovered:s}}function em(e={}){let{autoFocus:t=!1,isTextInput:n,within:r}=e,i=h.useRef({isFocused:!1,isFocusVisible:t||pl()}),[s,o]=h.useState(!1),[a,l]=h.useState(()=>i.current.isFocused&&i.current.isFocusVisible),u=h.useCallback(()=>l(i.current.isFocused&&i.current.isFocusVisible),[]),c=h.useCallback(p=>{i.current.isFocused=p,o(p),u()},[u]);Gh(p=>{i.current.isFocusVisible=p,u()},[],{isTextInput:n});let{focusProps:f}=qh({isDisabled:r,onFocusChange:c}),{focusWithinProps:m}=Xh({isDisabled:!r,onFocusWithinChange:c});return{isFocused:s,isFocusVisible:a,focusProps:r?m:f}}var tm=Object.defineProperty,nm=(e,t,n)=>t in e?tm(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,_s=(e,t,n)=>(nm(e,typeof t!="symbol"?t+"":t,n),n);let rm=class{constructor(){_s(this,"current",this.detect()),_s(this,"handoffState","pending"),_s(this,"currentId",0)}set(t){this.current!==t&&(this.handoffState="pending",this.currentId=0,this.current=t)}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"}},ln=new rm;function sr(e){return ln.isServer?null:e instanceof Node?e.ownerDocument:e!=null&&e.hasOwnProperty("current")&&e.current instanceof Node?e.current.ownerDocument:document}function ml(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t}))}function Rt(){let e=[],t={addEventListener(n,r,i,s){return n.addEventListener(r,i,s),t.add(()=>n.removeEventListener(r,i,s))},requestAnimationFrame(...n){let r=requestAnimationFrame(...n);return t.add(()=>cancelAnimationFrame(r))},nextFrame(...n){return t.requestAnimationFrame(()=>t.requestAnimationFrame(...n))},setTimeout(...n){let r=setTimeout(...n);return t.add(()=>clearTimeout(r))},microTask(...n){let r={current:!0};return ml(()=>{r.current&&n[0]()}),t.add(()=>{r.current=!1})},style(n,r,i){let s=n.style.getPropertyValue(r);return Object.assign(n.style,{[r]:i}),this.add(()=>{Object.assign(n.style,{[r]:s})})},group(n){let r=Rt();return n(r),this.add(()=>r.dispose())},add(n){return e.includes(n)||e.push(n),()=>{let r=e.indexOf(n);if(r>=0)for(let i of e.splice(r,1))i()}},dispose(){for(let n of e.splice(0))n()}};return t}function un(){let[e]=h.useState(Rt);return h.useEffect(()=>()=>e.dispose(),[e]),e}let me=(e,t)=>{ln.isServer?h.useEffect(e,t):h.useLayoutEffect(e,t)};function cn(e){let t=h.useRef(e);return me(()=>{t.current=e},[e]),t}let te=function(e){let t=cn(e);return h.useCallback((...n)=>t.current(...n),[t])};function im(e){let t=e.width/2,n=e.height/2;return{top:e.clientY-n,right:e.clientX+t,bottom:e.clientY+n,left:e.clientX-t}}function sm(e,t){return!(!e||!t||e.right<t.left||e.left>t.right||e.bottom<t.top||e.top>t.bottom)}function om({disabled:e=!1}={}){let t=h.useRef(null),[n,r]=h.useState(!1),i=un(),s=te(()=>{t.current=null,r(!1),i.dispose()}),o=te(a=>{if(i.dispose(),t.current===null){t.current=a.currentTarget,r(!0);{let l=sr(a.currentTarget);i.addEventListener(l,"pointerup",s,!1),i.addEventListener(l,"pointermove",u=>{if(t.current){let c=im(u);r(sm(c,t.current.getBoundingClientRect()))}},!1),i.addEventListener(l,"pointercancel",s,!1)}}});return{pressed:n,pressProps:e?{}:{onPointerDown:o,onPointerUp:s,onClick:s}}}let am=h.createContext(void 0);function Cs(){return h.useContext(am)}function Os(...e){return Array.from(new Set(e.flatMap(t=>typeof t=="string"?t.split(" "):[]))).filter(Boolean).join(" ")}function mt(e,t,...n){if(e in t){let i=t[e];return typeof i=="function"?i(...n):i}let r=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map(i=>`"${i}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,mt),r}var Qr=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(Qr||{}),Wt=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(Wt||{});function it(){let e=um();return h.useCallback(t=>lm({mergeRefs:e,...t}),[e])}function lm({ourProps:e,theirProps:t,slot:n,defaultTag:r,features:i,visible:s=!0,name:o,mergeRefs:a}){a=a??cm;let l=gl(t,e);if(s)return Zr(l,n,r,o,a);let u=i??0;if(u&2){let{static:c=!1,...f}=l;if(c)return Zr(f,n,r,o,a)}if(u&1){let{unmount:c=!0,...f}=l;return mt(c?0:1,{0(){return null},1(){return Zr({...f,hidden:!0,style:{display:"none"}},n,r,o,a)}})}return Zr(l,n,r,o,a)}function Zr(e,t={},n,r,i){let{as:s=n,children:o,refName:a="ref",...l}=ks(e,["unmount","static"]),u=e.ref!==void 0?{[a]:e.ref}:{},c=typeof o=="function"?o(t):o;"className"in l&&l.className&&typeof l.className=="function"&&(l.className=l.className(t)),l["aria-labelledby"]&&l["aria-labelledby"]===l.id&&(l["aria-labelledby"]=void 0);let f={};if(t){let m=!1,p=[];for(let[d,g]of Object.entries(t))typeof g=="boolean"&&(m=!0),g===!0&&p.push(d.replace(/([A-Z])/g,v=>`-${v.toLowerCase()}`));if(m){f["data-headlessui-state"]=p.join(" ");for(let d of p)f[`data-${d}`]=""}}if(s===h.Fragment&&(Object.keys(Kt(l)).length>0||Object.keys(Kt(f)).length>0))if(!h.isValidElement(c)||Array.isArray(c)&&c.length>1){if(Object.keys(Kt(l)).length>0)throw new Error(['Passing props on "Fragment"!',"",`The current component <${r} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(Kt(l)).concat(Object.keys(Kt(f))).map(m=>` - ${m}`).join(`
|
|
48
48
|
`),"","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(m=>` - ${m}`).join(`
|
|
49
49
|
`)].join(`
|
|
50
|
-
`))}else{let m=c.props,d=m==null?void 0:m.className,p=typeof d=="function"?(...g)=>Ji(d(...g),a.className):Ji(d,a.className),v=p?{className:p}:{},b=ja(c.props,Vt(Qi(a,["ref"])));for(let g in f)g in b&&delete f[g];return h.cloneElement(c,Object.assign({},b,f,u,{ref:i(zp(c),u.ref)},v))}return h.createElement(o,Object.assign({},Qi(a,["ref"]),o!==h.Fragment&&u,o!==h.Fragment&&f),c)}function Hp(){let e=h.useRef([]),t=h.useCallback(n=>{for(let r of e.current)r!=null&&(typeof r=="function"?r(n):r.current=n)},[]);return(...n)=>{if(!n.every(r=>r==null))return e.current=n,t}}function qp(...e){return e.every(t=>t==null)?void 0:t=>{for(let n of e)n!=null&&(typeof n=="function"?n(t):n.current=t)}}function ja(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},n={};for(let r of e)for(let i in r)i.startsWith("on")&&typeof r[i]=="function"?(n[i]!=null||(n[i]=[]),n[i].push(r[i])):t[i]=r[i];if(t.disabled||t["aria-disabled"])for(let r in n)/^(on(?:Click|Pointer|Mouse|Key)(?:Down|Up|Press)?)$/.test(r)&&(n[r]=[i=>{var o;return(o=i==null?void 0:i.preventDefault)==null?void 0:o.call(i)}]);for(let r in n)Object.assign(t,{[r](i,...o){let s=n[r];for(let l of s){if((i instanceof Event||(i==null?void 0:i.nativeEvent)instanceof Event)&&i.defaultPrevented)return;l(i,...o)}}});return t}function Na(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},n={};for(let r of e)for(let i in r)i.startsWith("on")&&typeof r[i]=="function"?(n[i]!=null||(n[i]=[]),n[i].push(r[i])):t[i]=r[i];for(let r in n)Object.assign(t,{[r](...i){let o=n[r];for(let s of o)s==null||s(...i)}});return t}function Ye(e){var t;return Object.assign(h.forwardRef(e),{displayName:(t=e.displayName)!=null?t:e.name})}function Vt(e){let t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}function Qi(e,t=[]){let n=Object.assign({},e);for(let r of t)r in n&&delete n[r];return n}function zp(e){return h.version.split(".")[0]>="19"?e.props.ref:e.ref}function Wp(e,t,n){let[r,i]=h.useState(n),o=e!==void 0,s=h.useRef(o),l=h.useRef(!1),a=h.useRef(!1);return o&&!s.current&&!l.current?(l.current=!0,s.current=o,console.error("A component is changing from uncontrolled to controlled. This may be caused by the value changing from undefined to a defined value, which should not happen.")):!o&&s.current&&!a.current&&(a.current=!0,s.current=o,console.error("A component is changing from controlled to uncontrolled. This may be caused by the value changing from a defined value to undefined, which should not happen.")),[o?e:r,Z(u=>(o||i(u),t==null?void 0:t(u)))]}function Kp(e){let[t]=h.useState(e);return t}function Ia(e={},t=null,n=[]){for(let[r,i]of Object.entries(e))Va(n,Ma(t,r),i);return n}function Ma(e,t){return e?e+"["+t+"]":t}function Va(e,t,n){if(Array.isArray(n))for(let[r,i]of n.entries())Va(e,Ma(t,r.toString()),i);else n instanceof Date?e.push([t,n.toISOString()]):typeof n=="boolean"?e.push([t,n?"1":"0"]):typeof n=="string"?e.push([t,n]):typeof n=="number"?e.push([t,`${n}`]):n==null?e.push([t,""]):Ia(n,t,e)}function Yp(e){var t,n;let r=(t=e==null?void 0:e.form)!=null?t:e.closest("form");if(r){for(let i of r.elements)if(i!==e&&(i.tagName==="INPUT"&&i.type==="submit"||i.tagName==="BUTTON"&&i.type==="submit"||i.nodeName==="INPUT"&&i.type==="image")){i.click();return}(n=r.requestSubmit)==null||n.call(r)}}let Gp="span";var Zi=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(Zi||{});function Xp(e,t){var n;let{features:r=1,...i}=e,o={ref:t,"aria-hidden":(r&2)===2?!0:(n=i["aria-hidden"])!=null?n:void 0,hidden:(r&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",...(r&4)===4&&(r&2)!==2&&{display:"none"}}};return Ze()({ourProps:o,theirProps:i,slot:{},defaultTag:Gp,name:"Hidden"})}let Ra=Ye(Xp),Jp=h.createContext(null);function Qp({children:e}){let t=h.useContext(Jp);if(!t)return h.createElement(h.Fragment,null,e);let{target:n}=t;return n?mt.createPortal(h.createElement(h.Fragment,null,e),n):null}function Zp({data:e,form:t,disabled:n,onReset:r,overrides:i}){let[o,s]=h.useState(null),l=Zt();return h.useEffect(()=>{if(r&&o)return l.addEventListener(o,"reset",r)},[o,t,r]),h.createElement(Qp,null,h.createElement(eh,{setForm:s,formId:t}),Ia(e).map(([a,u])=>h.createElement(Ra,{features:Zi.Hidden,...Vt({key:a,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:t,disabled:n,name:a,value:u,...i})})))}function eh({setForm:e,formId:t}){return h.useEffect(()=>{if(t){let n=document.getElementById(t);n&&e(n)}},[e,t]),t?null:h.createElement(Ra,{features:Zi.Hidden,as:"input",type:"hidden",hidden:!0,readOnly:!0,ref:n=>{if(!n)return;let r=n.closest("form");r&&e(r)}})}let th=h.createContext(void 0);function Ba(){return h.useContext(th)}function nh(e){let t=e.parentElement,n=null;for(;t&&!(t instanceof HTMLFieldSetElement);)t instanceof HTMLLegendElement&&(n=t),t=t.parentElement;let r=(t==null?void 0:t.getAttribute("disabled"))==="";return r&&rh(n)?!1:r}function rh(e){if(!e)return!1;let t=e.previousElementSibling;for(;t!==null;){if(t instanceof HTMLLegendElement)return!1;t=t.previousElementSibling}return!0}let Ua=Symbol();function ih(e,t=!0){return Object.assign(e,{[Ua]:t})}function ot(...e){let t=h.useRef(e);h.useEffect(()=>{t.current=e},[e]);let n=Z(r=>{for(let i of t.current)i!=null&&(typeof i=="function"?i(r):i.current=r)});return e.every(r=>r==null||(r==null?void 0:r[Ua]))?void 0:n}let eo=h.createContext(null);eo.displayName="DescriptionContext";function Ha(){let e=h.useContext(eo);if(e===null){let t=new Error("You used a <Description /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,Ha),t}return e}function oh(){var e,t;return(t=(e=h.useContext(eo))==null?void 0:e.value)!=null?t:void 0}let sh="p";function ah(e,t){let n=h.useId(),r=Xi(),{id:i=`headlessui-description-${n}`,...o}=e,s=Ha(),l=ot(t);pe(()=>s.register(i),[i,s.register]);let a=r||!1,u=h.useMemo(()=>({...s.slot,disabled:a}),[s.slot,a]),c={ref:l,...s.props,id:i};return Ze()({ourProps:c,theirProps:o,slot:u,defaultTag:sh,name:s.name||"Description"})}let lh=Ye(ah);Object.assign(lh,{});var Oe=(e=>(e.Space=" ",e.Enter="Enter",e.Escape="Escape",e.Backspace="Backspace",e.Delete="Delete",e.ArrowLeft="ArrowLeft",e.ArrowUp="ArrowUp",e.ArrowRight="ArrowRight",e.ArrowDown="ArrowDown",e.Home="Home",e.End="End",e.PageUp="PageUp",e.PageDown="PageDown",e.Tab="Tab",e))(Oe||{});let Nr=h.createContext(null);Nr.displayName="LabelContext";function qa(){let e=h.useContext(Nr);if(e===null){let t=new Error("You used a <Label /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,qa),t}return e}function za(e){var t,n,r;let i=(n=(t=h.useContext(Nr))==null?void 0:t.value)!=null?n:void 0;return((r=e==null?void 0:e.length)!=null?r:0)>0?[i,...e].filter(Boolean).join(" "):i}function uh({inherit:e=!1}={}){let t=za(),[n,r]=h.useState([]),i=e?[t,...n].filter(Boolean):n;return[i.length>0?i.join(" "):void 0,h.useMemo(()=>function(o){let s=Z(a=>(r(u=>[...u,a]),()=>r(u=>{let c=u.slice(),f=c.indexOf(a);return f!==-1&&c.splice(f,1),c}))),l=h.useMemo(()=>({register:s,slot:o.slot,name:o.name,props:o.props,value:o.value}),[s,o.slot,o.name,o.props,o.value]);return h.createElement(Nr.Provider,{value:l},o.children)},[r])]}let ch="label";function fh(e,t){var n;let r=h.useId(),i=qa(),o=Ba(),s=Xi(),{id:l=`headlessui-label-${r}`,htmlFor:a=o??((n=i.props)==null?void 0:n.htmlFor),passive:u=!1,...c}=e,f=ot(t);pe(()=>i.register(l),[l,i.register]);let m=Z(b=>{let g=b.currentTarget;if(g instanceof HTMLLabelElement&&b.preventDefault(),i.props&&"onClick"in i.props&&typeof i.props.onClick=="function"&&i.props.onClick(b),g instanceof HTMLLabelElement){let y=document.getElementById(g.htmlFor);if(y){let x=y.getAttribute("disabled");if(x==="true"||x==="")return;let _=y.getAttribute("aria-disabled");if(_==="true"||_==="")return;(y instanceof HTMLInputElement&&(y.type==="radio"||y.type==="checkbox")||y.role==="radio"||y.role==="checkbox"||y.role==="switch")&&y.click(),y.focus({preventScroll:!0})}}}),d=s||!1,p=h.useMemo(()=>({...i.slot,disabled:d}),[i.slot,d]),v={ref:f,...i.props,id:l,htmlFor:a,onClick:m};return u&&("onClick"in v&&(delete v.htmlFor,delete v.onClick),"onClick"in c&&delete c.onClick),Ze()({ourProps:v,theirProps:c,slot:p,defaultTag:a?ch:"div",name:i.name||"Label"})}let dh=Ye(fh),ph=Object.assign(dh,{});function hh(e,t){return e!==null&&t!==null&&typeof e=="object"&&typeof t=="object"&&"id"in e&&"id"in t?e.id===t.id:e===t}function mh(e=hh){return h.useCallback((t,n)=>{if(typeof e=="string"){let r=e;return(t==null?void 0:t[r])===(n==null?void 0:n[r])}return e(t,n)},[e])}function gh(e){if(e===null)return{width:0,height:0};let{width:t,height:n}=e.getBoundingClientRect();return{width:t,height:n}}function yh(e,t=!1){let[n,r]=h.useReducer(()=>({}),{}),i=h.useMemo(()=>gh(e),[e,n]);return pe(()=>{if(!e)return;let o=new ResizeObserver(r);return o.observe(e),()=>{o.disconnect()}},[e]),t?{width:`${i.width}px`,height:`${i.height}px`}:i}let vh=class extends Map{constructor(t){super(),this.factory=t}get(t){let n=super.get(t);return n===void 0&&(n=this.factory(t),this.set(t,n)),n}};function Wa(e,t){let n=e(),r=new Set;return{getSnapshot(){return n},subscribe(i){return r.add(i),()=>r.delete(i)},dispatch(i,...o){let s=t[i].call(n,...o);s&&(n=s,r.forEach(l=>l()))}}}function Ka(e){return h.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot)}let bh=new vh(()=>Wa(()=>[],{ADD(e){return this.includes(e)?this:[...this,e]},REMOVE(e){let t=this.indexOf(e);if(t===-1)return this;let n=this.slice();return n.splice(t,1),n}}));function to(e,t){let n=bh.get(t),r=h.useId(),i=Ka(n);if(pe(()=>{if(e)return n.dispatch("ADD",r),()=>n.dispatch("REMOVE",r)},[n,e]),!e)return!1;let o=i.indexOf(r),s=i.length;return o===-1&&(o=s,s+=1),o===s-1}let no=new Map,Wn=new Map;function Ya(e){var t;let n=(t=Wn.get(e))!=null?t:0;return Wn.set(e,n+1),n!==0?()=>Ga(e):(no.set(e,{"aria-hidden":e.getAttribute("aria-hidden"),inert:e.inert}),e.setAttribute("aria-hidden","true"),e.inert=!0,()=>Ga(e))}function Ga(e){var t;let n=(t=Wn.get(e))!=null?t:1;if(n===1?Wn.delete(e):Wn.set(e,n-1),n!==1)return;let r=no.get(e);r&&(r["aria-hidden"]===null?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",r["aria-hidden"]),e.inert=r.inert,no.delete(e))}function xh(e,{allowed:t,disallowed:n}={}){let r=to(e,"inert-others");pe(()=>{var i,o;if(!r)return;let s=At();for(let a of(i=n==null?void 0:n())!=null?i:[])a&&s.add(Ya(a));let l=(o=t==null?void 0:t())!=null?o:[];for(let a of l){if(!a)continue;let u=zn(a);if(!u)continue;let c=a.parentElement;for(;c&&c!==u.body;){for(let f of c.children)l.some(m=>f.contains(m))||s.add(Ya(f));c=c.parentElement}}return s.dispose},[r,t,n])}function wh(e,t,n){let r=en(i=>{let o=i.getBoundingClientRect();o.x===0&&o.y===0&&o.width===0&&o.height===0&&n()});h.useEffect(()=>{if(!e)return;let i=t===null?null:t instanceof HTMLElement?t:t.current;if(!i)return;let o=At();if(typeof ResizeObserver<"u"){let s=new ResizeObserver(()=>r.current(i));s.observe(i),o.add(()=>s.disconnect())}if(typeof IntersectionObserver<"u"){let s=new IntersectionObserver(()=>r.current(i));s.observe(i),o.add(()=>s.disconnect())}return()=>o.dispose()},[t,r,e])}let ro=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map(e=>`${e}:not([tabindex='-1'])`).join(","),Eh=["[data-autofocus]"].map(e=>`${e}:not([tabindex='-1'])`).join(",");var io=(e=>(e[e.First=1]="First",e[e.Previous=2]="Previous",e[e.Next=4]="Next",e[e.Last=8]="Last",e[e.WrapAround=16]="WrapAround",e[e.NoScroll=32]="NoScroll",e[e.AutoFocus=64]="AutoFocus",e))(io||{}),Th=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(Th||{}),Sh=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(Sh||{});function Xa(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(ro)).sort((t,n)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(n.tabIndex||Number.MAX_SAFE_INTEGER)))}function _h(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(Eh)).sort((t,n)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(n.tabIndex||Number.MAX_SAFE_INTEGER)))}var oo=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(oo||{});function Ja(e,t=0){var n;return e===((n=zn(e))==null?void 0:n.body)?!1:lt(t,{0(){return e.matches(ro)},1(){let r=e;for(;r!==null;){if(r.matches(ro))return!0;r=r.parentElement}return!1}})}var Ch=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(Ch||{});typeof window<"u"&&typeof document<"u"&&(document.addEventListener("keydown",e=>{e.metaKey||e.altKey||e.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")},!0),document.addEventListener("click",e=>{e.detail===1?delete document.documentElement.dataset.headlessuiFocusVisible:e.detail===0&&(document.documentElement.dataset.headlessuiFocusVisible="")},!0));let Fh=["textarea","input"].join(",");function kh(e){var t,n;return(n=(t=e==null?void 0:e.matches)==null?void 0:t.call(e,Fh))!=null?n:!1}function Qa(e,t=n=>n){return e.slice().sort((n,r)=>{let i=t(n),o=t(r);if(i===null||o===null)return 0;let s=i.compareDocumentPosition(o);return s&Node.DOCUMENT_POSITION_FOLLOWING?-1:s&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function $h(e,t){return Oh(Xa(),t,{relativeTo:e})}function Oh(e,t,{sorted:n=!0,relativeTo:r=null,skipElements:i=[]}={}){let o=Array.isArray(e)?e.length>0?e[0].ownerDocument:document:e.ownerDocument,s=Array.isArray(e)?n?Qa(e):e:t&64?_h(e):Xa(e);i.length>0&&s.length>1&&(s=s.filter(d=>!i.some(p=>p!=null&&"current"in p?(p==null?void 0:p.current)===d:p===d))),r=r??o.activeElement;let l=(()=>{if(t&5)return 1;if(t&10)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),a=(()=>{if(t&1)return 0;if(t&2)return Math.max(0,s.indexOf(r))-1;if(t&4)return Math.max(0,s.indexOf(r))+1;if(t&8)return s.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),u=t&32?{preventScroll:!0}:{},c=0,f=s.length,m;do{if(c>=f||c+f<=0)return 0;let d=a+c;if(t&16)d=(d+f)%f;else{if(d<0)return 3;if(d>=f)return 1}m=s[d],m==null||m.focus(u),c+=l}while(m!==o.activeElement);return t&6&&kh(m)&&m.select(),2}function Za(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function Ah(){return/Android/gi.test(window.navigator.userAgent)}function Dh(){return Za()||Ah()}function Kn(e,t,n,r){let i=en(n);h.useEffect(()=>{if(!e)return;function o(s){i.current(s)}return document.addEventListener(t,o,r),()=>document.removeEventListener(t,o,r)},[e,t,r])}function Lh(e,t,n,r){let i=en(n);h.useEffect(()=>{if(!e)return;function o(s){i.current(s)}return window.addEventListener(t,o,r),()=>window.removeEventListener(t,o,r)},[e,t,r])}const el=30;function Ph(e,t,n){let r=to(e,"outside-click"),i=en(n),o=h.useCallback(function(a,u){if(a.defaultPrevented)return;let c=u(a);if(c===null||!c.getRootNode().contains(c)||!c.isConnected)return;let f=function m(d){return typeof d=="function"?m(d()):Array.isArray(d)||d instanceof Set?d:[d]}(t);for(let m of f)if(m!==null&&(m.contains(c)||a.composed&&a.composedPath().includes(m)))return;return!Ja(c,oo.Loose)&&c.tabIndex!==-1&&a.preventDefault(),i.current(a,c)},[i,t]),s=h.useRef(null);Kn(r,"pointerdown",a=>{var u,c;s.current=((c=(u=a.composedPath)==null?void 0:u.call(a))==null?void 0:c[0])||a.target},!0),Kn(r,"mousedown",a=>{var u,c;s.current=((c=(u=a.composedPath)==null?void 0:u.call(a))==null?void 0:c[0])||a.target},!0),Kn(r,"click",a=>{Dh()||s.current&&(o(a,()=>s.current),s.current=null)},!0);let l=h.useRef({x:0,y:0});Kn(r,"touchstart",a=>{l.current.x=a.touches[0].clientX,l.current.y=a.touches[0].clientY},!0),Kn(r,"touchend",a=>{let u={x:a.changedTouches[0].clientX,y:a.changedTouches[0].clientY};if(!(Math.abs(u.x-l.current.x)>=el||Math.abs(u.y-l.current.y)>=el))return o(a,()=>a.target instanceof HTMLElement?a.target:null)},!0),Lh(r,"blur",a=>o(a,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}function so(...e){return h.useMemo(()=>zn(...e),[...e])}function jh(e,t){return h.useMemo(()=>{var n;if(e.type)return e.type;let r=(n=e.as)!=null?n:"button";if(typeof r=="string"&&r.toLowerCase()==="button"||(t==null?void 0:t.tagName)==="BUTTON"&&!t.hasAttribute("type"))return"button"},[e.type,e.as,t])}function Nh(){let e;return{before({doc:t}){var n;let r=t.documentElement,i=(n=t.defaultView)!=null?n:window;e=Math.max(0,i.innerWidth-r.clientWidth)},after({doc:t,d:n}){let r=t.documentElement,i=Math.max(0,r.clientWidth-r.offsetWidth),o=Math.max(0,e-i);n.style(r,"paddingRight",`${o}px`)}}}function Ih(){return Za()?{before({doc:e,d:t,meta:n}){function r(i){return n.containers.flatMap(o=>o()).some(o=>o.contains(i))}t.microTask(()=>{var i;if(window.getComputedStyle(e.documentElement).scrollBehavior!=="auto"){let l=At();l.style(e.documentElement,"scrollBehavior","auto"),t.add(()=>t.microTask(()=>l.dispose()))}let o=(i=window.scrollY)!=null?i:window.pageYOffset,s=null;t.addEventListener(e,"click",l=>{if(l.target instanceof HTMLElement)try{let a=l.target.closest("a");if(!a)return;let{hash:u}=new URL(a.href),c=e.querySelector(u);c&&!r(c)&&(s=c)}catch{}},!0),t.addEventListener(e,"touchstart",l=>{if(l.target instanceof HTMLElement)if(r(l.target)){let a=l.target;for(;a.parentElement&&r(a.parentElement);)a=a.parentElement;t.style(a,"overscrollBehavior","contain")}else t.style(l.target,"touchAction","none")}),t.addEventListener(e,"touchmove",l=>{if(l.target instanceof HTMLElement){if(l.target.tagName==="INPUT")return;if(r(l.target)){let a=l.target;for(;a.parentElement&&a.dataset.headlessuiPortal!==""&&!(a.scrollHeight>a.clientHeight||a.scrollWidth>a.clientWidth);)a=a.parentElement;a.dataset.headlessuiPortal===""&&l.preventDefault()}else l.preventDefault()}},{passive:!1}),t.add(()=>{var l;let a=(l=window.scrollY)!=null?l:window.pageYOffset;o!==a&&window.scrollTo(0,o),s&&s.isConnected&&(s.scrollIntoView({block:"nearest"}),s=null)})})}}:{}}function Mh(){return{before({doc:e,d:t}){t.style(e.documentElement,"overflow","hidden")}}}function Vh(e){let t={};for(let n of e)Object.assign(t,n(t));return t}let tn=Wa(()=>new Map,{PUSH(e,t){var n;let r=(n=this.get(e))!=null?n:{doc:e,count:0,d:At(),meta:new Set};return r.count++,r.meta.add(t),this.set(e,r),this},POP(e,t){let n=this.get(e);return n&&(n.count--,n.meta.delete(t)),this},SCROLL_PREVENT({doc:e,d:t,meta:n}){let r={doc:e,d:t,meta:Vh(n)},i=[Ih(),Nh(),Mh()];i.forEach(({before:o})=>o==null?void 0:o(r)),i.forEach(({after:o})=>o==null?void 0:o(r))},SCROLL_ALLOW({d:e}){e.dispose()},TEARDOWN({doc:e}){this.delete(e)}});tn.subscribe(()=>{let e=tn.getSnapshot(),t=new Map;for(let[n]of e)t.set(n,n.documentElement.style.overflow);for(let n of e.values()){let r=t.get(n.doc)==="hidden",i=n.count!==0;(i&&!r||!i&&r)&&tn.dispatch(n.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",n),n.count===0&&tn.dispatch("TEARDOWN",n)}});function Rh(e,t,n=()=>({containers:[]})){let r=Ka(tn),i=t?r.get(t):void 0,o=i?i.count>0:!1;return pe(()=>{if(!(!t||!e))return tn.dispatch("PUSH",t,n),()=>tn.dispatch("POP",t,n)},[e,t]),o}function Bh(e,t,n=()=>[document.body]){let r=to(e,"scroll-lock");Rh(r,t,i=>{var o;return{containers:[...(o=i.containers)!=null?o:[],n]}})}function tl(e){return[e.screenX,e.screenY]}function Uh(){let e=h.useRef([-1,-1]);return{wasMoved(t){let n=tl(t);return e.current[0]===n[0]&&e.current[1]===n[1]?!1:(e.current=n,!0)},update(t){e.current=tl(t)}}}function Hh(e=0){let[t,n]=h.useState(e),r=h.useCallback(a=>n(a),[t]),i=h.useCallback(a=>n(u=>u|a),[t]),o=h.useCallback(a=>(t&a)===a,[t]),s=h.useCallback(a=>n(u=>u&~a),[n]),l=h.useCallback(a=>n(u=>u^a),[n]);return{flags:t,setFlag:r,addFlag:i,hasFlag:o,removeFlag:s,toggleFlag:l}}var nl,rl;typeof process<"u"&&typeof globalThis<"u"&&typeof Element<"u"&&((nl=process==null?void 0:process.env)==null?void 0:nl.NODE_ENV)==="test"&&typeof((rl=Element==null?void 0:Element.prototype)==null?void 0:rl.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(`
|
|
51
|
-
`)),[]});var qh=(e=>(e[e.None=0]="None",e[e.Closed=1]="Closed",e[e.Enter=2]="Enter",e[e.Leave=4]="Leave",e))(qh||{});function il(e){let t={};for(let n in e)e[n]===!0&&(t[`data-${n}`]="");return t}function ol(e,t,n,r){let[i,o]=h.useState(n),{hasFlag:s,addFlag:l,removeFlag:a}=Hh(e&&i?3:0),u=h.useRef(!1),c=h.useRef(!1),f=Zt();return pe(()=>{var m;if(e){if(n&&o(!0),!t){n&&l(3);return}return(m=r==null?void 0:r.start)==null||m.call(r,n),zh(t,{inFlight:u,prepare(){c.current?c.current=!1:c.current=u.current,u.current=!0,!c.current&&(n?(l(3),a(4)):(l(4),a(2)))},run(){c.current?n?(a(3),l(4)):(a(4),l(3)):n?a(1):l(1)},done(){var d;c.current&&typeof t.getAnimations=="function"&&t.getAnimations().length>0||(u.current=!1,a(7),n||o(!1),(d=r==null?void 0:r.end)==null||d.call(r,n))}})}},[e,n,t,f]),e?[i,{closed:s(1),enter:s(2),leave:s(4),transition:s(2)||s(4)}]:[n,{closed:void 0,enter:void 0,leave:void 0,transition:void 0}]}function zh(e,{prepare:t,run:n,done:r,inFlight:i}){let o=At();return Kh(e,{prepare:t,inFlight:i}),o.nextFrame(()=>{n(),o.requestAnimationFrame(()=>{o.add(Wh(e,r))})}),o.dispose}function Wh(e,t){var n,r;let i=At();if(!e)return i.dispose;let o=!1;i.add(()=>{o=!0});let s=(r=(n=e.getAnimations)==null?void 0:n.call(e).filter(l=>l instanceof CSSTransition))!=null?r:[];return s.length===0?(t(),i.dispose):(Promise.allSettled(s.map(l=>l.finished)).then(()=>{o||t()}),i.dispose)}function Kh(e,{inFlight:t,prepare:n}){if(t!=null&&t.current){n();return}let r=e.style.transition;e.style.transition="none",n(),e.offsetHeight,e.style.transition=r}function Ir(){return typeof window<"u"}function gn(e){return sl(e)?(e.nodeName||"").toLowerCase():"#document"}function et(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function yt(e){var t;return(t=(sl(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function sl(e){return Ir()?e instanceof Node||e instanceof et(e).Node:!1}function Me(e){return Ir()?e instanceof Element||e instanceof et(e).Element:!1}function vt(e){return Ir()?e instanceof HTMLElement||e instanceof et(e).HTMLElement:!1}function al(e){return!Ir()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof et(e).ShadowRoot}function Yn(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=ut(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(i)}function Yh(e){return["table","td","th"].includes(gn(e))}function Mr(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function ao(e){const t=lo(),n=Me(e)?ut(e):e;return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function Gh(e){let t=Rt(e);for(;vt(t)&&!yn(t);){if(ao(t))return t;if(Mr(t))return null;t=Rt(t)}return null}function lo(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function yn(e){return["html","body","#document"].includes(gn(e))}function ut(e){return et(e).getComputedStyle(e)}function Vr(e){return Me(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Rt(e){if(gn(e)==="html")return e;const t=e.assignedSlot||e.parentNode||al(e)&&e.host||yt(e);return al(t)?t.host:t}function ll(e){const t=Rt(e);return yn(t)?e.ownerDocument?e.ownerDocument.body:e.body:vt(t)&&Yn(t)?t:ll(t)}function Gn(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=ll(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),s=et(i);if(o){const l=uo(s);return t.concat(s,s.visualViewport||[],Yn(i)?i:[],l&&n?Gn(l):[])}return t.concat(i,Gn(i,[],n))}function uo(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Xh(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:n,version:r}=t;return n+"/"+r}).join(" "):navigator.userAgent}const nn=Math.min,Ve=Math.max,Xn=Math.round,Rr=Math.floor,bt=e=>({x:e,y:e}),Jh={left:"right",right:"left",bottom:"top",top:"bottom"},Qh={start:"end",end:"start"};function ul(e,t,n){return Ve(e,nn(t,n))}function vn(e,t){return typeof e=="function"?e(t):e}function Bt(e){return e.split("-")[0]}function Jn(e){return e.split("-")[1]}function cl(e){return e==="x"?"y":"x"}function fl(e){return e==="y"?"height":"width"}function rn(e){return["top","bottom"].includes(Bt(e))?"y":"x"}function dl(e){return cl(rn(e))}function Zh(e,t,n){n===void 0&&(n=!1);const r=Jn(e),i=dl(e),o=fl(i);let s=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(s=Br(s)),[s,Br(s)]}function em(e){const t=Br(e);return[co(e),t,co(t)]}function co(e){return e.replace(/start|end/g,t=>Qh[t])}function tm(e,t,n){const r=["left","right"],i=["right","left"],o=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return n?t?i:r:t?r:i;case"left":case"right":return t?o:s;default:return[]}}function nm(e,t,n,r){const i=Jn(e);let o=tm(Bt(e),n==="start",r);return i&&(o=o.map(s=>s+"-"+i),t&&(o=o.concat(o.map(co)))),o}function Br(e){return e.replace(/left|right|bottom|top/g,t=>Jh[t])}function rm(e){return{top:0,right:0,bottom:0,left:0,...e}}function im(e){return typeof e!="number"?rm(e):{top:e,right:e,bottom:e,left:e}}function Ur(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function pl(e,t,n){let{reference:r,floating:i}=e;const o=rn(t),s=dl(t),l=fl(s),a=Bt(t),u=o==="y",c=r.x+r.width/2-i.width/2,f=r.y+r.height/2-i.height/2,m=r[l]/2-i[l]/2;let d;switch(a){case"top":d={x:c,y:r.y-i.height};break;case"bottom":d={x:c,y:r.y+r.height};break;case"right":d={x:r.x+r.width,y:f};break;case"left":d={x:r.x-i.width,y:f};break;default:d={x:r.x,y:r.y}}switch(Jn(t)){case"start":d[s]-=m*(n&&u?-1:1);break;case"end":d[s]+=m*(n&&u?-1:1);break}return d}const om=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:s}=n,l=o.filter(Boolean),a=await(s.isRTL==null?void 0:s.isRTL(t));let u=await s.getElementRects({reference:e,floating:t,strategy:i}),{x:c,y:f}=pl(u,r,a),m=r,d={},p=0;for(let v=0;v<l.length;v++){const{name:b,fn:g}=l[v],{x:y,y:x,data:_,reset:$}=await g({x:c,y:f,initialPlacement:r,placement:m,strategy:i,middlewareData:d,rects:u,platform:s,elements:{reference:e,floating:t}});c=y??c,f=x??f,d={...d,[b]:{...d[b],..._}},$&&p<=50&&(p++,typeof $=="object"&&($.placement&&(m=$.placement),$.rects&&(u=$.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:i}):$.rects),{x:c,y:f}=pl(u,m,a)),v=-1)}return{x:c,y:f,placement:m,strategy:i,middlewareData:d}};async function Hr(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:o,rects:s,elements:l,strategy:a}=e,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:f="floating",altBoundary:m=!1,padding:d=0}=vn(t,e),p=im(d),b=l[m?f==="floating"?"reference":"floating":f],g=Ur(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(b)))==null||n?b:b.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(l.floating)),boundary:u,rootBoundary:c,strategy:a})),y=f==="floating"?{x:r,y:i,width:s.floating.width,height:s.floating.height}:s.reference,x=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l.floating)),_=await(o.isElement==null?void 0:o.isElement(x))?await(o.getScale==null?void 0:o.getScale(x))||{x:1,y:1}:{x:1,y:1},$=Ur(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:y,offsetParent:x,strategy:a}):y);return{top:(g.top-$.top+p.top)/_.y,bottom:($.bottom-g.bottom+p.bottom)/_.y,left:(g.left-$.left+p.left)/_.x,right:($.right-g.right+p.right)/_.x}}const sm=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:o,rects:s,initialPlacement:l,platform:a,elements:u}=t,{mainAxis:c=!0,crossAxis:f=!0,fallbackPlacements:m,fallbackStrategy:d="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:v=!0,...b}=vn(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const g=Bt(i),y=rn(l),x=Bt(l)===l,_=await(a.isRTL==null?void 0:a.isRTL(u.floating)),$=m||(x||!v?[Br(l)]:em(l)),S=p!=="none";!m&&S&&$.push(...nm(l,v,p,_));const C=[l,...$],A=await Hr(t,b),L=[];let j=((r=o.flip)==null?void 0:r.overflows)||[];if(c&&L.push(A[g]),f){const H=Zh(i,s,_);L.push(A[H[0]],A[H[1]])}if(j=[...j,{placement:i,overflows:L}],!L.every(H=>H<=0)){var D,I;const H=(((D=o.flip)==null?void 0:D.index)||0)+1,Y=C[H];if(Y)return{data:{index:H,overflows:j},reset:{placement:Y}};let X=(I=j.filter(G=>G.overflows[0]<=0).sort((G,z)=>G.overflows[1]-z.overflows[1])[0])==null?void 0:I.placement;if(!X)switch(d){case"bestFit":{var V;const G=(V=j.filter(z=>{if(S){const Q=rn(z.placement);return Q===y||Q==="y"}return!0}).map(z=>[z.placement,z.overflows.filter(Q=>Q>0).reduce((Q,ee)=>Q+ee,0)]).sort((z,Q)=>z[1]-Q[1])[0])==null?void 0:V[0];G&&(X=G);break}case"initialPlacement":X=l;break}if(i!==X)return{reset:{placement:X}}}return{}}}};async function am(e,t){const{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),s=Bt(n),l=Jn(n),a=rn(n)==="y",u=["left","top"].includes(s)?-1:1,c=o&&a?-1:1,f=vn(t,e);let{mainAxis:m,crossAxis:d,alignmentAxis:p}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return l&&typeof p=="number"&&(d=l==="end"?p*-1:p),a?{x:d*c,y:m*u}:{x:m*u,y:d*c}}const lm=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:o,placement:s,middlewareData:l}=t,a=await am(t,e);return s===((n=l.offset)==null?void 0:n.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:i+a.x,y:o+a.y,data:{...a,placement:s}}}}},um=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:l={fn:b=>{let{x:g,y}=b;return{x:g,y}}},...a}=vn(e,t),u={x:n,y:r},c=await Hr(t,a),f=rn(Bt(i)),m=cl(f);let d=u[m],p=u[f];if(o){const b=m==="y"?"top":"left",g=m==="y"?"bottom":"right",y=d+c[b],x=d-c[g];d=ul(y,d,x)}if(s){const b=f==="y"?"top":"left",g=f==="y"?"bottom":"right",y=p+c[b],x=p-c[g];p=ul(y,p,x)}const v=l.fn({...t,[m]:d,[f]:p});return{...v,data:{x:v.x-n,y:v.y-r,enabled:{[m]:o,[f]:s}}}}}},cm=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:i,rects:o,platform:s,elements:l}=t,{apply:a=()=>{},...u}=vn(e,t),c=await Hr(t,u),f=Bt(i),m=Jn(i),d=rn(i)==="y",{width:p,height:v}=o.floating;let b,g;f==="top"||f==="bottom"?(b=f,g=m===(await(s.isRTL==null?void 0:s.isRTL(l.floating))?"start":"end")?"left":"right"):(g=f,b=m==="end"?"top":"bottom");const y=v-c.top-c.bottom,x=p-c.left-c.right,_=nn(v-c[b],y),$=nn(p-c[g],x),S=!t.middlewareData.shift;let C=_,A=$;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(A=x),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=y),S&&!m){const j=Ve(c.left,0),D=Ve(c.right,0),I=Ve(c.top,0),V=Ve(c.bottom,0);d?A=p-2*(j!==0||D!==0?j+D:Ve(c.left,c.right)):C=v-2*(I!==0||V!==0?I+V:Ve(c.top,c.bottom))}await a({...t,availableWidth:A,availableHeight:C});const L=await s.getDimensions(l.floating);return p!==L.width||v!==L.height?{reset:{rects:!0}}:{}}}};function hl(e){const t=ut(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=vt(e),o=i?e.offsetWidth:n,s=i?e.offsetHeight:r,l=Xn(n)!==o||Xn(r)!==s;return l&&(n=o,r=s),{width:n,height:r,$:l}}function fo(e){return Me(e)?e:e.contextElement}function bn(e){const t=fo(e);if(!vt(t))return bt(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=hl(t);let s=(o?Xn(n.width):n.width)/r,l=(o?Xn(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!l||!Number.isFinite(l))&&(l=1),{x:s,y:l}}const fm=bt(0);function ml(e){const t=et(e);return!lo()||!t.visualViewport?fm:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function dm(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==et(e)?!1:t}function on(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),o=fo(e);let s=bt(1);t&&(r?Me(r)&&(s=bn(r)):s=bn(e));const l=dm(o,n,r)?ml(o):bt(0);let a=(i.left+l.x)/s.x,u=(i.top+l.y)/s.y,c=i.width/s.x,f=i.height/s.y;if(o){const m=et(o),d=r&&Me(r)?et(r):r;let p=m,v=uo(p);for(;v&&r&&d!==p;){const b=bn(v),g=v.getBoundingClientRect(),y=ut(v),x=g.left+(v.clientLeft+parseFloat(y.paddingLeft))*b.x,_=g.top+(v.clientTop+parseFloat(y.paddingTop))*b.y;a*=b.x,u*=b.y,c*=b.x,f*=b.y,a+=x,u+=_,p=et(v),v=uo(p)}}return Ur({width:c,height:f,x:a,y:u})}function po(e,t){const n=Vr(e).scrollLeft;return t?t.left+n:on(yt(e)).left+n}function gl(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),i=r.left+t.scrollLeft-(n?0:po(e,r)),o=r.top+t.scrollTop;return{x:i,y:o}}function pm(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const o=i==="fixed",s=yt(r),l=t?Mr(t.floating):!1;if(r===s||l&&o)return n;let a={scrollLeft:0,scrollTop:0},u=bt(1);const c=bt(0),f=vt(r);if((f||!f&&!o)&&((gn(r)!=="body"||Yn(s))&&(a=Vr(r)),vt(r))){const d=on(r);u=bn(r),c.x=d.x+r.clientLeft,c.y=d.y+r.clientTop}const m=s&&!f&&!o?gl(s,a,!0):bt(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-a.scrollLeft*u.x+c.x+m.x,y:n.y*u.y-a.scrollTop*u.y+c.y+m.y}}function hm(e){return Array.from(e.getClientRects())}function mm(e){const t=yt(e),n=Vr(e),r=e.ownerDocument.body,i=Ve(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=Ve(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+po(e);const l=-n.scrollTop;return ut(r).direction==="rtl"&&(s+=Ve(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:s,y:l}}function gm(e,t){const n=et(e),r=yt(e),i=n.visualViewport;let o=r.clientWidth,s=r.clientHeight,l=0,a=0;if(i){o=i.width,s=i.height;const u=lo();(!u||u&&t==="fixed")&&(l=i.offsetLeft,a=i.offsetTop)}return{width:o,height:s,x:l,y:a}}function ym(e,t){const n=on(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=vt(e)?bn(e):bt(1),s=e.clientWidth*o.x,l=e.clientHeight*o.y,a=i*o.x,u=r*o.y;return{width:s,height:l,x:a,y:u}}function yl(e,t,n){let r;if(t==="viewport")r=gm(e,n);else if(t==="document")r=mm(yt(e));else if(Me(t))r=ym(t,n);else{const i=ml(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return Ur(r)}function vl(e,t){const n=Rt(e);return n===t||!Me(n)||yn(n)?!1:ut(n).position==="fixed"||vl(n,t)}function vm(e,t){const n=t.get(e);if(n)return n;let r=Gn(e,[],!1).filter(l=>Me(l)&&gn(l)!=="body"),i=null;const o=ut(e).position==="fixed";let s=o?Rt(e):e;for(;Me(s)&&!yn(s);){const l=ut(s),a=ao(s);!a&&l.position==="fixed"&&(i=null),(o?!a&&!i:!a&&l.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||Yn(s)&&!a&&vl(e,s))?r=r.filter(c=>c!==s):i=l,s=Rt(s)}return t.set(e,r),r}function bm(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const s=[...n==="clippingAncestors"?Mr(t)?[]:vm(t,this._c):[].concat(n),r],l=s[0],a=s.reduce((u,c)=>{const f=yl(t,c,i);return u.top=Ve(f.top,u.top),u.right=nn(f.right,u.right),u.bottom=nn(f.bottom,u.bottom),u.left=Ve(f.left,u.left),u},yl(t,l,i));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function xm(e){const{width:t,height:n}=hl(e);return{width:t,height:n}}function wm(e,t,n){const r=vt(t),i=yt(t),o=n==="fixed",s=on(e,!0,o,t);let l={scrollLeft:0,scrollTop:0};const a=bt(0);if(r||!r&&!o)if((gn(t)!=="body"||Yn(i))&&(l=Vr(t)),r){const m=on(t,!0,o,t);a.x=m.x+t.clientLeft,a.y=m.y+t.clientTop}else i&&(a.x=po(i));const u=i&&!r&&!o?gl(i,l):bt(0),c=s.left+l.scrollLeft-a.x-u.x,f=s.top+l.scrollTop-a.y-u.y;return{x:c,y:f,width:s.width,height:s.height}}function ho(e){return ut(e).position==="static"}function bl(e,t){if(!vt(e)||ut(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return yt(e)===n&&(n=n.ownerDocument.body),n}function xl(e,t){const n=et(e);if(Mr(e))return n;if(!vt(e)){let i=Rt(e);for(;i&&!yn(i);){if(Me(i)&&!ho(i))return i;i=Rt(i)}return n}let r=bl(e,t);for(;r&&Yh(r)&&ho(r);)r=bl(r,t);return r&&yn(r)&&ho(r)&&!ao(r)?n:r||Gh(e)||n}const Em=async function(e){const t=this.getOffsetParent||xl,n=this.getDimensions,r=await n(e.floating);return{reference:wm(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Tm(e){return ut(e).direction==="rtl"}const Sm={convertOffsetParentRelativeRectToViewportRelativeRect:pm,getDocumentElement:yt,getClippingRect:bm,getOffsetParent:xl,getElementRects:Em,getClientRects:hm,getDimensions:xm,getScale:bn,isElement:Me,isRTL:Tm};function _m(e,t){let n=null,r;const i=yt(e);function o(){var l;clearTimeout(r),(l=n)==null||l.disconnect(),n=null}function s(l,a){l===void 0&&(l=!1),a===void 0&&(a=1),o();const{left:u,top:c,width:f,height:m}=e.getBoundingClientRect();if(l||t(),!f||!m)return;const d=Rr(c),p=Rr(i.clientWidth-(u+f)),v=Rr(i.clientHeight-(c+m)),b=Rr(u),y={rootMargin:-d+"px "+-p+"px "+-v+"px "+-b+"px",threshold:Ve(0,nn(1,a))||1};let x=!0;function _($){const S=$[0].intersectionRatio;if(S!==a){if(!x)return s();S?s(!1,S):r=setTimeout(()=>{s(!1,1e-7)},1e3)}x=!1}try{n=new IntersectionObserver(_,{...y,root:i.ownerDocument})}catch{n=new IntersectionObserver(_,y)}n.observe(e)}return s(!0),o}function Cm(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:a=!1}=r,u=fo(e),c=i||o?[...u?Gn(u):[],...Gn(t)]:[];c.forEach(g=>{i&&g.addEventListener("scroll",n,{passive:!0}),o&&g.addEventListener("resize",n)});const f=u&&l?_m(u,n):null;let m=-1,d=null;s&&(d=new ResizeObserver(g=>{let[y]=g;y&&y.target===u&&d&&(d.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var x;(x=d)==null||x.observe(t)})),n()}),u&&!a&&d.observe(u),d.observe(t));let p,v=a?on(e):null;a&&b();function b(){const g=on(e);v&&(g.x!==v.x||g.y!==v.y||g.width!==v.width||g.height!==v.height)&&n(),v=g,p=requestAnimationFrame(b)}return n(),()=>{var g;c.forEach(y=>{i&&y.removeEventListener("scroll",n),o&&y.removeEventListener("resize",n)}),f==null||f(),(g=d)==null||g.disconnect(),d=null,a&&cancelAnimationFrame(p)}}const mo=Hr,Fm=lm,km=um,$m=sm,Om=cm,Am=(e,t,n)=>{const r=new Map,i={platform:Sm,...n},o={...i.platform,_c:r};return om(e,t,{...i,platform:o})};var qr=typeof document<"u"?h.useLayoutEffect:h.useEffect;function zr(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!zr(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const o=i[r];if(!(o==="_owner"&&e.$$typeof)&&!zr(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function wl(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function El(e,t){const n=wl(e);return Math.round(t*n)/n}function go(e){const t=k.useRef(e);return qr(()=>{t.current=e}),t}function Dm(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:o,floating:s}={},transform:l=!0,whileElementsMounted:a,open:u}=e,[c,f]=k.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[m,d]=k.useState(r);zr(m,r)||d(r);const[p,v]=k.useState(null),[b,g]=k.useState(null),y=k.useCallback(z=>{z!==S.current&&(S.current=z,v(z))},[]),x=k.useCallback(z=>{z!==C.current&&(C.current=z,g(z))},[]),_=o||p,$=s||b,S=k.useRef(null),C=k.useRef(null),A=k.useRef(c),L=a!=null,j=go(a),D=go(i),I=go(u),V=k.useCallback(()=>{if(!S.current||!C.current)return;const z={placement:t,strategy:n,middleware:m};D.current&&(z.platform=D.current),Am(S.current,C.current,z).then(Q=>{const ee={...Q,isPositioned:I.current!==!1};H.current&&!zr(A.current,ee)&&(A.current=ee,dr.flushSync(()=>{f(ee)}))})},[m,t,n,D,I]);qr(()=>{u===!1&&A.current.isPositioned&&(A.current.isPositioned=!1,f(z=>({...z,isPositioned:!1})))},[u]);const H=k.useRef(!1);qr(()=>(H.current=!0,()=>{H.current=!1}),[]),qr(()=>{if(_&&(S.current=_),$&&(C.current=$),_&&$){if(j.current)return j.current(_,$,V);V()}},[_,$,V,j,L]);const Y=k.useMemo(()=>({reference:S,floating:C,setReference:y,setFloating:x}),[y,x]),X=k.useMemo(()=>({reference:_,floating:$}),[_,$]),G=k.useMemo(()=>{const z={position:n,left:0,top:0};if(!X.floating)return z;const Q=El(X.floating,c.x),ee=El(X.floating,c.y);return l?{...z,transform:"translate("+Q+"px, "+ee+"px)",...wl(X.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:Q,top:ee}},[n,l,X.floating,c.x,c.y]);return k.useMemo(()=>({...c,update:V,refs:Y,elements:X,floatingStyles:G}),[c,V,Y,X,G])}const Tl=(e,t)=>({...Fm(e),options:[e,t]}),Lm=(e,t)=>({...km(e),options:[e,t]}),Pm=(e,t)=>({...$m(e),options:[e,t]}),jm=(e,t)=>({...Om(e),options:[e,t]}),Sl={...k},Nm=Sl.useInsertionEffect||(e=>e());function _l(e){const t=k.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return Nm(()=>{t.current=e}),k.useCallback(function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return t.current==null?void 0:t.current(...r)},[])}var yo=typeof document<"u"?h.useLayoutEffect:h.useEffect;let Cl=!1,Im=0;const Fl=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+Im++;function Mm(){const[e,t]=k.useState(()=>Cl?Fl():void 0);return yo(()=>{e==null&&t(Fl())},[]),k.useEffect(()=>{Cl=!0},[]),e}const Vm=Sl.useId||Mm;let Qn;process.env.NODE_ENV!=="production"&&(Qn=new Set);function Rm(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const i="Floating UI: "+n.join(" ");if(!((e=Qn)!=null&&e.has(i))){var o;(o=Qn)==null||o.add(i),console.warn(i)}}function Bm(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const i="Floating UI: "+n.join(" ");if(!((e=Qn)!=null&&e.has(i))){var o;(o=Qn)==null||o.add(i),console.error(i)}}function Um(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(i=>i(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,((r=e.get(t))==null?void 0:r.filter(i=>i!==n))||[])}}}const Hm=k.createContext(null),qm=k.createContext(null),zm=()=>{var e;return((e=k.useContext(Hm))==null?void 0:e.id)||null},Wm=()=>k.useContext(qm),Km="data-floating-ui-focusable";function Ym(e){const{open:t=!1,onOpenChange:n,elements:r}=e,i=Vm(),o=k.useRef({}),[s]=k.useState(()=>Um()),l=zm()!=null;if(process.env.NODE_ENV!=="production"){const d=r.reference;d&&!Me(d)&&Bm("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[a,u]=k.useState(r.reference),c=_l((d,p,v)=>{o.current.openEvent=d?p:void 0,s.emit("openchange",{open:d,event:p,reason:v,nested:l}),n==null||n(d,p,v)}),f=k.useMemo(()=>({setPositionReference:u}),[]),m=k.useMemo(()=>({reference:a||r.reference||null,floating:r.floating||null,domReference:r.reference}),[a,r.reference,r.floating]);return k.useMemo(()=>({dataRef:o,open:t,onOpenChange:c,elements:m,events:s,floatingId:i,refs:f}),[t,c,m,s,i,f])}function Gm(e){e===void 0&&(e={});const{nodeId:t}=e,n=Ym({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,i=r.elements,[o,s]=k.useState(null),[l,a]=k.useState(null),c=(i==null?void 0:i.domReference)||o,f=k.useRef(null),m=Wm();yo(()=>{c&&(f.current=c)},[c]);const d=Dm({...e,elements:{...i,...l&&{reference:l}}}),p=k.useCallback(x=>{const _=Me(x)?{getBoundingClientRect:()=>x.getBoundingClientRect(),contextElement:x}:x;a(_),d.refs.setReference(_)},[d.refs]),v=k.useCallback(x=>{(Me(x)||x===null)&&(f.current=x,s(x)),(Me(d.refs.reference.current)||d.refs.reference.current===null||x!==null&&!Me(x))&&d.refs.setReference(x)},[d.refs]),b=k.useMemo(()=>({...d.refs,setReference:v,setPositionReference:p,domReference:f}),[d.refs,v,p]),g=k.useMemo(()=>({...d.elements,domReference:c}),[d.elements,c]),y=k.useMemo(()=>({...d,...r,refs:b,elements:g,nodeId:t}),[d,b,g,t,r]);return yo(()=>{r.dataRef.current.floatingContext=y;const x=m==null?void 0:m.nodesRef.current.find(_=>_.id===t);x&&(x.context=y)}),k.useMemo(()=>({...d,context:y,refs:b,elements:g}),[d,b,g,y])}const kl="active",$l="selected";function vo(e,t,n){const r=new Map,i=n==="item";let o=e;if(i&&e){const{[kl]:s,[$l]:l,...a}=e;o=a}return{...n==="floating"&&{tabIndex:-1,[Km]:""},...o,...t.map(s=>{const l=s?s[n]:null;return typeof l=="function"?e?l(e):null:l}).concat(e).reduce((s,l)=>(l&&Object.entries(l).forEach(a=>{let[u,c]=a;if(!(i&&[kl,$l].includes(u)))if(u.indexOf("on")===0){if(r.has(u)||r.set(u,[]),typeof c=="function"){var f;(f=r.get(u))==null||f.push(c),s[u]=function(){for(var m,d=arguments.length,p=new Array(d),v=0;v<d;v++)p[v]=arguments[v];return(m=r.get(u))==null?void 0:m.map(b=>b(...p)).find(b=>b!==void 0)}}}else s[u]=c}),s),{})}}function Xm(e){e===void 0&&(e=[]);const t=e.map(l=>l==null?void 0:l.reference),n=e.map(l=>l==null?void 0:l.floating),r=e.map(l=>l==null?void 0:l.item),i=k.useCallback(l=>vo(l,e,"reference"),t),o=k.useCallback(l=>vo(l,e,"floating"),n),s=k.useCallback(l=>vo(l,e,"item"),r);return k.useMemo(()=>({getReferenceProps:i,getFloatingProps:o,getItemProps:s}),[i,o,s])}function Ol(e,t){return{...e,rects:{...e.rects,floating:{...e.rects.floating,height:t}}}}const Jm=e=>({name:"inner",options:e,async fn(t){const{listRef:n,overflowRef:r,onFallbackChange:i,offset:o=0,index:s=0,minItemsVisible:l=4,referenceOverflowThreshold:a=0,scrollRef:u,...c}=vn(e,t),{rects:f,elements:{floating:m}}=t,d=n.current[s],p=(u==null?void 0:u.current)||m,v=m.clientTop||p.clientTop,b=m.clientTop!==0,g=p.clientTop!==0,y=m===p;if(process.env.NODE_ENV!=="production"&&(t.placement.startsWith("bottom")||Rm('`placement` side must be "bottom" when using the `inner`',"middleware.")),!d)return{};const x={...t,...await Tl(-d.offsetTop-m.clientTop-f.reference.height/2-d.offsetHeight/2-o).fn(t)},_=await mo(Ol(x,p.scrollHeight+v+m.clientTop),c),$=await mo(x,{...c,elementContext:"reference"}),S=Ve(0,_.top),C=x.y+S,j=(p.scrollHeight>p.clientHeight?D=>D:Xn)(Ve(0,p.scrollHeight+(b&&y||g?v*2:0)-S-Ve(0,_.bottom)));if(p.style.maxHeight=j+"px",p.scrollTop=S,i){const D=p.offsetHeight<d.offsetHeight*nn(l,n.current.length)-1||$.top>=-a||$.bottom>=-a;dr.flushSync(()=>i(D))}return r&&(r.current=await mo(Ol({...x,y:C},p.offsetHeight+v+m.clientTop),c)),{y:C}}});function Qm(e,t){const{open:n,elements:r}=e,{enabled:i=!0,overflowRef:o,scrollRef:s,onChange:l}=t,a=_l(l),u=k.useRef(!1),c=k.useRef(null),f=k.useRef(null);k.useEffect(()=>{if(!i)return;function d(v){if(v.ctrlKey||!p||o.current==null)return;const b=v.deltaY,g=o.current.top>=-.5,y=o.current.bottom>=-.5,x=p.scrollHeight-p.clientHeight,_=b<0?-1:1,$=b<0?"max":"min";p.scrollHeight<=p.clientHeight||(!g&&b>0||!y&&b<0?(v.preventDefault(),dr.flushSync(()=>{a(S=>S+Math[$](b,x*_))})):/firefox/i.test(Xh())&&(p.scrollTop+=b))}const p=(s==null?void 0:s.current)||r.floating;if(n&&p)return p.addEventListener("wheel",d),requestAnimationFrame(()=>{c.current=p.scrollTop,o.current!=null&&(f.current={...o.current})}),()=>{c.current=null,f.current=null,p.removeEventListener("wheel",d)}},[i,n,r.floating,o,s,a]);const m=k.useMemo(()=>({onKeyDown(){u.current=!0},onWheel(){u.current=!1},onPointerMove(){u.current=!1},onScroll(){const d=(s==null?void 0:s.current)||r.floating;if(!(!o.current||!d||!u.current)){if(c.current!==null){const p=d.scrollTop-c.current;(o.current.bottom<-.5&&p<-1||o.current.top<-.5&&p>1)&&dr.flushSync(()=>a(v=>v+p))}requestAnimationFrame(()=>{c.current=d.scrollTop})}}}),[r.floating,a,o,s]);return k.useMemo(()=>i?{floating:m}:{},[i,m])}let xn=h.createContext({styles:void 0,setReference:()=>{},setFloating:()=>{},getReferenceProps:()=>({}),getFloatingProps:()=>({}),slot:{}});xn.displayName="FloatingContext";let bo=h.createContext(null);bo.displayName="PlacementContext";function Zm(e){return h.useMemo(()=>e?typeof e=="string"?{to:e}:e:null,[e])}function eg(){return h.useContext(xn).setReference}function tg(){return h.useContext(xn).getReferenceProps}function ng(){let{getFloatingProps:e,slot:t}=h.useContext(xn);return h.useCallback((...n)=>Object.assign({},e(...n),{"data-anchor":t.anchor}),[e,t])}function rg(e=null){e===!1&&(e=null),typeof e=="string"&&(e={to:e});let t=h.useContext(bo),n=h.useMemo(()=>e,[JSON.stringify(e,(i,o)=>{var s;return(s=o==null?void 0:o.outerHTML)!=null?s:o})]);pe(()=>{t==null||t(n??null)},[t,n]);let r=h.useContext(xn);return h.useMemo(()=>[r.setFloating,e?r.styles:{}],[r.setFloating,e,r.styles])}let Al=4;function ig({children:e,enabled:t=!0}){let[n,r]=h.useState(null),[i,o]=h.useState(0),s=h.useRef(null),[l,a]=h.useState(null);og(l);let u=t&&n!==null&&l!==null,{to:c="bottom",gap:f=0,offset:m=0,padding:d=0,inner:p}=sg(n,l),[v,b="center"]=c.split(" ");pe(()=>{u&&o(0)},[u]);let{refs:g,floatingStyles:y,context:x}=Gm({open:u,placement:v==="selection"?b==="center"?"bottom":`bottom-${b}`:b==="center"?`${v}`:`${v}-${b}`,strategy:"absolute",transform:!1,middleware:[Tl({mainAxis:v==="selection"?0:f,crossAxis:m}),Lm({padding:d}),v!=="selection"&&Pm({padding:d}),v==="selection"&&p?Jm({...p,padding:d,overflowRef:s,offset:i,minItemsVisible:Al,referenceOverflowThreshold:d,onFallbackChange(D){var I,V;if(!D)return;let H=x.elements.floating;if(!H)return;let Y=parseFloat(getComputedStyle(H).scrollPaddingBottom)||0,X=Math.min(Al,H.childElementCount),G=0,z=0;for(let Q of(V=(I=x.elements.floating)==null?void 0:I.childNodes)!=null?V:[])if(Q instanceof HTMLElement){let ee=Q.offsetTop,Fe=ee+Q.clientHeight+Y,Ae=H.scrollTop,q=Ae+H.clientHeight;if(ee>=Ae&&Fe<=q)X--;else{z=Math.max(0,Math.min(Fe,q)-Math.max(ee,Ae)),G=Q.clientHeight;break}}X>=1&&o(Q=>{let ee=G*X-z+Y;return Q>=ee?Q:ee})}}):null,jm({padding:d,apply({availableWidth:D,availableHeight:I,elements:V}){Object.assign(V.floating.style,{overflow:"auto",maxWidth:`${D}px`,maxHeight:`min(var(--anchor-max-height, 100vh), ${I}px)`})}})].filter(Boolean),whileElementsMounted:Cm}),[_=v,$=b]=x.placement.split("-");v==="selection"&&(_="selection");let S=h.useMemo(()=>({anchor:[_,$].filter(Boolean).join(" ")}),[_,$]),C=Qm(x,{overflowRef:s,onChange:o}),{getReferenceProps:A,getFloatingProps:L}=Xm([C]),j=Z(D=>{a(D),g.setFloating(D)});return k.createElement(bo.Provider,{value:r},k.createElement(xn.Provider,{value:{setFloating:j,setReference:g.setReference,styles:y,getReferenceProps:A,getFloatingProps:L,slot:S}},e))}function og(e){pe(()=>{if(!e)return;let t=new MutationObserver(()=>{let n=window.getComputedStyle(e).maxHeight,r=parseFloat(n);if(isNaN(r))return;let i=parseInt(n);isNaN(i)||r!==i&&(e.style.maxHeight=`${Math.ceil(r)}px`)});return t.observe(e,{attributes:!0,attributeFilter:["style"]}),()=>{t.disconnect()}},[e])}function sg(e,t){var n,r,i;let o=xo((n=e==null?void 0:e.gap)!=null?n:"var(--anchor-gap, 0)",t),s=xo((r=e==null?void 0:e.offset)!=null?r:"var(--anchor-offset, 0)",t),l=xo((i=e==null?void 0:e.padding)!=null?i:"var(--anchor-padding, 0)",t);return{...e,gap:o,offset:s,padding:l}}function xo(e,t,n=void 0){let r=Zt(),i=Z((a,u)=>{if(a==null)return[n,null];if(typeof a=="number")return[a,null];if(typeof a=="string"){if(!u)return[n,null];let c=Ll(a,u);return[c,f=>{let m=Dl(a);{let d=m.map(p=>window.getComputedStyle(u).getPropertyValue(p));r.requestAnimationFrame(function p(){r.nextFrame(p);let v=!1;for(let[g,y]of m.entries()){let x=window.getComputedStyle(u).getPropertyValue(y);if(d[g]!==x){d[g]=x,v=!0;break}}if(!v)return;let b=Ll(a,u);c!==b&&(f(b),c=b)})}return r.dispose}]}return[n,null]}),o=h.useMemo(()=>i(e,t)[0],[e,t]),[s=o,l]=h.useState();return pe(()=>{let[a,u]=i(e,t);if(l(a),!!u)return u(l)},[e,t]),s}function Dl(e){let t=/var\((.*)\)/.exec(e);if(t){let n=t[1].indexOf(",");if(n===-1)return[t[1]];let r=t[1].slice(0,n).trim(),i=t[1].slice(n+1).trim();return i?[r,...Dl(i)]:[r]}return[]}function Ll(e,t){let n=document.createElement("div");t.appendChild(n),n.style.setProperty("margin-top","0px","important"),n.style.setProperty("margin-top",e,"important");let r=parseFloat(window.getComputedStyle(n).marginTop)||0;return t.removeChild(n),r}function ag(e,t){let[n,r]=h.useState(t);return!e&&n!==t&&r(t),e?n:t}let wo=h.createContext(null);wo.displayName="OpenClosedContext";var ct=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(ct||{});function Eo(){return h.useContext(wo)}function Pl({value:e,children:t}){return h.createElement(wo.Provider,{value:e},t)}function lg(e){throw new Error("Unexpected object: "+e)}var _e=(e=>(e[e.First=0]="First",e[e.Previous=1]="Previous",e[e.Next=2]="Next",e[e.Last=3]="Last",e[e.Specific=4]="Specific",e[e.Nothing=5]="Nothing",e))(_e||{});function To(e,t){let n=t.resolveItems();if(n.length<=0)return null;let r=t.resolveActiveIndex(),i=r??-1;switch(e.focus){case 0:{for(let o=0;o<n.length;++o)if(!t.resolveDisabled(n[o],o,n))return o;return r}case 1:{i===-1&&(i=n.length);for(let o=i-1;o>=0;--o)if(!t.resolveDisabled(n[o],o,n))return o;return r}case 2:{for(let o=i+1;o<n.length;++o)if(!t.resolveDisabled(n[o],o,n))return o;return r}case 3:{for(let o=n.length-1;o>=0;--o)if(!t.resolveDisabled(n[o],o,n))return o;return r}case 4:{for(let o=0;o<n.length;++o)if(t.resolveId(n[o],o,n)===e.id)return o;return r}case 5:return null;default:lg(e)}}function ug(e){let t=Z(e),n=h.useRef(!1);h.useEffect(()=>(n.current=!1,()=>{n.current=!0,Pa(()=>{n.current&&t()})}),[t])}function cg(){let e=typeof document>"u";return"useSyncExternalStore"in k?(t=>t.useSyncExternalStore)(k)(()=>()=>{},()=>!1,()=>!e):!1}function So(){let e=cg(),[t,n]=k.useState(Qt.isHandoffComplete);return t&&Qt.isHandoffComplete===!1&&n(!1),k.useEffect(()=>{t!==!0&&n(!0)},[t]),k.useEffect(()=>Qt.handoff(),[]),e?!1:t}let fg=h.createContext(!1);function dg(){return h.useContext(fg)}function pg(e){let t=dg(),n=h.useContext(Nl),r=so(e),[i,o]=h.useState(()=>{var s;if(!t&&n!==null)return(s=n.current)!=null?s:null;if(Qt.isServer)return null;let l=r==null?void 0:r.getElementById("headlessui-portal-root");if(l)return l;if(r===null)return null;let a=r.createElement("div");return a.setAttribute("id","headlessui-portal-root"),r.body.appendChild(a)});return h.useEffect(()=>{i!==null&&(r!=null&&r.body.contains(i)||r==null||r.body.appendChild(i))},[i,r]),h.useEffect(()=>{t||n!==null&&o(n.current)},[n,o,t]),i}let jl=h.Fragment,hg=Ye(function(e,t){let n=e,r=h.useRef(null),i=ot(ih(f=>{r.current=f}),t),o=so(r),s=pg(r),[l]=h.useState(()=>{var f;return Qt.isServer?null:(f=o==null?void 0:o.createElement("div"))!=null?f:null}),a=h.useContext(vg),u=So();pe(()=>{!s||!l||s.contains(l)||(l.setAttribute("data-headlessui-portal",""),s.appendChild(l))},[s,l]),pe(()=>{if(l&&a)return a.register(l)},[a,l]),ug(()=>{var f;!s||!l||(l instanceof Node&&s.contains(l)&&s.removeChild(l),s.childNodes.length<=0&&((f=s.parentElement)==null||f.removeChild(s)))});let c=Ze();return u?!s||!l?null:mt.createPortal(c({ourProps:{ref:i},theirProps:n,slot:{},defaultTag:jl,name:"Portal"}),l):null});function mg(e,t){let n=ot(t),{enabled:r=!0,...i}=e,o=Ze();return r?h.createElement(hg,{...i,ref:n}):o({ourProps:{ref:n},theirProps:i,slot:{},defaultTag:jl,name:"Portal"})}let gg=h.Fragment,Nl=h.createContext(null);function yg(e,t){let{target:n,...r}=e,i={ref:ot(t)},o=Ze();return h.createElement(Nl.Provider,{value:n},o({ourProps:i,theirProps:r,defaultTag:gg,name:"Popover.Group"}))}let vg=h.createContext(null),bg=Ye(mg),xg=Ye(yg),wg=Object.assign(bg,{Group:xg});function Eg(){let e=h.useRef(!1);return pe(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function Il(e){var t;return!!(e.enter||e.enterFrom||e.enterTo||e.leave||e.leaveFrom||e.leaveTo)||((t=e.as)!=null?t:Vl)!==h.Fragment||h.Children.count(e.children)===1}let Wr=h.createContext(null);Wr.displayName="TransitionContext";var Tg=(e=>(e.Visible="visible",e.Hidden="hidden",e))(Tg||{});function Sg(){let e=h.useContext(Wr);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}function _g(){let e=h.useContext(Kr);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}let Kr=h.createContext(null);Kr.displayName="NestingContext";function Yr(e){return"children"in e?Yr(e.children):e.current.filter(({el:t})=>t.current!==null).filter(({state:t})=>t==="visible").length>0}function Ml(e,t){let n=en(e),r=h.useRef([]),i=Eg(),o=Zt(),s=Z((d,p=Mt.Hidden)=>{let v=r.current.findIndex(({el:b})=>b===d);v!==-1&&(lt(p,{[Mt.Unmount](){r.current.splice(v,1)},[Mt.Hidden](){r.current[v].state="hidden"}}),o.microTask(()=>{var b;!Yr(r)&&i.current&&((b=n.current)==null||b.call(n))}))}),l=Z(d=>{let p=r.current.find(({el:v})=>v===d);return p?p.state!=="visible"&&(p.state="visible"):r.current.push({el:d,state:"visible"}),()=>s(d,Mt.Unmount)}),a=h.useRef([]),u=h.useRef(Promise.resolve()),c=h.useRef({enter:[],leave:[]}),f=Z((d,p,v)=>{a.current.splice(0),t&&(t.chains.current[p]=t.chains.current[p].filter(([b])=>b!==d)),t==null||t.chains.current[p].push([d,new Promise(b=>{a.current.push(b)})]),t==null||t.chains.current[p].push([d,new Promise(b=>{Promise.all(c.current[p].map(([g,y])=>y)).then(()=>b())})]),p==="enter"?u.current=u.current.then(()=>t==null?void 0:t.wait.current).then(()=>v(p)):v(p)}),m=Z((d,p,v)=>{Promise.all(c.current[p].splice(0).map(([b,g])=>g)).then(()=>{var b;(b=a.current.shift())==null||b()}).then(()=>v(p))});return h.useMemo(()=>({children:r,register:l,unregister:s,onStart:f,onStop:m,wait:u,chains:c}),[l,s,r,f,m,c,u])}let Vl=h.Fragment,Rl=Pr.RenderStrategy;function Cg(e,t){var n,r;let{transition:i=!0,beforeEnter:o,afterEnter:s,beforeLeave:l,afterLeave:a,enter:u,enterFrom:c,enterTo:f,entered:m,leave:d,leaveFrom:p,leaveTo:v,...b}=e,[g,y]=h.useState(null),x=h.useRef(null),_=Il(e),$=ot(..._?[x,t,y]:t===null?[]:[t]),S=(n=b.unmount)==null||n?Mt.Unmount:Mt.Hidden,{show:C,appear:A,initial:L}=Sg(),[j,D]=h.useState(C?"visible":"hidden"),I=_g(),{register:V,unregister:H}=I;pe(()=>V(x),[V,x]),pe(()=>{if(S===Mt.Hidden&&x.current){if(C&&j!=="visible"){D("visible");return}return lt(j,{hidden:()=>H(x),visible:()=>V(x)})}},[j,x,V,H,C,S]);let Y=So();pe(()=>{if(_&&Y&&j==="visible"&&x.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[x,j,Y,_]);let X=L&&!A,G=A&&C&&L,z=h.useRef(!1),Q=Ml(()=>{z.current||(D("hidden"),H(x))},I),ee=Z(ke=>{z.current=!0;let xe=ke?"enter":"leave";Q.onStart(x,xe,De=>{De==="enter"?o==null||o():De==="leave"&&(l==null||l())})}),Fe=Z(ke=>{let xe=ke?"enter":"leave";z.current=!1,Q.onStop(x,xe,De=>{De==="enter"?s==null||s():De==="leave"&&(a==null||a())}),xe==="leave"&&!Yr(Q)&&(D("hidden"),H(x))});h.useEffect(()=>{_&&i||(ee(C),Fe(C))},[C,_,i]);let Ae=!(!i||!_||!Y||X),[,q]=ol(Ae,g,C,{start:ee,end:Fe}),ge=Vt({ref:$,className:((r=Ji(b.className,G&&u,G&&c,q.enter&&u,q.enter&&q.closed&&c,q.enter&&!q.closed&&f,q.leave&&d,q.leave&&!q.closed&&p,q.leave&&q.closed&&v,!q.transition&&C&&m))==null?void 0:r.trim())||void 0,...il(q)}),be=0;j==="visible"&&(be|=ct.Open),j==="hidden"&&(be|=ct.Closed),q.enter&&(be|=ct.Opening),q.leave&&(be|=ct.Closing);let oe=Ze();return h.createElement(Kr.Provider,{value:Q},h.createElement(Pl,{value:be},oe({ourProps:ge,theirProps:b,defaultTag:Vl,features:Rl,visible:j==="visible",name:"Transition.Child"})))}function Fg(e,t){let{show:n,appear:r=!1,unmount:i=!0,...o}=e,s=h.useRef(null),l=Il(e),a=ot(...l?[s,t]:t===null?[]:[t]);So();let u=Eo();if(n===void 0&&u!==null&&(n=(u&ct.Open)===ct.Open),n===void 0)throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[c,f]=h.useState(n?"visible":"hidden"),m=Ml(()=>{n||f("hidden")}),[d,p]=h.useState(!0),v=h.useRef([n]);pe(()=>{d!==!1&&v.current[v.current.length-1]!==n&&(v.current.push(n),p(!1))},[v,n]);let b=h.useMemo(()=>({show:n,appear:r,initial:d}),[n,r,d]);pe(()=>{n?f("visible"):!Yr(m)&&s.current!==null&&f("hidden")},[n,m]);let g={unmount:i},y=Z(()=>{var $;d&&p(!1),($=e.beforeEnter)==null||$.call(e)}),x=Z(()=>{var $;d&&p(!1),($=e.beforeLeave)==null||$.call(e)}),_=Ze();return h.createElement(Kr.Provider,{value:m},h.createElement(Wr.Provider,{value:b},_({ourProps:{...g,as:h.Fragment,children:h.createElement(Bl,{ref:a,...g,...o,beforeEnter:y,beforeLeave:x})},theirProps:{},defaultTag:h.Fragment,features:Rl,visible:c==="visible",name:"Transition"})))}function kg(e,t){let n=h.useContext(Wr)!==null,r=Eo()!==null;return h.createElement(h.Fragment,null,!n&&r?h.createElement(_o,{ref:t,...e}):h.createElement(Bl,{ref:t,...e}))}let _o=Ye(Fg),Bl=Ye(Cg),$g=Ye(kg),Og=Object.assign(_o,{Child:$g,Root:_o});function Ag(e,t){let n=h.useRef({left:0,top:0});if(pe(()=>{if(!t)return;let i=t.getBoundingClientRect();i&&(n.current=i)},[e,t]),t==null||!e||t===document.activeElement)return!1;let r=t.getBoundingClientRect();return r.top!==n.current.top||r.left!==n.current.left}let Ul=/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g;function Hl(e){var t,n;let r=(t=e.innerText)!=null?t:"",i=e.cloneNode(!0);if(!(i instanceof HTMLElement))return r;let o=!1;for(let l of i.querySelectorAll('[hidden],[aria-hidden],[role="img"]'))l.remove(),o=!0;let s=o?(n=i.innerText)!=null?n:"":r;return Ul.test(s)&&(s=s.replace(Ul,"")),s}function Dg(e){let t=e.getAttribute("aria-label");if(typeof t=="string")return t.trim();let n=e.getAttribute("aria-labelledby");if(n){let r=n.split(" ").map(i=>{let o=document.getElementById(i);if(o){let s=o.getAttribute("aria-label");return typeof s=="string"?s.trim():Hl(o).trim()}return null}).filter(Boolean);if(r.length>0)return r.join(", ")}return Hl(e).trim()}function Lg(e){let t=h.useRef(""),n=h.useRef("");return Z(()=>{let r=e.current;if(!r)return"";let i=r.innerText;if(t.current===i)return n.current;let o=Dg(r).trim().toLowerCase();return t.current=i,n.current=o,o})}var Pg=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(Pg||{}),jg=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(jg||{}),Ng=(e=>(e[e.Pointer=0]="Pointer",e[e.Other=1]="Other",e))(Ng||{}),Ig=(e=>(e[e.OpenListbox=0]="OpenListbox",e[e.CloseListbox=1]="CloseListbox",e[e.GoToOption=2]="GoToOption",e[e.Search=3]="Search",e[e.ClearSearch=4]="ClearSearch",e[e.RegisterOption=5]="RegisterOption",e[e.UnregisterOption=6]="UnregisterOption",e[e.SetButtonElement=7]="SetButtonElement",e[e.SetOptionsElement=8]="SetOptionsElement",e))(Ig||{});function Co(e,t=n=>n){let n=e.activeOptionIndex!==null?e.options[e.activeOptionIndex]:null,r=Qa(t(e.options.slice()),o=>o.dataRef.current.domRef.current),i=n?r.indexOf(n):null;return i===-1&&(i=null),{options:r,activeOptionIndex:i}}let Mg={1(e){return e.dataRef.current.disabled||e.listboxState===1?e:{...e,activeOptionIndex:null,listboxState:1,__demoMode:!1}},0(e){if(e.dataRef.current.disabled||e.listboxState===0)return e;let t=e.activeOptionIndex,{isSelected:n}=e.dataRef.current,r=e.options.findIndex(i=>n(i.dataRef.current.value));return r!==-1&&(t=r),{...e,listboxState:0,activeOptionIndex:t,__demoMode:!1}},2(e,t){var n,r,i,o,s;if(e.dataRef.current.disabled||e.listboxState===1)return e;let l={...e,searchQuery:"",activationTrigger:(n=t.trigger)!=null?n:1,__demoMode:!1};if(t.focus===_e.Nothing)return{...l,activeOptionIndex:null};if(t.focus===_e.Specific)return{...l,activeOptionIndex:e.options.findIndex(c=>c.id===t.id)};if(t.focus===_e.Previous){let c=e.activeOptionIndex;if(c!==null){let f=e.options[c].dataRef.current.domRef,m=To(t,{resolveItems:()=>e.options,resolveActiveIndex:()=>e.activeOptionIndex,resolveId:d=>d.id,resolveDisabled:d=>d.dataRef.current.disabled});if(m!==null){let d=e.options[m].dataRef.current.domRef;if(((r=f.current)==null?void 0:r.previousElementSibling)===d.current||((i=d.current)==null?void 0:i.previousElementSibling)===null)return{...l,activeOptionIndex:m}}}}else if(t.focus===_e.Next){let c=e.activeOptionIndex;if(c!==null){let f=e.options[c].dataRef.current.domRef,m=To(t,{resolveItems:()=>e.options,resolveActiveIndex:()=>e.activeOptionIndex,resolveId:d=>d.id,resolveDisabled:d=>d.dataRef.current.disabled});if(m!==null){let d=e.options[m].dataRef.current.domRef;if(((o=f.current)==null?void 0:o.nextElementSibling)===d.current||((s=d.current)==null?void 0:s.nextElementSibling)===null)return{...l,activeOptionIndex:m}}}}let a=Co(e),u=To(t,{resolveItems:()=>a.options,resolveActiveIndex:()=>a.activeOptionIndex,resolveId:c=>c.id,resolveDisabled:c=>c.dataRef.current.disabled});return{...l,...a,activeOptionIndex:u}},3:(e,t)=>{if(e.dataRef.current.disabled||e.listboxState===1)return e;let n=e.searchQuery!==""?0:1,r=e.searchQuery+t.value.toLowerCase(),i=(e.activeOptionIndex!==null?e.options.slice(e.activeOptionIndex+n).concat(e.options.slice(0,e.activeOptionIndex+n)):e.options).find(s=>{var l;return!s.dataRef.current.disabled&&((l=s.dataRef.current.textValue)==null?void 0:l.startsWith(r))}),o=i?e.options.indexOf(i):-1;return o===-1||o===e.activeOptionIndex?{...e,searchQuery:r}:{...e,searchQuery:r,activeOptionIndex:o,activationTrigger:1}},4(e){return e.dataRef.current.disabled||e.listboxState===1||e.searchQuery===""?e:{...e,searchQuery:""}},5:(e,t)=>{let n={id:t.id,dataRef:t.dataRef},r=Co(e,i=>[...i,n]);return e.activeOptionIndex===null&&e.dataRef.current.isSelected(t.dataRef.current.value)&&(r.activeOptionIndex=r.options.indexOf(n)),{...e,...r}},6:(e,t)=>{let n=Co(e,r=>{let i=r.findIndex(o=>o.id===t.id);return i!==-1&&r.splice(i,1),r});return{...e,...n,activationTrigger:1}},7:(e,t)=>e.buttonElement===t.element?e:{...e,buttonElement:t.element},8:(e,t)=>e.optionsElement===t.element?e:{...e,optionsElement:t.element}},Fo=h.createContext(null);Fo.displayName="ListboxActionsContext";function Gr(e){let t=h.useContext(Fo);if(t===null){let n=new Error(`<${e} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Gr),n}return t}let Xr=h.createContext(null);Xr.displayName="ListboxDataContext";function Zn(e){let t=h.useContext(Xr);if(t===null){let n=new Error(`<${e} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Zn),n}return t}function Vg(e,t){return lt(t.type,Mg,e,t)}let Rg=h.Fragment;function Bg(e,t){var n;let r=Xi(),{value:i,defaultValue:o,form:s,name:l,onChange:a,by:u,invalid:c=!1,disabled:f=r||!1,horizontal:m=!1,multiple:d=!1,__demoMode:p=!1,...v}=e;const b=m?"horizontal":"vertical";let g=ot(t),y=Kp(o),[x=d?[]:void 0,_]=Wp(i,a,y),[$,S]=h.useReducer(Vg,{dataRef:h.createRef(),listboxState:p?0:1,options:[],searchQuery:"",activeOptionIndex:null,activationTrigger:1,optionsVisible:!1,buttonElement:null,optionsElement:null,__demoMode:p}),C=h.useRef({static:!1,hold:!1}),A=h.useRef(new Map),L=mh(u),j=h.useCallback(ne=>lt(D.mode,{1:()=>x.some(de=>L(de,ne)),0:()=>L(x,ne)}),[x]),D=h.useMemo(()=>({...$,value:x,disabled:f,invalid:c,mode:d?1:0,orientation:b,compare:L,isSelected:j,optionsPropsRef:C,listRef:A}),[x,f,c,d,$,A]);pe(()=>{$.dataRef.current=D},[D]);let I=D.listboxState===0;Ph(I,[D.buttonElement,D.optionsElement],(ne,de)=>{var $e;S({type:1}),Ja(de,oo.Loose)||(ne.preventDefault(),($e=D.buttonElement)==null||$e.focus())});let V=h.useMemo(()=>({open:D.listboxState===0,disabled:f,invalid:c,value:x}),[D,f,x,c]),H=Z(ne=>{let de=D.options.find($e=>$e.id===ne);de&&Fe(de.dataRef.current.value)}),Y=Z(()=>{if(D.activeOptionIndex!==null){let{dataRef:ne,id:de}=D.options[D.activeOptionIndex];Fe(ne.current.value),S({type:2,focus:_e.Specific,id:de})}}),X=Z(()=>S({type:0})),G=Z(()=>S({type:1})),z=Zt(),Q=Z((ne,de,$e)=>{z.dispose(),z.microTask(()=>ne===_e.Specific?S({type:2,focus:_e.Specific,id:de,trigger:$e}):S({type:2,focus:ne,trigger:$e}))}),ee=Z((ne,de)=>(S({type:5,id:ne,dataRef:de}),()=>S({type:6,id:ne}))),Fe=Z(ne=>lt(D.mode,{0(){return _==null?void 0:_(ne)},1(){let de=D.value.slice(),$e=de.findIndex(jt=>L(jt,ne));return $e===-1?de.push(ne):de.splice($e,1),_==null?void 0:_(de)}})),Ae=Z(ne=>S({type:3,value:ne})),q=Z(()=>S({type:4})),ge=Z(ne=>{S({type:7,element:ne})}),be=Z(ne=>{S({type:8,element:ne})}),oe=h.useMemo(()=>({onChange:Fe,registerOption:ee,goToOption:Q,closeListbox:G,openListbox:X,selectActiveOption:Y,selectOption:H,search:Ae,clearSearch:q,setButtonElement:ge,setOptionsElement:be}),[]),[ke,xe]=uh({inherit:!0}),De={ref:g},dt=h.useCallback(()=>{if(y!==void 0)return _==null?void 0:_(y)},[_,y]),we=Ze();return h.createElement(xe,{value:ke,props:{htmlFor:(n=D.buttonElement)==null?void 0:n.id},slot:{open:D.listboxState===0,disabled:f}},h.createElement(ig,null,h.createElement(Fo.Provider,{value:oe},h.createElement(Xr.Provider,{value:D},h.createElement(Pl,{value:lt(D.listboxState,{0:ct.Open,1:ct.Closed})},l!=null&&x!=null&&h.createElement(Zp,{disabled:f,data:{[l]:x},form:s,onReset:dt}),we({ourProps:De,theirProps:v,slot:V,defaultTag:Rg,name:"Listbox"}))))))}let Ug="button";function Hg(e,t){var n;let r=Zn("Listbox.Button"),i=Gr("Listbox.Button"),o=h.useId(),s=Ba(),{id:l=s||`headlessui-listbox-button-${o}`,disabled:a=r.disabled||!1,autoFocus:u=!1,...c}=e,f=ot(t,eg(),i.setButtonElement),m=tg(),d=Z(D=>{switch(D.key){case Oe.Enter:Yp(D.currentTarget);break;case Oe.Space:case Oe.ArrowDown:D.preventDefault(),mt.flushSync(()=>i.openListbox()),r.value||i.goToOption(_e.First);break;case Oe.ArrowUp:D.preventDefault(),mt.flushSync(()=>i.openListbox()),r.value||i.goToOption(_e.Last);break}}),p=Z(D=>{switch(D.key){case Oe.Space:D.preventDefault();break}}),v=Z(D=>{var I;if(nh(D.currentTarget))return D.preventDefault();r.listboxState===0?(mt.flushSync(()=>i.closeListbox()),(I=r.buttonElement)==null||I.focus({preventScroll:!0})):(D.preventDefault(),i.openListbox())}),b=Z(D=>D.preventDefault()),g=za([l]),y=oh(),{isFocusVisible:x,focusProps:_}=Pp({autoFocus:u}),{isHovered:$,hoverProps:S}=Lp({isDisabled:a}),{pressed:C,pressProps:A}=Rp({disabled:a}),L=h.useMemo(()=>({open:r.listboxState===0,active:C||r.listboxState===0,disabled:a,invalid:r.invalid,value:r.value,hover:$,focus:x,autofocus:u}),[r.listboxState,r.value,a,$,x,C,r.invalid,u]),j=Na(m(),{ref:f,id:l,type:jh(e,r.buttonElement),"aria-haspopup":"listbox","aria-controls":(n=r.optionsElement)==null?void 0:n.id,"aria-expanded":r.listboxState===0,"aria-labelledby":g,"aria-describedby":y,disabled:a||void 0,autoFocus:u,onKeyDown:d,onKeyUp:p,onKeyPress:b,onClick:v},_,S,A);return Ze()({ourProps:j,theirProps:c,slot:L,defaultTag:Ug,name:"Listbox.Button"})}let ql=h.createContext(!1),qg="div",zg=Pr.RenderStrategy|Pr.Static;function Wg(e,t){var n,r;let i=h.useId(),{id:o=`headlessui-listbox-options-${i}`,anchor:s,portal:l=!1,modal:a=!0,transition:u=!1,...c}=e,f=Zm(s),[m,d]=h.useState(null);f&&(l=!0);let p=Zn("Listbox.Options"),v=Gr("Listbox.Options"),b=so(p.optionsElement),g=Eo(),[y,x]=ol(u,m,g!==null?(g&ct.Open)===ct.Open:p.listboxState===0);wh(y,p.buttonElement,v.closeListbox);let _=p.__demoMode?!1:a&&p.listboxState===0;Bh(_,b);let $=p.__demoMode?!1:a&&p.listboxState===0;xh($,{allowed:h.useCallback(()=>[p.buttonElement,p.optionsElement],[p.buttonElement,p.optionsElement])});let S=p.listboxState!==0,C=Ag(S,p.buttonElement)?!1:y,A=y&&p.listboxState===1,L=ag(A,p.value),j=Z(q=>p.compare(L,q)),D=h.useMemo(()=>{var q;if(f==null||!((q=f==null?void 0:f.to)!=null&&q.includes("selection")))return null;let ge=p.options.findIndex(be=>j(be.dataRef.current.value));return ge===-1&&(ge=0),ge},[f,p.options]),I=(()=>{if(f==null)return;if(D===null)return{...f,inner:void 0};let q=Array.from(p.listRef.current.values());return{...f,inner:{listRef:{current:q},index:D}}})(),[V,H]=rg(I),Y=ng(),X=ot(t,f?V:null,v.setOptionsElement,d),G=Zt();h.useEffect(()=>{var q;let ge=p.optionsElement;ge&&p.listboxState===0&&ge!==((q=zn(ge))==null?void 0:q.activeElement)&&(ge==null||ge.focus({preventScroll:!0}))},[p.listboxState,p.optionsElement]);let z=Z(q=>{var ge,be;switch(G.dispose(),q.key){case Oe.Space:if(p.searchQuery!=="")return q.preventDefault(),q.stopPropagation(),v.search(q.key);case Oe.Enter:if(q.preventDefault(),q.stopPropagation(),p.activeOptionIndex!==null){let{dataRef:oe}=p.options[p.activeOptionIndex];v.onChange(oe.current.value)}p.mode===0&&(mt.flushSync(()=>v.closeListbox()),(ge=p.buttonElement)==null||ge.focus({preventScroll:!0}));break;case lt(p.orientation,{vertical:Oe.ArrowDown,horizontal:Oe.ArrowRight}):return q.preventDefault(),q.stopPropagation(),v.goToOption(_e.Next);case lt(p.orientation,{vertical:Oe.ArrowUp,horizontal:Oe.ArrowLeft}):return q.preventDefault(),q.stopPropagation(),v.goToOption(_e.Previous);case Oe.Home:case Oe.PageUp:return q.preventDefault(),q.stopPropagation(),v.goToOption(_e.First);case Oe.End:case Oe.PageDown:return q.preventDefault(),q.stopPropagation(),v.goToOption(_e.Last);case Oe.Escape:q.preventDefault(),q.stopPropagation(),mt.flushSync(()=>v.closeListbox()),(be=p.buttonElement)==null||be.focus({preventScroll:!0});return;case Oe.Tab:q.preventDefault(),q.stopPropagation(),mt.flushSync(()=>v.closeListbox()),$h(p.buttonElement,q.shiftKey?io.Previous:io.Next);break;default:q.key.length===1&&(v.search(q.key),G.setTimeout(()=>v.clearSearch(),350));break}}),Q=(n=p.buttonElement)==null?void 0:n.id,ee=h.useMemo(()=>({open:p.listboxState===0}),[p.listboxState]),Fe=Na(f?Y():{},{id:o,ref:X,"aria-activedescendant":p.activeOptionIndex===null||(r=p.options[p.activeOptionIndex])==null?void 0:r.id,"aria-multiselectable":p.mode===1?!0:void 0,"aria-labelledby":Q,"aria-orientation":p.orientation,onKeyDown:z,role:"listbox",tabIndex:p.listboxState===0?0:void 0,style:{...c.style,...H,"--button-width":yh(p.buttonElement,!0).width},...il(x)}),Ae=Ze();return h.createElement(wg,{enabled:l?e.static||y:!1},h.createElement(Xr.Provider,{value:p.mode===1?p:{...p,isSelected:j}},Ae({ourProps:Fe,theirProps:c,slot:ee,defaultTag:qg,features:zg,visible:C,name:"Listbox.Options"})))}let Kg="div";function Yg(e,t){let n=h.useId(),{id:r=`headlessui-listbox-option-${n}`,disabled:i=!1,value:o,...s}=e,l=h.useContext(ql)===!0,a=Zn("Listbox.Option"),u=Gr("Listbox.Option"),c=a.activeOptionIndex!==null?a.options[a.activeOptionIndex].id===r:!1,f=a.isSelected(o),m=h.useRef(null),d=Lg(m),p=en({disabled:i,value:o,domRef:m,get textValue(){return d()}}),v=ot(t,m,L=>{L?a.listRef.current.set(r,L):a.listRef.current.delete(r)});pe(()=>{if(!a.__demoMode&&a.listboxState===0&&c&&a.activationTrigger!==0)return At().requestAnimationFrame(()=>{var L,j;(j=(L=m.current)==null?void 0:L.scrollIntoView)==null||j.call(L,{block:"nearest"})})},[m,c,a.__demoMode,a.listboxState,a.activationTrigger,a.activeOptionIndex]),pe(()=>{if(!l)return u.registerOption(r,p)},[p,r,l]);let b=Z(L=>{var j;if(i)return L.preventDefault();u.onChange(o),a.mode===0&&(mt.flushSync(()=>u.closeListbox()),(j=a.buttonElement)==null||j.focus({preventScroll:!0}))}),g=Z(()=>{if(i)return u.goToOption(_e.Nothing);u.goToOption(_e.Specific,r)}),y=Uh(),x=Z(L=>{y.update(L),!i&&(c||u.goToOption(_e.Specific,r,0))}),_=Z(L=>{y.wasMoved(L)&&(i||c||u.goToOption(_e.Specific,r,0))}),$=Z(L=>{y.wasMoved(L)&&(i||c&&u.goToOption(_e.Nothing))}),S=h.useMemo(()=>({active:c,focus:c,selected:f,disabled:i,selectedOption:f&&l}),[c,f,i,l]),C=l?{}:{id:r,ref:v,role:"option",tabIndex:i===!0?void 0:-1,"aria-disabled":i===!0?!0:void 0,"aria-selected":f,disabled:void 0,onClick:b,onFocus:g,onPointerEnter:x,onMouseEnter:x,onPointerMove:_,onMouseMove:_,onPointerLeave:$,onMouseLeave:$},A=Ze();return!f&&l?null:A({ourProps:C,theirProps:s,slot:S,defaultTag:Kg,name:"Listbox.Option"})}let Gg=h.Fragment;function Xg(e,t){let{options:n,placeholder:r,...i}=e,o={ref:ot(t)},s=Zn("ListboxSelectedOption"),l=h.useMemo(()=>({}),[]),a=s.value===void 0||s.value===null||s.mode===1&&Array.isArray(s.value)&&s.value.length===0,u=Ze();return h.createElement(ql.Provider,{value:!0},u({ourProps:o,theirProps:{...i,children:h.createElement(h.Fragment,null,r&&a?r:n)},slot:l,defaultTag:Gg,name:"ListboxSelectedOption"}))}let Jg=Ye(Bg),Qg=Ye(Hg),Zg=ph,ey=Ye(Wg),ty=Ye(Yg),ny=Ye(Xg),Jr=Object.assign(Jg,{Button:Qg,Label:Zg,Options:ey,Option:ty,SelectedOption:ny});const ry=({className:e="",options:t,placeholder:n="Select",errors:r,register:i,setValue:o,name:s,label:l,value:a,trigger:u,isMultiple:c,isFloatingLabel:f,subText:m,labelClass:d="text-[10px]",loading:p})=>{const[v,b]=h.useState(c?[]:null),g=rt("input-control",e);return h.useEffect(()=>{v&&o&&i&&(o(s,v==null?void 0:v.value),i(s),u(s))},[s,i,v,o]),h.useEffect(()=>{const y=t==null?void 0:t.find(x=>typeof x.value=="string"&&typeof a=="string"?x.value.toLowerCase()===a.toLowerCase():typeof x.value=="object"&&typeof a=="object"?x.value.id===(a==null?void 0:a.id):x.value===a);b(y||null)},[a,t]),w.jsxs("div",{className:"relative",children:[!f&&l&&w.jsx("label",{className:"block text-sm text-[#686878] darks:!text-white/70 mb-2",children:l}),f&&w.jsx("label",{className:`z-[40] absolute block text-[#667085] bg-white py-[2px] px-1 -top-[10px] left-3 ${d}`,children:l}),w.jsx(Jr,{value:v,onChange:b,multiple:c,children:w.jsxs("div",{className:"relative",children:[w.jsxs(Jr.Button,{className:g,children:[p?w.jsx("span",{className:" block opacity-60 text-sm text-left",children:"Fetching data ..."}):w.jsx("span",{className:"block truncate text-sm text-left",children:(v==null?void 0:v.label)||w.jsx("span",{className:"opacity-60",children:n})}),w.jsx("span",{className:"pointer-events-none absolute inset-y-0 right-0 flex items-center pr-2",children:w.jsx(He,{icon:"lucide:chevron-down"})})]}),w.jsx(Og,{as:h.Fragment,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:w.jsx(Jr.Options,{className:"z-[77] absolute mt-1 max-h-60 w-full overflow-auto rounded-md bg-white darks:bg-gray-800 text-gray-900 darks:text-white/80 py-1 text-base shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none sm:text-sm",children:t==null?void 0:t.map((y,x)=>w.jsx(Jr.Option,{className:({active:_})=>`relative cursor-default select-none py-2 pl-4 pr-4 text-sm ${_?"bg-gray-100 darks:bg-gray-700 text-gray-900 darks:text-white/80":"text-gray-900 darks:text-white/70 "}`,value:y,children:({selected:_})=>w.jsx("div",{className:`block truncate text-sm ${_?"font-medium":"font-normal"}`,children:y.label})},x))})})]})}),!r&&m&&w.jsx("p",{className:"text-[10px] text-[#98A2B3] leading-normal mt-[6px]",children:m}),r&&w.jsx("span",{className:"text-sm text-red-500",children:r.message})]})};function zl({element:e}){return w.jsx("div",{children:w.jsx(ry,{options:(e==null?void 0:e.options)??[],name:""})})}function Wl({element:e,validationData:t}){const{register:n=()=>({})}=t||{};return w.jsx("textarea",{placeholder:e.placeholder,rows:4,className:"input-control resize-none",...n(e.id)})}var er=e=>e.type==="checkbox",sn=e=>e instanceof Date,qe=e=>e==null;const Kl=e=>typeof e=="object";var ve=e=>!qe(e)&&!Array.isArray(e)&&Kl(e)&&!sn(e),iy=e=>ve(e)&&e.target?er(e.target)?e.target.checked:e.target.value:e,oy=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,sy=(e,t)=>e.has(oy(t)),ay=e=>{const t=e.constructor&&e.constructor.prototype;return ve(t)&&t.hasOwnProperty("isPrototypeOf")},ko=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function je(e){let t;const n=Array.isArray(e),r=typeof FileList<"u"?e instanceof FileList:!1;if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else if(!(ko&&(e instanceof Blob||r))&&(n||ve(e)))if(t=n?[]:{},!n&&!ay(e))t=e;else for(const i in e)e.hasOwnProperty(i)&&(t[i]=je(e[i]));else return e;return t}var tr=e=>Array.isArray(e)?e.filter(Boolean):[],ce=e=>e===void 0,B=(e,t,n)=>{if(!t||!ve(e))return n;const r=tr(t.split(/[,[\].]+?/)).reduce((i,o)=>qe(i)?i:i[o],e);return ce(r)||r===e?ce(e[t])?n:e[t]:r},xt=e=>typeof e=="boolean",$o=e=>/^\w*$/.test(e),Yl=e=>tr(e.replace(/["|']|\]/g,"").split(/\.|\[/)),ie=(e,t,n)=>{let r=-1;const i=$o(t)?[t]:Yl(t),o=i.length,s=o-1;for(;++r<o;){const l=i[r];let a=n;if(r!==s){const u=e[l];a=ve(u)||Array.isArray(u)?u:isNaN(+i[r+1])?{}:[]}if(l==="__proto__"||l==="constructor"||l==="prototype")return;e[l]=a,e=e[l]}return e};const Gl={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},st={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Dt={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},Xl=h.createContext(null),ly=()=>h.useContext(Xl),uy=e=>{const{children:t,...n}=e;return h.createElement(Xl.Provider,{value:n},t)};var cy=(e,t,n,r=!0)=>{const i={defaultValues:t._defaultValues};for(const o in e)Object.defineProperty(i,o,{get:()=>{const s=o;return t._proxyFormState[s]!==st.all&&(t._proxyFormState[s]=!r||st.all),e[s]}});return i},ze=e=>ve(e)&&!Object.keys(e).length,fy=(e,t,n,r)=>{n(e);const{name:i,...o}=e;return ze(o)||Object.keys(o).length>=Object.keys(t).length||Object.keys(o).find(s=>t[s]===st.all)},tt=e=>Array.isArray(e)?e:[e];function Jl(e){const t=h.useRef(e);t.current=e,h.useEffect(()=>{const n=!e.disabled&&t.current.subject&&t.current.subject.subscribe({next:t.current.next});return()=>{n&&n.unsubscribe()}},[e.disabled])}var wt=e=>typeof e=="string",dy=(e,t,n,r,i)=>wt(e)?(r&&t.watch.add(e),B(n,e,i)):Array.isArray(e)?e.map(o=>(r&&t.watch.add(o),B(n,o))):(r&&(t.watchAll=!0),n),Ql=(e,t,n,r,i)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:i||!0}}:{},Ut=()=>{const e=typeof performance>"u"?Date.now():performance.now()*1e3;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const n=(Math.random()*16+e)%16|0;return(t=="x"?n:n&3|8).toString(16)})},Oo=(e,t,n={})=>n.shouldFocus||ce(n.shouldFocus)?n.focusName||`${e}.${ce(n.focusIndex)?t:n.focusIndex}.`:"",nr=e=>({isOnSubmit:!e||e===st.onSubmit,isOnBlur:e===st.onBlur,isOnChange:e===st.onChange,isOnAll:e===st.all,isOnTouch:e===st.onTouched}),Ao=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(r=>e.startsWith(r)&&/^\.\w+/.test(e.slice(r.length))));const wn=(e,t,n,r)=>{for(const i of n||Object.keys(e)){const o=B(e,i);if(o){const{_f:s,...l}=o;if(s){if(s.refs&&s.refs[0]&&t(s.refs[0],i)&&!r)return!0;if(s.ref&&t(s.ref,s.name)&&!r)return!0;if(wn(l,t))break}else if(ve(l)&&wn(l,t))break}}};var Zl=(e,t,n)=>{const r=tt(B(e,n));return ie(r,"root",t[n]),ie(e,n,r),e},Do=e=>e.type==="file",Et=e=>typeof e=="function",Qr=e=>{if(!ko)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},Zr=e=>wt(e),Lo=e=>e.type==="radio",ei=e=>e instanceof RegExp;const eu={value:!1,isValid:!1},tu={value:!0,isValid:!0};var nu=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!ce(e[0].attributes.value)?ce(e[0].value)||e[0].value===""?tu:{value:e[0].value,isValid:!0}:tu:eu}return eu};const ru={isValid:!1,value:null};var iu=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,ru):ru;function ou(e,t,n="validate"){if(Zr(e)||Array.isArray(e)&&e.every(Zr)||xt(e)&&!e)return{type:n,message:Zr(e)?e:"",ref:t}}var En=e=>ve(e)&&!ei(e)?e:{value:e,message:""},Po=async(e,t,n,r,i)=>{const{ref:o,refs:s,required:l,maxLength:a,minLength:u,min:c,max:f,pattern:m,validate:d,name:p,valueAsNumber:v,mount:b,disabled:g}=e._f,y=B(t,p);if(!b||g)return{};const x=s?s[0]:o,_=I=>{r&&x.reportValidity&&(x.setCustomValidity(xt(I)?"":I||""),x.reportValidity())},$={},S=Lo(o),C=er(o),A=S||C,L=(v||Do(o))&&ce(o.value)&&ce(y)||Qr(o)&&o.value===""||y===""||Array.isArray(y)&&!y.length,j=Ql.bind(null,p,n,$),D=(I,V,H,Y=Dt.maxLength,X=Dt.minLength)=>{const G=I?V:H;$[p]={type:I?Y:X,message:G,ref:o,...j(I?Y:X,G)}};if(i?!Array.isArray(y)||!y.length:l&&(!A&&(L||qe(y))||xt(y)&&!y||C&&!nu(s).isValid||S&&!iu(s).isValid)){const{value:I,message:V}=Zr(l)?{value:!!l,message:l}:En(l);if(I&&($[p]={type:Dt.required,message:V,ref:x,...j(Dt.required,V)},!n))return _(V),$}if(!L&&(!qe(c)||!qe(f))){let I,V;const H=En(f),Y=En(c);if(!qe(y)&&!isNaN(y)){const X=o.valueAsNumber||y&&+y;qe(H.value)||(I=X>H.value),qe(Y.value)||(V=X<Y.value)}else{const X=o.valueAsDate||new Date(y),G=ee=>new Date(new Date().toDateString()+" "+ee),z=o.type=="time",Q=o.type=="week";wt(H.value)&&y&&(I=z?G(y)>G(H.value):Q?y>H.value:X>new Date(H.value)),wt(Y.value)&&y&&(V=z?G(y)<G(Y.value):Q?y<Y.value:X<new Date(Y.value))}if((I||V)&&(D(!!I,H.message,Y.message,Dt.max,Dt.min),!n))return _($[p].message),$}if((a||u)&&!L&&(wt(y)||i&&Array.isArray(y))){const I=En(a),V=En(u),H=!qe(I.value)&&y.length>+I.value,Y=!qe(V.value)&&y.length<+V.value;if((H||Y)&&(D(H,I.message,V.message),!n))return _($[p].message),$}if(m&&!L&&wt(y)){const{value:I,message:V}=En(m);if(ei(I)&&!y.match(I)&&($[p]={type:Dt.pattern,message:V,ref:o,...j(Dt.pattern,V)},!n))return _(V),$}if(d){if(Et(d)){const I=await d(y,t),V=ou(I,x);if(V&&($[p]={...V,...j(Dt.validate,V.message)},!n))return _(V.message),$}else if(ve(d)){let I={};for(const V in d){if(!ze(I)&&!n)break;const H=ou(await d[V](y,t),x,V);H&&(I={...H,...j(V,H.message)},_(H.message),n&&($[p]=I))}if(!ze(I)&&($[p]={ref:x,...I},!n))return $}}return _(!0),$},jo=(e,t)=>[...e,...tt(t)],No=e=>Array.isArray(e)?e.map(()=>{}):void 0;function Io(e,t,n){return[...e.slice(0,t),...tt(n),...e.slice(t)]}var Mo=(e,t,n)=>Array.isArray(e)?(ce(e[n])&&(e[n]=void 0),e.splice(n,0,e.splice(t,1)[0]),e):[],Vo=(e,t)=>[...tt(t),...tt(e)];function py(e,t){let n=0;const r=[...e];for(const i of t)r.splice(i-n,1),n++;return tr(r).length?r:[]}var Ro=(e,t)=>ce(t)?[]:py(e,tt(t).sort((n,r)=>n-r)),Bo=(e,t,n)=>{[e[t],e[n]]=[e[n],e[t]]};function hy(e,t){const n=t.slice(0,-1).length;let r=0;for(;r<n;)e=ce(e)?r++:e[t[r++]];return e}function my(e){for(const t in e)if(e.hasOwnProperty(t)&&!ce(e[t]))return!1;return!0}function Te(e,t){const n=Array.isArray(t)?t:$o(t)?[t]:Yl(t),r=n.length===1?e:hy(e,n),i=n.length-1,o=n[i];return r&&delete r[o],i!==0&&(ve(r)&&ze(r)||Array.isArray(r)&&my(r))&&Te(e,n.slice(0,-1)),e}var su=(e,t,n)=>(e[t]=n,e);function gy(e){const t=ly(),{control:n=t.control,name:r,keyName:i="id",shouldUnregister:o,rules:s}=e,[l,a]=h.useState(n._getFieldArray(r)),u=h.useRef(n._getFieldArray(r).map(Ut)),c=h.useRef(l),f=h.useRef(r),m=h.useRef(!1);f.current=r,c.current=l,n._names.array.add(r),s&&n.register(r,s),Jl({next:({values:S,name:C})=>{if(C===f.current||!C){const A=B(S,f.current);Array.isArray(A)&&(a(A),u.current=A.map(Ut))}},subject:n._subjects.array});const d=h.useCallback(S=>{m.current=!0,n._updateFieldArray(r,S)},[n,r]),p=(S,C)=>{const A=tt(je(S)),L=jo(n._getFieldArray(r),A);n._names.focus=Oo(r,L.length-1,C),u.current=jo(u.current,A.map(Ut)),d(L),a(L),n._updateFieldArray(r,L,jo,{argA:No(S)})},v=(S,C)=>{const A=tt(je(S)),L=Vo(n._getFieldArray(r),A);n._names.focus=Oo(r,0,C),u.current=Vo(u.current,A.map(Ut)),d(L),a(L),n._updateFieldArray(r,L,Vo,{argA:No(S)})},b=S=>{const C=Ro(n._getFieldArray(r),S);u.current=Ro(u.current,S),d(C),a(C),!Array.isArray(B(n._fields,r))&&ie(n._fields,r,void 0),n._updateFieldArray(r,C,Ro,{argA:S})},g=(S,C,A)=>{const L=tt(je(C)),j=Io(n._getFieldArray(r),S,L);n._names.focus=Oo(r,S,A),u.current=Io(u.current,S,L.map(Ut)),d(j),a(j),n._updateFieldArray(r,j,Io,{argA:S,argB:No(C)})},y=(S,C)=>{const A=n._getFieldArray(r);Bo(A,S,C),Bo(u.current,S,C),d(A),a(A),n._updateFieldArray(r,A,Bo,{argA:S,argB:C},!1)},x=(S,C)=>{const A=n._getFieldArray(r);Mo(A,S,C),Mo(u.current,S,C),d(A),a(A),n._updateFieldArray(r,A,Mo,{argA:S,argB:C},!1)},_=(S,C)=>{const A=je(C),L=su(n._getFieldArray(r),S,A);u.current=[...L].map((j,D)=>!j||D===S?Ut():u.current[D]),d(L),a([...L]),n._updateFieldArray(r,L,su,{argA:S,argB:A},!0,!1)},$=S=>{const C=tt(je(S));u.current=C.map(Ut),d([...C]),a([...C]),n._updateFieldArray(r,[...C],A=>A,{},!0,!1)};return h.useEffect(()=>{if(n._state.action=!1,Ao(r,n._names)&&n._subjects.state.next({...n._formState}),m.current&&(!nr(n._options.mode).isOnSubmit||n._formState.isSubmitted))if(n._options.resolver)n._executeSchema([r]).then(S=>{const C=B(S.errors,r),A=B(n._formState.errors,r);(A?!C&&A.type||C&&(A.type!==C.type||A.message!==C.message):C&&C.type)&&(C?ie(n._formState.errors,r,C):Te(n._formState.errors,r),n._subjects.state.next({errors:n._formState.errors}))});else{const S=B(n._fields,r);S&&S._f&&!(nr(n._options.reValidateMode).isOnSubmit&&nr(n._options.mode).isOnSubmit)&&Po(S,n._formValues,n._options.criteriaMode===st.all,n._options.shouldUseNativeValidation,!0).then(C=>!ze(C)&&n._subjects.state.next({errors:Zl(n._formState.errors,C,r)}))}n._subjects.values.next({name:r,values:{...n._formValues}}),n._names.focus&&wn(n._fields,(S,C)=>{if(n._names.focus&&C.startsWith(n._names.focus)&&S.focus)return S.focus(),1}),n._names.focus="",n._updateValid(),m.current=!1},[l,r,n]),h.useEffect(()=>(!B(n._formValues,r)&&n._updateFieldArray(r),()=>{(n._options.shouldUnregister||o)&&n.unregister(r)}),[r,n,i,o]),{swap:h.useCallback(y,[d,r,n]),move:h.useCallback(x,[d,r,n]),prepend:h.useCallback(v,[d,r,n]),append:h.useCallback(p,[d,r,n]),remove:h.useCallback(b,[d,r,n]),insert:h.useCallback(g,[d,r,n]),update:h.useCallback(_,[d,r,n]),replace:h.useCallback($,[d,r,n]),fields:h.useMemo(()=>l.map((S,C)=>({...S,[i]:u.current[C]||Ut()})),[l,i])}}var Uo=()=>{let e=[];return{get observers(){return e},next:i=>{for(const o of e)o.next&&o.next(i)},subscribe:i=>(e.push(i),{unsubscribe:()=>{e=e.filter(o=>o!==i)}}),unsubscribe:()=>{e=[]}}},Ho=e=>qe(e)||!Kl(e);function Ht(e,t){if(Ho(e)||Ho(t))return e===t;if(sn(e)&&sn(t))return e.getTime()===t.getTime();const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const i of n){const o=e[i];if(!r.includes(i))return!1;if(i!=="ref"){const s=t[i];if(sn(o)&&sn(s)||ve(o)&&ve(s)||Array.isArray(o)&&Array.isArray(s)?!Ht(o,s):o!==s)return!1}}return!0}var au=e=>e.type==="select-multiple",yy=e=>Lo(e)||er(e),qo=e=>Qr(e)&&e.isConnected,lu=e=>{for(const t in e)if(Et(e[t]))return!0;return!1};function ti(e,t={}){const n=Array.isArray(e);if(ve(e)||n)for(const r in e)Array.isArray(e[r])||ve(e[r])&&!lu(e[r])?(t[r]=Array.isArray(e[r])?[]:{},ti(e[r],t[r])):qe(e[r])||(t[r]=!0);return t}function uu(e,t,n){const r=Array.isArray(e);if(ve(e)||r)for(const i in e)Array.isArray(e[i])||ve(e[i])&&!lu(e[i])?ce(t)||Ho(n[i])?n[i]=Array.isArray(e[i])?ti(e[i],[]):{...ti(e[i])}:uu(e[i],qe(t)?{}:t[i],n[i]):n[i]=!Ht(e[i],t[i]);return n}var rr=(e,t)=>uu(e,t,ti(t)),cu=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>ce(e)?e:t?e===""?NaN:e&&+e:n&&wt(e)?new Date(e):r?r(e):e;function zo(e){const t=e.ref;if(!(e.refs?e.refs.every(n=>n.disabled):t.disabled))return Do(t)?t.files:Lo(t)?iu(e.refs).value:au(t)?[...t.selectedOptions].map(({value:n})=>n):er(t)?nu(e.refs).value:cu(ce(t.value)?e.ref.value:t.value,e)}var vy=(e,t,n,r)=>{const i={};for(const o of e){const s=B(t,o);s&&ie(i,o,s._f)}return{criteriaMode:n,names:[...e],fields:i,shouldUseNativeValidation:r}},ir=e=>ce(e)?e:ei(e)?e.source:ve(e)?ei(e.value)?e.value.source:e.value:e;const fu="AsyncFunction";var by=e=>!!e&&!!e.validate&&!!(Et(e.validate)&&e.validate.constructor.name===fu||ve(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===fu)),xy=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function du(e,t,n){const r=B(e,n);if(r||$o(n))return{error:r,name:n};const i=n.split(".");for(;i.length;){const o=i.join("."),s=B(t,o),l=B(e,o);if(s&&!Array.isArray(s)&&n!==o)return{name:n};if(l&&l.type)return{name:o,error:l};i.pop()}return{name:n}}var wy=(e,t,n,r,i)=>i.isOnAll?!1:!n&&i.isOnTouch?!(t||e):(n?r.isOnBlur:i.isOnBlur)?!e:(n?r.isOnChange:i.isOnChange)?e:!0,Ey=(e,t)=>!tr(B(e,t)).length&&Te(e,t);const Ty={mode:st.onSubmit,reValidateMode:st.onChange,shouldFocusError:!0};function Sy(e={}){let t={...Ty,...e},n={submitCount:0,isDirty:!1,isLoading:Et(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},r={},i=ve(t.defaultValues)||ve(t.values)?je(t.defaultValues||t.values)||{}:{},o=t.shouldUnregister?{}:je(i),s={action:!1,mount:!1,watch:!1},l={mount:new Set,unMount:new Set,array:new Set,watch:new Set},a,u=0;const c={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},f={values:Uo(),array:Uo(),state:Uo()},m=nr(t.mode),d=nr(t.reValidateMode),p=t.criteriaMode===st.all,v=T=>F=>{clearTimeout(u),u=setTimeout(T,F)},b=async T=>{if(!t.disabled&&(c.isValid||T)){const F=t.resolver?ze((await A()).errors):await j(r,!0);F!==n.isValid&&f.state.next({isValid:F})}},g=(T,F)=>{!t.disabled&&(c.isValidating||c.validatingFields)&&((T||Array.from(l.mount)).forEach(O=>{O&&(F?ie(n.validatingFields,O,F):Te(n.validatingFields,O))}),f.state.next({validatingFields:n.validatingFields,isValidating:!ze(n.validatingFields)}))},y=(T,F=[],O,R,M=!0,N=!0)=>{if(R&&O&&!t.disabled){if(s.action=!0,N&&Array.isArray(B(r,T))){const W=O(B(r,T),R.argA,R.argB);M&&ie(r,T,W)}if(N&&Array.isArray(B(n.errors,T))){const W=O(B(n.errors,T),R.argA,R.argB);M&&ie(n.errors,T,W),Ey(n.errors,T)}if(c.touchedFields&&N&&Array.isArray(B(n.touchedFields,T))){const W=O(B(n.touchedFields,T),R.argA,R.argB);M&&ie(n.touchedFields,T,W)}c.dirtyFields&&(n.dirtyFields=rr(i,o)),f.state.next({name:T,isDirty:I(T,F),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else ie(o,T,F)},x=(T,F)=>{ie(n.errors,T,F),f.state.next({errors:n.errors})},_=T=>{n.errors=T,f.state.next({errors:n.errors,isValid:!1})},$=(T,F,O,R)=>{const M=B(r,T);if(M){const N=B(o,T,ce(O)?B(i,T):O);ce(N)||R&&R.defaultChecked||F?ie(o,T,F?N:zo(M._f)):Y(T,N),s.mount&&b()}},S=(T,F,O,R,M)=>{let N=!1,W=!1;const K={name:T};if(!t.disabled){const he=!!(B(r,T)&&B(r,T)._f&&B(r,T)._f.disabled);if(!O||R){c.isDirty&&(W=n.isDirty,n.isDirty=K.isDirty=I(),N=W!==K.isDirty);const fe=he||Ht(B(i,T),F);W=!!(!he&&B(n.dirtyFields,T)),fe||he?Te(n.dirtyFields,T):ie(n.dirtyFields,T,!0),K.dirtyFields=n.dirtyFields,N=N||c.dirtyFields&&W!==!fe}if(O){const fe=B(n.touchedFields,T);fe||(ie(n.touchedFields,T,O),K.touchedFields=n.touchedFields,N=N||c.touchedFields&&fe!==O)}N&&M&&f.state.next(K)}return N?K:{}},C=(T,F,O,R)=>{const M=B(n.errors,T),N=c.isValid&&xt(F)&&n.isValid!==F;if(t.delayError&&O?(a=v(()=>x(T,O)),a(t.delayError)):(clearTimeout(u),a=null,O?ie(n.errors,T,O):Te(n.errors,T)),(O?!Ht(M,O):M)||!ze(R)||N){const W={...R,...N&&xt(F)?{isValid:F}:{},errors:n.errors,name:T};n={...n,...W},f.state.next(W)}},A=async T=>{g(T,!0);const F=await t.resolver(o,t.context,vy(T||l.mount,r,t.criteriaMode,t.shouldUseNativeValidation));return g(T),F},L=async T=>{const{errors:F}=await A(T);if(T)for(const O of T){const R=B(F,O);R?ie(n.errors,O,R):Te(n.errors,O)}else n.errors=F;return F},j=async(T,F,O={valid:!0})=>{for(const R in T){const M=T[R];if(M){const{_f:N,...W}=M;if(N){const K=l.array.has(N.name),he=M._f&&by(M._f);he&&c.validatingFields&&g([R],!0);const fe=await Po(M,o,p,t.shouldUseNativeValidation&&!F,K);if(he&&c.validatingFields&&g([R]),fe[N.name]&&(O.valid=!1,F))break;!F&&(B(fe,N.name)?K?Zl(n.errors,fe,N.name):ie(n.errors,N.name,fe[N.name]):Te(n.errors,N.name))}!ze(W)&&await j(W,F,O)}}return O.valid},D=()=>{for(const T of l.unMount){const F=B(r,T);F&&(F._f.refs?F._f.refs.every(O=>!qo(O)):!qo(F._f.ref))&&oe(T)}l.unMount=new Set},I=(T,F)=>!t.disabled&&(T&&F&&ie(o,T,F),!Ht(Fe(),i)),V=(T,F,O)=>dy(T,l,{...s.mount?o:ce(F)?i:wt(T)?{[T]:F}:F},O,F),H=T=>tr(B(s.mount?o:i,T,t.shouldUnregister?B(i,T,[]):[])),Y=(T,F,O={})=>{const R=B(r,T);let M=F;if(R){const N=R._f;N&&(!N.disabled&&ie(o,T,cu(F,N)),M=Qr(N.ref)&&qe(F)?"":F,au(N.ref)?[...N.ref.options].forEach(W=>W.selected=M.includes(W.value)):N.refs?er(N.ref)?N.refs.length>1?N.refs.forEach(W=>(!W.defaultChecked||!W.disabled)&&(W.checked=Array.isArray(M)?!!M.find(K=>K===W.value):M===W.value)):N.refs[0]&&(N.refs[0].checked=!!M):N.refs.forEach(W=>W.checked=W.value===M):Do(N.ref)?N.ref.value="":(N.ref.value=M,N.ref.type||f.values.next({name:T,values:{...o}})))}(O.shouldDirty||O.shouldTouch)&&S(T,M,O.shouldTouch,O.shouldDirty,!0),O.shouldValidate&&ee(T)},X=(T,F,O)=>{for(const R in F){const M=F[R],N=`${T}.${R}`,W=B(r,N);(l.array.has(T)||ve(M)||W&&!W._f)&&!sn(M)?X(N,M,O):Y(N,M,O)}},G=(T,F,O={})=>{const R=B(r,T),M=l.array.has(T),N=je(F);ie(o,T,N),M?(f.array.next({name:T,values:{...o}}),(c.isDirty||c.dirtyFields)&&O.shouldDirty&&f.state.next({name:T,dirtyFields:rr(i,o),isDirty:I(T,N)})):R&&!R._f&&!qe(N)?X(T,N,O):Y(T,N,O),Ao(T,l)&&f.state.next({...n}),f.values.next({name:s.mount?T:void 0,values:{...o}})},z=async T=>{s.mount=!0;const F=T.target;let O=F.name,R=!0;const M=B(r,O),N=()=>F.type?zo(M._f):iy(T),W=K=>{R=Number.isNaN(K)||sn(K)&&isNaN(K.getTime())||Ht(K,B(o,O,K))};if(M){let K,he;const fe=N(),pt=T.type===Gl.BLUR||T.type===Gl.FOCUS_OUT,_n=!xy(M._f)&&!t.resolver&&!B(n.errors,O)&&!M._f.deps||wy(pt,B(n.touchedFields,O),n.isSubmitted,d,m),zt=Ao(O,l,pt);ie(o,O,fe),pt?(M._f.onBlur&&M._f.onBlur(T),a&&a(0)):M._f.onChange&&M._f.onChange(T);const It=S(O,fe,pt,!1),ur=!ze(It)||zt;if(!pt&&f.values.next({name:O,type:T.type,values:{...o}}),_n)return c.isValid&&(t.mode==="onBlur"?pt&&b():b()),ur&&f.state.next({name:O,...zt?{}:It});if(!pt&&zt&&f.state.next({...n}),t.resolver){const{errors:fn}=await A([O]);if(W(fe),R){const cr=du(n.errors,r,O),me=du(fn,r,cr.name||O);K=me.error,O=me.name,he=ze(fn)}}else g([O],!0),K=(await Po(M,o,p,t.shouldUseNativeValidation))[O],g([O]),W(fe),R&&(K?he=!1:c.isValid&&(he=await j(r,!0)));R&&(M._f.deps&&ee(M._f.deps),C(O,he,K,It))}},Q=(T,F)=>{if(B(n.errors,F)&&T.focus)return T.focus(),1},ee=async(T,F={})=>{let O,R;const M=tt(T);if(t.resolver){const N=await L(ce(T)?T:M);O=ze(N),R=T?!M.some(W=>B(N,W)):O}else T?(R=(await Promise.all(M.map(async N=>{const W=B(r,N);return await j(W&&W._f?{[N]:W}:W)}))).every(Boolean),!(!R&&!n.isValid)&&b()):R=O=await j(r);return f.state.next({...!wt(T)||c.isValid&&O!==n.isValid?{}:{name:T},...t.resolver||!T?{isValid:O}:{},errors:n.errors}),F.shouldFocus&&!R&&wn(r,Q,T?M:l.mount),R},Fe=T=>{const F={...s.mount?o:i};return ce(T)?F:wt(T)?B(F,T):T.map(O=>B(F,O))},Ae=(T,F)=>({invalid:!!B((F||n).errors,T),isDirty:!!B((F||n).dirtyFields,T),error:B((F||n).errors,T),isValidating:!!B(n.validatingFields,T),isTouched:!!B((F||n).touchedFields,T)}),q=T=>{T&&tt(T).forEach(F=>Te(n.errors,F)),f.state.next({errors:T?n.errors:{}})},ge=(T,F,O)=>{const R=(B(r,T,{_f:{}})._f||{}).ref,M=B(n.errors,T)||{},{ref:N,message:W,type:K,...he}=M;ie(n.errors,T,{...he,...F,ref:R}),f.state.next({name:T,errors:n.errors,isValid:!1}),O&&O.shouldFocus&&R&&R.focus&&R.focus()},be=(T,F)=>Et(T)?f.values.subscribe({next:O=>T(V(void 0,F),O)}):V(T,F,!0),oe=(T,F={})=>{for(const O of T?tt(T):l.mount)l.mount.delete(O),l.array.delete(O),F.keepValue||(Te(r,O),Te(o,O)),!F.keepError&&Te(n.errors,O),!F.keepDirty&&Te(n.dirtyFields,O),!F.keepTouched&&Te(n.touchedFields,O),!F.keepIsValidating&&Te(n.validatingFields,O),!t.shouldUnregister&&!F.keepDefaultValue&&Te(i,O);f.values.next({values:{...o}}),f.state.next({...n,...F.keepDirty?{isDirty:I()}:{}}),!F.keepIsValid&&b()},ke=({disabled:T,name:F,field:O,fields:R,value:M})=>{if(xt(T)&&s.mount||T){const N=T?void 0:ce(M)?zo(O?O._f:B(R,F)._f):M;(T||!T&&!ce(N))&&ie(o,F,N),S(F,N,!1,!1,!0)}},xe=(T,F={})=>{let O=B(r,T);const R=xt(F.disabled)||xt(t.disabled);return ie(r,T,{...O||{},_f:{...O&&O._f?O._f:{ref:{name:T}},name:T,mount:!0,...F}}),l.mount.add(T),O?ke({field:O,disabled:xt(F.disabled)?F.disabled:t.disabled,name:T,value:F.value}):$(T,!0,F.value),{...R?{disabled:F.disabled||t.disabled}:{},...t.progressive?{required:!!F.required,min:ir(F.min),max:ir(F.max),minLength:ir(F.minLength),maxLength:ir(F.maxLength),pattern:ir(F.pattern)}:{},name:T,onChange:z,onBlur:z,ref:M=>{if(M){xe(T,F),O=B(r,T);const N=ce(M.value)&&M.querySelectorAll&&M.querySelectorAll("input,select,textarea")[0]||M,W=yy(N),K=O._f.refs||[];if(W?K.find(he=>he===N):N===O._f.ref)return;ie(r,T,{_f:{...O._f,...W?{refs:[...K.filter(qo),N,...Array.isArray(B(i,T))?[{}]:[]],ref:{type:N.type,name:T}}:{ref:N}}}),$(T,!1,void 0,N)}else O=B(r,T,{}),O._f&&(O._f.mount=!1),(t.shouldUnregister||F.shouldUnregister)&&!(sy(l.array,T)&&s.action)&&l.unMount.add(T)}}},De=()=>t.shouldFocusError&&wn(r,Q,l.mount),dt=T=>{xt(T)&&(f.state.next({disabled:T}),wn(r,(F,O)=>{const R=B(r,O);R&&(F.disabled=R._f.disabled||T,Array.isArray(R._f.refs)&&R._f.refs.forEach(M=>{M.disabled=R._f.disabled||T}))},0,!1))},we=(T,F)=>async O=>{let R;if(O&&(O.preventDefault&&O.preventDefault(),O.persist&&O.persist()),t.disabled){F&&await F({...n.errors},O);return}let M=je(o);if(f.state.next({isSubmitting:!0}),t.resolver){const{errors:N,values:W}=await A();n.errors=N,M=W}else await j(r);if(Te(n.errors,"root"),ze(n.errors)){f.state.next({errors:{}});try{await T(M,O)}catch(N){R=N}}else F&&await F({...n.errors},O),De(),setTimeout(De);if(f.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:ze(n.errors)&&!R,submitCount:n.submitCount+1,errors:n.errors}),R)throw R},ne=(T,F={})=>{B(r,T)&&(ce(F.defaultValue)?G(T,je(B(i,T))):(G(T,F.defaultValue),ie(i,T,je(F.defaultValue))),F.keepTouched||Te(n.touchedFields,T),F.keepDirty||(Te(n.dirtyFields,T),n.isDirty=F.defaultValue?I(T,je(B(i,T))):I()),F.keepError||(Te(n.errors,T),c.isValid&&b()),f.state.next({...n}))},de=(T,F={})=>{const O=T?je(T):i,R=je(O),M=ze(T),N=M?i:R;if(F.keepDefaultValues||(i=O),!F.keepValues){if(F.keepDirtyValues){const W=new Set([...l.mount,...Object.keys(rr(i,o))]);for(const K of Array.from(W))B(n.dirtyFields,K)?ie(N,K,B(o,K)):G(K,B(N,K))}else{if(ko&&ce(T))for(const W of l.mount){const K=B(r,W);if(K&&K._f){const he=Array.isArray(K._f.refs)?K._f.refs[0]:K._f.ref;if(Qr(he)){const fe=he.closest("form");if(fe){fe.reset();break}}}}r={}}o=t.shouldUnregister?F.keepDefaultValues?je(i):{}:je(N),f.array.next({values:{...N}}),f.values.next({values:{...N}})}l={mount:F.keepDirtyValues?l.mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},s.mount=!c.isValid||!!F.keepIsValid||!!F.keepDirtyValues,s.watch=!!t.shouldUnregister,f.state.next({submitCount:F.keepSubmitCount?n.submitCount:0,isDirty:M?!1:F.keepDirty?n.isDirty:!!(F.keepDefaultValues&&!Ht(T,i)),isSubmitted:F.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:M?{}:F.keepDirtyValues?F.keepDefaultValues&&o?rr(i,o):n.dirtyFields:F.keepDefaultValues&&T?rr(i,T):F.keepDirty?n.dirtyFields:{},touchedFields:F.keepTouched?n.touchedFields:{},errors:F.keepErrors?n.errors:{},isSubmitSuccessful:F.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1})},$e=(T,F)=>de(Et(T)?T(o):T,F);return{control:{register:xe,unregister:oe,getFieldState:Ae,handleSubmit:we,setError:ge,_executeSchema:A,_getWatch:V,_getDirty:I,_updateValid:b,_removeUnmounted:D,_updateFieldArray:y,_updateDisabledField:ke,_getFieldArray:H,_reset:de,_resetDefaultValues:()=>Et(t.defaultValues)&&t.defaultValues().then(T=>{$e(T,t.resetOptions),f.state.next({isLoading:!1})}),_updateFormState:T=>{n={...n,...T}},_disableForm:dt,_subjects:f,_proxyFormState:c,_setErrors:_,get _fields(){return r},get _formValues(){return o},get _state(){return s},set _state(T){s=T},get _defaultValues(){return i},get _names(){return l},set _names(T){l=T},get _formState(){return n},set _formState(T){n=T},get _options(){return t},set _options(T){t={...t,...T}}},trigger:ee,register:xe,handleSubmit:we,watch:be,setValue:G,getValues:Fe,reset:$e,resetField:ne,clearErrors:q,unregister:oe,setError:ge,setFocus:(T,F={})=>{const O=B(r,T),R=O&&O._f;if(R){const M=R.refs?R.refs[0]:R.ref;M.focus&&(M.focus(),F.shouldSelect&&Et(M.select)&&M.select())}},getFieldState:Ae}}function Wo(e={}){const t=h.useRef(),n=h.useRef(),[r,i]=h.useState({isDirty:!1,isValidating:!1,isLoading:Et(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,defaultValues:Et(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={...Sy(e),formState:r});const o=t.current.control;return o._options=e,Jl({subject:o._subjects.state,next:s=>{fy(s,o._proxyFormState,o._updateFormState)&&i({...o._formState})}}),h.useEffect(()=>o._disableForm(e.disabled),[o,e.disabled]),h.useEffect(()=>{if(o._proxyFormState.isDirty){const s=o._getDirty();s!==r.isDirty&&o._subjects.state.next({isDirty:s})}},[o,r.isDirty]),h.useEffect(()=>{e.values&&!Ht(e.values,n.current)?(o._reset(e.values,o._options.resetOptions),n.current=e.values,i(s=>({...s}))):o._resetDefaultValues()},[e.values,o]),h.useEffect(()=>{e.errors&&o._setErrors(e.errors)},[e.errors,o]),h.useEffect(()=>{o._state.mount||(o._updateValid(),o._state.mount=!0),o._state.watch&&(o._state.watch=!1,o._subjects.state.next({...o._formState})),o._removeUnmounted()}),h.useEffect(()=>{e.shouldUnregister&&o._subjects.values.next({values:o._getWatch()})},[e.shouldUnregister,o]),h.useMemo(()=>({...t.current,formState:cy(r,o)}),[r,o])}const pu=(e,t,n)=>{if(e&&"reportValidity"in e){const r=B(n,t);e.setCustomValidity(r&&r.message||""),e.reportValidity()}},hu=(e,t)=>{for(const n in t.fields){const r=t.fields[n];r&&r.ref&&"reportValidity"in r.ref?pu(r.ref,n,e):r.refs&&r.refs.forEach(i=>pu(i,n,e))}},_y=(e,t)=>{t.shouldUseNativeValidation&&hu(e,t);const n={};for(const r in e){const i=B(t.fields,r),o=Object.assign(e[r]||{},{ref:i&&i.ref});if(Cy(t.names||Object.keys(e),r)){const s=Object.assign({},B(n,r));ie(s,"root",o),ie(n,r,s)}else ie(n,r,o)}return n},Cy=(e,t)=>e.some(n=>n.startsWith(t+"."));function Ko(e,t,n){return t===void 0&&(t={}),n===void 0&&(n={}),function(r,i,o){try{return Promise.resolve(function(s,l){try{var a=(t.context&&process.env.NODE_ENV==="development"&&console.warn("You should not used the yup options context. Please, use the 'useForm' context object instead"),Promise.resolve(e[n.mode==="sync"?"validateSync":"validate"](r,Object.assign({abortEarly:!1},t,{context:i}))).then(function(u){return o.shouldUseNativeValidation&&hu({},o),{values:n.raw?r:u,errors:{}}}))}catch(u){return l(u)}return a&&a.then?a.then(void 0,l):a}(0,function(s){if(!s.inner)throw s;return{values:{},errors:_y((l=s,a=!o.shouldUseNativeValidation&&o.criteriaMode==="all",(l.inner||[]).reduce(function(u,c){if(u[c.path]||(u[c.path]={message:c.message,type:c.type}),a){var f=u[c.path].types,m=f&&f[c.type];u[c.path]=Ql(c.path,a,u,c.type,m?[].concat(m,c.message):c.message)}return u},{})),o)};var l,a}))}catch(s){return Promise.reject(s)}}}var Yo,mu;function Fy(){if(mu)return Yo;mu=1;function e(g){this._maxSize=g,this.clear()}e.prototype.clear=function(){this._size=0,this._values=Object.create(null)},e.prototype.get=function(g){return this._values[g]},e.prototype.set=function(g,y){return this._size>=this._maxSize&&this.clear(),g in this._values||this._size++,this._values[g]=y};var t=/[^.^\]^[]+|(?=\[\]|\.\.)/g,n=/^\d+$/,r=/^\d/,i=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,o=/^\s*(['"]?)(.*?)(\1)\s*$/,s=512,l=new e(s),a=new e(s),u=new e(s);Yo={Cache:e,split:f,normalizePath:c,setter:function(g){var y=c(g);return a.get(g)||a.set(g,function(_,$){for(var S=0,C=y.length,A=_;S<C-1;){var L=y[S];if(L==="__proto__"||L==="constructor"||L==="prototype")return _;A=A[y[S++]]}A[y[S]]=$})},getter:function(g,y){var x=c(g);return u.get(g)||u.set(g,function($){for(var S=0,C=x.length;S<C;)if($!=null||!y)$=$[x[S++]];else return;return $})},join:function(g){return g.reduce(function(y,x){return y+(d(x)||n.test(x)?"["+x+"]":(y?".":"")+x)},"")},forEach:function(g,y,x){m(Array.isArray(g)?g:f(g),y,x)}};function c(g){return l.get(g)||l.set(g,f(g).map(function(y){return y.replace(o,"$2")}))}function f(g){return g.match(t)||[""]}function m(g,y,x){var _=g.length,$,S,C,A;for(S=0;S<_;S++)$=g[S],$&&(b($)&&($='"'+$+'"'),A=d($),C=!A&&/^\d+$/.test($),y.call(x,$,A,C,S,g))}function d(g){return typeof g=="string"&&g&&["'",'"'].indexOf(g.charAt(0))!==-1}function p(g){return g.match(r)&&!g.match(n)}function v(g){return i.test(g)}function b(g){return!d(g)&&(p(g)||v(g))}return Yo}var an=Fy(),Go,gu;function ky(){if(gu)return Go;gu=1;const e=/[A-Z\xc0-\xd6\xd8-\xde]?[a-z\xdf-\xf6\xf8-\xff]+(?:['’](?:d|ll|m|re|s|t|ve))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde]|$)|(?:[A-Z\xc0-\xd6\xd8-\xde]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:D|LL|M|RE|S|T|VE))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde](?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])|$)|[A-Z\xc0-\xd6\xd8-\xde]?(?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:d|ll|m|re|s|t|ve))?|[A-Z\xc0-\xd6\xd8-\xde]+(?:['’](?:D|LL|M|RE|S|T|VE))?|\d*(?:1ST|2ND|3RD|(?![123])\dTH)(?=\b|[a-z_])|\d*(?:1st|2nd|3rd|(?![123])\dth)(?=\b|[A-Z_])|\d+|(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?(?:\u200d(?:[^\ud800-\udfff]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?)*/g,t=c=>c.match(e)||[],n=c=>c[0].toUpperCase()+c.slice(1),r=(c,f)=>t(c).join(f).toLowerCase(),i=c=>t(c).reduce((f,m)=>`${f}${f?m[0].toUpperCase()+m.slice(1).toLowerCase():m.toLowerCase()}`,"");return Go={words:t,upperFirst:n,camelCase:i,pascalCase:c=>n(i(c)),snakeCase:c=>r(c,"_"),kebabCase:c=>r(c,"-"),sentenceCase:c=>n(r(c," ")),titleCase:c=>t(c).map(n).join(" ")},Go}var Xo=ky(),ni={exports:{}},yu;function $y(){if(yu)return ni.exports;yu=1,ni.exports=function(i){return e(t(i),i)},ni.exports.array=e;function e(i,o){var s=i.length,l=new Array(s),a={},u=s,c=n(o),f=r(i);for(o.forEach(function(d){if(!f.has(d[0])||!f.has(d[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")});u--;)a[u]||m(i[u],u,new Set);return l;function m(d,p,v){if(v.has(d)){var b;try{b=", node was:"+JSON.stringify(d)}catch{b=""}throw new Error("Cyclic dependency"+b)}if(!f.has(d))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(d));if(!a[p]){a[p]=!0;var g=c.get(d)||new Set;if(g=Array.from(g),p=g.length){v.add(d);do{var y=g[--p];m(y,f.get(y),v)}while(p);v.delete(d)}l[--s]=d}}}function t(i){for(var o=new Set,s=0,l=i.length;s<l;s++){var a=i[s];o.add(a[0]),o.add(a[1])}return Array.from(o)}function n(i){for(var o=new Map,s=0,l=i.length;s<l;s++){var a=i[s];o.has(a[0])||o.set(a[0],new Set),o.has(a[1])||o.set(a[1],new Set),o.get(a[0]).add(a[1])}return o}function r(i){for(var o=new Map,s=0,l=i.length;s<l;s++)o.set(i[s],s);return o}return ni.exports}var Oy=$y();const Ay=qu(Oy),Dy=Object.prototype.toString,Ly=Error.prototype.toString,Py=RegExp.prototype.toString,jy=typeof Symbol<"u"?Symbol.prototype.toString:()=>"",Ny=/^Symbol\((.*)\)(.*)$/;function Iy(e){return e!=+e?"NaN":e===0&&1/e<0?"-0":""+e}function vu(e,t=!1){if(e==null||e===!0||e===!1)return""+e;const n=typeof e;if(n==="number")return Iy(e);if(n==="string")return t?`"${e}"`:e;if(n==="function")return"[Function "+(e.name||"anonymous")+"]";if(n==="symbol")return jy.call(e).replace(Ny,"Symbol($1)");const r=Dy.call(e).slice(8,-1);return r==="Date"?isNaN(e.getTime())?""+e:e.toISOString(e):r==="Error"||e instanceof Error?"["+Ly.call(e)+"]":r==="RegExp"?Py.call(e):null}function Lt(e,t){let n=vu(e,t);return n!==null?n:JSON.stringify(e,function(r,i){let o=vu(this[r],t);return o!==null?o:i},2)}function bu(e){return e==null?[]:[].concat(e)}let xu,wu,Eu,My=/\$\{\s*(\w+)\s*\}/g;xu=Symbol.toStringTag;class Tu{constructor(t,n,r,i){this.name=void 0,this.message=void 0,this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=void 0,this.inner=void 0,this[xu]="Error",this.name="ValidationError",this.value=n,this.path=r,this.type=i,this.errors=[],this.inner=[],bu(t).forEach(o=>{if(Ge.isError(o)){this.errors.push(...o.errors);const s=o.inner.length?o.inner:[o];this.inner.push(...s)}else this.errors.push(o)}),this.message=this.errors.length>1?`${this.errors.length} errors occurred`:this.errors[0]}}wu=Symbol.hasInstance,Eu=Symbol.toStringTag;class Ge extends Error{static formatError(t,n){const r=n.label||n.path||"this";return n=Object.assign({},n,{path:r,originalPath:n.path}),typeof t=="string"?t.replace(My,(i,o)=>Lt(n[o])):typeof t=="function"?t(n):t}static isError(t){return t&&t.name==="ValidationError"}constructor(t,n,r,i,o){const s=new Tu(t,n,r,i);if(o)return s;super(),this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=[],this.inner=[],this[Eu]="Error",this.name=s.name,this.message=s.message,this.type=s.type,this.value=s.value,this.path=s.path,this.errors=s.errors,this.inner=s.inner,Error.captureStackTrace&&Error.captureStackTrace(this,Ge)}static[wu](t){return Tu[Symbol.hasInstance](t)||super[Symbol.hasInstance](t)}}let Tt={default:"${path} is invalid",required:"${path} is a required field",defined:"${path} must be defined",notNull:"${path} cannot be null",oneOf:"${path} must be one of the following values: ${values}",notOneOf:"${path} must not be one of the following values: ${values}",notType:({path:e,type:t,value:n,originalValue:r})=>{const i=r!=null&&r!==n?` (cast from the value \`${Lt(r,!0)}\`).`:".";return t!=="mixed"?`${e} must be a \`${t}\` type, but the final value was: \`${Lt(n,!0)}\``+i:`${e} must match the configured type. The validated value was: \`${Lt(n,!0)}\``+i}},Xe={length:"${path} must be exactly ${length} characters",min:"${path} must be at least ${min} characters",max:"${path} must be at most ${max} characters",matches:'${path} must match the following: "${regex}"',email:"${path} must be a valid email",url:"${path} must be a valid URL",uuid:"${path} must be a valid UUID",datetime:"${path} must be a valid ISO date-time",datetime_precision:"${path} must be a valid ISO date-time with a sub-second precision of exactly ${precision} digits",datetime_offset:'${path} must be a valid ISO date-time with UTC "Z" timezone',trim:"${path} must be a trimmed string",lowercase:"${path} must be a lowercase string",uppercase:"${path} must be a upper case string"},qt={min:"${path} must be greater than or equal to ${min}",max:"${path} must be less than or equal to ${max}",lessThan:"${path} must be less than ${less}",moreThan:"${path} must be greater than ${more}",positive:"${path} must be a positive number",negative:"${path} must be a negative number",integer:"${path} must be an integer"},Jo={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},Qo={isValue:"${path} field must be ${value}"},ri={noUnknown:"${path} field has unspecified keys: ${unknown}",exact:"${path} object contains unknown properties: ${properties}"},ii={min:"${path} field must have at least ${min} items",max:"${path} field must have less than or equal to ${max} items",length:"${path} must have ${length} items"};Object.assign(Object.create(null),{mixed:Tt,string:Xe,number:qt,date:Jo,object:ri,array:ii,boolean:Qo,tuple:{notType:e=>{const{path:t,value:n,spec:r}=e,i=r.types.length;if(Array.isArray(n)){if(n.length<i)return`${t} tuple value has too few items, expected a length of ${i} but got ${n.length} for value: \`${Lt(n,!0)}\``;if(n.length>i)return`${t} tuple value has too many items, expected a length of ${i} but got ${n.length} for value: \`${Lt(n,!0)}\``}return Ge.formatError(Tt.notType,e)}}});const oi=e=>e&&e.__isYupSchema__;class si{static fromOptions(t,n){if(!n.then&&!n.otherwise)throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");let{is:r,then:i,otherwise:o}=n,s=typeof r=="function"?r:(...l)=>l.every(a=>a===r);return new si(t,(l,a)=>{var u;let c=s(...l)?i:o;return(u=c==null?void 0:c(a))!=null?u:a})}constructor(t,n){this.fn=void 0,this.refs=t,this.refs=t,this.fn=n}resolve(t,n){let r=this.refs.map(o=>o.getValue(n==null?void 0:n.value,n==null?void 0:n.parent,n==null?void 0:n.context)),i=this.fn(r,t,n);if(i===void 0||i===t)return t;if(!oi(i))throw new TypeError("conditions must return a schema object");return i.resolve(n)}}const ai={context:"$",value:"."};class ln{constructor(t,n={}){if(this.key=void 0,this.isContext=void 0,this.isValue=void 0,this.isSibling=void 0,this.path=void 0,this.getter=void 0,this.map=void 0,typeof t!="string")throw new TypeError("ref must be a string, got: "+t);if(this.key=t.trim(),t==="")throw new TypeError("ref must be a non-empty string");this.isContext=this.key[0]===ai.context,this.isValue=this.key[0]===ai.value,this.isSibling=!this.isContext&&!this.isValue;let r=this.isContext?ai.context:this.isValue?ai.value:"";this.path=this.key.slice(r.length),this.getter=this.path&&an.getter(this.path,!0),this.map=n.map}getValue(t,n,r){let i=this.isContext?r:this.isValue?t:n;return this.getter&&(i=this.getter(i||{})),this.map&&(i=this.map(i)),i}cast(t,n){return this.getValue(t,n==null?void 0:n.parent,n==null?void 0:n.context)}resolve(){return this}describe(){return{type:"ref",key:this.key}}toString(){return`Ref(${this.key})`}static isRef(t){return t&&t.__isYupRef}}ln.prototype.__isYupRef=!0;const ft=e=>e==null;function Tn(e){function t({value:n,path:r="",options:i,originalValue:o,schema:s},l,a){const{name:u,test:c,params:f,message:m,skipAbsent:d}=e;let{parent:p,context:v,abortEarly:b=s.spec.abortEarly,disableStackTrace:g=s.spec.disableStackTrace}=i;function y(D){return ln.isRef(D)?D.getValue(n,p,v):D}function x(D={}){const I=Object.assign({value:n,originalValue:o,label:s.spec.label,path:D.path||r,spec:s.spec,disableStackTrace:D.disableStackTrace||g},f,D.params);for(const H of Object.keys(I))I[H]=y(I[H]);const V=new Ge(Ge.formatError(D.message||m,I),n,I.path,D.type||u,I.disableStackTrace);return V.params=I,V}const _=b?l:a;let $={path:r,parent:p,type:u,from:i.from,createError:x,resolve:y,options:i,originalValue:o,schema:s};const S=D=>{Ge.isError(D)?_(D):D?a(null):_(x())},C=D=>{Ge.isError(D)?_(D):l(D)};if(d&&ft(n))return S(!0);let L;try{var j;if(L=c.call($,n,$),typeof((j=L)==null?void 0:j.then)=="function"){if(i.sync)throw new Error(`Validation test of type: "${$.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`);return Promise.resolve(L).then(S,C)}}catch(D){C(D);return}S(L)}return t.OPTIONS=e,t}function Vy(e,t,n,r=n){let i,o,s;return t?(an.forEach(t,(l,a,u)=>{let c=a?l.slice(1,l.length-1):l;e=e.resolve({context:r,parent:i,value:n});let f=e.type==="tuple",m=u?parseInt(c,10):0;if(e.innerType||f){if(f&&!u)throw new Error(`Yup.reach cannot implicitly index into a tuple type. the path part "${s}" must contain an index to the tuple element, e.g. "${s}[0]"`);if(n&&m>=n.length)throw new Error(`Yup.reach cannot resolve an array item at index: ${l}, in the path: ${t}. because there is no value at that index. `);i=n,n=n&&n[m],e=f?e.spec.types[m]:e.innerType}if(!u){if(!e.fields||!e.fields[c])throw new Error(`The schema does not contain the path: ${t}. (failed at: ${s} which is a type: "${e.type}")`);i=n,n=n&&n[c],e=e.fields[c]}o=c,s=a?"["+l+"]":"."+l}),{schema:e,parent:i,parentPath:o}):{parent:i,parentPath:t,schema:e}}class li extends Set{describe(){const t=[];for(const n of this.values())t.push(ln.isRef(n)?n.describe():n);return t}resolveAll(t){let n=[];for(const r of this.values())n.push(t(r));return n}clone(){return new li(this.values())}merge(t,n){const r=this.clone();return t.forEach(i=>r.add(i)),n.forEach(i=>r.delete(i)),r}}function Sn(e,t=new Map){if(oi(e)||!e||typeof e!="object")return e;if(t.has(e))return t.get(e);let n;if(e instanceof Date)n=new Date(e.getTime()),t.set(e,n);else if(e instanceof RegExp)n=new RegExp(e),t.set(e,n);else if(Array.isArray(e)){n=new Array(e.length),t.set(e,n);for(let r=0;r<e.length;r++)n[r]=Sn(e[r],t)}else if(e instanceof Map){n=new Map,t.set(e,n);for(const[r,i]of e.entries())n.set(r,Sn(i,t))}else if(e instanceof Set){n=new Set,t.set(e,n);for(const r of e)n.add(Sn(r,t))}else if(e instanceof Object){n={},t.set(e,n);for(const[r,i]of Object.entries(e))n[r]=Sn(i,t)}else throw Error(`Unable to clone ${e}`);return n}class nt{constructor(t){this.type=void 0,this.deps=[],this.tests=void 0,this.transforms=void 0,this.conditions=[],this._mutate=void 0,this.internalTests={},this._whitelist=new li,this._blacklist=new li,this.exclusiveTests=Object.create(null),this._typeCheck=void 0,this.spec=void 0,this.tests=[],this.transforms=[],this.withMutation(()=>{this.typeError(Tt.notType)}),this.type=t.type,this._typeCheck=t.check,this.spec=Object.assign({strip:!1,strict:!1,abortEarly:!0,recursive:!0,disableStackTrace:!1,nullable:!1,optional:!0,coerce:!0},t==null?void 0:t.spec),this.withMutation(n=>{n.nonNullable()})}get _type(){return this.type}clone(t){if(this._mutate)return t&&Object.assign(this.spec,t),this;const n=Object.create(Object.getPrototypeOf(this));return n.type=this.type,n._typeCheck=this._typeCheck,n._whitelist=this._whitelist.clone(),n._blacklist=this._blacklist.clone(),n.internalTests=Object.assign({},this.internalTests),n.exclusiveTests=Object.assign({},this.exclusiveTests),n.deps=[...this.deps],n.conditions=[...this.conditions],n.tests=[...this.tests],n.transforms=[...this.transforms],n.spec=Sn(Object.assign({},this.spec,t)),n}label(t){let n=this.clone();return n.spec.label=t,n}meta(...t){if(t.length===0)return this.spec.meta;let n=this.clone();return n.spec.meta=Object.assign(n.spec.meta||{},t[0]),n}withMutation(t){let n=this._mutate;this._mutate=!0;let r=t(this);return this._mutate=n,r}concat(t){if(!t||t===this)return this;if(t.type!==this.type&&this.type!=="mixed")throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${t.type}`);let n=this,r=t.clone();const i=Object.assign({},n.spec,r.spec);return r.spec=i,r.internalTests=Object.assign({},n.internalTests,r.internalTests),r._whitelist=n._whitelist.merge(t._whitelist,t._blacklist),r._blacklist=n._blacklist.merge(t._blacklist,t._whitelist),r.tests=n.tests,r.exclusiveTests=n.exclusiveTests,r.withMutation(o=>{t.tests.forEach(s=>{o.test(s.OPTIONS)})}),r.transforms=[...n.transforms,...r.transforms],r}isType(t){return t==null?!!(this.spec.nullable&&t===null||this.spec.optional&&t===void 0):this._typeCheck(t)}resolve(t){let n=this;if(n.conditions.length){let r=n.conditions;n=n.clone(),n.conditions=[],n=r.reduce((i,o)=>o.resolve(i,t),n),n=n.resolve(t)}return n}resolveOptions(t){var n,r,i,o;return Object.assign({},t,{from:t.from||[],strict:(n=t.strict)!=null?n:this.spec.strict,abortEarly:(r=t.abortEarly)!=null?r:this.spec.abortEarly,recursive:(i=t.recursive)!=null?i:this.spec.recursive,disableStackTrace:(o=t.disableStackTrace)!=null?o:this.spec.disableStackTrace})}cast(t,n={}){let r=this.resolve(Object.assign({value:t},n)),i=n.assert==="ignore-optionality",o=r._cast(t,n);if(n.assert!==!1&&!r.isType(o)){if(i&&ft(o))return o;let s=Lt(t),l=Lt(o);throw new TypeError(`The value of ${n.path||"field"} could not be cast to a value that satisfies the schema type: "${r.type}".
|
|
50
|
+
`))}else{let m=c.props,p=m==null?void 0:m.className,d=typeof p=="function"?(...b)=>Os(p(...b),l.className):Os(p,l.className),g=d?{className:d}:{},v=gl(c.props,Kt(ks(l,["ref"])));for(let b in f)b in v&&delete f[b];return h.cloneElement(c,Object.assign({},v,f,u,{ref:i(fm(c),u.ref)},g))}return h.createElement(s,Object.assign({},ks(l,["ref"]),s!==h.Fragment&&u,s!==h.Fragment&&f),c)}function um(){let e=h.useRef([]),t=h.useCallback(n=>{for(let r of e.current)r!=null&&(typeof r=="function"?r(n):r.current=n)},[]);return(...n)=>{if(!n.every(r=>r==null))return e.current=n,t}}function cm(...e){return e.every(t=>t==null)?void 0:t=>{for(let n of e)n!=null&&(typeof n=="function"?n(t):n.current=t)}}function gl(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},n={};for(let r of e)for(let i in r)i.startsWith("on")&&typeof r[i]=="function"?(n[i]!=null||(n[i]=[]),n[i].push(r[i])):t[i]=r[i];if(t.disabled||t["aria-disabled"])for(let r in n)/^(on(?:Click|Pointer|Mouse|Key)(?:Down|Up|Press)?)$/.test(r)&&(n[r]=[i=>{var s;return(s=i==null?void 0:i.preventDefault)==null?void 0:s.call(i)}]);for(let r in n)Object.assign(t,{[r](i,...s){let o=n[r];for(let a of o){if((i instanceof Event||(i==null?void 0:i.nativeEvent)instanceof Event)&&i.defaultPrevented)return;a(i,...s)}}});return t}function yl(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},n={};for(let r of e)for(let i in r)i.startsWith("on")&&typeof r[i]=="function"?(n[i]!=null||(n[i]=[]),n[i].push(r[i])):t[i]=r[i];for(let r in n)Object.assign(t,{[r](...i){let s=n[r];for(let o of s)o==null||o(...i)}});return t}function Qe(e){var t;return Object.assign(h.forwardRef(e),{displayName:(t=e.displayName)!=null?t:e.name})}function Kt(e){let t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}function ks(e,t=[]){let n=Object.assign({},e);for(let r of t)r in n&&delete n[r];return n}function fm(e){return h.version.split(".")[0]>="19"?e.props.ref:e.ref}function dm(e,t,n){let[r,i]=h.useState(n),s=e!==void 0,o=h.useRef(s),a=h.useRef(!1),l=h.useRef(!1);return s&&!o.current&&!a.current?(a.current=!0,o.current=s,console.error("A component is changing from uncontrolled to controlled. This may be caused by the value changing from undefined to a defined value, which should not happen.")):!s&&o.current&&!l.current&&(l.current=!0,o.current=s,console.error("A component is changing from controlled to uncontrolled. This may be caused by the value changing from a defined value to undefined, which should not happen.")),[s?e:r,te(u=>(s||i(u),t==null?void 0:t(u)))]}function pm(e){let[t]=h.useState(e);return t}function bl(e={},t=null,n=[]){for(let[r,i]of Object.entries(e))xl(n,vl(t,r),i);return n}function vl(e,t){return e?e+"["+t+"]":t}function xl(e,t,n){if(Array.isArray(n))for(let[r,i]of n.entries())xl(e,vl(t,r.toString()),i);else n instanceof Date?e.push([t,n.toISOString()]):typeof n=="boolean"?e.push([t,n?"1":"0"]):typeof n=="string"?e.push([t,n]):typeof n=="number"?e.push([t,`${n}`]):n==null?e.push([t,""]):bl(n,t,e)}function hm(e){var t,n;let r=(t=e==null?void 0:e.form)!=null?t:e.closest("form");if(r){for(let i of r.elements)if(i!==e&&(i.tagName==="INPUT"&&i.type==="submit"||i.tagName==="BUTTON"&&i.type==="submit"||i.nodeName==="INPUT"&&i.type==="image")){i.click();return}(n=r.requestSubmit)==null||n.call(r)}}let mm="span";var Fs=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(Fs||{});function gm(e,t){var n;let{features:r=1,...i}=e,s={ref:t,"aria-hidden":(r&2)===2?!0:(n=i["aria-hidden"])!=null?n:void 0,hidden:(r&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",...(r&4)===4&&(r&2)!==2&&{display:"none"}}};return it()({ourProps:s,theirProps:i,slot:{},defaultTag:mm,name:"Hidden"})}let wl=Qe(gm),ym=h.createContext(null);function bm({children:e}){let t=h.useContext(ym);if(!t)return h.createElement(h.Fragment,null,e);let{target:n}=t;return n?St.createPortal(h.createElement(h.Fragment,null,e),n):null}function vm({data:e,form:t,disabled:n,onReset:r,overrides:i}){let[s,o]=h.useState(null),a=un();return h.useEffect(()=>{if(r&&s)return a.addEventListener(s,"reset",r)},[s,t,r]),h.createElement(bm,null,h.createElement(xm,{setForm:o,formId:t}),bl(e).map(([l,u])=>h.createElement(wl,{features:Fs.Hidden,...Kt({key:l,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:t,disabled:n,name:l,value:u,...i})})))}function xm({setForm:e,formId:t}){return h.useEffect(()=>{if(t){let n=document.getElementById(t);n&&e(n)}},[e,t]),t?null:h.createElement(wl,{features:Fs.Hidden,as:"input",type:"hidden",hidden:!0,readOnly:!0,ref:n=>{if(!n)return;let r=n.closest("form");r&&e(r)}})}let wm=h.createContext(void 0);function El(){return h.useContext(wm)}function Em(e){let t=e.parentElement,n=null;for(;t&&!(t instanceof HTMLFieldSetElement);)t instanceof HTMLLegendElement&&(n=t),t=t.parentElement;let r=(t==null?void 0:t.getAttribute("disabled"))==="";return r&&Sm(n)?!1:r}function Sm(e){if(!e)return!1;let t=e.previousElementSibling;for(;t!==null;){if(t instanceof HTMLLegendElement)return!1;t=t.previousElementSibling}return!0}let Sl=Symbol();function Tm(e,t=!0){return Object.assign(e,{[Sl]:t})}function ft(...e){let t=h.useRef(e);h.useEffect(()=>{t.current=e},[e]);let n=te(r=>{for(let i of t.current)i!=null&&(typeof i=="function"?i(r):i.current=r)});return e.every(r=>r==null||(r==null?void 0:r[Sl]))?void 0:n}let As=h.createContext(null);As.displayName="DescriptionContext";function Tl(){let e=h.useContext(As);if(e===null){let t=new Error("You used a <Description /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,Tl),t}return e}function _m(){var e,t;return(t=(e=h.useContext(As))==null?void 0:e.value)!=null?t:void 0}let Cm="p";function Om(e,t){let n=h.useId(),r=Cs(),{id:i=`headlessui-description-${n}`,...s}=e,o=Tl(),a=ft(t);me(()=>o.register(i),[i,o.register]);let l=r||!1,u=h.useMemo(()=>({...o.slot,disabled:l}),[o.slot,l]),c={ref:a,...o.props,id:i};return it()({ourProps:c,theirProps:s,slot:u,defaultTag:Cm,name:o.name||"Description"})}let km=Qe(Om);Object.assign(km,{});var Ne=(e=>(e.Space=" ",e.Enter="Enter",e.Escape="Escape",e.Backspace="Backspace",e.Delete="Delete",e.ArrowLeft="ArrowLeft",e.ArrowUp="ArrowUp",e.ArrowRight="ArrowRight",e.ArrowDown="ArrowDown",e.Home="Home",e.End="End",e.PageUp="PageUp",e.PageDown="PageDown",e.Tab="Tab",e))(Ne||{});let ei=h.createContext(null);ei.displayName="LabelContext";function _l(){let e=h.useContext(ei);if(e===null){let t=new Error("You used a <Label /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,_l),t}return e}function Cl(e){var t,n,r;let i=(n=(t=h.useContext(ei))==null?void 0:t.value)!=null?n:void 0;return((r=e==null?void 0:e.length)!=null?r:0)>0?[i,...e].filter(Boolean).join(" "):i}function Fm({inherit:e=!1}={}){let t=Cl(),[n,r]=h.useState([]),i=e?[t,...n].filter(Boolean):n;return[i.length>0?i.join(" "):void 0,h.useMemo(()=>function(s){let o=te(l=>(r(u=>[...u,l]),()=>r(u=>{let c=u.slice(),f=c.indexOf(l);return f!==-1&&c.splice(f,1),c}))),a=h.useMemo(()=>({register:o,slot:s.slot,name:s.name,props:s.props,value:s.value}),[o,s.slot,s.name,s.props,s.value]);return h.createElement(ei.Provider,{value:a},s.children)},[r])]}let Am="label";function $m(e,t){var n;let r=h.useId(),i=_l(),s=El(),o=Cs(),{id:a=`headlessui-label-${r}`,htmlFor:l=s??((n=i.props)==null?void 0:n.htmlFor),passive:u=!1,...c}=e,f=ft(t);me(()=>i.register(a),[a,i.register]);let m=te(v=>{let b=v.currentTarget;if(b instanceof HTMLLabelElement&&v.preventDefault(),i.props&&"onClick"in i.props&&typeof i.props.onClick=="function"&&i.props.onClick(v),b instanceof HTMLLabelElement){let x=document.getElementById(b.htmlFor);if(x){let w=x.getAttribute("disabled");if(w==="true"||w==="")return;let T=x.getAttribute("aria-disabled");if(T==="true"||T==="")return;(x instanceof HTMLInputElement&&(x.type==="radio"||x.type==="checkbox")||x.role==="radio"||x.role==="checkbox"||x.role==="switch")&&x.click(),x.focus({preventScroll:!0})}}}),p=o||!1,d=h.useMemo(()=>({...i.slot,disabled:p}),[i.slot,p]),g={ref:f,...i.props,id:a,htmlFor:l,onClick:m};return u&&("onClick"in g&&(delete g.htmlFor,delete g.onClick),"onClick"in c&&delete c.onClick),it()({ourProps:g,theirProps:c,slot:d,defaultTag:l?Am:"div",name:i.name||"Label"})}let jm=Qe($m),Nm=Object.assign(jm,{});function Pm(e,t){return e!==null&&t!==null&&typeof e=="object"&&typeof t=="object"&&"id"in e&&"id"in t?e.id===t.id:e===t}function Lm(e=Pm){return h.useCallback((t,n)=>{if(typeof e=="string"){let r=e;return(t==null?void 0:t[r])===(n==null?void 0:n[r])}return e(t,n)},[e])}function Dm(e){if(e===null)return{width:0,height:0};let{width:t,height:n}=e.getBoundingClientRect();return{width:t,height:n}}function Im(e,t=!1){let[n,r]=h.useReducer(()=>({}),{}),i=h.useMemo(()=>Dm(e),[e,n]);return me(()=>{if(!e)return;let s=new ResizeObserver(r);return s.observe(e),()=>{s.disconnect()}},[e]),t?{width:`${i.width}px`,height:`${i.height}px`}:i}let Mm=class extends Map{constructor(t){super(),this.factory=t}get(t){let n=super.get(t);return n===void 0&&(n=this.factory(t),this.set(t,n)),n}};function Ol(e,t){let n=e(),r=new Set;return{getSnapshot(){return n},subscribe(i){return r.add(i),()=>r.delete(i)},dispatch(i,...s){let o=t[i].call(n,...s);o&&(n=o,r.forEach(a=>a()))}}}function kl(e){return h.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot)}let Rm=new Mm(()=>Ol(()=>[],{ADD(e){return this.includes(e)?this:[...this,e]},REMOVE(e){let t=this.indexOf(e);if(t===-1)return this;let n=this.slice();return n.splice(t,1),n}}));function $s(e,t){let n=Rm.get(t),r=h.useId(),i=kl(n);if(me(()=>{if(e)return n.dispatch("ADD",r),()=>n.dispatch("REMOVE",r)},[n,e]),!e)return!1;let s=i.indexOf(r),o=i.length;return s===-1&&(s=o,o+=1),s===o-1}let js=new Map,or=new Map;function Fl(e){var t;let n=(t=or.get(e))!=null?t:0;return or.set(e,n+1),n!==0?()=>Al(e):(js.set(e,{"aria-hidden":e.getAttribute("aria-hidden"),inert:e.inert}),e.setAttribute("aria-hidden","true"),e.inert=!0,()=>Al(e))}function Al(e){var t;let n=(t=or.get(e))!=null?t:1;if(n===1?or.delete(e):or.set(e,n-1),n!==1)return;let r=js.get(e);r&&(r["aria-hidden"]===null?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",r["aria-hidden"]),e.inert=r.inert,js.delete(e))}function Vm(e,{allowed:t,disallowed:n}={}){let r=$s(e,"inert-others");me(()=>{var i,s;if(!r)return;let o=Rt();for(let l of(i=n==null?void 0:n())!=null?i:[])l&&o.add(Fl(l));let a=(s=t==null?void 0:t())!=null?s:[];for(let l of a){if(!l)continue;let u=sr(l);if(!u)continue;let c=l.parentElement;for(;c&&c!==u.body;){for(let f of c.children)a.some(m=>f.contains(m))||o.add(Fl(f));c=c.parentElement}}return o.dispose},[r,t,n])}function Bm(e,t,n){let r=cn(i=>{let s=i.getBoundingClientRect();s.x===0&&s.y===0&&s.width===0&&s.height===0&&n()});h.useEffect(()=>{if(!e)return;let i=t===null?null:t instanceof HTMLElement?t:t.current;if(!i)return;let s=Rt();if(typeof ResizeObserver<"u"){let o=new ResizeObserver(()=>r.current(i));o.observe(i),s.add(()=>o.disconnect())}if(typeof IntersectionObserver<"u"){let o=new IntersectionObserver(()=>r.current(i));o.observe(i),s.add(()=>o.disconnect())}return()=>s.dispose()},[t,r,e])}let Ns=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map(e=>`${e}:not([tabindex='-1'])`).join(","),Um=["[data-autofocus]"].map(e=>`${e}:not([tabindex='-1'])`).join(",");var Ps=(e=>(e[e.First=1]="First",e[e.Previous=2]="Previous",e[e.Next=4]="Next",e[e.Last=8]="Last",e[e.WrapAround=16]="WrapAround",e[e.NoScroll=32]="NoScroll",e[e.AutoFocus=64]="AutoFocus",e))(Ps||{}),Hm=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(Hm||{}),qm=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(qm||{});function $l(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(Ns)).sort((t,n)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(n.tabIndex||Number.MAX_SAFE_INTEGER)))}function zm(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(Um)).sort((t,n)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(n.tabIndex||Number.MAX_SAFE_INTEGER)))}var Ls=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(Ls||{});function jl(e,t=0){var n;return e===((n=sr(e))==null?void 0:n.body)?!1:mt(t,{0(){return e.matches(Ns)},1(){let r=e;for(;r!==null;){if(r.matches(Ns))return!0;r=r.parentElement}return!1}})}var Wm=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(Wm||{});typeof window<"u"&&typeof document<"u"&&(document.addEventListener("keydown",e=>{e.metaKey||e.altKey||e.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")},!0),document.addEventListener("click",e=>{e.detail===1?delete document.documentElement.dataset.headlessuiFocusVisible:e.detail===0&&(document.documentElement.dataset.headlessuiFocusVisible="")},!0));let Km=["textarea","input"].join(",");function Jm(e){var t,n;return(n=(t=e==null?void 0:e.matches)==null?void 0:t.call(e,Km))!=null?n:!1}function Nl(e,t=n=>n){return e.slice().sort((n,r)=>{let i=t(n),s=t(r);if(i===null||s===null)return 0;let o=i.compareDocumentPosition(s);return o&Node.DOCUMENT_POSITION_FOLLOWING?-1:o&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function Ym(e,t){return Gm($l(),t,{relativeTo:e})}function Gm(e,t,{sorted:n=!0,relativeTo:r=null,skipElements:i=[]}={}){let s=Array.isArray(e)?e.length>0?e[0].ownerDocument:document:e.ownerDocument,o=Array.isArray(e)?n?Nl(e):e:t&64?zm(e):$l(e);i.length>0&&o.length>1&&(o=o.filter(p=>!i.some(d=>d!=null&&"current"in d?(d==null?void 0:d.current)===p:d===p))),r=r??s.activeElement;let a=(()=>{if(t&5)return 1;if(t&10)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),l=(()=>{if(t&1)return 0;if(t&2)return Math.max(0,o.indexOf(r))-1;if(t&4)return Math.max(0,o.indexOf(r))+1;if(t&8)return o.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),u=t&32?{preventScroll:!0}:{},c=0,f=o.length,m;do{if(c>=f||c+f<=0)return 0;let p=l+c;if(t&16)p=(p+f)%f;else{if(p<0)return 3;if(p>=f)return 1}m=o[p],m==null||m.focus(u),c+=a}while(m!==s.activeElement);return t&6&&Jm(m)&&m.select(),2}function Pl(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function Xm(){return/Android/gi.test(window.navigator.userAgent)}function Qm(){return Pl()||Xm()}function ar(e,t,n,r){let i=cn(n);h.useEffect(()=>{if(!e)return;function s(o){i.current(o)}return document.addEventListener(t,s,r),()=>document.removeEventListener(t,s,r)},[e,t,r])}function Zm(e,t,n,r){let i=cn(n);h.useEffect(()=>{if(!e)return;function s(o){i.current(o)}return window.addEventListener(t,s,r),()=>window.removeEventListener(t,s,r)},[e,t,r])}const Ll=30;function eg(e,t,n){let r=$s(e,"outside-click"),i=cn(n),s=h.useCallback(function(l,u){if(l.defaultPrevented)return;let c=u(l);if(c===null||!c.getRootNode().contains(c)||!c.isConnected)return;let f=function m(p){return typeof p=="function"?m(p()):Array.isArray(p)||p instanceof Set?p:[p]}(t);for(let m of f)if(m!==null&&(m.contains(c)||l.composed&&l.composedPath().includes(m)))return;return!jl(c,Ls.Loose)&&c.tabIndex!==-1&&l.preventDefault(),i.current(l,c)},[i,t]),o=h.useRef(null);ar(r,"pointerdown",l=>{var u,c;o.current=((c=(u=l.composedPath)==null?void 0:u.call(l))==null?void 0:c[0])||l.target},!0),ar(r,"mousedown",l=>{var u,c;o.current=((c=(u=l.composedPath)==null?void 0:u.call(l))==null?void 0:c[0])||l.target},!0),ar(r,"click",l=>{Qm()||o.current&&(s(l,()=>o.current),o.current=null)},!0);let a=h.useRef({x:0,y:0});ar(r,"touchstart",l=>{a.current.x=l.touches[0].clientX,a.current.y=l.touches[0].clientY},!0),ar(r,"touchend",l=>{let u={x:l.changedTouches[0].clientX,y:l.changedTouches[0].clientY};if(!(Math.abs(u.x-a.current.x)>=Ll||Math.abs(u.y-a.current.y)>=Ll))return s(l,()=>l.target instanceof HTMLElement?l.target:null)},!0),Zm(r,"blur",l=>s(l,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}function Ds(...e){return h.useMemo(()=>sr(...e),[...e])}function tg(e,t){return h.useMemo(()=>{var n;if(e.type)return e.type;let r=(n=e.as)!=null?n:"button";if(typeof r=="string"&&r.toLowerCase()==="button"||(t==null?void 0:t.tagName)==="BUTTON"&&!t.hasAttribute("type"))return"button"},[e.type,e.as,t])}function ng(){let e;return{before({doc:t}){var n;let r=t.documentElement,i=(n=t.defaultView)!=null?n:window;e=Math.max(0,i.innerWidth-r.clientWidth)},after({doc:t,d:n}){let r=t.documentElement,i=Math.max(0,r.clientWidth-r.offsetWidth),s=Math.max(0,e-i);n.style(r,"paddingRight",`${s}px`)}}}function rg(){return Pl()?{before({doc:e,d:t,meta:n}){function r(i){return n.containers.flatMap(s=>s()).some(s=>s.contains(i))}t.microTask(()=>{var i;if(window.getComputedStyle(e.documentElement).scrollBehavior!=="auto"){let a=Rt();a.style(e.documentElement,"scrollBehavior","auto"),t.add(()=>t.microTask(()=>a.dispose()))}let s=(i=window.scrollY)!=null?i:window.pageYOffset,o=null;t.addEventListener(e,"click",a=>{if(a.target instanceof HTMLElement)try{let l=a.target.closest("a");if(!l)return;let{hash:u}=new URL(l.href),c=e.querySelector(u);c&&!r(c)&&(o=c)}catch{}},!0),t.addEventListener(e,"touchstart",a=>{if(a.target instanceof HTMLElement)if(r(a.target)){let l=a.target;for(;l.parentElement&&r(l.parentElement);)l=l.parentElement;t.style(l,"overscrollBehavior","contain")}else t.style(a.target,"touchAction","none")}),t.addEventListener(e,"touchmove",a=>{if(a.target instanceof HTMLElement){if(a.target.tagName==="INPUT")return;if(r(a.target)){let l=a.target;for(;l.parentElement&&l.dataset.headlessuiPortal!==""&&!(l.scrollHeight>l.clientHeight||l.scrollWidth>l.clientWidth);)l=l.parentElement;l.dataset.headlessuiPortal===""&&a.preventDefault()}else a.preventDefault()}},{passive:!1}),t.add(()=>{var a;let l=(a=window.scrollY)!=null?a:window.pageYOffset;s!==l&&window.scrollTo(0,s),o&&o.isConnected&&(o.scrollIntoView({block:"nearest"}),o=null)})})}}:{}}function ig(){return{before({doc:e,d:t}){t.style(e.documentElement,"overflow","hidden")}}}function sg(e){let t={};for(let n of e)Object.assign(t,n(t));return t}let fn=Ol(()=>new Map,{PUSH(e,t){var n;let r=(n=this.get(e))!=null?n:{doc:e,count:0,d:Rt(),meta:new Set};return r.count++,r.meta.add(t),this.set(e,r),this},POP(e,t){let n=this.get(e);return n&&(n.count--,n.meta.delete(t)),this},SCROLL_PREVENT({doc:e,d:t,meta:n}){let r={doc:e,d:t,meta:sg(n)},i=[rg(),ng(),ig()];i.forEach(({before:s})=>s==null?void 0:s(r)),i.forEach(({after:s})=>s==null?void 0:s(r))},SCROLL_ALLOW({d:e}){e.dispose()},TEARDOWN({doc:e}){this.delete(e)}});fn.subscribe(()=>{let e=fn.getSnapshot(),t=new Map;for(let[n]of e)t.set(n,n.documentElement.style.overflow);for(let n of e.values()){let r=t.get(n.doc)==="hidden",i=n.count!==0;(i&&!r||!i&&r)&&fn.dispatch(n.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",n),n.count===0&&fn.dispatch("TEARDOWN",n)}});function og(e,t,n=()=>({containers:[]})){let r=kl(fn),i=t?r.get(t):void 0,s=i?i.count>0:!1;return me(()=>{if(!(!t||!e))return fn.dispatch("PUSH",t,n),()=>fn.dispatch("POP",t,n)},[e,t]),s}function ag(e,t,n=()=>[document.body]){let r=$s(e,"scroll-lock");og(r,t,i=>{var s;return{containers:[...(s=i.containers)!=null?s:[],n]}})}function Dl(e){return[e.screenX,e.screenY]}function lg(){let e=h.useRef([-1,-1]);return{wasMoved(t){let n=Dl(t);return e.current[0]===n[0]&&e.current[1]===n[1]?!1:(e.current=n,!0)},update(t){e.current=Dl(t)}}}function ug(e=0){let[t,n]=h.useState(e),r=h.useCallback(l=>n(l),[t]),i=h.useCallback(l=>n(u=>u|l),[t]),s=h.useCallback(l=>(t&l)===l,[t]),o=h.useCallback(l=>n(u=>u&~l),[n]),a=h.useCallback(l=>n(u=>u^l),[n]);return{flags:t,setFlag:r,addFlag:i,hasFlag:s,removeFlag:o,toggleFlag:a}}var Il,Ml;typeof process<"u"&&typeof globalThis<"u"&&typeof Element<"u"&&((Il=process==null?void 0:process.env)==null?void 0:Il.NODE_ENV)==="test"&&typeof((Ml=Element==null?void 0:Element.prototype)==null?void 0:Ml.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(`
|
|
51
|
+
`)),[]});var cg=(e=>(e[e.None=0]="None",e[e.Closed=1]="Closed",e[e.Enter=2]="Enter",e[e.Leave=4]="Leave",e))(cg||{});function Rl(e){let t={};for(let n in e)e[n]===!0&&(t[`data-${n}`]="");return t}function Vl(e,t,n,r){let[i,s]=h.useState(n),{hasFlag:o,addFlag:a,removeFlag:l}=ug(e&&i?3:0),u=h.useRef(!1),c=h.useRef(!1),f=un();return me(()=>{var m;if(e){if(n&&s(!0),!t){n&&a(3);return}return(m=r==null?void 0:r.start)==null||m.call(r,n),fg(t,{inFlight:u,prepare(){c.current?c.current=!1:c.current=u.current,u.current=!0,!c.current&&(n?(a(3),l(4)):(a(4),l(2)))},run(){c.current?n?(l(3),a(4)):(l(4),a(3)):n?l(1):a(1)},done(){var p;c.current&&typeof t.getAnimations=="function"&&t.getAnimations().length>0||(u.current=!1,l(7),n||s(!1),(p=r==null?void 0:r.end)==null||p.call(r,n))}})}},[e,n,t,f]),e?[i,{closed:o(1),enter:o(2),leave:o(4),transition:o(2)||o(4)}]:[n,{closed:void 0,enter:void 0,leave:void 0,transition:void 0}]}function fg(e,{prepare:t,run:n,done:r,inFlight:i}){let s=Rt();return pg(e,{prepare:t,inFlight:i}),s.nextFrame(()=>{n(),s.requestAnimationFrame(()=>{s.add(dg(e,r))})}),s.dispose}function dg(e,t){var n,r;let i=Rt();if(!e)return i.dispose;let s=!1;i.add(()=>{s=!0});let o=(r=(n=e.getAnimations)==null?void 0:n.call(e).filter(a=>a instanceof CSSTransition))!=null?r:[];return o.length===0?(t(),i.dispose):(Promise.allSettled(o.map(a=>a.finished)).then(()=>{s||t()}),i.dispose)}function pg(e,{inFlight:t,prepare:n}){if(t!=null&&t.current){n();return}let r=e.style.transition;e.style.transition="none",n(),e.offsetHeight,e.style.transition=r}function ti(){return typeof window<"u"}function Fn(e){return Bl(e)?(e.nodeName||"").toLowerCase():"#document"}function st(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Tt(e){var t;return(t=(Bl(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Bl(e){return ti()?e instanceof Node||e instanceof st(e).Node:!1}function Ue(e){return ti()?e instanceof Element||e instanceof st(e).Element:!1}function _t(e){return ti()?e instanceof HTMLElement||e instanceof st(e).HTMLElement:!1}function Ul(e){return!ti()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof st(e).ShadowRoot}function lr(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=gt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(i)}function hg(e){return["table","td","th"].includes(Fn(e))}function ni(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Is(e){const t=Ms(),n=Ue(e)?gt(e):e;return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function mg(e){let t=Jt(e);for(;_t(t)&&!An(t);){if(Is(t))return t;if(ni(t))return null;t=Jt(t)}return null}function Ms(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function An(e){return["html","body","#document"].includes(Fn(e))}function gt(e){return st(e).getComputedStyle(e)}function ri(e){return Ue(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Jt(e){if(Fn(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Ul(e)&&e.host||Tt(e);return Ul(t)?t.host:t}function Hl(e){const t=Jt(e);return An(t)?e.ownerDocument?e.ownerDocument.body:e.body:_t(t)&&lr(t)?t:Hl(t)}function ur(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=Hl(e),s=i===((r=e.ownerDocument)==null?void 0:r.body),o=st(i);if(s){const a=Rs(o);return t.concat(o,o.visualViewport||[],lr(i)?i:[],a&&n?ur(a):[])}return t.concat(i,ur(i,[],n))}function Rs(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function gg(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:n,version:r}=t;return n+"/"+r}).join(" "):navigator.userAgent}const dn=Math.min,He=Math.max,cr=Math.round,ii=Math.floor,Ct=e=>({x:e,y:e}),yg={left:"right",right:"left",bottom:"top",top:"bottom"},bg={start:"end",end:"start"};function ql(e,t,n){return He(e,dn(t,n))}function $n(e,t){return typeof e=="function"?e(t):e}function Yt(e){return e.split("-")[0]}function fr(e){return e.split("-")[1]}function zl(e){return e==="x"?"y":"x"}function Wl(e){return e==="y"?"height":"width"}function pn(e){return["top","bottom"].includes(Yt(e))?"y":"x"}function Kl(e){return zl(pn(e))}function vg(e,t,n){n===void 0&&(n=!1);const r=fr(e),i=Kl(e),s=Wl(i);let o=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(o=si(o)),[o,si(o)]}function xg(e){const t=si(e);return[Vs(e),t,Vs(t)]}function Vs(e){return e.replace(/start|end/g,t=>bg[t])}function wg(e,t,n){const r=["left","right"],i=["right","left"],s=["top","bottom"],o=["bottom","top"];switch(e){case"top":case"bottom":return n?t?i:r:t?r:i;case"left":case"right":return t?s:o;default:return[]}}function Eg(e,t,n,r){const i=fr(e);let s=wg(Yt(e),n==="start",r);return i&&(s=s.map(o=>o+"-"+i),t&&(s=s.concat(s.map(Vs)))),s}function si(e){return e.replace(/left|right|bottom|top/g,t=>yg[t])}function Sg(e){return{top:0,right:0,bottom:0,left:0,...e}}function Tg(e){return typeof e!="number"?Sg(e):{top:e,right:e,bottom:e,left:e}}function oi(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function Jl(e,t,n){let{reference:r,floating:i}=e;const s=pn(t),o=Kl(t),a=Wl(o),l=Yt(t),u=s==="y",c=r.x+r.width/2-i.width/2,f=r.y+r.height/2-i.height/2,m=r[a]/2-i[a]/2;let p;switch(l){case"top":p={x:c,y:r.y-i.height};break;case"bottom":p={x:c,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:f};break;case"left":p={x:r.x-i.width,y:f};break;default:p={x:r.x,y:r.y}}switch(fr(t)){case"start":p[o]-=m*(n&&u?-1:1);break;case"end":p[o]+=m*(n&&u?-1:1);break}return p}const _g=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:s=[],platform:o}=n,a=s.filter(Boolean),l=await(o.isRTL==null?void 0:o.isRTL(t));let u=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:c,y:f}=Jl(u,r,l),m=r,p={},d=0;for(let g=0;g<a.length;g++){const{name:v,fn:b}=a[g],{x,y:w,data:T,reset:C}=await b({x:c,y:f,initialPlacement:r,placement:m,strategy:i,middlewareData:p,rects:u,platform:o,elements:{reference:e,floating:t}});c=x??c,f=w??f,p={...p,[v]:{...p[v],...T}},C&&d<=50&&(d++,typeof C=="object"&&(C.placement&&(m=C.placement),C.rects&&(u=C.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):C.rects),{x:c,y:f}=Jl(u,m,l)),g=-1)}return{x:c,y:f,placement:m,strategy:i,middlewareData:p}};async function ai(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:s,rects:o,elements:a,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:f="floating",altBoundary:m=!1,padding:p=0}=$n(t,e),d=Tg(p),v=a[m?f==="floating"?"reference":"floating":f],b=oi(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(v)))==null||n?v:v.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:u,rootBoundary:c,strategy:l})),x=f==="floating"?{x:r,y:i,width:o.floating.width,height:o.floating.height}:o.reference,w=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),T=await(s.isElement==null?void 0:s.isElement(w))?await(s.getScale==null?void 0:s.getScale(w))||{x:1,y:1}:{x:1,y:1},C=oi(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:x,offsetParent:w,strategy:l}):x);return{top:(b.top-C.top+d.top)/T.y,bottom:(C.bottom-b.bottom+d.bottom)/T.y,left:(b.left-C.left+d.left)/T.x,right:(C.right-b.right+d.right)/T.x}}const Cg=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:s,rects:o,initialPlacement:a,platform:l,elements:u}=t,{mainAxis:c=!0,crossAxis:f=!0,fallbackPlacements:m,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:d="none",flipAlignment:g=!0,...v}=$n(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const b=Yt(i),x=pn(a),w=Yt(a)===a,T=await(l.isRTL==null?void 0:l.isRTL(u.floating)),C=m||(w||!g?[si(a)]:xg(a)),_=d!=="none";!m&&_&&C.push(...Eg(a,g,d,T));const O=[a,...C],A=await ai(t,v),N=[];let L=((r=s.flip)==null?void 0:r.overflows)||[];if(c&&N.push(A[b]),f){const z=vg(i,o,T);N.push(A[z[0]],A[z[1]])}if(L=[...L,{placement:i,overflows:N}],!N.every(z=>z<=0)){var P,I;const z=(((P=s.flip)==null?void 0:P.index)||0)+1,Y=O[z];if(Y)return{data:{index:z,overflows:L},reset:{placement:Y}};let H=(I=L.filter(X=>X.overflows[0]<=0).sort((X,K)=>X.overflows[1]-K.overflows[1])[0])==null?void 0:I.placement;if(!H)switch(p){case"bestFit":{var R;const X=(R=L.filter(K=>{if(_){const Z=pn(K.placement);return Z===x||Z==="y"}return!0}).map(K=>[K.placement,K.overflows.filter(Z=>Z>0).reduce((Z,ne)=>Z+ne,0)]).sort((K,Z)=>K[1]-Z[1])[0])==null?void 0:R[0];X&&(H=X);break}case"initialPlacement":H=a;break}if(i!==H)return{reset:{placement:H}}}return{}}}};async function Og(e,t){const{placement:n,platform:r,elements:i}=e,s=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Yt(n),a=fr(n),l=pn(n)==="y",u=["left","top"].includes(o)?-1:1,c=s&&l?-1:1,f=$n(t,e);let{mainAxis:m,crossAxis:p,alignmentAxis:d}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return a&&typeof d=="number"&&(p=a==="end"?d*-1:d),l?{x:p*c,y:m*u}:{x:m*u,y:p*c}}const kg=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:s,placement:o,middlewareData:a}=t,l=await Og(t,e);return o===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:s+l.y,data:{...l,placement:o}}}}},Fg=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:s=!0,crossAxis:o=!1,limiter:a={fn:v=>{let{x:b,y:x}=v;return{x:b,y:x}}},...l}=$n(e,t),u={x:n,y:r},c=await ai(t,l),f=pn(Yt(i)),m=zl(f);let p=u[m],d=u[f];if(s){const v=m==="y"?"top":"left",b=m==="y"?"bottom":"right",x=p+c[v],w=p-c[b];p=ql(x,p,w)}if(o){const v=f==="y"?"top":"left",b=f==="y"?"bottom":"right",x=d+c[v],w=d-c[b];d=ql(x,d,w)}const g=a.fn({...t,[m]:p,[f]:d});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[m]:s,[f]:o}}}}}},Ag=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:i,rects:s,platform:o,elements:a}=t,{apply:l=()=>{},...u}=$n(e,t),c=await ai(t,u),f=Yt(i),m=fr(i),p=pn(i)==="y",{width:d,height:g}=s.floating;let v,b;f==="top"||f==="bottom"?(v=f,b=m===(await(o.isRTL==null?void 0:o.isRTL(a.floating))?"start":"end")?"left":"right"):(b=f,v=m==="end"?"top":"bottom");const x=g-c.top-c.bottom,w=d-c.left-c.right,T=dn(g-c[v],x),C=dn(d-c[b],w),_=!t.middlewareData.shift;let O=T,A=C;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(A=w),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(O=x),_&&!m){const L=He(c.left,0),P=He(c.right,0),I=He(c.top,0),R=He(c.bottom,0);p?A=d-2*(L!==0||P!==0?L+P:He(c.left,c.right)):O=g-2*(I!==0||R!==0?I+R:He(c.top,c.bottom))}await l({...t,availableWidth:A,availableHeight:O});const N=await o.getDimensions(a.floating);return d!==N.width||g!==N.height?{reset:{rects:!0}}:{}}}};function Yl(e){const t=gt(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=_t(e),s=i?e.offsetWidth:n,o=i?e.offsetHeight:r,a=cr(n)!==s||cr(r)!==o;return a&&(n=s,r=o),{width:n,height:r,$:a}}function Bs(e){return Ue(e)?e:e.contextElement}function jn(e){const t=Bs(e);if(!_t(t))return Ct(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:s}=Yl(t);let o=(s?cr(n.width):n.width)/r,a=(s?cr(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const $g=Ct(0);function Gl(e){const t=st(e);return!Ms()||!t.visualViewport?$g:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function jg(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==st(e)?!1:t}function hn(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),s=Bs(e);let o=Ct(1);t&&(r?Ue(r)&&(o=jn(r)):o=jn(e));const a=jg(s,n,r)?Gl(s):Ct(0);let l=(i.left+a.x)/o.x,u=(i.top+a.y)/o.y,c=i.width/o.x,f=i.height/o.y;if(s){const m=st(s),p=r&&Ue(r)?st(r):r;let d=m,g=Rs(d);for(;g&&r&&p!==d;){const v=jn(g),b=g.getBoundingClientRect(),x=gt(g),w=b.left+(g.clientLeft+parseFloat(x.paddingLeft))*v.x,T=b.top+(g.clientTop+parseFloat(x.paddingTop))*v.y;l*=v.x,u*=v.y,c*=v.x,f*=v.y,l+=w,u+=T,d=st(g),g=Rs(d)}}return oi({width:c,height:f,x:l,y:u})}function Us(e,t){const n=ri(e).scrollLeft;return t?t.left+n:hn(Tt(e)).left+n}function Xl(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),i=r.left+t.scrollLeft-(n?0:Us(e,r)),s=r.top+t.scrollTop;return{x:i,y:s}}function Ng(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const s=i==="fixed",o=Tt(r),a=t?ni(t.floating):!1;if(r===o||a&&s)return n;let l={scrollLeft:0,scrollTop:0},u=Ct(1);const c=Ct(0),f=_t(r);if((f||!f&&!s)&&((Fn(r)!=="body"||lr(o))&&(l=ri(r)),_t(r))){const p=hn(r);u=jn(r),c.x=p.x+r.clientLeft,c.y=p.y+r.clientTop}const m=o&&!f&&!s?Xl(o,l,!0):Ct(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+c.x+m.x,y:n.y*u.y-l.scrollTop*u.y+c.y+m.y}}function Pg(e){return Array.from(e.getClientRects())}function Lg(e){const t=Tt(e),n=ri(e),r=e.ownerDocument.body,i=He(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=He(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+Us(e);const a=-n.scrollTop;return gt(r).direction==="rtl"&&(o+=He(t.clientWidth,r.clientWidth)-i),{width:i,height:s,x:o,y:a}}function Dg(e,t){const n=st(e),r=Tt(e),i=n.visualViewport;let s=r.clientWidth,o=r.clientHeight,a=0,l=0;if(i){s=i.width,o=i.height;const u=Ms();(!u||u&&t==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}return{width:s,height:o,x:a,y:l}}function Ig(e,t){const n=hn(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,s=_t(e)?jn(e):Ct(1),o=e.clientWidth*s.x,a=e.clientHeight*s.y,l=i*s.x,u=r*s.y;return{width:o,height:a,x:l,y:u}}function Ql(e,t,n){let r;if(t==="viewport")r=Dg(e,n);else if(t==="document")r=Lg(Tt(e));else if(Ue(t))r=Ig(t,n);else{const i=Gl(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return oi(r)}function Zl(e,t){const n=Jt(e);return n===t||!Ue(n)||An(n)?!1:gt(n).position==="fixed"||Zl(n,t)}function Mg(e,t){const n=t.get(e);if(n)return n;let r=ur(e,[],!1).filter(a=>Ue(a)&&Fn(a)!=="body"),i=null;const s=gt(e).position==="fixed";let o=s?Jt(e):e;for(;Ue(o)&&!An(o);){const a=gt(o),l=Is(o);!l&&a.position==="fixed"&&(i=null),(s?!l&&!i:!l&&a.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||lr(o)&&!l&&Zl(e,o))?r=r.filter(c=>c!==o):i=a,o=Jt(o)}return t.set(e,r),r}function Rg(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const o=[...n==="clippingAncestors"?ni(t)?[]:Mg(t,this._c):[].concat(n),r],a=o[0],l=o.reduce((u,c)=>{const f=Ql(t,c,i);return u.top=He(f.top,u.top),u.right=dn(f.right,u.right),u.bottom=dn(f.bottom,u.bottom),u.left=He(f.left,u.left),u},Ql(t,a,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function Vg(e){const{width:t,height:n}=Yl(e);return{width:t,height:n}}function Bg(e,t,n){const r=_t(t),i=Tt(t),s=n==="fixed",o=hn(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const l=Ct(0);if(r||!r&&!s)if((Fn(t)!=="body"||lr(i))&&(a=ri(t)),r){const m=hn(t,!0,s,t);l.x=m.x+t.clientLeft,l.y=m.y+t.clientTop}else i&&(l.x=Us(i));const u=i&&!r&&!s?Xl(i,a):Ct(0),c=o.left+a.scrollLeft-l.x-u.x,f=o.top+a.scrollTop-l.y-u.y;return{x:c,y:f,width:o.width,height:o.height}}function Hs(e){return gt(e).position==="static"}function eu(e,t){if(!_t(e)||gt(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Tt(e)===n&&(n=n.ownerDocument.body),n}function tu(e,t){const n=st(e);if(ni(e))return n;if(!_t(e)){let i=Jt(e);for(;i&&!An(i);){if(Ue(i)&&!Hs(i))return i;i=Jt(i)}return n}let r=eu(e,t);for(;r&&hg(r)&&Hs(r);)r=eu(r,t);return r&&An(r)&&Hs(r)&&!Is(r)?n:r||mg(e)||n}const Ug=async function(e){const t=this.getOffsetParent||tu,n=this.getDimensions,r=await n(e.floating);return{reference:Bg(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Hg(e){return gt(e).direction==="rtl"}const qg={convertOffsetParentRelativeRectToViewportRelativeRect:Ng,getDocumentElement:Tt,getClippingRect:Rg,getOffsetParent:tu,getElementRects:Ug,getClientRects:Pg,getDimensions:Vg,getScale:jn,isElement:Ue,isRTL:Hg};function zg(e,t){let n=null,r;const i=Tt(e);function s(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function o(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),s();const{left:u,top:c,width:f,height:m}=e.getBoundingClientRect();if(a||t(),!f||!m)return;const p=ii(c),d=ii(i.clientWidth-(u+f)),g=ii(i.clientHeight-(c+m)),v=ii(u),x={rootMargin:-p+"px "+-d+"px "+-g+"px "+-v+"px",threshold:He(0,dn(1,l))||1};let w=!0;function T(C){const _=C[0].intersectionRatio;if(_!==l){if(!w)return o();_?o(!1,_):r=setTimeout(()=>{o(!1,1e-7)},1e3)}w=!1}try{n=new IntersectionObserver(T,{...x,root:i.ownerDocument})}catch{n=new IntersectionObserver(T,x)}n.observe(e)}return o(!0),s}function Wg(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=Bs(e),c=i||s?[...u?ur(u):[],...ur(t)]:[];c.forEach(b=>{i&&b.addEventListener("scroll",n,{passive:!0}),s&&b.addEventListener("resize",n)});const f=u&&a?zg(u,n):null;let m=-1,p=null;o&&(p=new ResizeObserver(b=>{let[x]=b;x&&x.target===u&&p&&(p.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var w;(w=p)==null||w.observe(t)})),n()}),u&&!l&&p.observe(u),p.observe(t));let d,g=l?hn(e):null;l&&v();function v(){const b=hn(e);g&&(b.x!==g.x||b.y!==g.y||b.width!==g.width||b.height!==g.height)&&n(),g=b,d=requestAnimationFrame(v)}return n(),()=>{var b;c.forEach(x=>{i&&x.removeEventListener("scroll",n),s&&x.removeEventListener("resize",n)}),f==null||f(),(b=p)==null||b.disconnect(),p=null,l&&cancelAnimationFrame(d)}}const qs=ai,Kg=kg,Jg=Fg,Yg=Cg,Gg=Ag,Xg=(e,t,n)=>{const r=new Map,i={platform:qg,...n},s={...i.platform,_c:r};return _g(e,t,{...i,platform:s})};var li=typeof document<"u"?h.useLayoutEffect:h.useEffect;function ui(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!ui(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const s=i[r];if(!(s==="_owner"&&e.$$typeof)&&!ui(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function nu(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ru(e,t){const n=nu(e);return Math.round(t*n)/n}function zs(e){const t=F.useRef(e);return li(()=>{t.current=e}),t}function Qg(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:s,floating:o}={},transform:a=!0,whileElementsMounted:l,open:u}=e,[c,f]=F.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[m,p]=F.useState(r);ui(m,r)||p(r);const[d,g]=F.useState(null),[v,b]=F.useState(null),x=F.useCallback(K=>{K!==_.current&&(_.current=K,g(K))},[]),w=F.useCallback(K=>{K!==O.current&&(O.current=K,b(K))},[]),T=s||d,C=o||v,_=F.useRef(null),O=F.useRef(null),A=F.useRef(c),N=l!=null,L=zs(l),P=zs(i),I=zs(u),R=F.useCallback(()=>{if(!_.current||!O.current)return;const K={placement:t,strategy:n,middleware:m};P.current&&(K.platform=P.current),Xg(_.current,O.current,K).then(Z=>{const ne={...Z,isPositioned:I.current!==!1};z.current&&!ui(A.current,ne)&&(A.current=ne,$r.flushSync(()=>{f(ne)}))})},[m,t,n,P,I]);li(()=>{u===!1&&A.current.isPositioned&&(A.current.isPositioned=!1,f(K=>({...K,isPositioned:!1})))},[u]);const z=F.useRef(!1);li(()=>(z.current=!0,()=>{z.current=!1}),[]),li(()=>{if(T&&(_.current=T),C&&(O.current=C),T&&C){if(L.current)return L.current(T,C,R);R()}},[T,C,R,L,N]);const Y=F.useMemo(()=>({reference:_,floating:O,setReference:x,setFloating:w}),[x,w]),H=F.useMemo(()=>({reference:T,floating:C}),[T,C]),X=F.useMemo(()=>{const K={position:n,left:0,top:0};if(!H.floating)return K;const Z=ru(H.floating,c.x),ne=ru(H.floating,c.y);return a?{...K,transform:"translate("+Z+"px, "+ne+"px)",...nu(H.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:Z,top:ne}},[n,a,H.floating,c.x,c.y]);return F.useMemo(()=>({...c,update:R,refs:Y,elements:H,floatingStyles:X}),[c,R,Y,H,X])}const iu=(e,t)=>({...Kg(e),options:[e,t]}),Zg=(e,t)=>({...Jg(e),options:[e,t]}),ey=(e,t)=>({...Yg(e),options:[e,t]}),ty=(e,t)=>({...Gg(e),options:[e,t]}),su={...F},ny=su.useInsertionEffect||(e=>e());function ou(e){const t=F.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return ny(()=>{t.current=e}),F.useCallback(function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return t.current==null?void 0:t.current(...r)},[])}var Ws=typeof document<"u"?h.useLayoutEffect:h.useEffect;let au=!1,ry=0;const lu=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+ry++;function iy(){const[e,t]=F.useState(()=>au?lu():void 0);return Ws(()=>{e==null&&t(lu())},[]),F.useEffect(()=>{au=!0},[]),e}const sy=su.useId||iy;let dr;process.env.NODE_ENV!=="production"&&(dr=new Set);function oy(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const i="Floating UI: "+n.join(" ");if(!((e=dr)!=null&&e.has(i))){var s;(s=dr)==null||s.add(i),console.warn(i)}}function ay(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const i="Floating UI: "+n.join(" ");if(!((e=dr)!=null&&e.has(i))){var s;(s=dr)==null||s.add(i),console.error(i)}}function ly(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(i=>i(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,((r=e.get(t))==null?void 0:r.filter(i=>i!==n))||[])}}}const uy=F.createContext(null),cy=F.createContext(null),fy=()=>{var e;return((e=F.useContext(uy))==null?void 0:e.id)||null},dy=()=>F.useContext(cy),py="data-floating-ui-focusable";function hy(e){const{open:t=!1,onOpenChange:n,elements:r}=e,i=sy(),s=F.useRef({}),[o]=F.useState(()=>ly()),a=fy()!=null;if(process.env.NODE_ENV!=="production"){const p=r.reference;p&&!Ue(p)&&ay("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[l,u]=F.useState(r.reference),c=ou((p,d,g)=>{s.current.openEvent=p?d:void 0,o.emit("openchange",{open:p,event:d,reason:g,nested:a}),n==null||n(p,d,g)}),f=F.useMemo(()=>({setPositionReference:u}),[]),m=F.useMemo(()=>({reference:l||r.reference||null,floating:r.floating||null,domReference:r.reference}),[l,r.reference,r.floating]);return F.useMemo(()=>({dataRef:s,open:t,onOpenChange:c,elements:m,events:o,floatingId:i,refs:f}),[t,c,m,o,i,f])}function my(e){e===void 0&&(e={});const{nodeId:t}=e,n=hy({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,i=r.elements,[s,o]=F.useState(null),[a,l]=F.useState(null),c=(i==null?void 0:i.domReference)||s,f=F.useRef(null),m=dy();Ws(()=>{c&&(f.current=c)},[c]);const p=Qg({...e,elements:{...i,...a&&{reference:a}}}),d=F.useCallback(w=>{const T=Ue(w)?{getBoundingClientRect:()=>w.getBoundingClientRect(),contextElement:w}:w;l(T),p.refs.setReference(T)},[p.refs]),g=F.useCallback(w=>{(Ue(w)||w===null)&&(f.current=w,o(w)),(Ue(p.refs.reference.current)||p.refs.reference.current===null||w!==null&&!Ue(w))&&p.refs.setReference(w)},[p.refs]),v=F.useMemo(()=>({...p.refs,setReference:g,setPositionReference:d,domReference:f}),[p.refs,g,d]),b=F.useMemo(()=>({...p.elements,domReference:c}),[p.elements,c]),x=F.useMemo(()=>({...p,...r,refs:v,elements:b,nodeId:t}),[p,v,b,t,r]);return Ws(()=>{r.dataRef.current.floatingContext=x;const w=m==null?void 0:m.nodesRef.current.find(T=>T.id===t);w&&(w.context=x)}),F.useMemo(()=>({...p,context:x,refs:v,elements:b}),[p,v,b,x])}const uu="active",cu="selected";function Ks(e,t,n){const r=new Map,i=n==="item";let s=e;if(i&&e){const{[uu]:o,[cu]:a,...l}=e;s=l}return{...n==="floating"&&{tabIndex:-1,[py]:""},...s,...t.map(o=>{const a=o?o[n]:null;return typeof a=="function"?e?a(e):null:a}).concat(e).reduce((o,a)=>(a&&Object.entries(a).forEach(l=>{let[u,c]=l;if(!(i&&[uu,cu].includes(u)))if(u.indexOf("on")===0){if(r.has(u)||r.set(u,[]),typeof c=="function"){var f;(f=r.get(u))==null||f.push(c),o[u]=function(){for(var m,p=arguments.length,d=new Array(p),g=0;g<p;g++)d[g]=arguments[g];return(m=r.get(u))==null?void 0:m.map(v=>v(...d)).find(v=>v!==void 0)}}}else o[u]=c}),o),{})}}function gy(e){e===void 0&&(e=[]);const t=e.map(a=>a==null?void 0:a.reference),n=e.map(a=>a==null?void 0:a.floating),r=e.map(a=>a==null?void 0:a.item),i=F.useCallback(a=>Ks(a,e,"reference"),t),s=F.useCallback(a=>Ks(a,e,"floating"),n),o=F.useCallback(a=>Ks(a,e,"item"),r);return F.useMemo(()=>({getReferenceProps:i,getFloatingProps:s,getItemProps:o}),[i,s,o])}function fu(e,t){return{...e,rects:{...e.rects,floating:{...e.rects.floating,height:t}}}}const yy=e=>({name:"inner",options:e,async fn(t){const{listRef:n,overflowRef:r,onFallbackChange:i,offset:s=0,index:o=0,minItemsVisible:a=4,referenceOverflowThreshold:l=0,scrollRef:u,...c}=$n(e,t),{rects:f,elements:{floating:m}}=t,p=n.current[o],d=(u==null?void 0:u.current)||m,g=m.clientTop||d.clientTop,v=m.clientTop!==0,b=d.clientTop!==0,x=m===d;if(process.env.NODE_ENV!=="production"&&(t.placement.startsWith("bottom")||oy('`placement` side must be "bottom" when using the `inner`',"middleware.")),!p)return{};const w={...t,...await iu(-p.offsetTop-m.clientTop-f.reference.height/2-p.offsetHeight/2-s).fn(t)},T=await qs(fu(w,d.scrollHeight+g+m.clientTop),c),C=await qs(w,{...c,elementContext:"reference"}),_=He(0,T.top),O=w.y+_,L=(d.scrollHeight>d.clientHeight?P=>P:cr)(He(0,d.scrollHeight+(v&&x||b?g*2:0)-_-He(0,T.bottom)));if(d.style.maxHeight=L+"px",d.scrollTop=_,i){const P=d.offsetHeight<p.offsetHeight*dn(a,n.current.length)-1||C.top>=-l||C.bottom>=-l;$r.flushSync(()=>i(P))}return r&&(r.current=await qs(fu({...w,y:O},d.offsetHeight+g+m.clientTop),c)),{y:O}}});function by(e,t){const{open:n,elements:r}=e,{enabled:i=!0,overflowRef:s,scrollRef:o,onChange:a}=t,l=ou(a),u=F.useRef(!1),c=F.useRef(null),f=F.useRef(null);F.useEffect(()=>{if(!i)return;function p(g){if(g.ctrlKey||!d||s.current==null)return;const v=g.deltaY,b=s.current.top>=-.5,x=s.current.bottom>=-.5,w=d.scrollHeight-d.clientHeight,T=v<0?-1:1,C=v<0?"max":"min";d.scrollHeight<=d.clientHeight||(!b&&v>0||!x&&v<0?(g.preventDefault(),$r.flushSync(()=>{l(_=>_+Math[C](v,w*T))})):/firefox/i.test(gg())&&(d.scrollTop+=v))}const d=(o==null?void 0:o.current)||r.floating;if(n&&d)return d.addEventListener("wheel",p),requestAnimationFrame(()=>{c.current=d.scrollTop,s.current!=null&&(f.current={...s.current})}),()=>{c.current=null,f.current=null,d.removeEventListener("wheel",p)}},[i,n,r.floating,s,o,l]);const m=F.useMemo(()=>({onKeyDown(){u.current=!0},onWheel(){u.current=!1},onPointerMove(){u.current=!1},onScroll(){const p=(o==null?void 0:o.current)||r.floating;if(!(!s.current||!p||!u.current)){if(c.current!==null){const d=p.scrollTop-c.current;(s.current.bottom<-.5&&d<-1||s.current.top<-.5&&d>1)&&$r.flushSync(()=>l(g=>g+d))}requestAnimationFrame(()=>{c.current=p.scrollTop})}}}),[r.floating,l,s,o]);return F.useMemo(()=>i?{floating:m}:{},[i,m])}let Nn=h.createContext({styles:void 0,setReference:()=>{},setFloating:()=>{},getReferenceProps:()=>({}),getFloatingProps:()=>({}),slot:{}});Nn.displayName="FloatingContext";let Js=h.createContext(null);Js.displayName="PlacementContext";function vy(e){return h.useMemo(()=>e?typeof e=="string"?{to:e}:e:null,[e])}function xy(){return h.useContext(Nn).setReference}function wy(){return h.useContext(Nn).getReferenceProps}function Ey(){let{getFloatingProps:e,slot:t}=h.useContext(Nn);return h.useCallback((...n)=>Object.assign({},e(...n),{"data-anchor":t.anchor}),[e,t])}function Sy(e=null){e===!1&&(e=null),typeof e=="string"&&(e={to:e});let t=h.useContext(Js),n=h.useMemo(()=>e,[JSON.stringify(e,(i,s)=>{var o;return(o=s==null?void 0:s.outerHTML)!=null?o:s})]);me(()=>{t==null||t(n??null)},[t,n]);let r=h.useContext(Nn);return h.useMemo(()=>[r.setFloating,e?r.styles:{}],[r.setFloating,e,r.styles])}let du=4;function Ty({children:e,enabled:t=!0}){let[n,r]=h.useState(null),[i,s]=h.useState(0),o=h.useRef(null),[a,l]=h.useState(null);_y(a);let u=t&&n!==null&&a!==null,{to:c="bottom",gap:f=0,offset:m=0,padding:p=0,inner:d}=Cy(n,a),[g,v="center"]=c.split(" ");me(()=>{u&&s(0)},[u]);let{refs:b,floatingStyles:x,context:w}=my({open:u,placement:g==="selection"?v==="center"?"bottom":`bottom-${v}`:v==="center"?`${g}`:`${g}-${v}`,strategy:"absolute",transform:!1,middleware:[iu({mainAxis:g==="selection"?0:f,crossAxis:m}),Zg({padding:p}),g!=="selection"&&ey({padding:p}),g==="selection"&&d?yy({...d,padding:p,overflowRef:o,offset:i,minItemsVisible:du,referenceOverflowThreshold:p,onFallbackChange(P){var I,R;if(!P)return;let z=w.elements.floating;if(!z)return;let Y=parseFloat(getComputedStyle(z).scrollPaddingBottom)||0,H=Math.min(du,z.childElementCount),X=0,K=0;for(let Z of(R=(I=w.elements.floating)==null?void 0:I.childNodes)!=null?R:[])if(Z instanceof HTMLElement){let ne=Z.offsetTop,Ae=ne+Z.clientHeight+Y,Pe=z.scrollTop,W=Pe+z.clientHeight;if(ne>=Pe&&Ae<=W)H--;else{K=Math.max(0,Math.min(Ae,W)-Math.max(ne,Pe)),X=Z.clientHeight;break}}H>=1&&s(Z=>{let ne=X*H-K+Y;return Z>=ne?Z:ne})}}):null,ty({padding:p,apply({availableWidth:P,availableHeight:I,elements:R}){Object.assign(R.floating.style,{overflow:"auto",maxWidth:`${P}px`,maxHeight:`min(var(--anchor-max-height, 100vh), ${I}px)`})}})].filter(Boolean),whileElementsMounted:Wg}),[T=g,C=v]=w.placement.split("-");g==="selection"&&(T="selection");let _=h.useMemo(()=>({anchor:[T,C].filter(Boolean).join(" ")}),[T,C]),O=by(w,{overflowRef:o,onChange:s}),{getReferenceProps:A,getFloatingProps:N}=gy([O]),L=te(P=>{l(P),b.setFloating(P)});return F.createElement(Js.Provider,{value:r},F.createElement(Nn.Provider,{value:{setFloating:L,setReference:b.setReference,styles:x,getReferenceProps:A,getFloatingProps:N,slot:_}},e))}function _y(e){me(()=>{if(!e)return;let t=new MutationObserver(()=>{let n=window.getComputedStyle(e).maxHeight,r=parseFloat(n);if(isNaN(r))return;let i=parseInt(n);isNaN(i)||r!==i&&(e.style.maxHeight=`${Math.ceil(r)}px`)});return t.observe(e,{attributes:!0,attributeFilter:["style"]}),()=>{t.disconnect()}},[e])}function Cy(e,t){var n,r,i;let s=Ys((n=e==null?void 0:e.gap)!=null?n:"var(--anchor-gap, 0)",t),o=Ys((r=e==null?void 0:e.offset)!=null?r:"var(--anchor-offset, 0)",t),a=Ys((i=e==null?void 0:e.padding)!=null?i:"var(--anchor-padding, 0)",t);return{...e,gap:s,offset:o,padding:a}}function Ys(e,t,n=void 0){let r=un(),i=te((l,u)=>{if(l==null)return[n,null];if(typeof l=="number")return[l,null];if(typeof l=="string"){if(!u)return[n,null];let c=hu(l,u);return[c,f=>{let m=pu(l);{let p=m.map(d=>window.getComputedStyle(u).getPropertyValue(d));r.requestAnimationFrame(function d(){r.nextFrame(d);let g=!1;for(let[b,x]of m.entries()){let w=window.getComputedStyle(u).getPropertyValue(x);if(p[b]!==w){p[b]=w,g=!0;break}}if(!g)return;let v=hu(l,u);c!==v&&(f(v),c=v)})}return r.dispose}]}return[n,null]}),s=h.useMemo(()=>i(e,t)[0],[e,t]),[o=s,a]=h.useState();return me(()=>{let[l,u]=i(e,t);if(a(l),!!u)return u(a)},[e,t]),o}function pu(e){let t=/var\((.*)\)/.exec(e);if(t){let n=t[1].indexOf(",");if(n===-1)return[t[1]];let r=t[1].slice(0,n).trim(),i=t[1].slice(n+1).trim();return i?[r,...pu(i)]:[r]}return[]}function hu(e,t){let n=document.createElement("div");t.appendChild(n),n.style.setProperty("margin-top","0px","important"),n.style.setProperty("margin-top",e,"important");let r=parseFloat(window.getComputedStyle(n).marginTop)||0;return t.removeChild(n),r}function Oy(e,t){let[n,r]=h.useState(t);return!e&&n!==t&&r(t),e?n:t}let Gs=h.createContext(null);Gs.displayName="OpenClosedContext";var yt=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(yt||{});function Xs(){return h.useContext(Gs)}function mu({value:e,children:t}){return h.createElement(Gs.Provider,{value:e},t)}function ky(e){throw new Error("Unexpected object: "+e)}var Fe=(e=>(e[e.First=0]="First",e[e.Previous=1]="Previous",e[e.Next=2]="Next",e[e.Last=3]="Last",e[e.Specific=4]="Specific",e[e.Nothing=5]="Nothing",e))(Fe||{});function Qs(e,t){let n=t.resolveItems();if(n.length<=0)return null;let r=t.resolveActiveIndex(),i=r??-1;switch(e.focus){case 0:{for(let s=0;s<n.length;++s)if(!t.resolveDisabled(n[s],s,n))return s;return r}case 1:{i===-1&&(i=n.length);for(let s=i-1;s>=0;--s)if(!t.resolveDisabled(n[s],s,n))return s;return r}case 2:{for(let s=i+1;s<n.length;++s)if(!t.resolveDisabled(n[s],s,n))return s;return r}case 3:{for(let s=n.length-1;s>=0;--s)if(!t.resolveDisabled(n[s],s,n))return s;return r}case 4:{for(let s=0;s<n.length;++s)if(t.resolveId(n[s],s,n)===e.id)return s;return r}case 5:return null;default:ky(e)}}function Fy(e){let t=te(e),n=h.useRef(!1);h.useEffect(()=>(n.current=!1,()=>{n.current=!0,ml(()=>{n.current&&t()})}),[t])}function Ay(){let e=typeof document>"u";return"useSyncExternalStore"in F?(t=>t.useSyncExternalStore)(F)(()=>()=>{},()=>!1,()=>!e):!1}function Zs(){let e=Ay(),[t,n]=F.useState(ln.isHandoffComplete);return t&&ln.isHandoffComplete===!1&&n(!1),F.useEffect(()=>{t!==!0&&n(!0)},[t]),F.useEffect(()=>ln.handoff(),[]),e?!1:t}let $y=h.createContext(!1);function jy(){return h.useContext($y)}function Ny(e){let t=jy(),n=h.useContext(yu),r=Ds(e),[i,s]=h.useState(()=>{var o;if(!t&&n!==null)return(o=n.current)!=null?o:null;if(ln.isServer)return null;let a=r==null?void 0:r.getElementById("headlessui-portal-root");if(a)return a;if(r===null)return null;let l=r.createElement("div");return l.setAttribute("id","headlessui-portal-root"),r.body.appendChild(l)});return h.useEffect(()=>{i!==null&&(r!=null&&r.body.contains(i)||r==null||r.body.appendChild(i))},[i,r]),h.useEffect(()=>{t||n!==null&&s(n.current)},[n,s,t]),i}let gu=h.Fragment,Py=Qe(function(e,t){let n=e,r=h.useRef(null),i=ft(Tm(f=>{r.current=f}),t),s=Ds(r),o=Ny(r),[a]=h.useState(()=>{var f;return ln.isServer?null:(f=s==null?void 0:s.createElement("div"))!=null?f:null}),l=h.useContext(My),u=Zs();me(()=>{!o||!a||o.contains(a)||(a.setAttribute("data-headlessui-portal",""),o.appendChild(a))},[o,a]),me(()=>{if(a&&l)return l.register(a)},[l,a]),Fy(()=>{var f;!o||!a||(a instanceof Node&&o.contains(a)&&o.removeChild(a),o.childNodes.length<=0&&((f=o.parentElement)==null||f.removeChild(o)))});let c=it();return u?!o||!a?null:St.createPortal(c({ourProps:{ref:i},theirProps:n,slot:{},defaultTag:gu,name:"Portal"}),a):null});function Ly(e,t){let n=ft(t),{enabled:r=!0,...i}=e,s=it();return r?h.createElement(Py,{...i,ref:n}):s({ourProps:{ref:n},theirProps:i,slot:{},defaultTag:gu,name:"Portal"})}let Dy=h.Fragment,yu=h.createContext(null);function Iy(e,t){let{target:n,...r}=e,i={ref:ft(t)},s=it();return h.createElement(yu.Provider,{value:n},s({ourProps:i,theirProps:r,defaultTag:Dy,name:"Popover.Group"}))}let My=h.createContext(null),Ry=Qe(Ly),Vy=Qe(Iy),By=Object.assign(Ry,{Group:Vy});function Uy(){let e=h.useRef(!1);return me(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function bu(e){var t;return!!(e.enter||e.enterFrom||e.enterTo||e.leave||e.leaveFrom||e.leaveTo)||((t=e.as)!=null?t:xu)!==h.Fragment||h.Children.count(e.children)===1}let ci=h.createContext(null);ci.displayName="TransitionContext";var Hy=(e=>(e.Visible="visible",e.Hidden="hidden",e))(Hy||{});function qy(){let e=h.useContext(ci);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}function zy(){let e=h.useContext(fi);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}let fi=h.createContext(null);fi.displayName="NestingContext";function di(e){return"children"in e?di(e.children):e.current.filter(({el:t})=>t.current!==null).filter(({state:t})=>t==="visible").length>0}function vu(e,t){let n=cn(e),r=h.useRef([]),i=Uy(),s=un(),o=te((p,d=Wt.Hidden)=>{let g=r.current.findIndex(({el:v})=>v===p);g!==-1&&(mt(d,{[Wt.Unmount](){r.current.splice(g,1)},[Wt.Hidden](){r.current[g].state="hidden"}}),s.microTask(()=>{var v;!di(r)&&i.current&&((v=n.current)==null||v.call(n))}))}),a=te(p=>{let d=r.current.find(({el:g})=>g===p);return d?d.state!=="visible"&&(d.state="visible"):r.current.push({el:p,state:"visible"}),()=>o(p,Wt.Unmount)}),l=h.useRef([]),u=h.useRef(Promise.resolve()),c=h.useRef({enter:[],leave:[]}),f=te((p,d,g)=>{l.current.splice(0),t&&(t.chains.current[d]=t.chains.current[d].filter(([v])=>v!==p)),t==null||t.chains.current[d].push([p,new Promise(v=>{l.current.push(v)})]),t==null||t.chains.current[d].push([p,new Promise(v=>{Promise.all(c.current[d].map(([b,x])=>x)).then(()=>v())})]),d==="enter"?u.current=u.current.then(()=>t==null?void 0:t.wait.current).then(()=>g(d)):g(d)}),m=te((p,d,g)=>{Promise.all(c.current[d].splice(0).map(([v,b])=>b)).then(()=>{var v;(v=l.current.shift())==null||v()}).then(()=>g(d))});return h.useMemo(()=>({children:r,register:a,unregister:o,onStart:f,onStop:m,wait:u,chains:c}),[a,o,r,f,m,c,u])}let xu=h.Fragment,wu=Qr.RenderStrategy;function Wy(e,t){var n,r;let{transition:i=!0,beforeEnter:s,afterEnter:o,beforeLeave:a,afterLeave:l,enter:u,enterFrom:c,enterTo:f,entered:m,leave:p,leaveFrom:d,leaveTo:g,...v}=e,[b,x]=h.useState(null),w=h.useRef(null),T=bu(e),C=ft(...T?[w,t,x]:t===null?[]:[t]),_=(n=v.unmount)==null||n?Wt.Unmount:Wt.Hidden,{show:O,appear:A,initial:N}=qy(),[L,P]=h.useState(O?"visible":"hidden"),I=zy(),{register:R,unregister:z}=I;me(()=>R(w),[R,w]),me(()=>{if(_===Wt.Hidden&&w.current){if(O&&L!=="visible"){P("visible");return}return mt(L,{hidden:()=>z(w),visible:()=>R(w)})}},[L,w,R,z,O,_]);let Y=Zs();me(()=>{if(T&&Y&&L==="visible"&&w.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[w,L,Y,T]);let H=N&&!A,X=A&&O&&N,K=h.useRef(!1),Z=vu(()=>{K.current||(P("hidden"),z(w))},I),ne=te($e=>{K.current=!0;let Te=$e?"enter":"leave";Z.onStart(w,Te,Le=>{Le==="enter"?s==null||s():Le==="leave"&&(a==null||a())})}),Ae=te($e=>{let Te=$e?"enter":"leave";K.current=!1,Z.onStop(w,Te,Le=>{Le==="enter"?o==null||o():Le==="leave"&&(l==null||l())}),Te==="leave"&&!di(Z)&&(P("hidden"),z(w))});h.useEffect(()=>{T&&i||(ne(O),Ae(O))},[O,T,i]);let Pe=!(!i||!T||!Y||H),[,W]=Vl(Pe,b,O,{start:ne,end:Ae}),ve=Kt({ref:C,className:((r=Os(v.className,X&&u,X&&c,W.enter&&u,W.enter&&W.closed&&c,W.enter&&!W.closed&&f,W.leave&&p,W.leave&&!W.closed&&d,W.leave&&W.closed&&g,!W.transition&&O&&m))==null?void 0:r.trim())||void 0,...Rl(W)}),Se=0;L==="visible"&&(Se|=yt.Open),L==="hidden"&&(Se|=yt.Closed),W.enter&&(Se|=yt.Opening),W.leave&&(Se|=yt.Closing);let ae=it();return h.createElement(fi.Provider,{value:Z},h.createElement(mu,{value:Se},ae({ourProps:ve,theirProps:v,defaultTag:xu,features:wu,visible:L==="visible",name:"Transition.Child"})))}function Ky(e,t){let{show:n,appear:r=!1,unmount:i=!0,...s}=e,o=h.useRef(null),a=bu(e),l=ft(...a?[o,t]:t===null?[]:[t]);Zs();let u=Xs();if(n===void 0&&u!==null&&(n=(u&yt.Open)===yt.Open),n===void 0)throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[c,f]=h.useState(n?"visible":"hidden"),m=vu(()=>{n||f("hidden")}),[p,d]=h.useState(!0),g=h.useRef([n]);me(()=>{p!==!1&&g.current[g.current.length-1]!==n&&(g.current.push(n),d(!1))},[g,n]);let v=h.useMemo(()=>({show:n,appear:r,initial:p}),[n,r,p]);me(()=>{n?f("visible"):!di(m)&&o.current!==null&&f("hidden")},[n,m]);let b={unmount:i},x=te(()=>{var C;p&&d(!1),(C=e.beforeEnter)==null||C.call(e)}),w=te(()=>{var C;p&&d(!1),(C=e.beforeLeave)==null||C.call(e)}),T=it();return h.createElement(fi.Provider,{value:m},h.createElement(ci.Provider,{value:v},T({ourProps:{...b,as:h.Fragment,children:h.createElement(Eu,{ref:l,...b,...s,beforeEnter:x,beforeLeave:w})},theirProps:{},defaultTag:h.Fragment,features:wu,visible:c==="visible",name:"Transition"})))}function Jy(e,t){let n=h.useContext(ci)!==null,r=Xs()!==null;return h.createElement(h.Fragment,null,!n&&r?h.createElement(eo,{ref:t,...e}):h.createElement(Eu,{ref:t,...e}))}let eo=Qe(Ky),Eu=Qe(Wy),Yy=Qe(Jy),Su=Object.assign(eo,{Child:Yy,Root:eo});function Gy(e,t){let n=h.useRef({left:0,top:0});if(me(()=>{if(!t)return;let i=t.getBoundingClientRect();i&&(n.current=i)},[e,t]),t==null||!e||t===document.activeElement)return!1;let r=t.getBoundingClientRect();return r.top!==n.current.top||r.left!==n.current.left}let Tu=/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g;function _u(e){var t,n;let r=(t=e.innerText)!=null?t:"",i=e.cloneNode(!0);if(!(i instanceof HTMLElement))return r;let s=!1;for(let a of i.querySelectorAll('[hidden],[aria-hidden],[role="img"]'))a.remove(),s=!0;let o=s?(n=i.innerText)!=null?n:"":r;return Tu.test(o)&&(o=o.replace(Tu,"")),o}function Xy(e){let t=e.getAttribute("aria-label");if(typeof t=="string")return t.trim();let n=e.getAttribute("aria-labelledby");if(n){let r=n.split(" ").map(i=>{let s=document.getElementById(i);if(s){let o=s.getAttribute("aria-label");return typeof o=="string"?o.trim():_u(s).trim()}return null}).filter(Boolean);if(r.length>0)return r.join(", ")}return _u(e).trim()}function Qy(e){let t=h.useRef(""),n=h.useRef("");return te(()=>{let r=e.current;if(!r)return"";let i=r.innerText;if(t.current===i)return n.current;let s=Xy(r).trim().toLowerCase();return t.current=i,n.current=s,s})}var Zy=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(Zy||{}),eb=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(eb||{}),tb=(e=>(e[e.Pointer=0]="Pointer",e[e.Other=1]="Other",e))(tb||{}),nb=(e=>(e[e.OpenListbox=0]="OpenListbox",e[e.CloseListbox=1]="CloseListbox",e[e.GoToOption=2]="GoToOption",e[e.Search=3]="Search",e[e.ClearSearch=4]="ClearSearch",e[e.RegisterOption=5]="RegisterOption",e[e.UnregisterOption=6]="UnregisterOption",e[e.SetButtonElement=7]="SetButtonElement",e[e.SetOptionsElement=8]="SetOptionsElement",e))(nb||{});function to(e,t=n=>n){let n=e.activeOptionIndex!==null?e.options[e.activeOptionIndex]:null,r=Nl(t(e.options.slice()),s=>s.dataRef.current.domRef.current),i=n?r.indexOf(n):null;return i===-1&&(i=null),{options:r,activeOptionIndex:i}}let rb={1(e){return e.dataRef.current.disabled||e.listboxState===1?e:{...e,activeOptionIndex:null,listboxState:1,__demoMode:!1}},0(e){if(e.dataRef.current.disabled||e.listboxState===0)return e;let t=e.activeOptionIndex,{isSelected:n}=e.dataRef.current,r=e.options.findIndex(i=>n(i.dataRef.current.value));return r!==-1&&(t=r),{...e,listboxState:0,activeOptionIndex:t,__demoMode:!1}},2(e,t){var n,r,i,s,o;if(e.dataRef.current.disabled||e.listboxState===1)return e;let a={...e,searchQuery:"",activationTrigger:(n=t.trigger)!=null?n:1,__demoMode:!1};if(t.focus===Fe.Nothing)return{...a,activeOptionIndex:null};if(t.focus===Fe.Specific)return{...a,activeOptionIndex:e.options.findIndex(c=>c.id===t.id)};if(t.focus===Fe.Previous){let c=e.activeOptionIndex;if(c!==null){let f=e.options[c].dataRef.current.domRef,m=Qs(t,{resolveItems:()=>e.options,resolveActiveIndex:()=>e.activeOptionIndex,resolveId:p=>p.id,resolveDisabled:p=>p.dataRef.current.disabled});if(m!==null){let p=e.options[m].dataRef.current.domRef;if(((r=f.current)==null?void 0:r.previousElementSibling)===p.current||((i=p.current)==null?void 0:i.previousElementSibling)===null)return{...a,activeOptionIndex:m}}}}else if(t.focus===Fe.Next){let c=e.activeOptionIndex;if(c!==null){let f=e.options[c].dataRef.current.domRef,m=Qs(t,{resolveItems:()=>e.options,resolveActiveIndex:()=>e.activeOptionIndex,resolveId:p=>p.id,resolveDisabled:p=>p.dataRef.current.disabled});if(m!==null){let p=e.options[m].dataRef.current.domRef;if(((s=f.current)==null?void 0:s.nextElementSibling)===p.current||((o=p.current)==null?void 0:o.nextElementSibling)===null)return{...a,activeOptionIndex:m}}}}let l=to(e),u=Qs(t,{resolveItems:()=>l.options,resolveActiveIndex:()=>l.activeOptionIndex,resolveId:c=>c.id,resolveDisabled:c=>c.dataRef.current.disabled});return{...a,...l,activeOptionIndex:u}},3:(e,t)=>{if(e.dataRef.current.disabled||e.listboxState===1)return e;let n=e.searchQuery!==""?0:1,r=e.searchQuery+t.value.toLowerCase(),i=(e.activeOptionIndex!==null?e.options.slice(e.activeOptionIndex+n).concat(e.options.slice(0,e.activeOptionIndex+n)):e.options).find(o=>{var a;return!o.dataRef.current.disabled&&((a=o.dataRef.current.textValue)==null?void 0:a.startsWith(r))}),s=i?e.options.indexOf(i):-1;return s===-1||s===e.activeOptionIndex?{...e,searchQuery:r}:{...e,searchQuery:r,activeOptionIndex:s,activationTrigger:1}},4(e){return e.dataRef.current.disabled||e.listboxState===1||e.searchQuery===""?e:{...e,searchQuery:""}},5:(e,t)=>{let n={id:t.id,dataRef:t.dataRef},r=to(e,i=>[...i,n]);return e.activeOptionIndex===null&&e.dataRef.current.isSelected(t.dataRef.current.value)&&(r.activeOptionIndex=r.options.indexOf(n)),{...e,...r}},6:(e,t)=>{let n=to(e,r=>{let i=r.findIndex(s=>s.id===t.id);return i!==-1&&r.splice(i,1),r});return{...e,...n,activationTrigger:1}},7:(e,t)=>e.buttonElement===t.element?e:{...e,buttonElement:t.element},8:(e,t)=>e.optionsElement===t.element?e:{...e,optionsElement:t.element}},no=h.createContext(null);no.displayName="ListboxActionsContext";function pi(e){let t=h.useContext(no);if(t===null){let n=new Error(`<${e} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,pi),n}return t}let hi=h.createContext(null);hi.displayName="ListboxDataContext";function pr(e){let t=h.useContext(hi);if(t===null){let n=new Error(`<${e} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,pr),n}return t}function ib(e,t){return mt(t.type,rb,e,t)}let sb=h.Fragment;function ob(e,t){var n;let r=Cs(),{value:i,defaultValue:s,form:o,name:a,onChange:l,by:u,invalid:c=!1,disabled:f=r||!1,horizontal:m=!1,multiple:p=!1,__demoMode:d=!1,...g}=e;const v=m?"horizontal":"vertical";let b=ft(t),x=pm(s),[w=p?[]:void 0,T]=dm(i,l,x),[C,_]=h.useReducer(ib,{dataRef:h.createRef(),listboxState:d?0:1,options:[],searchQuery:"",activeOptionIndex:null,activationTrigger:1,optionsVisible:!1,buttonElement:null,optionsElement:null,__demoMode:d}),O=h.useRef({static:!1,hold:!1}),A=h.useRef(new Map),N=Lm(u),L=h.useCallback(ie=>mt(P.mode,{1:()=>w.some(he=>N(he,ie)),0:()=>N(w,ie)}),[w]),P=h.useMemo(()=>({...C,value:w,disabled:f,invalid:c,mode:p?1:0,orientation:v,compare:N,isSelected:L,optionsPropsRef:O,listRef:A}),[w,f,c,p,C,A]);me(()=>{C.dataRef.current=P},[P]);let I=P.listboxState===0;eg(I,[P.buttonElement,P.optionsElement],(ie,he)=>{var je;_({type:1}),jl(he,Ls.Loose)||(ie.preventDefault(),(je=P.buttonElement)==null||je.focus())});let R=h.useMemo(()=>({open:P.listboxState===0,disabled:f,invalid:c,value:w}),[P,f,w,c]),z=te(ie=>{let he=P.options.find(je=>je.id===ie);he&&Ae(he.dataRef.current.value)}),Y=te(()=>{if(P.activeOptionIndex!==null){let{dataRef:ie,id:he}=P.options[P.activeOptionIndex];Ae(ie.current.value),_({type:2,focus:Fe.Specific,id:he})}}),H=te(()=>_({type:0})),X=te(()=>_({type:1})),K=un(),Z=te((ie,he,je)=>{K.dispose(),K.microTask(()=>ie===Fe.Specific?_({type:2,focus:Fe.Specific,id:he,trigger:je}):_({type:2,focus:ie,trigger:je}))}),ne=te((ie,he)=>(_({type:5,id:ie,dataRef:he}),()=>_({type:6,id:ie}))),Ae=te(ie=>mt(P.mode,{0(){return T==null?void 0:T(ie)},1(){let he=P.value.slice(),je=he.findIndex(Ht=>N(Ht,ie));return je===-1?he.push(ie):he.splice(je,1),T==null?void 0:T(he)}})),Pe=te(ie=>_({type:3,value:ie})),W=te(()=>_({type:4})),ve=te(ie=>{_({type:7,element:ie})}),Se=te(ie=>{_({type:8,element:ie})}),ae=h.useMemo(()=>({onChange:Ae,registerOption:ne,goToOption:Z,closeListbox:X,openListbox:H,selectActiveOption:Y,selectOption:z,search:Pe,clearSearch:W,setButtonElement:ve,setOptionsElement:Se}),[]),[$e,Te]=Fm({inherit:!0}),Le={ref:b},xt=h.useCallback(()=>{if(x!==void 0)return T==null?void 0:T(x)},[T,x]),_e=it();return h.createElement(Te,{value:$e,props:{htmlFor:(n=P.buttonElement)==null?void 0:n.id},slot:{open:P.listboxState===0,disabled:f}},h.createElement(Ty,null,h.createElement(no.Provider,{value:ae},h.createElement(hi.Provider,{value:P},h.createElement(mu,{value:mt(P.listboxState,{0:yt.Open,1:yt.Closed})},a!=null&&w!=null&&h.createElement(vm,{disabled:f,data:{[a]:w},form:o,onReset:xt}),_e({ourProps:Le,theirProps:g,slot:R,defaultTag:sb,name:"Listbox"}))))))}let ab="button";function lb(e,t){var n;let r=pr("Listbox.Button"),i=pi("Listbox.Button"),s=h.useId(),o=El(),{id:a=o||`headlessui-listbox-button-${s}`,disabled:l=r.disabled||!1,autoFocus:u=!1,...c}=e,f=ft(t,xy(),i.setButtonElement),m=wy(),p=te(P=>{switch(P.key){case Ne.Enter:hm(P.currentTarget);break;case Ne.Space:case Ne.ArrowDown:P.preventDefault(),St.flushSync(()=>i.openListbox()),r.value||i.goToOption(Fe.First);break;case Ne.ArrowUp:P.preventDefault(),St.flushSync(()=>i.openListbox()),r.value||i.goToOption(Fe.Last);break}}),d=te(P=>{switch(P.key){case Ne.Space:P.preventDefault();break}}),g=te(P=>{var I;if(Em(P.currentTarget))return P.preventDefault();r.listboxState===0?(St.flushSync(()=>i.closeListbox()),(I=r.buttonElement)==null||I.focus({preventScroll:!0})):(P.preventDefault(),i.openListbox())}),v=te(P=>P.preventDefault()),b=Cl([a]),x=_m(),{isFocusVisible:w,focusProps:T}=em({autoFocus:u}),{isHovered:C,hoverProps:_}=Zh({isDisabled:l}),{pressed:O,pressProps:A}=om({disabled:l}),N=h.useMemo(()=>({open:r.listboxState===0,active:O||r.listboxState===0,disabled:l,invalid:r.invalid,value:r.value,hover:C,focus:w,autofocus:u}),[r.listboxState,r.value,l,C,w,O,r.invalid,u]),L=yl(m(),{ref:f,id:a,type:tg(e,r.buttonElement),"aria-haspopup":"listbox","aria-controls":(n=r.optionsElement)==null?void 0:n.id,"aria-expanded":r.listboxState===0,"aria-labelledby":b,"aria-describedby":x,disabled:l||void 0,autoFocus:u,onKeyDown:p,onKeyUp:d,onKeyPress:v,onClick:g},T,_,A);return it()({ourProps:L,theirProps:c,slot:N,defaultTag:ab,name:"Listbox.Button"})}let Cu=h.createContext(!1),ub="div",cb=Qr.RenderStrategy|Qr.Static;function fb(e,t){var n,r;let i=h.useId(),{id:s=`headlessui-listbox-options-${i}`,anchor:o,portal:a=!1,modal:l=!0,transition:u=!1,...c}=e,f=vy(o),[m,p]=h.useState(null);f&&(a=!0);let d=pr("Listbox.Options"),g=pi("Listbox.Options"),v=Ds(d.optionsElement),b=Xs(),[x,w]=Vl(u,m,b!==null?(b&yt.Open)===yt.Open:d.listboxState===0);Bm(x,d.buttonElement,g.closeListbox);let T=d.__demoMode?!1:l&&d.listboxState===0;ag(T,v);let C=d.__demoMode?!1:l&&d.listboxState===0;Vm(C,{allowed:h.useCallback(()=>[d.buttonElement,d.optionsElement],[d.buttonElement,d.optionsElement])});let _=d.listboxState!==0,O=Gy(_,d.buttonElement)?!1:x,A=x&&d.listboxState===1,N=Oy(A,d.value),L=te(W=>d.compare(N,W)),P=h.useMemo(()=>{var W;if(f==null||!((W=f==null?void 0:f.to)!=null&&W.includes("selection")))return null;let ve=d.options.findIndex(Se=>L(Se.dataRef.current.value));return ve===-1&&(ve=0),ve},[f,d.options]),I=(()=>{if(f==null)return;if(P===null)return{...f,inner:void 0};let W=Array.from(d.listRef.current.values());return{...f,inner:{listRef:{current:W},index:P}}})(),[R,z]=Sy(I),Y=Ey(),H=ft(t,f?R:null,g.setOptionsElement,p),X=un();h.useEffect(()=>{var W;let ve=d.optionsElement;ve&&d.listboxState===0&&ve!==((W=sr(ve))==null?void 0:W.activeElement)&&(ve==null||ve.focus({preventScroll:!0}))},[d.listboxState,d.optionsElement]);let K=te(W=>{var ve,Se;switch(X.dispose(),W.key){case Ne.Space:if(d.searchQuery!=="")return W.preventDefault(),W.stopPropagation(),g.search(W.key);case Ne.Enter:if(W.preventDefault(),W.stopPropagation(),d.activeOptionIndex!==null){let{dataRef:ae}=d.options[d.activeOptionIndex];g.onChange(ae.current.value)}d.mode===0&&(St.flushSync(()=>g.closeListbox()),(ve=d.buttonElement)==null||ve.focus({preventScroll:!0}));break;case mt(d.orientation,{vertical:Ne.ArrowDown,horizontal:Ne.ArrowRight}):return W.preventDefault(),W.stopPropagation(),g.goToOption(Fe.Next);case mt(d.orientation,{vertical:Ne.ArrowUp,horizontal:Ne.ArrowLeft}):return W.preventDefault(),W.stopPropagation(),g.goToOption(Fe.Previous);case Ne.Home:case Ne.PageUp:return W.preventDefault(),W.stopPropagation(),g.goToOption(Fe.First);case Ne.End:case Ne.PageDown:return W.preventDefault(),W.stopPropagation(),g.goToOption(Fe.Last);case Ne.Escape:W.preventDefault(),W.stopPropagation(),St.flushSync(()=>g.closeListbox()),(Se=d.buttonElement)==null||Se.focus({preventScroll:!0});return;case Ne.Tab:W.preventDefault(),W.stopPropagation(),St.flushSync(()=>g.closeListbox()),Ym(d.buttonElement,W.shiftKey?Ps.Previous:Ps.Next);break;default:W.key.length===1&&(g.search(W.key),X.setTimeout(()=>g.clearSearch(),350));break}}),Z=(n=d.buttonElement)==null?void 0:n.id,ne=h.useMemo(()=>({open:d.listboxState===0}),[d.listboxState]),Ae=yl(f?Y():{},{id:s,ref:H,"aria-activedescendant":d.activeOptionIndex===null||(r=d.options[d.activeOptionIndex])==null?void 0:r.id,"aria-multiselectable":d.mode===1?!0:void 0,"aria-labelledby":Z,"aria-orientation":d.orientation,onKeyDown:K,role:"listbox",tabIndex:d.listboxState===0?0:void 0,style:{...c.style,...z,"--button-width":Im(d.buttonElement,!0).width},...Rl(w)}),Pe=it();return h.createElement(By,{enabled:a?e.static||x:!1},h.createElement(hi.Provider,{value:d.mode===1?d:{...d,isSelected:L}},Pe({ourProps:Ae,theirProps:c,slot:ne,defaultTag:ub,features:cb,visible:O,name:"Listbox.Options"})))}let db="div";function pb(e,t){let n=h.useId(),{id:r=`headlessui-listbox-option-${n}`,disabled:i=!1,value:s,...o}=e,a=h.useContext(Cu)===!0,l=pr("Listbox.Option"),u=pi("Listbox.Option"),c=l.activeOptionIndex!==null?l.options[l.activeOptionIndex].id===r:!1,f=l.isSelected(s),m=h.useRef(null),p=Qy(m),d=cn({disabled:i,value:s,domRef:m,get textValue(){return p()}}),g=ft(t,m,N=>{N?l.listRef.current.set(r,N):l.listRef.current.delete(r)});me(()=>{if(!l.__demoMode&&l.listboxState===0&&c&&l.activationTrigger!==0)return Rt().requestAnimationFrame(()=>{var N,L;(L=(N=m.current)==null?void 0:N.scrollIntoView)==null||L.call(N,{block:"nearest"})})},[m,c,l.__demoMode,l.listboxState,l.activationTrigger,l.activeOptionIndex]),me(()=>{if(!a)return u.registerOption(r,d)},[d,r,a]);let v=te(N=>{var L;if(i)return N.preventDefault();u.onChange(s),l.mode===0&&(St.flushSync(()=>u.closeListbox()),(L=l.buttonElement)==null||L.focus({preventScroll:!0}))}),b=te(()=>{if(i)return u.goToOption(Fe.Nothing);u.goToOption(Fe.Specific,r)}),x=lg(),w=te(N=>{x.update(N),!i&&(c||u.goToOption(Fe.Specific,r,0))}),T=te(N=>{x.wasMoved(N)&&(i||c||u.goToOption(Fe.Specific,r,0))}),C=te(N=>{x.wasMoved(N)&&(i||c&&u.goToOption(Fe.Nothing))}),_=h.useMemo(()=>({active:c,focus:c,selected:f,disabled:i,selectedOption:f&&a}),[c,f,i,a]),O=a?{}:{id:r,ref:g,role:"option",tabIndex:i===!0?void 0:-1,"aria-disabled":i===!0?!0:void 0,"aria-selected":f,disabled:void 0,onClick:v,onFocus:b,onPointerEnter:w,onMouseEnter:w,onPointerMove:T,onMouseMove:T,onPointerLeave:C,onMouseLeave:C},A=it();return!f&&a?null:A({ourProps:O,theirProps:o,slot:_,defaultTag:db,name:"Listbox.Option"})}let hb=h.Fragment;function mb(e,t){let{options:n,placeholder:r,...i}=e,s={ref:ft(t)},o=pr("ListboxSelectedOption"),a=h.useMemo(()=>({}),[]),l=o.value===void 0||o.value===null||o.mode===1&&Array.isArray(o.value)&&o.value.length===0,u=it();return h.createElement(Cu.Provider,{value:!0},u({ourProps:s,theirProps:{...i,children:h.createElement(h.Fragment,null,r&&l?r:n)},slot:a,defaultTag:hb,name:"ListboxSelectedOption"}))}let gb=Qe(ob),yb=Qe(lb),bb=Nm,vb=Qe(fb),xb=Qe(pb),wb=Qe(mb),Gt=Object.assign(gb,{Button:yb,Label:bb,Options:vb,Option:xb,SelectedOption:wb});function Ou({element:e,validationData:t}){var l;const[n,r]=h.useState(e.value||[]),{register:i=()=>({}),setValue:s,getValues:o}=t||{},a=o&&o(e==null?void 0:e.id);return h.useEffect(()=>{i(e.id)},[e.id,i]),h.useEffect(()=>{s&&s(e.id,n)},[e.id,n,s]),h.useEffect(()=>{a!=null&&a.length&&!(n!=null&&n.length)&&r(a)},[a,n==null?void 0:n.length]),y.jsx("div",{className:"w-full z-10",children:y.jsx(Gt,{value:n,onChange:r,multiple:!0,children:y.jsxs("div",{className:"relative",children:[y.jsx(Gt.Button,{className:"w-full py-2 pl-3 pr-10 text-left bg-white input-control cursor-default ",children:(n==null?void 0:n.length)>0?n==null?void 0:n.map(u=>u.label).join(", "):"Select options"}),y.jsx(Su,{as:h.Fragment,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:y.jsx(Gt.Options,{className:"absolute w-full py-1 mt-1 grid gap-y-[1px] bg-white rounded-md shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none sm:text-sm",children:(l=e==null?void 0:e.options)==null?void 0:l.map((u,c)=>y.jsx(Gt.Option,{className:({active:f})=>`cursor-default select-none relative w-full flex justify-between ${f?"text-gray-700 bg-gray-100":"text-gray-700"}`,value:u,children:({selected:f})=>y.jsxs("div",{className:`flex items-center justify-between py-2 pl-4 pr-4 w-full ${f?"bg-gray-100":""}`,children:[y.jsx("span",{className:`block truncate ${f?"font-medium":"font-normal"}`,children:u==null?void 0:u.label}),f?y.jsx("span",{className:"absolute inset-y-0 right-3 flex items-center pl-3 text-gray-600",children:"✓"}):null]})},c))})})]})})})}function ku({element:e,validationData:t}){const{register:n=()=>({})}=t||{};return y.jsx("input",{placeholder:e.placeholder,type:e.inputType,className:"input-control",...n(e.id)})}function Eb({onFileLoaded:e,disabled:t}){const[n,r]=h.useState(null),i=s=>{var l;const o=(l=s.target.files)==null?void 0:l[0];if(!o)return;const a=new FileReader;a.onloadend=()=>{const u=a.result;e({base64:u,type:o.type,name:o.name}),r(null)},a.onerror=()=>{r("Failed to read file.")},a.readAsDataURL(o)};return y.jsxs("div",{className:"flex flex-col items-start gap-2",children:[y.jsx("input",{type:"file",onChange:i,disabled:t,className:`block w-full text-sm text-gray-500 file:mr-4 file:px-4 input-control !py-1 !pl-1\r
|
|
52
|
+
file:rounded-[6px] file:py-[6px] file:border-0\r
|
|
53
|
+
file:text-sm file:font-semibold\r
|
|
54
|
+
file:bg-blue-50 file:text-blue-700\r
|
|
55
|
+
hover:file:bg-blue-100`}),n&&y.jsx("p",{className:"text-red-500 text-sm",children:n})]})}const Sb=["jpg","jpeg","png","gif","bmp","webp","svg","image"],Fu={pdf:"/pdf-icon.png",word:"/word-icon.png",excel:"/excel-icon.png",powerpoint:"/ppt-icon.png",other:"/file-icon.png"},Tb=(e="")=>{var n;const t=((n=e.split(".").pop())==null?void 0:n.toLowerCase())||"";return Sb.includes(t)||e.startsWith("data:image/")?"image":["pdf"].includes(t)||e.startsWith("data:application/pdf")?"pdf":["doc","docx"].includes(t)||e.startsWith("data:application/msword")||e.startsWith("data:application/vnd.openxmlformats-officedocument.wordprocessingml.document")?"word":["xls","xlsx","csv"].includes(t)||e.startsWith("data:application/vnd.ms-excel")||e.startsWith("data:application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")?"excel":["ppt","pptx"].includes(t)||e.startsWith("data:application/vnd.ms-powerpoint")||e.startsWith("data:application/vnd.openxmlformats-officedocument.presentationml.presentation")?"powerpoint":["txt"].includes(t)||e.startsWith("data:text/")?"text":["zip","rar","7z","tar","gz"].includes(t)?"archive":["mp4","mkv","webm","avi","mov"].includes(t)||e.startsWith("data:video/")?"video":["mp3","wav","flac","aac","ogg"].includes(t)||e.startsWith("data:audio/")?"audio":"other"},_b=({fileUrl:e,fileName:t})=>{const[n,r]=h.useState(!1),[i,s]=h.useState("unknown");h.useEffect(()=>{e&&s(Tb(e))},[e]);const o=()=>{i==="image"?r(!0):window.open(e,"_blank")},a=()=>r(!1),l=()=>{if(i==="image")return y.jsx("button",{className:"btn btn-view text-sm font-semibold",type:"button","aria-label":"Preview file",children:y.jsx("span",{children:"Preview File"})});const u=Fu[i]||Fu.other;return y.jsxs("div",{onClick:o,className:"cursor-pointer border border-gray-200 bg-gray-200 rounded p-2 flex flex-col items-center justify-center hover:shadow",title:`Click to ${i==="pdf"?"open":"download"} ${t||"file"}`,children:[i==="image"&&y.jsx("div",{className:"w-14 h-14 flex items-center justify-center mb-2",children:y.jsx("img",{src:u,alt:`${i} icon`,className:"max-w-full max-h-full"})}),y.jsx("div",{className:"text-xs text-gray-700 truncate w-full text-center",children:t||(e==null?void 0:e.split("/").pop())||"Unknown file"})]})};return y.jsxs("div",{className:"mt-2",children:[y.jsx("div",{onClick:o,children:l()}),n&&i==="image"&&y.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex justify-center items-center z-50",onClick:a,children:y.jsxs("div",{className:"relative bg-white p-5 rounded-lg max-w-[90vw] max-h-[90vh] overflow-auto",onClick:u=>u.stopPropagation(),children:[y.jsx("button",{onClick:a,className:"absolute top-2 right-2 text-2xl font-bold text-gray-700","aria-label":"Close preview",children:"×"}),y.jsx("img",{src:e||"/place.png",alt:t||"Full Image",className:"max-w-full max-h-[80vh] mx-auto object-contain"})]})})]})};function Au({element:e,validationData:t}){const[n,r]=h.useState((e==null?void 0:e.value)??null),{register:i=()=>({}),setValue:s,isReadOnly:o}=t||{};return h.useEffect(()=>{i(e.id)},[e.id,i]),y.jsxs("div",{children:[y.jsx(Eb,{onFileLoaded:a=>{s(e.id,a),r(a)},disabled:o}),n&&y.jsx(_b,{fileUrl:n.base64,fileName:n.name})]})}const Cb=({element:e})=>{const t=h.useMemo(()=>Array.from({length:e.grid},(n,r)=>r),[e.grid]);return y.jsx("div",{className:"grid p-3",style:{gridTemplateColumns:`repeat(${e.grid}, 1fr)`,gap:"8px"},children:t.map(n=>y.jsx("div",{className:"border rounded p-4 min-h-[80px] transition-colors hover:border-gray-400",children:n},n))})},$u=h.memo(Cb);function ju({element:e,validationData:t}){const{register:n=()=>({})}=t||{};return y.jsx("input",{placeholder:e.placeholder,type:e.inputType,className:"input-control",...n(e.id)})}var ce=function(){return ce=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},ce.apply(this,arguments)};function Ob(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function ot(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,s;r<i;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var Ot=function(e){return e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")},kb={k:1e3,m:1e6,b:1e9},Fb=function(e,t){t===void 0&&(t=".");var n=new RegExp("(\\d+(".concat(Ot(t),"\\d*)?)([kmb])$"),"i"),r=e.match(n);if(r){var i=r[1],s=r[3],o=kb[s.toLowerCase()];return Number(i.replace(t,"."))*o}},Ab=function(e,t){t===void 0&&(t=",");var n=new RegExp(Ot(t),"g");return e.replace(n,"")},$b=function(e,t){var n=Ot(t.join("")),r=new RegExp("[^\\d".concat(n,"]"),"gi");return e.replace(r,"")},ro=function(e){var t=e.value,n=e.groupSeparator,r=n===void 0?",":n,i=e.decimalSeparator,s=i===void 0?".":i,o=e.allowDecimals,a=o===void 0?!0:o,l=e.decimalsLimit,u=l===void 0?2:l,c=e.allowNegativeValue,f=c===void 0?!0:c,m=e.disableAbbreviations,p=m===void 0?!1:m,d=e.prefix,g=d===void 0?"":d,v=e.transformRawValue,b=v===void 0?function(ne){return ne}:v,x=b(t);if(x==="-")return x;var w=p?[]:["k","m","b"],T=new RegExp("((^|\\D)-\\d)|(-".concat(Ot(g),")")),C=T.test(x),_=RegExp("(\\d+)-?".concat(Ot(g))).exec(t)||[],O=_[0],A=_[1],N=g?O?x.replace(O,"").concat(A):x.replace(g,""):x,L=Ab(N,r),P=$b(L,ot([r,s],w,!0)),I=P;if(!p){if(w.some(function(ne){return ne===P.toLowerCase().replace(s,"")}))return"";var R=Fb(P,s);R&&(I=String(R))}var z=C&&f?"-":"";if(s&&I.includes(s)){var Y=P.split(s),H=Y[0],X=Y[1],K=u&&X?X.slice(0,u):X,Z=a?"".concat(s).concat(K):"";return"".concat(z).concat(H).concat(Z)}return"".concat(z).concat(I)},jb=function(e,t,n){if(n!==void 0&&e.length>1){if(n===0)return e.replace(t,"");if(e.includes(t)){var r=e.split(t),i=r[0],s=r[1];if(s.length===n)return e;if(s.length>n)return"".concat(i).concat(t).concat(s.slice(0,n))}var o=e.length>n?new RegExp("(\\d+)(\\d{".concat(n,"})")):new RegExp("(\\d)(\\d+)"),a=e.match(o);if(a){var i=a[1],s=a[2];return"".concat(i).concat(t).concat(s)}}return e},Nu=function(e,t){var n=t.groupSeparator,r=n===void 0?",":n,i=t.decimalSeparator,s=i===void 0?".":i,o=new RegExp("\\d([^".concat(Ot(r)).concat(Ot(s),"0-9]+)")),a=e.match(o);return a?a[1]:void 0},hr=function(e){var t=e.value,n=e.decimalSeparator,r=e.intlConfig,i=e.decimalScale,s=e.prefix,o=s===void 0?"":s,a=e.suffix,l=a===void 0?"":a;if(t===""||t===void 0)return"";if(t==="-")return"-";var u=new RegExp("^\\d?-".concat(o?"".concat(Ot(o),"?"):"","\\d")).test(t),c=n!=="."?Nb(t,n,u):t;n&&n!=="-"&&c.startsWith(n)&&(c="0"+c);var f={minimumFractionDigits:i||0,maximumFractionDigits:20},m=r?new Intl.NumberFormat(r.locale,r.currency?ce(ce({},f),{style:"currency",currency:r.currency}):f):new Intl.NumberFormat(void 0,f),p=m.formatToParts(Number(c)),d=Pb(p,e),g=Nu(d,ce({},e)),v=t.slice(-1)===n?n:"",b=c.match(RegExp("\\d+\\.(\\d+)"))||[],x=b[1];return i===void 0&&x&&n&&(d.includes(n)?d=d.replace(RegExp("(\\d+)(".concat(Ot(n),")(\\d+)"),"g"),"$1$2".concat(x)):g&&!l?d=d.replace(g,"".concat(n).concat(x).concat(g)):d="".concat(d).concat(n).concat(x)),l&&v?"".concat(d).concat(v).concat(l):g&&v?d.replace(g,"".concat(v).concat(g)):g&&l?d.replace(g,"".concat(v).concat(l)):[d,v,l].join("")},Nb=function(e,t,n){var r=e;return t&&t!=="."&&(r=r.replace(RegExp(Ot(t),"g"),"."),n&&t==="-"&&(r="-".concat(r.slice(1)))),r},Pb=function(e,t){var n=t.prefix,r=t.groupSeparator,i=t.decimalSeparator,s=t.decimalScale,o=t.disableGroupSeparators,a=o===void 0?!1:o;return e.reduce(function(l,u,c){var f=u.type,m=u.value;return c===0&&n?f==="minusSign"?[m,n]:f==="currency"?ot(ot([],l,!0),[n],!1):[n,m]:f==="currency"?n?l:ot(ot([],l,!0),[m],!1):f==="group"?a?l:ot(ot([],l,!0),[r!==void 0?r:m],!1):f==="decimal"?s!==void 0&&s===0?l:ot(ot([],l,!0),[i!==void 0?i:m],!1):f==="fraction"?ot(ot([],l,!0),[s!==void 0?m.slice(0,s):m],!1):ot(ot([],l,!0),[m],!1)},[""]).join("")},Lb={currencySymbol:"",groupSeparator:"",decimalSeparator:"",prefix:"",suffix:""},Db=function(e){var t=e||{},n=t.locale,r=t.currency,i=n?new Intl.NumberFormat(n,r?{currency:r,style:"currency"}:void 0):new Intl.NumberFormat;return i.formatToParts(1000.1).reduce(function(s,o,a){return o.type==="currency"?a===0?ce(ce({},s),{currencySymbol:o.value,prefix:o.value}):ce(ce({},s),{currencySymbol:o.value,suffix:o.value}):o.type==="group"?ce(ce({},s),{groupSeparator:o.value}):o.type==="decimal"?ce(ce({},s),{decimalSeparator:o.value}):s},Lb)},Pu=function(e){return RegExp(/\d/,"gi").test(e)},Ib=function(e,t,n){if(t===void 0&&(t="."),n===void 0||e===""||e===void 0)return e;if(!e.match(/\d/g))return"";var r=e.split(t),i=r[0],s=r[1];if(n===0)return i;var o=s||"";if(o.length<n)for(;o.length<n;)o+="0";else o=o.slice(0,n);return"".concat(i).concat(t).concat(o)},Mb=function(e){var t=e.selectionStart,n=e.value,r=e.lastKeyStroke,i=e.stateValue,s=e.groupSeparator,o=t,a=n;if(i&&o){var l=n.split("");return r==="Backspace"&&i[o]===s&&(l.splice(o-1,1),o-=1),r==="Delete"&&i[o]===s&&(l.splice(o,1),o+=1),a=l.join(""),{modifiedValue:a,cursorPosition:o}}return{modifiedValue:a,cursorPosition:t}},mi=h.forwardRef(function(e,t){var n=e.allowDecimals,r=n===void 0?!0:n,i=e.allowNegativeValue,s=i===void 0?!0:i,o=e.id,a=e.name,l=e.className,u=e.customInput,c=e.decimalsLimit,f=e.defaultValue,m=e.disabled,p=m===void 0?!1:m,d=e.maxLength,g=e.value,v=e.onValueChange,b=e.fixedDecimalLength,x=e.placeholder,w=e.decimalScale,T=e.prefix,C=e.suffix,_=e.intlConfig,O=e.step,A=e.min,N=e.max,L=e.disableGroupSeparators,P=L===void 0?!1:L,I=e.disableAbbreviations,R=I===void 0?!1:I,z=e.decimalSeparator,Y=e.groupSeparator,H=e.onChange,X=e.onFocus,K=e.onBlur,Z=e.onKeyDown,ne=e.onKeyUp,Ae=e.transformRawValue,Pe=e.formatValueOnBlur,W=Pe===void 0?!0:Pe,ve=Ob(e,["allowDecimals","allowNegativeValue","id","name","className","customInput","decimalsLimit","defaultValue","disabled","maxLength","value","onValueChange","fixedDecimalLength","placeholder","decimalScale","prefix","suffix","intlConfig","step","min","max","disableGroupSeparators","disableAbbreviations","decimalSeparator","groupSeparator","onChange","onFocus","onBlur","onKeyDown","onKeyUp","transformRawValue","formatValueOnBlur"]);if(z&&Pu(z))throw new Error("decimalSeparator cannot be a number");if(Y&&Pu(Y))throw new Error("groupSeparator cannot be a number");var Se=h.useMemo(function(){return Db(_)},[_]),ae=z||Se.decimalSeparator||"",$e=Y||Se.groupSeparator||"";if(ae&&$e&&ae===$e&&P===!1)throw new Error("decimalSeparator cannot be the same as groupSeparator");var Te={decimalSeparator:ae,groupSeparator:$e,disableGroupSeparators:P,intlConfig:_,prefix:T||Se.prefix,suffix:C},Le={decimalSeparator:ae,groupSeparator:$e,allowDecimals:r,decimalsLimit:c||b||2,allowNegativeValue:s,disableAbbreviations:R,prefix:T||Se.prefix,transformRawValue:Ae},xt=h.useState(function(){return f!=null?hr(ce(ce({},Te),{decimalScale:w,value:String(f)})):g!=null?hr(ce(ce({},Te),{decimalScale:w,value:String(g)})):""}),_e=xt[0],ie=xt[1],he=h.useState(!1),je=he[0],Ht=he[1],qt=h.useState(0),En=qt[0],S=qt[1],k=h.useState(0),j=k[0],B=k[1],V=h.useState(null),M=V[0],J=V[1],G=h.useRef(null);h.useImperativeHandle(t,function(){return G.current});var ge=function(ye,ze){Ht(!0);var Re=Mb({selectionStart:ze,value:ye,lastKeyStroke:M,stateValue:_e,groupSeparator:$e}),We=Re.modifiedValue,Ve=Re.cursorPosition,Ge=ro(ce({value:We},Le));if(!(d&&Ge.replace(/-/g,"").length>d)){if(Ge===""||Ge==="-"||Ge===ae){v&&v(void 0,a,{float:null,formatted:"",value:""}),ie(Ge),S(1);return}var Et=ae?Ge.replace(ae,"."):Ge,Ar=parseFloat(Et),Tn=hr(ce({value:Ge},Te));if(Ve!=null){var _n=Ve+(Tn.length-ye.length);_n=_n<=0?T?T.length:0:_n,S(_n),B(j+1)}if(ie(Tn),v){var Wo={float:Ar,formatted:Tn,value:Ge};v(Ge,a,Wo)}}},pe=function(ye){var ze=ye.target,Re=ze.value,We=ze.selectionStart;ge(Re,We),H&&H(ye)},wt=function(ye){return X&&X(ye),_e?_e.length:0},Vn=function(ye){var ze=ye.target.value,Re=ro(ce({value:ze},Le));if(Re==="-"||Re===ae||!Re){ie(""),K&&K(ye);return}var We=jb(Re,ae,b),Ve=Ib(We,ae,w!==void 0?w:b),Ge=parseFloat(Ve.replace(ae,".")),Et=hr(ce(ce({},Te),{value:Ve}));v&&W&&v(Ve,a,{float:Ge,formatted:Et,value:Ve}),ie(Et),K&&K(ye)},en=function(ye){var ze=ye.key;if(J(ze),O&&(ze==="ArrowUp"||ze==="ArrowDown")){ye.preventDefault(),S(_e.length);var Re=parseFloat(g!=null?String(g).replace(ae,"."):ro(ce({value:_e},Le)))||0,We=ze==="ArrowUp"?Re+O:Re-O;if(A!==void 0&&We<Number(A)||N!==void 0&&We>Number(N))return;var Ve=String(O).includes(".")?Number(String(O).split(".")[1].length):void 0;ge(String(Ve?We.toFixed(Ve):We).replace(".",ae))}Z&&Z(ye)},zt=function(ye){var ze=ye.key,Re=ye.currentTarget.selectionStart;if(ze!=="ArrowUp"&&ze!=="ArrowDown"&&_e!=="-"){var We=Nu(_e,{groupSeparator:$e,decimalSeparator:ae});if(We&&Re&&Re>_e.length-We.length&&G.current){var Ve=_e.length-We.length;G.current.setSelectionRange(Ve,Ve)}}ne&&ne(ye)};h.useEffect(function(){g==null&&f==null&&ie("")},[f,g]),h.useEffect(function(){je&&_e!=="-"&&G.current&&document.activeElement===G.current&&G.current.setSelectionRange(En,En)},[_e,En,G,je,j]);var kr=function(){return g!=null&&_e!=="-"&&(!ae||_e!==ae)?hr(ce(ce({},Te),{decimalScale:je?void 0:w,value:String(g)})):_e},Sn=ce({type:"text",inputMode:"decimal",id:o,name:a,className:l,onChange:pe,onBlur:Vn,onFocus:wt,onKeyDown:en,onKeyUp:zt,placeholder:x,disabled:p,value:kr(),ref:G},ve);if(u){var Fr=u;return h.createElement(Fr,ce({},Sn))}return h.createElement("input",ce({},Sn))});mi.displayName="CurrencyInput";const xe=({label:e,name:t,register:n,errors:r,className:i,type:s="text",placeholder:o="",isFloating:a,setValue:l,value:u,trigger:c,prefix:f,disabled:m})=>{var d,g,v,b;const p=n?{...n(t)}:{};return s==="amount"?y.jsxs("div",{className:"space-y-1.5 relative",children:[y.jsx("label",{className:`block text-sm font-medium text-[#344054] font-onest ${a?"z-[40] absolute block text-[#667085] bg-white py-[2px] px-1 -top-[10px] left-3 ":"relative"}`,children:e}),y.jsx(mi,{onValueChange:x=>{l(t,x),n&&n(t),c&&c(t)},placeholder:o,className:`input-control ${r!=null&&r[t]?"border-red-300":"border-[#D0D5DD]"}`,decimalsLimit:2,value:u,prefix:f,disabled:m}),(r==null?void 0:r[t])&&y.jsx("p",{className:"mt-1 text-sm text-red-600",children:(d=r[t])==null?void 0:d.message})]}):["checkbox","radio"].includes(s)?y.jsxs("div",{children:[y.jsxs("label",{className:"flex items-center space-x-2",children:[y.jsx("input",{...p,type:s,className:"h-4 w-4 rounded border-gray-300",value:u,disabled:m}),y.jsx("span",{className:"text-sm font-medium text-[#344054] font-onest",children:e})]}),(r==null?void 0:r[t])&&y.jsx("p",{className:"ml-2 text-sm text-red-600",children:(g=r[t])==null?void 0:g.message})]}):s==="textarea"?y.jsxs("div",{className:"space-y-1.5 relative",children:[y.jsx("label",{className:`block text-sm font-medium text-[#344054] font-onest ${a?"z-[40] absolute block text-[#667085] bg-white py-[2px] px-1 -top-[10px] left-3 ":"relative"}`,children:e}),y.jsx("textarea",{...p,className:`input-control ${r!=null&&r[t]?"border-red-300":"border-[#D0D5DD]"} ${i}`,placeholder:o,disabled:m}),(r==null?void 0:r[t])&&y.jsx("p",{className:"mt-1 text-sm text-red-600",children:(v=r[t])==null?void 0:v.message})]}):y.jsxs("div",{className:"space-y-1.5 relative",children:[y.jsx("label",{className:`block text-sm font-medium text-[#344054] font-onest ${a?"z-[40] absolute block text-[#667085] bg-white py-[2px] px-1 -top-[10px] left-3":"relative"}`,children:e}),y.jsx("input",{...p,type:s,className:`input-control ${r!=null&&r[t]?"border-red-300":"border-[#D0D5DD]"} ${i}`,placeholder:a?"":o,disabled:m}),(r==null?void 0:r[t])&&y.jsx("p",{className:"mt-1 text-sm text-red-600",children:(b=r[t])==null?void 0:b.message})]})};function Lu({element:e,validationData:t}){const{register:n=()=>({})}=t||{};return y.jsx("div",{className:"flex flex-wrap gap-y-4 gap-x-6",children:e==null?void 0:e.options.map(r=>y.jsx("div",{children:y.jsx(xe,{placeholder:e.placeholder,type:e.inputType,label:r==null?void 0:r.label,register:n,name:e.id,value:r.value})},r.id))})}function Du({element:e,state:t}){return y.jsx("div",{children:"SectionInput"})}function Iu({element:e,validationData:t}){const{register:n=()=>({})}=t||{};return y.jsx("div",{className:"flex flex-wrap gap-y-4 gap-x-6",children:e==null?void 0:e.options.map(r=>y.jsx("div",{children:y.jsx(xe,{placeholder:e.placeholder,type:e.inputType,label:r==null?void 0:r.label,register:n,name:e.id,value:r.value})},r.id))})}const io=({className:e="",options:t,placeholder:n="Select",errors:r,register:i,setValue:s,name:o,label:a,value:l,trigger:u,isMultiple:c,isFloatingLabel:f,subText:m,labelClass:p="text-[10px]",loading:d})=>{const[g,v]=h.useState(c?[]:null),b=ut("input-control",e);return h.useEffect(()=>{g&&s&&i&&(s(o,g==null?void 0:g.value),i&&i(o),u&&u(o))},[o,i,g,s,u]),h.useEffect(()=>{const x=t==null?void 0:t.find(w=>typeof w.value=="string"&&typeof l=="string"?w.value.toLowerCase()===l.toLowerCase():typeof w.value=="object"&&typeof l=="object"?w.value.id===(l==null?void 0:l.id):w.value===l);v(x||null)},[l,t]),y.jsxs("div",{className:"relative",children:[!f&&a&&y.jsx("label",{className:"block text-sm text-[#686878] darks:!text-white/70 mb-2",children:a}),f&&y.jsx("label",{className:`z-[40] absolute block text-[#667085] bg-white py-[2px] px-1 -top-[10px] left-3 ${p}`,children:a}),y.jsx(Gt,{value:g,onChange:v,multiple:c,children:y.jsxs("div",{className:"relative",children:[y.jsxs(Gt.Button,{className:b,children:[d?y.jsx("span",{className:" block opacity-60 text-sm text-left",children:"Fetching data ..."}):y.jsx("span",{className:"block truncate text-sm text-left",children:(g==null?void 0:g.label)||y.jsx("span",{className:"opacity-60",children:n})}),y.jsx("span",{className:"pointer-events-none absolute inset-y-0 right-0 flex items-center pr-2",children:y.jsx(Be,{icon:"lucide:chevron-down"})})]}),y.jsx(Su,{as:h.Fragment,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:y.jsx(Gt.Options,{className:"z-[77] absolute mt-1 max-h-60 w-full overflow-auto rounded-md bg-white darks:bg-gray-800 text-gray-900 darks:text-white/80 py-1 text-base shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none sm:text-sm",children:t==null?void 0:t.map((x,w)=>y.jsx(Gt.Option,{className:({active:T})=>`relative cursor-default select-none py-2 pl-4 pr-4 text-sm ${T?"bg-gray-100 darks:bg-gray-700 text-gray-900 darks:text-white/80":"text-gray-900 darks:text-white/70 "}`,value:x,children:({selected:T})=>y.jsx("div",{className:`block truncate text-sm ${T?"font-medium":"font-normal"}`,children:x.label})},w))})})]})}),!r&&m&&y.jsx("p",{className:"text-[10px] text-[#98A2B3] leading-normal mt-[6px]",children:m}),r&&y.jsx("span",{className:"text-sm text-red-500",children:r.message})]})};function Mu({element:e,validationData:t}){const{register:n=()=>({}),trigger:r,setValue:i,watch:s}=t||{};let o;return s&&(o=s()[e.id]),h.useEffect(()=>{n(e.id)},[e.id,n]),y.jsx("div",{children:y.jsx(io,{options:(e==null?void 0:e.options)??[],register:n,name:e.id,setValue:i,trigger:r,value:o})})}function Ru({element:e,validationData:t}){const{register:n=()=>({})}=t||{};return y.jsx("textarea",{placeholder:e.placeholder,rows:4,className:"input-control resize-none",...n(e.id)})}var mr=e=>e.type==="checkbox",mn=e=>e instanceof Date,Je=e=>e==null;const Vu=e=>typeof e=="object";var we=e=>!Je(e)&&!Array.isArray(e)&&Vu(e)&&!mn(e),Rb=e=>we(e)&&e.target?mr(e.target)?e.target.checked:e.target.value:e,Vb=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,Bb=(e,t)=>e.has(Vb(t)),Ub=e=>{const t=e.constructor&&e.constructor.prototype;return we(t)&&t.hasOwnProperty("isPrototypeOf")},so=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Me(e){let t;const n=Array.isArray(e),r=typeof FileList<"u"?e instanceof FileList:!1;if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else if(!(so&&(e instanceof Blob||r))&&(n||we(e)))if(t=n?[]:{},!n&&!Ub(e))t=e;else for(const i in e)e.hasOwnProperty(i)&&(t[i]=Me(e[i]));else return e;return t}var gr=e=>Array.isArray(e)?e.filter(Boolean):[],de=e=>e===void 0,U=(e,t,n)=>{if(!t||!we(e))return n;const r=gr(t.split(/[,[\].]+?/)).reduce((i,s)=>Je(i)?i:i[s],e);return de(r)||r===e?de(e[t])?n:e[t]:r},kt=e=>typeof e=="boolean",oo=e=>/^\w*$/.test(e),Bu=e=>gr(e.replace(/["|']|\]/g,"").split(/\.|\[/)),oe=(e,t,n)=>{let r=-1;const i=oo(t)?[t]:Bu(t),s=i.length,o=s-1;for(;++r<s;){const a=i[r];let l=n;if(r!==o){const u=e[a];l=we(u)||Array.isArray(u)?u:isNaN(+i[r+1])?{}:[]}if(a==="__proto__"||a==="constructor"||a==="prototype")return;e[a]=l,e=e[a]}return e};const Uu={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},dt={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Vt={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},Hu=h.createContext(null),Hb=()=>h.useContext(Hu),qb=e=>{const{children:t,...n}=e;return h.createElement(Hu.Provider,{value:n},t)};var zb=(e,t,n,r=!0)=>{const i={defaultValues:t._defaultValues};for(const s in e)Object.defineProperty(i,s,{get:()=>{const o=s;return t._proxyFormState[o]!==dt.all&&(t._proxyFormState[o]=!r||dt.all),e[o]}});return i},Ye=e=>we(e)&&!Object.keys(e).length,Wb=(e,t,n,r)=>{n(e);const{name:i,...s}=e;return Ye(s)||Object.keys(s).length>=Object.keys(t).length||Object.keys(s).find(o=>t[o]===dt.all)},at=e=>Array.isArray(e)?e:[e];function qu(e){const t=h.useRef(e);t.current=e,h.useEffect(()=>{const n=!e.disabled&&t.current.subject&&t.current.subject.subscribe({next:t.current.next});return()=>{n&&n.unsubscribe()}},[e.disabled])}var Ft=e=>typeof e=="string",Kb=(e,t,n,r,i)=>Ft(e)?(r&&t.watch.add(e),U(n,e,i)):Array.isArray(e)?e.map(s=>(r&&t.watch.add(s),U(n,s))):(r&&(t.watchAll=!0),n),zu=(e,t,n,r,i)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:i||!0}}:{},Xt=()=>{const e=typeof performance>"u"?Date.now():performance.now()*1e3;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const n=(Math.random()*16+e)%16|0;return(t=="x"?n:n&3|8).toString(16)})},ao=(e,t,n={})=>n.shouldFocus||de(n.shouldFocus)?n.focusName||`${e}.${de(n.focusIndex)?t:n.focusIndex}.`:"",yr=e=>({isOnSubmit:!e||e===dt.onSubmit,isOnBlur:e===dt.onBlur,isOnChange:e===dt.onChange,isOnAll:e===dt.all,isOnTouch:e===dt.onTouched}),lo=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(r=>e.startsWith(r)&&/^\.\w+/.test(e.slice(r.length))));const Pn=(e,t,n,r)=>{for(const i of n||Object.keys(e)){const s=U(e,i);if(s){const{_f:o,...a}=s;if(o){if(o.refs&&o.refs[0]&&t(o.refs[0],i)&&!r)return!0;if(o.ref&&t(o.ref,o.name)&&!r)return!0;if(Pn(a,t))break}else if(we(a)&&Pn(a,t))break}}};var Wu=(e,t,n)=>{const r=at(U(e,n));return oe(r,"root",t[n]),oe(e,n,r),e},uo=e=>e.type==="file",At=e=>typeof e=="function",gi=e=>{if(!so)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},yi=e=>Ft(e),co=e=>e.type==="radio",bi=e=>e instanceof RegExp;const Ku={value:!1,isValid:!1},Ju={value:!0,isValid:!0};var Yu=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!de(e[0].attributes.value)?de(e[0].value)||e[0].value===""?Ju:{value:e[0].value,isValid:!0}:Ju:Ku}return Ku};const Gu={isValid:!1,value:null};var Xu=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,Gu):Gu;function Qu(e,t,n="validate"){if(yi(e)||Array.isArray(e)&&e.every(yi)||kt(e)&&!e)return{type:n,message:yi(e)?e:"",ref:t}}var Ln=e=>we(e)&&!bi(e)?e:{value:e,message:""},fo=async(e,t,n,r,i)=>{const{ref:s,refs:o,required:a,maxLength:l,minLength:u,min:c,max:f,pattern:m,validate:p,name:d,valueAsNumber:g,mount:v,disabled:b}=e._f,x=U(t,d);if(!v||b)return{};const w=o?o[0]:s,T=I=>{r&&w.reportValidity&&(w.setCustomValidity(kt(I)?"":I||""),w.reportValidity())},C={},_=co(s),O=mr(s),A=_||O,N=(g||uo(s))&&de(s.value)&&de(x)||gi(s)&&s.value===""||x===""||Array.isArray(x)&&!x.length,L=zu.bind(null,d,n,C),P=(I,R,z,Y=Vt.maxLength,H=Vt.minLength)=>{const X=I?R:z;C[d]={type:I?Y:H,message:X,ref:s,...L(I?Y:H,X)}};if(i?!Array.isArray(x)||!x.length:a&&(!A&&(N||Je(x))||kt(x)&&!x||O&&!Yu(o).isValid||_&&!Xu(o).isValid)){const{value:I,message:R}=yi(a)?{value:!!a,message:a}:Ln(a);if(I&&(C[d]={type:Vt.required,message:R,ref:w,...L(Vt.required,R)},!n))return T(R),C}if(!N&&(!Je(c)||!Je(f))){let I,R;const z=Ln(f),Y=Ln(c);if(!Je(x)&&!isNaN(x)){const H=s.valueAsNumber||x&&+x;Je(z.value)||(I=H>z.value),Je(Y.value)||(R=H<Y.value)}else{const H=s.valueAsDate||new Date(x),X=ne=>new Date(new Date().toDateString()+" "+ne),K=s.type=="time",Z=s.type=="week";Ft(z.value)&&x&&(I=K?X(x)>X(z.value):Z?x>z.value:H>new Date(z.value)),Ft(Y.value)&&x&&(R=K?X(x)<X(Y.value):Z?x<Y.value:H<new Date(Y.value))}if((I||R)&&(P(!!I,z.message,Y.message,Vt.max,Vt.min),!n))return T(C[d].message),C}if((l||u)&&!N&&(Ft(x)||i&&Array.isArray(x))){const I=Ln(l),R=Ln(u),z=!Je(I.value)&&x.length>+I.value,Y=!Je(R.value)&&x.length<+R.value;if((z||Y)&&(P(z,I.message,R.message),!n))return T(C[d].message),C}if(m&&!N&&Ft(x)){const{value:I,message:R}=Ln(m);if(bi(I)&&!x.match(I)&&(C[d]={type:Vt.pattern,message:R,ref:s,...L(Vt.pattern,R)},!n))return T(R),C}if(p){if(At(p)){const I=await p(x,t),R=Qu(I,w);if(R&&(C[d]={...R,...L(Vt.validate,R.message)},!n))return T(R.message),C}else if(we(p)){let I={};for(const R in p){if(!Ye(I)&&!n)break;const z=Qu(await p[R](x,t),w,R);z&&(I={...z,...L(R,z.message)},T(z.message),n&&(C[d]=I))}if(!Ye(I)&&(C[d]={ref:w,...I},!n))return C}}return T(!0),C},po=(e,t)=>[...e,...at(t)],ho=e=>Array.isArray(e)?e.map(()=>{}):void 0;function mo(e,t,n){return[...e.slice(0,t),...at(n),...e.slice(t)]}var go=(e,t,n)=>Array.isArray(e)?(de(e[n])&&(e[n]=void 0),e.splice(n,0,e.splice(t,1)[0]),e):[],yo=(e,t)=>[...at(t),...at(e)];function Jb(e,t){let n=0;const r=[...e];for(const i of t)r.splice(i-n,1),n++;return gr(r).length?r:[]}var bo=(e,t)=>de(t)?[]:Jb(e,at(t).sort((n,r)=>n-r)),vo=(e,t,n)=>{[e[t],e[n]]=[e[n],e[t]]};function Yb(e,t){const n=t.slice(0,-1).length;let r=0;for(;r<n;)e=de(e)?r++:e[t[r++]];return e}function Gb(e){for(const t in e)if(e.hasOwnProperty(t)&&!de(e[t]))return!1;return!0}function Oe(e,t){const n=Array.isArray(t)?t:oo(t)?[t]:Bu(t),r=n.length===1?e:Yb(e,n),i=n.length-1,s=n[i];return r&&delete r[s],i!==0&&(we(r)&&Ye(r)||Array.isArray(r)&&Gb(r))&&Oe(e,n.slice(0,-1)),e}var Zu=(e,t,n)=>(e[t]=n,e);function Xb(e){const t=Hb(),{control:n=t.control,name:r,keyName:i="id",shouldUnregister:s,rules:o}=e,[a,l]=h.useState(n._getFieldArray(r)),u=h.useRef(n._getFieldArray(r).map(Xt)),c=h.useRef(a),f=h.useRef(r),m=h.useRef(!1);f.current=r,c.current=a,n._names.array.add(r),o&&n.register(r,o),qu({next:({values:_,name:O})=>{if(O===f.current||!O){const A=U(_,f.current);Array.isArray(A)&&(l(A),u.current=A.map(Xt))}},subject:n._subjects.array});const p=h.useCallback(_=>{m.current=!0,n._updateFieldArray(r,_)},[n,r]),d=(_,O)=>{const A=at(Me(_)),N=po(n._getFieldArray(r),A);n._names.focus=ao(r,N.length-1,O),u.current=po(u.current,A.map(Xt)),p(N),l(N),n._updateFieldArray(r,N,po,{argA:ho(_)})},g=(_,O)=>{const A=at(Me(_)),N=yo(n._getFieldArray(r),A);n._names.focus=ao(r,0,O),u.current=yo(u.current,A.map(Xt)),p(N),l(N),n._updateFieldArray(r,N,yo,{argA:ho(_)})},v=_=>{const O=bo(n._getFieldArray(r),_);u.current=bo(u.current,_),p(O),l(O),!Array.isArray(U(n._fields,r))&&oe(n._fields,r,void 0),n._updateFieldArray(r,O,bo,{argA:_})},b=(_,O,A)=>{const N=at(Me(O)),L=mo(n._getFieldArray(r),_,N);n._names.focus=ao(r,_,A),u.current=mo(u.current,_,N.map(Xt)),p(L),l(L),n._updateFieldArray(r,L,mo,{argA:_,argB:ho(O)})},x=(_,O)=>{const A=n._getFieldArray(r);vo(A,_,O),vo(u.current,_,O),p(A),l(A),n._updateFieldArray(r,A,vo,{argA:_,argB:O},!1)},w=(_,O)=>{const A=n._getFieldArray(r);go(A,_,O),go(u.current,_,O),p(A),l(A),n._updateFieldArray(r,A,go,{argA:_,argB:O},!1)},T=(_,O)=>{const A=Me(O),N=Zu(n._getFieldArray(r),_,A);u.current=[...N].map((L,P)=>!L||P===_?Xt():u.current[P]),p(N),l([...N]),n._updateFieldArray(r,N,Zu,{argA:_,argB:A},!0,!1)},C=_=>{const O=at(Me(_));u.current=O.map(Xt),p([...O]),l([...O]),n._updateFieldArray(r,[...O],A=>A,{},!0,!1)};return h.useEffect(()=>{if(n._state.action=!1,lo(r,n._names)&&n._subjects.state.next({...n._formState}),m.current&&(!yr(n._options.mode).isOnSubmit||n._formState.isSubmitted))if(n._options.resolver)n._executeSchema([r]).then(_=>{const O=U(_.errors,r),A=U(n._formState.errors,r);(A?!O&&A.type||O&&(A.type!==O.type||A.message!==O.message):O&&O.type)&&(O?oe(n._formState.errors,r,O):Oe(n._formState.errors,r),n._subjects.state.next({errors:n._formState.errors}))});else{const _=U(n._fields,r);_&&_._f&&!(yr(n._options.reValidateMode).isOnSubmit&&yr(n._options.mode).isOnSubmit)&&fo(_,n._formValues,n._options.criteriaMode===dt.all,n._options.shouldUseNativeValidation,!0).then(O=>!Ye(O)&&n._subjects.state.next({errors:Wu(n._formState.errors,O,r)}))}n._subjects.values.next({name:r,values:{...n._formValues}}),n._names.focus&&Pn(n._fields,(_,O)=>{if(n._names.focus&&O.startsWith(n._names.focus)&&_.focus)return _.focus(),1}),n._names.focus="",n._updateValid(),m.current=!1},[a,r,n]),h.useEffect(()=>(!U(n._formValues,r)&&n._updateFieldArray(r),()=>{(n._options.shouldUnregister||s)&&n.unregister(r)}),[r,n,i,s]),{swap:h.useCallback(x,[p,r,n]),move:h.useCallback(w,[p,r,n]),prepend:h.useCallback(g,[p,r,n]),append:h.useCallback(d,[p,r,n]),remove:h.useCallback(v,[p,r,n]),insert:h.useCallback(b,[p,r,n]),update:h.useCallback(T,[p,r,n]),replace:h.useCallback(C,[p,r,n]),fields:h.useMemo(()=>a.map((_,O)=>({..._,[i]:u.current[O]||Xt()})),[a,i])}}var xo=()=>{let e=[];return{get observers(){return e},next:i=>{for(const s of e)s.next&&s.next(i)},subscribe:i=>(e.push(i),{unsubscribe:()=>{e=e.filter(s=>s!==i)}}),unsubscribe:()=>{e=[]}}},wo=e=>Je(e)||!Vu(e);function Qt(e,t){if(wo(e)||wo(t))return e===t;if(mn(e)&&mn(t))return e.getTime()===t.getTime();const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const i of n){const s=e[i];if(!r.includes(i))return!1;if(i!=="ref"){const o=t[i];if(mn(s)&&mn(o)||we(s)&&we(o)||Array.isArray(s)&&Array.isArray(o)?!Qt(s,o):s!==o)return!1}}return!0}var ec=e=>e.type==="select-multiple",Qb=e=>co(e)||mr(e),Eo=e=>gi(e)&&e.isConnected,tc=e=>{for(const t in e)if(At(e[t]))return!0;return!1};function vi(e,t={}){const n=Array.isArray(e);if(we(e)||n)for(const r in e)Array.isArray(e[r])||we(e[r])&&!tc(e[r])?(t[r]=Array.isArray(e[r])?[]:{},vi(e[r],t[r])):Je(e[r])||(t[r]=!0);return t}function nc(e,t,n){const r=Array.isArray(e);if(we(e)||r)for(const i in e)Array.isArray(e[i])||we(e[i])&&!tc(e[i])?de(t)||wo(n[i])?n[i]=Array.isArray(e[i])?vi(e[i],[]):{...vi(e[i])}:nc(e[i],Je(t)?{}:t[i],n[i]):n[i]=!Qt(e[i],t[i]);return n}var br=(e,t)=>nc(e,t,vi(t)),rc=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>de(e)?e:t?e===""?NaN:e&&+e:n&&Ft(e)?new Date(e):r?r(e):e;function So(e){const t=e.ref;if(!(e.refs?e.refs.every(n=>n.disabled):t.disabled))return uo(t)?t.files:co(t)?Xu(e.refs).value:ec(t)?[...t.selectedOptions].map(({value:n})=>n):mr(t)?Yu(e.refs).value:rc(de(t.value)?e.ref.value:t.value,e)}var Zb=(e,t,n,r)=>{const i={};for(const s of e){const o=U(t,s);o&&oe(i,s,o._f)}return{criteriaMode:n,names:[...e],fields:i,shouldUseNativeValidation:r}},vr=e=>de(e)?e:bi(e)?e.source:we(e)?bi(e.value)?e.value.source:e.value:e;const ic="AsyncFunction";var ev=e=>!!e&&!!e.validate&&!!(At(e.validate)&&e.validate.constructor.name===ic||we(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===ic)),tv=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function sc(e,t,n){const r=U(e,n);if(r||oo(n))return{error:r,name:n};const i=n.split(".");for(;i.length;){const s=i.join("."),o=U(t,s),a=U(e,s);if(o&&!Array.isArray(o)&&n!==s)return{name:n};if(a&&a.type)return{name:s,error:a};i.pop()}return{name:n}}var nv=(e,t,n,r,i)=>i.isOnAll?!1:!n&&i.isOnTouch?!(t||e):(n?r.isOnBlur:i.isOnBlur)?!e:(n?r.isOnChange:i.isOnChange)?e:!0,rv=(e,t)=>!gr(U(e,t)).length&&Oe(e,t);const iv={mode:dt.onSubmit,reValidateMode:dt.onChange,shouldFocusError:!0};function sv(e={}){let t={...iv,...e},n={submitCount:0,isDirty:!1,isLoading:At(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},r={},i=we(t.defaultValues)||we(t.values)?Me(t.defaultValues||t.values)||{}:{},s=t.shouldUnregister?{}:Me(i),o={action:!1,mount:!1,watch:!1},a={mount:new Set,unMount:new Set,array:new Set,watch:new Set},l,u=0;const c={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},f={values:xo(),array:xo(),state:xo()},m=yr(t.mode),p=yr(t.reValidateMode),d=t.criteriaMode===dt.all,g=S=>k=>{clearTimeout(u),u=setTimeout(S,k)},v=async S=>{if(!t.disabled&&(c.isValid||S)){const k=t.resolver?Ye((await A()).errors):await L(r,!0);k!==n.isValid&&f.state.next({isValid:k})}},b=(S,k)=>{!t.disabled&&(c.isValidating||c.validatingFields)&&((S||Array.from(a.mount)).forEach(j=>{j&&(k?oe(n.validatingFields,j,k):Oe(n.validatingFields,j))}),f.state.next({validatingFields:n.validatingFields,isValidating:!Ye(n.validatingFields)}))},x=(S,k=[],j,B,V=!0,M=!0)=>{if(B&&j&&!t.disabled){if(o.action=!0,M&&Array.isArray(U(r,S))){const J=j(U(r,S),B.argA,B.argB);V&&oe(r,S,J)}if(M&&Array.isArray(U(n.errors,S))){const J=j(U(n.errors,S),B.argA,B.argB);V&&oe(n.errors,S,J),rv(n.errors,S)}if(c.touchedFields&&M&&Array.isArray(U(n.touchedFields,S))){const J=j(U(n.touchedFields,S),B.argA,B.argB);V&&oe(n.touchedFields,S,J)}c.dirtyFields&&(n.dirtyFields=br(i,s)),f.state.next({name:S,isDirty:I(S,k),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else oe(s,S,k)},w=(S,k)=>{oe(n.errors,S,k),f.state.next({errors:n.errors})},T=S=>{n.errors=S,f.state.next({errors:n.errors,isValid:!1})},C=(S,k,j,B)=>{const V=U(r,S);if(V){const M=U(s,S,de(j)?U(i,S):j);de(M)||B&&B.defaultChecked||k?oe(s,S,k?M:So(V._f)):Y(S,M),o.mount&&v()}},_=(S,k,j,B,V)=>{let M=!1,J=!1;const G={name:S};if(!t.disabled){const ge=!!(U(r,S)&&U(r,S)._f&&U(r,S)._f.disabled);if(!j||B){c.isDirty&&(J=n.isDirty,n.isDirty=G.isDirty=I(),M=J!==G.isDirty);const pe=ge||Qt(U(i,S),k);J=!!(!ge&&U(n.dirtyFields,S)),pe||ge?Oe(n.dirtyFields,S):oe(n.dirtyFields,S,!0),G.dirtyFields=n.dirtyFields,M=M||c.dirtyFields&&J!==!pe}if(j){const pe=U(n.touchedFields,S);pe||(oe(n.touchedFields,S,j),G.touchedFields=n.touchedFields,M=M||c.touchedFields&&pe!==j)}M&&V&&f.state.next(G)}return M?G:{}},O=(S,k,j,B)=>{const V=U(n.errors,S),M=c.isValid&&kt(k)&&n.isValid!==k;if(t.delayError&&j?(l=g(()=>w(S,j)),l(t.delayError)):(clearTimeout(u),l=null,j?oe(n.errors,S,j):Oe(n.errors,S)),(j?!Qt(V,j):V)||!Ye(B)||M){const J={...B,...M&&kt(k)?{isValid:k}:{},errors:n.errors,name:S};n={...n,...J},f.state.next(J)}},A=async S=>{b(S,!0);const k=await t.resolver(s,t.context,Zb(S||a.mount,r,t.criteriaMode,t.shouldUseNativeValidation));return b(S),k},N=async S=>{const{errors:k}=await A(S);if(S)for(const j of S){const B=U(k,j);B?oe(n.errors,j,B):Oe(n.errors,j)}else n.errors=k;return k},L=async(S,k,j={valid:!0})=>{for(const B in S){const V=S[B];if(V){const{_f:M,...J}=V;if(M){const G=a.array.has(M.name),ge=V._f&&ev(V._f);ge&&c.validatingFields&&b([B],!0);const pe=await fo(V,s,d,t.shouldUseNativeValidation&&!k,G);if(ge&&c.validatingFields&&b([B]),pe[M.name]&&(j.valid=!1,k))break;!k&&(U(pe,M.name)?G?Wu(n.errors,pe,M.name):oe(n.errors,M.name,pe[M.name]):Oe(n.errors,M.name))}!Ye(J)&&await L(J,k,j)}}return j.valid},P=()=>{for(const S of a.unMount){const k=U(r,S);k&&(k._f.refs?k._f.refs.every(j=>!Eo(j)):!Eo(k._f.ref))&&ae(S)}a.unMount=new Set},I=(S,k)=>!t.disabled&&(S&&k&&oe(s,S,k),!Qt(Ae(),i)),R=(S,k,j)=>Kb(S,a,{...o.mount?s:de(k)?i:Ft(S)?{[S]:k}:k},j,k),z=S=>gr(U(o.mount?s:i,S,t.shouldUnregister?U(i,S,[]):[])),Y=(S,k,j={})=>{const B=U(r,S);let V=k;if(B){const M=B._f;M&&(!M.disabled&&oe(s,S,rc(k,M)),V=gi(M.ref)&&Je(k)?"":k,ec(M.ref)?[...M.ref.options].forEach(J=>J.selected=V.includes(J.value)):M.refs?mr(M.ref)?M.refs.length>1?M.refs.forEach(J=>(!J.defaultChecked||!J.disabled)&&(J.checked=Array.isArray(V)?!!V.find(G=>G===J.value):V===J.value)):M.refs[0]&&(M.refs[0].checked=!!V):M.refs.forEach(J=>J.checked=J.value===V):uo(M.ref)?M.ref.value="":(M.ref.value=V,M.ref.type||f.values.next({name:S,values:{...s}})))}(j.shouldDirty||j.shouldTouch)&&_(S,V,j.shouldTouch,j.shouldDirty,!0),j.shouldValidate&&ne(S)},H=(S,k,j)=>{for(const B in k){const V=k[B],M=`${S}.${B}`,J=U(r,M);(a.array.has(S)||we(V)||J&&!J._f)&&!mn(V)?H(M,V,j):Y(M,V,j)}},X=(S,k,j={})=>{const B=U(r,S),V=a.array.has(S),M=Me(k);oe(s,S,M),V?(f.array.next({name:S,values:{...s}}),(c.isDirty||c.dirtyFields)&&j.shouldDirty&&f.state.next({name:S,dirtyFields:br(i,s),isDirty:I(S,M)})):B&&!B._f&&!Je(M)?H(S,M,j):Y(S,M,j),lo(S,a)&&f.state.next({...n}),f.values.next({name:o.mount?S:void 0,values:{...s}})},K=async S=>{o.mount=!0;const k=S.target;let j=k.name,B=!0;const V=U(r,j),M=()=>k.type?So(V._f):Rb(S),J=G=>{B=Number.isNaN(G)||mn(G)&&isNaN(G.getTime())||Qt(G,U(s,j,G))};if(V){let G,ge;const pe=M(),wt=S.type===Uu.BLUR||S.type===Uu.FOCUS_OUT,Vn=!tv(V._f)&&!t.resolver&&!U(n.errors,j)&&!V._f.deps||nv(wt,U(n.touchedFields,j),n.isSubmitted,p,m),en=lo(j,a,wt);oe(s,j,pe),wt?(V._f.onBlur&&V._f.onBlur(S),l&&l(0)):V._f.onChange&&V._f.onChange(S);const zt=_(j,pe,wt,!1),kr=!Ye(zt)||en;if(!wt&&f.values.next({name:j,type:S.type,values:{...s}}),Vn)return c.isValid&&(t.mode==="onBlur"?wt&&v():v()),kr&&f.state.next({name:j,...en?{}:zt});if(!wt&&en&&f.state.next({...n}),t.resolver){const{errors:Sn}=await A([j]);if(J(pe),B){const Fr=sc(n.errors,r,j),ye=sc(Sn,r,Fr.name||j);G=ye.error,j=ye.name,ge=Ye(Sn)}}else b([j],!0),G=(await fo(V,s,d,t.shouldUseNativeValidation))[j],b([j]),J(pe),B&&(G?ge=!1:c.isValid&&(ge=await L(r,!0)));B&&(V._f.deps&&ne(V._f.deps),O(j,ge,G,zt))}},Z=(S,k)=>{if(U(n.errors,k)&&S.focus)return S.focus(),1},ne=async(S,k={})=>{let j,B;const V=at(S);if(t.resolver){const M=await N(de(S)?S:V);j=Ye(M),B=S?!V.some(J=>U(M,J)):j}else S?(B=(await Promise.all(V.map(async M=>{const J=U(r,M);return await L(J&&J._f?{[M]:J}:J)}))).every(Boolean),!(!B&&!n.isValid)&&v()):B=j=await L(r);return f.state.next({...!Ft(S)||c.isValid&&j!==n.isValid?{}:{name:S},...t.resolver||!S?{isValid:j}:{},errors:n.errors}),k.shouldFocus&&!B&&Pn(r,Z,S?V:a.mount),B},Ae=S=>{const k={...o.mount?s:i};return de(S)?k:Ft(S)?U(k,S):S.map(j=>U(k,j))},Pe=(S,k)=>({invalid:!!U((k||n).errors,S),isDirty:!!U((k||n).dirtyFields,S),error:U((k||n).errors,S),isValidating:!!U(n.validatingFields,S),isTouched:!!U((k||n).touchedFields,S)}),W=S=>{S&&at(S).forEach(k=>Oe(n.errors,k)),f.state.next({errors:S?n.errors:{}})},ve=(S,k,j)=>{const B=(U(r,S,{_f:{}})._f||{}).ref,V=U(n.errors,S)||{},{ref:M,message:J,type:G,...ge}=V;oe(n.errors,S,{...ge,...k,ref:B}),f.state.next({name:S,errors:n.errors,isValid:!1}),j&&j.shouldFocus&&B&&B.focus&&B.focus()},Se=(S,k)=>At(S)?f.values.subscribe({next:j=>S(R(void 0,k),j)}):R(S,k,!0),ae=(S,k={})=>{for(const j of S?at(S):a.mount)a.mount.delete(j),a.array.delete(j),k.keepValue||(Oe(r,j),Oe(s,j)),!k.keepError&&Oe(n.errors,j),!k.keepDirty&&Oe(n.dirtyFields,j),!k.keepTouched&&Oe(n.touchedFields,j),!k.keepIsValidating&&Oe(n.validatingFields,j),!t.shouldUnregister&&!k.keepDefaultValue&&Oe(i,j);f.values.next({values:{...s}}),f.state.next({...n,...k.keepDirty?{isDirty:I()}:{}}),!k.keepIsValid&&v()},$e=({disabled:S,name:k,field:j,fields:B,value:V})=>{if(kt(S)&&o.mount||S){const M=S?void 0:de(V)?So(j?j._f:U(B,k)._f):V;(S||!S&&!de(M))&&oe(s,k,M),_(k,M,!1,!1,!0)}},Te=(S,k={})=>{let j=U(r,S);const B=kt(k.disabled)||kt(t.disabled);return oe(r,S,{...j||{},_f:{...j&&j._f?j._f:{ref:{name:S}},name:S,mount:!0,...k}}),a.mount.add(S),j?$e({field:j,disabled:kt(k.disabled)?k.disabled:t.disabled,name:S,value:k.value}):C(S,!0,k.value),{...B?{disabled:k.disabled||t.disabled}:{},...t.progressive?{required:!!k.required,min:vr(k.min),max:vr(k.max),minLength:vr(k.minLength),maxLength:vr(k.maxLength),pattern:vr(k.pattern)}:{},name:S,onChange:K,onBlur:K,ref:V=>{if(V){Te(S,k),j=U(r,S);const M=de(V.value)&&V.querySelectorAll&&V.querySelectorAll("input,select,textarea")[0]||V,J=Qb(M),G=j._f.refs||[];if(J?G.find(ge=>ge===M):M===j._f.ref)return;oe(r,S,{_f:{...j._f,...J?{refs:[...G.filter(Eo),M,...Array.isArray(U(i,S))?[{}]:[]],ref:{type:M.type,name:S}}:{ref:M}}}),C(S,!1,void 0,M)}else j=U(r,S,{}),j._f&&(j._f.mount=!1),(t.shouldUnregister||k.shouldUnregister)&&!(Bb(a.array,S)&&o.action)&&a.unMount.add(S)}}},Le=()=>t.shouldFocusError&&Pn(r,Z,a.mount),xt=S=>{kt(S)&&(f.state.next({disabled:S}),Pn(r,(k,j)=>{const B=U(r,j);B&&(k.disabled=B._f.disabled||S,Array.isArray(B._f.refs)&&B._f.refs.forEach(V=>{V.disabled=B._f.disabled||S}))},0,!1))},_e=(S,k)=>async j=>{let B;if(j&&(j.preventDefault&&j.preventDefault(),j.persist&&j.persist()),t.disabled){k&&await k({...n.errors},j);return}let V=Me(s);if(f.state.next({isSubmitting:!0}),t.resolver){const{errors:M,values:J}=await A();n.errors=M,V=J}else await L(r);if(Oe(n.errors,"root"),Ye(n.errors)){f.state.next({errors:{}});try{await S(V,j)}catch(M){B=M}}else k&&await k({...n.errors},j),Le(),setTimeout(Le);if(f.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Ye(n.errors)&&!B,submitCount:n.submitCount+1,errors:n.errors}),B)throw B},ie=(S,k={})=>{U(r,S)&&(de(k.defaultValue)?X(S,Me(U(i,S))):(X(S,k.defaultValue),oe(i,S,Me(k.defaultValue))),k.keepTouched||Oe(n.touchedFields,S),k.keepDirty||(Oe(n.dirtyFields,S),n.isDirty=k.defaultValue?I(S,Me(U(i,S))):I()),k.keepError||(Oe(n.errors,S),c.isValid&&v()),f.state.next({...n}))},he=(S,k={})=>{const j=S?Me(S):i,B=Me(j),V=Ye(S),M=V?i:B;if(k.keepDefaultValues||(i=j),!k.keepValues){if(k.keepDirtyValues){const J=new Set([...a.mount,...Object.keys(br(i,s))]);for(const G of Array.from(J))U(n.dirtyFields,G)?oe(M,G,U(s,G)):X(G,U(M,G))}else{if(so&&de(S))for(const J of a.mount){const G=U(r,J);if(G&&G._f){const ge=Array.isArray(G._f.refs)?G._f.refs[0]:G._f.ref;if(gi(ge)){const pe=ge.closest("form");if(pe){pe.reset();break}}}}r={}}s=t.shouldUnregister?k.keepDefaultValues?Me(i):{}:Me(M),f.array.next({values:{...M}}),f.values.next({values:{...M}})}a={mount:k.keepDirtyValues?a.mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},o.mount=!c.isValid||!!k.keepIsValid||!!k.keepDirtyValues,o.watch=!!t.shouldUnregister,f.state.next({submitCount:k.keepSubmitCount?n.submitCount:0,isDirty:V?!1:k.keepDirty?n.isDirty:!!(k.keepDefaultValues&&!Qt(S,i)),isSubmitted:k.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:V?{}:k.keepDirtyValues?k.keepDefaultValues&&s?br(i,s):n.dirtyFields:k.keepDefaultValues&&S?br(i,S):k.keepDirty?n.dirtyFields:{},touchedFields:k.keepTouched?n.touchedFields:{},errors:k.keepErrors?n.errors:{},isSubmitSuccessful:k.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1})},je=(S,k)=>he(At(S)?S(s):S,k);return{control:{register:Te,unregister:ae,getFieldState:Pe,handleSubmit:_e,setError:ve,_executeSchema:A,_getWatch:R,_getDirty:I,_updateValid:v,_removeUnmounted:P,_updateFieldArray:x,_updateDisabledField:$e,_getFieldArray:z,_reset:he,_resetDefaultValues:()=>At(t.defaultValues)&&t.defaultValues().then(S=>{je(S,t.resetOptions),f.state.next({isLoading:!1})}),_updateFormState:S=>{n={...n,...S}},_disableForm:xt,_subjects:f,_proxyFormState:c,_setErrors:T,get _fields(){return r},get _formValues(){return s},get _state(){return o},set _state(S){o=S},get _defaultValues(){return i},get _names(){return a},set _names(S){a=S},get _formState(){return n},set _formState(S){n=S},get _options(){return t},set _options(S){t={...t,...S}}},trigger:ne,register:Te,handleSubmit:_e,watch:Se,setValue:X,getValues:Ae,reset:je,resetField:ie,clearErrors:W,unregister:ae,setError:ve,setFocus:(S,k={})=>{const j=U(r,S),B=j&&j._f;if(B){const V=B.refs?B.refs[0]:B.ref;V.focus&&(V.focus(),k.shouldSelect&&At(V.select)&&V.select())}},getFieldState:Pe}}function To(e={}){const t=h.useRef(),n=h.useRef(),[r,i]=h.useState({isDirty:!1,isValidating:!1,isLoading:At(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,defaultValues:At(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={...sv(e),formState:r});const s=t.current.control;return s._options=e,qu({subject:s._subjects.state,next:o=>{Wb(o,s._proxyFormState,s._updateFormState)&&i({...s._formState})}}),h.useEffect(()=>s._disableForm(e.disabled),[s,e.disabled]),h.useEffect(()=>{if(s._proxyFormState.isDirty){const o=s._getDirty();o!==r.isDirty&&s._subjects.state.next({isDirty:o})}},[s,r.isDirty]),h.useEffect(()=>{e.values&&!Qt(e.values,n.current)?(s._reset(e.values,s._options.resetOptions),n.current=e.values,i(o=>({...o}))):s._resetDefaultValues()},[e.values,s]),h.useEffect(()=>{e.errors&&s._setErrors(e.errors)},[e.errors,s]),h.useEffect(()=>{s._state.mount||(s._updateValid(),s._state.mount=!0),s._state.watch&&(s._state.watch=!1,s._subjects.state.next({...s._formState})),s._removeUnmounted()}),h.useEffect(()=>{e.shouldUnregister&&s._subjects.values.next({values:s._getWatch()})},[e.shouldUnregister,s]),h.useMemo(()=>({...t.current,formState:zb(r,s)}),[r,s])}const oc=(e,t,n)=>{if(e&&"reportValidity"in e){const r=U(n,t);e.setCustomValidity(r&&r.message||""),e.reportValidity()}},ac=(e,t)=>{for(const n in t.fields){const r=t.fields[n];r&&r.ref&&"reportValidity"in r.ref?oc(r.ref,n,e):r.refs&&r.refs.forEach(i=>oc(i,n,e))}},ov=(e,t)=>{t.shouldUseNativeValidation&&ac(e,t);const n={};for(const r in e){const i=U(t.fields,r),s=Object.assign(e[r]||{},{ref:i&&i.ref});if(av(t.names||Object.keys(e),r)){const o=Object.assign({},U(n,r));oe(o,"root",s),oe(n,r,o)}else oe(n,r,s)}return n},av=(e,t)=>e.some(n=>n.startsWith(t+"."));function _o(e,t,n){return t===void 0&&(t={}),n===void 0&&(n={}),function(r,i,s){try{return Promise.resolve(function(o,a){try{var l=(t.context&&process.env.NODE_ENV==="development"&&console.warn("You should not used the yup options context. Please, use the 'useForm' context object instead"),Promise.resolve(e[n.mode==="sync"?"validateSync":"validate"](r,Object.assign({abortEarly:!1},t,{context:i}))).then(function(u){return s.shouldUseNativeValidation&&ac({},s),{values:n.raw?r:u,errors:{}}}))}catch(u){return a(u)}return l&&l.then?l.then(void 0,a):l}(0,function(o){if(!o.inner)throw o;return{values:{},errors:ov((a=o,l=!s.shouldUseNativeValidation&&s.criteriaMode==="all",(a.inner||[]).reduce(function(u,c){if(u[c.path]||(u[c.path]={message:c.message,type:c.type}),l){var f=u[c.path].types,m=f&&f[c.type];u[c.path]=zu(c.path,l,u,c.type,m?[].concat(m,c.message):c.message)}return u},{})),s)};var a,l}))}catch(o){return Promise.reject(o)}}}var Co,lc;function lv(){if(lc)return Co;lc=1;function e(b){this._maxSize=b,this.clear()}e.prototype.clear=function(){this._size=0,this._values=Object.create(null)},e.prototype.get=function(b){return this._values[b]},e.prototype.set=function(b,x){return this._size>=this._maxSize&&this.clear(),b in this._values||this._size++,this._values[b]=x};var t=/[^.^\]^[]+|(?=\[\]|\.\.)/g,n=/^\d+$/,r=/^\d/,i=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,s=/^\s*(['"]?)(.*?)(\1)\s*$/,o=512,a=new e(o),l=new e(o),u=new e(o);Co={Cache:e,split:f,normalizePath:c,setter:function(b){var x=c(b);return l.get(b)||l.set(b,function(T,C){for(var _=0,O=x.length,A=T;_<O-1;){var N=x[_];if(N==="__proto__"||N==="constructor"||N==="prototype")return T;A=A[x[_++]]}A[x[_]]=C})},getter:function(b,x){var w=c(b);return u.get(b)||u.set(b,function(C){for(var _=0,O=w.length;_<O;)if(C!=null||!x)C=C[w[_++]];else return;return C})},join:function(b){return b.reduce(function(x,w){return x+(p(w)||n.test(w)?"["+w+"]":(x?".":"")+w)},"")},forEach:function(b,x,w){m(Array.isArray(b)?b:f(b),x,w)}};function c(b){return a.get(b)||a.set(b,f(b).map(function(x){return x.replace(s,"$2")}))}function f(b){return b.match(t)||[""]}function m(b,x,w){var T=b.length,C,_,O,A;for(_=0;_<T;_++)C=b[_],C&&(v(C)&&(C='"'+C+'"'),A=p(C),O=!A&&/^\d+$/.test(C),x.call(w,C,A,O,_,b))}function p(b){return typeof b=="string"&&b&&["'",'"'].indexOf(b.charAt(0))!==-1}function d(b){return b.match(r)&&!b.match(n)}function g(b){return i.test(b)}function v(b){return!p(b)&&(d(b)||g(b))}return Co}var gn=lv(),Oo,uc;function uv(){if(uc)return Oo;uc=1;const e=/[A-Z\xc0-\xd6\xd8-\xde]?[a-z\xdf-\xf6\xf8-\xff]+(?:['’](?:d|ll|m|re|s|t|ve))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde]|$)|(?:[A-Z\xc0-\xd6\xd8-\xde]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:D|LL|M|RE|S|T|VE))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde](?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])|$)|[A-Z\xc0-\xd6\xd8-\xde]?(?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:d|ll|m|re|s|t|ve))?|[A-Z\xc0-\xd6\xd8-\xde]+(?:['’](?:D|LL|M|RE|S|T|VE))?|\d*(?:1ST|2ND|3RD|(?![123])\dTH)(?=\b|[a-z_])|\d*(?:1st|2nd|3rd|(?![123])\dth)(?=\b|[A-Z_])|\d+|(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?(?:\u200d(?:[^\ud800-\udfff]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?)*/g,t=c=>c.match(e)||[],n=c=>c[0].toUpperCase()+c.slice(1),r=(c,f)=>t(c).join(f).toLowerCase(),i=c=>t(c).reduce((f,m)=>`${f}${f?m[0].toUpperCase()+m.slice(1).toLowerCase():m.toLowerCase()}`,"");return Oo={words:t,upperFirst:n,camelCase:i,pascalCase:c=>n(i(c)),snakeCase:c=>r(c,"_"),kebabCase:c=>r(c,"-"),sentenceCase:c=>n(r(c," ")),titleCase:c=>t(c).map(n).join(" ")},Oo}var ko=uv(),xi={exports:{}},cc;function cv(){if(cc)return xi.exports;cc=1,xi.exports=function(i){return e(t(i),i)},xi.exports.array=e;function e(i,s){var o=i.length,a=new Array(o),l={},u=o,c=n(s),f=r(i);for(s.forEach(function(p){if(!f.has(p[0])||!f.has(p[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")});u--;)l[u]||m(i[u],u,new Set);return a;function m(p,d,g){if(g.has(p)){var v;try{v=", node was:"+JSON.stringify(p)}catch{v=""}throw new Error("Cyclic dependency"+v)}if(!f.has(p))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(p));if(!l[d]){l[d]=!0;var b=c.get(p)||new Set;if(b=Array.from(b),d=b.length){g.add(p);do{var x=b[--d];m(x,f.get(x),g)}while(d);g.delete(p)}a[--o]=p}}}function t(i){for(var s=new Set,o=0,a=i.length;o<a;o++){var l=i[o];s.add(l[0]),s.add(l[1])}return Array.from(s)}function n(i){for(var s=new Map,o=0,a=i.length;o<a;o++){var l=i[o];s.has(l[0])||s.set(l[0],new Set),s.has(l[1])||s.set(l[1],new Set),s.get(l[0]).add(l[1])}return s}function r(i){for(var s=new Map,o=0,a=i.length;o<a;o++)s.set(i[o],o);return s}return xi.exports}var fv=cv();const dv=Tf(fv),pv=Object.prototype.toString,hv=Error.prototype.toString,mv=RegExp.prototype.toString,gv=typeof Symbol<"u"?Symbol.prototype.toString:()=>"",yv=/^Symbol\((.*)\)(.*)$/;function bv(e){return e!=+e?"NaN":e===0&&1/e<0?"-0":""+e}function fc(e,t=!1){if(e==null||e===!0||e===!1)return""+e;const n=typeof e;if(n==="number")return bv(e);if(n==="string")return t?`"${e}"`:e;if(n==="function")return"[Function "+(e.name||"anonymous")+"]";if(n==="symbol")return gv.call(e).replace(yv,"Symbol($1)");const r=pv.call(e).slice(8,-1);return r==="Date"?isNaN(e.getTime())?""+e:e.toISOString(e):r==="Error"||e instanceof Error?"["+hv.call(e)+"]":r==="RegExp"?mv.call(e):null}function Bt(e,t){let n=fc(e,t);return n!==null?n:JSON.stringify(e,function(r,i){let s=fc(this[r],t);return s!==null?s:i},2)}function dc(e){return e==null?[]:[].concat(e)}let pc,hc,mc,vv=/\$\{\s*(\w+)\s*\}/g;pc=Symbol.toStringTag;class gc{constructor(t,n,r,i){this.name=void 0,this.message=void 0,this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=void 0,this.inner=void 0,this[pc]="Error",this.name="ValidationError",this.value=n,this.path=r,this.type=i,this.errors=[],this.inner=[],dc(t).forEach(s=>{if(Ze.isError(s)){this.errors.push(...s.errors);const o=s.inner.length?s.inner:[s];this.inner.push(...o)}else this.errors.push(s)}),this.message=this.errors.length>1?`${this.errors.length} errors occurred`:this.errors[0]}}hc=Symbol.hasInstance,mc=Symbol.toStringTag;class Ze extends Error{static formatError(t,n){const r=n.label||n.path||"this";return n=Object.assign({},n,{path:r,originalPath:n.path}),typeof t=="string"?t.replace(vv,(i,s)=>Bt(n[s])):typeof t=="function"?t(n):t}static isError(t){return t&&t.name==="ValidationError"}constructor(t,n,r,i,s){const o=new gc(t,n,r,i);if(s)return o;super(),this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=[],this.inner=[],this[mc]="Error",this.name=o.name,this.message=o.message,this.type=o.type,this.value=o.value,this.path=o.path,this.errors=o.errors,this.inner=o.inner,Error.captureStackTrace&&Error.captureStackTrace(this,Ze)}static[hc](t){return gc[Symbol.hasInstance](t)||super[Symbol.hasInstance](t)}}let $t={default:"${path} is invalid",required:"${path} is a required field",defined:"${path} must be defined",notNull:"${path} cannot be null",oneOf:"${path} must be one of the following values: ${values}",notOneOf:"${path} must not be one of the following values: ${values}",notType:({path:e,type:t,value:n,originalValue:r})=>{const i=r!=null&&r!==n?` (cast from the value \`${Bt(r,!0)}\`).`:".";return t!=="mixed"?`${e} must be a \`${t}\` type, but the final value was: \`${Bt(n,!0)}\``+i:`${e} must match the configured type. The validated value was: \`${Bt(n,!0)}\``+i}},et={length:"${path} must be exactly ${length} characters",min:"${path} must be at least ${min} characters",max:"${path} must be at most ${max} characters",matches:'${path} must match the following: "${regex}"',email:"${path} must be a valid email",url:"${path} must be a valid URL",uuid:"${path} must be a valid UUID",datetime:"${path} must be a valid ISO date-time",datetime_precision:"${path} must be a valid ISO date-time with a sub-second precision of exactly ${precision} digits",datetime_offset:'${path} must be a valid ISO date-time with UTC "Z" timezone',trim:"${path} must be a trimmed string",lowercase:"${path} must be a lowercase string",uppercase:"${path} must be a upper case string"},Zt={min:"${path} must be greater than or equal to ${min}",max:"${path} must be less than or equal to ${max}",lessThan:"${path} must be less than ${less}",moreThan:"${path} must be greater than ${more}",positive:"${path} must be a positive number",negative:"${path} must be a negative number",integer:"${path} must be an integer"},Fo={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},Ao={isValue:"${path} field must be ${value}"},wi={noUnknown:"${path} field has unspecified keys: ${unknown}",exact:"${path} object contains unknown properties: ${properties}"},Ei={min:"${path} field must have at least ${min} items",max:"${path} field must have less than or equal to ${max} items",length:"${path} must have ${length} items"};Object.assign(Object.create(null),{mixed:$t,string:et,number:Zt,date:Fo,object:wi,array:Ei,boolean:Ao,tuple:{notType:e=>{const{path:t,value:n,spec:r}=e,i=r.types.length;if(Array.isArray(n)){if(n.length<i)return`${t} tuple value has too few items, expected a length of ${i} but got ${n.length} for value: \`${Bt(n,!0)}\``;if(n.length>i)return`${t} tuple value has too many items, expected a length of ${i} but got ${n.length} for value: \`${Bt(n,!0)}\``}return Ze.formatError($t.notType,e)}}});const Si=e=>e&&e.__isYupSchema__;class Ti{static fromOptions(t,n){if(!n.then&&!n.otherwise)throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");let{is:r,then:i,otherwise:s}=n,o=typeof r=="function"?r:(...a)=>a.every(l=>l===r);return new Ti(t,(a,l)=>{var u;let c=o(...a)?i:s;return(u=c==null?void 0:c(l))!=null?u:l})}constructor(t,n){this.fn=void 0,this.refs=t,this.refs=t,this.fn=n}resolve(t,n){let r=this.refs.map(s=>s.getValue(n==null?void 0:n.value,n==null?void 0:n.parent,n==null?void 0:n.context)),i=this.fn(r,t,n);if(i===void 0||i===t)return t;if(!Si(i))throw new TypeError("conditions must return a schema object");return i.resolve(n)}}const _i={context:"$",value:"."};class yn{constructor(t,n={}){if(this.key=void 0,this.isContext=void 0,this.isValue=void 0,this.isSibling=void 0,this.path=void 0,this.getter=void 0,this.map=void 0,typeof t!="string")throw new TypeError("ref must be a string, got: "+t);if(this.key=t.trim(),t==="")throw new TypeError("ref must be a non-empty string");this.isContext=this.key[0]===_i.context,this.isValue=this.key[0]===_i.value,this.isSibling=!this.isContext&&!this.isValue;let r=this.isContext?_i.context:this.isValue?_i.value:"";this.path=this.key.slice(r.length),this.getter=this.path&&gn.getter(this.path,!0),this.map=n.map}getValue(t,n,r){let i=this.isContext?r:this.isValue?t:n;return this.getter&&(i=this.getter(i||{})),this.map&&(i=this.map(i)),i}cast(t,n){return this.getValue(t,n==null?void 0:n.parent,n==null?void 0:n.context)}resolve(){return this}describe(){return{type:"ref",key:this.key}}toString(){return`Ref(${this.key})`}static isRef(t){return t&&t.__isYupRef}}yn.prototype.__isYupRef=!0;const bt=e=>e==null;function Dn(e){function t({value:n,path:r="",options:i,originalValue:s,schema:o},a,l){const{name:u,test:c,params:f,message:m,skipAbsent:p}=e;let{parent:d,context:g,abortEarly:v=o.spec.abortEarly,disableStackTrace:b=o.spec.disableStackTrace}=i;function x(P){return yn.isRef(P)?P.getValue(n,d,g):P}function w(P={}){const I=Object.assign({value:n,originalValue:s,label:o.spec.label,path:P.path||r,spec:o.spec,disableStackTrace:P.disableStackTrace||b},f,P.params);for(const z of Object.keys(I))I[z]=x(I[z]);const R=new Ze(Ze.formatError(P.message||m,I),n,I.path,P.type||u,I.disableStackTrace);return R.params=I,R}const T=v?a:l;let C={path:r,parent:d,type:u,from:i.from,createError:w,resolve:x,options:i,originalValue:s,schema:o};const _=P=>{Ze.isError(P)?T(P):P?l(null):T(w())},O=P=>{Ze.isError(P)?T(P):a(P)};if(p&&bt(n))return _(!0);let N;try{var L;if(N=c.call(C,n,C),typeof((L=N)==null?void 0:L.then)=="function"){if(i.sync)throw new Error(`Validation test of type: "${C.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`);return Promise.resolve(N).then(_,O)}}catch(P){O(P);return}_(N)}return t.OPTIONS=e,t}function xv(e,t,n,r=n){let i,s,o;return t?(gn.forEach(t,(a,l,u)=>{let c=l?a.slice(1,a.length-1):a;e=e.resolve({context:r,parent:i,value:n});let f=e.type==="tuple",m=u?parseInt(c,10):0;if(e.innerType||f){if(f&&!u)throw new Error(`Yup.reach cannot implicitly index into a tuple type. the path part "${o}" must contain an index to the tuple element, e.g. "${o}[0]"`);if(n&&m>=n.length)throw new Error(`Yup.reach cannot resolve an array item at index: ${a}, in the path: ${t}. because there is no value at that index. `);i=n,n=n&&n[m],e=f?e.spec.types[m]:e.innerType}if(!u){if(!e.fields||!e.fields[c])throw new Error(`The schema does not contain the path: ${t}. (failed at: ${o} which is a type: "${e.type}")`);i=n,n=n&&n[c],e=e.fields[c]}s=c,o=l?"["+a+"]":"."+a}),{schema:e,parent:i,parentPath:s}):{parent:i,parentPath:t,schema:e}}class Ci extends Set{describe(){const t=[];for(const n of this.values())t.push(yn.isRef(n)?n.describe():n);return t}resolveAll(t){let n=[];for(const r of this.values())n.push(t(r));return n}clone(){return new Ci(this.values())}merge(t,n){const r=this.clone();return t.forEach(i=>r.add(i)),n.forEach(i=>r.delete(i)),r}}function In(e,t=new Map){if(Si(e)||!e||typeof e!="object")return e;if(t.has(e))return t.get(e);let n;if(e instanceof Date)n=new Date(e.getTime()),t.set(e,n);else if(e instanceof RegExp)n=new RegExp(e),t.set(e,n);else if(Array.isArray(e)){n=new Array(e.length),t.set(e,n);for(let r=0;r<e.length;r++)n[r]=In(e[r],t)}else if(e instanceof Map){n=new Map,t.set(e,n);for(const[r,i]of e.entries())n.set(r,In(i,t))}else if(e instanceof Set){n=new Set,t.set(e,n);for(const r of e)n.add(In(r,t))}else if(e instanceof Object){n={},t.set(e,n);for(const[r,i]of Object.entries(e))n[r]=In(i,t)}else throw Error(`Unable to clone ${e}`);return n}class tt{constructor(t){this.type=void 0,this.deps=[],this.tests=void 0,this.transforms=void 0,this.conditions=[],this._mutate=void 0,this.internalTests={},this._whitelist=new Ci,this._blacklist=new Ci,this.exclusiveTests=Object.create(null),this._typeCheck=void 0,this.spec=void 0,this.tests=[],this.transforms=[],this.withMutation(()=>{this.typeError($t.notType)}),this.type=t.type,this._typeCheck=t.check,this.spec=Object.assign({strip:!1,strict:!1,abortEarly:!0,recursive:!0,disableStackTrace:!1,nullable:!1,optional:!0,coerce:!0},t==null?void 0:t.spec),this.withMutation(n=>{n.nonNullable()})}get _type(){return this.type}clone(t){if(this._mutate)return t&&Object.assign(this.spec,t),this;const n=Object.create(Object.getPrototypeOf(this));return n.type=this.type,n._typeCheck=this._typeCheck,n._whitelist=this._whitelist.clone(),n._blacklist=this._blacklist.clone(),n.internalTests=Object.assign({},this.internalTests),n.exclusiveTests=Object.assign({},this.exclusiveTests),n.deps=[...this.deps],n.conditions=[...this.conditions],n.tests=[...this.tests],n.transforms=[...this.transforms],n.spec=In(Object.assign({},this.spec,t)),n}label(t){let n=this.clone();return n.spec.label=t,n}meta(...t){if(t.length===0)return this.spec.meta;let n=this.clone();return n.spec.meta=Object.assign(n.spec.meta||{},t[0]),n}withMutation(t){let n=this._mutate;this._mutate=!0;let r=t(this);return this._mutate=n,r}concat(t){if(!t||t===this)return this;if(t.type!==this.type&&this.type!=="mixed")throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${t.type}`);let n=this,r=t.clone();const i=Object.assign({},n.spec,r.spec);return r.spec=i,r.internalTests=Object.assign({},n.internalTests,r.internalTests),r._whitelist=n._whitelist.merge(t._whitelist,t._blacklist),r._blacklist=n._blacklist.merge(t._blacklist,t._whitelist),r.tests=n.tests,r.exclusiveTests=n.exclusiveTests,r.withMutation(s=>{t.tests.forEach(o=>{s.test(o.OPTIONS)})}),r.transforms=[...n.transforms,...r.transforms],r}isType(t){return t==null?!!(this.spec.nullable&&t===null||this.spec.optional&&t===void 0):this._typeCheck(t)}resolve(t){let n=this;if(n.conditions.length){let r=n.conditions;n=n.clone(),n.conditions=[],n=r.reduce((i,s)=>s.resolve(i,t),n),n=n.resolve(t)}return n}resolveOptions(t){var n,r,i,s;return Object.assign({},t,{from:t.from||[],strict:(n=t.strict)!=null?n:this.spec.strict,abortEarly:(r=t.abortEarly)!=null?r:this.spec.abortEarly,recursive:(i=t.recursive)!=null?i:this.spec.recursive,disableStackTrace:(s=t.disableStackTrace)!=null?s:this.spec.disableStackTrace})}cast(t,n={}){let r=this.resolve(Object.assign({value:t},n)),i=n.assert==="ignore-optionality",s=r._cast(t,n);if(n.assert!==!1&&!r.isType(s)){if(i&&bt(s))return s;let o=Bt(t),a=Bt(s);throw new TypeError(`The value of ${n.path||"field"} could not be cast to a value that satisfies the schema type: "${r.type}".
|
|
52
56
|
|
|
53
|
-
attempted value: ${
|
|
54
|
-
`+(l!==s?`result of cast: ${l}`:""))}return o}_cast(t,n){let r=t===void 0?t:this.transforms.reduce((i,o)=>o.call(this,i,t,this),t);return r===void 0&&(r=this.getDefault(n)),r}_validate(t,n={},r,i){let{path:o,originalValue:s=t,strict:l=this.spec.strict}=n,a=t;l||(a=this._cast(a,Object.assign({assert:!1},n)));let u=[];for(let c of Object.values(this.internalTests))c&&u.push(c);this.runTests({path:o,value:a,originalValue:s,options:n,tests:u},r,c=>{if(c.length)return i(c,a);this.runTests({path:o,value:a,originalValue:s,options:n,tests:this.tests},r,i)})}runTests(t,n,r){let i=!1,{tests:o,value:s,originalValue:l,path:a,options:u}=t,c=v=>{i||(i=!0,n(v,s))},f=v=>{i||(i=!0,r(v,s))},m=o.length,d=[];if(!m)return f([]);let p={value:s,originalValue:l,path:a,options:u,schema:this};for(let v=0;v<o.length;v++){const b=o[v];b(p,c,function(y){y&&(Array.isArray(y)?d.push(...y):d.push(y)),--m<=0&&f(d)})}}asNestedTest({key:t,index:n,parent:r,parentPath:i,originalParent:o,options:s}){const l=t??n;if(l==null)throw TypeError("Must include `key` or `index` for nested validations");const a=typeof l=="number";let u=r[l];const c=Object.assign({},s,{strict:!0,parent:r,value:u,originalValue:o[l],key:void 0,[a?"index":"key"]:l,path:a||l.includes(".")?`${i||""}[${a?l:`"${l}"`}]`:(i?`${i}.`:"")+t});return(f,m,d)=>this.resolve(c)._validate(u,c,m,d)}validate(t,n){var r;let i=this.resolve(Object.assign({},n,{value:t})),o=(r=n==null?void 0:n.disableStackTrace)!=null?r:i.spec.disableStackTrace;return new Promise((s,l)=>i._validate(t,n,(a,u)=>{Ge.isError(a)&&(a.value=u),l(a)},(a,u)=>{a.length?l(new Ge(a,u,void 0,void 0,o)):s(u)}))}validateSync(t,n){var r;let i=this.resolve(Object.assign({},n,{value:t})),o,s=(r=n==null?void 0:n.disableStackTrace)!=null?r:i.spec.disableStackTrace;return i._validate(t,Object.assign({},n,{sync:!0}),(l,a)=>{throw Ge.isError(l)&&(l.value=a),l},(l,a)=>{if(l.length)throw new Ge(l,t,void 0,void 0,s);o=a}),o}isValid(t,n){return this.validate(t,n).then(()=>!0,r=>{if(Ge.isError(r))return!1;throw r})}isValidSync(t,n){try{return this.validateSync(t,n),!0}catch(r){if(Ge.isError(r))return!1;throw r}}_getDefault(t){let n=this.spec.default;return n==null?n:typeof n=="function"?n.call(this,t):Sn(n)}getDefault(t){return this.resolve(t||{})._getDefault(t)}default(t){return arguments.length===0?this._getDefault():this.clone({default:t})}strict(t=!0){return this.clone({strict:t})}nullability(t,n){const r=this.clone({nullable:t});return r.internalTests.nullable=Tn({message:n,name:"nullable",test(i){return i===null?this.schema.spec.nullable:!0}}),r}optionality(t,n){const r=this.clone({optional:t});return r.internalTests.optionality=Tn({message:n,name:"optionality",test(i){return i===void 0?this.schema.spec.optional:!0}}),r}optional(){return this.optionality(!0)}defined(t=Tt.defined){return this.optionality(!1,t)}nullable(){return this.nullability(!0)}nonNullable(t=Tt.notNull){return this.nullability(!1,t)}required(t=Tt.required){return this.clone().withMutation(n=>n.nonNullable(t).defined(t))}notRequired(){return this.clone().withMutation(t=>t.nullable().optional())}transform(t){let n=this.clone();return n.transforms.push(t),n}test(...t){let n;if(t.length===1?typeof t[0]=="function"?n={test:t[0]}:n=t[0]:t.length===2?n={name:t[0],test:t[1]}:n={name:t[0],message:t[1],test:t[2]},n.message===void 0&&(n.message=Tt.default),typeof n.test!="function")throw new TypeError("`test` is a required parameters");let r=this.clone(),i=Tn(n),o=n.exclusive||n.name&&r.exclusiveTests[n.name]===!0;if(n.exclusive&&!n.name)throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");return n.name&&(r.exclusiveTests[n.name]=!!n.exclusive),r.tests=r.tests.filter(s=>!(s.OPTIONS.name===n.name&&(o||s.OPTIONS.test===i.OPTIONS.test))),r.tests.push(i),r}when(t,n){!Array.isArray(t)&&typeof t!="string"&&(n=t,t=".");let r=this.clone(),i=bu(t).map(o=>new ln(o));return i.forEach(o=>{o.isSibling&&r.deps.push(o.key)}),r.conditions.push(typeof n=="function"?new si(i,n):si.fromOptions(i,n)),r}typeError(t){let n=this.clone();return n.internalTests.typeError=Tn({message:t,name:"typeError",skipAbsent:!0,test(r){return this.schema._typeCheck(r)?!0:this.createError({params:{type:this.schema.type}})}}),n}oneOf(t,n=Tt.oneOf){let r=this.clone();return t.forEach(i=>{r._whitelist.add(i),r._blacklist.delete(i)}),r.internalTests.whiteList=Tn({message:n,name:"oneOf",skipAbsent:!0,test(i){let o=this.schema._whitelist,s=o.resolveAll(this.resolve);return s.includes(i)?!0:this.createError({params:{values:Array.from(o).join(", "),resolved:s}})}}),r}notOneOf(t,n=Tt.notOneOf){let r=this.clone();return t.forEach(i=>{r._blacklist.add(i),r._whitelist.delete(i)}),r.internalTests.blacklist=Tn({message:n,name:"notOneOf",test(i){let o=this.schema._blacklist,s=o.resolveAll(this.resolve);return s.includes(i)?this.createError({params:{values:Array.from(o).join(", "),resolved:s}}):!0}}),r}strip(t=!0){let n=this.clone();return n.spec.strip=t,n}describe(t){const n=(t?this.resolve(t):this).clone(),{label:r,meta:i,optional:o,nullable:s}=n.spec;return{meta:i,label:r,optional:o,nullable:s,default:n.getDefault(t),type:n.type,oneOf:n._whitelist.describe(),notOneOf:n._blacklist.describe(),tests:n.tests.map(a=>({name:a.OPTIONS.name,params:a.OPTIONS.params})).filter((a,u,c)=>c.findIndex(f=>f.name===a.name)===u)}}}nt.prototype.__isYupSchema__=!0;for(const e of["validate","validateSync"])nt.prototype[`${e}At`]=function(t,n,r={}){const{parent:i,parentPath:o,schema:s}=Vy(this,t,n,r.context);return s[e](i&&i[o],Object.assign({},r,{parent:i,path:t}))};for(const e of["equals","is"])nt.prototype[e]=nt.prototype.oneOf;for(const e of["not","nope"])nt.prototype[e]=nt.prototype.notOneOf;function or(){return new Su}class Su extends nt{constructor(){super({type:"boolean",check(t){return t instanceof Boolean&&(t=t.valueOf()),typeof t=="boolean"}}),this.withMutation(()=>{this.transform((t,n,r)=>{if(r.spec.coerce&&!r.isType(t)){if(/^(true|1)$/i.test(String(t)))return!0;if(/^(false|0)$/i.test(String(t)))return!1}return t})})}isTrue(t=Qo.isValue){return this.test({message:t,name:"is-value",exclusive:!0,params:{value:"true"},test(n){return ft(n)||n===!0}})}isFalse(t=Qo.isValue){return this.test({message:t,name:"is-value",exclusive:!0,params:{value:"false"},test(n){return ft(n)||n===!1}})}default(t){return super.default(t)}defined(t){return super.defined(t)}optional(){return super.optional()}required(t){return super.required(t)}notRequired(){return super.notRequired()}nullable(){return super.nullable()}nonNullable(t){return super.nonNullable(t)}strip(t){return super.strip(t)}}or.prototype=Su.prototype;const Ry=/^(\d{4}|[+-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,.](\d{1,}))?)?(?:(Z)|([+-])(\d{2})(?::?(\d{2}))?)?)?$/;function By(e){const t=Zo(e);if(!t)return Date.parse?Date.parse(e):Number.NaN;if(t.z===void 0&&t.plusMinus===void 0)return new Date(t.year,t.month,t.day,t.hour,t.minute,t.second,t.millisecond).valueOf();let n=0;return t.z!=="Z"&&t.plusMinus!==void 0&&(n=t.hourOffset*60+t.minuteOffset,t.plusMinus==="+"&&(n=0-n)),Date.UTC(t.year,t.month,t.day,t.hour,t.minute+n,t.second,t.millisecond)}function Zo(e){var t,n;const r=Ry.exec(e);return r?{year:Pt(r[1]),month:Pt(r[2],1)-1,day:Pt(r[3],1),hour:Pt(r[4]),minute:Pt(r[5]),second:Pt(r[6]),millisecond:r[7]?Pt(r[7].substring(0,3)):0,precision:(t=(n=r[7])==null?void 0:n.length)!=null?t:void 0,z:r[8]||void 0,plusMinus:r[9]||void 0,hourOffset:Pt(r[10]),minuteOffset:Pt(r[11])}:null}function Pt(e,t=0){return Number(e)||t}let Uy=/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Hy=/^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,qy=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,zy="^\\d{4}-\\d{2}-\\d{2}",Wy="\\d{2}:\\d{2}:\\d{2}",Ky="(([+-]\\d{2}(:?\\d{2})?)|Z)",Yy=new RegExp(`${zy}T${Wy}(\\.\\d+)?${Ky}$`),Gy=e=>ft(e)||e===e.trim(),Xy={}.toString();function Ce(){return new _u}class _u extends nt{constructor(){super({type:"string",check(t){return t instanceof String&&(t=t.valueOf()),typeof t=="string"}}),this.withMutation(()=>{this.transform((t,n,r)=>{if(!r.spec.coerce||r.isType(t)||Array.isArray(t))return t;const i=t!=null&&t.toString?t.toString():t;return i===Xy?t:i})})}required(t){return super.required(t).withMutation(n=>n.test({message:t||Tt.required,name:"required",skipAbsent:!0,test:r=>!!r.length}))}notRequired(){return super.notRequired().withMutation(t=>(t.tests=t.tests.filter(n=>n.OPTIONS.name!=="required"),t))}length(t,n=Xe.length){return this.test({message:n,name:"length",exclusive:!0,params:{length:t},skipAbsent:!0,test(r){return r.length===this.resolve(t)}})}min(t,n=Xe.min){return this.test({message:n,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(r){return r.length>=this.resolve(t)}})}max(t,n=Xe.max){return this.test({name:"max",exclusive:!0,message:n,params:{max:t},skipAbsent:!0,test(r){return r.length<=this.resolve(t)}})}matches(t,n){let r=!1,i,o;return n&&(typeof n=="object"?{excludeEmptyString:r=!1,message:i,name:o}=n:i=n),this.test({name:o||"matches",message:i||Xe.matches,params:{regex:t},skipAbsent:!0,test:s=>s===""&&r||s.search(t)!==-1})}email(t=Xe.email){return this.matches(Uy,{name:"email",message:t,excludeEmptyString:!0})}url(t=Xe.url){return this.matches(Hy,{name:"url",message:t,excludeEmptyString:!0})}uuid(t=Xe.uuid){return this.matches(qy,{name:"uuid",message:t,excludeEmptyString:!1})}datetime(t){let n="",r,i;return t&&(typeof t=="object"?{message:n="",allowOffset:r=!1,precision:i=void 0}=t:n=t),this.matches(Yy,{name:"datetime",message:n||Xe.datetime,excludeEmptyString:!0}).test({name:"datetime_offset",message:n||Xe.datetime_offset,params:{allowOffset:r},skipAbsent:!0,test:o=>{if(!o||r)return!0;const s=Zo(o);return s?!!s.z:!1}}).test({name:"datetime_precision",message:n||Xe.datetime_precision,params:{precision:i},skipAbsent:!0,test:o=>{if(!o||i==null)return!0;const s=Zo(o);return s?s.precision===i:!1}})}ensure(){return this.default("").transform(t=>t===null?"":t)}trim(t=Xe.trim){return this.transform(n=>n!=null?n.trim():n).test({message:t,name:"trim",test:Gy})}lowercase(t=Xe.lowercase){return this.transform(n=>ft(n)?n:n.toLowerCase()).test({message:t,name:"string_case",exclusive:!0,skipAbsent:!0,test:n=>ft(n)||n===n.toLowerCase()})}uppercase(t=Xe.uppercase){return this.transform(n=>ft(n)?n:n.toUpperCase()).test({message:t,name:"string_case",exclusive:!0,skipAbsent:!0,test:n=>ft(n)||n===n.toUpperCase()})}}Ce.prototype=_u.prototype;let Jy=e=>e!=+e;function sr(){return new Cu}class Cu extends nt{constructor(){super({type:"number",check(t){return t instanceof Number&&(t=t.valueOf()),typeof t=="number"&&!Jy(t)}}),this.withMutation(()=>{this.transform((t,n,r)=>{if(!r.spec.coerce)return t;let i=t;if(typeof i=="string"){if(i=i.replace(/\s/g,""),i==="")return NaN;i=+i}return r.isType(i)||i===null?i:parseFloat(i)})})}min(t,n=qt.min){return this.test({message:n,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(r){return r>=this.resolve(t)}})}max(t,n=qt.max){return this.test({message:n,name:"max",exclusive:!0,params:{max:t},skipAbsent:!0,test(r){return r<=this.resolve(t)}})}lessThan(t,n=qt.lessThan){return this.test({message:n,name:"max",exclusive:!0,params:{less:t},skipAbsent:!0,test(r){return r<this.resolve(t)}})}moreThan(t,n=qt.moreThan){return this.test({message:n,name:"min",exclusive:!0,params:{more:t},skipAbsent:!0,test(r){return r>this.resolve(t)}})}positive(t=qt.positive){return this.moreThan(0,t)}negative(t=qt.negative){return this.lessThan(0,t)}integer(t=qt.integer){return this.test({name:"integer",message:t,skipAbsent:!0,test:n=>Number.isInteger(n)})}truncate(){return this.transform(t=>ft(t)?t:t|0)}round(t){var n;let r=["ceil","floor","round","trunc"];if(t=((n=t)==null?void 0:n.toLowerCase())||"round",t==="trunc")return this.truncate();if(r.indexOf(t.toLowerCase())===-1)throw new TypeError("Only valid options for round() are: "+r.join(", "));return this.transform(i=>ft(i)?i:Math[t](i))}}sr.prototype=Cu.prototype;let Fu=new Date(""),Qy=e=>Object.prototype.toString.call(e)==="[object Date]";function es(){return new ar}class ar extends nt{constructor(){super({type:"date",check(t){return Qy(t)&&!isNaN(t.getTime())}}),this.withMutation(()=>{this.transform((t,n,r)=>!r.spec.coerce||r.isType(t)||t===null?t:(t=By(t),isNaN(t)?ar.INVALID_DATE:new Date(t)))})}prepareParam(t,n){let r;if(ln.isRef(t))r=t;else{let i=this.cast(t);if(!this._typeCheck(i))throw new TypeError(`\`${n}\` must be a Date or a value that can be \`cast()\` to a Date`);r=i}return r}min(t,n=Jo.min){let r=this.prepareParam(t,"min");return this.test({message:n,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(i){return i>=this.resolve(r)}})}max(t,n=Jo.max){let r=this.prepareParam(t,"max");return this.test({message:n,name:"max",exclusive:!0,params:{max:t},skipAbsent:!0,test(i){return i<=this.resolve(r)}})}}ar.INVALID_DATE=Fu,es.prototype=ar.prototype,es.INVALID_DATE=Fu;function Zy(e,t=[]){let n=[],r=new Set,i=new Set(t.map(([s,l])=>`${s}-${l}`));function o(s,l){let a=an.split(s)[0];r.add(a),i.has(`${l}-${a}`)||n.push([l,a])}for(const s of Object.keys(e)){let l=e[s];r.add(s),ln.isRef(l)&&l.isSibling?o(l.path,s):oi(l)&&"deps"in l&&l.deps.forEach(a=>o(a,s))}return Ay.array(Array.from(r),n).reverse()}function ku(e,t){let n=1/0;return e.some((r,i)=>{var o;if((o=t.path)!=null&&o.includes(r))return n=i,!0}),n}function $u(e){return(t,n)=>ku(e,t)-ku(e,n)}const Ou=(e,t,n)=>{if(typeof e!="string")return e;let r=e;try{r=JSON.parse(e)}catch{}return n.isType(r)?r:e};function ui(e){if("fields"in e){const t={};for(const[n,r]of Object.entries(e.fields))t[n]=ui(r);return e.setFields(t)}if(e.type==="array"){const t=e.optional();return t.innerType&&(t.innerType=ui(t.innerType)),t}return e.type==="tuple"?e.optional().clone({types:e.spec.types.map(ui)}):"optional"in e?e.optional():e}const ev=(e,t)=>{const n=[...an.normalizePath(t)];if(n.length===1)return n[0]in e;let r=n.pop(),i=an.getter(an.join(n),!0)(e);return!!(i&&r in i)};let Au=e=>Object.prototype.toString.call(e)==="[object Object]";function Du(e,t){let n=Object.keys(e.fields);return Object.keys(t).filter(r=>n.indexOf(r)===-1)}const tv=$u([]);function lr(e){return new Lu(e)}class Lu extends nt{constructor(t){super({type:"object",check(n){return Au(n)||typeof n=="function"}}),this.fields=Object.create(null),this._sortErrors=tv,this._nodes=[],this._excludedEdges=[],this.withMutation(()=>{t&&this.shape(t)})}_cast(t,n={}){var r;let i=super._cast(t,n);if(i===void 0)return this.getDefault(n);if(!this._typeCheck(i))return i;let o=this.fields,s=(r=n.stripUnknown)!=null?r:this.spec.noUnknown,l=[].concat(this._nodes,Object.keys(i).filter(f=>!this._nodes.includes(f))),a={},u=Object.assign({},n,{parent:a,__validating:n.__validating||!1}),c=!1;for(const f of l){let m=o[f],d=f in i;if(m){let p,v=i[f];u.path=(n.path?`${n.path}.`:"")+f,m=m.resolve({value:v,context:n.context,parent:a});let b=m instanceof nt?m.spec:void 0,g=b==null?void 0:b.strict;if(b!=null&&b.strip){c=c||f in i;continue}p=!n.__validating||!g?m.cast(i[f],u):i[f],p!==void 0&&(a[f]=p)}else d&&!s&&(a[f]=i[f]);(d!==f in a||a[f]!==i[f])&&(c=!0)}return c?a:i}_validate(t,n={},r,i){let{from:o=[],originalValue:s=t,recursive:l=this.spec.recursive}=n;n.from=[{schema:this,value:s},...o],n.__validating=!0,n.originalValue=s,super._validate(t,n,r,(a,u)=>{if(!l||!Au(u)){i(a,u);return}s=s||u;let c=[];for(let f of this._nodes){let m=this.fields[f];!m||ln.isRef(m)||c.push(m.asNestedTest({options:n,key:f,parent:u,parentPath:n.path,originalParent:s}))}this.runTests({tests:c,value:u,originalValue:s,options:n},r,f=>{i(f.sort(this._sortErrors).concat(a),u)})})}clone(t){const n=super.clone(t);return n.fields=Object.assign({},this.fields),n._nodes=this._nodes,n._excludedEdges=this._excludedEdges,n._sortErrors=this._sortErrors,n}concat(t){let n=super.concat(t),r=n.fields;for(let[i,o]of Object.entries(this.fields)){const s=r[i];r[i]=s===void 0?o:s}return n.withMutation(i=>i.setFields(r,[...this._excludedEdges,...t._excludedEdges]))}_getDefault(t){if("default"in this.spec)return super._getDefault(t);if(!this._nodes.length)return;let n={};return this._nodes.forEach(r=>{var i;const o=this.fields[r];let s=t;(i=s)!=null&&i.value&&(s=Object.assign({},s,{parent:s.value,value:s.value[r]})),n[r]=o&&"getDefault"in o?o.getDefault(s):void 0}),n}setFields(t,n){let r=this.clone();return r.fields=t,r._nodes=Zy(t,n),r._sortErrors=$u(Object.keys(t)),n&&(r._excludedEdges=n),r}shape(t,n=[]){return this.clone().withMutation(r=>{let i=r._excludedEdges;return n.length&&(Array.isArray(n[0])||(n=[n]),i=[...r._excludedEdges,...n]),r.setFields(Object.assign(r.fields,t),i)})}partial(){const t={};for(const[n,r]of Object.entries(this.fields))t[n]="optional"in r&&r.optional instanceof Function?r.optional():r;return this.setFields(t)}deepPartial(){return ui(this)}pick(t){const n={};for(const r of t)this.fields[r]&&(n[r]=this.fields[r]);return this.setFields(n,this._excludedEdges.filter(([r,i])=>t.includes(r)&&t.includes(i)))}omit(t){const n=[];for(const r of Object.keys(this.fields))t.includes(r)||n.push(r);return this.pick(n)}from(t,n,r){let i=an.getter(t,!0);return this.transform(o=>{if(!o)return o;let s=o;return ev(o,t)&&(s=Object.assign({},o),r||delete s[t],s[n]=i(o)),s})}json(){return this.transform(Ou)}exact(t){return this.test({name:"exact",exclusive:!0,message:t||ri.exact,test(n){if(n==null)return!0;const r=Du(this.schema,n);return r.length===0||this.createError({params:{properties:r.join(", ")}})}})}stripUnknown(){return this.clone({noUnknown:!0})}noUnknown(t=!0,n=ri.noUnknown){typeof t!="boolean"&&(n=t,t=!0);let r=this.test({name:"noUnknown",exclusive:!0,message:n,test(i){if(i==null)return!0;const o=Du(this.schema,i);return!t||o.length===0||this.createError({params:{unknown:o.join(", ")}})}});return r.spec.noUnknown=t,r}unknown(t=!0,n=ri.noUnknown){return this.noUnknown(!t,n)}transformKeys(t){return this.transform(n=>{if(!n)return n;const r={};for(const i of Object.keys(n))r[t(i)]=n[i];return r})}camelCase(){return this.transformKeys(Xo.camelCase)}snakeCase(){return this.transformKeys(Xo.snakeCase)}constantCase(){return this.transformKeys(t=>Xo.snakeCase(t).toUpperCase())}describe(t){const n=(t?this.resolve(t):this).clone(),r=super.describe(t);r.fields={};for(const[o,s]of Object.entries(n.fields)){var i;let l=t;(i=l)!=null&&i.value&&(l=Object.assign({},l,{parent:l.value,value:l.value[o]})),r.fields[o]=s.describe(l)}return r}}lr.prototype=Lu.prototype;function Pu(e){return new ju(e)}class ju extends nt{constructor(t){super({type:"array",spec:{types:t},check(n){return Array.isArray(n)}}),this.innerType=void 0,this.innerType=t}_cast(t,n){const r=super._cast(t,n);if(!this._typeCheck(r)||!this.innerType)return r;let i=!1;const o=r.map((s,l)=>{const a=this.innerType.cast(s,Object.assign({},n,{path:`${n.path||""}[${l}]`}));return a!==s&&(i=!0),a});return i?o:r}_validate(t,n={},r,i){var o;let s=this.innerType,l=(o=n.recursive)!=null?o:this.spec.recursive;n.originalValue!=null&&n.originalValue,super._validate(t,n,r,(a,u)=>{var c;if(!l||!s||!this._typeCheck(u)){i(a,u);return}let f=new Array(u.length);for(let d=0;d<u.length;d++){var m;f[d]=s.asNestedTest({options:n,index:d,parent:u,parentPath:n.path,originalParent:(m=n.originalValue)!=null?m:t})}this.runTests({value:u,tests:f,originalValue:(c=n.originalValue)!=null?c:t,options:n},r,d=>i(d.concat(a),u))})}clone(t){const n=super.clone(t);return n.innerType=this.innerType,n}json(){return this.transform(Ou)}concat(t){let n=super.concat(t);return n.innerType=this.innerType,t.innerType&&(n.innerType=n.innerType?n.innerType.concat(t.innerType):t.innerType),n}of(t){let n=this.clone();if(!oi(t))throw new TypeError("`array.of()` sub-schema must be a valid yup schema not: "+Lt(t));return n.innerType=t,n.spec=Object.assign({},n.spec,{types:t}),n}length(t,n=ii.length){return this.test({message:n,name:"length",exclusive:!0,params:{length:t},skipAbsent:!0,test(r){return r.length===this.resolve(t)}})}min(t,n){return n=n||ii.min,this.test({message:n,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(r){return r.length>=this.resolve(t)}})}max(t,n){return n=n||ii.max,this.test({message:n,name:"max",exclusive:!0,params:{max:t},skipAbsent:!0,test(r){return r.length<=this.resolve(t)}})}ensure(){return this.default(()=>[]).transform((t,n)=>this._typeCheck(t)?t:n==null?[]:[].concat(n))}compact(t){let n=t?(r,i,o)=>!t(r,i,o):r=>!!r;return this.transform(r=>r!=null?r.filter(n):r)}describe(t){const n=(t?this.resolve(t):this).clone(),r=super.describe(t);if(n.innerType){var i;let o=t;(i=o)!=null&&i.value&&(o=Object.assign({},o,{parent:o.value,value:o.value[0]})),r.innerType=n.innerType.describe(o)}return r}}Pu.prototype=ju.prototype;const nv=({tabs:e,className:t="",count:n={},setActiveTab:r,activeTab:i,btnClass:o=""})=>{const s=rt("flex gap-x-3 mb-8 w-full no-scrollbar overflow-x-auto border-b border-[#EAECF0] darks:border-gray-500",t);return w.jsx("div",{className:s,children:e.map(l=>{const a=i===l.key,u=n[l.key]||0,c=rt("capitalize text-xs whitespace-nowrap no-scrollbar md:text-sm font-semibold pb-[14px] border-b-2 px-6 flex items-center justify-center gap-x-1 flex-1 text-center",o),f=rt({"border-gray-400 darks:border-white !text-primary darks:!text-white":a,"border-transparent text-[#667085] darks:!text-white/60":!a}),m=u>0&&w.jsx("span",{className:"text-xs h-6 min-w-[24px] rounded-full flex justify-center items-center border border-[#EAECF0] darks:border-gray-500 bg-[#F9FAFB] darks:bg-gray-800 text-[#454745] darks:text-white/80",children:u});return w.jsxs("button",{onClick:()=>r(l.key),className:rt(c,f),"aria-selected":a,role:"tab",type:"button",children:[l.title,m]},l.key)})})},rv=[{type:"textField",label:"Short Text",icon:"fluent:text-16-filled",inputLabel:"Short Text Label",required:!1,inputType:"text",maxLength:null,minLength:null,placeholder:"Type here",description:"",isReadOnly:!1,isDisabled:!1,isRequired:!1,requiredMessage:"Field is required",minLengthMessage:"",maxLengthMessage:"",value:null},{type:"longText",label:"Long Text",icon:"dashicons:text",inputLabel:"Long Text Label",required:!1,inputType:"text",maxLength:null,minLength:null,placeholder:"Type here",description:"",isReadOnly:!1,isDisabled:!1,isRequired:!1,requiredMessage:"Field is required",minLengthMessage:"",maxLengthMessage:"",value:null},{type:"selectField",label:"Select List",icon:"tabler:select",inputLabel:"Select Text Label",required:!1,inputType:"select",maxLength:null,minLength:null,placeholder:"Type here",description:"",isReadOnly:!1,isDisabled:!1,isRequired:!1,requiredMessage:"Field is required",minLengthMessage:"",maxLengthMessage:"",value:null,options:[]},{type:"multiSelect",label:"MultiSelect",icon:"fluent-mdl2:multi-select",inputLabel:"Select Text Label",required:!1,inputType:"select",maxLength:null,minLength:null,placeholder:"Type here",description:"",isReadOnly:!1,isDisabled:!1,isRequired:!1,requiredMessage:"Field is required",minLengthMessage:"",maxLengthMessage:"",value:null,options:[]},{type:"numberField",label:"Number",icon:"octicon:number-16",inputLabel:"Number Label",required:!1,inputType:"number",maxLength:null,minLength:null,placeholder:"Type here",description:"",isReadOnly:!1,isDisabled:!1,isRequired:!1,requiredMessage:"Field is required",minLengthMessage:"",maxLengthMessage:"",value:null},{type:"amountField",label:"Amount",icon:"carbon:currency",inputLabel:"Enter amount",required:!1,inputType:"amount",maxAmount:null,minAmount:null,placeholder:"Type here",description:"",isReadOnly:!1,isDisabled:!1,isRequired:!1,requiredMessage:"Field is required",minAmountMessage:"",maxAmountMessage:"",value:null},{type:"date",label:"Date",icon:"bx:calendar",inputLabel:"Date Text Label",required:!1,inputType:"date",maxLength:null,minLength:null,placeholder:"Type here",description:"",isReadOnly:!1,isDisabled:!1,isRequired:!1,requiredMessage:"Field is required",minLengthMessage:"",maxLengthMessage:"",value:null},{type:"password",label:"Password",icon:"ic:round-password",inputLabel:"Password Text Label",required:!1,inputType:"password",maxLength:null,minLength:null,placeholder:"Type here",description:"",isReadOnly:!1,isDisabled:!1,isRequired:!1,requiredMessage:"Field is required",minLengthMessage:"",maxLengthMessage:"",value:null},{type:"checkbox",label:"Checkbox",icon:"mingcute:checkbox-line",inputLabel:"Checkbox Text Label",required:!1,inputType:"checkbox",maxLength:null,minLength:null,placeholder:"Type here",description:"",isReadOnly:!1,isDisabled:!1,isRequired:!1,requiredMessage:"Field is required",minLengthMessage:"",maxLengthMessage:"",value:null,options:[]},{type:"radio",label:"Radio select",icon:"ri:checkbox-circle-line",inputLabel:"Radio Text Label",required:!1,inputType:"radio",maxLength:null,minLength:null,placeholder:"Type here",description:"",isReadOnly:!1,isDisabled:!1,isRequired:!1,requiredMessage:"Field is required",minLengthMessage:"",maxLengthMessage:"",value:null,options:[]},{type:"email",label:"Email",icon:"mdi:email-outline",inputLabel:"Email Text Label",required:!1,inputType:"email",maxLength:null,minLength:null,placeholder:"Type here",description:"",isReadOnly:!1,isDisabled:!1,isRequired:!1,requiredMessage:"Field is required",minLengthMessage:"",maxLengthMessage:"",value:null},{type:"file",label:"File Attachment",icon:"ion:attach-sharp",inputLabel:"File Text Label",required:!1,inputType:"file",maxLength:null,minLength:null,placeholder:"Type here",description:"",isReadOnly:!1,isDisabled:!1,isRequired:!1,requiredMessage:"Field is required",minLengthMessage:"",maxLengthMessage:"",value:null},{type:"grid",label:"Grid",icon:"cuida:grid-outline",inputLabel:"Grid Text Label",inputType:"grid",placeholder:"Type here",description:"",grid:2,gridData:[]}],iv=["text","number"],ov=["text","number","amount","date","password"],sv=["amount"],av=["grid","section"],lv=["radio","select","checkbox","multiselect"],uv=lr().shape({inputLabel:Ce().required("Label is required"),placeholder:Ce().nullable(),description:Ce().nullable(),isReadOnly:or(),isDisabled:or(),isRequired:or(),requiredMessage:Ce().nullable(),minLengthMessage:Ce().nullable(),maxLengthMessage:Ce().nullable(),maxLength:sr().nullable(),minLength:sr().nullable(),inputType:Ce().nullable(),maxAmountMessage:Ce().nullable(),maxAmount:Ce().nullable(),options:Pu().of(lr().shape({label:Ce().nullable(),value:Ce().when("label",{is:e=>e&&e.length>0,then:e=>e.required("Value is required when label is present"),otherwise:e=>e.nullable()})})).nullable()}),cv=[{title:"Basics",key:"basic"},{title:"Validations",key:"validation"}],fv=({isOpen:e,onClose:t,element:n})=>{const{updateElement:r}=h.useContext(Ot),[i,o]=h.useState("basic"),{register:s,handleSubmit:l,control:a,formState:{errors:u,isSubmitting:c,isValid:f},reset:m}=Wo({resolver:Ko(uv),defaultValues:{...n,options:n.options||[]}}),{fields:d,append:p,remove:v}=gy({control:a,name:"options"});h.useEffect(()=>{e||m()},[e,m]);const b=y=>{r(y,n.sectionId),t()},g=()=>w.jsxs("div",{className:"flex flex-col gap-y-1 justify-start",children:[d.map((y,x)=>w.jsxs("div",{className:"flex gap-x-4 items-center ",children:[w.jsx("div",{className:"flex-1",children:w.jsx(ye,{label:"Label",name:`options.${x}.label`,register:s,errors:u,element:n,placeholder:"Label",isFloating:!0})}),w.jsx("div",{className:"flex-1",children:w.jsx(ye,{label:"Value",name:`options.${x}.value`,register:s,errors:u,element:n,placeholder:"Value",isFloating:!0})})," ",w.jsx("button",{type:"button",className:"outline-none hover:opacity-80",onClick:()=>v(x),children:w.jsx(He,{icon:"iconamoon:sign-times-fill"})})]},y.id)),w.jsxs("div",{children:[" ",w.jsxs("button",{type:"button",className:"mt-2 text-gray-500 font-medium text-sm flex gap-x-1 items-center",onClick:()=>p({label:"",value:"",id:Or()}),children:[w.jsx(He,{icon:"qlementine-icons:plus-16"})," Add Option"]})]})]});return w.jsx("div",{className:"fixed inset-0 bg-black/30 flex items-center justify-center z-[999] cursor-default no-drag select-none",children:w.jsxs("div",{className:"min-w-[600px] bg-white rounded-xl shadow-xl relative flex flex-col items-center",children:[w.jsxs("div",{className:"w-full px-6 pt-6 pb-5 flex flex-col items-start gap-4 z-10 mb-6",children:[w.jsx("h2",{className:"text-lg font-semibold text-[#475467] font-onest",children:n.label}),w.jsx("button",{onClick:t,className:"absolute right-4 top-4 p-2 text-[#98A2B3] hover:bg-gray-50 rounded-lg",children:w.jsx(He,{icon:"tabler:x"})})]}),w.jsx("div",{className:"w-full",children:w.jsx(nv,{tabs:cv,setActiveTab:o,activeTab:i,className:"justify-start !text-left",btnClass:"!uppercase !text-left"})}),w.jsxs("form",{onSubmit:l(b),className:"w-full",children:[i==="basic"&&w.jsxs("div",{className:"w-full px-6 flex flex-col gap-5 z-10",children:[w.jsx(ye,{label:"Label",name:"inputLabel",register:s,errors:u,element:n}),ov.includes(n.inputType)&&w.jsx(ye,{label:"Placeholder",name:"placeholder",register:s,errors:u,element:n}),w.jsx(ye,{label:"Short Description",name:"description",register:s,errors:u,element:n}),lv.includes(n.inputType)&&g()]}),!av.includes(n.type.toLowerCase())&&i==="validation"&&w.jsxs("div",{className:"w-full px-6 flex flex-col gap-5 z-10",children:[w.jsxs("div",{className:"flex gap-x-6 items-center",children:[w.jsx("div",{className:"w-[150px]",children:w.jsx(ye,{label:"Required",name:"isRequired",register:s,errors:u,element:n,type:"checkbox"})})," ",w.jsx("div",{className:"flex-1",children:w.jsx(ye,{label:"Error message text",name:"requiredMessage",register:s,errors:u,element:n})})]}),iv.includes(n.inputType)&&w.jsxs(w.Fragment,{children:[w.jsxs("div",{className:"flex gap-x-6 items-center",children:[w.jsx("div",{className:"w-[150px]",children:w.jsx(ye,{label:"Min Length",name:"minLength",register:s,errors:u,element:n,type:"number"})})," ",w.jsx("div",{className:"flex-1",children:w.jsx(ye,{label:"Error message text",name:"minLengthMessage",register:s,errors:u,element:n})})]}),w.jsxs("div",{className:"flex gap-x-6 items-center",children:[w.jsx("div",{className:"w-[150px]",children:w.jsx(ye,{label:"Max Length",name:"maxLength",register:s,errors:u,element:n,type:"number"})})," ",w.jsx("div",{className:"flex-1",children:w.jsx(ye,{label:"Error message text",name:"maxLengthMessage",register:s,errors:u,element:n})})]})]}),sv.includes(n.inputType)&&w.jsxs(w.Fragment,{children:[w.jsxs("div",{className:"flex gap-x-6 items-center",children:[w.jsx("div",{className:"w-[150px]",children:w.jsx(ye,{label:"Min Amount",name:"minAmount",register:s,errors:u,element:n,type:"amount"})})," ",w.jsx("div",{className:"flex-1",children:w.jsx(ye,{label:"Error message text",name:"minAmountMessage",register:s,errors:u,element:n})})]}),w.jsxs("div",{className:"flex gap-x-6 items-center",children:[w.jsx("div",{className:"w-[150px]",children:w.jsx(ye,{label:"Max Amount",name:"maxAmount",register:s,errors:u,element:n,type:"amount"})})," ",w.jsx("div",{className:"flex-1",children:w.jsx(ye,{label:"Error message text",name:"maxAmountMessage",register:s,errors:u,element:n})})]})]})]}),w.jsxs("div",{className:"w-full px-6 pt-8 pb-6 flex gap-3 mt-4",children:[w.jsx("button",{type:"button",onClick:t,className:"flex-1 px-4 py-2.5 bg-white border border-[#D0D5DD] rounded-lg shadow-xs font-semibold text-[#344054] font-onest",children:"Cancel"}),w.jsx("button",{type:"submit",disabled:!f||c,className:`flex-1 px-4 py-2.5 ${!f||c?"bg-[#F2F4F7]":"bg-[#C6593C]"} ${!f||c?"text-[#98A2B3]":"text-white"} rounded-lg shadow-xs font-semibold font-onest disabled:opacity-50`,children:c?"Saving...":"Save"})]})]})]})})},Nu=h.memo(({state:e,element:t,children:n})=>{const[r,i]=h.useState(!1),{removeElement:o}=h.useContext(Ot),s=h.useCallback(()=>{o(t.id,t.sectionId)},[t.id,o]);return w.jsxs("div",{children:[r&&w.jsx(fv,{isOpen:r,onClose:()=>i(!1),element:t}),w.jsxs("div",{className:"flex justify-between items-center mb-2",children:[w.jsx("label",{className:"text-sm font-medium",children:t.inputLabel}),e==="edit"&&w.jsxs("span",{className:"flex gap-x-3 items-center",children:[w.jsx("button",{type:"button",className:"outline-none hover:opacity-80",onClick:()=>i(!0),children:w.jsx(He,{icon:"circum:edit"})}),w.jsx("button",{type:"button",className:"outline-none hover:opacity-80",onClick:s,children:w.jsx(He,{icon:"iconamoon:sign-times-fill"})})]})]}),n]})});Nu.displayName="ElementContainer";function Iu({element:e,validationData:t}){const{register:n=()=>({})}=t||{};return w.jsx(ye,{placeholder:e.placeholder,type:e.inputType,label:"",name:e.id,register:n})}const dv={textField:Ar,longText:Wl,selectField:zl,multiSelect:ha,numberField:Ar,amountField:Iu,date:pa,password:wa,checkbox:Sa,radio:Ea,email:ma,file:ba,grid:xa,section:Ta},Mu="edit",pv=e=>{const t=dv[e.type];return t?w.jsx(Nu,{element:e,state:Mu,children:w.jsx(t,{element:e,state:Mu})}):null};function hv({elementData:e,sectionId:t}){const{formData:n,updateElementPosition:r,isDragging:i}=h.useContext(Ot),[o,s]=h.useState(null),l=h.useCallback((f,m)=>{f.dataTransfer.setData("properties",m),s(m)},[]),a=h.useCallback(f=>{f.preventDefault(),f.stopPropagation(),f.dataTransfer.dropEffect="move"},[]),u=h.useCallback(f=>{var d;f.preventDefault(),f.stopPropagation();const m=(d=n.find(p=>p.id===t))==null?void 0:d.questionData;try{const p=f.dataTransfer.getData("properties"),v=f.currentTarget;if(!v.id||p===v.id)return;const b=m.findIndex(y=>y.id===p),g=m.findIndex(y=>y.id===v.id);if(b===-1||g===-1)return;if(m.length){const y=[...m];[y[b],y[g]]=[y[g],y[b]],r(y,t),s(null)}}catch{s(null)}},[n,r]),c=h.useCallback(f=>w.jsx("div",{id:f.id,className:`cursor-move border p-4 w-full transition-colors rounded-lg ${o===f.id?"bg-gray-100":""} ${o&&o!==f.id?"border-dashed border-blue-300":""}`,draggable:!0,onDrop:u,onDragOver:a,onDragStart:m=>l(m,f.id),children:pv(f)},f.id),[o,u,a,l]);return e!=null&&e.length?w.jsxs("div",{className:"w-full h-full flex flex-col gap-y-4 relative",children:[e==null?void 0:e.map(c),i&&w.jsx("div",{className:"bg-gray-50 rounded p-6 h-[60px] border-2 border-dashed flex items-center justify-center text-gray-400 opacity-70",children:w.jsx(He,{icon:"octicon:plus-16"})})]}):w.jsx("div",{className:"w-full h-full flex items-center justify-center text-gray-500 min-h-[250px] p-10",children:"No input to display"})}const mv=lr({title:Ce(),description:Ce()}).required(),gv=({isOpen:e,onClose:t,section:n})=>{const{updateSection:r}=h.useContext(Ot),{register:i,handleSubmit:o,formState:{errors:s,isSubmitting:l,isValid:a},reset:u}=Wo({resolver:Ko(mv),defaultValues:n});if(h.useEffect(()=>{e||u()},[e,u]),!e)return null;const c=f=>{r(f,n.id),t()};return w.jsx("div",{className:"fixed inset-0 bg-black/30 flex items-center justify-center z-[999] cursor-default no-drag select-none",children:w.jsxs("div",{className:"min-w-[600px] bg-white rounded-xl shadow-xl relative flex flex-col items-center",children:[w.jsxs("div",{className:"w-full px-6 pt-6 pb-5 flex flex-col items-start gap-4 z-10 mb-6",children:[w.jsx("h2",{className:"text-lg font-semibold text-[#475467] font-onest",children:"Update Section Information"}),w.jsx("button",{onClick:t,className:"absolute right-4 top-4 p-2 text-[#98A2B3] hover:bg-gray-50 rounded-lg",children:w.jsx(He,{icon:"tabler:x"})})]}),w.jsxs("form",{onSubmit:o(c),className:"w-full",children:[w.jsxs("div",{className:"w-full px-6 flex flex-col gap-5 z-10",children:[w.jsx(ye,{label:"Title",name:"title",register:i,errors:s}),w.jsx(ye,{label:"Description",name:"description",register:i,errors:s})]}),w.jsxs("div",{className:"w-full px-6 pt-8 pb-6 flex gap-3 mt-4",children:[w.jsx("button",{type:"button",onClick:t,className:"flex-1 px-4 py-2.5 bg-white border border-[#D0D5DD] rounded-lg shadow-xs font-semibold text-[#344054] font-onest",children:"Cancel"}),w.jsx("button",{type:"submit",disabled:!a||l,className:`flex-1 px-4 py-2.5 ${!a||l?"bg-[#F2F4F7]":"bg-[#C6593C]"} ${!a||l?"text-[#98A2B3]":"text-white"} rounded-lg shadow-xs font-semibold font-onest disabled:opacity-50`,children:l?"Saving...":"Save"})]})]})]})})},yv=()=>{const[e,t]=h.useState(!1),n=h.useRef(null),[r,i]=h.useState([0]),{removeSection:o,addElement:s,formData:l,setIsDragging:a}=h.useContext(Ot),u=h.useCallback(d=>{d.preventDefault(),d.dataTransfer.dropEffect="move"},[]),c=h.useCallback(d=>{try{d.preventDefault(),a(!1);const p=d==null?void 0:d.currentTarget,v=d.dataTransfer.getData("properties");if(v){const b=JSON.parse(v),g={id:Or(),sectionId:p.id,...b};s(g,p.id)}}catch{a(!1)}},[]);function f(d){r.includes(d)?i(p=>p.filter(v=>v!==d)):i(p=>[...p,d])}function m(d){n.current=d,t(!0)}return w.jsxs("div",{className:"flex gap-x-4 mx-auto h-full relative px-6 pb-5 flex-col no-scrollbar overflow-y-auto max-h-[86vh]",children:[e&&w.jsx(gv,{isOpen:e,onClose:()=>t(!1),section:n.current}),w.jsx("div",{className:" relative w-full flex flex-col gap-y-6 flex-1 py-5",children:l.map((d,p)=>w.jsxs("div",{className:"group",children:[w.jsxs("div",{className:`border rounded-lg py-4 px-6 transition-colors duration-200 ${r.includes(p)?"min-h-[300px]":""}`,children:[w.jsxs("div",{className:"flex justify-between items-center",children:[w.jsx("h2",{children:d.title}),w.jsxs("div",{className:"flex gap-x-4 items-center",children:[w.jsx("button",{type:"button",className:"p-1 border rounded-lg",onClick:()=>m(d),children:w.jsx(He,{icon:"fluent:edit-28-regular"})}),l.length>1&&w.jsx("button",{type:"button",className:"p-1 border rounded-lg",onClick:()=>o(d.id),children:w.jsx(He,{icon:"lets-icons:trash-duotone-line"})}),w.jsx("button",{type:"button",className:"p-1 rounded-lg",onClick:()=>f(p),children:w.jsx(He,{icon:r.includes(p)?"gravity-ui:minus":"octicon:plus-16"})})]})]}),r.includes(p)&&w.jsxs("div",{className:"mt-4 transition-all duration-200 h-full",id:d.id,onDrop:c,onDragOver:u,children:[w.jsx("hr",{}),w.jsx("div",{className:" gap-y-6 mt-4 h-full",children:w.jsx(hv,{elementData:d.questionData,sectionId:d.id})})]})]}),w.jsx("hr",{className:"mt-6 group-last:hidden"})]},d.id))})]})};function vv(){return w.jsx("div",{className:"bg-white p-4 border border-[#E4E7EC] rounded-lg h-full overflow-y-auto",children:w.jsx(yv,{})})}const bv=()=>{const{setIsDragging:e}=h.useContext(Ot),t=h.useCallback((n,r)=>{n.dataTransfer.setData("properties",JSON.stringify(r)),n.dataTransfer.effectAllowed="move",e(!0)},[]);return w.jsx("div",{className:"w-full",children:w.jsx("div",{className:"pt-4 px-5 max-h-[70vh] overflow-y-auto",children:w.jsx("div",{children:w.jsx("ul",{className:"grid gap-y-[8px] mt-3",children:rv.map(n=>w.jsxs("li",{onDragStart:r=>t(r,n),style:{borderColor:n.color,color:n.color},className:`cursor-move text-[#475467] flex justify-between items-center \r
|
|
57
|
+
attempted value: ${o}
|
|
58
|
+
`+(a!==o?`result of cast: ${a}`:""))}return s}_cast(t,n){let r=t===void 0?t:this.transforms.reduce((i,s)=>s.call(this,i,t,this),t);return r===void 0&&(r=this.getDefault(n)),r}_validate(t,n={},r,i){let{path:s,originalValue:o=t,strict:a=this.spec.strict}=n,l=t;a||(l=this._cast(l,Object.assign({assert:!1},n)));let u=[];for(let c of Object.values(this.internalTests))c&&u.push(c);this.runTests({path:s,value:l,originalValue:o,options:n,tests:u},r,c=>{if(c.length)return i(c,l);this.runTests({path:s,value:l,originalValue:o,options:n,tests:this.tests},r,i)})}runTests(t,n,r){let i=!1,{tests:s,value:o,originalValue:a,path:l,options:u}=t,c=g=>{i||(i=!0,n(g,o))},f=g=>{i||(i=!0,r(g,o))},m=s.length,p=[];if(!m)return f([]);let d={value:o,originalValue:a,path:l,options:u,schema:this};for(let g=0;g<s.length;g++){const v=s[g];v(d,c,function(x){x&&(Array.isArray(x)?p.push(...x):p.push(x)),--m<=0&&f(p)})}}asNestedTest({key:t,index:n,parent:r,parentPath:i,originalParent:s,options:o}){const a=t??n;if(a==null)throw TypeError("Must include `key` or `index` for nested validations");const l=typeof a=="number";let u=r[a];const c=Object.assign({},o,{strict:!0,parent:r,value:u,originalValue:s[a],key:void 0,[l?"index":"key"]:a,path:l||a.includes(".")?`${i||""}[${l?a:`"${a}"`}]`:(i?`${i}.`:"")+t});return(f,m,p)=>this.resolve(c)._validate(u,c,m,p)}validate(t,n){var r;let i=this.resolve(Object.assign({},n,{value:t})),s=(r=n==null?void 0:n.disableStackTrace)!=null?r:i.spec.disableStackTrace;return new Promise((o,a)=>i._validate(t,n,(l,u)=>{Ze.isError(l)&&(l.value=u),a(l)},(l,u)=>{l.length?a(new Ze(l,u,void 0,void 0,s)):o(u)}))}validateSync(t,n){var r;let i=this.resolve(Object.assign({},n,{value:t})),s,o=(r=n==null?void 0:n.disableStackTrace)!=null?r:i.spec.disableStackTrace;return i._validate(t,Object.assign({},n,{sync:!0}),(a,l)=>{throw Ze.isError(a)&&(a.value=l),a},(a,l)=>{if(a.length)throw new Ze(a,t,void 0,void 0,o);s=l}),s}isValid(t,n){return this.validate(t,n).then(()=>!0,r=>{if(Ze.isError(r))return!1;throw r})}isValidSync(t,n){try{return this.validateSync(t,n),!0}catch(r){if(Ze.isError(r))return!1;throw r}}_getDefault(t){let n=this.spec.default;return n==null?n:typeof n=="function"?n.call(this,t):In(n)}getDefault(t){return this.resolve(t||{})._getDefault(t)}default(t){return arguments.length===0?this._getDefault():this.clone({default:t})}strict(t=!0){return this.clone({strict:t})}nullability(t,n){const r=this.clone({nullable:t});return r.internalTests.nullable=Dn({message:n,name:"nullable",test(i){return i===null?this.schema.spec.nullable:!0}}),r}optionality(t,n){const r=this.clone({optional:t});return r.internalTests.optionality=Dn({message:n,name:"optionality",test(i){return i===void 0?this.schema.spec.optional:!0}}),r}optional(){return this.optionality(!0)}defined(t=$t.defined){return this.optionality(!1,t)}nullable(){return this.nullability(!0)}nonNullable(t=$t.notNull){return this.nullability(!1,t)}required(t=$t.required){return this.clone().withMutation(n=>n.nonNullable(t).defined(t))}notRequired(){return this.clone().withMutation(t=>t.nullable().optional())}transform(t){let n=this.clone();return n.transforms.push(t),n}test(...t){let n;if(t.length===1?typeof t[0]=="function"?n={test:t[0]}:n=t[0]:t.length===2?n={name:t[0],test:t[1]}:n={name:t[0],message:t[1],test:t[2]},n.message===void 0&&(n.message=$t.default),typeof n.test!="function")throw new TypeError("`test` is a required parameters");let r=this.clone(),i=Dn(n),s=n.exclusive||n.name&&r.exclusiveTests[n.name]===!0;if(n.exclusive&&!n.name)throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");return n.name&&(r.exclusiveTests[n.name]=!!n.exclusive),r.tests=r.tests.filter(o=>!(o.OPTIONS.name===n.name&&(s||o.OPTIONS.test===i.OPTIONS.test))),r.tests.push(i),r}when(t,n){!Array.isArray(t)&&typeof t!="string"&&(n=t,t=".");let r=this.clone(),i=dc(t).map(s=>new yn(s));return i.forEach(s=>{s.isSibling&&r.deps.push(s.key)}),r.conditions.push(typeof n=="function"?new Ti(i,n):Ti.fromOptions(i,n)),r}typeError(t){let n=this.clone();return n.internalTests.typeError=Dn({message:t,name:"typeError",skipAbsent:!0,test(r){return this.schema._typeCheck(r)?!0:this.createError({params:{type:this.schema.type}})}}),n}oneOf(t,n=$t.oneOf){let r=this.clone();return t.forEach(i=>{r._whitelist.add(i),r._blacklist.delete(i)}),r.internalTests.whiteList=Dn({message:n,name:"oneOf",skipAbsent:!0,test(i){let s=this.schema._whitelist,o=s.resolveAll(this.resolve);return o.includes(i)?!0:this.createError({params:{values:Array.from(s).join(", "),resolved:o}})}}),r}notOneOf(t,n=$t.notOneOf){let r=this.clone();return t.forEach(i=>{r._blacklist.add(i),r._whitelist.delete(i)}),r.internalTests.blacklist=Dn({message:n,name:"notOneOf",test(i){let s=this.schema._blacklist,o=s.resolveAll(this.resolve);return o.includes(i)?this.createError({params:{values:Array.from(s).join(", "),resolved:o}}):!0}}),r}strip(t=!0){let n=this.clone();return n.spec.strip=t,n}describe(t){const n=(t?this.resolve(t):this).clone(),{label:r,meta:i,optional:s,nullable:o}=n.spec;return{meta:i,label:r,optional:s,nullable:o,default:n.getDefault(t),type:n.type,oneOf:n._whitelist.describe(),notOneOf:n._blacklist.describe(),tests:n.tests.map(l=>({name:l.OPTIONS.name,params:l.OPTIONS.params})).filter((l,u,c)=>c.findIndex(f=>f.name===l.name)===u)}}}tt.prototype.__isYupSchema__=!0;for(const e of["validate","validateSync"])tt.prototype[`${e}At`]=function(t,n,r={}){const{parent:i,parentPath:s,schema:o}=xv(this,t,n,r.context);return o[e](i&&i[s],Object.assign({},r,{parent:i,path:t}))};for(const e of["equals","is"])tt.prototype[e]=tt.prototype.oneOf;for(const e of["not","nope"])tt.prototype[e]=tt.prototype.notOneOf;const wv=()=>!0;function xr(e){return new yc(e)}class yc extends tt{constructor(t){super(typeof t=="function"?{type:"mixed",check:t}:Object.assign({type:"mixed",check:wv},t))}}xr.prototype=yc.prototype;function Oi(){return new bc}class bc extends tt{constructor(){super({type:"boolean",check(t){return t instanceof Boolean&&(t=t.valueOf()),typeof t=="boolean"}}),this.withMutation(()=>{this.transform((t,n,r)=>{if(r.spec.coerce&&!r.isType(t)){if(/^(true|1)$/i.test(String(t)))return!0;if(/^(false|0)$/i.test(String(t)))return!1}return t})})}isTrue(t=Ao.isValue){return this.test({message:t,name:"is-value",exclusive:!0,params:{value:"true"},test(n){return bt(n)||n===!0}})}isFalse(t=Ao.isValue){return this.test({message:t,name:"is-value",exclusive:!0,params:{value:"false"},test(n){return bt(n)||n===!1}})}default(t){return super.default(t)}defined(t){return super.defined(t)}optional(){return super.optional()}required(t){return super.required(t)}notRequired(){return super.notRequired()}nullable(){return super.nullable()}nonNullable(t){return super.nonNullable(t)}strip(t){return super.strip(t)}}Oi.prototype=bc.prototype;const Ev=/^(\d{4}|[+-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,.](\d{1,}))?)?(?:(Z)|([+-])(\d{2})(?::?(\d{2}))?)?)?$/;function Sv(e){const t=$o(e);if(!t)return Date.parse?Date.parse(e):Number.NaN;if(t.z===void 0&&t.plusMinus===void 0)return new Date(t.year,t.month,t.day,t.hour,t.minute,t.second,t.millisecond).valueOf();let n=0;return t.z!=="Z"&&t.plusMinus!==void 0&&(n=t.hourOffset*60+t.minuteOffset,t.plusMinus==="+"&&(n=0-n)),Date.UTC(t.year,t.month,t.day,t.hour,t.minute+n,t.second,t.millisecond)}function $o(e){var t,n;const r=Ev.exec(e);return r?{year:Ut(r[1]),month:Ut(r[2],1)-1,day:Ut(r[3],1),hour:Ut(r[4]),minute:Ut(r[5]),second:Ut(r[6]),millisecond:r[7]?Ut(r[7].substring(0,3)):0,precision:(t=(n=r[7])==null?void 0:n.length)!=null?t:void 0,z:r[8]||void 0,plusMinus:r[9]||void 0,hourOffset:Ut(r[10]),minuteOffset:Ut(r[11])}:null}function Ut(e,t=0){return Number(e)||t}let Tv=/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,_v=/^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,Cv=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,Ov="^\\d{4}-\\d{2}-\\d{2}",kv="\\d{2}:\\d{2}:\\d{2}",Fv="(([+-]\\d{2}(:?\\d{2})?)|Z)",Av=new RegExp(`${Ov}T${kv}(\\.\\d+)?${Fv}$`),$v=e=>bt(e)||e===e.trim(),jv={}.toString();function be(){return new vc}class vc extends tt{constructor(){super({type:"string",check(t){return t instanceof String&&(t=t.valueOf()),typeof t=="string"}}),this.withMutation(()=>{this.transform((t,n,r)=>{if(!r.spec.coerce||r.isType(t)||Array.isArray(t))return t;const i=t!=null&&t.toString?t.toString():t;return i===jv?t:i})})}required(t){return super.required(t).withMutation(n=>n.test({message:t||$t.required,name:"required",skipAbsent:!0,test:r=>!!r.length}))}notRequired(){return super.notRequired().withMutation(t=>(t.tests=t.tests.filter(n=>n.OPTIONS.name!=="required"),t))}length(t,n=et.length){return this.test({message:n,name:"length",exclusive:!0,params:{length:t},skipAbsent:!0,test(r){return r.length===this.resolve(t)}})}min(t,n=et.min){return this.test({message:n,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(r){return r.length>=this.resolve(t)}})}max(t,n=et.max){return this.test({name:"max",exclusive:!0,message:n,params:{max:t},skipAbsent:!0,test(r){return r.length<=this.resolve(t)}})}matches(t,n){let r=!1,i,s;return n&&(typeof n=="object"?{excludeEmptyString:r=!1,message:i,name:s}=n:i=n),this.test({name:s||"matches",message:i||et.matches,params:{regex:t},skipAbsent:!0,test:o=>o===""&&r||o.search(t)!==-1})}email(t=et.email){return this.matches(Tv,{name:"email",message:t,excludeEmptyString:!0})}url(t=et.url){return this.matches(_v,{name:"url",message:t,excludeEmptyString:!0})}uuid(t=et.uuid){return this.matches(Cv,{name:"uuid",message:t,excludeEmptyString:!1})}datetime(t){let n="",r,i;return t&&(typeof t=="object"?{message:n="",allowOffset:r=!1,precision:i=void 0}=t:n=t),this.matches(Av,{name:"datetime",message:n||et.datetime,excludeEmptyString:!0}).test({name:"datetime_offset",message:n||et.datetime_offset,params:{allowOffset:r},skipAbsent:!0,test:s=>{if(!s||r)return!0;const o=$o(s);return o?!!o.z:!1}}).test({name:"datetime_precision",message:n||et.datetime_precision,params:{precision:i},skipAbsent:!0,test:s=>{if(!s||i==null)return!0;const o=$o(s);return o?o.precision===i:!1}})}ensure(){return this.default("").transform(t=>t===null?"":t)}trim(t=et.trim){return this.transform(n=>n!=null?n.trim():n).test({message:t,name:"trim",test:$v})}lowercase(t=et.lowercase){return this.transform(n=>bt(n)?n:n.toLowerCase()).test({message:t,name:"string_case",exclusive:!0,skipAbsent:!0,test:n=>bt(n)||n===n.toLowerCase()})}uppercase(t=et.uppercase){return this.transform(n=>bt(n)?n:n.toUpperCase()).test({message:t,name:"string_case",exclusive:!0,skipAbsent:!0,test:n=>bt(n)||n===n.toUpperCase()})}}be.prototype=vc.prototype;let Nv=e=>e!=+e;function wr(){return new xc}class xc extends tt{constructor(){super({type:"number",check(t){return t instanceof Number&&(t=t.valueOf()),typeof t=="number"&&!Nv(t)}}),this.withMutation(()=>{this.transform((t,n,r)=>{if(!r.spec.coerce)return t;let i=t;if(typeof i=="string"){if(i=i.replace(/\s/g,""),i==="")return NaN;i=+i}return r.isType(i)||i===null?i:parseFloat(i)})})}min(t,n=Zt.min){return this.test({message:n,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(r){return r>=this.resolve(t)}})}max(t,n=Zt.max){return this.test({message:n,name:"max",exclusive:!0,params:{max:t},skipAbsent:!0,test(r){return r<=this.resolve(t)}})}lessThan(t,n=Zt.lessThan){return this.test({message:n,name:"max",exclusive:!0,params:{less:t},skipAbsent:!0,test(r){return r<this.resolve(t)}})}moreThan(t,n=Zt.moreThan){return this.test({message:n,name:"min",exclusive:!0,params:{more:t},skipAbsent:!0,test(r){return r>this.resolve(t)}})}positive(t=Zt.positive){return this.moreThan(0,t)}negative(t=Zt.negative){return this.lessThan(0,t)}integer(t=Zt.integer){return this.test({name:"integer",message:t,skipAbsent:!0,test:n=>Number.isInteger(n)})}truncate(){return this.transform(t=>bt(t)?t:t|0)}round(t){var n;let r=["ceil","floor","round","trunc"];if(t=((n=t)==null?void 0:n.toLowerCase())||"round",t==="trunc")return this.truncate();if(r.indexOf(t.toLowerCase())===-1)throw new TypeError("Only valid options for round() are: "+r.join(", "));return this.transform(i=>bt(i)?i:Math[t](i))}}wr.prototype=xc.prototype;let wc=new Date(""),Pv=e=>Object.prototype.toString.call(e)==="[object Date]";function jo(){return new Er}class Er extends tt{constructor(){super({type:"date",check(t){return Pv(t)&&!isNaN(t.getTime())}}),this.withMutation(()=>{this.transform((t,n,r)=>!r.spec.coerce||r.isType(t)||t===null?t:(t=Sv(t),isNaN(t)?Er.INVALID_DATE:new Date(t)))})}prepareParam(t,n){let r;if(yn.isRef(t))r=t;else{let i=this.cast(t);if(!this._typeCheck(i))throw new TypeError(`\`${n}\` must be a Date or a value that can be \`cast()\` to a Date`);r=i}return r}min(t,n=Fo.min){let r=this.prepareParam(t,"min");return this.test({message:n,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(i){return i>=this.resolve(r)}})}max(t,n=Fo.max){let r=this.prepareParam(t,"max");return this.test({message:n,name:"max",exclusive:!0,params:{max:t},skipAbsent:!0,test(i){return i<=this.resolve(r)}})}}Er.INVALID_DATE=wc,jo.prototype=Er.prototype,jo.INVALID_DATE=wc;function Lv(e,t=[]){let n=[],r=new Set,i=new Set(t.map(([o,a])=>`${o}-${a}`));function s(o,a){let l=gn.split(o)[0];r.add(l),i.has(`${a}-${l}`)||n.push([a,l])}for(const o of Object.keys(e)){let a=e[o];r.add(o),yn.isRef(a)&&a.isSibling?s(a.path,o):Si(a)&&"deps"in a&&a.deps.forEach(l=>s(l,o))}return dv.array(Array.from(r),n).reverse()}function Ec(e,t){let n=1/0;return e.some((r,i)=>{var s;if((s=t.path)!=null&&s.includes(r))return n=i,!0}),n}function Sc(e){return(t,n)=>Ec(e,t)-Ec(e,n)}const Tc=(e,t,n)=>{if(typeof e!="string")return e;let r=e;try{r=JSON.parse(e)}catch{}return n.isType(r)?r:e};function ki(e){if("fields"in e){const t={};for(const[n,r]of Object.entries(e.fields))t[n]=ki(r);return e.setFields(t)}if(e.type==="array"){const t=e.optional();return t.innerType&&(t.innerType=ki(t.innerType)),t}return e.type==="tuple"?e.optional().clone({types:e.spec.types.map(ki)}):"optional"in e?e.optional():e}const Dv=(e,t)=>{const n=[...gn.normalizePath(t)];if(n.length===1)return n[0]in e;let r=n.pop(),i=gn.getter(gn.join(n),!0)(e);return!!(i&&r in i)};let _c=e=>Object.prototype.toString.call(e)==="[object Object]";function Cc(e,t){let n=Object.keys(e.fields);return Object.keys(t).filter(r=>n.indexOf(r)===-1)}const Iv=Sc([]);function Sr(e){return new Oc(e)}class Oc extends tt{constructor(t){super({type:"object",check(n){return _c(n)||typeof n=="function"}}),this.fields=Object.create(null),this._sortErrors=Iv,this._nodes=[],this._excludedEdges=[],this.withMutation(()=>{t&&this.shape(t)})}_cast(t,n={}){var r;let i=super._cast(t,n);if(i===void 0)return this.getDefault(n);if(!this._typeCheck(i))return i;let s=this.fields,o=(r=n.stripUnknown)!=null?r:this.spec.noUnknown,a=[].concat(this._nodes,Object.keys(i).filter(f=>!this._nodes.includes(f))),l={},u=Object.assign({},n,{parent:l,__validating:n.__validating||!1}),c=!1;for(const f of a){let m=s[f],p=f in i;if(m){let d,g=i[f];u.path=(n.path?`${n.path}.`:"")+f,m=m.resolve({value:g,context:n.context,parent:l});let v=m instanceof tt?m.spec:void 0,b=v==null?void 0:v.strict;if(v!=null&&v.strip){c=c||f in i;continue}d=!n.__validating||!b?m.cast(i[f],u):i[f],d!==void 0&&(l[f]=d)}else p&&!o&&(l[f]=i[f]);(p!==f in l||l[f]!==i[f])&&(c=!0)}return c?l:i}_validate(t,n={},r,i){let{from:s=[],originalValue:o=t,recursive:a=this.spec.recursive}=n;n.from=[{schema:this,value:o},...s],n.__validating=!0,n.originalValue=o,super._validate(t,n,r,(l,u)=>{if(!a||!_c(u)){i(l,u);return}o=o||u;let c=[];for(let f of this._nodes){let m=this.fields[f];!m||yn.isRef(m)||c.push(m.asNestedTest({options:n,key:f,parent:u,parentPath:n.path,originalParent:o}))}this.runTests({tests:c,value:u,originalValue:o,options:n},r,f=>{i(f.sort(this._sortErrors).concat(l),u)})})}clone(t){const n=super.clone(t);return n.fields=Object.assign({},this.fields),n._nodes=this._nodes,n._excludedEdges=this._excludedEdges,n._sortErrors=this._sortErrors,n}concat(t){let n=super.concat(t),r=n.fields;for(let[i,s]of Object.entries(this.fields)){const o=r[i];r[i]=o===void 0?s:o}return n.withMutation(i=>i.setFields(r,[...this._excludedEdges,...t._excludedEdges]))}_getDefault(t){if("default"in this.spec)return super._getDefault(t);if(!this._nodes.length)return;let n={};return this._nodes.forEach(r=>{var i;const s=this.fields[r];let o=t;(i=o)!=null&&i.value&&(o=Object.assign({},o,{parent:o.value,value:o.value[r]})),n[r]=s&&"getDefault"in s?s.getDefault(o):void 0}),n}setFields(t,n){let r=this.clone();return r.fields=t,r._nodes=Lv(t,n),r._sortErrors=Sc(Object.keys(t)),n&&(r._excludedEdges=n),r}shape(t,n=[]){return this.clone().withMutation(r=>{let i=r._excludedEdges;return n.length&&(Array.isArray(n[0])||(n=[n]),i=[...r._excludedEdges,...n]),r.setFields(Object.assign(r.fields,t),i)})}partial(){const t={};for(const[n,r]of Object.entries(this.fields))t[n]="optional"in r&&r.optional instanceof Function?r.optional():r;return this.setFields(t)}deepPartial(){return ki(this)}pick(t){const n={};for(const r of t)this.fields[r]&&(n[r]=this.fields[r]);return this.setFields(n,this._excludedEdges.filter(([r,i])=>t.includes(r)&&t.includes(i)))}omit(t){const n=[];for(const r of Object.keys(this.fields))t.includes(r)||n.push(r);return this.pick(n)}from(t,n,r){let i=gn.getter(t,!0);return this.transform(s=>{if(!s)return s;let o=s;return Dv(s,t)&&(o=Object.assign({},s),r||delete o[t],o[n]=i(s)),o})}json(){return this.transform(Tc)}exact(t){return this.test({name:"exact",exclusive:!0,message:t||wi.exact,test(n){if(n==null)return!0;const r=Cc(this.schema,n);return r.length===0||this.createError({params:{properties:r.join(", ")}})}})}stripUnknown(){return this.clone({noUnknown:!0})}noUnknown(t=!0,n=wi.noUnknown){typeof t!="boolean"&&(n=t,t=!0);let r=this.test({name:"noUnknown",exclusive:!0,message:n,test(i){if(i==null)return!0;const s=Cc(this.schema,i);return!t||s.length===0||this.createError({params:{unknown:s.join(", ")}})}});return r.spec.noUnknown=t,r}unknown(t=!0,n=wi.noUnknown){return this.noUnknown(!t,n)}transformKeys(t){return this.transform(n=>{if(!n)return n;const r={};for(const i of Object.keys(n))r[t(i)]=n[i];return r})}camelCase(){return this.transformKeys(ko.camelCase)}snakeCase(){return this.transformKeys(ko.snakeCase)}constantCase(){return this.transformKeys(t=>ko.snakeCase(t).toUpperCase())}describe(t){const n=(t?this.resolve(t):this).clone(),r=super.describe(t);r.fields={};for(const[s,o]of Object.entries(n.fields)){var i;let a=t;(i=a)!=null&&i.value&&(a=Object.assign({},a,{parent:a.value,value:a.value[s]})),r.fields[s]=o.describe(a)}return r}}Sr.prototype=Oc.prototype;function kc(e){return new Fc(e)}class Fc extends tt{constructor(t){super({type:"array",spec:{types:t},check(n){return Array.isArray(n)}}),this.innerType=void 0,this.innerType=t}_cast(t,n){const r=super._cast(t,n);if(!this._typeCheck(r)||!this.innerType)return r;let i=!1;const s=r.map((o,a)=>{const l=this.innerType.cast(o,Object.assign({},n,{path:`${n.path||""}[${a}]`}));return l!==o&&(i=!0),l});return i?s:r}_validate(t,n={},r,i){var s;let o=this.innerType,a=(s=n.recursive)!=null?s:this.spec.recursive;n.originalValue!=null&&n.originalValue,super._validate(t,n,r,(l,u)=>{var c;if(!a||!o||!this._typeCheck(u)){i(l,u);return}let f=new Array(u.length);for(let p=0;p<u.length;p++){var m;f[p]=o.asNestedTest({options:n,index:p,parent:u,parentPath:n.path,originalParent:(m=n.originalValue)!=null?m:t})}this.runTests({value:u,tests:f,originalValue:(c=n.originalValue)!=null?c:t,options:n},r,p=>i(p.concat(l),u))})}clone(t){const n=super.clone(t);return n.innerType=this.innerType,n}json(){return this.transform(Tc)}concat(t){let n=super.concat(t);return n.innerType=this.innerType,t.innerType&&(n.innerType=n.innerType?n.innerType.concat(t.innerType):t.innerType),n}of(t){let n=this.clone();if(!Si(t))throw new TypeError("`array.of()` sub-schema must be a valid yup schema not: "+Bt(t));return n.innerType=t,n.spec=Object.assign({},n.spec,{types:t}),n}length(t,n=Ei.length){return this.test({message:n,name:"length",exclusive:!0,params:{length:t},skipAbsent:!0,test(r){return r.length===this.resolve(t)}})}min(t,n){return n=n||Ei.min,this.test({message:n,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(r){return r.length>=this.resolve(t)}})}max(t,n){return n=n||Ei.max,this.test({message:n,name:"max",exclusive:!0,params:{max:t},skipAbsent:!0,test(r){return r.length<=this.resolve(t)}})}ensure(){return this.default(()=>[]).transform((t,n)=>this._typeCheck(t)?t:n==null?[]:[].concat(n))}compact(t){let n=t?(r,i,s)=>!t(r,i,s):r=>!!r;return this.transform(r=>r!=null?r.filter(n):r)}describe(t){const n=(t?this.resolve(t):this).clone(),r=super.describe(t);if(n.innerType){var i;let s=t;(i=s)!=null&&i.value&&(s=Object.assign({},s,{parent:s.value,value:s.value[0]})),r.innerType=n.innerType.describe(s)}return r}}kc.prototype=Fc.prototype;const Mv=({tabs:e,className:t="",count:n={},setActiveTab:r,activeTab:i,btnClass:s=""})=>{const o=ut("flex gap-x-3 mb-8 w-full no-scrollbar overflow-x-auto border-b border-[#EAECF0] darks:border-gray-500",t);return y.jsx("div",{className:o,children:e.map(a=>{const l=i===a.key,u=n[a.key]||0,c=ut("capitalize text-xs whitespace-nowrap no-scrollbar md:text-sm font-semibold pb-[14px] border-b-2 px-6 flex items-center justify-center gap-x-1 flex-1 text-center",s),f=ut({"border-gray-400 darks:border-white !text-primary darks:!text-white":l,"border-transparent text-[#667085] darks:!text-white/60":!l}),m=u>0&&y.jsx("span",{className:"text-xs h-6 min-w-[24px] rounded-full flex justify-center items-center border border-[#EAECF0] darks:border-gray-500 bg-[#F9FAFB] darks:bg-gray-800 text-[#454745] darks:text-white/80",children:u});return y.jsxs("button",{onClick:()=>r(a.key),className:ut(c,f),"aria-selected":l,role:"tab",type:"button",children:[a.title,m]},a.key)})})},Rv=[{type:"textField",label:"Short Text",icon:"fluent:text-16-filled",inputLabel:"Short Text Label",required:!1,inputType:"text",maxLength:null,minLength:null,placeholder:"Type here",description:"",isReadOnly:!1,isDisabled:!1,isRequired:!1,requiredMessage:"Field is required",minLengthMessage:"",maxLengthMessage:"",value:null},{type:"longText",label:"Long Text",icon:"dashicons:text",inputLabel:"Long Text Label",required:!1,inputType:"text",maxLength:null,minLength:null,placeholder:"Type here",description:"",isReadOnly:!1,isDisabled:!1,isRequired:!1,requiredMessage:"Field is required",minLengthMessage:"",maxLengthMessage:"",value:null},{type:"selectField",label:"Select List",icon:"tabler:select",inputLabel:"Select Text Label",required:!1,inputType:"select",maxLength:null,minLength:null,placeholder:"Type here",description:"",isReadOnly:!1,isDisabled:!1,isRequired:!1,requiredMessage:"Field is required",minLengthMessage:"",maxLengthMessage:"",value:null,options:[]},{type:"multiSelect",label:"MultiSelect",icon:"fluent-mdl2:multi-select",inputLabel:"Select Text Label",required:!1,inputType:"select",maxLength:null,minLength:null,placeholder:"Type here",description:"",isReadOnly:!1,isDisabled:!1,isRequired:!1,requiredMessage:"Field is required",minLengthMessage:"",maxLengthMessage:"",value:null,options:[]},{type:"validateInput",label:"Validate Input",icon:"iconoir:www",inputLabel:"Validate Input Label",required:!1,inputType:"validateInput",maxLength:null,minLength:null,placeholder:"Type here",description:"",isReadOnly:!1,isDisabled:!1,isRequired:!1,requiredMessage:"Value is required",minLengthMessage:"",maxLengthMessage:"",value:null,url:"https://api.example.com/validate?value={value}",method:"GET",responseType:"string"},{type:"numberField",label:"Number",icon:"octicon:number-16",inputLabel:"Number Label",required:!1,inputType:"number",maxLength:null,minLength:null,placeholder:"Type here",description:"",isReadOnly:!1,isDisabled:!1,isRequired:!1,requiredMessage:"Field is required",minLengthMessage:"",maxLengthMessage:"",value:null},{type:"amountField",label:"Amount",icon:"carbon:currency",inputLabel:"Enter amount",required:!1,inputType:"amount",maxAmount:null,minAmount:null,placeholder:"Type here",description:"",isReadOnly:!1,isDisabled:!1,isRequired:!1,requiredMessage:"Field is required",minAmountMessage:"",maxAmountMessage:"",value:null,prefix:null},{type:"date",label:"Date",icon:"bx:calendar",inputLabel:"Date Text Label",required:!1,inputType:"date",maxLength:null,minLength:null,placeholder:"Type here",description:"",isReadOnly:!1,isDisabled:!1,isRequired:!1,requiredMessage:"Field is required",minLengthMessage:"",maxLengthMessage:"",value:null},{type:"password",label:"Password",icon:"ic:round-password",inputLabel:"Password Text Label",required:!1,inputType:"password",maxLength:null,minLength:null,placeholder:"Type here",description:"",isReadOnly:!1,isDisabled:!1,isRequired:!1,requiredMessage:"Field is required",minLengthMessage:"",maxLengthMessage:"",value:null},{type:"checkbox",label:"Checkbox",icon:"mingcute:checkbox-line",inputLabel:"Checkbox Text Label",required:!1,inputType:"checkbox",maxLength:null,minLength:null,placeholder:"Type here",description:"",isReadOnly:!1,isDisabled:!1,isRequired:!1,requiredMessage:"Field is required",minLengthMessage:"",maxLengthMessage:"",value:null,options:[]},{type:"radio",label:"Radio select",icon:"ri:checkbox-circle-line",inputLabel:"Radio Text Label",required:!1,inputType:"radio",maxLength:null,minLength:null,placeholder:"Type here",description:"",isReadOnly:!1,isDisabled:!1,isRequired:!1,requiredMessage:"Field is required",minLengthMessage:"",maxLengthMessage:"",value:null,options:[]},{type:"email",label:"Email",icon:"mdi:email-outline",inputLabel:"Email Text Label",required:!1,inputType:"email",maxLength:null,minLength:null,placeholder:"Type here",description:"",isReadOnly:!1,isDisabled:!1,isRequired:!1,requiredMessage:"Field is required",minLengthMessage:"",maxLengthMessage:"",value:null},{type:"file",label:"File Attachment",icon:"ion:attach-sharp",inputLabel:"File Text Label",required:!1,inputType:"file",maxLength:null,minLength:null,placeholder:"Type here",description:"",isReadOnly:!1,isDisabled:!1,isRequired:!1,requiredMessage:"Field is required",minLengthMessage:"",maxLengthMessage:"",value:null},{type:"tableInput",label:"Table Input",icon:"iconoir:table",inputLabel:"Table Input Label",required:!1,inputType:"tableInput",maxLength:null,minLength:null,placeholder:"Type here",description:"",isReadOnly:!1,isDisabled:!1,isRequired:!1,requiredMessage:"Value is required",minLengthMessage:"",maxLengthMessage:"",value:[],denominators:null},{type:"grid",label:"Grid",icon:"cuida:grid-outline",inputLabel:"Grid Text Label",inputType:"grid",placeholder:"Type here",description:"",grid:2,gridData:[]}],Vv=["amount"],Bv=["text","number"],Uv=["text","number","amount","date","password"],Hv=["amount"],qv=["grid","section"],zv=["radio","select","checkbox","multiselect"],Wv=["validateInput"],Kv=["tableInput"];function Jv({value:e=[],onChange:t,onGetValue:n}){const[r,i]=h.useState((e==null?void 0:e.length)>0?e:[{value:""}]);h.useEffect(()=>{(e==null?void 0:e.length)>0&&JSON.stringify(e)!==JSON.stringify(r)&&i(e)},[e]);function s(l,u){const c=[...r];c[u]={...c[u],value:l},i(c),t&&t(c)}function o(){const l=[...r,{value:""}];i(l),t&&t(l)}function a(l){const u=r.filter((c,f)=>f!==l);i(u),t&&t(u)}return h.useEffect(()=>{n&&n(JSON.stringify({values:r}))},[n,r]),y.jsxs("div",{className:"]",children:[y.jsxs("div",{className:"border border-gray-200 rounded-lg overflow-hidden",children:[y.jsx("div",{className:"grid text-sm font-bold border-b border-gray-100 bg-gray-50",children:y.jsx("div",{className:"px-2 py-2",children:y.jsx("span",{className:"",children:"Add Denominations"})})}),r.map((l,u)=>y.jsx("div",{className:"grid text-sm border-b border-gray-100",children:y.jsxs("div",{className:"flex items-center gap-x-4 px-2 py-1",children:[y.jsx("span",{className:"flex-1",children:y.jsx(mi,{id:"input-example",className:"border border-gray-100 rounded w-full px-3 py-1 outline-none",decimalsLimit:6,defaultValue:l.value,onValueChange:c=>s(c,u),allowNegativeValue:!1})}),y.jsx("button",{onClick:()=>a(u),className:"text-red-500 hover:text-red-700 px-2",type:"button","aria-label":"Remove row",children:"×"})]})},l.key+u+Math.random()))]}),y.jsx("div",{className:"mt-1 flex justify-end",children:y.jsx("button",{type:"button",onClick:o,className:"font-semibold !text-blue-700 text-sm rounded outline-0 focus:outline-0",children:"+ Add"})})]})}const Yv=()=>y.jsx("blockquote",{className:"bg-gray-100 p-4 rounded-md text-gray-700",children:y.jsxs("ul",{children:[y.jsxs("li",{className:"text-xs",children:["API URL example format: ",y.jsx("code",{children:"https://example.com/validation?value={value}"})]}),y.jsxs("li",{className:"text-xs",children:[y.jsx("span",{className:"block mb-1",children:" Response example format:"}),y.jsx("pre",{className:"bg-white p-2 rounded-md",children:y.jsxs("code",{children:["{ ",y.jsx("br",{}),' "data": { ',y.jsx("br",{}),' "status": true, ',y.jsx("br",{}),' "description": "John Doe" ',y.jsx("br",{})," } ",y.jsx("br",{}),"}"]})})]})]})}),Gv=Sr().shape({inputLabel:be().required("Label is required"),placeholder:be().nullable(),description:be().nullable(),isReadOnly:Oi(),isDisabled:Oi(),isRequired:Oi(),requiredMessage:be().nullable(),minLengthMessage:be().nullable(),maxLengthMessage:be().nullable(),maxLength:wr().nullable(),minLength:wr().nullable(),inputType:be().nullable(),maxAmountMessage:be().nullable(),maxAmount:be().nullable(),options:kc().of(Sr().shape({label:be().nullable(),value:be().when("label",{is:e=>e&&e.length>0,then:e=>e.required("Value is required when label is present"),otherwise:e=>e.nullable()})})).nullable(),prefix:be().nullable(),url:be().nullable(),method:be().nullable(),denominators:xr().nullable(),responseType:be().nullable(),minAmount:be().nullable()}),Xv=[{title:"Basics",key:"basic"},{title:"Validations",key:"validation"}],Qv=({isOpen:e,onClose:t,element:n})=>{const{updateElement:r}=h.useContext(ht),[i,s]=h.useState("basic"),o=bs("config"),{register:a,handleSubmit:l,control:u,setValue:c,watch:f,trigger:m,formState:{errors:p,isSubmitting:d,isValid:g},reset:v}=To({resolver:_o(Gv),defaultValues:{...n,options:n.options||[]}}),{fields:b,append:x,remove:w}=Xb({control:u,name:"options"});h.useEffect(()=>{e||v()},[e,v]);const T=_=>{r(_,n.sectionId),t()},C=()=>y.jsxs("div",{className:"flex flex-col gap-y-1 justify-start",children:[b.map((_,O)=>y.jsxs("div",{className:"flex gap-x-4 items-center ",children:[y.jsx("div",{className:"flex-1",children:y.jsx(xe,{label:"Label",name:`options.${O}.label`,register:a,errors:p,element:n,placeholder:"Label",isFloating:!0})}),y.jsx("div",{className:"flex-1",children:y.jsx(xe,{label:"Value",name:`options.${O}.value`,register:a,errors:p,element:n,placeholder:"Value",isFloating:!0})})," ",y.jsx("button",{type:"button",className:"outline-none hover:opacity-80",onClick:()=>w(O),children:y.jsx(Be,{icon:"iconamoon:sign-times-fill"})})]},_.id)),y.jsxs("div",{children:[" ",y.jsxs("button",{type:"button",className:"mt-2 text-gray-700 font-medium text-sm flex gap-x-1 items-center",onClick:()=>x({label:"",value:"",id:tr()}),children:[y.jsx(Be,{icon:"qlementine-icons:plus-16"})," Add Option"]})]})]});return y.jsx("div",{className:"fixed inset-0 bg-black/30 flex items-center justify-center z-[999] cursor-default no-drag select-none",children:y.jsxs("div",{className:"min-w-[600px] bg-white rounded-xl shadow-xl relative flex flex-col items-center",children:[y.jsxs("div",{className:"w-full px-6 pt-6 pb-5 flex flex-col items-start gap-4 z-10 mb-6",children:[y.jsx("h2",{className:"text-lg font-semibold text-[#475467] font-onest",children:n.label}),y.jsx("button",{onClick:t,className:"absolute right-4 top-4 p-2 text-[#98A2B3] hover:bg-gray-50 rounded-lg",children:y.jsx(Be,{icon:"tabler:x"})})]}),y.jsx("div",{className:"w-full",children:y.jsx(Mv,{tabs:Xv,setActiveTab:s,activeTab:i,className:"justify-start !text-left",btnClass:"!uppercase !text-left"})}),y.jsxs("form",{onSubmit:l(T),className:"w-full",children:[i==="basic"&&y.jsxs("div",{className:"w-full px-6 flex flex-col gap-5 z-10",children:[y.jsx(xe,{label:"Label",name:"inputLabel",register:a,errors:p,element:n}),Uv.includes(n.inputType)&&y.jsx(xe,{label:"Placeholder",name:"placeholder",register:a,errors:p,element:n}),Vv.includes(n.inputType)&&y.jsx(xe,{label:"Prefix",name:"prefix",register:a,errors:p,element:n}),Wv.includes(n.inputType)&&y.jsxs(y.Fragment,{children:[y.jsx(Yv,{}),y.jsx(xe,{label:"Api Url",name:"url",register:a,errors:p,element:n}),y.jsx(io,{label:"Api Method",options:[{label:"GET",value:"GET"},{label:"POST",value:"POST"}],register:a,name:"method",setValue:c,trigger:m,value:f("method")}),y.jsx(io,{label:"Api Response type",options:[{label:"String",value:"string"},{label:"Object",value:"object"}],register:a,name:"responseType",setValue:c,trigger:m,value:f("responseType")})]}),Kv.includes(n.inputType)&&y.jsx(Jv,{onChange:_=>{c("denominators",_)},value:f("denominators")}),y.jsx(xe,{label:"Short Description",name:"description",register:a,errors:p,element:n}),zv.includes(n.inputType)&&C()]}),!qv.includes(n.type.toLowerCase())&&i==="validation"&&y.jsxs("div",{className:"w-full px-6 flex flex-col gap-5 z-10",children:[y.jsxs("div",{className:"flex gap-x-6 items-center",children:[y.jsx("div",{className:"w-[150px]",children:y.jsx(xe,{label:"Required",name:"isRequired",register:a,errors:p,element:n,type:"checkbox"})})," ",y.jsx("div",{className:"flex-1",children:y.jsx(xe,{label:"Error message text",name:"requiredMessage",register:a,errors:p,element:n})})]}),Bv.includes(n.inputType)&&y.jsxs(y.Fragment,{children:[y.jsxs("div",{className:"flex gap-x-6 items-center",children:[y.jsx("div",{className:"w-[150px]",children:y.jsx(xe,{label:"Min Length",name:"minLength",register:a,errors:p,element:n,type:"number"})})," ",y.jsx("div",{className:"flex-1",children:y.jsx(xe,{label:"Error message text",name:"minLengthMessage",register:a,errors:p,element:n})})]}),y.jsxs("div",{className:"flex gap-x-6 items-center",children:[y.jsx("div",{className:"w-[150px]",children:y.jsx(xe,{label:"Max Length",name:"maxLength",register:a,errors:p,element:n,type:"number"})})," ",y.jsx("div",{className:"flex-1",children:y.jsx(xe,{label:"Error message text",name:"maxLengthMessage",register:a,errors:p,element:n})})]})]}),Hv.includes(n.inputType)&&y.jsxs(y.Fragment,{children:[y.jsxs("div",{className:"flex gap-x-6 items-center",children:[y.jsx("div",{className:"w-[150px]",children:y.jsx(xe,{label:"Min Amount",name:"minAmount",register:a,errors:p,element:n,type:"amount"})})," ",y.jsx("div",{className:"flex-1",children:y.jsx(xe,{label:"Error message text",name:"minAmountMessage",register:a,errors:p,element:n})})]}),y.jsxs("div",{className:"flex gap-x-6 items-center",children:[y.jsx("div",{className:"w-[150px]",children:y.jsx(xe,{label:"Max Amount",name:"maxAmount",register:a,errors:p,element:n,type:"amount"})})," ",y.jsx("div",{className:"flex-1",children:y.jsx(xe,{label:"Error message text",name:"maxAmountMessage",register:a,errors:p,element:n})})]})]})]}),y.jsxs("div",{className:"w-full px-6 pt-8 pb-6 flex gap-3 mt-4",children:[y.jsx("button",{type:"button",onClick:t,className:"flex-1 px-4 py-2.5 bg-white border border-[#D0D5DD] rounded-lg shadow-xs font-semibold text-[#344054] font-onest",children:"Cancel"}),y.jsx("button",{type:"submit",disabled:!g||d,style:{background:o.buttonColor},className:`flex-1 px-4 py-2.5 ${!g||d?"bg-[#F2F4F7]":"bg-[#2563EB]"} ${!g||d?"text-[#98A2B3]":"text-white"} rounded-lg shadow-xs font-semibold font-onest disabled:opacity-50`,children:d?"Saving...":"Save"})]})]})]})})},Ac=h.memo(({state:e,element:t,children:n})=>{const[r,i]=h.useState(!1),{removeElement:s}=h.useContext(ht),o=h.useCallback(()=>{s(t.id,t.sectionId)},[t.id,s]);return y.jsxs("div",{children:[r&&y.jsx(Qv,{isOpen:r,onClose:()=>i(!1),element:t}),y.jsxs("div",{className:"flex justify-between items-center mb-2",children:[y.jsx("label",{className:"text-sm font-medium",children:t.inputLabel}),e==="edit"&&y.jsxs("span",{className:"flex gap-x-3 items-center",children:[y.jsx("button",{type:"button",className:"outline-none hover:opacity-80 text-sm",onClick:()=>i(!0),children:y.jsx(Be,{icon:"circum:edit"})}),y.jsx("button",{type:"button",className:"outline-none hover:opacity-80 text-sm",onClick:o,children:y.jsx(Be,{icon:"iconamoon:sign-times-fill"})})]})]}),n]})});Ac.displayName="ElementContainer";function $c({element:e,validationData:t}){const{register:n=()=>({}),trigger:r,setValue:i,watch:s,isReadOnly:o}=t||{};let a;return s&&(a=s()[e.id]),y.jsx(xe,{placeholder:e.placeholder,type:e.inputType,label:"",name:e.id,register:n,trigger:r,setValue:i,value:a,prefix:e.prefix,disabled:o})}function jc(e,t){return function(){return e.apply(t,arguments)}}const{toString:Zv}=Object.prototype,{getPrototypeOf:No}=Object,Fi=(e=>t=>{const n=Zv.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),vt=e=>(e=e.toLowerCase(),t=>Fi(t)===e),Ai=e=>t=>typeof t===e,{isArray:Mn}=Array,Tr=Ai("undefined");function e0(e){return e!==null&&!Tr(e)&&e.constructor!==null&&!Tr(e.constructor)&<(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Nc=vt("ArrayBuffer");function t0(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Nc(e.buffer),t}const n0=Ai("string"),lt=Ai("function"),Pc=Ai("number"),$i=e=>e!==null&&typeof e=="object",r0=e=>e===!0||e===!1,ji=e=>{if(Fi(e)!=="object")return!1;const t=No(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},i0=vt("Date"),s0=vt("File"),o0=vt("Blob"),a0=vt("FileList"),l0=e=>$i(e)&<(e.pipe),u0=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||lt(e.append)&&((t=Fi(e))==="formdata"||t==="object"&<(e.toString)&&e.toString()==="[object FormData]"))},c0=vt("URLSearchParams"),[f0,d0,p0,h0]=["ReadableStream","Request","Response","Headers"].map(vt),m0=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function _r(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,i;if(typeof e!="object"&&(e=[e]),Mn(e))for(r=0,i=e.length;r<i;r++)t.call(null,e[r],r,e);else{const s=n?Object.getOwnPropertyNames(e):Object.keys(e),o=s.length;let a;for(r=0;r<o;r++)a=s[r],t.call(null,e[a],a,e)}}function Lc(e,t){t=t.toLowerCase();const n=Object.keys(e);let r=n.length,i;for(;r-- >0;)if(i=n[r],t===i.toLowerCase())return i;return null}const bn=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Dc=e=>!Tr(e)&&e!==bn;function Po(){const{caseless:e}=Dc(this)&&this||{},t={},n=(r,i)=>{const s=e&&Lc(t,i)||i;ji(t[s])&&ji(r)?t[s]=Po(t[s],r):ji(r)?t[s]=Po({},r):Mn(r)?t[s]=r.slice():t[s]=r};for(let r=0,i=arguments.length;r<i;r++)arguments[r]&&_r(arguments[r],n);return t}const g0=(e,t,n,{allOwnKeys:r}={})=>(_r(t,(i,s)=>{n&<(i)?e[s]=jc(i,n):e[s]=i},{allOwnKeys:r}),e),y0=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),b0=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},v0=(e,t,n,r)=>{let i,s,o;const a={};if(t=t||{},e==null)return t;do{for(i=Object.getOwnPropertyNames(e),s=i.length;s-- >0;)o=i[s],(!r||r(o,e,t))&&!a[o]&&(t[o]=e[o],a[o]=!0);e=n!==!1&&No(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},x0=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},w0=e=>{if(!e)return null;if(Mn(e))return e;let t=e.length;if(!Pc(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},E0=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&No(Uint8Array)),S0=(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let i;for(;(i=r.next())&&!i.done;){const s=i.value;t.call(e,s[0],s[1])}},T0=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},_0=vt("HTMLFormElement"),C0=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,i){return r.toUpperCase()+i}),Ic=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),O0=vt("RegExp"),Mc=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};_r(n,(i,s)=>{let o;(o=t(i,s,e))!==!1&&(r[s]=o||i)}),Object.defineProperties(e,r)},k0=e=>{Mc(e,(t,n)=>{if(lt(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(lt(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},F0=(e,t)=>{const n={},r=i=>{i.forEach(s=>{n[s]=!0})};return Mn(e)?r(e):r(String(e).split(t)),n},A0=()=>{},$0=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function j0(e){return!!(e&<(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const N0=e=>{const t=new Array(10),n=(r,i)=>{if($i(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[i]=r;const s=Mn(r)?[]:{};return _r(r,(o,a)=>{const l=n(o,i+1);!Tr(l)&&(s[a]=l)}),t[i]=void 0,s}}return r};return n(e,0)},P0=vt("AsyncFunction"),L0=e=>e&&($i(e)||lt(e))&<(e.then)&<(e.catch),Rc=((e,t)=>e?setImmediate:t?((n,r)=>(bn.addEventListener("message",({source:i,data:s})=>{i===bn&&s===n&&r.length&&r.shift()()},!1),i=>{r.push(i),bn.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",lt(bn.postMessage)),D0=typeof queueMicrotask<"u"?queueMicrotask.bind(bn):typeof process<"u"&&process.nextTick||Rc,$={isArray:Mn,isArrayBuffer:Nc,isBuffer:e0,isFormData:u0,isArrayBufferView:t0,isString:n0,isNumber:Pc,isBoolean:r0,isObject:$i,isPlainObject:ji,isReadableStream:f0,isRequest:d0,isResponse:p0,isHeaders:h0,isUndefined:Tr,isDate:i0,isFile:s0,isBlob:o0,isRegExp:O0,isFunction:lt,isStream:l0,isURLSearchParams:c0,isTypedArray:E0,isFileList:a0,forEach:_r,merge:Po,extend:g0,trim:m0,stripBOM:y0,inherits:b0,toFlatObject:v0,kindOf:Fi,kindOfTest:vt,endsWith:x0,toArray:w0,forEachEntry:S0,matchAll:T0,isHTMLForm:_0,hasOwnProperty:Ic,hasOwnProp:Ic,reduceDescriptors:Mc,freezeMethods:k0,toObjectSet:F0,toCamelCase:C0,noop:A0,toFiniteNumber:$0,findKey:Lc,global:bn,isContextDefined:Dc,isSpecCompliantForm:j0,toJSONObject:N0,isAsyncFn:P0,isThenable:L0,setImmediate:Rc,asap:D0};function ee(e,t,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i,this.status=i.status?i.status:null)}$.inherits(ee,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:$.toJSONObject(this.config),code:this.code,status:this.status}}});const Vc=ee.prototype,Bc={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{Bc[e]={value:e}}),Object.defineProperties(ee,Bc),Object.defineProperty(Vc,"isAxiosError",{value:!0}),ee.from=(e,t,n,r,i,s)=>{const o=Object.create(Vc);return $.toFlatObject(e,o,function(l){return l!==Error.prototype},a=>a!=="isAxiosError"),ee.call(o,e.message,t,n,r,i),o.cause=e,o.name=e.name,s&&Object.assign(o,s),o};const I0=null;function Lo(e){return $.isPlainObject(e)||$.isArray(e)}function Uc(e){return $.endsWith(e,"[]")?e.slice(0,-2):e}function Hc(e,t,n){return e?e.concat(t).map(function(i,s){return i=Uc(i),!n&&s?"["+i+"]":i}).join(n?".":""):t}function M0(e){return $.isArray(e)&&!e.some(Lo)}const R0=$.toFlatObject($,{},null,function(t){return/^is[A-Z]/.test(t)});function Ni(e,t,n){if(!$.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=$.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(g,v){return!$.isUndefined(v[g])});const r=n.metaTokens,i=n.visitor||c,s=n.dots,o=n.indexes,l=(n.Blob||typeof Blob<"u"&&Blob)&&$.isSpecCompliantForm(t);if(!$.isFunction(i))throw new TypeError("visitor must be a function");function u(d){if(d===null)return"";if($.isDate(d))return d.toISOString();if(!l&&$.isBlob(d))throw new ee("Blob is not supported. Use a Buffer instead.");return $.isArrayBuffer(d)||$.isTypedArray(d)?l&&typeof Blob=="function"?new Blob([d]):Buffer.from(d):d}function c(d,g,v){let b=d;if(d&&!v&&typeof d=="object"){if($.endsWith(g,"{}"))g=r?g:g.slice(0,-2),d=JSON.stringify(d);else if($.isArray(d)&&M0(d)||($.isFileList(d)||$.endsWith(g,"[]"))&&(b=$.toArray(d)))return g=Uc(g),b.forEach(function(w,T){!($.isUndefined(w)||w===null)&&t.append(o===!0?Hc([g],T,s):o===null?g:g+"[]",u(w))}),!1}return Lo(d)?!0:(t.append(Hc(v,g,s),u(d)),!1)}const f=[],m=Object.assign(R0,{defaultVisitor:c,convertValue:u,isVisitable:Lo});function p(d,g){if(!$.isUndefined(d)){if(f.indexOf(d)!==-1)throw Error("Circular reference detected in "+g.join("."));f.push(d),$.forEach(d,function(b,x){(!($.isUndefined(b)||b===null)&&i.call(t,b,$.isString(x)?x.trim():x,g,m))===!0&&p(b,g?g.concat(x):[x])}),f.pop()}}if(!$.isObject(e))throw new TypeError("data must be an object");return p(e),t}function qc(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function Do(e,t){this._pairs=[],e&&Ni(e,this,t)}const zc=Do.prototype;zc.append=function(t,n){this._pairs.push([t,n])},zc.toString=function(t){const n=t?function(r){return t.call(this,r,qc)}:qc;return this._pairs.map(function(i){return n(i[0])+"="+n(i[1])},"").join("&")};function V0(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Wc(e,t,n){if(!t)return e;const r=n&&n.encode||V0;$.isFunction(n)&&(n={serialize:n});const i=n&&n.serialize;let s;if(i?s=i(t,n):s=$.isURLSearchParams(t)?t.toString():new Do(t,n).toString(r),s){const o=e.indexOf("#");o!==-1&&(e=e.slice(0,o)),e+=(e.indexOf("?")===-1?"?":"&")+s}return e}class Kc{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){$.forEach(this.handlers,function(r){r!==null&&t(r)})}}const Jc={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},B0={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:Do,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},Io=typeof window<"u"&&typeof document<"u",Mo=typeof navigator=="object"&&navigator||void 0,U0=Io&&(!Mo||["ReactNative","NativeScript","NS"].indexOf(Mo.product)<0),H0=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",q0=Io&&window.location.href||"http://localhost",qe={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Io,hasStandardBrowserEnv:U0,hasStandardBrowserWebWorkerEnv:H0,navigator:Mo,origin:q0},Symbol.toStringTag,{value:"Module"})),...B0};function z0(e,t){return Ni(e,new qe.classes.URLSearchParams,Object.assign({visitor:function(n,r,i,s){return qe.isNode&&$.isBuffer(n)?(this.append(r,n.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)}},t))}function W0(e){return $.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function K0(e){const t={},n=Object.keys(e);let r;const i=n.length;let s;for(r=0;r<i;r++)s=n[r],t[s]=e[s];return t}function Yc(e){function t(n,r,i,s){let o=n[s++];if(o==="__proto__")return!0;const a=Number.isFinite(+o),l=s>=n.length;return o=!o&&$.isArray(i)?i.length:o,l?($.hasOwnProp(i,o)?i[o]=[i[o],r]:i[o]=r,!a):((!i[o]||!$.isObject(i[o]))&&(i[o]=[]),t(n,r,i[o],s)&&$.isArray(i[o])&&(i[o]=K0(i[o])),!a)}if($.isFormData(e)&&$.isFunction(e.entries)){const n={};return $.forEachEntry(e,(r,i)=>{t(W0(r),i,n,0)}),n}return null}function J0(e,t,n){if($.isString(e))try{return(t||JSON.parse)(e),$.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(0,JSON.stringify)(e)}const Cr={transitional:Jc,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",i=r.indexOf("application/json")>-1,s=$.isObject(t);if(s&&$.isHTMLForm(t)&&(t=new FormData(t)),$.isFormData(t))return i?JSON.stringify(Yc(t)):t;if($.isArrayBuffer(t)||$.isBuffer(t)||$.isStream(t)||$.isFile(t)||$.isBlob(t)||$.isReadableStream(t))return t;if($.isArrayBufferView(t))return t.buffer;if($.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let a;if(s){if(r.indexOf("application/x-www-form-urlencoded")>-1)return z0(t,this.formSerializer).toString();if((a=$.isFileList(t))||r.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return Ni(a?{"files[]":t}:t,l&&new l,this.formSerializer)}}return s||i?(n.setContentType("application/json",!1),J0(t)):t}],transformResponse:[function(t){const n=this.transitional||Cr.transitional,r=n&&n.forcedJSONParsing,i=this.responseType==="json";if($.isResponse(t)||$.isReadableStream(t))return t;if(t&&$.isString(t)&&(r&&!this.responseType||i)){const o=!(n&&n.silentJSONParsing)&&i;try{return JSON.parse(t)}catch(a){if(o)throw a.name==="SyntaxError"?ee.from(a,ee.ERR_BAD_RESPONSE,this,null,this.response):a}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:qe.classes.FormData,Blob:qe.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};$.forEach(["delete","get","head","post","put","patch"],e=>{Cr.headers[e]={}});const Y0=$.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),G0=e=>{const t={};let n,r,i;return e&&e.split(`
|
|
59
|
+
`).forEach(function(o){i=o.indexOf(":"),n=o.substring(0,i).trim().toLowerCase(),r=o.substring(i+1).trim(),!(!n||t[n]&&Y0[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},Gc=Symbol("internals");function Or(e){return e&&String(e).trim().toLowerCase()}function Pi(e){return e===!1||e==null?e:$.isArray(e)?e.map(Pi):String(e)}function X0(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const Q0=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Ro(e,t,n,r,i){if($.isFunction(r))return r.call(this,t,n);if(i&&(t=n),!!$.isString(t)){if($.isString(r))return t.indexOf(r)!==-1;if($.isRegExp(r))return r.test(t)}}function Z0(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function ex(e,t){const n=$.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(i,s,o){return this[r].call(this,t,i,s,o)},configurable:!0})})}class nt{constructor(t){t&&this.set(t)}set(t,n,r){const i=this;function s(a,l,u){const c=Or(l);if(!c)throw new Error("header name must be a non-empty string");const f=$.findKey(i,c);(!f||i[f]===void 0||u===!0||u===void 0&&i[f]!==!1)&&(i[f||l]=Pi(a))}const o=(a,l)=>$.forEach(a,(u,c)=>s(u,c,l));if($.isPlainObject(t)||t instanceof this.constructor)o(t,n);else if($.isString(t)&&(t=t.trim())&&!Q0(t))o(G0(t),n);else if($.isHeaders(t))for(const[a,l]of t.entries())s(l,a,r);else t!=null&&s(n,t,r);return this}get(t,n){if(t=Or(t),t){const r=$.findKey(this,t);if(r){const i=this[r];if(!n)return i;if(n===!0)return X0(i);if($.isFunction(n))return n.call(this,i,r);if($.isRegExp(n))return n.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=Or(t),t){const r=$.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||Ro(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let i=!1;function s(o){if(o=Or(o),o){const a=$.findKey(r,o);a&&(!n||Ro(r,r[a],a,n))&&(delete r[a],i=!0)}}return $.isArray(t)?t.forEach(s):s(t),i}clear(t){const n=Object.keys(this);let r=n.length,i=!1;for(;r--;){const s=n[r];(!t||Ro(this,this[s],s,t,!0))&&(delete this[s],i=!0)}return i}normalize(t){const n=this,r={};return $.forEach(this,(i,s)=>{const o=$.findKey(r,s);if(o){n[o]=Pi(i),delete n[s];return}const a=t?Z0(s):String(s).trim();a!==s&&delete n[s],n[a]=Pi(i),r[a]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return $.forEach(this,(r,i)=>{r!=null&&r!==!1&&(n[i]=t&&$.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
|
|
60
|
+
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(i=>r.set(i)),r}static accessor(t){const r=(this[Gc]=this[Gc]={accessors:{}}).accessors,i=this.prototype;function s(o){const a=Or(o);r[a]||(ex(i,o),r[a]=!0)}return $.isArray(t)?t.forEach(s):s(t),this}}nt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),$.reduceDescriptors(nt.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}}),$.freezeMethods(nt);function Vo(e,t){const n=this||Cr,r=t||n,i=nt.from(r.headers);let s=r.data;return $.forEach(e,function(a){s=a.call(n,s,i.normalize(),t?t.status:void 0)}),i.normalize(),s}function Xc(e){return!!(e&&e.__CANCEL__)}function Rn(e,t,n){ee.call(this,e??"canceled",ee.ERR_CANCELED,t,n),this.name="CanceledError"}$.inherits(Rn,ee,{__CANCEL__:!0});function Qc(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new ee("Request failed with status code "+n.status,[ee.ERR_BAD_REQUEST,ee.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function tx(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function nx(e,t){e=e||10;const n=new Array(e),r=new Array(e);let i=0,s=0,o;return t=t!==void 0?t:1e3,function(l){const u=Date.now(),c=r[s];o||(o=u),n[i]=l,r[i]=u;let f=s,m=0;for(;f!==i;)m+=n[f++],f=f%e;if(i=(i+1)%e,i===s&&(s=(s+1)%e),u-o<t)return;const p=c&&u-c;return p?Math.round(m*1e3/p):void 0}}function rx(e,t){let n=0,r=1e3/t,i,s;const o=(u,c=Date.now())=>{n=c,i=null,s&&(clearTimeout(s),s=null),e.apply(null,u)};return[(...u)=>{const c=Date.now(),f=c-n;f>=r?o(u,c):(i=u,s||(s=setTimeout(()=>{s=null,o(i)},r-f)))},()=>i&&o(i)]}const Li=(e,t,n=3)=>{let r=0;const i=nx(50,250);return rx(s=>{const o=s.loaded,a=s.lengthComputable?s.total:void 0,l=o-r,u=i(l),c=o<=a;r=o;const f={loaded:o,total:a,progress:a?o/a:void 0,bytes:l,rate:u||void 0,estimated:u&&a&&c?(a-o)/u:void 0,event:s,lengthComputable:a!=null,[t?"download":"upload"]:!0};e(f)},n)},Zc=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},ef=e=>(...t)=>$.asap(()=>e(...t)),ix=qe.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,qe.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(qe.origin),qe.navigator&&/(msie|trident)/i.test(qe.navigator.userAgent)):()=>!0,sx=qe.hasStandardBrowserEnv?{write(e,t,n,r,i,s){const o=[e+"="+encodeURIComponent(t)];$.isNumber(n)&&o.push("expires="+new Date(n).toGMTString()),$.isString(r)&&o.push("path="+r),$.isString(i)&&o.push("domain="+i),s===!0&&o.push("secure"),document.cookie=o.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function ox(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function ax(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function tf(e,t,n){let r=!ox(t);return e&&(r||n==!1)?ax(e,t):t}const nf=e=>e instanceof nt?{...e}:e;function vn(e,t){t=t||{};const n={};function r(u,c,f,m){return $.isPlainObject(u)&&$.isPlainObject(c)?$.merge.call({caseless:m},u,c):$.isPlainObject(c)?$.merge({},c):$.isArray(c)?c.slice():c}function i(u,c,f,m){if($.isUndefined(c)){if(!$.isUndefined(u))return r(void 0,u,f,m)}else return r(u,c,f,m)}function s(u,c){if(!$.isUndefined(c))return r(void 0,c)}function o(u,c){if($.isUndefined(c)){if(!$.isUndefined(u))return r(void 0,u)}else return r(void 0,c)}function a(u,c,f){if(f in t)return r(u,c);if(f in e)return r(void 0,u)}const l={url:s,method:s,data:s,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:a,headers:(u,c,f)=>i(nf(u),nf(c),f,!0)};return $.forEach(Object.keys(Object.assign({},e,t)),function(c){const f=l[c]||i,m=f(e[c],t[c],c);$.isUndefined(m)&&f!==a||(n[c]=m)}),n}const rf=e=>{const t=vn({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:i,xsrfCookieName:s,headers:o,auth:a}=t;t.headers=o=nt.from(o),t.url=Wc(tf(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),a&&o.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):"")));let l;if($.isFormData(n)){if(qe.hasStandardBrowserEnv||qe.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if((l=o.getContentType())!==!1){const[u,...c]=l?l.split(";").map(f=>f.trim()).filter(Boolean):[];o.setContentType([u||"multipart/form-data",...c].join("; "))}}if(qe.hasStandardBrowserEnv&&(r&&$.isFunction(r)&&(r=r(t)),r||r!==!1&&ix(t.url))){const u=i&&s&&sx.read(s);u&&o.set(i,u)}return t},lx=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,r){const i=rf(e);let s=i.data;const o=nt.from(i.headers).normalize();let{responseType:a,onUploadProgress:l,onDownloadProgress:u}=i,c,f,m,p,d;function g(){p&&p(),d&&d(),i.cancelToken&&i.cancelToken.unsubscribe(c),i.signal&&i.signal.removeEventListener("abort",c)}let v=new XMLHttpRequest;v.open(i.method.toUpperCase(),i.url,!0),v.timeout=i.timeout;function b(){if(!v)return;const w=nt.from("getAllResponseHeaders"in v&&v.getAllResponseHeaders()),C={data:!a||a==="text"||a==="json"?v.responseText:v.response,status:v.status,statusText:v.statusText,headers:w,config:e,request:v};Qc(function(O){n(O),g()},function(O){r(O),g()},C),v=null}"onloadend"in v?v.onloadend=b:v.onreadystatechange=function(){!v||v.readyState!==4||v.status===0&&!(v.responseURL&&v.responseURL.indexOf("file:")===0)||setTimeout(b)},v.onabort=function(){v&&(r(new ee("Request aborted",ee.ECONNABORTED,e,v)),v=null)},v.onerror=function(){r(new ee("Network Error",ee.ERR_NETWORK,e,v)),v=null},v.ontimeout=function(){let T=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const C=i.transitional||Jc;i.timeoutErrorMessage&&(T=i.timeoutErrorMessage),r(new ee(T,C.clarifyTimeoutError?ee.ETIMEDOUT:ee.ECONNABORTED,e,v)),v=null},s===void 0&&o.setContentType(null),"setRequestHeader"in v&&$.forEach(o.toJSON(),function(T,C){v.setRequestHeader(C,T)}),$.isUndefined(i.withCredentials)||(v.withCredentials=!!i.withCredentials),a&&a!=="json"&&(v.responseType=i.responseType),u&&([m,d]=Li(u,!0),v.addEventListener("progress",m)),l&&v.upload&&([f,p]=Li(l),v.upload.addEventListener("progress",f),v.upload.addEventListener("loadend",p)),(i.cancelToken||i.signal)&&(c=w=>{v&&(r(!w||w.type?new Rn(null,e,v):w),v.abort(),v=null)},i.cancelToken&&i.cancelToken.subscribe(c),i.signal&&(i.signal.aborted?c():i.signal.addEventListener("abort",c)));const x=tx(i.url);if(x&&qe.protocols.indexOf(x)===-1){r(new ee("Unsupported protocol "+x+":",ee.ERR_BAD_REQUEST,e));return}v.send(s||null)})},ux=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,i;const s=function(u){if(!i){i=!0,a();const c=u instanceof Error?u:this.reason;r.abort(c instanceof ee?c:new Rn(c instanceof Error?c.message:c))}};let o=t&&setTimeout(()=>{o=null,s(new ee(`timeout ${t} of ms exceeded`,ee.ETIMEDOUT))},t);const a=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(u=>{u.unsubscribe?u.unsubscribe(s):u.removeEventListener("abort",s)}),e=null)};e.forEach(u=>u.addEventListener("abort",s));const{signal:l}=r;return l.unsubscribe=()=>$.asap(a),l}},cx=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let r=0,i;for(;r<n;)i=r+t,yield e.slice(r,i),r=i},fx=async function*(e,t){for await(const n of dx(e))yield*cx(n,t)},dx=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:r}=await t.read();if(n)break;yield r}}finally{await t.cancel()}},sf=(e,t,n,r)=>{const i=fx(e,t);let s=0,o,a=l=>{o||(o=!0,r&&r(l))};return new ReadableStream({async pull(l){try{const{done:u,value:c}=await i.next();if(u){a(),l.close();return}let f=c.byteLength;if(n){let m=s+=f;n(m)}l.enqueue(new Uint8Array(c))}catch(u){throw a(u),u}},cancel(l){return a(l),i.return()}},{highWaterMark:2})},Di=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",of=Di&&typeof ReadableStream=="function",px=Di&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),af=(e,...t)=>{try{return!!e(...t)}catch{return!1}},hx=of&&af(()=>{let e=!1;const t=new Request(qe.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),lf=64*1024,Bo=of&&af(()=>$.isReadableStream(new Response("").body)),Ii={stream:Bo&&(e=>e.body)};Di&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!Ii[t]&&(Ii[t]=$.isFunction(e[t])?n=>n[t]():(n,r)=>{throw new ee(`Response type '${t}' is not supported`,ee.ERR_NOT_SUPPORT,r)})})})(new Response);const mx=async e=>{if(e==null)return 0;if($.isBlob(e))return e.size;if($.isSpecCompliantForm(e))return(await new Request(qe.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if($.isArrayBufferView(e)||$.isArrayBuffer(e))return e.byteLength;if($.isURLSearchParams(e)&&(e=e+""),$.isString(e))return(await px(e)).byteLength},gx=async(e,t)=>{const n=$.toFiniteNumber(e.getContentLength());return n??mx(t)},Uo={http:I0,xhr:lx,fetch:Di&&(async e=>{let{url:t,method:n,data:r,signal:i,cancelToken:s,timeout:o,onDownloadProgress:a,onUploadProgress:l,responseType:u,headers:c,withCredentials:f="same-origin",fetchOptions:m}=rf(e);u=u?(u+"").toLowerCase():"text";let p=ux([i,s&&s.toAbortSignal()],o),d;const g=p&&p.unsubscribe&&(()=>{p.unsubscribe()});let v;try{if(l&&hx&&n!=="get"&&n!=="head"&&(v=await gx(c,r))!==0){let C=new Request(t,{method:"POST",body:r,duplex:"half"}),_;if($.isFormData(r)&&(_=C.headers.get("content-type"))&&c.setContentType(_),C.body){const[O,A]=Zc(v,Li(ef(l)));r=sf(C.body,lf,O,A)}}$.isString(f)||(f=f?"include":"omit");const b="credentials"in Request.prototype;d=new Request(t,{...m,signal:p,method:n.toUpperCase(),headers:c.normalize().toJSON(),body:r,duplex:"half",credentials:b?f:void 0});let x=await fetch(d);const w=Bo&&(u==="stream"||u==="response");if(Bo&&(a||w&&g)){const C={};["status","statusText","headers"].forEach(N=>{C[N]=x[N]});const _=$.toFiniteNumber(x.headers.get("content-length")),[O,A]=a&&Zc(_,Li(ef(a),!0))||[];x=new Response(sf(x.body,lf,O,()=>{A&&A(),g&&g()}),C)}u=u||"text";let T=await Ii[$.findKey(Ii,u)||"text"](x,e);return!w&&g&&g(),await new Promise((C,_)=>{Qc(C,_,{data:T,headers:nt.from(x.headers),status:x.status,statusText:x.statusText,config:e,request:d})})}catch(b){throw g&&g(),b&&b.name==="TypeError"&&/fetch/i.test(b.message)?Object.assign(new ee("Network Error",ee.ERR_NETWORK,e,d),{cause:b.cause||b}):ee.from(b,b&&b.code,e,d)}})};$.forEach(Uo,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const uf=e=>`- ${e}`,yx=e=>$.isFunction(e)||e===null||e===!1,cf={getAdapter:e=>{e=$.isArray(e)?e:[e];const{length:t}=e;let n,r;const i={};for(let s=0;s<t;s++){n=e[s];let o;if(r=n,!yx(n)&&(r=Uo[(o=String(n)).toLowerCase()],r===void 0))throw new ee(`Unknown adapter '${o}'`);if(r)break;i[o||"#"+s]=r}if(!r){const s=Object.entries(i).map(([a,l])=>`adapter ${a} `+(l===!1?"is not supported by the environment":"is not available in the build"));let o=t?s.length>1?`since :
|
|
61
|
+
`+s.map(uf).join(`
|
|
62
|
+
`):" "+uf(s[0]):"as no adapter specified";throw new ee("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return r},adapters:Uo};function Ho(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Rn(null,e)}function ff(e){return Ho(e),e.headers=nt.from(e.headers),e.data=Vo.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),cf.getAdapter(e.adapter||Cr.adapter)(e).then(function(r){return Ho(e),r.data=Vo.call(e,e.transformResponse,r),r.headers=nt.from(r.headers),r},function(r){return Xc(r)||(Ho(e),r&&r.response&&(r.response.data=Vo.call(e,e.transformResponse,r.response),r.response.headers=nt.from(r.response.headers))),Promise.reject(r)})}const df="1.8.4",Mi={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Mi[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const pf={};Mi.transitional=function(t,n,r){function i(s,o){return"[Axios v"+df+"] Transitional option '"+s+"'"+o+(r?". "+r:"")}return(s,o,a)=>{if(t===!1)throw new ee(i(o," has been removed"+(n?" in "+n:"")),ee.ERR_DEPRECATED);return n&&!pf[o]&&(pf[o]=!0,console.warn(i(o," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(s,o,a):!0}},Mi.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function bx(e,t,n){if(typeof e!="object")throw new ee("options must be an object",ee.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let i=r.length;for(;i-- >0;){const s=r[i],o=t[s];if(o){const a=e[s],l=a===void 0||o(a,s,e);if(l!==!0)throw new ee("option "+s+" must be "+l,ee.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new ee("Unknown option "+s,ee.ERR_BAD_OPTION)}}const Ri={assertOptions:bx,validators:Mi},jt=Ri.validators;class xn{constructor(t){this.defaults=t,this.interceptors={request:new Kc,response:new Kc}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let i={};Error.captureStackTrace?Error.captureStackTrace(i):i=new Error;const s=i.stack?i.stack.replace(/^.+\n/,""):"";try{r.stack?s&&!String(r.stack).endsWith(s.replace(/^.+\n.+\n/,""))&&(r.stack+=`
|
|
63
|
+
`+s):r.stack=s}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=vn(this.defaults,n);const{transitional:r,paramsSerializer:i,headers:s}=n;r!==void 0&&Ri.assertOptions(r,{silentJSONParsing:jt.transitional(jt.boolean),forcedJSONParsing:jt.transitional(jt.boolean),clarifyTimeoutError:jt.transitional(jt.boolean)},!1),i!=null&&($.isFunction(i)?n.paramsSerializer={serialize:i}:Ri.assertOptions(i,{encode:jt.function,serialize:jt.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),Ri.assertOptions(n,{baseUrl:jt.spelling("baseURL"),withXsrfToken:jt.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let o=s&&$.merge(s.common,s[n.method]);s&&$.forEach(["delete","get","head","post","put","patch","common"],d=>{delete s[d]}),n.headers=nt.concat(o,s);const a=[];let l=!0;this.interceptors.request.forEach(function(g){typeof g.runWhen=="function"&&g.runWhen(n)===!1||(l=l&&g.synchronous,a.unshift(g.fulfilled,g.rejected))});const u=[];this.interceptors.response.forEach(function(g){u.push(g.fulfilled,g.rejected)});let c,f=0,m;if(!l){const d=[ff.bind(this),void 0];for(d.unshift.apply(d,a),d.push.apply(d,u),m=d.length,c=Promise.resolve(n);f<m;)c=c.then(d[f++],d[f++]);return c}m=a.length;let p=n;for(f=0;f<m;){const d=a[f++],g=a[f++];try{p=d(p)}catch(v){g.call(this,v);break}}try{c=ff.call(this,p)}catch(d){return Promise.reject(d)}for(f=0,m=u.length;f<m;)c=c.then(u[f++],u[f++]);return c}getUri(t){t=vn(this.defaults,t);const n=tf(t.baseURL,t.url,t.allowAbsoluteUrls);return Wc(n,t.params,t.paramsSerializer)}}$.forEach(["delete","get","head","options"],function(t){xn.prototype[t]=function(n,r){return this.request(vn(r||{},{method:t,url:n,data:(r||{}).data}))}}),$.forEach(["post","put","patch"],function(t){function n(r){return function(s,o,a){return this.request(vn(a||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:s,data:o}))}}xn.prototype[t]=n(),xn.prototype[t+"Form"]=n(!0)});class qo{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(s){n=s});const r=this;this.promise.then(i=>{if(!r._listeners)return;let s=r._listeners.length;for(;s-- >0;)r._listeners[s](i);r._listeners=null}),this.promise.then=i=>{let s;const o=new Promise(a=>{r.subscribe(a),s=a}).then(i);return o.cancel=function(){r.unsubscribe(s)},o},t(function(s,o,a){r.reason||(r.reason=new Rn(s,o,a),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new qo(function(i){t=i}),cancel:t}}}function vx(e){return function(n){return e.apply(null,n)}}function xx(e){return $.isObject(e)&&e.isAxiosError===!0}const zo={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(zo).forEach(([e,t])=>{zo[t]=e});function hf(e){const t=new xn(e),n=jc(xn.prototype.request,t);return $.extend(n,xn.prototype,t,{allOwnKeys:!0}),$.extend(n,t,null,{allOwnKeys:!0}),n.create=function(i){return hf(vn(e,i))},n}const Ee=hf(Cr);Ee.Axios=xn,Ee.CanceledError=Rn,Ee.CancelToken=qo,Ee.isCancel=Xc,Ee.VERSION=df,Ee.toFormData=Ni,Ee.AxiosError=ee,Ee.Cancel=Ee.CanceledError,Ee.all=function(t){return Promise.all(t)},Ee.spread=vx,Ee.isAxiosError=xx,Ee.mergeConfig=vn,Ee.AxiosHeaders=nt,Ee.formToJSON=e=>Yc($.isHTMLForm(e)?new FormData(e):e),Ee.getAdapter=cf.getAdapter,Ee.HttpStatusCode=zo,Ee.default=Ee;function wx(e){if(!e)return!1;const t=/^data:image\/(jpeg|png|gif|bmp|webp);base64,/i,n=/\.(jpeg|jpg|png|gif|bmp|webp)$/i;return t.test(e)||n.test(e)}const Ex=({imageUrl:e})=>{const[t,n]=h.useState(!1),r=()=>{n(!0)},i=()=>{n(!1)};return y.jsxs("div",{children:[y.jsx("img",{alt:"Thumbnail",style:{cursor:"pointer",width:"120px",height:"130px",objectFit:"cover"},onClick:r,src:e||"/place.png","data-toggle":"tooltip","data-placement":"top",title:"Click to view"}),t&&y.jsx("div",{className:"modal",style:{position:"fixed",top:0,left:0,width:"100%",height:"100%",backgroundColor:"rgba(0, 0, 0, 0.5)",display:"flex",justifyContent:"center",alignItems:"center"},onClick:i,children:y.jsxs("div",{className:"modal-content",style:{position:"relative",backgroundColor:"white",padding:"20px",borderRadius:"8px",width:"90vw"},onClick:s=>s.stopPropagation(),children:[y.jsx("span",{className:"close",onClick:i,style:{position:"absolute",top:"10px",right:"10px",fontSize:"24px",cursor:"pointer"},children:"×"}),y.jsx("img",{src:e||"/place.png",alt:"Full Image",style:{maxWidth:"90%",maxHeight:"90vh",objectFit:"contain"}})]})})]})};function mf({element:e,validationData:t}){const{register:n=()=>({}),setValue:r,getValues:i}=t||{},[s,o]=h.useState(),[a,l]=h.useState(!1),[u,c]=h.useState(!1),[f,m]=h.useState(""),p=i&&i(e==null?void 0:e.id);h.useEffect(()=>{o(p)},[p]);const[d,g]=h.useState("");h.useEffect(()=>{n(e.id)},[e.id,n]);const{url:v,method:b,responseType:x}=e||{},w=h.useCallback(async T=>{var C,_,O,A,N,L,P,I,R,z,Y;if(!(!v||!b)){l(!0);try{let H;if(b.toLowerCase()==="get"){const X=`${v}?value=${T}`;H=await Ee.get(X)}else if(b.toLowerCase()==="post")H=await Ee.post(v,{value:T});else throw new Error("Unsupported HTTP method");H.status===200&&((((_=(C=H==null?void 0:H.data)==null?void 0:C.data)==null?void 0:_.status)||((O=H==null?void 0:H.data)==null?void 0:O.status))===!0?(c(!0),x==="string"?m(((N=(A=H==null?void 0:H.data)==null?void 0:A.data)==null?void 0:N.description)||((L=H==null?void 0:H.data)==null?void 0:L.description)||"Validation successful"):g(((I=(P=H==null?void 0:H.data)==null?void 0:P.data)==null?void 0:I.description)||((R=H==null?void 0:H.data)==null?void 0:R.description)||{})):(console.error("Invalid input:",T),m("Unable to validate input"),c(!1)))}catch(H){console.error("Error validating input:",H),m(((Y=(z=H==null?void 0:H.response)==null?void 0:z.data)==null?void 0:Y.message)||"Unable to validate input"),c(!1)}finally{l(!1)}}},[b,x,v]);return h.useEffect(()=>{if(s){const T=setTimeout(()=>{w(s)},700);return()=>clearTimeout(T)}},[w,s]),y.jsxs("div",{children:[y.jsxs("div",{className:"relative flex items-center",children:[y.jsx("input",{placeholder:(e==null?void 0:e.placeholder)||"",type:(e==null?void 0:e.inputType)||"text",className:"input-control",...n(e==null?void 0:e.id),onChange:T=>{o(T.target.value),r(e==null?void 0:e.id,T.target.value)}}),y.jsxs("span",{className:"absolute right-0",children:[a&&y.jsxs("span",{children:[" ",y.jsxs("svg",{className:"animate-spin -ml-1 mr-3 h-5 w-5",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[y.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),y.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})]}),u&&!a&&y.jsx("span",{className:"text-green-600 text-lg pr-3 block",children:y.jsx(Be,{icon:"gg:check-o"})})]})]}),f&&x==="string"&&y.jsx("span",{className:`${u?"text-green-600":"text-red-600"} text-sm`,children:f}),x==="object"&&y.jsx("div",{className:"grid grid-cols-2 gap-6 text-sm text-gray-600 mt-2",children:Object.entries(d).map(([T,C])=>y.jsxs("div",{className:"flex items-center gap-x-2",children:[y.jsxs("span",{className:"font-semibold",children:[T,":"]}),wx(C)?y.jsx(Ex,{imageUrl:C}):y.jsx("span",{children:String(C)})]},T))})]})}function Sx({onGetTotal:e,readOnly:t,defaultValue:n,denominators:r}){const[i,s]=h.useState([...n]);function o(u,c){s(f=>{const m=[...f];return m[c]={...m[c],value:u},m})}function a(u,c){return parseFloat(u)*parseFloat(c)||0}const l=h.useMemo(()=>i.reduce((u,c)=>{const f=a(c.key,c.value);return u+f},0),[i]);return h.useEffect(()=>{e&&e(i)},[e,i]),h.useEffect(()=>{if(r!=null&&r.length){const u=r.map((c,f)=>({key:c.value,value:Array.isArray(n)&&n[f]?n[f].value:""}));s(u)}},[n,r]),y.jsx("div",{className:"mt-2",children:y.jsxs("div",{className:"border border-gray-200 rounded-lg overflow-hidden text-gray-700",children:[y.jsxs("div",{className:"grid grid-cols-3 text-sm font-bold border-b border-gray-100 bg-gray-50",children:[y.jsx("div",{className:"border-r px-4 py-2",children:y.jsx("span",{className:"",children:"Denomination"})}),y.jsx("div",{className:"border-r px-4 py-2",children:y.jsx("span",{children:"Quantity"})}),y.jsx("div",{className:"px-4 py-2",children:y.jsx("span",{children:"Sub total"})})]}),i.map((u,c)=>{var f,m;return y.jsxs("div",{className:"grid grid-cols-3 text-sm border-b border-gray-100",children:[y.jsx("div",{className:"border-r px-4 py-2 flex items-center",children:y.jsx("span",{className:"",children:(f=parseFloat(u.key))==null?void 0:f.toLocaleString()})}),y.jsx("div",{className:"border-r px-4 py-1",children:y.jsx("span",{children:y.jsx(mi,{id:"input-example",className:"border border-gray-100 rounded w-full px-3 py-1 outline-none",decimalsLimit:6,defaultValue:u.value,onValueChange:p=>o(p,c),disabled:t,allowNegativeValue:!1})})}),y.jsx("div",{className:"px-4 py-2 flex justify-between items-center",children:y.jsx("span",{children:(m=a(u.key,u.value))==null?void 0:m.toLocaleString()})})]},u.key+c+Math.random())}),y.jsxs("div",{className:"grid grid-cols-3 text-sm font-bold bg-gray-50",children:[y.jsx("div",{className:"border-r px-4 py-3 col-span-2 text-right",children:"Total"}),y.jsx("div",{className:"px-4 py-3",children:l==null?void 0:l.toLocaleString()})]})]})})}function gf({element:e,validationData:t}){const{register:n=()=>({}),setValue:r,getValues:i}=t||{},s=i&&i(e==null?void 0:e.id)||[];return h.useEffect(()=>{n(e.id)},[e.id,n]),y.jsx("div",{children:y.jsx(Sx,{onGetTotal:o=>{r&&r(e.id,o)},denominators:(e==null?void 0:e.denominators)||[],defaultValue:s,readOnly:e==null?void 0:e.isReadOnly})})}const Tx={textField:Yr,longText:Ru,selectField:Mu,multiSelect:Ou,numberField:Yr,amountField:$c,date:sl,password:ju,checkbox:Iu,radio:Lu,email:ku,file:Au,grid:$u,section:Du,validateInput:mf,tableInput:gf},yf="edit",_x=e=>{const t=Tx[e.type];return t?y.jsx(Ac,{element:e,state:yf,children:y.jsxs("div",{className:"relative",children:[y.jsx("div",{className:"absolute top-0 left-0 h-full w-full z-20"}),y.jsx(t,{element:e,state:yf})]})}):null};function Cx({elementData:e,sectionId:t}){const{formData:n,updateElementPosition:r,isDragging:i}=h.useContext(ht),[s,o]=h.useState(null),a=h.useCallback((f,m)=>{f.dataTransfer.setData("properties",m),o(m)},[]),l=h.useCallback(f=>{f.preventDefault(),f.stopPropagation(),f.dataTransfer.dropEffect="move"},[]),u=h.useCallback(f=>{var p;f.preventDefault(),f.stopPropagation();const m=(p=n.find(d=>d.id===t))==null?void 0:p.questionData;try{const d=f.dataTransfer.getData("properties"),g=f.currentTarget;if(!g.id||d===g.id)return;const v=m.findIndex(x=>x.id===d),b=m.findIndex(x=>x.id===g.id);if(v===-1||b===-1)return;if(m.length){const x=[...m];[x[v],x[b]]=[x[b],x[v]],r(x,t),o(null)}}catch(d){console.error("Error during drag and drop:",d),o(null)}},[n,r]),c=h.useCallback(f=>y.jsx("div",{id:f.id,className:`cursor-move border p-4 w-full transition-colors rounded-lg bg-white ${s===f.id?"bg-gray-100":""} ${s&&s!==f.id?"border-dashed border-blue-300":""}`,draggable:!0,onDrop:u,onDragOver:l,onDragStart:m=>a(m,f.id),children:_x(f)},f.id),[s,u,l,a]);return e!=null&&e.length?y.jsxs("div",{className:"w-full h-full flex flex-col gap-y-4 relative",children:[e==null?void 0:e.map(c),i&&y.jsx("div",{className:"bg-gray-50 rounded p-6 h-[60px] border-2 border-dashed flex items-center justify-center text-gray-400 opacity-70",children:y.jsx(Be,{icon:"octicon:plus-16"})})]}):y.jsx("div",{className:"w-full h-full flex items-center justify-center text-gray-500 min-h-[250px] p-10",children:"No input to display"})}const Ox=Sr({title:be(),description:be()}).required(),kx=({isOpen:e,onClose:t,section:n})=>{const{updateSection:r}=h.useContext(ht),{register:i,handleSubmit:s,formState:{errors:o,isSubmitting:a,isValid:l},reset:u}=To({resolver:_o(Ox),defaultValues:n});if(h.useEffect(()=>{e||u()},[e,u]),!e)return null;const c=f=>{r(f,n.id),t()};return y.jsx("div",{className:"fixed inset-0 bg-black/30 flex items-center justify-center z-[999] cursor-default no-drag select-none",children:y.jsxs("div",{className:"min-w-[600px] bg-white rounded-xl shadow-xl relative flex flex-col items-center",children:[y.jsxs("div",{className:"w-full px-6 pt-6 pb-5 flex flex-col items-start gap-4 z-10 mb-6",children:[y.jsx("h2",{className:"text-lg font-semibold text-[#475467] font-onest",children:"Update Section Information"}),y.jsx("button",{onClick:t,className:"absolute right-4 top-4 p-2 text-[#98A2B3] hover:bg-gray-50 rounded-lg",children:y.jsx(Be,{icon:"tabler:x"})})]}),y.jsxs("form",{onSubmit:s(c),className:"w-full",children:[y.jsxs("div",{className:"w-full px-6 flex flex-col gap-5 z-10",children:[y.jsx(xe,{label:"Title",name:"title",register:i,errors:o}),y.jsx(xe,{label:"Description",name:"description",register:i,errors:o})]}),y.jsxs("div",{className:"w-full px-6 pt-8 pb-6 flex gap-3 mt-4",children:[y.jsx("button",{type:"button",onClick:t,className:"flex-1 px-4 py-2.5 bg-white border border-[#D0D5DD] rounded-lg shadow-xs font-semibold text-[#344054] font-onest",children:"Cancel"}),y.jsx("button",{type:"submit",disabled:!l||a,className:`flex-1 px-4 py-2.5 ${!l||a?"bg-[#F2F4F7]":"bg-[#2563EB]"} ${!l||a?"text-[#98A2B3]":"text-white"} rounded-lg shadow-xs font-semibold font-onest disabled:opacity-50`,children:a?"Saving...":"Save"})]})]})]})})},Fx=()=>{const[e,t]=h.useState(!1),n=h.useRef(null),[r,i]=h.useState([0]),{removeSection:s,addElement:o,formData:a,setIsDragging:l,setSelectedSection:u,selectedSection:c}=h.useContext(ht),f=h.useCallback(g=>{g.preventDefault(),g.dataTransfer.dropEffect="move"},[]),m=h.useCallback(g=>{try{g.preventDefault(),l(!1);const v=g==null?void 0:g.currentTarget,b=g.dataTransfer.getData("properties");if(b){const x=JSON.parse(b),w={id:tr(),sectionId:v.id,...x};o(w,v.id)}}catch(v){console.log(v),l(!1)}},[o,l]);function p(g){r.includes(g)?i(v=>v.filter(b=>b!==g)):i(v=>[...v,g])}function d(g){n.current=g,t(!0)}return y.jsxs("div",{className:"flex gap-x-4 mx-auto h-full relative px-6 pb-5 flex-col no-scrollbar overflow-y-auto max-h-[86vh]",children:[e&&y.jsx(kx,{isOpen:e,onClose:()=>t(!1),section:n.current}),y.jsx("div",{className:" relative w-full flex flex-col gap-y-6 flex-1 py-4",children:a.map((g,v)=>y.jsxs("div",{className:"group cursor-pointer rounded",onClick:()=>u(g.id),children:[y.jsxs("div",{className:`border border-gray-100 rounded py-4 px-4 shadow-[rgba(149,157,165,0.2)_0px_2px_4px] transition-colors duration-200
|
|
64
|
+
${c===g.id?"border-dashed border-blue-400 bg-[#f7f8fa]":"border-transparent"} ${r.includes(v)?"min-h-[300px]":""}`,children:[y.jsxs("div",{className:"flex justify-between items-center",children:[y.jsx("h2",{className:"font-medium",children:g.title||"Section title"}),y.jsxs("div",{className:"flex gap-x-4 items-center",children:[y.jsx("button",{type:"button",className:"p-1 border rounded-lg text-xs",onClick:()=>d(g),children:y.jsx(Be,{icon:"fluent:edit-28-regular"})}),a.length>1&&y.jsx("button",{type:"button",className:"p-1 border rounded-lg text-xs",onClick:()=>s(g.id),children:y.jsx(Be,{icon:"lets-icons:trash-duotone-line"})}),y.jsx("button",{type:"button",className:"p-1 rounded-lg text-xs",onClick:()=>p(v),children:y.jsx(Be,{icon:r.includes(v)?"gravity-ui:minus":"octicon:plus-16"})})]})]}),(g==null?void 0:g.description)&&r.includes(v)&&y.jsx("p",{className:"text-sm text-gray-60 mt-2 text-gray-600",children:g==null?void 0:g.description}),r.includes(v)&&y.jsxs("div",{className:"mt-4 transition-all duration-200 h-full",id:g.id,onDrop:m,onDragOver:f,children:[y.jsx("hr",{}),y.jsx("div",{className:" gap-y-6 mt-4 h-full ",children:y.jsx(Cx,{elementData:g.questionData,sectionId:g.id})})]})]}),y.jsx("hr",{className:"mt-6 group-last:hidden"})]},g.id))})]})};function Ax({questionData:e}){const{setFormData:t}=h.useContext(ht);return h.useEffect(()=>{e&&e.length>0&&t(e)},[e,t]),y.jsx("div",{className:"bg-white p-4 border border-[#E4E7EC] rounded-lg h-full overflow-y-auto",children:y.jsx(Fx,{})})}const $x=()=>{const{setIsDragging:e,addElement:t,selectedSection:n}=h.useContext(ht),r=h.useCallback((s,o)=>{s.dataTransfer.setData("properties",JSON.stringify(o)),s.dataTransfer.effectAllowed="move",e(!0)},[e]);function i(s){if(!n){ue.error("Please select a section to add an element to.");return}const o={id:tr(),sectionId:n,...s};t(o,n)}return y.jsx("div",{className:"w-full",children:y.jsx("div",{className:"pt-4 px-5 max-h-[70vh] overflow-y-auto",children:y.jsx("div",{children:y.jsx("ul",{className:"grid gap-y-[8px] mt-3",children:Rv.map(s=>y.jsxs("li",{onDragStart:o=>r(o,s),onClick:()=>i(s),style:{borderColor:s.color,color:s.color},className:`cursor-move text-[#475467] flex justify-between items-center \r
|
|
55
65
|
border border-[#98A2B3] rounded-lg py-3 px-[14px] shadow-custom\r
|
|
56
66
|
hover:shadow-lg transition-all duration-200\r
|
|
57
|
-
active:opacity-50`,draggable:!0,children:[
|
|
67
|
+
active:opacity-50`,draggable:!0,children:[y.jsxs("span",{className:"flex gap-x-2 items-center",children:[y.jsx("span",{style:{color:s.color},children:y.jsx(Be,{icon:s.icon,iconClass:"w-5 h-5"})}),y.jsx("span",{className:"text-sm font-medium leading-[0]",children:s.label})]}),y.jsx("span",{className:"text-gray-400",children:y.jsx(Be,{icon:"akar-icons:drag-horizontal"})})]},s.type))})})})})},jx=h.memo($x),Nx=({isOpen:e,onClose:t})=>{const{formData:n}=h.useContext(ht);return e?y.jsx("div",{className:"fixed inset-0 bg-black/30 flex items-center justify-center z-[999] cursor-default no-drag select-none",children:y.jsxs("div",{className:"max-w-[80vw] bg-white rounded-xl shadow-xl relative flex flex-col items-center w-full py-6 ",children:[y.jsx("button",{type:"button",onClick:t,className:"absolute top-3 right-4 text-sm",children:"Close"}),y.jsx("div",{className:"max-h-[90vh] overflow-y-auto h-full min-h-[600px] w-full",children:y.jsx(bf,{form_data:n,ignoreValidation:!0})})]})}):null};function Px(){const{addSection:e}=h.useContext(ht),[t,n]=h.useState(!1);return y.jsxs("div",{className:"px-[30px] py-[10px] flex justify-between items-center",children:[y.jsx("div",{className:"flex gap-x-4 items-center"}),t&&y.jsx(Nx,{isOpen:t,onClose:()=>n(!1),element:void 0}),y.jsxs("div",{className:"py-4 flex justify-end gap-x-6 text-sm",children:[y.jsx(kn,{onClick:()=>e(),text:"Add section",btnClass:"text-gray-700 border-[#98A2B3] !font-medium bg-transparent"}),y.jsx(kn,{onClick:()=>n(!0),text:"Preview",btnClass:"text-gray-700 border-[#98A2B3] !font-medium"})]})]})}function Lx({onSubmit:e,questionData:t}){return y.jsx(Lh,{children:y.jsxs("div",{className:"w-full h-screen bg-[#E4E7EC] flex flex-col",children:[y.jsx(ld,{}),y.jsx("div",{className:"border-b bg-white border-[#E4E7EC]",children:y.jsx(Px,{})}),y.jsxs("div",{className:"flex flex-1 ",children:[y.jsx("div",{className:"w-[270px] h-full border-l border-[#E4E7EC] bg-white",children:y.jsx(jx,{})}),y.jsx("div",{className:"flex-1 h-full max-h-full p-4 z-[1]",children:y.jsx(Ax,{questionData:t})})]}),y.jsx("div",{className:"border-b bg-white border-t border-[#E4E7EC]",children:y.jsx(Dh,{onSubmit:e})})]})})}const Dx=({onSubmit:e,questionData:t,isReadOnly:n,config:r})=>(h.useEffect(()=>{r&&il("config",r)},[r]),y.jsx(Lx,{onSubmit:e,questionData:t,isReadOnly:n}));function Ix(){return y.jsx("div",{className:"flex justify-center items-center h-full",children:y.jsx("p",{children:"Loading..."})})}const Mx={textField:Yr,longText:Ru,selectField:Mu,multiSelect:Ou,numberField:Yr,amountField:$c,date:sl,password:ju,checkbox:Iu,radio:Lu,email:ku,file:Au,grid:$u,section:Du,validateInput:mf,tableInput:gf},Rx=(e,t)=>{const n=Mx[e.type];return n?y.jsxs("div",{children:[y.jsx("label",{className:"block text-sm font-medium mb-[5px]",children:e.inputLabel}),y.jsx(n,{element:e,state:"edit",validationData:t})]}):null},wn={required:"This field is required",email:"Invalid email format",minLength:e=>`Minimum length is ${e}`,maxLength:e=>`Maximum length is ${e}`,minAmount:e=>`Minimum amount is ${e}`,maxAmount:e=>`Maximum amount is ${e}`},Vx=e=>({textField:be().nullable(),longText:be().nullable(),numberField:wr().nullable().transform(n=>isNaN(n)?null:n),amountField:wr().nullable().transform(n=>isNaN(n)?null:n),selectField:be().nullable(),checkbox:xr().nullable(),radio:xr().nullable(),email:be().nullable().email(wn.email),date:jo().typeError("Invalid date").nullable()})[e]||xr().nullable(),Bx=(e,t,n)=>t?e.type==="boolean"?e.oneOf([!0],n||wn.required):e.required(n||wn.required):e,Ux=(e,{minLength:t,maxLength:n,minLengthMessage:r,maxLengthMessage:i})=>{let s=e;return t&&(s=s.min(t,r||wn.minLength(t))),n&&(s=s.max(n,i||wn.maxLength(n))),s},Hx=(e,{minAmount:t,maxAmount:n,minAmountMessage:r,maxAmountMessage:i})=>{let s=e;return t&&(s=s.min(parseFloat(String(t)),r||wn.minAmount(t))),n&&(s=s.max(parseFloat(String(n)),i||wn.maxAmount(n))),s};function qx(e){const t={};return e.forEach(({questionData:n})=>{n.forEach(r=>{const{id:i,type:s,isRequired:o,requiredMessage:a}=r;let l=Vx(s);l=Bx(l,o,a),s==="textField"||s==="longText"||s==="email"?l=Ux(l,r):(s==="numberField"||s==="amountField")&&(l=Hx(l,r)),t[i]=l})}),Sr().shape(t)}function zx(e){return e.reduce((t,n)=>(n.questionData.forEach(r=>{t[r.id]=Object.prototype.hasOwnProperty.call(r,"value")?r.value:null}),t),{})}const Wx=({form_data:e,answerData:t,ignoreValidation:n,onSubmitData:r,isReadOnly:i})=>{var O;const[s,o]=h.useState(0),a=h.useMemo(()=>e.length,[e]),l=qx(e),u=To({resolver:_o(l),mode:"onSubmit",defaultValues:{}}),{register:c,setValue:f,watch:m,handleSubmit:p,reset:d,getValues:g,formState:{errors:v,isSubmitting:b},trigger:x}=u,w=bs("config"),T=A=>{const N=e==null?void 0:e.map(L=>{var P;return{...L,questionData:(P=L==null?void 0:L.questionData)==null?void 0:P.map(I=>{const R=A[I.id];return{...I,value:R}})}});r&&r(N),console.log("🚀 ~ FormRenderer ~ tempData:",N)};h.useEffect(()=>{if(t&&t.length>0){const A=zx(t);d(A)}},[t,d]);async function C(){var A;!n&&!await x((A=e==null?void 0:e[s].questionData)==null?void 0:A.map(L=>L.id))||o(s+1)}function _(){o(s-1)}return y.jsx(qb,{...u,children:y.jsxs("form",{onSubmit:p(T),className:"container mx-auto p-6",children:[y.jsx("div",{className:"relative w-full flex flex-col gap-y-12 py-4",children:y.jsxs("div",{children:[y.jsxs("div",{className:"mb-4",children:[(e==null?void 0:e[s].title)&&y.jsx("h2",{className:"text-lg font-semibold mb-[6px]",children:e==null?void 0:e[s].title}),(e==null?void 0:e[s].description)&&y.jsx("p",{className:"text-sm",children:e==null?void 0:e[s].description})]}),y.jsx("div",{className:"grid gap-y-6",children:(O=e==null?void 0:e[s].questionData)==null?void 0:O.map(A=>{var N;return y.jsx("div",{children:y.jsxs("div",{children:[Rx(A,{register:c,setValue:f,watch:m,errors:v,trigger:x,isSubmitting:b,isReadOnly:i,getValues:g}),y.jsx("div",{className:"text-xs text-red-600 mt-1",children:(N=v==null?void 0:v[A.id])==null?void 0:N.message})]})},A.id)})})]},e==null?void 0:e[s].id)}),y.jsxs("div",{className:"pt-8 flex justify-end items-center gap-4",children:[s!==0&&y.jsx(kn,{type:"button",text:"Back",btnClass:"text-gray-700 border-[#98A2B3] !font-medium !py-[10px] px-10 bg-gray-200 rounded-lg",onClick:_}),s!==a-1?y.jsx(kn,{type:"button",text:"Continue",style:{background:w.buttonColor},onClick:C,btnClass:"text-gray-700 border-[#98A2B3] !font-medium !py-[10px] px-10 bg-blue-600 text-white rounded-lg"}):y.jsx(y.Fragment,{children:!n&&y.jsx(kn,{isDisabled:b,isLoading:b,type:"submit",text:"Submit",style:{background:w.buttonColor},btnClass:"text-gray-700 border-[#98A2B3] !font-medium !py-[10px] px-10 bg-blue-600 text-white rounded-lg"})})]})]})})};function bf({answerData:e,form_data:t,ignoreValidation:n,onSubmit:r,isReadOnly:i=!1,loading:s=!1,config:o}){return h.useEffect(()=>{o&&il("config",o)},[o]),s?y.jsx(Ix,{}):t?y.jsx("div",{className:"w-full",children:y.jsx(Wx,{form_data:t,answerData:e,ignoreValidation:n,onSubmitData:r,isReadOnly:i})}):y.jsx("div",{children:y.jsx("p",{children:"Error: No form data available. Please ensure the form data is saved correctly."})})}Nt.FormBuilder=Dx,Nt.FormViewer=bf,Object.defineProperty(Nt,Symbol.toStringTag,{value:"Module"})});
|