beesoft-components 0.9.6-0 → 0.9.6-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.es.js +1 -0
- package/dist/index.es.js.gz +0 -0
- package/dist/index.umd.js +7 -7
- package/dist/index.umd.js.gz +0 -0
- package/package.json +1 -1
- package/types/index.d.ts +1 -1
package/dist/index.es.js
CHANGED
package/dist/index.es.js.gz
CHANGED
|
Binary file
|
package/dist/index.umd.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(J,f){typeof exports=="object"&&typeof module<"u"?f(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],f):(J=typeof globalThis<"u"?globalThis:J||self,f(J.BeeSoftComponents={},J.React,J.ReactDOM))})(this,function(J,f,He){"use strict";var gp=Object.defineProperty;var bp=(J,f,He)=>f in J?gp(J,f,{enumerable:!0,configurable:!0,writable:!0,value:He}):J[f]=He;var m=(J,f,He)=>(bp(J,typeof f!="symbol"?f+"":f,He),He);function Yo(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
|
|
1
|
+
(function(J,f){typeof exports=="object"&&typeof module<"u"?f(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],f):(J=typeof globalThis<"u"?globalThis:J||self,f(J.BeeSoftComponents={},J.React,J.ReactDOM))})(this,function(J,f,He){"use strict";var gp=Object.defineProperty;var bp=(J,f,He)=>f in J?gp(J,f,{enumerable:!0,configurable:!0,writable:!0,value:He}):J[f]=He;var m=(J,f,He)=>(bp(J,typeof f!="symbol"?f+"":f,He),He);function Yo(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=Yo(f);function Hr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Yr={exports:{}},Lt={};/**
|
|
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 Rn;function Wo(){if(Rn)return
|
|
9
|
+
*/var Rn;function Wo(){if(Rn)return Lt;Rn=1;var e=f,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,o={key:!0,ref:!0,__self:!0,__source:!0};function i(a,c,d){var h,p={},v=null,y=null;d!==void 0&&(v=""+d),c.key!==void 0&&(v=""+c.key),c.ref!==void 0&&(y=c.ref);for(h in c)n.call(c,h)&&!o.hasOwnProperty(h)&&(p[h]=c[h]);if(a&&a.defaultProps)for(h in c=a.defaultProps,c)p[h]===void 0&&(p[h]=c[h]);return{$$typeof:r,type:a,key:v,ref:y,props:p,_owner:s.current}}return Lt.Fragment=t,Lt.jsx=i,Lt.jsxs=i,Lt}var At={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.development.js
|
|
12
12
|
*
|
|
@@ -18,22 +18,22 @@
|
|
|
18
18
|
`+Y+u}}var Q=!1,E;{var te=typeof WeakMap=="function"?WeakMap:Map;E=new te}function _(u,w){if(!u||Q)return"";{var M=E.get(u);if(M!==void 0)return M}var X;Q=!0;var he=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var be;be=A.current,A.current=null,H();try{if(w){var ue=function(){throw Error()};if(Object.defineProperty(ue.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ue,[])}catch(Le){X=Le}Reflect.construct(u,[],ue)}else{try{ue.call()}catch(Le){X=Le}u.call(ue.prototype)}}else{try{throw Error()}catch(Le){X=Le}u()}}catch(Le){if(Le&&X&&typeof Le.stack=="string"){for(var ie=Le.stack.split(`
|
|
19
19
|
`),Me=X.stack.split(`
|
|
20
20
|
`),ke=ie.length-1,De=Me.length-1;ke>=1&&De>=0&&ie[ke]!==Me[De];)De--;for(;ke>=1&&De>=0;ke--,De--)if(ie[ke]!==Me[De]){if(ke!==1||De!==1)do if(ke--,De--,De<0||ie[ke]!==Me[De]){var $e=`
|
|
21
|
-
`+ie[ke].replace(" at new "," at ");return u.displayName&&$e.includes("<anonymous>")&&($e=$e.replace("<anonymous>",u.displayName)),typeof u=="function"&&E.set(u,$e),$e}while(ke>=1&&De>=0);break}}}finally{Q=!1,A.current=be,K(),Error.prepareStackTrace=he}var
|
|
21
|
+
`+ie[ke].replace(" at new "," at ");return u.displayName&&$e.includes("<anonymous>")&&($e=$e.replace("<anonymous>",u.displayName)),typeof u=="function"&&E.set(u,$e),$e}while(ke>=1&&De>=0);break}}}finally{Q=!1,A.current=be,K(),Error.prepareStackTrace=he}var Mt=u?u.displayName||u.name:"",bt=Mt?q(Mt):"";return typeof u=="function"&&E.set(u,bt),bt}function _e(u,w,M){return _(u,!1)}function st(u){var w=u.prototype;return!!(w&&w.isReactComponent)}function Ge(u,w,M){if(u==null)return"";if(typeof u=="function")return _(u,st(u));if(typeof u=="string")return q(u);switch(u){case d:return q("Suspense");case h:return q("SuspenseList")}if(typeof u=="object")switch(u.$$typeof){case c:return _e(u.render);case p:return Ge(u.type,w,M);case v:{var X=u,he=X._payload,be=X._init;try{return Ge(be(he),w,M)}catch{}}}return""}var pt=Object.prototype.hasOwnProperty,Cr={},er=P.ReactDebugCurrentFrame;function _t(u){if(u){var w=u._owner,M=Ge(u.type,u._source,w?w.type:null);er.setExtraStackFrame(M)}else er.setExtraStackFrame(null)}function kr(u,w,M,X,he){{var be=Function.call.bind(pt);for(var ue in u)if(be(u,ue)){var ie=void 0;try{if(typeof u[ue]!="function"){var Me=Error((X||"React class")+": "+M+" type `"+ue+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof u[ue]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw Me.name="Invariant Violation",Me}ie=u[ue](w,ue,X,M,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(ke){ie=ke}ie&&!(ie instanceof Error)&&(_t(he),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).",X||"React class",M,ue,typeof ie),_t(null)),ie instanceof Error&&!(ie.message in Cr)&&(Cr[ie.message]=!0,_t(he),R("Failed %s type: %s",M,ie.message),_t(null))}}}var Dr=Array.isArray;function mt(u){return Dr(u)}function Or(u){{var w=typeof Symbol=="function"&&Symbol.toStringTag,M=w&&u[Symbol.toStringTag]||u.constructor.name||"Object";return M}}function Nr(u){try{return _r(u),!1}catch{return!0}}function _r(u){return""+u}function gt(u){if(Nr(u))return R("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Or(u)),_r(u)}var Ke=P.ReactCurrentOwner,In={key:!0,ref:!0,__self:!0,__source:!0},ot,Ir,jr;jr={};function jn(u){if(pt.call(u,"ref")){var w=Object.getOwnPropertyDescriptor(u,"ref").get;if(w&&w.isReactWarning)return!1}return u.ref!==void 0}function Mr(u){if(pt.call(u,"key")){var w=Object.getOwnPropertyDescriptor(u,"key").get;if(w&&w.isReactWarning)return!1}return u.key!==void 0}function Rr(u,w){if(typeof u.ref=="string"&&Ke.current&&w&&Ke.current.stateNode!==w){var M=I(Ke.current.type);jr[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',I(Ke.current.type),u.ref),jr[M]=!0)}}function Fo(u,w){{var M=function(){ot||(ot=!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)",w))};M.isReactWarning=!0,Object.defineProperty(u,"key",{get:M,configurable:!0})}}function Lr(u,w){{var M=function(){Ir||(Ir=!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)",w))};M.isReactWarning=!0,Object.defineProperty(u,"ref",{get:M,configurable:!0})}}var tr=function(u,w,M,X,he,be,ue){var ie={$$typeof:r,type:u,key:w,ref:M,props:ue,_owner:be};return ie._store={},Object.defineProperty(ie._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(ie,"_self",{configurable:!1,enumerable:!1,writable:!1,value:X}),Object.defineProperty(ie,"_source",{configurable:!1,enumerable:!1,writable:!1,value:he}),Object.freeze&&(Object.freeze(ie.props),Object.freeze(ie)),ie};function Z(u,w,M,X,he){{var be,ue={},ie=null,Me=null;M!==void 0&&(gt(M),ie=""+M),Mr(w)&&(gt(w.key),ie=""+w.key),jn(w)&&(Me=w.ref,Rr(w,he));for(be in w)pt.call(w,be)&&!In.hasOwnProperty(be)&&(ue[be]=w[be]);if(u&&u.defaultProps){var ke=u.defaultProps;for(be in ke)ue[be]===void 0&&(ue[be]=ke[be])}if(ie||Me){var De=typeof u=="function"?u.displayName||u.name||"Unknown":u;ie&&Fo(ue,De),Me&&Lr(ue,De)}return tr(u,ie,Me,he,X,Ke.current,ue)}}var ae=P.ReactCurrentOwner,Re=P.ReactDebugCurrentFrame;function et(u){if(u){var w=u._owner,M=Ge(u.type,u._source,w?w.type:null);Re.setExtraStackFrame(M)}else Re.setExtraStackFrame(null)}var It;It=!1;function jt(u){return typeof u=="object"&&u!==null&&u.$$typeof===r}function rr(){{if(ae.current){var u=I(ae.current.type);if(u)return`
|
|
22
22
|
|
|
23
23
|
Check the render method of \``+u+"`."}return""}}function Ar(u){{if(u!==void 0){var w=u.fileName.replace(/^.*[\\\/]/,""),M=u.lineNumber;return`
|
|
24
24
|
|
|
25
25
|
Check your code at `+w+":"+M+"."}return""}}var nr={};function Fr(u){{var w=rr();if(!w){var M=typeof u=="string"?u:u.displayName||u.name;M&&(w=`
|
|
26
26
|
|
|
27
|
-
Check the top-level render call using <`+M+">.")}return w}}function sr(u,w){{if(!u._store||u._store.validated||u.key!=null)return;u._store.validated=!0;var M=Fr(w);if(nr[M])return;nr[M]=!0;var X="";u&&u._owner&&u._owner!==ae.current&&(X=" It was passed a child from "+I(u._owner.type)+"."),et(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,X),et(null)}}function or(u,w){{if(typeof u!="object")return;if(mt(u))for(var M=0;M<u.length;M++){var X=u[M];
|
|
27
|
+
Check the top-level render call using <`+M+">.")}return w}}function sr(u,w){{if(!u._store||u._store.validated||u.key!=null)return;u._store.validated=!0;var M=Fr(w);if(nr[M])return;nr[M]=!0;var X="";u&&u._owner&&u._owner!==ae.current&&(X=" It was passed a child from "+I(u._owner.type)+"."),et(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,X),et(null)}}function or(u,w){{if(typeof u!="object")return;if(mt(u))for(var M=0;M<u.length;M++){var X=u[M];jt(X)&&sr(X,w)}else if(jt(u))u._store&&(u._store.validated=!0);else if(u){var he=O(u);if(typeof he=="function"&&he!==u.entries)for(var be=he.call(u),ue;!(ue=be.next()).done;)jt(ue.value)&&sr(ue.value,w)}}}function $r(u){{var w=u.type;if(w==null||typeof w=="string")return;var M;if(typeof w=="function")M=w.propTypes;else if(typeof w=="object"&&(w.$$typeof===c||w.$$typeof===p))M=w.propTypes;else return;if(M){var X=I(w);kr(M,u.props,"prop",X,u)}else if(w.PropTypes!==void 0&&!It){It=!0;var he=I(w);R("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",he||"Unknown")}typeof w.getDefaultProps=="function"&&!w.getDefaultProps.isReactClassApproved&&R("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function up(u){{for(var w=Object.keys(u.props),M=0;M<w.length;M++){var X=w[M];if(X!=="children"&&X!=="key"){et(u),R("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",X),et(null);break}}u.ref!==null&&(et(u),R("Invalid attribute `ref` supplied to `React.Fragment`."),et(null))}}var $o={};function Ho(u,w,M,X,he,be){{var ue=se(u);if(!ue){var ie="";(u===void 0||typeof u=="object"&&u!==null&&Object.keys(u).length===0)&&(ie+=" 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=Ar(he);Me?ie+=Me:ie+=rr();var ke;u===null?ke="null":mt(u)?ke="array":u!==void 0&&u.$$typeof===r?(ke="<"+(I(u.type)||"Unknown")+" />",ie=" Did you accidentally export a JSX literal instead of a component?"):ke=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",ke,ie)}var De=Z(u,w,M,he,be);if(De==null)return De;if(ue){var $e=w.children;if($e!==void 0)if(X)if(mt($e)){for(var Mt=0;Mt<$e.length;Mt++)or($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 or($e,u)}if(pt.call(w,"key")){var bt=I(u),Le=Object.keys(w).filter(function(mp){return mp!=="key"}),Mn=Le.length>0?"{key: someKey, "+Le.join(": ..., ")+": ...}":"{key: someKey}";if(!$o[bt+Mn]){var pp=Le.length>0?"{"+Le.join(": ..., ")+": ...}":"{}";R(`A props object containing a "key" prop is being spread into JSX:
|
|
28
28
|
let props = %s;
|
|
29
29
|
<%s {...props} />
|
|
30
30
|
React keys must be passed directly to JSX without using spread:
|
|
31
31
|
let props = %s;
|
|
32
|
-
<%s key={someKey} {...props} />`,Mn,bt,pp,bt),$o[bt+Mn]=!0}}return u===n?up(De):$r(De),De}}function lp(u,w,M){return Ho(u,w,M,!0)}function fp(u,w,M){return Ho(u,w,M,!1)}var dp=fp,hp=lp;
|
|
32
|
+
<%s key={someKey} {...props} />`,Mn,bt,pp,bt),$o[bt+Mn]=!0}}return u===n?up(De):$r(De),De}}function lp(u,w,M){return Ho(u,w,M,!0)}function fp(u,w,M){return Ho(u,w,M,!1)}var dp=fp,hp=lp;At.Fragment=n,At.jsx=dp,At.jsxs=hp}()),At}process.env.NODE_ENV==="production"?Yr.exports=Wo():Yr.exports=Vo();var l=Yr.exports;const An=f.createContext(void 0),Fn=()=>f.useContext(An),Bo=({overlayKeepOnScreen:e=!0,useAnimations:r=!0,mobileMediaQuery:t,tabletMediaQuery:n,desktopMediaQuery:s,isValidScrollableElement:o,children:i})=>{const a={overlayKeepOnScreen:e,useAnimations:r,mobileMediaQuery:t,tabletMediaQuery:n,desktopMediaQuery:s,isValidScrollableElement:o};return l.jsx(An.Provider,{value:a,children:i})};var Ie=(e=>(e[e.Vertical=0]="Vertical",e[e.Horizontal=1]="Horizontal",e))(Ie||{}),Ae=(e=>(e[e.Right=0]="Right",e[e.Left=1]="Left",e))(Ae||{}),$n={exports:{}};/*!
|
|
33
33
|
Copyright (c) 2018 Jed Watson.
|
|
34
34
|
Licensed under the MIT License (MIT), see
|
|
35
35
|
http://jedwatson.github.io/classnames
|
|
36
|
-
*/(function(e){(function(){var r={}.hasOwnProperty;function t(){for(var o="",i=0;i<arguments.length;i++){var a=arguments[i];a&&(o=s(o,n(a)))}return o}function n(o){if(typeof o=="string"||typeof o=="number")return o;if(typeof o!="object")return"";if(Array.isArray(o))return t.apply(null,o);if(o.toString!==Object.prototype.toString&&!o.toString.toString().includes("[native code]"))return o.toString();var i="";for(var a in o)r.call(o,a)&&o[a]&&(i=s(i,a));return i}function s(o,i){return i?o?o+" "+i:o+i:o}e.exports?(t.default=t,e.exports=t):window.classNames=t})()})($n);var Uo=$n.exports;const le=Hr(Uo);var At=(e=>(e[e.Focus=0]="Focus",e[e.FocusWithin=1]="FocusWithin",e))(At||{});const ir=(e=1)=>f.useMemo(()=>le("dark:bsc-ring-mono-light-2 dark:bsc-ring-offset-mono-dark-1",{"focus-within:bsc-ring focus-within:bsc-ring-primary-2 focus-within:bsc-ring-offset-2 focus-within:bsc-ring-opacity-50":e===1,"focus:bsc-ring focus:bsc-ring-primary-2 focus:bsc-ring-offset-2 focus:bsc-ring-opacity-50":e===0}),[e]),zo=(e,r)=>{const t=f.useRef(null),{buttonType:n,buttonStyle:s="flat",type:o="button",disabled:i=!1,form:a,fullWidth:c=!1,onClick:d,className:h,children:p}=e,v=()=>{d==null||d()},y=()=>{var O;(O=t.current)==null||O.click()};f.useImperativeHandle(r,()=>({click:y}));const x=ir(At.Focus),D=le("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",x,{"bsc-w-full":c,"bc-disabled bsc-bg-gray-3 bsc-text-gray-2 bsc-pointer-events-none":i,"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:o,onClick:v,disabled:i,form:a,className:D,children:p})},Ve=f.forwardRef(zo),Wr=e=>{const[r,t]=f.useState(!0),n=Fn();return f.useEffect(()=>{e!==void 0?t(e):n&&n.useAnimations!==void 0&&t(n.useAnimations)},[n,e]),r},Hn=f.createContext(void 0),Yn=()=>f.useContext(Hn),qo=({children:e})=>{const r=f.useId(),t=f.useMemo(()=>({sharedId:r}),[r]);return l.jsx(Hn.Provider,{value:t,children:e})},ar=e=>e==null?!1:typeof e=="object",Wn=e=>e instanceof Date,Vn=e=>typeof e=="function",Bn=e=>{const r=typeof e;return r==="string"||r==="number"||r==="boolean"||r==="bigint"},Vr=e=>{if(!ar(e))return e;const r={},t=Object.keys(e);for(let n=0,s=t.length;n<s;n++){const o=t[n],i=e[o];Bn(i)||Vn(i)?r[o]=i:Wn(i)?r[o]=new Date(i.getTime()):Array.isArray(i)?r[o]=Br(i):ar(i)&&(r[o]=Vr(i))}return r},Br=e=>{let r=e.length;const t=new Array(r);for(;r--!==0;){const n=e[r];Bn(n)||Vn(n)?t[r]=n:Wn(n)?t[r]=new Date(n.getTime()):ar(n)&&!Array.isArray(n)?t[r]=Vr(n):Array.isArray(n)?t[r]=Br(n):t[r]=n}return t},Go=e=>ar(e)?Array.isArray(e)?Br(e):Vr(e):e;function Ko(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Zo=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,o;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(o=Object.keys(r),n=o.length,n!==Object.keys(t).length)return!1;for(s=n;s--!==0;)if(!Object.prototype.hasOwnProperty.call(t,o[s]))return!1;for(s=n;s--!==0;){var i=o[s];if(!e(r[i],t[i]))return!1}return!0}return r!==r&&t!==t};const Un=Ko(Zo);function Qo(e,r){for(let t=e.length;t--!==0;)if(!Un(e[t],r[t]))return!0;return!1}const cr=(e,r)=>{const t=f.useRef([]),n=t.current.length>0&&t.current[0]&&Qo(t.current[0],r);return(t.current.length===0||n)&&(t.current=[Go(r),e()]),t.current[1]},zn=e=>{const r=f.useRef();let t=!1;r.current!==void 0&&(t=!Un(r.current,e));const n={changed:t,previousValue:r.current};return r.current=e,n},Xo=e=>typeof e=="function",Jo=e=>{const[r,t]=f.useState({value:e,initial:!0}),n=f.useRef(e);return[r,s=>{if(!Xo(s))t({value:s,initial:!1});else{const o=s(n.current);n.current=o,t({value:o,initial:!1})}}]},ei=e=>{const[r,t]=Jo(e),n=f.useRef({value:e,initial:!0});return n.current!==r&&(n.current=r),[r,t,n]},ti=e=>{const[r,t]=f.useState(e),n=f.useRef(e);return n.current!==r&&(n.current=r),[r,t,n]};function qn(){return window.navigator.languages?window.navigator.languages[0]:window.navigator.language}function ri(e,r,t){const n=[];for(let s=e;s<=r;s++)n.push(t?t(s):s);return n}function ni(e,r){const t=e.target;return t?!r.isSameNode(t)&&!r.contains(t):!1}function si(e,r){return e.isSameNode(r)||e.contains(r)}function oi(e,r){const t=Object.entries(r),n=getComputedStyle(e);for(let s=0,o=t.length;s<o;s++){const[i,a]=t[s];if(typeof a=="string"&&a.indexOf(",")>-1){if(!a.split(",").map(d=>d.trim()).includes(n[i]))return!1}else if(n[i]!==a)return!1}return!0}function ii(e,r){const t=Object.entries(r),n=getComputedStyle(e);for(let s=0,o=t.length;s<o;s++){const[i,a]=t[s];if(typeof a=="string"&&a.indexOf(",")>-1){if(a.split(",").map(d=>d.trim()).includes(n[i]))return!0}else if(n[i]===a)return!0}return!1}function Gn(e,r,t=!1,n){if(t&&oi(e,r)){if(!n||(n==null?void 0:n(e))===!0)return e}else if(!t&&ii(e,r)&&(!n||(n==null?void 0:n(e))===!0))return e;return e.parentElement?Gn(e.parentElement,r,t,n):e}function Kn(e,r){const t=Array.from(document.querySelectorAll("body *")),n=[];for(let s=0,o=t.length;s<o;s++){const i=getComputedStyle(t[s]);i[e]&&r(i[e])&&n.push(i[e])}return n}function yp(e){return e}function ai(e){const r=document.documentElement;Object.keys(e).forEach(t=>{r.style.setProperty(t,e[t])})}function ci(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 ui=f.createContext(void 0),li=()=>f.useContext(ui),fi=({id:e,name:r,value:t,type:n,checked:s,readOnly:o,className:i})=>l.jsx("input",{id:e,name:r,value:t,type:n,checked:s,onChange:()=>{},readOnly:o,disabled:o,className:i}),di=({type:e,props:r,renderProps:t,signalName:n,onSignalRetrieved:s,children:o,className:i})=>{const a=li(),{id:c,name:d}=cr(()=>{const h=r;return{id:h.id,name:h.name}},[r]);return f.useEffect(()=>{a&&n&&a[n]&&s&&s(a[n])},[a]),l.jsxs(l.Fragment,{children:[c&&d&&e&&l.jsx(fi,{id:c,name:d,type:e,className:i,...r}),o&&o(t)]})},hi=(e,r)=>{const{name:t,value:n,checked:s=!1,partial:o=!1,onChange:i,children:a,labelStyles:c,className:d}=e,h=Yn(),p=f.useId(),[v,y,x]=ei({checked:!1,partial:!1}),D=zn(s),O=zn(o),P={id:(h==null?void 0:h.sharedId)||e.id||p,...e,...v.value};f.useEffect(()=>{if(v.initial)y({checked:o?!0:s,partial:o});else{const g=D.changed?s:v.value.checked,L=O.changed?o:v.value.partial;y({checked:L?!0:g,partial:L})}},[s,o]);const R=g=>{var C;const L=((C=x.current)==null?void 0:C.value.partial)===!0?!0:g.target.checked;y({checked:L,partial:!1}),i==null||i({originalEvent:g,name:t||g.target.name,value:n,checked:L})},z=g=>{var C;const L={checked:g?!0:((C=x.current)==null?void 0:C.value.checked)||!1,partial:g};y(L)},$=g=>{y({checked:g,partial:!1})};return f.useImperativeHandle(r,()=>({setPartiallyChecked:z,setChecked:$})),l.jsx("label",{className:c,onChange:g=>R(g),children:l.jsx(di,{id:p,name:t,type:"checkbox",props:P,renderProps:v.value,className:d,children:a})})},pi=f.memo(f.forwardRef(hi)),mi=({label:e,htmlFor:r,className:t})=>{const n=Yn(),s=f.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})},Ze=({label:e,htmlFor:r,readOnly:t=!1,className:n})=>{const s=le("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(mi,{label:e,htmlFor:r,className:s})},gi=(e,r)=>{const{name:t,label:n,value:s,readOnly:o=!1,checked:i=!1,partial:a=!1,labelLocation:c=Ae.Right,className:d,useAnimation:h,onChange:p}=e,v=Wr(h),y=le("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":o},d),x=le("bc-checkbox-label bsc-cursor-pointer",{"bsc-ml-2":c===Ae.Right,"bsc-mr-2":c===Ae.Left}),D=ir(At.FocusWithin),O=le("bc-checkbox-outer bsc-relative bsc-rounded *:bsc-block *:bsc-size-[21px]",{"bsc-checkbox-animate":!o&&v,"bc-read-only bsc-checkbox-no-animate":o||!o&&!v},D),P=le("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]":v,"bsc-checkbox":!o,"bc-read-only bsc-checkbox-read-only":o}),R=le("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":!o,"bc-read-only bsc-fill-primary-4 dark:bsc-fill-mono-light-3":o});return l.jsx(qo,{children:l.jsxs("div",{className:y,children:[n&&c===Ae.Left&&l.jsx(Ze,{label:n,readOnly:o,className:x}),l.jsx(pi,{ref:r,name:t,value:s,checked:i,partial:a,readOnly:o,className:P,labelStyles:O,onChange:p,children:({partial:z})=>l.jsx("svg",{viewBox:"0 0 21 21",className:R,children:z?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===Ae.Right&&l.jsx(Ze,{label:n,readOnly:o,className:x})]})})},Zn=f.memo(f.forwardRef(gi)),bi=({name:e,label:r,value:t,data:n,textField:s,valueField:o,readOnly:i=!1,orientation:a=Ie.Vertical,className:c,onChange:d})=>{const[h,p]=f.useState([]),v=cr(()=>n,[n]);f.useEffect(()=>{p(t??[])},[t]);const y=R=>{const{value:z,checked:$}=R;let g;$?g=[...h,z]:g=h.filter(L=>L!==z),p(g),d==null||d({name:e,value:g})},x=(R,z)=>l.jsx(Zn,{name:e,label:R[s],value:R[o],checked:h.some($=>$===R[o]),readOnly:i,onChange:$=>$&&y($),className:"bsc-mr-3"},`${e}_checkbox_${z}`),D=le("bsc-flex bsc-flex-col bsc-gap-1",c),O=le("bsc-flex bsc-gap-1",{"bsc-flex-col":a===Ie.Vertical}),P=R=>l.jsx("div",{className:O,children:R.map(x)});return l.jsxs("div",{className:D,children:[r&&l.jsx(Ze,{label:r,readOnly:i}),v&&P(v)]})},yi=f.memo(bi);var vi=typeof global=="object"&&global&&global.Object===Object&&global;const Qn=vi;var xi=typeof self=="object"&&self&&self.Object===Object&&self,wi=Qn||xi||Function("return this")();const Ye=wi;var Pi=Ye.Symbol;const yt=Pi;var Xn=Object.prototype,Ti=Xn.hasOwnProperty,Si=Xn.toString,Ft=yt?yt.toStringTag:void 0;function Ei(e){var r=Ti.call(e,Ft),t=e[Ft];try{e[Ft]=void 0;var n=!0}catch{}var s=Si.call(e);return n&&(r?e[Ft]=t:delete e[Ft]),s}var Ci=Object.prototype,ki=Ci.toString;function Di(e){return ki.call(e)}var Oi="[object Null]",Ni="[object Undefined]",Jn=yt?yt.toStringTag:void 0;function vt(e){return e==null?e===void 0?Ni:Oi:Jn&&Jn in Object(e)?Ei(e):Di(e)}function xt(e){return e!=null&&typeof e=="object"}var _i="[object Symbol]";function Ii(e){return typeof e=="symbol"||xt(e)&&vt(e)==_i}var ji=Array.isArray;const Ur=ji;var Mi=/\s/;function Ri(e){for(var r=e.length;r--&&Mi.test(e.charAt(r)););return r}var Li=/^\s+/;function Ai(e){return e&&e.slice(0,Ri(e)+1).replace(Li,"")}function Qe(e){var r=typeof e;return e!=null&&(r=="object"||r=="function")}var es=0/0,Fi=/^[-+]0x[0-9a-f]+$/i,$i=/^0b[01]+$/i,Hi=/^0o[0-7]+$/i,Yi=parseInt;function ts(e){if(typeof e=="number")return e;if(Ii(e))return es;if(Qe(e)){var r=typeof e.valueOf=="function"?e.valueOf():e;e=Qe(r)?r+"":r}if(typeof e!="string")return e===0?e:+e;e=Ai(e);var t=$i.test(e);return t||Hi.test(e)?Yi(e.slice(2),t?2:8):Fi.test(e)?es:+e}var Wi="[object AsyncFunction]",Vi="[object Function]",Bi="[object GeneratorFunction]",Ui="[object Proxy]";function rs(e){if(!Qe(e))return!1;var r=vt(e);return r==Vi||r==Bi||r==Wi||r==Ui}var zi=Ye["__core-js_shared__"];const zr=zi;var ns=function(){var e=/[^.]+$/.exec(zr&&zr.keys&&zr.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function qi(e){return!!ns&&ns in e}var Gi=Function.prototype,Ki=Gi.toString;function it(e){if(e!=null){try{return Ki.call(e)}catch{}try{return e+""}catch{}}return""}var Zi=/[\\^$.*+?()[\]{}|]/g,Qi=/^\[object .+?Constructor\]$/,Xi=Function.prototype,Ji=Object.prototype,ea=Xi.toString,ta=Ji.hasOwnProperty,ra=RegExp("^"+ea.call(ta).replace(Zi,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function na(e){if(!Qe(e)||qi(e))return!1;var r=rs(e)?ra:Qi;return r.test(it(e))}function sa(e,r){return e==null?void 0:e[r]}function at(e,r){var t=sa(e,r);return na(t)?t:void 0}var oa=at(Ye,"WeakMap");const qr=oa;var ss=Object.create,ia=function(){function e(){}return function(r){if(!Qe(r))return{};if(ss)return ss(r);e.prototype=r;var t=new e;return e.prototype=void 0,t}}();const aa=ia;function ca(e,r){var t=-1,n=e.length;for(r||(r=Array(n));++t<n;)r[t]=e[t];return r}var ua=function(){try{var e=at(Object,"defineProperty");return e({},"",{}),e}catch{}}();const os=ua;function la(e,r){for(var t=-1,n=e==null?0:e.length;++t<n&&r(e[t],t,e)!==!1;);return e}var fa=9007199254740991,da=/^(?:0|[1-9]\d*)$/;function ha(e,r){var t=typeof e;return r=r??fa,!!r&&(t=="number"||t!="symbol"&&da.test(e))&&e>-1&&e%1==0&&e<r}function is(e,r,t){r=="__proto__"&&os?os(e,r,{configurable:!0,enumerable:!0,value:t,writable:!0}):e[r]=t}function as(e,r){return e===r||e!==e&&r!==r}var pa=Object.prototype,ma=pa.hasOwnProperty;function cs(e,r,t){var n=e[r];(!(ma.call(e,r)&&as(n,t))||t===void 0&&!(r in e))&&is(e,r,t)}function ur(e,r,t,n){var s=!t;t||(t={});for(var o=-1,i=r.length;++o<i;){var a=r[o],c=n?n(t[a],e[a],a,t,e):void 0;c===void 0&&(c=e[a]),s?is(t,a,c):cs(t,a,c)}return t}var ga=9007199254740991;function us(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=ga}function ls(e){return e!=null&&us(e.length)&&!rs(e)}var ba=Object.prototype;function Gr(e){var r=e&&e.constructor,t=typeof r=="function"&&r.prototype||ba;return e===t}function ya(e,r){for(var t=-1,n=Array(e);++t<e;)n[t]=r(t);return n}var va="[object Arguments]";function fs(e){return xt(e)&&vt(e)==va}var ds=Object.prototype,xa=ds.hasOwnProperty,wa=ds.propertyIsEnumerable,Pa=fs(function(){return arguments}())?fs:function(e){return xt(e)&&xa.call(e,"callee")&&!wa.call(e,"callee")};const Ta=Pa;function Sa(){return!1}var hs=typeof J=="object"&&J&&!J.nodeType&&J,ps=hs&&typeof module=="object"&&module&&!module.nodeType&&module,Ea=ps&&ps.exports===hs,ms=Ea?Ye.Buffer:void 0,Ca=ms?ms.isBuffer:void 0,ka=Ca||Sa;const gs=ka;var Da="[object Arguments]",Oa="[object Array]",Na="[object Boolean]",_a="[object Date]",Ia="[object Error]",ja="[object Function]",Ma="[object Map]",Ra="[object Number]",La="[object Object]",Aa="[object RegExp]",Fa="[object Set]",$a="[object String]",Ha="[object WeakMap]",Ya="[object ArrayBuffer]",Wa="[object DataView]",Va="[object Float32Array]",Ba="[object Float64Array]",Ua="[object Int8Array]",za="[object Int16Array]",qa="[object Int32Array]",Ga="[object Uint8Array]",Ka="[object Uint8ClampedArray]",Za="[object Uint16Array]",Qa="[object Uint32Array]",xe={};xe[Va]=xe[Ba]=xe[Ua]=xe[za]=xe[qa]=xe[Ga]=xe[Ka]=xe[Za]=xe[Qa]=!0,xe[Da]=xe[Oa]=xe[Ya]=xe[Na]=xe[Wa]=xe[_a]=xe[Ia]=xe[ja]=xe[Ma]=xe[Ra]=xe[La]=xe[Aa]=xe[Fa]=xe[$a]=xe[Ha]=!1;function Xa(e){return xt(e)&&us(e.length)&&!!xe[vt(e)]}function Kr(e){return function(r){return e(r)}}var bs=typeof J=="object"&&J&&!J.nodeType&&J,$t=bs&&typeof module=="object"&&module&&!module.nodeType&&module,Ja=$t&&$t.exports===bs,Zr=Ja&&Qn.process,ec=function(){try{var e=$t&&$t.require&&$t.require("util").types;return e||Zr&&Zr.binding&&Zr.binding("util")}catch{}}();const wt=ec;var ys=wt&&wt.isTypedArray,tc=ys?Kr(ys):Xa;const rc=tc;var nc=Object.prototype,sc=nc.hasOwnProperty;function vs(e,r){var t=Ur(e),n=!t&&Ta(e),s=!t&&!n&&gs(e),o=!t&&!n&&!s&&rc(e),i=t||n||s||o,a=i?ya(e.length,String):[],c=a.length;for(var d in e)(r||sc.call(e,d))&&!(i&&(d=="length"||s&&(d=="offset"||d=="parent")||o&&(d=="buffer"||d=="byteLength"||d=="byteOffset")||ha(d,c)))&&a.push(d);return a}function xs(e,r){return function(t){return e(r(t))}}var oc=xs(Object.keys,Object);const ic=oc;var ac=Object.prototype,cc=ac.hasOwnProperty;function uc(e){if(!Gr(e))return ic(e);var r=[];for(var t in Object(e))cc.call(e,t)&&t!="constructor"&&r.push(t);return r}function Qr(e){return ls(e)?vs(e):uc(e)}function lc(e){var r=[];if(e!=null)for(var t in Object(e))r.push(t);return r}var fc=Object.prototype,dc=fc.hasOwnProperty;function hc(e){if(!Qe(e))return lc(e);var r=Gr(e),t=[];for(var n in e)n=="constructor"&&(r||!dc.call(e,n))||t.push(n);return t}function Xr(e){return ls(e)?vs(e,!0):hc(e)}var pc=at(Object,"create");const Ht=pc;function mc(){this.__data__=Ht?Ht(null):{},this.size=0}function gc(e){var r=this.has(e)&&delete this.__data__[e];return this.size-=r?1:0,r}var bc="__lodash_hash_undefined__",yc=Object.prototype,vc=yc.hasOwnProperty;function xc(e){var r=this.__data__;if(Ht){var t=r[e];return t===bc?void 0:t}return vc.call(r,e)?r[e]:void 0}var wc=Object.prototype,Pc=wc.hasOwnProperty;function Tc(e){var r=this.__data__;return Ht?r[e]!==void 0:Pc.call(r,e)}var Sc="__lodash_hash_undefined__";function Ec(e,r){var t=this.__data__;return this.size+=this.has(e)?0:1,t[e]=Ht&&r===void 0?Sc:r,this}function ct(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])}}ct.prototype.clear=mc,ct.prototype.delete=gc,ct.prototype.get=xc,ct.prototype.has=Tc,ct.prototype.set=Ec;function Cc(){this.__data__=[],this.size=0}function lr(e,r){for(var t=e.length;t--;)if(as(e[t][0],r))return t;return-1}var kc=Array.prototype,Dc=kc.splice;function Oc(e){var r=this.__data__,t=lr(r,e);if(t<0)return!1;var n=r.length-1;return t==n?r.pop():Dc.call(r,t,1),--this.size,!0}function Nc(e){var r=this.__data__,t=lr(r,e);return t<0?void 0:r[t][1]}function _c(e){return lr(this.__data__,e)>-1}function Ic(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 Xe(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])}}Xe.prototype.clear=Cc,Xe.prototype.delete=Oc,Xe.prototype.get=Nc,Xe.prototype.has=_c,Xe.prototype.set=Ic;var jc=at(Ye,"Map");const Yt=jc;function Mc(){this.size=0,this.__data__={hash:new ct,map:new(Yt||Xe),string:new ct}}function Rc(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 Rc(r)?t[typeof r=="string"?"string":"hash"]:t.map}function Lc(e){var r=fr(this,e).delete(e);return this.size-=r?1:0,r}function Ac(e){return fr(this,e).get(e)}function Fc(e){return fr(this,e).has(e)}function $c(e,r){var t=fr(this,e),n=t.size;return t.set(e,r),this.size+=t.size==n?0:1,this}function Pt(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])}}Pt.prototype.clear=Mc,Pt.prototype.delete=Lc,Pt.prototype.get=Ac,Pt.prototype.has=Fc,Pt.prototype.set=$c;function ws(e,r){for(var t=-1,n=r.length,s=e.length;++t<n;)e[s+t]=r[t];return e}var Hc=xs(Object.getPrototypeOf,Object);const Ps=Hc;function Yc(){this.__data__=new Xe,this.size=0}function Wc(e){var r=this.__data__,t=r.delete(e);return this.size=r.size,t}function Vc(e){return this.__data__.get(e)}function Bc(e){return this.__data__.has(e)}var Uc=200;function zc(e,r){var t=this.__data__;if(t instanceof Xe){var n=t.__data__;if(!Yt||n.length<Uc-1)return n.push([e,r]),this.size=++t.size,this;t=this.__data__=new Pt(n)}return t.set(e,r),this.size=t.size,this}function Tt(e){var r=this.__data__=new Xe(e);this.size=r.size}Tt.prototype.clear=Yc,Tt.prototype.delete=Wc,Tt.prototype.get=Vc,Tt.prototype.has=Bc,Tt.prototype.set=zc;function qc(e,r){return e&&ur(r,Qr(r),e)}function Gc(e,r){return e&&ur(r,Xr(r),e)}var Ts=typeof J=="object"&&J&&!J.nodeType&&J,Ss=Ts&&typeof module=="object"&&module&&!module.nodeType&&module,Kc=Ss&&Ss.exports===Ts,Es=Kc?Ye.Buffer:void 0,Cs=Es?Es.allocUnsafe:void 0;function Zc(e,r){if(r)return e.slice();var t=e.length,n=Cs?Cs(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,o=[];++t<n;){var i=e[t];r(i,t,e)&&(o[s++]=i)}return o}function ks(){return[]}var Xc=Object.prototype,Jc=Xc.propertyIsEnumerable,Ds=Object.getOwnPropertySymbols,eu=Ds?function(e){return e==null?[]:(e=Object(e),Qc(Ds(e),function(r){return Jc.call(e,r)}))}:ks;const Jr=eu;function tu(e,r){return ur(e,Jr(e),r)}var ru=Object.getOwnPropertySymbols,nu=ru?function(e){for(var r=[];e;)ws(r,Jr(e)),e=Ps(e);return r}:ks;const Os=nu;function su(e,r){return ur(e,Os(e),r)}function Ns(e,r,t){var n=r(e);return Ur(e)?n:ws(n,t(e))}function ou(e){return Ns(e,Qr,Jr)}function iu(e){return Ns(e,Xr,Os)}var au=at(Ye,"DataView");const en=au;var cu=at(Ye,"Promise");const tn=cu;var uu=at(Ye,"Set");const rn=uu;var _s="[object Map]",lu="[object Object]",Is="[object Promise]",js="[object Set]",Ms="[object WeakMap]",Rs="[object DataView]",fu=it(en),du=it(Yt),hu=it(tn),pu=it(rn),mu=it(qr),ut=vt;(en&&ut(new en(new ArrayBuffer(1)))!=Rs||Yt&&ut(new Yt)!=_s||tn&&ut(tn.resolve())!=Is||rn&&ut(new rn)!=js||qr&&ut(new qr)!=Ms)&&(ut=function(e){var r=vt(e),t=r==lu?e.constructor:void 0,n=t?it(t):"";if(n)switch(n){case fu:return Rs;case du:return _s;case hu:return Is;case pu:return js;case mu:return Ms}return r});const nn=ut;var gu=Object.prototype,bu=gu.hasOwnProperty;function yu(e){var r=e.length,t=new e.constructor(r);return r&&typeof e[0]=="string"&&bu.call(e,"index")&&(t.index=e.index,t.input=e.input),t}var vu=Ye.Uint8Array;const Ls=vu;function sn(e){var r=new e.constructor(e.byteLength);return new Ls(r).set(new Ls(e)),r}function xu(e,r){var t=r?sn(e.buffer):e.buffer;return new e.constructor(t,e.byteOffset,e.byteLength)}var wu=/\w*$/;function Pu(e){var r=new e.constructor(e.source,wu.exec(e));return r.lastIndex=e.lastIndex,r}var As=yt?yt.prototype:void 0,Fs=As?As.valueOf:void 0;function Tu(e){return Fs?Object(Fs.call(e)):{}}function Su(e,r){var t=r?sn(e.buffer):e.buffer;return new e.constructor(t,e.byteOffset,e.length)}var Eu="[object Boolean]",Cu="[object Date]",ku="[object Map]",Du="[object Number]",Ou="[object RegExp]",Nu="[object Set]",_u="[object String]",Iu="[object Symbol]",ju="[object ArrayBuffer]",Mu="[object DataView]",Ru="[object Float32Array]",Lu="[object Float64Array]",Au="[object Int8Array]",Fu="[object Int16Array]",$u="[object Int32Array]",Hu="[object Uint8Array]",Yu="[object Uint8ClampedArray]",Wu="[object Uint16Array]",Vu="[object Uint32Array]";function Bu(e,r,t){var n=e.constructor;switch(r){case ju:return sn(e);case Eu:case Cu:return new n(+e);case Mu:return xu(e,t);case Ru:case Lu:case Au:case Fu:case $u:case Hu:case Yu:case Wu:case Vu:return Su(e,t);case ku:return new n;case Du:case _u:return new n(e);case Ou:return Pu(e);case Nu:return new n;case Iu:return Tu(e)}}function Uu(e){return typeof e.constructor=="function"&&!Gr(e)?aa(Ps(e)):{}}var zu="[object Map]";function qu(e){return xt(e)&&nn(e)==zu}var $s=wt&&wt.isMap,Gu=$s?Kr($s):qu;const Ku=Gu;var Zu="[object Set]";function Qu(e){return xt(e)&&nn(e)==Zu}var Hs=wt&&wt.isSet,Xu=Hs?Kr(Hs):Qu;const Ju=Xu;var el=1,tl=2,rl=4,Ys="[object Arguments]",nl="[object Array]",sl="[object Boolean]",ol="[object Date]",il="[object Error]",Ws="[object Function]",al="[object GeneratorFunction]",cl="[object Map]",ul="[object Number]",Vs="[object Object]",ll="[object RegExp]",fl="[object Set]",dl="[object String]",hl="[object Symbol]",pl="[object WeakMap]",ml="[object ArrayBuffer]",gl="[object DataView]",bl="[object Float32Array]",yl="[object Float64Array]",vl="[object Int8Array]",xl="[object Int16Array]",wl="[object Int32Array]",Pl="[object Uint8Array]",Tl="[object Uint8ClampedArray]",Sl="[object Uint16Array]",El="[object Uint32Array]",ye={};ye[Ys]=ye[nl]=ye[ml]=ye[gl]=ye[sl]=ye[ol]=ye[bl]=ye[yl]=ye[vl]=ye[xl]=ye[wl]=ye[cl]=ye[ul]=ye[Vs]=ye[ll]=ye[fl]=ye[dl]=ye[hl]=ye[Pl]=ye[Tl]=ye[Sl]=ye[El]=!0,ye[il]=ye[Ws]=ye[pl]=!1;function dr(e,r,t,n,s,o){var i,a=r&el,c=r&tl,d=r&rl;if(t&&(i=s?t(e,n,s,o):t(e)),i!==void 0)return i;if(!Qe(e))return e;var h=Ur(e);if(h){if(i=yu(e),!a)return ca(e,i)}else{var p=nn(e),v=p==Ws||p==al;if(gs(e))return Zc(e,a);if(p==Vs||p==Ys||v&&!s){if(i=c||v?{}:Uu(e),!a)return c?su(e,Gc(i,e)):tu(e,qc(i,e))}else{if(!ye[p])return s?e:{};i=Bu(e,p,a)}}o||(o=new Tt);var y=o.get(e);if(y)return y;o.set(e,i),Ju(e)?e.forEach(function(O){i.add(dr(O,r,t,O,e,o))}):Ku(e)&&e.forEach(function(O,P){i.set(P,dr(O,r,t,P,e,o))});var x=d?c?iu:ou:c?Xr:Qr,D=h?void 0:x(e);return la(D||e,function(O,P){D&&(P=O,O=e[P]),cs(i,P,dr(O,r,t,P,e,o))}),i}var Cl=1,kl=4;function Dl(e){return dr(e,Cl|kl)}var Ol=function(){return Ye.Date.now()};const on=Ol;var Nl="Expected a function",_l=Math.max,Il=Math.min;function Wt(e,r,t){var n,s,o,i,a,c,d=0,h=!1,p=!1,v=!0;if(typeof e!="function")throw new TypeError(Nl);r=ts(r)||0,Qe(t)&&(h=!!t.leading,p="maxWait"in t,o=p?_l(ts(t.maxWait)||0,r):o,v="trailing"in t?!!t.trailing:v);function y(L){var C=n,U=s;return n=s=void 0,d=L,i=e.apply(U,C),i}function x(L){return d=L,a=setTimeout(P,r),h?y(L):i}function D(L){var C=L-c,U=L-d,B=r-C;return p?Il(B,o-U):B}function O(L){var C=L-c,U=L-d;return c===void 0||C>=r||C<0||p&&U>=o}function P(){var L=on();if(O(L))return R(L);a=setTimeout(P,D(L))}function R(L){return a=void 0,v&&n?y(L):(n=s=void 0,i)}function z(){a!==void 0&&clearTimeout(a),d=0,n=c=s=a=void 0}function $(){return a===void 0?i:R(on())}function g(){var L=on(),C=O(L);if(n=arguments,s=this,c=L,C){if(a===void 0)return x(c);if(p)return clearTimeout(a),a=setTimeout(P,r),y(c)}return a===void 0&&(a=setTimeout(P,r)),i}return g.cancel=z,g.flush=$,g}var jl="Expected a function";function Ml(e,r,t){var n=!0,s=!0;if(typeof e!="function")throw new TypeError(jl);return Qe(t)&&(n="leading"in t?!!t.leading:n,s="trailing"in t?!!t.trailing:s),Wt(e,r,{leading:n,maxWait:r,trailing:s})}const Rl=(e,r)=>{const{value:t,readOnly:n=!1,debounceTime:s=800,fillContainer:o=!0,leftElement:i,rightElement:a,className:c,leftElementClassName:d,rightElementClassName:h,isSingleLine:p=!0,allowSingleLineScroll:v=!1,inputMode:y,placeholder:x,onFocus:D,onBlur:O,onInput:P,onInnerTextChange:R,onInnerHTMLChange:z,onElementCreate:$,onLeftElementClick:g,onRightElementClick:L}=e,C=f.useRef("bsc-flex-grow focus:bsc-outline-none"),U=f.useRef("bsc-text-gray-4"),B=f.useRef(),se=f.useCallback(S=>{const H=S.target,K=H.innerHTML;H.className=`${C.current}`,x&&K===x&&(H.innerHTML=""),D==null||D(S)},[x,D]),re=f.useCallback(S=>{const H=S.target.innerHTML;if(x&&H===""){const K=S.target;K.innerHTML=x,K.className=`${C.current} ${U.current}`}O==null||O(S)},[x,O]),ee=f.useCallback(S=>{var H,K;(H=B.current)==null||H.removeEventListener("focus",se),(K=B.current)==null||K.removeEventListener("blur",re),x&&S&&S!==document.activeElement&&S.innerHTML===""&&(S.innerHTML=x,S.className=`${C.current} ${U.current}`),S.addEventListener("focus",se),S.addEventListener("blur",re),B.current=S},[x]),I=f.useCallback(S=>{$==null||$(S)},[$]),F=S=>{g==null||g(S)},j=S=>{L==null||L(S)},k=Wt(S=>{P==null||P(S),R==null||R(S.target.innerText),z==null||z(S.target.innerHTML)},s),G=f.useCallback(S=>{B.current&&(B.current.innerText=S)},[]),N=f.useCallback(S=>{B.current&&(B.current.innerHTML=S)},[]),W=f.useCallback(()=>{var S;(S=B.current)==null||S.focus()},[]);f.useImperativeHandle(r,()=>({inputElement:B.current,setInnerText:G,setInnerHTML:N,focus:W}));const b=le({"bsc-w-full ":o},"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&&v,"bsc-overflow-hidden bsc-whitespace-pre":p&&!v},c),T=le("bsc-flex-shrink",{"bsc-mr-2":i},d),V=le("bsc-flex-shrink",{"bsc-ml-2":a},h);return l.jsxs("div",{className:b,ref:S=>S&&I(S),children:[i&&l.jsx("div",{className:T,onClick:F,children:i}),l.jsx("div",{ref:S=>S&&ee(S),className:C.current,contentEditable:!n,suppressContentEditableWarning:!0,inputMode:y,onInput:k,children:t}),a&&l.jsx("div",{className:V,onClick:j,children:a})]})},hr=f.forwardRef(Rl);function fe(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 ve(e,r){return e instanceof Date?new e.constructor(r):new Date(r)}function St(e,r){const t=fe(e);return isNaN(r)?ve(e,NaN):(r&&t.setDate(t.getDate()+r),t)}function tt(e,r){const t=fe(e);if(isNaN(r))return ve(e,NaN);if(!r)return t;const n=t.getDate(),s=ve(e,t.getTime());s.setMonth(t.getMonth()+r+1,0);const o=s.getDate();return n>=o?s:(t.setFullYear(s.getFullYear(),s.getMonth(),n),t)}const Bs=6048e5,an=6e4,cn=36e5,Ll=1e3;let Al={};function Vt(){return Al}function rt(e,r){var a,c,d,h;const t=Vt(),n=(r==null?void 0:r.weekStartsOn)??((c=(a=r==null?void 0:r.locale)==null?void 0:a.options)==null?void 0:c.weekStartsOn)??t.weekStartsOn??((h=(d=t.locale)==null?void 0:d.options)==null?void 0:h.weekStartsOn)??0,s=fe(e),o=s.getDay(),i=(o<n?7:0)+o-n;return s.setDate(s.getDate()-i),s.setHours(0,0,0,0),s}function Et(e){return rt(e,{weekStartsOn:1})}function Fl(e){const r=fe(e),t=r.getFullYear(),n=ve(e,0);n.setFullYear(t+1,0,4),n.setHours(0,0,0,0);const s=Et(n),o=ve(e,0);o.setFullYear(t,0,4),o.setHours(0,0,0,0);const i=Et(o);return r.getTime()>=s.getTime()?t+1:r.getTime()>=i.getTime()?t:t-1}function Us(e){const r=fe(e);return r.setHours(0,0,0,0),r}function zs(e){const r=fe(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 $l(e){const r=Fl(e),t=ve(e,0);return t.setFullYear(r,0,4),t.setHours(0,0,0,0),Et(t)}function Bt(e,r){return tt(e,r*12)}function qs(e,r){const t=Us(e),n=Us(r);return+t==+n}function Hl(e){const r=fe(e),t=r.getMonth();return r.setFullYear(r.getFullYear(),t+1,0),r.setHours(23,59,59,999),r}function Yl(e,r){const t=fe(e.start),n=fe(e.end);let s=+t>+n;const o=s?+t:+n,i=s?n:t;i.setHours(0,0,0,0);let a=(r==null?void 0:r.step)??1;if(!a)return[];a<0&&(a=-a,s=!s);const c=[];for(;+i<=o;)c.push(fe(i)),i.setDate(i.getDate()+a),i.setHours(0,0,0,0);return s?c.reverse():c}function Gs(e){const r=fe(e);return r.setDate(1),r.setHours(0,0,0,0),r}function Wl(e,r){const t=fe(e.start),n=fe(e.end);let s=+t>+n;const o=s?+t:+n,i=s?n:t;i.setHours(0,0,0,0),i.setMonth(0,1);let a=(r==null?void 0:r.step)??1;if(!a)return[];a<0&&(a=-a,s=!s);const c=[];for(;+i<=o;)c.push(fe(i)),i.setFullYear(i.getFullYear()+a);return s?c.reverse():c}const Vl={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"}},Bl=(e,r,t)=>{let n;const s=Vl[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 un(e){return(r={})=>{const t=r.width?String(r.width):e.defaultWidth;return e.formats[t]||e.formats[e.defaultWidth]}}const Ul={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},zl={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},ql={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Gl={date:un({formats:Ul,defaultWidth:"full"}),time:un({formats:zl,defaultWidth:"full"}),dateTime:un({formats:ql,defaultWidth:"full"})},Kl={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Zl=(e,r,t,n)=>Kl[e];function Ut(e){return(r,t)=>{const n=t!=null&&t.context?String(t.context):"standalone";let s;if(n==="formatting"&&e.formattingValues){const i=e.defaultFormattingWidth||e.defaultWidth,a=t!=null&&t.width?String(t.width):i;s=e.formattingValues[a]||e.formattingValues[i]}else{const i=e.defaultWidth,a=t!=null&&t.width?String(t.width):e.defaultWidth;s=e.values[a]||e.values[i]}const o=e.argumentCallback?e.argumentCallback(r):r;return s[o]}}const Ql={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Xl={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Jl={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"]},ef={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"]},tf={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"}},rf={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"}},nf={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:Ut({values:Ql,defaultWidth:"wide"}),quarter:Ut({values:Xl,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Ut({values:Jl,defaultWidth:"wide"}),day:Ut({values:ef,defaultWidth:"wide"}),dayPeriod:Ut({values:tf,defaultWidth:"wide",formattingValues:rf,defaultFormattingWidth:"wide"})};function zt(e){return(r,t={})=>{const n=t.width,s=n&&e.matchPatterns[n]||e.matchPatterns[e.defaultMatchWidth],o=r.match(s);if(!o)return null;const i=o[0],a=n&&e.parsePatterns[n]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(a)?of(a,p=>p.test(i)):sf(a,p=>p.test(i));let d;d=e.valueCallback?e.valueCallback(c):c,d=t.valueCallback?t.valueCallback(d):d;const h=r.slice(i.length);return{value:d,rest:h}}}function sf(e,r){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&r(e[t]))return t}function of(e,r){for(let t=0;t<e.length;t++)if(r(e[t]))return t}function af(e){return(r,t={})=>{const n=r.match(e.matchPattern);if(!n)return null;const s=n[0],o=r.match(e.parsePattern);if(!o)return null;let i=e.valueCallback?e.valueCallback(o[0]):o[0];i=t.valueCallback?t.valueCallback(i):i;const a=r.slice(s.length);return{value:i,rest:a}}}const cf=/^(\d+)(th|st|nd|rd)?/i,uf=/\d+/i,lf={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},ff={any:[/^b/i,/^(a|c)/i]},df={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},hf={any:[/1/i,/2/i,/3/i,/4/i]},pf={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},mf={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]},gf={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},bf={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]},yf={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},vf={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}},xf={ordinalNumber:af({matchPattern:cf,parsePattern:uf,valueCallback:e=>parseInt(e,10)}),era:zt({matchPatterns:lf,defaultMatchWidth:"wide",parsePatterns:ff,defaultParseWidth:"any"}),quarter:zt({matchPatterns:df,defaultMatchWidth:"wide",parsePatterns:hf,defaultParseWidth:"any",valueCallback:e=>e+1}),month:zt({matchPatterns:pf,defaultMatchWidth:"wide",parsePatterns:mf,defaultParseWidth:"any"}),day:zt({matchPatterns:gf,defaultMatchWidth:"wide",parsePatterns:bf,defaultParseWidth:"any"}),dayPeriod:zt({matchPatterns:yf,defaultMatchWidth:"any",parsePatterns:vf,defaultParseWidth:"any"})},wf={code:"en-US",formatDistance:Bl,formatLong:Gl,formatRelative:Zl,localize:nf,match:xf,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Pf(e){const r=fe(e),t=+Et(r)-+$l(r);return Math.round(t/Bs)+1}function Ks(e,r){var h,p,v,y;const t=fe(e),n=t.getFullYear(),s=Vt(),o=(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??((y=(v=s.locale)==null?void 0:v.options)==null?void 0:y.firstWeekContainsDate)??1,i=ve(e,0);i.setFullYear(n+1,0,o),i.setHours(0,0,0,0);const a=rt(i,r),c=ve(e,0);c.setFullYear(n,0,o),c.setHours(0,0,0,0);const d=rt(c,r);return t.getTime()>=a.getTime()?n+1:t.getTime()>=d.getTime()?n:n-1}function Tf(e,r){var a,c,d,h;const t=Vt(),n=(r==null?void 0:r.firstWeekContainsDate)??((c=(a=r==null?void 0:r.locale)==null?void 0:a.options)==null?void 0:c.firstWeekContainsDate)??t.firstWeekContainsDate??((h=(d=t.locale)==null?void 0:d.options)==null?void 0:h.firstWeekContainsDate)??1,s=Ks(e,r),o=ve(e,0);return o.setFullYear(s,0,n),o.setHours(0,0,0,0),rt(o,r)}function Sf(e,r){const t=fe(e),n=+rt(t,r)-+Tf(t,r);return Math.round(n/Bs)+1}const Zs=(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"})}},Qs=(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"})}},Xs={p:Qs,P:(e,r)=>{const t=e.match(/(P+)(p+)?/)||[],n=t[1],s=t[2];if(!s)return Zs(e,r);let o;switch(n){case"P":o=r.dateTime({width:"short"});break;case"PP":o=r.dateTime({width:"medium"});break;case"PPP":o=r.dateTime({width:"long"});break;case"PPPP":default:o=r.dateTime({width:"full"});break}return o.replace("{{date}}",Zs(n,r)).replace("{{time}}",Qs(s,r))}},Ef=/^D+$/,Cf=/^Y+$/,kf=["D","DD","YY","YYYY"];function Df(e){return Ef.test(e)}function Of(e){return Cf.test(e)}function Js(e,r,t){const n=Nf(e,r,t);if(console.warn(n),kf.includes(e))throw new RangeError(n)}function Nf(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 ln(e){return fe(e).getDay()}function eo(e){const r=fe(e),t=r.getFullYear(),n=r.getMonth(),s=ve(e,0);return s.setFullYear(t,n+1,0),s.setHours(0,0,0,0),s.getDate()}function _f(){return Object.assign({},Vt())}function If(e){let t=fe(e).getDay();return t===0&&(t=7),t}function jf(e){const r=fe(e),t=r.getMonth();return r.setFullYear(r.getFullYear(),t+1,0),r.setHours(0,0,0,0),r}function Mf(e,r){const t=fe(e),n=fe(r);return+t<+n}function Rf(e,r){const t=r instanceof Date?ve(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 Lf=10;class to{constructor(){m(this,"subPriority",0)}validate(r,t){return!0}}class Af extends to{constructor(r,t,n,s,o){super(),this.value=r,this.validateValue=t,this.setValue=n,this.priority=s,o&&(this.subPriority=o)}validate(r,t){return this.validateValue(r,this.value,t)}set(r,t,n){return this.setValue(r,t,this.value,n)}}class Ff extends to{constructor(){super(...arguments);m(this,"priority",Lf);m(this,"subPriority",-1)}set(t,n){return n.timestampIsSet?t:ve(t,Rf(t,Date))}}class de{run(r,t,n,s){const o=this.parse(r,t,n,s);return o?{setter:new Af(o.value,this.validate,this.set,this.priority,this.subPriority),rest:o.rest}:null}validate(r,t,n){return!0}}class $f extends de{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 Ce(e,r){return e&&{value:r(e.value),rest:e.rest}}function Pe(e,r){const t=r.match(e);return t?{value:parseInt(t[0],10),rest:r.slice(t[0].length)}:null}function Ue(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,o=t[3]?parseInt(t[3],10):0,i=t[5]?parseInt(t[5],10):0;return{value:n*(s*cn+o*an+i*Ll),rest:r.slice(t[0].length)}}function ro(e){return Pe(Ee.anyDigitsSigned,e)}function Te(e,r){switch(e){case 1:return Pe(Ee.singleDigit,r);case 2:return Pe(Ee.twoDigits,r);case 3:return Pe(Ee.threeDigits,r);case 4:return Pe(Ee.fourDigits,r);default:return Pe(new RegExp("^\\d{1,"+e+"}"),r)}}function pr(e,r){switch(e){case 1:return Pe(Ee.singleDigitSigned,r);case 2:return Pe(Ee.twoDigitsSigned,r);case 3:return Pe(Ee.threeDigitsSigned,r);case 4:return Pe(Ee.fourDigitsSigned,r);default:return Pe(new RegExp("^-?\\d{1,"+e+"}"),r)}}function fn(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 no(e,r){const t=r>0,n=t?r:1-r;let s;if(n<=50)s=e||100;else{const o=n+50,i=Math.trunc(o/100)*100,a=e>=o%100;s=e+i-(a?100:0)}return t?s:1-s}function so(e){return e%400===0||e%4===0&&e%100!==0}class Hf extends de{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 o=i=>({year:i,isTwoDigitYear:n==="yy"});switch(n){case"y":return Ce(Te(4,t),o);case"yo":return Ce(s.ordinalNumber(t,{unit:"year"}),o);default:return Ce(Te(n.length,t),o)}}validate(t,n){return n.isTwoDigitYear||n.year>0}set(t,n,s){const o=t.getFullYear();if(s.isTwoDigitYear){const a=no(s.year,o);return t.setFullYear(a,0,1),t.setHours(0,0,0,0),t}const i=!("era"in n)||n.era===1?s.year:1-s.year;return t.setFullYear(i,0,1),t.setHours(0,0,0,0),t}}class Yf extends de{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 o=i=>({year:i,isTwoDigitYear:n==="YY"});switch(n){case"Y":return Ce(Te(4,t),o);case"Yo":return Ce(s.ordinalNumber(t,{unit:"year"}),o);default:return Ce(Te(n.length,t),o)}}validate(t,n){return n.isTwoDigitYear||n.year>0}set(t,n,s,o){const i=Ks(t,o);if(s.isTwoDigitYear){const c=no(s.year,i);return t.setFullYear(c,0,o.firstWeekContainsDate),t.setHours(0,0,0,0),rt(t,o)}const a=!("era"in n)||n.era===1?s.year:1-s.year;return t.setFullYear(a,0,o.firstWeekContainsDate),t.setHours(0,0,0,0),rt(t,o)}}class Wf extends de{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 pr(n==="R"?4:n.length,t)}set(t,n,s){const o=ve(t,0);return o.setFullYear(s,0,4),o.setHours(0,0,0,0),Et(o)}}class Vf extends de{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 pr(n==="u"?4:n.length,t)}set(t,n,s){return t.setFullYear(s,0,1),t.setHours(0,0,0,0),t}}class Bf extends de{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 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 Uf extends de{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 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 zf extends de{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 o=i=>i-1;switch(n){case"M":return Ce(Pe(Ee.month,t),o);case"MM":return Ce(Te(2,t),o);case"Mo":return Ce(s.ordinalNumber(t,{unit:"month"}),o);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 qf extends de{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 o=i=>i-1;switch(n){case"L":return Ce(Pe(Ee.month,t),o);case"LL":return Ce(Te(2,t),o);case"Lo":return Ce(s.ordinalNumber(t,{unit:"month"}),o);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 Gf(e,r,t){const n=fe(e),s=Sf(n,t)-r;return n.setDate(n.getDate()-s*7),n}class Kf extends de{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 Pe(Ee.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,o){return rt(Gf(t,s,o),o)}}function Zf(e,r){const t=fe(e),n=Pf(t)-r;return t.setDate(t.getDate()-n*7),t}class Qf extends de{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 Pe(Ee.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 Et(Zf(t,s))}}const Xf=[31,28,31,30,31,30,31,31,30,31,30,31],Jf=[31,29,31,30,31,30,31,31,30,31,30,31];class ed extends de{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 Pe(Ee.date,t);case"do":return s.ordinalNumber(t,{unit:"date"});default:return Te(n.length,t)}}validate(t,n){const s=t.getFullYear(),o=so(s),i=t.getMonth();return o?n>=1&&n<=Jf[i]:n>=1&&n<=Xf[i]}set(t,n,s){return t.setDate(s),t.setHours(0,0,0,0),t}}class td extends de{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 Pe(Ee.dayOfYear,t);case"Do":return s.ordinalNumber(t,{unit:"date"});default:return Te(n.length,t)}}validate(t,n){const s=t.getFullYear();return so(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 dn(e,r,t){var p,v,y,x;const n=Vt(),s=(t==null?void 0:t.weekStartsOn)??((v=(p=t==null?void 0:t.locale)==null?void 0:p.options)==null?void 0:v.weekStartsOn)??n.weekStartsOn??((x=(y=n.locale)==null?void 0:y.options)==null?void 0:x.weekStartsOn)??0,o=fe(e),i=o.getDay(),c=(r%7+7)%7,d=7-s,h=r<0||r>6?r-(i+d)%7:(c+d)%7-(i+d)%7;return St(o,h)}class rd extends de{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,o){return t=dn(t,s,o),t.setHours(0,0,0,0),t}}class nd extends de{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,o){const i=a=>{const c=Math.floor((a-1)/7)*7;return(a+o.weekStartsOn+6)%7+c};switch(n){case"e":case"ee":return Ce(Te(n.length,t),i);case"eo":return Ce(s.ordinalNumber(t,{unit:"day"}),i);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,o){return t=dn(t,s,o),t.setHours(0,0,0,0),t}}class sd extends de{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,o){const i=a=>{const c=Math.floor((a-1)/7)*7;return(a+o.weekStartsOn+6)%7+c};switch(n){case"c":case"cc":return Ce(Te(n.length,t),i);case"co":return Ce(s.ordinalNumber(t,{unit:"day"}),i);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,o){return t=dn(t,s,o),t.setHours(0,0,0,0),t}}function od(e,r){const t=fe(e),n=If(t),s=r-n;return St(t,s)}class id extends de{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 o=i=>i===0?7:i;switch(n){case"i":case"ii":return Te(n.length,t);case"io":return s.ordinalNumber(t,{unit:"day"});case"iii":return Ce(s.day(t,{width:"abbreviated",context:"formatting"})||s.day(t,{width:"short",context:"formatting"})||s.day(t,{width:"narrow",context:"formatting"}),o);case"iiiii":return Ce(s.day(t,{width:"narrow",context:"formatting"}),o);case"iiiiii":return Ce(s.day(t,{width:"short",context:"formatting"})||s.day(t,{width:"narrow",context:"formatting"}),o);case"iiii":default:return Ce(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"}),o)}}validate(t,n){return n>=1&&n<=7}set(t,n,s){return t=od(t,s),t.setHours(0,0,0,0),t}}class ad extends de{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(fn(s),0,0,0),t}}class cd extends de{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(fn(s),0,0,0),t}}class ud extends de{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(fn(s),0,0,0),t}}class ld extends de{constructor(){super(...arguments);m(this,"priority",70);m(this,"incompatibleTokens",["H","K","k","t","T"])}parse(t,n,s){switch(n){case"h":return Pe(Ee.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 o=t.getHours()>=12;return o&&s<12?t.setHours(s+12,0,0,0):!o&&s===12?t.setHours(0,0,0,0):t.setHours(s,0,0,0),t}}class fd extends de{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 Pe(Ee.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 dd extends de{constructor(){super(...arguments);m(this,"priority",70);m(this,"incompatibleTokens",["h","H","k","t","T"])}parse(t,n,s){switch(n){case"K":return Pe(Ee.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 hd extends de{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 Pe(Ee.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 o=s<=24?s%24:s;return t.setHours(o,0,0,0),t}}class pd extends de{constructor(){super(...arguments);m(this,"priority",60);m(this,"incompatibleTokens",["t","T"])}parse(t,n,s){switch(n){case"m":return Pe(Ee.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 md extends de{constructor(){super(...arguments);m(this,"priority",50);m(this,"incompatibleTokens",["t","T"])}parse(t,n,s){switch(n){case"s":return Pe(Ee.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 gd extends de{constructor(){super(...arguments);m(this,"priority",30);m(this,"incompatibleTokens",["t","T"])}parse(t,n){const s=o=>Math.trunc(o*Math.pow(10,-n.length+3));return Ce(Te(n.length,t),s)}set(t,n,s){return t.setMilliseconds(s),t}}class bd extends de{constructor(){super(...arguments);m(this,"priority",10);m(this,"incompatibleTokens",["t","T","x"])}parse(t,n){switch(n){case"X":return Ue(Be.basicOptionalMinutes,t);case"XX":return Ue(Be.basic,t);case"XXXX":return Ue(Be.basicOptionalSeconds,t);case"XXXXX":return Ue(Be.extendedOptionalSeconds,t);case"XXX":default:return Ue(Be.extended,t)}}set(t,n,s){return n.timestampIsSet?t:ve(t,t.getTime()-zs(t)-s)}}class yd extends de{constructor(){super(...arguments);m(this,"priority",10);m(this,"incompatibleTokens",["t","T","X"])}parse(t,n){switch(n){case"x":return Ue(Be.basicOptionalMinutes,t);case"xx":return Ue(Be.basic,t);case"xxxx":return Ue(Be.basicOptionalSeconds,t);case"xxxxx":return Ue(Be.extendedOptionalSeconds,t);case"xxx":default:return Ue(Be.extended,t)}}set(t,n,s){return n.timestampIsSet?t:ve(t,t.getTime()-zs(t)-s)}}class vd extends de{constructor(){super(...arguments);m(this,"priority",40);m(this,"incompatibleTokens","*")}parse(t){return ro(t)}set(t,n,s){return[ve(t,s*1e3),{timestampIsSet:!0}]}}class xd extends de{constructor(){super(...arguments);m(this,"priority",20);m(this,"incompatibleTokens","*")}parse(t){return ro(t)}set(t,n,s){return[ve(t,s),{timestampIsSet:!0}]}}const wd={G:new $f,y:new Hf,Y:new Yf,R:new Wf,u:new Vf,Q:new Bf,q:new Uf,M:new zf,L:new qf,w:new Kf,I:new Qf,d:new ed,D:new td,E:new rd,e:new nd,c:new sd,i:new id,a:new ad,b:new cd,B:new ud,h:new ld,H:new fd,K:new dd,k:new hd,m:new pd,s:new md,S:new gd,X:new bd,x:new yd,t:new vd,T:new xd},Pd=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Td=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Sd=/^'([^]*?)'?$/,Ed=/''/g,Cd=/\S/,kd=/[a-zA-Z]/;function ze(e,r,t,n){var D,O,P,R,z,$,g,L;const s=_f(),o=(n==null?void 0:n.locale)??s.locale??wf,i=(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=(P=s.locale)==null?void 0:P.options)==null?void 0:R.firstWeekContainsDate)??1,a=(n==null?void 0:n.weekStartsOn)??(($=(z=n==null?void 0:n.locale)==null?void 0:z.options)==null?void 0:$.weekStartsOn)??s.weekStartsOn??((L=(g=s.locale)==null?void 0:g.options)==null?void 0:L.weekStartsOn)??0;if(r==="")return e===""?fe(t):ve(t,NaN);const c={firstWeekContainsDate:i,weekStartsOn:a,locale:o},d=[new Ff],h=r.match(Td).map(C=>{const U=C[0];if(U in Xs){const B=Xs[U];return B(C,o.formatLong)}return C}).join("").match(Pd),p=[];for(let C of h){!(n!=null&&n.useAdditionalWeekYearTokens)&&Of(C)&&Js(C,r,e),!(n!=null&&n.useAdditionalDayOfYearTokens)&&Df(C)&&Js(C,r,e);const U=C[0],B=wd[U];if(B){const{incompatibleTokens:se}=B;if(Array.isArray(se)){const ee=p.find(I=>se.includes(I.token)||I.token===U);if(ee)throw new RangeError(`The format string mustn't contain \`${ee.fullToken}\` and \`${C}\` at the same time`)}else if(B.incompatibleTokens==="*"&&p.length>0)throw new RangeError(`The format string mustn't contain \`${C}\` and any other token at the same time`);p.push({token:U,fullToken:C});const re=B.run(e,C,o.match,c);if(!re)return ve(t,NaN);d.push(re.setter),e=re.rest}else{if(U.match(kd))throw new RangeError("Format string contains an unescaped latin alphabet character `"+U+"`");if(C==="''"?C="'":U==="'"&&(C=Dd(C)),e.indexOf(C)===0)e=e.slice(C.length);else return ve(t,NaN)}}if(e.length>0&&Cd.test(e))return ve(t,NaN);const v=d.map(C=>C.priority).sort((C,U)=>U-C).filter((C,U,B)=>B.indexOf(C)===U).map(C=>d.filter(U=>U.priority===C).sort((U,B)=>B.subPriority-U.subPriority)).map(C=>C[0]);let y=fe(t);if(isNaN(y.getTime()))return ve(t,NaN);const x={};for(const C of v){if(!C.validate(y,c))return ve(t,NaN);const U=C.set(y,x,c);Array.isArray(U)?(y=U[0],Object.assign(x,U[1])):y=U}return ve(t,y)}function Dd(e){return e.match(Sd)[1].replace(Ed,"'")}function Od(e){return qs(e,Date.now())}function Nd(e,r){return St(e,-r)}function _d(e,r){let t=r-ln(e);return t<=0&&(t+=7),St(e,t)}function Id(e,r){const t=(r==null?void 0:r.additionalDigits)??2,n=Ld(e);let s;if(n.date){const c=Ad(n.date,t);s=Fd(c.restDateString,c.year)}if(!s||isNaN(s.getTime()))return new Date(NaN);const o=s.getTime();let i=0,a;if(n.time&&(i=$d(n.time),isNaN(i)))return new Date(NaN);if(n.timezone){if(a=Hd(n.timezone),isNaN(a))return new Date(NaN)}else{const c=new Date(o+i),d=new Date(0);return d.setFullYear(c.getUTCFullYear(),c.getUTCMonth(),c.getUTCDate()),d.setHours(c.getUTCHours(),c.getUTCMinutes(),c.getUTCSeconds(),c.getUTCMilliseconds()),d}return new Date(o+i+a)}const mr={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},jd=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,Md=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,Rd=/^([+-])(\d{2})(?::?(\d{2}))?$/;function Ld(e){const r={},t=e.split(mr.dateTimeDelimiter);let n;if(t.length>2)return r;if(/:/.test(t[0])?n=t[0]:(r.date=t[0],n=t[1],mr.timeZoneDelimiter.test(r.date)&&(r.date=e.split(mr.timeZoneDelimiter)[0],n=e.substr(r.date.length,e.length))),n){const s=mr.timezone.exec(n);s?(r.time=n.replace(s[1],""),r.timezone=s[1]):r.time=n}return r}function Ad(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,o=n[2]?parseInt(n[2]):null;return{year:o===null?s:o*100,restDateString:e.slice((n[1]||n[2]).length)}}function Fd(e,r){if(r===null)return new Date(NaN);const t=e.match(jd);if(!t)return new Date(NaN);const n=!!t[4],s=qt(t[1]),o=qt(t[2])-1,i=qt(t[3]),a=qt(t[4]),c=qt(t[5])-1;if(n)return Ud(r,a,c)?Yd(r,a,c):new Date(NaN);{const d=new Date(0);return!Vd(r,o,i)||!Bd(r,s)?new Date(NaN):(d.setUTCFullYear(r,o,Math.max(s,i)),d)}}function qt(e){return e?parseInt(e):1}function $d(e){const r=e.match(Md);if(!r)return NaN;const t=hn(r[1]),n=hn(r[2]),s=hn(r[3]);return zd(t,n,s)?t*cn+n*an+s*1e3:NaN}function hn(e){return e&&parseFloat(e.replace(",","."))||0}function Hd(e){if(e==="Z")return 0;const r=e.match(Rd);if(!r)return 0;const t=r[1]==="+"?-1:1,n=parseInt(r[2]),s=r[3]&&parseInt(r[3])||0;return qd(n,s)?t*(n*cn+s*an):NaN}function Yd(e,r,t){const n=new Date(0);n.setUTCFullYear(e,0,4);const s=n.getUTCDay()||7,o=(r-1)*7+t+1-s;return n.setUTCDate(n.getUTCDate()+o),n}const Wd=[31,null,31,30,31,30,31,31,30,31,30,31];function oo(e){return e%400===0||e%4===0&&e%100!==0}function Vd(e,r,t){return r>=0&&r<=11&&t>=1&&t<=(Wd[r]||(oo(e)?29:28))}function Bd(e,r){return r>=1&&r<=(oo(e)?366:365)}function Ud(e,r,t){return r>=1&&r<=53&&t>=0&&t<=6}function zd(e,r,t){return e===24?r===0&&t===0:t>=0&&t<60&&r>=0&&r<60&&e>=0&&e<25}function qd(e,r){return r>=0&&r<=59}function Gd(e,r){const t=fe(e),n=t.getFullYear(),s=t.getDate(),o=ve(e,0);o.setFullYear(n,r,15),o.setHours(0,0,0,0);const i=eo(o);return t.setMonth(r,Math.min(s,i)),t}function Kd(e,r){const t=fe(e);return isNaN(+t)?ve(e,NaN):(t.setFullYear(r),t)}function pn(e,r){return tt(e,-r)}function mn(e,r){return Bt(e,-r)}var je=(e=>(e[e.Regular=24]="Regular",e[e.Small=20]="Small",e))(je||{});const io=({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"})}),Zd=({className:e})=>{const r=le("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=le("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"})})},Xd=({className:e})=>{const r=le("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"})})},Jd=({className:e})=>{const r=le("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"})})},eh=({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"})}),Fe=({icon:e,size:r=je.Regular,onClick:t,className:n})=>{const s=f.useRef({calendar:io,chevronDown:Zd,chevronLeft:Qd,chevronRight:Xd,chevronUp:Jd,close:eh}),o=f.useMemo(()=>s.current[e]||io,[e]),i=le({"bsc-h-[24px] bsc-w-[24px]":r===je.Regular,"bsc-h-[20px] bsc-w-[20px]":r===je.Small},n);return l.jsx("div",{onClick:t,children:l.jsx(o,{className:i})})},lt=({template:e,props:r,children:t})=>e(r,t);function th(e,r){if(r===e)return!1;const t=Object.values(r),n=Object.values(e);if(t.length!==n.length||t.some((o,i)=>o!==n[i]))return!0;const s=Object.keys(e);return Object.keys(r).some((o,i)=>o!==s[i])}function rh(e,r){return e.matches[r]=!1,e.mediaQueries[r]={},e}function ao(e){const r=Object.keys(e);return typeof window>"u"?r.reduce(rh,{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 nh(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 ao(r.queries)}}function sh(e){const r=Mt.useRef(e),[t,n]=Mt.useReducer(nh,e,ao);Mt.useEffect(()=>{th(e,r.current)&&(n({type:"setQueries",queries:e}),r.current=e)},[e]);function s(){return n({type:"updateMatches"})}function o(c){const d=s;return typeof c.addListener<"u"?c.addListener(d):c.addEventListener("change",d),d}Mt.useEffect(()=>{const c=Object.values(t.mediaQueries),d=c.map(o);function h(p,v){typeof p.addListener<"u"?p.removeListener(d[v]):p.removeEventListener("change",d[v])}return()=>{c.forEach(h)}},[t.mediaQueries]);const{matches:i}=t,a=Mt.useMemo(()=>Object.values(i),[i]);return{matches:i,matchesAny:a.some(Boolean),matchesAll:a.length>0&&a.every(Boolean)}}function gr(e){return sh(oh(e)).matchesAll}const gn={};function oh(e){return gn[e]===void 0&&(gn[e]={default:e}),gn[e]}const bn=({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:o,desktopMarkup:i})=>{const a=gr(e),c=gr(r),d=gr(t);return(()=>a&&n?n:!a&&s?s:c&&o?o:d&&i?i:(console.error("Invalid media settings"),null))()};function co(e,r,t){const n=o=>{const i=o.target,a=e.style.display!=="hidden";e&&a&&!si(e,i)&&!s(t,i)&&r(!1),r(!0)},s=(o,i)=>{if(!o)return!1;for(let a=0,c=o.length;a<c;a++)if(o[a].isSameNode(i)||o[a].contains(i))return!0;return!1};return document.addEventListener("mousedown",n),n}function uo(e){document.removeEventListener("mousedown",e)}function ih(e,r){if(e==null)return{};var t={},n=Object.keys(e),s,o;for(o=0;o<n.length;o++)s=n[o],!(r.indexOf(s)>=0)&&(t[s]=e[s]);return t}function yn(e,r){return yn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,s){return n.__proto__=s,n},yn(e,r)}function ah(e,r){e.prototype=Object.create(r.prototype),e.prototype.constructor=e,yn(e,r)}var vn={exports:{}},br={exports:{}},pe={};/** @license React v16.13.1
|
|
36
|
+
*/(function(e){(function(){var r={}.hasOwnProperty;function t(){for(var o="",i=0;i<arguments.length;i++){var a=arguments[i];a&&(o=s(o,n(a)))}return o}function n(o){if(typeof o=="string"||typeof o=="number")return o;if(typeof o!="object")return"";if(Array.isArray(o))return t.apply(null,o);if(o.toString!==Object.prototype.toString&&!o.toString.toString().includes("[native code]"))return o.toString();var i="";for(var a in o)r.call(o,a)&&o[a]&&(i=s(i,a));return i}function s(o,i){return i?o?o+" "+i:o+i:o}e.exports?(t.default=t,e.exports=t):window.classNames=t})()})($n);var Uo=$n.exports;const le=Hr(Uo);var Ft=(e=>(e[e.Focus=0]="Focus",e[e.FocusWithin=1]="FocusWithin",e))(Ft||{});const ir=(e=1)=>f.useMemo(()=>le("dark:bsc-ring-mono-light-2 dark:bsc-ring-offset-mono-dark-1",{"focus-within:bsc-ring focus-within:bsc-ring-primary-2 focus-within:bsc-ring-offset-2 focus-within:bsc-ring-opacity-50":e===1,"focus:bsc-ring focus:bsc-ring-primary-2 focus:bsc-ring-offset-2 focus:bsc-ring-opacity-50":e===0}),[e]),zo=(e,r)=>{const t=f.useRef(null),{buttonType:n,buttonStyle:s="flat",type:o="button",disabled:i=!1,form:a,fullWidth:c=!1,onClick:d,className:h,children:p}=e,v=()=>{d==null||d()},y=()=>{var O;(O=t.current)==null||O.click()};f.useImperativeHandle(r,()=>({click:y}));const x=ir(Ft.Focus),D=le("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",x,{"bsc-w-full":c,"bc-disabled bsc-bg-gray-3 bsc-text-gray-2 bsc-pointer-events-none":i,"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:o,onClick:v,disabled:i,form:a,className:D,children:p})},Ve=f.forwardRef(zo),Wr=e=>{const[r,t]=f.useState(!0),n=Fn();return f.useEffect(()=>{e!==void 0?t(e):n&&n.useAnimations!==void 0&&t(n.useAnimations)},[n,e]),r},Hn=f.createContext(void 0),Yn=()=>f.useContext(Hn),qo=({children:e})=>{const r=f.useId(),t=f.useMemo(()=>({sharedId:r}),[r]);return l.jsx(Hn.Provider,{value:t,children:e})},ar=e=>e==null?!1:typeof e=="object",Wn=e=>e instanceof Date,Vn=e=>typeof e=="function",Bn=e=>{const r=typeof e;return r==="string"||r==="number"||r==="boolean"||r==="bigint"},Vr=e=>{if(!ar(e))return e;const r={},t=Object.keys(e);for(let n=0,s=t.length;n<s;n++){const o=t[n],i=e[o];Bn(i)||Vn(i)?r[o]=i:Wn(i)?r[o]=new Date(i.getTime()):Array.isArray(i)?r[o]=Br(i):ar(i)&&(r[o]=Vr(i))}return r},Br=e=>{let r=e.length;const t=new Array(r);for(;r--!==0;){const n=e[r];Bn(n)||Vn(n)?t[r]=n:Wn(n)?t[r]=new Date(n.getTime()):ar(n)&&!Array.isArray(n)?t[r]=Vr(n):Array.isArray(n)?t[r]=Br(n):t[r]=n}return t},Go=e=>ar(e)?Array.isArray(e)?Br(e):Vr(e):e;function Ko(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Zo=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,o;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(o=Object.keys(r),n=o.length,n!==Object.keys(t).length)return!1;for(s=n;s--!==0;)if(!Object.prototype.hasOwnProperty.call(t,o[s]))return!1;for(s=n;s--!==0;){var i=o[s];if(!e(r[i],t[i]))return!1}return!0}return r!==r&&t!==t};const Un=Ko(Zo);function Qo(e,r){for(let t=e.length;t--!==0;)if(!Un(e[t],r[t]))return!0;return!1}const cr=(e,r)=>{const t=f.useRef([]),n=t.current.length>0&&t.current[0]&&Qo(t.current[0],r);return(t.current.length===0||n)&&(t.current=[Go(r),e()]),t.current[1]},zn=e=>{const r=f.useRef();let t=!1;r.current!==void 0&&(t=!Un(r.current,e));const n={changed:t,previousValue:r.current};return r.current=e,n},Xo=e=>typeof e=="function",Jo=e=>{const[r,t]=f.useState({value:e,initial:!0}),n=f.useRef(e);return[r,s=>{if(!Xo(s))t({value:s,initial:!1});else{const o=s(n.current);n.current=o,t({value:o,initial:!1})}}]},ei=e=>{const[r,t]=Jo(e),n=f.useRef({value:e,initial:!0});return n.current!==r&&(n.current=r),[r,t,n]},ti=e=>{const[r,t]=f.useState(e),n=f.useRef(e);return n.current!==r&&(n.current=r),[r,t,n]};function qn(){return window.navigator.languages?window.navigator.languages[0]:window.navigator.language}function ri(e,r,t){const n=[];for(let s=e;s<=r;s++)n.push(t?t(s):s);return n}function ni(e,r){const t=e.target;return t?!r.isSameNode(t)&&!r.contains(t):!1}function si(e,r){return e.isSameNode(r)||e.contains(r)}function oi(e,r){const t=Object.entries(r),n=getComputedStyle(e);for(let s=0,o=t.length;s<o;s++){const[i,a]=t[s];if(typeof a=="string"&&a.indexOf(",")>-1){if(!a.split(",").map(d=>d.trim()).includes(n[i]))return!1}else if(n[i]!==a)return!1}return!0}function ii(e,r){const t=Object.entries(r),n=getComputedStyle(e);for(let s=0,o=t.length;s<o;s++){const[i,a]=t[s];if(typeof a=="string"&&a.indexOf(",")>-1){if(a.split(",").map(d=>d.trim()).includes(n[i]))return!0}else if(n[i]===a)return!0}return!1}function Gn(e,r,t=!1,n){if(t&&oi(e,r)){if(!n||(n==null?void 0:n(e))===!0)return e}else if(!t&&ii(e,r)&&(!n||(n==null?void 0:n(e))===!0))return e;return e.parentElement?Gn(e.parentElement,r,t,n):e}function Kn(e,r){const t=Array.from(document.querySelectorAll("body *")),n=[];for(let s=0,o=t.length;s<o;s++){const i=getComputedStyle(t[s]);i[e]&&r(i[e])&&n.push(i[e])}return n}function yp(e){return e}function ai(e){const r=document.documentElement;Object.keys(e).forEach(t=>{r.style.setProperty(t,e[t])})}function ci(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 ui=f.createContext(void 0),li=()=>f.useContext(ui),fi=({id:e,name:r,value:t,type:n,checked:s,readOnly:o,className:i})=>l.jsx("input",{id:e,name:r,value:t,type:n,checked:s,onChange:()=>{},readOnly:o,disabled:o,className:i}),di=({type:e,props:r,renderProps:t,signalName:n,onSignalRetrieved:s,children:o,className:i})=>{const a=li(),{id:c,name:d}=cr(()=>{const h=r;return{id:h.id,name:h.name}},[r]);return f.useEffect(()=>{a&&n&&a[n]&&s&&s(a[n])},[a]),l.jsxs(l.Fragment,{children:[c&&d&&e&&l.jsx(fi,{id:c,name:d,type:e,className:i,...r}),o&&o(t)]})},hi=(e,r)=>{const{name:t,value:n,checked:s=!1,partial:o=!1,onChange:i,children:a,labelStyles:c,className:d}=e,h=Yn(),p=f.useId(),[v,y,x]=ei({checked:!1,partial:!1}),D=zn(s),O=zn(o),P={id:(h==null?void 0:h.sharedId)||e.id||p,...e,...v.value};f.useEffect(()=>{if(v.initial)y({checked:o?!0:s,partial:o});else{const g=D.changed?s:v.value.checked,L=O.changed?o:v.value.partial;y({checked:L?!0:g,partial:L})}},[s,o]);const R=g=>{var C;const L=((C=x.current)==null?void 0:C.value.partial)===!0?!0:g.target.checked;y({checked:L,partial:!1}),i==null||i({originalEvent:g,name:t||g.target.name,value:n,checked:L})},z=g=>{var C;const L={checked:g?!0:((C=x.current)==null?void 0:C.value.checked)||!1,partial:g};y(L)},$=g=>{y({checked:g,partial:!1})};return f.useImperativeHandle(r,()=>({setPartiallyChecked:z,setChecked:$})),l.jsx("label",{className:c,onChange:g=>R(g),children:l.jsx(di,{id:p,name:t,type:"checkbox",props:P,renderProps:v.value,className:d,children:a})})},pi=f.memo(f.forwardRef(hi)),mi=({label:e,htmlFor:r,className:t})=>{const n=Yn(),s=f.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})},Ze=({label:e,htmlFor:r,readOnly:t=!1,className:n})=>{const s=le("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(mi,{label:e,htmlFor:r,className:s})},gi=(e,r)=>{const{name:t,label:n,value:s,readOnly:o=!1,checked:i=!1,partial:a=!1,labelLocation:c=Ae.Right,className:d,useAnimation:h,onChange:p}=e,v=Wr(h),y=le("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":o},d),x=le("bc-checkbox-label bsc-cursor-pointer",{"bsc-ml-2":c===Ae.Right,"bsc-mr-2":c===Ae.Left}),D=ir(Ft.FocusWithin),O=le("bc-checkbox-outer bsc-relative bsc-rounded *:bsc-block *:bsc-size-[21px]",{"bsc-checkbox-animate":!o&&v,"bc-read-only bsc-checkbox-no-animate":o||!o&&!v},D),P=le("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]":v,"bsc-checkbox":!o,"bc-read-only bsc-checkbox-read-only":o}),R=le("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":!o,"bc-read-only bsc-fill-primary-4 dark:bsc-fill-mono-light-3":o});return l.jsx(qo,{children:l.jsxs("div",{className:y,children:[n&&c===Ae.Left&&l.jsx(Ze,{label:n,readOnly:o,className:x}),l.jsx(pi,{ref:r,name:t,value:s,checked:i,partial:a,readOnly:o,className:P,labelStyles:O,onChange:p,children:({partial:z})=>l.jsx("svg",{viewBox:"0 0 21 21",className:R,children:z?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===Ae.Right&&l.jsx(Ze,{label:n,readOnly:o,className:x})]})})},Zn=f.memo(f.forwardRef(gi)),bi=({name:e,label:r,value:t,data:n,textField:s,valueField:o,readOnly:i=!1,orientation:a=Ie.Vertical,className:c,onChange:d})=>{const[h,p]=f.useState([]),v=cr(()=>n,[n]);f.useEffect(()=>{p(t??[])},[t]);const y=R=>{const{value:z,checked:$}=R;let g;$?g=[...h,z]:g=h.filter(L=>L!==z),p(g),d==null||d({name:e,value:g})},x=(R,z)=>l.jsx(Zn,{name:e,label:R[s],value:R[o],checked:h.some($=>$===R[o]),readOnly:i,onChange:$=>$&&y($),className:"bsc-mr-3"},`${e}_checkbox_${z}`),D=le("bsc-flex bsc-flex-col bsc-gap-1",c),O=le("bsc-flex bsc-gap-1",{"bsc-flex-col":a===Ie.Vertical}),P=R=>l.jsx("div",{className:O,children:R.map(x)});return l.jsxs("div",{className:D,children:[r&&l.jsx(Ze,{label:r,readOnly:i}),v&&P(v)]})},yi=f.memo(bi);var vi=typeof global=="object"&&global&&global.Object===Object&&global;const Qn=vi;var xi=typeof self=="object"&&self&&self.Object===Object&&self,wi=Qn||xi||Function("return this")();const Ye=wi;var Pi=Ye.Symbol;const yt=Pi;var Xn=Object.prototype,Ti=Xn.hasOwnProperty,Si=Xn.toString,$t=yt?yt.toStringTag:void 0;function Ei(e){var r=Ti.call(e,$t),t=e[$t];try{e[$t]=void 0;var n=!0}catch{}var s=Si.call(e);return n&&(r?e[$t]=t:delete e[$t]),s}var Ci=Object.prototype,ki=Ci.toString;function Di(e){return ki.call(e)}var Oi="[object Null]",Ni="[object Undefined]",Jn=yt?yt.toStringTag:void 0;function vt(e){return e==null?e===void 0?Ni:Oi:Jn&&Jn in Object(e)?Ei(e):Di(e)}function xt(e){return e!=null&&typeof e=="object"}var _i="[object Symbol]";function Ii(e){return typeof e=="symbol"||xt(e)&&vt(e)==_i}var ji=Array.isArray;const Ur=ji;var Mi=/\s/;function Ri(e){for(var r=e.length;r--&&Mi.test(e.charAt(r)););return r}var Li=/^\s+/;function Ai(e){return e&&e.slice(0,Ri(e)+1).replace(Li,"")}function Qe(e){var r=typeof e;return e!=null&&(r=="object"||r=="function")}var es=0/0,Fi=/^[-+]0x[0-9a-f]+$/i,$i=/^0b[01]+$/i,Hi=/^0o[0-7]+$/i,Yi=parseInt;function ts(e){if(typeof e=="number")return e;if(Ii(e))return es;if(Qe(e)){var r=typeof e.valueOf=="function"?e.valueOf():e;e=Qe(r)?r+"":r}if(typeof e!="string")return e===0?e:+e;e=Ai(e);var t=$i.test(e);return t||Hi.test(e)?Yi(e.slice(2),t?2:8):Fi.test(e)?es:+e}var Wi="[object AsyncFunction]",Vi="[object Function]",Bi="[object GeneratorFunction]",Ui="[object Proxy]";function rs(e){if(!Qe(e))return!1;var r=vt(e);return r==Vi||r==Bi||r==Wi||r==Ui}var zi=Ye["__core-js_shared__"];const zr=zi;var ns=function(){var e=/[^.]+$/.exec(zr&&zr.keys&&zr.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function qi(e){return!!ns&&ns in e}var Gi=Function.prototype,Ki=Gi.toString;function it(e){if(e!=null){try{return Ki.call(e)}catch{}try{return e+""}catch{}}return""}var Zi=/[\\^$.*+?()[\]{}|]/g,Qi=/^\[object .+?Constructor\]$/,Xi=Function.prototype,Ji=Object.prototype,ea=Xi.toString,ta=Ji.hasOwnProperty,ra=RegExp("^"+ea.call(ta).replace(Zi,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function na(e){if(!Qe(e)||qi(e))return!1;var r=rs(e)?ra:Qi;return r.test(it(e))}function sa(e,r){return e==null?void 0:e[r]}function at(e,r){var t=sa(e,r);return na(t)?t:void 0}var oa=at(Ye,"WeakMap");const qr=oa;var ss=Object.create,ia=function(){function e(){}return function(r){if(!Qe(r))return{};if(ss)return ss(r);e.prototype=r;var t=new e;return e.prototype=void 0,t}}();const aa=ia;function ca(e,r){var t=-1,n=e.length;for(r||(r=Array(n));++t<n;)r[t]=e[t];return r}var ua=function(){try{var e=at(Object,"defineProperty");return e({},"",{}),e}catch{}}();const os=ua;function la(e,r){for(var t=-1,n=e==null?0:e.length;++t<n&&r(e[t],t,e)!==!1;);return e}var fa=9007199254740991,da=/^(?:0|[1-9]\d*)$/;function ha(e,r){var t=typeof e;return r=r??fa,!!r&&(t=="number"||t!="symbol"&&da.test(e))&&e>-1&&e%1==0&&e<r}function is(e,r,t){r=="__proto__"&&os?os(e,r,{configurable:!0,enumerable:!0,value:t,writable:!0}):e[r]=t}function as(e,r){return e===r||e!==e&&r!==r}var pa=Object.prototype,ma=pa.hasOwnProperty;function cs(e,r,t){var n=e[r];(!(ma.call(e,r)&&as(n,t))||t===void 0&&!(r in e))&&is(e,r,t)}function ur(e,r,t,n){var s=!t;t||(t={});for(var o=-1,i=r.length;++o<i;){var a=r[o],c=n?n(t[a],e[a],a,t,e):void 0;c===void 0&&(c=e[a]),s?is(t,a,c):cs(t,a,c)}return t}var ga=9007199254740991;function us(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=ga}function ls(e){return e!=null&&us(e.length)&&!rs(e)}var ba=Object.prototype;function Gr(e){var r=e&&e.constructor,t=typeof r=="function"&&r.prototype||ba;return e===t}function ya(e,r){for(var t=-1,n=Array(e);++t<e;)n[t]=r(t);return n}var va="[object Arguments]";function fs(e){return xt(e)&&vt(e)==va}var ds=Object.prototype,xa=ds.hasOwnProperty,wa=ds.propertyIsEnumerable,Pa=fs(function(){return arguments}())?fs:function(e){return xt(e)&&xa.call(e,"callee")&&!wa.call(e,"callee")};const Ta=Pa;function Sa(){return!1}var hs=typeof J=="object"&&J&&!J.nodeType&&J,ps=hs&&typeof module=="object"&&module&&!module.nodeType&&module,Ea=ps&&ps.exports===hs,ms=Ea?Ye.Buffer:void 0,Ca=ms?ms.isBuffer:void 0,ka=Ca||Sa;const gs=ka;var Da="[object Arguments]",Oa="[object Array]",Na="[object Boolean]",_a="[object Date]",Ia="[object Error]",ja="[object Function]",Ma="[object Map]",Ra="[object Number]",La="[object Object]",Aa="[object RegExp]",Fa="[object Set]",$a="[object String]",Ha="[object WeakMap]",Ya="[object ArrayBuffer]",Wa="[object DataView]",Va="[object Float32Array]",Ba="[object Float64Array]",Ua="[object Int8Array]",za="[object Int16Array]",qa="[object Int32Array]",Ga="[object Uint8Array]",Ka="[object Uint8ClampedArray]",Za="[object Uint16Array]",Qa="[object Uint32Array]",xe={};xe[Va]=xe[Ba]=xe[Ua]=xe[za]=xe[qa]=xe[Ga]=xe[Ka]=xe[Za]=xe[Qa]=!0,xe[Da]=xe[Oa]=xe[Ya]=xe[Na]=xe[Wa]=xe[_a]=xe[Ia]=xe[ja]=xe[Ma]=xe[Ra]=xe[La]=xe[Aa]=xe[Fa]=xe[$a]=xe[Ha]=!1;function Xa(e){return xt(e)&&us(e.length)&&!!xe[vt(e)]}function Kr(e){return function(r){return e(r)}}var bs=typeof J=="object"&&J&&!J.nodeType&&J,Ht=bs&&typeof module=="object"&&module&&!module.nodeType&&module,Ja=Ht&&Ht.exports===bs,Zr=Ja&&Qn.process,ec=function(){try{var e=Ht&&Ht.require&&Ht.require("util").types;return e||Zr&&Zr.binding&&Zr.binding("util")}catch{}}();const wt=ec;var ys=wt&&wt.isTypedArray,tc=ys?Kr(ys):Xa;const rc=tc;var nc=Object.prototype,sc=nc.hasOwnProperty;function vs(e,r){var t=Ur(e),n=!t&&Ta(e),s=!t&&!n&&gs(e),o=!t&&!n&&!s&&rc(e),i=t||n||s||o,a=i?ya(e.length,String):[],c=a.length;for(var d in e)(r||sc.call(e,d))&&!(i&&(d=="length"||s&&(d=="offset"||d=="parent")||o&&(d=="buffer"||d=="byteLength"||d=="byteOffset")||ha(d,c)))&&a.push(d);return a}function xs(e,r){return function(t){return e(r(t))}}var oc=xs(Object.keys,Object);const ic=oc;var ac=Object.prototype,cc=ac.hasOwnProperty;function uc(e){if(!Gr(e))return ic(e);var r=[];for(var t in Object(e))cc.call(e,t)&&t!="constructor"&&r.push(t);return r}function Qr(e){return ls(e)?vs(e):uc(e)}function lc(e){var r=[];if(e!=null)for(var t in Object(e))r.push(t);return r}var fc=Object.prototype,dc=fc.hasOwnProperty;function hc(e){if(!Qe(e))return lc(e);var r=Gr(e),t=[];for(var n in e)n=="constructor"&&(r||!dc.call(e,n))||t.push(n);return t}function Xr(e){return ls(e)?vs(e,!0):hc(e)}var pc=at(Object,"create");const Yt=pc;function mc(){this.__data__=Yt?Yt(null):{},this.size=0}function gc(e){var r=this.has(e)&&delete this.__data__[e];return this.size-=r?1:0,r}var bc="__lodash_hash_undefined__",yc=Object.prototype,vc=yc.hasOwnProperty;function xc(e){var r=this.__data__;if(Yt){var t=r[e];return t===bc?void 0:t}return vc.call(r,e)?r[e]:void 0}var wc=Object.prototype,Pc=wc.hasOwnProperty;function Tc(e){var r=this.__data__;return Yt?r[e]!==void 0:Pc.call(r,e)}var Sc="__lodash_hash_undefined__";function Ec(e,r){var t=this.__data__;return this.size+=this.has(e)?0:1,t[e]=Yt&&r===void 0?Sc:r,this}function ct(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])}}ct.prototype.clear=mc,ct.prototype.delete=gc,ct.prototype.get=xc,ct.prototype.has=Tc,ct.prototype.set=Ec;function Cc(){this.__data__=[],this.size=0}function lr(e,r){for(var t=e.length;t--;)if(as(e[t][0],r))return t;return-1}var kc=Array.prototype,Dc=kc.splice;function Oc(e){var r=this.__data__,t=lr(r,e);if(t<0)return!1;var n=r.length-1;return t==n?r.pop():Dc.call(r,t,1),--this.size,!0}function Nc(e){var r=this.__data__,t=lr(r,e);return t<0?void 0:r[t][1]}function _c(e){return lr(this.__data__,e)>-1}function Ic(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 Xe(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])}}Xe.prototype.clear=Cc,Xe.prototype.delete=Oc,Xe.prototype.get=Nc,Xe.prototype.has=_c,Xe.prototype.set=Ic;var jc=at(Ye,"Map");const Wt=jc;function Mc(){this.size=0,this.__data__={hash:new ct,map:new(Wt||Xe),string:new ct}}function Rc(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 Rc(r)?t[typeof r=="string"?"string":"hash"]:t.map}function Lc(e){var r=fr(this,e).delete(e);return this.size-=r?1:0,r}function Ac(e){return fr(this,e).get(e)}function Fc(e){return fr(this,e).has(e)}function $c(e,r){var t=fr(this,e),n=t.size;return t.set(e,r),this.size+=t.size==n?0:1,this}function Pt(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])}}Pt.prototype.clear=Mc,Pt.prototype.delete=Lc,Pt.prototype.get=Ac,Pt.prototype.has=Fc,Pt.prototype.set=$c;function ws(e,r){for(var t=-1,n=r.length,s=e.length;++t<n;)e[s+t]=r[t];return e}var Hc=xs(Object.getPrototypeOf,Object);const Ps=Hc;function Yc(){this.__data__=new Xe,this.size=0}function Wc(e){var r=this.__data__,t=r.delete(e);return this.size=r.size,t}function Vc(e){return this.__data__.get(e)}function Bc(e){return this.__data__.has(e)}var Uc=200;function zc(e,r){var t=this.__data__;if(t instanceof Xe){var n=t.__data__;if(!Wt||n.length<Uc-1)return n.push([e,r]),this.size=++t.size,this;t=this.__data__=new Pt(n)}return t.set(e,r),this.size=t.size,this}function Tt(e){var r=this.__data__=new Xe(e);this.size=r.size}Tt.prototype.clear=Yc,Tt.prototype.delete=Wc,Tt.prototype.get=Vc,Tt.prototype.has=Bc,Tt.prototype.set=zc;function qc(e,r){return e&&ur(r,Qr(r),e)}function Gc(e,r){return e&&ur(r,Xr(r),e)}var Ts=typeof J=="object"&&J&&!J.nodeType&&J,Ss=Ts&&typeof module=="object"&&module&&!module.nodeType&&module,Kc=Ss&&Ss.exports===Ts,Es=Kc?Ye.Buffer:void 0,Cs=Es?Es.allocUnsafe:void 0;function Zc(e,r){if(r)return e.slice();var t=e.length,n=Cs?Cs(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,o=[];++t<n;){var i=e[t];r(i,t,e)&&(o[s++]=i)}return o}function ks(){return[]}var Xc=Object.prototype,Jc=Xc.propertyIsEnumerable,Ds=Object.getOwnPropertySymbols,eu=Ds?function(e){return e==null?[]:(e=Object(e),Qc(Ds(e),function(r){return Jc.call(e,r)}))}:ks;const Jr=eu;function tu(e,r){return ur(e,Jr(e),r)}var ru=Object.getOwnPropertySymbols,nu=ru?function(e){for(var r=[];e;)ws(r,Jr(e)),e=Ps(e);return r}:ks;const Os=nu;function su(e,r){return ur(e,Os(e),r)}function Ns(e,r,t){var n=r(e);return Ur(e)?n:ws(n,t(e))}function ou(e){return Ns(e,Qr,Jr)}function iu(e){return Ns(e,Xr,Os)}var au=at(Ye,"DataView");const en=au;var cu=at(Ye,"Promise");const tn=cu;var uu=at(Ye,"Set");const rn=uu;var _s="[object Map]",lu="[object Object]",Is="[object Promise]",js="[object Set]",Ms="[object WeakMap]",Rs="[object DataView]",fu=it(en),du=it(Wt),hu=it(tn),pu=it(rn),mu=it(qr),ut=vt;(en&&ut(new en(new ArrayBuffer(1)))!=Rs||Wt&&ut(new Wt)!=_s||tn&&ut(tn.resolve())!=Is||rn&&ut(new rn)!=js||qr&&ut(new qr)!=Ms)&&(ut=function(e){var r=vt(e),t=r==lu?e.constructor:void 0,n=t?it(t):"";if(n)switch(n){case fu:return Rs;case du:return _s;case hu:return Is;case pu:return js;case mu:return Ms}return r});const nn=ut;var gu=Object.prototype,bu=gu.hasOwnProperty;function yu(e){var r=e.length,t=new e.constructor(r);return r&&typeof e[0]=="string"&&bu.call(e,"index")&&(t.index=e.index,t.input=e.input),t}var vu=Ye.Uint8Array;const Ls=vu;function sn(e){var r=new e.constructor(e.byteLength);return new Ls(r).set(new Ls(e)),r}function xu(e,r){var t=r?sn(e.buffer):e.buffer;return new e.constructor(t,e.byteOffset,e.byteLength)}var wu=/\w*$/;function Pu(e){var r=new e.constructor(e.source,wu.exec(e));return r.lastIndex=e.lastIndex,r}var As=yt?yt.prototype:void 0,Fs=As?As.valueOf:void 0;function Tu(e){return Fs?Object(Fs.call(e)):{}}function Su(e,r){var t=r?sn(e.buffer):e.buffer;return new e.constructor(t,e.byteOffset,e.length)}var Eu="[object Boolean]",Cu="[object Date]",ku="[object Map]",Du="[object Number]",Ou="[object RegExp]",Nu="[object Set]",_u="[object String]",Iu="[object Symbol]",ju="[object ArrayBuffer]",Mu="[object DataView]",Ru="[object Float32Array]",Lu="[object Float64Array]",Au="[object Int8Array]",Fu="[object Int16Array]",$u="[object Int32Array]",Hu="[object Uint8Array]",Yu="[object Uint8ClampedArray]",Wu="[object Uint16Array]",Vu="[object Uint32Array]";function Bu(e,r,t){var n=e.constructor;switch(r){case ju:return sn(e);case Eu:case Cu:return new n(+e);case Mu:return xu(e,t);case Ru:case Lu:case Au:case Fu:case $u:case Hu:case Yu:case Wu:case Vu:return Su(e,t);case ku:return new n;case Du:case _u:return new n(e);case Ou:return Pu(e);case Nu:return new n;case Iu:return Tu(e)}}function Uu(e){return typeof e.constructor=="function"&&!Gr(e)?aa(Ps(e)):{}}var zu="[object Map]";function qu(e){return xt(e)&&nn(e)==zu}var $s=wt&&wt.isMap,Gu=$s?Kr($s):qu;const Ku=Gu;var Zu="[object Set]";function Qu(e){return xt(e)&&nn(e)==Zu}var Hs=wt&&wt.isSet,Xu=Hs?Kr(Hs):Qu;const Ju=Xu;var el=1,tl=2,rl=4,Ys="[object Arguments]",nl="[object Array]",sl="[object Boolean]",ol="[object Date]",il="[object Error]",Ws="[object Function]",al="[object GeneratorFunction]",cl="[object Map]",ul="[object Number]",Vs="[object Object]",ll="[object RegExp]",fl="[object Set]",dl="[object String]",hl="[object Symbol]",pl="[object WeakMap]",ml="[object ArrayBuffer]",gl="[object DataView]",bl="[object Float32Array]",yl="[object Float64Array]",vl="[object Int8Array]",xl="[object Int16Array]",wl="[object Int32Array]",Pl="[object Uint8Array]",Tl="[object Uint8ClampedArray]",Sl="[object Uint16Array]",El="[object Uint32Array]",ye={};ye[Ys]=ye[nl]=ye[ml]=ye[gl]=ye[sl]=ye[ol]=ye[bl]=ye[yl]=ye[vl]=ye[xl]=ye[wl]=ye[cl]=ye[ul]=ye[Vs]=ye[ll]=ye[fl]=ye[dl]=ye[hl]=ye[Pl]=ye[Tl]=ye[Sl]=ye[El]=!0,ye[il]=ye[Ws]=ye[pl]=!1;function dr(e,r,t,n,s,o){var i,a=r&el,c=r&tl,d=r&rl;if(t&&(i=s?t(e,n,s,o):t(e)),i!==void 0)return i;if(!Qe(e))return e;var h=Ur(e);if(h){if(i=yu(e),!a)return ca(e,i)}else{var p=nn(e),v=p==Ws||p==al;if(gs(e))return Zc(e,a);if(p==Vs||p==Ys||v&&!s){if(i=c||v?{}:Uu(e),!a)return c?su(e,Gc(i,e)):tu(e,qc(i,e))}else{if(!ye[p])return s?e:{};i=Bu(e,p,a)}}o||(o=new Tt);var y=o.get(e);if(y)return y;o.set(e,i),Ju(e)?e.forEach(function(O){i.add(dr(O,r,t,O,e,o))}):Ku(e)&&e.forEach(function(O,P){i.set(P,dr(O,r,t,P,e,o))});var x=d?c?iu:ou:c?Xr:Qr,D=h?void 0:x(e);return la(D||e,function(O,P){D&&(P=O,O=e[P]),cs(i,P,dr(O,r,t,P,e,o))}),i}var Cl=1,kl=4;function Dl(e){return dr(e,Cl|kl)}var Ol=function(){return Ye.Date.now()};const on=Ol;var Nl="Expected a function",_l=Math.max,Il=Math.min;function Vt(e,r,t){var n,s,o,i,a,c,d=0,h=!1,p=!1,v=!0;if(typeof e!="function")throw new TypeError(Nl);r=ts(r)||0,Qe(t)&&(h=!!t.leading,p="maxWait"in t,o=p?_l(ts(t.maxWait)||0,r):o,v="trailing"in t?!!t.trailing:v);function y(L){var C=n,U=s;return n=s=void 0,d=L,i=e.apply(U,C),i}function x(L){return d=L,a=setTimeout(P,r),h?y(L):i}function D(L){var C=L-c,U=L-d,B=r-C;return p?Il(B,o-U):B}function O(L){var C=L-c,U=L-d;return c===void 0||C>=r||C<0||p&&U>=o}function P(){var L=on();if(O(L))return R(L);a=setTimeout(P,D(L))}function R(L){return a=void 0,v&&n?y(L):(n=s=void 0,i)}function z(){a!==void 0&&clearTimeout(a),d=0,n=c=s=a=void 0}function $(){return a===void 0?i:R(on())}function g(){var L=on(),C=O(L);if(n=arguments,s=this,c=L,C){if(a===void 0)return x(c);if(p)return clearTimeout(a),a=setTimeout(P,r),y(c)}return a===void 0&&(a=setTimeout(P,r)),i}return g.cancel=z,g.flush=$,g}var jl="Expected a function";function Ml(e,r,t){var n=!0,s=!0;if(typeof e!="function")throw new TypeError(jl);return Qe(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 Rl=(e,r)=>{const{value:t,readOnly:n=!1,debounceTime:s=800,fillContainer:o=!0,leftElement:i,rightElement:a,className:c,leftElementClassName:d,rightElementClassName:h,isSingleLine:p=!0,allowSingleLineScroll:v=!1,inputMode:y,placeholder:x,onFocus:D,onBlur:O,onInput:P,onInnerTextChange:R,onInnerHTMLChange:z,onElementCreate:$,onLeftElementClick:g,onRightElementClick:L}=e,C=f.useRef("bsc-flex-grow focus:bsc-outline-none"),U=f.useRef("bsc-text-gray-4"),B=f.useRef(),se=f.useCallback(S=>{const H=S.target,K=H.innerHTML;H.className=`${C.current}`,x&&K===x&&(H.innerHTML=""),D==null||D(S)},[x,D]),re=f.useCallback(S=>{const H=S.target.innerHTML;if(x&&H===""){const K=S.target;K.innerHTML=x,K.className=`${C.current} ${U.current}`}O==null||O(S)},[x,O]),ee=f.useCallback(S=>{var H,K;(H=B.current)==null||H.removeEventListener("focus",se),(K=B.current)==null||K.removeEventListener("blur",re),x&&S&&S!==document.activeElement&&S.innerHTML===""&&(S.innerHTML=x,S.className=`${C.current} ${U.current}`),S.addEventListener("focus",se),S.addEventListener("blur",re),B.current=S},[x]),I=f.useCallback(S=>{$==null||$(S)},[$]),F=S=>{g==null||g(S)},j=S=>{L==null||L(S)},k=Vt(S=>{P==null||P(S),R==null||R(S.target.innerText),z==null||z(S.target.innerHTML)},s),G=f.useCallback(S=>{B.current&&(B.current.innerText=S)},[]),N=f.useCallback(S=>{B.current&&(B.current.innerHTML=S)},[]),W=f.useCallback(()=>{var S;(S=B.current)==null||S.focus()},[]);f.useImperativeHandle(r,()=>({inputElement:B.current,setInnerText:G,setInnerHTML:N,focus:W}));const b=le({"bsc-w-full ":o},"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&&v,"bsc-overflow-hidden bsc-whitespace-pre":p&&!v},c),T=le("bsc-flex-shrink",{"bsc-mr-2":i},d),V=le("bsc-flex-shrink",{"bsc-ml-2":a},h);return l.jsxs("div",{className:b,ref:S=>S&&I(S),children:[i&&l.jsx("div",{className:T,onClick:F,children:i}),l.jsx("div",{ref:S=>S&&ee(S),className:C.current,contentEditable:!n,suppressContentEditableWarning:!0,inputMode:y,onInput:k,children:t}),a&&l.jsx("div",{className:V,onClick:j,children:a})]})},hr=f.forwardRef(Rl);function fe(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 ve(e,r){return e instanceof Date?new e.constructor(r):new Date(r)}function St(e,r){const t=fe(e);return isNaN(r)?ve(e,NaN):(r&&t.setDate(t.getDate()+r),t)}function tt(e,r){const t=fe(e);if(isNaN(r))return ve(e,NaN);if(!r)return t;const n=t.getDate(),s=ve(e,t.getTime());s.setMonth(t.getMonth()+r+1,0);const o=s.getDate();return n>=o?s:(t.setFullYear(s.getFullYear(),s.getMonth(),n),t)}const Bs=6048e5,an=6e4,cn=36e5,Ll=1e3;let Al={};function Bt(){return Al}function rt(e,r){var a,c,d,h;const t=Bt(),n=(r==null?void 0:r.weekStartsOn)??((c=(a=r==null?void 0:r.locale)==null?void 0:a.options)==null?void 0:c.weekStartsOn)??t.weekStartsOn??((h=(d=t.locale)==null?void 0:d.options)==null?void 0:h.weekStartsOn)??0,s=fe(e),o=s.getDay(),i=(o<n?7:0)+o-n;return s.setDate(s.getDate()-i),s.setHours(0,0,0,0),s}function Et(e){return rt(e,{weekStartsOn:1})}function Fl(e){const r=fe(e),t=r.getFullYear(),n=ve(e,0);n.setFullYear(t+1,0,4),n.setHours(0,0,0,0);const s=Et(n),o=ve(e,0);o.setFullYear(t,0,4),o.setHours(0,0,0,0);const i=Et(o);return r.getTime()>=s.getTime()?t+1:r.getTime()>=i.getTime()?t:t-1}function Us(e){const r=fe(e);return r.setHours(0,0,0,0),r}function zs(e){const r=fe(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 $l(e){const r=Fl(e),t=ve(e,0);return t.setFullYear(r,0,4),t.setHours(0,0,0,0),Et(t)}function Ut(e,r){return tt(e,r*12)}function qs(e,r){const t=Us(e),n=Us(r);return+t==+n}function Hl(e){const r=fe(e),t=r.getMonth();return r.setFullYear(r.getFullYear(),t+1,0),r.setHours(23,59,59,999),r}function Yl(e,r){const t=fe(e.start),n=fe(e.end);let s=+t>+n;const o=s?+t:+n,i=s?n:t;i.setHours(0,0,0,0);let a=(r==null?void 0:r.step)??1;if(!a)return[];a<0&&(a=-a,s=!s);const c=[];for(;+i<=o;)c.push(fe(i)),i.setDate(i.getDate()+a),i.setHours(0,0,0,0);return s?c.reverse():c}function Gs(e){const r=fe(e);return r.setDate(1),r.setHours(0,0,0,0),r}function Wl(e,r){const t=fe(e.start),n=fe(e.end);let s=+t>+n;const o=s?+t:+n,i=s?n:t;i.setHours(0,0,0,0),i.setMonth(0,1);let a=(r==null?void 0:r.step)??1;if(!a)return[];a<0&&(a=-a,s=!s);const c=[];for(;+i<=o;)c.push(fe(i)),i.setFullYear(i.getFullYear()+a);return s?c.reverse():c}const Vl={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"}},Bl=(e,r,t)=>{let n;const s=Vl[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 un(e){return(r={})=>{const t=r.width?String(r.width):e.defaultWidth;return e.formats[t]||e.formats[e.defaultWidth]}}const Ul={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},zl={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},ql={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Gl={date:un({formats:Ul,defaultWidth:"full"}),time:un({formats:zl,defaultWidth:"full"}),dateTime:un({formats:ql,defaultWidth:"full"})},Kl={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Zl=(e,r,t,n)=>Kl[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 i=e.defaultFormattingWidth||e.defaultWidth,a=t!=null&&t.width?String(t.width):i;s=e.formattingValues[a]||e.formattingValues[i]}else{const i=e.defaultWidth,a=t!=null&&t.width?String(t.width):e.defaultWidth;s=e.values[a]||e.values[i]}const o=e.argumentCallback?e.argumentCallback(r):r;return s[o]}}const Ql={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Xl={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Jl={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"]},ef={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"]},tf={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"}},rf={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"}},nf={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:Xl,defaultWidth:"wide",argumentCallback:e=>e-1}),month:zt({values:Jl,defaultWidth:"wide"}),day:zt({values:ef,defaultWidth:"wide"}),dayPeriod:zt({values:tf,defaultWidth:"wide",formattingValues:rf,defaultFormattingWidth:"wide"})};function qt(e){return(r,t={})=>{const n=t.width,s=n&&e.matchPatterns[n]||e.matchPatterns[e.defaultMatchWidth],o=r.match(s);if(!o)return null;const i=o[0],a=n&&e.parsePatterns[n]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(a)?of(a,p=>p.test(i)):sf(a,p=>p.test(i));let d;d=e.valueCallback?e.valueCallback(c):c,d=t.valueCallback?t.valueCallback(d):d;const h=r.slice(i.length);return{value:d,rest:h}}}function sf(e,r){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&r(e[t]))return t}function of(e,r){for(let t=0;t<e.length;t++)if(r(e[t]))return t}function af(e){return(r,t={})=>{const n=r.match(e.matchPattern);if(!n)return null;const s=n[0],o=r.match(e.parsePattern);if(!o)return null;let i=e.valueCallback?e.valueCallback(o[0]):o[0];i=t.valueCallback?t.valueCallback(i):i;const a=r.slice(s.length);return{value:i,rest:a}}}const cf=/^(\d+)(th|st|nd|rd)?/i,uf=/\d+/i,lf={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},ff={any:[/^b/i,/^(a|c)/i]},df={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},hf={any:[/1/i,/2/i,/3/i,/4/i]},pf={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},mf={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]},gf={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},bf={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]},yf={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},vf={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}},xf={ordinalNumber:af({matchPattern:cf,parsePattern:uf,valueCallback:e=>parseInt(e,10)}),era:qt({matchPatterns:lf,defaultMatchWidth:"wide",parsePatterns:ff,defaultParseWidth:"any"}),quarter:qt({matchPatterns:df,defaultMatchWidth:"wide",parsePatterns:hf,defaultParseWidth:"any",valueCallback:e=>e+1}),month:qt({matchPatterns:pf,defaultMatchWidth:"wide",parsePatterns:mf,defaultParseWidth:"any"}),day:qt({matchPatterns:gf,defaultMatchWidth:"wide",parsePatterns:bf,defaultParseWidth:"any"}),dayPeriod:qt({matchPatterns:yf,defaultMatchWidth:"any",parsePatterns:vf,defaultParseWidth:"any"})},wf={code:"en-US",formatDistance:Bl,formatLong:Gl,formatRelative:Zl,localize:nf,match:xf,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Pf(e){const r=fe(e),t=+Et(r)-+$l(r);return Math.round(t/Bs)+1}function Ks(e,r){var h,p,v,y;const t=fe(e),n=t.getFullYear(),s=Bt(),o=(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??((y=(v=s.locale)==null?void 0:v.options)==null?void 0:y.firstWeekContainsDate)??1,i=ve(e,0);i.setFullYear(n+1,0,o),i.setHours(0,0,0,0);const a=rt(i,r),c=ve(e,0);c.setFullYear(n,0,o),c.setHours(0,0,0,0);const d=rt(c,r);return t.getTime()>=a.getTime()?n+1:t.getTime()>=d.getTime()?n:n-1}function Tf(e,r){var a,c,d,h;const t=Bt(),n=(r==null?void 0:r.firstWeekContainsDate)??((c=(a=r==null?void 0:r.locale)==null?void 0:a.options)==null?void 0:c.firstWeekContainsDate)??t.firstWeekContainsDate??((h=(d=t.locale)==null?void 0:d.options)==null?void 0:h.firstWeekContainsDate)??1,s=Ks(e,r),o=ve(e,0);return o.setFullYear(s,0,n),o.setHours(0,0,0,0),rt(o,r)}function Sf(e,r){const t=fe(e),n=+rt(t,r)-+Tf(t,r);return Math.round(n/Bs)+1}const Zs=(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"})}},Qs=(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"})}},Xs={p:Qs,P:(e,r)=>{const t=e.match(/(P+)(p+)?/)||[],n=t[1],s=t[2];if(!s)return Zs(e,r);let o;switch(n){case"P":o=r.dateTime({width:"short"});break;case"PP":o=r.dateTime({width:"medium"});break;case"PPP":o=r.dateTime({width:"long"});break;case"PPPP":default:o=r.dateTime({width:"full"});break}return o.replace("{{date}}",Zs(n,r)).replace("{{time}}",Qs(s,r))}},Ef=/^D+$/,Cf=/^Y+$/,kf=["D","DD","YY","YYYY"];function Df(e){return Ef.test(e)}function Of(e){return Cf.test(e)}function Js(e,r,t){const n=Nf(e,r,t);if(console.warn(n),kf.includes(e))throw new RangeError(n)}function Nf(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 ln(e){return fe(e).getDay()}function eo(e){const r=fe(e),t=r.getFullYear(),n=r.getMonth(),s=ve(e,0);return s.setFullYear(t,n+1,0),s.setHours(0,0,0,0),s.getDate()}function _f(){return Object.assign({},Bt())}function If(e){let t=fe(e).getDay();return t===0&&(t=7),t}function jf(e){const r=fe(e),t=r.getMonth();return r.setFullYear(r.getFullYear(),t+1,0),r.setHours(0,0,0,0),r}function Mf(e,r){const t=fe(e),n=fe(r);return+t<+n}function Rf(e,r){const t=r instanceof Date?ve(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 Lf=10;class to{constructor(){m(this,"subPriority",0)}validate(r,t){return!0}}class Af extends to{constructor(r,t,n,s,o){super(),this.value=r,this.validateValue=t,this.setValue=n,this.priority=s,o&&(this.subPriority=o)}validate(r,t){return this.validateValue(r,this.value,t)}set(r,t,n){return this.setValue(r,t,this.value,n)}}class Ff extends to{constructor(){super(...arguments);m(this,"priority",Lf);m(this,"subPriority",-1)}set(t,n){return n.timestampIsSet?t:ve(t,Rf(t,Date))}}class de{run(r,t,n,s){const o=this.parse(r,t,n,s);return o?{setter:new Af(o.value,this.validate,this.set,this.priority,this.subPriority),rest:o.rest}:null}validate(r,t,n){return!0}}class $f extends de{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 Ce(e,r){return e&&{value:r(e.value),rest:e.rest}}function Pe(e,r){const t=r.match(e);return t?{value:parseInt(t[0],10),rest:r.slice(t[0].length)}:null}function Ue(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,o=t[3]?parseInt(t[3],10):0,i=t[5]?parseInt(t[5],10):0;return{value:n*(s*cn+o*an+i*Ll),rest:r.slice(t[0].length)}}function ro(e){return Pe(Ee.anyDigitsSigned,e)}function Te(e,r){switch(e){case 1:return Pe(Ee.singleDigit,r);case 2:return Pe(Ee.twoDigits,r);case 3:return Pe(Ee.threeDigits,r);case 4:return Pe(Ee.fourDigits,r);default:return Pe(new RegExp("^\\d{1,"+e+"}"),r)}}function pr(e,r){switch(e){case 1:return Pe(Ee.singleDigitSigned,r);case 2:return Pe(Ee.twoDigitsSigned,r);case 3:return Pe(Ee.threeDigitsSigned,r);case 4:return Pe(Ee.fourDigitsSigned,r);default:return Pe(new RegExp("^-?\\d{1,"+e+"}"),r)}}function fn(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 no(e,r){const t=r>0,n=t?r:1-r;let s;if(n<=50)s=e||100;else{const o=n+50,i=Math.trunc(o/100)*100,a=e>=o%100;s=e+i-(a?100:0)}return t?s:1-s}function so(e){return e%400===0||e%4===0&&e%100!==0}class Hf extends de{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 o=i=>({year:i,isTwoDigitYear:n==="yy"});switch(n){case"y":return Ce(Te(4,t),o);case"yo":return Ce(s.ordinalNumber(t,{unit:"year"}),o);default:return Ce(Te(n.length,t),o)}}validate(t,n){return n.isTwoDigitYear||n.year>0}set(t,n,s){const o=t.getFullYear();if(s.isTwoDigitYear){const a=no(s.year,o);return t.setFullYear(a,0,1),t.setHours(0,0,0,0),t}const i=!("era"in n)||n.era===1?s.year:1-s.year;return t.setFullYear(i,0,1),t.setHours(0,0,0,0),t}}class Yf extends de{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 o=i=>({year:i,isTwoDigitYear:n==="YY"});switch(n){case"Y":return Ce(Te(4,t),o);case"Yo":return Ce(s.ordinalNumber(t,{unit:"year"}),o);default:return Ce(Te(n.length,t),o)}}validate(t,n){return n.isTwoDigitYear||n.year>0}set(t,n,s,o){const i=Ks(t,o);if(s.isTwoDigitYear){const c=no(s.year,i);return t.setFullYear(c,0,o.firstWeekContainsDate),t.setHours(0,0,0,0),rt(t,o)}const a=!("era"in n)||n.era===1?s.year:1-s.year;return t.setFullYear(a,0,o.firstWeekContainsDate),t.setHours(0,0,0,0),rt(t,o)}}class Wf extends de{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 pr(n==="R"?4:n.length,t)}set(t,n,s){const o=ve(t,0);return o.setFullYear(s,0,4),o.setHours(0,0,0,0),Et(o)}}class Vf extends de{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 pr(n==="u"?4:n.length,t)}set(t,n,s){return t.setFullYear(s,0,1),t.setHours(0,0,0,0),t}}class Bf extends de{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 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 Uf extends de{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 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 zf extends de{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 o=i=>i-1;switch(n){case"M":return Ce(Pe(Ee.month,t),o);case"MM":return Ce(Te(2,t),o);case"Mo":return Ce(s.ordinalNumber(t,{unit:"month"}),o);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 qf extends de{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 o=i=>i-1;switch(n){case"L":return Ce(Pe(Ee.month,t),o);case"LL":return Ce(Te(2,t),o);case"Lo":return Ce(s.ordinalNumber(t,{unit:"month"}),o);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 Gf(e,r,t){const n=fe(e),s=Sf(n,t)-r;return n.setDate(n.getDate()-s*7),n}class Kf extends de{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 Pe(Ee.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,o){return rt(Gf(t,s,o),o)}}function Zf(e,r){const t=fe(e),n=Pf(t)-r;return t.setDate(t.getDate()-n*7),t}class Qf extends de{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 Pe(Ee.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 Et(Zf(t,s))}}const Xf=[31,28,31,30,31,30,31,31,30,31,30,31],Jf=[31,29,31,30,31,30,31,31,30,31,30,31];class ed extends de{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 Pe(Ee.date,t);case"do":return s.ordinalNumber(t,{unit:"date"});default:return Te(n.length,t)}}validate(t,n){const s=t.getFullYear(),o=so(s),i=t.getMonth();return o?n>=1&&n<=Jf[i]:n>=1&&n<=Xf[i]}set(t,n,s){return t.setDate(s),t.setHours(0,0,0,0),t}}class td extends de{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 Pe(Ee.dayOfYear,t);case"Do":return s.ordinalNumber(t,{unit:"date"});default:return Te(n.length,t)}}validate(t,n){const s=t.getFullYear();return so(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 dn(e,r,t){var p,v,y,x;const n=Bt(),s=(t==null?void 0:t.weekStartsOn)??((v=(p=t==null?void 0:t.locale)==null?void 0:p.options)==null?void 0:v.weekStartsOn)??n.weekStartsOn??((x=(y=n.locale)==null?void 0:y.options)==null?void 0:x.weekStartsOn)??0,o=fe(e),i=o.getDay(),c=(r%7+7)%7,d=7-s,h=r<0||r>6?r-(i+d)%7:(c+d)%7-(i+d)%7;return St(o,h)}class rd extends de{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,o){return t=dn(t,s,o),t.setHours(0,0,0,0),t}}class nd extends de{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,o){const i=a=>{const c=Math.floor((a-1)/7)*7;return(a+o.weekStartsOn+6)%7+c};switch(n){case"e":case"ee":return Ce(Te(n.length,t),i);case"eo":return Ce(s.ordinalNumber(t,{unit:"day"}),i);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,o){return t=dn(t,s,o),t.setHours(0,0,0,0),t}}class sd extends de{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,o){const i=a=>{const c=Math.floor((a-1)/7)*7;return(a+o.weekStartsOn+6)%7+c};switch(n){case"c":case"cc":return Ce(Te(n.length,t),i);case"co":return Ce(s.ordinalNumber(t,{unit:"day"}),i);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,o){return t=dn(t,s,o),t.setHours(0,0,0,0),t}}function od(e,r){const t=fe(e),n=If(t),s=r-n;return St(t,s)}class id extends de{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 o=i=>i===0?7:i;switch(n){case"i":case"ii":return Te(n.length,t);case"io":return s.ordinalNumber(t,{unit:"day"});case"iii":return Ce(s.day(t,{width:"abbreviated",context:"formatting"})||s.day(t,{width:"short",context:"formatting"})||s.day(t,{width:"narrow",context:"formatting"}),o);case"iiiii":return Ce(s.day(t,{width:"narrow",context:"formatting"}),o);case"iiiiii":return Ce(s.day(t,{width:"short",context:"formatting"})||s.day(t,{width:"narrow",context:"formatting"}),o);case"iiii":default:return Ce(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"}),o)}}validate(t,n){return n>=1&&n<=7}set(t,n,s){return t=od(t,s),t.setHours(0,0,0,0),t}}class ad extends de{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(fn(s),0,0,0),t}}class cd extends de{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(fn(s),0,0,0),t}}class ud extends de{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(fn(s),0,0,0),t}}class ld extends de{constructor(){super(...arguments);m(this,"priority",70);m(this,"incompatibleTokens",["H","K","k","t","T"])}parse(t,n,s){switch(n){case"h":return Pe(Ee.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 o=t.getHours()>=12;return o&&s<12?t.setHours(s+12,0,0,0):!o&&s===12?t.setHours(0,0,0,0):t.setHours(s,0,0,0),t}}class fd extends de{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 Pe(Ee.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 dd extends de{constructor(){super(...arguments);m(this,"priority",70);m(this,"incompatibleTokens",["h","H","k","t","T"])}parse(t,n,s){switch(n){case"K":return Pe(Ee.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 hd extends de{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 Pe(Ee.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 o=s<=24?s%24:s;return t.setHours(o,0,0,0),t}}class pd extends de{constructor(){super(...arguments);m(this,"priority",60);m(this,"incompatibleTokens",["t","T"])}parse(t,n,s){switch(n){case"m":return Pe(Ee.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 md extends de{constructor(){super(...arguments);m(this,"priority",50);m(this,"incompatibleTokens",["t","T"])}parse(t,n,s){switch(n){case"s":return Pe(Ee.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 gd extends de{constructor(){super(...arguments);m(this,"priority",30);m(this,"incompatibleTokens",["t","T"])}parse(t,n){const s=o=>Math.trunc(o*Math.pow(10,-n.length+3));return Ce(Te(n.length,t),s)}set(t,n,s){return t.setMilliseconds(s),t}}class bd extends de{constructor(){super(...arguments);m(this,"priority",10);m(this,"incompatibleTokens",["t","T","x"])}parse(t,n){switch(n){case"X":return Ue(Be.basicOptionalMinutes,t);case"XX":return Ue(Be.basic,t);case"XXXX":return Ue(Be.basicOptionalSeconds,t);case"XXXXX":return Ue(Be.extendedOptionalSeconds,t);case"XXX":default:return Ue(Be.extended,t)}}set(t,n,s){return n.timestampIsSet?t:ve(t,t.getTime()-zs(t)-s)}}class yd extends de{constructor(){super(...arguments);m(this,"priority",10);m(this,"incompatibleTokens",["t","T","X"])}parse(t,n){switch(n){case"x":return Ue(Be.basicOptionalMinutes,t);case"xx":return Ue(Be.basic,t);case"xxxx":return Ue(Be.basicOptionalSeconds,t);case"xxxxx":return Ue(Be.extendedOptionalSeconds,t);case"xxx":default:return Ue(Be.extended,t)}}set(t,n,s){return n.timestampIsSet?t:ve(t,t.getTime()-zs(t)-s)}}class vd extends de{constructor(){super(...arguments);m(this,"priority",40);m(this,"incompatibleTokens","*")}parse(t){return ro(t)}set(t,n,s){return[ve(t,s*1e3),{timestampIsSet:!0}]}}class xd extends de{constructor(){super(...arguments);m(this,"priority",20);m(this,"incompatibleTokens","*")}parse(t){return ro(t)}set(t,n,s){return[ve(t,s),{timestampIsSet:!0}]}}const wd={G:new $f,y:new Hf,Y:new Yf,R:new Wf,u:new Vf,Q:new Bf,q:new Uf,M:new zf,L:new qf,w:new Kf,I:new Qf,d:new ed,D:new td,E:new rd,e:new nd,c:new sd,i:new id,a:new ad,b:new cd,B:new ud,h:new ld,H:new fd,K:new dd,k:new hd,m:new pd,s:new md,S:new gd,X:new bd,x:new yd,t:new vd,T:new xd},Pd=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Td=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Sd=/^'([^]*?)'?$/,Ed=/''/g,Cd=/\S/,kd=/[a-zA-Z]/;function ze(e,r,t,n){var D,O,P,R,z,$,g,L;const s=_f(),o=(n==null?void 0:n.locale)??s.locale??wf,i=(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=(P=s.locale)==null?void 0:P.options)==null?void 0:R.firstWeekContainsDate)??1,a=(n==null?void 0:n.weekStartsOn)??(($=(z=n==null?void 0:n.locale)==null?void 0:z.options)==null?void 0:$.weekStartsOn)??s.weekStartsOn??((L=(g=s.locale)==null?void 0:g.options)==null?void 0:L.weekStartsOn)??0;if(r==="")return e===""?fe(t):ve(t,NaN);const c={firstWeekContainsDate:i,weekStartsOn:a,locale:o},d=[new Ff],h=r.match(Td).map(C=>{const U=C[0];if(U in Xs){const B=Xs[U];return B(C,o.formatLong)}return C}).join("").match(Pd),p=[];for(let C of h){!(n!=null&&n.useAdditionalWeekYearTokens)&&Of(C)&&Js(C,r,e),!(n!=null&&n.useAdditionalDayOfYearTokens)&&Df(C)&&Js(C,r,e);const U=C[0],B=wd[U];if(B){const{incompatibleTokens:se}=B;if(Array.isArray(se)){const ee=p.find(I=>se.includes(I.token)||I.token===U);if(ee)throw new RangeError(`The format string mustn't contain \`${ee.fullToken}\` and \`${C}\` at the same time`)}else if(B.incompatibleTokens==="*"&&p.length>0)throw new RangeError(`The format string mustn't contain \`${C}\` and any other token at the same time`);p.push({token:U,fullToken:C});const re=B.run(e,C,o.match,c);if(!re)return ve(t,NaN);d.push(re.setter),e=re.rest}else{if(U.match(kd))throw new RangeError("Format string contains an unescaped latin alphabet character `"+U+"`");if(C==="''"?C="'":U==="'"&&(C=Dd(C)),e.indexOf(C)===0)e=e.slice(C.length);else return ve(t,NaN)}}if(e.length>0&&Cd.test(e))return ve(t,NaN);const v=d.map(C=>C.priority).sort((C,U)=>U-C).filter((C,U,B)=>B.indexOf(C)===U).map(C=>d.filter(U=>U.priority===C).sort((U,B)=>B.subPriority-U.subPriority)).map(C=>C[0]);let y=fe(t);if(isNaN(y.getTime()))return ve(t,NaN);const x={};for(const C of v){if(!C.validate(y,c))return ve(t,NaN);const U=C.set(y,x,c);Array.isArray(U)?(y=U[0],Object.assign(x,U[1])):y=U}return ve(t,y)}function Dd(e){return e.match(Sd)[1].replace(Ed,"'")}function Od(e){return qs(e,Date.now())}function Nd(e,r){return St(e,-r)}function _d(e,r){let t=r-ln(e);return t<=0&&(t+=7),St(e,t)}function Id(e,r){const t=(r==null?void 0:r.additionalDigits)??2,n=Ld(e);let s;if(n.date){const c=Ad(n.date,t);s=Fd(c.restDateString,c.year)}if(!s||isNaN(s.getTime()))return new Date(NaN);const o=s.getTime();let i=0,a;if(n.time&&(i=$d(n.time),isNaN(i)))return new Date(NaN);if(n.timezone){if(a=Hd(n.timezone),isNaN(a))return new Date(NaN)}else{const c=new Date(o+i),d=new Date(0);return d.setFullYear(c.getUTCFullYear(),c.getUTCMonth(),c.getUTCDate()),d.setHours(c.getUTCHours(),c.getUTCMinutes(),c.getUTCSeconds(),c.getUTCMilliseconds()),d}return new Date(o+i+a)}const mr={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},jd=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,Md=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,Rd=/^([+-])(\d{2})(?::?(\d{2}))?$/;function Ld(e){const r={},t=e.split(mr.dateTimeDelimiter);let n;if(t.length>2)return r;if(/:/.test(t[0])?n=t[0]:(r.date=t[0],n=t[1],mr.timeZoneDelimiter.test(r.date)&&(r.date=e.split(mr.timeZoneDelimiter)[0],n=e.substr(r.date.length,e.length))),n){const s=mr.timezone.exec(n);s?(r.time=n.replace(s[1],""),r.timezone=s[1]):r.time=n}return r}function Ad(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,o=n[2]?parseInt(n[2]):null;return{year:o===null?s:o*100,restDateString:e.slice((n[1]||n[2]).length)}}function Fd(e,r){if(r===null)return new Date(NaN);const t=e.match(jd);if(!t)return new Date(NaN);const n=!!t[4],s=Gt(t[1]),o=Gt(t[2])-1,i=Gt(t[3]),a=Gt(t[4]),c=Gt(t[5])-1;if(n)return Ud(r,a,c)?Yd(r,a,c):new Date(NaN);{const d=new Date(0);return!Vd(r,o,i)||!Bd(r,s)?new Date(NaN):(d.setUTCFullYear(r,o,Math.max(s,i)),d)}}function Gt(e){return e?parseInt(e):1}function $d(e){const r=e.match(Md);if(!r)return NaN;const t=hn(r[1]),n=hn(r[2]),s=hn(r[3]);return zd(t,n,s)?t*cn+n*an+s*1e3:NaN}function hn(e){return e&&parseFloat(e.replace(",","."))||0}function Hd(e){if(e==="Z")return 0;const r=e.match(Rd);if(!r)return 0;const t=r[1]==="+"?-1:1,n=parseInt(r[2]),s=r[3]&&parseInt(r[3])||0;return qd(n,s)?t*(n*cn+s*an):NaN}function Yd(e,r,t){const n=new Date(0);n.setUTCFullYear(e,0,4);const s=n.getUTCDay()||7,o=(r-1)*7+t+1-s;return n.setUTCDate(n.getUTCDate()+o),n}const Wd=[31,null,31,30,31,30,31,31,30,31,30,31];function oo(e){return e%400===0||e%4===0&&e%100!==0}function Vd(e,r,t){return r>=0&&r<=11&&t>=1&&t<=(Wd[r]||(oo(e)?29:28))}function Bd(e,r){return r>=1&&r<=(oo(e)?366:365)}function Ud(e,r,t){return r>=1&&r<=53&&t>=0&&t<=6}function zd(e,r,t){return e===24?r===0&&t===0:t>=0&&t<60&&r>=0&&r<60&&e>=0&&e<25}function qd(e,r){return r>=0&&r<=59}function Gd(e,r){const t=fe(e),n=t.getFullYear(),s=t.getDate(),o=ve(e,0);o.setFullYear(n,r,15),o.setHours(0,0,0,0);const i=eo(o);return t.setMonth(r,Math.min(s,i)),t}function Kd(e,r){const t=fe(e);return isNaN(+t)?ve(e,NaN):(t.setFullYear(r),t)}function pn(e,r){return tt(e,-r)}function mn(e,r){return Ut(e,-r)}var je=(e=>(e[e.Regular=24]="Regular",e[e.Small=20]="Small",e))(je||{});const io=({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"})}),Zd=({className:e})=>{const r=le("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=le("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"})})},Xd=({className:e})=>{const r=le("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"})})},Jd=({className:e})=>{const r=le("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"})})},eh=({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"})}),Fe=({icon:e,size:r=je.Regular,onClick:t,className:n})=>{const s=f.useRef({calendar:io,chevronDown:Zd,chevronLeft:Qd,chevronRight:Xd,chevronUp:Jd,close:eh}),o=f.useMemo(()=>s.current[e]||io,[e]),i=le({"bsc-h-[24px] bsc-w-[24px]":r===je.Regular,"bsc-h-[20px] bsc-w-[20px]":r===je.Small},n);return l.jsx("div",{onClick:t,children:l.jsx(o,{className:i})})},lt=({template:e,props:r,children:t})=>e(r,t);function th(e,r){if(r===e)return!1;const t=Object.values(r),n=Object.values(e);if(t.length!==n.length||t.some((o,i)=>o!==n[i]))return!0;const s=Object.keys(e);return Object.keys(r).some((o,i)=>o!==s[i])}function rh(e,r){return e.matches[r]=!1,e.mediaQueries[r]={},e}function ao(e){const r=Object.keys(e);return typeof window>"u"?r.reduce(rh,{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 nh(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 ao(r.queries)}}function sh(e){const r=Rt.useRef(e),[t,n]=Rt.useReducer(nh,e,ao);Rt.useEffect(()=>{th(e,r.current)&&(n({type:"setQueries",queries:e}),r.current=e)},[e]);function s(){return n({type:"updateMatches"})}function o(c){const d=s;return typeof c.addListener<"u"?c.addListener(d):c.addEventListener("change",d),d}Rt.useEffect(()=>{const c=Object.values(t.mediaQueries),d=c.map(o);function h(p,v){typeof p.addListener<"u"?p.removeListener(d[v]):p.removeEventListener("change",d[v])}return()=>{c.forEach(h)}},[t.mediaQueries]);const{matches:i}=t,a=Rt.useMemo(()=>Object.values(i),[i]);return{matches:i,matchesAny:a.some(Boolean),matchesAll:a.length>0&&a.every(Boolean)}}function gr(e){return sh(oh(e)).matchesAll}const gn={};function oh(e){return gn[e]===void 0&&(gn[e]={default:e}),gn[e]}const bn=({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:o,desktopMarkup:i})=>{const a=gr(e),c=gr(r),d=gr(t);return(()=>a&&n?n:!a&&s?s:c&&o?o:d&&i?i:(console.error("Invalid media settings"),null))()};function co(e,r,t){const n=o=>{const i=o.target,a=e.style.display!=="hidden";e&&a&&!si(e,i)&&!s(t,i)&&r(!1),r(!0)},s=(o,i)=>{if(!o)return!1;for(let a=0,c=o.length;a<c;a++)if(o[a].isSameNode(i)||o[a].contains(i))return!0;return!1};return document.addEventListener("mousedown",n),n}function uo(e){document.removeEventListener("mousedown",e)}function ih(e,r){if(e==null)return{};var t={},n=Object.keys(e),s,o;for(o=0;o<n.length;o++)s=n[o],!(r.indexOf(s)>=0)&&(t[s]=e[s]);return t}function yn(e,r){return yn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,s){return n.__proto__=s,n},yn(e,r)}function ah(e,r){e.prototype=Object.create(r.prototype),e.prototype.constructor=e,yn(e,r)}var vn={exports:{}},br={exports:{}},pe={};/** @license React v16.13.1
|
|
37
37
|
* react-is.production.min.js
|
|
38
38
|
*
|
|
39
39
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
@@ -52,4 +52,4 @@ object-assign
|
|
|
52
52
|
(c) Sindre Sorhus
|
|
53
53
|
@license MIT
|
|
54
54
|
*/var xn,mo;function lh(){if(mo)return xn;mo=1;var e=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,t=Object.prototype.propertyIsEnumerable;function n(o){if(o==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(o)}function s(){try{if(!Object.assign)return!1;var o=new String("abc");if(o[5]="de",Object.getOwnPropertyNames(o)[0]==="5")return!1;for(var i={},a=0;a<10;a++)i["_"+String.fromCharCode(a)]=a;var c=Object.getOwnPropertyNames(i).map(function(h){return i[h]});if(c.join("")!=="0123456789")return!1;var d={};return"abcdefghijklmnopqrst".split("").forEach(function(h){d[h]=h}),Object.keys(Object.assign({},d)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return xn=s()?Object.assign:function(o,i){for(var a,c=n(o),d,h=1;h<arguments.length;h++){a=Object(arguments[h]);for(var p in a)r.call(a,p)&&(c[p]=a[p]);if(e){d=e(a);for(var v=0;v<d.length;v++)t.call(a,d[v])&&(c[d[v]]=a[d[v]])}}return c},xn}var wn,go;function Pn(){if(go)return wn;go=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return wn=e,wn}var Tn,bo;function yo(){return bo||(bo=1,Tn=Function.call.bind(Object.prototype.hasOwnProperty)),Tn}var Sn,vo;function fh(){if(vo)return Sn;vo=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var r=Pn(),t={},n=yo();e=function(o){var i="Warning: "+o;typeof console<"u"&&console.error(i);try{throw new Error(i)}catch{}}}function s(o,i,a,c,d){if(process.env.NODE_ENV!=="production"){for(var h in o)if(n(o,h)){var p;try{if(typeof o[h]!="function"){var v=Error((c||"React class")+": "+a+" type `"+h+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof o[h]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw v.name="Invariant Violation",v}p=o[h](i,h,c,a,null,r)}catch(x){p=x}if(p&&!(p instanceof Error)&&e((c||"React class")+": type specification of "+a+" `"+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 y=d?d():"";e("Failed "+a+" type: "+p.message+(y??""))}}}}return s.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(t={})},Sn=s,Sn}var En,xo;function dh(){if(xo)return En;xo=1;var e=po(),r=lh(),t=Pn(),n=yo(),s=fh(),o=function(){};process.env.NODE_ENV!=="production"&&(o=function(a){var c="Warning: "+a;typeof console<"u"&&console.error(c);try{throw new Error(c)}catch{}});function i(){return null}return En=function(a,c){var d=typeof Symbol=="function"&&Symbol.iterator,h="@@iterator";function p(b){var T=b&&(d&&b[d]||b[h]);if(typeof T=="function")return T}var v="<<anonymous>>",y={array:P("array"),bigint:P("bigint"),bool:P("boolean"),func:P("function"),number:P("number"),object:P("object"),string:P("string"),symbol:P("symbol"),any:R(),arrayOf:z,element:$(),elementType:g(),instanceOf:L,node:se(),objectOf:U,oneOf:C,oneOfType:B,shape:ee,exact:I};function x(b,T){return b===T?b!==0||1/b===1/T:b!==b&&T!==T}function D(b,T){this.message=b,this.data=T&&typeof T=="object"?T:{},this.stack=""}D.prototype=Error.prototype;function O(b){if(process.env.NODE_ENV!=="production")var T={},V=0;function S(K,A,Y,q,Q,E,te){if(q=q||v,E=E||Y,te!==t){if(c){var _=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 _.name="Invariant Violation",_}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var _e=q+":"+Y;!T[_e]&&V<3&&(o("You are manually calling a React.PropTypes validation function for the `"+E+"` prop on `"+q+"`. 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."),T[_e]=!0,V++)}}return A[Y]==null?K?A[Y]===null?new D("The "+Q+" `"+E+"` is marked as required "+("in `"+q+"`, but its value is `null`.")):new D("The "+Q+" `"+E+"` is marked as required in "+("`"+q+"`, but its value is `undefined`.")):null:b(A,Y,q,Q,E)}var H=S.bind(null,!1);return H.isRequired=S.bind(null,!0),H}function P(b){function T(V,S,H,K,A,Y){var q=V[S],Q=k(q);if(Q!==b){var E=G(q);return new D("Invalid "+K+" `"+A+"` of type "+("`"+E+"` supplied to `"+H+"`, expected ")+("`"+b+"`."),{expectedType:b})}return null}return O(T)}function R(){return O(i)}function z(b){function T(V,S,H,K,A){if(typeof b!="function")return new D("Property `"+A+"` of component `"+H+"` has invalid PropType notation inside arrayOf.");var Y=V[S];if(!Array.isArray(Y)){var q=k(Y);return new D("Invalid "+K+" `"+A+"` of type "+("`"+q+"` supplied to `"+H+"`, expected an array."))}for(var Q=0;Q<Y.length;Q++){var E=b(Y,Q,H,K,A+"["+Q+"]",t);if(E instanceof Error)return E}return null}return O(T)}function $(){function b(T,V,S,H,K){var A=T[V];if(!a(A)){var Y=k(A);return new D("Invalid "+H+" `"+K+"` of type "+("`"+Y+"` supplied to `"+S+"`, expected a single ReactElement."))}return null}return O(b)}function g(){function b(T,V,S,H,K){var A=T[V];if(!e.isValidElementType(A)){var Y=k(A);return new D("Invalid "+H+" `"+K+"` of type "+("`"+Y+"` supplied to `"+S+"`, expected a single ReactElement type."))}return null}return O(b)}function L(b){function T(V,S,H,K,A){if(!(V[S]instanceof b)){var Y=b.name||v,q=W(V[S]);return new D("Invalid "+K+" `"+A+"` of type "+("`"+q+"` supplied to `"+H+"`, expected ")+("instance of `"+Y+"`."))}return null}return O(T)}function C(b){if(!Array.isArray(b))return process.env.NODE_ENV!=="production"&&(arguments.length>1?o("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):o("Invalid argument supplied to oneOf, expected an array.")),i;function T(V,S,H,K,A){for(var Y=V[S],q=0;q<b.length;q++)if(x(Y,b[q]))return null;var Q=JSON.stringify(b,function(te,_){var _e=G(_);return _e==="symbol"?String(_):_});return new D("Invalid "+K+" `"+A+"` of value `"+String(Y)+"` "+("supplied to `"+H+"`, expected one of "+Q+"."))}return O(T)}function U(b){function T(V,S,H,K,A){if(typeof b!="function")return new D("Property `"+A+"` of component `"+H+"` has invalid PropType notation inside objectOf.");var Y=V[S],q=k(Y);if(q!=="object")return new D("Invalid "+K+" `"+A+"` of type "+("`"+q+"` supplied to `"+H+"`, expected an object."));for(var Q in Y)if(n(Y,Q)){var E=b(Y,Q,H,K,A+"."+Q,t);if(E instanceof Error)return E}return null}return O(T)}function B(b){if(!Array.isArray(b))return process.env.NODE_ENV!=="production"&&o("Invalid argument supplied to oneOfType, expected an instance of array."),i;for(var T=0;T<b.length;T++){var V=b[T];if(typeof V!="function")return o("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+N(V)+" at index "+T+"."),i}function S(H,K,A,Y,q){for(var Q=[],E=0;E<b.length;E++){var te=b[E],_=te(H,K,A,Y,q,t);if(_==null)return null;_.data&&n(_.data,"expectedType")&&Q.push(_.data.expectedType)}var _e=Q.length>0?", expected one of type ["+Q.join(", ")+"]":"";return new D("Invalid "+Y+" `"+q+"` supplied to "+("`"+A+"`"+_e+"."))}return O(S)}function se(){function b(T,V,S,H,K){return F(T[V])?null:new D("Invalid "+H+" `"+K+"` supplied to "+("`"+S+"`, expected a ReactNode."))}return O(b)}function re(b,T,V,S,H){return new D((b||"React class")+": "+T+" type `"+V+"."+S+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+H+"`.")}function ee(b){function T(V,S,H,K,A){var Y=V[S],q=k(Y);if(q!=="object")return new D("Invalid "+K+" `"+A+"` of type `"+q+"` "+("supplied to `"+H+"`, expected `object`."));for(var Q in b){var E=b[Q];if(typeof E!="function")return re(H,K,A,Q,G(E));var te=E(Y,Q,H,K,A+"."+Q,t);if(te)return te}return null}return O(T)}function I(b){function T(V,S,H,K,A){var Y=V[S],q=k(Y);if(q!=="object")return new D("Invalid "+K+" `"+A+"` of type `"+q+"` "+("supplied to `"+H+"`, expected `object`."));var Q=r({},V[S],b);for(var E in Q){var te=b[E];if(n(b,E)&&typeof te!="function")return re(H,K,A,E,G(te));if(!te)return new D("Invalid "+K+" `"+A+"` key `"+E+"` supplied to `"+H+"`.\nBad object: "+JSON.stringify(V[S],null," ")+`
|
|
55
|
-
Valid keys: `+JSON.stringify(Object.keys(b),null," "));var _=te(Y,E,H,K,A+"."+E,t);if(_)return _}return null}return O(T)}function F(b){switch(typeof b){case"number":case"string":case"undefined":return!0;case"boolean":return!b;case"object":if(Array.isArray(b))return b.every(F);if(b===null||a(b))return!0;var T=p(b);if(T){var V=T.call(b),S;if(T!==b.entries){for(;!(S=V.next()).done;)if(!F(S.value))return!1}else for(;!(S=V.next()).done;){var H=S.value;if(H&&!F(H[1]))return!1}}else return!1;return!0;default:return!1}}function j(b,T){return b==="symbol"?!0:T?T["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&T instanceof Symbol:!1}function k(b){var T=typeof b;return Array.isArray(b)?"array":b instanceof RegExp?"object":j(T,b)?"symbol":T}function G(b){if(typeof b>"u"||b===null)return""+b;var T=k(b);if(T==="object"){if(b instanceof Date)return"date";if(b instanceof RegExp)return"regexp"}return T}function N(b){var T=G(b);switch(T){case"array":case"object":return"an "+T;case"boolean":case"date":case"regexp":return"a "+T;default:return T}}function W(b){return!b.constructor||!b.constructor.name?v:b.constructor.name}return y.checkPropTypes=s,y.resetWarningCache=s.resetWarningCache,y.PropTypes=y,y},En}var Cn,wo;function hh(){if(wo)return Cn;wo=1;var e=Pn();function r(){}function t(){}return t.resetWarningCache=r,Cn=function(){function n(i,a,c,d,h,p){if(p!==e){var v=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 v.name="Invariant Violation",v}}n.isRequired=n;function s(){return n}var o={array:n,bigint:n,bool:n,func:n,number:n,object:n,string:n,symbol:n,any:n,arrayOf:s,element:n,elementType:n,instanceOf:s,node:n,objectOf:s,oneOf:s,oneOfType:s,shape:s,exact:s,checkPropTypes:t,resetWarningCache:r};return o.PropTypes=o,o},Cn}if(process.env.NODE_ENV!=="production"){var ph=po(),mh=!0;vn.exports=dh()(ph.isElement,mh)}else vn.exports=hh()();var gh=vn.exports;const ne=Hr(gh),Po={disabled:!1};var bh=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 To=f.createContext(null);var yh=function(r){return r.scrollTop},Gt="unmounted",ft="exited",dt="entering",Ct="entered",kn="exiting",Je=function(e){ah(r,e);function r(n,s){var o;o=e.call(this,n,s)||this;var i=s,a=i&&!i.isMounting?n.enter:n.appear,c;return o.appearStatus=null,n.in?a?(c=ft,o.appearStatus=dt):c=Ct:n.unmountOnExit||n.mountOnEnter?c=Gt:c=ft,o.state={status:c},o.nextCallback=null,o}r.getDerivedStateFromProps=function(s,o){var i=s.in;return i&&o.status===Gt?{status:ft}:null};var t=r.prototype;return t.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},t.componentDidUpdate=function(s){var o=null;if(s!==this.props){var i=this.state.status;this.props.in?i!==dt&&i!==Ct&&(o=dt):(i===dt||i===Ct)&&(o=kn)}this.updateStatus(!1,o)},t.componentWillUnmount=function(){this.cancelNextCallback()},t.getTimeouts=function(){var s=this.props.timeout,o,i,a;return o=i=a=s,s!=null&&typeof s!="number"&&(o=s.exit,i=s.enter,a=s.appear!==void 0?s.appear:i),{exit:o,enter:i,appear:a}},t.updateStatus=function(s,o){if(s===void 0&&(s=!1),o!==null)if(this.cancelNextCallback(),o===dt){if(this.props.unmountOnExit||this.props.mountOnEnter){var i=this.props.nodeRef?this.props.nodeRef.current:He.findDOMNode(this);i&&yh(i)}this.performEnter(s)}else this.performExit();else this.props.unmountOnExit&&this.state.status===ft&&this.setState({status:Gt})},t.performEnter=function(s){var o=this,i=this.props.enter,a=this.context?this.context.isMounting:s,c=this.props.nodeRef?[a]:[He.findDOMNode(this),a],d=c[0],h=c[1],p=this.getTimeouts(),v=a?p.appear:p.enter;if(!s&&!i||Po.disabled){this.safeSetState({status:Ct},function(){o.props.onEntered(d)});return}this.props.onEnter(d,h),this.safeSetState({status:dt},function(){o.props.onEntering(d,h),o.onTransitionEnd(v,function(){o.safeSetState({status:Ct},function(){o.props.onEntered(d,h)})})})},t.performExit=function(){var s=this,o=this.props.exit,i=this.getTimeouts(),a=this.props.nodeRef?void 0:He.findDOMNode(this);if(!o||Po.disabled){this.safeSetState({status:ft},function(){s.props.onExited(a)});return}this.props.onExit(a),this.safeSetState({status:kn},function(){s.props.onExiting(a),s.onTransitionEnd(i.exit,function(){s.safeSetState({status:ft},function(){s.props.onExited(a)})})})},t.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},t.safeSetState=function(s,o){o=this.setNextCallback(o),this.setState(s,o)},t.setNextCallback=function(s){var o=this,i=!0;return this.nextCallback=function(a){i&&(i=!1,o.nextCallback=null,s(a))},this.nextCallback.cancel=function(){i=!1},this.nextCallback},t.onTransitionEnd=function(s,o){this.setNextCallback(o);var i=this.props.nodeRef?this.props.nodeRef.current:He.findDOMNode(this),a=s==null&&!this.props.addEndListener;if(!i||a){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var c=this.props.nodeRef?[this.nextCallback]:[i,this.nextCallback],d=c[0],h=c[1];this.props.addEndListener(d,h)}s!=null&&setTimeout(this.nextCallback,s)},t.render=function(){var s=this.state.status;if(s===Gt)return null;var o=this.props,i=o.children;o.in,o.mountOnEnter,o.unmountOnExit,o.appear,o.enter,o.exit,o.timeout,o.addEndListener,o.onEnter,o.onEntering,o.onEntered,o.onExit,o.onExiting,o.onExited,o.nodeRef;var a=ih(o,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return f.createElement(To.Provider,{value:null},typeof i=="function"?i(s,a):f.cloneElement(f.Children.only(i),a))},r}(f.Component);Je.contextType=To,Je.propTypes=process.env.NODE_ENV!=="production"?{nodeRef:ne.shape({current:typeof Element>"u"?ne.any:function(e,r,t,n,s,o){var i=e[r];return ne.instanceOf(i&&"ownerDocument"in i?i.ownerDocument.defaultView.Element:Element)(e,r,t,n,s,o)}}),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=bh;r.addEndListener||(t=t.isRequired);for(var n=arguments.length,s=new Array(n>1?n-1:0),o=1;o<n;o++)s[o-1]=arguments[o];return 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 kt(){}Je.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:kt,onEntering:kt,onEntered:kt,onExit:kt,onExiting:kt,onExited:kt},Je.UNMOUNTED=Gt,Je.EXITED=ft,Je.ENTERING=dt,Je.ENTERED=Ct,Je.EXITING=kn;const vh=Je,So=({start:e,timeout:r=400,defaultStyle:t,transitionStyles:n,showTransitionOptions:s="cubic-bezier(0, 0, 0.2, 1)",hideTransitionOptions:o="linear",unmountOnExit:i=!1,onEntering:a,onEntered:c,onExit:d,onExited:h,children:p})=>{const v=t||{transition:`opacity ${r}ms ${s}`,opacity:0},y=n||{entering:{opacity:1},entered:{opacity:1},exiting:{transition:`opacity ${r}ms ${o}`,opacity:0},exited:{transition:`opacity ${r}ms ${o}`,opacity:0},unmounted:{}};return l.jsx(vh,{in:e,timeout:r,onEntering:a,onEntered:c,onExit:d,onExited:h,unmountOnExit:i,children:x=>p({state:x,defaultStyle:v,transitionStyles:y})})};function Eo(e){return e.target?e.target:e}const Co=({visible:e,target:r,appendTo:t=document.body,unmountWhenHidden:n=!1,transitionDuration:s=400,showTransitionOptions:o="cubic-bezier(0, 0, 0.2, 1)",hideTransitionOptions:i="linear",approveText:a="DONE",shown:c,hidden:d,isClickedWithin:h,children:p})=>{const[v,y]=f.useState(-1),[x,D]=f.useState(-1),[O,P]=f.useState(e),R=f.useRef(100),z=f.useRef(101),$=f.useRef(),g=f.useRef(),L=f.useRef();f.useEffect(()=>{r&&($.current=Eo(r));const I=Kn("zIndex",F=>F==="auto"||F==="-1"?!1:parseInt(F)>100).map(F=>parseInt(F,10));I.length>0&&(R.current=Math.max(...I)+1,z.current=Math.max(...I)+2),P(e)},[e,r]);const C=I=>{g.current=I},U=()=>{D(R.current),y(z.current)},B=()=>{if(!g.current)return;c==null||c();let I;$.current&&(I=[$.current]);const F=j=>{j?h==null||h():P(!1)};L.current=co(g.current,F,I)},se=()=>{L.current&&uo(L.current)},re=()=>{D(-1),y(-1),d==null||d()},ee={entering:{opacity:.5},entered:{opacity:.5}};return He.createPortal(l.jsx(So,{start:O,timeout:s,showTransitionOptions:o,hideTransitionOptions:i,onEntering:U,onEntered:B,onExit:se,onExited:re,unmountOnExit:n,children:({state:I,defaultStyle:F,transitionStyles:j})=>l.jsxs("div",{ref:k=>k&&C(k),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:x,...j[I],...ee[I]}}),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:v,...F,...j[I]},children:[l.jsx("div",{className:"bsc-w-full",children:p}),l.jsx(l.Fragment,{children:l.jsx(Ve,{buttonType:"primary",fullWidth:!0,onClick:()=>P(!1),className:"bsc-text-xs bsc-font-bold",children:a})})]})]})}),t)};var ko=(e=>(e[e.TopLeft=0]="TopLeft",e[e.TopRight=1]="TopRight",e[e.BottomLeft=2]="BottomLeft",e[e.BottomRight=3]="BottomRight",e))(ko||{}),Do=(e=>(e[e.TopLeft=0]="TopLeft",e[e.TopRight=1]="TopRight",e[e.BottomLeft=2]="BottomLeft",e[e.BottomRight=3]="BottomRight",e))(Do||{});class we{static positionToTarget(r,t=2){const n=r.getBoundingClientRect();let s=0,o=0;const i=window.scrollY;switch(t){case 2:s=n.top+n.height+i,o=n.left;break;case 0:s=n.top+i,o=n.left;break;case 3:s=n.top+n.height+i,o=n.left+n.width;break;case 1:s=n.top+i,o=n.left+n.width}return{top:s,left:o}}static positionElementToTarget(r,t,n=0,s=2){let{left:o,top:i}=we.positionToTarget(t,s);const a=r.getBoundingClientRect();switch(n){case 0:break;case 1:o=o-a.width;break;case 2:i=i-a.height;break;case 3:i=i-a.height,o=o-a.width;break}return{top:i,left:o}}static canPositionElementOnScreenWithTarget(r,t){const n=we.getScreenDimensions(),s=r.getBoundingClientRect(),o=we.positionElementToTarget(r,t,0,2);if(o.left+s.width<n.width&&o.top+s.height<n.height||we.positionElementToTarget(r,t,1,3).left>=0&&o.top+s.height<n.height)return!0;const a=we.positionElementToTarget(r,t,2,0);if(a.left+s.width<n.width&&a.top>=0)return!0;const c=we.positionElementToTarget(r,t,3,1);return c.left>=0&&c.top>=0}static canPositionElementOnScreen(r){const t=we.getScreenDimensions(),n=r.getBoundingClientRect();return n.width<=t.width&&n.height<=t.height}static positionElementToTargetOnScreen(r,t,n=0,s=2){const{left:o,top:i}=we.positionElementToTarget(r,t,n,s),a=r.getBoundingClientRect(),c=we.determineOffScreenLocation(a);if(c){if(n===0&&s===2){if(c.right&&!c.bottom)return we.positionElementToTarget(r,t,1,3);if(c.bottom&&!c.right)return we.positionElementToTarget(r,t,2,0);if(c.right&&c.bottom)return we.positionElementToTarget(r,t,3,1)}else if(n===1&&s===3){if(c.left&&!c.bottom)return we.positionElementToTarget(r,t,0,2);if(c.bottom&&!c.left)return we.positionElementToTarget(r,t,3,1);if(c.left&&c.bottom)return we.positionElementToTarget(r,t,2,0)}}return{top:i,left:o}}static determineOffScreenLocation(r){const t=we.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 Oo=({visible:e,target:r,targetPosition:t=ko.BottomLeft,elementAlignment:n=Do.TopLeft,shouldTargetCloseOverlay:s=!0,shouldMatchTargetWidth:o=!1,shouldScrollCloseOverlay:i=!1,shouldCheckZIndex:a=!1,shouldRemainOnScreen:c=!1,unmountWhenHidden:d=!1,transitionDuration:h=400,showTransitionOptions:p="cubic-bezier(0, 0, 0.2, 1)",hideTransitionOptions:v="linear",shown:y,hidden:x,isClickedWithin:D,markupCreated:O,children:P})=>{const[R,z]=f.useState(-1),[$,g]=f.useState(e),[L,C]=f.useState(!1),U=f.useRef(!1),B=f.useRef(100),se=f.useRef({left:0,top:0,width:0}),re=f.useRef(),ee=f.useRef(),I=f.useRef(),F=f.useRef(),j=f.useRef(),k=f.useRef(),G=Fn();f.useEffect(()=>(c===!0&&(k.current=new ResizeObserver(N)),()=>{var A,Y;c===!0&&(ee.current&&((A=k.current)==null||A.unobserve(ee.current)),(Y=k.current)==null||Y.disconnect())}),[]),f.useEffect(()=>{if(r&&(re.current=Eo(r),i)){const A=G==null?void 0:G.isValidScrollableElement;I.current=Gn(re.current,{overflow:"scroll, auto",overflowX:"scroll, auto",overflowY:"scroll, auto"},!1,A),I.current.tagName.toLowerCase()==="html"&&(I.current=document)}if(a){const A=Kn("zIndex",Y=>parseInt(Y)>=100).map(Y=>parseInt(Y));A.length>0&&(B.current=Math.max(...A)+1)}e!==void 0&&g(e)},[r,e,i,a]);const N=A=>{if(ee.current){const Y=we.getScreenDimensions(),q=A[A.length-1].target,Q=q.getBoundingClientRect(),E=we.determineOffScreenLocation(Q);if(E){if(re.current&&we.canPositionElementOnScreenWithTarget(q,re.current)){const te=we.positionElementToTargetOnScreen(ee.current,re.current,n,t);se.current={...se.current,...te}}else E.right?se.current.left=Y.width-Q.width:E.left&&(se.current.left=0),E.bottom?se.current.top=Y.height-Q.height:E.top&&(se.current.top=0);W()}}},W=Wt(()=>{U.current=!U.current,C(U.current)},20),b=()=>{z(B.current)},T=()=>{if(!ee.current)return;y==null||y();let A;!s&&re.current&&(A=[re.current]);const Y=q=>{q?D==null||D():g(!1)};F.current=co(ee.current,Y,A),i&&(j.current=Ml(q=>ee.current&&ni(q,ee.current)&&g(!1),100,{leading:!0}),I.current&&I.current.addEventListener("scroll",j.current))},V=()=>{I.current&&j.current&&(I.current.removeEventListener("scroll",j.current),j.current=void 0),F.current&&uo(F.current)},S=()=>{z(-1),x==null||x()},H=A=>{var Y,q;if(c===!0&&ee.current&&((Y=k.current)==null||Y.unobserve(ee.current)),ee.current=A,O==null||O(A),re.current){const Q=we.positionElementToTarget(ee.current,re.current,n,t);se.current={...Q,width:re.current.offsetWidth},c===!0&&(we.canPositionElementOnScreenWithTarget(ee.current,re.current)||we.canPositionElementOnScreen(ee.current))&&((q=k.current)==null||q.observe(ee.current))}},K=f.useMemo(()=>{const A={top:`${se.current.top}px`,left:`${se.current.left}px`,zIndex:R};return o&&(A.width=`${se.current.width}px`),A},[L,R,o]);return l.jsx(So,{start:$,timeout:h,showTransitionOptions:p,hideTransitionOptions:v,onEntering:b,onEntered:T,onExit:V,onExited:S,unmountOnExit:d,children:({state:A,defaultStyle:Y,transitionStyles:q})=>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:{...K,...Y,...q[A]},ref:Q=>Q&&H(Q),children:P})})};let yr;const xh=new Uint8Array(16);function wh(){if(!yr&&(yr=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!yr))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return yr(xh)}const Ne=[];for(let e=0;e<256;++e)Ne.push((e+256).toString(16).slice(1));function Ph(e,r=0){return Ne[e[r+0]]+Ne[e[r+1]]+Ne[e[r+2]]+Ne[e[r+3]]+"-"+Ne[e[r+4]]+Ne[e[r+5]]+"-"+Ne[e[r+6]]+Ne[e[r+7]]+"-"+Ne[e[r+8]]+Ne[e[r+9]]+"-"+Ne[e[r+10]]+Ne[e[r+11]]+Ne[e[r+12]]+Ne[e[r+13]]+Ne[e[r+14]]+Ne[e[r+15]]}const No={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Th(e,r,t){if(No.randomUUID&&!r&&!e)return No.randomUUID();e=e||{};const n=e.random||(e.rng||wh)();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 Ph(n)}class Kt{static create(r){const t=[];let n=0;for(let s=0,o=r.formatParts.length;s<o;s++){const i=r.formatParts[s],a=n,c=a+i.characterCount;t.push({startPosition:a,endPosition:c,...i}),n=c}return t}}class Sh{constructor(r,t){m(this,"instanceCollection");m(this,"formatPartList");m(this,"inputSlotCollection");m(this,"currentPartIndex",0);m(this,"currentPartIndices",[]);m(this,"currentCursorPosition",0);m(this,"highlightCursorPosition",0);m(this,"currentCursorStartPosition",-1);m(this,"currentCursorEndPosition",-1);m(this,"inputElement");m(this,"inputSelection",null);m(this,"inputRange");m(this,"textNode");this.instanceCollection=Dt.getInstance(),this.formatPartList=Kt.create(r),this.inputSlotCollection=this.instanceCollection.getInputSlotInstance(t,r)}get isSelection(){return this.inputRange!==void 0&&this.inputRange.startOffset!==this.inputRange.endOffset}get isAllSelected(){var t;const r=this.inputSlotCollection.getLastSlot();return this.isSelection&&((t=this.inputRange)==null?void 0:t.startOffset)===0&&this.inputRange.endOffset===r.endPosition}getCursorPosition(){return this.currentCursorPosition}getCursorStartPosition(){return this.currentCursorStartPosition}getCursorEndPosition(){return this.currentCursorEndPosition}getCurrentPartIndex(){return this.currentPartIndex}getCurrentPartIndices(){return this.currentPartIndices}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.currentPartIndices=[],t===void 0||r===t?(this.currentCursorPosition=t||r,this.highlightCursorPosition=t||r,this.currentCursorStartPosition=-1,this.currentCursorEndPosition=-1,this.setPartIndexByCursorPosition()):(r<t?(this.currentCursorStartPosition!==r?this.highlightCursorPosition=r:this.currentCursorEndPosition!==t&&(this.highlightCursorPosition=t),this.currentCursorStartPosition=r,this.currentCursorEndPosition=t):(this.currentCursorStartPosition!==t?this.highlightCursorPosition=t:this.currentCursorEndPosition!==r&&(this.highlightCursorPosition=r),this.currentCursorStartPosition=t,this.currentCursorEndPosition=r),this.currentCursorPosition=-1,this.setPartIndexByHighlightPosition(),this.setPartIndicesByCursorPositions()))}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 d=document.createRange();return d.selectNodeContents(c),d.compareBoundaryPoints(Range.END_TO_END,r)<1?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT});let o=0;for(;s.nextNode();)o+=((n=s.currentNode.textContent)==null?void 0:n.length)||0;r.startContainer.nodeType===Node.TEXT_NODE&&(o+=r.startOffset);const i=this.inputSlotCollection.getLastSlotWithData(),a=i.startPosition+i.partText.length;r.startOffset===r.endOffset?this.setCursorSelection(o>a?a:o):this.setCursorSelection(r.startOffset,r.endOffset)}}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.updateCursorPosition(),this.currentCursorPosition>0&&!this.isSelection){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--)if(t=this.formatPartList[n],r>=t.startPosition&&r<=t.endPosition){t.isSeparator?this.setCursorSelection(this.formatPartList[n-1].endPosition):this.setCursorSelection(r);break}}else this.isSelection?this.setCursorSelection(this.currentCursorPosition):this.moveHome()}moveCursorRight(){this.updateCursorPosition(!1);const r=this.inputSlotCollection.getLastSlotWithData(),t=r.startPosition+r.partText.length;if(this.currentCursorPosition<t&&!this.isSelection){const n=this.currentCursorPosition+1;let s=this.formatPartList[this.currentPartIndex];if(n>=s.startPosition&&n<=s.endPosition)this.setCursorSelection(n);else for(let o=this.currentPartIndex+1,i=this.formatPartList.length;o<i;o++)if(s=this.formatPartList[o],n>=s.startPosition&&n<=s.endPosition){s.isSeparator?this.setCursorSelection(this.formatPartList[o+1].startPosition):this.setCursorSelection(n);break}}else this.setCursorSelection(this.currentCursorPosition)}moveToNextInputPart(){if(this.currentPartIndex<this.formatPartList.length-1){const 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))}}highlightAll(){const r=this.formatPartList[this.formatPartList.length-1].endPosition;this.setCursorSelection(0,r)}moveHighlightLeft(){this.updateHighlightPositions();const r=this.highlightCursorPosition>this.currentCursorStartPosition;if(this.currentCursorStartPosition>0||r){let t=r?this.currentCursorStartPosition:this.currentCursorStartPosition-1,n=r?this.highlightCursorPosition-1:this.currentCursorEndPosition,s=this.formatPartList[this.currentPartIndex];if(t>=s.startPosition&&t<=s.endPosition||r&&n>=s.startPosition&&n<=s.endPosition)this.setCursorSelection(t,n);else for(let o=this.currentPartIndex-1;o>=0;o--)if(s=this.formatPartList[o],t>=s.startPosition&&t<=s.endPosition||r&&n>=s.startPosition&&n<=s.endPosition){s.isSeparator?(r?n=this.formatPartList[o-1].endPosition-1:t=this.formatPartList[o-1].endPosition-1,this.setCursorSelection(t,n)):this.setCursorSelection(t,n);break}}}moveHighlightRight(){this.updateHighlightPositions();const r=this.inputSlotCollection.getLastSlotWithData(),t=r.startPosition+r.partText.length,n=this.highlightCursorPosition<this.currentCursorEndPosition;if(this.currentCursorEndPosition<t||n){let s=n?this.highlightCursorPosition+1:this.currentCursorStartPosition,o=n?this.currentCursorEndPosition:this.currentCursorEndPosition+1,i=this.formatPartList[this.currentPartIndex];if(o>=i.startPosition&&o<=i.endPosition||n&&s>=i.startPosition&&s<=i.endPosition)this.setCursorSelection(s,o);else for(let a=this.currentPartIndex+1,c=this.formatPartList.length;a<c;a++)if(i=this.formatPartList[a],o>=i.startPosition&&o<=i.endPosition||n&&s>=i.startPosition&&s<=i.endPosition){i.isSeparator?(n?s=this.formatPartList[a+1].startPosition+1:o=this.formatPartList[a+1].startPosition+1,this.setCursorSelection(s,o)):this.setCursorSelection(s,o);break}}}updateHighlightPositions(){this.currentCursorStartPosition===-1&&this.currentCursorEndPosition===-1&&this.currentCursorPosition>-1&&(this.currentCursorStartPosition=this.currentCursorPosition,this.currentCursorEndPosition=this.currentCursorPosition,this.highlightCursorPosition=this.currentCursorPosition)}updateCursorPosition(r=!0){this.currentCursorPosition===-1&&this.currentCursorStartPosition>-1&&this.currentCursorEndPosition>-1&&(r?this.currentCursorPosition=this.currentCursorStartPosition:this.currentCursorPosition=this.currentCursorEndPosition)}findNextEditablePart(){return this.inputSlotCollection.getNextSlot(this.currentPartIndex)}findPreviousEditablePart(){return this.inputSlotCollection.getPreviousSlot(this.currentPartIndex)}setPartIndexByCursorPosition(){for(let 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}}}setPartIndexByHighlightPosition(){for(let r=0;r<this.formatPartList.length;r++){const t=this.formatPartList[r];if(this.highlightCursorPosition>=t.startPosition&&this.highlightCursorPosition<=t.endPosition){if(t.isSeparator){this.highlightCursorPosition=this.formatPartList[r+1].startPosition,this.currentPartIndex=r+1;break}this.currentPartIndex=r;break}}}setPartIndicesByCursorPositions(){for(let r=0,t=this.formatPartList.length;r<t;r++){const n=this.formatPartList[r];n.isSeparator||(n.startPosition>=this.currentCursorStartPosition&&n.startPosition<=this.currentCursorEndPosition||n.endPosition>=this.currentCursorStartPosition&&n.endPosition<=this.currentCursorEndPosition||n.startPosition<this.currentCursorStartPosition&&n.endPosition>this.currentCursorEndPosition)&&this.currentPartIndices.push(r)}}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 Eh{static create(r){const t=[];for(let n=0,s=r.length;n<s;n++){const o=r[n];o.isSeparator||t.push({partIndex:n,partText:"",isComplete:!1,...o})}return t}}class Ch{constructor(r){m(this,"inputSlots");this.inputSlots=Eh.create(Kt.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)}getSlots(r){return this.inputSlots.filter(t=>r.includes(t.partIndex))}getSlotsFromCursorPosition(r){let t=-1;for(let n=0,s=this.inputSlots.length;n<s;n++){const o=this.inputSlots[n];if(r>=o.startPosition&&r<=o.endPosition){t=n;break}}return t>-1?this.inputSlots.filter(n=>n.partIndex>=t):void 0}getFirstSlot(){return this.inputSlots[0]}getLastSlot(){return this.inputSlots[this.inputSlots.length-1]}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 Dt{static getInstance(){return this.instance||(this.instance=new kh),this.instance}}m(Dt,"instance");class kh{constructor(){m(this,"navigatorInstances");m(this,"inputSlotInstances");this.navigatorInstances={},this.inputSlotInstances={}}getNavigatorInstance(r,t){return this.navigatorInstances[r]||(this.navigatorInstances[r]=new Sh(t,r)),this.navigatorInstances[r]}getInputSlotInstance(r,t){return this.inputSlotInstances[r]||(this.inputSlotInstances[r]=new Ch(t)),this.inputSlotInstances[r]}removeInstances(r){this.navigatorInstances[r]&&delete this.navigatorInstances[r],this.inputSlotInstances[r]&&delete this.inputSlotInstances[r]}}class Dn{constructor(r,t){m(this,"instanceCollection");m(this,"formatPartList");m(this,"inputSlotCollection");m(this,"inputElement");this.instanceCollection=Dt.getInstance(),this.formatPartList=Kt.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 o=this.formatPartList[n];if(o.isSeparator)r+=o.inputText;else{const i=this.inputSlotCollection.getSlot(n);i&&(r+=i.partText+((t=i.inputText)==null?void 0:t.repeat(i.characterCount-i.partText.length)))}}this.inputElement&&(this.inputElement.innerHTML=r)}}var qe=(e=>(e[e.Text=0]="Text",e[e.Numeric=1]="Numeric",e))(qe||{});class _o{constructor(){m(this,"numberKeys",["0","1","2","3","4","5","6","7","8","9"]);m(this,"movementKeys",["ArrowLeft","ArrowRight","Home","End","a"]);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 Dh{constructor(r){m(this,"_currentIndex",0);m(this,"index",0);m(this,"formatParts");this.formatParts=Kt.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 Oh{constructor(r){m(this,"formatParts");this.formatParts=Kt.create(r)}getUniqueSeparators(){const r=[],t=this.formatParts.filter(n=>n.isSeparator);for(let n=0,s=t.length;n<s;n++){const o=t[n];o.inputText&&!r.includes(o.inputText)&&r.push(o.inputText)}return r}}class Io{constructor(r,t){m(this,"instanceCollection");m(this,"inputSlotCollection");m(this,"formatNavigator");m(this,"keyTypeChecker");m(this,"formatRenderer");m(this,"formatPartList");m(this,"partEntryList");this.format=r,this.instanceCollection=Dt.getInstance(),this.inputSlotCollection=this.instanceCollection.getInputSlotInstance(t,r),this.formatNavigator=this.instanceCollection.getNavigatorInstance(t,r),this.keyTypeChecker=new _o,this.formatRenderer=new Dn(r,t),this.formatPartList=new Dh(r),this.partEntryList=new Oh(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 o=this.formatPartList.currentIndex,i=this.formatPartList.next();if(i&&i.inputText){const a=r.indexOf(i.inputText,t),c=this.inputSlotCollection.getSlot(o);if(c&&a>-1){const d=a-t>c.characterCount?t+c.characterCount:a;c.partText=r.substring(t,d),this.processSlotRules(c),t=a+i.characterCount}}}else{const o=this.inputSlotCollection.getSlot(this.formatPartList.currentIndex);o&&(o.partText=r.substring(t,t+o.characterCount),this.processSlotRules(o))}}}processPastedValue(r,t=!1){t&&this.processSelectionEditRules();const n=this.formatNavigator.getCursorPosition(),s=this.inputSlotCollection.getSlotsFromCursorPosition(n);if(s){const o=n-s[0].startPosition,i=s[0].partText.substring(0,o);let a=s[0].partText.substring(o);s[0].partText="";for(let p=1,v=s.length;p<v;p++)a+=s[p].partText,s[p].partText="";const c=this.removeSeparatorsFromValue(r),d=i+c+a;let h=0;for(let p=0,v=s.length;p<v;p++){const y=s[p];y.partText=d.substring(h,y.characterCount+h),h+=y.characterCount,this.processSlotRules(y)}}}removeSeparatorsFromValue(r){let t=r;const n=this.partEntryList.getUniqueSeparators();for(let s=0,o=n.length;s<o;s++){const i=n[s];t=t.replace(i,"")}return t}processEditRules(r){this.formatNavigator.isSelection?this.processSelectionEditRules(r):this.processNonSelectionEditRules(r)}processNonSelectionEditRules(r){const t=this.inputSlotCollection.getSlot(this.formatNavigator.getCurrentPartIndex());if(!t)return;const n=this.formatNavigator.getCursorPosition(),s=n-t.startPosition,o=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),o&&this.shiftFormatParts(t),this.formatRenderer.render(),this.formatNavigator.moveCursorLeft(),this.processSlotRules(t,!0);else{this.processSlotRules(t,!0);const a=this.inputSlotCollection.getPreviousSlot(t.partIndex);a&&(a.partText=a.partText.substring(0,a.partText.length-1),o&&this.shiftFormatParts(a),this.formatRenderer.render(),this.formatNavigator.setCursorPosition(a.startPosition+a.partText.length),this.processSlotRules(a,!0))}break}case"Delete":t.partText=t.partText.substring(0,s)+t.partText.substring(s+1),o&&this.shiftFormatParts(t),this.formatRenderer.render(),this.formatNavigator.setCursorToCurrentPosition(),this.processSlotRules(t,!0);break}}processSelectionEditRules(r){const t=this.inputSlotCollection.getSlots(this.formatNavigator.getCurrentPartIndices());if(t.length<=0)return;const n=this.formatNavigator.getCursorStartPosition(),s=this.formatNavigator.getCursorEndPosition();for(let o=0,i=t.length;o<i;o++){const a=t[o];a.startPosition>=n&&a.endPosition<=s?a.partText="":a.startPosition>=n&&a.endPosition>s?a.partText=a.partText.substring(s-a.startPosition):a.startPosition<n&&a.endPosition<=s?a.partText=a.partText.substring(0,n-a.startPosition):a.startPosition<n&&a.endPosition>s&&(a.partText=a.partText.substring(0,n-a.startPosition)+a.partText.substring(s-a.startPosition))}this.formatRenderer.render(),!r||r.key==="Backspace"?this.formatNavigator.setCursorPosition(s):this.formatNavigator.setCursorPosition(n);for(let o=0,i=t.length;o<i;o++)this.processSlotRules(t[o])}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,o=t.partText;if(t.valueType===qe.Numeric){if(!this.keyTypeChecker.isNumberKey(n))return;const i=t.maximumValue,a=t.exceedingMaximumValueCausesTab||!1,c=t.padWithZeros||!1,d=parseInt(this.createNewValue(t,n));if(i&&d>i)if(a){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 o.length+1===s?(this.addToInputSlot(n),t.isComplete=!0,this.formatRenderer.render(),this.formatNavigator.isAtLastPart()?this.formatNavigator.moveCursorRight():this.formatNavigator.moveToNextInputPart()):o.length+1<s&&(this.addToInputSlot(n),this.formatRenderer.render(),this.formatNavigator.moveCursorRight())}else o.length+1===s?(this.addToInputSlot(n),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 o=s-r.startPosition;return n.substring(0,o)+t+n.substring(o)}}processSlotRules(r,t=!1){const n=r.characterCount,s=r.allCharactersRequired||!1;if(r.valueType===qe.Numeric){const o=r.minimumValue,i=r.maximumValue;if(s)r.isComplete=r.partText.length===n;else if(o!==void 0&&i!==void 0){const a=r.padWithZeros||!1,c=parseInt(r.partText);r.isComplete=c>=o&&c<=i,r.isComplete&&a&&!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 Nh{constructor(r,t){m(this,"instanceCollection");m(this,"formatNavigator");m(this,"ruleProcessor");m(this,"keyTypeChecker");m(this,"formatRenderer");this.format=r,this.instanceCollection=Dt.getInstance(),this.formatNavigator=this.instanceCollection.getNavigatorInstance(t,r),this.ruleProcessor=new Io(r,t),this.keyTypeChecker=new _o,this.formatRenderer=new Dn(r,t)}setInputElement(r){this.ruleProcessor.setInputElement(r),this.formatRenderer.setInputElement(r)}processMovementKey(r){const{key:t,metaKey:n,ctrlKey:s,shiftKey:o}=r;switch(t){case"ArrowLeft":o?this.formatNavigator.moveHighlightLeft():n?this.formatNavigator.moveHome():this.formatNavigator.moveCursorLeft();break;case"ArrowRight":o?this.formatNavigator.moveHighlightRight():n?this.formatNavigator.moveEnd():this.formatNavigator.moveCursorRight();break;case"Home":this.formatNavigator.moveHome();break;case"End":this.formatNavigator.moveEnd();break;case"a":(n||s)&&this.formatNavigator.highlightAll();break}}processKeyPress(r){return this.keyTypeChecker.isIgnoreKey(r)?!1:this.keyTypeChecker.isMovementKey(r)?(this.processMovementKey(r),!1):(this.ruleProcessor.processKeyPress(r),!0)}}class _h{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=Th(),this.instanceCollection=Dt.getInstance(),this.keyProcessor=new Nh(r,this.instanceId),this.formatNavigator=this.instanceCollection.getNavigatorInstance(this.instanceId,r),this.formatRenderer=new Dn(r,this.instanceId),this.inputSlotCollection=this.instanceCollection.getInputSlotInstance(this.instanceId,r),this.inputRuleProcessor=new Io(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),this.renderFormat())}pastedValue(r){r.length>0&&(this.formatNavigator.isSelection?this.formatNavigator.isAllSelected?this.inputValuePassed(r):this.inputRuleProcessor.processPastedValue(r,!0):this.inputValue.length===0?this.inputValuePassed(r):this.inputRuleProcessor.processPastedValue(r),this.renderFormat(!0))}registerFormatChangeEvent(r){this.onFormatChange=r}mouseUpHandler(){this.formatNavigator.findCursorPosition()}keyDownHandler(r){r.key!=="Tab"&&(!(r.key==="c"&&(r.ctrlKey||r.metaKey))&&!(r.key==="v"&&(r.ctrlKey||r.metaKey))&&(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)}renderFormat(r=!1){setTimeout(()=>{var t,n;this.formatRenderer.render(),this.isInputFocused&&this.formatNavigator.setCursorToCurrentPosition(),this.inputValue.length>0&&(this.previousOutputValue=(t=this.inputElement)==null?void 0:t.innerHTML),r&&((n=this.inputElement)!=null&&n.innerHTML)&&this.onFormatChange&&this.onFormatChange(this.inputElement.innerHTML)})}}const Ih=(e,r)=>{const{value:t="",format:n,readOnly:s=!1,debounceTime:o=800,fillContainer:i=!0,leftElement:a,rightElement:c,className:d,leftElementClassName:h,rightElementClassName:p,isSingleLine:v=!1,allowSingleLineScroll:y=!1,isInputValid:x,onChange:D,onFocus:O,onBlur:P,onElementCreate:R,onLeftElementClick:z,onRightElementClick:$}=e,[g,L]=f.useState(!0),C=f.useRef(),U=f.useRef(),B=f.useRef();f.useEffect(()=>()=>{var W;(W=B.current)==null||W.dispose()},[]),f.useEffect(()=>{var W;(W=B.current)==null||W.inputValuePassed(t)},[t]),f.useEffect(()=>{var W,b,T;(W=B.current)==null||W.dispose(),n&&(B.current=new _h(n,t),U.current&&((b=B.current)==null||b.inputElementCreated(U.current)),(T=B.current)==null||T.registerFormatChangeEvent(se))},[n]);const se=f.useCallback(W=>{x?x(W)?(L(!0),D==null||D(W)):L(!1):D==null||D(W)},[D]),re=f.useCallback(W=>{var b;(b=B.current)==null||b.inputFocused(),O==null||O(W)},[O]),ee=f.useCallback(W=>{var b;(b=B.current)==null||b.inputBlurred(),P==null||P(W)},[P]),I=f.useCallback(()=>{var W;(W=B.current)==null||W.mouseUpHandler()},[]),F=f.useCallback(W=>{var b;(b=B.current)==null||b.keyDownHandler(W)},[]),j=f.useCallback(W=>{var T,V;W.preventDefault(),W.stopPropagation();const b=(T=W.clipboardData)==null?void 0:T.getData("text/plain");b&&((V=B.current)==null||V.pastedValue(b))},[]),k=f.useCallback(W=>{var b,T,V,S,H,K,A,Y,q,Q,E,te,_;(T=(b=C.current)==null?void 0:b.inputElement)==null||T.removeEventListener("keydown",F),(S=(V=C.current)==null?void 0:V.inputElement)==null||S.removeEventListener("mouseup",I),(K=(H=C.current)==null?void 0:H.inputElement)==null||K.removeEventListener("paste",j),C.current=W,(Y=(A=C.current)==null?void 0:A.inputElement)==null||Y.addEventListener("keydown",F),(Q=(q=C.current)==null?void 0:q.inputElement)==null||Q.addEventListener("mouseup",I),(te=(E=C.current)==null?void 0:E.inputElement)==null||te.addEventListener("paste",j),U.current=(_=C.current)==null?void 0:_.inputElement},[]),G=f.useCallback(()=>{var W;(W=C.current)==null||W.focus()},[]);f.useImperativeHandle(r,()=>({focus:G}));const N=le(d,{"!bsc-border-error":!g});return l.jsx(hr,{ref:W=>W&&k(W),readOnly:s,debounceTime:o,fillContainer:i,leftElement:a,rightElement:c,className:N,leftElementClassName:h,rightElementClassName:p,isSingleLine:v,allowSingleLineScroll:y,onFocus:re,onBlur:ee,onElementCreate:R,onLeftElementClick:z,onRightElementClick:$})},jo=f.forwardRef(Ih),On=f.createContext(void 0);function Mo(e,r,t=!0){var v,y;const n=eo(e),s=Gs(e),o=jf(e);let i=ln(s)-(((v=r.options)==null?void 0:v.weekStartsOn)||0);i=i===-1?6:i;const a=ln(o)-(((y=r.options)==null?void 0:y.weekStartsOn)||0),c=Yl({start:s,end:o}),d=n+i>35?6:5,h=Ro(d,7,{dayValue:null,isCurrent:!0});let p=1;for(let x=0,D=d;x<D;x++){for(let O=x>0?0:i;O<7;O++){const P=c[p-1];if(P.setHours(e.getHours(),e.getMinutes(),e.getSeconds()),h[x][O].dayValue=P,++p>n)break}if(p>n)break}if(i>0&&t)for(let x=0;x<i;x++)h[0][x].dayValue=Nd(s,i-x),h[0][x].isCurrent=!1;if(a>-1&&t)for(let x=6;x>a;x--)h[d-1][x].dayValue=St(o,x-a),h[d-1][x].isCurrent=!1;return h}function Ro(e,r,t){const n=[];for(let s=0,o=e;s<o;s++){const i=[];for(let a=0,c=r;a<c;a++){const d=jh(t)?t:{...t};i.push(d)}n.push(i)}return n}function jh(e){const r=typeof e;return r==="string"||r==="number"||r==="boolean"||e instanceof Date}function Mh(e){var n;const r=_d(new Date,((n=e.options)==null?void 0:n.weekStartsOn)||0),t=[];for(let s=0;s<7;s++)t.push(St(r,s).toLocaleDateString(e.code,{weekday:"short"}));return t}function Rh(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 o=0;o<4;o++)t[s][o]={monthNumber:n,monthName:tt(r,n++).toLocaleDateString(e.code,{month:"short"})};return t}function Lh(e,r){const t=new Date(e.getTime()),n=Math.floor(t.getFullYear()/10)*10;t.setFullYear(n);const s=Wl({start:t,end:Bt(t,9)}),o=Ro(3,4,"");let i=0;for(let a=0;a<3;a++)for(let c=0;c<4&&(o[a][c]=s[i++].toLocaleDateString(r.code,{year:"numeric"}),i!==s.length);c++);return o}function Ah(e){const r=new Date;return r.setHours(0,0,0,0),r.toLocaleTimeString(e.code)}function Fh(e,r,t){return e.getTime()>=r.getTime()&&e.getTime()<=t.getTime()}async function Lo(e){return(await import(`/node_modules/date-fns/locale/${$h(e)}`)).default}function $h(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=Id(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 Nn(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 ge=(e=>(e[e.DateTime=0]="DateTime",e[e.DateOnly=1]="DateOnly",e[e.TimeOnly=2]="TimeOnly",e[e.DateRange=3]="DateRange",e))(ge||{}),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||{}),Xt=(e=>(e[e.Short=0]="Short",e[e.Medium=1]="Medium",e[e.Long=2]="Long",e))(Xt||{}),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||{}),vr=(e=>(e[e.Right=0]="Right",e[e.Left=1]="Left",e[e.None=2]="None",e))(vr||{}),oe=(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))(oe||{});const Hh=(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:Yh(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 Yh(e){return e?Array.isArray(e)?e[0]:e:new Date}const _n=(e,r,t)=>{const n=f.useCallback(c=>{t({type:oe.SetViewDate,viewDate:tt(r,c)})},[]),s=f.useCallback(c=>{t({type:oe.SetViewDate,viewDate:pn(r,c)})},[]),o=f.useCallback(c=>{t({type:oe.SetViewDate,viewDate:Bt(r,c)})},[]),i=f.useCallback(c=>{t({type:oe.SetViewDate,viewDate:mn(r,c)})},[]),a=f.useCallback(c=>{t({type:oe.SetDateSelector,dateSelector:c})},[]);return{...e,incrementViewMonths:n,decrementViewMonths:s,incrementViewYears:o,decrementViewYears:i,setDateSelector:a}},xr=({viewDate:e,selectedDate:r,selectedStartDate:t,selectedEndDate:n,selectionMode:s=nt.Normal,locale:o,onDateSelected:i,selectableDate:a,isValidDate:c,dispatcher:d})=>{var j;const[h,p]=f.useState(!1),[v,y]=f.useState(),[x,D]=f.useState(),[O,P]=f.useState(),[R,z]=f.useState(),$=f.useRef(),g=f.useRef(),L=f.useContext(On),C=f.useMemo(()=>L.calendarTemplate,[L.calendarTemplate]),U=async()=>o||await Lo(qn());f.useEffect(()=>{U().then(k=>{$.current=k,g.current=Mh($.current),p(!0)}).catch(k=>console.error(k))},[]),f.useEffect(()=>{e&&$.current&&P(Mo(e,$.current,s===nt.Normal))},[e,h]),f.useEffect(()=>{z(r?new Date(r.getFullYear(),r.getMonth(),r.getDate()):void 0)},[r]),f.useEffect(()=>{y(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]),f.useEffect(()=>{$.current&&o&&($.current=o,P(Mo(e,$.current,s===nt.Normal)))},[o]);const B=k=>{if(s===nt.Normal)d==null||d({type:oe.SetSelectedDate,selectedDate:k,viewDate:k}),i==null||i(k);else{if(!i)throw new Error("Range selection mode requires onDateSelected to be set");!t||Mf(k,t)?i(k):t&&!n?i(k,{setEndDate:!0}):t&&n&&i(k)}},se=k=>(R==null?void 0:R.toLocaleDateString())===k.toLocaleDateString(),re=k=>{if(v&&x){const G=k.getTime();return G>=v&&G<=x}return!1},ee=_n({viewDate:e,selectedDate:r,selectedStartDate:t,selectedEndDate:n,selectionMode:s,locale:o,weekDays:g.current,monthMatrix:O,selectableDate:a,isValidDate:c,onDateClicked:B,isSelectedDate:se,isInSelectedDateRange:re},e,d),F=C||((k,G)=>l.jsx("div",{className:"bc-dt-calendar bsc-w-full",children:G}));return l.jsx(lt,{props:ee,template:F,children:l.jsxs("div",{className:"bc-dt-day-row bsc-grid bsc-min-w-[329px] bsc-grid-cols-7 bsc-gap-3",children:[(j=g.current)==null?void 0:j.map((k,G)=>l.jsx("div",{className:"bc-dt-day-cell bsc-text-center bsc-font-bold",children:k},G)),O==null?void 0:O.map((k,G)=>k.map((N,W)=>{var V,S;const b=N.dayValue!==null&&(a===void 0||a(N.dayValue)),T=le("bsc-text-center bsc-py-1",{"bsc-text-gray-3":!N.isCurrent,"bsc-bg-primary-3 dark:bsc-bg-mono-light-1 dark:bsc-text-mono-dark-1":N&&N.dayValue&&(R&&se(N.dayValue)||v&&!x&&qs(v,N.dayValue)||v&&x&&re(N.dayValue)),"bsc-cursor-pointer":b,"bsc-text-error bsc-cursor-not-allowed":!b,"bsc-bg-primary-5 dark:bsc-bg-mono-light-3 dark:bsc-text-mono-dark-1":N.dayValue&&Od(N.dayValue)&&!(se(N.dayValue)||re(N.dayValue))},"bc-dt-date-cell");return l.jsx("div",{className:T,onClick:()=>N&&N.dayValue&&b&&(c===void 0||c(N.dayValue))&&B(N.dayValue),children:(S=N.dayValue)==null?void 0:S.getDate().toLocaleString((V=$.current)==null?void 0:V.code)},G.toString()+W.toString())}))]})})},wr=({title:e,scrollerType:r,onTitleClicked:t,onMovePrevious:n,onMoveNext:s,viewDate:o,dispatcher:i})=>{const c=f.useContext(On).dateScrollerTemplate,d=_n({title:e,scrollerType:r,onTitleClicked:t,onMovePrevious:n,onMoveNext:s},o,i),p=c||((v,y)=>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:y}));return l.jsxs(lt,{props:d,template:p,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(Fe,{icon:"chevronLeft",size:je.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(Fe,{icon:"chevronRight",size:je.Regular})})})]})},Wh=({selectedDate:e,viewDate:r,locale:t,showTimeSelector:n,selectableDate:s,isValidDate:o,onChange:i,dispatcher:a})=>{const c=()=>{r&&a({type:oe.SetViewDate,viewDate:pn(r,1)})},d=()=>{r&&a({type:oe.SetViewDate,viewDate:tt(r,1)})},h=()=>{a({type:oe.SetDateSelector,dateSelector:Oe.MonthSelector})},p=()=>{a({type:oe.SetDateSelector,dateSelector:Oe.TimeSelector})},v=()=>r?r.toLocaleDateString(t.code,{month:"long",year:"numeric"}):"";return l.jsxs("div",{className:"bc-dt-day-selector bsc-p-2",children:[l.jsx(wr,{title:v(),scrollerType:Qt.Day,onTitleClicked:h,onMovePrevious:c,onMoveNext:d,viewDate:r,dispatcher:a}),l.jsx(xr,{viewDate:r,selectedDate:e,locale:t,selectableDate:s,isValidDate:o,onDateSelected:i,dispatcher:a}),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))||Ah(t)})})]})},Vh=({viewDate:e,locale:r,dateSelection:t=ge.DateTime,dispatcher:n})=>{const s=f.useRef(Rh(r)),o=()=>{const h=mn(e,1);n({type:oe.SetViewDate,viewDate:h})},i=()=>{const h=Bt(e,1);n({type:oe.SetViewDate,viewDate:h})},a=h=>{n({type:oe.SetDateSelector,dateSelector:t!==ge.DateRange?Oe.DaySelector:Oe.DateRangeSelector,viewDate:Gd(e,h)})},c=()=>e.toLocaleDateString(r.code,{year:"numeric"}),d=()=>{n({type:oe.SetDateSelector,dateSelector:Oe.YearSelector})};return l.jsxs("div",{className:"bc-dt-month-selector bsc-p-2",style:{minWidth:"20rem"},children:[l.jsx(wr,{title:c(),scrollerType:Qt.Month,onTitleClicked:d,onMovePrevious:o,onMoveNext:i,viewDate:e,dispatcher:n}),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((v,y)=>l.jsx("div",{className:"bc-dt-month-cell bsc-cursor-pointer bsc-text-center",onClick:()=>a(v.monthNumber),children:v.monthName},p.toString()+y.toString())))})]})},Bh=({viewDate:e,selectedStartDate:r,selectedEndDate:t,locale:n,onChange:s,dispatcher:o})=>{const i=gr("screen and (max-device-width: 40rem)"),a=tt(e,1),c=(y,x)=>{!x||!x.setEndDate?o({type:oe.SetSelectedStartDate,selectedStartDate:y}):(o({type:oe.SetSelectedEndDate,selectedEndDate:y}),r&&(s==null||s([r,y])))},d=()=>{o({type:oe.SetDateSelector,dateSelector:Oe.MonthSelector})},h=()=>i?`${e.toLocaleDateString(n.code,{month:"long"})} ${e.toLocaleDateString(n.code,{year:"numeric"})}`:`${e.toLocaleDateString(n.code,{month:"long"})} ${e.toLocaleDateString(n.code,{year:"numeric"})} - ${a.toLocaleDateString(n.code,{month:"long"})} ${a.toLocaleDateString(n.code,{year:"numeric"})}`,p=()=>{e&&o({type:oe.SetViewDate,viewDate:pn(e,1)})},v=()=>{e&&o({type:oe.SetViewDate,viewDate:tt(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(wr,{title:h(),scrollerType:Qt.Range,onTitleClicked:d,onMovePrevious:p,onMoveNext:v,viewDate:e,dispatcher:o})}),l.jsx("div",{className:"bsc-flex-grow",children:l.jsx(bn,{mobileMarkup:l.jsx("div",{className:"bc-dt-range-calendar bsc-px-2 bsc-py-1",children:l.jsx(xr,{viewDate:e,selectedStartDate:r,selectedEndDate:t,selectionMode:nt.Range,onDateSelected:c,locale:n,dispatcher:o})}),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(xr,{viewDate:e,selectedStartDate:r,selectedEndDate:t,selectionMode:nt.Range,onDateSelected:c,locale:n,dispatcher:o})}),l.jsx("div",{className:"bc-dt-range-calendar-2 bsc-pl-4",children:l.jsx(xr,{viewDate:a,selectedStartDate:r,selectedEndDate:t,selectionMode:nt.Range,onDateSelected:c,locale:n,dispatcher:o})})]})})})]})},Uh=({viewDate:e,showDateSelector:r,locale:t,timeFormat:n=Se.TwelveHour,timeConstraints:s,onChange:o,dispatcher:i})=>{const a=f.useRef(n===Se.TwelveHour?11:23),c=f.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"]),d=f.useRef(ri(0,59,I=>I.toString().padStart(2,"0"))),h=f.useRef(["AM","PM"]),p=f.useRef(Dl(e)),v=I=>I>11?I-12:I,[y,x]=f.useState(v(e.getHours())),[D,O]=f.useState(e.getMinutes()),[P,R]=f.useState(e.getHours()<=12?0:1),z=f.useRef(e.toLocaleDateString(t.code));f.useEffect(()=>{const I=e.getHours(),F=e.getMinutes();if(I!==y&&x(n===Se.TwelveHour?v(I):I),F!==D&&O(F),n===Se.TwelveHour){const j=I<=11?0:1;j!==P&&R(j)}},[e]);const $=()=>{var j;const I=((j=s==null?void 0:s.hours)==null?void 0:j.step)||1,F=y<a.current?y+I:0;x(F),B(F,D,P)},g=()=>{var j;const I=((j=s==null?void 0:s.hours)==null?void 0:j.step)||1,F=y>0?y-I:a.current;x(F),B(F,D,P)},L=()=>{var j,k,G;const I=((j=s==null?void 0:s.minutes)==null?void 0:j.step)||1,F=D+I<(((k=s==null?void 0:s.minutes)==null?void 0:k.max)||59)?D+I:((G=s==null?void 0:s.minutes)==null?void 0:G.min)||0;O(F),B(y,F,P)},C=()=>{var j,k,G;const I=((j=s==null?void 0:s.minutes)==null?void 0:j.step)||1,F=D-I>=(((k=s==null?void 0:s.minutes)==null?void 0:k.min)||0)?D-I:(((G=s==null?void 0:s.minutes)==null?void 0:G.max)||60)-I;O(F),B(y,F,P)},U=()=>{const I=P===0?1:0;R(I),B(y,D,I)},B=(I,F,j)=>{const k=n===Se.TwelveHour&&j===1?I+12:I;p.current.setHours(k,F),i({type:oe.SetSelectedDate,selectedDate:p.current,viewDate:p.current}),o==null||o(p.current)},se=()=>{i({type:oe.SetDateSelector,dateSelector:Oe.DaySelector})},re=le("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}),ee=le("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 l.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:l.jsxs("div",{className:re,children:[r&&l.jsx("div",{className:ee,onClick:se,children:z.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:$,children:l.jsx(Fe,{icon:"chevronUp",size:je.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:L,children:l.jsx(Fe,{icon:"chevronUp",size:je.Regular})})}),n===Se.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:U,children:l.jsx(Fe,{icon:"chevronUp",size:je.Regular})})}),l.jsx("div",{className:"bc-dt-time-hour-value bsc-text-center",children:c.current[y]}),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:d.current[D]}),n===Se.TwelveHour&&l.jsx("div",{className:"bc-dt-time-meridian-value bsc-text-center",children:h.current[P]}),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:g,children:l.jsx(Fe,{icon:"chevronDown",size:je.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:C,children:l.jsx(Fe,{icon:"chevronDown",size:je.Regular})})}),n===Se.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:U,children:l.jsx(Fe,{icon:"chevronDown",size:je.Regular})})})]})})},zh=({viewDate:e,locale:r,dispatcher:t})=>{const n=Lh(e,r),s=()=>{const c=mn(e,10);t({type:oe.SetViewDate,viewDate:c})},o=()=>{const c=Bt(e,10);t({type:oe.SetViewDate,viewDate:c})},i=c=>{const d=parseInt(c);t({type:oe.SetDateSelector,dateSelector:Oe.MonthSelector,viewDate:Kd(e,d)})},a=()=>`${n[0][0].toString()} - ${n[2][1].toString()}`;return l.jsxs("div",{className:"bc-dt-year-selector",style:{minWidth:"20rem"},children:[l.jsx(wr,{title:a(),scrollerType:Qt.Year,onMovePrevious:s,onMoveNext:o,viewDate:e,dispatcher:t}),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,d)=>c.map((h,p)=>h.length>0?l.jsx("div",{className:"bc-dt-year-cell bsc-cursor-pointer bsc-text-center",onClick:()=>i(h),children:h},d.toString()+p.toString()):l.jsx("div",{},d.toString()+p.toString())))})})]})};class qh{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,o=20,a=new Date(n,s-1,o).toLocaleDateString(t,{year:"numeric",month:"numeric",day:"numeric"});this.dateFormat=a.replace(`${n}`,"YYYY").replace(`${s}`,"MM").replace(`${o}`,"DD");const c=new Date,d=18,h=24,p=37,v=317;c.setHours(d,h,p,v);const y=c.toLocaleTimeString(t);this.use24HourTime=y.startsWith("18"),this.timeFormat=y.replace(`${this.use24HourTime?d:"6"}`,"HH").replace(`${h}`,"MM").replace(`${p}`,"SS").replace(`${v}`,"LLL"),this.createDateParts()}get is24HourTime(){return this.use24HourTime}createInputFormat(){const r={deleteShiftsFormatPart:!1,formatParts:[]};switch(this.dateSelection){case ge.DateOnly:return this.createDateFormat(r);case ge.TimeOnly:return this.createTimeFormat(r);case ge.DateRange:return this.createDateRangeFormat(r);case ge.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 o={characterCount:n.length,placeholder:n,inputText:n,isSeparator:!0};return[this.monthPart,s,this.dayPart,o,this.yearPart]}return[]}createDayMonthYearFormatParts(){if(this.monthPart&&this.dayPart&&this.yearPart){let 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 o={characterCount:n.length,placeholder:n,inputText:n,isSeparator:!0};return[this.dayPart,s,this.monthPart,o,this.yearPart]}return[]}createYearMonthDayFormatParts(){if(this.monthPart&&this.dayPart&&this.yearPart){let 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 o={characterCount:n.length,placeholder:n,inputText:n,isSeparator:!0};return[this.yearPart,s,this.monthPart,o,this.dayPart]}return[]}createTwelveHourFormatParts(){if(this.twelveHourPart&&this.minutePart&&this.meridianPart){const r=this.timeFormat.replace("HH",""),t=r.indexOf("MM"),n=r.substring(0,t),s={characterCount:n.length,placeholder:n,inputText:n,isSeparator:!0},o={characterCount:1,placeholder:" ",inputText:" ",isSeparator:!0};return[this.twelveHourPart,s,this.minutePart,o,this.meridianPart]}return[]}createTwentyFourHourFormatParts(){if(this.twentyFourHourPart&&this.minutePart){const 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 Gh=(e,r)=>{var o;const[t,n]=f.useState(),s=f.useRef();return f.useEffect(()=>{r&&!t&&(s.current=new qh(e,r),n(s.current.createInputFormat()))},[r]),[t,(o=s.current)==null?void 0:o.is24HourTime]},Kh=({value:e,readOnly:r=!1,label:t,useDefaultDateValue:n=!1,useFormattedInput:s=!1,allowClear:o=!1,closeSelector:i=!1,locale:a,className:c,dateSelection:d=ge.DateTime,dateFormat:h,timeConstraints:p,icon:v,iconPosition:y=vr.Right,inputElement:x,selectableDate:D,isValidDate:O,onChange:P,calendarTemplate:R,dateScrollerTemplate:z,inputTemplate:$,wrapperTemplate:g})=>{const[L,C]=f.useState(!1),[U,B]=f.useState(),[se,re]=f.useState(),[ee,I,F]=ti(d),j=f.useRef(),k=f.useRef(!1),G=f.useRef(a||qn()),N=f.useRef(),W=f.useRef(),b=f.useRef(),T=f.useRef(null),V=f.useRef(null),[S,H]=Gh(d,U),K=f.useRef({calendarTemplate:R,dateScrollerTemplate:z});f.useEffect(()=>{G.current&&Y(G.current)},[G]),f.useEffect(()=>{a&&Y(a)},[a]),f.useEffect(()=>{if(e){const Z=q();te({type:oe.InitializeDates,initialDate:Z})}else te({type:oe.ClearDates})},[e,N.current]),f.useEffect(()=>{H&&te({type:oe.SetTimeFormat,timeFormat:H?Se.TwentyFourHour:Se.TwelveHour})},[H]),f.useEffect(()=>{x&&(W.current=x)},[x]),f.useEffect(()=>{te({type:oe.SetDateSelector,dateSelector:A()})},[ee]);const A=f.useCallback(()=>F.current===ge.TimeOnly?Oe.TimeSelector:F.current===ge.DateTime||F.current===ge.DateOnly?Oe.DaySelector:Oe.DateRangeSelector,[]),Y=Z=>{Lo(Z).then(ae=>{B(ae.code),N.current=ae;const Re=q();te(e||n?{type:oe.InitializeDates,initialDate:Array.isArray(Re)?Re[0]:Re}:{type:oe.SetViewDate,viewDate:Array.isArray(Re)?Re[0]:Re})}).catch(ae=>console.error(ae))},q=()=>{const Z=new Date;return Z.setHours(0,0,0,0),e?typeof e=="string"?F.current!==ge.DateRange?Zt(e,N.current):Nn(e,N.current):e:Z},Q={currentSelector:A(),currentViewDate:new Date,timeFormat:Se.TwelveHour,dateInitialized:!1},[E,te]=f.useReducer(Hh,Q),_=()=>{Or(),C(!0)},_e=f.useMemo(()=>Wt(()=>{C(!1)},250),[]),st=f.useMemo(()=>Wt(()=>{_e.cancel()},5),[_e]),Ge=Z=>{const ae=Z.target.innerText;er(ae)},pt=Z=>{if(Z){const ae=F.current!==ge.DateRange?Zt(Z,N.current):Nn(Z,N.current);return ae?O?Array.isArray(ae)?ae.every(Re=>O(Re)):O(ae):!0:!1}else return!0},Cr=Z=>{er(Z||"")},er=Z=>{const ae=F.current!==ge.DateRange?Zt(Z,N.current):Nn(Z,N.current);ae?(Array.isArray(ae)?(Fh(ae[0],Gs(E.currentViewDate),Hl(tt(E.currentViewDate,1)))||te({type:oe.SetViewDate,viewDate:ae[0]}),te({type:oe.SetSelectedDateRange,selectedStartDate:ae[0],selectedEndDate:ae[1]})):te({type:oe.SetSelectedDate,selectedDate:ae,viewDate:ae}),P==null||P(ae)):Z===""&&(te({type:oe.ClearDates}),P==null||P())},Nt=Z=>{F.current===ge.DateOnly&&i===!0&&C(!1),P==null||P(Z)},kr=()=>{Or(),C(!L),V.current?V.current.focus():T.current&&T.current.focus()},Dr=()=>{te({type:oe.ClearDates}),C(!1),P==null||P()},mt=(Z,ae)=>{(!W.current||j.current!==ae)&&(W.current=Z,j.current=ae,k.current=!0)},Or=()=>{(!b.current||k.current)&&W.current&&(b.current=W.current,re(W.current),k.current=!1)},Nr=()=>{C(!1),te({type:oe.SetDateSelector,dateSelector:A()})},_r=()=>{switch(h){case Xt.Short:return"short";case Xt.Medium:return"medium";case Xt.Long:return"long";default:return}},gt=()=>{var ae,Re,et,_t,It,rr,Ar,nr,Fr,sr,or,$r;const Z=_r();switch(F.current){case ge.DateTime:return E.selectedDate?Z?E.selectedDate.toLocaleString((ae=N.current)==null?void 0:ae.code,{dateStyle:Z,timeStyle:Z}):E.selectedDate.toLocaleString((Re=N.current)==null?void 0:Re.code):"";case ge.DateOnly:return E.selectedDate?Z?E.selectedDate.toLocaleDateString((et=N.current)==null?void 0:et.code,{dateStyle:Z}):E.selectedDate.toLocaleDateString((_t=N.current)==null?void 0:_t.code):"";case ge.TimeOnly:return E.selectedDate?Z?E.selectedDate.toLocaleTimeString((It=N.current)==null?void 0:It.code,{timeStyle:Z,hour12:E.timeFormat===Se.TwelveHour,hourCycle:E.timeFormat===Se.TwentyFourHour?"h23":void 0}):E.selectedDate.toLocaleTimeString((rr=N.current)==null?void 0:rr.code,{hour12:E.timeFormat===Se.TwelveHour,hourCycle:E.timeFormat===Se.TwentyFourHour?"h23":void 0}):"";case ge.DateRange:return E.selectedStartDate&&E.selectedEndDate?Z?`${E.selectedStartDate.toLocaleDateString((Ar=N.current)==null?void 0:Ar.code,{dateStyle:Z})} - ${E.selectedEndDate.toLocaleDateString((nr=N.current)==null?void 0:nr.code,{dateStyle:Z})}`:`${E.selectedStartDate.toLocaleDateString((Fr=N.current)==null?void 0:Fr.code)} - ${E.selectedEndDate.toLocaleDateString((sr=N.current)==null?void 0:sr.code)}`:"";default:return E.selectedDate?Z?E.selectedDate.toLocaleString((or=N.current)==null?void 0:or.code,{dateStyle:Z,timeStyle:Z}):E.selectedDate.toLocaleString(($r=N.current)==null?void 0:$r.code):""}},Ke=ee===ge.DateTime||ee===ge.DateOnly||ee===ge.DateRange,In=ee===ge.DateTime||ee===ge.TimeOnly,ot=y===vr.None?{}:y===vr.Right?{rightElement:l.jsxs("div",{className:"bsc-flex bsc-text-black dark:bsc-text-mono-light-1",children:[o&&!r&&l.jsx("div",{children:l.jsx(Fe,{icon:"close",size:je.Small,className:"bsc-cursor-pointer bsc-text-sm",onClick:Dr})}),l.jsx("div",{className:"bsc-ml-2",onClick:r?void 0:kr,children:v||l.jsx(Fe,{icon:"calendar",size:je.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:kr,children:v||l.jsx(Fe,{icon:"calendar",size:je.Small,className:r?void 0:"bsc-cursor-pointer"})}),o&&!r&&l.jsx("div",{children:l.jsx(Fe,{icon:"close",size:je.Small,className:"bsc-cursor-pointer bsc-text-sm",onClick:Dr})})]}),leftElementClassName:"bsc-justify-center"},Ir={setDateSelector:Z=>I(Z)},jn=g||((Z,ae)=>l.jsx(l.Fragment,{children:ae})),Mr=()=>l.jsx(lt,{props:Ir,template:jn,children:l.jsxs(l.Fragment,{children:[E.currentSelector===Oe.DaySelector&&Ke&&E.dateInitialized&&N.current&&l.jsx(Wh,{selectedDate:E.selectedDate,viewDate:E.currentViewDate,locale:N.current,showTimeSelector:F.current===ge.DateTime,selectableDate:D,isValidDate:O,dispatcher:te,onChange:Nt}),E.currentSelector===Oe.MonthSelector&&Ke&&E.dateInitialized&&N.current&&l.jsx(Vh,{viewDate:E.currentViewDate,locale:N.current,dateSelection:F.current,dispatcher:te}),E.currentSelector===Oe.YearSelector&&Ke&&E.dateInitialized&&N.current&&l.jsx(zh,{viewDate:E.currentViewDate,locale:N.current,dispatcher:te}),E.currentSelector===Oe.TimeSelector&&In&&E.dateInitialized&&N.current&&l.jsx(Uh,{viewDate:E.currentViewDate,showDateSelector:F.current===ge.DateTime,locale:N.current,timeFormat:E.timeFormat,timeConstraints:p,onChange:P,dispatcher:te}),E.currentSelector===Oe.DateRangeSelector&&Ke&&E.dateInitialized&&N.current&&l.jsx(Bh,{viewDate:E.currentViewDate,selectedStartDate:E.selectedStartDate,selectedEndDate:E.selectedEndDate,locale:N.current,onChange:P,dispatcher:te})]})}),Rr=_n({label:t,readOnly:r,allowClear:o,getValue:gt,onFocus:_,onInput:Ge,iconPosition:y,iconElement:ot.rightElement||ot.leftElement},E.currentViewDate,te),Lr=$||((Z,ae)=>l.jsx(l.Fragment,{children:ae})),tr=le("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(On.Provider,{value:K.current,children:l.jsxs("div",{className:"bc-date-time",children:[t&&l.jsx(Ze,{label:t,readOnly:r,className:"bc-dt-label"}),l.jsx(bn,{mobileMarkup:l.jsxs(l.Fragment,{children:[l.jsx(lt,{props:Rr,template:Lr,children:l.jsx(hr,{ref:T,value:gt(),readOnly:r,inputMode:"none",className:tr,onFocus:_,onElementCreate:Z=>mt(Z,!1),...ot})}),l.jsx(Co,{visible:L,target:se,hidden:Nr,unmountWhenHidden:!0,children:Mr()})]}),aboveMobileMarkup:l.jsxs(l.Fragment,{children:[l.jsx(lt,{props:Rr,template:Lr,children:s===!1?l.jsx(hr,{ref:T,value:gt(),readOnly:r,className:tr,onFocus:_,onBlur:_e,onInput:Ge,onElementCreate:Z=>mt(Z,!1),...ot}):l.jsx(jo,{ref:V,value:gt(),readOnly:r,className:tr,format:S,isInputValid:pt,onFocus:_,onBlur:_e,onChange:Cr,onElementCreate:Z=>mt(Z,!0),...ot})}),l.jsx(Oo,{visible:L,target:se,shouldTargetCloseOverlay:!1,shouldScrollCloseOverlay:!0,shouldCheckZIndex:!0,shouldRemainOnScreen:!0,hidden:Nr,isClickedWithin:st,unmountWhenHidden:!0,children:Mr()})]})})]})})};function ht(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 Qh(e){return/^\d+$/.test(e)}function Pr(e){return Object.prototype.toString.call(e)==="[object Object]"}function Jt(e){return Object(e)===e}function Tr(e){return Object.keys(e).length===0}var Xh=["__proto__","prototype","constructor"],Jh=function(e){return Xh.indexOf(e)===-1};function Sr(e,r){e.indexOf("[")>=0&&(e=e.replace(/\[/g,r).replace(/]/g,""));var t=e.split(r),n=t.filter(Jh);if(n.length!==t.length)throw Error("Refusing to update blacklisted property "+e);return t}var Ao=Object.prototype.hasOwnProperty;function ce(e,r,t,n){if(!(this instanceof ce))return new ce(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 Ot=new ce(".",!1,!0,!0);function We(e){return function(){return Ot[e].apply(Ot,arguments)}}ce.prototype._fill=function(e,r,t,n){var s=e.shift();if(e.length>0){if(r[s]=r[s]||(this.useArray&&Qh(e[0])?[]:{}),!Jt(r[s]))if(this.override)r[s]={};else{if(!(Jt(t)&&Tr(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&&Jt(r[s])&&!Tr(r[s])){if(!(Jt(t)&&Tr(t)))throw new Error("Trying to redefine non-empty obj['"+s+"']");return}r[s]=ht(t,n)}},ce.prototype.object=function(e,r){var t=this;return Object.keys(e).forEach(function(n){var s=r===void 0?null:r[n],o=Sr(n,t.separator).join(t.separator);o.indexOf(t.separator)!==-1?(t._fill(o.split(t.separator),e,e[n],s),delete e[n]):e[n]=ht(e[n],s)}),e},ce.prototype.str=function(e,r,t,n){var s=Sr(e,this.separator).join(this.separator);return e.indexOf(this.separator)!==-1?this._fill(s.split(this.separator),t,r,n):t[e]=ht(r,n),t},ce.prototype.pick=function(e,r,t,n){var s,o,i,a,c;for(o=Sr(e,this.separator),s=0;s<o.length;s++)if(a=Zh(o[s],r),r&&typeof r=="object"&&a in r){if(s===o.length-1)return t?(i=r[a],n&&Array.isArray(r)?r.splice(a,1):delete r[a],Array.isArray(r)&&(c=o.slice(0,-1).join("."),this.cleanup.indexOf(c)===-1&&this.cleanup.push(c)),i):r[a];r=r[a]}else return;return t&&Array.isArray(r)&&(r=r.filter(function(d){return d!==void 0})),r},ce.prototype.delete=function(e,r){return this.remove(e,r,!0)},ce.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)},ce.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(o){return o!==void 0}),this.set(this.cleanup[t],r,e);this.cleanup=[]}},ce.prototype.del=ce.prototype.remove,ce.prototype.move=function(e,r,t,n,s){return typeof n=="function"||Array.isArray(n)?this.set(r,ht(this.pick(e,t,!0),n),t,s):(s=n,this.set(r,this.pick(e,t,!0),t,s)),t},ce.prototype.transfer=function(e,r,t,n,s,o){return typeof s=="function"||Array.isArray(s)?this.set(r,ht(this.pick(e,t,!0),s),n,o):(o=s,this.set(r,this.pick(e,t,!0),n,o)),n},ce.prototype.copy=function(e,r,t,n,s,o){return typeof s=="function"||Array.isArray(s)?this.set(r,ht(JSON.parse(JSON.stringify(this.pick(e,t,!1))),s),n,o):(o=s,this.set(r,this.pick(e,t,!1),n,o)),n},ce.prototype.set=function(e,r,t,n){var s,o,i,a;if(typeof r>"u")return t;for(i=Sr(e,this.separator),s=0;s<i.length;s++){if(a=i[s],s===i.length-1)if(n&&Pr(r)&&Pr(t[a]))for(o in r)Ao.call(r,o)&&(t[a][o]=r[o]);else if(n&&Array.isArray(t[a])&&Array.isArray(r))for(var c=0;c<r.length;c++)t[i[s]].push(r[c]);else t[a]=r;else(!Ao.call(t,a)||!Pr(t[a])&&!Array.isArray(t[a]))&&(/^\d+$/.test(i[s+1])?t[a]=[]:t[a]={});t=t[a]}return t},ce.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},ce.prototype.dot=function(e,r,t){r=r||{},t=t||[];var n=Array.isArray(e);return Object.keys(e).forEach((function(s){var o=n&&this.useBrackets?"["+s+"]":s;if(Jt(e[s])&&(Pr(e[s])&&!Tr(e[s])||Array.isArray(e[s])&&!this.keepArray&&e[s].length!==0))if(n&&this.useBrackets){var i=t[t.length-1]||"";return this.dot(e[s],r,t.slice(0,-1).concat(i+o))}else return this.dot(e[s],r,t.concat(o));else n&&this.useBrackets?r[t.join(this.separator).concat("["+s+"]")]=e[s]:r[t.concat(o).join(this.separator)]=e[s]}).bind(this)),r},ce.pick=We("pick"),ce.move=We("move"),ce.transfer=We("transfer"),ce.transform=We("transform"),ce.copy=We("copy"),ce.object=We("object"),ce.str=We("str"),ce.set=We("set"),ce.delete=We("delete"),ce.del=ce.remove=We("remove"),ce.dot=We("dot"),["override","overwrite"].forEach(function(e){Object.defineProperty(ce,e,{get:function(){return Ot.override},set:function(r){Ot.override=!!r}})}),["useArray","keepArray","useBrackets"].forEach(function(e){Object.defineProperty(ce,e,{get:function(){return Ot[e]},set:function(r){Ot[e]=r}})}),ce._process=ht;var ep=ce;const Er=Hr(ep),tp=({name:e,label:r,value:t,data:n,textField:s,valueField:o,readOnly:i=!1,orientation:a=Ie.Horizontal,isMultiSelect:c=!1,className:d,onChange:h,itemTemplate:p})=>{const[v,y]=f.useState(),[x,D]=f.useState([]),O=cr(()=>n,[n]),P=f.useId();f.useEffect(()=>{if(c){const j=Array.isArray(t)?t.map(k=>k.toString()):t?[String(t)]:void 0;D(j??[])}else t&&y(t.toString())},[t]);const R=j=>c?x.findIndex(k=>k===j)>-1:v===j,z=j=>{const k=j.toString();if(c){const G=R(k);let N;G?N=x.filter(W=>W!=k):N=[...x,k],D(N),h==null||h({name:e,value:N})}else k!==v&&(y(k),h==null||h({name:e,value:k}))},$=j=>{const{value:k}=j.target;y(k),h==null||h({name:e,value:k})},g=j=>{const{value:k,checked:G}=j.target;let N;G?N=[...x,k]:N=x.filter(W=>W!=k),D(N),h==null||h({name:e,value:N})},L=(j,k,G,N)=>l.jsxs("label",{htmlFor:j,className:N,children:[l.jsx("input",{id:j,name:e,value:G,type:"checkbox",onChange:g,checked:R(G),className:"bsc-appearance-none"}),k]},j),C=(j,k,G,N)=>l.jsxs("label",{htmlFor:j,className:N,children:[l.jsx("input",{id:j,name:e,value:G,type:"radio",onChange:$,checked:R(G),className:"bsc-appearance-none"}),k]},j),U=ir(At.FocusWithin),B=f.useCallback((j,k)=>l.jsx(l.Fragment,{children:k}),[]),se=p||B,re=(j,k,G)=>{const N=`element_${P}_${k}`,W=Er.pick(s,j),b=String(Er.pick(o,j)),T=k===0,V=k===G.length-1,S=le("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":!i,"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":i,"bsc-border-t bsc-border-l bsc-border-b bsc-rounded-l-md bsc-pl-2":T&&a===Ie.Horizontal,"bsc-border-t bsc-border-r bsc-border-l bsc-border-b bsc-rounded-r-md bsc-pr-2":V&&a===Ie.Horizontal,"bsc-border-t bsc-border-b":!T&&!V&&a===Ie.Horizontal,"bsc-border-l":!T&&a===Ie.Horizontal,"bsc-border-l bsc-border-r bsc-border-t bsc-rounded-t-md":T&&a===Ie.Vertical,"bsc-border bsc-rounded-b-md":V&&a===Ie.Vertical,"bsc-border-t bsc-border-l bsc-border-r":!T&&!V&&a===Ie.Vertical},U),H={itemId:N,selectedValue:c?x:v,itemText:W,itemValue:b,itemData:j,itemStyles:S,isSelected:R(b),isFirstItem:T,isLastItem:V,onItemChanged:z};return c?l.jsx(lt,{props:H,template:se,children:L(N,W,b,S)}):l.jsx(lt,{props:H,template:se,children:C(N,W,b,S)})},ee=le("bsc-flex bsc-flex-col bsc-gap-2",d),I=le("bsc-flex",{"bsc-flex-col [width:max-content]":a===Ie.Vertical}),F=j=>l.jsx("div",{className:I,children:j.map(re)});return l.jsxs("div",{className:ee,children:[r&&l.jsx(Ze,{label:r,readOnly:i}),O&&F(O)]})},rp=f.memo(tp),np=({id:e,name:r,label:t,value:n,checked:s=!1,labelLocation:o=Ae.Right,readOnly:i=!1,useAnimation:a,onChange:c})=>{const d=Wr(a),h=f.useCallback(y=>{c==null||c(y)},[c]),p=le("bc-radio-item-wrapper bsc-flex bsc-items-center *:bsc-cursor-pointer",{"bc-read-only":i}),v=le("bc-radio-item-outer bsc-relative *:bsc-size-[21px]",{"bsc-pl-1":o===Ae.Left,"bsc-pr-1":o===Ae.Right,"bsc-radio-item-animate":!i&&d,"bsc-radio-item":!i,"bc-read-only bsc-radio-item-read-only":i});return l.jsxs("div",{className:p,children:[o===Ae.Left&&l.jsx(Ze,{label:t,htmlFor:e,readOnly:i}),l.jsxs("label",{className:v,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})]})]}),o===Ae.Right&&l.jsx(Ze,{label:t,htmlFor:e,readOnly:i})]})},sp=f.memo(np),op=({name:e,label:r,value:t,data:n,textField:s,valueField:o,readOnly:i=!1,labelLocation:a=Ae.Right,orientation:c=Ie.Vertical,className:d,useAnimation:h,onChange:p})=>{const[v,y]=f.useState(t),x=cr(()=>n,[n]),D=f.useId(),O=f.useCallback(g=>{const L=g.target.value;y(L),p==null||p({name:e,value:L,originalEvent:g})},[e]),P=(g,L)=>{const C=`${D}_radio_${L}`,U=Er.pick(o,g);return l.jsx(sp,{id:C,name:e,label:Er.pick(s,g),value:U,checked:U==v,labelLocation:a,readOnly:i,useAnimation:h,onChange:O},C)},R=le("bc-radio-container bsc-flex bsc-flex-col bsc-gap-1",d),z=le("bc-radio-wrapper bsc-flex bsc-gap-1",{"bsc-flex-col":c===Ie.Vertical,"[&>*]:bsc-pr-2":c===Ie.Horizontal}),$=g=>l.jsx("div",{className:z,children:g.map(P)});return l.jsxs("div",{className:R,children:[r&&l.jsx(Ze,{label:r,readOnly:i}),x&&$(x)]})},ip=f.memo(op),ap=({name:e,label:r,value:t,checked:n=!1,readOnly:s=!1,useAnimation:o,className:i,onChange:a})=>{const[c,d]=f.useState(!1),h=f.useId(),p=Wr(o);f.useEffect(()=>{d(n)},[n]);const v=P=>{const{checked:R}=P.target;d(R),a==null||a({originalEvent:P,name:e||P.target.name,value:t||P.target.value,checked:R})},y=le("bc-toggle-wrapper bsc-flex bsc-flex-col",i),x=ir(At.FocusWithin),D=le("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},x),O=le("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:y,children:[r&&l.jsx(Ze,{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:v,className:"bsc-appearance-none"}),l.jsx("div",{id:"switch",className:O})]})]})},cp=f.memo(ap),Pp="";J.BeeSoftProvider=Bo,J.Button=Ve,J.Checkbox=Zn,J.CheckboxGroup=yi,J.ContentEditableInput=hr,J.DateFormatType=Xt,J.DateSelectionType=ge,J.DateTime=Kh,J.FormGroupItemOrientation=Ie,J.FormattedInput=jo,J.GroupButton=rp,J.MediaQuery=bn,J.MobileOverlayPanel=Co,J.OverlayPanel=Oo,J.RadioButton=ip,J.SelectionLabelLocation=Ae,J.Toggle=cp,J.applyBeeSoftTheme=ai,J.createBeeSoftTheme=ci,Object.defineProperty(J,Symbol.toStringTag,{value:"Module"})});
|
|
55
|
+
Valid keys: `+JSON.stringify(Object.keys(b),null," "));var _=te(Y,E,H,K,A+"."+E,t);if(_)return _}return null}return O(T)}function F(b){switch(typeof b){case"number":case"string":case"undefined":return!0;case"boolean":return!b;case"object":if(Array.isArray(b))return b.every(F);if(b===null||a(b))return!0;var T=p(b);if(T){var V=T.call(b),S;if(T!==b.entries){for(;!(S=V.next()).done;)if(!F(S.value))return!1}else for(;!(S=V.next()).done;){var H=S.value;if(H&&!F(H[1]))return!1}}else return!1;return!0;default:return!1}}function j(b,T){return b==="symbol"?!0:T?T["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&T instanceof Symbol:!1}function k(b){var T=typeof b;return Array.isArray(b)?"array":b instanceof RegExp?"object":j(T,b)?"symbol":T}function G(b){if(typeof b>"u"||b===null)return""+b;var T=k(b);if(T==="object"){if(b instanceof Date)return"date";if(b instanceof RegExp)return"regexp"}return T}function N(b){var T=G(b);switch(T){case"array":case"object":return"an "+T;case"boolean":case"date":case"regexp":return"a "+T;default:return T}}function W(b){return!b.constructor||!b.constructor.name?v:b.constructor.name}return y.checkPropTypes=s,y.resetWarningCache=s.resetWarningCache,y.PropTypes=y,y},En}var Cn,wo;function hh(){if(wo)return Cn;wo=1;var e=Pn();function r(){}function t(){}return t.resetWarningCache=r,Cn=function(){function n(i,a,c,d,h,p){if(p!==e){var v=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 v.name="Invariant Violation",v}}n.isRequired=n;function s(){return n}var o={array:n,bigint:n,bool:n,func:n,number:n,object:n,string:n,symbol:n,any:n,arrayOf:s,element:n,elementType:n,instanceOf:s,node:n,objectOf:s,oneOf:s,oneOfType:s,shape:s,exact:s,checkPropTypes:t,resetWarningCache:r};return o.PropTypes=o,o},Cn}if(process.env.NODE_ENV!=="production"){var ph=po(),mh=!0;vn.exports=dh()(ph.isElement,mh)}else vn.exports=hh()();var gh=vn.exports;const ne=Hr(gh),Po={disabled:!1};var bh=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 To=f.createContext(null);var yh=function(r){return r.scrollTop},Kt="unmounted",ft="exited",dt="entering",Ct="entered",kn="exiting",Je=function(e){ah(r,e);function r(n,s){var o;o=e.call(this,n,s)||this;var i=s,a=i&&!i.isMounting?n.enter:n.appear,c;return o.appearStatus=null,n.in?a?(c=ft,o.appearStatus=dt):c=Ct:n.unmountOnExit||n.mountOnEnter?c=Kt:c=ft,o.state={status:c},o.nextCallback=null,o}r.getDerivedStateFromProps=function(s,o){var i=s.in;return i&&o.status===Kt?{status:ft}:null};var t=r.prototype;return t.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},t.componentDidUpdate=function(s){var o=null;if(s!==this.props){var i=this.state.status;this.props.in?i!==dt&&i!==Ct&&(o=dt):(i===dt||i===Ct)&&(o=kn)}this.updateStatus(!1,o)},t.componentWillUnmount=function(){this.cancelNextCallback()},t.getTimeouts=function(){var s=this.props.timeout,o,i,a;return o=i=a=s,s!=null&&typeof s!="number"&&(o=s.exit,i=s.enter,a=s.appear!==void 0?s.appear:i),{exit:o,enter:i,appear:a}},t.updateStatus=function(s,o){if(s===void 0&&(s=!1),o!==null)if(this.cancelNextCallback(),o===dt){if(this.props.unmountOnExit||this.props.mountOnEnter){var i=this.props.nodeRef?this.props.nodeRef.current:He.findDOMNode(this);i&&yh(i)}this.performEnter(s)}else this.performExit();else this.props.unmountOnExit&&this.state.status===ft&&this.setState({status:Kt})},t.performEnter=function(s){var o=this,i=this.props.enter,a=this.context?this.context.isMounting:s,c=this.props.nodeRef?[a]:[He.findDOMNode(this),a],d=c[0],h=c[1],p=this.getTimeouts(),v=a?p.appear:p.enter;if(!s&&!i||Po.disabled){this.safeSetState({status:Ct},function(){o.props.onEntered(d)});return}this.props.onEnter(d,h),this.safeSetState({status:dt},function(){o.props.onEntering(d,h),o.onTransitionEnd(v,function(){o.safeSetState({status:Ct},function(){o.props.onEntered(d,h)})})})},t.performExit=function(){var s=this,o=this.props.exit,i=this.getTimeouts(),a=this.props.nodeRef?void 0:He.findDOMNode(this);if(!o||Po.disabled){this.safeSetState({status:ft},function(){s.props.onExited(a)});return}this.props.onExit(a),this.safeSetState({status:kn},function(){s.props.onExiting(a),s.onTransitionEnd(i.exit,function(){s.safeSetState({status:ft},function(){s.props.onExited(a)})})})},t.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},t.safeSetState=function(s,o){o=this.setNextCallback(o),this.setState(s,o)},t.setNextCallback=function(s){var o=this,i=!0;return this.nextCallback=function(a){i&&(i=!1,o.nextCallback=null,s(a))},this.nextCallback.cancel=function(){i=!1},this.nextCallback},t.onTransitionEnd=function(s,o){this.setNextCallback(o);var i=this.props.nodeRef?this.props.nodeRef.current:He.findDOMNode(this),a=s==null&&!this.props.addEndListener;if(!i||a){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var c=this.props.nodeRef?[this.nextCallback]:[i,this.nextCallback],d=c[0],h=c[1];this.props.addEndListener(d,h)}s!=null&&setTimeout(this.nextCallback,s)},t.render=function(){var s=this.state.status;if(s===Kt)return null;var o=this.props,i=o.children;o.in,o.mountOnEnter,o.unmountOnExit,o.appear,o.enter,o.exit,o.timeout,o.addEndListener,o.onEnter,o.onEntering,o.onEntered,o.onExit,o.onExiting,o.onExited,o.nodeRef;var a=ih(o,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return f.createElement(To.Provider,{value:null},typeof i=="function"?i(s,a):f.cloneElement(f.Children.only(i),a))},r}(f.Component);Je.contextType=To,Je.propTypes=process.env.NODE_ENV!=="production"?{nodeRef:ne.shape({current:typeof Element>"u"?ne.any:function(e,r,t,n,s,o){var i=e[r];return ne.instanceOf(i&&"ownerDocument"in i?i.ownerDocument.defaultView.Element:Element)(e,r,t,n,s,o)}}),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=bh;r.addEndListener||(t=t.isRequired);for(var n=arguments.length,s=new Array(n>1?n-1:0),o=1;o<n;o++)s[o-1]=arguments[o];return 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 kt(){}Je.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:kt,onEntering:kt,onEntered:kt,onExit:kt,onExiting:kt,onExited:kt},Je.UNMOUNTED=Kt,Je.EXITED=ft,Je.ENTERING=dt,Je.ENTERED=Ct,Je.EXITING=kn;const vh=Je,So=({start:e,timeout:r=400,defaultStyle:t,transitionStyles:n,showTransitionOptions:s="cubic-bezier(0, 0, 0.2, 1)",hideTransitionOptions:o="linear",unmountOnExit:i=!1,onEntering:a,onEntered:c,onExit:d,onExited:h,children:p})=>{const v=t||{transition:`opacity ${r}ms ${s}`,opacity:0},y=n||{entering:{opacity:1},entered:{opacity:1},exiting:{transition:`opacity ${r}ms ${o}`,opacity:0},exited:{transition:`opacity ${r}ms ${o}`,opacity:0},unmounted:{}};return l.jsx(vh,{in:e,timeout:r,onEntering:a,onEntered:c,onExit:d,onExited:h,unmountOnExit:i,children:x=>p({state:x,defaultStyle:v,transitionStyles:y})})};function Eo(e){return e.target?e.target:e}const Co=({visible:e,target:r,appendTo:t=document.body,unmountWhenHidden:n=!1,transitionDuration:s=400,showTransitionOptions:o="cubic-bezier(0, 0, 0.2, 1)",hideTransitionOptions:i="linear",approveText:a="DONE",shown:c,hidden:d,isClickedWithin:h,children:p})=>{const[v,y]=f.useState(-1),[x,D]=f.useState(-1),[O,P]=f.useState(e),R=f.useRef(100),z=f.useRef(101),$=f.useRef(),g=f.useRef(),L=f.useRef();f.useEffect(()=>{r&&($.current=Eo(r));const I=Kn("zIndex",F=>F==="auto"||F==="-1"?!1:parseInt(F)>100).map(F=>parseInt(F,10));I.length>0&&(R.current=Math.max(...I)+1,z.current=Math.max(...I)+2),P(e)},[e,r]);const C=I=>{g.current=I},U=()=>{D(R.current),y(z.current)},B=()=>{if(!g.current)return;c==null||c();let I;$.current&&(I=[$.current]);const F=j=>{j?h==null||h():P(!1)};L.current=co(g.current,F,I)},se=()=>{L.current&&uo(L.current)},re=()=>{D(-1),y(-1),d==null||d()},ee={entering:{opacity:.5},entered:{opacity:.5}};return He.createPortal(l.jsx(So,{start:O,timeout:s,showTransitionOptions:o,hideTransitionOptions:i,onEntering:U,onEntered:B,onExit:se,onExited:re,unmountOnExit:n,children:({state:I,defaultStyle:F,transitionStyles:j})=>l.jsxs("div",{ref:k=>k&&C(k),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:x,...j[I],...ee[I]}}),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:v,...F,...j[I]},children:[l.jsx("div",{className:"bsc-w-full",children:p}),l.jsx(l.Fragment,{children:l.jsx(Ve,{buttonType:"primary",fullWidth:!0,onClick:()=>P(!1),className:"bsc-text-xs bsc-font-bold",children:a})})]})]})}),t)};var ko=(e=>(e[e.TopLeft=0]="TopLeft",e[e.TopRight=1]="TopRight",e[e.BottomLeft=2]="BottomLeft",e[e.BottomRight=3]="BottomRight",e))(ko||{}),Do=(e=>(e[e.TopLeft=0]="TopLeft",e[e.TopRight=1]="TopRight",e[e.BottomLeft=2]="BottomLeft",e[e.BottomRight=3]="BottomRight",e))(Do||{});class we{static positionToTarget(r,t=2){const n=r.getBoundingClientRect();let s=0,o=0;const i=window.scrollY;switch(t){case 2:s=n.top+n.height+i,o=n.left;break;case 0:s=n.top+i,o=n.left;break;case 3:s=n.top+n.height+i,o=n.left+n.width;break;case 1:s=n.top+i,o=n.left+n.width}return{top:s,left:o}}static positionElementToTarget(r,t,n=0,s=2){let{left:o,top:i}=we.positionToTarget(t,s);const a=r.getBoundingClientRect();switch(n){case 0:break;case 1:o=o-a.width;break;case 2:i=i-a.height;break;case 3:i=i-a.height,o=o-a.width;break}return{top:i,left:o}}static canPositionElementOnScreenWithTarget(r,t){const n=we.getScreenDimensions(),s=r.getBoundingClientRect(),o=we.positionElementToTarget(r,t,0,2);if(o.left+s.width<n.width&&o.top+s.height<n.height||we.positionElementToTarget(r,t,1,3).left>=0&&o.top+s.height<n.height)return!0;const a=we.positionElementToTarget(r,t,2,0);if(a.left+s.width<n.width&&a.top>=0)return!0;const c=we.positionElementToTarget(r,t,3,1);return c.left>=0&&c.top>=0}static canPositionElementOnScreen(r){const t=we.getScreenDimensions(),n=r.getBoundingClientRect();return n.width<=t.width&&n.height<=t.height}static positionElementToTargetOnScreen(r,t,n=0,s=2){const{left:o,top:i}=we.positionElementToTarget(r,t,n,s),a=r.getBoundingClientRect(),c=we.determineOffScreenLocation(a);if(c){if(n===0&&s===2){if(c.right&&!c.bottom)return we.positionElementToTarget(r,t,1,3);if(c.bottom&&!c.right)return we.positionElementToTarget(r,t,2,0);if(c.right&&c.bottom)return we.positionElementToTarget(r,t,3,1)}else if(n===1&&s===3){if(c.left&&!c.bottom)return we.positionElementToTarget(r,t,0,2);if(c.bottom&&!c.left)return we.positionElementToTarget(r,t,3,1);if(c.left&&c.bottom)return we.positionElementToTarget(r,t,2,0)}}return{top:i,left:o}}static determineOffScreenLocation(r){const t=we.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 Oo=({visible:e,target:r,targetPosition:t=ko.BottomLeft,elementAlignment:n=Do.TopLeft,shouldTargetCloseOverlay:s=!0,shouldMatchTargetWidth:o=!1,shouldScrollCloseOverlay:i=!1,shouldCheckZIndex:a=!1,shouldRemainOnScreen:c=!1,unmountWhenHidden:d=!1,transitionDuration:h=400,showTransitionOptions:p="cubic-bezier(0, 0, 0.2, 1)",hideTransitionOptions:v="linear",shown:y,hidden:x,isClickedWithin:D,markupCreated:O,children:P})=>{const[R,z]=f.useState(-1),[$,g]=f.useState(e),[L,C]=f.useState(!1),U=f.useRef(!1),B=f.useRef(100),se=f.useRef({left:0,top:0,width:0}),re=f.useRef(),ee=f.useRef(),I=f.useRef(),F=f.useRef(),j=f.useRef(),k=f.useRef(),G=Fn();f.useEffect(()=>(c===!0&&(k.current=new ResizeObserver(N)),()=>{var A,Y;c===!0&&(ee.current&&((A=k.current)==null||A.unobserve(ee.current)),(Y=k.current)==null||Y.disconnect())}),[]),f.useEffect(()=>{if(r&&(re.current=Eo(r),i)){const A=G==null?void 0:G.isValidScrollableElement;I.current=Gn(re.current,{overflow:"scroll, auto",overflowX:"scroll, auto",overflowY:"scroll, auto"},!1,A),I.current.tagName.toLowerCase()==="html"&&(I.current=document)}if(a){const A=Kn("zIndex",Y=>parseInt(Y)>=100).map(Y=>parseInt(Y));A.length>0&&(B.current=Math.max(...A)+1)}e!==void 0&&g(e)},[r,e,i,a]);const N=A=>{if(ee.current){const Y=we.getScreenDimensions(),q=A[A.length-1].target,Q=q.getBoundingClientRect(),E=we.determineOffScreenLocation(Q);if(E){if(re.current&&we.canPositionElementOnScreenWithTarget(q,re.current)){const te=we.positionElementToTargetOnScreen(ee.current,re.current,n,t);se.current={...se.current,...te}}else E.right?se.current.left=Y.width-Q.width:E.left&&(se.current.left=0),E.bottom?se.current.top=Y.height-Q.height:E.top&&(se.current.top=0);W()}}},W=Vt(()=>{U.current=!U.current,C(U.current)},20),b=()=>{z(B.current)},T=()=>{if(!ee.current)return;y==null||y();let A;!s&&re.current&&(A=[re.current]);const Y=q=>{q?D==null||D():g(!1)};F.current=co(ee.current,Y,A),i&&(j.current=Ml(q=>ee.current&&ni(q,ee.current)&&g(!1),100,{leading:!0}),I.current&&I.current.addEventListener("scroll",j.current))},V=()=>{I.current&&j.current&&(I.current.removeEventListener("scroll",j.current),j.current=void 0),F.current&&uo(F.current)},S=()=>{z(-1),x==null||x()},H=A=>{var Y,q;if(c===!0&&ee.current&&((Y=k.current)==null||Y.unobserve(ee.current)),ee.current=A,O==null||O(A),re.current){const Q=we.positionElementToTarget(ee.current,re.current,n,t);se.current={...Q,width:re.current.offsetWidth},c===!0&&(we.canPositionElementOnScreenWithTarget(ee.current,re.current)||we.canPositionElementOnScreen(ee.current))&&((q=k.current)==null||q.observe(ee.current))}},K=f.useMemo(()=>{const A={top:`${se.current.top}px`,left:`${se.current.left}px`,zIndex:R};return o&&(A.width=`${se.current.width}px`),A},[L,R,o]);return l.jsx(So,{start:$,timeout:h,showTransitionOptions:p,hideTransitionOptions:v,onEntering:b,onEntered:T,onExit:V,onExited:S,unmountOnExit:d,children:({state:A,defaultStyle:Y,transitionStyles:q})=>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:{...K,...Y,...q[A]},ref:Q=>Q&&H(Q),children:P})})};let yr;const xh=new Uint8Array(16);function wh(){if(!yr&&(yr=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!yr))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return yr(xh)}const Ne=[];for(let e=0;e<256;++e)Ne.push((e+256).toString(16).slice(1));function Ph(e,r=0){return Ne[e[r+0]]+Ne[e[r+1]]+Ne[e[r+2]]+Ne[e[r+3]]+"-"+Ne[e[r+4]]+Ne[e[r+5]]+"-"+Ne[e[r+6]]+Ne[e[r+7]]+"-"+Ne[e[r+8]]+Ne[e[r+9]]+"-"+Ne[e[r+10]]+Ne[e[r+11]]+Ne[e[r+12]]+Ne[e[r+13]]+Ne[e[r+14]]+Ne[e[r+15]]}const No={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Th(e,r,t){if(No.randomUUID&&!r&&!e)return No.randomUUID();e=e||{};const n=e.random||(e.rng||wh)();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 Ph(n)}class Zt{static create(r){const t=[];let n=0;for(let s=0,o=r.formatParts.length;s<o;s++){const i=r.formatParts[s],a=n,c=a+i.characterCount;t.push({startPosition:a,endPosition:c,...i}),n=c}return t}}class Sh{constructor(r,t){m(this,"instanceCollection");m(this,"formatPartList");m(this,"inputSlotCollection");m(this,"currentPartIndex",0);m(this,"currentPartIndices",[]);m(this,"currentCursorPosition",0);m(this,"highlightCursorPosition",0);m(this,"currentCursorStartPosition",-1);m(this,"currentCursorEndPosition",-1);m(this,"inputElement");m(this,"inputSelection",null);m(this,"inputRange");m(this,"textNode");this.instanceCollection=Dt.getInstance(),this.formatPartList=Zt.create(r),this.inputSlotCollection=this.instanceCollection.getInputSlotInstance(t,r)}get isSelection(){return this.inputRange!==void 0&&this.inputRange.startOffset!==this.inputRange.endOffset}get isAllSelected(){var t;const r=this.inputSlotCollection.getLastSlot();return this.isSelection&&((t=this.inputRange)==null?void 0:t.startOffset)===0&&this.inputRange.endOffset===r.endPosition}getCursorPosition(){return this.currentCursorPosition}getCursorStartPosition(){return this.currentCursorStartPosition}getCursorEndPosition(){return this.currentCursorEndPosition}getCurrentPartIndex(){return this.currentPartIndex}getCurrentPartIndices(){return this.currentPartIndices}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.currentPartIndices=[],t===void 0||r===t?(this.currentCursorPosition=t||r,this.highlightCursorPosition=t||r,this.currentCursorStartPosition=-1,this.currentCursorEndPosition=-1,this.setPartIndexByCursorPosition()):(r<t?(this.currentCursorStartPosition!==r?this.highlightCursorPosition=r:this.currentCursorEndPosition!==t&&(this.highlightCursorPosition=t),this.currentCursorStartPosition=r,this.currentCursorEndPosition=t):(this.currentCursorStartPosition!==t?this.highlightCursorPosition=t:this.currentCursorEndPosition!==r&&(this.highlightCursorPosition=r),this.currentCursorStartPosition=t,this.currentCursorEndPosition=r),this.currentCursorPosition=-1,this.setPartIndexByHighlightPosition(),this.setPartIndicesByCursorPositions()))}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 d=document.createRange();return d.selectNodeContents(c),d.compareBoundaryPoints(Range.END_TO_END,r)<1?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT});let o=0;for(;s.nextNode();)o+=((n=s.currentNode.textContent)==null?void 0:n.length)||0;r.startContainer.nodeType===Node.TEXT_NODE&&(o+=r.startOffset);const i=this.inputSlotCollection.getLastSlotWithData(),a=i.startPosition+i.partText.length;r.startOffset===r.endOffset?this.setCursorSelection(o>a?a:o):this.setCursorSelection(r.startOffset,r.endOffset)}}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.updateCursorPosition(),this.currentCursorPosition>0&&!this.isSelection){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--)if(t=this.formatPartList[n],r>=t.startPosition&&r<=t.endPosition){t.isSeparator?this.setCursorSelection(this.formatPartList[n-1].endPosition):this.setCursorSelection(r);break}}else this.isSelection?this.setCursorSelection(this.currentCursorPosition):this.moveHome()}moveCursorRight(){this.updateCursorPosition(!1);const r=this.inputSlotCollection.getLastSlotWithData(),t=r.startPosition+r.partText.length;if(this.currentCursorPosition<t&&!this.isSelection){const n=this.currentCursorPosition+1;let s=this.formatPartList[this.currentPartIndex];if(n>=s.startPosition&&n<=s.endPosition)this.setCursorSelection(n);else for(let o=this.currentPartIndex+1,i=this.formatPartList.length;o<i;o++)if(s=this.formatPartList[o],n>=s.startPosition&&n<=s.endPosition){s.isSeparator?this.setCursorSelection(this.formatPartList[o+1].startPosition):this.setCursorSelection(n);break}}else this.setCursorSelection(this.currentCursorPosition)}moveToNextInputPart(){if(this.currentPartIndex<this.formatPartList.length-1){const 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))}}highlightAll(){const r=this.formatPartList[this.formatPartList.length-1].endPosition;this.setCursorSelection(0,r)}moveHighlightLeft(){this.updateHighlightPositions();const r=this.highlightCursorPosition>this.currentCursorStartPosition;if(this.currentCursorStartPosition>0||r){let t=r?this.currentCursorStartPosition:this.currentCursorStartPosition-1,n=r?this.highlightCursorPosition-1:this.currentCursorEndPosition,s=this.formatPartList[this.currentPartIndex];if(t>=s.startPosition&&t<=s.endPosition||r&&n>=s.startPosition&&n<=s.endPosition)this.setCursorSelection(t,n);else for(let o=this.currentPartIndex-1;o>=0;o--)if(s=this.formatPartList[o],t>=s.startPosition&&t<=s.endPosition||r&&n>=s.startPosition&&n<=s.endPosition){s.isSeparator?(r?n=this.formatPartList[o-1].endPosition-1:t=this.formatPartList[o-1].endPosition-1,this.setCursorSelection(t,n)):this.setCursorSelection(t,n);break}}}moveHighlightRight(){this.updateHighlightPositions();const r=this.inputSlotCollection.getLastSlotWithData(),t=r.startPosition+r.partText.length,n=this.highlightCursorPosition<this.currentCursorEndPosition;if(this.currentCursorEndPosition<t||n){let s=n?this.highlightCursorPosition+1:this.currentCursorStartPosition,o=n?this.currentCursorEndPosition:this.currentCursorEndPosition+1,i=this.formatPartList[this.currentPartIndex];if(o>=i.startPosition&&o<=i.endPosition||n&&s>=i.startPosition&&s<=i.endPosition)this.setCursorSelection(s,o);else for(let a=this.currentPartIndex+1,c=this.formatPartList.length;a<c;a++)if(i=this.formatPartList[a],o>=i.startPosition&&o<=i.endPosition||n&&s>=i.startPosition&&s<=i.endPosition){i.isSeparator?(n?s=this.formatPartList[a+1].startPosition+1:o=this.formatPartList[a+1].startPosition+1,this.setCursorSelection(s,o)):this.setCursorSelection(s,o);break}}}updateHighlightPositions(){this.currentCursorStartPosition===-1&&this.currentCursorEndPosition===-1&&this.currentCursorPosition>-1&&(this.currentCursorStartPosition=this.currentCursorPosition,this.currentCursorEndPosition=this.currentCursorPosition,this.highlightCursorPosition=this.currentCursorPosition)}updateCursorPosition(r=!0){this.currentCursorPosition===-1&&this.currentCursorStartPosition>-1&&this.currentCursorEndPosition>-1&&(r?this.currentCursorPosition=this.currentCursorStartPosition:this.currentCursorPosition=this.currentCursorEndPosition)}findNextEditablePart(){return this.inputSlotCollection.getNextSlot(this.currentPartIndex)}findPreviousEditablePart(){return this.inputSlotCollection.getPreviousSlot(this.currentPartIndex)}setPartIndexByCursorPosition(){for(let 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}}}setPartIndexByHighlightPosition(){for(let r=0;r<this.formatPartList.length;r++){const t=this.formatPartList[r];if(this.highlightCursorPosition>=t.startPosition&&this.highlightCursorPosition<=t.endPosition){if(t.isSeparator){this.highlightCursorPosition=this.formatPartList[r+1].startPosition,this.currentPartIndex=r+1;break}this.currentPartIndex=r;break}}}setPartIndicesByCursorPositions(){for(let r=0,t=this.formatPartList.length;r<t;r++){const n=this.formatPartList[r];n.isSeparator||(n.startPosition>=this.currentCursorStartPosition&&n.startPosition<=this.currentCursorEndPosition||n.endPosition>=this.currentCursorStartPosition&&n.endPosition<=this.currentCursorEndPosition||n.startPosition<this.currentCursorStartPosition&&n.endPosition>this.currentCursorEndPosition)&&this.currentPartIndices.push(r)}}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 Eh{static create(r){const t=[];for(let n=0,s=r.length;n<s;n++){const o=r[n];o.isSeparator||t.push({partIndex:n,partText:"",isComplete:!1,...o})}return t}}class Ch{constructor(r){m(this,"inputSlots");this.inputSlots=Eh.create(Zt.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)}getSlots(r){return this.inputSlots.filter(t=>r.includes(t.partIndex))}getSlotsFromCursorPosition(r){let t=-1;for(let n=0,s=this.inputSlots.length;n<s;n++){const o=this.inputSlots[n];if(r>=o.startPosition&&r<=o.endPosition){t=n;break}}return t>-1?this.inputSlots.filter(n=>n.partIndex>=t):void 0}getFirstSlot(){return this.inputSlots[0]}getLastSlot(){return this.inputSlots[this.inputSlots.length-1]}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 Dt{static getInstance(){return this.instance||(this.instance=new kh),this.instance}}m(Dt,"instance");class kh{constructor(){m(this,"navigatorInstances");m(this,"inputSlotInstances");this.navigatorInstances={},this.inputSlotInstances={}}getNavigatorInstance(r,t){return this.navigatorInstances[r]||(this.navigatorInstances[r]=new Sh(t,r)),this.navigatorInstances[r]}getInputSlotInstance(r,t){return this.inputSlotInstances[r]||(this.inputSlotInstances[r]=new Ch(t)),this.inputSlotInstances[r]}removeInstances(r){this.navigatorInstances[r]&&delete this.navigatorInstances[r],this.inputSlotInstances[r]&&delete this.inputSlotInstances[r]}}class Dn{constructor(r,t){m(this,"instanceCollection");m(this,"formatPartList");m(this,"inputSlotCollection");m(this,"inputElement");this.instanceCollection=Dt.getInstance(),this.formatPartList=Zt.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 o=this.formatPartList[n];if(o.isSeparator)r+=o.inputText;else{const i=this.inputSlotCollection.getSlot(n);i&&(r+=i.partText+((t=i.inputText)==null?void 0:t.repeat(i.characterCount-i.partText.length)))}}this.inputElement&&(this.inputElement.innerHTML=r)}}var qe=(e=>(e[e.Text=0]="Text",e[e.Numeric=1]="Numeric",e))(qe||{});class _o{constructor(){m(this,"numberKeys",["0","1","2","3","4","5","6","7","8","9"]);m(this,"movementKeys",["ArrowLeft","ArrowRight","Home","End","a"]);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 Dh{constructor(r){m(this,"_currentIndex",0);m(this,"index",0);m(this,"formatParts");this.formatParts=Zt.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 Oh{constructor(r){m(this,"formatParts");this.formatParts=Zt.create(r)}getUniqueSeparators(){const r=[],t=this.formatParts.filter(n=>n.isSeparator);for(let n=0,s=t.length;n<s;n++){const o=t[n];o.inputText&&!r.includes(o.inputText)&&r.push(o.inputText)}return r}}class Io{constructor(r,t){m(this,"instanceCollection");m(this,"inputSlotCollection");m(this,"formatNavigator");m(this,"keyTypeChecker");m(this,"formatRenderer");m(this,"formatPartList");m(this,"partEntryList");this.format=r,this.instanceCollection=Dt.getInstance(),this.inputSlotCollection=this.instanceCollection.getInputSlotInstance(t,r),this.formatNavigator=this.instanceCollection.getNavigatorInstance(t,r),this.keyTypeChecker=new _o,this.formatRenderer=new Dn(r,t),this.formatPartList=new Dh(r),this.partEntryList=new Oh(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 o=this.formatPartList.currentIndex,i=this.formatPartList.next();if(i&&i.inputText){const a=r.indexOf(i.inputText,t),c=this.inputSlotCollection.getSlot(o);if(c&&a>-1){const d=a-t>c.characterCount?t+c.characterCount:a;c.partText=r.substring(t,d),this.processSlotRules(c),t=a+i.characterCount}}}else{const o=this.inputSlotCollection.getSlot(this.formatPartList.currentIndex);o&&(o.partText=r.substring(t,t+o.characterCount),this.processSlotRules(o))}}}processPastedValue(r,t=!1){t&&this.processSelectionEditRules();const n=this.formatNavigator.getCursorPosition(),s=this.inputSlotCollection.getSlotsFromCursorPosition(n);if(s){const o=n-s[0].startPosition,i=s[0].partText.substring(0,o);let a=s[0].partText.substring(o);s[0].partText="";for(let p=1,v=s.length;p<v;p++)a+=s[p].partText,s[p].partText="";const c=this.removeSeparatorsFromValue(r),d=i+c+a;let h=0;for(let p=0,v=s.length;p<v;p++){const y=s[p];y.partText=d.substring(h,y.characterCount+h),h+=y.characterCount,this.processSlotRules(y)}}}removeSeparatorsFromValue(r){let t=r;const n=this.partEntryList.getUniqueSeparators();for(let s=0,o=n.length;s<o;s++){const i=n[s];t=t.replace(i,"")}return t}processEditRules(r){this.formatNavigator.isSelection?this.processSelectionEditRules(r):this.processNonSelectionEditRules(r)}processNonSelectionEditRules(r){const t=this.inputSlotCollection.getSlot(this.formatNavigator.getCurrentPartIndex());if(!t)return;const n=this.formatNavigator.getCursorPosition(),s=n-t.startPosition,o=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),o&&this.shiftFormatParts(t),this.formatRenderer.render(),this.formatNavigator.moveCursorLeft(),this.processSlotRules(t,!0);else{this.processSlotRules(t,!0);const a=this.inputSlotCollection.getPreviousSlot(t.partIndex);a&&(a.partText=a.partText.substring(0,a.partText.length-1),o&&this.shiftFormatParts(a),this.formatRenderer.render(),this.formatNavigator.setCursorPosition(a.startPosition+a.partText.length),this.processSlotRules(a,!0))}break}case"Delete":t.partText=t.partText.substring(0,s)+t.partText.substring(s+1),o&&this.shiftFormatParts(t),this.formatRenderer.render(),this.formatNavigator.setCursorToCurrentPosition(),this.processSlotRules(t,!0);break}}processSelectionEditRules(r){const t=this.inputSlotCollection.getSlots(this.formatNavigator.getCurrentPartIndices());if(t.length<=0)return;const n=this.formatNavigator.getCursorStartPosition(),s=this.formatNavigator.getCursorEndPosition();for(let o=0,i=t.length;o<i;o++){const a=t[o];a.startPosition>=n&&a.endPosition<=s?a.partText="":a.startPosition>=n&&a.endPosition>s?a.partText=a.partText.substring(s-a.startPosition):a.startPosition<n&&a.endPosition<=s?a.partText=a.partText.substring(0,n-a.startPosition):a.startPosition<n&&a.endPosition>s&&(a.partText=a.partText.substring(0,n-a.startPosition)+a.partText.substring(s-a.startPosition))}this.formatRenderer.render(),!r||r.key==="Backspace"?this.formatNavigator.setCursorPosition(s):this.formatNavigator.setCursorPosition(n);for(let o=0,i=t.length;o<i;o++)this.processSlotRules(t[o])}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,o=t.partText;if(t.valueType===qe.Numeric){if(!this.keyTypeChecker.isNumberKey(n))return;const i=t.maximumValue,a=t.exceedingMaximumValueCausesTab||!1,c=t.padWithZeros||!1,d=parseInt(this.createNewValue(t,n));if(i&&d>i)if(a){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 o.length+1===s?(this.addToInputSlot(n),t.isComplete=!0,this.formatRenderer.render(),this.formatNavigator.isAtLastPart()?this.formatNavigator.moveCursorRight():this.formatNavigator.moveToNextInputPart()):o.length+1<s&&(this.addToInputSlot(n),this.formatRenderer.render(),this.formatNavigator.moveCursorRight())}else o.length+1===s?(this.addToInputSlot(n),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 o=s-r.startPosition;return n.substring(0,o)+t+n.substring(o)}}processSlotRules(r,t=!1){const n=r.characterCount,s=r.allCharactersRequired||!1;if(r.valueType===qe.Numeric){const o=r.minimumValue,i=r.maximumValue;if(s)r.isComplete=r.partText.length===n;else if(o!==void 0&&i!==void 0){const a=r.padWithZeros||!1,c=parseInt(r.partText);r.isComplete=c>=o&&c<=i,r.isComplete&&a&&!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 Nh{constructor(r,t){m(this,"instanceCollection");m(this,"formatNavigator");m(this,"ruleProcessor");m(this,"keyTypeChecker");m(this,"formatRenderer");this.format=r,this.instanceCollection=Dt.getInstance(),this.formatNavigator=this.instanceCollection.getNavigatorInstance(t,r),this.ruleProcessor=new Io(r,t),this.keyTypeChecker=new _o,this.formatRenderer=new Dn(r,t)}setInputElement(r){this.ruleProcessor.setInputElement(r),this.formatRenderer.setInputElement(r)}processMovementKey(r){const{key:t,metaKey:n,ctrlKey:s,shiftKey:o}=r;switch(t){case"ArrowLeft":o?this.formatNavigator.moveHighlightLeft():n?this.formatNavigator.moveHome():this.formatNavigator.moveCursorLeft();break;case"ArrowRight":o?this.formatNavigator.moveHighlightRight():n?this.formatNavigator.moveEnd():this.formatNavigator.moveCursorRight();break;case"Home":this.formatNavigator.moveHome();break;case"End":this.formatNavigator.moveEnd();break;case"a":(n||s)&&this.formatNavigator.highlightAll();break}}processKeyPress(r){return this.keyTypeChecker.isIgnoreKey(r)?!1:this.keyTypeChecker.isMovementKey(r)?(this.processMovementKey(r),!1):(this.ruleProcessor.processKeyPress(r),!0)}}class _h{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=Th(),this.instanceCollection=Dt.getInstance(),this.keyProcessor=new Nh(r,this.instanceId),this.formatNavigator=this.instanceCollection.getNavigatorInstance(this.instanceId,r),this.formatRenderer=new Dn(r,this.instanceId),this.inputSlotCollection=this.instanceCollection.getInputSlotInstance(this.instanceId,r),this.inputRuleProcessor=new Io(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),this.renderFormat())}pastedValue(r){r.length>0&&(this.formatNavigator.isSelection?this.formatNavigator.isAllSelected?this.inputValuePassed(r):this.inputRuleProcessor.processPastedValue(r,!0):this.inputValue.length===0?this.inputValuePassed(r):this.inputRuleProcessor.processPastedValue(r),this.renderFormat(!0))}registerFormatChangeEvent(r){this.onFormatChange=r}mouseUpHandler(){this.formatNavigator.findCursorPosition()}keyDownHandler(r){r.key!=="Tab"&&(!(r.key==="c"&&(r.ctrlKey||r.metaKey))&&!(r.key==="v"&&(r.ctrlKey||r.metaKey))&&(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)}renderFormat(r=!1){setTimeout(()=>{var t,n;this.formatRenderer.render(),this.isInputFocused&&this.formatNavigator.setCursorToCurrentPosition(),this.inputValue.length>0&&(this.previousOutputValue=(t=this.inputElement)==null?void 0:t.innerHTML),r&&((n=this.inputElement)!=null&&n.innerHTML)&&this.onFormatChange&&this.onFormatChange(this.inputElement.innerHTML)})}}const Ih=(e,r)=>{const{value:t="",format:n,readOnly:s=!1,debounceTime:o=800,fillContainer:i=!0,leftElement:a,rightElement:c,className:d,leftElementClassName:h,rightElementClassName:p,isSingleLine:v=!1,allowSingleLineScroll:y=!1,isInputValid:x,onChange:D,onFocus:O,onBlur:P,onElementCreate:R,onLeftElementClick:z,onRightElementClick:$}=e,[g,L]=f.useState(!0),C=f.useRef(),U=f.useRef(),B=f.useRef();f.useEffect(()=>()=>{var W;(W=B.current)==null||W.dispose()},[]),f.useEffect(()=>{var W;(W=B.current)==null||W.inputValuePassed(t)},[t]),f.useEffect(()=>{var W,b,T;(W=B.current)==null||W.dispose(),n&&(B.current=new _h(n,t),U.current&&((b=B.current)==null||b.inputElementCreated(U.current)),(T=B.current)==null||T.registerFormatChangeEvent(se))},[n]);const se=f.useCallback(W=>{x?x(W)?(L(!0),D==null||D(W)):L(!1):D==null||D(W)},[D]),re=f.useCallback(W=>{var b;(b=B.current)==null||b.inputFocused(),O==null||O(W)},[O]),ee=f.useCallback(W=>{var b;(b=B.current)==null||b.inputBlurred(),P==null||P(W)},[P]),I=f.useCallback(()=>{var W;(W=B.current)==null||W.mouseUpHandler()},[]),F=f.useCallback(W=>{var b;(b=B.current)==null||b.keyDownHandler(W)},[]),j=f.useCallback(W=>{var T,V;W.preventDefault(),W.stopPropagation();const b=(T=W.clipboardData)==null?void 0:T.getData("text/plain");b&&((V=B.current)==null||V.pastedValue(b))},[]),k=f.useCallback(W=>{var b,T,V,S,H,K,A,Y,q,Q,E,te,_;(T=(b=C.current)==null?void 0:b.inputElement)==null||T.removeEventListener("keydown",F),(S=(V=C.current)==null?void 0:V.inputElement)==null||S.removeEventListener("mouseup",I),(K=(H=C.current)==null?void 0:H.inputElement)==null||K.removeEventListener("paste",j),C.current=W,(Y=(A=C.current)==null?void 0:A.inputElement)==null||Y.addEventListener("keydown",F),(Q=(q=C.current)==null?void 0:q.inputElement)==null||Q.addEventListener("mouseup",I),(te=(E=C.current)==null?void 0:E.inputElement)==null||te.addEventListener("paste",j),U.current=(_=C.current)==null?void 0:_.inputElement},[]),G=f.useCallback(()=>{var W;(W=C.current)==null||W.focus()},[]);f.useImperativeHandle(r,()=>({focus:G}));const N=le(d,{"!bsc-border-error":!g});return l.jsx(hr,{ref:W=>W&&k(W),readOnly:s,debounceTime:o,fillContainer:i,leftElement:a,rightElement:c,className:N,leftElementClassName:h,rightElementClassName:p,isSingleLine:v,allowSingleLineScroll:y,onFocus:re,onBlur:ee,onElementCreate:R,onLeftElementClick:z,onRightElementClick:$})},jo=f.forwardRef(Ih),On=f.createContext(void 0);function Mo(e,r,t=!0){var v,y;const n=eo(e),s=Gs(e),o=jf(e);let i=ln(s)-(((v=r.options)==null?void 0:v.weekStartsOn)||0);i=i===-1?6:i;const a=ln(o)-(((y=r.options)==null?void 0:y.weekStartsOn)||0),c=Yl({start:s,end:o}),d=n+i>35?6:5,h=Ro(d,7,{dayValue:null,isCurrent:!0});let p=1;for(let x=0,D=d;x<D;x++){for(let O=x>0?0:i;O<7;O++){const P=c[p-1];if(P.setHours(e.getHours(),e.getMinutes(),e.getSeconds()),h[x][O].dayValue=P,++p>n)break}if(p>n)break}if(i>0&&t)for(let x=0;x<i;x++)h[0][x].dayValue=Nd(s,i-x),h[0][x].isCurrent=!1;if(a>-1&&t)for(let x=6;x>a;x--)h[d-1][x].dayValue=St(o,x-a),h[d-1][x].isCurrent=!1;return h}function Ro(e,r,t){const n=[];for(let s=0,o=e;s<o;s++){const i=[];for(let a=0,c=r;a<c;a++){const d=jh(t)?t:{...t};i.push(d)}n.push(i)}return n}function jh(e){const r=typeof e;return r==="string"||r==="number"||r==="boolean"||e instanceof Date}function Mh(e){var n;const r=_d(new Date,((n=e.options)==null?void 0:n.weekStartsOn)||0),t=[];for(let s=0;s<7;s++)t.push(St(r,s).toLocaleDateString(e.code,{weekday:"short"}));return t}function Rh(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 o=0;o<4;o++)t[s][o]={monthNumber:n,monthName:tt(r,n++).toLocaleDateString(e.code,{month:"short"})};return t}function Lh(e,r){const t=new Date(e.getTime()),n=Math.floor(t.getFullYear()/10)*10;t.setFullYear(n);const s=Wl({start:t,end:Ut(t,9)}),o=Ro(3,4,"");let i=0;for(let a=0;a<3;a++)for(let c=0;c<4&&(o[a][c]=s[i++].toLocaleDateString(r.code,{year:"numeric"}),i!==s.length);c++);return o}function Ah(e){const r=new Date;return r.setHours(0,0,0,0),r.toLocaleTimeString(e.code)}function Fh(e,r,t){return e.getTime()>=r.getTime()&&e.getTime()<=t.getTime()}async function Lo(e){return(await import(`/node_modules/date-fns/locale/${$h(e)}`)).default}function $h(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 Qt(e,r){const t=Id(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 Nn(e,r){const t=e.split("-");if(t.length!==2)return;const n=Qt(t[0].trim(),r);if(!n)return;const s=Qt(t[1].trim(),r);if(s)return[n,s]}var ge=(e=>(e[e.DateTime=0]="DateTime",e[e.DateOnly=1]="DateOnly",e[e.TimeOnly=2]="TimeOnly",e[e.DateRange=3]="DateRange",e))(ge||{}),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||{}),Ot=(e=>(e[e.Day=0]="Day",e[e.Month=1]="Month",e[e.Year=2]="Year",e[e.Range=3]="Range",e))(Ot||{}),Xt=(e=>(e[e.Short=0]="Short",e[e.Medium=1]="Medium",e[e.Long=2]="Long",e))(Xt||{}),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||{}),vr=(e=>(e[e.Right=0]="Right",e[e.Left=1]="Left",e[e.None=2]="None",e))(vr||{}),oe=(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))(oe||{});const Hh=(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:Yh(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 Yh(e){return e?Array.isArray(e)?e[0]:e:new Date}const _n=(e,r,t)=>{const n=f.useCallback(c=>{t({type:oe.SetViewDate,viewDate:tt(r,c)})},[]),s=f.useCallback(c=>{t({type:oe.SetViewDate,viewDate:pn(r,c)})},[]),o=f.useCallback(c=>{t({type:oe.SetViewDate,viewDate:Ut(r,c)})},[]),i=f.useCallback(c=>{t({type:oe.SetViewDate,viewDate:mn(r,c)})},[]),a=f.useCallback(c=>{t({type:oe.SetDateSelector,dateSelector:c})},[]);return{...e,incrementViewMonths:n,decrementViewMonths:s,incrementViewYears:o,decrementViewYears:i,setDateSelector:a}},xr=({viewDate:e,selectedDate:r,selectedStartDate:t,selectedEndDate:n,selectionMode:s=nt.Normal,locale:o,onDateSelected:i,selectableDate:a,isValidDate:c,dispatcher:d})=>{var j;const[h,p]=f.useState(!1),[v,y]=f.useState(),[x,D]=f.useState(),[O,P]=f.useState(),[R,z]=f.useState(),$=f.useRef(),g=f.useRef(),L=f.useContext(On),C=f.useMemo(()=>L.calendarTemplate,[L.calendarTemplate]),U=async()=>o||await Lo(qn());f.useEffect(()=>{U().then(k=>{$.current=k,g.current=Mh($.current),p(!0)}).catch(k=>console.error(k))},[]),f.useEffect(()=>{e&&$.current&&P(Mo(e,$.current,s===nt.Normal))},[e,h]),f.useEffect(()=>{z(r?new Date(r.getFullYear(),r.getMonth(),r.getDate()):void 0)},[r]),f.useEffect(()=>{y(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]),f.useEffect(()=>{$.current&&o&&($.current=o,P(Mo(e,$.current,s===nt.Normal)))},[o]);const B=k=>{if(s===nt.Normal)d==null||d({type:oe.SetSelectedDate,selectedDate:k,viewDate:k}),i==null||i(k);else{if(!i)throw new Error("Range selection mode requires onDateSelected to be set");!t||Mf(k,t)?i(k):t&&!n?i(k,{setEndDate:!0}):t&&n&&i(k)}},se=k=>(R==null?void 0:R.toLocaleDateString())===k.toLocaleDateString(),re=k=>{if(v&&x){const G=k.getTime();return G>=v&&G<=x}return!1},ee=_n({viewDate:e,selectedDate:r,selectedStartDate:t,selectedEndDate:n,selectionMode:s,locale:o,weekDays:g.current,monthMatrix:O,selectableDate:a,isValidDate:c,onDateClicked:B,isSelectedDate:se,isInSelectedDateRange:re},e,d),F=C||((k,G)=>l.jsx("div",{className:"bc-dt-calendar bsc-w-full",children:G}));return l.jsx(lt,{props:ee,template:F,children:l.jsxs("div",{className:"bc-dt-day-row bsc-grid bsc-min-w-[329px] bsc-grid-cols-7 bsc-gap-3",children:[(j=g.current)==null?void 0:j.map((k,G)=>l.jsx("div",{className:"bc-dt-day-cell bsc-text-center bsc-font-bold",children:k},G)),O==null?void 0:O.map((k,G)=>k.map((N,W)=>{var V,S;const b=N.dayValue!==null&&(a===void 0||a(N.dayValue)),T=le("bsc-text-center bsc-py-1",{"bsc-text-gray-3":!N.isCurrent,"bsc-bg-primary-3 dark:bsc-bg-mono-light-1 dark:bsc-text-mono-dark-1":N&&N.dayValue&&(R&&se(N.dayValue)||v&&!x&&qs(v,N.dayValue)||v&&x&&re(N.dayValue)),"bsc-cursor-pointer":b,"bsc-text-error bsc-cursor-not-allowed":!b,"bsc-bg-primary-5 dark:bsc-bg-mono-light-3 dark:bsc-text-mono-dark-1":N.dayValue&&Od(N.dayValue)&&!(se(N.dayValue)||re(N.dayValue))},"bc-dt-date-cell");return l.jsx("div",{className:T,onClick:()=>N&&N.dayValue&&b&&(c===void 0||c(N.dayValue))&&B(N.dayValue),children:(S=N.dayValue)==null?void 0:S.getDate().toLocaleString((V=$.current)==null?void 0:V.code)},G.toString()+W.toString())}))]})})},wr=({title:e,scrollerType:r,onTitleClicked:t,onMovePrevious:n,onMoveNext:s,viewDate:o,dispatcher:i})=>{const c=f.useContext(On).dateScrollerTemplate,d=_n({title:e,scrollerType:r,onTitleClicked:t,onMovePrevious:n,onMoveNext:s},o,i),p=c||((v,y)=>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:y}));return l.jsxs(lt,{props:d,template:p,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(Fe,{icon:"chevronLeft",size:je.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(Fe,{icon:"chevronRight",size:je.Regular})})})]})},Wh=({selectedDate:e,viewDate:r,locale:t,showTimeSelector:n,selectableDate:s,isValidDate:o,onChange:i,dispatcher:a})=>{const c=()=>{r&&a({type:oe.SetViewDate,viewDate:pn(r,1)})},d=()=>{r&&a({type:oe.SetViewDate,viewDate:tt(r,1)})},h=()=>{a({type:oe.SetDateSelector,dateSelector:Oe.MonthSelector})},p=()=>{a({type:oe.SetDateSelector,dateSelector:Oe.TimeSelector})},v=()=>r?r.toLocaleDateString(t.code,{month:"long",year:"numeric"}):"";return l.jsxs("div",{className:"bc-dt-day-selector bsc-p-2",children:[l.jsx(wr,{title:v(),scrollerType:Ot.Day,onTitleClicked:h,onMovePrevious:c,onMoveNext:d,viewDate:r,dispatcher:a}),l.jsx(xr,{viewDate:r,selectedDate:e,locale:t,selectableDate:s,isValidDate:o,onDateSelected:i,dispatcher:a}),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))||Ah(t)})})]})},Vh=({viewDate:e,locale:r,dateSelection:t=ge.DateTime,dispatcher:n})=>{const s=f.useRef(Rh(r)),o=()=>{const h=mn(e,1);n({type:oe.SetViewDate,viewDate:h})},i=()=>{const h=Ut(e,1);n({type:oe.SetViewDate,viewDate:h})},a=h=>{n({type:oe.SetDateSelector,dateSelector:t!==ge.DateRange?Oe.DaySelector:Oe.DateRangeSelector,viewDate:Gd(e,h)})},c=()=>e.toLocaleDateString(r.code,{year:"numeric"}),d=()=>{n({type:oe.SetDateSelector,dateSelector:Oe.YearSelector})};return l.jsxs("div",{className:"bc-dt-month-selector bsc-p-2",style:{minWidth:"20rem"},children:[l.jsx(wr,{title:c(),scrollerType:Ot.Month,onTitleClicked:d,onMovePrevious:o,onMoveNext:i,viewDate:e,dispatcher:n}),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((v,y)=>l.jsx("div",{className:"bc-dt-month-cell bsc-cursor-pointer bsc-text-center",onClick:()=>a(v.monthNumber),children:v.monthName},p.toString()+y.toString())))})]})},Bh=({viewDate:e,selectedStartDate:r,selectedEndDate:t,locale:n,onChange:s,dispatcher:o})=>{const i=gr("screen and (max-device-width: 40rem)"),a=tt(e,1),c=(y,x)=>{!x||!x.setEndDate?o({type:oe.SetSelectedStartDate,selectedStartDate:y}):(o({type:oe.SetSelectedEndDate,selectedEndDate:y}),r&&(s==null||s([r,y])))},d=()=>{o({type:oe.SetDateSelector,dateSelector:Oe.MonthSelector})},h=()=>i?`${e.toLocaleDateString(n.code,{month:"long"})} ${e.toLocaleDateString(n.code,{year:"numeric"})}`:`${e.toLocaleDateString(n.code,{month:"long"})} ${e.toLocaleDateString(n.code,{year:"numeric"})} - ${a.toLocaleDateString(n.code,{month:"long"})} ${a.toLocaleDateString(n.code,{year:"numeric"})}`,p=()=>{e&&o({type:oe.SetViewDate,viewDate:pn(e,1)})},v=()=>{e&&o({type:oe.SetViewDate,viewDate:tt(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(wr,{title:h(),scrollerType:Ot.Range,onTitleClicked:d,onMovePrevious:p,onMoveNext:v,viewDate:e,dispatcher:o})}),l.jsx("div",{className:"bsc-flex-grow",children:l.jsx(bn,{mobileMarkup:l.jsx("div",{className:"bc-dt-range-calendar bsc-px-2 bsc-py-1",children:l.jsx(xr,{viewDate:e,selectedStartDate:r,selectedEndDate:t,selectionMode:nt.Range,onDateSelected:c,locale:n,dispatcher:o})}),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(xr,{viewDate:e,selectedStartDate:r,selectedEndDate:t,selectionMode:nt.Range,onDateSelected:c,locale:n,dispatcher:o})}),l.jsx("div",{className:"bc-dt-range-calendar-2 bsc-pl-4",children:l.jsx(xr,{viewDate:a,selectedStartDate:r,selectedEndDate:t,selectionMode:nt.Range,onDateSelected:c,locale:n,dispatcher:o})})]})})})]})},Uh=({viewDate:e,showDateSelector:r,locale:t,timeFormat:n=Se.TwelveHour,timeConstraints:s,onChange:o,dispatcher:i})=>{const a=f.useRef(n===Se.TwelveHour?11:23),c=f.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"]),d=f.useRef(ri(0,59,I=>I.toString().padStart(2,"0"))),h=f.useRef(["AM","PM"]),p=f.useRef(Dl(e)),v=I=>I>11?I-12:I,[y,x]=f.useState(v(e.getHours())),[D,O]=f.useState(e.getMinutes()),[P,R]=f.useState(e.getHours()<=12?0:1),z=f.useRef(e.toLocaleDateString(t.code));f.useEffect(()=>{const I=e.getHours(),F=e.getMinutes();if(I!==y&&x(n===Se.TwelveHour?v(I):I),F!==D&&O(F),n===Se.TwelveHour){const j=I<=11?0:1;j!==P&&R(j)}},[e]);const $=()=>{var j;const I=((j=s==null?void 0:s.hours)==null?void 0:j.step)||1,F=y<a.current?y+I:0;x(F),B(F,D,P)},g=()=>{var j;const I=((j=s==null?void 0:s.hours)==null?void 0:j.step)||1,F=y>0?y-I:a.current;x(F),B(F,D,P)},L=()=>{var j,k,G;const I=((j=s==null?void 0:s.minutes)==null?void 0:j.step)||1,F=D+I<(((k=s==null?void 0:s.minutes)==null?void 0:k.max)||59)?D+I:((G=s==null?void 0:s.minutes)==null?void 0:G.min)||0;O(F),B(y,F,P)},C=()=>{var j,k,G;const I=((j=s==null?void 0:s.minutes)==null?void 0:j.step)||1,F=D-I>=(((k=s==null?void 0:s.minutes)==null?void 0:k.min)||0)?D-I:(((G=s==null?void 0:s.minutes)==null?void 0:G.max)||60)-I;O(F),B(y,F,P)},U=()=>{const I=P===0?1:0;R(I),B(y,D,I)},B=(I,F,j)=>{const k=n===Se.TwelveHour&&j===1?I+12:I;p.current.setHours(k,F),i({type:oe.SetSelectedDate,selectedDate:p.current,viewDate:p.current}),o==null||o(p.current)},se=()=>{i({type:oe.SetDateSelector,dateSelector:Oe.DaySelector})},re=le("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}),ee=le("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 l.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:l.jsxs("div",{className:re,children:[r&&l.jsx("div",{className:ee,onClick:se,children:z.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:$,children:l.jsx(Fe,{icon:"chevronUp",size:je.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:L,children:l.jsx(Fe,{icon:"chevronUp",size:je.Regular})})}),n===Se.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:U,children:l.jsx(Fe,{icon:"chevronUp",size:je.Regular})})}),l.jsx("div",{className:"bc-dt-time-hour-value bsc-text-center",children:c.current[y]}),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:d.current[D]}),n===Se.TwelveHour&&l.jsx("div",{className:"bc-dt-time-meridian-value bsc-text-center",children:h.current[P]}),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:g,children:l.jsx(Fe,{icon:"chevronDown",size:je.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:C,children:l.jsx(Fe,{icon:"chevronDown",size:je.Regular})})}),n===Se.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:U,children:l.jsx(Fe,{icon:"chevronDown",size:je.Regular})})})]})})},zh=({viewDate:e,locale:r,dispatcher:t})=>{const n=Lh(e,r),s=()=>{const c=mn(e,10);t({type:oe.SetViewDate,viewDate:c})},o=()=>{const c=Ut(e,10);t({type:oe.SetViewDate,viewDate:c})},i=c=>{const d=parseInt(c);t({type:oe.SetDateSelector,dateSelector:Oe.MonthSelector,viewDate:Kd(e,d)})},a=()=>`${n[0][0].toString()} - ${n[2][1].toString()}`;return l.jsxs("div",{className:"bc-dt-year-selector",style:{minWidth:"20rem"},children:[l.jsx(wr,{title:a(),scrollerType:Ot.Year,onMovePrevious:s,onMoveNext:o,viewDate:e,dispatcher:t}),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,d)=>c.map((h,p)=>h.length>0?l.jsx("div",{className:"bc-dt-year-cell bsc-cursor-pointer bsc-text-center",onClick:()=>i(h),children:h},d.toString()+p.toString()):l.jsx("div",{},d.toString()+p.toString())))})})]})};class qh{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,o=20,a=new Date(n,s-1,o).toLocaleDateString(t,{year:"numeric",month:"numeric",day:"numeric"});this.dateFormat=a.replace(`${n}`,"YYYY").replace(`${s}`,"MM").replace(`${o}`,"DD");const c=new Date,d=18,h=24,p=37,v=317;c.setHours(d,h,p,v);const y=c.toLocaleTimeString(t);this.use24HourTime=y.startsWith("18"),this.timeFormat=y.replace(`${this.use24HourTime?d:"6"}`,"HH").replace(`${h}`,"MM").replace(`${p}`,"SS").replace(`${v}`,"LLL"),this.createDateParts()}get is24HourTime(){return this.use24HourTime}createInputFormat(){const r={deleteShiftsFormatPart:!1,formatParts:[]};switch(this.dateSelection){case ge.DateOnly:return this.createDateFormat(r);case ge.TimeOnly:return this.createTimeFormat(r);case ge.DateRange:return this.createDateRangeFormat(r);case ge.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 o={characterCount:n.length,placeholder:n,inputText:n,isSeparator:!0};return[this.monthPart,s,this.dayPart,o,this.yearPart]}return[]}createDayMonthYearFormatParts(){if(this.monthPart&&this.dayPart&&this.yearPart){let 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 o={characterCount:n.length,placeholder:n,inputText:n,isSeparator:!0};return[this.dayPart,s,this.monthPart,o,this.yearPart]}return[]}createYearMonthDayFormatParts(){if(this.monthPart&&this.dayPart&&this.yearPart){let 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 o={characterCount:n.length,placeholder:n,inputText:n,isSeparator:!0};return[this.yearPart,s,this.monthPart,o,this.dayPart]}return[]}createTwelveHourFormatParts(){if(this.twelveHourPart&&this.minutePart&&this.meridianPart){const r=this.timeFormat.replace("HH",""),t=r.indexOf("MM"),n=r.substring(0,t),s={characterCount:n.length,placeholder:n,inputText:n,isSeparator:!0},o={characterCount:1,placeholder:" ",inputText:" ",isSeparator:!0};return[this.twelveHourPart,s,this.minutePart,o,this.meridianPart]}return[]}createTwentyFourHourFormatParts(){if(this.twentyFourHourPart&&this.minutePart){const 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 Gh=(e,r)=>{var o;const[t,n]=f.useState(),s=f.useRef();return f.useEffect(()=>{r&&!t&&(s.current=new qh(e,r),n(s.current.createInputFormat()))},[r]),[t,(o=s.current)==null?void 0:o.is24HourTime]},Kh=({value:e,readOnly:r=!1,label:t,useDefaultDateValue:n=!1,useFormattedInput:s=!1,allowClear:o=!1,closeSelector:i=!1,locale:a,className:c,dateSelection:d=ge.DateTime,dateFormat:h,timeConstraints:p,icon:v,iconPosition:y=vr.Right,inputElement:x,selectableDate:D,isValidDate:O,onChange:P,calendarTemplate:R,dateScrollerTemplate:z,inputTemplate:$,wrapperTemplate:g})=>{const[L,C]=f.useState(!1),[U,B]=f.useState(),[se,re]=f.useState(),[ee,I,F]=ti(d),j=f.useRef(),k=f.useRef(!1),G=f.useRef(a||qn()),N=f.useRef(),W=f.useRef(),b=f.useRef(),T=f.useRef(null),V=f.useRef(null),[S,H]=Gh(d,U),K=f.useRef({calendarTemplate:R,dateScrollerTemplate:z});f.useEffect(()=>{G.current&&Y(G.current)},[G]),f.useEffect(()=>{a&&Y(a)},[a]),f.useEffect(()=>{if(e){const Z=q();te({type:oe.InitializeDates,initialDate:Z})}else te({type:oe.ClearDates})},[e,N.current]),f.useEffect(()=>{H&&te({type:oe.SetTimeFormat,timeFormat:H?Se.TwentyFourHour:Se.TwelveHour})},[H]),f.useEffect(()=>{x&&(W.current=x)},[x]),f.useEffect(()=>{te({type:oe.SetDateSelector,dateSelector:A()})},[ee]);const A=f.useCallback(()=>F.current===ge.TimeOnly?Oe.TimeSelector:F.current===ge.DateTime||F.current===ge.DateOnly?Oe.DaySelector:Oe.DateRangeSelector,[]),Y=Z=>{Lo(Z).then(ae=>{B(ae.code),N.current=ae;const Re=q();te(e||n?{type:oe.InitializeDates,initialDate:Array.isArray(Re)?Re[0]:Re}:{type:oe.SetViewDate,viewDate:Array.isArray(Re)?Re[0]:Re})}).catch(ae=>console.error(ae))},q=()=>{const Z=new Date;return Z.setHours(0,0,0,0),e?typeof e=="string"?F.current!==ge.DateRange?Qt(e,N.current):Nn(e,N.current):e:Z},Q={currentSelector:A(),currentViewDate:new Date,timeFormat:Se.TwelveHour,dateInitialized:!1},[E,te]=f.useReducer(Hh,Q),_=()=>{Or(),C(!0)},_e=f.useMemo(()=>Vt(()=>{C(!1)},250),[]),st=f.useMemo(()=>Vt(()=>{_e.cancel()},5),[_e]),Ge=Z=>{const ae=Z.target.innerText;er(ae)},pt=Z=>{if(Z){const ae=F.current!==ge.DateRange?Qt(Z,N.current):Nn(Z,N.current);return ae?O?Array.isArray(ae)?ae.every(Re=>O(Re)):O(ae):!0:!1}else return!0},Cr=Z=>{er(Z||"")},er=Z=>{const ae=F.current!==ge.DateRange?Qt(Z,N.current):Nn(Z,N.current);ae?(Array.isArray(ae)?(Fh(ae[0],Gs(E.currentViewDate),Hl(tt(E.currentViewDate,1)))||te({type:oe.SetViewDate,viewDate:ae[0]}),te({type:oe.SetSelectedDateRange,selectedStartDate:ae[0],selectedEndDate:ae[1]})):te({type:oe.SetSelectedDate,selectedDate:ae,viewDate:ae}),P==null||P(ae)):Z===""&&(te({type:oe.ClearDates}),P==null||P())},_t=Z=>{F.current===ge.DateOnly&&i===!0&&C(!1),P==null||P(Z)},kr=()=>{Or(),C(!L),V.current?V.current.focus():T.current&&T.current.focus()},Dr=()=>{te({type:oe.ClearDates}),C(!1),P==null||P()},mt=(Z,ae)=>{(!W.current||j.current!==ae)&&(W.current=Z,j.current=ae,k.current=!0)},Or=()=>{(!b.current||k.current)&&W.current&&(b.current=W.current,re(W.current),k.current=!1)},Nr=()=>{C(!1),te({type:oe.SetDateSelector,dateSelector:A()})},_r=()=>{switch(h){case Xt.Short:return"short";case Xt.Medium:return"medium";case Xt.Long:return"long";default:return}},gt=()=>{var ae,Re,et,It,jt,rr,Ar,nr,Fr,sr,or,$r;const Z=_r();switch(F.current){case ge.DateTime:return E.selectedDate?Z?E.selectedDate.toLocaleString((ae=N.current)==null?void 0:ae.code,{dateStyle:Z,timeStyle:Z}):E.selectedDate.toLocaleString((Re=N.current)==null?void 0:Re.code):"";case ge.DateOnly:return E.selectedDate?Z?E.selectedDate.toLocaleDateString((et=N.current)==null?void 0:et.code,{dateStyle:Z}):E.selectedDate.toLocaleDateString((It=N.current)==null?void 0:It.code):"";case ge.TimeOnly:return E.selectedDate?Z?E.selectedDate.toLocaleTimeString((jt=N.current)==null?void 0:jt.code,{timeStyle:Z,hour12:E.timeFormat===Se.TwelveHour,hourCycle:E.timeFormat===Se.TwentyFourHour?"h23":void 0}):E.selectedDate.toLocaleTimeString((rr=N.current)==null?void 0:rr.code,{hour12:E.timeFormat===Se.TwelveHour,hourCycle:E.timeFormat===Se.TwentyFourHour?"h23":void 0}):"";case ge.DateRange:return E.selectedStartDate&&E.selectedEndDate?Z?`${E.selectedStartDate.toLocaleDateString((Ar=N.current)==null?void 0:Ar.code,{dateStyle:Z})} - ${E.selectedEndDate.toLocaleDateString((nr=N.current)==null?void 0:nr.code,{dateStyle:Z})}`:`${E.selectedStartDate.toLocaleDateString((Fr=N.current)==null?void 0:Fr.code)} - ${E.selectedEndDate.toLocaleDateString((sr=N.current)==null?void 0:sr.code)}`:"";default:return E.selectedDate?Z?E.selectedDate.toLocaleString((or=N.current)==null?void 0:or.code,{dateStyle:Z,timeStyle:Z}):E.selectedDate.toLocaleString(($r=N.current)==null?void 0:$r.code):""}},Ke=ee===ge.DateTime||ee===ge.DateOnly||ee===ge.DateRange,In=ee===ge.DateTime||ee===ge.TimeOnly,ot=y===vr.None?{}:y===vr.Right?{rightElement:l.jsxs("div",{className:"bsc-flex bsc-text-black dark:bsc-text-mono-light-1",children:[o&&!r&&l.jsx("div",{children:l.jsx(Fe,{icon:"close",size:je.Small,className:"bsc-cursor-pointer bsc-text-sm",onClick:Dr})}),l.jsx("div",{className:"bsc-ml-2",onClick:r?void 0:kr,children:v||l.jsx(Fe,{icon:"calendar",size:je.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:kr,children:v||l.jsx(Fe,{icon:"calendar",size:je.Small,className:r?void 0:"bsc-cursor-pointer"})}),o&&!r&&l.jsx("div",{children:l.jsx(Fe,{icon:"close",size:je.Small,className:"bsc-cursor-pointer bsc-text-sm",onClick:Dr})})]}),leftElementClassName:"bsc-justify-center"},Ir={setDateSelector:Z=>I(Z)},jn=g||((Z,ae)=>l.jsx(l.Fragment,{children:ae})),Mr=()=>l.jsx(lt,{props:Ir,template:jn,children:l.jsxs(l.Fragment,{children:[E.currentSelector===Oe.DaySelector&&Ke&&E.dateInitialized&&N.current&&l.jsx(Wh,{selectedDate:E.selectedDate,viewDate:E.currentViewDate,locale:N.current,showTimeSelector:F.current===ge.DateTime,selectableDate:D,isValidDate:O,dispatcher:te,onChange:_t}),E.currentSelector===Oe.MonthSelector&&Ke&&E.dateInitialized&&N.current&&l.jsx(Vh,{viewDate:E.currentViewDate,locale:N.current,dateSelection:F.current,dispatcher:te}),E.currentSelector===Oe.YearSelector&&Ke&&E.dateInitialized&&N.current&&l.jsx(zh,{viewDate:E.currentViewDate,locale:N.current,dispatcher:te}),E.currentSelector===Oe.TimeSelector&&In&&E.dateInitialized&&N.current&&l.jsx(Uh,{viewDate:E.currentViewDate,showDateSelector:F.current===ge.DateTime,locale:N.current,timeFormat:E.timeFormat,timeConstraints:p,onChange:P,dispatcher:te}),E.currentSelector===Oe.DateRangeSelector&&Ke&&E.dateInitialized&&N.current&&l.jsx(Bh,{viewDate:E.currentViewDate,selectedStartDate:E.selectedStartDate,selectedEndDate:E.selectedEndDate,locale:N.current,onChange:P,dispatcher:te})]})}),Rr=_n({label:t,readOnly:r,allowClear:o,getValue:gt,onFocus:_,onInput:Ge,iconPosition:y,iconElement:ot.rightElement||ot.leftElement},E.currentViewDate,te),Lr=$||((Z,ae)=>l.jsx(l.Fragment,{children:ae})),tr=le("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(On.Provider,{value:K.current,children:l.jsxs("div",{className:"bc-date-time",children:[t&&l.jsx(Ze,{label:t,readOnly:r,className:"bc-dt-label"}),l.jsx(bn,{mobileMarkup:l.jsxs(l.Fragment,{children:[l.jsx(lt,{props:Rr,template:Lr,children:l.jsx(hr,{ref:T,value:gt(),readOnly:r,inputMode:"none",className:tr,onFocus:_,onElementCreate:Z=>mt(Z,!1),...ot})}),l.jsx(Co,{visible:L,target:se,hidden:Nr,unmountWhenHidden:!0,children:Mr()})]}),aboveMobileMarkup:l.jsxs(l.Fragment,{children:[l.jsx(lt,{props:Rr,template:Lr,children:s===!1?l.jsx(hr,{ref:T,value:gt(),readOnly:r,className:tr,onFocus:_,onBlur:_e,onInput:Ge,onElementCreate:Z=>mt(Z,!1),...ot}):l.jsx(jo,{ref:V,value:gt(),readOnly:r,className:tr,format:S,isInputValid:pt,onFocus:_,onBlur:_e,onChange:Cr,onElementCreate:Z=>mt(Z,!0),...ot})}),l.jsx(Oo,{visible:L,target:se,shouldTargetCloseOverlay:!1,shouldScrollCloseOverlay:!0,shouldCheckZIndex:!0,shouldRemainOnScreen:!0,hidden:Nr,isClickedWithin:st,unmountWhenHidden:!0,children:Mr()})]})})]})})};function ht(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 Qh(e){return/^\d+$/.test(e)}function Pr(e){return Object.prototype.toString.call(e)==="[object Object]"}function Jt(e){return Object(e)===e}function Tr(e){return Object.keys(e).length===0}var Xh=["__proto__","prototype","constructor"],Jh=function(e){return Xh.indexOf(e)===-1};function Sr(e,r){e.indexOf("[")>=0&&(e=e.replace(/\[/g,r).replace(/]/g,""));var t=e.split(r),n=t.filter(Jh);if(n.length!==t.length)throw Error("Refusing to update blacklisted property "+e);return t}var Ao=Object.prototype.hasOwnProperty;function ce(e,r,t,n){if(!(this instanceof ce))return new ce(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 Nt=new ce(".",!1,!0,!0);function We(e){return function(){return Nt[e].apply(Nt,arguments)}}ce.prototype._fill=function(e,r,t,n){var s=e.shift();if(e.length>0){if(r[s]=r[s]||(this.useArray&&Qh(e[0])?[]:{}),!Jt(r[s]))if(this.override)r[s]={};else{if(!(Jt(t)&&Tr(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&&Jt(r[s])&&!Tr(r[s])){if(!(Jt(t)&&Tr(t)))throw new Error("Trying to redefine non-empty obj['"+s+"']");return}r[s]=ht(t,n)}},ce.prototype.object=function(e,r){var t=this;return Object.keys(e).forEach(function(n){var s=r===void 0?null:r[n],o=Sr(n,t.separator).join(t.separator);o.indexOf(t.separator)!==-1?(t._fill(o.split(t.separator),e,e[n],s),delete e[n]):e[n]=ht(e[n],s)}),e},ce.prototype.str=function(e,r,t,n){var s=Sr(e,this.separator).join(this.separator);return e.indexOf(this.separator)!==-1?this._fill(s.split(this.separator),t,r,n):t[e]=ht(r,n),t},ce.prototype.pick=function(e,r,t,n){var s,o,i,a,c;for(o=Sr(e,this.separator),s=0;s<o.length;s++)if(a=Zh(o[s],r),r&&typeof r=="object"&&a in r){if(s===o.length-1)return t?(i=r[a],n&&Array.isArray(r)?r.splice(a,1):delete r[a],Array.isArray(r)&&(c=o.slice(0,-1).join("."),this.cleanup.indexOf(c)===-1&&this.cleanup.push(c)),i):r[a];r=r[a]}else return;return t&&Array.isArray(r)&&(r=r.filter(function(d){return d!==void 0})),r},ce.prototype.delete=function(e,r){return this.remove(e,r,!0)},ce.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)},ce.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(o){return o!==void 0}),this.set(this.cleanup[t],r,e);this.cleanup=[]}},ce.prototype.del=ce.prototype.remove,ce.prototype.move=function(e,r,t,n,s){return typeof n=="function"||Array.isArray(n)?this.set(r,ht(this.pick(e,t,!0),n),t,s):(s=n,this.set(r,this.pick(e,t,!0),t,s)),t},ce.prototype.transfer=function(e,r,t,n,s,o){return typeof s=="function"||Array.isArray(s)?this.set(r,ht(this.pick(e,t,!0),s),n,o):(o=s,this.set(r,this.pick(e,t,!0),n,o)),n},ce.prototype.copy=function(e,r,t,n,s,o){return typeof s=="function"||Array.isArray(s)?this.set(r,ht(JSON.parse(JSON.stringify(this.pick(e,t,!1))),s),n,o):(o=s,this.set(r,this.pick(e,t,!1),n,o)),n},ce.prototype.set=function(e,r,t,n){var s,o,i,a;if(typeof r>"u")return t;for(i=Sr(e,this.separator),s=0;s<i.length;s++){if(a=i[s],s===i.length-1)if(n&&Pr(r)&&Pr(t[a]))for(o in r)Ao.call(r,o)&&(t[a][o]=r[o]);else if(n&&Array.isArray(t[a])&&Array.isArray(r))for(var c=0;c<r.length;c++)t[i[s]].push(r[c]);else t[a]=r;else(!Ao.call(t,a)||!Pr(t[a])&&!Array.isArray(t[a]))&&(/^\d+$/.test(i[s+1])?t[a]=[]:t[a]={});t=t[a]}return t},ce.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},ce.prototype.dot=function(e,r,t){r=r||{},t=t||[];var n=Array.isArray(e);return Object.keys(e).forEach((function(s){var o=n&&this.useBrackets?"["+s+"]":s;if(Jt(e[s])&&(Pr(e[s])&&!Tr(e[s])||Array.isArray(e[s])&&!this.keepArray&&e[s].length!==0))if(n&&this.useBrackets){var i=t[t.length-1]||"";return this.dot(e[s],r,t.slice(0,-1).concat(i+o))}else return this.dot(e[s],r,t.concat(o));else n&&this.useBrackets?r[t.join(this.separator).concat("["+s+"]")]=e[s]:r[t.concat(o).join(this.separator)]=e[s]}).bind(this)),r},ce.pick=We("pick"),ce.move=We("move"),ce.transfer=We("transfer"),ce.transform=We("transform"),ce.copy=We("copy"),ce.object=We("object"),ce.str=We("str"),ce.set=We("set"),ce.delete=We("delete"),ce.del=ce.remove=We("remove"),ce.dot=We("dot"),["override","overwrite"].forEach(function(e){Object.defineProperty(ce,e,{get:function(){return Nt.override},set:function(r){Nt.override=!!r}})}),["useArray","keepArray","useBrackets"].forEach(function(e){Object.defineProperty(ce,e,{get:function(){return Nt[e]},set:function(r){Nt[e]=r}})}),ce._process=ht;var ep=ce;const Er=Hr(ep),tp=({name:e,label:r,value:t,data:n,textField:s,valueField:o,readOnly:i=!1,orientation:a=Ie.Horizontal,isMultiSelect:c=!1,className:d,onChange:h,itemTemplate:p})=>{const[v,y]=f.useState(),[x,D]=f.useState([]),O=cr(()=>n,[n]),P=f.useId();f.useEffect(()=>{if(c){const j=Array.isArray(t)?t.map(k=>k.toString()):t?[String(t)]:void 0;D(j??[])}else t&&y(t.toString())},[t]);const R=j=>c?x.findIndex(k=>k===j)>-1:v===j,z=j=>{const k=j.toString();if(c){const G=R(k);let N;G?N=x.filter(W=>W!=k):N=[...x,k],D(N),h==null||h({name:e,value:N})}else k!==v&&(y(k),h==null||h({name:e,value:k}))},$=j=>{const{value:k}=j.target;y(k),h==null||h({name:e,value:k})},g=j=>{const{value:k,checked:G}=j.target;let N;G?N=[...x,k]:N=x.filter(W=>W!=k),D(N),h==null||h({name:e,value:N})},L=(j,k,G,N)=>l.jsxs("label",{htmlFor:j,className:N,children:[l.jsx("input",{id:j,name:e,value:G,type:"checkbox",onChange:g,checked:R(G),className:"bsc-appearance-none"}),k]},j),C=(j,k,G,N)=>l.jsxs("label",{htmlFor:j,className:N,children:[l.jsx("input",{id:j,name:e,value:G,type:"radio",onChange:$,checked:R(G),className:"bsc-appearance-none"}),k]},j),U=ir(Ft.FocusWithin),B=f.useCallback((j,k)=>l.jsx(l.Fragment,{children:k}),[]),se=p||B,re=(j,k,G)=>{const N=`element_${P}_${k}`,W=Er.pick(s,j),b=String(Er.pick(o,j)),T=k===0,V=k===G.length-1,S=le("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":!i,"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":i,"bsc-border-t bsc-border-l bsc-border-b bsc-rounded-l-md bsc-pl-2":T&&a===Ie.Horizontal,"bsc-border-t bsc-border-r bsc-border-l bsc-border-b bsc-rounded-r-md bsc-pr-2":V&&a===Ie.Horizontal,"bsc-border-t bsc-border-b":!T&&!V&&a===Ie.Horizontal,"bsc-border-l":!T&&a===Ie.Horizontal,"bsc-border-l bsc-border-r bsc-border-t bsc-rounded-t-md":T&&a===Ie.Vertical,"bsc-border bsc-rounded-b-md":V&&a===Ie.Vertical,"bsc-border-t bsc-border-l bsc-border-r":!T&&!V&&a===Ie.Vertical},U),H={itemId:N,selectedValue:c?x:v,itemText:W,itemValue:b,itemData:j,itemStyles:S,isSelected:R(b),isFirstItem:T,isLastItem:V,onItemChanged:z};return c?l.jsx(lt,{props:H,template:se,children:L(N,W,b,S)}):l.jsx(lt,{props:H,template:se,children:C(N,W,b,S)})},ee=le("bsc-flex bsc-flex-col bsc-gap-2",d),I=le("bsc-flex",{"bsc-flex-col [width:max-content]":a===Ie.Vertical}),F=j=>l.jsx("div",{className:I,children:j.map(re)});return l.jsxs("div",{className:ee,children:[r&&l.jsx(Ze,{label:r,readOnly:i}),O&&F(O)]})},rp=f.memo(tp),np=({id:e,name:r,label:t,value:n,checked:s=!1,labelLocation:o=Ae.Right,readOnly:i=!1,useAnimation:a,onChange:c})=>{const d=Wr(a),h=f.useCallback(y=>{c==null||c(y)},[c]),p=le("bc-radio-item-wrapper bsc-flex bsc-items-center *:bsc-cursor-pointer",{"bc-read-only":i}),v=le("bc-radio-item-outer bsc-relative *:bsc-size-[21px]",{"bsc-pl-1":o===Ae.Left,"bsc-pr-1":o===Ae.Right,"bsc-radio-item-animate":!i&&d,"bsc-radio-item":!i,"bc-read-only bsc-radio-item-read-only":i});return l.jsxs("div",{className:p,children:[o===Ae.Left&&l.jsx(Ze,{label:t,htmlFor:e,readOnly:i}),l.jsxs("label",{className:v,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})]})]}),o===Ae.Right&&l.jsx(Ze,{label:t,htmlFor:e,readOnly:i})]})},sp=f.memo(np),op=({name:e,label:r,value:t,data:n,textField:s,valueField:o,readOnly:i=!1,labelLocation:a=Ae.Right,orientation:c=Ie.Vertical,className:d,useAnimation:h,onChange:p})=>{const[v,y]=f.useState(t),x=cr(()=>n,[n]),D=f.useId(),O=f.useCallback(g=>{const L=g.target.value;y(L),p==null||p({name:e,value:L,originalEvent:g})},[e]),P=(g,L)=>{const C=`${D}_radio_${L}`,U=Er.pick(o,g);return l.jsx(sp,{id:C,name:e,label:Er.pick(s,g),value:U,checked:U==v,labelLocation:a,readOnly:i,useAnimation:h,onChange:O},C)},R=le("bc-radio-container bsc-flex bsc-flex-col bsc-gap-1",d),z=le("bc-radio-wrapper bsc-flex bsc-gap-1",{"bsc-flex-col":c===Ie.Vertical,"[&>*]:bsc-pr-2":c===Ie.Horizontal}),$=g=>l.jsx("div",{className:z,children:g.map(P)});return l.jsxs("div",{className:R,children:[r&&l.jsx(Ze,{label:r,readOnly:i}),x&&$(x)]})},ip=f.memo(op),ap=({name:e,label:r,value:t,checked:n=!1,readOnly:s=!1,useAnimation:o,className:i,onChange:a})=>{const[c,d]=f.useState(!1),h=f.useId(),p=Wr(o);f.useEffect(()=>{d(n)},[n]);const v=P=>{const{checked:R}=P.target;d(R),a==null||a({originalEvent:P,name:e||P.target.name,value:t||P.target.value,checked:R})},y=le("bc-toggle-wrapper bsc-flex bsc-flex-col",i),x=ir(Ft.FocusWithin),D=le("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},x),O=le("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:y,children:[r&&l.jsx(Ze,{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:v,className:"bsc-appearance-none"}),l.jsx("div",{id:"switch",className:O})]})]})},cp=f.memo(ap),Pp="";J.BeeSoftProvider=Bo,J.Button=Ve,J.Checkbox=Zn,J.CheckboxGroup=yi,J.ContentEditableInput=hr,J.DateFormatType=Xt,J.DateScrollerType=Ot,J.DateSelectionType=ge,J.DateTime=Kh,J.FormGroupItemOrientation=Ie,J.FormattedInput=jo,J.GroupButton=rp,J.MediaQuery=bn,J.MobileOverlayPanel=Co,J.OverlayPanel=Oo,J.RadioButton=ip,J.SelectionLabelLocation=Ae,J.Toggle=cp,J.applyBeeSoftTheme=ai,J.createBeeSoftTheme=ci,Object.defineProperty(J,Symbol.toStringTag,{value:"Module"})});
|
package/dist/index.umd.js.gz
CHANGED
|
Binary file
|
package/package.json
CHANGED