beesoft-components 0.9.1 → 0.9.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.umd.js CHANGED
@@ -1,4 +1,4 @@
1
- (function(K,d){typeof exports=="object"&&typeof module<"u"?d(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],d):(K=typeof globalThis<"u"?globalThis:K||self,d(K.BeeSoftComponents={},K.React,K.ReactDOM))})(this,function(K,d,$e){"use strict";var ap=Object.defineProperty;var op=(K,d,$e)=>d in K?ap(K,d,{enumerable:!0,configurable:!0,writable:!0,value:$e}):K[d]=$e;var b=(K,d,$e)=>(op(K,typeof d!="symbol"?d+"":d,$e),$e);function Na(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:()=>e[t]})}}return r.default=e,Object.freeze(r)}const _t=Na(d);function Or(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Nr={exports:{}},It={};/**
1
+ (function(X,d){typeof exports=="object"&&typeof module<"u"?d(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],d):(X=typeof globalThis<"u"?globalThis:X||self,d(X.BeeSoftComponents={},X.React,X.ReactDOM))})(this,function(X,d,Fe){"use strict";var lp=Object.defineProperty;var fp=(X,d,Fe)=>d in X?lp(X,d,{enumerable:!0,configurable:!0,writable:!0,value:Fe}):X[d]=Fe;var m=(X,d,Fe)=>(fp(X,typeof d!="symbol"?d+"":d,Fe),Fe);function Aa(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:()=>e[t]})}}return r.default=e,Object.freeze(r)}const Rt=Aa(d);function Ar(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Lr={exports:{}},At={};/**
2
2
  * @license React
3
3
  * react-jsx-runtime.production.min.js
4
4
  *
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * This source code is licensed under the MIT license found in the
8
8
  * LICENSE file in the root directory of this source tree.
9
- */var wn;function _a(){if(wn)return It;wn=1;var e=d,r=Symbol.for("react.element"),t=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,s=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function o(i,c,l){var h,m={},x=null,v=null;l!==void 0&&(x=""+l),c.key!==void 0&&(x=""+c.key),c.ref!==void 0&&(v=c.ref);for(h in c)n.call(c,h)&&!a.hasOwnProperty(h)&&(m[h]=c[h]);if(i&&i.defaultProps)for(h in c=i.defaultProps,c)m[h]===void 0&&(m[h]=c[h]);return{$$typeof:r,type:i,key:x,ref:v,props:m,_owner:s.current}}return It.Fragment=t,It.jsx=o,It.jsxs=o,It}var jt={};/**
9
+ */var Dn;function La(){if(Dn)return At;Dn=1;var e=d,r=Symbol.for("react.element"),t=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,s=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function o(i,c,f){var h,p={},y=null,x=null;f!==void 0&&(y=""+f),c.key!==void 0&&(y=""+c.key),c.ref!==void 0&&(x=c.ref);for(h in c)n.call(c,h)&&!a.hasOwnProperty(h)&&(p[h]=c[h]);if(i&&i.defaultProps)for(h in c=i.defaultProps,c)p[h]===void 0&&(p[h]=c[h]);return{$$typeof:r,type:i,key:y,ref:x,props:p,_owner:s.current}}return At.Fragment=t,At.jsx=o,At.jsxs=o,At}var Lt={};/**
10
10
  * @license React
11
11
  * react-jsx-runtime.development.js
12
12
  *
@@ -14,37 +14,37 @@
14
14
  *
15
15
  * This source code is licensed under the MIT license found in the
16
16
  * LICENSE file in the root directory of this source tree.
17
- */var Tn;function Ia(){return Tn||(Tn=1,process.env.NODE_ENV!=="production"&&function(){var e=d,r=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),i=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),h=Symbol.for("react.suspense_list"),m=Symbol.for("react.memo"),x=Symbol.for("react.lazy"),v=Symbol.for("react.offscreen"),w=Symbol.iterator,D="@@iterator";function N(u){if(u===null||typeof u!="object")return null;var T=w&&u[w]||u[D];return typeof T=="function"?T:null}var S=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function A(u){{for(var T=arguments.length,R=new Array(T>1?T-1:0),Z=1;Z<T;Z++)R[Z-1]=arguments[Z];B("error",u,R)}}function B(u,T,R){{var Z=S.ReactDebugCurrentFrame,fe=Z.getStackAddendum();fe!==""&&(T+="%s",R=R.concat([fe]));var be=R.map(function(ie){return String(ie)});be.unshift("Warning: "+T),Function.prototype.apply.call(console[u],console,be)}}var F=!1,g=!1,$=!1,_=!1,W=!1,Y;Y=Symbol.for("react.module.reference");function re(u){return!!(typeof u=="string"||typeof u=="function"||u===n||u===a||W||u===s||u===l||u===h||_||u===v||F||g||$||typeof u=="object"&&u!==null&&(u.$$typeof===x||u.$$typeof===m||u.$$typeof===o||u.$$typeof===i||u.$$typeof===c||u.$$typeof===Y||u.getModuleId!==void 0))}function te(u,T,R){var Z=u.displayName;if(Z)return Z;var fe=T.displayName||T.name||"";return fe!==""?R+"("+fe+")":R}function U(u){return u.displayName||"Context"}function E(u){if(u==null)return null;if(typeof u.tag=="number"&&A("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof u=="function")return u.displayName||u.name||null;if(typeof u=="string")return u;switch(u){case n:return"Fragment";case t:return"Portal";case a:return"Profiler";case s:return"StrictMode";case l:return"Suspense";case h:return"SuspenseList"}if(typeof u=="object")switch(u.$$typeof){case i:var T=u;return U(T)+".Consumer";case o:var R=u;return U(R._context)+".Provider";case c:return te(u,u.render,"ForwardRef");case m:var Z=u.displayName||null;return Z!==null?Z:E(u.type)||"Memo";case x:{var fe=u,be=fe._payload,ie=fe._init;try{return E(ie(be))}catch{return null}}}return null}var P=Object.assign,I=0,k,G,O,se,y,C,V;function p(){}p.__reactDisabledLog=!0;function j(){{if(I===0){k=console.log,G=console.info,O=console.warn,se=console.error,y=console.group,C=console.groupCollapsed,V=console.groupEnd;var u={configurable:!0,enumerable:!0,value:p,writable:!0};Object.defineProperties(console,{info:u,log:u,warn:u,error:u,group:u,groupCollapsed:u,groupEnd:u})}I++}}function q(){{if(I--,I===0){var u={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:P({},u,{value:k}),info:P({},u,{value:G}),warn:P({},u,{value:O}),error:P({},u,{value:se}),group:P({},u,{value:y}),groupCollapsed:P({},u,{value:C}),groupEnd:P({},u,{value:V})})}I<0&&A("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var L=S.ReactCurrentDispatcher,H;function z(u,T,R){{if(H===void 0)try{throw Error()}catch(fe){var Z=fe.stack.trim().match(/\n( *(at )?)/);H=Z&&Z[1]||""}return`
18
- `+H+u}}var X=!1,Q;{var ke=typeof WeakMap=="function"?WeakMap:Map;Q=new ke}function M(u,T){if(!u||X)return"";{var R=Q.get(u);if(R!==void 0)return R}var Z;X=!0;var fe=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var be;be=L.current,L.current=null,j();try{if(T){var ie=function(){throw Error()};if(Object.defineProperty(ie.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ie,[])}catch(tt){Z=tt}Reflect.construct(u,[],ie)}else{try{ie.call()}catch(tt){Z=tt}u.call(ie.prototype)}}else{try{throw Error()}catch(tt){Z=tt}u()}}catch(tt){if(tt&&Z&&typeof tt.stack=="string"){for(var ae=tt.stack.split(`
19
- `),je=Z.stack.split(`
20
- `),Ce=ae.length-1,De=je.length-1;Ce>=1&&De>=0&&ae[Ce]!==je[De];)De--;for(;Ce>=1&&De>=0;Ce--,De--)if(ae[Ce]!==je[De]){if(Ce!==1||De!==1)do if(Ce--,De--,De<0||ae[Ce]!==je[De]){var Le=`
21
- `+ae[Ce].replace(" at new "," at ");return u.displayName&&Le.includes("<anonymous>")&&(Le=Le.replace("<anonymous>",u.displayName)),typeof u=="function"&&Q.set(u,Le),Le}while(Ce>=1&&De>=0);break}}}finally{X=!1,L.current=be,q(),Error.prepareStackTrace=fe}var Nt=u?u.displayName||u.name:"",Oa=Nt?z(Nt):"";return typeof u=="function"&&Q.set(u,Oa),Oa}function Ie(u,T,R){return M(u,!1)}function Ke(u){var T=u.prototype;return!!(T&&T.isReactComponent)}function He(u,T,R){if(u==null)return"";if(typeof u=="function")return M(u,Ke(u));if(typeof u=="string")return z(u);switch(u){case l:return z("Suspense");case h:return z("SuspenseList")}if(typeof u=="object")switch(u.$$typeof){case c:return Ie(u.render);case m:return He(u.type,T,R);case x:{var Z=u,fe=Z._payload,be=Z._init;try{return He(be(fe),T,R)}catch{}}}return""}var dt=Object.prototype.hasOwnProperty,Zt={},vr=S.ReactDebugCurrentFrame;function Xe(u){if(u){var T=u._owner,R=He(u.type,u._source,T?T.type:null);vr.setExtraStackFrame(R)}else vr.setExtraStackFrame(null)}function kt(u,T,R,Z,fe){{var be=Function.call.bind(dt);for(var ie in u)if(be(u,ie)){var ae=void 0;try{if(typeof u[ie]!="function"){var je=Error((Z||"React class")+": "+R+" type `"+ie+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof u[ie]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw je.name="Invariant Violation",je}ae=u[ie](T,ie,Z,R,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(Ce){ae=Ce}ae&&!(ae instanceof Error)&&(Xe(fe),A("%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).",Z||"React class",R,ie,typeof ae),Xe(null)),ae instanceof Error&&!(ae.message in Zt)&&(Zt[ae.message]=!0,Xe(fe),A("Failed %s type: %s",R,ae.message),Xe(null))}}}var gn=Array.isArray;function Je(u){return gn(u)}function xr(u){{var T=typeof Symbol=="function"&&Symbol.toStringTag,R=T&&u[Symbol.toStringTag]||u.constructor.name||"Object";return R}}function wr(u){try{return yn(u),!1}catch{return!0}}function yn(u){return""+u}function Qt(u){if(wr(u))return A("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",xr(u)),yn(u)}var et=S.ReactCurrentOwner,J={key:!0,ref:!0,__self:!0,__source:!0},pe,Ae,Ct;Ct={};function Tr(u){if(dt.call(u,"ref")){var T=Object.getOwnPropertyDescriptor(u,"ref").get;if(T&&T.isReactWarning)return!1}return u.ref!==void 0}function Sr(u){if(dt.call(u,"key")){var T=Object.getOwnPropertyDescriptor(u,"key").get;if(T&&T.isReactWarning)return!1}return u.key!==void 0}function Pr(u,T){if(typeof u.ref=="string"&&et.current&&T&&et.current.stateNode!==T){var R=E(et.current.type);Ct[R]||(A('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',E(et.current.type),u.ref),Ct[R]=!0)}}function Er(u,T){{var R=function(){pe||(pe=!0,A("%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)",T))};R.isReactWarning=!0,Object.defineProperty(u,"key",{get:R,configurable:!0})}}function kr(u,T){{var R=function(){Ae||(Ae=!0,A("%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)",T))};R.isReactWarning=!0,Object.defineProperty(u,"ref",{get:R,configurable:!0})}}var Cr=function(u,T,R,Z,fe,be,ie){var ae={$$typeof:r,type:u,key:T,ref:R,props:ie,_owner:be};return ae._store={},Object.defineProperty(ae._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(ae,"_self",{configurable:!1,enumerable:!1,writable:!1,value:Z}),Object.defineProperty(ae,"_source",{configurable:!1,enumerable:!1,writable:!1,value:fe}),Object.freeze&&(Object.freeze(ae.props),Object.freeze(ae)),ae};function Dr(u,T,R,Z,fe){{var be,ie={},ae=null,je=null;R!==void 0&&(Qt(R),ae=""+R),Sr(T)&&(Qt(T.key),ae=""+T.key),Tr(T)&&(je=T.ref,Pr(T,fe));for(be in T)dt.call(T,be)&&!J.hasOwnProperty(be)&&(ie[be]=T[be]);if(u&&u.defaultProps){var Ce=u.defaultProps;for(be in Ce)ie[be]===void 0&&(ie[be]=Ce[be])}if(ae||je){var De=typeof u=="function"?u.displayName||u.name||"Unknown":u;ae&&Er(ie,De),je&&kr(ie,De)}return Cr(u,ae,je,fe,Z,et.current,ie)}}var Dt=S.ReactCurrentOwner,Kt=S.ReactDebugCurrentFrame;function Ot(u){if(u){var T=u._owner,R=He(u.type,u._source,T?T.type:null);Kt.setExtraStackFrame(R)}else Kt.setExtraStackFrame(null)}var vn;vn=!1;function xn(u){return typeof u=="object"&&u!==null&&u.$$typeof===r}function Pa(){{if(Dt.current){var u=E(Dt.current.type);if(u)return`
17
+ */var On;function $a(){return On||(On=1,process.env.NODE_ENV!=="production"&&function(){var e=d,r=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),i=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),h=Symbol.for("react.suspense_list"),p=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),x=Symbol.for("react.offscreen"),w=Symbol.iterator,D="@@iterator";function O(u){if(u===null||typeof u!="object")return null;var T=w&&u[w]||u[D];return typeof T=="function"?T:null}var S=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function R(u){{for(var T=arguments.length,M=new Array(T>1?T-1:0),K=1;K<T;K++)M[K-1]=arguments[K];U("error",u,M)}}function U(u,T,M){{var K=S.ReactDebugCurrentFrame,de=K.getStackAddendum();de!==""&&(T+="%s",M=M.concat([de]));var be=M.map(function(oe){return String(oe)});be.unshift("Warning: "+T),Function.prototype.apply.call(console[u],console,be)}}var F=!1,b=!1,A=!1,k=!1,V=!1,B;B=Symbol.for("react.module.reference");function ne(u){return!!(typeof u=="string"||typeof u=="function"||u===n||u===a||V||u===s||u===f||u===h||k||u===x||F||b||A||typeof u=="object"&&u!==null&&(u.$$typeof===y||u.$$typeof===p||u.$$typeof===o||u.$$typeof===i||u.$$typeof===c||u.$$typeof===B||u.getModuleId!==void 0))}function te(u,T,M){var K=u.displayName;if(K)return K;var de=T.displayName||T.name||"";return de!==""?M+"("+de+")":M}function J(u){return u.displayName||"Context"}function N(u){if(u==null)return null;if(typeof u.tag=="number"&&R("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof u=="function")return u.displayName||u.name||null;if(typeof u=="string")return u;switch(u){case n:return"Fragment";case t:return"Portal";case a:return"Profiler";case s:return"StrictMode";case f:return"Suspense";case h:return"SuspenseList"}if(typeof u=="object")switch(u.$$typeof){case i:var T=u;return J(T)+".Consumer";case o:var M=u;return J(M._context)+".Provider";case c:return te(u,u.render,"ForwardRef");case p:var K=u.displayName||null;return K!==null?K:N(u.type)||"Memo";case y:{var de=u,be=de._payload,oe=de._init;try{return N(oe(be))}catch{return null}}}return null}var $=Object.assign,I=0,C,G,v,ee,g,_,z;function E(){}E.__reactDisabledLog=!0;function Y(){{if(I===0){C=console.log,G=console.info,v=console.warn,ee=console.error,g=console.group,_=console.groupCollapsed,z=console.groupEnd;var u={configurable:!0,enumerable:!0,value:E,writable:!0};Object.defineProperties(console,{info:u,log:u,warn:u,error:u,group:u,groupCollapsed:u,groupEnd:u})}I++}}function q(){{if(I--,I===0){var u={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:$({},u,{value:C}),info:$({},u,{value:G}),warn:$({},u,{value:v}),error:$({},u,{value:ee}),group:$({},u,{value:g}),groupCollapsed:$({},u,{value:_}),groupEnd:$({},u,{value:z})})}I<0&&R("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var L=S.ReactCurrentDispatcher,H;function P(u,T,M){{if(H===void 0)try{throw Error()}catch(de){var K=de.stack.trim().match(/\n( *(at )?)/);H=K&&K[1]||""}return`
18
+ `+H+u}}var W=!1,Z;{var Te=typeof WeakMap=="function"?WeakMap:Map;Z=new Te}function j(u,T){if(!u||W)return"";{var M=Z.get(u);if(M!==void 0)return M}var K;W=!0;var de=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var be;be=L.current,L.current=null,Y();try{if(T){var oe=function(){throw Error()};if(Object.defineProperty(oe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(oe,[])}catch(et){K=et}Reflect.construct(u,[],oe)}else{try{oe.call()}catch(et){K=et}u.call(oe.prototype)}}else{try{throw Error()}catch(et){K=et}u()}}catch(et){if(et&&K&&typeof et.stack=="string"){for(var se=et.stack.split(`
19
+ `),Me=K.stack.split(`
20
+ `),Ce=se.length-1,De=Me.length-1;Ce>=1&&De>=0&&se[Ce]!==Me[De];)De--;for(;Ce>=1&&De>=0;Ce--,De--)if(se[Ce]!==Me[De]){if(Ce!==1||De!==1)do if(Ce--,De--,De<0||se[Ce]!==Me[De]){var $e=`
21
+ `+se[Ce].replace(" at new "," at ");return u.displayName&&$e.includes("<anonymous>")&&($e=$e.replace("<anonymous>",u.displayName)),typeof u=="function"&&Z.set(u,$e),$e}while(Ce>=1&&De>=0);break}}}finally{W=!1,L.current=be,q(),Error.prepareStackTrace=de}var Mt=u?u.displayName||u.name:"",Ra=Mt?P(Mt):"";return typeof u=="function"&&Z.set(u,Ra),Ra}function je(u,T,M){return j(u,!1)}function nt(u){var T=u.prototype;return!!(T&&T.isReactComponent)}function Xe(u,T,M){if(u==null)return"";if(typeof u=="function")return j(u,nt(u));if(typeof u=="string")return P(u);switch(u){case f:return P("Suspense");case h:return P("SuspenseList")}if(typeof u=="object")switch(u.$$typeof){case c:return je(u.render);case p:return Xe(u.type,T,M);case y:{var K=u,de=K._payload,be=K._init;try{return Xe(be(de),T,M)}catch{}}}return""}var ht=Object.prototype.hasOwnProperty,Dr={},Jt=S.ReactDebugCurrentFrame;function pt(u){if(u){var T=u._owner,M=Xe(u.type,u._source,T?T.type:null);Jt.setExtraStackFrame(M)}else Jt.setExtraStackFrame(null)}function er(u,T,M,K,de){{var be=Function.call.bind(ht);for(var oe in u)if(be(u,oe)){var se=void 0;try{if(typeof u[oe]!="function"){var Me=Error((K||"React class")+": "+M+" type `"+oe+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof u[oe]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw Me.name="Invariant Violation",Me}se=u[oe](T,oe,K,M,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(Ce){se=Ce}se&&!(se instanceof Error)&&(pt(de),R("%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).",K||"React class",M,oe,typeof se),pt(null)),se instanceof Error&&!(se.message in Dr)&&(Dr[se.message]=!0,pt(de),R("Failed %s type: %s",M,se.message),pt(null))}}}var Or=Array.isArray;function Dt(u){return Or(u)}function En(u){{var T=typeof Symbol=="function"&&Symbol.toStringTag,M=T&&u[Symbol.toStringTag]||u.constructor.name||"Object";return M}}function Ot(u){try{return mt(u),!1}catch{return!0}}function mt(u){return""+u}function _r(u){if(Ot(u))return R("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",En(u)),mt(u)}var We=S.ReactCurrentOwner,kn={key:!0,ref:!0,__self:!0,__source:!0},Cn,Nr,_t;_t={};function Ir(u){if(ht.call(u,"ref")){var T=Object.getOwnPropertyDescriptor(u,"ref").get;if(T&&T.isReactWarning)return!1}return u.ref!==void 0}function Ia(u){if(ht.call(u,"key")){var T=Object.getOwnPropertyDescriptor(u,"key").get;if(T&&T.isReactWarning)return!1}return u.key!==void 0}function jr(u,T){if(typeof u.ref=="string"&&We.current&&T&&We.current.stateNode!==T){var M=N(We.current.type);_t[M]||(R('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',N(We.current.type),u.ref),_t[M]=!0)}}function tr(u,T){{var M=function(){Cn||(Cn=!0,R("%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)",T))};M.isReactWarning=!0,Object.defineProperty(u,"key",{get:M,configurable:!0})}}function Q(u,T){{var M=function(){Nr||(Nr=!0,R("%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)",T))};M.isReactWarning=!0,Object.defineProperty(u,"ref",{get:M,configurable:!0})}}var ce=function(u,T,M,K,de,be,oe){var se={$$typeof:r,type:u,key:T,ref:M,props:oe,_owner:be};return se._store={},Object.defineProperty(se._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(se,"_self",{configurable:!1,enumerable:!1,writable:!1,value:K}),Object.defineProperty(se,"_source",{configurable:!1,enumerable:!1,writable:!1,value:de}),Object.freeze&&(Object.freeze(se.props),Object.freeze(se)),se};function Ae(u,T,M,K,de){{var be,oe={},se=null,Me=null;M!==void 0&&(_r(M),se=""+M),Ia(T)&&(_r(T.key),se=""+T.key),Ir(T)&&(Me=T.ref,jr(T,de));for(be in T)ht.call(T,be)&&!kn.hasOwnProperty(be)&&(oe[be]=T[be]);if(u&&u.defaultProps){var Ce=u.defaultProps;for(be in Ce)oe[be]===void 0&&(oe[be]=Ce[be])}if(se||Me){var De=typeof u=="function"?u.displayName||u.name||"Unknown":u;se&&tr(oe,De),Me&&Q(oe,De)}return ce(u,se,Me,de,K,We.current,oe)}}var Nt=S.ReactCurrentOwner,rr=S.ReactDebugCurrentFrame;function Je(u){if(u){var T=u._owner,M=Xe(u.type,u._source,T?T.type:null);rr.setExtraStackFrame(M)}else rr.setExtraStackFrame(null)}var It;It=!1;function jt(u){return typeof u=="object"&&u!==null&&u.$$typeof===r}function nr(){{if(Nt.current){var u=N(Nt.current.type);if(u)return`
22
22
 
23
- Check the render method of \``+u+"`."}return""}}function Kh(u){{if(u!==void 0){var T=u.fileName.replace(/^.*[\\\/]/,""),R=u.lineNumber;return`
23
+ Check the render method of \``+u+"`."}return""}}function Mr(u){{if(u!==void 0){var T=u.fileName.replace(/^.*[\\\/]/,""),M=u.lineNumber;return`
24
24
 
25
- Check your code at `+T+":"+R+"."}return""}}var Ea={};function Xh(u){{var T=Pa();if(!T){var R=typeof u=="string"?u:u.displayName||u.name;R&&(T=`
25
+ Check your code at `+T+":"+M+"."}return""}}var sr={};function Rr(u){{var T=nr();if(!T){var M=typeof u=="string"?u:u.displayName||u.name;M&&(T=`
26
26
 
27
- Check the top-level render call using <`+R+">.")}return T}}function ka(u,T){{if(!u._store||u._store.validated||u.key!=null)return;u._store.validated=!0;var R=Xh(T);if(Ea[R])return;Ea[R]=!0;var Z="";u&&u._owner&&u._owner!==Dt.current&&(Z=" It was passed a child from "+E(u._owner.type)+"."),Ot(u),A('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',R,Z),Ot(null)}}function Ca(u,T){{if(typeof u!="object")return;if(Je(u))for(var R=0;R<u.length;R++){var Z=u[R];xn(Z)&&ka(Z,T)}else if(xn(u))u._store&&(u._store.validated=!0);else if(u){var fe=N(u);if(typeof fe=="function"&&fe!==u.entries)for(var be=fe.call(u),ie;!(ie=be.next()).done;)xn(ie.value)&&ka(ie.value,T)}}}function Jh(u){{var T=u.type;if(T==null||typeof T=="string")return;var R;if(typeof T=="function")R=T.propTypes;else if(typeof T=="object"&&(T.$$typeof===c||T.$$typeof===m))R=T.propTypes;else return;if(R){var Z=E(T);kt(R,u.props,"prop",Z,u)}else if(T.PropTypes!==void 0&&!vn){vn=!0;var fe=E(T);A("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",fe||"Unknown")}typeof T.getDefaultProps=="function"&&!T.getDefaultProps.isReactClassApproved&&A("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function ep(u){{for(var T=Object.keys(u.props),R=0;R<T.length;R++){var Z=T[R];if(Z!=="children"&&Z!=="key"){Ot(u),A("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",Z),Ot(null);break}}u.ref!==null&&(Ot(u),A("Invalid attribute `ref` supplied to `React.Fragment`."),Ot(null))}}function Da(u,T,R,Z,fe,be){{var ie=re(u);if(!ie){var ae="";(u===void 0||typeof u=="object"&&u!==null&&Object.keys(u).length===0)&&(ae+=" 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 je=Kh(fe);je?ae+=je:ae+=Pa();var Ce;u===null?Ce="null":Je(u)?Ce="array":u!==void 0&&u.$$typeof===r?(Ce="<"+(E(u.type)||"Unknown")+" />",ae=" Did you accidentally export a JSX literal instead of a component?"):Ce=typeof u,A("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",Ce,ae)}var De=Dr(u,T,R,fe,be);if(De==null)return De;if(ie){var Le=T.children;if(Le!==void 0)if(Z)if(Je(Le)){for(var Nt=0;Nt<Le.length;Nt++)Ca(Le[Nt],u);Object.freeze&&Object.freeze(Le)}else A("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 Ca(Le,u)}return u===n?ep(De):Jh(De),De}}function tp(u,T,R){return Da(u,T,R,!0)}function rp(u,T,R){return Da(u,T,R,!1)}var np=rp,sp=tp;jt.Fragment=n,jt.jsx=np,jt.jsxs=sp}()),jt}process.env.NODE_ENV==="production"?Nr.exports=_a():Nr.exports=Ia();var f=Nr.exports;const Sn=d.createContext(void 0),Pn=()=>d.useContext(Sn),ja=({overlayKeepOnScreen:e=!0,useAnimations:r=!0,mobileMediaQuery:t,tabletMediaQuery:n,desktopMediaQuery:s,isValidScrollableElement:a,children:o})=>{const i={overlayKeepOnScreen:e,useAnimations:r,mobileMediaQuery:t,tabletMediaQuery:n,desktopMediaQuery:s,isValidScrollableElement:a};return f.jsx(Sn.Provider,{value:i,children:o})};var Ne=(e=>(e[e.Vertical=0]="Vertical",e[e.Horizontal=1]="Horizontal",e))(Ne||{}),Me=(e=>(e[e.Right=0]="Right",e[e.Left=1]="Left",e))(Me||{}),En={exports:{}};/*!
27
+ Check the top-level render call using <`+M+">.")}return T}}function ar(u,T){{if(!u._store||u._store.validated||u.key!=null)return;u._store.validated=!0;var M=Rr(T);if(sr[M])return;sr[M]=!0;var K="";u&&u._owner&&u._owner!==Nt.current&&(K=" It was passed a child from "+N(u._owner.type)+"."),Je(u),R('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',M,K),Je(null)}}function ja(u,T){{if(typeof u!="object")return;if(Dt(u))for(var M=0;M<u.length;M++){var K=u[M];jt(K)&&ar(K,T)}else if(jt(u))u._store&&(u._store.validated=!0);else if(u){var de=O(u);if(typeof de=="function"&&de!==u.entries)for(var be=de.call(u),oe;!(oe=be.next()).done;)jt(oe.value)&&ar(oe.value,T)}}}function sp(u){{var T=u.type;if(T==null||typeof T=="string")return;var M;if(typeof T=="function")M=T.propTypes;else if(typeof T=="object"&&(T.$$typeof===c||T.$$typeof===p))M=T.propTypes;else return;if(M){var K=N(T);er(M,u.props,"prop",K,u)}else if(T.PropTypes!==void 0&&!It){It=!0;var de=N(T);R("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",de||"Unknown")}typeof T.getDefaultProps=="function"&&!T.getDefaultProps.isReactClassApproved&&R("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function ap(u){{for(var T=Object.keys(u.props),M=0;M<T.length;M++){var K=T[M];if(K!=="children"&&K!=="key"){Je(u),R("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",K),Je(null);break}}u.ref!==null&&(Je(u),R("Invalid attribute `ref` supplied to `React.Fragment`."),Je(null))}}function Ma(u,T,M,K,de,be){{var oe=ne(u);if(!oe){var se="";(u===void 0||typeof u=="object"&&u!==null&&Object.keys(u).length===0)&&(se+=" 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 Me=Mr(de);Me?se+=Me:se+=nr();var Ce;u===null?Ce="null":Dt(u)?Ce="array":u!==void 0&&u.$$typeof===r?(Ce="<"+(N(u.type)||"Unknown")+" />",se=" Did you accidentally export a JSX literal instead of a component?"):Ce=typeof u,R("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",Ce,se)}var De=Ae(u,T,M,de,be);if(De==null)return De;if(oe){var $e=T.children;if($e!==void 0)if(K)if(Dt($e)){for(var Mt=0;Mt<$e.length;Mt++)ja($e[Mt],u);Object.freeze&&Object.freeze($e)}else R("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 ja($e,u)}return u===n?ap(De):sp(De),De}}function op(u,T,M){return Ma(u,T,M,!0)}function ip(u,T,M){return Ma(u,T,M,!1)}var cp=ip,up=op;Lt.Fragment=n,Lt.jsx=cp,Lt.jsxs=up}()),Lt}process.env.NODE_ENV==="production"?Lr.exports=La():Lr.exports=$a();var l=Lr.exports;const _n=d.createContext(void 0),Nn=()=>d.useContext(_n),Fa=({overlayKeepOnScreen:e=!0,useAnimations:r=!0,mobileMediaQuery:t,tabletMediaQuery:n,desktopMediaQuery:s,isValidScrollableElement:a,children:o})=>{const i={overlayKeepOnScreen:e,useAnimations:r,mobileMediaQuery:t,tabletMediaQuery:n,desktopMediaQuery:s,isValidScrollableElement:a};return l.jsx(_n.Provider,{value:i,children:o})};var Ne=(e=>(e[e.Vertical=0]="Vertical",e[e.Horizontal=1]="Horizontal",e))(Ne||{}),Re=(e=>(e[e.Right=0]="Right",e[e.Left=1]="Left",e))(Re||{}),In={exports:{}};/*!
28
28
  Copyright (c) 2018 Jed Watson.
29
29
  Licensed under the MIT License (MIT), see
30
30
  http://jedwatson.github.io/classnames
31
- */(function(e){(function(){var r={}.hasOwnProperty;function t(){for(var a="",o=0;o<arguments.length;o++){var i=arguments[o];i&&(a=s(a,n(i)))}return a}function n(a){if(typeof a=="string"||typeof a=="number")return a;if(typeof a!="object")return"";if(Array.isArray(a))return t.apply(null,a);if(a.toString!==Object.prototype.toString&&!a.toString.toString().includes("[native code]"))return a.toString();var o="";for(var i in a)r.call(a,i)&&a[i]&&(o=s(o,i));return o}function s(a,o){return o?a?a+" "+o:a+o:a}e.exports?(t.default=t,e.exports=t):window.classNames=t})()})(En);var Ma=En.exports;const ce=Or(Ma);var Mt=(e=>(e[e.Focus=0]="Focus",e[e.FocusWithin=1]="FocusWithin",e))(Mt||{});const Xt=(e=1)=>d.useMemo(()=>ce("dark:bsc-ring-mono-light-2 dark:bsc-ring-offset-mono-dark-1",{"focus-within:bsc-ring focus-within:bsc-ring-offset-2 focus-within:bsc-ring-opacity-50":e===1,"focus:bsc-ring focus:bsc-ring-offset-2 focus:bsc-ring-opacity-50":e===0}),[e]),Ra=(e,r)=>{const t=d.useRef(null),{buttonType:n,buttonStyle:s="flat",type:a="button",disabled:o=!1,form:i,fullWidth:c=!1,onClick:l,className:h,children:m}=e,x=()=>{l==null||l()},v=()=>{var N;(N=t.current)==null||N.click()};d.useImperativeHandle(r,()=>({click:v}));const w=Xt(Mt.Focus),D=ce("bc-button max-sm:bsc-p-4 md:bsc-p-2 dark:bsc-bg-mono-light-1 dark:hover:bsc-bg-mono-light-2 dark:bsc-text-mono-dark-1",w,{"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 hover:bsc-bg-primary-2 focus:bsc-ring-primary-1":n==="primary","bsc-bg-primary-2 bsc-text-white hover:bsc-bg-primary-3 focus:bsc-ring-primary-2":n==="secondary","bsc-bg-info bsc-text-white focus:bsc-ring-info":n==="info","bsc-bg-success bsc-text-white focus:bsc-ring-success":n==="success","bsc-bg-warning bsc-text-white focus:bsc-ring-warning":n==="warning","bsc-bg-error bsc-text-white focus:bsc-ring-error":n==="error","bsc-rounded-md":s==="curved","bsc-rounded-full !bsc-px-4":s==="round"},h);return f.jsx("button",{ref:t,type:a,onClick:x,disabled:o,form:i,className:D,children:m})},We=d.forwardRef(Ra),Jt=e=>e==null?!1:typeof e=="object",Aa=e=>Array.isArray(e)&&e.every(r=>Jt(r)),La=e=>e instanceof Date,$a=e=>Array.isArray(e)&&e.every(r=>r instanceof Date),kn=e=>typeof e=="function",Fa=e=>Array.isArray(e)&&e.every(r=>kn(r)),Cn=e=>{const r=typeof e;return r==="string"||r==="number"||r==="boolean"||r==="bigint"},Ya=e=>Array.isArray(e)&&e.every(r=>Cn(r)),_r=e=>{if(!Jt(e))return e;const r={},t=Object.keys(e);for(let n=t.length;n--!==0;){const s=t[n],a=e[s];Cn(a)||kn(a)?r[s]=a:La(a)?r[s]=new Date(a.getTime()):Array.isArray(a)?r[s]=Dn(a):Jt(a)&&(r[s]=_r(a))}return r},Ha=e=>{let r=e.length;const t=new Array(r);for(;r--!==0;)t[r]=e[r];return t},Wa=e=>{let r=e.length;const t=new Array(r);for(;r--!==0;)t[r]=new Date(e[r].getTime());return t},Va=e=>{let r=e.length;const t=new Array(r);for(;r--!==0;)t[r]=_r(e[r]);return t},Dn=e=>{if(Ya(e)||Fa(e))return Ha(e);if($a(e))return Wa(e);if(Aa(e))return Va(e);let r=e.length;const t=new Array(r);for(;r--!==0;)t[r]=e[r];return t},Ba=e=>Jt(e)?Array.isArray(e)?Dn(e):_r(e):e;function za(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ua=function e(r,t){if(r===t)return!0;if(r&&t&&typeof r=="object"&&typeof t=="object"){if(r.constructor!==t.constructor)return!1;var n,s,a;if(Array.isArray(r)){if(n=r.length,n!=t.length)return!1;for(s=n;s--!==0;)if(!e(r[s],t[s]))return!1;return!0}if(r.constructor===RegExp)return r.source===t.source&&r.flags===t.flags;if(r.valueOf!==Object.prototype.valueOf)return r.valueOf()===t.valueOf();if(r.toString!==Object.prototype.toString)return r.toString()===t.toString();if(a=Object.keys(r),n=a.length,n!==Object.keys(t).length)return!1;for(s=n;s--!==0;)if(!Object.prototype.hasOwnProperty.call(t,a[s]))return!1;for(s=n;s--!==0;){var o=a[s];if(!e(r[o],t[o]))return!1}return!0}return r!==r&&t!==t};const On=za(Ua),qa=(e,r)=>{for(let t=e.length;t--!==0;)if(e[t]!==r[t]&&!On(e[t],r[t]))return!0;return!1},Ir=(e,r)=>{const t=d.useRef([]),n=t.current.length>0&&t.current[0]&&qa(t.current[0],r);return(t.current.length===0||n)&&(t.current=[Ba(r),e()]),t.current[1]},Nn=e=>{const r=d.useRef();let t=!1;r.current!==void 0&&(t=!On(r.current,e));const n={changed:t,previousValue:r.current};return r.current=e,n},Ga=e=>typeof e=="function",Za=e=>{const[r,t]=d.useState({value:e,initial:!0}),n=d.useRef(e);return[r,s=>{if(!Ga(s))t({value:s,initial:!1});else{const a=s(n.current);n.current=a,t({value:a,initial:!1})}}]},Qa=e=>{const[r,t]=Za(e),n=d.useRef({value:e,initial:!0});return n.current!==r&&(n.current=r),[r,t,n]},jr=e=>{const[r,t]=d.useState(!0),n=Pn();return d.useEffect(()=>{e!==void 0?t(e):n&&n.useAnimations!==void 0&&t(n.useAnimations)},[n,e]),r},qe=({label:e,htmlFor:r,readOnly:t=!1,className:n})=>{const s=ce("bc-label",{"bsc-text-black dark:bsc-text-mono-light-1":!t,"bc-read-only bsc-text-gray-4 dark:bsc-text-mono-light-3 bsc-pointer-events-none":t},n);return f.jsx("label",{htmlFor:r,className:s,children:e})},Ka=(e,r)=>{const{name:t,label:n,value:s,readOnly:a=!1,checked:o=!1,partial:i=!1,labelLocation:c=Me.Right,className:l,useAnimation:h,onChange:m}=e,[x,v,w]=Qa({checked:!1,partial:!1}),D=Nn(o),N=Nn(i),S=d.useId(),A=jr(h);d.useEffect(()=>{if(x.initial)v({checked:i?!0:o,partial:i});else{const U=D.changed?o:x.value.checked,E=N.changed?i:x.value.partial;v({checked:E?!0:U,partial:E})}},[o,i]);const B=U=>{var P;const E=((P=w.current)==null?void 0:P.value.partial)===!0?!0:U.target.checked;v({checked:E,partial:!1}),m==null||m({originalEvent:U,name:t||U.target.name,value:s,checked:E})},F=U=>{var P;const E={checked:U?!0:((P=w.current)==null?void 0:P.value.checked)||!1,partial:U};v(E)},g=U=>{v({checked:U,partial:!1})};d.useImperativeHandle(r,()=>({setPartiallyChecked:F,setChecked:g}));const $=ce("bc-checkbox-wrapper bsc-flex bsc-items-center",{"bc-read-only bsc-pointer-events-none bsc-text-gray-2 dark:bsc-text-mono-light-3":a},l),_=ce("bc-checkbox-label bsc-cursor-pointer",{"bsc-ml-2":c===Me.Right,"bsc-mr-2":c===Me.Left}),W=Xt(Mt.FocusWithin),Y=ce("bc-checkbox-outer bsc-relative bsc-rounded *:bsc-block *:bsc-size-[21px]",{"bsc-checkbox-animate":!a&&A,"bc-read-only bsc-checkbox-no-animate":a||!a&&!A},W),re=ce("bc-checkbox-inner bsc-relative bsc-m-0 bsc-cursor-pointer bsc-appearance-none bsc-rounded bsc-border-none bsc-bg-mono-light-1 bsc-p-0 bsc-outline-none dark:bsc-bg-mono-dark-1 dark:checked:bsc-bg-mono-light-1",{"[transition:box-shadow_0.3s]":A,"bsc-checkbox":!a,"bc-read-only bsc-checkbox-read-only":a}),te=ce("bc-checkbox-svg bsc-pointer-events-none bsc-absolute bsc-left-0 bsc-top-0 bsc-stroke-mono-light-1 bsc-stroke-2 [stroke-linecap:round] [stroke-linejoin:round] [transform:scale(0)_translateZ(0)] dark:bsc-stroke-mono-dark-3",{"bsc-fill-primary-1 dark:bsc-fill-mono-light-1":!a,"bc-read-only bsc-fill-primary-4 dark:bsc-fill-mono-light-3":a});return f.jsxs("div",{className:$,children:[n&&c===Me.Left&&f.jsx(qe,{label:n,htmlFor:S,readOnly:a,className:_}),f.jsxs("label",{className:Y,children:[f.jsx("input",{id:S,name:t,type:"checkbox",checked:x.value.checked,onChange:B,className:re}),f.jsx("svg",{viewBox:"0 0 21 21",className:te,children:x.value.partial?f.jsx("polyline",{points:"6 10.5 16 10.5"}):f.jsx("polyline",{points:"5 10.75 8.5 14.25 16 6"})})]}),n&&c===Me.Right&&f.jsx(qe,{label:n,htmlFor:S,readOnly:a,className:_})]})},_n=d.memo(d.forwardRef(Ka)),Xa=({name:e,label:r,value:t,data:n,textField:s,valueField:a,readOnly:o=!1,orientation:i=Ne.Vertical,className:c,onChange:l})=>{const[h,m]=d.useState([]),x=Ir(()=>n,[n]);d.useEffect(()=>{m(t??[])},[t]);const v=A=>{const{value:B,checked:F}=A;let g;F?g=[...h,B]:g=h.filter($=>$!==B),m(g),l==null||l({name:e,value:g})},w=(A,B)=>f.jsx(_n,{name:e,label:A[s],value:A[a],checked:h.some(F=>F===A[a]),readOnly:o,onChange:F=>F&&v(F),className:"bsc-mr-3"},`${e}_checkbox_${B}`),D=ce("bsc-flex bsc-flex-col bsc-gap-1",c),N=ce("bsc-flex bsc-gap-1",{"bsc-flex-col":i===Ne.Vertical}),S=A=>f.jsx("div",{className:N,children:A.map(w)});return f.jsxs("div",{className:D,children:[r&&f.jsx(qe,{label:r,readOnly:o}),x&&S(x)]})},Ja=d.memo(Xa);var eo=typeof global=="object"&&global&&global.Object===Object&&global;const In=eo;var to=typeof self=="object"&&self&&self.Object===Object&&self,ro=In||to||Function("return this")();const Fe=ro;var no=Fe.Symbol;const ht=no;var jn=Object.prototype,so=jn.hasOwnProperty,ao=jn.toString,Rt=ht?ht.toStringTag:void 0;function oo(e){var r=so.call(e,Rt),t=e[Rt];try{e[Rt]=void 0;var n=!0}catch{}var s=ao.call(e);return n&&(r?e[Rt]=t:delete e[Rt]),s}var io=Object.prototype,co=io.toString;function uo(e){return co.call(e)}var lo="[object Null]",fo="[object Undefined]",Mn=ht?ht.toStringTag:void 0;function pt(e){return e==null?e===void 0?fo:lo:Mn&&Mn in Object(e)?oo(e):uo(e)}function mt(e){return e!=null&&typeof e=="object"}var ho="[object Symbol]";function po(e){return typeof e=="symbol"||mt(e)&&pt(e)==ho}var mo=Array.isArray;const Mr=mo;var bo=/\s/;function go(e){for(var r=e.length;r--&&bo.test(e.charAt(r)););return r}var yo=/^\s+/;function vo(e){return e&&e.slice(0,go(e)+1).replace(yo,"")}function Ge(e){var r=typeof e;return e!=null&&(r=="object"||r=="function")}var Rn=0/0,xo=/^[-+]0x[0-9a-f]+$/i,wo=/^0b[01]+$/i,To=/^0o[0-7]+$/i,So=parseInt;function An(e){if(typeof e=="number")return e;if(po(e))return Rn;if(Ge(e)){var r=typeof e.valueOf=="function"?e.valueOf():e;e=Ge(r)?r+"":r}if(typeof e!="string")return e===0?e:+e;e=vo(e);var t=wo.test(e);return t||To.test(e)?So(e.slice(2),t?2:8):xo.test(e)?Rn:+e}var Po="[object AsyncFunction]",Eo="[object Function]",ko="[object GeneratorFunction]",Co="[object Proxy]";function Ln(e){if(!Ge(e))return!1;var r=pt(e);return r==Eo||r==ko||r==Po||r==Co}var Do=Fe["__core-js_shared__"];const Rr=Do;var $n=function(){var e=/[^.]+$/.exec(Rr&&Rr.keys&&Rr.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function Oo(e){return!!$n&&$n in e}var No=Function.prototype,_o=No.toString;function st(e){if(e!=null){try{return _o.call(e)}catch{}try{return e+""}catch{}}return""}var Io=/[\\^$.*+?()[\]{}|]/g,jo=/^\[object .+?Constructor\]$/,Mo=Function.prototype,Ro=Object.prototype,Ao=Mo.toString,Lo=Ro.hasOwnProperty,$o=RegExp("^"+Ao.call(Lo).replace(Io,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Fo(e){if(!Ge(e)||Oo(e))return!1;var r=Ln(e)?$o:jo;return r.test(st(e))}function Yo(e,r){return e==null?void 0:e[r]}function at(e,r){var t=Yo(e,r);return Fo(t)?t:void 0}var Ho=at(Fe,"WeakMap");const Ar=Ho;var Fn=Object.create,Wo=function(){function e(){}return function(r){if(!Ge(r))return{};if(Fn)return Fn(r);e.prototype=r;var t=new e;return e.prototype=void 0,t}}();const Vo=Wo;function Bo(e,r){var t=-1,n=e.length;for(r||(r=Array(n));++t<n;)r[t]=e[t];return r}var zo=function(){try{var e=at(Object,"defineProperty");return e({},"",{}),e}catch{}}();const Yn=zo;function Uo(e,r){for(var t=-1,n=e==null?0:e.length;++t<n&&r(e[t],t,e)!==!1;);return e}var qo=9007199254740991,Go=/^(?:0|[1-9]\d*)$/;function Zo(e,r){var t=typeof e;return r=r??qo,!!r&&(t=="number"||t!="symbol"&&Go.test(e))&&e>-1&&e%1==0&&e<r}function Hn(e,r,t){r=="__proto__"&&Yn?Yn(e,r,{configurable:!0,enumerable:!0,value:t,writable:!0}):e[r]=t}function Wn(e,r){return e===r||e!==e&&r!==r}var Qo=Object.prototype,Ko=Qo.hasOwnProperty;function Vn(e,r,t){var n=e[r];(!(Ko.call(e,r)&&Wn(n,t))||t===void 0&&!(r in e))&&Hn(e,r,t)}function er(e,r,t,n){var s=!t;t||(t={});for(var a=-1,o=r.length;++a<o;){var i=r[a],c=n?n(t[i],e[i],i,t,e):void 0;c===void 0&&(c=e[i]),s?Hn(t,i,c):Vn(t,i,c)}return t}var Xo=9007199254740991;function Bn(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Xo}function zn(e){return e!=null&&Bn(e.length)&&!Ln(e)}var Jo=Object.prototype;function Lr(e){var r=e&&e.constructor,t=typeof r=="function"&&r.prototype||Jo;return e===t}function ei(e,r){for(var t=-1,n=Array(e);++t<e;)n[t]=r(t);return n}var ti="[object Arguments]";function Un(e){return mt(e)&&pt(e)==ti}var qn=Object.prototype,ri=qn.hasOwnProperty,ni=qn.propertyIsEnumerable,si=Un(function(){return arguments}())?Un:function(e){return mt(e)&&ri.call(e,"callee")&&!ni.call(e,"callee")};const ai=si;function oi(){return!1}var Gn=typeof K=="object"&&K&&!K.nodeType&&K,Zn=Gn&&typeof module=="object"&&module&&!module.nodeType&&module,ii=Zn&&Zn.exports===Gn,Qn=ii?Fe.Buffer:void 0,ci=Qn?Qn.isBuffer:void 0,ui=ci||oi;const Kn=ui;var li="[object Arguments]",fi="[object Array]",di="[object Boolean]",hi="[object Date]",pi="[object Error]",mi="[object Function]",bi="[object Map]",gi="[object Number]",yi="[object Object]",vi="[object RegExp]",xi="[object Set]",wi="[object String]",Ti="[object WeakMap]",Si="[object ArrayBuffer]",Pi="[object DataView]",Ei="[object Float32Array]",ki="[object Float64Array]",Ci="[object Int8Array]",Di="[object Int16Array]",Oi="[object Int32Array]",Ni="[object Uint8Array]",_i="[object Uint8ClampedArray]",Ii="[object Uint16Array]",ji="[object Uint32Array]",ve={};ve[Ei]=ve[ki]=ve[Ci]=ve[Di]=ve[Oi]=ve[Ni]=ve[_i]=ve[Ii]=ve[ji]=!0,ve[li]=ve[fi]=ve[Si]=ve[di]=ve[Pi]=ve[hi]=ve[pi]=ve[mi]=ve[bi]=ve[gi]=ve[yi]=ve[vi]=ve[xi]=ve[wi]=ve[Ti]=!1;function Mi(e){return mt(e)&&Bn(e.length)&&!!ve[pt(e)]}function $r(e){return function(r){return e(r)}}var Xn=typeof K=="object"&&K&&!K.nodeType&&K,At=Xn&&typeof module=="object"&&module&&!module.nodeType&&module,Ri=At&&At.exports===Xn,Fr=Ri&&In.process,Ai=function(){try{var e=At&&At.require&&At.require("util").types;return e||Fr&&Fr.binding&&Fr.binding("util")}catch{}}();const bt=Ai;var Jn=bt&&bt.isTypedArray,Li=Jn?$r(Jn):Mi;const $i=Li;var Fi=Object.prototype,Yi=Fi.hasOwnProperty;function es(e,r){var t=Mr(e),n=!t&&ai(e),s=!t&&!n&&Kn(e),a=!t&&!n&&!s&&$i(e),o=t||n||s||a,i=o?ei(e.length,String):[],c=i.length;for(var l in e)(r||Yi.call(e,l))&&!(o&&(l=="length"||s&&(l=="offset"||l=="parent")||a&&(l=="buffer"||l=="byteLength"||l=="byteOffset")||Zo(l,c)))&&i.push(l);return i}function ts(e,r){return function(t){return e(r(t))}}var Hi=ts(Object.keys,Object);const Wi=Hi;var Vi=Object.prototype,Bi=Vi.hasOwnProperty;function zi(e){if(!Lr(e))return Wi(e);var r=[];for(var t in Object(e))Bi.call(e,t)&&t!="constructor"&&r.push(t);return r}function Yr(e){return zn(e)?es(e):zi(e)}function Ui(e){var r=[];if(e!=null)for(var t in Object(e))r.push(t);return r}var qi=Object.prototype,Gi=qi.hasOwnProperty;function Zi(e){if(!Ge(e))return Ui(e);var r=Lr(e),t=[];for(var n in e)n=="constructor"&&(r||!Gi.call(e,n))||t.push(n);return t}function Hr(e){return zn(e)?es(e,!0):Zi(e)}var Qi=at(Object,"create");const Lt=Qi;function Ki(){this.__data__=Lt?Lt(null):{},this.size=0}function Xi(e){var r=this.has(e)&&delete this.__data__[e];return this.size-=r?1:0,r}var Ji="__lodash_hash_undefined__",ec=Object.prototype,tc=ec.hasOwnProperty;function rc(e){var r=this.__data__;if(Lt){var t=r[e];return t===Ji?void 0:t}return tc.call(r,e)?r[e]:void 0}var nc=Object.prototype,sc=nc.hasOwnProperty;function ac(e){var r=this.__data__;return Lt?r[e]!==void 0:sc.call(r,e)}var oc="__lodash_hash_undefined__";function ic(e,r){var t=this.__data__;return this.size+=this.has(e)?0:1,t[e]=Lt&&r===void 0?oc:r,this}function ot(e){var r=-1,t=e==null?0:e.length;for(this.clear();++r<t;){var n=e[r];this.set(n[0],n[1])}}ot.prototype.clear=Ki,ot.prototype.delete=Xi,ot.prototype.get=rc,ot.prototype.has=ac,ot.prototype.set=ic;function cc(){this.__data__=[],this.size=0}function tr(e,r){for(var t=e.length;t--;)if(Wn(e[t][0],r))return t;return-1}var uc=Array.prototype,lc=uc.splice;function fc(e){var r=this.__data__,t=tr(r,e);if(t<0)return!1;var n=r.length-1;return t==n?r.pop():lc.call(r,t,1),--this.size,!0}function dc(e){var r=this.__data__,t=tr(r,e);return t<0?void 0:r[t][1]}function hc(e){return tr(this.__data__,e)>-1}function pc(e,r){var t=this.__data__,n=tr(t,e);return n<0?(++this.size,t.push([e,r])):t[n][1]=r,this}function Ze(e){var r=-1,t=e==null?0:e.length;for(this.clear();++r<t;){var n=e[r];this.set(n[0],n[1])}}Ze.prototype.clear=cc,Ze.prototype.delete=fc,Ze.prototype.get=dc,Ze.prototype.has=hc,Ze.prototype.set=pc;var mc=at(Fe,"Map");const $t=mc;function bc(){this.size=0,this.__data__={hash:new ot,map:new($t||Ze),string:new ot}}function gc(e){var r=typeof e;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?e!=="__proto__":e===null}function rr(e,r){var t=e.__data__;return gc(r)?t[typeof r=="string"?"string":"hash"]:t.map}function yc(e){var r=rr(this,e).delete(e);return this.size-=r?1:0,r}function vc(e){return rr(this,e).get(e)}function xc(e){return rr(this,e).has(e)}function wc(e,r){var t=rr(this,e),n=t.size;return t.set(e,r),this.size+=t.size==n?0:1,this}function gt(e){var r=-1,t=e==null?0:e.length;for(this.clear();++r<t;){var n=e[r];this.set(n[0],n[1])}}gt.prototype.clear=bc,gt.prototype.delete=yc,gt.prototype.get=vc,gt.prototype.has=xc,gt.prototype.set=wc;function rs(e,r){for(var t=-1,n=r.length,s=e.length;++t<n;)e[s+t]=r[t];return e}var Tc=ts(Object.getPrototypeOf,Object);const ns=Tc;function Sc(){this.__data__=new Ze,this.size=0}function Pc(e){var r=this.__data__,t=r.delete(e);return this.size=r.size,t}function Ec(e){return this.__data__.get(e)}function kc(e){return this.__data__.has(e)}var Cc=200;function Dc(e,r){var t=this.__data__;if(t instanceof Ze){var n=t.__data__;if(!$t||n.length<Cc-1)return n.push([e,r]),this.size=++t.size,this;t=this.__data__=new gt(n)}return t.set(e,r),this.size=t.size,this}function yt(e){var r=this.__data__=new Ze(e);this.size=r.size}yt.prototype.clear=Sc,yt.prototype.delete=Pc,yt.prototype.get=Ec,yt.prototype.has=kc,yt.prototype.set=Dc;function Oc(e,r){return e&&er(r,Yr(r),e)}function Nc(e,r){return e&&er(r,Hr(r),e)}var ss=typeof K=="object"&&K&&!K.nodeType&&K,as=ss&&typeof module=="object"&&module&&!module.nodeType&&module,_c=as&&as.exports===ss,os=_c?Fe.Buffer:void 0,is=os?os.allocUnsafe:void 0;function Ic(e,r){if(r)return e.slice();var t=e.length,n=is?is(t):new e.constructor(t);return e.copy(n),n}function jc(e,r){for(var t=-1,n=e==null?0:e.length,s=0,a=[];++t<n;){var o=e[t];r(o,t,e)&&(a[s++]=o)}return a}function cs(){return[]}var Mc=Object.prototype,Rc=Mc.propertyIsEnumerable,us=Object.getOwnPropertySymbols,Ac=us?function(e){return e==null?[]:(e=Object(e),jc(us(e),function(r){return Rc.call(e,r)}))}:cs;const Wr=Ac;function Lc(e,r){return er(e,Wr(e),r)}var $c=Object.getOwnPropertySymbols,Fc=$c?function(e){for(var r=[];e;)rs(r,Wr(e)),e=ns(e);return r}:cs;const ls=Fc;function Yc(e,r){return er(e,ls(e),r)}function fs(e,r,t){var n=r(e);return Mr(e)?n:rs(n,t(e))}function Hc(e){return fs(e,Yr,Wr)}function Wc(e){return fs(e,Hr,ls)}var Vc=at(Fe,"DataView");const Vr=Vc;var Bc=at(Fe,"Promise");const Br=Bc;var zc=at(Fe,"Set");const zr=zc;var ds="[object Map]",Uc="[object Object]",hs="[object Promise]",ps="[object Set]",ms="[object WeakMap]",bs="[object DataView]",qc=st(Vr),Gc=st($t),Zc=st(Br),Qc=st(zr),Kc=st(Ar),it=pt;(Vr&&it(new Vr(new ArrayBuffer(1)))!=bs||$t&&it(new $t)!=ds||Br&&it(Br.resolve())!=hs||zr&&it(new zr)!=ps||Ar&&it(new Ar)!=ms)&&(it=function(e){var r=pt(e),t=r==Uc?e.constructor:void 0,n=t?st(t):"";if(n)switch(n){case qc:return bs;case Gc:return ds;case Zc:return hs;case Qc:return ps;case Kc:return ms}return r});const Ur=it;var Xc=Object.prototype,Jc=Xc.hasOwnProperty;function eu(e){var r=e.length,t=new e.constructor(r);return r&&typeof e[0]=="string"&&Jc.call(e,"index")&&(t.index=e.index,t.input=e.input),t}var tu=Fe.Uint8Array;const gs=tu;function qr(e){var r=new e.constructor(e.byteLength);return new gs(r).set(new gs(e)),r}function ru(e,r){var t=r?qr(e.buffer):e.buffer;return new e.constructor(t,e.byteOffset,e.byteLength)}var nu=/\w*$/;function su(e){var r=new e.constructor(e.source,nu.exec(e));return r.lastIndex=e.lastIndex,r}var ys=ht?ht.prototype:void 0,vs=ys?ys.valueOf:void 0;function au(e){return vs?Object(vs.call(e)):{}}function ou(e,r){var t=r?qr(e.buffer):e.buffer;return new e.constructor(t,e.byteOffset,e.length)}var iu="[object Boolean]",cu="[object Date]",uu="[object Map]",lu="[object Number]",fu="[object RegExp]",du="[object Set]",hu="[object String]",pu="[object Symbol]",mu="[object ArrayBuffer]",bu="[object DataView]",gu="[object Float32Array]",yu="[object Float64Array]",vu="[object Int8Array]",xu="[object Int16Array]",wu="[object Int32Array]",Tu="[object Uint8Array]",Su="[object Uint8ClampedArray]",Pu="[object Uint16Array]",Eu="[object Uint32Array]";function ku(e,r,t){var n=e.constructor;switch(r){case mu:return qr(e);case iu:case cu:return new n(+e);case bu:return ru(e,t);case gu:case yu:case vu:case xu:case wu:case Tu:case Su:case Pu:case Eu:return ou(e,t);case uu:return new n;case lu:case hu:return new n(e);case fu:return su(e);case du:return new n;case pu:return au(e)}}function Cu(e){return typeof e.constructor=="function"&&!Lr(e)?Vo(ns(e)):{}}var Du="[object Map]";function Ou(e){return mt(e)&&Ur(e)==Du}var xs=bt&&bt.isMap,Nu=xs?$r(xs):Ou;const _u=Nu;var Iu="[object Set]";function ju(e){return mt(e)&&Ur(e)==Iu}var ws=bt&&bt.isSet,Mu=ws?$r(ws):ju;const Ru=Mu;var Au=1,Lu=2,$u=4,Ts="[object Arguments]",Fu="[object Array]",Yu="[object Boolean]",Hu="[object Date]",Wu="[object Error]",Ss="[object Function]",Vu="[object GeneratorFunction]",Bu="[object Map]",zu="[object Number]",Ps="[object Object]",Uu="[object RegExp]",qu="[object Set]",Gu="[object String]",Zu="[object Symbol]",Qu="[object WeakMap]",Ku="[object ArrayBuffer]",Xu="[object DataView]",Ju="[object Float32Array]",el="[object Float64Array]",tl="[object Int8Array]",rl="[object Int16Array]",nl="[object Int32Array]",sl="[object Uint8Array]",al="[object Uint8ClampedArray]",ol="[object Uint16Array]",il="[object Uint32Array]",ge={};ge[Ts]=ge[Fu]=ge[Ku]=ge[Xu]=ge[Yu]=ge[Hu]=ge[Ju]=ge[el]=ge[tl]=ge[rl]=ge[nl]=ge[Bu]=ge[zu]=ge[Ps]=ge[Uu]=ge[qu]=ge[Gu]=ge[Zu]=ge[sl]=ge[al]=ge[ol]=ge[il]=!0,ge[Wu]=ge[Ss]=ge[Qu]=!1;function nr(e,r,t,n,s,a){var o,i=r&Au,c=r&Lu,l=r&$u;if(t&&(o=s?t(e,n,s,a):t(e)),o!==void 0)return o;if(!Ge(e))return e;var h=Mr(e);if(h){if(o=eu(e),!i)return Bo(e,o)}else{var m=Ur(e),x=m==Ss||m==Vu;if(Kn(e))return Ic(e,i);if(m==Ps||m==Ts||x&&!s){if(o=c||x?{}:Cu(e),!i)return c?Yc(e,Nc(o,e)):Lc(e,Oc(o,e))}else{if(!ge[m])return s?e:{};o=ku(e,m,i)}}a||(a=new yt);var v=a.get(e);if(v)return v;a.set(e,o),Ru(e)?e.forEach(function(N){o.add(nr(N,r,t,N,e,a))}):_u(e)&&e.forEach(function(N,S){o.set(S,nr(N,r,t,S,e,a))});var w=l?c?Wc:Hc:c?Hr:Yr,D=h?void 0:w(e);return Uo(D||e,function(N,S){D&&(S=N,N=e[S]),Vn(o,S,nr(N,r,t,S,e,a))}),o}var cl=1,ul=4;function ll(e){return nr(e,cl|ul)}var fl=function(){return Fe.Date.now()};const Gr=fl;var dl="Expected a function",hl=Math.max,pl=Math.min;function Ft(e,r,t){var n,s,a,o,i,c,l=0,h=!1,m=!1,x=!0;if(typeof e!="function")throw new TypeError(dl);r=An(r)||0,Ge(t)&&(h=!!t.leading,m="maxWait"in t,a=m?hl(An(t.maxWait)||0,r):a,x="trailing"in t?!!t.trailing:x);function v($){var _=n,W=s;return n=s=void 0,l=$,o=e.apply(W,_),o}function w($){return l=$,i=setTimeout(S,r),h?v($):o}function D($){var _=$-c,W=$-l,Y=r-_;return m?pl(Y,a-W):Y}function N($){var _=$-c,W=$-l;return c===void 0||_>=r||_<0||m&&W>=a}function S(){var $=Gr();if(N($))return A($);i=setTimeout(S,D($))}function A($){return i=void 0,x&&n?v($):(n=s=void 0,o)}function B(){i!==void 0&&clearTimeout(i),l=0,n=c=s=i=void 0}function F(){return i===void 0?o:A(Gr())}function g(){var $=Gr(),_=N($);if(n=arguments,s=this,c=$,_){if(i===void 0)return w(c);if(m)return clearTimeout(i),i=setTimeout(S,r),v(c)}return i===void 0&&(i=setTimeout(S,r)),o}return g.cancel=B,g.flush=F,g}var ml="Expected a function";function bl(e,r,t){var n=!0,s=!0;if(typeof e!="function")throw new TypeError(ml);return Ge(t)&&(n="leading"in t?!!t.leading:n,s="trailing"in t?!!t.trailing:s),Ft(e,r,{leading:n,maxWait:r,trailing:s})}const gl=(e,r)=>{const{value:t,readOnly:n=!1,debounceTime:s=800,fillContainer:a=!0,leftElement:o,rightElement:i,className:c,leftElementClassName:l,rightElementClassName:h,isSingleLine:m=!0,allowSingleLineScroll:x=!1,inputMode:v,placeholder:w,onFocus:D,onBlur:N,onInput:S,onInnerTextChange:A,onInnerHTMLChange:B,onElementCreate:F,onLeftElementClick:g,onRightElementClick:$}=e,_=d.useRef("bsc-flex-grow focus:bsc-outline-none"),W=d.useRef("bsc-text-gray-4"),Y=d.useRef(),re=d.useCallback(p=>{const j=p.target,q=j.innerHTML;j.className=`${_.current}`,w&&q===w&&(j.innerHTML=""),D==null||D(p)},[w,D]),te=d.useCallback(p=>{const j=p.target.innerHTML;if(w&&j===""){const q=p.target;q.innerHTML=w,q.className=`${_.current} ${W.current}`}N==null||N(p)},[w,N]),U=d.useCallback(p=>{var j,q;(j=Y.current)==null||j.removeEventListener("focus",re),(q=Y.current)==null||q.removeEventListener("blur",te),w&&p&&p!==document.activeElement&&p.innerHTML===""&&(p.innerHTML=w,p.className=`${_.current} ${W.current}`),p.addEventListener("focus",re),p.addEventListener("blur",te),Y.current=p},[w]),E=d.useCallback(p=>{F==null||F(p)},[F]),P=p=>{g==null||g(p)},I=p=>{$==null||$(p)},k=Ft(p=>{S==null||S(p),A==null||A(p.target.innerText),B==null||B(p.target.innerHTML)},s),G=d.useCallback(p=>{Y.current&&(Y.current.innerText=p)},[]),O=d.useCallback(p=>{Y.current&&(Y.current.innerHTML=p)},[]),se=d.useCallback(()=>{var p;(p=Y.current)==null||p.focus()},[]);d.useImperativeHandle(r,()=>({inputElement:Y.current,setInnerText:G,setInnerHTML:O,focus:se}));const y=ce({"bsc-w-full ":a},"bsc-flex bsc-flex-row bsc-items-center bsc-shadow-sm bsc-border bsc-border-solid bsc-border-gray-3 dark:bsc-border-white dark:bsc-bg-mono-dark-1 dark:bsc-text-mono-light-1 bsc-rounded-md bsc-p-2",{"bsc-overflow-x-auto bsc-overflow-y-hidden bsc-whitespace-pre":m&&x,"bsc-overflow-hidden bsc-whitespace-pre":m&&!x},c),C=ce("bsc-flex-shrink",{"bsc-mr-2":o},l),V=ce("bsc-flex-shrink",{"bsc-ml-2":i},h);return f.jsxs("div",{className:y,ref:p=>p&&E(p),children:[o&&f.jsx("div",{className:C,onClick:P,children:o}),f.jsx("div",{ref:p=>p&&U(p),className:_.current,contentEditable:!n,suppressContentEditableWarning:!0,inputMode:v,onInput:k,children:t}),i&&f.jsx("div",{className:V,onClick:I,children:i})]})},sr=d.forwardRef(gl);function ue(e){const r=Object.prototype.toString.call(e);return e instanceof Date||typeof e=="object"&&r==="[object Date]"?new e.constructor(+e):typeof e=="number"||r==="[object Number]"||typeof e=="string"||r==="[object String]"?new Date(e):new Date(NaN)}function ye(e,r){return e instanceof Date?new e.constructor(r):new Date(r)}function vt(e,r){const t=ue(e);return isNaN(r)?ye(e,NaN):(r&&t.setDate(t.getDate()+r),t)}function ct(e,r){const t=ue(e);if(isNaN(r))return ye(e,NaN);if(!r)return t;const n=t.getDate(),s=ye(e,t.getTime());s.setMonth(t.getMonth()+r+1,0);const a=s.getDate();return n>=a?s:(t.setFullYear(s.getFullYear(),s.getMonth(),n),t)}const Es=6048e5,Zr=6e4,Qr=36e5,yl=1e3;let vl={};function Yt(){return vl}function rt(e,r){var i,c,l,h;const t=Yt(),n=(r==null?void 0:r.weekStartsOn)??((c=(i=r==null?void 0:r.locale)==null?void 0:i.options)==null?void 0:c.weekStartsOn)??t.weekStartsOn??((h=(l=t.locale)==null?void 0:l.options)==null?void 0:h.weekStartsOn)??0,s=ue(e),a=s.getDay(),o=(a<n?7:0)+a-n;return s.setDate(s.getDate()-o),s.setHours(0,0,0,0),s}function xt(e){return rt(e,{weekStartsOn:1})}function xl(e){const r=ue(e),t=r.getFullYear(),n=ye(e,0);n.setFullYear(t+1,0,4),n.setHours(0,0,0,0);const s=xt(n),a=ye(e,0);a.setFullYear(t,0,4),a.setHours(0,0,0,0);const o=xt(a);return r.getTime()>=s.getTime()?t+1:r.getTime()>=o.getTime()?t:t-1}function ks(e){const r=ue(e);return r.setHours(0,0,0,0),r}function Cs(e){const r=ue(e),t=new Date(Date.UTC(r.getFullYear(),r.getMonth(),r.getDate(),r.getHours(),r.getMinutes(),r.getSeconds(),r.getMilliseconds()));return t.setUTCFullYear(r.getFullYear()),+e-+t}function wl(e){const r=xl(e),t=ye(e,0);return t.setFullYear(r,0,4),t.setHours(0,0,0,0),xt(t)}function ar(e,r){return ct(e,r*12)}function Ds(e,r){const t=ks(e),n=ks(r);return+t==+n}function Tl(e){const r=ue(e),t=r.getMonth();return r.setFullYear(r.getFullYear(),t+1,0),r.setHours(23,59,59,999),r}function Sl(e,r){const t=ue(e.start),n=ue(e.end);let s=+t>+n;const a=s?+t:+n,o=s?n:t;o.setHours(0,0,0,0);let i=(r==null?void 0:r.step)??1;if(!i)return[];i<0&&(i=-i,s=!s);const c=[];for(;+o<=a;)c.push(ue(o)),o.setDate(o.getDate()+i),o.setHours(0,0,0,0);return s?c.reverse():c}function Os(e){const r=ue(e);return r.setDate(1),r.setHours(0,0,0,0),r}function Pl(e,r){const t=ue(e.start),n=ue(e.end);let s=+t>+n;const a=s?+t:+n,o=s?n:t;o.setHours(0,0,0,0),o.setMonth(0,1);let i=(r==null?void 0:r.step)??1;if(!i)return[];i<0&&(i=-i,s=!s);const c=[];for(;+o<=a;)c.push(ue(o)),o.setFullYear(o.getFullYear()+i);return s?c.reverse():c}const El={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"}},kl=(e,r,t)=>{let n;const s=El[e];return typeof s=="string"?n=s:r===1?n=s.one:n=s.other.replace("{{count}}",r.toString()),t!=null&&t.addSuffix?t.comparison&&t.comparison>0?"in "+n:n+" ago":n};function Kr(e){return(r={})=>{const t=r.width?String(r.width):e.defaultWidth;return e.formats[t]||e.formats[e.defaultWidth]}}const Cl={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Dl={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Ol={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Nl={date:Kr({formats:Cl,defaultWidth:"full"}),time:Kr({formats:Dl,defaultWidth:"full"}),dateTime:Kr({formats:Ol,defaultWidth:"full"})},_l={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Il=(e,r,t,n)=>_l[e];function Ht(e){return(r,t)=>{const n=t!=null&&t.context?String(t.context):"standalone";let s;if(n==="formatting"&&e.formattingValues){const o=e.defaultFormattingWidth||e.defaultWidth,i=t!=null&&t.width?String(t.width):o;s=e.formattingValues[i]||e.formattingValues[o]}else{const o=e.defaultWidth,i=t!=null&&t.width?String(t.width):e.defaultWidth;s=e.values[i]||e.values[o]}const a=e.argumentCallback?e.argumentCallback(r):r;return s[a]}}const jl={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Ml={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Rl={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"]},Al={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"]},Ll={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"}},$l={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"}},Fl={ordinalNumber:(e,r)=>{const t=Number(e),n=t%100;if(n>20||n<10)switch(n%10){case 1:return t+"st";case 2:return t+"nd";case 3:return t+"rd"}return t+"th"},era:Ht({values:jl,defaultWidth:"wide"}),quarter:Ht({values:Ml,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Ht({values:Rl,defaultWidth:"wide"}),day:Ht({values:Al,defaultWidth:"wide"}),dayPeriod:Ht({values:Ll,defaultWidth:"wide",formattingValues:$l,defaultFormattingWidth:"wide"})};function Wt(e){return(r,t={})=>{const n=t.width,s=n&&e.matchPatterns[n]||e.matchPatterns[e.defaultMatchWidth],a=r.match(s);if(!a)return null;const o=a[0],i=n&&e.parsePatterns[n]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(i)?Hl(i,m=>m.test(o)):Yl(i,m=>m.test(o));let l;l=e.valueCallback?e.valueCallback(c):c,l=t.valueCallback?t.valueCallback(l):l;const h=r.slice(o.length);return{value:l,rest:h}}}function Yl(e,r){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&r(e[t]))return t}function Hl(e,r){for(let t=0;t<e.length;t++)if(r(e[t]))return t}function Wl(e){return(r,t={})=>{const n=r.match(e.matchPattern);if(!n)return null;const s=n[0],a=r.match(e.parsePattern);if(!a)return null;let o=e.valueCallback?e.valueCallback(a[0]):a[0];o=t.valueCallback?t.valueCallback(o):o;const i=r.slice(s.length);return{value:o,rest:i}}}const Vl=/^(\d+)(th|st|nd|rd)?/i,Bl=/\d+/i,zl={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},Ul={any:[/^b/i,/^(a|c)/i]},ql={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Gl={any:[/1/i,/2/i,/3/i,/4/i]},Zl={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},Ql={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]},Kl={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},Xl={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]},Jl={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},ef={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}},tf={ordinalNumber:Wl({matchPattern:Vl,parsePattern:Bl,valueCallback:e=>parseInt(e,10)}),era:Wt({matchPatterns:zl,defaultMatchWidth:"wide",parsePatterns:Ul,defaultParseWidth:"any"}),quarter:Wt({matchPatterns:ql,defaultMatchWidth:"wide",parsePatterns:Gl,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Wt({matchPatterns:Zl,defaultMatchWidth:"wide",parsePatterns:Ql,defaultParseWidth:"any"}),day:Wt({matchPatterns:Kl,defaultMatchWidth:"wide",parsePatterns:Xl,defaultParseWidth:"any"}),dayPeriod:Wt({matchPatterns:Jl,defaultMatchWidth:"any",parsePatterns:ef,defaultParseWidth:"any"})},rf={code:"en-US",formatDistance:kl,formatLong:Nl,formatRelative:Il,localize:Fl,match:tf,options:{weekStartsOn:0,firstWeekContainsDate:1}};function nf(e){const r=ue(e),t=+xt(r)-+wl(r);return Math.round(t/Es)+1}function Ns(e,r){var h,m,x,v;const t=ue(e),n=t.getFullYear(),s=Yt(),a=(r==null?void 0:r.firstWeekContainsDate)??((m=(h=r==null?void 0:r.locale)==null?void 0:h.options)==null?void 0:m.firstWeekContainsDate)??s.firstWeekContainsDate??((v=(x=s.locale)==null?void 0:x.options)==null?void 0:v.firstWeekContainsDate)??1,o=ye(e,0);o.setFullYear(n+1,0,a),o.setHours(0,0,0,0);const i=rt(o,r),c=ye(e,0);c.setFullYear(n,0,a),c.setHours(0,0,0,0);const l=rt(c,r);return t.getTime()>=i.getTime()?n+1:t.getTime()>=l.getTime()?n:n-1}function sf(e,r){var i,c,l,h;const t=Yt(),n=(r==null?void 0:r.firstWeekContainsDate)??((c=(i=r==null?void 0:r.locale)==null?void 0:i.options)==null?void 0:c.firstWeekContainsDate)??t.firstWeekContainsDate??((h=(l=t.locale)==null?void 0:l.options)==null?void 0:h.firstWeekContainsDate)??1,s=Ns(e,r),a=ye(e,0);return a.setFullYear(s,0,n),a.setHours(0,0,0,0),rt(a,r)}function af(e,r){const t=ue(e),n=+rt(t,r)-+sf(t,r);return Math.round(n/Es)+1}const _s=(e,r)=>{switch(e){case"P":return r.date({width:"short"});case"PP":return r.date({width:"medium"});case"PPP":return r.date({width:"long"});case"PPPP":default:return r.date({width:"full"})}},Is=(e,r)=>{switch(e){case"p":return r.time({width:"short"});case"pp":return r.time({width:"medium"});case"ppp":return r.time({width:"long"});case"pppp":default:return r.time({width:"full"})}},js={p:Is,P:(e,r)=>{const t=e.match(/(P+)(p+)?/)||[],n=t[1],s=t[2];if(!s)return _s(e,r);let a;switch(n){case"P":a=r.dateTime({width:"short"});break;case"PP":a=r.dateTime({width:"medium"});break;case"PPP":a=r.dateTime({width:"long"});break;case"PPPP":default:a=r.dateTime({width:"full"});break}return a.replace("{{date}}",_s(n,r)).replace("{{time}}",Is(s,r))}},of=/^D+$/,cf=/^Y+$/,uf=["D","DD","YY","YYYY"];function lf(e){return of.test(e)}function ff(e){return cf.test(e)}function Ms(e,r,t){const n=df(e,r,t);if(console.warn(n),uf.includes(e))throw new RangeError(n)}function df(e,r,t){const n=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${r}\`) for formatting ${n} to the input \`${t}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}function Xr(e){return ue(e).getDay()}function Rs(e){const r=ue(e),t=r.getFullYear(),n=r.getMonth(),s=ye(e,0);return s.setFullYear(t,n+1,0),s.setHours(0,0,0,0),s.getDate()}function hf(){return Object.assign({},Yt())}function pf(e){let t=ue(e).getDay();return t===0&&(t=7),t}function mf(e){const r=ue(e),t=r.getMonth();return r.setFullYear(r.getFullYear(),t+1,0),r.setHours(0,0,0,0),r}function bf(e,r){const t=ue(e),n=ue(r);return+t<+n}function gf(e,r){const t=r instanceof Date?ye(r,0):new r(0);return t.setFullYear(e.getFullYear(),e.getMonth(),e.getDate()),t.setHours(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()),t}const yf=10;class As{constructor(){b(this,"subPriority",0)}validate(r,t){return!0}}class vf extends As{constructor(r,t,n,s,a){super(),this.value=r,this.validateValue=t,this.setValue=n,this.priority=s,a&&(this.subPriority=a)}validate(r,t){return this.validateValue(r,this.value,t)}set(r,t,n){return this.setValue(r,t,this.value,n)}}class xf extends As{constructor(){super(...arguments);b(this,"priority",yf);b(this,"subPriority",-1)}set(t,n){return n.timestampIsSet?t:ye(t,gf(t,Date))}}class le{run(r,t,n,s){const a=this.parse(r,t,n,s);return a?{setter:new vf(a.value,this.validate,this.set,this.priority,this.subPriority),rest:a.rest}:null}validate(r,t,n){return!0}}class wf extends le{constructor(){super(...arguments);b(this,"priority",140);b(this,"incompatibleTokens",["R","u","t","T"])}parse(t,n,s){switch(n){case"G":case"GG":case"GGG":return s.era(t,{width:"abbreviated"})||s.era(t,{width:"narrow"});case"GGGGG":return s.era(t,{width:"narrow"});case"GGGG":default:return s.era(t,{width:"wide"})||s.era(t,{width:"abbreviated"})||s.era(t,{width:"narrow"})}}set(t,n,s){return n.era=s,t.setFullYear(s,0,1),t.setHours(0,0,0,0),t}}const Pe={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}/},Ve={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 Ee(e,r){return e&&{value:r(e.value),rest:e.rest}}function we(e,r){const t=r.match(e);return t?{value:parseInt(t[0],10),rest:r.slice(t[0].length)}:null}function Be(e,r){const t=r.match(e);if(!t)return null;if(t[0]==="Z")return{value:0,rest:r.slice(1)};const n=t[1]==="+"?1:-1,s=t[2]?parseInt(t[2],10):0,a=t[3]?parseInt(t[3],10):0,o=t[5]?parseInt(t[5],10):0;return{value:n*(s*Qr+a*Zr+o*yl),rest:r.slice(t[0].length)}}function Ls(e){return we(Pe.anyDigitsSigned,e)}function Te(e,r){switch(e){case 1:return we(Pe.singleDigit,r);case 2:return we(Pe.twoDigits,r);case 3:return we(Pe.threeDigits,r);case 4:return we(Pe.fourDigits,r);default:return we(new RegExp("^\\d{1,"+e+"}"),r)}}function or(e,r){switch(e){case 1:return we(Pe.singleDigitSigned,r);case 2:return we(Pe.twoDigitsSigned,r);case 3:return we(Pe.threeDigitsSigned,r);case 4:return we(Pe.fourDigitsSigned,r);default:return we(new RegExp("^-?\\d{1,"+e+"}"),r)}}function Jr(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 $s(e,r){const t=r>0,n=t?r:1-r;let s;if(n<=50)s=e||100;else{const a=n+50,o=Math.trunc(a/100)*100,i=e>=a%100;s=e+o-(i?100:0)}return t?s:1-s}function Fs(e){return e%400===0||e%4===0&&e%100!==0}class Tf extends le{constructor(){super(...arguments);b(this,"priority",130);b(this,"incompatibleTokens",["Y","R","u","w","I","i","e","c","t","T"])}parse(t,n,s){const a=o=>({year:o,isTwoDigitYear:n==="yy"});switch(n){case"y":return Ee(Te(4,t),a);case"yo":return Ee(s.ordinalNumber(t,{unit:"year"}),a);default:return Ee(Te(n.length,t),a)}}validate(t,n){return n.isTwoDigitYear||n.year>0}set(t,n,s){const a=t.getFullYear();if(s.isTwoDigitYear){const i=$s(s.year,a);return t.setFullYear(i,0,1),t.setHours(0,0,0,0),t}const o=!("era"in n)||n.era===1?s.year:1-s.year;return t.setFullYear(o,0,1),t.setHours(0,0,0,0),t}}class Sf extends le{constructor(){super(...arguments);b(this,"priority",130);b(this,"incompatibleTokens",["y","R","u","Q","q","M","L","I","d","D","i","t","T"])}parse(t,n,s){const a=o=>({year:o,isTwoDigitYear:n==="YY"});switch(n){case"Y":return Ee(Te(4,t),a);case"Yo":return Ee(s.ordinalNumber(t,{unit:"year"}),a);default:return Ee(Te(n.length,t),a)}}validate(t,n){return n.isTwoDigitYear||n.year>0}set(t,n,s,a){const o=Ns(t,a);if(s.isTwoDigitYear){const c=$s(s.year,o);return t.setFullYear(c,0,a.firstWeekContainsDate),t.setHours(0,0,0,0),rt(t,a)}const i=!("era"in n)||n.era===1?s.year:1-s.year;return t.setFullYear(i,0,a.firstWeekContainsDate),t.setHours(0,0,0,0),rt(t,a)}}class Pf extends le{constructor(){super(...arguments);b(this,"priority",130);b(this,"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"])}parse(t,n){return or(n==="R"?4:n.length,t)}set(t,n,s){const a=ye(t,0);return a.setFullYear(s,0,4),a.setHours(0,0,0,0),xt(a)}}class Ef extends le{constructor(){super(...arguments);b(this,"priority",130);b(this,"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"])}parse(t,n){return or(n==="u"?4:n.length,t)}set(t,n,s){return t.setFullYear(s,0,1),t.setHours(0,0,0,0),t}}class kf extends le{constructor(){super(...arguments);b(this,"priority",120);b(this,"incompatibleTokens",["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"])}parse(t,n,s){switch(n){case"Q":case"QQ":return Te(n.length,t);case"Qo":return s.ordinalNumber(t,{unit:"quarter"});case"QQQ":return s.quarter(t,{width:"abbreviated",context:"formatting"})||s.quarter(t,{width:"narrow",context:"formatting"});case"QQQQQ":return s.quarter(t,{width:"narrow",context:"formatting"});case"QQQQ":default:return s.quarter(t,{width:"wide",context:"formatting"})||s.quarter(t,{width:"abbreviated",context:"formatting"})||s.quarter(t,{width:"narrow",context:"formatting"})}}validate(t,n){return n>=1&&n<=4}set(t,n,s){return t.setMonth((s-1)*3,1),t.setHours(0,0,0,0),t}}class Cf extends le{constructor(){super(...arguments);b(this,"priority",120);b(this,"incompatibleTokens",["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"])}parse(t,n,s){switch(n){case"q":case"qq":return Te(n.length,t);case"qo":return s.ordinalNumber(t,{unit:"quarter"});case"qqq":return s.quarter(t,{width:"abbreviated",context:"standalone"})||s.quarter(t,{width:"narrow",context:"standalone"});case"qqqqq":return s.quarter(t,{width:"narrow",context:"standalone"});case"qqqq":default:return s.quarter(t,{width:"wide",context:"standalone"})||s.quarter(t,{width:"abbreviated",context:"standalone"})||s.quarter(t,{width:"narrow",context:"standalone"})}}validate(t,n){return n>=1&&n<=4}set(t,n,s){return t.setMonth((s-1)*3,1),t.setHours(0,0,0,0),t}}class Df extends le{constructor(){super(...arguments);b(this,"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]);b(this,"priority",110)}parse(t,n,s){const a=o=>o-1;switch(n){case"M":return Ee(we(Pe.month,t),a);case"MM":return Ee(Te(2,t),a);case"Mo":return Ee(s.ordinalNumber(t,{unit:"month"}),a);case"MMM":return s.month(t,{width:"abbreviated",context:"formatting"})||s.month(t,{width:"narrow",context:"formatting"});case"MMMMM":return s.month(t,{width:"narrow",context:"formatting"});case"MMMM":default:return s.month(t,{width:"wide",context:"formatting"})||s.month(t,{width:"abbreviated",context:"formatting"})||s.month(t,{width:"narrow",context:"formatting"})}}validate(t,n){return n>=0&&n<=11}set(t,n,s){return t.setMonth(s,1),t.setHours(0,0,0,0),t}}class Of extends le{constructor(){super(...arguments);b(this,"priority",110);b(this,"incompatibleTokens",["Y","R","q","Q","M","w","I","D","i","e","c","t","T"])}parse(t,n,s){const a=o=>o-1;switch(n){case"L":return Ee(we(Pe.month,t),a);case"LL":return Ee(Te(2,t),a);case"Lo":return Ee(s.ordinalNumber(t,{unit:"month"}),a);case"LLL":return s.month(t,{width:"abbreviated",context:"standalone"})||s.month(t,{width:"narrow",context:"standalone"});case"LLLLL":return s.month(t,{width:"narrow",context:"standalone"});case"LLLL":default:return s.month(t,{width:"wide",context:"standalone"})||s.month(t,{width:"abbreviated",context:"standalone"})||s.month(t,{width:"narrow",context:"standalone"})}}validate(t,n){return n>=0&&n<=11}set(t,n,s){return t.setMonth(s,1),t.setHours(0,0,0,0),t}}function Nf(e,r,t){const n=ue(e),s=af(n,t)-r;return n.setDate(n.getDate()-s*7),n}class _f extends le{constructor(){super(...arguments);b(this,"priority",100);b(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"])}parse(t,n,s){switch(n){case"w":return we(Pe.week,t);case"wo":return s.ordinalNumber(t,{unit:"week"});default:return Te(n.length,t)}}validate(t,n){return n>=1&&n<=53}set(t,n,s,a){return rt(Nf(t,s,a),a)}}function If(e,r){const t=ue(e),n=nf(t)-r;return t.setDate(t.getDate()-n*7),t}class jf extends le{constructor(){super(...arguments);b(this,"priority",100);b(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"])}parse(t,n,s){switch(n){case"I":return we(Pe.week,t);case"Io":return s.ordinalNumber(t,{unit:"week"});default:return Te(n.length,t)}}validate(t,n){return n>=1&&n<=53}set(t,n,s){return xt(If(t,s))}}const Mf=[31,28,31,30,31,30,31,31,30,31,30,31],Rf=[31,29,31,30,31,30,31,31,30,31,30,31];class Af extends le{constructor(){super(...arguments);b(this,"priority",90);b(this,"subPriority",1);b(this,"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"])}parse(t,n,s){switch(n){case"d":return we(Pe.date,t);case"do":return s.ordinalNumber(t,{unit:"date"});default:return Te(n.length,t)}}validate(t,n){const s=t.getFullYear(),a=Fs(s),o=t.getMonth();return a?n>=1&&n<=Rf[o]:n>=1&&n<=Mf[o]}set(t,n,s){return t.setDate(s),t.setHours(0,0,0,0),t}}class Lf extends le{constructor(){super(...arguments);b(this,"priority",90);b(this,"subpriority",1);b(this,"incompatibleTokens",["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"])}parse(t,n,s){switch(n){case"D":case"DD":return we(Pe.dayOfYear,t);case"Do":return s.ordinalNumber(t,{unit:"date"});default:return Te(n.length,t)}}validate(t,n){const s=t.getFullYear();return Fs(s)?n>=1&&n<=366:n>=1&&n<=365}set(t,n,s){return t.setMonth(0,s),t.setHours(0,0,0,0),t}}function en(e,r,t){var m,x,v,w;const n=Yt(),s=(t==null?void 0:t.weekStartsOn)??((x=(m=t==null?void 0:t.locale)==null?void 0:m.options)==null?void 0:x.weekStartsOn)??n.weekStartsOn??((w=(v=n.locale)==null?void 0:v.options)==null?void 0:w.weekStartsOn)??0,a=ue(e),o=a.getDay(),c=(r%7+7)%7,l=7-s,h=r<0||r>6?r-(o+l)%7:(c+l)%7-(o+l)%7;return vt(a,h)}class $f extends le{constructor(){super(...arguments);b(this,"priority",90);b(this,"incompatibleTokens",["D","i","e","c","t","T"])}parse(t,n,s){switch(n){case"E":case"EE":case"EEE":return s.day(t,{width:"abbreviated",context:"formatting"})||s.day(t,{width:"short",context:"formatting"})||s.day(t,{width:"narrow",context:"formatting"});case"EEEEE":return s.day(t,{width:"narrow",context:"formatting"});case"EEEEEE":return s.day(t,{width:"short",context:"formatting"})||s.day(t,{width:"narrow",context:"formatting"});case"EEEE":default:return s.day(t,{width:"wide",context:"formatting"})||s.day(t,{width:"abbreviated",context:"formatting"})||s.day(t,{width:"short",context:"formatting"})||s.day(t,{width:"narrow",context:"formatting"})}}validate(t,n){return n>=0&&n<=6}set(t,n,s,a){return t=en(t,s,a),t.setHours(0,0,0,0),t}}class Ff extends le{constructor(){super(...arguments);b(this,"priority",90);b(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"])}parse(t,n,s,a){const o=i=>{const c=Math.floor((i-1)/7)*7;return(i+a.weekStartsOn+6)%7+c};switch(n){case"e":case"ee":return Ee(Te(n.length,t),o);case"eo":return Ee(s.ordinalNumber(t,{unit:"day"}),o);case"eee":return s.day(t,{width:"abbreviated",context:"formatting"})||s.day(t,{width:"short",context:"formatting"})||s.day(t,{width:"narrow",context:"formatting"});case"eeeee":return s.day(t,{width:"narrow",context:"formatting"});case"eeeeee":return s.day(t,{width:"short",context:"formatting"})||s.day(t,{width:"narrow",context:"formatting"});case"eeee":default:return s.day(t,{width:"wide",context:"formatting"})||s.day(t,{width:"abbreviated",context:"formatting"})||s.day(t,{width:"short",context:"formatting"})||s.day(t,{width:"narrow",context:"formatting"})}}validate(t,n){return n>=0&&n<=6}set(t,n,s,a){return t=en(t,s,a),t.setHours(0,0,0,0),t}}class Yf extends le{constructor(){super(...arguments);b(this,"priority",90);b(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"])}parse(t,n,s,a){const o=i=>{const c=Math.floor((i-1)/7)*7;return(i+a.weekStartsOn+6)%7+c};switch(n){case"c":case"cc":return Ee(Te(n.length,t),o);case"co":return Ee(s.ordinalNumber(t,{unit:"day"}),o);case"ccc":return s.day(t,{width:"abbreviated",context:"standalone"})||s.day(t,{width:"short",context:"standalone"})||s.day(t,{width:"narrow",context:"standalone"});case"ccccc":return s.day(t,{width:"narrow",context:"standalone"});case"cccccc":return s.day(t,{width:"short",context:"standalone"})||s.day(t,{width:"narrow",context:"standalone"});case"cccc":default:return s.day(t,{width:"wide",context:"standalone"})||s.day(t,{width:"abbreviated",context:"standalone"})||s.day(t,{width:"short",context:"standalone"})||s.day(t,{width:"narrow",context:"standalone"})}}validate(t,n){return n>=0&&n<=6}set(t,n,s,a){return t=en(t,s,a),t.setHours(0,0,0,0),t}}function Hf(e,r){const t=ue(e),n=pf(t),s=r-n;return vt(t,s)}class Wf extends le{constructor(){super(...arguments);b(this,"priority",90);b(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"])}parse(t,n,s){const a=o=>o===0?7:o;switch(n){case"i":case"ii":return Te(n.length,t);case"io":return s.ordinalNumber(t,{unit:"day"});case"iii":return Ee(s.day(t,{width:"abbreviated",context:"formatting"})||s.day(t,{width:"short",context:"formatting"})||s.day(t,{width:"narrow",context:"formatting"}),a);case"iiiii":return Ee(s.day(t,{width:"narrow",context:"formatting"}),a);case"iiiiii":return Ee(s.day(t,{width:"short",context:"formatting"})||s.day(t,{width:"narrow",context:"formatting"}),a);case"iiii":default:return Ee(s.day(t,{width:"wide",context:"formatting"})||s.day(t,{width:"abbreviated",context:"formatting"})||s.day(t,{width:"short",context:"formatting"})||s.day(t,{width:"narrow",context:"formatting"}),a)}}validate(t,n){return n>=1&&n<=7}set(t,n,s){return t=Hf(t,s),t.setHours(0,0,0,0),t}}class Vf extends le{constructor(){super(...arguments);b(this,"priority",80);b(this,"incompatibleTokens",["b","B","H","k","t","T"])}parse(t,n,s){switch(n){case"a":case"aa":case"aaa":return s.dayPeriod(t,{width:"abbreviated",context:"formatting"})||s.dayPeriod(t,{width:"narrow",context:"formatting"});case"aaaaa":return s.dayPeriod(t,{width:"narrow",context:"formatting"});case"aaaa":default:return s.dayPeriod(t,{width:"wide",context:"formatting"})||s.dayPeriod(t,{width:"abbreviated",context:"formatting"})||s.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,n,s){return t.setHours(Jr(s),0,0,0),t}}class Bf extends le{constructor(){super(...arguments);b(this,"priority",80);b(this,"incompatibleTokens",["a","B","H","k","t","T"])}parse(t,n,s){switch(n){case"b":case"bb":case"bbb":return s.dayPeriod(t,{width:"abbreviated",context:"formatting"})||s.dayPeriod(t,{width:"narrow",context:"formatting"});case"bbbbb":return s.dayPeriod(t,{width:"narrow",context:"formatting"});case"bbbb":default:return s.dayPeriod(t,{width:"wide",context:"formatting"})||s.dayPeriod(t,{width:"abbreviated",context:"formatting"})||s.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,n,s){return t.setHours(Jr(s),0,0,0),t}}class zf extends le{constructor(){super(...arguments);b(this,"priority",80);b(this,"incompatibleTokens",["a","b","t","T"])}parse(t,n,s){switch(n){case"B":case"BB":case"BBB":return s.dayPeriod(t,{width:"abbreviated",context:"formatting"})||s.dayPeriod(t,{width:"narrow",context:"formatting"});case"BBBBB":return s.dayPeriod(t,{width:"narrow",context:"formatting"});case"BBBB":default:return s.dayPeriod(t,{width:"wide",context:"formatting"})||s.dayPeriod(t,{width:"abbreviated",context:"formatting"})||s.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,n,s){return t.setHours(Jr(s),0,0,0),t}}class Uf extends le{constructor(){super(...arguments);b(this,"priority",70);b(this,"incompatibleTokens",["H","K","k","t","T"])}parse(t,n,s){switch(n){case"h":return we(Pe.hour12h,t);case"ho":return s.ordinalNumber(t,{unit:"hour"});default:return Te(n.length,t)}}validate(t,n){return n>=1&&n<=12}set(t,n,s){const a=t.getHours()>=12;return a&&s<12?t.setHours(s+12,0,0,0):!a&&s===12?t.setHours(0,0,0,0):t.setHours(s,0,0,0),t}}class qf extends le{constructor(){super(...arguments);b(this,"priority",70);b(this,"incompatibleTokens",["a","b","h","K","k","t","T"])}parse(t,n,s){switch(n){case"H":return we(Pe.hour23h,t);case"Ho":return s.ordinalNumber(t,{unit:"hour"});default:return Te(n.length,t)}}validate(t,n){return n>=0&&n<=23}set(t,n,s){return t.setHours(s,0,0,0),t}}class Gf extends le{constructor(){super(...arguments);b(this,"priority",70);b(this,"incompatibleTokens",["h","H","k","t","T"])}parse(t,n,s){switch(n){case"K":return we(Pe.hour11h,t);case"Ko":return s.ordinalNumber(t,{unit:"hour"});default:return Te(n.length,t)}}validate(t,n){return n>=0&&n<=11}set(t,n,s){return t.getHours()>=12&&s<12?t.setHours(s+12,0,0,0):t.setHours(s,0,0,0),t}}class Zf extends le{constructor(){super(...arguments);b(this,"priority",70);b(this,"incompatibleTokens",["a","b","h","H","K","t","T"])}parse(t,n,s){switch(n){case"k":return we(Pe.hour24h,t);case"ko":return s.ordinalNumber(t,{unit:"hour"});default:return Te(n.length,t)}}validate(t,n){return n>=1&&n<=24}set(t,n,s){const a=s<=24?s%24:s;return t.setHours(a,0,0,0),t}}class Qf extends le{constructor(){super(...arguments);b(this,"priority",60);b(this,"incompatibleTokens",["t","T"])}parse(t,n,s){switch(n){case"m":return we(Pe.minute,t);case"mo":return s.ordinalNumber(t,{unit:"minute"});default:return Te(n.length,t)}}validate(t,n){return n>=0&&n<=59}set(t,n,s){return t.setMinutes(s,0,0),t}}class Kf extends le{constructor(){super(...arguments);b(this,"priority",50);b(this,"incompatibleTokens",["t","T"])}parse(t,n,s){switch(n){case"s":return we(Pe.second,t);case"so":return s.ordinalNumber(t,{unit:"second"});default:return Te(n.length,t)}}validate(t,n){return n>=0&&n<=59}set(t,n,s){return t.setSeconds(s,0),t}}class Xf extends le{constructor(){super(...arguments);b(this,"priority",30);b(this,"incompatibleTokens",["t","T"])}parse(t,n){const s=a=>Math.trunc(a*Math.pow(10,-n.length+3));return Ee(Te(n.length,t),s)}set(t,n,s){return t.setMilliseconds(s),t}}class Jf extends le{constructor(){super(...arguments);b(this,"priority",10);b(this,"incompatibleTokens",["t","T","x"])}parse(t,n){switch(n){case"X":return Be(Ve.basicOptionalMinutes,t);case"XX":return Be(Ve.basic,t);case"XXXX":return Be(Ve.basicOptionalSeconds,t);case"XXXXX":return Be(Ve.extendedOptionalSeconds,t);case"XXX":default:return Be(Ve.extended,t)}}set(t,n,s){return n.timestampIsSet?t:ye(t,t.getTime()-Cs(t)-s)}}class ed extends le{constructor(){super(...arguments);b(this,"priority",10);b(this,"incompatibleTokens",["t","T","X"])}parse(t,n){switch(n){case"x":return Be(Ve.basicOptionalMinutes,t);case"xx":return Be(Ve.basic,t);case"xxxx":return Be(Ve.basicOptionalSeconds,t);case"xxxxx":return Be(Ve.extendedOptionalSeconds,t);case"xxx":default:return Be(Ve.extended,t)}}set(t,n,s){return n.timestampIsSet?t:ye(t,t.getTime()-Cs(t)-s)}}class td extends le{constructor(){super(...arguments);b(this,"priority",40);b(this,"incompatibleTokens","*")}parse(t){return Ls(t)}set(t,n,s){return[ye(t,s*1e3),{timestampIsSet:!0}]}}class rd extends le{constructor(){super(...arguments);b(this,"priority",20);b(this,"incompatibleTokens","*")}parse(t){return Ls(t)}set(t,n,s){return[ye(t,s),{timestampIsSet:!0}]}}const nd={G:new wf,y:new Tf,Y:new Sf,R:new Pf,u:new Ef,Q:new kf,q:new Cf,M:new Df,L:new Of,w:new _f,I:new jf,d:new Af,D:new Lf,E:new $f,e:new Ff,c:new Yf,i:new Wf,a:new Vf,b:new Bf,B:new zf,h:new Uf,H:new qf,K:new Gf,k:new Zf,m:new Qf,s:new Kf,S:new Xf,X:new Jf,x:new ed,t:new td,T:new rd},sd=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,ad=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,od=/^'([^]*?)'?$/,id=/''/g,cd=/\S/,ud=/[a-zA-Z]/;function ze(e,r,t,n){var D,N,S,A,B,F,g,$;const s=hf(),a=(n==null?void 0:n.locale)??s.locale??rf,o=(n==null?void 0:n.firstWeekContainsDate)??((N=(D=n==null?void 0:n.locale)==null?void 0:D.options)==null?void 0:N.firstWeekContainsDate)??s.firstWeekContainsDate??((A=(S=s.locale)==null?void 0:S.options)==null?void 0:A.firstWeekContainsDate)??1,i=(n==null?void 0:n.weekStartsOn)??((F=(B=n==null?void 0:n.locale)==null?void 0:B.options)==null?void 0:F.weekStartsOn)??s.weekStartsOn??(($=(g=s.locale)==null?void 0:g.options)==null?void 0:$.weekStartsOn)??0;if(r==="")return e===""?ue(t):ye(t,NaN);const c={firstWeekContainsDate:o,weekStartsOn:i,locale:a},l=[new xf],h=r.match(ad).map(_=>{const W=_[0];if(W in js){const Y=js[W];return Y(_,a.formatLong)}return _}).join("").match(sd),m=[];for(let _ of h){!(n!=null&&n.useAdditionalWeekYearTokens)&&ff(_)&&Ms(_,r,e),!(n!=null&&n.useAdditionalDayOfYearTokens)&&lf(_)&&Ms(_,r,e);const W=_[0],Y=nd[W];if(Y){const{incompatibleTokens:re}=Y;if(Array.isArray(re)){const U=m.find(E=>re.includes(E.token)||E.token===W);if(U)throw new RangeError(`The format string mustn't contain \`${U.fullToken}\` and \`${_}\` at the same time`)}else if(Y.incompatibleTokens==="*"&&m.length>0)throw new RangeError(`The format string mustn't contain \`${_}\` and any other token at the same time`);m.push({token:W,fullToken:_});const te=Y.run(e,_,a.match,c);if(!te)return ye(t,NaN);l.push(te.setter),e=te.rest}else{if(W.match(ud))throw new RangeError("Format string contains an unescaped latin alphabet character `"+W+"`");if(_==="''"?_="'":W==="'"&&(_=ld(_)),e.indexOf(_)===0)e=e.slice(_.length);else return ye(t,NaN)}}if(e.length>0&&cd.test(e))return ye(t,NaN);const x=l.map(_=>_.priority).sort((_,W)=>W-_).filter((_,W,Y)=>Y.indexOf(_)===W).map(_=>l.filter(W=>W.priority===_).sort((W,Y)=>Y.subPriority-W.subPriority)).map(_=>_[0]);let v=ue(t);if(isNaN(v.getTime()))return ye(t,NaN);const w={};for(const _ of x){if(!_.validate(v,c))return ye(t,NaN);const W=_.set(v,w,c);Array.isArray(W)?(v=W[0],Object.assign(w,W[1])):v=W}return ye(t,v)}function ld(e){return e.match(od)[1].replace(id,"'")}function fd(e){return Ds(e,Date.now())}function dd(e,r){return vt(e,-r)}function hd(e,r){let t=r-Xr(e);return t<=0&&(t+=7),vt(e,t)}function pd(e,r){const t=(r==null?void 0:r.additionalDigits)??2,n=yd(e);let s;if(n.date){const c=vd(n.date,t);s=xd(c.restDateString,c.year)}if(!s||isNaN(s.getTime()))return new Date(NaN);const a=s.getTime();let o=0,i;if(n.time&&(o=wd(n.time),isNaN(o)))return new Date(NaN);if(n.timezone){if(i=Td(n.timezone),isNaN(i))return new Date(NaN)}else{const c=new Date(a+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(a+o+i)}const ir={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},md=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,bd=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,gd=/^([+-])(\d{2})(?::?(\d{2}))?$/;function yd(e){const r={},t=e.split(ir.dateTimeDelimiter);let n;if(t.length>2)return r;if(/:/.test(t[0])?n=t[0]:(r.date=t[0],n=t[1],ir.timeZoneDelimiter.test(r.date)&&(r.date=e.split(ir.timeZoneDelimiter)[0],n=e.substr(r.date.length,e.length))),n){const s=ir.timezone.exec(n);s?(r.time=n.replace(s[1],""),r.timezone=s[1]):r.time=n}return r}function vd(e,r){const t=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+r)+"})|(\\d{2}|[+-]\\d{"+(2+r)+"})$)"),n=e.match(t);if(!n)return{year:NaN,restDateString:""};const s=n[1]?parseInt(n[1]):null,a=n[2]?parseInt(n[2]):null;return{year:a===null?s:a*100,restDateString:e.slice((n[1]||n[2]).length)}}function xd(e,r){if(r===null)return new Date(NaN);const t=e.match(md);if(!t)return new Date(NaN);const n=!!t[4],s=Vt(t[1]),a=Vt(t[2])-1,o=Vt(t[3]),i=Vt(t[4]),c=Vt(t[5])-1;if(n)return Cd(r,i,c)?Sd(r,i,c):new Date(NaN);{const l=new Date(0);return!Ed(r,a,o)||!kd(r,s)?new Date(NaN):(l.setUTCFullYear(r,a,Math.max(s,o)),l)}}function Vt(e){return e?parseInt(e):1}function wd(e){const r=e.match(bd);if(!r)return NaN;const t=tn(r[1]),n=tn(r[2]),s=tn(r[3]);return Dd(t,n,s)?t*Qr+n*Zr+s*1e3:NaN}function tn(e){return e&&parseFloat(e.replace(",","."))||0}function Td(e){if(e==="Z")return 0;const r=e.match(gd);if(!r)return 0;const t=r[1]==="+"?-1:1,n=parseInt(r[2]),s=r[3]&&parseInt(r[3])||0;return Od(n,s)?t*(n*Qr+s*Zr):NaN}function Sd(e,r,t){const n=new Date(0);n.setUTCFullYear(e,0,4);const s=n.getUTCDay()||7,a=(r-1)*7+t+1-s;return n.setUTCDate(n.getUTCDate()+a),n}const Pd=[31,null,31,30,31,30,31,31,30,31,30,31];function Ys(e){return e%400===0||e%4===0&&e%100!==0}function Ed(e,r,t){return r>=0&&r<=11&&t>=1&&t<=(Pd[r]||(Ys(e)?29:28))}function kd(e,r){return r>=1&&r<=(Ys(e)?366:365)}function Cd(e,r,t){return r>=1&&r<=53&&t>=0&&t<=6}function Dd(e,r,t){return e===24?r===0&&t===0:t>=0&&t<60&&r>=0&&r<60&&e>=0&&e<25}function Od(e,r){return r>=0&&r<=59}function Nd(e,r){const t=ue(e),n=t.getFullYear(),s=t.getDate(),a=ye(e,0);a.setFullYear(n,r,15),a.setHours(0,0,0,0);const o=Rs(a);return t.setMonth(r,Math.min(s,o)),t}function _d(e,r){const t=ue(e);return isNaN(+t)?ye(e,NaN):(t.setFullYear(r),t)}function Hs(e,r){return ct(e,-r)}function Ws(e,r){return ar(e,-r)}function Vs(){return window.navigator.languages?window.navigator.languages[0]:window.navigator.language}function Id(e,r,t){const n=[];for(let s=e;s<=r;s++)n.push(t?t(s):s);return n}function jd(e,r){const t=e.target;return t?!r.isSameNode(t)&&!r.contains(t):!1}function Md(e,r){return e.isSameNode(r)||e.contains(r)}function Rd(e,r){const t=Object.entries(r),n=getComputedStyle(e);for(let s=0,a=t.length;s<a;s++){const[o,i]=t[s];if(typeof i=="string"&&i.indexOf(",")>-1){if(!i.split(",").map(l=>l.trim()).includes(n[o]))return!1}else if(n[o]!==i)return!1}return!0}function Ad(e,r){const t=Object.entries(r),n=getComputedStyle(e);for(let s=0,a=t.length;s<a;s++){const[o,i]=t[s];if(typeof i=="string"&&i.indexOf(",")>-1){if(i.split(",").map(l=>l.trim()).includes(n[o]))return!0}else if(n[o]===i)return!0}return!1}function Bs(e,r,t=!1,n){if(t&&Rd(e,r)){if(!n||(n==null?void 0:n(e))===!0)return e}else if(!t&&Ad(e,r)&&(!n||(n==null?void 0:n(e))===!0))return e;return e.parentElement?Bs(e.parentElement,r,t,n):e}function zs(e,r){const t=Array.from(document.querySelectorAll("body *")),n=[];for(let s=0,a=t.length;s<a;s++){const o=getComputedStyle(t[s]);o[e]&&r(o[e])&&n.push(o[e])}return n}function up(e){return e}function Ld(e){const r=document.documentElement;Object.keys(e).forEach(t=>{r.style.setProperty(t,e[t])})}function $d(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 _e=(e=>(e[e.Regular=24]="Regular",e[e.Small=20]="Small",e))(_e||{});const Us=({className:e})=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:e,children:f.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"})}),Fd=({className:e})=>{const r=ce("bsc-h-6 bsc-w-6",e);return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:r,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m19.5 8.25-7.5 7.5-7.5-7.5"})})},Yd=({className:e})=>{const r=ce("bsc-h-6 bsc-w-6",e);return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:r,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 19.5 8.25 12l7.5-7.5"})})},Hd=({className:e})=>{const r=ce("bsc-h-6 bsc-w-6",e);return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:r,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m8.25 4.5 7.5 7.5-7.5 7.5"})})},Wd=({className:e})=>{const r=ce("bsc-h-6 bsc-w-6",e);return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:r,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m4.5 15.75 7.5-7.5 7.5 7.5"})})},Vd=({className:e})=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:e,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18 18 6M6 6l12 12"})}),Re=({icon:e,size:r=_e.Regular,onClick:t,className:n})=>{const s=d.useRef({calendar:Us,chevronDown:Fd,chevronLeft:Yd,chevronRight:Hd,chevronUp:Wd,close:Vd}),a=d.useMemo(()=>s.current[e]||Us,[e]),o=ce({"bsc-h-[24px] bsc-w-[24px]":r===_e.Regular,"bsc-h-[20px] bsc-w-[20px]":r===_e.Small},n);return f.jsx("div",{onClick:t,children:f.jsx(a,{className:o})})},wt=({template:e,props:r,children:t})=>e(r,t);function Bd(e,r){if(r===e)return!1;const t=Object.values(r),n=Object.values(e);if(t.length!==n.length||t.some((a,o)=>a!==n[o]))return!0;const s=Object.keys(e);return Object.keys(r).some((a,o)=>a!==s[o])}function zd(e,r){return e.matches[r]=!1,e.mediaQueries[r]={},e}function qs(e){const r=Object.keys(e);return typeof window>"u"?r.reduce(zd,{mediaQueries:{},matches:{}}):r.reduce((t,n)=>{const s=window.matchMedia(e[n]);return t.mediaQueries[n]=s,t.matches[n]=s.matches,t},{mediaQueries:{},matches:{}})}function Ud(e,r){function t(n,s){return n[s]=e.mediaQueries[s].matches,n}switch(r.type){case"updateMatches":return{matches:Object.keys(e.mediaQueries).reduce(t,{}),mediaQueries:e.mediaQueries};case"setQueries":return qs(r.queries)}}function qd(e){const r=_t.useRef(e),[t,n]=_t.useReducer(Ud,e,qs);_t.useEffect(()=>{Bd(e,r.current)&&(n({type:"setQueries",queries:e}),r.current=e)},[e]);function s(){return n({type:"updateMatches"})}function a(c){const l=s;return typeof c.addListener<"u"?c.addListener(l):c.addEventListener("change",l),l}_t.useEffect(()=>{const c=Object.values(t.mediaQueries),l=c.map(a);function h(m,x){typeof m.addListener<"u"?m.removeListener(l[x]):m.removeEventListener("change",l[x])}return()=>{c.forEach(h)}},[t.mediaQueries]);const{matches:o}=t,i=_t.useMemo(()=>Object.values(o),[o]);return{matches:o,matchesAny:i.some(Boolean),matchesAll:i.length>0&&i.every(Boolean)}}function cr(e){return qd(Gd(e)).matchesAll}const rn={};function Gd(e){return rn[e]===void 0&&(rn[e]={default:e}),rn[e]}const nn=({mobileQuery:e="screen and (max-device-width: 40rem)",tabletQuery:r="screen and (min-device-width: 40.01rem) and (max-device-width: 63.9375rem)",desktopQuery:t="screen and (min-device-width: 64rem)",mobileMarkup:n,aboveMobileMarkup:s,tabletMarkup:a,desktopMarkup:o})=>{const i=cr(e),c=cr(r),l=cr(t);return(()=>i&&n?n:!i&&s?s:c&&a?a:l&&o?o:(console.error("Invalid media settings"),null))()};function Gs(e,r,t){const n=a=>{const o=a.target,i=e.style.display!=="hidden";e&&i&&!Md(e,o)&&!s(t,o)&&r(!1),r(!0)},s=(a,o)=>{if(!a)return!1;for(let i=0,c=a.length;i<c;i++)if(a[i].isSameNode(o)||a[i].contains(o))return!0;return!1};return document.addEventListener("mousedown",n),n}function Zs(e){document.removeEventListener("mousedown",e)}function Zd(e,r){if(e==null)return{};var t={},n=Object.keys(e),s,a;for(a=0;a<n.length;a++)s=n[a],!(r.indexOf(s)>=0)&&(t[s]=e[s]);return t}function sn(e,r){return sn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,s){return n.__proto__=s,n},sn(e,r)}function Qd(e,r){e.prototype=Object.create(r.prototype),e.prototype.constructor=e,sn(e,r)}var an={exports:{}},ur={exports:{}},de={};/** @license React v16.13.1
31
+ */(function(e){(function(){var r={}.hasOwnProperty;function t(){for(var a="",o=0;o<arguments.length;o++){var i=arguments[o];i&&(a=s(a,n(i)))}return a}function n(a){if(typeof a=="string"||typeof a=="number")return a;if(typeof a!="object")return"";if(Array.isArray(a))return t.apply(null,a);if(a.toString!==Object.prototype.toString&&!a.toString.toString().includes("[native code]"))return a.toString();var o="";for(var i in a)r.call(a,i)&&a[i]&&(o=s(o,i));return o}function s(a,o){return o?a?a+" "+o:a+o:a}e.exports?(t.default=t,e.exports=t):window.classNames=t})()})(In);var Ya=In.exports;const ie=Ar(Ya);var $t=(e=>(e[e.Focus=0]="Focus",e[e.FocusWithin=1]="FocusWithin",e))($t||{});const or=(e=1)=>d.useMemo(()=>ie("dark:bsc-ring-mono-light-2 dark:bsc-ring-offset-mono-dark-1",{"focus-within:bsc-ring focus-within:bsc-ring-offset-2 focus-within:bsc-ring-opacity-50":e===1,"focus:bsc-ring focus:bsc-ring-offset-2 focus:bsc-ring-opacity-50":e===0}),[e]),Ha=(e,r)=>{const t=d.useRef(null),{buttonType:n,buttonStyle:s="flat",type:a="button",disabled:o=!1,form:i,fullWidth:c=!1,onClick:f,className:h,children:p}=e,y=()=>{f==null||f()},x=()=>{var O;(O=t.current)==null||O.click()};d.useImperativeHandle(r,()=>({click:x}));const w=or($t.Focus),D=ie("bc-button max-sm:bsc-p-4 md:bsc-p-2 dark:bsc-bg-mono-light-1 dark:hover:bsc-bg-mono-light-2 dark:bsc-text-mono-dark-1",w,{"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 hover:bsc-bg-primary-2 focus:bsc-ring-primary-1":n==="primary","bsc-bg-primary-2 bsc-text-white hover:bsc-bg-primary-3 focus:bsc-ring-primary-2":n==="secondary","bsc-bg-info bsc-text-white focus:bsc-ring-info":n==="info","bsc-bg-success bsc-text-white focus:bsc-ring-success":n==="success","bsc-bg-warning bsc-text-white focus:bsc-ring-warning":n==="warning","bsc-bg-error bsc-text-white focus:bsc-ring-error":n==="error","bsc-rounded-md":s==="curved","bsc-rounded-full !bsc-px-4":s==="round"},h);return l.jsx("button",{ref:t,type:a,onClick:y,disabled:o,form:i,className:D,children:p})},Ve=d.forwardRef(Ha),$r=e=>{const[r,t]=d.useState(!0),n=Nn();return d.useEffect(()=>{e!==void 0?t(e):n&&n.useAnimations!==void 0&&t(n.useAnimations)},[n,e]),r},jn=d.createContext(void 0),Mn=()=>d.useContext(jn),Wa=({children:e})=>{const r=d.useId(),t=d.useMemo(()=>({sharedId:r}),[r]);return l.jsx(jn.Provider,{value:t,children:e})},ir=e=>e==null?!1:typeof e=="object",Rn=e=>e instanceof Date,An=e=>typeof e=="function",Ln=e=>{const r=typeof e;return r==="string"||r==="number"||r==="boolean"||r==="bigint"},Fr=e=>{if(!ir(e))return e;const r={},t=Object.keys(e);for(let n=0,s=t.length;n<s;n++){const a=t[n],o=e[a];Ln(o)||An(o)?r[a]=o:Rn(o)?r[a]=new Date(o.getTime()):Array.isArray(o)?r[a]=Yr(o):ir(o)&&(r[a]=Fr(o))}return r},Yr=e=>{let r=e.length;const t=new Array(r);for(;r--!==0;){const n=e[r];Ln(n)||An(n)?t[r]=n:Rn(n)?t[r]=new Date(n.getTime()):ir(n)&&!Array.isArray(n)?t[r]=Fr(n):Array.isArray(n)?t[r]=Yr(n):t[r]=n}return t},Va=e=>ir(e)?Array.isArray(e)?Yr(e):Fr(e):e;function Ba(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var za=function e(r,t){if(r===t)return!0;if(r&&t&&typeof r=="object"&&typeof t=="object"){if(r.constructor!==t.constructor)return!1;var n,s,a;if(Array.isArray(r)){if(n=r.length,n!=t.length)return!1;for(s=n;s--!==0;)if(!e(r[s],t[s]))return!1;return!0}if(r.constructor===RegExp)return r.source===t.source&&r.flags===t.flags;if(r.valueOf!==Object.prototype.valueOf)return r.valueOf()===t.valueOf();if(r.toString!==Object.prototype.toString)return r.toString()===t.toString();if(a=Object.keys(r),n=a.length,n!==Object.keys(t).length)return!1;for(s=n;s--!==0;)if(!Object.prototype.hasOwnProperty.call(t,a[s]))return!1;for(s=n;s--!==0;){var o=a[s];if(!e(r[o],t[o]))return!1}return!0}return r!==r&&t!==t};const $n=Ba(za);function Ua(e,r){for(let t=e.length;t--!==0;)if(!$n(e[t],r[t]))return!0;return!1}const cr=(e,r)=>{const t=d.useRef([]),n=t.current.length>0&&t.current[0]&&Ua(t.current[0],r);return(t.current.length===0||n)&&(t.current=[Va(r),e()]),t.current[1]},Fn=e=>{const r=d.useRef();let t=!1;r.current!==void 0&&(t=!$n(r.current,e));const n={changed:t,previousValue:r.current};return r.current=e,n},qa=e=>typeof e=="function",Ga=e=>{const[r,t]=d.useState({value:e,initial:!0}),n=d.useRef(e);return[r,s=>{if(!qa(s))t({value:s,initial:!1});else{const a=s(n.current);n.current=a,t({value:a,initial:!1})}}]},Za=e=>{const[r,t]=Ga(e),n=d.useRef({value:e,initial:!0});return n.current!==r&&(n.current=r),[r,t,n]},Qa=e=>{const[r,t]=d.useState(e),n=d.useRef(e);return n.current!==r&&(n.current=r),[r,t,n]};function Yn(){return window.navigator.languages?window.navigator.languages[0]:window.navigator.language}function Ka(e,r,t){const n=[];for(let s=e;s<=r;s++)n.push(t?t(s):s);return n}function Xa(e,r){const t=e.target;return t?!r.isSameNode(t)&&!r.contains(t):!1}function Ja(e,r){return e.isSameNode(r)||e.contains(r)}function eo(e,r){const t=Object.entries(r),n=getComputedStyle(e);for(let s=0,a=t.length;s<a;s++){const[o,i]=t[s];if(typeof i=="string"&&i.indexOf(",")>-1){if(!i.split(",").map(f=>f.trim()).includes(n[o]))return!1}else if(n[o]!==i)return!1}return!0}function to(e,r){const t=Object.entries(r),n=getComputedStyle(e);for(let s=0,a=t.length;s<a;s++){const[o,i]=t[s];if(typeof i=="string"&&i.indexOf(",")>-1){if(i.split(",").map(f=>f.trim()).includes(n[o]))return!0}else if(n[o]===i)return!0}return!1}function Hn(e,r,t=!1,n){if(t&&eo(e,r)){if(!n||(n==null?void 0:n(e))===!0)return e}else if(!t&&to(e,r)&&(!n||(n==null?void 0:n(e))===!0))return e;return e.parentElement?Hn(e.parentElement,r,t,n):e}function Wn(e,r){const t=Array.from(document.querySelectorAll("body *")),n=[];for(let s=0,a=t.length;s<a;s++){const o=getComputedStyle(t[s]);o[e]&&r(o[e])&&n.push(o[e])}return n}function dp(e){return e}function ro(e){const r=document.documentElement;Object.keys(e).forEach(t=>{r.style.setProperty(t,e[t])})}function no(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"}}const so=d.createContext(void 0),ao=()=>d.useContext(so),oo=({id:e,name:r,value:t,type:n,checked:s,readOnly:a,className:o})=>l.jsx("input",{id:e,name:r,value:t,type:n,checked:s,readOnly:a,disabled:a,className:o}),io=({type:e,props:r,renderProps:t,signalName:n,onSignalRetrieved:s,children:a,className:o})=>{const i=ao(),{id:c,name:f}=cr(()=>{const h=r;return{id:h.id,name:h.name}},[r]);return d.useEffect(()=>{i&&n&&i[n]&&s&&s(i[n])},[i]),l.jsxs(l.Fragment,{children:[c&&f&&e&&l.jsx(oo,{id:c,name:f,type:e,className:o,...r}),a&&a(t)]})},co=(e,r)=>{const{name:t,value:n,checked:s=!1,partial:a=!1,onChange:o,children:i,labelStyles:c,className:f}=e,h=Mn(),p=d.useId(),[y,x,w]=Za({checked:!1,partial:!1}),D=Fn(s),O=Fn(a),S={id:(h==null?void 0:h.sharedId)||e.id||p,...e,...y.value};d.useEffect(()=>{if(y.initial)x({checked:a?!0:s,partial:a});else{const b=D.changed?s:y.value.checked,A=O.changed?a:y.value.partial;x({checked:A?!0:b,partial:A})}},[s,a]);const R=b=>{var k;const A=((k=w.current)==null?void 0:k.value.partial)===!0?!0:b.target.checked;x({checked:A,partial:!1}),o==null||o({originalEvent:b,name:t||b.target.name,value:n,checked:A})},U=b=>{var k;const A={checked:b?!0:((k=w.current)==null?void 0:k.value.checked)||!1,partial:b};x(A)},F=b=>{x({checked:b,partial:!1})};return d.useImperativeHandle(r,()=>({setPartiallyChecked:U,setChecked:F})),l.jsx("label",{className:c,onChange:b=>R(b),children:l.jsx(io,{id:p,name:t,type:"checkbox",props:S,renderProps:y.value,className:f,children:i})})},uo=d.memo(d.forwardRef(co)),lo=({label:e,htmlFor:r,className:t})=>{const n=Mn(),s=d.useMemo(()=>(n==null?void 0:n.sharedId)||r,[n==null?void 0:n.sharedId,r]);return l.jsx("label",{htmlFor:s,className:t,children:e})},Ge=({label:e,htmlFor:r,readOnly:t=!1,className:n})=>{const s=ie("bc-label",{"bsc-text-black dark:bsc-text-mono-light-1":!t,"bc-read-only bsc-text-gray-4 dark:bsc-text-mono-light-3 bsc-pointer-events-none":t},n);return l.jsx(lo,{label:e,htmlFor:r,className:s})},fo=(e,r)=>{const{name:t,label:n,value:s,readOnly:a=!1,checked:o=!1,partial:i=!1,labelLocation:c=Re.Right,className:f,useAnimation:h,onChange:p}=e,y=$r(h),x=ie("bc-checkbox-wrapper bsc-flex bsc-items-center",{"bc-read-only bsc-pointer-events-none bsc-text-gray-2 dark:bsc-text-mono-light-3":a},f),w=ie("bc-checkbox-label bsc-cursor-pointer",{"bsc-ml-2":c===Re.Right,"bsc-mr-2":c===Re.Left}),D=or($t.FocusWithin),O=ie("bc-checkbox-outer bsc-relative bsc-rounded *:bsc-block *:bsc-size-[21px]",{"bsc-checkbox-animate":!a&&y,"bc-read-only bsc-checkbox-no-animate":a||!a&&!y},D),S=ie("bc-checkbox-inner bsc-relative bsc-m-0 bsc-cursor-pointer bsc-appearance-none bsc-rounded bsc-border-none bsc-bg-mono-light-1 bsc-p-0 bsc-outline-none dark:bsc-bg-mono-dark-1 dark:checked:bsc-bg-mono-light-1",{"[transition:box-shadow_0.3s]":y,"bsc-checkbox":!a,"bc-read-only bsc-checkbox-read-only":a}),R=ie("bc-checkbox-svg bsc-pointer-events-none bsc-absolute bsc-left-0 bsc-top-0 bsc-stroke-mono-light-1 bsc-stroke-2 [stroke-linecap:round] [stroke-linejoin:round] [transform:scale(0)_translateZ(0)] dark:bsc-stroke-mono-dark-3",{"bsc-fill-primary-1 dark:bsc-fill-mono-light-1":!a,"bc-read-only bsc-fill-primary-4 dark:bsc-fill-mono-light-3":a});return l.jsx(Wa,{children:l.jsxs("div",{className:x,children:[n&&c===Re.Left&&l.jsx(Ge,{label:n,readOnly:a,className:w}),l.jsx(uo,{ref:r,name:t,value:s,checked:o,partial:i,readOnly:a,className:S,labelStyles:O,onChange:p,children:({partial:U})=>l.jsx("svg",{viewBox:"0 0 21 21",className:R,children:U?l.jsx("polyline",{points:"6 10.5 16 10.5"}):l.jsx("polyline",{points:"5 10.75 8.5 14.25 16 6"})})}),n&&c===Re.Right&&l.jsx(Ge,{label:n,readOnly:a,className:w})]})})},Vn=d.memo(d.forwardRef(fo)),ho=({name:e,label:r,value:t,data:n,textField:s,valueField:a,readOnly:o=!1,orientation:i=Ne.Vertical,className:c,onChange:f})=>{const[h,p]=d.useState([]),y=cr(()=>n,[n]);d.useEffect(()=>{p(t??[])},[t]);const x=R=>{const{value:U,checked:F}=R;let b;F?b=[...h,U]:b=h.filter(A=>A!==U),p(b),f==null||f({name:e,value:b})},w=(R,U)=>l.jsx(Vn,{name:e,label:R[s],value:R[a],checked:h.some(F=>F===R[a]),readOnly:o,onChange:F=>F&&x(F),className:"bsc-mr-3"},`${e}_checkbox_${U}`),D=ie("bsc-flex bsc-flex-col bsc-gap-1",c),O=ie("bsc-flex bsc-gap-1",{"bsc-flex-col":i===Ne.Vertical}),S=R=>l.jsx("div",{className:O,children:R.map(w)});return l.jsxs("div",{className:D,children:[r&&l.jsx(Ge,{label:r,readOnly:o}),y&&S(y)]})},po=d.memo(ho);var mo=typeof global=="object"&&global&&global.Object===Object&&global;const Bn=mo;var bo=typeof self=="object"&&self&&self.Object===Object&&self,go=Bn||bo||Function("return this")();const Ye=go;var yo=Ye.Symbol;const bt=yo;var zn=Object.prototype,vo=zn.hasOwnProperty,xo=zn.toString,Ft=bt?bt.toStringTag:void 0;function wo(e){var r=vo.call(e,Ft),t=e[Ft];try{e[Ft]=void 0;var n=!0}catch{}var s=xo.call(e);return n&&(r?e[Ft]=t:delete e[Ft]),s}var To=Object.prototype,So=To.toString;function Po(e){return So.call(e)}var Eo="[object Null]",ko="[object Undefined]",Un=bt?bt.toStringTag:void 0;function gt(e){return e==null?e===void 0?ko:Eo:Un&&Un in Object(e)?wo(e):Po(e)}function yt(e){return e!=null&&typeof e=="object"}var Co="[object Symbol]";function Do(e){return typeof e=="symbol"||yt(e)&&gt(e)==Co}var Oo=Array.isArray;const Hr=Oo;var _o=/\s/;function No(e){for(var r=e.length;r--&&_o.test(e.charAt(r)););return r}var Io=/^\s+/;function jo(e){return e&&e.slice(0,No(e)+1).replace(Io,"")}function Ze(e){var r=typeof e;return e!=null&&(r=="object"||r=="function")}var qn=0/0,Mo=/^[-+]0x[0-9a-f]+$/i,Ro=/^0b[01]+$/i,Ao=/^0o[0-7]+$/i,Lo=parseInt;function Gn(e){if(typeof e=="number")return e;if(Do(e))return qn;if(Ze(e)){var r=typeof e.valueOf=="function"?e.valueOf():e;e=Ze(r)?r+"":r}if(typeof e!="string")return e===0?e:+e;e=jo(e);var t=Ro.test(e);return t||Ao.test(e)?Lo(e.slice(2),t?2:8):Mo.test(e)?qn:+e}var $o="[object AsyncFunction]",Fo="[object Function]",Yo="[object GeneratorFunction]",Ho="[object Proxy]";function Zn(e){if(!Ze(e))return!1;var r=gt(e);return r==Fo||r==Yo||r==$o||r==Ho}var Wo=Ye["__core-js_shared__"];const Wr=Wo;var Qn=function(){var e=/[^.]+$/.exec(Wr&&Wr.keys&&Wr.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function Vo(e){return!!Qn&&Qn in e}var Bo=Function.prototype,zo=Bo.toString;function st(e){if(e!=null){try{return zo.call(e)}catch{}try{return e+""}catch{}}return""}var Uo=/[\\^$.*+?()[\]{}|]/g,qo=/^\[object .+?Constructor\]$/,Go=Function.prototype,Zo=Object.prototype,Qo=Go.toString,Ko=Zo.hasOwnProperty,Xo=RegExp("^"+Qo.call(Ko).replace(Uo,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Jo(e){if(!Ze(e)||Vo(e))return!1;var r=Zn(e)?Xo:qo;return r.test(st(e))}function ei(e,r){return e==null?void 0:e[r]}function at(e,r){var t=ei(e,r);return Jo(t)?t:void 0}var ti=at(Ye,"WeakMap");const Vr=ti;var Kn=Object.create,ri=function(){function e(){}return function(r){if(!Ze(r))return{};if(Kn)return Kn(r);e.prototype=r;var t=new e;return e.prototype=void 0,t}}();const ni=ri;function si(e,r){var t=-1,n=e.length;for(r||(r=Array(n));++t<n;)r[t]=e[t];return r}var ai=function(){try{var e=at(Object,"defineProperty");return e({},"",{}),e}catch{}}();const Xn=ai;function oi(e,r){for(var t=-1,n=e==null?0:e.length;++t<n&&r(e[t],t,e)!==!1;);return e}var ii=9007199254740991,ci=/^(?:0|[1-9]\d*)$/;function ui(e,r){var t=typeof e;return r=r??ii,!!r&&(t=="number"||t!="symbol"&&ci.test(e))&&e>-1&&e%1==0&&e<r}function Jn(e,r,t){r=="__proto__"&&Xn?Xn(e,r,{configurable:!0,enumerable:!0,value:t,writable:!0}):e[r]=t}function es(e,r){return e===r||e!==e&&r!==r}var li=Object.prototype,fi=li.hasOwnProperty;function ts(e,r,t){var n=e[r];(!(fi.call(e,r)&&es(n,t))||t===void 0&&!(r in e))&&Jn(e,r,t)}function ur(e,r,t,n){var s=!t;t||(t={});for(var a=-1,o=r.length;++a<o;){var i=r[a],c=n?n(t[i],e[i],i,t,e):void 0;c===void 0&&(c=e[i]),s?Jn(t,i,c):ts(t,i,c)}return t}var di=9007199254740991;function rs(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=di}function ns(e){return e!=null&&rs(e.length)&&!Zn(e)}var hi=Object.prototype;function Br(e){var r=e&&e.constructor,t=typeof r=="function"&&r.prototype||hi;return e===t}function pi(e,r){for(var t=-1,n=Array(e);++t<e;)n[t]=r(t);return n}var mi="[object Arguments]";function ss(e){return yt(e)&&gt(e)==mi}var as=Object.prototype,bi=as.hasOwnProperty,gi=as.propertyIsEnumerable,yi=ss(function(){return arguments}())?ss:function(e){return yt(e)&&bi.call(e,"callee")&&!gi.call(e,"callee")};const vi=yi;function xi(){return!1}var os=typeof X=="object"&&X&&!X.nodeType&&X,is=os&&typeof module=="object"&&module&&!module.nodeType&&module,wi=is&&is.exports===os,cs=wi?Ye.Buffer:void 0,Ti=cs?cs.isBuffer:void 0,Si=Ti||xi;const us=Si;var Pi="[object Arguments]",Ei="[object Array]",ki="[object Boolean]",Ci="[object Date]",Di="[object Error]",Oi="[object Function]",_i="[object Map]",Ni="[object Number]",Ii="[object Object]",ji="[object RegExp]",Mi="[object Set]",Ri="[object String]",Ai="[object WeakMap]",Li="[object ArrayBuffer]",$i="[object DataView]",Fi="[object Float32Array]",Yi="[object Float64Array]",Hi="[object Int8Array]",Wi="[object Int16Array]",Vi="[object Int32Array]",Bi="[object Uint8Array]",zi="[object Uint8ClampedArray]",Ui="[object Uint16Array]",qi="[object Uint32Array]",ve={};ve[Fi]=ve[Yi]=ve[Hi]=ve[Wi]=ve[Vi]=ve[Bi]=ve[zi]=ve[Ui]=ve[qi]=!0,ve[Pi]=ve[Ei]=ve[Li]=ve[ki]=ve[$i]=ve[Ci]=ve[Di]=ve[Oi]=ve[_i]=ve[Ni]=ve[Ii]=ve[ji]=ve[Mi]=ve[Ri]=ve[Ai]=!1;function Gi(e){return yt(e)&&rs(e.length)&&!!ve[gt(e)]}function zr(e){return function(r){return e(r)}}var ls=typeof X=="object"&&X&&!X.nodeType&&X,Yt=ls&&typeof module=="object"&&module&&!module.nodeType&&module,Zi=Yt&&Yt.exports===ls,Ur=Zi&&Bn.process,Qi=function(){try{var e=Yt&&Yt.require&&Yt.require("util").types;return e||Ur&&Ur.binding&&Ur.binding("util")}catch{}}();const vt=Qi;var fs=vt&&vt.isTypedArray,Ki=fs?zr(fs):Gi;const Xi=Ki;var Ji=Object.prototype,ec=Ji.hasOwnProperty;function ds(e,r){var t=Hr(e),n=!t&&vi(e),s=!t&&!n&&us(e),a=!t&&!n&&!s&&Xi(e),o=t||n||s||a,i=o?pi(e.length,String):[],c=i.length;for(var f in e)(r||ec.call(e,f))&&!(o&&(f=="length"||s&&(f=="offset"||f=="parent")||a&&(f=="buffer"||f=="byteLength"||f=="byteOffset")||ui(f,c)))&&i.push(f);return i}function hs(e,r){return function(t){return e(r(t))}}var tc=hs(Object.keys,Object);const rc=tc;var nc=Object.prototype,sc=nc.hasOwnProperty;function ac(e){if(!Br(e))return rc(e);var r=[];for(var t in Object(e))sc.call(e,t)&&t!="constructor"&&r.push(t);return r}function qr(e){return ns(e)?ds(e):ac(e)}function oc(e){var r=[];if(e!=null)for(var t in Object(e))r.push(t);return r}var ic=Object.prototype,cc=ic.hasOwnProperty;function uc(e){if(!Ze(e))return oc(e);var r=Br(e),t=[];for(var n in e)n=="constructor"&&(r||!cc.call(e,n))||t.push(n);return t}function Gr(e){return ns(e)?ds(e,!0):uc(e)}var lc=at(Object,"create");const Ht=lc;function fc(){this.__data__=Ht?Ht(null):{},this.size=0}function dc(e){var r=this.has(e)&&delete this.__data__[e];return this.size-=r?1:0,r}var hc="__lodash_hash_undefined__",pc=Object.prototype,mc=pc.hasOwnProperty;function bc(e){var r=this.__data__;if(Ht){var t=r[e];return t===hc?void 0:t}return mc.call(r,e)?r[e]:void 0}var gc=Object.prototype,yc=gc.hasOwnProperty;function vc(e){var r=this.__data__;return Ht?r[e]!==void 0:yc.call(r,e)}var xc="__lodash_hash_undefined__";function wc(e,r){var t=this.__data__;return this.size+=this.has(e)?0:1,t[e]=Ht&&r===void 0?xc:r,this}function ot(e){var r=-1,t=e==null?0:e.length;for(this.clear();++r<t;){var n=e[r];this.set(n[0],n[1])}}ot.prototype.clear=fc,ot.prototype.delete=dc,ot.prototype.get=bc,ot.prototype.has=vc,ot.prototype.set=wc;function Tc(){this.__data__=[],this.size=0}function lr(e,r){for(var t=e.length;t--;)if(es(e[t][0],r))return t;return-1}var Sc=Array.prototype,Pc=Sc.splice;function Ec(e){var r=this.__data__,t=lr(r,e);if(t<0)return!1;var n=r.length-1;return t==n?r.pop():Pc.call(r,t,1),--this.size,!0}function kc(e){var r=this.__data__,t=lr(r,e);return t<0?void 0:r[t][1]}function Cc(e){return lr(this.__data__,e)>-1}function Dc(e,r){var t=this.__data__,n=lr(t,e);return n<0?(++this.size,t.push([e,r])):t[n][1]=r,this}function Qe(e){var r=-1,t=e==null?0:e.length;for(this.clear();++r<t;){var n=e[r];this.set(n[0],n[1])}}Qe.prototype.clear=Tc,Qe.prototype.delete=Ec,Qe.prototype.get=kc,Qe.prototype.has=Cc,Qe.prototype.set=Dc;var Oc=at(Ye,"Map");const Wt=Oc;function _c(){this.size=0,this.__data__={hash:new ot,map:new(Wt||Qe),string:new ot}}function Nc(e){var r=typeof e;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?e!=="__proto__":e===null}function fr(e,r){var t=e.__data__;return Nc(r)?t[typeof r=="string"?"string":"hash"]:t.map}function Ic(e){var r=fr(this,e).delete(e);return this.size-=r?1:0,r}function jc(e){return fr(this,e).get(e)}function Mc(e){return fr(this,e).has(e)}function Rc(e,r){var t=fr(this,e),n=t.size;return t.set(e,r),this.size+=t.size==n?0:1,this}function xt(e){var r=-1,t=e==null?0:e.length;for(this.clear();++r<t;){var n=e[r];this.set(n[0],n[1])}}xt.prototype.clear=_c,xt.prototype.delete=Ic,xt.prototype.get=jc,xt.prototype.has=Mc,xt.prototype.set=Rc;function ps(e,r){for(var t=-1,n=r.length,s=e.length;++t<n;)e[s+t]=r[t];return e}var Ac=hs(Object.getPrototypeOf,Object);const ms=Ac;function Lc(){this.__data__=new Qe,this.size=0}function $c(e){var r=this.__data__,t=r.delete(e);return this.size=r.size,t}function Fc(e){return this.__data__.get(e)}function Yc(e){return this.__data__.has(e)}var Hc=200;function Wc(e,r){var t=this.__data__;if(t instanceof Qe){var n=t.__data__;if(!Wt||n.length<Hc-1)return n.push([e,r]),this.size=++t.size,this;t=this.__data__=new xt(n)}return t.set(e,r),this.size=t.size,this}function wt(e){var r=this.__data__=new Qe(e);this.size=r.size}wt.prototype.clear=Lc,wt.prototype.delete=$c,wt.prototype.get=Fc,wt.prototype.has=Yc,wt.prototype.set=Wc;function Vc(e,r){return e&&ur(r,qr(r),e)}function Bc(e,r){return e&&ur(r,Gr(r),e)}var bs=typeof X=="object"&&X&&!X.nodeType&&X,gs=bs&&typeof module=="object"&&module&&!module.nodeType&&module,zc=gs&&gs.exports===bs,ys=zc?Ye.Buffer:void 0,vs=ys?ys.allocUnsafe:void 0;function Uc(e,r){if(r)return e.slice();var t=e.length,n=vs?vs(t):new e.constructor(t);return e.copy(n),n}function qc(e,r){for(var t=-1,n=e==null?0:e.length,s=0,a=[];++t<n;){var o=e[t];r(o,t,e)&&(a[s++]=o)}return a}function xs(){return[]}var Gc=Object.prototype,Zc=Gc.propertyIsEnumerable,ws=Object.getOwnPropertySymbols,Qc=ws?function(e){return e==null?[]:(e=Object(e),qc(ws(e),function(r){return Zc.call(e,r)}))}:xs;const Zr=Qc;function Kc(e,r){return ur(e,Zr(e),r)}var Xc=Object.getOwnPropertySymbols,Jc=Xc?function(e){for(var r=[];e;)ps(r,Zr(e)),e=ms(e);return r}:xs;const Ts=Jc;function eu(e,r){return ur(e,Ts(e),r)}function Ss(e,r,t){var n=r(e);return Hr(e)?n:ps(n,t(e))}function tu(e){return Ss(e,qr,Zr)}function ru(e){return Ss(e,Gr,Ts)}var nu=at(Ye,"DataView");const Qr=nu;var su=at(Ye,"Promise");const Kr=su;var au=at(Ye,"Set");const Xr=au;var Ps="[object Map]",ou="[object Object]",Es="[object Promise]",ks="[object Set]",Cs="[object WeakMap]",Ds="[object DataView]",iu=st(Qr),cu=st(Wt),uu=st(Kr),lu=st(Xr),fu=st(Vr),it=gt;(Qr&&it(new Qr(new ArrayBuffer(1)))!=Ds||Wt&&it(new Wt)!=Ps||Kr&&it(Kr.resolve())!=Es||Xr&&it(new Xr)!=ks||Vr&&it(new Vr)!=Cs)&&(it=function(e){var r=gt(e),t=r==ou?e.constructor:void 0,n=t?st(t):"";if(n)switch(n){case iu:return Ds;case cu:return Ps;case uu:return Es;case lu:return ks;case fu:return Cs}return r});const Jr=it;var du=Object.prototype,hu=du.hasOwnProperty;function pu(e){var r=e.length,t=new e.constructor(r);return r&&typeof e[0]=="string"&&hu.call(e,"index")&&(t.index=e.index,t.input=e.input),t}var mu=Ye.Uint8Array;const Os=mu;function en(e){var r=new e.constructor(e.byteLength);return new Os(r).set(new Os(e)),r}function bu(e,r){var t=r?en(e.buffer):e.buffer;return new e.constructor(t,e.byteOffset,e.byteLength)}var gu=/\w*$/;function yu(e){var r=new e.constructor(e.source,gu.exec(e));return r.lastIndex=e.lastIndex,r}var _s=bt?bt.prototype:void 0,Ns=_s?_s.valueOf:void 0;function vu(e){return Ns?Object(Ns.call(e)):{}}function xu(e,r){var t=r?en(e.buffer):e.buffer;return new e.constructor(t,e.byteOffset,e.length)}var wu="[object Boolean]",Tu="[object Date]",Su="[object Map]",Pu="[object Number]",Eu="[object RegExp]",ku="[object Set]",Cu="[object String]",Du="[object Symbol]",Ou="[object ArrayBuffer]",_u="[object DataView]",Nu="[object Float32Array]",Iu="[object Float64Array]",ju="[object Int8Array]",Mu="[object Int16Array]",Ru="[object Int32Array]",Au="[object Uint8Array]",Lu="[object Uint8ClampedArray]",$u="[object Uint16Array]",Fu="[object Uint32Array]";function Yu(e,r,t){var n=e.constructor;switch(r){case Ou:return en(e);case wu:case Tu:return new n(+e);case _u:return bu(e,t);case Nu:case Iu:case ju:case Mu:case Ru:case Au:case Lu:case $u:case Fu:return xu(e,t);case Su:return new n;case Pu:case Cu:return new n(e);case Eu:return yu(e);case ku:return new n;case Du:return vu(e)}}function Hu(e){return typeof e.constructor=="function"&&!Br(e)?ni(ms(e)):{}}var Wu="[object Map]";function Vu(e){return yt(e)&&Jr(e)==Wu}var Is=vt&&vt.isMap,Bu=Is?zr(Is):Vu;const zu=Bu;var Uu="[object Set]";function qu(e){return yt(e)&&Jr(e)==Uu}var js=vt&&vt.isSet,Gu=js?zr(js):qu;const Zu=Gu;var Qu=1,Ku=2,Xu=4,Ms="[object Arguments]",Ju="[object Array]",el="[object Boolean]",tl="[object Date]",rl="[object Error]",Rs="[object Function]",nl="[object GeneratorFunction]",sl="[object Map]",al="[object Number]",As="[object Object]",ol="[object RegExp]",il="[object Set]",cl="[object String]",ul="[object Symbol]",ll="[object WeakMap]",fl="[object ArrayBuffer]",dl="[object DataView]",hl="[object Float32Array]",pl="[object Float64Array]",ml="[object Int8Array]",bl="[object Int16Array]",gl="[object Int32Array]",yl="[object Uint8Array]",vl="[object Uint8ClampedArray]",xl="[object Uint16Array]",wl="[object Uint32Array]",ge={};ge[Ms]=ge[Ju]=ge[fl]=ge[dl]=ge[el]=ge[tl]=ge[hl]=ge[pl]=ge[ml]=ge[bl]=ge[gl]=ge[sl]=ge[al]=ge[As]=ge[ol]=ge[il]=ge[cl]=ge[ul]=ge[yl]=ge[vl]=ge[xl]=ge[wl]=!0,ge[rl]=ge[Rs]=ge[ll]=!1;function dr(e,r,t,n,s,a){var o,i=r&Qu,c=r&Ku,f=r&Xu;if(t&&(o=s?t(e,n,s,a):t(e)),o!==void 0)return o;if(!Ze(e))return e;var h=Hr(e);if(h){if(o=pu(e),!i)return si(e,o)}else{var p=Jr(e),y=p==Rs||p==nl;if(us(e))return Uc(e,i);if(p==As||p==Ms||y&&!s){if(o=c||y?{}:Hu(e),!i)return c?eu(e,Bc(o,e)):Kc(e,Vc(o,e))}else{if(!ge[p])return s?e:{};o=Yu(e,p,i)}}a||(a=new wt);var x=a.get(e);if(x)return x;a.set(e,o),Zu(e)?e.forEach(function(O){o.add(dr(O,r,t,O,e,a))}):zu(e)&&e.forEach(function(O,S){o.set(S,dr(O,r,t,S,e,a))});var w=f?c?ru:tu:c?Gr:qr,D=h?void 0:w(e);return oi(D||e,function(O,S){D&&(S=O,O=e[S]),ts(o,S,dr(O,r,t,S,e,a))}),o}var Tl=1,Sl=4;function Pl(e){return dr(e,Tl|Sl)}var El=function(){return Ye.Date.now()};const tn=El;var kl="Expected a function",Cl=Math.max,Dl=Math.min;function Vt(e,r,t){var n,s,a,o,i,c,f=0,h=!1,p=!1,y=!0;if(typeof e!="function")throw new TypeError(kl);r=Gn(r)||0,Ze(t)&&(h=!!t.leading,p="maxWait"in t,a=p?Cl(Gn(t.maxWait)||0,r):a,y="trailing"in t?!!t.trailing:y);function x(A){var k=n,V=s;return n=s=void 0,f=A,o=e.apply(V,k),o}function w(A){return f=A,i=setTimeout(S,r),h?x(A):o}function D(A){var k=A-c,V=A-f,B=r-k;return p?Dl(B,a-V):B}function O(A){var k=A-c,V=A-f;return c===void 0||k>=r||k<0||p&&V>=a}function S(){var A=tn();if(O(A))return R(A);i=setTimeout(S,D(A))}function R(A){return i=void 0,y&&n?x(A):(n=s=void 0,o)}function U(){i!==void 0&&clearTimeout(i),f=0,n=c=s=i=void 0}function F(){return i===void 0?o:R(tn())}function b(){var A=tn(),k=O(A);if(n=arguments,s=this,c=A,k){if(i===void 0)return w(c);if(p)return clearTimeout(i),i=setTimeout(S,r),x(c)}return i===void 0&&(i=setTimeout(S,r)),o}return b.cancel=U,b.flush=F,b}var Ol="Expected a function";function _l(e,r,t){var n=!0,s=!0;if(typeof e!="function")throw new TypeError(Ol);return Ze(t)&&(n="leading"in t?!!t.leading:n,s="trailing"in t?!!t.trailing:s),Vt(e,r,{leading:n,maxWait:r,trailing:s})}const Nl=(e,r)=>{const{value:t,readOnly:n=!1,debounceTime:s=800,fillContainer:a=!0,leftElement:o,rightElement:i,className:c,leftElementClassName:f,rightElementClassName:h,isSingleLine:p=!0,allowSingleLineScroll:y=!1,inputMode:x,placeholder:w,onFocus:D,onBlur:O,onInput:S,onInnerTextChange:R,onInnerHTMLChange:U,onElementCreate:F,onLeftElementClick:b,onRightElementClick:A}=e,k=d.useRef("bsc-flex-grow focus:bsc-outline-none"),V=d.useRef("bsc-text-gray-4"),B=d.useRef(),ne=d.useCallback(E=>{const Y=E.target,q=Y.innerHTML;Y.className=`${k.current}`,w&&q===w&&(Y.innerHTML=""),D==null||D(E)},[w,D]),te=d.useCallback(E=>{const Y=E.target.innerHTML;if(w&&Y===""){const q=E.target;q.innerHTML=w,q.className=`${k.current} ${V.current}`}O==null||O(E)},[w,O]),J=d.useCallback(E=>{var Y,q;(Y=B.current)==null||Y.removeEventListener("focus",ne),(q=B.current)==null||q.removeEventListener("blur",te),w&&E&&E!==document.activeElement&&E.innerHTML===""&&(E.innerHTML=w,E.className=`${k.current} ${V.current}`),E.addEventListener("focus",ne),E.addEventListener("blur",te),B.current=E},[w]),N=d.useCallback(E=>{F==null||F(E)},[F]),$=E=>{b==null||b(E)},I=E=>{A==null||A(E)},C=Vt(E=>{S==null||S(E),R==null||R(E.target.innerText),U==null||U(E.target.innerHTML)},s),G=d.useCallback(E=>{B.current&&(B.current.innerText=E)},[]),v=d.useCallback(E=>{B.current&&(B.current.innerHTML=E)},[]),ee=d.useCallback(()=>{var E;(E=B.current)==null||E.focus()},[]);d.useImperativeHandle(r,()=>({inputElement:B.current,setInnerText:G,setInnerHTML:v,focus:ee}));const g=ie({"bsc-w-full ":a},"bsc-flex bsc-flex-row bsc-items-center bsc-shadow-sm bsc-border bsc-border-solid bsc-border-gray-3 dark:bsc-border-white dark:bsc-bg-mono-dark-1 dark:bsc-text-mono-light-1 bsc-rounded-md bsc-p-2",{"bsc-overflow-x-auto bsc-overflow-y-hidden bsc-whitespace-pre":p&&y,"bsc-overflow-hidden bsc-whitespace-pre":p&&!y},c),_=ie("bsc-flex-shrink",{"bsc-mr-2":o},f),z=ie("bsc-flex-shrink",{"bsc-ml-2":i},h);return l.jsxs("div",{className:g,ref:E=>E&&N(E),children:[o&&l.jsx("div",{className:_,onClick:$,children:o}),l.jsx("div",{ref:E=>E&&J(E),className:k.current,contentEditable:!n,suppressContentEditableWarning:!0,inputMode:x,onInput:C,children:t}),i&&l.jsx("div",{className:z,onClick:I,children:i})]})},hr=d.forwardRef(Nl);function le(e){const r=Object.prototype.toString.call(e);return e instanceof Date||typeof e=="object"&&r==="[object Date]"?new e.constructor(+e):typeof e=="number"||r==="[object Number]"||typeof e=="string"||r==="[object String]"?new Date(e):new Date(NaN)}function ye(e,r){return e instanceof Date?new e.constructor(r):new Date(r)}function Tt(e,r){const t=le(e);return isNaN(r)?ye(e,NaN):(r&&t.setDate(t.getDate()+r),t)}function ct(e,r){const t=le(e);if(isNaN(r))return ye(e,NaN);if(!r)return t;const n=t.getDate(),s=ye(e,t.getTime());s.setMonth(t.getMonth()+r+1,0);const a=s.getDate();return n>=a?s:(t.setFullYear(s.getFullYear(),s.getMonth(),n),t)}const Ls=6048e5,rn=6e4,nn=36e5,Il=1e3;let jl={};function Bt(){return jl}function tt(e,r){var i,c,f,h;const t=Bt(),n=(r==null?void 0:r.weekStartsOn)??((c=(i=r==null?void 0:r.locale)==null?void 0:i.options)==null?void 0:c.weekStartsOn)??t.weekStartsOn??((h=(f=t.locale)==null?void 0:f.options)==null?void 0:h.weekStartsOn)??0,s=le(e),a=s.getDay(),o=(a<n?7:0)+a-n;return s.setDate(s.getDate()-o),s.setHours(0,0,0,0),s}function St(e){return tt(e,{weekStartsOn:1})}function Ml(e){const r=le(e),t=r.getFullYear(),n=ye(e,0);n.setFullYear(t+1,0,4),n.setHours(0,0,0,0);const s=St(n),a=ye(e,0);a.setFullYear(t,0,4),a.setHours(0,0,0,0);const o=St(a);return r.getTime()>=s.getTime()?t+1:r.getTime()>=o.getTime()?t:t-1}function $s(e){const r=le(e);return r.setHours(0,0,0,0),r}function Fs(e){const r=le(e),t=new Date(Date.UTC(r.getFullYear(),r.getMonth(),r.getDate(),r.getHours(),r.getMinutes(),r.getSeconds(),r.getMilliseconds()));return t.setUTCFullYear(r.getFullYear()),+e-+t}function Rl(e){const r=Ml(e),t=ye(e,0);return t.setFullYear(r,0,4),t.setHours(0,0,0,0),St(t)}function pr(e,r){return ct(e,r*12)}function Ys(e,r){const t=$s(e),n=$s(r);return+t==+n}function Al(e){const r=le(e),t=r.getMonth();return r.setFullYear(r.getFullYear(),t+1,0),r.setHours(23,59,59,999),r}function Ll(e,r){const t=le(e.start),n=le(e.end);let s=+t>+n;const a=s?+t:+n,o=s?n:t;o.setHours(0,0,0,0);let i=(r==null?void 0:r.step)??1;if(!i)return[];i<0&&(i=-i,s=!s);const c=[];for(;+o<=a;)c.push(le(o)),o.setDate(o.getDate()+i),o.setHours(0,0,0,0);return s?c.reverse():c}function Hs(e){const r=le(e);return r.setDate(1),r.setHours(0,0,0,0),r}function $l(e,r){const t=le(e.start),n=le(e.end);let s=+t>+n;const a=s?+t:+n,o=s?n:t;o.setHours(0,0,0,0),o.setMonth(0,1);let i=(r==null?void 0:r.step)??1;if(!i)return[];i<0&&(i=-i,s=!s);const c=[];for(;+o<=a;)c.push(le(o)),o.setFullYear(o.getFullYear()+i);return s?c.reverse():c}const Fl={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"}},Yl=(e,r,t)=>{let n;const s=Fl[e];return typeof s=="string"?n=s:r===1?n=s.one:n=s.other.replace("{{count}}",r.toString()),t!=null&&t.addSuffix?t.comparison&&t.comparison>0?"in "+n:n+" ago":n};function sn(e){return(r={})=>{const t=r.width?String(r.width):e.defaultWidth;return e.formats[t]||e.formats[e.defaultWidth]}}const Hl={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Wl={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Vl={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Bl={date:sn({formats:Hl,defaultWidth:"full"}),time:sn({formats:Wl,defaultWidth:"full"}),dateTime:sn({formats:Vl,defaultWidth:"full"})},zl={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Ul=(e,r,t,n)=>zl[e];function zt(e){return(r,t)=>{const n=t!=null&&t.context?String(t.context):"standalone";let s;if(n==="formatting"&&e.formattingValues){const o=e.defaultFormattingWidth||e.defaultWidth,i=t!=null&&t.width?String(t.width):o;s=e.formattingValues[i]||e.formattingValues[o]}else{const o=e.defaultWidth,i=t!=null&&t.width?String(t.width):e.defaultWidth;s=e.values[i]||e.values[o]}const a=e.argumentCallback?e.argumentCallback(r):r;return s[a]}}const ql={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Gl={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Zl={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"]},Ql={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"]},Kl={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"}},Xl={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"}},Jl={ordinalNumber:(e,r)=>{const t=Number(e),n=t%100;if(n>20||n<10)switch(n%10){case 1:return t+"st";case 2:return t+"nd";case 3:return t+"rd"}return t+"th"},era:zt({values:ql,defaultWidth:"wide"}),quarter:zt({values:Gl,defaultWidth:"wide",argumentCallback:e=>e-1}),month:zt({values:Zl,defaultWidth:"wide"}),day:zt({values:Ql,defaultWidth:"wide"}),dayPeriod:zt({values:Kl,defaultWidth:"wide",formattingValues:Xl,defaultFormattingWidth:"wide"})};function Ut(e){return(r,t={})=>{const n=t.width,s=n&&e.matchPatterns[n]||e.matchPatterns[e.defaultMatchWidth],a=r.match(s);if(!a)return null;const o=a[0],i=n&&e.parsePatterns[n]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(i)?tf(i,p=>p.test(o)):ef(i,p=>p.test(o));let f;f=e.valueCallback?e.valueCallback(c):c,f=t.valueCallback?t.valueCallback(f):f;const h=r.slice(o.length);return{value:f,rest:h}}}function ef(e,r){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&r(e[t]))return t}function tf(e,r){for(let t=0;t<e.length;t++)if(r(e[t]))return t}function rf(e){return(r,t={})=>{const n=r.match(e.matchPattern);if(!n)return null;const s=n[0],a=r.match(e.parsePattern);if(!a)return null;let o=e.valueCallback?e.valueCallback(a[0]):a[0];o=t.valueCallback?t.valueCallback(o):o;const i=r.slice(s.length);return{value:o,rest:i}}}const nf=/^(\d+)(th|st|nd|rd)?/i,sf=/\d+/i,af={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},of={any:[/^b/i,/^(a|c)/i]},cf={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},uf={any:[/1/i,/2/i,/3/i,/4/i]},lf={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},ff={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]},df={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},hf={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]},pf={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},mf={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}},bf={ordinalNumber:rf({matchPattern:nf,parsePattern:sf,valueCallback:e=>parseInt(e,10)}),era:Ut({matchPatterns:af,defaultMatchWidth:"wide",parsePatterns:of,defaultParseWidth:"any"}),quarter:Ut({matchPatterns:cf,defaultMatchWidth:"wide",parsePatterns:uf,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Ut({matchPatterns:lf,defaultMatchWidth:"wide",parsePatterns:ff,defaultParseWidth:"any"}),day:Ut({matchPatterns:df,defaultMatchWidth:"wide",parsePatterns:hf,defaultParseWidth:"any"}),dayPeriod:Ut({matchPatterns:pf,defaultMatchWidth:"any",parsePatterns:mf,defaultParseWidth:"any"})},gf={code:"en-US",formatDistance:Yl,formatLong:Bl,formatRelative:Ul,localize:Jl,match:bf,options:{weekStartsOn:0,firstWeekContainsDate:1}};function yf(e){const r=le(e),t=+St(r)-+Rl(r);return Math.round(t/Ls)+1}function Ws(e,r){var h,p,y,x;const t=le(e),n=t.getFullYear(),s=Bt(),a=(r==null?void 0:r.firstWeekContainsDate)??((p=(h=r==null?void 0:r.locale)==null?void 0:h.options)==null?void 0:p.firstWeekContainsDate)??s.firstWeekContainsDate??((x=(y=s.locale)==null?void 0:y.options)==null?void 0:x.firstWeekContainsDate)??1,o=ye(e,0);o.setFullYear(n+1,0,a),o.setHours(0,0,0,0);const i=tt(o,r),c=ye(e,0);c.setFullYear(n,0,a),c.setHours(0,0,0,0);const f=tt(c,r);return t.getTime()>=i.getTime()?n+1:t.getTime()>=f.getTime()?n:n-1}function vf(e,r){var i,c,f,h;const t=Bt(),n=(r==null?void 0:r.firstWeekContainsDate)??((c=(i=r==null?void 0:r.locale)==null?void 0:i.options)==null?void 0:c.firstWeekContainsDate)??t.firstWeekContainsDate??((h=(f=t.locale)==null?void 0:f.options)==null?void 0:h.firstWeekContainsDate)??1,s=Ws(e,r),a=ye(e,0);return a.setFullYear(s,0,n),a.setHours(0,0,0,0),tt(a,r)}function xf(e,r){const t=le(e),n=+tt(t,r)-+vf(t,r);return Math.round(n/Ls)+1}const Vs=(e,r)=>{switch(e){case"P":return r.date({width:"short"});case"PP":return r.date({width:"medium"});case"PPP":return r.date({width:"long"});case"PPPP":default:return r.date({width:"full"})}},Bs=(e,r)=>{switch(e){case"p":return r.time({width:"short"});case"pp":return r.time({width:"medium"});case"ppp":return r.time({width:"long"});case"pppp":default:return r.time({width:"full"})}},zs={p:Bs,P:(e,r)=>{const t=e.match(/(P+)(p+)?/)||[],n=t[1],s=t[2];if(!s)return Vs(e,r);let a;switch(n){case"P":a=r.dateTime({width:"short"});break;case"PP":a=r.dateTime({width:"medium"});break;case"PPP":a=r.dateTime({width:"long"});break;case"PPPP":default:a=r.dateTime({width:"full"});break}return a.replace("{{date}}",Vs(n,r)).replace("{{time}}",Bs(s,r))}},wf=/^D+$/,Tf=/^Y+$/,Sf=["D","DD","YY","YYYY"];function Pf(e){return wf.test(e)}function Ef(e){return Tf.test(e)}function Us(e,r,t){const n=kf(e,r,t);if(console.warn(n),Sf.includes(e))throw new RangeError(n)}function kf(e,r,t){const n=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${r}\`) for formatting ${n} to the input \`${t}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}function an(e){return le(e).getDay()}function qs(e){const r=le(e),t=r.getFullYear(),n=r.getMonth(),s=ye(e,0);return s.setFullYear(t,n+1,0),s.setHours(0,0,0,0),s.getDate()}function Cf(){return Object.assign({},Bt())}function Df(e){let t=le(e).getDay();return t===0&&(t=7),t}function Of(e){const r=le(e),t=r.getMonth();return r.setFullYear(r.getFullYear(),t+1,0),r.setHours(0,0,0,0),r}function _f(e,r){const t=le(e),n=le(r);return+t<+n}function Nf(e,r){const t=r instanceof Date?ye(r,0):new r(0);return t.setFullYear(e.getFullYear(),e.getMonth(),e.getDate()),t.setHours(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()),t}const If=10;class Gs{constructor(){m(this,"subPriority",0)}validate(r,t){return!0}}class jf extends Gs{constructor(r,t,n,s,a){super(),this.value=r,this.validateValue=t,this.setValue=n,this.priority=s,a&&(this.subPriority=a)}validate(r,t){return this.validateValue(r,this.value,t)}set(r,t,n){return this.setValue(r,t,this.value,n)}}class Mf extends Gs{constructor(){super(...arguments);m(this,"priority",If);m(this,"subPriority",-1)}set(t,n){return n.timestampIsSet?t:ye(t,Nf(t,Date))}}class fe{run(r,t,n,s){const a=this.parse(r,t,n,s);return a?{setter:new jf(a.value,this.validate,this.set,this.priority,this.subPriority),rest:a.rest}:null}validate(r,t,n){return!0}}class Rf extends fe{constructor(){super(...arguments);m(this,"priority",140);m(this,"incompatibleTokens",["R","u","t","T"])}parse(t,n,s){switch(n){case"G":case"GG":case"GGG":return s.era(t,{width:"abbreviated"})||s.era(t,{width:"narrow"});case"GGGGG":return s.era(t,{width:"narrow"});case"GGGG":default:return s.era(t,{width:"wide"})||s.era(t,{width:"abbreviated"})||s.era(t,{width:"narrow"})}}set(t,n,s){return n.era=s,t.setFullYear(s,0,1),t.setHours(0,0,0,0),t}}const Ee={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}/},Be={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 ke(e,r){return e&&{value:r(e.value),rest:e.rest}}function we(e,r){const t=r.match(e);return t?{value:parseInt(t[0],10),rest:r.slice(t[0].length)}:null}function ze(e,r){const t=r.match(e);if(!t)return null;if(t[0]==="Z")return{value:0,rest:r.slice(1)};const n=t[1]==="+"?1:-1,s=t[2]?parseInt(t[2],10):0,a=t[3]?parseInt(t[3],10):0,o=t[5]?parseInt(t[5],10):0;return{value:n*(s*nn+a*rn+o*Il),rest:r.slice(t[0].length)}}function Zs(e){return we(Ee.anyDigitsSigned,e)}function Se(e,r){switch(e){case 1:return we(Ee.singleDigit,r);case 2:return we(Ee.twoDigits,r);case 3:return we(Ee.threeDigits,r);case 4:return we(Ee.fourDigits,r);default:return we(new RegExp("^\\d{1,"+e+"}"),r)}}function mr(e,r){switch(e){case 1:return we(Ee.singleDigitSigned,r);case 2:return we(Ee.twoDigitsSigned,r);case 3:return we(Ee.threeDigitsSigned,r);case 4:return we(Ee.fourDigitsSigned,r);default:return we(new RegExp("^-?\\d{1,"+e+"}"),r)}}function on(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 Qs(e,r){const t=r>0,n=t?r:1-r;let s;if(n<=50)s=e||100;else{const a=n+50,o=Math.trunc(a/100)*100,i=e>=a%100;s=e+o-(i?100:0)}return t?s:1-s}function Ks(e){return e%400===0||e%4===0&&e%100!==0}class Af extends fe{constructor(){super(...arguments);m(this,"priority",130);m(this,"incompatibleTokens",["Y","R","u","w","I","i","e","c","t","T"])}parse(t,n,s){const a=o=>({year:o,isTwoDigitYear:n==="yy"});switch(n){case"y":return ke(Se(4,t),a);case"yo":return ke(s.ordinalNumber(t,{unit:"year"}),a);default:return ke(Se(n.length,t),a)}}validate(t,n){return n.isTwoDigitYear||n.year>0}set(t,n,s){const a=t.getFullYear();if(s.isTwoDigitYear){const i=Qs(s.year,a);return t.setFullYear(i,0,1),t.setHours(0,0,0,0),t}const o=!("era"in n)||n.era===1?s.year:1-s.year;return t.setFullYear(o,0,1),t.setHours(0,0,0,0),t}}class Lf extends fe{constructor(){super(...arguments);m(this,"priority",130);m(this,"incompatibleTokens",["y","R","u","Q","q","M","L","I","d","D","i","t","T"])}parse(t,n,s){const a=o=>({year:o,isTwoDigitYear:n==="YY"});switch(n){case"Y":return ke(Se(4,t),a);case"Yo":return ke(s.ordinalNumber(t,{unit:"year"}),a);default:return ke(Se(n.length,t),a)}}validate(t,n){return n.isTwoDigitYear||n.year>0}set(t,n,s,a){const o=Ws(t,a);if(s.isTwoDigitYear){const c=Qs(s.year,o);return t.setFullYear(c,0,a.firstWeekContainsDate),t.setHours(0,0,0,0),tt(t,a)}const i=!("era"in n)||n.era===1?s.year:1-s.year;return t.setFullYear(i,0,a.firstWeekContainsDate),t.setHours(0,0,0,0),tt(t,a)}}class $f extends fe{constructor(){super(...arguments);m(this,"priority",130);m(this,"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"])}parse(t,n){return mr(n==="R"?4:n.length,t)}set(t,n,s){const a=ye(t,0);return a.setFullYear(s,0,4),a.setHours(0,0,0,0),St(a)}}class Ff extends fe{constructor(){super(...arguments);m(this,"priority",130);m(this,"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"])}parse(t,n){return mr(n==="u"?4:n.length,t)}set(t,n,s){return t.setFullYear(s,0,1),t.setHours(0,0,0,0),t}}class Yf extends fe{constructor(){super(...arguments);m(this,"priority",120);m(this,"incompatibleTokens",["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"])}parse(t,n,s){switch(n){case"Q":case"QQ":return Se(n.length,t);case"Qo":return s.ordinalNumber(t,{unit:"quarter"});case"QQQ":return s.quarter(t,{width:"abbreviated",context:"formatting"})||s.quarter(t,{width:"narrow",context:"formatting"});case"QQQQQ":return s.quarter(t,{width:"narrow",context:"formatting"});case"QQQQ":default:return s.quarter(t,{width:"wide",context:"formatting"})||s.quarter(t,{width:"abbreviated",context:"formatting"})||s.quarter(t,{width:"narrow",context:"formatting"})}}validate(t,n){return n>=1&&n<=4}set(t,n,s){return t.setMonth((s-1)*3,1),t.setHours(0,0,0,0),t}}class Hf extends fe{constructor(){super(...arguments);m(this,"priority",120);m(this,"incompatibleTokens",["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"])}parse(t,n,s){switch(n){case"q":case"qq":return Se(n.length,t);case"qo":return s.ordinalNumber(t,{unit:"quarter"});case"qqq":return s.quarter(t,{width:"abbreviated",context:"standalone"})||s.quarter(t,{width:"narrow",context:"standalone"});case"qqqqq":return s.quarter(t,{width:"narrow",context:"standalone"});case"qqqq":default:return s.quarter(t,{width:"wide",context:"standalone"})||s.quarter(t,{width:"abbreviated",context:"standalone"})||s.quarter(t,{width:"narrow",context:"standalone"})}}validate(t,n){return n>=1&&n<=4}set(t,n,s){return t.setMonth((s-1)*3,1),t.setHours(0,0,0,0),t}}class Wf extends fe{constructor(){super(...arguments);m(this,"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]);m(this,"priority",110)}parse(t,n,s){const a=o=>o-1;switch(n){case"M":return ke(we(Ee.month,t),a);case"MM":return ke(Se(2,t),a);case"Mo":return ke(s.ordinalNumber(t,{unit:"month"}),a);case"MMM":return s.month(t,{width:"abbreviated",context:"formatting"})||s.month(t,{width:"narrow",context:"formatting"});case"MMMMM":return s.month(t,{width:"narrow",context:"formatting"});case"MMMM":default:return s.month(t,{width:"wide",context:"formatting"})||s.month(t,{width:"abbreviated",context:"formatting"})||s.month(t,{width:"narrow",context:"formatting"})}}validate(t,n){return n>=0&&n<=11}set(t,n,s){return t.setMonth(s,1),t.setHours(0,0,0,0),t}}class Vf extends fe{constructor(){super(...arguments);m(this,"priority",110);m(this,"incompatibleTokens",["Y","R","q","Q","M","w","I","D","i","e","c","t","T"])}parse(t,n,s){const a=o=>o-1;switch(n){case"L":return ke(we(Ee.month,t),a);case"LL":return ke(Se(2,t),a);case"Lo":return ke(s.ordinalNumber(t,{unit:"month"}),a);case"LLL":return s.month(t,{width:"abbreviated",context:"standalone"})||s.month(t,{width:"narrow",context:"standalone"});case"LLLLL":return s.month(t,{width:"narrow",context:"standalone"});case"LLLL":default:return s.month(t,{width:"wide",context:"standalone"})||s.month(t,{width:"abbreviated",context:"standalone"})||s.month(t,{width:"narrow",context:"standalone"})}}validate(t,n){return n>=0&&n<=11}set(t,n,s){return t.setMonth(s,1),t.setHours(0,0,0,0),t}}function Bf(e,r,t){const n=le(e),s=xf(n,t)-r;return n.setDate(n.getDate()-s*7),n}class zf extends fe{constructor(){super(...arguments);m(this,"priority",100);m(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"])}parse(t,n,s){switch(n){case"w":return we(Ee.week,t);case"wo":return s.ordinalNumber(t,{unit:"week"});default:return Se(n.length,t)}}validate(t,n){return n>=1&&n<=53}set(t,n,s,a){return tt(Bf(t,s,a),a)}}function Uf(e,r){const t=le(e),n=yf(t)-r;return t.setDate(t.getDate()-n*7),t}class qf extends fe{constructor(){super(...arguments);m(this,"priority",100);m(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"])}parse(t,n,s){switch(n){case"I":return we(Ee.week,t);case"Io":return s.ordinalNumber(t,{unit:"week"});default:return Se(n.length,t)}}validate(t,n){return n>=1&&n<=53}set(t,n,s){return St(Uf(t,s))}}const Gf=[31,28,31,30,31,30,31,31,30,31,30,31],Zf=[31,29,31,30,31,30,31,31,30,31,30,31];class Qf extends fe{constructor(){super(...arguments);m(this,"priority",90);m(this,"subPriority",1);m(this,"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"])}parse(t,n,s){switch(n){case"d":return we(Ee.date,t);case"do":return s.ordinalNumber(t,{unit:"date"});default:return Se(n.length,t)}}validate(t,n){const s=t.getFullYear(),a=Ks(s),o=t.getMonth();return a?n>=1&&n<=Zf[o]:n>=1&&n<=Gf[o]}set(t,n,s){return t.setDate(s),t.setHours(0,0,0,0),t}}class Kf extends fe{constructor(){super(...arguments);m(this,"priority",90);m(this,"subpriority",1);m(this,"incompatibleTokens",["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"])}parse(t,n,s){switch(n){case"D":case"DD":return we(Ee.dayOfYear,t);case"Do":return s.ordinalNumber(t,{unit:"date"});default:return Se(n.length,t)}}validate(t,n){const s=t.getFullYear();return Ks(s)?n>=1&&n<=366:n>=1&&n<=365}set(t,n,s){return t.setMonth(0,s),t.setHours(0,0,0,0),t}}function cn(e,r,t){var p,y,x,w;const n=Bt(),s=(t==null?void 0:t.weekStartsOn)??((y=(p=t==null?void 0:t.locale)==null?void 0:p.options)==null?void 0:y.weekStartsOn)??n.weekStartsOn??((w=(x=n.locale)==null?void 0:x.options)==null?void 0:w.weekStartsOn)??0,a=le(e),o=a.getDay(),c=(r%7+7)%7,f=7-s,h=r<0||r>6?r-(o+f)%7:(c+f)%7-(o+f)%7;return Tt(a,h)}class Xf extends fe{constructor(){super(...arguments);m(this,"priority",90);m(this,"incompatibleTokens",["D","i","e","c","t","T"])}parse(t,n,s){switch(n){case"E":case"EE":case"EEE":return s.day(t,{width:"abbreviated",context:"formatting"})||s.day(t,{width:"short",context:"formatting"})||s.day(t,{width:"narrow",context:"formatting"});case"EEEEE":return s.day(t,{width:"narrow",context:"formatting"});case"EEEEEE":return s.day(t,{width:"short",context:"formatting"})||s.day(t,{width:"narrow",context:"formatting"});case"EEEE":default:return s.day(t,{width:"wide",context:"formatting"})||s.day(t,{width:"abbreviated",context:"formatting"})||s.day(t,{width:"short",context:"formatting"})||s.day(t,{width:"narrow",context:"formatting"})}}validate(t,n){return n>=0&&n<=6}set(t,n,s,a){return t=cn(t,s,a),t.setHours(0,0,0,0),t}}class Jf extends fe{constructor(){super(...arguments);m(this,"priority",90);m(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"])}parse(t,n,s,a){const o=i=>{const c=Math.floor((i-1)/7)*7;return(i+a.weekStartsOn+6)%7+c};switch(n){case"e":case"ee":return ke(Se(n.length,t),o);case"eo":return ke(s.ordinalNumber(t,{unit:"day"}),o);case"eee":return s.day(t,{width:"abbreviated",context:"formatting"})||s.day(t,{width:"short",context:"formatting"})||s.day(t,{width:"narrow",context:"formatting"});case"eeeee":return s.day(t,{width:"narrow",context:"formatting"});case"eeeeee":return s.day(t,{width:"short",context:"formatting"})||s.day(t,{width:"narrow",context:"formatting"});case"eeee":default:return s.day(t,{width:"wide",context:"formatting"})||s.day(t,{width:"abbreviated",context:"formatting"})||s.day(t,{width:"short",context:"formatting"})||s.day(t,{width:"narrow",context:"formatting"})}}validate(t,n){return n>=0&&n<=6}set(t,n,s,a){return t=cn(t,s,a),t.setHours(0,0,0,0),t}}class ed extends fe{constructor(){super(...arguments);m(this,"priority",90);m(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"])}parse(t,n,s,a){const o=i=>{const c=Math.floor((i-1)/7)*7;return(i+a.weekStartsOn+6)%7+c};switch(n){case"c":case"cc":return ke(Se(n.length,t),o);case"co":return ke(s.ordinalNumber(t,{unit:"day"}),o);case"ccc":return s.day(t,{width:"abbreviated",context:"standalone"})||s.day(t,{width:"short",context:"standalone"})||s.day(t,{width:"narrow",context:"standalone"});case"ccccc":return s.day(t,{width:"narrow",context:"standalone"});case"cccccc":return s.day(t,{width:"short",context:"standalone"})||s.day(t,{width:"narrow",context:"standalone"});case"cccc":default:return s.day(t,{width:"wide",context:"standalone"})||s.day(t,{width:"abbreviated",context:"standalone"})||s.day(t,{width:"short",context:"standalone"})||s.day(t,{width:"narrow",context:"standalone"})}}validate(t,n){return n>=0&&n<=6}set(t,n,s,a){return t=cn(t,s,a),t.setHours(0,0,0,0),t}}function td(e,r){const t=le(e),n=Df(t),s=r-n;return Tt(t,s)}class rd extends fe{constructor(){super(...arguments);m(this,"priority",90);m(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"])}parse(t,n,s){const a=o=>o===0?7:o;switch(n){case"i":case"ii":return Se(n.length,t);case"io":return s.ordinalNumber(t,{unit:"day"});case"iii":return ke(s.day(t,{width:"abbreviated",context:"formatting"})||s.day(t,{width:"short",context:"formatting"})||s.day(t,{width:"narrow",context:"formatting"}),a);case"iiiii":return ke(s.day(t,{width:"narrow",context:"formatting"}),a);case"iiiiii":return ke(s.day(t,{width:"short",context:"formatting"})||s.day(t,{width:"narrow",context:"formatting"}),a);case"iiii":default:return ke(s.day(t,{width:"wide",context:"formatting"})||s.day(t,{width:"abbreviated",context:"formatting"})||s.day(t,{width:"short",context:"formatting"})||s.day(t,{width:"narrow",context:"formatting"}),a)}}validate(t,n){return n>=1&&n<=7}set(t,n,s){return t=td(t,s),t.setHours(0,0,0,0),t}}class nd extends fe{constructor(){super(...arguments);m(this,"priority",80);m(this,"incompatibleTokens",["b","B","H","k","t","T"])}parse(t,n,s){switch(n){case"a":case"aa":case"aaa":return s.dayPeriod(t,{width:"abbreviated",context:"formatting"})||s.dayPeriod(t,{width:"narrow",context:"formatting"});case"aaaaa":return s.dayPeriod(t,{width:"narrow",context:"formatting"});case"aaaa":default:return s.dayPeriod(t,{width:"wide",context:"formatting"})||s.dayPeriod(t,{width:"abbreviated",context:"formatting"})||s.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,n,s){return t.setHours(on(s),0,0,0),t}}class sd extends fe{constructor(){super(...arguments);m(this,"priority",80);m(this,"incompatibleTokens",["a","B","H","k","t","T"])}parse(t,n,s){switch(n){case"b":case"bb":case"bbb":return s.dayPeriod(t,{width:"abbreviated",context:"formatting"})||s.dayPeriod(t,{width:"narrow",context:"formatting"});case"bbbbb":return s.dayPeriod(t,{width:"narrow",context:"formatting"});case"bbbb":default:return s.dayPeriod(t,{width:"wide",context:"formatting"})||s.dayPeriod(t,{width:"abbreviated",context:"formatting"})||s.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,n,s){return t.setHours(on(s),0,0,0),t}}class ad extends fe{constructor(){super(...arguments);m(this,"priority",80);m(this,"incompatibleTokens",["a","b","t","T"])}parse(t,n,s){switch(n){case"B":case"BB":case"BBB":return s.dayPeriod(t,{width:"abbreviated",context:"formatting"})||s.dayPeriod(t,{width:"narrow",context:"formatting"});case"BBBBB":return s.dayPeriod(t,{width:"narrow",context:"formatting"});case"BBBB":default:return s.dayPeriod(t,{width:"wide",context:"formatting"})||s.dayPeriod(t,{width:"abbreviated",context:"formatting"})||s.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,n,s){return t.setHours(on(s),0,0,0),t}}class od extends fe{constructor(){super(...arguments);m(this,"priority",70);m(this,"incompatibleTokens",["H","K","k","t","T"])}parse(t,n,s){switch(n){case"h":return we(Ee.hour12h,t);case"ho":return s.ordinalNumber(t,{unit:"hour"});default:return Se(n.length,t)}}validate(t,n){return n>=1&&n<=12}set(t,n,s){const a=t.getHours()>=12;return a&&s<12?t.setHours(s+12,0,0,0):!a&&s===12?t.setHours(0,0,0,0):t.setHours(s,0,0,0),t}}class id extends fe{constructor(){super(...arguments);m(this,"priority",70);m(this,"incompatibleTokens",["a","b","h","K","k","t","T"])}parse(t,n,s){switch(n){case"H":return we(Ee.hour23h,t);case"Ho":return s.ordinalNumber(t,{unit:"hour"});default:return Se(n.length,t)}}validate(t,n){return n>=0&&n<=23}set(t,n,s){return t.setHours(s,0,0,0),t}}class cd extends fe{constructor(){super(...arguments);m(this,"priority",70);m(this,"incompatibleTokens",["h","H","k","t","T"])}parse(t,n,s){switch(n){case"K":return we(Ee.hour11h,t);case"Ko":return s.ordinalNumber(t,{unit:"hour"});default:return Se(n.length,t)}}validate(t,n){return n>=0&&n<=11}set(t,n,s){return t.getHours()>=12&&s<12?t.setHours(s+12,0,0,0):t.setHours(s,0,0,0),t}}class ud extends fe{constructor(){super(...arguments);m(this,"priority",70);m(this,"incompatibleTokens",["a","b","h","H","K","t","T"])}parse(t,n,s){switch(n){case"k":return we(Ee.hour24h,t);case"ko":return s.ordinalNumber(t,{unit:"hour"});default:return Se(n.length,t)}}validate(t,n){return n>=1&&n<=24}set(t,n,s){const a=s<=24?s%24:s;return t.setHours(a,0,0,0),t}}class ld extends fe{constructor(){super(...arguments);m(this,"priority",60);m(this,"incompatibleTokens",["t","T"])}parse(t,n,s){switch(n){case"m":return we(Ee.minute,t);case"mo":return s.ordinalNumber(t,{unit:"minute"});default:return Se(n.length,t)}}validate(t,n){return n>=0&&n<=59}set(t,n,s){return t.setMinutes(s,0,0),t}}class fd extends fe{constructor(){super(...arguments);m(this,"priority",50);m(this,"incompatibleTokens",["t","T"])}parse(t,n,s){switch(n){case"s":return we(Ee.second,t);case"so":return s.ordinalNumber(t,{unit:"second"});default:return Se(n.length,t)}}validate(t,n){return n>=0&&n<=59}set(t,n,s){return t.setSeconds(s,0),t}}class dd extends fe{constructor(){super(...arguments);m(this,"priority",30);m(this,"incompatibleTokens",["t","T"])}parse(t,n){const s=a=>Math.trunc(a*Math.pow(10,-n.length+3));return ke(Se(n.length,t),s)}set(t,n,s){return t.setMilliseconds(s),t}}class hd extends fe{constructor(){super(...arguments);m(this,"priority",10);m(this,"incompatibleTokens",["t","T","x"])}parse(t,n){switch(n){case"X":return ze(Be.basicOptionalMinutes,t);case"XX":return ze(Be.basic,t);case"XXXX":return ze(Be.basicOptionalSeconds,t);case"XXXXX":return ze(Be.extendedOptionalSeconds,t);case"XXX":default:return ze(Be.extended,t)}}set(t,n,s){return n.timestampIsSet?t:ye(t,t.getTime()-Fs(t)-s)}}class pd extends fe{constructor(){super(...arguments);m(this,"priority",10);m(this,"incompatibleTokens",["t","T","X"])}parse(t,n){switch(n){case"x":return ze(Be.basicOptionalMinutes,t);case"xx":return ze(Be.basic,t);case"xxxx":return ze(Be.basicOptionalSeconds,t);case"xxxxx":return ze(Be.extendedOptionalSeconds,t);case"xxx":default:return ze(Be.extended,t)}}set(t,n,s){return n.timestampIsSet?t:ye(t,t.getTime()-Fs(t)-s)}}class md extends fe{constructor(){super(...arguments);m(this,"priority",40);m(this,"incompatibleTokens","*")}parse(t){return Zs(t)}set(t,n,s){return[ye(t,s*1e3),{timestampIsSet:!0}]}}class bd extends fe{constructor(){super(...arguments);m(this,"priority",20);m(this,"incompatibleTokens","*")}parse(t){return Zs(t)}set(t,n,s){return[ye(t,s),{timestampIsSet:!0}]}}const gd={G:new Rf,y:new Af,Y:new Lf,R:new $f,u:new Ff,Q:new Yf,q:new Hf,M:new Wf,L:new Vf,w:new zf,I:new qf,d:new Qf,D:new Kf,E:new Xf,e:new Jf,c:new ed,i:new rd,a:new nd,b:new sd,B:new ad,h:new od,H:new id,K:new cd,k:new ud,m:new ld,s:new fd,S:new dd,X:new hd,x:new pd,t:new md,T:new bd},yd=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,vd=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,xd=/^'([^]*?)'?$/,wd=/''/g,Td=/\S/,Sd=/[a-zA-Z]/;function Ue(e,r,t,n){var D,O,S,R,U,F,b,A;const s=Cf(),a=(n==null?void 0:n.locale)??s.locale??gf,o=(n==null?void 0:n.firstWeekContainsDate)??((O=(D=n==null?void 0:n.locale)==null?void 0:D.options)==null?void 0:O.firstWeekContainsDate)??s.firstWeekContainsDate??((R=(S=s.locale)==null?void 0:S.options)==null?void 0:R.firstWeekContainsDate)??1,i=(n==null?void 0:n.weekStartsOn)??((F=(U=n==null?void 0:n.locale)==null?void 0:U.options)==null?void 0:F.weekStartsOn)??s.weekStartsOn??((A=(b=s.locale)==null?void 0:b.options)==null?void 0:A.weekStartsOn)??0;if(r==="")return e===""?le(t):ye(t,NaN);const c={firstWeekContainsDate:o,weekStartsOn:i,locale:a},f=[new Mf],h=r.match(vd).map(k=>{const V=k[0];if(V in zs){const B=zs[V];return B(k,a.formatLong)}return k}).join("").match(yd),p=[];for(let k of h){!(n!=null&&n.useAdditionalWeekYearTokens)&&Ef(k)&&Us(k,r,e),!(n!=null&&n.useAdditionalDayOfYearTokens)&&Pf(k)&&Us(k,r,e);const V=k[0],B=gd[V];if(B){const{incompatibleTokens:ne}=B;if(Array.isArray(ne)){const J=p.find(N=>ne.includes(N.token)||N.token===V);if(J)throw new RangeError(`The format string mustn't contain \`${J.fullToken}\` and \`${k}\` at the same time`)}else if(B.incompatibleTokens==="*"&&p.length>0)throw new RangeError(`The format string mustn't contain \`${k}\` and any other token at the same time`);p.push({token:V,fullToken:k});const te=B.run(e,k,a.match,c);if(!te)return ye(t,NaN);f.push(te.setter),e=te.rest}else{if(V.match(Sd))throw new RangeError("Format string contains an unescaped latin alphabet character `"+V+"`");if(k==="''"?k="'":V==="'"&&(k=Pd(k)),e.indexOf(k)===0)e=e.slice(k.length);else return ye(t,NaN)}}if(e.length>0&&Td.test(e))return ye(t,NaN);const y=f.map(k=>k.priority).sort((k,V)=>V-k).filter((k,V,B)=>B.indexOf(k)===V).map(k=>f.filter(V=>V.priority===k).sort((V,B)=>B.subPriority-V.subPriority)).map(k=>k[0]);let x=le(t);if(isNaN(x.getTime()))return ye(t,NaN);const w={};for(const k of y){if(!k.validate(x,c))return ye(t,NaN);const V=k.set(x,w,c);Array.isArray(V)?(x=V[0],Object.assign(w,V[1])):x=V}return ye(t,x)}function Pd(e){return e.match(xd)[1].replace(wd,"'")}function Ed(e){return Ys(e,Date.now())}function kd(e,r){return Tt(e,-r)}function Cd(e,r){let t=r-an(e);return t<=0&&(t+=7),Tt(e,t)}function Dd(e,r){const t=(r==null?void 0:r.additionalDigits)??2,n=Id(e);let s;if(n.date){const c=jd(n.date,t);s=Md(c.restDateString,c.year)}if(!s||isNaN(s.getTime()))return new Date(NaN);const a=s.getTime();let o=0,i;if(n.time&&(o=Rd(n.time),isNaN(o)))return new Date(NaN);if(n.timezone){if(i=Ad(n.timezone),isNaN(i))return new Date(NaN)}else{const c=new Date(a+o),f=new Date(0);return f.setFullYear(c.getUTCFullYear(),c.getUTCMonth(),c.getUTCDate()),f.setHours(c.getUTCHours(),c.getUTCMinutes(),c.getUTCSeconds(),c.getUTCMilliseconds()),f}return new Date(a+o+i)}const br={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},Od=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,_d=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,Nd=/^([+-])(\d{2})(?::?(\d{2}))?$/;function Id(e){const r={},t=e.split(br.dateTimeDelimiter);let n;if(t.length>2)return r;if(/:/.test(t[0])?n=t[0]:(r.date=t[0],n=t[1],br.timeZoneDelimiter.test(r.date)&&(r.date=e.split(br.timeZoneDelimiter)[0],n=e.substr(r.date.length,e.length))),n){const s=br.timezone.exec(n);s?(r.time=n.replace(s[1],""),r.timezone=s[1]):r.time=n}return r}function jd(e,r){const t=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+r)+"})|(\\d{2}|[+-]\\d{"+(2+r)+"})$)"),n=e.match(t);if(!n)return{year:NaN,restDateString:""};const s=n[1]?parseInt(n[1]):null,a=n[2]?parseInt(n[2]):null;return{year:a===null?s:a*100,restDateString:e.slice((n[1]||n[2]).length)}}function Md(e,r){if(r===null)return new Date(NaN);const t=e.match(Od);if(!t)return new Date(NaN);const n=!!t[4],s=qt(t[1]),a=qt(t[2])-1,o=qt(t[3]),i=qt(t[4]),c=qt(t[5])-1;if(n)return Hd(r,i,c)?Ld(r,i,c):new Date(NaN);{const f=new Date(0);return!Fd(r,a,o)||!Yd(r,s)?new Date(NaN):(f.setUTCFullYear(r,a,Math.max(s,o)),f)}}function qt(e){return e?parseInt(e):1}function Rd(e){const r=e.match(_d);if(!r)return NaN;const t=un(r[1]),n=un(r[2]),s=un(r[3]);return Wd(t,n,s)?t*nn+n*rn+s*1e3:NaN}function un(e){return e&&parseFloat(e.replace(",","."))||0}function Ad(e){if(e==="Z")return 0;const r=e.match(Nd);if(!r)return 0;const t=r[1]==="+"?-1:1,n=parseInt(r[2]),s=r[3]&&parseInt(r[3])||0;return Vd(n,s)?t*(n*nn+s*rn):NaN}function Ld(e,r,t){const n=new Date(0);n.setUTCFullYear(e,0,4);const s=n.getUTCDay()||7,a=(r-1)*7+t+1-s;return n.setUTCDate(n.getUTCDate()+a),n}const $d=[31,null,31,30,31,30,31,31,30,31,30,31];function Xs(e){return e%400===0||e%4===0&&e%100!==0}function Fd(e,r,t){return r>=0&&r<=11&&t>=1&&t<=($d[r]||(Xs(e)?29:28))}function Yd(e,r){return r>=1&&r<=(Xs(e)?366:365)}function Hd(e,r,t){return r>=1&&r<=53&&t>=0&&t<=6}function Wd(e,r,t){return e===24?r===0&&t===0:t>=0&&t<60&&r>=0&&r<60&&e>=0&&e<25}function Vd(e,r){return r>=0&&r<=59}function Bd(e,r){const t=le(e),n=t.getFullYear(),s=t.getDate(),a=ye(e,0);a.setFullYear(n,r,15),a.setHours(0,0,0,0);const o=qs(a);return t.setMonth(r,Math.min(s,o)),t}function zd(e,r){const t=le(e);return isNaN(+t)?ye(e,NaN):(t.setFullYear(r),t)}function Js(e,r){return ct(e,-r)}function ea(e,r){return pr(e,-r)}var Ie=(e=>(e[e.Regular=24]="Regular",e[e.Small=20]="Small",e))(Ie||{});const ta=({className:e})=>l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:e,children:l.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"})}),Ud=({className:e})=>{const r=ie("bsc-h-6 bsc-w-6",e);return l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:r,children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m19.5 8.25-7.5 7.5-7.5-7.5"})})},qd=({className:e})=>{const r=ie("bsc-h-6 bsc-w-6",e);return l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:r,children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 19.5 8.25 12l7.5-7.5"})})},Gd=({className:e})=>{const r=ie("bsc-h-6 bsc-w-6",e);return l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:r,children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m8.25 4.5 7.5 7.5-7.5 7.5"})})},Zd=({className:e})=>{const r=ie("bsc-h-6 bsc-w-6",e);return l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:r,children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m4.5 15.75 7.5-7.5 7.5 7.5"})})},Qd=({className:e})=>l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:e,children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18 18 6M6 6l12 12"})}),Le=({icon:e,size:r=Ie.Regular,onClick:t,className:n})=>{const s=d.useRef({calendar:ta,chevronDown:Ud,chevronLeft:qd,chevronRight:Gd,chevronUp:Zd,close:Qd}),a=d.useMemo(()=>s.current[e]||ta,[e]),o=ie({"bsc-h-[24px] bsc-w-[24px]":r===Ie.Regular,"bsc-h-[20px] bsc-w-[20px]":r===Ie.Small},n);return l.jsx("div",{onClick:t,children:l.jsx(a,{className:o})})},ut=({template:e,props:r,children:t})=>e(r,t);function Kd(e,r){if(r===e)return!1;const t=Object.values(r),n=Object.values(e);if(t.length!==n.length||t.some((a,o)=>a!==n[o]))return!0;const s=Object.keys(e);return Object.keys(r).some((a,o)=>a!==s[o])}function Xd(e,r){return e.matches[r]=!1,e.mediaQueries[r]={},e}function ra(e){const r=Object.keys(e);return typeof window>"u"?r.reduce(Xd,{mediaQueries:{},matches:{}}):r.reduce((t,n)=>{const s=window.matchMedia(e[n]);return t.mediaQueries[n]=s,t.matches[n]=s.matches,t},{mediaQueries:{},matches:{}})}function Jd(e,r){function t(n,s){return n[s]=e.mediaQueries[s].matches,n}switch(r.type){case"updateMatches":return{matches:Object.keys(e.mediaQueries).reduce(t,{}),mediaQueries:e.mediaQueries};case"setQueries":return ra(r.queries)}}function eh(e){const r=Rt.useRef(e),[t,n]=Rt.useReducer(Jd,e,ra);Rt.useEffect(()=>{Kd(e,r.current)&&(n({type:"setQueries",queries:e}),r.current=e)},[e]);function s(){return n({type:"updateMatches"})}function a(c){const f=s;return typeof c.addListener<"u"?c.addListener(f):c.addEventListener("change",f),f}Rt.useEffect(()=>{const c=Object.values(t.mediaQueries),f=c.map(a);function h(p,y){typeof p.addListener<"u"?p.removeListener(f[y]):p.removeEventListener("change",f[y])}return()=>{c.forEach(h)}},[t.mediaQueries]);const{matches:o}=t,i=Rt.useMemo(()=>Object.values(o),[o]);return{matches:o,matchesAny:i.some(Boolean),matchesAll:i.length>0&&i.every(Boolean)}}function gr(e){return eh(th(e)).matchesAll}const ln={};function th(e){return ln[e]===void 0&&(ln[e]={default:e}),ln[e]}const fn=({mobileQuery:e="screen and (max-device-width: 40rem)",tabletQuery:r="screen and (min-device-width: 40.01rem) and (max-device-width: 63.9375rem)",desktopQuery:t="screen and (min-device-width: 64rem)",mobileMarkup:n,aboveMobileMarkup:s,tabletMarkup:a,desktopMarkup:o})=>{const i=gr(e),c=gr(r),f=gr(t);return(()=>i&&n?n:!i&&s?s:c&&a?a:f&&o?o:(console.error("Invalid media settings"),null))()};function na(e,r,t){const n=a=>{const o=a.target,i=e.style.display!=="hidden";e&&i&&!Ja(e,o)&&!s(t,o)&&r(!1),r(!0)},s=(a,o)=>{if(!a)return!1;for(let i=0,c=a.length;i<c;i++)if(a[i].isSameNode(o)||a[i].contains(o))return!0;return!1};return document.addEventListener("mousedown",n),n}function sa(e){document.removeEventListener("mousedown",e)}function rh(e,r){if(e==null)return{};var t={},n=Object.keys(e),s,a;for(a=0;a<n.length;a++)s=n[a],!(r.indexOf(s)>=0)&&(t[s]=e[s]);return t}function dn(e,r){return dn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,s){return n.__proto__=s,n},dn(e,r)}function nh(e,r){e.prototype=Object.create(r.prototype),e.prototype.constructor=e,dn(e,r)}var hn={exports:{}},yr={exports:{}},he={};/** @license React v16.13.1
32
32
  * react-is.production.min.js
33
33
  *
34
34
  * Copyright (c) Facebook, Inc. and its affiliates.
35
35
  *
36
36
  * This source code is licensed under the MIT license found in the
37
37
  * LICENSE file in the root directory of this source tree.
38
- */var Qs;function Kd(){if(Qs)return de;Qs=1;var e=typeof Symbol=="function"&&Symbol.for,r=e?Symbol.for("react.element"):60103,t=e?Symbol.for("react.portal"):60106,n=e?Symbol.for("react.fragment"):60107,s=e?Symbol.for("react.strict_mode"):60108,a=e?Symbol.for("react.profiler"):60114,o=e?Symbol.for("react.provider"):60109,i=e?Symbol.for("react.context"):60110,c=e?Symbol.for("react.async_mode"):60111,l=e?Symbol.for("react.concurrent_mode"):60111,h=e?Symbol.for("react.forward_ref"):60112,m=e?Symbol.for("react.suspense"):60113,x=e?Symbol.for("react.suspense_list"):60120,v=e?Symbol.for("react.memo"):60115,w=e?Symbol.for("react.lazy"):60116,D=e?Symbol.for("react.block"):60121,N=e?Symbol.for("react.fundamental"):60117,S=e?Symbol.for("react.responder"):60118,A=e?Symbol.for("react.scope"):60119;function B(g){if(typeof g=="object"&&g!==null){var $=g.$$typeof;switch($){case r:switch(g=g.type,g){case c:case l:case n:case a:case s:case m:return g;default:switch(g=g&&g.$$typeof,g){case i:case h:case w:case v:case o:return g;default:return $}}case t:return $}}}function F(g){return B(g)===l}return de.AsyncMode=c,de.ConcurrentMode=l,de.ContextConsumer=i,de.ContextProvider=o,de.Element=r,de.ForwardRef=h,de.Fragment=n,de.Lazy=w,de.Memo=v,de.Portal=t,de.Profiler=a,de.StrictMode=s,de.Suspense=m,de.isAsyncMode=function(g){return F(g)||B(g)===c},de.isConcurrentMode=F,de.isContextConsumer=function(g){return B(g)===i},de.isContextProvider=function(g){return B(g)===o},de.isElement=function(g){return typeof g=="object"&&g!==null&&g.$$typeof===r},de.isForwardRef=function(g){return B(g)===h},de.isFragment=function(g){return B(g)===n},de.isLazy=function(g){return B(g)===w},de.isMemo=function(g){return B(g)===v},de.isPortal=function(g){return B(g)===t},de.isProfiler=function(g){return B(g)===a},de.isStrictMode=function(g){return B(g)===s},de.isSuspense=function(g){return B(g)===m},de.isValidElementType=function(g){return typeof g=="string"||typeof g=="function"||g===n||g===l||g===a||g===s||g===m||g===x||typeof g=="object"&&g!==null&&(g.$$typeof===w||g.$$typeof===v||g.$$typeof===o||g.$$typeof===i||g.$$typeof===h||g.$$typeof===N||g.$$typeof===S||g.$$typeof===A||g.$$typeof===D)},de.typeOf=B,de}var he={};/** @license React v16.13.1
38
+ */var aa;function sh(){if(aa)return he;aa=1;var e=typeof Symbol=="function"&&Symbol.for,r=e?Symbol.for("react.element"):60103,t=e?Symbol.for("react.portal"):60106,n=e?Symbol.for("react.fragment"):60107,s=e?Symbol.for("react.strict_mode"):60108,a=e?Symbol.for("react.profiler"):60114,o=e?Symbol.for("react.provider"):60109,i=e?Symbol.for("react.context"):60110,c=e?Symbol.for("react.async_mode"):60111,f=e?Symbol.for("react.concurrent_mode"):60111,h=e?Symbol.for("react.forward_ref"):60112,p=e?Symbol.for("react.suspense"):60113,y=e?Symbol.for("react.suspense_list"):60120,x=e?Symbol.for("react.memo"):60115,w=e?Symbol.for("react.lazy"):60116,D=e?Symbol.for("react.block"):60121,O=e?Symbol.for("react.fundamental"):60117,S=e?Symbol.for("react.responder"):60118,R=e?Symbol.for("react.scope"):60119;function U(b){if(typeof b=="object"&&b!==null){var A=b.$$typeof;switch(A){case r:switch(b=b.type,b){case c:case f:case n:case a:case s:case p:return b;default:switch(b=b&&b.$$typeof,b){case i:case h:case w:case x:case o:return b;default:return A}}case t:return A}}}function F(b){return U(b)===f}return he.AsyncMode=c,he.ConcurrentMode=f,he.ContextConsumer=i,he.ContextProvider=o,he.Element=r,he.ForwardRef=h,he.Fragment=n,he.Lazy=w,he.Memo=x,he.Portal=t,he.Profiler=a,he.StrictMode=s,he.Suspense=p,he.isAsyncMode=function(b){return F(b)||U(b)===c},he.isConcurrentMode=F,he.isContextConsumer=function(b){return U(b)===i},he.isContextProvider=function(b){return U(b)===o},he.isElement=function(b){return typeof b=="object"&&b!==null&&b.$$typeof===r},he.isForwardRef=function(b){return U(b)===h},he.isFragment=function(b){return U(b)===n},he.isLazy=function(b){return U(b)===w},he.isMemo=function(b){return U(b)===x},he.isPortal=function(b){return U(b)===t},he.isProfiler=function(b){return U(b)===a},he.isStrictMode=function(b){return U(b)===s},he.isSuspense=function(b){return U(b)===p},he.isValidElementType=function(b){return typeof b=="string"||typeof b=="function"||b===n||b===f||b===a||b===s||b===p||b===y||typeof b=="object"&&b!==null&&(b.$$typeof===w||b.$$typeof===x||b.$$typeof===o||b.$$typeof===i||b.$$typeof===h||b.$$typeof===O||b.$$typeof===S||b.$$typeof===R||b.$$typeof===D)},he.typeOf=U,he}var pe={};/** @license React v16.13.1
39
39
  * react-is.development.js
40
40
  *
41
41
  * Copyright (c) Facebook, Inc. and its affiliates.
42
42
  *
43
43
  * This source code is licensed under the MIT license found in the
44
44
  * LICENSE file in the root directory of this source tree.
45
- */var Ks;function Xd(){return Ks||(Ks=1,process.env.NODE_ENV!=="production"&&function(){var e=typeof Symbol=="function"&&Symbol.for,r=e?Symbol.for("react.element"):60103,t=e?Symbol.for("react.portal"):60106,n=e?Symbol.for("react.fragment"):60107,s=e?Symbol.for("react.strict_mode"):60108,a=e?Symbol.for("react.profiler"):60114,o=e?Symbol.for("react.provider"):60109,i=e?Symbol.for("react.context"):60110,c=e?Symbol.for("react.async_mode"):60111,l=e?Symbol.for("react.concurrent_mode"):60111,h=e?Symbol.for("react.forward_ref"):60112,m=e?Symbol.for("react.suspense"):60113,x=e?Symbol.for("react.suspense_list"):60120,v=e?Symbol.for("react.memo"):60115,w=e?Symbol.for("react.lazy"):60116,D=e?Symbol.for("react.block"):60121,N=e?Symbol.for("react.fundamental"):60117,S=e?Symbol.for("react.responder"):60118,A=e?Symbol.for("react.scope"):60119;function B(M){return typeof M=="string"||typeof M=="function"||M===n||M===l||M===a||M===s||M===m||M===x||typeof M=="object"&&M!==null&&(M.$$typeof===w||M.$$typeof===v||M.$$typeof===o||M.$$typeof===i||M.$$typeof===h||M.$$typeof===N||M.$$typeof===S||M.$$typeof===A||M.$$typeof===D)}function F(M){if(typeof M=="object"&&M!==null){var Ie=M.$$typeof;switch(Ie){case r:var Ke=M.type;switch(Ke){case c:case l:case n:case a:case s:case m:return Ke;default:var He=Ke&&Ke.$$typeof;switch(He){case i:case h:case w:case v:case o:return He;default:return Ie}}case t:return Ie}}}var g=c,$=l,_=i,W=o,Y=r,re=h,te=n,U=w,E=v,P=t,I=a,k=s,G=m,O=!1;function se(M){return O||(O=!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.")),y(M)||F(M)===c}function y(M){return F(M)===l}function C(M){return F(M)===i}function V(M){return F(M)===o}function p(M){return typeof M=="object"&&M!==null&&M.$$typeof===r}function j(M){return F(M)===h}function q(M){return F(M)===n}function L(M){return F(M)===w}function H(M){return F(M)===v}function z(M){return F(M)===t}function X(M){return F(M)===a}function Q(M){return F(M)===s}function ke(M){return F(M)===m}he.AsyncMode=g,he.ConcurrentMode=$,he.ContextConsumer=_,he.ContextProvider=W,he.Element=Y,he.ForwardRef=re,he.Fragment=te,he.Lazy=U,he.Memo=E,he.Portal=P,he.Profiler=I,he.StrictMode=k,he.Suspense=G,he.isAsyncMode=se,he.isConcurrentMode=y,he.isContextConsumer=C,he.isContextProvider=V,he.isElement=p,he.isForwardRef=j,he.isFragment=q,he.isLazy=L,he.isMemo=H,he.isPortal=z,he.isProfiler=X,he.isStrictMode=Q,he.isSuspense=ke,he.isValidElementType=B,he.typeOf=F}()),he}var Xs;function Js(){return Xs||(Xs=1,process.env.NODE_ENV==="production"?ur.exports=Kd():ur.exports=Xd()),ur.exports}/*
45
+ */var oa;function ah(){return oa||(oa=1,process.env.NODE_ENV!=="production"&&function(){var e=typeof Symbol=="function"&&Symbol.for,r=e?Symbol.for("react.element"):60103,t=e?Symbol.for("react.portal"):60106,n=e?Symbol.for("react.fragment"):60107,s=e?Symbol.for("react.strict_mode"):60108,a=e?Symbol.for("react.profiler"):60114,o=e?Symbol.for("react.provider"):60109,i=e?Symbol.for("react.context"):60110,c=e?Symbol.for("react.async_mode"):60111,f=e?Symbol.for("react.concurrent_mode"):60111,h=e?Symbol.for("react.forward_ref"):60112,p=e?Symbol.for("react.suspense"):60113,y=e?Symbol.for("react.suspense_list"):60120,x=e?Symbol.for("react.memo"):60115,w=e?Symbol.for("react.lazy"):60116,D=e?Symbol.for("react.block"):60121,O=e?Symbol.for("react.fundamental"):60117,S=e?Symbol.for("react.responder"):60118,R=e?Symbol.for("react.scope"):60119;function U(j){return typeof j=="string"||typeof j=="function"||j===n||j===f||j===a||j===s||j===p||j===y||typeof j=="object"&&j!==null&&(j.$$typeof===w||j.$$typeof===x||j.$$typeof===o||j.$$typeof===i||j.$$typeof===h||j.$$typeof===O||j.$$typeof===S||j.$$typeof===R||j.$$typeof===D)}function F(j){if(typeof j=="object"&&j!==null){var je=j.$$typeof;switch(je){case r:var nt=j.type;switch(nt){case c:case f:case n:case a:case s:case p:return nt;default:var Xe=nt&&nt.$$typeof;switch(Xe){case i:case h:case w:case x:case o:return Xe;default:return je}}case t:return je}}}var b=c,A=f,k=i,V=o,B=r,ne=h,te=n,J=w,N=x,$=t,I=a,C=s,G=p,v=!1;function ee(j){return v||(v=!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.")),g(j)||F(j)===c}function g(j){return F(j)===f}function _(j){return F(j)===i}function z(j){return F(j)===o}function E(j){return typeof j=="object"&&j!==null&&j.$$typeof===r}function Y(j){return F(j)===h}function q(j){return F(j)===n}function L(j){return F(j)===w}function H(j){return F(j)===x}function P(j){return F(j)===t}function W(j){return F(j)===a}function Z(j){return F(j)===s}function Te(j){return F(j)===p}pe.AsyncMode=b,pe.ConcurrentMode=A,pe.ContextConsumer=k,pe.ContextProvider=V,pe.Element=B,pe.ForwardRef=ne,pe.Fragment=te,pe.Lazy=J,pe.Memo=N,pe.Portal=$,pe.Profiler=I,pe.StrictMode=C,pe.Suspense=G,pe.isAsyncMode=ee,pe.isConcurrentMode=g,pe.isContextConsumer=_,pe.isContextProvider=z,pe.isElement=E,pe.isForwardRef=Y,pe.isFragment=q,pe.isLazy=L,pe.isMemo=H,pe.isPortal=P,pe.isProfiler=W,pe.isStrictMode=Z,pe.isSuspense=Te,pe.isValidElementType=U,pe.typeOf=F}()),pe}var ia;function ca(){return ia||(ia=1,process.env.NODE_ENV==="production"?yr.exports=sh():yr.exports=ah()),yr.exports}/*
46
46
  object-assign
47
47
  (c) Sindre Sorhus
48
48
  @license MIT
49
- */var on,ea;function Jd(){if(ea)return on;ea=1;var e=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,t=Object.prototype.propertyIsEnumerable;function n(a){if(a==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(a)}function s(){try{if(!Object.assign)return!1;var a=new String("abc");if(a[5]="de",Object.getOwnPropertyNames(a)[0]==="5")return!1;for(var o={},i=0;i<10;i++)o["_"+String.fromCharCode(i)]=i;var c=Object.getOwnPropertyNames(o).map(function(h){return o[h]});if(c.join("")!=="0123456789")return!1;var l={};return"abcdefghijklmnopqrst".split("").forEach(function(h){l[h]=h}),Object.keys(Object.assign({},l)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return on=s()?Object.assign:function(a,o){for(var i,c=n(a),l,h=1;h<arguments.length;h++){i=Object(arguments[h]);for(var m in i)r.call(i,m)&&(c[m]=i[m]);if(e){l=e(i);for(var x=0;x<l.length;x++)t.call(i,l[x])&&(c[l[x]]=i[l[x]])}}return c},on}var cn,ta;function un(){if(ta)return cn;ta=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return cn=e,cn}var ln,ra;function na(){return ra||(ra=1,ln=Function.call.bind(Object.prototype.hasOwnProperty)),ln}var fn,sa;function eh(){if(sa)return fn;sa=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var r=un(),t={},n=na();e=function(a){var o="Warning: "+a;typeof console<"u"&&console.error(o);try{throw new Error(o)}catch{}}}function s(a,o,i,c,l){if(process.env.NODE_ENV!=="production"){for(var h in a)if(n(a,h)){var m;try{if(typeof a[h]!="function"){var x=Error((c||"React class")+": "+i+" type `"+h+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof a[h]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw x.name="Invariant Violation",x}m=a[h](o,h,c,i,null,r)}catch(w){m=w}if(m&&!(m instanceof Error)&&e((c||"React class")+": type specification of "+i+" `"+h+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof m+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),m instanceof Error&&!(m.message in t)){t[m.message]=!0;var v=l?l():"";e("Failed "+i+" type: "+m.message+(v??""))}}}}return s.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(t={})},fn=s,fn}var dn,aa;function th(){if(aa)return dn;aa=1;var e=Js(),r=Jd(),t=un(),n=na(),s=eh(),a=function(){};process.env.NODE_ENV!=="production"&&(a=function(i){var c="Warning: "+i;typeof console<"u"&&console.error(c);try{throw new Error(c)}catch{}});function o(){return null}return dn=function(i,c){var l=typeof Symbol=="function"&&Symbol.iterator,h="@@iterator";function m(y){var C=y&&(l&&y[l]||y[h]);if(typeof C=="function")return C}var x="<<anonymous>>",v={array:S("array"),bigint:S("bigint"),bool:S("boolean"),func:S("function"),number:S("number"),object:S("object"),string:S("string"),symbol:S("symbol"),any:A(),arrayOf:B,element:F(),elementType:g(),instanceOf:$,node:re(),objectOf:W,oneOf:_,oneOfType:Y,shape:U,exact:E};function w(y,C){return y===C?y!==0||1/y===1/C:y!==y&&C!==C}function D(y,C){this.message=y,this.data=C&&typeof C=="object"?C:{},this.stack=""}D.prototype=Error.prototype;function N(y){if(process.env.NODE_ENV!=="production")var C={},V=0;function p(q,L,H,z,X,Q,ke){if(z=z||x,Q=Q||H,ke!==t){if(c){var M=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 M.name="Invariant Violation",M}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var Ie=z+":"+H;!C[Ie]&&V<3&&(a("You are manually calling a React.PropTypes validation function for the `"+Q+"` prop on `"+z+"`. 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."),C[Ie]=!0,V++)}}return L[H]==null?q?L[H]===null?new D("The "+X+" `"+Q+"` is marked as required "+("in `"+z+"`, but its value is `null`.")):new D("The "+X+" `"+Q+"` is marked as required in "+("`"+z+"`, but its value is `undefined`.")):null:y(L,H,z,X,Q)}var j=p.bind(null,!1);return j.isRequired=p.bind(null,!0),j}function S(y){function C(V,p,j,q,L,H){var z=V[p],X=k(z);if(X!==y){var Q=G(z);return new D("Invalid "+q+" `"+L+"` of type "+("`"+Q+"` supplied to `"+j+"`, expected ")+("`"+y+"`."),{expectedType:y})}return null}return N(C)}function A(){return N(o)}function B(y){function C(V,p,j,q,L){if(typeof y!="function")return new D("Property `"+L+"` of component `"+j+"` has invalid PropType notation inside arrayOf.");var H=V[p];if(!Array.isArray(H)){var z=k(H);return new D("Invalid "+q+" `"+L+"` of type "+("`"+z+"` supplied to `"+j+"`, expected an array."))}for(var X=0;X<H.length;X++){var Q=y(H,X,j,q,L+"["+X+"]",t);if(Q instanceof Error)return Q}return null}return N(C)}function F(){function y(C,V,p,j,q){var L=C[V];if(!i(L)){var H=k(L);return new D("Invalid "+j+" `"+q+"` of type "+("`"+H+"` supplied to `"+p+"`, expected a single ReactElement."))}return null}return N(y)}function g(){function y(C,V,p,j,q){var L=C[V];if(!e.isValidElementType(L)){var H=k(L);return new D("Invalid "+j+" `"+q+"` of type "+("`"+H+"` supplied to `"+p+"`, expected a single ReactElement type."))}return null}return N(y)}function $(y){function C(V,p,j,q,L){if(!(V[p]instanceof y)){var H=y.name||x,z=se(V[p]);return new D("Invalid "+q+" `"+L+"` of type "+("`"+z+"` supplied to `"+j+"`, expected ")+("instance of `"+H+"`."))}return null}return N(C)}function _(y){if(!Array.isArray(y))return process.env.NODE_ENV!=="production"&&(arguments.length>1?a("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])."):a("Invalid argument supplied to oneOf, expected an array.")),o;function C(V,p,j,q,L){for(var H=V[p],z=0;z<y.length;z++)if(w(H,y[z]))return null;var X=JSON.stringify(y,function(ke,M){var Ie=G(M);return Ie==="symbol"?String(M):M});return new D("Invalid "+q+" `"+L+"` of value `"+String(H)+"` "+("supplied to `"+j+"`, expected one of "+X+"."))}return N(C)}function W(y){function C(V,p,j,q,L){if(typeof y!="function")return new D("Property `"+L+"` of component `"+j+"` has invalid PropType notation inside objectOf.");var H=V[p],z=k(H);if(z!=="object")return new D("Invalid "+q+" `"+L+"` of type "+("`"+z+"` supplied to `"+j+"`, expected an object."));for(var X in H)if(n(H,X)){var Q=y(H,X,j,q,L+"."+X,t);if(Q instanceof Error)return Q}return null}return N(C)}function Y(y){if(!Array.isArray(y))return process.env.NODE_ENV!=="production"&&a("Invalid argument supplied to oneOfType, expected an instance of array."),o;for(var C=0;C<y.length;C++){var V=y[C];if(typeof V!="function")return a("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+O(V)+" at index "+C+"."),o}function p(j,q,L,H,z){for(var X=[],Q=0;Q<y.length;Q++){var ke=y[Q],M=ke(j,q,L,H,z,t);if(M==null)return null;M.data&&n(M.data,"expectedType")&&X.push(M.data.expectedType)}var Ie=X.length>0?", expected one of type ["+X.join(", ")+"]":"";return new D("Invalid "+H+" `"+z+"` supplied to "+("`"+L+"`"+Ie+"."))}return N(p)}function re(){function y(C,V,p,j,q){return P(C[V])?null:new D("Invalid "+j+" `"+q+"` supplied to "+("`"+p+"`, expected a ReactNode."))}return N(y)}function te(y,C,V,p,j){return new D((y||"React class")+": "+C+" type `"+V+"."+p+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+j+"`.")}function U(y){function C(V,p,j,q,L){var H=V[p],z=k(H);if(z!=="object")return new D("Invalid "+q+" `"+L+"` of type `"+z+"` "+("supplied to `"+j+"`, expected `object`."));for(var X in y){var Q=y[X];if(typeof Q!="function")return te(j,q,L,X,G(Q));var ke=Q(H,X,j,q,L+"."+X,t);if(ke)return ke}return null}return N(C)}function E(y){function C(V,p,j,q,L){var H=V[p],z=k(H);if(z!=="object")return new D("Invalid "+q+" `"+L+"` of type `"+z+"` "+("supplied to `"+j+"`, expected `object`."));var X=r({},V[p],y);for(var Q in X){var ke=y[Q];if(n(y,Q)&&typeof ke!="function")return te(j,q,L,Q,G(ke));if(!ke)return new D("Invalid "+q+" `"+L+"` key `"+Q+"` supplied to `"+j+"`.\nBad object: "+JSON.stringify(V[p],null," ")+`
50
- Valid keys: `+JSON.stringify(Object.keys(y),null," "));var M=ke(H,Q,j,q,L+"."+Q,t);if(M)return M}return null}return N(C)}function P(y){switch(typeof y){case"number":case"string":case"undefined":return!0;case"boolean":return!y;case"object":if(Array.isArray(y))return y.every(P);if(y===null||i(y))return!0;var C=m(y);if(C){var V=C.call(y),p;if(C!==y.entries){for(;!(p=V.next()).done;)if(!P(p.value))return!1}else for(;!(p=V.next()).done;){var j=p.value;if(j&&!P(j[1]))return!1}}else return!1;return!0;default:return!1}}function I(y,C){return y==="symbol"?!0:C?C["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&C instanceof Symbol:!1}function k(y){var C=typeof y;return Array.isArray(y)?"array":y instanceof RegExp?"object":I(C,y)?"symbol":C}function G(y){if(typeof y>"u"||y===null)return""+y;var C=k(y);if(C==="object"){if(y instanceof Date)return"date";if(y instanceof RegExp)return"regexp"}return C}function O(y){var C=G(y);switch(C){case"array":case"object":return"an "+C;case"boolean":case"date":case"regexp":return"a "+C;default:return C}}function se(y){return!y.constructor||!y.constructor.name?x:y.constructor.name}return v.checkPropTypes=s,v.resetWarningCache=s.resetWarningCache,v.PropTypes=v,v},dn}var hn,oa;function rh(){if(oa)return hn;oa=1;var e=un();function r(){}function t(){}return t.resetWarningCache=r,hn=function(){function n(o,i,c,l,h,m){if(m!==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 a={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:t,resetWarningCache:r};return a.PropTypes=a,a},hn}if(process.env.NODE_ENV!=="production"){var nh=Js(),sh=!0;an.exports=th()(nh.isElement,sh)}else an.exports=rh()();var ah=an.exports;const ne=Or(ah),ia={disabled:!1};var oh=process.env.NODE_ENV!=="production"?ne.oneOfType([ne.number,ne.shape({enter:ne.number,exit:ne.number,appear:ne.number}).isRequired]):null;process.env.NODE_ENV!=="production"&&ne.oneOfType([ne.string,ne.shape({enter:ne.string,exit:ne.string,active:ne.string}),ne.shape({enter:ne.string,enterDone:ne.string,enterActive:ne.string,exit:ne.string,exitDone:ne.string,exitActive:ne.string})]);const ca=d.createContext(null);var ih=function(r){return r.scrollTop},Bt="unmounted",ut="exited",lt="entering",Tt="entered",pn="exiting",Qe=function(e){Qd(r,e);function r(n,s){var a;a=e.call(this,n,s)||this;var o=s,i=o&&!o.isMounting?n.enter:n.appear,c;return a.appearStatus=null,n.in?i?(c=ut,a.appearStatus=lt):c=Tt:n.unmountOnExit||n.mountOnEnter?c=Bt:c=ut,a.state={status:c},a.nextCallback=null,a}r.getDerivedStateFromProps=function(s,a){var o=s.in;return o&&a.status===Bt?{status:ut}:null};var t=r.prototype;return t.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},t.componentDidUpdate=function(s){var a=null;if(s!==this.props){var o=this.state.status;this.props.in?o!==lt&&o!==Tt&&(a=lt):(o===lt||o===Tt)&&(a=pn)}this.updateStatus(!1,a)},t.componentWillUnmount=function(){this.cancelNextCallback()},t.getTimeouts=function(){var s=this.props.timeout,a,o,i;return a=o=i=s,s!=null&&typeof s!="number"&&(a=s.exit,o=s.enter,i=s.appear!==void 0?s.appear:o),{exit:a,enter:o,appear:i}},t.updateStatus=function(s,a){if(s===void 0&&(s=!1),a!==null)if(this.cancelNextCallback(),a===lt){if(this.props.unmountOnExit||this.props.mountOnEnter){var o=this.props.nodeRef?this.props.nodeRef.current:$e.findDOMNode(this);o&&ih(o)}this.performEnter(s)}else this.performExit();else this.props.unmountOnExit&&this.state.status===ut&&this.setState({status:Bt})},t.performEnter=function(s){var a=this,o=this.props.enter,i=this.context?this.context.isMounting:s,c=this.props.nodeRef?[i]:[$e.findDOMNode(this),i],l=c[0],h=c[1],m=this.getTimeouts(),x=i?m.appear:m.enter;if(!s&&!o||ia.disabled){this.safeSetState({status:Tt},function(){a.props.onEntered(l)});return}this.props.onEnter(l,h),this.safeSetState({status:lt},function(){a.props.onEntering(l,h),a.onTransitionEnd(x,function(){a.safeSetState({status:Tt},function(){a.props.onEntered(l,h)})})})},t.performExit=function(){var s=this,a=this.props.exit,o=this.getTimeouts(),i=this.props.nodeRef?void 0:$e.findDOMNode(this);if(!a||ia.disabled){this.safeSetState({status:ut},function(){s.props.onExited(i)});return}this.props.onExit(i),this.safeSetState({status:pn},function(){s.props.onExiting(i),s.onTransitionEnd(o.exit,function(){s.safeSetState({status:ut},function(){s.props.onExited(i)})})})},t.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},t.safeSetState=function(s,a){a=this.setNextCallback(a),this.setState(s,a)},t.setNextCallback=function(s){var a=this,o=!0;return this.nextCallback=function(i){o&&(o=!1,a.nextCallback=null,s(i))},this.nextCallback.cancel=function(){o=!1},this.nextCallback},t.onTransitionEnd=function(s,a){this.setNextCallback(a);var o=this.props.nodeRef?this.props.nodeRef.current:$e.findDOMNode(this),i=s==null&&!this.props.addEndListener;if(!o||i){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var c=this.props.nodeRef?[this.nextCallback]:[o,this.nextCallback],l=c[0],h=c[1];this.props.addEndListener(l,h)}s!=null&&setTimeout(this.nextCallback,s)},t.render=function(){var s=this.state.status;if(s===Bt)return null;var a=this.props,o=a.children;a.in,a.mountOnEnter,a.unmountOnExit,a.appear,a.enter,a.exit,a.timeout,a.addEndListener,a.onEnter,a.onEntering,a.onEntered,a.onExit,a.onExiting,a.onExited,a.nodeRef;var i=Zd(a,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return d.createElement(ca.Provider,{value:null},typeof o=="function"?o(s,i):d.cloneElement(d.Children.only(o),i))},r}(d.Component);Qe.contextType=ca,Qe.propTypes=process.env.NODE_ENV!=="production"?{nodeRef:ne.shape({current:typeof Element>"u"?ne.any:function(e,r,t,n,s,a){var o=e[r];return ne.instanceOf(o&&"ownerDocument"in o?o.ownerDocument.defaultView.Element:Element)(e,r,t,n,s,a)}}),children:ne.oneOfType([ne.func.isRequired,ne.element.isRequired]).isRequired,in:ne.bool,mountOnEnter:ne.bool,unmountOnExit:ne.bool,appear:ne.bool,enter:ne.bool,exit:ne.bool,timeout:function(r){var t=oh;r.addEndListener||(t=t.isRequired);for(var n=arguments.length,s=new Array(n>1?n-1:0),a=1;a<n;a++)s[a-1]=arguments[a];return t.apply(void 0,[r].concat(s))},addEndListener:ne.func,onEnter:ne.func,onEntering:ne.func,onEntered:ne.func,onExit:ne.func,onExiting:ne.func,onExited:ne.func}:{};function St(){}Qe.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:St,onEntering:St,onEntered:St,onExit:St,onExiting:St,onExited:St},Qe.UNMOUNTED=Bt,Qe.EXITED=ut,Qe.ENTERING=lt,Qe.ENTERED=Tt,Qe.EXITING=pn;const ch=Qe,ua=({start:e,timeout:r=400,defaultStyle:t,transitionStyles:n,showTransitionOptions:s="cubic-bezier(0, 0, 0.2, 1)",hideTransitionOptions:a="linear",unmountOnExit:o=!1,onEntering:i,onEntered:c,onExit:l,onExited:h,children:m})=>{const x=t||{transition:`opacity ${r}ms ${s}`,opacity:0},v=n||{entering:{opacity:1},entered:{opacity:1},exiting:{transition:`opacity ${r}ms ${a}`,opacity:0},exited:{transition:`opacity ${r}ms ${a}`,opacity:0},unmounted:{}};return f.jsx(ch,{in:e,timeout:r,onEntering:i,onEntered:c,onExit:l,onExited:h,unmountOnExit:o,children:w=>m({state:w,defaultStyle:x,transitionStyles:v})})};function la(e){return e.target?e.target:e}const fa=({visible:e,target:r,appendTo:t=document.body,unmountWhenHidden:n=!1,transitionDuration:s=400,showTransitionOptions:a="cubic-bezier(0, 0, 0.2, 1)",hideTransitionOptions:o="linear",approveText:i="DONE",shown:c,hidden:l,isClickedWithin:h,children:m})=>{const[x,v]=d.useState(-1),[w,D]=d.useState(-1),[N,S]=d.useState(e),A=d.useRef(100),B=d.useRef(101),F=d.useRef(),g=d.useRef(),$=d.useRef();d.useEffect(()=>{r&&(F.current=la(r));const E=zs("zIndex",P=>P==="auto"||P==="-1"?!1:parseInt(P)>100).map(P=>parseInt(P,10));E.length>0&&(A.current=Math.max(...E)+1,B.current=Math.max(...E)+2),S(e)},[e,r]);const _=E=>{g.current=E},W=()=>{D(A.current),v(B.current)},Y=()=>{if(!g.current)return;c==null||c();let E;F.current&&(E=[F.current]);const P=I=>{I?h==null||h():S(!1)};$.current=Gs(g.current,P,E)},re=()=>{$.current&&Zs($.current)},te=()=>{D(-1),v(-1),l==null||l()},U={entering:{opacity:.5},entered:{opacity:.5}};return $e.createPortal(f.jsx(ua,{start:N,timeout:s,showTransitionOptions:a,hideTransitionOptions:o,onEntering:W,onEntered:Y,onExit:re,onExited:te,unmountOnExit:n,children:({state:E,defaultStyle:P,transitionStyles:I})=>f.jsxs("div",{ref:k=>k&&_(k),children:[f.jsx("div",{className:"bsc-fixed bsc-left-0 bsc-top-0 bsc-h-full bsc-w-full bsc-bg-mono-dark-1",style:{zIndex:w,...I[E],...U[E]}}),f.jsxs("div",{className:"dark:bsck-border-mono-light-1 bsc-fixed bsc-bottom-0 bsc-left-0 bsc-w-full bsc-bg-white dark:bsc-border-t dark:bsc-border-solid dark:bsc-bg-mono-dark-1 dark:bsc-text-mono-light-1",style:{zIndex:x,...P,...I[E]},children:[f.jsx("div",{className:"bsc-w-full",children:m}),f.jsx(f.Fragment,{children:f.jsx(We,{buttonType:"primary",fullWidth:!0,onClick:()=>S(!1),className:"bsc-text-xs bsc-font-bold",children:i})})]})]})}),t)};var da=(e=>(e[e.TopLeft=0]="TopLeft",e[e.TopRight=1]="TopRight",e[e.BottomLeft=2]="BottomLeft",e[e.BottomRight=3]="BottomRight",e))(da||{}),ha=(e=>(e[e.TopLeft=0]="TopLeft",e[e.TopRight=1]="TopRight",e[e.BottomLeft=2]="BottomLeft",e[e.BottomRight=3]="BottomRight",e))(ha||{});class xe{static positionToTarget(r,t=2){const n=r.getBoundingClientRect();let s=0,a=0;const o=window.scrollY;switch(t){case 2:s=n.top+n.height+o,a=n.left;break;case 0:s=n.top+o,a=n.left;break;case 3:s=n.top+n.height+o,a=n.left+n.width;break;case 1:s=n.top+o,a=n.left+n.width}return{top:s,left:a}}static positionElementToTarget(r,t,n=0,s=2){let{left:a,top:o}=xe.positionToTarget(t,s);const i=r.getBoundingClientRect();switch(n){case 0:break;case 1:a=a-i.width;break;case 2:o=o-i.height;break;case 3:o=o-i.height,a=a-i.width;break}return{top:o,left:a}}static canPositionElementOnScreenWithTarget(r,t){const n=xe.getScreenDimensions(),s=r.getBoundingClientRect(),a=xe.positionElementToTarget(r,t,0,2);if(a.left+s.width<n.width&&a.top+s.height<n.height||xe.positionElementToTarget(r,t,1,3).left>=0&&a.top+s.height<n.height)return!0;const i=xe.positionElementToTarget(r,t,2,0);if(i.left+s.width<n.width&&i.top>=0)return!0;const c=xe.positionElementToTarget(r,t,3,1);return c.left>=0&&c.top>=0}static canPositionElementOnScreen(r){const t=xe.getScreenDimensions(),n=r.getBoundingClientRect();return n.width<=t.width&&n.height<=t.height}static positionElementToTargetOnScreen(r,t,n=0,s=2){const{left:a,top:o}=xe.positionElementToTarget(r,t,n,s),i=r.getBoundingClientRect(),c=xe.determineOffScreenLocation(i);if(c){if(n===0&&s===2){if(c.right&&!c.bottom)return xe.positionElementToTarget(r,t,1,3);if(c.bottom&&!c.right)return xe.positionElementToTarget(r,t,2,0);if(c.right&&c.bottom)return xe.positionElementToTarget(r,t,3,1)}else if(n===1&&s===3){if(c.left&&!c.bottom)return xe.positionElementToTarget(r,t,0,2);if(c.bottom&&!c.left)return xe.positionElementToTarget(r,t,3,1);if(c.left&&c.bottom)return xe.positionElementToTarget(r,t,2,0)}}return{top:o,left:a}}static determineOffScreenLocation(r){const t=xe.getScreenDimensions(),n={left:r.left<0,top:r.top<0,right:r.left+r.width>t.width,bottom:r.top+r.height>t.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 pa=({visible:e,target:r,targetPosition:t=da.BottomLeft,elementAlignment:n=ha.TopLeft,shouldTargetCloseOverlay:s=!0,shouldMatchTargetWidth:a=!1,shouldScrollCloseOverlay:o=!1,shouldCheckZIndex:i=!1,shouldRemainOnScreen:c=!1,unmountWhenHidden:l=!1,transitionDuration:h=400,showTransitionOptions:m="cubic-bezier(0, 0, 0.2, 1)",hideTransitionOptions:x="linear",shown:v,hidden:w,isClickedWithin:D,markupCreated:N,children:S})=>{const[A,B]=d.useState(-1),[F,g]=d.useState(e),[$,_]=d.useState(!1),W=d.useRef(!1),Y=d.useRef(100),re=d.useRef({left:0,top:0,width:0}),te=d.useRef(),U=d.useRef(),E=d.useRef(),P=d.useRef(),I=d.useRef(),k=d.useRef(),G=Pn();d.useEffect(()=>(c===!0&&(k.current=new ResizeObserver(O)),()=>{var L,H;c===!0&&(U.current&&((L=k.current)==null||L.unobserve(U.current)),(H=k.current)==null||H.disconnect())}),[]),d.useEffect(()=>{if(r&&(te.current=la(r),o)){const L=G==null?void 0:G.isValidScrollableElement;E.current=Bs(te.current,{overflow:"scroll, auto",overflowX:"scroll, auto",overflowY:"scroll, auto"},!1,L),E.current.tagName.toLowerCase()==="html"&&(E.current=document)}if(i){const L=zs("zIndex",H=>parseInt(H)>=100).map(H=>parseInt(H));L.length>0&&(Y.current=Math.max(...L)+1)}e!==void 0&&g(e)},[r,e,o,i]);const O=L=>{if(U.current){const H=xe.getScreenDimensions(),z=L[L.length-1].target,X=z.getBoundingClientRect(),Q=xe.determineOffScreenLocation(X);if(Q){if(te.current&&xe.canPositionElementOnScreenWithTarget(z,te.current)){const ke=xe.positionElementToTargetOnScreen(U.current,te.current,n,t);re.current={...re.current,...ke}}else Q.right?re.current.left=H.width-X.width:Q.left&&(re.current.left=0),Q.bottom?re.current.top=H.height-X.height:Q.top&&(re.current.top=0);se()}}},se=Ft(()=>{W.current=!W.current,_(W.current)},20),y=()=>{B(Y.current)},C=()=>{if(!U.current)return;v==null||v();let L;!s&&te.current&&(L=[te.current]);const H=z=>{z?D==null||D():g(!1)};P.current=Gs(U.current,H,L),o&&(I.current=bl(z=>U.current&&jd(z,U.current)&&g(!1),100,{leading:!0}),E.current&&E.current.addEventListener("scroll",I.current))},V=()=>{E.current&&I.current&&(E.current.removeEventListener("scroll",I.current),I.current=void 0),P.current&&Zs(P.current)},p=()=>{B(-1),w==null||w()},j=L=>{var H,z;if(c===!0&&U.current&&((H=k.current)==null||H.unobserve(U.current)),U.current=L,N==null||N(L),te.current){const X=xe.positionElementToTarget(U.current,te.current,n,t);re.current={...X,width:te.current.offsetWidth},c===!0&&(xe.canPositionElementOnScreenWithTarget(U.current,te.current)||xe.canPositionElementOnScreen(U.current))&&((z=k.current)==null||z.observe(U.current))}},q=d.useMemo(()=>{const L={top:`${re.current.top}px`,left:`${re.current.left}px`,zIndex:A};return a&&(L.width=`${re.current.width}px`),L},[$,A,a]);return f.jsx(ua,{start:F,timeout:h,showTransitionOptions:m,hideTransitionOptions:x,onEntering:y,onEntered:C,onExit:V,onExited:p,unmountOnExit:l,children:({state:L,defaultStyle:H,transitionStyles:z})=>f.jsx("div",{className:"bsc-fixed bsc-border bsc-border-solid bsc-bg-white bsc-shadow dark:bsc-border-mono-light-1 dark:bsc-bg-mono-dark-1 dark:bsc-text-mono-light-1",style:{...q,...H,...z[L]},ref:X=>X&&j(X),children:S})})};let lr;const uh=new Uint8Array(16);function lh(){if(!lr&&(lr=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!lr))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return lr(uh)}const Oe=[];for(let e=0;e<256;++e)Oe.push((e+256).toString(16).slice(1));function fh(e,r=0){return Oe[e[r+0]]+Oe[e[r+1]]+Oe[e[r+2]]+Oe[e[r+3]]+"-"+Oe[e[r+4]]+Oe[e[r+5]]+"-"+Oe[e[r+6]]+Oe[e[r+7]]+"-"+Oe[e[r+8]]+Oe[e[r+9]]+"-"+Oe[e[r+10]]+Oe[e[r+11]]+Oe[e[r+12]]+Oe[e[r+13]]+Oe[e[r+14]]+Oe[e[r+15]]}const ma={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function dh(e,r,t){if(ma.randomUUID&&!r&&!e)return ma.randomUUID();e=e||{};const n=e.random||(e.rng||lh)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,r){t=t||0;for(let s=0;s<16;++s)r[t+s]=n[s];return r}return fh(n)}class fr{static create(r){const t=[];let n=0;for(let s=0,a=r.formatParts.length;s<a;s++){const o=r.formatParts[s],i=n,c=i+o.characterCount;t.push({startPosition:i,endPosition:c,...o}),n=c}return t}}class hh{constructor(r,t){b(this,"instanceCollection");b(this,"formatPartList");b(this,"inputSlotCollection");b(this,"currentPartIndex",0);b(this,"currentCursorPosition",0);b(this,"inputElement");b(this,"inputSelection",null);b(this,"inputRange");b(this,"textNode");this.instanceCollection=Pt.getInstance(),this.formatPartList=fr.create(r),this.inputSlotCollection=this.instanceCollection.getInputSlotInstance(t,r)}getCursorPosition(){return this.currentCursorPosition}getCurrentPartIndex(){return this.currentPartIndex}setInputElement(r){this.inputElement=r}setCursorToCurrentPosition(){this.setCursorSelection(this.currentCursorPosition)}setCursorPosition(r){this.setCursorSelection(r)}setCursorSelection(r,t){this.createInputRangeSelection(),this.inputRange&&this.textNode&&(this.inputRange.setStart(this.textNode,r),this.inputRange.setEnd(this.textNode,t||r),this.currentCursorPosition=t||r,this.setPartIndexByCursorPosition())}findCursorPosition(){var t,n;const r=(t=window.getSelection())==null?void 0:t.getRangeAt(0);if(this.inputElement&&r){const s=document.createTreeWalker(this.inputElement,NodeFilter.SHOW_TEXT,c=>{const l=document.createRange();return l.selectNodeContents(c),l.compareBoundaryPoints(Range.END_TO_END,r)<1?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT});let a=0;for(;s.nextNode();)a+=((n=s.currentNode.textContent)==null?void 0:n.length)||0;r.startContainer.nodeType===Node.TEXT_NODE&&(a+=r.startOffset);const o=this.inputSlotCollection.getLastSlotWithData(),i=o.startPosition+o.partText.length;this.setCursorSelection(a>i?i:a)}}isAtLastPart(){return this.currentPartIndex===this.formatPartList.length-1}moveHome(){const r=this.inputSlotCollection.getFirstSlot();this.setCursorSelection(r.startPosition)}moveEnd(){const r=this.inputSlotCollection.getLastSlotWithData(),t=r.startPosition+r.partText.length;this.setCursorSelection(t)}moveCursorLeft(){if(this.currentCursorPosition>0){const r=this.currentCursorPosition-1;let t=this.formatPartList[this.currentPartIndex];if(r>=t.startPosition&&r<=t.endPosition)this.setCursorSelection(r);else for(let n=this.currentPartIndex-1;n>=0;n--)t=this.formatPartList[n],r>=t.startPosition&&r<=t.endPosition&&(t.isSeparator?this.setCursorSelection(this.formatPartList[n-1].endPosition):this.setCursorSelection(r))}}moveCursorRight(){const r=this.inputSlotCollection.getLastSlotWithData(),t=r.startPosition+r.partText.length;if(this.currentCursorPosition<t){const n=this.currentCursorPosition+1;let s=this.formatPartList[this.currentPartIndex];if(n>=s.startPosition&&n<=s.endPosition)this.setCursorSelection(n);else for(let a=this.currentPartIndex+1,o=this.formatPartList.length;a<o;a++)s=this.formatPartList[a],n>=s.startPosition&&n<=s.endPosition&&(s.isSeparator?this.setCursorSelection(this.formatPartList[a+1].startPosition):this.setCursorSelection(n))}}moveToNextInputPart(){if(this.currentPartIndex<this.formatPartList.length-1){const r=this.findNextEditablePart();r&&(this.currentPartIndex=r.partIndex,this.setCursorSelection(r.startPosition))}}moveToPreviousInputPart(){if(this.currentPartIndex>0){const r=this.findPreviousEditablePart();r&&(this.currentPartIndex=r.partIndex,this.setCursorSelection(r.endPosition))}}findNextEditablePart(){return this.inputSlotCollection.getNextSlot(this.currentPartIndex)}findPreviousEditablePart(){return this.inputSlotCollection.getPreviousSlot(this.currentPartIndex)}setPartIndexByCursorPosition(){for(let r=0;r<this.formatPartList.length;r++){const t=this.formatPartList[r];if(this.currentCursorPosition>=t.startPosition&&this.currentCursorPosition<=t.endPosition){if(t.isSeparator){this.currentCursorPosition=this.formatPartList[r+1].startPosition,this.currentPartIndex=r+1;break}this.currentPartIndex=r;break}}}createInputRangeSelection(){var r,t;this.inputElement&&(this.inputSelection=window.getSelection(),this.inputRange=document.createRange(),(r=this.inputSelection)==null||r.removeAllRanges(),this.inputRange.selectNodeContents(this.inputElement),this.inputRange.collapse(!0),(t=this.inputSelection)==null||t.addRange(this.inputRange),this.inputElement.firstChild&&(this.textNode=this.inputElement.firstChild))}}class ph{static create(r){const t=[];for(let n=0,s=r.length;n<s;n++){const a=r[n];a.isSeparator||t.push({partIndex:n,partText:"",isComplete:!1,...a})}return t}}class mh{constructor(r){b(this,"inputSlots");this.inputSlots=ph.create(fr.create(r))}clearAllSlots(){for(let r=0,t=this.inputSlots.length;r<t;r++)this.inputSlots[r].partText=""}getSlot(r){return this.inputSlots.find(t=>t.partIndex===r)}getFirstSlot(){return this.inputSlots[0]}getNextSlot(r){const t=this.inputSlots.findIndex(n=>n.partIndex===r);if(t>-1&&t+1<this.inputSlots.length)return this.inputSlots[t+1]}getPreviousSlot(r){const t=this.inputSlots.findIndex(n=>n.partIndex===r);if(t>-1&&t-1>=0)return this.inputSlots[t-1]}getLastSlotWithData(){const r=this.inputSlots.findIndex(n=>!n.isComplete);let t=r;for(let n=r+1,s=this.inputSlots.length;n<s;n++)this.inputSlots[n].partText.length>0&&(t=n);return this.inputSlots[t>-1?t:0]}allSlotsCompleted(){return this.inputSlots.every(r=>r.isComplete)}allSlotsEmpty(){return this.inputSlots.every(r=>r.partText.length===0)}}class Pt{static getInstance(){return this.instance||(this.instance=new bh),this.instance}}b(Pt,"instance");class bh{constructor(){b(this,"navigatorInstances");b(this,"inputSlotInstances");this.navigatorInstances={},this.inputSlotInstances={}}getNavigatorInstance(r,t){return this.navigatorInstances[r]||(this.navigatorInstances[r]=new hh(t,r)),this.navigatorInstances[r]}getInputSlotInstance(r,t){return this.inputSlotInstances[r]||(this.inputSlotInstances[r]=new mh(t)),this.inputSlotInstances[r]}removeInstances(r){this.navigatorInstances[r]&&delete this.navigatorInstances[r],this.inputSlotInstances[r]&&delete this.inputSlotInstances[r]}}class mn{constructor(r,t){b(this,"instanceCollection");b(this,"formatPartList");b(this,"inputSlotCollection");b(this,"inputElement");this.instanceCollection=Pt.getInstance(),this.formatPartList=fr.create(r),this.inputSlotCollection=this.instanceCollection.getInputSlotInstance(t,r)}setInputElement(r){this.inputElement=r}render(){var t;let r="";for(let n=0,s=this.formatPartList.length;n<s;n++){const a=this.formatPartList[n];if(a.isSeparator)r+=a.inputText;else{const o=this.inputSlotCollection.getSlot(n);o&&(r+=o.partText+((t=o.inputText)==null?void 0:t.repeat(o.characterCount-o.partText.length)))}}this.inputElement&&(this.inputElement.innerHTML=r)}}var Ue=(e=>(e[e.Text=0]="Text",e[e.Numeric=1]="Numeric",e))(Ue||{});class ba{constructor(){b(this,"numberKeys",["0","1","2","3","4","5","6","7","8","9"]);b(this,"movementKeys",["ArrowLeft","ArrowRight","Home","End"]);b(this,"editingKeys",["Backspace","Delete"]);b(this,"ignoreKeys",["Shift","Alt","Control","Fn","Meta"])}isNumberKey(r){return this.numberKeys.includes(r)}isMovementKey(r){return this.movementKeys.includes(r.key)}isEditingKey(r){return this.editingKeys.includes(r.key)}isIgnoreKey(r){return this.ignoreKeys.includes(r.key)}}class gh{constructor(r){b(this,"_currentIndex",0);b(this,"index",0);b(this,"formatParts");this.formatParts=fr.create(r)}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 ga{constructor(r,t){b(this,"instanceCollection");b(this,"inputSlotCollection");b(this,"formatNavigator");b(this,"keyTypeChecker");b(this,"formatRenderer");b(this,"formatPartList");this.format=r,this.instanceCollection=Pt.getInstance(),this.inputSlotCollection=this.instanceCollection.getInputSlotInstance(t,r),this.formatNavigator=this.instanceCollection.getNavigatorInstance(t,r),this.keyTypeChecker=new ba,this.formatRenderer=new mn(r,t),this.formatPartList=new gh(r)}setInputElement(r){this.formatRenderer.setInputElement(r)}processKeyPress(r){if(this.keyTypeChecker.isEditingKey(r)){this.processEditRules(r);return}this.processInputRules(r)}processInputValue(r){var n;this.inputSlotCollection.clearAllSlots(),this.formatPartList.reset();let t=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 a=this.formatPartList.currentIndex,o=this.formatPartList.next();if(o&&o.inputText){const i=r.indexOf(o.inputText,t),c=this.inputSlotCollection.getSlot(a);if(c&&i>-1){const l=i-t>c.characterCount?t+c.characterCount:i;c.partText=r.substring(t,l),this.processSlotRules(c),t=i+o.characterCount}}}else{const a=this.inputSlotCollection.getSlot(this.formatPartList.currentIndex);a&&(a.partText=r.substring(t,t+a.characterCount),this.processSlotRules(a))}}}processEditRules(r){const t=this.inputSlotCollection.getSlot(this.formatNavigator.getCurrentPartIndex());if(!t)return;const n=this.formatNavigator.getCursorPosition(),s=n-t.startPosition,a=this.format.deleteShiftsFormatPart||!1;switch(r.key){case"Backspace":{if(!(t.startPosition===n))t.partText=t.partText.substring(0,s-1)+t.partText.substring(s),a&&this.shiftFormatParts(t),this.formatRenderer.render(),this.formatNavigator.moveCursorLeft(),this.processSlotRules(t,!0);else{this.processSlotRules(t,!0);const i=this.inputSlotCollection.getPreviousSlot(t.partIndex);i&&(i.partText=i.partText.substring(0,i.partText.length-1),a&&this.shiftFormatParts(i),this.formatRenderer.render(),this.formatNavigator.setCursorPosition(i.startPosition+i.partText.length),this.processSlotRules(i,!0))}break}case"Delete":t.partText=t.partText.substring(0,s)+t.partText.substring(s+1),a&&this.shiftFormatParts(t),this.formatRenderer.render(),this.formatNavigator.setCursorToCurrentPosition(),this.processSlotRules(t,!0);break}}shiftFormatParts(r){let t=r,n;for(;(n=this.inputSlotCollection.getNextSlot(t.partIndex))!==void 0;){const s=n.partText.substring(0,1);n.partText=n.partText.substring(1),t.partText=t.partText+s,t=n}}processInputRules(r){const t=this.inputSlotCollection.getSlot(this.formatNavigator.getCurrentPartIndex());if(!t)return;const{key:n}=r,s=t.characterCount,a=t.partText;if(t.valueType===Ue.Numeric){if(!this.keyTypeChecker.isNumberKey(n))return;const o=t.maximumValue,i=t.exceedingMaximumValueCausesTab||!1,c=t.padWithZeros||!1,l=parseInt(this.createNewValue(t,n));if(o&&l>o)if(i){c&&(t.partText=t.partText.padStart(s,"0")),t.isComplete=!0;const h=this.inputSlotCollection.getNextSlot(t.partIndex);h&&!h.isComplete&&(h.partText=n),this.formatRenderer.render(),h&&this.formatNavigator.setCursorPosition(h.isComplete?h.startPosition:h.startPosition+1)}else return;else a.length+1===s?(this.addToInputSlot(n),t.isComplete=!0,this.formatRenderer.render(),this.formatNavigator.isAtLastPart()?this.formatNavigator.moveCursorRight():this.formatNavigator.moveToNextInputPart()):a.length+1<s&&(this.addToInputSlot(n),this.formatRenderer.render(),this.formatNavigator.moveCursorRight())}else a.length+1===s?(this.addToInputSlot(n),t.isComplete=!0,this.formatRenderer.render(),this.formatNavigator.isAtLastPart()?this.formatNavigator.moveCursorRight():this.formatNavigator.moveToNextInputPart()):(this.addToInputSlot(n),this.formatRenderer.render(),this.formatNavigator.moveCursorRight())}addToInputSlot(r){const t=this.inputSlotCollection.getSlot(this.formatNavigator.getCurrentPartIndex());t&&(t.partText=this.createNewValue(t,r))}createNewValue(r,t){const n=r.partText,s=this.formatNavigator.getCursorPosition();if(s>=r.startPosition+r.partText.length)return n+t;{const a=s-r.startPosition;return n.substring(0,a)+t+n.substring(a)}}processSlotRules(r,t=!1){const n=r.characterCount,s=r.allCharactersRequired||!1;if(r.valueType===Ue.Numeric){const a=r.minimumValue,o=r.maximumValue;if(s)r.isComplete=r.partText.length===n;else if(a!==void 0&&o!==void 0){const i=r.padWithZeros||!1,c=parseInt(r.partText);r.isComplete=c>=a&&c<=o,r.isComplete&&i&&!t&&(r.partText=r.partText.padStart(n,"0"))}else r.isComplete=r.partText.length>0}else s?r.isComplete=r.partText.length===n:r.isComplete=r.partText.length>0}}class yh{constructor(r,t){b(this,"instanceCollection");b(this,"formatNavigator");b(this,"ruleProcessor");b(this,"keyTypeChecker");b(this,"formatRenderer");this.format=r,this.instanceCollection=Pt.getInstance(),this.formatNavigator=this.instanceCollection.getNavigatorInstance(t,r),this.ruleProcessor=new ga(r,t),this.keyTypeChecker=new ba,this.formatRenderer=new mn(r,t)}setInputElement(r){this.ruleProcessor.setInputElement(r),this.formatRenderer.setInputElement(r)}processMovementKey(r){const{key:t,metaKey:n}=r;switch(t){case"ArrowLeft":n?this.formatNavigator.moveHome():this.formatNavigator.moveCursorLeft();break;case"ArrowRight":n?this.formatNavigator.moveEnd():this.formatNavigator.moveCursorRight();break;case"Home":this.formatNavigator.moveHome();break;case"End":this.formatNavigator.moveEnd();break}}processKeyPress(r){return this.keyTypeChecker.isIgnoreKey(r)?!1:this.keyTypeChecker.isMovementKey(r)?(this.processMovementKey(r),!1):(this.ruleProcessor.processKeyPress(r),!0)}}class vh{constructor(r,t=""){b(this,"instanceId");b(this,"instanceCollection");b(this,"keyProcessor");b(this,"formatNavigator");b(this,"formatRenderer");b(this,"inputSlotCollection");b(this,"inputRuleProcessor");b(this,"previousOutputValue","");b(this,"inputElementSet",!1);b(this,"isInputFocused",!1);b(this,"inputElement");b(this,"onFormatChange");this.inputValue=t,this.instanceId=dh(),this.instanceCollection=Pt.getInstance(),this.keyProcessor=new yh(r,this.instanceId),this.formatNavigator=this.instanceCollection.getNavigatorInstance(this.instanceId,r),this.formatRenderer=new mn(r,this.instanceId),this.inputSlotCollection=this.instanceCollection.getInputSlotInstance(this.instanceId,r),this.inputRuleProcessor=new ga(r,this.instanceId)}inputElementCreated(r){this.keyProcessor.setInputElement(r),this.formatNavigator.setInputElement(r),this.formatRenderer.setInputElement(r),this.inputElement=r,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(r){this.inputValue=r,this.inputElementSet&&(this.inputValue.length>0?this.inputRuleProcessor.processInputValue(r):(this.inputSlotCollection.clearAllSlots(),this.previousOutputValue=void 0),setTimeout(()=>{var t;this.formatRenderer.render(),this.isInputFocused&&this.formatNavigator.setCursorToCurrentPosition(),this.inputValue.length>0&&(this.previousOutputValue=(t=this.inputElement)==null?void 0:t.innerHTML)}))}registerFormatChangeEvent(r){this.onFormatChange=r}mouseUpHandler(){this.formatNavigator.findCursorPosition()}keyDownHandler(r){r.key!=="Tab"&&(r.preventDefault(),r.stopPropagation(),this.keyProcessor.processKeyPress(r)&&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)}}const xh=(e,r)=>{const{value:t="",format:n,readOnly:s=!1,debounceTime:a=800,fillContainer:o=!0,leftElement:i,rightElement:c,className:l,leftElementClassName:h,rightElementClassName:m,isSingleLine:x=!1,allowSingleLineScroll:v=!1,isInputValid:w,onChange:D,onFocus:N,onBlur:S,onElementCreate:A,onLeftElementClick:B,onRightElementClick:F}=e,[g,$]=d.useState(!0),_=d.useRef(),W=d.useRef(),Y=d.useRef();d.useEffect(()=>()=>{var O;(O=Y.current)==null||O.dispose()},[]),d.useEffect(()=>{var O;(O=Y.current)==null||O.inputValuePassed(t)},[t]),d.useEffect(()=>{var O,se,y;(O=Y.current)==null||O.dispose(),n&&(Y.current=new vh(n,t),W.current&&((se=Y.current)==null||se.inputElementCreated(W.current)),(y=Y.current)==null||y.registerFormatChangeEvent(re))},[n]);const re=d.useCallback(O=>{w?w(O)?($(!0),D==null||D(O)):$(!1):D==null||D(O)},[D]),te=d.useCallback(O=>{var se;(se=Y.current)==null||se.inputFocused(),N==null||N(O)},[N]),U=d.useCallback(O=>{var se;(se=Y.current)==null||se.inputBlurred(),S==null||S(O)},[S]),E=d.useCallback(()=>{var O;(O=Y.current)==null||O.mouseUpHandler()},[]),P=d.useCallback(O=>{var se;(se=Y.current)==null||se.keyDownHandler(O)},[]),I=d.useCallback(O=>{var se,y,C,V,p,j,q,L,H;(y=(se=_.current)==null?void 0:se.inputElement)==null||y.removeEventListener("keydown",P),(V=(C=_.current)==null?void 0:C.inputElement)==null||V.removeEventListener("mouseup",E),_.current=O,(j=(p=_.current)==null?void 0:p.inputElement)==null||j.addEventListener("keydown",P),(L=(q=_.current)==null?void 0:q.inputElement)==null||L.addEventListener("mouseup",E),W.current=(H=_.current)==null?void 0:H.inputElement},[]),k=d.useCallback(()=>{var O;(O=_.current)==null||O.focus()},[]);d.useImperativeHandle(r,()=>({focus:k}));const G=ce(l,{"!bsc-border-error":!g});return f.jsx(sr,{ref:O=>O&&I(O),readOnly:s,debounceTime:a,fillContainer:o,leftElement:i,rightElement:c,className:G,leftElementClassName:h,rightElementClassName:m,isSingleLine:x,allowSingleLineScroll:v,onFocus:te,onBlur:U,onElementCreate:A,onLeftElementClick:B,onRightElementClick:F})},ya=d.forwardRef(xh),bn=d.createContext(void 0);function va(e,r,t=!0){var x,v;const n=Rs(e),s=Os(e),a=mf(e);let o=Xr(s)-(((x=r.options)==null?void 0:x.weekStartsOn)||0);o=o===-1?6:o;const i=Xr(a)-(((v=r.options)==null?void 0:v.weekStartsOn)||0),c=Sl({start:s,end:a}),l=n+o>35?6:5,h=xa(l,7,{dayValue:null,isCurrent:!0});let m=1;for(let w=0,D=l;w<D;w++){for(let N=w>0?0:o;N<7;N++){const S=c[m-1];if(S.setHours(e.getHours(),e.getMinutes(),e.getSeconds()),h[w][N].dayValue=S,++m>n)break}if(m>n)break}if(o>0&&t)for(let w=0;w<o;w++)h[0][w].dayValue=dd(s,o-w),h[0][w].isCurrent=!1;if(i>-1&&t)for(let w=6;w>i;w--)h[l-1][w].dayValue=vt(a,w-i),h[l-1][w].isCurrent=!1;return h}function xa(e,r,t){const n=[];for(let s=0,a=e;s<a;s++){const o=[];for(let i=0,c=r;i<c;i++){const l=wh(t)?t:{...t};o.push(l)}n.push(o)}return n}function wh(e){const r=typeof e;return r==="string"||r==="number"||r==="boolean"||e instanceof Date}function Th(e){var n;const r=hd(new Date,((n=e.options)==null?void 0:n.weekStartsOn)||0),t=[];for(let s=0;s<7;s++)t.push(vt(r,s).toLocaleDateString(e.code,{weekday:"short"}));return t}function Sh(e){const r=new Date(Date.UTC(2020,0,1)),t=[[{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 a=0;a<4;a++)t[s][a]={monthNumber:n,monthName:ct(r,n++).toLocaleDateString(e.code,{month:"short"})};return t}function Ph(e,r){const t=new Date(e.getTime()),n=Math.floor(t.getFullYear()/10)*10;t.setFullYear(n);const s=Pl({start:t,end:ar(t,9)}),a=xa(3,4,"");let o=0;for(let i=0;i<3;i++)for(let c=0;c<4&&(a[i][c]=s[o++].toLocaleDateString(r.code,{year:"numeric"}),o!==s.length);c++);return a}function Eh(e){const r=new Date;return r.setHours(0,0,0,0),r.toLocaleTimeString(e.code)}function kh(e,r,t){return e.getTime()>=r.getTime()&&e.getTime()<=t.getTime()}async function wa(e){return(await import(`/node_modules/date-fns/locale/${Ch(e)}`)).default}function Ch(e){const[r,t]=e.split("-");switch(r){case"af":return"af";case"ar":switch(t){case"DZ":return"ar-DZ";case"EG":return"ar-EG";case"MA":return"ar-MA";case"SA":return"ar-SA";case"TN":return"ar-TN";default:return"ar"}case"az":return"az";case"be":switch(t){case"tarask":return"be-tarask";default:return"be"}case"bg":return"bg";case"bn":return"bn";case"bs":return"bs";case"ca":return"ca";case"cs":return"cs";case"cy":return"cy";case"da":return"da";case"de":switch(t){case"AT":return"de-AT";default:return"de"}case"el":return"el";case"en":switch(t){case"AU":return"en-AU";case"CA":return"en-CA";case"GB":return"en-GB";case"IE":return"en-IE";case"IN":return"en-IN";case"NZ":return"en-NZ";case"US":return"en-US";default:return"en-ZA"}case"eo":return"eo";case"es":return"es";case"et":return"et";case"eu":return"eu";case"fa":return"fa-IR";case"fi":return"fi";case"fr":switch(t){case"CA":return"fr-CA";case"CH":return"fr-CH";default:return"fr"}case"fy":return"fy";case"gd":return"gd";case"gl":return"gl";case"gu":return"gu";case"he":return"he";case"hi":return"hi";case"hr":return"hr";case"ht":return"ht";case"hu":return"hu";case"hy":return"hy";case"id":return"id";case"is":return"is";case"it":switch(t){case"CH":return"it-CH";default:return"it"}case"ja":switch(t){case"Hira":return"ja-Hira";default:return"ja"}case"ka":return"ka";case"kk":return"kk";case"km":return"km";case"kn":return"kn";case"ko":return"ko";case"lb":return"lb";case"lt":return"lt";case"lv":return"lv";case"mk":return"mk";case"mn":return"mn";case"ms":return"ms";case"mt":return"mt";case"nb":return"nb";case"nl":switch(t){case"BE":return"nl-BE";default:return"nl"}case"nn":return"nn";case"oc":return"oc";case"pl":return"pl";case"pt":switch(t){case"BR":return"pt-BR";default:return"pt"}case"ro":return"ro";case"ru":return"ru";case"sk":return"sk";case"sl":return"sl";case"sq":return"sq";case"sr":switch(t){case"Latn":return"sr-Latn";default:return"sr"}case"sv":return"sv";case"ta":return"ta";case"te":return"te";case"th":return"th";case"tr":return"tr";case"ug":return"ug";case"uk":return"uk";case"uz":switch(t){case"Cyrl":return"uz-Cyrl";default:return"uz"}case"vi":return"vi";case"zh":switch(t){case"CN":return"zh-CN";case"HK":return"zh-HK";default:return"zh-TW"}default:return"en-AU"}}function zt(e,r){const t=pd(e);if(isNaN(t.valueOf())){let n=ze(e,"P pp",new Date,{locale:r});return!isNaN(n.valueOf())||(n=ze(e,"Pp",new Date,{locale:r}),!isNaN(n.valueOf()))||(n=ze(e,"P HH:mm",new Date,{locale:r}),!isNaN(n.valueOf()))||(n=ze(e,"P hh:mm a..aaa",new Date,{locale:r}),!isNaN(n.valueOf()))||(n=ze(e,"P HH:mm:ss",new Date,{locale:r}),!isNaN(n.valueOf()))||(n=ze(e,"P hh:mm:ss a..aaa",new Date,{locale:r}),!isNaN(n.valueOf()))||(n=ze(e,"P",new Date,{locale:r}),!isNaN(n.valueOf()))||(n=ze(e,"P p",new Date,{locale:r}),!isNaN(n.valueOf()))||(n=ze(e,"pp",new Date,{locale:r}),!isNaN(n.valueOf()))||(n=ze(e,"p",new Date,{locale:r}),!isNaN(n.valueOf()))?n:void 0}return t}function Ta(e,r){const t=e.split("-");if(t.length!==2)return;const n=zt(t[0].trim(),r);if(!n)return;const s=zt(t[1].trim(),r);if(s)return[n,s]}var me=(e=>(e[e.DateTime=0]="DateTime",e[e.DateOnly=1]="DateOnly",e[e.TimeOnly=2]="TimeOnly",e[e.DateRange=3]="DateRange",e))(me||{}),Ut=(e=>(e[e.Day=0]="Day",e[e.Month=1]="Month",e[e.Year=2]="Year",e[e.Range=3]="Range",e))(Ut||{}),qt=(e=>(e[e.Short=0]="Short",e[e.Medium=1]="Medium",e[e.Long=2]="Long",e))(qt||{}),Se=(e=>(e[e.TwelveHour=0]="TwelveHour",e[e.TwentyFourHour=1]="TwentyFourHour",e))(Se||{}),nt=(e=>(e[e.Normal=0]="Normal",e[e.Range=1]="Range",e))(nt||{}),dr=(e=>(e[e.Right=0]="Right",e[e.Left=1]="Left",e[e.None=2]="None",e))(dr||{}),ee=(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[e.SetViewDate=5]="SetViewDate",e[e.SetSelectedDate=6]="SetSelectedDate",e[e.SetSelectedDateRange=7]="SetSelectedDateRange",e[e.SetSelectedStartDate=8]="SetSelectedStartDate",e[e.SetSelectedEndDate=9]="SetSelectedEndDate",e[e.SetTimeFormat=10]="SetTimeFormat",e[e.ClearDates=11]="ClearDates",e[e.InitializeDates=12]="InitializeDates",e))(ee||{});const Dh=(e,r)=>{switch(r.type){case 0:return{...e,currentSelector:0,currentViewDate:r.viewDate||e.currentViewDate};case 1:return{...e,currentSelector:1,currentViewDate:r.viewDate||e.currentViewDate};case 2:return{...e,currentSelector:2};case 3:return{...e,currentSelector:3};case 4:return{...e,currentSelector:4,currentViewDate:r.viewDate||e.currentViewDate};case 5:return{...e,currentViewDate:r.viewDate||new Date,dateInitialized:!0};case 6:return{...e,selectedDate:r.selectedDate||e.selectedDate,currentViewDate:r.viewDate||e.currentViewDate};case 7:return{...e,selectedStartDate:r.selectedStartDate||e.selectedStartDate,selectedEndDate:r.selectedEndDate||e.selectedEndDate};case 8:return{...e,selectedStartDate:r.selectedStartDate,selectedEndDate:void 0};case 9:return{...e,selectedEndDate:r.selectedEndDate};case 10:return{...e,timeFormat:r.timeFormat||e.timeFormat};case 11:return{currentSelector:e.currentSelector,currentViewDate:e.currentViewDate,timeFormat:e.timeFormat,dateInitialized:!0};case 12:{const t={...e,currentViewDate:Oh(r.initialDate),dateInitialized:!0};return Array.isArray(r.initialDate)?{...t,selectedStartDate:r.initialDate[0],selectedEndDate:r.initialDate[1]}:{...t,selectedDate:r.initialDate}}default:return{...e,currentSelector:0}}};function Oh(e){return e?Array.isArray(e)?e[0]:e:new Date}const hr=({viewDate:e,selectedDate:r,selectedStartDate:t,selectedEndDate:n,selectionMode:s=nt.Normal,locale:a,onDateSelected:o,selectableDate:i,isValidDate:c,dispatcher:l})=>{var I;const[h,m]=d.useState(!1),[x,v]=d.useState(),[w,D]=d.useState(),[N,S]=d.useState(),[A,B]=d.useState(),F=d.useRef(),g=d.useRef(),$=d.useContext(bn),_=d.useMemo(()=>$.calendarTemplate,[$.calendarTemplate]),W=async()=>a||await wa(Vs());d.useEffect(()=>{W().then(k=>{F.current=k,g.current=Th(F.current),m(!0)}).catch(k=>console.error(k))},[]),d.useEffect(()=>{e&&F.current&&S(va(e,F.current,s===nt.Normal))},[e,h]),d.useEffect(()=>{B(r?new Date(r.getFullYear(),r.getMonth(),r.getDate()):void 0)},[r]),d.useEffect(()=>{v(t?new Date(t.getFullYear(),t.getMonth(),t.getDate(),0,0,0).getTime():void 0),D(n?new Date(n.getFullYear(),n.getMonth(),n.getDate(),23,59,59).getTime():void 0)},[t,n]),d.useEffect(()=>{F.current&&a&&(F.current=a,S(va(e,F.current,s===nt.Normal)))},[a]);const Y=k=>{if(s===nt.Normal)l==null||l({type:ee.SetSelectedDate,selectedDate:k,viewDate:k}),o==null||o(k);else{if(!o)throw new Error("Range selection mode requires onDateSelected to be set");!t||bf(k,t)?o(k):t&&!n?o(k,{setEndDate:!0}):t&&n&&o(k)}},re=k=>(A==null?void 0:A.toLocaleDateString())===k.toLocaleDateString(),te=k=>{if(x&&w){const G=k.getTime();return G>=x&&G<=w}return!1},U={viewDate:e,selectedDate:r,selectedStartDate:t,selectedEndDate:n,selectionMode:s,locale:a,weekDays:g.current,monthMatrix:N,selectableDate:i,isValidDate:c,onDateClicked:Y,isSelectedDate:re,isInSelectedDateRange:te},P=_||((k,G)=>f.jsx("div",{className:"bc-dt-calendar bsc-w-full",children:G}));return f.jsx(wt,{props:U,template:P,children:f.jsxs("div",{className:"bc-dt-day-row bsc-grid bsc-min-w-[329px] bsc-grid-cols-7 bsc-gap-3",children:[(I=g.current)==null?void 0:I.map((k,G)=>f.jsx("div",{className:"bc-dt-day-cell bsc-text-center bsc-font-bold",children:k},G)),N==null?void 0:N.map((k,G)=>k.map((O,se)=>{var V,p;const y=O.dayValue!==null&&(i===void 0||i(O.dayValue)),C=ce("bsc-text-center bsc-py-1",{"bsc-text-gray-3":!O.isCurrent,"bsc-bg-primary-3 dark:bsc-bg-mono-light-1 dark:bsc-text-mono-dark-1":O&&O.dayValue&&(A&&re(O.dayValue)||x&&!w&&Ds(x,O.dayValue)||x&&w&&te(O.dayValue)),"bsc-cursor-pointer":y,"bsc-text-error bsc-cursor-not-allowed":!y,"bsc-bg-primary-5 dark:bsc-bg-mono-light-3 dark:bsc-text-mono-dark-1":O.dayValue&&fd(O.dayValue)&&!(re(O.dayValue)||te(O.dayValue))},"bc-dt-date-cell");return f.jsx("div",{className:C,onClick:()=>O&&O.dayValue&&y&&(c===void 0||c(O.dayValue))&&Y(O.dayValue),children:(p=O.dayValue)==null?void 0:p.getDate().toLocaleString((V=F.current)==null?void 0:V.code)},G.toString()+se.toString())}))]})})},pr=({title:e,scrollerType:r,onTitleClicked:t,onMovePrevious:n,onMoveNext:s})=>{const o=d.useContext(bn).dateScrollerTemplate,i={title:e,scrollerType:r,onTitleClicked:t,onMovePrevious:n,onMoveNext:s},l=o||((h,m)=>f.jsx("div",{className:"bc-dt-scroller bsc-flex bsc-w-full bsc-flex-row bsc-items-center bsc-px-2 bsc-py-1",children:m}));return f.jsxs(wt,{props:i,template:l,children:[f.jsx("div",{className:"bc-dt-scroller-left bsc-flex-shrink bsc-cursor-pointer",children:f.jsx(We,{className:"bsc-bg-transparent focus:bsc-outline-none",onClick:n,children:f.jsx(Re,{icon:"chevronLeft",size:_e.Regular})})}),f.jsx("div",{className:"bc-dt-scroller-title bsc-flex-grow bsc-cursor-pointer bsc-text-center",onClick:t,children:e}),f.jsx("div",{className:"bc-dt-scroller-right bsc-flex-shrink bsc-cursor-pointer",children:f.jsx(We,{className:"bsc-bg-transparent focus:bsc-outline-none",onClick:s,children:f.jsx(Re,{icon:"chevronRight",size:_e.Regular})})})]})},Nh=({selectedDate:e,viewDate:r,locale:t,showTimeSelector:n,selectableDate:s,isValidDate:a,onChange:o,dispatcher:i})=>{const c=()=>{r&&i({type:ee.SetViewDate,viewDate:Hs(r,1)})},l=()=>{r&&i({type:ee.SetViewDate,viewDate:ct(r,1)})},h=()=>{i({type:ee.MonthSelector})},m=()=>{i({type:ee.TimeSelector})},x=()=>r?r.toLocaleDateString(t.code,{month:"long",year:"numeric"}):"";return f.jsxs("div",{className:"bc-dt-day-selector bsc-p-2",children:[f.jsx(pr,{title:x(),scrollerType:Ut.Day,onTitleClicked:h,onMovePrevious:c,onMoveNext:l}),f.jsx(hr,{viewDate:r,selectedDate:e,locale:t,selectableDate:s,isValidDate:a,onDateSelected:o,dispatcher:i}),n&&f.jsx("div",{className:"bc-dt-time-value-wrapper bsc-flex bsc-w-full bsc-flex-row bsc-justify-center bsc-p-2",children:f.jsx("div",{className:"bc-dt-time-value bsc-cursor-pointer bsc-p-2 hover:bsc-bg-gray-4 dark:bsc-bg-mono-dark-1 dark:bsc-text-mono-light-1 dark:hover:bsc-bg-mono-light-2 dark:hover:bsc-text-mono-dark-2",onClick:m,children:(e==null?void 0:e.toLocaleTimeString(t.code))||Eh(t)})})]})},_h=({viewDate:e,locale:r,dateSelection:t=me.DateTime,dispatcher:n})=>{const s=d.useRef(Sh(r)),a=()=>{const h=Ws(e,1);n({type:ee.SetViewDate,viewDate:h})},o=()=>{const h=ar(e,1);n({type:ee.SetViewDate,viewDate:h})},i=h=>{n({type:t!==me.DateRange?ee.DaySelector:ee.DateRangeSelector,viewDate:Nd(e,h)})},c=()=>e.toLocaleDateString(r.code,{year:"numeric"}),l=()=>{n({type:ee.YearSelector})};return f.jsxs("div",{className:"bc-dt-month-selector bsc-p-2",style:{minWidth:"20rem"},children:[f.jsx(pr,{title:c(),scrollerType:Ut.Month,onTitleClicked:l,onMovePrevious:a,onMoveNext:o}),f.jsx("div",{className:"bc-dt-month-grid bsc-grid bsc-w-full bsc-grid-cols-4 bsc-gap-4",children:s.current.map((h,m)=>h.map((x,v)=>f.jsx("div",{className:"bc-dt-month-cell bsc-cursor-pointer bsc-text-center",onClick:()=>i(x.monthNumber),children:x.monthName},m.toString()+v.toString())))})]})},Ih=({viewDate:e,selectedStartDate:r,selectedEndDate:t,locale:n,onChange:s,dispatcher:a})=>{const o=cr("screen and (max-device-width: 40rem)"),i=ct(e,1),c=(v,w)=>{!w||!w.setEndDate?a({type:ee.SetSelectedStartDate,selectedStartDate:v}):(a({type:ee.SetSelectedEndDate,selectedEndDate:v}),r&&(s==null||s([r,v])))},l=()=>{a({type:ee.MonthSelector})},h=()=>o?`${e.toLocaleDateString(n.code,{month:"long"})} ${e.toLocaleDateString(n.code,{year:"numeric"})}`:`${e.toLocaleDateString(n.code,{month:"long"})} ${e.toLocaleDateString(n.code,{year:"numeric"})} - ${i.toLocaleDateString(n.code,{month:"long"})} ${i.toLocaleDateString(n.code,{year:"numeric"})}`,m=()=>{e&&a({type:ee.SetViewDate,viewDate:Hs(e,1)})},x=()=>{e&&a({type:ee.SetViewDate,viewDate:ct(e,1)})};return f.jsxs("div",{className:"bc-dt-range-selector bsc-flex bsc-flex-col",children:[f.jsx("div",{className:"bc-dt-range-scroller-wrapper bsc-flex-shrink",children:f.jsx(pr,{title:h(),scrollerType:Ut.Range,onTitleClicked:l,onMovePrevious:m,onMoveNext:x})}),f.jsx("div",{className:"bsc-flex-grow",children:f.jsx(nn,{mobileMarkup:f.jsx("div",{className:"bc-dt-range-calendar bsc-px-2 bsc-py-1",children:f.jsx(hr,{viewDate:e,selectedStartDate:r,selectedEndDate:t,selectionMode:nt.Range,onDateSelected:c,locale:n,dispatcher:a})}),aboveMobileMarkup:f.jsxs("div",{className:"bc-dt-range-wrapper bsc-flex bsc-flex-row bsc-px-2 bsc-py-1",children:[f.jsx("div",{className:"bc-dt-range-calendar-1 bsc-border-r bsc-border-solid bsc-border-gray-3 bsc-pr-4",children:f.jsx(hr,{viewDate:e,selectedStartDate:r,selectedEndDate:t,selectionMode:nt.Range,onDateSelected:c,locale:n,dispatcher:a})}),f.jsx("div",{className:"bc-dt-range-calendar-2 bsc-pl-4",children:f.jsx(hr,{viewDate:i,selectedStartDate:r,selectedEndDate:t,selectionMode:nt.Range,onDateSelected:c,locale:n,dispatcher:a})})]})})})]})},jh=({viewDate:e,showDateSelector:r,locale:t,timeFormat:n=Se.TwelveHour,timeConstraints:s,onChange:a,dispatcher:o})=>{const i=d.useRef(n===Se.TwelveHour?11:23),c=d.useRef(n===Se.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=d.useRef(Id(0,59,E=>E.toString().padStart(2,"0"))),h=d.useRef(["AM","PM"]),m=d.useRef(ll(e)),x=E=>E>11?E-12:E,[v,w]=d.useState(x(e.getHours())),[D,N]=d.useState(e.getMinutes()),[S,A]=d.useState(e.getHours()<=12?0:1),B=d.useRef(e.toLocaleDateString(t.code));d.useEffect(()=>{const E=e.getHours(),P=e.getMinutes();if(E!==v&&w(n===Se.TwelveHour?x(E):E),P!==D&&N(P),n===Se.TwelveHour){const I=E<=11?0:1;I!==S&&A(I)}},[e]);const F=()=>{var I;const E=((I=s==null?void 0:s.hours)==null?void 0:I.step)||1,P=v<i.current?v+E:0;w(P),Y(P,D,S)},g=()=>{var I;const E=((I=s==null?void 0:s.hours)==null?void 0:I.step)||1,P=v>0?v-E:i.current;w(P),Y(P,D,S)},$=()=>{var I,k,G;const E=((I=s==null?void 0:s.minutes)==null?void 0:I.step)||1,P=D+E<(((k=s==null?void 0:s.minutes)==null?void 0:k.max)||59)?D+E:((G=s==null?void 0:s.minutes)==null?void 0:G.min)||0;N(P),Y(v,P,S)},_=()=>{var I,k,G;const E=((I=s==null?void 0:s.minutes)==null?void 0:I.step)||1,P=D-E>=(((k=s==null?void 0:s.minutes)==null?void 0:k.min)||0)?D-E:(((G=s==null?void 0:s.minutes)==null?void 0:G.max)||60)-E;N(P),Y(v,P,S)},W=()=>{const E=S===0?1:0;A(E),Y(v,D,E)},Y=(E,P,I)=>{const k=n===Se.TwelveHour&&I===1?E+12:E;m.current.setHours(k,P),o({type:ee.SetSelectedDate,selectedDate:m.current,viewDate:m.current}),a==null||a(m.current)},re=()=>{o({type:ee.DaySelector})},te=ce("bsc-w-full bsc-grid bsc-grid-rows-3 bsc-gap-4 bc-dt-time-grid",{"bsc-grid-cols-4":n===Se.TwelveHour,"bsc-grid-cols-3":n===Se.TwentyFourHour}),U=ce("bsc-text-center bsc-cursor-pointer hover:bsc-bg-gray-4 dark:bsc-text-mono-light-1 dark:hover:bsc-bg-mono-light-1 dark:hover:bsc-text-mono-dark-1 bc-dt-time-date-value",{"bsc-col-span-4":n===Se.TwelveHour,"bsc-col-span-3":n===Se.TwentyFourHour});return f.jsx("div",{className:"bc-dt-time-selector bsc-flex bsc-flex-row bsc-justify-center bsc-p-2",style:{minWidth:n===Se.TwelveHour?"15rem":"11rem"},children:f.jsxs("div",{className:te,children:[r&&f.jsx("div",{className:U,onClick:re,children:B.current}),f.jsx("div",{className:"bc-dt-time-hour-increase bsc-cursor-pointer bsc-text-center",children:f.jsx(We,{className:"bsc-bg-transparent bsc-p-2 focus:bsc-outline-none",onClick:F,children:f.jsx(Re,{icon:"chevronUp",size:_e.Regular})})}),f.jsx("div",{}),f.jsx("div",{className:"bc-dt-time-minute-increase bsc-cursor-pointer bsc-text-center",children:f.jsx(We,{className:"bsc-bg-transparent bsc-p-2 focus:bsc-outline-none",onClick:$,children:f.jsx(Re,{icon:"chevronUp",size:_e.Regular})})}),n===Se.TwelveHour&&f.jsx("div",{className:"bc-dt-time-meridian-increase bsc-cursor-pointer bsc-text-center",children:f.jsx(We,{className:"bsc-bg-transparent bsc-p-2 focus:bsc-outline-none",onClick:W,children:f.jsx(Re,{icon:"chevronUp",size:_e.Regular})})}),f.jsx("div",{className:"bc-dt-time-hour-value bsc-text-center",children:c.current[v]}),f.jsx("div",{className:"bc-dt-time-separator bsc-text-center",children:":"}),f.jsx("div",{className:"bc-dt-time-minute-value bsc-text-center",children:l.current[D]}),n===Se.TwelveHour&&f.jsx("div",{className:"bc-dt-time-meridian-value bsc-text-center",children:h.current[S]}),f.jsx("div",{className:"bc-dt-time-hour-decrease bsc-cursor-pointer bsc-text-center",children:f.jsx(We,{className:"bsc-bg-transparent bsc-p-2 focus:bsc-outline-none",onClick:g,children:f.jsx(Re,{icon:"chevronDown",size:_e.Regular})})}),f.jsx("div",{}),f.jsx("div",{className:"bc-dt-time-minute-decrease bsc-cursor-pointer bsc-text-center",children:f.jsx(We,{className:"bsc-bg-transparent bsc-p-2 focus:bsc-outline-none",onClick:_,children:f.jsx(Re,{icon:"chevronDown",size:_e.Regular})})}),n===Se.TwelveHour&&f.jsx("div",{className:"bc-dt-time-meridian-decrease bsc-cursor-pointer bsc-text-center",children:f.jsx(We,{className:"bsc-bg-transparent bsc-p-2 focus:bsc-outline-none",onClick:W,children:f.jsx(Re,{icon:"chevronDown",size:_e.Regular})})})]})})},Mh=({viewDate:e,locale:r,dispatcher:t})=>{const n=Ph(e,r),s=()=>{const c=Ws(e,10);t({type:ee.SetViewDate,viewDate:c})},a=()=>{const c=ar(e,10);t({type:ee.SetViewDate,viewDate:c})},o=c=>{const l=parseInt(c);t({type:ee.MonthSelector,viewDate:_d(e,l)})},i=()=>`${n[0][0].toString()} - ${n[2][1].toString()}`;return f.jsxs("div",{className:"bc-dt-year-selector",style:{minWidth:"20rem"},children:[f.jsx(pr,{title:i(),scrollerType:Ut.Year,onMovePrevious:s,onMoveNext:a}),f.jsx("div",{className:"bc-dt-year-wrapper bsc-w-full",children:f.jsx("div",{className:"bc-dt-year-grid bsc-grid bsc-grid-cols-4 bsc-gap-4",children:n.map((c,l)=>c.map((h,m)=>h.length>0?f.jsx("div",{className:"bc-dt-year-cell bsc-cursor-pointer bsc-text-center",onClick:()=>o(h),children:h},l.toString()+m.toString()):f.jsx("div",{},l.toString()+m.toString())))})})]})};class Rh{constructor(r,t){b(this,"dateFormat");b(this,"timeFormat");b(this,"use24HourTime");b(this,"monthPart");b(this,"dayPart");b(this,"yearPart");b(this,"twelveHourPart");b(this,"twentyFourHourPart");b(this,"minutePart");b(this,"meridianPart");this.dateSelection=r;const n=2023,s=12,a=20,i=new Date(n,s-1,a).toLocaleDateString(t,{year:"numeric",month:"numeric",day:"numeric"});this.dateFormat=i.replace(`${n}`,"YYYY").replace(`${s}`,"MM").replace(`${a}`,"DD");const c=new Date,l=18,h=24,m=37,x=317;c.setHours(l,h,m,x);const v=c.toLocaleTimeString(t);this.use24HourTime=v.startsWith("18"),this.timeFormat=v.replace(`${this.use24HourTime?l:"6"}`,"HH").replace(`${h}`,"MM").replace(`${m}`,"SS").replace(`${x}`,"LLL"),this.createDateParts()}get is24HourTime(){return this.use24HourTime}createInputFormat(){const r={deleteShiftsFormatPart:!1,formatParts:[]};switch(this.dateSelection){case me.DateOnly:return this.createDateFormat(r);case me.TimeOnly:return this.createTimeFormat(r);case me.DateRange:return this.createDateRangeFormat(r);case me.DateTime:return this.createDateTimeFormat(r)}}createDateFormat(r){return this.dateFormat.startsWith("MM")?r.formatParts.push(...this.createMonthDayYearFormatParts()):this.dateFormat.startsWith("DD")?r.formatParts.push(...this.createDayMonthYearFormatParts()):r.formatParts.push(...this.createYearMonthDayFormatParts()),r}createTimeFormat(r){return this.use24HourTime?r.formatParts.push(...this.createTwentyFourHourFormatParts()):r.formatParts.push(...this.createTwelveHourFormatParts()),r}createDateRangeFormat(r){const t=[];this.dateFormat.startsWith("MM")?t.push(...this.createMonthDayYearFormatParts()):this.dateFormat.startsWith("DD")?t.push(...this.createDayMonthYearFormatParts()):t.push(...this.createYearMonthDayFormatParts());const n={characterCount:3,placeholder:" - ",inputText:" - ",isSeparator:!0};return r.formatParts.push(...t,n,...t),r}createDateTimeFormat(r){this.dateFormat.startsWith("MM")?r.formatParts.push(...this.createMonthDayYearFormatParts()):this.dateFormat.startsWith("DD")?r.formatParts.push(...this.createDayMonthYearFormatParts()):r.formatParts.push(...this.createYearMonthDayFormatParts());const t={characterCount:1,placeholder:" ",inputText:" ",isSeparator:!0};return r.formatParts.push(t),this.use24HourTime?r.formatParts.push(...this.createTwentyFourHourFormatParts()):r.formatParts.push(...this.createTwelveHourFormatParts()),r}createMonthDayYearFormatParts(){if(this.monthPart&&this.dayPart&&this.yearPart){let r=this.dateFormat.replace("MM",""),t=r.indexOf("DD"),n=r.substring(0,t);r=r.replace(n,"").replace("DD","");const s={characterCount:n.length,placeholder:n,inputText:n,isSeparator:!0};t=r.indexOf("YYYY"),n=r.substring(0,t);const a={characterCount:n.length,placeholder:n,inputText:n,isSeparator:!0};return[this.monthPart,s,this.dayPart,a,this.yearPart]}return[]}createDayMonthYearFormatParts(){if(this.monthPart&&this.dayPart&&this.yearPart){let r=this.dateFormat.replace("DD",""),t=r.indexOf("MM"),n=r.substring(0,t);r=r.replace(n,"").replace("MM","");const s={characterCount:n.length,placeholder:n,inputText:n,isSeparator:!0};t=r.indexOf("YYYY"),n=r.substring(0,t);const a={characterCount:n.length,placeholder:n,inputText:n,isSeparator:!0};return[this.dayPart,s,this.monthPart,a,this.yearPart]}return[]}createYearMonthDayFormatParts(){if(this.monthPart&&this.dayPart&&this.yearPart){let r=this.dateFormat.replace("YYYY",""),t=r.indexOf("MM"),n=r.substring(0,t);r=r.replace(n,"").replace("MM","");const s={characterCount:n.length,placeholder:n,inputText:n,isSeparator:!0};t=r.indexOf("DD"),n=r.substring(0,t);const a={characterCount:n.length,placeholder:n,inputText:n,isSeparator:!0};return[this.yearPart,s,this.monthPart,a,this.dayPart]}return[]}createTwelveHourFormatParts(){if(this.twelveHourPart&&this.minutePart&&this.meridianPart){const r=this.timeFormat.replace("HH",""),t=r.indexOf("MM"),n=r.substring(0,t),s={characterCount:n.length,placeholder:n,inputText:n,isSeparator:!0},a={characterCount:1,placeholder:" ",inputText:" ",isSeparator:!0};return[this.twelveHourPart,s,this.minutePart,a,this.meridianPart]}return[]}createTwentyFourHourFormatParts(){if(this.twentyFourHourPart&&this.minutePart){const r=this.timeFormat.replace("HH",""),t=r.indexOf("MM"),n=r.substring(0,t),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:Ue.Numeric,minimumValue:1,maximumValue:12,exceedingMaximumValueCausesTab:!0,padWithZeros:!0},this.dayPart={characterCount:2,placeholder:"D",inputText:"_",isSeparator:!1,allCharactersRequired:!1,valueType:Ue.Numeric,minimumValue:1,maximumValue:31,exceedingMaximumValueCausesTab:!0,padWithZeros:!0},this.yearPart={characterCount:4,placeholder:"Y",inputText:"_",isSeparator:!1,allCharactersRequired:!0,valueType:Ue.Numeric},this.twelveHourPart={characterCount:2,placeholder:"H",inputText:"_",isSeparator:!1,allCharactersRequired:!1,valueType:Ue.Numeric,minimumValue:1,maximumValue:12,exceedingMaximumValueCausesTab:!0,padWithZeros:!0},this.twentyFourHourPart={characterCount:2,placeholder:"H",inputText:"_",isSeparator:!1,allCharactersRequired:!1,valueType:Ue.Numeric,minimumValue:0,maximumValue:23,exceedingMaximumValueCausesTab:!0,padWithZeros:!0},this.minutePart={characterCount:2,placeholder:"M",inputText:"_",isSeparator:!1,allCharactersRequired:!1,valueType:Ue.Numeric,minimumValue:0,maximumValue:59,exceedingMaximumValueCausesError:!0,padWithZeros:!0},this.meridianPart={characterCount:2,inputText:"_",isSeparator:!1,valueType:Ue.Text,possibleValues:["AM","PM"]}}}const Ah=(e,r)=>{var a;const[t,n]=d.useState(),s=d.useRef();return d.useEffect(()=>{r&&!t&&(s.current=new Rh(e,r),n(s.current.createInputFormat()))},[r]),[t,(a=s.current)==null?void 0:a.is24HourTime]},Lh=({value:e,readOnly:r=!1,label:t,useDefaultDateValue:n=!1,useFormattedInput:s=!1,allowClear:a=!1,closeSelector:o=!1,locale:i,className:c,dateSelection:l=me.DateTime,dateFormat:h,timeConstraints:m,icon:x,iconPosition:v=dr.Right,inputElement:w,selectableDate:D,isValidDate:N,onChange:S,calendarTemplate:A,dateScrollerTemplate:B,inputTemplate:F})=>{const[g,$]=d.useState(!1),[_,W]=d.useState(),[Y,re]=d.useState(),te=d.useRef(),U=d.useRef(!1),E=d.useRef(i||Vs()),P=d.useRef(),I=d.useRef(),k=d.useRef(),[G,O]=Ah(l,_),se=d.useRef({calendarTemplate:A,dateScrollerTemplate:B});d.useEffect(()=>{E.current&&y(E.current)},[E]),d.useEffect(()=>{i&&y(i)},[i]),d.useEffect(()=>{if(e){const J=C();j({type:ee.InitializeDates,initialDate:J})}else j({type:ee.ClearDates})},[e,P.current]),d.useEffect(()=>{O&&j({type:ee.SetTimeFormat,timeFormat:O?Se.TwentyFourHour:Se.TwelveHour})},[O]),d.useEffect(()=>{w&&(I.current=w)},[w]);const y=J=>{wa(J).then(pe=>{W(pe.code),P.current=pe;const Ae=C();j(e||n?{type:ee.InitializeDates,initialDate:Array.isArray(Ae)?Ae[0]:Ae}:{type:ee.SetViewDate,viewDate:Array.isArray(Ae)?Ae[0]:Ae})}).catch(pe=>console.error(pe))},C=()=>{const J=new Date;return J.setHours(0,0,0,0),e?typeof e=="string"?l!==me.DateRange?zt(e,P.current):Ta(e,P.current):e:J},V={currentSelector:l===me.TimeOnly?ee.TimeSelector:l===me.DateTime||l===me.DateOnly?ee.DaySelector:ee.DateRangeSelector,currentViewDate:new Date,timeFormat:Se.TwelveHour,dateInitialized:!1},[p,j]=d.useReducer(Dh,V),q=()=>{dt(),$(!0)},L=d.useMemo(()=>Ft(()=>{$(!1)},250),[]),H=d.useMemo(()=>Ft(()=>{L.cancel()},5),[L]),z=J=>{const pe=J.target.innerText;ke(pe)},X=J=>{if(J){const pe=zt(J,P.current);return pe?N?N(pe):!0:!1}else return!0},Q=J=>{ke(J||"")},ke=J=>{const pe=l!==me.DateRange?zt(J,P.current):Ta(J,P.current);pe?(Array.isArray(pe)?(kh(pe[0],Os(p.currentViewDate),Tl(ct(p.currentViewDate,1)))||j({type:ee.SetViewDate,viewDate:pe[0]}),j({type:ee.SetSelectedDateRange,selectedStartDate:pe[0],selectedEndDate:pe[1]})):j({type:ee.SetSelectedDate,selectedDate:pe,viewDate:pe}),S==null||S(pe)):J===""&&(j({type:ee.ClearDates}),S==null||S())},M=J=>{l===me.DateOnly&&o===!0&&$(!1),S==null||S(J)},Ie=()=>{dt(),$(!g)},Ke=()=>{j({type:ee.ClearDates}),$(!1),S==null||S()},He=(J,pe)=>{(!I.current||te.current!==pe)&&(I.current=J,te.current=pe,U.current=!0)},dt=()=>{(!k.current||U.current)&&I.current&&(k.current=I.current,re(I.current),U.current=!1)},Zt=()=>{$(!1),j({type:l===me.TimeOnly?ee.TimeSelector:l===me.DateTime||l===me.DateOnly?ee.DaySelector:ee.DateRangeSelector})},vr=()=>{switch(h){case qt.Short:return"short";case qt.Medium:return"medium";case qt.Long:return"long";default:return}},Xe=()=>{var pe,Ae,Ct,Tr,Sr,Pr,Er,kr,Cr,Dr,Dt,Kt;const J=vr();switch(l){case me.DateTime:return p.selectedDate?J?p.selectedDate.toLocaleString((pe=P.current)==null?void 0:pe.code,{dateStyle:J,timeStyle:J}):p.selectedDate.toLocaleString((Ae=P.current)==null?void 0:Ae.code):"";case me.DateOnly:return p.selectedDate?J?p.selectedDate.toLocaleDateString((Ct=P.current)==null?void 0:Ct.code,{dateStyle:J}):p.selectedDate.toLocaleDateString((Tr=P.current)==null?void 0:Tr.code):"";case me.TimeOnly:return p.selectedDate?J?p.selectedDate.toLocaleTimeString((Sr=P.current)==null?void 0:Sr.code,{timeStyle:J,hour12:p.timeFormat===Se.TwelveHour,hourCycle:p.timeFormat===Se.TwentyFourHour?"h23":void 0}):p.selectedDate.toLocaleTimeString((Pr=P.current)==null?void 0:Pr.code,{hour12:p.timeFormat===Se.TwelveHour,hourCycle:p.timeFormat===Se.TwentyFourHour?"h23":void 0}):"";case me.DateRange:return p.selectedStartDate&&p.selectedEndDate?J?`${p.selectedStartDate.toLocaleDateString((Er=P.current)==null?void 0:Er.code,{dateStyle:J})} - ${p.selectedEndDate.toLocaleDateString((kr=P.current)==null?void 0:kr.code,{dateStyle:J})}`:`${p.selectedStartDate.toLocaleDateString((Cr=P.current)==null?void 0:Cr.code)} - ${p.selectedEndDate.toLocaleDateString((Dr=P.current)==null?void 0:Dr.code)}`:"";default:return p.selectedDate?J?p.selectedDate.toLocaleString((Dt=P.current)==null?void 0:Dt.code,{dateStyle:J,timeStyle:J}):p.selectedDate.toLocaleString((Kt=P.current)==null?void 0:Kt.code):""}},kt=l===me.DateTime||l===me.DateOnly||l===me.DateRange,gn=l===me.DateTime||l===me.TimeOnly,Je=v===dr.None?{}:v===dr.Right?{rightElement:f.jsxs("div",{className:"bsc-flex bsc-text-black dark:bsc-text-mono-light-1",children:[a&&!r&&f.jsx("div",{children:f.jsx(Re,{icon:"close",size:_e.Small,className:"bsc-cursor-pointer bsc-text-sm",onClick:Ke})}),f.jsx("div",{className:"bsc-ml-2",onClick:r?void 0:Ie,children:x||f.jsx(Re,{icon:"calendar",size:_e.Small,className:r?void 0:"bsc-cursor-pointer"})})]}),rightElementClassName:"bsc-justify-center"}:{leftElement:f.jsxs("div",{className:"bsc-flex bsc-text-black dark:bsc-text-mono-light-1",children:[f.jsx("div",{className:"bsc-mr-2",onClick:r?void 0:Ie,children:x||f.jsx(Re,{icon:"calendar",size:_e.Small,className:r?void 0:"bsc-cursor-pointer"})}),a&&!r&&f.jsx("div",{children:f.jsx(Re,{icon:"close",size:_e.Small,className:"bsc-cursor-pointer bsc-text-sm",onClick:Ke})})]}),leftElementClassName:"bsc-justify-center"},xr=()=>f.jsxs(f.Fragment,{children:[p.currentSelector===ee.DaySelector&&kt&&p.dateInitialized&&P.current&&f.jsx(Nh,{selectedDate:p.selectedDate,viewDate:p.currentViewDate,locale:P.current,showTimeSelector:l===me.DateTime,selectableDate:D,isValidDate:N,dispatcher:j,onChange:M}),p.currentSelector===ee.MonthSelector&&kt&&p.dateInitialized&&P.current&&f.jsx(_h,{viewDate:p.currentViewDate,locale:P.current,dateSelection:l,dispatcher:j}),p.currentSelector===ee.YearSelector&&kt&&p.dateInitialized&&P.current&&f.jsx(Mh,{viewDate:p.currentViewDate,locale:P.current,dispatcher:j}),p.currentSelector===ee.TimeSelector&&gn&&p.dateInitialized&&P.current&&f.jsx(jh,{viewDate:p.currentViewDate,showDateSelector:l===me.DateTime,locale:P.current,timeFormat:p.timeFormat,timeConstraints:m,onChange:S,dispatcher:j}),p.currentSelector===ee.DateRangeSelector&&kt&&p.dateInitialized&&P.current&&f.jsx(Ih,{viewDate:p.currentViewDate,selectedStartDate:p.selectedStartDate,selectedEndDate:p.selectedEndDate,locale:P.current,onChange:S,dispatcher:j})]}),wr={label:t,readOnly:r,allowClear:a,getValue:Xe,onFocus:q,onInput:z,iconPosition:v,iconElement:Je.rightElement||Je.leftElement},Qt=F||((J,pe)=>f.jsx(f.Fragment,{children:pe})),et=ce("bsc-text-left",{"bc-read-only bsc-bg-gray-4 dark:bsc-bg-mono-dark-3":r,"bsc-bg-white dark:bsc-bg-mono-dark-1":!r},"bc-dt-input",c);return f.jsx(bn.Provider,{value:se.current,children:f.jsxs("div",{className:"bc-date-time",children:[t&&f.jsx(qe,{label:t,readOnly:r,className:"bc-dt-label"}),f.jsx(nn,{mobileMarkup:f.jsxs(f.Fragment,{children:[f.jsx(wt,{props:wr,template:Qt,children:f.jsx(sr,{value:Xe(),readOnly:r,inputMode:"none",className:et,onFocus:q,onElementCreate:J=>He(J,!1),...Je})}),f.jsx(fa,{visible:g,target:Y,hidden:Zt,unmountWhenHidden:!0,children:xr()})]}),aboveMobileMarkup:f.jsxs(f.Fragment,{children:[f.jsx(wt,{props:wr,template:Qt,children:s===!1?f.jsx(sr,{value:Xe(),readOnly:r,className:et,onFocus:q,onBlur:L,onInput:z,onElementCreate:J=>He(J,!1),...Je}):f.jsx(ya,{value:Xe(),readOnly:r,className:et,format:G,isInputValid:X,onFocus:q,onBlur:L,onChange:Q,onElementCreate:J=>He(J,!0),...Je})}),f.jsx(pa,{visible:g,target:Y,shouldTargetCloseOverlay:!1,shouldScrollCloseOverlay:!0,shouldCheckZIndex:!0,shouldRemainOnScreen:!0,hidden:Zt,isClickedWithin:H,unmountWhenHidden:!0,children:xr()})]})})]})})};function ft(e,r){var t,n;if(typeof r=="function")n=r(e),n!==void 0&&(e=n);else if(Array.isArray(r))for(t=0;t<r.length;t++)n=r[t](e),n!==void 0&&(e=n);return e}function $h(e,r){return e[0]==="-"&&Array.isArray(r)&&/^-\d+$/.test(e)?r.length+parseInt(e,10):e}function Fh(e){return/^\d+$/.test(e)}function mr(e){return Object.prototype.toString.call(e)==="[object Object]"}function Gt(e){return Object(e)===e}function br(e){return Object.keys(e).length===0}var Yh=["__proto__","prototype","constructor"],Hh=function(e){return Yh.indexOf(e)===-1};function gr(e,r){e.indexOf("[")>=0&&(e=e.replace(/\[/g,r).replace(/]/g,""));var t=e.split(r),n=t.filter(Hh);if(n.length!==t.length)throw Error("Refusing to update blacklisted property "+e);return t}var Sa=Object.prototype.hasOwnProperty;function oe(e,r,t,n){if(!(this instanceof oe))return new oe(e,r,t,n);typeof r>"u"&&(r=!1),typeof t>"u"&&(t=!0),typeof n>"u"&&(n=!0),this.separator=e||".",this.override=r,this.useArray=t,this.useBrackets=n,this.keepArray=!1,this.cleanup=[]}var Et=new oe(".",!1,!0,!0);function Ye(e){return function(){return Et[e].apply(Et,arguments)}}oe.prototype._fill=function(e,r,t,n){var s=e.shift();if(e.length>0){if(r[s]=r[s]||(this.useArray&&Fh(e[0])?[]:{}),!Gt(r[s]))if(this.override)r[s]={};else{if(!(Gt(t)&&br(t)))throw new Error("Trying to redefine `"+s+"` which is a "+typeof r[s]);return}this._fill(e,r[s],t,n)}else{if(!this.override&&Gt(r[s])&&!br(r[s])){if(!(Gt(t)&&br(t)))throw new Error("Trying to redefine non-empty obj['"+s+"']");return}r[s]=ft(t,n)}},oe.prototype.object=function(e,r){var t=this;return Object.keys(e).forEach(function(n){var s=r===void 0?null:r[n],a=gr(n,t.separator).join(t.separator);a.indexOf(t.separator)!==-1?(t._fill(a.split(t.separator),e,e[n],s),delete e[n]):e[n]=ft(e[n],s)}),e},oe.prototype.str=function(e,r,t,n){var s=gr(e,this.separator).join(this.separator);return e.indexOf(this.separator)!==-1?this._fill(s.split(this.separator),t,r,n):t[e]=ft(r,n),t},oe.prototype.pick=function(e,r,t,n){var s,a,o,i,c;for(a=gr(e,this.separator),s=0;s<a.length;s++)if(i=$h(a[s],r),r&&typeof r=="object"&&i in r){if(s===a.length-1)return t?(o=r[i],n&&Array.isArray(r)?r.splice(i,1):delete r[i],Array.isArray(r)&&(c=a.slice(0,-1).join("."),this.cleanup.indexOf(c)===-1&&this.cleanup.push(c)),o):r[i];r=r[i]}else return;return t&&Array.isArray(r)&&(r=r.filter(function(l){return l!==void 0})),r},oe.prototype.delete=function(e,r){return this.remove(e,r,!0)},oe.prototype.remove=function(e,r,t){var n;if(this.cleanup=[],Array.isArray(e)){for(n=0;n<e.length;n++)this.pick(e[n],r,!0,t);return t||this._cleanup(r),r}else return this.pick(e,r,!0,t)},oe.prototype._cleanup=function(e){var r,t,n,s;if(this.cleanup.length){for(t=0;t<this.cleanup.length;t++)n=this.cleanup[t].split("."),s=n.splice(0,-1).join("."),r=s?this.pick(s,e):e,r=r[n[0]].filter(function(a){return a!==void 0}),this.set(this.cleanup[t],r,e);this.cleanup=[]}},oe.prototype.del=oe.prototype.remove,oe.prototype.move=function(e,r,t,n,s){return typeof n=="function"||Array.isArray(n)?this.set(r,ft(this.pick(e,t,!0),n),t,s):(s=n,this.set(r,this.pick(e,t,!0),t,s)),t},oe.prototype.transfer=function(e,r,t,n,s,a){return typeof s=="function"||Array.isArray(s)?this.set(r,ft(this.pick(e,t,!0),s),n,a):(a=s,this.set(r,this.pick(e,t,!0),n,a)),n},oe.prototype.copy=function(e,r,t,n,s,a){return typeof s=="function"||Array.isArray(s)?this.set(r,ft(JSON.parse(JSON.stringify(this.pick(e,t,!1))),s),n,a):(a=s,this.set(r,this.pick(e,t,!1),n,a)),n},oe.prototype.set=function(e,r,t,n){var s,a,o,i;if(typeof r>"u")return t;for(o=gr(e,this.separator),s=0;s<o.length;s++){if(i=o[s],s===o.length-1)if(n&&mr(r)&&mr(t[i]))for(a in r)Sa.call(r,a)&&(t[i][a]=r[a]);else if(n&&Array.isArray(t[i])&&Array.isArray(r))for(var c=0;c<r.length;c++)t[o[s]].push(r[c]);else t[i]=r;else(!Sa.call(t,i)||!mr(t[i])&&!Array.isArray(t[i]))&&(/^\d+$/.test(o[s+1])?t[i]=[]:t[i]={});t=t[i]}return t},oe.prototype.transform=function(e,r,t){return r=r||{},t=t||{},Object.keys(e).forEach((function(n){this.set(e[n],this.pick(n,r),t)}).bind(this)),t},oe.prototype.dot=function(e,r,t){r=r||{},t=t||[];var n=Array.isArray(e);return Object.keys(e).forEach((function(s){var a=n&&this.useBrackets?"["+s+"]":s;if(Gt(e[s])&&(mr(e[s])&&!br(e[s])||Array.isArray(e[s])&&!this.keepArray&&e[s].length!==0))if(n&&this.useBrackets){var o=t[t.length-1]||"";return this.dot(e[s],r,t.slice(0,-1).concat(o+a))}else return this.dot(e[s],r,t.concat(a));else n&&this.useBrackets?r[t.join(this.separator).concat("["+s+"]")]=e[s]:r[t.concat(a).join(this.separator)]=e[s]}).bind(this)),r},oe.pick=Ye("pick"),oe.move=Ye("move"),oe.transfer=Ye("transfer"),oe.transform=Ye("transform"),oe.copy=Ye("copy"),oe.object=Ye("object"),oe.str=Ye("str"),oe.set=Ye("set"),oe.delete=Ye("delete"),oe.del=oe.remove=Ye("remove"),oe.dot=Ye("dot"),["override","overwrite"].forEach(function(e){Object.defineProperty(oe,e,{get:function(){return Et.override},set:function(r){Et.override=!!r}})}),["useArray","keepArray","useBrackets"].forEach(function(e){Object.defineProperty(oe,e,{get:function(){return Et[e]},set:function(r){Et[e]=r}})}),oe._process=ft;var Wh=oe;const yr=Or(Wh),Vh=({name:e,label:r,value:t,data:n,textField:s,valueField:a,readOnly:o=!1,orientation:i=Ne.Horizontal,isMultiSelect:c=!1,className:l,onChange:h,itemTemplate:m})=>{const[x,v]=d.useState(),[w,D]=d.useState([]),N=Ir(()=>n,[n]),S=d.useId();d.useEffect(()=>{if(c){const I=Array.isArray(t)?t.map(k=>k.toString()):t?[String(t)]:void 0;D(I??[])}else t&&v(t.toString())},[t]);const A=I=>c?w.findIndex(k=>k===I)>-1:x===I,B=I=>{const k=I.toString();if(c){const G=A(k);let O;G?O=w.filter(se=>se!=k):O=[...w,k],D(O),h==null||h({name:e,value:O})}else k!==x&&(v(k),h==null||h({name:e,value:k}))},F=I=>{const{value:k}=I.target;v(k),h==null||h({name:e,value:k})},g=I=>{const{value:k,checked:G}=I.target;let O;G?O=[...w,k]:O=w.filter(se=>se!=k),D(O),h==null||h({name:e,value:O})},$=(I,k,G,O)=>f.jsxs("label",{htmlFor:I,className:O,children:[f.jsx("input",{id:I,name:e,value:G,type:"checkbox",onChange:g,checked:A(G),className:"bsc-appearance-none"}),k]},I),_=(I,k,G,O)=>f.jsxs("label",{htmlFor:I,className:O,children:[f.jsx("input",{id:I,name:e,value:G,type:"radio",onChange:F,checked:A(G),className:"bsc-appearance-none"}),k]},I),W=Xt(Mt.FocusWithin),Y=d.useCallback((I,k)=>f.jsx(f.Fragment,{children:k}),[]),re=m||Y,te=(I,k,G)=>{const O=`element_${S}_${k}`,se=yr.pick(s,I),y=String(yr.pick(a,I)),C=k===0,V=k===G.length-1,p=ce("bc-group-button-item bsc-cursor-pointer bsc-border-solid bsc-p-2 bsc-font-medium",{"has-[:checked]:bsc-bg-primary-1 has-[:checked]:dark:bsc-bg-mono-light-1 has-[:checked]:bsc-text-white has-[:checked]:dark:bsc-text-mono-dark-1 dark:bsc-text-mono-light-1 bsc-text-gray-2 bsc-border-gray-3 dark:bsc-border-mono-light-2":!o,"bc-read-only has-[:checked]:bsc-bg-primary-4 has-[:checked]:dark:bsc-bg-mono-light-3 has-[:checked]:bsc-text-gray-5 has-[:checked]:dark:bsc-text-mono-dark-3 dark:bsc-text-mono-light-3 bsc-text-gray-3 bsc-border-gray-4 dark:bsc-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":C&&i===Ne.Horizontal,"bsc-border-t bsc-border-r bsc-border-l bsc-border-b bsc-rounded-r-md bsc-pr-2":V&&i===Ne.Horizontal,"bsc-border-t bsc-border-b":!C&&!V&&i===Ne.Horizontal,"bsc-border-l":!C&&i===Ne.Horizontal,"bsc-border-l bsc-border-r bsc-border-t bsc-rounded-t-md":C&&i===Ne.Vertical,"bsc-border bsc-rounded-b-md":V&&i===Ne.Vertical,"bsc-border-t bsc-border-l bsc-border-r":!C&&!V&&i===Ne.Vertical},W),j={itemId:O,selectedValue:c?w:x,itemText:se,itemValue:y,itemData:I,itemStyles:p,isSelected:A(y),isFirstItem:C,isLastItem:V,onItemChanged:B};return c?f.jsx(wt,{props:j,template:re,children:$(O,se,y,p)}):f.jsx(wt,{props:j,template:re,children:_(O,se,y,p)})},U=ce("bsc-flex bsc-flex-col bsc-gap-2",l),E=ce("bsc-flex",{"bsc-flex-col [width:max-content]":i===Ne.Vertical}),P=I=>f.jsx("div",{className:E,children:I.map(te)});return f.jsxs("div",{className:U,children:[r&&f.jsx(qe,{label:r,readOnly:o}),N&&P(N)]})},Bh=d.memo(Vh),zh=({id:e,name:r,label:t,value:n,checked:s=!1,labelLocation:a=Me.Right,readOnly:o=!1,useAnimation:i,onChange:c})=>{const l=jr(i),h=d.useCallback(v=>{c==null||c(v)},[c]),m=ce("bc-radio-item-wrapper bsc-flex bsc-items-center *:bsc-cursor-pointer",{"bc-read-only":o}),x=ce("bc-radio-item-outer bsc-relative *:bsc-size-[21px]",{"bsc-pl-1":a===Me.Left,"bsc-pr-1":a===Me.Right,"bsc-radio-item-animate":!o&&l,"bsc-radio-item":!o,"bc-read-only bsc-radio-item-read-only":o});return f.jsxs("div",{className:m,children:[a===Me.Left&&f.jsx(qe,{label:t,htmlFor:e,readOnly:o}),f.jsxs("label",{className:x,children:[f.jsx("input",{id:e,name:r,value:n,type:"radio",checked:s,onChange:h,className:"bc-radio-item-input-hidden bsc-hidden"}),f.jsxs("svg",{viewBox:"0 0 30 30",preserveAspectRatio:"xMidYMid meet",className:"bc-radio-item-svg",children:[f.jsx("circle",{cx:15,cy:15,r:13}),f.jsx("circle",{cx:"50%",cy:"50%",r:7})]})]}),a===Me.Right&&f.jsx(qe,{label:t,htmlFor:e,readOnly:o})]})},Uh=d.memo(zh),qh=({name:e,label:r,value:t,data:n,textField:s,valueField:a,readOnly:o=!1,labelLocation:i=Me.Right,orientation:c=Ne.Vertical,className:l,useAnimation:h,onChange:m})=>{const[x,v]=d.useState(t),w=Ir(()=>n,[n]),D=d.useId(),N=d.useCallback(g=>{const $=g.target.value;v($),m==null||m({name:e,value:$,originalEvent:g})},[e]),S=(g,$)=>{const _=`${D}_radio_${$}`,W=yr.pick(a,g);return f.jsx(Uh,{id:_,name:e,label:yr.pick(s,g),value:W,checked:W==x,labelLocation:i,readOnly:o,useAnimation:h,onChange:N},_)},A=ce("bc-radio-container bsc-flex bsc-flex-col bsc-gap-1",l),B=ce("bc-radio-wrapper bsc-flex bsc-gap-1",{"bsc-flex-col":c===Ne.Vertical,"[&>*]:bsc-pr-2":c===Ne.Horizontal}),F=g=>f.jsx("div",{className:B,children:g.map(S)});return f.jsxs("div",{className:A,children:[r&&f.jsx(qe,{label:r,readOnly:o}),w&&F(w)]})},Gh=d.memo(qh),Zh=({name:e,label:r,value:t,checked:n=!1,readOnly:s=!1,useAnimation:a,className:o,onChange:i})=>{const[c,l]=d.useState(!1),h=d.useId(),m=jr(a);d.useEffect(()=>{l(n)},[n]);const x=S=>{const{checked:A}=S.target;l(A),i==null||i({originalEvent:S,name:e||S.target.name,value:t||S.target.value,checked:A})},v=ce("bc-toggle-wrapper bsc-flex bsc-flex-col",o),w=Xt(Mt.FocusWithin),D=ce("bc-toggle-container bsc-toggle-switch bsc-flex bsc-mt-0.5 bsc-relative bsc-w-[70px] bsc-h-[30px] bsc-rounded-full [transition:background-color_1s]",{"bsc-cursor-pointer bsc-bg-gray-3 dark:bsc-bg-mono-dark-3 has-[:checked]:bsc-bg-primary-1 has-[:checked]:dark:bsc-bg-mono-light-2":!s,"bc-read-only bsc-pointer-events-none bsc-bg-gray-4 dark:bsc-bg-mono-dark-2 has-[:checked]:bsc-bg-primary-4 has-[:checked]:dark:bsc-bg-mono-light-3":s},w),N=ce("bc-toggle-switch bsc-absolute bsc-rounded-full dark:bsc-border dark:bsc-border-solid dark:bsc-border-mono-dark-1 bsc-w-[22px] bsc-h-[22px] 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,"[transition:0.3s]":!s&&m});return f.jsxs("div",{className:v,children:[r&&f.jsx(qe,{label:r,htmlFor:h,readOnly:s}),f.jsxs("label",{className:D,children:[f.jsx("input",{id:h,name:e,value:t,type:"checkbox",checked:c,onChange:x,className:"bsc-appearance-none"}),f.jsx("div",{id:"switch",className:N})]})]})},Qh=d.memo(Zh),fp="";K.BeeSoftProvider=ja,K.Button=We,K.Checkbox=_n,K.CheckboxGroup=Ja,K.ContentEditableInput=sr,K.DateFormatType=qt,K.DateSelectionType=me,K.DateTime=Lh,K.FormGroupItemOrientation=Ne,K.FormattedInput=ya,K.GroupButton=Bh,K.MediaQuery=nn,K.MobileOverlayPanel=fa,K.OverlayPanel=pa,K.RadioButton=Gh,K.SelectionLabelLocation=Me,K.Toggle=Qh,K.applyBeeSoftTheme=Ld,K.createBeeSoftTheme=$d,Object.defineProperty(K,Symbol.toStringTag,{value:"Module"})});
49
+ */var pn,ua;function oh(){if(ua)return pn;ua=1;var e=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,t=Object.prototype.propertyIsEnumerable;function n(a){if(a==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(a)}function s(){try{if(!Object.assign)return!1;var a=new String("abc");if(a[5]="de",Object.getOwnPropertyNames(a)[0]==="5")return!1;for(var o={},i=0;i<10;i++)o["_"+String.fromCharCode(i)]=i;var c=Object.getOwnPropertyNames(o).map(function(h){return o[h]});if(c.join("")!=="0123456789")return!1;var f={};return"abcdefghijklmnopqrst".split("").forEach(function(h){f[h]=h}),Object.keys(Object.assign({},f)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return pn=s()?Object.assign:function(a,o){for(var i,c=n(a),f,h=1;h<arguments.length;h++){i=Object(arguments[h]);for(var p in i)r.call(i,p)&&(c[p]=i[p]);if(e){f=e(i);for(var y=0;y<f.length;y++)t.call(i,f[y])&&(c[f[y]]=i[f[y]])}}return c},pn}var mn,la;function bn(){if(la)return mn;la=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return mn=e,mn}var gn,fa;function da(){return fa||(fa=1,gn=Function.call.bind(Object.prototype.hasOwnProperty)),gn}var yn,ha;function ih(){if(ha)return yn;ha=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var r=bn(),t={},n=da();e=function(a){var o="Warning: "+a;typeof console<"u"&&console.error(o);try{throw new Error(o)}catch{}}}function s(a,o,i,c,f){if(process.env.NODE_ENV!=="production"){for(var h in a)if(n(a,h)){var p;try{if(typeof a[h]!="function"){var y=Error((c||"React class")+": "+i+" type `"+h+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof a[h]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw y.name="Invariant Violation",y}p=a[h](o,h,c,i,null,r)}catch(w){p=w}if(p&&!(p instanceof Error)&&e((c||"React class")+": type specification of "+i+" `"+h+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof p+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),p instanceof Error&&!(p.message in t)){t[p.message]=!0;var x=f?f():"";e("Failed "+i+" type: "+p.message+(x??""))}}}}return s.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(t={})},yn=s,yn}var vn,pa;function ch(){if(pa)return vn;pa=1;var e=ca(),r=oh(),t=bn(),n=da(),s=ih(),a=function(){};process.env.NODE_ENV!=="production"&&(a=function(i){var c="Warning: "+i;typeof console<"u"&&console.error(c);try{throw new Error(c)}catch{}});function o(){return null}return vn=function(i,c){var f=typeof Symbol=="function"&&Symbol.iterator,h="@@iterator";function p(g){var _=g&&(f&&g[f]||g[h]);if(typeof _=="function")return _}var y="<<anonymous>>",x={array:S("array"),bigint:S("bigint"),bool:S("boolean"),func:S("function"),number:S("number"),object:S("object"),string:S("string"),symbol:S("symbol"),any:R(),arrayOf:U,element:F(),elementType:b(),instanceOf:A,node:ne(),objectOf:V,oneOf:k,oneOfType:B,shape:J,exact:N};function w(g,_){return g===_?g!==0||1/g===1/_:g!==g&&_!==_}function D(g,_){this.message=g,this.data=_&&typeof _=="object"?_:{},this.stack=""}D.prototype=Error.prototype;function O(g){if(process.env.NODE_ENV!=="production")var _={},z=0;function E(q,L,H,P,W,Z,Te){if(P=P||y,Z=Z||H,Te!==t){if(c){var j=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 j.name="Invariant Violation",j}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var je=P+":"+H;!_[je]&&z<3&&(a("You are manually calling a React.PropTypes validation function for the `"+Z+"` prop on `"+P+"`. 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."),_[je]=!0,z++)}}return L[H]==null?q?L[H]===null?new D("The "+W+" `"+Z+"` is marked as required "+("in `"+P+"`, but its value is `null`.")):new D("The "+W+" `"+Z+"` is marked as required in "+("`"+P+"`, but its value is `undefined`.")):null:g(L,H,P,W,Z)}var Y=E.bind(null,!1);return Y.isRequired=E.bind(null,!0),Y}function S(g){function _(z,E,Y,q,L,H){var P=z[E],W=C(P);if(W!==g){var Z=G(P);return new D("Invalid "+q+" `"+L+"` of type "+("`"+Z+"` supplied to `"+Y+"`, expected ")+("`"+g+"`."),{expectedType:g})}return null}return O(_)}function R(){return O(o)}function U(g){function _(z,E,Y,q,L){if(typeof g!="function")return new D("Property `"+L+"` of component `"+Y+"` has invalid PropType notation inside arrayOf.");var H=z[E];if(!Array.isArray(H)){var P=C(H);return new D("Invalid "+q+" `"+L+"` of type "+("`"+P+"` supplied to `"+Y+"`, expected an array."))}for(var W=0;W<H.length;W++){var Z=g(H,W,Y,q,L+"["+W+"]",t);if(Z instanceof Error)return Z}return null}return O(_)}function F(){function g(_,z,E,Y,q){var L=_[z];if(!i(L)){var H=C(L);return new D("Invalid "+Y+" `"+q+"` of type "+("`"+H+"` supplied to `"+E+"`, expected a single ReactElement."))}return null}return O(g)}function b(){function g(_,z,E,Y,q){var L=_[z];if(!e.isValidElementType(L)){var H=C(L);return new D("Invalid "+Y+" `"+q+"` of type "+("`"+H+"` supplied to `"+E+"`, expected a single ReactElement type."))}return null}return O(g)}function A(g){function _(z,E,Y,q,L){if(!(z[E]instanceof g)){var H=g.name||y,P=ee(z[E]);return new D("Invalid "+q+" `"+L+"` of type "+("`"+P+"` supplied to `"+Y+"`, expected ")+("instance of `"+H+"`."))}return null}return O(_)}function k(g){if(!Array.isArray(g))return process.env.NODE_ENV!=="production"&&(arguments.length>1?a("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])."):a("Invalid argument supplied to oneOf, expected an array.")),o;function _(z,E,Y,q,L){for(var H=z[E],P=0;P<g.length;P++)if(w(H,g[P]))return null;var W=JSON.stringify(g,function(Te,j){var je=G(j);return je==="symbol"?String(j):j});return new D("Invalid "+q+" `"+L+"` of value `"+String(H)+"` "+("supplied to `"+Y+"`, expected one of "+W+"."))}return O(_)}function V(g){function _(z,E,Y,q,L){if(typeof g!="function")return new D("Property `"+L+"` of component `"+Y+"` has invalid PropType notation inside objectOf.");var H=z[E],P=C(H);if(P!=="object")return new D("Invalid "+q+" `"+L+"` of type "+("`"+P+"` supplied to `"+Y+"`, expected an object."));for(var W in H)if(n(H,W)){var Z=g(H,W,Y,q,L+"."+W,t);if(Z instanceof Error)return Z}return null}return O(_)}function B(g){if(!Array.isArray(g))return process.env.NODE_ENV!=="production"&&a("Invalid argument supplied to oneOfType, expected an instance of array."),o;for(var _=0;_<g.length;_++){var z=g[_];if(typeof z!="function")return a("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+v(z)+" at index "+_+"."),o}function E(Y,q,L,H,P){for(var W=[],Z=0;Z<g.length;Z++){var Te=g[Z],j=Te(Y,q,L,H,P,t);if(j==null)return null;j.data&&n(j.data,"expectedType")&&W.push(j.data.expectedType)}var je=W.length>0?", expected one of type ["+W.join(", ")+"]":"";return new D("Invalid "+H+" `"+P+"` supplied to "+("`"+L+"`"+je+"."))}return O(E)}function ne(){function g(_,z,E,Y,q){return $(_[z])?null:new D("Invalid "+Y+" `"+q+"` supplied to "+("`"+E+"`, expected a ReactNode."))}return O(g)}function te(g,_,z,E,Y){return new D((g||"React class")+": "+_+" type `"+z+"."+E+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+Y+"`.")}function J(g){function _(z,E,Y,q,L){var H=z[E],P=C(H);if(P!=="object")return new D("Invalid "+q+" `"+L+"` of type `"+P+"` "+("supplied to `"+Y+"`, expected `object`."));for(var W in g){var Z=g[W];if(typeof Z!="function")return te(Y,q,L,W,G(Z));var Te=Z(H,W,Y,q,L+"."+W,t);if(Te)return Te}return null}return O(_)}function N(g){function _(z,E,Y,q,L){var H=z[E],P=C(H);if(P!=="object")return new D("Invalid "+q+" `"+L+"` of type `"+P+"` "+("supplied to `"+Y+"`, expected `object`."));var W=r({},z[E],g);for(var Z in W){var Te=g[Z];if(n(g,Z)&&typeof Te!="function")return te(Y,q,L,Z,G(Te));if(!Te)return new D("Invalid "+q+" `"+L+"` key `"+Z+"` supplied to `"+Y+"`.\nBad object: "+JSON.stringify(z[E],null," ")+`
50
+ Valid keys: `+JSON.stringify(Object.keys(g),null," "));var j=Te(H,Z,Y,q,L+"."+Z,t);if(j)return j}return null}return O(_)}function $(g){switch(typeof g){case"number":case"string":case"undefined":return!0;case"boolean":return!g;case"object":if(Array.isArray(g))return g.every($);if(g===null||i(g))return!0;var _=p(g);if(_){var z=_.call(g),E;if(_!==g.entries){for(;!(E=z.next()).done;)if(!$(E.value))return!1}else for(;!(E=z.next()).done;){var Y=E.value;if(Y&&!$(Y[1]))return!1}}else return!1;return!0;default:return!1}}function I(g,_){return g==="symbol"?!0:_?_["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&_ instanceof Symbol:!1}function C(g){var _=typeof g;return Array.isArray(g)?"array":g instanceof RegExp?"object":I(_,g)?"symbol":_}function G(g){if(typeof g>"u"||g===null)return""+g;var _=C(g);if(_==="object"){if(g instanceof Date)return"date";if(g instanceof RegExp)return"regexp"}return _}function v(g){var _=G(g);switch(_){case"array":case"object":return"an "+_;case"boolean":case"date":case"regexp":return"a "+_;default:return _}}function ee(g){return!g.constructor||!g.constructor.name?y:g.constructor.name}return x.checkPropTypes=s,x.resetWarningCache=s.resetWarningCache,x.PropTypes=x,x},vn}var xn,ma;function uh(){if(ma)return xn;ma=1;var e=bn();function r(){}function t(){}return t.resetWarningCache=r,xn=function(){function n(o,i,c,f,h,p){if(p!==e){var y=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 y.name="Invariant Violation",y}}n.isRequired=n;function s(){return n}var a={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:t,resetWarningCache:r};return a.PropTypes=a,a},xn}if(process.env.NODE_ENV!=="production"){var lh=ca(),fh=!0;hn.exports=ch()(lh.isElement,fh)}else hn.exports=uh()();var dh=hn.exports;const re=Ar(dh),ba={disabled:!1};var hh=process.env.NODE_ENV!=="production"?re.oneOfType([re.number,re.shape({enter:re.number,exit:re.number,appear:re.number}).isRequired]):null;process.env.NODE_ENV!=="production"&&re.oneOfType([re.string,re.shape({enter:re.string,exit:re.string,active:re.string}),re.shape({enter:re.string,enterDone:re.string,enterActive:re.string,exit:re.string,exitDone:re.string,exitActive:re.string})]);const ga=d.createContext(null);var ph=function(r){return r.scrollTop},Gt="unmounted",lt="exited",ft="entering",Pt="entered",wn="exiting",Ke=function(e){nh(r,e);function r(n,s){var a;a=e.call(this,n,s)||this;var o=s,i=o&&!o.isMounting?n.enter:n.appear,c;return a.appearStatus=null,n.in?i?(c=lt,a.appearStatus=ft):c=Pt:n.unmountOnExit||n.mountOnEnter?c=Gt:c=lt,a.state={status:c},a.nextCallback=null,a}r.getDerivedStateFromProps=function(s,a){var o=s.in;return o&&a.status===Gt?{status:lt}:null};var t=r.prototype;return t.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},t.componentDidUpdate=function(s){var a=null;if(s!==this.props){var o=this.state.status;this.props.in?o!==ft&&o!==Pt&&(a=ft):(o===ft||o===Pt)&&(a=wn)}this.updateStatus(!1,a)},t.componentWillUnmount=function(){this.cancelNextCallback()},t.getTimeouts=function(){var s=this.props.timeout,a,o,i;return a=o=i=s,s!=null&&typeof s!="number"&&(a=s.exit,o=s.enter,i=s.appear!==void 0?s.appear:o),{exit:a,enter:o,appear:i}},t.updateStatus=function(s,a){if(s===void 0&&(s=!1),a!==null)if(this.cancelNextCallback(),a===ft){if(this.props.unmountOnExit||this.props.mountOnEnter){var o=this.props.nodeRef?this.props.nodeRef.current:Fe.findDOMNode(this);o&&ph(o)}this.performEnter(s)}else this.performExit();else this.props.unmountOnExit&&this.state.status===lt&&this.setState({status:Gt})},t.performEnter=function(s){var a=this,o=this.props.enter,i=this.context?this.context.isMounting:s,c=this.props.nodeRef?[i]:[Fe.findDOMNode(this),i],f=c[0],h=c[1],p=this.getTimeouts(),y=i?p.appear:p.enter;if(!s&&!o||ba.disabled){this.safeSetState({status:Pt},function(){a.props.onEntered(f)});return}this.props.onEnter(f,h),this.safeSetState({status:ft},function(){a.props.onEntering(f,h),a.onTransitionEnd(y,function(){a.safeSetState({status:Pt},function(){a.props.onEntered(f,h)})})})},t.performExit=function(){var s=this,a=this.props.exit,o=this.getTimeouts(),i=this.props.nodeRef?void 0:Fe.findDOMNode(this);if(!a||ba.disabled){this.safeSetState({status:lt},function(){s.props.onExited(i)});return}this.props.onExit(i),this.safeSetState({status:wn},function(){s.props.onExiting(i),s.onTransitionEnd(o.exit,function(){s.safeSetState({status:lt},function(){s.props.onExited(i)})})})},t.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},t.safeSetState=function(s,a){a=this.setNextCallback(a),this.setState(s,a)},t.setNextCallback=function(s){var a=this,o=!0;return this.nextCallback=function(i){o&&(o=!1,a.nextCallback=null,s(i))},this.nextCallback.cancel=function(){o=!1},this.nextCallback},t.onTransitionEnd=function(s,a){this.setNextCallback(a);var o=this.props.nodeRef?this.props.nodeRef.current:Fe.findDOMNode(this),i=s==null&&!this.props.addEndListener;if(!o||i){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var c=this.props.nodeRef?[this.nextCallback]:[o,this.nextCallback],f=c[0],h=c[1];this.props.addEndListener(f,h)}s!=null&&setTimeout(this.nextCallback,s)},t.render=function(){var s=this.state.status;if(s===Gt)return null;var a=this.props,o=a.children;a.in,a.mountOnEnter,a.unmountOnExit,a.appear,a.enter,a.exit,a.timeout,a.addEndListener,a.onEnter,a.onEntering,a.onEntered,a.onExit,a.onExiting,a.onExited,a.nodeRef;var i=rh(a,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return d.createElement(ga.Provider,{value:null},typeof o=="function"?o(s,i):d.cloneElement(d.Children.only(o),i))},r}(d.Component);Ke.contextType=ga,Ke.propTypes=process.env.NODE_ENV!=="production"?{nodeRef:re.shape({current:typeof Element>"u"?re.any:function(e,r,t,n,s,a){var o=e[r];return re.instanceOf(o&&"ownerDocument"in o?o.ownerDocument.defaultView.Element:Element)(e,r,t,n,s,a)}}),children:re.oneOfType([re.func.isRequired,re.element.isRequired]).isRequired,in:re.bool,mountOnEnter:re.bool,unmountOnExit:re.bool,appear:re.bool,enter:re.bool,exit:re.bool,timeout:function(r){var t=hh;r.addEndListener||(t=t.isRequired);for(var n=arguments.length,s=new Array(n>1?n-1:0),a=1;a<n;a++)s[a-1]=arguments[a];return t.apply(void 0,[r].concat(s))},addEndListener:re.func,onEnter:re.func,onEntering:re.func,onEntered:re.func,onExit:re.func,onExiting:re.func,onExited:re.func}:{};function Et(){}Ke.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Et,onEntering:Et,onEntered:Et,onExit:Et,onExiting:Et,onExited:Et},Ke.UNMOUNTED=Gt,Ke.EXITED=lt,Ke.ENTERING=ft,Ke.ENTERED=Pt,Ke.EXITING=wn;const mh=Ke,ya=({start:e,timeout:r=400,defaultStyle:t,transitionStyles:n,showTransitionOptions:s="cubic-bezier(0, 0, 0.2, 1)",hideTransitionOptions:a="linear",unmountOnExit:o=!1,onEntering:i,onEntered:c,onExit:f,onExited:h,children:p})=>{const y=t||{transition:`opacity ${r}ms ${s}`,opacity:0},x=n||{entering:{opacity:1},entered:{opacity:1},exiting:{transition:`opacity ${r}ms ${a}`,opacity:0},exited:{transition:`opacity ${r}ms ${a}`,opacity:0},unmounted:{}};return l.jsx(mh,{in:e,timeout:r,onEntering:i,onEntered:c,onExit:f,onExited:h,unmountOnExit:o,children:w=>p({state:w,defaultStyle:y,transitionStyles:x})})};function va(e){return e.target?e.target:e}const xa=({visible:e,target:r,appendTo:t=document.body,unmountWhenHidden:n=!1,transitionDuration:s=400,showTransitionOptions:a="cubic-bezier(0, 0, 0.2, 1)",hideTransitionOptions:o="linear",approveText:i="DONE",shown:c,hidden:f,isClickedWithin:h,children:p})=>{const[y,x]=d.useState(-1),[w,D]=d.useState(-1),[O,S]=d.useState(e),R=d.useRef(100),U=d.useRef(101),F=d.useRef(),b=d.useRef(),A=d.useRef();d.useEffect(()=>{r&&(F.current=va(r));const N=Wn("zIndex",$=>$==="auto"||$==="-1"?!1:parseInt($)>100).map($=>parseInt($,10));N.length>0&&(R.current=Math.max(...N)+1,U.current=Math.max(...N)+2),S(e)},[e,r]);const k=N=>{b.current=N},V=()=>{D(R.current),x(U.current)},B=()=>{if(!b.current)return;c==null||c();let N;F.current&&(N=[F.current]);const $=I=>{I?h==null||h():S(!1)};A.current=na(b.current,$,N)},ne=()=>{A.current&&sa(A.current)},te=()=>{D(-1),x(-1),f==null||f()},J={entering:{opacity:.5},entered:{opacity:.5}};return Fe.createPortal(l.jsx(ya,{start:O,timeout:s,showTransitionOptions:a,hideTransitionOptions:o,onEntering:V,onEntered:B,onExit:ne,onExited:te,unmountOnExit:n,children:({state:N,defaultStyle:$,transitionStyles:I})=>l.jsxs("div",{ref:C=>C&&k(C),children:[l.jsx("div",{className:"bsc-fixed bsc-left-0 bsc-top-0 bsc-h-full bsc-w-full bsc-bg-mono-dark-1",style:{zIndex:w,...I[N],...J[N]}}),l.jsxs("div",{className:"dark:bsck-border-mono-light-1 bsc-fixed bsc-bottom-0 bsc-left-0 bsc-w-full bsc-bg-white dark:bsc-border-t dark:bsc-border-solid dark:bsc-bg-mono-dark-1 dark:bsc-text-mono-light-1",style:{zIndex:y,...$,...I[N]},children:[l.jsx("div",{className:"bsc-w-full",children:p}),l.jsx(l.Fragment,{children:l.jsx(Ve,{buttonType:"primary",fullWidth:!0,onClick:()=>S(!1),className:"bsc-text-xs bsc-font-bold",children:i})})]})]})}),t)};var wa=(e=>(e[e.TopLeft=0]="TopLeft",e[e.TopRight=1]="TopRight",e[e.BottomLeft=2]="BottomLeft",e[e.BottomRight=3]="BottomRight",e))(wa||{}),Ta=(e=>(e[e.TopLeft=0]="TopLeft",e[e.TopRight=1]="TopRight",e[e.BottomLeft=2]="BottomLeft",e[e.BottomRight=3]="BottomRight",e))(Ta||{});class xe{static positionToTarget(r,t=2){const n=r.getBoundingClientRect();let s=0,a=0;const o=window.scrollY;switch(t){case 2:s=n.top+n.height+o,a=n.left;break;case 0:s=n.top+o,a=n.left;break;case 3:s=n.top+n.height+o,a=n.left+n.width;break;case 1:s=n.top+o,a=n.left+n.width}return{top:s,left:a}}static positionElementToTarget(r,t,n=0,s=2){let{left:a,top:o}=xe.positionToTarget(t,s);const i=r.getBoundingClientRect();switch(n){case 0:break;case 1:a=a-i.width;break;case 2:o=o-i.height;break;case 3:o=o-i.height,a=a-i.width;break}return{top:o,left:a}}static canPositionElementOnScreenWithTarget(r,t){const n=xe.getScreenDimensions(),s=r.getBoundingClientRect(),a=xe.positionElementToTarget(r,t,0,2);if(a.left+s.width<n.width&&a.top+s.height<n.height||xe.positionElementToTarget(r,t,1,3).left>=0&&a.top+s.height<n.height)return!0;const i=xe.positionElementToTarget(r,t,2,0);if(i.left+s.width<n.width&&i.top>=0)return!0;const c=xe.positionElementToTarget(r,t,3,1);return c.left>=0&&c.top>=0}static canPositionElementOnScreen(r){const t=xe.getScreenDimensions(),n=r.getBoundingClientRect();return n.width<=t.width&&n.height<=t.height}static positionElementToTargetOnScreen(r,t,n=0,s=2){const{left:a,top:o}=xe.positionElementToTarget(r,t,n,s),i=r.getBoundingClientRect(),c=xe.determineOffScreenLocation(i);if(c){if(n===0&&s===2){if(c.right&&!c.bottom)return xe.positionElementToTarget(r,t,1,3);if(c.bottom&&!c.right)return xe.positionElementToTarget(r,t,2,0);if(c.right&&c.bottom)return xe.positionElementToTarget(r,t,3,1)}else if(n===1&&s===3){if(c.left&&!c.bottom)return xe.positionElementToTarget(r,t,0,2);if(c.bottom&&!c.left)return xe.positionElementToTarget(r,t,3,1);if(c.left&&c.bottom)return xe.positionElementToTarget(r,t,2,0)}}return{top:o,left:a}}static determineOffScreenLocation(r){const t=xe.getScreenDimensions(),n={left:r.left<0,top:r.top<0,right:r.left+r.width>t.width,bottom:r.top+r.height>t.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 Sa=({visible:e,target:r,targetPosition:t=wa.BottomLeft,elementAlignment:n=Ta.TopLeft,shouldTargetCloseOverlay:s=!0,shouldMatchTargetWidth:a=!1,shouldScrollCloseOverlay:o=!1,shouldCheckZIndex:i=!1,shouldRemainOnScreen:c=!1,unmountWhenHidden:f=!1,transitionDuration:h=400,showTransitionOptions:p="cubic-bezier(0, 0, 0.2, 1)",hideTransitionOptions:y="linear",shown:x,hidden:w,isClickedWithin:D,markupCreated:O,children:S})=>{const[R,U]=d.useState(-1),[F,b]=d.useState(e),[A,k]=d.useState(!1),V=d.useRef(!1),B=d.useRef(100),ne=d.useRef({left:0,top:0,width:0}),te=d.useRef(),J=d.useRef(),N=d.useRef(),$=d.useRef(),I=d.useRef(),C=d.useRef(),G=Nn();d.useEffect(()=>(c===!0&&(C.current=new ResizeObserver(v)),()=>{var L,H;c===!0&&(J.current&&((L=C.current)==null||L.unobserve(J.current)),(H=C.current)==null||H.disconnect())}),[]),d.useEffect(()=>{if(r&&(te.current=va(r),o)){const L=G==null?void 0:G.isValidScrollableElement;N.current=Hn(te.current,{overflow:"scroll, auto",overflowX:"scroll, auto",overflowY:"scroll, auto"},!1,L),N.current.tagName.toLowerCase()==="html"&&(N.current=document)}if(i){const L=Wn("zIndex",H=>parseInt(H)>=100).map(H=>parseInt(H));L.length>0&&(B.current=Math.max(...L)+1)}e!==void 0&&b(e)},[r,e,o,i]);const v=L=>{if(J.current){const H=xe.getScreenDimensions(),P=L[L.length-1].target,W=P.getBoundingClientRect(),Z=xe.determineOffScreenLocation(W);if(Z){if(te.current&&xe.canPositionElementOnScreenWithTarget(P,te.current)){const Te=xe.positionElementToTargetOnScreen(J.current,te.current,n,t);ne.current={...ne.current,...Te}}else Z.right?ne.current.left=H.width-W.width:Z.left&&(ne.current.left=0),Z.bottom?ne.current.top=H.height-W.height:Z.top&&(ne.current.top=0);ee()}}},ee=Vt(()=>{V.current=!V.current,k(V.current)},20),g=()=>{U(B.current)},_=()=>{if(!J.current)return;x==null||x();let L;!s&&te.current&&(L=[te.current]);const H=P=>{P?D==null||D():b(!1)};$.current=na(J.current,H,L),o&&(I.current=_l(P=>J.current&&Xa(P,J.current)&&b(!1),100,{leading:!0}),N.current&&N.current.addEventListener("scroll",I.current))},z=()=>{N.current&&I.current&&(N.current.removeEventListener("scroll",I.current),I.current=void 0),$.current&&sa($.current)},E=()=>{U(-1),w==null||w()},Y=L=>{var H,P;if(c===!0&&J.current&&((H=C.current)==null||H.unobserve(J.current)),J.current=L,O==null||O(L),te.current){const W=xe.positionElementToTarget(J.current,te.current,n,t);ne.current={...W,width:te.current.offsetWidth},c===!0&&(xe.canPositionElementOnScreenWithTarget(J.current,te.current)||xe.canPositionElementOnScreen(J.current))&&((P=C.current)==null||P.observe(J.current))}},q=d.useMemo(()=>{const L={top:`${ne.current.top}px`,left:`${ne.current.left}px`,zIndex:R};return a&&(L.width=`${ne.current.width}px`),L},[A,R,a]);return l.jsx(ya,{start:F,timeout:h,showTransitionOptions:p,hideTransitionOptions:y,onEntering:g,onEntered:_,onExit:z,onExited:E,unmountOnExit:f,children:({state:L,defaultStyle:H,transitionStyles:P})=>l.jsx("div",{className:"bsc-fixed bsc-border bsc-border-solid bsc-bg-white bsc-shadow dark:bsc-border-mono-light-1 dark:bsc-bg-mono-dark-1 dark:bsc-text-mono-light-1",style:{...q,...H,...P[L]},ref:W=>W&&Y(W),children:S})})};let vr;const bh=new Uint8Array(16);function gh(){if(!vr&&(vr=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!vr))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return vr(bh)}const _e=[];for(let e=0;e<256;++e)_e.push((e+256).toString(16).slice(1));function yh(e,r=0){return _e[e[r+0]]+_e[e[r+1]]+_e[e[r+2]]+_e[e[r+3]]+"-"+_e[e[r+4]]+_e[e[r+5]]+"-"+_e[e[r+6]]+_e[e[r+7]]+"-"+_e[e[r+8]]+_e[e[r+9]]+"-"+_e[e[r+10]]+_e[e[r+11]]+_e[e[r+12]]+_e[e[r+13]]+_e[e[r+14]]+_e[e[r+15]]}const Pa={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function vh(e,r,t){if(Pa.randomUUID&&!r&&!e)return Pa.randomUUID();e=e||{};const n=e.random||(e.rng||gh)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,r){t=t||0;for(let s=0;s<16;++s)r[t+s]=n[s];return r}return yh(n)}class xr{static create(r){const t=[];let n=0;for(let s=0,a=r.formatParts.length;s<a;s++){const o=r.formatParts[s],i=n,c=i+o.characterCount;t.push({startPosition:i,endPosition:c,...o}),n=c}return t}}class xh{constructor(r,t){m(this,"instanceCollection");m(this,"formatPartList");m(this,"inputSlotCollection");m(this,"currentPartIndex",0);m(this,"currentCursorPosition",0);m(this,"inputElement");m(this,"inputSelection",null);m(this,"inputRange");m(this,"textNode");this.instanceCollection=kt.getInstance(),this.formatPartList=xr.create(r),this.inputSlotCollection=this.instanceCollection.getInputSlotInstance(t,r)}getCursorPosition(){return this.currentCursorPosition}getCurrentPartIndex(){return this.currentPartIndex}setInputElement(r){this.inputElement=r}setCursorToCurrentPosition(){this.setCursorSelection(this.currentCursorPosition)}setCursorPosition(r){this.setCursorSelection(r)}setCursorSelection(r,t){this.createInputRangeSelection(),this.inputRange&&this.textNode&&(this.inputRange.setStart(this.textNode,r),this.inputRange.setEnd(this.textNode,t||r),this.currentCursorPosition=t||r,this.setPartIndexByCursorPosition())}findCursorPosition(){var t,n;const r=(t=window.getSelection())==null?void 0:t.getRangeAt(0);if(this.inputElement&&r){const s=document.createTreeWalker(this.inputElement,NodeFilter.SHOW_TEXT,c=>{const f=document.createRange();return f.selectNodeContents(c),f.compareBoundaryPoints(Range.END_TO_END,r)<1?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT});let a=0;for(;s.nextNode();)a+=((n=s.currentNode.textContent)==null?void 0:n.length)||0;r.startContainer.nodeType===Node.TEXT_NODE&&(a+=r.startOffset);const o=this.inputSlotCollection.getLastSlotWithData(),i=o.startPosition+o.partText.length;this.setCursorSelection(a>i?i:a)}}isAtLastPart(){return this.currentPartIndex===this.formatPartList.length-1}moveHome(){const r=this.inputSlotCollection.getFirstSlot();this.setCursorSelection(r.startPosition)}moveEnd(){const r=this.inputSlotCollection.getLastSlotWithData(),t=r.startPosition+r.partText.length;this.setCursorSelection(t)}moveCursorLeft(){if(this.currentCursorPosition>0){const r=this.currentCursorPosition-1;let t=this.formatPartList[this.currentPartIndex];if(r>=t.startPosition&&r<=t.endPosition)this.setCursorSelection(r);else for(let n=this.currentPartIndex-1;n>=0;n--)t=this.formatPartList[n],r>=t.startPosition&&r<=t.endPosition&&(t.isSeparator?this.setCursorSelection(this.formatPartList[n-1].endPosition):this.setCursorSelection(r))}}moveCursorRight(){const r=this.inputSlotCollection.getLastSlotWithData(),t=r.startPosition+r.partText.length;if(this.currentCursorPosition<t){const n=this.currentCursorPosition+1;let s=this.formatPartList[this.currentPartIndex];if(n>=s.startPosition&&n<=s.endPosition)this.setCursorSelection(n);else for(let a=this.currentPartIndex+1,o=this.formatPartList.length;a<o;a++)s=this.formatPartList[a],n>=s.startPosition&&n<=s.endPosition&&(s.isSeparator?this.setCursorSelection(this.formatPartList[a+1].startPosition):this.setCursorSelection(n))}}moveToNextInputPart(){if(this.currentPartIndex<this.formatPartList.length-1){const r=this.findNextEditablePart();r&&(this.currentPartIndex=r.partIndex,this.setCursorSelection(r.startPosition))}}moveToPreviousInputPart(){if(this.currentPartIndex>0){const r=this.findPreviousEditablePart();r&&(this.currentPartIndex=r.partIndex,this.setCursorSelection(r.endPosition))}}findNextEditablePart(){return this.inputSlotCollection.getNextSlot(this.currentPartIndex)}findPreviousEditablePart(){return this.inputSlotCollection.getPreviousSlot(this.currentPartIndex)}setPartIndexByCursorPosition(){for(let r=0;r<this.formatPartList.length;r++){const t=this.formatPartList[r];if(this.currentCursorPosition>=t.startPosition&&this.currentCursorPosition<=t.endPosition){if(t.isSeparator){this.currentCursorPosition=this.formatPartList[r+1].startPosition,this.currentPartIndex=r+1;break}this.currentPartIndex=r;break}}}createInputRangeSelection(){var r,t;this.inputElement&&(this.inputSelection=window.getSelection(),this.inputRange=document.createRange(),(r=this.inputSelection)==null||r.removeAllRanges(),this.inputRange.selectNodeContents(this.inputElement),this.inputRange.collapse(!0),(t=this.inputSelection)==null||t.addRange(this.inputRange),this.inputElement.firstChild&&(this.textNode=this.inputElement.firstChild))}}class wh{static create(r){const t=[];for(let n=0,s=r.length;n<s;n++){const a=r[n];a.isSeparator||t.push({partIndex:n,partText:"",isComplete:!1,...a})}return t}}class Th{constructor(r){m(this,"inputSlots");this.inputSlots=wh.create(xr.create(r))}clearAllSlots(){for(let r=0,t=this.inputSlots.length;r<t;r++)this.inputSlots[r].partText=""}getSlot(r){return this.inputSlots.find(t=>t.partIndex===r)}getFirstSlot(){return this.inputSlots[0]}getNextSlot(r){const t=this.inputSlots.findIndex(n=>n.partIndex===r);if(t>-1&&t+1<this.inputSlots.length)return this.inputSlots[t+1]}getPreviousSlot(r){const t=this.inputSlots.findIndex(n=>n.partIndex===r);if(t>-1&&t-1>=0)return this.inputSlots[t-1]}getLastSlotWithData(){const r=this.inputSlots.findIndex(n=>!n.isComplete);let t=r;for(let n=r+1,s=this.inputSlots.length;n<s;n++)this.inputSlots[n].partText.length>0&&(t=n);return this.inputSlots[t>-1?t:0]}allSlotsCompleted(){return this.inputSlots.every(r=>r.isComplete)}allSlotsEmpty(){return this.inputSlots.every(r=>r.partText.length===0)}}class kt{static getInstance(){return this.instance||(this.instance=new Sh),this.instance}}m(kt,"instance");class Sh{constructor(){m(this,"navigatorInstances");m(this,"inputSlotInstances");this.navigatorInstances={},this.inputSlotInstances={}}getNavigatorInstance(r,t){return this.navigatorInstances[r]||(this.navigatorInstances[r]=new xh(t,r)),this.navigatorInstances[r]}getInputSlotInstance(r,t){return this.inputSlotInstances[r]||(this.inputSlotInstances[r]=new Th(t)),this.inputSlotInstances[r]}removeInstances(r){this.navigatorInstances[r]&&delete this.navigatorInstances[r],this.inputSlotInstances[r]&&delete this.inputSlotInstances[r]}}class Tn{constructor(r,t){m(this,"instanceCollection");m(this,"formatPartList");m(this,"inputSlotCollection");m(this,"inputElement");this.instanceCollection=kt.getInstance(),this.formatPartList=xr.create(r),this.inputSlotCollection=this.instanceCollection.getInputSlotInstance(t,r)}setInputElement(r){this.inputElement=r}render(){var t;let r="";for(let n=0,s=this.formatPartList.length;n<s;n++){const a=this.formatPartList[n];if(a.isSeparator)r+=a.inputText;else{const o=this.inputSlotCollection.getSlot(n);o&&(r+=o.partText+((t=o.inputText)==null?void 0:t.repeat(o.characterCount-o.partText.length)))}}this.inputElement&&(this.inputElement.innerHTML=r)}}var qe=(e=>(e[e.Text=0]="Text",e[e.Numeric=1]="Numeric",e))(qe||{});class Ea{constructor(){m(this,"numberKeys",["0","1","2","3","4","5","6","7","8","9"]);m(this,"movementKeys",["ArrowLeft","ArrowRight","Home","End"]);m(this,"editingKeys",["Backspace","Delete"]);m(this,"ignoreKeys",["Shift","Alt","Control","Fn","Meta"])}isNumberKey(r){return this.numberKeys.includes(r)}isMovementKey(r){return this.movementKeys.includes(r.key)}isEditingKey(r){return this.editingKeys.includes(r.key)}isIgnoreKey(r){return this.ignoreKeys.includes(r.key)}}class Ph{constructor(r){m(this,"_currentIndex",0);m(this,"index",0);m(this,"formatParts");this.formatParts=xr.create(r)}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 ka{constructor(r,t){m(this,"instanceCollection");m(this,"inputSlotCollection");m(this,"formatNavigator");m(this,"keyTypeChecker");m(this,"formatRenderer");m(this,"formatPartList");this.format=r,this.instanceCollection=kt.getInstance(),this.inputSlotCollection=this.instanceCollection.getInputSlotInstance(t,r),this.formatNavigator=this.instanceCollection.getNavigatorInstance(t,r),this.keyTypeChecker=new Ea,this.formatRenderer=new Tn(r,t),this.formatPartList=new Ph(r)}setInputElement(r){this.formatRenderer.setInputElement(r)}processKeyPress(r){if(this.keyTypeChecker.isEditingKey(r)){this.processEditRules(r);return}this.processInputRules(r)}processInputValue(r){var n;this.inputSlotCollection.clearAllSlots(),this.formatPartList.reset();let t=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 a=this.formatPartList.currentIndex,o=this.formatPartList.next();if(o&&o.inputText){const i=r.indexOf(o.inputText,t),c=this.inputSlotCollection.getSlot(a);if(c&&i>-1){const f=i-t>c.characterCount?t+c.characterCount:i;c.partText=r.substring(t,f),this.processSlotRules(c),t=i+o.characterCount}}}else{const a=this.inputSlotCollection.getSlot(this.formatPartList.currentIndex);a&&(a.partText=r.substring(t,t+a.characterCount),this.processSlotRules(a))}}}processEditRules(r){const t=this.inputSlotCollection.getSlot(this.formatNavigator.getCurrentPartIndex());if(!t)return;const n=this.formatNavigator.getCursorPosition(),s=n-t.startPosition,a=this.format.deleteShiftsFormatPart||!1;switch(r.key){case"Backspace":{if(!(t.startPosition===n))t.partText=t.partText.substring(0,s-1)+t.partText.substring(s),a&&this.shiftFormatParts(t),this.formatRenderer.render(),this.formatNavigator.moveCursorLeft(),this.processSlotRules(t,!0);else{this.processSlotRules(t,!0);const i=this.inputSlotCollection.getPreviousSlot(t.partIndex);i&&(i.partText=i.partText.substring(0,i.partText.length-1),a&&this.shiftFormatParts(i),this.formatRenderer.render(),this.formatNavigator.setCursorPosition(i.startPosition+i.partText.length),this.processSlotRules(i,!0))}break}case"Delete":t.partText=t.partText.substring(0,s)+t.partText.substring(s+1),a&&this.shiftFormatParts(t),this.formatRenderer.render(),this.formatNavigator.setCursorToCurrentPosition(),this.processSlotRules(t,!0);break}}shiftFormatParts(r){let t=r,n;for(;(n=this.inputSlotCollection.getNextSlot(t.partIndex))!==void 0;){const s=n.partText.substring(0,1);n.partText=n.partText.substring(1),t.partText=t.partText+s,t=n}}processInputRules(r){const t=this.inputSlotCollection.getSlot(this.formatNavigator.getCurrentPartIndex());if(!t)return;const{key:n}=r,s=t.characterCount,a=t.partText;if(t.valueType===qe.Numeric){if(!this.keyTypeChecker.isNumberKey(n))return;const o=t.maximumValue,i=t.exceedingMaximumValueCausesTab||!1,c=t.padWithZeros||!1,f=parseInt(this.createNewValue(t,n));if(o&&f>o)if(i){c&&(t.partText=t.partText.padStart(s,"0")),t.isComplete=!0;const h=this.inputSlotCollection.getNextSlot(t.partIndex);h&&!h.isComplete&&(h.partText=n),this.formatRenderer.render(),h&&this.formatNavigator.setCursorPosition(h.isComplete?h.startPosition:h.startPosition+1)}else return;else a.length+1===s?(this.addToInputSlot(n),t.isComplete=!0,this.formatRenderer.render(),this.formatNavigator.isAtLastPart()?this.formatNavigator.moveCursorRight():this.formatNavigator.moveToNextInputPart()):a.length+1<s&&(this.addToInputSlot(n),this.formatRenderer.render(),this.formatNavigator.moveCursorRight())}else a.length+1===s?(this.addToInputSlot(n),t.isComplete=!0,this.formatRenderer.render(),this.formatNavigator.isAtLastPart()?this.formatNavigator.moveCursorRight():this.formatNavigator.moveToNextInputPart()):(this.addToInputSlot(n),this.formatRenderer.render(),this.formatNavigator.moveCursorRight())}addToInputSlot(r){const t=this.inputSlotCollection.getSlot(this.formatNavigator.getCurrentPartIndex());t&&(t.partText=this.createNewValue(t,r))}createNewValue(r,t){const n=r.partText,s=this.formatNavigator.getCursorPosition();if(s>=r.startPosition+r.partText.length)return n+t;{const a=s-r.startPosition;return n.substring(0,a)+t+n.substring(a)}}processSlotRules(r,t=!1){const n=r.characterCount,s=r.allCharactersRequired||!1;if(r.valueType===qe.Numeric){const a=r.minimumValue,o=r.maximumValue;if(s)r.isComplete=r.partText.length===n;else if(a!==void 0&&o!==void 0){const i=r.padWithZeros||!1,c=parseInt(r.partText);r.isComplete=c>=a&&c<=o,r.isComplete&&i&&!t&&(r.partText=r.partText.padStart(n,"0"))}else r.isComplete=r.partText.length>0}else s?r.isComplete=r.partText.length===n:r.isComplete=r.partText.length>0}}class Eh{constructor(r,t){m(this,"instanceCollection");m(this,"formatNavigator");m(this,"ruleProcessor");m(this,"keyTypeChecker");m(this,"formatRenderer");this.format=r,this.instanceCollection=kt.getInstance(),this.formatNavigator=this.instanceCollection.getNavigatorInstance(t,r),this.ruleProcessor=new ka(r,t),this.keyTypeChecker=new Ea,this.formatRenderer=new Tn(r,t)}setInputElement(r){this.ruleProcessor.setInputElement(r),this.formatRenderer.setInputElement(r)}processMovementKey(r){const{key:t,metaKey:n}=r;switch(t){case"ArrowLeft":n?this.formatNavigator.moveHome():this.formatNavigator.moveCursorLeft();break;case"ArrowRight":n?this.formatNavigator.moveEnd():this.formatNavigator.moveCursorRight();break;case"Home":this.formatNavigator.moveHome();break;case"End":this.formatNavigator.moveEnd();break}}processKeyPress(r){return this.keyTypeChecker.isIgnoreKey(r)?!1:this.keyTypeChecker.isMovementKey(r)?(this.processMovementKey(r),!1):(this.ruleProcessor.processKeyPress(r),!0)}}class kh{constructor(r,t=""){m(this,"instanceId");m(this,"instanceCollection");m(this,"keyProcessor");m(this,"formatNavigator");m(this,"formatRenderer");m(this,"inputSlotCollection");m(this,"inputRuleProcessor");m(this,"previousOutputValue","");m(this,"inputElementSet",!1);m(this,"isInputFocused",!1);m(this,"inputElement");m(this,"onFormatChange");this.inputValue=t,this.instanceId=vh(),this.instanceCollection=kt.getInstance(),this.keyProcessor=new Eh(r,this.instanceId),this.formatNavigator=this.instanceCollection.getNavigatorInstance(this.instanceId,r),this.formatRenderer=new Tn(r,this.instanceId),this.inputSlotCollection=this.instanceCollection.getInputSlotInstance(this.instanceId,r),this.inputRuleProcessor=new ka(r,this.instanceId)}inputElementCreated(r){this.keyProcessor.setInputElement(r),this.formatNavigator.setInputElement(r),this.formatRenderer.setInputElement(r),this.inputElement=r,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(r){this.inputValue=r,this.inputElementSet&&(this.inputValue.length>0?this.inputRuleProcessor.processInputValue(r):(this.inputSlotCollection.clearAllSlots(),this.previousOutputValue=void 0),setTimeout(()=>{var t;this.formatRenderer.render(),this.isInputFocused&&this.formatNavigator.setCursorToCurrentPosition(),this.inputValue.length>0&&(this.previousOutputValue=(t=this.inputElement)==null?void 0:t.innerHTML)}))}registerFormatChangeEvent(r){this.onFormatChange=r}mouseUpHandler(){this.formatNavigator.findCursorPosition()}keyDownHandler(r){r.key!=="Tab"&&(r.preventDefault(),r.stopPropagation(),this.keyProcessor.processKeyPress(r)&&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)}}const Ch=(e,r)=>{const{value:t="",format:n,readOnly:s=!1,debounceTime:a=800,fillContainer:o=!0,leftElement:i,rightElement:c,className:f,leftElementClassName:h,rightElementClassName:p,isSingleLine:y=!1,allowSingleLineScroll:x=!1,isInputValid:w,onChange:D,onFocus:O,onBlur:S,onElementCreate:R,onLeftElementClick:U,onRightElementClick:F}=e,[b,A]=d.useState(!0),k=d.useRef(),V=d.useRef(),B=d.useRef();d.useEffect(()=>()=>{var v;(v=B.current)==null||v.dispose()},[]),d.useEffect(()=>{var v;(v=B.current)==null||v.inputValuePassed(t)},[t]),d.useEffect(()=>{var v,ee,g;(v=B.current)==null||v.dispose(),n&&(B.current=new kh(n,t),V.current&&((ee=B.current)==null||ee.inputElementCreated(V.current)),(g=B.current)==null||g.registerFormatChangeEvent(ne))},[n]);const ne=d.useCallback(v=>{w?w(v)?(A(!0),D==null||D(v)):A(!1):D==null||D(v)},[D]),te=d.useCallback(v=>{var ee;(ee=B.current)==null||ee.inputFocused(),O==null||O(v)},[O]),J=d.useCallback(v=>{var ee;(ee=B.current)==null||ee.inputBlurred(),S==null||S(v)},[S]),N=d.useCallback(()=>{var v;(v=B.current)==null||v.mouseUpHandler()},[]),$=d.useCallback(v=>{var ee;(ee=B.current)==null||ee.keyDownHandler(v)},[]),I=d.useCallback(v=>{var ee,g,_,z,E,Y,q,L,H;(g=(ee=k.current)==null?void 0:ee.inputElement)==null||g.removeEventListener("keydown",$),(z=(_=k.current)==null?void 0:_.inputElement)==null||z.removeEventListener("mouseup",N),k.current=v,(Y=(E=k.current)==null?void 0:E.inputElement)==null||Y.addEventListener("keydown",$),(L=(q=k.current)==null?void 0:q.inputElement)==null||L.addEventListener("mouseup",N),V.current=(H=k.current)==null?void 0:H.inputElement},[]),C=d.useCallback(()=>{var v;(v=k.current)==null||v.focus()},[]);d.useImperativeHandle(r,()=>({focus:C}));const G=ie(f,{"!bsc-border-error":!b});return l.jsx(hr,{ref:v=>v&&I(v),readOnly:s,debounceTime:a,fillContainer:o,leftElement:i,rightElement:c,className:G,leftElementClassName:h,rightElementClassName:p,isSingleLine:y,allowSingleLineScroll:x,onFocus:te,onBlur:J,onElementCreate:R,onLeftElementClick:U,onRightElementClick:F})},Ca=d.forwardRef(Ch),Sn=d.createContext(void 0);function Da(e,r,t=!0){var y,x;const n=qs(e),s=Hs(e),a=Of(e);let o=an(s)-(((y=r.options)==null?void 0:y.weekStartsOn)||0);o=o===-1?6:o;const i=an(a)-(((x=r.options)==null?void 0:x.weekStartsOn)||0),c=Ll({start:s,end:a}),f=n+o>35?6:5,h=Oa(f,7,{dayValue:null,isCurrent:!0});let p=1;for(let w=0,D=f;w<D;w++){for(let O=w>0?0:o;O<7;O++){const S=c[p-1];if(S.setHours(e.getHours(),e.getMinutes(),e.getSeconds()),h[w][O].dayValue=S,++p>n)break}if(p>n)break}if(o>0&&t)for(let w=0;w<o;w++)h[0][w].dayValue=kd(s,o-w),h[0][w].isCurrent=!1;if(i>-1&&t)for(let w=6;w>i;w--)h[f-1][w].dayValue=Tt(a,w-i),h[f-1][w].isCurrent=!1;return h}function Oa(e,r,t){const n=[];for(let s=0,a=e;s<a;s++){const o=[];for(let i=0,c=r;i<c;i++){const f=Dh(t)?t:{...t};o.push(f)}n.push(o)}return n}function Dh(e){const r=typeof e;return r==="string"||r==="number"||r==="boolean"||e instanceof Date}function Oh(e){var n;const r=Cd(new Date,((n=e.options)==null?void 0:n.weekStartsOn)||0),t=[];for(let s=0;s<7;s++)t.push(Tt(r,s).toLocaleDateString(e.code,{weekday:"short"}));return t}function _h(e){const r=new Date(Date.UTC(2020,0,1)),t=[[{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 a=0;a<4;a++)t[s][a]={monthNumber:n,monthName:ct(r,n++).toLocaleDateString(e.code,{month:"short"})};return t}function Nh(e,r){const t=new Date(e.getTime()),n=Math.floor(t.getFullYear()/10)*10;t.setFullYear(n);const s=$l({start:t,end:pr(t,9)}),a=Oa(3,4,"");let o=0;for(let i=0;i<3;i++)for(let c=0;c<4&&(a[i][c]=s[o++].toLocaleDateString(r.code,{year:"numeric"}),o!==s.length);c++);return a}function Ih(e){const r=new Date;return r.setHours(0,0,0,0),r.toLocaleTimeString(e.code)}function jh(e,r,t){return e.getTime()>=r.getTime()&&e.getTime()<=t.getTime()}async function _a(e){return(await import(`/node_modules/date-fns/locale/${Mh(e)}`)).default}function Mh(e){const[r,t]=e.split("-");switch(r){case"af":return"af";case"ar":switch(t){case"DZ":return"ar-DZ";case"EG":return"ar-EG";case"MA":return"ar-MA";case"SA":return"ar-SA";case"TN":return"ar-TN";default:return"ar"}case"az":return"az";case"be":switch(t){case"tarask":return"be-tarask";default:return"be"}case"bg":return"bg";case"bn":return"bn";case"bs":return"bs";case"ca":return"ca";case"cs":return"cs";case"cy":return"cy";case"da":return"da";case"de":switch(t){case"AT":return"de-AT";default:return"de"}case"el":return"el";case"en":switch(t){case"AU":return"en-AU";case"CA":return"en-CA";case"GB":return"en-GB";case"IE":return"en-IE";case"IN":return"en-IN";case"NZ":return"en-NZ";case"US":return"en-US";default:return"en-ZA"}case"eo":return"eo";case"es":return"es";case"et":return"et";case"eu":return"eu";case"fa":return"fa-IR";case"fi":return"fi";case"fr":switch(t){case"CA":return"fr-CA";case"CH":return"fr-CH";default:return"fr"}case"fy":return"fy";case"gd":return"gd";case"gl":return"gl";case"gu":return"gu";case"he":return"he";case"hi":return"hi";case"hr":return"hr";case"ht":return"ht";case"hu":return"hu";case"hy":return"hy";case"id":return"id";case"is":return"is";case"it":switch(t){case"CH":return"it-CH";default:return"it"}case"ja":switch(t){case"Hira":return"ja-Hira";default:return"ja"}case"ka":return"ka";case"kk":return"kk";case"km":return"km";case"kn":return"kn";case"ko":return"ko";case"lb":return"lb";case"lt":return"lt";case"lv":return"lv";case"mk":return"mk";case"mn":return"mn";case"ms":return"ms";case"mt":return"mt";case"nb":return"nb";case"nl":switch(t){case"BE":return"nl-BE";default:return"nl"}case"nn":return"nn";case"oc":return"oc";case"pl":return"pl";case"pt":switch(t){case"BR":return"pt-BR";default:return"pt"}case"ro":return"ro";case"ru":return"ru";case"sk":return"sk";case"sl":return"sl";case"sq":return"sq";case"sr":switch(t){case"Latn":return"sr-Latn";default:return"sr"}case"sv":return"sv";case"ta":return"ta";case"te":return"te";case"th":return"th";case"tr":return"tr";case"ug":return"ug";case"uk":return"uk";case"uz":switch(t){case"Cyrl":return"uz-Cyrl";default:return"uz"}case"vi":return"vi";case"zh":switch(t){case"CN":return"zh-CN";case"HK":return"zh-HK";default:return"zh-TW"}default:return"en-AU"}}function Zt(e,r){const t=Dd(e);if(isNaN(t.valueOf())){let n=Ue(e,"P pp",new Date,{locale:r});return!isNaN(n.valueOf())||(n=Ue(e,"Pp",new Date,{locale:r}),!isNaN(n.valueOf()))||(n=Ue(e,"P HH:mm",new Date,{locale:r}),!isNaN(n.valueOf()))||(n=Ue(e,"P hh:mm a..aaa",new Date,{locale:r}),!isNaN(n.valueOf()))||(n=Ue(e,"P HH:mm:ss",new Date,{locale:r}),!isNaN(n.valueOf()))||(n=Ue(e,"P hh:mm:ss a..aaa",new Date,{locale:r}),!isNaN(n.valueOf()))||(n=Ue(e,"P",new Date,{locale:r}),!isNaN(n.valueOf()))||(n=Ue(e,"P p",new Date,{locale:r}),!isNaN(n.valueOf()))||(n=Ue(e,"pp",new Date,{locale:r}),!isNaN(n.valueOf()))||(n=Ue(e,"p",new Date,{locale:r}),!isNaN(n.valueOf()))?n:void 0}return t}function Pn(e,r){const t=e.split("-");if(t.length!==2)return;const n=Zt(t[0].trim(),r);if(!n)return;const s=Zt(t[1].trim(),r);if(s)return[n,s]}var me=(e=>(e[e.DateTime=0]="DateTime",e[e.DateOnly=1]="DateOnly",e[e.TimeOnly=2]="TimeOnly",e[e.DateRange=3]="DateRange",e))(me||{}),Oe=(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))(Oe||{}),Qt=(e=>(e[e.Day=0]="Day",e[e.Month=1]="Month",e[e.Year=2]="Year",e[e.Range=3]="Range",e))(Qt||{}),Kt=(e=>(e[e.Short=0]="Short",e[e.Medium=1]="Medium",e[e.Long=2]="Long",e))(Kt||{}),Pe=(e=>(e[e.TwelveHour=0]="TwelveHour",e[e.TwentyFourHour=1]="TwentyFourHour",e))(Pe||{}),rt=(e=>(e[e.Normal=0]="Normal",e[e.Range=1]="Range",e))(rt||{}),wr=(e=>(e[e.Right=0]="Right",e[e.Left=1]="Left",e[e.None=2]="None",e))(wr||{}),ue=(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))(ue||{});const Rh=(e,r)=>{switch(r.type){case 0:return r.dateSelector!==void 0?{...e,currentSelector:r.dateSelector,currentViewDate:r.viewDate||e.currentViewDate}:{...e};case 1:return{...e,currentViewDate:r.viewDate||new Date,dateInitialized:!0};case 2:return{...e,selectedDate:r.selectedDate||e.selectedDate,currentViewDate:r.viewDate||e.currentViewDate};case 3:return{...e,selectedStartDate:r.selectedStartDate||e.selectedStartDate,selectedEndDate:r.selectedEndDate||e.selectedEndDate};case 4:return{...e,selectedStartDate:r.selectedStartDate,selectedEndDate:void 0};case 5:return{...e,selectedEndDate:r.selectedEndDate};case 6:return{...e,timeFormat:r.timeFormat||e.timeFormat};case 7:return{currentSelector:e.currentSelector,currentViewDate:e.currentViewDate,timeFormat:e.timeFormat,dateInitialized:!0};case 8:{const t={...e,currentViewDate:Ah(r.initialDate),dateInitialized:!0};return Array.isArray(r.initialDate)?{...t,selectedStartDate:r.initialDate[0],selectedEndDate:r.initialDate[1]}:{...t,selectedDate:r.initialDate}}default:return{...e,currentSelector:Oe.DaySelector}}};function Ah(e){return e?Array.isArray(e)?e[0]:e:new Date}const Tr=({viewDate:e,selectedDate:r,selectedStartDate:t,selectedEndDate:n,selectionMode:s=rt.Normal,locale:a,onDateSelected:o,selectableDate:i,isValidDate:c,dispatcher:f})=>{var I;const[h,p]=d.useState(!1),[y,x]=d.useState(),[w,D]=d.useState(),[O,S]=d.useState(),[R,U]=d.useState(),F=d.useRef(),b=d.useRef(),A=d.useContext(Sn),k=d.useMemo(()=>A.calendarTemplate,[A.calendarTemplate]),V=async()=>a||await _a(Yn());d.useEffect(()=>{V().then(C=>{F.current=C,b.current=Oh(F.current),p(!0)}).catch(C=>console.error(C))},[]),d.useEffect(()=>{e&&F.current&&S(Da(e,F.current,s===rt.Normal))},[e,h]),d.useEffect(()=>{U(r?new Date(r.getFullYear(),r.getMonth(),r.getDate()):void 0)},[r]),d.useEffect(()=>{x(t?new Date(t.getFullYear(),t.getMonth(),t.getDate(),0,0,0).getTime():void 0),D(n?new Date(n.getFullYear(),n.getMonth(),n.getDate(),23,59,59).getTime():void 0)},[t,n]),d.useEffect(()=>{F.current&&a&&(F.current=a,S(Da(e,F.current,s===rt.Normal)))},[a]);const B=C=>{if(s===rt.Normal)f==null||f({type:ue.SetSelectedDate,selectedDate:C,viewDate:C}),o==null||o(C);else{if(!o)throw new Error("Range selection mode requires onDateSelected to be set");!t||_f(C,t)?o(C):t&&!n?o(C,{setEndDate:!0}):t&&n&&o(C)}},ne=C=>(R==null?void 0:R.toLocaleDateString())===C.toLocaleDateString(),te=C=>{if(y&&w){const G=C.getTime();return G>=y&&G<=w}return!1},J={viewDate:e,selectedDate:r,selectedStartDate:t,selectedEndDate:n,selectionMode:s,locale:a,weekDays:b.current,monthMatrix:O,selectableDate:i,isValidDate:c,onDateClicked:B,isSelectedDate:ne,isInSelectedDateRange:te},$=k||((C,G)=>l.jsx("div",{className:"bc-dt-calendar bsc-w-full",children:G}));return l.jsx(ut,{props:J,template:$,children:l.jsxs("div",{className:"bc-dt-day-row bsc-grid bsc-min-w-[329px] bsc-grid-cols-7 bsc-gap-3",children:[(I=b.current)==null?void 0:I.map((C,G)=>l.jsx("div",{className:"bc-dt-day-cell bsc-text-center bsc-font-bold",children:C},G)),O==null?void 0:O.map((C,G)=>C.map((v,ee)=>{var z,E;const g=v.dayValue!==null&&(i===void 0||i(v.dayValue)),_=ie("bsc-text-center bsc-py-1",{"bsc-text-gray-3":!v.isCurrent,"bsc-bg-primary-3 dark:bsc-bg-mono-light-1 dark:bsc-text-mono-dark-1":v&&v.dayValue&&(R&&ne(v.dayValue)||y&&!w&&Ys(y,v.dayValue)||y&&w&&te(v.dayValue)),"bsc-cursor-pointer":g,"bsc-text-error bsc-cursor-not-allowed":!g,"bsc-bg-primary-5 dark:bsc-bg-mono-light-3 dark:bsc-text-mono-dark-1":v.dayValue&&Ed(v.dayValue)&&!(ne(v.dayValue)||te(v.dayValue))},"bc-dt-date-cell");return l.jsx("div",{className:_,onClick:()=>v&&v.dayValue&&g&&(c===void 0||c(v.dayValue))&&B(v.dayValue),children:(E=v.dayValue)==null?void 0:E.getDate().toLocaleString((z=F.current)==null?void 0:z.code)},G.toString()+ee.toString())}))]})})},Sr=({title:e,scrollerType:r,onTitleClicked:t,onMovePrevious:n,onMoveNext:s})=>{const o=d.useContext(Sn).dateScrollerTemplate,i={title:e,scrollerType:r,onTitleClicked:t,onMovePrevious:n,onMoveNext:s},f=o||((h,p)=>l.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 l.jsxs(ut,{props:i,template:f,children:[l.jsx("div",{className:"bc-dt-scroller-left bsc-flex-shrink bsc-cursor-pointer",children:l.jsx(Ve,{className:"bsc-bg-transparent focus:bsc-outline-none",onClick:n,children:l.jsx(Le,{icon:"chevronLeft",size:Ie.Regular})})}),l.jsx("div",{className:"bc-dt-scroller-title bsc-flex-grow bsc-cursor-pointer bsc-text-center",onClick:t,children:e}),l.jsx("div",{className:"bc-dt-scroller-right bsc-flex-shrink bsc-cursor-pointer",children:l.jsx(Ve,{className:"bsc-bg-transparent focus:bsc-outline-none",onClick:s,children:l.jsx(Le,{icon:"chevronRight",size:Ie.Regular})})})]})},Lh=({selectedDate:e,viewDate:r,locale:t,showTimeSelector:n,selectableDate:s,isValidDate:a,onChange:o,dispatcher:i})=>{const c=()=>{r&&i({type:ue.SetViewDate,viewDate:Js(r,1)})},f=()=>{r&&i({type:ue.SetViewDate,viewDate:ct(r,1)})},h=()=>{i({type:ue.SetDateSelector,dateSelector:Oe.MonthSelector})},p=()=>{i({type:ue.SetDateSelector,dateSelector:Oe.TimeSelector})},y=()=>r?r.toLocaleDateString(t.code,{month:"long",year:"numeric"}):"";return l.jsxs("div",{className:"bc-dt-day-selector bsc-p-2",children:[l.jsx(Sr,{title:y(),scrollerType:Qt.Day,onTitleClicked:h,onMovePrevious:c,onMoveNext:f}),l.jsx(Tr,{viewDate:r,selectedDate:e,locale:t,selectableDate:s,isValidDate:a,onDateSelected:o,dispatcher:i}),n&&l.jsx("div",{className:"bc-dt-time-value-wrapper bsc-flex bsc-w-full bsc-flex-row bsc-justify-center bsc-p-2",children:l.jsx("div",{className:"bc-dt-time-value bsc-cursor-pointer bsc-p-2 hover:bsc-bg-gray-4 dark:bsc-bg-mono-dark-1 dark:bsc-text-mono-light-1 dark:hover:bsc-bg-mono-light-2 dark:hover:bsc-text-mono-dark-2",onClick:p,children:(e==null?void 0:e.toLocaleTimeString(t.code))||Ih(t)})})]})},$h=({viewDate:e,locale:r,dateSelection:t=me.DateTime,dispatcher:n})=>{const s=d.useRef(_h(r)),a=()=>{const h=ea(e,1);n({type:ue.SetViewDate,viewDate:h})},o=()=>{const h=pr(e,1);n({type:ue.SetViewDate,viewDate:h})},i=h=>{n({type:ue.SetDateSelector,dateSelector:t!==me.DateRange?Oe.DaySelector:Oe.DateRangeSelector,viewDate:Bd(e,h)})},c=()=>e.toLocaleDateString(r.code,{year:"numeric"}),f=()=>{n({type:ue.SetDateSelector,dateSelector:Oe.YearSelector})};return l.jsxs("div",{className:"bc-dt-month-selector bsc-p-2",style:{minWidth:"20rem"},children:[l.jsx(Sr,{title:c(),scrollerType:Qt.Month,onTitleClicked:f,onMovePrevious:a,onMoveNext:o}),l.jsx("div",{className:"bc-dt-month-grid bsc-grid bsc-w-full bsc-grid-cols-4 bsc-gap-4",children:s.current.map((h,p)=>h.map((y,x)=>l.jsx("div",{className:"bc-dt-month-cell bsc-cursor-pointer bsc-text-center",onClick:()=>i(y.monthNumber),children:y.monthName},p.toString()+x.toString())))})]})},Fh=({viewDate:e,selectedStartDate:r,selectedEndDate:t,locale:n,onChange:s,dispatcher:a})=>{const o=gr("screen and (max-device-width: 40rem)"),i=ct(e,1),c=(x,w)=>{!w||!w.setEndDate?a({type:ue.SetSelectedStartDate,selectedStartDate:x}):(a({type:ue.SetSelectedEndDate,selectedEndDate:x}),r&&(s==null||s([r,x])))},f=()=>{a({type:ue.SetDateSelector,dateSelector:Oe.MonthSelector})},h=()=>o?`${e.toLocaleDateString(n.code,{month:"long"})} ${e.toLocaleDateString(n.code,{year:"numeric"})}`:`${e.toLocaleDateString(n.code,{month:"long"})} ${e.toLocaleDateString(n.code,{year:"numeric"})} - ${i.toLocaleDateString(n.code,{month:"long"})} ${i.toLocaleDateString(n.code,{year:"numeric"})}`,p=()=>{e&&a({type:ue.SetViewDate,viewDate:Js(e,1)})},y=()=>{e&&a({type:ue.SetViewDate,viewDate:ct(e,1)})};return l.jsxs("div",{className:"bc-dt-range-selector bsc-flex bsc-flex-col",children:[l.jsx("div",{className:"bc-dt-range-scroller-wrapper bsc-flex-shrink",children:l.jsx(Sr,{title:h(),scrollerType:Qt.Range,onTitleClicked:f,onMovePrevious:p,onMoveNext:y})}),l.jsx("div",{className:"bsc-flex-grow",children:l.jsx(fn,{mobileMarkup:l.jsx("div",{className:"bc-dt-range-calendar bsc-px-2 bsc-py-1",children:l.jsx(Tr,{viewDate:e,selectedStartDate:r,selectedEndDate:t,selectionMode:rt.Range,onDateSelected:c,locale:n,dispatcher:a})}),aboveMobileMarkup:l.jsxs("div",{className:"bc-dt-range-wrapper bsc-flex bsc-flex-row bsc-px-2 bsc-py-1",children:[l.jsx("div",{className:"bc-dt-range-calendar-1 bsc-border-r bsc-border-solid bsc-border-gray-3 bsc-pr-4",children:l.jsx(Tr,{viewDate:e,selectedStartDate:r,selectedEndDate:t,selectionMode:rt.Range,onDateSelected:c,locale:n,dispatcher:a})}),l.jsx("div",{className:"bc-dt-range-calendar-2 bsc-pl-4",children:l.jsx(Tr,{viewDate:i,selectedStartDate:r,selectedEndDate:t,selectionMode:rt.Range,onDateSelected:c,locale:n,dispatcher:a})})]})})})]})},Yh=({viewDate:e,showDateSelector:r,locale:t,timeFormat:n=Pe.TwelveHour,timeConstraints:s,onChange:a,dispatcher:o})=>{const i=d.useRef(n===Pe.TwelveHour?11:23),c=d.useRef(n===Pe.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"]),f=d.useRef(Ka(0,59,N=>N.toString().padStart(2,"0"))),h=d.useRef(["AM","PM"]),p=d.useRef(Pl(e)),y=N=>N>11?N-12:N,[x,w]=d.useState(y(e.getHours())),[D,O]=d.useState(e.getMinutes()),[S,R]=d.useState(e.getHours()<=12?0:1),U=d.useRef(e.toLocaleDateString(t.code));d.useEffect(()=>{const N=e.getHours(),$=e.getMinutes();if(N!==x&&w(n===Pe.TwelveHour?y(N):N),$!==D&&O($),n===Pe.TwelveHour){const I=N<=11?0:1;I!==S&&R(I)}},[e]);const F=()=>{var I;const N=((I=s==null?void 0:s.hours)==null?void 0:I.step)||1,$=x<i.current?x+N:0;w($),B($,D,S)},b=()=>{var I;const N=((I=s==null?void 0:s.hours)==null?void 0:I.step)||1,$=x>0?x-N:i.current;w($),B($,D,S)},A=()=>{var I,C,G;const N=((I=s==null?void 0:s.minutes)==null?void 0:I.step)||1,$=D+N<(((C=s==null?void 0:s.minutes)==null?void 0:C.max)||59)?D+N:((G=s==null?void 0:s.minutes)==null?void 0:G.min)||0;O($),B(x,$,S)},k=()=>{var I,C,G;const N=((I=s==null?void 0:s.minutes)==null?void 0:I.step)||1,$=D-N>=(((C=s==null?void 0:s.minutes)==null?void 0:C.min)||0)?D-N:(((G=s==null?void 0:s.minutes)==null?void 0:G.max)||60)-N;O($),B(x,$,S)},V=()=>{const N=S===0?1:0;R(N),B(x,D,N)},B=(N,$,I)=>{const C=n===Pe.TwelveHour&&I===1?N+12:N;p.current.setHours(C,$),o({type:ue.SetSelectedDate,selectedDate:p.current,viewDate:p.current}),a==null||a(p.current)},ne=()=>{o({type:ue.SetDateSelector,dateSelector:Oe.DaySelector})},te=ie("bsc-w-full bsc-grid bsc-grid-rows-3 bsc-gap-4 bc-dt-time-grid",{"bsc-grid-cols-4":n===Pe.TwelveHour,"bsc-grid-cols-3":n===Pe.TwentyFourHour}),J=ie("bsc-text-center bsc-cursor-pointer hover:bsc-bg-gray-4 dark:bsc-text-mono-light-1 dark:hover:bsc-bg-mono-light-1 dark:hover:bsc-text-mono-dark-1 bc-dt-time-date-value",{"bsc-col-span-4":n===Pe.TwelveHour,"bsc-col-span-3":n===Pe.TwentyFourHour});return l.jsx("div",{className:"bc-dt-time-selector bsc-flex bsc-flex-row bsc-justify-center bsc-p-2",style:{minWidth:n===Pe.TwelveHour?"15rem":"11rem"},children:l.jsxs("div",{className:te,children:[r&&l.jsx("div",{className:J,onClick:ne,children:U.current}),l.jsx("div",{className:"bc-dt-time-hour-increase bsc-cursor-pointer bsc-text-center",children:l.jsx(Ve,{className:"bsc-bg-transparent bsc-p-2 focus:bsc-outline-none",onClick:F,children:l.jsx(Le,{icon:"chevronUp",size:Ie.Regular})})}),l.jsx("div",{}),l.jsx("div",{className:"bc-dt-time-minute-increase bsc-cursor-pointer bsc-text-center",children:l.jsx(Ve,{className:"bsc-bg-transparent bsc-p-2 focus:bsc-outline-none",onClick:A,children:l.jsx(Le,{icon:"chevronUp",size:Ie.Regular})})}),n===Pe.TwelveHour&&l.jsx("div",{className:"bc-dt-time-meridian-increase bsc-cursor-pointer bsc-text-center",children:l.jsx(Ve,{className:"bsc-bg-transparent bsc-p-2 focus:bsc-outline-none",onClick:V,children:l.jsx(Le,{icon:"chevronUp",size:Ie.Regular})})}),l.jsx("div",{className:"bc-dt-time-hour-value bsc-text-center",children:c.current[x]}),l.jsx("div",{className:"bc-dt-time-separator bsc-text-center",children:":"}),l.jsx("div",{className:"bc-dt-time-minute-value bsc-text-center",children:f.current[D]}),n===Pe.TwelveHour&&l.jsx("div",{className:"bc-dt-time-meridian-value bsc-text-center",children:h.current[S]}),l.jsx("div",{className:"bc-dt-time-hour-decrease bsc-cursor-pointer bsc-text-center",children:l.jsx(Ve,{className:"bsc-bg-transparent bsc-p-2 focus:bsc-outline-none",onClick:b,children:l.jsx(Le,{icon:"chevronDown",size:Ie.Regular})})}),l.jsx("div",{}),l.jsx("div",{className:"bc-dt-time-minute-decrease bsc-cursor-pointer bsc-text-center",children:l.jsx(Ve,{className:"bsc-bg-transparent bsc-p-2 focus:bsc-outline-none",onClick:k,children:l.jsx(Le,{icon:"chevronDown",size:Ie.Regular})})}),n===Pe.TwelveHour&&l.jsx("div",{className:"bc-dt-time-meridian-decrease bsc-cursor-pointer bsc-text-center",children:l.jsx(Ve,{className:"bsc-bg-transparent bsc-p-2 focus:bsc-outline-none",onClick:V,children:l.jsx(Le,{icon:"chevronDown",size:Ie.Regular})})})]})})},Hh=({viewDate:e,locale:r,dispatcher:t})=>{const n=Nh(e,r),s=()=>{const c=ea(e,10);t({type:ue.SetViewDate,viewDate:c})},a=()=>{const c=pr(e,10);t({type:ue.SetViewDate,viewDate:c})},o=c=>{const f=parseInt(c);t({type:ue.SetDateSelector,dateSelector:Oe.MonthSelector,viewDate:zd(e,f)})},i=()=>`${n[0][0].toString()} - ${n[2][1].toString()}`;return l.jsxs("div",{className:"bc-dt-year-selector",style:{minWidth:"20rem"},children:[l.jsx(Sr,{title:i(),scrollerType:Qt.Year,onMovePrevious:s,onMoveNext:a}),l.jsx("div",{className:"bc-dt-year-wrapper bsc-w-full",children:l.jsx("div",{className:"bc-dt-year-grid bsc-grid bsc-grid-cols-4 bsc-gap-4",children:n.map((c,f)=>c.map((h,p)=>h.length>0?l.jsx("div",{className:"bc-dt-year-cell bsc-cursor-pointer bsc-text-center",onClick:()=>o(h),children:h},f.toString()+p.toString()):l.jsx("div",{},f.toString()+p.toString())))})})]})};class Wh{constructor(r,t){m(this,"dateFormat");m(this,"timeFormat");m(this,"use24HourTime");m(this,"monthPart");m(this,"dayPart");m(this,"yearPart");m(this,"twelveHourPart");m(this,"twentyFourHourPart");m(this,"minutePart");m(this,"meridianPart");this.dateSelection=r;const n=2023,s=12,a=20,i=new Date(n,s-1,a).toLocaleDateString(t,{year:"numeric",month:"numeric",day:"numeric"});this.dateFormat=i.replace(`${n}`,"YYYY").replace(`${s}`,"MM").replace(`${a}`,"DD");const c=new Date,f=18,h=24,p=37,y=317;c.setHours(f,h,p,y);const x=c.toLocaleTimeString(t);this.use24HourTime=x.startsWith("18"),this.timeFormat=x.replace(`${this.use24HourTime?f:"6"}`,"HH").replace(`${h}`,"MM").replace(`${p}`,"SS").replace(`${y}`,"LLL"),this.createDateParts()}get is24HourTime(){return this.use24HourTime}createInputFormat(){const r={deleteShiftsFormatPart:!1,formatParts:[]};switch(this.dateSelection){case me.DateOnly:return this.createDateFormat(r);case me.TimeOnly:return this.createTimeFormat(r);case me.DateRange:return this.createDateRangeFormat(r);case me.DateTime:return this.createDateTimeFormat(r)}}createDateFormat(r){return this.dateFormat.startsWith("MM")?r.formatParts.push(...this.createMonthDayYearFormatParts()):this.dateFormat.startsWith("DD")?r.formatParts.push(...this.createDayMonthYearFormatParts()):r.formatParts.push(...this.createYearMonthDayFormatParts()),r}createTimeFormat(r){return this.use24HourTime?r.formatParts.push(...this.createTwentyFourHourFormatParts()):r.formatParts.push(...this.createTwelveHourFormatParts()),r}createDateRangeFormat(r){const t=[];this.dateFormat.startsWith("MM")?t.push(...this.createMonthDayYearFormatParts()):this.dateFormat.startsWith("DD")?t.push(...this.createDayMonthYearFormatParts()):t.push(...this.createYearMonthDayFormatParts());const n={characterCount:3,placeholder:" - ",inputText:" - ",isSeparator:!0};return r.formatParts.push(...t,n,...t),r}createDateTimeFormat(r){this.dateFormat.startsWith("MM")?r.formatParts.push(...this.createMonthDayYearFormatParts()):this.dateFormat.startsWith("DD")?r.formatParts.push(...this.createDayMonthYearFormatParts()):r.formatParts.push(...this.createYearMonthDayFormatParts());const t={characterCount:1,placeholder:" ",inputText:" ",isSeparator:!0};return r.formatParts.push(t),this.use24HourTime?r.formatParts.push(...this.createTwentyFourHourFormatParts()):r.formatParts.push(...this.createTwelveHourFormatParts()),r}createMonthDayYearFormatParts(){if(this.monthPart&&this.dayPart&&this.yearPart){let r=this.dateFormat.replace("MM",""),t=r.indexOf("DD"),n=r.substring(0,t);r=r.replace(n,"").replace("DD","");const s={characterCount:n.length,placeholder:n,inputText:n,isSeparator:!0};t=r.indexOf("YYYY"),n=r.substring(0,t);const a={characterCount:n.length,placeholder:n,inputText:n,isSeparator:!0};return[this.monthPart,s,this.dayPart,a,this.yearPart]}return[]}createDayMonthYearFormatParts(){if(this.monthPart&&this.dayPart&&this.yearPart){let r=this.dateFormat.replace("DD",""),t=r.indexOf("MM"),n=r.substring(0,t);r=r.replace(n,"").replace("MM","");const s={characterCount:n.length,placeholder:n,inputText:n,isSeparator:!0};t=r.indexOf("YYYY"),n=r.substring(0,t);const a={characterCount:n.length,placeholder:n,inputText:n,isSeparator:!0};return[this.dayPart,s,this.monthPart,a,this.yearPart]}return[]}createYearMonthDayFormatParts(){if(this.monthPart&&this.dayPart&&this.yearPart){let r=this.dateFormat.replace("YYYY",""),t=r.indexOf("MM"),n=r.substring(0,t);r=r.replace(n,"").replace("MM","");const s={characterCount:n.length,placeholder:n,inputText:n,isSeparator:!0};t=r.indexOf("DD"),n=r.substring(0,t);const a={characterCount:n.length,placeholder:n,inputText:n,isSeparator:!0};return[this.yearPart,s,this.monthPart,a,this.dayPart]}return[]}createTwelveHourFormatParts(){if(this.twelveHourPart&&this.minutePart&&this.meridianPart){const r=this.timeFormat.replace("HH",""),t=r.indexOf("MM"),n=r.substring(0,t),s={characterCount:n.length,placeholder:n,inputText:n,isSeparator:!0},a={characterCount:1,placeholder:" ",inputText:" ",isSeparator:!0};return[this.twelveHourPart,s,this.minutePart,a,this.meridianPart]}return[]}createTwentyFourHourFormatParts(){if(this.twentyFourHourPart&&this.minutePart){const r=this.timeFormat.replace("HH",""),t=r.indexOf("MM"),n=r.substring(0,t),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:qe.Numeric,minimumValue:1,maximumValue:12,exceedingMaximumValueCausesTab:!0,padWithZeros:!0},this.dayPart={characterCount:2,placeholder:"D",inputText:"_",isSeparator:!1,allCharactersRequired:!1,valueType:qe.Numeric,minimumValue:1,maximumValue:31,exceedingMaximumValueCausesTab:!0,padWithZeros:!0},this.yearPart={characterCount:4,placeholder:"Y",inputText:"_",isSeparator:!1,allCharactersRequired:!0,valueType:qe.Numeric},this.twelveHourPart={characterCount:2,placeholder:"H",inputText:"_",isSeparator:!1,allCharactersRequired:!1,valueType:qe.Numeric,minimumValue:1,maximumValue:12,exceedingMaximumValueCausesTab:!0,padWithZeros:!0},this.twentyFourHourPart={characterCount:2,placeholder:"H",inputText:"_",isSeparator:!1,allCharactersRequired:!1,valueType:qe.Numeric,minimumValue:0,maximumValue:23,exceedingMaximumValueCausesTab:!0,padWithZeros:!0},this.minutePart={characterCount:2,placeholder:"M",inputText:"_",isSeparator:!1,allCharactersRequired:!1,valueType:qe.Numeric,minimumValue:0,maximumValue:59,exceedingMaximumValueCausesError:!0,padWithZeros:!0},this.meridianPart={characterCount:2,inputText:"_",isSeparator:!1,valueType:qe.Text,possibleValues:["AM","PM"]}}}const Vh=(e,r)=>{var a;const[t,n]=d.useState(),s=d.useRef();return d.useEffect(()=>{r&&!t&&(s.current=new Wh(e,r),n(s.current.createInputFormat()))},[r]),[t,(a=s.current)==null?void 0:a.is24HourTime]},Bh=({value:e,readOnly:r=!1,label:t,useDefaultDateValue:n=!1,useFormattedInput:s=!1,allowClear:a=!1,closeSelector:o=!1,locale:i,className:c,dateSelection:f=me.DateTime,dateFormat:h,timeConstraints:p,icon:y,iconPosition:x=wr.Right,inputElement:w,selectableDate:D,isValidDate:O,onChange:S,calendarTemplate:R,dateScrollerTemplate:U,inputTemplate:F,wrapperTemplate:b})=>{const[A,k]=d.useState(!1),[V,B]=d.useState(),[ne,te]=d.useState(),[J,N,$]=Qa(f),I=d.useRef(),C=d.useRef(!1),G=d.useRef(i||Yn()),v=d.useRef(),ee=d.useRef(),g=d.useRef(),[_,z]=Vh(f,V),E=d.useRef({calendarTemplate:R,dateScrollerTemplate:U});d.useEffect(()=>{G.current&&q(G.current)},[G]),d.useEffect(()=>{i&&q(i)},[i]),d.useEffect(()=>{if(e){const Q=L();W({type:ue.InitializeDates,initialDate:Q})}else W({type:ue.ClearDates})},[e,v.current]),d.useEffect(()=>{z&&W({type:ue.SetTimeFormat,timeFormat:z?Pe.TwentyFourHour:Pe.TwelveHour})},[z]),d.useEffect(()=>{w&&(ee.current=w)},[w]),d.useEffect(()=>{W({type:ue.SetDateSelector,dateSelector:Y()})},[J]);const Y=d.useCallback(()=>$.current===me.TimeOnly?Oe.TimeSelector:$.current===me.DateTime||$.current===me.DateOnly?Oe.DaySelector:Oe.DateRangeSelector,[]),q=Q=>{_a(Q).then(ce=>{B(ce.code),v.current=ce;const Ae=L();W(e||n?{type:ue.InitializeDates,initialDate:Array.isArray(Ae)?Ae[0]:Ae}:{type:ue.SetViewDate,viewDate:Array.isArray(Ae)?Ae[0]:Ae})}).catch(ce=>console.error(ce))},L=()=>{const Q=new Date;return Q.setHours(0,0,0,0),e?typeof e=="string"?$.current!==me.DateRange?Zt(e,v.current):Pn(e,v.current):e:Q},H={currentSelector:Y(),currentViewDate:new Date,timeFormat:Pe.TwelveHour,dateInitialized:!1},[P,W]=d.useReducer(Rh,H),Z=()=>{Or(),k(!0)},Te=d.useMemo(()=>Vt(()=>{k(!1)},250),[]),j=d.useMemo(()=>Vt(()=>{Te.cancel()},5),[Te]),je=Q=>{const ce=Q.target.innerText;ht(ce)},nt=Q=>{if(Q){const ce=$.current!==me.DateRange?Zt(Q,v.current):Pn(Q,v.current);return ce?O?Array.isArray(ce)?ce.every(Ae=>O(Ae)):O(ce):!0:!1}else return!0},Xe=Q=>{ht(Q||"")},ht=Q=>{const ce=$.current!==me.DateRange?Zt(Q,v.current):Pn(Q,v.current);ce?(Array.isArray(ce)?(jh(ce[0],Hs(P.currentViewDate),Al(ct(P.currentViewDate,1)))||W({type:ue.SetViewDate,viewDate:ce[0]}),W({type:ue.SetSelectedDateRange,selectedStartDate:ce[0],selectedEndDate:ce[1]})):W({type:ue.SetSelectedDate,selectedDate:ce,viewDate:ce}),S==null||S(ce)):Q===""&&(W({type:ue.ClearDates}),S==null||S())},Dr=Q=>{$.current===me.DateOnly&&o===!0&&k(!1),S==null||S(Q)},Jt=()=>{Or(),k(!A)},pt=()=>{W({type:ue.ClearDates}),k(!1),S==null||S()},er=(Q,ce)=>{(!ee.current||I.current!==ce)&&(ee.current=Q,I.current=ce,C.current=!0)},Or=()=>{(!g.current||C.current)&&ee.current&&(g.current=ee.current,te(ee.current),C.current=!1)},Dt=()=>{k(!1),W({type:ue.SetDateSelector,dateSelector:Y()})},En=()=>{switch(h){case Kt.Short:return"short";case Kt.Medium:return"medium";case Kt.Long:return"long";default:return}},Ot=()=>{var ce,Ae,Nt,rr,Je,It,jt,nr,Mr,sr,Rr,ar;const Q=En();switch($.current){case me.DateTime:return P.selectedDate?Q?P.selectedDate.toLocaleString((ce=v.current)==null?void 0:ce.code,{dateStyle:Q,timeStyle:Q}):P.selectedDate.toLocaleString((Ae=v.current)==null?void 0:Ae.code):"";case me.DateOnly:return P.selectedDate?Q?P.selectedDate.toLocaleDateString((Nt=v.current)==null?void 0:Nt.code,{dateStyle:Q}):P.selectedDate.toLocaleDateString((rr=v.current)==null?void 0:rr.code):"";case me.TimeOnly:return P.selectedDate?Q?P.selectedDate.toLocaleTimeString((Je=v.current)==null?void 0:Je.code,{timeStyle:Q,hour12:P.timeFormat===Pe.TwelveHour,hourCycle:P.timeFormat===Pe.TwentyFourHour?"h23":void 0}):P.selectedDate.toLocaleTimeString((It=v.current)==null?void 0:It.code,{hour12:P.timeFormat===Pe.TwelveHour,hourCycle:P.timeFormat===Pe.TwentyFourHour?"h23":void 0}):"";case me.DateRange:return P.selectedStartDate&&P.selectedEndDate?Q?`${P.selectedStartDate.toLocaleDateString((jt=v.current)==null?void 0:jt.code,{dateStyle:Q})} - ${P.selectedEndDate.toLocaleDateString((nr=v.current)==null?void 0:nr.code,{dateStyle:Q})}`:`${P.selectedStartDate.toLocaleDateString((Mr=v.current)==null?void 0:Mr.code)} - ${P.selectedEndDate.toLocaleDateString((sr=v.current)==null?void 0:sr.code)}`:"";default:return P.selectedDate?Q?P.selectedDate.toLocaleString((Rr=v.current)==null?void 0:Rr.code,{dateStyle:Q,timeStyle:Q}):P.selectedDate.toLocaleString((ar=v.current)==null?void 0:ar.code):""}},mt=J===me.DateTime||J===me.DateOnly||J===me.DateRange,_r=J===me.DateTime||J===me.TimeOnly,We=x===wr.None?{}:x===wr.Right?{rightElement:l.jsxs("div",{className:"bsc-flex bsc-text-black dark:bsc-text-mono-light-1",children:[a&&!r&&l.jsx("div",{children:l.jsx(Le,{icon:"close",size:Ie.Small,className:"bsc-cursor-pointer bsc-text-sm",onClick:pt})}),l.jsx("div",{className:"bsc-ml-2",onClick:r?void 0:Jt,children:y||l.jsx(Le,{icon:"calendar",size:Ie.Small,className:r?void 0:"bsc-cursor-pointer"})})]}),rightElementClassName:"bsc-justify-center"}:{leftElement:l.jsxs("div",{className:"bsc-flex bsc-text-black dark:bsc-text-mono-light-1",children:[l.jsx("div",{className:"bsc-mr-2",onClick:r?void 0:Jt,children:y||l.jsx(Le,{icon:"calendar",size:Ie.Small,className:r?void 0:"bsc-cursor-pointer"})}),a&&!r&&l.jsx("div",{children:l.jsx(Le,{icon:"close",size:Ie.Small,className:"bsc-cursor-pointer bsc-text-sm",onClick:pt})})]}),leftElementClassName:"bsc-justify-center"},kn={setDateSelector:Q=>N(Q)},Nr=b||((Q,ce)=>l.jsx(l.Fragment,{children:ce})),_t=()=>l.jsx(ut,{props:kn,template:Nr,children:l.jsxs(l.Fragment,{children:[P.currentSelector===Oe.DaySelector&&mt&&P.dateInitialized&&v.current&&l.jsx(Lh,{selectedDate:P.selectedDate,viewDate:P.currentViewDate,locale:v.current,showTimeSelector:$.current===me.DateTime,selectableDate:D,isValidDate:O,dispatcher:W,onChange:Dr}),P.currentSelector===Oe.MonthSelector&&mt&&P.dateInitialized&&v.current&&l.jsx($h,{viewDate:P.currentViewDate,locale:v.current,dateSelection:$.current,dispatcher:W}),P.currentSelector===Oe.YearSelector&&mt&&P.dateInitialized&&v.current&&l.jsx(Hh,{viewDate:P.currentViewDate,locale:v.current,dispatcher:W}),P.currentSelector===Oe.TimeSelector&&_r&&P.dateInitialized&&v.current&&l.jsx(Yh,{viewDate:P.currentViewDate,showDateSelector:$.current===me.DateTime,locale:v.current,timeFormat:P.timeFormat,timeConstraints:p,onChange:S,dispatcher:W}),P.currentSelector===Oe.DateRangeSelector&&mt&&P.dateInitialized&&v.current&&l.jsx(Fh,{viewDate:P.currentViewDate,selectedStartDate:P.selectedStartDate,selectedEndDate:P.selectedEndDate,locale:v.current,onChange:S,dispatcher:W})]})}),Ir={label:t,readOnly:r,allowClear:a,getValue:Ot,onFocus:Z,onInput:je,iconPosition:x,iconElement:We.rightElement||We.leftElement},jr=F||((Q,ce)=>l.jsx(l.Fragment,{children:ce})),tr=ie("bsc-text-left",{"bc-read-only bsc-bg-gray-4 dark:bsc-bg-mono-dark-3":r,"bsc-bg-white dark:bsc-bg-mono-dark-1":!r},"bc-dt-input",c);return l.jsx(Sn.Provider,{value:E.current,children:l.jsxs("div",{className:"bc-date-time",children:[t&&l.jsx(Ge,{label:t,readOnly:r,className:"bc-dt-label"}),l.jsx(fn,{mobileMarkup:l.jsxs(l.Fragment,{children:[l.jsx(ut,{props:Ir,template:jr,children:l.jsx(hr,{value:Ot(),readOnly:r,inputMode:"none",className:tr,onFocus:Z,onElementCreate:Q=>er(Q,!1),...We})}),l.jsx(xa,{visible:A,target:ne,hidden:Dt,unmountWhenHidden:!0,children:_t()})]}),aboveMobileMarkup:l.jsxs(l.Fragment,{children:[l.jsx(ut,{props:Ir,template:jr,children:s===!1?l.jsx(hr,{value:Ot(),readOnly:r,className:tr,onFocus:Z,onBlur:Te,onInput:je,onElementCreate:Q=>er(Q,!1),...We}):l.jsx(Ca,{value:Ot(),readOnly:r,className:tr,format:_,isInputValid:nt,onFocus:Z,onBlur:Te,onChange:Xe,onElementCreate:Q=>er(Q,!0),...We})}),l.jsx(Sa,{visible:A,target:ne,shouldTargetCloseOverlay:!1,shouldScrollCloseOverlay:!0,shouldCheckZIndex:!0,shouldRemainOnScreen:!0,hidden:Dt,isClickedWithin:j,unmountWhenHidden:!0,children:_t()})]})})]})})};function dt(e,r){var t,n;if(typeof r=="function")n=r(e),n!==void 0&&(e=n);else if(Array.isArray(r))for(t=0;t<r.length;t++)n=r[t](e),n!==void 0&&(e=n);return e}function zh(e,r){return e[0]==="-"&&Array.isArray(r)&&/^-\d+$/.test(e)?r.length+parseInt(e,10):e}function Uh(e){return/^\d+$/.test(e)}function Pr(e){return Object.prototype.toString.call(e)==="[object Object]"}function Xt(e){return Object(e)===e}function Er(e){return Object.keys(e).length===0}var qh=["__proto__","prototype","constructor"],Gh=function(e){return qh.indexOf(e)===-1};function kr(e,r){e.indexOf("[")>=0&&(e=e.replace(/\[/g,r).replace(/]/g,""));var t=e.split(r),n=t.filter(Gh);if(n.length!==t.length)throw Error("Refusing to update blacklisted property "+e);return t}var Na=Object.prototype.hasOwnProperty;function ae(e,r,t,n){if(!(this instanceof ae))return new ae(e,r,t,n);typeof r>"u"&&(r=!1),typeof t>"u"&&(t=!0),typeof n>"u"&&(n=!0),this.separator=e||".",this.override=r,this.useArray=t,this.useBrackets=n,this.keepArray=!1,this.cleanup=[]}var Ct=new ae(".",!1,!0,!0);function He(e){return function(){return Ct[e].apply(Ct,arguments)}}ae.prototype._fill=function(e,r,t,n){var s=e.shift();if(e.length>0){if(r[s]=r[s]||(this.useArray&&Uh(e[0])?[]:{}),!Xt(r[s]))if(this.override)r[s]={};else{if(!(Xt(t)&&Er(t)))throw new Error("Trying to redefine `"+s+"` which is a "+typeof r[s]);return}this._fill(e,r[s],t,n)}else{if(!this.override&&Xt(r[s])&&!Er(r[s])){if(!(Xt(t)&&Er(t)))throw new Error("Trying to redefine non-empty obj['"+s+"']");return}r[s]=dt(t,n)}},ae.prototype.object=function(e,r){var t=this;return Object.keys(e).forEach(function(n){var s=r===void 0?null:r[n],a=kr(n,t.separator).join(t.separator);a.indexOf(t.separator)!==-1?(t._fill(a.split(t.separator),e,e[n],s),delete e[n]):e[n]=dt(e[n],s)}),e},ae.prototype.str=function(e,r,t,n){var s=kr(e,this.separator).join(this.separator);return e.indexOf(this.separator)!==-1?this._fill(s.split(this.separator),t,r,n):t[e]=dt(r,n),t},ae.prototype.pick=function(e,r,t,n){var s,a,o,i,c;for(a=kr(e,this.separator),s=0;s<a.length;s++)if(i=zh(a[s],r),r&&typeof r=="object"&&i in r){if(s===a.length-1)return t?(o=r[i],n&&Array.isArray(r)?r.splice(i,1):delete r[i],Array.isArray(r)&&(c=a.slice(0,-1).join("."),this.cleanup.indexOf(c)===-1&&this.cleanup.push(c)),o):r[i];r=r[i]}else return;return t&&Array.isArray(r)&&(r=r.filter(function(f){return f!==void 0})),r},ae.prototype.delete=function(e,r){return this.remove(e,r,!0)},ae.prototype.remove=function(e,r,t){var n;if(this.cleanup=[],Array.isArray(e)){for(n=0;n<e.length;n++)this.pick(e[n],r,!0,t);return t||this._cleanup(r),r}else return this.pick(e,r,!0,t)},ae.prototype._cleanup=function(e){var r,t,n,s;if(this.cleanup.length){for(t=0;t<this.cleanup.length;t++)n=this.cleanup[t].split("."),s=n.splice(0,-1).join("."),r=s?this.pick(s,e):e,r=r[n[0]].filter(function(a){return a!==void 0}),this.set(this.cleanup[t],r,e);this.cleanup=[]}},ae.prototype.del=ae.prototype.remove,ae.prototype.move=function(e,r,t,n,s){return typeof n=="function"||Array.isArray(n)?this.set(r,dt(this.pick(e,t,!0),n),t,s):(s=n,this.set(r,this.pick(e,t,!0),t,s)),t},ae.prototype.transfer=function(e,r,t,n,s,a){return typeof s=="function"||Array.isArray(s)?this.set(r,dt(this.pick(e,t,!0),s),n,a):(a=s,this.set(r,this.pick(e,t,!0),n,a)),n},ae.prototype.copy=function(e,r,t,n,s,a){return typeof s=="function"||Array.isArray(s)?this.set(r,dt(JSON.parse(JSON.stringify(this.pick(e,t,!1))),s),n,a):(a=s,this.set(r,this.pick(e,t,!1),n,a)),n},ae.prototype.set=function(e,r,t,n){var s,a,o,i;if(typeof r>"u")return t;for(o=kr(e,this.separator),s=0;s<o.length;s++){if(i=o[s],s===o.length-1)if(n&&Pr(r)&&Pr(t[i]))for(a in r)Na.call(r,a)&&(t[i][a]=r[a]);else if(n&&Array.isArray(t[i])&&Array.isArray(r))for(var c=0;c<r.length;c++)t[o[s]].push(r[c]);else t[i]=r;else(!Na.call(t,i)||!Pr(t[i])&&!Array.isArray(t[i]))&&(/^\d+$/.test(o[s+1])?t[i]=[]:t[i]={});t=t[i]}return t},ae.prototype.transform=function(e,r,t){return r=r||{},t=t||{},Object.keys(e).forEach((function(n){this.set(e[n],this.pick(n,r),t)}).bind(this)),t},ae.prototype.dot=function(e,r,t){r=r||{},t=t||[];var n=Array.isArray(e);return Object.keys(e).forEach((function(s){var a=n&&this.useBrackets?"["+s+"]":s;if(Xt(e[s])&&(Pr(e[s])&&!Er(e[s])||Array.isArray(e[s])&&!this.keepArray&&e[s].length!==0))if(n&&this.useBrackets){var o=t[t.length-1]||"";return this.dot(e[s],r,t.slice(0,-1).concat(o+a))}else return this.dot(e[s],r,t.concat(a));else n&&this.useBrackets?r[t.join(this.separator).concat("["+s+"]")]=e[s]:r[t.concat(a).join(this.separator)]=e[s]}).bind(this)),r},ae.pick=He("pick"),ae.move=He("move"),ae.transfer=He("transfer"),ae.transform=He("transform"),ae.copy=He("copy"),ae.object=He("object"),ae.str=He("str"),ae.set=He("set"),ae.delete=He("delete"),ae.del=ae.remove=He("remove"),ae.dot=He("dot"),["override","overwrite"].forEach(function(e){Object.defineProperty(ae,e,{get:function(){return Ct.override},set:function(r){Ct.override=!!r}})}),["useArray","keepArray","useBrackets"].forEach(function(e){Object.defineProperty(ae,e,{get:function(){return Ct[e]},set:function(r){Ct[e]=r}})}),ae._process=dt;var Zh=ae;const Cr=Ar(Zh),Qh=({name:e,label:r,value:t,data:n,textField:s,valueField:a,readOnly:o=!1,orientation:i=Ne.Horizontal,isMultiSelect:c=!1,className:f,onChange:h,itemTemplate:p})=>{const[y,x]=d.useState(),[w,D]=d.useState([]),O=cr(()=>n,[n]),S=d.useId();d.useEffect(()=>{if(c){const I=Array.isArray(t)?t.map(C=>C.toString()):t?[String(t)]:void 0;D(I??[])}else t&&x(t.toString())},[t]);const R=I=>c?w.findIndex(C=>C===I)>-1:y===I,U=I=>{const C=I.toString();if(c){const G=R(C);let v;G?v=w.filter(ee=>ee!=C):v=[...w,C],D(v),h==null||h({name:e,value:v})}else C!==y&&(x(C),h==null||h({name:e,value:C}))},F=I=>{const{value:C}=I.target;x(C),h==null||h({name:e,value:C})},b=I=>{const{value:C,checked:G}=I.target;let v;G?v=[...w,C]:v=w.filter(ee=>ee!=C),D(v),h==null||h({name:e,value:v})},A=(I,C,G,v)=>l.jsxs("label",{htmlFor:I,className:v,children:[l.jsx("input",{id:I,name:e,value:G,type:"checkbox",onChange:b,checked:R(G),className:"bsc-appearance-none"}),C]},I),k=(I,C,G,v)=>l.jsxs("label",{htmlFor:I,className:v,children:[l.jsx("input",{id:I,name:e,value:G,type:"radio",onChange:F,checked:R(G),className:"bsc-appearance-none"}),C]},I),V=or($t.FocusWithin),B=d.useCallback((I,C)=>l.jsx(l.Fragment,{children:C}),[]),ne=p||B,te=(I,C,G)=>{const v=`element_${S}_${C}`,ee=Cr.pick(s,I),g=String(Cr.pick(a,I)),_=C===0,z=C===G.length-1,E=ie("bc-group-button-item bsc-cursor-pointer bsc-border-solid bsc-p-2 bsc-font-medium",{"has-[:checked]:bsc-bg-primary-1 has-[:checked]:dark:bsc-bg-mono-light-1 has-[:checked]:bsc-text-white has-[:checked]:dark:bsc-text-mono-dark-1 dark:bsc-text-mono-light-1 bsc-text-gray-2 bsc-border-gray-3 dark:bsc-border-mono-light-2":!o,"bc-read-only has-[:checked]:bsc-bg-primary-4 has-[:checked]:dark:bsc-bg-mono-light-3 has-[:checked]:bsc-text-gray-5 has-[:checked]:dark:bsc-text-mono-dark-3 dark:bsc-text-mono-light-3 bsc-text-gray-3 bsc-border-gray-4 dark:bsc-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":_&&i===Ne.Horizontal,"bsc-border-t bsc-border-r bsc-border-l bsc-border-b bsc-rounded-r-md bsc-pr-2":z&&i===Ne.Horizontal,"bsc-border-t bsc-border-b":!_&&!z&&i===Ne.Horizontal,"bsc-border-l":!_&&i===Ne.Horizontal,"bsc-border-l bsc-border-r bsc-border-t bsc-rounded-t-md":_&&i===Ne.Vertical,"bsc-border bsc-rounded-b-md":z&&i===Ne.Vertical,"bsc-border-t bsc-border-l bsc-border-r":!_&&!z&&i===Ne.Vertical},V),Y={itemId:v,selectedValue:c?w:y,itemText:ee,itemValue:g,itemData:I,itemStyles:E,isSelected:R(g),isFirstItem:_,isLastItem:z,onItemChanged:U};return c?l.jsx(ut,{props:Y,template:ne,children:A(v,ee,g,E)}):l.jsx(ut,{props:Y,template:ne,children:k(v,ee,g,E)})},J=ie("bsc-flex bsc-flex-col bsc-gap-2",f),N=ie("bsc-flex",{"bsc-flex-col [width:max-content]":i===Ne.Vertical}),$=I=>l.jsx("div",{className:N,children:I.map(te)});return l.jsxs("div",{className:J,children:[r&&l.jsx(Ge,{label:r,readOnly:o}),O&&$(O)]})},Kh=d.memo(Qh),Xh=({id:e,name:r,label:t,value:n,checked:s=!1,labelLocation:a=Re.Right,readOnly:o=!1,useAnimation:i,onChange:c})=>{const f=$r(i),h=d.useCallback(x=>{c==null||c(x)},[c]),p=ie("bc-radio-item-wrapper bsc-flex bsc-items-center *:bsc-cursor-pointer",{"bc-read-only":o}),y=ie("bc-radio-item-outer bsc-relative *:bsc-size-[21px]",{"bsc-pl-1":a===Re.Left,"bsc-pr-1":a===Re.Right,"bsc-radio-item-animate":!o&&f,"bsc-radio-item":!o,"bc-read-only bsc-radio-item-read-only":o});return l.jsxs("div",{className:p,children:[a===Re.Left&&l.jsx(Ge,{label:t,htmlFor:e,readOnly:o}),l.jsxs("label",{className:y,children:[l.jsx("input",{id:e,name:r,value:n,type:"radio",checked:s,onChange:h,className:"bc-radio-item-input-hidden bsc-hidden"}),l.jsxs("svg",{viewBox:"0 0 30 30",preserveAspectRatio:"xMidYMid meet",className:"bc-radio-item-svg",children:[l.jsx("circle",{cx:15,cy:15,r:13}),l.jsx("circle",{cx:"50%",cy:"50%",r:7})]})]}),a===Re.Right&&l.jsx(Ge,{label:t,htmlFor:e,readOnly:o})]})},Jh=d.memo(Xh),ep=({name:e,label:r,value:t,data:n,textField:s,valueField:a,readOnly:o=!1,labelLocation:i=Re.Right,orientation:c=Ne.Vertical,className:f,useAnimation:h,onChange:p})=>{const[y,x]=d.useState(t),w=cr(()=>n,[n]),D=d.useId(),O=d.useCallback(b=>{const A=b.target.value;x(A),p==null||p({name:e,value:A,originalEvent:b})},[e]),S=(b,A)=>{const k=`${D}_radio_${A}`,V=Cr.pick(a,b);return l.jsx(Jh,{id:k,name:e,label:Cr.pick(s,b),value:V,checked:V==y,labelLocation:i,readOnly:o,useAnimation:h,onChange:O},k)},R=ie("bc-radio-container bsc-flex bsc-flex-col bsc-gap-1",f),U=ie("bc-radio-wrapper bsc-flex bsc-gap-1",{"bsc-flex-col":c===Ne.Vertical,"[&>*]:bsc-pr-2":c===Ne.Horizontal}),F=b=>l.jsx("div",{className:U,children:b.map(S)});return l.jsxs("div",{className:R,children:[r&&l.jsx(Ge,{label:r,readOnly:o}),w&&F(w)]})},tp=d.memo(ep),rp=({name:e,label:r,value:t,checked:n=!1,readOnly:s=!1,useAnimation:a,className:o,onChange:i})=>{const[c,f]=d.useState(!1),h=d.useId(),p=$r(a);d.useEffect(()=>{f(n)},[n]);const y=S=>{const{checked:R}=S.target;f(R),i==null||i({originalEvent:S,name:e||S.target.name,value:t||S.target.value,checked:R})},x=ie("bc-toggle-wrapper bsc-flex bsc-flex-col",o),w=or($t.FocusWithin),D=ie("bc-toggle-container bsc-toggle-switch bsc-flex bsc-mt-0.5 bsc-relative bsc-w-[70px] bsc-h-[30px] bsc-rounded-full [transition:background-color_1s]",{"bsc-cursor-pointer bsc-bg-gray-3 dark:bsc-bg-mono-dark-3 has-[:checked]:bsc-bg-primary-1 has-[:checked]:dark:bsc-bg-mono-light-2":!s,"bc-read-only bsc-pointer-events-none bsc-bg-gray-4 dark:bsc-bg-mono-dark-2 has-[:checked]:bsc-bg-primary-4 has-[:checked]:dark:bsc-bg-mono-light-3":s},w),O=ie("bc-toggle-switch bsc-absolute bsc-rounded-full dark:bsc-border dark:bsc-border-solid dark:bsc-border-mono-dark-1 bsc-w-[22px] bsc-h-[22px] 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,"[transition:0.3s]":!s&&p});return l.jsxs("div",{className:x,children:[r&&l.jsx(Ge,{label:r,htmlFor:h,readOnly:s}),l.jsxs("label",{className:D,children:[l.jsx("input",{id:h,name:e,value:t,type:"checkbox",checked:c,onChange:y,className:"bsc-appearance-none"}),l.jsx("div",{id:"switch",className:O})]})]})},np=d.memo(rp),bp="";X.BeeSoftProvider=Fa,X.Button=Ve,X.Checkbox=Vn,X.CheckboxGroup=po,X.ContentEditableInput=hr,X.DateFormatType=Kt,X.DateSelectionType=me,X.DateTime=Bh,X.FormGroupItemOrientation=Ne,X.FormattedInput=Ca,X.GroupButton=Kh,X.MediaQuery=fn,X.MobileOverlayPanel=xa,X.OverlayPanel=Sa,X.RadioButton=tp,X.SelectionLabelLocation=Re,X.Toggle=np,X.applyBeeSoftTheme=ro,X.createBeeSoftTheme=no,Object.defineProperty(X,Symbol.toStringTag,{value:"Module"})});