@worldresources/wri-design-systems 2.191.1 → 2.191.3

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.cjs.js CHANGED
@@ -2225,6 +2225,7 @@
2225
2225
  background-color: ${h("neutral",200)};
2226
2226
  }
2227
2227
  `,Ki=({id:t,label:n,caption:o,icon:i,value:a,variant:s="data",onItemClick:l,isExpanded:c=!1,ariaLabel:d,disabled:u=!1,isHighlighted:p=!1})=>{const f=("navigation"===s||"select"===s)&&!!l,g=f?e.chakra.button:e.chakra.div,x=d||("data"===s&&a?`${n}, ${a}`:n);return r.jsxs(g,{id:t,css:["data"===s?Xi:Yi,p&&{backgroundColor:h("neutral",200)}],onClick:f?l:void 0,tabIndex:f?0:void 0,onKeyDown:e=>{f&&("Enter"!==e.key&&" "!==e.key||l?.())},role:f?"button":void 0,"aria-expanded":f?c:void 0,"aria-label":x,disabled:u,"aria-selected":p,children:[r.jsxs(e.Flex,{gap:3,flex:"1",overflow:"hidden",children:[i,r.jsxs(e.Box,{flex:"1",minWidth:0,children:[r.jsx(e.Text,{fontWeight:"data"===s?"400":"700",css:Zi(u),children:n}),o&&r.jsx(e.Text,{css:Wi,children:o})]})]}),"data"===s&&a&&r.jsx(e.Text,{css:Gi,children:a}),"navigation"===s&&r.jsx(e.Icon,{as:R,boxSize:4,"aria-hidden":"true",css:Ui(u)})]})},Ji=({items:t,noBorder:n,highlightedIndex:o})=>r.jsx(e.Box,{css:qi(n),children:t.map(((e,t)=>r.jsx(Ki,{id:e.id,icon:e.icon,label:e.label,caption:e.caption,value:e.value,variant:e.variant??"data",onItemClick:e.onItemClick,isHighlighted:t===o},e.id??e.label)))}),Qi=o.css`
2228
+ background: transparent;
2228
2229
  svg {
2229
2230
  path {
2230
2231
  fill: ${h("primary",500)};
@@ -2250,7 +2251,7 @@
2250
2251
  line-height: 1.5rem;
2251
2252
  font-weight: 400;
2252
2253
  color: ${h("neutral",700)};
2253
-
2254
+ background: transparent;
2254
2255
  &[data-selected] {
2255
2256
  color: ${h("neutral",900)};
2256
2257
  font-weight: 700;
@@ -2299,7 +2300,7 @@
2299
2300
  `,la=e=>o.css`
2300
2301
  svg {
2301
2302
  path {
2302
- fill: ${e?h("primary",600):h("neutral",500)} !important;
2303
+ fill: ${h("accessible",e?"controls-on-neutral-lights":100)} !important;
2303
2304
  }
2304
2305
  }
2305
2306
  `,ca=o.css`
@@ -2319,6 +2320,10 @@
2319
2320
  :hover {
2320
2321
  background-color: ${h("neutral",200)};
2321
2322
  }
2323
+
2324
+ &.selected {
2325
+ background-color: ${h("primary",100)} !important;
2326
+ }
2322
2327
  }
2323
2328
  `,pa=o.css`
2324
2329
  height: 480px;
@@ -2395,54 +2400,54 @@
2395
2400
  *
2396
2401
  * This source code is licensed under the MIT license found in the
2397
2402
  * LICENSE file in the root directory of this source tree.
2398
- */function Ha(){return Ra||(Ra=1,"production"===process.env.NODE_ENV?Sa.exports=function(){if(Ca)return Ea;Ca=1;var e="function"==typeof Symbol&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,a=e?Symbol.for("react.provider"):60109,s=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,c=e?Symbol.for("react.concurrent_mode"):60111,d=e?Symbol.for("react.forward_ref"):60112,u=e?Symbol.for("react.suspense"):60113,p=e?Symbol.for("react.suspense_list"):60120,h=e?Symbol.for("react.memo"):60115,f=e?Symbol.for("react.lazy"):60116,g=e?Symbol.for("react.block"):60121,x=e?Symbol.for("react.fundamental"):60117,m=e?Symbol.for("react.responder"):60118,v=e?Symbol.for("react.scope"):60119;function b(e){if("object"==typeof e&&null!==e){var p=e.$$typeof;switch(p){case t:switch(e=e.type){case l:case c:case r:case i:case o:case u:return e;default:switch(e=e&&e.$$typeof){case s:case d:case f:case h:case a:return e;default:return p}}case n:return p}}}function y(e){return b(e)===c}return Ea.AsyncMode=l,Ea.ConcurrentMode=c,Ea.ContextConsumer=s,Ea.ContextProvider=a,Ea.Element=t,Ea.ForwardRef=d,Ea.Fragment=r,Ea.Lazy=f,Ea.Memo=h,Ea.Portal=n,Ea.Profiler=i,Ea.StrictMode=o,Ea.Suspense=u,Ea.isAsyncMode=function(e){return y(e)||b(e)===l},Ea.isConcurrentMode=y,Ea.isContextConsumer=function(e){return b(e)===s},Ea.isContextProvider=function(e){return b(e)===a},Ea.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},Ea.isForwardRef=function(e){return b(e)===d},Ea.isFragment=function(e){return b(e)===r},Ea.isLazy=function(e){return b(e)===f},Ea.isMemo=function(e){return b(e)===h},Ea.isPortal=function(e){return b(e)===n},Ea.isProfiler=function(e){return b(e)===i},Ea.isStrictMode=function(e){return b(e)===o},Ea.isSuspense=function(e){return b(e)===u},Ea.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===r||e===c||e===i||e===o||e===u||e===p||"object"==typeof e&&null!==e&&(e.$$typeof===f||e.$$typeof===h||e.$$typeof===a||e.$$typeof===s||e.$$typeof===d||e.$$typeof===x||e.$$typeof===m||e.$$typeof===v||e.$$typeof===g)},Ea.typeOf=b,Ea}():Sa.exports=(La||(La=1,"production"!==process.env.NODE_ENV&&function(){var e="function"==typeof Symbol&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,a=e?Symbol.for("react.provider"):60109,s=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,c=e?Symbol.for("react.concurrent_mode"):60111,d=e?Symbol.for("react.forward_ref"):60112,u=e?Symbol.for("react.suspense"):60113,p=e?Symbol.for("react.suspense_list"):60120,h=e?Symbol.for("react.memo"):60115,f=e?Symbol.for("react.lazy"):60116,g=e?Symbol.for("react.block"):60121,x=e?Symbol.for("react.fundamental"):60117,m=e?Symbol.for("react.responder"):60118,v=e?Symbol.for("react.scope"):60119;function b(e){if("object"==typeof e&&null!==e){var p=e.$$typeof;switch(p){case t:var g=e.type;switch(g){case l:case c:case r:case i:case o:case u:return g;default:var x=g&&g.$$typeof;switch(x){case s:case d:case f:case h:case a:return x;default:return p}}case n:return p}}}var y=l,w=c,C=s,j=a,k=t,$=d,S=r,E=f,L=h,R=n,T=i,O=o,P=u,M=!1;function _(e){return b(e)===c}Ba.AsyncMode=y,Ba.ConcurrentMode=w,Ba.ContextConsumer=C,Ba.ContextProvider=j,Ba.Element=k,Ba.ForwardRef=$,Ba.Fragment=S,Ba.Lazy=E,Ba.Memo=L,Ba.Portal=R,Ba.Profiler=T,Ba.StrictMode=O,Ba.Suspense=P,Ba.isAsyncMode=function(e){return M||(M=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),_(e)||b(e)===l},Ba.isConcurrentMode=_,Ba.isContextConsumer=function(e){return b(e)===s},Ba.isContextProvider=function(e){return b(e)===a},Ba.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},Ba.isForwardRef=function(e){return b(e)===d},Ba.isFragment=function(e){return b(e)===r},Ba.isLazy=function(e){return b(e)===f},Ba.isMemo=function(e){return b(e)===h},Ba.isPortal=function(e){return b(e)===n},Ba.isProfiler=function(e){return b(e)===i},Ba.isStrictMode=function(e){return b(e)===o},Ba.isSuspense=function(e){return b(e)===u},Ba.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===r||e===c||e===i||e===o||e===u||e===p||"object"==typeof e&&null!==e&&(e.$$typeof===f||e.$$typeof===h||e.$$typeof===a||e.$$typeof===s||e.$$typeof===d||e.$$typeof===x||e.$$typeof===m||e.$$typeof===v||e.$$typeof===g)},Ba.typeOf=b}()),Ba)),Sa.exports}function Fa(){if(Oa)return Ta;Oa=1;return Ta="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}function qa(){return Ma?Pa:(Ma=1,Pa=Function.call.bind(Object.prototype.hasOwnProperty))}function Za(){if(Aa)return Da;Aa=1;var e=Ha(),t=a,n=Fa(),r=qa(),o=function(){if(Ia)return _a;Ia=1;var e=function(){};if("production"!==process.env.NODE_ENV){var t=Fa(),n={},r=qa();e=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}}function o(o,i,a,s,l){if("production"!==process.env.NODE_ENV)for(var c in o)if(r(o,c)){var d;try{if("function"!=typeof o[c]){var u=Error((s||"React class")+": "+a+" type `"+c+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof o[c]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw u.name="Invariant Violation",u}d=o[c](i,c,s,a,null,t)}catch(e){d=e}if(!d||d instanceof Error||e((s||"React class")+": type specification of "+a+" `"+c+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof d+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),d instanceof Error&&!(d.message in n)){n[d.message]=!0;var p=l?l():"";e("Failed "+a+" type: "+d.message+(null!=p?p:""))}}}return o.resetWarningCache=function(){"production"!==process.env.NODE_ENV&&(n={})},_a=o}(),i=function(){};function s(){return null}return"production"!==process.env.NODE_ENV&&(i=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}),Da=function(a,l){var c="function"==typeof Symbol&&Symbol.iterator;var d="<<anonymous>>",u={array:g("array"),bigint:g("bigint"),bool:g("boolean"),func:g("function"),number:g("number"),object:g("object"),string:g("string"),symbol:g("symbol"),any:f(s),arrayOf:function(e){return f((function(t,r,o,i,a){if("function"!=typeof e)return new h("Property `"+a+"` of component `"+o+"` has invalid PropType notation inside arrayOf.");var s=t[r];if(!Array.isArray(s))return new h("Invalid "+i+" `"+a+"` of type `"+v(s)+"` supplied to `"+o+"`, expected an array.");for(var l=0;l<s.length;l++){var c=e(s,l,o,i,a+"["+l+"]",n);if(c instanceof Error)return c}return null}))},element:f((function(e,t,n,r,o){var i=e[t];return a(i)?null:new h("Invalid "+r+" `"+o+"` of type `"+v(i)+"` supplied to `"+n+"`, expected a single ReactElement.")})),elementType:f((function(t,n,r,o,i){var a=t[n];return e.isValidElementType(a)?null:new h("Invalid "+o+" `"+i+"` of type `"+v(a)+"` supplied to `"+r+"`, expected a single ReactElement type.")})),instanceOf:function(e){return f((function(t,n,r,o,i){if(!(t[n]instanceof e)){var a=e.name||d;return new h("Invalid "+o+" `"+i+"` of type `"+(((s=t[n]).constructor&&s.constructor.name?s.constructor.name:d)+"` supplied to `")+r+"`, expected instance of `"+a+"`.")}var s;return null}))},node:f((function(e,t,n,r,o){return m(e[t])?null:new h("Invalid "+r+" `"+o+"` supplied to `"+n+"`, expected a ReactNode.")})),objectOf:function(e){return f((function(t,o,i,a,s){if("function"!=typeof e)return new h("Property `"+s+"` of component `"+i+"` has invalid PropType notation inside objectOf.");var l=t[o],c=v(l);if("object"!==c)return new h("Invalid "+a+" `"+s+"` of type `"+c+"` supplied to `"+i+"`, expected an object.");for(var d in l)if(r(l,d)){var u=e(l,d,i,a,s+"."+d,n);if(u instanceof Error)return u}return null}))},oneOf:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&i(arguments.length>1?"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]).":"Invalid argument supplied to oneOf, expected an array."),s;return f((function(t,n,r,o,i){for(var a=t[n],s=0;s<e.length;s++)if(p(a,e[s]))return null;var l=JSON.stringify(e,(function(e,t){return"symbol"===b(t)?String(t):t}));return new h("Invalid "+o+" `"+i+"` of value `"+String(a)+"` supplied to `"+r+"`, expected one of "+l+".")}))},oneOfType:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&i("Invalid argument supplied to oneOfType, expected an instance of array."),s;for(var t=0;t<e.length;t++){var o=e[t];if("function"!=typeof o)return i("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+y(o)+" at index "+t+"."),s}return f((function(t,o,i,a,s){for(var l=[],c=0;c<e.length;c++){var d=(0,e[c])(t,o,i,a,s,n);if(null==d)return null;d.data&&r(d.data,"expectedType")&&l.push(d.data.expectedType)}return new h("Invalid "+a+" `"+s+"` supplied to `"+i+"`"+(l.length>0?", expected one of type ["+l.join(", ")+"]":"")+".")}))},shape:function(e){return f((function(t,r,o,i,a){var s=t[r],l=v(s);if("object"!==l)return new h("Invalid "+i+" `"+a+"` of type `"+l+"` supplied to `"+o+"`, expected `object`.");for(var c in e){var d=e[c];if("function"!=typeof d)return x(o,i,a,c,b(d));var u=d(s,c,o,i,a+"."+c,n);if(u)return u}return null}))},exact:function(e){return f((function(o,i,a,s,l){var c=o[i],d=v(c);if("object"!==d)return new h("Invalid "+s+" `"+l+"` of type `"+d+"` supplied to `"+a+"`, expected `object`.");var u=t({},o[i],e);for(var p in u){var f=e[p];if(r(e,p)&&"function"!=typeof f)return x(a,s,l,p,b(f));if(!f)return new h("Invalid "+s+" `"+l+"` key `"+p+"` supplied to `"+a+"`.\nBad object: "+JSON.stringify(o[i],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var g=f(c,p,a,s,l+"."+p,n);if(g)return g}return null}))}};function p(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function h(e,t){this.message=e,this.data=t&&"object"==typeof t?t:{},this.stack=""}function f(e){if("production"!==process.env.NODE_ENV)var t={},r=0;function o(o,a,s,c,u,p,f){if(c=c||d,p=p||s,f!==n){if(l){var g=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 g.name="Invariant Violation",g}if("production"!==process.env.NODE_ENV&&"undefined"!=typeof console){var x=c+":"+s;!t[x]&&r<3&&(i("You are manually calling a React.PropTypes validation function for the `"+p+"` prop on `"+c+"`. 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[x]=!0,r++)}}return null==a[s]?o?null===a[s]?new h("The "+u+" `"+p+"` is marked as required in `"+c+"`, but its value is `null`."):new h("The "+u+" `"+p+"` is marked as required in `"+c+"`, but its value is `undefined`."):null:e(a,s,c,u,p)}var a=o.bind(null,!1);return a.isRequired=o.bind(null,!0),a}function g(e){return f((function(t,n,r,o,i,a){var s=t[n];return v(s)!==e?new h("Invalid "+o+" `"+i+"` of type `"+b(s)+"` supplied to `"+r+"`, expected `"+e+"`.",{expectedType:e}):null}))}function x(e,t,n,r,o){return new h((e||"React class")+": "+t+" type `"+n+"."+r+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+o+"`.")}function m(e){switch(typeof e){case"number":case"string":case"undefined":return!0;case"boolean":return!e;case"object":if(Array.isArray(e))return e.every(m);if(null===e||a(e))return!0;var t=function(e){var t=e&&(c&&e[c]||e["@@iterator"]);if("function"==typeof t)return t}(e);if(!t)return!1;var n,r=t.call(e);if(t!==e.entries){for(;!(n=r.next()).done;)if(!m(n.value))return!1}else for(;!(n=r.next()).done;){var o=n.value;if(o&&!m(o[1]))return!1}return!0;default:return!1}}function v(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":function(e,t){return"symbol"===e||!!t&&("Symbol"===t["@@toStringTag"]||"function"==typeof Symbol&&t instanceof Symbol)}(t,e)?"symbol":t}function b(e){if(null==e)return""+e;var t=v(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}function y(e){var t=b(e);switch(t){case"array":case"object":return"an "+t;case"boolean":case"date":case"regexp":return"a "+t;default:return t}}return h.prototype=Error.prototype,u.checkPropTypes=o,u.resetWarningCache=o.resetWarningCache,u.PropTypes=u,u},Da}function Wa(){if(za)return $a.exports;if(za=1,"production"!==process.env.NODE_ENV){var e=Ha();$a.exports=Za()(e.isElement,!0)}else $a.exports=function(){if(Va)return Na;Va=1;var e=Fa();function t(){}function n(){}return n.resetWarningCache=t,Na=function(){function r(t,n,r,o,i,a){if(a!==e){var s=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 s.name="Invariant Violation",s}}function o(){return r}r.isRequired=r;var i={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:o,element:r,elementType:r,instanceOf:o,node:r,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:n,resetWarningCache:t};return i.PropTypes=i,i}}()();return $a.exports}var Ga,Ua={exports:{}};var Xa,Ya={},Ka={};function Ja(){if(Xa)return Ka;return Xa=1,Object.defineProperty(Ka,"__esModule",{value:!0}),Ka.dontSetMe=function(e,t,n){if(e[t])return new Error(`Invalid prop ${t} passed to ${n} - do not set this, set it on the child.`)},Ka.findInArray=function(e,t){for(let n=0,r=e.length;n<r;n++)if(t.apply(t,[e[n],n,e]))return e[n]},Ka.int=function(e){return parseInt(e,10)},Ka.isFunction=function(e){return"function"==typeof e||"[object Function]"===Object.prototype.toString.call(e)},Ka.isNum=function(e){return"number"==typeof e&&!isNaN(e)},Ka}var Qa,es,ts={};function ns(){if(es)return Ya;es=1,Object.defineProperty(Ya,"__esModule",{value:!0}),Ya.addClassName=a,Ya.addEvent=function(e,t,n,r){if(!e)return;const o={capture:!0,...r};e.addEventListener?e.addEventListener(t,n,o):e.attachEvent?e.attachEvent("on"+t,n):e["on"+t]=n},Ya.addUserSelectStyles=function(e){if(!e)return;let t=e.getElementById("react-draggable-style-el");t||(t=e.createElement("style"),t.type="text/css",t.id="react-draggable-style-el",t.innerHTML=".react-draggable-transparent-selection *::-moz-selection {all: inherit;}\n",t.innerHTML+=".react-draggable-transparent-selection *::selection {all: inherit;}\n",e.getElementsByTagName("head")[0].appendChild(t));e.body&&a(e.body,"react-draggable-transparent-selection")},Ya.createCSSTransform=function(e,n){const r=o(e,n,"px");return{[(0,t.browserPrefixToKey)("transform",t.default)]:r}},Ya.createSVGTransform=function(e,t){return o(e,t,"")},Ya.getTouch=function(t,n){return t.targetTouches&&(0,e.findInArray)(t.targetTouches,(e=>n===e.identifier))||t.changedTouches&&(0,e.findInArray)(t.changedTouches,(e=>n===e.identifier))},Ya.getTouchIdentifier=function(e){if(e.targetTouches&&e.targetTouches[0])return e.targetTouches[0].identifier;if(e.changedTouches&&e.changedTouches[0])return e.changedTouches[0].identifier},Ya.getTranslation=o,Ya.innerHeight=function(t){let n=t.clientHeight;const r=t.ownerDocument.defaultView.getComputedStyle(t);return n-=(0,e.int)(r.paddingTop),n-=(0,e.int)(r.paddingBottom),n},Ya.innerWidth=function(t){let n=t.clientWidth;const r=t.ownerDocument.defaultView.getComputedStyle(t);return n-=(0,e.int)(r.paddingLeft),n-=(0,e.int)(r.paddingRight),n},Ya.matchesSelector=r,Ya.matchesSelectorAndParentsTo=function(e,t,n){let o=e;do{if(r(o,t))return!0;if(o===n)return!1;o=o.parentNode}while(o);return!1},Ya.offsetXYFromParent=function(e,t,n){const r=t===t.ownerDocument.body?{left:0,top:0}:t.getBoundingClientRect(),o=(e.clientX+t.scrollLeft-r.left)/n,i=(e.clientY+t.scrollTop-r.top)/n;return{x:o,y:i}},Ya.outerHeight=function(t){let n=t.clientHeight;const r=t.ownerDocument.defaultView.getComputedStyle(t);return n+=(0,e.int)(r.borderTopWidth),n+=(0,e.int)(r.borderBottomWidth),n},Ya.outerWidth=function(t){let n=t.clientWidth;const r=t.ownerDocument.defaultView.getComputedStyle(t);return n+=(0,e.int)(r.borderLeftWidth),n+=(0,e.int)(r.borderRightWidth),n},Ya.removeClassName=s,Ya.removeEvent=function(e,t,n,r){if(!e)return;const o={capture:!0,...r};e.removeEventListener?e.removeEventListener(t,n,o):e.detachEvent?e.detachEvent("on"+t,n):e["on"+t]=null},Ya.scheduleRemoveUserSelectStyles=function(e){window.requestAnimationFrame?window.requestAnimationFrame((()=>{i(e)})):i(e)};var e=Ja(),t=function(e,t){if("function"==typeof WeakMap)var n=new WeakMap,r=new WeakMap;return function(e,t){if(!t&&e&&e.__esModule)return e;var o,i,a={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return a;if(o=t?r:n){if(o.has(e))return o.get(e);o.set(e,a)}for(const t in e)"default"!==t&&{}.hasOwnProperty.call(e,t)&&((i=(o=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,t))&&(i.get||i.set)?o(a,t,i):a[t]=e[t]);return a}(e,t)}(function(){if(Qa)return ts;Qa=1,Object.defineProperty(ts,"__esModule",{value:!0}),ts.browserPrefixToKey=n,ts.browserPrefixToStyle=function(e,t){return t?`-${t.toLowerCase()}-${e}`:e},ts.default=void 0,ts.getPrefix=t;const e=["Moz","Webkit","O","ms"];function t(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"transform";if("undefined"==typeof window)return"";const r=window.document?.documentElement?.style;if(!r)return"";if(t in r)return"";for(let o=0;o<e.length;o++)if(n(t,e[o])in r)return e[o];return""}function n(e,t){return t?`${t}${function(e){let t="",n=!0;for(let r=0;r<e.length;r++)n?(t+=e[r].toUpperCase(),n=!1):"-"===e[r]?n=!0:t+=e[r];return t}(e)}`:e}return ts.default=t(),ts}());let n="";function r(t,r){return n||(n=(0,e.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],(function(n){return(0,e.isFunction)(t[n])}))),!!(0,e.isFunction)(t[n])&&t[n](r)}function o(e,t,n){let{x:r,y:o}=e,i=`translate(${r}${n},${o}${n})`;if(t){i=`translate(${`${"string"==typeof t.x?t.x:t.x+n}`}, ${`${"string"==typeof t.y?t.y:t.y+n}`})`+i}return i}function i(e){if(e)try{if(e.body&&s(e.body,"react-draggable-transparent-selection"),e.selection)e.selection.empty();else{const t=(e.defaultView||window).getSelection();t&&"Caret"!==t.type&&t.removeAllRanges()}}catch(e){}}function a(e,t){e.classList?e.classList.add(t):e.className.match(new RegExp(`(?:^|\\s)${t}(?!\\S)`))||(e.className+=` ${t}`)}function s(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp(`(?:^|\\s)${t}(?!\\S)`,"g"),"")}return Ya}var rs,os={};function is(){if(rs)return os;rs=1,Object.defineProperty(os,"__esModule",{value:!0}),os.canDragX=function(e){return"both"===e.props.axis||"x"===e.props.axis},os.canDragY=function(e){return"both"===e.props.axis||"y"===e.props.axis},os.createCoreData=function(t,r,o){const i=!(0,e.isNum)(t.lastX),a=n(t);return i?{node:a,deltaX:0,deltaY:0,lastX:r,lastY:o,x:r,y:o}:{node:a,deltaX:r-t.lastX,deltaY:o-t.lastY,lastX:t.lastX,lastY:t.lastY,x:r,y:o}},os.createDraggableData=function(e,t){const n=e.props.scale;return{node:t.node,x:e.state.x+t.deltaX/n,y:e.state.y+t.deltaY/n,deltaX:t.deltaX/n,deltaY:t.deltaY/n,lastX:e.state.x,lastY:e.state.y}},os.getBoundPosition=function(r,o,i){if(!r.props.bounds)return[o,i];let{bounds:a}=r.props;a="string"==typeof a?a:function(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}(a);const s=n(r);if("string"==typeof a){const{ownerDocument:n}=s,r=n.defaultView;let o;if("parent"===a)o=s.parentNode;else{o=s.getRootNode().querySelector(a)}if(!(o instanceof r.HTMLElement))throw new Error('Bounds selector "'+a+'" could not find an element.');const i=o,l=r.getComputedStyle(s),c=r.getComputedStyle(i);a={left:-s.offsetLeft+(0,e.int)(c.paddingLeft)+(0,e.int)(l.marginLeft),top:-s.offsetTop+(0,e.int)(c.paddingTop)+(0,e.int)(l.marginTop),right:(0,t.innerWidth)(i)-(0,t.outerWidth)(s)-s.offsetLeft+(0,e.int)(c.paddingRight)-(0,e.int)(l.marginRight),bottom:(0,t.innerHeight)(i)-(0,t.outerHeight)(s)-s.offsetTop+(0,e.int)(c.paddingBottom)-(0,e.int)(l.marginBottom)}}(0,e.isNum)(a.right)&&(o=Math.min(o,a.right));(0,e.isNum)(a.bottom)&&(i=Math.min(i,a.bottom));(0,e.isNum)(a.left)&&(o=Math.max(o,a.left));(0,e.isNum)(a.top)&&(i=Math.max(i,a.top));return[o,i]},os.getControlPosition=function(e,r,o){const i="number"==typeof r?(0,t.getTouch)(e,r):null;if("number"==typeof r&&!i)return null;const a=n(o),s=o.props.offsetParent||a.offsetParent||a.ownerDocument.body;return(0,t.offsetXYFromParent)(i||e,s,o.props.scale)},os.snapToGrid=function(e,t,n){const r=Math.round(t/e[0])*e[0],o=Math.round(n/e[1])*e[1];return[r,o]};var e=Ja(),t=ns();function n(e){const t=e.findDOMNode();if(!t)throw new Error("<DraggableCore>: Unmounted during event!");return t}return os}var as,ss,ls,cs,ds={},us={};function ps(){if(as)return us;return as=1,Object.defineProperty(us,"__esModule",{value:!0}),us.default=function(){},us}function hs(){if(ss)return ds;ss=1,Object.defineProperty(ds,"__esModule",{value:!0}),ds.default=void 0;var e=function(e,t){if("function"==typeof WeakMap)var n=new WeakMap,r=new WeakMap;return function(e,t){if(!t&&e&&e.__esModule)return e;var o,i,a={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return a;if(o=t?r:n){if(o.has(e))return o.get(e);o.set(e,a)}for(const t in e)"default"!==t&&{}.hasOwnProperty.call(e,t)&&((i=(o=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,t))&&(i.get||i.set)?o(a,t,i):a[t]=e[t]);return a}(e,t)}(n),t=c(Wa()),r=c(i),o=ns(),a=is(),s=Ja(),l=c(ps());function c(e){return e&&e.__esModule?e:{default:e}}function d(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const u={start:"touchstart",move:"touchmove",stop:"touchend"},p={start:"mousedown",move:"mousemove",stop:"mouseup"};let h=p,f=class extends e.Component{constructor(){super(...arguments),d(this,"dragging",!1),d(this,"lastX",NaN),d(this,"lastY",NaN),d(this,"touchIdentifier",null),d(this,"mounted",!1),d(this,"handleDragStart",(e=>{if(this.props.onMouseDown(e),!this.props.allowAnyClick&&"number"==typeof e.button&&0!==e.button)return!1;const t=this.findDOMNode();if(!t||!t.ownerDocument||!t.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:n}=t;if(this.props.disabled||!(e.target instanceof n.defaultView.Node)||this.props.handle&&!(0,o.matchesSelectorAndParentsTo)(e.target,this.props.handle,t)||this.props.cancel&&(0,o.matchesSelectorAndParentsTo)(e.target,this.props.cancel,t))return;"touchstart"!==e.type||this.props.allowMobileScroll||e.preventDefault();const r=(0,o.getTouchIdentifier)(e);this.touchIdentifier=r;const i=(0,a.getControlPosition)(e,r,this);if(null==i)return;const{x:s,y:c}=i,d=(0,a.createCoreData)(this,s,c);(0,l.default)("DraggableCore: handleDragStart: %j",d),(0,l.default)("calling",this.props.onStart);!1!==this.props.onStart(e,d)&&!1!==this.mounted&&(this.props.enableUserSelectHack&&(0,o.addUserSelectStyles)(n),this.dragging=!0,this.lastX=s,this.lastY=c,(0,o.addEvent)(n,h.move,this.handleDrag),(0,o.addEvent)(n,h.stop,this.handleDragStop))})),d(this,"handleDrag",(e=>{const t=(0,a.getControlPosition)(e,this.touchIdentifier,this);if(null==t)return;let{x:n,y:r}=t;if(Array.isArray(this.props.grid)){let e=n-this.lastX,t=r-this.lastY;if([e,t]=(0,a.snapToGrid)(this.props.grid,e,t),!e&&!t)return;n=this.lastX+e,r=this.lastY+t}const o=(0,a.createCoreData)(this,n,r);(0,l.default)("DraggableCore: handleDrag: %j",o);if(!1!==this.props.onDrag(e,o)&&!1!==this.mounted)this.lastX=n,this.lastY=r;else try{this.handleDragStop(new MouseEvent("mouseup"))}catch(e){const t=document.createEvent("MouseEvents");t.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(t)}})),d(this,"handleDragStop",(e=>{if(!this.dragging)return;const t=(0,a.getControlPosition)(e,this.touchIdentifier,this);if(null==t)return;let{x:n,y:r}=t;if(Array.isArray(this.props.grid)){let e=n-this.lastX||0,t=r-this.lastY||0;[e,t]=(0,a.snapToGrid)(this.props.grid,e,t),n=this.lastX+e,r=this.lastY+t}const i=(0,a.createCoreData)(this,n,r);if(!1===this.props.onStop(e,i)||!1===this.mounted)return!1;const s=this.findDOMNode();s&&this.props.enableUserSelectHack&&(0,o.scheduleRemoveUserSelectStyles)(s.ownerDocument),(0,l.default)("DraggableCore: handleDragStop: %j",i),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,s&&((0,l.default)("DraggableCore: Removing handlers"),(0,o.removeEvent)(s.ownerDocument,h.move,this.handleDrag),(0,o.removeEvent)(s.ownerDocument,h.stop,this.handleDragStop))})),d(this,"onMouseDown",(e=>(h=p,this.handleDragStart(e)))),d(this,"onMouseUp",(e=>(h=p,this.handleDragStop(e)))),d(this,"onTouchStart",(e=>(h=u,this.handleDragStart(e)))),d(this,"onTouchEnd",(e=>(h=u,this.handleDragStop(e))))}componentDidMount(){this.mounted=!0;const e=this.findDOMNode();e&&(0,o.addEvent)(e,u.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const e=this.findDOMNode();if(e){const{ownerDocument:t}=e;(0,o.removeEvent)(t,p.move,this.handleDrag),(0,o.removeEvent)(t,u.move,this.handleDrag),(0,o.removeEvent)(t,p.stop,this.handleDragStop),(0,o.removeEvent)(t,u.stop,this.handleDragStop),(0,o.removeEvent)(e,u.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,o.scheduleRemoveUserSelectStyles)(t)}}findDOMNode(){return this.props?.nodeRef?this.props?.nodeRef?.current:r.default.findDOMNode(this)}render(){return e.cloneElement(e.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};return ds.default=f,d(f,"displayName","DraggableCore"),d(f,"propTypes",{allowAnyClick:t.default.bool,allowMobileScroll:t.default.bool,children:t.default.node.isRequired,disabled:t.default.bool,enableUserSelectHack:t.default.bool,offsetParent:function(e,t){if(e[t]&&1!==e[t].nodeType)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:t.default.arrayOf(t.default.number),handle:t.default.string,cancel:t.default.string,nodeRef:t.default.object,onStart:t.default.func,onDrag:t.default.func,onStop:t.default.func,onMouseDown:t.default.func,scale:t.default.number,className:s.dontSetMe,style:s.dontSetMe,transform:s.dontSetMe}),d(f,"defaultProps",{allowAnyClick:!1,allowMobileScroll:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1}),ds}function fs(){return ls||(ls=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"DraggableCore",{enumerable:!0,get:function(){return d.default}}),e.default=void 0;var t=function(e,t){if("function"==typeof WeakMap)var n=new WeakMap,r=new WeakMap;return function(e,t){if(!t&&e&&e.__esModule)return e;var o,i,a={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return a;if(o=t?r:n){if(o.has(e))return o.get(e);o.set(e,a)}for(const t in e)"default"!==t&&{}.hasOwnProperty.call(e,t)&&((i=(o=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,t))&&(i.get||i.set)?o(a,t,i):a[t]=e[t]);return a}(e,t)}(n),r=p(Wa()),o=p(i),a=function(){if(Ga)return Ua.exports;function e(t){var n,r,o="";if("string"==typeof t||"number"==typeof t)o+=t;else if("object"==typeof t)if(Array.isArray(t)){var i=t.length;for(n=0;n<i;n++)t[n]&&(r=e(t[n]))&&(o&&(o+=" "),o+=r)}else for(r in t)t[r]&&(o&&(o+=" "),o+=r);return o}function t(){for(var t,n,r=0,o="",i=arguments.length;r<i;r++)(t=arguments[r])&&(n=e(t))&&(o&&(o+=" "),o+=n);return o}return Ga=1,Ua.exports=t,Ua.exports.clsx=t,Ua.exports}(),s=ns(),l=is(),c=Ja(),d=p(hs()),u=p(ps());function p(e){return e&&e.__esModule?e:{default:e}}function h(){return h=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},h.apply(null,arguments)}function f(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class g extends t.Component{static getDerivedStateFromProps(e,t){let{position:n}=e,{prevPropsPosition:r}=t;return!n||r&&n.x===r.x&&n.y===r.y?null:((0,u.default)("Draggable: getDerivedStateFromProps %j",{position:n,prevPropsPosition:r}),{x:n.x,y:n.y,prevPropsPosition:{...n}})}constructor(e){super(e),f(this,"onDragStart",((e,t)=>{(0,u.default)("Draggable: onDragStart: %j",t);if(!1===this.props.onStart(e,(0,l.createDraggableData)(this,t)))return!1;this.setState({dragging:!0,dragged:!0})})),f(this,"onDrag",((e,t)=>{if(!this.state.dragging)return!1;(0,u.default)("Draggable: onDrag: %j",t);const n=(0,l.createDraggableData)(this,t),r={x:n.x,y:n.y,slackX:0,slackY:0};if(this.props.bounds){const{x:e,y:t}=r;r.x+=this.state.slackX,r.y+=this.state.slackY;const[o,i]=(0,l.getBoundPosition)(this,r.x,r.y);r.x=o,r.y=i,r.slackX=this.state.slackX+(e-r.x),r.slackY=this.state.slackY+(t-r.y),n.x=r.x,n.y=r.y,n.deltaX=r.x-this.state.x,n.deltaY=r.y-this.state.y}if(!1===this.props.onDrag(e,n))return!1;this.setState(r)})),f(this,"onDragStop",((e,t)=>{if(!this.state.dragging)return!1;if(!1===this.props.onStop(e,(0,l.createDraggableData)(this,t)))return!1;(0,u.default)("Draggable: onDragStop: %j",t);const n={dragging:!1,slackX:0,slackY:0};if(Boolean(this.props.position)){const{x:e,y:t}=this.props.position;n.x=e,n.y=t}this.setState(n)})),this.state={dragging:!1,dragged:!1,x:e.position?e.position.x:e.defaultPosition.x,y:e.position?e.position.y:e.defaultPosition.y,prevPropsPosition:{...e.position},slackX:0,slackY:0,isElementSVG:!1},!e.position||e.onDrag||e.onStop||console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){void 0!==window.SVGElement&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.state.dragging&&this.setState({dragging:!1})}findDOMNode(){return this.props?.nodeRef?.current??o.default.findDOMNode(this)}render(){const{axis:e,bounds:n,children:r,defaultPosition:o,defaultClassName:i,defaultClassNameDragging:c,defaultClassNameDragged:u,position:p,positionOffset:f,scale:g,...x}=this.props;let m={},v=null;const b=!Boolean(p)||this.state.dragging,y=p||o,w={x:(0,l.canDragX)(this)&&b?this.state.x:y.x,y:(0,l.canDragY)(this)&&b?this.state.y:y.y};this.state.isElementSVG?v=(0,s.createSVGTransform)(w,f):m=(0,s.createCSSTransform)(w,f);const C=(0,a.clsx)(r.props.className||"",i,{[c]:this.state.dragging,[u]:this.state.dragged});return t.createElement(d.default,h({},x,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),t.cloneElement(t.Children.only(r),{className:C,style:{...r.props.style,...m},transform:v}))}}e.default=g,f(g,"displayName","Draggable"),f(g,"propTypes",{...d.default.propTypes,axis:r.default.oneOf(["both","x","y","none"]),bounds:r.default.oneOfType([r.default.shape({left:r.default.number,right:r.default.number,top:r.default.number,bottom:r.default.number}),r.default.string,r.default.oneOf([!1])]),defaultClassName:r.default.string,defaultClassNameDragging:r.default.string,defaultClassNameDragged:r.default.string,defaultPosition:r.default.shape({x:r.default.number,y:r.default.number}),positionOffset:r.default.shape({x:r.default.oneOfType([r.default.number,r.default.string]),y:r.default.oneOfType([r.default.number,r.default.string])}),position:r.default.shape({x:r.default.number,y:r.default.number}),className:c.dontSetMe,style:c.dontSetMe,transform:c.dontSetMe}),f(g,"defaultProps",{...d.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})}(ka)),ka}var gs=function(){if(cs)return ja.exports;cs=1;const{default:e,DraggableCore:t}=fs();return ja.exports=e,ja.exports.default=e,ja.exports.DraggableCore=t,ja.exports}(),xs=wa(gs);const ms=(e="medium",t,n,r)=>{const i=t||{xsmall:"240px",small:"320px",medium:"480px",large:"640px",xlarge:"960px","full-width":"90%"}[e]||"240px",a=r||{xsmall:"560px",small:"720px",medium:"720px",large:"720px",xlarge:"720px","full-width":"unset"}[e]||"560px",s="unset"===a?"80vh":`min(${a}, 80vh)`;let l="auto";return n?l=n:"full-width"===e&&(l="90%"),o.css`
2403
+ */function Ha(){return Ra||(Ra=1,"production"===process.env.NODE_ENV?Sa.exports=function(){if(Ca)return Ea;Ca=1;var e="function"==typeof Symbol&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,a=e?Symbol.for("react.provider"):60109,s=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,c=e?Symbol.for("react.concurrent_mode"):60111,d=e?Symbol.for("react.forward_ref"):60112,u=e?Symbol.for("react.suspense"):60113,p=e?Symbol.for("react.suspense_list"):60120,h=e?Symbol.for("react.memo"):60115,f=e?Symbol.for("react.lazy"):60116,g=e?Symbol.for("react.block"):60121,x=e?Symbol.for("react.fundamental"):60117,m=e?Symbol.for("react.responder"):60118,v=e?Symbol.for("react.scope"):60119;function b(e){if("object"==typeof e&&null!==e){var p=e.$$typeof;switch(p){case t:switch(e=e.type){case l:case c:case r:case i:case o:case u:return e;default:switch(e=e&&e.$$typeof){case s:case d:case f:case h:case a:return e;default:return p}}case n:return p}}}function y(e){return b(e)===c}return Ea.AsyncMode=l,Ea.ConcurrentMode=c,Ea.ContextConsumer=s,Ea.ContextProvider=a,Ea.Element=t,Ea.ForwardRef=d,Ea.Fragment=r,Ea.Lazy=f,Ea.Memo=h,Ea.Portal=n,Ea.Profiler=i,Ea.StrictMode=o,Ea.Suspense=u,Ea.isAsyncMode=function(e){return y(e)||b(e)===l},Ea.isConcurrentMode=y,Ea.isContextConsumer=function(e){return b(e)===s},Ea.isContextProvider=function(e){return b(e)===a},Ea.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},Ea.isForwardRef=function(e){return b(e)===d},Ea.isFragment=function(e){return b(e)===r},Ea.isLazy=function(e){return b(e)===f},Ea.isMemo=function(e){return b(e)===h},Ea.isPortal=function(e){return b(e)===n},Ea.isProfiler=function(e){return b(e)===i},Ea.isStrictMode=function(e){return b(e)===o},Ea.isSuspense=function(e){return b(e)===u},Ea.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===r||e===c||e===i||e===o||e===u||e===p||"object"==typeof e&&null!==e&&(e.$$typeof===f||e.$$typeof===h||e.$$typeof===a||e.$$typeof===s||e.$$typeof===d||e.$$typeof===x||e.$$typeof===m||e.$$typeof===v||e.$$typeof===g)},Ea.typeOf=b,Ea}():Sa.exports=(La||(La=1,"production"!==process.env.NODE_ENV&&function(){var e="function"==typeof Symbol&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,a=e?Symbol.for("react.provider"):60109,s=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,c=e?Symbol.for("react.concurrent_mode"):60111,d=e?Symbol.for("react.forward_ref"):60112,u=e?Symbol.for("react.suspense"):60113,p=e?Symbol.for("react.suspense_list"):60120,h=e?Symbol.for("react.memo"):60115,f=e?Symbol.for("react.lazy"):60116,g=e?Symbol.for("react.block"):60121,x=e?Symbol.for("react.fundamental"):60117,m=e?Symbol.for("react.responder"):60118,v=e?Symbol.for("react.scope"):60119;function b(e){if("object"==typeof e&&null!==e){var p=e.$$typeof;switch(p){case t:var g=e.type;switch(g){case l:case c:case r:case i:case o:case u:return g;default:var x=g&&g.$$typeof;switch(x){case s:case d:case f:case h:case a:return x;default:return p}}case n:return p}}}var y=l,w=c,C=s,j=a,k=t,$=d,S=r,E=f,L=h,R=n,T=i,O=o,P=u,M=!1;function _(e){return b(e)===c}Ba.AsyncMode=y,Ba.ConcurrentMode=w,Ba.ContextConsumer=C,Ba.ContextProvider=j,Ba.Element=k,Ba.ForwardRef=$,Ba.Fragment=S,Ba.Lazy=E,Ba.Memo=L,Ba.Portal=R,Ba.Profiler=T,Ba.StrictMode=O,Ba.Suspense=P,Ba.isAsyncMode=function(e){return M||(M=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),_(e)||b(e)===l},Ba.isConcurrentMode=_,Ba.isContextConsumer=function(e){return b(e)===s},Ba.isContextProvider=function(e){return b(e)===a},Ba.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},Ba.isForwardRef=function(e){return b(e)===d},Ba.isFragment=function(e){return b(e)===r},Ba.isLazy=function(e){return b(e)===f},Ba.isMemo=function(e){return b(e)===h},Ba.isPortal=function(e){return b(e)===n},Ba.isProfiler=function(e){return b(e)===i},Ba.isStrictMode=function(e){return b(e)===o},Ba.isSuspense=function(e){return b(e)===u},Ba.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===r||e===c||e===i||e===o||e===u||e===p||"object"==typeof e&&null!==e&&(e.$$typeof===f||e.$$typeof===h||e.$$typeof===a||e.$$typeof===s||e.$$typeof===d||e.$$typeof===x||e.$$typeof===m||e.$$typeof===v||e.$$typeof===g)},Ba.typeOf=b}()),Ba)),Sa.exports}function Fa(){if(Oa)return Ta;Oa=1;return Ta="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}function qa(){return Ma?Pa:(Ma=1,Pa=Function.call.bind(Object.prototype.hasOwnProperty))}function Za(){if(Aa)return Da;Aa=1;var e=Ha(),t=a,n=Fa(),r=qa(),o=function(){if(Ia)return _a;Ia=1;var e=function(){};if("production"!==process.env.NODE_ENV){var t=Fa(),n={},r=qa();e=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}}function o(o,i,a,s,l){if("production"!==process.env.NODE_ENV)for(var c in o)if(r(o,c)){var d;try{if("function"!=typeof o[c]){var u=Error((s||"React class")+": "+a+" type `"+c+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof o[c]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw u.name="Invariant Violation",u}d=o[c](i,c,s,a,null,t)}catch(e){d=e}if(!d||d instanceof Error||e((s||"React class")+": type specification of "+a+" `"+c+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof d+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),d instanceof Error&&!(d.message in n)){n[d.message]=!0;var p=l?l():"";e("Failed "+a+" type: "+d.message+(null!=p?p:""))}}}return o.resetWarningCache=function(){"production"!==process.env.NODE_ENV&&(n={})},_a=o}(),i=function(){};function s(){return null}return"production"!==process.env.NODE_ENV&&(i=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}),Da=function(a,l){var c="function"==typeof Symbol&&Symbol.iterator;var d="<<anonymous>>",u={array:g("array"),bigint:g("bigint"),bool:g("boolean"),func:g("function"),number:g("number"),object:g("object"),string:g("string"),symbol:g("symbol"),any:f(s),arrayOf:function(e){return f((function(t,r,o,i,a){if("function"!=typeof e)return new h("Property `"+a+"` of component `"+o+"` has invalid PropType notation inside arrayOf.");var s=t[r];if(!Array.isArray(s))return new h("Invalid "+i+" `"+a+"` of type `"+v(s)+"` supplied to `"+o+"`, expected an array.");for(var l=0;l<s.length;l++){var c=e(s,l,o,i,a+"["+l+"]",n);if(c instanceof Error)return c}return null}))},element:f((function(e,t,n,r,o){var i=e[t];return a(i)?null:new h("Invalid "+r+" `"+o+"` of type `"+v(i)+"` supplied to `"+n+"`, expected a single ReactElement.")})),elementType:f((function(t,n,r,o,i){var a=t[n];return e.isValidElementType(a)?null:new h("Invalid "+o+" `"+i+"` of type `"+v(a)+"` supplied to `"+r+"`, expected a single ReactElement type.")})),instanceOf:function(e){return f((function(t,n,r,o,i){if(!(t[n]instanceof e)){var a=e.name||d;return new h("Invalid "+o+" `"+i+"` of type `"+(((s=t[n]).constructor&&s.constructor.name?s.constructor.name:d)+"` supplied to `")+r+"`, expected instance of `"+a+"`.")}var s;return null}))},node:f((function(e,t,n,r,o){return m(e[t])?null:new h("Invalid "+r+" `"+o+"` supplied to `"+n+"`, expected a ReactNode.")})),objectOf:function(e){return f((function(t,o,i,a,s){if("function"!=typeof e)return new h("Property `"+s+"` of component `"+i+"` has invalid PropType notation inside objectOf.");var l=t[o],c=v(l);if("object"!==c)return new h("Invalid "+a+" `"+s+"` of type `"+c+"` supplied to `"+i+"`, expected an object.");for(var d in l)if(r(l,d)){var u=e(l,d,i,a,s+"."+d,n);if(u instanceof Error)return u}return null}))},oneOf:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&i(arguments.length>1?"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]).":"Invalid argument supplied to oneOf, expected an array."),s;return f((function(t,n,r,o,i){for(var a=t[n],s=0;s<e.length;s++)if(p(a,e[s]))return null;var l=JSON.stringify(e,(function(e,t){return"symbol"===b(t)?String(t):t}));return new h("Invalid "+o+" `"+i+"` of value `"+String(a)+"` supplied to `"+r+"`, expected one of "+l+".")}))},oneOfType:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&i("Invalid argument supplied to oneOfType, expected an instance of array."),s;for(var t=0;t<e.length;t++){var o=e[t];if("function"!=typeof o)return i("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+y(o)+" at index "+t+"."),s}return f((function(t,o,i,a,s){for(var l=[],c=0;c<e.length;c++){var d=(0,e[c])(t,o,i,a,s,n);if(null==d)return null;d.data&&r(d.data,"expectedType")&&l.push(d.data.expectedType)}return new h("Invalid "+a+" `"+s+"` supplied to `"+i+"`"+(l.length>0?", expected one of type ["+l.join(", ")+"]":"")+".")}))},shape:function(e){return f((function(t,r,o,i,a){var s=t[r],l=v(s);if("object"!==l)return new h("Invalid "+i+" `"+a+"` of type `"+l+"` supplied to `"+o+"`, expected `object`.");for(var c in e){var d=e[c];if("function"!=typeof d)return x(o,i,a,c,b(d));var u=d(s,c,o,i,a+"."+c,n);if(u)return u}return null}))},exact:function(e){return f((function(o,i,a,s,l){var c=o[i],d=v(c);if("object"!==d)return new h("Invalid "+s+" `"+l+"` of type `"+d+"` supplied to `"+a+"`, expected `object`.");var u=t({},o[i],e);for(var p in u){var f=e[p];if(r(e,p)&&"function"!=typeof f)return x(a,s,l,p,b(f));if(!f)return new h("Invalid "+s+" `"+l+"` key `"+p+"` supplied to `"+a+"`.\nBad object: "+JSON.stringify(o[i],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var g=f(c,p,a,s,l+"."+p,n);if(g)return g}return null}))}};function p(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function h(e,t){this.message=e,this.data=t&&"object"==typeof t?t:{},this.stack=""}function f(e){if("production"!==process.env.NODE_ENV)var t={},r=0;function o(o,a,s,c,u,p,f){if(c=c||d,p=p||s,f!==n){if(l){var g=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 g.name="Invariant Violation",g}if("production"!==process.env.NODE_ENV&&"undefined"!=typeof console){var x=c+":"+s;!t[x]&&r<3&&(i("You are manually calling a React.PropTypes validation function for the `"+p+"` prop on `"+c+"`. 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[x]=!0,r++)}}return null==a[s]?o?null===a[s]?new h("The "+u+" `"+p+"` is marked as required in `"+c+"`, but its value is `null`."):new h("The "+u+" `"+p+"` is marked as required in `"+c+"`, but its value is `undefined`."):null:e(a,s,c,u,p)}var a=o.bind(null,!1);return a.isRequired=o.bind(null,!0),a}function g(e){return f((function(t,n,r,o,i,a){var s=t[n];return v(s)!==e?new h("Invalid "+o+" `"+i+"` of type `"+b(s)+"` supplied to `"+r+"`, expected `"+e+"`.",{expectedType:e}):null}))}function x(e,t,n,r,o){return new h((e||"React class")+": "+t+" type `"+n+"."+r+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+o+"`.")}function m(e){switch(typeof e){case"number":case"string":case"undefined":return!0;case"boolean":return!e;case"object":if(Array.isArray(e))return e.every(m);if(null===e||a(e))return!0;var t=function(e){var t=e&&(c&&e[c]||e["@@iterator"]);if("function"==typeof t)return t}(e);if(!t)return!1;var n,r=t.call(e);if(t!==e.entries){for(;!(n=r.next()).done;)if(!m(n.value))return!1}else for(;!(n=r.next()).done;){var o=n.value;if(o&&!m(o[1]))return!1}return!0;default:return!1}}function v(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":function(e,t){return"symbol"===e||!!t&&("Symbol"===t["@@toStringTag"]||"function"==typeof Symbol&&t instanceof Symbol)}(t,e)?"symbol":t}function b(e){if(null==e)return""+e;var t=v(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}function y(e){var t=b(e);switch(t){case"array":case"object":return"an "+t;case"boolean":case"date":case"regexp":return"a "+t;default:return t}}return h.prototype=Error.prototype,u.checkPropTypes=o,u.resetWarningCache=o.resetWarningCache,u.PropTypes=u,u},Da}function Wa(){if(za)return $a.exports;if(za=1,"production"!==process.env.NODE_ENV){var e=Ha();$a.exports=Za()(e.isElement,!0)}else $a.exports=function(){if(Va)return Na;Va=1;var e=Fa();function t(){}function n(){}return n.resetWarningCache=t,Na=function(){function r(t,n,r,o,i,a){if(a!==e){var s=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 s.name="Invariant Violation",s}}function o(){return r}r.isRequired=r;var i={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:o,element:r,elementType:r,instanceOf:o,node:r,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:n,resetWarningCache:t};return i.PropTypes=i,i}}()();return $a.exports}var Ga,Ua={exports:{}};var Xa,Ya={},Ka={};function Ja(){if(Xa)return Ka;return Xa=1,Object.defineProperty(Ka,"__esModule",{value:!0}),Ka.dontSetMe=function(e,t,n){if(e[t])return new Error(`Invalid prop ${t} passed to ${n} - do not set this, set it on the child.`)},Ka.findInArray=function(e,t){for(let n=0,r=e.length;n<r;n++)if(t.apply(t,[e[n],n,e]))return e[n]},Ka.int=function(e){return parseInt(e,10)},Ka.isFunction=function(e){return"function"==typeof e||"[object Function]"===Object.prototype.toString.call(e)},Ka.isNum=function(e){return"number"==typeof e&&!isNaN(e)},Ka}var Qa,es,ts={};function ns(){if(es)return Ya;es=1,Object.defineProperty(Ya,"__esModule",{value:!0}),Ya.addClassName=a,Ya.addEvent=function(e,t,n,r){if(!e)return;const o={capture:!0,...r};e.addEventListener?e.addEventListener(t,n,o):e.attachEvent?e.attachEvent("on"+t,n):e["on"+t]=n},Ya.addUserSelectStyles=function(e){if(!e)return;let t=e.getElementById("react-draggable-style-el");t||(t=e.createElement("style"),t.type="text/css",t.id="react-draggable-style-el",t.innerHTML=".react-draggable-transparent-selection *::-moz-selection {all: inherit;}\n",t.innerHTML+=".react-draggable-transparent-selection *::selection {all: inherit;}\n",e.getElementsByTagName("head")[0].appendChild(t));e.body&&a(e.body,"react-draggable-transparent-selection")},Ya.createCSSTransform=function(e,n){const r=o(e,n,"px");return{[(0,t.browserPrefixToKey)("transform",t.default)]:r}},Ya.createSVGTransform=function(e,t){return o(e,t,"")},Ya.getTouch=function(t,n){return t.targetTouches&&(0,e.findInArray)(t.targetTouches,(e=>n===e.identifier))||t.changedTouches&&(0,e.findInArray)(t.changedTouches,(e=>n===e.identifier))},Ya.getTouchIdentifier=function(e){if(e.targetTouches&&e.targetTouches[0])return e.targetTouches[0].identifier;if(e.changedTouches&&e.changedTouches[0])return e.changedTouches[0].identifier},Ya.getTranslation=o,Ya.innerHeight=function(t){let n=t.clientHeight;const r=t.ownerDocument.defaultView.getComputedStyle(t);return n-=(0,e.int)(r.paddingTop),n-=(0,e.int)(r.paddingBottom),n},Ya.innerWidth=function(t){let n=t.clientWidth;const r=t.ownerDocument.defaultView.getComputedStyle(t);return n-=(0,e.int)(r.paddingLeft),n-=(0,e.int)(r.paddingRight),n},Ya.matchesSelector=r,Ya.matchesSelectorAndParentsTo=function(e,t,n){let o=e;do{if(r(o,t))return!0;if(o===n)return!1;o=o.parentNode}while(o);return!1},Ya.offsetXYFromParent=function(e,t,n){const r=t===t.ownerDocument.body?{left:0,top:0}:t.getBoundingClientRect(),o=(e.clientX+t.scrollLeft-r.left)/n,i=(e.clientY+t.scrollTop-r.top)/n;return{x:o,y:i}},Ya.outerHeight=function(t){let n=t.clientHeight;const r=t.ownerDocument.defaultView.getComputedStyle(t);return n+=(0,e.int)(r.borderTopWidth),n+=(0,e.int)(r.borderBottomWidth),n},Ya.outerWidth=function(t){let n=t.clientWidth;const r=t.ownerDocument.defaultView.getComputedStyle(t);return n+=(0,e.int)(r.borderLeftWidth),n+=(0,e.int)(r.borderRightWidth),n},Ya.removeClassName=s,Ya.removeEvent=function(e,t,n,r){if(!e)return;const o={capture:!0,...r};e.removeEventListener?e.removeEventListener(t,n,o):e.detachEvent?e.detachEvent("on"+t,n):e["on"+t]=null},Ya.scheduleRemoveUserSelectStyles=function(e){window.requestAnimationFrame?window.requestAnimationFrame((()=>{i(e)})):i(e)};var e=Ja(),t=function(e,t){if("function"==typeof WeakMap)var n=new WeakMap,r=new WeakMap;return function(e,t){if(!t&&e&&e.__esModule)return e;var o,i,a={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return a;if(o=t?r:n){if(o.has(e))return o.get(e);o.set(e,a)}for(const t in e)"default"!==t&&{}.hasOwnProperty.call(e,t)&&((i=(o=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,t))&&(i.get||i.set)?o(a,t,i):a[t]=e[t]);return a}(e,t)}(function(){if(Qa)return ts;Qa=1,Object.defineProperty(ts,"__esModule",{value:!0}),ts.browserPrefixToKey=n,ts.browserPrefixToStyle=function(e,t){return t?`-${t.toLowerCase()}-${e}`:e},ts.default=void 0,ts.getPrefix=t;const e=["Moz","Webkit","O","ms"];function t(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"transform";if("undefined"==typeof window)return"";const r=window.document?.documentElement?.style;if(!r)return"";if(t in r)return"";for(let o=0;o<e.length;o++)if(n(t,e[o])in r)return e[o];return""}function n(e,t){return t?`${t}${function(e){let t="",n=!0;for(let r=0;r<e.length;r++)n?(t+=e[r].toUpperCase(),n=!1):"-"===e[r]?n=!0:t+=e[r];return t}(e)}`:e}return ts.default=t(),ts}());let n="";function r(t,r){return n||(n=(0,e.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],(function(n){return(0,e.isFunction)(t[n])}))),!!(0,e.isFunction)(t[n])&&t[n](r)}function o(e,t,n){let{x:r,y:o}=e,i=`translate(${r}${n},${o}${n})`;if(t){i=`translate(${`${"string"==typeof t.x?t.x:t.x+n}`}, ${`${"string"==typeof t.y?t.y:t.y+n}`})`+i}return i}function i(e){if(e)try{if(e.body&&s(e.body,"react-draggable-transparent-selection"),e.selection)e.selection.empty();else{const t=(e.defaultView||window).getSelection();t&&"Caret"!==t.type&&t.removeAllRanges()}}catch(e){}}function a(e,t){e.classList?e.classList.add(t):e.className.match(new RegExp(`(?:^|\\s)${t}(?!\\S)`))||(e.className+=` ${t}`)}function s(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp(`(?:^|\\s)${t}(?!\\S)`,"g"),"")}return Ya}var rs,os={};function is(){if(rs)return os;rs=1,Object.defineProperty(os,"__esModule",{value:!0}),os.canDragX=function(e){return"both"===e.props.axis||"x"===e.props.axis},os.canDragY=function(e){return"both"===e.props.axis||"y"===e.props.axis},os.createCoreData=function(t,r,o){const i=!(0,e.isNum)(t.lastX),a=n(t);return i?{node:a,deltaX:0,deltaY:0,lastX:r,lastY:o,x:r,y:o}:{node:a,deltaX:r-t.lastX,deltaY:o-t.lastY,lastX:t.lastX,lastY:t.lastY,x:r,y:o}},os.createDraggableData=function(e,t){const n=e.props.scale;return{node:t.node,x:e.state.x+t.deltaX/n,y:e.state.y+t.deltaY/n,deltaX:t.deltaX/n,deltaY:t.deltaY/n,lastX:e.state.x,lastY:e.state.y}},os.getBoundPosition=function(r,o,i){if(!r.props.bounds)return[o,i];let{bounds:a}=r.props;a="string"==typeof a?a:function(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}(a);const s=n(r);if("string"==typeof a){const{ownerDocument:n}=s,r=n.defaultView;let o;if("parent"===a)o=s.parentNode;else{o=s.getRootNode().querySelector(a)}if(!(o instanceof r.HTMLElement))throw new Error('Bounds selector "'+a+'" could not find an element.');const i=o,l=r.getComputedStyle(s),c=r.getComputedStyle(i);a={left:-s.offsetLeft+(0,e.int)(c.paddingLeft)+(0,e.int)(l.marginLeft),top:-s.offsetTop+(0,e.int)(c.paddingTop)+(0,e.int)(l.marginTop),right:(0,t.innerWidth)(i)-(0,t.outerWidth)(s)-s.offsetLeft+(0,e.int)(c.paddingRight)-(0,e.int)(l.marginRight),bottom:(0,t.innerHeight)(i)-(0,t.outerHeight)(s)-s.offsetTop+(0,e.int)(c.paddingBottom)-(0,e.int)(l.marginBottom)}}(0,e.isNum)(a.right)&&(o=Math.min(o,a.right));(0,e.isNum)(a.bottom)&&(i=Math.min(i,a.bottom));(0,e.isNum)(a.left)&&(o=Math.max(o,a.left));(0,e.isNum)(a.top)&&(i=Math.max(i,a.top));return[o,i]},os.getControlPosition=function(e,r,o){const i="number"==typeof r?(0,t.getTouch)(e,r):null;if("number"==typeof r&&!i)return null;const a=n(o),s=o.props.offsetParent||a.offsetParent||a.ownerDocument.body;return(0,t.offsetXYFromParent)(i||e,s,o.props.scale)},os.snapToGrid=function(e,t,n){const r=Math.round(t/e[0])*e[0],o=Math.round(n/e[1])*e[1];return[r,o]};var e=Ja(),t=ns();function n(e){const t=e.findDOMNode();if(!t)throw new Error("<DraggableCore>: Unmounted during event!");return t}return os}var as,ss,ls,cs,ds={},us={};function ps(){if(as)return us;return as=1,Object.defineProperty(us,"__esModule",{value:!0}),us.default=function(){},us}function hs(){if(ss)return ds;ss=1,Object.defineProperty(ds,"__esModule",{value:!0}),ds.default=void 0;var e=function(e,t){if("function"==typeof WeakMap)var n=new WeakMap,r=new WeakMap;return function(e,t){if(!t&&e&&e.__esModule)return e;var o,i,a={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return a;if(o=t?r:n){if(o.has(e))return o.get(e);o.set(e,a)}for(const t in e)"default"!==t&&{}.hasOwnProperty.call(e,t)&&((i=(o=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,t))&&(i.get||i.set)?o(a,t,i):a[t]=e[t]);return a}(e,t)}(n),t=c(Wa()),r=c(i),o=ns(),a=is(),s=Ja(),l=c(ps());function c(e){return e&&e.__esModule?e:{default:e}}function d(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const u={start:"touchstart",move:"touchmove",stop:"touchend"},p={start:"mousedown",move:"mousemove",stop:"mouseup"};let h=p,f=class extends e.Component{constructor(){super(...arguments),d(this,"dragging",!1),d(this,"lastX",NaN),d(this,"lastY",NaN),d(this,"touchIdentifier",null),d(this,"mounted",!1),d(this,"handleDragStart",(e=>{if(this.props.onMouseDown(e),!this.props.allowAnyClick&&"number"==typeof e.button&&0!==e.button)return!1;const t=this.findDOMNode();if(!t||!t.ownerDocument||!t.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:n}=t;if(this.props.disabled||!(e.target instanceof n.defaultView.Node)||this.props.handle&&!(0,o.matchesSelectorAndParentsTo)(e.target,this.props.handle,t)||this.props.cancel&&(0,o.matchesSelectorAndParentsTo)(e.target,this.props.cancel,t))return;"touchstart"!==e.type||this.props.allowMobileScroll||e.preventDefault();const r=(0,o.getTouchIdentifier)(e);this.touchIdentifier=r;const i=(0,a.getControlPosition)(e,r,this);if(null==i)return;const{x:s,y:c}=i,d=(0,a.createCoreData)(this,s,c);(0,l.default)("DraggableCore: handleDragStart: %j",d),(0,l.default)("calling",this.props.onStart);!1!==this.props.onStart(e,d)&&!1!==this.mounted&&(this.props.enableUserSelectHack&&(0,o.addUserSelectStyles)(n),this.dragging=!0,this.lastX=s,this.lastY=c,(0,o.addEvent)(n,h.move,this.handleDrag),(0,o.addEvent)(n,h.stop,this.handleDragStop))})),d(this,"handleDrag",(e=>{const t=(0,a.getControlPosition)(e,this.touchIdentifier,this);if(null==t)return;let{x:n,y:r}=t;if(Array.isArray(this.props.grid)){let e=n-this.lastX,t=r-this.lastY;if([e,t]=(0,a.snapToGrid)(this.props.grid,e,t),!e&&!t)return;n=this.lastX+e,r=this.lastY+t}const o=(0,a.createCoreData)(this,n,r);(0,l.default)("DraggableCore: handleDrag: %j",o);if(!1!==this.props.onDrag(e,o)&&!1!==this.mounted)this.lastX=n,this.lastY=r;else try{this.handleDragStop(new MouseEvent("mouseup"))}catch(e){const t=document.createEvent("MouseEvents");t.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(t)}})),d(this,"handleDragStop",(e=>{if(!this.dragging)return;const t=(0,a.getControlPosition)(e,this.touchIdentifier,this);if(null==t)return;let{x:n,y:r}=t;if(Array.isArray(this.props.grid)){let e=n-this.lastX||0,t=r-this.lastY||0;[e,t]=(0,a.snapToGrid)(this.props.grid,e,t),n=this.lastX+e,r=this.lastY+t}const i=(0,a.createCoreData)(this,n,r);if(!1===this.props.onStop(e,i)||!1===this.mounted)return!1;const s=this.findDOMNode();s&&this.props.enableUserSelectHack&&(0,o.scheduleRemoveUserSelectStyles)(s.ownerDocument),(0,l.default)("DraggableCore: handleDragStop: %j",i),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,s&&((0,l.default)("DraggableCore: Removing handlers"),(0,o.removeEvent)(s.ownerDocument,h.move,this.handleDrag),(0,o.removeEvent)(s.ownerDocument,h.stop,this.handleDragStop))})),d(this,"onMouseDown",(e=>(h=p,this.handleDragStart(e)))),d(this,"onMouseUp",(e=>(h=p,this.handleDragStop(e)))),d(this,"onTouchStart",(e=>(h=u,this.handleDragStart(e)))),d(this,"onTouchEnd",(e=>(h=u,this.handleDragStop(e))))}componentDidMount(){this.mounted=!0;const e=this.findDOMNode();e&&(0,o.addEvent)(e,u.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const e=this.findDOMNode();if(e){const{ownerDocument:t}=e;(0,o.removeEvent)(t,p.move,this.handleDrag),(0,o.removeEvent)(t,u.move,this.handleDrag),(0,o.removeEvent)(t,p.stop,this.handleDragStop),(0,o.removeEvent)(t,u.stop,this.handleDragStop),(0,o.removeEvent)(e,u.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,o.scheduleRemoveUserSelectStyles)(t)}}findDOMNode(){return this.props?.nodeRef?this.props?.nodeRef?.current:r.default.findDOMNode(this)}render(){return e.cloneElement(e.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};return ds.default=f,d(f,"displayName","DraggableCore"),d(f,"propTypes",{allowAnyClick:t.default.bool,allowMobileScroll:t.default.bool,children:t.default.node.isRequired,disabled:t.default.bool,enableUserSelectHack:t.default.bool,offsetParent:function(e,t){if(e[t]&&1!==e[t].nodeType)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:t.default.arrayOf(t.default.number),handle:t.default.string,cancel:t.default.string,nodeRef:t.default.object,onStart:t.default.func,onDrag:t.default.func,onStop:t.default.func,onMouseDown:t.default.func,scale:t.default.number,className:s.dontSetMe,style:s.dontSetMe,transform:s.dontSetMe}),d(f,"defaultProps",{allowAnyClick:!1,allowMobileScroll:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1}),ds}function fs(){return ls||(ls=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"DraggableCore",{enumerable:!0,get:function(){return d.default}}),e.default=void 0;var t=function(e,t){if("function"==typeof WeakMap)var n=new WeakMap,r=new WeakMap;return function(e,t){if(!t&&e&&e.__esModule)return e;var o,i,a={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return a;if(o=t?r:n){if(o.has(e))return o.get(e);o.set(e,a)}for(const t in e)"default"!==t&&{}.hasOwnProperty.call(e,t)&&((i=(o=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,t))&&(i.get||i.set)?o(a,t,i):a[t]=e[t]);return a}(e,t)}(n),r=p(Wa()),o=p(i),a=function(){if(Ga)return Ua.exports;function e(t){var n,r,o="";if("string"==typeof t||"number"==typeof t)o+=t;else if("object"==typeof t)if(Array.isArray(t)){var i=t.length;for(n=0;n<i;n++)t[n]&&(r=e(t[n]))&&(o&&(o+=" "),o+=r)}else for(r in t)t[r]&&(o&&(o+=" "),o+=r);return o}function t(){for(var t,n,r=0,o="",i=arguments.length;r<i;r++)(t=arguments[r])&&(n=e(t))&&(o&&(o+=" "),o+=n);return o}return Ga=1,Ua.exports=t,Ua.exports.clsx=t,Ua.exports}(),s=ns(),l=is(),c=Ja(),d=p(hs()),u=p(ps());function p(e){return e&&e.__esModule?e:{default:e}}function h(){return h=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},h.apply(null,arguments)}function f(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class g extends t.Component{static getDerivedStateFromProps(e,t){let{position:n}=e,{prevPropsPosition:r}=t;return!n||r&&n.x===r.x&&n.y===r.y?null:((0,u.default)("Draggable: getDerivedStateFromProps %j",{position:n,prevPropsPosition:r}),{x:n.x,y:n.y,prevPropsPosition:{...n}})}constructor(e){super(e),f(this,"onDragStart",((e,t)=>{(0,u.default)("Draggable: onDragStart: %j",t);if(!1===this.props.onStart(e,(0,l.createDraggableData)(this,t)))return!1;this.setState({dragging:!0,dragged:!0})})),f(this,"onDrag",((e,t)=>{if(!this.state.dragging)return!1;(0,u.default)("Draggable: onDrag: %j",t);const n=(0,l.createDraggableData)(this,t),r={x:n.x,y:n.y,slackX:0,slackY:0};if(this.props.bounds){const{x:e,y:t}=r;r.x+=this.state.slackX,r.y+=this.state.slackY;const[o,i]=(0,l.getBoundPosition)(this,r.x,r.y);r.x=o,r.y=i,r.slackX=this.state.slackX+(e-r.x),r.slackY=this.state.slackY+(t-r.y),n.x=r.x,n.y=r.y,n.deltaX=r.x-this.state.x,n.deltaY=r.y-this.state.y}if(!1===this.props.onDrag(e,n))return!1;this.setState(r)})),f(this,"onDragStop",((e,t)=>{if(!this.state.dragging)return!1;if(!1===this.props.onStop(e,(0,l.createDraggableData)(this,t)))return!1;(0,u.default)("Draggable: onDragStop: %j",t);const n={dragging:!1,slackX:0,slackY:0};if(Boolean(this.props.position)){const{x:e,y:t}=this.props.position;n.x=e,n.y=t}this.setState(n)})),this.state={dragging:!1,dragged:!1,x:e.position?e.position.x:e.defaultPosition.x,y:e.position?e.position.y:e.defaultPosition.y,prevPropsPosition:{...e.position},slackX:0,slackY:0,isElementSVG:!1},!e.position||e.onDrag||e.onStop||console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){void 0!==window.SVGElement&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.state.dragging&&this.setState({dragging:!1})}findDOMNode(){return this.props?.nodeRef?.current??o.default.findDOMNode(this)}render(){const{axis:e,bounds:n,children:r,defaultPosition:o,defaultClassName:i,defaultClassNameDragging:c,defaultClassNameDragged:u,position:p,positionOffset:f,scale:g,...x}=this.props;let m={},v=null;const b=!Boolean(p)||this.state.dragging,y=p||o,w={x:(0,l.canDragX)(this)&&b?this.state.x:y.x,y:(0,l.canDragY)(this)&&b?this.state.y:y.y};this.state.isElementSVG?v=(0,s.createSVGTransform)(w,f):m=(0,s.createCSSTransform)(w,f);const C=(0,a.clsx)(r.props.className||"",i,{[c]:this.state.dragging,[u]:this.state.dragged});return t.createElement(d.default,h({},x,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),t.cloneElement(t.Children.only(r),{className:C,style:{...r.props.style,...m},transform:v}))}}e.default=g,f(g,"displayName","Draggable"),f(g,"propTypes",{...d.default.propTypes,axis:r.default.oneOf(["both","x","y","none"]),bounds:r.default.oneOfType([r.default.shape({left:r.default.number,right:r.default.number,top:r.default.number,bottom:r.default.number}),r.default.string,r.default.oneOf([!1])]),defaultClassName:r.default.string,defaultClassNameDragging:r.default.string,defaultClassNameDragged:r.default.string,defaultPosition:r.default.shape({x:r.default.number,y:r.default.number}),positionOffset:r.default.shape({x:r.default.oneOfType([r.default.number,r.default.string]),y:r.default.oneOfType([r.default.number,r.default.string])}),position:r.default.shape({x:r.default.number,y:r.default.number}),className:c.dontSetMe,style:c.dontSetMe,transform:c.dontSetMe}),f(g,"defaultProps",{...d.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})}(ka)),ka}var gs=function(){if(cs)return ja.exports;cs=1;const{default:e,DraggableCore:t}=fs();return ja.exports=e,ja.exports.default=e,ja.exports.DraggableCore=t,ja.exports}(),xs=wa(gs);const ms=e=>"number"==typeof e?`${(e=>parseFloat(e.toFixed(4)).toString())(.25*e)}rem`:e,vs=(e="medium",t,n,r)=>{const i=t?ms(t):{xsmall:"15rem",small:"20rem",medium:"30rem",large:"40rem",xlarge:"60rem","full-width":"90%"}[e]||"15rem",a=r?ms(r):{xsmall:"35rem",small:"45rem",medium:"45rem",large:"45rem",xlarge:"45rem","full-width":"unset"}[e]||"35rem",s="unset"===a?"80vh":`min(${a}, 80vh)`;let l="auto";return n?l=ms(n):"full-width"===e&&(l="90%"),o.css`
2399
2404
  max-width: 100%;
2400
2405
  width: ${i};
2401
2406
  height: ${l};
2402
2407
  max-height: ${s};
2403
2408
  background-color: ${h("neutral",100)};
2404
- border: 1px solid ${h("neutral",300)};
2405
- border-radius: 4px;
2406
- box-shadow: 0px 4px 6px -4px #0000001a;
2407
- box-shadow: 0px 10px 15px -3px #0000001a;
2408
- `},vs=o.css`
2409
+ border: 0.0625rem solid ${h("neutral",300)};
2410
+ border-radius: 0.25rem;
2411
+ box-shadow: 0 0.25rem 0.375rem -0.25rem #0000001a;
2412
+ box-shadow: 0 0.625rem 0.9375rem -0.1875rem #0000001a;
2413
+ `},bs=o.css`
2409
2414
  height: 100%;
2410
- min-height: 40px;
2415
+ min-height: 2.5rem;
2411
2416
  display: flex;
2412
2417
  align-items: center;
2413
2418
  justify-content: space-between;
2414
- padding: 8px;
2415
- border-bottom: 1px solid ${h("neutral",300)};
2416
- `,bs=o.css`
2417
- top: 10px;
2419
+ padding: 0.5rem;
2420
+ border-bottom: 0.0625rem solid ${h("neutral",300)};
2418
2421
  `,ys=o.css`
2419
- padding: 12px;
2420
- `,ws=e=>o.css`
2422
+ top: 0.625rem;
2423
+ `,ws=o.css`
2424
+ padding: 0.75rem;
2425
+ `,Cs=e=>o.css`
2421
2426
  height: 100%;
2422
- width: ${e||"320px"};
2427
+ width: ${e||"20rem"};
2423
2428
  background-color: ${h("neutral",100)};
2424
- box-shadow: 0px 1px 2px -1px #0000001a;
2425
- box-shadow: 0px 1px 3px 0px #0000001a;
2429
+ box-shadow: 0 0.0625rem 0.125rem -0.0625rem #0000001a;
2430
+ box-shadow: 0 0.0625rem 0.1875rem 0 #0000001a;
2426
2431
  position: relative;
2427
- `,Cs=o.css`
2428
- border-right: 1px solid ${h("neutral",300)};
2429
2432
  `,js=o.css`
2430
- border: 1px solid ${h("neutral",300)};
2431
- border-radius: 4px;
2433
+ border-right: 0.0625rem solid ${h("neutral",300)};
2432
2434
  `,ks=o.css`
2433
- min-height: 48px;
2435
+ border: 0.0625rem solid ${h("neutral",300)};
2436
+ border-radius: 0.25rem;
2437
+ `,$s=o.css`
2438
+ min-height: 3rem;
2434
2439
  width: 100%;
2435
- border-bottom: 1px solid ${h("neutral",300)};
2436
- `,$s=(e,t)=>o.css`
2437
- height: ${((e,t)=>e&&t?`calc(100% - ${e+t}px)`:e?`calc(100% - ${e}px)`:t?`calc(100% - ${t}px)`:"100%")(e,t)};
2440
+ border-bottom: 0.0625rem solid ${h("neutral",300)};
2441
+ `,Ss=(e,t)=>o.css`
2442
+ height: ${((e,t)=>e&&t?`calc(100% - ${(e+t)/16}rem)`:e?`calc(100% - ${e/16}rem)`:t?`calc(100% - ${t/16}rem)`:"100%")(e,t)};
2438
2443
  width: 100%;
2439
2444
  overflow-y: auto;
2440
2445
 
2441
2446
  &:focus-visible {
2442
2447
  outline-color: ${h("primary",700)};
2443
2448
  }
2444
- `,Ss=o.css`
2445
- min-height: 64px;
2449
+ `,Es=o.css`
2450
+ min-height: 4rem;
2446
2451
  width: 100%;
2447
2452
  display: flex;
2448
2453
  align-items: center;
@@ -2450,8 +2455,8 @@
2450
2455
  position: absolute;
2451
2456
  bottom: 0;
2452
2457
  left: 0;
2453
- border-top: 1px solid ${h("neutral",300)};
2454
- `;var Es,Ls;!function(){if(Ls)return Es;Ls=1;var e=function(){};if("production"!==process.env.NODE_ENV){var t=function(e,t){var n=arguments.length;t=new Array(n>1?n-1:0);for(var r=1;r<n;r++)t[r-1]=arguments[r];var o=0,i="Warning: "+e.replace(/%s/g,(function(){return t[o++]}));"undefined"!=typeof console&&console.error(i);try{throw new Error(i)}catch(e){}};e=function(e,n,r){var o=arguments.length;r=new Array(o>2?o-2:0);for(var i=2;i<o;i++)r[i-2]=arguments[i];if(void 0===n)throw new Error("`warning(condition, format, ...args)` requires a warning message argument");e||t.apply(null,[n].concat(r))}}Es=e}();var Rs=Ts()?n.useLayoutEffect:n.useEffect;"production"!==process.env.NODE_ENV&&("undefined"!=typeof process?process:{env:{NODE_ENV:"development"}}).env;function Ts(){return!("undefined"==typeof window||!window.document||!window.document.createElement)}process.env.NODE_ENV,process.env.NODE_ENV,process.env.NODE_ENV;var Os=function(e){var t,r=e.children,o=e.type,a=void 0===o?"reach-portal":o,s=n.useRef(null),l=n.useRef(null),c=(t=n.useState(Object.create(null))[1],n.useCallback((function(){t(Object.create(null))}),[]));return Rs((function(){if(s.current){var e=s.current.ownerDocument;return l.current=null==e?void 0:e.createElement(a),e.body.appendChild(l.current),c(),function(){l.current&&l.current.ownerDocument&&l.current.ownerDocument.body.removeChild(l.current)}}}),[a,c]),l.current?i.createPortal(r,l.current):n.createElement("span",{ref:s})};"production"!==process.env.NODE_ENV&&(Os.displayName="Portal");
2458
+ border-top: 0.0625rem solid ${h("neutral",300)};
2459
+ `;var Ls,Rs;!function(){if(Rs)return Ls;Rs=1;var e=function(){};if("production"!==process.env.NODE_ENV){var t=function(e,t){var n=arguments.length;t=new Array(n>1?n-1:0);for(var r=1;r<n;r++)t[r-1]=arguments[r];var o=0,i="Warning: "+e.replace(/%s/g,(function(){return t[o++]}));"undefined"!=typeof console&&console.error(i);try{throw new Error(i)}catch(e){}};e=function(e,n,r){var o=arguments.length;r=new Array(o>2?o-2:0);for(var i=2;i<o;i++)r[i-2]=arguments[i];if(void 0===n)throw new Error("`warning(condition, format, ...args)` requires a warning message argument");e||t.apply(null,[n].concat(r))}}Ls=e}();var Ts=Os()?n.useLayoutEffect:n.useEffect;"production"!==process.env.NODE_ENV&&("undefined"!=typeof process?process:{env:{NODE_ENV:"development"}}).env;function Os(){return!("undefined"==typeof window||!window.document||!window.document.createElement)}process.env.NODE_ENV,process.env.NODE_ENV,process.env.NODE_ENV;var Ps=function(e){var t,r=e.children,o=e.type,a=void 0===o?"reach-portal":o,s=n.useRef(null),l=n.useRef(null),c=(t=n.useState(Object.create(null))[1],n.useCallback((function(){t(Object.create(null))}),[]));return Ts((function(){if(s.current){var e=s.current.ownerDocument;return l.current=null==e?void 0:e.createElement(a),e.body.appendChild(l.current),c(),function(){l.current&&l.current.ownerDocument&&l.current.ownerDocument.body.removeChild(l.current)}}}),[a,c]),l.current?i.createPortal(r,l.current):n.createElement("span",{ref:s})};"production"!==process.env.NODE_ENV&&(Ps.displayName="Portal");
2455
2460
  /*! *****************************************************************************
2456
2461
  Copyright (c) Microsoft Corporation.
2457
2462
 
@@ -2465,33 +2470,33 @@ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
2465
2470
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
2466
2471
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
2467
2472
  PERFORMANCE OF THIS SOFTWARE.
2468
- ***************************************************************************** */var Ps,Ms,_s=function(){return _s=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},_s.apply(this,arguments)};function Is(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}function Ds(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function As(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}function Ns(e,t,n){if(2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}!function(e){e.Start="xstate.start",e.Stop="xstate.stop",e.Raise="xstate.raise",e.Send="xstate.send",e.Cancel="xstate.cancel",e.NullEvent="",e.Assign="xstate.assign",e.After="xstate.after",e.DoneState="done.state",e.DoneInvoke="done.invoke",e.Log="xstate.log",e.Init="xstate.init",e.Invoke="xstate.invoke",e.ErrorExecution="error.execution",e.ErrorCommunication="error.communication",e.ErrorPlatform="error.platform",e.ErrorCustom="xstate.error",e.Update="xstate.update",e.Pure="xstate.pure",e.Choose="xstate.choose"}(Ps||(Ps={})),function(e){e.Parent="#_parent",e.Internal="#_internal"}(Ms||(Ms={}));var Vs=Ps.Start,zs=Ps.Stop,Bs=Ps.Raise,Hs=Ps.Send,Fs=Ps.Cancel,qs=Ps.NullEvent,Zs=Ps.Assign;Ps.After,Ps.DoneState;var Ws=Ps.Log,Gs=Ps.Init,Us=Ps.Invoke;Ps.ErrorExecution;var Xs,Ys=Ps.ErrorPlatform,Ks=Ps.ErrorCustom,Js=Ps.Update,Qs=Ps.Choose,el=Ps.Pure,tl={},nl="xstate.guard",rl="production"===process.env.NODE_ENV;function ol(e,t,n){void 0===n&&(n=".");var r=sl(e,n),o=sl(t,n);return jl(o)?!!jl(r)&&o===r:jl(r)?r in o:Object.keys(r).every((function(e){return e in o&&ol(r[e],o[e])}))}function il(e){try{return jl(e)||"number"==typeof e?"".concat(e):e.type}catch(e){throw new Error("Events must be strings or objects with a string event.type property.")}}function al(e,t){try{return wl(e)?e:e.toString().split(t)}catch(t){throw new Error("'".concat(e,"' is not a valid state path."))}}function sl(e,t){return"object"==typeof(n=e)&&"value"in n&&"context"in n&&"event"in n&&"_event"in n?e.value:wl(e)?ll(e):"string"!=typeof e?e:ll(al(e,t));var n}function ll(e){if(1===e.length)return e[0];for(var t={},n=t,r=0;r<e.length-1;r++)r===e.length-2?n[e[r]]=e[r+1]:(n[e[r]]={},n=n[e[r]]);return t}function cl(e,t){for(var n={},r=Object.keys(e),o=0;o<r.length;o++){var i=r[o];n[i]=t(e[i],i,e,o)}return n}function dl(e,t,n){var r,o,i={};try{for(var a=Ds(Object.keys(e)),s=a.next();!s.done;s=a.next()){var l=s.value,c=e[l];n(c)&&(i[l]=t(c,l,e))}}catch(e){r={error:e}}finally{try{s&&!s.done&&(o=a.return)&&o.call(a)}finally{if(r)throw r.error}}return i}var ul=function(e){return function(t){var n,r,o=t;try{for(var i=Ds(e),a=i.next();!a.done;a=i.next()){o=o[a.value]}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return o}};function pl(e){return e?jl(e)?[[e]]:hl(Object.keys(e).map((function(t){var n=e[t];return"string"==typeof n||n&&Object.keys(n).length?pl(e[t]).map((function(e){return[t].concat(e)})):[[t]]}))):[[]]}function hl(e){var t;return(t=[]).concat.apply(t,Ns([],As(e),!1))}function fl(e){return wl(e)?e:[e]}function gl(e){return void 0===e?[]:fl(e)}function xl(e,t,n){var r,o;if(Cl(e))return e(t,n.data);var i={};try{for(var a=Ds(Object.keys(e)),s=a.next();!s.done;s=a.next()){var l=s.value,c=e[l];Cl(c)?i[l]=c(t,n.data):i[l]=c}}catch(e){r={error:e}}finally{try{s&&!s.done&&(o=a.return)&&o.call(a)}finally{if(r)throw r.error}}return i}function ml(e){return e instanceof Promise||!(null===e||!Cl(e)&&"object"!=typeof e||!Cl(e.then))}function vl(e,t){return cl(e.states,(function(e,n){if(e){var r=(jl(t)?void 0:t[n])||(e?e.current:void 0);if(r)return{current:r,states:vl(e,r)}}}))}function bl(e,t,n,r){rl||yl(!!e,"Attempting to update undefined context");var o=e?n.reduce((function(e,n){var o,i,a=n.assignment,s={state:r,action:n,_event:t},l={};if(Cl(a))l=a(e,t.data,s);else try{for(var c=Ds(Object.keys(a)),d=c.next();!d.done;d=c.next()){var u=d.value,p=a[u];l[u]=Cl(p)?p(e,t.data,s):p}}catch(e){o={error:e}}finally{try{d&&!d.done&&(i=c.return)&&i.call(c)}finally{if(o)throw o.error}}return Object.assign({},e,l)}),e):e;return o}var yl=function(){};function wl(e){return Array.isArray(e)}function Cl(e){return"function"==typeof e}function jl(e){return"string"==typeof e}function kl(e,t){if(e)return jl(e)?{type:nl,name:e,predicate:t?t[e]:void 0}:Cl(e)?{type:nl,name:e.name,predicate:e}:e}rl||(yl=function(e,t){var n=e instanceof Error?e:void 0;if((n||!e)&&void 0!==console){var r=["Warning: ".concat(t)];n&&r.push(n),console.warn.apply(console,r)}});var $l=function(){return"function"==typeof Symbol&&Symbol.observable||"@@observable"}();function Sl(e){return!!e&&"__xstatenode"in e}function El(e,t){return jl(e)||"number"==typeof e?_s({type:e},t):e}function Ll(e,t){if(!jl(e)&&"$$type"in e&&"scxml"===e.$$type)return e;var n=El(e);return _s({name:n.type,data:n,$$type:"scxml",type:"external"},t)}function Rl(e,t){return fl(t).map((function(t){return void 0===t||"string"==typeof t||Sl(t)?{target:t,event:e}:_s(_s({},t),{event:e})}))}function Tl(e,t,n,r,o){var i=e.options.guards,a={state:o,cond:t,_event:r};if(t.type===nl)return((null==i?void 0:i[t.name])||t.predicate)(n,r.data,a);var s=null==i?void 0:i[t.type];if(!s)throw new Error("Guard '".concat(t.type,"' is not implemented on machine '").concat(e.id,"'."));return s(n,r.data,a)}function Ol(e){return"string"==typeof e?{type:e}:e}function Pl(e,t,n){var r=function(){},o="object"==typeof e,i=o?e:null;return{next:((o?e.next:e)||r).bind(i),error:((o?e.error:t)||r).bind(i),complete:((o?e.complete:n)||r).bind(i)}}function Ml(e,t){return"".concat(e,":invocation[").concat(t,"]")}function _l(e){return(e.type===Bs||e.type===Hs&&e.to===Ms.Internal)&&"number"!=typeof e.delay}(Xs={})[$l]=function(){return this},Xs[Symbol.observable]=function(){return this};var Il=Ll({type:Gs});function Dl(e,t){return t&&t[e]||void 0}function Al(e,t){var n;if(jl(e)||"number"==typeof e)n=Cl(r=Dl(e,t))?{type:e,exec:r}:r||{type:e,exec:void 0};else if(Cl(e))n={type:e.name||e.toString(),exec:e};else{var r;if(Cl(r=Dl(e.type,t)))n=_s(_s({},e),{exec:r});else if(r){var o=r.type||e.type;n=_s(_s(_s({},r),e),{type:o})}else n=e}return n}var Nl=function(e,t){return e?(wl(e)?e:[e]).map((function(e){return Al(e,t)})):[]};function Vl(e){var t=Al(e);return _s(_s({id:jl(e)?e:t.id},t),{type:t.type})}function zl(e,t){var n="".concat(Ps.DoneState,".").concat(e),r={type:n,data:t,toString:function(){return n}};return r}function Bl(e,t){var n="".concat(Ps.DoneInvoke,".").concat(e),r={type:n,data:t,toString:function(){return n}};return r}function Hl(e,t){var n="".concat(Ps.ErrorPlatform,".").concat(e),r={type:n,data:t,toString:function(){return n}};return r}function Fl(e,t,n,r,o,i,a){void 0===a&&(a=!1);var s=a?[]:function(e){var t,n,r=[];try{for(var o=Ds(e),i=o.next();!i.done;i=o.next())for(var a=i.value,s=0;s<a.actions.length;)a.actions[s].type!==Zs?s++:(r.push(a.actions[s]),a.actions.splice(s,1))}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return r}(o),l=s.length?bl(n,r,s,t):n,c=a?[n]:void 0,d=[];function u(o,s){var u;switch(s.type){case Bs:var p=function(e,t,n,r){var o,i={_event:n},a=Ll(Cl(e.event)?e.event(t,n.data,i):e.event);if(jl(e.delay)){var s=r&&r[e.delay];o=Cl(s)?s(t,n.data,i):s}else o=Cl(e.delay)?e.delay(t,n.data,i):e.delay;return _s(_s({},e),{type:Bs,_event:a,delay:o})}(s,l,r,e.options.delays);return i&&"number"==typeof p.delay&&i(p,l,r),p;case Hs:var h=function(e,t,n,r){var o,i={_event:n},a=Ll(Cl(e.event)?e.event(t,n.data,i):e.event);if(jl(e.delay)){var s=r&&r[e.delay];o=Cl(s)?s(t,n.data,i):s}else o=Cl(e.delay)?e.delay(t,n.data,i):e.delay;var l=Cl(e.to)?e.to(t,n.data,i):e.to;return _s(_s({},e),{to:l,_event:a,event:a.data,delay:o})}(s,l,r,e.options.delays);if(!rl){var f=s.delay;yl(!jl(f)||"number"==typeof h.delay,"No delay reference for delay expression '".concat(f,"' was found on machine '").concat(e.id,"'"))}return i&&h.to!==Ms.Internal&&("entry"===o?d.push(h):i(h,l,r)),h;case Ws:var g=function(e,t,n){return _s(_s({},e),{value:jl(e.expr)?e.expr:e.expr(t,n.data,{_event:n})})}(s,l,r);return null==i||i(g,l,r),g;case Qs:if(!(b=null===(u=s.conds.find((function(n){var o=kl(n.cond,e.options.guards);return!o||Tl(e,o,l,r,i?void 0:t)})))||void 0===u?void 0:u.actions))return[];var x=As(Fl(e,t,l,r,[{type:o,actions:Nl(gl(b),e.options.actions)}],i,a),2),m=x[0],v=x[1];return l=v,null==c||c.push(l),m;case el:var b;if(!(b=s.get(l,r.data)))return[];var y=As(Fl(e,t,l,r,[{type:o,actions:Nl(gl(b),e.options.actions)}],i,a),2),w=y[0],C=y[1];return l=C,null==c||c.push(l),w;case zs:g=function(e,t,n){var r=Cl(e.activity)?e.activity(t,n.data):e.activity,o="string"==typeof r?{id:r}:r;return{type:Ps.Stop,activity:o}}(s,l,r);return null==i||i(g,n,r),g;case Zs:l=bl(l,r,[s],i?void 0:t),null==c||c.push(l);break;default:var j=Al(s,e.options.actions),k=j.exec;if(i)i(j,l,r);else if(k&&c){var $=c.length-1,S=_s(_s({},j),{exec:function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];k.apply(void 0,Ns([c[$]],As(t),!1))}});j=S}return j}}var p=hl(o.map((function(e){var t,n,o=[];try{for(var a=Ds(e.actions),s=a.next();!s.done;s=a.next()){var c=s.value,p=u(e.type,c);p&&(o=o.concat(p))}}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}return d.forEach((function(e){i(e,l,r)})),d.length=0,o})));return[p,l]}var ql=function(e,t){return t(e)};function Zl(e){var t;return(t={id:e,send:function(){},subscribe:function(){return{unsubscribe:function(){}}},getSnapshot:function(){},toJSON:function(){return{id:e}}})[$l]=function(){return this},t}function Wl(e,t,n){var r=Zl(t);if(r.deferred=!0,Sl(e)){var o=r.state=ql(void 0,(function(){return(n?e.withContext(n):e).initialState}));r.getSnapshot=function(){return o}}return r}var Gl=function(e){return"atomic"===e.type||"final"===e.type};function Ul(e){return Object.keys(e.states).map((function(t){return e.states[t]}))}function Xl(e){return Ul(e).filter((function(e){return"history"!==e.type}))}function Yl(e){var t=[e];return Gl(e)?t:t.concat(hl(Xl(e).map(Yl)))}function Kl(e,t){var n,r,o,i,a,s,l,c,d=Ql(new Set(e)),u=new Set(t);try{for(var p=Ds(u),h=p.next();!h.done;h=p.next())for(var f=(j=h.value).parent;f&&!u.has(f);)u.add(f),f=f.parent}catch(e){n={error:e}}finally{try{h&&!h.done&&(r=p.return)&&r.call(p)}finally{if(n)throw n.error}}var g=Ql(u);try{for(var x=Ds(u),m=x.next();!m.done;m=x.next()){if("compound"!==(j=m.value).type||g.get(j)&&g.get(j).length){if("parallel"===j.type)try{for(var v=(a=void 0,Ds(Xl(j))),b=v.next();!b.done;b=v.next()){var y=b.value;u.has(y)||(u.add(y),d.get(y)?d.get(y).forEach((function(e){return u.add(e)})):y.initialStateNodes.forEach((function(e){return u.add(e)})))}}catch(e){a={error:e}}finally{try{b&&!b.done&&(s=v.return)&&s.call(v)}finally{if(a)throw a.error}}}else d.get(j)?d.get(j).forEach((function(e){return u.add(e)})):j.initialStateNodes.forEach((function(e){return u.add(e)}))}}catch(e){o={error:e}}finally{try{m&&!m.done&&(i=x.return)&&i.call(x)}finally{if(o)throw o.error}}try{for(var w=Ds(u),C=w.next();!C.done;C=w.next()){var j;for(f=(j=C.value).parent;f&&!u.has(f);)u.add(f),f=f.parent}}catch(e){l={error:e}}finally{try{C&&!C.done&&(c=w.return)&&c.call(w)}finally{if(l)throw l.error}}return u}function Jl(e,t){var n=t.get(e);if(!n)return{};if("compound"===e.type){var r=n[0];if(!r)return{};if(Gl(r))return r.key}var o={};return n.forEach((function(e){o[e.key]=Jl(e,t)})),o}function Ql(e){var t,n,r=new Map;try{for(var o=Ds(e),i=o.next();!i.done;i=o.next()){var a=i.value;r.has(a)||r.set(a,[]),a.parent&&(r.has(a.parent)||r.set(a.parent,[]),r.get(a.parent).push(a))}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return r}function ec(e,t){return Jl(e,Ql(Kl([e],t)))}function tc(e,t){return Array.isArray(e)?e.some((function(e){return e===t})):e instanceof Set&&e.has(t)}function nc(e,t){return"compound"===t.type?Xl(t).some((function(t){return"final"===t.type&&tc(e,t)})):"parallel"===t.type&&Xl(t).every((function(t){return nc(e,t)}))}function rc(e){return new Set(hl(e.map((function(e){return e.tags}))))}function oc(e,t){if(e===t)return!0;if(void 0===e||void 0===t)return!1;if(jl(e)||jl(t))return e===t;var n=Object.keys(e),r=Object.keys(t);return n.length===r.length&&n.every((function(n){return oc(e[n],t[n])}))}var ic=function(){function e(e){var t,n,r=this;this.actions=[],this.activities=tl,this.meta={},this.events=[],this.value=e.value,this.context=e.context,this._event=e._event,this._sessionid=e._sessionid,this.event=this._event.data,this.historyValue=e.historyValue,this.history=e.history,this.actions=e.actions||[],this.activities=e.activities||tl,this.meta=(void 0===(n=e.configuration)&&(n=[]),n.reduce((function(e,t){return void 0!==t.meta&&(e[t.id]=t.meta),e}),{})),this.events=e.events||[],this.matches=this.matches.bind(this),this.toStrings=this.toStrings.bind(this),this.configuration=e.configuration,this.transitions=e.transitions,this.children=e.children,this.done=!!e.done,this.tags=null!==(t=Array.isArray(e.tags)?new Set(e.tags):e.tags)&&void 0!==t?t:new Set,this.machine=e.machine,Object.defineProperty(this,"nextEvents",{get:function(){return function(e){return Ns([],As(new Set(hl(Ns([],As(e.map((function(e){return e.ownEvents}))),!1)))),!1)}(r.configuration)}})}return e.from=function(t,n){return t instanceof e?t.context!==n?new e({value:t.value,context:n,_event:t._event,_sessionid:null,historyValue:t.historyValue,history:t.history,actions:[],activities:t.activities,events:[],configuration:[],transitions:[],children:{}}):t:new e({value:t,context:n,_event:Il,_sessionid:null,historyValue:void 0,history:void 0,actions:[],activities:void 0,events:[],configuration:[],transitions:[],children:{}})},e.create=function(t){return new e(t)},e.inert=function(t,n){if(t instanceof e){if(!t.actions.length)return t;var r=Il;return new e({value:t.value,context:n,_event:r,_sessionid:null,historyValue:t.historyValue,history:t.history,activities:t.activities,configuration:t.configuration,transitions:[],children:{}})}return e.from(t,n)},e.prototype.toStrings=function(e,t){var n=this;if(void 0===e&&(e=this.value),void 0===t&&(t="."),jl(e))return[e];var r=Object.keys(e);return r.concat.apply(r,Ns([],As(r.map((function(r){return n.toStrings(e[r],t).map((function(e){return r+t+e}))}))),!1))},e.prototype.toJSON=function(){var e=this;e.configuration,e.transitions;var t=e.tags;e.machine;var n=Is(e,["configuration","transitions","tags","machine"]);return _s(_s({},n),{tags:Array.from(t)})},e.prototype.matches=function(e){return ol(e,this.value)},e.prototype.hasTag=function(e){return this.tags.has(e)},e.prototype.can=function(e){var t;rl&&yl(!!this.machine,"state.can(...) used outside of a machine-created State object; this will always return false.");var n=null===(t=this.machine)||void 0===t?void 0:t.getTransitionData(this,e);return!!(null==n?void 0:n.transitions.length)&&n.transitions.some((function(e){return void 0!==e.target||e.actions.length}))},e}(),ac={deferEvents:!1},sc=function(){function e(e){this.processingEvent=!1,this.queue=[],this.initialized=!1,this.options=_s(_s({},ac),e)}return e.prototype.initialize=function(e){if(this.initialized=!0,e){if(!this.options.deferEvents)return void this.schedule(e);this.process(e)}this.flushEvents()},e.prototype.schedule=function(e){if(this.initialized&&!this.processingEvent){if(0!==this.queue.length)throw new Error("Event queue should be empty when it is not processing events");this.process(e),this.flushEvents()}else this.queue.push(e)},e.prototype.clear=function(){this.queue=[]},e.prototype.flushEvents=function(){for(var e=this.queue.shift();e;)this.process(e),e=this.queue.shift()},e.prototype.process=function(e){this.processingEvent=!0;try{e()}catch(e){throw this.clear(),e}finally{this.processingEvent=!1}},e}(),lc=new Map,cc=0,dc=function(){return"x:".concat(cc++)},uc=function(e,t){return lc.set(e,t),e},pc=function(e){return lc.get(e)},hc=function(e){lc.delete(e)};function fc(){return"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:void(rl||console.warn("XState could not find a global object in this environment. Please let the maintainers know and raise an issue here: https://github.com/statelyai/xstate/issues"))}function gc(e){if(fc()){var t=function(){var e=fc();if(e&&"__xstate__"in e)return e.__xstate__}();t&&t.register(e)}}function xc(e,t){void 0===t&&(t={});var n=e.initialState,r=new Set,o=[],i=!1,a=function(e){var t;return _s(((t={subscribe:function(){return{unsubscribe:function(){}}},id:"anonymous",getSnapshot:function(){}})[$l]=function(){return this},t),e)}({id:t.id,send:function(t){o.push(t),function(){if(!i){for(i=!0;o.length>0;){var t=o.shift();n=e.transition(n,t,s),r.forEach((function(e){return e.next(n)}))}i=!1}}()},getSnapshot:function(){return n},subscribe:function(e,t,o){var i=Pl(e,t,o);return r.add(i),i.next(n),{unsubscribe:function(){r.delete(i)}}}}),s={parent:t.parent,self:a,id:t.id||"anonymous",observers:r};return n=e.start?e.start(s):n,a}var mc,vc={sync:!1,autoForward:!1};!function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"}(mc||(mc={}));var bc=function(){function e(t,n){void 0===n&&(n=e.defaultOptions);var r=this;this.machine=t,this.delayedEventsMap={},this.listeners=new Set,this.contextListeners=new Set,this.stopListeners=new Set,this.doneListeners=new Set,this.eventListeners=new Set,this.sendListeners=new Set,this.initialized=!1,this.status=mc.NotStarted,this.children=new Map,this.forwardTo=new Set,this._outgoingQueue=[],this.init=this.start,this.send=function(e,t){if(wl(e))return r.batch(e),r.state;var n=Ll(El(e,t));if(r.status===mc.Stopped)return rl||yl(!1,'Event "'.concat(n.name,'" was sent to stopped service "').concat(r.machine.id,'". This service has already reached its final state, and will not transition.\nEvent: ').concat(JSON.stringify(n.data))),r.state;if(r.status!==mc.Running&&!r.options.deferEvents)throw new Error('Event "'.concat(n.name,'" was sent to uninitialized service "').concat(r.machine.id,'". Make sure .start() is called for this service, or set { deferEvents: true } in the service options.\nEvent: ').concat(JSON.stringify(n.data)));return r.scheduler.schedule((function(){r.forward(n);var e=r._nextState(n);r.update(e,n)})),r._state},this.sendTo=function(e,t,n){var o,i=r.parent&&(t===Ms.Parent||r.parent.id===t),a=i?r.parent:jl(t)?t===Ms.Internal?r:r.children.get(t)||pc(t):(o=t)&&"function"==typeof o.send?t:void 0;if(a)if("machine"in a){if(r.status!==mc.Stopped||r.parent!==a||r.state.done){var s=_s(_s({},e),{name:e.name===Ks?"".concat(Hl(r.id)):e.name,origin:r.sessionId});!n&&r.machine.config.predictableActionArguments?r._outgoingQueue.push([a,s]):a.send(s)}}else!n&&r.machine.config.predictableActionArguments?r._outgoingQueue.push([a,e.data]):a.send(e.data);else{if(!i)throw new Error("Unable to send event to child '".concat(t,"' from service '").concat(r.id,"'."));rl||yl(!1,"Service '".concat(r.id,"' has no parent: unable to send event ").concat(e.type))}},this._exec=function(e,t,n,o){void 0===o&&(o=r.machine.options.actions);var i=e.exec||Dl(e.type,o),a=Cl(i)?i:i?i.exec:e.exec;if(a)try{return a(t,n.data,r.machine.config.predictableActionArguments?{action:e,_event:n}:{action:e,state:r.state,_event:n})}catch(e){throw r.parent&&r.parent.send({type:"xstate.error",data:e}),e}switch(e.type){case Bs:var s=e;r.defer(s);break;case Hs:var l=e;if("number"==typeof l.delay)return void r.defer(l);l.to?r.sendTo(l._event,l.to,n===Il):r.send(l._event);break;case Fs:r.cancel(e.sendId);break;case Vs:if(r.status!==mc.Running)return;var c=e.activity;if(!r.machine.config.predictableActionArguments&&!r.state.activities[c.id||c.type])break;if(c.type===Ps.Invoke){var d=Ol(c.src),u=r.machine.options.services?r.machine.options.services[d.type]:void 0,p=c.id,h=c.data;rl||yl(!("forward"in c),"`forward` property is deprecated (found in invocation of '".concat(c.src,"' in in machine '").concat(r.machine.id,"'). ")+"Please use `autoForward` instead.");var f="autoForward"in c?c.autoForward:!!c.forward;if(!u)return void(rl||yl(!1,"No service found for invocation '".concat(c.src,"' in machine '").concat(r.machine.id,"'.")));var g=h?xl(h,t,n):void 0;if("string"==typeof u)return;var x=Cl(u)?u(t,n.data,{data:g,src:d,meta:c.meta}):u;if(!x)return;var m=void 0;Sl(x)&&(x=g?x.withContext(g):x,m={autoForward:f}),r.spawn(x,p,m)}else r.spawnActivity(c);break;case zs:r.stopChild(e.activity.id);break;case Ws:var v=e,b=v.label,y=v.value;b?r.logger(b,y):r.logger(y);break;default:rl||yl(!1,"No implementation found for action type '".concat(e.type,"'"))}};var o=_s(_s({},e.defaultOptions),n),i=o.clock,a=o.logger,s=o.parent,l=o.id,c=void 0!==l?l:t.id;this.id=c,this.logger=a,this.clock=i,this.parent=s,this.options=o,this.scheduler=new sc({deferEvents:this.options.deferEvents}),this.sessionId=dc()}return Object.defineProperty(e.prototype,"initialState",{get:function(){var e=this;return this._initialState?this._initialState:ql(this,(function(){return e._initialState=e.machine.initialState,e._initialState}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"state",{get:function(){return rl||yl(this.status!==mc.NotStarted,"Attempted to read state from uninitialized service '".concat(this.id,"'. Make sure the service is started first.")),this._state},enumerable:!1,configurable:!0}),e.prototype.execute=function(e,t){var n,r;try{for(var o=Ds(e.actions),i=o.next();!i.done;i=o.next()){var a=i.value;this.exec(a,e,t)}}catch(e){n={error:e}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}},e.prototype.update=function(e,t){var n,r,o,i,a,s,l,c,d=this;if(e._sessionid=this.sessionId,this._state=e,this.machine.config.predictableActionArguments&&t!==Il||!this.options.execute)for(var u=void 0;u=this._outgoingQueue.shift();)u[0].send(u[1]);else this.execute(this.state);if(this.children.forEach((function(e){d.state.children[e.id]=e})),this.devTools&&this.devTools.send(t.data,e),e.event)try{for(var p=Ds(this.eventListeners),h=p.next();!h.done;h=p.next()){(0,h.value)(e.event)}}catch(e){n={error:e}}finally{try{h&&!h.done&&(r=p.return)&&r.call(p)}finally{if(n)throw n.error}}try{for(var f=Ds(this.listeners),g=f.next();!g.done;g=f.next()){(0,g.value)(e,e.event)}}catch(e){o={error:e}}finally{try{g&&!g.done&&(i=f.return)&&i.call(f)}finally{if(o)throw o.error}}try{for(var x=Ds(this.contextListeners),m=x.next();!m.done;m=x.next()){(0,m.value)(this.state.context,this.state.history?this.state.history.context:void 0)}}catch(e){a={error:e}}finally{try{m&&!m.done&&(s=x.return)&&s.call(x)}finally{if(a)throw a.error}}if(this.state.done){var v=e.configuration.find((function(e){return"final"===e.type&&e.parent===d.machine})),b=v&&v.doneData?xl(v.doneData,e.context,t):void 0;this._doneEvent=Bl(this.id,b);try{for(var y=Ds(this.doneListeners),w=y.next();!w.done;w=y.next()){(0,w.value)(this._doneEvent)}}catch(e){l={error:e}}finally{try{w&&!w.done&&(c=y.return)&&c.call(y)}finally{if(l)throw l.error}}this._stop(),this._stopChildren(),hc(this.sessionId)}},e.prototype.onTransition=function(e){return this.listeners.add(e),this.status===mc.Running&&e(this.state,this.state.event),this},e.prototype.subscribe=function(e,t,n){var r=this,o=Pl(e,t,n);this.listeners.add(o.next),this.status!==mc.NotStarted&&o.next(this.state);var i=function(){r.doneListeners.delete(i),r.stopListeners.delete(i),o.complete()};return this.status===mc.Stopped?o.complete():(this.onDone(i),this.onStop(i)),{unsubscribe:function(){r.listeners.delete(o.next),r.doneListeners.delete(i),r.stopListeners.delete(i)}}},e.prototype.onEvent=function(e){return this.eventListeners.add(e),this},e.prototype.onSend=function(e){return this.sendListeners.add(e),this},e.prototype.onChange=function(e){return this.contextListeners.add(e),this},e.prototype.onStop=function(e){return this.stopListeners.add(e),this},e.prototype.onDone=function(e){return this.status===mc.Stopped&&this._doneEvent?e(this._doneEvent):this.doneListeners.add(e),this},e.prototype.off=function(e){return this.listeners.delete(e),this.eventListeners.delete(e),this.sendListeners.delete(e),this.stopListeners.delete(e),this.doneListeners.delete(e),this.contextListeners.delete(e),this},e.prototype.start=function(e){var t=this;if(this.status===mc.Running)return this;this.machine._init(),uc(this.sessionId,this),this.initialized=!0,this.status=mc.Running;var n=void 0===e?this.initialState:ql(this,(function(){return"object"==typeof(n=e)&&null!==n&&"value"in n&&"_event"in n?t.machine.resolveState(e):t.machine.resolveState(ic.from(e,t.machine.context));var n}));return this.options.devTools&&this.attachDev(),this.scheduler.initialize((function(){t.update(n,Il)})),this},e.prototype._stopChildren=function(){this.children.forEach((function(e){Cl(e.stop)&&e.stop()})),this.children.clear()},e.prototype._stop=function(){var e,t,n,r,o,i,a,s,l,c;try{for(var d=Ds(this.listeners),u=d.next();!u.done;u=d.next()){var p=u.value;this.listeners.delete(p)}}catch(t){e={error:t}}finally{try{u&&!u.done&&(t=d.return)&&t.call(d)}finally{if(e)throw e.error}}try{for(var h=Ds(this.stopListeners),f=h.next();!f.done;f=h.next()){(p=f.value)(),this.stopListeners.delete(p)}}catch(e){n={error:e}}finally{try{f&&!f.done&&(r=h.return)&&r.call(h)}finally{if(n)throw n.error}}try{for(var g=Ds(this.contextListeners),x=g.next();!x.done;x=g.next()){p=x.value;this.contextListeners.delete(p)}}catch(e){o={error:e}}finally{try{x&&!x.done&&(i=g.return)&&i.call(g)}finally{if(o)throw o.error}}try{for(var m=Ds(this.doneListeners),v=m.next();!v.done;v=m.next()){p=v.value;this.doneListeners.delete(p)}}catch(e){a={error:e}}finally{try{v&&!v.done&&(s=m.return)&&s.call(m)}finally{if(a)throw a.error}}if(!this.initialized)return this;this.initialized=!1,this.status=mc.Stopped,this._initialState=void 0;try{for(var b=Ds(Object.keys(this.delayedEventsMap)),y=b.next();!y.done;y=b.next()){var w=y.value;this.clock.clearTimeout(this.delayedEventsMap[w])}}catch(e){l={error:e}}finally{try{y&&!y.done&&(c=b.return)&&c.call(b)}finally{if(l)throw l.error}}this.scheduler.clear(),this.scheduler=new sc({deferEvents:this.options.deferEvents})},e.prototype.stop=function(){var e=this,t=this.scheduler;return this._stop(),t.schedule((function(){var t;if(!(null===(t=e._state)||void 0===t?void 0:t.done)){var n=Ll({type:"xstate.stop"}),r=ql(e,(function(){var t=hl(Ns([],As(e.state.configuration),!1).sort((function(e,t){return t.order-e.order})).map((function(t){return Nl(t.onExit,e.machine.options.actions)}))),r=As(Fl(e.machine,e.state,e.state.context,n,[{type:"exit",actions:t}],e.machine.config.predictableActionArguments?e._exec:void 0,e.machine.config.predictableActionArguments||e.machine.config.preserveActionOrder),2),o=r[0],i=r[1],a=new ic({value:e.state.value,context:i,_event:n,_sessionid:e.sessionId,historyValue:void 0,history:e.state,actions:o.filter((function(e){return!_l(e)})),activities:{},events:[],configuration:[],transitions:[],children:{},done:e.state.done,tags:e.state.tags,machine:e.machine});return a.changed=!0,a}));e.update(r,n),e._stopChildren(),hc(e.sessionId)}})),this},e.prototype.batch=function(e){var t=this;if(this.status===mc.NotStarted&&this.options.deferEvents)rl||yl(!1,"".concat(e.length,' event(s) were sent to uninitialized service "').concat(this.machine.id,'" and are deferred. Make sure .start() is called for this service.\nEvent: ').concat(JSON.stringify(event)));else if(this.status!==mc.Running)throw new Error("".concat(e.length,' event(s) were sent to uninitialized service "').concat(this.machine.id,'". Make sure .start() is called for this service, or set { deferEvents: true } in the service options.'));if(e.length){var n=!!this.machine.config.predictableActionArguments&&this._exec;this.scheduler.schedule((function(){var r,o,i=t.state,a=!1,s=[],l=function(e){var r=Ll(e);t.forward(r),i=ql(t,(function(){return t.machine.transition(i,r,void 0,n||void 0)})),s.push.apply(s,Ns([],As(t.machine.config.predictableActionArguments?i.actions:i.actions.map((function(e){return function(e,t){var n=e.exec;return _s(_s({},e),{exec:void 0!==n?function(){return n(t.context,t.event,{action:e,state:t,_event:t._event})}:void 0})}(e,i)}))),!1)),a=a||!!i.changed};try{for(var c=Ds(e),d=c.next();!d.done;d=c.next()){l(d.value)}}catch(e){r={error:e}}finally{try{d&&!d.done&&(o=c.return)&&o.call(c)}finally{if(r)throw r.error}}i.changed=a,i.actions=s,t.update(i,Ll(e[e.length-1]))}))}},e.prototype.sender=function(e){return this.send.bind(this,e)},e.prototype._nextState=function(e,t){var n=this;void 0===t&&(t=!!this.machine.config.predictableActionArguments&&this._exec);var r=Ll(e);if(0===r.name.indexOf(Ys)&&!this.state.nextEvents.some((function(e){return 0===e.indexOf(Ys)})))throw r.data.data;return ql(this,(function(){return n.machine.transition(n.state,r,void 0,t||void 0)}))},e.prototype.nextState=function(e){return this._nextState(e,!1)},e.prototype.forward=function(e){var t,n;try{for(var r=Ds(this.forwardTo),o=r.next();!o.done;o=r.next()){var i=o.value,a=this.children.get(i);if(!a)throw new Error("Unable to forward event '".concat(e,"' from interpreter '").concat(this.id,"' to nonexistant child '").concat(i,"'."));a.send(e)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}},e.prototype.defer=function(e){var t=this,n=this.clock.setTimeout((function(){"to"in e&&e.to?t.sendTo(e._event,e.to,!0):t.send(e._event)}),e.delay);e.id&&(this.delayedEventsMap[e.id]=n)},e.prototype.cancel=function(e){this.clock.clearTimeout(this.delayedEventsMap[e]),delete this.delayedEventsMap[e]},e.prototype.exec=function(e,t,n){void 0===n&&(n=this.machine.options.actions),this._exec(e,t.context,t._event,n)},e.prototype.removeChild=function(e){var t;this.children.delete(e),this.forwardTo.delete(e),null===(t=this.state)||void 0===t||delete t.children[e]},e.prototype.stopChild=function(e){var t=this.children.get(e);t&&(this.removeChild(e),Cl(t.stop)&&t.stop())},e.prototype.spawn=function(e,t,n){if(this.status!==mc.Running)return Wl(e,t);if(ml(e))return this.spawnPromise(Promise.resolve(e),t);if(Cl(e))return this.spawnCallback(e,t);if(function(e){try{return"function"==typeof e.send}catch(e){return!1}}(o=e)&&"id"in o)return this.spawnActor(e,t);if(function(e){try{return"subscribe"in e&&Cl(e.subscribe)}catch(e){return!1}}(e))return this.spawnObservable(e,t);if(Sl(e))return this.spawnMachine(e,_s(_s({},n),{id:t}));if(null!==(r=e)&&"object"==typeof r&&"transition"in r&&"function"==typeof r.transition)return this.spawnBehavior(e,t);throw new Error('Unable to spawn entity "'.concat(t,'" of type "').concat(typeof e,'".'));var r,o},e.prototype.spawnMachine=function(t,n){var r=this;void 0===n&&(n={});var o=new e(t,_s(_s({},this.options),{parent:this,id:n.id||t.id})),i=_s(_s({},vc),n);i.sync&&o.onTransition((function(e){r.send(Js,{state:e,id:o.id})}));var a=o;return this.children.set(o.id,a),i.autoForward&&this.forwardTo.add(o.id),o.onDone((function(e){r.removeChild(o.id),r.send(Ll(e,{origin:o.id}))})).start(),a},e.prototype.spawnBehavior=function(e,t){var n=xc(e,{id:t,parent:this});return this.children.set(t,n),n},e.prototype.spawnPromise=function(e,t){var n,r,o=this,i=!1;e.then((function(e){i||(r=e,o.removeChild(t),o.send(Ll(Bl(t,e),{origin:t})))}),(function(e){if(!i){o.removeChild(t);var n=Hl(t,e);try{o.send(Ll(n,{origin:t}))}catch(r){!function(e,t,n){if(!rl){var r=e.stack?" Stacktrace was '".concat(e.stack,"'"):"";if(e===t)console.error("Missing onError handler for invocation '".concat(n,"', error was '").concat(e,"'.").concat(r));else{var o=t.stack?" Stacktrace was '".concat(t.stack,"'"):"";console.error("Missing onError handler and/or unhandled exception/promise rejection for invocation '".concat(n,"'. ")+"Original error: '".concat(e,"'. ").concat(r," Current error is '").concat(t,"'.").concat(o))}}}(e,r,t),o.devTools&&o.devTools.send(n,o.state),o.machine.strict&&o.stop()}}}));var a=((n={id:t,send:function(){},subscribe:function(t,n,r){var o=Pl(t,n,r),i=!1;return e.then((function(e){i||(o.next(e),i||o.complete())}),(function(e){i||o.error(e)})),{unsubscribe:function(){return i=!0}}},stop:function(){i=!0},toJSON:function(){return{id:t}},getSnapshot:function(){return r}})[$l]=function(){return this},n);return this.children.set(t,a),a},e.prototype.spawnCallback=function(e,t){var n,r,o,i=this,a=!1,s=new Set,l=new Set;try{o=e((function(e){r=e,l.forEach((function(t){return t(e)})),a||i.send(Ll(e,{origin:t}))}),(function(e){s.add(e)}))}catch(e){this.send(Hl(t,e))}if(ml(o))return this.spawnPromise(o,t);var c=((n={id:t,send:function(e){return s.forEach((function(t){return t(e)}))},subscribe:function(e){var t=Pl(e);return l.add(t.next),{unsubscribe:function(){l.delete(t.next)}}},stop:function(){a=!0,Cl(o)&&o()},toJSON:function(){return{id:t}},getSnapshot:function(){return r}})[$l]=function(){return this},n);return this.children.set(t,c),c},e.prototype.spawnObservable=function(e,t){var n,r,o=this,i=e.subscribe((function(e){r=e,o.send(Ll(e,{origin:t}))}),(function(e){o.removeChild(t),o.send(Ll(Hl(t,e),{origin:t}))}),(function(){o.removeChild(t),o.send(Ll(Bl(t),{origin:t}))})),a=((n={id:t,send:function(){},subscribe:function(t,n,r){return e.subscribe(t,n,r)},stop:function(){return i.unsubscribe()},getSnapshot:function(){return r},toJSON:function(){return{id:t}}})[$l]=function(){return this},n);return this.children.set(t,a),a},e.prototype.spawnActor=function(e,t){return this.children.set(t,e),e},e.prototype.spawnActivity=function(e){var t=this.machine.options&&this.machine.options.activities?this.machine.options.activities[e.type]:void 0;if(t){var n=t(this.state.context,e);this.spawnEffect(e.id,n)}else rl||yl(!1,"No implementation found for activity '".concat(e.type,"'"))},e.prototype.spawnEffect=function(e,t){var n;this.children.set(e,((n={id:e,send:function(){},subscribe:function(){return{unsubscribe:function(){}}},stop:t||void 0,getSnapshot:function(){},toJSON:function(){return{id:e}}})[$l]=function(){return this},n))},e.prototype.attachDev=function(){var e=fc();if(this.options.devTools&&e){if(e.__REDUX_DEVTOOLS_EXTENSION__){var t="object"==typeof this.options.devTools?this.options.devTools:void 0;this.devTools=e.__REDUX_DEVTOOLS_EXTENSION__.connect(_s(_s({name:this.id,autoPause:!0,stateSanitizer:function(e){return{value:e.value,context:e.context,actions:e.actions}}},t),{features:_s({jump:!1,skip:!1},t?t.features:void 0)}),this.machine),this.devTools.init(this.state)}gc(this)}},e.prototype.toJSON=function(){return{id:this.id}},e.prototype[$l]=function(){return this},e.prototype.getSnapshot=function(){return this.status===mc.NotStarted?this.initialState:this._state},e.defaultOptions={execute:!0,deferEvents:!0,clock:{setTimeout:function(e,t){return setTimeout(e,t)},clearTimeout:function(e){return clearTimeout(e)}},logger:console.log.bind(console),devTools:!1},e.interpret=yc,e}();function yc(e,t){return new bc(e,t)}function wc(e){if("string"==typeof e){var t={type:e,toString:function(){return e}};return t}return e}function Cc(e){return _s(_s({type:Us},e),{toJSON:function(){e.onDone,e.onError;var t=Is(e,["onDone","onError"]);return _s(_s({},t),{type:Us,src:wc(e.src)})}})}var jc="",kc="*",$c={},Sc=function(e){return"#"===e[0]},Ec=function(){function e(t,n,r,o){void 0===r&&(r="context"in t?t.context:void 0);var i,a=this;this.config=t,this._context=r,this.order=-1,this.__xstatenode=!0,this.__cache={events:void 0,relativeValue:new Map,initialStateValue:void 0,initialState:void 0,on:void 0,transitions:void 0,candidates:{},delayedTransitions:void 0},this.idMap={},this.tags=[],this.options=Object.assign({actions:{},guards:{},services:{},activities:{},delays:{}},n),this.parent=null==o?void 0:o.parent,this.key=this.config.key||(null==o?void 0:o.key)||this.config.id||"(machine)",this.machine=this.parent?this.parent.machine:this,this.path=this.parent?this.parent.path.concat(this.key):[],this.delimiter=this.config.delimiter||(this.parent?this.parent.delimiter:"."),this.id=this.config.id||Ns([this.machine.key],As(this.path),!1).join(this.delimiter),this.version=this.parent?this.parent.version:this.config.version,this.type=this.config.type||(this.config.parallel?"parallel":this.config.states&&Object.keys(this.config.states).length?"compound":this.config.history?"history":"atomic"),this.schema=this.parent?this.machine.schema:null!==(i=this.config.schema)&&void 0!==i?i:{},this.description=this.config.description,rl||yl(!("parallel"in this.config),'The "parallel" property is deprecated and will be removed in version 4.1. '.concat(this.config.parallel?"Replace with `type: 'parallel'`":"Use `type: '".concat(this.type,"'`")," in the config for state node '").concat(this.id,"' instead.")),this.initial=this.config.initial,this.states=this.config.states?cl(this.config.states,(function(t,n){var r,o=new e(t,{},void 0,{parent:a,key:n});return Object.assign(a.idMap,_s(((r={})[o.id]=o,r),o.idMap)),o})):$c;var s=0;!function e(t){var n,r;t.order=s++;try{for(var o=Ds(Ul(t)),i=o.next();!i.done;i=o.next()){e(i.value)}}catch(e){n={error:e}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}}(this),this.history=!0===this.config.history?"shallow":this.config.history||!1,this._transient=!!this.config.always||!!this.config.on&&(Array.isArray(this.config.on)?this.config.on.some((function(e){return e.event===jc})):jc in this.config.on),this.strict=!!this.config.strict,this.onEntry=gl(this.config.entry||this.config.onEntry).map((function(e){return Al(e)})),this.onExit=gl(this.config.exit||this.config.onExit).map((function(e){return Al(e)})),this.meta=this.config.meta,this.doneData="final"===this.type?this.config.data:void 0,this.invoke=gl(this.config.invoke).map((function(e,t){var n,r;if(Sl(e)){var o=Ml(a.id,t);return a.machine.options.services=_s(((n={})[o]=e,n),a.machine.options.services),Cc({src:o,id:o})}if(jl(e.src)){o=e.id||Ml(a.id,t);return Cc(_s(_s({},e),{id:o,src:e.src}))}if(Sl(e.src)||Cl(e.src)){o=e.id||Ml(a.id,t);return a.machine.options.services=_s(((r={})[o]=e.src,r),a.machine.options.services),Cc(_s(_s({id:o},e),{src:o}))}var i=e.src;return Cc(_s(_s({id:Ml(a.id,t)},e),{src:i}))})),this.activities=gl(this.config.activities).concat(this.invoke).map((function(e){return Vl(e)})),this.transition=this.transition.bind(this),this.tags=gl(this.config.tags)}return e.prototype._init=function(){this.__cache.transitions||Yl(this).forEach((function(e){return e.on}))},e.prototype.withConfig=function(t,n){var r=this.options,o=r.actions,i=r.activities,a=r.guards,s=r.services,l=r.delays;return new e(this.config,{actions:_s(_s({},o),t.actions),activities:_s(_s({},i),t.activities),guards:_s(_s({},a),t.guards),services:_s(_s({},s),t.services),delays:_s(_s({},l),t.delays)},null!=n?n:this.context)},e.prototype.withContext=function(t){return new e(this.config,this.options,t)},Object.defineProperty(e.prototype,"context",{get:function(){return Cl(this._context)?this._context():this._context},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"definition",{get:function(){return{id:this.id,key:this.key,version:this.version,context:this.context,type:this.type,initial:this.initial,history:this.history,states:cl(this.states,(function(e){return e.definition})),on:this.on,transitions:this.transitions,entry:this.onEntry,exit:this.onExit,activities:this.activities||[],meta:this.meta,order:this.order||-1,data:this.doneData,invoke:this.invoke,description:this.description,tags:this.tags}},enumerable:!1,configurable:!0}),e.prototype.toJSON=function(){return this.definition},Object.defineProperty(e.prototype,"on",{get:function(){if(this.__cache.on)return this.__cache.on;var e=this.transitions;return this.__cache.on=e.reduce((function(e,t){return e[t.eventType]=e[t.eventType]||[],e[t.eventType].push(t),e}),{})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"after",{get:function(){return this.__cache.delayedTransitions||(this.__cache.delayedTransitions=this.getDelayedTransitions(),this.__cache.delayedTransitions)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"transitions",{get:function(){return this.__cache.transitions||(this.__cache.transitions=this.formatTransitions(),this.__cache.transitions)},enumerable:!1,configurable:!0}),e.prototype.getCandidates=function(e){if(this.__cache.candidates[e])return this.__cache.candidates[e];var t=e===jc,n=this.transitions.filter((function(n){var r=n.eventType===e;return t?r:r||n.eventType===kc}));return this.__cache.candidates[e]=n,n},e.prototype.getDelayedTransitions=function(){var e=this,t=this.config.after;if(!t)return[];var n=function(t,n){var r=function(e,t){var n=t?"#".concat(t):"";return"".concat(Ps.After,"(").concat(e,")").concat(n)}(Cl(t)?"".concat(e.id,":delay[").concat(n,"]"):t,e.id);return e.onEntry.push(function(e,t){return{to:t?t.to:void 0,type:Hs,event:Cl(e)?e:El(e),delay:t?t.delay:void 0,id:t&&void 0!==t.id?t.id:Cl(e)?e.name:il(e)}}(r,{delay:t})),e.onExit.push({type:Fs,sendId:r}),r},r=wl(t)?t.map((function(e,t){var r=n(e.delay,t);return _s(_s({},e),{event:r})})):hl(Object.keys(t).map((function(e,r){var o=t[e],i=jl(o)?{target:o}:o,a=isNaN(+e)?e:+e,s=n(a,r);return gl(i).map((function(e){return _s(_s({},e),{event:s,delay:a})}))})));return r.map((function(t){var n=t.delay;return _s(_s({},e.formatTransition(t)),{delay:n})}))},e.prototype.getStateNodes=function(e){var t,n=this;if(!e)return[];var r=e instanceof ic?e.value:sl(e,this.delimiter);if(jl(r)){var o=this.getStateNode(r).initial;return void 0!==o?this.getStateNodes(((t={})[r]=o,t)):[this,this.states[r]]}var i=Object.keys(r),a=[this];return a.push.apply(a,Ns([],As(hl(i.map((function(e){return n.getStateNode(e).getStateNodes(r[e])})))),!1)),a},e.prototype.handles=function(e){var t=il(e);return this.events.includes(t)},e.prototype.resolveState=function(e){var t=e instanceof ic?e:ic.create(e),n=Array.from(Kl([],this.getStateNodes(t.value)));return new ic(_s(_s({},t),{value:this.resolve(t.value),configuration:n,done:nc(n,this),tags:rc(n),machine:this.machine}))},e.prototype.transitionLeafNode=function(e,t,n){var r=this.getStateNode(e).next(t,n);return r&&r.transitions.length?r:this.next(t,n)},e.prototype.transitionCompoundNode=function(e,t,n){var r=Object.keys(e),o=this.getStateNode(r[0])._transition(e[r[0]],t,n);return o&&o.transitions.length?o:this.next(t,n)},e.prototype.transitionParallelNode=function(e,t,n){var r,o,i={};try{for(var a=Ds(Object.keys(e)),s=a.next();!s.done;s=a.next()){var l=s.value,c=e[l];if(c){var d=this.getStateNode(l)._transition(c,t,n);d&&(i[l]=d)}}}catch(e){r={error:e}}finally{try{s&&!s.done&&(o=a.return)&&o.call(a)}finally{if(r)throw r.error}}var u=Object.keys(i).map((function(e){return i[e]})),p=hl(u.map((function(e){return e.transitions})));if(!u.some((function(e){return e.transitions.length>0})))return this.next(t,n);var h=hl(Object.keys(i).map((function(e){return i[e].configuration})));return{transitions:p,exitSet:hl(u.map((function(e){return e.exitSet}))),configuration:h,source:t,actions:hl(Object.keys(i).map((function(e){return i[e].actions})))}},e.prototype._transition=function(e,t,n){return jl(e)?this.transitionLeafNode(e,t,n):1===Object.keys(e).length?this.transitionCompoundNode(e,t,n):this.transitionParallelNode(e,t,n)},e.prototype.getTransitionData=function(e,t){return this._transition(e.value,e,Ll(t))},e.prototype.next=function(e,t){var n,r,o,i=this,a=t.name,s=[],l=[];try{for(var c=Ds(this.getCandidates(a)),d=c.next();!d.done;d=c.next()){var u=d.value,p=u.cond,h=u.in,f=e.context,g=!h||(jl(h)&&Sc(h)?e.matches(sl(this.getStateNodeById(h).path,this.delimiter)):ol(sl(h,this.delimiter),ul(this.path.slice(0,-2))(e.value))),x=!1;try{x=!p||Tl(this.machine,p,f,t,e)}catch(e){throw new Error("Unable to evaluate guard '".concat(p.name||p.type,"' in transition for event '").concat(a,"' in state node '").concat(this.id,"':\n").concat(e.message))}if(x&&g){void 0!==u.target&&(l=u.target),s.push.apply(s,Ns([],As(u.actions),!1)),o=u;break}}}catch(e){n={error:e}}finally{try{d&&!d.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}if(o){if(!l.length)return{transitions:[o],exitSet:[],configuration:e.value?[this]:[],source:e,actions:s};var m=hl(l.map((function(t){return i.getRelativeStateNodes(t,e.historyValue)})));return{transitions:[o],exitSet:!!o.internal?[]:hl(l.map((function(e){return i.getPotentiallyReenteringNodes(e)}))),configuration:m,source:e,actions:s}}},e.prototype.getPotentiallyReenteringNodes=function(e){if(this.order<e.order)return[this];for(var t=[],n=this,r=e;n&&n!==r;)t.push(n),n=n.parent;return n!==r?[]:(t.push(r),t)},e.prototype.getActions=function(e,t,n,r,o,i,a){var s,l,c,d,u=this,p=i?Kl([],this.getStateNodes(i.value)):[],h=new Set;try{for(var f=Ds(Array.from(e).sort((function(e,t){return e.order-t.order}))),g=f.next();!g.done;g=f.next()){(!tc(p,v=g.value)||tc(n.exitSet,v)||v.parent&&h.has(v.parent))&&h.add(v)}}catch(e){s={error:e}}finally{try{g&&!g.done&&(l=f.return)&&l.call(f)}finally{if(s)throw s.error}}try{for(var x=Ds(p),m=x.next();!m.done;m=x.next()){var v;tc(e,v=m.value)&&!tc(n.exitSet,v.parent)||n.exitSet.push(v)}}catch(e){c={error:e}}finally{try{m&&!m.done&&(d=x.return)&&d.call(x)}finally{if(c)throw c.error}}n.exitSet.sort((function(e,t){return t.order-e.order}));var b=Array.from(h).sort((function(e,t){return e.order-t.order})),y=new Set(n.exitSet),w=hl(b.map((function(e){var t=[];if("final"!==e.type)return t;var i=e.parent;if(!i.parent)return t;t.push(zl(e.id,e.doneData),zl(i.id,e.doneData?xl(e.doneData,r,o):void 0));var a=i.parent;return"parallel"===a.type&&Xl(a).every((function(e){return nc(n.configuration,e)}))&&t.push(zl(a.id)),t}))),C=b.map((function(e){var t=e.onEntry,n=e.activities.map((function(e){return function(e){var t=Vl(e);return{type:Ps.Start,activity:t,exec:void 0}}(e)}));return{type:"entry",actions:Nl(a?Ns(Ns([],As(t),!1),As(n),!1):Ns(Ns([],As(n),!1),As(t),!1),u.machine.options.actions)}})).concat({type:"state_done",actions:w.map((function(e){return function(e,t){return{type:Bs,event:"function"==typeof e?e:El(e),delay:t?t.delay:void 0,id:null==t?void 0:t.id}}(e)}))}),j=Array.from(y).map((function(e){return{type:"exit",actions:Nl(Ns(Ns([],As(e.onExit),!1),As(e.activities.map((function(e){return function(e){var t=Cl(e)?e:Vl(e);return{type:Ps.Stop,activity:t,exec:void 0}}(e)}))),!1),u.machine.options.actions)}})).concat({type:"transition",actions:Nl(n.actions,this.machine.options.actions)}).concat(C);if(t){var k=Nl(hl(Ns([],As(e),!1).sort((function(e,t){return t.order-e.order})).map((function(e){return e.onExit}))),this.machine.options.actions).filter((function(e){return!_l(e)}));return j.concat({type:"stop",actions:k})}return j},e.prototype.transition=function(e,t,n,r){void 0===e&&(e=this.initialState);var o,i,a=Ll(t);if(e instanceof ic)o=void 0===n?e:this.resolveState(ic.from(e,n));else{var s=jl(e)?this.resolve(ll(this.getResolvedPath(e))):this.resolve(e),l=null!=n?n:this.machine.context;o=this.resolveState(ic.from(s,l))}if(!rl&&a.name===kc)throw new Error("An event cannot have the wildcard type ('".concat(kc,"')"));if(this.strict&&!this.events.includes(a.name)&&(i=a.name,!/^(done|error)\./.test(i)))throw new Error("Machine '".concat(this.id,"' does not accept event '").concat(a.name,"'"));var c=this._transition(o.value,o,a)||{transitions:[],configuration:[],exitSet:[],source:o,actions:[]},d=Kl([],this.getStateNodes(o.value)),u=c.configuration.length?Kl(d,c.configuration):d;return c.configuration=Ns([],As(u),!1),this.resolveTransition(c,o,o.context,r,a)},e.prototype.resolveRaisedTransition=function(e,t,n,r){var o,i=e.actions;return(e=this.transition(e,t,void 0,r))._event=n,e.event=n.data,(o=e.actions).unshift.apply(o,Ns([],As(i),!1)),e},e.prototype.resolveTransition=function(e,t,n,r,o){var i,a,s,l,c=this;void 0===o&&(o=Il);var d=e.configuration,u=!t||e.transitions.length>0,p=u?e.configuration:t?t.configuration:[],h=nc(p,this),f=u?ec(this.machine,d):void 0,g=t?t.historyValue?t.historyValue:e.source?this.machine.historyValue(t.value):void 0:void 0,x=this.getActions(new Set(p),h,e,n,o,t,r),m=t?_s({},t.activities):{};try{for(var v=Ds(x),b=v.next();!b.done;b=v.next()){var y=b.value;try{for(var w=(s=void 0,Ds(y.actions)),C=w.next();!C.done;C=w.next()){var j=C.value;j.type===Vs?m[j.activity.id||j.activity.type]=j:j.type===zs&&(m[j.activity.id||j.activity.type]=!1)}}catch(e){s={error:e}}finally{try{C&&!C.done&&(l=w.return)&&l.call(w)}finally{if(s)throw s.error}}}}catch(e){i={error:e}}finally{try{b&&!b.done&&(a=v.return)&&a.call(v)}finally{if(i)throw i.error}}var k,$,S=As(Fl(this,t,n,o,x,r,this.machine.config.predictableActionArguments||this.machine.config.preserveActionOrder),2),E=S[0],L=S[1],R=As(function(e,t){var n,r,o=As([[],[]],2),i=o[0],a=o[1];try{for(var s=Ds(e),l=s.next();!l.done;l=s.next()){var c=l.value;t(c)?i.push(c):a.push(c)}}catch(e){n={error:e}}finally{try{l&&!l.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return[i,a]}(E,_l),2),T=R[0],O=R[1],P=E.filter((function(e){var t;return e.type===Vs&&(null===(t=e.activity)||void 0===t?void 0:t.type)===Us})),M=P.reduce((function(e,t){return e[t.activity.id]=function(e,t,n,r){var o,i=Ol(e.src),a=null===(o=null==t?void 0:t.options.services)||void 0===o?void 0:o[i.type],s=e.data?xl(e.data,n,r):void 0,l=a?Wl(a,e.id,s):Zl(e.id);return l.meta=e,l}(t.activity,c.machine,L,o),e}),t?_s({},t.children):{}),_=new ic({value:f||t.value,context:L,_event:o,_sessionid:t?t._sessionid:null,historyValue:f?g?(k=g,$=f,{current:$,states:vl(k,$)}):void 0:t?t.historyValue:void 0,history:!f||e.source?t:void 0,actions:f?O:[],activities:f?m:t?t.activities:{},events:[],configuration:p,transitions:e.transitions,children:M,done:h,tags:rc(p),machine:this}),I=n!==L;_.changed=o.name===Js||I;var D=_.history;D&&delete D.history;var A=!h&&(this._transient||d.some((function(e){return e._transient})));if(!(u||A&&o.name!==jc))return _;var N=_;if(!h)for(A&&(N=this.resolveRaisedTransition(N,{type:qs},o,r));T.length;){var V=T.shift();N=this.resolveRaisedTransition(N,V._event,o,r)}var z=N.changed||(D?!!N.actions.length||I||typeof D.value!=typeof N.value||!oc(N.value,D.value):void 0);return N.changed=z,N.history=D,N},e.prototype.getStateNode=function(e){if(Sc(e))return this.machine.getStateNodeById(e);if(!this.states)throw new Error("Unable to retrieve child state '".concat(e,"' from '").concat(this.id,"'; no child states exist."));var t=this.states[e];if(!t)throw new Error("Child state '".concat(e,"' does not exist on '").concat(this.id,"'"));return t},e.prototype.getStateNodeById=function(e){var t=Sc(e)?e.slice(1):e;if(t===this.id)return this;var n=this.machine.idMap[t];if(!n)throw new Error("Child state node '#".concat(t,"' does not exist on machine '").concat(this.id,"'"));return n},e.prototype.getStateNodeByPath=function(e){if("string"==typeof e&&Sc(e))try{return this.getStateNodeById(e.slice(1))}catch(e){}for(var t=al(e,this.delimiter).slice(),n=this;t.length;){var r=t.shift();if(!r.length)break;n=n.getStateNode(r)}return n},e.prototype.resolve=function(e){var t,n=this;if(!e)return this.initialStateValue||$c;switch(this.type){case"parallel":return cl(this.initialStateValue,(function(t,r){return t?n.getStateNode(r).resolve(e[r]||t):$c}));case"compound":if(jl(e)){var r=this.getStateNode(e);return"parallel"===r.type||"compound"===r.type?((t={})[e]=r.initialStateValue,t):e}return Object.keys(e).length?cl(e,(function(e,t){return e?n.getStateNode(t).resolve(e):$c})):this.initialStateValue||{};default:return e||$c}},e.prototype.getResolvedPath=function(e){if(Sc(e)){var t=this.machine.idMap[e.slice(1)];if(!t)throw new Error("Unable to find state node '".concat(e,"'"));return t.path}return al(e,this.delimiter)},Object.defineProperty(e.prototype,"initialStateValue",{get:function(){var e,t;if(this.__cache.initialStateValue)return this.__cache.initialStateValue;if("parallel"===this.type)t=dl(this.states,(function(e){return e.initialStateValue||$c}),(function(e){return!("history"===e.type)}));else if(void 0!==this.initial){if(!this.states[this.initial])throw new Error("Initial state '".concat(this.initial,"' not found on '").concat(this.key,"'"));t=Gl(this.states[this.initial])?this.initial:((e={})[this.initial]=this.states[this.initial].initialStateValue,e)}else t={};return this.__cache.initialStateValue=t,this.__cache.initialStateValue},enumerable:!1,configurable:!0}),e.prototype.getInitialState=function(e,t){this._init();var n=this.getStateNodes(e);return this.resolveTransition({configuration:n,exitSet:[],transitions:[],source:void 0,actions:[]},void 0,null!=t?t:this.machine.context,void 0)},Object.defineProperty(e.prototype,"initialState",{get:function(){var e=this.initialStateValue;if(!e)throw new Error("Cannot retrieve initial state from simple state '".concat(this.id,"'."));return this.getInitialState(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"target",{get:function(){var e;if("history"===this.type){var t=this.config;e=jl(t.target)&&Sc(t.target)?ll(this.machine.getStateNodeById(t.target).path.slice(this.path.length-1)):t.target}return e},enumerable:!1,configurable:!0}),e.prototype.getRelativeStateNodes=function(e,t,n){return void 0===n&&(n=!0),n?"history"===e.type?e.resolveHistory(t):e.initialStateNodes:[e]},Object.defineProperty(e.prototype,"initialStateNodes",{get:function(){var e=this;return Gl(this)?[this]:"compound"!==this.type||this.initial?hl(pl(this.initialStateValue).map((function(t){return e.getFromRelativePath(t)}))):(rl||yl(!1,"Compound state node '".concat(this.id,"' has no initial state.")),[this])},enumerable:!1,configurable:!0}),e.prototype.getFromRelativePath=function(e){if(!e.length)return[this];var t=As(e),n=t[0],r=t.slice(1);if(!this.states)throw new Error("Cannot retrieve subPath '".concat(n,"' from node with no states"));var o=this.getStateNode(n);if("history"===o.type)return o.resolveHistory();if(!this.states[n])throw new Error("Child state '".concat(n,"' does not exist on '").concat(this.id,"'"));return this.states[n].getFromRelativePath(r)},e.prototype.historyValue=function(e){if(Object.keys(this.states).length)return{current:e||this.initialStateValue,states:dl(this.states,(function(t,n){if(!e)return t.historyValue();var r=jl(e)?void 0:e[n];return t.historyValue(r||t.initialStateValue)}),(function(e){return!e.history}))}},e.prototype.resolveHistory=function(e){var t=this;if("history"!==this.type)return[this];var n=this.parent;if(!e){var r=this.target;return r?hl(pl(r).map((function(e){return n.getFromRelativePath(e)}))):n.initialStateNodes}var o,i,a=(o=n.path,i="states",function(e){var t,n,r=e;try{for(var a=Ds(o),s=a.next();!s.done;s=a.next()){var l=s.value;r=r[i][l]}}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}return r})(e).current;return jl(a)?[n.getStateNode(a)]:hl(pl(a).map((function(e){return"deep"===t.history?n.getFromRelativePath(e):[n.states[e[0]]]})))},Object.defineProperty(e.prototype,"stateIds",{get:function(){var e=this,t=hl(Object.keys(this.states).map((function(t){return e.states[t].stateIds})));return[this.id].concat(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"events",{get:function(){var e,t,n,r;if(this.__cache.events)return this.__cache.events;var o=this.states,i=new Set(this.ownEvents);if(o)try{for(var a=Ds(Object.keys(o)),s=a.next();!s.done;s=a.next()){var l=o[s.value];if(l.states)try{for(var c=(n=void 0,Ds(l.events)),d=c.next();!d.done;d=c.next()){var u=d.value;i.add("".concat(u))}}catch(e){n={error:e}}finally{try{d&&!d.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}}}catch(t){e={error:t}}finally{try{s&&!s.done&&(t=a.return)&&t.call(a)}finally{if(e)throw e.error}}return this.__cache.events=Array.from(i)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ownEvents",{get:function(){var e=new Set(this.transitions.filter((function(e){return!(!e.target&&!e.actions.length&&e.internal)})).map((function(e){return e.eventType})));return Array.from(e)},enumerable:!1,configurable:!0}),e.prototype.resolveTarget=function(e){var t=this;if(void 0!==e)return e.map((function(e){if(!jl(e))return e;var n=e[0]===t.delimiter;if(n&&!t.parent)return t.getStateNodeByPath(e.slice(1));var r=n?t.key+e:e;if(!t.parent)return t.getStateNodeByPath(r);try{return t.parent.getStateNodeByPath(r)}catch(e){throw new Error("Invalid transition definition for state node '".concat(t.id,"':\n").concat(e.message))}}))},e.prototype.formatTransition=function(e){var t=this,n=function(e){if(void 0!==e&&""!==e)return gl(e)}(e.target),r="internal"in e?e.internal:!n||n.some((function(e){return jl(e)&&e[0]===t.delimiter})),o=this.machine.options.guards,i=this.resolveTarget(n),a=_s(_s({},e),{actions:Nl(gl(e.actions)),cond:kl(e.cond,o),target:i,source:this,internal:r,eventType:e.event,toJSON:function(){return _s(_s({},a),{target:a.target?a.target.map((function(e){return"#".concat(e.id)})):void 0,source:"#".concat(t.id)})}});return a},e.prototype.formatTransitions=function(){var e,t,n,r=this;if(this.config.on)if(Array.isArray(this.config.on))n=this.config.on;else{var o=this.config.on,i=kc,a=o[i],s=void 0===a?[]:a,l=Is(o,["*"]);n=hl(Object.keys(l).map((function(e){rl||e!==jc||yl(!1,"Empty string transition configs (e.g., `{ on: { '': ... }}`) for transient transitions are deprecated. Specify the transition in the `{ always: ... }` property instead. "+'Please check the `on` configuration for "#'.concat(r.id,'".'));var t=Rl(e,l[e]);return rl||function(e,t,n){var r=n.slice(0,-1).some((function(e){return!("cond"in e)&&!("in"in e)&&(jl(e.target)||Sl(e.target))})),o=t===jc?"the transient event":"event '".concat(t,"'");yl(!r,"One or more transitions for ".concat(o," on state '").concat(e.id,"' are unreachable. ")+"Make sure that the default transition is the last one defined.")}(r,e,t),t})).concat(Rl(kc,s)))}else n=[];var c=this.config.always?Rl("",this.config.always):[],d=this.config.onDone?Rl(String(zl(this.id)),this.config.onDone):[];rl||yl(!(this.config.onDone&&!this.parent),'Root nodes cannot have an ".onDone" transition. Please check the config of "'.concat(this.id,'".'));var u=hl(this.invoke.map((function(e){var t=[];return e.onDone&&t.push.apply(t,Ns([],As(Rl(String(Bl(e.id)),e.onDone)),!1)),e.onError&&t.push.apply(t,Ns([],As(Rl(String(Hl(e.id)),e.onError)),!1)),t}))),p=this.after,h=hl(Ns(Ns(Ns(Ns([],As(d),!1),As(u),!1),As(n),!1),As(c),!1).map((function(e){return gl(e).map((function(e){return r.formatTransition(e)}))})));try{for(var f=Ds(p),g=f.next();!g.done;g=f.next()){var x=g.value;h.push(x)}}catch(t){e={error:t}}finally{try{g&&!g.done&&(t=f.return)&&t.call(f)}finally{if(e)throw e.error}}return h},e}();var Lc,Rc=function(e){return{type:Zs,assignment:e}};!function(e){e[e.Effect=1]="Effect",e[e.LayoutEffect=2]="LayoutEffect"}(Lc||(Lc={}));var Tc="undefined"!=typeof document?n.useLayoutEffect:function(){};function Oc(e){var t=l.useRef();return t.current||(t.current={v:e()}),t.current.v}var Pc=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},Mc=function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};var _c=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},Ic=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))};function Dc(e,t){(0,e.exec)(t.context,t._event.data,{action:e,state:t,_event:t._event})()}function Ac(e){var t=n.useRef([]),r=n.useRef([]);Tc((function(){var n=e.subscribe((function(e){var n,o;if(e.actions.length){var i=e.actions.filter((function(e){return"function"==typeof e.exec&&"__effect"in e.exec})),a=_c(function(e,t){var n,r,o=Pc([[],[]],2),i=o[0],a=o[1];try{for(var s=Mc(e),l=s.next();!l.done;l=s.next()){var c=l.value;t(c)?i.push(c):a.push(c)}}catch(e){n={error:e}}finally{try{l&&!l.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return[i,a]}(i,(function(e){return e.exec.__effect===Lc.Effect})),2),s=a[0],l=a[1];(n=t.current).push.apply(n,Ic([],_c(s.map((function(t){return[t,e]}))),!1)),(o=r.current).push.apply(o,Ic([],_c(l.map((function(t){return[t,e]}))),!1))}}));return function(){n.unsubscribe()}}),[]),Tc((function(){for(;r.current.length;){var e=_c(r.current.shift(),2);Dc(e[0],e[1])}})),n.useEffect((function(){for(;t.current.length;){var e=_c(t.current.shift(),2);Dc(e[0],e[1])}}))}var Nc=function(){return Nc=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Nc.apply(this,arguments)},Vc=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},zc=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a};var Bc=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a};function Hc(e,t){void 0===t&&(t={});var r=n.useCallback((function(e){var t=void 0===e.changed&&Object.keys(e.children).length;(e.changed||t)&&s(e)}),[]),o=function(e,t,r){void 0===t&&(t={});var o=Oc((function(){return"function"==typeof e?e():e}));if("production"!==process.env.NODE_ENV&&"function"!=typeof e){var i=zc(n.useState(o),1)[0];e!==i&&console.warn("Machine given to `useMachine` has changed between renders. This is not supported and might lead to unexpected results.\nPlease make sure that you pass the same Machine as argument each time.")}var a=t.context,s=t.guards,l=t.actions,c=t.activities,d=t.services,u=t.delays,p=t.state,h=Vc(t,["context","guards","actions","activities","services","delays","state"]),f=Oc((function(){var e={context:a,guards:s,actions:l,activities:c,services:d,delays:u};return yc(o.withConfig(e,(function(){return Nc(Nc({},o.context),a)})),Nc({deferEvents:!0},h))}));return Tc((function(){var e;return r&&(e=f.subscribe(function(e){if("object"==typeof e)return e;var t=function(){};return{next:e,error:void 0||t,complete:void 0||t}}(r))),function(){null==e||e.unsubscribe()}}),[r]),Tc((function(){return f.start(p?ic.create(p):void 0),function(){f.stop()}}),[]),Tc((function(){Object.assign(f.machine.options.actions,l),Object.assign(f.machine.options.guards,s),Object.assign(f.machine.options.activities,c),Object.assign(f.machine.options.services,d),Object.assign(f.machine.options.delays,u)}),[l,s,c,d,u]),Ac(f),f}(e,t,r),i=Bc(n.useState((function(){var e=o.machine.initialState;return t.state?ic.create(t.state):e})),2),a=i[0],s=i[1];return[a,o.send,o]}function Fc(){return Fc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Fc.apply(null,arguments)}function qc(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}const Zc={arr:Array.isArray,obj:e=>"[object Object]"===Object.prototype.toString.call(e),fun:e=>"function"==typeof e,str:e=>"string"==typeof e,num:e=>"number"==typeof e,und:e=>void 0===e,nul:e=>null===e,set:e=>e instanceof Set,map:e=>e instanceof Map,equ(e,t){if(typeof e!=typeof t)return!1;if(Zc.str(e)||Zc.num(e))return e===t;if(Zc.obj(e)&&Zc.obj(t)&&Object.keys(e).length+Object.keys(t).length===0)return!0;let n;for(n in e)if(!(n in t))return!1;for(n in t)if(e[n]!==t[n])return!1;return!Zc.und(n)||e===t}};function Wc(e,t){return Zc.und(e)||Zc.nul(e)?t:e}function Gc(e){return Zc.und(e)?[]:Zc.arr(e)?e:[e]}function Uc(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return Zc.fun(e)?e(...n):e}function Xc(e){const t=function(e){return e.to,e.from,e.config,e.onStart,e.onRest,e.onFrame,e.children,e.reset,e.reverse,e.force,e.immediate,e.delay,e.attach,e.destroyed,e.interpolateTo,e.ref,e.lazy,qc(e,["to","from","config","onStart","onRest","onFrame","children","reset","reverse","force","immediate","delay","attach","destroyed","interpolateTo","ref","lazy"])}(e);if(Zc.und(t))return Fc({to:t},e);const n=Object.keys(e).reduce(((n,r)=>Zc.und(t[r])?Fc({},n,{[r]:e[r]}):n),{});return Fc({to:t},n)}class Yc{constructor(){this.payload=void 0,this.children=[]}getAnimatedValue(){return this.getValue()}getPayload(){return this.payload||this}attach(){}detach(){}getChildren(){return this.children}addChild(e){0===this.children.length&&this.attach(),this.children.push(e)}removeChild(e){const t=this.children.indexOf(e);this.children.splice(t,1),0===this.children.length&&this.detach()}}class Kc extends Yc{constructor(){super(...arguments),this.payload=[],this.attach=()=>this.payload.forEach((e=>e instanceof Yc&&e.addChild(this))),this.detach=()=>this.payload.forEach((e=>e instanceof Yc&&e.removeChild(this)))}}class Jc extends Yc{constructor(){super(...arguments),this.payload={},this.attach=()=>Object.values(this.payload).forEach((e=>e instanceof Yc&&e.addChild(this))),this.detach=()=>Object.values(this.payload).forEach((e=>e instanceof Yc&&e.removeChild(this)))}getValue(e){void 0===e&&(e=!1);const t={};for(const n in this.payload){const r=this.payload[n];(!e||r instanceof Yc)&&(t[n]=r instanceof Yc?r[e?"getAnimatedValue":"getValue"]():r)}return t}getAnimatedValue(){return this.getValue(!0)}}let Qc,ed;let td,nd=e=>"undefined"!=typeof window?window.requestAnimationFrame(e):-1;let rd,od=()=>Date.now();class id extends Jc{constructor(e,t){super(),this.update=void 0,this.payload=e.style?Fc({},e,{style:rd(e.style)}):e,this.update=t,this.attach()}}let ad=!1;const sd=new Set,ld=()=>{if(!ad)return!1;let e=od();for(let t of sd){let n=!1;for(let r=0;r<t.configs.length;r++){let o,i,a=t.configs[r];for(let t=0;t<a.animatedValues.length;t++){let r=a.animatedValues[t];if(r.done)continue;let s=a.fromValues[t],l=a.toValues[t],c=r.lastPosition,d=l instanceof Yc,u=Array.isArray(a.initialVelocity)?a.initialVelocity[t]:a.initialVelocity;if(d&&(l=l.getValue()),a.immediate)r.setValue(l),r.done=!0;else if("string"!=typeof s&&"string"!=typeof l){if(void 0!==a.duration)c=s+a.easing((e-r.startTime)/a.duration)*(l-s),o=e>=r.startTime+a.duration;else if(a.decay)c=s+u/(1-.998)*(1-Math.exp(-.0020000000000000018*(e-r.startTime))),o=Math.abs(r.lastPosition-c)<.1,o&&(l=c);else{i=void 0!==r.lastTime?r.lastTime:e,u=void 0!==r.lastVelocity?r.lastVelocity:a.initialVelocity,e>i+64&&(i=e);let t=Math.floor(e-i);for(let e=0;e<t;++e){u+=1*((-a.tension*(c-l)+-a.friction*u)/a.mass)/1e3,c+=1*u/1e3}let n=!(!a.clamp||0===a.tension)&&(s<l?c>l:c<l),d=Math.abs(u)<=a.precision,p=0===a.tension||Math.abs(l-c)<=a.precision;o=n||d&&p,r.lastVelocity=u,r.lastTime=e}d&&!a.toValues[t].done&&(o=!1),o?(r.value!==l&&(c=l),r.done=!0):n=!0,r.setValue(c),r.lastPosition=c}else r.setValue(l),r.done=!0}t.props.onFrame&&(t.values[a.name]=a.interpolation.getValue())}t.props.onFrame&&t.props.onFrame(t.values),n||(sd.delete(t),t.stop(!0))}return sd.size?nd(ld):ad=!1,ad};function cd(e,t,n){if("function"==typeof e)return e;if(Array.isArray(e))return cd({range:e,output:t,extrapolate:n});if(td&&"string"==typeof e.output[0])return td(e);const r=e,o=r.output,i=r.range||[0,1],a=r.extrapolateLeft||r.extrapolate||"extend",s=r.extrapolateRight||r.extrapolate||"extend",l=r.easing||(e=>e);return e=>{const t=function(e,t){for(var n=1;n<t.length-1&&!(t[n]>=e);++n);return n-1}(e,i);return function(e,t,n,r,o,i,a,s,l){let c=l?l(e):e;if(c<t){if("identity"===a)return c;"clamp"===a&&(c=t)}if(c>n){if("identity"===s)return c;"clamp"===s&&(c=n)}if(r===o)return r;if(t===n)return e<=t?r:o;t===-1/0?c=-c:n===1/0?c-=t:c=(c-t)/(n-t);c=i(c),r===-1/0?c=-c:o===1/0?c+=r:c=c*(o-r)+r;return c}(e,i[t],i[t+1],o[t],o[t+1],l,a,s,r.map)}}class dd extends Kc{constructor(e,t,n,r){super(),this.calc=void 0,this.payload=e instanceof Kc&&!(e instanceof dd)?e.getPayload():Array.isArray(e)?e:[e],this.calc=cd(t,n,r)}getValue(){return this.calc(...this.payload.map((e=>e.getValue())))}updateConfig(e,t,n){this.calc=cd(e,t,n)}interpolate(e,t,n){return new dd(this,e,t,n)}}const ud=(e,t,n)=>e&&new dd(e,t,n);function pd(e,t){"update"in e?t.add(e):e.getChildren().forEach((e=>pd(e,t)))}class hd extends Yc{constructor(e){var t;super(),t=this,this.animatedStyles=new Set,this.value=void 0,this.startPosition=void 0,this.lastPosition=void 0,this.lastVelocity=void 0,this.startTime=void 0,this.lastTime=void 0,this.done=!1,this.setValue=function(e,n){void 0===n&&(n=!0),t.value=e,n&&t.flush()},this.value=e,this.startPosition=e,this.lastPosition=e}flush(){0===this.animatedStyles.size&&pd(this,this.animatedStyles),this.animatedStyles.forEach((e=>e.update()))}clearStyles(){this.animatedStyles.clear()}getValue(){return this.value}interpolate(e,t,n){return new dd(this,e,t,n)}}class fd extends Kc{constructor(e){super(),this.payload=e.map((e=>new hd(e)))}setValue(e,t){void 0===t&&(t=!0),Array.isArray(e)?e.length===this.payload.length&&e.forEach(((e,n)=>this.payload[n].setValue(e,t))):this.payload.forEach((n=>n.setValue(e,t)))}getValue(){return this.payload.map((e=>e.getValue()))}interpolate(e,t){return new dd(this,e,t)}}let gd=0,xd=class{constructor(){this.id=void 0,this.idle=!0,this.hasChanged=!1,this.guid=0,this.local=0,this.props={},this.merged={},this.animations={},this.interpolations={},this.values={},this.configs=[],this.listeners=[],this.queue=[],this.localQueue=void 0,this.getValues=()=>this.interpolations,this.id=gd++}update(e){if(!e)return this;const t=Xc(e),n=t.delay,r=void 0===n?0:n,o=t.to,i=qc(t,["delay","to"]);if(Zc.arr(o)||Zc.fun(o))this.queue.push(Fc({},i,{delay:r,to:o}));else if(o){let e={};Object.entries(o).forEach((t=>{let n=t[0],o=t[1];const a=Fc({to:{[n]:o},delay:Uc(r,n)},i),s=e[a.delay]&&e[a.delay].to;e[a.delay]=Fc({},e[a.delay],a,{to:Fc({},s,a.to)})})),this.queue=Object.values(e)}return this.queue=this.queue.sort(((e,t)=>e.delay-t.delay)),this.diff(i),this}start(e){if(this.queue.length){this.idle=!1,this.localQueue&&this.localQueue.forEach((e=>{let t=e.from,n=void 0===t?{}:t,r=e.to,o=void 0===r?{}:r;Zc.obj(n)&&(this.merged=Fc({},n,this.merged)),Zc.obj(o)&&(this.merged=Fc({},this.merged,o))}));const t=this.local=++this.guid,n=this.localQueue=this.queue;this.queue=[],n.forEach(((r,o)=>{let i=r.delay,a=qc(r,["delay"]);const s=r=>{o===n.length-1&&t===this.guid&&r&&(this.idle=!0,this.props.onRest&&this.props.onRest(this.merged)),e&&e()};let l=Zc.arr(a.to)||Zc.fun(a.to);i?setTimeout((()=>{t===this.guid&&(l?this.runAsync(a,s):this.diff(a).start(s))}),i):l?this.runAsync(a,s):this.diff(a).start(s)}))}else Zc.fun(e)&&this.listeners.push(e),this.props.onStart&&this.props.onStart(),t=this,sd.has(t)||sd.add(t),ad||(ad=!0,nd(ld));var t;return this}stop(e){return this.listeners.forEach((t=>t(e))),this.listeners=[],this}pause(e){var t;return this.stop(!0),e&&(t=this,sd.has(t)&&sd.delete(t)),this}runAsync(e,t){var n=this;e.delay;let r=qc(e,["delay"]);const o=this.local;let i=Promise.resolve(void 0);if(Zc.arr(r.to))for(let e=0;e<r.to.length;e++){const t=e,n=Fc({},r,Xc(r.to[t]));Zc.arr(n.config)&&(n.config=n.config[t]),i=i.then((()=>{if(o===this.guid)return new Promise((e=>this.diff(n).start(e)))}))}else if(Zc.fun(r.to)){let e,t=0;i=i.then((()=>r.to((n=>{const i=Fc({},r,Xc(n));if(Zc.arr(i.config)&&(i.config=i.config[t]),t++,o===this.guid)return e=new Promise((e=>this.diff(i).start(e)))}),(function(e){return void 0===e&&(e=!0),n.stop(e)})).then((()=>e))))}i.then(t)}diff(e){this.props=Fc({},this.props,e);let t=this.props,n=t.from,r=void 0===n?{}:n,o=t.to,i=void 0===o?{}:o,a=t.config,s=void 0===a?{}:a,l=t.reverse,c=t.attach,d=t.reset,u=t.immediate;if(l){var p=[i,r];r=p[0],i=p[1]}this.merged=Fc({},r,this.merged,i),this.hasChanged=!1;let h=c&&c(this);if(this.animations=Object.entries(this.merged).reduce(((e,t)=>{let n=t[0],o=t[1],i=e[n]||{};const a=Zc.num(o),l=Zc.str(o)&&!o.startsWith("#")&&!/\d/.test(o)&&!ed[o],c=Zc.arr(o),p=!a&&!c&&!l;let f=Zc.und(r[n])?o:r[n],g=a||c||l?o:1,x=Uc(s,n);h&&(g=h.animations[n].parent);let m,v=i.parent,b=i.interpolation,y=Gc(h?g.getPayload():g),w=o;p&&(w=td({range:[0,1],output:[o,o]})(1));let C=b&&b.getValue();const j=!Zc.und(v)&&i.animatedValues.some((e=>!e.done)),k=!Zc.equ(w,C),$=!Zc.equ(w,i.previous),S=!Zc.equ(x,i.config);if(d||$&&k||S){if(a||l)v=b=i.parent||new hd(f);else if(c)v=b=i.parent||new fd(f);else if(p){let e=i.interpolation&&i.interpolation.calc(i.parent.value);e=void 0===e||d?f:e,i.parent?(v=i.parent,v.setValue(0,!1)):v=new hd(0);const t={output:[e,o]};i.interpolation?(b=i.interpolation,i.interpolation.updateConfig(t)):b=v.interpolate(t)}return y=Gc(h?g.getPayload():g),m=Gc(v.getPayload()),d&&!p&&v.setValue(f,!1),this.hasChanged=!0,m.forEach((e=>{e.startPosition=e.value,e.lastPosition=e.value,e.lastVelocity=j?e.lastVelocity:void 0,e.lastTime=j?e.lastTime:void 0,e.startTime=od(),e.done=!1,e.animatedStyles.clear()})),Uc(u,n)&&v.setValue(p?g:o,!1),Fc({},e,{[n]:Fc({},i,{name:n,parent:v,interpolation:b,animatedValues:m,toValues:y,previous:w,config:x,fromValues:Gc(v.getValue()),immediate:Uc(u,n),initialVelocity:Wc(x.velocity,0),clamp:Wc(x.clamp,!1),precision:Wc(x.precision,.01),tension:Wc(x.tension,170),friction:Wc(x.friction,26),mass:Wc(x.mass,1),duration:x.duration,easing:Wc(x.easing,(e=>e)),decay:x.decay})})}return k?e:(p&&(v.setValue(1,!1),b.updateConfig({output:[w,w]})),v.done=!0,this.hasChanged=!0,Fc({},e,{[n]:Fc({},e[n],{previous:w})}))}),this.animations),this.hasChanged){this.configs=Object.values(this.animations),this.values={},this.interpolations={};for(let e in this.animations)this.interpolations[e]=this.animations[e].interpolation,this.values[e]=this.animations[e].interpolation.getValue()}return this}destroy(){this.stop(),this.props={},this.merged={},this.animations={},this.interpolations={},this.values={},this.configs=[],this.local=0}};const md=e=>{const t=Zc.fun(e),r=((e,t)=>{const r=n.useRef(!1),o=n.useRef(),i=Zc.fun(t),a=n.useMemo((()=>{let n;return o.current&&(o.current.map((e=>e.destroy())),o.current=void 0),[new Array(e).fill().map(((e,r)=>{const o=new xd,a=i?Uc(t,r,o):t[r];return 0===r&&(n=a.ref),o.update(a),n||o.start(),o})),n]}),[e]),s=a[0],l=a[1];o.current=s,n.useImperativeHandle(l,(()=>({start:()=>Promise.all(o.current.map((e=>new Promise((t=>e.start(t)))))),stop:e=>o.current.forEach((t=>t.stop(e))),get controllers(){return o.current}})));const c=n.useMemo((()=>e=>o.current.map(((t,n)=>{t.update(i?Uc(e,n,t):e[n]),l||t.start()}))),[e]);n.useEffect((()=>{r.current?i||c(t):l||o.current.forEach((e=>e.start()))})),n.useEffect((()=>(r.current=!0,()=>o.current.forEach((e=>e.destroy())))),[]);const d=o.current.map((e=>e.getValues()));return i?[d,c,e=>o.current.forEach((t=>t.pause(e)))]:d})(1,t?e:[e]),o=r[0],i=r[1],a=r[2];return t?[o[0],i,a]:o};class vd extends Jc{constructor(e){void 0===e&&(e={}),super(),!e.transform||e.transform instanceof Yc||(e=Qc.transform(e)),this.payload=e}}const bd={transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199},yd="[-+]?\\d*\\.?\\d+",wd=yd+"%";function Cd(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return"\\(\\s*("+t.join(")\\s*,\\s*(")+")\\s*\\)"}const jd=new RegExp("rgb"+Cd(yd,yd,yd)),kd=new RegExp("rgba"+Cd(yd,yd,yd,yd)),$d=new RegExp("hsl"+Cd(yd,wd,wd)),Sd=new RegExp("hsla"+Cd(yd,wd,wd,yd)),Ed=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,Ld=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,Rd=/^#([0-9a-fA-F]{6})$/,Td=/^#([0-9a-fA-F]{8})$/;function Od(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Pd(e,t,n){const r=n<.5?n*(1+t):n+t-n*t,o=2*n-r,i=Od(o,r,e+1/3),a=Od(o,r,e),s=Od(o,r,e-1/3);return Math.round(255*i)<<24|Math.round(255*a)<<16|Math.round(255*s)<<8}function Md(e){const t=parseInt(e,10);return t<0?0:t>255?255:t}function _d(e){return(parseFloat(e)%360+360)%360/360}function Id(e){const t=parseFloat(e);return t<0?0:t>1?255:Math.round(255*t)}function Dd(e){const t=parseFloat(e);return t<0?0:t>100?1:t/100}function Ad(e){let t=function(e){let t;return"number"==typeof e?e>>>0===e&&e>=0&&e<=4294967295?e:null:(t=Rd.exec(e))?parseInt(t[1]+"ff",16)>>>0:bd.hasOwnProperty(e)?bd[e]:(t=jd.exec(e))?(Md(t[1])<<24|Md(t[2])<<16|Md(t[3])<<8|255)>>>0:(t=kd.exec(e))?(Md(t[1])<<24|Md(t[2])<<16|Md(t[3])<<8|Id(t[4]))>>>0:(t=Ed.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+"ff",16)>>>0:(t=Td.exec(e))?parseInt(t[1],16)>>>0:(t=Ld.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+t[4]+t[4],16)>>>0:(t=$d.exec(e))?(255|Pd(_d(t[1]),Dd(t[2]),Dd(t[3])))>>>0:(t=Sd.exec(e))?(Pd(_d(t[1]),Dd(t[2]),Dd(t[3]))|Id(t[4]))>>>0:null}(e);return null===t?e:(t=t||0,`rgba(${(4278190080&t)>>>24}, ${(16711680&t)>>>16}, ${(65280&t)>>>8}, ${(255&t)/255})`)}const Nd=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,Vd=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,zd=new RegExp(`(${Object.keys(bd).join("|")})`,"g");let Bd={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0};const Hd=["Webkit","Ms","Moz","O"];function Fd(e,t,n){return null==t||"boolean"==typeof t||""===t?"":n||"number"!=typeof t||0===t||Bd.hasOwnProperty(e)&&Bd[e]?(""+t).trim():t+"px"}Bd=Object.keys(Bd).reduce(((e,t)=>(Hd.forEach((n=>e[((e,t)=>e+t.charAt(0).toUpperCase()+t.substring(1))(n,t)]=e[t])),e)),Bd);const qd={};var Zd;rd=e=>new vd(e),Zd=e=>{const t=e.output.map((e=>e.replace(Vd,Ad))).map((e=>e.replace(zd,Ad))),n=t[0].match(Nd).map((()=>[]));t.forEach((e=>{e.match(Nd).forEach(((e,t)=>n[t].push(+e)))}));const r=t[0].match(Nd).map(((t,r)=>cd(Fc({},e,{output:n[r]}))));return e=>{let n=0;return t[0].replace(Nd,(()=>r[n++](e))).replace(/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,((e,t,n,r,o)=>`rgba(${Math.round(t)}, ${Math.round(n)}, ${Math.round(r)}, ${o})`))}},td=Zd,ed=bd,function(e,t){Qc={fn:e,transform:t}}(((e,t)=>{if(!e.nodeType||void 0===e.setAttribute)return!1;{const o=t.style,i=t.children,a=t.scrollTop,s=t.scrollLeft,l=qc(t,["style","children","scrollTop","scrollLeft"]),c="filter"===e.nodeName||e.parentNode&&"filter"===e.parentNode.nodeName;void 0!==a&&(e.scrollTop=a),void 0!==s&&(e.scrollLeft=s),void 0!==i&&(e.textContent=i);for(let t in o)if(o.hasOwnProperty(t)){var n=0===t.indexOf("--"),r=Fd(t,o[t],n);"float"===t&&(t="cssFloat"),n?e.style.setProperty(t,r):e.style[t]=r}for(let t in l){const n=c?t:qd[t]||(qd[t]=t.replace(/([A-Z])/g,(e=>"-"+e.toLowerCase())));void 0!==e.getAttribute(n)&&e.setAttribute(n,l[t])}}}),(e=>e));var Wd;const Gd=(Wd=e=>n.forwardRef(((t,r)=>{const o=function(){const e=n.useState(!1)[1];return n.useCallback((()=>e((e=>!e))),[])}(),i=n.useRef(!0),a=n.useRef(null),s=n.useRef(null),l=n.useCallback((e=>{const t=a.current;a.current=new id(e,(()=>{let e=!1;s.current&&(e=Qc.fn(s.current,a.current.getAnimatedValue())),s.current&&!1!==e||o()})),t&&t.detach()}),[]);n.useEffect((()=>()=>{i.current=!1,a.current&&a.current.detach()}),[]),n.useImperativeHandle(r,(()=>(e=>e.current)(s))),l(t);const c=a.current.getValue();c.scrollTop,c.scrollLeft;const d=qc(c,["scrollTop","scrollLeft"]),u=(p=e,!Zc.fun(p)||p.prototype instanceof n.Component?e=>s.current=function(e,t){return t&&(Zc.fun(t)?t(e):Zc.obj(t)&&(t.current=e)),e}(e,r):void 0);var p;return n.createElement(e,Fc({},d,{ref:u}))})),e=>(Zc.arr(e)?e:Object.keys(e)).reduce(((e,t)=>{const n=t;return e[n]=Wd(n),e}),Wd))(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"]);function Ud(e,t){return e.map((function(e,n){return e+t[n]}))}function Xd(e,t){return e.map((function(e,n){return e-t[n]}))}function Yd(e){return Math.hypot.apply(Math,e)}function Kd(e){return Math.sign?Math.sign(e):Number(e>0)-Number(e<0)||+e}function Jd(e,t,n){return 0===t||Math.abs(t)===1/0?function(e,t){return Math.pow(e,5*t)}(e,n):e*t*n/(t+n*e)}function Qd(e,t,n,r){return void 0===r&&(r=.15),0===r?function(e,t,n){return Math.max(t,Math.min(e,n))}(e,t,n):e<t?-Jd(t-e,n-t,r)+t:e>n?+Jd(e-n,n-t,r)+n:e}function eu(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}function tu(){return tu=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},tu.apply(this,arguments)}function nu(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function ru(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ou(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function iu(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return ou(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ou(e,t):void 0}}(e))||t){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(n=e[Symbol.iterator]()).next.bind(n)}function au(){}function su(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return 0===t.length?au:1===t.length?t[0]:function(){for(var e,n,r=iu(t);!(n=r()).done;){e=n.value.apply(this,arguments)||e}return e}}function lu(e,t){if(void 0===e){if(void 0===t)throw new Error("Must define fallback value if undefined is expected");e=t}return Array.isArray(e)?e:[e,e]}function cu(e){if("function"==typeof e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return e.apply(void 0,n)}return e}function du(e,t){void 0===e&&(e={});for(var n={},r=0,o=Object.entries(t);r<o.length;r++){var i=o[r],a=i[0],s=i[1];switch(typeof s){case"function":n[a]=s.call(n,e[a],a,e);break;case"object":n[a]=du(e[a],s);break;case"boolean":s&&(n[a]=e[a])}}return n}var uu=tu({},{threshold:function(e){return void 0===e&&(e=0),lu(e)},rubberband:function(e){switch(void 0===e&&(e=0),e){case!0:return lu(.15);case!1:return lu(0);default:return lu(e)}},enabled:function(e){return void 0===e&&(e=!0),e},triggerAllEvents:function(e){return void 0===e&&(e=!1),e},initial:function(e){return void 0===e&&(e=0),"function"==typeof e?e:lu(e)}},{axis:!0,lockDirection:function(e){return void 0===e&&(e=!1),e},bounds:function(e){if(void 0===e&&(e={}),"function"==typeof e)return function(t){return uu.bounds(e(t))};var t=e,n=t.left,r=void 0===n?-1/0:n,o=t.right,i=void 0===o?1/0:o,a=t.top,s=void 0===a?-1/0:a,l=t.bottom;return[[r,i],[s,void 0===l?1/0:l]]}}),pu="undefined"!=typeof window&&window.document&&window.document.createElement,hu={enabled:function(e){return void 0===e&&(e=!0),e},domTarget:!0,window:function(e){function t(t){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((function(e){return void 0===e&&(e=pu?window:void 0),e})),eventOptions:function(e){var t=void 0===e?{}:e,n=t.passive,r=void 0===n||n,o=t.capture;return{passive:r,capture:void 0!==o&&o}}},fu=tu({},uu,{threshold:function(e,t,n){var r=n.filterTaps,o=void 0!==r&&r,i=n.lockDirection,a=void 0!==i&&i,s=n.axis,l=lu(e,o?3:a||(void 0===s?void 0:s)?1:0);return this.filterTaps=o||l[0]+l[1]>0,l},swipeVelocity:function(e){return void 0===e&&(e=.5),lu(e)},swipeDistance:function(e){return void 0===e&&(e=60),lu(e)},delay:function(e){switch(void 0===e&&(e=0),e){case!0:return 180;case!1:return 0;default:return e}}});function gu(e){var t=e.domTarget,n=e.eventOptions,r=e.window,o=e.enabled,i=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,["domTarget","eventOptions","window","enabled"]),a=function(e){return void 0===e&&(e={}),du(e,hu)}({domTarget:t,eventOptions:n,window:r,enabled:o});return a.drag=function(e){return void 0===e&&(e={}),du(e,fu)}(i),a}function xu(e){return tu({_active:!1,_blocked:!1,_intentional:[!1,!1],_movement:[0,0],_initial:[0,0],_bounds:[[-1/0,1/0],[-1/0,1/0]],_lastEventType:void 0,event:void 0,intentional:!1,values:[0,0],velocities:[0,0],delta:[0,0],movement:[0,0],offset:[0,0],lastOffset:[0,0],direction:[0,0],initial:[0,0],previous:[0,0],first:!1,last:!1,active:!1,timeStamp:0,startTime:0,elapsedTime:0,cancel:au,canceled:!1,memo:void 0,args:void 0},e)}function mu(){return{shared:{hovering:!1,scrolling:!1,wheeling:!1,dragging:!1,moving:!1,pinching:!1,touches:0,buttons:0,down:!1,shiftKey:!1,altKey:!1,metaKey:!1,ctrlKey:!1},drag:xu({axis:void 0,xy:[0,0],vxvy:[0,0],velocity:0,distance:0,_isTap:!0,_delayedEvent:!1,_pointerId:void 0,tap:!1,swipe:[0,0]}),pinch:xu({da:[0,0],vdva:[0,0],origin:void 0,turns:0}),wheel:xu({axis:void 0,xy:[0,0],vxvy:[0,0],velocity:0,distance:0}),move:xu({axis:void 0,xy:[0,0],vxvy:[0,0],velocity:0,distance:0}),scroll:xu({axis:void 0,xy:[0,0],vxvy:[0,0],velocity:0,distance:0})}}var vu=new Map,bu=function(){function e(e,t){var n=this;void 0===t&&(t=[]),this.controller=e,this.args=t,this.debounced=!0,this.setTimeout=function(e,t){var r;void 0===t&&(t=140),clearTimeout(n.controller.timeouts[n.stateKey]);for(var o=arguments.length,i=new Array(o>2?o-2:0),a=2;a<o;a++)i[a-2]=arguments[a];n.controller.timeouts[n.stateKey]=(r=window).setTimeout.apply(r,[e,t].concat(i))},this.clearTimeout=function(){clearTimeout(n.controller.timeouts[n.stateKey])},this.fireGestureHandler=function(e){if(void 0===e&&(e=!1),n.state._blocked)return n.debounced||(n.state._active=!1,n.clean()),null;if(!e&&!n.state.intentional&&!n.config.triggerAllEvents)return null;if(n.state.intentional){var t=n.state.active,r=n.state._active;n.state.active=r,n.state.first=r&&!t,n.state.last=t&&!r,n.controller.state.shared[n.ingKey]=r}var o=tu({},n.controller.state.shared,n.state,n.mapStateValues(n.state)),i=n.handler(o);return n.state.memo=void 0!==i?i:n.state.memo,n.state._active||n.clean(),o}}var t=e.prototype;return t.updateSharedState=function(e){Object.assign(this.controller.state.shared,e)},t.updateGestureState=function(e){Object.assign(this.state,e)},t.checkIntentionality=function(e,t){return{_intentional:e,_blocked:!1}},t.getMovement=function(e){var t=this.config,n=t.initial,r=t.bounds,o=t.rubberband,i=t.threshold,a=this.state,s=a._bounds,l=a._initial,c=a._active,d=a._intentional,u=a.lastOffset,p=a.movement,h=this.getInternalMovement(e,this.state),f=!1===d[0]?yu(h[0],i[0]):d[0],g=!1===d[1]?yu(h[1],i[1]):d[1],x=this.checkIntentionality([f,g],h);if(x._blocked)return tu({},x,{_movement:h,delta:[0,0]});var m,v,b,y,w=x._intentional,C=h;(!1!==w[0]&&!1===d[0]&&(v=cu(n,this.state),m=cu(r,this.state),l[0]=v[0],s[0]=m[0]),!1!==w[1]&&!1===d[1])&&(v=null!=(b=v)?b:cu(n,this.state),m=null!=(y=m)?y:cu(r,this.state),l[1]=v[1],s[1]=m[1]);var j=[!1!==w[0]?h[0]-w[0]:l[0],!1!==w[1]?h[1]-w[1]:l[1]],k=Ud(j,u),$=c?o:[0,0];return j=wu(s,Ud(j,l),$),tu({},x,{intentional:!1!==w[0]||!1!==w[1],_initial:l,_movement:C,movement:j,values:e,offset:wu(s,k,$),delta:Xd(j,p)})},t.clean=function(){this.clearTimeout()},eu(e,[{key:"config",get:function(){return this.controller.config[this.stateKey]}},{key:"enabled",get:function(){return this.controller.config.enabled&&this.config.enabled}},{key:"state",get:function(){return this.controller.state[this.stateKey]}},{key:"handler",get:function(){return this.controller.handlers[this.stateKey]}}]),e}();function yu(e,t){return Math.abs(e)>=t&&Kd(e)*t}function wu(e,t,n){var r=t[0],o=t[1],i=n[0],a=n[1],s=e[0],l=s[0],c=s[1],d=e[1],u=d[0],p=d[1];return[Qd(r,l,c,i),Qd(o,u,p,a)]}function Cu(e,t,n){var r=e.state,o=e.args,i=t.timeStamp,a=t.type,s=r.values;return{_lastEventType:a,event:t,timeStamp:i,elapsedTime:n?0:i-r.startTime,args:o,previous:s}}function ju(e,t){return function(n){for(var r=arguments.length,o=new Array(r>1?r-1:0),i=1;i<r;i++)o[i-1]=arguments[i];return e.call.apply(e,[this,tu({},t,{event:n})].concat(o))}}var ku=function(e){var t=this;this.classes=e,this.bind=function(){for(var e={},n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];for(var i,a=iu(t.classes);!(i=a()).done;){new(0,i.value)(t,r).addBindings(e)}for(var s=0,l=Object.entries(t.nativeRefs);s<l.length;s++){var c=l[s];Eu(e,c[0],ju(c[1],tu({},t.state.shared,{args:r})))}return t.config.domTarget?function(e,t){var n=e.config,r=e.domListeners,o=Su(n);if(!o)throw new Error("domTarget must be defined");var i=n.eventOptions;Ru(o,$u(r),i);for(var a=0,s=Object.entries(t);a<s.length;a++){var l=s[a],c=l[0],d=l[1],u=c.slice(2).toLowerCase();r.push([u,su.apply(void 0,d)])}Lu(o,r,i)}(t,e):function(e,t){for(var n=e.config,r={},o=n.eventOptions.capture?"Capture":"",i=0,a=Object.entries(t);i<a.length;i++){var s=a[i],l=s[0],c=s[1],d=Array.isArray(c)?c:[c];r[l+o]=su.apply(void 0,d)}return r}(t,e)},this.effect=function(){return t.config.domTarget&&t.bind(),t.clean},this.clean=function(){var e=Su(t.config),n=t.config.eventOptions;e&&Ru(e,$u(t.domListeners),n),Object.values(t.timeouts).forEach(clearTimeout),function(e){var t=e.config,n=t.window,r=t.eventOptions,o=e.windowListeners;if(!n)return;for(var i in o){Ru(n,o[i],r)}e.windowListeners={}}(t)},this.state=mu(),this.timeouts={},this.domListeners=[],this.windowListeners={}};function $u(e){return void 0===e&&(e=[]),e.splice(0,e.length)}function Su(e){var t=e.domTarget;return t&&"current"in t?t.current:t}function Eu(e,t,n){e[t]||(e[t]=[]),e[t].push(n)}function Lu(e,t,n){void 0===t&&(t=[]),void 0===n&&(n={});for(var r,o=iu(t);!(r=o()).done;){var i=r.value,a=i[0],s=i[1];e.addEventListener(a,s,n)}}function Ru(e,t,n){void 0===t&&(t=[]),void 0===n&&(n={});for(var r,o=iu(t);!(r=o()).done;){var i=r.value,a=i[0],s=i[1];e.removeEventListener(a,s,n)}}function Tu(e,t,r){void 0===r&&(r={});var o=function(e){var t=new Set;e.drag&&t.add(vu.get("drag"));e.wheel&&t.add(vu.get("wheel"));e.scroll&&t.add(vu.get("scroll"));e.move&&t.add(vu.get("move"));e.pinch&&t.add(vu.get("pinch"));e.hover&&t.add(vu.get("hover"));return t}(e),i=n.useMemo((function(){return new ku(o)}),[]);return i.config=t,i.handlers=e,i.nativeRefs=r,n.useEffect(i.effect,[]),i.config.domTarget?Ou:i.bind}function Ou(){"development"===process.env.NODE_ENV&&console.warn("Deprecation notice: When the `domTarget` option is specified, you don't need to write `useEffect(bind, [bind])` anymore: event binding is now made handled internally to this lib.\n\nNext version won't return anything when `domTarget` is provided, therefore your code will break if you try to call `useEffect`.")}function Pu(e){if("touches"in e){var t=e.targetTouches,n=e.changedTouches;return t.length>0?t:n}return null}function Mu(e){var t="buttons"in e?e.buttons:0,n=Pu(e),r=n&&n.length||0;return{touches:r,down:r>0||t>0,buttons:t,shiftKey:e.shiftKey,altKey:e.altKey,metaKey:e.metaKey,ctrlKey:e.ctrlKey}}function _u(e){var t=Pu(e),n=t?t[0]:e;return[n.clientX,n.clientY]}var Iu=function(e){function t(){var t;return(t=e.apply(this,arguments)||this).ingKey="dragging",t.stateKey="drag",t.onDragStart=function(e){t.enabled&&!t.state._active&&(!function(e,t,n){var r=e.config,o=e.windowListeners;void 0===n&&(n=[]),r.window&&(Ru(r.window,o[t],r.eventOptions),Lu(r.window,o[t]=n,r.eventOptions))}(t.controller,t.stateKey,[["pointermove",t.onDragChange],["pointerup",t.onDragEnd],["pointercancel",t.onDragEnd]]),t.updateGestureState({_pointerId:e.pointerId}),t.config.delay>0?(t.state._delayedEvent=!0,"persist"in e&&"function"==typeof e.persist&&e.persist(),t.setTimeout(t.startDrag.bind(ru(t)),t.config.delay,e)):t.startDrag(e))},t.onDragChange=function(e){if(!t.state.canceled&&e.pointerId===t.state._pointerId)if(t.state._active){var n=Mu(e);if(n.down){t.updateSharedState(n);var r=_u(e),o=t.getKinematics(r,e),i=Cu(ru(t),e),a=t.state._isTap,s=Yd(o._movement);a&&s>=3&&(a=!1),t.updateGestureState(tu({},i,o,{_isTap:a})),t.fireGestureHandler()}else t.onDragEnd(e)}else t.state._delayedEvent&&(t.clearTimeout(),t.startDrag(e))},t.onDragEnd=function(e){if(e.pointerId===t.state._pointerId){t.state._active=!1,t.updateSharedState({down:!1,buttons:0,touches:0});var n=t.state._isTap,r=t.state.velocities,o=r[0],i=r[1],a=t.state.movement,s=a[0],l=a[1],c=t.state._intentional,d=c[0],u=c[1],p=t.config.swipeVelocity,h=p[0],f=p[1],g=t.config.swipeDistance,x=g[0],m=g[1],v=tu({},Cu(ru(t),e),t.getMovement(t.state.values)),b=[0,0];v.elapsedTime<220&&(!1!==d&&Math.abs(o)>h&&Math.abs(s)>x&&(b[0]=Kd(o)),!1!==u&&Math.abs(i)>f&&Math.abs(l)>m&&(b[1]=Kd(i))),t.updateGestureState(tu({},v,{tap:n,swipe:b})),t.fireGestureHandler(!0===n)}},t.clean=function(){e.prototype.clean.call(ru(t)),t.state._delayedEvent=!1,function(e,t){var n=e.config,r=e.windowListeners;n.window&&(Ru(n.window,r[t],n.eventOptions),delete r[t])}(t.controller,t.stateKey)},t.onCancel=function(){t.state.canceled||(t.updateGestureState({canceled:!0}),t.state._active=!1,t.updateSharedState({down:!1,buttons:0,touches:0}),requestAnimationFrame((function(){return t.fireGestureHandler()})))},t.onClick=function(e){t.state._isTap||e.stopPropagation()},t}nu(t,e);var n=t.prototype;return n.startDrag=function(e){var t=_u(e);this.updateSharedState(Mu(e)),this.updateGestureState(tu({},function(e,t,n){var r=e.state.offset,o=n.timeStamp;return tu({},mu()[e.stateKey],{_active:!0,values:t,initial:t,offset:r,lastOffset:r,startTime:o})}(this,t,e),Cu(this,e,!0),{_pointerId:e.pointerId,cancel:this.onCancel})),this.updateGestureState(this.getMovement(t)),this.fireGestureHandler()},n.addBindings=function(e){(Eu(e,"onPointerDown",this.onDragStart),this.config.filterTaps)&&Eu(e,this.controller.config.eventOptions.capture?"onClick":"onClickCapture",this.onClick)},t}(function(e){function t(){return e.apply(this,arguments)||this}nu(t,e);var n=t.prototype;return n.getInternalMovement=function(e,t){return Xd(e,t.initial)},n.checkIntentionality=function(e,t){if(!1===e[0]&&!1===e[1])return{_intentional:e,axis:this.state.axis};var n=t.map(Math.abs),r=n[0],o=n[1],i=this.state.axis||(r>o?"x":r<o?"y":void 0);return this.config.axis||this.config.lockDirection?i?this.config.axis&&i!==this.config.axis?{_intentional:e,_blocked:!0,axis:i}:(e["x"===i?1:0]=!1,{_intentional:e,_blocked:!1,axis:i}):{_intentional:[!1,!1],_blocked:!1,axis:i}:{_intentional:e,_blocked:!1,axis:i}},n.getKinematics=function(e,t){var n=this.getMovement(e);if(!n._blocked){var r=t.timeStamp-this.state.timeStamp;Object.assign(n,function(e,t,n){var r=Yd(t),o=0===r?0:1/r,i=0===n?0:1/n,a=i*r,s=t.map((function(e){return i*e})),l=t.map((function(e){return o*e}));return{velocities:s,velocity:a,distance:Yd(e),direction:l}}(n.movement,n.delta,r))}return n},n.mapStateValues=function(e){return{xy:e.values,vxvy:e.velocities}},t}(bu));function Du(e,t){if(e===t)return!0;if(e&&t&&"object"==typeof e&&"object"==typeof t){if(e.constructor!==t.constructor)return!1;var n,r,o,i;if(Array.isArray(e)){if((n=e.length)!==t.length)return!1;for(r=n;0!=r--;)if(!Du(e[r],t[r]))return!1;return!0}if("function"==typeof Map&&e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(i=e.entries();!(r=i.next()).done;)if(!t.has(r.value[0]))return!1;for(i=e.entries();!(r=i.next()).done;)if(!Du(r.value[1],t.get(r.value[0])))return!1;return!0}if("function"==typeof Set&&e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(i=e.entries();!(r=i.next()).done;)if(!t.has(r.value[0]))return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();if((n=(o=Object.keys(e)).length)!==Object.keys(t).length)return!1;for(r=n;0!=r--;)if(!Object.prototype.hasOwnProperty.call(t,o[r]))return!1;if("undefined"!=typeof Element&&e instanceof Element)return!1;for(r=n;0!=r--;)if(!("_owner"===o[r]&&e.$$typeof||Du(e[o[r]],t[o[r]])))return!1;return!0}return e!=e&&t!=t}function Au(e,t){try{return Du(e,t)}catch(e){if((e.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw e}}function Nu(e,t){void 0===t&&(t={}),vu.set("drag",Iu);var r=n.useRef();return r.current||(r.current=function(e,t){var n,r,o=[],i=!1;return function(){for(var a=arguments.length,s=new Array(a),l=0;l<a;l++)s[l]=arguments[l];return i&&n===this&&t(s,o)||(r=e.apply(this,s),i=!0,n=this,o=s),r}}(gu,Au)),Tu({drag:e},r.current(t))}
2473
+ ***************************************************************************** */var Ms,_s,Is=function(){return Is=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Is.apply(this,arguments)};function Ds(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}function As(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Ns(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}function Vs(e,t,n){if(2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}!function(e){e.Start="xstate.start",e.Stop="xstate.stop",e.Raise="xstate.raise",e.Send="xstate.send",e.Cancel="xstate.cancel",e.NullEvent="",e.Assign="xstate.assign",e.After="xstate.after",e.DoneState="done.state",e.DoneInvoke="done.invoke",e.Log="xstate.log",e.Init="xstate.init",e.Invoke="xstate.invoke",e.ErrorExecution="error.execution",e.ErrorCommunication="error.communication",e.ErrorPlatform="error.platform",e.ErrorCustom="xstate.error",e.Update="xstate.update",e.Pure="xstate.pure",e.Choose="xstate.choose"}(Ms||(Ms={})),function(e){e.Parent="#_parent",e.Internal="#_internal"}(_s||(_s={}));var zs=Ms.Start,Bs=Ms.Stop,Hs=Ms.Raise,Fs=Ms.Send,qs=Ms.Cancel,Zs=Ms.NullEvent,Ws=Ms.Assign;Ms.After,Ms.DoneState;var Gs=Ms.Log,Us=Ms.Init,Xs=Ms.Invoke;Ms.ErrorExecution;var Ys,Ks=Ms.ErrorPlatform,Js=Ms.ErrorCustom,Qs=Ms.Update,el=Ms.Choose,tl=Ms.Pure,nl={},rl="xstate.guard",ol="production"===process.env.NODE_ENV;function il(e,t,n){void 0===n&&(n=".");var r=ll(e,n),o=ll(t,n);return kl(o)?!!kl(r)&&o===r:kl(r)?r in o:Object.keys(r).every((function(e){return e in o&&il(r[e],o[e])}))}function al(e){try{return kl(e)||"number"==typeof e?"".concat(e):e.type}catch(e){throw new Error("Events must be strings or objects with a string event.type property.")}}function sl(e,t){try{return Cl(e)?e:e.toString().split(t)}catch(t){throw new Error("'".concat(e,"' is not a valid state path."))}}function ll(e,t){return"object"==typeof(n=e)&&"value"in n&&"context"in n&&"event"in n&&"_event"in n?e.value:Cl(e)?cl(e):"string"!=typeof e?e:cl(sl(e,t));var n}function cl(e){if(1===e.length)return e[0];for(var t={},n=t,r=0;r<e.length-1;r++)r===e.length-2?n[e[r]]=e[r+1]:(n[e[r]]={},n=n[e[r]]);return t}function dl(e,t){for(var n={},r=Object.keys(e),o=0;o<r.length;o++){var i=r[o];n[i]=t(e[i],i,e,o)}return n}function ul(e,t,n){var r,o,i={};try{for(var a=As(Object.keys(e)),s=a.next();!s.done;s=a.next()){var l=s.value,c=e[l];n(c)&&(i[l]=t(c,l,e))}}catch(e){r={error:e}}finally{try{s&&!s.done&&(o=a.return)&&o.call(a)}finally{if(r)throw r.error}}return i}var pl=function(e){return function(t){var n,r,o=t;try{for(var i=As(e),a=i.next();!a.done;a=i.next()){o=o[a.value]}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return o}};function hl(e){return e?kl(e)?[[e]]:fl(Object.keys(e).map((function(t){var n=e[t];return"string"==typeof n||n&&Object.keys(n).length?hl(e[t]).map((function(e){return[t].concat(e)})):[[t]]}))):[[]]}function fl(e){var t;return(t=[]).concat.apply(t,Vs([],Ns(e),!1))}function gl(e){return Cl(e)?e:[e]}function xl(e){return void 0===e?[]:gl(e)}function ml(e,t,n){var r,o;if(jl(e))return e(t,n.data);var i={};try{for(var a=As(Object.keys(e)),s=a.next();!s.done;s=a.next()){var l=s.value,c=e[l];jl(c)?i[l]=c(t,n.data):i[l]=c}}catch(e){r={error:e}}finally{try{s&&!s.done&&(o=a.return)&&o.call(a)}finally{if(r)throw r.error}}return i}function vl(e){return e instanceof Promise||!(null===e||!jl(e)&&"object"!=typeof e||!jl(e.then))}function bl(e,t){return dl(e.states,(function(e,n){if(e){var r=(kl(t)?void 0:t[n])||(e?e.current:void 0);if(r)return{current:r,states:bl(e,r)}}}))}function yl(e,t,n,r){ol||wl(!!e,"Attempting to update undefined context");var o=e?n.reduce((function(e,n){var o,i,a=n.assignment,s={state:r,action:n,_event:t},l={};if(jl(a))l=a(e,t.data,s);else try{for(var c=As(Object.keys(a)),d=c.next();!d.done;d=c.next()){var u=d.value,p=a[u];l[u]=jl(p)?p(e,t.data,s):p}}catch(e){o={error:e}}finally{try{d&&!d.done&&(i=c.return)&&i.call(c)}finally{if(o)throw o.error}}return Object.assign({},e,l)}),e):e;return o}var wl=function(){};function Cl(e){return Array.isArray(e)}function jl(e){return"function"==typeof e}function kl(e){return"string"==typeof e}function $l(e,t){if(e)return kl(e)?{type:rl,name:e,predicate:t?t[e]:void 0}:jl(e)?{type:rl,name:e.name,predicate:e}:e}ol||(wl=function(e,t){var n=e instanceof Error?e:void 0;if((n||!e)&&void 0!==console){var r=["Warning: ".concat(t)];n&&r.push(n),console.warn.apply(console,r)}});var Sl=function(){return"function"==typeof Symbol&&Symbol.observable||"@@observable"}();function El(e){return!!e&&"__xstatenode"in e}function Ll(e,t){return kl(e)||"number"==typeof e?Is({type:e},t):e}function Rl(e,t){if(!kl(e)&&"$$type"in e&&"scxml"===e.$$type)return e;var n=Ll(e);return Is({name:n.type,data:n,$$type:"scxml",type:"external"},t)}function Tl(e,t){return gl(t).map((function(t){return void 0===t||"string"==typeof t||El(t)?{target:t,event:e}:Is(Is({},t),{event:e})}))}function Ol(e,t,n,r,o){var i=e.options.guards,a={state:o,cond:t,_event:r};if(t.type===rl)return((null==i?void 0:i[t.name])||t.predicate)(n,r.data,a);var s=null==i?void 0:i[t.type];if(!s)throw new Error("Guard '".concat(t.type,"' is not implemented on machine '").concat(e.id,"'."));return s(n,r.data,a)}function Pl(e){return"string"==typeof e?{type:e}:e}function Ml(e,t,n){var r=function(){},o="object"==typeof e,i=o?e:null;return{next:((o?e.next:e)||r).bind(i),error:((o?e.error:t)||r).bind(i),complete:((o?e.complete:n)||r).bind(i)}}function _l(e,t){return"".concat(e,":invocation[").concat(t,"]")}function Il(e){return(e.type===Hs||e.type===Fs&&e.to===_s.Internal)&&"number"!=typeof e.delay}(Ys={})[Sl]=function(){return this},Ys[Symbol.observable]=function(){return this};var Dl=Rl({type:Us});function Al(e,t){return t&&t[e]||void 0}function Nl(e,t){var n;if(kl(e)||"number"==typeof e)n=jl(r=Al(e,t))?{type:e,exec:r}:r||{type:e,exec:void 0};else if(jl(e))n={type:e.name||e.toString(),exec:e};else{var r;if(jl(r=Al(e.type,t)))n=Is(Is({},e),{exec:r});else if(r){var o=r.type||e.type;n=Is(Is(Is({},r),e),{type:o})}else n=e}return n}var Vl=function(e,t){return e?(Cl(e)?e:[e]).map((function(e){return Nl(e,t)})):[]};function zl(e){var t=Nl(e);return Is(Is({id:kl(e)?e:t.id},t),{type:t.type})}function Bl(e,t){var n="".concat(Ms.DoneState,".").concat(e),r={type:n,data:t,toString:function(){return n}};return r}function Hl(e,t){var n="".concat(Ms.DoneInvoke,".").concat(e),r={type:n,data:t,toString:function(){return n}};return r}function Fl(e,t){var n="".concat(Ms.ErrorPlatform,".").concat(e),r={type:n,data:t,toString:function(){return n}};return r}function ql(e,t,n,r,o,i,a){void 0===a&&(a=!1);var s=a?[]:function(e){var t,n,r=[];try{for(var o=As(e),i=o.next();!i.done;i=o.next())for(var a=i.value,s=0;s<a.actions.length;)a.actions[s].type!==Ws?s++:(r.push(a.actions[s]),a.actions.splice(s,1))}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return r}(o),l=s.length?yl(n,r,s,t):n,c=a?[n]:void 0,d=[];function u(o,s){var u;switch(s.type){case Hs:var p=function(e,t,n,r){var o,i={_event:n},a=Rl(jl(e.event)?e.event(t,n.data,i):e.event);if(kl(e.delay)){var s=r&&r[e.delay];o=jl(s)?s(t,n.data,i):s}else o=jl(e.delay)?e.delay(t,n.data,i):e.delay;return Is(Is({},e),{type:Hs,_event:a,delay:o})}(s,l,r,e.options.delays);return i&&"number"==typeof p.delay&&i(p,l,r),p;case Fs:var h=function(e,t,n,r){var o,i={_event:n},a=Rl(jl(e.event)?e.event(t,n.data,i):e.event);if(kl(e.delay)){var s=r&&r[e.delay];o=jl(s)?s(t,n.data,i):s}else o=jl(e.delay)?e.delay(t,n.data,i):e.delay;var l=jl(e.to)?e.to(t,n.data,i):e.to;return Is(Is({},e),{to:l,_event:a,event:a.data,delay:o})}(s,l,r,e.options.delays);if(!ol){var f=s.delay;wl(!kl(f)||"number"==typeof h.delay,"No delay reference for delay expression '".concat(f,"' was found on machine '").concat(e.id,"'"))}return i&&h.to!==_s.Internal&&("entry"===o?d.push(h):i(h,l,r)),h;case Gs:var g=function(e,t,n){return Is(Is({},e),{value:kl(e.expr)?e.expr:e.expr(t,n.data,{_event:n})})}(s,l,r);return null==i||i(g,l,r),g;case el:if(!(b=null===(u=s.conds.find((function(n){var o=$l(n.cond,e.options.guards);return!o||Ol(e,o,l,r,i?void 0:t)})))||void 0===u?void 0:u.actions))return[];var x=Ns(ql(e,t,l,r,[{type:o,actions:Vl(xl(b),e.options.actions)}],i,a),2),m=x[0],v=x[1];return l=v,null==c||c.push(l),m;case tl:var b;if(!(b=s.get(l,r.data)))return[];var y=Ns(ql(e,t,l,r,[{type:o,actions:Vl(xl(b),e.options.actions)}],i,a),2),w=y[0],C=y[1];return l=C,null==c||c.push(l),w;case Bs:g=function(e,t,n){var r=jl(e.activity)?e.activity(t,n.data):e.activity,o="string"==typeof r?{id:r}:r;return{type:Ms.Stop,activity:o}}(s,l,r);return null==i||i(g,n,r),g;case Ws:l=yl(l,r,[s],i?void 0:t),null==c||c.push(l);break;default:var j=Nl(s,e.options.actions),k=j.exec;if(i)i(j,l,r);else if(k&&c){var $=c.length-1,S=Is(Is({},j),{exec:function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];k.apply(void 0,Vs([c[$]],Ns(t),!1))}});j=S}return j}}var p=fl(o.map((function(e){var t,n,o=[];try{for(var a=As(e.actions),s=a.next();!s.done;s=a.next()){var c=s.value,p=u(e.type,c);p&&(o=o.concat(p))}}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}return d.forEach((function(e){i(e,l,r)})),d.length=0,o})));return[p,l]}var Zl=function(e,t){return t(e)};function Wl(e){var t;return(t={id:e,send:function(){},subscribe:function(){return{unsubscribe:function(){}}},getSnapshot:function(){},toJSON:function(){return{id:e}}})[Sl]=function(){return this},t}function Gl(e,t,n){var r=Wl(t);if(r.deferred=!0,El(e)){var o=r.state=Zl(void 0,(function(){return(n?e.withContext(n):e).initialState}));r.getSnapshot=function(){return o}}return r}var Ul=function(e){return"atomic"===e.type||"final"===e.type};function Xl(e){return Object.keys(e.states).map((function(t){return e.states[t]}))}function Yl(e){return Xl(e).filter((function(e){return"history"!==e.type}))}function Kl(e){var t=[e];return Ul(e)?t:t.concat(fl(Yl(e).map(Kl)))}function Jl(e,t){var n,r,o,i,a,s,l,c,d=ec(new Set(e)),u=new Set(t);try{for(var p=As(u),h=p.next();!h.done;h=p.next())for(var f=(j=h.value).parent;f&&!u.has(f);)u.add(f),f=f.parent}catch(e){n={error:e}}finally{try{h&&!h.done&&(r=p.return)&&r.call(p)}finally{if(n)throw n.error}}var g=ec(u);try{for(var x=As(u),m=x.next();!m.done;m=x.next()){if("compound"!==(j=m.value).type||g.get(j)&&g.get(j).length){if("parallel"===j.type)try{for(var v=(a=void 0,As(Yl(j))),b=v.next();!b.done;b=v.next()){var y=b.value;u.has(y)||(u.add(y),d.get(y)?d.get(y).forEach((function(e){return u.add(e)})):y.initialStateNodes.forEach((function(e){return u.add(e)})))}}catch(e){a={error:e}}finally{try{b&&!b.done&&(s=v.return)&&s.call(v)}finally{if(a)throw a.error}}}else d.get(j)?d.get(j).forEach((function(e){return u.add(e)})):j.initialStateNodes.forEach((function(e){return u.add(e)}))}}catch(e){o={error:e}}finally{try{m&&!m.done&&(i=x.return)&&i.call(x)}finally{if(o)throw o.error}}try{for(var w=As(u),C=w.next();!C.done;C=w.next()){var j;for(f=(j=C.value).parent;f&&!u.has(f);)u.add(f),f=f.parent}}catch(e){l={error:e}}finally{try{C&&!C.done&&(c=w.return)&&c.call(w)}finally{if(l)throw l.error}}return u}function Ql(e,t){var n=t.get(e);if(!n)return{};if("compound"===e.type){var r=n[0];if(!r)return{};if(Ul(r))return r.key}var o={};return n.forEach((function(e){o[e.key]=Ql(e,t)})),o}function ec(e){var t,n,r=new Map;try{for(var o=As(e),i=o.next();!i.done;i=o.next()){var a=i.value;r.has(a)||r.set(a,[]),a.parent&&(r.has(a.parent)||r.set(a.parent,[]),r.get(a.parent).push(a))}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return r}function tc(e,t){return Ql(e,ec(Jl([e],t)))}function nc(e,t){return Array.isArray(e)?e.some((function(e){return e===t})):e instanceof Set&&e.has(t)}function rc(e,t){return"compound"===t.type?Yl(t).some((function(t){return"final"===t.type&&nc(e,t)})):"parallel"===t.type&&Yl(t).every((function(t){return rc(e,t)}))}function oc(e){return new Set(fl(e.map((function(e){return e.tags}))))}function ic(e,t){if(e===t)return!0;if(void 0===e||void 0===t)return!1;if(kl(e)||kl(t))return e===t;var n=Object.keys(e),r=Object.keys(t);return n.length===r.length&&n.every((function(n){return ic(e[n],t[n])}))}var ac=function(){function e(e){var t,n,r=this;this.actions=[],this.activities=nl,this.meta={},this.events=[],this.value=e.value,this.context=e.context,this._event=e._event,this._sessionid=e._sessionid,this.event=this._event.data,this.historyValue=e.historyValue,this.history=e.history,this.actions=e.actions||[],this.activities=e.activities||nl,this.meta=(void 0===(n=e.configuration)&&(n=[]),n.reduce((function(e,t){return void 0!==t.meta&&(e[t.id]=t.meta),e}),{})),this.events=e.events||[],this.matches=this.matches.bind(this),this.toStrings=this.toStrings.bind(this),this.configuration=e.configuration,this.transitions=e.transitions,this.children=e.children,this.done=!!e.done,this.tags=null!==(t=Array.isArray(e.tags)?new Set(e.tags):e.tags)&&void 0!==t?t:new Set,this.machine=e.machine,Object.defineProperty(this,"nextEvents",{get:function(){return function(e){return Vs([],Ns(new Set(fl(Vs([],Ns(e.map((function(e){return e.ownEvents}))),!1)))),!1)}(r.configuration)}})}return e.from=function(t,n){return t instanceof e?t.context!==n?new e({value:t.value,context:n,_event:t._event,_sessionid:null,historyValue:t.historyValue,history:t.history,actions:[],activities:t.activities,events:[],configuration:[],transitions:[],children:{}}):t:new e({value:t,context:n,_event:Dl,_sessionid:null,historyValue:void 0,history:void 0,actions:[],activities:void 0,events:[],configuration:[],transitions:[],children:{}})},e.create=function(t){return new e(t)},e.inert=function(t,n){if(t instanceof e){if(!t.actions.length)return t;var r=Dl;return new e({value:t.value,context:n,_event:r,_sessionid:null,historyValue:t.historyValue,history:t.history,activities:t.activities,configuration:t.configuration,transitions:[],children:{}})}return e.from(t,n)},e.prototype.toStrings=function(e,t){var n=this;if(void 0===e&&(e=this.value),void 0===t&&(t="."),kl(e))return[e];var r=Object.keys(e);return r.concat.apply(r,Vs([],Ns(r.map((function(r){return n.toStrings(e[r],t).map((function(e){return r+t+e}))}))),!1))},e.prototype.toJSON=function(){var e=this;e.configuration,e.transitions;var t=e.tags;e.machine;var n=Ds(e,["configuration","transitions","tags","machine"]);return Is(Is({},n),{tags:Array.from(t)})},e.prototype.matches=function(e){return il(e,this.value)},e.prototype.hasTag=function(e){return this.tags.has(e)},e.prototype.can=function(e){var t;ol&&wl(!!this.machine,"state.can(...) used outside of a machine-created State object; this will always return false.");var n=null===(t=this.machine)||void 0===t?void 0:t.getTransitionData(this,e);return!!(null==n?void 0:n.transitions.length)&&n.transitions.some((function(e){return void 0!==e.target||e.actions.length}))},e}(),sc={deferEvents:!1},lc=function(){function e(e){this.processingEvent=!1,this.queue=[],this.initialized=!1,this.options=Is(Is({},sc),e)}return e.prototype.initialize=function(e){if(this.initialized=!0,e){if(!this.options.deferEvents)return void this.schedule(e);this.process(e)}this.flushEvents()},e.prototype.schedule=function(e){if(this.initialized&&!this.processingEvent){if(0!==this.queue.length)throw new Error("Event queue should be empty when it is not processing events");this.process(e),this.flushEvents()}else this.queue.push(e)},e.prototype.clear=function(){this.queue=[]},e.prototype.flushEvents=function(){for(var e=this.queue.shift();e;)this.process(e),e=this.queue.shift()},e.prototype.process=function(e){this.processingEvent=!0;try{e()}catch(e){throw this.clear(),e}finally{this.processingEvent=!1}},e}(),cc=new Map,dc=0,uc=function(){return"x:".concat(dc++)},pc=function(e,t){return cc.set(e,t),e},hc=function(e){return cc.get(e)},fc=function(e){cc.delete(e)};function gc(){return"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:void(ol||console.warn("XState could not find a global object in this environment. Please let the maintainers know and raise an issue here: https://github.com/statelyai/xstate/issues"))}function xc(e){if(gc()){var t=function(){var e=gc();if(e&&"__xstate__"in e)return e.__xstate__}();t&&t.register(e)}}function mc(e,t){void 0===t&&(t={});var n=e.initialState,r=new Set,o=[],i=!1,a=function(e){var t;return Is(((t={subscribe:function(){return{unsubscribe:function(){}}},id:"anonymous",getSnapshot:function(){}})[Sl]=function(){return this},t),e)}({id:t.id,send:function(t){o.push(t),function(){if(!i){for(i=!0;o.length>0;){var t=o.shift();n=e.transition(n,t,s),r.forEach((function(e){return e.next(n)}))}i=!1}}()},getSnapshot:function(){return n},subscribe:function(e,t,o){var i=Ml(e,t,o);return r.add(i),i.next(n),{unsubscribe:function(){r.delete(i)}}}}),s={parent:t.parent,self:a,id:t.id||"anonymous",observers:r};return n=e.start?e.start(s):n,a}var vc,bc={sync:!1,autoForward:!1};!function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"}(vc||(vc={}));var yc=function(){function e(t,n){void 0===n&&(n=e.defaultOptions);var r=this;this.machine=t,this.delayedEventsMap={},this.listeners=new Set,this.contextListeners=new Set,this.stopListeners=new Set,this.doneListeners=new Set,this.eventListeners=new Set,this.sendListeners=new Set,this.initialized=!1,this.status=vc.NotStarted,this.children=new Map,this.forwardTo=new Set,this._outgoingQueue=[],this.init=this.start,this.send=function(e,t){if(Cl(e))return r.batch(e),r.state;var n=Rl(Ll(e,t));if(r.status===vc.Stopped)return ol||wl(!1,'Event "'.concat(n.name,'" was sent to stopped service "').concat(r.machine.id,'". This service has already reached its final state, and will not transition.\nEvent: ').concat(JSON.stringify(n.data))),r.state;if(r.status!==vc.Running&&!r.options.deferEvents)throw new Error('Event "'.concat(n.name,'" was sent to uninitialized service "').concat(r.machine.id,'". Make sure .start() is called for this service, or set { deferEvents: true } in the service options.\nEvent: ').concat(JSON.stringify(n.data)));return r.scheduler.schedule((function(){r.forward(n);var e=r._nextState(n);r.update(e,n)})),r._state},this.sendTo=function(e,t,n){var o,i=r.parent&&(t===_s.Parent||r.parent.id===t),a=i?r.parent:kl(t)?t===_s.Internal?r:r.children.get(t)||hc(t):(o=t)&&"function"==typeof o.send?t:void 0;if(a)if("machine"in a){if(r.status!==vc.Stopped||r.parent!==a||r.state.done){var s=Is(Is({},e),{name:e.name===Js?"".concat(Fl(r.id)):e.name,origin:r.sessionId});!n&&r.machine.config.predictableActionArguments?r._outgoingQueue.push([a,s]):a.send(s)}}else!n&&r.machine.config.predictableActionArguments?r._outgoingQueue.push([a,e.data]):a.send(e.data);else{if(!i)throw new Error("Unable to send event to child '".concat(t,"' from service '").concat(r.id,"'."));ol||wl(!1,"Service '".concat(r.id,"' has no parent: unable to send event ").concat(e.type))}},this._exec=function(e,t,n,o){void 0===o&&(o=r.machine.options.actions);var i=e.exec||Al(e.type,o),a=jl(i)?i:i?i.exec:e.exec;if(a)try{return a(t,n.data,r.machine.config.predictableActionArguments?{action:e,_event:n}:{action:e,state:r.state,_event:n})}catch(e){throw r.parent&&r.parent.send({type:"xstate.error",data:e}),e}switch(e.type){case Hs:var s=e;r.defer(s);break;case Fs:var l=e;if("number"==typeof l.delay)return void r.defer(l);l.to?r.sendTo(l._event,l.to,n===Dl):r.send(l._event);break;case qs:r.cancel(e.sendId);break;case zs:if(r.status!==vc.Running)return;var c=e.activity;if(!r.machine.config.predictableActionArguments&&!r.state.activities[c.id||c.type])break;if(c.type===Ms.Invoke){var d=Pl(c.src),u=r.machine.options.services?r.machine.options.services[d.type]:void 0,p=c.id,h=c.data;ol||wl(!("forward"in c),"`forward` property is deprecated (found in invocation of '".concat(c.src,"' in in machine '").concat(r.machine.id,"'). ")+"Please use `autoForward` instead.");var f="autoForward"in c?c.autoForward:!!c.forward;if(!u)return void(ol||wl(!1,"No service found for invocation '".concat(c.src,"' in machine '").concat(r.machine.id,"'.")));var g=h?ml(h,t,n):void 0;if("string"==typeof u)return;var x=jl(u)?u(t,n.data,{data:g,src:d,meta:c.meta}):u;if(!x)return;var m=void 0;El(x)&&(x=g?x.withContext(g):x,m={autoForward:f}),r.spawn(x,p,m)}else r.spawnActivity(c);break;case Bs:r.stopChild(e.activity.id);break;case Gs:var v=e,b=v.label,y=v.value;b?r.logger(b,y):r.logger(y);break;default:ol||wl(!1,"No implementation found for action type '".concat(e.type,"'"))}};var o=Is(Is({},e.defaultOptions),n),i=o.clock,a=o.logger,s=o.parent,l=o.id,c=void 0!==l?l:t.id;this.id=c,this.logger=a,this.clock=i,this.parent=s,this.options=o,this.scheduler=new lc({deferEvents:this.options.deferEvents}),this.sessionId=uc()}return Object.defineProperty(e.prototype,"initialState",{get:function(){var e=this;return this._initialState?this._initialState:Zl(this,(function(){return e._initialState=e.machine.initialState,e._initialState}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"state",{get:function(){return ol||wl(this.status!==vc.NotStarted,"Attempted to read state from uninitialized service '".concat(this.id,"'. Make sure the service is started first.")),this._state},enumerable:!1,configurable:!0}),e.prototype.execute=function(e,t){var n,r;try{for(var o=As(e.actions),i=o.next();!i.done;i=o.next()){var a=i.value;this.exec(a,e,t)}}catch(e){n={error:e}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}},e.prototype.update=function(e,t){var n,r,o,i,a,s,l,c,d=this;if(e._sessionid=this.sessionId,this._state=e,this.machine.config.predictableActionArguments&&t!==Dl||!this.options.execute)for(var u=void 0;u=this._outgoingQueue.shift();)u[0].send(u[1]);else this.execute(this.state);if(this.children.forEach((function(e){d.state.children[e.id]=e})),this.devTools&&this.devTools.send(t.data,e),e.event)try{for(var p=As(this.eventListeners),h=p.next();!h.done;h=p.next()){(0,h.value)(e.event)}}catch(e){n={error:e}}finally{try{h&&!h.done&&(r=p.return)&&r.call(p)}finally{if(n)throw n.error}}try{for(var f=As(this.listeners),g=f.next();!g.done;g=f.next()){(0,g.value)(e,e.event)}}catch(e){o={error:e}}finally{try{g&&!g.done&&(i=f.return)&&i.call(f)}finally{if(o)throw o.error}}try{for(var x=As(this.contextListeners),m=x.next();!m.done;m=x.next()){(0,m.value)(this.state.context,this.state.history?this.state.history.context:void 0)}}catch(e){a={error:e}}finally{try{m&&!m.done&&(s=x.return)&&s.call(x)}finally{if(a)throw a.error}}if(this.state.done){var v=e.configuration.find((function(e){return"final"===e.type&&e.parent===d.machine})),b=v&&v.doneData?ml(v.doneData,e.context,t):void 0;this._doneEvent=Hl(this.id,b);try{for(var y=As(this.doneListeners),w=y.next();!w.done;w=y.next()){(0,w.value)(this._doneEvent)}}catch(e){l={error:e}}finally{try{w&&!w.done&&(c=y.return)&&c.call(y)}finally{if(l)throw l.error}}this._stop(),this._stopChildren(),fc(this.sessionId)}},e.prototype.onTransition=function(e){return this.listeners.add(e),this.status===vc.Running&&e(this.state,this.state.event),this},e.prototype.subscribe=function(e,t,n){var r=this,o=Ml(e,t,n);this.listeners.add(o.next),this.status!==vc.NotStarted&&o.next(this.state);var i=function(){r.doneListeners.delete(i),r.stopListeners.delete(i),o.complete()};return this.status===vc.Stopped?o.complete():(this.onDone(i),this.onStop(i)),{unsubscribe:function(){r.listeners.delete(o.next),r.doneListeners.delete(i),r.stopListeners.delete(i)}}},e.prototype.onEvent=function(e){return this.eventListeners.add(e),this},e.prototype.onSend=function(e){return this.sendListeners.add(e),this},e.prototype.onChange=function(e){return this.contextListeners.add(e),this},e.prototype.onStop=function(e){return this.stopListeners.add(e),this},e.prototype.onDone=function(e){return this.status===vc.Stopped&&this._doneEvent?e(this._doneEvent):this.doneListeners.add(e),this},e.prototype.off=function(e){return this.listeners.delete(e),this.eventListeners.delete(e),this.sendListeners.delete(e),this.stopListeners.delete(e),this.doneListeners.delete(e),this.contextListeners.delete(e),this},e.prototype.start=function(e){var t=this;if(this.status===vc.Running)return this;this.machine._init(),pc(this.sessionId,this),this.initialized=!0,this.status=vc.Running;var n=void 0===e?this.initialState:Zl(this,(function(){return"object"==typeof(n=e)&&null!==n&&"value"in n&&"_event"in n?t.machine.resolveState(e):t.machine.resolveState(ac.from(e,t.machine.context));var n}));return this.options.devTools&&this.attachDev(),this.scheduler.initialize((function(){t.update(n,Dl)})),this},e.prototype._stopChildren=function(){this.children.forEach((function(e){jl(e.stop)&&e.stop()})),this.children.clear()},e.prototype._stop=function(){var e,t,n,r,o,i,a,s,l,c;try{for(var d=As(this.listeners),u=d.next();!u.done;u=d.next()){var p=u.value;this.listeners.delete(p)}}catch(t){e={error:t}}finally{try{u&&!u.done&&(t=d.return)&&t.call(d)}finally{if(e)throw e.error}}try{for(var h=As(this.stopListeners),f=h.next();!f.done;f=h.next()){(p=f.value)(),this.stopListeners.delete(p)}}catch(e){n={error:e}}finally{try{f&&!f.done&&(r=h.return)&&r.call(h)}finally{if(n)throw n.error}}try{for(var g=As(this.contextListeners),x=g.next();!x.done;x=g.next()){p=x.value;this.contextListeners.delete(p)}}catch(e){o={error:e}}finally{try{x&&!x.done&&(i=g.return)&&i.call(g)}finally{if(o)throw o.error}}try{for(var m=As(this.doneListeners),v=m.next();!v.done;v=m.next()){p=v.value;this.doneListeners.delete(p)}}catch(e){a={error:e}}finally{try{v&&!v.done&&(s=m.return)&&s.call(m)}finally{if(a)throw a.error}}if(!this.initialized)return this;this.initialized=!1,this.status=vc.Stopped,this._initialState=void 0;try{for(var b=As(Object.keys(this.delayedEventsMap)),y=b.next();!y.done;y=b.next()){var w=y.value;this.clock.clearTimeout(this.delayedEventsMap[w])}}catch(e){l={error:e}}finally{try{y&&!y.done&&(c=b.return)&&c.call(b)}finally{if(l)throw l.error}}this.scheduler.clear(),this.scheduler=new lc({deferEvents:this.options.deferEvents})},e.prototype.stop=function(){var e=this,t=this.scheduler;return this._stop(),t.schedule((function(){var t;if(!(null===(t=e._state)||void 0===t?void 0:t.done)){var n=Rl({type:"xstate.stop"}),r=Zl(e,(function(){var t=fl(Vs([],Ns(e.state.configuration),!1).sort((function(e,t){return t.order-e.order})).map((function(t){return Vl(t.onExit,e.machine.options.actions)}))),r=Ns(ql(e.machine,e.state,e.state.context,n,[{type:"exit",actions:t}],e.machine.config.predictableActionArguments?e._exec:void 0,e.machine.config.predictableActionArguments||e.machine.config.preserveActionOrder),2),o=r[0],i=r[1],a=new ac({value:e.state.value,context:i,_event:n,_sessionid:e.sessionId,historyValue:void 0,history:e.state,actions:o.filter((function(e){return!Il(e)})),activities:{},events:[],configuration:[],transitions:[],children:{},done:e.state.done,tags:e.state.tags,machine:e.machine});return a.changed=!0,a}));e.update(r,n),e._stopChildren(),fc(e.sessionId)}})),this},e.prototype.batch=function(e){var t=this;if(this.status===vc.NotStarted&&this.options.deferEvents)ol||wl(!1,"".concat(e.length,' event(s) were sent to uninitialized service "').concat(this.machine.id,'" and are deferred. Make sure .start() is called for this service.\nEvent: ').concat(JSON.stringify(event)));else if(this.status!==vc.Running)throw new Error("".concat(e.length,' event(s) were sent to uninitialized service "').concat(this.machine.id,'". Make sure .start() is called for this service, or set { deferEvents: true } in the service options.'));if(e.length){var n=!!this.machine.config.predictableActionArguments&&this._exec;this.scheduler.schedule((function(){var r,o,i=t.state,a=!1,s=[],l=function(e){var r=Rl(e);t.forward(r),i=Zl(t,(function(){return t.machine.transition(i,r,void 0,n||void 0)})),s.push.apply(s,Vs([],Ns(t.machine.config.predictableActionArguments?i.actions:i.actions.map((function(e){return function(e,t){var n=e.exec;return Is(Is({},e),{exec:void 0!==n?function(){return n(t.context,t.event,{action:e,state:t,_event:t._event})}:void 0})}(e,i)}))),!1)),a=a||!!i.changed};try{for(var c=As(e),d=c.next();!d.done;d=c.next()){l(d.value)}}catch(e){r={error:e}}finally{try{d&&!d.done&&(o=c.return)&&o.call(c)}finally{if(r)throw r.error}}i.changed=a,i.actions=s,t.update(i,Rl(e[e.length-1]))}))}},e.prototype.sender=function(e){return this.send.bind(this,e)},e.prototype._nextState=function(e,t){var n=this;void 0===t&&(t=!!this.machine.config.predictableActionArguments&&this._exec);var r=Rl(e);if(0===r.name.indexOf(Ks)&&!this.state.nextEvents.some((function(e){return 0===e.indexOf(Ks)})))throw r.data.data;return Zl(this,(function(){return n.machine.transition(n.state,r,void 0,t||void 0)}))},e.prototype.nextState=function(e){return this._nextState(e,!1)},e.prototype.forward=function(e){var t,n;try{for(var r=As(this.forwardTo),o=r.next();!o.done;o=r.next()){var i=o.value,a=this.children.get(i);if(!a)throw new Error("Unable to forward event '".concat(e,"' from interpreter '").concat(this.id,"' to nonexistant child '").concat(i,"'."));a.send(e)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}},e.prototype.defer=function(e){var t=this,n=this.clock.setTimeout((function(){"to"in e&&e.to?t.sendTo(e._event,e.to,!0):t.send(e._event)}),e.delay);e.id&&(this.delayedEventsMap[e.id]=n)},e.prototype.cancel=function(e){this.clock.clearTimeout(this.delayedEventsMap[e]),delete this.delayedEventsMap[e]},e.prototype.exec=function(e,t,n){void 0===n&&(n=this.machine.options.actions),this._exec(e,t.context,t._event,n)},e.prototype.removeChild=function(e){var t;this.children.delete(e),this.forwardTo.delete(e),null===(t=this.state)||void 0===t||delete t.children[e]},e.prototype.stopChild=function(e){var t=this.children.get(e);t&&(this.removeChild(e),jl(t.stop)&&t.stop())},e.prototype.spawn=function(e,t,n){if(this.status!==vc.Running)return Gl(e,t);if(vl(e))return this.spawnPromise(Promise.resolve(e),t);if(jl(e))return this.spawnCallback(e,t);if(function(e){try{return"function"==typeof e.send}catch(e){return!1}}(o=e)&&"id"in o)return this.spawnActor(e,t);if(function(e){try{return"subscribe"in e&&jl(e.subscribe)}catch(e){return!1}}(e))return this.spawnObservable(e,t);if(El(e))return this.spawnMachine(e,Is(Is({},n),{id:t}));if(null!==(r=e)&&"object"==typeof r&&"transition"in r&&"function"==typeof r.transition)return this.spawnBehavior(e,t);throw new Error('Unable to spawn entity "'.concat(t,'" of type "').concat(typeof e,'".'));var r,o},e.prototype.spawnMachine=function(t,n){var r=this;void 0===n&&(n={});var o=new e(t,Is(Is({},this.options),{parent:this,id:n.id||t.id})),i=Is(Is({},bc),n);i.sync&&o.onTransition((function(e){r.send(Qs,{state:e,id:o.id})}));var a=o;return this.children.set(o.id,a),i.autoForward&&this.forwardTo.add(o.id),o.onDone((function(e){r.removeChild(o.id),r.send(Rl(e,{origin:o.id}))})).start(),a},e.prototype.spawnBehavior=function(e,t){var n=mc(e,{id:t,parent:this});return this.children.set(t,n),n},e.prototype.spawnPromise=function(e,t){var n,r,o=this,i=!1;e.then((function(e){i||(r=e,o.removeChild(t),o.send(Rl(Hl(t,e),{origin:t})))}),(function(e){if(!i){o.removeChild(t);var n=Fl(t,e);try{o.send(Rl(n,{origin:t}))}catch(r){!function(e,t,n){if(!ol){var r=e.stack?" Stacktrace was '".concat(e.stack,"'"):"";if(e===t)console.error("Missing onError handler for invocation '".concat(n,"', error was '").concat(e,"'.").concat(r));else{var o=t.stack?" Stacktrace was '".concat(t.stack,"'"):"";console.error("Missing onError handler and/or unhandled exception/promise rejection for invocation '".concat(n,"'. ")+"Original error: '".concat(e,"'. ").concat(r," Current error is '").concat(t,"'.").concat(o))}}}(e,r,t),o.devTools&&o.devTools.send(n,o.state),o.machine.strict&&o.stop()}}}));var a=((n={id:t,send:function(){},subscribe:function(t,n,r){var o=Ml(t,n,r),i=!1;return e.then((function(e){i||(o.next(e),i||o.complete())}),(function(e){i||o.error(e)})),{unsubscribe:function(){return i=!0}}},stop:function(){i=!0},toJSON:function(){return{id:t}},getSnapshot:function(){return r}})[Sl]=function(){return this},n);return this.children.set(t,a),a},e.prototype.spawnCallback=function(e,t){var n,r,o,i=this,a=!1,s=new Set,l=new Set;try{o=e((function(e){r=e,l.forEach((function(t){return t(e)})),a||i.send(Rl(e,{origin:t}))}),(function(e){s.add(e)}))}catch(e){this.send(Fl(t,e))}if(vl(o))return this.spawnPromise(o,t);var c=((n={id:t,send:function(e){return s.forEach((function(t){return t(e)}))},subscribe:function(e){var t=Ml(e);return l.add(t.next),{unsubscribe:function(){l.delete(t.next)}}},stop:function(){a=!0,jl(o)&&o()},toJSON:function(){return{id:t}},getSnapshot:function(){return r}})[Sl]=function(){return this},n);return this.children.set(t,c),c},e.prototype.spawnObservable=function(e,t){var n,r,o=this,i=e.subscribe((function(e){r=e,o.send(Rl(e,{origin:t}))}),(function(e){o.removeChild(t),o.send(Rl(Fl(t,e),{origin:t}))}),(function(){o.removeChild(t),o.send(Rl(Hl(t),{origin:t}))})),a=((n={id:t,send:function(){},subscribe:function(t,n,r){return e.subscribe(t,n,r)},stop:function(){return i.unsubscribe()},getSnapshot:function(){return r},toJSON:function(){return{id:t}}})[Sl]=function(){return this},n);return this.children.set(t,a),a},e.prototype.spawnActor=function(e,t){return this.children.set(t,e),e},e.prototype.spawnActivity=function(e){var t=this.machine.options&&this.machine.options.activities?this.machine.options.activities[e.type]:void 0;if(t){var n=t(this.state.context,e);this.spawnEffect(e.id,n)}else ol||wl(!1,"No implementation found for activity '".concat(e.type,"'"))},e.prototype.spawnEffect=function(e,t){var n;this.children.set(e,((n={id:e,send:function(){},subscribe:function(){return{unsubscribe:function(){}}},stop:t||void 0,getSnapshot:function(){},toJSON:function(){return{id:e}}})[Sl]=function(){return this},n))},e.prototype.attachDev=function(){var e=gc();if(this.options.devTools&&e){if(e.__REDUX_DEVTOOLS_EXTENSION__){var t="object"==typeof this.options.devTools?this.options.devTools:void 0;this.devTools=e.__REDUX_DEVTOOLS_EXTENSION__.connect(Is(Is({name:this.id,autoPause:!0,stateSanitizer:function(e){return{value:e.value,context:e.context,actions:e.actions}}},t),{features:Is({jump:!1,skip:!1},t?t.features:void 0)}),this.machine),this.devTools.init(this.state)}xc(this)}},e.prototype.toJSON=function(){return{id:this.id}},e.prototype[Sl]=function(){return this},e.prototype.getSnapshot=function(){return this.status===vc.NotStarted?this.initialState:this._state},e.defaultOptions={execute:!0,deferEvents:!0,clock:{setTimeout:function(e,t){return setTimeout(e,t)},clearTimeout:function(e){return clearTimeout(e)}},logger:console.log.bind(console),devTools:!1},e.interpret=wc,e}();function wc(e,t){return new yc(e,t)}function Cc(e){if("string"==typeof e){var t={type:e,toString:function(){return e}};return t}return e}function jc(e){return Is(Is({type:Xs},e),{toJSON:function(){e.onDone,e.onError;var t=Ds(e,["onDone","onError"]);return Is(Is({},t),{type:Xs,src:Cc(e.src)})}})}var kc="",$c="*",Sc={},Ec=function(e){return"#"===e[0]},Lc=function(){function e(t,n,r,o){void 0===r&&(r="context"in t?t.context:void 0);var i,a=this;this.config=t,this._context=r,this.order=-1,this.__xstatenode=!0,this.__cache={events:void 0,relativeValue:new Map,initialStateValue:void 0,initialState:void 0,on:void 0,transitions:void 0,candidates:{},delayedTransitions:void 0},this.idMap={},this.tags=[],this.options=Object.assign({actions:{},guards:{},services:{},activities:{},delays:{}},n),this.parent=null==o?void 0:o.parent,this.key=this.config.key||(null==o?void 0:o.key)||this.config.id||"(machine)",this.machine=this.parent?this.parent.machine:this,this.path=this.parent?this.parent.path.concat(this.key):[],this.delimiter=this.config.delimiter||(this.parent?this.parent.delimiter:"."),this.id=this.config.id||Vs([this.machine.key],Ns(this.path),!1).join(this.delimiter),this.version=this.parent?this.parent.version:this.config.version,this.type=this.config.type||(this.config.parallel?"parallel":this.config.states&&Object.keys(this.config.states).length?"compound":this.config.history?"history":"atomic"),this.schema=this.parent?this.machine.schema:null!==(i=this.config.schema)&&void 0!==i?i:{},this.description=this.config.description,ol||wl(!("parallel"in this.config),'The "parallel" property is deprecated and will be removed in version 4.1. '.concat(this.config.parallel?"Replace with `type: 'parallel'`":"Use `type: '".concat(this.type,"'`")," in the config for state node '").concat(this.id,"' instead.")),this.initial=this.config.initial,this.states=this.config.states?dl(this.config.states,(function(t,n){var r,o=new e(t,{},void 0,{parent:a,key:n});return Object.assign(a.idMap,Is(((r={})[o.id]=o,r),o.idMap)),o})):Sc;var s=0;!function e(t){var n,r;t.order=s++;try{for(var o=As(Xl(t)),i=o.next();!i.done;i=o.next()){e(i.value)}}catch(e){n={error:e}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}}(this),this.history=!0===this.config.history?"shallow":this.config.history||!1,this._transient=!!this.config.always||!!this.config.on&&(Array.isArray(this.config.on)?this.config.on.some((function(e){return e.event===kc})):kc in this.config.on),this.strict=!!this.config.strict,this.onEntry=xl(this.config.entry||this.config.onEntry).map((function(e){return Nl(e)})),this.onExit=xl(this.config.exit||this.config.onExit).map((function(e){return Nl(e)})),this.meta=this.config.meta,this.doneData="final"===this.type?this.config.data:void 0,this.invoke=xl(this.config.invoke).map((function(e,t){var n,r;if(El(e)){var o=_l(a.id,t);return a.machine.options.services=Is(((n={})[o]=e,n),a.machine.options.services),jc({src:o,id:o})}if(kl(e.src)){o=e.id||_l(a.id,t);return jc(Is(Is({},e),{id:o,src:e.src}))}if(El(e.src)||jl(e.src)){o=e.id||_l(a.id,t);return a.machine.options.services=Is(((r={})[o]=e.src,r),a.machine.options.services),jc(Is(Is({id:o},e),{src:o}))}var i=e.src;return jc(Is(Is({id:_l(a.id,t)},e),{src:i}))})),this.activities=xl(this.config.activities).concat(this.invoke).map((function(e){return zl(e)})),this.transition=this.transition.bind(this),this.tags=xl(this.config.tags)}return e.prototype._init=function(){this.__cache.transitions||Kl(this).forEach((function(e){return e.on}))},e.prototype.withConfig=function(t,n){var r=this.options,o=r.actions,i=r.activities,a=r.guards,s=r.services,l=r.delays;return new e(this.config,{actions:Is(Is({},o),t.actions),activities:Is(Is({},i),t.activities),guards:Is(Is({},a),t.guards),services:Is(Is({},s),t.services),delays:Is(Is({},l),t.delays)},null!=n?n:this.context)},e.prototype.withContext=function(t){return new e(this.config,this.options,t)},Object.defineProperty(e.prototype,"context",{get:function(){return jl(this._context)?this._context():this._context},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"definition",{get:function(){return{id:this.id,key:this.key,version:this.version,context:this.context,type:this.type,initial:this.initial,history:this.history,states:dl(this.states,(function(e){return e.definition})),on:this.on,transitions:this.transitions,entry:this.onEntry,exit:this.onExit,activities:this.activities||[],meta:this.meta,order:this.order||-1,data:this.doneData,invoke:this.invoke,description:this.description,tags:this.tags}},enumerable:!1,configurable:!0}),e.prototype.toJSON=function(){return this.definition},Object.defineProperty(e.prototype,"on",{get:function(){if(this.__cache.on)return this.__cache.on;var e=this.transitions;return this.__cache.on=e.reduce((function(e,t){return e[t.eventType]=e[t.eventType]||[],e[t.eventType].push(t),e}),{})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"after",{get:function(){return this.__cache.delayedTransitions||(this.__cache.delayedTransitions=this.getDelayedTransitions(),this.__cache.delayedTransitions)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"transitions",{get:function(){return this.__cache.transitions||(this.__cache.transitions=this.formatTransitions(),this.__cache.transitions)},enumerable:!1,configurable:!0}),e.prototype.getCandidates=function(e){if(this.__cache.candidates[e])return this.__cache.candidates[e];var t=e===kc,n=this.transitions.filter((function(n){var r=n.eventType===e;return t?r:r||n.eventType===$c}));return this.__cache.candidates[e]=n,n},e.prototype.getDelayedTransitions=function(){var e=this,t=this.config.after;if(!t)return[];var n=function(t,n){var r=function(e,t){var n=t?"#".concat(t):"";return"".concat(Ms.After,"(").concat(e,")").concat(n)}(jl(t)?"".concat(e.id,":delay[").concat(n,"]"):t,e.id);return e.onEntry.push(function(e,t){return{to:t?t.to:void 0,type:Fs,event:jl(e)?e:Ll(e),delay:t?t.delay:void 0,id:t&&void 0!==t.id?t.id:jl(e)?e.name:al(e)}}(r,{delay:t})),e.onExit.push({type:qs,sendId:r}),r},r=Cl(t)?t.map((function(e,t){var r=n(e.delay,t);return Is(Is({},e),{event:r})})):fl(Object.keys(t).map((function(e,r){var o=t[e],i=kl(o)?{target:o}:o,a=isNaN(+e)?e:+e,s=n(a,r);return xl(i).map((function(e){return Is(Is({},e),{event:s,delay:a})}))})));return r.map((function(t){var n=t.delay;return Is(Is({},e.formatTransition(t)),{delay:n})}))},e.prototype.getStateNodes=function(e){var t,n=this;if(!e)return[];var r=e instanceof ac?e.value:ll(e,this.delimiter);if(kl(r)){var o=this.getStateNode(r).initial;return void 0!==o?this.getStateNodes(((t={})[r]=o,t)):[this,this.states[r]]}var i=Object.keys(r),a=[this];return a.push.apply(a,Vs([],Ns(fl(i.map((function(e){return n.getStateNode(e).getStateNodes(r[e])})))),!1)),a},e.prototype.handles=function(e){var t=al(e);return this.events.includes(t)},e.prototype.resolveState=function(e){var t=e instanceof ac?e:ac.create(e),n=Array.from(Jl([],this.getStateNodes(t.value)));return new ac(Is(Is({},t),{value:this.resolve(t.value),configuration:n,done:rc(n,this),tags:oc(n),machine:this.machine}))},e.prototype.transitionLeafNode=function(e,t,n){var r=this.getStateNode(e).next(t,n);return r&&r.transitions.length?r:this.next(t,n)},e.prototype.transitionCompoundNode=function(e,t,n){var r=Object.keys(e),o=this.getStateNode(r[0])._transition(e[r[0]],t,n);return o&&o.transitions.length?o:this.next(t,n)},e.prototype.transitionParallelNode=function(e,t,n){var r,o,i={};try{for(var a=As(Object.keys(e)),s=a.next();!s.done;s=a.next()){var l=s.value,c=e[l];if(c){var d=this.getStateNode(l)._transition(c,t,n);d&&(i[l]=d)}}}catch(e){r={error:e}}finally{try{s&&!s.done&&(o=a.return)&&o.call(a)}finally{if(r)throw r.error}}var u=Object.keys(i).map((function(e){return i[e]})),p=fl(u.map((function(e){return e.transitions})));if(!u.some((function(e){return e.transitions.length>0})))return this.next(t,n);var h=fl(Object.keys(i).map((function(e){return i[e].configuration})));return{transitions:p,exitSet:fl(u.map((function(e){return e.exitSet}))),configuration:h,source:t,actions:fl(Object.keys(i).map((function(e){return i[e].actions})))}},e.prototype._transition=function(e,t,n){return kl(e)?this.transitionLeafNode(e,t,n):1===Object.keys(e).length?this.transitionCompoundNode(e,t,n):this.transitionParallelNode(e,t,n)},e.prototype.getTransitionData=function(e,t){return this._transition(e.value,e,Rl(t))},e.prototype.next=function(e,t){var n,r,o,i=this,a=t.name,s=[],l=[];try{for(var c=As(this.getCandidates(a)),d=c.next();!d.done;d=c.next()){var u=d.value,p=u.cond,h=u.in,f=e.context,g=!h||(kl(h)&&Ec(h)?e.matches(ll(this.getStateNodeById(h).path,this.delimiter)):il(ll(h,this.delimiter),pl(this.path.slice(0,-2))(e.value))),x=!1;try{x=!p||Ol(this.machine,p,f,t,e)}catch(e){throw new Error("Unable to evaluate guard '".concat(p.name||p.type,"' in transition for event '").concat(a,"' in state node '").concat(this.id,"':\n").concat(e.message))}if(x&&g){void 0!==u.target&&(l=u.target),s.push.apply(s,Vs([],Ns(u.actions),!1)),o=u;break}}}catch(e){n={error:e}}finally{try{d&&!d.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}if(o){if(!l.length)return{transitions:[o],exitSet:[],configuration:e.value?[this]:[],source:e,actions:s};var m=fl(l.map((function(t){return i.getRelativeStateNodes(t,e.historyValue)})));return{transitions:[o],exitSet:!!o.internal?[]:fl(l.map((function(e){return i.getPotentiallyReenteringNodes(e)}))),configuration:m,source:e,actions:s}}},e.prototype.getPotentiallyReenteringNodes=function(e){if(this.order<e.order)return[this];for(var t=[],n=this,r=e;n&&n!==r;)t.push(n),n=n.parent;return n!==r?[]:(t.push(r),t)},e.prototype.getActions=function(e,t,n,r,o,i,a){var s,l,c,d,u=this,p=i?Jl([],this.getStateNodes(i.value)):[],h=new Set;try{for(var f=As(Array.from(e).sort((function(e,t){return e.order-t.order}))),g=f.next();!g.done;g=f.next()){(!nc(p,v=g.value)||nc(n.exitSet,v)||v.parent&&h.has(v.parent))&&h.add(v)}}catch(e){s={error:e}}finally{try{g&&!g.done&&(l=f.return)&&l.call(f)}finally{if(s)throw s.error}}try{for(var x=As(p),m=x.next();!m.done;m=x.next()){var v;nc(e,v=m.value)&&!nc(n.exitSet,v.parent)||n.exitSet.push(v)}}catch(e){c={error:e}}finally{try{m&&!m.done&&(d=x.return)&&d.call(x)}finally{if(c)throw c.error}}n.exitSet.sort((function(e,t){return t.order-e.order}));var b=Array.from(h).sort((function(e,t){return e.order-t.order})),y=new Set(n.exitSet),w=fl(b.map((function(e){var t=[];if("final"!==e.type)return t;var i=e.parent;if(!i.parent)return t;t.push(Bl(e.id,e.doneData),Bl(i.id,e.doneData?ml(e.doneData,r,o):void 0));var a=i.parent;return"parallel"===a.type&&Yl(a).every((function(e){return rc(n.configuration,e)}))&&t.push(Bl(a.id)),t}))),C=b.map((function(e){var t=e.onEntry,n=e.activities.map((function(e){return function(e){var t=zl(e);return{type:Ms.Start,activity:t,exec:void 0}}(e)}));return{type:"entry",actions:Vl(a?Vs(Vs([],Ns(t),!1),Ns(n),!1):Vs(Vs([],Ns(n),!1),Ns(t),!1),u.machine.options.actions)}})).concat({type:"state_done",actions:w.map((function(e){return function(e,t){return{type:Hs,event:"function"==typeof e?e:Ll(e),delay:t?t.delay:void 0,id:null==t?void 0:t.id}}(e)}))}),j=Array.from(y).map((function(e){return{type:"exit",actions:Vl(Vs(Vs([],Ns(e.onExit),!1),Ns(e.activities.map((function(e){return function(e){var t=jl(e)?e:zl(e);return{type:Ms.Stop,activity:t,exec:void 0}}(e)}))),!1),u.machine.options.actions)}})).concat({type:"transition",actions:Vl(n.actions,this.machine.options.actions)}).concat(C);if(t){var k=Vl(fl(Vs([],Ns(e),!1).sort((function(e,t){return t.order-e.order})).map((function(e){return e.onExit}))),this.machine.options.actions).filter((function(e){return!Il(e)}));return j.concat({type:"stop",actions:k})}return j},e.prototype.transition=function(e,t,n,r){void 0===e&&(e=this.initialState);var o,i,a=Rl(t);if(e instanceof ac)o=void 0===n?e:this.resolveState(ac.from(e,n));else{var s=kl(e)?this.resolve(cl(this.getResolvedPath(e))):this.resolve(e),l=null!=n?n:this.machine.context;o=this.resolveState(ac.from(s,l))}if(!ol&&a.name===$c)throw new Error("An event cannot have the wildcard type ('".concat($c,"')"));if(this.strict&&!this.events.includes(a.name)&&(i=a.name,!/^(done|error)\./.test(i)))throw new Error("Machine '".concat(this.id,"' does not accept event '").concat(a.name,"'"));var c=this._transition(o.value,o,a)||{transitions:[],configuration:[],exitSet:[],source:o,actions:[]},d=Jl([],this.getStateNodes(o.value)),u=c.configuration.length?Jl(d,c.configuration):d;return c.configuration=Vs([],Ns(u),!1),this.resolveTransition(c,o,o.context,r,a)},e.prototype.resolveRaisedTransition=function(e,t,n,r){var o,i=e.actions;return(e=this.transition(e,t,void 0,r))._event=n,e.event=n.data,(o=e.actions).unshift.apply(o,Vs([],Ns(i),!1)),e},e.prototype.resolveTransition=function(e,t,n,r,o){var i,a,s,l,c=this;void 0===o&&(o=Dl);var d=e.configuration,u=!t||e.transitions.length>0,p=u?e.configuration:t?t.configuration:[],h=rc(p,this),f=u?tc(this.machine,d):void 0,g=t?t.historyValue?t.historyValue:e.source?this.machine.historyValue(t.value):void 0:void 0,x=this.getActions(new Set(p),h,e,n,o,t,r),m=t?Is({},t.activities):{};try{for(var v=As(x),b=v.next();!b.done;b=v.next()){var y=b.value;try{for(var w=(s=void 0,As(y.actions)),C=w.next();!C.done;C=w.next()){var j=C.value;j.type===zs?m[j.activity.id||j.activity.type]=j:j.type===Bs&&(m[j.activity.id||j.activity.type]=!1)}}catch(e){s={error:e}}finally{try{C&&!C.done&&(l=w.return)&&l.call(w)}finally{if(s)throw s.error}}}}catch(e){i={error:e}}finally{try{b&&!b.done&&(a=v.return)&&a.call(v)}finally{if(i)throw i.error}}var k,$,S=Ns(ql(this,t,n,o,x,r,this.machine.config.predictableActionArguments||this.machine.config.preserveActionOrder),2),E=S[0],L=S[1],R=Ns(function(e,t){var n,r,o=Ns([[],[]],2),i=o[0],a=o[1];try{for(var s=As(e),l=s.next();!l.done;l=s.next()){var c=l.value;t(c)?i.push(c):a.push(c)}}catch(e){n={error:e}}finally{try{l&&!l.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return[i,a]}(E,Il),2),T=R[0],O=R[1],P=E.filter((function(e){var t;return e.type===zs&&(null===(t=e.activity)||void 0===t?void 0:t.type)===Xs})),M=P.reduce((function(e,t){return e[t.activity.id]=function(e,t,n,r){var o,i=Pl(e.src),a=null===(o=null==t?void 0:t.options.services)||void 0===o?void 0:o[i.type],s=e.data?ml(e.data,n,r):void 0,l=a?Gl(a,e.id,s):Wl(e.id);return l.meta=e,l}(t.activity,c.machine,L,o),e}),t?Is({},t.children):{}),_=new ac({value:f||t.value,context:L,_event:o,_sessionid:t?t._sessionid:null,historyValue:f?g?(k=g,$=f,{current:$,states:bl(k,$)}):void 0:t?t.historyValue:void 0,history:!f||e.source?t:void 0,actions:f?O:[],activities:f?m:t?t.activities:{},events:[],configuration:p,transitions:e.transitions,children:M,done:h,tags:oc(p),machine:this}),I=n!==L;_.changed=o.name===Qs||I;var D=_.history;D&&delete D.history;var A=!h&&(this._transient||d.some((function(e){return e._transient})));if(!(u||A&&o.name!==kc))return _;var N=_;if(!h)for(A&&(N=this.resolveRaisedTransition(N,{type:Zs},o,r));T.length;){var V=T.shift();N=this.resolveRaisedTransition(N,V._event,o,r)}var z=N.changed||(D?!!N.actions.length||I||typeof D.value!=typeof N.value||!ic(N.value,D.value):void 0);return N.changed=z,N.history=D,N},e.prototype.getStateNode=function(e){if(Ec(e))return this.machine.getStateNodeById(e);if(!this.states)throw new Error("Unable to retrieve child state '".concat(e,"' from '").concat(this.id,"'; no child states exist."));var t=this.states[e];if(!t)throw new Error("Child state '".concat(e,"' does not exist on '").concat(this.id,"'"));return t},e.prototype.getStateNodeById=function(e){var t=Ec(e)?e.slice(1):e;if(t===this.id)return this;var n=this.machine.idMap[t];if(!n)throw new Error("Child state node '#".concat(t,"' does not exist on machine '").concat(this.id,"'"));return n},e.prototype.getStateNodeByPath=function(e){if("string"==typeof e&&Ec(e))try{return this.getStateNodeById(e.slice(1))}catch(e){}for(var t=sl(e,this.delimiter).slice(),n=this;t.length;){var r=t.shift();if(!r.length)break;n=n.getStateNode(r)}return n},e.prototype.resolve=function(e){var t,n=this;if(!e)return this.initialStateValue||Sc;switch(this.type){case"parallel":return dl(this.initialStateValue,(function(t,r){return t?n.getStateNode(r).resolve(e[r]||t):Sc}));case"compound":if(kl(e)){var r=this.getStateNode(e);return"parallel"===r.type||"compound"===r.type?((t={})[e]=r.initialStateValue,t):e}return Object.keys(e).length?dl(e,(function(e,t){return e?n.getStateNode(t).resolve(e):Sc})):this.initialStateValue||{};default:return e||Sc}},e.prototype.getResolvedPath=function(e){if(Ec(e)){var t=this.machine.idMap[e.slice(1)];if(!t)throw new Error("Unable to find state node '".concat(e,"'"));return t.path}return sl(e,this.delimiter)},Object.defineProperty(e.prototype,"initialStateValue",{get:function(){var e,t;if(this.__cache.initialStateValue)return this.__cache.initialStateValue;if("parallel"===this.type)t=ul(this.states,(function(e){return e.initialStateValue||Sc}),(function(e){return!("history"===e.type)}));else if(void 0!==this.initial){if(!this.states[this.initial])throw new Error("Initial state '".concat(this.initial,"' not found on '").concat(this.key,"'"));t=Ul(this.states[this.initial])?this.initial:((e={})[this.initial]=this.states[this.initial].initialStateValue,e)}else t={};return this.__cache.initialStateValue=t,this.__cache.initialStateValue},enumerable:!1,configurable:!0}),e.prototype.getInitialState=function(e,t){this._init();var n=this.getStateNodes(e);return this.resolveTransition({configuration:n,exitSet:[],transitions:[],source:void 0,actions:[]},void 0,null!=t?t:this.machine.context,void 0)},Object.defineProperty(e.prototype,"initialState",{get:function(){var e=this.initialStateValue;if(!e)throw new Error("Cannot retrieve initial state from simple state '".concat(this.id,"'."));return this.getInitialState(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"target",{get:function(){var e;if("history"===this.type){var t=this.config;e=kl(t.target)&&Ec(t.target)?cl(this.machine.getStateNodeById(t.target).path.slice(this.path.length-1)):t.target}return e},enumerable:!1,configurable:!0}),e.prototype.getRelativeStateNodes=function(e,t,n){return void 0===n&&(n=!0),n?"history"===e.type?e.resolveHistory(t):e.initialStateNodes:[e]},Object.defineProperty(e.prototype,"initialStateNodes",{get:function(){var e=this;return Ul(this)?[this]:"compound"!==this.type||this.initial?fl(hl(this.initialStateValue).map((function(t){return e.getFromRelativePath(t)}))):(ol||wl(!1,"Compound state node '".concat(this.id,"' has no initial state.")),[this])},enumerable:!1,configurable:!0}),e.prototype.getFromRelativePath=function(e){if(!e.length)return[this];var t=Ns(e),n=t[0],r=t.slice(1);if(!this.states)throw new Error("Cannot retrieve subPath '".concat(n,"' from node with no states"));var o=this.getStateNode(n);if("history"===o.type)return o.resolveHistory();if(!this.states[n])throw new Error("Child state '".concat(n,"' does not exist on '").concat(this.id,"'"));return this.states[n].getFromRelativePath(r)},e.prototype.historyValue=function(e){if(Object.keys(this.states).length)return{current:e||this.initialStateValue,states:ul(this.states,(function(t,n){if(!e)return t.historyValue();var r=kl(e)?void 0:e[n];return t.historyValue(r||t.initialStateValue)}),(function(e){return!e.history}))}},e.prototype.resolveHistory=function(e){var t=this;if("history"!==this.type)return[this];var n=this.parent;if(!e){var r=this.target;return r?fl(hl(r).map((function(e){return n.getFromRelativePath(e)}))):n.initialStateNodes}var o,i,a=(o=n.path,i="states",function(e){var t,n,r=e;try{for(var a=As(o),s=a.next();!s.done;s=a.next()){var l=s.value;r=r[i][l]}}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}return r})(e).current;return kl(a)?[n.getStateNode(a)]:fl(hl(a).map((function(e){return"deep"===t.history?n.getFromRelativePath(e):[n.states[e[0]]]})))},Object.defineProperty(e.prototype,"stateIds",{get:function(){var e=this,t=fl(Object.keys(this.states).map((function(t){return e.states[t].stateIds})));return[this.id].concat(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"events",{get:function(){var e,t,n,r;if(this.__cache.events)return this.__cache.events;var o=this.states,i=new Set(this.ownEvents);if(o)try{for(var a=As(Object.keys(o)),s=a.next();!s.done;s=a.next()){var l=o[s.value];if(l.states)try{for(var c=(n=void 0,As(l.events)),d=c.next();!d.done;d=c.next()){var u=d.value;i.add("".concat(u))}}catch(e){n={error:e}}finally{try{d&&!d.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}}}catch(t){e={error:t}}finally{try{s&&!s.done&&(t=a.return)&&t.call(a)}finally{if(e)throw e.error}}return this.__cache.events=Array.from(i)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ownEvents",{get:function(){var e=new Set(this.transitions.filter((function(e){return!(!e.target&&!e.actions.length&&e.internal)})).map((function(e){return e.eventType})));return Array.from(e)},enumerable:!1,configurable:!0}),e.prototype.resolveTarget=function(e){var t=this;if(void 0!==e)return e.map((function(e){if(!kl(e))return e;var n=e[0]===t.delimiter;if(n&&!t.parent)return t.getStateNodeByPath(e.slice(1));var r=n?t.key+e:e;if(!t.parent)return t.getStateNodeByPath(r);try{return t.parent.getStateNodeByPath(r)}catch(e){throw new Error("Invalid transition definition for state node '".concat(t.id,"':\n").concat(e.message))}}))},e.prototype.formatTransition=function(e){var t=this,n=function(e){if(void 0!==e&&""!==e)return xl(e)}(e.target),r="internal"in e?e.internal:!n||n.some((function(e){return kl(e)&&e[0]===t.delimiter})),o=this.machine.options.guards,i=this.resolveTarget(n),a=Is(Is({},e),{actions:Vl(xl(e.actions)),cond:$l(e.cond,o),target:i,source:this,internal:r,eventType:e.event,toJSON:function(){return Is(Is({},a),{target:a.target?a.target.map((function(e){return"#".concat(e.id)})):void 0,source:"#".concat(t.id)})}});return a},e.prototype.formatTransitions=function(){var e,t,n,r=this;if(this.config.on)if(Array.isArray(this.config.on))n=this.config.on;else{var o=this.config.on,i=$c,a=o[i],s=void 0===a?[]:a,l=Ds(o,["*"]);n=fl(Object.keys(l).map((function(e){ol||e!==kc||wl(!1,"Empty string transition configs (e.g., `{ on: { '': ... }}`) for transient transitions are deprecated. Specify the transition in the `{ always: ... }` property instead. "+'Please check the `on` configuration for "#'.concat(r.id,'".'));var t=Tl(e,l[e]);return ol||function(e,t,n){var r=n.slice(0,-1).some((function(e){return!("cond"in e)&&!("in"in e)&&(kl(e.target)||El(e.target))})),o=t===kc?"the transient event":"event '".concat(t,"'");wl(!r,"One or more transitions for ".concat(o," on state '").concat(e.id,"' are unreachable. ")+"Make sure that the default transition is the last one defined.")}(r,e,t),t})).concat(Tl($c,s)))}else n=[];var c=this.config.always?Tl("",this.config.always):[],d=this.config.onDone?Tl(String(Bl(this.id)),this.config.onDone):[];ol||wl(!(this.config.onDone&&!this.parent),'Root nodes cannot have an ".onDone" transition. Please check the config of "'.concat(this.id,'".'));var u=fl(this.invoke.map((function(e){var t=[];return e.onDone&&t.push.apply(t,Vs([],Ns(Tl(String(Hl(e.id)),e.onDone)),!1)),e.onError&&t.push.apply(t,Vs([],Ns(Tl(String(Fl(e.id)),e.onError)),!1)),t}))),p=this.after,h=fl(Vs(Vs(Vs(Vs([],Ns(d),!1),Ns(u),!1),Ns(n),!1),Ns(c),!1).map((function(e){return xl(e).map((function(e){return r.formatTransition(e)}))})));try{for(var f=As(p),g=f.next();!g.done;g=f.next()){var x=g.value;h.push(x)}}catch(t){e={error:t}}finally{try{g&&!g.done&&(t=f.return)&&t.call(f)}finally{if(e)throw e.error}}return h},e}();var Rc,Tc=function(e){return{type:Ws,assignment:e}};!function(e){e[e.Effect=1]="Effect",e[e.LayoutEffect=2]="LayoutEffect"}(Rc||(Rc={}));var Oc="undefined"!=typeof document?n.useLayoutEffect:function(){};function Pc(e){var t=l.useRef();return t.current||(t.current={v:e()}),t.current.v}var Mc=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},_c=function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};var Ic=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},Dc=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))};function Ac(e,t){(0,e.exec)(t.context,t._event.data,{action:e,state:t,_event:t._event})()}function Nc(e){var t=n.useRef([]),r=n.useRef([]);Oc((function(){var n=e.subscribe((function(e){var n,o;if(e.actions.length){var i=e.actions.filter((function(e){return"function"==typeof e.exec&&"__effect"in e.exec})),a=Ic(function(e,t){var n,r,o=Mc([[],[]],2),i=o[0],a=o[1];try{for(var s=_c(e),l=s.next();!l.done;l=s.next()){var c=l.value;t(c)?i.push(c):a.push(c)}}catch(e){n={error:e}}finally{try{l&&!l.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return[i,a]}(i,(function(e){return e.exec.__effect===Rc.Effect})),2),s=a[0],l=a[1];(n=t.current).push.apply(n,Dc([],Ic(s.map((function(t){return[t,e]}))),!1)),(o=r.current).push.apply(o,Dc([],Ic(l.map((function(t){return[t,e]}))),!1))}}));return function(){n.unsubscribe()}}),[]),Oc((function(){for(;r.current.length;){var e=Ic(r.current.shift(),2);Ac(e[0],e[1])}})),n.useEffect((function(){for(;t.current.length;){var e=Ic(t.current.shift(),2);Ac(e[0],e[1])}}))}var Vc=function(){return Vc=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Vc.apply(this,arguments)},zc=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},Bc=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a};var Hc=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a};function Fc(e,t){void 0===t&&(t={});var r=n.useCallback((function(e){var t=void 0===e.changed&&Object.keys(e.children).length;(e.changed||t)&&s(e)}),[]),o=function(e,t,r){void 0===t&&(t={});var o=Pc((function(){return"function"==typeof e?e():e}));if("production"!==process.env.NODE_ENV&&"function"!=typeof e){var i=Bc(n.useState(o),1)[0];e!==i&&console.warn("Machine given to `useMachine` has changed between renders. This is not supported and might lead to unexpected results.\nPlease make sure that you pass the same Machine as argument each time.")}var a=t.context,s=t.guards,l=t.actions,c=t.activities,d=t.services,u=t.delays,p=t.state,h=zc(t,["context","guards","actions","activities","services","delays","state"]),f=Pc((function(){var e={context:a,guards:s,actions:l,activities:c,services:d,delays:u};return wc(o.withConfig(e,(function(){return Vc(Vc({},o.context),a)})),Vc({deferEvents:!0},h))}));return Oc((function(){var e;return r&&(e=f.subscribe(function(e){if("object"==typeof e)return e;var t=function(){};return{next:e,error:void 0||t,complete:void 0||t}}(r))),function(){null==e||e.unsubscribe()}}),[r]),Oc((function(){return f.start(p?ac.create(p):void 0),function(){f.stop()}}),[]),Oc((function(){Object.assign(f.machine.options.actions,l),Object.assign(f.machine.options.guards,s),Object.assign(f.machine.options.activities,c),Object.assign(f.machine.options.services,d),Object.assign(f.machine.options.delays,u)}),[l,s,c,d,u]),Nc(f),f}(e,t,r),i=Hc(n.useState((function(){var e=o.machine.initialState;return t.state?ac.create(t.state):e})),2),a=i[0],s=i[1];return[a,o.send,o]}function qc(){return qc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},qc.apply(null,arguments)}function Zc(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}const Wc={arr:Array.isArray,obj:e=>"[object Object]"===Object.prototype.toString.call(e),fun:e=>"function"==typeof e,str:e=>"string"==typeof e,num:e=>"number"==typeof e,und:e=>void 0===e,nul:e=>null===e,set:e=>e instanceof Set,map:e=>e instanceof Map,equ(e,t){if(typeof e!=typeof t)return!1;if(Wc.str(e)||Wc.num(e))return e===t;if(Wc.obj(e)&&Wc.obj(t)&&Object.keys(e).length+Object.keys(t).length===0)return!0;let n;for(n in e)if(!(n in t))return!1;for(n in t)if(e[n]!==t[n])return!1;return!Wc.und(n)||e===t}};function Gc(e,t){return Wc.und(e)||Wc.nul(e)?t:e}function Uc(e){return Wc.und(e)?[]:Wc.arr(e)?e:[e]}function Xc(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return Wc.fun(e)?e(...n):e}function Yc(e){const t=function(e){return e.to,e.from,e.config,e.onStart,e.onRest,e.onFrame,e.children,e.reset,e.reverse,e.force,e.immediate,e.delay,e.attach,e.destroyed,e.interpolateTo,e.ref,e.lazy,Zc(e,["to","from","config","onStart","onRest","onFrame","children","reset","reverse","force","immediate","delay","attach","destroyed","interpolateTo","ref","lazy"])}(e);if(Wc.und(t))return qc({to:t},e);const n=Object.keys(e).reduce(((n,r)=>Wc.und(t[r])?qc({},n,{[r]:e[r]}):n),{});return qc({to:t},n)}class Kc{constructor(){this.payload=void 0,this.children=[]}getAnimatedValue(){return this.getValue()}getPayload(){return this.payload||this}attach(){}detach(){}getChildren(){return this.children}addChild(e){0===this.children.length&&this.attach(),this.children.push(e)}removeChild(e){const t=this.children.indexOf(e);this.children.splice(t,1),0===this.children.length&&this.detach()}}class Jc extends Kc{constructor(){super(...arguments),this.payload=[],this.attach=()=>this.payload.forEach((e=>e instanceof Kc&&e.addChild(this))),this.detach=()=>this.payload.forEach((e=>e instanceof Kc&&e.removeChild(this)))}}class Qc extends Kc{constructor(){super(...arguments),this.payload={},this.attach=()=>Object.values(this.payload).forEach((e=>e instanceof Kc&&e.addChild(this))),this.detach=()=>Object.values(this.payload).forEach((e=>e instanceof Kc&&e.removeChild(this)))}getValue(e){void 0===e&&(e=!1);const t={};for(const n in this.payload){const r=this.payload[n];(!e||r instanceof Kc)&&(t[n]=r instanceof Kc?r[e?"getAnimatedValue":"getValue"]():r)}return t}getAnimatedValue(){return this.getValue(!0)}}let ed,td;let nd,rd=e=>"undefined"!=typeof window?window.requestAnimationFrame(e):-1;let od,id=()=>Date.now();class ad extends Qc{constructor(e,t){super(),this.update=void 0,this.payload=e.style?qc({},e,{style:od(e.style)}):e,this.update=t,this.attach()}}let sd=!1;const ld=new Set,cd=()=>{if(!sd)return!1;let e=id();for(let t of ld){let n=!1;for(let r=0;r<t.configs.length;r++){let o,i,a=t.configs[r];for(let t=0;t<a.animatedValues.length;t++){let r=a.animatedValues[t];if(r.done)continue;let s=a.fromValues[t],l=a.toValues[t],c=r.lastPosition,d=l instanceof Kc,u=Array.isArray(a.initialVelocity)?a.initialVelocity[t]:a.initialVelocity;if(d&&(l=l.getValue()),a.immediate)r.setValue(l),r.done=!0;else if("string"!=typeof s&&"string"!=typeof l){if(void 0!==a.duration)c=s+a.easing((e-r.startTime)/a.duration)*(l-s),o=e>=r.startTime+a.duration;else if(a.decay)c=s+u/(1-.998)*(1-Math.exp(-.0020000000000000018*(e-r.startTime))),o=Math.abs(r.lastPosition-c)<.1,o&&(l=c);else{i=void 0!==r.lastTime?r.lastTime:e,u=void 0!==r.lastVelocity?r.lastVelocity:a.initialVelocity,e>i+64&&(i=e);let t=Math.floor(e-i);for(let e=0;e<t;++e){u+=1*((-a.tension*(c-l)+-a.friction*u)/a.mass)/1e3,c+=1*u/1e3}let n=!(!a.clamp||0===a.tension)&&(s<l?c>l:c<l),d=Math.abs(u)<=a.precision,p=0===a.tension||Math.abs(l-c)<=a.precision;o=n||d&&p,r.lastVelocity=u,r.lastTime=e}d&&!a.toValues[t].done&&(o=!1),o?(r.value!==l&&(c=l),r.done=!0):n=!0,r.setValue(c),r.lastPosition=c}else r.setValue(l),r.done=!0}t.props.onFrame&&(t.values[a.name]=a.interpolation.getValue())}t.props.onFrame&&t.props.onFrame(t.values),n||(ld.delete(t),t.stop(!0))}return ld.size?rd(cd):sd=!1,sd};function dd(e,t,n){if("function"==typeof e)return e;if(Array.isArray(e))return dd({range:e,output:t,extrapolate:n});if(nd&&"string"==typeof e.output[0])return nd(e);const r=e,o=r.output,i=r.range||[0,1],a=r.extrapolateLeft||r.extrapolate||"extend",s=r.extrapolateRight||r.extrapolate||"extend",l=r.easing||(e=>e);return e=>{const t=function(e,t){for(var n=1;n<t.length-1&&!(t[n]>=e);++n);return n-1}(e,i);return function(e,t,n,r,o,i,a,s,l){let c=l?l(e):e;if(c<t){if("identity"===a)return c;"clamp"===a&&(c=t)}if(c>n){if("identity"===s)return c;"clamp"===s&&(c=n)}if(r===o)return r;if(t===n)return e<=t?r:o;t===-1/0?c=-c:n===1/0?c-=t:c=(c-t)/(n-t);c=i(c),r===-1/0?c=-c:o===1/0?c+=r:c=c*(o-r)+r;return c}(e,i[t],i[t+1],o[t],o[t+1],l,a,s,r.map)}}class ud extends Jc{constructor(e,t,n,r){super(),this.calc=void 0,this.payload=e instanceof Jc&&!(e instanceof ud)?e.getPayload():Array.isArray(e)?e:[e],this.calc=dd(t,n,r)}getValue(){return this.calc(...this.payload.map((e=>e.getValue())))}updateConfig(e,t,n){this.calc=dd(e,t,n)}interpolate(e,t,n){return new ud(this,e,t,n)}}const pd=(e,t,n)=>e&&new ud(e,t,n);function hd(e,t){"update"in e?t.add(e):e.getChildren().forEach((e=>hd(e,t)))}class fd extends Kc{constructor(e){var t;super(),t=this,this.animatedStyles=new Set,this.value=void 0,this.startPosition=void 0,this.lastPosition=void 0,this.lastVelocity=void 0,this.startTime=void 0,this.lastTime=void 0,this.done=!1,this.setValue=function(e,n){void 0===n&&(n=!0),t.value=e,n&&t.flush()},this.value=e,this.startPosition=e,this.lastPosition=e}flush(){0===this.animatedStyles.size&&hd(this,this.animatedStyles),this.animatedStyles.forEach((e=>e.update()))}clearStyles(){this.animatedStyles.clear()}getValue(){return this.value}interpolate(e,t,n){return new ud(this,e,t,n)}}class gd extends Jc{constructor(e){super(),this.payload=e.map((e=>new fd(e)))}setValue(e,t){void 0===t&&(t=!0),Array.isArray(e)?e.length===this.payload.length&&e.forEach(((e,n)=>this.payload[n].setValue(e,t))):this.payload.forEach((n=>n.setValue(e,t)))}getValue(){return this.payload.map((e=>e.getValue()))}interpolate(e,t){return new ud(this,e,t)}}let xd=0,md=class{constructor(){this.id=void 0,this.idle=!0,this.hasChanged=!1,this.guid=0,this.local=0,this.props={},this.merged={},this.animations={},this.interpolations={},this.values={},this.configs=[],this.listeners=[],this.queue=[],this.localQueue=void 0,this.getValues=()=>this.interpolations,this.id=xd++}update(e){if(!e)return this;const t=Yc(e),n=t.delay,r=void 0===n?0:n,o=t.to,i=Zc(t,["delay","to"]);if(Wc.arr(o)||Wc.fun(o))this.queue.push(qc({},i,{delay:r,to:o}));else if(o){let e={};Object.entries(o).forEach((t=>{let n=t[0],o=t[1];const a=qc({to:{[n]:o},delay:Xc(r,n)},i),s=e[a.delay]&&e[a.delay].to;e[a.delay]=qc({},e[a.delay],a,{to:qc({},s,a.to)})})),this.queue=Object.values(e)}return this.queue=this.queue.sort(((e,t)=>e.delay-t.delay)),this.diff(i),this}start(e){if(this.queue.length){this.idle=!1,this.localQueue&&this.localQueue.forEach((e=>{let t=e.from,n=void 0===t?{}:t,r=e.to,o=void 0===r?{}:r;Wc.obj(n)&&(this.merged=qc({},n,this.merged)),Wc.obj(o)&&(this.merged=qc({},this.merged,o))}));const t=this.local=++this.guid,n=this.localQueue=this.queue;this.queue=[],n.forEach(((r,o)=>{let i=r.delay,a=Zc(r,["delay"]);const s=r=>{o===n.length-1&&t===this.guid&&r&&(this.idle=!0,this.props.onRest&&this.props.onRest(this.merged)),e&&e()};let l=Wc.arr(a.to)||Wc.fun(a.to);i?setTimeout((()=>{t===this.guid&&(l?this.runAsync(a,s):this.diff(a).start(s))}),i):l?this.runAsync(a,s):this.diff(a).start(s)}))}else Wc.fun(e)&&this.listeners.push(e),this.props.onStart&&this.props.onStart(),t=this,ld.has(t)||ld.add(t),sd||(sd=!0,rd(cd));var t;return this}stop(e){return this.listeners.forEach((t=>t(e))),this.listeners=[],this}pause(e){var t;return this.stop(!0),e&&(t=this,ld.has(t)&&ld.delete(t)),this}runAsync(e,t){var n=this;e.delay;let r=Zc(e,["delay"]);const o=this.local;let i=Promise.resolve(void 0);if(Wc.arr(r.to))for(let e=0;e<r.to.length;e++){const t=e,n=qc({},r,Yc(r.to[t]));Wc.arr(n.config)&&(n.config=n.config[t]),i=i.then((()=>{if(o===this.guid)return new Promise((e=>this.diff(n).start(e)))}))}else if(Wc.fun(r.to)){let e,t=0;i=i.then((()=>r.to((n=>{const i=qc({},r,Yc(n));if(Wc.arr(i.config)&&(i.config=i.config[t]),t++,o===this.guid)return e=new Promise((e=>this.diff(i).start(e)))}),(function(e){return void 0===e&&(e=!0),n.stop(e)})).then((()=>e))))}i.then(t)}diff(e){this.props=qc({},this.props,e);let t=this.props,n=t.from,r=void 0===n?{}:n,o=t.to,i=void 0===o?{}:o,a=t.config,s=void 0===a?{}:a,l=t.reverse,c=t.attach,d=t.reset,u=t.immediate;if(l){var p=[i,r];r=p[0],i=p[1]}this.merged=qc({},r,this.merged,i),this.hasChanged=!1;let h=c&&c(this);if(this.animations=Object.entries(this.merged).reduce(((e,t)=>{let n=t[0],o=t[1],i=e[n]||{};const a=Wc.num(o),l=Wc.str(o)&&!o.startsWith("#")&&!/\d/.test(o)&&!td[o],c=Wc.arr(o),p=!a&&!c&&!l;let f=Wc.und(r[n])?o:r[n],g=a||c||l?o:1,x=Xc(s,n);h&&(g=h.animations[n].parent);let m,v=i.parent,b=i.interpolation,y=Uc(h?g.getPayload():g),w=o;p&&(w=nd({range:[0,1],output:[o,o]})(1));let C=b&&b.getValue();const j=!Wc.und(v)&&i.animatedValues.some((e=>!e.done)),k=!Wc.equ(w,C),$=!Wc.equ(w,i.previous),S=!Wc.equ(x,i.config);if(d||$&&k||S){if(a||l)v=b=i.parent||new fd(f);else if(c)v=b=i.parent||new gd(f);else if(p){let e=i.interpolation&&i.interpolation.calc(i.parent.value);e=void 0===e||d?f:e,i.parent?(v=i.parent,v.setValue(0,!1)):v=new fd(0);const t={output:[e,o]};i.interpolation?(b=i.interpolation,i.interpolation.updateConfig(t)):b=v.interpolate(t)}return y=Uc(h?g.getPayload():g),m=Uc(v.getPayload()),d&&!p&&v.setValue(f,!1),this.hasChanged=!0,m.forEach((e=>{e.startPosition=e.value,e.lastPosition=e.value,e.lastVelocity=j?e.lastVelocity:void 0,e.lastTime=j?e.lastTime:void 0,e.startTime=id(),e.done=!1,e.animatedStyles.clear()})),Xc(u,n)&&v.setValue(p?g:o,!1),qc({},e,{[n]:qc({},i,{name:n,parent:v,interpolation:b,animatedValues:m,toValues:y,previous:w,config:x,fromValues:Uc(v.getValue()),immediate:Xc(u,n),initialVelocity:Gc(x.velocity,0),clamp:Gc(x.clamp,!1),precision:Gc(x.precision,.01),tension:Gc(x.tension,170),friction:Gc(x.friction,26),mass:Gc(x.mass,1),duration:x.duration,easing:Gc(x.easing,(e=>e)),decay:x.decay})})}return k?e:(p&&(v.setValue(1,!1),b.updateConfig({output:[w,w]})),v.done=!0,this.hasChanged=!0,qc({},e,{[n]:qc({},e[n],{previous:w})}))}),this.animations),this.hasChanged){this.configs=Object.values(this.animations),this.values={},this.interpolations={};for(let e in this.animations)this.interpolations[e]=this.animations[e].interpolation,this.values[e]=this.animations[e].interpolation.getValue()}return this}destroy(){this.stop(),this.props={},this.merged={},this.animations={},this.interpolations={},this.values={},this.configs=[],this.local=0}};const vd=e=>{const t=Wc.fun(e),r=((e,t)=>{const r=n.useRef(!1),o=n.useRef(),i=Wc.fun(t),a=n.useMemo((()=>{let n;return o.current&&(o.current.map((e=>e.destroy())),o.current=void 0),[new Array(e).fill().map(((e,r)=>{const o=new md,a=i?Xc(t,r,o):t[r];return 0===r&&(n=a.ref),o.update(a),n||o.start(),o})),n]}),[e]),s=a[0],l=a[1];o.current=s,n.useImperativeHandle(l,(()=>({start:()=>Promise.all(o.current.map((e=>new Promise((t=>e.start(t)))))),stop:e=>o.current.forEach((t=>t.stop(e))),get controllers(){return o.current}})));const c=n.useMemo((()=>e=>o.current.map(((t,n)=>{t.update(i?Xc(e,n,t):e[n]),l||t.start()}))),[e]);n.useEffect((()=>{r.current?i||c(t):l||o.current.forEach((e=>e.start()))})),n.useEffect((()=>(r.current=!0,()=>o.current.forEach((e=>e.destroy())))),[]);const d=o.current.map((e=>e.getValues()));return i?[d,c,e=>o.current.forEach((t=>t.pause(e)))]:d})(1,t?e:[e]),o=r[0],i=r[1],a=r[2];return t?[o[0],i,a]:o};class bd extends Qc{constructor(e){void 0===e&&(e={}),super(),!e.transform||e.transform instanceof Kc||(e=ed.transform(e)),this.payload=e}}const yd={transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199},wd="[-+]?\\d*\\.?\\d+",Cd=wd+"%";function jd(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return"\\(\\s*("+t.join(")\\s*,\\s*(")+")\\s*\\)"}const kd=new RegExp("rgb"+jd(wd,wd,wd)),$d=new RegExp("rgba"+jd(wd,wd,wd,wd)),Sd=new RegExp("hsl"+jd(wd,Cd,Cd)),Ed=new RegExp("hsla"+jd(wd,Cd,Cd,wd)),Ld=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,Rd=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,Td=/^#([0-9a-fA-F]{6})$/,Od=/^#([0-9a-fA-F]{8})$/;function Pd(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Md(e,t,n){const r=n<.5?n*(1+t):n+t-n*t,o=2*n-r,i=Pd(o,r,e+1/3),a=Pd(o,r,e),s=Pd(o,r,e-1/3);return Math.round(255*i)<<24|Math.round(255*a)<<16|Math.round(255*s)<<8}function _d(e){const t=parseInt(e,10);return t<0?0:t>255?255:t}function Id(e){return(parseFloat(e)%360+360)%360/360}function Dd(e){const t=parseFloat(e);return t<0?0:t>1?255:Math.round(255*t)}function Ad(e){const t=parseFloat(e);return t<0?0:t>100?1:t/100}function Nd(e){let t=function(e){let t;return"number"==typeof e?e>>>0===e&&e>=0&&e<=4294967295?e:null:(t=Td.exec(e))?parseInt(t[1]+"ff",16)>>>0:yd.hasOwnProperty(e)?yd[e]:(t=kd.exec(e))?(_d(t[1])<<24|_d(t[2])<<16|_d(t[3])<<8|255)>>>0:(t=$d.exec(e))?(_d(t[1])<<24|_d(t[2])<<16|_d(t[3])<<8|Dd(t[4]))>>>0:(t=Ld.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+"ff",16)>>>0:(t=Od.exec(e))?parseInt(t[1],16)>>>0:(t=Rd.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+t[4]+t[4],16)>>>0:(t=Sd.exec(e))?(255|Md(Id(t[1]),Ad(t[2]),Ad(t[3])))>>>0:(t=Ed.exec(e))?(Md(Id(t[1]),Ad(t[2]),Ad(t[3]))|Dd(t[4]))>>>0:null}(e);return null===t?e:(t=t||0,`rgba(${(4278190080&t)>>>24}, ${(16711680&t)>>>16}, ${(65280&t)>>>8}, ${(255&t)/255})`)}const Vd=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,zd=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,Bd=new RegExp(`(${Object.keys(yd).join("|")})`,"g");let Hd={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0};const Fd=["Webkit","Ms","Moz","O"];function qd(e,t,n){return null==t||"boolean"==typeof t||""===t?"":n||"number"!=typeof t||0===t||Hd.hasOwnProperty(e)&&Hd[e]?(""+t).trim():t+"px"}Hd=Object.keys(Hd).reduce(((e,t)=>(Fd.forEach((n=>e[((e,t)=>e+t.charAt(0).toUpperCase()+t.substring(1))(n,t)]=e[t])),e)),Hd);const Zd={};var Wd;od=e=>new bd(e),Wd=e=>{const t=e.output.map((e=>e.replace(zd,Nd))).map((e=>e.replace(Bd,Nd))),n=t[0].match(Vd).map((()=>[]));t.forEach((e=>{e.match(Vd).forEach(((e,t)=>n[t].push(+e)))}));const r=t[0].match(Vd).map(((t,r)=>dd(qc({},e,{output:n[r]}))));return e=>{let n=0;return t[0].replace(Vd,(()=>r[n++](e))).replace(/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,((e,t,n,r,o)=>`rgba(${Math.round(t)}, ${Math.round(n)}, ${Math.round(r)}, ${o})`))}},nd=Wd,td=yd,function(e,t){ed={fn:e,transform:t}}(((e,t)=>{if(!e.nodeType||void 0===e.setAttribute)return!1;{const o=t.style,i=t.children,a=t.scrollTop,s=t.scrollLeft,l=Zc(t,["style","children","scrollTop","scrollLeft"]),c="filter"===e.nodeName||e.parentNode&&"filter"===e.parentNode.nodeName;void 0!==a&&(e.scrollTop=a),void 0!==s&&(e.scrollLeft=s),void 0!==i&&(e.textContent=i);for(let t in o)if(o.hasOwnProperty(t)){var n=0===t.indexOf("--"),r=qd(t,o[t],n);"float"===t&&(t="cssFloat"),n?e.style.setProperty(t,r):e.style[t]=r}for(let t in l){const n=c?t:Zd[t]||(Zd[t]=t.replace(/([A-Z])/g,(e=>"-"+e.toLowerCase())));void 0!==e.getAttribute(n)&&e.setAttribute(n,l[t])}}}),(e=>e));var Gd;const Ud=(Gd=e=>n.forwardRef(((t,r)=>{const o=function(){const e=n.useState(!1)[1];return n.useCallback((()=>e((e=>!e))),[])}(),i=n.useRef(!0),a=n.useRef(null),s=n.useRef(null),l=n.useCallback((e=>{const t=a.current;a.current=new ad(e,(()=>{let e=!1;s.current&&(e=ed.fn(s.current,a.current.getAnimatedValue())),s.current&&!1!==e||o()})),t&&t.detach()}),[]);n.useEffect((()=>()=>{i.current=!1,a.current&&a.current.detach()}),[]),n.useImperativeHandle(r,(()=>(e=>e.current)(s))),l(t);const c=a.current.getValue();c.scrollTop,c.scrollLeft;const d=Zc(c,["scrollTop","scrollLeft"]),u=(p=e,!Wc.fun(p)||p.prototype instanceof n.Component?e=>s.current=function(e,t){return t&&(Wc.fun(t)?t(e):Wc.obj(t)&&(t.current=e)),e}(e,r):void 0);var p;return n.createElement(e,qc({},d,{ref:u}))})),e=>(Wc.arr(e)?e:Object.keys(e)).reduce(((e,t)=>{const n=t;return e[n]=Gd(n),e}),Gd))(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"]);function Xd(e,t){return e.map((function(e,n){return e+t[n]}))}function Yd(e,t){return e.map((function(e,n){return e-t[n]}))}function Kd(e){return Math.hypot.apply(Math,e)}function Jd(e){return Math.sign?Math.sign(e):Number(e>0)-Number(e<0)||+e}function Qd(e,t,n){return 0===t||Math.abs(t)===1/0?function(e,t){return Math.pow(e,5*t)}(e,n):e*t*n/(t+n*e)}function eu(e,t,n,r){return void 0===r&&(r=.15),0===r?function(e,t,n){return Math.max(t,Math.min(e,n))}(e,t,n):e<t?-Qd(t-e,n-t,r)+t:e>n?+Qd(e-n,n-t,r)+n:e}function tu(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}function nu(){return nu=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},nu.apply(this,arguments)}function ru(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function ou(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function iu(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function au(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return iu(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?iu(e,t):void 0}}(e))||t){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(n=e[Symbol.iterator]()).next.bind(n)}function su(){}function lu(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return 0===t.length?su:1===t.length?t[0]:function(){for(var e,n,r=au(t);!(n=r()).done;){e=n.value.apply(this,arguments)||e}return e}}function cu(e,t){if(void 0===e){if(void 0===t)throw new Error("Must define fallback value if undefined is expected");e=t}return Array.isArray(e)?e:[e,e]}function du(e){if("function"==typeof e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return e.apply(void 0,n)}return e}function uu(e,t){void 0===e&&(e={});for(var n={},r=0,o=Object.entries(t);r<o.length;r++){var i=o[r],a=i[0],s=i[1];switch(typeof s){case"function":n[a]=s.call(n,e[a],a,e);break;case"object":n[a]=uu(e[a],s);break;case"boolean":s&&(n[a]=e[a])}}return n}var pu=nu({},{threshold:function(e){return void 0===e&&(e=0),cu(e)},rubberband:function(e){switch(void 0===e&&(e=0),e){case!0:return cu(.15);case!1:return cu(0);default:return cu(e)}},enabled:function(e){return void 0===e&&(e=!0),e},triggerAllEvents:function(e){return void 0===e&&(e=!1),e},initial:function(e){return void 0===e&&(e=0),"function"==typeof e?e:cu(e)}},{axis:!0,lockDirection:function(e){return void 0===e&&(e=!1),e},bounds:function(e){if(void 0===e&&(e={}),"function"==typeof e)return function(t){return pu.bounds(e(t))};var t=e,n=t.left,r=void 0===n?-1/0:n,o=t.right,i=void 0===o?1/0:o,a=t.top,s=void 0===a?-1/0:a,l=t.bottom;return[[r,i],[s,void 0===l?1/0:l]]}}),hu="undefined"!=typeof window&&window.document&&window.document.createElement,fu={enabled:function(e){return void 0===e&&(e=!0),e},domTarget:!0,window:function(e){function t(t){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((function(e){return void 0===e&&(e=hu?window:void 0),e})),eventOptions:function(e){var t=void 0===e?{}:e,n=t.passive,r=void 0===n||n,o=t.capture;return{passive:r,capture:void 0!==o&&o}}},gu=nu({},pu,{threshold:function(e,t,n){var r=n.filterTaps,o=void 0!==r&&r,i=n.lockDirection,a=void 0!==i&&i,s=n.axis,l=cu(e,o?3:a||(void 0===s?void 0:s)?1:0);return this.filterTaps=o||l[0]+l[1]>0,l},swipeVelocity:function(e){return void 0===e&&(e=.5),cu(e)},swipeDistance:function(e){return void 0===e&&(e=60),cu(e)},delay:function(e){switch(void 0===e&&(e=0),e){case!0:return 180;case!1:return 0;default:return e}}});function xu(e){var t=e.domTarget,n=e.eventOptions,r=e.window,o=e.enabled,i=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,["domTarget","eventOptions","window","enabled"]),a=function(e){return void 0===e&&(e={}),uu(e,fu)}({domTarget:t,eventOptions:n,window:r,enabled:o});return a.drag=function(e){return void 0===e&&(e={}),uu(e,gu)}(i),a}function mu(e){return nu({_active:!1,_blocked:!1,_intentional:[!1,!1],_movement:[0,0],_initial:[0,0],_bounds:[[-1/0,1/0],[-1/0,1/0]],_lastEventType:void 0,event:void 0,intentional:!1,values:[0,0],velocities:[0,0],delta:[0,0],movement:[0,0],offset:[0,0],lastOffset:[0,0],direction:[0,0],initial:[0,0],previous:[0,0],first:!1,last:!1,active:!1,timeStamp:0,startTime:0,elapsedTime:0,cancel:su,canceled:!1,memo:void 0,args:void 0},e)}function vu(){return{shared:{hovering:!1,scrolling:!1,wheeling:!1,dragging:!1,moving:!1,pinching:!1,touches:0,buttons:0,down:!1,shiftKey:!1,altKey:!1,metaKey:!1,ctrlKey:!1},drag:mu({axis:void 0,xy:[0,0],vxvy:[0,0],velocity:0,distance:0,_isTap:!0,_delayedEvent:!1,_pointerId:void 0,tap:!1,swipe:[0,0]}),pinch:mu({da:[0,0],vdva:[0,0],origin:void 0,turns:0}),wheel:mu({axis:void 0,xy:[0,0],vxvy:[0,0],velocity:0,distance:0}),move:mu({axis:void 0,xy:[0,0],vxvy:[0,0],velocity:0,distance:0}),scroll:mu({axis:void 0,xy:[0,0],vxvy:[0,0],velocity:0,distance:0})}}var bu=new Map,yu=function(){function e(e,t){var n=this;void 0===t&&(t=[]),this.controller=e,this.args=t,this.debounced=!0,this.setTimeout=function(e,t){var r;void 0===t&&(t=140),clearTimeout(n.controller.timeouts[n.stateKey]);for(var o=arguments.length,i=new Array(o>2?o-2:0),a=2;a<o;a++)i[a-2]=arguments[a];n.controller.timeouts[n.stateKey]=(r=window).setTimeout.apply(r,[e,t].concat(i))},this.clearTimeout=function(){clearTimeout(n.controller.timeouts[n.stateKey])},this.fireGestureHandler=function(e){if(void 0===e&&(e=!1),n.state._blocked)return n.debounced||(n.state._active=!1,n.clean()),null;if(!e&&!n.state.intentional&&!n.config.triggerAllEvents)return null;if(n.state.intentional){var t=n.state.active,r=n.state._active;n.state.active=r,n.state.first=r&&!t,n.state.last=t&&!r,n.controller.state.shared[n.ingKey]=r}var o=nu({},n.controller.state.shared,n.state,n.mapStateValues(n.state)),i=n.handler(o);return n.state.memo=void 0!==i?i:n.state.memo,n.state._active||n.clean(),o}}var t=e.prototype;return t.updateSharedState=function(e){Object.assign(this.controller.state.shared,e)},t.updateGestureState=function(e){Object.assign(this.state,e)},t.checkIntentionality=function(e,t){return{_intentional:e,_blocked:!1}},t.getMovement=function(e){var t=this.config,n=t.initial,r=t.bounds,o=t.rubberband,i=t.threshold,a=this.state,s=a._bounds,l=a._initial,c=a._active,d=a._intentional,u=a.lastOffset,p=a.movement,h=this.getInternalMovement(e,this.state),f=!1===d[0]?wu(h[0],i[0]):d[0],g=!1===d[1]?wu(h[1],i[1]):d[1],x=this.checkIntentionality([f,g],h);if(x._blocked)return nu({},x,{_movement:h,delta:[0,0]});var m,v,b,y,w=x._intentional,C=h;(!1!==w[0]&&!1===d[0]&&(v=du(n,this.state),m=du(r,this.state),l[0]=v[0],s[0]=m[0]),!1!==w[1]&&!1===d[1])&&(v=null!=(b=v)?b:du(n,this.state),m=null!=(y=m)?y:du(r,this.state),l[1]=v[1],s[1]=m[1]);var j=[!1!==w[0]?h[0]-w[0]:l[0],!1!==w[1]?h[1]-w[1]:l[1]],k=Xd(j,u),$=c?o:[0,0];return j=Cu(s,Xd(j,l),$),nu({},x,{intentional:!1!==w[0]||!1!==w[1],_initial:l,_movement:C,movement:j,values:e,offset:Cu(s,k,$),delta:Yd(j,p)})},t.clean=function(){this.clearTimeout()},tu(e,[{key:"config",get:function(){return this.controller.config[this.stateKey]}},{key:"enabled",get:function(){return this.controller.config.enabled&&this.config.enabled}},{key:"state",get:function(){return this.controller.state[this.stateKey]}},{key:"handler",get:function(){return this.controller.handlers[this.stateKey]}}]),e}();function wu(e,t){return Math.abs(e)>=t&&Jd(e)*t}function Cu(e,t,n){var r=t[0],o=t[1],i=n[0],a=n[1],s=e[0],l=s[0],c=s[1],d=e[1],u=d[0],p=d[1];return[eu(r,l,c,i),eu(o,u,p,a)]}function ju(e,t,n){var r=e.state,o=e.args,i=t.timeStamp,a=t.type,s=r.values;return{_lastEventType:a,event:t,timeStamp:i,elapsedTime:n?0:i-r.startTime,args:o,previous:s}}function ku(e,t){return function(n){for(var r=arguments.length,o=new Array(r>1?r-1:0),i=1;i<r;i++)o[i-1]=arguments[i];return e.call.apply(e,[this,nu({},t,{event:n})].concat(o))}}var $u=function(e){var t=this;this.classes=e,this.bind=function(){for(var e={},n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];for(var i,a=au(t.classes);!(i=a()).done;){new(0,i.value)(t,r).addBindings(e)}for(var s=0,l=Object.entries(t.nativeRefs);s<l.length;s++){var c=l[s];Lu(e,c[0],ku(c[1],nu({},t.state.shared,{args:r})))}return t.config.domTarget?function(e,t){var n=e.config,r=e.domListeners,o=Eu(n);if(!o)throw new Error("domTarget must be defined");var i=n.eventOptions;Tu(o,Su(r),i);for(var a=0,s=Object.entries(t);a<s.length;a++){var l=s[a],c=l[0],d=l[1],u=c.slice(2).toLowerCase();r.push([u,lu.apply(void 0,d)])}Ru(o,r,i)}(t,e):function(e,t){for(var n=e.config,r={},o=n.eventOptions.capture?"Capture":"",i=0,a=Object.entries(t);i<a.length;i++){var s=a[i],l=s[0],c=s[1],d=Array.isArray(c)?c:[c];r[l+o]=lu.apply(void 0,d)}return r}(t,e)},this.effect=function(){return t.config.domTarget&&t.bind(),t.clean},this.clean=function(){var e=Eu(t.config),n=t.config.eventOptions;e&&Tu(e,Su(t.domListeners),n),Object.values(t.timeouts).forEach(clearTimeout),function(e){var t=e.config,n=t.window,r=t.eventOptions,o=e.windowListeners;if(!n)return;for(var i in o){Tu(n,o[i],r)}e.windowListeners={}}(t)},this.state=vu(),this.timeouts={},this.domListeners=[],this.windowListeners={}};function Su(e){return void 0===e&&(e=[]),e.splice(0,e.length)}function Eu(e){var t=e.domTarget;return t&&"current"in t?t.current:t}function Lu(e,t,n){e[t]||(e[t]=[]),e[t].push(n)}function Ru(e,t,n){void 0===t&&(t=[]),void 0===n&&(n={});for(var r,o=au(t);!(r=o()).done;){var i=r.value,a=i[0],s=i[1];e.addEventListener(a,s,n)}}function Tu(e,t,n){void 0===t&&(t=[]),void 0===n&&(n={});for(var r,o=au(t);!(r=o()).done;){var i=r.value,a=i[0],s=i[1];e.removeEventListener(a,s,n)}}function Ou(e,t,r){void 0===r&&(r={});var o=function(e){var t=new Set;e.drag&&t.add(bu.get("drag"));e.wheel&&t.add(bu.get("wheel"));e.scroll&&t.add(bu.get("scroll"));e.move&&t.add(bu.get("move"));e.pinch&&t.add(bu.get("pinch"));e.hover&&t.add(bu.get("hover"));return t}(e),i=n.useMemo((function(){return new $u(o)}),[]);return i.config=t,i.handlers=e,i.nativeRefs=r,n.useEffect(i.effect,[]),i.config.domTarget?Pu:i.bind}function Pu(){"development"===process.env.NODE_ENV&&console.warn("Deprecation notice: When the `domTarget` option is specified, you don't need to write `useEffect(bind, [bind])` anymore: event binding is now made handled internally to this lib.\n\nNext version won't return anything when `domTarget` is provided, therefore your code will break if you try to call `useEffect`.")}function Mu(e){if("touches"in e){var t=e.targetTouches,n=e.changedTouches;return t.length>0?t:n}return null}function _u(e){var t="buttons"in e?e.buttons:0,n=Mu(e),r=n&&n.length||0;return{touches:r,down:r>0||t>0,buttons:t,shiftKey:e.shiftKey,altKey:e.altKey,metaKey:e.metaKey,ctrlKey:e.ctrlKey}}function Iu(e){var t=Mu(e),n=t?t[0]:e;return[n.clientX,n.clientY]}var Du=function(e){function t(){var t;return(t=e.apply(this,arguments)||this).ingKey="dragging",t.stateKey="drag",t.onDragStart=function(e){t.enabled&&!t.state._active&&(!function(e,t,n){var r=e.config,o=e.windowListeners;void 0===n&&(n=[]),r.window&&(Tu(r.window,o[t],r.eventOptions),Ru(r.window,o[t]=n,r.eventOptions))}(t.controller,t.stateKey,[["pointermove",t.onDragChange],["pointerup",t.onDragEnd],["pointercancel",t.onDragEnd]]),t.updateGestureState({_pointerId:e.pointerId}),t.config.delay>0?(t.state._delayedEvent=!0,"persist"in e&&"function"==typeof e.persist&&e.persist(),t.setTimeout(t.startDrag.bind(ou(t)),t.config.delay,e)):t.startDrag(e))},t.onDragChange=function(e){if(!t.state.canceled&&e.pointerId===t.state._pointerId)if(t.state._active){var n=_u(e);if(n.down){t.updateSharedState(n);var r=Iu(e),o=t.getKinematics(r,e),i=ju(ou(t),e),a=t.state._isTap,s=Kd(o._movement);a&&s>=3&&(a=!1),t.updateGestureState(nu({},i,o,{_isTap:a})),t.fireGestureHandler()}else t.onDragEnd(e)}else t.state._delayedEvent&&(t.clearTimeout(),t.startDrag(e))},t.onDragEnd=function(e){if(e.pointerId===t.state._pointerId){t.state._active=!1,t.updateSharedState({down:!1,buttons:0,touches:0});var n=t.state._isTap,r=t.state.velocities,o=r[0],i=r[1],a=t.state.movement,s=a[0],l=a[1],c=t.state._intentional,d=c[0],u=c[1],p=t.config.swipeVelocity,h=p[0],f=p[1],g=t.config.swipeDistance,x=g[0],m=g[1],v=nu({},ju(ou(t),e),t.getMovement(t.state.values)),b=[0,0];v.elapsedTime<220&&(!1!==d&&Math.abs(o)>h&&Math.abs(s)>x&&(b[0]=Jd(o)),!1!==u&&Math.abs(i)>f&&Math.abs(l)>m&&(b[1]=Jd(i))),t.updateGestureState(nu({},v,{tap:n,swipe:b})),t.fireGestureHandler(!0===n)}},t.clean=function(){e.prototype.clean.call(ou(t)),t.state._delayedEvent=!1,function(e,t){var n=e.config,r=e.windowListeners;n.window&&(Tu(n.window,r[t],n.eventOptions),delete r[t])}(t.controller,t.stateKey)},t.onCancel=function(){t.state.canceled||(t.updateGestureState({canceled:!0}),t.state._active=!1,t.updateSharedState({down:!1,buttons:0,touches:0}),requestAnimationFrame((function(){return t.fireGestureHandler()})))},t.onClick=function(e){t.state._isTap||e.stopPropagation()},t}ru(t,e);var n=t.prototype;return n.startDrag=function(e){var t=Iu(e);this.updateSharedState(_u(e)),this.updateGestureState(nu({},function(e,t,n){var r=e.state.offset,o=n.timeStamp;return nu({},vu()[e.stateKey],{_active:!0,values:t,initial:t,offset:r,lastOffset:r,startTime:o})}(this,t,e),ju(this,e,!0),{_pointerId:e.pointerId,cancel:this.onCancel})),this.updateGestureState(this.getMovement(t)),this.fireGestureHandler()},n.addBindings=function(e){(Lu(e,"onPointerDown",this.onDragStart),this.config.filterTaps)&&Lu(e,this.controller.config.eventOptions.capture?"onClick":"onClickCapture",this.onClick)},t}(function(e){function t(){return e.apply(this,arguments)||this}ru(t,e);var n=t.prototype;return n.getInternalMovement=function(e,t){return Yd(e,t.initial)},n.checkIntentionality=function(e,t){if(!1===e[0]&&!1===e[1])return{_intentional:e,axis:this.state.axis};var n=t.map(Math.abs),r=n[0],o=n[1],i=this.state.axis||(r>o?"x":r<o?"y":void 0);return this.config.axis||this.config.lockDirection?i?this.config.axis&&i!==this.config.axis?{_intentional:e,_blocked:!0,axis:i}:(e["x"===i?1:0]=!1,{_intentional:e,_blocked:!1,axis:i}):{_intentional:[!1,!1],_blocked:!1,axis:i}:{_intentional:e,_blocked:!1,axis:i}},n.getKinematics=function(e,t){var n=this.getMovement(e);if(!n._blocked){var r=t.timeStamp-this.state.timeStamp;Object.assign(n,function(e,t,n){var r=Kd(t),o=0===r?0:1/r,i=0===n?0:1/n,a=i*r,s=t.map((function(e){return i*e})),l=t.map((function(e){return o*e}));return{velocities:s,velocity:a,distance:Kd(e),direction:l}}(n.movement,n.delta,r))}return n},n.mapStateValues=function(e){return{xy:e.values,vxvy:e.velocities}},t}(yu));function Au(e,t){if(e===t)return!0;if(e&&t&&"object"==typeof e&&"object"==typeof t){if(e.constructor!==t.constructor)return!1;var n,r,o,i;if(Array.isArray(e)){if((n=e.length)!==t.length)return!1;for(r=n;0!=r--;)if(!Au(e[r],t[r]))return!1;return!0}if("function"==typeof Map&&e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(i=e.entries();!(r=i.next()).done;)if(!t.has(r.value[0]))return!1;for(i=e.entries();!(r=i.next()).done;)if(!Au(r.value[1],t.get(r.value[0])))return!1;return!0}if("function"==typeof Set&&e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(i=e.entries();!(r=i.next()).done;)if(!t.has(r.value[0]))return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();if((n=(o=Object.keys(e)).length)!==Object.keys(t).length)return!1;for(r=n;0!=r--;)if(!Object.prototype.hasOwnProperty.call(t,o[r]))return!1;if("undefined"!=typeof Element&&e instanceof Element)return!1;for(r=n;0!=r--;)if(!("_owner"===o[r]&&e.$$typeof||Au(e[o[r]],t[o[r]])))return!1;return!0}return e!=e&&t!=t}function Nu(e,t){try{return Au(e,t)}catch(e){if((e.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw e}}function Vu(e,t){void 0===t&&(t={}),bu.set("drag",Du);var r=n.useRef();return r.current||(r.current=function(e,t){var n,r,o=[],i=!1;return function(){for(var a=arguments.length,s=new Array(a),l=0;l<a;l++)s[l]=arguments[l];return i&&n===this&&t(s,o)||(r=e.apply(this,s),i=!0,n=this,o=s),r}}(xu,Nu)),Ou({drag:e},r.current(t))}
2469
2474
  /*!
2470
2475
  * tabbable 5.3.3
2471
2476
  * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
2472
- */var Vu=["input","select","textarea","a[href]","button","[tabindex]:not(slot)","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])',"details>summary:first-of-type","details"],zu=Vu.join(","),Bu="undefined"==typeof Element,Hu=Bu?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Fu=!Bu&&Element.prototype.getRootNode?function(e){return e.getRootNode()}:function(e){return e.ownerDocument},qu=function(e,t,n){var r=Array.prototype.slice.apply(e.querySelectorAll(zu));return t&&Hu.call(e,zu)&&r.unshift(e),r=r.filter(n)},Zu=function e(t,n,r){for(var o=[],i=Array.from(t);i.length;){var a=i.shift();if("SLOT"===a.tagName){var s=a.assignedElements(),l=e(s.length?s:a.children,!0,r);r.flatten?o.push.apply(o,l):o.push({scope:a,candidates:l})}else{Hu.call(a,zu)&&r.filter(a)&&(n||!t.includes(a))&&o.push(a);var c=a.shadowRoot||"function"==typeof r.getShadowRoot&&r.getShadowRoot(a),d=!r.shadowRootFilter||r.shadowRootFilter(a);if(c&&d){var u=e(!0===c?a.children:c.children,!0,r);r.flatten?o.push.apply(o,u):o.push({scope:a,candidates:u})}else i.unshift.apply(i,a.children)}}return o},Wu=function(e,t){return e.tabIndex<0&&(t||/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||e.isContentEditable)&&isNaN(parseInt(e.getAttribute("tabindex"),10))?0:e.tabIndex},Gu=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},Uu=function(e){return"INPUT"===e.tagName},Xu=function(e){return function(e){return Uu(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||Fu(e),r=function(e){return n.querySelectorAll('input[type="radio"][name="'+e+'"]')};if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)t=r(window.CSS.escape(e.name));else try{t=r(e.name)}catch(e){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",e.message),!1}var o=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]}(t,e.form);return!o||o===e}(e)},Yu=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return 0===n&&0===r},Ku=function(e,t){return!(t.disabled||function(e){return Uu(e)&&"hidden"===e.type}(t)||function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if("hidden"===getComputedStyle(e).visibility)return!0;var o=Hu.call(e,"details>summary:first-of-type")?e.parentElement:e;if(Hu.call(o,"details:not([open]) *"))return!0;var i=Fu(e).host,a=(null==i?void 0:i.ownerDocument.contains(i))||e.ownerDocument.contains(e);if(n&&"full"!==n){if("non-zero-area"===n)return Yu(e)}else{if("function"==typeof r){for(var s=e;e;){var l=e.parentElement,c=Fu(e);if(l&&!l.shadowRoot&&!0===r(l))return Yu(e);e=e.assignedSlot?e.assignedSlot:l||c===e.ownerDocument?l:c.host}e=s}if(a)return!e.getClientRects().length}return!1}(t,e)||function(e){return"DETAILS"===e.tagName&&Array.prototype.slice.apply(e.children).some((function(e){return"SUMMARY"===e.tagName}))}(t)||function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if("FIELDSET"===t.tagName&&t.disabled){for(var n=0;n<t.children.length;n++){var r=t.children.item(n);if("LEGEND"===r.tagName)return!!Hu.call(t,"fieldset[disabled] *")||!r.contains(e)}return!0}t=t.parentElement}return!1}(t))},Ju=function(e,t){return!(Xu(t)||Wu(t)<0||!Ku(e,t))},Qu=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},ep=function e(t){var n=[],r=[];return t.forEach((function(t,o){var i=!!t.scope,a=i?t.scope:t,s=Wu(a,i),l=i?e(t.candidates):a;0===s?i?n.push.apply(n,l):n.push(a):r.push({documentOrder:o,tabIndex:s,item:t,isScope:i,content:l})})),r.sort(Gu).reduce((function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e}),[]).concat(n)},tp=function(e,t){var n;return n=(t=t||{}).getShadowRoot?Zu([e],t.includeContainer,{filter:Ju.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:Qu}):qu(e,t.includeContainer,Ju.bind(null,t)),ep(n)},np=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==Hu.call(e,zu)&&Ju(t,e)},rp=Vu.concat("iframe").join(","),op=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==Hu.call(e,rp)&&Ku(t,e)};
2477
+ */var zu=["input","select","textarea","a[href]","button","[tabindex]:not(slot)","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])',"details>summary:first-of-type","details"],Bu=zu.join(","),Hu="undefined"==typeof Element,Fu=Hu?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,qu=!Hu&&Element.prototype.getRootNode?function(e){return e.getRootNode()}:function(e){return e.ownerDocument},Zu=function(e,t,n){var r=Array.prototype.slice.apply(e.querySelectorAll(Bu));return t&&Fu.call(e,Bu)&&r.unshift(e),r=r.filter(n)},Wu=function e(t,n,r){for(var o=[],i=Array.from(t);i.length;){var a=i.shift();if("SLOT"===a.tagName){var s=a.assignedElements(),l=e(s.length?s:a.children,!0,r);r.flatten?o.push.apply(o,l):o.push({scope:a,candidates:l})}else{Fu.call(a,Bu)&&r.filter(a)&&(n||!t.includes(a))&&o.push(a);var c=a.shadowRoot||"function"==typeof r.getShadowRoot&&r.getShadowRoot(a),d=!r.shadowRootFilter||r.shadowRootFilter(a);if(c&&d){var u=e(!0===c?a.children:c.children,!0,r);r.flatten?o.push.apply(o,u):o.push({scope:a,candidates:u})}else i.unshift.apply(i,a.children)}}return o},Gu=function(e,t){return e.tabIndex<0&&(t||/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||e.isContentEditable)&&isNaN(parseInt(e.getAttribute("tabindex"),10))?0:e.tabIndex},Uu=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},Xu=function(e){return"INPUT"===e.tagName},Yu=function(e){return function(e){return Xu(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||qu(e),r=function(e){return n.querySelectorAll('input[type="radio"][name="'+e+'"]')};if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)t=r(window.CSS.escape(e.name));else try{t=r(e.name)}catch(e){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",e.message),!1}var o=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]}(t,e.form);return!o||o===e}(e)},Ku=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return 0===n&&0===r},Ju=function(e,t){return!(t.disabled||function(e){return Xu(e)&&"hidden"===e.type}(t)||function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if("hidden"===getComputedStyle(e).visibility)return!0;var o=Fu.call(e,"details>summary:first-of-type")?e.parentElement:e;if(Fu.call(o,"details:not([open]) *"))return!0;var i=qu(e).host,a=(null==i?void 0:i.ownerDocument.contains(i))||e.ownerDocument.contains(e);if(n&&"full"!==n){if("non-zero-area"===n)return Ku(e)}else{if("function"==typeof r){for(var s=e;e;){var l=e.parentElement,c=qu(e);if(l&&!l.shadowRoot&&!0===r(l))return Ku(e);e=e.assignedSlot?e.assignedSlot:l||c===e.ownerDocument?l:c.host}e=s}if(a)return!e.getClientRects().length}return!1}(t,e)||function(e){return"DETAILS"===e.tagName&&Array.prototype.slice.apply(e.children).some((function(e){return"SUMMARY"===e.tagName}))}(t)||function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if("FIELDSET"===t.tagName&&t.disabled){for(var n=0;n<t.children.length;n++){var r=t.children.item(n);if("LEGEND"===r.tagName)return!!Fu.call(t,"fieldset[disabled] *")||!r.contains(e)}return!0}t=t.parentElement}return!1}(t))},Qu=function(e,t){return!(Yu(t)||Gu(t)<0||!Ju(e,t))},ep=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},tp=function e(t){var n=[],r=[];return t.forEach((function(t,o){var i=!!t.scope,a=i?t.scope:t,s=Gu(a,i),l=i?e(t.candidates):a;0===s?i?n.push.apply(n,l):n.push(a):r.push({documentOrder:o,tabIndex:s,item:t,isScope:i,content:l})})),r.sort(Uu).reduce((function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e}),[]).concat(n)},np=function(e,t){var n;return n=(t=t||{}).getShadowRoot?Wu([e],t.includeContainer,{filter:Qu.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:ep}):Zu(e,t.includeContainer,Qu.bind(null,t)),tp(n)},rp=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==Fu.call(e,Bu)&&Qu(t,e)},op=zu.concat("iframe").join(","),ip=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==Fu.call(e,op)&&Ju(t,e)};
2473
2478
  /*!
2474
2479
  * focus-trap 6.9.4
2475
2480
  * @license MIT, https://github.com/focus-trap/focus-trap/blob/master/LICENSE
2476
2481
  */
2477
- function ip(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ap(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ip(Object(n),!0).forEach((function(t){sp(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ip(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function sp(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var lp,cp=(lp=[],{activateTrap:function(e){if(lp.length>0){var t=lp[lp.length-1];t!==e&&t.pause()}var n=lp.indexOf(e);-1===n||lp.splice(n,1),lp.push(e)},deactivateTrap:function(e){var t=lp.indexOf(e);-1!==t&&lp.splice(t,1),lp.length>0&&lp[lp.length-1].unpause()}}),dp=function(e){return setTimeout(e,0)},up=function(e,t){var n=-1;return e.every((function(e,r){return!t(e)||(n=r,!1)})),n},pp=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return"function"==typeof e?e.apply(void 0,n):e},hp=function(e){return e.target.shadowRoot&&"function"==typeof e.composedPath?e.composedPath()[0]:e.target},fp=function(e,t){var n,r=(null==t?void 0:t.document)||document,o=ap({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0},t),i={containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,delayInitialFocusTimer:void 0},a=function(e,t,n){return e&&void 0!==e[t]?e[t]:o[n||t]},s=function(e){return i.containerGroups.findIndex((function(t){var n=t.container,r=t.tabbableNodes;return n.contains(e)||r.find((function(t){return t===e}))}))},l=function(e){var t=o[e];if("function"==typeof t){for(var n=arguments.length,i=new Array(n>1?n-1:0),a=1;a<n;a++)i[a-1]=arguments[a];t=t.apply(void 0,i)}if(!0===t&&(t=void 0),!t){if(void 0===t||!1===t)return t;throw new Error("`".concat(e,"` was specified but was not a node, or did not return a node"))}var s=t;if("string"==typeof t&&!(s=r.querySelector(t)))throw new Error("`".concat(e,"` as selector refers to no known node"));return s},c=function(){var e=l("initialFocus");if(!1===e)return!1;if(void 0===e)if(s(r.activeElement)>=0)e=r.activeElement;else{var t=i.tabbableGroups[0];e=t&&t.firstTabbableNode||l("fallbackFocus")}if(!e)throw new Error("Your focus-trap needs to have at least one focusable element");return e},d=function(){if(i.containerGroups=i.containers.map((function(e){var t,n,r=tp(e,o.tabbableOptions),i=(t=e,(n=(n=o.tabbableOptions)||{}).getShadowRoot?Zu([t],n.includeContainer,{filter:Ku.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):qu(t,n.includeContainer,Ku.bind(null,n)));return{container:e,tabbableNodes:r,focusableNodes:i,firstTabbableNode:r.length>0?r[0]:null,lastTabbableNode:r.length>0?r[r.length-1]:null,nextTabbableNode:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=i.findIndex((function(t){return t===e}));if(!(n<0))return t?i.slice(n+1).find((function(e){return np(e,o.tabbableOptions)})):i.slice(0,n).reverse().find((function(e){return np(e,o.tabbableOptions)}))}}})),i.tabbableGroups=i.containerGroups.filter((function(e){return e.tabbableNodes.length>0})),i.tabbableGroups.length<=0&&!l("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times")},u=function e(t){!1!==t&&t!==r.activeElement&&(t&&t.focus?(t.focus({preventScroll:!!o.preventScroll}),i.mostRecentlyFocusedNode=t,function(e){return e.tagName&&"input"===e.tagName.toLowerCase()&&"function"==typeof e.select}(t)&&t.select()):e(c()))},p=function(e){var t=l("setReturnFocus",e);return t||!1!==t&&e},h=function(e){var t=hp(e);s(t)>=0||(pp(o.clickOutsideDeactivates,e)?n.deactivate({returnFocus:o.returnFocusOnDeactivate&&!op(t,o.tabbableOptions)}):pp(o.allowOutsideClick,e)||e.preventDefault())},f=function(e){var t=hp(e),n=s(t)>=0;n||t instanceof Document?n&&(i.mostRecentlyFocusedNode=t):(e.stopImmediatePropagation(),u(i.mostRecentlyFocusedNode||c()))},g=function(e){if(function(e){return"Escape"===e.key||"Esc"===e.key||27===e.keyCode}(e)&&!1!==pp(o.escapeDeactivates,e))return e.preventDefault(),void n.deactivate();(function(e){return"Tab"===e.key||9===e.keyCode})(e)&&function(e){var t=hp(e);d();var n=null;if(i.tabbableGroups.length>0){var r=s(t),a=r>=0?i.containerGroups[r]:void 0;if(r<0)n=e.shiftKey?i.tabbableGroups[i.tabbableGroups.length-1].lastTabbableNode:i.tabbableGroups[0].firstTabbableNode;else if(e.shiftKey){var c=up(i.tabbableGroups,(function(e){var n=e.firstTabbableNode;return t===n}));if(c<0&&(a.container===t||op(t,o.tabbableOptions)&&!np(t,o.tabbableOptions)&&!a.nextTabbableNode(t,!1))&&(c=r),c>=0){var p=0===c?i.tabbableGroups.length-1:c-1;n=i.tabbableGroups[p].lastTabbableNode}}else{var h=up(i.tabbableGroups,(function(e){var n=e.lastTabbableNode;return t===n}));if(h<0&&(a.container===t||op(t,o.tabbableOptions)&&!np(t,o.tabbableOptions)&&!a.nextTabbableNode(t))&&(h=r),h>=0){var f=h===i.tabbableGroups.length-1?0:h+1;n=i.tabbableGroups[f].firstTabbableNode}}}else n=l("fallbackFocus");n&&(e.preventDefault(),u(n))}(e)},x=function(e){var t=hp(e);s(t)>=0||pp(o.clickOutsideDeactivates,e)||pp(o.allowOutsideClick,e)||(e.preventDefault(),e.stopImmediatePropagation())},m=function(){if(i.active)return cp.activateTrap(n),i.delayInitialFocusTimer=o.delayInitialFocus?dp((function(){u(c())})):u(c()),r.addEventListener("focusin",f,!0),r.addEventListener("mousedown",h,{capture:!0,passive:!1}),r.addEventListener("touchstart",h,{capture:!0,passive:!1}),r.addEventListener("click",x,{capture:!0,passive:!1}),r.addEventListener("keydown",g,{capture:!0,passive:!1}),n},v=function(){if(i.active)return r.removeEventListener("focusin",f,!0),r.removeEventListener("mousedown",h,!0),r.removeEventListener("touchstart",h,!0),r.removeEventListener("click",x,!0),r.removeEventListener("keydown",g,!0),n};return(n={get active(){return i.active},get paused(){return i.paused},activate:function(e){if(i.active)return this;var t=a(e,"onActivate"),n=a(e,"onPostActivate"),o=a(e,"checkCanFocusTrap");o||d(),i.active=!0,i.paused=!1,i.nodeFocusedBeforeActivation=r.activeElement,t&&t();var s=function(){o&&d(),m(),n&&n()};return o?(o(i.containers.concat()).then(s,s),this):(s(),this)},deactivate:function(e){if(!i.active)return this;var t=ap({onDeactivate:o.onDeactivate,onPostDeactivate:o.onPostDeactivate,checkCanReturnFocus:o.checkCanReturnFocus},e);clearTimeout(i.delayInitialFocusTimer),i.delayInitialFocusTimer=void 0,v(),i.active=!1,i.paused=!1,cp.deactivateTrap(n);var r=a(t,"onDeactivate"),s=a(t,"onPostDeactivate"),l=a(t,"checkCanReturnFocus"),c=a(t,"returnFocus","returnFocusOnDeactivate");r&&r();var d=function(){dp((function(){c&&u(p(i.nodeFocusedBeforeActivation)),s&&s()}))};return c&&l?(l(p(i.nodeFocusedBeforeActivation)).then(d,d),this):(d(),this)},pause:function(){return i.paused||!i.active||(i.paused=!0,v()),this},unpause:function(){return i.paused&&i.active?(i.paused=!1,d(),m(),this):this},updateContainerElements:function(e){var t=[].concat(e).filter(Boolean);return i.containers=t.map((function(e){return"string"==typeof e?r.querySelector(e):e})),i.active&&d(),this}}).updateContainerElements(e),n};var gp=!1;if("undefined"!=typeof window){var xp={get passive(){gp=!0}};window.addEventListener("testPassive",null,xp),window.removeEventListener("testPassive",null,xp)}var mp,vp="undefined"!=typeof window&&window.navigator&&window.navigator.platform&&(/iP(ad|hone|od)/.test(window.navigator.platform)||"MacIntel"===window.navigator.platform&&window.navigator.maxTouchPoints>1),bp=[],yp=!1,wp=-1,Cp=void 0,jp=void 0,kp=function(e){return bp.some((function(t){return!(!t.options.allowTouchMove||!t.options.allowTouchMove(e))}))},$p=function(e){var t=e||window.event;return!!kp(t.target)||(t.touches.length>1||(t.preventDefault&&t.preventDefault(),!1))},Sp=function(e,t){if(e){if(!bp.some((function(t){return t.targetElement===e}))){var n={targetElement:e,options:t||{}};bp=[].concat(function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}(bp),[n]),vp?(e.ontouchstart=function(e){1===e.targetTouches.length&&(wp=e.targetTouches[0].clientY)},e.ontouchmove=function(t){1===t.targetTouches.length&&function(e,t){var n=e.targetTouches[0].clientY-wp;!kp(e.target)&&(t&&0===t.scrollTop&&n>0||function(e){return!!e&&e.scrollHeight-e.scrollTop<=e.clientHeight}(t)&&n<0?$p(e):e.stopPropagation())}(t,e)},yp||(document.addEventListener("touchmove",$p,gp?{passive:!1}:void 0),yp=!0)):function(e){if(void 0===jp){var t=!!e&&!0===e.reserveScrollBarGap,n=window.innerWidth-document.documentElement.clientWidth;t&&n>0&&(jp=document.body.style.paddingRight,document.body.style.paddingRight=n+"px")}void 0===Cp&&(Cp=document.body.style.overflow,document.body.style.overflow="hidden")}(t)}}else console.error("disableBodyScroll unsuccessful - targetElement must be provided when calling disableBodyScroll on IOS devices.")},Ep=function(e){e?(bp=bp.filter((function(t){return t.targetElement!==e})),vp?(e.ontouchstart=null,e.ontouchmove=null,yp&&0===bp.length&&(document.removeEventListener("touchmove",$p,gp?{passive:!1}:void 0),yp=!1)):bp.length||(void 0!==jp&&(document.body.style.paddingRight=jp,jp=void 0),void 0!==Cp&&(document.body.style.overflow=Cp,Cp=void 0))):console.error("enableBodyScroll unsuccessful - targetElement must be provided when calling enableBodyScroll on IOS devices.")},Lp=[],Rp="ResizeObserver loop completed with undelivered notifications.";!function(e){e.BORDER_BOX="border-box",e.CONTENT_BOX="content-box",e.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"}(mp||(mp={}));var Tp,Op=function(e){return Object.freeze(e)},Pp=function(e,t){this.inlineSize=e,this.blockSize=t,Op(this)},Mp=function(){function e(e,t,n,r){return this.x=e,this.y=t,this.width=n,this.height=r,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,Op(this)}return e.prototype.toJSON=function(){var e=this;return{x:e.x,y:e.y,top:e.top,right:e.right,bottom:e.bottom,left:e.left,width:e.width,height:e.height}},e.fromRect=function(t){return new e(t.x,t.y,t.width,t.height)},e}(),_p=function(e){return e instanceof SVGElement&&"getBBox"in e},Ip=function(e){if(_p(e)){var t=e.getBBox(),n=t.width,r=t.height;return!n&&!r}var o=e,i=o.offsetWidth,a=o.offsetHeight;return!(i||a||e.getClientRects().length)},Dp=function(e){var t;if(e instanceof Element)return!0;var n=null===(t=null==e?void 0:e.ownerDocument)||void 0===t?void 0:t.defaultView;return!!(n&&e instanceof n.Element)},Ap="undefined"!=typeof window?window:{},Np=new WeakMap,Vp=/auto|scroll/,zp=/^tb|vertical/,Bp=/msie|trident/i.test(Ap.navigator&&Ap.navigator.userAgent),Hp=function(e){return parseFloat(e||"0")},Fp=function(e,t,n){return void 0===e&&(e=0),void 0===t&&(t=0),void 0===n&&(n=!1),new Pp((n?t:e)||0,(n?e:t)||0)},qp=Op({devicePixelContentBoxSize:Fp(),borderBoxSize:Fp(),contentBoxSize:Fp(),contentRect:new Mp(0,0,0,0)}),Zp=function(e,t){if(void 0===t&&(t=!1),Np.has(e)&&!t)return Np.get(e);if(Ip(e))return Np.set(e,qp),qp;var n=getComputedStyle(e),r=_p(e)&&e.ownerSVGElement&&e.getBBox(),o=!Bp&&"border-box"===n.boxSizing,i=zp.test(n.writingMode||""),a=!r&&Vp.test(n.overflowY||""),s=!r&&Vp.test(n.overflowX||""),l=r?0:Hp(n.paddingTop),c=r?0:Hp(n.paddingRight),d=r?0:Hp(n.paddingBottom),u=r?0:Hp(n.paddingLeft),p=r?0:Hp(n.borderTopWidth),h=r?0:Hp(n.borderRightWidth),f=r?0:Hp(n.borderBottomWidth),g=u+c,x=l+d,m=(r?0:Hp(n.borderLeftWidth))+h,v=p+f,b=s?e.offsetHeight-v-e.clientHeight:0,y=a?e.offsetWidth-m-e.clientWidth:0,w=o?g+m:0,C=o?x+v:0,j=r?r.width:Hp(n.width)-w-y,k=r?r.height:Hp(n.height)-C-b,$=j+g+y+m,S=k+x+b+v,E=Op({devicePixelContentBoxSize:Fp(Math.round(j*devicePixelRatio),Math.round(k*devicePixelRatio),i),borderBoxSize:Fp($,S,i),contentBoxSize:Fp(j,k,i),contentRect:new Mp(u,l,j,k)});return Np.set(e,E),E},Wp=function(e,t,n){var r=Zp(e,n),o=r.borderBoxSize,i=r.contentBoxSize,a=r.devicePixelContentBoxSize;switch(t){case mp.DEVICE_PIXEL_CONTENT_BOX:return a;case mp.BORDER_BOX:return o;default:return i}},Gp=function(e){var t=Zp(e);this.target=e,this.contentRect=t.contentRect,this.borderBoxSize=Op([t.borderBoxSize]),this.contentBoxSize=Op([t.contentBoxSize]),this.devicePixelContentBoxSize=Op([t.devicePixelContentBoxSize])},Up=function(e){if(Ip(e))return 1/0;for(var t=0,n=e.parentNode;n;)t+=1,n=n.parentNode;return t},Xp=function(){var e=1/0,t=[];Lp.forEach((function(n){if(0!==n.activeTargets.length){var r=[];n.activeTargets.forEach((function(t){var n=new Gp(t.target),o=Up(t.target);r.push(n),t.lastReportedSize=Wp(t.target,t.observedBox),o<e&&(e=o)})),t.push((function(){n.callback.call(n.observer,r,n.observer)})),n.activeTargets.splice(0,n.activeTargets.length)}}));for(var n=0,r=t;n<r.length;n++){(0,r[n])()}return e},Yp=function(e){Lp.forEach((function(t){t.activeTargets.splice(0,t.activeTargets.length),t.skippedTargets.splice(0,t.skippedTargets.length),t.observationTargets.forEach((function(n){n.isActive()&&(Up(n.target)>e?t.activeTargets.push(n):t.skippedTargets.push(n))}))}))},Kp=function(){var e=0;for(Yp(e);Lp.some((function(e){return e.activeTargets.length>0}));)e=Xp(),Yp(e);return Lp.some((function(e){return e.skippedTargets.length>0}))&&function(){var e;"function"==typeof ErrorEvent?e=new ErrorEvent("error",{message:Rp}):((e=document.createEvent("Event")).initEvent("error",!1,!1),e.message=Rp),window.dispatchEvent(e)}(),e>0},Jp=[],Qp=function(e){if(!Tp){var t=0,n=document.createTextNode("");new MutationObserver((function(){return Jp.splice(0).forEach((function(e){return e()}))})).observe(n,{characterData:!0}),Tp=function(){n.textContent="".concat(t?t--:t++)}}Jp.push(e),Tp()},eh=0,th={attributes:!0,characterData:!0,childList:!0,subtree:!0},nh=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],rh=function(e){return void 0===e&&(e=0),Date.now()+e},oh=!1,ih=new(function(){function e(){var e=this;this.stopped=!0,this.listener=function(){return e.schedule()}}return e.prototype.run=function(e){var t=this;if(void 0===e&&(e=250),!oh){oh=!0;var n,r=rh(e);n=function(){var n=!1;try{n=Kp()}finally{if(oh=!1,e=r-rh(),!eh)return;n?t.run(1e3):e>0?t.run(e):t.start()}},Qp((function(){requestAnimationFrame(n)}))}},e.prototype.schedule=function(){this.stop(),this.run()},e.prototype.observe=function(){var e=this,t=function(){return e.observer&&e.observer.observe(document.body,th)};document.body?t():Ap.addEventListener("DOMContentLoaded",t)},e.prototype.start=function(){var e=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),nh.forEach((function(t){return Ap.addEventListener(t,e.listener,!0)})))},e.prototype.stop=function(){var e=this;this.stopped||(this.observer&&this.observer.disconnect(),nh.forEach((function(t){return Ap.removeEventListener(t,e.listener,!0)})),this.stopped=!0)},e}()),ah=function(e){!eh&&e>0&&ih.start(),!(eh+=e)&&ih.stop()},sh=function(){function e(e,t){this.target=e,this.observedBox=t||mp.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return e.prototype.isActive=function(){var e=Wp(this.target,this.observedBox,!0);return function(e){return!_p(e)&&!function(e){switch(e.tagName){case"INPUT":if("image"!==e.type)break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1}(e)&&"inline"===getComputedStyle(e).display}(this.target)&&(this.lastReportedSize=e),this.lastReportedSize.inlineSize!==e.inlineSize||this.lastReportedSize.blockSize!==e.blockSize},e}(),lh=function(e,t){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=e,this.callback=t},ch=new WeakMap,dh=function(e,t){for(var n=0;n<e.length;n+=1)if(e[n].target===t)return n;return-1},uh=function(){function e(){}return e.connect=function(e,t){var n=new lh(e,t);ch.set(e,n)},e.observe=function(e,t,n){var r=ch.get(e),o=0===r.observationTargets.length;dh(r.observationTargets,t)<0&&(o&&Lp.push(r),r.observationTargets.push(new sh(t,n&&n.box)),ah(1),ih.schedule())},e.unobserve=function(e,t){var n=ch.get(e),r=dh(n.observationTargets,t),o=1===n.observationTargets.length;r>=0&&(o&&Lp.splice(Lp.indexOf(n),1),n.observationTargets.splice(r,1),ah(-1))},e.disconnect=function(e){var t=this,n=ch.get(e);n.observationTargets.slice().forEach((function(n){return t.unobserve(e,n.target)})),n.activeTargets.splice(0,n.activeTargets.length)},e}(),ph=function(){function e(e){if(0===arguments.length)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if("function"!=typeof e)throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");uh.connect(this,e)}return e.prototype.observe=function(e,t){if(0===arguments.length)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!Dp(e))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");uh.observe(this,e,t)},e.prototype.unobserve=function(e){if(0===arguments.length)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!Dp(e))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");uh.unobserve(this,e)},e.prototype.disconnect=function(){uh.disconnect(this)},e.toString=function(){return"function ResizeObserver () { [polyfill code] }"},e}();function hh(){return hh=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},hh.apply(this,arguments)}function fh(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)t.indexOf(n=i[r])>=0||(o[n]=e[n]);return o}var gh="undefined"!=typeof window?n.useLayoutEffect:n.useEffect;function xh(e,t,n){return t=(t=+t)==t?t:0,n=(n=+n)==n?n:0,(e=+e)==e&&(e=(e=e<=n?e:n)>=t?e:t),e}function mh(e){var t=Math.round(e);if(Number.isNaN(e))throw new TypeError("Found a NaN! Check your snapPoints / defaultSnap / snapTo ");return t}var vh={box:"border-box"};function bh(e,t){var r=t.label,o=t.enabled,i=t.resizeSourceRef,a=n.useState(0),s=a[0],l=a[1];n.useDebugValue(r+": "+s);var c=n.useCallback((function(e){l(e[0].borderBoxSize[0].blockSize),i.current="element"}),[i]);return gh((function(){if(e.current&&o){var t=new ph(c);return t.observe(e.current,vh),function(){t.disconnect()}}}),[e,c,o]),o?s:0}function yh(e){return void 0===e&&(e=1e3),new Promise((function(t){return setTimeout(t,e)}))}var wh={DRAG:{target:"#overlay.dragging",actions:"onOpenEnd"}},Ch={RESIZE:{target:"#overlay.resizing",actions:"onOpenEnd"}},jh=function(e,t,n){return void 0===n&&(n=e.context),new Ec(e,t,n)}({id:"overlay",initial:"closed",context:{initialState:"CLOSED"},states:{closed:{on:{OPEN:"opening",CLOSE:void 0}},opening:{initial:"start",states:{start:{invoke:{src:"onOpenStart",onDone:"transition"}},transition:{always:[{target:"immediately",cond:"initiallyOpen"},{target:"smoothly",cond:"initiallyClosed"}]},immediately:{initial:"open",states:{open:{invoke:{src:"openImmediately",onDone:"activating"}},activating:{invoke:{src:"activate",onDone:"#overlay.opening.end"},on:hh({},wh,Ch)}}},smoothly:{initial:"visuallyHidden",states:{visuallyHidden:{invoke:{src:"renderVisuallyHidden",onDone:"activating"}},activating:{invoke:{src:"activate",onDone:"open"}},open:{invoke:{src:"openSmoothly",onDone:"#overlay.opening.end"},on:hh({},wh,Ch)}}},end:{invoke:{src:"onOpenEnd",onDone:"done"},on:{CLOSE:"#overlay.closing",DRAG:"#overlay.dragging"}},done:{type:"final"}},on:hh({},{CLOSE:{target:"#overlay.closing",actions:"onOpenCancel"}}),onDone:"open"},open:{on:{DRAG:"#overlay.dragging",SNAP:"snapping",RESIZE:"resizing"}},dragging:{on:{SNAP:"snapping"}},snapping:{initial:"start",states:{start:{invoke:{src:"onSnapStart",onDone:"snappingSmoothly"},entry:[Rc({y:function(e,t){return t.payload.y},velocity:function(e,t){return t.payload.velocity},snapSource:function(e,t){var n=t.payload.source;return void 0===n?"custom":n}})]},snappingSmoothly:{invoke:{src:"snapSmoothly",onDone:"end"}},end:{invoke:{src:"onSnapEnd",onDone:"done"},on:{RESIZE:"#overlay.resizing",SNAP:"#overlay.snapping",CLOSE:"#overlay.closing",DRAG:"#overlay.dragging"}},done:{type:"final"}},on:{SNAP:{target:"snapping",actions:"onSnapEnd"},RESIZE:{target:"#overlay.resizing",actions:"onSnapCancel"},DRAG:{target:"#overlay.dragging",actions:"onSnapCancel"},CLOSE:{target:"#overlay.closing",actions:"onSnapCancel"}},onDone:"open"},resizing:{initial:"start",states:{start:{invoke:{src:"onResizeStart",onDone:"resizingSmoothly"}},resizingSmoothly:{invoke:{src:"resizeSmoothly",onDone:"end"}},end:{invoke:{src:"onResizeEnd",onDone:"done"},on:{SNAP:"#overlay.snapping",CLOSE:"#overlay.closing",DRAG:"#overlay.dragging"}},done:{type:"final"}},on:{RESIZE:{target:"resizing",actions:"onResizeEnd"},SNAP:{target:"snapping",actions:"onResizeCancel"},DRAG:{target:"#overlay.dragging",actions:"onResizeCancel"},CLOSE:{target:"#overlay.closing",actions:"onResizeCancel"}},onDone:"open"},closing:{initial:"start",states:{start:{invoke:{src:"onCloseStart",onDone:"deactivating"},on:{OPEN:{target:"#overlay.open",actions:"onCloseCancel"}}},deactivating:{invoke:{src:"deactivate",onDone:"closingSmoothly"}},closingSmoothly:{invoke:{src:"closeSmoothly",onDone:"end"}},end:{invoke:{src:"onCloseEnd",onDone:"done"},on:{OPEN:{target:"#overlay.opening",actions:"onCloseCancel"}}},done:{type:"final"}},on:{CLOSE:void 0,OPEN:{target:"#overlay.opening",actions:"onCloseCancel"}},onDone:"closed"}},on:{CLOSE:"closing"}},{actions:{onOpenCancel:function(e,t){},onSnapCancel:function(e,t){},onResizeCancel:function(e,t){},onCloseCancel:function(e,t){},onOpenEnd:function(e,t){},onSnapEnd:function(e,t){},onRezizeEnd:function(e,t){}},services:{onSnapStart:function(){try{return Promise.resolve(yh()).then((function(){}))}catch(e){return Promise.reject(e)}},onOpenStart:function(){try{return Promise.resolve(yh()).then((function(){}))}catch(e){return Promise.reject(e)}},onCloseStart:function(){try{return Promise.resolve(yh()).then((function(){}))}catch(e){return Promise.reject(e)}},onResizeStart:function(){try{return Promise.resolve(yh()).then((function(){}))}catch(e){return Promise.reject(e)}},onSnapEnd:function(){try{return Promise.resolve(yh()).then((function(){}))}catch(e){return Promise.reject(e)}},onOpenEnd:function(){try{return Promise.resolve(yh()).then((function(){}))}catch(e){return Promise.reject(e)}},onCloseEnd:function(){try{return Promise.resolve(yh()).then((function(){}))}catch(e){return Promise.reject(e)}},onResizeEnd:function(){try{return Promise.resolve(yh()).then((function(){}))}catch(e){return Promise.reject(e)}},renderVisuallyHidden:function(e,t){try{return Promise.resolve(yh()).then((function(){}))}catch(e){return Promise.reject(e)}},activate:function(e,t){try{return Promise.resolve(yh()).then((function(){}))}catch(e){return Promise.reject(e)}},deactivate:function(e,t){try{return Promise.resolve(yh()).then((function(){}))}catch(e){return Promise.reject(e)}},openSmoothly:function(e,t){try{return Promise.resolve(yh()).then((function(){}))}catch(e){return Promise.reject(e)}},openImmediately:function(e,t){try{return Promise.resolve(yh()).then((function(){}))}catch(e){return Promise.reject(e)}},snapSmoothly:function(e,t){try{return Promise.resolve(yh()).then((function(){}))}catch(e){return Promise.reject(e)}},resizeSmoothly:function(e,t){try{return Promise.resolve(yh()).then((function(){}))}catch(e){return Promise.reject(e)}},closeSmoothly:function(e,t){try{return Promise.resolve(yh()).then((function(){}))}catch(e){return Promise.reject(e)}}},guards:{initiallyClosed:function(e){return"CLOSED"===e.initialState},initiallyOpen:function(e){return"OPEN"===e.initialState}}}),kh=["children","sibling","className","footer","header","open","initialState","lastSnapRef","initialFocusRef","onDismiss","maxHeight","defaultSnap","snapPoints","blocking","scrollLocking","style","onSpringStart","onSpringCancel","onSpringEnd","reserveScrollBarGap","expandOnContentDrag"],$h=["velocity"],Sh=["onRest","config"],Eh={tension:170,friction:26},Lh=Eh.tension,Rh=Eh.friction,Th=n.forwardRef((function(e,t){var r=e.children,o=e.sibling,i=e.className,a=e.footer,s=e.header,l=e.open,c=e.initialState,d=e.lastSnapRef,u=e.initialFocusRef,p=e.onDismiss,h=e.maxHeight,f=e.defaultSnap,g=void 0===f?Ph:f,x=e.snapPoints,m=void 0===x?Mh:x,v=e.blocking,b=void 0===v||v,y=e.scrollLocking,w=void 0===y||y,C=e.style,j=e.onSpringStart,k=e.onSpringCancel,$=e.onSpringEnd,S=e.reserveScrollBarGap,E=void 0===S?b:S,L=e.expandOnContentDrag,R=void 0!==L&&L,T=fh(e,kh),O=function(){var e=n.useState(!1),t=e[0],r=e[1],o=n.useState({}),i=o[0],a=o[1],s=n.useCallback((function(e){return a((function(t){var n;return hh({},t,((n={})[e]=!1,n))})),function(){a((function(t){var n;return hh({},t,((n={})[e]=!0,n))}))}}),[]);return n.useEffect((function(){var e=Object.values(i);0!==e.length&&e.every(Boolean)&&r(!0)}),[i]),{ready:t,registerReady:s}}(),P=O.ready,M=O.registerReady,_=n.useRef(!1),I=n.useRef(j),D=n.useRef(k),A=n.useRef($);n.useEffect((function(){I.current=j,D.current=k,A.current=$}),[k,j,$]);var N,V,z=md((function(){return{y:0,ready:0,maxHeight:0,minSnap:0,maxSnap:0}})),B=z[0],H=z[1],F=n.useRef(null),q=n.useRef(null),Z=n.useRef(null),W=n.useRef(null),G=n.useRef(null),U=n.useRef(null),X=n.useRef(0),Y=n.useRef(),K=n.useRef(!1),J=(N=n.useMemo((function(){return"undefined"!=typeof window?window.matchMedia("(prefers-reduced-motion: reduce)"):null}),[]),V=n.useRef(null==N?void 0:N.matches),n.useDebugValue(V.current?"reduce":"no-preference"),n.useEffect((function(){var e=function(e){V.current=e.matches};return null==N||N.addListener(e),function(){return null==N?void 0:N.removeListener(e)}}),[N]),V),Q=function(e){var t=e.targetRef,r=e.enabled,o=e.reserveScrollBarGap,i=n.useRef({activate:function(){throw new TypeError("Tried to activate scroll lock too early")},deactivate:function(){}});return n.useDebugValue(r?"Enabled":"Disabled"),n.useEffect((function(){if(!r)return i.current.deactivate(),void(i.current={activate:function(){},deactivate:function(){}});var e=t.current,n=!1;i.current={activate:function(){n||(n=!0,Sp(e,{allowTouchMove:function(e){return e.closest("[data-body-scroll-lock-ignore]")},reserveScrollBarGap:o}))},deactivate:function(){n&&(n=!1,Ep(e))}}}),[r,t,o]),i}({targetRef:q,enabled:P&&w,reserveScrollBarGap:E}),ee=function(e){var t=e.targetRef,r=e.enabled,o=n.useRef({activate:function(){throw new TypeError("Tried to activate aria hider too early")},deactivate:function(){}});return n.useDebugValue(r?"Enabled":"Disabled"),n.useEffect((function(){if(!r)return o.current.deactivate(),void(o.current={activate:function(){},deactivate:function(){}});var e=t.current,n=!1,i=[],a=[];o.current={activate:function(){if(!n){n=!0;var t=e.parentNode;document.querySelectorAll("body > *").forEach((function(e){if(e!==t){var n=e.getAttribute("aria-hidden");null!==n&&"false"!==n||(i.push(n),a.push(e),e.setAttribute("aria-hidden","true"))}}))}},deactivate:function(){n&&(n=!1,a.forEach((function(e,t){var n=i[t];null===n?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",n)})),i=[],a=[])}}}),[t,r]),o}({targetRef:F,enabled:P&&b}),te=function(e){var t=e.targetRef,r=e.fallbackRef,o=e.initialFocusRef,i=e.enabled,a=n.useRef({activate:function(){throw new TypeError("Tried to activate focus trap too early")},deactivate:function(){}});return n.useDebugValue(i?"Enabled":"Disabled"),n.useEffect((function(){if(!i)return a.current.deactivate(),void(a.current={activate:function(){},deactivate:function(){}});var e=r.current,n=fp(t.current,{onActivate:void 0,initialFocus:o?function(){return(null==o?void 0:o.current)||e}:void 0,fallbackFocus:e,escapeDeactivates:!1,clickOutsideDeactivates:!1}),s=!1;a.current={activate:function(){try{return s?Promise.resolve():(s=!0,Promise.resolve(n.activate()).then((function(){return Promise.resolve(new Promise((function(e){return setTimeout((function(){return e(void 0)}),0)}))).then((function(){}))})))}catch(e){return Promise.reject(e)}},deactivate:function(){s&&(s=!1,n.deactivate())}}}),[i,r,o,t]),a}({targetRef:F,fallbackRef:U,initialFocusRef:u||void 0,enabled:P&&b&&!1!==u}),ne=function(e){var t=e.getSnapPoints,r=e.heightRef,o=e.lastSnapRef,i=e.ready,a=function(e){var t=e.contentRef,r=e.controlledMaxHeight,o=e.footerEnabled,i=e.footerRef,a=e.headerEnabled,s=e.headerRef,l=e.registerReady,c=e.resizeSourceRef,d=n.useMemo((function(){return l("contentHeight")}),[l]),u=function(e,t,r){var o=n.useMemo((function(){return t("maxHeight")}),[t]),i=n.useState((function(){return mh(e)||"undefined"!=typeof window?window.innerHeight:0})),a=i[0],s=i[1],l=a>0,c=n.useRef(0);return n.useDebugValue(e?"controlled":"auto"),n.useEffect((function(){l&&o()}),[l,o]),gh((function(){if(e)return s(mh(e)),void(r.current="maxheightprop");var t=function(){c.current||(c.current=requestAnimationFrame((function(){s(window.innerHeight),r.current="window",c.current=0})))};return window.addEventListener("resize",t),s(window.innerHeight),r.current="window",o(),function(){window.removeEventListener("resize",t),cancelAnimationFrame(c.current)}}),[e,o,r]),a}(r,l,c),p=bh(s,{label:"headerHeight",enabled:a,resizeSourceRef:c}),h=bh(t,{label:"contentHeight",enabled:!0,resizeSourceRef:c}),f=bh(i,{label:"footerHeight",enabled:o,resizeSourceRef:c}),g=Math.min(u-p-f,h)+p+f;n.useDebugValue("minHeight: "+g);var x=h>0;return n.useEffect((function(){x&&d()}),[x,d]),{maxHeight:u,minHeight:g,headerHeight:p,footerHeight:f}}({contentRef:e.contentRef,controlledMaxHeight:e.controlledMaxHeight,footerEnabled:e.footerEnabled,footerRef:e.footerRef,headerEnabled:e.headerEnabled,headerRef:e.headerRef,registerReady:e.registerReady,resizeSourceRef:e.resizeSourceRef}),s=a.maxHeight,l=a.minHeight,c=a.headerHeight,d=a.footerHeight,u=function(e,t){var n=[].concat(e).map(mh).reduce((function(e,n){return e.add(xh(n,0,t)),e}),new Set),r=Array.from(n),o=Math.min.apply(Math,r);if(Number.isNaN(o))throw new TypeError("minSnap is NaN");var i=Math.max.apply(Math,r);if(Number.isNaN(i))throw new TypeError("maxSnap is NaN");return{snapPoints:r,minSnap:o,maxSnap:i}}(i?t({height:r.current,footerHeight:d,headerHeight:c,minHeight:l,maxHeight:s}):[0],s),p=u.snapPoints,h=u.minSnap,f=u.maxSnap;return n.useDebugValue("minSnap: "+h+", maxSnap:"+f),{minSnap:h,maxSnap:f,findSnap:function(e){var t=mh("function"==typeof e?e({footerHeight:d,headerHeight:c,height:r.current,minHeight:l,maxHeight:s,snapPoints:p,lastSnap:o.current}):e);return p.reduce((function(e,n){return Math.abs(n-t)<Math.abs(e-t)?n:e}),h)},maxHeight:s}}({contentRef:Z,controlledMaxHeight:h,footerEnabled:!!a,footerRef:G,getSnapPoints:m,headerEnabled:!1!==s,headerRef:W,heightRef:X,lastSnapRef:d,ready:P,registerReady:M,resizeSourceRef:Y}),re=ne.minSnap,oe=ne.maxSnap,ie=ne.maxHeight,ae=ne.findSnap,se=n.useRef(ie),le=n.useRef(re),ce=n.useRef(oe),de=n.useRef(ae),ue=n.useRef(0);gh((function(){se.current=ie,ce.current=oe,le.current=re,de.current=ae,ue.current=ae(g)}),[ae,g,ie,oe,re]);var pe=n.useCallback((function(e){var t=e.onRest,n=e.config,r=(n=void 0===n?{}:n).velocity,o=void 0===r?1:r,i=fh(n,$h),a=fh(e,Sh);return new Promise((function(e){return H(hh({},a,{config:hh({velocity:o},i,{mass:1,tension:Lh,friction:Math.max(Rh,Rh+(Rh-Rh*o))}),onRest:function(){var n=[].slice.call(arguments);e.apply(void 0,n),null==t||t.apply(void 0,n)}}))}))}),[H]),he=Hc(jh,{devTools:!1,actions:{onOpenCancel:n.useCallback((function(){return null==D.current?void 0:D.current({type:"OPEN"})}),[]),onSnapCancel:n.useCallback((function(e){return null==D.current?void 0:D.current({type:"SNAP",source:e.snapSource})}),[]),onCloseCancel:n.useCallback((function(){return null==D.current?void 0:D.current({type:"CLOSE"})}),[]),onResizeCancel:n.useCallback((function(){return null==D.current?void 0:D.current({type:"RESIZE",source:Y.current})}),[]),onOpenEnd:n.useCallback((function(){return null==A.current?void 0:A.current({type:"OPEN"})}),[]),onSnapEnd:n.useCallback((function(e,t){return null==A.current?void 0:A.current({type:"SNAP",source:e.snapSource})}),[]),onResizeEnd:n.useCallback((function(){return null==A.current?void 0:A.current({type:"RESIZE",source:Y.current})}),[])},context:{initialState:c},services:{onSnapStart:n.useCallback((function(e,t){try{return Promise.resolve(null==I.current?void 0:I.current({type:"SNAP",source:t.payload.source||"custom"}))}catch(e){return Promise.reject(e)}}),[]),onOpenStart:n.useCallback((function(){try{return Promise.resolve(null==I.current?void 0:I.current({type:"OPEN"}))}catch(e){return Promise.reject(e)}}),[]),onCloseStart:n.useCallback((function(){try{return Promise.resolve(null==I.current?void 0:I.current({type:"CLOSE"}))}catch(e){return Promise.reject(e)}}),[]),onResizeStart:n.useCallback((function(){try{return Promise.resolve(null==I.current?void 0:I.current({type:"RESIZE",source:Y.current}))}catch(e){return Promise.reject(e)}}),[]),onSnapEnd:n.useCallback((function(e,t){try{return Promise.resolve(null==A.current?void 0:A.current({type:"SNAP",source:e.snapSource}))}catch(e){return Promise.reject(e)}}),[]),onOpenEnd:n.useCallback((function(){try{return Promise.resolve(null==A.current?void 0:A.current({type:"OPEN"}))}catch(e){return Promise.reject(e)}}),[]),onCloseEnd:n.useCallback((function(){try{return Promise.resolve(null==A.current?void 0:A.current({type:"CLOSE"}))}catch(e){return Promise.reject(e)}}),[]),onResizeEnd:n.useCallback((function(){try{return Promise.resolve(null==A.current?void 0:A.current({type:"RESIZE",source:Y.current}))}catch(e){return Promise.reject(e)}}),[]),renderVisuallyHidden:n.useCallback((function(e,t){try{return Promise.resolve(pe({y:ue.current,ready:0,maxHeight:se.current,maxSnap:ce.current,minSnap:ue.current,immediate:!0})).then((function(){}))}catch(e){return Promise.reject(e)}}),[pe]),activate:n.useCallback((function(e,t){try{return _.current=!0,Promise.resolve(Promise.all([Q.current.activate(),te.current.activate(),ee.current.activate()])).then((function(){}))}catch(e){return Promise.reject(e)}}),[ee,te,Q]),deactivate:n.useCallback((function(){try{return Q.current.deactivate(),te.current.deactivate(),ee.current.deactivate(),_.current=!1,Promise.resolve()}catch(e){return Promise.reject(e)}}),[ee,te,Q]),openImmediately:n.useCallback((function(){try{return X.current=ue.current,Promise.resolve(pe({y:ue.current,ready:1,maxHeight:se.current,maxSnap:ce.current,minSnap:ue.current,immediate:!0})).then((function(){}))}catch(e){return Promise.reject(e)}}),[pe]),openSmoothly:n.useCallback((function(){try{return Promise.resolve(pe({y:0,ready:1,maxHeight:se.current,maxSnap:ce.current,minSnap:ue.current,immediate:!0})).then((function(){return X.current=ue.current,Promise.resolve(pe({y:ue.current,ready:1,maxHeight:se.current,maxSnap:ce.current,minSnap:ue.current,immediate:J.current})).then((function(){}))}))}catch(e){return Promise.reject(e)}}),[pe,J]),snapSmoothly:n.useCallback((function(e,t){try{var n=de.current(e.y);return X.current=n,d.current=n,Promise.resolve(pe({y:n,ready:1,maxHeight:se.current,maxSnap:ce.current,minSnap:le.current,immediate:J.current,config:{velocity:e.velocity}})).then((function(){}))}catch(e){return Promise.reject(e)}}),[pe,d,J]),resizeSmoothly:n.useCallback((function(){try{var e=de.current(X.current);return X.current=e,d.current=e,Promise.resolve(pe({y:e,ready:1,maxHeight:se.current,maxSnap:ce.current,minSnap:le.current,immediate:"element"!==Y.current||J.current})).then((function(){}))}catch(e){return Promise.reject(e)}}),[pe,d,J]),closeSmoothly:n.useCallback((function(e,t){try{return pe({minSnap:X.current,immediate:!0}),X.current=0,Promise.resolve(pe({y:0,maxHeight:se.current,maxSnap:ce.current,immediate:J.current})).then((function(){return Promise.resolve(pe({ready:0,immediate:!0})).then((function(){}))}))}catch(e){return Promise.reject(e)}}),[pe,J])}}),fe=he[0],ge=he[1];n.useEffect((function(){P&&ge(l?"OPEN":"CLOSE")}),[l,ge,P]),gh((function(){(ie||oe||re)&&ge("RESIZE")}),[ie,oe,re,ge]),n.useEffect((function(){return function(){Q.current.deactivate(),te.current.deactivate(),ee.current.deactivate()}}),[ee,te,Q]),n.useImperativeHandle(t,(function(){return{snapTo:function(e,t){var n=void 0===t?{}:t,r=n.velocity,o=void 0===r?1:r,i=n.source,a=void 0===i?"custom":i;ge("SNAP",{payload:{y:de.current(e),velocity:o,source:a}})},get height(){return X.current}}}),[ge]),n.useEffect((function(){var e=q.current,t=function(e){K.current&&e.preventDefault()},n=function(t){e.scrollTop<0&&(requestAnimationFrame((function(){e.style.overflow="hidden",e.scrollTop=0,e.style.removeProperty("overflow")})),t.preventDefault())};return R&&(e.addEventListener("scroll",t),e.addEventListener("touchmove",t),e.addEventListener("touchstart",n)),function(){e.removeEventListener("scroll",t),e.removeEventListener("touchmove",t),e.removeEventListener("touchstart",n)}}),[R,q]);var xe=Nu((function(e){var t=e.args,n=(t=void 0===t?[]:t)[0],r=(n=void 0===n?{}:n).closeOnTap,o=void 0!==r&&r,i=n.isContentDragging,a=void 0!==i&&i,s=e.cancel,l=e.direction[1],c=e.down,d=e.first,u=e.last,h=e.memo,f=void 0===h?B.y.getValue():h,g=e.tap,x=e.velocity,m=-1*e.movement[1];if(!_.current)return s(),f;if(p&&o&&g)return s(),setTimeout((function(){return p()}),0),f;if(g)return f;var v=f+m,b=m*x,y=Math.max(le.current,Math.min(ce.current,v+2*b));if(!c&&p&&l>0&&v+b<le.current/2)return s(),p(),f;var w=c?p||le.current!==ce.current?Qd(v,p?0:le.current,ce.current,.55):v<le.current?Qd(v,le.current,2*ce.current,.55):Qd(v,le.current/2,ce.current,.55):y;return R&&a?(w>=ce.current&&(w=ce.current),f===ce.current&&q.current.scrollTop>0&&(w=ce.current),K.current=w<ce.current):K.current=!1,d&&ge("DRAG"),u?(ge("SNAP",{payload:{y:w,velocity:x>.05?x:1,source:"dragging"}}),f):(H({y:w,ready:1,maxHeight:se.current,maxSnap:ce.current,minSnap:le.current,immediate:!0,config:{velocity:x}}),f)}),{filterTaps:!0});if(Number.isNaN(ce.current))throw new TypeError("maxSnapRef is NaN!!");if(Number.isNaN(le.current))throw new TypeError("minSnapRef is NaN!!");var me=function(e){var t,n=e.spring,r=ud([n.y,n.maxHeight],(function(e,t){return Math.round(xh(t-e,0,16))+"px"})),o=ud([n.y,n.minSnap,n.maxSnap],(function(e,t,n){return xh(e,t,n)+"px"})),i=ud([n.y,n.minSnap,n.maxSnap],(function(e,t,n){return e<t?t-e+"px":e>n?n-e+"px":"0px"})),a=ud([n.y,n.maxSnap],(function(e,t){return e>=t?Math.ceil(e-t):0})),s=ud([n.y,n.minSnap],(function(e,t){if(!t)return 0;var n=Math.max(t/2-45,0);return xh((e-n)*(1/(Math.min(t/2+45,t)-n)+0),0,1)})),l=ud([n.y,n.minSnap],(function(e,t){return t?xh(e/t,0,1):0}));return(t={})["--rsbs-content-opacity"]=s,t["--rsbs-backdrop-opacity"]=l,t["--rsbs-antigap-scale-y"]=a,t["--rsbs-overlay-translate-y"]=i,t["--rsbs-overlay-rounded"]=r,t["--rsbs-overlay-h"]=o,t}({spring:B});return n.createElement(Gd.div,hh({},T,{"data-rsbs-root":!0,"data-rsbs-state":Oh.find(fe.matches),"data-rsbs-is-blocking":b,"data-rsbs-is-dismissable":!!p,"data-rsbs-has-header":!!s,"data-rsbs-has-footer":!!a,className:i,ref:F,style:hh({},me,C,{opacity:B.ready})}),o,b&&n.createElement("div",hh({key:"backdrop","data-rsbs-backdrop":!0},xe({closeOnTap:!0}))),n.createElement("div",{key:"overlay","aria-modal":"true",role:"dialog","data-rsbs-overlay":!0,tabIndex:-1,ref:U,onKeyDown:function(e){"Escape"===e.key&&(e.stopPropagation(),p&&p())}},!1!==s&&n.createElement("div",hh({key:"header","data-rsbs-header":!0,ref:W},xe()),s),n.createElement("div",hh({key:"scroll","data-rsbs-scroll":!0,ref:q},R?xe({isContentDragging:!0}):{}),n.createElement("div",{"data-rsbs-content":!0,ref:Z},r)),a&&n.createElement("div",hh({key:"footer",ref:G,"data-rsbs-footer":!0},xe()),a)))})),Oh=["closed","opening","open","closing","dragging","snapping","resizing"];function Ph(e){var t=e.lastSnap;return null!=t?t:Math.min.apply(Math,e.snapPoints)}function Mh(e){return e.minHeight}var _h=["onSpringStart","onSpringEnd","skipInitialTransition"],Ih=n.forwardRef((function(e,t){var r=e.onSpringStart,o=e.onSpringEnd,i=e.skipInitialTransition,a=fh(e,_h),s=n.useState(!1),l=s[0],c=s[1],d=n.useRef(),u=n.useRef(null),p=n.useRef(i&&a.open?"OPEN":"CLOSED");gh((function(){if(a.open)return cancelAnimationFrame(d.current),c(!0),function(){p.current="CLOSED"}}),[a.open]);var h=n.useCallback((function(e){return Promise.resolve(null==r?void 0:r(e)).then((function(){"OPEN"===e.type&&cancelAnimationFrame(d.current)}))}),[r]),f=n.useCallback((function(e){return Promise.resolve(null==o?void 0:o(e)).then((function(){"CLOSE"===e.type&&(d.current=requestAnimationFrame((function(){return c(!1)})))}))}),[o]);return l?n.createElement(Os,{"data-rsbs-portal":!0},n.createElement(Th,hh({},a,{lastSnapRef:u,ref:t,initialState:p.current,onSpringStart:h,onSpringEnd:f}))):null}));const Dh=o.css`
2478
- width: 40px;
2479
- border-radius: 4px;
2482
+ function ap(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function sp(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ap(Object(n),!0).forEach((function(t){lp(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ap(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function lp(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var cp,dp=(cp=[],{activateTrap:function(e){if(cp.length>0){var t=cp[cp.length-1];t!==e&&t.pause()}var n=cp.indexOf(e);-1===n||cp.splice(n,1),cp.push(e)},deactivateTrap:function(e){var t=cp.indexOf(e);-1!==t&&cp.splice(t,1),cp.length>0&&cp[cp.length-1].unpause()}}),up=function(e){return setTimeout(e,0)},pp=function(e,t){var n=-1;return e.every((function(e,r){return!t(e)||(n=r,!1)})),n},hp=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return"function"==typeof e?e.apply(void 0,n):e},fp=function(e){return e.target.shadowRoot&&"function"==typeof e.composedPath?e.composedPath()[0]:e.target},gp=function(e,t){var n,r=(null==t?void 0:t.document)||document,o=sp({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0},t),i={containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,delayInitialFocusTimer:void 0},a=function(e,t,n){return e&&void 0!==e[t]?e[t]:o[n||t]},s=function(e){return i.containerGroups.findIndex((function(t){var n=t.container,r=t.tabbableNodes;return n.contains(e)||r.find((function(t){return t===e}))}))},l=function(e){var t=o[e];if("function"==typeof t){for(var n=arguments.length,i=new Array(n>1?n-1:0),a=1;a<n;a++)i[a-1]=arguments[a];t=t.apply(void 0,i)}if(!0===t&&(t=void 0),!t){if(void 0===t||!1===t)return t;throw new Error("`".concat(e,"` was specified but was not a node, or did not return a node"))}var s=t;if("string"==typeof t&&!(s=r.querySelector(t)))throw new Error("`".concat(e,"` as selector refers to no known node"));return s},c=function(){var e=l("initialFocus");if(!1===e)return!1;if(void 0===e)if(s(r.activeElement)>=0)e=r.activeElement;else{var t=i.tabbableGroups[0];e=t&&t.firstTabbableNode||l("fallbackFocus")}if(!e)throw new Error("Your focus-trap needs to have at least one focusable element");return e},d=function(){if(i.containerGroups=i.containers.map((function(e){var t,n,r=np(e,o.tabbableOptions),i=(t=e,(n=(n=o.tabbableOptions)||{}).getShadowRoot?Wu([t],n.includeContainer,{filter:Ju.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):Zu(t,n.includeContainer,Ju.bind(null,n)));return{container:e,tabbableNodes:r,focusableNodes:i,firstTabbableNode:r.length>0?r[0]:null,lastTabbableNode:r.length>0?r[r.length-1]:null,nextTabbableNode:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=i.findIndex((function(t){return t===e}));if(!(n<0))return t?i.slice(n+1).find((function(e){return rp(e,o.tabbableOptions)})):i.slice(0,n).reverse().find((function(e){return rp(e,o.tabbableOptions)}))}}})),i.tabbableGroups=i.containerGroups.filter((function(e){return e.tabbableNodes.length>0})),i.tabbableGroups.length<=0&&!l("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times")},u=function e(t){!1!==t&&t!==r.activeElement&&(t&&t.focus?(t.focus({preventScroll:!!o.preventScroll}),i.mostRecentlyFocusedNode=t,function(e){return e.tagName&&"input"===e.tagName.toLowerCase()&&"function"==typeof e.select}(t)&&t.select()):e(c()))},p=function(e){var t=l("setReturnFocus",e);return t||!1!==t&&e},h=function(e){var t=fp(e);s(t)>=0||(hp(o.clickOutsideDeactivates,e)?n.deactivate({returnFocus:o.returnFocusOnDeactivate&&!ip(t,o.tabbableOptions)}):hp(o.allowOutsideClick,e)||e.preventDefault())},f=function(e){var t=fp(e),n=s(t)>=0;n||t instanceof Document?n&&(i.mostRecentlyFocusedNode=t):(e.stopImmediatePropagation(),u(i.mostRecentlyFocusedNode||c()))},g=function(e){if(function(e){return"Escape"===e.key||"Esc"===e.key||27===e.keyCode}(e)&&!1!==hp(o.escapeDeactivates,e))return e.preventDefault(),void n.deactivate();(function(e){return"Tab"===e.key||9===e.keyCode})(e)&&function(e){var t=fp(e);d();var n=null;if(i.tabbableGroups.length>0){var r=s(t),a=r>=0?i.containerGroups[r]:void 0;if(r<0)n=e.shiftKey?i.tabbableGroups[i.tabbableGroups.length-1].lastTabbableNode:i.tabbableGroups[0].firstTabbableNode;else if(e.shiftKey){var c=pp(i.tabbableGroups,(function(e){var n=e.firstTabbableNode;return t===n}));if(c<0&&(a.container===t||ip(t,o.tabbableOptions)&&!rp(t,o.tabbableOptions)&&!a.nextTabbableNode(t,!1))&&(c=r),c>=0){var p=0===c?i.tabbableGroups.length-1:c-1;n=i.tabbableGroups[p].lastTabbableNode}}else{var h=pp(i.tabbableGroups,(function(e){var n=e.lastTabbableNode;return t===n}));if(h<0&&(a.container===t||ip(t,o.tabbableOptions)&&!rp(t,o.tabbableOptions)&&!a.nextTabbableNode(t))&&(h=r),h>=0){var f=h===i.tabbableGroups.length-1?0:h+1;n=i.tabbableGroups[f].firstTabbableNode}}}else n=l("fallbackFocus");n&&(e.preventDefault(),u(n))}(e)},x=function(e){var t=fp(e);s(t)>=0||hp(o.clickOutsideDeactivates,e)||hp(o.allowOutsideClick,e)||(e.preventDefault(),e.stopImmediatePropagation())},m=function(){if(i.active)return dp.activateTrap(n),i.delayInitialFocusTimer=o.delayInitialFocus?up((function(){u(c())})):u(c()),r.addEventListener("focusin",f,!0),r.addEventListener("mousedown",h,{capture:!0,passive:!1}),r.addEventListener("touchstart",h,{capture:!0,passive:!1}),r.addEventListener("click",x,{capture:!0,passive:!1}),r.addEventListener("keydown",g,{capture:!0,passive:!1}),n},v=function(){if(i.active)return r.removeEventListener("focusin",f,!0),r.removeEventListener("mousedown",h,!0),r.removeEventListener("touchstart",h,!0),r.removeEventListener("click",x,!0),r.removeEventListener("keydown",g,!0),n};return(n={get active(){return i.active},get paused(){return i.paused},activate:function(e){if(i.active)return this;var t=a(e,"onActivate"),n=a(e,"onPostActivate"),o=a(e,"checkCanFocusTrap");o||d(),i.active=!0,i.paused=!1,i.nodeFocusedBeforeActivation=r.activeElement,t&&t();var s=function(){o&&d(),m(),n&&n()};return o?(o(i.containers.concat()).then(s,s),this):(s(),this)},deactivate:function(e){if(!i.active)return this;var t=sp({onDeactivate:o.onDeactivate,onPostDeactivate:o.onPostDeactivate,checkCanReturnFocus:o.checkCanReturnFocus},e);clearTimeout(i.delayInitialFocusTimer),i.delayInitialFocusTimer=void 0,v(),i.active=!1,i.paused=!1,dp.deactivateTrap(n);var r=a(t,"onDeactivate"),s=a(t,"onPostDeactivate"),l=a(t,"checkCanReturnFocus"),c=a(t,"returnFocus","returnFocusOnDeactivate");r&&r();var d=function(){up((function(){c&&u(p(i.nodeFocusedBeforeActivation)),s&&s()}))};return c&&l?(l(p(i.nodeFocusedBeforeActivation)).then(d,d),this):(d(),this)},pause:function(){return i.paused||!i.active||(i.paused=!0,v()),this},unpause:function(){return i.paused&&i.active?(i.paused=!1,d(),m(),this):this},updateContainerElements:function(e){var t=[].concat(e).filter(Boolean);return i.containers=t.map((function(e){return"string"==typeof e?r.querySelector(e):e})),i.active&&d(),this}}).updateContainerElements(e),n};var xp=!1;if("undefined"!=typeof window){var mp={get passive(){xp=!0}};window.addEventListener("testPassive",null,mp),window.removeEventListener("testPassive",null,mp)}var vp,bp="undefined"!=typeof window&&window.navigator&&window.navigator.platform&&(/iP(ad|hone|od)/.test(window.navigator.platform)||"MacIntel"===window.navigator.platform&&window.navigator.maxTouchPoints>1),yp=[],wp=!1,Cp=-1,jp=void 0,kp=void 0,$p=function(e){return yp.some((function(t){return!(!t.options.allowTouchMove||!t.options.allowTouchMove(e))}))},Sp=function(e){var t=e||window.event;return!!$p(t.target)||(t.touches.length>1||(t.preventDefault&&t.preventDefault(),!1))},Ep=function(e,t){if(e){if(!yp.some((function(t){return t.targetElement===e}))){var n={targetElement:e,options:t||{}};yp=[].concat(function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}(yp),[n]),bp?(e.ontouchstart=function(e){1===e.targetTouches.length&&(Cp=e.targetTouches[0].clientY)},e.ontouchmove=function(t){1===t.targetTouches.length&&function(e,t){var n=e.targetTouches[0].clientY-Cp;!$p(e.target)&&(t&&0===t.scrollTop&&n>0||function(e){return!!e&&e.scrollHeight-e.scrollTop<=e.clientHeight}(t)&&n<0?Sp(e):e.stopPropagation())}(t,e)},wp||(document.addEventListener("touchmove",Sp,xp?{passive:!1}:void 0),wp=!0)):function(e){if(void 0===kp){var t=!!e&&!0===e.reserveScrollBarGap,n=window.innerWidth-document.documentElement.clientWidth;t&&n>0&&(kp=document.body.style.paddingRight,document.body.style.paddingRight=n+"px")}void 0===jp&&(jp=document.body.style.overflow,document.body.style.overflow="hidden")}(t)}}else console.error("disableBodyScroll unsuccessful - targetElement must be provided when calling disableBodyScroll on IOS devices.")},Lp=function(e){e?(yp=yp.filter((function(t){return t.targetElement!==e})),bp?(e.ontouchstart=null,e.ontouchmove=null,wp&&0===yp.length&&(document.removeEventListener("touchmove",Sp,xp?{passive:!1}:void 0),wp=!1)):yp.length||(void 0!==kp&&(document.body.style.paddingRight=kp,kp=void 0),void 0!==jp&&(document.body.style.overflow=jp,jp=void 0))):console.error("enableBodyScroll unsuccessful - targetElement must be provided when calling enableBodyScroll on IOS devices.")},Rp=[],Tp="ResizeObserver loop completed with undelivered notifications.";!function(e){e.BORDER_BOX="border-box",e.CONTENT_BOX="content-box",e.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"}(vp||(vp={}));var Op,Pp=function(e){return Object.freeze(e)},Mp=function(e,t){this.inlineSize=e,this.blockSize=t,Pp(this)},_p=function(){function e(e,t,n,r){return this.x=e,this.y=t,this.width=n,this.height=r,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,Pp(this)}return e.prototype.toJSON=function(){var e=this;return{x:e.x,y:e.y,top:e.top,right:e.right,bottom:e.bottom,left:e.left,width:e.width,height:e.height}},e.fromRect=function(t){return new e(t.x,t.y,t.width,t.height)},e}(),Ip=function(e){return e instanceof SVGElement&&"getBBox"in e},Dp=function(e){if(Ip(e)){var t=e.getBBox(),n=t.width,r=t.height;return!n&&!r}var o=e,i=o.offsetWidth,a=o.offsetHeight;return!(i||a||e.getClientRects().length)},Ap=function(e){var t;if(e instanceof Element)return!0;var n=null===(t=null==e?void 0:e.ownerDocument)||void 0===t?void 0:t.defaultView;return!!(n&&e instanceof n.Element)},Np="undefined"!=typeof window?window:{},Vp=new WeakMap,zp=/auto|scroll/,Bp=/^tb|vertical/,Hp=/msie|trident/i.test(Np.navigator&&Np.navigator.userAgent),Fp=function(e){return parseFloat(e||"0")},qp=function(e,t,n){return void 0===e&&(e=0),void 0===t&&(t=0),void 0===n&&(n=!1),new Mp((n?t:e)||0,(n?e:t)||0)},Zp=Pp({devicePixelContentBoxSize:qp(),borderBoxSize:qp(),contentBoxSize:qp(),contentRect:new _p(0,0,0,0)}),Wp=function(e,t){if(void 0===t&&(t=!1),Vp.has(e)&&!t)return Vp.get(e);if(Dp(e))return Vp.set(e,Zp),Zp;var n=getComputedStyle(e),r=Ip(e)&&e.ownerSVGElement&&e.getBBox(),o=!Hp&&"border-box"===n.boxSizing,i=Bp.test(n.writingMode||""),a=!r&&zp.test(n.overflowY||""),s=!r&&zp.test(n.overflowX||""),l=r?0:Fp(n.paddingTop),c=r?0:Fp(n.paddingRight),d=r?0:Fp(n.paddingBottom),u=r?0:Fp(n.paddingLeft),p=r?0:Fp(n.borderTopWidth),h=r?0:Fp(n.borderRightWidth),f=r?0:Fp(n.borderBottomWidth),g=u+c,x=l+d,m=(r?0:Fp(n.borderLeftWidth))+h,v=p+f,b=s?e.offsetHeight-v-e.clientHeight:0,y=a?e.offsetWidth-m-e.clientWidth:0,w=o?g+m:0,C=o?x+v:0,j=r?r.width:Fp(n.width)-w-y,k=r?r.height:Fp(n.height)-C-b,$=j+g+y+m,S=k+x+b+v,E=Pp({devicePixelContentBoxSize:qp(Math.round(j*devicePixelRatio),Math.round(k*devicePixelRatio),i),borderBoxSize:qp($,S,i),contentBoxSize:qp(j,k,i),contentRect:new _p(u,l,j,k)});return Vp.set(e,E),E},Gp=function(e,t,n){var r=Wp(e,n),o=r.borderBoxSize,i=r.contentBoxSize,a=r.devicePixelContentBoxSize;switch(t){case vp.DEVICE_PIXEL_CONTENT_BOX:return a;case vp.BORDER_BOX:return o;default:return i}},Up=function(e){var t=Wp(e);this.target=e,this.contentRect=t.contentRect,this.borderBoxSize=Pp([t.borderBoxSize]),this.contentBoxSize=Pp([t.contentBoxSize]),this.devicePixelContentBoxSize=Pp([t.devicePixelContentBoxSize])},Xp=function(e){if(Dp(e))return 1/0;for(var t=0,n=e.parentNode;n;)t+=1,n=n.parentNode;return t},Yp=function(){var e=1/0,t=[];Rp.forEach((function(n){if(0!==n.activeTargets.length){var r=[];n.activeTargets.forEach((function(t){var n=new Up(t.target),o=Xp(t.target);r.push(n),t.lastReportedSize=Gp(t.target,t.observedBox),o<e&&(e=o)})),t.push((function(){n.callback.call(n.observer,r,n.observer)})),n.activeTargets.splice(0,n.activeTargets.length)}}));for(var n=0,r=t;n<r.length;n++){(0,r[n])()}return e},Kp=function(e){Rp.forEach((function(t){t.activeTargets.splice(0,t.activeTargets.length),t.skippedTargets.splice(0,t.skippedTargets.length),t.observationTargets.forEach((function(n){n.isActive()&&(Xp(n.target)>e?t.activeTargets.push(n):t.skippedTargets.push(n))}))}))},Jp=function(){var e=0;for(Kp(e);Rp.some((function(e){return e.activeTargets.length>0}));)e=Yp(),Kp(e);return Rp.some((function(e){return e.skippedTargets.length>0}))&&function(){var e;"function"==typeof ErrorEvent?e=new ErrorEvent("error",{message:Tp}):((e=document.createEvent("Event")).initEvent("error",!1,!1),e.message=Tp),window.dispatchEvent(e)}(),e>0},Qp=[],eh=function(e){if(!Op){var t=0,n=document.createTextNode("");new MutationObserver((function(){return Qp.splice(0).forEach((function(e){return e()}))})).observe(n,{characterData:!0}),Op=function(){n.textContent="".concat(t?t--:t++)}}Qp.push(e),Op()},th=0,nh={attributes:!0,characterData:!0,childList:!0,subtree:!0},rh=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],oh=function(e){return void 0===e&&(e=0),Date.now()+e},ih=!1,ah=new(function(){function e(){var e=this;this.stopped=!0,this.listener=function(){return e.schedule()}}return e.prototype.run=function(e){var t=this;if(void 0===e&&(e=250),!ih){ih=!0;var n,r=oh(e);n=function(){var n=!1;try{n=Jp()}finally{if(ih=!1,e=r-oh(),!th)return;n?t.run(1e3):e>0?t.run(e):t.start()}},eh((function(){requestAnimationFrame(n)}))}},e.prototype.schedule=function(){this.stop(),this.run()},e.prototype.observe=function(){var e=this,t=function(){return e.observer&&e.observer.observe(document.body,nh)};document.body?t():Np.addEventListener("DOMContentLoaded",t)},e.prototype.start=function(){var e=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),rh.forEach((function(t){return Np.addEventListener(t,e.listener,!0)})))},e.prototype.stop=function(){var e=this;this.stopped||(this.observer&&this.observer.disconnect(),rh.forEach((function(t){return Np.removeEventListener(t,e.listener,!0)})),this.stopped=!0)},e}()),sh=function(e){!th&&e>0&&ah.start(),!(th+=e)&&ah.stop()},lh=function(){function e(e,t){this.target=e,this.observedBox=t||vp.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return e.prototype.isActive=function(){var e=Gp(this.target,this.observedBox,!0);return function(e){return!Ip(e)&&!function(e){switch(e.tagName){case"INPUT":if("image"!==e.type)break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1}(e)&&"inline"===getComputedStyle(e).display}(this.target)&&(this.lastReportedSize=e),this.lastReportedSize.inlineSize!==e.inlineSize||this.lastReportedSize.blockSize!==e.blockSize},e}(),ch=function(e,t){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=e,this.callback=t},dh=new WeakMap,uh=function(e,t){for(var n=0;n<e.length;n+=1)if(e[n].target===t)return n;return-1},ph=function(){function e(){}return e.connect=function(e,t){var n=new ch(e,t);dh.set(e,n)},e.observe=function(e,t,n){var r=dh.get(e),o=0===r.observationTargets.length;uh(r.observationTargets,t)<0&&(o&&Rp.push(r),r.observationTargets.push(new lh(t,n&&n.box)),sh(1),ah.schedule())},e.unobserve=function(e,t){var n=dh.get(e),r=uh(n.observationTargets,t),o=1===n.observationTargets.length;r>=0&&(o&&Rp.splice(Rp.indexOf(n),1),n.observationTargets.splice(r,1),sh(-1))},e.disconnect=function(e){var t=this,n=dh.get(e);n.observationTargets.slice().forEach((function(n){return t.unobserve(e,n.target)})),n.activeTargets.splice(0,n.activeTargets.length)},e}(),hh=function(){function e(e){if(0===arguments.length)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if("function"!=typeof e)throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");ph.connect(this,e)}return e.prototype.observe=function(e,t){if(0===arguments.length)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!Ap(e))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");ph.observe(this,e,t)},e.prototype.unobserve=function(e){if(0===arguments.length)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!Ap(e))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");ph.unobserve(this,e)},e.prototype.disconnect=function(){ph.disconnect(this)},e.toString=function(){return"function ResizeObserver () { [polyfill code] }"},e}();function fh(){return fh=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},fh.apply(this,arguments)}function gh(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)t.indexOf(n=i[r])>=0||(o[n]=e[n]);return o}var xh="undefined"!=typeof window?n.useLayoutEffect:n.useEffect;function mh(e,t,n){return t=(t=+t)==t?t:0,n=(n=+n)==n?n:0,(e=+e)==e&&(e=(e=e<=n?e:n)>=t?e:t),e}function vh(e){var t=Math.round(e);if(Number.isNaN(e))throw new TypeError("Found a NaN! Check your snapPoints / defaultSnap / snapTo ");return t}var bh={box:"border-box"};function yh(e,t){var r=t.label,o=t.enabled,i=t.resizeSourceRef,a=n.useState(0),s=a[0],l=a[1];n.useDebugValue(r+": "+s);var c=n.useCallback((function(e){l(e[0].borderBoxSize[0].blockSize),i.current="element"}),[i]);return xh((function(){if(e.current&&o){var t=new hh(c);return t.observe(e.current,bh),function(){t.disconnect()}}}),[e,c,o]),o?s:0}function wh(e){return void 0===e&&(e=1e3),new Promise((function(t){return setTimeout(t,e)}))}var Ch={DRAG:{target:"#overlay.dragging",actions:"onOpenEnd"}},jh={RESIZE:{target:"#overlay.resizing",actions:"onOpenEnd"}},kh=function(e,t,n){return void 0===n&&(n=e.context),new Lc(e,t,n)}({id:"overlay",initial:"closed",context:{initialState:"CLOSED"},states:{closed:{on:{OPEN:"opening",CLOSE:void 0}},opening:{initial:"start",states:{start:{invoke:{src:"onOpenStart",onDone:"transition"}},transition:{always:[{target:"immediately",cond:"initiallyOpen"},{target:"smoothly",cond:"initiallyClosed"}]},immediately:{initial:"open",states:{open:{invoke:{src:"openImmediately",onDone:"activating"}},activating:{invoke:{src:"activate",onDone:"#overlay.opening.end"},on:fh({},Ch,jh)}}},smoothly:{initial:"visuallyHidden",states:{visuallyHidden:{invoke:{src:"renderVisuallyHidden",onDone:"activating"}},activating:{invoke:{src:"activate",onDone:"open"}},open:{invoke:{src:"openSmoothly",onDone:"#overlay.opening.end"},on:fh({},Ch,jh)}}},end:{invoke:{src:"onOpenEnd",onDone:"done"},on:{CLOSE:"#overlay.closing",DRAG:"#overlay.dragging"}},done:{type:"final"}},on:fh({},{CLOSE:{target:"#overlay.closing",actions:"onOpenCancel"}}),onDone:"open"},open:{on:{DRAG:"#overlay.dragging",SNAP:"snapping",RESIZE:"resizing"}},dragging:{on:{SNAP:"snapping"}},snapping:{initial:"start",states:{start:{invoke:{src:"onSnapStart",onDone:"snappingSmoothly"},entry:[Tc({y:function(e,t){return t.payload.y},velocity:function(e,t){return t.payload.velocity},snapSource:function(e,t){var n=t.payload.source;return void 0===n?"custom":n}})]},snappingSmoothly:{invoke:{src:"snapSmoothly",onDone:"end"}},end:{invoke:{src:"onSnapEnd",onDone:"done"},on:{RESIZE:"#overlay.resizing",SNAP:"#overlay.snapping",CLOSE:"#overlay.closing",DRAG:"#overlay.dragging"}},done:{type:"final"}},on:{SNAP:{target:"snapping",actions:"onSnapEnd"},RESIZE:{target:"#overlay.resizing",actions:"onSnapCancel"},DRAG:{target:"#overlay.dragging",actions:"onSnapCancel"},CLOSE:{target:"#overlay.closing",actions:"onSnapCancel"}},onDone:"open"},resizing:{initial:"start",states:{start:{invoke:{src:"onResizeStart",onDone:"resizingSmoothly"}},resizingSmoothly:{invoke:{src:"resizeSmoothly",onDone:"end"}},end:{invoke:{src:"onResizeEnd",onDone:"done"},on:{SNAP:"#overlay.snapping",CLOSE:"#overlay.closing",DRAG:"#overlay.dragging"}},done:{type:"final"}},on:{RESIZE:{target:"resizing",actions:"onResizeEnd"},SNAP:{target:"snapping",actions:"onResizeCancel"},DRAG:{target:"#overlay.dragging",actions:"onResizeCancel"},CLOSE:{target:"#overlay.closing",actions:"onResizeCancel"}},onDone:"open"},closing:{initial:"start",states:{start:{invoke:{src:"onCloseStart",onDone:"deactivating"},on:{OPEN:{target:"#overlay.open",actions:"onCloseCancel"}}},deactivating:{invoke:{src:"deactivate",onDone:"closingSmoothly"}},closingSmoothly:{invoke:{src:"closeSmoothly",onDone:"end"}},end:{invoke:{src:"onCloseEnd",onDone:"done"},on:{OPEN:{target:"#overlay.opening",actions:"onCloseCancel"}}},done:{type:"final"}},on:{CLOSE:void 0,OPEN:{target:"#overlay.opening",actions:"onCloseCancel"}},onDone:"closed"}},on:{CLOSE:"closing"}},{actions:{onOpenCancel:function(e,t){},onSnapCancel:function(e,t){},onResizeCancel:function(e,t){},onCloseCancel:function(e,t){},onOpenEnd:function(e,t){},onSnapEnd:function(e,t){},onRezizeEnd:function(e,t){}},services:{onSnapStart:function(){try{return Promise.resolve(wh()).then((function(){}))}catch(e){return Promise.reject(e)}},onOpenStart:function(){try{return Promise.resolve(wh()).then((function(){}))}catch(e){return Promise.reject(e)}},onCloseStart:function(){try{return Promise.resolve(wh()).then((function(){}))}catch(e){return Promise.reject(e)}},onResizeStart:function(){try{return Promise.resolve(wh()).then((function(){}))}catch(e){return Promise.reject(e)}},onSnapEnd:function(){try{return Promise.resolve(wh()).then((function(){}))}catch(e){return Promise.reject(e)}},onOpenEnd:function(){try{return Promise.resolve(wh()).then((function(){}))}catch(e){return Promise.reject(e)}},onCloseEnd:function(){try{return Promise.resolve(wh()).then((function(){}))}catch(e){return Promise.reject(e)}},onResizeEnd:function(){try{return Promise.resolve(wh()).then((function(){}))}catch(e){return Promise.reject(e)}},renderVisuallyHidden:function(e,t){try{return Promise.resolve(wh()).then((function(){}))}catch(e){return Promise.reject(e)}},activate:function(e,t){try{return Promise.resolve(wh()).then((function(){}))}catch(e){return Promise.reject(e)}},deactivate:function(e,t){try{return Promise.resolve(wh()).then((function(){}))}catch(e){return Promise.reject(e)}},openSmoothly:function(e,t){try{return Promise.resolve(wh()).then((function(){}))}catch(e){return Promise.reject(e)}},openImmediately:function(e,t){try{return Promise.resolve(wh()).then((function(){}))}catch(e){return Promise.reject(e)}},snapSmoothly:function(e,t){try{return Promise.resolve(wh()).then((function(){}))}catch(e){return Promise.reject(e)}},resizeSmoothly:function(e,t){try{return Promise.resolve(wh()).then((function(){}))}catch(e){return Promise.reject(e)}},closeSmoothly:function(e,t){try{return Promise.resolve(wh()).then((function(){}))}catch(e){return Promise.reject(e)}}},guards:{initiallyClosed:function(e){return"CLOSED"===e.initialState},initiallyOpen:function(e){return"OPEN"===e.initialState}}}),$h=["children","sibling","className","footer","header","open","initialState","lastSnapRef","initialFocusRef","onDismiss","maxHeight","defaultSnap","snapPoints","blocking","scrollLocking","style","onSpringStart","onSpringCancel","onSpringEnd","reserveScrollBarGap","expandOnContentDrag"],Sh=["velocity"],Eh=["onRest","config"],Lh={tension:170,friction:26},Rh=Lh.tension,Th=Lh.friction,Oh=n.forwardRef((function(e,t){var r=e.children,o=e.sibling,i=e.className,a=e.footer,s=e.header,l=e.open,c=e.initialState,d=e.lastSnapRef,u=e.initialFocusRef,p=e.onDismiss,h=e.maxHeight,f=e.defaultSnap,g=void 0===f?Mh:f,x=e.snapPoints,m=void 0===x?_h:x,v=e.blocking,b=void 0===v||v,y=e.scrollLocking,w=void 0===y||y,C=e.style,j=e.onSpringStart,k=e.onSpringCancel,$=e.onSpringEnd,S=e.reserveScrollBarGap,E=void 0===S?b:S,L=e.expandOnContentDrag,R=void 0!==L&&L,T=gh(e,$h),O=function(){var e=n.useState(!1),t=e[0],r=e[1],o=n.useState({}),i=o[0],a=o[1],s=n.useCallback((function(e){return a((function(t){var n;return fh({},t,((n={})[e]=!1,n))})),function(){a((function(t){var n;return fh({},t,((n={})[e]=!0,n))}))}}),[]);return n.useEffect((function(){var e=Object.values(i);0!==e.length&&e.every(Boolean)&&r(!0)}),[i]),{ready:t,registerReady:s}}(),P=O.ready,M=O.registerReady,_=n.useRef(!1),I=n.useRef(j),D=n.useRef(k),A=n.useRef($);n.useEffect((function(){I.current=j,D.current=k,A.current=$}),[k,j,$]);var N,V,z=vd((function(){return{y:0,ready:0,maxHeight:0,minSnap:0,maxSnap:0}})),B=z[0],H=z[1],F=n.useRef(null),q=n.useRef(null),Z=n.useRef(null),W=n.useRef(null),G=n.useRef(null),U=n.useRef(null),X=n.useRef(0),Y=n.useRef(),K=n.useRef(!1),J=(N=n.useMemo((function(){return"undefined"!=typeof window?window.matchMedia("(prefers-reduced-motion: reduce)"):null}),[]),V=n.useRef(null==N?void 0:N.matches),n.useDebugValue(V.current?"reduce":"no-preference"),n.useEffect((function(){var e=function(e){V.current=e.matches};return null==N||N.addListener(e),function(){return null==N?void 0:N.removeListener(e)}}),[N]),V),Q=function(e){var t=e.targetRef,r=e.enabled,o=e.reserveScrollBarGap,i=n.useRef({activate:function(){throw new TypeError("Tried to activate scroll lock too early")},deactivate:function(){}});return n.useDebugValue(r?"Enabled":"Disabled"),n.useEffect((function(){if(!r)return i.current.deactivate(),void(i.current={activate:function(){},deactivate:function(){}});var e=t.current,n=!1;i.current={activate:function(){n||(n=!0,Ep(e,{allowTouchMove:function(e){return e.closest("[data-body-scroll-lock-ignore]")},reserveScrollBarGap:o}))},deactivate:function(){n&&(n=!1,Lp(e))}}}),[r,t,o]),i}({targetRef:q,enabled:P&&w,reserveScrollBarGap:E}),ee=function(e){var t=e.targetRef,r=e.enabled,o=n.useRef({activate:function(){throw new TypeError("Tried to activate aria hider too early")},deactivate:function(){}});return n.useDebugValue(r?"Enabled":"Disabled"),n.useEffect((function(){if(!r)return o.current.deactivate(),void(o.current={activate:function(){},deactivate:function(){}});var e=t.current,n=!1,i=[],a=[];o.current={activate:function(){if(!n){n=!0;var t=e.parentNode;document.querySelectorAll("body > *").forEach((function(e){if(e!==t){var n=e.getAttribute("aria-hidden");null!==n&&"false"!==n||(i.push(n),a.push(e),e.setAttribute("aria-hidden","true"))}}))}},deactivate:function(){n&&(n=!1,a.forEach((function(e,t){var n=i[t];null===n?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",n)})),i=[],a=[])}}}),[t,r]),o}({targetRef:F,enabled:P&&b}),te=function(e){var t=e.targetRef,r=e.fallbackRef,o=e.initialFocusRef,i=e.enabled,a=n.useRef({activate:function(){throw new TypeError("Tried to activate focus trap too early")},deactivate:function(){}});return n.useDebugValue(i?"Enabled":"Disabled"),n.useEffect((function(){if(!i)return a.current.deactivate(),void(a.current={activate:function(){},deactivate:function(){}});var e=r.current,n=gp(t.current,{onActivate:void 0,initialFocus:o?function(){return(null==o?void 0:o.current)||e}:void 0,fallbackFocus:e,escapeDeactivates:!1,clickOutsideDeactivates:!1}),s=!1;a.current={activate:function(){try{return s?Promise.resolve():(s=!0,Promise.resolve(n.activate()).then((function(){return Promise.resolve(new Promise((function(e){return setTimeout((function(){return e(void 0)}),0)}))).then((function(){}))})))}catch(e){return Promise.reject(e)}},deactivate:function(){s&&(s=!1,n.deactivate())}}}),[i,r,o,t]),a}({targetRef:F,fallbackRef:U,initialFocusRef:u||void 0,enabled:P&&b&&!1!==u}),ne=function(e){var t=e.getSnapPoints,r=e.heightRef,o=e.lastSnapRef,i=e.ready,a=function(e){var t=e.contentRef,r=e.controlledMaxHeight,o=e.footerEnabled,i=e.footerRef,a=e.headerEnabled,s=e.headerRef,l=e.registerReady,c=e.resizeSourceRef,d=n.useMemo((function(){return l("contentHeight")}),[l]),u=function(e,t,r){var o=n.useMemo((function(){return t("maxHeight")}),[t]),i=n.useState((function(){return vh(e)||"undefined"!=typeof window?window.innerHeight:0})),a=i[0],s=i[1],l=a>0,c=n.useRef(0);return n.useDebugValue(e?"controlled":"auto"),n.useEffect((function(){l&&o()}),[l,o]),xh((function(){if(e)return s(vh(e)),void(r.current="maxheightprop");var t=function(){c.current||(c.current=requestAnimationFrame((function(){s(window.innerHeight),r.current="window",c.current=0})))};return window.addEventListener("resize",t),s(window.innerHeight),r.current="window",o(),function(){window.removeEventListener("resize",t),cancelAnimationFrame(c.current)}}),[e,o,r]),a}(r,l,c),p=yh(s,{label:"headerHeight",enabled:a,resizeSourceRef:c}),h=yh(t,{label:"contentHeight",enabled:!0,resizeSourceRef:c}),f=yh(i,{label:"footerHeight",enabled:o,resizeSourceRef:c}),g=Math.min(u-p-f,h)+p+f;n.useDebugValue("minHeight: "+g);var x=h>0;return n.useEffect((function(){x&&d()}),[x,d]),{maxHeight:u,minHeight:g,headerHeight:p,footerHeight:f}}({contentRef:e.contentRef,controlledMaxHeight:e.controlledMaxHeight,footerEnabled:e.footerEnabled,footerRef:e.footerRef,headerEnabled:e.headerEnabled,headerRef:e.headerRef,registerReady:e.registerReady,resizeSourceRef:e.resizeSourceRef}),s=a.maxHeight,l=a.minHeight,c=a.headerHeight,d=a.footerHeight,u=function(e,t){var n=[].concat(e).map(vh).reduce((function(e,n){return e.add(mh(n,0,t)),e}),new Set),r=Array.from(n),o=Math.min.apply(Math,r);if(Number.isNaN(o))throw new TypeError("minSnap is NaN");var i=Math.max.apply(Math,r);if(Number.isNaN(i))throw new TypeError("maxSnap is NaN");return{snapPoints:r,minSnap:o,maxSnap:i}}(i?t({height:r.current,footerHeight:d,headerHeight:c,minHeight:l,maxHeight:s}):[0],s),p=u.snapPoints,h=u.minSnap,f=u.maxSnap;return n.useDebugValue("minSnap: "+h+", maxSnap:"+f),{minSnap:h,maxSnap:f,findSnap:function(e){var t=vh("function"==typeof e?e({footerHeight:d,headerHeight:c,height:r.current,minHeight:l,maxHeight:s,snapPoints:p,lastSnap:o.current}):e);return p.reduce((function(e,n){return Math.abs(n-t)<Math.abs(e-t)?n:e}),h)},maxHeight:s}}({contentRef:Z,controlledMaxHeight:h,footerEnabled:!!a,footerRef:G,getSnapPoints:m,headerEnabled:!1!==s,headerRef:W,heightRef:X,lastSnapRef:d,ready:P,registerReady:M,resizeSourceRef:Y}),re=ne.minSnap,oe=ne.maxSnap,ie=ne.maxHeight,ae=ne.findSnap,se=n.useRef(ie),le=n.useRef(re),ce=n.useRef(oe),de=n.useRef(ae),ue=n.useRef(0);xh((function(){se.current=ie,ce.current=oe,le.current=re,de.current=ae,ue.current=ae(g)}),[ae,g,ie,oe,re]);var pe=n.useCallback((function(e){var t=e.onRest,n=e.config,r=(n=void 0===n?{}:n).velocity,o=void 0===r?1:r,i=gh(n,Sh),a=gh(e,Eh);return new Promise((function(e){return H(fh({},a,{config:fh({velocity:o},i,{mass:1,tension:Rh,friction:Math.max(Th,Th+(Th-Th*o))}),onRest:function(){var n=[].slice.call(arguments);e.apply(void 0,n),null==t||t.apply(void 0,n)}}))}))}),[H]),he=Fc(kh,{devTools:!1,actions:{onOpenCancel:n.useCallback((function(){return null==D.current?void 0:D.current({type:"OPEN"})}),[]),onSnapCancel:n.useCallback((function(e){return null==D.current?void 0:D.current({type:"SNAP",source:e.snapSource})}),[]),onCloseCancel:n.useCallback((function(){return null==D.current?void 0:D.current({type:"CLOSE"})}),[]),onResizeCancel:n.useCallback((function(){return null==D.current?void 0:D.current({type:"RESIZE",source:Y.current})}),[]),onOpenEnd:n.useCallback((function(){return null==A.current?void 0:A.current({type:"OPEN"})}),[]),onSnapEnd:n.useCallback((function(e,t){return null==A.current?void 0:A.current({type:"SNAP",source:e.snapSource})}),[]),onResizeEnd:n.useCallback((function(){return null==A.current?void 0:A.current({type:"RESIZE",source:Y.current})}),[])},context:{initialState:c},services:{onSnapStart:n.useCallback((function(e,t){try{return Promise.resolve(null==I.current?void 0:I.current({type:"SNAP",source:t.payload.source||"custom"}))}catch(e){return Promise.reject(e)}}),[]),onOpenStart:n.useCallback((function(){try{return Promise.resolve(null==I.current?void 0:I.current({type:"OPEN"}))}catch(e){return Promise.reject(e)}}),[]),onCloseStart:n.useCallback((function(){try{return Promise.resolve(null==I.current?void 0:I.current({type:"CLOSE"}))}catch(e){return Promise.reject(e)}}),[]),onResizeStart:n.useCallback((function(){try{return Promise.resolve(null==I.current?void 0:I.current({type:"RESIZE",source:Y.current}))}catch(e){return Promise.reject(e)}}),[]),onSnapEnd:n.useCallback((function(e,t){try{return Promise.resolve(null==A.current?void 0:A.current({type:"SNAP",source:e.snapSource}))}catch(e){return Promise.reject(e)}}),[]),onOpenEnd:n.useCallback((function(){try{return Promise.resolve(null==A.current?void 0:A.current({type:"OPEN"}))}catch(e){return Promise.reject(e)}}),[]),onCloseEnd:n.useCallback((function(){try{return Promise.resolve(null==A.current?void 0:A.current({type:"CLOSE"}))}catch(e){return Promise.reject(e)}}),[]),onResizeEnd:n.useCallback((function(){try{return Promise.resolve(null==A.current?void 0:A.current({type:"RESIZE",source:Y.current}))}catch(e){return Promise.reject(e)}}),[]),renderVisuallyHidden:n.useCallback((function(e,t){try{return Promise.resolve(pe({y:ue.current,ready:0,maxHeight:se.current,maxSnap:ce.current,minSnap:ue.current,immediate:!0})).then((function(){}))}catch(e){return Promise.reject(e)}}),[pe]),activate:n.useCallback((function(e,t){try{return _.current=!0,Promise.resolve(Promise.all([Q.current.activate(),te.current.activate(),ee.current.activate()])).then((function(){}))}catch(e){return Promise.reject(e)}}),[ee,te,Q]),deactivate:n.useCallback((function(){try{return Q.current.deactivate(),te.current.deactivate(),ee.current.deactivate(),_.current=!1,Promise.resolve()}catch(e){return Promise.reject(e)}}),[ee,te,Q]),openImmediately:n.useCallback((function(){try{return X.current=ue.current,Promise.resolve(pe({y:ue.current,ready:1,maxHeight:se.current,maxSnap:ce.current,minSnap:ue.current,immediate:!0})).then((function(){}))}catch(e){return Promise.reject(e)}}),[pe]),openSmoothly:n.useCallback((function(){try{return Promise.resolve(pe({y:0,ready:1,maxHeight:se.current,maxSnap:ce.current,minSnap:ue.current,immediate:!0})).then((function(){return X.current=ue.current,Promise.resolve(pe({y:ue.current,ready:1,maxHeight:se.current,maxSnap:ce.current,minSnap:ue.current,immediate:J.current})).then((function(){}))}))}catch(e){return Promise.reject(e)}}),[pe,J]),snapSmoothly:n.useCallback((function(e,t){try{var n=de.current(e.y);return X.current=n,d.current=n,Promise.resolve(pe({y:n,ready:1,maxHeight:se.current,maxSnap:ce.current,minSnap:le.current,immediate:J.current,config:{velocity:e.velocity}})).then((function(){}))}catch(e){return Promise.reject(e)}}),[pe,d,J]),resizeSmoothly:n.useCallback((function(){try{var e=de.current(X.current);return X.current=e,d.current=e,Promise.resolve(pe({y:e,ready:1,maxHeight:se.current,maxSnap:ce.current,minSnap:le.current,immediate:"element"!==Y.current||J.current})).then((function(){}))}catch(e){return Promise.reject(e)}}),[pe,d,J]),closeSmoothly:n.useCallback((function(e,t){try{return pe({minSnap:X.current,immediate:!0}),X.current=0,Promise.resolve(pe({y:0,maxHeight:se.current,maxSnap:ce.current,immediate:J.current})).then((function(){return Promise.resolve(pe({ready:0,immediate:!0})).then((function(){}))}))}catch(e){return Promise.reject(e)}}),[pe,J])}}),fe=he[0],ge=he[1];n.useEffect((function(){P&&ge(l?"OPEN":"CLOSE")}),[l,ge,P]),xh((function(){(ie||oe||re)&&ge("RESIZE")}),[ie,oe,re,ge]),n.useEffect((function(){return function(){Q.current.deactivate(),te.current.deactivate(),ee.current.deactivate()}}),[ee,te,Q]),n.useImperativeHandle(t,(function(){return{snapTo:function(e,t){var n=void 0===t?{}:t,r=n.velocity,o=void 0===r?1:r,i=n.source,a=void 0===i?"custom":i;ge("SNAP",{payload:{y:de.current(e),velocity:o,source:a}})},get height(){return X.current}}}),[ge]),n.useEffect((function(){var e=q.current,t=function(e){K.current&&e.preventDefault()},n=function(t){e.scrollTop<0&&(requestAnimationFrame((function(){e.style.overflow="hidden",e.scrollTop=0,e.style.removeProperty("overflow")})),t.preventDefault())};return R&&(e.addEventListener("scroll",t),e.addEventListener("touchmove",t),e.addEventListener("touchstart",n)),function(){e.removeEventListener("scroll",t),e.removeEventListener("touchmove",t),e.removeEventListener("touchstart",n)}}),[R,q]);var xe=Vu((function(e){var t=e.args,n=(t=void 0===t?[]:t)[0],r=(n=void 0===n?{}:n).closeOnTap,o=void 0!==r&&r,i=n.isContentDragging,a=void 0!==i&&i,s=e.cancel,l=e.direction[1],c=e.down,d=e.first,u=e.last,h=e.memo,f=void 0===h?B.y.getValue():h,g=e.tap,x=e.velocity,m=-1*e.movement[1];if(!_.current)return s(),f;if(p&&o&&g)return s(),setTimeout((function(){return p()}),0),f;if(g)return f;var v=f+m,b=m*x,y=Math.max(le.current,Math.min(ce.current,v+2*b));if(!c&&p&&l>0&&v+b<le.current/2)return s(),p(),f;var w=c?p||le.current!==ce.current?eu(v,p?0:le.current,ce.current,.55):v<le.current?eu(v,le.current,2*ce.current,.55):eu(v,le.current/2,ce.current,.55):y;return R&&a?(w>=ce.current&&(w=ce.current),f===ce.current&&q.current.scrollTop>0&&(w=ce.current),K.current=w<ce.current):K.current=!1,d&&ge("DRAG"),u?(ge("SNAP",{payload:{y:w,velocity:x>.05?x:1,source:"dragging"}}),f):(H({y:w,ready:1,maxHeight:se.current,maxSnap:ce.current,minSnap:le.current,immediate:!0,config:{velocity:x}}),f)}),{filterTaps:!0});if(Number.isNaN(ce.current))throw new TypeError("maxSnapRef is NaN!!");if(Number.isNaN(le.current))throw new TypeError("minSnapRef is NaN!!");var me=function(e){var t,n=e.spring,r=pd([n.y,n.maxHeight],(function(e,t){return Math.round(mh(t-e,0,16))+"px"})),o=pd([n.y,n.minSnap,n.maxSnap],(function(e,t,n){return mh(e,t,n)+"px"})),i=pd([n.y,n.minSnap,n.maxSnap],(function(e,t,n){return e<t?t-e+"px":e>n?n-e+"px":"0px"})),a=pd([n.y,n.maxSnap],(function(e,t){return e>=t?Math.ceil(e-t):0})),s=pd([n.y,n.minSnap],(function(e,t){if(!t)return 0;var n=Math.max(t/2-45,0);return mh((e-n)*(1/(Math.min(t/2+45,t)-n)+0),0,1)})),l=pd([n.y,n.minSnap],(function(e,t){return t?mh(e/t,0,1):0}));return(t={})["--rsbs-content-opacity"]=s,t["--rsbs-backdrop-opacity"]=l,t["--rsbs-antigap-scale-y"]=a,t["--rsbs-overlay-translate-y"]=i,t["--rsbs-overlay-rounded"]=r,t["--rsbs-overlay-h"]=o,t}({spring:B});return n.createElement(Ud.div,fh({},T,{"data-rsbs-root":!0,"data-rsbs-state":Ph.find(fe.matches),"data-rsbs-is-blocking":b,"data-rsbs-is-dismissable":!!p,"data-rsbs-has-header":!!s,"data-rsbs-has-footer":!!a,className:i,ref:F,style:fh({},me,C,{opacity:B.ready})}),o,b&&n.createElement("div",fh({key:"backdrop","data-rsbs-backdrop":!0},xe({closeOnTap:!0}))),n.createElement("div",{key:"overlay","aria-modal":"true",role:"dialog","data-rsbs-overlay":!0,tabIndex:-1,ref:U,onKeyDown:function(e){"Escape"===e.key&&(e.stopPropagation(),p&&p())}},!1!==s&&n.createElement("div",fh({key:"header","data-rsbs-header":!0,ref:W},xe()),s),n.createElement("div",fh({key:"scroll","data-rsbs-scroll":!0,ref:q},R?xe({isContentDragging:!0}):{}),n.createElement("div",{"data-rsbs-content":!0,ref:Z},r)),a&&n.createElement("div",fh({key:"footer",ref:G,"data-rsbs-footer":!0},xe()),a)))})),Ph=["closed","opening","open","closing","dragging","snapping","resizing"];function Mh(e){var t=e.lastSnap;return null!=t?t:Math.min.apply(Math,e.snapPoints)}function _h(e){return e.minHeight}var Ih=["onSpringStart","onSpringEnd","skipInitialTransition"],Dh=n.forwardRef((function(e,t){var r=e.onSpringStart,o=e.onSpringEnd,i=e.skipInitialTransition,a=gh(e,Ih),s=n.useState(!1),l=s[0],c=s[1],d=n.useRef(),u=n.useRef(null),p=n.useRef(i&&a.open?"OPEN":"CLOSED");xh((function(){if(a.open)return cancelAnimationFrame(d.current),c(!0),function(){p.current="CLOSED"}}),[a.open]);var h=n.useCallback((function(e){return Promise.resolve(null==r?void 0:r(e)).then((function(){"OPEN"===e.type&&cancelAnimationFrame(d.current)}))}),[r]),f=n.useCallback((function(e){return Promise.resolve(null==o?void 0:o(e)).then((function(){"CLOSE"===e.type&&(d.current=requestAnimationFrame((function(){return c(!1)})))}))}),[o]);return l?n.createElement(Ps,{"data-rsbs-portal":!0},n.createElement(Oh,fh({},a,{lastSnapRef:u,ref:t,initialState:p.current,onSpringStart:h,onSpringEnd:f}))):null}));const Ah=o.css`
2483
+ width: 2.5rem;
2484
+ border-radius: 0.25rem;
2480
2485
  background: transparent;
2481
- padding: 4px 6px;
2486
+ padding: 0.25rem 0.375rem;
2482
2487
  cursor: grab;
2483
2488
  &:focus-visible {
2484
2489
  outline-color: ${h("primary",700)};
2485
2490
  }
2486
2491
  div {
2487
- height: 2px;
2488
- margin: 0px 0px;
2492
+ height: 0.125rem;
2493
+ margin: 0;
2489
2494
  background: ${h("neutral",300)};
2490
2495
  }
2491
- `,Ah=(e,t)=>o.css`
2496
+ `,Nh=(e,t)=>o.css`
2492
2497
  [data-rsbs-overlay] {
2493
- border-top-left-radius: 16px;
2494
- border-top-right-radius: 16px;
2498
+ border-top-left-radius: 1rem;
2499
+ border-top-right-radius: 1rem;
2495
2500
  overflow: hidden;
2496
2501
  z-index: ${t};
2497
2502
  }
@@ -2502,8 +2507,8 @@ function ip(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Obj
2502
2507
  }
2503
2508
 
2504
2509
  [data-rsbs-header] {
2505
- padding: 0px;
2506
- min-height: ${e?"50px":"20px"};
2510
+ padding: 0;
2511
+ min-height: ${e?"3.125rem":"1.25rem"};
2507
2512
  }
2508
2513
 
2509
2514
  [data-rsbs-header]:before {
@@ -2511,10 +2516,10 @@ function ip(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Obj
2511
2516
  }
2512
2517
 
2513
2518
  [data-rsbs-footer] {
2514
- padding: 0px;
2515
- min-height: 64px;
2519
+ padding: 0;
2520
+ min-height: 4rem;
2516
2521
  }
2517
- `;!function(e,t){void 0===t&&(t={});var n=t.insertAt;if("undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===n&&r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}("[data-rsbs-overlay] {\n border-top-left-radius: 16px;\n border-top-left-radius: var(--rsbs-overlay-rounded,16px);\n border-top-right-radius: 16px;\n border-top-right-radius: var(--rsbs-overlay-rounded,16px);\n display: flex;\n background: #fff;\n background: var(--rsbs-bg,#fff);\n flex-direction: column;\n height: 0px;\n height: var(--rsbs-overlay-h,0px);\n transform: translate3d(0, 0px, 0);\n transform: translate3d(0, var(--rsbs-overlay-translate-y,0px), 0);\n will-change: height;\n}\n\n[data-rsbs-overlay]:focus {\n outline: none;\n}\n\n[data-rsbs-is-blocking='false'] [data-rsbs-overlay] {\n box-shadow: 0 -5px 60px 0 rgba(38, 89, 115, 0.11),\n 0 -1px 0 rgba(38, 89, 115, 0.05);\n}\n\n[data-rsbs-overlay],\n[data-rsbs-root]:after {\n max-width: auto;\n max-width: var(--rsbs-max-w,auto);\n margin-left: env(safe-area-inset-left);\n margin-left: var(--rsbs-ml,env(safe-area-inset-left));\n margin-right: env(safe-area-inset-right);\n margin-right: var(--rsbs-mr,env(safe-area-inset-right));\n}\n\n[data-rsbs-overlay],\n[data-rsbs-backdrop],\n[data-rsbs-root]:after {\n z-index: 3;\n -ms-scroll-chaining: none;\n overscroll-behavior: none;\n touch-action: none;\n position: fixed;\n right: 0;\n bottom: 0;\n left: 0;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n -webkit-tap-highlight-color: transparent;\n -webkit-touch-callout: none;\n}\n\n[data-rsbs-backdrop] {\n top: -60px;\n bottom: -60px;\n background-color: rgba(0, 0, 0, 0.6);\n background-color: var(--rsbs-backdrop-bg,rgba(0, 0, 0, 0.6));\n will-change: opacity;\n cursor: pointer;\n opacity: 1;\n}\n\n[data-rsbs-is-dismissable='false'] [data-rsbs-backdrop] {\n cursor: ns-resize;\n}\n\n[data-rsbs-root]:after {\n content: '';\n pointer-events: none;\n background: #fff;\n background: var(--rsbs-bg,#fff);\n height: 1px;\n transform-origin: bottom;\n transform: scale3d(1, 0, 1);\n transform: scale3d(1, var(--rsbs-antigap-scale-y,0), 1);\n will-change: transform;\n}\n\n[data-rsbs-footer],\n[data-rsbs-header] {\n flex-shrink: 0;\n cursor: ns-resize;\n padding: 16px;\n}\n\n[data-rsbs-header] {\n text-align: center;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n box-shadow: 0 1px 0\n rgba(46, 59, 66, calc(1 * 0.125));\n box-shadow: 0 1px 0\n rgba(46, 59, 66, calc(var(--rsbs-content-opacity,1) * 0.125));\n z-index: 1;\n padding-top: calc(20px + env(safe-area-inset-top));\n padding-bottom: 8px;\n}\n\n[data-rsbs-header]:before {\n position: absolute;\n content: '';\n display: block;\n width: 36px;\n height: 4px;\n top: calc(8px + env(safe-area-inset-top));\n left: 50%;\n transform: translateX(-50%);\n border-radius: 2px;\n background-color: hsla(0, 0%, 0%, 0.14);\n background-color: var(--rsbs-handle-bg,hsla(0, 0%, 0%, 0.14));\n}\n\n@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 2dppx) {\n [data-rsbs-header]:before {\n transform: translateX(-50%) scaleY(0.75);\n }\n}\n\n[data-rsbs-has-header='false'] [data-rsbs-header] {\n box-shadow: none;\n padding-top: calc(12px + env(safe-area-inset-top));\n}\n\n[data-rsbs-scroll] {\n flex-shrink: 1;\n flex-grow: 1;\n -webkit-tap-highlight-color: revert;\n -webkit-touch-callout: revert;\n -webkit-user-select: auto;\n -ms-user-select: auto;\n -moz-user-select: auto;\n user-select: auto;\n overflow: auto;\n -ms-scroll-chaining: none;\n overscroll-behavior: contain;\n -webkit-overflow-scrolling: touch;\n}\n\n[data-rsbs-scroll]:focus {\n outline: none;\n}\n\n[data-rsbs-has-footer='false'] [data-rsbs-content] {\n padding-bottom: env(safe-area-inset-bottom);\n}\n\n[data-rsbs-content] {\n /* The overflow hidden is to ensure any margin on child nodes are included when the resize observer is measuring the height */\n overflow: hidden;\n}\n\n[data-rsbs-footer] {\n box-shadow: 0 -1px 0 rgba(46, 59, 66, calc(1 * 0.125)),\n 0 2px 0 #fff;\n box-shadow: 0 -1px 0 rgba(46, 59, 66, calc(var(--rsbs-content-opacity,1) * 0.125)),\n 0 2px 0 var(--rsbs-bg,#fff);\n overflow: hidden;\n z-index: 1;\n padding-bottom: calc(16px + env(safe-area-inset-bottom));\n}\n\n[data-rsbs-is-dismissable='true'] [data-rsbs-header] > *, [data-rsbs-is-dismissable='true'] [data-rsbs-scroll] > *, [data-rsbs-is-dismissable='true'] [data-rsbs-footer] > *, [data-rsbs-is-dismissable='false'][data-rsbs-state='opening'] [data-rsbs-header] > *, [data-rsbs-is-dismissable='false'][data-rsbs-state='closing'] [data-rsbs-header] > *, [data-rsbs-is-dismissable='false'][data-rsbs-state='opening'] [data-rsbs-scroll] > *, [data-rsbs-is-dismissable='false'][data-rsbs-state='closing'] [data-rsbs-scroll] > *, [data-rsbs-is-dismissable='false'][data-rsbs-state='opening'] [data-rsbs-footer] > *, [data-rsbs-is-dismissable='false'][data-rsbs-state='closing'] [data-rsbs-footer] > * {\n opacity: 1;\n opacity: var(--rsbs-content-opacity,1);\n }\n\n[data-rsbs-is-dismissable='true'] [data-rsbs-backdrop], [data-rsbs-is-dismissable='false'][data-rsbs-state='opening'] [data-rsbs-backdrop], [data-rsbs-is-dismissable='false'][data-rsbs-state='closing'] [data-rsbs-backdrop] {\n opacity: 1;\n opacity: var(--rsbs-backdrop-opacity,1);\n }\n\n[data-rsbs-state='closed'],\n[data-rsbs-state='closing'] {\n /* Allows interactions on the rest of the page before the close transition is finished */\n pointer-events: none;\n}\n");const Nh=(e,t)=>{let n=0,r=1/0;return t.forEach(((t,o)=>{const i=Math.abs(t-e);i<r&&(r=i,n=o)})),n},Vh=e=>o.css`
2522
+ `;!function(e,t){void 0===t&&(t={});var n=t.insertAt;if("undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===n&&r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}("[data-rsbs-overlay] {\n border-top-left-radius: 16px;\n border-top-left-radius: var(--rsbs-overlay-rounded,16px);\n border-top-right-radius: 16px;\n border-top-right-radius: var(--rsbs-overlay-rounded,16px);\n display: flex;\n background: #fff;\n background: var(--rsbs-bg,#fff);\n flex-direction: column;\n height: 0px;\n height: var(--rsbs-overlay-h,0px);\n transform: translate3d(0, 0px, 0);\n transform: translate3d(0, var(--rsbs-overlay-translate-y,0px), 0);\n will-change: height;\n}\n\n[data-rsbs-overlay]:focus {\n outline: none;\n}\n\n[data-rsbs-is-blocking='false'] [data-rsbs-overlay] {\n box-shadow: 0 -5px 60px 0 rgba(38, 89, 115, 0.11),\n 0 -1px 0 rgba(38, 89, 115, 0.05);\n}\n\n[data-rsbs-overlay],\n[data-rsbs-root]:after {\n max-width: auto;\n max-width: var(--rsbs-max-w,auto);\n margin-left: env(safe-area-inset-left);\n margin-left: var(--rsbs-ml,env(safe-area-inset-left));\n margin-right: env(safe-area-inset-right);\n margin-right: var(--rsbs-mr,env(safe-area-inset-right));\n}\n\n[data-rsbs-overlay],\n[data-rsbs-backdrop],\n[data-rsbs-root]:after {\n z-index: 3;\n -ms-scroll-chaining: none;\n overscroll-behavior: none;\n touch-action: none;\n position: fixed;\n right: 0;\n bottom: 0;\n left: 0;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n -webkit-tap-highlight-color: transparent;\n -webkit-touch-callout: none;\n}\n\n[data-rsbs-backdrop] {\n top: -60px;\n bottom: -60px;\n background-color: rgba(0, 0, 0, 0.6);\n background-color: var(--rsbs-backdrop-bg,rgba(0, 0, 0, 0.6));\n will-change: opacity;\n cursor: pointer;\n opacity: 1;\n}\n\n[data-rsbs-is-dismissable='false'] [data-rsbs-backdrop] {\n cursor: ns-resize;\n}\n\n[data-rsbs-root]:after {\n content: '';\n pointer-events: none;\n background: #fff;\n background: var(--rsbs-bg,#fff);\n height: 1px;\n transform-origin: bottom;\n transform: scale3d(1, 0, 1);\n transform: scale3d(1, var(--rsbs-antigap-scale-y,0), 1);\n will-change: transform;\n}\n\n[data-rsbs-footer],\n[data-rsbs-header] {\n flex-shrink: 0;\n cursor: ns-resize;\n padding: 16px;\n}\n\n[data-rsbs-header] {\n text-align: center;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n box-shadow: 0 1px 0\n rgba(46, 59, 66, calc(1 * 0.125));\n box-shadow: 0 1px 0\n rgba(46, 59, 66, calc(var(--rsbs-content-opacity,1) * 0.125));\n z-index: 1;\n padding-top: calc(20px + env(safe-area-inset-top));\n padding-bottom: 8px;\n}\n\n[data-rsbs-header]:before {\n position: absolute;\n content: '';\n display: block;\n width: 36px;\n height: 4px;\n top: calc(8px + env(safe-area-inset-top));\n left: 50%;\n transform: translateX(-50%);\n border-radius: 2px;\n background-color: hsla(0, 0%, 0%, 0.14);\n background-color: var(--rsbs-handle-bg,hsla(0, 0%, 0%, 0.14));\n}\n\n@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 2dppx) {\n [data-rsbs-header]:before {\n transform: translateX(-50%) scaleY(0.75);\n }\n}\n\n[data-rsbs-has-header='false'] [data-rsbs-header] {\n box-shadow: none;\n padding-top: calc(12px + env(safe-area-inset-top));\n}\n\n[data-rsbs-scroll] {\n flex-shrink: 1;\n flex-grow: 1;\n -webkit-tap-highlight-color: revert;\n -webkit-touch-callout: revert;\n -webkit-user-select: auto;\n -ms-user-select: auto;\n -moz-user-select: auto;\n user-select: auto;\n overflow: auto;\n -ms-scroll-chaining: none;\n overscroll-behavior: contain;\n -webkit-overflow-scrolling: touch;\n}\n\n[data-rsbs-scroll]:focus {\n outline: none;\n}\n\n[data-rsbs-has-footer='false'] [data-rsbs-content] {\n padding-bottom: env(safe-area-inset-bottom);\n}\n\n[data-rsbs-content] {\n /* The overflow hidden is to ensure any margin on child nodes are included when the resize observer is measuring the height */\n overflow: hidden;\n}\n\n[data-rsbs-footer] {\n box-shadow: 0 -1px 0 rgba(46, 59, 66, calc(1 * 0.125)),\n 0 2px 0 #fff;\n box-shadow: 0 -1px 0 rgba(46, 59, 66, calc(var(--rsbs-content-opacity,1) * 0.125)),\n 0 2px 0 var(--rsbs-bg,#fff);\n overflow: hidden;\n z-index: 1;\n padding-bottom: calc(16px + env(safe-area-inset-bottom));\n}\n\n[data-rsbs-is-dismissable='true'] [data-rsbs-header] > *, [data-rsbs-is-dismissable='true'] [data-rsbs-scroll] > *, [data-rsbs-is-dismissable='true'] [data-rsbs-footer] > *, [data-rsbs-is-dismissable='false'][data-rsbs-state='opening'] [data-rsbs-header] > *, [data-rsbs-is-dismissable='false'][data-rsbs-state='closing'] [data-rsbs-header] > *, [data-rsbs-is-dismissable='false'][data-rsbs-state='opening'] [data-rsbs-scroll] > *, [data-rsbs-is-dismissable='false'][data-rsbs-state='closing'] [data-rsbs-scroll] > *, [data-rsbs-is-dismissable='false'][data-rsbs-state='opening'] [data-rsbs-footer] > *, [data-rsbs-is-dismissable='false'][data-rsbs-state='closing'] [data-rsbs-footer] > * {\n opacity: 1;\n opacity: var(--rsbs-content-opacity,1);\n }\n\n[data-rsbs-is-dismissable='true'] [data-rsbs-backdrop], [data-rsbs-is-dismissable='false'][data-rsbs-state='opening'] [data-rsbs-backdrop], [data-rsbs-is-dismissable='false'][data-rsbs-state='closing'] [data-rsbs-backdrop] {\n opacity: 1;\n opacity: var(--rsbs-backdrop-opacity,1);\n }\n\n[data-rsbs-state='closed'],\n[data-rsbs-state='closing'] {\n /* Allows interactions on the rest of the page before the close transition is finished */\n pointer-events: none;\n}\n");const Vh=(e,t)=>{let n=0,r=1/0;return t.forEach(((t,o)=>{const i=Math.abs(t-e);i<r&&(r=i,n=o)})),n},zh=e=>o.css`
2518
2523
  a,
2519
2524
  p {
2520
2525
  font-size: ${"small"===e?"0.75rem":"1rem"};
@@ -2546,19 +2551,19 @@ function ip(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Obj
2546
2551
  a:hover {
2547
2552
  text-decoration: underline;
2548
2553
  }
2549
- `,zh=e=>o.css`
2554
+ `,Bh=e=>o.css`
2550
2555
  svg {
2551
2556
  height: ${"small"===e?"0.5rem":"0.75rem"};
2552
2557
  width: ${"small"===e?"0.5rem":"0.75rem"};
2553
2558
  color: ${h("neutral",600)};
2554
2559
  }
2555
- `,Bh=o.css`
2560
+ `,Hh=o.css`
2556
2561
  cursor: pointer;
2557
2562
  color: ${h("neutral",600)};
2558
2563
  display: flex;
2559
2564
  justify-content: center;
2560
2565
  align-items: center;
2561
- `,Hh=e=>"number"==typeof e?`${(e=>parseFloat(e.toFixed(4)).toString())(.25*e)}rem`:e,Fh=(e,t)=>o.css`
2566
+ `,Fh=(e,t)=>o.css`
2562
2567
  min-height: 3.5rem;
2563
2568
  width: 100vw;
2564
2569
  position: ${e?"sticky":"absolute"};
@@ -2570,7 +2575,7 @@ function ip(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Obj
2570
2575
  `,qh=e=>o.css`
2571
2576
  height: 100%;
2572
2577
  width: 100%;
2573
- max-width: ${null!=e?Hh(e):"100%"};
2578
+ max-width: ${null!=e?ms(e):"100%"};
2574
2579
  display: flex;
2575
2580
  align-items: center;
2576
2581
  justify-content: space-between;
@@ -2750,7 +2755,7 @@ function ip(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Obj
2750
2755
  `,tf=(e,t,n)=>o.css`
2751
2756
  height: ${n?"1.75rem":"3rem"};
2752
2757
  width: 100%;
2753
- max-width: ${t?Hh(t):"100%"};
2758
+ max-width: ${t?ms(t):"100%"};
2754
2759
  background-color: ${e?h("neutral",800):"transparent"};
2755
2760
  display: flex;
2756
2761
  align-items: ${n?"start":"center"};
@@ -3717,7 +3722,7 @@ function ip(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Obj
3717
3722
  background-image: url(${t});
3718
3723
  background-size: cover;
3719
3724
  background-position: center;
3720
- `)}),r.jsxs("div",{css:Dn,children:[r.jsxs("div",{className:"ds-base-map-title-container",children:[r.jsx("p",{className:"ds-base-map-title",children:e.label}),e.active?r.jsx(en,{label:u.activeLabel,variant:"warning",size:"small",icon:r.jsx($,{})}):null]}),r.jsx("p",{className:"ds-base-map-caption",children:e.caption}),e.active&&e.children?r.jsx("div",{className:"ds-base-map-children",children:e.children}):null]})]},e.label);var t}))}):null]})]})})},exports.Breadcrumb=({links:t,separator:o,maxItems:i=99,linkRouter:a,size:s="default"})=>{const[l,c]=n.useState(t.length>i);n.useEffect((()=>{c(t.length>i)}),[t.length]);const d=a;return r.jsx(e.Breadcrumb.Root,{children:r.jsx(e.Breadcrumb.List,{gap:"small"===s?"0.375rem":"0.625rem",children:l?r.jsxs(r.Fragment,{children:[r.jsx(e.Breadcrumb.Item,{css:Vh(s),children:r.jsxs(d,{to:t[0].link,href:t[0].link,children:[t[0].icon,t[0].label]})}),r.jsx(e.Breadcrumb.Separator,{css:zh(s),children:o||r.jsx(L,{rotate:"270"})}),r.jsx("li",{className:"chakra-breadcrumb__item",children:r.jsx("button",{css:Bh,type:"button",onClick:()=>c(!1),children:"..."})}),r.jsx(e.Breadcrumb.Separator,{css:zh(s),children:o||r.jsx(L,{rotate:"270"})}),r.jsx(e.Breadcrumb.Item,{css:Vh(s),children:r.jsxs("p",{"aria-current":"page","aria-label":t[t.length-1].label,children:[t[t.length-1].icon,t[t.length-1].label]})})]}):t.map(((i,a)=>i?.label?r.jsxs(n.Fragment,{children:[r.jsx(e.Breadcrumb.Item,{css:Vh(s),children:a<t.length-1?r.jsxs(d,{to:i.link,href:i.link,children:[i.icon,i.label]}):r.jsxs("p",{"aria-current":"page","aria-label":i.label,children:[i.label&&i.icon?i.icon:"",i.label]})}),a<t.length-1?r.jsx(e.Breadcrumb.Separator,{css:zh(s),children:o||r.jsx(L,{rotate:"270"})}):null]},i.label):null))})})},exports.Button=C,exports.Checkbox=De,exports.CheckboxList=({label:t,caption:i,checkboxes:a,defaultValues:s,onCheckedChange:l,errorMessage:c,horizontal:d,required:u,hideCheckedCounter:p=!1,hideExpandToggle:h=!1,labels:f})=>{const g=w("CheckboxList",f),x=Array.isArray(s)?s:[],m=n.useMemo((()=>new Set(x)),[x]),[v,b]=n.useState((()=>a.filter((e=>e.name)).reduce(((e,t)=>{const n=t.name;return e[n]="boolean"==typeof t.checked?t.checked:m.has(n),e}),{}))),[y,C]=n.useState(!0);n.useEffect((()=>{b((e=>{const t=a.filter((e=>e.name)).reduce(((t,n)=>{const r=n.name;return t[r]="boolean"==typeof n.checked?n.checked:e[r]??m.has(r),t}),{});return Object.keys(e).length===Object.keys(t).length&&Object.entries(t).every((([t,n])=>e[t]===n))?e:t}))}),[a,m]);const j="string"!=typeof t,k=a.filter((e=>e.name)).reduce(((e,t)=>{const n=t.name;return e[n]="boolean"==typeof t.checked?t.checked:!!v[n],e}),{}),$=a.length>0&&a.every((e=>e.name&&k[e.name])),S=a.some((e=>e.name&&k[e.name]))&&!$,E=a.length,R=`${a.filter((e=>e?.name&&k[e.name])).length} / ${E}`,T=i?`${i}.`:"",O=u?g.requiredLabel:g.optionalLabel,P=c?`${g.errorPrefix} ${c}.`:"",M=`${j?t.label:t}. ${T} ${O} ${P} `;return r.jsxs(e.Group,{css:ut,"aria-label":M,children:[c?r.jsx("div",{css:gt}):null,r.jsxs("div",{css:(_=!!c,o.css`
3725
+ `)}),r.jsxs("div",{css:Dn,children:[r.jsxs("div",{className:"ds-base-map-title-container",children:[r.jsx("p",{className:"ds-base-map-title",children:e.label}),e.active?r.jsx(en,{label:u.activeLabel,variant:"warning",size:"small",icon:r.jsx($,{})}):null]}),r.jsx("p",{className:"ds-base-map-caption",children:e.caption}),e.active&&e.children?r.jsx("div",{className:"ds-base-map-children",children:e.children}):null]})]},e.label);var t}))}):null]})]})})},exports.Breadcrumb=({links:t,separator:o,maxItems:i=99,linkRouter:a,size:s="default"})=>{const[l,c]=n.useState(t.length>i);n.useEffect((()=>{c(t.length>i)}),[t.length]);const d=a;return r.jsx(e.Breadcrumb.Root,{children:r.jsx(e.Breadcrumb.List,{gap:"small"===s?"0.375rem":"0.625rem",children:l?r.jsxs(r.Fragment,{children:[r.jsx(e.Breadcrumb.Item,{css:zh(s),children:r.jsxs(d,{to:t[0].link,href:t[0].link,children:[t[0].icon,t[0].label]})}),r.jsx(e.Breadcrumb.Separator,{css:Bh(s),children:o||r.jsx(L,{rotate:"270"})}),r.jsx("li",{className:"chakra-breadcrumb__item",children:r.jsx("button",{css:Hh,type:"button",onClick:()=>c(!1),children:"..."})}),r.jsx(e.Breadcrumb.Separator,{css:Bh(s),children:o||r.jsx(L,{rotate:"270"})}),r.jsx(e.Breadcrumb.Item,{css:zh(s),children:r.jsxs("p",{"aria-current":"page","aria-label":t[t.length-1].label,children:[t[t.length-1].icon,t[t.length-1].label]})})]}):t.map(((i,a)=>i?.label?r.jsxs(n.Fragment,{children:[r.jsx(e.Breadcrumb.Item,{css:zh(s),children:a<t.length-1?r.jsxs(d,{to:i.link,href:i.link,children:[i.icon,i.label]}):r.jsxs("p",{"aria-current":"page","aria-label":i.label,children:[i.label&&i.icon?i.icon:"",i.label]})}),a<t.length-1?r.jsx(e.Breadcrumb.Separator,{css:Bh(s),children:o||r.jsx(L,{rotate:"270"})}):null]},i.label):null))})})},exports.Button=C,exports.Checkbox=De,exports.CheckboxList=({label:t,caption:i,checkboxes:a,defaultValues:s,onCheckedChange:l,errorMessage:c,horizontal:d,required:u,hideCheckedCounter:p=!1,hideExpandToggle:h=!1,labels:f})=>{const g=w("CheckboxList",f),x=Array.isArray(s)?s:[],m=n.useMemo((()=>new Set(x)),[x]),[v,b]=n.useState((()=>a.filter((e=>e.name)).reduce(((e,t)=>{const n=t.name;return e[n]="boolean"==typeof t.checked?t.checked:m.has(n),e}),{}))),[y,C]=n.useState(!0);n.useEffect((()=>{b((e=>{const t=a.filter((e=>e.name)).reduce(((t,n)=>{const r=n.name;return t[r]="boolean"==typeof n.checked?n.checked:e[r]??m.has(r),t}),{});return Object.keys(e).length===Object.keys(t).length&&Object.entries(t).every((([t,n])=>e[t]===n))?e:t}))}),[a,m]);const j="string"!=typeof t,k=a.filter((e=>e.name)).reduce(((e,t)=>{const n=t.name;return e[n]="boolean"==typeof t.checked?t.checked:!!v[n],e}),{}),$=a.length>0&&a.every((e=>e.name&&k[e.name])),S=a.some((e=>e.name&&k[e.name]))&&!$,E=a.length,R=`${a.filter((e=>e?.name&&k[e.name])).length} / ${E}`,T=i?`${i}.`:"",O=u?g.requiredLabel:g.optionalLabel,P=c?`${g.errorPrefix} ${c}.`:"",M=`${j?t.label:t}. ${T} ${O} ${P} `;return r.jsxs(e.Group,{css:ut,"aria-label":M,children:[c?r.jsx("div",{css:gt}):null,r.jsxs("div",{css:(_=!!c,o.css`
3721
3726
  margin-left: ${_?"19px":"0px"};
3722
3727
  width: 100%;
3723
3728
  `),children:[r.jsx("div",{css:pt,children:"string"==typeof t?r.jsxs(r.Fragment,{children:[u&&r.jsx("span",{id:"required-symbol","aria-label":g.requiredSymbolLabel,children:"*"}),t]}):r.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%"},children:[r.jsxs(De,{checked:$,indeterminate:S,onCheckedChange:e=>(e=>{const t=a.filter((e=>void 0!==e.name)).reduce(((t,n)=>(t[n.name]=e,t)),{});b(t),l?.(t)})(!!e.checked),children:[t.label," ",!p&&r.jsx("span",{"aria-hidden":"true",css:mt,children:R})]}),!h&&r.jsxs("button",{type:"button",onClick:()=>C((e=>!e)),"aria-expanded":y,"aria-controls":"checkbox-list",css:vt,children:[y?g.hideLabel:g.expandLabel,r.jsx("span",{"aria-hidden":"true",children:y?r.jsx(L,{style:{transform:"rotate(180deg)"}}):r.jsx(L,{})})]})]})}),r.jsx("p",{css:ht,"aria-label":i,children:i}),c?r.jsx("p",{css:xt,"aria-label":c,children:c}):null,r.jsx("div",{id:"checkbox-list",css:ft(d,y),children:a.map((e=>{const{onCheckedChange:t,...n}=e;return r.jsx(De,{ms:j&&!d?"6":"",css:{},checked:!!e?.name&&!!k[e.name],onCheckedChange:({checked:n})=>{((e,t)=>{const n={...v};t&&(n[t]=e,b(n)),l&&l(n)})(n,e.name),t?.({checked:!!n})},...n},e.name)}))})]})]});var _},exports.CheckboxOptionCard=({defaultValue:t,items:n,onValueChange:i})=>r.jsx(e.CheckboxGroup,{defaultValue:t,onValueChange:i,children:r.jsx(e.HStack,{alignItems:"flex-start",flexWrap:"wrap",gap:"12px",children:n.map((n=>{return r.jsxs(e.CheckboxCard.Root,{css:Ae,defaultChecked:-1!==t?.indexOf(n.value),disabled:n.disabled,value:n.value,children:[r.jsx(e.CheckboxCard.HiddenInput,{}),r.jsxs(e.CheckboxCard.Control,{css:Ne,children:[r.jsxs(e.CheckboxCard.Content,{css:(a=n.variant,o.css`
@@ -3733,7 +3738,7 @@ function ip(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Obj
3733
3738
  padding: 0px;
3734
3739
  padding-top: 8px;
3735
3740
  color: ${i?h("neutral",500):"inherit"};
3736
- `),children:n.children}):null]},`${n.label}-${n.value}`);var i,a}))})}),exports.CloseButton=de,exports.ClusterPoint=({onClick:e,triggerRef:n,showFocusState:r,count:o,mode:i,variant:a="cluster"})=>t.jsx(Nn,{count:o,mode:i,onClick:e,ref:n,showFocusState:r,variant:a}),exports.Combobox=({label:t,required:o,caption:i,errorMessage:a,size:s,disabled:l,placeholder:c,labels:d,noMarginBottom:u,initialItems:p=[],multiple:h=!1,showSelectedItems:f=!1})=>{const[g,x]=n.useState([]),m=w("TextInput",d),{contains:v}=e.useFilter({sensitivity:"base"}),{collection:b,filter:y}=e.useListCollection({initialItems:p,filter:v});return r.jsxs("div",{css:$t(s,u),className:"ds-text-input-container",children:[a?r.jsx("div",{css:St}):null,r.jsxs(e.Field.Root,{required:o,invalid:!!a,gap:"0",style:{marginLeft:a?"19px":"0px"},children:[t?r.jsxs(e.Field.Label,{css:Et(s,l),"aria-label":t,children:[r.jsx(e.Field.RequiredIndicator,{"aria-label":m.requiredSymbolLabel}),t,o?"":r.jsx("span",{children:m.optionalSuffix})]}):null,i?r.jsx(e.Field.HelperText,{css:Lt(s,l),"aria-label":i,children:i}):null,a?r.jsx(e.Field.ErrorText,{css:Rt(s),"aria-label":a,children:a}):null,r.jsxs(e.Combobox.Root,{multiple:h,onValueChange:e=>{x(e.items.map((e=>({label:e.label,value:e.value}))))},value:g.map((e=>e.value)),collection:b,onInputValueChange:e=>y(e.inputValue),width:"320px",size:"small"===s?"sm":"md",children:[r.jsxs(e.Combobox.Control,{children:[r.jsx(e.Combobox.Input,{placeholder:c,css:Tt(s),disabled:l}),r.jsxs(e.Combobox.IndicatorGroup,{children:[r.jsx(e.Combobox.ClearTrigger,{}),r.jsx(e.Combobox.Trigger,{})]})]}),r.jsx(e.Portal,{children:r.jsx(e.Combobox.Positioner,{children:r.jsxs(e.Combobox.Content,{children:[r.jsx(e.Combobox.Empty,{children:"No items found"}),b.items.map((t=>r.jsxs(e.Combobox.Item,{item:t,children:[t.label,r.jsx(e.Combobox.ItemIndicator,{})]},t.value)))]})})}),r.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"flex-start",gap:"0.25rem",paddingTop:"0.5rem"},children:f&&g.map((e=>r.jsx(en,{label:e.label,variant:"info-white",onClose:()=>x((t=>t.filter((t=>t.value!==e.value)))),closable:!0},e.value)))})]})]})]})},exports.DesignSystemLocaleProvider=({labels:e,children:r})=>{const o=n.useMemo((()=>({labels:e})),[e]);return t.jsx(f.Provider,{value:o,children:r})},exports.ExtendableCard=({children:t,header:n,footer:o})=>r.jsx(e.Box,{css:ga,children:r.jsx(e.Accordion.Root,{multiple:!0,children:r.jsxs(e.Accordion.Item,{value:"extendable-card-item",children:[r.jsxs(e.Accordion.ItemTrigger,{css:xa,alignItems:"center",children:[r.jsx(e.Flex,{gap:3,flex:"1",overflow:"hidden",alignItems:"center",children:n}),r.jsx(e.Accordion.ItemIndicator,{children:r.jsx(L,{color:"var(--chakra-colors-neutral-700)",height:"16px",width:"16px"})})]}),r.jsxs(e.Accordion.ItemContent,{children:[t,o]})]})})}),exports.Footer=({children:e,label:t="© World Resources Institute",fixed:n,filled:o,maxWidth:i,additionalLogos:a})=>{const s=(new Date).getFullYear();return r.jsx("footer",{css:Fh(n,o),children:r.jsxs("div",{css:qh(i),children:[r.jsxs("div",{css:Gh,children:[r.jsx(N,{height:"2rem",width:"5.6875rem"}),a&&a.map(((e,t)=>r.jsx("div",{children:e},t)))]}),r.jsx("div",{css:Zh,children:e}),r.jsx("div",{children:r.jsxs("p",{css:Wh,children:[t," ",s]})})]})})},exports.FormContainer=({label:e,error:t,children:n})=>r.jsxs("div",{css:Oe,children:[t?r.jsx("div",{css:Me}):null,r.jsxs("div",{children:[e?r.jsx("p",{css:Pe,children:e}):null,t?r.jsx("p",{css:_e,"aria-label":t,children:t}):null,n]})]}),exports.IconButton=ce,exports.InlineMessage=({label:e,caption:t,variant:n,size:o="large",icon:i=r.jsx(E,{height:"16px",width:"16px"}),onActionClick:a,actionLabel:s,isButtonRight:l,buttonLeftIcon:c,buttonRightIcon:d,labels:u})=>{const p=w("InlineMessage",u);let h=tg;return"info-grey"===n?h=ng:"success"===n?h=rg:"warning"===n?h=og:"error"===n&&(h=ig),r.jsxs("div",{css:[Yf(o,l),h],"aria-roledescription":p.roleDescription,children:[r.jsxs("div",{children:[r.jsxs("div",{css:Kf,children:[i,r.jsx("p",{css:Jf(o),children:e})]}),t&&"string"==typeof t?r.jsx("p",{css:Qf(o,!!i),children:t}):t?r.jsx("div",{css:eg(o,!!i),children:t}):null]}),s?r.jsx(C,{label:s,variant:"info-white"===n||"info-grey"===n?"primary":"secondary",size:"large"===o?"default":"small",onClick:a,leftIcon:c,rightIcon:d}):null]})},exports.InputWithUnits=({label:t,caption:o,errorMessage:i,units:a,unitsPosition:s="end",defaultUnit:l="",defaultValue:c="",onChange:d,required:u,disabled:p})=>{const[h,f]=n.useState(c),[g,x]=n.useState(l?[l]:[a[0].value]),m=(e,t)=>{d&&d("end"===s?""+(t?`${h} ${e}`:`${e} ${g}`):""+(t?`${e} ${h}`:`${g} ${e}`))};return r.jsxs("div",{css:bt,children:[i?r.jsx("div",{css:Ct}):null,r.jsxs("div",{style:{marginLeft:i?"19px":"0px"},children:[r.jsxs("p",{css:yt(p),"aria-label":t,children:[u?r.jsx("span",{children:"*"}):null,t]}),r.jsx("p",{css:wt(p),"aria-label":o,children:o}),i?r.jsx("p",{css:jt,"aria-label":i,children:i}):null,r.jsxs(e.Group,{css:kt(!!i,s),attached:!0,children:["start"===s?r.jsx(rn,{placeholder:"",value:g,items:a,disabled:p,onChange:e=>{x(e),m(e?.[0],!0)}}):null,r.jsx(Ot,{type:"number",value:h,disabled:p,onChange:e=>{f(e.target.value),m(e.target.value)}}),"end"===s?r.jsx(rn,{placeholder:"",value:g,items:a,disabled:p,onChange:e=>{x(e),m(e?.[0],!0)}}):null]})]})]})},exports.ItemCount=Fi,exports.LayerGroup=({label:t,caption:o,value:i,layerItems:a,onChangeForRadioVariant:s,labels:l})=>{const c=w("LayerGroup",l),[d,u]=n.useState({}),[p]=n.useState((e=>{const t=e.find((e=>"radio"===e.variant&&e.isDefaultSelected));return t?.name})(a));n.useEffect((()=>{let e={...d};a.forEach((n=>{n.isDefaultSelected&&(e={...e,["radio"===n.variant?t:n.name]:n.isDefaultSelected})})),u(e)}),[]);const h=(e,t,n,r)=>{const o={...d,[e]:t};u(o),n&&n(e,t,r)},f=Object.values(d).filter((e=>!0===e)).length,g=c.groupAriaLabel(t,f,o);return r.jsxs(e.Accordion.Item,{value:i,width:"100%",children:[r.jsxs(e.Accordion.ItemTrigger,{css:ni,alignItems:"flex-start","aria-label":g,children:[r.jsxs(e.Box,{width:"full",display:"flex",flexDirection:"column",alignItems:"flex-start",children:[r.jsxs("span",{css:ri,children:[t,r.jsx(en,{label:c.activeTagLabel(f),size:"small",variant:f>0?"success":"info-grey"})]}),r.jsx("div",{css:oi,children:o})]}),r.jsx(e.Accordion.ItemIndicator,{display:"flex",children:r.jsx(L,{color:"var(--chakra-colors-neutral-700)",height:"16px",width:"16px"})})]}),r.jsx(e.Accordion.ItemContent,{paddingLeft:"16px",paddingRight:"16px",children:r.jsx(Qe,{name:t,value:p,customGap:"0px",onChange:(e,t)=>h(e,!!t,s,t),children:a.map((e=>r.jsx(di,{...e,onChange:(t,n)=>h(t,n,e.onChange)},e.label)))})})]})},exports.LayerGroupContainer=({children:t,defaultValue:n,...o})=>r.jsx("div",{css:ti,style:{width:"100%"},children:r.jsx(e.Accordion.Root,{css:{},defaultValue:n,multiple:!0,...o,children:t})}),exports.LayerItem=di,exports.LayerParameters=({label:t,children:o,openedByDefault:i})=>r.jsx("div",{children:r.jsx(e.Accordion.Root,{defaultValue:i?[t]:[],multiple:!0,children:r.jsxs(e.Accordion.Item,{css:ui,value:t,children:[r.jsxs(e.Accordion.ItemTrigger,{css:pi,children:[r.jsx(e.Box,{width:"full",display:"flex",flexDirection:"column",alignItems:"flex-start",children:r.jsx("p",{css:hi,children:t})}),r.jsx(e.Accordion.ItemIndicator,{display:"flex",children:r.jsx(L,{color:"var(--chakra-colors-neutral-700)",height:"16px",width:"16px"})})]}),r.jsx(e.Accordion.ItemContent,{css:fi,children:n.Children.map(o,(e=>r.jsx("div",{className:"ds-layer-parameters-item-child",children:e})))})]})})}),exports.LegendItem=({layerName:e,dataUnit:t,onDrag:n,onUpClick:o,onDownClick:i,onRemoveClick:a,children:s,onInfoClick:l,onOpacityChanged:c,labels:d})=>{const u=w("LegendItem",d);return r.jsxs("div",{css:gi,children:[r.jsxs("div",{css:xi,children:[r.jsx(ce,{icon:r.jsx(_,{}),"aria-label":u.dragAndDropLabel,"aria-hidden":!0,onClick:n,style:{display:"none",marginBottom:"12px"}}),r.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"12px"},children:[r.jsx(ce,{icon:r.jsx(L,{rotate:"180"}),"aria-label":u.upLabel,onClick:o}),r.jsx(ce,{icon:r.jsx(L,{}),"aria-label":u.downLabel,onClick:i})]})]}),r.jsxs("div",{style:{width:"100%"},children:[r.jsxs("div",{css:mi,children:[r.jsxs("div",{children:[r.jsx("h3",{css:vi,children:e}),r.jsx("p",{css:bi,children:t})]}),r.jsx(C,{label:u.removeLabel,size:"small",variant:"secondary",rightIcon:r.jsx(T,{}),onClick:a})]}),s,r.jsxs("div",{css:yi,children:[r.jsx(C,{label:u.aboutDataLabel,size:"small",variant:"secondary",leftIcon:r.jsx(E,{}),onClick:l}),r.jsx($i,{defaultValue:80,onOpacityChanged:c})]})]})]})},exports.List=Ji,exports.MapControlsToolbar=({onZoomInClick:e,onZoomOutClick:n,onExpandClick:r,onShareClick:o,onPrintClick:i,onSettingsClick:a,onQuestionClick:s,vertical:l,expanded:c,showExpandedToggle:d,ariaLabel:u,labels:p})=>{const h=w("MapControlsToolbar",p),f=[{icon:t.jsx(z,{}),label:h.zoomInLabel,ariaLabel:h.zoomInAriaLabel,onClick:e},{icon:t.jsx(B,{}),label:h.zoomOutLabel,ariaLabel:h.zoomOutAriaLabel,onClick:n,gap:!0},{icon:t.jsx(H,{}),label:h.expandLabel,ariaLabel:h.expandAriaLabel,onClick:r,gap:!0},{icon:t.jsx(F,{}),label:h.shareLabel,ariaLabel:h.shareAriaLabel,onClick:o,gap:!0},{icon:t.jsx(q,{}),label:h.printLabel,ariaLabel:h.printAriaLabel,onClick:i,gap:!0},{icon:t.jsx(Z,{}),label:h.settingsLabel,ariaLabel:h.settingsAriaLabel,onClick:a,gap:!0},{icon:t.jsx(W,{}),label:h.helpLabel,ariaLabel:h.helpAriaLabel,onClick:s}];return t.jsx(me,{items:f,vertical:l,expanded:c,showExpandedToggle:d,ariaLabel:u||h.toolbarAriaLabel})},exports.MapMarker=Nn,exports.MapMarkers=Vn,exports.MapPopUp=({open:e,onOpenChange:t,anchorRef:o,header:i,content:a,footer:s,placement:c="bottom",offset:d=30,closeOnEscape:u=!0,closeOnOutsideClick:p=!1,labels:h})=>{const f=w("MapPopUp",h),g=n.useRef(null),{refs:x,floatingStyles:m,context:v,middlewareData:b,placement:y}=Wo({open:e,onOpenChange:t,placement:c,whileElementsMounted:fo,middleware:[So(d),(C={fallbackAxisSideDirection:"start"},{...mo(C),options:[C,j]}),Eo({padding:8}),Lo({element:g})]});var C,j;n.useEffect((()=>{o?.current&&x.setReference(o.current)}),[o,x]);const k=function(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,elements:o,dataRef:i}=e,{enabled:a=!0,escapeKey:s=!0,outsidePress:c=!0,outsidePressEvent:d="pointerdown",referencePress:u=!1,referencePressEvent:p="pointerdown",ancestorScroll:h=!1,bubbles:f,capture:g}=t,x=Bo(),m=Wr("function"==typeof c?c:()=>!1),v="function"==typeof c?m:c,b=l.useRef(!1),{escapeKey:y,outsidePress:w}=qo(f),{escapeKey:C,outsidePress:j}=qo(g),k=l.useRef(!1),$=Wr((e=>{var t;if(!n||!a||!s||"Escape"!==e.key)return;if(k.current)return;const o=null==(t=i.current.floatingContext)?void 0:t.nodeId,l=x?Fr(x.nodesRef.current,o):[];if(!y&&(e.stopPropagation(),l.length>0)){let e=!0;if(l.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__escapeKeyBubbles||(e=!1)})),!e)return}r(!1,function(e){return"nativeEvent"in e}(e)?e.nativeEvent:e,"escape-key")})),S=Wr((e=>{var t;const n=()=>{var t;$(e),null==(t=zr(e))||t.removeEventListener("keydown",n)};null==(t=zr(e))||t.addEventListener("keydown",n)})),E=Wr((e=>{var t;const n=i.current.insideReactTree;i.current.insideReactTree=!1;const a=b.current;if(b.current=!1,"click"===d&&a)return;if(n)return;if("function"==typeof v&&!v(e))return;const s=zr(e),l="[data-floating-ui-inert]",c=Hr(o.floating).querySelectorAll(l);let u=Zn(s)?s:null;for(;u&&!ar(u);){const e=cr(u);if(ar(e)||!Zn(e))break;u=e}if(c.length&&Zn(s)&&!s.matches("html,body")&&!Vr(s,o.floating)&&Array.from(c).every((e=>!Vr(u,e))))return;if(Wn(s)&&T){const t=ar(s),n=sr(s),r=/auto|scroll/,o=t||r.test(n.overflowX),i=t||r.test(n.overflowY),a=o&&s.clientWidth>0&&s.scrollWidth>s.clientWidth,l=i&&s.clientHeight>0&&s.scrollHeight>s.clientHeight,c="rtl"===n.direction,d=l&&(c?e.offsetX<=s.offsetWidth-s.clientWidth:e.offsetX>s.clientWidth),u=a&&e.offsetY>s.clientHeight;if(d||u)return}const p=null==(t=i.current.floatingContext)?void 0:t.nodeId,h=x&&Fr(x.nodesRef.current,p).some((t=>{var n;return Br(e,null==(n=t.context)?void 0:n.elements.floating)}));if(Br(e,o.floating)||Br(e,o.domReference)||h)return;const f=x?Fr(x.nodesRef.current,p):[];if(f.length>0){let e=!0;if(f.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__outsidePressBubbles||(e=!1)})),!e)return}r(!1,e,"outside-press")})),L=Wr((e=>{var t;const n=()=>{var t;E(e),null==(t=zr(e))||t.removeEventListener(d,n)};null==(t=zr(e))||t.addEventListener(d,n)}));l.useEffect((()=>{if(!n||!a)return;i.current.__escapeKeyBubbles=y,i.current.__outsidePressBubbles=w;let e=-1;function t(e){r(!1,e,"ancestor-scroll")}function l(){window.clearTimeout(e),k.current=!0}function c(){e=window.setTimeout((()=>{k.current=!1}),or()?5:0)}const u=Hr(o.floating);s&&(u.addEventListener("keydown",C?S:$,C),u.addEventListener("compositionstart",l),u.addEventListener("compositionend",c)),v&&u.addEventListener(d,j?L:E,j);let p=[];return h&&(Zn(o.domReference)&&(p=ur(o.domReference)),Zn(o.floating)&&(p=p.concat(ur(o.floating))),!Zn(o.reference)&&o.reference&&o.reference.contextElement&&(p=p.concat(ur(o.reference.contextElement)))),p=p.filter((e=>{var t;return e!==(null==(t=u.defaultView)?void 0:t.visualViewport)})),p.forEach((e=>{e.addEventListener("scroll",t,{passive:!0})})),()=>{s&&(u.removeEventListener("keydown",C?S:$,C),u.removeEventListener("compositionstart",l),u.removeEventListener("compositionend",c)),v&&u.removeEventListener(d,j?L:E,j),p.forEach((e=>{e.removeEventListener("scroll",t)})),window.clearTimeout(e)}}),[i,o,s,v,d,n,r,h,a,y,w,$,C,S,E,j,L]),l.useEffect((()=>{i.current.insideReactTree=!1}),[i,v,d]);const R=l.useMemo((()=>({onKeyDown:$,...u&&{[Ho[p]]:e=>{r(!1,e.nativeEvent,"reference-press")},..."click"!==p&&{onClick(e){r(!1,e.nativeEvent,"reference-press")}}}})),[$,r,u,p]),T=l.useMemo((()=>({onKeyDown:$,onMouseDown(){b.current=!0},onMouseUp(){b.current=!0},[Fo[d]]:()=>{i.current.insideReactTree=!0}})),[$,d,i]);return l.useMemo((()=>a?{reference:R,floating:T}:{}),[a,R,T])}(v,{escapeKey:u,outsidePress:p}),$=Xo(v,{role:"dialog"}),{getFloatingProps:S}=function(e){void 0===e&&(e=[]);const t=e.map((e=>null==e?void 0:e.reference)),n=e.map((e=>null==e?void 0:e.floating)),r=e.map((e=>null==e?void 0:e.item)),o=l.useCallback((t=>Go(t,e,"reference")),t),i=l.useCallback((t=>Go(t,e,"floating")),n),a=l.useCallback((t=>Go(t,e,"item")),r);return l.useMemo((()=>({getReferenceProps:o,getFloatingProps:i,getItemProps:a})),[o,i,a])}([k,$]),{x:E,y:L}=b.arrow??{x:null,y:null},R={top:"bottom",right:"left",bottom:"top",left:"right"}[y.split("-")[0]];if(!e)return null;let T=d-1,O=4;return"left"!==R&&"right"!==R||(T=4,O=d-1),r.jsxs(r.Fragment,{children:[r.jsxs("div",{ref:x.setFloating,style:m,"aria-modal":!0,...S(),css:Yo,children:[r.jsxs("div",{css:Ko,children:[i,r.jsx(de,{onClick:()=>t(!1),className:"ds-map-pop-up-close-button","aria-label":f.closeLabel})]}),r.jsx("div",{css:Jo,children:a}),s?r.jsx("div",{css:Qo,children:s}):null,r.jsx("div",{ref:g,css:ei(T,O,E,L,R,d)})]}),r.jsx("div",{className:"fixed inset-0 z-[999] bg-black/20 backdrop-blur-[1px]",onClick:()=>p&&t(!1)})]})},exports.Menu=$e,exports.MobileTabBar=({defaultValue:t,tabs:o,onTabClick:i,hideLabels:a,activationMode:s="manual"})=>{const l=o.length,[c,d]=n.useState((()=>Jh(o,t)));return r.jsx("div",{css:Uh,children:r.jsx(e.Tabs.Root,{width:"full",defaultValue:t||o?.[0]?.value,onValueChange:({value:e})=>(e=>{const t=Jh(o,e);d(t),i&&i(e)})(e),activationMode:s,children:r.jsx(e.Tabs.List,{alignItems:"center",border:"none",children:o.map(((t,n)=>{const{label:o,icon:i,bagdeCount:s,"aria-label":d,"aria-describedby":u,disabled:p,...h}=t,f=`${t.value}-str-status`,g=[`tab ${n+1} of ${l}`,c===n?"selected":"not selected"];p&&g.push("disabled");const x=[u,f].filter(Boolean).join(" ")||void 0;return r.jsxs(e.Tabs.Trigger,{css:Xh,"aria-label":d||o,"aria-disabled":!!p||void 0,"aria-describedby":x,disabled:p,...h,children:[r.jsxs("div",{css:Yh,children:[i,s?r.jsx("div",{css:Kh,className:"ds-badge-count",children:s}):null]}),a?null:r.jsx("p",{children:o}),r.jsx(e.VisuallyHidden,{id:f,children:g.join(", ")})]},t.value)}))})})})},exports.Modal=({header:t,content:o,footer:i,size:a="medium",width:s,height:l,maxHeight:c,draggable:d,blocking:u,open:p,onClose:h})=>{const f=n.useRef(null);return p?r.jsx(e.Dialog.Root,{open:p,onOpenChange:h,placement:"center",scrollBehavior:"inside",closeOnInteractOutside:!d&&!u,preventScroll:!d&&!u,closeOnEscape:!u,defaultOpen:!0,children:r.jsxs(e.Portal,{children:[d?null:r.jsx(e.Dialog.Backdrop,{css:{background:"rgba(0, 0, 0, 0.64)"}}),r.jsx(xs,{disabled:!d,nodeRef:f,children:r.jsx(e.Dialog.Positioner,{ref:f,children:r.jsxs(e.Dialog.Content,{css:ms(a,s,l,c),children:[r.jsxs(e.Dialog.Header,{css:vs,children:[t,u?null:r.jsx(e.Dialog.CloseTrigger,{css:bs,asChild:!0,children:r.jsx(de,{})})]}),r.jsx(e.Dialog.Body,{css:ys,children:o}),i?r.jsx(e.Dialog.Footer,{padding:"12px",children:i}):null]})})})]})}):null},exports.MultiActionButton=({variant:t="primary",size:o="default",mainActionLabel:i,mainActionOnClick:a=()=>{},otherActions:s=[],disabled:l,...c})=>{const[d,u]=n.useState(!1),p=l?`${i} action button with menu, disabled`:void 0;return r.jsxs(e.Group,{css:Re,attached:!0,tabIndex:l?0:void 0,"aria-disabled":l,"aria-label":p,role:"group",children:[r.jsx(C,{css:{},label:i,variant:t,size:o,onClick:a,disabled:l,...c}),r.jsxs(e.Menu.Root,{onOpenChange:({open:e})=>u(e),positioning:{placement:"bottom-end"},children:[r.jsx(e.Menu.Trigger,{css:Ee(t),"data-group-item":!0,"data-last":!0,asChild:!0,children:r.jsx(C,{variant:t,size:o,leftIcon:r.jsx(L,{rotate:d?"180":"0",color:h("accessible","text-on-primary-mids")||h("primary",900)}),disabled:l})}),r.jsx(Te,{children:s.map((({label:t,value:n,onClick:i})=>r.jsx(e.Menu.Item,{css:Le(o),onClick:i,value:n,children:t},n)))})]})]})},exports.Navbar=({variant:e="default",theme:t="light",logo:o,linkRouter:i,pathname:a,navigationSection:s,utilitySection:l,actionsSection:c,maxWidth:d,fixed:u,onNavbarHeightChange:p,backgroundColor:h,labels:f})=>{const g=w("Navbar",f),x=n.useRef(null),m=n.useRef(null),v=n.useRef(null),[b,y]=n.useState(!1),[j,k]=n.useState(-1),[$,S]=n.useState("undefined"!=typeof window&&window?.innerWidth<=Cf),[E,L]=n.useState(!1),R=i,O=n.useCallback((()=>{if(m.current&&x.current&&v.current){const e=x.current.getBoundingClientRect(),t=m.current.getBoundingClientRect(),n=v.current.getBoundingClientRect();t.width,e.width,window.innerWidth<=Cf||window.innerWidth<=j?(p?.(96),y(!0)):window.innerWidth>Cf&&window.innerWidth<=1440?e.right>=t.left?(p?.(96),y(!0),k(window.innerWidth)):window.innerWidth>j&&(p?.(48),y(!1),k(-1)):(p?.(48),y(!1),k(-1)),b&&(window.innerWidth<=Cf||n.right>=t.left?(S(!0),p?.(48)):(S(!1),p?.(96)))}}),[j,b]);n.useEffect((()=>(O(),window.addEventListener("resize",O),()=>{window.removeEventListener("resize",O)})),[O]);const P="condensed"===e;return r.jsxs("nav",{css:Qh(b&&!$,u,h,t,P),children:[r.jsxs("div",{css:tf(b&&!$,d,P),children:[r.jsxs("div",{css:nf(b&&!$||"dark"===t,P),ref:x,children:[o?r.jsx("div",{ref:v,css:rf,children:o}):null,r.jsx("div",{css:of(b),children:s?.map((e=>e.link?r.jsx(R,{to:e.link,href:e.link,css:af(a===e.link,t,P),children:e.label},e.label):r.jsx($e,{theme:t,label:e.label,fontSize:P?"0.875rem":"1rem",items:e.items||[]},e.label)))})]}),r.jsx("div",{css:sf(P),ref:m,children:$?r.jsxs("button",{type:"button",onClick:()=>L(!E),"aria-label":g.openMenuLabel,css:df(t),children:[E?g.closeLabel:g.menuLabel,E?r.jsx(T,{height:P?"0.75rem":"1rem",width:P?"0.75rem":"1rem"}):r.jsx(te,{height:P?"0.75rem":"1rem",width:P?"0.75rem":"1rem"})]}):r.jsxs(r.Fragment,{children:[r.jsx("div",{css:sf(P),children:l?.map(((e,t)=>r.jsx("div",{css:lf(b),children:e},t)))}),c?.length?r.jsx("div",{css:cf(b),children:c.map((e=>r.jsx(C,{...e},e.ariaLabel)))}):null]})})]}),b&&!$?r.jsx("div",{css:ef(t,P),children:s?.map((e=>e.link?r.jsx(R,{to:e.link,href:e.link,css:af(a===e.link,t,P),children:e.label},e.label):r.jsx($e,{theme:t,label:e.label,fontSize:P?"0.875rem":"1rem",items:e.items||[]},e.label)))}):null,$?r.jsx(wf,{theme:t,variant:e,navigationSection:s,utilitySection:l,actionsSection:c,linkRouter:i,isOpen:E,setIsOpen:L,pathname:a,resolvedLabels:g}):null]})},exports.NavigationRail=({tabs:t=[],defaultValue:o,onTabClick:i,children:a,onOpenChange:s,labels:l})=>{const c=w("NavigationRail",l),[d,u]=n.useState(!1),[p,f]=n.useState(o||t?.[0]?.value),g=e=>{f(e),i&&i(e)},[x]=e.useMediaQuery(["(max-width: 48rem)"]);return x?r.jsxs(e.Tabs.Root,{defaultValue:p,onValueChange:({value:e})=>g(e),children:[r.jsx(e.Tabs.List,{style:{display:"flex",overflowX:"auto",whiteSpace:"nowrap",padding:"0.5rem",gap:"0.5rem"},children:t.map((t=>r.jsx(e.Tabs.Trigger,{value:t.value,css:{"--indicator-color":h("primary",500),flexShrink:0,padding:"0.625rem 1rem",color:h("neutral",600),"&[data-selected]":{color:h("neutral",800),fontWeight:600}},children:t.label},t.value)))}),t.map((t=>r.jsx(e.Tabs.Content,{value:t.value,children:a},t.value)))]}):r.jsxs("div",{style:{height:"calc(100vh - 3rem - 3.5rem)",position:"fixed",top:"3rem",left:0,display:"flex"},children:[r.jsxs("div",{css:jf,children:[r.jsx(e.Tabs.Root,{defaultValue:o||t?.[0]?.value,orientation:"horizontal",width:"full",onValueChange:({value:e})=>{g(e)},role:"tablist",children:r.jsx(e.Tabs.List,{alignItems:"center",border:"none",style:{flexDirection:"column"},children:t.map((t=>r.jsx(e.Tabs.Trigger,{css:kf,"aria-label":t["aria-label"]||t.label,...t,children:r.jsxs(e.Box,{display:"flex",alignItems:"center",flexDirection:"column",gap:"0.3125rem",className:"ds-tab-label",children:[t.icon?r.jsx("div",{css:$f,children:t.icon}):null,r.jsx("p",{children:t.label})]})},t.label)))})}),a?r.jsx(e.Collapsible.Root,{onOpenChange:({open:e})=>{u(e),s&&s(!e)},children:r.jsxs(e.Collapsible.Trigger,{css:Sf,children:[r.jsx("div",{css:$f,children:d?r.jsx(k,{}):r.jsx(j,{})}),r.jsxs("div",{className:"ds-tab-label",children:[r.jsx("p",{children:d?c.showLabel:c.hideLabel}),r.jsx("p",{children:c.sidebarLabel})]})]})}):null]}),a?r.jsx(e.Collapsible.Root,{defaultOpen:!0,open:!d,children:r.jsx(e.Collapsible.Content,{height:"100%",children:r.jsx("div",{css:Ef,role:"tabpanel","aria-labelledby":p,children:a})})}):null]})},exports.OptionCard=({defaultValue:t,items:n,onValueChange:i})=>r.jsx(e.RadioCard.Root,{defaultValue:t,onValueChange:i,children:r.jsx(e.HStack,{alignItems:"flex-start",flexWrap:"wrap",gap:"12px",children:n.map((t=>{return r.jsxs(e.RadioCard.Item,{css:Fe,value:t.value,disabled:t.disabled,children:[r.jsx(e.RadioCard.ItemHiddenInput,{}),r.jsxs(e.RadioCard.ItemControl,{css:qe,children:[r.jsxs("div",{css:(i=t.variant,o.css`
3741
+ `),children:n.children}):null]},`${n.label}-${n.value}`);var i,a}))})}),exports.CloseButton=de,exports.ClusterPoint=({onClick:e,triggerRef:n,showFocusState:r,count:o,mode:i,variant:a="cluster"})=>t.jsx(Nn,{count:o,mode:i,onClick:e,ref:n,showFocusState:r,variant:a}),exports.Combobox=({label:t,required:o,caption:i,errorMessage:a,size:s,disabled:l,placeholder:c,labels:d,noMarginBottom:u,initialItems:p=[],multiple:h=!1,showSelectedItems:f=!1})=>{const[g,x]=n.useState([]),m=w("TextInput",d),{contains:v}=e.useFilter({sensitivity:"base"}),{collection:b,filter:y}=e.useListCollection({initialItems:p,filter:v});return r.jsxs("div",{css:$t(s,u),className:"ds-text-input-container",children:[a?r.jsx("div",{css:St}):null,r.jsxs(e.Field.Root,{required:o,invalid:!!a,gap:"0",style:{marginLeft:a?"19px":"0px"},children:[t?r.jsxs(e.Field.Label,{css:Et(s,l),"aria-label":t,children:[r.jsx(e.Field.RequiredIndicator,{"aria-label":m.requiredSymbolLabel}),t,o?"":r.jsx("span",{children:m.optionalSuffix})]}):null,i?r.jsx(e.Field.HelperText,{css:Lt(s,l),"aria-label":i,children:i}):null,a?r.jsx(e.Field.ErrorText,{css:Rt(s),"aria-label":a,children:a}):null,r.jsxs(e.Combobox.Root,{multiple:h,onValueChange:e=>{x(e.items.map((e=>({label:e.label,value:e.value}))))},value:g.map((e=>e.value)),collection:b,onInputValueChange:e=>y(e.inputValue),width:"320px",size:"small"===s?"sm":"md",children:[r.jsxs(e.Combobox.Control,{children:[r.jsx(e.Combobox.Input,{placeholder:c,css:Tt(s),disabled:l}),r.jsxs(e.Combobox.IndicatorGroup,{children:[r.jsx(e.Combobox.ClearTrigger,{}),r.jsx(e.Combobox.Trigger,{})]})]}),r.jsx(e.Portal,{children:r.jsx(e.Combobox.Positioner,{children:r.jsxs(e.Combobox.Content,{children:[r.jsx(e.Combobox.Empty,{children:"No items found"}),b.items.map((t=>r.jsxs(e.Combobox.Item,{item:t,children:[t.label,r.jsx(e.Combobox.ItemIndicator,{})]},t.value)))]})})}),r.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"flex-start",gap:"0.25rem",paddingTop:"0.5rem"},children:f&&g.map((e=>r.jsx(en,{label:e.label,variant:"info-white",onClose:()=>x((t=>t.filter((t=>t.value!==e.value)))),closable:!0},e.value)))})]})]})]})},exports.DesignSystemLocaleProvider=({labels:e,children:r})=>{const o=n.useMemo((()=>({labels:e})),[e]);return t.jsx(f.Provider,{value:o,children:r})},exports.ExtendableCard=({children:t,header:n,footer:o})=>r.jsx(e.Box,{css:ga,children:r.jsx(e.Accordion.Root,{multiple:!0,children:r.jsxs(e.Accordion.Item,{value:"extendable-card-item",children:[r.jsxs(e.Accordion.ItemTrigger,{css:xa,alignItems:"center",children:[r.jsx(e.Flex,{gap:3,flex:"1",overflow:"hidden",alignItems:"center",children:n}),r.jsx(e.Accordion.ItemIndicator,{children:r.jsx(L,{color:"var(--chakra-colors-neutral-700)",height:"16px",width:"16px"})})]}),r.jsxs(e.Accordion.ItemContent,{children:[t,o]})]})})}),exports.Footer=({children:e,label:t="© World Resources Institute",fixed:n,filled:o,maxWidth:i,additionalLogos:a})=>{const s=(new Date).getFullYear();return r.jsx("footer",{css:Fh(n,o),children:r.jsxs("div",{css:qh(i),children:[r.jsxs("div",{css:Gh,children:[r.jsx(N,{height:"2rem",width:"5.6875rem"}),a&&a.map(((e,t)=>r.jsx("div",{children:e},t)))]}),r.jsx("div",{css:Zh,children:e}),r.jsx("div",{children:r.jsxs("p",{css:Wh,children:[t," ",s]})})]})})},exports.FormContainer=({label:e,error:t,children:n})=>r.jsxs("div",{css:Oe,children:[t?r.jsx("div",{css:Me}):null,r.jsxs("div",{children:[e?r.jsx("p",{css:Pe,children:e}):null,t?r.jsx("p",{css:_e,"aria-label":t,children:t}):null,n]})]}),exports.IconButton=ce,exports.InlineMessage=({label:e,caption:t,variant:n,size:o="large",icon:i=r.jsx(E,{height:"16px",width:"16px"}),onActionClick:a,actionLabel:s,isButtonRight:l,buttonLeftIcon:c,buttonRightIcon:d,labels:u})=>{const p=w("InlineMessage",u);let h=tg;return"info-grey"===n?h=ng:"success"===n?h=rg:"warning"===n?h=og:"error"===n&&(h=ig),r.jsxs("div",{css:[Yf(o,l),h],"aria-roledescription":p.roleDescription,children:[r.jsxs("div",{children:[r.jsxs("div",{css:Kf,children:[i,r.jsx("p",{css:Jf(o),children:e})]}),t&&"string"==typeof t?r.jsx("p",{css:Qf(o,!!i),children:t}):t?r.jsx("div",{css:eg(o,!!i),children:t}):null]}),s?r.jsx(C,{label:s,variant:"info-white"===n||"info-grey"===n?"primary":"secondary",size:"large"===o?"default":"small",onClick:a,leftIcon:c,rightIcon:d}):null]})},exports.InputWithUnits=({label:t,caption:o,errorMessage:i,units:a,unitsPosition:s="end",defaultUnit:l="",defaultValue:c="",onChange:d,required:u,disabled:p})=>{const[h,f]=n.useState(c),[g,x]=n.useState(l?[l]:[a[0].value]),m=(e,t)=>{d&&d("end"===s?""+(t?`${h} ${e}`:`${e} ${g}`):""+(t?`${e} ${h}`:`${g} ${e}`))};return r.jsxs("div",{css:bt,children:[i?r.jsx("div",{css:Ct}):null,r.jsxs("div",{style:{marginLeft:i?"19px":"0px"},children:[r.jsxs("p",{css:yt(p),"aria-label":t,children:[u?r.jsx("span",{children:"*"}):null,t]}),r.jsx("p",{css:wt(p),"aria-label":o,children:o}),i?r.jsx("p",{css:jt,"aria-label":i,children:i}):null,r.jsxs(e.Group,{css:kt(!!i,s),attached:!0,children:["start"===s?r.jsx(rn,{placeholder:"",value:g,items:a,disabled:p,onChange:e=>{x(e),m(e?.[0],!0)}}):null,r.jsx(Ot,{type:"number",value:h,disabled:p,onChange:e=>{f(e.target.value),m(e.target.value)}}),"end"===s?r.jsx(rn,{placeholder:"",value:g,items:a,disabled:p,onChange:e=>{x(e),m(e?.[0],!0)}}):null]})]})]})},exports.ItemCount=Fi,exports.LayerGroup=({label:t,caption:o,value:i,layerItems:a,onChangeForRadioVariant:s,labels:l})=>{const c=w("LayerGroup",l),[d,u]=n.useState({}),[p]=n.useState((e=>{const t=e.find((e=>"radio"===e.variant&&e.isDefaultSelected));return t?.name})(a));n.useEffect((()=>{let e={...d};a.forEach((n=>{n.isDefaultSelected&&(e={...e,["radio"===n.variant?t:n.name]:n.isDefaultSelected})})),u(e)}),[]);const h=(e,t,n,r)=>{const o={...d,[e]:t};u(o),n&&n(e,t,r)},f=Object.values(d).filter((e=>!0===e)).length,g=c.groupAriaLabel(t,f,o);return r.jsxs(e.Accordion.Item,{value:i,width:"100%",children:[r.jsxs(e.Accordion.ItemTrigger,{css:ni,alignItems:"flex-start","aria-label":g,children:[r.jsxs(e.Box,{width:"full",display:"flex",flexDirection:"column",alignItems:"flex-start",children:[r.jsxs("span",{css:ri,children:[t,r.jsx(en,{label:c.activeTagLabel(f),size:"small",variant:f>0?"success":"info-grey"})]}),r.jsx("div",{css:oi,children:o})]}),r.jsx(e.Accordion.ItemIndicator,{display:"flex",children:r.jsx(L,{color:"var(--chakra-colors-neutral-700)",height:"16px",width:"16px"})})]}),r.jsx(e.Accordion.ItemContent,{paddingLeft:"16px",paddingRight:"16px",children:r.jsx(Qe,{name:t,value:p,customGap:"0px",onChange:(e,t)=>h(e,!!t,s,t),children:a.map((e=>r.jsx(di,{...e,onChange:(t,n)=>h(t,n,e.onChange)},e.label)))})})]})},exports.LayerGroupContainer=({children:t,defaultValue:n,...o})=>r.jsx("div",{css:ti,style:{width:"100%"},children:r.jsx(e.Accordion.Root,{css:{},defaultValue:n,multiple:!0,...o,children:t})}),exports.LayerItem=di,exports.LayerParameters=({label:t,children:o,openedByDefault:i})=>r.jsx("div",{children:r.jsx(e.Accordion.Root,{defaultValue:i?[t]:[],multiple:!0,children:r.jsxs(e.Accordion.Item,{css:ui,value:t,children:[r.jsxs(e.Accordion.ItemTrigger,{css:pi,children:[r.jsx(e.Box,{width:"full",display:"flex",flexDirection:"column",alignItems:"flex-start",children:r.jsx("p",{css:hi,children:t})}),r.jsx(e.Accordion.ItemIndicator,{display:"flex",children:r.jsx(L,{color:"var(--chakra-colors-neutral-700)",height:"16px",width:"16px"})})]}),r.jsx(e.Accordion.ItemContent,{css:fi,children:n.Children.map(o,(e=>r.jsx("div",{className:"ds-layer-parameters-item-child",children:e})))})]})})}),exports.LegendItem=({layerName:e,dataUnit:t,onDrag:n,onUpClick:o,onDownClick:i,onRemoveClick:a,children:s,onInfoClick:l,onOpacityChanged:c,labels:d})=>{const u=w("LegendItem",d);return r.jsxs("div",{css:gi,children:[r.jsxs("div",{css:xi,children:[r.jsx(ce,{icon:r.jsx(_,{}),"aria-label":u.dragAndDropLabel,"aria-hidden":!0,onClick:n,style:{display:"none",marginBottom:"12px"}}),r.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"12px"},children:[r.jsx(ce,{icon:r.jsx(L,{rotate:"180"}),"aria-label":u.upLabel,onClick:o}),r.jsx(ce,{icon:r.jsx(L,{}),"aria-label":u.downLabel,onClick:i})]})]}),r.jsxs("div",{style:{width:"100%"},children:[r.jsxs("div",{css:mi,children:[r.jsxs("div",{children:[r.jsx("h3",{css:vi,children:e}),r.jsx("p",{css:bi,children:t})]}),r.jsx(C,{label:u.removeLabel,size:"small",variant:"secondary",rightIcon:r.jsx(T,{}),onClick:a})]}),s,r.jsxs("div",{css:yi,children:[r.jsx(C,{label:u.aboutDataLabel,size:"small",variant:"secondary",leftIcon:r.jsx(E,{}),onClick:l}),r.jsx($i,{defaultValue:80,onOpacityChanged:c})]})]})]})},exports.List=Ji,exports.MapControlsToolbar=({onZoomInClick:e,onZoomOutClick:n,onExpandClick:r,onShareClick:o,onPrintClick:i,onSettingsClick:a,onQuestionClick:s,vertical:l,expanded:c,showExpandedToggle:d,ariaLabel:u,labels:p})=>{const h=w("MapControlsToolbar",p),f=[{icon:t.jsx(z,{}),label:h.zoomInLabel,ariaLabel:h.zoomInAriaLabel,onClick:e},{icon:t.jsx(B,{}),label:h.zoomOutLabel,ariaLabel:h.zoomOutAriaLabel,onClick:n,gap:!0},{icon:t.jsx(H,{}),label:h.expandLabel,ariaLabel:h.expandAriaLabel,onClick:r,gap:!0},{icon:t.jsx(F,{}),label:h.shareLabel,ariaLabel:h.shareAriaLabel,onClick:o,gap:!0},{icon:t.jsx(q,{}),label:h.printLabel,ariaLabel:h.printAriaLabel,onClick:i,gap:!0},{icon:t.jsx(Z,{}),label:h.settingsLabel,ariaLabel:h.settingsAriaLabel,onClick:a,gap:!0},{icon:t.jsx(W,{}),label:h.helpLabel,ariaLabel:h.helpAriaLabel,onClick:s}];return t.jsx(me,{items:f,vertical:l,expanded:c,showExpandedToggle:d,ariaLabel:u||h.toolbarAriaLabel})},exports.MapMarker=Nn,exports.MapMarkers=Vn,exports.MapPopUp=({open:e,onOpenChange:t,anchorRef:o,header:i,content:a,footer:s,placement:c="bottom",offset:d=30,closeOnEscape:u=!0,closeOnOutsideClick:p=!1,labels:h})=>{const f=w("MapPopUp",h),g=n.useRef(null),{refs:x,floatingStyles:m,context:v,middlewareData:b,placement:y}=Wo({open:e,onOpenChange:t,placement:c,whileElementsMounted:fo,middleware:[So(d),(C={fallbackAxisSideDirection:"start"},{...mo(C),options:[C,j]}),Eo({padding:8}),Lo({element:g})]});var C,j;n.useEffect((()=>{o?.current&&x.setReference(o.current)}),[o,x]);const k=function(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,elements:o,dataRef:i}=e,{enabled:a=!0,escapeKey:s=!0,outsidePress:c=!0,outsidePressEvent:d="pointerdown",referencePress:u=!1,referencePressEvent:p="pointerdown",ancestorScroll:h=!1,bubbles:f,capture:g}=t,x=Bo(),m=Wr("function"==typeof c?c:()=>!1),v="function"==typeof c?m:c,b=l.useRef(!1),{escapeKey:y,outsidePress:w}=qo(f),{escapeKey:C,outsidePress:j}=qo(g),k=l.useRef(!1),$=Wr((e=>{var t;if(!n||!a||!s||"Escape"!==e.key)return;if(k.current)return;const o=null==(t=i.current.floatingContext)?void 0:t.nodeId,l=x?Fr(x.nodesRef.current,o):[];if(!y&&(e.stopPropagation(),l.length>0)){let e=!0;if(l.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__escapeKeyBubbles||(e=!1)})),!e)return}r(!1,function(e){return"nativeEvent"in e}(e)?e.nativeEvent:e,"escape-key")})),S=Wr((e=>{var t;const n=()=>{var t;$(e),null==(t=zr(e))||t.removeEventListener("keydown",n)};null==(t=zr(e))||t.addEventListener("keydown",n)})),E=Wr((e=>{var t;const n=i.current.insideReactTree;i.current.insideReactTree=!1;const a=b.current;if(b.current=!1,"click"===d&&a)return;if(n)return;if("function"==typeof v&&!v(e))return;const s=zr(e),l="[data-floating-ui-inert]",c=Hr(o.floating).querySelectorAll(l);let u=Zn(s)?s:null;for(;u&&!ar(u);){const e=cr(u);if(ar(e)||!Zn(e))break;u=e}if(c.length&&Zn(s)&&!s.matches("html,body")&&!Vr(s,o.floating)&&Array.from(c).every((e=>!Vr(u,e))))return;if(Wn(s)&&T){const t=ar(s),n=sr(s),r=/auto|scroll/,o=t||r.test(n.overflowX),i=t||r.test(n.overflowY),a=o&&s.clientWidth>0&&s.scrollWidth>s.clientWidth,l=i&&s.clientHeight>0&&s.scrollHeight>s.clientHeight,c="rtl"===n.direction,d=l&&(c?e.offsetX<=s.offsetWidth-s.clientWidth:e.offsetX>s.clientWidth),u=a&&e.offsetY>s.clientHeight;if(d||u)return}const p=null==(t=i.current.floatingContext)?void 0:t.nodeId,h=x&&Fr(x.nodesRef.current,p).some((t=>{var n;return Br(e,null==(n=t.context)?void 0:n.elements.floating)}));if(Br(e,o.floating)||Br(e,o.domReference)||h)return;const f=x?Fr(x.nodesRef.current,p):[];if(f.length>0){let e=!0;if(f.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__outsidePressBubbles||(e=!1)})),!e)return}r(!1,e,"outside-press")})),L=Wr((e=>{var t;const n=()=>{var t;E(e),null==(t=zr(e))||t.removeEventListener(d,n)};null==(t=zr(e))||t.addEventListener(d,n)}));l.useEffect((()=>{if(!n||!a)return;i.current.__escapeKeyBubbles=y,i.current.__outsidePressBubbles=w;let e=-1;function t(e){r(!1,e,"ancestor-scroll")}function l(){window.clearTimeout(e),k.current=!0}function c(){e=window.setTimeout((()=>{k.current=!1}),or()?5:0)}const u=Hr(o.floating);s&&(u.addEventListener("keydown",C?S:$,C),u.addEventListener("compositionstart",l),u.addEventListener("compositionend",c)),v&&u.addEventListener(d,j?L:E,j);let p=[];return h&&(Zn(o.domReference)&&(p=ur(o.domReference)),Zn(o.floating)&&(p=p.concat(ur(o.floating))),!Zn(o.reference)&&o.reference&&o.reference.contextElement&&(p=p.concat(ur(o.reference.contextElement)))),p=p.filter((e=>{var t;return e!==(null==(t=u.defaultView)?void 0:t.visualViewport)})),p.forEach((e=>{e.addEventListener("scroll",t,{passive:!0})})),()=>{s&&(u.removeEventListener("keydown",C?S:$,C),u.removeEventListener("compositionstart",l),u.removeEventListener("compositionend",c)),v&&u.removeEventListener(d,j?L:E,j),p.forEach((e=>{e.removeEventListener("scroll",t)})),window.clearTimeout(e)}}),[i,o,s,v,d,n,r,h,a,y,w,$,C,S,E,j,L]),l.useEffect((()=>{i.current.insideReactTree=!1}),[i,v,d]);const R=l.useMemo((()=>({onKeyDown:$,...u&&{[Ho[p]]:e=>{r(!1,e.nativeEvent,"reference-press")},..."click"!==p&&{onClick(e){r(!1,e.nativeEvent,"reference-press")}}}})),[$,r,u,p]),T=l.useMemo((()=>({onKeyDown:$,onMouseDown(){b.current=!0},onMouseUp(){b.current=!0},[Fo[d]]:()=>{i.current.insideReactTree=!0}})),[$,d,i]);return l.useMemo((()=>a?{reference:R,floating:T}:{}),[a,R,T])}(v,{escapeKey:u,outsidePress:p}),$=Xo(v,{role:"dialog"}),{getFloatingProps:S}=function(e){void 0===e&&(e=[]);const t=e.map((e=>null==e?void 0:e.reference)),n=e.map((e=>null==e?void 0:e.floating)),r=e.map((e=>null==e?void 0:e.item)),o=l.useCallback((t=>Go(t,e,"reference")),t),i=l.useCallback((t=>Go(t,e,"floating")),n),a=l.useCallback((t=>Go(t,e,"item")),r);return l.useMemo((()=>({getReferenceProps:o,getFloatingProps:i,getItemProps:a})),[o,i,a])}([k,$]),{x:E,y:L}=b.arrow??{x:null,y:null},R={top:"bottom",right:"left",bottom:"top",left:"right"}[y.split("-")[0]];if(!e)return null;let T=d-1,O=4;return"left"!==R&&"right"!==R||(T=4,O=d-1),r.jsxs(r.Fragment,{children:[r.jsxs("div",{ref:x.setFloating,style:m,"aria-modal":!0,...S(),css:Yo,children:[r.jsxs("div",{css:Ko,children:[i,r.jsx(de,{onClick:()=>t(!1),className:"ds-map-pop-up-close-button","aria-label":f.closeLabel})]}),r.jsx("div",{css:Jo,children:a}),s?r.jsx("div",{css:Qo,children:s}):null,r.jsx("div",{ref:g,css:ei(T,O,E,L,R,d)})]}),r.jsx("div",{className:"fixed inset-0 z-[999] bg-black/20 backdrop-blur-[1px]",onClick:()=>p&&t(!1)})]})},exports.Menu=$e,exports.MobileTabBar=({defaultValue:t,tabs:o,onTabClick:i,hideLabels:a,activationMode:s="manual"})=>{const l=o.length,[c,d]=n.useState((()=>Jh(o,t)));return r.jsx("div",{css:Uh,children:r.jsx(e.Tabs.Root,{width:"full",defaultValue:t||o?.[0]?.value,onValueChange:({value:e})=>(e=>{const t=Jh(o,e);d(t),i&&i(e)})(e),activationMode:s,children:r.jsx(e.Tabs.List,{alignItems:"center",border:"none",children:o.map(((t,n)=>{const{label:o,icon:i,bagdeCount:s,"aria-label":d,"aria-describedby":u,disabled:p,...h}=t,f=`${t.value}-str-status`,g=[`tab ${n+1} of ${l}`,c===n?"selected":"not selected"];p&&g.push("disabled");const x=[u,f].filter(Boolean).join(" ")||void 0;return r.jsxs(e.Tabs.Trigger,{css:Xh,"aria-label":d||o,"aria-disabled":!!p||void 0,"aria-describedby":x,disabled:p,...h,children:[r.jsxs("div",{css:Yh,children:[i,s?r.jsx("div",{css:Kh,className:"ds-badge-count",children:s}):null]}),a?null:r.jsx("p",{children:o}),r.jsx(e.VisuallyHidden,{id:f,children:g.join(", ")})]},t.value)}))})})})},exports.Modal=({header:t,content:o,footer:i,size:a="medium",width:s,height:l,maxHeight:c,draggable:d,blocking:u,open:p,onClose:h})=>{const f=n.useRef(null);return p?r.jsx(e.Dialog.Root,{open:p,onOpenChange:h,placement:"center",scrollBehavior:"inside",closeOnInteractOutside:!d&&!u,preventScroll:!d&&!u,closeOnEscape:!u,defaultOpen:!0,children:r.jsxs(e.Portal,{children:[d?null:r.jsx(e.Dialog.Backdrop,{css:{background:"rgba(0, 0, 0, 0.64)"}}),r.jsx(xs,{disabled:!d,nodeRef:f,children:r.jsx(e.Dialog.Positioner,{ref:f,children:r.jsxs(e.Dialog.Content,{css:vs(a,s,l,c),children:[r.jsxs(e.Dialog.Header,{css:bs,children:[t,u?null:r.jsx(e.Dialog.CloseTrigger,{css:ys,asChild:!0,children:r.jsx(de,{})})]}),r.jsx(e.Dialog.Body,{css:ws,children:o}),i?r.jsx(e.Dialog.Footer,{padding:"0.75rem",children:i}):null]})})})]})}):null},exports.MultiActionButton=({variant:t="primary",size:o="default",mainActionLabel:i,mainActionOnClick:a=()=>{},otherActions:s=[],disabled:l,...c})=>{const[d,u]=n.useState(!1),p=l?`${i} action button with menu, disabled`:void 0;return r.jsxs(e.Group,{css:Re,attached:!0,tabIndex:l?0:void 0,"aria-disabled":l,"aria-label":p,role:"group",children:[r.jsx(C,{css:{},label:i,variant:t,size:o,onClick:a,disabled:l,...c}),r.jsxs(e.Menu.Root,{onOpenChange:({open:e})=>u(e),positioning:{placement:"bottom-end"},children:[r.jsx(e.Menu.Trigger,{css:Ee(t),"data-group-item":!0,"data-last":!0,asChild:!0,children:r.jsx(C,{variant:t,size:o,leftIcon:r.jsx(L,{rotate:d?"180":"0",color:h("accessible","text-on-primary-mids")||h("primary",900)}),disabled:l})}),r.jsx(Te,{children:s.map((({label:t,value:n,onClick:i})=>r.jsx(e.Menu.Item,{css:Le(o),onClick:i,value:n,children:t},n)))})]})]})},exports.Navbar=({variant:e="default",theme:t="light",logo:o,linkRouter:i,pathname:a,navigationSection:s,utilitySection:l,actionsSection:c,maxWidth:d,fixed:u,onNavbarHeightChange:p,backgroundColor:h,labels:f})=>{const g=w("Navbar",f),x=n.useRef(null),m=n.useRef(null),v=n.useRef(null),[b,y]=n.useState(!1),[j,k]=n.useState(-1),[$,S]=n.useState("undefined"!=typeof window&&window?.innerWidth<=Cf),[E,L]=n.useState(!1),R=i,O=n.useCallback((()=>{if(m.current&&x.current&&v.current){const e=x.current.getBoundingClientRect(),t=m.current.getBoundingClientRect(),n=v.current.getBoundingClientRect();t.width,e.width,window.innerWidth<=Cf||window.innerWidth<=j?(p?.(96),y(!0)):window.innerWidth>Cf&&window.innerWidth<=1440?e.right>=t.left?(p?.(96),y(!0),k(window.innerWidth)):window.innerWidth>j&&(p?.(48),y(!1),k(-1)):(p?.(48),y(!1),k(-1)),b&&(window.innerWidth<=Cf||n.right>=t.left?(S(!0),p?.(48)):(S(!1),p?.(96)))}}),[j,b]);n.useEffect((()=>(O(),window.addEventListener("resize",O),()=>{window.removeEventListener("resize",O)})),[O]);const P="condensed"===e;return r.jsxs("nav",{css:Qh(b&&!$,u,h,t,P),children:[r.jsxs("div",{css:tf(b&&!$,d,P),children:[r.jsxs("div",{css:nf(b&&!$||"dark"===t,P),ref:x,children:[o?r.jsx("div",{ref:v,css:rf,children:o}):null,r.jsx("div",{css:of(b),children:s?.map((e=>e.link?r.jsx(R,{to:e.link,href:e.link,css:af(a===e.link,t,P),children:e.label},e.label):r.jsx($e,{theme:t,label:e.label,fontSize:P?"0.875rem":"1rem",items:e.items||[]},e.label)))})]}),r.jsx("div",{css:sf(P),ref:m,children:$?r.jsxs("button",{type:"button",onClick:()=>L(!E),"aria-label":g.openMenuLabel,css:df(t),children:[E?g.closeLabel:g.menuLabel,E?r.jsx(T,{height:P?"0.75rem":"1rem",width:P?"0.75rem":"1rem"}):r.jsx(te,{height:P?"0.75rem":"1rem",width:P?"0.75rem":"1rem"})]}):r.jsxs(r.Fragment,{children:[r.jsx("div",{css:sf(P),children:l?.map(((e,t)=>r.jsx("div",{css:lf(b),children:e},t)))}),c?.length?r.jsx("div",{css:cf(b),children:c.map((e=>r.jsx(C,{...e},e.ariaLabel)))}):null]})})]}),b&&!$?r.jsx("div",{css:ef(t,P),children:s?.map((e=>e.link?r.jsx(R,{to:e.link,href:e.link,css:af(a===e.link,t,P),children:e.label},e.label):r.jsx($e,{theme:t,label:e.label,fontSize:P?"0.875rem":"1rem",items:e.items||[]},e.label)))}):null,$?r.jsx(wf,{theme:t,variant:e,navigationSection:s,utilitySection:l,actionsSection:c,linkRouter:i,isOpen:E,setIsOpen:L,pathname:a,resolvedLabels:g}):null]})},exports.NavigationRail=({tabs:t=[],defaultValue:o,onTabClick:i,children:a,onOpenChange:s,labels:l})=>{const c=w("NavigationRail",l),[d,u]=n.useState(!1),[p,f]=n.useState(o||t?.[0]?.value),g=e=>{f(e),i&&i(e)},[x]=e.useMediaQuery(["(max-width: 48rem)"]);return x?r.jsxs(e.Tabs.Root,{defaultValue:p,onValueChange:({value:e})=>g(e),children:[r.jsx(e.Tabs.List,{style:{display:"flex",overflowX:"auto",whiteSpace:"nowrap",padding:"0.5rem",gap:"0.5rem"},children:t.map((t=>r.jsx(e.Tabs.Trigger,{value:t.value,css:{"--indicator-color":h("primary",500),flexShrink:0,padding:"0.625rem 1rem",color:h("neutral",600),"&[data-selected]":{color:h("neutral",800),fontWeight:600}},children:t.label},t.value)))}),t.map((t=>r.jsx(e.Tabs.Content,{value:t.value,children:a},t.value)))]}):r.jsxs("div",{style:{height:"calc(100vh - 3rem - 3.5rem)",position:"fixed",top:"3rem",left:0,display:"flex"},children:[r.jsxs("div",{css:jf,children:[r.jsx(e.Tabs.Root,{defaultValue:o||t?.[0]?.value,orientation:"horizontal",width:"full",onValueChange:({value:e})=>{g(e)},role:"tablist",children:r.jsx(e.Tabs.List,{alignItems:"center",border:"none",style:{flexDirection:"column"},children:t.map((t=>r.jsx(e.Tabs.Trigger,{css:kf,"aria-label":t["aria-label"]||t.label,...t,children:r.jsxs(e.Box,{display:"flex",alignItems:"center",flexDirection:"column",gap:"0.3125rem",className:"ds-tab-label",children:[t.icon?r.jsx("div",{css:$f,children:t.icon}):null,r.jsx("p",{children:t.label})]})},t.label)))})}),a?r.jsx(e.Collapsible.Root,{onOpenChange:({open:e})=>{u(e),s&&s(!e)},children:r.jsxs(e.Collapsible.Trigger,{css:Sf,children:[r.jsx("div",{css:$f,children:d?r.jsx(k,{}):r.jsx(j,{})}),r.jsxs("div",{className:"ds-tab-label",children:[r.jsx("p",{children:d?c.showLabel:c.hideLabel}),r.jsx("p",{children:c.sidebarLabel})]})]})}):null]}),a?r.jsx(e.Collapsible.Root,{defaultOpen:!0,open:!d,children:r.jsx(e.Collapsible.Content,{height:"100%",children:r.jsx("div",{css:Ef,role:"tabpanel","aria-labelledby":p,children:a})})}):null]})},exports.OptionCard=({defaultValue:t,items:n,onValueChange:i})=>r.jsx(e.RadioCard.Root,{defaultValue:t,onValueChange:i,children:r.jsx(e.HStack,{alignItems:"flex-start",flexWrap:"wrap",gap:"12px",children:n.map((t=>{return r.jsxs(e.RadioCard.Item,{css:Fe,value:t.value,disabled:t.disabled,children:[r.jsx(e.RadioCard.ItemHiddenInput,{}),r.jsxs(e.RadioCard.ItemControl,{css:qe,children:[r.jsxs("div",{css:(i=t.variant,o.css`
3737
3742
  width: 100%;
3738
3743
  display: flex;
3739
3744
  flex-direction: ${"centered"===i?"column":"row"};
@@ -3746,7 +3751,7 @@ function ip(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Obj
3746
3751
  padding: 0px;
3747
3752
  padding-top: 8px;
3748
3753
  color: ${n?h("neutral",500):"inherit"};
3749
- `),children:t.children}):null]},`${t.label}-${t.value}`);var n,i}))})}),exports.Pagination=ra,exports.Panel=({header:e,content:t,footer:o,variant:i="fixed",width:a})=>{const[s,l]=n.useState(void 0),[c,d]=n.useState(void 0),u=n.useRef(null),p=n.useRef(null);n.useEffect((()=>{l(u?.current?.getBoundingClientRect()?.height),d(p?.current?.getBoundingClientRect()?.height)}),[e,o]);return r.jsxs("div",{css:[ws(a),"fixed"===i?Cs:js],children:[e?r.jsx("div",{css:ks,ref:u,children:e}):null,r.jsx("div",{css:$s(s,c),children:t}),o?r.jsx("div",{css:Ss,ref:p,children:o}):null]})},exports.Password=({label:e,caption:t,required:i,disabledRules:a,onChange:s,minLength:l=8,hideValidations:c,labels:d})=>{const u=w("Password",d),[p,f]=n.useState(!1),[g,x]=n.useState(""),[m,v]=n.useState({strength:"very-weak",length:!1,uppercase:!1,lowercase:!1,numbers:!1,specialCharacters:!1}),b={"very-weak":u.strengthVeryWeak,weak:u.strengthWeak,medium:u.strengthMedium,strong:u.strengthStrong,"very-strong":u.strengthVeryStrong};return r.jsxs("div",{css:on,children:[r.jsxs("p",{css:an,"aria-label":e,children:[i?r.jsx("span",{children:"*"}):null,e]}),r.jsx("p",{css:sn,"aria-label":t,children:t}),r.jsxs("div",{css:ln,children:[r.jsx(Ot,{type:p?"text":"password",value:g,"aria-describedby":"password-guidelines",onChange:e=>(e=>{const t={...m};let n=0,r=!1;t.length=e.length>=l,n+=e.length>=l?1:0,r=/[A-Z]/.test(e),n+=r?1:0,t.uppercase=r,r=/[a-z]/.test(e),n+=r?1:0,t.lowercase=r,r=/[0-9]/.test(e),n+=r?1:0,t.numbers=r,r=/[-'/`~!¡#*$@_%+=.,^&(){}[\]|;:“‘"<>?\\]/.test(e),n+=r?1:0,t.specialCharacters=r,t.strength="very-weak",e.length>=4&&n>=2&&(t.strength="weak"),e.length>=6&&n>=3&&(t.strength="medium"),e.length>=l&&n>=4&&(t.strength="strong"),e.length>=l+2&&n>=5&&(t.strength="very-strong"),x(e),v(t),s&&s({...t,password:e})})(e.target.value)}),r.jsx(C,{label:p?u.hideLabel:u.showLabel,variant:"secondary",leftIcon:p?r.jsx(M,{}):r.jsx(P,{}),"aria-label":p?u.hidePasswordLabel:u.showPasswordLabel,onClick:()=>f(!p),type:"button"})]}),g&&!c?r.jsxs("div",{id:"password-guidelines",css:cn,"aria-live":"polite",children:[r.jsxs("p",{css:(y=m.strength,o.css`
3754
+ `),children:t.children}):null]},`${t.label}-${t.value}`);var n,i}))})}),exports.Pagination=ra,exports.Panel=({header:e,content:t,footer:o,variant:i="fixed",width:a})=>{const[s,l]=n.useState(void 0),[c,d]=n.useState(void 0),u=n.useRef(null),p=n.useRef(null);n.useEffect((()=>{l(u?.current?.getBoundingClientRect()?.height),d(p?.current?.getBoundingClientRect()?.height)}),[e,o]);return r.jsxs("div",{css:[Cs(a),"fixed"===i?js:ks],children:[e?r.jsx("div",{css:$s,ref:u,children:e}):null,r.jsx("div",{css:Ss(s,c),children:t}),o?r.jsx("div",{css:Es,ref:p,children:o}):null]})},exports.Password=({label:e,caption:t,required:i,disabledRules:a,onChange:s,minLength:l=8,hideValidations:c,labels:d})=>{const u=w("Password",d),[p,f]=n.useState(!1),[g,x]=n.useState(""),[m,v]=n.useState({strength:"very-weak",length:!1,uppercase:!1,lowercase:!1,numbers:!1,specialCharacters:!1}),b={"very-weak":u.strengthVeryWeak,weak:u.strengthWeak,medium:u.strengthMedium,strong:u.strengthStrong,"very-strong":u.strengthVeryStrong};return r.jsxs("div",{css:on,children:[r.jsxs("p",{css:an,"aria-label":e,children:[i?r.jsx("span",{children:"*"}):null,e]}),r.jsx("p",{css:sn,"aria-label":t,children:t}),r.jsxs("div",{css:ln,children:[r.jsx(Ot,{type:p?"text":"password",value:g,"aria-describedby":"password-guidelines",onChange:e=>(e=>{const t={...m};let n=0,r=!1;t.length=e.length>=l,n+=e.length>=l?1:0,r=/[A-Z]/.test(e),n+=r?1:0,t.uppercase=r,r=/[a-z]/.test(e),n+=r?1:0,t.lowercase=r,r=/[0-9]/.test(e),n+=r?1:0,t.numbers=r,r=/[-'/`~!¡#*$@_%+=.,^&(){}[\]|;:“‘"<>?\\]/.test(e),n+=r?1:0,t.specialCharacters=r,t.strength="very-weak",e.length>=4&&n>=2&&(t.strength="weak"),e.length>=6&&n>=3&&(t.strength="medium"),e.length>=l&&n>=4&&(t.strength="strong"),e.length>=l+2&&n>=5&&(t.strength="very-strong"),x(e),v(t),s&&s({...t,password:e})})(e.target.value)}),r.jsx(C,{label:p?u.hideLabel:u.showLabel,variant:"secondary",leftIcon:p?r.jsx(M,{}):r.jsx(P,{}),"aria-label":p?u.hidePasswordLabel:u.showPasswordLabel,onClick:()=>f(!p),type:"button"})]}),g&&!c?r.jsxs("div",{id:"password-guidelines",css:cn,"aria-live":"polite",children:[r.jsxs("p",{css:(y=m.strength,o.css`
3750
3755
  font-size: 16px;
3751
3756
  line-height: 24px;
3752
3757
  font-weight: 400;
@@ -3766,4 +3771,4 @@ function ip(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Obj
3766
3771
  border: 1px solid ${h("neutral",300)};
3767
3772
  border-radius: 4px;
3768
3773
  ${a?`background: ${a};`:""}
3769
- `)}):r.jsx("div",{css:Ii,children:e?.map(((e,n)=>r.jsx("div",{"data-test":`${e}-${t?.[n]}`,style:{backgroundColor:e,width:"100%",height:"100%"}},`${e}-${t?.[n]}`)))}),r.jsx("div",{css:Di,children:t?.map((e=>r.jsx("div",{style:{width:i?"auto":`calc(100% / ${t.length})`,display:"flex",justifyContent:"center"},children:r.jsx("p",{css:Ai,children:e})},e)))}),n&&n.length?r.jsx("div",{css:Di,children:n.map((e=>r.jsx("div",{style:{width:i?"auto":`calc(100% / ${t.length})`,display:"flex",justifyContent:"center"},children:r.jsx("p",{css:Ni,style:{width:"100%"},children:e})},e)))}):null]});var a},exports.Search=({placeholder:t,disabled:o,size:i="default",options:a=[],resultsMaxHeight:s=50,isLoading:l=!1,displayResults:c="text",onSelect:d,onQueryChange:u,onClear:p,renderResults:f,labels:g})=>{const x=w("Search",g),[m,v]=n.useState(""),{open:b,onOpen:y,onClose:C}=e.useDisclosure(),[j,k]=n.useState(a),[$,S]=n.useState(-1),[E,L]=n.useState(!1),R=n.useRef(null),T=`search-results-${n.useId()}`,O=e=>{const t=a.find((t=>t.id===e||t.label===e));t&&(d?.(t),v(""),C())};n.useEffect((()=>{if(u?.(m),!m)return void k(a);const e=a.filter((e=>e.id?.toLowerCase().includes(m.toLowerCase())||e.label.toLowerCase().includes(m.toLowerCase())||e.caption?.toLowerCase().includes(m.toLowerCase()))).map((e=>({id:e.id,label:e.label,caption:e.caption,variant:"select",icon:e.icon,onItemClick:()=>O(e.id||e.label)})));k(e),y()}),[m]),n.useEffect((()=>{function e(e){b&&R.current&&!R.current.contains(e.target)&&C()}return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}}),[b]);const P=m.length?r.jsx(de,{style:{marginTop:"0.5rem"},onClick:()=>{v(""),p?.()}}):null,M="none"!==c&&!!m.length&&j.length>0&&b;let _=h("neutral",500);o?_=h("neutral",500):E&&(_=h("primary",700));const I="small"===i?"1rem":"1.25rem",D=Hh(s);return r.jsxs("div",{ref:R,style:{position:"relative",width:"100%"},children:[r.jsx(e.InputGroup,{startElement:r.jsx(ie,{width:I,height:I,fill:_,style:{marginTop:"0.5rem"}}),endElement:P,children:r.jsx(Ot,{autoComplete:"off",placeholder:t||x.filterPlaceholder,onChange:e=>{const{value:t}=e.target;v(t)},onFocus:()=>L(!0),onBlur:()=>L(!1),value:m,label:"",style:{paddingLeft:"2.5rem",borderColor:h("neutral",500)},type:"search","aria-label":t||x.filterAriaLabel,"aria-expanded":M,"aria-controls":T,role:"combobox","aria-autocomplete":"list",disabled:o,size:i,noMarginBottom:!0,onKeyDown:e=>{if(M){if("ArrowDown"===e.key&&(e.preventDefault(),S((e=>Math.min(e+1,j.length-1)))),"ArrowUp"===e.key&&(e.preventDefault(),S((e=>Math.max(e-1,0)))),"Enter"===e.key&&(e.preventDefault(),$>=0)){const e=j[$];O(e.id||e.label)}"Escape"===e.key&&C()}}})}),(M||l&&!!m.length)&&"custom"===c&&f&&!l&&f({items:j,highlightedIndex:$,query:m,onSelect:O}),(M||l&&!!m.length)&&r.jsx(e.Portal,{container:R,children:r.jsxs(e.Box,{position:"absolute",width:"100%",backgroundColor:"white",border:"custom"===c?"none":"0.0625rem solid",borderColor:"gray.200",borderRadius:"md",zIndex:1e3,overflowY:"auto",maxHeight:D,children:[l&&r.jsx(e.Box,{padding:"1rem",children:r.jsx(e.Spinner,{})}),"text"===c&&!l&&r.jsx(Af,{highlightedIndex:$,items:j,query:m,onSelect:O}),"list"===c&&!l&&r.jsx(Ji,{items:j,highlightedIndex:$})]})})]})},exports.Select=rn,exports.Sheet=({header:e,content:t,footer:o,open:i=!1,onClose:a,minimizedHeight:s,midHeight:l=200,maxFullHeight:c,defaultSnap:d="minimized",className:u,blocking:p,zIndex:h=1e3})=>{const f=n.useRef(null),g=n.useRef([]),[x,m]=n.useState(null),v=window.innerWidth>768,b=g.current;let y="Expand sheet";if(null!=x){const e=Nh(x,b);e>0&&e<b.length-1?y="Make full screen":e===b.length-1&&(y="Expanded sheet")}const w=!(null==x||!b.length||Nh(x,b)!==b.length-1);return r.jsx(Ih,{ref:f,css:Ah(!!e,h),className:u,open:i,onDismiss:a,header:r.jsxs("div",{children:[r.jsx("button",{type:"button",disabled:w,"aria-label":y,css:Dh,onKeyDown:e=>{if("Enter"!==e.key&&" "!==e.key)return;e.preventDefault();const t=b[b.length-1];if(v)return void f.current?.snapTo?.((()=>t));const n=x??b[0];let r=b.findIndex((e=>e>n));-1===r&&(r=b.length-1);const o=b[r];f.current?.snapTo?.((()=>o))},children:r.jsx("div",{})}),r.jsx("span",{"aria-live":"polite",style:{position:"absolute",width:1,height:1,overflow:"hidden",clip:"rect(0 0 0 0)"},children:y}),e]}),footer:o,snapPoints:({headerHeight:e,maxHeight:t,footerHeight:n})=>{const r=[20,s||e,l+(o?n:0),c||t-t/6];return g.current=r,r},onSpringEnd:()=>{const e=f.current?.height;e&&m(e)},defaultSnap:({headerHeight:e,maxHeight:t,footerHeight:n})=>{let r=20;return"minimized"===d?r=s||e:"mid"===d?r=l+(o?n:0):"full"===d&&(r=c||t-t/6),r},blocking:p,children:i?t:null})},exports.SimpleMapPin=({onClick:e,triggerRef:n,showFocusState:r,count:o,mode:i,variant:a="simple-pin"})=>t.jsx(Nn,{count:o,mode:i,onClick:e,ref:n,showFocusState:r,variant:a}),exports.Slider=lt,exports.SliderInput=({label:e,caption:t,size:o="default",sliderItem:i,required:a,onChange:s})=>{const[l,c]=n.useState(i.value||[]),d=(e,t)=>{const n=e.target.value,r=[...l];let o=n?parseInt(n,10):n;const a=i.min||0,s=i.max||100;o=Number.isNaN(o)?a:o,o=o<a?a:o,o=o>s?s:o,r[t]=o,c(r)},u=(e,t)=>{const n=e.target.value||"0",r=[...l];let o=parseInt(n,10);const a=i.min||0,d=i.max||100;if(o=Number.isNaN(o)?a:o,o=o<a?a:o,o=o>d?d:o,2===l?.length){o=Number.isNaN(o)?a:o;const e=l[0],n=l[1];0===t?(o=o<a?a:o,o=o>n?n:o):1===t&&(o=o<e?e:o,o=o>d?d:o)}r[t]=o,c(r),s&&s(r)};return r.jsxs("div",{children:[r.jsxs("p",{css:bn(o),"aria-label":e,children:[a?r.jsx("span",{children:"*"}):null,e]}),t?r.jsx("p",{css:yn(o),"aria-label":t,children:t}):null,r.jsxs("div",{css:wn,children:[i.step&&i.marks?r.jsx(rn,{items:i.marks.map((e=>({label:`${e.label}`,value:`${e.value}`}))),placeholder:"",style:{width:"90px"},value:[`${l?.[0]}`],onChange:e=>{const t=e.map((e=>parseInt(e,10)));c(t),s&&s(t)}}):r.jsx(Ot,{"aria-label":e,min:i.min,max:i.max,value:l?.[0],type:"number",onChange:e=>d(e,0),onBlur:e=>u(e,0),className:"ds-opacity-control-text-input",onClick:e=>e.target.select()}),r.jsx(lt,{css:{},...i,value:l,onValueChangeEnd:e=>{c(e.value),s&&s(e.value)}}),2===l?.length?r.jsx(Ot,{"aria-label":e,min:i.min,max:i.max,value:l?.[1],type:"number",onChange:e=>d(e,1),onBlur:e=>u(e,1),className:"ds-opacity-control-text-input",onClick:e=>e.target.select()}):null]})]})},exports.StepProgressIndicator=({steps:e,currentStep:t,labels:n})=>{const o=w("StepProgressIndicator",n);return r.jsxs("div",{css:dg,children:[e.map(((e,n)=>r.jsxs("div",{css:ug,children:[r.jsx("button",{css:pg(t>=n+1,t<n+1),type:"button",onClick:e.onClick,"aria-current":t===n+1,"aria-disabled":t<n+1,disabled:t<n+1,"aria-label":o.currentStepLabel(n+1,e.label||"",t>n+1),"data-active":t>=n+1,children:t>n+1?r.jsx($,{height:"16px",width:"16px"}):n+1}),e.label?r.jsx("p",{css:hg(t===n+1),children:e.label}):null]},`${e.label}-${n}`))),r.jsx("div",{css:fg,children:r.jsx("div",{css:gg})})]})},exports.Switch=dt,exports.TabBar=({variant:t="panel",defaultValue:o,tabs:i,onTabClick:a,activationMode:s="manual"})=>{const[l,c]=n.useState(_f(i,o)||0);return r.jsx("div",{css:Lf(t),children:r.jsx(e.Tabs.Root,{width:"full",defaultValue:o||i?.[0]?.value,onValueChange:({value:e})=>{return c(_f(i,t=e)),void(a&&a(t));var t},activationMode:s,children:r.jsx(e.Tabs.List,{alignItems:"center",border:"none",children:i.map(((o,i)=>r.jsxs(n.Fragment,{children:["view"===t&&1===i&&"left"===If(l)?r.jsx("div",{css:Of}):null,r.jsx(e.Tabs.Trigger,{css:[Rf,"view"===t&&Pf,"panel"===t&&Tf,"transparent"===t&&Mf],"aria-label":o["aria-label"]||o.label,...o,children:r.jsxs(e.Box,{display:"flex",alignItems:"center",gap:"0.3125rem",children:[o.icon,o.label]})},o.label),"view"===t&&1===i&&"right"===If(l)?r.jsx("div",{css:Of}):null]},o.label)))})})})},exports.Table=({columns:t,data:o=[],renderRow:i,striped:a,stickyHeader:s,pagination:l,selectable:c,selectedRows:d,variant:u="default",onSortColumn:p,onPageSizeChange:f,onPageChange:g,onAllItemsSelected:x,loading:m,labels:v})=>{const b=w("Table",v),[y,C]=n.useState({key:"",order:""}),{totalItems:j=o.length,currentPage:k=1,pageSize:$=10,showItemCount:S,showItemCountText:E}=l||{},R=(e,t)=>{C({key:e,order:t}),p&&p({key:e,order:t})},T=d?.length===o?.length,O=d&&d.length>0&&!T;return r.jsxs("div",{children:[r.jsxs(e.Table.Root,{css:oa(u),striped:a,stickyHeader:s,interactive:!0,children:[r.jsx(e.Table.Header,{css:ia(u),children:r.jsxs(e.Table.Row,{children:[c?r.jsx(e.Table.ColumnHeader,{children:r.jsx(De,{name:"header-checkbox",checked:T,indeterminate:O,onCheckedChange:({checked:e})=>{x&&x(e)}})}):null,t.map((t=>r.jsx(e.Table.ColumnHeader,{role:t.sortable?"columnheader":void 0,"aria-sort":t.sortable&&"asc"===y.order?"ascending":t.sortable&&"desc"===y.order?"descending":void 0,children:r.jsxs("div",{css:aa,children:[t.label,t.sortable?r.jsxs("div",{css:sa,children:[r.jsx(ce,{css:la(y.key===t.key&&"asc"===y.order),icon:r.jsx(L,{style:{transform:"rotate(180deg)"}}),onClick:()=>R(t.key,"asc"),"aria-label":b.ascendingLabel}),r.jsx(ce,{css:la(y.key===t.key&&"desc"===y.order),icon:r.jsx(L,{}),onClick:()=>R(t.key,"desc"),"aria-label":b.descendingLabel})]}):null]})},t.key)))]})}),r.jsx(e.Table.Body,{css:ua,children:o.map((e=>r.jsx(n.Fragment,{children:i(e)},e.id)))})]}),m?r.jsx("div",{css:pa,children:r.jsx(e.Spinner,{size:"lg",color:h("primary",500)})}):null,r.jsxs("div",{css:ca,children:[r.jsx("div",{children:S?r.jsx(Fi,{pageSize:$,currentPage:k,totalItems:j,onPageSizeChange:f,showItemCountText:E}):null}),l?r.jsx("div",{css:da,children:r.jsx(ra,{totalItems:j,pageSize:$,currentPage:k,onPageChange:g})}):null]})]})},exports.TableCell=fa,exports.TableRow=ha,exports.Tag=en,exports.TextInput=Ot,exports.Textarea=({label:t,caption:o,placeholder:i,errorMessage:a,required:s,disabled:l,size:c="default",defaultValue:d="",onChange:u,minLength:p,maxLength:h,labels:f,...g})=>{const x=w("Textarea",f),[m,v]=n.useState(d),[b,y]=n.useState(!1),[C,j]=n.useState(!1),[k,$]=n.useState(""),S=n.useId(),E=n.useId(),L=n.useId();n.useEffect((()=>{const{length:e}=d;p&&e<p&&e>0?(y(e<p),j(!1),$(x.enterAtLeastChars(p-e))):p&&0===e&&$(x.minChars(p)),h&&e>0?(y(!1),j(e>h),$(x.charsRemaining(h-e))):h&&0===e&&$(x.maxChars(h))}),[]);const R=!!a||b||C,T=[o?S:null,R?E:null,k?L:null].filter(Boolean).join(" ")||void 0;return r.jsxs("div",{css:Cn(c),children:[R?r.jsx("div",{css:jn}):null,r.jsxs(e.Field.Root,{required:s,invalid:R,gap:"0",style:{marginLeft:R?"19px":"0px"},children:[t?r.jsxs(e.Field.Label,{css:kn(c,l),"aria-label":t,children:[r.jsx(e.Field.RequiredIndicator,{"aria-label":x.requiredSymbolLabel}),t,s?"":r.jsx("span",{children:x.optionalSuffix})]}):null,o?r.jsx(e.Field.HelperText,{id:S,css:$n(c,l),children:o}):null,a?r.jsx(e.Field.ErrorText,{id:E,css:En,"aria-label":`${x.errorPrefix} ${a}`,"aria-live":"polite",children:a}):null,r.jsx(e.Textarea,{placeholder:i,disabled:l,css:Ln(c,m,d),onChange:e=>{v(e.target.value);const{length:t}=e.target.value;p&&h?(y(t<p),j(t>h),$(x.charsRemaining(h-t))):p?(y(t<p),j(!1),$(t<p?x.enterAtLeastChars(p-t):"")):h&&(j(t>h),y(!1),$(x.charsRemaining(h-t))),u&&u(e)},value:m,"aria-describedby":T,_placeholder:{color:"var(--chakra-colors-neutral-500)"},...g}),b&&p?r.jsx(e.Field.ErrorText,{id:E,css:En,style:{marginTop:"8px",fontSize:"12px",lineHeight:"16px"},"aria-live":"polite",children:x.needMoreChars(p-m.length)}):null,C&&h?r.jsx(e.Field.ErrorText,{id:E,css:En,style:{marginTop:"8px",fontSize:"12px",lineHeight:"16px"},"aria-live":"polite",children:x.tooManyChars(m.length-h)}):null,!k||C||b?null:r.jsx(e.Field.HelperText,{id:L,css:Sn,"aria-live":"polite",children:k})]})]})},exports.Toast=({labels:t})=>{const n=w("Toast",t);return Object.keys(Cg).map((t=>r.jsx(e.Portal,{children:r.jsx(e.Toaster,{toaster:Cg[t],insetInline:{mdDown:"4"},children:o=>r.jsxs(e.Toast.Root,{css:xg,width:{md:"sm"},children:[r.jsxs(e.Stack,{flexDirection:"row",className:"ds-toast-icon-container",children:["info"===o.type?o.meta?.icon?o.meta.icon:r.jsx(E,{color:"var(--chakra-colors-neutral-700)"}):null,"loading"===o.type?r.jsx(e.Spinner,{size:"lg",borderWidth:"3px",color:"var(--chakra-colors-primary-500)"}):null,"success"===o.type?o.meta?.icon?o.meta.icon:r.jsx(I,{color:"var(--chakra-colors-success-500)"}):null,"warning"===o.type?o.meta?.icon?o.meta.icon:r.jsx(D,{color:"var(--chakra-colors-warning-500)"}):null,"error"===o.type?o.meta?.icon?o.meta.icon:r.jsx(A,{color:"var(--chakra-colors-error-500)"}):null,r.jsxs(e.Stack,{gap:"1",flex:"1",maxWidth:"100%",children:[r.jsx(e.Toast.Title,{css:mg,"aria-label":`${o.title}`,children:o.title}),o.description?r.jsx(e.Toast.Title,{css:vg,"aria-label":`${o.description}`,children:o.description}):null]})]}),o.action||o.meta?.closable?r.jsxs(e.Stack,{flexDirection:"row",children:[o.action?r.jsx(C,{css:bg,label:o.action.label,size:"small",variant:"info"===o.type?"primary":"secondary",onClick:()=>{o?.action?.onClick&&o.action.onClick(),Cg[t].dismiss()}}):null,o.meta?.closable?r.jsx(C,{css:yg,label:o.meta.closableLabel,"aria-label":o.meta?.closableLabel||n.dismissLabel,leftIcon:r.jsx(T,{height:"10px!",width:"10px!"}),size:"small",variant:"secondary",onClick:()=>Cg[t].dismiss()}):null]}):null]})})},t)))},exports.Toolbar=me,exports.Tooltip=ge,exports.designSystemStyles=p,exports.designSystemStylesForTailwind=u,exports.getThemedColor=h,exports.showToast=e=>{Cg[e.placement].create({title:e.label,description:e.caption,duration:e.duration||5e3,meta:{closable:e.closable,icon:e.icon,closableLabel:e.closableLabel},...e})};
3774
+ `)}):r.jsx("div",{css:Ii,children:e?.map(((e,n)=>r.jsx("div",{"data-test":`${e}-${t?.[n]}`,style:{backgroundColor:e,width:"100%",height:"100%"}},`${e}-${t?.[n]}`)))}),r.jsx("div",{css:Di,children:t?.map((e=>r.jsx("div",{style:{width:i?"auto":`calc(100% / ${t.length})`,display:"flex",justifyContent:"center"},children:r.jsx("p",{css:Ai,children:e})},e)))}),n&&n.length?r.jsx("div",{css:Di,children:n.map((e=>r.jsx("div",{style:{width:i?"auto":`calc(100% / ${t.length})`,display:"flex",justifyContent:"center"},children:r.jsx("p",{css:Ni,style:{width:"100%"},children:e})},e)))}):null]});var a},exports.Search=({placeholder:t,disabled:o,size:i="default",options:a=[],resultsMaxHeight:s=50,isLoading:l=!1,displayResults:c="text",onSelect:d,onQueryChange:u,onClear:p,renderResults:f,labels:g})=>{const x=w("Search",g),[m,v]=n.useState(""),{open:b,onOpen:y,onClose:C}=e.useDisclosure(),[j,k]=n.useState(a),[$,S]=n.useState(-1),[E,L]=n.useState(!1),R=n.useRef(null),T=`search-results-${n.useId()}`,O=e=>{const t=a.find((t=>t.id===e||t.label===e));t&&(d?.(t),v(""),C())};n.useEffect((()=>{if(u?.(m),!m)return void k(a);const e=a.filter((e=>e.id?.toLowerCase().includes(m.toLowerCase())||e.label.toLowerCase().includes(m.toLowerCase())||e.caption?.toLowerCase().includes(m.toLowerCase()))).map((e=>({id:e.id,label:e.label,caption:e.caption,variant:"select",icon:e.icon,onItemClick:()=>O(e.id||e.label)})));k(e),y()}),[m]),n.useEffect((()=>{function e(e){b&&R.current&&!R.current.contains(e.target)&&C()}return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}}),[b]);const P=m.length?r.jsx(de,{style:{marginTop:"0.5rem"},onClick:()=>{v(""),p?.()}}):null,M="none"!==c&&!!m.length&&j.length>0&&b;let _=h("neutral",500);o?_=h("neutral",500):E&&(_=h("primary",700));const I="small"===i?"1rem":"1.25rem",D=ms(s);return r.jsxs("div",{ref:R,style:{position:"relative",width:"100%"},children:[r.jsx(e.InputGroup,{startElement:r.jsx(ie,{width:I,height:I,fill:_,style:{marginTop:"0.5rem"}}),endElement:P,children:r.jsx(Ot,{autoComplete:"off",placeholder:t||x.filterPlaceholder,onChange:e=>{const{value:t}=e.target;v(t)},onFocus:()=>L(!0),onBlur:()=>L(!1),value:m,label:"",style:{paddingLeft:"2.5rem",borderColor:h("neutral",500)},type:"search","aria-label":t||x.filterAriaLabel,"aria-expanded":M,"aria-controls":T,role:"combobox","aria-autocomplete":"list",disabled:o,size:i,noMarginBottom:!0,onKeyDown:e=>{if(M){if("ArrowDown"===e.key&&(e.preventDefault(),S((e=>Math.min(e+1,j.length-1)))),"ArrowUp"===e.key&&(e.preventDefault(),S((e=>Math.max(e-1,0)))),"Enter"===e.key&&(e.preventDefault(),$>=0)){const e=j[$];O(e.id||e.label)}"Escape"===e.key&&C()}}})}),(M||l&&!!m.length)&&"custom"===c&&f&&!l&&f({items:j,highlightedIndex:$,query:m,onSelect:O}),(M||l&&!!m.length)&&r.jsx(e.Portal,{container:R,children:r.jsxs(e.Box,{position:"absolute",width:"100%",backgroundColor:"white",border:"custom"===c?"none":"0.0625rem solid",borderColor:"gray.200",borderRadius:"md",zIndex:1e3,overflowY:"auto",maxHeight:D,children:[l&&r.jsx(e.Box,{padding:"1rem",children:r.jsx(e.Spinner,{})}),"text"===c&&!l&&r.jsx(Af,{highlightedIndex:$,items:j,query:m,onSelect:O}),"list"===c&&!l&&r.jsx(Ji,{items:j,highlightedIndex:$})]})})]})},exports.Select=rn,exports.Sheet=({header:e,content:t,footer:o,open:i=!1,onClose:a,minimizedHeight:s,midHeight:l=200,maxFullHeight:c,defaultSnap:d="minimized",className:u,blocking:p,zIndex:h=1e3})=>{const f=n.useRef(null),g=n.useRef([]),[x,m]=n.useState(null),v=window.innerWidth>768,b=g.current;let y="Expand sheet";if(null!=x){const e=Vh(x,b);e>0&&e<b.length-1?y="Make full screen":e===b.length-1&&(y="Expanded sheet")}const w=!(null==x||!b.length||Vh(x,b)!==b.length-1);return r.jsx(Dh,{ref:f,css:Nh(!!e,h),className:u,open:i,onDismiss:a,header:r.jsxs("div",{children:[r.jsx("button",{type:"button",disabled:w,"aria-label":y,css:Ah,onKeyDown:e=>{if("Enter"!==e.key&&" "!==e.key)return;e.preventDefault();const t=b[b.length-1];if(v)return void f.current?.snapTo?.((()=>t));const n=x??b[0];let r=b.findIndex((e=>e>n));-1===r&&(r=b.length-1);const o=b[r];f.current?.snapTo?.((()=>o))},children:r.jsx("div",{})}),r.jsx("span",{"aria-live":"polite",style:{position:"absolute",width:1,height:1,overflow:"hidden",clip:"rect(0 0 0 0)"},children:y}),e]}),footer:o,snapPoints:({headerHeight:e,maxHeight:t,footerHeight:n})=>{const r=[20,s||e,l+(o?n:0),c||t-t/6];return g.current=r,r},onSpringEnd:()=>{const e=f.current?.height;e&&m(e)},defaultSnap:({headerHeight:e,maxHeight:t,footerHeight:n})=>{let r=20;return"minimized"===d?r=s||e:"mid"===d?r=l+(o?n:0):"full"===d&&(r=c||t-t/6),r},blocking:p,children:i?t:null})},exports.SimpleMapPin=({onClick:e,triggerRef:n,showFocusState:r,count:o,mode:i,variant:a="simple-pin"})=>t.jsx(Nn,{count:o,mode:i,onClick:e,ref:n,showFocusState:r,variant:a}),exports.Slider=lt,exports.SliderInput=({label:e,caption:t,size:o="default",sliderItem:i,required:a,onChange:s})=>{const[l,c]=n.useState(i.value||[]),d=(e,t)=>{const n=e.target.value,r=[...l];let o=n?parseInt(n,10):n;const a=i.min||0,s=i.max||100;o=Number.isNaN(o)?a:o,o=o<a?a:o,o=o>s?s:o,r[t]=o,c(r)},u=(e,t)=>{const n=e.target.value||"0",r=[...l];let o=parseInt(n,10);const a=i.min||0,d=i.max||100;if(o=Number.isNaN(o)?a:o,o=o<a?a:o,o=o>d?d:o,2===l?.length){o=Number.isNaN(o)?a:o;const e=l[0],n=l[1];0===t?(o=o<a?a:o,o=o>n?n:o):1===t&&(o=o<e?e:o,o=o>d?d:o)}r[t]=o,c(r),s&&s(r)};return r.jsxs("div",{children:[r.jsxs("p",{css:bn(o),"aria-label":e,children:[a?r.jsx("span",{children:"*"}):null,e]}),t?r.jsx("p",{css:yn(o),"aria-label":t,children:t}):null,r.jsxs("div",{css:wn,children:[i.step&&i.marks?r.jsx(rn,{items:i.marks.map((e=>({label:`${e.label}`,value:`${e.value}`}))),placeholder:"",style:{width:"90px"},value:[`${l?.[0]}`],onChange:e=>{const t=e.map((e=>parseInt(e,10)));c(t),s&&s(t)}}):r.jsx(Ot,{"aria-label":e,min:i.min,max:i.max,value:l?.[0],type:"number",onChange:e=>d(e,0),onBlur:e=>u(e,0),className:"ds-opacity-control-text-input",onClick:e=>e.target.select()}),r.jsx(lt,{css:{},...i,value:l,onValueChangeEnd:e=>{c(e.value),s&&s(e.value)}}),2===l?.length?r.jsx(Ot,{"aria-label":e,min:i.min,max:i.max,value:l?.[1],type:"number",onChange:e=>d(e,1),onBlur:e=>u(e,1),className:"ds-opacity-control-text-input",onClick:e=>e.target.select()}):null]})]})},exports.StepProgressIndicator=({steps:e,currentStep:t,labels:n})=>{const o=w("StepProgressIndicator",n);return r.jsxs("div",{css:dg,children:[e.map(((e,n)=>r.jsxs("div",{css:ug,children:[r.jsx("button",{css:pg(t>=n+1,t<n+1),type:"button",onClick:e.onClick,"aria-current":t===n+1,"aria-disabled":t<n+1,disabled:t<n+1,"aria-label":o.currentStepLabel(n+1,e.label||"",t>n+1),"data-active":t>=n+1,children:t>n+1?r.jsx($,{height:"16px",width:"16px"}):n+1}),e.label?r.jsx("p",{css:hg(t===n+1),children:e.label}):null]},`${e.label}-${n}`))),r.jsx("div",{css:fg,children:r.jsx("div",{css:gg})})]})},exports.Switch=dt,exports.TabBar=({variant:t="panel",defaultValue:o,tabs:i,onTabClick:a,activationMode:s="manual"})=>{const[l,c]=n.useState(_f(i,o)||0);return r.jsx("div",{css:Lf(t),children:r.jsx(e.Tabs.Root,{width:"full",defaultValue:o||i?.[0]?.value,onValueChange:({value:e})=>{return c(_f(i,t=e)),void(a&&a(t));var t},activationMode:s,children:r.jsx(e.Tabs.List,{alignItems:"center",border:"none",children:i.map(((o,i)=>r.jsxs(n.Fragment,{children:["view"===t&&1===i&&"left"===If(l)?r.jsx("div",{css:Of}):null,r.jsx(e.Tabs.Trigger,{css:[Rf,"view"===t&&Pf,"panel"===t&&Tf,"transparent"===t&&Mf],"aria-label":o["aria-label"]||o.label,...o,children:r.jsxs(e.Box,{display:"flex",alignItems:"center",gap:"0.3125rem",children:[o.icon,o.label]})},o.label),"view"===t&&1===i&&"right"===If(l)?r.jsx("div",{css:Of}):null]},o.label)))})})})},exports.Table=({columns:t,data:o=[],renderRow:i,striped:a,stickyHeader:s,pagination:l,selectable:c,selectedRows:d,variant:u="default",onSortColumn:p,onPageSizeChange:f,onPageChange:g,onAllItemsSelected:x,loading:m,labels:v})=>{const b=w("Table",v),[y,C]=n.useState({key:"",order:""}),{totalItems:j=o.length,currentPage:k=1,pageSize:$=10,showItemCount:S,showItemCountText:E}=l||{},R=(e,t)=>{C({key:e,order:t}),p&&p({key:e,order:t})},T=d?.length===o?.length,O=d&&d.length>0&&!T;return r.jsxs("div",{children:[r.jsxs(e.Table.Root,{css:oa(u),striped:a,stickyHeader:s,interactive:!0,children:[r.jsx(e.Table.Header,{css:ia(u),children:r.jsxs(e.Table.Row,{children:[c?r.jsx(e.Table.ColumnHeader,{children:r.jsx(De,{name:"header-checkbox",checked:T,indeterminate:O,onCheckedChange:({checked:e})=>{x&&x(e)}})}):null,t.map((t=>r.jsx(e.Table.ColumnHeader,{role:t.sortable?"columnheader":void 0,"aria-sort":t.sortable&&"asc"===y.order?"ascending":t.sortable&&"desc"===y.order?"descending":void 0,children:r.jsxs("div",{css:aa,children:[t.label,t.sortable?r.jsxs("div",{css:sa,children:[r.jsx(ce,{css:la(y.key===t.key&&"asc"===y.order),icon:r.jsx(L,{style:{transform:"rotate(180deg)"}}),onClick:()=>R(t.key,"asc"),"aria-label":b.ascendingLabel}),r.jsx(ce,{css:la(y.key===t.key&&"desc"===y.order),icon:r.jsx(L,{}),onClick:()=>R(t.key,"desc"),"aria-label":b.descendingLabel})]}):null]})},t.key)))]})}),r.jsx(e.Table.Body,{css:ua,children:o.map((e=>r.jsx(n.Fragment,{children:i(e,{className:d?.some((t=>t.id===e.id))?"selected":void 0})},e.id)))})]}),m?r.jsx("div",{css:pa,children:r.jsx(e.Spinner,{size:"lg",color:h("primary",500)})}):null,r.jsxs("div",{css:ca,children:[r.jsx("div",{children:S?r.jsx(Fi,{pageSize:$,currentPage:k,totalItems:j,onPageSizeChange:f,showItemCountText:E}):null}),l?r.jsx("div",{css:da,children:r.jsx(ra,{totalItems:j,pageSize:$,currentPage:k,onPageChange:g})}):null]})]})},exports.TableCell=fa,exports.TableRow=ha,exports.Tag=en,exports.TextInput=Ot,exports.Textarea=({label:t,caption:o,placeholder:i,errorMessage:a,required:s,disabled:l,size:c="default",defaultValue:d="",onChange:u,minLength:p,maxLength:h,labels:f,...g})=>{const x=w("Textarea",f),[m,v]=n.useState(d),[b,y]=n.useState(!1),[C,j]=n.useState(!1),[k,$]=n.useState(""),S=n.useId(),E=n.useId(),L=n.useId();n.useEffect((()=>{const{length:e}=d;p&&e<p&&e>0?(y(e<p),j(!1),$(x.enterAtLeastChars(p-e))):p&&0===e&&$(x.minChars(p)),h&&e>0?(y(!1),j(e>h),$(x.charsRemaining(h-e))):h&&0===e&&$(x.maxChars(h))}),[]);const R=!!a||b||C,T=[o?S:null,R?E:null,k?L:null].filter(Boolean).join(" ")||void 0;return r.jsxs("div",{css:Cn(c),children:[R?r.jsx("div",{css:jn}):null,r.jsxs(e.Field.Root,{required:s,invalid:R,gap:"0",style:{marginLeft:R?"19px":"0px"},children:[t?r.jsxs(e.Field.Label,{css:kn(c,l),"aria-label":t,children:[r.jsx(e.Field.RequiredIndicator,{"aria-label":x.requiredSymbolLabel}),t,s?"":r.jsx("span",{children:x.optionalSuffix})]}):null,o?r.jsx(e.Field.HelperText,{id:S,css:$n(c,l),children:o}):null,a?r.jsx(e.Field.ErrorText,{id:E,css:En,"aria-label":`${x.errorPrefix} ${a}`,"aria-live":"polite",children:a}):null,r.jsx(e.Textarea,{placeholder:i,disabled:l,css:Ln(c,m,d),onChange:e=>{v(e.target.value);const{length:t}=e.target.value;p&&h?(y(t<p),j(t>h),$(x.charsRemaining(h-t))):p?(y(t<p),j(!1),$(t<p?x.enterAtLeastChars(p-t):"")):h&&(j(t>h),y(!1),$(x.charsRemaining(h-t))),u&&u(e)},value:m,"aria-describedby":T,_placeholder:{color:"var(--chakra-colors-neutral-500)"},...g}),b&&p?r.jsx(e.Field.ErrorText,{id:E,css:En,style:{marginTop:"8px",fontSize:"12px",lineHeight:"16px"},"aria-live":"polite",children:x.needMoreChars(p-m.length)}):null,C&&h?r.jsx(e.Field.ErrorText,{id:E,css:En,style:{marginTop:"8px",fontSize:"12px",lineHeight:"16px"},"aria-live":"polite",children:x.tooManyChars(m.length-h)}):null,!k||C||b?null:r.jsx(e.Field.HelperText,{id:L,css:Sn,"aria-live":"polite",children:k})]})]})},exports.Toast=({labels:t})=>{const n=w("Toast",t);return Object.keys(Cg).map((t=>r.jsx(e.Portal,{children:r.jsx(e.Toaster,{toaster:Cg[t],insetInline:{mdDown:"4"},children:o=>r.jsxs(e.Toast.Root,{css:xg,width:{md:"sm"},children:[r.jsxs(e.Stack,{flexDirection:"row",className:"ds-toast-icon-container",children:["info"===o.type?o.meta?.icon?o.meta.icon:r.jsx(E,{color:"var(--chakra-colors-neutral-700)"}):null,"loading"===o.type?r.jsx(e.Spinner,{size:"lg",borderWidth:"3px",color:"var(--chakra-colors-primary-500)"}):null,"success"===o.type?o.meta?.icon?o.meta.icon:r.jsx(I,{color:"var(--chakra-colors-success-500)"}):null,"warning"===o.type?o.meta?.icon?o.meta.icon:r.jsx(D,{color:"var(--chakra-colors-warning-500)"}):null,"error"===o.type?o.meta?.icon?o.meta.icon:r.jsx(A,{color:"var(--chakra-colors-error-500)"}):null,r.jsxs(e.Stack,{gap:"1",flex:"1",maxWidth:"100%",children:[r.jsx(e.Toast.Title,{css:mg,"aria-label":`${o.title}`,children:o.title}),o.description?r.jsx(e.Toast.Title,{css:vg,"aria-label":`${o.description}`,children:o.description}):null]})]}),o.action||o.meta?.closable?r.jsxs(e.Stack,{flexDirection:"row",children:[o.action?r.jsx(C,{css:bg,label:o.action.label,size:"small",variant:"info"===o.type?"primary":"secondary",onClick:()=>{o?.action?.onClick&&o.action.onClick(),Cg[t].dismiss()}}):null,o.meta?.closable?r.jsx(C,{css:yg,label:o.meta.closableLabel,"aria-label":o.meta?.closableLabel||n.dismissLabel,leftIcon:r.jsx(T,{height:"10px!",width:"10px!"}),size:"small",variant:"secondary",onClick:()=>Cg[t].dismiss()}):null]}):null]})})},t)))},exports.Toolbar=me,exports.Tooltip=ge,exports.designSystemStyles=p,exports.designSystemStylesForTailwind=u,exports.getThemedColor=h,exports.showToast=e=>{Cg[e.placement].create({title:e.label,description:e.caption,duration:e.duration||5e3,meta:{closable:e.closable,icon:e.icon,closableLabel:e.closableLabel},...e})};