beesoft-components 0.10.5 → 0.12.0-0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.umd.js CHANGED
@@ -1,102 +1,6 @@
1
- (function(oe,h){typeof exports=="object"&&typeof module<"u"?h(exports,require("react"),require("@beesoft/locale"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","@beesoft/locale","react-dom"],h):(oe=typeof globalThis<"u"?globalThis:oe||self,h(oe.BeeSoftComponents={},oe.React,oe["beesoft-locale"],oe.ReactDOM))})(this,function(oe,h,Mt,cr){"use strict";var Yp=Object.defineProperty;var Hp=(oe,h,Mt)=>h in oe?Yp(oe,h,{enumerable:!0,configurable:!0,writable:!0,value:Mt}):oe[h]=Mt;var P=(oe,h,Mt)=>Hp(oe,typeof h!="symbol"?h+"":h,Mt);function Ei(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const ur=Ei(h);function tn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Rr={exports:{}},lr={};/**
2
- * @license React
3
- * react-jsx-runtime.production.min.js
4
- *
5
- * Copyright (c) Facebook, Inc. and its affiliates.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE file in the root directory of this source tree.
9
- */var os;function ki(){if(os)return lr;os=1;var e=h,t=Symbol.for("react.element"),r=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,s=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function i(c,u,m){var d,b={},x=null,l=null;m!==void 0&&(x=""+m),u.key!==void 0&&(x=""+u.key),u.ref!==void 0&&(l=u.ref);for(d in u)n.call(u,d)&&!o.hasOwnProperty(d)&&(b[d]=u[d]);if(c&&c.defaultProps)for(d in u=c.defaultProps,u)b[d]===void 0&&(b[d]=u[d]);return{$$typeof:t,type:c,key:x,ref:l,props:b,_owner:s.current}}return lr.Fragment=r,lr.jsx=i,lr.jsxs=i,lr}var fr={};/**
10
- * @license React
11
- * react-jsx-runtime.development.js
12
- *
13
- * Copyright (c) Facebook, Inc. and its affiliates.
14
- *
15
- * This source code is licensed under the MIT license found in the
16
- * LICENSE file in the root directory of this source tree.
17
- */var is;function Ci(){return is||(is=1,process.env.NODE_ENV!=="production"&&function(){var e=h,t=Symbol.for("react.element"),r=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),c=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),d=Symbol.for("react.suspense_list"),b=Symbol.for("react.memo"),x=Symbol.for("react.lazy"),l=Symbol.for("react.offscreen"),f=Symbol.iterator,p="@@iterator";function w(a){if(a===null||typeof a!="object")return null;var g=f&&a[f]||a[p];return typeof g=="function"?g:null}var v=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function T(a){{for(var g=arguments.length,S=new Array(g>1?g-1:0),_=1;_<g;_++)S[_-1]=arguments[_];L("error",a,S)}}function L(a,g,S){{var _=v.ReactDebugCurrentFrame,X=_.getStackAddendum();X!==""&&(g+="%s",S=S.concat([X]));var te=S.map(function(B){return String(B)});te.unshift("Warning: "+g),Function.prototype.apply.call(console[a],console,te)}}var I=!1,E=!1,Q=!1,M=!1,$=!1,F;F=Symbol.for("react.module.reference");function se(a){return!!(typeof a=="string"||typeof a=="function"||a===n||a===o||$||a===s||a===m||a===d||M||a===l||I||E||Q||typeof a=="object"&&a!==null&&(a.$$typeof===x||a.$$typeof===b||a.$$typeof===i||a.$$typeof===c||a.$$typeof===u||a.$$typeof===F||a.getModuleId!==void 0))}function ae(a,g,S){var _=a.displayName;if(_)return _;var X=g.displayName||g.name||"";return X!==""?S+"("+X+")":S}function U(a){return a.displayName||"Context"}function R(a){if(a==null)return null;if(typeof a.tag=="number"&&T("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof a=="function")return a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case n:return"Fragment";case r:return"Portal";case o:return"Profiler";case s:return"StrictMode";case m:return"Suspense";case d:return"SuspenseList"}if(typeof a=="object")switch(a.$$typeof){case c:var g=a;return U(g)+".Consumer";case i:var S=a;return U(S._context)+".Provider";case u:return ae(a,a.render,"ForwardRef");case b:var _=a.displayName||null;return _!==null?_:R(a.type)||"Memo";case x:{var X=a,te=X._payload,B=X._init;try{return R(B(te))}catch{return null}}}return null}var A=Object.assign,j=0,q,W,ie,Z,k,N,D;function C(){}C.__reactDisabledLog=!0;function z(){{if(j===0){q=console.log,W=console.info,ie=console.warn,Z=console.error,k=console.group,N=console.groupCollapsed,D=console.groupEnd;var a={configurable:!0,enumerable:!0,value:C,writable:!0};Object.defineProperties(console,{info:a,log:a,warn:a,error:a,group:a,groupCollapsed:a,groupEnd:a})}j++}}function ee(){{if(j--,j===0){var a={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:A({},a,{value:q}),info:A({},a,{value:W}),warn:A({},a,{value:ie}),error:A({},a,{value:Z}),group:A({},a,{value:k}),groupCollapsed:A({},a,{value:N}),groupEnd:A({},a,{value:D})})}j<0&&T("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var Y=v.ReactCurrentDispatcher,K;function G(a,g,S){{if(K===void 0)try{throw Error()}catch(X){var _=X.stack.trim().match(/\n( *(at )?)/);K=_&&_[1]||""}return`
18
- `+K+a}}var ne=!1,re;{var V=typeof WeakMap=="function"?WeakMap:Map;re=new V}function O(a,g){if(!a||ne)return"";{var S=re.get(a);if(S!==void 0)return S}var _;ne=!0;var X=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var te;te=Y.current,Y.current=null,z();try{if(g){var B=function(){throw Error()};if(Object.defineProperty(B.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(B,[])}catch(xe){_=xe}Reflect.construct(a,[],B)}else{try{B.call()}catch(xe){_=xe}a.call(B.prototype)}}else{try{throw Error()}catch(xe){_=xe}a()}}catch(xe){if(xe&&_&&typeof xe.stack=="string"){for(var H=xe.stack.split(`
19
- `),ge=_.stack.split(`
20
- `),ce=H.length-1,le=ge.length-1;ce>=1&&le>=0&&H[ce]!==ge[le];)le--;for(;ce>=1&&le>=0;ce--,le--)if(H[ce]!==ge[le]){if(ce!==1||le!==1)do if(ce--,le--,le<0||H[ce]!==ge[le]){var Ee=`
21
- `+H[ce].replace(" at new "," at ");return a.displayName&&Ee.includes("<anonymous>")&&(Ee=Ee.replace("<anonymous>",a.displayName)),typeof a=="function"&&re.set(a,Ee),Ee}while(ce>=1&&le>=0);break}}}finally{ne=!1,Y.current=te,ee(),Error.prepareStackTrace=X}var Ue=a?a.displayName||a.name:"",Ve=Ue?G(Ue):"";return typeof a=="function"&&re.set(a,Ve),Ve}function _e(a,g,S){return O(a,!1)}function He(a){var g=a.prototype;return!!(g&&g.isReactComponent)}function Re(a,g,S){if(a==null)return"";if(typeof a=="function")return O(a,He(a));if(typeof a=="string")return G(a);switch(a){case m:return G("Suspense");case d:return G("SuspenseList")}if(typeof a=="object")switch(a.$$typeof){case u:return _e(a.render);case b:return Re(a.type,g,S);case x:{var _=a,X=_._payload,te=_._init;try{return Re(te(X),g,S)}catch{}}}return""}var Le=Object.prototype.hasOwnProperty,nt={},st=v.ReactDebugCurrentFrame;function We(a){if(a){var g=a._owner,S=Re(a.type,a._source,g?g.type:null);st.setExtraStackFrame(S)}else st.setExtraStackFrame(null)}function Nr(a,g,S,_,X){{var te=Function.call.bind(Le);for(var B in a)if(te(a,B)){var H=void 0;try{if(typeof a[B]!="function"){var ge=Error((_||"React class")+": "+S+" type `"+B+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof a[B]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw ge.name="Invariant Violation",ge}H=a[B](g,B,_,S,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(ce){H=ce}H&&!(H instanceof Error)&&(We(X),T("%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).",_||"React class",S,B,typeof H),We(null)),H instanceof Error&&!(H.message in nt)&&(nt[H.message]=!0,We(X),T("Failed %s type: %s",S,H.message),We(null))}}}var Jt=Array.isArray;function ot(a){return Jt(a)}function _t(a){{var g=typeof Symbol=="function"&&Symbol.toStringTag,S=g&&a[Symbol.toStringTag]||a.constructor.name||"Object";return S}}function er(a){try{return gt(a),!1}catch{return!0}}function gt(a){return""+a}function Nt(a){if(er(a))return T("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",_t(a)),gt(a)}var it=v.ReactCurrentOwner,bt={key:!0,ref:!0,__self:!0,__source:!0},jt,Qe;function jr(a){if(Le.call(a,"ref")){var g=Object.getOwnPropertyDescriptor(a,"ref").get;if(g&&g.isReactWarning)return!1}return a.ref!==void 0}function Jr(a){if(Le.call(a,"key")){var g=Object.getOwnPropertyDescriptor(a,"key").get;if(g&&g.isReactWarning)return!1}return a.key!==void 0}function Ir(a,g){typeof a.ref=="string"&&it.current}function tr(a,g){{var S=function(){jt||(jt=!0,T("%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)",g))};S.isReactWarning=!0,Object.defineProperty(a,"key",{get:S,configurable:!0})}}function rr(a,g){{var S=function(){Qe||(Qe=!0,T("%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)",g))};S.isReactWarning=!0,Object.defineProperty(a,"ref",{get:S,configurable:!0})}}var en=function(a,g,S,_,X,te,B){var H={$$typeof:t,type:a,key:g,ref:S,props:B,_owner:te};return H._store={},Object.defineProperty(H._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(H,"_self",{configurable:!1,enumerable:!1,writable:!1,value:_}),Object.defineProperty(H,"_source",{configurable:!1,enumerable:!1,writable:!1,value:X}),Object.freeze&&(Object.freeze(H.props),Object.freeze(H)),H};function nr(a,g,S,_,X){{var te,B={},H=null,ge=null;S!==void 0&&(Nt(S),H=""+S),Jr(g)&&(Nt(g.key),H=""+g.key),jr(g)&&(ge=g.ref,Ir(g,X));for(te in g)Le.call(g,te)&&!bt.hasOwnProperty(te)&&(B[te]=g[te]);if(a&&a.defaultProps){var ce=a.defaultProps;for(te in ce)B[te]===void 0&&(B[te]=ce[te])}if(H||ge){var le=typeof a=="function"?a.displayName||a.name||"Unknown":a;H&&tr(B,le),ge&&rr(B,le)}return en(a,H,ge,X,_,it.current,B)}}var Ge=v.ReactCurrentOwner,J=v.ReactDebugCurrentFrame;function ue(a){if(a){var g=a._owner,S=Re(a.type,a._source,g?g.type:null);J.setExtraStackFrame(S)}else J.setExtraStackFrame(null)}var Be;Be=!1;function Ke(a){return typeof a=="object"&&a!==null&&a.$$typeof===t}function yt(){{if(Ge.current){var a=R(Ge.current.type);if(a)return`
22
-
23
- Check the render method of \``+a+"`."}return""}}function sr(a){return""}var vt={};function or(a){{var g=yt();if(!g){var S=typeof a=="string"?a:a.displayName||a.name;S&&(g=`
24
-
25
- Check the top-level render call using <`+S+">.")}return g}}function xt(a,g){{if(!a._store||a._store.validated||a.key!=null)return;a._store.validated=!0;var S=or(g);if(vt[S])return;vt[S]=!0;var _="";a&&a._owner&&a._owner!==Ge.current&&(_=" It was passed a child from "+R(a._owner.type)+"."),ue(a),T('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',S,_),ue(null)}}function wt(a,g){{if(typeof a!="object")return;if(ot(a))for(var S=0;S<a.length;S++){var _=a[S];Ke(_)&&xt(_,g)}else if(Ke(a))a._store&&(a._store.validated=!0);else if(a){var X=w(a);if(typeof X=="function"&&X!==a.entries)for(var te=X.call(a),B;!(B=te.next()).done;)Ke(B.value)&&xt(B.value,g)}}}function ir(a){{var g=a.type;if(g==null||typeof g=="string")return;var S;if(typeof g=="function")S=g.propTypes;else if(typeof g=="object"&&(g.$$typeof===u||g.$$typeof===b))S=g.propTypes;else return;if(S){var _=R(g);Nr(S,a.props,"prop",_,a)}else if(g.PropTypes!==void 0&&!Be){Be=!0;var X=R(g);T("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",X||"Unknown")}typeof g.getDefaultProps=="function"&&!g.getDefaultProps.isReactClassApproved&&T("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function ar(a){{for(var g=Object.keys(a.props),S=0;S<g.length;S++){var _=g[S];if(_!=="children"&&_!=="key"){ue(a),T("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",_),ue(null);break}}a.ref!==null&&(ue(a),T("Invalid attribute `ref` supplied to `React.Fragment`."),ue(null))}}var St={};function Mr(a,g,S,_,X,te){{var B=se(a);if(!B){var H="";(a===void 0||typeof a=="object"&&a!==null&&Object.keys(a).length===0)&&(H+=" 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 ge=sr();ge?H+=ge:H+=yt();var ce;a===null?ce="null":ot(a)?ce="array":a!==void 0&&a.$$typeof===t?(ce="<"+(R(a.type)||"Unknown")+" />",H=" Did you accidentally export a JSX literal instead of a component?"):ce=typeof a,T("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",ce,H)}var le=nr(a,g,S,X,te);if(le==null)return le;if(B){var Ee=g.children;if(Ee!==void 0)if(_)if(ot(Ee)){for(var Ue=0;Ue<Ee.length;Ue++)wt(Ee[Ue],a);Object.freeze&&Object.freeze(Ee)}else T("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 wt(Ee,a)}if(Le.call(g,"key")){var Ve=R(a),xe=Object.keys(g).filter(function(ss){return ss!=="key"}),It=xe.length>0?"{key: someKey, "+xe.join(": ..., ")+": ...}":"{key: someKey}";if(!St[Ve+It]){var ns=xe.length>0?"{"+xe.join(": ..., ")+": ...}":"{}";T(`A props object containing a "key" prop is being spread into JSX:
1
+ (function(Y,v){typeof exports=="object"&&typeof module<"u"?v(exports,require("react/jsx-runtime"),require("react"),require("@beesoft/locale"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","@beesoft/locale","react-dom"],v):(Y=typeof globalThis<"u"?globalThis:Y||self,v(Y.BeeSoftComponents={},Y.React,Y.React,Y["beesoft-locale"],Y.ReactDOM))})(this,(function(Y,v,m,kl,Dl){"use strict";function El(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 Ke=El(m),mi=m.createContext(void 0),gi=()=>m.useContext(mi),Ml=({overlayKeepOnScreen:e=!0,useAnimations:t=!0,mobileMediaQuery:n,tabletMediaQuery:r,desktopMediaQuery:s,isValidScrollableElement:i,children:o})=>{const a={overlayKeepOnScreen:e,useAnimations:t,mobileMediaQuery:n,tabletMediaQuery:r,desktopMediaQuery:s,isValidScrollableElement:i};return v.jsx(mi.Provider,{value:a,children:o})};var wt=(e=>(e[e.Vertical=0]="Vertical",e[e.Horizontal=1]="Horizontal",e))(wt||{}),Et=(e=>(e[e.Right=0]="Right",e[e.Left=1]="Left",e))(Et||{});function yi(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var lr={exports:{}};var bi;function Al(){return bi||(bi=1,(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var i="",o=0;o<arguments.length;o++){var a=arguments[o];a&&(i=s(i,r(a)))}return i}function r(i){if(typeof i=="string"||typeof i=="number")return i;if(typeof i!="object")return"";if(Array.isArray(i))return n.apply(null,i);if(i.toString!==Object.prototype.toString&&!i.toString.toString().includes("[native code]"))return i.toString();var o="";for(var a in i)t.call(i,a)&&i[a]&&(o=s(o,a));return o}function s(i,o){return o?i?i+" "+o:i+o:i}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})(lr)),lr.exports}var Nl=Al();const z=yi(Nl);var we=(e=>(e[e.Focus=0]="Focus",e[e.FocusWithin=1]="FocusWithin",e))(we||{});const Ge=(e=1)=>m.useMemo(()=>z("bsc:dark:ring-mono-light-2 bsc:dark:ring-offset-mono-dark-1",{"bsc:focus-within:ring-3 bsc:focus-within:ring-primary-2 bsc:focus-within:ring-offset-2 focus-within:bsc-ring-opacity-50":e===1,"bsc:focus:ring-3 bsc:focus:ring-primary-2 bsc:focus:ring-offset-2 focus:bsc-ring-opacity-50":e===0}),[e]),Il=(e,t)=>{const n=m.useRef(null),{buttonType:r,buttonStyle:s="curved",type:i="button",disabled:o=!1,form:a,fullWidth:c=!1,onClick:l,className:u,children:h}=e,d=()=>{n.current?.click()};m.useImperativeHandle(t,()=>({click:d}));const f=Ge(we.Focus),p=z("bc-button bsc:max-sm:p-4 bsc:md:p-2 bsc:dark:bg-mono-light-1 bsc:dark:hover:bg-mono-light-2 bsc:dark:text-mono-dark-1",f,{"bsc:w-full":c,"bc-disabled bsc:bg-gray-3 bsc:text-gray-2 bsc:pointer-events-none":o,"bsc:bg-primary-1 bsc:text-white bsc:hover:bg-primary-2 bsc:focus:ring-primary-1":r==="primary","bsc:bg-primary-2 bsc:text-white bsc:hover:bg-primary-3 bsc:focus:ring-primary-2":r==="secondary","bsc:bg-info bsc:text-white bsc:focus:ring-info":r==="info","bsc:bg-success bsc:text-white bsc:focus:ring-success":r==="success","bsc:bg-warning bsc:text-white bsc:focus:ring-warning":r==="warning","bsc:bg-error bsc:text-white bsc:focus:ring-error":r==="error","bsc:rounded-md":s==="curved","bsc:rounded-full bsc:px-4!":s==="round"},u);return v.jsx("button",{ref:n,type:i,onClick:l,disabled:o,form:a,className:p,children:h})},jt=m.forwardRef(Il);var hr={exports:{}},qe={},vi;function Ol(){if(vi)return qe;vi=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,s,i){var o=null;if(i!==void 0&&(o=""+i),s.key!==void 0&&(o=""+s.key),"key"in s){i={};for(var a in s)a!=="key"&&(i[a]=s[a])}else i=s;return s=i.ref,{$$typeof:e,type:r,key:o,ref:s!==void 0?s:null,props:i}}return qe.Fragment=t,qe.jsx=n,qe.jsxs=n,qe}var An={},wi;function Vl(){return wi||(wi=1,process.env.NODE_ENV!=="production"&&(function(){function e(x){if(x==null)return null;if(typeof x=="function")return x.$$typeof===R?null:x.displayName||x.name||null;if(typeof x=="string")return x;switch(x){case y:return"Fragment";case w:return"Profiler";case b:return"StrictMode";case D:return"Suspense";case A:return"SuspenseList";case j:return"Activity"}if(typeof x=="object")switch(typeof x.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),x.$$typeof){case g:return"Portal";case T:return x.displayName||"Context";case S:return(x._context.displayName||"Context")+".Consumer";case P:var k=x.render;return x=x.displayName,x||(x=k.displayName||k.name||"",x=x!==""?"ForwardRef("+x+")":"ForwardRef"),x;case C:return k=x.displayName||null,k!==null?k:e(x.type)||"Memo";case E:k=x._payload,x=x._init;try{return e(x(k))}catch{}}return null}function t(x){return""+x}function n(x){try{t(x);var k=!1}catch{k=!0}if(k){k=console;var M=k.error,q=typeof Symbol=="function"&&Symbol.toStringTag&&x[Symbol.toStringTag]||x.constructor.name||"Object";return M.call(k,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",q),t(x)}}function r(x){if(x===y)return"<>";if(typeof x=="object"&&x!==null&&x.$$typeof===E)return"<...>";try{var k=e(x);return k?"<"+k+">":"<...>"}catch{return"<...>"}}function s(){var x=F.A;return x===null?null:x.getOwner()}function i(){return Error("react-stack-top-frame")}function o(x){if(B.call(x,"key")){var k=Object.getOwnPropertyDescriptor(x,"key").get;if(k&&k.isReactWarning)return!1}return x.key!==void 0}function a(x,k){function M(){W||(W=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",k))}M.isReactWarning=!0,Object.defineProperty(x,"key",{get:M,configurable:!0})}function c(){var x=e(this.type);return L[x]||(L[x]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),x=this.props.ref,x!==void 0?x:null}function l(x,k,M,q,Dt,Zt){var ut=M.ref;return x={$$typeof:p,type:x,key:k,props:M,_owner:q},(ut!==void 0?ut:null)!==null?Object.defineProperty(x,"ref",{enumerable:!1,get:c}):Object.defineProperty(x,"ref",{enumerable:!1,value:null}),x._store={},Object.defineProperty(x._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(x,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(x,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:Dt}),Object.defineProperty(x,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:Zt}),Object.freeze&&(Object.freeze(x.props),Object.freeze(x)),x}function u(x,k,M,q,Dt,Zt){var ut=k.children;if(ut!==void 0)if(q)if(N(ut)){for(q=0;q<ut.length;q++)h(ut[q]);Object.freeze&&Object.freeze(ut)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else h(ut);if(B.call(k,"key")){ut=e(x);var Ot=Object.keys(k).filter(function(lt){return lt!=="key"});q=0<Ot.length?"{key: someKey, "+Ot.join(": ..., ")+": ...}":"{key: someKey}",Z[ut+q]||(Ot=0<Ot.length?"{"+Ot.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
26
2
  let props = %s;
27
3
  <%s {...props} />
28
4
  React keys must be passed directly to JSX without using spread:
29
5
  let props = %s;
30
- <%s key={someKey} {...props} />`,It,Ve,ns,Ve),St[Ve+It]=!0}}return a===n?ar(le):ir(le),le}}function Jn(a,g,S){return Mr(a,g,S,!0)}function es(a,g,S){return Mr(a,g,S,!1)}var ts=es,rs=Jn;fr.Fragment=n,fr.jsx=ts,fr.jsxs=rs}()),fr}var as;function Oi(){return as||(as=1,process.env.NODE_ENV==="production"?Rr.exports=ki():Rr.exports=Ci()),Rr.exports}var y=Oi();const cs=h.createContext(void 0),us=()=>h.useContext(cs),Di=({overlayKeepOnScreen:e=!0,useAnimations:t=!0,mobileMediaQuery:r,tabletMediaQuery:n,desktopMediaQuery:s,isValidScrollableElement:o,children:i})=>{const c={overlayKeepOnScreen:e,useAnimations:t,mobileMediaQuery:r,tabletMediaQuery:n,desktopMediaQuery:s,isValidScrollableElement:o};return y.jsx(cs.Provider,{value:c,children:i})};var Ae=(e=>(e[e.Vertical=0]="Vertical",e[e.Horizontal=1]="Horizontal",e))(Ae||{}),qe=(e=>(e[e.Right=0]="Right",e[e.Left=1]="Left",e))(qe||{}),rn={exports:{}};/*!
31
- Copyright (c) 2018 Jed Watson.
32
- Licensed under the MIT License (MIT), see
33
- http://jedwatson.github.io/classnames
34
- */var ls;function _i(){return ls||(ls=1,function(e){(function(){var t={}.hasOwnProperty;function r(){for(var o="",i=0;i<arguments.length;i++){var c=arguments[i];c&&(o=s(o,n(c)))}return o}function n(o){if(typeof o=="string"||typeof o=="number")return o;if(typeof o!="object")return"";if(Array.isArray(o))return r.apply(null,o);if(o.toString!==Object.prototype.toString&&!o.toString.toString().includes("[native code]"))return o.toString();var i="";for(var c in o)t.call(o,c)&&o[c]&&(i=s(i,c));return i}function s(o,i){return i?o?o+" "+i:o+i:o}e.exports?(r.default=r,e.exports=r):window.classNames=r})()}(rn)),rn.exports}var Ni=_i();const he=tn(Ni);var Rt=(e=>(e[e.Focus=0]="Focus",e[e.FocusWithin=1]="FocusWithin",e))(Rt||{});const dr=(e=1)=>h.useMemo(()=>he("bsc:dark:ring-mono-light-2 bsc:dark:ring-offset-mono-dark-1",{"bsc:focus-within:ring-3 bsc:focus-within:ring-primary-2 bsc:focus-within:ring-offset-2 focus-within:bsc-ring-opacity-50":e===1,"bsc:focus:ring-3 bsc:focus:ring-primary-2 bsc:focus:ring-offset-2 focus:bsc-ring-opacity-50":e===0}),[e]),ji=(e,t)=>{const r=h.useRef(null),{buttonType:n,buttonStyle:s="curved",type:o="button",disabled:i=!1,form:c,fullWidth:u=!1,onClick:m,className:d,children:b}=e,x=()=>{var p;(p=r.current)==null||p.click()};h.useImperativeHandle(t,()=>({click:x}));const l=dr(Rt.Focus),f=he("bc-button bsc:max-sm:p-4 bsc:md:p-2 bsc:dark:bg-mono-light-1 bsc:dark:hover:bg-mono-light-2 bsc:dark:text-mono-dark-1",l,{"bsc:w-full":u,"bc-disabled bsc:bg-gray-3 bsc:text-gray-2 bsc:pointer-events-none":i,"bsc:bg-primary-1 bsc:text-white bsc:hover:bg-primary-2 bsc:focus:ring-primary-1":n==="primary","bsc:bg-primary-2 bsc:text-white bsc:hover:bg-primary-3 bsc:focus:ring-primary-2":n==="secondary","bsc:bg-info bsc:text-white bsc:focus:ring-info":n==="info","bsc:bg-success bsc:text-white bsc:focus:ring-success":n==="success","bsc:bg-warning bsc:text-white bsc:focus:ring-warning":n==="warning","bsc:bg-error bsc:text-white bsc:focus:ring-error":n==="error","bsc:rounded-md":s==="curved","bsc:rounded-full bsc:px-4!":s==="round"},d);return y.jsx("button",{ref:r,type:o,onClick:m,disabled:i,form:c,className:f,children:b})},Xe=h.forwardRef(ji);var nn={exports:{}},hr={};/**
35
- * @license React
36
- * react-jsx-runtime.production.min.js
37
- *
38
- * Copyright (c) Facebook, Inc. and its affiliates.
39
- *
40
- * This source code is licensed under the MIT license found in the
41
- * LICENSE file in the root directory of this source tree.
42
- */var fs;function Ii(){if(fs)return hr;fs=1;var e=h,t=Symbol.for("react.element"),r=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,s=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function i(c,u,m){var d,b={},x=null,l=null;m!==void 0&&(x=""+m),u.key!==void 0&&(x=""+u.key),u.ref!==void 0&&(l=u.ref);for(d in u)n.call(u,d)&&!o.hasOwnProperty(d)&&(b[d]=u[d]);if(c&&c.defaultProps)for(d in u=c.defaultProps,u)b[d]===void 0&&(b[d]=u[d]);return{$$typeof:t,type:c,key:x,ref:l,props:b,_owner:s.current}}return hr.Fragment=r,hr.jsx=i,hr.jsxs=i,hr}var Lr={};/**
43
- * @license React
44
- * react-jsx-runtime.development.js
45
- *
46
- * Copyright (c) Facebook, Inc. and its affiliates.
47
- *
48
- * This source code is licensed under the MIT license found in the
49
- * LICENSE file in the root directory of this source tree.
50
- */var ds;function Mi(){return ds||(ds=1,process.env.NODE_ENV!=="production"&&function(){var e=h,t=Symbol.for("react.element"),r=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),c=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),d=Symbol.for("react.suspense_list"),b=Symbol.for("react.memo"),x=Symbol.for("react.lazy"),l=Symbol.for("react.offscreen"),f=Symbol.iterator,p="@@iterator";function w(a){if(a===null||typeof a!="object")return null;var g=f&&a[f]||a[p];return typeof g=="function"?g:null}var v=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function T(a){{for(var g=arguments.length,S=new Array(g>1?g-1:0),_=1;_<g;_++)S[_-1]=arguments[_];L("error",a,S)}}function L(a,g,S){{var _=v.ReactDebugCurrentFrame,X=_.getStackAddendum();X!==""&&(g+="%s",S=S.concat([X]));var te=S.map(function(B){return String(B)});te.unshift("Warning: "+g),Function.prototype.apply.call(console[a],console,te)}}var I=!1,E=!1,Q=!1,M=!1,$=!1,F;F=Symbol.for("react.module.reference");function se(a){return!!(typeof a=="string"||typeof a=="function"||a===n||a===o||$||a===s||a===m||a===d||M||a===l||I||E||Q||typeof a=="object"&&a!==null&&(a.$$typeof===x||a.$$typeof===b||a.$$typeof===i||a.$$typeof===c||a.$$typeof===u||a.$$typeof===F||a.getModuleId!==void 0))}function ae(a,g,S){var _=a.displayName;if(_)return _;var X=g.displayName||g.name||"";return X!==""?S+"("+X+")":S}function U(a){return a.displayName||"Context"}function R(a){if(a==null)return null;if(typeof a.tag=="number"&&T("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof a=="function")return a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case n:return"Fragment";case r:return"Portal";case o:return"Profiler";case s:return"StrictMode";case m:return"Suspense";case d:return"SuspenseList"}if(typeof a=="object")switch(a.$$typeof){case c:var g=a;return U(g)+".Consumer";case i:var S=a;return U(S._context)+".Provider";case u:return ae(a,a.render,"ForwardRef");case b:var _=a.displayName||null;return _!==null?_:R(a.type)||"Memo";case x:{var X=a,te=X._payload,B=X._init;try{return R(B(te))}catch{return null}}}return null}var A=Object.assign,j=0,q,W,ie,Z,k,N,D;function C(){}C.__reactDisabledLog=!0;function z(){{if(j===0){q=console.log,W=console.info,ie=console.warn,Z=console.error,k=console.group,N=console.groupCollapsed,D=console.groupEnd;var a={configurable:!0,enumerable:!0,value:C,writable:!0};Object.defineProperties(console,{info:a,log:a,warn:a,error:a,group:a,groupCollapsed:a,groupEnd:a})}j++}}function ee(){{if(j--,j===0){var a={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:A({},a,{value:q}),info:A({},a,{value:W}),warn:A({},a,{value:ie}),error:A({},a,{value:Z}),group:A({},a,{value:k}),groupCollapsed:A({},a,{value:N}),groupEnd:A({},a,{value:D})})}j<0&&T("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var Y=v.ReactCurrentDispatcher,K;function G(a,g,S){{if(K===void 0)try{throw Error()}catch(X){var _=X.stack.trim().match(/\n( *(at )?)/);K=_&&_[1]||""}return`
51
- `+K+a}}var ne=!1,re;{var V=typeof WeakMap=="function"?WeakMap:Map;re=new V}function O(a,g){if(!a||ne)return"";{var S=re.get(a);if(S!==void 0)return S}var _;ne=!0;var X=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var te;te=Y.current,Y.current=null,z();try{if(g){var B=function(){throw Error()};if(Object.defineProperty(B.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(B,[])}catch(xe){_=xe}Reflect.construct(a,[],B)}else{try{B.call()}catch(xe){_=xe}a.call(B.prototype)}}else{try{throw Error()}catch(xe){_=xe}a()}}catch(xe){if(xe&&_&&typeof xe.stack=="string"){for(var H=xe.stack.split(`
52
- `),ge=_.stack.split(`
53
- `),ce=H.length-1,le=ge.length-1;ce>=1&&le>=0&&H[ce]!==ge[le];)le--;for(;ce>=1&&le>=0;ce--,le--)if(H[ce]!==ge[le]){if(ce!==1||le!==1)do if(ce--,le--,le<0||H[ce]!==ge[le]){var Ee=`
54
- `+H[ce].replace(" at new "," at ");return a.displayName&&Ee.includes("<anonymous>")&&(Ee=Ee.replace("<anonymous>",a.displayName)),typeof a=="function"&&re.set(a,Ee),Ee}while(ce>=1&&le>=0);break}}}finally{ne=!1,Y.current=te,ee(),Error.prepareStackTrace=X}var Ue=a?a.displayName||a.name:"",Ve=Ue?G(Ue):"";return typeof a=="function"&&re.set(a,Ve),Ve}function _e(a,g,S){return O(a,!1)}function He(a){var g=a.prototype;return!!(g&&g.isReactComponent)}function Re(a,g,S){if(a==null)return"";if(typeof a=="function")return O(a,He(a));if(typeof a=="string")return G(a);switch(a){case m:return G("Suspense");case d:return G("SuspenseList")}if(typeof a=="object")switch(a.$$typeof){case u:return _e(a.render);case b:return Re(a.type,g,S);case x:{var _=a,X=_._payload,te=_._init;try{return Re(te(X),g,S)}catch{}}}return""}var Le=Object.prototype.hasOwnProperty,nt={},st=v.ReactDebugCurrentFrame;function We(a){if(a){var g=a._owner,S=Re(a.type,a._source,g?g.type:null);st.setExtraStackFrame(S)}else st.setExtraStackFrame(null)}function Nr(a,g,S,_,X){{var te=Function.call.bind(Le);for(var B in a)if(te(a,B)){var H=void 0;try{if(typeof a[B]!="function"){var ge=Error((_||"React class")+": "+S+" type `"+B+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof a[B]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw ge.name="Invariant Violation",ge}H=a[B](g,B,_,S,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(ce){H=ce}H&&!(H instanceof Error)&&(We(X),T("%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).",_||"React class",S,B,typeof H),We(null)),H instanceof Error&&!(H.message in nt)&&(nt[H.message]=!0,We(X),T("Failed %s type: %s",S,H.message),We(null))}}}var Jt=Array.isArray;function ot(a){return Jt(a)}function _t(a){{var g=typeof Symbol=="function"&&Symbol.toStringTag,S=g&&a[Symbol.toStringTag]||a.constructor.name||"Object";return S}}function er(a){try{return gt(a),!1}catch{return!0}}function gt(a){return""+a}function Nt(a){if(er(a))return T("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",_t(a)),gt(a)}var it=v.ReactCurrentOwner,bt={key:!0,ref:!0,__self:!0,__source:!0},jt,Qe;function jr(a){if(Le.call(a,"ref")){var g=Object.getOwnPropertyDescriptor(a,"ref").get;if(g&&g.isReactWarning)return!1}return a.ref!==void 0}function Jr(a){if(Le.call(a,"key")){var g=Object.getOwnPropertyDescriptor(a,"key").get;if(g&&g.isReactWarning)return!1}return a.key!==void 0}function Ir(a,g){typeof a.ref=="string"&&it.current}function tr(a,g){{var S=function(){jt||(jt=!0,T("%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)",g))};S.isReactWarning=!0,Object.defineProperty(a,"key",{get:S,configurable:!0})}}function rr(a,g){{var S=function(){Qe||(Qe=!0,T("%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)",g))};S.isReactWarning=!0,Object.defineProperty(a,"ref",{get:S,configurable:!0})}}var en=function(a,g,S,_,X,te,B){var H={$$typeof:t,type:a,key:g,ref:S,props:B,_owner:te};return H._store={},Object.defineProperty(H._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(H,"_self",{configurable:!1,enumerable:!1,writable:!1,value:_}),Object.defineProperty(H,"_source",{configurable:!1,enumerable:!1,writable:!1,value:X}),Object.freeze&&(Object.freeze(H.props),Object.freeze(H)),H};function nr(a,g,S,_,X){{var te,B={},H=null,ge=null;S!==void 0&&(Nt(S),H=""+S),Jr(g)&&(Nt(g.key),H=""+g.key),jr(g)&&(ge=g.ref,Ir(g));for(te in g)Le.call(g,te)&&!bt.hasOwnProperty(te)&&(B[te]=g[te]);if(a&&a.defaultProps){var ce=a.defaultProps;for(te in ce)B[te]===void 0&&(B[te]=ce[te])}if(H||ge){var le=typeof a=="function"?a.displayName||a.name||"Unknown":a;H&&tr(B,le),ge&&rr(B,le)}return en(a,H,ge,X,_,it.current,B)}}var Ge=v.ReactCurrentOwner,J=v.ReactDebugCurrentFrame;function ue(a){if(a){var g=a._owner,S=Re(a.type,a._source,g?g.type:null);J.setExtraStackFrame(S)}else J.setExtraStackFrame(null)}var Be;Be=!1;function Ke(a){return typeof a=="object"&&a!==null&&a.$$typeof===t}function yt(){{if(Ge.current){var a=R(Ge.current.type);if(a)return`
55
-
56
- Check the render method of \``+a+"`."}return""}}function sr(a){return""}var vt={};function or(a){{var g=yt();if(!g){var S=typeof a=="string"?a:a.displayName||a.name;S&&(g=`
57
-
58
- Check the top-level render call using <`+S+">.")}return g}}function xt(a,g){{if(!a._store||a._store.validated||a.key!=null)return;a._store.validated=!0;var S=or(g);if(vt[S])return;vt[S]=!0;var _="";a&&a._owner&&a._owner!==Ge.current&&(_=" It was passed a child from "+R(a._owner.type)+"."),ue(a),T('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',S,_),ue(null)}}function wt(a,g){{if(typeof a!="object")return;if(ot(a))for(var S=0;S<a.length;S++){var _=a[S];Ke(_)&&xt(_,g)}else if(Ke(a))a._store&&(a._store.validated=!0);else if(a){var X=w(a);if(typeof X=="function"&&X!==a.entries)for(var te=X.call(a),B;!(B=te.next()).done;)Ke(B.value)&&xt(B.value,g)}}}function ir(a){{var g=a.type;if(g==null||typeof g=="string")return;var S;if(typeof g=="function")S=g.propTypes;else if(typeof g=="object"&&(g.$$typeof===u||g.$$typeof===b))S=g.propTypes;else return;if(S){var _=R(g);Nr(S,a.props,"prop",_,a)}else if(g.PropTypes!==void 0&&!Be){Be=!0;var X=R(g);T("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",X||"Unknown")}typeof g.getDefaultProps=="function"&&!g.getDefaultProps.isReactClassApproved&&T("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function ar(a){{for(var g=Object.keys(a.props),S=0;S<g.length;S++){var _=g[S];if(_!=="children"&&_!=="key"){ue(a),T("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",_),ue(null);break}}a.ref!==null&&(ue(a),T("Invalid attribute `ref` supplied to `React.Fragment`."),ue(null))}}var St={};function Mr(a,g,S,_,X,te){{var B=se(a);if(!B){var H="";(a===void 0||typeof a=="object"&&a!==null&&Object.keys(a).length===0)&&(H+=" 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 ge=sr();ge?H+=ge:H+=yt();var ce;a===null?ce="null":ot(a)?ce="array":a!==void 0&&a.$$typeof===t?(ce="<"+(R(a.type)||"Unknown")+" />",H=" Did you accidentally export a JSX literal instead of a component?"):ce=typeof a,T("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",ce,H)}var le=nr(a,g,S,X,te);if(le==null)return le;if(B){var Ee=g.children;if(Ee!==void 0)if(_)if(ot(Ee)){for(var Ue=0;Ue<Ee.length;Ue++)wt(Ee[Ue],a);Object.freeze&&Object.freeze(Ee)}else T("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 wt(Ee,a)}if(Le.call(g,"key")){var Ve=R(a),xe=Object.keys(g).filter(function(ss){return ss!=="key"}),It=xe.length>0?"{key: someKey, "+xe.join(": ..., ")+": ...}":"{key: someKey}";if(!St[Ve+It]){var ns=xe.length>0?"{"+xe.join(": ..., ")+": ...}":"{}";T(`A props object containing a "key" prop is being spread into JSX:
59
- let props = %s;
60
- <%s {...props} />
61
- React keys must be passed directly to JSX without using spread:
62
- let props = %s;
63
- <%s key={someKey} {...props} />`,It,Ve,ns,Ve),St[Ve+It]=!0}}return a===n?ar(le):ir(le),le}}function Jn(a,g,S){return Mr(a,g,S,!0)}function es(a,g,S){return Mr(a,g,S,!1)}var ts=es,rs=Jn;Lr.Fragment=n,Lr.jsx=ts,Lr.jsxs=rs}()),Lr}var hs;function Ri(){return hs||(hs=1,process.env.NODE_ENV==="production"?nn.exports=Ii():nn.exports=Mi()),nn.exports}var Fe=Ri();function Li(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ai=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var n,s,o;if(Array.isArray(t)){if(n=t.length,n!=r.length)return!1;for(s=n;s--!==0;)if(!e(t[s],r[s]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(o=Object.keys(t),n=o.length,n!==Object.keys(r).length)return!1;for(s=n;s--!==0;)if(!Object.prototype.hasOwnProperty.call(r,o[s]))return!1;for(s=n;s--!==0;){var i=o[s];if(!e(t[i],r[i]))return!1}return!0}return t!==t&&r!==r};const Fi=Li(Ai),$i=()=>{throw new Error("useEvent should not be called before the component is mounted")},pr=e=>{const t=h.useRef($i);h.useInsertionEffect(()=>{t.current=e},[e]);const r=h.useRef(null);return r.current||(r.current=function(){var n;return(n=t.current)==null?void 0:n.apply(this,arguments)}),r.current},ps=e=>{const t=h.useRef();let r=!1;t.current!==void 0&&(r=!Fi(t.current,e));const n={changed:r,previousValue:t.current};return t.current=e,n},Yi=e=>typeof e=="function",Hi=e=>{const[t,r]=h.useState({value:e,initial:!0}),n=h.useRef(e);return[t,s=>{if(!Yi(s))r({value:s,initial:!1});else{const o=s(n.current);n.current=o,r({value:o,initial:!1})}}]},Wi=e=>{const[t,r]=Hi(e),n=h.useRef({value:e,initial:!0});return n.current!==t&&(n.current=t),[t,r,n]},ms=h.createContext(void 0),Ar=()=>h.useContext(ms),sn=({id:e,name:t,value:r,type:n,checked:s,readOnly:o,onChange:i})=>Fe.jsx("input",{id:e,name:t,value:r,type:n,checked:s,onChange:i,readOnly:o,disabled:o,className:"bsh:appearance-none! bsh:absolute! bsh:left-[-1000px]!"});function Vi(e){const t=Object.keys(e),r={};for(let n=0,s=t.length;n<s;n++){const o=t[n];if(o){const i=e[o],c=o.replace(/([A-Z])/g,u=>`-${u.toLowerCase()}`);typeof i=="boolean"?i&&(r[`data-${c}`]=!0):r[`data-${c}`]=e[o]}}return r}const mr=({wrapperElement:e,renderProps:t,elementProps:r,innerWrapperElement:n,className:s,children:o})=>{if(typeof o=="function")return n?Fe.jsxs(Fe.Fragment,{children:[n,o(t)]}):o(t);{const i=n?Fe.jsxs(Fe.Fragment,{children:[n,o]}):o;return h.createElement(e,Object.assign({},t?Vi(t):{},r,{className:s}),i)}};var Bi=Symbol.for("preact-signals");function on(){if(Lt>1)Lt--;else{for(var e,t=!1;gr!==void 0;){var r=gr;for(gr=void 0,an++;r!==void 0;){var n=r.o;if(r.o=void 0,r.f&=-3,!(8&r.f)&&ys(r))try{r.c()}catch(s){t||(e=s,t=!0)}r=n}}if(an=0,Lt--,t)throw e}}var be=void 0;function gs(e){var t=be;be=void 0;try{return e()}finally{be=t}}var gr=void 0,Lt=0,an=0,Fr=0;function bs(e){if(be!==void 0){var t=e.n;if(t===void 0||t.t!==be)return t={i:0,S:e,p:be.s,n:void 0,t:be,e:void 0,x:void 0,r:t},be.s!==void 0&&(be.s.n=t),be.s=t,e.n=t,32&be.f&&e.S(t),t;if(t.i===-1)return t.i=0,t.n!==void 0&&(t.n.p=t.p,t.p!==void 0&&(t.p.n=t.n),t.p=be.s,t.n=void 0,be.s.n=t,be.s=t),t}}function $e(e,t){this.v=e,this.i=0,this.n=void 0,this.t=void 0,this.W=t==null?void 0:t.watched,this.Z=t==null?void 0:t.unwatched}$e.prototype.brand=Bi,$e.prototype.h=function(){return!0},$e.prototype.S=function(e){var t=this,r=this.t;r!==e&&e.e===void 0&&(e.x=r,this.t=e,r!==void 0?r.e=e:gs(function(){var n;(n=t.W)==null||n.call(t)}))},$e.prototype.U=function(e){var t=this;if(this.t!==void 0){var r=e.e,n=e.x;r!==void 0&&(r.x=n,e.e=void 0),n!==void 0&&(n.e=r,e.x=void 0),e===this.t&&(this.t=n,n===void 0&&gs(function(){var s;(s=t.Z)==null||s.call(t)}))}},$e.prototype.subscribe=function(e){var t=this;return un(function(){var r=t.value,n=be;be=void 0;try{e(r)}finally{be=n}})},$e.prototype.valueOf=function(){return this.value},$e.prototype.toString=function(){return this.value+""},$e.prototype.toJSON=function(){return this.value},$e.prototype.peek=function(){var e=be;be=void 0;try{return this.value}finally{be=e}},Object.defineProperty($e.prototype,"value",{get:function(){var e=bs(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(an>100)throw new Error("Cycle detected");this.v=e,this.i++,Fr++,Lt++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{on()}}}});function Ui(e,t){return new $e(e,t)}function ys(e){for(var t=e.s;t!==void 0;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function vs(e){for(var t=e.s;t!==void 0;t=t.n){var r=t.S.n;if(r!==void 0&&(t.r=r),t.S.n=t,t.i=-1,t.n===void 0){e.s=t;break}}}function xs(e){for(var t=e.s,r=void 0;t!==void 0;){var n=t.p;t.i===-1?(t.S.U(t),n!==void 0&&(n.n=t.n),t.n!==void 0&&(t.n.p=n)):r=t,t.S.n=t.r,t.r!==void 0&&(t.r=void 0),t=n}e.s=r}function At(e,t){$e.call(this,void 0),this.x=e,this.s=void 0,this.g=Fr-1,this.f=4,this.W=t==null?void 0:t.watched,this.Z=t==null?void 0:t.unwatched}At.prototype=new $e,At.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===Fr))return!0;if(this.g=Fr,this.f|=1,this.i>0&&!ys(this))return this.f&=-2,!0;var e=be;try{vs(this),be=this;var t=this.x();(16&this.f||this.v!==t||this.i===0)&&(this.v=t,this.f&=-17,this.i++)}catch(r){this.v=r,this.f|=16,this.i++}return be=e,xs(this),this.f&=-2,!0},At.prototype.S=function(e){if(this.t===void 0){this.f|=36;for(var t=this.s;t!==void 0;t=t.n)t.S.S(t)}$e.prototype.S.call(this,e)},At.prototype.U=function(e){if(this.t!==void 0&&($e.prototype.U.call(this,e),this.t===void 0)){this.f&=-33;for(var t=this.s;t!==void 0;t=t.n)t.S.U(t)}},At.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var e=this.t;e!==void 0;e=e.x)e.t.N()}},Object.defineProperty(At.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var e=bs(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});function ws(e){var t=e.u;if(e.u=void 0,typeof t=="function"){Lt++;var r=be;be=void 0;try{t()}catch(n){throw e.f&=-2,e.f|=8,cn(e),n}finally{be=r,on()}}}function cn(e){for(var t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,ws(e)}function qi(e){if(be!==this)throw new Error("Out-of-order effect");xs(this),be=e,this.f&=-2,8&this.f&&cn(this),on()}function Ft(e){this.x=e,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32}Ft.prototype.c=function(){var e=this.S();try{if(8&this.f||this.x===void 0)return;var t=this.x();typeof t=="function"&&(this.u=t)}finally{e()}},Ft.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,ws(this),vs(this),Lt++;var e=be;return be=this,qi.bind(this,e)},Ft.prototype.N=function(){2&this.f||(this.f|=2,this.o=gr,gr=this)},Ft.prototype.d=function(){this.f|=8,1&this.f||cn(this)},Ft.prototype.dispose=function(){this.d()};function un(e){var t=new Ft(e);try{t.c()}catch(n){throw t.d(),n}var r=t.d.bind(t);return r[Symbol.dispose]=r,r}var ln={exports:{}},fn={};/**
64
- * @license React
65
- * use-sync-external-store-shim.production.js
66
- *
67
- * Copyright (c) Meta Platforms, Inc. and affiliates.
68
- *
69
- * This source code is licensed under the MIT license found in the
70
- * LICENSE file in the root directory of this source tree.
71
- */var Ss;function zi(){if(Ss)return fn;Ss=1;var e=h;function t(b,x){return b===x&&(b!==0||1/b===1/x)||b!==b&&x!==x}var r=typeof Object.is=="function"?Object.is:t,n=e.useState,s=e.useEffect,o=e.useLayoutEffect,i=e.useDebugValue;function c(b,x){var l=x(),f=n({inst:{value:l,getSnapshot:x}}),p=f[0].inst,w=f[1];return o(function(){p.value=l,p.getSnapshot=x,u(p)&&w({inst:p})},[b,l,x]),s(function(){return u(p)&&w({inst:p}),b(function(){u(p)&&w({inst:p})})},[b]),i(l),l}function u(b){var x=b.getSnapshot;b=b.value;try{var l=x();return!r(b,l)}catch{return!0}}function m(b,x){return x()}var d=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?m:c;return fn.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:d,fn}var Ps={};/**
72
- * @license React
73
- * use-sync-external-store-shim.development.js
74
- *
75
- * Copyright (c) Meta Platforms, Inc. and affiliates.
76
- *
77
- * This source code is licensed under the MIT license found in the
78
- * LICENSE file in the root directory of this source tree.
79
- */var Ts;function Ki(){return Ts||(Ts=1,process.env.NODE_ENV!=="production"&&function(){function e(l,f){return l===f&&(l!==0||1/l===1/f)||l!==l&&f!==f}function t(l,f){d||s.startTransition===void 0||(d=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var p=f();if(!b){var w=f();o(p,w)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),b=!0)}w=i({inst:{value:p,getSnapshot:f}});var v=w[0].inst,T=w[1];return u(function(){v.value=p,v.getSnapshot=f,r(v)&&T({inst:v})},[l,p,f]),c(function(){return r(v)&&T({inst:v}),l(function(){r(v)&&T({inst:v})})},[l]),m(p),p}function r(l){var f=l.getSnapshot;l=l.value;try{var p=f();return!o(l,p)}catch{return!0}}function n(l,f){return f()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var s=h,o=typeof Object.is=="function"?Object.is:e,i=s.useState,c=s.useEffect,u=s.useLayoutEffect,m=s.useDebugValue,d=!1,b=!1,x=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?n:t;Ps.useSyncExternalStore=s.useSyncExternalStore!==void 0?s.useSyncExternalStore:x,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),Ps}var Es;function Zi(){return Es||(Es=1,process.env.NODE_ENV==="production"?ln.exports=zi():ln.exports=Ki()),ln.exports}var Qi=Zi(),Gi=h.version.split(".").map(Number)[0],ks=[],Xi=Symbol.for(Gi>=19?"react.transitional.element":"react.element"),Pt,Cs=Symbol.dispose||Symbol.for("Symbol.dispose");function dn(e,t){var r=t.effect.S();return Pt=t,Ji.bind(t,e,r)}function Ji(e,t){t(),Pt=e}var Os,hn,Ds=function(){},ea=((Os={o:0,effect:{s:void 0,c:function(){},S:function(){return Ds},d:function(){}},subscribe:function(){return Ds},getSnapshot:function(){return 0},S:function(){},f:function(){}})[Cs]=function(){},Os),ta=Promise.prototype.then.bind(Promise.resolve());function ra(){hn||(hn=ta(na))}function na(){var e;hn=void 0,(e=Pt)==null||e.f()}function sa(e){ra();var t=h.useRef();t.current==null&&(typeof window>"u"?t.current=ea:t.current=function(n){var s,o,i,c,u=0,m=un(function(){o=this});return o.c=function(){u=u+1|0,c&&c()},(s={o:n,effect:o,subscribe:function(d){return c=d,function(){u=u+1|0,c=void 0,m()}},getSnapshot:function(){return u},S:function(){if(Pt!=null){var d=Pt.o,b=this.o;d==0&&b==0||d==0&&b==1?(Pt.f(),i=dn(void 0,this)):d==1&&b==0||d==2&&b==0||(i=dn(Pt,this))}else i=dn(void 0,this)},f:function(){var d=i;i=void 0,d==null||d()}})[Cs]=function(){this.f()},s}(e));var r=t.current;return Qi.useSyncExternalStore(r.subscribe,r.getSnapshot,r.getSnapshot),r.S(),r}Object.defineProperties($e.prototype,{$$typeof:{configurable:!0,value:Xi},type:{configurable:!0,value:function(e){var t=e.data,r=sa(1);try{return t.value}finally{r.f()}}},props:{configurable:!0,get:function(){return{data:this}}},ref:{configurable:!0,value:null}});function ft(e,t){return h.useMemo(function(){return Ui(e,t)},ks)}function $t(e){var t=h.useRef(e);t.current=e,h.useEffect(function(){return un(function(){return t.current()})},ks)}const _s=h.createContext(void 0),Ns=()=>h.useContext(_s),oa=(e,t)=>{const{name:r,value:n,checked:s=!1,partial:o=!1,readOnly:i=!1,onChange:c,children:u,className:m}=e,[d,b]=h.useState(r),[x,l]=h.useState(i),f=h.useRef(),p=h.useRef(),w=h.useRef(),v=h.useRef(),T=h.useRef(),L=h.useRef(),I=Ns(),E=Ar(),Q=h.useId(),M=h.useMemo(()=>(E==null?void 0:E.sharedId)||e.id||Q,[E==null?void 0:E.sharedId,e.id,Q]),[$,F,se]=Wi({checked:!1,partial:!1}),ae=ps(s),U=ps(o);h.useEffect(()=>{if($.initial)F({checked:o?!1:s,partial:o});else{const W=ae.changed?s:$.value.checked,ie=U.changed?o:$.value.partial;F({checked:ie?!1:W,partial:ie})}},[s,o]),h.useEffect(()=>{l(i)},[i]),h.useEffect(()=>{I&&(f.current=I.nameSignal,p.current=I.valueSignal,w.current=I.readOnlySignal,v.current=I.useComparator,T.current=I.compare,L.current=I.onCheckboxChange)},[I]),$t(()=>{var W,ie,Z;if(p.current)if((W=v.current)!=null&&W.value&&T.current){const k=T.current,N=((ie=p.current.value)==null?void 0:ie.some(D=>k(n,D)))??!1;F(D=>({...D,checked:N}))}else{const k=((Z=p.current.value)==null?void 0:Z.some(N=>n===N))??!1;F(N=>({...N,checked:k}))}}),$t(()=>{f.current&&b(f.current.value)}),$t(()=>{w.current&&l(w.current.value??!1)});const R=pr(W=>{var ie;const Z=((ie=se.current)==null?void 0:ie.value.partial)===!0?!0:W.target.checked;F({checked:Z,partial:!1}),L.current?L.current({originalEvent:W,name:d,value:n,checked:Z}):c==null||c({originalEvent:W,name:d,value:n,checked:Z})}),A=W=>{var ie;const Z={checked:W?!1:((ie=se.current)==null?void 0:ie.value.checked)??!1,partial:W};F(Z)},j=W=>{F({checked:W,partial:!1})};h.useImperativeHandle(t,()=>({setPartiallyChecked:A,setChecked:j}));const q=d&&Fe.jsx(sn,{id:M,name:d,type:"checkbox",checked:$.value.checked,readOnly:x,onChange:R});return mr({wrapperElement:"label",renderProps:{...$.value,readOnly:x},elementProps:{htmlFor:M},className:m,innerWrapperElement:q,children:u})},js=h.memo(h.forwardRef(oa)),ia=(e,t)=>e&&t&&typeof e=="object"&&typeof t=="object"&&"value"in e&&"value"in t?e.value===t.value:e===t,Is=(e=ia)=>pr((t,r)=>{if(typeof e=="string"){const n=e;return(t==null?void 0:t[n])===(r==null?void 0:r[n])}return e(t,r)}),Ms=({props:e,children:t})=>Fe.jsx(_s.Provider,{value:e,children:t}),aa=({name:e,value:t,comparator:r,readOnly:n=!1,onChange:s,className:o,children:i})=>{const c=ft(),u=ft(),m=ft(),d=ft(),b=Is(r),x=pr(f=>{if(f){const{checked:p}=f,w=f.value;if(u.value)if(r)if(p)u.value.findIndex(v=>b(w,v))===-1&&u.value.push(w);else{const v=u.value.filter(T=>!b(w,T));u.value=[...v]}else if(p)u.value.indexOf(w)===-1&&u.value.push(w);else{const v=u.value.filter(T=>T!==w);u.value=[...v]}else p&&(u.value=[w])}s==null||s({originalEvent:f==null?void 0:f.originalEvent,name:e,value:u.value})}),l=h.useMemo(()=>({nameSignal:c,valueSignal:u,readOnlySignal:m,useComparator:d,compare:b,onCheckboxChange:x}),[]);return h.useEffect(()=>{c.value=e},[e]),h.useEffect(()=>{u.value=t},[t]),h.useEffect(()=>{m.value=n},[n]),h.useEffect(()=>{d.value=r!==void 0},[r]),Fe.jsx("div",{className:o,children:Fe.jsx(Ms,{props:l,children:i})})},Rs=h.memo(aa),Yt=({className:e,children:t})=>{const r=h.useId(),n=h.useMemo(()=>({sharedId:r}),[r]),s=Fe.jsx(ms.Provider,{value:n,children:t});return mr({wrapperElement:"div",className:e,children:s})},ca=({htmlFor:e,className:t,children:r})=>{const n=Ar(),s=h.useMemo(()=>(n==null?void 0:n.sharedId)||e,[n==null?void 0:n.sharedId,e]);return mr({wrapperElement:"label",elementProps:{htmlFor:s},className:t,children:r})};var Ls={exports:{}};/*!
80
- Copyright (c) 2018 Jed Watson.
81
- Licensed under the MIT License (MIT), see
82
- http://jedwatson.github.io/classnames
83
- */var As;function ua(){return As||(As=1,function(e){(function(){var t={}.hasOwnProperty;function r(){for(var o="",i=0;i<arguments.length;i++){var c=arguments[i];c&&(o=s(o,n(c)))}return o}function n(o){if(typeof o=="string"||typeof o=="number")return o;if(typeof o!="object")return"";if(Array.isArray(o))return r.apply(null,o);if(o.toString!==Object.prototype.toString&&!o.toString.toString().includes("[native code]"))return o.toString();var i="";for(var c in o)t.call(o,c)&&o[c]&&(i=s(i,c));return i}function s(o,i){return i?o?o+" "+i:o+i:o}e.exports?(r.default=r,e.exports=r):window.classNames=r})()}(Ls)),Ls.exports}ua();const la=({intersectionObserver:e,resizeObserver:t,page:r,height:n,children:s})=>{const o=h.useRef();h.useEffect(()=>()=>{o.current&&(e==null||e.unobserve(o.current),t==null||t.unobserve(o.current))},[]),h.useEffect(()=>(o.current&&(e==null||e.observe(o.current)),()=>{o.current&&e&&e.unobserve(o.current)}),[e]);const i=u=>{o.current&&(e==null||e.unobserve(o.current),t==null||t.unobserve(o.current)),e==null||e.observe(u),t==null||t.observe(u),o.current=u},c=n?{height:`${n}px`}:{};return Fe.jsx("div",{"data-page":r,"data-name":"page",style:c,ref:u=>u&&i(u),children:s})};h.memo(la);const fa=({intersectionObserver:e,page:t})=>{const r=h.useRef();h.useEffect(()=>()=>{r.current&&(e==null||e.unobserve(r.current))},[]);const n=s=>{r.current&&(e==null||e.unobserve(r.current)),e==null||e.observe(s),r.current=s};return Fe.jsx("div",{"data-page":t,"data-name":"marker",ref:s=>s&&n(s)})};h.memo(fa);const da=({name:e,value:t,comparator:r,readOnly:n=!1,onChange:s,className:o,children:i})=>{const c=ft(),u=ft(),m=ft(),d=ft(),b=Is(r),x=h.useMemo(()=>({nameSignal:c,valueSignal:u,readOnlySignal:m,useComparator:d,compare:b}),[]);h.useEffect(()=>{c.value=e},[e]),h.useEffect(()=>{u.value=t},[t]),h.useEffect(()=>{m.value=n},[n]),h.useEffect(()=>{d.value=r!==void 0},[r]);const l=pr(f=>{s==null||s({originalEvent:f,name:e,value:u.value})});return Fe.jsx("div",{className:o,onChange:l,children:Fe.jsx(Ms,{props:x,children:i})})},Fs=h.memo(da),ha=({value:e,className:t,children:r})=>{const[n,s]=h.useState(),[o,i]=h.useState(!1),[c,u]=h.useState(!1),m=h.useRef(),d=h.useRef(),b=h.useRef(),x=h.useRef(),l=h.useRef(),f=Ns(),p=Ar(),w=h.useId(),v=h.useMemo(()=>(p==null?void 0:p.sharedId)||w,[p==null?void 0:p.sharedId,w]);h.useEffect(()=>{f&&(m.current=f.nameSignal,d.current=f.valueSignal,b.current=f.readOnlySignal,x.current=f.useComparator,l.current=f.compare)},[f]),$t(()=>{var L;x&&d.current&&l.current?i(l.current(e,d.current.value)):i(e===((L=d.current)==null?void 0:L.value))}),$t(()=>{var L;s((L=m.current)==null?void 0:L.value)}),$t(()=>{var L;u(((L=b.current)==null?void 0:L.value)??!1)});const T=pr(L=>{L.target.checked&&d.current&&(d.current.value=e)});return mr({wrapperElement:"label",renderProps:{checked:o,readOnly:c},elementProps:{htmlFor:v},className:t,innerWrapperElement:n?Fe.jsx(sn,{id:v,name:n,type:"radio",value:e,checked:o,readOnly:c,onChange:T}):null,children:r})},$s=h.memo(ha),pa=(e,t)=>{const{id:r,name:n,value:s,toggled:o=!1,readOnly:i,onChange:c,children:u,className:m}=e,[d,b]=h.useState(o),x=Ar(),l=h.useId(),f=h.useMemo(()=>(x==null?void 0:x.sharedId)||r||l,[x==null?void 0:x.sharedId,r,l]);h.useEffect(()=>{b(o)},[o]);const p=v=>{b(v.target.checked),c==null||c({originalEvent:v,name:n,value:s,checked:v.target.checked})},w=v=>{b(v)};return h.useImperativeHandle(t,()=>({setToggled:w})),mr({wrapperElement:"label",renderProps:{toggled:d,readOnly:i},elementProps:{htmlFor:f},className:m,innerWrapperElement:Fe.jsx(sn,{id:f,name:n,type:"checkbox",checked:d,readOnly:i,onChange:p}),children:u})},ma=h.memo(h.forwardRef(pa)),pn=e=>{const[t,r]=h.useState(!0),n=us();return h.useEffect(()=>{n&&n.useAnimations!==void 0?r(n.useAnimations):e!==void 0&&r(e)},[n,e]),t},at=({label:e,htmlFor:t,readOnly:r=!1,className:n})=>{const s=he("bc-label",{"bsc:text-black bsc:dark:text-mono-light-1":!r,"bc-read-only bsc:text-gray-4 bsc:dark:text-mono-light-3 bsc:pointer-events-none":r},n);return y.jsx(ca,{htmlFor:t,className:s,children:e})},ga=(e,t)=>{const{name:r,label:n,value:s,readOnly:o=!1,checked:i=!1,partial:c=!1,labelLocation:u=qe.Right,className:m,useAnimation:d,onChange:b}=e,x=pn(d),l=he("bc-checkbox-wrapper bsc:flex bsc:items-center bsc:group/wrapper bsc:*:cursor-pointer bsc:has-data-read-only:text-gray-4 bsc:dark:has-data-read-only:text-mono-light-3 bsc:has-data-read-only:pointer-events-none",m),f=he("bc-checkbox-label bsc:peer-data-read-only:text-gray-4 bsc:dark:peer-data-read-only:text-mono-light-3",{"bsc:ml-2":u===qe.Right,"bsc:mr-2":u===qe.Left}),p=dr(Rt.FocusWithin),w=he("bc-checkbox-outer bsc:group/checkbox bsc:peer bsc:rounded bsc:*:block bsc:*:size-[21px]","bsc:inset-shadow-[0_0_0_1px] bsc:inset-shadow-gray-2 bsc:dark:inset-shadow-[0_0_0_1px] bsc:dark:inset-shadow-mono-light-2","bsc:group-hover/wrapper:not-data-checked:inset-shadow-[0_0_0_2px] bsc:group-hover/wrapper:not-data-checked:inset-shadow-gray-4","bsc:dark:group-hover/wrapper:not-data-checked:inset-shadow-[0_0_0_2px] bsc:[transition:box-shadow_0.3s]",p),v=he("bc-checkbox-svg bsc:rounded bsc:stroke-mono-light-1 bsc:stroke-2 bsc:[stroke-linecap:round]","bsc:[stroke-linejoin:round] bsc:dark:stroke-mono-dark-3 bsc:[transform:scale(0)]","bsc:group-data-checked/checkbox:group-data-read-only/checkbox:bg-primary-4 bsc:group-data-checked/checkbox:group-data-read-only/checkbox:fill-primary-4 bsc:group-data-partial/checkbox:group-data-read-only/checkbox:bg-primary-4 bsc:group-data-partial/checkbox:group-data-read-only/checkbox:fill-primary-4 bsc:dark:group-data-checked/checkbox:group-data-read-only/checkbox:bg-mono-light-3 bsc:dark:group-data-checked/checkbox:group-data-read-only/checkbox:fill-mono-light-3 bsc:dark:group-data-partial/checkbox:group-data-read-only/checkbox:bg-mono-light-3 bsc:dark:group-data-partial/checkbox:group-data-read-only/checkbox:fill-mono-light-3","bsc:group-data-checked/checkbox:group-not-data-read-only/checkbox:bg-primary-1 bsc:group-data-checked/checkbox:group-not-data-read-only/checkbox:fill-primary-1 bsc:group-data-partial/checkbox:bg-primary-1 bsc:group-data-partial/checkbox:fill-primary-1 bsc:dark:group-data-checked/checkbox:bg-mono-light-1 bsc:dark:group-data-checked/checkbox:fill-mono-light-1 bsc:dark:group-data-partial/checkbox:bg-mono-light-1 bsc:dark:group-data-partial/checkbox:fill-mono-light-1",{"bsc:group-data-checked/checkbox:group-not-data-read-only/checkbox:animate-bounce bsc:group-data-partial/checkbox:group-not-data-read-only/checkbox:animate-bounce bsc:group-data-checked/checkbox:group-data-read-only/checkbox:[transform:scale(1)] bsc:group-data-partial/checkbox:group-data-read-only/checkbox:[transform:scale(1)]":x,"bsc:group-data-checked/checkbox:[transform:scale(1)] bsc:group-data-partial/checkbox:[transform:scale(1)]":!x});return y.jsxs(Yt,{className:l,children:[n&&u===qe.Left&&y.jsx(at,{label:n,readOnly:o,className:f}),y.jsx(js,{ref:t,name:r,value:s,checked:i,partial:c,readOnly:o,className:w,onChange:b,children:y.jsxs("svg",{viewBox:"0 0 21 21",className:v,children:[y.jsx("polyline",{className:"bsc:[visibility:hidden] bsc:group-data-checked/checkbox:visible",points:"5 10.75 8.5 14.25 16 6"}),y.jsx("polyline",{className:"bsc:[visibility:hidden] bsc:group-data-partial/checkbox:visible",points:"6 10.5 16 10.5"})]})}),n&&u===qe.Right&&y.jsx(at,{label:n,readOnly:o,className:f})]})},Ys=h.memo(h.forwardRef(ga)),$r=e=>e==null?!1:typeof e=="object",Hs=e=>e instanceof Date,Ws=e=>typeof e=="function",Vs=e=>{const t=typeof e;return t==="string"||t==="number"||t==="boolean"||t==="bigint"},mn=e=>{if(!$r(e))return e;const t={},r=Object.keys(e);for(let n=0,s=r.length;n<s;n++){const o=r[n],i=e[o];Vs(i)||Ws(i)?t[o]=i:Hs(i)?t[o]=new Date(i.getTime()):Array.isArray(i)?t[o]=gn(i):$r(i)&&(t[o]=mn(i))}return t},gn=e=>{let t=e.length;const r=new Array(t);for(;t--!==0;){const n=e[t];Vs(n)||Ws(n)?r[t]=n:Hs(n)?r[t]=new Date(n.getTime()):$r(n)&&!Array.isArray(n)?r[t]=mn(n):Array.isArray(n)?r[t]=gn(n):r[t]=n}return r},ba=e=>$r(e)?Array.isArray(e)?gn(e):mn(e):e;function ya(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var va=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var n,s,o;if(Array.isArray(t)){if(n=t.length,n!=r.length)return!1;for(s=n;s--!==0;)if(!e(t[s],r[s]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(o=Object.keys(t),n=o.length,n!==Object.keys(r).length)return!1;for(s=n;s--!==0;)if(!Object.prototype.hasOwnProperty.call(r,o[s]))return!1;for(s=n;s--!==0;){var i=o[s];if(!e(t[i],r[i]))return!1}return!0}return t!==t&&r!==r};const xa=ya(va);function wa(e,t){for(let r=e.length;r--!==0;)if(!xa(e[r],t[r]))return!0;return!1}const bn=(e,t)=>{const r=h.useRef([]),n=r.current.length>0&&r.current[0]&&wa(r.current[0],t);return(r.current.length===0||n)&&(r.current=[ba(t),e()]),r.current[1]},Sa=e=>{const[t,r]=h.useState(e),n=h.useRef(e);return n.current!==t&&(n.current=t),[t,r,n]},Pa=({name:e,label:t,value:r,data:n,textField:s,valueField:o,readOnly:i=!1,orientation:c=Ae.Vertical,className:u,onChange:m})=>{const[d,b]=h.useState([]),x=bn(()=>n,[n]);h.useEffect(()=>{b(r??[])},[r]);const l=T=>{if(T){const{value:L}=T;b(L??[]),m==null||m({name:e,value:L})}},f=(T,L)=>y.jsx(Ys,{label:T[s],value:T[o],className:"bsc:mr-3"},`${e}_checkbox_${L}`),p=he("bsc:flex bsc:flex-col bsc:gap-1",u),w=he("bsc:flex bsc:gap-1",{"bsc:flex-col":c===Ae.Vertical}),v=T=>y.jsx(Rs,{name:e,value:d,readOnly:i,onChange:l,className:w,children:T.map(f)});return y.jsxs("div",{className:p,children:[t&&y.jsx(at,{label:t,readOnly:i}),x&&v(x)]})},Ta=h.memo(Pa);var Bs=typeof global=="object"&&global&&global.Object===Object&&global,Ea=typeof self=="object"&&self&&self.Object===Object&&self,Ze=Bs||Ea||Function("return this")(),Ht=Ze.Symbol,Us=Object.prototype,ka=Us.hasOwnProperty,Ca=Us.toString,br=Ht?Ht.toStringTag:void 0;function Oa(e){var t=ka.call(e,br),r=e[br];try{e[br]=void 0;var n=!0}catch{}var s=Ca.call(e);return n&&(t?e[br]=r:delete e[br]),s}var Da=Object.prototype,_a=Da.toString;function Na(e){return _a.call(e)}var ja="[object Null]",Ia="[object Undefined]",qs=Ht?Ht.toStringTag:void 0;function Wt(e){return e==null?e===void 0?Ia:ja:qs&&qs in Object(e)?Oa(e):Na(e)}function Vt(e){return e!=null&&typeof e=="object"}var Ma="[object Symbol]";function Ra(e){return typeof e=="symbol"||Vt(e)&&Wt(e)==Ma}var yn=Array.isArray,La=/\s/;function Aa(e){for(var t=e.length;t--&&La.test(e.charAt(t)););return t}var Fa=/^\s+/;function $a(e){return e&&e.slice(0,Aa(e)+1).replace(Fa,"")}function dt(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var zs=NaN,Ya=/^[-+]0x[0-9a-f]+$/i,Ha=/^0b[01]+$/i,Wa=/^0o[0-7]+$/i,Va=parseInt;function Ks(e){if(typeof e=="number")return e;if(Ra(e))return zs;if(dt(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=dt(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=$a(e);var r=Ha.test(e);return r||Wa.test(e)?Va(e.slice(2),r?2:8):Ya.test(e)?zs:+e}var Ba="[object AsyncFunction]",Ua="[object Function]",qa="[object GeneratorFunction]",za="[object Proxy]";function Zs(e){if(!dt(e))return!1;var t=Wt(e);return t==Ua||t==qa||t==Ba||t==za}var vn=Ze["__core-js_shared__"],Qs=function(){var e=/[^.]+$/.exec(vn&&vn.keys&&vn.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function Ka(e){return!!Qs&&Qs in e}var Za=Function.prototype,Qa=Za.toString;function Tt(e){if(e!=null){try{return Qa.call(e)}catch{}try{return e+""}catch{}}return""}var Ga=/[\\^$.*+?()[\]{}|]/g,Xa=/^\[object .+?Constructor\]$/,Ja=Function.prototype,ec=Object.prototype,tc=Ja.toString,rc=ec.hasOwnProperty,nc=RegExp("^"+tc.call(rc).replace(Ga,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function sc(e){if(!dt(e)||Ka(e))return!1;var t=Zs(e)?nc:Xa;return t.test(Tt(e))}function oc(e,t){return e==null?void 0:e[t]}function Et(e,t){var r=oc(e,t);return sc(r)?r:void 0}var xn=Et(Ze,"WeakMap"),Gs=Object.create,ic=function(){function e(){}return function(t){if(!dt(t))return{};if(Gs)return Gs(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}(),Xs=function(){try{var e=Et(Object,"defineProperty");return e({},"",{}),e}catch{}}();function ac(e,t){for(var r=-1,n=e==null?0:e.length;++r<n&&t(e[r],r,e)!==!1;);return e}var cc=9007199254740991,uc=/^(?:0|[1-9]\d*)$/;function lc(e,t){var r=typeof e;return t=t??cc,!!t&&(r=="number"||r!="symbol"&&uc.test(e))&&e>-1&&e%1==0&&e<t}function fc(e,t,r){t=="__proto__"&&Xs?Xs(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}function Js(e,t){return e===t||e!==e&&t!==t}var dc=Object.prototype,hc=dc.hasOwnProperty;function pc(e,t,r){var n=e[t];(!(hc.call(e,t)&&Js(n,r))||r===void 0&&!(t in e))&&fc(e,t,r)}var mc=9007199254740991;function eo(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=mc}function gc(e){return e!=null&&eo(e.length)&&!Zs(e)}var bc=Object.prototype;function to(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||bc;return e===r}function yc(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}var vc="[object Arguments]";function ro(e){return Vt(e)&&Wt(e)==vc}var no=Object.prototype,xc=no.hasOwnProperty,wc=no.propertyIsEnumerable,Sc=ro(function(){return arguments}())?ro:function(e){return Vt(e)&&xc.call(e,"callee")&&!wc.call(e,"callee")};function Pc(){return!1}var so=typeof oe=="object"&&oe&&!oe.nodeType&&oe,oo=so&&typeof module=="object"&&module&&!module.nodeType&&module,Tc=oo&&oo.exports===so,io=Tc?Ze.Buffer:void 0,Ec=io?io.isBuffer:void 0,ao=Ec||Pc,kc="[object Arguments]",Cc="[object Array]",Oc="[object Boolean]",Dc="[object Date]",_c="[object Error]",Nc="[object Function]",jc="[object Map]",Ic="[object Number]",Mc="[object Object]",Rc="[object RegExp]",Lc="[object Set]",Ac="[object String]",Fc="[object WeakMap]",$c="[object ArrayBuffer]",Yc="[object DataView]",Hc="[object Float32Array]",Wc="[object Float64Array]",Vc="[object Int8Array]",Bc="[object Int16Array]",Uc="[object Int32Array]",qc="[object Uint8Array]",zc="[object Uint8ClampedArray]",Kc="[object Uint16Array]",Zc="[object Uint32Array]",Te={};Te[Hc]=Te[Wc]=Te[Vc]=Te[Bc]=Te[Uc]=Te[qc]=Te[zc]=Te[Kc]=Te[Zc]=!0,Te[kc]=Te[Cc]=Te[$c]=Te[Oc]=Te[Yc]=Te[Dc]=Te[_c]=Te[Nc]=Te[jc]=Te[Ic]=Te[Mc]=Te[Rc]=Te[Lc]=Te[Ac]=Te[Fc]=!1;function Qc(e){return Vt(e)&&eo(e.length)&&!!Te[Wt(e)]}function wn(e){return function(t){return e(t)}}var co=typeof oe=="object"&&oe&&!oe.nodeType&&oe,yr=co&&typeof module=="object"&&module&&!module.nodeType&&module,Gc=yr&&yr.exports===co,Sn=Gc&&Bs.process,Bt=function(){try{var e=yr&&yr.require&&yr.require("util").types;return e||Sn&&Sn.binding&&Sn.binding("util")}catch{}}(),uo=Bt&&Bt.isTypedArray,Xc=uo?wn(uo):Qc,Jc=Object.prototype,eu=Jc.hasOwnProperty;function tu(e,t){var r=yn(e),n=!r&&Sc(e),s=!r&&!n&&ao(e),o=!r&&!n&&!s&&Xc(e),i=r||n||s||o,c=i?yc(e.length,String):[],u=c.length;for(var m in e)eu.call(e,m)&&!(i&&(m=="length"||s&&(m=="offset"||m=="parent")||o&&(m=="buffer"||m=="byteLength"||m=="byteOffset")||lc(m,u)))&&c.push(m);return c}function lo(e,t){return function(r){return e(t(r))}}var ru=lo(Object.keys,Object),nu=Object.prototype,su=nu.hasOwnProperty;function ou(e){if(!to(e))return ru(e);var t=[];for(var r in Object(e))su.call(e,r)&&r!="constructor"&&t.push(r);return t}function iu(e){return gc(e)?tu(e):ou(e)}var vr=Et(Object,"create");function au(){this.__data__=vr?vr(null):{},this.size=0}function cu(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var uu="__lodash_hash_undefined__",lu=Object.prototype,fu=lu.hasOwnProperty;function du(e){var t=this.__data__;if(vr){var r=t[e];return r===uu?void 0:r}return fu.call(t,e)?t[e]:void 0}var hu=Object.prototype,pu=hu.hasOwnProperty;function mu(e){var t=this.__data__;return vr?t[e]!==void 0:pu.call(t,e)}var gu="__lodash_hash_undefined__";function bu(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=vr&&t===void 0?gu:t,this}function kt(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}kt.prototype.clear=au,kt.prototype.delete=cu,kt.prototype.get=du,kt.prototype.has=mu,kt.prototype.set=bu;function yu(){this.__data__=[],this.size=0}function Yr(e,t){for(var r=e.length;r--;)if(Js(e[r][0],t))return r;return-1}var vu=Array.prototype,xu=vu.splice;function wu(e){var t=this.__data__,r=Yr(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():xu.call(t,r,1),--this.size,!0}function Su(e){var t=this.__data__,r=Yr(t,e);return r<0?void 0:t[r][1]}function Pu(e){return Yr(this.__data__,e)>-1}function Tu(e,t){var r=this.__data__,n=Yr(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}function ct(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}ct.prototype.clear=yu,ct.prototype.delete=wu,ct.prototype.get=Su,ct.prototype.has=Pu,ct.prototype.set=Tu;var xr=Et(Ze,"Map");function Eu(){this.size=0,this.__data__={hash:new kt,map:new(xr||ct),string:new kt}}function ku(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function Hr(e,t){var r=e.__data__;return ku(t)?r[typeof t=="string"?"string":"hash"]:r.map}function Cu(e){var t=Hr(this,e).delete(e);return this.size-=t?1:0,t}function Ou(e){return Hr(this,e).get(e)}function Du(e){return Hr(this,e).has(e)}function _u(e,t){var r=Hr(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}function Ut(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Ut.prototype.clear=Eu,Ut.prototype.delete=Cu,Ut.prototype.get=Ou,Ut.prototype.has=Du,Ut.prototype.set=_u;function Nu(e,t){for(var r=-1,n=t.length,s=e.length;++r<n;)e[s+r]=t[r];return e}var ju=lo(Object.getPrototypeOf,Object);function Iu(){this.__data__=new ct,this.size=0}function Mu(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}function Ru(e){return this.__data__.get(e)}function Lu(e){return this.__data__.has(e)}var Au=200;function Fu(e,t){var r=this.__data__;if(r instanceof ct){var n=r.__data__;if(!xr||n.length<Au-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new Ut(n)}return r.set(e,t),this.size=r.size,this}function qt(e){var t=this.__data__=new ct(e);this.size=t.size}qt.prototype.clear=Iu,qt.prototype.delete=Mu,qt.prototype.get=Ru,qt.prototype.has=Lu,qt.prototype.set=Fu;var fo=typeof oe=="object"&&oe&&!oe.nodeType&&oe,ho=fo&&typeof module=="object"&&module&&!module.nodeType&&module,$u=ho&&ho.exports===fo,po=$u?Ze.Buffer:void 0;po&&po.allocUnsafe;function Yu(e,t){return e.slice()}function Hu(e,t){for(var r=-1,n=e==null?0:e.length,s=0,o=[];++r<n;){var i=e[r];t(i,r,e)&&(o[s++]=i)}return o}function Wu(){return[]}var Vu=Object.prototype,Bu=Vu.propertyIsEnumerable,mo=Object.getOwnPropertySymbols,Uu=mo?function(e){return e==null?[]:(e=Object(e),Hu(mo(e),function(t){return Bu.call(e,t)}))}:Wu;function qu(e,t,r){var n=t(e);return yn(e)?n:Nu(n,r(e))}function zu(e){return qu(e,iu,Uu)}var Pn=Et(Ze,"DataView"),Tn=Et(Ze,"Promise"),En=Et(Ze,"Set"),go="[object Map]",Ku="[object Object]",bo="[object Promise]",yo="[object Set]",vo="[object WeakMap]",xo="[object DataView]",Zu=Tt(Pn),Qu=Tt(xr),Gu=Tt(Tn),Xu=Tt(En),Ju=Tt(xn),ut=Wt;(Pn&&ut(new Pn(new ArrayBuffer(1)))!=xo||xr&&ut(new xr)!=go||Tn&&ut(Tn.resolve())!=bo||En&&ut(new En)!=yo||xn&&ut(new xn)!=vo)&&(ut=function(e){var t=Wt(e),r=t==Ku?e.constructor:void 0,n=r?Tt(r):"";if(n)switch(n){case Zu:return xo;case Qu:return go;case Gu:return bo;case Xu:return yo;case Ju:return vo}return t});var el=Object.prototype,tl=el.hasOwnProperty;function rl(e){var t=e.length,r=new e.constructor(t);return t&&typeof e[0]=="string"&&tl.call(e,"index")&&(r.index=e.index,r.input=e.input),r}var wo=Ze.Uint8Array;function kn(e){var t=new e.constructor(e.byteLength);return new wo(t).set(new wo(e)),t}function nl(e,t){var r=kn(e.buffer);return new e.constructor(r,e.byteOffset,e.byteLength)}var sl=/\w*$/;function ol(e){var t=new e.constructor(e.source,sl.exec(e));return t.lastIndex=e.lastIndex,t}var So=Ht?Ht.prototype:void 0,Po=So?So.valueOf:void 0;function il(e){return Po?Object(Po.call(e)):{}}function al(e,t){var r=kn(e.buffer);return new e.constructor(r,e.byteOffset,e.length)}var cl="[object Boolean]",ul="[object Date]",ll="[object Map]",fl="[object Number]",dl="[object RegExp]",hl="[object Set]",pl="[object String]",ml="[object Symbol]",gl="[object ArrayBuffer]",bl="[object DataView]",yl="[object Float32Array]",vl="[object Float64Array]",xl="[object Int8Array]",wl="[object Int16Array]",Sl="[object Int32Array]",Pl="[object Uint8Array]",Tl="[object Uint8ClampedArray]",El="[object Uint16Array]",kl="[object Uint32Array]";function Cl(e,t,r){var n=e.constructor;switch(t){case gl:return kn(e);case cl:case ul:return new n(+e);case bl:return nl(e);case yl:case vl:case xl:case wl:case Sl:case Pl:case Tl:case El:case kl:return al(e);case ll:return new n;case fl:case pl:return new n(e);case dl:return ol(e);case hl:return new n;case ml:return il(e)}}function Ol(e){return typeof e.constructor=="function"&&!to(e)?ic(ju(e)):{}}var Dl="[object Map]";function _l(e){return Vt(e)&&ut(e)==Dl}var To=Bt&&Bt.isMap,Nl=To?wn(To):_l,jl="[object Set]";function Il(e){return Vt(e)&&ut(e)==jl}var Eo=Bt&&Bt.isSet,Ml=Eo?wn(Eo):Il,ko="[object Arguments]",Rl="[object Array]",Ll="[object Boolean]",Al="[object Date]",Fl="[object Error]",Co="[object Function]",$l="[object GeneratorFunction]",Yl="[object Map]",Hl="[object Number]",Oo="[object Object]",Wl="[object RegExp]",Vl="[object Set]",Bl="[object String]",Ul="[object Symbol]",ql="[object WeakMap]",zl="[object ArrayBuffer]",Kl="[object DataView]",Zl="[object Float32Array]",Ql="[object Float64Array]",Gl="[object Int8Array]",Xl="[object Int16Array]",Jl="[object Int32Array]",ef="[object Uint8Array]",tf="[object Uint8ClampedArray]",rf="[object Uint16Array]",nf="[object Uint32Array]",Se={};Se[ko]=Se[Rl]=Se[zl]=Se[Kl]=Se[Ll]=Se[Al]=Se[Zl]=Se[Ql]=Se[Gl]=Se[Xl]=Se[Jl]=Se[Yl]=Se[Hl]=Se[Oo]=Se[Wl]=Se[Vl]=Se[Bl]=Se[Ul]=Se[ef]=Se[tf]=Se[rf]=Se[nf]=!0,Se[Fl]=Se[Co]=Se[ql]=!1;function Wr(e,t,r,n,s,o){var i;if(i!==void 0)return i;if(!dt(e))return e;var c=yn(e);if(c)i=rl(e);else{var u=ut(e),m=u==Co||u==$l;if(ao(e))return Yu(e);if(u==Oo||u==ko||m&&!s)i=m?{}:Ol(e);else{if(!Se[u])return s?e:{};i=Cl(e,u)}}o||(o=new qt);var d=o.get(e);if(d)return d;o.set(e,i),Ml(e)?e.forEach(function(l){i.add(Wr(l,t,r,l,e,o))}):Nl(e)&&e.forEach(function(l,f){i.set(f,Wr(l,t,r,f,e,o))});var b=zu,x=c?void 0:b(e);return ac(x||e,function(l,f){x&&(f=l,l=e[f]),pc(i,f,Wr(l,t,r,f,e,o))}),i}var sf=1,of=4;function af(e){return Wr(e,sf|of)}var Cn=function(){return Ze.Date.now()},cf="Expected a function",uf=Math.max,lf=Math.min;function wr(e,t,r){var n,s,o,i,c,u,m=0,d=!1,b=!1,x=!0;if(typeof e!="function")throw new TypeError(cf);t=Ks(t)||0,dt(r)&&(d=!!r.leading,b="maxWait"in r,o=b?uf(Ks(r.maxWait)||0,t):o,x="trailing"in r?!!r.trailing:x);function l(Q){var M=n,$=s;return n=s=void 0,m=Q,i=e.apply($,M),i}function f(Q){return m=Q,c=setTimeout(v,t),d?l(Q):i}function p(Q){var M=Q-u,$=Q-m,F=t-M;return b?lf(F,o-$):F}function w(Q){var M=Q-u,$=Q-m;return u===void 0||M>=t||M<0||b&&$>=o}function v(){var Q=Cn();if(w(Q))return T(Q);c=setTimeout(v,p(Q))}function T(Q){return c=void 0,x&&n?l(Q):(n=s=void 0,i)}function L(){c!==void 0&&clearTimeout(c),m=0,n=u=s=c=void 0}function I(){return c===void 0?i:T(Cn())}function E(){var Q=Cn(),M=w(Q);if(n=arguments,s=this,u=Q,M){if(c===void 0)return f(u);if(b)return clearTimeout(c),c=setTimeout(v,t),l(u)}return c===void 0&&(c=setTimeout(v,t)),i}return E.cancel=L,E.flush=I,E}var ff="Expected a function";function df(e,t,r){var n=!0,s=!0;if(typeof e!="function")throw new TypeError(ff);return dt(r)&&(n="leading"in r?!0:n,s="trailing"in r?!!r.trailing:s),wr(e,t,{leading:n,maxWait:t,trailing:s})}const hf=(e,t)=>{const{value:r,readOnly:n=!1,debounceTime:s=800,fillContainer:o=!0,leftElement:i,rightElement:c,className:u,leftElementClassName:m,rightElementClassName:d,isSingleLine:b=!0,allowSingleLineScroll:x=!1,inputMode:l,placeholder:f,onFocus:p,onBlur:w,onInput:v,onInnerTextChange:T,onInnerHTMLChange:L,onElementCreate:I,onLeftElementClick:E,onRightElementClick:Q}=e,M=h.useRef("bsc:grow bsc:focus:outline-hidden"),$=h.useRef("bsc:text-gray-4"),F=h.useRef(),se=h.useCallback(C=>{const z=C.target,ee=z.innerHTML;z.className=`${M.current}`,f&&ee===f&&(z.innerHTML=""),p==null||p(C)},[f,p]),ae=h.useCallback(C=>{const z=C.target.innerHTML;if(f&&z===""){const ee=C.target;ee.innerHTML=f,ee.className=`${M.current} ${$.current}`}w==null||w(C)},[f,w]),U=h.useCallback(C=>{var z,ee;(z=F.current)==null||z.removeEventListener("focus",se),(ee=F.current)==null||ee.removeEventListener("blur",ae),f&&C&&C!==document.activeElement&&C.innerHTML===""&&(C.innerHTML=f,C.className=`${M.current} ${$.current}`),C.addEventListener("focus",se),C.addEventListener("blur",ae),F.current=C},[f]),R=h.useCallback(C=>{I==null||I(C)},[I]),A=C=>{E==null||E(C)},j=C=>{Q==null||Q(C)},q=wr(C=>{v==null||v(C),T==null||T(C.target.innerText),L==null||L(C.target.innerHTML)},s),W=h.useCallback(C=>{F.current&&(F.current.innerText=C)},[]),ie=h.useCallback(C=>{F.current&&(F.current.innerHTML=C)},[]),Z=h.useCallback(()=>{var C;(C=F.current)==null||C.focus()},[]);h.useImperativeHandle(t,()=>({inputElement:F.current,setInnerText:W,setInnerHTML:ie,focus:Z}));const k=he({"bsc:w-full ":o},"bsc:flex bsc:flex-row bsc:items-center bsc:shadow-sm bsc:border bsc:border-solid bsc:border-gray-3 bsc:dark:border-white bsc:dark:bg-mono-dark-1 bsc:dark:text-mono-light-1 bsc:rounded-md bsc:p-2",{"bsc:overflow-x-auto bsc:overflow-y-hidden bsc:whitespace-pre":b&&x,"bsc:overflow-hidden bsc:whitespace-pre":b&&!x},u),N=he("bsc:shrink",{"bsc:mr-2":i},m),D=he("bsc:shrink",{"bsc:ml-2":c},d);return y.jsxs("div",{className:k,ref:C=>C&&R(C),children:[i&&y.jsx("div",{className:N,onClick:A,children:i}),y.jsx("div",{ref:C=>C&&U(C),className:M.current,contentEditable:!n,suppressContentEditableWarning:!0,inputMode:l,onInput:q,children:r}),c&&y.jsx("div",{className:D,onClick:j,children:c})]})},Vr=h.forwardRef(hf);function pe(e){const t=Object.prototype.toString.call(e);return e instanceof Date||typeof e=="object"&&t==="[object Date]"?new e.constructor(+e):typeof e=="number"||t==="[object Number]"||typeof e=="string"||t==="[object String]"?new Date(e):new Date(NaN)}function Pe(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}function zt(e,t){const r=pe(e);return isNaN(t)?Pe(e,NaN):(t&&r.setDate(r.getDate()+t),r)}function ht(e,t){const r=pe(e);if(isNaN(t))return Pe(e,NaN);if(!t)return r;const n=r.getDate(),s=Pe(e,r.getTime());s.setMonth(r.getMonth()+t+1,0);const o=s.getDate();return n>=o?s:(r.setFullYear(s.getFullYear(),s.getMonth(),n),r)}const Do=6048e5,On=6e4,Dn=36e5,pf=1e3;let mf={};function Sr(){return mf}function pt(e,t){var c,u,m,d;const r=Sr(),n=(t==null?void 0:t.weekStartsOn)??((u=(c=t==null?void 0:t.locale)==null?void 0:c.options)==null?void 0:u.weekStartsOn)??r.weekStartsOn??((d=(m=r.locale)==null?void 0:m.options)==null?void 0:d.weekStartsOn)??0,s=pe(e),o=s.getDay(),i=(o<n?7:0)+o-n;return s.setDate(s.getDate()-i),s.setHours(0,0,0,0),s}function Kt(e){return pt(e,{weekStartsOn:1})}function gf(e){const t=pe(e),r=t.getFullYear(),n=Pe(e,0);n.setFullYear(r+1,0,4),n.setHours(0,0,0,0);const s=Kt(n),o=Pe(e,0);o.setFullYear(r,0,4),o.setHours(0,0,0,0);const i=Kt(o);return t.getTime()>=s.getTime()?r+1:t.getTime()>=i.getTime()?r:r-1}function _o(e){const t=pe(e);return t.setHours(0,0,0,0),t}function No(e){const t=pe(e),r=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return r.setUTCFullYear(t.getFullYear()),+e-+r}function bf(e){const t=gf(e),r=Pe(e,0);return r.setFullYear(t,0,4),r.setHours(0,0,0,0),Kt(r)}function Pr(e,t){return ht(e,t*12)}function jo(e,t){const r=_o(e),n=_o(t);return+r==+n}function yf(e){const t=pe(e),r=t.getMonth();return t.setFullYear(t.getFullYear(),r+1,0),t.setHours(23,59,59,999),t}function vf(e,t){const r=pe(e.start),n=pe(e.end);let s=+r>+n;const o=s?+r:+n,i=s?n:r;i.setHours(0,0,0,0);let c=1;const u=[];for(;+i<=o;)u.push(pe(i)),i.setDate(i.getDate()+c),i.setHours(0,0,0,0);return s?u.reverse():u}function Io(e){const t=pe(e);return t.setDate(1),t.setHours(0,0,0,0),t}function xf(e,t){const r=pe(e.start),n=pe(e.end);let s=+r>+n;const o=s?+r:+n,i=s?n:r;i.setHours(0,0,0,0),i.setMonth(0,1);let c=1;const u=[];for(;+i<=o;)u.push(pe(i)),i.setFullYear(i.getFullYear()+c);return s?u.reverse():u}const wf={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},Sf=(e,t,r)=>{let n;const s=wf[e];return typeof s=="string"?n=s:t===1?n=s.one:n=s.other.replace("{{count}}",t.toString()),r!=null&&r.addSuffix?r.comparison&&r.comparison>0?"in "+n:n+" ago":n};function _n(e){return(t={})=>{const r=t.width?String(t.width):e.defaultWidth;return e.formats[r]||e.formats[e.defaultWidth]}}const Pf={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Tf={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Ef={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},kf={date:_n({formats:Pf,defaultWidth:"full"}),time:_n({formats:Tf,defaultWidth:"full"}),dateTime:_n({formats:Ef,defaultWidth:"full"})},Cf={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Of=(e,t,r,n)=>Cf[e];function Tr(e){return(t,r)=>{const n=r!=null&&r.context?String(r.context):"standalone";let s;if(n==="formatting"&&e.formattingValues){const i=e.defaultFormattingWidth||e.defaultWidth,c=r!=null&&r.width?String(r.width):i;s=e.formattingValues[c]||e.formattingValues[i]}else{const i=e.defaultWidth,c=r!=null&&r.width?String(r.width):e.defaultWidth;s=e.values[c]||e.values[i]}const o=e.argumentCallback?e.argumentCallback(t):t;return s[o]}}const Df={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},_f={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Nf={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},jf={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},If={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Mf={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},Rf={ordinalNumber:(e,t)=>{const r=Number(e),n=r%100;if(n>20||n<10)switch(n%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},era:Tr({values:Df,defaultWidth:"wide"}),quarter:Tr({values:_f,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Tr({values:Nf,defaultWidth:"wide"}),day:Tr({values:jf,defaultWidth:"wide"}),dayPeriod:Tr({values:If,defaultWidth:"wide",formattingValues:Mf,defaultFormattingWidth:"wide"})};function Er(e){return(t,r={})=>{const n=r.width,s=n&&e.matchPatterns[n]||e.matchPatterns[e.defaultMatchWidth],o=t.match(s);if(!o)return null;const i=o[0],c=n&&e.parsePatterns[n]||e.parsePatterns[e.defaultParseWidth],u=Array.isArray(c)?Af(c,b=>b.test(i)):Lf(c,b=>b.test(i));let m;m=e.valueCallback?e.valueCallback(u):u,m=r.valueCallback?r.valueCallback(m):m;const d=t.slice(i.length);return{value:m,rest:d}}}function Lf(e,t){for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&t(e[r]))return r}function Af(e,t){for(let r=0;r<e.length;r++)if(t(e[r]))return r}function Ff(e){return(t,r={})=>{const n=t.match(e.matchPattern);if(!n)return null;const s=n[0],o=t.match(e.parsePattern);if(!o)return null;let i=e.valueCallback?e.valueCallback(o[0]):o[0];i=r.valueCallback?r.valueCallback(i):i;const c=t.slice(s.length);return{value:i,rest:c}}}const $f=/^(\d+)(th|st|nd|rd)?/i,Yf=/\d+/i,Hf={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Wf={any:[/^b/i,/^(a|c)/i]},Vf={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Bf={any:[/1/i,/2/i,/3/i,/4/i]},Uf={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},qf={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},zf={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Kf={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Zf={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Qf={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Gf={ordinalNumber:Ff({matchPattern:$f,parsePattern:Yf,valueCallback:e=>parseInt(e,10)}),era:Er({matchPatterns:Hf,defaultMatchWidth:"wide",parsePatterns:Wf,defaultParseWidth:"any"}),quarter:Er({matchPatterns:Vf,defaultMatchWidth:"wide",parsePatterns:Bf,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Er({matchPatterns:Uf,defaultMatchWidth:"wide",parsePatterns:qf,defaultParseWidth:"any"}),day:Er({matchPatterns:zf,defaultMatchWidth:"wide",parsePatterns:Kf,defaultParseWidth:"any"}),dayPeriod:Er({matchPatterns:Zf,defaultMatchWidth:"any",parsePatterns:Qf,defaultParseWidth:"any"})},Xf={code:"en-US",formatDistance:Sf,formatLong:kf,formatRelative:Of,localize:Rf,match:Gf,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Jf(e){const t=pe(e),r=+Kt(t)-+bf(t);return Math.round(r/Do)+1}function Mo(e,t){var d,b,x,l;const r=pe(e),n=r.getFullYear(),s=Sr(),o=(t==null?void 0:t.firstWeekContainsDate)??((b=(d=t==null?void 0:t.locale)==null?void 0:d.options)==null?void 0:b.firstWeekContainsDate)??s.firstWeekContainsDate??((l=(x=s.locale)==null?void 0:x.options)==null?void 0:l.firstWeekContainsDate)??1,i=Pe(e,0);i.setFullYear(n+1,0,o),i.setHours(0,0,0,0);const c=pt(i,t),u=Pe(e,0);u.setFullYear(n,0,o),u.setHours(0,0,0,0);const m=pt(u,t);return r.getTime()>=c.getTime()?n+1:r.getTime()>=m.getTime()?n:n-1}function ed(e,t){var c,u,m,d;const r=Sr(),n=(t==null?void 0:t.firstWeekContainsDate)??((u=(c=t==null?void 0:t.locale)==null?void 0:c.options)==null?void 0:u.firstWeekContainsDate)??r.firstWeekContainsDate??((d=(m=r.locale)==null?void 0:m.options)==null?void 0:d.firstWeekContainsDate)??1,s=Mo(e,t),o=Pe(e,0);return o.setFullYear(s,0,n),o.setHours(0,0,0,0),pt(o,t)}function td(e,t){const r=pe(e),n=+pt(r,t)-+ed(r,t);return Math.round(n/Do)+1}const Ro=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},Lo=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},Ao={p:Lo,P:(e,t)=>{const r=e.match(/(P+)(p+)?/)||[],n=r[1],s=r[2];if(!s)return Ro(e,t);let o;switch(n){case"P":o=t.dateTime({width:"short"});break;case"PP":o=t.dateTime({width:"medium"});break;case"PPP":o=t.dateTime({width:"long"});break;case"PPPP":default:o=t.dateTime({width:"full"});break}return o.replace("{{date}}",Ro(n,t)).replace("{{time}}",Lo(s,t))}},rd=/^D+$/,nd=/^Y+$/,sd=["D","DD","YY","YYYY"];function od(e){return rd.test(e)}function id(e){return nd.test(e)}function Fo(e,t,r){const n=ad(e,t,r);if(console.warn(n),sd.includes(e))throw new RangeError(n)}function ad(e,t,r){const n=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${n} to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}function Nn(e){return pe(e).getDay()}function $o(e){const t=pe(e),r=t.getFullYear(),n=t.getMonth(),s=Pe(e,0);return s.setFullYear(r,n+1,0),s.setHours(0,0,0,0),s.getDate()}function cd(){return Object.assign({},Sr())}function ud(e){let r=pe(e).getDay();return r===0&&(r=7),r}function ld(e){const t=pe(e),r=t.getMonth();return t.setFullYear(t.getFullYear(),r+1,0),t.setHours(0,0,0,0),t}function fd(e,t){const r=pe(e),n=pe(t);return+r<+n}function dd(e,t){const r=t instanceof Date?Pe(t,0):new t(0);return r.setFullYear(e.getFullYear(),e.getMonth(),e.getDate()),r.setHours(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()),r}const hd=10;class Yo{constructor(){P(this,"subPriority",0)}validate(t,r){return!0}}class pd extends Yo{constructor(t,r,n,s,o){super(),this.value=t,this.validateValue=r,this.setValue=n,this.priority=s,o&&(this.subPriority=o)}validate(t,r){return this.validateValue(t,this.value,r)}set(t,r,n){return this.setValue(t,r,this.value,n)}}class md extends Yo{constructor(){super(...arguments);P(this,"priority",hd);P(this,"subPriority",-1)}set(r,n){return n.timestampIsSet?r:Pe(r,dd(r,Date))}}class me{run(t,r,n,s){const o=this.parse(t,r,n,s);return o?{setter:new pd(o.value,this.validate,this.set,this.priority,this.subPriority),rest:o.rest}:null}validate(t,r,n){return!0}}class gd extends me{constructor(){super(...arguments);P(this,"priority",140);P(this,"incompatibleTokens",["R","u","t","T"])}parse(r,n,s){switch(n){case"G":case"GG":case"GGG":return s.era(r,{width:"abbreviated"})||s.era(r,{width:"narrow"});case"GGGGG":return s.era(r,{width:"narrow"});case"GGGG":default:return s.era(r,{width:"wide"})||s.era(r,{width:"abbreviated"})||s.era(r,{width:"narrow"})}}set(r,n,s){return n.era=s,r.setFullYear(s,0,1),r.setHours(0,0,0,0),r}}const Ne={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},Je={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function je(e,t){return e&&{value:t(e.value),rest:e.rest}}function Ce(e,t){const r=t.match(e);return r?{value:parseInt(r[0],10),rest:t.slice(r[0].length)}:null}function et(e,t){const r=t.match(e);if(!r)return null;if(r[0]==="Z")return{value:0,rest:t.slice(1)};const n=r[1]==="+"?1:-1,s=r[2]?parseInt(r[2],10):0,o=r[3]?parseInt(r[3],10):0,i=r[5]?parseInt(r[5],10):0;return{value:n*(s*Dn+o*On+i*pf),rest:t.slice(r[0].length)}}function Ho(e){return Ce(Ne.anyDigitsSigned,e)}function Oe(e,t){switch(e){case 1:return Ce(Ne.singleDigit,t);case 2:return Ce(Ne.twoDigits,t);case 3:return Ce(Ne.threeDigits,t);case 4:return Ce(Ne.fourDigits,t);default:return Ce(new RegExp("^\\d{1,"+e+"}"),t)}}function Br(e,t){switch(e){case 1:return Ce(Ne.singleDigitSigned,t);case 2:return Ce(Ne.twoDigitsSigned,t);case 3:return Ce(Ne.threeDigitsSigned,t);case 4:return Ce(Ne.fourDigitsSigned,t);default:return Ce(new RegExp("^-?\\d{1,"+e+"}"),t)}}function jn(e){switch(e){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;case"am":case"midnight":case"night":default:return 0}}function Wo(e,t){const r=t>0,n=r?t:1-t;let s;if(n<=50)s=e||100;else{const o=n+50,i=Math.trunc(o/100)*100,c=e>=o%100;s=e+i-(c?100:0)}return r?s:1-s}function Vo(e){return e%400===0||e%4===0&&e%100!==0}class bd extends me{constructor(){super(...arguments);P(this,"priority",130);P(this,"incompatibleTokens",["Y","R","u","w","I","i","e","c","t","T"])}parse(r,n,s){const o=i=>({year:i,isTwoDigitYear:n==="yy"});switch(n){case"y":return je(Oe(4,r),o);case"yo":return je(s.ordinalNumber(r,{unit:"year"}),o);default:return je(Oe(n.length,r),o)}}validate(r,n){return n.isTwoDigitYear||n.year>0}set(r,n,s){const o=r.getFullYear();if(s.isTwoDigitYear){const c=Wo(s.year,o);return r.setFullYear(c,0,1),r.setHours(0,0,0,0),r}const i=!("era"in n)||n.era===1?s.year:1-s.year;return r.setFullYear(i,0,1),r.setHours(0,0,0,0),r}}class yd extends me{constructor(){super(...arguments);P(this,"priority",130);P(this,"incompatibleTokens",["y","R","u","Q","q","M","L","I","d","D","i","t","T"])}parse(r,n,s){const o=i=>({year:i,isTwoDigitYear:n==="YY"});switch(n){case"Y":return je(Oe(4,r),o);case"Yo":return je(s.ordinalNumber(r,{unit:"year"}),o);default:return je(Oe(n.length,r),o)}}validate(r,n){return n.isTwoDigitYear||n.year>0}set(r,n,s,o){const i=Mo(r,o);if(s.isTwoDigitYear){const u=Wo(s.year,i);return r.setFullYear(u,0,o.firstWeekContainsDate),r.setHours(0,0,0,0),pt(r,o)}const c=!("era"in n)||n.era===1?s.year:1-s.year;return r.setFullYear(c,0,o.firstWeekContainsDate),r.setHours(0,0,0,0),pt(r,o)}}class vd extends me{constructor(){super(...arguments);P(this,"priority",130);P(this,"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"])}parse(r,n){return Br(n==="R"?4:n.length,r)}set(r,n,s){const o=Pe(r,0);return o.setFullYear(s,0,4),o.setHours(0,0,0,0),Kt(o)}}class xd extends me{constructor(){super(...arguments);P(this,"priority",130);P(this,"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"])}parse(r,n){return Br(n==="u"?4:n.length,r)}set(r,n,s){return r.setFullYear(s,0,1),r.setHours(0,0,0,0),r}}class wd extends me{constructor(){super(...arguments);P(this,"priority",120);P(this,"incompatibleTokens",["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"])}parse(r,n,s){switch(n){case"Q":case"QQ":return Oe(n.length,r);case"Qo":return s.ordinalNumber(r,{unit:"quarter"});case"QQQ":return s.quarter(r,{width:"abbreviated",context:"formatting"})||s.quarter(r,{width:"narrow",context:"formatting"});case"QQQQQ":return s.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return s.quarter(r,{width:"wide",context:"formatting"})||s.quarter(r,{width:"abbreviated",context:"formatting"})||s.quarter(r,{width:"narrow",context:"formatting"})}}validate(r,n){return n>=1&&n<=4}set(r,n,s){return r.setMonth((s-1)*3,1),r.setHours(0,0,0,0),r}}class Sd extends me{constructor(){super(...arguments);P(this,"priority",120);P(this,"incompatibleTokens",["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"])}parse(r,n,s){switch(n){case"q":case"qq":return Oe(n.length,r);case"qo":return s.ordinalNumber(r,{unit:"quarter"});case"qqq":return s.quarter(r,{width:"abbreviated",context:"standalone"})||s.quarter(r,{width:"narrow",context:"standalone"});case"qqqqq":return s.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return s.quarter(r,{width:"wide",context:"standalone"})||s.quarter(r,{width:"abbreviated",context:"standalone"})||s.quarter(r,{width:"narrow",context:"standalone"})}}validate(r,n){return n>=1&&n<=4}set(r,n,s){return r.setMonth((s-1)*3,1),r.setHours(0,0,0,0),r}}class Pd extends me{constructor(){super(...arguments);P(this,"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]);P(this,"priority",110)}parse(r,n,s){const o=i=>i-1;switch(n){case"M":return je(Ce(Ne.month,r),o);case"MM":return je(Oe(2,r),o);case"Mo":return je(s.ordinalNumber(r,{unit:"month"}),o);case"MMM":return s.month(r,{width:"abbreviated",context:"formatting"})||s.month(r,{width:"narrow",context:"formatting"});case"MMMMM":return s.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return s.month(r,{width:"wide",context:"formatting"})||s.month(r,{width:"abbreviated",context:"formatting"})||s.month(r,{width:"narrow",context:"formatting"})}}validate(r,n){return n>=0&&n<=11}set(r,n,s){return r.setMonth(s,1),r.setHours(0,0,0,0),r}}class Td extends me{constructor(){super(...arguments);P(this,"priority",110);P(this,"incompatibleTokens",["Y","R","q","Q","M","w","I","D","i","e","c","t","T"])}parse(r,n,s){const o=i=>i-1;switch(n){case"L":return je(Ce(Ne.month,r),o);case"LL":return je(Oe(2,r),o);case"Lo":return je(s.ordinalNumber(r,{unit:"month"}),o);case"LLL":return s.month(r,{width:"abbreviated",context:"standalone"})||s.month(r,{width:"narrow",context:"standalone"});case"LLLLL":return s.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return s.month(r,{width:"wide",context:"standalone"})||s.month(r,{width:"abbreviated",context:"standalone"})||s.month(r,{width:"narrow",context:"standalone"})}}validate(r,n){return n>=0&&n<=11}set(r,n,s){return r.setMonth(s,1),r.setHours(0,0,0,0),r}}function Ed(e,t,r){const n=pe(e),s=td(n,r)-t;return n.setDate(n.getDate()-s*7),n}class kd extends me{constructor(){super(...arguments);P(this,"priority",100);P(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"])}parse(r,n,s){switch(n){case"w":return Ce(Ne.week,r);case"wo":return s.ordinalNumber(r,{unit:"week"});default:return Oe(n.length,r)}}validate(r,n){return n>=1&&n<=53}set(r,n,s,o){return pt(Ed(r,s,o),o)}}function Cd(e,t){const r=pe(e),n=Jf(r)-t;return r.setDate(r.getDate()-n*7),r}class Od extends me{constructor(){super(...arguments);P(this,"priority",100);P(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"])}parse(r,n,s){switch(n){case"I":return Ce(Ne.week,r);case"Io":return s.ordinalNumber(r,{unit:"week"});default:return Oe(n.length,r)}}validate(r,n){return n>=1&&n<=53}set(r,n,s){return Kt(Cd(r,s))}}const Dd=[31,28,31,30,31,30,31,31,30,31,30,31],_d=[31,29,31,30,31,30,31,31,30,31,30,31];class Nd extends me{constructor(){super(...arguments);P(this,"priority",90);P(this,"subPriority",1);P(this,"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"])}parse(r,n,s){switch(n){case"d":return Ce(Ne.date,r);case"do":return s.ordinalNumber(r,{unit:"date"});default:return Oe(n.length,r)}}validate(r,n){const s=r.getFullYear(),o=Vo(s),i=r.getMonth();return o?n>=1&&n<=_d[i]:n>=1&&n<=Dd[i]}set(r,n,s){return r.setDate(s),r.setHours(0,0,0,0),r}}class jd extends me{constructor(){super(...arguments);P(this,"priority",90);P(this,"subpriority",1);P(this,"incompatibleTokens",["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"])}parse(r,n,s){switch(n){case"D":case"DD":return Ce(Ne.dayOfYear,r);case"Do":return s.ordinalNumber(r,{unit:"date"});default:return Oe(n.length,r)}}validate(r,n){const s=r.getFullYear();return Vo(s)?n>=1&&n<=366:n>=1&&n<=365}set(r,n,s){return r.setMonth(0,s),r.setHours(0,0,0,0),r}}function In(e,t,r){var b,x,l,f;const n=Sr(),s=(r==null?void 0:r.weekStartsOn)??((x=(b=r==null?void 0:r.locale)==null?void 0:b.options)==null?void 0:x.weekStartsOn)??n.weekStartsOn??((f=(l=n.locale)==null?void 0:l.options)==null?void 0:f.weekStartsOn)??0,o=pe(e),i=o.getDay(),u=(t%7+7)%7,m=7-s,d=t<0||t>6?t-(i+m)%7:(u+m)%7-(i+m)%7;return zt(o,d)}class Id extends me{constructor(){super(...arguments);P(this,"priority",90);P(this,"incompatibleTokens",["D","i","e","c","t","T"])}parse(r,n,s){switch(n){case"E":case"EE":case"EEE":return s.day(r,{width:"abbreviated",context:"formatting"})||s.day(r,{width:"short",context:"formatting"})||s.day(r,{width:"narrow",context:"formatting"});case"EEEEE":return s.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return s.day(r,{width:"short",context:"formatting"})||s.day(r,{width:"narrow",context:"formatting"});case"EEEE":default:return s.day(r,{width:"wide",context:"formatting"})||s.day(r,{width:"abbreviated",context:"formatting"})||s.day(r,{width:"short",context:"formatting"})||s.day(r,{width:"narrow",context:"formatting"})}}validate(r,n){return n>=0&&n<=6}set(r,n,s,o){return r=In(r,s,o),r.setHours(0,0,0,0),r}}class Md extends me{constructor(){super(...arguments);P(this,"priority",90);P(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"])}parse(r,n,s,o){const i=c=>{const u=Math.floor((c-1)/7)*7;return(c+o.weekStartsOn+6)%7+u};switch(n){case"e":case"ee":return je(Oe(n.length,r),i);case"eo":return je(s.ordinalNumber(r,{unit:"day"}),i);case"eee":return s.day(r,{width:"abbreviated",context:"formatting"})||s.day(r,{width:"short",context:"formatting"})||s.day(r,{width:"narrow",context:"formatting"});case"eeeee":return s.day(r,{width:"narrow",context:"formatting"});case"eeeeee":return s.day(r,{width:"short",context:"formatting"})||s.day(r,{width:"narrow",context:"formatting"});case"eeee":default:return s.day(r,{width:"wide",context:"formatting"})||s.day(r,{width:"abbreviated",context:"formatting"})||s.day(r,{width:"short",context:"formatting"})||s.day(r,{width:"narrow",context:"formatting"})}}validate(r,n){return n>=0&&n<=6}set(r,n,s,o){return r=In(r,s,o),r.setHours(0,0,0,0),r}}class Rd extends me{constructor(){super(...arguments);P(this,"priority",90);P(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"])}parse(r,n,s,o){const i=c=>{const u=Math.floor((c-1)/7)*7;return(c+o.weekStartsOn+6)%7+u};switch(n){case"c":case"cc":return je(Oe(n.length,r),i);case"co":return je(s.ordinalNumber(r,{unit:"day"}),i);case"ccc":return s.day(r,{width:"abbreviated",context:"standalone"})||s.day(r,{width:"short",context:"standalone"})||s.day(r,{width:"narrow",context:"standalone"});case"ccccc":return s.day(r,{width:"narrow",context:"standalone"});case"cccccc":return s.day(r,{width:"short",context:"standalone"})||s.day(r,{width:"narrow",context:"standalone"});case"cccc":default:return s.day(r,{width:"wide",context:"standalone"})||s.day(r,{width:"abbreviated",context:"standalone"})||s.day(r,{width:"short",context:"standalone"})||s.day(r,{width:"narrow",context:"standalone"})}}validate(r,n){return n>=0&&n<=6}set(r,n,s,o){return r=In(r,s,o),r.setHours(0,0,0,0),r}}function Ld(e,t){const r=pe(e),n=ud(r),s=t-n;return zt(r,s)}class Ad extends me{constructor(){super(...arguments);P(this,"priority",90);P(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"])}parse(r,n,s){const o=i=>i===0?7:i;switch(n){case"i":case"ii":return Oe(n.length,r);case"io":return s.ordinalNumber(r,{unit:"day"});case"iii":return je(s.day(r,{width:"abbreviated",context:"formatting"})||s.day(r,{width:"short",context:"formatting"})||s.day(r,{width:"narrow",context:"formatting"}),o);case"iiiii":return je(s.day(r,{width:"narrow",context:"formatting"}),o);case"iiiiii":return je(s.day(r,{width:"short",context:"formatting"})||s.day(r,{width:"narrow",context:"formatting"}),o);case"iiii":default:return je(s.day(r,{width:"wide",context:"formatting"})||s.day(r,{width:"abbreviated",context:"formatting"})||s.day(r,{width:"short",context:"formatting"})||s.day(r,{width:"narrow",context:"formatting"}),o)}}validate(r,n){return n>=1&&n<=7}set(r,n,s){return r=Ld(r,s),r.setHours(0,0,0,0),r}}class Fd extends me{constructor(){super(...arguments);P(this,"priority",80);P(this,"incompatibleTokens",["b","B","H","k","t","T"])}parse(r,n,s){switch(n){case"a":case"aa":case"aaa":return s.dayPeriod(r,{width:"abbreviated",context:"formatting"})||s.dayPeriod(r,{width:"narrow",context:"formatting"});case"aaaaa":return s.dayPeriod(r,{width:"narrow",context:"formatting"});case"aaaa":default:return s.dayPeriod(r,{width:"wide",context:"formatting"})||s.dayPeriod(r,{width:"abbreviated",context:"formatting"})||s.dayPeriod(r,{width:"narrow",context:"formatting"})}}set(r,n,s){return r.setHours(jn(s),0,0,0),r}}class $d extends me{constructor(){super(...arguments);P(this,"priority",80);P(this,"incompatibleTokens",["a","B","H","k","t","T"])}parse(r,n,s){switch(n){case"b":case"bb":case"bbb":return s.dayPeriod(r,{width:"abbreviated",context:"formatting"})||s.dayPeriod(r,{width:"narrow",context:"formatting"});case"bbbbb":return s.dayPeriod(r,{width:"narrow",context:"formatting"});case"bbbb":default:return s.dayPeriod(r,{width:"wide",context:"formatting"})||s.dayPeriod(r,{width:"abbreviated",context:"formatting"})||s.dayPeriod(r,{width:"narrow",context:"formatting"})}}set(r,n,s){return r.setHours(jn(s),0,0,0),r}}class Yd extends me{constructor(){super(...arguments);P(this,"priority",80);P(this,"incompatibleTokens",["a","b","t","T"])}parse(r,n,s){switch(n){case"B":case"BB":case"BBB":return s.dayPeriod(r,{width:"abbreviated",context:"formatting"})||s.dayPeriod(r,{width:"narrow",context:"formatting"});case"BBBBB":return s.dayPeriod(r,{width:"narrow",context:"formatting"});case"BBBB":default:return s.dayPeriod(r,{width:"wide",context:"formatting"})||s.dayPeriod(r,{width:"abbreviated",context:"formatting"})||s.dayPeriod(r,{width:"narrow",context:"formatting"})}}set(r,n,s){return r.setHours(jn(s),0,0,0),r}}class Hd extends me{constructor(){super(...arguments);P(this,"priority",70);P(this,"incompatibleTokens",["H","K","k","t","T"])}parse(r,n,s){switch(n){case"h":return Ce(Ne.hour12h,r);case"ho":return s.ordinalNumber(r,{unit:"hour"});default:return Oe(n.length,r)}}validate(r,n){return n>=1&&n<=12}set(r,n,s){const o=r.getHours()>=12;return o&&s<12?r.setHours(s+12,0,0,0):!o&&s===12?r.setHours(0,0,0,0):r.setHours(s,0,0,0),r}}class Wd extends me{constructor(){super(...arguments);P(this,"priority",70);P(this,"incompatibleTokens",["a","b","h","K","k","t","T"])}parse(r,n,s){switch(n){case"H":return Ce(Ne.hour23h,r);case"Ho":return s.ordinalNumber(r,{unit:"hour"});default:return Oe(n.length,r)}}validate(r,n){return n>=0&&n<=23}set(r,n,s){return r.setHours(s,0,0,0),r}}class Vd extends me{constructor(){super(...arguments);P(this,"priority",70);P(this,"incompatibleTokens",["h","H","k","t","T"])}parse(r,n,s){switch(n){case"K":return Ce(Ne.hour11h,r);case"Ko":return s.ordinalNumber(r,{unit:"hour"});default:return Oe(n.length,r)}}validate(r,n){return n>=0&&n<=11}set(r,n,s){return r.getHours()>=12&&s<12?r.setHours(s+12,0,0,0):r.setHours(s,0,0,0),r}}class Bd extends me{constructor(){super(...arguments);P(this,"priority",70);P(this,"incompatibleTokens",["a","b","h","H","K","t","T"])}parse(r,n,s){switch(n){case"k":return Ce(Ne.hour24h,r);case"ko":return s.ordinalNumber(r,{unit:"hour"});default:return Oe(n.length,r)}}validate(r,n){return n>=1&&n<=24}set(r,n,s){const o=s<=24?s%24:s;return r.setHours(o,0,0,0),r}}class Ud extends me{constructor(){super(...arguments);P(this,"priority",60);P(this,"incompatibleTokens",["t","T"])}parse(r,n,s){switch(n){case"m":return Ce(Ne.minute,r);case"mo":return s.ordinalNumber(r,{unit:"minute"});default:return Oe(n.length,r)}}validate(r,n){return n>=0&&n<=59}set(r,n,s){return r.setMinutes(s,0,0),r}}class qd extends me{constructor(){super(...arguments);P(this,"priority",50);P(this,"incompatibleTokens",["t","T"])}parse(r,n,s){switch(n){case"s":return Ce(Ne.second,r);case"so":return s.ordinalNumber(r,{unit:"second"});default:return Oe(n.length,r)}}validate(r,n){return n>=0&&n<=59}set(r,n,s){return r.setSeconds(s,0),r}}class zd extends me{constructor(){super(...arguments);P(this,"priority",30);P(this,"incompatibleTokens",["t","T"])}parse(r,n){const s=o=>Math.trunc(o*Math.pow(10,-n.length+3));return je(Oe(n.length,r),s)}set(r,n,s){return r.setMilliseconds(s),r}}class Kd extends me{constructor(){super(...arguments);P(this,"priority",10);P(this,"incompatibleTokens",["t","T","x"])}parse(r,n){switch(n){case"X":return et(Je.basicOptionalMinutes,r);case"XX":return et(Je.basic,r);case"XXXX":return et(Je.basicOptionalSeconds,r);case"XXXXX":return et(Je.extendedOptionalSeconds,r);case"XXX":default:return et(Je.extended,r)}}set(r,n,s){return n.timestampIsSet?r:Pe(r,r.getTime()-No(r)-s)}}class Zd extends me{constructor(){super(...arguments);P(this,"priority",10);P(this,"incompatibleTokens",["t","T","X"])}parse(r,n){switch(n){case"x":return et(Je.basicOptionalMinutes,r);case"xx":return et(Je.basic,r);case"xxxx":return et(Je.basicOptionalSeconds,r);case"xxxxx":return et(Je.extendedOptionalSeconds,r);case"xxx":default:return et(Je.extended,r)}}set(r,n,s){return n.timestampIsSet?r:Pe(r,r.getTime()-No(r)-s)}}class Qd extends me{constructor(){super(...arguments);P(this,"priority",40);P(this,"incompatibleTokens","*")}parse(r){return Ho(r)}set(r,n,s){return[Pe(r,s*1e3),{timestampIsSet:!0}]}}class Gd extends me{constructor(){super(...arguments);P(this,"priority",20);P(this,"incompatibleTokens","*")}parse(r){return Ho(r)}set(r,n,s){return[Pe(r,s),{timestampIsSet:!0}]}}const Xd={G:new gd,y:new bd,Y:new yd,R:new vd,u:new xd,Q:new wd,q:new Sd,M:new Pd,L:new Td,w:new kd,I:new Od,d:new Nd,D:new jd,E:new Id,e:new Md,c:new Rd,i:new Ad,a:new Fd,b:new $d,B:new Yd,h:new Hd,H:new Wd,K:new Vd,k:new Bd,m:new Ud,s:new qd,S:new zd,X:new Kd,x:new Zd,t:new Qd,T:new Gd},Jd=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,eh=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,th=/^'([^]*?)'?$/,rh=/''/g,nh=/\S/,sh=/[a-zA-Z]/;function tt(e,t,r,n){var p,w,v,T,L,I,E,Q;const s=cd(),o=(n==null?void 0:n.locale)??s.locale??Xf,i=(n==null?void 0:n.firstWeekContainsDate)??((w=(p=n==null?void 0:n.locale)==null?void 0:p.options)==null?void 0:w.firstWeekContainsDate)??s.firstWeekContainsDate??((T=(v=s.locale)==null?void 0:v.options)==null?void 0:T.firstWeekContainsDate)??1,c=(n==null?void 0:n.weekStartsOn)??((I=(L=n==null?void 0:n.locale)==null?void 0:L.options)==null?void 0:I.weekStartsOn)??s.weekStartsOn??((Q=(E=s.locale)==null?void 0:E.options)==null?void 0:Q.weekStartsOn)??0;if(t==="")return e===""?pe(r):Pe(r,NaN);const u={firstWeekContainsDate:i,weekStartsOn:c,locale:o},m=[new md],d=t.match(eh).map(M=>{const $=M[0];if($ in Ao){const F=Ao[$];return F(M,o.formatLong)}return M}).join("").match(Jd),b=[];for(let M of d){!(n!=null&&n.useAdditionalWeekYearTokens)&&id(M)&&Fo(M,t,e),!(n!=null&&n.useAdditionalDayOfYearTokens)&&od(M)&&Fo(M,t,e);const $=M[0],F=Xd[$];if(F){const{incompatibleTokens:se}=F;if(Array.isArray(se)){const U=b.find(R=>se.includes(R.token)||R.token===$);if(U)throw new RangeError(`The format string mustn't contain \`${U.fullToken}\` and \`${M}\` at the same time`)}else if(F.incompatibleTokens==="*"&&b.length>0)throw new RangeError(`The format string mustn't contain \`${M}\` and any other token at the same time`);b.push({token:$,fullToken:M});const ae=F.run(e,M,o.match,u);if(!ae)return Pe(r,NaN);m.push(ae.setter),e=ae.rest}else{if($.match(sh))throw new RangeError("Format string contains an unescaped latin alphabet character `"+$+"`");if(M==="''"?M="'":$==="'"&&(M=oh(M)),e.indexOf(M)===0)e=e.slice(M.length);else return Pe(r,NaN)}}if(e.length>0&&nh.test(e))return Pe(r,NaN);const x=m.map(M=>M.priority).sort((M,$)=>$-M).filter((M,$,F)=>F.indexOf(M)===$).map(M=>m.filter($=>$.priority===M).sort(($,F)=>F.subPriority-$.subPriority)).map(M=>M[0]);let l=pe(r);if(isNaN(l.getTime()))return Pe(r,NaN);const f={};for(const M of x){if(!M.validate(l,u))return Pe(r,NaN);const $=M.set(l,f,u);Array.isArray($)?(l=$[0],Object.assign(f,$[1])):l=$}return Pe(r,l)}function oh(e){return e.match(th)[1].replace(rh,"'")}function ih(e){return jo(e,Date.now())}function ah(e,t){return zt(e,-t)}function ch(e,t){let r=t-Nn(e);return r<=0&&(r+=7),zt(e,r)}function uh(e,t){const n=hh(e);let s;if(n.date){const u=ph(n.date,2);s=mh(u.restDateString,u.year)}if(!s||isNaN(s.getTime()))return new Date(NaN);const o=s.getTime();let i=0,c;if(n.time&&(i=gh(n.time),isNaN(i)))return new Date(NaN);if(n.timezone){if(c=bh(n.timezone),isNaN(c))return new Date(NaN)}else{const u=new Date(o+i),m=new Date(0);return m.setFullYear(u.getUTCFullYear(),u.getUTCMonth(),u.getUTCDate()),m.setHours(u.getUTCHours(),u.getUTCMinutes(),u.getUTCSeconds(),u.getUTCMilliseconds()),m}return new Date(o+i+c)}const Ur={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},lh=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,fh=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,dh=/^([+-])(\d{2})(?::?(\d{2}))?$/;function hh(e){const t={},r=e.split(Ur.dateTimeDelimiter);let n;if(r.length>2)return t;if(/:/.test(r[0])?n=r[0]:(t.date=r[0],n=r[1],Ur.timeZoneDelimiter.test(t.date)&&(t.date=e.split(Ur.timeZoneDelimiter)[0],n=e.substr(t.date.length,e.length))),n){const s=Ur.timezone.exec(n);s?(t.time=n.replace(s[1],""),t.timezone=s[1]):t.time=n}return t}function ph(e,t){const r=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),n=e.match(r);if(!n)return{year:NaN,restDateString:""};const s=n[1]?parseInt(n[1]):null,o=n[2]?parseInt(n[2]):null;return{year:o===null?s:o*100,restDateString:e.slice((n[1]||n[2]).length)}}function mh(e,t){if(t===null)return new Date(NaN);const r=e.match(lh);if(!r)return new Date(NaN);const n=!!r[4],s=kr(r[1]),o=kr(r[2])-1,i=kr(r[3]),c=kr(r[4]),u=kr(r[5])-1;if(n)return Sh(t,c,u)?yh(t,c,u):new Date(NaN);{const m=new Date(0);return!xh(t,o,i)||!wh(t,s)?new Date(NaN):(m.setUTCFullYear(t,o,Math.max(s,i)),m)}}function kr(e){return e?parseInt(e):1}function gh(e){const t=e.match(fh);if(!t)return NaN;const r=Mn(t[1]),n=Mn(t[2]),s=Mn(t[3]);return Ph(r,n,s)?r*Dn+n*On+s*1e3:NaN}function Mn(e){return e&&parseFloat(e.replace(",","."))||0}function bh(e){if(e==="Z")return 0;const t=e.match(dh);if(!t)return 0;const r=t[1]==="+"?-1:1,n=parseInt(t[2]),s=t[3]&&parseInt(t[3])||0;return Th(n,s)?r*(n*Dn+s*On):NaN}function yh(e,t,r){const n=new Date(0);n.setUTCFullYear(e,0,4);const s=n.getUTCDay()||7,o=(t-1)*7+r+1-s;return n.setUTCDate(n.getUTCDate()+o),n}const vh=[31,null,31,30,31,30,31,31,30,31,30,31];function Bo(e){return e%400===0||e%4===0&&e%100!==0}function xh(e,t,r){return t>=0&&t<=11&&r>=1&&r<=(vh[t]||(Bo(e)?29:28))}function wh(e,t){return t>=1&&t<=(Bo(e)?366:365)}function Sh(e,t,r){return t>=1&&t<=53&&r>=0&&r<=6}function Ph(e,t,r){return e===24?t===0&&r===0:r>=0&&r<60&&t>=0&&t<60&&e>=0&&e<25}function Th(e,t){return t>=0&&t<=59}function Eh(e,t){const r=pe(e),n=r.getFullYear(),s=r.getDate(),o=Pe(e,0);o.setFullYear(n,t,15),o.setHours(0,0,0,0);const i=$o(o);return r.setMonth(t,Math.min(s,i)),r}function kh(e,t){const r=pe(e);return isNaN(+r)?Pe(e,NaN):(r.setFullYear(t),r)}function Rn(e,t){return ht(e,-t)}function Ln(e,t){return Pr(e,-t)}function Ch(){return window.navigator.languages?window.navigator.languages[0]:window.navigator.language}function Oh(e,t,r){const n=[];for(let s=e;s<=t;s++)n.push(r?r(s):s);return n}function Dh(e,t){const r=e.target;return r?!t.isSameNode(r)&&!t.contains(r):!1}function _h(e,t){return e.isSameNode(t)||e.contains(t)}function Nh(e,t){const r=Object.entries(t),n=getComputedStyle(e);for(let s=0,o=r.length;s<o;s++){const[i,c]=r[s];if(typeof c=="string"&&c.indexOf(",")>-1){if(!c.split(",").map(m=>m.trim()).includes(n[i]))return!1}else if(n[i]!==c)return!1}return!0}function jh(e,t){const r=Object.entries(t),n=getComputedStyle(e);for(let s=0,o=r.length;s<o;s++){const[i,c]=r[s];if(typeof c=="string"&&c.indexOf(",")>-1){if(c.split(",").map(m=>m.trim()).includes(n[i]))return!0}else if(n[i]===c)return!0}return!1}function Uo(e,t,r=!1,n){if(r&&Nh(e,t)){if(!n||(n==null?void 0:n(e))===!0)return e}else if(!r&&jh(e,t)&&(!n||(n==null?void 0:n(e))===!0))return e;return e.parentElement?Uo(e.parentElement,t,r,n):e}function qo(e,t){const r=Array.from(document.querySelectorAll("body *")),n=[];for(let s=0,o=r.length;s<o;s++){const i=getComputedStyle(r[s]);i[e]&&t(i[e])&&n.push(i[e])}return n}function Bp(e){return e}function Ih(e){const t=document.documentElement;Object.keys(e).forEach(r=>{t.style.setProperty(r,e[r])})}function Mh(e){return{"--theme-bsc-primary-1":e.primary1,"--theme-bsc-primary-2":e.primary2,"--theme-bsc-primary-3":e.primary3,"--theme-bsc-primary-4":e.primary4,"--theme-bsc-primary-5":e.primary5,"--theme-bsc-gray-1":e.gray1||"#303030","--theme-bsc-gray-2":e.gray2||"#5f5f5f","--theme-bsc-gray-3":e.gray3||"#8f8f8f","--theme-bsc-gray-4":e.gray4||"#bebebe","--theme-bsc-gray-5":e.gray5||"#eee","--theme-bsc-black":e.black||"#000","--theme-bsc-white":e.white||"#fff","--theme-bsc-mono-dark-1":e.monoDark1||"#222","--theme-bsc-mono-dark-2":e.monoDark2||"#3c3c3c","--theme-bsc-mono-dark-3":e.monoDark3||"#4e4e4e","--theme-bsc-mono-light-1":e.monoLight1||"#fefefe","--theme-bsc-mono-light-2":e.monoLight2||"#eee","--theme-bsc-mono-light-3":e.monoLight3||"#ccc","--theme-bsc-info":e.info||"#2e7ff8","--theme-bsc-success":e.success||"#53ae0c","--theme-bsc-warning":e.warning||"#ff6914","--theme-bsc-error":e.error||"#f01616"}}var Ye=(e=>(e[e.Regular=24]="Regular",e[e.Small=20]="Small",e))(Ye||{});const zo=({className:e})=>y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:e,children:y.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6.75 3v2.25M17.25 3v2.25M3 18.75V7.5a2.25 2.25 0 0 1 2.25-2.25h13.5A2.25 2.25 0 0 1 21 7.5v11.25m-18 0A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75m-18 0v-7.5A2.25 2.25 0 0 1 5.25 9h13.5A2.25 2.25 0 0 1 21 11.25v7.5m-9-6h.008v.008H12v-.008ZM12 15h.008v.008H12V15Zm0 2.25h.008v.008H12v-.008ZM9.75 15h.008v.008H9.75V15Zm0 2.25h.008v.008H9.75v-.008ZM7.5 15h.008v.008H7.5V15Zm0 2.25h.008v.008H7.5v-.008Zm6.75-4.5h.008v.008h-.008v-.008Zm0 2.25h.008v.008h-.008V15Zm0 2.25h.008v.008h-.008v-.008Zm2.25-4.5h.008v.008H16.5v-.008Zm0 2.25h.008v.008H16.5V15Z"})}),Rh=({className:e})=>{const t=he("bsc:h-6 bsc:w-6",e);return y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:t,children:y.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m19.5 8.25-7.5 7.5-7.5-7.5"})})},Lh=({className:e})=>{const t=he("bsc:h-6 bsc:w-6",e);return y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:t,children:y.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 19.5 8.25 12l7.5-7.5"})})},Ah=({className:e})=>{const t=he("bsc:h-6 bsc:w-6",e);return y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:t,children:y.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m8.25 4.5 7.5 7.5-7.5 7.5"})})},Fh=({className:e})=>{const t=he("bsc:h-6 bsc:w-6",e);return y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:t,children:y.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m4.5 15.75 7.5-7.5 7.5 7.5"})})},$h=({className:e})=>y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:e,children:y.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18 18 6M6 6l12 12"})}),ze=({icon:e,size:t=Ye.Regular,onClick:r,className:n})=>{const s=h.useRef({calendar:zo,chevronDown:Rh,chevronLeft:Lh,chevronRight:Ah,chevronUp:Fh,close:$h}),o=h.useMemo(()=>s.current[e]||zo,[e]),i=he({"bsc:h-[24px] bsc:w-[24px]":t===Ye.Regular,"bsc:h-[20px] bsc:w-[20px]":t===Ye.Small},n);return y.jsx("div",{onClick:r,children:y.jsx(o,{className:i})})},Ct=({template:e,props:t,children:r})=>e(t,r);function Yh(e,t){if(t===e)return!1;const r=Object.values(t),n=Object.values(e);if(r.length!==n.length||r.some((o,i)=>o!==n[i]))return!0;const s=Object.keys(e);return Object.keys(t).some((o,i)=>o!==s[i])}function Hh(e,t){return e.matches[t]=!1,e.mediaQueries[t]={},e}function Ko(e){const t=Object.keys(e);return typeof window>"u"?t.reduce(Hh,{mediaQueries:{},matches:{}}):t.reduce((r,n)=>{const s=window.matchMedia(e[n]);return r.mediaQueries[n]=s,r.matches[n]=s.matches,r},{mediaQueries:{},matches:{}})}function Wh(e,t){function r(n,s){return n[s]=e.mediaQueries[s].matches,n}switch(t.type){case"updateMatches":return{matches:Object.keys(e.mediaQueries).reduce(r,{}),mediaQueries:e.mediaQueries};case"setQueries":return Ko(t.queries)}}function Vh(e){const t=ur.useRef(e),[r,n]=ur.useReducer(Wh,e,Ko);ur.useEffect(()=>{Yh(e,t.current)&&(n({type:"setQueries",queries:e}),t.current=e)},[e]);function s(){return n({type:"updateMatches"})}function o(u){const m=s;return typeof u.addListener<"u"?u.addListener(m):u.addEventListener("change",m),m}ur.useEffect(()=>{const u=Object.values(r.mediaQueries),m=u.map(o);function d(b,x){typeof b.addListener<"u"?b.removeListener(m[x]):b.removeEventListener("change",m[x])}return()=>{u.forEach(d)}},[r.mediaQueries]);const{matches:i}=r,c=ur.useMemo(()=>Object.values(i),[i]);return{matches:i,matchesAny:c.some(Boolean),matchesAll:c.length>0&&c.every(Boolean)}}function qr(e){return Vh(Bh(e)).matchesAll}const An={};function Bh(e){return An[e]===void 0&&(An[e]={default:e}),An[e]}const Fn=({mobileQuery:e="screen and (max-device-width: 40rem)",tabletQuery:t="screen and (min-device-width: 40.01rem) and (max-device-width: 63.9375rem)",desktopQuery:r="screen and (min-device-width: 64rem)",mobileMarkup:n,aboveMobileMarkup:s,tabletMarkup:o,desktopMarkup:i})=>{const c=qr(e),u=qr(t),m=qr(r);return c&&n?n:!c&&s?s:u&&o?o:m&&i?i:(console.error("Invalid media settings"),null)};function Zo(e,t,r){const n=o=>{const i=o.target,c=e.style.display!=="hidden";e&&c&&!_h(e,i)&&!s(r,i)&&t(!1),t(!0)},s=(o,i)=>{if(!o)return!1;for(let c=0,u=o.length;c<u;c++)if(o[c].isSameNode(i)||o[c].contains(i))return!0;return!1};return document.addEventListener("mousedown",n),n}function Qo(e){document.removeEventListener("mousedown",e)}function Uh(e,t){if(e==null)return{};var r={},n=Object.keys(e),s,o;for(o=0;o<n.length;o++)s=n[o],!(t.indexOf(s)>=0)&&(r[s]=e[s]);return r}function $n(e,t){return $n=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,s){return n.__proto__=s,n},$n(e,t)}function qh(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,$n(e,t)}var zr={exports:{}},Kr={exports:{}},ye={};/** @license React v16.13.1
84
- * react-is.production.min.js
85
- *
86
- * Copyright (c) Facebook, Inc. and its affiliates.
87
- *
88
- * This source code is licensed under the MIT license found in the
89
- * LICENSE file in the root directory of this source tree.
90
- */var Go;function zh(){if(Go)return ye;Go=1;var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,r=e?Symbol.for("react.portal"):60106,n=e?Symbol.for("react.fragment"):60107,s=e?Symbol.for("react.strict_mode"):60108,o=e?Symbol.for("react.profiler"):60114,i=e?Symbol.for("react.provider"):60109,c=e?Symbol.for("react.context"):60110,u=e?Symbol.for("react.async_mode"):60111,m=e?Symbol.for("react.concurrent_mode"):60111,d=e?Symbol.for("react.forward_ref"):60112,b=e?Symbol.for("react.suspense"):60113,x=e?Symbol.for("react.suspense_list"):60120,l=e?Symbol.for("react.memo"):60115,f=e?Symbol.for("react.lazy"):60116,p=e?Symbol.for("react.block"):60121,w=e?Symbol.for("react.fundamental"):60117,v=e?Symbol.for("react.responder"):60118,T=e?Symbol.for("react.scope"):60119;function L(E){if(typeof E=="object"&&E!==null){var Q=E.$$typeof;switch(Q){case t:switch(E=E.type,E){case u:case m:case n:case o:case s:case b:return E;default:switch(E=E&&E.$$typeof,E){case c:case d:case f:case l:case i:return E;default:return Q}}case r:return Q}}}function I(E){return L(E)===m}return ye.AsyncMode=u,ye.ConcurrentMode=m,ye.ContextConsumer=c,ye.ContextProvider=i,ye.Element=t,ye.ForwardRef=d,ye.Fragment=n,ye.Lazy=f,ye.Memo=l,ye.Portal=r,ye.Profiler=o,ye.StrictMode=s,ye.Suspense=b,ye.isAsyncMode=function(E){return I(E)||L(E)===u},ye.isConcurrentMode=I,ye.isContextConsumer=function(E){return L(E)===c},ye.isContextProvider=function(E){return L(E)===i},ye.isElement=function(E){return typeof E=="object"&&E!==null&&E.$$typeof===t},ye.isForwardRef=function(E){return L(E)===d},ye.isFragment=function(E){return L(E)===n},ye.isLazy=function(E){return L(E)===f},ye.isMemo=function(E){return L(E)===l},ye.isPortal=function(E){return L(E)===r},ye.isProfiler=function(E){return L(E)===o},ye.isStrictMode=function(E){return L(E)===s},ye.isSuspense=function(E){return L(E)===b},ye.isValidElementType=function(E){return typeof E=="string"||typeof E=="function"||E===n||E===m||E===o||E===s||E===b||E===x||typeof E=="object"&&E!==null&&(E.$$typeof===f||E.$$typeof===l||E.$$typeof===i||E.$$typeof===c||E.$$typeof===d||E.$$typeof===w||E.$$typeof===v||E.$$typeof===T||E.$$typeof===p)},ye.typeOf=L,ye}var ve={};/** @license React v16.13.1
91
- * react-is.development.js
92
- *
93
- * Copyright (c) Facebook, Inc. and its affiliates.
94
- *
95
- * This source code is licensed under the MIT license found in the
96
- * LICENSE file in the root directory of this source tree.
97
- */var Xo;function Kh(){return Xo||(Xo=1,process.env.NODE_ENV!=="production"&&function(){var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,r=e?Symbol.for("react.portal"):60106,n=e?Symbol.for("react.fragment"):60107,s=e?Symbol.for("react.strict_mode"):60108,o=e?Symbol.for("react.profiler"):60114,i=e?Symbol.for("react.provider"):60109,c=e?Symbol.for("react.context"):60110,u=e?Symbol.for("react.async_mode"):60111,m=e?Symbol.for("react.concurrent_mode"):60111,d=e?Symbol.for("react.forward_ref"):60112,b=e?Symbol.for("react.suspense"):60113,x=e?Symbol.for("react.suspense_list"):60120,l=e?Symbol.for("react.memo"):60115,f=e?Symbol.for("react.lazy"):60116,p=e?Symbol.for("react.block"):60121,w=e?Symbol.for("react.fundamental"):60117,v=e?Symbol.for("react.responder"):60118,T=e?Symbol.for("react.scope"):60119;function L(O){return typeof O=="string"||typeof O=="function"||O===n||O===m||O===o||O===s||O===b||O===x||typeof O=="object"&&O!==null&&(O.$$typeof===f||O.$$typeof===l||O.$$typeof===i||O.$$typeof===c||O.$$typeof===d||O.$$typeof===w||O.$$typeof===v||O.$$typeof===T||O.$$typeof===p)}function I(O){if(typeof O=="object"&&O!==null){var _e=O.$$typeof;switch(_e){case t:var He=O.type;switch(He){case u:case m:case n:case o:case s:case b:return He;default:var Re=He&&He.$$typeof;switch(Re){case c:case d:case f:case l:case i:return Re;default:return _e}}case r:return _e}}}var E=u,Q=m,M=c,$=i,F=t,se=d,ae=n,U=f,R=l,A=r,j=o,q=s,W=b,ie=!1;function Z(O){return ie||(ie=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),k(O)||I(O)===u}function k(O){return I(O)===m}function N(O){return I(O)===c}function D(O){return I(O)===i}function C(O){return typeof O=="object"&&O!==null&&O.$$typeof===t}function z(O){return I(O)===d}function ee(O){return I(O)===n}function Y(O){return I(O)===f}function K(O){return I(O)===l}function G(O){return I(O)===r}function ne(O){return I(O)===o}function re(O){return I(O)===s}function V(O){return I(O)===b}ve.AsyncMode=E,ve.ConcurrentMode=Q,ve.ContextConsumer=M,ve.ContextProvider=$,ve.Element=F,ve.ForwardRef=se,ve.Fragment=ae,ve.Lazy=U,ve.Memo=R,ve.Portal=A,ve.Profiler=j,ve.StrictMode=q,ve.Suspense=W,ve.isAsyncMode=Z,ve.isConcurrentMode=k,ve.isContextConsumer=N,ve.isContextProvider=D,ve.isElement=C,ve.isForwardRef=z,ve.isFragment=ee,ve.isLazy=Y,ve.isMemo=K,ve.isPortal=G,ve.isProfiler=ne,ve.isStrictMode=re,ve.isSuspense=V,ve.isValidElementType=L,ve.typeOf=I}()),ve}var Jo;function ei(){return Jo||(Jo=1,process.env.NODE_ENV==="production"?Kr.exports=zh():Kr.exports=Kh()),Kr.exports}/*
98
- object-assign
99
- (c) Sindre Sorhus
100
- @license MIT
101
- */var Yn,ti;function Zh(){if(ti)return Yn;ti=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;function n(o){if(o==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(o)}function s(){try{if(!Object.assign)return!1;var o=new String("abc");if(o[5]="de",Object.getOwnPropertyNames(o)[0]==="5")return!1;for(var i={},c=0;c<10;c++)i["_"+String.fromCharCode(c)]=c;var u=Object.getOwnPropertyNames(i).map(function(d){return i[d]});if(u.join("")!=="0123456789")return!1;var m={};return"abcdefghijklmnopqrst".split("").forEach(function(d){m[d]=d}),Object.keys(Object.assign({},m)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return Yn=s()?Object.assign:function(o,i){for(var c,u=n(o),m,d=1;d<arguments.length;d++){c=Object(arguments[d]);for(var b in c)t.call(c,b)&&(u[b]=c[b]);if(e){m=e(c);for(var x=0;x<m.length;x++)r.call(c,m[x])&&(u[m[x]]=c[m[x]])}}return u},Yn}var Hn,ri;function Wn(){if(ri)return Hn;ri=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Hn=e,Hn}var Vn,ni;function si(){return ni||(ni=1,Vn=Function.call.bind(Object.prototype.hasOwnProperty)),Vn}var Bn,oi;function Qh(){if(oi)return Bn;oi=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=Wn(),r={},n=si();e=function(o){var i="Warning: "+o;typeof console<"u"&&console.error(i);try{throw new Error(i)}catch{}}}function s(o,i,c,u,m){if(process.env.NODE_ENV!=="production"){for(var d in o)if(n(o,d)){var b;try{if(typeof o[d]!="function"){var x=Error((u||"React class")+": "+c+" type `"+d+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof o[d]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw x.name="Invariant Violation",x}b=o[d](i,d,u,c,null,t)}catch(f){b=f}if(b&&!(b instanceof Error)&&e((u||"React class")+": type specification of "+c+" `"+d+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof b+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),b instanceof Error&&!(b.message in r)){r[b.message]=!0;var l=m?m():"";e("Failed "+c+" type: "+b.message+(l??""))}}}}return s.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(r={})},Bn=s,Bn}var Un,ii;function Gh(){if(ii)return Un;ii=1;var e=ei(),t=Zh(),r=Wn(),n=si(),s=Qh(),o=function(){};process.env.NODE_ENV!=="production"&&(o=function(c){var u="Warning: "+c;typeof console<"u"&&console.error(u);try{throw new Error(u)}catch{}});function i(){return null}return Un=function(c,u){var m=typeof Symbol=="function"&&Symbol.iterator,d="@@iterator";function b(k){var N=k&&(m&&k[m]||k[d]);if(typeof N=="function")return N}var x="<<anonymous>>",l={array:v("array"),bigint:v("bigint"),bool:v("boolean"),func:v("function"),number:v("number"),object:v("object"),string:v("string"),symbol:v("symbol"),any:T(),arrayOf:L,element:I(),elementType:E(),instanceOf:Q,node:se(),objectOf:$,oneOf:M,oneOfType:F,shape:U,exact:R};function f(k,N){return k===N?k!==0||1/k===1/N:k!==k&&N!==N}function p(k,N){this.message=k,this.data=N&&typeof N=="object"?N:{},this.stack=""}p.prototype=Error.prototype;function w(k){if(process.env.NODE_ENV!=="production")var N={},D=0;function C(ee,Y,K,G,ne,re,V){if(G=G||x,re=re||K,V!==r){if(u){var O=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw O.name="Invariant Violation",O}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var _e=G+":"+K;!N[_e]&&D<3&&(o("You are manually calling a React.PropTypes validation function for the `"+re+"` prop on `"+G+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),N[_e]=!0,D++)}}return Y[K]==null?ee?Y[K]===null?new p("The "+ne+" `"+re+"` is marked as required "+("in `"+G+"`, but its value is `null`.")):new p("The "+ne+" `"+re+"` is marked as required in "+("`"+G+"`, but its value is `undefined`.")):null:k(Y,K,G,ne,re)}var z=C.bind(null,!1);return z.isRequired=C.bind(null,!0),z}function v(k){function N(D,C,z,ee,Y,K){var G=D[C],ne=q(G);if(ne!==k){var re=W(G);return new p("Invalid "+ee+" `"+Y+"` of type "+("`"+re+"` supplied to `"+z+"`, expected ")+("`"+k+"`."),{expectedType:k})}return null}return w(N)}function T(){return w(i)}function L(k){function N(D,C,z,ee,Y){if(typeof k!="function")return new p("Property `"+Y+"` of component `"+z+"` has invalid PropType notation inside arrayOf.");var K=D[C];if(!Array.isArray(K)){var G=q(K);return new p("Invalid "+ee+" `"+Y+"` of type "+("`"+G+"` supplied to `"+z+"`, expected an array."))}for(var ne=0;ne<K.length;ne++){var re=k(K,ne,z,ee,Y+"["+ne+"]",r);if(re instanceof Error)return re}return null}return w(N)}function I(){function k(N,D,C,z,ee){var Y=N[D];if(!c(Y)){var K=q(Y);return new p("Invalid "+z+" `"+ee+"` of type "+("`"+K+"` supplied to `"+C+"`, expected a single ReactElement."))}return null}return w(k)}function E(){function k(N,D,C,z,ee){var Y=N[D];if(!e.isValidElementType(Y)){var K=q(Y);return new p("Invalid "+z+" `"+ee+"` of type "+("`"+K+"` supplied to `"+C+"`, expected a single ReactElement type."))}return null}return w(k)}function Q(k){function N(D,C,z,ee,Y){if(!(D[C]instanceof k)){var K=k.name||x,G=Z(D[C]);return new p("Invalid "+ee+" `"+Y+"` of type "+("`"+G+"` supplied to `"+z+"`, expected ")+("instance of `"+K+"`."))}return null}return w(N)}function M(k){if(!Array.isArray(k))return process.env.NODE_ENV!=="production"&&(arguments.length>1?o("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):o("Invalid argument supplied to oneOf, expected an array.")),i;function N(D,C,z,ee,Y){for(var K=D[C],G=0;G<k.length;G++)if(f(K,k[G]))return null;var ne=JSON.stringify(k,function(V,O){var _e=W(O);return _e==="symbol"?String(O):O});return new p("Invalid "+ee+" `"+Y+"` of value `"+String(K)+"` "+("supplied to `"+z+"`, expected one of "+ne+"."))}return w(N)}function $(k){function N(D,C,z,ee,Y){if(typeof k!="function")return new p("Property `"+Y+"` of component `"+z+"` has invalid PropType notation inside objectOf.");var K=D[C],G=q(K);if(G!=="object")return new p("Invalid "+ee+" `"+Y+"` of type "+("`"+G+"` supplied to `"+z+"`, expected an object."));for(var ne in K)if(n(K,ne)){var re=k(K,ne,z,ee,Y+"."+ne,r);if(re instanceof Error)return re}return null}return w(N)}function F(k){if(!Array.isArray(k))return process.env.NODE_ENV!=="production"&&o("Invalid argument supplied to oneOfType, expected an instance of array."),i;for(var N=0;N<k.length;N++){var D=k[N];if(typeof D!="function")return o("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+ie(D)+" at index "+N+"."),i}function C(z,ee,Y,K,G){for(var ne=[],re=0;re<k.length;re++){var V=k[re],O=V(z,ee,Y,K,G,r);if(O==null)return null;O.data&&n(O.data,"expectedType")&&ne.push(O.data.expectedType)}var _e=ne.length>0?", expected one of type ["+ne.join(", ")+"]":"";return new p("Invalid "+K+" `"+G+"` supplied to "+("`"+Y+"`"+_e+"."))}return w(C)}function se(){function k(N,D,C,z,ee){return A(N[D])?null:new p("Invalid "+z+" `"+ee+"` supplied to "+("`"+C+"`, expected a ReactNode."))}return w(k)}function ae(k,N,D,C,z){return new p((k||"React class")+": "+N+" type `"+D+"."+C+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+z+"`.")}function U(k){function N(D,C,z,ee,Y){var K=D[C],G=q(K);if(G!=="object")return new p("Invalid "+ee+" `"+Y+"` of type `"+G+"` "+("supplied to `"+z+"`, expected `object`."));for(var ne in k){var re=k[ne];if(typeof re!="function")return ae(z,ee,Y,ne,W(re));var V=re(K,ne,z,ee,Y+"."+ne,r);if(V)return V}return null}return w(N)}function R(k){function N(D,C,z,ee,Y){var K=D[C],G=q(K);if(G!=="object")return new p("Invalid "+ee+" `"+Y+"` of type `"+G+"` "+("supplied to `"+z+"`, expected `object`."));var ne=t({},D[C],k);for(var re in ne){var V=k[re];if(n(k,re)&&typeof V!="function")return ae(z,ee,Y,re,W(V));if(!V)return new p("Invalid "+ee+" `"+Y+"` key `"+re+"` supplied to `"+z+"`.\nBad object: "+JSON.stringify(D[C],null," ")+`
102
- Valid keys: `+JSON.stringify(Object.keys(k),null," "));var O=V(K,re,z,ee,Y+"."+re,r);if(O)return O}return null}return w(N)}function A(k){switch(typeof k){case"number":case"string":case"undefined":return!0;case"boolean":return!k;case"object":if(Array.isArray(k))return k.every(A);if(k===null||c(k))return!0;var N=b(k);if(N){var D=N.call(k),C;if(N!==k.entries){for(;!(C=D.next()).done;)if(!A(C.value))return!1}else for(;!(C=D.next()).done;){var z=C.value;if(z&&!A(z[1]))return!1}}else return!1;return!0;default:return!1}}function j(k,N){return k==="symbol"?!0:N?N["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&N instanceof Symbol:!1}function q(k){var N=typeof k;return Array.isArray(k)?"array":k instanceof RegExp?"object":j(N,k)?"symbol":N}function W(k){if(typeof k>"u"||k===null)return""+k;var N=q(k);if(N==="object"){if(k instanceof Date)return"date";if(k instanceof RegExp)return"regexp"}return N}function ie(k){var N=W(k);switch(N){case"array":case"object":return"an "+N;case"boolean":case"date":case"regexp":return"a "+N;default:return N}}function Z(k){return!k.constructor||!k.constructor.name?x:k.constructor.name}return l.checkPropTypes=s,l.resetWarningCache=s.resetWarningCache,l.PropTypes=l,l},Un}var qn,ai;function Xh(){if(ai)return qn;ai=1;var e=Wn();function t(){}function r(){}return r.resetWarningCache=t,qn=function(){function n(i,c,u,m,d,b){if(b!==e){var x=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw x.name="Invariant Violation",x}}n.isRequired=n;function s(){return n}var o={array:n,bigint:n,bool:n,func:n,number:n,object:n,string:n,symbol:n,any:n,arrayOf:s,element:n,elementType:n,instanceOf:s,node:n,objectOf:s,oneOf:s,oneOfType:s,shape:s,exact:s,checkPropTypes:r,resetWarningCache:t};return o.PropTypes=o,o},qn}var ci;function Jh(){if(ci)return zr.exports;if(ci=1,process.env.NODE_ENV!=="production"){var e=ei(),t=!0;zr.exports=Gh()(e.isElement,t)}else zr.exports=Xh()();return zr.exports}var ep=Jh();const fe=tn(ep),ui={disabled:!1};var tp=process.env.NODE_ENV!=="production"?fe.oneOfType([fe.number,fe.shape({enter:fe.number,exit:fe.number,appear:fe.number}).isRequired]):null;process.env.NODE_ENV!=="production"&&fe.oneOfType([fe.string,fe.shape({enter:fe.string,exit:fe.string,active:fe.string}),fe.shape({enter:fe.string,enterDone:fe.string,enterActive:fe.string,exit:fe.string,exitDone:fe.string,exitActive:fe.string})]);const li=h.createContext(null);var rp=function(t){return t.scrollTop},Cr="unmounted",Ot="exited",Dt="entering",Zt="entered",zn="exiting",lt=function(e){qh(t,e);function t(n,s){var o;o=e.call(this,n,s)||this;var i=s,c=i&&!i.isMounting?n.enter:n.appear,u;return o.appearStatus=null,n.in?c?(u=Ot,o.appearStatus=Dt):u=Zt:n.unmountOnExit||n.mountOnEnter?u=Cr:u=Ot,o.state={status:u},o.nextCallback=null,o}t.getDerivedStateFromProps=function(s,o){var i=s.in;return i&&o.status===Cr?{status:Ot}:null};var r=t.prototype;return r.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},r.componentDidUpdate=function(s){var o=null;if(s!==this.props){var i=this.state.status;this.props.in?i!==Dt&&i!==Zt&&(o=Dt):(i===Dt||i===Zt)&&(o=zn)}this.updateStatus(!1,o)},r.componentWillUnmount=function(){this.cancelNextCallback()},r.getTimeouts=function(){var s=this.props.timeout,o,i,c;return o=i=c=s,s!=null&&typeof s!="number"&&(o=s.exit,i=s.enter,c=s.appear!==void 0?s.appear:i),{exit:o,enter:i,appear:c}},r.updateStatus=function(s,o){if(s===void 0&&(s=!1),o!==null)if(this.cancelNextCallback(),o===Dt){if(this.props.unmountOnExit||this.props.mountOnEnter){var i=this.props.nodeRef?this.props.nodeRef.current:cr.findDOMNode(this);i&&rp(i)}this.performEnter(s)}else this.performExit();else this.props.unmountOnExit&&this.state.status===Ot&&this.setState({status:Cr})},r.performEnter=function(s){var o=this,i=this.props.enter,c=this.context?this.context.isMounting:s,u=this.props.nodeRef?[c]:[cr.findDOMNode(this),c],m=u[0],d=u[1],b=this.getTimeouts(),x=c?b.appear:b.enter;if(!s&&!i||ui.disabled){this.safeSetState({status:Zt},function(){o.props.onEntered(m)});return}this.props.onEnter(m,d),this.safeSetState({status:Dt},function(){o.props.onEntering(m,d),o.onTransitionEnd(x,function(){o.safeSetState({status:Zt},function(){o.props.onEntered(m,d)})})})},r.performExit=function(){var s=this,o=this.props.exit,i=this.getTimeouts(),c=this.props.nodeRef?void 0:cr.findDOMNode(this);if(!o||ui.disabled){this.safeSetState({status:Ot},function(){s.props.onExited(c)});return}this.props.onExit(c),this.safeSetState({status:zn},function(){s.props.onExiting(c),s.onTransitionEnd(i.exit,function(){s.safeSetState({status:Ot},function(){s.props.onExited(c)})})})},r.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},r.safeSetState=function(s,o){o=this.setNextCallback(o),this.setState(s,o)},r.setNextCallback=function(s){var o=this,i=!0;return this.nextCallback=function(c){i&&(i=!1,o.nextCallback=null,s(c))},this.nextCallback.cancel=function(){i=!1},this.nextCallback},r.onTransitionEnd=function(s,o){this.setNextCallback(o);var i=this.props.nodeRef?this.props.nodeRef.current:cr.findDOMNode(this),c=s==null&&!this.props.addEndListener;if(!i||c){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var u=this.props.nodeRef?[this.nextCallback]:[i,this.nextCallback],m=u[0],d=u[1];this.props.addEndListener(m,d)}s!=null&&setTimeout(this.nextCallback,s)},r.render=function(){var s=this.state.status;if(s===Cr)return null;var o=this.props,i=o.children;o.in,o.mountOnEnter,o.unmountOnExit,o.appear,o.enter,o.exit,o.timeout,o.addEndListener,o.onEnter,o.onEntering,o.onEntered,o.onExit,o.onExiting,o.onExited,o.nodeRef;var c=Uh(o,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return h.createElement(li.Provider,{value:null},typeof i=="function"?i(s,c):h.cloneElement(h.Children.only(i),c))},t}(h.Component);lt.contextType=li,lt.propTypes=process.env.NODE_ENV!=="production"?{nodeRef:fe.shape({current:typeof Element>"u"?fe.any:function(e,t,r,n,s,o){var i=e[t];return fe.instanceOf(i&&"ownerDocument"in i?i.ownerDocument.defaultView.Element:Element)(e,t,r,n,s,o)}}),children:fe.oneOfType([fe.func.isRequired,fe.element.isRequired]).isRequired,in:fe.bool,mountOnEnter:fe.bool,unmountOnExit:fe.bool,appear:fe.bool,enter:fe.bool,exit:fe.bool,timeout:function(t){var r=tp;t.addEndListener||(r=r.isRequired);for(var n=arguments.length,s=new Array(n>1?n-1:0),o=1;o<n;o++)s[o-1]=arguments[o];return r.apply(void 0,[t].concat(s))},addEndListener:fe.func,onEnter:fe.func,onEntering:fe.func,onEntered:fe.func,onExit:fe.func,onExiting:fe.func,onExited:fe.func}:{};function Qt(){}lt.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Qt,onEntering:Qt,onEntered:Qt,onExit:Qt,onExiting:Qt,onExited:Qt},lt.UNMOUNTED=Cr,lt.EXITED=Ot,lt.ENTERING=Dt,lt.ENTERED=Zt,lt.EXITING=zn;const fi=({start:e,timeout:t=400,defaultStyle:r,transitionStyles:n,showTransitionOptions:s="cubic-bezier(0, 0, 0.2, 1)",hideTransitionOptions:o="linear",unmountOnExit:i=!1,onEntering:c,onEntered:u,onExit:m,onExited:d,children:b})=>{const x=r||{transition:`opacity ${t}ms ${s}`,opacity:0},l=n||{entering:{opacity:1},entered:{opacity:1},exiting:{transition:`opacity ${t}ms ${o}`,opacity:0},exited:{transition:`opacity ${t}ms ${o}`,opacity:0},unmounted:{}};return y.jsx(lt,{in:e,timeout:t,onEntering:c,onEntered:u,onExit:m,onExited:d,unmountOnExit:i,children:f=>b({state:f,defaultStyle:x,transitionStyles:l})})};function di(e){return e.target?e.target:e}const hi=({visible:e,target:t,appendTo:r=document.body,unmountWhenHidden:n=!1,transitionDuration:s=400,showTransitionOptions:o="cubic-bezier(0, 0, 0.2, 1)",hideTransitionOptions:i="linear",approveText:c="DONE",shown:u,hidden:m,isClickedWithin:d,children:b})=>{const[x,l]=h.useState(-1),[f,p]=h.useState(-1),[w,v]=h.useState(e),T=h.useRef(100),L=h.useRef(101),I=h.useRef(),E=h.useRef(),Q=h.useRef();h.useEffect(()=>{t&&(I.current=di(t));const R=qo("zIndex",A=>A==="auto"||A==="-1"?!1:parseInt(A)>100).map(A=>parseInt(A,10));R.length>0&&(T.current=Math.max(...R)+1,L.current=Math.max(...R)+2),v(e)},[e,t]);const M=R=>{E.current=R},$=()=>{p(T.current),l(L.current)},F=()=>{if(!E.current)return;u==null||u();let R;I.current&&(R=[I.current]);const A=j=>{j?d==null||d():v(!1)};Q.current=Zo(E.current,A,R)},se=()=>{Q.current&&Qo(Q.current)},ae=()=>{p(-1),l(-1),m==null||m()},U={entering:{opacity:.5},entered:{opacity:.5}};return cr.createPortal(y.jsx(fi,{start:w,timeout:s,showTransitionOptions:o,hideTransitionOptions:i,onEntering:$,onEntered:F,onExit:se,onExited:ae,unmountOnExit:n,children:({state:R,defaultStyle:A,transitionStyles:j})=>y.jsxs("div",{ref:q=>q&&M(q),children:[y.jsx("div",{className:"bsc:fixed bsc:left-0 bsc:top-0 bsc:h-full bsc:w-full bsc:bg-mono-dark-1",style:{zIndex:f,...j[R],...U[R]}}),y.jsxs("div",{className:"dark:bsck-border-mono-light-1 bsc:fixed bsc:bottom-0 bsc:left-0 bsc:w-full bsc:bg-white bsc:dark:border-t bsc:dark:border-solid bsc:dark:bg-mono-dark-1 bsc:dark:text-mono-light-1",style:{zIndex:x,...A,...j[R]},children:[y.jsx("div",{className:"bsc:w-full",children:b}),y.jsx(y.Fragment,{children:y.jsx(Xe,{buttonType:"primary",fullWidth:!0,onClick:()=>v(!1),className:"bsc:text-xs bsc:font-bold",children:c})})]})]})}),r)};var pi=(e=>(e[e.TopLeft=0]="TopLeft",e[e.TopRight=1]="TopRight",e[e.BottomLeft=2]="BottomLeft",e[e.BottomRight=3]="BottomRight",e))(pi||{}),mi=(e=>(e[e.TopLeft=0]="TopLeft",e[e.TopRight=1]="TopRight",e[e.BottomLeft=2]="BottomLeft",e[e.BottomRight=3]="BottomRight",e))(mi||{});class ke{static positionToTarget(t,r=2){const n=t.getBoundingClientRect();let s=0,o=0;const i=window.scrollY;switch(r){case 2:s=n.top+n.height+i,o=n.left;break;case 0:s=n.top+i,o=n.left;break;case 3:s=n.top+n.height+i,o=n.left+n.width;break;case 1:s=n.top+i,o=n.left+n.width}return{top:s,left:o}}static positionElementToTarget(t,r,n=0,s=2){let{left:o,top:i}=ke.positionToTarget(r,s);const c=t.getBoundingClientRect();switch(n){case 0:break;case 1:o=o-c.width;break;case 2:i=i-c.height;break;case 3:i=i-c.height,o=o-c.width;break}return{top:i,left:o}}static canPositionElementOnScreenWithTarget(t,r){const n=ke.getScreenDimensions(),s=t.getBoundingClientRect(),o=ke.positionElementToTarget(t,r,0,2);if(o.left+s.width<n.width&&o.top+s.height<n.height||ke.positionElementToTarget(t,r,1,3).left>=0&&o.top+s.height<n.height)return!0;const c=ke.positionElementToTarget(t,r,2,0);if(c.left+s.width<n.width&&c.top>=0)return!0;const u=ke.positionElementToTarget(t,r,3,1);return u.left>=0&&u.top>=0}static canPositionElementOnScreen(t){const r=ke.getScreenDimensions(),n=t.getBoundingClientRect();return n.width<=r.width&&n.height<=r.height}static positionElementToTargetOnScreen(t,r,n=0,s=2){const{left:o,top:i}=ke.positionElementToTarget(t,r,n,s),c=t.getBoundingClientRect(),u=ke.determineOffScreenLocation(c);if(u){if(n===0&&s===2){if(u.right&&!u.bottom)return ke.positionElementToTarget(t,r,1,3);if(u.bottom&&!u.right)return ke.positionElementToTarget(t,r,2,0);if(u.right&&u.bottom)return ke.positionElementToTarget(t,r,3,1)}else if(n===1&&s===3){if(u.left&&!u.bottom)return ke.positionElementToTarget(t,r,0,2);if(u.bottom&&!u.left)return ke.positionElementToTarget(t,r,3,1);if(u.left&&u.bottom)return ke.positionElementToTarget(t,r,2,0)}}return{top:i,left:o}}static determineOffScreenLocation(t){const r=ke.getScreenDimensions(),n={left:t.left<0,top:t.top<0,right:t.left+t.width>r.width,bottom:t.top+t.height>r.height};return n.left||n.top||n.right||n.bottom?n:void 0}static getScreenDimensions(){return{width:window.innerWidth,height:Math.max(document.documentElement.clientHeight||0,window.innerHeight||0)}}}const gi=({visible:e,target:t,targetPosition:r=pi.BottomLeft,elementAlignment:n=mi.TopLeft,shouldTargetCloseOverlay:s=!0,shouldMatchTargetWidth:o=!1,shouldScrollCloseOverlay:i=!1,shouldCheckZIndex:c=!1,shouldRemainOnScreen:u=!1,unmountWhenHidden:m=!1,transitionDuration:d=400,showTransitionOptions:b="cubic-bezier(0, 0, 0.2, 1)",hideTransitionOptions:x="linear",shown:l,hidden:f,isClickedWithin:p,markupCreated:w,children:v})=>{const[T,L]=h.useState(-1),[I,E]=h.useState(e),[Q,M]=h.useState(!1),$=h.useRef(!1),F=h.useRef(100),se=h.useRef({left:0,top:0,width:0}),ae=h.useRef(),U=h.useRef(),R=h.useRef(),A=h.useRef(),j=h.useRef(),q=h.useRef(),W=us();h.useEffect(()=>(u===!0&&(q.current=new ResizeObserver(ie)),()=>{var Y,K;u===!0&&(U.current&&((Y=q.current)==null||Y.unobserve(U.current)),(K=q.current)==null||K.disconnect())}),[]),h.useEffect(()=>{if(t&&(ae.current=di(t),i)){const Y=W==null?void 0:W.isValidScrollableElement;R.current=Uo(ae.current,{overflow:"scroll, auto",overflowX:"scroll, auto",overflowY:"scroll, auto"},!1,Y),R.current.tagName.toLowerCase()==="html"&&(R.current=document)}if(c){const Y=qo("zIndex",K=>parseInt(K)>=100).map(K=>parseInt(K));Y.length>0&&(F.current=Math.max(...Y)+1)}e!==void 0&&E(e)},[t,e,i,c]);const ie=Y=>{if(U.current){const K=ke.getScreenDimensions(),G=Y[Y.length-1].target,ne=G.getBoundingClientRect(),re=ke.determineOffScreenLocation(ne);if(re){if(ae.current&&ke.canPositionElementOnScreenWithTarget(G,ae.current)){const V=ke.positionElementToTargetOnScreen(U.current,ae.current,n,r);se.current={...se.current,...V}}else re.right?se.current.left=K.width-ne.width:re.left&&(se.current.left=0),re.bottom?se.current.top=K.height-ne.height:re.top&&(se.current.top=0);Z()}}},Z=wr(()=>{$.current=!$.current,M($.current)},20),k=()=>{L(F.current)},N=()=>{if(!U.current)return;l==null||l();let Y;!s&&ae.current&&(Y=[ae.current]);const K=G=>{G?p==null||p():E(!1)};A.current=Zo(U.current,K,Y),i&&(j.current=df(G=>U.current&&Dh(G,U.current)&&E(!1),100,{leading:!0}),R.current&&R.current.addEventListener("scroll",j.current))},D=()=>{R.current&&j.current&&(R.current.removeEventListener("scroll",j.current),j.current=void 0),A.current&&Qo(A.current)},C=()=>{L(-1),f==null||f()},z=Y=>{var K,G;if(u===!0&&U.current&&((K=q.current)==null||K.unobserve(U.current)),U.current=Y,w==null||w(Y),ae.current){const ne=ke.positionElementToTarget(U.current,ae.current,n,r);se.current={...ne,width:ae.current.offsetWidth},u===!0&&(ke.canPositionElementOnScreenWithTarget(U.current,ae.current)||ke.canPositionElementOnScreen(U.current))&&((G=q.current)==null||G.observe(U.current))}},ee=h.useMemo(()=>{const Y={top:`${se.current.top}px`,left:`${se.current.left}px`,zIndex:T};return o&&(Y.width=`${se.current.width}px`),Y},[Q,T,o]);return y.jsx(fi,{start:I,timeout:d,showTransitionOptions:b,hideTransitionOptions:x,onEntering:k,onEntered:N,onExit:D,onExited:C,unmountOnExit:m,children:({state:Y,defaultStyle:K,transitionStyles:G})=>y.jsx("div",{className:"bsc:fixed bsc:border! bsc:border-solid! bsc:border-black bsc:bg-white bsc:shadow bsc:dark:border-mono-light-1 bsc:dark:bg-mono-dark-1 bsc:dark:text-mono-light-1",style:{...ee,...K,...G[Y]},ref:ne=>ne&&z(ne),children:v})})};let Zr;const np=new Uint8Array(16);function sp(){if(!Zr&&(Zr=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Zr))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Zr(np)}const Me=[];for(let e=0;e<256;++e)Me.push((e+256).toString(16).slice(1));function op(e,t=0){return Me[e[t+0]]+Me[e[t+1]]+Me[e[t+2]]+Me[e[t+3]]+"-"+Me[e[t+4]]+Me[e[t+5]]+"-"+Me[e[t+6]]+Me[e[t+7]]+"-"+Me[e[t+8]]+Me[e[t+9]]+"-"+Me[e[t+10]]+Me[e[t+11]]+Me[e[t+12]]+Me[e[t+13]]+Me[e[t+14]]+Me[e[t+15]]}const bi={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function ip(e,t,r){if(bi.randomUUID&&!e)return bi.randomUUID();e=e||{};const n=e.random||(e.rng||sp)();return n[6]=n[6]&15|64,n[8]=n[8]&63|128,op(n)}class Or{static create(t){const r=[];let n=0;for(let s=0,o=t.formatParts.length;s<o;s++){const i=t.formatParts[s],c=n,u=c+i.characterCount;r.push({startPosition:c,endPosition:u,...i}),n=u}return r}}class ap{constructor(t,r){P(this,"instanceCollection");P(this,"formatPartList");P(this,"inputSlotCollection");P(this,"currentPartIndex",0);P(this,"currentPartIndices",[]);P(this,"currentCursorPosition",0);P(this,"highlightCursorPosition",0);P(this,"currentCursorStartPosition",-1);P(this,"currentCursorEndPosition",-1);P(this,"inputElement");P(this,"inputSelection",null);P(this,"inputRange");P(this,"textNode");this.instanceCollection=Gt.getInstance(),this.formatPartList=Or.create(t),this.inputSlotCollection=this.instanceCollection.getInputSlotInstance(r,t)}get isSelection(){return this.inputRange!==void 0&&this.inputRange.startOffset!==this.inputRange.endOffset}get isAllSelected(){var r;const t=this.inputSlotCollection.getLastSlot();return this.isSelection&&((r=this.inputRange)==null?void 0:r.startOffset)===0&&this.inputRange.endOffset===t.endPosition}getCursorPosition(){return this.currentCursorPosition}getCursorStartPosition(){return this.currentCursorStartPosition}getCursorEndPosition(){return this.currentCursorEndPosition}getCurrentPartIndex(){return this.currentPartIndex}getCurrentPartIndices(){return this.currentPartIndices}setInputElement(t){this.inputElement=t}setCursorToCurrentPosition(){this.setCursorSelection(this.currentCursorPosition>-1?this.currentCursorPosition:this.highlightCursorPosition)}setCursorPosition(t){this.setCursorSelection(t)}setCursorSelection(t,r){if(this.createInputRangeSelection(),this.inputRange&&this.textNode){let n,s,o=!0;r===void 0?(n=t,s=t):t<r?(n=t,s=r):(o=!1,n=r,s=t),this.inputRange.setStart(this.textNode,n),this.inputRange.setEnd(this.textNode,s),this.currentPartIndices=[],n===s?(this.currentCursorPosition=s,this.highlightCursorPosition=s,this.currentCursorStartPosition=-1,this.currentCursorEndPosition=-1,this.setPartIndexByCursorPosition()):(o?this.currentCursorStartPosition===-1&&this.currentCursorEndPosition===-1?this.highlightCursorPosition=s:this.currentCursorStartPosition!==n?this.highlightCursorPosition=n:this.currentCursorEndPosition!==s&&(this.highlightCursorPosition=s):this.currentCursorStartPosition===-1&&this.currentCursorEndPosition===-1?this.highlightCursorPosition=n:this.currentCursorStartPosition!==s?this.highlightCursorPosition=s:this.currentCursorEndPosition!==n&&(this.highlightCursorPosition=n),this.currentCursorStartPosition=n,this.currentCursorEndPosition=s,this.currentCursorPosition=-1,this.setPartIndexByHighlightPosition(),this.setPartIndicesByCursorPositions())}}findCursorPosition(){var n;const t=window.getSelection(),r=t==null?void 0:t.getRangeAt(0);if(this.inputElement&&t&&r){const s=document.createTreeWalker(this.inputElement,NodeFilter.SHOW_TEXT,u=>{const m=document.createRange();return m.selectNodeContents(u),m.compareBoundaryPoints(Range.END_TO_END,r)<1?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT});let o=0;for(;s.nextNode();)o+=((n=s.currentNode.textContent)==null?void 0:n.length)||0;r.startContainer.nodeType===Node.TEXT_NODE&&(o+=r.startOffset);const i=this.inputSlotCollection.getLastSlotWithData(),c=i.startPosition+i.partText.length;t.anchorOffset===t.focusOffset?this.setCursorSelection(o>c?c:o):this.setCursorSelection(t.anchorOffset,t.focusOffset)}}isAtLastPart(){return this.currentPartIndex===this.formatPartList.length-1}moveHome(){const t=this.inputSlotCollection.getFirstSlot();this.setCursorSelection(t.startPosition)}moveEnd(){const t=this.inputSlotCollection.getLastSlotWithData(),r=t.startPosition+t.partText.length;this.setCursorSelection(r)}moveCursorLeft(){if(this.updateCursorPosition(),this.currentCursorPosition>0&&!this.isSelection){const t=this.currentCursorPosition-1;let r=this.formatPartList[this.currentPartIndex];if(t>=r.startPosition&&t<=r.endPosition)this.setCursorSelection(t);else for(let n=this.currentPartIndex-1;n>=0;n--)if(r=this.formatPartList[n],t>=r.startPosition&&t<=r.endPosition){r.isSeparator?this.setCursorSelection(this.formatPartList[n-1].endPosition):this.setCursorSelection(t);break}}else this.isSelection?this.setCursorSelection(this.currentCursorPosition):this.moveHome()}moveCursorRight(){this.updateCursorPosition(!1);const t=this.inputSlotCollection.getLastSlotWithData(),r=t.startPosition+t.partText.length;if(this.currentCursorPosition<r&&!this.isSelection){const n=this.currentCursorPosition+1;let s=this.formatPartList[this.currentPartIndex];if(n>=s.startPosition&&n<=s.endPosition)this.setCursorSelection(n);else for(let o=this.currentPartIndex+1,i=this.formatPartList.length;o<i;o++)if(s=this.formatPartList[o],n>=s.startPosition&&n<=s.endPosition){s.isSeparator?this.setCursorSelection(this.formatPartList[o+1].startPosition):this.setCursorSelection(n);break}}else this.setCursorSelection(this.currentCursorPosition)}moveToNextInputPart(){if(this.currentPartIndex<this.formatPartList.length-1){const t=this.findNextEditablePart();t&&(this.currentPartIndex=t.partIndex,this.setCursorSelection(t.startPosition))}}moveToPreviousInputPart(){if(this.currentPartIndex>0){const t=this.findPreviousEditablePart();t&&(this.currentPartIndex=t.partIndex,this.setCursorSelection(t.endPosition))}}highlightAll(){const t=this.formatPartList[this.formatPartList.length-1].endPosition;this.setCursorSelection(0,t)}moveHighlightLeft(){this.updateHighlightPositions();const t=this.highlightCursorPosition>this.currentCursorStartPosition;if(this.currentCursorStartPosition>0||t){let r=t?this.currentCursorStartPosition:this.currentCursorStartPosition-1,n=t?this.highlightCursorPosition-1:this.currentCursorEndPosition,s=this.formatPartList[this.currentPartIndex];if(r>=s.startPosition&&r<=s.endPosition||t&&n>=s.startPosition&&n<=s.endPosition)this.setCursorSelection(r,n);else for(let o=this.currentPartIndex-1;o>=0;o--)if(s=this.formatPartList[o],r>=s.startPosition&&r<=s.endPosition||t&&n>=s.startPosition&&n<=s.endPosition){s.isSeparator?(t?n=this.formatPartList[o-1].endPosition:r=this.formatPartList[o-1].endPosition,this.setCursorSelection(r,n)):this.setCursorSelection(r,n);break}}}moveHighlightRight(){this.updateHighlightPositions();const t=this.inputSlotCollection.getLastSlotWithData(),r=t.startPosition+t.partText.length,n=this.highlightCursorPosition<this.currentCursorEndPosition;if(this.currentCursorEndPosition<r||n){let s=n?this.highlightCursorPosition+1:this.currentCursorStartPosition,o=n?this.currentCursorEndPosition:this.currentCursorEndPosition+1,i=this.formatPartList[this.currentPartIndex];if(o>=i.startPosition&&o<=i.endPosition||n&&s>=i.startPosition&&s<=i.endPosition)this.setCursorSelection(s,o);else for(let c=this.currentPartIndex+1,u=this.formatPartList.length;c<u;c++)if(i=this.formatPartList[c],o>=i.startPosition&&o<=i.endPosition||n&&s>=i.startPosition&&s<=i.endPosition){i.isSeparator?(n?s=this.formatPartList[c+1].startPosition:o=this.formatPartList[c+1].startPosition,this.setCursorSelection(s,o)):this.setCursorSelection(s,o);break}}}updateHighlightPositions(){this.currentCursorStartPosition===-1&&this.currentCursorEndPosition===-1&&this.currentCursorPosition>-1&&(this.currentCursorStartPosition=this.currentCursorPosition,this.currentCursorEndPosition=this.currentCursorPosition,this.highlightCursorPosition=this.currentCursorPosition)}updateCursorPosition(t=!0){this.currentCursorPosition===-1&&this.currentCursorStartPosition>-1&&this.currentCursorEndPosition>-1&&(t?this.currentCursorPosition=this.currentCursorStartPosition:this.currentCursorPosition=this.currentCursorEndPosition)}findNextEditablePart(){return this.inputSlotCollection.getNextSlot(this.currentPartIndex)}findPreviousEditablePart(){return this.inputSlotCollection.getPreviousSlot(this.currentPartIndex)}setPartIndexByCursorPosition(){for(let t=0;t<this.formatPartList.length;t++){const r=this.formatPartList[t];if(this.currentCursorPosition>=r.startPosition&&this.currentCursorPosition<=r.endPosition){if(r.isSeparator){this.currentCursorPosition=this.formatPartList[t+1].startPosition,this.currentPartIndex=t+1;break}this.currentPartIndex=t;break}}}setPartIndexByHighlightPosition(){for(let t=0;t<this.formatPartList.length;t++){const r=this.formatPartList[t];if(this.highlightCursorPosition>=r.startPosition&&this.highlightCursorPosition<=r.endPosition){if(r.isSeparator){this.highlightCursorPosition=this.formatPartList[t+1].startPosition,this.currentPartIndex=t+1;break}this.currentPartIndex=t;break}}}setPartIndicesByCursorPositions(){for(let t=0,r=this.formatPartList.length;t<r;t++){const n=this.formatPartList[t];n.isSeparator||(n.startPosition>=this.currentCursorStartPosition&&n.startPosition<=this.currentCursorEndPosition||n.endPosition>=this.currentCursorStartPosition&&n.endPosition<=this.currentCursorEndPosition||n.startPosition<this.currentCursorStartPosition&&n.endPosition>this.currentCursorEndPosition)&&this.currentPartIndices.push(t)}}createInputRangeSelection(){var t,r;this.inputElement&&(this.inputSelection=window.getSelection(),this.inputRange=document.createRange(),(t=this.inputSelection)==null||t.removeAllRanges(),this.inputRange.selectNodeContents(this.inputElement),this.inputRange.collapse(!0),(r=this.inputSelection)==null||r.addRange(this.inputRange),this.inputElement.firstChild&&(this.textNode=this.inputElement.firstChild))}}class cp{static create(t){const r=[];for(let n=0,s=t.length;n<s;n++){const o=t[n];o.isSeparator||r.push({partIndex:n,partText:"",isComplete:!1,...o})}return r}}class up{constructor(t){P(this,"inputSlots");this.inputSlots=cp.create(Or.create(t))}clearAllSlots(){for(let t=0,r=this.inputSlots.length;t<r;t++)this.inputSlots[t].partText=""}getSlot(t){return this.inputSlots.find(r=>r.partIndex===t)}getSlots(t){return this.inputSlots.filter(r=>t.includes(r.partIndex))}getSlotsFromCursorPosition(t){let r=-1;for(let n=0,s=this.inputSlots.length;n<s;n++){const o=this.inputSlots[n];if(t>=o.startPosition&&t<=o.endPosition){r=o.partIndex;break}}return r>-1?this.inputSlots.filter(n=>n.partIndex>=r):void 0}getFirstSlot(){return this.inputSlots[0]}getLastSlot(){return this.inputSlots[this.inputSlots.length-1]}getNextSlot(t){const r=this.inputSlots.findIndex(n=>n.partIndex===t);if(r>-1&&r+1<this.inputSlots.length)return this.inputSlots[r+1]}getPreviousSlot(t){const r=this.inputSlots.findIndex(n=>n.partIndex===t);if(r>-1&&r-1>=0)return this.inputSlots[r-1]}getLastSlotWithData(){const t=this.inputSlots.findIndex(n=>!n.isComplete);let r=t;for(let n=t+1,s=this.inputSlots.length;n<s;n++)this.inputSlots[n].partText.length>0&&(r=n);return this.inputSlots[r>-1?r:0]}allSlotsCompleted(){return this.inputSlots.every(t=>t.isComplete)}allSlotsEmpty(){return this.inputSlots.every(t=>t.partText.length===0)}}class Gt{static getInstance(){return this.instance||(this.instance=new lp),this.instance}}P(Gt,"instance");class lp{constructor(){P(this,"navigatorInstances");P(this,"inputSlotInstances");this.navigatorInstances={},this.inputSlotInstances={}}getNavigatorInstance(t,r){return this.navigatorInstances[t]||(this.navigatorInstances[t]=new ap(r,t)),this.navigatorInstances[t]}getInputSlotInstance(t,r){return this.inputSlotInstances[t]||(this.inputSlotInstances[t]=new up(r)),this.inputSlotInstances[t]}removeInstances(t){this.navigatorInstances[t]&&delete this.navigatorInstances[t],this.inputSlotInstances[t]&&delete this.inputSlotInstances[t]}}class Kn{constructor(t,r){P(this,"instanceCollection");P(this,"formatPartList");P(this,"inputSlotCollection");P(this,"inputElement");this.instanceCollection=Gt.getInstance(),this.formatPartList=Or.create(t),this.inputSlotCollection=this.instanceCollection.getInputSlotInstance(r,t)}setInputElement(t){this.inputElement=t}render(){var r;let t="";for(let n=0,s=this.formatPartList.length;n<s;n++){const o=this.formatPartList[n];if(o.isSeparator)t+=o.inputText;else{const i=this.inputSlotCollection.getSlot(n);i&&(t+=i.partText+((r=i.inputText)==null?void 0:r.repeat(i.characterCount-i.partText.length)))}}this.inputElement&&(this.inputElement.innerHTML=t)}}var rt=(e=>(e[e.Text=0]="Text",e[e.Numeric=1]="Numeric",e))(rt||{});class yi{constructor(){P(this,"numberKeys",["0","1","2","3","4","5","6","7","8","9"]);P(this,"movementKeys",["ArrowLeft","ArrowRight","Home","End","a"]);P(this,"editingKeys",["Backspace","Delete"]);P(this,"ignoreKeys",["Shift","Alt","Control","Fn","Meta"])}isNumberKey(t){return this.numberKeys.includes(t)}isMovementKey(t){return this.movementKeys.includes(t.key)}isEditingKey(t){return this.editingKeys.includes(t.key)}isIgnoreKey(t){return this.ignoreKeys.includes(t.key)}}class fp{constructor(t){P(this,"_currentIndex",0);P(this,"index",0);P(this,"formatParts");this.formatParts=Or.create(t)}get currentIndex(){return this._currentIndex}hasNext(){return this.index<this.formatParts.length}next(){if(this.index<this.formatParts.length)return this._currentIndex=this.index++,this.formatParts[this._currentIndex]}peek(){if(this.index<this.formatParts.length)return this.formatParts[this.index]}reset(){this.index=0}}class dp{constructor(t){P(this,"formatParts");this.formatParts=Or.create(t)}getUniqueSeparators(){const t=[],r=this.formatParts.filter(n=>n.isSeparator);for(let n=0,s=r.length;n<s;n++){const o=r[n];o.inputText&&!t.includes(o.inputText)&&t.push(o.inputText)}return t}}class vi{constructor(t,r){P(this,"instanceCollection");P(this,"inputSlotCollection");P(this,"formatNavigator");P(this,"keyTypeChecker");P(this,"formatRenderer");P(this,"formatPartList");P(this,"partEntryList");this.format=t,this.instanceCollection=Gt.getInstance(),this.inputSlotCollection=this.instanceCollection.getInputSlotInstance(r,t),this.formatNavigator=this.instanceCollection.getNavigatorInstance(r,t),this.keyTypeChecker=new yi,this.formatRenderer=new Kn(t,r),this.formatPartList=new fp(t),this.partEntryList=new dp(t)}setInputElement(t){this.formatRenderer.setInputElement(t)}processKeyPress(t){if(this.keyTypeChecker.isEditingKey(t)){this.processEditRules(t);return}this.formatNavigator.isSelection?(this.processSelectionEditRules(),setTimeout(()=>this.processInputRules(t))):this.processInputRules(t)}processInputValue(t){var n;this.inputSlotCollection.clearAllSlots(),this.formatPartList.reset();let r=0;for(;this.formatPartList.hasNext();){const s=this.formatPartList.next();if(s&&!s.isSeparator)if(((n=this.formatPartList.peek())==null?void 0:n.isSeparator)===!0){const o=this.formatPartList.currentIndex,i=this.formatPartList.next();if(i&&i.inputText){const c=t.indexOf(i.inputText,r),u=this.inputSlotCollection.getSlot(o);if(u&&c>-1){const m=c-r>u.characterCount?r+u.characterCount:c;u.partText=t.substring(r,m),this.processSlotRules(u),r=c+i.characterCount}}}else{const o=this.inputSlotCollection.getSlot(this.formatPartList.currentIndex);o&&(o.partText=t.substring(r,r+o.characterCount),this.processSlotRules(o))}}}processPastedValue(t,r=!1){r&&this.processSelectionEditRules();const n=this.formatNavigator.getCursorPosition(),s=this.inputSlotCollection.getSlotsFromCursorPosition(n);if(s){const o=n-s[0].startPosition,i=s[0].partText.substring(0,o);let c=s[0].partText.substring(o);s[0].partText="";for(let b=1,x=s.length;b<x;b++)c+=s[b].partText,s[b].partText="";const u=this.removeSeparatorsFromValue(t),m=i+u+c;let d=0;for(let b=0,x=s.length;b<x;b++){const l=s[b];l.partText=m.substring(d,l.characterCount+d),d+=l.characterCount,this.processSlotRules(l)}}}removeSeparatorsFromValue(t){let r=t;const n=this.partEntryList.getUniqueSeparators();for(let s=0,o=n.length;s<o;s++){const i=n[s];r=r.replaceAll(i,"")}return r}processEditRules(t){this.formatNavigator.isSelection?this.processSelectionEditRules():this.processNonSelectionEditRules(t)}processNonSelectionEditRules(t){const r=this.inputSlotCollection.getSlot(this.formatNavigator.getCurrentPartIndex());if(!r)return;const n=this.formatNavigator.getCursorPosition(),s=n-r.startPosition,o=this.format.deleteShiftsFormatPart||!1;switch(t.key){case"Backspace":{if(!(r.startPosition===n))r.partText=r.partText.substring(0,s-1)+r.partText.substring(s),o&&this.shiftFormatParts(r),this.formatRenderer.render(),this.formatNavigator.moveCursorLeft(),this.processSlotRules(r,!0);else{this.processSlotRules(r,!0);const c=this.inputSlotCollection.getPreviousSlot(r.partIndex);c&&(c.partText=c.partText.substring(0,c.partText.length-1),o&&this.shiftFormatParts(c),this.formatRenderer.render(),this.formatNavigator.setCursorPosition(c.startPosition+c.partText.length),this.processSlotRules(c,!0))}break}case"Delete":r.partText=r.partText.substring(0,s)+r.partText.substring(s+1),o&&this.shiftFormatParts(r),this.formatRenderer.render(),this.formatNavigator.setCursorToCurrentPosition(),this.processSlotRules(r,!0);break}}processSelectionEditRules(){const t=this.inputSlotCollection.getSlots(this.formatNavigator.getCurrentPartIndices());if(t.length<=0)return;const r=this.formatNavigator.getCursorStartPosition(),n=this.formatNavigator.getCursorEndPosition();for(let s=0,o=t.length;s<o;s++){const i=t[s];i.startPosition>=r&&i.endPosition<=n?i.partText="":i.startPosition>=r&&i.endPosition>n?i.partText=i.partText.substring(n-i.startPosition):i.startPosition<r&&i.endPosition<=n?i.partText=i.partText.substring(0,r-i.startPosition):i.startPosition<r&&i.endPosition>n&&(i.partText=i.partText.substring(0,r-i.startPosition)+i.partText.substring(n-i.startPosition))}this.formatRenderer.render(),this.formatNavigator.setCursorPosition(r);for(let s=0,o=t.length;s<o;s++)this.processSlotRules(t[s])}shiftFormatParts(t){let r=t,n;for(;(n=this.inputSlotCollection.getNextSlot(r.partIndex))!==void 0;){const s=n.partText.substring(0,1);n.partText=n.partText.substring(1),r.partText=r.partText+s,r=n}}processInputRules(t){const r=this.inputSlotCollection.getSlot(this.formatNavigator.getCurrentPartIndex());if(!r)return;const{key:n}=t,s=r.characterCount,o=r.partText;if(r.valueType===rt.Numeric){if(!this.keyTypeChecker.isNumberKey(n))return;const i=r.maximumValue,c=r.exceedingMaximumValueCausesTab||!1,u=r.padWithZeros||!1,m=parseInt(this.createNewValue(r,n));if(i&&m>i)if(c){u&&(r.partText=r.partText.padStart(s,"0")),r.isComplete=!0;const d=this.inputSlotCollection.getNextSlot(r.partIndex);d&&!d.isComplete&&(d.partText=n),this.formatRenderer.render(),d&&this.formatNavigator.setCursorPosition(d.isComplete?d.startPosition:d.startPosition+1)}else return;else o.length+1===s?(this.addToInputSlot(n),r.isComplete=!0,this.formatRenderer.render(),this.formatNavigator.isAtLastPart()?this.formatNavigator.moveCursorRight():this.formatNavigator.moveToNextInputPart()):o.length+1<s&&(this.addToInputSlot(n),this.formatRenderer.render(),this.formatNavigator.moveCursorRight())}else o.length+1===s?(this.addToInputSlot(n),r.isComplete=!0,this.formatRenderer.render(),this.formatNavigator.isAtLastPart()?this.formatNavigator.moveCursorRight():this.formatNavigator.moveToNextInputPart()):(this.addToInputSlot(n),this.formatRenderer.render(),this.formatNavigator.moveCursorRight())}addToInputSlot(t){const r=this.inputSlotCollection.getSlot(this.formatNavigator.getCurrentPartIndex());r&&(r.partText=this.createNewValue(r,t))}createNewValue(t,r){const n=t.partText,s=this.formatNavigator.getCursorPosition();if(s>=t.startPosition+t.partText.length)return n+r;{const o=s-t.startPosition;return n.substring(0,o)+r+n.substring(o)}}processSlotRules(t,r=!1){const n=t.characterCount,s=t.allCharactersRequired||!1;if(t.valueType===rt.Numeric){const o=t.minimumValue,i=t.maximumValue;if(s)t.isComplete=t.partText.length===n;else if(o!==void 0&&i!==void 0){const c=t.padWithZeros||!1,u=parseInt(t.partText);t.isComplete=u>=o&&u<=i,t.isComplete&&c&&!r&&(t.partText=t.partText.padStart(n,"0"))}else t.isComplete=t.partText.length>0}else s?t.isComplete=t.partText.length===n:t.isComplete=t.partText.length>0}}class hp{constructor(t,r){P(this,"instanceCollection");P(this,"formatNavigator");P(this,"ruleProcessor");P(this,"keyTypeChecker");P(this,"formatRenderer");this.format=t,this.instanceCollection=Gt.getInstance(),this.formatNavigator=this.instanceCollection.getNavigatorInstance(r,t),this.ruleProcessor=new vi(t,r),this.keyTypeChecker=new yi,this.formatRenderer=new Kn(t,r)}setInputElement(t){this.ruleProcessor.setInputElement(t),this.formatRenderer.setInputElement(t)}processMovementKey(t){const{key:r,metaKey:n,ctrlKey:s,shiftKey:o}=t;switch(r){case"ArrowLeft":o?this.formatNavigator.moveHighlightLeft():n?this.formatNavigator.moveHome():this.formatNavigator.moveCursorLeft();break;case"ArrowRight":o?this.formatNavigator.moveHighlightRight():n?this.formatNavigator.moveEnd():this.formatNavigator.moveCursorRight();break;case"Home":this.formatNavigator.moveHome();break;case"End":this.formatNavigator.moveEnd();break;case"a":(n||s)&&this.formatNavigator.highlightAll();break}}processKeyPress(t){return this.keyTypeChecker.isIgnoreKey(t)?!1:this.keyTypeChecker.isMovementKey(t)?(this.processMovementKey(t),!1):(this.ruleProcessor.processKeyPress(t),!0)}}class pp{constructor(t,r=""){P(this,"instanceId");P(this,"instanceCollection");P(this,"keyProcessor");P(this,"formatNavigator");P(this,"formatRenderer");P(this,"inputSlotCollection");P(this,"inputRuleProcessor");P(this,"previousOutputValue","");P(this,"inputElementSet",!1);P(this,"isInputFocused",!1);P(this,"inputElement");P(this,"onFormatChange");this.inputValue=r,this.instanceId=ip(),this.instanceCollection=Gt.getInstance(),this.keyProcessor=new hp(t,this.instanceId),this.formatNavigator=this.instanceCollection.getNavigatorInstance(this.instanceId,t),this.formatRenderer=new Kn(t,this.instanceId),this.inputSlotCollection=this.instanceCollection.getInputSlotInstance(this.instanceId,t),this.inputRuleProcessor=new vi(t,this.instanceId)}inputElementCreated(t){this.keyProcessor.setInputElement(t),this.formatNavigator.setInputElement(t),this.formatRenderer.setInputElement(t),this.inputElement=t,this.inputElementSet=!0,this.inputElementSet&&this.inputValue.length>0&&this.inputValuePassed(this.inputValue)}inputFocused(){this.isInputFocused=!0,this.formatRenderer.render(),setTimeout(()=>this.formatNavigator.findCursorPosition())}inputBlurred(){this.isInputFocused=!1}inputValuePassed(t){this.inputValue=t,this.inputElementSet&&(this.inputValue.length>0?this.inputRuleProcessor.processInputValue(t):(this.inputSlotCollection.clearAllSlots(),this.previousOutputValue=void 0),this.renderFormat())}pastedValue(t){t.length>0&&(this.formatNavigator.isSelection?this.formatNavigator.isAllSelected?this.inputValuePassed(t):this.inputRuleProcessor.processPastedValue(t,!0):this.inputValue.length===0?this.inputValuePassed(t):this.inputRuleProcessor.processPastedValue(t),this.renderFormat(!0))}registerFormatChangeEvent(t){this.onFormatChange=t}mouseUpHandler(){this.formatNavigator.findCursorPosition()}keyDownHandler(t){if(t.key!=="Tab"){if(!(t.key==="c"&&(t.ctrlKey||t.metaKey))&&!(t.key==="x"&&(t.ctrlKey||t.metaKey))&&!(t.key==="v"&&(t.ctrlKey||t.metaKey)))t.preventDefault(),t.stopPropagation();else return;this.keyProcessor.processKeyPress(t)&&this.inputElement&&this.onFormatChange&&(this.inputSlotCollection.allSlotsCompleted()&&this.previousOutputValue!==this.inputElement.innerHTML?(this.previousOutputValue=this.inputElement.innerHTML,this.onFormatChange(this.inputElement.innerHTML)):this.inputSlotCollection.allSlotsEmpty()&&this.previousOutputValue!==void 0&&(this.previousOutputValue=void 0,this.onFormatChange()))}}dispose(){this.instanceCollection.removeInstances(this.instanceId)}renderFormat(t=!1){setTimeout(()=>{var r,n;this.formatRenderer.render(),this.isInputFocused&&this.formatNavigator.setCursorToCurrentPosition(),this.inputValue.length>0&&(this.previousOutputValue=(r=this.inputElement)==null?void 0:r.innerHTML),t&&((n=this.inputElement)!=null&&n.innerHTML)&&this.onFormatChange&&this.onFormatChange(this.inputElement.innerHTML)})}}const mp=(e,t)=>{const{value:r="",format:n,readOnly:s=!1,debounceTime:o=800,fillContainer:i=!0,leftElement:c,rightElement:u,className:m,leftElementClassName:d,rightElementClassName:b,isSingleLine:x=!1,allowSingleLineScroll:l=!1,isInputValid:f,onChange:p,onFocus:w,onBlur:v,onElementCreate:T,onLeftElementClick:L,onRightElementClick:I}=e,[E,Q]=h.useState(!0),M=h.useRef(),$=h.useRef(),F=h.useRef(),se=h.useRef(!1);h.useEffect(()=>(document.addEventListener("mouseup",q),()=>{var D;(D=F.current)==null||D.dispose(),document.removeEventListener("mouseup",q)}),[]),h.useEffect(()=>{var D;(D=F.current)==null||D.inputValuePassed(r)},[r]),h.useEffect(()=>{var D,C,z;(D=F.current)==null||D.dispose(),n&&(F.current=new pp(n,r),$.current&&((C=F.current)==null||C.inputElementCreated($.current)),(z=F.current)==null||z.registerFormatChangeEvent(ae))},[n]);const ae=h.useCallback(D=>{f?f(D)?(Q(!0),p==null||p(D)):Q(!1):p==null||p(D)},[p]),U=h.useCallback(D=>{var C;(C=F.current)==null||C.inputFocused(),w==null||w(D)},[w]),R=h.useCallback(D=>{var C;(C=F.current)==null||C.inputBlurred(),v==null||v(D)},[v]),A=h.useCallback(()=>{se.current=!0},[]),j=h.useCallback(()=>{var D;if(se.current)se.current=!1,(D=F.current)==null||D.mouseUpHandler();else{const C=new MouseEvent("mouseup");document.dispatchEvent(C)}},[]),q=h.useCallback(()=>{var D;se.current&&(se.current=!1,(D=F.current)==null||D.mouseUpHandler())},[]),W=h.useCallback(D=>{var C;(C=F.current)==null||C.keyDownHandler(D)},[]),ie=h.useCallback(D=>{var z,ee;D.preventDefault(),D.stopPropagation();const C=(z=D.clipboardData)==null?void 0:z.getData("text/plain");C&&((ee=F.current)==null||ee.pastedValue(C))},[]),Z=h.useCallback(D=>{var C,z,ee,Y,K,G,ne,re,V,O,_e,He,Re,Le,nt,st,We;(z=(C=M.current)==null?void 0:C.inputElement)==null||z.removeEventListener("keydown",W),(Y=(ee=M.current)==null?void 0:ee.inputElement)==null||Y.removeEventListener("mousedown",A),(G=(K=M.current)==null?void 0:K.inputElement)==null||G.removeEventListener("mouseup",j),(re=(ne=M.current)==null?void 0:ne.inputElement)==null||re.removeEventListener("paste",ie),M.current=D,(O=(V=M.current)==null?void 0:V.inputElement)==null||O.addEventListener("keydown",W),(He=(_e=M.current)==null?void 0:_e.inputElement)==null||He.addEventListener("mousedown",A),(Le=(Re=M.current)==null?void 0:Re.inputElement)==null||Le.addEventListener("mouseup",j),(st=(nt=M.current)==null?void 0:nt.inputElement)==null||st.addEventListener("paste",ie),$.current=(We=M.current)==null?void 0:We.inputElement},[]),k=h.useCallback(()=>{var D;(D=M.current)==null||D.focus()},[]);h.useImperativeHandle(t,()=>({focus:k}));const N=he(m,{"bsc:border-error!":!E});return y.jsx(Vr,{ref:D=>D&&Z(D),readOnly:s,debounceTime:o,fillContainer:i,leftElement:c,rightElement:u,className:N,leftElementClassName:d,rightElementClassName:b,isSingleLine:x,allowSingleLineScroll:l,onFocus:U,onBlur:R,onElementCreate:T,onLeftElementClick:L,onRightElementClick:I})},xi=h.forwardRef(mp),Zn=h.createContext(void 0);function wi(e,t,r=!0){var x,l;const n=$o(e),s=Io(e),o=ld(e);let i=Nn(s)-(((x=t.options)==null?void 0:x.weekStartsOn)||0);i=i===-1?6:i;const c=Nn(o)-(((l=t.options)==null?void 0:l.weekStartsOn)||0),u=vf({start:s,end:o}),m=n+i>35?6:5,d=Si(m,7,{dayValue:null,isCurrent:!0});let b=1;for(let f=0,p=m;f<p;f++){for(let w=f>0?0:i;w<7;w++){const v=u[b-1];if(v.setHours(e.getHours(),e.getMinutes(),e.getSeconds()),d[f][w].dayValue=v,++b>n)break}if(b>n)break}if(i>0&&r)for(let f=0;f<i;f++)d[0][f].dayValue=ah(s,i-f),d[0][f].isCurrent=!1;if(c>-1&&r)for(let f=6;f>c;f--)d[m-1][f].dayValue=zt(o,f-c),d[m-1][f].isCurrent=!1;return d}function Si(e,t,r){const n=[];for(let s=0,o=e;s<o;s++){const i=[];for(let c=0,u=t;c<u;c++){const m=gp(r)?r:{...r};i.push(m)}n.push(i)}return n}function gp(e){const t=typeof e;return t==="string"||t==="number"||t==="boolean"||e instanceof Date}function bp(e){var n;const t=ch(new Date,((n=e.options)==null?void 0:n.weekStartsOn)||0),r=[];for(let s=0;s<7;s++)r.push(zt(t,s).toLocaleDateString(e.code,{weekday:"short"}));return r}function yp(e){const t=new Date(Date.UTC(2020,0,1)),r=[[{monthNumber:0,monthName:""},{monthNumber:0,monthName:""},{monthNumber:0,monthName:""},{monthNumber:0,monthName:""}],[{monthNumber:0,monthName:""},{monthNumber:0,monthName:""},{monthNumber:0,monthName:""},{monthNumber:0,monthName:""}],[{monthNumber:0,monthName:""},{monthNumber:0,monthName:""},{monthNumber:0,monthName:""},{monthNumber:0,monthName:""}]];let n=0;for(let s=0;s<3;s++)for(let o=0;o<4;o++)r[s][o]={monthNumber:n,monthName:ht(t,n++).toLocaleDateString(e.code,{month:"short"})};return r}function vp(e,t){const r=new Date(e.getTime()),n=Math.floor(r.getFullYear()/10)*10;r.setFullYear(n);const s=xf({start:r,end:Pr(r,9)}),o=Si(3,4,"");let i=0;for(let c=0;c<3;c++)for(let u=0;u<4&&(o[c][u]=s[i++].toLocaleDateString(t.code,{year:"numeric"}),i!==s.length);u++);return o}function xp(e){const t=new Date;return t.setHours(0,0,0,0),t.toLocaleTimeString(e.code)}function wp(e,t,r){return e.getTime()>=t.getTime()&&e.getTime()<=r.getTime()}function Dr(e,t){const r=uh(e);if(isNaN(r.valueOf())){let n=tt(e,"P pp",new Date,{locale:t});return!isNaN(n.valueOf())||(n=tt(e,"Pp",new Date,{locale:t}),!isNaN(n.valueOf()))||(n=tt(e,"P HH:mm",new Date,{locale:t}),!isNaN(n.valueOf()))||(n=tt(e,"P hh:mm a..aaa",new Date,{locale:t}),!isNaN(n.valueOf()))||(n=tt(e,"P HH:mm:ss",new Date,{locale:t}),!isNaN(n.valueOf()))||(n=tt(e,"P hh:mm:ss a..aaa",new Date,{locale:t}),!isNaN(n.valueOf()))||(n=tt(e,"P",new Date,{locale:t}),!isNaN(n.valueOf()))||(n=tt(e,"P p",new Date,{locale:t}),!isNaN(n.valueOf()))||(n=tt(e,"pp",new Date,{locale:t}),!isNaN(n.valueOf()))||(n=tt(e,"p",new Date,{locale:t}),!isNaN(n.valueOf()))?n:void 0}return r}function Qn(e,t){const r=e.split("-");if(r.length!==2)return;const n=Dr(r[0].trim(),t);if(!n)return;const s=Dr(r[1].trim(),t);if(s)return[n,s]}var we=(e=>(e[e.DateTime=0]="DateTime",e[e.DateOnly=1]="DateOnly",e[e.TimeOnly=2]="TimeOnly",e[e.DateRange=3]="DateRange",e))(we||{}),Ie=(e=>(e[e.DaySelector=0]="DaySelector",e[e.MonthSelector=1]="MonthSelector",e[e.YearSelector=2]="YearSelector",e[e.TimeSelector=3]="TimeSelector",e[e.DateRangeSelector=4]="DateRangeSelector",e))(Ie||{}),Xt=(e=>(e[e.Day=0]="Day",e[e.Month=1]="Month",e[e.Year=2]="Year",e[e.Range=3]="Range",e))(Xt||{}),_r=(e=>(e[e.Short=0]="Short",e[e.Medium=1]="Medium",e[e.Long=2]="Long",e))(_r||{}),De=(e=>(e[e.TwelveHour=0]="TwelveHour",e[e.TwentyFourHour=1]="TwentyFourHour",e))(De||{}),mt=(e=>(e[e.Normal=0]="Normal",e[e.Range=1]="Range",e))(mt||{}),Qr=(e=>(e[e.Right=0]="Right",e[e.Left=1]="Left",e[e.None=2]="None",e))(Qr||{}),de=(e=>(e[e.SetDateSelector=0]="SetDateSelector",e[e.SetViewDate=1]="SetViewDate",e[e.SetSelectedDate=2]="SetSelectedDate",e[e.SetSelectedDateRange=3]="SetSelectedDateRange",e[e.SetSelectedStartDate=4]="SetSelectedStartDate",e[e.SetSelectedEndDate=5]="SetSelectedEndDate",e[e.SetTimeFormat=6]="SetTimeFormat",e[e.ClearDates=7]="ClearDates",e[e.InitializeDates=8]="InitializeDates",e))(de||{});const Sp=(e,t)=>{switch(t.type){case 0:return t.dateSelector!==void 0?{...e,currentSelector:t.dateSelector,currentViewDate:t.viewDate||e.currentViewDate}:{...e};case 1:return{...e,currentViewDate:t.viewDate||new Date,dateInitialized:!0};case 2:return{...e,selectedDate:t.selectedDate||e.selectedDate,currentViewDate:t.viewDate||e.currentViewDate};case 3:return{...e,selectedStartDate:t.selectedStartDate||e.selectedStartDate,selectedEndDate:t.selectedEndDate||e.selectedEndDate};case 4:return{...e,selectedStartDate:t.selectedStartDate,selectedEndDate:void 0};case 5:return{...e,selectedEndDate:t.selectedEndDate};case 6:return{...e,timeFormat:t.timeFormat||e.timeFormat};case 7:return{currentSelector:e.currentSelector,currentViewDate:e.currentViewDate,timeFormat:e.timeFormat,dateInitialized:!0};case 8:{const r={...e,currentViewDate:Pp(t.initialDate),dateInitialized:!0};return Array.isArray(t.initialDate)?{...r,selectedStartDate:t.initialDate[0],selectedEndDate:t.initialDate[1]}:{...r,selectedDate:t.initialDate}}default:return{...e,currentSelector:Ie.DaySelector}}};function Pp(e){return e?Array.isArray(e)?e[0]:e:new Date}const Gn=(e,t,r)=>{const n=h.useCallback(u=>{r({type:de.SetViewDate,viewDate:ht(t,u)})},[t]),s=h.useCallback(u=>{r({type:de.SetViewDate,viewDate:Rn(t,u)})},[t]),o=h.useCallback(u=>{r({type:de.SetViewDate,viewDate:Pr(t,u)})},[t]),i=h.useCallback(u=>{r({type:de.SetViewDate,viewDate:Ln(t,u)})},[t]),c=h.useCallback(u=>{r({type:de.SetDateSelector,dateSelector:u})},[]);return{...e,incrementViewMonths:n,decrementViewMonths:s,incrementViewYears:o,decrementViewYears:i,setDateSelector:c}},Gr=({viewDate:e,selectedDate:t,selectedStartDate:r,selectedEndDate:n,selectionMode:s=mt.Normal,locale:o,onDateSelected:i,selectableDate:c,isValidDate:u,dispatcher:m})=>{var A;const[d,b]=h.useState(!1),[x,l]=h.useState(),[f,p]=h.useState(),[w,v]=h.useState(),[T,L]=h.useState(),I=h.useRef(),E=h.useRef(),Q=h.useContext(Zn),M=h.useMemo(()=>Q.calendarTemplate,[Q.calendarTemplate]);h.useEffect(()=>{I.current=o,E.current=bp(I.current),b(!0)},[]),h.useEffect(()=>{e&&I.current&&v(wi(e,I.current,s===mt.Normal))},[e,d]),h.useEffect(()=>{L(t?new Date(t.getFullYear(),t.getMonth(),t.getDate()):void 0)},[t]),h.useEffect(()=>{l(r?new Date(r.getFullYear(),r.getMonth(),r.getDate(),0,0,0).getTime():void 0),p(n?new Date(n.getFullYear(),n.getMonth(),n.getDate(),23,59,59).getTime():void 0)},[r,n]),h.useEffect(()=>{I.current&&o&&(I.current=o,v(wi(e,I.current,s===mt.Normal)))},[o]);const $=j=>{if(s===mt.Normal)m==null||m({type:de.SetSelectedDate,selectedDate:j,viewDate:j}),i==null||i(j);else{if(!i)throw new Error("Range selection mode requires onDateSelected to be set");!r||fd(j,r)?i(j):r&&!n?i(j,{setEndDate:!0}):r&&n&&i(j)}},F=j=>(T==null?void 0:T.toLocaleDateString())===j.toLocaleDateString(),se=j=>{if(x&&f){const q=j.getTime();return q>=x&&q<=f}return!1},ae=Gn({viewDate:e,selectedDate:t,selectedStartDate:r,selectedEndDate:n,selectionMode:s,locale:o,weekDays:E.current,monthMatrix:w,selectableDate:c,isValidDate:u,onDateClicked:$,isSelectedDate:F,isInSelectedDateRange:se},e,m),R=M||((j,q)=>y.jsx("div",{className:"bc-dt-calendar bsc:w-full",children:q}));return y.jsx(Ct,{props:ae,template:R,children:y.jsxs("div",{className:"bc-dt-day-row bsc:grid bsc:min-w-[329px] bsc:grid-cols-7 bsc:gap-3",children:[(A=E.current)==null?void 0:A.map((j,q)=>y.jsx("div",{className:"bc-dt-day-cell bsc:text-center bsc:font-bold",children:j},q)),w==null?void 0:w.map((j,q)=>j.map((W,ie)=>{var N,D;const Z=W.dayValue!==null&&(c===void 0||c(W.dayValue)),k=he("bsc:text-center bsc:py-1 bsc:hover:bg-primary-2 bsc:hover:text-white bsc:dark:hover:bg-mono-light-2 bsc:dark:hover:text-mono-dark-1",{"bsc:text-gray-3":!W.isCurrent,"bsc:bg-primary-1 bsc:text-white bsc:dark:bg-mono-light-1 bsc:dark:text-mono-dark-1":W&&W.dayValue&&(T&&F(W.dayValue)||x&&!f&&jo(x,W.dayValue)||x&&f&&se(W.dayValue)),"bsc:cursor-pointer":Z,"bsc:text-error bsc:cursor-not-allowed":!Z,"bsc:bg-primary-5 bsc:dark:bg-mono-light-3 bsc:dark:text-mono-dark-1":W.dayValue&&ih(W.dayValue)&&!(F(W.dayValue)||se(W.dayValue))},"bc-dt-date-cell");return y.jsx("div",{className:k,onClick:()=>W&&W.dayValue&&Z&&(u===void 0||u(W.dayValue))&&$(W.dayValue),children:(D=W.dayValue)==null?void 0:D.getDate().toLocaleString((N=I.current)==null?void 0:N.code)},q.toString()+ie.toString())}))]})})},Xr=({title:e,scrollerType:t,onTitleClicked:r,onMovePrevious:n,onMoveNext:s,viewDate:o,dispatcher:i})=>{const u=h.useContext(Zn).dateScrollerTemplate,m=Gn({title:e,scrollerType:t,onTitleClicked:r,onMovePrevious:n,onMoveNext:s},o,i),d="bsc:bg-transparent bsc:cursor-pointer bsc:focus:outline-hidden bsc:hover:bg-primary-1! bsc:hover:text-white! bsc:dark:hover:bg-mono-light-3!",x=u||((l,f)=>y.jsx("div",{className:"bc-dt-scroller bsc:flex bsc:w-full bsc:flex-row bsc:items-center bsc:px-2 bsc:py-1",children:f}));return y.jsxs(Ct,{props:m,template:x,children:[y.jsx("div",{className:"bc-dt-scroller-left bsc:shrink bsc:cursor-pointer",children:y.jsx(Xe,{className:d,onClick:n,children:y.jsx(ze,{icon:"chevronLeft",size:Ye.Regular})})}),y.jsx("div",{className:"bc-dt-scroller-title bsc:grow bsc:cursor-pointer bsc:text-center bsc:hover:text-primary-2 bsc:dark:hover:text-mono-light-3",onClick:r,children:e}),y.jsx("div",{className:"bc-dt-scroller-right bsc:shrink bsc:cursor-pointer",children:y.jsx(Xe,{className:d,onClick:s,children:y.jsx(ze,{icon:"chevronRight",size:Ye.Regular})})})]})},Tp=({selectedDate:e,viewDate:t,locale:r,showTimeSelector:n,selectableDate:s,isValidDate:o,onChange:i,dispatcher:c})=>{const u=()=>{t&&c({type:de.SetViewDate,viewDate:Rn(t,1)})},m=()=>{t&&c({type:de.SetViewDate,viewDate:ht(t,1)})},d=()=>{c({type:de.SetDateSelector,dateSelector:Ie.MonthSelector})},b=()=>{c({type:de.SetDateSelector,dateSelector:Ie.TimeSelector})},x=()=>t?t.toLocaleDateString(r.code,{month:"long",year:"numeric"}):"";return y.jsxs("div",{className:"bc-dt-day-selector bsc:p-2",children:[y.jsx(Xr,{title:x(),scrollerType:Xt.Day,onTitleClicked:d,onMovePrevious:u,onMoveNext:m,viewDate:t,dispatcher:c}),y.jsx(Gr,{viewDate:t,selectedDate:e,locale:r,selectableDate:s,isValidDate:o,onDateSelected:i,dispatcher:c}),n&&y.jsx("div",{className:"bc-dt-time-value-wrapper bsc:flex bsc:w-full bsc:flex-row bsc:justify-center bsc:p-2",children:y.jsx("div",{className:"bc-dt-time-value bsc:cursor-pointer bsc:p-2 bsc:hover:bg-primary-2 bsc:hover:text-white bsc:dark:bg-mono-dark-1 bsc:dark:text-mono-light-1 bsc:dark:hover:bg-mono-light-2 bsc:dark:hover:text-mono-dark-2",onClick:b,children:(e==null?void 0:e.toLocaleTimeString(r.code))||xp(r)})})]})},Ep=({viewDate:e,locale:t,dateSelection:r=we.DateTime,dispatcher:n})=>{const s=h.useRef(yp(t)),o=()=>{const d=Ln(e,1);n({type:de.SetViewDate,viewDate:d})},i=()=>{const d=Pr(e,1);n({type:de.SetViewDate,viewDate:d})},c=d=>{n({type:de.SetDateSelector,dateSelector:r!==we.DateRange?Ie.DaySelector:Ie.DateRangeSelector,viewDate:Eh(e,d)})},u=()=>e.toLocaleDateString(t.code,{year:"numeric"}),m=()=>{n({type:de.SetDateSelector,dateSelector:Ie.YearSelector})};return y.jsxs("div",{className:"bc-dt-month-selector bsc:p-2",style:{minWidth:"20rem"},children:[y.jsx(Xr,{title:u(),scrollerType:Xt.Month,onTitleClicked:m,onMovePrevious:o,onMoveNext:i,viewDate:e,dispatcher:n}),y.jsx("div",{className:"bc-dt-month-grid bsc:grid bsc:w-full bsc:grid-cols-4 bsc:gap-4",children:s.current.map((d,b)=>d.map((x,l)=>y.jsx("div",{className:"bc-dt-month-cell bsc:cursor-pointer bsc:text-center bsc:py-2 bsc:hover:bg-primary-2 bsc:hover:text-white bsc:dark:hover:bg-mono-light-2 bsc:dark:hover:text-mono-dark-1",onClick:()=>c(x.monthNumber),children:x.monthName},b.toString()+l.toString())))})]})},kp=({viewDate:e,selectedStartDate:t,selectedEndDate:r,locale:n,onChange:s,dispatcher:o})=>{const i=qr("screen and (max-device-width: 40rem)"),c=ht(e,1),u=(l,f)=>{!f||!f.setEndDate?o({type:de.SetSelectedStartDate,selectedStartDate:l}):(o({type:de.SetSelectedEndDate,selectedEndDate:l}),t&&s&&s([t,l]))},m=()=>{o({type:de.SetDateSelector,dateSelector:Ie.MonthSelector})},d=()=>i?`${e.toLocaleDateString(n.code,{month:"long"})} ${e.toLocaleDateString(n.code,{year:"numeric"})}`:`${e.toLocaleDateString(n.code,{month:"long"})} ${e.toLocaleDateString(n.code,{year:"numeric"})} - ${c.toLocaleDateString(n.code,{month:"long"})} ${c.toLocaleDateString(n.code,{year:"numeric"})}`,b=()=>{e&&o({type:de.SetViewDate,viewDate:Rn(e,1)})},x=()=>{e&&o({type:de.SetViewDate,viewDate:ht(e,1)})};return y.jsxs("div",{className:"bc-dt-range-selector bsc:flex bsc:flex-col",children:[y.jsx("div",{className:"bc-dt-range-scroller-wrapper bsc:shrink",children:y.jsx(Xr,{title:d(),scrollerType:Xt.Range,onTitleClicked:m,onMovePrevious:b,onMoveNext:x,viewDate:e,dispatcher:o})}),y.jsx("div",{className:"bsc-flex-grow",children:y.jsx(Fn,{mobileMarkup:y.jsx("div",{className:"bc-dt-range-calendar bsc:px-2 bsc:py-1",children:y.jsx(Gr,{viewDate:e,selectedStartDate:t,selectedEndDate:r,selectionMode:mt.Range,onDateSelected:u,locale:n,dispatcher:o})}),aboveMobileMarkup:y.jsxs("div",{className:"bc-dt-range-wrapper bsc:flex bsc:flex-row bsc:px-2 bsc:py-1",children:[y.jsx("div",{className:"bc-dt-range-calendar-1 bsc:border-r bsc:border-solid bsc:border-gray-3 bsc:pr-4",children:y.jsx(Gr,{viewDate:e,selectedStartDate:t,selectedEndDate:r,selectionMode:mt.Range,onDateSelected:u,locale:n,dispatcher:o})}),y.jsx("div",{className:"bc-dt-range-calendar-2 bsc:pl-4",children:y.jsx(Gr,{viewDate:c,selectedStartDate:t,selectedEndDate:r,selectionMode:mt.Range,onDateSelected:u,locale:n,dispatcher:o})})]})})})]})},Cp=({viewDate:e,showDateSelector:t,locale:r,timeFormat:n=De.TwelveHour,timeConstraints:s,onChange:o,dispatcher:i})=>{const c=h.useRef(n===De.TwelveHour?11:23),u=h.useRef(n===De.TwelveHour?["12","01","02","03","04","05","06","07","08","09","10","11"]:["00","01","02","03","04","05","06","07","08","09","10","11","12","13","14","15","16","17","18","19","20","21","22","23"]),m=h.useRef(Oh(0,59,A=>A.toString().padStart(2,"0"))),d=h.useRef(["AM","PM"]),b=h.useRef(af(e)),x=A=>A>11?A-12:A,[l,f]=h.useState(x(e.getHours())),[p,w]=h.useState(e.getMinutes()),[v,T]=h.useState(e.getHours()<=12?0:1),L=h.useRef(e.toLocaleDateString(r.code));h.useEffect(()=>{const A=e.getHours(),j=e.getMinutes();if(A!==l&&f(n===De.TwelveHour?x(A):A),j!==p&&w(j),n===De.TwelveHour){const q=A<=11?0:1;q!==v&&T(q)}},[e]);const I=()=>{var q;const A=((q=s==null?void 0:s.hours)==null?void 0:q.step)||1,j=l<c.current?l+A:0;f(j),F(j,p,v)},E=()=>{var q;const A=((q=s==null?void 0:s.hours)==null?void 0:q.step)||1,j=l>0?l-A:c.current;f(j),F(j,p,v)},Q=()=>{var q,W,ie;const A=((q=s==null?void 0:s.minutes)==null?void 0:q.step)||1,j=p+A<(((W=s==null?void 0:s.minutes)==null?void 0:W.max)||59)?p+A:((ie=s==null?void 0:s.minutes)==null?void 0:ie.min)||0;w(j),F(l,j,v)},M=()=>{var q,W,ie;const A=((q=s==null?void 0:s.minutes)==null?void 0:q.step)||1,j=p-A>=(((W=s==null?void 0:s.minutes)==null?void 0:W.min)||0)?p-A:(((ie=s==null?void 0:s.minutes)==null?void 0:ie.max)||60)-A;w(j),F(l,j,v)},$=()=>{const A=v===0?1:0;T(A),F(l,p,A)},F=(A,j,q)=>{const W=n===De.TwelveHour&&q===1?A+12:A;b.current.setHours(W,j),i({type:de.SetSelectedDate,selectedDate:b.current,viewDate:b.current}),o==null||o(b.current)},se=()=>{i({type:de.SetDateSelector,dateSelector:Ie.DaySelector})},ae=he("bsc:w-full bsc:grid bsc:grid-rows-3 bsc:gap-4 bsc:items-center bc-dt-time-grid",{"bsc:grid-cols-4":n===De.TwelveHour,"bsc:grid-cols-3":n===De.TwentyFourHour}),U=he("bsc:text-center bsc:cursor-pointer bsc:hover:bg-primary-2 bsc:hover:text-white bsc:dark:text-mono-light-1 bsc:dark:hover:bg-mono-light-1 bsc:dark:hover:text-mono-dark-1 bc-dt-time-date-value",{"bsc:col-span-4":n===De.TwelveHour,"bsc:col-span-3":n===De.TwentyFourHour}),R="bsc-bg-transparent bsc:p-2 bsc:cursor-pointer bsc:focus:outline-hidden bsc:hover:bg-primary-2 bsc:hover:text-white bsc:dark:hover:bg-mono-light-1 bsc:dark:hover:text-mono-dark-1";return y.jsx("div",{className:"bc-dt-time-selector bsc:flex bsc:flex-row bsc:justify-center bsc:p-2",style:{minWidth:n===De.TwelveHour?"15rem":"11rem"},children:y.jsxs("div",{className:ae,children:[t&&y.jsx("div",{className:U,onClick:se,children:L.current}),y.jsx("div",{className:"bc-dt-time-hour-increase bsc:cursor-pointer bsc:text-center",children:y.jsx(Xe,{className:R,onClick:I,children:y.jsx(ze,{icon:"chevronUp",size:Ye.Regular})})}),y.jsx("div",{}),y.jsx("div",{className:"bc-dt-time-minute-increase bsc:cursor-pointer bsc:text-center",children:y.jsx(Xe,{className:R,onClick:Q,children:y.jsx(ze,{icon:"chevronUp",size:Ye.Regular})})}),n===De.TwelveHour&&y.jsx("div",{className:"bc-dt-time-meridian-increase bsc:cursor-pointer bsc:text-center",children:y.jsx(Xe,{className:R,onClick:$,children:y.jsx(ze,{icon:"chevronUp",size:Ye.Regular})})}),y.jsx("div",{className:"bc-dt-time-hour-value bsc:text-center",children:u.current[l]}),y.jsx("div",{className:"bc-dt-time-separator bsc:text-center",children:":"}),y.jsx("div",{className:"bc-dt-time-minute-value bsc:text-center",children:m.current[p]}),n===De.TwelveHour&&y.jsx("div",{className:"bc-dt-time-meridian-value bsc:text-center",children:d.current[v]}),y.jsx("div",{className:"bc-dt-time-hour-decrease bsc:cursor-pointer bsc:text-center",children:y.jsx(Xe,{className:R,onClick:E,children:y.jsx(ze,{icon:"chevronDown",size:Ye.Regular})})}),y.jsx("div",{}),y.jsx("div",{className:"bc-dt-time-minute-decrease bsc:cursor-pointer bsc:text-center",children:y.jsx(Xe,{className:R,onClick:M,children:y.jsx(ze,{icon:"chevronDown",size:Ye.Regular})})}),n===De.TwelveHour&&y.jsx("div",{className:"bc-dt-time-meridian-decrease bsc:cursor-pointer bsc:text-center",children:y.jsx(Xe,{className:R,onClick:$,children:y.jsx(ze,{icon:"chevronDown",size:Ye.Regular})})})]})})},Op=({viewDate:e,locale:t,dispatcher:r})=>{const n=vp(e,t),s=()=>{const u=Ln(e,10);r({type:de.SetViewDate,viewDate:u})},o=()=>{const u=Pr(e,10);r({type:de.SetViewDate,viewDate:u})},i=u=>{const m=parseInt(u);r({type:de.SetDateSelector,dateSelector:Ie.MonthSelector,viewDate:kh(e,m)})},c=()=>`${n[0][0].toString()} - ${n[2][1].toString()}`;return y.jsxs("div",{className:"bc-dt-year-selector bsc:p-2",style:{minWidth:"20rem"},children:[y.jsx(Xr,{title:c(),scrollerType:Xt.Year,onMovePrevious:s,onMoveNext:o,viewDate:e,dispatcher:r}),y.jsx("div",{className:"bc-dt-year-wrapper bsc:w-full",children:y.jsx("div",{className:"bc-dt-year-grid bsc:grid bsc:grid-cols-4 bsc:gap-4",children:n.map((u,m)=>u.map((d,b)=>d.length>0?y.jsx("div",{className:"bc-dt-year-cell bsc:cursor-pointer bsc:text-center bsc:py-2 bsc:hover:bg-primary-2 bsc:hover:text-white bsc:dark:hover:bg-mono-light-2 bsc:dark:hover:text-mono-dark-1",onClick:()=>i(d),children:d},m.toString()+b.toString()):y.jsx("div",{},m.toString()+b.toString())))})})]})};class Dp{constructor(t,r){P(this,"dateFormat");P(this,"timeFormat");P(this,"use24HourTime");P(this,"monthPart");P(this,"dayPart");P(this,"yearPart");P(this,"twelveHourPart");P(this,"twentyFourHourPart");P(this,"minutePart");P(this,"meridianPart");this.dateSelection=t;const n=2023,s=12,o=20,c=new Date(n,s-1,o).toLocaleDateString(r,{year:"numeric",month:"numeric",day:"numeric"});this.dateFormat=c.replace(`${n}`,"YYYY").replace(`${s}`,"MM").replace(`${o}`,"DD");const u=new Date,m=18,d=24,b=37,x=317;u.setHours(m,d,b,x);const l=u.toLocaleTimeString(r);this.use24HourTime=l.startsWith("18"),this.timeFormat=l.replace(`${this.use24HourTime?m:"6"}`,"HH").replace(`${d}`,"MM").replace(`${b}`,"SS").replace(`${x}`,"LLL"),this.createDateParts()}get is24HourTime(){return this.use24HourTime}createInputFormat(){const t={deleteShiftsFormatPart:!1,formatParts:[]};switch(this.dateSelection){case we.DateOnly:return this.createDateFormat(t);case we.TimeOnly:return this.createTimeFormat(t);case we.DateRange:return this.createDateRangeFormat(t);case we.DateTime:return this.createDateTimeFormat(t)}}createDateFormat(t){return this.dateFormat.startsWith("MM")?t.formatParts.push(...this.createMonthDayYearFormatParts()):this.dateFormat.startsWith("DD")?t.formatParts.push(...this.createDayMonthYearFormatParts()):t.formatParts.push(...this.createYearMonthDayFormatParts()),t}createTimeFormat(t){return this.use24HourTime?t.formatParts.push(...this.createTwentyFourHourFormatParts()):t.formatParts.push(...this.createTwelveHourFormatParts()),t}createDateRangeFormat(t){const r=[];this.dateFormat.startsWith("MM")?r.push(...this.createMonthDayYearFormatParts()):this.dateFormat.startsWith("DD")?r.push(...this.createDayMonthYearFormatParts()):r.push(...this.createYearMonthDayFormatParts());const n={characterCount:3,placeholder:" - ",inputText:" - ",isSeparator:!0};return t.formatParts.push(...r,n,...r),t}createDateTimeFormat(t){this.dateFormat.startsWith("MM")?t.formatParts.push(...this.createMonthDayYearFormatParts()):this.dateFormat.startsWith("DD")?t.formatParts.push(...this.createDayMonthYearFormatParts()):t.formatParts.push(...this.createYearMonthDayFormatParts());const r={characterCount:1,placeholder:" ",inputText:" ",isSeparator:!0};return t.formatParts.push(r),this.use24HourTime?t.formatParts.push(...this.createTwentyFourHourFormatParts()):t.formatParts.push(...this.createTwelveHourFormatParts()),t}createMonthDayYearFormatParts(){if(this.monthPart&&this.dayPart&&this.yearPart){let t=this.dateFormat.replace("MM",""),r=t.indexOf("DD"),n=t.substring(0,r);t=t.replace(n,"").replace("DD","");const s={characterCount:n.length,placeholder:n,inputText:n,isSeparator:!0};r=t.indexOf("YYYY"),n=t.substring(0,r);const o={characterCount:n.length,placeholder:n,inputText:n,isSeparator:!0};return[this.monthPart,s,this.dayPart,o,this.yearPart]}return[]}createDayMonthYearFormatParts(){if(this.monthPart&&this.dayPart&&this.yearPart){let t=this.dateFormat.replace("DD",""),r=t.indexOf("MM"),n=t.substring(0,r);t=t.replace(n,"").replace("MM","");const s={characterCount:n.length,placeholder:n,inputText:n,isSeparator:!0};r=t.indexOf("YYYY"),n=t.substring(0,r);const o={characterCount:n.length,placeholder:n,inputText:n,isSeparator:!0};return[this.dayPart,s,this.monthPart,o,this.yearPart]}return[]}createYearMonthDayFormatParts(){if(this.monthPart&&this.dayPart&&this.yearPart){let t=this.dateFormat.replace("YYYY",""),r=t.indexOf("MM"),n=t.substring(0,r);t=t.replace(n,"").replace("MM","");const s={characterCount:n.length,placeholder:n,inputText:n,isSeparator:!0};r=t.indexOf("DD"),n=t.substring(0,r);const o={characterCount:n.length,placeholder:n,inputText:n,isSeparator:!0};return[this.yearPart,s,this.monthPart,o,this.dayPart]}return[]}createTwelveHourFormatParts(){if(this.twelveHourPart&&this.minutePart&&this.meridianPart){const t=this.timeFormat.replace("HH",""),r=t.indexOf("MM"),n=t.substring(0,r),s={characterCount:n.length,placeholder:n,inputText:n,isSeparator:!0},o={characterCount:1,placeholder:" ",inputText:" ",isSeparator:!0};return[this.twelveHourPart,s,this.minutePart,o,this.meridianPart]}return[]}createTwentyFourHourFormatParts(){if(this.twentyFourHourPart&&this.minutePart){const t=this.timeFormat.replace("HH",""),r=t.indexOf("MM"),n=t.substring(0,r),s={characterCount:n.length,placeholder:n,inputText:n,isSeparator:!0};return[this.twentyFourHourPart,s,this.minutePart]}return[]}createDateParts(){this.monthPart={characterCount:2,placeholder:"M",inputText:"_",isSeparator:!1,allCharactersRequired:!1,valueType:rt.Numeric,minimumValue:1,maximumValue:12,exceedingMaximumValueCausesTab:!0,padWithZeros:!0},this.dayPart={characterCount:2,placeholder:"D",inputText:"_",isSeparator:!1,allCharactersRequired:!1,valueType:rt.Numeric,minimumValue:1,maximumValue:31,exceedingMaximumValueCausesTab:!0,padWithZeros:!0},this.yearPart={characterCount:4,placeholder:"Y",inputText:"_",isSeparator:!1,allCharactersRequired:!0,valueType:rt.Numeric},this.twelveHourPart={characterCount:2,placeholder:"H",inputText:"_",isSeparator:!1,allCharactersRequired:!1,valueType:rt.Numeric,minimumValue:1,maximumValue:12,exceedingMaximumValueCausesTab:!0,padWithZeros:!0},this.twentyFourHourPart={characterCount:2,placeholder:"H",inputText:"_",isSeparator:!1,allCharactersRequired:!1,valueType:rt.Numeric,minimumValue:0,maximumValue:23,exceedingMaximumValueCausesTab:!0,padWithZeros:!0},this.minutePart={characterCount:2,placeholder:"M",inputText:"_",isSeparator:!1,allCharactersRequired:!1,valueType:rt.Numeric,minimumValue:0,maximumValue:59,exceedingMaximumValueCausesError:!0,padWithZeros:!0},this.meridianPart={characterCount:2,inputText:"_",isSeparator:!1,valueType:rt.Text,possibleValues:["AM","PM"]}}}const _p=(e,t)=>{var o;const[r,n]=h.useState(),s=h.useRef();return h.useEffect(()=>{t&&!r&&(s.current=new Dp(e,t),n(s.current.createInputFormat()))},[t]),[r,(o=s.current)==null?void 0:o.is24HourTime]},Np=({value:e,readOnly:t=!1,label:r,useDefaultDateValue:n=!1,useFormattedInput:s=!1,allowClear:o=!1,closeSelector:i=!1,locale:c,className:u,dateSelection:m=we.DateTime,dateFormat:d,timeConstraints:b,icon:x,iconPosition:l=Qr.Right,inputElement:f,selectableDate:p,isValidDate:w,onChange:v,onError:T,calendarTemplate:L,dateScrollerTemplate:I,inputTemplate:E,wrapperTemplate:Q})=>{const[M,$]=h.useState(!1),[F,se]=h.useState(),[ae,U]=h.useState(),[R,A,j]=Sa(m),q=h.useRef(),W=h.useRef(!1),ie=h.useRef(c||Ch()),Z=h.useRef(),k=h.useRef(),N=h.useRef(),D=h.useRef(null),C=h.useRef(null),[z,ee]=_p(m,F),Y=Mt.useDateLocale(ie.current),K=h.useRef({calendarTemplate:L,dateScrollerTemplate:I});h.useEffect(()=>{se(Y.code),Z.current=Y;const J=ne();O(e||n?{type:de.InitializeDates,initialDate:Array.isArray(J)?J[0]:J}:{type:de.SetViewDate,viewDate:Array.isArray(J)?J[0]:J})},[Y]),h.useEffect(()=>{if(e){const J=ne();O({type:de.InitializeDates,initialDate:J})}else O({type:de.ClearDates})},[e,Z.current]),h.useEffect(()=>{ee&&O({type:de.SetTimeFormat,timeFormat:ee?De.TwentyFourHour:De.TwelveHour})},[ee]),h.useEffect(()=>{f&&(k.current=f)},[f]),h.useEffect(()=>{O({type:de.SetDateSelector,dateSelector:G()})},[R]);const G=h.useCallback(()=>j.current===we.TimeOnly?Ie.TimeSelector:j.current===we.DateTime||j.current===we.DateOnly?Ie.DaySelector:Ie.DateRangeSelector,[]),ne=()=>{const J=new Date;return J.setHours(0,0,0,0),e?typeof e=="string"?j.current!==we.DateRange?Dr(e,Z.current):Qn(e,Z.current):e:J},re={currentSelector:G(),currentViewDate:new Date,timeFormat:De.TwelveHour,dateInitialized:!1},[V,O]=h.useReducer(Sp,re),_e=()=>{er(),$(!0)},He=h.useMemo(()=>wr(()=>{$(!1)},250),[]),Re=h.useMemo(()=>wr(()=>{He.cancel()},5),[He]),Le=J=>{const ue=J.target.innerText;We(ue)},nt=J=>{if(J){const ue=j.current!==we.DateRange?Dr(J,Z.current):Qn(J,Z.current);if(ue)if(w){const Be=Array.isArray(ue)?ue.every(Ke=>w(Ke)):w(ue);return!Be&&T&&T(ue),Be}else return!0;else return!1}else return!0},st=J=>{We(J||"")},We=J=>{const ue=j.current!==we.DateRange?Dr(J,Z.current):Qn(J,Z.current);ue?(Array.isArray(ue)?(wp(ue[0],Io(V.currentViewDate),yf(ht(V.currentViewDate,1)))||O({type:de.SetViewDate,viewDate:ue[0]}),O({type:de.SetSelectedDateRange,selectedStartDate:ue[0],selectedEndDate:ue[1]})):O({type:de.SetSelectedDate,selectedDate:ue,viewDate:ue}),v==null||v(ue)):J===""&&(O({type:de.ClearDates}),v==null||v())},Nr=J=>{j.current===we.DateOnly&&i===!0&&$(!1),v==null||v(J)},Jt=()=>{er(),$(!M),C.current?C.current.focus():D.current&&D.current.focus()},ot=()=>{O({type:de.ClearDates}),$(!1),v==null||v()},_t=(J,ue)=>{(!k.current||q.current!==ue)&&(k.current=J,q.current=ue,W.current=!0)},er=()=>{(!N.current||W.current)&&k.current&&(N.current=k.current,U(k.current),W.current=!1)},gt=()=>{$(!1),O({type:de.SetDateSelector,dateSelector:G()})},Nt=()=>{switch(d){case _r.Short:return"short";case _r.Medium:return"medium";case _r.Long:return"long";default:return}},it=()=>{var ue,Be,Ke,yt,sr,vt,or,xt,wt,ir,ar,St;const J=Nt();switch(j.current){case we.DateTime:return V.selectedDate?J?V.selectedDate.toLocaleString((ue=Z.current)==null?void 0:ue.code,{dateStyle:J,timeStyle:J}):V.selectedDate.toLocaleString((Be=Z.current)==null?void 0:Be.code):"";case we.DateOnly:return V.selectedDate?J?V.selectedDate.toLocaleDateString((Ke=Z.current)==null?void 0:Ke.code,{dateStyle:J}):V.selectedDate.toLocaleDateString((yt=Z.current)==null?void 0:yt.code):"";case we.TimeOnly:return V.selectedDate?J?V.selectedDate.toLocaleTimeString((sr=Z.current)==null?void 0:sr.code,{timeStyle:J,hour12:V.timeFormat===De.TwelveHour,hourCycle:V.timeFormat===De.TwentyFourHour?"h23":void 0}):V.selectedDate.toLocaleTimeString((vt=Z.current)==null?void 0:vt.code,{hour12:V.timeFormat===De.TwelveHour,hourCycle:V.timeFormat===De.TwentyFourHour?"h23":void 0}):"";case we.DateRange:return V.selectedStartDate&&V.selectedEndDate?J?`${V.selectedStartDate.toLocaleDateString((or=Z.current)==null?void 0:or.code,{dateStyle:J})} - ${V.selectedEndDate.toLocaleDateString((xt=Z.current)==null?void 0:xt.code,{dateStyle:J})}`:`${V.selectedStartDate.toLocaleDateString((wt=Z.current)==null?void 0:wt.code)} - ${V.selectedEndDate.toLocaleDateString((ir=Z.current)==null?void 0:ir.code)}`:"";default:return V.selectedDate?J?V.selectedDate.toLocaleString((ar=Z.current)==null?void 0:ar.code,{dateStyle:J,timeStyle:J}):V.selectedDate.toLocaleString((St=Z.current)==null?void 0:St.code):""}},bt=R===we.DateTime||R===we.DateOnly||R===we.DateRange,jt=R===we.DateTime||R===we.TimeOnly,Qe=l===Qr.None?{}:l===Qr.Right?{rightElement:y.jsxs("div",{className:"bsc:flex bsc:text-black bsc:dark:text-mono-light-1",children:[o&&!t&&y.jsx("div",{children:y.jsx(ze,{icon:"close",size:Ye.Small,className:"bsc:cursor-pointer bsc:text-sm",onClick:ot})}),y.jsx("div",{className:"bsc:ml-2",onClick:t?void 0:Jt,children:x||y.jsx(ze,{icon:"calendar",size:Ye.Small,className:t?void 0:"bsc:cursor-pointer"})})]}),rightElementClassName:"bsc:justify-center"}:{leftElement:y.jsxs("div",{className:"bsc:flex bsc:text-black bsc:dark:text-mono-light-1",children:[y.jsx("div",{className:"bsc:mr-2",onClick:t?void 0:Jt,children:x||y.jsx(ze,{icon:"calendar",size:Ye.Small,className:t?void 0:"bsc:cursor-pointer"})}),o&&!t&&y.jsx("div",{children:y.jsx(ze,{icon:"close",size:Ye.Small,className:"bsc:cursor-pointer bsc:text-sm",onClick:ot})})]}),leftElementClassName:"bsc:justify-center"},jr={setDateSelector:J=>A(J)},Ir=Q||((J,ue)=>y.jsx(y.Fragment,{children:ue})),tr=()=>y.jsx(Ct,{props:jr,template:Ir,children:y.jsxs(y.Fragment,{children:[V.currentSelector===Ie.DaySelector&&bt&&V.dateInitialized&&Z.current&&y.jsx(Tp,{selectedDate:V.selectedDate,viewDate:V.currentViewDate,locale:Z.current,showTimeSelector:j.current===we.DateTime,selectableDate:p,isValidDate:w,dispatcher:O,onChange:Nr}),V.currentSelector===Ie.MonthSelector&&bt&&V.dateInitialized&&Z.current&&y.jsx(Ep,{viewDate:V.currentViewDate,locale:Z.current,dateSelection:j.current,dispatcher:O}),V.currentSelector===Ie.YearSelector&&bt&&V.dateInitialized&&Z.current&&y.jsx(Op,{viewDate:V.currentViewDate,locale:Z.current,dispatcher:O}),V.currentSelector===Ie.TimeSelector&&jt&&V.dateInitialized&&Z.current&&y.jsx(Cp,{viewDate:V.currentViewDate,showDateSelector:j.current===we.DateTime,locale:Z.current,timeFormat:V.timeFormat,timeConstraints:b,onChange:v,dispatcher:O}),V.currentSelector===Ie.DateRangeSelector&&bt&&V.dateInitialized&&Z.current&&y.jsx(kp,{viewDate:V.currentViewDate,selectedStartDate:V.selectedStartDate,selectedEndDate:V.selectedEndDate,locale:Z.current,onChange:v,dispatcher:O})]})}),rr=Gn({label:r,readOnly:t,allowClear:o,getValue:it,onFocus:_e,onInput:Le,iconPosition:l,iconElement:Qe.rightElement||Qe.leftElement},V.currentViewDate,O),nr=E||((J,ue)=>y.jsx(y.Fragment,{children:ue})),Ge=he("bsc:text-left",{"bc-read-only bsc:bg-gray-4 bsc:dark:bg-mono-dark-3":t,"bsc:bg-white bsc:dark:bg-mono-dark-1":!t},"bc-dt-input",u);return y.jsx(Zn.Provider,{value:K.current,children:y.jsxs("div",{className:"bc-date-time",children:[r&&y.jsx(at,{label:r,readOnly:t,className:"bc-dt-label"}),y.jsx(Fn,{mobileMarkup:y.jsxs(y.Fragment,{children:[y.jsx(Ct,{props:rr,template:nr,children:y.jsx(Vr,{ref:D,value:it(),readOnly:t,inputMode:"none",className:Ge,onFocus:_e,onElementCreate:J=>_t(J,!1),...Qe})}),y.jsx(hi,{visible:M,target:ae,hidden:gt,unmountWhenHidden:!0,children:tr()})]}),aboveMobileMarkup:y.jsxs(y.Fragment,{children:[y.jsx(Ct,{props:rr,template:nr,children:s===!1?y.jsx(Vr,{ref:D,value:it(),readOnly:t,className:Ge,onFocus:_e,onBlur:He,onInput:Le,onElementCreate:J=>_t(J,!1),...Qe}):y.jsx(xi,{ref:C,value:it(),readOnly:t,className:Ge,format:z,isInputValid:nt,onFocus:_e,onBlur:He,onChange:st,onElementCreate:J=>_t(J,!0),...Qe})}),y.jsx(gi,{visible:M,target:ae,shouldTargetCloseOverlay:!1,shouldScrollCloseOverlay:!0,shouldCheckZIndex:!0,shouldRemainOnScreen:!0,hidden:gt,isClickedWithin:Re,unmountWhenHidden:!0,children:tr()})]})})]})})};var Xn,Pi;function jp(){if(Pi)return Xn;Pi=1;function e(l,f){var p,w;if(typeof f=="function")w=f(l),w!==void 0&&(l=w);else if(Array.isArray(f))for(p=0;p<f.length;p++)w=f[p](l),w!==void 0&&(l=w);return l}function t(l,f){return l[0]==="-"&&Array.isArray(f)&&/^-\d+$/.test(l)?f.length+parseInt(l,10):l}function r(l){return/^\d+$/.test(l)}function n(l){return Object.prototype.toString.call(l)==="[object Object]"}function s(l){return Object(l)===l}function o(l){return Object.keys(l).length===0}var i=["__proto__","prototype","constructor"],c=function(l){return i.indexOf(l)===-1};function u(l,f){l.indexOf("[")>=0&&(l=l.replace(/\[/g,f).replace(/]/g,""));var p=l.split(f),w=p.filter(c);if(w.length!==p.length)throw Error("Refusing to update blacklisted property "+l);return p}var m=Object.prototype.hasOwnProperty;function d(l,f,p,w){if(!(this instanceof d))return new d(l,f,p,w);typeof f>"u"&&(f=!1),typeof p>"u"&&(p=!0),typeof w>"u"&&(w=!0),this.separator=l||".",this.override=f,this.useArray=p,this.useBrackets=w,this.keepArray=!1,this.cleanup=[]}var b=new d(".",!1,!0,!0);function x(l){return function(){return b[l].apply(b,arguments)}}return d.prototype._fill=function(l,f,p,w){var v=l.shift();if(l.length>0){if(f[v]=f[v]||(this.useArray&&r(l[0])?[]:{}),!s(f[v]))if(this.override)f[v]={};else{if(!(s(p)&&o(p)))throw new Error("Trying to redefine `"+v+"` which is a "+typeof f[v]);return}this._fill(l,f[v],p,w)}else{if(!this.override&&s(f[v])&&!o(f[v])){if(!(s(p)&&o(p)))throw new Error("Trying to redefine non-empty obj['"+v+"']");return}f[v]=e(p,w)}},d.prototype.object=function(l,f){var p=this;return Object.keys(l).forEach(function(w){var v=f===void 0?null:f[w],T=u(w,p.separator).join(p.separator);T.indexOf(p.separator)!==-1?(p._fill(T.split(p.separator),l,l[w],v),delete l[w]):l[w]=e(l[w],v)}),l},d.prototype.str=function(l,f,p,w){var v=u(l,this.separator).join(this.separator);return l.indexOf(this.separator)!==-1?this._fill(v.split(this.separator),p,f,w):p[l]=e(f,w),p},d.prototype.pick=function(l,f,p,w){var v,T,L,I,E;for(T=u(l,this.separator),v=0;v<T.length;v++)if(I=t(T[v],f),f&&typeof f=="object"&&I in f){if(v===T.length-1)return p?(L=f[I],w&&Array.isArray(f)?f.splice(I,1):delete f[I],Array.isArray(f)&&(E=T.slice(0,-1).join("."),this.cleanup.indexOf(E)===-1&&this.cleanup.push(E)),L):f[I];f=f[I]}else return;return p&&Array.isArray(f)&&(f=f.filter(function(Q){return Q!==void 0})),f},d.prototype.delete=function(l,f){return this.remove(l,f,!0)},d.prototype.remove=function(l,f,p){var w;if(this.cleanup=[],Array.isArray(l)){for(w=0;w<l.length;w++)this.pick(l[w],f,!0,p);return p||this._cleanup(f),f}else return this.pick(l,f,!0,p)},d.prototype._cleanup=function(l){var f,p,w,v;if(this.cleanup.length){for(p=0;p<this.cleanup.length;p++)w=this.cleanup[p].split("."),v=w.splice(0,-1).join("."),f=v?this.pick(v,l):l,f=f[w[0]].filter(function(T){return T!==void 0}),this.set(this.cleanup[p],f,l);this.cleanup=[]}},d.prototype.del=d.prototype.remove,d.prototype.move=function(l,f,p,w,v){return typeof w=="function"||Array.isArray(w)?this.set(f,e(this.pick(l,p,!0),w),p,v):(v=w,this.set(f,this.pick(l,p,!0),p,v)),p},d.prototype.transfer=function(l,f,p,w,v,T){return typeof v=="function"||Array.isArray(v)?this.set(f,e(this.pick(l,p,!0),v),w,T):(T=v,this.set(f,this.pick(l,p,!0),w,T)),w},d.prototype.copy=function(l,f,p,w,v,T){return typeof v=="function"||Array.isArray(v)?this.set(f,e(JSON.parse(JSON.stringify(this.pick(l,p,!1))),v),w,T):(T=v,this.set(f,this.pick(l,p,!1),w,T)),w},d.prototype.set=function(l,f,p,w){var v,T,L,I;if(typeof f>"u")return p;for(L=u(l,this.separator),v=0;v<L.length;v++){if(I=L[v],v===L.length-1)if(w&&n(f)&&n(p[I]))for(T in f)m.call(f,T)&&(p[I][T]=f[T]);else if(w&&Array.isArray(p[I])&&Array.isArray(f))for(var E=0;E<f.length;E++)p[L[v]].push(f[E]);else p[I]=f;else(!m.call(p,I)||!n(p[I])&&!Array.isArray(p[I]))&&(/^\d+$/.test(L[v+1])?p[I]=[]:p[I]={});p=p[I]}return p},d.prototype.transform=function(l,f,p){return f=f||{},p=p||{},Object.keys(l).forEach((function(w){this.set(l[w],this.pick(w,f),p)}).bind(this)),p},d.prototype.dot=function(l,f,p){f=f||{},p=p||[];var w=Array.isArray(l);return Object.keys(l).forEach((function(v){var T=w&&this.useBrackets?"["+v+"]":v;if(s(l[v])&&(n(l[v])&&!o(l[v])||Array.isArray(l[v])&&!this.keepArray&&l[v].length!==0))if(w&&this.useBrackets){var L=p[p.length-1]||"";return this.dot(l[v],f,p.slice(0,-1).concat(L+T))}else return this.dot(l[v],f,p.concat(T));else w&&this.useBrackets?f[p.join(this.separator).concat("["+v+"]")]=l[v]:f[p.concat(T).join(this.separator)]=l[v]}).bind(this)),f},d.pick=x("pick"),d.move=x("move"),d.transfer=x("transfer"),d.transform=x("transform"),d.copy=x("copy"),d.object=x("object"),d.str=x("str"),d.set=x("set"),d.delete=x("delete"),d.del=d.remove=x("remove"),d.dot=x("dot"),["override","overwrite"].forEach(function(l){Object.defineProperty(d,l,{get:function(){return b.override},set:function(f){b.override=!!f}})}),["useArray","keepArray","useBrackets"].forEach(function(l){Object.defineProperty(d,l,{get:function(){return b[l]},set:function(f){b[l]=f}})}),d._process=e,Xn=d,Xn}var Ip=jp();const Ti=tn(Ip),Mp=({name:e,label:t,value:r,data:n,textField:s,valueField:o,readOnly:i=!1,orientation:c=Ae.Horizontal,isMultiSelect:u=!1,className:m,onChange:d,itemTemplate:b})=>{const[x,l]=h.useState(),[f,p]=h.useState([]),w=bn(()=>n,[n]),v=h.useId();h.useEffect(()=>{if(u){const U=Array.isArray(r)?r.map(R=>R.toString()):r?[String(r)]:void 0;p(U??[])}else r&&l(r.toString())},[r]);const T=U=>u?f.findIndex(R=>R===U)>-1:x===U,L=U=>{const R=U.toString();if(u){const A=T(R);let j;A?j=f.filter(q=>q!=R):j=[...f,R],p(j),d==null||d({name:e,value:j})}else R!==x&&(l(R),d==null||d({name:e,value:R}))},I=U=>{Array.isArray(U==null?void 0:U.value)?p((U==null?void 0:U.value)??[]):l(U==null?void 0:U.value),d==null||d(U)},E=dr(Rt.FocusWithin),Q=h.useCallback((U,R)=>y.jsx(y.Fragment,{children:R}),[]),M=b||Q,$=(U,R,A)=>{const j=`element_${v}_${R}`,q=Ti.pick(s,U),W=String(Ti.pick(o,U)),ie=R===0,Z=R===A.length-1,k=he("bc-group-button-item bsc:cursor-pointer bsc:border-solid bsc:p-2 bsc:font-medium",{"bsc:has-data-checked:bg-primary-1 bsc:dark:has-data-checked:bg-mono-light-1 bsc:has-data-checked:text-white bsc:dark:has-data-checked:text-mono-dark-1 bsc:dark:text-mono-light-1 bsc:text-gray-2 bsc:border-gray-3 bsc:dark:border-mono-light-2":!i,"bc-read-only bsc:has-data-checked:bg-primary-4 bsc:dark:has-data-checked:bg-mono-light-3 bsc:has-data-checked:text-gray-5 bsc:dark:has-data-checked:text-mono-dark-3 bsc:dark:text-mono-light-3 bsc:text-gray-3 bsc:border-gray-4 bsc:dark:border-mono-light-3 bsc:pointer-events-none":i,"bsc:border-t bsc:border-l bsc:border-b bsc:rounded-l-md bsc:pl-2":ie&&c===Ae.Horizontal,"bsc:border-t bsc:border-r bsc:border-l bsc:border-b bsc:rounded-r-md bsc:pr-2":Z&&c===Ae.Horizontal,"bsc:border-t bsc:border-b":!ie&&!Z&&c===Ae.Horizontal,"bsc:border-l":!ie&&c===Ae.Horizontal,"bsc:border-l bsc:border-r bsc:border-t bsc:rounded-t-md":ie&&c===Ae.Vertical,"bsc:border bsc:rounded-b-md":Z&&c===Ae.Vertical,"bsc:border-t bsc:border-l bsc:border-r":!ie&&!Z&&c===Ae.Vertical},E),N={itemId:j,selectedValue:u?f:x,itemText:q,itemValue:W,itemData:U,itemStyles:k,isSelected:T(W),isFirstItem:ie,isLastItem:Z,onItemChanged:L};return u?y.jsx(Ct,{props:N,template:M,children:y.jsx(Yt,{className:k,children:y.jsx(js,{value:W,className:"bsc:block bsc:w-full bsc:cursor-pointer",children:q})})},j):y.jsx(Ct,{props:N,template:M,children:y.jsx(Yt,{className:k,children:y.jsx($s,{value:W,className:"bsc:block bsc:w-full bsc:cursor-pointer",children:q})})},j)},F=he("bsc:flex bsc:flex-col bsc:gap-2",m),se=he("bsc:flex",{"bsc:flex-col bsc:w-max":c===Ae.Vertical}),ae=U=>u?y.jsx(Rs,{name:e,value:f,readOnly:i,onChange:I,className:se,children:U.map($)}):y.jsx(Fs,{name:e,value:x,readOnly:i,onChange:I,className:se,children:U.map($)});return y.jsxs(Yt,{className:F,children:[t&&y.jsx(at,{label:t,readOnly:i}),w&&ae(w)]})},Rp=h.memo(Mp),Lp=({name:e,label:t,value:r,data:n,textField:s,valueField:o,readOnly:i=!1,labelLocation:c=qe.Right,orientation:u=Ae.Vertical,className:m,useAnimation:d,onChange:b})=>{const x=bn(()=>n,[n]),l=h.useId(),f=pn(d),p=dr(Rt.FocusWithin),w=he("bc-radio-container bsc:flex bsc:flex-col bsc:gap-1",m),v=he("bc-radio-wrapper bsc:flex bsc:gap-1",{"bsc:flex-col":u===Ae.Vertical,"bsc:*:pr-2":u===Ae.Horizontal}),T=he("bc-radio-item-wrapper bsc:flex bsc:items-center bsc:*:cursor-pointer",{"bc-read-only":i}),L=he("bc-radio-item bsc:group bsc:relative bsc:*:size-[21px] bsc:rounded-full",{"bsc:ml-2":c===qe.Left,"bsc:mr-2":c===qe.Right,"bc-read-only":i},p),I=he("bc-radio-item-svg bsc:stroke-2 bsc:fill-none bsc:rounded-full bsc:stroke-gray-1 bsc:dark:stroke-mono-light-2 bsc:group-data-read-only:stroke-gray-4 bsc:dark:group-data-read-only:stroke-mono-light-3"),E=he("bsc:group-data-checked:fill-primary-1 bsc:dark:group-data-checked:fill-mono-light-2 bsc:group-data-checked:group-data-read-only:fill-primary-4 bsc:dark:group-data-checked:group-data-read-only:fill-mono-light-3",{"bsc:group-data-checked:animate-bounce":!i&&f}),Q=he("bsc:invisible bsc:group-data-checked:visible bsc:group-data-checked:fill-white bsc:dark:group-data-checked:fill-mono-dark-1",{"bsc:group-data-checked:animate-bounce":!i&&f}),M=($,F)=>{const se=$[s],ae=$[o];return y.jsxs(Yt,{className:T,children:[c===qe.Left&&y.jsx(at,{label:se,readOnly:i}),y.jsx($s,{value:ae,className:L,children:y.jsxs("svg",{viewBox:"0 0 30 30",preserveAspectRatio:"xMidYMid meet",className:I,children:[y.jsx("circle",{cx:15,cy:15,r:15,className:E}),y.jsx("circle",{cx:"50%",cy:"50%",r:7,className:Q})]})}),c===qe.Right&&y.jsx(at,{label:se,readOnly:i})]},`radio_${l}_item${F}`)};return y.jsxs("div",{className:w,children:[t&&y.jsx(at,{label:t,readOnly:i}),y.jsx(Fs,{name:e,value:r,readOnly:i,onChange:b,className:v,children:x&&x.map(M)})]})},Ap=h.memo(Lp),Fp=({name:e,label:t,value:r,checked:n=!1,readOnly:s=!1,useAnimation:o,className:i,onChange:c})=>{const u=pn(o),m=he("bc-toggle-wrapper bsc:flex bsc:flex-col",i),d=dr(Rt.FocusWithin),b=he("bc-toggle-container bsc:group bsc:flex bsc:mt-0.5 bsc:relative bsc:w-[60px] bsc:h-[26px] bsc:rounded-full bsc:[transition:background-color_1s]",{"bsc:cursor-pointer bsc:bg-gray-3 bsc:dark:bg-mono-dark-3 bsc:has-checked:bg-primary-1 bsc:dark:has-checked:bg-mono-light-2":!s,"bc-read-only bsc:pointer-events-none bsc:bg-gray-4 bsc:dark:bg-mono-dark-2 bsc:has-checked:bg-primary-4 bsc:dark:has-checked:bg-mono-light-3":s},d),x=he("bc-toggle-switch bsc:absolute bsc:rounded-full bsc:dark:border bsc:dark:border-solid bsc:dark:border-mono-dark-1 bsc:group-data-toggled:translate-x-[35px] bsc:w-[18px] bsc:h-[18px] bsc:top-[4px] bsc:left-[4px]",{"bsc:bg-white bsc:cursor-pointer":!s,"bc-read-only bsc:bg-gray-5 bsc:pointer-events-none":s,"bsc:[transition:0.3s]":!s&&u});return y.jsxs(Yt,{className:m,children:[t&&y.jsx(at,{label:t,readOnly:s}),y.jsx(ma,{name:e,value:r,toggled:n,onChange:c,className:b,children:y.jsx("div",{className:x})})]})},$p=h.memo(Fp);oe.BeeSoftProvider=Di,oe.Button=Xe,oe.Checkbox=Ys,oe.CheckboxGroup=Ta,oe.ContentEditableInput=Vr,oe.DateFormatType=_r,oe.DateScrollerType=Xt,oe.DateSelectionType=we,oe.DateTime=Np,oe.FormGroupItemOrientation=Ae,oe.FormattedInput=xi,oe.GroupButton=Rp,oe.MediaQuery=Fn,oe.MobileOverlayPanel=hi,oe.OverlayPanel=gi,oe.RadioButton=Ap,oe.SelectionLabelLocation=qe,oe.Toggle=$p,oe.applyBeeSoftTheme=Ih,oe.createBeeSoftTheme=Mh,Object.defineProperty(oe,Symbol.toStringTag,{value:"Module"})});
6
+ <%s key={someKey} {...props} />`,q,ut,Ot,ut),Z[ut+q]=!0)}if(ut=null,M!==void 0&&(n(M),ut=""+M),o(k)&&(n(k.key),ut=""+k.key),"key"in k){M={};for(var ce in k)ce!=="key"&&(M[ce]=k[ce])}else M=k;return ut&&a(M,typeof x=="function"?x.displayName||x.name||"Unknown":x),l(x,ut,M,s(),Dt,Zt)}function h(x){d(x)?x._store&&(x._store.validated=1):typeof x=="object"&&x!==null&&x.$$typeof===E&&(x._payload.status==="fulfilled"?d(x._payload.value)&&x._payload.value._store&&(x._payload.value._store.validated=1):x._store&&(x._store.validated=1))}function d(x){return typeof x=="object"&&x!==null&&x.$$typeof===p}var f=m,p=Symbol.for("react.transitional.element"),g=Symbol.for("react.portal"),y=Symbol.for("react.fragment"),b=Symbol.for("react.strict_mode"),w=Symbol.for("react.profiler"),S=Symbol.for("react.consumer"),T=Symbol.for("react.context"),P=Symbol.for("react.forward_ref"),D=Symbol.for("react.suspense"),A=Symbol.for("react.suspense_list"),C=Symbol.for("react.memo"),E=Symbol.for("react.lazy"),j=Symbol.for("react.activity"),R=Symbol.for("react.client.reference"),F=f.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,B=Object.prototype.hasOwnProperty,N=Array.isArray,I=console.createTask?console.createTask:function(){return null};f={react_stack_bottom_frame:function(x){return x()}};var W,L={},H=f.react_stack_bottom_frame.bind(f,i)(),V=I(r(i)),Z={};An.Fragment=y,An.jsx=function(x,k,M){var q=1e4>F.recentlyCreatedOwnerStacks++;return u(x,k,M,!1,q?Error("react-stack-top-frame"):H,q?I(r(x)):V)},An.jsxs=function(x,k,M){var q=1e4>F.recentlyCreatedOwnerStacks++;return u(x,k,M,!0,q?Error("react-stack-top-frame"):H,q?I(r(x)):V)}})()),An}var xi;function Ll(){return xi||(xi=1,process.env.NODE_ENV==="production"?hr.exports=Ol():hr.exports=Vl()),hr.exports}var xt=Ll();function Fl(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Si,Ti;function _l(){return Ti||(Ti=1,Si=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t=="object"&&typeof n=="object"){if(t.constructor!==n.constructor)return!1;var r,s,i;if(Array.isArray(t)){if(r=t.length,r!=n.length)return!1;for(s=r;s--!==0;)if(!e(t[s],n[s]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(i=Object.keys(t),r=i.length,r!==Object.keys(n).length)return!1;for(s=r;s--!==0;)if(!Object.prototype.hasOwnProperty.call(n,i[s]))return!1;for(s=r;s--!==0;){var o=i[s];if(!e(t[o],n[o]))return!1}return!0}return t!==t&&n!==n}),Si}var jl=_l();const Bl=Fl(jl),Hl=()=>{throw new Error("useEvent should not be called before the component is mounted")},Xe=e=>{const t=m.useRef(Hl);m.useInsertionEffect(()=>{t.current=e},[e]);const n=m.useRef(null);return n.current||(n.current=function(){return t.current?.apply(this,arguments)}),n.current},Pi=e=>{const t=m.useRef(void 0);let n=!1;t.current!==void 0&&(n=!Bl(t.current,e));const r={changed:n,previousValue:t.current};return t.current=e,r},$l=e=>typeof e=="function",Wl=e=>{const[t,n]=m.useState({value:e,initial:!0}),r=m.useRef(e);return[t,s=>{if(!$l(s))n({value:s,initial:!1});else{const i=s(r.current);r.current=i,n({value:i,initial:!1})}}]},Yl=e=>{const[t,n]=Wl(e),r=m.useRef({value:e,initial:!0});return r.current!==t&&(r.current=t),[t,n,r]},Ci=m.createContext(void 0),Nn=()=>m.useContext(Ci),fr=({id:e,name:t,value:n,type:r,checked:s,readOnly:i,onChange:o})=>xt.jsx("input",{id:e,name:t,value:n,type:r,checked:s,onChange:o,readOnly:i,disabled:i,className:"bsh:appearance-none! bsh:absolute! bsh:left-[-1000px]!"});function Rl(e){const t=Object.keys(e),n={};for(let r=0,s=t.length;r<s;r++){const i=t[r];if(i){const o=e[i],a=i.replace(/([A-Z])/g,c=>`-${c.toLowerCase()}`);typeof o=="boolean"?o&&(n[`data-${a}`]=!0):n[`data-${a}`]=e[i]}}return n}const Ze=({wrapperElement:e,renderProps:t,elementProps:n,innerWrapperElement:r,className:s,children:i})=>{if(typeof i=="function")return r?xt.jsxs(xt.Fragment,{children:[r,i(t)]}):i(t);{const o=r?xt.jsxs(xt.Fragment,{children:[r,i]}):i;return m.createElement(e,Object.assign({},t?Rl(t):{},n,{className:s}),o)}};var Ul=Symbol.for("preact-signals");function dr(){if(xe>1)xe--;else{for(var e,t=!1;Qe!==void 0;){var n=Qe;for(Qe=void 0,pr++;n!==void 0;){var r=n.o;if(n.o=void 0,n.f&=-3,!(8&n.f)&&Ei(n))try{n.c()}catch(s){t||(e=s,t=!0)}n=r}}if(pr=0,xe--,t)throw e}}var X=void 0;function ki(e){var t=X;X=void 0;try{return e()}finally{X=t}}var Qe=void 0,xe=0,pr=0,In=0;function Di(e){if(X!==void 0){var t=e.n;if(t===void 0||t.t!==X)return t={i:0,S:e,p:X.s,n:void 0,t:X,e:void 0,x:void 0,r:t},X.s!==void 0&&(X.s.n=t),X.s=t,e.n=t,32&X.f&&e.S(t),t;if(t.i===-1)return t.i=0,t.n!==void 0&&(t.n.p=t.p,t.p!==void 0&&(t.p.n=t.n),t.p=X.s,t.n=void 0,X.s.n=t,X.s=t),t}}function St(e,t){this.v=e,this.i=0,this.n=void 0,this.t=void 0,this.W=t?.watched,this.Z=t?.unwatched,this.name=t?.name}St.prototype.brand=Ul,St.prototype.h=function(){return!0},St.prototype.S=function(e){var t=this,n=this.t;n!==e&&e.e===void 0&&(e.x=n,this.t=e,n!==void 0?n.e=e:ki(function(){var r;(r=t.W)==null||r.call(t)}))},St.prototype.U=function(e){var t=this;if(this.t!==void 0){var n=e.e,r=e.x;n!==void 0&&(n.x=r,e.e=void 0),r!==void 0&&(r.e=n,e.x=void 0),e===this.t&&(this.t=r,r===void 0&&ki(function(){var s;(s=t.Z)==null||s.call(t)}))}},St.prototype.subscribe=function(e){var t=this;return gr(function(){var n=t.value,r=X;X=void 0;try{e(n)}finally{X=r}},{name:"sub"})},St.prototype.valueOf=function(){return this.value},St.prototype.toString=function(){return this.value+""},St.prototype.toJSON=function(){return this.value},St.prototype.peek=function(){var e=X;X=void 0;try{return this.value}finally{X=e}},Object.defineProperty(St.prototype,"value",{get:function(){var e=Di(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(pr>100)throw new Error("Cycle detected");this.v=e,this.i++,In++,xe++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{dr()}}}});function zl(e,t){return new St(e,t)}function Ei(e){for(var t=e.s;t!==void 0;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function Mi(e){for(var t=e.s;t!==void 0;t=t.n){var n=t.S.n;if(n!==void 0&&(t.r=n),t.S.n=t,t.i=-1,t.n===void 0){e.s=t;break}}}function Ai(e){for(var t=e.s,n=void 0;t!==void 0;){var r=t.p;t.i===-1?(t.S.U(t),r!==void 0&&(r.n=t.n),t.n!==void 0&&(t.n.p=r)):n=t,t.S.n=t.r,t.r!==void 0&&(t.r=void 0),t=r}e.s=n}function Se(e,t){St.call(this,void 0),this.x=e,this.s=void 0,this.g=In-1,this.f=4,this.W=t?.watched,this.Z=t?.unwatched,this.name=t?.name}Se.prototype=new St,Se.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===In))return!0;if(this.g=In,this.f|=1,this.i>0&&!Ei(this))return this.f&=-2,!0;var e=X;try{Mi(this),X=this;var t=this.x();(16&this.f||this.v!==t||this.i===0)&&(this.v=t,this.f&=-17,this.i++)}catch(n){this.v=n,this.f|=16,this.i++}return X=e,Ai(this),this.f&=-2,!0},Se.prototype.S=function(e){if(this.t===void 0){this.f|=36;for(var t=this.s;t!==void 0;t=t.n)t.S.S(t)}St.prototype.S.call(this,e)},Se.prototype.U=function(e){if(this.t!==void 0&&(St.prototype.U.call(this,e),this.t===void 0)){this.f&=-33;for(var t=this.s;t!==void 0;t=t.n)t.S.U(t)}},Se.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var e=this.t;e!==void 0;e=e.x)e.t.N()}},Object.defineProperty(Se.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var e=Di(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});function Ni(e){var t=e.u;if(e.u=void 0,typeof t=="function"){xe++;var n=X;X=void 0;try{t()}catch(r){throw e.f&=-2,e.f|=8,mr(e),r}finally{X=n,dr()}}}function mr(e){for(var t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,Ni(e)}function Kl(e){if(X!==this)throw new Error("Out-of-order effect");Ai(this),X=e,this.f&=-2,8&this.f&&mr(this),dr()}function Te(e,t){this.x=e,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32,this.name=t?.name}Te.prototype.c=function(){var e=this.S();try{if(8&this.f||this.x===void 0)return;var t=this.x();typeof t=="function"&&(this.u=t)}finally{e()}},Te.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,Ni(this),Mi(this),xe++;var e=X;return X=this,Kl.bind(this,e)},Te.prototype.N=function(){2&this.f||(this.f|=2,this.o=Qe,Qe=this)},Te.prototype.d=function(){this.f|=8,1&this.f||mr(this)},Te.prototype.dispose=function(){this.d()};function gr(e,t){var n=new Te(e,t);try{n.c()}catch(s){throw n.d(),s}var r=n.d.bind(n);return r[Symbol.dispose]=r,r}var yr={exports:{}},br={},Ii;function Gl(){if(Ii)return br;Ii=1;var e=m;function t(h,d){return h===d&&(h!==0||1/h===1/d)||h!==h&&d!==d}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,s=e.useEffect,i=e.useLayoutEffect,o=e.useDebugValue;function a(h,d){var f=d(),p=r({inst:{value:f,getSnapshot:d}}),g=p[0].inst,y=p[1];return i(function(){g.value=f,g.getSnapshot=d,c(g)&&y({inst:g})},[h,f,d]),s(function(){return c(g)&&y({inst:g}),h(function(){c(g)&&y({inst:g})})},[h]),o(f),f}function c(h){var d=h.getSnapshot;h=h.value;try{var f=d();return!n(h,f)}catch{return!0}}function l(h,d){return d()}var u=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?l:a;return br.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:u,br}var Oi={},Vi;function ql(){return Vi||(Vi=1,process.env.NODE_ENV!=="production"&&(function(){function e(f,p){return f===p&&(f!==0||1/f===1/p)||f!==f&&p!==p}function t(f,p){u||s.startTransition===void 0||(u=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var g=p();if(!h){var y=p();i(g,y)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),h=!0)}y=o({inst:{value:g,getSnapshot:p}});var b=y[0].inst,w=y[1];return c(function(){b.value=g,b.getSnapshot=p,n(b)&&w({inst:b})},[f,g,p]),a(function(){return n(b)&&w({inst:b}),f(function(){n(b)&&w({inst:b})})},[f]),l(g),g}function n(f){var p=f.getSnapshot;f=f.value;try{var g=p();return!i(f,g)}catch{return!0}}function r(f,p){return p()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var s=m,i=typeof Object.is=="function"?Object.is:e,o=s.useState,a=s.useEffect,c=s.useLayoutEffect,l=s.useDebugValue,u=!1,h=!1,d=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?r:t;Oi.useSyncExternalStore=s.useSyncExternalStore!==void 0?s.useSyncExternalStore:d,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),Oi}var Li;function Xl(){return Li||(Li=1,process.env.NODE_ENV==="production"?yr.exports=Gl():yr.exports=ql()),yr.exports}var Zl=Xl(),Ql=m.version.split(".").map(Number)[0],Fi=[],Jl=Symbol.for(Ql>=19?"react.transitional.element":"react.element"),le,_i=Symbol.dispose||Symbol.for("Symbol.dispose");function vr(e,t){var n=t.effect.S();return le=t,th.bind(t,e,n)}function th(e,t){t(),le=e}var ji,wr,Bi=function(){},eh=((ji={o:0,effect:{s:void 0,c:function(){},S:function(){return Bi},d:function(){}},subscribe:function(){return Bi},getSnapshot:function(){return 0},S:function(){},f:function(){}})[_i]=function(){},ji),nh=Promise.prototype.then.bind(Promise.resolve());function rh(){wr||(wr=nh(sh))}function sh(){var e;wr=void 0,(e=le)==null||e.f()}function ih(e){rh();var t=m.useRef();t.current==null&&(typeof window>"u"?t.current=eh:t.current=(function(r){var s,i,o,a,c=0,l=gr(function(){i=this});return i.c=function(){c=c+1|0,a&&a()},(s={o:r,effect:i,subscribe:function(u){return a=u,function(){c=c+1|0,a=void 0,l()}},getSnapshot:function(){return c},S:function(){if(le!=null){var u=le.o,h=this.o;u==0&&h==0||u==0&&h==1?(le.f(),o=vr(void 0,this)):u==1&&h==0||u==2&&h==0||(o=vr(le,this))}else o=vr(void 0,this)},f:function(){var u=o;o=void 0,u?.()}})[_i]=function(){this.f()},s})(e));var n=t.current;return Zl.useSyncExternalStore(n.subscribe,n.getSnapshot,n.getSnapshot),n.S(),n}Object.defineProperties(St.prototype,{$$typeof:{configurable:!0,value:Jl},type:{configurable:!0,value:function(e){var t=e.data,n=ih(1);try{return t.value}finally{n.f()}}},props:{configurable:!0,get:function(){return{data:this}}},ref:{configurable:!0,value:null}});function Qt(e,t){return m.useMemo(function(){return zl(e,t)},Fi)}function Pe(e,t){var n=m.useRef(e);n.current=e,m.useEffect(function(){return gr(function(){return n.current()},t)},Fi)}const Hi=m.createContext(void 0),$i=()=>m.useContext(Hi),oh=(e,t)=>{const{name:n,value:r,checked:s=!1,partial:i=!1,readOnly:o=!1,onChange:a,children:c,className:l}=e,[u,h]=m.useState(n),[d,f]=m.useState(o),p=m.useRef(void 0),g=m.useRef(void 0),y=m.useRef(void 0),b=m.useRef(void 0),w=m.useRef(void 0),S=m.useRef(void 0),T=$i(),P=Nn(),D=m.useId(),A=m.useMemo(()=>P?.sharedId||e.id||D,[P?.sharedId,e.id,D]),[C,E,j]=Yl({checked:!1,partial:!1}),R=Pi(s),F=Pi(i);m.useEffect(()=>{if(C.initial)E({checked:i?!1:s,partial:i});else{const L=R.changed?s:C.value.checked,H=F.changed?i:C.value.partial;E({checked:H?!1:L,partial:H})}},[s,i]),m.useEffect(()=>{f(o)},[o]),m.useEffect(()=>{T&&(p.current=T.nameSignal,g.current=T.valueSignal,y.current=T.readOnlySignal,b.current=T.useComparator,w.current=T.compare,S.current=T.onCheckboxChange)},[T]),Pe(()=>{if(g.current)if(b.current?.value&&w.current){const L=w.current,H=g.current.value?.some(V=>L(r,V))??!1;E(V=>({...V,checked:H}))}else{const L=g.current.value?.some(H=>r===H)??!1;E(H=>({...H,checked:L}))}}),Pe(()=>{p.current&&h(p.current.value)}),Pe(()=>{y.current&&f(y.current.value??!1)});const B=Xe(L=>{const H=j.current?.value.partial===!0?!0:L.target.checked;E({checked:H,partial:!1}),S.current?S.current({originalEvent:L,name:u,value:r,checked:H}):a?.({originalEvent:L,name:u,value:r,checked:H})}),N=L=>{const H={checked:L?!1:j.current?.value.checked??!1,partial:L};E(H)},I=L=>{E({checked:L,partial:!1})};m.useImperativeHandle(t,()=>({setPartiallyChecked:N,setChecked:I}));const W=u&&xt.jsx(fr,{id:A,name:u,type:"checkbox",checked:C.value.checked,readOnly:d,onChange:B});return Ze({wrapperElement:"label",renderProps:{...C.value,readOnly:d},elementProps:{htmlFor:A},className:l,innerWrapperElement:W,children:c})},Wi=m.memo(m.forwardRef(oh)),ah=(e,t)=>e&&t&&typeof e=="object"&&typeof t=="object"&&"value"in e&&"value"in t?e.value===t.value:e===t,Yi=(e=ah)=>Xe((t,n)=>{if(typeof e=="string"){const r=e;return t?.[r]===n?.[r]}return e(t,n)}),Ri=({props:e,children:t})=>xt.jsx(Hi.Provider,{value:e,children:t}),ch=({name:e,value:t,comparator:n,readOnly:r=!1,onChange:s,className:i,children:o})=>{const a=Qt(),c=Qt(),l=Qt(),u=Qt(),h=Yi(n),d=Xe(p=>{if(p){const{checked:g}=p,y=p.value;if(c.value)if(n)if(g)c.value.findIndex(b=>h(y,b))===-1&&c.value.push(y);else{const b=c.value.filter(w=>!h(y,w));c.value=[...b]}else if(g)c.value.indexOf(y)===-1&&c.value.push(y);else{const b=c.value.filter(w=>w!==y);c.value=[...b]}else g&&(c.value=[y])}s?.({originalEvent:p?.originalEvent,name:e,value:c.value})}),f=m.useMemo(()=>({nameSignal:a,valueSignal:c,readOnlySignal:l,useComparator:u,compare:h,onCheckboxChange:d}),[]);return m.useEffect(()=>{a.value=e},[e]),m.useEffect(()=>{c.value=t},[t]),m.useEffect(()=>{l.value=r},[r]),m.useEffect(()=>{u.value=n!==void 0},[n]),xt.jsx("div",{className:i,children:xt.jsx(Ri,{props:f,children:o})})},Ui=m.memo(ch),Ce=({className:e,children:t})=>{const n=m.useId(),r=m.useMemo(()=>({sharedId:n}),[n]),s=xt.jsx(Ci.Provider,{value:r,children:t});return Ze({wrapperElement:"div",className:e,children:s})},uh=({htmlFor:e,className:t,children:n})=>{const r=Nn(),s=m.useMemo(()=>r?.sharedId||e,[r?.sharedId,e]);return Ze({wrapperElement:"label",elementProps:{htmlFor:s},className:t,children:n})};var zi={exports:{}},Ki;function lh(){return Ki||(Ki=1,(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var i="",o=0;o<arguments.length;o++){var a=arguments[o];a&&(i=s(i,r(a)))}return i}function r(i){if(typeof i=="string"||typeof i=="number")return i;if(typeof i!="object")return"";if(Array.isArray(i))return n.apply(null,i);if(i.toString!==Object.prototype.toString&&!i.toString.toString().includes("[native code]"))return i.toString();var o="";for(var a in i)t.call(i,a)&&i[a]&&(o=s(o,a));return o}function s(i,o){return o?i?i+" "+o:i+o:i}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})(zi)),zi.exports}lh();const hh=({intersectionObserver:e,resizeObserver:t,page:n,height:r,children:s})=>{const i=m.useRef(void 0);m.useEffect(()=>()=>{i.current&&(e?.unobserve(i.current),t?.unobserve(i.current))},[]),m.useEffect(()=>(i.current&&e?.observe(i.current),()=>{i.current&&e&&e.unobserve(i.current)}),[e]);const o=c=>{i.current&&(e?.unobserve(i.current),t?.unobserve(i.current)),e?.observe(c),t?.observe(c),i.current=c},a=r?{height:`${r}px`}:{};return xt.jsx("div",{"data-page":n,"data-name":"page",style:a,ref:c=>{c&&o(c)},children:s})};m.memo(hh);const fh=({intersectionObserver:e,page:t})=>{const n=m.useRef(void 0);m.useEffect(()=>()=>{n.current&&e?.unobserve(n.current)},[]);const r=s=>{n.current&&e?.unobserve(n.current),e?.observe(s),n.current=s};return xt.jsx("div",{"data-page":t,"data-name":"marker",ref:s=>{s&&r(s)}})};m.memo(fh);const dh=({name:e,value:t,comparator:n,readOnly:r=!1,onChange:s,className:i,children:o})=>{const a=Qt(),c=Qt(),l=Qt(),u=Qt(),h=Yi(n),d=m.useMemo(()=>({nameSignal:a,valueSignal:c,readOnlySignal:l,useComparator:u,compare:h}),[]);m.useEffect(()=>{a.value=e},[e]),m.useEffect(()=>{c.value=t},[t]),m.useEffect(()=>{l.value=r},[r]),m.useEffect(()=>{u.value=n!==void 0},[n]);const f=Xe(p=>{s?.({originalEvent:p,name:e,value:c.value})});return xt.jsx("div",{className:i,onChange:f,children:xt.jsx(Ri,{props:d,children:o})})},Gi=m.memo(dh),ph=({value:e,className:t,children:n})=>{const[r,s]=m.useState(),[i,o]=m.useState(!1),[a,c]=m.useState(!1),l=m.useRef(void 0),u=m.useRef(void 0),h=m.useRef(void 0),d=m.useRef(void 0),f=m.useRef(void 0),p=$i(),g=Nn(),y=m.useId(),b=m.useMemo(()=>g?.sharedId||y,[g?.sharedId,y]);m.useEffect(()=>{p&&(l.current=p.nameSignal,u.current=p.valueSignal,h.current=p.readOnlySignal,d.current=p.useComparator,f.current=p.compare)},[p]),Pe(()=>{d&&u.current&&f.current?o(f.current(e,u.current.value)):o(e===u.current?.value)}),Pe(()=>{s(l.current?.value)}),Pe(()=>{c(h.current?.value??!1)});const w=Xe(S=>{S.target.checked&&u.current&&(u.current.value=e)});return Ze({wrapperElement:"label",renderProps:{checked:i,readOnly:a},elementProps:{htmlFor:b},className:t,innerWrapperElement:r?xt.jsx(fr,{id:b,name:r,type:"radio",value:e,checked:i,readOnly:a,onChange:w}):null,children:n})},qi=m.memo(ph),mh=(e,t)=>{const{id:n,name:r,value:s,toggled:i=!1,readOnly:o,onChange:a,children:c,className:l}=e,[u,h]=m.useState(i),d=Nn(),f=m.useId(),p=m.useMemo(()=>d?.sharedId||n||f,[d?.sharedId,n,f]);m.useEffect(()=>{h(i)},[i]);const g=b=>{h(b.target.checked),a?.({originalEvent:b,name:r,value:s,checked:b.target.checked})},y=b=>{h(b)};return m.useImperativeHandle(t,()=>({setToggled:y})),Ze({wrapperElement:"label",renderProps:{toggled:u,readOnly:o},elementProps:{htmlFor:p},className:l,innerWrapperElement:xt.jsx(fr,{id:p,name:r,type:"checkbox",checked:u,readOnly:o,onChange:g}),children:c})},gh=m.memo(m.forwardRef(mh)),xr=e=>{const[t,n]=m.useState(!0),r=gi();return m.useEffect(()=>{r&&r.useAnimations!==void 0?n(r.useAnimations):e!==void 0&&n(e)},[r,e]),t},Ut=({label:e,htmlFor:t,readOnly:n=!1,className:r})=>{const s=z("bc-label",{"bsc:text-black bsc:dark:text-mono-light-1":!n,"bc-read-only bsc:text-gray-4 bsc:dark:text-mono-light-3 bsc:pointer-events-none":n},r);return v.jsx(uh,{htmlFor:t,className:s,children:e})},yh=(e,t)=>{const{name:n,label:r,value:s,readOnly:i=!1,checked:o=!1,partial:a=!1,labelLocation:c=Et.Right,className:l,useAnimation:u,onChange:h}=e,d=xr(u),f=z("bc-checkbox-wrapper bsc:flex bsc:items-center bsc:group/wrapper bsc:*:cursor-pointer bsc:has-data-read-only:text-gray-4 bsc:dark:has-data-read-only:text-mono-light-3 bsc:has-data-read-only:pointer-events-none",l),p=z("bc-checkbox-label bsc:peer-data-read-only:text-gray-4 bsc:dark:peer-data-read-only:text-mono-light-3",{"bsc:ml-2":c===Et.Right,"bsc:mr-2":c===Et.Left}),g=Ge(we.FocusWithin),y=z("bc-checkbox-outer bsc:group/checkbox bsc:peer bsc:rounded bsc:*:block bsc:*:size-[21px]","bsc:inset-shadow-[0_0_0_1px] bsc:inset-shadow-gray-2 bsc:dark:inset-shadow-[0_0_0_1px] bsc:dark:inset-shadow-mono-light-2","bsc:group-hover/wrapper:not-data-checked:inset-shadow-[0_0_0_2px] bsc:group-hover/wrapper:not-data-checked:inset-shadow-gray-4","bsc:dark:group-hover/wrapper:not-data-checked:inset-shadow-[0_0_0_2px] bsc:[transition:box-shadow_0.3s]",g),b=z("bc-checkbox-svg bsc:rounded bsc:stroke-mono-light-1 bsc:stroke-2 bsc:[stroke-linecap:round]","bsc:[stroke-linejoin:round] bsc:dark:stroke-mono-dark-3 bsc:[transform:scale(0)]","bsc:group-data-checked/checkbox:group-data-read-only/checkbox:bg-primary-4 bsc:group-data-checked/checkbox:group-data-read-only/checkbox:fill-primary-4 bsc:group-data-partial/checkbox:group-data-read-only/checkbox:bg-primary-4 bsc:group-data-partial/checkbox:group-data-read-only/checkbox:fill-primary-4 bsc:dark:group-data-checked/checkbox:group-data-read-only/checkbox:bg-mono-light-3 bsc:dark:group-data-checked/checkbox:group-data-read-only/checkbox:fill-mono-light-3 bsc:dark:group-data-partial/checkbox:group-data-read-only/checkbox:bg-mono-light-3 bsc:dark:group-data-partial/checkbox:group-data-read-only/checkbox:fill-mono-light-3","bsc:group-data-checked/checkbox:group-not-data-read-only/checkbox:bg-primary-1 bsc:group-data-checked/checkbox:group-not-data-read-only/checkbox:fill-primary-1 bsc:group-data-partial/checkbox:bg-primary-1 bsc:group-data-partial/checkbox:fill-primary-1 bsc:dark:group-data-checked/checkbox:bg-mono-light-1 bsc:dark:group-data-checked/checkbox:fill-mono-light-1 bsc:dark:group-data-partial/checkbox:bg-mono-light-1 bsc:dark:group-data-partial/checkbox:fill-mono-light-1",{"bsc:group-data-checked/checkbox:group-not-data-read-only/checkbox:animate-bounce bsc:group-data-partial/checkbox:group-not-data-read-only/checkbox:animate-bounce bsc:group-data-checked/checkbox:group-data-read-only/checkbox:[transform:scale(1)] bsc:group-data-partial/checkbox:group-data-read-only/checkbox:[transform:scale(1)]":d,"bsc:group-data-checked/checkbox:[transform:scale(1)] bsc:group-data-partial/checkbox:[transform:scale(1)]":!d});return v.jsxs(Ce,{className:f,children:[r&&c===Et.Left&&v.jsx(Ut,{label:r,readOnly:i,className:p}),v.jsx(Wi,{ref:t,name:n,value:s,checked:o,partial:a,readOnly:i,className:y,onChange:h,children:v.jsxs("svg",{viewBox:"0 0 21 21",className:b,children:[v.jsx("polyline",{className:"bsc:[visibility:hidden] bsc:group-data-checked/checkbox:visible",points:"5 10.75 8.5 14.25 16 6"}),v.jsx("polyline",{className:"bsc:[visibility:hidden] bsc:group-data-partial/checkbox:visible",points:"6 10.5 16 10.5"})]})}),r&&c===Et.Right&&v.jsx(Ut,{label:r,readOnly:i,className:p})]})},Xi=m.memo(m.forwardRef(yh)),On=e=>e==null?!1:typeof e=="object",Zi=e=>e instanceof Date,Qi=e=>typeof e=="function",Ji=e=>{const t=typeof e;return t==="string"||t==="number"||t==="boolean"||t==="bigint"},Sr=e=>{if(!On(e))return e;const t={},n=Object.keys(e);for(let r=0,s=n.length;r<s;r++){const i=n[r],o=e[i];Ji(o)||Qi(o)?t[i]=o:Zi(o)?t[i]=new Date(o.getTime()):Array.isArray(o)?t[i]=Tr(o):On(o)&&(t[i]=Sr(o))}return t},Tr=e=>{let t=e.length;const n=new Array(t);for(;t--!==0;){const r=e[t];Ji(r)||Qi(r)?n[t]=r:Zi(r)?n[t]=new Date(r.getTime()):On(r)&&!Array.isArray(r)?n[t]=Sr(r):Array.isArray(r)?n[t]=Tr(r):n[t]=r}return n},bh=e=>On(e)?Array.isArray(e)?Tr(e):Sr(e):e;function vh(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var to,eo;function wh(){return eo||(eo=1,to=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t=="object"&&typeof n=="object"){if(t.constructor!==n.constructor)return!1;var r,s,i;if(Array.isArray(t)){if(r=t.length,r!=n.length)return!1;for(s=r;s--!==0;)if(!e(t[s],n[s]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(i=Object.keys(t),r=i.length,r!==Object.keys(n).length)return!1;for(s=r;s--!==0;)if(!Object.prototype.hasOwnProperty.call(n,i[s]))return!1;for(s=r;s--!==0;){var o=i[s];if(!e(t[o],n[o]))return!1}return!0}return t!==t&&n!==n}),to}var xh=wh();const Sh=vh(xh);function Th(e,t){for(let n=e.length;n--!==0;)if(!Sh(e[n],t[n]))return!0;return!1}const Pr=(e,t)=>{const n=m.useRef([]),r=n.current.length>0&&n.current[0]&&Th(n.current[0],t);return(n.current.length===0||r)&&(n.current=[bh(t),e()]),n.current[1]},Ph=()=>{throw new Error("useEvent should not be called before the component is mounted")},Vn=e=>{const t=m.useRef(Ph);m.useInsertionEffect(()=>{t.current=e},[e]);const n=m.useRef(null);return n.current||(n.current=function(){return t.current?.apply(this,arguments)}),n.current},Ch=e=>{const[t,n]=m.useState(e),r=m.useRef(e);return r.current!==t&&(r.current=t),[t,n,r]},kh=({name:e,label:t,value:n,data:r,textField:s,valueField:i,readOnly:o=!1,orientation:a=wt.Vertical,className:c,onChange:l})=>{const[u,h]=m.useState([]),d=Pr(()=>r,[r]);m.useEffect(()=>{h(n??[])},[n]);const f=w=>{if(w){const{value:S}=w;h(S??[]),l?.({name:e,value:S})}},p=(w,S)=>v.jsx(Xi,{label:w[s],value:w[i],className:"bsc:mr-3"},`${e}_checkbox_${S}`),g=z("bsc:flex bsc:flex-col bsc:gap-1",c),y=z("bsc:flex bsc:gap-1",{"bsc:flex-col":a===wt.Vertical}),b=w=>v.jsx(Ui,{name:e,value:u,readOnly:o,onChange:f,className:y,children:w.map(p)});return v.jsxs("div",{className:g,children:[t&&v.jsx(Ut,{label:t,readOnly:o}),d&&b(d)]})},Dh=m.memo(kh);var no=typeof global=="object"&&global&&global.Object===Object&&global,Eh=typeof self=="object"&&self&&self.Object===Object&&self,Vt=no||Eh||Function("return this")(),ke=Vt.Symbol,ro=Object.prototype,Mh=ro.hasOwnProperty,Ah=ro.toString,Je=ke?ke.toStringTag:void 0;function Nh(e){var t=Mh.call(e,Je),n=e[Je];try{e[Je]=void 0;var r=!0}catch{}var s=Ah.call(e);return r&&(t?e[Je]=n:delete e[Je]),s}var Ih=Object.prototype,Oh=Ih.toString;function Vh(e){return Oh.call(e)}var Lh="[object Null]",Fh="[object Undefined]",so=ke?ke.toStringTag:void 0;function De(e){return e==null?e===void 0?Fh:Lh:so&&so in Object(e)?Nh(e):Vh(e)}function Ee(e){return e!=null&&typeof e=="object"}var _h="[object Symbol]";function jh(e){return typeof e=="symbol"||Ee(e)&&De(e)==_h}var Cr=Array.isArray,Bh=/\s/;function Hh(e){for(var t=e.length;t--&&Bh.test(e.charAt(t)););return t}var $h=/^\s+/;function Wh(e){return e&&e.slice(0,Hh(e)+1).replace($h,"")}function Jt(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var io=NaN,Yh=/^[-+]0x[0-9a-f]+$/i,Rh=/^0b[01]+$/i,Uh=/^0o[0-7]+$/i,zh=parseInt;function oo(e){if(typeof e=="number")return e;if(jh(e))return io;if(Jt(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Jt(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=Wh(e);var n=Rh.test(e);return n||Uh.test(e)?zh(e.slice(2),n?2:8):Yh.test(e)?io:+e}var Kh="[object AsyncFunction]",Gh="[object Function]",qh="[object GeneratorFunction]",Xh="[object Proxy]";function ao(e){if(!Jt(e))return!1;var t=De(e);return t==Gh||t==qh||t==Kh||t==Xh}var kr=Vt["__core-js_shared__"],co=(function(){var e=/[^.]+$/.exec(kr&&kr.keys&&kr.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""})();function Zh(e){return!!co&&co in e}var Qh=Function.prototype,Jh=Qh.toString;function he(e){if(e!=null){try{return Jh.call(e)}catch{}try{return e+""}catch{}}return""}var tf=/[\\^$.*+?()[\]{}|]/g,ef=/^\[object .+?Constructor\]$/,nf=Function.prototype,rf=Object.prototype,sf=nf.toString,of=rf.hasOwnProperty,af=RegExp("^"+sf.call(of).replace(tf,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function cf(e){if(!Jt(e)||Zh(e))return!1;var t=ao(e)?af:ef;return t.test(he(e))}function uf(e,t){return e?.[t]}function fe(e,t){var n=uf(e,t);return cf(n)?n:void 0}var Dr=fe(Vt,"WeakMap"),uo=Object.create,lf=(function(){function e(){}return function(t){if(!Jt(t))return{};if(uo)return uo(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}})(),lo=(function(){try{var e=fe(Object,"defineProperty");return e({},"",{}),e}catch{}})();function hf(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}var ff=9007199254740991,df=/^(?:0|[1-9]\d*)$/;function pf(e,t){var n=typeof e;return t=t??ff,!!t&&(n=="number"||n!="symbol"&&df.test(e))&&e>-1&&e%1==0&&e<t}function mf(e,t,n){t=="__proto__"&&lo?lo(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function ho(e,t){return e===t||e!==e&&t!==t}var gf=Object.prototype,yf=gf.hasOwnProperty;function bf(e,t,n){var r=e[t];(!(yf.call(e,t)&&ho(r,n))||n===void 0&&!(t in e))&&mf(e,t,n)}var vf=9007199254740991;function fo(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=vf}function wf(e){return e!=null&&fo(e.length)&&!ao(e)}var xf=Object.prototype;function po(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||xf;return e===n}function Sf(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var Tf="[object Arguments]";function mo(e){return Ee(e)&&De(e)==Tf}var go=Object.prototype,Pf=go.hasOwnProperty,Cf=go.propertyIsEnumerable,kf=mo((function(){return arguments})())?mo:function(e){return Ee(e)&&Pf.call(e,"callee")&&!Cf.call(e,"callee")};function Df(){return!1}var yo=typeof Y=="object"&&Y&&!Y.nodeType&&Y,bo=yo&&typeof module=="object"&&module&&!module.nodeType&&module,Ef=bo&&bo.exports===yo,vo=Ef?Vt.Buffer:void 0,Mf=vo?vo.isBuffer:void 0,wo=Mf||Df,Af="[object Arguments]",Nf="[object Array]",If="[object Boolean]",Of="[object Date]",Vf="[object Error]",Lf="[object Function]",Ff="[object Map]",_f="[object Number]",jf="[object Object]",Bf="[object RegExp]",Hf="[object Set]",$f="[object String]",Wf="[object WeakMap]",Yf="[object ArrayBuffer]",Rf="[object DataView]",Uf="[object Float32Array]",zf="[object Float64Array]",Kf="[object Int8Array]",Gf="[object Int16Array]",qf="[object Int32Array]",Xf="[object Uint8Array]",Zf="[object Uint8ClampedArray]",Qf="[object Uint16Array]",Jf="[object Uint32Array]",nt={};nt[Uf]=nt[zf]=nt[Kf]=nt[Gf]=nt[qf]=nt[Xf]=nt[Zf]=nt[Qf]=nt[Jf]=!0,nt[Af]=nt[Nf]=nt[Yf]=nt[If]=nt[Rf]=nt[Of]=nt[Vf]=nt[Lf]=nt[Ff]=nt[_f]=nt[jf]=nt[Bf]=nt[Hf]=nt[$f]=nt[Wf]=!1;function td(e){return Ee(e)&&fo(e.length)&&!!nt[De(e)]}function Er(e){return function(t){return e(t)}}var xo=typeof Y=="object"&&Y&&!Y.nodeType&&Y,tn=xo&&typeof module=="object"&&module&&!module.nodeType&&module,ed=tn&&tn.exports===xo,Mr=ed&&no.process,Me=(function(){try{var e=tn&&tn.require&&tn.require("util").types;return e||Mr&&Mr.binding&&Mr.binding("util")}catch{}})(),So=Me&&Me.isTypedArray,nd=So?Er(So):td,rd=Object.prototype,sd=rd.hasOwnProperty;function id(e,t){var n=Cr(e),r=!n&&kf(e),s=!n&&!r&&wo(e),i=!n&&!r&&!s&&nd(e),o=n||r||s||i,a=o?Sf(e.length,String):[],c=a.length;for(var l in e)sd.call(e,l)&&!(o&&(l=="length"||s&&(l=="offset"||l=="parent")||i&&(l=="buffer"||l=="byteLength"||l=="byteOffset")||pf(l,c)))&&a.push(l);return a}function To(e,t){return function(n){return e(t(n))}}var od=To(Object.keys,Object),ad=Object.prototype,cd=ad.hasOwnProperty;function ud(e){if(!po(e))return od(e);var t=[];for(var n in Object(e))cd.call(e,n)&&n!="constructor"&&t.push(n);return t}function ld(e){return wf(e)?id(e):ud(e)}var en=fe(Object,"create");function hd(){this.__data__=en?en(null):{},this.size=0}function fd(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var dd="__lodash_hash_undefined__",pd=Object.prototype,md=pd.hasOwnProperty;function gd(e){var t=this.__data__;if(en){var n=t[e];return n===dd?void 0:n}return md.call(t,e)?t[e]:void 0}var yd=Object.prototype,bd=yd.hasOwnProperty;function vd(e){var t=this.__data__;return en?t[e]!==void 0:bd.call(t,e)}var wd="__lodash_hash_undefined__";function xd(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=en&&t===void 0?wd:t,this}function de(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}de.prototype.clear=hd,de.prototype.delete=fd,de.prototype.get=gd,de.prototype.has=vd,de.prototype.set=xd;function Sd(){this.__data__=[],this.size=0}function Ln(e,t){for(var n=e.length;n--;)if(ho(e[n][0],t))return n;return-1}var Td=Array.prototype,Pd=Td.splice;function Cd(e){var t=this.__data__,n=Ln(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():Pd.call(t,n,1),--this.size,!0}function kd(e){var t=this.__data__,n=Ln(t,e);return n<0?void 0:t[n][1]}function Dd(e){return Ln(this.__data__,e)>-1}function Ed(e,t){var n=this.__data__,r=Ln(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function zt(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}zt.prototype.clear=Sd,zt.prototype.delete=Cd,zt.prototype.get=kd,zt.prototype.has=Dd,zt.prototype.set=Ed;var nn=fe(Vt,"Map");function Md(){this.size=0,this.__data__={hash:new de,map:new(nn||zt),string:new de}}function Ad(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function Fn(e,t){var n=e.__data__;return Ad(t)?n[typeof t=="string"?"string":"hash"]:n.map}function Nd(e){var t=Fn(this,e).delete(e);return this.size-=t?1:0,t}function Id(e){return Fn(this,e).get(e)}function Od(e){return Fn(this,e).has(e)}function Vd(e,t){var n=Fn(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function Ae(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Ae.prototype.clear=Md,Ae.prototype.delete=Nd,Ae.prototype.get=Id,Ae.prototype.has=Od,Ae.prototype.set=Vd;function Ld(e,t){for(var n=-1,r=t.length,s=e.length;++n<r;)e[s+n]=t[n];return e}var Fd=To(Object.getPrototypeOf,Object);function _d(){this.__data__=new zt,this.size=0}function jd(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function Bd(e){return this.__data__.get(e)}function Hd(e){return this.__data__.has(e)}var $d=200;function Wd(e,t){var n=this.__data__;if(n instanceof zt){var r=n.__data__;if(!nn||r.length<$d-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Ae(r)}return n.set(e,t),this.size=n.size,this}function Ne(e){var t=this.__data__=new zt(e);this.size=t.size}Ne.prototype.clear=_d,Ne.prototype.delete=jd,Ne.prototype.get=Bd,Ne.prototype.has=Hd,Ne.prototype.set=Wd;var Po=typeof Y=="object"&&Y&&!Y.nodeType&&Y,Co=Po&&typeof module=="object"&&module&&!module.nodeType&&module,Yd=Co&&Co.exports===Po,ko=Yd?Vt.Buffer:void 0;ko&&ko.allocUnsafe;function Rd(e,t){return e.slice()}function Ud(e,t){for(var n=-1,r=e==null?0:e.length,s=0,i=[];++n<r;){var o=e[n];t(o,n,e)&&(i[s++]=o)}return i}function zd(){return[]}var Kd=Object.prototype,Gd=Kd.propertyIsEnumerable,Do=Object.getOwnPropertySymbols,qd=Do?function(e){return e==null?[]:(e=Object(e),Ud(Do(e),function(t){return Gd.call(e,t)}))}:zd;function Xd(e,t,n){var r=t(e);return Cr(e)?r:Ld(r,n(e))}function Zd(e){return Xd(e,ld,qd)}var Ar=fe(Vt,"DataView"),Nr=fe(Vt,"Promise"),Ir=fe(Vt,"Set"),Eo="[object Map]",Qd="[object Object]",Mo="[object Promise]",Ao="[object Set]",No="[object WeakMap]",Io="[object DataView]",Jd=he(Ar),tp=he(nn),ep=he(Nr),np=he(Ir),rp=he(Dr),Kt=De;(Ar&&Kt(new Ar(new ArrayBuffer(1)))!=Io||nn&&Kt(new nn)!=Eo||Nr&&Kt(Nr.resolve())!=Mo||Ir&&Kt(new Ir)!=Ao||Dr&&Kt(new Dr)!=No)&&(Kt=function(e){var t=De(e),n=t==Qd?e.constructor:void 0,r=n?he(n):"";if(r)switch(r){case Jd:return Io;case tp:return Eo;case ep:return Mo;case np:return Ao;case rp:return No}return t});var sp=Object.prototype,ip=sp.hasOwnProperty;function op(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&ip.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var Oo=Vt.Uint8Array;function Or(e){var t=new e.constructor(e.byteLength);return new Oo(t).set(new Oo(e)),t}function ap(e,t){var n=Or(e.buffer);return new e.constructor(n,e.byteOffset,e.byteLength)}var cp=/\w*$/;function up(e){var t=new e.constructor(e.source,cp.exec(e));return t.lastIndex=e.lastIndex,t}var Vo=ke?ke.prototype:void 0,Lo=Vo?Vo.valueOf:void 0;function lp(e){return Lo?Object(Lo.call(e)):{}}function hp(e,t){var n=Or(e.buffer);return new e.constructor(n,e.byteOffset,e.length)}var fp="[object Boolean]",dp="[object Date]",pp="[object Map]",mp="[object Number]",gp="[object RegExp]",yp="[object Set]",bp="[object String]",vp="[object Symbol]",wp="[object ArrayBuffer]",xp="[object DataView]",Sp="[object Float32Array]",Tp="[object Float64Array]",Pp="[object Int8Array]",Cp="[object Int16Array]",kp="[object Int32Array]",Dp="[object Uint8Array]",Ep="[object Uint8ClampedArray]",Mp="[object Uint16Array]",Ap="[object Uint32Array]";function Np(e,t,n){var r=e.constructor;switch(t){case wp:return Or(e);case fp:case dp:return new r(+e);case xp:return ap(e);case Sp:case Tp:case Pp:case Cp:case kp:case Dp:case Ep:case Mp:case Ap:return hp(e);case pp:return new r;case mp:case bp:return new r(e);case gp:return up(e);case yp:return new r;case vp:return lp(e)}}function Ip(e){return typeof e.constructor=="function"&&!po(e)?lf(Fd(e)):{}}var Op="[object Map]";function Vp(e){return Ee(e)&&Kt(e)==Op}var Fo=Me&&Me.isMap,Lp=Fo?Er(Fo):Vp,Fp="[object Set]";function _p(e){return Ee(e)&&Kt(e)==Fp}var _o=Me&&Me.isSet,jp=_o?Er(_o):_p,jo="[object Arguments]",Bp="[object Array]",Hp="[object Boolean]",$p="[object Date]",Wp="[object Error]",Bo="[object Function]",Yp="[object GeneratorFunction]",Rp="[object Map]",Up="[object Number]",Ho="[object Object]",zp="[object RegExp]",Kp="[object Set]",Gp="[object String]",qp="[object Symbol]",Xp="[object WeakMap]",Zp="[object ArrayBuffer]",Qp="[object DataView]",Jp="[object Float32Array]",tm="[object Float64Array]",em="[object Int8Array]",nm="[object Int16Array]",rm="[object Int32Array]",sm="[object Uint8Array]",im="[object Uint8ClampedArray]",om="[object Uint16Array]",am="[object Uint32Array]",J={};J[jo]=J[Bp]=J[Zp]=J[Qp]=J[Hp]=J[$p]=J[Jp]=J[tm]=J[em]=J[nm]=J[rm]=J[Rp]=J[Up]=J[Ho]=J[zp]=J[Kp]=J[Gp]=J[qp]=J[sm]=J[im]=J[om]=J[am]=!0,J[Wp]=J[Bo]=J[Xp]=!1;function _n(e,t,n,r,s,i){var o;if(o!==void 0)return o;if(!Jt(e))return e;var a=Cr(e);if(a)o=op(e);else{var c=Kt(e),l=c==Bo||c==Yp;if(wo(e))return Rd(e);if(c==Ho||c==jo||l&&!s)o=l?{}:Ip(e);else{if(!J[c])return s?e:{};o=Np(e,c)}}i||(i=new Ne);var u=i.get(e);if(u)return u;i.set(e,o),jp(e)?e.forEach(function(f){o.add(_n(f,t,n,f,e,i))}):Lp(e)&&e.forEach(function(f,p){o.set(p,_n(f,t,n,p,e,i))});var h=Zd,d=a?void 0:h(e);return hf(d||e,function(f,p){d&&(p=f,f=e[p]),bf(o,p,_n(f,t,n,p,e,i))}),o}var cm=1,um=4;function lm(e){return _n(e,cm|um)}var Vr=function(){return Vt.Date.now()},hm="Expected a function",fm=Math.max,dm=Math.min;function rn(e,t,n){var r,s,i,o,a,c,l=0,u=!1,h=!1,d=!0;if(typeof e!="function")throw new TypeError(hm);t=oo(t)||0,Jt(n)&&(u=!!n.leading,h="maxWait"in n,i=h?fm(oo(n.maxWait)||0,t):i,d="trailing"in n?!!n.trailing:d);function f(D){var A=r,C=s;return r=s=void 0,l=D,o=e.apply(C,A),o}function p(D){return l=D,a=setTimeout(b,t),u?f(D):o}function g(D){var A=D-c,C=D-l,E=t-A;return h?dm(E,i-C):E}function y(D){var A=D-c,C=D-l;return c===void 0||A>=t||A<0||h&&C>=i}function b(){var D=Vr();if(y(D))return w(D);a=setTimeout(b,g(D))}function w(D){return a=void 0,d&&r?f(D):(r=s=void 0,o)}function S(){a!==void 0&&clearTimeout(a),l=0,r=c=s=a=void 0}function T(){return a===void 0?o:w(Vr())}function P(){var D=Vr(),A=y(D);if(r=arguments,s=this,c=D,A){if(a===void 0)return p(c);if(h)return clearTimeout(a),a=setTimeout(b,t),f(c)}return a===void 0&&(a=setTimeout(b,t)),o}return P.cancel=S,P.flush=T,P}var pm="Expected a function";function mm(e,t,n){var r=!0,s=!0;if(typeof e!="function")throw new TypeError(pm);return Jt(n)&&(r="leading"in n?!0:r,s="trailing"in n?!!n.trailing:s),rn(e,t,{leading:r,maxWait:t,trailing:s})}const gm=(e,t)=>{const{value:n,readOnly:r=!1,debounceTime:s=800,fillContainer:i=!0,leftElement:o,rightElement:a,className:c,leftElementClassName:l,rightElementClassName:u,isSingleLine:h=!0,allowSingleLineScroll:d=!1,inputMode:f,placeholder:p,onFocus:g,onBlur:y,onInput:b,onInnerTextChange:w,onInnerHTMLChange:S,onElementCreate:T,onLeftElementClick:P,onRightElementClick:D}=e,A=m.useRef("bsc:grow bsc:focus:outline-hidden"),C=m.useRef("bsc:text-gray-4"),E=m.useRef(void 0),j=m.useCallback(M=>{const q=M.target,Dt=q.innerHTML;q.className=`${A.current}`,p&&Dt===p&&(q.innerHTML=""),g?.(M)},[p,g]),R=m.useCallback(M=>{const q=M.target.innerHTML;if(p&&q===""){const Dt=M.target;Dt.innerHTML=p,Dt.className=`${A.current} ${C.current}`}y?.(M)},[p,y]),F=m.useCallback(M=>{E.current?.removeEventListener("focus",j),E.current?.removeEventListener("blur",R),p&&M&&M!==document.activeElement&&M.innerHTML===""&&(M.innerHTML=p,M.className=`${A.current} ${C.current}`),M.addEventListener("focus",j),M.addEventListener("blur",R),E.current=M},[p]),B=m.useCallback(M=>{T?.(M)},[T]),N=M=>{P?.(M)},I=M=>{D?.(M)},W=rn(M=>{b?.(M),w?.(M.target.innerText),S?.(M.target.innerHTML)},s),L=m.useCallback(M=>{E.current&&(E.current.innerText=M)},[]),H=m.useCallback(M=>{E.current&&(E.current.innerHTML=M)},[]),V=m.useCallback(()=>{E.current?.focus()},[]);m.useImperativeHandle(t,()=>({inputElement:E.current,setInnerText:L,setInnerHTML:H,focus:V}));const Z=z({"bsc:w-full ":i},"bsc:flex bsc:flex-row bsc:items-center bsc:shadow-sm bsc:border bsc:border-solid bsc:border-gray-3 bsc:dark:border-white bsc:dark:bg-mono-dark-1 bsc:dark:text-mono-light-1 bsc:rounded-md bsc:p-2",{"bsc:overflow-x-auto bsc:overflow-y-hidden bsc:whitespace-pre":h&&d,"bsc:overflow-hidden bsc:whitespace-pre":h&&!d},c),x=z("bsc:shrink",{"bsc:mr-2":o},l),k=z("bsc:shrink",{"bsc:ml-2":a},u);return v.jsxs("div",{className:Z,ref:M=>{M&&B(M)},children:[o&&v.jsx("div",{className:x,onClick:N,children:o}),v.jsx("div",{ref:M=>{M&&F(M)},className:A.current,contentEditable:!r,suppressContentEditableWarning:!0,inputMode:f,onInput:W,children:n}),a&&v.jsx("div",{className:k,onClick:I,children:a})]})},jn=m.forwardRef(gm);function K(e){const t=Object.prototype.toString.call(e);return e instanceof Date||typeof e=="object"&&t==="[object Date]"?new e.constructor(+e):typeof e=="number"||t==="[object Number]"||typeof e=="string"||t==="[object String]"?new Date(e):new Date(NaN)}function tt(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}function Ie(e,t){const n=K(e);return isNaN(t)?tt(e,NaN):(t&&n.setDate(n.getDate()+t),n)}function te(e,t){const n=K(e);if(isNaN(t))return tt(e,NaN);if(!t)return n;const r=n.getDate(),s=tt(e,n.getTime());s.setMonth(n.getMonth()+t+1,0);const i=s.getDate();return r>=i?s:(n.setFullYear(s.getFullYear(),s.getMonth(),r),n)}const $o=6048e5,Lr=6e4,Fr=36e5,ym=1e3;let bm={};function sn(){return bm}function ee(e,t){const n=sn(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,s=K(e),i=s.getDay(),o=(i<r?7:0)+i-r;return s.setDate(s.getDate()-o),s.setHours(0,0,0,0),s}function Oe(e){return ee(e,{weekStartsOn:1})}function vm(e){const t=K(e),n=t.getFullYear(),r=tt(e,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);const s=Oe(r),i=tt(e,0);i.setFullYear(n,0,4),i.setHours(0,0,0,0);const o=Oe(i);return t.getTime()>=s.getTime()?n+1:t.getTime()>=o.getTime()?n:n-1}function Wo(e){const t=K(e);return t.setHours(0,0,0,0),t}function Yo(e){const t=K(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function wm(e){const t=vm(e),n=tt(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),Oe(n)}function on(e,t){return te(e,t*12)}function Ro(e,t){const n=Wo(e),r=Wo(t);return+n==+r}function xm(e){const t=K(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}function Sm(e,t){const n=K(e.start),r=K(e.end);let s=+n>+r;const i=s?+n:+r,o=s?r:n;o.setHours(0,0,0,0);let a=1;const c=[];for(;+o<=i;)c.push(K(o)),o.setDate(o.getDate()+a),o.setHours(0,0,0,0);return s?c.reverse():c}function Uo(e){const t=K(e);return t.setDate(1),t.setHours(0,0,0,0),t}function Tm(e,t){const n=K(e.start),r=K(e.end);let s=+n>+r;const i=s?+n:+r,o=s?r:n;o.setHours(0,0,0,0),o.setMonth(0,1);let a=1;const c=[];for(;+o<=i;)c.push(K(o)),o.setFullYear(o.getFullYear()+a);return s?c.reverse():c}const Pm={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},Cm=(e,t,n)=>{let r;const s=Pm[e];return typeof s=="string"?r=s:t===1?r=s.one:r=s.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function _r(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const km={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Dm={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Em={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Mm={date:_r({formats:km,defaultWidth:"full"}),time:_r({formats:Dm,defaultWidth:"full"}),dateTime:_r({formats:Em,defaultWidth:"full"})},Am={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Nm=(e,t,n,r)=>Am[e];function an(e){return(t,n)=>{const r=n?.context?String(n.context):"standalone";let s;if(r==="formatting"&&e.formattingValues){const o=e.defaultFormattingWidth||e.defaultWidth,a=n?.width?String(n.width):o;s=e.formattingValues[a]||e.formattingValues[o]}else{const o=e.defaultWidth,a=n?.width?String(n.width):e.defaultWidth;s=e.values[a]||e.values[o]}const i=e.argumentCallback?e.argumentCallback(t):t;return s[i]}}const Im={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Om={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Vm={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},Lm={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},Fm={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},_m={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},jm={ordinalNumber:(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:an({values:Im,defaultWidth:"wide"}),quarter:an({values:Om,defaultWidth:"wide",argumentCallback:e=>e-1}),month:an({values:Vm,defaultWidth:"wide"}),day:an({values:Lm,defaultWidth:"wide"}),dayPeriod:an({values:Fm,defaultWidth:"wide",formattingValues:_m,defaultFormattingWidth:"wide"})};function cn(e){return(t,n={})=>{const r=n.width,s=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],i=t.match(s);if(!i)return null;const o=i[0],a=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(a)?Hm(a,h=>h.test(o)):Bm(a,h=>h.test(o));let l;l=e.valueCallback?e.valueCallback(c):c,l=n.valueCallback?n.valueCallback(l):l;const u=t.slice(o.length);return{value:l,rest:u}}}function Bm(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function Hm(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function $m(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const s=r[0],i=t.match(e.parsePattern);if(!i)return null;let o=e.valueCallback?e.valueCallback(i[0]):i[0];o=n.valueCallback?n.valueCallback(o):o;const a=t.slice(s.length);return{value:o,rest:a}}}const Wm=/^(\d+)(th|st|nd|rd)?/i,Ym=/\d+/i,Rm={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Um={any:[/^b/i,/^(a|c)/i]},zm={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Km={any:[/1/i,/2/i,/3/i,/4/i]},Gm={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},qm={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Xm={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Zm={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Qm={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Jm={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},tg={ordinalNumber:$m({matchPattern:Wm,parsePattern:Ym,valueCallback:e=>parseInt(e,10)}),era:cn({matchPatterns:Rm,defaultMatchWidth:"wide",parsePatterns:Um,defaultParseWidth:"any"}),quarter:cn({matchPatterns:zm,defaultMatchWidth:"wide",parsePatterns:Km,defaultParseWidth:"any",valueCallback:e=>e+1}),month:cn({matchPatterns:Gm,defaultMatchWidth:"wide",parsePatterns:qm,defaultParseWidth:"any"}),day:cn({matchPatterns:Xm,defaultMatchWidth:"wide",parsePatterns:Zm,defaultParseWidth:"any"}),dayPeriod:cn({matchPatterns:Qm,defaultMatchWidth:"any",parsePatterns:Jm,defaultParseWidth:"any"})},eg={code:"en-US",formatDistance:Cm,formatLong:Mm,formatRelative:Nm,localize:jm,match:tg,options:{weekStartsOn:0,firstWeekContainsDate:1}};function ng(e){const t=K(e),n=+Oe(t)-+wm(t);return Math.round(n/$o)+1}function zo(e,t){const n=K(e),r=n.getFullYear(),s=sn(),i=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??s.firstWeekContainsDate??s.locale?.options?.firstWeekContainsDate??1,o=tt(e,0);o.setFullYear(r+1,0,i),o.setHours(0,0,0,0);const a=ee(o,t),c=tt(e,0);c.setFullYear(r,0,i),c.setHours(0,0,0,0);const l=ee(c,t);return n.getTime()>=a.getTime()?r+1:n.getTime()>=l.getTime()?r:r-1}function rg(e,t){const n=sn(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,s=zo(e,t),i=tt(e,0);return i.setFullYear(s,0,r),i.setHours(0,0,0,0),ee(i,t)}function sg(e,t){const n=K(e),r=+ee(n,t)-+rg(n,t);return Math.round(r/$o)+1}const Ko=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},Go=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},qo={p:Go,P:(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],s=n[2];if(!s)return Ko(e,t);let i;switch(r){case"P":i=t.dateTime({width:"short"});break;case"PP":i=t.dateTime({width:"medium"});break;case"PPP":i=t.dateTime({width:"long"});break;default:i=t.dateTime({width:"full"});break}return i.replace("{{date}}",Ko(r,t)).replace("{{time}}",Go(s,t))}},ig=/^D+$/,og=/^Y+$/,ag=["D","DD","YY","YYYY"];function cg(e){return ig.test(e)}function ug(e){return og.test(e)}function Xo(e,t,n){const r=lg(e,t,n);if(console.warn(r),ag.includes(e))throw new RangeError(r)}function lg(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}function jr(e){return K(e).getDay()}function Zo(e){const t=K(e),n=t.getFullYear(),r=t.getMonth(),s=tt(e,0);return s.setFullYear(n,r+1,0),s.setHours(0,0,0,0),s.getDate()}function hg(){return Object.assign({},sn())}function fg(e){let n=K(e).getDay();return n===0&&(n=7),n}function dg(e){const t=K(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(0,0,0,0),t}function pg(e,t){const n=K(e),r=K(t);return+n<+r}function mg(e,t){const n=t instanceof Date?tt(t,0):new t(0);return n.setFullYear(e.getFullYear(),e.getMonth(),e.getDate()),n.setHours(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()),n}const gg=10;class Qo{subPriority=0;validate(t,n){return!0}}class yg extends Qo{constructor(t,n,r,s,i){super(),this.value=t,this.validateValue=n,this.setValue=r,this.priority=s,i&&(this.subPriority=i)}validate(t,n){return this.validateValue(t,this.value,n)}set(t,n,r){return this.setValue(t,n,this.value,r)}}class bg extends Qo{priority=gg;subPriority=-1;set(t,n){return n.timestampIsSet?t:tt(t,mg(t,Date))}}class G{run(t,n,r,s){const i=this.parse(t,n,r,s);return i?{setter:new yg(i.value,this.validate,this.set,this.priority,this.subPriority),rest:i.rest}:null}validate(t,n,r){return!0}}class vg extends G{priority=140;parse(t,n,r){switch(n){case"G":case"GG":case"GGG":return r.era(t,{width:"abbreviated"})||r.era(t,{width:"narrow"});case"GGGGG":return r.era(t,{width:"narrow"});default:return r.era(t,{width:"wide"})||r.era(t,{width:"abbreviated"})||r.era(t,{width:"narrow"})}}set(t,n,r){return n.era=r,t.setFullYear(r,0,1),t.setHours(0,0,0,0),t}incompatibleTokens=["R","u","t","T"]}const dt={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},Bt={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function pt(e,t){return e&&{value:t(e.value),rest:e.rest}}function ot(e,t){const n=t.match(e);return n?{value:parseInt(n[0],10),rest:t.slice(n[0].length)}:null}function Ht(e,t){const n=t.match(e);if(!n)return null;if(n[0]==="Z")return{value:0,rest:t.slice(1)};const r=n[1]==="+"?1:-1,s=n[2]?parseInt(n[2],10):0,i=n[3]?parseInt(n[3],10):0,o=n[5]?parseInt(n[5],10):0;return{value:r*(s*Fr+i*Lr+o*ym),rest:t.slice(n[0].length)}}function Jo(e){return ot(dt.anyDigitsSigned,e)}function ht(e,t){switch(e){case 1:return ot(dt.singleDigit,t);case 2:return ot(dt.twoDigits,t);case 3:return ot(dt.threeDigits,t);case 4:return ot(dt.fourDigits,t);default:return ot(new RegExp("^\\d{1,"+e+"}"),t)}}function Bn(e,t){switch(e){case 1:return ot(dt.singleDigitSigned,t);case 2:return ot(dt.twoDigitsSigned,t);case 3:return ot(dt.threeDigitsSigned,t);case 4:return ot(dt.fourDigitsSigned,t);default:return ot(new RegExp("^-?\\d{1,"+e+"}"),t)}}function Br(e){switch(e){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;default:return 0}}function ta(e,t){const n=t>0,r=n?t:1-t;let s;if(r<=50)s=e||100;else{const i=r+50,o=Math.trunc(i/100)*100,a=e>=i%100;s=e+o-(a?100:0)}return n?s:1-s}function ea(e){return e%400===0||e%4===0&&e%100!==0}class wg extends G{priority=130;incompatibleTokens=["Y","R","u","w","I","i","e","c","t","T"];parse(t,n,r){const s=i=>({year:i,isTwoDigitYear:n==="yy"});switch(n){case"y":return pt(ht(4,t),s);case"yo":return pt(r.ordinalNumber(t,{unit:"year"}),s);default:return pt(ht(n.length,t),s)}}validate(t,n){return n.isTwoDigitYear||n.year>0}set(t,n,r){const s=t.getFullYear();if(r.isTwoDigitYear){const o=ta(r.year,s);return t.setFullYear(o,0,1),t.setHours(0,0,0,0),t}const i=!("era"in n)||n.era===1?r.year:1-r.year;return t.setFullYear(i,0,1),t.setHours(0,0,0,0),t}}class xg extends G{priority=130;parse(t,n,r){const s=i=>({year:i,isTwoDigitYear:n==="YY"});switch(n){case"Y":return pt(ht(4,t),s);case"Yo":return pt(r.ordinalNumber(t,{unit:"year"}),s);default:return pt(ht(n.length,t),s)}}validate(t,n){return n.isTwoDigitYear||n.year>0}set(t,n,r,s){const i=zo(t,s);if(r.isTwoDigitYear){const a=ta(r.year,i);return t.setFullYear(a,0,s.firstWeekContainsDate),t.setHours(0,0,0,0),ee(t,s)}const o=!("era"in n)||n.era===1?r.year:1-r.year;return t.setFullYear(o,0,s.firstWeekContainsDate),t.setHours(0,0,0,0),ee(t,s)}incompatibleTokens=["y","R","u","Q","q","M","L","I","d","D","i","t","T"]}class Sg extends G{priority=130;parse(t,n){return Bn(n==="R"?4:n.length,t)}set(t,n,r){const s=tt(t,0);return s.setFullYear(r,0,4),s.setHours(0,0,0,0),Oe(s)}incompatibleTokens=["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]}class Tg extends G{priority=130;parse(t,n){return Bn(n==="u"?4:n.length,t)}set(t,n,r){return t.setFullYear(r,0,1),t.setHours(0,0,0,0),t}incompatibleTokens=["G","y","Y","R","w","I","i","e","c","t","T"]}class Pg extends G{priority=120;parse(t,n,r){switch(n){case"Q":case"QQ":return ht(n.length,t);case"Qo":return r.ordinalNumber(t,{unit:"quarter"});case"QQQ":return r.quarter(t,{width:"abbreviated",context:"formatting"})||r.quarter(t,{width:"narrow",context:"formatting"});case"QQQQQ":return r.quarter(t,{width:"narrow",context:"formatting"});default:return r.quarter(t,{width:"wide",context:"formatting"})||r.quarter(t,{width:"abbreviated",context:"formatting"})||r.quarter(t,{width:"narrow",context:"formatting"})}}validate(t,n){return n>=1&&n<=4}set(t,n,r){return t.setMonth((r-1)*3,1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]}class Cg extends G{priority=120;parse(t,n,r){switch(n){case"q":case"qq":return ht(n.length,t);case"qo":return r.ordinalNumber(t,{unit:"quarter"});case"qqq":return r.quarter(t,{width:"abbreviated",context:"standalone"})||r.quarter(t,{width:"narrow",context:"standalone"});case"qqqqq":return r.quarter(t,{width:"narrow",context:"standalone"});default:return r.quarter(t,{width:"wide",context:"standalone"})||r.quarter(t,{width:"abbreviated",context:"standalone"})||r.quarter(t,{width:"narrow",context:"standalone"})}}validate(t,n){return n>=1&&n<=4}set(t,n,r){return t.setMonth((r-1)*3,1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]}class kg extends G{incompatibleTokens=["Y","R","q","Q","L","w","I","D","i","e","c","t","T"];priority=110;parse(t,n,r){const s=i=>i-1;switch(n){case"M":return pt(ot(dt.month,t),s);case"MM":return pt(ht(2,t),s);case"Mo":return pt(r.ordinalNumber(t,{unit:"month"}),s);case"MMM":return r.month(t,{width:"abbreviated",context:"formatting"})||r.month(t,{width:"narrow",context:"formatting"});case"MMMMM":return r.month(t,{width:"narrow",context:"formatting"});default:return r.month(t,{width:"wide",context:"formatting"})||r.month(t,{width:"abbreviated",context:"formatting"})||r.month(t,{width:"narrow",context:"formatting"})}}validate(t,n){return n>=0&&n<=11}set(t,n,r){return t.setMonth(r,1),t.setHours(0,0,0,0),t}}class Dg extends G{priority=110;parse(t,n,r){const s=i=>i-1;switch(n){case"L":return pt(ot(dt.month,t),s);case"LL":return pt(ht(2,t),s);case"Lo":return pt(r.ordinalNumber(t,{unit:"month"}),s);case"LLL":return r.month(t,{width:"abbreviated",context:"standalone"})||r.month(t,{width:"narrow",context:"standalone"});case"LLLLL":return r.month(t,{width:"narrow",context:"standalone"});default:return r.month(t,{width:"wide",context:"standalone"})||r.month(t,{width:"abbreviated",context:"standalone"})||r.month(t,{width:"narrow",context:"standalone"})}}validate(t,n){return n>=0&&n<=11}set(t,n,r){return t.setMonth(r,1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]}function Eg(e,t,n){const r=K(e),s=sg(r,n)-t;return r.setDate(r.getDate()-s*7),r}class Mg extends G{priority=100;parse(t,n,r){switch(n){case"w":return ot(dt.week,t);case"wo":return r.ordinalNumber(t,{unit:"week"});default:return ht(n.length,t)}}validate(t,n){return n>=1&&n<=53}set(t,n,r,s){return ee(Eg(t,r,s),s)}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","i","t","T"]}function Ag(e,t){const n=K(e),r=ng(n)-t;return n.setDate(n.getDate()-r*7),n}class Ng extends G{priority=100;parse(t,n,r){switch(n){case"I":return ot(dt.week,t);case"Io":return r.ordinalNumber(t,{unit:"week"});default:return ht(n.length,t)}}validate(t,n){return n>=1&&n<=53}set(t,n,r){return Oe(Ag(t,r))}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]}const Ig=[31,28,31,30,31,30,31,31,30,31,30,31],Og=[31,29,31,30,31,30,31,31,30,31,30,31];class Vg extends G{priority=90;subPriority=1;parse(t,n,r){switch(n){case"d":return ot(dt.date,t);case"do":return r.ordinalNumber(t,{unit:"date"});default:return ht(n.length,t)}}validate(t,n){const r=t.getFullYear(),s=ea(r),i=t.getMonth();return s?n>=1&&n<=Og[i]:n>=1&&n<=Ig[i]}set(t,n,r){return t.setDate(r),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","w","I","D","i","e","c","t","T"]}class Lg extends G{priority=90;subpriority=1;parse(t,n,r){switch(n){case"D":case"DD":return ot(dt.dayOfYear,t);case"Do":return r.ordinalNumber(t,{unit:"date"});default:return ht(n.length,t)}}validate(t,n){const r=t.getFullYear();return ea(r)?n>=1&&n<=366:n>=1&&n<=365}set(t,n,r){return t.setMonth(0,r),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]}function Hr(e,t,n){const r=sn(),s=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,i=K(e),o=i.getDay(),c=(t%7+7)%7,l=7-s,u=t<0||t>6?t-(o+l)%7:(c+l)%7-(o+l)%7;return Ie(i,u)}class Fg extends G{priority=90;parse(t,n,r){switch(n){case"E":case"EE":case"EEE":return r.day(t,{width:"abbreviated",context:"formatting"})||r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"});case"EEEEE":return r.day(t,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"});default:return r.day(t,{width:"wide",context:"formatting"})||r.day(t,{width:"abbreviated",context:"formatting"})||r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"})}}validate(t,n){return n>=0&&n<=6}set(t,n,r,s){return t=Hr(t,r,s),t.setHours(0,0,0,0),t}incompatibleTokens=["D","i","e","c","t","T"]}class _g extends G{priority=90;parse(t,n,r,s){const i=o=>{const a=Math.floor((o-1)/7)*7;return(o+s.weekStartsOn+6)%7+a};switch(n){case"e":case"ee":return pt(ht(n.length,t),i);case"eo":return pt(r.ordinalNumber(t,{unit:"day"}),i);case"eee":return r.day(t,{width:"abbreviated",context:"formatting"})||r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"});case"eeeee":return r.day(t,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"});default:return r.day(t,{width:"wide",context:"formatting"})||r.day(t,{width:"abbreviated",context:"formatting"})||r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"})}}validate(t,n){return n>=0&&n<=6}set(t,n,r,s){return t=Hr(t,r,s),t.setHours(0,0,0,0),t}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]}class jg extends G{priority=90;parse(t,n,r,s){const i=o=>{const a=Math.floor((o-1)/7)*7;return(o+s.weekStartsOn+6)%7+a};switch(n){case"c":case"cc":return pt(ht(n.length,t),i);case"co":return pt(r.ordinalNumber(t,{unit:"day"}),i);case"ccc":return r.day(t,{width:"abbreviated",context:"standalone"})||r.day(t,{width:"short",context:"standalone"})||r.day(t,{width:"narrow",context:"standalone"});case"ccccc":return r.day(t,{width:"narrow",context:"standalone"});case"cccccc":return r.day(t,{width:"short",context:"standalone"})||r.day(t,{width:"narrow",context:"standalone"});default:return r.day(t,{width:"wide",context:"standalone"})||r.day(t,{width:"abbreviated",context:"standalone"})||r.day(t,{width:"short",context:"standalone"})||r.day(t,{width:"narrow",context:"standalone"})}}validate(t,n){return n>=0&&n<=6}set(t,n,r,s){return t=Hr(t,r,s),t.setHours(0,0,0,0),t}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]}function Bg(e,t){const n=K(e),r=fg(n),s=t-r;return Ie(n,s)}class Hg extends G{priority=90;parse(t,n,r){const s=i=>i===0?7:i;switch(n){case"i":case"ii":return ht(n.length,t);case"io":return r.ordinalNumber(t,{unit:"day"});case"iii":return pt(r.day(t,{width:"abbreviated",context:"formatting"})||r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"}),s);case"iiiii":return pt(r.day(t,{width:"narrow",context:"formatting"}),s);case"iiiiii":return pt(r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"}),s);default:return pt(r.day(t,{width:"wide",context:"formatting"})||r.day(t,{width:"abbreviated",context:"formatting"})||r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"}),s)}}validate(t,n){return n>=1&&n<=7}set(t,n,r){return t=Bg(t,r),t.setHours(0,0,0,0),t}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"]}class $g extends G{priority=80;parse(t,n,r){switch(n){case"a":case"aa":case"aaa":return r.dayPeriod(t,{width:"abbreviated",context:"formatting"})||r.dayPeriod(t,{width:"narrow",context:"formatting"});case"aaaaa":return r.dayPeriod(t,{width:"narrow",context:"formatting"});default:return r.dayPeriod(t,{width:"wide",context:"formatting"})||r.dayPeriod(t,{width:"abbreviated",context:"formatting"})||r.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,n,r){return t.setHours(Br(r),0,0,0),t}incompatibleTokens=["b","B","H","k","t","T"]}class Wg extends G{priority=80;parse(t,n,r){switch(n){case"b":case"bb":case"bbb":return r.dayPeriod(t,{width:"abbreviated",context:"formatting"})||r.dayPeriod(t,{width:"narrow",context:"formatting"});case"bbbbb":return r.dayPeriod(t,{width:"narrow",context:"formatting"});default:return r.dayPeriod(t,{width:"wide",context:"formatting"})||r.dayPeriod(t,{width:"abbreviated",context:"formatting"})||r.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,n,r){return t.setHours(Br(r),0,0,0),t}incompatibleTokens=["a","B","H","k","t","T"]}class Yg extends G{priority=80;parse(t,n,r){switch(n){case"B":case"BB":case"BBB":return r.dayPeriod(t,{width:"abbreviated",context:"formatting"})||r.dayPeriod(t,{width:"narrow",context:"formatting"});case"BBBBB":return r.dayPeriod(t,{width:"narrow",context:"formatting"});default:return r.dayPeriod(t,{width:"wide",context:"formatting"})||r.dayPeriod(t,{width:"abbreviated",context:"formatting"})||r.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,n,r){return t.setHours(Br(r),0,0,0),t}incompatibleTokens=["a","b","t","T"]}class Rg extends G{priority=70;parse(t,n,r){switch(n){case"h":return ot(dt.hour12h,t);case"ho":return r.ordinalNumber(t,{unit:"hour"});default:return ht(n.length,t)}}validate(t,n){return n>=1&&n<=12}set(t,n,r){const s=t.getHours()>=12;return s&&r<12?t.setHours(r+12,0,0,0):!s&&r===12?t.setHours(0,0,0,0):t.setHours(r,0,0,0),t}incompatibleTokens=["H","K","k","t","T"]}class Ug extends G{priority=70;parse(t,n,r){switch(n){case"H":return ot(dt.hour23h,t);case"Ho":return r.ordinalNumber(t,{unit:"hour"});default:return ht(n.length,t)}}validate(t,n){return n>=0&&n<=23}set(t,n,r){return t.setHours(r,0,0,0),t}incompatibleTokens=["a","b","h","K","k","t","T"]}class zg extends G{priority=70;parse(t,n,r){switch(n){case"K":return ot(dt.hour11h,t);case"Ko":return r.ordinalNumber(t,{unit:"hour"});default:return ht(n.length,t)}}validate(t,n){return n>=0&&n<=11}set(t,n,r){return t.getHours()>=12&&r<12?t.setHours(r+12,0,0,0):t.setHours(r,0,0,0),t}incompatibleTokens=["h","H","k","t","T"]}class Kg extends G{priority=70;parse(t,n,r){switch(n){case"k":return ot(dt.hour24h,t);case"ko":return r.ordinalNumber(t,{unit:"hour"});default:return ht(n.length,t)}}validate(t,n){return n>=1&&n<=24}set(t,n,r){const s=r<=24?r%24:r;return t.setHours(s,0,0,0),t}incompatibleTokens=["a","b","h","H","K","t","T"]}class Gg extends G{priority=60;parse(t,n,r){switch(n){case"m":return ot(dt.minute,t);case"mo":return r.ordinalNumber(t,{unit:"minute"});default:return ht(n.length,t)}}validate(t,n){return n>=0&&n<=59}set(t,n,r){return t.setMinutes(r,0,0),t}incompatibleTokens=["t","T"]}class qg extends G{priority=50;parse(t,n,r){switch(n){case"s":return ot(dt.second,t);case"so":return r.ordinalNumber(t,{unit:"second"});default:return ht(n.length,t)}}validate(t,n){return n>=0&&n<=59}set(t,n,r){return t.setSeconds(r,0),t}incompatibleTokens=["t","T"]}class Xg extends G{priority=30;parse(t,n){const r=s=>Math.trunc(s*Math.pow(10,-n.length+3));return pt(ht(n.length,t),r)}set(t,n,r){return t.setMilliseconds(r),t}incompatibleTokens=["t","T"]}class Zg extends G{priority=10;parse(t,n){switch(n){case"X":return Ht(Bt.basicOptionalMinutes,t);case"XX":return Ht(Bt.basic,t);case"XXXX":return Ht(Bt.basicOptionalSeconds,t);case"XXXXX":return Ht(Bt.extendedOptionalSeconds,t);default:return Ht(Bt.extended,t)}}set(t,n,r){return n.timestampIsSet?t:tt(t,t.getTime()-Yo(t)-r)}incompatibleTokens=["t","T","x"]}class Qg extends G{priority=10;parse(t,n){switch(n){case"x":return Ht(Bt.basicOptionalMinutes,t);case"xx":return Ht(Bt.basic,t);case"xxxx":return Ht(Bt.basicOptionalSeconds,t);case"xxxxx":return Ht(Bt.extendedOptionalSeconds,t);default:return Ht(Bt.extended,t)}}set(t,n,r){return n.timestampIsSet?t:tt(t,t.getTime()-Yo(t)-r)}incompatibleTokens=["t","T","X"]}class Jg extends G{priority=40;parse(t){return Jo(t)}set(t,n,r){return[tt(t,r*1e3),{timestampIsSet:!0}]}incompatibleTokens="*"}class ty extends G{priority=20;parse(t){return Jo(t)}set(t,n,r){return[tt(t,r),{timestampIsSet:!0}]}incompatibleTokens="*"}const ey={G:new vg,y:new wg,Y:new xg,R:new Sg,u:new Tg,Q:new Pg,q:new Cg,M:new kg,L:new Dg,w:new Mg,I:new Ng,d:new Vg,D:new Lg,E:new Fg,e:new _g,c:new jg,i:new Hg,a:new $g,b:new Wg,B:new Yg,h:new Rg,H:new Ug,K:new zg,k:new Kg,m:new Gg,s:new qg,S:new Xg,X:new Zg,x:new Qg,t:new Jg,T:new ty},ny=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,ry=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,sy=/^'([^]*?)'?$/,iy=/''/g,oy=/\S/,ay=/[a-zA-Z]/;function $t(e,t,n,r){const s=hg(),i=r?.locale??s.locale??eg,o=r?.firstWeekContainsDate??r?.locale?.options?.firstWeekContainsDate??s.firstWeekContainsDate??s.locale?.options?.firstWeekContainsDate??1,a=r?.weekStartsOn??r?.locale?.options?.weekStartsOn??s.weekStartsOn??s.locale?.options?.weekStartsOn??0;if(t==="")return e===""?K(n):tt(n,NaN);const c={firstWeekContainsDate:o,weekStartsOn:a,locale:i},l=[new bg],u=t.match(ry).map(g=>{const y=g[0];if(y in qo){const b=qo[y];return b(g,i.formatLong)}return g}).join("").match(ny),h=[];for(let g of u){!r?.useAdditionalWeekYearTokens&&ug(g)&&Xo(g,t,e),!r?.useAdditionalDayOfYearTokens&&cg(g)&&Xo(g,t,e);const y=g[0],b=ey[y];if(b){const{incompatibleTokens:w}=b;if(Array.isArray(w)){const T=h.find(P=>w.includes(P.token)||P.token===y);if(T)throw new RangeError(`The format string mustn't contain \`${T.fullToken}\` and \`${g}\` at the same time`)}else if(b.incompatibleTokens==="*"&&h.length>0)throw new RangeError(`The format string mustn't contain \`${g}\` and any other token at the same time`);h.push({token:y,fullToken:g});const S=b.run(e,g,i.match,c);if(!S)return tt(n,NaN);l.push(S.setter),e=S.rest}else{if(y.match(ay))throw new RangeError("Format string contains an unescaped latin alphabet character `"+y+"`");if(g==="''"?g="'":y==="'"&&(g=cy(g)),e.indexOf(g)===0)e=e.slice(g.length);else return tt(n,NaN)}}if(e.length>0&&oy.test(e))return tt(n,NaN);const d=l.map(g=>g.priority).sort((g,y)=>y-g).filter((g,y,b)=>b.indexOf(g)===y).map(g=>l.filter(y=>y.priority===g).sort((y,b)=>b.subPriority-y.subPriority)).map(g=>g[0]);let f=K(n);if(isNaN(f.getTime()))return tt(n,NaN);const p={};for(const g of d){if(!g.validate(f,c))return tt(n,NaN);const y=g.set(f,p,c);Array.isArray(y)?(f=y[0],Object.assign(p,y[1])):f=y}return tt(n,f)}function cy(e){return e.match(sy)[1].replace(iy,"'")}function uy(e){return Ro(e,Date.now())}function ly(e,t){return Ie(e,-t)}function hy(e,t){let n=t-jr(e);return n<=0&&(n+=7),Ie(e,n)}function fy(e,t){const r=gy(e);let s;if(r.date){const c=yy(r.date,2);s=by(c.restDateString,c.year)}if(!s||isNaN(s.getTime()))return new Date(NaN);const i=s.getTime();let o=0,a;if(r.time&&(o=vy(r.time),isNaN(o)))return new Date(NaN);if(r.timezone){if(a=wy(r.timezone),isNaN(a))return new Date(NaN)}else{const c=new Date(i+o),l=new Date(0);return l.setFullYear(c.getUTCFullYear(),c.getUTCMonth(),c.getUTCDate()),l.setHours(c.getUTCHours(),c.getUTCMinutes(),c.getUTCSeconds(),c.getUTCMilliseconds()),l}return new Date(i+o+a)}const Hn={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},dy=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,py=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,my=/^([+-])(\d{2})(?::?(\d{2}))?$/;function gy(e){const t={},n=e.split(Hn.dateTimeDelimiter);let r;if(n.length>2)return t;if(/:/.test(n[0])?r=n[0]:(t.date=n[0],r=n[1],Hn.timeZoneDelimiter.test(t.date)&&(t.date=e.split(Hn.timeZoneDelimiter)[0],r=e.substr(t.date.length,e.length))),r){const s=Hn.timezone.exec(r);s?(t.time=r.replace(s[1],""),t.timezone=s[1]):t.time=r}return t}function yy(e,t){const n=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),r=e.match(n);if(!r)return{year:NaN,restDateString:""};const s=r[1]?parseInt(r[1]):null,i=r[2]?parseInt(r[2]):null;return{year:i===null?s:i*100,restDateString:e.slice((r[1]||r[2]).length)}}function by(e,t){if(t===null)return new Date(NaN);const n=e.match(dy);if(!n)return new Date(NaN);const r=!!n[4],s=un(n[1]),i=un(n[2])-1,o=un(n[3]),a=un(n[4]),c=un(n[5])-1;if(r)return Cy(t,a,c)?xy(t,a,c):new Date(NaN);{const l=new Date(0);return!Ty(t,i,o)||!Py(t,s)?new Date(NaN):(l.setUTCFullYear(t,i,Math.max(s,o)),l)}}function un(e){return e?parseInt(e):1}function vy(e){const t=e.match(py);if(!t)return NaN;const n=$r(t[1]),r=$r(t[2]),s=$r(t[3]);return ky(n,r,s)?n*Fr+r*Lr+s*1e3:NaN}function $r(e){return e&&parseFloat(e.replace(",","."))||0}function wy(e){if(e==="Z")return 0;const t=e.match(my);if(!t)return 0;const n=t[1]==="+"?-1:1,r=parseInt(t[2]),s=t[3]&&parseInt(t[3])||0;return Dy(r,s)?n*(r*Fr+s*Lr):NaN}function xy(e,t,n){const r=new Date(0);r.setUTCFullYear(e,0,4);const s=r.getUTCDay()||7,i=(t-1)*7+n+1-s;return r.setUTCDate(r.getUTCDate()+i),r}const Sy=[31,null,31,30,31,30,31,31,30,31,30,31];function na(e){return e%400===0||e%4===0&&e%100!==0}function Ty(e,t,n){return t>=0&&t<=11&&n>=1&&n<=(Sy[t]||(na(e)?29:28))}function Py(e,t){return t>=1&&t<=(na(e)?366:365)}function Cy(e,t,n){return t>=1&&t<=53&&n>=0&&n<=6}function ky(e,t,n){return e===24?t===0&&n===0:n>=0&&n<60&&t>=0&&t<60&&e>=0&&e<25}function Dy(e,t){return t>=0&&t<=59}function Ey(e,t){const n=K(e),r=n.getFullYear(),s=n.getDate(),i=tt(e,0);i.setFullYear(r,t,15),i.setHours(0,0,0,0);const o=Zo(i);return n.setMonth(t,Math.min(s,o)),n}function My(e,t){const n=K(e);return isNaN(+n)?tt(e,NaN):(n.setFullYear(t),n)}function Wr(e,t){return te(e,-t)}function Yr(e,t){return on(e,-t)}function Ay(){return window.navigator.languages?window.navigator.languages[0]:window.navigator.language}function Ny(e,t,n){const r=[];for(let s=e;s<=t;s++)r.push(n?n(s):s);return r}function Iy(e,t){const n=e.target;return n?!t.isSameNode(n)&&!t.contains(n):!1}function Oy(e,t){return e.isSameNode(t)||e.contains(t)}function Vy(e,t){const n=Object.entries(t),r=getComputedStyle(e);for(let s=0,i=n.length;s<i;s++){const[o,a]=n[s];if(typeof a=="string"&&a.indexOf(",")>-1){if(!a.split(",").map(l=>l.trim()).includes(r[o]))return!1}else if(r[o]!==a)return!1}return!0}function Ly(e,t){const n=Object.entries(t),r=getComputedStyle(e);for(let s=0,i=n.length;s<i;s++){const[o,a]=n[s];if(typeof a=="string"&&a.indexOf(",")>-1){if(a.split(",").map(l=>l.trim()).includes(r[o]))return!0}else if(r[o]===a)return!0}return!1}function ra(e,t,n=!1,r){if(n&&Vy(e,t)){if(!r||r?.(e)===!0)return e}else if(!n&&Ly(e,t)&&(!r||r?.(e)===!0))return e;return e.parentElement?ra(e.parentElement,t,n,r):e}function sa(e,t){const n=Array.from(document.querySelectorAll("body *")),r=[];for(let s=0,i=n.length;s<i;s++){const o=getComputedStyle(n[s]);o[e]&&t(o[e])&&r.push(o[e])}return r}function dS(e){return e}function Fy(e){const t=document.documentElement;Object.keys(e).forEach(n=>{t.style.setProperty(n,e[n])})}function _y(e){return{"--theme-bsc-primary-1":e.primary1,"--theme-bsc-primary-2":e.primary2,"--theme-bsc-primary-3":e.primary3,"--theme-bsc-primary-4":e.primary4,"--theme-bsc-primary-5":e.primary5,"--theme-bsc-gray-1":e.gray1||"#303030","--theme-bsc-gray-2":e.gray2||"#5f5f5f","--theme-bsc-gray-3":e.gray3||"#8f8f8f","--theme-bsc-gray-4":e.gray4||"#bebebe","--theme-bsc-gray-5":e.gray5||"#eee","--theme-bsc-black":e.black||"#000","--theme-bsc-white":e.white||"#fff","--theme-bsc-mono-dark-1":e.monoDark1||"#222","--theme-bsc-mono-dark-2":e.monoDark2||"#3c3c3c","--theme-bsc-mono-dark-3":e.monoDark3||"#4e4e4e","--theme-bsc-mono-light-1":e.monoLight1||"#fefefe","--theme-bsc-mono-light-2":e.monoLight2||"#eee","--theme-bsc-mono-light-3":e.monoLight3||"#ccc","--theme-bsc-info":e.info||"#2e7ff8","--theme-bsc-success":e.success||"#53ae0c","--theme-bsc-warning":e.warning||"#ff6914","--theme-bsc-error":e.error||"#f01616"}}var Tt=(e=>(e[e.Regular=24]="Regular",e[e.Small=20]="Small",e))(Tt||{});const ia=({className:e})=>v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:e,children:v.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6.75 3v2.25M17.25 3v2.25M3 18.75V7.5a2.25 2.25 0 0 1 2.25-2.25h13.5A2.25 2.25 0 0 1 21 7.5v11.25m-18 0A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75m-18 0v-7.5A2.25 2.25 0 0 1 5.25 9h13.5A2.25 2.25 0 0 1 21 11.25v7.5m-9-6h.008v.008H12v-.008ZM12 15h.008v.008H12V15Zm0 2.25h.008v.008H12v-.008ZM9.75 15h.008v.008H9.75V15Zm0 2.25h.008v.008H9.75v-.008ZM7.5 15h.008v.008H7.5V15Zm0 2.25h.008v.008H7.5v-.008Zm6.75-4.5h.008v.008h-.008v-.008Zm0 2.25h.008v.008h-.008V15Zm0 2.25h.008v.008h-.008v-.008Zm2.25-4.5h.008v.008H16.5v-.008Zm0 2.25h.008v.008H16.5V15Z"})}),jy=({className:e})=>{const t=z("bsc:h-6 bsc:w-6",e);return v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:t,children:v.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m19.5 8.25-7.5 7.5-7.5-7.5"})})},By=({className:e})=>{const t=z("bsc:h-6 bsc:w-6",e);return v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:t,children:v.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 19.5 8.25 12l7.5-7.5"})})},Hy=({className:e})=>{const t=z("bsc:h-6 bsc:w-6",e);return v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:t,children:v.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m8.25 4.5 7.5 7.5-7.5 7.5"})})},$y=({className:e})=>{const t=z("bsc:h-6 bsc:w-6",e);return v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:t,children:v.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m4.5 15.75 7.5-7.5 7.5 7.5"})})},Wy=({className:e})=>v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:e,children:v.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18 18 6M6 6l12 12"})}),Mt=({icon:e,size:t=Tt.Regular,onClick:n,className:r})=>{const s=m.useRef({calendar:ia,chevronDown:jy,chevronLeft:By,chevronRight:Hy,chevronUp:$y,close:Wy}),i=m.useMemo(()=>s.current[e]||ia,[e]),o=z({"bsc:h-[24px] bsc:w-[24px]":t===Tt.Regular,"bsc:h-[20px] bsc:w-[20px]":t===Tt.Small},r);return v.jsx("div",{onClick:n,children:v.jsx(i,{className:o})})},pe=({template:e,props:t,children:n})=>e(t,n);function Yy(e,t){if(t===e)return!1;const n=Object.values(t),r=Object.values(e);if(n.length!==r.length||n.some((i,o)=>i!==r[o]))return!0;const s=Object.keys(e);return Object.keys(t).some((i,o)=>i!==s[o])}function Ry(e,t){return e.matches[t]=!1,e.mediaQueries[t]={},e}function oa(e){const t=Object.keys(e);return typeof window>"u"?t.reduce(Ry,{mediaQueries:{},matches:{}}):t.reduce((n,r)=>{const s=window.matchMedia(e[r]);return n.mediaQueries[r]=s,n.matches[r]=s.matches,n},{mediaQueries:{},matches:{}})}function Uy(e,t){function n(r,s){return r[s]=e.mediaQueries[s].matches,r}switch(t.type){case"updateMatches":return{matches:Object.keys(e.mediaQueries).reduce(n,{}),mediaQueries:e.mediaQueries};case"setQueries":return oa(t.queries)}}function zy(e){const t=Ke.useRef(e),[n,r]=Ke.useReducer(Uy,e,oa);Ke.useEffect(()=>{Yy(e,t.current)&&(r({type:"setQueries",queries:e}),t.current=e)},[e]);function s(){return r({type:"updateMatches"})}function i(c){const l=s;return typeof c.addListener<"u"?c.addListener(l):c.addEventListener("change",l),l}Ke.useEffect(()=>{const c=Object.values(n.mediaQueries),l=c.map(i);function u(h,d){typeof h.addListener<"u"?h.removeListener(l[d]):h.removeEventListener("change",l[d])}return()=>{c.forEach(u)}},[n.mediaQueries]);const{matches:o}=n,a=Ke.useMemo(()=>Object.values(o),[o]);return{matches:o,matchesAny:a.some(Boolean),matchesAll:a.length>0&&a.every(Boolean)}}function $n(e){return zy(Ky(e)).matchesAll}const Rr={};function Ky(e){return Rr[e]===void 0&&(Rr[e]={default:e}),Rr[e]}const Ur=({mobileQuery:e="screen and (max-device-width: 40rem)",tabletQuery:t="screen and (min-device-width: 40.01rem) and (max-device-width: 63.9375rem)",desktopQuery:n="screen and (min-device-width: 64rem)",mobileMarkup:r,aboveMobileMarkup:s,tabletMarkup:i,desktopMarkup:o})=>{const a=$n(e),c=$n(t),l=$n(n);return a&&r?r:!a&&s?s:c&&i?i:l&&o?o:(console.error("Invalid media settings"),null)};function aa(e,t,n){const r=i=>{const o=i.target,a=e.style.display!=="hidden";e&&a&&!Oy(e,o)&&!s(n,o)?t(!1):t(!0)},s=(i,o)=>{if(!i)return!1;for(let a=0,c=i.length;a<c;a++)if(i[a].isSameNode(o)||i[a].contains(o))return!0;return!1};return document.addEventListener("mousedown",r),r}function ca(e){document.removeEventListener("mousedown",e)}function ua(e){return e.target?e.target:e}const la=m.createContext({});function Gy(e){const t=m.useRef(null);return t.current===null&&(t.current=e()),t.current}const zr=typeof window<"u",qy=zr?m.useLayoutEffect:m.useEffect,Kr=m.createContext(null);function Gr(e,t){e.indexOf(t)===-1&&e.push(t)}function qr(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const Gt=(e,t,n)=>n>t?t:n<e?e:n;function Xr(e,t){return t?`${e}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${t}`:e}let Ve=()=>{},qt=()=>{};typeof process<"u"&&process.env?.NODE_ENV!=="production"&&(Ve=(e,t,n)=>{!e&&typeof console<"u"&&console.warn(Xr(t,n))},qt=(e,t,n)=>{if(!e)throw new Error(Xr(t,n))});const Xt={},ha=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function fa(e){return typeof e=="object"&&e!==null}const da=e=>/^0[^.\s]+$/u.test(e);function Zr(e){let t;return()=>(t===void 0&&(t=e()),t)}const At=e=>e,Xy=(e,t)=>n=>t(e(n)),ln=(...e)=>e.reduce(Xy),hn=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r};class Qr{constructor(){this.subscriptions=[]}add(t){return Gr(this.subscriptions,t),()=>qr(this.subscriptions,t)}notify(t,n,r){const s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](t,n,r);else for(let i=0;i<s;i++){const o=this.subscriptions[i];o&&o(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Lt=e=>e*1e3,Nt=e=>e/1e3;function pa(e,t){return t?e*(1e3/t):0}const ma=new Set;function Jr(e,t,n){e||ma.has(t)||(console.warn(Xr(t,n)),ma.add(t))}const ga=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,Zy=1e-7,Qy=12;function Jy(e,t,n,r,s){let i,o,a=0;do o=t+(n-t)/2,i=ga(o,r,s)-e,i>0?n=o:t=o;while(Math.abs(i)>Zy&&++a<Qy);return o}function fn(e,t,n,r){if(e===t&&n===r)return At;const s=i=>Jy(i,0,1,e,n);return i=>i===0||i===1?i:ga(s(i),t,r)}const ya=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,ba=e=>t=>1-e(1-t),va=fn(.33,1.53,.69,.99),ts=ba(va),wa=ya(ts),xa=e=>(e*=2)<1?.5*ts(e):.5*(2-Math.pow(2,-10*(e-1))),es=e=>1-Math.sin(Math.acos(e)),Sa=ba(es),Ta=ya(es),tb=fn(.42,0,1,1),eb=fn(0,0,.58,1),Pa=fn(.42,0,.58,1),nb=e=>Array.isArray(e)&&typeof e[0]!="number",Ca=e=>Array.isArray(e)&&typeof e[0]=="number",ka={linear:At,easeIn:tb,easeInOut:Pa,easeOut:eb,circIn:es,circInOut:Ta,circOut:Sa,backIn:ts,backInOut:wa,backOut:va,anticipate:xa},rb=e=>typeof e=="string",Da=e=>{if(Ca(e)){qt(e.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[t,n,r,s]=e;return fn(t,n,r,s)}else if(rb(e))return qt(ka[e]!==void 0,`Invalid easing type '${e}'`,"invalid-easing-type"),ka[e];return e},Wn=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function sb(e,t){let n=new Set,r=new Set,s=!1,i=!1;const o=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function c(u){o.has(u)&&(l.schedule(u),e()),u(a)}const l={schedule:(u,h=!1,d=!1)=>{const p=d&&s?n:r;return h&&o.add(u),p.has(u)||p.add(u),u},cancel:u=>{r.delete(u),o.delete(u)},process:u=>{if(a=u,s){i=!0;return}s=!0,[n,r]=[r,n],n.forEach(c),n.clear(),s=!1,i&&(i=!1,l.process(u))}};return l}const ib=40;function Ea(e,t){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,o=Wn.reduce((S,T)=>(S[T]=sb(i),S),{}),{setup:a,read:c,resolveKeyframes:l,preUpdate:u,update:h,preRender:d,render:f,postRender:p}=o,g=()=>{const S=Xt.useManualTiming?s.timestamp:performance.now();n=!1,Xt.useManualTiming||(s.delta=r?1e3/60:Math.max(Math.min(S-s.timestamp,ib),1)),s.timestamp=S,s.isProcessing=!0,a.process(s),c.process(s),l.process(s),u.process(s),h.process(s),d.process(s),f.process(s),p.process(s),s.isProcessing=!1,n&&t&&(r=!1,e(g))},y=()=>{n=!0,r=!0,s.isProcessing||e(g)};return{schedule:Wn.reduce((S,T)=>{const P=o[T];return S[T]=(D,A=!1,C=!1)=>(n||y(),P.schedule(D,A,C)),S},{}),cancel:S=>{for(let T=0;T<Wn.length;T++)o[Wn[T]].cancel(S)},state:s,steps:o}}const{schedule:rt,cancel:ne,state:bt,steps:ns}=Ea(typeof requestAnimationFrame<"u"?requestAnimationFrame:At,!0);let Yn;function ob(){Yn=void 0}const kt={now:()=>(Yn===void 0&&kt.set(bt.isProcessing||Xt.useManualTiming?bt.timestamp:performance.now()),Yn),set:e=>{Yn=e,queueMicrotask(ob)}},Ma=e=>t=>typeof t=="string"&&t.startsWith(e),Aa=Ma("--"),ab=Ma("var(--"),rs=e=>ab(e)?cb.test(e.split("/*")[0].trim()):!1,cb=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Na(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const Le={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},dn={...Le,transform:e=>Gt(0,1,e)},Rn={...Le,default:1},pn=e=>Math.round(e*1e5)/1e5,ss=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function ub(e){return e==null}const lb=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,is=(e,t)=>n=>!!(typeof n=="string"&&lb.test(n)&&n.startsWith(e)||t&&!ub(n)&&Object.prototype.hasOwnProperty.call(n,t)),Ia=(e,t,n)=>r=>{if(typeof r!="string")return r;const[s,i,o,a]=r.match(ss);return{[e]:parseFloat(s),[t]:parseFloat(i),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},hb=e=>Gt(0,255,e),os={...Le,transform:e=>Math.round(hb(e))},me={test:is("rgb","red"),parse:Ia("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+os.transform(e)+", "+os.transform(t)+", "+os.transform(n)+", "+pn(dn.transform(r))+")"};function fb(e){let t="",n="",r="",s="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),s=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),s=e.substring(4,5),t+=t,n+=n,r+=r,s+=s),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:s?parseInt(s,16)/255:1}}const as={test:is("#"),parse:fb,transform:me.transform},mn=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),re=mn("deg"),Wt=mn("%"),O=mn("px"),db=mn("vh"),pb=mn("vw"),Oa={...Wt,parse:e=>Wt.parse(e)/100,transform:e=>Wt.transform(e*100)},Fe={test:is("hsl","hue"),parse:Ia("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+Wt.transform(pn(t))+", "+Wt.transform(pn(n))+", "+pn(dn.transform(r))+")"},mt={test:e=>me.test(e)||as.test(e)||Fe.test(e),parse:e=>me.test(e)?me.parse(e):Fe.test(e)?Fe.parse(e):as.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?me.transform(e):Fe.transform(e),getAnimatableNone:e=>{const t=mt.parse(e);return t.alpha=0,mt.transform(t)}},mb=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function gb(e){return isNaN(e)&&typeof e=="string"&&(e.match(ss)?.length||0)+(e.match(mb)?.length||0)>0}const Va="number",La="color",yb="var",bb="var(",Fa="${}",vb=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function gn(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},s=[];let i=0;const a=t.replace(vb,c=>(mt.test(c)?(r.color.push(i),s.push(La),n.push(mt.parse(c))):c.startsWith(bb)?(r.var.push(i),s.push(yb),n.push(c)):(r.number.push(i),s.push(Va),n.push(parseFloat(c))),++i,Fa)).split(Fa);return{values:n,split:a,indexes:r,types:s}}function _a(e){return gn(e).values}function ja(e){const{split:t,types:n}=gn(e),r=t.length;return s=>{let i="";for(let o=0;o<r;o++)if(i+=t[o],s[o]!==void 0){const a=n[o];a===Va?i+=pn(s[o]):a===La?i+=mt.transform(s[o]):i+=s[o]}return i}}const wb=e=>typeof e=="number"?0:mt.test(e)?mt.getAnimatableNone(e):e;function xb(e){const t=_a(e);return ja(e)(t.map(wb))}const se={test:gb,parse:_a,createTransformer:ja,getAnimatableNone:xb};function cs(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Sb({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let s=0,i=0,o=0;if(!t)s=i=o=n;else{const a=n<.5?n*(1+t):n+t-n*t,c=2*n-a;s=cs(c,a,e+1/3),i=cs(c,a,e),o=cs(c,a,e-1/3)}return{red:Math.round(s*255),green:Math.round(i*255),blue:Math.round(o*255),alpha:r}}function Un(e,t){return n=>n>0?t:e}const at=(e,t,n)=>e+(t-e)*n,us=(e,t,n)=>{const r=e*e,s=n*(t*t-r)+r;return s<0?0:Math.sqrt(s)},Tb=[as,me,Fe],Pb=e=>Tb.find(t=>t.test(e));function Ba(e){const t=Pb(e);if(Ve(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!t)return!1;let n=t.parse(e);return t===Fe&&(n=Sb(n)),n}const Ha=(e,t)=>{const n=Ba(e),r=Ba(t);if(!n||!r)return Un(e,t);const s={...n};return i=>(s.red=us(n.red,r.red,i),s.green=us(n.green,r.green,i),s.blue=us(n.blue,r.blue,i),s.alpha=at(n.alpha,r.alpha,i),me.transform(s))},ls=new Set(["none","hidden"]);function Cb(e,t){return ls.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function kb(e,t){return n=>at(e,t,n)}function hs(e){return typeof e=="number"?kb:typeof e=="string"?rs(e)?Un:mt.test(e)?Ha:Mb:Array.isArray(e)?$a:typeof e=="object"?mt.test(e)?Ha:Db:Un}function $a(e,t){const n=[...e],r=n.length,s=e.map((i,o)=>hs(i)(i,t[o]));return i=>{for(let o=0;o<r;o++)n[o]=s[o](i);return n}}function Db(e,t){const n={...e,...t},r={};for(const s in n)e[s]!==void 0&&t[s]!==void 0&&(r[s]=hs(e[s])(e[s],t[s]));return s=>{for(const i in r)n[i]=r[i](s);return n}}function Eb(e,t){const n=[],r={color:0,var:0,number:0};for(let s=0;s<t.values.length;s++){const i=t.types[s],o=e.indexes[i][r[i]],a=e.values[o]??0;n[s]=a,r[i]++}return n}const Mb=(e,t)=>{const n=se.createTransformer(t),r=gn(e),s=gn(t);return r.indexes.var.length===s.indexes.var.length&&r.indexes.color.length===s.indexes.color.length&&r.indexes.number.length>=s.indexes.number.length?ls.has(e)&&!s.values.length||ls.has(t)&&!r.values.length?Cb(e,t):ln($a(Eb(r,s),s.values),n):(Ve(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,"complex-values-different"),Un(e,t))};function Wa(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?at(e,t,n):hs(e)(e,t)}const Ab=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>rt.update(t,n),stop:()=>ne(t),now:()=>bt.isProcessing?bt.timestamp:kt.now()}},Ya=(e,t,n=10)=>{let r="";const s=Math.max(Math.round(t/n),2);for(let i=0;i<s;i++)r+=Math.round(e(i/(s-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},zn=2e4;function fs(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<zn;)t+=n,r=e.next(t);return t>=zn?1/0:t}function Nb(e,t=100,n){const r=n({...e,keyframes:[0,t]}),s=Math.min(fs(r),zn);return{type:"keyframes",ease:i=>r.next(s*i).value/t,duration:Nt(s)}}const Ib=5;function Ra(e,t,n){const r=Math.max(t-Ib,0);return pa(n-e(r),t-r)}const ct={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},ds=.001;function Ob({duration:e=ct.duration,bounce:t=ct.bounce,velocity:n=ct.velocity,mass:r=ct.mass}){let s,i;Ve(e<=Lt(ct.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let o=1-t;o=Gt(ct.minDamping,ct.maxDamping,o),e=Gt(ct.minDuration,ct.maxDuration,Nt(e)),o<1?(s=l=>{const u=l*o,h=u*e,d=u-n,f=ps(l,o),p=Math.exp(-h);return ds-d/f*p},i=l=>{const h=l*o*e,d=h*n+n,f=Math.pow(o,2)*Math.pow(l,2)*e,p=Math.exp(-h),g=ps(Math.pow(l,2),o);return(-s(l)+ds>0?-1:1)*((d-f)*p)/g}):(s=l=>{const u=Math.exp(-l*e),h=(l-n)*e+1;return-ds+u*h},i=l=>{const u=Math.exp(-l*e),h=(n-l)*(e*e);return u*h});const a=5/e,c=Lb(s,i,a);if(e=Lt(e),isNaN(c))return{stiffness:ct.stiffness,damping:ct.damping,duration:e};{const l=Math.pow(c,2)*r;return{stiffness:l,damping:o*2*Math.sqrt(r*l),duration:e}}}const Vb=12;function Lb(e,t,n){let r=n;for(let s=1;s<Vb;s++)r=r-e(r)/t(r);return r}function ps(e,t){return e*Math.sqrt(1-t*t)}const Fb=["duration","bounce"],_b=["stiffness","damping","mass"];function Ua(e,t){return t.some(n=>e[n]!==void 0)}function jb(e){let t={velocity:ct.velocity,stiffness:ct.stiffness,damping:ct.damping,mass:ct.mass,isResolvedFromDuration:!1,...e};if(!Ua(e,_b)&&Ua(e,Fb))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),s=r*r,i=2*Gt(.05,1,1-(e.bounce||0))*Math.sqrt(s);t={...t,mass:ct.mass,stiffness:s,damping:i}}else{const n=Ob(e);t={...t,...n,mass:ct.mass},t.isResolvedFromDuration=!0}return t}function Kn(e=ct.visualDuration,t=ct.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:s}=n;const i=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],a={done:!1,value:i},{stiffness:c,damping:l,mass:u,duration:h,velocity:d,isResolvedFromDuration:f}=jb({...n,velocity:-Nt(n.velocity||0)}),p=d||0,g=l/(2*Math.sqrt(c*u)),y=o-i,b=Nt(Math.sqrt(c/u)),w=Math.abs(y)<5;r||(r=w?ct.restSpeed.granular:ct.restSpeed.default),s||(s=w?ct.restDelta.granular:ct.restDelta.default);let S;if(g<1){const P=ps(b,g);S=D=>{const A=Math.exp(-g*b*D);return o-A*((p+g*b*y)/P*Math.sin(P*D)+y*Math.cos(P*D))}}else if(g===1)S=P=>o-Math.exp(-b*P)*(y+(p+b*y)*P);else{const P=b*Math.sqrt(g*g-1);S=D=>{const A=Math.exp(-g*b*D),C=Math.min(P*D,300);return o-A*((p+g*b*y)*Math.sinh(C)+P*y*Math.cosh(C))/P}}const T={calculatedDuration:f&&h||null,next:P=>{const D=S(P);if(f)a.done=P>=h;else{let A=P===0?p:0;g<1&&(A=P===0?Lt(p):Ra(S,P,D));const C=Math.abs(A)<=r,E=Math.abs(o-D)<=s;a.done=C&&E}return a.value=a.done?o:D,a},toString:()=>{const P=Math.min(fs(T),zn),D=Ya(A=>T.next(P*A).value,P,30);return P+"ms "+D},toTransition:()=>{}};return T}Kn.applyToOptions=e=>{const t=Nb(e,100,Kn);return e.ease=t.ease,e.duration=Lt(t.duration),e.type="keyframes",e};function ms({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:s=10,bounceStiffness:i=500,modifyTarget:o,min:a,max:c,restDelta:l=.5,restSpeed:u}){const h=e[0],d={done:!1,value:h},f=C=>a!==void 0&&C<a||c!==void 0&&C>c,p=C=>a===void 0?c:c===void 0||Math.abs(a-C)<Math.abs(c-C)?a:c;let g=n*t;const y=h+g,b=o===void 0?y:o(y);b!==y&&(g=b-h);const w=C=>-g*Math.exp(-C/r),S=C=>b+w(C),T=C=>{const E=w(C),j=S(C);d.done=Math.abs(E)<=l,d.value=d.done?b:j};let P,D;const A=C=>{f(d.value)&&(P=C,D=Kn({keyframes:[d.value,p(d.value)],velocity:Ra(S,C,d.value),damping:s,stiffness:i,restDelta:l,restSpeed:u}))};return A(0),{calculatedDuration:null,next:C=>{let E=!1;return!D&&P===void 0&&(E=!0,T(C),A(C)),P!==void 0&&C>=P?D.next(C-P):(!E&&T(C),d)}}}function Bb(e,t,n){const r=[],s=n||Xt.mix||Wa,i=e.length-1;for(let o=0;o<i;o++){let a=s(e[o],e[o+1]);if(t){const c=Array.isArray(t)?t[o]||At:t;a=ln(c,a)}r.push(a)}return r}function Hb(e,t,{clamp:n=!0,ease:r,mixer:s}={}){const i=e.length;if(qt(i===t.length,"Both input and output ranges must be the same length","range-length"),i===1)return()=>t[0];if(i===2&&t[0]===t[1])return()=>t[1];const o=e[0]===e[1];e[0]>e[i-1]&&(e=[...e].reverse(),t=[...t].reverse());const a=Bb(t,r,s),c=a.length,l=u=>{if(o&&u<e[0])return t[0];let h=0;if(c>1)for(;h<e.length-2&&!(u<e[h+1]);h++);const d=hn(e[h],e[h+1],u);return a[h](d)};return n?u=>l(Gt(e[0],e[i-1],u)):l}function $b(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const s=hn(0,t,r);e.push(at(n,1,s))}}function Wb(e){const t=[0];return $b(t,e.length-1),t}function Yb(e,t){return e.map(n=>n*t)}function Rb(e,t){return e.map(()=>t||Pa).splice(0,e.length-1)}function _e({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const s=nb(r)?r.map(Da):Da(r),i={done:!1,value:t[0]},o=Yb(n&&n.length===t.length?n:Wb(t),e),a=Hb(o,t,{ease:Array.isArray(s)?s:Rb(t,s)});return{calculatedDuration:e,next:c=>(i.value=a(c),i.done=c>=e,i)}}const Ub=e=>e!==null;function gs(e,{repeat:t,repeatType:n="loop"},r,s=1){const i=e.filter(Ub),a=s<0||t&&n!=="loop"&&t%2===1?0:i.length-1;return!a||r===void 0?i[a]:r}const zb={decay:ms,inertia:ms,tween:_e,keyframes:_e,spring:Kn};function za(e){typeof e.type=="string"&&(e.type=zb[e.type])}class ys{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,n){return this.finished.then(t,n)}}const Kb=e=>e/100;class bs extends ys{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{const{motionValue:n}=this.options;n&&n.updatedAt!==kt.now()&&this.tick(kt.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;za(t);const{type:n=_e,repeat:r=0,repeatDelay:s=0,repeatType:i,velocity:o=0}=t;let{keyframes:a}=t;const c=n||_e;process.env.NODE_ENV!=="production"&&c!==_e&&qt(a.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${a}`,"spring-two-frames"),c!==_e&&typeof a[0]!="number"&&(this.mixKeyframes=ln(Kb,Wa(a[0],a[1])),a=[0,100]);const l=c({...t,keyframes:a});i==="mirror"&&(this.mirroredGenerator=c({...t,keyframes:[...a].reverse(),velocity:-o})),l.calculatedDuration===null&&(l.calculatedDuration=fs(l));const{calculatedDuration:u}=l;this.calculatedDuration=u,this.resolvedDuration=u+s,this.totalDuration=this.resolvedDuration*(r+1)-s,this.generator=l}updateTime(t){const n=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(t,n=!1){const{generator:r,totalDuration:s,mixKeyframes:i,mirroredGenerator:o,resolvedDuration:a,calculatedDuration:c}=this;if(this.startTime===null)return r.next(0);const{delay:l=0,keyframes:u,repeat:h,repeatType:d,repeatDelay:f,type:p,onUpdate:g,finalKeyframe:y}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-s/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const b=this.currentTime-l*(this.playbackSpeed>=0?1:-1),w=this.playbackSpeed>=0?b<0:b>s;this.currentTime=Math.max(b,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=s);let S=this.currentTime,T=r;if(h){const C=Math.min(this.currentTime,s)/a;let E=Math.floor(C),j=C%1;!j&&C>=1&&(j=1),j===1&&E--,E=Math.min(E,h+1),E%2&&(d==="reverse"?(j=1-j,f&&(j-=f/a)):d==="mirror"&&(T=o)),S=Gt(0,1,j)*a}const P=w?{done:!1,value:u[0]}:T.next(S);i&&(P.value=i(P.value));let{done:D}=P;!w&&c!==null&&(D=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const A=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&D);return A&&p!==ms&&(P.value=gs(u,this.options,y,this.speed)),g&&g(P.value),A&&this.finish(),P}then(t,n){return this.finished.then(t,n)}get duration(){return Nt(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Nt(t)}get time(){return Nt(this.currentTime)}set time(t){t=Lt(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(kt.now());const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=Nt(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=Ab,startTime:n}=this.options;this.driver||(this.driver=t(s=>this.tick(s))),this.options.onPlay?.();const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=n??r),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(kt.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}function Gb(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const ge=e=>e*180/Math.PI,vs=e=>{const t=ge(Math.atan2(e[1],e[0]));return ws(t)},qb={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:vs,rotateZ:vs,skewX:e=>ge(Math.atan(e[1])),skewY:e=>ge(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},ws=e=>(e=e%360,e<0&&(e+=360),e),Ka=vs,Ga=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),qa=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),Xb={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Ga,scaleY:qa,scale:e=>(Ga(e)+qa(e))/2,rotateX:e=>ws(ge(Math.atan2(e[6],e[5]))),rotateY:e=>ws(ge(Math.atan2(-e[2],e[0]))),rotateZ:Ka,rotate:Ka,skewX:e=>ge(Math.atan(e[4])),skewY:e=>ge(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function xs(e){return e.includes("scale")?1:0}function Ss(e,t){if(!e||e==="none")return xs(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,s;if(n)r=Xb,s=n;else{const a=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=qb,s=a}if(!s)return xs(t);const i=r[t],o=s[1].split(",").map(Qb);return typeof i=="function"?i(o):o[i]}const Zb=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return Ss(n,t)};function Qb(e){return parseFloat(e.trim())}const je=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Be=new Set(je),Xa=e=>e===Le||e===O,Jb=new Set(["x","y","z"]),tv=je.filter(e=>!Jb.has(e));function ev(e){const t=[];return tv.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const ie={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>Ss(t,"x"),y:(e,{transform:t})=>Ss(t,"y")};ie.translateX=ie.x,ie.translateY=ie.y;const ye=new Set;let Ts=!1,Ps=!1,Cs=!1;function Za(){if(Ps){const e=Array.from(ye).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const s=ev(r);s.length&&(n.set(r,s),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const s=n.get(r);s&&s.forEach(([i,o])=>{r.getValue(i)?.set(o)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}Ps=!1,Ts=!1,ye.forEach(e=>e.complete(Cs)),ye.clear()}function Qa(){ye.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Ps=!0)})}function nv(){Cs=!0,Qa(),Za(),Cs=!1}class ks{constructor(t,n,r,s,i,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=s,this.element=i,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(ye.add(this),Ts||(Ts=!0,rt.read(Qa),rt.resolveKeyframes(Za))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:s}=this;if(t[0]===null){const i=s?.get(),o=t[t.length-1];if(i!==void 0)t[0]=i;else if(r&&n){const a=r.readValue(n,o);a!=null&&(t[0]=a)}t[0]===void 0&&(t[0]=o),s&&i===void 0&&s.set(t[0])}Gb(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),ye.delete(this)}cancel(){this.state==="scheduled"&&(ye.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const rv=e=>e.startsWith("--");function sv(e,t,n){rv(t)?e.style.setProperty(t,n):e.style[t]=n}const iv=Zr(()=>window.ScrollTimeline!==void 0),ov={};function av(e,t){const n=Zr(e);return()=>ov[t]??n()}const Ja=av(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),yn=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,tc={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:yn([0,.65,.55,1]),circOut:yn([.55,0,1,.45]),backIn:yn([.31,.01,.66,-.59]),backOut:yn([.33,1.53,.69,.99])};function ec(e,t){if(e)return typeof e=="function"?Ja()?Ya(e,t):"ease-out":Ca(e)?yn(e):Array.isArray(e)?e.map(n=>ec(n,t)||tc.easeOut):tc[e]}function cv(e,t,n,{delay:r=0,duration:s=300,repeat:i=0,repeatType:o="loop",ease:a="easeOut",times:c}={},l=void 0){const u={[t]:n};c&&(u.offset=c);const h=ec(a,s);Array.isArray(h)&&(u.easing=h);const d={delay:r,duration:s,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:i+1,direction:o==="reverse"?"alternate":"normal"};return l&&(d.pseudoElement=l),e.animate(u,d)}function nc(e){return typeof e=="function"&&"applyToOptions"in e}function uv({type:e,...t}){return nc(e)&&Ja()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class lv extends ys{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,!t)return;const{element:n,name:r,keyframes:s,pseudoElement:i,allowFlatten:o=!1,finalKeyframe:a,onComplete:c}=t;this.isPseudoElement=!!i,this.allowFlatten=o,this.options=t,qt(typeof t.type!="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");const l=uv(t);this.animation=cv(n,r,s,l,i),l.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){const u=gs(s,this.options,a,this.speed);this.updateMotionValue?this.updateMotionValue(u):sv(n,r,u),this.animation.cancel()}c?.(),this.notifyFinished()}}play(){this.isStopped||(this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){this.isPseudoElement||this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return Nt(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Nt(t)}get time(){return Nt(Number(this.animation.currentTime)||0)}set time(t){this.finishedTime=null,this.animation.currentTime=Lt(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(t){this.animation.startTime=t}attachTimeline({timeline:t,observe:n}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&iv()?(this.animation.timeline=t,At):n(this)}}const rc={anticipate:xa,backInOut:wa,circInOut:Ta};function hv(e){return e in rc}function fv(e){typeof e.ease=="string"&&hv(e.ease)&&(e.ease=rc[e.ease])}const sc=10;class dv extends lv{constructor(t){fv(t),za(t),super(t),t.startTime&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:r,onComplete:s,element:i,...o}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const a=new bs({...o,autoplay:!1}),c=Lt(this.finishedTime??this.time);n.setWithVelocity(a.sample(c-sc).value,a.sample(c).value,sc),a.stop()}}const ic=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(se.test(e)||e==="0")&&!e.startsWith("url("));function pv(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function mv(e,t,n,r){const s=e[0];if(s===null)return!1;if(t==="display"||t==="visibility")return!0;const i=e[e.length-1],o=ic(s,t),a=ic(i,t);return Ve(o===a,`You are trying to animate ${t} from "${s}" to "${i}". "${o?i:s}" is not an animatable value.`,"value-not-animatable"),!o||!a?!1:pv(e)||(n==="spring"||nc(n))&&r}function Ds(e){e.duration=0,e.type="keyframes"}const gv=new Set(["opacity","clipPath","filter","transform"]),yv=Zr(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function bv(e){const{motionValue:t,name:n,repeatDelay:r,repeatType:s,damping:i,type:o}=e;if(!(t?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:l}=t.owner.getProps();return yv()&&n&&gv.has(n)&&(n!=="transform"||!l)&&!c&&!r&&s!=="mirror"&&i!==0&&o!=="inertia"}const vv=40;class wv extends ys{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:o="loop",keyframes:a,name:c,motionValue:l,element:u,...h}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=kt.now();const d={autoplay:t,delay:n,type:r,repeat:s,repeatDelay:i,repeatType:o,name:c,motionValue:l,element:u,...h},f=u?.KeyframeResolver||ks;this.keyframeResolver=new f(a,(p,g,y)=>this.onKeyframesResolved(p,g,d,!y),c,l,u),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,n,r,s){this.keyframeResolver=void 0;const{name:i,type:o,velocity:a,delay:c,isHandoff:l,onUpdate:u}=r;this.resolvedAt=kt.now(),mv(t,i,o,a)||((Xt.instantAnimations||!c)&&u?.(gs(t,r,n)),t[0]=t[t.length-1],Ds(r),r.repeat=0);const d={startTime:s?this.resolvedAt?this.resolvedAt-this.createdAt>vv?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:t},f=!l&&bv(d)?new dv({...d,element:d.motionValue.owner.current}):new bs(d);f.finished.then(()=>this.notifyFinished()).catch(At),this.pendingTimeline&&(this.stopTimeline=f.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=f}get finished(){return this._animation?this.animation.finished:this._finished}then(t,n){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),nv()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}const xv=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Sv(e){const t=xv.exec(e);if(!t)return[,];const[,n,r,s]=t;return[`--${n??r}`,s]}const Tv=4;function oc(e,t,n=1){qt(n<=Tv,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[r,s]=Sv(e);if(!r)return;const i=window.getComputedStyle(t).getPropertyValue(r);if(i){const o=i.trim();return ha(o)?parseFloat(o):o}return rs(s)?oc(s,t,n+1):s}function Es(e,t){return e?.[t]??e?.default??e}const ac=new Set(["width","height","top","left","right","bottom",...je]),Pv={test:e=>e==="auto",parse:e=>e},cc=e=>t=>t.test(e),uc=[Le,O,Wt,re,pb,db,Pv],lc=e=>uc.find(cc(e));function Cv(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||da(e):!0}const kv=new Set(["brightness","contrast","saturate","opacity"]);function Dv(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(ss)||[];if(!r)return e;const s=n.replace(r,"");let i=kv.has(t)?1:0;return r!==n&&(i*=100),t+"("+i+s+")"}const Ev=/\b([a-z-]*)\(.*?\)/gu,Ms={...se,getAnimatableNone:e=>{const t=e.match(Ev);return t?t.map(Dv).join(" "):e}},hc={...Le,transform:Math.round},As={borderWidth:O,borderTopWidth:O,borderRightWidth:O,borderBottomWidth:O,borderLeftWidth:O,borderRadius:O,radius:O,borderTopLeftRadius:O,borderTopRightRadius:O,borderBottomRightRadius:O,borderBottomLeftRadius:O,width:O,maxWidth:O,height:O,maxHeight:O,top:O,right:O,bottom:O,left:O,inset:O,insetBlock:O,insetBlockStart:O,insetBlockEnd:O,insetInline:O,insetInlineStart:O,insetInlineEnd:O,padding:O,paddingTop:O,paddingRight:O,paddingBottom:O,paddingLeft:O,paddingBlock:O,paddingBlockStart:O,paddingBlockEnd:O,paddingInline:O,paddingInlineStart:O,paddingInlineEnd:O,margin:O,marginTop:O,marginRight:O,marginBottom:O,marginLeft:O,marginBlock:O,marginBlockStart:O,marginBlockEnd:O,marginInline:O,marginInlineStart:O,marginInlineEnd:O,backgroundPositionX:O,backgroundPositionY:O,...{rotate:re,rotateX:re,rotateY:re,rotateZ:re,scale:Rn,scaleX:Rn,scaleY:Rn,scaleZ:Rn,skew:re,skewX:re,skewY:re,distance:O,translateX:O,translateY:O,translateZ:O,x:O,y:O,z:O,perspective:O,transformPerspective:O,opacity:dn,originX:Oa,originY:Oa,originZ:O},zIndex:hc,fillOpacity:dn,strokeOpacity:dn,numOctaves:hc},Mv={...As,color:mt,backgroundColor:mt,outlineColor:mt,fill:mt,stroke:mt,borderColor:mt,borderTopColor:mt,borderRightColor:mt,borderBottomColor:mt,borderLeftColor:mt,filter:Ms,WebkitFilter:Ms},fc=e=>Mv[e];function dc(e,t){let n=fc(e);return n!==Ms&&(n=se),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const Av=new Set(["auto","none","0"]);function Nv(e,t,n){let r=0,s;for(;r<e.length&&!s;){const i=e[r];typeof i=="string"&&!Av.has(i)&&gn(i).values.length&&(s=e[r]),r++}if(s&&n)for(const i of t)e[i]=dc(n,s)}class Iv extends ks{constructor(t,n,r,s,i){super(t,n,r,s,i,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let u=0;u<t.length;u++){let h=t[u];if(typeof h=="string"&&(h=h.trim(),rs(h))){const d=oc(h,n.current);d!==void 0&&(t[u]=d),u===t.length-1&&(this.finalKeyframe=h)}}if(this.resolveNoneKeyframes(),!ac.has(r)||t.length!==2)return;const[s,i]=t,o=lc(s),a=lc(i),c=Na(s),l=Na(i);if(c!==l&&ie[r]){this.needsMeasurement=!0;return}if(o!==a)if(Xa(o)&&Xa(a))for(let u=0;u<t.length;u++){const h=t[u];typeof h=="string"&&(t[u]=parseFloat(h))}else ie[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let s=0;s<t.length;s++)(t[s]===null||Cv(t[s]))&&r.push(s);r.length&&Nv(t,r,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=ie[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const s=n[n.length-1];s!==void 0&&t.getValue(r,s).jump(s,!1)}measureEndState(){const{element:t,name:n,unresolvedKeyframes:r}=this;if(!t||!t.current)return;const s=t.getValue(n);s&&s.jump(this.measuredOrigin,!1);const i=r.length-1,o=r[i];r[i]=ie[n](t.measureViewportBox(),window.getComputedStyle(t.current)),o!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=o),this.removedTransforms?.length&&this.removedTransforms.forEach(([a,c])=>{t.getValue(a).set(c)}),this.resolveNoneKeyframes()}}function Ov(e,t,n){if(e instanceof EventTarget)return[e];if(typeof e=="string"){let r=document;const s=n?.[e]??r.querySelectorAll(e);return s?Array.from(s):[]}return Array.from(e)}const pc=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function Vv(e){return fa(e)&&"offsetHeight"in e}const mc=30,Lv=e=>!isNaN(parseFloat(e));class Fv{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{const s=kt.now();if(this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const i of this.dependents)i.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=kt.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=Lv(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return process.env.NODE_ENV!=="production"&&Jr(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new Qr);const r=this.events[t].add(n);return t==="change"?()=>{r(),rt.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=kt.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>mc)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,mc);return pa(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function He(e,t){return new Fv(e,t)}const{schedule:Ns}=Ea(queueMicrotask,!1),Ft={x:!1,y:!1};function gc(){return Ft.x||Ft.y}function _v(e){return e==="x"||e==="y"?Ft[e]?null:(Ft[e]=!0,()=>{Ft[e]=!1}):Ft.x||Ft.y?null:(Ft.x=Ft.y=!0,()=>{Ft.x=Ft.y=!1})}function yc(e,t){const n=Ov(e),r=new AbortController,s={passive:!0,...t,signal:r.signal};return[n,s,()=>r.abort()]}function bc(e){return!(e.pointerType==="touch"||gc())}function jv(e,t,n={}){const[r,s,i]=yc(e,n),o=a=>{if(!bc(a))return;const{target:c}=a,l=t(c,a);if(typeof l!="function"||!c)return;const u=h=>{bc(h)&&(l(h),c.removeEventListener("pointerleave",u))};c.addEventListener("pointerleave",u,s)};return r.forEach(a=>{a.addEventListener("pointerenter",o,s)}),i}const vc=(e,t)=>t?e===t?!0:vc(e,t.parentElement):!1,Is=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,Bv=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function wc(e){return Bv.has(e.tagName)||e.isContentEditable===!0}const Gn=new WeakSet;function xc(e){return t=>{t.key==="Enter"&&e(t)}}function Os(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const Hv=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=xc(()=>{if(Gn.has(n))return;Os(n,"down");const s=xc(()=>{Os(n,"up")}),i=()=>Os(n,"cancel");n.addEventListener("keyup",s,t),n.addEventListener("blur",i,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function Sc(e){return Is(e)&&!gc()}function $v(e,t,n={}){const[r,s,i]=yc(e,n),o=a=>{const c=a.currentTarget;if(!Sc(a))return;Gn.add(c);const l=t(c,a),u=(f,p)=>{window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",d),Gn.has(c)&&Gn.delete(c),Sc(f)&&typeof l=="function"&&l(f,{success:p})},h=f=>{u(f,c===window||c===document||n.useGlobalTarget||vc(c,f.target))},d=f=>{u(f,!1)};window.addEventListener("pointerup",h,s),window.addEventListener("pointercancel",d,s)};return r.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",o,s),Vv(a)&&(a.addEventListener("focus",l=>Hv(l,s)),!wc(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),i}function Tc(e){return fa(e)&&"ownerSVGElement"in e}function Wv(e){return Tc(e)&&e.tagName==="svg"}const Pt=e=>!!(e&&e.getVelocity),Yv=[...uc,mt,se],Rv=e=>Yv.find(cc(e)),Pc=m.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function Uv(e=!0){const t=m.useContext(Kr);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:s}=t,i=m.useId();m.useEffect(()=>{if(e)return s(i)},[e]);const o=m.useCallback(()=>e&&r&&r(i),[i,r,e]);return!n&&r?[!1,o]:[!0]}const Cc=m.createContext({strict:!1}),kc={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},$e={};for(const e in kc)$e[e]={isEnabled:t=>kc[e].some(n=>!!t[n])};function zv(e){for(const t in e)$e[t]={...$e[t],...e[t]}}const Kv=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function qn(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||Kv.has(e)}let Dc=e=>!qn(e);function Gv(e){typeof e=="function"&&(Dc=t=>t.startsWith("on")?!qn(t):e(t))}try{Gv(require("@emotion/is-prop-valid").default)}catch{}function qv(e,t,n){const r={};for(const s in e)s==="values"&&typeof e.values=="object"||(Dc(s)||n===!0&&qn(s)||!t&&!qn(s)||e.draggable&&s.startsWith("onDrag"))&&(r[s]=e[s]);return r}const Xn=m.createContext({});function Zn(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function bn(e){return typeof e=="string"||Array.isArray(e)}const Vs=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Ls=["initial",...Vs];function Qn(e){return Zn(e.animate)||Ls.some(t=>bn(e[t]))}function Ec(e){return!!(Qn(e)||e.variants)}function Xv(e,t){if(Qn(e)){const{initial:n,animate:r}=e;return{initial:n===!1||bn(n)?n:void 0,animate:bn(r)?r:void 0}}return e.inherit!==!1?t:{}}function Zv(e){const{initial:t,animate:n}=Xv(e,m.useContext(Xn));return m.useMemo(()=>({initial:t,animate:n}),[Mc(t),Mc(n)])}function Mc(e){return Array.isArray(e)?e.join(" "):e}function Ac(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const vn={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(O.test(e))e=parseFloat(e);else return e;const n=Ac(e,t.target.x),r=Ac(e,t.target.y);return`${n}% ${r}%`}},Qv={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,s=se.parse(e);if(s.length>5)return r;const i=se.createTransformer(e),o=typeof s[0]!="number"?1:0,a=n.x.scale*t.x,c=n.y.scale*t.y;s[0+o]/=a,s[1+o]/=c;const l=at(a,c,.5);return typeof s[2+o]=="number"&&(s[2+o]/=l),typeof s[3+o]=="number"&&(s[3+o]/=l),i(s)}},Fs={borderRadius:{...vn,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:vn,borderTopRightRadius:vn,borderBottomLeftRadius:vn,borderBottomRightRadius:vn,boxShadow:Qv};function Nc(e,{layout:t,layoutId:n}){return Be.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!Fs[e]||e==="opacity")}const Jv={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},t0=je.length;function e0(e,t,n){let r="",s=!0;for(let i=0;i<t0;i++){const o=je[i],a=e[o];if(a===void 0)continue;let c=!0;if(typeof a=="number"?c=a===(o.startsWith("scale")?1:0):c=parseFloat(a)===0,!c||n){const l=pc(a,As[o]);if(!c){s=!1;const u=Jv[o]||o;r+=`${u}(${l}) `}n&&(t[o]=l)}}return r=r.trim(),n?r=n(t,s?"":r):s&&(r="none"),r}function _s(e,t,n){const{style:r,vars:s,transformOrigin:i}=e;let o=!1,a=!1;for(const c in t){const l=t[c];if(Be.has(c)){o=!0;continue}else if(Aa(c)){s[c]=l;continue}else{const u=pc(l,As[c]);c.startsWith("origin")?(a=!0,i[c]=u):r[c]=u}}if(t.transform||(o||n?r.transform=e0(t,e.transform,n):r.transform&&(r.transform="none")),a){const{originX:c="50%",originY:l="50%",originZ:u=0}=i;r.transformOrigin=`${c} ${l} ${u}`}}const js=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Ic(e,t,n){for(const r in t)!Pt(t[r])&&!Nc(r,n)&&(e[r]=t[r])}function n0({transformTemplate:e},t){return m.useMemo(()=>{const n=js();return _s(n,t,e),Object.assign({},n.vars,n.style)},[t])}function r0(e,t){const n=e.style||{},r={};return Ic(r,n,e),Object.assign(r,n0(e,t)),r}function s0(e,t){const n={},r=r0(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const i0={offset:"stroke-dashoffset",array:"stroke-dasharray"},o0={offset:"strokeDashoffset",array:"strokeDasharray"};function a0(e,t,n=1,r=0,s=!0){e.pathLength=1;const i=s?i0:o0;e[i.offset]=O.transform(-r);const o=O.transform(t),a=O.transform(n);e[i.array]=`${o} ${a}`}const c0=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function Oc(e,{attrX:t,attrY:n,attrScale:r,pathLength:s,pathSpacing:i=1,pathOffset:o=0,...a},c,l,u){if(_s(e,a,l),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:h,style:d}=e;h.transform&&(d.transform=h.transform,delete h.transform),(d.transform||h.transformOrigin)&&(d.transformOrigin=h.transformOrigin??"50% 50%",delete h.transformOrigin),d.transform&&(d.transformBox=u?.transformBox??"fill-box",delete h.transformBox);for(const f of c0)h[f]!==void 0&&(d[f]=h[f],delete h[f]);t!==void 0&&(h.x=t),n!==void 0&&(h.y=n),r!==void 0&&(h.scale=r),s!==void 0&&a0(h,s,i,o,!1)}const Vc=()=>({...js(),attrs:{}}),Lc=e=>typeof e=="string"&&e.toLowerCase()==="svg";function u0(e,t,n,r){const s=m.useMemo(()=>{const i=Vc();return Oc(i,t,Lc(r),e.transformTemplate,e.style),{...i.attrs,style:{...i.style}}},[t]);if(e.style){const i={};Ic(i,e.style,e),s.style={...i,...s.style}}return s}const l0=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Bs(e){return typeof e!="string"||e.includes("-")?!1:!!(l0.indexOf(e)>-1||/[A-Z]/u.test(e))}function h0(e,t,n,{latestValues:r},s,i=!1,o){const c=(o??Bs(e)?u0:s0)(t,r,s,e),l=qv(t,typeof e=="string",i),u=e!==m.Fragment?{...l,...c,ref:n}:{},{children:h}=t,d=m.useMemo(()=>Pt(h)?h.get():h,[h]);return m.createElement(e,{...u,children:d})}function Fc(e){const t=[{},{}];return e?.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function Hs(e,t,n,r){if(typeof t=="function"){const[s,i]=Fc(r);t=t(n!==void 0?n:e.custom,s,i)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[s,i]=Fc(r);t=t(n!==void 0?n:e.custom,s,i)}return t}function Jn(e){return Pt(e)?e.get():e}function f0({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,s){return{latestValues:d0(n,r,s,e),renderState:t()}}function d0(e,t,n,r){const s={},i=r(e,{});for(const d in i)s[d]=Jn(i[d]);let{initial:o,animate:a}=e;const c=Qn(e),l=Ec(e);t&&l&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),a===void 0&&(a=t.animate));let u=n?n.initial===!1:!1;u=u||o===!1;const h=u?a:o;if(h&&typeof h!="boolean"&&!Zn(h)){const d=Array.isArray(h)?h:[h];for(let f=0;f<d.length;f++){const p=Hs(e,d[f]);if(p){const{transitionEnd:g,transition:y,...b}=p;for(const w in b){let S=b[w];if(Array.isArray(S)){const T=u?S.length-1:0;S=S[T]}S!==null&&(s[w]=S)}for(const w in g)s[w]=g[w]}}}return s}const _c=e=>(t,n)=>{const r=m.useContext(Xn),s=m.useContext(Kr),i=()=>f0(e,t,r,s);return n?i():Gy(i)};function $s(e,t,n){const{style:r}=e,s={};for(const i in r)(Pt(r[i])||t.style&&Pt(t.style[i])||Nc(i,e)||n?.getValue(i)?.liveStyle!==void 0)&&(s[i]=r[i]);return s}const p0=_c({scrapeMotionValuesFromProps:$s,createRenderState:js});function jc(e,t,n){const r=$s(e,t,n);for(const s in e)if(Pt(e[s])||Pt(t[s])){const i=je.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;r[i]=e[s]}return r}const m0=_c({scrapeMotionValuesFromProps:jc,createRenderState:Vc}),g0=Symbol.for("motionComponentSymbol");function y0(e,t,n){const r=m.useRef(n);m.useInsertionEffect(()=>{r.current=n});const s=m.useRef(null);return m.useCallback(i=>{i&&e.onMount?.(i),t&&(i?t.mount(i):t.unmount());const o=r.current;if(typeof o=="function")if(i){const a=o(i);typeof a=="function"&&(s.current=a)}else s.current?(s.current(),s.current=null):o(i);else o&&(o.current=i)},[t])}const Ws=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),Bc="data-"+Ws("framerAppearId"),Hc=m.createContext({});function wn(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function b0(e,t,n,r,s,i){const{visualElement:o}=m.useContext(Xn),a=m.useContext(Cc),c=m.useContext(Kr),l=m.useContext(Pc).reducedMotion,u=m.useRef(null);r=r||a.renderer,!u.current&&r&&(u.current=r(e,{visualState:t,parent:o,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:l,isSVG:i}));const h=u.current,d=m.useContext(Hc);h&&!h.projection&&s&&(h.type==="html"||h.type==="svg")&&v0(u.current,n,s,d);const f=m.useRef(!1);m.useInsertionEffect(()=>{h&&f.current&&h.update(n,c)});const p=n[Bc],g=m.useRef(!!p&&!window.MotionHandoffIsComplete?.(p)&&window.MotionHasOptimisedAnimation?.(p));return qy(()=>{h&&(f.current=!0,window.MotionIsMounted=!0,h.updateFeatures(),h.scheduleRenderMicrotask(),g.current&&h.animationState&&h.animationState.animateChanges())}),m.useEffect(()=>{h&&(!g.current&&h.animationState&&h.animationState.animateChanges(),g.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(p)}),g.current=!1),h.enteringChildren=void 0)}),h}function v0(e,t,n,r){const{layoutId:s,layout:i,drag:o,dragConstraints:a,layoutScroll:c,layoutRoot:l,layoutCrossfade:u}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:$c(e.parent)),e.projection.setOptions({layoutId:s,layout:i,alwaysMeasureLayout:!!o||a&&wn(a),visualElement:e,animationType:typeof i=="string"?i:"both",initialPromotionConfig:r,crossfade:u,layoutScroll:c,layoutRoot:l})}function $c(e){if(e)return e.options.allowProjection!==!1?e.projection:$c(e.parent)}function Ys(e,{forwardMotionProps:t=!1,type:n}={},r,s){r&&zv(r);const i=n?n==="svg":Bs(e),o=i?m0:p0;function a(l,u){let h;const d={...m.useContext(Pc),...l,layoutId:w0(l)},{isStatic:f}=d,p=Zv(l),g=o(l,f);if(!f&&zr){x0(d,r);const y=S0(d);h=y.MeasureLayout,p.visualElement=b0(e,g,d,s,y.ProjectionNode,i)}return v.jsxs(Xn.Provider,{value:p,children:[h&&p.visualElement?v.jsx(h,{visualElement:p.visualElement,...d}):null,h0(e,l,y0(g,p.visualElement,u),g,f,t,i)]})}a.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const c=m.forwardRef(a);return c[g0]=e,c}function w0({layoutId:e}){const t=m.useContext(la).id;return t&&e!==void 0?t+"-"+e:e}function x0(e,t){const n=m.useContext(Cc).strict;if(process.env.NODE_ENV!=="production"&&t&&n){const r="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";e.ignoreStrict?Ve(!1,r,"lazy-strict-mode"):qt(!1,r,"lazy-strict-mode")}}function S0(e){const{drag:t,layout:n}=$e;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function T0(e,t){if(typeof Proxy>"u")return Ys;const n=new Map,r=(i,o)=>Ys(i,o,e,t),s=(i,o)=>(process.env.NODE_ENV!=="production"&&Jr(!1,"motion() is deprecated. Use motion.create() instead."),r(i,o));return new Proxy(s,{get:(i,o)=>o==="create"?r:(n.has(o)||n.set(o,Ys(o,void 0,e,t)),n.get(o))})}function Wc({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function P0({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function C0(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function Rs(e){return e===void 0||e===1}function Us({scale:e,scaleX:t,scaleY:n}){return!Rs(e)||!Rs(t)||!Rs(n)}function be(e){return Us(e)||Yc(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Yc(e){return Rc(e.x)||Rc(e.y)}function Rc(e){return e&&e!=="0%"}function tr(e,t,n){const r=e-n,s=t*r;return n+s}function Uc(e,t,n,r,s){return s!==void 0&&(e=tr(e,s,r)),tr(e,n,r)+t}function zs(e,t=0,n=1,r,s){e.min=Uc(e.min,t,n,r,s),e.max=Uc(e.max,t,n,r,s)}function zc(e,{x:t,y:n}){zs(e.x,t.translate,t.scale,t.originPoint),zs(e.y,n.translate,n.scale,n.originPoint)}const Kc=.999999999999,Gc=1.0000000000001;function k0(e,t,n,r=!1){const s=n.length;if(!s)return;t.x=t.y=1;let i,o;for(let a=0;a<s;a++){i=n[a],o=i.projectionDelta;const{visualElement:c}=i.options;c&&c.props.style&&c.props.style.display==="contents"||(r&&i.options.layoutScroll&&i.scroll&&i!==i.root&&Ye(e,{x:-i.scroll.offset.x,y:-i.scroll.offset.y}),o&&(t.x*=o.x.scale,t.y*=o.y.scale,zc(e,o)),r&&be(i.latestValues)&&Ye(e,i.latestValues))}t.x<Gc&&t.x>Kc&&(t.x=1),t.y<Gc&&t.y>Kc&&(t.y=1)}function We(e,t){e.min=e.min+t,e.max=e.max+t}function qc(e,t,n,r,s=.5){const i=at(e.min,e.max,s);zs(e,t,n,i,r)}function Ye(e,t){qc(e.x,t.x,t.scaleX,t.scale,t.originX),qc(e.y,t.y,t.scaleY,t.scale,t.originY)}function Xc(e,t){return Wc(C0(e.getBoundingClientRect(),t))}function D0(e,t,n){const r=Xc(e,n),{scroll:s}=t;return s&&(We(r.x,s.offset.x),We(r.y,s.offset.y)),r}const Zc=()=>({translate:0,scale:1,origin:0,originPoint:0}),Re=()=>({x:Zc(),y:Zc()}),Qc=()=>({min:0,max:0}),gt=()=>({x:Qc(),y:Qc()}),Ks={current:null},Jc={current:!1};function E0(){if(Jc.current=!0,!!zr)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Ks.current=e.matches;e.addEventListener("change",t),t()}else Ks.current=!1}const M0=new WeakMap;function A0(e,t,n){for(const r in t){const s=t[r],i=n[r];if(Pt(s))e.addValue(r,s);else if(Pt(i))e.addValue(r,He(s,{owner:e}));else if(i!==s)if(e.hasValue(r)){const o=e.getValue(r);o.liveStyle===!0?o.jump(s):o.hasAnimated||o.set(s)}else{const o=e.getStaticValue(r);e.addValue(r,He(o!==void 0?o:s,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const tu=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class N0{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:s,blockInitialAnimation:i,visualState:o},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=ks,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const d=kt.now();this.renderScheduledAt<d&&(this.renderScheduledAt=d,rt.render(this.render,!1,!0))};const{latestValues:c,renderState:l}=o;this.latestValues=c,this.baseTarget={...c},this.initialValues=n.initial?{...c}:{},this.renderState=l,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=s,this.options=a,this.blockInitialAnimation=!!i,this.isControllingVariants=Qn(n),this.isVariantNode=Ec(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:u,...h}=this.scrapeMotionValuesFromProps(n,{},this);for(const d in h){const f=h[d];c[d]!==void 0&&Pt(f)&&f.set(c[d])}}mount(t){this.current=t,M0.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,r)=>this.bindToMotionValue(r,n)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(Jc.current||E0(),this.shouldReduceMotion=Ks.current),process.env.NODE_ENV!=="production"&&Jr(this.shouldReduceMotion!==!0,"You have Reduced Motion enabled on your device. Animations may not appear as expected.","reduced-motion-disabled"),this.parent?.addChild(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),ne(this.notifyUpdate),ne(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const r=Be.has(t);r&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",o=>{this.latestValues[t]=o,this.props.onUpdate&&rt.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let i;window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{s(),i&&i(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in $e){const n=$e[t];if(!n)continue;const{isEnabled:r,Feature:s}=n;if(!this.features[t]&&s&&r(this.props)&&(this.features[t]=new s(this)),this.features[t]){const i=this.features[t];i.isMounted?i.update():(i.mount(),i.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):gt()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<tu.length;r++){const s=tu[r];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);const i="on"+s,o=t[i];o&&(this.propEventSubscriptions[s]=this.on(s,o))}this.prevMotionValues=A0(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=He(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){let r=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return r!=null&&(typeof r=="string"&&(ha(r)||da(r))?r=parseFloat(r):!Rv(r)&&se.test(n)&&(r=dc(t,n)),this.setBaseTarget(t,Pt(r)?r.get():r)),Pt(r)?r.get():r}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const i=Hs(this.props,n,this.presenceContext?.custom);i&&(r=i[t])}if(n&&r!==void 0)return r;const s=this.getBaseTargetFromProps(this.props,t);return s!==void 0&&!Pt(s)?s:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new Qr),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){Ns.render(this.render)}}class eu extends N0{constructor(){super(...arguments),this.KeyframeResolver=Iv}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Pt(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function nu(e,{style:t,vars:n},r,s){const i=e.style;let o;for(o in t)i[o]=t[o];s?.applyProjectionStyles(i,r);for(o in n)i.setProperty(o,n[o])}function I0(e){return window.getComputedStyle(e)}class O0 extends eu{constructor(){super(...arguments),this.type="html",this.renderInstance=nu}readValueFromInstance(t,n){if(Be.has(n))return this.projection?.isProjecting?xs(n):Zb(t,n);{const r=I0(t),s=(Aa(n)?r.getPropertyValue(n):r[n])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(t,{transformPagePoint:n}){return Xc(t,n)}build(t,n,r){_s(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return $s(t,n,r)}}const ru=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function V0(e,t,n,r){nu(e,t,void 0,r);for(const s in t.attrs)e.setAttribute(ru.has(s)?s:Ws(s),t.attrs[s])}class L0 extends eu{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=gt}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Be.has(n)){const r=fc(n);return r&&r.default||0}return n=ru.has(n)?n:Ws(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return jc(t,n,r)}build(t,n,r){Oc(t,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,n,r,s){V0(t,n,r,s)}mount(t){this.isSVGTag=Lc(t.tagName),super.mount(t)}}const F0=(e,t)=>t.isSVG??Bs(e)?new L0(t):new O0(t,{allowProjection:e!==m.Fragment});function Ue(e,t,n){const r=e.getProps();return Hs(r,t,n!==void 0?n:r.custom,e)}const Gs=e=>Array.isArray(e);function _0(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,He(n))}function j0(e){return Gs(e)?e[e.length-1]||0:e}function B0(e,t){const n=Ue(e,t);let{transitionEnd:r={},transition:s={},...i}=n||{};i={...i,...r};for(const o in i){const a=j0(i[o]);_0(e,o,a)}}function H0(e){return!!(Pt(e)&&e.add)}function qs(e,t){const n=e.getValue("willChange");if(H0(n))return n.add(t);if(!n&&Xt.WillChange){const r=new Xt.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function su(e){return e.props[Bc]}const $0=e=>e!==null;function W0(e,{repeat:t,repeatType:n="loop"},r){const s=e.filter($0),i=t&&n!=="loop"&&t%2===1?0:s.length-1;return s[i]}const Y0={type:"spring",stiffness:500,damping:25,restSpeed:10},R0=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),U0={type:"keyframes",duration:.8},z0={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},K0=(e,{keyframes:t})=>t.length>2?U0:Be.has(e)?e.startsWith("scale")?R0(t[1]):Y0:z0;function G0({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:s,repeat:i,repeatType:o,repeatDelay:a,from:c,elapsed:l,...u}){return!!Object.keys(u).length}const Xs=(e,t,n,r={},s,i)=>o=>{const a=Es(r,e)||{},c=a.delay||r.delay||0;let{elapsed:l=0}=r;l=l-Lt(c);const u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-l,onUpdate:d=>{t.set(d),a.onUpdate&&a.onUpdate(d)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:i?void 0:s};G0(a)||Object.assign(u,K0(e,u)),u.duration&&(u.duration=Lt(u.duration)),u.repeatDelay&&(u.repeatDelay=Lt(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let h=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(Ds(u),u.delay===0&&(h=!0)),(Xt.instantAnimations||Xt.skipAnimations)&&(h=!0,Ds(u),u.delay=0),u.allowFlatten=!a.type&&!a.ease,h&&!i&&t.get()!==void 0){const d=W0(u.keyframes,a);if(d!==void 0){rt.update(()=>{u.onUpdate(d),u.onComplete()});return}}return a.isSync?new bs(u):new wv(u)};function q0({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function iu(e,t,{delay:n=0,transitionOverride:r,type:s}={}){let{transition:i=e.getDefaultTransition(),transitionEnd:o,...a}=t;r&&(i=r);const c=[],l=s&&e.animationState&&e.animationState.getState()[s];for(const u in a){const h=e.getValue(u,e.latestValues[u]??null),d=a[u];if(d===void 0||l&&q0(l,u))continue;const f={delay:n,...Es(i||{},u)},p=h.get();if(p!==void 0&&!h.isAnimating&&!Array.isArray(d)&&d===p&&!f.velocity)continue;let g=!1;if(window.MotionHandoffAnimation){const b=su(e);if(b){const w=window.MotionHandoffAnimation(b,u,rt);w!==null&&(f.startTime=w,g=!0)}}qs(e,u),h.start(Xs(u,h,d,e.shouldReduceMotion&&ac.has(u)?{type:!1}:f,e,g));const y=h.animation;y&&c.push(y)}return o&&Promise.all(c).then(()=>{rt.update(()=>{o&&B0(e,o)})}),c}function ou(e,t,n,r=0,s=1){const i=Array.from(e).sort((l,u)=>l.sortNodePosition(u)).indexOf(t),o=e.size,a=(o-1)*r;return typeof n=="function"?n(i,o):s===1?i*r:a-i*r}function Zs(e,t,n={}){const r=Ue(e,t,n.type==="exit"?e.presenceContext?.custom:void 0);let{transition:s=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(s=n.transitionOverride);const i=r?()=>Promise.all(iu(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(c=0)=>{const{delayChildren:l=0,staggerChildren:u,staggerDirection:h}=s;return X0(e,t,c,l,u,h,n)}:()=>Promise.resolve(),{when:a}=s;if(a){const[c,l]=a==="beforeChildren"?[i,o]:[o,i];return c().then(()=>l())}else return Promise.all([i(),o(n.delay)])}function X0(e,t,n=0,r=0,s=0,i=1,o){const a=[];for(const c of e.variantChildren)c.notify("AnimationStart",t),a.push(Zs(c,t,{...o,delay:n+(typeof r=="function"?0:r)+ou(e.variantChildren,c,r,s,i)}).then(()=>c.notify("AnimationComplete",t)));return Promise.all(a)}function Z0(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const s=t.map(i=>Zs(e,i,n));r=Promise.all(s)}else if(typeof t=="string")r=Zs(e,t,n);else{const s=typeof t=="function"?Ue(e,t,n.custom):t;r=Promise.all(iu(e,s,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}function au(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}const Q0=Ls.length;function cu(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?cu(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<Q0;n++){const r=Ls[n],s=e.props[r];(bn(s)||s===!1)&&(t[r]=s)}return t}const J0=[...Vs].reverse(),tw=Vs.length;function ew(e){return t=>Promise.all(t.map(({animation:n,options:r})=>Z0(e,n,r)))}function nw(e){let t=ew(e),n=uu(),r=!0;const s=c=>(l,u)=>{const h=Ue(e,u,c==="exit"?e.presenceContext?.custom:void 0);if(h){const{transition:d,transitionEnd:f,...p}=h;l={...l,...p,...f}}return l};function i(c){t=c(e)}function o(c){const{props:l}=e,u=cu(e.parent)||{},h=[],d=new Set;let f={},p=1/0;for(let y=0;y<tw;y++){const b=J0[y],w=n[b],S=l[b]!==void 0?l[b]:u[b],T=bn(S),P=b===c?w.isActive:null;P===!1&&(p=y);let D=S===u[b]&&S!==l[b]&&T;if(D&&r&&e.manuallyAnimateOnMount&&(D=!1),w.protectedKeys={...f},!w.isActive&&P===null||!S&&!w.prevProp||Zn(S)||typeof S=="boolean")continue;const A=rw(w.prevProp,S);let C=A||b===c&&w.isActive&&!D&&T||y>p&&T,E=!1;const j=Array.isArray(S)?S:[S];let R=j.reduce(s(b),{});P===!1&&(R={});const{prevResolvedValues:F={}}=w,B={...F,...R},N=L=>{C=!0,d.has(L)&&(E=!0,d.delete(L)),w.needsAnimating[L]=!0;const H=e.getValue(L);H&&(H.liveStyle=!1)};for(const L in B){const H=R[L],V=F[L];if(f.hasOwnProperty(L))continue;let Z=!1;Gs(H)&&Gs(V)?Z=!au(H,V):Z=H!==V,Z?H!=null?N(L):d.add(L):H!==void 0&&d.has(L)?N(L):w.protectedKeys[L]=!0}w.prevProp=S,w.prevResolvedValues=R,w.isActive&&(f={...f,...R}),r&&e.blockInitialAnimation&&(C=!1);const I=D&&A;C&&(!I||E)&&h.push(...j.map(L=>{const H={type:b};if(typeof L=="string"&&r&&!I&&e.manuallyAnimateOnMount&&e.parent){const{parent:V}=e,Z=Ue(V,L);if(V.enteringChildren&&Z){const{delayChildren:x}=Z.transition||{};H.delay=ou(V.enteringChildren,e,x)}}return{animation:L,options:H}}))}if(d.size){const y={};if(typeof l.initial!="boolean"){const b=Ue(e,Array.isArray(l.initial)?l.initial[0]:l.initial);b&&b.transition&&(y.transition=b.transition)}d.forEach(b=>{const w=e.getBaseTarget(b),S=e.getValue(b);S&&(S.liveStyle=!0),y[b]=w??null}),h.push({animation:y})}let g=!!h.length;return r&&(l.initial===!1||l.initial===l.animate)&&!e.manuallyAnimateOnMount&&(g=!1),r=!1,g?t(h):Promise.resolve()}function a(c,l){if(n[c].isActive===l)return Promise.resolve();e.variantChildren?.forEach(h=>h.animationState?.setActive(c,l)),n[c].isActive=l;const u=o(c);for(const h in n)n[h].protectedKeys={};return u}return{animateChanges:o,setActive:a,setAnimateFunction:i,getState:()=>n,reset:()=>{n=uu()}}}function rw(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!au(t,e):!1}function ve(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function uu(){return{animate:ve(!0),whileInView:ve(),whileHover:ve(),whileTap:ve(),whileDrag:ve(),whileFocus:ve(),exit:ve()}}class oe{constructor(t){this.isMounted=!1,this.node=t}update(){}}class sw extends oe{constructor(t){super(t),t.animationState||(t.animationState=nw(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Zn(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let iw=0;class ow extends oe{constructor(){super(...arguments),this.id=iw++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;const s=this.node.animationState.setActive("exit",!t);n&&!t&&s.then(()=>{n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const aw={animation:{Feature:sw},exit:{Feature:ow}};function xn(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function Sn(e){return{point:{x:e.pageX,y:e.pageY}}}const cw=e=>t=>Is(t)&&e(t,Sn(t));function Tn(e,t,n,r){return xn(e,t,cw(n),r)}const lu=1e-4,uw=1-lu,lw=1+lu,hu=.01,hw=0-hu,fw=0+hu;function Ct(e){return e.max-e.min}function dw(e,t,n){return Math.abs(e-t)<=n}function fu(e,t,n,r=.5){e.origin=r,e.originPoint=at(t.min,t.max,e.origin),e.scale=Ct(n)/Ct(t),e.translate=at(n.min,n.max,e.origin)-e.originPoint,(e.scale>=uw&&e.scale<=lw||isNaN(e.scale))&&(e.scale=1),(e.translate>=hw&&e.translate<=fw||isNaN(e.translate))&&(e.translate=0)}function Pn(e,t,n,r){fu(e.x,t.x,n.x,r?r.originX:void 0),fu(e.y,t.y,n.y,r?r.originY:void 0)}function du(e,t,n){e.min=n.min+t.min,e.max=e.min+Ct(t)}function pw(e,t,n){du(e.x,t.x,n.x),du(e.y,t.y,n.y)}function pu(e,t,n){e.min=t.min-n.min,e.max=e.min+Ct(t)}function er(e,t,n){pu(e.x,t.x,n.x),pu(e.y,t.y,n.y)}function It(e){return[e("x"),e("y")]}const mu=({current:e})=>e?e.ownerDocument.defaultView:null,gu=(e,t)=>Math.abs(e-t);function mw(e,t){const n=gu(e.x,t.x),r=gu(e.y,t.y);return Math.sqrt(n**2+r**2)}class yu{constructor(t,n,{transformPagePoint:r,contextWindow:s=window,dragSnapToOrigin:i=!1,distanceThreshold:o=3}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const d=Js(this.lastMoveEventInfo,this.history),f=this.startEvent!==null,p=mw(d.offset,{x:0,y:0})>=this.distanceThreshold;if(!f&&!p)return;const{point:g}=d,{timestamp:y}=bt;this.history.push({...g,timestamp:y});const{onStart:b,onMove:w}=this.handlers;f||(b&&b(this.lastMoveEvent,d),this.startEvent=this.lastMoveEvent),w&&w(this.lastMoveEvent,d)},this.handlePointerMove=(d,f)=>{this.lastMoveEvent=d,this.lastMoveEventInfo=Qs(f,this.transformPagePoint),rt.update(this.updatePoint,!0)},this.handlePointerUp=(d,f)=>{this.end();const{onEnd:p,onSessionEnd:g,resumeAnimation:y}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&y&&y(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const b=Js(d.type==="pointercancel"?this.lastMoveEventInfo:Qs(f,this.transformPagePoint),this.history);this.startEvent&&p&&p(d,b),g&&g(d,b)},!Is(t))return;this.dragSnapToOrigin=i,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=o,this.contextWindow=s||window;const a=Sn(t),c=Qs(a,this.transformPagePoint),{point:l}=c,{timestamp:u}=bt;this.history=[{...l,timestamp:u}];const{onSessionStart:h}=n;h&&h(t,Js(c,this.history)),this.removeListeners=ln(Tn(this.contextWindow,"pointermove",this.handlePointerMove),Tn(this.contextWindow,"pointerup",this.handlePointerUp),Tn(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),ne(this.updatePoint)}}function Qs(e,t){return t?{point:t(e.point)}:e}function bu(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Js({point:e},t){return{point:e,delta:bu(e,vu(t)),offset:bu(e,gw(t)),velocity:yw(t,.1)}}function gw(e){return e[0]}function vu(e){return e[e.length-1]}function yw(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const s=vu(e);for(;n>=0&&(r=e[n],!(s.timestamp-r.timestamp>Lt(t)));)n--;if(!r)return{x:0,y:0};const i=Nt(s.timestamp-r.timestamp);if(i===0)return{x:0,y:0};const o={x:(s.x-r.x)/i,y:(s.y-r.y)/i};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function bw(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?at(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?at(n,e,r.max):Math.min(e,n)),e}function wu(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function vw(e,{top:t,left:n,bottom:r,right:s}){return{x:wu(e.x,n,s),y:wu(e.y,t,r)}}function xu(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function ww(e,t){return{x:xu(e.x,t.x),y:xu(e.y,t.y)}}function xw(e,t){let n=.5;const r=Ct(e),s=Ct(t);return s>r?n=hn(t.min,t.max-r,e.min):r>s&&(n=hn(e.min,e.max-s,t.min)),Gt(0,1,n)}function Sw(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const ti=.35;function Tw(e=ti){return e===!1?e=0:e===!0&&(e=ti),{x:Su(e,"left","right"),y:Su(e,"top","bottom")}}function Su(e,t,n){return{min:Tu(e,t),max:Tu(e,n)}}function Tu(e,t){return typeof e=="number"?e:e[t]||0}const Pw=new WeakMap;class Cw{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=gt(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:r}={}){const{presenceContext:s}=this.visualElement;if(s&&s.isPresent===!1)return;const i=h=>{n?(this.stopAnimation(),this.snapToCursor(Sn(h).point)):this.pauseAnimation()},o=(h,d)=>{this.stopAnimation();const{drag:f,dragPropagation:p,onDragStart:g}=this.getProps();if(f&&!p&&(this.openDragLock&&this.openDragLock(),this.openDragLock=_v(f),!this.openDragLock))return;this.latestPointerEvent=h,this.latestPanInfo=d,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),It(b=>{let w=this.getAxisMotionValue(b).get()||0;if(Wt.test(w)){const{projection:S}=this.visualElement;if(S&&S.layout){const T=S.layout.layoutBox[b];T&&(w=Ct(T)*(parseFloat(w)/100))}}this.originPoint[b]=w}),g&&rt.postRender(()=>g(h,d)),qs(this.visualElement,"transform");const{animationState:y}=this.visualElement;y&&y.setActive("whileDrag",!0)},a=(h,d)=>{this.latestPointerEvent=h,this.latestPanInfo=d;const{dragPropagation:f,dragDirectionLock:p,onDirectionLock:g,onDrag:y}=this.getProps();if(!f&&!this.openDragLock)return;const{offset:b}=d;if(p&&this.currentDirection===null){this.currentDirection=kw(b),this.currentDirection!==null&&g&&g(this.currentDirection);return}this.updateAxis("x",d.point,b),this.updateAxis("y",d.point,b),this.visualElement.render(),y&&y(h,d)},c=(h,d)=>{this.latestPointerEvent=h,this.latestPanInfo=d,this.stop(h,d),this.latestPointerEvent=null,this.latestPanInfo=null},l=()=>It(h=>this.getAnimationState(h)==="paused"&&this.getAxisMotionValue(h).animation?.play()),{dragSnapToOrigin:u}=this.getProps();this.panSession=new yu(t,{onSessionStart:i,onStart:o,onMove:a,onSessionEnd:c,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,distanceThreshold:r,contextWindow:mu(this.visualElement)})}stop(t,n){const r=t||this.latestPointerEvent,s=n||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!s||!r)return;const{velocity:o}=s;this.startAnimation(o);const{onDragEnd:a}=this.getProps();a&&rt.postRender(()=>a(r,s))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,r){const{drag:s}=this.getProps();if(!r||!nr(t,s,this.currentDirection))return;const i=this.getAxisMotionValue(t);let o=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(o=bw(o,this.constraints[t],this.elastic[t])),i.set(o)}resolveConstraints(){const{dragConstraints:t,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,s=this.constraints;t&&wn(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=vw(r.layoutBox,t):this.constraints=!1,this.elastic=Tw(n),s!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&It(i=>{this.constraints!==!1&&this.getAxisMotionValue(i)&&(this.constraints[i]=Sw(r.layoutBox[i],this.constraints[i]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!wn(t))return!1;const r=t.current;qt(r!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.","drag-constraints-ref");const{projection:s}=this.visualElement;if(!s||!s.layout)return!1;const i=D0(r,s.root,this.visualElement.getTransformPagePoint());let o=ww(s.layout.layoutBox,i);if(n){const a=n(P0(o));this.hasMutatedConstraints=!!a,a&&(o=Wc(a))}return o}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:s,dragTransition:i,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),c=this.constraints||{},l=It(u=>{if(!nr(u,n,this.currentDirection))return;let h=c&&c[u]||{};o&&(h={min:0,max:0});const d=s?200:1e6,f=s?40:1e7,p={type:"inertia",velocity:r?t[u]:0,bounceStiffness:d,bounceDamping:f,timeConstant:750,restDelta:1,restSpeed:10,...i,...h};return this.startAxisValueAnimation(u,p)});return Promise.all(l).then(a)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return qs(this.visualElement,t),r.start(Xs(t,r,0,n,this.visualElement,!1))}stopAnimation(){It(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){It(t=>this.getAxisMotionValue(t).animation?.pause())}getAnimationState(t){return this.getAxisMotionValue(t).animation?.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),s=r[n];return s||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){It(n=>{const{drag:r}=this.getProps();if(!nr(n,r,this.currentDirection))return;const{projection:s}=this.visualElement,i=this.getAxisMotionValue(n);if(s&&s.layout){const{min:o,max:a}=s.layout.layoutBox[n],c=i.get()||0;i.set(t[n]-at(o,a,.5)+c)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!wn(n)||!r||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};It(o=>{const a=this.getAxisMotionValue(o);if(a&&this.constraints!==!1){const c=a.get();s[o]=xw({min:c,max:c},this.constraints[o])}});const{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),It(o=>{if(!nr(o,t,null))return;const a=this.getAxisMotionValue(o),{min:c,max:l}=this.constraints[o];a.set(at(c,l,s[o]))})}addListeners(){if(!this.visualElement.current)return;Pw.set(this.visualElement,this);const t=this.visualElement.current,n=Tn(t,"pointerdown",c=>{const{drag:l,dragListener:u=!0}=this.getProps();l&&u&&!wc(c.target)&&this.start(c)}),r=()=>{const{dragConstraints:c}=this.getProps();wn(c)&&c.current&&(this.constraints=this.resolveRefConstraints())},{projection:s}=this.visualElement,i=s.addEventListener("measure",r);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),rt.read(r);const o=xn(window,"resize",()=>this.scalePositionWithinConstraints()),a=s.addEventListener("didUpdate",(({delta:c,hasLayoutChanged:l})=>{this.isDragging&&l&&(It(u=>{const h=this.getAxisMotionValue(u);h&&(this.originPoint[u]+=c[u].translate,h.set(h.get()+c[u].translate))}),this.visualElement.render())}));return()=>{o(),n(),i(),a&&a()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:s=!1,dragConstraints:i=!1,dragElastic:o=ti,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:s,dragConstraints:i,dragElastic:o,dragMomentum:a}}}function nr(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function kw(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class Dw extends oe{constructor(t){super(t),this.removeGroupControls=At,this.removeListeners=At,this.controls=new Cw(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||At}update(){const{dragControls:t}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};t!==n&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners()}}const Pu=e=>(t,n)=>{e&&rt.postRender(()=>e(t,n))};class Ew extends oe{constructor(){super(...arguments),this.removePointerDownListener=At}onPointerDown(t){this.session=new yu(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:mu(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:s}=this.node.getProps();return{onSessionStart:Pu(t),onStart:Pu(n),onMove:r,onEnd:(i,o)=>{delete this.session,s&&rt.postRender(()=>s(i,o))}}}mount(){this.removePointerDownListener=Tn(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const rr={hasAnimatedSinceResize:!0,hasEverUpdated:!1};let ei=!1;class Mw extends m.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:s}=this.props,{projection:i}=t;i&&(n.group&&n.group.add(i),r&&r.register&&s&&r.register(i),ei&&i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,onExitComplete:()=>this.safeToRemove()})),rr.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:s,isPresent:i}=this.props,{projection:o}=r;return o&&(o.isPresent=i,ei=!0,s||t.layoutDependency!==n||n===void 0||t.isPresent!==i?o.willUpdate():this.safeToRemove(),t.isPresent!==i&&(i?o.promote():o.relegate()||rt.postRender(()=>{const a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),Ns.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:s}=t;ei=!0,s&&(s.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(s),r&&r.deregister&&r.deregister(s))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function Cu(e){const[t,n]=Uv(),r=m.useContext(la);return v.jsx(Mw,{...e,layoutGroup:r,switchLayoutGroup:m.useContext(Hc),isPresent:t,safeToRemove:n})}function Aw(e,t,n){const r=Pt(e)?e:He(e);return r.start(Xs("",r,t,n)),r.animation}const Nw=(e,t)=>e.depth-t.depth;class Iw{constructor(){this.children=[],this.isDirty=!1}add(t){Gr(this.children,t),this.isDirty=!0}remove(t){qr(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(Nw),this.isDirty=!1,this.children.forEach(t)}}function Ow(e,t){const n=kt.now(),r=({timestamp:s})=>{const i=s-n;i>=t&&(ne(r),e(i-t))};return rt.setup(r,!0),()=>ne(r)}const ku=["TopLeft","TopRight","BottomLeft","BottomRight"],Vw=ku.length,Du=e=>typeof e=="string"?parseFloat(e):e,Eu=e=>typeof e=="number"||O.test(e);function Lw(e,t,n,r,s,i){s?(e.opacity=at(0,n.opacity??1,Fw(r)),e.opacityExit=at(t.opacity??1,0,_w(r))):i&&(e.opacity=at(t.opacity??1,n.opacity??1,r));for(let o=0;o<Vw;o++){const a=`border${ku[o]}Radius`;let c=Mu(t,a),l=Mu(n,a);if(c===void 0&&l===void 0)continue;c||(c=0),l||(l=0),c===0||l===0||Eu(c)===Eu(l)?(e[a]=Math.max(at(Du(c),Du(l),r),0),(Wt.test(l)||Wt.test(c))&&(e[a]+="%")):e[a]=l}(t.rotate||n.rotate)&&(e.rotate=at(t.rotate||0,n.rotate||0,r))}function Mu(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const Fw=Au(0,.5,Sa),_w=Au(.5,.95,At);function Au(e,t,n){return r=>r<e?0:r>t?1:n(hn(e,t,r))}function Nu(e,t){e.min=t.min,e.max=t.max}function _t(e,t){Nu(e.x,t.x),Nu(e.y,t.y)}function Iu(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function Ou(e,t,n,r,s){return e-=t,e=tr(e,1/n,r),s!==void 0&&(e=tr(e,1/s,r)),e}function jw(e,t=0,n=1,r=.5,s,i=e,o=e){if(Wt.test(t)&&(t=parseFloat(t),t=at(o.min,o.max,t/100)-o.min),typeof t!="number")return;let a=at(i.min,i.max,r);e===i&&(a-=t),e.min=Ou(e.min,t,n,a,s),e.max=Ou(e.max,t,n,a,s)}function Vu(e,t,[n,r,s],i,o){jw(e,t[n],t[r],t[s],t.scale,i,o)}const Bw=["x","scaleX","originX"],Hw=["y","scaleY","originY"];function Lu(e,t,n,r){Vu(e.x,t,Bw,n?n.x:void 0,r?r.x:void 0),Vu(e.y,t,Hw,n?n.y:void 0,r?r.y:void 0)}function Fu(e){return e.translate===0&&e.scale===1}function _u(e){return Fu(e.x)&&Fu(e.y)}function ju(e,t){return e.min===t.min&&e.max===t.max}function $w(e,t){return ju(e.x,t.x)&&ju(e.y,t.y)}function Bu(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Hu(e,t){return Bu(e.x,t.x)&&Bu(e.y,t.y)}function $u(e){return Ct(e.x)/Ct(e.y)}function Wu(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class Ww{constructor(){this.members=[]}add(t){Gr(this.members,t),t.scheduleRender()}remove(t){if(qr(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(s=>t===s);if(n===0)return!1;let r;for(let s=n;s>=0;s--){const i=this.members[s];if(i.isPresent!==!1){r=i;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:s}=t.options;s===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function Yw(e,t,n){let r="";const s=e.x.translate/t.x,i=e.y.translate/t.y,o=n?.z||0;if((s||i||o)&&(r=`translate3d(${s}px, ${i}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:l,rotate:u,rotateX:h,rotateY:d,skewX:f,skewY:p}=n;l&&(r=`perspective(${l}px) ${r}`),u&&(r+=`rotate(${u}deg) `),h&&(r+=`rotateX(${h}deg) `),d&&(r+=`rotateY(${d}deg) `),f&&(r+=`skewX(${f}deg) `),p&&(r+=`skewY(${p}deg) `)}const a=e.x.scale*t.x,c=e.y.scale*t.y;return(a!==1||c!==1)&&(r+=`scale(${a}, ${c})`),r||"none"}const ni=["","X","Y","Z"],Rw=1e3;let Uw=0;function ri(e,t,n,r){const{latestValues:s}=t;s[e]&&(n[e]=s[e],t.setStaticValue(e,0),r&&(r[e]=0))}function Yu(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=su(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:i}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",rt,!(s||i))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&Yu(r)}function Ru({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:s}){return class{constructor(o={},a=t?.()){this.id=Uw++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(Gw),this.nodes.forEach(Qw),this.nodes.forEach(Jw),this.nodes.forEach(qw)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let c=0;c<this.path.length;c++)this.path[c].shouldResetTransform=!0;this.root===this&&(this.nodes=new Iw)}addEventListener(o,a){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new Qr),this.eventHandlers.get(o).add(a)}notifyListeners(o,...a){const c=this.eventHandlers.get(o);c&&c.notify(...a)}hasListeners(o){return this.eventHandlers.has(o)}mount(o){if(this.instance)return;this.isSVG=Tc(o)&&!Wv(o),this.instance=o;const{layoutId:a,layout:c,visualElement:l}=this.options;if(l&&!l.current&&l.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(c||a)&&(this.isLayoutDirty=!0),e){let u,h=0;const d=()=>this.root.updateBlockedByResize=!1;rt.read(()=>{h=window.innerWidth}),e(o,()=>{const f=window.innerWidth;f!==h&&(h=f,this.root.updateBlockedByResize=!0,u&&u(),u=Ow(d,250),rr.hasAnimatedSinceResize&&(rr.hasAnimatedSinceResize=!1,this.nodes.forEach(Ku)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&l&&(a||c)&&this.addEventListener("didUpdate",({delta:u,hasLayoutChanged:h,hasRelativeLayoutChanged:d,layout:f})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const p=this.options.transition||l.getDefaultTransition()||sx,{onLayoutAnimationStart:g,onLayoutAnimationComplete:y}=l.getProps(),b=!this.targetLayout||!Hu(this.targetLayout,f),w=!h&&d;if(this.options.layoutRoot||this.resumeFrom||w||h&&(b||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const S={...Es(p,"layout"),onPlay:g,onComplete:y};(l.shouldReduceMotion||this.options.layoutRoot)&&(S.delay=0,S.type=!1),this.startAnimation(S),this.setAnimationOrigin(u,w)}else h||Ku(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=f})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),ne(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(tx),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Yu(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;u<this.path.length;u++){const h=this.path[u];h.shouldResetTransform=!0,h.updateScroll("snapshot"),h.options.layoutRoot&&h.willUpdate(!1)}const{layoutId:a,layout:c}=this.options;if(a===void 0&&!c)return;const l=this.getTransformTemplate();this.prevTransformTemplateValue=l?l(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(Uu);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(zu);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Zw),this.nodes.forEach(zw),this.nodes.forEach(Kw)):this.nodes.forEach(zu),this.clearAllSnapshots();const a=kt.now();bt.delta=Gt(0,1e3/60,a-bt.timestamp),bt.timestamp=a,bt.isProcessing=!0,ns.update.process(bt),ns.preRender.process(bt),ns.render.process(bt),bt.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Ns.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Xw),this.sharedNodes.forEach(ex)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,rt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){rt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Ct(this.snapshot.measuredBox.x)&&!Ct(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let c=0;c<this.path.length;c++)this.path[c].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected=gt(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(a=!1),a&&this.instance){const c=r(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:c,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:c}}}resetTransform(){if(!s)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!_u(this.projectionDelta),c=this.getTransformTemplate(),l=c?c(this.latestValues,""):void 0,u=l!==this.prevTransformTemplateValue;o&&this.instance&&(a||be(this.latestValues)||u)&&(s(this.instance,l),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const a=this.measurePageBox();let c=this.removeElementScroll(a);return o&&(c=this.removeTransform(c)),ix(c),{animationId:this.root.animationId,measuredBox:a,layoutBox:c,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:o}=this.options;if(!o)return gt();const a=o.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(ox))){const{scroll:l}=this.root;l&&(We(a.x,l.offset.x),We(a.y,l.offset.y))}return a}removeElementScroll(o){const a=gt();if(_t(a,o),this.scroll?.wasRoot)return a;for(let c=0;c<this.path.length;c++){const l=this.path[c],{scroll:u,options:h}=l;l!==this.root&&u&&h.layoutScroll&&(u.wasRoot&&_t(a,o),We(a.x,u.offset.x),We(a.y,u.offset.y))}return a}applyTransform(o,a=!1){const c=gt();_t(c,o);for(let l=0;l<this.path.length;l++){const u=this.path[l];!a&&u.options.layoutScroll&&u.scroll&&u!==u.root&&Ye(c,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),be(u.latestValues)&&Ye(c,u.latestValues)}return be(this.latestValues)&&Ye(c,this.latestValues),c}removeTransform(o){const a=gt();_t(a,o);for(let c=0;c<this.path.length;c++){const l=this.path[c];if(!l.instance||!be(l.latestValues))continue;Us(l.latestValues)&&l.updateSnapshot();const u=gt(),h=l.measurePageBox();_t(u,h),Lu(a,l.latestValues,l.snapshot?l.snapshot.layoutBox:void 0,u)}return be(this.latestValues)&&Lu(a,this.latestValues),a}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==bt.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){const a=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=a.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=a.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=a.isSharedProjectionDirty);const c=!!this.resumingFrom||this!==a;if(!(o||c&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:u,layoutId:h}=this.options;if(!this.layout||!(u||h))return;this.resolvedRelativeTargetAt=bt.timestamp;const d=this.getClosestProjectingParent();d&&this.linkedParentVersion!==d.layoutVersion&&!d.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(d&&d.layout?this.createRelativeTarget(d,this.layout.layoutBox,d.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=gt(),this.targetWithTransforms=gt()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),pw(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):_t(this.target,this.layout.layoutBox),zc(this.target,this.targetDelta)):_t(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,d&&!!d.resumingFrom==!!this.resumingFrom&&!d.options.layoutScroll&&d.target&&this.animationProgress!==1?this.createRelativeTarget(d,this.target,d.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||Us(this.parent.latestValues)||Yc(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(o,a,c){this.relativeParent=o,this.linkedParentVersion=o.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=gt(),this.relativeTargetOrigin=gt(),er(this.relativeTargetOrigin,a,c),_t(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){const o=this.getLead(),a=!!this.resumingFrom||this!==o;let c=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(c=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(c=!1),this.resolvedRelativeTargetAt===bt.timestamp&&(c=!1),c)return;const{layout:l,layoutId:u}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(l||u))return;_t(this.layoutCorrected,this.layout.layoutBox);const h=this.treeScale.x,d=this.treeScale.y;k0(this.layoutCorrected,this.treeScale,this.path,a),o.layout&&!o.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(o.target=o.layout.layoutBox,o.targetWithTransforms=gt());const{target:f}=o;if(!f){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Iu(this.prevProjectionDelta.x,this.projectionDelta.x),Iu(this.prevProjectionDelta.y,this.projectionDelta.y)),Pn(this.projectionDelta,this.layoutCorrected,f,this.latestValues),(this.treeScale.x!==h||this.treeScale.y!==d||!Wu(this.projectionDelta.x,this.prevProjectionDelta.x)||!Wu(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",f))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){if(this.options.visualElement?.scheduleRender(),o){const a=this.getStack();a&&a.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Re(),this.projectionDelta=Re(),this.projectionDeltaWithTransform=Re()}setAnimationOrigin(o,a=!1){const c=this.snapshot,l=c?c.latestValues:{},u={...this.latestValues},h=Re();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const d=gt(),f=c?c.source:void 0,p=this.layout?this.layout.source:void 0,g=f!==p,y=this.getStack(),b=!y||y.members.length<=1,w=!!(g&&!b&&this.options.crossfade===!0&&!this.path.some(rx));this.animationProgress=0;let S;this.mixTargetDelta=T=>{const P=T/1e3;Gu(h.x,o.x,P),Gu(h.y,o.y,P),this.setTargetDelta(h),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(er(d,this.layout.layoutBox,this.relativeParent.layout.layoutBox),nx(this.relativeTarget,this.relativeTargetOrigin,d,P),S&&$w(this.relativeTarget,S)&&(this.isProjectionDirty=!1),S||(S=gt()),_t(S,this.relativeTarget)),g&&(this.animationValues=u,Lw(u,l,this.latestValues,P,w,b)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=P},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(ne(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=rt.update(()=>{rr.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=He(0)),this.currentAnimation=Aw(this.motionValue,[0,1e3],{...o,velocity:0,isSync:!0,onUpdate:a=>{this.mixTargetDelta(a),o.onUpdate&&o.onUpdate(a)},onStop:()=>{},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Rw),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:c,layout:l,latestValues:u}=o;if(!(!a||!c||!l)){if(this!==o&&this.layout&&l&&Ju(this.options.animationType,this.layout.layoutBox,l.layoutBox)){c=this.target||gt();const h=Ct(this.layout.layoutBox.x);c.x.min=o.target.x.min,c.x.max=c.x.min+h;const d=Ct(this.layout.layoutBox.y);c.y.min=o.target.y.min,c.y.max=c.y.min+d}_t(a,c),Ye(a,u),Pn(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new Ww),this.sharedNodes.get(o).add(a);const l=a.options.initialPromotionConfig;a.promote({transition:l?l.transition:void 0,preserveFollowOpacity:l&&l.shouldPreserveFollowOpacity?l.shouldPreserveFollowOpacity(a):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){const{layoutId:o}=this.options;return o?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:o}=this.options;return o?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:a,preserveFollowOpacity:c}={}){const l=this.getStack();l&&l.promote(this,c),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let a=!1;const{latestValues:c}=o;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(a=!0),!a)return;const l={};c.z&&ri("z",o,l,this.animationValues);for(let u=0;u<ni.length;u++)ri(`rotate${ni[u]}`,o,l,this.animationValues),ri(`skew${ni[u]}`,o,l,this.animationValues);o.render();for(const u in l)o.setStaticValue(u,l[u]),this.animationValues&&(this.animationValues[u]=l[u]);o.scheduleRender()}applyProjectionStyles(o,a){if(!this.instance||this.isSVG)return;if(!this.isVisible){o.visibility="hidden";return}const c=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,o.visibility="",o.opacity="",o.pointerEvents=Jn(a?.pointerEvents)||"",o.transform=c?c(this.latestValues,""):"none";return}const l=this.getLead();if(!this.projectionDelta||!this.layout||!l.target){this.options.layoutId&&(o.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,o.pointerEvents=Jn(a?.pointerEvents)||""),this.hasProjected&&!be(this.latestValues)&&(o.transform=c?c({},""):"none",this.hasProjected=!1);return}o.visibility="";const u=l.animationValues||l.latestValues;this.applyTransformsToTarget();let h=Yw(this.projectionDeltaWithTransform,this.treeScale,u);c&&(h=c(u,h)),o.transform=h;const{x:d,y:f}=this.projectionDelta;o.transformOrigin=`${d.origin*100}% ${f.origin*100}% 0`,l.animationValues?o.opacity=l===this?u.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:u.opacityExit:o.opacity=l===this?u.opacity!==void 0?u.opacity:"":u.opacityExit!==void 0?u.opacityExit:0;for(const p in Fs){if(u[p]===void 0)continue;const{correct:g,applyTo:y,isCSSVariable:b}=Fs[p],w=h==="none"?u[p]:g(u[p],l);if(y){const S=y.length;for(let T=0;T<S;T++)o[y[T]]=w}else b?this.options.visualElement.renderState.vars[p]=w:o[p]=w}this.options.layoutId&&(o.pointerEvents=l===this?Jn(a?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>o.currentAnimation?.stop()),this.root.nodes.forEach(Uu),this.root.sharedNodes.clear()}}}function zw(e){e.updateLayout()}function Kw(e){const t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:r}=e.layout,{animationType:s}=e.options,i=t.source!==e.layout.source;s==="size"?It(u=>{const h=i?t.measuredBox[u]:t.layoutBox[u],d=Ct(h);h.min=n[u].min,h.max=h.min+d}):Ju(s,t.layoutBox,n)&&It(u=>{const h=i?t.measuredBox[u]:t.layoutBox[u],d=Ct(n[u]);h.max=h.min+d,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[u].max=e.relativeTarget[u].min+d)});const o=Re();Pn(o,n,t.layoutBox);const a=Re();i?Pn(a,e.applyTransform(r,!0),t.measuredBox):Pn(a,n,t.layoutBox);const c=!_u(o);let l=!1;if(!e.resumeFrom){const u=e.getClosestProjectingParent();if(u&&!u.resumeFrom){const{snapshot:h,layout:d}=u;if(h&&d){const f=gt();er(f,t.layoutBox,h.layoutBox);const p=gt();er(p,n,d.layoutBox),Hu(f,p)||(l=!0),u.options.layoutRoot&&(e.relativeTarget=p,e.relativeTargetOrigin=f,e.relativeParent=u)}}}e.notifyListeners("didUpdate",{layout:n,snapshot:t,delta:a,layoutDelta:o,hasLayoutChanged:c,hasRelativeLayoutChanged:l})}else if(e.isLead()){const{onExitComplete:n}=e.options;n&&n()}e.options.transition=void 0}function Gw(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function qw(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Xw(e){e.clearSnapshot()}function Uu(e){e.clearMeasurements()}function zu(e){e.isLayoutDirty=!1}function Zw(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Ku(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Qw(e){e.resolveTargetDelta()}function Jw(e){e.calcProjection()}function tx(e){e.resetSkewAndRotation()}function ex(e){e.removeLeadSnapshot()}function Gu(e,t,n){e.translate=at(t.translate,0,n),e.scale=at(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function qu(e,t,n,r){e.min=at(t.min,n.min,r),e.max=at(t.max,n.max,r)}function nx(e,t,n,r){qu(e.x,t.x,n.x,r),qu(e.y,t.y,n.y,r)}function rx(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const sx={duration:.45,ease:[.4,0,.1,1]},Xu=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Zu=Xu("applewebkit/")&&!Xu("chrome/")?Math.round:At;function Qu(e){e.min=Zu(e.min),e.max=Zu(e.max)}function ix(e){Qu(e.x),Qu(e.y)}function Ju(e,t,n){return e==="position"||e==="preserve-aspect"&&!dw($u(t),$u(n),.2)}function ox(e){return e!==e.root&&e.scroll?.wasRoot}const ax=Ru({attachResizeListener:(e,t)=>xn(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),si={current:void 0},tl=Ru({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!si.current){const e=new ax({});e.mount(window),e.setOptions({layoutScroll:!0}),si.current=e}return si.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),cx={pan:{Feature:Ew},drag:{Feature:Dw,ProjectionNode:tl,MeasureLayout:Cu}};function el(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const s="onHover"+n,i=r[s];i&&rt.postRender(()=>i(t,Sn(t)))}class ux extends oe{mount(){const{current:t}=this.node;t&&(this.unmount=jv(t,(n,r)=>(el(this.node,r,"Start"),s=>el(this.node,s,"End"))))}unmount(){}}class lx extends oe{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=ln(xn(this.node.current,"focus",()=>this.onFocus()),xn(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function nl(e,t,n){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const s="onTap"+(n==="End"?"":n),i=r[s];i&&rt.postRender(()=>i(t,Sn(t)))}class hx extends oe{mount(){const{current:t}=this.node;t&&(this.unmount=$v(t,(n,r)=>(nl(this.node,r,"Start"),(s,{success:i})=>nl(this.node,s,i?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const ii=new WeakMap,oi=new WeakMap,fx=e=>{const t=ii.get(e.target);t&&t(e)},dx=e=>{e.forEach(fx)};function px({root:e,...t}){const n=e||document;oi.has(n)||oi.set(n,{});const r=oi.get(n),s=JSON.stringify(t);return r[s]||(r[s]=new IntersectionObserver(dx,{root:e,...t})),r[s]}function mx(e,t,n){const r=px(t);return ii.set(e,n),r.observe(e),()=>{ii.delete(e),r.unobserve(e)}}const gx={some:0,all:1};class yx extends oe{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:s="some",once:i}=t,o={root:n?n.current:void 0,rootMargin:r,threshold:typeof s=="number"?s:gx[s]},a=c=>{const{isIntersecting:l}=c;if(this.isInView===l||(this.isInView=l,i&&!l&&this.hasEnteredView))return;l&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",l);const{onViewportEnter:u,onViewportLeave:h}=this.node.getProps(),d=l?u:h;d&&d(c)};return mx(this.node.current,o,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(bx(t,n))&&this.startObserver()}unmount(){}}function bx({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const vx={...aw,...{inView:{Feature:yx},tap:{Feature:hx},focus:{Feature:lx},hover:{Feature:ux}},...cx,...{layout:{ProjectionNode:tl,MeasureLayout:Cu}}},rl=T0(vx,F0),sl=({visible:e,target:t,appendTo:n=document.body,unmountWhenHidden:r=!1,transitionDuration:s=400,showTransitionOptions:i="easeInOut",hideTransitionOptions:o="linear",approveText:a="DONE",shown:c,hidden:l,isClickedWithin:u,children:h})=>{const[d,f]=m.useState(-1),[p,g]=m.useState(-1),[y,b]=m.useState(e),[w,S]=m.useState(!0),T=m.useRef(100),P=m.useRef(101),D=m.useRef(void 0),A=m.useRef(void 0),C=m.useRef(void 0),E=m.useRef(!1),j=s/1e3;m.useEffect(()=>{t&&(D.current=ua(t));const k=sa("zIndex",M=>M==="auto"||M==="-1"?!1:parseInt(M)>100).map(M=>parseInt(M,10));k.length>0&&(T.current=Math.max(...k)+1,P.current=Math.max(...k)+2),S(!1),b(e)},[e,t]);const R=k=>{A.current=k},F=()=>{g(T.current),f(P.current),E.current=!0},B=()=>{if(!A.current)return;c?.();let k;D.current&&(k=[D.current]);const M=q=>{q?u?.():(S(!1),b(!1))};C.current=aa(A.current,M,k)},N=()=>{C.current&&ca(C.current)},I=()=>{g(-1),f(-1),l?.()},W=Vn(()=>{y?F():N()}),L=Vn(()=>{y?B():I(),S(!0)}),H={opacity:.5},V={opacity:0},Z={opacity:1,pointerEvents:"auto"},x={opacity:0,pointerEvents:"none"};return E.current&&!y&&r===!0&&w?null:Dl.createPortal(v.jsxs("div",{children:[v.jsx(rl.div,{className:"bsc:fixed bsc:left-0 bsc:top-0 bsc:h-full bsc:w-full bsc:bg-mono-dark-1",style:{zIndex:p},initial:!1,animate:y?H:V}),v.jsxs(rl.div,{ref:k=>{k&&R(k)},className:"dark:bsc-border-mono-light-1 bsc:fixed bsc:bottom-0 bsc:left-0 bsc:w-full bsc:bg-white bsc:dark:border-t bsc:dark:border-solid bsc:dark:bg-mono-dark-1 bsc:dark:text-mono-light-1",style:{zIndex:d},initial:!1,animate:y?Z:x,transition:{duration:j,ease:y?i:o},onAnimationStart:W,onAnimationComplete:L,children:[v.jsx("div",{className:"bsc:w-full",children:h}),v.jsx(v.Fragment,{children:v.jsx(jt,{buttonType:"primary",fullWidth:!0,onClick:()=>b(!1),className:"bsc:text-xs bsc:font-bold",children:a})})]})]}),n)};var il=(e=>(e[e.TopLeft=0]="TopLeft",e[e.TopRight=1]="TopRight",e[e.BottomLeft=2]="BottomLeft",e[e.BottomRight=3]="BottomRight",e))(il||{}),ol=(e=>(e[e.TopLeft=0]="TopLeft",e[e.TopRight=1]="TopRight",e[e.BottomLeft=2]="BottomLeft",e[e.BottomRight=3]="BottomRight",e))(ol||{});class st{static positionToTarget(t,n=2){const r=t.getBoundingClientRect();let s=0,i=0;const o=window.scrollY;switch(n){case 2:s=r.top+r.height+o,i=r.left;break;case 0:s=r.top+o,i=r.left;break;case 3:s=r.top+r.height+o,i=r.left+r.width;break;case 1:s=r.top+o,i=r.left+r.width}return{top:s,left:i}}static positionElementToTarget(t,n,r=0,s=2){let{left:i,top:o}=st.positionToTarget(n,s);const a=t.getBoundingClientRect();switch(r){case 0:break;case 1:i=i-a.width;break;case 2:o=o-a.height;break;case 3:o=o-a.height,i=i-a.width;break}return{top:o,left:i}}static canPositionElementOnScreenWithTarget(t,n){const r=st.getScreenDimensions(),s=t.getBoundingClientRect(),i=st.positionElementToTarget(t,n,0,2);if(i.left+s.width<r.width&&i.top+s.height<r.height||st.positionElementToTarget(t,n,1,3).left>=0&&i.top+s.height<r.height)return!0;const a=st.positionElementToTarget(t,n,2,0);if(a.left+s.width<r.width&&a.top>=0)return!0;const c=st.positionElementToTarget(t,n,3,1);return c.left>=0&&c.top>=0}static canPositionElementOnScreen(t){const n=st.getScreenDimensions(),r=t.getBoundingClientRect();return r.width<=n.width&&r.height<=n.height}static positionElementToTargetOnScreen(t,n,r=0,s=2){const{left:i,top:o}=st.positionElementToTarget(t,n,r,s),a=t.getBoundingClientRect(),c=st.determineOffScreenLocation(a);if(c){if(r===0&&s===2){if(c.right&&!c.bottom)return st.positionElementToTarget(t,n,1,3);if(c.bottom&&!c.right)return st.positionElementToTarget(t,n,2,0);if(c.right&&c.bottom)return st.positionElementToTarget(t,n,3,1)}else if(r===1&&s===3){if(c.left&&!c.bottom)return st.positionElementToTarget(t,n,0,2);if(c.bottom&&!c.left)return st.positionElementToTarget(t,n,3,1);if(c.left&&c.bottom)return st.positionElementToTarget(t,n,2,0)}}return{top:o,left:i}}static determineOffScreenLocation(t){const n=st.getScreenDimensions(),r={left:t.left<0,top:t.top<0,right:t.left+t.width>n.width,bottom:t.top+t.height>n.height};return r.left||r.top||r.right||r.bottom?r:void 0}static getScreenDimensions(){return{width:window.innerWidth,height:Math.max(document.documentElement.clientHeight||0,window.innerHeight||0)}}}const al=({visible:e,target:t,targetPosition:n=il.BottomLeft,elementAlignment:r=ol.TopLeft,shouldTargetCloseOverlay:s=!0,shouldMatchTargetWidth:i=!1,shouldScrollCloseOverlay:o=!1,shouldCheckZIndex:a=!1,shouldRemainOnScreen:c=!1,unmountWhenHidden:l=!1,transitionDuration:u=400,showTransitionOptions:h="cubic-bezier(0, 0, 0.2, 1)",hideTransitionOptions:d="linear",shown:f,hidden:p,isClickedWithin:g,markupCreated:y,children:b})=>{const[w,S]=m.useState(-1),[T,P]=m.useState(e),[D,A]=m.useState(!1),C=m.useRef(!1),E=m.useRef(100),j=m.useRef({left:0,top:0,width:0}),R=m.useRef(void 0),F=m.useRef(void 0),B=m.useRef(void 0),N=m.useRef(void 0),I=m.useRef(void 0),W=m.useRef(void 0),L=m.useRef(!1),H=gi();m.useEffect(()=>(c===!0&&(W.current=new ResizeObserver(V)),()=>{c===!0&&(F.current&&W.current?.unobserve(F.current),W.current?.disconnect())}),[]),m.useEffect(()=>{if(t&&(R.current=ua(t),o)){const lt=H?.isValidScrollableElement;B.current=ra(R.current,{overflow:"scroll, auto",overflowX:"scroll, auto",overflowY:"scroll, auto"},!1,lt),B.current.tagName.toLowerCase()==="html"&&(B.current=document)}if(a){const lt=sa("zIndex",_=>parseInt(_)>=100).map(_=>parseInt(_));lt.length>0&&(E.current=Math.max(...lt)+1)}e!==void 0&&P(e)},[t,e,o,a]);const V=lt=>{if(F.current){const _=st.getScreenDimensions(),et=lt[lt.length-1].target,ue=et.getBoundingClientRect(),Rt=st.determineOffScreenLocation(ue);if(Rt){if(R.current&&st.canPositionElementOnScreenWithTarget(et,R.current)){const fi=st.positionElementToTargetOnScreen(F.current,R.current,r,n);j.current={...j.current,...fi}}else Rt.right?j.current.left=_.width-ue.width:Rt.left&&(j.current.left=0),Rt.bottom?j.current.top=_.height-ue.height:Rt.top&&(j.current.top=0);Z()}}},Z=rn(()=>{C.current=!C.current,A(C.current)},20),x=()=>{S(E.current)},k=()=>{if(!F.current)return;f?.();let lt;!s&&R.current&&(lt=[R.current]);const _=et=>{et?g?.():P(!1)};N.current=aa(F.current,_,lt),o&&(I.current=mm(et=>F.current&&Iy(et,F.current)&&P(!1),100,{leading:!0}),B.current&&B.current.addEventListener("scroll",I.current)),L.current=!0},M=()=>{B.current&&I.current&&(B.current.removeEventListener("scroll",I.current),I.current=void 0),N.current&&ca(N.current)},q=()=>{S(-1),p?.()},Dt=lt=>{if(c===!0&&F.current&&W.current?.unobserve(F.current),F.current=lt,y?.(lt),R.current){const _=st.positionElementToTarget(F.current,R.current,r,n);j.current={..._,width:R.current.offsetWidth},c===!0&&(st.canPositionElementOnScreenWithTarget(F.current,R.current)||st.canPositionElementOnScreen(F.current))&&W.current?.observe(F.current)}},Zt=Vn(()=>{T?x():M()}),ut=Vn(()=>{T?k():q()}),Ot=m.useMemo(()=>T?{transition:`opacity ${u}ms ${h}`,pointerEvents:"auto",opacity:1}:{transition:`opacity ${u}ms ${d}`,pointerEvents:"none",opacity:0},[T]),ce=m.useMemo(()=>{const lt={top:`${j.current.top}px`,left:`${j.current.left}px`,zIndex:w};return i&&(lt.width=`${j.current.width}px`),lt},[D,w,i]);return L.current&&!T&&l===!0?null:v.jsx("div",{onTransitionStart:Zt,onTransitionEnd:ut,children:v.jsx("div",{className:"bsc:fixed bsc:border! bsc:border-solid! bsc:border-black bsc:bg-white bsc:shadow bsc:dark:border-mono-light-1 bsc:dark:bg-mono-dark-1 bsc:dark:text-mono-light-1",style:{...ce,...Ot},ref:lt=>{lt&&Dt(lt)},children:b})})};let sr;const wx=new Uint8Array(16);function xx(){if(!sr&&(sr=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!sr))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return sr(wx)}const vt=[];for(let e=0;e<256;++e)vt.push((e+256).toString(16).slice(1));function Sx(e,t=0){return vt[e[t+0]]+vt[e[t+1]]+vt[e[t+2]]+vt[e[t+3]]+"-"+vt[e[t+4]]+vt[e[t+5]]+"-"+vt[e[t+6]]+vt[e[t+7]]+"-"+vt[e[t+8]]+vt[e[t+9]]+"-"+vt[e[t+10]]+vt[e[t+11]]+vt[e[t+12]]+vt[e[t+13]]+vt[e[t+14]]+vt[e[t+15]]}const cl={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Tx(e,t,n){if(cl.randomUUID&&!e)return cl.randomUUID();e=e||{};const r=e.random||(e.rng||xx)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,Sx(r)}class Cn{static create(t){const n=[];let r=0;for(let s=0,i=t.formatParts.length;s<i;s++){const o=t.formatParts[s],a=r,c=a+o.characterCount;n.push({startPosition:a,endPosition:c,...o}),r=c}return n}}class Px{instanceCollection;formatPartList;inputSlotCollection;currentPartIndex=0;currentPartIndices=[];currentCursorPosition=0;highlightCursorPosition=0;currentCursorStartPosition=-1;currentCursorEndPosition=-1;inputElement;inputSelection=null;inputRange;textNode;constructor(t,n){this.instanceCollection=kn.getInstance(),this.formatPartList=Cn.create(t),this.inputSlotCollection=this.instanceCollection.getInputSlotInstance(n,t)}get isSelection(){return this.inputRange!==void 0&&this.inputRange.startOffset!==this.inputRange.endOffset}get isAllSelected(){const t=this.inputSlotCollection.getLastSlot();return this.isSelection&&this.inputRange?.startOffset===0&&this.inputRange.endOffset===t.endPosition}getCursorPosition(){return this.currentCursorPosition}getCursorStartPosition(){return this.currentCursorStartPosition}getCursorEndPosition(){return this.currentCursorEndPosition}getCurrentPartIndex(){return this.currentPartIndex}getCurrentPartIndices(){return this.currentPartIndices}setInputElement(t){this.inputElement=t}setCursorToCurrentPosition(){this.setCursorSelection(this.currentCursorPosition>-1?this.currentCursorPosition:this.highlightCursorPosition)}setCursorPosition(t){this.setCursorSelection(t)}setCursorSelection(t,n){if(this.createInputRangeSelection(),this.inputRange&&this.textNode){let r,s,i=!0;n===void 0?(r=t,s=t):t<n?(r=t,s=n):(i=!1,r=n,s=t),this.inputRange.setStart(this.textNode,r),this.inputRange.setEnd(this.textNode,s),this.currentPartIndices=[],r===s?(this.currentCursorPosition=s,this.highlightCursorPosition=s,this.currentCursorStartPosition=-1,this.currentCursorEndPosition=-1,this.setPartIndexByCursorPosition()):(i?this.currentCursorStartPosition===-1&&this.currentCursorEndPosition===-1?this.highlightCursorPosition=s:this.currentCursorStartPosition!==r?this.highlightCursorPosition=r:this.currentCursorEndPosition!==s&&(this.highlightCursorPosition=s):this.currentCursorStartPosition===-1&&this.currentCursorEndPosition===-1?this.highlightCursorPosition=r:this.currentCursorStartPosition!==s?this.highlightCursorPosition=s:this.currentCursorEndPosition!==r&&(this.highlightCursorPosition=r),this.currentCursorStartPosition=r,this.currentCursorEndPosition=s,this.currentCursorPosition=-1,this.setPartIndexByHighlightPosition(),this.setPartIndicesByCursorPositions())}}findCursorPosition(){const t=window.getSelection(),n=t?.getRangeAt(0);if(this.inputElement&&t&&n){const r=document.createTreeWalker(this.inputElement,NodeFilter.SHOW_TEXT,a=>{const c=document.createRange();return c.selectNodeContents(a),c.compareBoundaryPoints(Range.END_TO_END,n)<1?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT});let s=0;for(;r.nextNode();)s+=r.currentNode.textContent?.length||0;n.startContainer.nodeType===Node.TEXT_NODE&&(s+=n.startOffset);const i=this.inputSlotCollection.getLastSlotWithData(),o=i.startPosition+i.partText.length;t.anchorOffset===t.focusOffset?this.setCursorSelection(s>o?o:s):this.setCursorSelection(t.anchorOffset,t.focusOffset)}}isAtLastPart(){return this.currentPartIndex===this.formatPartList.length-1}moveHome(){const t=this.inputSlotCollection.getFirstSlot();this.setCursorSelection(t.startPosition)}moveEnd(){const t=this.inputSlotCollection.getLastSlotWithData(),n=t.startPosition+t.partText.length;this.setCursorSelection(n)}moveCursorLeft(){if(this.updateCursorPosition(),this.currentCursorPosition>0&&!this.isSelection){const t=this.currentCursorPosition-1;let n=this.formatPartList[this.currentPartIndex];if(t>=n.startPosition&&t<=n.endPosition)this.setCursorSelection(t);else for(let r=this.currentPartIndex-1;r>=0;r--)if(n=this.formatPartList[r],t>=n.startPosition&&t<=n.endPosition){n.isSeparator?this.setCursorSelection(this.formatPartList[r-1].endPosition):this.setCursorSelection(t);break}}else this.isSelection?this.setCursorSelection(this.currentCursorPosition):this.moveHome()}moveCursorRight(){this.updateCursorPosition(!1);const t=this.inputSlotCollection.getLastSlotWithData(),n=t.startPosition+t.partText.length;if(this.currentCursorPosition<n&&!this.isSelection){const r=this.currentCursorPosition+1;let s=this.formatPartList[this.currentPartIndex];if(r>=s.startPosition&&r<=s.endPosition)this.setCursorSelection(r);else for(let i=this.currentPartIndex+1,o=this.formatPartList.length;i<o;i++)if(s=this.formatPartList[i],r>=s.startPosition&&r<=s.endPosition){s.isSeparator?this.setCursorSelection(this.formatPartList[i+1].startPosition):this.setCursorSelection(r);break}}else this.setCursorSelection(this.currentCursorPosition)}moveToNextInputPart(){if(this.currentPartIndex<this.formatPartList.length-1){const t=this.findNextEditablePart();t&&(this.currentPartIndex=t.partIndex,this.setCursorSelection(t.startPosition))}}moveToPreviousInputPart(){if(this.currentPartIndex>0){const t=this.findPreviousEditablePart();t&&(this.currentPartIndex=t.partIndex,this.setCursorSelection(t.endPosition))}}highlightAll(){const t=this.formatPartList[this.formatPartList.length-1].endPosition;this.setCursorSelection(0,t)}moveHighlightLeft(){this.updateHighlightPositions();const t=this.highlightCursorPosition>this.currentCursorStartPosition;if(this.currentCursorStartPosition>0||t){let n=t?this.currentCursorStartPosition:this.currentCursorStartPosition-1,r=t?this.highlightCursorPosition-1:this.currentCursorEndPosition,s=this.formatPartList[this.currentPartIndex];if(n>=s.startPosition&&n<=s.endPosition||t&&r>=s.startPosition&&r<=s.endPosition)this.setCursorSelection(n,r);else for(let i=this.currentPartIndex-1;i>=0;i--)if(s=this.formatPartList[i],n>=s.startPosition&&n<=s.endPosition||t&&r>=s.startPosition&&r<=s.endPosition){s.isSeparator?(t?r=this.formatPartList[i-1].endPosition:n=this.formatPartList[i-1].endPosition,this.setCursorSelection(n,r)):this.setCursorSelection(n,r);break}}}moveHighlightRight(){this.updateHighlightPositions();const t=this.inputSlotCollection.getLastSlotWithData(),n=t.startPosition+t.partText.length,r=this.highlightCursorPosition<this.currentCursorEndPosition;if(this.currentCursorEndPosition<n||r){let s=r?this.highlightCursorPosition+1:this.currentCursorStartPosition,i=r?this.currentCursorEndPosition:this.currentCursorEndPosition+1,o=this.formatPartList[this.currentPartIndex];if(i>=o.startPosition&&i<=o.endPosition||r&&s>=o.startPosition&&s<=o.endPosition)this.setCursorSelection(s,i);else for(let a=this.currentPartIndex+1,c=this.formatPartList.length;a<c;a++)if(o=this.formatPartList[a],i>=o.startPosition&&i<=o.endPosition||r&&s>=o.startPosition&&s<=o.endPosition){o.isSeparator?(r?s=this.formatPartList[a+1].startPosition:i=this.formatPartList[a+1].startPosition,this.setCursorSelection(s,i)):this.setCursorSelection(s,i);break}}}updateHighlightPositions(){this.currentCursorStartPosition===-1&&this.currentCursorEndPosition===-1&&this.currentCursorPosition>-1&&(this.currentCursorStartPosition=this.currentCursorPosition,this.currentCursorEndPosition=this.currentCursorPosition,this.highlightCursorPosition=this.currentCursorPosition)}updateCursorPosition(t=!0){this.currentCursorPosition===-1&&this.currentCursorStartPosition>-1&&this.currentCursorEndPosition>-1&&(t?this.currentCursorPosition=this.currentCursorStartPosition:this.currentCursorPosition=this.currentCursorEndPosition)}findNextEditablePart(){return this.inputSlotCollection.getNextSlot(this.currentPartIndex)}findPreviousEditablePart(){return this.inputSlotCollection.getPreviousSlot(this.currentPartIndex)}setPartIndexByCursorPosition(){for(let t=0;t<this.formatPartList.length;t++){const n=this.formatPartList[t];if(this.currentCursorPosition>=n.startPosition&&this.currentCursorPosition<=n.endPosition){if(n.isSeparator){this.currentCursorPosition=this.formatPartList[t+1].startPosition,this.currentPartIndex=t+1;break}this.currentPartIndex=t;break}}}setPartIndexByHighlightPosition(){for(let t=0;t<this.formatPartList.length;t++){const n=this.formatPartList[t];if(this.highlightCursorPosition>=n.startPosition&&this.highlightCursorPosition<=n.endPosition){if(n.isSeparator){this.highlightCursorPosition=this.formatPartList[t+1].startPosition,this.currentPartIndex=t+1;break}this.currentPartIndex=t;break}}}setPartIndicesByCursorPositions(){for(let t=0,n=this.formatPartList.length;t<n;t++){const r=this.formatPartList[t];r.isSeparator||(r.startPosition>=this.currentCursorStartPosition&&r.startPosition<=this.currentCursorEndPosition||r.endPosition>=this.currentCursorStartPosition&&r.endPosition<=this.currentCursorEndPosition||r.startPosition<this.currentCursorStartPosition&&r.endPosition>this.currentCursorEndPosition)&&this.currentPartIndices.push(t)}}createInputRangeSelection(){this.inputElement&&(this.inputSelection=window.getSelection(),this.inputRange=document.createRange(),this.inputSelection?.removeAllRanges(),this.inputRange.selectNodeContents(this.inputElement),this.inputRange.collapse(!0),this.inputSelection?.addRange(this.inputRange),this.inputElement.firstChild&&(this.textNode=this.inputElement.firstChild))}}class Cx{static create(t){const n=[];for(let r=0,s=t.length;r<s;r++){const i=t[r];i.isSeparator||n.push({partIndex:r,partText:"",isComplete:!1,...i})}return n}}class kx{inputSlots;constructor(t){this.inputSlots=Cx.create(Cn.create(t))}clearAllSlots(){for(let t=0,n=this.inputSlots.length;t<n;t++)this.inputSlots[t].partText=""}getSlot(t){return this.inputSlots.find(n=>n.partIndex===t)}getSlots(t){return this.inputSlots.filter(n=>t.includes(n.partIndex))}getSlotsFromCursorPosition(t){let n=-1;for(let r=0,s=this.inputSlots.length;r<s;r++){const i=this.inputSlots[r];if(t>=i.startPosition&&t<=i.endPosition){n=i.partIndex;break}}return n>-1?this.inputSlots.filter(r=>r.partIndex>=n):void 0}getFirstSlot(){return this.inputSlots[0]}getLastSlot(){return this.inputSlots[this.inputSlots.length-1]}getNextSlot(t){const n=this.inputSlots.findIndex(r=>r.partIndex===t);if(n>-1&&n+1<this.inputSlots.length)return this.inputSlots[n+1]}getPreviousSlot(t){const n=this.inputSlots.findIndex(r=>r.partIndex===t);if(n>-1&&n-1>=0)return this.inputSlots[n-1]}getLastSlotWithData(){const t=this.inputSlots.findIndex(r=>!r.isComplete);let n=t;for(let r=t+1,s=this.inputSlots.length;r<s;r++)this.inputSlots[r].partText.length>0&&(n=r);return this.inputSlots[n>-1?n:0]}allSlotsCompleted(){return this.inputSlots.every(t=>t.isComplete)}allSlotsEmpty(){return this.inputSlots.every(t=>t.partText.length===0)}}class kn{static instance;static getInstance(){return this.instance||(this.instance=new Dx),this.instance}}class Dx{navigatorInstances;inputSlotInstances;constructor(){this.navigatorInstances={},this.inputSlotInstances={}}getNavigatorInstance(t,n){return this.navigatorInstances[t]||(this.navigatorInstances[t]=new Px(n,t)),this.navigatorInstances[t]}getInputSlotInstance(t,n){return this.inputSlotInstances[t]||(this.inputSlotInstances[t]=new kx(n)),this.inputSlotInstances[t]}removeInstances(t){this.navigatorInstances[t]&&delete this.navigatorInstances[t],this.inputSlotInstances[t]&&delete this.inputSlotInstances[t]}}class ai{instanceCollection;formatPartList;inputSlotCollection;inputElement;constructor(t,n){this.instanceCollection=kn.getInstance(),this.formatPartList=Cn.create(t),this.inputSlotCollection=this.instanceCollection.getInputSlotInstance(n,t)}setInputElement(t){this.inputElement=t}render(){let t="";for(let n=0,r=this.formatPartList.length;n<r;n++){const s=this.formatPartList[n];if(s.isSeparator)t+=s.inputText;else{const i=this.inputSlotCollection.getSlot(n);i&&(t+=i.partText+i.inputText?.repeat(i.characterCount-i.partText.length))}}this.inputElement&&(this.inputElement.innerHTML=t)}}var Yt=(e=>(e[e.Text=0]="Text",e[e.Numeric=1]="Numeric",e))(Yt||{});class ul{numberKeys=["0","1","2","3","4","5","6","7","8","9"];movementKeys=["ArrowLeft","ArrowRight","Home","End","a"];editingKeys=["Backspace","Delete"];ignoreKeys=["Shift","Alt","Control","Fn","Meta"];isNumberKey(t){return this.numberKeys.includes(t)}isMovementKey(t){return this.movementKeys.includes(t.key)}isEditingKey(t){return this.editingKeys.includes(t.key)}isIgnoreKey(t){return this.ignoreKeys.includes(t.key)}}class Ex{_currentIndex=0;index=0;formatParts;get currentIndex(){return this._currentIndex}constructor(t){this.formatParts=Cn.create(t)}hasNext(){return this.index<this.formatParts.length}next(){if(this.index<this.formatParts.length)return this._currentIndex=this.index++,this.formatParts[this._currentIndex]}peek(){if(this.index<this.formatParts.length)return this.formatParts[this.index]}reset(){this.index=0}}class Mx{formatParts;constructor(t){this.formatParts=Cn.create(t)}getUniqueSeparators(){const t=[],n=this.formatParts.filter(r=>r.isSeparator);for(let r=0,s=n.length;r<s;r++){const i=n[r];i.inputText&&!t.includes(i.inputText)&&t.push(i.inputText)}return t}}class ll{constructor(t,n){this.format=t,this.instanceCollection=kn.getInstance(),this.inputSlotCollection=this.instanceCollection.getInputSlotInstance(n,t),this.formatNavigator=this.instanceCollection.getNavigatorInstance(n,t),this.keyTypeChecker=new ul,this.formatRenderer=new ai(t,n),this.formatPartList=new Ex(t),this.partEntryList=new Mx(t)}instanceCollection;inputSlotCollection;formatNavigator;keyTypeChecker;formatRenderer;formatPartList;partEntryList;setInputElement(t){this.formatRenderer.setInputElement(t)}processKeyPress(t){if(this.keyTypeChecker.isEditingKey(t)){this.processEditRules(t);return}this.formatNavigator.isSelection?(this.processSelectionEditRules(),setTimeout(()=>this.processInputRules(t))):this.processInputRules(t)}processInputValue(t){this.inputSlotCollection.clearAllSlots(),this.formatPartList.reset();let n=0;for(;this.formatPartList.hasNext();){const r=this.formatPartList.next();if(r&&!r.isSeparator)if(this.formatPartList.peek()?.isSeparator===!0){const s=this.formatPartList.currentIndex,i=this.formatPartList.next();if(i&&i.inputText){const o=t.indexOf(i.inputText,n),a=this.inputSlotCollection.getSlot(s);if(a&&o>-1){const c=o-n>a.characterCount?n+a.characterCount:o;a.partText=t.substring(n,c),this.processSlotRules(a),n=o+i.characterCount}}}else{const s=this.inputSlotCollection.getSlot(this.formatPartList.currentIndex);s&&(s.partText=t.substring(n,n+s.characterCount),this.processSlotRules(s))}}}processPastedValue(t,n=!1){n&&this.processSelectionEditRules();const r=this.formatNavigator.getCursorPosition(),s=this.inputSlotCollection.getSlotsFromCursorPosition(r);if(s){const i=r-s[0].startPosition,o=s[0].partText.substring(0,i);let a=s[0].partText.substring(i);s[0].partText="";for(let h=1,d=s.length;h<d;h++)a+=s[h].partText,s[h].partText="";const c=this.removeSeparatorsFromValue(t),l=o+c+a;let u=0;for(let h=0,d=s.length;h<d;h++){const f=s[h];f.partText=l.substring(u,f.characterCount+u),u+=f.characterCount,this.processSlotRules(f)}}}removeSeparatorsFromValue(t){let n=t;const r=this.partEntryList.getUniqueSeparators();for(let s=0,i=r.length;s<i;s++){const o=r[s];n=n.replaceAll(o,"")}return n}processEditRules(t){this.formatNavigator.isSelection?this.processSelectionEditRules():this.processNonSelectionEditRules(t)}processNonSelectionEditRules(t){const n=this.inputSlotCollection.getSlot(this.formatNavigator.getCurrentPartIndex());if(!n)return;const r=this.formatNavigator.getCursorPosition(),s=r-n.startPosition,i=this.format.deleteShiftsFormatPart||!1;switch(t.key){case"Backspace":{if(!(n.startPosition===r))n.partText=n.partText.substring(0,s-1)+n.partText.substring(s),i&&this.shiftFormatParts(n),this.formatRenderer.render(),this.formatNavigator.moveCursorLeft(),this.processSlotRules(n,!0);else{this.processSlotRules(n,!0);const a=this.inputSlotCollection.getPreviousSlot(n.partIndex);a&&(a.partText=a.partText.substring(0,a.partText.length-1),i&&this.shiftFormatParts(a),this.formatRenderer.render(),this.formatNavigator.setCursorPosition(a.startPosition+a.partText.length),this.processSlotRules(a,!0))}break}case"Delete":n.partText=n.partText.substring(0,s)+n.partText.substring(s+1),i&&this.shiftFormatParts(n),this.formatRenderer.render(),this.formatNavigator.setCursorToCurrentPosition(),this.processSlotRules(n,!0);break}}processSelectionEditRules(){const t=this.inputSlotCollection.getSlots(this.formatNavigator.getCurrentPartIndices());if(t.length<=0)return;const n=this.formatNavigator.getCursorStartPosition(),r=this.formatNavigator.getCursorEndPosition();for(let s=0,i=t.length;s<i;s++){const o=t[s];o.startPosition>=n&&o.endPosition<=r?o.partText="":o.startPosition>=n&&o.endPosition>r?o.partText=o.partText.substring(r-o.startPosition):o.startPosition<n&&o.endPosition<=r?o.partText=o.partText.substring(0,n-o.startPosition):o.startPosition<n&&o.endPosition>r&&(o.partText=o.partText.substring(0,n-o.startPosition)+o.partText.substring(r-o.startPosition))}this.formatRenderer.render(),this.formatNavigator.setCursorPosition(n);for(let s=0,i=t.length;s<i;s++)this.processSlotRules(t[s])}shiftFormatParts(t){let n=t,r;for(;(r=this.inputSlotCollection.getNextSlot(n.partIndex))!==void 0;){const s=r.partText.substring(0,1);r.partText=r.partText.substring(1),n.partText=n.partText+s,n=r}}processInputRules(t){const n=this.inputSlotCollection.getSlot(this.formatNavigator.getCurrentPartIndex());if(!n)return;const{key:r}=t,s=n.characterCount,i=n.partText;if(n.valueType===Yt.Numeric){if(!this.keyTypeChecker.isNumberKey(r))return;const o=n.maximumValue,a=n.exceedingMaximumValueCausesTab||!1,c=n.padWithZeros||!1,l=parseInt(this.createNewValue(n,r));if(o&&l>o)if(a){c&&(n.partText=n.partText.padStart(s,"0")),n.isComplete=!0;const u=this.inputSlotCollection.getNextSlot(n.partIndex);u&&!u.isComplete&&(u.partText=r),this.formatRenderer.render(),u&&this.formatNavigator.setCursorPosition(u.isComplete?u.startPosition:u.startPosition+1)}else return;else i.length+1===s?(this.addToInputSlot(r),n.isComplete=!0,this.formatRenderer.render(),this.formatNavigator.isAtLastPart()?this.formatNavigator.moveCursorRight():this.formatNavigator.moveToNextInputPart()):i.length+1<s&&(this.addToInputSlot(r),this.formatRenderer.render(),this.formatNavigator.moveCursorRight())}else i.length+1===s?(this.addToInputSlot(r),n.isComplete=!0,this.formatRenderer.render(),this.formatNavigator.isAtLastPart()?this.formatNavigator.moveCursorRight():this.formatNavigator.moveToNextInputPart()):(this.addToInputSlot(r),this.formatRenderer.render(),this.formatNavigator.moveCursorRight())}addToInputSlot(t){const n=this.inputSlotCollection.getSlot(this.formatNavigator.getCurrentPartIndex());n&&(n.partText=this.createNewValue(n,t))}createNewValue(t,n){const r=t.partText,s=this.formatNavigator.getCursorPosition();if(s>=t.startPosition+t.partText.length)return r+n;{const i=s-t.startPosition;return r.substring(0,i)+n+r.substring(i)}}processSlotRules(t,n=!1){const r=t.characterCount,s=t.allCharactersRequired||!1;if(t.valueType===Yt.Numeric){const i=t.minimumValue,o=t.maximumValue;if(s)t.isComplete=t.partText.length===r;else if(i!==void 0&&o!==void 0){const a=t.padWithZeros||!1,c=parseInt(t.partText);t.isComplete=c>=i&&c<=o,t.isComplete&&a&&!n&&(t.partText=t.partText.padStart(r,"0"))}else t.isComplete=t.partText.length>0}else s?t.isComplete=t.partText.length===r:t.isComplete=t.partText.length>0}}class Ax{constructor(t,n){this.format=t,this.instanceCollection=kn.getInstance(),this.formatNavigator=this.instanceCollection.getNavigatorInstance(n,t),this.ruleProcessor=new ll(t,n),this.keyTypeChecker=new ul,this.formatRenderer=new ai(t,n)}instanceCollection;formatNavigator;ruleProcessor;keyTypeChecker;formatRenderer;setInputElement(t){this.ruleProcessor.setInputElement(t),this.formatRenderer.setInputElement(t)}processMovementKey(t){const{key:n,metaKey:r,ctrlKey:s,shiftKey:i}=t;switch(n){case"ArrowLeft":i?this.formatNavigator.moveHighlightLeft():r?this.formatNavigator.moveHome():this.formatNavigator.moveCursorLeft();break;case"ArrowRight":i?this.formatNavigator.moveHighlightRight():r?this.formatNavigator.moveEnd():this.formatNavigator.moveCursorRight();break;case"Home":this.formatNavigator.moveHome();break;case"End":this.formatNavigator.moveEnd();break;case"a":(r||s)&&this.formatNavigator.highlightAll();break}}processKeyPress(t){return this.keyTypeChecker.isIgnoreKey(t)?!1:this.keyTypeChecker.isMovementKey(t)?(this.processMovementKey(t),!1):(this.ruleProcessor.processKeyPress(t),!0)}}class Nx{constructor(t,n=""){this.inputValue=n,this.instanceId=Tx(),this.instanceCollection=kn.getInstance(),this.keyProcessor=new Ax(t,this.instanceId),this.formatNavigator=this.instanceCollection.getNavigatorInstance(this.instanceId,t),this.formatRenderer=new ai(t,this.instanceId),this.inputSlotCollection=this.instanceCollection.getInputSlotInstance(this.instanceId,t),this.inputRuleProcessor=new ll(t,this.instanceId)}instanceId;instanceCollection;keyProcessor;formatNavigator;formatRenderer;inputSlotCollection;inputRuleProcessor;previousOutputValue="";inputElementSet=!1;isInputFocused=!1;inputElement;onFormatChange;inputElementCreated(t){this.keyProcessor.setInputElement(t),this.formatNavigator.setInputElement(t),this.formatRenderer.setInputElement(t),this.inputElement=t,this.inputElementSet=!0,this.inputElementSet&&this.inputValue.length>0&&this.inputValuePassed(this.inputValue)}inputFocused(){this.isInputFocused=!0,this.formatRenderer.render(),setTimeout(()=>this.formatNavigator.findCursorPosition())}inputBlurred(){this.isInputFocused=!1}inputValuePassed(t){this.inputValue=t,this.inputElementSet&&(this.inputValue.length>0?this.inputRuleProcessor.processInputValue(t):(this.inputSlotCollection.clearAllSlots(),this.previousOutputValue=void 0),this.renderFormat())}pastedValue(t){t.length>0&&(this.formatNavigator.isSelection?this.formatNavigator.isAllSelected?this.inputValuePassed(t):this.inputRuleProcessor.processPastedValue(t,!0):this.inputValue.length===0?this.inputValuePassed(t):this.inputRuleProcessor.processPastedValue(t),this.renderFormat(!0))}registerFormatChangeEvent(t){this.onFormatChange=t}mouseUpHandler(){this.formatNavigator.findCursorPosition()}keyDownHandler(t){if(t.key!=="Tab"){if(!(t.key==="c"&&(t.ctrlKey||t.metaKey))&&!(t.key==="x"&&(t.ctrlKey||t.metaKey))&&!(t.key==="v"&&(t.ctrlKey||t.metaKey)))t.preventDefault(),t.stopPropagation();else return;this.keyProcessor.processKeyPress(t)&&this.inputElement&&this.onFormatChange&&(this.inputSlotCollection.allSlotsCompleted()&&this.previousOutputValue!==this.inputElement.innerHTML?(this.previousOutputValue=this.inputElement.innerHTML,this.onFormatChange(this.inputElement.innerHTML)):this.inputSlotCollection.allSlotsEmpty()&&this.previousOutputValue!==void 0&&(this.previousOutputValue=void 0,this.onFormatChange()))}}dispose(){this.instanceCollection.removeInstances(this.instanceId)}renderFormat(t=!1){setTimeout(()=>{this.formatRenderer.render(),this.isInputFocused&&this.formatNavigator.setCursorToCurrentPosition(),this.inputValue.length>0&&(this.previousOutputValue=this.inputElement?.innerHTML),t&&this.inputElement?.innerHTML&&this.onFormatChange&&this.onFormatChange(this.inputElement.innerHTML)})}}const Ix=(e,t)=>{const{value:n="",format:r,readOnly:s=!1,debounceTime:i=800,fillContainer:o=!0,leftElement:a,rightElement:c,className:l,leftElementClassName:u,rightElementClassName:h,isSingleLine:d=!1,allowSingleLineScroll:f=!1,isInputValid:p,onChange:g,onFocus:y,onBlur:b,onElementCreate:w,onLeftElementClick:S,onRightElementClick:T}=e,[P,D]=m.useState(!0),A=m.useRef(void 0),C=m.useRef(void 0),E=m.useRef(void 0),j=m.useRef(!1);m.useEffect(()=>(document.addEventListener("mouseup",W),()=>{E.current?.dispose(),document.removeEventListener("mouseup",W)}),[]),m.useEffect(()=>{E.current?.inputValuePassed(n)},[n]),m.useEffect(()=>{E.current?.dispose(),r&&(E.current=new Nx(r,n),C.current&&E.current?.inputElementCreated(C.current),E.current?.registerFormatChangeEvent(R))},[r]);const R=m.useCallback(k=>{p?p(k)?(D(!0),g?.(k)):D(!1):g?.(k)},[g]),F=m.useCallback(k=>{E.current?.inputFocused(),y?.(k)},[y]),B=m.useCallback(k=>{E.current?.inputBlurred(),b?.(k)},[b]),N=m.useCallback(()=>{j.current=!0},[]),I=m.useCallback(()=>{if(j.current)j.current=!1,E.current?.mouseUpHandler();else{const k=new MouseEvent("mouseup");document.dispatchEvent(k)}},[]),W=m.useCallback(()=>{j.current&&(j.current=!1,E.current?.mouseUpHandler())},[]),L=m.useCallback(k=>{E.current?.keyDownHandler(k)},[]),H=m.useCallback(k=>{k.preventDefault(),k.stopPropagation();const M=k.clipboardData?.getData("text/plain");M&&E.current?.pastedValue(M)},[]),V=m.useCallback(k=>{A.current?.inputElement?.removeEventListener("keydown",L),A.current?.inputElement?.removeEventListener("mousedown",N),A.current?.inputElement?.removeEventListener("mouseup",I),A.current?.inputElement?.removeEventListener("paste",H),A.current=k,A.current?.inputElement?.addEventListener("keydown",L),A.current?.inputElement?.addEventListener("mousedown",N),A.current?.inputElement?.addEventListener("mouseup",I),A.current?.inputElement?.addEventListener("paste",H),C.current=A.current?.inputElement},[]),Z=m.useCallback(()=>{A.current?.focus()},[]);m.useImperativeHandle(t,()=>({focus:Z}));const x=z(l,{"bsc:border-error!":!P});return v.jsx(jn,{ref:k=>{k&&V(k)},readOnly:s,debounceTime:i,fillContainer:o,leftElement:a,rightElement:c,className:x,leftElementClassName:u,rightElementClassName:h,isSingleLine:d,allowSingleLineScroll:f,onFocus:F,onBlur:B,onElementCreate:w,onLeftElementClick:S,onRightElementClick:T})},hl=m.forwardRef(Ix),ci=m.createContext(void 0);function fl(e,t,n=!0){const r=Zo(e),s=Uo(e),i=dg(e);let o=jr(s)-(t.options?.weekStartsOn||0);o=o===-1?6:o;const a=jr(i)-(t.options?.weekStartsOn||0),c=Sm({start:s,end:i}),l=r+o>35?6:5,u=dl(l,7,{dayValue:null,isCurrent:!0});let h=1;for(let d=0,f=l;d<f;d++){for(let p=d>0?0:o;p<7;p++){const g=c[h-1];if(g.setHours(e.getHours(),e.getMinutes(),e.getSeconds()),u[d][p].dayValue=g,++h>r)break}if(h>r)break}if(o>0&&n)for(let d=0;d<o;d++)u[0][d].dayValue=ly(s,o-d),u[0][d].isCurrent=!1;if(a>-1&&n)for(let d=6;d>a;d--)u[l-1][d].dayValue=Ie(i,d-a),u[l-1][d].isCurrent=!1;return u}function dl(e,t,n){const r=[];for(let s=0,i=e;s<i;s++){const o=[];for(let a=0,c=t;a<c;a++){const l=Ox(n)?n:{...n};o.push(l)}r.push(o)}return r}function Ox(e){const t=typeof e;return t==="string"||t==="number"||t==="boolean"||e instanceof Date}function Vx(e){const t=hy(new Date,e.options?.weekStartsOn||0),n=[];for(let r=0;r<7;r++)n.push(Ie(t,r).toLocaleDateString(e.code,{weekday:"short"}));return n}function Lx(e){const t=new Date(Date.UTC(2020,0,1)),n=[[{monthNumber:0,monthName:""},{monthNumber:0,monthName:""},{monthNumber:0,monthName:""},{monthNumber:0,monthName:""}],[{monthNumber:0,monthName:""},{monthNumber:0,monthName:""},{monthNumber:0,monthName:""},{monthNumber:0,monthName:""}],[{monthNumber:0,monthName:""},{monthNumber:0,monthName:""},{monthNumber:0,monthName:""},{monthNumber:0,monthName:""}]];let r=0;for(let s=0;s<3;s++)for(let i=0;i<4;i++)n[s][i]={monthNumber:r,monthName:te(t,r++).toLocaleDateString(e.code,{month:"short"})};return n}function Fx(e,t){const n=new Date(e.getTime()),r=Math.floor(n.getFullYear()/10)*10;n.setFullYear(r);const s=Tm({start:n,end:on(n,9)}),i=dl(3,4,"");let o=0;for(let a=0;a<3;a++)for(let c=0;c<4&&(i[a][c]=s[o++].toLocaleDateString(t.code,{year:"numeric"}),o!==s.length);c++);return i}function _x(e){const t=new Date;return t.setHours(0,0,0,0),t.toLocaleTimeString(e.code)}function jx(e,t,n){return e.getTime()>=t.getTime()&&e.getTime()<=n.getTime()}function Dn(e,t){const n=fy(e);if(isNaN(n.valueOf())){let r=$t(e,"P pp",new Date,{locale:t});return!isNaN(r.valueOf())||(r=$t(e,"Pp",new Date,{locale:t}),!isNaN(r.valueOf()))||(r=$t(e,"P HH:mm",new Date,{locale:t}),!isNaN(r.valueOf()))||(r=$t(e,"P hh:mm a..aaa",new Date,{locale:t}),!isNaN(r.valueOf()))||(r=$t(e,"P HH:mm:ss",new Date,{locale:t}),!isNaN(r.valueOf()))||(r=$t(e,"P hh:mm:ss a..aaa",new Date,{locale:t}),!isNaN(r.valueOf()))||(r=$t(e,"P",new Date,{locale:t}),!isNaN(r.valueOf()))||(r=$t(e,"P p",new Date,{locale:t}),!isNaN(r.valueOf()))||(r=$t(e,"pp",new Date,{locale:t}),!isNaN(r.valueOf()))||(r=$t(e,"p",new Date,{locale:t}),!isNaN(r.valueOf()))?r:void 0}return n}function ui(e,t){const n=e.split("-");if(n.length!==2)return;const r=Dn(n[0].trim(),t);if(!r)return;const s=Dn(n[1].trim(),t);if(s)return[r,s]}var Q=(e=>(e[e.DateTime=0]="DateTime",e[e.DateOnly=1]="DateOnly",e[e.TimeOnly=2]="TimeOnly",e[e.DateRange=3]="DateRange",e))(Q||{}),yt=(e=>(e[e.DaySelector=0]="DaySelector",e[e.MonthSelector=1]="MonthSelector",e[e.YearSelector=2]="YearSelector",e[e.TimeSelector=3]="TimeSelector",e[e.DateRangeSelector=4]="DateRangeSelector",e))(yt||{}),ze=(e=>(e[e.Day=0]="Day",e[e.Month=1]="Month",e[e.Year=2]="Year",e[e.Range=3]="Range",e))(ze||{}),En=(e=>(e[e.Short=0]="Short",e[e.Medium=1]="Medium",e[e.Long=2]="Long",e))(En||{}),ft=(e=>(e[e.TwelveHour=0]="TwelveHour",e[e.TwentyFourHour=1]="TwentyFourHour",e))(ft||{}),ae=(e=>(e[e.Normal=0]="Normal",e[e.Range=1]="Range",e))(ae||{}),ir=(e=>(e[e.Right=0]="Right",e[e.Left=1]="Left",e[e.None=2]="None",e))(ir||{}),U=(e=>(e[e.SetDateSelector=0]="SetDateSelector",e[e.SetViewDate=1]="SetViewDate",e[e.SetSelectedDate=2]="SetSelectedDate",e[e.SetSelectedDateRange=3]="SetSelectedDateRange",e[e.SetSelectedStartDate=4]="SetSelectedStartDate",e[e.SetSelectedEndDate=5]="SetSelectedEndDate",e[e.SetTimeFormat=6]="SetTimeFormat",e[e.ClearDates=7]="ClearDates",e[e.InitializeDates=8]="InitializeDates",e))(U||{});const Bx=(e,t)=>{switch(t.type){case 0:return t.dateSelector!==void 0?{...e,currentSelector:t.dateSelector,currentViewDate:t.viewDate||e.currentViewDate}:{...e};case 1:return{...e,currentViewDate:t.viewDate||new Date,dateInitialized:!0};case 2:return{...e,selectedDate:t.selectedDate||e.selectedDate,currentViewDate:t.viewDate||e.currentViewDate};case 3:return{...e,selectedStartDate:t.selectedStartDate||e.selectedStartDate,selectedEndDate:t.selectedEndDate||e.selectedEndDate};case 4:return{...e,selectedStartDate:t.selectedStartDate,selectedEndDate:void 0};case 5:return{...e,selectedEndDate:t.selectedEndDate};case 6:return{...e,timeFormat:t.timeFormat||e.timeFormat};case 7:return{currentSelector:e.currentSelector,currentViewDate:e.currentViewDate,timeFormat:e.timeFormat,dateInitialized:!0};case 8:{const n={...e,currentViewDate:Hx(t.initialDate),dateInitialized:!0};return Array.isArray(t.initialDate)?{...n,selectedStartDate:t.initialDate[0],selectedEndDate:t.initialDate[1]}:{...n,selectedDate:t.initialDate}}default:return{...e,currentSelector:yt.DaySelector}}};function Hx(e){return e?Array.isArray(e)?e[0]:e:new Date}const li=(e,t,n)=>{const r=m.useCallback(c=>{n({type:U.SetViewDate,viewDate:te(t,c)})},[t]),s=m.useCallback(c=>{n({type:U.SetViewDate,viewDate:Wr(t,c)})},[t]),i=m.useCallback(c=>{n({type:U.SetViewDate,viewDate:on(t,c)})},[t]),o=m.useCallback(c=>{n({type:U.SetViewDate,viewDate:Yr(t,c)})},[t]),a=m.useCallback(c=>{n({type:U.SetDateSelector,dateSelector:c})},[]);return{...e,incrementViewMonths:r,decrementViewMonths:s,incrementViewYears:i,decrementViewYears:o,setDateSelector:a}},or=({viewDate:e,selectedDate:t,selectedStartDate:n,selectedEndDate:r,selectionMode:s=ae.Normal,locale:i,onDateSelected:o,selectableDate:a,isValidDate:c,dispatcher:l})=>{const[u,h]=m.useState(!1),[d,f]=m.useState(),[p,g]=m.useState(),[y,b]=m.useState(),[w,S]=m.useState(),T=m.useRef(void 0),P=m.useRef(void 0),D=m.useContext(ci),A=m.useMemo(()=>D.calendarTemplate,[D.calendarTemplate]);m.useEffect(()=>{T.current=i,P.current=Vx(T.current),h(!0)},[]),m.useEffect(()=>{e&&T.current&&b(fl(e,T.current,s===ae.Normal))},[e,u]),m.useEffect(()=>{S(t?new Date(t.getFullYear(),t.getMonth(),t.getDate()):void 0)},[t]),m.useEffect(()=>{f(n?new Date(n.getFullYear(),n.getMonth(),n.getDate(),0,0,0).getTime():void 0),g(r?new Date(r.getFullYear(),r.getMonth(),r.getDate(),23,59,59).getTime():void 0)},[n,r]),m.useEffect(()=>{T.current&&i&&(T.current=i,b(fl(e,T.current,s===ae.Normal)))},[i]);const C=N=>{if(s===ae.Normal)l?.({type:U.SetSelectedDate,selectedDate:N,viewDate:N}),o?.(N);else{if(!o)throw new Error("Range selection mode requires onDateSelected to be set");!n||pg(N,n)?o(N):n&&!r?o(N,{setEndDate:!0}):n&&r&&o(N)}},E=N=>w?.toLocaleDateString()===N.toLocaleDateString(),j=N=>{if(d&&p){const I=N.getTime();return I>=d&&I<=p}return!1},R=li({viewDate:e,selectedDate:t,selectedStartDate:n,selectedEndDate:r,selectionMode:s,locale:i,weekDays:P.current,monthMatrix:y,selectableDate:a,isValidDate:c,onDateClicked:C,isSelectedDate:E,isInSelectedDateRange:j},e,l),B=A||((N,I)=>v.jsx("div",{className:"bc-dt-calendar bsc:w-full",children:I}));return v.jsx(pe,{props:R,template:B,children:v.jsxs("div",{className:"bc-dt-day-row bsc:grid bsc:min-w-[329px] bsc:grid-cols-7 bsc:gap-3",children:[P.current?.map((N,I)=>v.jsx("div",{className:"bc-dt-day-cell bsc:text-center bsc:font-bold",children:N},I)),y?.map((N,I)=>N.map((W,L)=>{const H=W.dayValue!==null&&(a===void 0||a(W.dayValue)),V=z("bsc:text-center bsc:py-1 bsc:hover:bg-primary-2 bsc:hover:text-white bsc:dark:hover:bg-mono-light-2 bsc:dark:hover:text-mono-dark-1",{"bsc:text-gray-3":!W.isCurrent,"bsc:bg-primary-1 bsc:text-white bsc:dark:bg-mono-light-1 bsc:dark:text-mono-dark-1":W&&W.dayValue&&(w&&E(W.dayValue)||d&&!p&&Ro(d,W.dayValue)||d&&p&&j(W.dayValue)),"bsc:cursor-pointer":H,"bsc:text-error bsc:cursor-not-allowed":!H,"bsc:bg-primary-5 bsc:dark:bg-mono-light-3 bsc:dark:text-mono-dark-1":W.dayValue&&uy(W.dayValue)&&!(E(W.dayValue)||j(W.dayValue))},"bc-dt-date-cell");return v.jsx("div",{className:V,onClick:()=>W&&W.dayValue&&H&&(c===void 0||c(W.dayValue))&&C(W.dayValue),children:W.dayValue?.getDate().toLocaleString(T.current?.code)},I.toString()+L.toString())}))]})})},ar=({title:e,scrollerType:t,onTitleClicked:n,onMovePrevious:r,onMoveNext:s,viewDate:i,dispatcher:o})=>{const c=m.useContext(ci).dateScrollerTemplate,l=li({title:e,scrollerType:t,onTitleClicked:n,onMovePrevious:r,onMoveNext:s},i,o),u="bsc:bg-transparent bsc:cursor-pointer bsc:focus:outline-hidden bsc:hover:bg-primary-1! bsc:hover:text-white! bsc:dark:hover:bg-mono-light-3!",d=c||((f,p)=>v.jsx("div",{className:"bc-dt-scroller bsc:flex bsc:w-full bsc:flex-row bsc:items-center bsc:px-2 bsc:py-1",children:p}));return v.jsxs(pe,{props:l,template:d,children:[v.jsx("div",{className:"bc-dt-scroller-left bsc:shrink bsc:cursor-pointer",children:v.jsx(jt,{className:u,onClick:r,children:v.jsx(Mt,{icon:"chevronLeft",size:Tt.Regular})})}),v.jsx("div",{className:"bc-dt-scroller-title bsc:grow bsc:cursor-pointer bsc:text-center bsc:hover:text-primary-2 bsc:dark:hover:text-mono-light-3",onClick:n,children:e}),v.jsx("div",{className:"bc-dt-scroller-right bsc:shrink bsc:cursor-pointer",children:v.jsx(jt,{className:u,onClick:s,children:v.jsx(Mt,{icon:"chevronRight",size:Tt.Regular})})})]})},$x=({selectedDate:e,viewDate:t,locale:n,showTimeSelector:r,selectableDate:s,isValidDate:i,onChange:o,dispatcher:a})=>{const c=()=>{t&&a({type:U.SetViewDate,viewDate:Wr(t,1)})},l=()=>{t&&a({type:U.SetViewDate,viewDate:te(t,1)})},u=()=>{a({type:U.SetDateSelector,dateSelector:yt.MonthSelector})},h=()=>{a({type:U.SetDateSelector,dateSelector:yt.TimeSelector})},d=()=>t?t.toLocaleDateString(n.code,{month:"long",year:"numeric"}):"";return v.jsxs("div",{className:"bc-dt-day-selector bsc:p-2",children:[v.jsx(ar,{title:d(),scrollerType:ze.Day,onTitleClicked:u,onMovePrevious:c,onMoveNext:l,viewDate:t,dispatcher:a}),v.jsx(or,{viewDate:t,selectedDate:e,locale:n,selectableDate:s,isValidDate:i,onDateSelected:o,dispatcher:a}),r&&v.jsx("div",{className:"bc-dt-time-value-wrapper bsc:flex bsc:w-full bsc:flex-row bsc:justify-center bsc:p-2",children:v.jsx("div",{className:"bc-dt-time-value bsc:cursor-pointer bsc:p-2 bsc:hover:bg-primary-2 bsc:hover:text-white bsc:dark:bg-mono-dark-1 bsc:dark:text-mono-light-1 bsc:dark:hover:bg-mono-light-2 bsc:dark:hover:text-mono-dark-2",onClick:h,children:e?.toLocaleTimeString(n.code)||_x(n)})})]})},Wx=({viewDate:e,locale:t,dateSelection:n=Q.DateTime,dispatcher:r})=>{const s=m.useRef(Lx(t)),i=()=>{const u=Yr(e,1);r({type:U.SetViewDate,viewDate:u})},o=()=>{const u=on(e,1);r({type:U.SetViewDate,viewDate:u})},a=u=>{r({type:U.SetDateSelector,dateSelector:n!==Q.DateRange?yt.DaySelector:yt.DateRangeSelector,viewDate:Ey(e,u)})},c=()=>e.toLocaleDateString(t.code,{year:"numeric"}),l=()=>{r({type:U.SetDateSelector,dateSelector:yt.YearSelector})};return v.jsxs("div",{className:"bc-dt-month-selector bsc:p-2",style:{minWidth:"20rem"},children:[v.jsx(ar,{title:c(),scrollerType:ze.Month,onTitleClicked:l,onMovePrevious:i,onMoveNext:o,viewDate:e,dispatcher:r}),v.jsx("div",{className:"bc-dt-month-grid bsc:grid bsc:w-full bsc:grid-cols-4 bsc:gap-4",children:s.current.map((u,h)=>u.map((d,f)=>v.jsx("div",{className:"bc-dt-month-cell bsc:cursor-pointer bsc:text-center bsc:py-2 bsc:hover:bg-primary-2 bsc:hover:text-white bsc:dark:hover:bg-mono-light-2 bsc:dark:hover:text-mono-dark-1",onClick:()=>a(d.monthNumber),children:d.monthName},h.toString()+f.toString())))})]})},Yx=({viewDate:e,selectedStartDate:t,selectedEndDate:n,locale:r,onChange:s,dispatcher:i})=>{const o=$n("screen and (max-device-width: 40rem)"),a=te(e,1),c=(f,p)=>{!p||!p.setEndDate?i({type:U.SetSelectedStartDate,selectedStartDate:f}):(i({type:U.SetSelectedEndDate,selectedEndDate:f}),t&&s&&s([t,f]))},l=()=>{i({type:U.SetDateSelector,dateSelector:yt.MonthSelector})},u=()=>o?`${e.toLocaleDateString(r.code,{month:"long"})} ${e.toLocaleDateString(r.code,{year:"numeric"})}`:`${e.toLocaleDateString(r.code,{month:"long"})} ${e.toLocaleDateString(r.code,{year:"numeric"})} - ${a.toLocaleDateString(r.code,{month:"long"})} ${a.toLocaleDateString(r.code,{year:"numeric"})}`,h=()=>{e&&i({type:U.SetViewDate,viewDate:Wr(e,1)})},d=()=>{e&&i({type:U.SetViewDate,viewDate:te(e,1)})};return v.jsxs("div",{className:"bc-dt-range-selector bsc:flex bsc:flex-col",children:[v.jsx("div",{className:"bc-dt-range-scroller-wrapper bsc:shrink",children:v.jsx(ar,{title:u(),scrollerType:ze.Range,onTitleClicked:l,onMovePrevious:h,onMoveNext:d,viewDate:e,dispatcher:i})}),v.jsx("div",{className:"bsc-flex-grow",children:v.jsx(Ur,{mobileMarkup:v.jsx("div",{className:"bc-dt-range-calendar bsc:px-2 bsc:py-1",children:v.jsx(or,{viewDate:e,selectedStartDate:t,selectedEndDate:n,selectionMode:ae.Range,onDateSelected:c,locale:r,dispatcher:i})}),aboveMobileMarkup:v.jsxs("div",{className:"bc-dt-range-wrapper bsc:flex bsc:flex-row bsc:px-2 bsc:py-1",children:[v.jsx("div",{className:"bc-dt-range-calendar-1 bsc:border-r bsc:border-solid bsc:border-gray-3 bsc:pr-4",children:v.jsx(or,{viewDate:e,selectedStartDate:t,selectedEndDate:n,selectionMode:ae.Range,onDateSelected:c,locale:r,dispatcher:i})}),v.jsx("div",{className:"bc-dt-range-calendar-2 bsc:pl-4",children:v.jsx(or,{viewDate:a,selectedStartDate:t,selectedEndDate:n,selectionMode:ae.Range,onDateSelected:c,locale:r,dispatcher:i})})]})})})]})},Rx=({viewDate:e,showDateSelector:t,locale:n,timeFormat:r=ft.TwelveHour,timeConstraints:s,onChange:i,dispatcher:o})=>{const a=m.useRef(r===ft.TwelveHour?11:23),c=m.useRef(r===ft.TwelveHour?["12","01","02","03","04","05","06","07","08","09","10","11"]:["00","01","02","03","04","05","06","07","08","09","10","11","12","13","14","15","16","17","18","19","20","21","22","23"]),l=m.useRef(Ny(0,59,N=>N.toString().padStart(2,"0"))),u=m.useRef(["AM","PM"]),h=m.useRef(lm(e)),d=N=>N>11?N-12:N,[f,p]=m.useState(d(e.getHours())),[g,y]=m.useState(e.getMinutes()),[b,w]=m.useState(e.getHours()<=12?0:1),S=m.useRef(e.toLocaleDateString(n.code));m.useEffect(()=>{const N=e.getHours(),I=e.getMinutes();if(N!==f&&p(r===ft.TwelveHour?d(N):N),I!==g&&y(I),r===ft.TwelveHour){const W=N<=11?0:1;W!==b&&w(W)}},[e]);const T=()=>{const N=s?.hours?.step||1,I=f<a.current?f+N:0;p(I),E(I,g,b)},P=()=>{const N=s?.hours?.step||1,I=f>0?f-N:a.current;p(I),E(I,g,b)},D=()=>{const N=s?.minutes?.step||1,I=g+N<(s?.minutes?.max||59)?g+N:s?.minutes?.min||0;y(I),E(f,I,b)},A=()=>{const N=s?.minutes?.step||1,I=g-N>=(s?.minutes?.min||0)?g-N:(s?.minutes?.max||60)-N;y(I),E(f,I,b)},C=()=>{const N=b===0?1:0;w(N),E(f,g,N)},E=(N,I,W)=>{const L=r===ft.TwelveHour&&W===1?N+12:N;h.current.setHours(L,I),o({type:U.SetSelectedDate,selectedDate:h.current,viewDate:h.current}),i?.(h.current)},j=()=>{o({type:U.SetDateSelector,dateSelector:yt.DaySelector})},R=z("bsc:w-full bsc:grid bsc:grid-rows-3 bsc:gap-4 bsc:items-center bc-dt-time-grid",{"bsc:grid-cols-4":r===ft.TwelveHour,"bsc:grid-cols-3":r===ft.TwentyFourHour}),F=z("bsc:text-center bsc:cursor-pointer bsc:hover:bg-primary-2 bsc:hover:text-white bsc:dark:text-mono-light-1 bsc:dark:hover:bg-mono-light-1 bsc:dark:hover:text-mono-dark-1 bc-dt-time-date-value",{"bsc:col-span-4":r===ft.TwelveHour,"bsc:col-span-3":r===ft.TwentyFourHour}),B="bsc-bg-transparent bsc:p-2 bsc:cursor-pointer bsc:focus:outline-hidden bsc:hover:bg-primary-2 bsc:hover:text-white bsc:dark:hover:bg-mono-light-1 bsc:dark:hover:text-mono-dark-1";return v.jsx("div",{className:"bc-dt-time-selector bsc:flex bsc:flex-row bsc:justify-center bsc:p-2",style:{minWidth:r===ft.TwelveHour?"15rem":"11rem"},children:v.jsxs("div",{className:R,children:[t&&v.jsx("div",{className:F,onClick:j,children:S.current}),v.jsx("div",{className:"bc-dt-time-hour-increase bsc:cursor-pointer bsc:text-center",children:v.jsx(jt,{className:B,onClick:T,children:v.jsx(Mt,{icon:"chevronUp",size:Tt.Regular})})}),v.jsx("div",{}),v.jsx("div",{className:"bc-dt-time-minute-increase bsc:cursor-pointer bsc:text-center",children:v.jsx(jt,{className:B,onClick:D,children:v.jsx(Mt,{icon:"chevronUp",size:Tt.Regular})})}),r===ft.TwelveHour&&v.jsx("div",{className:"bc-dt-time-meridian-increase bsc:cursor-pointer bsc:text-center",children:v.jsx(jt,{className:B,onClick:C,children:v.jsx(Mt,{icon:"chevronUp",size:Tt.Regular})})}),v.jsx("div",{className:"bc-dt-time-hour-value bsc:text-center",children:c.current[f]}),v.jsx("div",{className:"bc-dt-time-separator bsc:text-center",children:":"}),v.jsx("div",{className:"bc-dt-time-minute-value bsc:text-center",children:l.current[g]}),r===ft.TwelveHour&&v.jsx("div",{className:"bc-dt-time-meridian-value bsc:text-center",children:u.current[b]}),v.jsx("div",{className:"bc-dt-time-hour-decrease bsc:cursor-pointer bsc:text-center",children:v.jsx(jt,{className:B,onClick:P,children:v.jsx(Mt,{icon:"chevronDown",size:Tt.Regular})})}),v.jsx("div",{}),v.jsx("div",{className:"bc-dt-time-minute-decrease bsc:cursor-pointer bsc:text-center",children:v.jsx(jt,{className:B,onClick:A,children:v.jsx(Mt,{icon:"chevronDown",size:Tt.Regular})})}),r===ft.TwelveHour&&v.jsx("div",{className:"bc-dt-time-meridian-decrease bsc:cursor-pointer bsc:text-center",children:v.jsx(jt,{className:B,onClick:C,children:v.jsx(Mt,{icon:"chevronDown",size:Tt.Regular})})})]})})},Ux=({viewDate:e,locale:t,dispatcher:n})=>{const r=Fx(e,t),s=()=>{const c=Yr(e,10);n({type:U.SetViewDate,viewDate:c})},i=()=>{const c=on(e,10);n({type:U.SetViewDate,viewDate:c})},o=c=>{const l=parseInt(c);n({type:U.SetDateSelector,dateSelector:yt.MonthSelector,viewDate:My(e,l)})},a=()=>`${r[0][0].toString()} - ${r[2][1].toString()}`;return v.jsxs("div",{className:"bc-dt-year-selector bsc:p-2",style:{minWidth:"20rem"},children:[v.jsx(ar,{title:a(),scrollerType:ze.Year,onMovePrevious:s,onMoveNext:i,viewDate:e,dispatcher:n}),v.jsx("div",{className:"bc-dt-year-wrapper bsc:w-full",children:v.jsx("div",{className:"bc-dt-year-grid bsc:grid bsc:grid-cols-4 bsc:gap-4",children:r.map((c,l)=>c.map((u,h)=>u.length>0?v.jsx("div",{className:"bc-dt-year-cell bsc:cursor-pointer bsc:text-center bsc:py-2 bsc:hover:bg-primary-2 bsc:hover:text-white bsc:dark:hover:bg-mono-light-2 bsc:dark:hover:text-mono-dark-1",onClick:()=>o(u),children:u},l.toString()+h.toString()):v.jsx("div",{},l.toString()+h.toString())))})})]})};class zx{constructor(t,n){this.dateSelection=t;const r=2023,s=12,i=20,a=new Date(r,s-1,i).toLocaleDateString(n,{year:"numeric",month:"numeric",day:"numeric"});this.dateFormat=a.replace(`${r}`,"YYYY").replace(`${s}`,"MM").replace(`${i}`,"DD");const c=new Date,l=18,u=24,h=37,d=317;c.setHours(l,u,h,d);const f=c.toLocaleTimeString(n);this.use24HourTime=f.startsWith("18"),this.timeFormat=f.replace(`${this.use24HourTime?l:"6"}`,"HH").replace(`${u}`,"MM").replace(`${h}`,"SS").replace(`${d}`,"LLL"),this.createDateParts()}dateFormat;timeFormat;use24HourTime;monthPart;dayPart;yearPart;twelveHourPart;twentyFourHourPart;minutePart;meridianPart;get is24HourTime(){return this.use24HourTime}createInputFormat(){const t={deleteShiftsFormatPart:!1,formatParts:[]};switch(this.dateSelection){case Q.DateOnly:return this.createDateFormat(t);case Q.TimeOnly:return this.createTimeFormat(t);case Q.DateRange:return this.createDateRangeFormat(t);case Q.DateTime:return this.createDateTimeFormat(t)}}createDateFormat(t){return this.dateFormat.startsWith("MM")?t.formatParts.push(...this.createMonthDayYearFormatParts()):this.dateFormat.startsWith("DD")?t.formatParts.push(...this.createDayMonthYearFormatParts()):t.formatParts.push(...this.createYearMonthDayFormatParts()),t}createTimeFormat(t){return this.use24HourTime?t.formatParts.push(...this.createTwentyFourHourFormatParts()):t.formatParts.push(...this.createTwelveHourFormatParts()),t}createDateRangeFormat(t){const n=[];this.dateFormat.startsWith("MM")?n.push(...this.createMonthDayYearFormatParts()):this.dateFormat.startsWith("DD")?n.push(...this.createDayMonthYearFormatParts()):n.push(...this.createYearMonthDayFormatParts());const r={characterCount:3,placeholder:" - ",inputText:" - ",isSeparator:!0};return t.formatParts.push(...n,r,...n),t}createDateTimeFormat(t){this.dateFormat.startsWith("MM")?t.formatParts.push(...this.createMonthDayYearFormatParts()):this.dateFormat.startsWith("DD")?t.formatParts.push(...this.createDayMonthYearFormatParts()):t.formatParts.push(...this.createYearMonthDayFormatParts());const n={characterCount:1,placeholder:" ",inputText:" ",isSeparator:!0};return t.formatParts.push(n),this.use24HourTime?t.formatParts.push(...this.createTwentyFourHourFormatParts()):t.formatParts.push(...this.createTwelveHourFormatParts()),t}createMonthDayYearFormatParts(){if(this.monthPart&&this.dayPart&&this.yearPart){let t=this.dateFormat.replace("MM",""),n=t.indexOf("DD"),r=t.substring(0,n);t=t.replace(r,"").replace("DD","");const s={characterCount:r.length,placeholder:r,inputText:r,isSeparator:!0};n=t.indexOf("YYYY"),r=t.substring(0,n);const i={characterCount:r.length,placeholder:r,inputText:r,isSeparator:!0};return[this.monthPart,s,this.dayPart,i,this.yearPart]}return[]}createDayMonthYearFormatParts(){if(this.monthPart&&this.dayPart&&this.yearPart){let t=this.dateFormat.replace("DD",""),n=t.indexOf("MM"),r=t.substring(0,n);t=t.replace(r,"").replace("MM","");const s={characterCount:r.length,placeholder:r,inputText:r,isSeparator:!0};n=t.indexOf("YYYY"),r=t.substring(0,n);const i={characterCount:r.length,placeholder:r,inputText:r,isSeparator:!0};return[this.dayPart,s,this.monthPart,i,this.yearPart]}return[]}createYearMonthDayFormatParts(){if(this.monthPart&&this.dayPart&&this.yearPart){let t=this.dateFormat.replace("YYYY",""),n=t.indexOf("MM"),r=t.substring(0,n);t=t.replace(r,"").replace("MM","");const s={characterCount:r.length,placeholder:r,inputText:r,isSeparator:!0};n=t.indexOf("DD"),r=t.substring(0,n);const i={characterCount:r.length,placeholder:r,inputText:r,isSeparator:!0};return[this.yearPart,s,this.monthPart,i,this.dayPart]}return[]}createTwelveHourFormatParts(){if(this.twelveHourPart&&this.minutePart&&this.meridianPart){const t=this.timeFormat.replace("HH",""),n=t.indexOf("MM"),r=t.substring(0,n),s={characterCount:r.length,placeholder:r,inputText:r,isSeparator:!0},i={characterCount:1,placeholder:" ",inputText:" ",isSeparator:!0};return[this.twelveHourPart,s,this.minutePart,i,this.meridianPart]}return[]}createTwentyFourHourFormatParts(){if(this.twentyFourHourPart&&this.minutePart){const t=this.timeFormat.replace("HH",""),n=t.indexOf("MM"),r=t.substring(0,n),s={characterCount:r.length,placeholder:r,inputText:r,isSeparator:!0};return[this.twentyFourHourPart,s,this.minutePart]}return[]}createDateParts(){this.monthPart={characterCount:2,placeholder:"M",inputText:"_",isSeparator:!1,allCharactersRequired:!1,valueType:Yt.Numeric,minimumValue:1,maximumValue:12,exceedingMaximumValueCausesTab:!0,padWithZeros:!0},this.dayPart={characterCount:2,placeholder:"D",inputText:"_",isSeparator:!1,allCharactersRequired:!1,valueType:Yt.Numeric,minimumValue:1,maximumValue:31,exceedingMaximumValueCausesTab:!0,padWithZeros:!0},this.yearPart={characterCount:4,placeholder:"Y",inputText:"_",isSeparator:!1,allCharactersRequired:!0,valueType:Yt.Numeric},this.twelveHourPart={characterCount:2,placeholder:"H",inputText:"_",isSeparator:!1,allCharactersRequired:!1,valueType:Yt.Numeric,minimumValue:1,maximumValue:12,exceedingMaximumValueCausesTab:!0,padWithZeros:!0},this.twentyFourHourPart={characterCount:2,placeholder:"H",inputText:"_",isSeparator:!1,allCharactersRequired:!1,valueType:Yt.Numeric,minimumValue:0,maximumValue:23,exceedingMaximumValueCausesTab:!0,padWithZeros:!0},this.minutePart={characterCount:2,placeholder:"M",inputText:"_",isSeparator:!1,allCharactersRequired:!1,valueType:Yt.Numeric,minimumValue:0,maximumValue:59,exceedingMaximumValueCausesError:!0,padWithZeros:!0},this.meridianPart={characterCount:2,inputText:"_",isSeparator:!1,valueType:Yt.Text,possibleValues:["AM","PM"]}}}const Kx=(e,t)=>{const[n,r]=m.useState(),s=m.useRef(void 0);return m.useEffect(()=>{t&&!n&&(s.current=new zx(e,t),r(s.current.createInputFormat()))},[t]),[n,s.current?.is24HourTime]},Gx=({value:e,readOnly:t=!1,label:n,useDefaultDateValue:r=!1,useFormattedInput:s=!1,allowClear:i=!1,closeSelector:o=!1,locale:a,className:c,dateSelection:l=Q.DateTime,dateFormat:u,timeConstraints:h,icon:d,iconPosition:f=ir.Right,inputElement:p,selectableDate:g,isValidDate:y,onChange:b,onError:w,calendarTemplate:S,dateScrollerTemplate:T,inputTemplate:P,wrapperTemplate:D})=>{const[A,C]=m.useState(!1),[E,j]=m.useState(),[R,F]=m.useState(),[B,N,I]=Ch(l),W=m.useRef(void 0),L=m.useRef(!1),H=m.useRef(a||Ay()),V=m.useRef(void 0),Z=m.useRef(void 0),x=m.useRef(void 0),k=m.useRef(null),M=m.useRef(null),[q,Dt]=Kx(l,E),Zt=kl.useDateLocale(H.current),ut=m.useRef({calendarTemplate:S,dateScrollerTemplate:T});m.useEffect(()=>{j(Zt.code),V.current=Zt;const $=ce();et(e||r?{type:U.InitializeDates,initialDate:Array.isArray($)?$[0]:$}:{type:U.SetViewDate,viewDate:Array.isArray($)?$[0]:$})},[Zt]),m.useEffect(()=>{if(e){const $=ce();et({type:U.InitializeDates,initialDate:$})}else et({type:U.ClearDates})},[e,V.current]),m.useEffect(()=>{Dt&&et({type:U.SetTimeFormat,timeFormat:Dt?ft.TwentyFourHour:ft.TwelveHour})},[Dt]),m.useEffect(()=>{p&&(Z.current=p)},[p]),m.useEffect(()=>{et({type:U.SetDateSelector,dateSelector:Ot()})},[B]);const Ot=m.useCallback(()=>I.current===Q.TimeOnly?yt.TimeSelector:I.current===Q.DateTime||I.current===Q.DateOnly?yt.DaySelector:yt.DateRangeSelector,[]),ce=()=>{const $=new Date;return $.setHours(0,0,0,0),e?typeof e=="string"?I.current!==Q.DateRange?Dn(e,V.current):ui(e,V.current):e:$},lt={currentSelector:Ot(),currentViewDate:new Date,timeFormat:ft.TwelveHour,dateInitialized:!1},[_,et]=m.useReducer(Bx,lt),ue=()=>{wl(),C(!0)},Rt=m.useMemo(()=>rn(()=>{C(!1)},250),[]),fi=m.useMemo(()=>rn(()=>{Rt.cancel()},5),[Rt]),gl=$=>{const it=$.target.innerText;yl(it)},rS=$=>{if($){const it=I.current!==Q.DateRange?Dn($,V.current):ui($,V.current);if(it)if(y){const Cl=Array.isArray(it)?it.every(lS=>y(lS)):y(it);return!Cl&&w&&w(it),Cl}else return!0;else return!1}else return!0},sS=$=>{yl($||"")},yl=$=>{const it=I.current!==Q.DateRange?Dn($,V.current):ui($,V.current);it?(Array.isArray(it)?(jx(it[0],Uo(_.currentViewDate),xm(te(_.currentViewDate,1)))||et({type:U.SetViewDate,viewDate:it[0]}),et({type:U.SetSelectedDateRange,selectedStartDate:it[0],selectedEndDate:it[1]})):et({type:U.SetSelectedDate,selectedDate:it,viewDate:it}),b?.(it)):$===""&&(et({type:U.ClearDates}),b?.())},iS=$=>{I.current===Q.DateOnly&&o===!0&&C(!1),b?.($)},bl=()=>{wl(),C(!A),M.current?M.current.focus():k.current&&k.current.focus()},vl=()=>{et({type:U.ClearDates}),C(!1),b?.()},di=($,it)=>{(!Z.current||W.current!==it)&&(Z.current=$,W.current=it,L.current=!0)},wl=()=>{(!x.current||L.current)&&Z.current&&(x.current=Z.current,F(Z.current),L.current=!1)},xl=()=>{C(!1),et({type:U.SetDateSelector,dateSelector:Ot()})},oS=()=>{switch(u){case En.Short:return"short";case En.Medium:return"medium";case En.Long:return"long";default:return}},cr=()=>{const $=oS();switch(I.current){case Q.DateTime:return _.selectedDate?$?_.selectedDate.toLocaleString(V.current?.code,{dateStyle:$,timeStyle:$}):_.selectedDate.toLocaleString(V.current?.code):"";case Q.DateOnly:return _.selectedDate?$?_.selectedDate.toLocaleDateString(V.current?.code,{dateStyle:$}):_.selectedDate.toLocaleDateString(V.current?.code):"";case Q.TimeOnly:return _.selectedDate?$?_.selectedDate.toLocaleTimeString(V.current?.code,{timeStyle:$,hour12:_.timeFormat===ft.TwelveHour,hourCycle:_.timeFormat===ft.TwentyFourHour?"h23":void 0}):_.selectedDate.toLocaleTimeString(V.current?.code,{hour12:_.timeFormat===ft.TwelveHour,hourCycle:_.timeFormat===ft.TwentyFourHour?"h23":void 0}):"";case Q.DateRange:return _.selectedStartDate&&_.selectedEndDate?$?`${_.selectedStartDate.toLocaleDateString(V.current?.code,{dateStyle:$})} - ${_.selectedEndDate.toLocaleDateString(V.current?.code,{dateStyle:$})}`:`${_.selectedStartDate.toLocaleDateString(V.current?.code)} - ${_.selectedEndDate.toLocaleDateString(V.current?.code)}`:"";default:return _.selectedDate?$?_.selectedDate.toLocaleString(V.current?.code,{dateStyle:$,timeStyle:$}):_.selectedDate.toLocaleString(V.current?.code):""}},ur=B===Q.DateTime||B===Q.DateOnly||B===Q.DateRange,aS=B===Q.DateTime||B===Q.TimeOnly,Mn=f===ir.None?{}:f===ir.Right?{rightElement:v.jsxs("div",{className:"bsc:flex bsc:text-black bsc:dark:text-mono-light-1",children:[i&&!t&&v.jsx("div",{children:v.jsx(Mt,{icon:"close",size:Tt.Small,className:"bsc:cursor-pointer bsc:text-sm",onClick:vl})}),v.jsx("div",{className:"bsc:ml-2",onClick:t?void 0:bl,children:d||v.jsx(Mt,{icon:"calendar",size:Tt.Small,className:t?void 0:"bsc:cursor-pointer"})})]}),rightElementClassName:"bsc:justify-center"}:{leftElement:v.jsxs("div",{className:"bsc:flex bsc:text-black bsc:dark:text-mono-light-1",children:[v.jsx("div",{className:"bsc:mr-2",onClick:t?void 0:bl,children:d||v.jsx(Mt,{icon:"calendar",size:Tt.Small,className:t?void 0:"bsc:cursor-pointer"})}),i&&!t&&v.jsx("div",{children:v.jsx(Mt,{icon:"close",size:Tt.Small,className:"bsc:cursor-pointer bsc:text-sm",onClick:vl})})]}),leftElementClassName:"bsc:justify-center"},cS={setDateSelector:$=>N($)},uS=D||(($,it)=>v.jsx(v.Fragment,{children:it})),Sl=()=>v.jsx(pe,{props:cS,template:uS,children:v.jsxs(v.Fragment,{children:[_.currentSelector===yt.DaySelector&&ur&&_.dateInitialized&&V.current&&v.jsx($x,{selectedDate:_.selectedDate,viewDate:_.currentViewDate,locale:V.current,showTimeSelector:I.current===Q.DateTime,selectableDate:g,isValidDate:y,dispatcher:et,onChange:iS}),_.currentSelector===yt.MonthSelector&&ur&&_.dateInitialized&&V.current&&v.jsx(Wx,{viewDate:_.currentViewDate,locale:V.current,dateSelection:I.current,dispatcher:et}),_.currentSelector===yt.YearSelector&&ur&&_.dateInitialized&&V.current&&v.jsx(Ux,{viewDate:_.currentViewDate,locale:V.current,dispatcher:et}),_.currentSelector===yt.TimeSelector&&aS&&_.dateInitialized&&V.current&&v.jsx(Rx,{viewDate:_.currentViewDate,showDateSelector:I.current===Q.DateTime,locale:V.current,timeFormat:_.timeFormat,timeConstraints:h,onChange:b,dispatcher:et}),_.currentSelector===yt.DateRangeSelector&&ur&&_.dateInitialized&&V.current&&v.jsx(Yx,{viewDate:_.currentViewDate,selectedStartDate:_.selectedStartDate,selectedEndDate:_.selectedEndDate,locale:V.current,onChange:b,dispatcher:et})]})}),Tl=li({label:n,readOnly:t,allowClear:i,getValue:cr,onFocus:ue,onInput:gl,iconPosition:f,iconElement:Mn.rightElement||Mn.leftElement},_.currentViewDate,et),Pl=P||(($,it)=>v.jsx(v.Fragment,{children:it})),pi=z("bsc:text-left",{"bc-read-only bsc:bg-gray-4 bsc:dark:bg-mono-dark-3":t,"bsc:bg-white bsc:dark:bg-mono-dark-1":!t},"bc-dt-input",c);return v.jsx(ci.Provider,{value:ut.current,children:v.jsxs("div",{className:"bc-date-time",children:[n&&v.jsx(Ut,{label:n,readOnly:t,className:"bc-dt-label"}),v.jsx(Ur,{mobileMarkup:v.jsxs(v.Fragment,{children:[v.jsx(pe,{props:Tl,template:Pl,children:v.jsx(jn,{ref:k,value:cr(),readOnly:t,inputMode:"none",className:pi,onFocus:ue,onElementCreate:$=>di($,!1),...Mn})}),v.jsx(sl,{visible:A,target:R,hidden:xl,unmountWhenHidden:!0,children:Sl()})]}),aboveMobileMarkup:v.jsxs(v.Fragment,{children:[v.jsx(pe,{props:Tl,template:Pl,children:s===!1?v.jsx(jn,{ref:k,value:cr(),readOnly:t,className:pi,onFocus:ue,onBlur:Rt,onInput:gl,onElementCreate:$=>di($,!1),...Mn}):v.jsx(hl,{ref:M,value:cr(),readOnly:t,className:pi,format:q,isInputValid:rS,onFocus:ue,onBlur:Rt,onChange:sS,onElementCreate:$=>di($,!0),...Mn})}),v.jsx(al,{visible:A,target:R,shouldTargetCloseOverlay:!1,shouldScrollCloseOverlay:!0,shouldCheckZIndex:!0,shouldRemainOnScreen:!0,hidden:xl,isClickedWithin:fi,unmountWhenHidden:!1,children:Sl()})]})})]})})};var hi,pl;function qx(){if(pl)return hi;pl=1;function e(f,p){var g,y;if(typeof p=="function")y=p(f),y!==void 0&&(f=y);else if(Array.isArray(p))for(g=0;g<p.length;g++)y=p[g](f),y!==void 0&&(f=y);return f}function t(f,p){return f[0]==="-"&&Array.isArray(p)&&/^-\d+$/.test(f)?p.length+parseInt(f,10):f}function n(f){return/^\d+$/.test(f)}function r(f){return Object.prototype.toString.call(f)==="[object Object]"}function s(f){return Object(f)===f}function i(f){return Object.keys(f).length===0}var o=["__proto__","prototype","constructor"],a=function(f){return o.indexOf(f)===-1};function c(f,p){f.indexOf("[")>=0&&(f=f.replace(/\[/g,p).replace(/]/g,""));var g=f.split(p),y=g.filter(a);if(y.length!==g.length)throw Error("Refusing to update blacklisted property "+f);return g}var l=Object.prototype.hasOwnProperty;function u(f,p,g,y){if(!(this instanceof u))return new u(f,p,g,y);typeof p>"u"&&(p=!1),typeof g>"u"&&(g=!0),typeof y>"u"&&(y=!0),this.separator=f||".",this.override=p,this.useArray=g,this.useBrackets=y,this.keepArray=!1,this.cleanup=[]}var h=new u(".",!1,!0,!0);function d(f){return function(){return h[f].apply(h,arguments)}}return u.prototype._fill=function(f,p,g,y){var b=f.shift();if(f.length>0){if(p[b]=p[b]||(this.useArray&&n(f[0])?[]:{}),!s(p[b]))if(this.override)p[b]={};else{if(!(s(g)&&i(g)))throw new Error("Trying to redefine `"+b+"` which is a "+typeof p[b]);return}this._fill(f,p[b],g,y)}else{if(!this.override&&s(p[b])&&!i(p[b])){if(!(s(g)&&i(g)))throw new Error("Trying to redefine non-empty obj['"+b+"']");return}p[b]=e(g,y)}},u.prototype.object=function(f,p){var g=this;return Object.keys(f).forEach(function(y){var b=p===void 0?null:p[y],w=c(y,g.separator).join(g.separator);w.indexOf(g.separator)!==-1?(g._fill(w.split(g.separator),f,f[y],b),delete f[y]):f[y]=e(f[y],b)}),f},u.prototype.str=function(f,p,g,y){var b=c(f,this.separator).join(this.separator);return f.indexOf(this.separator)!==-1?this._fill(b.split(this.separator),g,p,y):g[f]=e(p,y),g},u.prototype.pick=function(f,p,g,y){var b,w,S,T,P;for(w=c(f,this.separator),b=0;b<w.length;b++)if(T=t(w[b],p),p&&typeof p=="object"&&T in p){if(b===w.length-1)return g?(S=p[T],y&&Array.isArray(p)?p.splice(T,1):delete p[T],Array.isArray(p)&&(P=w.slice(0,-1).join("."),this.cleanup.indexOf(P)===-1&&this.cleanup.push(P)),S):p[T];p=p[T]}else return;return g&&Array.isArray(p)&&(p=p.filter(function(D){return D!==void 0})),p},u.prototype.delete=function(f,p){return this.remove(f,p,!0)},u.prototype.remove=function(f,p,g){var y;if(this.cleanup=[],Array.isArray(f)){for(y=0;y<f.length;y++)this.pick(f[y],p,!0,g);return g||this._cleanup(p),p}else return this.pick(f,p,!0,g)},u.prototype._cleanup=function(f){var p,g,y,b;if(this.cleanup.length){for(g=0;g<this.cleanup.length;g++)y=this.cleanup[g].split("."),b=y.splice(0,-1).join("."),p=b?this.pick(b,f):f,p=p[y[0]].filter(function(w){return w!==void 0}),this.set(this.cleanup[g],p,f);this.cleanup=[]}},u.prototype.del=u.prototype.remove,u.prototype.move=function(f,p,g,y,b){return typeof y=="function"||Array.isArray(y)?this.set(p,e(this.pick(f,g,!0),y),g,b):(b=y,this.set(p,this.pick(f,g,!0),g,b)),g},u.prototype.transfer=function(f,p,g,y,b,w){return typeof b=="function"||Array.isArray(b)?this.set(p,e(this.pick(f,g,!0),b),y,w):(w=b,this.set(p,this.pick(f,g,!0),y,w)),y},u.prototype.copy=function(f,p,g,y,b,w){return typeof b=="function"||Array.isArray(b)?this.set(p,e(JSON.parse(JSON.stringify(this.pick(f,g,!1))),b),y,w):(w=b,this.set(p,this.pick(f,g,!1),y,w)),y},u.prototype.set=function(f,p,g,y){var b,w,S,T;if(typeof p>"u")return g;for(S=c(f,this.separator),b=0;b<S.length;b++){if(T=S[b],b===S.length-1)if(y&&r(p)&&r(g[T]))for(w in p)l.call(p,w)&&(g[T][w]=p[w]);else if(y&&Array.isArray(g[T])&&Array.isArray(p))for(var P=0;P<p.length;P++)g[S[b]].push(p[P]);else g[T]=p;else(!l.call(g,T)||!r(g[T])&&!Array.isArray(g[T]))&&(/^\d+$/.test(S[b+1])?g[T]=[]:g[T]={});g=g[T]}return g},u.prototype.transform=function(f,p,g){return p=p||{},g=g||{},Object.keys(f).forEach((function(y){this.set(f[y],this.pick(y,p),g)}).bind(this)),g},u.prototype.dot=function(f,p,g){p=p||{},g=g||[];var y=Array.isArray(f);return Object.keys(f).forEach((function(b){var w=y&&this.useBrackets?"["+b+"]":b;if(s(f[b])&&(r(f[b])&&!i(f[b])||Array.isArray(f[b])&&!this.keepArray&&f[b].length!==0))if(y&&this.useBrackets){var S=g[g.length-1]||"";return this.dot(f[b],p,g.slice(0,-1).concat(S+w))}else return this.dot(f[b],p,g.concat(w));else y&&this.useBrackets?p[g.join(this.separator).concat("["+b+"]")]=f[b]:p[g.concat(w).join(this.separator)]=f[b]}).bind(this)),p},u.pick=d("pick"),u.move=d("move"),u.transfer=d("transfer"),u.transform=d("transform"),u.copy=d("copy"),u.object=d("object"),u.str=d("str"),u.set=d("set"),u.delete=d("delete"),u.del=u.remove=d("remove"),u.dot=d("dot"),["override","overwrite"].forEach(function(f){Object.defineProperty(u,f,{get:function(){return h.override},set:function(p){h.override=!!p}})}),["useArray","keepArray","useBrackets"].forEach(function(f){Object.defineProperty(u,f,{get:function(){return h[f]},set:function(p){h[f]=p}})}),u._process=e,hi=u,hi}var Xx=qx();const ml=yi(Xx),Zx=({name:e,label:t,value:n,data:r,textField:s,valueField:i,readOnly:o=!1,orientation:a=wt.Horizontal,isMultiSelect:c=!1,className:l,onChange:u,itemTemplate:h})=>{const[d,f]=m.useState(),[p,g]=m.useState([]),y=Pr(()=>r,[r]),b=m.useId();m.useEffect(()=>{if(c){const F=Array.isArray(n)?n.map(B=>B.toString()):n?[String(n)]:void 0;g(F??[])}else n&&f(n.toString())},[n]);const w=F=>c?p.findIndex(B=>B===F)>-1:d===F,S=F=>{const B=F.toString();if(c){const N=w(B);let I;N?I=p.filter(W=>W!=B):I=[...p,B],g(I),u?.({name:e,value:I})}else B!==d&&(f(B),u?.({name:e,value:B}))},T=F=>{Array.isArray(F?.value)?g(F?.value??[]):f(F?.value),u?.(F)},P=Ge(we.FocusWithin),D=m.useCallback((F,B)=>v.jsx(v.Fragment,{children:B}),[]),A=h||D,C=(F,B,N)=>{const I=`element_${b}_${B}`,W=ml.pick(s,F),L=String(ml.pick(i,F)),H=B===0,V=B===N.length-1,Z=z("bc-group-button-item bsc:cursor-pointer bsc:border-solid bsc:p-2 bsc:font-medium",{"bsc:has-data-checked:bg-primary-1 bsc:dark:has-data-checked:bg-mono-light-1 bsc:has-data-checked:text-white bsc:dark:has-data-checked:text-mono-dark-1 bsc:dark:text-mono-light-1 bsc:text-gray-2 bsc:border-gray-3 bsc:dark:border-mono-light-2":!o,"bc-read-only bsc:has-data-checked:bg-primary-4 bsc:dark:has-data-checked:bg-mono-light-3 bsc:has-data-checked:text-gray-5 bsc:dark:has-data-checked:text-mono-dark-3 bsc:dark:text-mono-light-3 bsc:text-gray-3 bsc:border-gray-4 bsc:dark:border-mono-light-3 bsc:pointer-events-none":o,"bsc:border-t bsc:border-l bsc:border-b bsc:rounded-l-md bsc:pl-2":H&&a===wt.Horizontal,"bsc:border-t bsc:border-r bsc:border-l bsc:border-b bsc:rounded-r-md bsc:pr-2":V&&a===wt.Horizontal,"bsc:border-t bsc:border-b":!H&&!V&&a===wt.Horizontal,"bsc:border-l":!H&&a===wt.Horizontal,"bsc:border-l bsc:border-r bsc:border-t bsc:rounded-t-md":H&&a===wt.Vertical,"bsc:border bsc:rounded-b-md":V&&a===wt.Vertical,"bsc:border-t bsc:border-l bsc:border-r":!H&&!V&&a===wt.Vertical},P),x={itemId:I,selectedValue:c?p:d,itemText:W,itemValue:L,itemData:F,itemStyles:Z,isSelected:w(L),isFirstItem:H,isLastItem:V,onItemChanged:S};return c?v.jsx(pe,{props:x,template:A,children:v.jsx(Ce,{className:Z,children:v.jsx(Wi,{value:L,className:"bsc:block bsc:w-full bsc:cursor-pointer",children:W})})},I):v.jsx(pe,{props:x,template:A,children:v.jsx(Ce,{className:Z,children:v.jsx(qi,{value:L,className:"bsc:block bsc:w-full bsc:cursor-pointer",children:W})})},I)},E=z("bsc:flex bsc:flex-col bsc:gap-2",l),j=z("bsc:flex",{"bsc:flex-col bsc:w-max":a===wt.Vertical}),R=F=>c?v.jsx(Ui,{name:e,value:p,readOnly:o,onChange:T,className:j,children:F.map(C)}):v.jsx(Gi,{name:e,value:d,readOnly:o,onChange:T,className:j,children:F.map(C)});return v.jsxs(Ce,{className:E,children:[t&&v.jsx(Ut,{label:t,readOnly:o}),y&&R(y)]})},Qx=m.memo(Zx),Jx=({name:e,label:t,value:n,data:r,textField:s,valueField:i,readOnly:o=!1,labelLocation:a=Et.Right,orientation:c=wt.Vertical,className:l,useAnimation:u,onChange:h})=>{const d=Pr(()=>r,[r]),f=m.useId(),p=xr(u),g=Ge(we.FocusWithin),y=z("bc-radio-container bsc:flex bsc:flex-col bsc:gap-1",l),b=z("bc-radio-wrapper bsc:flex bsc:gap-1",{"bsc:flex-col":c===wt.Vertical,"bsc:*:pr-2":c===wt.Horizontal}),w=z("bc-radio-item-wrapper bsc:flex bsc:items-center bsc:*:cursor-pointer",{"bc-read-only":o}),S=z("bc-radio-item bsc:group bsc:relative bsc:*:size-[21px] bsc:rounded-full",{"bsc:ml-2":a===Et.Left,"bsc:mr-2":a===Et.Right,"bc-read-only":o},g),T=z("bc-radio-item-svg bsc:stroke-2 bsc:fill-none bsc:rounded-full bsc:stroke-gray-1 bsc:dark:stroke-mono-light-2 bsc:group-data-read-only:stroke-gray-4 bsc:dark:group-data-read-only:stroke-mono-light-3"),P=z("bsc:group-data-checked:fill-primary-1 bsc:dark:group-data-checked:fill-mono-light-2 bsc:group-data-checked:group-data-read-only:fill-primary-4 bsc:dark:group-data-checked:group-data-read-only:fill-mono-light-3",{"bsc:group-data-checked:animate-bounce":!o&&p}),D=z("bsc:invisible bsc:group-data-checked:visible bsc:group-data-checked:fill-white bsc:dark:group-data-checked:fill-mono-dark-1",{"bsc:group-data-checked:animate-bounce":!o&&p}),A=(C,E)=>{const j=C[s],R=C[i];return v.jsxs(Ce,{className:w,children:[a===Et.Left&&v.jsx(Ut,{label:j,readOnly:o}),v.jsx(qi,{value:R,className:S,children:v.jsxs("svg",{viewBox:"0 0 30 30",preserveAspectRatio:"xMidYMid meet",className:T,children:[v.jsx("circle",{cx:15,cy:15,r:15,className:P}),v.jsx("circle",{cx:"50%",cy:"50%",r:7,className:D})]})}),a===Et.Right&&v.jsx(Ut,{label:j,readOnly:o})]},`radio_${f}_item${E}`)};return v.jsxs("div",{className:y,children:[t&&v.jsx(Ut,{label:t,readOnly:o}),v.jsx(Gi,{name:e,value:n,readOnly:o,onChange:h,className:b,children:d&&d.map(A)})]})},tS=m.memo(Jx),eS=({name:e,label:t,value:n,checked:r=!1,readOnly:s=!1,useAnimation:i,className:o,onChange:a})=>{const c=xr(i),l=z("bc-toggle-wrapper bsc:flex bsc:flex-col",o),u=Ge(we.FocusWithin),h=z("bc-toggle-container bsc:group bsc:flex bsc:mt-0.5 bsc:relative bsc:w-[60px] bsc:h-[26px] bsc:rounded-full bsc:[transition:background-color_1s]",{"bsc:cursor-pointer bsc:bg-gray-3 bsc:dark:bg-mono-dark-3 bsc:has-checked:bg-primary-1 bsc:dark:has-checked:bg-mono-light-2":!s,"bc-read-only bsc:pointer-events-none bsc:bg-gray-4 bsc:dark:bg-mono-dark-2 bsc:has-checked:bg-primary-4 bsc:dark:has-checked:bg-mono-light-3":s},u),d=z("bc-toggle-switch bsc:absolute bsc:rounded-full bsc:dark:border bsc:dark:border-solid bsc:dark:border-mono-dark-1 bsc:group-data-toggled:translate-x-[35px] bsc:w-[18px] bsc:h-[18px] bsc:top-[4px] bsc:left-[4px]",{"bsc:bg-white bsc:cursor-pointer":!s,"bc-read-only bsc:bg-gray-5 bsc:pointer-events-none":s,"bsc:[transition:0.3s]":!s&&c});return v.jsxs(Ce,{className:l,children:[t&&v.jsx(Ut,{label:t,readOnly:s}),v.jsx(gh,{name:e,value:n,toggled:r,onChange:a,className:h,children:v.jsx("div",{className:d})})]})},nS=m.memo(eS);Y.BeeSoftProvider=Ml,Y.Button=jt,Y.Checkbox=Xi,Y.CheckboxGroup=Dh,Y.ContentEditableInput=jn,Y.DateFormatType=En,Y.DateScrollerType=ze,Y.DateSelectionType=Q,Y.DateTime=Gx,Y.FormGroupItemOrientation=wt,Y.FormattedInput=hl,Y.GroupButton=Qx,Y.MediaQuery=Ur,Y.MobileOverlayPanel=sl,Y.OverlayPanel=al,Y.RadioButton=tS,Y.SelectionLabelLocation=Et,Y.Toggle=nS,Y.applyBeeSoftTheme=Fy,Y.createBeeSoftTheme=_y,Object.defineProperty(Y,Symbol.toStringTag,{value:"Module"})}));