@signalwire/cfb 0.1.0-dev.202305301528.a3ecb8d.0 → 0.1.0-dev.202306050852.bc21269.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/main.js CHANGED
@@ -1,8 +1,8 @@
1
1
  (function(Pr,Uo){typeof exports=="object"&&typeof module<"u"?Uo(exports):typeof define=="function"&&define.amd?define(["exports"],Uo):(Pr=typeof globalThis<"u"?globalThis:Pr||self,Uo(Pr.CFB={}))})(this,function(Pr){"use strict";/**
2
- * Visual Builder v0.0.1 [a3ecb8d] (https://signalwire.com)
2
+ * Visual Builder v0.0.1 [bc21269] (https://signalwire.com)
3
3
  * Copyright 2018-2023 SignalWire.
4
4
  */
5
- function Uo(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const o in r)if(o!=="default"&&!(o in e)){const i=Object.getOwnPropertyDescriptor(r,o);i&&Object.defineProperty(e,o,i.get?i:{enumerable:!0,get:()=>r[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}function gf(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Fo={},tE={get exports(){return Fo},set exports(e){Fo=e}},ps={},N={},nE={get exports(){return N},set exports(e){N=e}},J={};/**
5
+ function Uo(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const o in r)if(o!=="default"&&!(o in e)){const i=Object.getOwnPropertyDescriptor(r,o);i&&Object.defineProperty(e,o,i.get?i:{enumerable:!0,get:()=>r[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}function hf(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Fo={},tE={get exports(){return Fo},set exports(e){Fo=e}},ps={},N={},nE={get exports(){return N},set exports(e){N=e}},J={};/**
6
6
  * @license React
7
7
  * react.production.min.js
8
8
  *
@@ -10,7 +10,7 @@ function Uo(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&
10
10
  *
11
11
  * This source code is licensed under the MIT license found in the
12
12
  * LICENSE file in the root directory of this source tree.
13
- */var Vo=Symbol.for("react.element"),rE=Symbol.for("react.portal"),oE=Symbol.for("react.fragment"),iE=Symbol.for("react.strict_mode"),sE=Symbol.for("react.profiler"),aE=Symbol.for("react.provider"),lE=Symbol.for("react.context"),uE=Symbol.for("react.forward_ref"),cE=Symbol.for("react.suspense"),dE=Symbol.for("react.memo"),fE=Symbol.for("react.lazy"),mf=Symbol.iterator;function pE(e){return e===null||typeof e!="object"?null:(e=mf&&e[mf]||e["@@iterator"],typeof e=="function"?e:null)}var vf={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},yf=Object.assign,Ef={};function Mr(e,t,n){this.props=e,this.context=t,this.refs=Ef,this.updater=n||vf}Mr.prototype.isReactComponent={},Mr.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},Mr.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Sf(){}Sf.prototype=Mr.prototype;function Sl(e,t,n){this.props=e,this.context=t,this.refs=Ef,this.updater=n||vf}var _l=Sl.prototype=new Sf;_l.constructor=Sl,yf(_l,Mr.prototype),_l.isPureReactComponent=!0;var _f=Array.isArray,wf=Object.prototype.hasOwnProperty,wl={current:null},Rf={key:!0,ref:!0,__self:!0,__source:!0};function Nf(e,t,n){var r,o={},i=null,s=null;if(t!=null)for(r in t.ref!==void 0&&(s=t.ref),t.key!==void 0&&(i=""+t.key),t)wf.call(t,r)&&!Rf.hasOwnProperty(r)&&(o[r]=t[r]);var a=arguments.length-2;if(a===1)o.children=n;else if(1<a){for(var l=Array(a),u=0;u<a;u++)l[u]=arguments[u+2];o.children=l}if(e&&e.defaultProps)for(r in a=e.defaultProps,a)o[r]===void 0&&(o[r]=a[r]);return{$$typeof:Vo,type:e,key:i,ref:s,props:o,_owner:wl.current}}function hE(e,t){return{$$typeof:Vo,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Rl(e){return typeof e=="object"&&e!==null&&e.$$typeof===Vo}function gE(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var Of=/\/+/g;function Nl(e,t){return typeof e=="object"&&e!==null&&e.key!=null?gE(""+e.key):t.toString(36)}function hs(e,t,n,r,o){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var s=!1;if(e===null)s=!0;else switch(i){case"string":case"number":s=!0;break;case"object":switch(e.$$typeof){case Vo:case rE:s=!0}}if(s)return s=e,o=o(s),e=r===""?"."+Nl(s,0):r,_f(o)?(n="",e!=null&&(n=e.replace(Of,"$&/")+"/"),hs(o,t,n,"",function(u){return u})):o!=null&&(Rl(o)&&(o=hE(o,n+(!o.key||s&&s.key===o.key?"":(""+o.key).replace(Of,"$&/")+"/")+e)),t.push(o)),1;if(s=0,r=r===""?".":r+":",_f(e))for(var a=0;a<e.length;a++){i=e[a];var l=r+Nl(i,a);s+=hs(i,t,n,l,o)}else if(l=pE(e),typeof l=="function")for(e=l.call(e),a=0;!(i=e.next()).done;)i=i.value,l=r+Nl(i,a++),s+=hs(i,t,n,l,o);else if(i==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return s}function gs(e,t,n){if(e==null)return e;var r=[],o=0;return hs(e,r,"","",function(i){return t.call(n,i,o++)}),r}function mE(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Ve={current:null},ms={transition:null},vE={ReactCurrentDispatcher:Ve,ReactCurrentBatchConfig:ms,ReactCurrentOwner:wl};J.Children={map:gs,forEach:function(e,t,n){gs(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return gs(e,function(){t++}),t},toArray:function(e){return gs(e,function(t){return t})||[]},only:function(e){if(!Rl(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},J.Component=Mr,J.Fragment=oE,J.Profiler=sE,J.PureComponent=Sl,J.StrictMode=iE,J.Suspense=cE,J.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=vE,J.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=yf({},e.props),o=e.key,i=e.ref,s=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,s=wl.current),t.key!==void 0&&(o=""+t.key),e.type&&e.type.defaultProps)var a=e.type.defaultProps;for(l in t)wf.call(t,l)&&!Rf.hasOwnProperty(l)&&(r[l]=t[l]===void 0&&a!==void 0?a[l]:t[l])}var l=arguments.length-2;if(l===1)r.children=n;else if(1<l){a=Array(l);for(var u=0;u<l;u++)a[u]=arguments[u+2];r.children=a}return{$$typeof:Vo,type:e.type,key:o,ref:i,props:r,_owner:s}},J.createContext=function(e){return e={$$typeof:lE,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:aE,_context:e},e.Consumer=e},J.createElement=Nf,J.createFactory=function(e){var t=Nf.bind(null,e);return t.type=e,t},J.createRef=function(){return{current:null}},J.forwardRef=function(e){return{$$typeof:uE,render:e}},J.isValidElement=Rl,J.lazy=function(e){return{$$typeof:fE,_payload:{_status:-1,_result:e},_init:mE}},J.memo=function(e,t){return{$$typeof:dE,type:e,compare:t===void 0?null:t}},J.startTransition=function(e){var t=ms.transition;ms.transition={};try{e()}finally{ms.transition=t}},J.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")},J.useCallback=function(e,t){return Ve.current.useCallback(e,t)},J.useContext=function(e){return Ve.current.useContext(e)},J.useDebugValue=function(){},J.useDeferredValue=function(e){return Ve.current.useDeferredValue(e)},J.useEffect=function(e,t){return Ve.current.useEffect(e,t)},J.useId=function(){return Ve.current.useId()},J.useImperativeHandle=function(e,t,n){return Ve.current.useImperativeHandle(e,t,n)},J.useInsertionEffect=function(e,t){return Ve.current.useInsertionEffect(e,t)},J.useLayoutEffect=function(e,t){return Ve.current.useLayoutEffect(e,t)},J.useMemo=function(e,t){return Ve.current.useMemo(e,t)},J.useReducer=function(e,t,n){return Ve.current.useReducer(e,t,n)},J.useRef=function(e){return Ve.current.useRef(e)},J.useState=function(e){return Ve.current.useState(e)},J.useSyncExternalStore=function(e,t,n){return Ve.current.useSyncExternalStore(e,t,n)},J.useTransition=function(){return Ve.current.useTransition()},J.version="18.2.0",function(e){e.exports=J}(nE);const pt=gf(N),xf=Uo({__proto__:null,default:pt},[N]);/**
13
+ */var Vo=Symbol.for("react.element"),rE=Symbol.for("react.portal"),oE=Symbol.for("react.fragment"),iE=Symbol.for("react.strict_mode"),sE=Symbol.for("react.profiler"),aE=Symbol.for("react.provider"),lE=Symbol.for("react.context"),uE=Symbol.for("react.forward_ref"),cE=Symbol.for("react.suspense"),dE=Symbol.for("react.memo"),fE=Symbol.for("react.lazy"),gf=Symbol.iterator;function pE(e){return e===null||typeof e!="object"?null:(e=gf&&e[gf]||e["@@iterator"],typeof e=="function"?e:null)}var mf={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},vf=Object.assign,yf={};function Mr(e,t,n){this.props=e,this.context=t,this.refs=yf,this.updater=n||mf}Mr.prototype.isReactComponent={},Mr.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},Mr.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Ef(){}Ef.prototype=Mr.prototype;function Sl(e,t,n){this.props=e,this.context=t,this.refs=yf,this.updater=n||mf}var _l=Sl.prototype=new Ef;_l.constructor=Sl,vf(_l,Mr.prototype),_l.isPureReactComponent=!0;var Sf=Array.isArray,_f=Object.prototype.hasOwnProperty,wl={current:null},wf={key:!0,ref:!0,__self:!0,__source:!0};function Rf(e,t,n){var r,o={},i=null,s=null;if(t!=null)for(r in t.ref!==void 0&&(s=t.ref),t.key!==void 0&&(i=""+t.key),t)_f.call(t,r)&&!wf.hasOwnProperty(r)&&(o[r]=t[r]);var a=arguments.length-2;if(a===1)o.children=n;else if(1<a){for(var l=Array(a),u=0;u<a;u++)l[u]=arguments[u+2];o.children=l}if(e&&e.defaultProps)for(r in a=e.defaultProps,a)o[r]===void 0&&(o[r]=a[r]);return{$$typeof:Vo,type:e,key:i,ref:s,props:o,_owner:wl.current}}function hE(e,t){return{$$typeof:Vo,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Rl(e){return typeof e=="object"&&e!==null&&e.$$typeof===Vo}function gE(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var Nf=/\/+/g;function Nl(e,t){return typeof e=="object"&&e!==null&&e.key!=null?gE(""+e.key):t.toString(36)}function hs(e,t,n,r,o){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var s=!1;if(e===null)s=!0;else switch(i){case"string":case"number":s=!0;break;case"object":switch(e.$$typeof){case Vo:case rE:s=!0}}if(s)return s=e,o=o(s),e=r===""?"."+Nl(s,0):r,Sf(o)?(n="",e!=null&&(n=e.replace(Nf,"$&/")+"/"),hs(o,t,n,"",function(u){return u})):o!=null&&(Rl(o)&&(o=hE(o,n+(!o.key||s&&s.key===o.key?"":(""+o.key).replace(Nf,"$&/")+"/")+e)),t.push(o)),1;if(s=0,r=r===""?".":r+":",Sf(e))for(var a=0;a<e.length;a++){i=e[a];var l=r+Nl(i,a);s+=hs(i,t,n,l,o)}else if(l=pE(e),typeof l=="function")for(e=l.call(e),a=0;!(i=e.next()).done;)i=i.value,l=r+Nl(i,a++),s+=hs(i,t,n,l,o);else if(i==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return s}function gs(e,t,n){if(e==null)return e;var r=[],o=0;return hs(e,r,"","",function(i){return t.call(n,i,o++)}),r}function mE(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Ve={current:null},ms={transition:null},vE={ReactCurrentDispatcher:Ve,ReactCurrentBatchConfig:ms,ReactCurrentOwner:wl};J.Children={map:gs,forEach:function(e,t,n){gs(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return gs(e,function(){t++}),t},toArray:function(e){return gs(e,function(t){return t})||[]},only:function(e){if(!Rl(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},J.Component=Mr,J.Fragment=oE,J.Profiler=sE,J.PureComponent=Sl,J.StrictMode=iE,J.Suspense=cE,J.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=vE,J.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=vf({},e.props),o=e.key,i=e.ref,s=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,s=wl.current),t.key!==void 0&&(o=""+t.key),e.type&&e.type.defaultProps)var a=e.type.defaultProps;for(l in t)_f.call(t,l)&&!wf.hasOwnProperty(l)&&(r[l]=t[l]===void 0&&a!==void 0?a[l]:t[l])}var l=arguments.length-2;if(l===1)r.children=n;else if(1<l){a=Array(l);for(var u=0;u<l;u++)a[u]=arguments[u+2];r.children=a}return{$$typeof:Vo,type:e.type,key:o,ref:i,props:r,_owner:s}},J.createContext=function(e){return e={$$typeof:lE,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:aE,_context:e},e.Consumer=e},J.createElement=Rf,J.createFactory=function(e){var t=Rf.bind(null,e);return t.type=e,t},J.createRef=function(){return{current:null}},J.forwardRef=function(e){return{$$typeof:uE,render:e}},J.isValidElement=Rl,J.lazy=function(e){return{$$typeof:fE,_payload:{_status:-1,_result:e},_init:mE}},J.memo=function(e,t){return{$$typeof:dE,type:e,compare:t===void 0?null:t}},J.startTransition=function(e){var t=ms.transition;ms.transition={};try{e()}finally{ms.transition=t}},J.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")},J.useCallback=function(e,t){return Ve.current.useCallback(e,t)},J.useContext=function(e){return Ve.current.useContext(e)},J.useDebugValue=function(){},J.useDeferredValue=function(e){return Ve.current.useDeferredValue(e)},J.useEffect=function(e,t){return Ve.current.useEffect(e,t)},J.useId=function(){return Ve.current.useId()},J.useImperativeHandle=function(e,t,n){return Ve.current.useImperativeHandle(e,t,n)},J.useInsertionEffect=function(e,t){return Ve.current.useInsertionEffect(e,t)},J.useLayoutEffect=function(e,t){return Ve.current.useLayoutEffect(e,t)},J.useMemo=function(e,t){return Ve.current.useMemo(e,t)},J.useReducer=function(e,t,n){return Ve.current.useReducer(e,t,n)},J.useRef=function(e){return Ve.current.useRef(e)},J.useState=function(e){return Ve.current.useState(e)},J.useSyncExternalStore=function(e,t,n){return Ve.current.useSyncExternalStore(e,t,n)},J.useTransition=function(){return Ve.current.useTransition()},J.version="18.2.0",function(e){e.exports=J}(nE);const pt=hf(N),Of=Uo({__proto__:null,default:pt},[N]);/**
14
14
  * @license React
15
15
  * react-jsx-runtime.production.min.js
16
16
  *
@@ -18,7 +18,7 @@ function Uo(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&
18
18
  *
19
19
  * This source code is licensed under the MIT license found in the
20
20
  * LICENSE file in the root directory of this source tree.
21
- */var yE=N,EE=Symbol.for("react.element"),SE=Symbol.for("react.fragment"),_E=Object.prototype.hasOwnProperty,wE=yE.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,RE={key:!0,ref:!0,__self:!0,__source:!0};function Tf(e,t,n){var r,o={},i=null,s=null;n!==void 0&&(i=""+n),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(s=t.ref);for(r in t)_E.call(t,r)&&!RE.hasOwnProperty(r)&&(o[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)o[r]===void 0&&(o[r]=t[r]);return{$$typeof:EE,type:e,key:i,ref:s,props:o,_owner:wE.current}}ps.Fragment=SE,ps.jsx=Tf,ps.jsxs=Tf,function(e){e.exports=ps}(tE);const ve=Fo.Fragment,E=Fo.jsx,k=Fo.jsxs;var Ol={},Ur={},NE={get exports(){return Ur},set exports(e){Ur=e}},rt={},xl={},OE={get exports(){return xl},set exports(e){xl=e}},Cf={};/**
21
+ */var yE=N,EE=Symbol.for("react.element"),SE=Symbol.for("react.fragment"),_E=Object.prototype.hasOwnProperty,wE=yE.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,RE={key:!0,ref:!0,__self:!0,__source:!0};function xf(e,t,n){var r,o={},i=null,s=null;n!==void 0&&(i=""+n),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(s=t.ref);for(r in t)_E.call(t,r)&&!RE.hasOwnProperty(r)&&(o[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)o[r]===void 0&&(o[r]=t[r]);return{$$typeof:EE,type:e,key:i,ref:s,props:o,_owner:wE.current}}ps.Fragment=SE,ps.jsx=xf,ps.jsxs=xf,function(e){e.exports=ps}(tE);const ve=Fo.Fragment,E=Fo.jsx,k=Fo.jsxs;var Ol={},Ur={},NE={get exports(){return Ur},set exports(e){Ur=e}},rt={},xl={},OE={get exports(){return xl},set exports(e){xl=e}},Tf={};/**
22
22
  * @license React
23
23
  * scheduler.production.min.js
24
24
  *
@@ -26,7 +26,7 @@ function Uo(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&
26
26
  *
27
27
  * This source code is licensed under the MIT license found in the
28
28
  * LICENSE file in the root directory of this source tree.
29
- */(function(e){function t(T,P){var U=T.length;T.push(P);e:for(;0<U;){var H=U-1>>>1,j=T[H];if(0<o(j,P))T[H]=P,T[U]=j,U=H;else break e}}function n(T){return T.length===0?null:T[0]}function r(T){if(T.length===0)return null;var P=T[0],U=T.pop();if(U!==P){T[0]=U;e:for(var H=0,j=T.length,K=j>>>1;H<K;){var W=2*(H+1)-1,Z=T[W],X=W+1,te=T[X];if(0>o(Z,U))X<j&&0>o(te,Z)?(T[H]=te,T[X]=U,H=X):(T[H]=Z,T[W]=U,H=W);else if(X<j&&0>o(te,U))T[H]=te,T[X]=U,H=X;else break e}}return P}function o(T,P){var U=T.sortIndex-P.sortIndex;return U!==0?U:T.id-P.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var s=Date,a=s.now();e.unstable_now=function(){return s.now()-a}}var l=[],u=[],c=1,d=null,f=3,h=!1,m=!1,v=!1,y=typeof setTimeout=="function"?setTimeout:null,p=typeof clearTimeout=="function"?clearTimeout:null,g=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function S(T){for(var P=n(u);P!==null;){if(P.callback===null)r(u);else if(P.startTime<=T)r(u),P.sortIndex=P.expirationTime,t(l,P);else break;P=n(u)}}function _(T){if(v=!1,S(T),!m)if(n(l)!==null)m=!0,D(w);else{var P=n(u);P!==null&&A(_,P.startTime-T)}}function w(T,P){m=!1,v&&(v=!1,p(L),L=-1),h=!0;var U=f;try{for(S(P),d=n(l);d!==null&&(!(d.expirationTime>P)||T&&!V());){var H=d.callback;if(typeof H=="function"){d.callback=null,f=d.priorityLevel;var j=H(d.expirationTime<=P);P=e.unstable_now(),typeof j=="function"?d.callback=j:d===n(l)&&r(l),S(P)}else r(l);d=n(l)}if(d!==null)var K=!0;else{var W=n(u);W!==null&&A(_,W.startTime-P),K=!1}return K}finally{d=null,f=U,h=!1}}var R=!1,C=null,L=-1,B=5,I=-1;function V(){return!(e.unstable_now()-I<B)}function $(){if(C!==null){var T=e.unstable_now();I=T;var P=!0;try{P=C(!0,T)}finally{P?F():(R=!1,C=null)}}else R=!1}var F;if(typeof g=="function")F=function(){g($)};else if(typeof MessageChannel<"u"){var O=new MessageChannel,M=O.port2;O.port1.onmessage=$,F=function(){M.postMessage(null)}}else F=function(){y($,0)};function D(T){C=T,R||(R=!0,F())}function A(T,P){L=y(function(){T(e.unstable_now())},P)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(T){T.callback=null},e.unstable_continueExecution=function(){m||h||(m=!0,D(w))},e.unstable_forceFrameRate=function(T){0>T||125<T?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):B=0<T?Math.floor(1e3/T):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(l)},e.unstable_next=function(T){switch(f){case 1:case 2:case 3:var P=3;break;default:P=f}var U=f;f=P;try{return T()}finally{f=U}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(T,P){switch(T){case 1:case 2:case 3:case 4:case 5:break;default:T=3}var U=f;f=T;try{return P()}finally{f=U}},e.unstable_scheduleCallback=function(T,P,U){var H=e.unstable_now();switch(typeof U=="object"&&U!==null?(U=U.delay,U=typeof U=="number"&&0<U?H+U:H):U=H,T){case 1:var j=-1;break;case 2:j=250;break;case 5:j=1073741823;break;case 4:j=1e4;break;default:j=5e3}return j=U+j,T={id:c++,callback:P,priorityLevel:T,startTime:U,expirationTime:j,sortIndex:-1},U>H?(T.sortIndex=U,t(u,T),n(l)===null&&T===n(u)&&(v?(p(L),L=-1):v=!0,A(_,U-H))):(T.sortIndex=j,t(l,T),m||h||(m=!0,D(w))),T},e.unstable_shouldYield=V,e.unstable_wrapCallback=function(T){var P=f;return function(){var U=f;f=P;try{return T.apply(this,arguments)}finally{f=U}}}})(Cf),function(e){e.exports=Cf}(OE);/**
29
+ */(function(e){function t(T,P){var U=T.length;T.push(P);e:for(;0<U;){var H=U-1>>>1,j=T[H];if(0<o(j,P))T[H]=P,T[U]=j,U=H;else break e}}function n(T){return T.length===0?null:T[0]}function r(T){if(T.length===0)return null;var P=T[0],U=T.pop();if(U!==P){T[0]=U;e:for(var H=0,j=T.length,K=j>>>1;H<K;){var W=2*(H+1)-1,Z=T[W],X=W+1,te=T[X];if(0>o(Z,U))X<j&&0>o(te,Z)?(T[H]=te,T[X]=U,H=X):(T[H]=Z,T[W]=U,H=W);else if(X<j&&0>o(te,U))T[H]=te,T[X]=U,H=X;else break e}}return P}function o(T,P){var U=T.sortIndex-P.sortIndex;return U!==0?U:T.id-P.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var s=Date,a=s.now();e.unstable_now=function(){return s.now()-a}}var l=[],u=[],c=1,d=null,f=3,h=!1,m=!1,v=!1,y=typeof setTimeout=="function"?setTimeout:null,p=typeof clearTimeout=="function"?clearTimeout:null,g=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function S(T){for(var P=n(u);P!==null;){if(P.callback===null)r(u);else if(P.startTime<=T)r(u),P.sortIndex=P.expirationTime,t(l,P);else break;P=n(u)}}function _(T){if(v=!1,S(T),!m)if(n(l)!==null)m=!0,D(w);else{var P=n(u);P!==null&&A(_,P.startTime-T)}}function w(T,P){m=!1,v&&(v=!1,p(L),L=-1),h=!0;var U=f;try{for(S(P),d=n(l);d!==null&&(!(d.expirationTime>P)||T&&!V());){var H=d.callback;if(typeof H=="function"){d.callback=null,f=d.priorityLevel;var j=H(d.expirationTime<=P);P=e.unstable_now(),typeof j=="function"?d.callback=j:d===n(l)&&r(l),S(P)}else r(l);d=n(l)}if(d!==null)var K=!0;else{var W=n(u);W!==null&&A(_,W.startTime-P),K=!1}return K}finally{d=null,f=U,h=!1}}var R=!1,C=null,L=-1,B=5,I=-1;function V(){return!(e.unstable_now()-I<B)}function $(){if(C!==null){var T=e.unstable_now();I=T;var P=!0;try{P=C(!0,T)}finally{P?F():(R=!1,C=null)}}else R=!1}var F;if(typeof g=="function")F=function(){g($)};else if(typeof MessageChannel<"u"){var O=new MessageChannel,M=O.port2;O.port1.onmessage=$,F=function(){M.postMessage(null)}}else F=function(){y($,0)};function D(T){C=T,R||(R=!0,F())}function A(T,P){L=y(function(){T(e.unstable_now())},P)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(T){T.callback=null},e.unstable_continueExecution=function(){m||h||(m=!0,D(w))},e.unstable_forceFrameRate=function(T){0>T||125<T?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):B=0<T?Math.floor(1e3/T):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(l)},e.unstable_next=function(T){switch(f){case 1:case 2:case 3:var P=3;break;default:P=f}var U=f;f=P;try{return T()}finally{f=U}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(T,P){switch(T){case 1:case 2:case 3:case 4:case 5:break;default:T=3}var U=f;f=T;try{return P()}finally{f=U}},e.unstable_scheduleCallback=function(T,P,U){var H=e.unstable_now();switch(typeof U=="object"&&U!==null?(U=U.delay,U=typeof U=="number"&&0<U?H+U:H):U=H,T){case 1:var j=-1;break;case 2:j=250;break;case 5:j=1073741823;break;case 4:j=1e4;break;default:j=5e3}return j=U+j,T={id:c++,callback:P,priorityLevel:T,startTime:U,expirationTime:j,sortIndex:-1},U>H?(T.sortIndex=U,t(u,T),n(l)===null&&T===n(u)&&(v?(p(L),L=-1):v=!0,A(_,U-H))):(T.sortIndex=j,t(l,T),m||h||(m=!0,D(w))),T},e.unstable_shouldYield=V,e.unstable_wrapCallback=function(T){var P=f;return function(){var U=f;f=P;try{return T.apply(this,arguments)}finally{f=U}}}})(Tf),function(e){e.exports=Tf}(OE);/**
30
30
  * @license React
31
31
  * react-dom.production.min.js
32
32
  *
@@ -34,14 +34,14 @@ function Uo(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&
34
34
  *
35
35
  * This source code is licensed under the MIT license found in the
36
36
  * LICENSE file in the root directory of this source tree.
37
- */var If=N,ot=xl;function z(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var bf=new Set,Bo={};function tr(e,t){Fr(e,t),Fr(e+"Capture",t)}function Fr(e,t){for(Bo[e]=t,e=0;e<t.length;e++)bf.add(t[e])}var en=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Tl=Object.prototype.hasOwnProperty,xE=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,Af={},Lf={};function TE(e){return Tl.call(Lf,e)?!0:Tl.call(Af,e)?!1:xE.test(e)?Lf[e]=!0:(Af[e]=!0,!1)}function CE(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function IE(e,t,n,r){if(t===null||typeof t>"u"||CE(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Be(e,t,n,r,o,i,s){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=s}var Ae={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Ae[e]=new Be(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Ae[t]=new Be(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){Ae[e]=new Be(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Ae[e]=new Be(e,2,!1,e,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Ae[e]=new Be(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){Ae[e]=new Be(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){Ae[e]=new Be(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){Ae[e]=new Be(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){Ae[e]=new Be(e,5,!1,e.toLowerCase(),null,!1,!1)});var Cl=/[\-:]([a-z])/g;function Il(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Cl,Il);Ae[t]=new Be(t,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Cl,Il);Ae[t]=new Be(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Cl,Il);Ae[t]=new Be(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){Ae[e]=new Be(e,1,!1,e.toLowerCase(),null,!1,!1)}),Ae.xlinkHref=new Be("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){Ae[e]=new Be(e,1,!1,e.toLowerCase(),null,!0,!0)});function bl(e,t,n,r){var o=Ae.hasOwnProperty(t)?Ae[t]:null;(o!==null?o.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(IE(t,n,o,r)&&(n=null),r||o===null?TE(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):o.mustUseProperty?e[o.propertyName]=n===null?o.type===3?!1:"":n:(t=o.attributeName,r=o.attributeNamespace,n===null?e.removeAttribute(t):(o=o.type,n=o===3||o===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var tn=If.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,vs=Symbol.for("react.element"),Vr=Symbol.for("react.portal"),Br=Symbol.for("react.fragment"),Al=Symbol.for("react.strict_mode"),Ll=Symbol.for("react.profiler"),Df=Symbol.for("react.provider"),kf=Symbol.for("react.context"),Dl=Symbol.for("react.forward_ref"),kl=Symbol.for("react.suspense"),Pl=Symbol.for("react.suspense_list"),Ml=Symbol.for("react.memo"),yn=Symbol.for("react.lazy"),Pf=Symbol.for("react.offscreen"),Mf=Symbol.iterator;function $o(e){return e===null||typeof e!="object"?null:(e=Mf&&e[Mf]||e["@@iterator"],typeof e=="function"?e:null)}var fe=Object.assign,Ul;function Ho(e){if(Ul===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Ul=t&&t[1]||""}return`
37
+ */var Cf=N,ot=xl;function z(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var If=new Set,Bo={};function tr(e,t){Fr(e,t),Fr(e+"Capture",t)}function Fr(e,t){for(Bo[e]=t,e=0;e<t.length;e++)If.add(t[e])}var en=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Tl=Object.prototype.hasOwnProperty,xE=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,bf={},Af={};function TE(e){return Tl.call(Af,e)?!0:Tl.call(bf,e)?!1:xE.test(e)?Af[e]=!0:(bf[e]=!0,!1)}function CE(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function IE(e,t,n,r){if(t===null||typeof t>"u"||CE(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Be(e,t,n,r,o,i,s){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=s}var Ae={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Ae[e]=new Be(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Ae[t]=new Be(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){Ae[e]=new Be(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Ae[e]=new Be(e,2,!1,e,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Ae[e]=new Be(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){Ae[e]=new Be(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){Ae[e]=new Be(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){Ae[e]=new Be(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){Ae[e]=new Be(e,5,!1,e.toLowerCase(),null,!1,!1)});var Cl=/[\-:]([a-z])/g;function Il(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Cl,Il);Ae[t]=new Be(t,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Cl,Il);Ae[t]=new Be(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Cl,Il);Ae[t]=new Be(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){Ae[e]=new Be(e,1,!1,e.toLowerCase(),null,!1,!1)}),Ae.xlinkHref=new Be("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){Ae[e]=new Be(e,1,!1,e.toLowerCase(),null,!0,!0)});function bl(e,t,n,r){var o=Ae.hasOwnProperty(t)?Ae[t]:null;(o!==null?o.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(IE(t,n,o,r)&&(n=null),r||o===null?TE(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):o.mustUseProperty?e[o.propertyName]=n===null?o.type===3?!1:"":n:(t=o.attributeName,r=o.attributeNamespace,n===null?e.removeAttribute(t):(o=o.type,n=o===3||o===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var tn=Cf.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,vs=Symbol.for("react.element"),Vr=Symbol.for("react.portal"),Br=Symbol.for("react.fragment"),Al=Symbol.for("react.strict_mode"),Ll=Symbol.for("react.profiler"),Lf=Symbol.for("react.provider"),Df=Symbol.for("react.context"),Dl=Symbol.for("react.forward_ref"),kl=Symbol.for("react.suspense"),Pl=Symbol.for("react.suspense_list"),Ml=Symbol.for("react.memo"),yn=Symbol.for("react.lazy"),kf=Symbol.for("react.offscreen"),Pf=Symbol.iterator;function $o(e){return e===null||typeof e!="object"?null:(e=Pf&&e[Pf]||e["@@iterator"],typeof e=="function"?e:null)}var fe=Object.assign,Ul;function Ho(e){if(Ul===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Ul=t&&t[1]||""}return`
38
38
  `+Ul+e}var Fl=!1;function Vl(e,t){if(!e||Fl)return"";Fl=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(u){var r=u}Reflect.construct(e,[],t)}else{try{t.call()}catch(u){r=u}e.call(t.prototype)}else{try{throw Error()}catch(u){r=u}e()}}catch(u){if(u&&r&&typeof u.stack=="string"){for(var o=u.stack.split(`
39
39
  `),i=r.stack.split(`
40
40
  `),s=o.length-1,a=i.length-1;1<=s&&0<=a&&o[s]!==i[a];)a--;for(;1<=s&&0<=a;s--,a--)if(o[s]!==i[a]){if(s!==1||a!==1)do if(s--,a--,0>a||o[s]!==i[a]){var l=`
41
- `+o[s].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),l}while(1<=s&&0<=a);break}}}finally{Fl=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Ho(e):""}function bE(e){switch(e.tag){case 5:return Ho(e.type);case 16:return Ho("Lazy");case 13:return Ho("Suspense");case 19:return Ho("SuspenseList");case 0:case 2:case 15:return e=Vl(e.type,!1),e;case 11:return e=Vl(e.type.render,!1),e;case 1:return e=Vl(e.type,!0),e;default:return""}}function Bl(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Br:return"Fragment";case Vr:return"Portal";case Ll:return"Profiler";case Al:return"StrictMode";case kl:return"Suspense";case Pl:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case kf:return(e.displayName||"Context")+".Consumer";case Df:return(e._context.displayName||"Context")+".Provider";case Dl:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Ml:return t=e.displayName||null,t!==null?t:Bl(e.type)||"Memo";case yn:t=e._payload,e=e._init;try{return Bl(e(t))}catch{}}return null}function AE(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Bl(t);case 8:return t===Al?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function En(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Uf(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function LE(e){var t=Uf(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var o=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(s){r=""+s,i.call(this,s)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function ys(e){e._valueTracker||(e._valueTracker=LE(e))}function Ff(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Uf(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Es(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function $l(e,t){var n=t.checked;return fe({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Vf(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=En(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Bf(e,t){t=t.checked,t!=null&&bl(e,"checked",t,!1)}function Hl(e,t){Bf(e,t);var n=En(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?zl(e,t.type,n):t.hasOwnProperty("defaultValue")&&zl(e,t.type,En(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function $f(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function zl(e,t,n){(t!=="number"||Es(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var zo=Array.isArray;function $r(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o<n.length;o++)t["$"+n[o]]=!0;for(n=0;n<e.length;n++)o=t.hasOwnProperty("$"+e[n].value),e[n].selected!==o&&(e[n].selected=o),o&&r&&(e[n].defaultSelected=!0)}else{for(n=""+En(n),t=null,o=0;o<e.length;o++){if(e[o].value===n){e[o].selected=!0,r&&(e[o].defaultSelected=!0);return}t!==null||e[o].disabled||(t=e[o])}t!==null&&(t.selected=!0)}}function jl(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(z(91));return fe({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Hf(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(z(92));if(zo(n)){if(1<n.length)throw Error(z(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:En(n)}}function zf(e,t){var n=En(t.value),r=En(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function jf(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Gf(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Gl(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Gf(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Ss,Yf=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,o){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,o)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Ss=Ss||document.createElement("div"),Ss.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Ss.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function jo(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Go={animationIterationCount:!0,aspectRatio:!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,gridArea:!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},DE=["Webkit","ms","Moz","O"];Object.keys(Go).forEach(function(e){DE.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Go[t]=Go[e]})});function Wf(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Go.hasOwnProperty(e)&&Go[e]?(""+t).trim():t+"px"}function Kf(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=Wf(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var kE=fe({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Yl(e,t){if(t){if(kE[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(z(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(z(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(z(61))}if(t.style!=null&&typeof t.style!="object")throw Error(z(62))}}function Wl(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Kl=null;function Ql(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Xl=null,Hr=null,zr=null;function Qf(e){if(e=pi(e)){if(typeof Xl!="function")throw Error(z(280));var t=e.stateNode;t&&(t=zs(t),Xl(e.stateNode,e.type,t))}}function Xf(e){Hr?zr?zr.push(e):zr=[e]:Hr=e}function qf(){if(Hr){var e=Hr,t=zr;if(zr=Hr=null,Qf(e),t)for(e=0;e<t.length;e++)Qf(t[e])}}function Zf(e,t){return e(t)}function Jf(){}var ql=!1;function ep(e,t,n){if(ql)return e(t,n);ql=!0;try{return Zf(e,t,n)}finally{ql=!1,(Hr!==null||zr!==null)&&(Jf(),qf())}}function Yo(e,t){var n=e.stateNode;if(n===null)return null;var r=zs(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(z(231,t,typeof n));return n}var Zl=!1;if(en)try{var Wo={};Object.defineProperty(Wo,"passive",{get:function(){Zl=!0}}),window.addEventListener("test",Wo,Wo),window.removeEventListener("test",Wo,Wo)}catch{Zl=!1}function PE(e,t,n,r,o,i,s,a,l){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(c){this.onError(c)}}var Ko=!1,_s=null,ws=!1,Jl=null,ME={onError:function(e){Ko=!0,_s=e}};function UE(e,t,n,r,o,i,s,a,l){Ko=!1,_s=null,PE.apply(ME,arguments)}function FE(e,t,n,r,o,i,s,a,l){if(UE.apply(this,arguments),Ko){if(Ko){var u=_s;Ko=!1,_s=null}else throw Error(z(198));ws||(ws=!0,Jl=u)}}function nr(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function tp(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function np(e){if(nr(e)!==e)throw Error(z(188))}function VE(e){var t=e.alternate;if(!t){if(t=nr(e),t===null)throw Error(z(188));return t!==e?null:e}for(var n=e,r=t;;){var o=n.return;if(o===null)break;var i=o.alternate;if(i===null){if(r=o.return,r!==null){n=r;continue}break}if(o.child===i.child){for(i=o.child;i;){if(i===n)return np(o),e;if(i===r)return np(o),t;i=i.sibling}throw Error(z(188))}if(n.return!==r.return)n=o,r=i;else{for(var s=!1,a=o.child;a;){if(a===n){s=!0,n=o,r=i;break}if(a===r){s=!0,r=o,n=i;break}a=a.sibling}if(!s){for(a=i.child;a;){if(a===n){s=!0,n=i,r=o;break}if(a===r){s=!0,r=i,n=o;break}a=a.sibling}if(!s)throw Error(z(189))}}if(n.alternate!==r)throw Error(z(190))}if(n.tag!==3)throw Error(z(188));return n.stateNode.current===n?e:t}function rp(e){return e=VE(e),e!==null?op(e):null}function op(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=op(e);if(t!==null)return t;e=e.sibling}return null}var ip=ot.unstable_scheduleCallback,sp=ot.unstable_cancelCallback,BE=ot.unstable_shouldYield,$E=ot.unstable_requestPaint,Ee=ot.unstable_now,HE=ot.unstable_getCurrentPriorityLevel,eu=ot.unstable_ImmediatePriority,ap=ot.unstable_UserBlockingPriority,Rs=ot.unstable_NormalPriority,zE=ot.unstable_LowPriority,lp=ot.unstable_IdlePriority,Ns=null,Vt=null;function jE(e){if(Vt&&typeof Vt.onCommitFiberRoot=="function")try{Vt.onCommitFiberRoot(Ns,e,void 0,(e.current.flags&128)===128)}catch{}}var Nt=Math.clz32?Math.clz32:WE,GE=Math.log,YE=Math.LN2;function WE(e){return e>>>=0,e===0?32:31-(GE(e)/YE|0)|0}var Os=64,xs=4194304;function Qo(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Ts(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,o=e.suspendedLanes,i=e.pingedLanes,s=n&268435455;if(s!==0){var a=s&~o;a!==0?r=Qo(a):(i&=s,i!==0&&(r=Qo(i)))}else s=n&~o,s!==0?r=Qo(s):i!==0&&(r=Qo(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&o)&&(o=r&-r,i=t&-t,o>=i||o===16&&(i&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-Nt(t),o=1<<n,r|=e[n],t&=~o;return r}function KE(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function QE(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,o=e.expirationTimes,i=e.pendingLanes;0<i;){var s=31-Nt(i),a=1<<s,l=o[s];l===-1?(!(a&n)||a&r)&&(o[s]=KE(a,t)):l<=t&&(e.expiredLanes|=a),i&=~a}}function tu(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function up(){var e=Os;return Os<<=1,!(Os&4194240)&&(Os=64),e}function nu(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Xo(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Nt(t),e[t]=n}function XE(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var o=31-Nt(n),i=1<<o;t[o]=0,r[o]=-1,e[o]=-1,n&=~i}}function ru(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Nt(n),o=1<<r;o&t|e[r]&t&&(e[r]|=t),n&=~o}}var re=0;function cp(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var dp,ou,fp,pp,hp,iu=!1,Cs=[],Sn=null,_n=null,wn=null,qo=new Map,Zo=new Map,Rn=[],qE="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function gp(e,t){switch(e){case"focusin":case"focusout":Sn=null;break;case"dragenter":case"dragleave":_n=null;break;case"mouseover":case"mouseout":wn=null;break;case"pointerover":case"pointerout":qo.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Zo.delete(t.pointerId)}}function Jo(e,t,n,r,o,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:i,targetContainers:[o]},t!==null&&(t=pi(t),t!==null&&ou(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function ZE(e,t,n,r,o){switch(t){case"focusin":return Sn=Jo(Sn,e,t,n,r,o),!0;case"dragenter":return _n=Jo(_n,e,t,n,r,o),!0;case"mouseover":return wn=Jo(wn,e,t,n,r,o),!0;case"pointerover":var i=o.pointerId;return qo.set(i,Jo(qo.get(i)||null,e,t,n,r,o)),!0;case"gotpointercapture":return i=o.pointerId,Zo.set(i,Jo(Zo.get(i)||null,e,t,n,r,o)),!0}return!1}function mp(e){var t=rr(e.target);if(t!==null){var n=nr(t);if(n!==null){if(t=n.tag,t===13){if(t=tp(n),t!==null){e.blockedOn=t,hp(e.priority,function(){fp(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Is(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=au(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Kl=r,n.target.dispatchEvent(r),Kl=null}else return t=pi(n),t!==null&&ou(t),e.blockedOn=n,!1;t.shift()}return!0}function vp(e,t,n){Is(e)&&n.delete(t)}function JE(){iu=!1,Sn!==null&&Is(Sn)&&(Sn=null),_n!==null&&Is(_n)&&(_n=null),wn!==null&&Is(wn)&&(wn=null),qo.forEach(vp),Zo.forEach(vp)}function ei(e,t){e.blockedOn===t&&(e.blockedOn=null,iu||(iu=!0,ot.unstable_scheduleCallback(ot.unstable_NormalPriority,JE)))}function ti(e){function t(o){return ei(o,e)}if(0<Cs.length){ei(Cs[0],e);for(var n=1;n<Cs.length;n++){var r=Cs[n];r.blockedOn===e&&(r.blockedOn=null)}}for(Sn!==null&&ei(Sn,e),_n!==null&&ei(_n,e),wn!==null&&ei(wn,e),qo.forEach(t),Zo.forEach(t),n=0;n<Rn.length;n++)r=Rn[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<Rn.length&&(n=Rn[0],n.blockedOn===null);)mp(n),n.blockedOn===null&&Rn.shift()}var jr=tn.ReactCurrentBatchConfig,bs=!0;function eS(e,t,n,r){var o=re,i=jr.transition;jr.transition=null;try{re=1,su(e,t,n,r)}finally{re=o,jr.transition=i}}function tS(e,t,n,r){var o=re,i=jr.transition;jr.transition=null;try{re=4,su(e,t,n,r)}finally{re=o,jr.transition=i}}function su(e,t,n,r){if(bs){var o=au(e,t,n,r);if(o===null)Nu(e,t,r,As,n),gp(e,r);else if(ZE(o,e,t,n,r))r.stopPropagation();else if(gp(e,r),t&4&&-1<qE.indexOf(e)){for(;o!==null;){var i=pi(o);if(i!==null&&dp(i),i=au(e,t,n,r),i===null&&Nu(e,t,r,As,n),i===o)break;o=i}o!==null&&r.stopPropagation()}else Nu(e,t,r,null,n)}}var As=null;function au(e,t,n,r){if(As=null,e=Ql(r),e=rr(e),e!==null)if(t=nr(e),t===null)e=null;else if(n=t.tag,n===13){if(e=tp(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return As=e,null}function yp(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(HE()){case eu:return 1;case ap:return 4;case Rs:case zE:return 16;case lp:return 536870912;default:return 16}default:return 16}}var Nn=null,lu=null,Ls=null;function Ep(){if(Ls)return Ls;var e,t=lu,n=t.length,r,o="value"in Nn?Nn.value:Nn.textContent,i=o.length;for(e=0;e<n&&t[e]===o[e];e++);var s=n-e;for(r=1;r<=s&&t[n-r]===o[i-r];r++);return Ls=o.slice(e,1<r?1-r:void 0)}function Ds(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function ks(){return!0}function Sp(){return!1}function it(e){function t(n,r,o,i,s){this._reactName=n,this._targetInst=o,this.type=r,this.nativeEvent=i,this.target=s,this.currentTarget=null;for(var a in e)e.hasOwnProperty(a)&&(n=e[a],this[a]=n?n(i):i[a]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?ks:Sp,this.isPropagationStopped=Sp,this}return fe(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=ks)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=ks)},persist:function(){},isPersistent:ks}),t}var Gr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},uu=it(Gr),ni=fe({},Gr,{view:0,detail:0}),nS=it(ni),cu,du,ri,Ps=fe({},ni,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:pu,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==ri&&(ri&&e.type==="mousemove"?(cu=e.screenX-ri.screenX,du=e.screenY-ri.screenY):du=cu=0,ri=e),cu)},movementY:function(e){return"movementY"in e?e.movementY:du}}),_p=it(Ps),rS=fe({},Ps,{dataTransfer:0}),oS=it(rS),iS=fe({},ni,{relatedTarget:0}),fu=it(iS),sS=fe({},Gr,{animationName:0,elapsedTime:0,pseudoElement:0}),aS=it(sS),lS=fe({},Gr,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),uS=it(lS),cS=fe({},Gr,{data:0}),wp=it(cS),dS={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},fS={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},pS={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function hS(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=pS[e])?!!t[e]:!1}function pu(){return hS}var gS=fe({},ni,{key:function(e){if(e.key){var t=dS[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Ds(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?fS[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:pu,charCode:function(e){return e.type==="keypress"?Ds(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Ds(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),mS=it(gS),vS=fe({},Ps,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Rp=it(vS),yS=fe({},ni,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:pu}),ES=it(yS),SS=fe({},Gr,{propertyName:0,elapsedTime:0,pseudoElement:0}),_S=it(SS),wS=fe({},Ps,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),RS=it(wS),NS=[9,13,27,32],hu=en&&"CompositionEvent"in window,oi=null;en&&"documentMode"in document&&(oi=document.documentMode);var OS=en&&"TextEvent"in window&&!oi,Np=en&&(!hu||oi&&8<oi&&11>=oi),Op=String.fromCharCode(32),xp=!1;function Tp(e,t){switch(e){case"keyup":return NS.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Cp(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Yr=!1;function xS(e,t){switch(e){case"compositionend":return Cp(t);case"keypress":return t.which!==32?null:(xp=!0,Op);case"textInput":return e=t.data,e===Op&&xp?null:e;default:return null}}function TS(e,t){if(Yr)return e==="compositionend"||!hu&&Tp(e,t)?(e=Ep(),Ls=lu=Nn=null,Yr=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Np&&t.locale!=="ko"?null:t.data;default:return null}}var CS={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Ip(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!CS[e.type]:t==="textarea"}function bp(e,t,n,r){Xf(r),t=Bs(t,"onChange"),0<t.length&&(n=new uu("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var ii=null,si=null;function IS(e){Kp(e,0)}function Ms(e){var t=qr(e);if(Ff(t))return e}function bS(e,t){if(e==="change")return t}var Ap=!1;if(en){var gu;if(en){var mu="oninput"in document;if(!mu){var Lp=document.createElement("div");Lp.setAttribute("oninput","return;"),mu=typeof Lp.oninput=="function"}gu=mu}else gu=!1;Ap=gu&&(!document.documentMode||9<document.documentMode)}function Dp(){ii&&(ii.detachEvent("onpropertychange",kp),si=ii=null)}function kp(e){if(e.propertyName==="value"&&Ms(si)){var t=[];bp(t,si,e,Ql(e)),ep(IS,t)}}function AS(e,t,n){e==="focusin"?(Dp(),ii=t,si=n,ii.attachEvent("onpropertychange",kp)):e==="focusout"&&Dp()}function LS(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ms(si)}function DS(e,t){if(e==="click")return Ms(t)}function kS(e,t){if(e==="input"||e==="change")return Ms(t)}function PS(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Ot=typeof Object.is=="function"?Object.is:PS;function ai(e,t){if(Ot(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var o=n[r];if(!Tl.call(t,o)||!Ot(e[o],t[o]))return!1}return!0}function Pp(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Mp(e,t){var n=Pp(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Pp(n)}}function Up(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Up(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Fp(){for(var e=window,t=Es();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Es(e.document)}return t}function vu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function MS(e){var t=Fp(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Up(n.ownerDocument.documentElement,n)){if(r!==null&&vu(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var o=n.textContent.length,i=Math.min(r.start,o);r=r.end===void 0?i:Math.min(r.end,o),!e.extend&&i>r&&(o=r,r=i,i=o),o=Mp(n,i);var s=Mp(n,r);o&&s&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var US=en&&"documentMode"in document&&11>=document.documentMode,Wr=null,yu=null,li=null,Eu=!1;function Vp(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Eu||Wr==null||Wr!==Es(r)||(r=Wr,"selectionStart"in r&&vu(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),li&&ai(li,r)||(li=r,r=Bs(yu,"onSelect"),0<r.length&&(t=new uu("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Wr)))}function Us(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Kr={animationend:Us("Animation","AnimationEnd"),animationiteration:Us("Animation","AnimationIteration"),animationstart:Us("Animation","AnimationStart"),transitionend:Us("Transition","TransitionEnd")},Su={},Bp={};en&&(Bp=document.createElement("div").style,"AnimationEvent"in window||(delete Kr.animationend.animation,delete Kr.animationiteration.animation,delete Kr.animationstart.animation),"TransitionEvent"in window||delete Kr.transitionend.transition);function Fs(e){if(Su[e])return Su[e];if(!Kr[e])return e;var t=Kr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Bp)return Su[e]=t[n];return e}var $p=Fs("animationend"),Hp=Fs("animationiteration"),zp=Fs("animationstart"),jp=Fs("transitionend"),Gp=new Map,Yp="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function On(e,t){Gp.set(e,t),tr(t,[e])}for(var _u=0;_u<Yp.length;_u++){var wu=Yp[_u],FS=wu.toLowerCase(),VS=wu[0].toUpperCase()+wu.slice(1);On(FS,"on"+VS)}On($p,"onAnimationEnd"),On(Hp,"onAnimationIteration"),On(zp,"onAnimationStart"),On("dblclick","onDoubleClick"),On("focusin","onFocus"),On("focusout","onBlur"),On(jp,"onTransitionEnd"),Fr("onMouseEnter",["mouseout","mouseover"]),Fr("onMouseLeave",["mouseout","mouseover"]),Fr("onPointerEnter",["pointerout","pointerover"]),Fr("onPointerLeave",["pointerout","pointerover"]),tr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),tr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),tr("onBeforeInput",["compositionend","keypress","textInput","paste"]),tr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),tr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),tr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ui="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),BS=new Set("cancel close invalid load scroll toggle".split(" ").concat(ui));function Wp(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,FE(r,t,void 0,e),e.currentTarget=null}function Kp(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],o=r.event;r=r.listeners;e:{var i=void 0;if(t)for(var s=r.length-1;0<=s;s--){var a=r[s],l=a.instance,u=a.currentTarget;if(a=a.listener,l!==i&&o.isPropagationStopped())break e;Wp(o,a,u),i=l}else for(s=0;s<r.length;s++){if(a=r[s],l=a.instance,u=a.currentTarget,a=a.listener,l!==i&&o.isPropagationStopped())break e;Wp(o,a,u),i=l}}}if(ws)throw e=Jl,ws=!1,Jl=null,e}function se(e,t){var n=t[bu];n===void 0&&(n=t[bu]=new Set);var r=e+"__bubble";n.has(r)||(Qp(t,e,2,!1),n.add(r))}function Ru(e,t,n){var r=0;t&&(r|=4),Qp(n,e,r,t)}var Vs="_reactListening"+Math.random().toString(36).slice(2);function ci(e){if(!e[Vs]){e[Vs]=!0,bf.forEach(function(n){n!=="selectionchange"&&(BS.has(n)||Ru(n,!1,e),Ru(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Vs]||(t[Vs]=!0,Ru("selectionchange",!1,t))}}function Qp(e,t,n,r){switch(yp(t)){case 1:var o=eS;break;case 4:o=tS;break;default:o=su}n=o.bind(null,t,n,e),o=void 0,!Zl||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(o=!0),r?o!==void 0?e.addEventListener(t,n,{capture:!0,passive:o}):e.addEventListener(t,n,!0):o!==void 0?e.addEventListener(t,n,{passive:o}):e.addEventListener(t,n,!1)}function Nu(e,t,n,r,o){var i=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var a=r.stateNode.containerInfo;if(a===o||a.nodeType===8&&a.parentNode===o)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&(l=s.stateNode.containerInfo,l===o||l.nodeType===8&&l.parentNode===o))return;s=s.return}for(;a!==null;){if(s=rr(a),s===null)return;if(l=s.tag,l===5||l===6){r=i=s;continue e}a=a.parentNode}}r=r.return}ep(function(){var u=i,c=Ql(n),d=[];e:{var f=Gp.get(e);if(f!==void 0){var h=uu,m=e;switch(e){case"keypress":if(Ds(n)===0)break e;case"keydown":case"keyup":h=mS;break;case"focusin":m="focus",h=fu;break;case"focusout":m="blur",h=fu;break;case"beforeblur":case"afterblur":h=fu;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":h=_p;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":h=oS;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":h=ES;break;case $p:case Hp:case zp:h=aS;break;case jp:h=_S;break;case"scroll":h=nS;break;case"wheel":h=RS;break;case"copy":case"cut":case"paste":h=uS;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":h=Rp}var v=(t&4)!==0,y=!v&&e==="scroll",p=v?f!==null?f+"Capture":null:f;v=[];for(var g=u,S;g!==null;){S=g;var _=S.stateNode;if(S.tag===5&&_!==null&&(S=_,p!==null&&(_=Yo(g,p),_!=null&&v.push(di(g,_,S)))),y)break;g=g.return}0<v.length&&(f=new h(f,m,null,n,c),d.push({event:f,listeners:v}))}}if(!(t&7)){e:{if(f=e==="mouseover"||e==="pointerover",h=e==="mouseout"||e==="pointerout",f&&n!==Kl&&(m=n.relatedTarget||n.fromElement)&&(rr(m)||m[nn]))break e;if((h||f)&&(f=c.window===c?c:(f=c.ownerDocument)?f.defaultView||f.parentWindow:window,h?(m=n.relatedTarget||n.toElement,h=u,m=m?rr(m):null,m!==null&&(y=nr(m),m!==y||m.tag!==5&&m.tag!==6)&&(m=null)):(h=null,m=u),h!==m)){if(v=_p,_="onMouseLeave",p="onMouseEnter",g="mouse",(e==="pointerout"||e==="pointerover")&&(v=Rp,_="onPointerLeave",p="onPointerEnter",g="pointer"),y=h==null?f:qr(h),S=m==null?f:qr(m),f=new v(_,g+"leave",h,n,c),f.target=y,f.relatedTarget=S,_=null,rr(c)===u&&(v=new v(p,g+"enter",m,n,c),v.target=S,v.relatedTarget=y,_=v),y=_,h&&m)t:{for(v=h,p=m,g=0,S=v;S;S=Qr(S))g++;for(S=0,_=p;_;_=Qr(_))S++;for(;0<g-S;)v=Qr(v),g--;for(;0<S-g;)p=Qr(p),S--;for(;g--;){if(v===p||p!==null&&v===p.alternate)break t;v=Qr(v),p=Qr(p)}v=null}else v=null;h!==null&&Xp(d,f,h,v,!1),m!==null&&y!==null&&Xp(d,y,m,v,!0)}}e:{if(f=u?qr(u):window,h=f.nodeName&&f.nodeName.toLowerCase(),h==="select"||h==="input"&&f.type==="file")var w=bS;else if(Ip(f))if(Ap)w=kS;else{w=LS;var R=AS}else(h=f.nodeName)&&h.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(w=DS);if(w&&(w=w(e,u))){bp(d,w,n,c);break e}R&&R(e,f,u),e==="focusout"&&(R=f._wrapperState)&&R.controlled&&f.type==="number"&&zl(f,"number",f.value)}switch(R=u?qr(u):window,e){case"focusin":(Ip(R)||R.contentEditable==="true")&&(Wr=R,yu=u,li=null);break;case"focusout":li=yu=Wr=null;break;case"mousedown":Eu=!0;break;case"contextmenu":case"mouseup":case"dragend":Eu=!1,Vp(d,n,c);break;case"selectionchange":if(US)break;case"keydown":case"keyup":Vp(d,n,c)}var C;if(hu)e:{switch(e){case"compositionstart":var L="onCompositionStart";break e;case"compositionend":L="onCompositionEnd";break e;case"compositionupdate":L="onCompositionUpdate";break e}L=void 0}else Yr?Tp(e,n)&&(L="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(L="onCompositionStart");L&&(Np&&n.locale!=="ko"&&(Yr||L!=="onCompositionStart"?L==="onCompositionEnd"&&Yr&&(C=Ep()):(Nn=c,lu="value"in Nn?Nn.value:Nn.textContent,Yr=!0)),R=Bs(u,L),0<R.length&&(L=new wp(L,e,null,n,c),d.push({event:L,listeners:R}),C?L.data=C:(C=Cp(n),C!==null&&(L.data=C)))),(C=OS?xS(e,n):TS(e,n))&&(u=Bs(u,"onBeforeInput"),0<u.length&&(c=new wp("onBeforeInput","beforeinput",null,n,c),d.push({event:c,listeners:u}),c.data=C))}Kp(d,t)})}function di(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Bs(e,t){for(var n=t+"Capture",r=[];e!==null;){var o=e,i=o.stateNode;o.tag===5&&i!==null&&(o=i,i=Yo(e,n),i!=null&&r.unshift(di(e,i,o)),i=Yo(e,t),i!=null&&r.push(di(e,i,o))),e=e.return}return r}function Qr(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Xp(e,t,n,r,o){for(var i=t._reactName,s=[];n!==null&&n!==r;){var a=n,l=a.alternate,u=a.stateNode;if(l!==null&&l===r)break;a.tag===5&&u!==null&&(a=u,o?(l=Yo(n,i),l!=null&&s.unshift(di(n,l,a))):o||(l=Yo(n,i),l!=null&&s.push(di(n,l,a)))),n=n.return}s.length!==0&&e.push({event:t,listeners:s})}var $S=/\r\n?/g,HS=/\u0000|\uFFFD/g;function qp(e){return(typeof e=="string"?e:""+e).replace($S,`
42
- `).replace(HS,"")}function $s(e,t,n){if(t=qp(t),qp(e)!==t&&n)throw Error(z(425))}function Hs(){}var Ou=null,xu=null;function Tu(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Cu=typeof setTimeout=="function"?setTimeout:void 0,zS=typeof clearTimeout=="function"?clearTimeout:void 0,Zp=typeof Promise=="function"?Promise:void 0,jS=typeof queueMicrotask=="function"?queueMicrotask:typeof Zp<"u"?function(e){return Zp.resolve(null).then(e).catch(GS)}:Cu;function GS(e){setTimeout(function(){throw e})}function Iu(e,t){var n=t,r=0;do{var o=n.nextSibling;if(e.removeChild(n),o&&o.nodeType===8)if(n=o.data,n==="/$"){if(r===0){e.removeChild(o),ti(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=o}while(n);ti(t)}function xn(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function Jp(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var Xr=Math.random().toString(36).slice(2),Bt="__reactFiber$"+Xr,fi="__reactProps$"+Xr,nn="__reactContainer$"+Xr,bu="__reactEvents$"+Xr,YS="__reactListeners$"+Xr,WS="__reactHandles$"+Xr;function rr(e){var t=e[Bt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[nn]||n[Bt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Jp(e);e!==null;){if(n=e[Bt])return n;e=Jp(e)}return t}e=n,n=e.parentNode}return null}function pi(e){return e=e[Bt]||e[nn],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function qr(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(z(33))}function zs(e){return e[fi]||null}var Au=[],Zr=-1;function Tn(e){return{current:e}}function ae(e){0>Zr||(e.current=Au[Zr],Au[Zr]=null,Zr--)}function ie(e,t){Zr++,Au[Zr]=e.current,e.current=t}var Cn={},ke=Tn(Cn),We=Tn(!1),or=Cn;function Jr(e,t){var n=e.type.contextTypes;if(!n)return Cn;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={},i;for(i in n)o[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function Ke(e){return e=e.childContextTypes,e!=null}function js(){ae(We),ae(ke)}function eh(e,t,n){if(ke.current!==Cn)throw Error(z(168));ie(ke,t),ie(We,n)}function th(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var o in r)if(!(o in t))throw Error(z(108,AE(e)||"Unknown",o));return fe({},n,r)}function Gs(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Cn,or=ke.current,ie(ke,e),ie(We,We.current),!0}function nh(e,t,n){var r=e.stateNode;if(!r)throw Error(z(169));n?(e=th(e,t,or),r.__reactInternalMemoizedMergedChildContext=e,ae(We),ae(ke),ie(ke,e)):ae(We),ie(We,n)}var rn=null,Ys=!1,Lu=!1;function rh(e){rn===null?rn=[e]:rn.push(e)}function KS(e){Ys=!0,rh(e)}function In(){if(!Lu&&rn!==null){Lu=!0;var e=0,t=re;try{var n=rn;for(re=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}rn=null,Ys=!1}catch(o){throw rn!==null&&(rn=rn.slice(e+1)),ip(eu,In),o}finally{re=t,Lu=!1}}return null}var eo=[],to=0,Ws=null,Ks=0,ht=[],gt=0,ir=null,on=1,sn="";function sr(e,t){eo[to++]=Ks,eo[to++]=Ws,Ws=e,Ks=t}function oh(e,t,n){ht[gt++]=on,ht[gt++]=sn,ht[gt++]=ir,ir=e;var r=on;e=sn;var o=32-Nt(r)-1;r&=~(1<<o),n+=1;var i=32-Nt(t)+o;if(30<i){var s=o-o%5;i=(r&(1<<s)-1).toString(32),r>>=s,o-=s,on=1<<32-Nt(t)+o|n<<o|r,sn=i+e}else on=1<<i|n<<o|r,sn=e}function Du(e){e.return!==null&&(sr(e,1),oh(e,1,0))}function ku(e){for(;e===Ws;)Ws=eo[--to],eo[to]=null,Ks=eo[--to],eo[to]=null;for(;e===ir;)ir=ht[--gt],ht[gt]=null,sn=ht[--gt],ht[gt]=null,on=ht[--gt],ht[gt]=null}var st=null,at=null,ce=!1,xt=null;function ih(e,t){var n=Et(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function sh(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,st=e,at=xn(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,st=e,at=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=ir!==null?{id:on,overflow:sn}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Et(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,st=e,at=null,!0):!1;default:return!1}}function Pu(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Mu(e){if(ce){var t=at;if(t){var n=t;if(!sh(e,t)){if(Pu(e))throw Error(z(418));t=xn(n.nextSibling);var r=st;t&&sh(e,t)?ih(r,n):(e.flags=e.flags&-4097|2,ce=!1,st=e)}}else{if(Pu(e))throw Error(z(418));e.flags=e.flags&-4097|2,ce=!1,st=e}}}function ah(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;st=e}function Qs(e){if(e!==st)return!1;if(!ce)return ah(e),ce=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Tu(e.type,e.memoizedProps)),t&&(t=at)){if(Pu(e))throw lh(),Error(z(418));for(;t;)ih(e,t),t=xn(t.nextSibling)}if(ah(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(z(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){at=xn(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}at=null}}else at=st?xn(e.stateNode.nextSibling):null;return!0}function lh(){for(var e=at;e;)e=xn(e.nextSibling)}function no(){at=st=null,ce=!1}function Uu(e){xt===null?xt=[e]:xt.push(e)}var QS=tn.ReactCurrentBatchConfig;function Tt(e,t){if(e&&e.defaultProps){t=fe({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}var Xs=Tn(null),qs=null,ro=null,Fu=null;function Vu(){Fu=ro=qs=null}function Bu(e){var t=Xs.current;ae(Xs),e._currentValue=t}function $u(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function oo(e,t){qs=e,Fu=ro=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Qe=!0),e.firstContext=null)}function mt(e){var t=e._currentValue;if(Fu!==e)if(e={context:e,memoizedValue:t,next:null},ro===null){if(qs===null)throw Error(z(308));ro=e,qs.dependencies={lanes:0,firstContext:e}}else ro=ro.next=e;return t}var ar=null;function Hu(e){ar===null?ar=[e]:ar.push(e)}function uh(e,t,n,r){var o=t.interleaved;return o===null?(n.next=n,Hu(t)):(n.next=o.next,o.next=n),t.interleaved=n,an(e,r)}function an(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var bn=!1;function zu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function ch(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function ln(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function An(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,ne&2){var o=r.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),r.pending=t,an(e,n)}return o=r.interleaved,o===null?(t.next=t,Hu(r)):(t.next=o.next,o.next=t),r.interleaved=t,an(e,n)}function Zs(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ru(e,n)}}function dh(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var o=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var s={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?o=i=s:i=i.next=s,n=n.next}while(n!==null);i===null?o=i=t:i=i.next=t}else o=i=t;n={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:i,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Js(e,t,n,r){var o=e.updateQueue;bn=!1;var i=o.firstBaseUpdate,s=o.lastBaseUpdate,a=o.shared.pending;if(a!==null){o.shared.pending=null;var l=a,u=l.next;l.next=null,s===null?i=u:s.next=u,s=l;var c=e.alternate;c!==null&&(c=c.updateQueue,a=c.lastBaseUpdate,a!==s&&(a===null?c.firstBaseUpdate=u:a.next=u,c.lastBaseUpdate=l))}if(i!==null){var d=o.baseState;s=0,c=u=l=null,a=i;do{var f=a.lane,h=a.eventTime;if((r&f)===f){c!==null&&(c=c.next={eventTime:h,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var m=e,v=a;switch(f=t,h=n,v.tag){case 1:if(m=v.payload,typeof m=="function"){d=m.call(h,d,f);break e}d=m;break e;case 3:m.flags=m.flags&-65537|128;case 0:if(m=v.payload,f=typeof m=="function"?m.call(h,d,f):m,f==null)break e;d=fe({},d,f);break e;case 2:bn=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,f=o.effects,f===null?o.effects=[a]:f.push(a))}else h={eventTime:h,lane:f,tag:a.tag,payload:a.payload,callback:a.callback,next:null},c===null?(u=c=h,l=d):c=c.next=h,s|=f;if(a=a.next,a===null){if(a=o.shared.pending,a===null)break;f=a,a=f.next,f.next=null,o.lastBaseUpdate=f,o.shared.pending=null}}while(1);if(c===null&&(l=d),o.baseState=l,o.firstBaseUpdate=u,o.lastBaseUpdate=c,t=o.shared.interleaved,t!==null){o=t;do s|=o.lane,o=o.next;while(o!==t)}else i===null&&(o.shared.lanes=0);cr|=s,e.lanes=s,e.memoizedState=d}}function fh(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],o=r.callback;if(o!==null){if(r.callback=null,r=n,typeof o!="function")throw Error(z(191,o));o.call(r)}}}var ph=new If.Component().refs;function ju(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:fe({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var ea={isMounted:function(e){return(e=e._reactInternals)?nr(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=He(),o=Pn(e),i=ln(r,o);i.payload=t,n!=null&&(i.callback=n),t=An(e,i,o),t!==null&&(bt(t,e,o,r),Zs(t,e,o))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=He(),o=Pn(e),i=ln(r,o);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=An(e,i,o),t!==null&&(bt(t,e,o,r),Zs(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=He(),r=Pn(e),o=ln(n,r);o.tag=2,t!=null&&(o.callback=t),t=An(e,o,r),t!==null&&(bt(t,e,r,n),Zs(t,e,r))}};function hh(e,t,n,r,o,i,s){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,i,s):t.prototype&&t.prototype.isPureReactComponent?!ai(n,r)||!ai(o,i):!0}function gh(e,t,n){var r=!1,o=Cn,i=t.contextType;return typeof i=="object"&&i!==null?i=mt(i):(o=Ke(t)?or:ke.current,r=t.contextTypes,i=(r=r!=null)?Jr(e,o):Cn),t=new t(n,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=ea,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=i),t}function mh(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&ea.enqueueReplaceState(t,t.state,null)}function Gu(e,t,n,r){var o=e.stateNode;o.props=n,o.state=e.memoizedState,o.refs=ph,zu(e);var i=t.contextType;typeof i=="object"&&i!==null?o.context=mt(i):(i=Ke(t)?or:ke.current,o.context=Jr(e,i)),o.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(ju(e,t,i,n),o.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof o.getSnapshotBeforeUpdate=="function"||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(t=o.state,typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount(),t!==o.state&&ea.enqueueReplaceState(o,o.state,null),Js(e,n,o,r),o.state=e.memoizedState),typeof o.componentDidMount=="function"&&(e.flags|=4194308)}function hi(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(z(309));var r=n.stateNode}if(!r)throw Error(z(147,e));var o=r,i=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===i?t.ref:(t=function(s){var a=o.refs;a===ph&&(a=o.refs={}),s===null?delete a[i]:a[i]=s},t._stringRef=i,t)}if(typeof e!="string")throw Error(z(284));if(!n._owner)throw Error(z(290,e))}return e}function ta(e,t){throw e=Object.prototype.toString.call(t),Error(z(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function vh(e){var t=e._init;return t(e._payload)}function yh(e){function t(p,g){if(e){var S=p.deletions;S===null?(p.deletions=[g],p.flags|=16):S.push(g)}}function n(p,g){if(!e)return null;for(;g!==null;)t(p,g),g=g.sibling;return null}function r(p,g){for(p=new Map;g!==null;)g.key!==null?p.set(g.key,g):p.set(g.index,g),g=g.sibling;return p}function o(p,g){return p=Un(p,g),p.index=0,p.sibling=null,p}function i(p,g,S){return p.index=S,e?(S=p.alternate,S!==null?(S=S.index,S<g?(p.flags|=2,g):S):(p.flags|=2,g)):(p.flags|=1048576,g)}function s(p){return e&&p.alternate===null&&(p.flags|=2),p}function a(p,g,S,_){return g===null||g.tag!==6?(g=Cc(S,p.mode,_),g.return=p,g):(g=o(g,S),g.return=p,g)}function l(p,g,S,_){var w=S.type;return w===Br?c(p,g,S.props.children,_,S.key):g!==null&&(g.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===yn&&vh(w)===g.type)?(_=o(g,S.props),_.ref=hi(p,g,S),_.return=p,_):(_=Sa(S.type,S.key,S.props,null,p.mode,_),_.ref=hi(p,g,S),_.return=p,_)}function u(p,g,S,_){return g===null||g.tag!==4||g.stateNode.containerInfo!==S.containerInfo||g.stateNode.implementation!==S.implementation?(g=Ic(S,p.mode,_),g.return=p,g):(g=o(g,S.children||[]),g.return=p,g)}function c(p,g,S,_,w){return g===null||g.tag!==7?(g=hr(S,p.mode,_,w),g.return=p,g):(g=o(g,S),g.return=p,g)}function d(p,g,S){if(typeof g=="string"&&g!==""||typeof g=="number")return g=Cc(""+g,p.mode,S),g.return=p,g;if(typeof g=="object"&&g!==null){switch(g.$$typeof){case vs:return S=Sa(g.type,g.key,g.props,null,p.mode,S),S.ref=hi(p,null,g),S.return=p,S;case Vr:return g=Ic(g,p.mode,S),g.return=p,g;case yn:var _=g._init;return d(p,_(g._payload),S)}if(zo(g)||$o(g))return g=hr(g,p.mode,S,null),g.return=p,g;ta(p,g)}return null}function f(p,g,S,_){var w=g!==null?g.key:null;if(typeof S=="string"&&S!==""||typeof S=="number")return w!==null?null:a(p,g,""+S,_);if(typeof S=="object"&&S!==null){switch(S.$$typeof){case vs:return S.key===w?l(p,g,S,_):null;case Vr:return S.key===w?u(p,g,S,_):null;case yn:return w=S._init,f(p,g,w(S._payload),_)}if(zo(S)||$o(S))return w!==null?null:c(p,g,S,_,null);ta(p,S)}return null}function h(p,g,S,_,w){if(typeof _=="string"&&_!==""||typeof _=="number")return p=p.get(S)||null,a(g,p,""+_,w);if(typeof _=="object"&&_!==null){switch(_.$$typeof){case vs:return p=p.get(_.key===null?S:_.key)||null,l(g,p,_,w);case Vr:return p=p.get(_.key===null?S:_.key)||null,u(g,p,_,w);case yn:var R=_._init;return h(p,g,S,R(_._payload),w)}if(zo(_)||$o(_))return p=p.get(S)||null,c(g,p,_,w,null);ta(g,_)}return null}function m(p,g,S,_){for(var w=null,R=null,C=g,L=g=0,B=null;C!==null&&L<S.length;L++){C.index>L?(B=C,C=null):B=C.sibling;var I=f(p,C,S[L],_);if(I===null){C===null&&(C=B);break}e&&C&&I.alternate===null&&t(p,C),g=i(I,g,L),R===null?w=I:R.sibling=I,R=I,C=B}if(L===S.length)return n(p,C),ce&&sr(p,L),w;if(C===null){for(;L<S.length;L++)C=d(p,S[L],_),C!==null&&(g=i(C,g,L),R===null?w=C:R.sibling=C,R=C);return ce&&sr(p,L),w}for(C=r(p,C);L<S.length;L++)B=h(C,p,L,S[L],_),B!==null&&(e&&B.alternate!==null&&C.delete(B.key===null?L:B.key),g=i(B,g,L),R===null?w=B:R.sibling=B,R=B);return e&&C.forEach(function(V){return t(p,V)}),ce&&sr(p,L),w}function v(p,g,S,_){var w=$o(S);if(typeof w!="function")throw Error(z(150));if(S=w.call(S),S==null)throw Error(z(151));for(var R=w=null,C=g,L=g=0,B=null,I=S.next();C!==null&&!I.done;L++,I=S.next()){C.index>L?(B=C,C=null):B=C.sibling;var V=f(p,C,I.value,_);if(V===null){C===null&&(C=B);break}e&&C&&V.alternate===null&&t(p,C),g=i(V,g,L),R===null?w=V:R.sibling=V,R=V,C=B}if(I.done)return n(p,C),ce&&sr(p,L),w;if(C===null){for(;!I.done;L++,I=S.next())I=d(p,I.value,_),I!==null&&(g=i(I,g,L),R===null?w=I:R.sibling=I,R=I);return ce&&sr(p,L),w}for(C=r(p,C);!I.done;L++,I=S.next())I=h(C,p,L,I.value,_),I!==null&&(e&&I.alternate!==null&&C.delete(I.key===null?L:I.key),g=i(I,g,L),R===null?w=I:R.sibling=I,R=I);return e&&C.forEach(function($){return t(p,$)}),ce&&sr(p,L),w}function y(p,g,S,_){if(typeof S=="object"&&S!==null&&S.type===Br&&S.key===null&&(S=S.props.children),typeof S=="object"&&S!==null){switch(S.$$typeof){case vs:e:{for(var w=S.key,R=g;R!==null;){if(R.key===w){if(w=S.type,w===Br){if(R.tag===7){n(p,R.sibling),g=o(R,S.props.children),g.return=p,p=g;break e}}else if(R.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===yn&&vh(w)===R.type){n(p,R.sibling),g=o(R,S.props),g.ref=hi(p,R,S),g.return=p,p=g;break e}n(p,R);break}else t(p,R);R=R.sibling}S.type===Br?(g=hr(S.props.children,p.mode,_,S.key),g.return=p,p=g):(_=Sa(S.type,S.key,S.props,null,p.mode,_),_.ref=hi(p,g,S),_.return=p,p=_)}return s(p);case Vr:e:{for(R=S.key;g!==null;){if(g.key===R)if(g.tag===4&&g.stateNode.containerInfo===S.containerInfo&&g.stateNode.implementation===S.implementation){n(p,g.sibling),g=o(g,S.children||[]),g.return=p,p=g;break e}else{n(p,g);break}else t(p,g);g=g.sibling}g=Ic(S,p.mode,_),g.return=p,p=g}return s(p);case yn:return R=S._init,y(p,g,R(S._payload),_)}if(zo(S))return m(p,g,S,_);if($o(S))return v(p,g,S,_);ta(p,S)}return typeof S=="string"&&S!==""||typeof S=="number"?(S=""+S,g!==null&&g.tag===6?(n(p,g.sibling),g=o(g,S),g.return=p,p=g):(n(p,g),g=Cc(S,p.mode,_),g.return=p,p=g),s(p)):n(p,g)}return y}var io=yh(!0),Eh=yh(!1),gi={},$t=Tn(gi),mi=Tn(gi),vi=Tn(gi);function lr(e){if(e===gi)throw Error(z(174));return e}function Yu(e,t){switch(ie(vi,t),ie(mi,e),ie($t,gi),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Gl(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Gl(t,e)}ae($t),ie($t,t)}function so(){ae($t),ae(mi),ae(vi)}function Sh(e){lr(vi.current);var t=lr($t.current),n=Gl(t,e.type);t!==n&&(ie(mi,e),ie($t,n))}function Wu(e){mi.current===e&&(ae($t),ae(mi))}var pe=Tn(0);function na(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Ku=[];function Qu(){for(var e=0;e<Ku.length;e++)Ku[e]._workInProgressVersionPrimary=null;Ku.length=0}var ra=tn.ReactCurrentDispatcher,Xu=tn.ReactCurrentBatchConfig,ur=0,he=null,Ne=null,Ce=null,oa=!1,yi=!1,Ei=0,XS=0;function Pe(){throw Error(z(321))}function qu(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Ot(e[n],t[n]))return!1;return!0}function Zu(e,t,n,r,o,i){if(ur=i,he=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,ra.current=e===null||e.memoizedState===null?e_:t_,e=n(r,o),yi){i=0;do{if(yi=!1,Ei=0,25<=i)throw Error(z(301));i+=1,Ce=Ne=null,t.updateQueue=null,ra.current=n_,e=n(r,o)}while(yi)}if(ra.current=aa,t=Ne!==null&&Ne.next!==null,ur=0,Ce=Ne=he=null,oa=!1,t)throw Error(z(300));return e}function Ju(){var e=Ei!==0;return Ei=0,e}function Ht(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ce===null?he.memoizedState=Ce=e:Ce=Ce.next=e,Ce}function vt(){if(Ne===null){var e=he.alternate;e=e!==null?e.memoizedState:null}else e=Ne.next;var t=Ce===null?he.memoizedState:Ce.next;if(t!==null)Ce=t,Ne=e;else{if(e===null)throw Error(z(310));Ne=e,e={memoizedState:Ne.memoizedState,baseState:Ne.baseState,baseQueue:Ne.baseQueue,queue:Ne.queue,next:null},Ce===null?he.memoizedState=Ce=e:Ce=Ce.next=e}return Ce}function Si(e,t){return typeof t=="function"?t(e):t}function ec(e){var t=vt(),n=t.queue;if(n===null)throw Error(z(311));n.lastRenderedReducer=e;var r=Ne,o=r.baseQueue,i=n.pending;if(i!==null){if(o!==null){var s=o.next;o.next=i.next,i.next=s}r.baseQueue=o=i,n.pending=null}if(o!==null){i=o.next,r=r.baseState;var a=s=null,l=null,u=i;do{var c=u.lane;if((ur&c)===c)l!==null&&(l=l.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),r=u.hasEagerState?u.eagerState:e(r,u.action);else{var d={lane:c,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};l===null?(a=l=d,s=r):l=l.next=d,he.lanes|=c,cr|=c}u=u.next}while(u!==null&&u!==i);l===null?s=r:l.next=a,Ot(r,t.memoizedState)||(Qe=!0),t.memoizedState=r,t.baseState=s,t.baseQueue=l,n.lastRenderedState=r}if(e=n.interleaved,e!==null){o=e;do i=o.lane,he.lanes|=i,cr|=i,o=o.next;while(o!==e)}else o===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function tc(e){var t=vt(),n=t.queue;if(n===null)throw Error(z(311));n.lastRenderedReducer=e;var r=n.dispatch,o=n.pending,i=t.memoizedState;if(o!==null){n.pending=null;var s=o=o.next;do i=e(i,s.action),s=s.next;while(s!==o);Ot(i,t.memoizedState)||(Qe=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function _h(){}function wh(e,t){var n=he,r=vt(),o=t(),i=!Ot(r.memoizedState,o);if(i&&(r.memoizedState=o,Qe=!0),r=r.queue,nc(Oh.bind(null,n,r,e),[e]),r.getSnapshot!==t||i||Ce!==null&&Ce.memoizedState.tag&1){if(n.flags|=2048,_i(9,Nh.bind(null,n,r,o,t),void 0,null),Ie===null)throw Error(z(349));ur&30||Rh(n,t,o)}return o}function Rh(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=he.updateQueue,t===null?(t={lastEffect:null,stores:null},he.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Nh(e,t,n,r){t.value=n,t.getSnapshot=r,xh(t)&&Th(e)}function Oh(e,t,n){return n(function(){xh(t)&&Th(e)})}function xh(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Ot(e,n)}catch{return!0}}function Th(e){var t=an(e,1);t!==null&&bt(t,e,1,-1)}function Ch(e){var t=Ht();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Si,lastRenderedState:e},t.queue=e,e=e.dispatch=JS.bind(null,he,e),[t.memoizedState,e]}function _i(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=he.updateQueue,t===null?(t={lastEffect:null,stores:null},he.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function Ih(){return vt().memoizedState}function ia(e,t,n,r){var o=Ht();he.flags|=e,o.memoizedState=_i(1|t,n,void 0,r===void 0?null:r)}function sa(e,t,n,r){var o=vt();r=r===void 0?null:r;var i=void 0;if(Ne!==null){var s=Ne.memoizedState;if(i=s.destroy,r!==null&&qu(r,s.deps)){o.memoizedState=_i(t,n,i,r);return}}he.flags|=e,o.memoizedState=_i(1|t,n,i,r)}function bh(e,t){return ia(8390656,8,e,t)}function nc(e,t){return sa(2048,8,e,t)}function Ah(e,t){return sa(4,2,e,t)}function Lh(e,t){return sa(4,4,e,t)}function Dh(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function kh(e,t,n){return n=n!=null?n.concat([e]):null,sa(4,4,Dh.bind(null,t,e),n)}function rc(){}function Ph(e,t){var n=vt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&qu(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Mh(e,t){var n=vt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&qu(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Uh(e,t,n){return ur&21?(Ot(n,t)||(n=up(),he.lanes|=n,cr|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Qe=!0),e.memoizedState=n)}function qS(e,t){var n=re;re=n!==0&&4>n?n:4,e(!0);var r=Xu.transition;Xu.transition={};try{e(!1),t()}finally{re=n,Xu.transition=r}}function Fh(){return vt().memoizedState}function ZS(e,t,n){var r=Pn(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Vh(e))Bh(t,n);else if(n=uh(e,t,n,r),n!==null){var o=He();bt(n,e,r,o),$h(n,t,r)}}function JS(e,t,n){var r=Pn(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Vh(e))Bh(t,o);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var s=t.lastRenderedState,a=i(s,n);if(o.hasEagerState=!0,o.eagerState=a,Ot(a,s)){var l=t.interleaved;l===null?(o.next=o,Hu(t)):(o.next=l.next,l.next=o),t.interleaved=o;return}}catch{}finally{}n=uh(e,t,o,r),n!==null&&(o=He(),bt(n,e,r,o),$h(n,t,r))}}function Vh(e){var t=e.alternate;return e===he||t!==null&&t===he}function Bh(e,t){yi=oa=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function $h(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ru(e,n)}}var aa={readContext:mt,useCallback:Pe,useContext:Pe,useEffect:Pe,useImperativeHandle:Pe,useInsertionEffect:Pe,useLayoutEffect:Pe,useMemo:Pe,useReducer:Pe,useRef:Pe,useState:Pe,useDebugValue:Pe,useDeferredValue:Pe,useTransition:Pe,useMutableSource:Pe,useSyncExternalStore:Pe,useId:Pe,unstable_isNewReconciler:!1},e_={readContext:mt,useCallback:function(e,t){return Ht().memoizedState=[e,t===void 0?null:t],e},useContext:mt,useEffect:bh,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,ia(4194308,4,Dh.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ia(4194308,4,e,t)},useInsertionEffect:function(e,t){return ia(4,2,e,t)},useMemo:function(e,t){var n=Ht();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Ht();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=ZS.bind(null,he,e),[r.memoizedState,e]},useRef:function(e){var t=Ht();return e={current:e},t.memoizedState=e},useState:Ch,useDebugValue:rc,useDeferredValue:function(e){return Ht().memoizedState=e},useTransition:function(){var e=Ch(!1),t=e[0];return e=qS.bind(null,e[1]),Ht().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=he,o=Ht();if(ce){if(n===void 0)throw Error(z(407));n=n()}else{if(n=t(),Ie===null)throw Error(z(349));ur&30||Rh(r,t,n)}o.memoizedState=n;var i={value:n,getSnapshot:t};return o.queue=i,bh(Oh.bind(null,r,i,e),[e]),r.flags|=2048,_i(9,Nh.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=Ht(),t=Ie.identifierPrefix;if(ce){var n=sn,r=on;n=(r&~(1<<32-Nt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Ei++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=XS++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},t_={readContext:mt,useCallback:Ph,useContext:mt,useEffect:nc,useImperativeHandle:kh,useInsertionEffect:Ah,useLayoutEffect:Lh,useMemo:Mh,useReducer:ec,useRef:Ih,useState:function(){return ec(Si)},useDebugValue:rc,useDeferredValue:function(e){var t=vt();return Uh(t,Ne.memoizedState,e)},useTransition:function(){var e=ec(Si)[0],t=vt().memoizedState;return[e,t]},useMutableSource:_h,useSyncExternalStore:wh,useId:Fh,unstable_isNewReconciler:!1},n_={readContext:mt,useCallback:Ph,useContext:mt,useEffect:nc,useImperativeHandle:kh,useInsertionEffect:Ah,useLayoutEffect:Lh,useMemo:Mh,useReducer:tc,useRef:Ih,useState:function(){return tc(Si)},useDebugValue:rc,useDeferredValue:function(e){var t=vt();return Ne===null?t.memoizedState=e:Uh(t,Ne.memoizedState,e)},useTransition:function(){var e=tc(Si)[0],t=vt().memoizedState;return[e,t]},useMutableSource:_h,useSyncExternalStore:wh,useId:Fh,unstable_isNewReconciler:!1};function ao(e,t){try{var n="",r=t;do n+=bE(r),r=r.return;while(r);var o=n}catch(i){o=`
41
+ `+o[s].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),l}while(1<=s&&0<=a);break}}}finally{Fl=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Ho(e):""}function bE(e){switch(e.tag){case 5:return Ho(e.type);case 16:return Ho("Lazy");case 13:return Ho("Suspense");case 19:return Ho("SuspenseList");case 0:case 2:case 15:return e=Vl(e.type,!1),e;case 11:return e=Vl(e.type.render,!1),e;case 1:return e=Vl(e.type,!0),e;default:return""}}function Bl(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Br:return"Fragment";case Vr:return"Portal";case Ll:return"Profiler";case Al:return"StrictMode";case kl:return"Suspense";case Pl:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Df:return(e.displayName||"Context")+".Consumer";case Lf:return(e._context.displayName||"Context")+".Provider";case Dl:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Ml:return t=e.displayName||null,t!==null?t:Bl(e.type)||"Memo";case yn:t=e._payload,e=e._init;try{return Bl(e(t))}catch{}}return null}function AE(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Bl(t);case 8:return t===Al?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function En(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Mf(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function LE(e){var t=Mf(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var o=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(s){r=""+s,i.call(this,s)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function ys(e){e._valueTracker||(e._valueTracker=LE(e))}function Uf(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Mf(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Es(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function $l(e,t){var n=t.checked;return fe({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Ff(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=En(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Vf(e,t){t=t.checked,t!=null&&bl(e,"checked",t,!1)}function Hl(e,t){Vf(e,t);var n=En(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?zl(e,t.type,n):t.hasOwnProperty("defaultValue")&&zl(e,t.type,En(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Bf(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function zl(e,t,n){(t!=="number"||Es(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var zo=Array.isArray;function $r(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o<n.length;o++)t["$"+n[o]]=!0;for(n=0;n<e.length;n++)o=t.hasOwnProperty("$"+e[n].value),e[n].selected!==o&&(e[n].selected=o),o&&r&&(e[n].defaultSelected=!0)}else{for(n=""+En(n),t=null,o=0;o<e.length;o++){if(e[o].value===n){e[o].selected=!0,r&&(e[o].defaultSelected=!0);return}t!==null||e[o].disabled||(t=e[o])}t!==null&&(t.selected=!0)}}function jl(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(z(91));return fe({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function $f(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(z(92));if(zo(n)){if(1<n.length)throw Error(z(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:En(n)}}function Hf(e,t){var n=En(t.value),r=En(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function zf(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function jf(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Gl(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?jf(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Ss,Gf=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,o){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,o)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Ss=Ss||document.createElement("div"),Ss.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Ss.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function jo(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Go={animationIterationCount:!0,aspectRatio:!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,gridArea:!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},DE=["Webkit","ms","Moz","O"];Object.keys(Go).forEach(function(e){DE.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Go[t]=Go[e]})});function Yf(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Go.hasOwnProperty(e)&&Go[e]?(""+t).trim():t+"px"}function Wf(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=Yf(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var kE=fe({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Yl(e,t){if(t){if(kE[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(z(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(z(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(z(61))}if(t.style!=null&&typeof t.style!="object")throw Error(z(62))}}function Wl(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Kl=null;function Ql(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Xl=null,Hr=null,zr=null;function Kf(e){if(e=pi(e)){if(typeof Xl!="function")throw Error(z(280));var t=e.stateNode;t&&(t=zs(t),Xl(e.stateNode,e.type,t))}}function Qf(e){Hr?zr?zr.push(e):zr=[e]:Hr=e}function Xf(){if(Hr){var e=Hr,t=zr;if(zr=Hr=null,Kf(e),t)for(e=0;e<t.length;e++)Kf(t[e])}}function qf(e,t){return e(t)}function Zf(){}var ql=!1;function Jf(e,t,n){if(ql)return e(t,n);ql=!0;try{return qf(e,t,n)}finally{ql=!1,(Hr!==null||zr!==null)&&(Zf(),Xf())}}function Yo(e,t){var n=e.stateNode;if(n===null)return null;var r=zs(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(z(231,t,typeof n));return n}var Zl=!1;if(en)try{var Wo={};Object.defineProperty(Wo,"passive",{get:function(){Zl=!0}}),window.addEventListener("test",Wo,Wo),window.removeEventListener("test",Wo,Wo)}catch{Zl=!1}function PE(e,t,n,r,o,i,s,a,l){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(c){this.onError(c)}}var Ko=!1,_s=null,ws=!1,Jl=null,ME={onError:function(e){Ko=!0,_s=e}};function UE(e,t,n,r,o,i,s,a,l){Ko=!1,_s=null,PE.apply(ME,arguments)}function FE(e,t,n,r,o,i,s,a,l){if(UE.apply(this,arguments),Ko){if(Ko){var u=_s;Ko=!1,_s=null}else throw Error(z(198));ws||(ws=!0,Jl=u)}}function nr(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function ep(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function tp(e){if(nr(e)!==e)throw Error(z(188))}function VE(e){var t=e.alternate;if(!t){if(t=nr(e),t===null)throw Error(z(188));return t!==e?null:e}for(var n=e,r=t;;){var o=n.return;if(o===null)break;var i=o.alternate;if(i===null){if(r=o.return,r!==null){n=r;continue}break}if(o.child===i.child){for(i=o.child;i;){if(i===n)return tp(o),e;if(i===r)return tp(o),t;i=i.sibling}throw Error(z(188))}if(n.return!==r.return)n=o,r=i;else{for(var s=!1,a=o.child;a;){if(a===n){s=!0,n=o,r=i;break}if(a===r){s=!0,r=o,n=i;break}a=a.sibling}if(!s){for(a=i.child;a;){if(a===n){s=!0,n=i,r=o;break}if(a===r){s=!0,r=i,n=o;break}a=a.sibling}if(!s)throw Error(z(189))}}if(n.alternate!==r)throw Error(z(190))}if(n.tag!==3)throw Error(z(188));return n.stateNode.current===n?e:t}function np(e){return e=VE(e),e!==null?rp(e):null}function rp(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=rp(e);if(t!==null)return t;e=e.sibling}return null}var op=ot.unstable_scheduleCallback,ip=ot.unstable_cancelCallback,BE=ot.unstable_shouldYield,$E=ot.unstable_requestPaint,Ee=ot.unstable_now,HE=ot.unstable_getCurrentPriorityLevel,eu=ot.unstable_ImmediatePriority,sp=ot.unstable_UserBlockingPriority,Rs=ot.unstable_NormalPriority,zE=ot.unstable_LowPriority,ap=ot.unstable_IdlePriority,Ns=null,Vt=null;function jE(e){if(Vt&&typeof Vt.onCommitFiberRoot=="function")try{Vt.onCommitFiberRoot(Ns,e,void 0,(e.current.flags&128)===128)}catch{}}var Nt=Math.clz32?Math.clz32:WE,GE=Math.log,YE=Math.LN2;function WE(e){return e>>>=0,e===0?32:31-(GE(e)/YE|0)|0}var Os=64,xs=4194304;function Qo(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Ts(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,o=e.suspendedLanes,i=e.pingedLanes,s=n&268435455;if(s!==0){var a=s&~o;a!==0?r=Qo(a):(i&=s,i!==0&&(r=Qo(i)))}else s=n&~o,s!==0?r=Qo(s):i!==0&&(r=Qo(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&o)&&(o=r&-r,i=t&-t,o>=i||o===16&&(i&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-Nt(t),o=1<<n,r|=e[n],t&=~o;return r}function KE(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function QE(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,o=e.expirationTimes,i=e.pendingLanes;0<i;){var s=31-Nt(i),a=1<<s,l=o[s];l===-1?(!(a&n)||a&r)&&(o[s]=KE(a,t)):l<=t&&(e.expiredLanes|=a),i&=~a}}function tu(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function lp(){var e=Os;return Os<<=1,!(Os&4194240)&&(Os=64),e}function nu(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Xo(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Nt(t),e[t]=n}function XE(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var o=31-Nt(n),i=1<<o;t[o]=0,r[o]=-1,e[o]=-1,n&=~i}}function ru(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Nt(n),o=1<<r;o&t|e[r]&t&&(e[r]|=t),n&=~o}}var re=0;function up(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var cp,ou,dp,fp,pp,iu=!1,Cs=[],Sn=null,_n=null,wn=null,qo=new Map,Zo=new Map,Rn=[],qE="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function hp(e,t){switch(e){case"focusin":case"focusout":Sn=null;break;case"dragenter":case"dragleave":_n=null;break;case"mouseover":case"mouseout":wn=null;break;case"pointerover":case"pointerout":qo.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Zo.delete(t.pointerId)}}function Jo(e,t,n,r,o,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:i,targetContainers:[o]},t!==null&&(t=pi(t),t!==null&&ou(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function ZE(e,t,n,r,o){switch(t){case"focusin":return Sn=Jo(Sn,e,t,n,r,o),!0;case"dragenter":return _n=Jo(_n,e,t,n,r,o),!0;case"mouseover":return wn=Jo(wn,e,t,n,r,o),!0;case"pointerover":var i=o.pointerId;return qo.set(i,Jo(qo.get(i)||null,e,t,n,r,o)),!0;case"gotpointercapture":return i=o.pointerId,Zo.set(i,Jo(Zo.get(i)||null,e,t,n,r,o)),!0}return!1}function gp(e){var t=rr(e.target);if(t!==null){var n=nr(t);if(n!==null){if(t=n.tag,t===13){if(t=ep(n),t!==null){e.blockedOn=t,pp(e.priority,function(){dp(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Is(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=au(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Kl=r,n.target.dispatchEvent(r),Kl=null}else return t=pi(n),t!==null&&ou(t),e.blockedOn=n,!1;t.shift()}return!0}function mp(e,t,n){Is(e)&&n.delete(t)}function JE(){iu=!1,Sn!==null&&Is(Sn)&&(Sn=null),_n!==null&&Is(_n)&&(_n=null),wn!==null&&Is(wn)&&(wn=null),qo.forEach(mp),Zo.forEach(mp)}function ei(e,t){e.blockedOn===t&&(e.blockedOn=null,iu||(iu=!0,ot.unstable_scheduleCallback(ot.unstable_NormalPriority,JE)))}function ti(e){function t(o){return ei(o,e)}if(0<Cs.length){ei(Cs[0],e);for(var n=1;n<Cs.length;n++){var r=Cs[n];r.blockedOn===e&&(r.blockedOn=null)}}for(Sn!==null&&ei(Sn,e),_n!==null&&ei(_n,e),wn!==null&&ei(wn,e),qo.forEach(t),Zo.forEach(t),n=0;n<Rn.length;n++)r=Rn[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<Rn.length&&(n=Rn[0],n.blockedOn===null);)gp(n),n.blockedOn===null&&Rn.shift()}var jr=tn.ReactCurrentBatchConfig,bs=!0;function eS(e,t,n,r){var o=re,i=jr.transition;jr.transition=null;try{re=1,su(e,t,n,r)}finally{re=o,jr.transition=i}}function tS(e,t,n,r){var o=re,i=jr.transition;jr.transition=null;try{re=4,su(e,t,n,r)}finally{re=o,jr.transition=i}}function su(e,t,n,r){if(bs){var o=au(e,t,n,r);if(o===null)Nu(e,t,r,As,n),hp(e,r);else if(ZE(o,e,t,n,r))r.stopPropagation();else if(hp(e,r),t&4&&-1<qE.indexOf(e)){for(;o!==null;){var i=pi(o);if(i!==null&&cp(i),i=au(e,t,n,r),i===null&&Nu(e,t,r,As,n),i===o)break;o=i}o!==null&&r.stopPropagation()}else Nu(e,t,r,null,n)}}var As=null;function au(e,t,n,r){if(As=null,e=Ql(r),e=rr(e),e!==null)if(t=nr(e),t===null)e=null;else if(n=t.tag,n===13){if(e=ep(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return As=e,null}function vp(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(HE()){case eu:return 1;case sp:return 4;case Rs:case zE:return 16;case ap:return 536870912;default:return 16}default:return 16}}var Nn=null,lu=null,Ls=null;function yp(){if(Ls)return Ls;var e,t=lu,n=t.length,r,o="value"in Nn?Nn.value:Nn.textContent,i=o.length;for(e=0;e<n&&t[e]===o[e];e++);var s=n-e;for(r=1;r<=s&&t[n-r]===o[i-r];r++);return Ls=o.slice(e,1<r?1-r:void 0)}function Ds(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function ks(){return!0}function Ep(){return!1}function it(e){function t(n,r,o,i,s){this._reactName=n,this._targetInst=o,this.type=r,this.nativeEvent=i,this.target=s,this.currentTarget=null;for(var a in e)e.hasOwnProperty(a)&&(n=e[a],this[a]=n?n(i):i[a]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?ks:Ep,this.isPropagationStopped=Ep,this}return fe(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=ks)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=ks)},persist:function(){},isPersistent:ks}),t}var Gr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},uu=it(Gr),ni=fe({},Gr,{view:0,detail:0}),nS=it(ni),cu,du,ri,Ps=fe({},ni,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:pu,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==ri&&(ri&&e.type==="mousemove"?(cu=e.screenX-ri.screenX,du=e.screenY-ri.screenY):du=cu=0,ri=e),cu)},movementY:function(e){return"movementY"in e?e.movementY:du}}),Sp=it(Ps),rS=fe({},Ps,{dataTransfer:0}),oS=it(rS),iS=fe({},ni,{relatedTarget:0}),fu=it(iS),sS=fe({},Gr,{animationName:0,elapsedTime:0,pseudoElement:0}),aS=it(sS),lS=fe({},Gr,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),uS=it(lS),cS=fe({},Gr,{data:0}),_p=it(cS),dS={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},fS={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},pS={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function hS(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=pS[e])?!!t[e]:!1}function pu(){return hS}var gS=fe({},ni,{key:function(e){if(e.key){var t=dS[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Ds(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?fS[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:pu,charCode:function(e){return e.type==="keypress"?Ds(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Ds(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),mS=it(gS),vS=fe({},Ps,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),wp=it(vS),yS=fe({},ni,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:pu}),ES=it(yS),SS=fe({},Gr,{propertyName:0,elapsedTime:0,pseudoElement:0}),_S=it(SS),wS=fe({},Ps,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),RS=it(wS),NS=[9,13,27,32],hu=en&&"CompositionEvent"in window,oi=null;en&&"documentMode"in document&&(oi=document.documentMode);var OS=en&&"TextEvent"in window&&!oi,Rp=en&&(!hu||oi&&8<oi&&11>=oi),Np=String.fromCharCode(32),Op=!1;function xp(e,t){switch(e){case"keyup":return NS.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Tp(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Yr=!1;function xS(e,t){switch(e){case"compositionend":return Tp(t);case"keypress":return t.which!==32?null:(Op=!0,Np);case"textInput":return e=t.data,e===Np&&Op?null:e;default:return null}}function TS(e,t){if(Yr)return e==="compositionend"||!hu&&xp(e,t)?(e=yp(),Ls=lu=Nn=null,Yr=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Rp&&t.locale!=="ko"?null:t.data;default:return null}}var CS={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Cp(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!CS[e.type]:t==="textarea"}function Ip(e,t,n,r){Qf(r),t=Bs(t,"onChange"),0<t.length&&(n=new uu("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var ii=null,si=null;function IS(e){Wp(e,0)}function Ms(e){var t=qr(e);if(Uf(t))return e}function bS(e,t){if(e==="change")return t}var bp=!1;if(en){var gu;if(en){var mu="oninput"in document;if(!mu){var Ap=document.createElement("div");Ap.setAttribute("oninput","return;"),mu=typeof Ap.oninput=="function"}gu=mu}else gu=!1;bp=gu&&(!document.documentMode||9<document.documentMode)}function Lp(){ii&&(ii.detachEvent("onpropertychange",Dp),si=ii=null)}function Dp(e){if(e.propertyName==="value"&&Ms(si)){var t=[];Ip(t,si,e,Ql(e)),Jf(IS,t)}}function AS(e,t,n){e==="focusin"?(Lp(),ii=t,si=n,ii.attachEvent("onpropertychange",Dp)):e==="focusout"&&Lp()}function LS(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ms(si)}function DS(e,t){if(e==="click")return Ms(t)}function kS(e,t){if(e==="input"||e==="change")return Ms(t)}function PS(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Ot=typeof Object.is=="function"?Object.is:PS;function ai(e,t){if(Ot(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var o=n[r];if(!Tl.call(t,o)||!Ot(e[o],t[o]))return!1}return!0}function kp(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Pp(e,t){var n=kp(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=kp(n)}}function Mp(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Mp(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Up(){for(var e=window,t=Es();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Es(e.document)}return t}function vu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function MS(e){var t=Up(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Mp(n.ownerDocument.documentElement,n)){if(r!==null&&vu(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var o=n.textContent.length,i=Math.min(r.start,o);r=r.end===void 0?i:Math.min(r.end,o),!e.extend&&i>r&&(o=r,r=i,i=o),o=Pp(n,i);var s=Pp(n,r);o&&s&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var US=en&&"documentMode"in document&&11>=document.documentMode,Wr=null,yu=null,li=null,Eu=!1;function Fp(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Eu||Wr==null||Wr!==Es(r)||(r=Wr,"selectionStart"in r&&vu(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),li&&ai(li,r)||(li=r,r=Bs(yu,"onSelect"),0<r.length&&(t=new uu("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Wr)))}function Us(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Kr={animationend:Us("Animation","AnimationEnd"),animationiteration:Us("Animation","AnimationIteration"),animationstart:Us("Animation","AnimationStart"),transitionend:Us("Transition","TransitionEnd")},Su={},Vp={};en&&(Vp=document.createElement("div").style,"AnimationEvent"in window||(delete Kr.animationend.animation,delete Kr.animationiteration.animation,delete Kr.animationstart.animation),"TransitionEvent"in window||delete Kr.transitionend.transition);function Fs(e){if(Su[e])return Su[e];if(!Kr[e])return e;var t=Kr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Vp)return Su[e]=t[n];return e}var Bp=Fs("animationend"),$p=Fs("animationiteration"),Hp=Fs("animationstart"),zp=Fs("transitionend"),jp=new Map,Gp="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function On(e,t){jp.set(e,t),tr(t,[e])}for(var _u=0;_u<Gp.length;_u++){var wu=Gp[_u],FS=wu.toLowerCase(),VS=wu[0].toUpperCase()+wu.slice(1);On(FS,"on"+VS)}On(Bp,"onAnimationEnd"),On($p,"onAnimationIteration"),On(Hp,"onAnimationStart"),On("dblclick","onDoubleClick"),On("focusin","onFocus"),On("focusout","onBlur"),On(zp,"onTransitionEnd"),Fr("onMouseEnter",["mouseout","mouseover"]),Fr("onMouseLeave",["mouseout","mouseover"]),Fr("onPointerEnter",["pointerout","pointerover"]),Fr("onPointerLeave",["pointerout","pointerover"]),tr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),tr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),tr("onBeforeInput",["compositionend","keypress","textInput","paste"]),tr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),tr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),tr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ui="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),BS=new Set("cancel close invalid load scroll toggle".split(" ").concat(ui));function Yp(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,FE(r,t,void 0,e),e.currentTarget=null}function Wp(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],o=r.event;r=r.listeners;e:{var i=void 0;if(t)for(var s=r.length-1;0<=s;s--){var a=r[s],l=a.instance,u=a.currentTarget;if(a=a.listener,l!==i&&o.isPropagationStopped())break e;Yp(o,a,u),i=l}else for(s=0;s<r.length;s++){if(a=r[s],l=a.instance,u=a.currentTarget,a=a.listener,l!==i&&o.isPropagationStopped())break e;Yp(o,a,u),i=l}}}if(ws)throw e=Jl,ws=!1,Jl=null,e}function se(e,t){var n=t[bu];n===void 0&&(n=t[bu]=new Set);var r=e+"__bubble";n.has(r)||(Kp(t,e,2,!1),n.add(r))}function Ru(e,t,n){var r=0;t&&(r|=4),Kp(n,e,r,t)}var Vs="_reactListening"+Math.random().toString(36).slice(2);function ci(e){if(!e[Vs]){e[Vs]=!0,If.forEach(function(n){n!=="selectionchange"&&(BS.has(n)||Ru(n,!1,e),Ru(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Vs]||(t[Vs]=!0,Ru("selectionchange",!1,t))}}function Kp(e,t,n,r){switch(vp(t)){case 1:var o=eS;break;case 4:o=tS;break;default:o=su}n=o.bind(null,t,n,e),o=void 0,!Zl||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(o=!0),r?o!==void 0?e.addEventListener(t,n,{capture:!0,passive:o}):e.addEventListener(t,n,!0):o!==void 0?e.addEventListener(t,n,{passive:o}):e.addEventListener(t,n,!1)}function Nu(e,t,n,r,o){var i=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var a=r.stateNode.containerInfo;if(a===o||a.nodeType===8&&a.parentNode===o)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&(l=s.stateNode.containerInfo,l===o||l.nodeType===8&&l.parentNode===o))return;s=s.return}for(;a!==null;){if(s=rr(a),s===null)return;if(l=s.tag,l===5||l===6){r=i=s;continue e}a=a.parentNode}}r=r.return}Jf(function(){var u=i,c=Ql(n),d=[];e:{var f=jp.get(e);if(f!==void 0){var h=uu,m=e;switch(e){case"keypress":if(Ds(n)===0)break e;case"keydown":case"keyup":h=mS;break;case"focusin":m="focus",h=fu;break;case"focusout":m="blur",h=fu;break;case"beforeblur":case"afterblur":h=fu;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":h=Sp;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":h=oS;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":h=ES;break;case Bp:case $p:case Hp:h=aS;break;case zp:h=_S;break;case"scroll":h=nS;break;case"wheel":h=RS;break;case"copy":case"cut":case"paste":h=uS;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":h=wp}var v=(t&4)!==0,y=!v&&e==="scroll",p=v?f!==null?f+"Capture":null:f;v=[];for(var g=u,S;g!==null;){S=g;var _=S.stateNode;if(S.tag===5&&_!==null&&(S=_,p!==null&&(_=Yo(g,p),_!=null&&v.push(di(g,_,S)))),y)break;g=g.return}0<v.length&&(f=new h(f,m,null,n,c),d.push({event:f,listeners:v}))}}if(!(t&7)){e:{if(f=e==="mouseover"||e==="pointerover",h=e==="mouseout"||e==="pointerout",f&&n!==Kl&&(m=n.relatedTarget||n.fromElement)&&(rr(m)||m[nn]))break e;if((h||f)&&(f=c.window===c?c:(f=c.ownerDocument)?f.defaultView||f.parentWindow:window,h?(m=n.relatedTarget||n.toElement,h=u,m=m?rr(m):null,m!==null&&(y=nr(m),m!==y||m.tag!==5&&m.tag!==6)&&(m=null)):(h=null,m=u),h!==m)){if(v=Sp,_="onMouseLeave",p="onMouseEnter",g="mouse",(e==="pointerout"||e==="pointerover")&&(v=wp,_="onPointerLeave",p="onPointerEnter",g="pointer"),y=h==null?f:qr(h),S=m==null?f:qr(m),f=new v(_,g+"leave",h,n,c),f.target=y,f.relatedTarget=S,_=null,rr(c)===u&&(v=new v(p,g+"enter",m,n,c),v.target=S,v.relatedTarget=y,_=v),y=_,h&&m)t:{for(v=h,p=m,g=0,S=v;S;S=Qr(S))g++;for(S=0,_=p;_;_=Qr(_))S++;for(;0<g-S;)v=Qr(v),g--;for(;0<S-g;)p=Qr(p),S--;for(;g--;){if(v===p||p!==null&&v===p.alternate)break t;v=Qr(v),p=Qr(p)}v=null}else v=null;h!==null&&Qp(d,f,h,v,!1),m!==null&&y!==null&&Qp(d,y,m,v,!0)}}e:{if(f=u?qr(u):window,h=f.nodeName&&f.nodeName.toLowerCase(),h==="select"||h==="input"&&f.type==="file")var w=bS;else if(Cp(f))if(bp)w=kS;else{w=LS;var R=AS}else(h=f.nodeName)&&h.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(w=DS);if(w&&(w=w(e,u))){Ip(d,w,n,c);break e}R&&R(e,f,u),e==="focusout"&&(R=f._wrapperState)&&R.controlled&&f.type==="number"&&zl(f,"number",f.value)}switch(R=u?qr(u):window,e){case"focusin":(Cp(R)||R.contentEditable==="true")&&(Wr=R,yu=u,li=null);break;case"focusout":li=yu=Wr=null;break;case"mousedown":Eu=!0;break;case"contextmenu":case"mouseup":case"dragend":Eu=!1,Fp(d,n,c);break;case"selectionchange":if(US)break;case"keydown":case"keyup":Fp(d,n,c)}var C;if(hu)e:{switch(e){case"compositionstart":var L="onCompositionStart";break e;case"compositionend":L="onCompositionEnd";break e;case"compositionupdate":L="onCompositionUpdate";break e}L=void 0}else Yr?xp(e,n)&&(L="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(L="onCompositionStart");L&&(Rp&&n.locale!=="ko"&&(Yr||L!=="onCompositionStart"?L==="onCompositionEnd"&&Yr&&(C=yp()):(Nn=c,lu="value"in Nn?Nn.value:Nn.textContent,Yr=!0)),R=Bs(u,L),0<R.length&&(L=new _p(L,e,null,n,c),d.push({event:L,listeners:R}),C?L.data=C:(C=Tp(n),C!==null&&(L.data=C)))),(C=OS?xS(e,n):TS(e,n))&&(u=Bs(u,"onBeforeInput"),0<u.length&&(c=new _p("onBeforeInput","beforeinput",null,n,c),d.push({event:c,listeners:u}),c.data=C))}Wp(d,t)})}function di(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Bs(e,t){for(var n=t+"Capture",r=[];e!==null;){var o=e,i=o.stateNode;o.tag===5&&i!==null&&(o=i,i=Yo(e,n),i!=null&&r.unshift(di(e,i,o)),i=Yo(e,t),i!=null&&r.push(di(e,i,o))),e=e.return}return r}function Qr(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Qp(e,t,n,r,o){for(var i=t._reactName,s=[];n!==null&&n!==r;){var a=n,l=a.alternate,u=a.stateNode;if(l!==null&&l===r)break;a.tag===5&&u!==null&&(a=u,o?(l=Yo(n,i),l!=null&&s.unshift(di(n,l,a))):o||(l=Yo(n,i),l!=null&&s.push(di(n,l,a)))),n=n.return}s.length!==0&&e.push({event:t,listeners:s})}var $S=/\r\n?/g,HS=/\u0000|\uFFFD/g;function Xp(e){return(typeof e=="string"?e:""+e).replace($S,`
42
+ `).replace(HS,"")}function $s(e,t,n){if(t=Xp(t),Xp(e)!==t&&n)throw Error(z(425))}function Hs(){}var Ou=null,xu=null;function Tu(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Cu=typeof setTimeout=="function"?setTimeout:void 0,zS=typeof clearTimeout=="function"?clearTimeout:void 0,qp=typeof Promise=="function"?Promise:void 0,jS=typeof queueMicrotask=="function"?queueMicrotask:typeof qp<"u"?function(e){return qp.resolve(null).then(e).catch(GS)}:Cu;function GS(e){setTimeout(function(){throw e})}function Iu(e,t){var n=t,r=0;do{var o=n.nextSibling;if(e.removeChild(n),o&&o.nodeType===8)if(n=o.data,n==="/$"){if(r===0){e.removeChild(o),ti(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=o}while(n);ti(t)}function xn(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function Zp(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var Xr=Math.random().toString(36).slice(2),Bt="__reactFiber$"+Xr,fi="__reactProps$"+Xr,nn="__reactContainer$"+Xr,bu="__reactEvents$"+Xr,YS="__reactListeners$"+Xr,WS="__reactHandles$"+Xr;function rr(e){var t=e[Bt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[nn]||n[Bt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Zp(e);e!==null;){if(n=e[Bt])return n;e=Zp(e)}return t}e=n,n=e.parentNode}return null}function pi(e){return e=e[Bt]||e[nn],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function qr(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(z(33))}function zs(e){return e[fi]||null}var Au=[],Zr=-1;function Tn(e){return{current:e}}function ae(e){0>Zr||(e.current=Au[Zr],Au[Zr]=null,Zr--)}function ie(e,t){Zr++,Au[Zr]=e.current,e.current=t}var Cn={},ke=Tn(Cn),We=Tn(!1),or=Cn;function Jr(e,t){var n=e.type.contextTypes;if(!n)return Cn;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={},i;for(i in n)o[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function Ke(e){return e=e.childContextTypes,e!=null}function js(){ae(We),ae(ke)}function Jp(e,t,n){if(ke.current!==Cn)throw Error(z(168));ie(ke,t),ie(We,n)}function eh(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var o in r)if(!(o in t))throw Error(z(108,AE(e)||"Unknown",o));return fe({},n,r)}function Gs(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Cn,or=ke.current,ie(ke,e),ie(We,We.current),!0}function th(e,t,n){var r=e.stateNode;if(!r)throw Error(z(169));n?(e=eh(e,t,or),r.__reactInternalMemoizedMergedChildContext=e,ae(We),ae(ke),ie(ke,e)):ae(We),ie(We,n)}var rn=null,Ys=!1,Lu=!1;function nh(e){rn===null?rn=[e]:rn.push(e)}function KS(e){Ys=!0,nh(e)}function In(){if(!Lu&&rn!==null){Lu=!0;var e=0,t=re;try{var n=rn;for(re=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}rn=null,Ys=!1}catch(o){throw rn!==null&&(rn=rn.slice(e+1)),op(eu,In),o}finally{re=t,Lu=!1}}return null}var eo=[],to=0,Ws=null,Ks=0,ht=[],gt=0,ir=null,on=1,sn="";function sr(e,t){eo[to++]=Ks,eo[to++]=Ws,Ws=e,Ks=t}function rh(e,t,n){ht[gt++]=on,ht[gt++]=sn,ht[gt++]=ir,ir=e;var r=on;e=sn;var o=32-Nt(r)-1;r&=~(1<<o),n+=1;var i=32-Nt(t)+o;if(30<i){var s=o-o%5;i=(r&(1<<s)-1).toString(32),r>>=s,o-=s,on=1<<32-Nt(t)+o|n<<o|r,sn=i+e}else on=1<<i|n<<o|r,sn=e}function Du(e){e.return!==null&&(sr(e,1),rh(e,1,0))}function ku(e){for(;e===Ws;)Ws=eo[--to],eo[to]=null,Ks=eo[--to],eo[to]=null;for(;e===ir;)ir=ht[--gt],ht[gt]=null,sn=ht[--gt],ht[gt]=null,on=ht[--gt],ht[gt]=null}var st=null,at=null,ce=!1,xt=null;function oh(e,t){var n=Et(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function ih(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,st=e,at=xn(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,st=e,at=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=ir!==null?{id:on,overflow:sn}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Et(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,st=e,at=null,!0):!1;default:return!1}}function Pu(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Mu(e){if(ce){var t=at;if(t){var n=t;if(!ih(e,t)){if(Pu(e))throw Error(z(418));t=xn(n.nextSibling);var r=st;t&&ih(e,t)?oh(r,n):(e.flags=e.flags&-4097|2,ce=!1,st=e)}}else{if(Pu(e))throw Error(z(418));e.flags=e.flags&-4097|2,ce=!1,st=e}}}function sh(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;st=e}function Qs(e){if(e!==st)return!1;if(!ce)return sh(e),ce=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Tu(e.type,e.memoizedProps)),t&&(t=at)){if(Pu(e))throw ah(),Error(z(418));for(;t;)oh(e,t),t=xn(t.nextSibling)}if(sh(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(z(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){at=xn(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}at=null}}else at=st?xn(e.stateNode.nextSibling):null;return!0}function ah(){for(var e=at;e;)e=xn(e.nextSibling)}function no(){at=st=null,ce=!1}function Uu(e){xt===null?xt=[e]:xt.push(e)}var QS=tn.ReactCurrentBatchConfig;function Tt(e,t){if(e&&e.defaultProps){t=fe({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}var Xs=Tn(null),qs=null,ro=null,Fu=null;function Vu(){Fu=ro=qs=null}function Bu(e){var t=Xs.current;ae(Xs),e._currentValue=t}function $u(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function oo(e,t){qs=e,Fu=ro=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Qe=!0),e.firstContext=null)}function mt(e){var t=e._currentValue;if(Fu!==e)if(e={context:e,memoizedValue:t,next:null},ro===null){if(qs===null)throw Error(z(308));ro=e,qs.dependencies={lanes:0,firstContext:e}}else ro=ro.next=e;return t}var ar=null;function Hu(e){ar===null?ar=[e]:ar.push(e)}function lh(e,t,n,r){var o=t.interleaved;return o===null?(n.next=n,Hu(t)):(n.next=o.next,o.next=n),t.interleaved=n,an(e,r)}function an(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var bn=!1;function zu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function uh(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function ln(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function An(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,ne&2){var o=r.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),r.pending=t,an(e,n)}return o=r.interleaved,o===null?(t.next=t,Hu(r)):(t.next=o.next,o.next=t),r.interleaved=t,an(e,n)}function Zs(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ru(e,n)}}function ch(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var o=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var s={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?o=i=s:i=i.next=s,n=n.next}while(n!==null);i===null?o=i=t:i=i.next=t}else o=i=t;n={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:i,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Js(e,t,n,r){var o=e.updateQueue;bn=!1;var i=o.firstBaseUpdate,s=o.lastBaseUpdate,a=o.shared.pending;if(a!==null){o.shared.pending=null;var l=a,u=l.next;l.next=null,s===null?i=u:s.next=u,s=l;var c=e.alternate;c!==null&&(c=c.updateQueue,a=c.lastBaseUpdate,a!==s&&(a===null?c.firstBaseUpdate=u:a.next=u,c.lastBaseUpdate=l))}if(i!==null){var d=o.baseState;s=0,c=u=l=null,a=i;do{var f=a.lane,h=a.eventTime;if((r&f)===f){c!==null&&(c=c.next={eventTime:h,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var m=e,v=a;switch(f=t,h=n,v.tag){case 1:if(m=v.payload,typeof m=="function"){d=m.call(h,d,f);break e}d=m;break e;case 3:m.flags=m.flags&-65537|128;case 0:if(m=v.payload,f=typeof m=="function"?m.call(h,d,f):m,f==null)break e;d=fe({},d,f);break e;case 2:bn=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,f=o.effects,f===null?o.effects=[a]:f.push(a))}else h={eventTime:h,lane:f,tag:a.tag,payload:a.payload,callback:a.callback,next:null},c===null?(u=c=h,l=d):c=c.next=h,s|=f;if(a=a.next,a===null){if(a=o.shared.pending,a===null)break;f=a,a=f.next,f.next=null,o.lastBaseUpdate=f,o.shared.pending=null}}while(1);if(c===null&&(l=d),o.baseState=l,o.firstBaseUpdate=u,o.lastBaseUpdate=c,t=o.shared.interleaved,t!==null){o=t;do s|=o.lane,o=o.next;while(o!==t)}else i===null&&(o.shared.lanes=0);cr|=s,e.lanes=s,e.memoizedState=d}}function dh(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],o=r.callback;if(o!==null){if(r.callback=null,r=n,typeof o!="function")throw Error(z(191,o));o.call(r)}}}var fh=new Cf.Component().refs;function ju(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:fe({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var ea={isMounted:function(e){return(e=e._reactInternals)?nr(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=He(),o=Pn(e),i=ln(r,o);i.payload=t,n!=null&&(i.callback=n),t=An(e,i,o),t!==null&&(bt(t,e,o,r),Zs(t,e,o))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=He(),o=Pn(e),i=ln(r,o);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=An(e,i,o),t!==null&&(bt(t,e,o,r),Zs(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=He(),r=Pn(e),o=ln(n,r);o.tag=2,t!=null&&(o.callback=t),t=An(e,o,r),t!==null&&(bt(t,e,r,n),Zs(t,e,r))}};function ph(e,t,n,r,o,i,s){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,i,s):t.prototype&&t.prototype.isPureReactComponent?!ai(n,r)||!ai(o,i):!0}function hh(e,t,n){var r=!1,o=Cn,i=t.contextType;return typeof i=="object"&&i!==null?i=mt(i):(o=Ke(t)?or:ke.current,r=t.contextTypes,i=(r=r!=null)?Jr(e,o):Cn),t=new t(n,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=ea,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=i),t}function gh(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&ea.enqueueReplaceState(t,t.state,null)}function Gu(e,t,n,r){var o=e.stateNode;o.props=n,o.state=e.memoizedState,o.refs=fh,zu(e);var i=t.contextType;typeof i=="object"&&i!==null?o.context=mt(i):(i=Ke(t)?or:ke.current,o.context=Jr(e,i)),o.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(ju(e,t,i,n),o.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof o.getSnapshotBeforeUpdate=="function"||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(t=o.state,typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount(),t!==o.state&&ea.enqueueReplaceState(o,o.state,null),Js(e,n,o,r),o.state=e.memoizedState),typeof o.componentDidMount=="function"&&(e.flags|=4194308)}function hi(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(z(309));var r=n.stateNode}if(!r)throw Error(z(147,e));var o=r,i=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===i?t.ref:(t=function(s){var a=o.refs;a===fh&&(a=o.refs={}),s===null?delete a[i]:a[i]=s},t._stringRef=i,t)}if(typeof e!="string")throw Error(z(284));if(!n._owner)throw Error(z(290,e))}return e}function ta(e,t){throw e=Object.prototype.toString.call(t),Error(z(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function mh(e){var t=e._init;return t(e._payload)}function vh(e){function t(p,g){if(e){var S=p.deletions;S===null?(p.deletions=[g],p.flags|=16):S.push(g)}}function n(p,g){if(!e)return null;for(;g!==null;)t(p,g),g=g.sibling;return null}function r(p,g){for(p=new Map;g!==null;)g.key!==null?p.set(g.key,g):p.set(g.index,g),g=g.sibling;return p}function o(p,g){return p=Un(p,g),p.index=0,p.sibling=null,p}function i(p,g,S){return p.index=S,e?(S=p.alternate,S!==null?(S=S.index,S<g?(p.flags|=2,g):S):(p.flags|=2,g)):(p.flags|=1048576,g)}function s(p){return e&&p.alternate===null&&(p.flags|=2),p}function a(p,g,S,_){return g===null||g.tag!==6?(g=Cc(S,p.mode,_),g.return=p,g):(g=o(g,S),g.return=p,g)}function l(p,g,S,_){var w=S.type;return w===Br?c(p,g,S.props.children,_,S.key):g!==null&&(g.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===yn&&mh(w)===g.type)?(_=o(g,S.props),_.ref=hi(p,g,S),_.return=p,_):(_=Sa(S.type,S.key,S.props,null,p.mode,_),_.ref=hi(p,g,S),_.return=p,_)}function u(p,g,S,_){return g===null||g.tag!==4||g.stateNode.containerInfo!==S.containerInfo||g.stateNode.implementation!==S.implementation?(g=Ic(S,p.mode,_),g.return=p,g):(g=o(g,S.children||[]),g.return=p,g)}function c(p,g,S,_,w){return g===null||g.tag!==7?(g=hr(S,p.mode,_,w),g.return=p,g):(g=o(g,S),g.return=p,g)}function d(p,g,S){if(typeof g=="string"&&g!==""||typeof g=="number")return g=Cc(""+g,p.mode,S),g.return=p,g;if(typeof g=="object"&&g!==null){switch(g.$$typeof){case vs:return S=Sa(g.type,g.key,g.props,null,p.mode,S),S.ref=hi(p,null,g),S.return=p,S;case Vr:return g=Ic(g,p.mode,S),g.return=p,g;case yn:var _=g._init;return d(p,_(g._payload),S)}if(zo(g)||$o(g))return g=hr(g,p.mode,S,null),g.return=p,g;ta(p,g)}return null}function f(p,g,S,_){var w=g!==null?g.key:null;if(typeof S=="string"&&S!==""||typeof S=="number")return w!==null?null:a(p,g,""+S,_);if(typeof S=="object"&&S!==null){switch(S.$$typeof){case vs:return S.key===w?l(p,g,S,_):null;case Vr:return S.key===w?u(p,g,S,_):null;case yn:return w=S._init,f(p,g,w(S._payload),_)}if(zo(S)||$o(S))return w!==null?null:c(p,g,S,_,null);ta(p,S)}return null}function h(p,g,S,_,w){if(typeof _=="string"&&_!==""||typeof _=="number")return p=p.get(S)||null,a(g,p,""+_,w);if(typeof _=="object"&&_!==null){switch(_.$$typeof){case vs:return p=p.get(_.key===null?S:_.key)||null,l(g,p,_,w);case Vr:return p=p.get(_.key===null?S:_.key)||null,u(g,p,_,w);case yn:var R=_._init;return h(p,g,S,R(_._payload),w)}if(zo(_)||$o(_))return p=p.get(S)||null,c(g,p,_,w,null);ta(g,_)}return null}function m(p,g,S,_){for(var w=null,R=null,C=g,L=g=0,B=null;C!==null&&L<S.length;L++){C.index>L?(B=C,C=null):B=C.sibling;var I=f(p,C,S[L],_);if(I===null){C===null&&(C=B);break}e&&C&&I.alternate===null&&t(p,C),g=i(I,g,L),R===null?w=I:R.sibling=I,R=I,C=B}if(L===S.length)return n(p,C),ce&&sr(p,L),w;if(C===null){for(;L<S.length;L++)C=d(p,S[L],_),C!==null&&(g=i(C,g,L),R===null?w=C:R.sibling=C,R=C);return ce&&sr(p,L),w}for(C=r(p,C);L<S.length;L++)B=h(C,p,L,S[L],_),B!==null&&(e&&B.alternate!==null&&C.delete(B.key===null?L:B.key),g=i(B,g,L),R===null?w=B:R.sibling=B,R=B);return e&&C.forEach(function(V){return t(p,V)}),ce&&sr(p,L),w}function v(p,g,S,_){var w=$o(S);if(typeof w!="function")throw Error(z(150));if(S=w.call(S),S==null)throw Error(z(151));for(var R=w=null,C=g,L=g=0,B=null,I=S.next();C!==null&&!I.done;L++,I=S.next()){C.index>L?(B=C,C=null):B=C.sibling;var V=f(p,C,I.value,_);if(V===null){C===null&&(C=B);break}e&&C&&V.alternate===null&&t(p,C),g=i(V,g,L),R===null?w=V:R.sibling=V,R=V,C=B}if(I.done)return n(p,C),ce&&sr(p,L),w;if(C===null){for(;!I.done;L++,I=S.next())I=d(p,I.value,_),I!==null&&(g=i(I,g,L),R===null?w=I:R.sibling=I,R=I);return ce&&sr(p,L),w}for(C=r(p,C);!I.done;L++,I=S.next())I=h(C,p,L,I.value,_),I!==null&&(e&&I.alternate!==null&&C.delete(I.key===null?L:I.key),g=i(I,g,L),R===null?w=I:R.sibling=I,R=I);return e&&C.forEach(function($){return t(p,$)}),ce&&sr(p,L),w}function y(p,g,S,_){if(typeof S=="object"&&S!==null&&S.type===Br&&S.key===null&&(S=S.props.children),typeof S=="object"&&S!==null){switch(S.$$typeof){case vs:e:{for(var w=S.key,R=g;R!==null;){if(R.key===w){if(w=S.type,w===Br){if(R.tag===7){n(p,R.sibling),g=o(R,S.props.children),g.return=p,p=g;break e}}else if(R.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===yn&&mh(w)===R.type){n(p,R.sibling),g=o(R,S.props),g.ref=hi(p,R,S),g.return=p,p=g;break e}n(p,R);break}else t(p,R);R=R.sibling}S.type===Br?(g=hr(S.props.children,p.mode,_,S.key),g.return=p,p=g):(_=Sa(S.type,S.key,S.props,null,p.mode,_),_.ref=hi(p,g,S),_.return=p,p=_)}return s(p);case Vr:e:{for(R=S.key;g!==null;){if(g.key===R)if(g.tag===4&&g.stateNode.containerInfo===S.containerInfo&&g.stateNode.implementation===S.implementation){n(p,g.sibling),g=o(g,S.children||[]),g.return=p,p=g;break e}else{n(p,g);break}else t(p,g);g=g.sibling}g=Ic(S,p.mode,_),g.return=p,p=g}return s(p);case yn:return R=S._init,y(p,g,R(S._payload),_)}if(zo(S))return m(p,g,S,_);if($o(S))return v(p,g,S,_);ta(p,S)}return typeof S=="string"&&S!==""||typeof S=="number"?(S=""+S,g!==null&&g.tag===6?(n(p,g.sibling),g=o(g,S),g.return=p,p=g):(n(p,g),g=Cc(S,p.mode,_),g.return=p,p=g),s(p)):n(p,g)}return y}var io=vh(!0),yh=vh(!1),gi={},$t=Tn(gi),mi=Tn(gi),vi=Tn(gi);function lr(e){if(e===gi)throw Error(z(174));return e}function Yu(e,t){switch(ie(vi,t),ie(mi,e),ie($t,gi),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Gl(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Gl(t,e)}ae($t),ie($t,t)}function so(){ae($t),ae(mi),ae(vi)}function Eh(e){lr(vi.current);var t=lr($t.current),n=Gl(t,e.type);t!==n&&(ie(mi,e),ie($t,n))}function Wu(e){mi.current===e&&(ae($t),ae(mi))}var pe=Tn(0);function na(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Ku=[];function Qu(){for(var e=0;e<Ku.length;e++)Ku[e]._workInProgressVersionPrimary=null;Ku.length=0}var ra=tn.ReactCurrentDispatcher,Xu=tn.ReactCurrentBatchConfig,ur=0,he=null,Ne=null,Ce=null,oa=!1,yi=!1,Ei=0,XS=0;function Pe(){throw Error(z(321))}function qu(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Ot(e[n],t[n]))return!1;return!0}function Zu(e,t,n,r,o,i){if(ur=i,he=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,ra.current=e===null||e.memoizedState===null?e_:t_,e=n(r,o),yi){i=0;do{if(yi=!1,Ei=0,25<=i)throw Error(z(301));i+=1,Ce=Ne=null,t.updateQueue=null,ra.current=n_,e=n(r,o)}while(yi)}if(ra.current=aa,t=Ne!==null&&Ne.next!==null,ur=0,Ce=Ne=he=null,oa=!1,t)throw Error(z(300));return e}function Ju(){var e=Ei!==0;return Ei=0,e}function Ht(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ce===null?he.memoizedState=Ce=e:Ce=Ce.next=e,Ce}function vt(){if(Ne===null){var e=he.alternate;e=e!==null?e.memoizedState:null}else e=Ne.next;var t=Ce===null?he.memoizedState:Ce.next;if(t!==null)Ce=t,Ne=e;else{if(e===null)throw Error(z(310));Ne=e,e={memoizedState:Ne.memoizedState,baseState:Ne.baseState,baseQueue:Ne.baseQueue,queue:Ne.queue,next:null},Ce===null?he.memoizedState=Ce=e:Ce=Ce.next=e}return Ce}function Si(e,t){return typeof t=="function"?t(e):t}function ec(e){var t=vt(),n=t.queue;if(n===null)throw Error(z(311));n.lastRenderedReducer=e;var r=Ne,o=r.baseQueue,i=n.pending;if(i!==null){if(o!==null){var s=o.next;o.next=i.next,i.next=s}r.baseQueue=o=i,n.pending=null}if(o!==null){i=o.next,r=r.baseState;var a=s=null,l=null,u=i;do{var c=u.lane;if((ur&c)===c)l!==null&&(l=l.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),r=u.hasEagerState?u.eagerState:e(r,u.action);else{var d={lane:c,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};l===null?(a=l=d,s=r):l=l.next=d,he.lanes|=c,cr|=c}u=u.next}while(u!==null&&u!==i);l===null?s=r:l.next=a,Ot(r,t.memoizedState)||(Qe=!0),t.memoizedState=r,t.baseState=s,t.baseQueue=l,n.lastRenderedState=r}if(e=n.interleaved,e!==null){o=e;do i=o.lane,he.lanes|=i,cr|=i,o=o.next;while(o!==e)}else o===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function tc(e){var t=vt(),n=t.queue;if(n===null)throw Error(z(311));n.lastRenderedReducer=e;var r=n.dispatch,o=n.pending,i=t.memoizedState;if(o!==null){n.pending=null;var s=o=o.next;do i=e(i,s.action),s=s.next;while(s!==o);Ot(i,t.memoizedState)||(Qe=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function Sh(){}function _h(e,t){var n=he,r=vt(),o=t(),i=!Ot(r.memoizedState,o);if(i&&(r.memoizedState=o,Qe=!0),r=r.queue,nc(Nh.bind(null,n,r,e),[e]),r.getSnapshot!==t||i||Ce!==null&&Ce.memoizedState.tag&1){if(n.flags|=2048,_i(9,Rh.bind(null,n,r,o,t),void 0,null),Ie===null)throw Error(z(349));ur&30||wh(n,t,o)}return o}function wh(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=he.updateQueue,t===null?(t={lastEffect:null,stores:null},he.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Rh(e,t,n,r){t.value=n,t.getSnapshot=r,Oh(t)&&xh(e)}function Nh(e,t,n){return n(function(){Oh(t)&&xh(e)})}function Oh(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Ot(e,n)}catch{return!0}}function xh(e){var t=an(e,1);t!==null&&bt(t,e,1,-1)}function Th(e){var t=Ht();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Si,lastRenderedState:e},t.queue=e,e=e.dispatch=JS.bind(null,he,e),[t.memoizedState,e]}function _i(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=he.updateQueue,t===null?(t={lastEffect:null,stores:null},he.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function Ch(){return vt().memoizedState}function ia(e,t,n,r){var o=Ht();he.flags|=e,o.memoizedState=_i(1|t,n,void 0,r===void 0?null:r)}function sa(e,t,n,r){var o=vt();r=r===void 0?null:r;var i=void 0;if(Ne!==null){var s=Ne.memoizedState;if(i=s.destroy,r!==null&&qu(r,s.deps)){o.memoizedState=_i(t,n,i,r);return}}he.flags|=e,o.memoizedState=_i(1|t,n,i,r)}function Ih(e,t){return ia(8390656,8,e,t)}function nc(e,t){return sa(2048,8,e,t)}function bh(e,t){return sa(4,2,e,t)}function Ah(e,t){return sa(4,4,e,t)}function Lh(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Dh(e,t,n){return n=n!=null?n.concat([e]):null,sa(4,4,Lh.bind(null,t,e),n)}function rc(){}function kh(e,t){var n=vt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&qu(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Ph(e,t){var n=vt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&qu(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Mh(e,t,n){return ur&21?(Ot(n,t)||(n=lp(),he.lanes|=n,cr|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Qe=!0),e.memoizedState=n)}function qS(e,t){var n=re;re=n!==0&&4>n?n:4,e(!0);var r=Xu.transition;Xu.transition={};try{e(!1),t()}finally{re=n,Xu.transition=r}}function Uh(){return vt().memoizedState}function ZS(e,t,n){var r=Pn(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Fh(e))Vh(t,n);else if(n=lh(e,t,n,r),n!==null){var o=He();bt(n,e,r,o),Bh(n,t,r)}}function JS(e,t,n){var r=Pn(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Fh(e))Vh(t,o);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var s=t.lastRenderedState,a=i(s,n);if(o.hasEagerState=!0,o.eagerState=a,Ot(a,s)){var l=t.interleaved;l===null?(o.next=o,Hu(t)):(o.next=l.next,l.next=o),t.interleaved=o;return}}catch{}finally{}n=lh(e,t,o,r),n!==null&&(o=He(),bt(n,e,r,o),Bh(n,t,r))}}function Fh(e){var t=e.alternate;return e===he||t!==null&&t===he}function Vh(e,t){yi=oa=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Bh(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ru(e,n)}}var aa={readContext:mt,useCallback:Pe,useContext:Pe,useEffect:Pe,useImperativeHandle:Pe,useInsertionEffect:Pe,useLayoutEffect:Pe,useMemo:Pe,useReducer:Pe,useRef:Pe,useState:Pe,useDebugValue:Pe,useDeferredValue:Pe,useTransition:Pe,useMutableSource:Pe,useSyncExternalStore:Pe,useId:Pe,unstable_isNewReconciler:!1},e_={readContext:mt,useCallback:function(e,t){return Ht().memoizedState=[e,t===void 0?null:t],e},useContext:mt,useEffect:Ih,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,ia(4194308,4,Lh.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ia(4194308,4,e,t)},useInsertionEffect:function(e,t){return ia(4,2,e,t)},useMemo:function(e,t){var n=Ht();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Ht();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=ZS.bind(null,he,e),[r.memoizedState,e]},useRef:function(e){var t=Ht();return e={current:e},t.memoizedState=e},useState:Th,useDebugValue:rc,useDeferredValue:function(e){return Ht().memoizedState=e},useTransition:function(){var e=Th(!1),t=e[0];return e=qS.bind(null,e[1]),Ht().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=he,o=Ht();if(ce){if(n===void 0)throw Error(z(407));n=n()}else{if(n=t(),Ie===null)throw Error(z(349));ur&30||wh(r,t,n)}o.memoizedState=n;var i={value:n,getSnapshot:t};return o.queue=i,Ih(Nh.bind(null,r,i,e),[e]),r.flags|=2048,_i(9,Rh.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=Ht(),t=Ie.identifierPrefix;if(ce){var n=sn,r=on;n=(r&~(1<<32-Nt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Ei++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=XS++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},t_={readContext:mt,useCallback:kh,useContext:mt,useEffect:nc,useImperativeHandle:Dh,useInsertionEffect:bh,useLayoutEffect:Ah,useMemo:Ph,useReducer:ec,useRef:Ch,useState:function(){return ec(Si)},useDebugValue:rc,useDeferredValue:function(e){var t=vt();return Mh(t,Ne.memoizedState,e)},useTransition:function(){var e=ec(Si)[0],t=vt().memoizedState;return[e,t]},useMutableSource:Sh,useSyncExternalStore:_h,useId:Uh,unstable_isNewReconciler:!1},n_={readContext:mt,useCallback:kh,useContext:mt,useEffect:nc,useImperativeHandle:Dh,useInsertionEffect:bh,useLayoutEffect:Ah,useMemo:Ph,useReducer:tc,useRef:Ch,useState:function(){return tc(Si)},useDebugValue:rc,useDeferredValue:function(e){var t=vt();return Ne===null?t.memoizedState=e:Mh(t,Ne.memoizedState,e)},useTransition:function(){var e=tc(Si)[0],t=vt().memoizedState;return[e,t]},useMutableSource:Sh,useSyncExternalStore:_h,useId:Uh,unstable_isNewReconciler:!1};function ao(e,t){try{var n="",r=t;do n+=bE(r),r=r.return;while(r);var o=n}catch(i){o=`
43
43
  Error generating stack: `+i.message+`
44
- `+i.stack}return{value:e,source:t,stack:o,digest:null}}function oc(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function ic(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var r_=typeof WeakMap=="function"?WeakMap:Map;function Hh(e,t,n){n=ln(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){ha||(ha=!0,Sc=r),ic(e,t)},n}function zh(e,t,n){n=ln(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var o=t.value;n.payload=function(){return r(o)},n.callback=function(){ic(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){ic(e,t),typeof r!="function"&&(Dn===null?Dn=new Set([this]):Dn.add(this));var s=t.stack;this.componentDidCatch(t.value,{componentStack:s!==null?s:""})}),n}function jh(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new r_;var o=new Set;r.set(t,o)}else o=r.get(t),o===void 0&&(o=new Set,r.set(t,o));o.has(n)||(o.add(n),e=v_.bind(null,e,t,n),t.then(e,e))}function Gh(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Yh(e,t,n,r,o){return e.mode&1?(e.flags|=65536,e.lanes=o,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=ln(-1,1),t.tag=2,An(n,t,1))),n.lanes|=1),e)}var o_=tn.ReactCurrentOwner,Qe=!1;function $e(e,t,n,r){t.child=e===null?Eh(t,null,n,r):io(t,e.child,n,r)}function Wh(e,t,n,r,o){n=n.render;var i=t.ref;return oo(t,o),r=Zu(e,t,n,r,i,o),n=Ju(),e!==null&&!Qe?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,un(e,t,o)):(ce&&n&&Du(t),t.flags|=1,$e(e,t,r,o),t.child)}function Kh(e,t,n,r,o){if(e===null){var i=n.type;return typeof i=="function"&&!Tc(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,Qh(e,t,i,r,o)):(e=Sa(n.type,null,r,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!(e.lanes&o)){var s=i.memoizedProps;if(n=n.compare,n=n!==null?n:ai,n(s,r)&&e.ref===t.ref)return un(e,t,o)}return t.flags|=1,e=Un(i,r),e.ref=t.ref,e.return=t,t.child=e}function Qh(e,t,n,r,o){if(e!==null){var i=e.memoizedProps;if(ai(i,r)&&e.ref===t.ref)if(Qe=!1,t.pendingProps=r=i,(e.lanes&o)!==0)e.flags&131072&&(Qe=!0);else return t.lanes=e.lanes,un(e,t,o)}return sc(e,t,n,r,o)}function Xh(e,t,n){var r=t.pendingProps,o=r.children,i=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},ie(uo,lt),lt|=n;else{if(!(n&1073741824))return e=i!==null?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,ie(uo,lt),lt|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,ie(uo,lt),lt|=r}else i!==null?(r=i.baseLanes|n,t.memoizedState=null):r=n,ie(uo,lt),lt|=r;return $e(e,t,o,n),t.child}function qh(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function sc(e,t,n,r,o){var i=Ke(n)?or:ke.current;return i=Jr(t,i),oo(t,o),n=Zu(e,t,n,r,i,o),r=Ju(),e!==null&&!Qe?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,un(e,t,o)):(ce&&r&&Du(t),t.flags|=1,$e(e,t,n,o),t.child)}function Zh(e,t,n,r,o){if(Ke(n)){var i=!0;Gs(t)}else i=!1;if(oo(t,o),t.stateNode===null)ua(e,t),gh(t,n,r),Gu(t,n,r,o),r=!0;else if(e===null){var s=t.stateNode,a=t.memoizedProps;s.props=a;var l=s.context,u=n.contextType;typeof u=="object"&&u!==null?u=mt(u):(u=Ke(n)?or:ke.current,u=Jr(t,u));var c=n.getDerivedStateFromProps,d=typeof c=="function"||typeof s.getSnapshotBeforeUpdate=="function";d||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==r||l!==u)&&mh(t,s,r,u),bn=!1;var f=t.memoizedState;s.state=f,Js(t,r,s,o),l=t.memoizedState,a!==r||f!==l||We.current||bn?(typeof c=="function"&&(ju(t,n,c,r),l=t.memoizedState),(a=bn||hh(t,n,a,r,f,l,u))?(d||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(t.flags|=4194308)):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),s.props=r,s.state=l,s.context=u,r=a):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{s=t.stateNode,ch(e,t),a=t.memoizedProps,u=t.type===t.elementType?a:Tt(t.type,a),s.props=u,d=t.pendingProps,f=s.context,l=n.contextType,typeof l=="object"&&l!==null?l=mt(l):(l=Ke(n)?or:ke.current,l=Jr(t,l));var h=n.getDerivedStateFromProps;(c=typeof h=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==d||f!==l)&&mh(t,s,r,l),bn=!1,f=t.memoizedState,s.state=f,Js(t,r,s,o);var m=t.memoizedState;a!==d||f!==m||We.current||bn?(typeof h=="function"&&(ju(t,n,h,r),m=t.memoizedState),(u=bn||hh(t,n,u,r,f,m,l)||!1)?(c||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(r,m,l),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(r,m,l)),typeof s.componentDidUpdate=="function"&&(t.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof s.componentDidUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=m),s.props=r,s.state=m,s.context=l,r=u):(typeof s.componentDidUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return ac(e,t,n,r,i,o)}function ac(e,t,n,r,o,i){qh(e,t);var s=(t.flags&128)!==0;if(!r&&!s)return o&&nh(t,n,!1),un(e,t,i);r=t.stateNode,o_.current=t;var a=s&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&s?(t.child=io(t,e.child,null,i),t.child=io(t,null,a,i)):$e(e,t,a,i),t.memoizedState=r.state,o&&nh(t,n,!0),t.child}function Jh(e){var t=e.stateNode;t.pendingContext?eh(e,t.pendingContext,t.pendingContext!==t.context):t.context&&eh(e,t.context,!1),Yu(e,t.containerInfo)}function eg(e,t,n,r,o){return no(),Uu(o),t.flags|=256,$e(e,t,n,r),t.child}var lc={dehydrated:null,treeContext:null,retryLane:0};function uc(e){return{baseLanes:e,cachePool:null,transitions:null}}function tg(e,t,n){var r=t.pendingProps,o=pe.current,i=!1,s=(t.flags&128)!==0,a;if((a=s)||(a=e!==null&&e.memoizedState===null?!1:(o&2)!==0),a?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(o|=1),ie(pe,o&1),e===null)return Mu(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(s=r.children,e=r.fallback,i?(r=t.mode,i=t.child,s={mode:"hidden",children:s},!(r&1)&&i!==null?(i.childLanes=0,i.pendingProps=s):i=_a(s,r,0,null),e=hr(e,r,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=uc(n),t.memoizedState=lc,e):cc(t,s));if(o=e.memoizedState,o!==null&&(a=o.dehydrated,a!==null))return i_(e,t,s,r,a,o,n);if(i){i=r.fallback,s=t.mode,o=e.child,a=o.sibling;var l={mode:"hidden",children:r.children};return!(s&1)&&t.child!==o?(r=t.child,r.childLanes=0,r.pendingProps=l,t.deletions=null):(r=Un(o,l),r.subtreeFlags=o.subtreeFlags&14680064),a!==null?i=Un(a,i):(i=hr(i,s,n,null),i.flags|=2),i.return=t,r.return=t,r.sibling=i,t.child=r,r=i,i=t.child,s=e.child.memoizedState,s=s===null?uc(n):{baseLanes:s.baseLanes|n,cachePool:null,transitions:s.transitions},i.memoizedState=s,i.childLanes=e.childLanes&~n,t.memoizedState=lc,r}return i=e.child,e=i.sibling,r=Un(i,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function cc(e,t){return t=_a({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function la(e,t,n,r){return r!==null&&Uu(r),io(t,e.child,null,n),e=cc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function i_(e,t,n,r,o,i,s){if(n)return t.flags&256?(t.flags&=-257,r=oc(Error(z(422))),la(e,t,s,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=r.fallback,o=t.mode,r=_a({mode:"visible",children:r.children},o,0,null),i=hr(i,o,s,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,t.mode&1&&io(t,e.child,null,s),t.child.memoizedState=uc(s),t.memoizedState=lc,i);if(!(t.mode&1))return la(e,t,s,null);if(o.data==="$!"){if(r=o.nextSibling&&o.nextSibling.dataset,r)var a=r.dgst;return r=a,i=Error(z(419)),r=oc(i,r,void 0),la(e,t,s,r)}if(a=(s&e.childLanes)!==0,Qe||a){if(r=Ie,r!==null){switch(s&-s){case 4:o=2;break;case 16:o=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:o=32;break;case 536870912:o=268435456;break;default:o=0}o=o&(r.suspendedLanes|s)?0:o,o!==0&&o!==i.retryLane&&(i.retryLane=o,an(e,o),bt(r,e,o,-1))}return xc(),r=oc(Error(z(421))),la(e,t,s,r)}return o.data==="$?"?(t.flags|=128,t.child=e.child,t=y_.bind(null,e),o._reactRetry=t,null):(e=i.treeContext,at=xn(o.nextSibling),st=t,ce=!0,xt=null,e!==null&&(ht[gt++]=on,ht[gt++]=sn,ht[gt++]=ir,on=e.id,sn=e.overflow,ir=t),t=cc(t,r.children),t.flags|=4096,t)}function ng(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),$u(e.return,t,n)}function dc(e,t,n,r,o){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:o}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=o)}function rg(e,t,n){var r=t.pendingProps,o=r.revealOrder,i=r.tail;if($e(e,t,r.children,n),r=pe.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&ng(e,n,t);else if(e.tag===19)ng(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(ie(pe,r),!(t.mode&1))t.memoizedState=null;else switch(o){case"forwards":for(n=t.child,o=null;n!==null;)e=n.alternate,e!==null&&na(e)===null&&(o=n),n=n.sibling;n=o,n===null?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),dc(t,!1,o,n,i);break;case"backwards":for(n=null,o=t.child,t.child=null;o!==null;){if(e=o.alternate,e!==null&&na(e)===null){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}dc(t,!0,n,null,i);break;case"together":dc(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function ua(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function un(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),cr|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(z(153));if(t.child!==null){for(e=t.child,n=Un(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Un(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function s_(e,t,n){switch(t.tag){case 3:Jh(t),no();break;case 5:Sh(t);break;case 1:Ke(t.type)&&Gs(t);break;case 4:Yu(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,o=t.memoizedProps.value;ie(Xs,r._currentValue),r._currentValue=o;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(ie(pe,pe.current&1),t.flags|=128,null):n&t.child.childLanes?tg(e,t,n):(ie(pe,pe.current&1),e=un(e,t,n),e!==null?e.sibling:null);ie(pe,pe.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return rg(e,t,n);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),ie(pe,pe.current),r)break;return null;case 22:case 23:return t.lanes=0,Xh(e,t,n)}return un(e,t,n)}var og,fc,ig,sg;og=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},fc=function(){},ig=function(e,t,n,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,lr($t.current);var i=null;switch(n){case"input":o=$l(e,o),r=$l(e,r),i=[];break;case"select":o=fe({},o,{value:void 0}),r=fe({},r,{value:void 0}),i=[];break;case"textarea":o=jl(e,o),r=jl(e,r),i=[];break;default:typeof o.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Hs)}Yl(n,r);var s;n=null;for(u in o)if(!r.hasOwnProperty(u)&&o.hasOwnProperty(u)&&o[u]!=null)if(u==="style"){var a=o[u];for(s in a)a.hasOwnProperty(s)&&(n||(n={}),n[s]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(Bo.hasOwnProperty(u)?i||(i=[]):(i=i||[]).push(u,null));for(u in r){var l=r[u];if(a=o!=null?o[u]:void 0,r.hasOwnProperty(u)&&l!==a&&(l!=null||a!=null))if(u==="style")if(a){for(s in a)!a.hasOwnProperty(s)||l&&l.hasOwnProperty(s)||(n||(n={}),n[s]="");for(s in l)l.hasOwnProperty(s)&&a[s]!==l[s]&&(n||(n={}),n[s]=l[s])}else n||(i||(i=[]),i.push(u,n)),n=l;else u==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,a=a?a.__html:void 0,l!=null&&a!==l&&(i=i||[]).push(u,l)):u==="children"?typeof l!="string"&&typeof l!="number"||(i=i||[]).push(u,""+l):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(Bo.hasOwnProperty(u)?(l!=null&&u==="onScroll"&&se("scroll",e),i||a===l||(i=[])):(i=i||[]).push(u,l))}n&&(i=i||[]).push("style",n);var u=i;(t.updateQueue=u)&&(t.flags|=4)}},sg=function(e,t,n,r){n!==r&&(t.flags|=4)};function wi(e,t){if(!ce)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Me(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags&14680064,r|=o.flags&14680064,o.return=e,o=o.sibling;else for(o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags,r|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function a_(e,t,n){var r=t.pendingProps;switch(ku(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Me(t),null;case 1:return Ke(t.type)&&js(),Me(t),null;case 3:return r=t.stateNode,so(),ae(We),ae(ke),Qu(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Qs(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,xt!==null&&(Rc(xt),xt=null))),fc(e,t),Me(t),null;case 5:Wu(t);var o=lr(vi.current);if(n=t.type,e!==null&&t.stateNode!=null)ig(e,t,n,r,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(z(166));return Me(t),null}if(e=lr($t.current),Qs(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[Bt]=t,r[fi]=i,e=(t.mode&1)!==0,n){case"dialog":se("cancel",r),se("close",r);break;case"iframe":case"object":case"embed":se("load",r);break;case"video":case"audio":for(o=0;o<ui.length;o++)se(ui[o],r);break;case"source":se("error",r);break;case"img":case"image":case"link":se("error",r),se("load",r);break;case"details":se("toggle",r);break;case"input":Vf(r,i),se("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},se("invalid",r);break;case"textarea":Hf(r,i),se("invalid",r)}Yl(n,i),o=null;for(var s in i)if(i.hasOwnProperty(s)){var a=i[s];s==="children"?typeof a=="string"?r.textContent!==a&&(i.suppressHydrationWarning!==!0&&$s(r.textContent,a,e),o=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(i.suppressHydrationWarning!==!0&&$s(r.textContent,a,e),o=["children",""+a]):Bo.hasOwnProperty(s)&&a!=null&&s==="onScroll"&&se("scroll",r)}switch(n){case"input":ys(r),$f(r,i,!0);break;case"textarea":ys(r),jf(r);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(r.onclick=Hs)}r=o,t.updateQueue=r,r!==null&&(t.flags|=4)}else{s=o.nodeType===9?o:o.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Gf(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=s.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=s.createElement(n,{is:r.is}):(e=s.createElement(n),n==="select"&&(s=e,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):e=s.createElementNS(e,n),e[Bt]=t,e[fi]=r,og(e,t,!1,!1),t.stateNode=e;e:{switch(s=Wl(n,r),n){case"dialog":se("cancel",e),se("close",e),o=r;break;case"iframe":case"object":case"embed":se("load",e),o=r;break;case"video":case"audio":for(o=0;o<ui.length;o++)se(ui[o],e);o=r;break;case"source":se("error",e),o=r;break;case"img":case"image":case"link":se("error",e),se("load",e),o=r;break;case"details":se("toggle",e),o=r;break;case"input":Vf(e,r),o=$l(e,r),se("invalid",e);break;case"option":o=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},o=fe({},r,{value:void 0}),se("invalid",e);break;case"textarea":Hf(e,r),o=jl(e,r),se("invalid",e);break;default:o=r}Yl(n,o),a=o;for(i in a)if(a.hasOwnProperty(i)){var l=a[i];i==="style"?Kf(e,l):i==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&Yf(e,l)):i==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&jo(e,l):typeof l=="number"&&jo(e,""+l):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(Bo.hasOwnProperty(i)?l!=null&&i==="onScroll"&&se("scroll",e):l!=null&&bl(e,i,l,s))}switch(n){case"input":ys(e),$f(e,r,!1);break;case"textarea":ys(e),jf(e);break;case"option":r.value!=null&&e.setAttribute("value",""+En(r.value));break;case"select":e.multiple=!!r.multiple,i=r.value,i!=null?$r(e,!!r.multiple,i,!1):r.defaultValue!=null&&$r(e,!!r.multiple,r.defaultValue,!0);break;default:typeof o.onClick=="function"&&(e.onclick=Hs)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Me(t),null;case 6:if(e&&t.stateNode!=null)sg(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(z(166));if(n=lr(vi.current),lr($t.current),Qs(t)){if(r=t.stateNode,n=t.memoizedProps,r[Bt]=t,(i=r.nodeValue!==n)&&(e=st,e!==null))switch(e.tag){case 3:$s(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&$s(r.nodeValue,n,(e.mode&1)!==0)}i&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Bt]=t,t.stateNode=r}return Me(t),null;case 13:if(ae(pe),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(ce&&at!==null&&t.mode&1&&!(t.flags&128))lh(),no(),t.flags|=98560,i=!1;else if(i=Qs(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(z(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(z(317));i[Bt]=t}else no(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Me(t),i=!1}else xt!==null&&(Rc(xt),xt=null),i=!0;if(!i)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||pe.current&1?Oe===0&&(Oe=3):xc())),t.updateQueue!==null&&(t.flags|=4),Me(t),null);case 4:return so(),fc(e,t),e===null&&ci(t.stateNode.containerInfo),Me(t),null;case 10:return Bu(t.type._context),Me(t),null;case 17:return Ke(t.type)&&js(),Me(t),null;case 19:if(ae(pe),i=t.memoizedState,i===null)return Me(t),null;if(r=(t.flags&128)!==0,s=i.rendering,s===null)if(r)wi(i,!1);else{if(Oe!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(s=na(e),s!==null){for(t.flags|=128,wi(i,!1),r=s.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)i=n,e=r,i.flags&=14680066,s=i.alternate,s===null?(i.childLanes=0,i.lanes=e,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=s.childLanes,i.lanes=s.lanes,i.child=s.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=s.memoizedProps,i.memoizedState=s.memoizedState,i.updateQueue=s.updateQueue,i.type=s.type,e=s.dependencies,i.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return ie(pe,pe.current&1|2),t.child}e=e.sibling}i.tail!==null&&Ee()>co&&(t.flags|=128,r=!0,wi(i,!1),t.lanes=4194304)}else{if(!r)if(e=na(s),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),wi(i,!0),i.tail===null&&i.tailMode==="hidden"&&!s.alternate&&!ce)return Me(t),null}else 2*Ee()-i.renderingStartTime>co&&n!==1073741824&&(t.flags|=128,r=!0,wi(i,!1),t.lanes=4194304);i.isBackwards?(s.sibling=t.child,t.child=s):(n=i.last,n!==null?n.sibling=s:t.child=s,i.last=s)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=Ee(),t.sibling=null,n=pe.current,ie(pe,r?n&1|2:n&1),t):(Me(t),null);case 22:case 23:return Oc(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?lt&1073741824&&(Me(t),t.subtreeFlags&6&&(t.flags|=8192)):Me(t),null;case 24:return null;case 25:return null}throw Error(z(156,t.tag))}function l_(e,t){switch(ku(t),t.tag){case 1:return Ke(t.type)&&js(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return so(),ae(We),ae(ke),Qu(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Wu(t),null;case 13:if(ae(pe),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(z(340));no()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ae(pe),null;case 4:return so(),null;case 10:return Bu(t.type._context),null;case 22:case 23:return Oc(),null;case 24:return null;default:return null}}var ca=!1,Ue=!1,u_=typeof WeakSet=="function"?WeakSet:Set,G=null;function lo(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){ye(e,t,r)}else n.current=null}function pc(e,t,n){try{n()}catch(r){ye(e,t,r)}}var ag=!1;function c_(e,t){if(Ou=bs,e=Fp(),vu(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var o=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var s=0,a=-1,l=-1,u=0,c=0,d=e,f=null;t:for(;;){for(var h;d!==n||o!==0&&d.nodeType!==3||(a=s+o),d!==i||r!==0&&d.nodeType!==3||(l=s+r),d.nodeType===3&&(s+=d.nodeValue.length),(h=d.firstChild)!==null;)f=d,d=h;for(;;){if(d===e)break t;if(f===n&&++u===o&&(a=s),f===i&&++c===r&&(l=s),(h=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=h}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(xu={focusedElem:e,selectionRange:n},bs=!1,G=t;G!==null;)if(t=G,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,G=e;else for(;G!==null;){t=G;try{var m=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(m!==null){var v=m.memoizedProps,y=m.memoizedState,p=t.stateNode,g=p.getSnapshotBeforeUpdate(t.elementType===t.type?v:Tt(t.type,v),y);p.__reactInternalSnapshotBeforeUpdate=g}break;case 3:var S=t.stateNode.containerInfo;S.nodeType===1?S.textContent="":S.nodeType===9&&S.documentElement&&S.removeChild(S.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(z(163))}}catch(_){ye(t,t.return,_)}if(e=t.sibling,e!==null){e.return=t.return,G=e;break}G=t.return}return m=ag,ag=!1,m}function Ri(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var o=r=r.next;do{if((o.tag&e)===e){var i=o.destroy;o.destroy=void 0,i!==void 0&&pc(t,n,i)}o=o.next}while(o!==r)}}function da(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function hc(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function lg(e){var t=e.alternate;t!==null&&(e.alternate=null,lg(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Bt],delete t[fi],delete t[bu],delete t[YS],delete t[WS])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function ug(e){return e.tag===5||e.tag===3||e.tag===4}function cg(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||ug(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function gc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Hs));else if(r!==4&&(e=e.child,e!==null))for(gc(e,t,n),e=e.sibling;e!==null;)gc(e,t,n),e=e.sibling}function mc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(mc(e,t,n),e=e.sibling;e!==null;)mc(e,t,n),e=e.sibling}var Le=null,Ct=!1;function Ln(e,t,n){for(n=n.child;n!==null;)dg(e,t,n),n=n.sibling}function dg(e,t,n){if(Vt&&typeof Vt.onCommitFiberUnmount=="function")try{Vt.onCommitFiberUnmount(Ns,n)}catch{}switch(n.tag){case 5:Ue||lo(n,t);case 6:var r=Le,o=Ct;Le=null,Ln(e,t,n),Le=r,Ct=o,Le!==null&&(Ct?(e=Le,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Le.removeChild(n.stateNode));break;case 18:Le!==null&&(Ct?(e=Le,n=n.stateNode,e.nodeType===8?Iu(e.parentNode,n):e.nodeType===1&&Iu(e,n),ti(e)):Iu(Le,n.stateNode));break;case 4:r=Le,o=Ct,Le=n.stateNode.containerInfo,Ct=!0,Ln(e,t,n),Le=r,Ct=o;break;case 0:case 11:case 14:case 15:if(!Ue&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var i=o,s=i.destroy;i=i.tag,s!==void 0&&(i&2||i&4)&&pc(n,t,s),o=o.next}while(o!==r)}Ln(e,t,n);break;case 1:if(!Ue&&(lo(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){ye(n,t,a)}Ln(e,t,n);break;case 21:Ln(e,t,n);break;case 22:n.mode&1?(Ue=(r=Ue)||n.memoizedState!==null,Ln(e,t,n),Ue=r):Ln(e,t,n);break;default:Ln(e,t,n)}}function fg(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new u_),t.forEach(function(r){var o=E_.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function It(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var o=n[r];try{var i=e,s=t,a=s;e:for(;a!==null;){switch(a.tag){case 5:Le=a.stateNode,Ct=!1;break e;case 3:Le=a.stateNode.containerInfo,Ct=!0;break e;case 4:Le=a.stateNode.containerInfo,Ct=!0;break e}a=a.return}if(Le===null)throw Error(z(160));dg(i,s,o),Le=null,Ct=!1;var l=o.alternate;l!==null&&(l.return=null),o.return=null}catch(u){ye(o,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)pg(t,e),t=t.sibling}function pg(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(It(t,e),zt(e),r&4){try{Ri(3,e,e.return),da(3,e)}catch(v){ye(e,e.return,v)}try{Ri(5,e,e.return)}catch(v){ye(e,e.return,v)}}break;case 1:It(t,e),zt(e),r&512&&n!==null&&lo(n,n.return);break;case 5:if(It(t,e),zt(e),r&512&&n!==null&&lo(n,n.return),e.flags&32){var o=e.stateNode;try{jo(o,"")}catch(v){ye(e,e.return,v)}}if(r&4&&(o=e.stateNode,o!=null)){var i=e.memoizedProps,s=n!==null?n.memoizedProps:i,a=e.type,l=e.updateQueue;if(e.updateQueue=null,l!==null)try{a==="input"&&i.type==="radio"&&i.name!=null&&Bf(o,i),Wl(a,s);var u=Wl(a,i);for(s=0;s<l.length;s+=2){var c=l[s],d=l[s+1];c==="style"?Kf(o,d):c==="dangerouslySetInnerHTML"?Yf(o,d):c==="children"?jo(o,d):bl(o,c,d,u)}switch(a){case"input":Hl(o,i);break;case"textarea":zf(o,i);break;case"select":var f=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!i.multiple;var h=i.value;h!=null?$r(o,!!i.multiple,h,!1):f!==!!i.multiple&&(i.defaultValue!=null?$r(o,!!i.multiple,i.defaultValue,!0):$r(o,!!i.multiple,i.multiple?[]:"",!1))}o[fi]=i}catch(v){ye(e,e.return,v)}}break;case 6:if(It(t,e),zt(e),r&4){if(e.stateNode===null)throw Error(z(162));o=e.stateNode,i=e.memoizedProps;try{o.nodeValue=i}catch(v){ye(e,e.return,v)}}break;case 3:if(It(t,e),zt(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{ti(t.containerInfo)}catch(v){ye(e,e.return,v)}break;case 4:It(t,e),zt(e);break;case 13:It(t,e),zt(e),o=e.child,o.flags&8192&&(i=o.memoizedState!==null,o.stateNode.isHidden=i,!i||o.alternate!==null&&o.alternate.memoizedState!==null||(Ec=Ee())),r&4&&fg(e);break;case 22:if(c=n!==null&&n.memoizedState!==null,e.mode&1?(Ue=(u=Ue)||c,It(t,e),Ue=u):It(t,e),zt(e),r&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!c&&e.mode&1)for(G=e,c=e.child;c!==null;){for(d=G=c;G!==null;){switch(f=G,h=f.child,f.tag){case 0:case 11:case 14:case 15:Ri(4,f,f.return);break;case 1:lo(f,f.return);var m=f.stateNode;if(typeof m.componentWillUnmount=="function"){r=f,n=f.return;try{t=r,m.props=t.memoizedProps,m.state=t.memoizedState,m.componentWillUnmount()}catch(v){ye(r,n,v)}}break;case 5:lo(f,f.return);break;case 22:if(f.memoizedState!==null){mg(d);continue}}h!==null?(h.return=f,G=h):mg(d)}c=c.sibling}e:for(c=null,d=e;;){if(d.tag===5){if(c===null){c=d;try{o=d.stateNode,u?(i=o.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(a=d.stateNode,l=d.memoizedProps.style,s=l!=null&&l.hasOwnProperty("display")?l.display:null,a.style.display=Wf("display",s))}catch(v){ye(e,e.return,v)}}}else if(d.tag===6){if(c===null)try{d.stateNode.nodeValue=u?"":d.memoizedProps}catch(v){ye(e,e.return,v)}}else if((d.tag!==22&&d.tag!==23||d.memoizedState===null||d===e)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===e)break e;for(;d.sibling===null;){if(d.return===null||d.return===e)break e;c===d&&(c=null),d=d.return}c===d&&(c=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:It(t,e),zt(e),r&4&&fg(e);break;case 21:break;default:It(t,e),zt(e)}}function zt(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(ug(n)){var r=n;break e}n=n.return}throw Error(z(160))}switch(r.tag){case 5:var o=r.stateNode;r.flags&32&&(jo(o,""),r.flags&=-33);var i=cg(e);mc(e,i,o);break;case 3:case 4:var s=r.stateNode.containerInfo,a=cg(e);gc(e,a,s);break;default:throw Error(z(161))}}catch(l){ye(e,e.return,l)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function d_(e,t,n){G=e,hg(e)}function hg(e,t,n){for(var r=(e.mode&1)!==0;G!==null;){var o=G,i=o.child;if(o.tag===22&&r){var s=o.memoizedState!==null||ca;if(!s){var a=o.alternate,l=a!==null&&a.memoizedState!==null||Ue;a=ca;var u=Ue;if(ca=s,(Ue=l)&&!u)for(G=o;G!==null;)s=G,l=s.child,s.tag===22&&s.memoizedState!==null?vg(o):l!==null?(l.return=s,G=l):vg(o);for(;i!==null;)G=i,hg(i),i=i.sibling;G=o,ca=a,Ue=u}gg(e)}else o.subtreeFlags&8772&&i!==null?(i.return=o,G=i):gg(e)}}function gg(e){for(;G!==null;){var t=G;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Ue||da(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Ue)if(n===null)r.componentDidMount();else{var o=t.elementType===t.type?n.memoizedProps:Tt(t.type,n.memoizedProps);r.componentDidUpdate(o,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&fh(t,i,r);break;case 3:var s=t.updateQueue;if(s!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}fh(t,s,n)}break;case 5:var a=t.stateNode;if(n===null&&t.flags&4){n=a;var l=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&n.focus();break;case"img":l.src&&(n.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var c=u.memoizedState;if(c!==null){var d=c.dehydrated;d!==null&&ti(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(z(163))}Ue||t.flags&512&&hc(t)}catch(f){ye(t,t.return,f)}}if(t===e){G=null;break}if(n=t.sibling,n!==null){n.return=t.return,G=n;break}G=t.return}}function mg(e){for(;G!==null;){var t=G;if(t===e){G=null;break}var n=t.sibling;if(n!==null){n.return=t.return,G=n;break}G=t.return}}function vg(e){for(;G!==null;){var t=G;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{da(4,t)}catch(l){ye(t,n,l)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var o=t.return;try{r.componentDidMount()}catch(l){ye(t,o,l)}}var i=t.return;try{hc(t)}catch(l){ye(t,i,l)}break;case 5:var s=t.return;try{hc(t)}catch(l){ye(t,s,l)}}}catch(l){ye(t,t.return,l)}if(t===e){G=null;break}var a=t.sibling;if(a!==null){a.return=t.return,G=a;break}G=t.return}}var f_=Math.ceil,fa=tn.ReactCurrentDispatcher,vc=tn.ReactCurrentOwner,yt=tn.ReactCurrentBatchConfig,ne=0,Ie=null,_e=null,De=0,lt=0,uo=Tn(0),Oe=0,Ni=null,cr=0,pa=0,yc=0,Oi=null,Xe=null,Ec=0,co=1/0,cn=null,ha=!1,Sc=null,Dn=null,ga=!1,kn=null,ma=0,xi=0,_c=null,va=-1,ya=0;function He(){return ne&6?Ee():va!==-1?va:va=Ee()}function Pn(e){return e.mode&1?ne&2&&De!==0?De&-De:QS.transition!==null?(ya===0&&(ya=up()),ya):(e=re,e!==0||(e=window.event,e=e===void 0?16:yp(e.type)),e):1}function bt(e,t,n,r){if(50<xi)throw xi=0,_c=null,Error(z(185));Xo(e,n,r),(!(ne&2)||e!==Ie)&&(e===Ie&&(!(ne&2)&&(pa|=n),Oe===4&&Mn(e,De)),qe(e,r),n===1&&ne===0&&!(t.mode&1)&&(co=Ee()+500,Ys&&In()))}function qe(e,t){var n=e.callbackNode;QE(e,t);var r=Ts(e,e===Ie?De:0);if(r===0)n!==null&&sp(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&sp(n),t===1)e.tag===0?KS(Eg.bind(null,e)):rh(Eg.bind(null,e)),jS(function(){!(ne&6)&&In()}),n=null;else{switch(cp(r)){case 1:n=eu;break;case 4:n=ap;break;case 16:n=Rs;break;case 536870912:n=lp;break;default:n=Rs}n=Tg(n,yg.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function yg(e,t){if(va=-1,ya=0,ne&6)throw Error(z(327));var n=e.callbackNode;if(fo()&&e.callbackNode!==n)return null;var r=Ts(e,e===Ie?De:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Ea(e,r);else{t=r;var o=ne;ne|=2;var i=_g();(Ie!==e||De!==t)&&(cn=null,co=Ee()+500,fr(e,t));do try{g_();break}catch(a){Sg(e,a)}while(1);Vu(),fa.current=i,ne=o,_e!==null?t=0:(Ie=null,De=0,t=Oe)}if(t!==0){if(t===2&&(o=tu(e),o!==0&&(r=o,t=wc(e,o))),t===1)throw n=Ni,fr(e,0),Mn(e,r),qe(e,Ee()),n;if(t===6)Mn(e,r);else{if(o=e.current.alternate,!(r&30)&&!p_(o)&&(t=Ea(e,r),t===2&&(i=tu(e),i!==0&&(r=i,t=wc(e,i))),t===1))throw n=Ni,fr(e,0),Mn(e,r),qe(e,Ee()),n;switch(e.finishedWork=o,e.finishedLanes=r,t){case 0:case 1:throw Error(z(345));case 2:pr(e,Xe,cn);break;case 3:if(Mn(e,r),(r&130023424)===r&&(t=Ec+500-Ee(),10<t)){if(Ts(e,0)!==0)break;if(o=e.suspendedLanes,(o&r)!==r){He(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=Cu(pr.bind(null,e,Xe,cn),t);break}pr(e,Xe,cn);break;case 4:if(Mn(e,r),(r&4194240)===r)break;for(t=e.eventTimes,o=-1;0<r;){var s=31-Nt(r);i=1<<s,s=t[s],s>o&&(o=s),r&=~i}if(r=o,r=Ee()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*f_(r/1960))-r,10<r){e.timeoutHandle=Cu(pr.bind(null,e,Xe,cn),r);break}pr(e,Xe,cn);break;case 5:pr(e,Xe,cn);break;default:throw Error(z(329))}}}return qe(e,Ee()),e.callbackNode===n?yg.bind(null,e):null}function wc(e,t){var n=Oi;return e.current.memoizedState.isDehydrated&&(fr(e,t).flags|=256),e=Ea(e,t),e!==2&&(t=Xe,Xe=n,t!==null&&Rc(t)),e}function Rc(e){Xe===null?Xe=e:Xe.push.apply(Xe,e)}function p_(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var o=n[r],i=o.getSnapshot;o=o.value;try{if(!Ot(i(),o))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Mn(e,t){for(t&=~yc,t&=~pa,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Nt(t),r=1<<n;e[n]=-1,t&=~r}}function Eg(e){if(ne&6)throw Error(z(327));fo();var t=Ts(e,0);if(!(t&1))return qe(e,Ee()),null;var n=Ea(e,t);if(e.tag!==0&&n===2){var r=tu(e);r!==0&&(t=r,n=wc(e,r))}if(n===1)throw n=Ni,fr(e,0),Mn(e,t),qe(e,Ee()),n;if(n===6)throw Error(z(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,pr(e,Xe,cn),qe(e,Ee()),null}function Nc(e,t){var n=ne;ne|=1;try{return e(t)}finally{ne=n,ne===0&&(co=Ee()+500,Ys&&In())}}function dr(e){kn!==null&&kn.tag===0&&!(ne&6)&&fo();var t=ne;ne|=1;var n=yt.transition,r=re;try{if(yt.transition=null,re=1,e)return e()}finally{re=r,yt.transition=n,ne=t,!(ne&6)&&In()}}function Oc(){lt=uo.current,ae(uo)}function fr(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,zS(n)),_e!==null)for(n=_e.return;n!==null;){var r=n;switch(ku(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&js();break;case 3:so(),ae(We),ae(ke),Qu();break;case 5:Wu(r);break;case 4:so();break;case 13:ae(pe);break;case 19:ae(pe);break;case 10:Bu(r.type._context);break;case 22:case 23:Oc()}n=n.return}if(Ie=e,_e=e=Un(e.current,null),De=lt=t,Oe=0,Ni=null,yc=pa=cr=0,Xe=Oi=null,ar!==null){for(t=0;t<ar.length;t++)if(n=ar[t],r=n.interleaved,r!==null){n.interleaved=null;var o=r.next,i=n.pending;if(i!==null){var s=i.next;i.next=o,r.next=s}n.pending=r}ar=null}return e}function Sg(e,t){do{var n=_e;try{if(Vu(),ra.current=aa,oa){for(var r=he.memoizedState;r!==null;){var o=r.queue;o!==null&&(o.pending=null),r=r.next}oa=!1}if(ur=0,Ce=Ne=he=null,yi=!1,Ei=0,vc.current=null,n===null||n.return===null){Oe=1,Ni=t,_e=null;break}e:{var i=e,s=n.return,a=n,l=t;if(t=De,a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var u=l,c=a,d=c.tag;if(!(c.mode&1)&&(d===0||d===11||d===15)){var f=c.alternate;f?(c.updateQueue=f.updateQueue,c.memoizedState=f.memoizedState,c.lanes=f.lanes):(c.updateQueue=null,c.memoizedState=null)}var h=Gh(s);if(h!==null){h.flags&=-257,Yh(h,s,a,i,t),h.mode&1&&jh(i,u,t),t=h,l=u;var m=t.updateQueue;if(m===null){var v=new Set;v.add(l),t.updateQueue=v}else m.add(l);break e}else{if(!(t&1)){jh(i,u,t),xc();break e}l=Error(z(426))}}else if(ce&&a.mode&1){var y=Gh(s);if(y!==null){!(y.flags&65536)&&(y.flags|=256),Yh(y,s,a,i,t),Uu(ao(l,a));break e}}i=l=ao(l,a),Oe!==4&&(Oe=2),Oi===null?Oi=[i]:Oi.push(i),i=s;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var p=Hh(i,l,t);dh(i,p);break e;case 1:a=l;var g=i.type,S=i.stateNode;if(!(i.flags&128)&&(typeof g.getDerivedStateFromError=="function"||S!==null&&typeof S.componentDidCatch=="function"&&(Dn===null||!Dn.has(S)))){i.flags|=65536,t&=-t,i.lanes|=t;var _=zh(i,a,t);dh(i,_);break e}}i=i.return}while(i!==null)}Rg(n)}catch(w){t=w,_e===n&&n!==null&&(_e=n=n.return);continue}break}while(1)}function _g(){var e=fa.current;return fa.current=aa,e===null?aa:e}function xc(){(Oe===0||Oe===3||Oe===2)&&(Oe=4),Ie===null||!(cr&268435455)&&!(pa&268435455)||Mn(Ie,De)}function Ea(e,t){var n=ne;ne|=2;var r=_g();(Ie!==e||De!==t)&&(cn=null,fr(e,t));do try{h_();break}catch(o){Sg(e,o)}while(1);if(Vu(),ne=n,fa.current=r,_e!==null)throw Error(z(261));return Ie=null,De=0,Oe}function h_(){for(;_e!==null;)wg(_e)}function g_(){for(;_e!==null&&!BE();)wg(_e)}function wg(e){var t=xg(e.alternate,e,lt);e.memoizedProps=e.pendingProps,t===null?Rg(e):_e=t,vc.current=null}function Rg(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=l_(n,t),n!==null){n.flags&=32767,_e=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Oe=6,_e=null;return}}else if(n=a_(n,t,lt),n!==null){_e=n;return}if(t=t.sibling,t!==null){_e=t;return}_e=t=e}while(t!==null);Oe===0&&(Oe=5)}function pr(e,t,n){var r=re,o=yt.transition;try{yt.transition=null,re=1,m_(e,t,n,r)}finally{yt.transition=o,re=r}return null}function m_(e,t,n,r){do fo();while(kn!==null);if(ne&6)throw Error(z(327));n=e.finishedWork;var o=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(z(177));e.callbackNode=null,e.callbackPriority=0;var i=n.lanes|n.childLanes;if(XE(e,i),e===Ie&&(_e=Ie=null,De=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||ga||(ga=!0,Tg(Rs,function(){return fo(),null})),i=(n.flags&15990)!==0,n.subtreeFlags&15990||i){i=yt.transition,yt.transition=null;var s=re;re=1;var a=ne;ne|=4,vc.current=null,c_(e,n),pg(n,e),MS(xu),bs=!!Ou,xu=Ou=null,e.current=n,d_(n),$E(),ne=a,re=s,yt.transition=i}else e.current=n;if(ga&&(ga=!1,kn=e,ma=o),i=e.pendingLanes,i===0&&(Dn=null),jE(n.stateNode),qe(e,Ee()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)o=t[n],r(o.value,{componentStack:o.stack,digest:o.digest});if(ha)throw ha=!1,e=Sc,Sc=null,e;return ma&1&&e.tag!==0&&fo(),i=e.pendingLanes,i&1?e===_c?xi++:(xi=0,_c=e):xi=0,In(),null}function fo(){if(kn!==null){var e=cp(ma),t=yt.transition,n=re;try{if(yt.transition=null,re=16>e?16:e,kn===null)var r=!1;else{if(e=kn,kn=null,ma=0,ne&6)throw Error(z(331));var o=ne;for(ne|=4,G=e.current;G!==null;){var i=G,s=i.child;if(G.flags&16){var a=i.deletions;if(a!==null){for(var l=0;l<a.length;l++){var u=a[l];for(G=u;G!==null;){var c=G;switch(c.tag){case 0:case 11:case 15:Ri(8,c,i)}var d=c.child;if(d!==null)d.return=c,G=d;else for(;G!==null;){c=G;var f=c.sibling,h=c.return;if(lg(c),c===u){G=null;break}if(f!==null){f.return=h,G=f;break}G=h}}}var m=i.alternate;if(m!==null){var v=m.child;if(v!==null){m.child=null;do{var y=v.sibling;v.sibling=null,v=y}while(v!==null)}}G=i}}if(i.subtreeFlags&2064&&s!==null)s.return=i,G=s;else e:for(;G!==null;){if(i=G,i.flags&2048)switch(i.tag){case 0:case 11:case 15:Ri(9,i,i.return)}var p=i.sibling;if(p!==null){p.return=i.return,G=p;break e}G=i.return}}var g=e.current;for(G=g;G!==null;){s=G;var S=s.child;if(s.subtreeFlags&2064&&S!==null)S.return=s,G=S;else e:for(s=g;G!==null;){if(a=G,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:da(9,a)}}catch(w){ye(a,a.return,w)}if(a===s){G=null;break e}var _=a.sibling;if(_!==null){_.return=a.return,G=_;break e}G=a.return}}if(ne=o,In(),Vt&&typeof Vt.onPostCommitFiberRoot=="function")try{Vt.onPostCommitFiberRoot(Ns,e)}catch{}r=!0}return r}finally{re=n,yt.transition=t}}return!1}function Ng(e,t,n){t=ao(n,t),t=Hh(e,t,1),e=An(e,t,1),t=He(),e!==null&&(Xo(e,1,t),qe(e,t))}function ye(e,t,n){if(e.tag===3)Ng(e,e,n);else for(;t!==null;){if(t.tag===3){Ng(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Dn===null||!Dn.has(r))){e=ao(n,e),e=zh(t,e,1),t=An(t,e,1),e=He(),t!==null&&(Xo(t,1,e),qe(t,e));break}}t=t.return}}function v_(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=He(),e.pingedLanes|=e.suspendedLanes&n,Ie===e&&(De&n)===n&&(Oe===4||Oe===3&&(De&130023424)===De&&500>Ee()-Ec?fr(e,0):yc|=n),qe(e,t)}function Og(e,t){t===0&&(e.mode&1?(t=xs,xs<<=1,!(xs&130023424)&&(xs=4194304)):t=1);var n=He();e=an(e,t),e!==null&&(Xo(e,t,n),qe(e,n))}function y_(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Og(e,n)}function E_(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(z(314))}r!==null&&r.delete(t),Og(e,n)}var xg;xg=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||We.current)Qe=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Qe=!1,s_(e,t,n);Qe=!!(e.flags&131072)}else Qe=!1,ce&&t.flags&1048576&&oh(t,Ks,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;ua(e,t),e=t.pendingProps;var o=Jr(t,ke.current);oo(t,n),o=Zu(null,t,r,e,o,n);var i=Ju();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Ke(r)?(i=!0,Gs(t)):i=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,zu(t),o.updater=ea,t.stateNode=o,o._reactInternals=t,Gu(t,r,e,n),t=ac(null,t,r,!0,i,n)):(t.tag=0,ce&&i&&Du(t),$e(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(ua(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=__(r),e=Tt(r,e),o){case 0:t=sc(null,t,r,e,n);break e;case 1:t=Zh(null,t,r,e,n);break e;case 11:t=Wh(null,t,r,e,n);break e;case 14:t=Kh(null,t,r,Tt(r.type,e),n);break e}throw Error(z(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Tt(r,o),sc(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Tt(r,o),Zh(e,t,r,o,n);case 3:e:{if(Jh(t),e===null)throw Error(z(387));r=t.pendingProps,i=t.memoizedState,o=i.element,ch(e,t),Js(t,r,null,n);var s=t.memoizedState;if(r=s.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){o=ao(Error(z(423)),t),t=eg(e,t,r,n,o);break e}else if(r!==o){o=ao(Error(z(424)),t),t=eg(e,t,r,n,o);break e}else for(at=xn(t.stateNode.containerInfo.firstChild),st=t,ce=!0,xt=null,n=Eh(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(no(),r===o){t=un(e,t,n);break e}$e(e,t,r,n)}t=t.child}return t;case 5:return Sh(t),e===null&&Mu(t),r=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,s=o.children,Tu(r,o)?s=null:i!==null&&Tu(r,i)&&(t.flags|=32),qh(e,t),$e(e,t,s,n),t.child;case 6:return e===null&&Mu(t),null;case 13:return tg(e,t,n);case 4:return Yu(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=io(t,null,r,n):$e(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Tt(r,o),Wh(e,t,r,o,n);case 7:return $e(e,t,t.pendingProps,n),t.child;case 8:return $e(e,t,t.pendingProps.children,n),t.child;case 12:return $e(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,i=t.memoizedProps,s=o.value,ie(Xs,r._currentValue),r._currentValue=s,i!==null)if(Ot(i.value,s)){if(i.children===o.children&&!We.current){t=un(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var a=i.dependencies;if(a!==null){s=i.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(i.tag===1){l=ln(-1,n&-n),l.tag=2;var u=i.updateQueue;if(u!==null){u=u.shared;var c=u.pending;c===null?l.next=l:(l.next=c.next,c.next=l),u.pending=l}}i.lanes|=n,l=i.alternate,l!==null&&(l.lanes|=n),$u(i.return,n,t),a.lanes|=n;break}l=l.next}}else if(i.tag===10)s=i.type===t.type?null:i.child;else if(i.tag===18){if(s=i.return,s===null)throw Error(z(341));s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),$u(s,n,t),s=i.sibling}else s=i.child;if(s!==null)s.return=i;else for(s=i;s!==null;){if(s===t){s=null;break}if(i=s.sibling,i!==null){i.return=s.return,s=i;break}s=s.return}i=s}$e(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,oo(t,n),o=mt(o),r=r(o),t.flags|=1,$e(e,t,r,n),t.child;case 14:return r=t.type,o=Tt(r,t.pendingProps),o=Tt(r.type,o),Kh(e,t,r,o,n);case 15:return Qh(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Tt(r,o),ua(e,t),t.tag=1,Ke(r)?(e=!0,Gs(t)):e=!1,oo(t,n),gh(t,r,o),Gu(t,r,o,n),ac(null,t,r,!0,e,n);case 19:return rg(e,t,n);case 22:return Xh(e,t,n)}throw Error(z(156,t.tag))};function Tg(e,t){return ip(e,t)}function S_(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Et(e,t,n,r){return new S_(e,t,n,r)}function Tc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function __(e){if(typeof e=="function")return Tc(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Dl)return 11;if(e===Ml)return 14}return 2}function Un(e,t){var n=e.alternate;return n===null?(n=Et(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Sa(e,t,n,r,o,i){var s=2;if(r=e,typeof e=="function")Tc(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case Br:return hr(n.children,o,i,t);case Al:s=8,o|=8;break;case Ll:return e=Et(12,n,t,o|2),e.elementType=Ll,e.lanes=i,e;case kl:return e=Et(13,n,t,o),e.elementType=kl,e.lanes=i,e;case Pl:return e=Et(19,n,t,o),e.elementType=Pl,e.lanes=i,e;case Pf:return _a(n,o,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Df:s=10;break e;case kf:s=9;break e;case Dl:s=11;break e;case Ml:s=14;break e;case yn:s=16,r=null;break e}throw Error(z(130,e==null?e:typeof e,""))}return t=Et(s,n,t,o),t.elementType=e,t.type=r,t.lanes=i,t}function hr(e,t,n,r){return e=Et(7,e,r,t),e.lanes=n,e}function _a(e,t,n,r){return e=Et(22,e,r,t),e.elementType=Pf,e.lanes=n,e.stateNode={isHidden:!1},e}function Cc(e,t,n){return e=Et(6,e,null,t),e.lanes=n,e}function Ic(e,t,n){return t=Et(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function w_(e,t,n,r,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=nu(0),this.expirationTimes=nu(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=nu(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function bc(e,t,n,r,o,i,s,a,l){return e=new w_(e,t,n,a,l),t===1?(t=1,i===!0&&(t|=8)):t=0,i=Et(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},zu(i),e}function R_(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Vr,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function Cg(e){if(!e)return Cn;e=e._reactInternals;e:{if(nr(e)!==e||e.tag!==1)throw Error(z(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Ke(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(z(171))}if(e.tag===1){var n=e.type;if(Ke(n))return th(e,n,t)}return t}function Ig(e,t,n,r,o,i,s,a,l){return e=bc(n,r,!0,e,o,i,s,a,l),e.context=Cg(null),n=e.current,r=He(),o=Pn(n),i=ln(r,o),i.callback=t??null,An(n,i,o),e.current.lanes=o,Xo(e,o,r),qe(e,r),e}function wa(e,t,n,r){var o=t.current,i=He(),s=Pn(o);return n=Cg(n),t.context===null?t.context=n:t.pendingContext=n,t=ln(i,s),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=An(o,t,s),e!==null&&(bt(e,o,s,i),Zs(e,o,s)),s}function Ra(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function bg(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Ac(e,t){bg(e,t),(e=e.alternate)&&bg(e,t)}function N_(){return null}var Ag=typeof reportError=="function"?reportError:function(e){console.error(e)};function Lc(e){this._internalRoot=e}Na.prototype.render=Lc.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(z(409));wa(e,t,null,null)},Na.prototype.unmount=Lc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;dr(function(){wa(null,e,null,null)}),t[nn]=null}};function Na(e){this._internalRoot=e}Na.prototype.unstable_scheduleHydration=function(e){if(e){var t=pp();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Rn.length&&t!==0&&t<Rn[n].priority;n++);Rn.splice(n,0,e),n===0&&mp(e)}};function Dc(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Oa(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Lg(){}function O_(e,t,n,r,o){if(o){if(typeof r=="function"){var i=r;r=function(){var u=Ra(s);i.call(u)}}var s=Ig(t,r,e,0,null,!1,!1,"",Lg);return e._reactRootContainer=s,e[nn]=s.current,ci(e.nodeType===8?e.parentNode:e),dr(),s}for(;o=e.lastChild;)e.removeChild(o);if(typeof r=="function"){var a=r;r=function(){var u=Ra(l);a.call(u)}}var l=bc(e,0,!1,null,null,!1,!1,"",Lg);return e._reactRootContainer=l,e[nn]=l.current,ci(e.nodeType===8?e.parentNode:e),dr(function(){wa(t,l,n,r)}),l}function xa(e,t,n,r,o){var i=n._reactRootContainer;if(i){var s=i;if(typeof o=="function"){var a=o;o=function(){var l=Ra(s);a.call(l)}}wa(t,s,e,o)}else s=O_(n,t,e,o,r);return Ra(s)}dp=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Qo(t.pendingLanes);n!==0&&(ru(t,n|1),qe(t,Ee()),!(ne&6)&&(co=Ee()+500,In()))}break;case 13:dr(function(){var r=an(e,1);if(r!==null){var o=He();bt(r,e,1,o)}}),Ac(e,1)}},ou=function(e){if(e.tag===13){var t=an(e,134217728);if(t!==null){var n=He();bt(t,e,134217728,n)}Ac(e,134217728)}},fp=function(e){if(e.tag===13){var t=Pn(e),n=an(e,t);if(n!==null){var r=He();bt(n,e,t,r)}Ac(e,t)}},pp=function(){return re},hp=function(e,t){var n=re;try{return re=e,t()}finally{re=n}},Xl=function(e,t,n){switch(t){case"input":if(Hl(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var o=zs(r);if(!o)throw Error(z(90));Ff(r),Hl(r,o)}}}break;case"textarea":zf(e,n);break;case"select":t=n.value,t!=null&&$r(e,!!n.multiple,t,!1)}},Zf=Nc,Jf=dr;var x_={usingClientEntryPoint:!1,Events:[pi,qr,zs,Xf,qf,Nc]},Ti={findFiberByHostInstance:rr,bundleType:0,version:"18.2.0",rendererPackageName:"react-dom"},T_={bundleType:Ti.bundleType,version:Ti.version,rendererPackageName:Ti.rendererPackageName,rendererConfig:Ti.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:tn.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=rp(e),e===null?null:e.stateNode},findFiberByHostInstance:Ti.findFiberByHostInstance||N_,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0-next-9e3b772b8-20220608"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ta=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ta.isDisabled&&Ta.supportsFiber)try{Ns=Ta.inject(T_),Vt=Ta}catch{}}rt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=x_,rt.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Dc(t))throw Error(z(200));return R_(e,t,null,n)},rt.createRoot=function(e,t){if(!Dc(e))throw Error(z(299));var n=!1,r="",o=Ag;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=bc(e,1,!1,null,null,n,!1,r,o),e[nn]=t.current,ci(e.nodeType===8?e.parentNode:e),new Lc(t)},rt.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(z(188)):(e=Object.keys(e).join(","),Error(z(268,e)));return e=rp(t),e=e===null?null:e.stateNode,e},rt.flushSync=function(e){return dr(e)},rt.hydrate=function(e,t,n){if(!Oa(t))throw Error(z(200));return xa(null,e,t,!0,n)},rt.hydrateRoot=function(e,t,n){if(!Dc(e))throw Error(z(405));var r=n!=null&&n.hydratedSources||null,o=!1,i="",s=Ag;if(n!=null&&(n.unstable_strictMode===!0&&(o=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(s=n.onRecoverableError)),t=Ig(t,null,e,1,n??null,o,!1,i,s),e[nn]=t.current,ci(e),r)for(e=0;e<r.length;e++)n=r[e],o=n._getVersion,o=o(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,o]:t.mutableSourceEagerHydrationData.push(n,o);return new Na(t)},rt.render=function(e,t,n){if(!Oa(t))throw Error(z(200));return xa(null,e,t,!1,n)},rt.unmountComponentAtNode=function(e){if(!Oa(e))throw Error(z(40));return e._reactRootContainer?(dr(function(){xa(null,null,e,!1,function(){e._reactRootContainer=null,e[nn]=null})}),!0):!1},rt.unstable_batchedUpdates=Nc,rt.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Oa(n))throw Error(z(200));if(e==null||e._reactInternals===void 0)throw Error(z(38));return xa(e,t,n,!1,r)},rt.version="18.2.0-next-9e3b772b8-20220608",function(e){function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(n){console.error(n)}}t(),e.exports=rt}(NE);var Dg=Ur;Ol.createRoot=Dg.createRoot,Ol.hydrateRoot=Dg.hydrateRoot;var C_=Object.create,kc=Object.defineProperty,I_=Object.getOwnPropertyDescriptor,b_=Object.getOwnPropertyNames,A_=Object.getPrototypeOf,L_=Object.prototype.hasOwnProperty,D_=(e,t,n)=>t in e?kc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,k_=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),P_=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of b_(t))!L_.call(e,o)&&o!==n&&kc(e,o,{get:()=>t[o],enumerable:!(r=I_(t,o))||r.enumerable});return e},M_=(e,t,n)=>(n=e!=null?C_(A_(e)):{},P_(t||!e||!e.__esModule?kc(n,"default",{value:e,enumerable:!0}):n,e)),kg=(e,t,n)=>(D_(e,typeof t!="symbol"?t+"":t,n),n),U_=k_((e,t)=>{(function(n,r){typeof define=="function"&&define.amd?define(r):typeof t=="object"&&t.exports?t.exports=r():n.log=r()})(e,function(){var n=function(){},r="undefined",o=typeof window!==r&&typeof window.navigator!==r&&/Trident\/|MSIE /.test(window.navigator.userAgent),i=["trace","debug","info","warn","error"];function s(y,p){var g=y[p];if(typeof g.bind=="function")return g.bind(y);try{return Function.prototype.bind.call(g,y)}catch{return function(){return Function.prototype.apply.apply(g,[y,arguments])}}}function a(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function l(y){return y==="debug"&&(y="log"),typeof console===r?!1:y==="trace"&&o?a:console[y]!==void 0?s(console,y):console.log!==void 0?s(console,"log"):n}function u(y,p){for(var g=0;g<i.length;g++){var S=i[g];this[S]=g<y?n:this.methodFactory(S,y,p)}this.log=this.debug}function c(y,p,g){return function(){typeof console!==r&&(u.call(this,p,g),this[y].apply(this,arguments))}}function d(y,p,g){return l(y)||c.apply(this,arguments)}function f(y,p,g){var S=this,_;p=p??"WARN";var w="loglevel";typeof y=="string"?w+=":"+y:typeof y=="symbol"&&(w=void 0);function R(I){var V=(i[I]||"silent").toUpperCase();if(!(typeof window===r||!w)){try{window.localStorage[w]=V;return}catch{}try{window.document.cookie=encodeURIComponent(w)+"="+V+";"}catch{}}}function C(){var I;if(!(typeof window===r||!w)){try{I=window.localStorage[w]}catch{}if(typeof I===r)try{var V=window.document.cookie,$=V.indexOf(encodeURIComponent(w)+"=");$!==-1&&(I=/^([^;]+)/.exec(V.slice($))[1])}catch{}return S.levels[I]===void 0&&(I=void 0),I}}function L(){if(!(typeof window===r||!w)){try{window.localStorage.removeItem(w);return}catch{}try{window.document.cookie=encodeURIComponent(w)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch{}}}S.name=y,S.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},S.methodFactory=g||d,S.getLevel=function(){return _},S.setLevel=function(I,V){if(typeof I=="string"&&S.levels[I.toUpperCase()]!==void 0&&(I=S.levels[I.toUpperCase()]),typeof I=="number"&&I>=0&&I<=S.levels.SILENT){if(_=I,V!==!1&&R(I),u.call(S,I,y),typeof console===r&&I<S.levels.SILENT)return"No console available for logging"}else throw"log.setLevel() called with invalid level: "+I},S.setDefaultLevel=function(I){p=I,C()||S.setLevel(I,!1)},S.resetLevel=function(){S.setLevel(p,!1),L()},S.enableAll=function(I){S.setLevel(S.levels.TRACE,I)},S.disableAll=function(I){S.setLevel(S.levels.SILENT,I)};var B=C();B==null&&(B=p),S.setLevel(B,!1)}var h=new f,m={};h.getLogger=function(y){if(typeof y!="symbol"&&typeof y!="string"||y==="")throw new TypeError("You must supply a name when creating a logger.");var p=m[y];return p||(p=m[y]=new f(y,h.getLevel(),h.methodFactory)),p};var v=typeof window!==r?window.log:void 0;return h.noConflict=function(){return typeof window!==r&&window.log===h&&(window.log=v),h},h.getLoggers=function(){return m},h.default=h,h})}),F_=M_(U_(),1),V_=()=>new Date().toISOString(),Ci=F_.default.getLogger("signalwire"),B_=Ci.methodFactory;Ci.methodFactory=(e,t,n)=>{let r=B_(e,t,n);return function(...o){o.unshift(V_(),"-"),r(...o)}};var $_=Ci.getLevel();Ci.setLevel($_);var Ze=()=>Ci,H_=e=>({id:e.id,type:e.type,data:e.data,position:e.position}),z_=e=>({id:e.id,source:e.source,sourceHandle:e.sourceHandle,target:e.target,targetHandle:e.targetHandle}),Pg=e=>{var t;return(t=e==null?void 0:e.trim())==null?void 0:t.toLowerCase()},Ca=e=>e.replace(/\s/g,""),Pc=({destinations:e,sessionTimeout:t,type:n})=>{let r=t&&t>0?t:void 0,o=e.map(s=>({from:"%{call.from}",to:Ca(s),session_timeout:r}));o.length||o.push({from:"%{call.from}",to:"",session_timeout:r});let i={switch:{variable:"connect_result",case:{connected:[]},default:[{switch:{variable:"connect_failed_reason",case:{busy:[],noAnswer:[],decline:[],error:[]},default:["hangup"]}}]}};switch(n){case"single":return[{connect:o[0]},i];case"serial":return[{connect:{serial:o}},i];case"parallel":return[{connect:{parallel:o}},i];default:return Ze().warn(`The type '${n}' is not supported yet.`),[{connect:o[0]},i]}},j_=/\bmale\b/i,G_=/\bfemale\b/i,Y_=e=>{if(e){if(G_.test(e))return"female";if(j_.test(e))return"male"}},Mg=(e,t)=>{if(typeof e=="object"&&!Array.isArray(e)){t.language&&(e.say_language=t.language);let n=Y_(t.gender);n&&(e.say_gender=n),t.voice&&(e.say_voice=t.voice)}return e},W_={answer:({data:{maxDuration:e}})=>e?{answer:{max_duration:e}}:"answer",hangup:({data:{reason:e}})=>e?{hangup:{reason:e}}:"hangup",play:({data:e})=>{let t=e.url||`say:${e.text||"Unknown TTS"}`,n=Mg({url:t},e);return e.volume&&(n.volume=e.volume),{play:n}},forwardAddress:({data:e})=>Pc(e),forwardPhone:({data:e})=>Pc(e),forwardResource:({data:e})=>Pc(e),promptPlay:({data:e})=>{let t=Mg({play:"say:Unknown value"},e);e.text&&(t.play=`say:${e.text}`),e.url&&(t.play=e.url),e.volume&&(t.volume=e.volume);let n=e.options.reduce((r,o)=>{let i=Pg(o.command);i&&r.speechHints.push(i);let s=Ca(o.digit);return s&&(r.maxDigits=Math.max(r.maxDigits,s.length)),r},{speechHints:[],maxDigits:0});return n.speechHints.length&&(t.speech_hints=n.speechHints,t.speech_language="en-US"),n.maxDigits>1&&(t.max_digits=n.maxDigits),[{prompt:t},{switch:{variable:"prompt_result",case:{failed:[{play:"say:Error while gathering input."},"hangup"],no_input:[],no_match:[]},default:[{switch:{variable:"prompt_value",case:{},default:[]}}]}}]},handleCall:()=>"start",record:({data:e})=>({record:{beep:e.beep,direction:e.direction,end_silence_timeout:e.endSilenceTimeout,format:e.format,initial_timeout:e.initialTimeout,input_sensitivity:e.inputSensitivity,stereo:e.stereo,terminators:e.terminators}}),recordCallStart:({data:e})=>({record_call:{beep:e.beep,control_id:e.controlId,direction:e.direction,end_silence_timeout:e.endSilenceTimeout,format:e.format,initial_timeout:e.initialTimeout,input_sensitivity:e.inputSensitivity,stereo:e.stereo,terminators:e.terminators}}),recordCallStop:({data:e})=>({stop_record_call:e.controlId}),sendSms:({data:e})=>{let{fromNumber:t,toNumber:n,body:r}=e;return{send_sms:{from_number:Ca(t),to_number:Ca(n),body:r}}},set:({data:{variables:e}})=>{let t={};return e.forEach(({key:n,value:r})=>{t[n]=r}),{set:t}},unset:({data:{variables:e}})=>({unset:e.map(({key:t})=>t)}),request:({data:e})=>[{request:{url:e.url,method:e.method,timeout:e.timeout,connect_timeout:e.connectTimeout,save_variables:e.saveVariables,headers:e.headers&&Object.keys(e.headers).length?e.headers:void 0,body:e.body?e.body:void 0}},{switch:{variable:"request_result",case:{success:[]},default:[]}}],cond:()=>({cond:[]}),condRequest:({data:e})=>[{request:{url:e.url,method:e.method,timeout:e.timeout,connect_timeout:e.connectTimeout,save_variables:e.saveVariables,headers:e.headers&&Object.keys(e.headers).length?e.headers:void 0,body:e.body?e.body:void 0}},{switch:{variable:"request_result",case:{success:[]},default:[]}}]},po=e=>{try{return W_[e.__type](e.node)}catch(t){throw Ze().error("Unknown Verb",e),t}},K_="1.0.0",Q_=e=>{let t=Ze(),n=new Set,r=new Map,o=new Set,i=new Map([["main",[]]]),s=new Map,a="",l=_=>i.has(_),u=_=>o.has(_),c=_=>o.add(_);e.nodes.forEach(_=>{r.set(_.id,{node:_,children:[]}),_.type==="handleCall"&&(a=_.id)}),e.edges.forEach(_=>{let w=r.get(_.source),R=r.get(_.target);if(!w||!R)return t.warn("Invalid edge:",_);w.children.push(_.target),_.sourceHandle&&s.set(_.sourceHandle,R),n.has(_.target)&&i.set(_.target,[]),n.add(_.target)});let d=[...i.keys()],f=(_,w)=>{let R=s.get(w.id);if(R){let C=[];i.set(w.id,C),w.digit&&(_[w.digit]=C);let L=Pg(w.command);L&&(_[L]=C);let B=l(R.node.id);if(B){let I={transfer:R.node.id};w.digit&&_[w.digit].push(I),L&&!_[L].includes(I)&&_[L].push(I)}p({sectionName:B?R.node.id:w.id,current:R})}return _},h=(_,w)=>{let R=s.get(w.id);if(R){let C=[];i.set(w.id,C),_[w.result]=C;let L=l(R.node.id);L&&_[w.result].push({transfer:R.node.id}),p({sectionName:L?R.node.id:w.id,current:R})}return _},m={then:(_,w)=>{if(w.result!=="success")return _;let R=s.get(w.id);if(R){let C=[];i.set(w.id,C),_=C;let L=l(R.node.id);L&&_.push({transfer:R.node.id}),p({sectionName:L?R.node.id:w.id,current:R})}return _},else:(_,w)=>{if(w.result==="success")return _;let R=s.get(w.id);if(R){let C=[];i.set(w.id,C),_=C;let L=l(R.node.id);L&&_.push({transfer:R.node.id}),p({sectionName:L?R.node.id:w.id,current:R})}return _}},v={options:(_,w)=>{let R=s.get(w.id),C={when:w.value,then:[]};if(R){let L=[];i.set(w.id,L),C.then=L;let B=l(R.node.id);B&&C.then.push({transfer:R.node.id}),_.push(C),p({sectionName:B?R.node.id:w.id,current:R})}return _},fallback:_=>{let w=s.get(_),R={else:[]};if(w){let C=[];i.set(_,C),R.else=C;let L=l(w.node.id);L&&R.else.push({transfer:w.node.id}),p({sectionName:L?w.node.id:_,current:w})}return R}},y=_=>{let w=s.get(_),R=[];if(w){let C=[];i.set(_,C),R=C;let L=l(w.node.id);L&&R.push({transfer:w.node.id}),p({sectionName:L?w.node.id:_,current:w})}return R},p=({sectionName:_,current:w})=>{var C,L,B;if(u(w.node.id))return;c(w.node.id);let R=i.get(_);if(!R){t.warn("Unknown section name:",_);return}switch(w.node.type){case"promptPlay":{let I=po({__type:w.node.type,node:w.node});if(!Array.isArray(I)){t.warn("Invalid gather node",I);return}(L=(C=w.node.data)==null?void 0:C.results)!=null&&L.length&&(I[1].switch.case={...I[1].switch.case,...w.node.data.results.reduce(h,{})}),I[1].switch.default[0].switch.case=w.node.data.options.reduce(f,{}),(B=I[1].switch.case)!=null&&B.no_match&&(I[1].switch.default[0].switch.default=I[1].switch.case.no_match),R.push(...I);return}case"cond":{let I=po({__type:w.node.type,node:w.node});I.cond=w.node.data.options.reduce(v.options,[]),I.cond.push(v.fallback(w.node.data.fallback)),R.push(I);return}case"condRequest":{let I=po({__type:w.node.type,node:w.node}),V=w.node.data.options.reduce(v.options,[]),$=v.fallback(w.node.data.fallback),F={cond:[...V,$]};I[1].switch.case.success=[F],I[1].switch.default=y(w.node.data.error),R.push(I);return}case"forwardPhone":case"forwardAddress":case"forwardResource":{let I=po({__type:w.node.type,node:w.node});if(!Array.isArray(I)){t.warn("Invalid connect node",I);return}w.node.data.options.length&&(I[1].switch.case.connected=w.node.data.options.reduce(m.then,[]),I[1].switch.default[0].switch.case=w.node.data.options.filter(V=>V.result!=="success").reduce(h,{})),R.push(...I);return}case"request":{let I=po({__type:w.node.type,node:w.node});if(!Array.isArray(I)){t.warn("Invalid request node",I);return}I[1].switch.case.success=w.node.data.options.reduce(m.then,[]),I[1].switch.default=w.node.data.options.reduce(m.else,[]),R.push(...I);return}default:{let I=po({__type:w.node.type,node:w.node});w.node.type!=="handleCall"&&R.push(I),w.children.forEach(V=>{let $=r.get(V);if(!$)return t.warn("Invalid Child Node",V);let F=l(V);F&&R.push({transfer:V}),p({sectionName:F?V:_,current:$})});break}}},g=r.get(a);g&&p({sectionName:"main",current:g});let S={};return d.forEach(_=>{let w=i.get(_);w&&(S[_]=w)}),t.debug("sections",JSON.stringify(S)),{version:K_,sections:S}},Ug=class extends Error{constructor(e,t){super(t),this.code=e,this.message=t,kg(this,"name","AuthError"),Object.setPrototypeOf(this,Ug.prototype)}},Fg=class extends Error{constructor(t,n,r){super(n),this.code=t,this.message=n,this.response=r,kg(this,"name","HttpError"),Object.setPrototypeOf(this,Fg.prototype)}};async function X_(e,t){let n=await fetch(e,t);if(!n.ok){if(n.status===401)throw new Ug(n.status,"Unauthorized");let r;try{r=await n.json()}catch{}let o=r!=null&&r.errors?JSON.stringify(r.errors):`Error Code: ${n.status}`;throw new Fg(n.status,o,r)}try{n.parsedBody=await n.json()}catch{}return n}var q_=({timeout:e=3e4,...t},n=X_)=>async(r,o)=>{let i={...o!=null&&o.body?{"Content-Type":"application/json"}:{},...t.headers,...o==null?void 0:o.headers},s=J_({...t,...o,headers:i});s.credentials="same-origin";let a;if(e){let l=new AbortController,u=l.signal;s.signal=u,a=setTimeout(()=>{l.abort()},e)}try{return{body:(await n(ew({url:r,searchParams:o==null?void 0:o.searchParams}),s)).parsedBody}}finally{a&&clearTimeout(a)}},Z_=e=>typeof e=="string"?e:JSON.stringify(e),J_=e=>Object.entries(e).reduce((t,[n,r])=>n==="body"?{...t,body:Z_(r)}:r!=null?{...t,[n]:r}:t,{}),ew=({url:e,searchParams:t})=>{let n=new URL(e);return t&&Object.entries(t).forEach(([r,o])=>{o!=null&&n.searchParams.append(r,o)}),n.toString()},tw=e=>{let t=Ze(),n=q_(e);return{getFlow:async()=>{var r;try{let{body:o}=await n(e.getFlowURL);switch(t.info("getFlow",o),(r=o==null?void 0:o.flow_data)==null?void 0:r.builderVersion){default:return o}}catch(o){if(t.error("Could not load flow. URL:",e.getFlowURL),o instanceof Error)throw o;return{}}},putFlow:async r=>{let o={type:"call_flow",document_version:r.documentVersion+1,flow_data:{builderVersion:r.builderVersion,nodes:r.nodes.map(H_),edges:r.edges.map(z_)},relayml:Q_({nodes:r.nodes,edges:r.edges})},i=await n(e.updateFlowURL,{method:"PUT",body:o});return t.info("putFlow",i.body),i.body},deployFlow:async r=>{let o={document_version:r.documentVersion},i=await n(e.deployFlowURL,{method:"POST",body:o});return t.info("deployFlow",i.body),i.body}}};function Je(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,r;n<e.length;n++)(r=Je(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}const Vg=e=>{let t;const n=new Set,r=(l,u)=>{const c=typeof l=="function"?l(t):l;if(!Object.is(c,t)){const d=t;t=u??typeof c!="object"?c:Object.assign({},t,c),n.forEach(f=>f(t,d))}},o=()=>t,a={setState:r,getState:o,subscribe:l=>(n.add(l),()=>n.delete(l)),destroy:()=>{var l;((l={VITE_BASE_URL:"",VITE_BASIC_AUTH:"signalwire:1aG93uXk",VITE_DEFAULT_STYLE_HREF:"https://cdn.swire.io/npm/@signalwire/cfb@dev/dist/style.css",VITE_DEFAULT_VOICES_URL:"https://cdn.signalwire.com/npm/@signalwire/cfb@dev/dist/voices.json",BASE_URL:"/cfb/",MODE:"staging",DEV:!1,PROD:!0,SSR:!1})==null?void 0:l.MODE)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}};return t=e(r,o,a),a},Bg=e=>e?Vg(e):Vg;var Mc={},nw={get exports(){return Mc},set exports(e){Mc=e}},$g={},Uc={},rw={get exports(){return Uc},set exports(e){Uc=e}},Hg={};/**
44
+ `+i.stack}return{value:e,source:t,stack:o,digest:null}}function oc(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function ic(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var r_=typeof WeakMap=="function"?WeakMap:Map;function $h(e,t,n){n=ln(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){ha||(ha=!0,Sc=r),ic(e,t)},n}function Hh(e,t,n){n=ln(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var o=t.value;n.payload=function(){return r(o)},n.callback=function(){ic(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){ic(e,t),typeof r!="function"&&(Dn===null?Dn=new Set([this]):Dn.add(this));var s=t.stack;this.componentDidCatch(t.value,{componentStack:s!==null?s:""})}),n}function zh(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new r_;var o=new Set;r.set(t,o)}else o=r.get(t),o===void 0&&(o=new Set,r.set(t,o));o.has(n)||(o.add(n),e=v_.bind(null,e,t,n),t.then(e,e))}function jh(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Gh(e,t,n,r,o){return e.mode&1?(e.flags|=65536,e.lanes=o,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=ln(-1,1),t.tag=2,An(n,t,1))),n.lanes|=1),e)}var o_=tn.ReactCurrentOwner,Qe=!1;function $e(e,t,n,r){t.child=e===null?yh(t,null,n,r):io(t,e.child,n,r)}function Yh(e,t,n,r,o){n=n.render;var i=t.ref;return oo(t,o),r=Zu(e,t,n,r,i,o),n=Ju(),e!==null&&!Qe?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,un(e,t,o)):(ce&&n&&Du(t),t.flags|=1,$e(e,t,r,o),t.child)}function Wh(e,t,n,r,o){if(e===null){var i=n.type;return typeof i=="function"&&!Tc(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,Kh(e,t,i,r,o)):(e=Sa(n.type,null,r,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!(e.lanes&o)){var s=i.memoizedProps;if(n=n.compare,n=n!==null?n:ai,n(s,r)&&e.ref===t.ref)return un(e,t,o)}return t.flags|=1,e=Un(i,r),e.ref=t.ref,e.return=t,t.child=e}function Kh(e,t,n,r,o){if(e!==null){var i=e.memoizedProps;if(ai(i,r)&&e.ref===t.ref)if(Qe=!1,t.pendingProps=r=i,(e.lanes&o)!==0)e.flags&131072&&(Qe=!0);else return t.lanes=e.lanes,un(e,t,o)}return sc(e,t,n,r,o)}function Qh(e,t,n){var r=t.pendingProps,o=r.children,i=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},ie(uo,lt),lt|=n;else{if(!(n&1073741824))return e=i!==null?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,ie(uo,lt),lt|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,ie(uo,lt),lt|=r}else i!==null?(r=i.baseLanes|n,t.memoizedState=null):r=n,ie(uo,lt),lt|=r;return $e(e,t,o,n),t.child}function Xh(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function sc(e,t,n,r,o){var i=Ke(n)?or:ke.current;return i=Jr(t,i),oo(t,o),n=Zu(e,t,n,r,i,o),r=Ju(),e!==null&&!Qe?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,un(e,t,o)):(ce&&r&&Du(t),t.flags|=1,$e(e,t,n,o),t.child)}function qh(e,t,n,r,o){if(Ke(n)){var i=!0;Gs(t)}else i=!1;if(oo(t,o),t.stateNode===null)ua(e,t),hh(t,n,r),Gu(t,n,r,o),r=!0;else if(e===null){var s=t.stateNode,a=t.memoizedProps;s.props=a;var l=s.context,u=n.contextType;typeof u=="object"&&u!==null?u=mt(u):(u=Ke(n)?or:ke.current,u=Jr(t,u));var c=n.getDerivedStateFromProps,d=typeof c=="function"||typeof s.getSnapshotBeforeUpdate=="function";d||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==r||l!==u)&&gh(t,s,r,u),bn=!1;var f=t.memoizedState;s.state=f,Js(t,r,s,o),l=t.memoizedState,a!==r||f!==l||We.current||bn?(typeof c=="function"&&(ju(t,n,c,r),l=t.memoizedState),(a=bn||ph(t,n,a,r,f,l,u))?(d||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(t.flags|=4194308)):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),s.props=r,s.state=l,s.context=u,r=a):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{s=t.stateNode,uh(e,t),a=t.memoizedProps,u=t.type===t.elementType?a:Tt(t.type,a),s.props=u,d=t.pendingProps,f=s.context,l=n.contextType,typeof l=="object"&&l!==null?l=mt(l):(l=Ke(n)?or:ke.current,l=Jr(t,l));var h=n.getDerivedStateFromProps;(c=typeof h=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==d||f!==l)&&gh(t,s,r,l),bn=!1,f=t.memoizedState,s.state=f,Js(t,r,s,o);var m=t.memoizedState;a!==d||f!==m||We.current||bn?(typeof h=="function"&&(ju(t,n,h,r),m=t.memoizedState),(u=bn||ph(t,n,u,r,f,m,l)||!1)?(c||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(r,m,l),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(r,m,l)),typeof s.componentDidUpdate=="function"&&(t.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof s.componentDidUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=m),s.props=r,s.state=m,s.context=l,r=u):(typeof s.componentDidUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return ac(e,t,n,r,i,o)}function ac(e,t,n,r,o,i){Xh(e,t);var s=(t.flags&128)!==0;if(!r&&!s)return o&&th(t,n,!1),un(e,t,i);r=t.stateNode,o_.current=t;var a=s&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&s?(t.child=io(t,e.child,null,i),t.child=io(t,null,a,i)):$e(e,t,a,i),t.memoizedState=r.state,o&&th(t,n,!0),t.child}function Zh(e){var t=e.stateNode;t.pendingContext?Jp(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Jp(e,t.context,!1),Yu(e,t.containerInfo)}function Jh(e,t,n,r,o){return no(),Uu(o),t.flags|=256,$e(e,t,n,r),t.child}var lc={dehydrated:null,treeContext:null,retryLane:0};function uc(e){return{baseLanes:e,cachePool:null,transitions:null}}function eg(e,t,n){var r=t.pendingProps,o=pe.current,i=!1,s=(t.flags&128)!==0,a;if((a=s)||(a=e!==null&&e.memoizedState===null?!1:(o&2)!==0),a?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(o|=1),ie(pe,o&1),e===null)return Mu(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(s=r.children,e=r.fallback,i?(r=t.mode,i=t.child,s={mode:"hidden",children:s},!(r&1)&&i!==null?(i.childLanes=0,i.pendingProps=s):i=_a(s,r,0,null),e=hr(e,r,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=uc(n),t.memoizedState=lc,e):cc(t,s));if(o=e.memoizedState,o!==null&&(a=o.dehydrated,a!==null))return i_(e,t,s,r,a,o,n);if(i){i=r.fallback,s=t.mode,o=e.child,a=o.sibling;var l={mode:"hidden",children:r.children};return!(s&1)&&t.child!==o?(r=t.child,r.childLanes=0,r.pendingProps=l,t.deletions=null):(r=Un(o,l),r.subtreeFlags=o.subtreeFlags&14680064),a!==null?i=Un(a,i):(i=hr(i,s,n,null),i.flags|=2),i.return=t,r.return=t,r.sibling=i,t.child=r,r=i,i=t.child,s=e.child.memoizedState,s=s===null?uc(n):{baseLanes:s.baseLanes|n,cachePool:null,transitions:s.transitions},i.memoizedState=s,i.childLanes=e.childLanes&~n,t.memoizedState=lc,r}return i=e.child,e=i.sibling,r=Un(i,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function cc(e,t){return t=_a({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function la(e,t,n,r){return r!==null&&Uu(r),io(t,e.child,null,n),e=cc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function i_(e,t,n,r,o,i,s){if(n)return t.flags&256?(t.flags&=-257,r=oc(Error(z(422))),la(e,t,s,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=r.fallback,o=t.mode,r=_a({mode:"visible",children:r.children},o,0,null),i=hr(i,o,s,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,t.mode&1&&io(t,e.child,null,s),t.child.memoizedState=uc(s),t.memoizedState=lc,i);if(!(t.mode&1))return la(e,t,s,null);if(o.data==="$!"){if(r=o.nextSibling&&o.nextSibling.dataset,r)var a=r.dgst;return r=a,i=Error(z(419)),r=oc(i,r,void 0),la(e,t,s,r)}if(a=(s&e.childLanes)!==0,Qe||a){if(r=Ie,r!==null){switch(s&-s){case 4:o=2;break;case 16:o=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:o=32;break;case 536870912:o=268435456;break;default:o=0}o=o&(r.suspendedLanes|s)?0:o,o!==0&&o!==i.retryLane&&(i.retryLane=o,an(e,o),bt(r,e,o,-1))}return xc(),r=oc(Error(z(421))),la(e,t,s,r)}return o.data==="$?"?(t.flags|=128,t.child=e.child,t=y_.bind(null,e),o._reactRetry=t,null):(e=i.treeContext,at=xn(o.nextSibling),st=t,ce=!0,xt=null,e!==null&&(ht[gt++]=on,ht[gt++]=sn,ht[gt++]=ir,on=e.id,sn=e.overflow,ir=t),t=cc(t,r.children),t.flags|=4096,t)}function tg(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),$u(e.return,t,n)}function dc(e,t,n,r,o){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:o}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=o)}function ng(e,t,n){var r=t.pendingProps,o=r.revealOrder,i=r.tail;if($e(e,t,r.children,n),r=pe.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&tg(e,n,t);else if(e.tag===19)tg(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(ie(pe,r),!(t.mode&1))t.memoizedState=null;else switch(o){case"forwards":for(n=t.child,o=null;n!==null;)e=n.alternate,e!==null&&na(e)===null&&(o=n),n=n.sibling;n=o,n===null?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),dc(t,!1,o,n,i);break;case"backwards":for(n=null,o=t.child,t.child=null;o!==null;){if(e=o.alternate,e!==null&&na(e)===null){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}dc(t,!0,n,null,i);break;case"together":dc(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function ua(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function un(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),cr|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(z(153));if(t.child!==null){for(e=t.child,n=Un(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Un(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function s_(e,t,n){switch(t.tag){case 3:Zh(t),no();break;case 5:Eh(t);break;case 1:Ke(t.type)&&Gs(t);break;case 4:Yu(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,o=t.memoizedProps.value;ie(Xs,r._currentValue),r._currentValue=o;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(ie(pe,pe.current&1),t.flags|=128,null):n&t.child.childLanes?eg(e,t,n):(ie(pe,pe.current&1),e=un(e,t,n),e!==null?e.sibling:null);ie(pe,pe.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return ng(e,t,n);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),ie(pe,pe.current),r)break;return null;case 22:case 23:return t.lanes=0,Qh(e,t,n)}return un(e,t,n)}var rg,fc,og,ig;rg=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},fc=function(){},og=function(e,t,n,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,lr($t.current);var i=null;switch(n){case"input":o=$l(e,o),r=$l(e,r),i=[];break;case"select":o=fe({},o,{value:void 0}),r=fe({},r,{value:void 0}),i=[];break;case"textarea":o=jl(e,o),r=jl(e,r),i=[];break;default:typeof o.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Hs)}Yl(n,r);var s;n=null;for(u in o)if(!r.hasOwnProperty(u)&&o.hasOwnProperty(u)&&o[u]!=null)if(u==="style"){var a=o[u];for(s in a)a.hasOwnProperty(s)&&(n||(n={}),n[s]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(Bo.hasOwnProperty(u)?i||(i=[]):(i=i||[]).push(u,null));for(u in r){var l=r[u];if(a=o!=null?o[u]:void 0,r.hasOwnProperty(u)&&l!==a&&(l!=null||a!=null))if(u==="style")if(a){for(s in a)!a.hasOwnProperty(s)||l&&l.hasOwnProperty(s)||(n||(n={}),n[s]="");for(s in l)l.hasOwnProperty(s)&&a[s]!==l[s]&&(n||(n={}),n[s]=l[s])}else n||(i||(i=[]),i.push(u,n)),n=l;else u==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,a=a?a.__html:void 0,l!=null&&a!==l&&(i=i||[]).push(u,l)):u==="children"?typeof l!="string"&&typeof l!="number"||(i=i||[]).push(u,""+l):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(Bo.hasOwnProperty(u)?(l!=null&&u==="onScroll"&&se("scroll",e),i||a===l||(i=[])):(i=i||[]).push(u,l))}n&&(i=i||[]).push("style",n);var u=i;(t.updateQueue=u)&&(t.flags|=4)}},ig=function(e,t,n,r){n!==r&&(t.flags|=4)};function wi(e,t){if(!ce)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Me(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags&14680064,r|=o.flags&14680064,o.return=e,o=o.sibling;else for(o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags,r|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function a_(e,t,n){var r=t.pendingProps;switch(ku(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Me(t),null;case 1:return Ke(t.type)&&js(),Me(t),null;case 3:return r=t.stateNode,so(),ae(We),ae(ke),Qu(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Qs(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,xt!==null&&(Rc(xt),xt=null))),fc(e,t),Me(t),null;case 5:Wu(t);var o=lr(vi.current);if(n=t.type,e!==null&&t.stateNode!=null)og(e,t,n,r,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(z(166));return Me(t),null}if(e=lr($t.current),Qs(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[Bt]=t,r[fi]=i,e=(t.mode&1)!==0,n){case"dialog":se("cancel",r),se("close",r);break;case"iframe":case"object":case"embed":se("load",r);break;case"video":case"audio":for(o=0;o<ui.length;o++)se(ui[o],r);break;case"source":se("error",r);break;case"img":case"image":case"link":se("error",r),se("load",r);break;case"details":se("toggle",r);break;case"input":Ff(r,i),se("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},se("invalid",r);break;case"textarea":$f(r,i),se("invalid",r)}Yl(n,i),o=null;for(var s in i)if(i.hasOwnProperty(s)){var a=i[s];s==="children"?typeof a=="string"?r.textContent!==a&&(i.suppressHydrationWarning!==!0&&$s(r.textContent,a,e),o=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(i.suppressHydrationWarning!==!0&&$s(r.textContent,a,e),o=["children",""+a]):Bo.hasOwnProperty(s)&&a!=null&&s==="onScroll"&&se("scroll",r)}switch(n){case"input":ys(r),Bf(r,i,!0);break;case"textarea":ys(r),zf(r);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(r.onclick=Hs)}r=o,t.updateQueue=r,r!==null&&(t.flags|=4)}else{s=o.nodeType===9?o:o.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=jf(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=s.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=s.createElement(n,{is:r.is}):(e=s.createElement(n),n==="select"&&(s=e,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):e=s.createElementNS(e,n),e[Bt]=t,e[fi]=r,rg(e,t,!1,!1),t.stateNode=e;e:{switch(s=Wl(n,r),n){case"dialog":se("cancel",e),se("close",e),o=r;break;case"iframe":case"object":case"embed":se("load",e),o=r;break;case"video":case"audio":for(o=0;o<ui.length;o++)se(ui[o],e);o=r;break;case"source":se("error",e),o=r;break;case"img":case"image":case"link":se("error",e),se("load",e),o=r;break;case"details":se("toggle",e),o=r;break;case"input":Ff(e,r),o=$l(e,r),se("invalid",e);break;case"option":o=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},o=fe({},r,{value:void 0}),se("invalid",e);break;case"textarea":$f(e,r),o=jl(e,r),se("invalid",e);break;default:o=r}Yl(n,o),a=o;for(i in a)if(a.hasOwnProperty(i)){var l=a[i];i==="style"?Wf(e,l):i==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&Gf(e,l)):i==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&jo(e,l):typeof l=="number"&&jo(e,""+l):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(Bo.hasOwnProperty(i)?l!=null&&i==="onScroll"&&se("scroll",e):l!=null&&bl(e,i,l,s))}switch(n){case"input":ys(e),Bf(e,r,!1);break;case"textarea":ys(e),zf(e);break;case"option":r.value!=null&&e.setAttribute("value",""+En(r.value));break;case"select":e.multiple=!!r.multiple,i=r.value,i!=null?$r(e,!!r.multiple,i,!1):r.defaultValue!=null&&$r(e,!!r.multiple,r.defaultValue,!0);break;default:typeof o.onClick=="function"&&(e.onclick=Hs)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Me(t),null;case 6:if(e&&t.stateNode!=null)ig(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(z(166));if(n=lr(vi.current),lr($t.current),Qs(t)){if(r=t.stateNode,n=t.memoizedProps,r[Bt]=t,(i=r.nodeValue!==n)&&(e=st,e!==null))switch(e.tag){case 3:$s(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&$s(r.nodeValue,n,(e.mode&1)!==0)}i&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Bt]=t,t.stateNode=r}return Me(t),null;case 13:if(ae(pe),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(ce&&at!==null&&t.mode&1&&!(t.flags&128))ah(),no(),t.flags|=98560,i=!1;else if(i=Qs(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(z(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(z(317));i[Bt]=t}else no(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Me(t),i=!1}else xt!==null&&(Rc(xt),xt=null),i=!0;if(!i)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||pe.current&1?Oe===0&&(Oe=3):xc())),t.updateQueue!==null&&(t.flags|=4),Me(t),null);case 4:return so(),fc(e,t),e===null&&ci(t.stateNode.containerInfo),Me(t),null;case 10:return Bu(t.type._context),Me(t),null;case 17:return Ke(t.type)&&js(),Me(t),null;case 19:if(ae(pe),i=t.memoizedState,i===null)return Me(t),null;if(r=(t.flags&128)!==0,s=i.rendering,s===null)if(r)wi(i,!1);else{if(Oe!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(s=na(e),s!==null){for(t.flags|=128,wi(i,!1),r=s.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)i=n,e=r,i.flags&=14680066,s=i.alternate,s===null?(i.childLanes=0,i.lanes=e,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=s.childLanes,i.lanes=s.lanes,i.child=s.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=s.memoizedProps,i.memoizedState=s.memoizedState,i.updateQueue=s.updateQueue,i.type=s.type,e=s.dependencies,i.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return ie(pe,pe.current&1|2),t.child}e=e.sibling}i.tail!==null&&Ee()>co&&(t.flags|=128,r=!0,wi(i,!1),t.lanes=4194304)}else{if(!r)if(e=na(s),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),wi(i,!0),i.tail===null&&i.tailMode==="hidden"&&!s.alternate&&!ce)return Me(t),null}else 2*Ee()-i.renderingStartTime>co&&n!==1073741824&&(t.flags|=128,r=!0,wi(i,!1),t.lanes=4194304);i.isBackwards?(s.sibling=t.child,t.child=s):(n=i.last,n!==null?n.sibling=s:t.child=s,i.last=s)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=Ee(),t.sibling=null,n=pe.current,ie(pe,r?n&1|2:n&1),t):(Me(t),null);case 22:case 23:return Oc(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?lt&1073741824&&(Me(t),t.subtreeFlags&6&&(t.flags|=8192)):Me(t),null;case 24:return null;case 25:return null}throw Error(z(156,t.tag))}function l_(e,t){switch(ku(t),t.tag){case 1:return Ke(t.type)&&js(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return so(),ae(We),ae(ke),Qu(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Wu(t),null;case 13:if(ae(pe),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(z(340));no()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ae(pe),null;case 4:return so(),null;case 10:return Bu(t.type._context),null;case 22:case 23:return Oc(),null;case 24:return null;default:return null}}var ca=!1,Ue=!1,u_=typeof WeakSet=="function"?WeakSet:Set,G=null;function lo(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){ye(e,t,r)}else n.current=null}function pc(e,t,n){try{n()}catch(r){ye(e,t,r)}}var sg=!1;function c_(e,t){if(Ou=bs,e=Up(),vu(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var o=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var s=0,a=-1,l=-1,u=0,c=0,d=e,f=null;t:for(;;){for(var h;d!==n||o!==0&&d.nodeType!==3||(a=s+o),d!==i||r!==0&&d.nodeType!==3||(l=s+r),d.nodeType===3&&(s+=d.nodeValue.length),(h=d.firstChild)!==null;)f=d,d=h;for(;;){if(d===e)break t;if(f===n&&++u===o&&(a=s),f===i&&++c===r&&(l=s),(h=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=h}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(xu={focusedElem:e,selectionRange:n},bs=!1,G=t;G!==null;)if(t=G,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,G=e;else for(;G!==null;){t=G;try{var m=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(m!==null){var v=m.memoizedProps,y=m.memoizedState,p=t.stateNode,g=p.getSnapshotBeforeUpdate(t.elementType===t.type?v:Tt(t.type,v),y);p.__reactInternalSnapshotBeforeUpdate=g}break;case 3:var S=t.stateNode.containerInfo;S.nodeType===1?S.textContent="":S.nodeType===9&&S.documentElement&&S.removeChild(S.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(z(163))}}catch(_){ye(t,t.return,_)}if(e=t.sibling,e!==null){e.return=t.return,G=e;break}G=t.return}return m=sg,sg=!1,m}function Ri(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var o=r=r.next;do{if((o.tag&e)===e){var i=o.destroy;o.destroy=void 0,i!==void 0&&pc(t,n,i)}o=o.next}while(o!==r)}}function da(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function hc(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function ag(e){var t=e.alternate;t!==null&&(e.alternate=null,ag(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Bt],delete t[fi],delete t[bu],delete t[YS],delete t[WS])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function lg(e){return e.tag===5||e.tag===3||e.tag===4}function ug(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||lg(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function gc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Hs));else if(r!==4&&(e=e.child,e!==null))for(gc(e,t,n),e=e.sibling;e!==null;)gc(e,t,n),e=e.sibling}function mc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(mc(e,t,n),e=e.sibling;e!==null;)mc(e,t,n),e=e.sibling}var Le=null,Ct=!1;function Ln(e,t,n){for(n=n.child;n!==null;)cg(e,t,n),n=n.sibling}function cg(e,t,n){if(Vt&&typeof Vt.onCommitFiberUnmount=="function")try{Vt.onCommitFiberUnmount(Ns,n)}catch{}switch(n.tag){case 5:Ue||lo(n,t);case 6:var r=Le,o=Ct;Le=null,Ln(e,t,n),Le=r,Ct=o,Le!==null&&(Ct?(e=Le,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Le.removeChild(n.stateNode));break;case 18:Le!==null&&(Ct?(e=Le,n=n.stateNode,e.nodeType===8?Iu(e.parentNode,n):e.nodeType===1&&Iu(e,n),ti(e)):Iu(Le,n.stateNode));break;case 4:r=Le,o=Ct,Le=n.stateNode.containerInfo,Ct=!0,Ln(e,t,n),Le=r,Ct=o;break;case 0:case 11:case 14:case 15:if(!Ue&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var i=o,s=i.destroy;i=i.tag,s!==void 0&&(i&2||i&4)&&pc(n,t,s),o=o.next}while(o!==r)}Ln(e,t,n);break;case 1:if(!Ue&&(lo(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){ye(n,t,a)}Ln(e,t,n);break;case 21:Ln(e,t,n);break;case 22:n.mode&1?(Ue=(r=Ue)||n.memoizedState!==null,Ln(e,t,n),Ue=r):Ln(e,t,n);break;default:Ln(e,t,n)}}function dg(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new u_),t.forEach(function(r){var o=E_.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function It(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var o=n[r];try{var i=e,s=t,a=s;e:for(;a!==null;){switch(a.tag){case 5:Le=a.stateNode,Ct=!1;break e;case 3:Le=a.stateNode.containerInfo,Ct=!0;break e;case 4:Le=a.stateNode.containerInfo,Ct=!0;break e}a=a.return}if(Le===null)throw Error(z(160));cg(i,s,o),Le=null,Ct=!1;var l=o.alternate;l!==null&&(l.return=null),o.return=null}catch(u){ye(o,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)fg(t,e),t=t.sibling}function fg(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(It(t,e),zt(e),r&4){try{Ri(3,e,e.return),da(3,e)}catch(v){ye(e,e.return,v)}try{Ri(5,e,e.return)}catch(v){ye(e,e.return,v)}}break;case 1:It(t,e),zt(e),r&512&&n!==null&&lo(n,n.return);break;case 5:if(It(t,e),zt(e),r&512&&n!==null&&lo(n,n.return),e.flags&32){var o=e.stateNode;try{jo(o,"")}catch(v){ye(e,e.return,v)}}if(r&4&&(o=e.stateNode,o!=null)){var i=e.memoizedProps,s=n!==null?n.memoizedProps:i,a=e.type,l=e.updateQueue;if(e.updateQueue=null,l!==null)try{a==="input"&&i.type==="radio"&&i.name!=null&&Vf(o,i),Wl(a,s);var u=Wl(a,i);for(s=0;s<l.length;s+=2){var c=l[s],d=l[s+1];c==="style"?Wf(o,d):c==="dangerouslySetInnerHTML"?Gf(o,d):c==="children"?jo(o,d):bl(o,c,d,u)}switch(a){case"input":Hl(o,i);break;case"textarea":Hf(o,i);break;case"select":var f=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!i.multiple;var h=i.value;h!=null?$r(o,!!i.multiple,h,!1):f!==!!i.multiple&&(i.defaultValue!=null?$r(o,!!i.multiple,i.defaultValue,!0):$r(o,!!i.multiple,i.multiple?[]:"",!1))}o[fi]=i}catch(v){ye(e,e.return,v)}}break;case 6:if(It(t,e),zt(e),r&4){if(e.stateNode===null)throw Error(z(162));o=e.stateNode,i=e.memoizedProps;try{o.nodeValue=i}catch(v){ye(e,e.return,v)}}break;case 3:if(It(t,e),zt(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{ti(t.containerInfo)}catch(v){ye(e,e.return,v)}break;case 4:It(t,e),zt(e);break;case 13:It(t,e),zt(e),o=e.child,o.flags&8192&&(i=o.memoizedState!==null,o.stateNode.isHidden=i,!i||o.alternate!==null&&o.alternate.memoizedState!==null||(Ec=Ee())),r&4&&dg(e);break;case 22:if(c=n!==null&&n.memoizedState!==null,e.mode&1?(Ue=(u=Ue)||c,It(t,e),Ue=u):It(t,e),zt(e),r&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!c&&e.mode&1)for(G=e,c=e.child;c!==null;){for(d=G=c;G!==null;){switch(f=G,h=f.child,f.tag){case 0:case 11:case 14:case 15:Ri(4,f,f.return);break;case 1:lo(f,f.return);var m=f.stateNode;if(typeof m.componentWillUnmount=="function"){r=f,n=f.return;try{t=r,m.props=t.memoizedProps,m.state=t.memoizedState,m.componentWillUnmount()}catch(v){ye(r,n,v)}}break;case 5:lo(f,f.return);break;case 22:if(f.memoizedState!==null){gg(d);continue}}h!==null?(h.return=f,G=h):gg(d)}c=c.sibling}e:for(c=null,d=e;;){if(d.tag===5){if(c===null){c=d;try{o=d.stateNode,u?(i=o.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(a=d.stateNode,l=d.memoizedProps.style,s=l!=null&&l.hasOwnProperty("display")?l.display:null,a.style.display=Yf("display",s))}catch(v){ye(e,e.return,v)}}}else if(d.tag===6){if(c===null)try{d.stateNode.nodeValue=u?"":d.memoizedProps}catch(v){ye(e,e.return,v)}}else if((d.tag!==22&&d.tag!==23||d.memoizedState===null||d===e)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===e)break e;for(;d.sibling===null;){if(d.return===null||d.return===e)break e;c===d&&(c=null),d=d.return}c===d&&(c=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:It(t,e),zt(e),r&4&&dg(e);break;case 21:break;default:It(t,e),zt(e)}}function zt(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(lg(n)){var r=n;break e}n=n.return}throw Error(z(160))}switch(r.tag){case 5:var o=r.stateNode;r.flags&32&&(jo(o,""),r.flags&=-33);var i=ug(e);mc(e,i,o);break;case 3:case 4:var s=r.stateNode.containerInfo,a=ug(e);gc(e,a,s);break;default:throw Error(z(161))}}catch(l){ye(e,e.return,l)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function d_(e,t,n){G=e,pg(e)}function pg(e,t,n){for(var r=(e.mode&1)!==0;G!==null;){var o=G,i=o.child;if(o.tag===22&&r){var s=o.memoizedState!==null||ca;if(!s){var a=o.alternate,l=a!==null&&a.memoizedState!==null||Ue;a=ca;var u=Ue;if(ca=s,(Ue=l)&&!u)for(G=o;G!==null;)s=G,l=s.child,s.tag===22&&s.memoizedState!==null?mg(o):l!==null?(l.return=s,G=l):mg(o);for(;i!==null;)G=i,pg(i),i=i.sibling;G=o,ca=a,Ue=u}hg(e)}else o.subtreeFlags&8772&&i!==null?(i.return=o,G=i):hg(e)}}function hg(e){for(;G!==null;){var t=G;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Ue||da(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Ue)if(n===null)r.componentDidMount();else{var o=t.elementType===t.type?n.memoizedProps:Tt(t.type,n.memoizedProps);r.componentDidUpdate(o,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&dh(t,i,r);break;case 3:var s=t.updateQueue;if(s!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}dh(t,s,n)}break;case 5:var a=t.stateNode;if(n===null&&t.flags&4){n=a;var l=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&n.focus();break;case"img":l.src&&(n.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var c=u.memoizedState;if(c!==null){var d=c.dehydrated;d!==null&&ti(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(z(163))}Ue||t.flags&512&&hc(t)}catch(f){ye(t,t.return,f)}}if(t===e){G=null;break}if(n=t.sibling,n!==null){n.return=t.return,G=n;break}G=t.return}}function gg(e){for(;G!==null;){var t=G;if(t===e){G=null;break}var n=t.sibling;if(n!==null){n.return=t.return,G=n;break}G=t.return}}function mg(e){for(;G!==null;){var t=G;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{da(4,t)}catch(l){ye(t,n,l)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var o=t.return;try{r.componentDidMount()}catch(l){ye(t,o,l)}}var i=t.return;try{hc(t)}catch(l){ye(t,i,l)}break;case 5:var s=t.return;try{hc(t)}catch(l){ye(t,s,l)}}}catch(l){ye(t,t.return,l)}if(t===e){G=null;break}var a=t.sibling;if(a!==null){a.return=t.return,G=a;break}G=t.return}}var f_=Math.ceil,fa=tn.ReactCurrentDispatcher,vc=tn.ReactCurrentOwner,yt=tn.ReactCurrentBatchConfig,ne=0,Ie=null,_e=null,De=0,lt=0,uo=Tn(0),Oe=0,Ni=null,cr=0,pa=0,yc=0,Oi=null,Xe=null,Ec=0,co=1/0,cn=null,ha=!1,Sc=null,Dn=null,ga=!1,kn=null,ma=0,xi=0,_c=null,va=-1,ya=0;function He(){return ne&6?Ee():va!==-1?va:va=Ee()}function Pn(e){return e.mode&1?ne&2&&De!==0?De&-De:QS.transition!==null?(ya===0&&(ya=lp()),ya):(e=re,e!==0||(e=window.event,e=e===void 0?16:vp(e.type)),e):1}function bt(e,t,n,r){if(50<xi)throw xi=0,_c=null,Error(z(185));Xo(e,n,r),(!(ne&2)||e!==Ie)&&(e===Ie&&(!(ne&2)&&(pa|=n),Oe===4&&Mn(e,De)),qe(e,r),n===1&&ne===0&&!(t.mode&1)&&(co=Ee()+500,Ys&&In()))}function qe(e,t){var n=e.callbackNode;QE(e,t);var r=Ts(e,e===Ie?De:0);if(r===0)n!==null&&ip(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&ip(n),t===1)e.tag===0?KS(yg.bind(null,e)):nh(yg.bind(null,e)),jS(function(){!(ne&6)&&In()}),n=null;else{switch(up(r)){case 1:n=eu;break;case 4:n=sp;break;case 16:n=Rs;break;case 536870912:n=ap;break;default:n=Rs}n=xg(n,vg.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function vg(e,t){if(va=-1,ya=0,ne&6)throw Error(z(327));var n=e.callbackNode;if(fo()&&e.callbackNode!==n)return null;var r=Ts(e,e===Ie?De:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Ea(e,r);else{t=r;var o=ne;ne|=2;var i=Sg();(Ie!==e||De!==t)&&(cn=null,co=Ee()+500,fr(e,t));do try{g_();break}catch(a){Eg(e,a)}while(1);Vu(),fa.current=i,ne=o,_e!==null?t=0:(Ie=null,De=0,t=Oe)}if(t!==0){if(t===2&&(o=tu(e),o!==0&&(r=o,t=wc(e,o))),t===1)throw n=Ni,fr(e,0),Mn(e,r),qe(e,Ee()),n;if(t===6)Mn(e,r);else{if(o=e.current.alternate,!(r&30)&&!p_(o)&&(t=Ea(e,r),t===2&&(i=tu(e),i!==0&&(r=i,t=wc(e,i))),t===1))throw n=Ni,fr(e,0),Mn(e,r),qe(e,Ee()),n;switch(e.finishedWork=o,e.finishedLanes=r,t){case 0:case 1:throw Error(z(345));case 2:pr(e,Xe,cn);break;case 3:if(Mn(e,r),(r&130023424)===r&&(t=Ec+500-Ee(),10<t)){if(Ts(e,0)!==0)break;if(o=e.suspendedLanes,(o&r)!==r){He(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=Cu(pr.bind(null,e,Xe,cn),t);break}pr(e,Xe,cn);break;case 4:if(Mn(e,r),(r&4194240)===r)break;for(t=e.eventTimes,o=-1;0<r;){var s=31-Nt(r);i=1<<s,s=t[s],s>o&&(o=s),r&=~i}if(r=o,r=Ee()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*f_(r/1960))-r,10<r){e.timeoutHandle=Cu(pr.bind(null,e,Xe,cn),r);break}pr(e,Xe,cn);break;case 5:pr(e,Xe,cn);break;default:throw Error(z(329))}}}return qe(e,Ee()),e.callbackNode===n?vg.bind(null,e):null}function wc(e,t){var n=Oi;return e.current.memoizedState.isDehydrated&&(fr(e,t).flags|=256),e=Ea(e,t),e!==2&&(t=Xe,Xe=n,t!==null&&Rc(t)),e}function Rc(e){Xe===null?Xe=e:Xe.push.apply(Xe,e)}function p_(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var o=n[r],i=o.getSnapshot;o=o.value;try{if(!Ot(i(),o))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Mn(e,t){for(t&=~yc,t&=~pa,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Nt(t),r=1<<n;e[n]=-1,t&=~r}}function yg(e){if(ne&6)throw Error(z(327));fo();var t=Ts(e,0);if(!(t&1))return qe(e,Ee()),null;var n=Ea(e,t);if(e.tag!==0&&n===2){var r=tu(e);r!==0&&(t=r,n=wc(e,r))}if(n===1)throw n=Ni,fr(e,0),Mn(e,t),qe(e,Ee()),n;if(n===6)throw Error(z(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,pr(e,Xe,cn),qe(e,Ee()),null}function Nc(e,t){var n=ne;ne|=1;try{return e(t)}finally{ne=n,ne===0&&(co=Ee()+500,Ys&&In())}}function dr(e){kn!==null&&kn.tag===0&&!(ne&6)&&fo();var t=ne;ne|=1;var n=yt.transition,r=re;try{if(yt.transition=null,re=1,e)return e()}finally{re=r,yt.transition=n,ne=t,!(ne&6)&&In()}}function Oc(){lt=uo.current,ae(uo)}function fr(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,zS(n)),_e!==null)for(n=_e.return;n!==null;){var r=n;switch(ku(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&js();break;case 3:so(),ae(We),ae(ke),Qu();break;case 5:Wu(r);break;case 4:so();break;case 13:ae(pe);break;case 19:ae(pe);break;case 10:Bu(r.type._context);break;case 22:case 23:Oc()}n=n.return}if(Ie=e,_e=e=Un(e.current,null),De=lt=t,Oe=0,Ni=null,yc=pa=cr=0,Xe=Oi=null,ar!==null){for(t=0;t<ar.length;t++)if(n=ar[t],r=n.interleaved,r!==null){n.interleaved=null;var o=r.next,i=n.pending;if(i!==null){var s=i.next;i.next=o,r.next=s}n.pending=r}ar=null}return e}function Eg(e,t){do{var n=_e;try{if(Vu(),ra.current=aa,oa){for(var r=he.memoizedState;r!==null;){var o=r.queue;o!==null&&(o.pending=null),r=r.next}oa=!1}if(ur=0,Ce=Ne=he=null,yi=!1,Ei=0,vc.current=null,n===null||n.return===null){Oe=1,Ni=t,_e=null;break}e:{var i=e,s=n.return,a=n,l=t;if(t=De,a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var u=l,c=a,d=c.tag;if(!(c.mode&1)&&(d===0||d===11||d===15)){var f=c.alternate;f?(c.updateQueue=f.updateQueue,c.memoizedState=f.memoizedState,c.lanes=f.lanes):(c.updateQueue=null,c.memoizedState=null)}var h=jh(s);if(h!==null){h.flags&=-257,Gh(h,s,a,i,t),h.mode&1&&zh(i,u,t),t=h,l=u;var m=t.updateQueue;if(m===null){var v=new Set;v.add(l),t.updateQueue=v}else m.add(l);break e}else{if(!(t&1)){zh(i,u,t),xc();break e}l=Error(z(426))}}else if(ce&&a.mode&1){var y=jh(s);if(y!==null){!(y.flags&65536)&&(y.flags|=256),Gh(y,s,a,i,t),Uu(ao(l,a));break e}}i=l=ao(l,a),Oe!==4&&(Oe=2),Oi===null?Oi=[i]:Oi.push(i),i=s;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var p=$h(i,l,t);ch(i,p);break e;case 1:a=l;var g=i.type,S=i.stateNode;if(!(i.flags&128)&&(typeof g.getDerivedStateFromError=="function"||S!==null&&typeof S.componentDidCatch=="function"&&(Dn===null||!Dn.has(S)))){i.flags|=65536,t&=-t,i.lanes|=t;var _=Hh(i,a,t);ch(i,_);break e}}i=i.return}while(i!==null)}wg(n)}catch(w){t=w,_e===n&&n!==null&&(_e=n=n.return);continue}break}while(1)}function Sg(){var e=fa.current;return fa.current=aa,e===null?aa:e}function xc(){(Oe===0||Oe===3||Oe===2)&&(Oe=4),Ie===null||!(cr&268435455)&&!(pa&268435455)||Mn(Ie,De)}function Ea(e,t){var n=ne;ne|=2;var r=Sg();(Ie!==e||De!==t)&&(cn=null,fr(e,t));do try{h_();break}catch(o){Eg(e,o)}while(1);if(Vu(),ne=n,fa.current=r,_e!==null)throw Error(z(261));return Ie=null,De=0,Oe}function h_(){for(;_e!==null;)_g(_e)}function g_(){for(;_e!==null&&!BE();)_g(_e)}function _g(e){var t=Og(e.alternate,e,lt);e.memoizedProps=e.pendingProps,t===null?wg(e):_e=t,vc.current=null}function wg(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=l_(n,t),n!==null){n.flags&=32767,_e=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Oe=6,_e=null;return}}else if(n=a_(n,t,lt),n!==null){_e=n;return}if(t=t.sibling,t!==null){_e=t;return}_e=t=e}while(t!==null);Oe===0&&(Oe=5)}function pr(e,t,n){var r=re,o=yt.transition;try{yt.transition=null,re=1,m_(e,t,n,r)}finally{yt.transition=o,re=r}return null}function m_(e,t,n,r){do fo();while(kn!==null);if(ne&6)throw Error(z(327));n=e.finishedWork;var o=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(z(177));e.callbackNode=null,e.callbackPriority=0;var i=n.lanes|n.childLanes;if(XE(e,i),e===Ie&&(_e=Ie=null,De=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||ga||(ga=!0,xg(Rs,function(){return fo(),null})),i=(n.flags&15990)!==0,n.subtreeFlags&15990||i){i=yt.transition,yt.transition=null;var s=re;re=1;var a=ne;ne|=4,vc.current=null,c_(e,n),fg(n,e),MS(xu),bs=!!Ou,xu=Ou=null,e.current=n,d_(n),$E(),ne=a,re=s,yt.transition=i}else e.current=n;if(ga&&(ga=!1,kn=e,ma=o),i=e.pendingLanes,i===0&&(Dn=null),jE(n.stateNode),qe(e,Ee()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)o=t[n],r(o.value,{componentStack:o.stack,digest:o.digest});if(ha)throw ha=!1,e=Sc,Sc=null,e;return ma&1&&e.tag!==0&&fo(),i=e.pendingLanes,i&1?e===_c?xi++:(xi=0,_c=e):xi=0,In(),null}function fo(){if(kn!==null){var e=up(ma),t=yt.transition,n=re;try{if(yt.transition=null,re=16>e?16:e,kn===null)var r=!1;else{if(e=kn,kn=null,ma=0,ne&6)throw Error(z(331));var o=ne;for(ne|=4,G=e.current;G!==null;){var i=G,s=i.child;if(G.flags&16){var a=i.deletions;if(a!==null){for(var l=0;l<a.length;l++){var u=a[l];for(G=u;G!==null;){var c=G;switch(c.tag){case 0:case 11:case 15:Ri(8,c,i)}var d=c.child;if(d!==null)d.return=c,G=d;else for(;G!==null;){c=G;var f=c.sibling,h=c.return;if(ag(c),c===u){G=null;break}if(f!==null){f.return=h,G=f;break}G=h}}}var m=i.alternate;if(m!==null){var v=m.child;if(v!==null){m.child=null;do{var y=v.sibling;v.sibling=null,v=y}while(v!==null)}}G=i}}if(i.subtreeFlags&2064&&s!==null)s.return=i,G=s;else e:for(;G!==null;){if(i=G,i.flags&2048)switch(i.tag){case 0:case 11:case 15:Ri(9,i,i.return)}var p=i.sibling;if(p!==null){p.return=i.return,G=p;break e}G=i.return}}var g=e.current;for(G=g;G!==null;){s=G;var S=s.child;if(s.subtreeFlags&2064&&S!==null)S.return=s,G=S;else e:for(s=g;G!==null;){if(a=G,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:da(9,a)}}catch(w){ye(a,a.return,w)}if(a===s){G=null;break e}var _=a.sibling;if(_!==null){_.return=a.return,G=_;break e}G=a.return}}if(ne=o,In(),Vt&&typeof Vt.onPostCommitFiberRoot=="function")try{Vt.onPostCommitFiberRoot(Ns,e)}catch{}r=!0}return r}finally{re=n,yt.transition=t}}return!1}function Rg(e,t,n){t=ao(n,t),t=$h(e,t,1),e=An(e,t,1),t=He(),e!==null&&(Xo(e,1,t),qe(e,t))}function ye(e,t,n){if(e.tag===3)Rg(e,e,n);else for(;t!==null;){if(t.tag===3){Rg(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Dn===null||!Dn.has(r))){e=ao(n,e),e=Hh(t,e,1),t=An(t,e,1),e=He(),t!==null&&(Xo(t,1,e),qe(t,e));break}}t=t.return}}function v_(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=He(),e.pingedLanes|=e.suspendedLanes&n,Ie===e&&(De&n)===n&&(Oe===4||Oe===3&&(De&130023424)===De&&500>Ee()-Ec?fr(e,0):yc|=n),qe(e,t)}function Ng(e,t){t===0&&(e.mode&1?(t=xs,xs<<=1,!(xs&130023424)&&(xs=4194304)):t=1);var n=He();e=an(e,t),e!==null&&(Xo(e,t,n),qe(e,n))}function y_(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Ng(e,n)}function E_(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(z(314))}r!==null&&r.delete(t),Ng(e,n)}var Og;Og=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||We.current)Qe=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Qe=!1,s_(e,t,n);Qe=!!(e.flags&131072)}else Qe=!1,ce&&t.flags&1048576&&rh(t,Ks,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;ua(e,t),e=t.pendingProps;var o=Jr(t,ke.current);oo(t,n),o=Zu(null,t,r,e,o,n);var i=Ju();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Ke(r)?(i=!0,Gs(t)):i=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,zu(t),o.updater=ea,t.stateNode=o,o._reactInternals=t,Gu(t,r,e,n),t=ac(null,t,r,!0,i,n)):(t.tag=0,ce&&i&&Du(t),$e(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(ua(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=__(r),e=Tt(r,e),o){case 0:t=sc(null,t,r,e,n);break e;case 1:t=qh(null,t,r,e,n);break e;case 11:t=Yh(null,t,r,e,n);break e;case 14:t=Wh(null,t,r,Tt(r.type,e),n);break e}throw Error(z(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Tt(r,o),sc(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Tt(r,o),qh(e,t,r,o,n);case 3:e:{if(Zh(t),e===null)throw Error(z(387));r=t.pendingProps,i=t.memoizedState,o=i.element,uh(e,t),Js(t,r,null,n);var s=t.memoizedState;if(r=s.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){o=ao(Error(z(423)),t),t=Jh(e,t,r,n,o);break e}else if(r!==o){o=ao(Error(z(424)),t),t=Jh(e,t,r,n,o);break e}else for(at=xn(t.stateNode.containerInfo.firstChild),st=t,ce=!0,xt=null,n=yh(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(no(),r===o){t=un(e,t,n);break e}$e(e,t,r,n)}t=t.child}return t;case 5:return Eh(t),e===null&&Mu(t),r=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,s=o.children,Tu(r,o)?s=null:i!==null&&Tu(r,i)&&(t.flags|=32),Xh(e,t),$e(e,t,s,n),t.child;case 6:return e===null&&Mu(t),null;case 13:return eg(e,t,n);case 4:return Yu(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=io(t,null,r,n):$e(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Tt(r,o),Yh(e,t,r,o,n);case 7:return $e(e,t,t.pendingProps,n),t.child;case 8:return $e(e,t,t.pendingProps.children,n),t.child;case 12:return $e(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,i=t.memoizedProps,s=o.value,ie(Xs,r._currentValue),r._currentValue=s,i!==null)if(Ot(i.value,s)){if(i.children===o.children&&!We.current){t=un(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var a=i.dependencies;if(a!==null){s=i.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(i.tag===1){l=ln(-1,n&-n),l.tag=2;var u=i.updateQueue;if(u!==null){u=u.shared;var c=u.pending;c===null?l.next=l:(l.next=c.next,c.next=l),u.pending=l}}i.lanes|=n,l=i.alternate,l!==null&&(l.lanes|=n),$u(i.return,n,t),a.lanes|=n;break}l=l.next}}else if(i.tag===10)s=i.type===t.type?null:i.child;else if(i.tag===18){if(s=i.return,s===null)throw Error(z(341));s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),$u(s,n,t),s=i.sibling}else s=i.child;if(s!==null)s.return=i;else for(s=i;s!==null;){if(s===t){s=null;break}if(i=s.sibling,i!==null){i.return=s.return,s=i;break}s=s.return}i=s}$e(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,oo(t,n),o=mt(o),r=r(o),t.flags|=1,$e(e,t,r,n),t.child;case 14:return r=t.type,o=Tt(r,t.pendingProps),o=Tt(r.type,o),Wh(e,t,r,o,n);case 15:return Kh(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Tt(r,o),ua(e,t),t.tag=1,Ke(r)?(e=!0,Gs(t)):e=!1,oo(t,n),hh(t,r,o),Gu(t,r,o,n),ac(null,t,r,!0,e,n);case 19:return ng(e,t,n);case 22:return Qh(e,t,n)}throw Error(z(156,t.tag))};function xg(e,t){return op(e,t)}function S_(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Et(e,t,n,r){return new S_(e,t,n,r)}function Tc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function __(e){if(typeof e=="function")return Tc(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Dl)return 11;if(e===Ml)return 14}return 2}function Un(e,t){var n=e.alternate;return n===null?(n=Et(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Sa(e,t,n,r,o,i){var s=2;if(r=e,typeof e=="function")Tc(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case Br:return hr(n.children,o,i,t);case Al:s=8,o|=8;break;case Ll:return e=Et(12,n,t,o|2),e.elementType=Ll,e.lanes=i,e;case kl:return e=Et(13,n,t,o),e.elementType=kl,e.lanes=i,e;case Pl:return e=Et(19,n,t,o),e.elementType=Pl,e.lanes=i,e;case kf:return _a(n,o,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Lf:s=10;break e;case Df:s=9;break e;case Dl:s=11;break e;case Ml:s=14;break e;case yn:s=16,r=null;break e}throw Error(z(130,e==null?e:typeof e,""))}return t=Et(s,n,t,o),t.elementType=e,t.type=r,t.lanes=i,t}function hr(e,t,n,r){return e=Et(7,e,r,t),e.lanes=n,e}function _a(e,t,n,r){return e=Et(22,e,r,t),e.elementType=kf,e.lanes=n,e.stateNode={isHidden:!1},e}function Cc(e,t,n){return e=Et(6,e,null,t),e.lanes=n,e}function Ic(e,t,n){return t=Et(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function w_(e,t,n,r,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=nu(0),this.expirationTimes=nu(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=nu(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function bc(e,t,n,r,o,i,s,a,l){return e=new w_(e,t,n,a,l),t===1?(t=1,i===!0&&(t|=8)):t=0,i=Et(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},zu(i),e}function R_(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Vr,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function Tg(e){if(!e)return Cn;e=e._reactInternals;e:{if(nr(e)!==e||e.tag!==1)throw Error(z(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Ke(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(z(171))}if(e.tag===1){var n=e.type;if(Ke(n))return eh(e,n,t)}return t}function Cg(e,t,n,r,o,i,s,a,l){return e=bc(n,r,!0,e,o,i,s,a,l),e.context=Tg(null),n=e.current,r=He(),o=Pn(n),i=ln(r,o),i.callback=t??null,An(n,i,o),e.current.lanes=o,Xo(e,o,r),qe(e,r),e}function wa(e,t,n,r){var o=t.current,i=He(),s=Pn(o);return n=Tg(n),t.context===null?t.context=n:t.pendingContext=n,t=ln(i,s),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=An(o,t,s),e!==null&&(bt(e,o,s,i),Zs(e,o,s)),s}function Ra(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function Ig(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Ac(e,t){Ig(e,t),(e=e.alternate)&&Ig(e,t)}function N_(){return null}var bg=typeof reportError=="function"?reportError:function(e){console.error(e)};function Lc(e){this._internalRoot=e}Na.prototype.render=Lc.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(z(409));wa(e,t,null,null)},Na.prototype.unmount=Lc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;dr(function(){wa(null,e,null,null)}),t[nn]=null}};function Na(e){this._internalRoot=e}Na.prototype.unstable_scheduleHydration=function(e){if(e){var t=fp();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Rn.length&&t!==0&&t<Rn[n].priority;n++);Rn.splice(n,0,e),n===0&&gp(e)}};function Dc(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Oa(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Ag(){}function O_(e,t,n,r,o){if(o){if(typeof r=="function"){var i=r;r=function(){var u=Ra(s);i.call(u)}}var s=Cg(t,r,e,0,null,!1,!1,"",Ag);return e._reactRootContainer=s,e[nn]=s.current,ci(e.nodeType===8?e.parentNode:e),dr(),s}for(;o=e.lastChild;)e.removeChild(o);if(typeof r=="function"){var a=r;r=function(){var u=Ra(l);a.call(u)}}var l=bc(e,0,!1,null,null,!1,!1,"",Ag);return e._reactRootContainer=l,e[nn]=l.current,ci(e.nodeType===8?e.parentNode:e),dr(function(){wa(t,l,n,r)}),l}function xa(e,t,n,r,o){var i=n._reactRootContainer;if(i){var s=i;if(typeof o=="function"){var a=o;o=function(){var l=Ra(s);a.call(l)}}wa(t,s,e,o)}else s=O_(n,t,e,o,r);return Ra(s)}cp=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Qo(t.pendingLanes);n!==0&&(ru(t,n|1),qe(t,Ee()),!(ne&6)&&(co=Ee()+500,In()))}break;case 13:dr(function(){var r=an(e,1);if(r!==null){var o=He();bt(r,e,1,o)}}),Ac(e,1)}},ou=function(e){if(e.tag===13){var t=an(e,134217728);if(t!==null){var n=He();bt(t,e,134217728,n)}Ac(e,134217728)}},dp=function(e){if(e.tag===13){var t=Pn(e),n=an(e,t);if(n!==null){var r=He();bt(n,e,t,r)}Ac(e,t)}},fp=function(){return re},pp=function(e,t){var n=re;try{return re=e,t()}finally{re=n}},Xl=function(e,t,n){switch(t){case"input":if(Hl(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var o=zs(r);if(!o)throw Error(z(90));Uf(r),Hl(r,o)}}}break;case"textarea":Hf(e,n);break;case"select":t=n.value,t!=null&&$r(e,!!n.multiple,t,!1)}},qf=Nc,Zf=dr;var x_={usingClientEntryPoint:!1,Events:[pi,qr,zs,Qf,Xf,Nc]},Ti={findFiberByHostInstance:rr,bundleType:0,version:"18.2.0",rendererPackageName:"react-dom"},T_={bundleType:Ti.bundleType,version:Ti.version,rendererPackageName:Ti.rendererPackageName,rendererConfig:Ti.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:tn.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=np(e),e===null?null:e.stateNode},findFiberByHostInstance:Ti.findFiberByHostInstance||N_,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0-next-9e3b772b8-20220608"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ta=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ta.isDisabled&&Ta.supportsFiber)try{Ns=Ta.inject(T_),Vt=Ta}catch{}}rt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=x_,rt.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Dc(t))throw Error(z(200));return R_(e,t,null,n)},rt.createRoot=function(e,t){if(!Dc(e))throw Error(z(299));var n=!1,r="",o=bg;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=bc(e,1,!1,null,null,n,!1,r,o),e[nn]=t.current,ci(e.nodeType===8?e.parentNode:e),new Lc(t)},rt.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(z(188)):(e=Object.keys(e).join(","),Error(z(268,e)));return e=np(t),e=e===null?null:e.stateNode,e},rt.flushSync=function(e){return dr(e)},rt.hydrate=function(e,t,n){if(!Oa(t))throw Error(z(200));return xa(null,e,t,!0,n)},rt.hydrateRoot=function(e,t,n){if(!Dc(e))throw Error(z(405));var r=n!=null&&n.hydratedSources||null,o=!1,i="",s=bg;if(n!=null&&(n.unstable_strictMode===!0&&(o=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(s=n.onRecoverableError)),t=Cg(t,null,e,1,n??null,o,!1,i,s),e[nn]=t.current,ci(e),r)for(e=0;e<r.length;e++)n=r[e],o=n._getVersion,o=o(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,o]:t.mutableSourceEagerHydrationData.push(n,o);return new Na(t)},rt.render=function(e,t,n){if(!Oa(t))throw Error(z(200));return xa(null,e,t,!1,n)},rt.unmountComponentAtNode=function(e){if(!Oa(e))throw Error(z(40));return e._reactRootContainer?(dr(function(){xa(null,null,e,!1,function(){e._reactRootContainer=null,e[nn]=null})}),!0):!1},rt.unstable_batchedUpdates=Nc,rt.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Oa(n))throw Error(z(200));if(e==null||e._reactInternals===void 0)throw Error(z(38));return xa(e,t,n,!1,r)},rt.version="18.2.0-next-9e3b772b8-20220608",function(e){function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(n){console.error(n)}}t(),e.exports=rt}(NE);var Lg=Ur;Ol.createRoot=Lg.createRoot,Ol.hydrateRoot=Lg.hydrateRoot;var C_=Object.create,kc=Object.defineProperty,I_=Object.getOwnPropertyDescriptor,b_=Object.getOwnPropertyNames,A_=Object.getPrototypeOf,L_=Object.prototype.hasOwnProperty,D_=(e,t,n)=>t in e?kc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,k_=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),P_=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of b_(t))!L_.call(e,o)&&o!==n&&kc(e,o,{get:()=>t[o],enumerable:!(r=I_(t,o))||r.enumerable});return e},M_=(e,t,n)=>(n=e!=null?C_(A_(e)):{},P_(t||!e||!e.__esModule?kc(n,"default",{value:e,enumerable:!0}):n,e)),Dg=(e,t,n)=>(D_(e,typeof t!="symbol"?t+"":t,n),n),U_=k_((e,t)=>{(function(n,r){typeof define=="function"&&define.amd?define(r):typeof t=="object"&&t.exports?t.exports=r():n.log=r()})(e,function(){var n=function(){},r="undefined",o=typeof window!==r&&typeof window.navigator!==r&&/Trident\/|MSIE /.test(window.navigator.userAgent),i=["trace","debug","info","warn","error"];function s(y,p){var g=y[p];if(typeof g.bind=="function")return g.bind(y);try{return Function.prototype.bind.call(g,y)}catch{return function(){return Function.prototype.apply.apply(g,[y,arguments])}}}function a(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function l(y){return y==="debug"&&(y="log"),typeof console===r?!1:y==="trace"&&o?a:console[y]!==void 0?s(console,y):console.log!==void 0?s(console,"log"):n}function u(y,p){for(var g=0;g<i.length;g++){var S=i[g];this[S]=g<y?n:this.methodFactory(S,y,p)}this.log=this.debug}function c(y,p,g){return function(){typeof console!==r&&(u.call(this,p,g),this[y].apply(this,arguments))}}function d(y,p,g){return l(y)||c.apply(this,arguments)}function f(y,p,g){var S=this,_;p=p??"WARN";var w="loglevel";typeof y=="string"?w+=":"+y:typeof y=="symbol"&&(w=void 0);function R(I){var V=(i[I]||"silent").toUpperCase();if(!(typeof window===r||!w)){try{window.localStorage[w]=V;return}catch{}try{window.document.cookie=encodeURIComponent(w)+"="+V+";"}catch{}}}function C(){var I;if(!(typeof window===r||!w)){try{I=window.localStorage[w]}catch{}if(typeof I===r)try{var V=window.document.cookie,$=V.indexOf(encodeURIComponent(w)+"=");$!==-1&&(I=/^([^;]+)/.exec(V.slice($))[1])}catch{}return S.levels[I]===void 0&&(I=void 0),I}}function L(){if(!(typeof window===r||!w)){try{window.localStorage.removeItem(w);return}catch{}try{window.document.cookie=encodeURIComponent(w)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch{}}}S.name=y,S.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},S.methodFactory=g||d,S.getLevel=function(){return _},S.setLevel=function(I,V){if(typeof I=="string"&&S.levels[I.toUpperCase()]!==void 0&&(I=S.levels[I.toUpperCase()]),typeof I=="number"&&I>=0&&I<=S.levels.SILENT){if(_=I,V!==!1&&R(I),u.call(S,I,y),typeof console===r&&I<S.levels.SILENT)return"No console available for logging"}else throw"log.setLevel() called with invalid level: "+I},S.setDefaultLevel=function(I){p=I,C()||S.setLevel(I,!1)},S.resetLevel=function(){S.setLevel(p,!1),L()},S.enableAll=function(I){S.setLevel(S.levels.TRACE,I)},S.disableAll=function(I){S.setLevel(S.levels.SILENT,I)};var B=C();B==null&&(B=p),S.setLevel(B,!1)}var h=new f,m={};h.getLogger=function(y){if(typeof y!="symbol"&&typeof y!="string"||y==="")throw new TypeError("You must supply a name when creating a logger.");var p=m[y];return p||(p=m[y]=new f(y,h.getLevel(),h.methodFactory)),p};var v=typeof window!==r?window.log:void 0;return h.noConflict=function(){return typeof window!==r&&window.log===h&&(window.log=v),h},h.getLoggers=function(){return m},h.default=h,h})}),F_=M_(U_(),1),V_=()=>new Date().toISOString(),Ci=F_.default.getLogger("signalwire"),B_=Ci.methodFactory;Ci.methodFactory=(e,t,n)=>{let r=B_(e,t,n);return function(...o){o.unshift(V_(),"-"),r(...o)}};var $_=Ci.getLevel();Ci.setLevel($_);var Ze=()=>Ci,H_=e=>({id:e.id,type:e.type,data:e.data,position:e.position}),z_=e=>({id:e.id,source:e.source,sourceHandle:e.sourceHandle,target:e.target,targetHandle:e.targetHandle}),kg=e=>{var t;return(t=e==null?void 0:e.trim())==null?void 0:t.toLowerCase()},Ca=e=>e.replace(/\s/g,""),Pc=({destinations:e,sessionTimeout:t,type:n})=>{let r=t&&t>0?t:void 0,o=e.map(s=>({from:"%{call.from}",to:Ca(s),session_timeout:r}));o.length||o.push({from:"%{call.from}",to:"",session_timeout:r});let i={switch:{variable:"connect_result",case:{connected:[]},default:[{switch:{variable:"connect_failed_reason",case:{busy:[],noAnswer:[],decline:[],error:[]},default:["hangup"]}}]}};switch(n){case"single":return[{connect:o[0]},i];case"serial":return[{connect:{serial:o}},i];case"parallel":return[{connect:{parallel:o}},i];default:return Ze().warn(`The type '${n}' is not supported yet.`),[{connect:o[0]},i]}},j_=/\bmale\b/i,G_=/\bfemale\b/i,Y_=e=>{if(e){if(G_.test(e))return"female";if(j_.test(e))return"male"}},Pg=(e,t)=>{if(typeof e=="object"&&!Array.isArray(e)){t.language&&(e.say_language=t.language);let n=Y_(t.gender);n&&(e.say_gender=n),t.voice&&(e.say_voice=t.voice)}return e},W_={answer:({data:{maxDuration:e}})=>e?{answer:{max_duration:e}}:"answer",hangup:({data:{reason:e}})=>e?{hangup:{reason:e}}:"hangup",play:({data:e})=>{let t=e.url||`say:${e.text||"Unknown TTS"}`,n=Pg({url:t},e);return e.volume&&(n.volume=e.volume),{play:n}},forwardAddress:({data:e})=>Pc(e),forwardPhone:({data:e})=>Pc(e),forwardResource:({data:e})=>Pc(e),promptPlay:({data:e})=>{let t=Pg({play:"say:Unknown value"},e);e.text&&(t.play=`say:${e.text}`),e.url&&(t.play=e.url),e.volume&&(t.volume=e.volume);let n=e.options.reduce((r,o)=>{let i=kg(o.command);i&&r.speechHints.push(i);let s=Ca(o.digit);return s&&(r.maxDigits=Math.max(r.maxDigits,s.length)),r},{speechHints:[],maxDigits:0});return n.speechHints.length&&(t.speech_hints=n.speechHints,t.speech_language="en-US"),n.maxDigits>1&&(t.max_digits=n.maxDigits),[{prompt:t},{switch:{variable:"prompt_result",case:{failed:[{play:"say:Error while gathering input."},"hangup"],no_input:[],no_match:[]},default:[{switch:{variable:"prompt_value",case:{},default:[]}}]}}]},handleCall:()=>"start",record:({data:e})=>({record:{beep:e.beep,direction:e.direction,end_silence_timeout:e.endSilenceTimeout,format:e.format,initial_timeout:e.initialTimeout,input_sensitivity:e.inputSensitivity,stereo:e.stereo,terminators:e.terminators}}),recordCallStart:({data:e})=>({record_call:{beep:e.beep,control_id:e.controlId,direction:e.direction,end_silence_timeout:e.endSilenceTimeout,format:e.format,initial_timeout:e.initialTimeout,input_sensitivity:e.inputSensitivity,stereo:e.stereo,terminators:e.terminators}}),recordCallStop:({data:e})=>({stop_record_call:e.controlId}),sendSms:({data:e})=>{let{fromNumber:t,toNumber:n,body:r}=e;return{send_sms:{from_number:Ca(t),to_number:Ca(n),body:r}}},set:({data:{variables:e}})=>{let t={};return e.forEach(({key:n,value:r})=>{t[n]=r}),{set:t}},unset:({data:{variables:e}})=>({unset:e.map(({key:t})=>t)}),request:({data:e})=>[{request:{url:e.url,method:e.method,timeout:e.timeout,connect_timeout:e.connectTimeout,save_variables:e.saveVariables,headers:e.headers&&Object.keys(e.headers).length?e.headers:void 0,body:e.body?e.body:void 0}},{switch:{variable:"request_result",case:{success:[]},default:[]}}],cond:()=>({cond:[]}),condRequest:({data:e})=>[{request:{url:e.url,method:e.method,timeout:e.timeout,connect_timeout:e.connectTimeout,save_variables:e.saveVariables,headers:e.headers&&Object.keys(e.headers).length?e.headers:void 0,body:e.body?e.body:void 0}},{switch:{variable:"request_result",case:{success:[]},default:[]}}]},po=e=>{try{return W_[e.__type](e.node)}catch(t){throw Ze().error("Unknown Verb",e),t}},K_="1.0.0",Q_=e=>{let t=Ze(),n=new Set,r=new Map,o=new Set,i=new Map([["main",[]]]),s=new Map,a="",l=_=>i.has(_),u=_=>o.has(_),c=_=>o.add(_);e.nodes.forEach(_=>{r.set(_.id,{node:_,children:[]}),_.type==="handleCall"&&(a=_.id)}),e.edges.forEach(_=>{let w=r.get(_.source),R=r.get(_.target);if(!w||!R)return t.warn("Invalid edge:",_);w.children.push(_.target),_.sourceHandle&&s.set(_.sourceHandle,R),n.has(_.target)&&i.set(_.target,[]),n.add(_.target)});let d=[...i.keys()],f=(_,w)=>{let R=s.get(w.id);if(R){let C=[];i.set(w.id,C),w.digit&&(_[w.digit]=C);let L=kg(w.command);L&&(_[L]=C);let B=l(R.node.id);if(B){let I={transfer:R.node.id};w.digit&&_[w.digit].push(I),L&&!_[L].includes(I)&&_[L].push(I)}p({sectionName:B?R.node.id:w.id,current:R})}return _},h=(_,w)=>{let R=s.get(w.id);if(R){let C=[];i.set(w.id,C),_[w.result]=C;let L=l(R.node.id);L&&_[w.result].push({transfer:R.node.id}),p({sectionName:L?R.node.id:w.id,current:R})}return _},m={then:(_,w)=>{if(w.result!=="success")return _;let R=s.get(w.id);if(R){let C=[];i.set(w.id,C),_=C;let L=l(R.node.id);L&&_.push({transfer:R.node.id}),p({sectionName:L?R.node.id:w.id,current:R})}return _},else:(_,w)=>{if(w.result==="success")return _;let R=s.get(w.id);if(R){let C=[];i.set(w.id,C),_=C;let L=l(R.node.id);L&&_.push({transfer:R.node.id}),p({sectionName:L?R.node.id:w.id,current:R})}return _}},v={options:(_,w)=>{let R=s.get(w.id),C={when:w.value,then:[]};if(R){let L=[];i.set(w.id,L),C.then=L;let B=l(R.node.id);B&&C.then.push({transfer:R.node.id}),_.push(C),p({sectionName:B?R.node.id:w.id,current:R})}return _},fallback:_=>{let w=s.get(_),R={else:[]};if(w){let C=[];i.set(_,C),R.else=C;let L=l(w.node.id);L&&R.else.push({transfer:w.node.id}),p({sectionName:L?w.node.id:_,current:w})}return R}},y=_=>{let w=s.get(_),R=[];if(w){let C=[];i.set(_,C),R=C;let L=l(w.node.id);L&&R.push({transfer:w.node.id}),p({sectionName:L?w.node.id:_,current:w})}return R},p=({sectionName:_,current:w})=>{var C,L,B;if(u(w.node.id))return;c(w.node.id);let R=i.get(_);if(!R){t.warn("Unknown section name:",_);return}switch(w.node.type){case"promptPlay":{let I=po({__type:w.node.type,node:w.node});if(!Array.isArray(I)){t.warn("Invalid gather node",I);return}(L=(C=w.node.data)==null?void 0:C.results)!=null&&L.length&&(I[1].switch.case={...I[1].switch.case,...w.node.data.results.reduce(h,{})}),I[1].switch.default[0].switch.case=w.node.data.options.reduce(f,{}),(B=I[1].switch.case)!=null&&B.no_match&&(I[1].switch.default[0].switch.default=I[1].switch.case.no_match),R.push(...I);return}case"cond":{let I=po({__type:w.node.type,node:w.node});I.cond=w.node.data.options.reduce(v.options,[]),I.cond.push(v.fallback(w.node.data.fallback)),R.push(I);return}case"condRequest":{let I=po({__type:w.node.type,node:w.node}),V=w.node.data.options.reduce(v.options,[]),$=v.fallback(w.node.data.fallback),F={cond:[...V,$]};I[1].switch.case.success=[F],I[1].switch.default=y(w.node.data.error),R.push(I);return}case"forwardPhone":case"forwardAddress":case"forwardResource":{let I=po({__type:w.node.type,node:w.node});if(!Array.isArray(I)){t.warn("Invalid connect node",I);return}w.node.data.options.length&&(I[1].switch.case.connected=w.node.data.options.reduce(m.then,[]),I[1].switch.default[0].switch.case=w.node.data.options.filter(V=>V.result!=="success").reduce(h,{})),R.push(...I);return}case"request":{let I=po({__type:w.node.type,node:w.node});if(!Array.isArray(I)){t.warn("Invalid request node",I);return}I[1].switch.case.success=w.node.data.options.reduce(m.then,[]),I[1].switch.default=w.node.data.options.reduce(m.else,[]),R.push(...I);return}default:{let I=po({__type:w.node.type,node:w.node});w.node.type!=="handleCall"&&R.push(I),w.children.forEach(V=>{let $=r.get(V);if(!$)return t.warn("Invalid Child Node",V);let F=l(V);F&&R.push({transfer:V}),p({sectionName:F?V:_,current:$})});break}}},g=r.get(a);g&&p({sectionName:"main",current:g});let S={};return d.forEach(_=>{let w=i.get(_);w&&(S[_]=w)}),t.debug("sections",JSON.stringify(S)),{version:K_,sections:S}},Mg=class extends Error{constructor(e,t){super(t),this.code=e,this.message=t,Dg(this,"name","AuthError"),Object.setPrototypeOf(this,Mg.prototype)}},Ug=class extends Error{constructor(t,n,r){super(n),this.code=t,this.message=n,this.response=r,Dg(this,"name","HttpError"),Object.setPrototypeOf(this,Ug.prototype)}};async function X_(e,t){let n=await fetch(e,t);if(!n.ok){if(n.status===401)throw new Mg(n.status,"Unauthorized");let r;try{r=await n.json()}catch{}let o=r!=null&&r.errors?JSON.stringify(r.errors):`Error Code: ${n.status}`;throw new Ug(n.status,o,r)}try{n.parsedBody=await n.json()}catch{}return n}var q_=({timeout:e=3e4,...t},n=X_)=>async(r,o)=>{let i={...o!=null&&o.body?{"Content-Type":"application/json"}:{},...t.headers,...o==null?void 0:o.headers},s=J_({...t,...o,headers:i});s.credentials="same-origin";let a;if(e){let l=new AbortController,u=l.signal;s.signal=u,a=setTimeout(()=>{l.abort()},e)}try{return{body:(await n(ew({url:r,searchParams:o==null?void 0:o.searchParams}),s)).parsedBody}}finally{a&&clearTimeout(a)}},Z_=e=>typeof e=="string"?e:JSON.stringify(e),J_=e=>Object.entries(e).reduce((t,[n,r])=>n==="body"?{...t,body:Z_(r)}:r!=null?{...t,[n]:r}:t,{}),ew=({url:e,searchParams:t})=>{let n=new URL(e);return t&&Object.entries(t).forEach(([r,o])=>{o!=null&&n.searchParams.append(r,o)}),n.toString()},tw=e=>{let t=Ze(),n=q_(e);return{getFlow:async()=>{var r;try{let{body:o}=await n(e.getFlowURL);switch(t.info("getFlow",o),(r=o==null?void 0:o.flow_data)==null?void 0:r.builderVersion){default:return o}}catch(o){if(t.error("Could not load flow. URL:",e.getFlowURL),o instanceof Error)throw o;return{}}},putFlow:async r=>{let o={type:"call_flow",document_version:r.documentVersion+1,flow_data:{builderVersion:r.builderVersion,nodes:r.nodes.map(H_),edges:r.edges.map(z_)},relayml:Q_({nodes:r.nodes,edges:r.edges})},i=await n(e.updateFlowURL,{method:"PUT",body:o});return t.info("putFlow",i.body),i.body},deployFlow:async r=>{let o={document_version:r.documentVersion},i=await n(e.deployFlowURL,{method:"POST",body:o});return t.info("deployFlow",i.body),i.body}}};function Je(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,r;n<e.length;n++)(r=Je(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}const Fg=e=>{let t;const n=new Set,r=(l,u)=>{const c=typeof l=="function"?l(t):l;if(!Object.is(c,t)){const d=t;t=u??typeof c!="object"?c:Object.assign({},t,c),n.forEach(f=>f(t,d))}},o=()=>t,a={setState:r,getState:o,subscribe:l=>(n.add(l),()=>n.delete(l)),destroy:()=>{var l;((l={VITE_BASE_URL:"",VITE_BASIC_AUTH:"signalwire:1aG93uXk",VITE_DEFAULT_STYLE_HREF:"https://cdn.swire.io/npm/@signalwire/cfb@dev/dist/style.css",VITE_DEFAULT_VOICES_URL:"https://cdn.signalwire.com/npm/@signalwire/cfb@dev/dist/voices.json",BASE_URL:"/cfb/",MODE:"staging",DEV:!1,PROD:!0,SSR:!1})==null?void 0:l.MODE)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}};return t=e(r,o,a),a},Vg=e=>e?Fg(e):Fg;var Mc={},nw={get exports(){return Mc},set exports(e){Mc=e}},Bg={},Uc={},rw={get exports(){return Uc},set exports(e){Uc=e}},$g={};/**
45
45
  * @license React
46
46
  * use-sync-external-store-shim.production.min.js
47
47
  *
@@ -49,7 +49,7 @@ Error generating stack: `+i.message+`
49
49
  *
50
50
  * This source code is licensed under the MIT license found in the
51
51
  * LICENSE file in the root directory of this source tree.
52
- */var ho=N;function ow(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var iw=typeof Object.is=="function"?Object.is:ow,sw=ho.useState,aw=ho.useEffect,lw=ho.useLayoutEffect,uw=ho.useDebugValue;function cw(e,t){var n=t(),r=sw({inst:{value:n,getSnapshot:t}}),o=r[0].inst,i=r[1];return lw(function(){o.value=n,o.getSnapshot=t,Fc(o)&&i({inst:o})},[e,n,t]),aw(function(){return Fc(o)&&i({inst:o}),e(function(){Fc(o)&&i({inst:o})})},[e]),uw(n),n}function Fc(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!iw(e,n)}catch{return!0}}function dw(e,t){return t()}var fw=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?dw:cw;Hg.useSyncExternalStore=ho.useSyncExternalStore!==void 0?ho.useSyncExternalStore:fw,function(e){e.exports=Hg}(rw);/**
52
+ */var ho=N;function ow(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var iw=typeof Object.is=="function"?Object.is:ow,sw=ho.useState,aw=ho.useEffect,lw=ho.useLayoutEffect,uw=ho.useDebugValue;function cw(e,t){var n=t(),r=sw({inst:{value:n,getSnapshot:t}}),o=r[0].inst,i=r[1];return lw(function(){o.value=n,o.getSnapshot=t,Fc(o)&&i({inst:o})},[e,n,t]),aw(function(){return Fc(o)&&i({inst:o}),e(function(){Fc(o)&&i({inst:o})})},[e]),uw(n),n}function Fc(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!iw(e,n)}catch{return!0}}function dw(e,t){return t()}var fw=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?dw:cw;$g.useSyncExternalStore=ho.useSyncExternalStore!==void 0?ho.useSyncExternalStore:fw,function(e){e.exports=$g}(rw);/**
53
53
  * @license React
54
54
  * use-sync-external-store-shim/with-selector.production.min.js
55
55
  *
@@ -57,13 +57,13 @@ Error generating stack: `+i.message+`
57
57
  *
58
58
  * This source code is licensed under the MIT license found in the
59
59
  * LICENSE file in the root directory of this source tree.
60
- */var Ia=N,pw=Uc;function hw(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var gw=typeof Object.is=="function"?Object.is:hw,mw=pw.useSyncExternalStore,vw=Ia.useRef,yw=Ia.useEffect,Ew=Ia.useMemo,Sw=Ia.useDebugValue;$g.useSyncExternalStoreWithSelector=function(e,t,n,r,o){var i=vw(null);if(i.current===null){var s={hasValue:!1,value:null};i.current=s}else s=i.current;i=Ew(function(){function l(h){if(!u){if(u=!0,c=h,h=r(h),o!==void 0&&s.hasValue){var m=s.value;if(o(m,h))return d=m}return d=h}if(m=d,gw(c,h))return m;var v=r(h);return o!==void 0&&o(m,v)?m:(c=h,d=v)}var u=!1,c,d,f=n===void 0?null:n;return[function(){return l(t())},f===null?void 0:function(){return l(f())}]},[t,n,r,o]);var a=mw(e,i[0],i[1]);return yw(function(){s.hasValue=!0,s.value=a},[a]),Sw(a),a},function(e){e.exports=$g}(nw);const _w=gf(Mc),{useSyncExternalStoreWithSelector:ww}=_w;function zg(e,t=e.getState,n){const r=ww(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return N.useDebugValue(r),r}const jg=e=>{var t;((t={VITE_BASE_URL:"",VITE_BASIC_AUTH:"signalwire:1aG93uXk",VITE_DEFAULT_STYLE_HREF:"https://cdn.swire.io/npm/@signalwire/cfb@dev/dist/style.css",VITE_DEFAULT_VOICES_URL:"https://cdn.signalwire.com/npm/@signalwire/cfb@dev/dist/voices.json",BASE_URL:"/cfb/",MODE:"staging",DEV:!1,PROD:!0,SSR:!1})==null?void 0:t.MODE)!=="production"&&typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const n=typeof e=="function"?Bg(e):e,r=(o,i)=>zg(n,o,i);return Object.assign(r,n),r},Ii=e=>e?jg(e):jg;function ze(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[r,o]of e)if(!Object.is(o,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(let r=0;r<n.length;r++)if(!Object.prototype.hasOwnProperty.call(t,n[r])||!Object.is(e[n[r]],t[n[r]]))return!1;return!0}var Rw={value:()=>{}};function ba(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new Aa(n)}function Aa(e){this._=e}function Nw(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",o=n.indexOf(".");if(o>=0&&(r=n.slice(o+1),n=n.slice(0,o)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}Aa.prototype=ba.prototype={constructor:Aa,on:function(e,t){var n=this._,r=Nw(e+"",n),o,i=-1,s=r.length;if(arguments.length<2){for(;++i<s;)if((o=(e=r[i]).type)&&(o=Ow(n[o],e.name)))return o;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++i<s;)if(o=(e=r[i]).type)n[o]=Gg(n[o],e.name,t);else if(t==null)for(o in n)n[o]=Gg(n[o],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Aa(e)},call:function(e,t){if((o=arguments.length-2)>0)for(var n=new Array(o),r=0,o,i;r<o;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(i=this._[e],r=0,o=i.length;r<o;++r)i[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],o=0,i=r.length;o<i;++o)r[o].value.apply(t,n)}};function Ow(e,t){for(var n=0,r=e.length,o;n<r;++n)if((o=e[n]).name===t)return o.value}function Gg(e,t,n){for(var r=0,o=e.length;r<o;++r)if(e[r].name===t){e[r]=Rw,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var Vc="http://www.w3.org/1999/xhtml";const Yg={svg:"http://www.w3.org/2000/svg",xhtml:Vc,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function La(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),Yg.hasOwnProperty(t)?{space:Yg[t],local:e}:e}function xw(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Vc&&t.documentElement.namespaceURI===Vc?t.createElement(e):t.createElementNS(n,e)}}function Tw(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Wg(e){var t=La(e);return(t.local?Tw:xw)(t)}function Cw(){}function Bc(e){return e==null?Cw:function(){return this.querySelector(e)}}function Iw(e){typeof e!="function"&&(e=Bc(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var i=t[o],s=i.length,a=r[o]=new Array(s),l,u,c=0;c<s;++c)(l=i[c])&&(u=e.call(l,l.__data__,c,i))&&("__data__"in l&&(u.__data__=l.__data__),a[c]=u);return new ut(r,this._parents)}function bw(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function Aw(){return[]}function Kg(e){return e==null?Aw:function(){return this.querySelectorAll(e)}}function Lw(e){return function(){return bw(e.apply(this,arguments))}}function Dw(e){typeof e=="function"?e=Lw(e):e=Kg(e);for(var t=this._groups,n=t.length,r=[],o=[],i=0;i<n;++i)for(var s=t[i],a=s.length,l,u=0;u<a;++u)(l=s[u])&&(r.push(e.call(l,l.__data__,u,s)),o.push(l));return new ut(r,o)}function Qg(e){return function(){return this.matches(e)}}function Xg(e){return function(t){return t.matches(e)}}var kw=Array.prototype.find;function Pw(e){return function(){return kw.call(this.children,e)}}function Mw(){return this.firstElementChild}function Uw(e){return this.select(e==null?Mw:Pw(typeof e=="function"?e:Xg(e)))}var Fw=Array.prototype.filter;function Vw(){return Array.from(this.children)}function Bw(e){return function(){return Fw.call(this.children,e)}}function $w(e){return this.selectAll(e==null?Vw:Bw(typeof e=="function"?e:Xg(e)))}function Hw(e){typeof e!="function"&&(e=Qg(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var i=t[o],s=i.length,a=r[o]=[],l,u=0;u<s;++u)(l=i[u])&&e.call(l,l.__data__,u,i)&&a.push(l);return new ut(r,this._parents)}function qg(e){return new Array(e.length)}function zw(){return new ut(this._enter||this._groups.map(qg),this._parents)}function Da(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Da.prototype={constructor:Da,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function jw(e){return function(){return e}}function Gw(e,t,n,r,o,i){for(var s=0,a,l=t.length,u=i.length;s<u;++s)(a=t[s])?(a.__data__=i[s],r[s]=a):n[s]=new Da(e,i[s]);for(;s<l;++s)(a=t[s])&&(o[s]=a)}function Yw(e,t,n,r,o,i,s){var a,l,u=new Map,c=t.length,d=i.length,f=new Array(c),h;for(a=0;a<c;++a)(l=t[a])&&(f[a]=h=s.call(l,l.__data__,a,t)+"",u.has(h)?o[a]=l:u.set(h,l));for(a=0;a<d;++a)h=s.call(e,i[a],a,i)+"",(l=u.get(h))?(r[a]=l,l.__data__=i[a],u.delete(h)):n[a]=new Da(e,i[a]);for(a=0;a<c;++a)(l=t[a])&&u.get(f[a])===l&&(o[a]=l)}function Ww(e){return e.__data__}function Kw(e,t){if(!arguments.length)return Array.from(this,Ww);var n=t?Yw:Gw,r=this._parents,o=this._groups;typeof e!="function"&&(e=jw(e));for(var i=o.length,s=new Array(i),a=new Array(i),l=new Array(i),u=0;u<i;++u){var c=r[u],d=o[u],f=d.length,h=Qw(e.call(c,c&&c.__data__,u,r)),m=h.length,v=a[u]=new Array(m),y=s[u]=new Array(m),p=l[u]=new Array(f);n(c,d,v,y,p,h,t);for(var g=0,S=0,_,w;g<m;++g)if(_=v[g]){for(g>=S&&(S=g+1);!(w=y[S])&&++S<m;);_._next=w||null}}return s=new ut(s,r),s._enter=a,s._exit=l,s}function Qw(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Xw(){return new ut(this._exit||this._groups.map(qg),this._parents)}function qw(e,t,n){var r=this.enter(),o=this,i=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(o=t(o),o&&(o=o.selection())),n==null?i.remove():n(i),r&&o?r.merge(o).order():o}function Zw(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,o=n.length,i=r.length,s=Math.min(o,i),a=new Array(o),l=0;l<s;++l)for(var u=n[l],c=r[l],d=u.length,f=a[l]=new Array(d),h,m=0;m<d;++m)(h=u[m]||c[m])&&(f[m]=h);for(;l<o;++l)a[l]=n[l];return new ut(a,this._parents)}function Jw(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],o=r.length-1,i=r[o],s;--o>=0;)(s=r[o])&&(i&&s.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(s,i),i=s);return this}function e1(e){e||(e=t1);function t(d,f){return d&&f?e(d.__data__,f.__data__):!d-!f}for(var n=this._groups,r=n.length,o=new Array(r),i=0;i<r;++i){for(var s=n[i],a=s.length,l=o[i]=new Array(a),u,c=0;c<a;++c)(u=s[c])&&(l[c]=u);l.sort(t)}return new ut(o,this._parents).order()}function t1(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function n1(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function r1(){return Array.from(this)}function o1(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],o=0,i=r.length;o<i;++o){var s=r[o];if(s)return s}return null}function i1(){let e=0;for(const t of this)++e;return e}function s1(){return!this.node()}function a1(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var o=t[n],i=0,s=o.length,a;i<s;++i)(a=o[i])&&e.call(a,a.__data__,i,o);return this}function l1(e){return function(){this.removeAttribute(e)}}function u1(e){return function(){this.removeAttributeNS(e.space,e.local)}}function c1(e,t){return function(){this.setAttribute(e,t)}}function d1(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function f1(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function p1(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function h1(e,t){var n=La(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?u1:l1:typeof t=="function"?n.local?p1:f1:n.local?d1:c1)(n,t))}function Zg(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function g1(e){return function(){this.style.removeProperty(e)}}function m1(e,t,n){return function(){this.style.setProperty(e,t,n)}}function v1(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function y1(e,t,n){return arguments.length>1?this.each((t==null?g1:typeof t=="function"?v1:m1)(e,t,n??"")):go(this.node(),e)}function go(e,t){return e.style.getPropertyValue(t)||Zg(e).getComputedStyle(e,null).getPropertyValue(t)}function E1(e){return function(){delete this[e]}}function S1(e,t){return function(){this[e]=t}}function _1(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function w1(e,t){return arguments.length>1?this.each((t==null?E1:typeof t=="function"?_1:S1)(e,t)):this.node()[e]}function Jg(e){return e.trim().split(/^|\s+/)}function $c(e){return e.classList||new em(e)}function em(e){this._node=e,this._names=Jg(e.getAttribute("class")||"")}em.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function tm(e,t){for(var n=$c(e),r=-1,o=t.length;++r<o;)n.add(t[r])}function nm(e,t){for(var n=$c(e),r=-1,o=t.length;++r<o;)n.remove(t[r])}function R1(e){return function(){tm(this,e)}}function N1(e){return function(){nm(this,e)}}function O1(e,t){return function(){(t.apply(this,arguments)?tm:nm)(this,e)}}function x1(e,t){var n=Jg(e+"");if(arguments.length<2){for(var r=$c(this.node()),o=-1,i=n.length;++o<i;)if(!r.contains(n[o]))return!1;return!0}return this.each((typeof t=="function"?O1:t?R1:N1)(n,t))}function T1(){this.textContent=""}function C1(e){return function(){this.textContent=e}}function I1(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function b1(e){return arguments.length?this.each(e==null?T1:(typeof e=="function"?I1:C1)(e)):this.node().textContent}function A1(){this.innerHTML=""}function L1(e){return function(){this.innerHTML=e}}function D1(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function k1(e){return arguments.length?this.each(e==null?A1:(typeof e=="function"?D1:L1)(e)):this.node().innerHTML}function P1(){this.nextSibling&&this.parentNode.appendChild(this)}function M1(){return this.each(P1)}function U1(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function F1(){return this.each(U1)}function V1(e){var t=typeof e=="function"?e:Wg(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function B1(){return null}function $1(e,t){var n=typeof e=="function"?e:Wg(e),r=t==null?B1:typeof t=="function"?t:Bc(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function H1(){var e=this.parentNode;e&&e.removeChild(this)}function z1(){return this.each(H1)}function j1(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function G1(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Y1(e){return this.select(e?G1:j1)}function W1(e){return arguments.length?this.property("__data__",e):this.node().__data__}function K1(e){return function(t){e.call(this,t,this.__data__)}}function Q1(e){return e.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");return r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function X1(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,o=t.length,i;n<o;++n)i=t[n],(!e.type||i.type===e.type)&&i.name===e.name?this.removeEventListener(i.type,i.listener,i.options):t[++r]=i;++r?t.length=r:delete this.__on}}}function q1(e,t,n){return function(){var r=this.__on,o,i=K1(t);if(r){for(var s=0,a=r.length;s<a;++s)if((o=r[s]).type===e.type&&o.name===e.name){this.removeEventListener(o.type,o.listener,o.options),this.addEventListener(o.type,o.listener=i,o.options=n),o.value=t;return}}this.addEventListener(e.type,i,n),o={type:e.type,name:e.name,value:t,listener:i,options:n},r?r.push(o):this.__on=[o]}}function Z1(e,t,n){var r=Q1(e+""),o,i=r.length,s;if(arguments.length<2){var a=this.node().__on;if(a){for(var l=0,u=a.length,c;l<u;++l)for(o=0,c=a[l];o<i;++o)if((s=r[o]).type===c.type&&s.name===c.name)return c.value}return}for(a=t?q1:X1,o=0;o<i;++o)this.each(a(r[o],t,n));return this}function rm(e,t,n){var r=Zg(e),o=r.CustomEvent;typeof o=="function"?o=new o(t,n):(o=r.document.createEvent("Event"),n?(o.initEvent(t,n.bubbles,n.cancelable),o.detail=n.detail):o.initEvent(t,!1,!1)),e.dispatchEvent(o)}function J1(e,t){return function(){return rm(this,e,t)}}function eR(e,t){return function(){return rm(this,e,t.apply(this,arguments))}}function tR(e,t){return this.each((typeof t=="function"?eR:J1)(e,t))}function*nR(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],o=0,i=r.length,s;o<i;++o)(s=r[o])&&(yield s)}var om=[null];function ut(e,t){this._groups=e,this._parents=t}function bi(){return new ut([[document.documentElement]],om)}function rR(){return this}ut.prototype=bi.prototype={constructor:ut,select:Iw,selectAll:Dw,selectChild:Uw,selectChildren:$w,filter:Hw,data:Kw,enter:zw,exit:Xw,join:qw,merge:Zw,selection:rR,order:Jw,sort:e1,call:n1,nodes:r1,node:o1,size:i1,empty:s1,each:a1,attr:h1,style:y1,property:w1,classed:x1,text:b1,html:k1,raise:M1,lower:F1,append:V1,insert:$1,remove:z1,clone:Y1,datum:W1,on:Z1,dispatch:tR,[Symbol.iterator]:nR};function At(e){return typeof e=="string"?new ut([[document.querySelector(e)]],[document.documentElement]):new ut([[e]],om)}function oR(e){let t;for(;t=e.sourceEvent;)e=t;return e}function jt(e,t){if(e=oR(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var o=t.getBoundingClientRect();return[e.clientX-o.left-t.clientLeft,e.clientY-o.top-t.clientTop]}}return[e.pageX,e.pageY]}const iR={passive:!1},Ai={capture:!0,passive:!1};function Hc(e){e.stopImmediatePropagation()}function mo(e){e.preventDefault(),e.stopImmediatePropagation()}function im(e){var t=e.document.documentElement,n=At(e).on("dragstart.drag",mo,Ai);"onselectstart"in t?n.on("selectstart.drag",mo,Ai):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function sm(e,t){var n=e.document.documentElement,r=At(e).on("dragstart.drag",null);t&&(r.on("click.drag",mo,Ai),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const ka=e=>()=>e;function zc(e,{sourceEvent:t,subject:n,target:r,identifier:o,active:i,x:s,y:a,dx:l,dy:u,dispatch:c}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:o,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:s,enumerable:!0,configurable:!0},y:{value:a,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:c}})}zc.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function sR(e){return!e.ctrlKey&&!e.button}function aR(){return this.parentNode}function lR(e,t){return t??{x:e.x,y:e.y}}function uR(){return navigator.maxTouchPoints||"ontouchstart"in this}function cR(){var e=sR,t=aR,n=lR,r=uR,o={},i=ba("start","drag","end"),s=0,a,l,u,c,d=0;function f(_){_.on("mousedown.drag",h).filter(r).on("touchstart.drag",y).on("touchmove.drag",p,iR).on("touchend.drag touchcancel.drag",g).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function h(_,w){if(!(c||!e.call(this,_,w))){var R=S(this,t.call(this,_,w),_,w,"mouse");R&&(At(_.view).on("mousemove.drag",m,Ai).on("mouseup.drag",v,Ai),im(_.view),Hc(_),u=!1,a=_.clientX,l=_.clientY,R("start",_))}}function m(_){if(mo(_),!u){var w=_.clientX-a,R=_.clientY-l;u=w*w+R*R>d}o.mouse("drag",_)}function v(_){At(_.view).on("mousemove.drag mouseup.drag",null),sm(_.view,u),mo(_),o.mouse("end",_)}function y(_,w){if(e.call(this,_,w)){var R=_.changedTouches,C=t.call(this,_,w),L=R.length,B,I;for(B=0;B<L;++B)(I=S(this,C,_,w,R[B].identifier,R[B]))&&(Hc(_),I("start",_,R[B]))}}function p(_){var w=_.changedTouches,R=w.length,C,L;for(C=0;C<R;++C)(L=o[w[C].identifier])&&(mo(_),L("drag",_,w[C]))}function g(_){var w=_.changedTouches,R=w.length,C,L;for(c&&clearTimeout(c),c=setTimeout(function(){c=null},500),C=0;C<R;++C)(L=o[w[C].identifier])&&(Hc(_),L("end",_,w[C]))}function S(_,w,R,C,L,B){var I=i.copy(),V=jt(B||R,w),$,F,O;if((O=n.call(_,new zc("beforestart",{sourceEvent:R,target:f,identifier:L,active:s,x:V[0],y:V[1],dx:0,dy:0,dispatch:I}),C))!=null)return $=O.x-V[0]||0,F=O.y-V[1]||0,function M(D,A,T){var P=V,U;switch(D){case"start":o[L]=M,U=s++;break;case"end":delete o[L],--s;case"drag":V=jt(T||A,w),U=s;break}I.call(D,_,new zc(D,{sourceEvent:A,subject:O,target:f,identifier:L,active:U,x:V[0]+$,y:V[1]+F,dx:V[0]-P[0],dy:V[1]-P[1],dispatch:I}),C)}}return f.filter=function(_){return arguments.length?(e=typeof _=="function"?_:ka(!!_),f):e},f.container=function(_){return arguments.length?(t=typeof _=="function"?_:ka(_),f):t},f.subject=function(_){return arguments.length?(n=typeof _=="function"?_:ka(_),f):n},f.touchable=function(_){return arguments.length?(r=typeof _=="function"?_:ka(!!_),f):r},f.on=function(){var _=i.on.apply(i,arguments);return _===i?f:_},f.clickDistance=function(_){return arguments.length?(d=(_=+_)*_,f):Math.sqrt(d)},f}function jc(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function am(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Li(){}var Di=.7,Pa=1/Di,vo="\\s*([+-]?\\d+)\\s*",ki="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Gt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",dR=/^#([0-9a-f]{3,8})$/,fR=new RegExp(`^rgb\\(${vo},${vo},${vo}\\)$`),pR=new RegExp(`^rgb\\(${Gt},${Gt},${Gt}\\)$`),hR=new RegExp(`^rgba\\(${vo},${vo},${vo},${ki}\\)$`),gR=new RegExp(`^rgba\\(${Gt},${Gt},${Gt},${ki}\\)$`),mR=new RegExp(`^hsl\\(${ki},${Gt},${Gt}\\)$`),vR=new RegExp(`^hsla\\(${ki},${Gt},${Gt},${ki}\\)$`),lm={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};jc(Li,Pi,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:um,formatHex:um,formatHex8:yR,formatHsl:ER,formatRgb:cm,toString:cm});function um(){return this.rgb().formatHex()}function yR(){return this.rgb().formatHex8()}function ER(){return gm(this).formatHsl()}function cm(){return this.rgb().formatRgb()}function Pi(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=dR.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?dm(t):n===3?new et(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Ma(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Ma(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=fR.exec(e))?new et(t[1],t[2],t[3],1):(t=pR.exec(e))?new et(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=hR.exec(e))?Ma(t[1],t[2],t[3],t[4]):(t=gR.exec(e))?Ma(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=mR.exec(e))?hm(t[1],t[2]/100,t[3]/100,1):(t=vR.exec(e))?hm(t[1],t[2]/100,t[3]/100,t[4]):lm.hasOwnProperty(e)?dm(lm[e]):e==="transparent"?new et(NaN,NaN,NaN,0):null}function dm(e){return new et(e>>16&255,e>>8&255,e&255,1)}function Ma(e,t,n,r){return r<=0&&(e=t=n=NaN),new et(e,t,n,r)}function SR(e){return e instanceof Li||(e=Pi(e)),e?(e=e.rgb(),new et(e.r,e.g,e.b,e.opacity)):new et}function Gc(e,t,n,r){return arguments.length===1?SR(e):new et(e,t,n,r??1)}function et(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}jc(et,Gc,am(Li,{brighter(e){return e=e==null?Pa:Math.pow(Pa,e),new et(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Di:Math.pow(Di,e),new et(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new et(gr(this.r),gr(this.g),gr(this.b),Ua(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:fm,formatHex:fm,formatHex8:_R,formatRgb:pm,toString:pm}));function fm(){return`#${mr(this.r)}${mr(this.g)}${mr(this.b)}`}function _R(){return`#${mr(this.r)}${mr(this.g)}${mr(this.b)}${mr((isNaN(this.opacity)?1:this.opacity)*255)}`}function pm(){const e=Ua(this.opacity);return`${e===1?"rgb(":"rgba("}${gr(this.r)}, ${gr(this.g)}, ${gr(this.b)}${e===1?")":`, ${e})`}`}function Ua(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function gr(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function mr(e){return e=gr(e),(e<16?"0":"")+e.toString(16)}function hm(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Lt(e,t,n,r)}function gm(e){if(e instanceof Lt)return new Lt(e.h,e.s,e.l,e.opacity);if(e instanceof Li||(e=Pi(e)),!e)return new Lt;if(e instanceof Lt)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,o=Math.min(t,n,r),i=Math.max(t,n,r),s=NaN,a=i-o,l=(i+o)/2;return a?(t===i?s=(n-r)/a+(n<r)*6:n===i?s=(r-t)/a+2:s=(t-n)/a+4,a/=l<.5?i+o:2-i-o,s*=60):a=l>0&&l<1?0:s,new Lt(s,a,l,e.opacity)}function wR(e,t,n,r){return arguments.length===1?gm(e):new Lt(e,t,n,r??1)}function Lt(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}jc(Lt,wR,am(Li,{brighter(e){return e=e==null?Pa:Math.pow(Pa,e),new Lt(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Di:Math.pow(Di,e),new Lt(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,o=2*n-r;return new et(Yc(e>=240?e-240:e+120,o,r),Yc(e,o,r),Yc(e<120?e+240:e-120,o,r),this.opacity)},clamp(){return new Lt(mm(this.h),Fa(this.s),Fa(this.l),Ua(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Ua(this.opacity);return`${e===1?"hsl(":"hsla("}${mm(this.h)}, ${Fa(this.s)*100}%, ${Fa(this.l)*100}%${e===1?")":`, ${e})`}`}}));function mm(e){return e=(e||0)%360,e<0?e+360:e}function Fa(e){return Math.max(0,Math.min(1,e||0))}function Yc(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const vm=e=>()=>e;function RR(e,t){return function(n){return e+n*t}}function NR(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function OR(e){return(e=+e)==1?ym:function(t,n){return n-t?NR(t,n,e):vm(isNaN(t)?n:t)}}function ym(e,t){var n=t-e;return n?RR(e,n):vm(isNaN(e)?t:e)}const Em=function e(t){var n=OR(t);function r(o,i){var s=n((o=Gc(o)).r,(i=Gc(i)).r),a=n(o.g,i.g),l=n(o.b,i.b),u=ym(o.opacity,i.opacity);return function(c){return o.r=s(c),o.g=a(c),o.b=l(c),o.opacity=u(c),o+""}}return r.gamma=e,r}(1);function Fn(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}var Wc=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Kc=new RegExp(Wc.source,"g");function xR(e){return function(){return e}}function TR(e){return function(t){return e(t)+""}}function CR(e,t){var n=Wc.lastIndex=Kc.lastIndex=0,r,o,i,s=-1,a=[],l=[];for(e=e+"",t=t+"";(r=Wc.exec(e))&&(o=Kc.exec(t));)(i=o.index)>n&&(i=t.slice(n,i),a[s]?a[s]+=i:a[++s]=i),(r=r[0])===(o=o[0])?a[s]?a[s]+=o:a[++s]=o:(a[++s]=null,l.push({i:s,x:Fn(r,o)})),n=Kc.lastIndex;return n<t.length&&(i=t.slice(n),a[s]?a[s]+=i:a[++s]=i),a.length<2?l[0]?TR(l[0].x):xR(t):(t=l.length,function(u){for(var c=0,d;c<t;++c)a[(d=l[c]).i]=d.x(u);return a.join("")})}var Sm=180/Math.PI,Qc={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function _m(e,t,n,r,o,i){var s,a,l;return(s=Math.sqrt(e*e+t*t))&&(e/=s,t/=s),(l=e*n+t*r)&&(n-=e*l,r-=t*l),(a=Math.sqrt(n*n+r*r))&&(n/=a,r/=a,l/=a),e*r<t*n&&(e=-e,t=-t,l=-l,s=-s),{translateX:o,translateY:i,rotate:Math.atan2(t,e)*Sm,skewX:Math.atan(l)*Sm,scaleX:s,scaleY:a}}var Va;function IR(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Qc:_m(t.a,t.b,t.c,t.d,t.e,t.f)}function bR(e){return e==null||(Va||(Va=document.createElementNS("http://www.w3.org/2000/svg","g")),Va.setAttribute("transform",e),!(e=Va.transform.baseVal.consolidate()))?Qc:(e=e.matrix,_m(e.a,e.b,e.c,e.d,e.e,e.f))}function wm(e,t,n,r){function o(u){return u.length?u.pop()+" ":""}function i(u,c,d,f,h,m){if(u!==d||c!==f){var v=h.push("translate(",null,t,null,n);m.push({i:v-4,x:Fn(u,d)},{i:v-2,x:Fn(c,f)})}else(d||f)&&h.push("translate("+d+t+f+n)}function s(u,c,d,f){u!==c?(u-c>180?c+=360:c-u>180&&(u+=360),f.push({i:d.push(o(d)+"rotate(",null,r)-2,x:Fn(u,c)})):c&&d.push(o(d)+"rotate("+c+r)}function a(u,c,d,f){u!==c?f.push({i:d.push(o(d)+"skewX(",null,r)-2,x:Fn(u,c)}):c&&d.push(o(d)+"skewX("+c+r)}function l(u,c,d,f,h,m){if(u!==d||c!==f){var v=h.push(o(h)+"scale(",null,",",null,")");m.push({i:v-4,x:Fn(u,d)},{i:v-2,x:Fn(c,f)})}else(d!==1||f!==1)&&h.push(o(h)+"scale("+d+","+f+")")}return function(u,c){var d=[],f=[];return u=e(u),c=e(c),i(u.translateX,u.translateY,c.translateX,c.translateY,d,f),s(u.rotate,c.rotate,d,f),a(u.skewX,c.skewX,d,f),l(u.scaleX,u.scaleY,c.scaleX,c.scaleY,d,f),u=c=null,function(h){for(var m=-1,v=f.length,y;++m<v;)d[(y=f[m]).i]=y.x(h);return d.join("")}}}var AR=wm(IR,"px, ","px)","deg)"),LR=wm(bR,", ",")",")"),DR=1e-12;function Rm(e){return((e=Math.exp(e))+1/e)/2}function kR(e){return((e=Math.exp(e))-1/e)/2}function PR(e){return((e=Math.exp(2*e))-1)/(e+1)}const MR=function e(t,n,r){function o(i,s){var a=i[0],l=i[1],u=i[2],c=s[0],d=s[1],f=s[2],h=c-a,m=d-l,v=h*h+m*m,y,p;if(v<DR)p=Math.log(f/u)/t,y=function(C){return[a+C*h,l+C*m,u*Math.exp(t*C*p)]};else{var g=Math.sqrt(v),S=(f*f-u*u+r*v)/(2*u*n*g),_=(f*f-u*u-r*v)/(2*f*n*g),w=Math.log(Math.sqrt(S*S+1)-S),R=Math.log(Math.sqrt(_*_+1)-_);p=(R-w)/t,y=function(C){var L=C*p,B=Rm(w),I=u/(n*g)*(B*PR(t*L+w)-kR(w));return[a+I*h,l+I*m,u*B/Rm(t*L+w)]}}return y.duration=p*1e3*t/Math.SQRT2,y}return o.rho=function(i){var s=Math.max(.001,+i),a=s*s,l=a*a;return e(s,a,l)},o}(Math.SQRT2,2,4);var yo=0,Mi=0,Ui=0,Nm=1e3,Ba,Fi,$a=0,vr=0,Ha=0,Vi=typeof performance=="object"&&performance.now?performance:Date,Om=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Xc(){return vr||(Om(UR),vr=Vi.now()+Ha)}function UR(){vr=0}function za(){this._call=this._time=this._next=null}za.prototype=xm.prototype={constructor:za,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Xc():+n)+(t==null?0:+t),!this._next&&Fi!==this&&(Fi?Fi._next=this:Ba=this,Fi=this),this._call=e,this._time=n,qc()},stop:function(){this._call&&(this._call=null,this._time=1/0,qc())}};function xm(e,t,n){var r=new za;return r.restart(e,t,n),r}function FR(){Xc(),++yo;for(var e=Ba,t;e;)(t=vr-e._time)>=0&&e._call.call(void 0,t),e=e._next;--yo}function Tm(){vr=($a=Vi.now())+Ha,yo=Mi=0;try{FR()}finally{yo=0,BR(),vr=0}}function VR(){var e=Vi.now(),t=e-$a;t>Nm&&(Ha-=t,$a=e)}function BR(){for(var e,t=Ba,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:Ba=n);Fi=e,qc(r)}function qc(e){if(!yo){Mi&&(Mi=clearTimeout(Mi));var t=e-vr;t>24?(e<1/0&&(Mi=setTimeout(Tm,e-Vi.now()-Ha)),Ui&&(Ui=clearInterval(Ui))):(Ui||($a=Vi.now(),Ui=setInterval(VR,Nm)),yo=1,Om(Tm))}}function Cm(e,t,n){var r=new za;return t=t==null?0:+t,r.restart(o=>{r.stop(),e(o+t)},t,n),r}var $R=ba("start","end","cancel","interrupt"),HR=[],Im=0,bm=1,Zc=2,ja=3,Am=4,Jc=5,Ga=6;function Ya(e,t,n,r,o,i){var s=e.__transition;if(!s)e.__transition={};else if(n in s)return;zR(e,n,{name:t,index:r,group:o,on:$R,tween:HR,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:Im})}function ed(e,t){var n=Dt(e,t);if(n.state>Im)throw new Error("too late; already scheduled");return n}function Yt(e,t){var n=Dt(e,t);if(n.state>ja)throw new Error("too late; already running");return n}function Dt(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function zR(e,t,n){var r=e.__transition,o;r[t]=n,n.timer=xm(i,0,n.time);function i(u){n.state=bm,n.timer.restart(s,n.delay,n.time),n.delay<=u&&s(u-n.delay)}function s(u){var c,d,f,h;if(n.state!==bm)return l();for(c in r)if(h=r[c],h.name===n.name){if(h.state===ja)return Cm(s);h.state===Am?(h.state=Ga,h.timer.stop(),h.on.call("interrupt",e,e.__data__,h.index,h.group),delete r[c]):+c<t&&(h.state=Ga,h.timer.stop(),h.on.call("cancel",e,e.__data__,h.index,h.group),delete r[c])}if(Cm(function(){n.state===ja&&(n.state=Am,n.timer.restart(a,n.delay,n.time),a(u))}),n.state=Zc,n.on.call("start",e,e.__data__,n.index,n.group),n.state===Zc){for(n.state=ja,o=new Array(f=n.tween.length),c=0,d=-1;c<f;++c)(h=n.tween[c].value.call(e,e.__data__,n.index,n.group))&&(o[++d]=h);o.length=d+1}}function a(u){for(var c=u<n.duration?n.ease.call(null,u/n.duration):(n.timer.restart(l),n.state=Jc,1),d=-1,f=o.length;++d<f;)o[d].call(e,c);n.state===Jc&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){n.state=Ga,n.timer.stop(),delete r[t];for(var u in r)return;delete e.__transition}}function Wa(e,t){var n=e.__transition,r,o,i=!0,s;if(n){t=t==null?null:t+"";for(s in n){if((r=n[s]).name!==t){i=!1;continue}o=r.state>Zc&&r.state<Jc,r.state=Ga,r.timer.stop(),r.on.call(o?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[s]}i&&delete e.__transition}}function jR(e){return this.each(function(){Wa(this,e)})}function GR(e,t){var n,r;return function(){var o=Yt(this,e),i=o.tween;if(i!==n){r=n=i;for(var s=0,a=r.length;s<a;++s)if(r[s].name===t){r=r.slice(),r.splice(s,1);break}}o.tween=r}}function YR(e,t,n){var r,o;if(typeof n!="function")throw new Error;return function(){var i=Yt(this,e),s=i.tween;if(s!==r){o=(r=s).slice();for(var a={name:t,value:n},l=0,u=o.length;l<u;++l)if(o[l].name===t){o[l]=a;break}l===u&&o.push(a)}i.tween=o}}function WR(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=Dt(this.node(),n).tween,o=0,i=r.length,s;o<i;++o)if((s=r[o]).name===e)return s.value;return null}return this.each((t==null?GR:YR)(n,e,t))}function td(e,t,n){var r=e._id;return e.each(function(){var o=Yt(this,r);(o.value||(o.value={}))[t]=n.apply(this,arguments)}),function(o){return Dt(o,r).value[t]}}function Lm(e,t){var n;return(typeof t=="number"?Fn:t instanceof Pi?Em:(n=Pi(t))?(t=n,Em):CR)(e,t)}function KR(e){return function(){this.removeAttribute(e)}}function QR(e){return function(){this.removeAttributeNS(e.space,e.local)}}function XR(e,t,n){var r,o=n+"",i;return function(){var s=this.getAttribute(e);return s===o?null:s===r?i:i=t(r=s,n)}}function qR(e,t,n){var r,o=n+"",i;return function(){var s=this.getAttributeNS(e.space,e.local);return s===o?null:s===r?i:i=t(r=s,n)}}function ZR(e,t,n){var r,o,i;return function(){var s,a=n(this),l;return a==null?void this.removeAttribute(e):(s=this.getAttribute(e),l=a+"",s===l?null:s===r&&l===o?i:(o=l,i=t(r=s,a)))}}function JR(e,t,n){var r,o,i;return function(){var s,a=n(this),l;return a==null?void this.removeAttributeNS(e.space,e.local):(s=this.getAttributeNS(e.space,e.local),l=a+"",s===l?null:s===r&&l===o?i:(o=l,i=t(r=s,a)))}}function eN(e,t){var n=La(e),r=n==="transform"?LR:Lm;return this.attrTween(e,typeof t=="function"?(n.local?JR:ZR)(n,r,td(this,"attr."+e,t)):t==null?(n.local?QR:KR)(n):(n.local?qR:XR)(n,r,t))}function tN(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function nN(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function rN(e,t){var n,r;function o(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&nN(e,i)),n}return o._value=t,o}function oN(e,t){var n,r;function o(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&tN(e,i)),n}return o._value=t,o}function iN(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var r=La(e);return this.tween(n,(r.local?rN:oN)(r,t))}function sN(e,t){return function(){ed(this,e).delay=+t.apply(this,arguments)}}function aN(e,t){return t=+t,function(){ed(this,e).delay=t}}function lN(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?sN:aN)(t,e)):Dt(this.node(),t).delay}function uN(e,t){return function(){Yt(this,e).duration=+t.apply(this,arguments)}}function cN(e,t){return t=+t,function(){Yt(this,e).duration=t}}function dN(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?uN:cN)(t,e)):Dt(this.node(),t).duration}function fN(e,t){if(typeof t!="function")throw new Error;return function(){Yt(this,e).ease=t}}function pN(e){var t=this._id;return arguments.length?this.each(fN(t,e)):Dt(this.node(),t).ease}function hN(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Yt(this,e).ease=n}}function gN(e){if(typeof e!="function")throw new Error;return this.each(hN(this._id,e))}function mN(e){typeof e!="function"&&(e=Qg(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var i=t[o],s=i.length,a=r[o]=[],l,u=0;u<s;++u)(l=i[u])&&e.call(l,l.__data__,u,i)&&a.push(l);return new dn(r,this._parents,this._name,this._id)}function vN(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,o=n.length,i=Math.min(r,o),s=new Array(r),a=0;a<i;++a)for(var l=t[a],u=n[a],c=l.length,d=s[a]=new Array(c),f,h=0;h<c;++h)(f=l[h]||u[h])&&(d[h]=f);for(;a<r;++a)s[a]=t[a];return new dn(s,this._parents,this._name,this._id)}function yN(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function EN(e,t,n){var r,o,i=yN(t)?ed:Yt;return function(){var s=i(this,e),a=s.on;a!==r&&(o=(r=a).copy()).on(t,n),s.on=o}}function SN(e,t){var n=this._id;return arguments.length<2?Dt(this.node(),n).on.on(e):this.each(EN(n,e,t))}function _N(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function wN(){return this.on("end.remove",_N(this._id))}function RN(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Bc(e));for(var r=this._groups,o=r.length,i=new Array(o),s=0;s<o;++s)for(var a=r[s],l=a.length,u=i[s]=new Array(l),c,d,f=0;f<l;++f)(c=a[f])&&(d=e.call(c,c.__data__,f,a))&&("__data__"in c&&(d.__data__=c.__data__),u[f]=d,Ya(u[f],t,n,f,u,Dt(c,n)));return new dn(i,this._parents,t,n)}function NN(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Kg(e));for(var r=this._groups,o=r.length,i=[],s=[],a=0;a<o;++a)for(var l=r[a],u=l.length,c,d=0;d<u;++d)if(c=l[d]){for(var f=e.call(c,c.__data__,d,l),h,m=Dt(c,n),v=0,y=f.length;v<y;++v)(h=f[v])&&Ya(h,t,n,v,f,m);i.push(f),s.push(c)}return new dn(i,s,t,n)}var ON=bi.prototype.constructor;function xN(){return new ON(this._groups,this._parents)}function TN(e,t){var n,r,o;return function(){var i=go(this,e),s=(this.style.removeProperty(e),go(this,e));return i===s?null:i===n&&s===r?o:o=t(n=i,r=s)}}function Dm(e){return function(){this.style.removeProperty(e)}}function CN(e,t,n){var r,o=n+"",i;return function(){var s=go(this,e);return s===o?null:s===r?i:i=t(r=s,n)}}function IN(e,t,n){var r,o,i;return function(){var s=go(this,e),a=n(this),l=a+"";return a==null&&(l=a=(this.style.removeProperty(e),go(this,e))),s===l?null:s===r&&l===o?i:(o=l,i=t(r=s,a))}}function bN(e,t){var n,r,o,i="style."+t,s="end."+i,a;return function(){var l=Yt(this,e),u=l.on,c=l.value[i]==null?a||(a=Dm(t)):void 0;(u!==n||o!==c)&&(r=(n=u).copy()).on(s,o=c),l.on=r}}function AN(e,t,n){var r=(e+="")=="transform"?AR:Lm;return t==null?this.styleTween(e,TN(e,r)).on("end.style."+e,Dm(e)):typeof t=="function"?this.styleTween(e,IN(e,r,td(this,"style."+e,t))).each(bN(this._id,e)):this.styleTween(e,CN(e,r,t),n).on("end.style."+e,null)}function LN(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function DN(e,t,n){var r,o;function i(){var s=t.apply(this,arguments);return s!==o&&(r=(o=s)&&LN(e,s,n)),r}return i._value=t,i}function kN(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;return this.tween(r,DN(e,t,n??""))}function PN(e){return function(){this.textContent=e}}function MN(e){return function(){var t=e(this);this.textContent=t??""}}function UN(e){return this.tween("text",typeof e=="function"?MN(td(this,"text",e)):PN(e==null?"":e+""))}function FN(e){return function(t){this.textContent=e.call(this,t)}}function VN(e){var t,n;function r(){var o=e.apply(this,arguments);return o!==n&&(t=(n=o)&&FN(o)),t}return r._value=e,r}function BN(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,VN(e))}function $N(){for(var e=this._name,t=this._id,n=km(),r=this._groups,o=r.length,i=0;i<o;++i)for(var s=r[i],a=s.length,l,u=0;u<a;++u)if(l=s[u]){var c=Dt(l,t);Ya(l,e,n,u,s,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new dn(r,this._parents,e,n)}function HN(){var e,t,n=this,r=n._id,o=n.size();return new Promise(function(i,s){var a={value:s},l={value:function(){--o===0&&i()}};n.each(function(){var u=Yt(this,r),c=u.on;c!==e&&(t=(e=c).copy(),t._.cancel.push(a),t._.interrupt.push(a),t._.end.push(l)),u.on=t}),o===0&&i()})}var zN=0;function dn(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function km(){return++zN}var fn=bi.prototype;dn.prototype={constructor:dn,select:RN,selectAll:NN,selectChild:fn.selectChild,selectChildren:fn.selectChildren,filter:mN,merge:vN,selection:xN,transition:$N,call:fn.call,nodes:fn.nodes,node:fn.node,size:fn.size,empty:fn.empty,each:fn.each,on:SN,attr:eN,attrTween:iN,style:AN,styleTween:kN,text:UN,textTween:BN,remove:wN,tween:WR,delay:lN,duration:dN,ease:pN,easeVarying:gN,end:HN,[Symbol.iterator]:fn[Symbol.iterator]};function jN(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var GN={time:null,delay:0,duration:250,ease:jN};function YN(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function WN(e){var t,n;e instanceof dn?(t=e._id,e=e._name):(t=km(),(n=GN).time=Xc(),e=e==null?null:e+"");for(var r=this._groups,o=r.length,i=0;i<o;++i)for(var s=r[i],a=s.length,l,u=0;u<a;++u)(l=s[u])&&Ya(l,e,t,u,s,n||YN(l,t));return new dn(r,this._parents,e,t)}bi.prototype.interrupt=jR,bi.prototype.transition=WN;const Ka=e=>()=>e;function KN(e,{sourceEvent:t,target:n,transform:r,dispatch:o}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:o}})}function pn(e,t,n){this.k=e,this.x=t,this.y=n}pn.prototype={constructor:pn,scale:function(e){return e===1?this:new pn(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new pn(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Vn=new pn(1,0,0);pn.prototype;function nd(e){e.stopImmediatePropagation()}function Bi(e){e.preventDefault(),e.stopImmediatePropagation()}function QN(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function XN(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function Pm(){return this.__zoom||Vn}function qN(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function ZN(){return navigator.maxTouchPoints||"ontouchstart"in this}function JN(e,t,n){var r=e.invertX(t[0][0])-n[0][0],o=e.invertX(t[1][0])-n[1][0],i=e.invertY(t[0][1])-n[0][1],s=e.invertY(t[1][1])-n[1][1];return e.translate(o>r?(r+o)/2:Math.min(0,r)||Math.max(0,o),s>i?(i+s)/2:Math.min(0,i)||Math.max(0,s))}function eO(){var e=QN,t=XN,n=JN,r=qN,o=ZN,i=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],a=250,l=MR,u=ba("start","zoom","end"),c,d,f,h=500,m=150,v=0,y=10;function p(O){O.property("__zoom",Pm).on("wheel.zoom",L,{passive:!1}).on("mousedown.zoom",B).on("dblclick.zoom",I).filter(o).on("touchstart.zoom",V).on("touchmove.zoom",$).on("touchend.zoom touchcancel.zoom",F).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}p.transform=function(O,M,D,A){var T=O.selection?O.selection():O;T.property("__zoom",Pm),O!==T?w(O,M,D,A):T.interrupt().each(function(){R(this,arguments).event(A).start().zoom(null,typeof M=="function"?M.apply(this,arguments):M).end()})},p.scaleBy=function(O,M,D,A){p.scaleTo(O,function(){var T=this.__zoom.k,P=typeof M=="function"?M.apply(this,arguments):M;return T*P},D,A)},p.scaleTo=function(O,M,D,A){p.transform(O,function(){var T=t.apply(this,arguments),P=this.__zoom,U=D==null?_(T):typeof D=="function"?D.apply(this,arguments):D,H=P.invert(U),j=typeof M=="function"?M.apply(this,arguments):M;return n(S(g(P,j),U,H),T,s)},D,A)},p.translateBy=function(O,M,D,A){p.transform(O,function(){return n(this.__zoom.translate(typeof M=="function"?M.apply(this,arguments):M,typeof D=="function"?D.apply(this,arguments):D),t.apply(this,arguments),s)},null,A)},p.translateTo=function(O,M,D,A,T){p.transform(O,function(){var P=t.apply(this,arguments),U=this.__zoom,H=A==null?_(P):typeof A=="function"?A.apply(this,arguments):A;return n(Vn.translate(H[0],H[1]).scale(U.k).translate(typeof M=="function"?-M.apply(this,arguments):-M,typeof D=="function"?-D.apply(this,arguments):-D),P,s)},A,T)};function g(O,M){return M=Math.max(i[0],Math.min(i[1],M)),M===O.k?O:new pn(M,O.x,O.y)}function S(O,M,D){var A=M[0]-D[0]*O.k,T=M[1]-D[1]*O.k;return A===O.x&&T===O.y?O:new pn(O.k,A,T)}function _(O){return[(+O[0][0]+ +O[1][0])/2,(+O[0][1]+ +O[1][1])/2]}function w(O,M,D,A){O.on("start.zoom",function(){R(this,arguments).event(A).start()}).on("interrupt.zoom end.zoom",function(){R(this,arguments).event(A).end()}).tween("zoom",function(){var T=this,P=arguments,U=R(T,P).event(A),H=t.apply(T,P),j=D==null?_(H):typeof D=="function"?D.apply(T,P):D,K=Math.max(H[1][0]-H[0][0],H[1][1]-H[0][1]),W=T.__zoom,Z=typeof M=="function"?M.apply(T,P):M,X=l(W.invert(j).concat(K/W.k),Z.invert(j).concat(K/Z.k));return function(te){if(te===1)te=Z;else{var oe=X(te),ge=K/oe[2];te=new pn(ge,j[0]-oe[0]*ge,j[1]-oe[1]*ge)}U.zoom(null,te)}})}function R(O,M,D){return!D&&O.__zooming||new C(O,M)}function C(O,M){this.that=O,this.args=M,this.active=0,this.sourceEvent=null,this.extent=t.apply(O,M),this.taps=0}C.prototype={event:function(O){return O&&(this.sourceEvent=O),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(O,M){return this.mouse&&O!=="mouse"&&(this.mouse[1]=M.invert(this.mouse[0])),this.touch0&&O!=="touch"&&(this.touch0[1]=M.invert(this.touch0[0])),this.touch1&&O!=="touch"&&(this.touch1[1]=M.invert(this.touch1[0])),this.that.__zoom=M,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(O){var M=At(this.that).datum();u.call(O,this.that,new KN(O,{sourceEvent:this.sourceEvent,target:p,type:O,transform:this.that.__zoom,dispatch:u}),M)}};function L(O,...M){if(!e.apply(this,arguments))return;var D=R(this,M).event(O),A=this.__zoom,T=Math.max(i[0],Math.min(i[1],A.k*Math.pow(2,r.apply(this,arguments)))),P=jt(O);if(D.wheel)(D.mouse[0][0]!==P[0]||D.mouse[0][1]!==P[1])&&(D.mouse[1]=A.invert(D.mouse[0]=P)),clearTimeout(D.wheel);else{if(A.k===T)return;D.mouse=[P,A.invert(P)],Wa(this),D.start()}Bi(O),D.wheel=setTimeout(U,m),D.zoom("mouse",n(S(g(A,T),D.mouse[0],D.mouse[1]),D.extent,s));function U(){D.wheel=null,D.end()}}function B(O,...M){if(f||!e.apply(this,arguments))return;var D=O.currentTarget,A=R(this,M,!0).event(O),T=At(O.view).on("mousemove.zoom",j,!0).on("mouseup.zoom",K,!0),P=jt(O,D),U=O.clientX,H=O.clientY;im(O.view),nd(O),A.mouse=[P,this.__zoom.invert(P)],Wa(this),A.start();function j(W){if(Bi(W),!A.moved){var Z=W.clientX-U,X=W.clientY-H;A.moved=Z*Z+X*X>v}A.event(W).zoom("mouse",n(S(A.that.__zoom,A.mouse[0]=jt(W,D),A.mouse[1]),A.extent,s))}function K(W){T.on("mousemove.zoom mouseup.zoom",null),sm(W.view,A.moved),Bi(W),A.event(W).end()}}function I(O,...M){if(e.apply(this,arguments)){var D=this.__zoom,A=jt(O.changedTouches?O.changedTouches[0]:O,this),T=D.invert(A),P=D.k*(O.shiftKey?.5:2),U=n(S(g(D,P),A,T),t.apply(this,M),s);Bi(O),a>0?At(this).transition().duration(a).call(w,U,A,O):At(this).call(p.transform,U,A,O)}}function V(O,...M){if(e.apply(this,arguments)){var D=O.touches,A=D.length,T=R(this,M,O.changedTouches.length===A).event(O),P,U,H,j;for(nd(O),U=0;U<A;++U)H=D[U],j=jt(H,this),j=[j,this.__zoom.invert(j),H.identifier],T.touch0?!T.touch1&&T.touch0[2]!==j[2]&&(T.touch1=j,T.taps=0):(T.touch0=j,P=!0,T.taps=1+!!c);c&&(c=clearTimeout(c)),P&&(T.taps<2&&(d=j[0],c=setTimeout(function(){c=null},h)),Wa(this),T.start())}}function $(O,...M){if(this.__zooming){var D=R(this,M).event(O),A=O.changedTouches,T=A.length,P,U,H,j;for(Bi(O),P=0;P<T;++P)U=A[P],H=jt(U,this),D.touch0&&D.touch0[2]===U.identifier?D.touch0[0]=H:D.touch1&&D.touch1[2]===U.identifier&&(D.touch1[0]=H);if(U=D.that.__zoom,D.touch1){var K=D.touch0[0],W=D.touch0[1],Z=D.touch1[0],X=D.touch1[1],te=(te=Z[0]-K[0])*te+(te=Z[1]-K[1])*te,oe=(oe=X[0]-W[0])*oe+(oe=X[1]-W[1])*oe;U=g(U,Math.sqrt(te/oe)),H=[(K[0]+Z[0])/2,(K[1]+Z[1])/2],j=[(W[0]+X[0])/2,(W[1]+X[1])/2]}else if(D.touch0)H=D.touch0[0],j=D.touch0[1];else return;D.zoom("touch",n(S(U,H,j),D.extent,s))}}function F(O,...M){if(this.__zooming){var D=R(this,M).event(O),A=O.changedTouches,T=A.length,P,U;for(nd(O),f&&clearTimeout(f),f=setTimeout(function(){f=null},h),P=0;P<T;++P)U=A[P],D.touch0&&D.touch0[2]===U.identifier?delete D.touch0:D.touch1&&D.touch1[2]===U.identifier&&delete D.touch1;if(D.touch1&&!D.touch0&&(D.touch0=D.touch1,delete D.touch1),D.touch0)D.touch0[1]=this.__zoom.invert(D.touch0[0]);else if(D.end(),D.taps===2&&(U=jt(U,this),Math.hypot(d[0]-U[0],d[1]-U[1])<y)){var H=At(this).on("dblclick.zoom");H&&H.apply(this,arguments)}}}return p.wheelDelta=function(O){return arguments.length?(r=typeof O=="function"?O:Ka(+O),p):r},p.filter=function(O){return arguments.length?(e=typeof O=="function"?O:Ka(!!O),p):e},p.touchable=function(O){return arguments.length?(o=typeof O=="function"?O:Ka(!!O),p):o},p.extent=function(O){return arguments.length?(t=typeof O=="function"?O:Ka([[+O[0][0],+O[0][1]],[+O[1][0],+O[1][1]]]),p):t},p.scaleExtent=function(O){return arguments.length?(i[0]=+O[0],i[1]=+O[1],p):[i[0],i[1]]},p.translateExtent=function(O){return arguments.length?(s[0][0]=+O[0][0],s[1][0]=+O[1][0],s[0][1]=+O[0][1],s[1][1]=+O[1][1],p):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},p.constrain=function(O){return arguments.length?(n=O,p):n},p.duration=function(O){return arguments.length?(a=+O,p):a},p.interpolate=function(O){return arguments.length?(l=O,p):l},p.on=function(){var O=u.on.apply(u,arguments);return O===u?p:O},p.clickDistance=function(O){return arguments.length?(v=(O=+O)*O,p):Math.sqrt(v)},p.tapDistance=function(O){return arguments.length?(y=+O,p):y},p}const Qa=N.createContext(null),tO=Qa.Provider,Bn={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,t)=>`Couldn't create edge for ${e?"target":"source"} handle id: "${e?t.targetHandle:t.sourceHandle}", edge id: ${t.id}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`},Mm=Bn.error001();function le(e,t){const n=N.useContext(Qa);if(n===null)throw new Error(Mm);return zg(n,e,t)}const xe=()=>{const e=N.useContext(Qa);if(e===null)throw new Error(Mm);return N.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe,destroy:e.destroy}),[e])},nO=e=>e.userSelectionActive?"none":"all";function rd({position:e,children:t,className:n,style:r,...o}){const i=le(nO),s=`${e}`.split("-");return E("div",{className:Je(["react-flow__panel",n,...s]),style:{...r,pointerEvents:i},...o,children:t})}function rO({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:E(rd,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:E("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const oO=({x:e,y:t,label:n,labelStyle:r={},labelShowBg:o=!0,labelBgStyle:i={},labelBgPadding:s=[2,4],labelBgBorderRadius:a=2,children:l,className:u,...c})=>{const d=N.useRef(null),[f,h]=N.useState({x:0,y:0,width:0,height:0}),m=Je(["react-flow__edge-textwrapper",u]);return N.useEffect(()=>{if(d.current){const v=d.current.getBBox();h({x:v.x,y:v.y,width:v.width,height:v.height})}},[n]),typeof n>"u"||!n?null:k("g",{transform:`translate(${e-f.width/2} ${t-f.height/2})`,className:m,visibility:f.width?"visible":"hidden",...c,children:[o&&E("rect",{width:f.width+2*s[0],x:-s[0],y:-s[1],height:f.height+2*s[1],className:"react-flow__edge-textbg",style:i,rx:a,ry:a}),E("text",{className:"react-flow__edge-text",y:f.height/2,dy:"0.3em",ref:d,style:r,children:n}),l]})};var iO=N.memo(oO);const od=e=>({width:e.offsetWidth,height:e.offsetHeight}),Eo=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),id=(e={x:0,y:0},t)=>({x:Eo(e.x,t[0][0],t[1][0]),y:Eo(e.y,t[0][1],t[1][1])}),Um=(e,t,n)=>e<t?Eo(Math.abs(e-t),1,50)/50:e>n?-Eo(Math.abs(e-n),1,50)/50:0,Fm=(e,t)=>{const n=Um(e.x,35,t.width-35)*20,r=Um(e.y,35,t.height-35)*20;return[n,r]},Vm=e=>{var t;return((t=e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},sO=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),Bm=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),aO=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),$m=e=>({...e.positionAbsolute||{x:0,y:0},width:e.width||0,height:e.height||0}),sd=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),r=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*r)},lO=e=>St(e.width)&&St(e.height)&&St(e.x)&&St(e.y),St=e=>!isNaN(e)&&isFinite(e),we=Symbol.for("internals"),Hm=["Enter"," ","Escape"],uO=(e,t)=>{},cO=e=>"nativeEvent"in e;function ad(e){var o,i;const t=cO(e)?e.nativeEvent:e,n=((i=(o=t.composedPath)==null?void 0:o.call(t))==null?void 0:i[0])||e.target;return["INPUT","SELECT","TEXTAREA"].includes(n==null?void 0:n.nodeName)||(n==null?void 0:n.hasAttribute("contenteditable"))||!!(n!=null&&n.closest(".nokey"))}const zm=e=>"clientX"in e,$n=(e,t)=>{var i,s;const n=zm(e),r=n?e.clientX:(i=e.touches)==null?void 0:i[0].clientX,o=n?e.clientY:(s=e.touches)==null?void 0:s[0].clientY;return{x:r-((t==null?void 0:t.left)??0),y:o-((t==null?void 0:t.top)??0)}},So=({path:e,labelX:t,labelY:n,label:r,labelStyle:o,labelShowBg:i,labelBgStyle:s,labelBgPadding:a,labelBgBorderRadius:l,style:u,markerEnd:c,markerStart:d,interactionWidth:f=20})=>k(ve,{children:[E("path",{style:u,d:e,fill:"none",className:"react-flow__edge-path",markerEnd:c,markerStart:d}),f&&E("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:f,className:"react-flow__edge-interaction"}),r&&St(t)&&St(n)?E(iO,{x:t,y:n,label:r,labelStyle:o,labelShowBg:i,labelBgStyle:s,labelBgPadding:a,labelBgBorderRadius:l}):null]});So.displayName="BaseEdge";function $i(e,t,n){return n===void 0?n:r=>{const o=t().edges.find(i=>i.id===e);o&&n(r,{...o})}}function jm({sourceX:e,sourceY:t,targetX:n,targetY:r}){const o=Math.abs(n-e)/2,i=n<e?n+o:n-o,s=Math.abs(r-t)/2,a=r<t?r+s:r-s;return[i,a,o,s]}function Gm({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:o,sourceControlY:i,targetControlX:s,targetControlY:a}){const l=e*.125+o*.375+s*.375+n*.125,u=t*.125+i*.375+a*.375+r*.125,c=Math.abs(l-e),d=Math.abs(u-t);return[l,u,c,d]}var Hn;(function(e){e.Strict="strict",e.Loose="loose"})(Hn||(Hn={}));var _o;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(_o||(_o={}));var Hi;(function(e){e.Partial="partial",e.Full="full"})(Hi||(Hi={}));var zn;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(zn||(zn={}));var zi;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(zi||(zi={}));var Y;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Y||(Y={}));function Ym({pos:e,x1:t,y1:n,x2:r,y2:o}){return e===Y.Left||e===Y.Right?[.5*(t+r),n]:[t,.5*(n+o)]}function Wm({sourceX:e,sourceY:t,sourcePosition:n=Y.Bottom,targetX:r,targetY:o,targetPosition:i=Y.Top}){const[s,a]=Ym({pos:n,x1:e,y1:t,x2:r,y2:o}),[l,u]=Ym({pos:i,x1:r,y1:o,x2:e,y2:t}),[c,d,f,h]=Gm({sourceX:e,sourceY:t,targetX:r,targetY:o,sourceControlX:s,sourceControlY:a,targetControlX:l,targetControlY:u});return[`M${e},${t} C${s},${a} ${l},${u} ${r},${o}`,c,d,f,h]}const ld=N.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,sourcePosition:o=Y.Bottom,targetPosition:i=Y.Top,label:s,labelStyle:a,labelShowBg:l,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:d,style:f,markerEnd:h,markerStart:m,interactionWidth:v})=>{const[y,p,g]=Wm({sourceX:e,sourceY:t,sourcePosition:o,targetX:n,targetY:r,targetPosition:i});return E(So,{path:y,labelX:p,labelY:g,label:s,labelStyle:a,labelShowBg:l,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:d,style:f,markerEnd:h,markerStart:m,interactionWidth:v})});ld.displayName="SimpleBezierEdge";const Km={[Y.Left]:{x:-1,y:0},[Y.Right]:{x:1,y:0},[Y.Top]:{x:0,y:-1},[Y.Bottom]:{x:0,y:1}},dO=({source:e,sourcePosition:t=Y.Bottom,target:n})=>t===Y.Left||t===Y.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},Qm=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function fO({source:e,sourcePosition:t=Y.Bottom,target:n,targetPosition:r=Y.Top,center:o,offset:i}){const s=Km[t],a=Km[r],l={x:e.x+s.x*i,y:e.y+s.y*i},u={x:n.x+a.x*i,y:n.y+a.y*i},c=dO({source:l,sourcePosition:t,target:u}),d=c.x!==0?"x":"y",f=c[d];let h=[],m,v;const[y,p,g,S]=jm({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(s[d]*a[d]===-1){m=o.x||y,v=o.y||p;const w=[{x:m,y:l.y},{x:m,y:u.y}],R=[{x:l.x,y:v},{x:u.x,y:v}];s[d]===f?h=d==="x"?w:R:h=d==="x"?R:w}else{const w=[{x:l.x,y:u.y}],R=[{x:u.x,y:l.y}];if(d==="x"?h=s.x===f?R:w:h=s.y===f?w:R,t!==r){const C=d==="x"?"y":"x",L=s[d]===a[C],B=l[C]>u[C],I=l[C]<u[C];(s[d]===1&&(!L&&B||L&&I)||s[d]!==1&&(!L&&I||L&&B))&&(h=d==="x"?w:R)}m=h[0].x,v=h[0].y}return[[e,l,...h,u,n],m,v,g,S]}function pO(e,t,n,r){const o=Math.min(Qm(e,t)/2,Qm(t,n)/2,r),{x:i,y:s}=t;if(e.x===i&&i===n.x||e.y===s&&s===n.y)return`L${i} ${s}`;if(e.y===s){const u=e.x<n.x?-1:1,c=e.y<n.y?1:-1;return`L ${i+o*u},${s}Q ${i},${s} ${i},${s+o*c}`}const a=e.x<n.x?1:-1,l=e.y<n.y?-1:1;return`L ${i},${s+o*l}Q ${i},${s} ${i+o*a},${s}`}function ji({sourceX:e,sourceY:t,sourcePosition:n=Y.Bottom,targetX:r,targetY:o,targetPosition:i=Y.Top,borderRadius:s=5,centerX:a,centerY:l,offset:u=20}){const[c,d,f,h,m]=fO({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:o},targetPosition:i,center:{x:a,y:l},offset:u});return[c.reduce((y,p,g)=>{let S="";return g>0&&g<c.length-1?S=pO(c[g-1],p,c[g+1],s):S=`${g===0?"M":"L"}${p.x} ${p.y}`,y+=S,y},""),d,f,h,m]}const Xa=N.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,label:o,labelStyle:i,labelShowBg:s,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:u,style:c,sourcePosition:d=Y.Bottom,targetPosition:f=Y.Top,markerEnd:h,markerStart:m,pathOptions:v,interactionWidth:y})=>{const[p,g,S]=ji({sourceX:e,sourceY:t,sourcePosition:d,targetX:n,targetY:r,targetPosition:f,borderRadius:v==null?void 0:v.borderRadius,offset:v==null?void 0:v.offset});return E(So,{path:p,labelX:g,labelY:S,label:o,labelStyle:i,labelShowBg:s,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:u,style:c,markerEnd:h,markerStart:m,interactionWidth:y})});Xa.displayName="SmoothStepEdge";const ud=N.memo(e=>{var t;return E(Xa,{...e,pathOptions:N.useMemo(()=>{var n;return{borderRadius:0,offset:(n=e.pathOptions)==null?void 0:n.offset}},[(t=e.pathOptions)==null?void 0:t.offset])})});ud.displayName="StepEdge";function hO({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[o,i,s,a]=jm({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,o,i,s,a]}const cd=N.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,label:o,labelStyle:i,labelShowBg:s,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:u,style:c,markerEnd:d,markerStart:f,interactionWidth:h})=>{const[m,v,y]=hO({sourceX:e,sourceY:t,targetX:n,targetY:r});return E(So,{path:m,labelX:v,labelY:y,label:o,labelStyle:i,labelShowBg:s,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:u,style:c,markerEnd:d,markerStart:f,interactionWidth:h})});cd.displayName="StraightEdge";function qa(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function Xm({pos:e,x1:t,y1:n,x2:r,y2:o,c:i}){switch(e){case Y.Left:return[t-qa(t-r,i),n];case Y.Right:return[t+qa(r-t,i),n];case Y.Top:return[t,n-qa(n-o,i)];case Y.Bottom:return[t,n+qa(o-n,i)]}}function qm({sourceX:e,sourceY:t,sourcePosition:n=Y.Bottom,targetX:r,targetY:o,targetPosition:i=Y.Top,curvature:s=.25}){const[a,l]=Xm({pos:n,x1:e,y1:t,x2:r,y2:o,c:s}),[u,c]=Xm({pos:i,x1:r,y1:o,x2:e,y2:t,c:s}),[d,f,h,m]=Gm({sourceX:e,sourceY:t,targetX:r,targetY:o,sourceControlX:a,sourceControlY:l,targetControlX:u,targetControlY:c});return[`M${e},${t} C${a},${l} ${u},${c} ${r},${o}`,d,f,h,m]}const Za=N.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,sourcePosition:o=Y.Bottom,targetPosition:i=Y.Top,label:s,labelStyle:a,labelShowBg:l,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:d,style:f,markerEnd:h,markerStart:m,pathOptions:v,interactionWidth:y})=>{const[p,g,S]=qm({sourceX:e,sourceY:t,sourcePosition:o,targetX:n,targetY:r,targetPosition:i,curvature:v==null?void 0:v.curvature});return E(So,{path:p,labelX:g,labelY:S,label:s,labelStyle:a,labelShowBg:l,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:d,style:f,markerEnd:h,markerStart:m,interactionWidth:y})});Za.displayName="BezierEdge";const dd=N.createContext(null),gO=dd.Provider;dd.Consumer;const mO=()=>N.useContext(dd),vO=e=>"id"in e&&"source"in e&&"target"in e,Zm=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`reactflow__edge-${e}${t||""}-${n}${r||""}`,fd=(e,t)=>typeof e>"u"?"":typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`,yO=(e,t)=>t.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),Jm=(e,t)=>{if(!e.source||!e.target)return t;let n;return vO(e)?n={...e}:n={...e,id:Zm(e)},yO(n,t)?t:t.concat(n)},EO=(e,t,n,r={shouldReplaceId:!0})=>{const{id:o,...i}=e;if(!t.source||!t.target||!n.find(l=>l.id===o))return n;const a={...i,id:r.shouldReplaceId?Zm(t):o,source:t.source,target:t.target,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle};return n.filter(l=>l.id!==o).concat(a)},ev=({x:e,y:t},[n,r,o],i,[s,a])=>{const l={x:(e-n)/o,y:(t-r)/o};return i?{x:s*Math.round(l.x/s),y:a*Math.round(l.y/a)}:l},SO=({x:e,y:t},[n,r,o])=>({x:e*o+n,y:t*o+r}),wo=(e,t=[0,0])=>{if(!e)return{x:0,y:0,positionAbsolute:{x:0,y:0}};const n=(e.width??0)*t[0],r=(e.height??0)*t[1],o={x:e.position.x-n,y:e.position.y-r};return{...o,positionAbsolute:e.positionAbsolute?{x:e.positionAbsolute.x-n,y:e.positionAbsolute.y-r}:o}},tv=(e,t=[0,0])=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((r,o)=>{const{x:i,y:s}=wo(o,t).positionAbsolute;return sO(r,Bm({x:i,y:s,width:o.width||0,height:o.height||0}))},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return aO(n)},nv=(e,t,[n,r,o]=[0,0,1],i=!1,s=!1,a=[0,0])=>{const l={x:(t.x-n)/o,y:(t.y-r)/o,width:t.width/o,height:t.height/o},u=[];return e.forEach(c=>{const{width:d,height:f,selectable:h=!0,hidden:m=!1}=c;if(s&&!h||m)return!1;const{positionAbsolute:v}=wo(c,a),y={x:v.x,y:v.y,width:d||0,height:f||0},p=sd(l,y),g=typeof d>"u"||typeof f>"u"||d===null||f===null,S=i&&p>0,_=(d||0)*(f||0);(g||S||p>=_||c.dragging)&&u.push(c)}),u},rv=(e,t)=>{const n=e.map(r=>r.id);return t.filter(r=>n.includes(r.source)||n.includes(r.target))},ov=(e,t,n,r,o,i=.1)=>{const s=t/(e.width*(1+i)),a=n/(e.height*(1+i)),l=Math.min(s,a),u=Eo(l,r,o),c=e.x+e.width/2,d=e.y+e.height/2,f=t/2-c*u,h=n/2-d*u;return[f,h,u]},yr=(e,t=0)=>e.transition().duration(t);function iv(e,t,n,r){return(t[n]||[]).reduce((o,i)=>{var s,a;return`${e.id}-${i.id}-${n}`!==r&&o.push({id:i.id||null,type:n,nodeId:e.id,x:(((s=e.positionAbsolute)==null?void 0:s.x)??0)+i.x+i.width/2,y:(((a=e.positionAbsolute)==null?void 0:a.y)??0)+i.y+i.height/2}),o},[])}function _O(e,t,n){let r=null,o=1/0;return n.forEach(i=>{const s=Math.sqrt(Math.pow(i.x-e.x,2)+Math.pow(i.y-e.y,2));s<=t&&s<o&&(o=s,r=i)}),r}const wO={source:null,target:null,sourceHandle:null,targetHandle:null};function sv(e,t,n,r,o,i,s,a){const l=i==="target",u=a.querySelector(`.react-flow__handle[data-id="${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`),{x:c,y:d}=$n(e),f=a.elementFromPoint(c,d),h=f!=null&&f.classList.contains("react-flow__handle")?f:u,m={handleDomNode:h,isValid:!1,connection:wO,endHandle:null};if(h){const v=av(void 0,h),y=h.getAttribute("data-nodeid"),p=h.getAttribute("data-handleid"),g=h.classList.contains("connectable"),S=h.classList.contains("connectableend"),_={source:l?y:r,sourceHandle:l?p:o,target:l?r:y,targetHandle:l?o:p};m.connection=_,g&&S&&(n===Hn.Strict?l&&v==="source"||!l&&v==="target":y!==r||p!==o)&&(m.endHandle={nodeId:y,handleId:p,type:v},m.isValid=s(_))}return m}function RO({nodes:e,nodeId:t,handleId:n,handleType:r}){return e.reduce((o,i)=>{if(i[we]){const{handleBounds:s}=i[we];let a=[],l=[];s&&(a=iv(i,s,"source",`${t}-${n}-${r}`),l=iv(i,s,"target",`${t}-${n}-${r}`)),o.push(...a,...l)}return o},[])}function av(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function pd(e){e==null||e.classList.remove("valid","connecting","react-flow__handle-valid","react-flow__handle-connecting")}function NO(e,t){let n=null;return t?n="valid":e&&!t&&(n="invalid"),n}function lv({event:e,handleId:t,nodeId:n,onConnect:r,isTarget:o,getState:i,setState:s,isValidConnection:a,edgeUpdaterType:l,onEdgeUpdateEnd:u}){const c=Vm(e.target),{connectionMode:d,domNode:f,autoPanOnConnect:h,connectionRadius:m,onConnectStart:v,panBy:y,getNodes:p,cancelConnection:g}=i();let S=0,_;const{x:w,y:R}=$n(e),C=c==null?void 0:c.elementFromPoint(w,R),L=av(l,C),B=f==null?void 0:f.getBoundingClientRect();if(!B||!L)return;let I,V=$n(e,B),$=!1,F=null,O=!1,M=null;const D=RO({nodes:p(),nodeId:n,handleId:t,handleType:L}),A=()=>{if(!h)return;const[U,H]=Fm(V,B);y({x:U,y:H}),S=requestAnimationFrame(A)};s({connectionPosition:V,connectionStatus:null,connectionNodeId:n,connectionHandleId:t,connectionHandleType:L,connectionStartHandle:{nodeId:n,handleId:t,type:L},connectionEndHandle:null}),v==null||v(e,{nodeId:n,handleId:t,handleType:L});function T(U){const{transform:H}=i();V=$n(U,B),_=_O(ev(V,H,!1,[1,1]),m,D),$||(A(),$=!0);const j=sv(U,_,d,n,t,o?"target":"source",a,c);if(M=j.handleDomNode,F=j.connection,O=j.isValid,s({connectionPosition:_&&O?SO({x:_.x,y:_.y},H):V,connectionStatus:NO(!!_,O),connectionEndHandle:j.endHandle}),!_&&!O&&!M)return pd(I);F.source!==F.target&&M&&(pd(I),I=M,M.classList.add("connecting","react-flow__handle-connecting"),M.classList.toggle("valid",O),M.classList.toggle("react-flow__handle-valid",O))}function P(U){var H,j;(_||M)&&F&&O&&(r==null||r(F)),(j=(H=i()).onConnectEnd)==null||j.call(H,U),l&&(u==null||u(U)),pd(I),g(),cancelAnimationFrame(S),$=!1,O=!1,F=null,M=null,c.removeEventListener("mousemove",T),c.removeEventListener("mouseup",P),c.removeEventListener("touchmove",T),c.removeEventListener("touchend",P)}c.addEventListener("mousemove",T),c.addEventListener("mouseup",P),c.addEventListener("touchmove",T),c.addEventListener("touchend",P)}const uv=()=>!0,OO=e=>({connectionStartHandle:e.connectionStartHandle,connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName}),xO=(e,t,n)=>r=>{const{connectionStartHandle:o,connectionEndHandle:i,connectionClickStartHandle:s}=r;return{connecting:(o==null?void 0:o.nodeId)===e&&(o==null?void 0:o.handleId)===t&&(o==null?void 0:o.type)===n||(i==null?void 0:i.nodeId)===e&&(i==null?void 0:i.handleId)===t&&(i==null?void 0:i.type)===n,clickConnecting:(s==null?void 0:s.nodeId)===e&&(s==null?void 0:s.handleId)===t&&(s==null?void 0:s.type)===n}},cv=N.forwardRef(({type:e="source",position:t=Y.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:o=!0,isConnectableEnd:i=!0,id:s,onConnect:a,children:l,className:u,onMouseDown:c,onTouchStart:d,...f},h)=>{var B,I;const m=s||null,v=e==="target",y=xe(),p=mO(),{connectOnClick:g,noPanClassName:S}=le(OO,ze),{connecting:_,clickConnecting:w}=le(xO(p,m,e));p||(I=(B=y.getState()).onError)==null||I.call(B,"010",Bn.error010());const R=V=>{const{defaultEdgeOptions:$,onConnect:F,hasDefaultEdges:O}=y.getState(),M={...$,...V};if(O){const{edges:D,setEdges:A}=y.getState();A(Jm(M,D))}F==null||F(M),a==null||a(M)},C=V=>{if(!p)return;const $=zm(V);o&&($&&V.button===0||!$)&&lv({event:V,handleId:m,nodeId:p,onConnect:R,isTarget:v,getState:y.getState,setState:y.setState,isValidConnection:n||y.getState().isValidConnection||uv}),$?c==null||c(V):d==null||d(V)},L=V=>{const{onClickConnectStart:$,onClickConnectEnd:F,connectionClickStartHandle:O,connectionMode:M,isValidConnection:D}=y.getState();if(!p||!O&&!o)return;if(!O){$==null||$(V,{nodeId:p,handleId:m,handleType:e}),y.setState({connectionClickStartHandle:{nodeId:p,type:e,handleId:m}});return}const A=Vm(V.target),T=n||D||uv,{connection:P,isValid:U}=sv(V,{nodeId:p,id:m,type:e},M,O.nodeId,O.handleId||null,O.type,T,A);U&&R(P),F==null||F(V),y.setState({connectionClickStartHandle:null})};return E("div",{"data-handleid":m,"data-nodeid":p,"data-handlepos":t,"data-id":`${p}-${m}-${e}`,className:Je(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",S,u,{source:!v,target:v,connectable:r,connectablestart:o,connectableend:i,connecting:w,connectionindicator:r&&(o&&!_||i&&_)}]),onMouseDown:C,onTouchStart:C,onClick:g?L:void 0,ref:h,...f,children:l})});cv.displayName="Handle";var Ro=N.memo(cv);const dv=({data:e,isConnectable:t,targetPosition:n=Y.Top,sourcePosition:r=Y.Bottom})=>k(ve,{children:[E(Ro,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,E(Ro,{type:"source",position:r,isConnectable:t})]});dv.displayName="DefaultNode";var hd=N.memo(dv);const fv=({data:e,isConnectable:t,sourcePosition:n=Y.Bottom})=>k(ve,{children:[e==null?void 0:e.label,E(Ro,{type:"source",position:n,isConnectable:t})]});fv.displayName="InputNode";var pv=N.memo(fv);const hv=({data:e,isConnectable:t,targetPosition:n=Y.Top})=>k(ve,{children:[E(Ro,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]});hv.displayName="OutputNode";var gv=N.memo(hv);const gd=()=>null;gd.displayName="GroupNode";const TO=e=>({selectedNodes:e.getNodes().filter(t=>t.selected),selectedEdges:e.edges.filter(t=>t.selected)}),Ja=e=>e.id;function CO(e,t){return ze(e.selectedNodes.map(Ja),t.selectedNodes.map(Ja))&&ze(e.selectedEdges.map(Ja),t.selectedEdges.map(Ja))}const mv=N.memo(({onSelectionChange:e})=>{const t=xe(),{selectedNodes:n,selectedEdges:r}=le(TO,CO);return N.useEffect(()=>{var i,s;const o={nodes:n,edges:r};e==null||e(o),(s=(i=t.getState()).onSelectionChange)==null||s.call(i,o)},[n,r,e]),null});mv.displayName="SelectionListener";const IO=e=>!!e.onSelectionChange;function bO({onSelectionChange:e}){const t=le(IO);return e||t?E(mv,{onSelectionChange:e}):null}const AO=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset});function No(e,t){N.useEffect(()=>{typeof e<"u"&&t(e)},[e])}function q(e,t,n){N.useEffect(()=>{typeof t<"u"&&n({[e]:t})},[t])}const LO=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:o,onConnectStart:i,onConnectEnd:s,onClickConnectStart:a,onClickConnectEnd:l,nodesDraggable:u,nodesConnectable:c,nodesFocusable:d,edgesFocusable:f,edgesUpdatable:h,elevateNodesOnSelect:m,minZoom:v,maxZoom:y,nodeExtent:p,onNodesChange:g,onEdgesChange:S,elementsSelectable:_,connectionMode:w,snapGrid:R,snapToGrid:C,translateExtent:L,connectOnClick:B,defaultEdgeOptions:I,fitView:V,fitViewOptions:$,onNodesDelete:F,onEdgesDelete:O,onNodeDrag:M,onNodeDragStart:D,onNodeDragStop:A,onSelectionDrag:T,onSelectionDragStart:P,onSelectionDragStop:U,noPanClassName:H,nodeOrigin:j,rfId:K,autoPanOnConnect:W,autoPanOnNodeDrag:Z,onError:X,connectionRadius:te,isValidConnection:oe})=>{const{setNodes:ge,setEdges:ue,setDefaultNodesAndEdges:Te,setMinZoom:Ye,setMaxZoom:ft,setTranslateExtent:me,setNodeExtent:de,reset:tt}=le(AO,ze),Q=xe();return N.useEffect(()=>{const Zn=r==null?void 0:r.map(Tr=>({...Tr,...I}));return Te(n,Zn),()=>{tt()}},[]),q("defaultEdgeOptions",I,Q.setState),q("connectionMode",w,Q.setState),q("onConnect",o,Q.setState),q("onConnectStart",i,Q.setState),q("onConnectEnd",s,Q.setState),q("onClickConnectStart",a,Q.setState),q("onClickConnectEnd",l,Q.setState),q("nodesDraggable",u,Q.setState),q("nodesConnectable",c,Q.setState),q("nodesFocusable",d,Q.setState),q("edgesFocusable",f,Q.setState),q("edgesUpdatable",h,Q.setState),q("elementsSelectable",_,Q.setState),q("elevateNodesOnSelect",m,Q.setState),q("snapToGrid",C,Q.setState),q("snapGrid",R,Q.setState),q("onNodesChange",g,Q.setState),q("onEdgesChange",S,Q.setState),q("connectOnClick",B,Q.setState),q("fitViewOnInit",V,Q.setState),q("fitViewOnInitOptions",$,Q.setState),q("onNodesDelete",F,Q.setState),q("onEdgesDelete",O,Q.setState),q("onNodeDrag",M,Q.setState),q("onNodeDragStart",D,Q.setState),q("onNodeDragStop",A,Q.setState),q("onSelectionDrag",T,Q.setState),q("onSelectionDragStart",P,Q.setState),q("onSelectionDragStop",U,Q.setState),q("noPanClassName",H,Q.setState),q("nodeOrigin",j,Q.setState),q("rfId",K,Q.setState),q("autoPanOnConnect",W,Q.setState),q("autoPanOnNodeDrag",Z,Q.setState),q("onError",X,Q.setState),q("connectionRadius",te,Q.setState),q("isValidConnection",oe,Q.setState),No(e,ge),No(t,ue),No(v,Ye),No(y,ft),No(L,me),No(p,de),null},vv={display:"none"},DO={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},yv="react-flow__node-desc",Ev="react-flow__edge-desc",kO="react-flow__aria-live",PO=e=>e.ariaLiveMessage;function MO({rfId:e}){const t=le(PO);return E("div",{id:`${kO}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:DO,children:t})}function UO({rfId:e,disableKeyboardA11y:t}){return k(ve,{children:[k("div",{id:`${yv}-${e}`,style:vv,children:["Press enter or space to select a node.",!t&&"You can then use the arrow keys to move the node around."," Press delete to remove it and escape to cancel."," "]}),E("div",{id:`${Ev}-${e}`,style:vv,children:"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel."}),!t&&E(MO,{rfId:e})]})}const FO=(e,t,n)=>n===Y.Left?e-t:n===Y.Right?e+t:e,VO=(e,t,n)=>n===Y.Top?e-t:n===Y.Bottom?e+t:e,Sv="react-flow__edgeupdater",_v=({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:o,onMouseEnter:i,onMouseOut:s,type:a})=>E("circle",{onMouseDown:o,onMouseEnter:i,onMouseOut:s,className:Je([Sv,`${Sv}-${a}`]),cx:FO(t,r,e),cy:VO(n,r,e),r,stroke:"transparent",fill:"transparent"}),BO=()=>!0;var Oo=e=>{const t=({id:n,className:r,type:o,data:i,onClick:s,onEdgeDoubleClick:a,selected:l,animated:u,label:c,labelStyle:d,labelShowBg:f,labelBgStyle:h,labelBgPadding:m,labelBgBorderRadius:v,style:y,source:p,target:g,sourceX:S,sourceY:_,targetX:w,targetY:R,sourcePosition:C,targetPosition:L,elementsSelectable:B,hidden:I,sourceHandleId:V,targetHandleId:$,onContextMenu:F,onMouseEnter:O,onMouseMove:M,onMouseLeave:D,edgeUpdaterRadius:A,onEdgeUpdate:T,onEdgeUpdateStart:P,onEdgeUpdateEnd:U,markerEnd:H,markerStart:j,rfId:K,ariaLabel:W,isFocusable:Z,isUpdatable:X,pathOptions:te,interactionWidth:oe})=>{const ge=N.useRef(null),[ue,Te]=N.useState(!1),[Ye,ft]=N.useState(!1),me=xe(),de=N.useMemo(()=>`url(#${fd(j,K)})`,[j,K]),tt=N.useMemo(()=>`url(#${fd(H,K)})`,[H,K]);if(I)return null;const Q=nt=>{const{edges:Ft,addSelectedEdges:br}=me.getState();if(B&&(me.setState({nodesSelectionActive:!1}),br([n])),s){const Ar=Ft.find(Lr=>Lr.id===n);s(nt,Ar)}},Zn=$i(n,me.getState,a),Tr=$i(n,me.getState,F),us=$i(n,me.getState,O),cs=$i(n,me.getState,M),ko=$i(n,me.getState,D),Cr=(nt,Ft)=>{if(nt.button!==0)return;const{edges:br,isValidConnection:Ar}=me.getState(),Lr=Ft?g:p,El=(Ft?$:V)||null,Dr=Ft?"target":"source",df=Ar||BO,ff=Ft,fs=br.find(kr=>kr.id===n);ft(!0),P==null||P(nt,fs,Dr);const pf=kr=>{ft(!1),U==null||U(kr,fs,Dr)};lv({event:nt,handleId:El,nodeId:Lr,onConnect:kr=>T==null?void 0:T(fs,kr),isTarget:ff,getState:me.getState,setState:me.setState,isValidConnection:df,edgeUpdaterType:Dr,onEdgeUpdateEnd:pf})},Jn=nt=>Cr(nt,!0),Po=nt=>Cr(nt,!1),er=()=>Te(!0),Ir=()=>Te(!1),ds=!B&&!s,Mo=nt=>{var Ft;if(Hm.includes(nt.key)&&B){const{unselectNodesAndEdges:br,addSelectedEdges:Ar,edges:Lr}=me.getState();nt.key==="Escape"?((Ft=ge.current)==null||Ft.blur(),br({edges:[Lr.find(Dr=>Dr.id===n)]})):Ar([n])}};return k("g",{className:Je(["react-flow__edge",`react-flow__edge-${o}`,r,{selected:l,animated:u,inactive:ds,updating:ue}]),onClick:Q,onDoubleClick:Zn,onContextMenu:Tr,onMouseEnter:us,onMouseMove:cs,onMouseLeave:ko,onKeyDown:Z?Mo:void 0,tabIndex:Z?0:void 0,role:Z?"button":void 0,"data-testid":`rf__edge-${n}`,"aria-label":W===null?void 0:W||`Edge from ${p} to ${g}`,"aria-describedby":Z?`${Ev}-${K}`:void 0,ref:ge,children:[!Ye&&E(e,{id:n,source:p,target:g,selected:l,animated:u,label:c,labelStyle:d,labelShowBg:f,labelBgStyle:h,labelBgPadding:m,labelBgBorderRadius:v,data:i,style:y,sourceX:S,sourceY:_,targetX:w,targetY:R,sourcePosition:C,targetPosition:L,sourceHandleId:V,targetHandleId:$,markerStart:de,markerEnd:tt,pathOptions:te,interactionWidth:oe}),X&&k(ve,{children:[(X==="source"||X===!0)&&E(_v,{position:C,centerX:S,centerY:_,radius:A,onMouseDown:Jn,onMouseEnter:er,onMouseOut:Ir,type:"source"}),(X==="target"||X===!0)&&E(_v,{position:L,centerX:w,centerY:R,radius:A,onMouseDown:Po,onMouseEnter:er,onMouseOut:Ir,type:"target"})]})]})};return t.displayName="EdgeWrapper",N.memo(t)};function $O(e){const t={default:Oo(e.default||Za),straight:Oo(e.bezier||cd),step:Oo(e.step||ud),smoothstep:Oo(e.step||Xa),simplebezier:Oo(e.simplebezier||ld)},n={},r=Object.keys(e).filter(o=>!["default","bezier"].includes(o)).reduce((o,i)=>(o[i]=Oo(e[i]||Za),o),n);return{...t,...r}}function wv(e,t,n=null){const r=((n==null?void 0:n.x)||0)+t.x,o=((n==null?void 0:n.y)||0)+t.y,i=(n==null?void 0:n.width)||t.width,s=(n==null?void 0:n.height)||t.height;switch(e){case Y.Top:return{x:r+i/2,y:o};case Y.Right:return{x:r+i,y:o+s/2};case Y.Bottom:return{x:r+i/2,y:o+s};case Y.Left:return{x:r,y:o+s/2}}}function Rv(e,t){return e?e.length===1||!t?e[0]:t&&e.find(n=>n.id===t)||null:null}const HO=(e,t,n,r,o,i)=>{const s=wv(n,e,t),a=wv(i,r,o);return{sourceX:s.x,sourceY:s.y,targetX:a.x,targetY:a.y}};function zO({sourcePos:e,targetPos:t,sourceWidth:n,sourceHeight:r,targetWidth:o,targetHeight:i,width:s,height:a,transform:l}){const u={x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x+n,t.x+o),y2:Math.max(e.y+r,t.y+i)};u.x===u.x2&&(u.x2+=1),u.y===u.y2&&(u.y2+=1);const c=Bm({x:(0-l[0])/l[2],y:(0-l[1])/l[2],width:s/l[2],height:a/l[2]}),d=Math.max(0,Math.min(c.x2,u.x2)-Math.max(c.x,u.x)),f=Math.max(0,Math.min(c.y2,u.y2)-Math.max(c.y,u.y));return Math.ceil(d*f)>0}function Nv(e){var r,o,i,s,a;const t=((r=e==null?void 0:e[we])==null?void 0:r.handleBounds)||null,n=t&&(e==null?void 0:e.width)&&(e==null?void 0:e.height)&&typeof((o=e==null?void 0:e.positionAbsolute)==null?void 0:o.x)<"u"&&typeof((i=e==null?void 0:e.positionAbsolute)==null?void 0:i.y)<"u";return[{x:((s=e==null?void 0:e.positionAbsolute)==null?void 0:s.x)||0,y:((a=e==null?void 0:e.positionAbsolute)==null?void 0:a.y)||0,width:(e==null?void 0:e.width)||0,height:(e==null?void 0:e.height)||0},t,!!n]}function Ov(e,t){if(!e.parentNode)return!1;const n=t.get(e.parentNode);return n?n.selected?!0:Ov(n,t):!1}function xv(e,t,n){let r=e;do{if(r!=null&&r.matches(t))return!0;if(r===n.current)return!1;r=r.parentElement}while(r);return!1}function jO(e,t,n,r){return Array.from(e.values()).filter(o=>(o.selected||o.id===r)&&(!o.parentNode||!Ov(o,e))&&(o.draggable||t&&typeof o.draggable>"u")).map(o=>{var i,s;return{id:o.id,position:o.position||{x:0,y:0},positionAbsolute:o.positionAbsolute||{x:0,y:0},distance:{x:n.x-(((i=o.positionAbsolute)==null?void 0:i.x)??0),y:n.y-(((s=o.positionAbsolute)==null?void 0:s.y)??0)},delta:{x:0,y:0},extent:o.extent,parentNode:o.parentNode,width:o.width,height:o.height}})}function Tv(e,t,n,r,o=[0,0],i){let s=e.extent||r;if(e.extent==="parent")if(e.parentNode&&e.width&&e.height){const u=n.get(e.parentNode),{x:c,y:d}=wo(u,o).positionAbsolute;s=u&&St(c)&&St(d)&&St(u.width)&&St(u.height)?[[c+e.width*o[0],d+e.height*o[1]],[c+u.width-e.width+e.width*o[0],d+u.height-e.height+e.height*o[1]]]:s}else i==null||i("005",Bn.error005()),s=r;else if(e.extent&&e.parentNode){const u=n.get(e.parentNode),{x:c,y:d}=wo(u,o).positionAbsolute;s=[[e.extent[0][0]+c,e.extent[0][1]+d],[e.extent[1][0]+c,e.extent[1][1]+d]]}let a={x:0,y:0};if(e.parentNode){const u=n.get(e.parentNode);a=wo(u,o).positionAbsolute}const l=s?id(t,s):t;return{position:{x:l.x-a.x,y:l.y-a.y},positionAbsolute:l}}function md({nodeId:e,dragItems:t,nodeInternals:n}){const r=t.map(o=>({...n.get(o.id),position:o.position,positionAbsolute:o.positionAbsolute}));return[e?r.find(o=>o.id===e):r[0],r]}const Cv=(e,t,n,r)=>{const o=t.querySelectorAll(e);if(!o||!o.length)return null;const i=Array.from(o),s=t.getBoundingClientRect(),a={x:s.width*r[0],y:s.height*r[1]};return i.map(l=>{const u=l.getBoundingClientRect();return{id:l.getAttribute("data-handleid"),position:l.getAttribute("data-handlepos"),x:(u.left-s.left-a.x)/n,y:(u.top-s.top-a.y)/n,...od(l)}})};function Gi(e,t,n){return n===void 0?n:r=>{const o=t().nodeInternals.get(e);n(r,{...o})}}function vd({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:o,unselectNodesAndEdges:i,multiSelectionActive:s,nodeInternals:a}=t.getState(),l=a.get(e);t.setState({nodesSelectionActive:!1}),l.selected?(n||l.selected&&s)&&(i({nodes:[l]}),requestAnimationFrame(()=>{var u;return(u=r==null?void 0:r.current)==null?void 0:u.blur()})):o([e])}function GO(){const e=xe();return N.useCallback(({sourceEvent:n})=>{const{transform:r,snapGrid:o,snapToGrid:i}=e.getState(),s=n.touches?n.touches[0].clientX:n.clientX,a=n.touches?n.touches[0].clientY:n.clientY,l={x:(s-r[0])/r[2],y:(a-r[1])/r[2]};return{xSnapped:i?o[0]*Math.round(l.x/o[0]):l.x,ySnapped:i?o[1]*Math.round(l.y/o[1]):l.y,...l}},[])}function yd(e){return(t,n,r)=>e==null?void 0:e(t,r)}function Iv({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:o,isSelectable:i,selectNodesOnDrag:s}){const a=xe(),[l,u]=N.useState(!1),c=N.useRef([]),d=N.useRef({x:null,y:null}),f=N.useRef(0),h=N.useRef(null),m=N.useRef({x:0,y:0}),v=N.useRef(null),y=N.useRef(!1),p=GO();return N.useEffect(()=>{if(e!=null&&e.current){const g=At(e.current),S=({x:w,y:R})=>{const{nodeInternals:C,onNodeDrag:L,onSelectionDrag:B,updateNodePositions:I,nodeExtent:V,snapGrid:$,snapToGrid:F,nodeOrigin:O,onError:M}=a.getState();d.current={x:w,y:R};let D=!1;if(c.current=c.current.map(T=>{const P={x:w-T.distance.x,y:R-T.distance.y};F&&(P.x=$[0]*Math.round(P.x/$[0]),P.y=$[1]*Math.round(P.y/$[1]));const U=Tv(T,P,C,V,O,M);return D=D||T.position.x!==U.position.x||T.position.y!==U.position.y,T.position=U.position,T.positionAbsolute=U.positionAbsolute,T}),!D)return;I(c.current,!0,!0),u(!0);const A=o?L:yd(B);if(A&&v.current){const[T,P]=md({nodeId:o,dragItems:c.current,nodeInternals:C});A(v.current,T,P)}},_=()=>{if(!h.current)return;const[w,R]=Fm(m.current,h.current);if(w!==0||R!==0){const{transform:C,panBy:L}=a.getState();d.current.x=(d.current.x??0)-w/C[2],d.current.y=(d.current.y??0)-R/C[2],S(d.current),L({x:w,y:R})}f.current=requestAnimationFrame(_)};if(t)g.on(".drag",null);else{const w=cR().on("start",R=>{var D;const{nodeInternals:C,multiSelectionActive:L,domNode:B,nodesDraggable:I,unselectNodesAndEdges:V,onNodeDragStart:$,onSelectionDragStart:F}=a.getState(),O=o?$:yd(F);!s&&!L&&o&&((D=C.get(o))!=null&&D.selected||V()),o&&i&&s&&vd({id:o,store:a,nodeRef:e});const M=p(R);if(d.current=M,c.current=jO(C,I,M,o),O&&c.current){const[A,T]=md({nodeId:o,dragItems:c.current,nodeInternals:C});O(R.sourceEvent,A,T)}h.current=(B==null?void 0:B.getBoundingClientRect())||null,m.current=$n(R.sourceEvent,h.current)}).on("drag",R=>{const C=p(R),{autoPanOnNodeDrag:L}=a.getState();!y.current&&L&&(y.current=!0,_()),(d.current.x!==C.xSnapped||d.current.y!==C.ySnapped)&&c.current&&(v.current=R.sourceEvent,m.current=$n(R.sourceEvent,h.current),S(C))}).on("end",R=>{if(u(!1),y.current=!1,cancelAnimationFrame(f.current),c.current){const{updateNodePositions:C,nodeInternals:L,onNodeDragStop:B,onSelectionDragStop:I}=a.getState(),V=o?B:yd(I);if(C(c.current,!1,!1),V){const[$,F]=md({nodeId:o,dragItems:c.current,nodeInternals:L});V(R.sourceEvent,$,F)}}}).filter(R=>{const C=R.target;return!R.button&&(!n||!xv(C,`.${n}`,e))&&(!r||xv(C,r,e))});return g.call(w),()=>{g.on(".drag",null)}}}},[e,t,n,r,i,a,o,s,p]),l}function bv(){const e=xe();return N.useCallback(n=>{const{nodeInternals:r,nodeExtent:o,updateNodePositions:i,getNodes:s,snapToGrid:a,snapGrid:l,onError:u,nodesDraggable:c}=e.getState(),d=s().filter(g=>g.selected&&(g.draggable||c&&typeof g.draggable>"u")),f=a?l[0]:5,h=a?l[1]:5,m=n.isShiftPressed?4:1,v=n.x*f*m,y=n.y*h*m,p=d.map(g=>{if(g.positionAbsolute){const S={x:g.positionAbsolute.x+v,y:g.positionAbsolute.y+y};a&&(S.x=l[0]*Math.round(S.x/l[0]),S.y=l[1]*Math.round(S.y/l[1]));const{positionAbsolute:_,position:w}=Tv(g,S,r,o,void 0,u);g.position=w,g.positionAbsolute=_}return g});i(p,!0,!1)},[])}const xo={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};var Yi=e=>{const t=({id:n,type:r,data:o,xPos:i,yPos:s,xPosOrigin:a,yPosOrigin:l,selected:u,onClick:c,onMouseEnter:d,onMouseMove:f,onMouseLeave:h,onContextMenu:m,onDoubleClick:v,style:y,className:p,isDraggable:g,isSelectable:S,isConnectable:_,isFocusable:w,selectNodesOnDrag:R,sourcePosition:C,targetPosition:L,hidden:B,resizeObserver:I,dragHandle:V,zIndex:$,isParent:F,noDragClassName:O,noPanClassName:M,initialized:D,disableKeyboardA11y:A,ariaLabel:T,rfId:P})=>{const U=xe(),H=N.useRef(null),j=N.useRef(C),K=N.useRef(L),W=N.useRef(r),Z=S||g||c||d||f||h,X=bv(),te=Gi(n,U.getState,d),oe=Gi(n,U.getState,f),ge=Gi(n,U.getState,h),ue=Gi(n,U.getState,m),Te=Gi(n,U.getState,v),Ye=de=>{if(S&&(!R||!g)&&vd({id:n,store:U,nodeRef:H}),c){const tt=U.getState().nodeInternals.get(n);c(de,{...tt})}},ft=de=>{if(!ad(de))if(Hm.includes(de.key)&&S){const tt=de.key==="Escape";vd({id:n,store:U,unselect:tt,nodeRef:H})}else!A&&g&&u&&Object.prototype.hasOwnProperty.call(xo,de.key)&&(U.setState({ariaLiveMessage:`Moved selected node ${de.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~i}, y: ${~~s}`}),X({x:xo[de.key].x,y:xo[de.key].y,isShiftPressed:de.shiftKey}))};N.useEffect(()=>{if(H.current&&!B){const de=H.current;return I==null||I.observe(de),()=>I==null?void 0:I.unobserve(de)}},[B]),N.useEffect(()=>{const de=W.current!==r,tt=j.current!==C,Q=K.current!==L;H.current&&(de||tt||Q)&&(de&&(W.current=r),tt&&(j.current=C),Q&&(K.current=L),U.getState().updateNodeDimensions([{id:n,nodeElement:H.current,forceUpdate:!0}]))},[n,r,C,L]);const me=Iv({nodeRef:H,disabled:B||!g,noDragClassName:O,handleSelector:V,nodeId:n,isSelectable:S,selectNodesOnDrag:R});return B?null:E("div",{className:Je(["react-flow__node",`react-flow__node-${r}`,{[M]:g},p,{selected:u,selectable:S,parent:F,dragging:me}]),ref:H,style:{zIndex:$,transform:`translate(${a}px,${l}px)`,pointerEvents:Z?"all":"none",visibility:D?"visible":"hidden",...y},"data-id":n,"data-testid":`rf__node-${n}`,onMouseEnter:te,onMouseMove:oe,onMouseLeave:ge,onContextMenu:ue,onClick:Ye,onDoubleClick:Te,onKeyDown:w?ft:void 0,tabIndex:w?0:void 0,role:w?"button":void 0,"aria-describedby":A?void 0:`${yv}-${P}`,"aria-label":T,children:E(gO,{value:n,children:E(e,{id:n,data:o,type:r,xPos:i,yPos:s,selected:u,isConnectable:_,sourcePosition:C,targetPosition:L,dragging:me,dragHandle:V,zIndex:$})})})};return t.displayName="NodeWrapper",N.memo(t)};function YO(e){const t={input:Yi(e.input||pv),default:Yi(e.default||hd),output:Yi(e.output||gv),group:Yi(e.group||gd)},n={},r=Object.keys(e).filter(o=>!["input","default","output","group"].includes(o)).reduce((o,i)=>(o[i]=Yi(e[i]||hd),o),n);return{...t,...r}}const WO=({x:e,y:t,width:n,height:r,origin:o})=>!n||!r?{x:e,y:t}:o[0]<0||o[1]<0||o[0]>1||o[1]>1?{x:e,y:t}:{x:e-n*o[0],y:t-r*o[1]},KO=typeof document<"u"?document:null;var Wi=(e=null,t={target:KO})=>{const[n,r]=N.useState(!1),o=N.useRef(!1),i=N.useRef(new Set([])),[s,a]=N.useMemo(()=>{if(e!==null){const u=(Array.isArray(e)?e:[e]).filter(d=>typeof d=="string").map(d=>d.split("+")),c=u.reduce((d,f)=>d.concat(...f),[]);return[u,c]}return[[],[]]},[e]);return N.useEffect(()=>{var l,u;if(e!==null){const c=h=>{if(o.current=h.ctrlKey||h.metaKey||h.shiftKey,!o.current&&ad(h))return!1;const m=Lv(h.code,a);i.current.add(h[m]),Av(s,i.current,!1)&&(h.preventDefault(),r(!0))},d=h=>{if(!o.current&&ad(h))return!1;const m=Lv(h.code,a);Av(s,i.current,!0)?(r(!1),i.current.clear()):i.current.delete(h[m]),o.current=!1},f=()=>{i.current.clear(),r(!1)};return(l=t==null?void 0:t.target)==null||l.addEventListener("keydown",c),(u=t==null?void 0:t.target)==null||u.addEventListener("keyup",d),window.addEventListener("blur",f),()=>{var h,m;(h=t==null?void 0:t.target)==null||h.removeEventListener("keydown",c),(m=t==null?void 0:t.target)==null||m.removeEventListener("keyup",d),window.removeEventListener("blur",f)}}},[e,r]),n};function Av(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(o=>t.has(o)))}function Lv(e,t){return t.includes(e)?"code":"key"}function Dv(e,t,n,r){var s,a;if(!e.parentNode)return n;const o=t.get(e.parentNode),i=wo(o,r);return Dv(o,t,{x:(n.x??0)+i.x,y:(n.y??0)+i.y,z:(((s=o[we])==null?void 0:s.z)??0)>(n.z??0)?((a=o[we])==null?void 0:a.z)??0:n.z??0},r)}function kv(e,t,n){e.forEach(r=>{var o;if(r.parentNode&&!e.has(r.parentNode))throw new Error(`Parent node ${r.parentNode} not found`);if(r.parentNode||n!=null&&n[r.id]){const{x:i,y:s,z:a}=Dv(r,e,{...r.position,z:((o=r[we])==null?void 0:o.z)??0},t);r.positionAbsolute={x:i,y:s},r[we].z=a,n!=null&&n[r.id]&&(r[we].isParent=!0)}})}function Ed(e,t,n,r){const o=new Map,i={},s=r?1e3:0;return e.forEach(a=>{var d;const l=(St(a.zIndex)?a.zIndex:0)+(a.selected?s:0),u=t.get(a.id),c={width:u==null?void 0:u.width,height:u==null?void 0:u.height,...a,positionAbsolute:{x:a.position.x,y:a.position.y}};a.parentNode&&(c.parentNode=a.parentNode,i[a.parentNode]=!0),Object.defineProperty(c,we,{enumerable:!1,value:{handleBounds:(d=u==null?void 0:u[we])==null?void 0:d.handleBounds,z:l}}),o.set(a.id,c)}),kv(o,n,i),o}function Pv(e,t={}){const{getNodes:n,width:r,height:o,minZoom:i,maxZoom:s,d3Zoom:a,d3Selection:l,fitViewOnInitDone:u,fitViewOnInit:c,nodeOrigin:d}=e(),f=t.initial&&!u&&c;if(a&&l&&(f||!t.initial)){const m=n().filter(y=>{var g;const p=t.includeHiddenNodes?y.width&&y.height:!y.hidden;return(g=t.nodes)!=null&&g.length?p&&t.nodes.some(S=>S.id===y.id):p}),v=m.every(y=>y.width&&y.height);if(m.length>0&&v){const y=tv(m,d),[p,g,S]=ov(y,r,o,t.minZoom??i,t.maxZoom??s,t.padding??.1),_=Vn.translate(p,g).scale(S);return typeof t.duration=="number"&&t.duration>0?a.transform(yr(l,t.duration),_):a.transform(l,_),!0}}return!1}function QO(e,t){return e.forEach(n=>{const r=t.get(n.id);r&&t.set(r.id,{...r,[we]:r[we],selected:n.selected})}),new Map(t)}function XO(e,t){return t.map(n=>{const r=e.find(o=>o.id===n.id);return r&&(n.selected=r.selected),n})}function el({changedNodes:e,changedEdges:t,get:n,set:r}){const{nodeInternals:o,edges:i,onNodesChange:s,onEdgesChange:a,hasDefaultNodes:l,hasDefaultEdges:u}=n();e!=null&&e.length&&(l&&r({nodeInternals:QO(e,o)}),s==null||s(e)),t!=null&&t.length&&(u&&r({edges:XO(t,i)}),a==null||a(t))}const To=()=>{},qO={zoomIn:To,zoomOut:To,zoomTo:To,getZoom:()=>1,setViewport:To,getViewport:()=>({x:0,y:0,zoom:1}),fitView:()=>!1,setCenter:To,fitBounds:To,project:e=>e,viewportInitialized:!1},ZO=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection}),JO=()=>{const e=xe(),{d3Zoom:t,d3Selection:n}=le(ZO,ze);return N.useMemo(()=>n&&t?{zoomIn:o=>t.scaleBy(yr(n,o==null?void 0:o.duration),1.2),zoomOut:o=>t.scaleBy(yr(n,o==null?void 0:o.duration),1/1.2),zoomTo:(o,i)=>t.scaleTo(yr(n,i==null?void 0:i.duration),o),getZoom:()=>e.getState().transform[2],setViewport:(o,i)=>{const[s,a,l]=e.getState().transform,u=Vn.translate(o.x??s,o.y??a).scale(o.zoom??l);t.transform(yr(n,i==null?void 0:i.duration),u)},getViewport:()=>{const[o,i,s]=e.getState().transform;return{x:o,y:i,zoom:s}},fitView:o=>Pv(e.getState,o),setCenter:(o,i,s)=>{const{width:a,height:l,maxZoom:u}=e.getState(),c=typeof(s==null?void 0:s.zoom)<"u"?s.zoom:u,d=a/2-o*c,f=l/2-i*c,h=Vn.translate(d,f).scale(c);t.transform(yr(n,s==null?void 0:s.duration),h)},fitBounds:(o,i)=>{const{width:s,height:a,minZoom:l,maxZoom:u}=e.getState(),[c,d,f]=ov(o,s,a,l,u,(i==null?void 0:i.padding)??.1),h=Vn.translate(c,d).scale(f);t.transform(yr(n,i==null?void 0:i.duration),h)},project:o=>{const{transform:i,snapToGrid:s,snapGrid:a}=e.getState();return ev(o,i,s,a)},viewportInitialized:!0}:qO,[t,n])};function Sd(){const e=JO(),t=xe(),n=N.useCallback(()=>t.getState().getNodes().map(v=>({...v})),[]),r=N.useCallback(v=>t.getState().nodeInternals.get(v),[]),o=N.useCallback(()=>{const{edges:v=[]}=t.getState();return v.map(y=>({...y}))},[]),i=N.useCallback(v=>{const{edges:y=[]}=t.getState();return y.find(p=>p.id===v)},[]),s=N.useCallback(v=>{const{getNodes:y,setNodes:p,hasDefaultNodes:g,onNodesChange:S}=t.getState(),_=y(),w=typeof v=="function"?v(_):v;if(g)p(w);else if(S){const R=w.length===0?_.map(C=>({type:"remove",id:C.id})):w.map(C=>({item:C,type:"reset"}));S(R)}},[]),a=N.useCallback(v=>{const{edges:y=[],setEdges:p,hasDefaultEdges:g,onEdgesChange:S}=t.getState(),_=typeof v=="function"?v(y):v;if(g)p(_);else if(S){const w=_.length===0?y.map(R=>({type:"remove",id:R.id})):_.map(R=>({item:R,type:"reset"}));S(w)}},[]),l=N.useCallback(v=>{const y=Array.isArray(v)?v:[v],{getNodes:p,setNodes:g,hasDefaultNodes:S,onNodesChange:_}=t.getState();if(S){const R=[...p(),...y];g(R)}else if(_){const w=y.map(R=>({item:R,type:"add"}));_(w)}},[]),u=N.useCallback(v=>{const y=Array.isArray(v)?v:[v],{edges:p=[],setEdges:g,hasDefaultEdges:S,onEdgesChange:_}=t.getState();if(S)g([...p,...y]);else if(_){const w=y.map(R=>({item:R,type:"add"}));_(w)}},[]),c=N.useCallback(()=>{const{getNodes:v,edges:y=[],transform:p}=t.getState(),[g,S,_]=p;return{nodes:v().map(w=>({...w})),edges:y.map(w=>({...w})),viewport:{x:g,y:S,zoom:_}}},[]),d=N.useCallback(({nodes:v,edges:y})=>{const{nodeInternals:p,getNodes:g,edges:S,hasDefaultNodes:_,hasDefaultEdges:w,onNodesDelete:R,onEdgesDelete:C,onNodesChange:L,onEdgesChange:B}=t.getState(),I=(v||[]).map(M=>M.id),V=(y||[]).map(M=>M.id),$=g().reduce((M,D)=>{const A=!I.includes(D.id)&&D.parentNode&&M.find(P=>P.id===D.parentNode);return(typeof D.deletable=="boolean"?D.deletable:!0)&&(I.includes(D.id)||A)&&M.push(D),M},[]),F=S.filter(M=>typeof M.deletable=="boolean"?M.deletable:!0),O=F.filter(M=>V.includes(M.id));if($||O){const M=rv($,F),D=[...O,...M],A=D.reduce((T,P)=>(T.includes(P.id)||T.push(P.id),T),[]);if((w||_)&&(w&&t.setState({edges:S.filter(T=>!A.includes(T.id))}),_&&($.forEach(T=>{p.delete(T.id)}),t.setState({nodeInternals:new Map(p)}))),A.length>0&&(C==null||C(D),B&&B(A.map(T=>({id:T,type:"remove"})))),$.length>0&&(R==null||R($),L)){const T=$.map(P=>({id:P.id,type:"remove"}));L(T)}}},[]),f=N.useCallback(v=>{const y=lO(v),p=y?null:t.getState().nodeInternals.get(v.id);return[y?v:$m(p),p,y]},[]),h=N.useCallback((v,y=!0,p)=>{const[g,S,_]=f(v);return g?(p||t.getState().getNodes()).filter(w=>{if(!_&&(w.id===S.id||!w.positionAbsolute))return!1;const R=$m(w),C=sd(R,g);return y&&C>0||C>=v.width*v.height}):[]},[]),m=N.useCallback((v,y,p=!0)=>{const[g]=f(v);if(!g)return!1;const S=sd(g,y);return p&&S>0||S>=v.width*v.height},[]);return N.useMemo(()=>({...e,getNodes:n,getNode:r,getEdges:o,getEdge:i,setNodes:s,setEdges:a,addNodes:l,addEdges:u,toObject:c,deleteElements:d,getIntersectingNodes:h,isNodeIntersecting:m}),[e,n,r,o,i,s,a,l,u,c,d,h,m])}var ex=({deleteKeyCode:e,multiSelectionKeyCode:t})=>{const n=xe(),{deleteElements:r}=Sd(),o=Wi(e),i=Wi(t);N.useEffect(()=>{if(o){const{edges:s,getNodes:a}=n.getState(),l=a().filter(c=>c.selected),u=s.filter(c=>c.selected);r({nodes:l,edges:u}),n.setState({nodesSelectionActive:!1})}},[o]),N.useEffect(()=>{n.setState({multiSelectionActive:i})},[i])};function tx(e){const t=xe();N.useEffect(()=>{let n;const r=()=>{var i,s;if(!e.current)return;const o=od(e.current);(o.height===0||o.width===0)&&((s=(i=t.getState()).onError)==null||s.call(i,"004",Bn.error004())),t.setState({width:o.width||500,height:o.height||500})};return r(),window.addEventListener("resize",r),e.current&&(n=new ResizeObserver(()=>r()),n.observe(e.current)),()=>{window.removeEventListener("resize",r),n&&e.current&&n.unobserve(e.current)}},[])}const _d={position:"absolute",width:"100%",height:"100%",top:0,left:0},nx=(e,t)=>e.x!==t.x||e.y!==t.y||e.zoom!==t.k,wd=e=>({x:e.x,y:e.y,zoom:e.k}),Co=(e,t)=>e.target.closest(`.${t}`),Mv=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),rx=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection,d3ZoomHandler:e.d3ZoomHandler,userSelectionActive:e.userSelectionActive}),ox=({onMove:e,onMoveStart:t,onMoveEnd:n,onPaneContextMenu:r,zoomOnScroll:o=!0,zoomOnPinch:i=!0,panOnScroll:s=!1,panOnScrollSpeed:a=.5,panOnScrollMode:l=_o.Free,zoomOnDoubleClick:u=!0,elementsSelectable:c,panOnDrag:d=!0,defaultViewport:f,translateExtent:h,minZoom:m,maxZoom:v,zoomActivationKeyCode:y,preventScrolling:p=!0,children:g,noWheelClassName:S,noPanClassName:_})=>{const w=N.useRef(),R=xe(),C=N.useRef(!1),L=N.useRef(!1),B=N.useRef(null),I=N.useRef({x:0,y:0,zoom:0}),{d3Zoom:V,d3Selection:$,d3ZoomHandler:F,userSelectionActive:O}=le(rx,ze),M=Wi(y),D=N.useRef(0);return tx(B),N.useEffect(()=>{if(B.current){const A=B.current.getBoundingClientRect(),T=eO().scaleExtent([m,v]).translateExtent(h),P=At(B.current).call(T),U=Vn.translate(f.x,f.y).scale(Eo(f.zoom,m,v)),H=[[0,0],[A.width,A.height]],j=T.constrain()(U,H,h);T.transform(P,j),R.setState({d3Zoom:T,d3Selection:P,d3ZoomHandler:P.on("wheel.zoom"),transform:[j.x,j.y,j.k],domNode:B.current.closest(".react-flow")})}},[]),N.useEffect(()=>{$&&V&&(s&&!M&&!O?$.on("wheel.zoom",A=>{if(Co(A,S))return!1;A.preventDefault(),A.stopImmediatePropagation();const T=$.property("__zoom").k||1;if(A.ctrlKey&&i){const j=jt(A),K=-A.deltaY*(A.deltaMode===1?.05:A.deltaMode?1:.002)*10,W=T*Math.pow(2,K);V.scaleTo($,W,j);return}const P=A.deltaMode===1?20:1,U=l===_o.Vertical?0:A.deltaX*P,H=l===_o.Horizontal?0:A.deltaY*P;V.translateBy($,-(U/T)*a,-(H/T)*a)},{passive:!1}):typeof F<"u"&&$.on("wheel.zoom",function(A,T){if(!p||Co(A,S))return null;A.preventDefault(),F.call(this,A,T)},{passive:!1}))},[O,s,l,$,V,F,M,i,p,S]),N.useEffect(()=>{V&&V.on("start",A=>{var P;if(!A.sourceEvent)return null;D.current=A.sourceEvent.button;const{onViewportChangeStart:T}=R.getState();if(C.current=!0,((P=A.sourceEvent)==null?void 0:P.type)==="mousedown"&&R.setState({paneDragging:!0}),t||T){const U=wd(A.transform);I.current=U,T==null||T(U),t==null||t(A.sourceEvent,U)}})},[V,t]),N.useEffect(()=>{V&&(O&&!C.current?V.on("zoom",null):O||V.on("zoom",A=>{const{onViewportChange:T}=R.getState();if(R.setState({transform:[A.transform.x,A.transform.y,A.transform.k]}),L.current=!!(r&&Mv(d,D.current??0)),e||T){const P=wd(A.transform);T==null||T(P),e==null||e(A.sourceEvent,P)}}))},[O,V,e,d,r]),N.useEffect(()=>{V&&V.on("end",A=>{if(!A.sourceEvent)return null;const{onViewportChangeEnd:T}=R.getState();if(C.current=!1,R.setState({paneDragging:!1}),r&&Mv(d,D.current??0)&&!L.current&&r(A.sourceEvent),L.current=!1,(n||T)&&nx(I.current,A.transform)){const P=wd(A.transform);I.current=P,clearTimeout(w.current),w.current=setTimeout(()=>{T==null||T(P),n==null||n(A.sourceEvent,P)},s?150:0)}})},[V,s,d,n,r]),N.useEffect(()=>{V&&V.filter(A=>{const T=M||o,P=i&&A.ctrlKey;if(A.button===1&&A.type==="mousedown"&&(Co(A,"react-flow__node")||Co(A,"react-flow__edge")))return!0;if(!d&&!T&&!s&&!u&&!i||O||!u&&A.type==="dblclick"||Co(A,S)&&A.type==="wheel"||Co(A,_)&&A.type!=="wheel"||!i&&A.ctrlKey&&A.type==="wheel"||!T&&!s&&!P&&A.type==="wheel"||!d&&(A.type==="mousedown"||A.type==="touchstart")||Array.isArray(d)&&!d.includes(A.button)&&(A.type==="mousedown"||A.type==="touchstart"))return!1;const U=Array.isArray(d)&&d.includes(A.button)||!A.button||A.button<=1;return(!A.ctrlKey||A.type==="wheel")&&U})},[O,V,o,i,s,u,d,c,M]),E("div",{className:"react-flow__renderer",ref:B,style:_d,children:g})},ix=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function sx(){const{userSelectionActive:e,userSelectionRect:t}=le(ix,ze);return e&&t?E("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}function Uv(e,t){const n=e.find(r=>r.id===t.parentNode);if(n){const r=t.position.x+t.width-n.width,o=t.position.y+t.height-n.height;if(r>0||o>0||t.position.x<0||t.position.y<0){if(n.style={...n.style},n.style.width=n.style.width??n.width,n.style.height=n.style.height??n.height,r>0&&(n.style.width+=r),o>0&&(n.style.height+=o),t.position.x<0){const i=Math.abs(t.position.x);n.position.x=n.position.x-i,n.style.width+=i,t.position.x=0}if(t.position.y<0){const i=Math.abs(t.position.y);n.position.y=n.position.y-i,n.style.height+=i,t.position.y=0}n.width=n.style.width,n.height=n.style.height}}}function Fv(e,t){if(e.some(r=>r.type==="reset"))return e.filter(r=>r.type==="reset").map(r=>r.item);const n=e.filter(r=>r.type==="add").map(r=>r.item);return t.reduce((r,o)=>{const i=e.filter(a=>a.id===o.id);if(i.length===0)return r.push(o),r;const s={...o};for(const a of i)if(a)switch(a.type){case"select":{s.selected=a.selected;break}case"position":{typeof a.position<"u"&&(s.position=a.position),typeof a.positionAbsolute<"u"&&(s.positionAbsolute=a.positionAbsolute),typeof a.dragging<"u"&&(s.dragging=a.dragging),s.expandParent&&Uv(r,s);break}case"dimensions":{typeof a.dimensions<"u"&&(s.width=a.dimensions.width,s.height=a.dimensions.height),typeof a.updateStyle<"u"&&(s.style={...s.style||{},...a.dimensions}),typeof a.resizing=="boolean"&&(s.resizing=a.resizing),s.expandParent&&Uv(r,s);break}case"remove":return r}return r.push(s),r},n)}function Vv(e,t){return Fv(e,t)}function ax(e,t){return Fv(e,t)}const jn=(e,t)=>({id:e,type:"select",selected:t});function Io(e,t){return e.reduce((n,r)=>{const o=t.includes(r.id);return!r.selected&&o?(r.selected=!0,n.push(jn(r.id,!0))):r.selected&&!o&&(r.selected=!1,n.push(jn(r.id,!1))),n},[])}const Rd=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},lx=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging}),Bv=N.memo(({isSelecting:e,selectionMode:t=Hi.Full,panOnDrag:n,onSelectionStart:r,onSelectionEnd:o,onPaneClick:i,onPaneContextMenu:s,onPaneScroll:a,onPaneMouseEnter:l,onPaneMouseMove:u,onPaneMouseLeave:c,children:d})=>{const f=N.useRef(null),h=xe(),m=N.useRef(0),v=N.useRef(0),y=N.useRef(),{userSelectionActive:p,elementsSelectable:g,dragging:S}=le(lx,ze),_=()=>{h.setState({userSelectionActive:!1,userSelectionRect:null}),m.current=0,v.current=0},w=F=>{i==null||i(F),h.getState().resetSelectedElements(),h.setState({nodesSelectionActive:!1})},R=F=>{if(Array.isArray(n)&&(n!=null&&n.includes(2))){F.preventDefault();return}s==null||s(F)},C=a?F=>a(F):void 0,L=F=>{const{resetSelectedElements:O,domNode:M}=h.getState();if(y.current=M==null?void 0:M.getBoundingClientRect(),!g||!e||F.button!==0||F.target!==f.current||!y.current)return;const{x:D,y:A}=$n(F,y.current);O(),h.setState({userSelectionRect:{width:0,height:0,startX:D,startY:A,x:D,y:A}}),r==null||r(F)},B=F=>{const{userSelectionRect:O,nodeInternals:M,edges:D,transform:A,onNodesChange:T,onEdgesChange:P,nodeOrigin:U,getNodes:H}=h.getState();if(!e||!y.current||!O)return;h.setState({userSelectionActive:!0,nodesSelectionActive:!1});const j=$n(F,y.current),K=O.startX??0,W=O.startY??0,Z={...O,x:j.x<K?j.x:K,y:j.y<W?j.y:W,width:Math.abs(j.x-K),height:Math.abs(j.y-W)},X=H(),te=nv(M,Z,A,t===Hi.Partial,!0,U),oe=rv(te,D).map(ue=>ue.id),ge=te.map(ue=>ue.id);if(m.current!==ge.length){m.current=ge.length;const ue=Io(X,ge);ue.length&&(T==null||T(ue))}if(v.current!==oe.length){v.current=oe.length;const ue=Io(D,oe);ue.length&&(P==null||P(ue))}h.setState({userSelectionRect:Z})},I=F=>{if(F.button!==0)return;const{userSelectionRect:O}=h.getState();!p&&O&&F.target===f.current&&(w==null||w(F)),h.setState({nodesSelectionActive:m.current>0}),_(),o==null||o(F)},V=F=>{p&&(h.setState({nodesSelectionActive:m.current>0}),o==null||o(F)),_()},$=g&&(e||p);return k("div",{className:Je(["react-flow__pane",{dragging:S,selection:e}]),onClick:$?void 0:Rd(w,f),onContextMenu:Rd(R,f),onWheel:Rd(C,f),onMouseEnter:$?void 0:l,onMouseDown:$?L:void 0,onMouseMove:$?B:u,onMouseUp:$?I:void 0,onMouseLeave:$?V:c,ref:f,style:_d,children:[d,E(sx,{})]})});Bv.displayName="Pane";const ux=e=>{const t=e.getNodes().filter(n=>n.selected);return{...tv(t,e.nodeOrigin),transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`,userSelectionActive:e.userSelectionActive}};function cx({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=xe(),{width:o,height:i,x:s,y:a,transformString:l,userSelectionActive:u}=le(ux,ze),c=bv(),d=N.useRef(null);if(N.useEffect(()=>{var m;n||(m=d.current)==null||m.focus({preventScroll:!0})},[n]),Iv({nodeRef:d}),u||!o||!i)return null;const f=e?m=>{const v=r.getState().getNodes().filter(y=>y.selected);e(m,v)}:void 0,h=m=>{Object.prototype.hasOwnProperty.call(xo,m.key)&&c({x:xo[m.key].x,y:xo[m.key].y,isShiftPressed:m.shiftKey})};return E("div",{className:Je(["react-flow__nodesselection","react-flow__container",t]),style:{transform:l},children:E("div",{ref:d,className:"react-flow__nodesselection-rect",onContextMenu:f,tabIndex:n?void 0:-1,onKeyDown:n?void 0:h,style:{width:o,height:i,top:a,left:s}})})}var dx=N.memo(cx);const fx=e=>e.nodesSelectionActive,$v=({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:o,onPaneContextMenu:i,onPaneScroll:s,deleteKeyCode:a,onMove:l,onMoveStart:u,onMoveEnd:c,selectionKeyCode:d,selectionOnDrag:f,selectionMode:h,onSelectionStart:m,onSelectionEnd:v,multiSelectionKeyCode:y,panActivationKeyCode:p,zoomActivationKeyCode:g,elementsSelectable:S,zoomOnScroll:_,zoomOnPinch:w,panOnScroll:R,panOnScrollSpeed:C,panOnScrollMode:L,zoomOnDoubleClick:B,panOnDrag:I,defaultViewport:V,translateExtent:$,minZoom:F,maxZoom:O,preventScrolling:M,onSelectionContextMenu:D,noWheelClassName:A,noPanClassName:T,disableKeyboardA11y:P})=>{const U=le(fx),H=Wi(d),K=Wi(p)||I,W=H||f&&K!==!0;return ex({deleteKeyCode:a,multiSelectionKeyCode:y}),E(ox,{onMove:l,onMoveStart:u,onMoveEnd:c,onPaneContextMenu:i,elementsSelectable:S,zoomOnScroll:_,zoomOnPinch:w,panOnScroll:R,panOnScrollSpeed:C,panOnScrollMode:L,zoomOnDoubleClick:B,panOnDrag:!H&&K,defaultViewport:V,translateExtent:$,minZoom:F,maxZoom:O,zoomActivationKeyCode:g,preventScrolling:M,noWheelClassName:A,noPanClassName:T,children:k(Bv,{onSelectionStart:m,onSelectionEnd:v,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:o,onPaneContextMenu:i,onPaneScroll:s,panOnDrag:K,isSelecting:!!W,selectionMode:h,children:[e,U&&E(dx,{onSelectionContextMenu:D,noPanClassName:T,disableKeyboardA11y:P})]})})};$v.displayName="FlowRenderer";var px=N.memo($v);function hx(e){return le(N.useCallback(n=>e?nv(n.nodeInternals,{x:0,y:0,width:n.width,height:n.height},n.transform,!0):n.getNodes(),[e]))}const gx=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,updateNodeDimensions:e.updateNodeDimensions,onError:e.onError}),Hv=e=>{const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:o,updateNodeDimensions:i,onError:s}=le(gx,ze),a=hx(e.onlyRenderVisibleElements),l=N.useRef(),u=N.useMemo(()=>{if(typeof ResizeObserver>"u")return null;const c=new ResizeObserver(d=>{const f=d.map(h=>({id:h.target.getAttribute("data-id"),nodeElement:h.target,forceUpdate:!0}));i(f)});return l.current=c,c},[]);return N.useEffect(()=>()=>{var c;(c=l==null?void 0:l.current)==null||c.disconnect()},[]),E("div",{className:"react-flow__nodes",style:_d,children:a.map(c=>{var w,R;let d=c.type||"default";e.nodeTypes[d]||(s==null||s("003",Bn.error003(d)),d="default");const f=e.nodeTypes[d]||e.nodeTypes.default,h=!!(c.draggable||t&&typeof c.draggable>"u"),m=!!(c.selectable||o&&typeof c.selectable>"u"),v=!!(c.connectable||n&&typeof c.connectable>"u"),y=!!(c.focusable||r&&typeof c.focusable>"u"),p=e.nodeExtent?id(c.positionAbsolute,e.nodeExtent):c.positionAbsolute,g=(p==null?void 0:p.x)??0,S=(p==null?void 0:p.y)??0,_=WO({x:g,y:S,width:c.width??0,height:c.height??0,origin:e.nodeOrigin});return E(f,{id:c.id,className:c.className,style:c.style,type:d,data:c.data,sourcePosition:c.sourcePosition||Y.Bottom,targetPosition:c.targetPosition||Y.Top,hidden:c.hidden,xPos:g,yPos:S,xPosOrigin:_.x,yPosOrigin:_.y,selectNodesOnDrag:e.selectNodesOnDrag,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,selected:!!c.selected,isDraggable:h,isSelectable:m,isConnectable:v,isFocusable:y,resizeObserver:u,dragHandle:c.dragHandle,zIndex:((w=c[we])==null?void 0:w.z)??0,isParent:!!((R=c[we])!=null&&R.isParent),noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,initialized:!!c.width&&!!c.height,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,ariaLabel:c.ariaLabel},c.id)})})};Hv.displayName="NodeRenderer";var mx=N.memo(Hv);const vx=[{level:0,isMaxLevel:!0,edges:[]}];function yx(e,t,n=!1){let r=-1;const o=e.reduce((s,a)=>{var c,d,f,h;const l=St(a.zIndex);let u=l?a.zIndex:0;return n&&(u=l?a.zIndex:Math.max(((d=(c=t.get(a.source))==null?void 0:c[we])==null?void 0:d.z)||0,((h=(f=t.get(a.target))==null?void 0:f[we])==null?void 0:h.z)||0)),s[u]?s[u].push(a):s[u]=[a],r=u>r?u:r,s},{}),i=Object.entries(o).map(([s,a])=>{const l=+s;return{edges:a,level:l,isMaxLevel:l===r}});return i.length===0?vx:i}function Ex(e,t,n){const r=le(N.useCallback(o=>e?o.edges.filter(i=>{const s=t.get(i.source),a=t.get(i.target);return(s==null?void 0:s.width)&&(s==null?void 0:s.height)&&(a==null?void 0:a.width)&&(a==null?void 0:a.height)&&zO({sourcePos:s.positionAbsolute||{x:0,y:0},targetPos:a.positionAbsolute||{x:0,y:0},sourceWidth:s.width,sourceHeight:s.height,targetWidth:a.width,targetHeight:a.height,width:o.width,height:o.height,transform:o.transform})}):o.edges,[e,t]));return yx(r,t,n)}const Sx=({color:e="none",strokeWidth:t=1})=>E("polyline",{stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:t,fill:"none",points:"-5,-4 0,0 -5,4"}),_x=({color:e="none",strokeWidth:t=1})=>E("polyline",{stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:t,fill:e,points:"-5,-4 0,0 -5,4 -5,-4"}),zv={[zi.Arrow]:Sx,[zi.ArrowClosed]:_x};function wx(e){const t=xe();return N.useMemo(()=>{var o,i;return Object.prototype.hasOwnProperty.call(zv,e)?zv[e]:((i=(o=t.getState()).onError)==null||i.call(o,"009",Bn.error009(e)),null)},[e])}const Rx=({id:e,type:t,color:n,width:r=12.5,height:o=12.5,markerUnits:i="strokeWidth",strokeWidth:s,orient:a="auto-start-reverse"})=>{const l=wx(t);return l?E("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${o}`,viewBox:"-10 -10 20 20",markerUnits:i,orient:a,refX:"0",refY:"0",children:E(l,{color:n,strokeWidth:s})}):null},Nx=({defaultColor:e,rfId:t})=>n=>{const r=[];return n.edges.reduce((o,i)=>([i.markerStart,i.markerEnd].forEach(s=>{if(s&&typeof s=="object"){const a=fd(s,t);r.includes(a)||(o.push({id:a,color:s.color||e,...s}),r.push(a))}}),o),[]).sort((o,i)=>o.id.localeCompare(i.id))},jv=({defaultColor:e,rfId:t})=>{const n=le(N.useCallback(Nx({defaultColor:e,rfId:t}),[e,t]),(r,o)=>!(r.length!==o.length||r.some((i,s)=>i.id!==o[s].id)));return E("defs",{children:n.map(r=>E(Rx,{id:r.id,type:r.type,color:r.color,width:r.width,height:r.height,markerUnits:r.markerUnits,strokeWidth:r.strokeWidth,orient:r.orient},r.id))})};jv.displayName="MarkerDefinitions";var Ox=N.memo(jv);const xx=e=>({nodesConnectable:e.nodesConnectable,edgesFocusable:e.edgesFocusable,edgesUpdatable:e.edgesUpdatable,elementsSelectable:e.elementsSelectable,width:e.width,height:e.height,connectionMode:e.connectionMode,nodeInternals:e.nodeInternals,onError:e.onError}),Gv=({defaultMarkerColor:e,onlyRenderVisibleElements:t,elevateEdgesOnSelect:n,rfId:r,edgeTypes:o,noPanClassName:i,onEdgeUpdate:s,onEdgeContextMenu:a,onEdgeMouseEnter:l,onEdgeMouseMove:u,onEdgeMouseLeave:c,onEdgeClick:d,edgeUpdaterRadius:f,onEdgeDoubleClick:h,onEdgeUpdateStart:m,onEdgeUpdateEnd:v,children:y})=>{const{edgesFocusable:p,edgesUpdatable:g,elementsSelectable:S,width:_,height:w,connectionMode:R,nodeInternals:C,onError:L}=le(xx,ze),B=Ex(t,C,n);return _?k(ve,{children:[B.map(({level:I,edges:V,isMaxLevel:$})=>k("svg",{style:{zIndex:I},width:_,height:w,className:"react-flow__edges react-flow__container",children:[$&&E(Ox,{defaultColor:e,rfId:r}),E("g",{children:V.map(F=>{const[O,M,D]=Nv(C.get(F.source)),[A,T,P]=Nv(C.get(F.target));if(!D||!P)return null;let U=F.type||"default";o[U]||(L==null||L("011",Bn.error011(U)),U="default");const H=o[U]||o.default,j=R===Hn.Strict?T.target:(T.target??[]).concat(T.source??[]),K=Rv(M.source,F.sourceHandle),W=Rv(j,F.targetHandle),Z=(K==null?void 0:K.position)||Y.Bottom,X=(W==null?void 0:W.position)||Y.Top,te=!!(F.focusable||p&&typeof F.focusable>"u"),oe=typeof s<"u"&&(F.updatable||g&&typeof F.updatable>"u");if(!K||!W)return L==null||L("008",Bn.error008(K,F)),null;const{sourceX:ge,sourceY:ue,targetX:Te,targetY:Ye}=HO(O,K,Z,A,W,X);return E(H,{id:F.id,className:Je([F.className,i]),type:U,data:F.data,selected:!!F.selected,animated:!!F.animated,hidden:!!F.hidden,label:F.label,labelStyle:F.labelStyle,labelShowBg:F.labelShowBg,labelBgStyle:F.labelBgStyle,labelBgPadding:F.labelBgPadding,labelBgBorderRadius:F.labelBgBorderRadius,style:F.style,source:F.source,target:F.target,sourceHandleId:F.sourceHandle,targetHandleId:F.targetHandle,markerEnd:F.markerEnd,markerStart:F.markerStart,sourceX:ge,sourceY:ue,targetX:Te,targetY:Ye,sourcePosition:Z,targetPosition:X,elementsSelectable:S,onEdgeUpdate:s,onContextMenu:a,onMouseEnter:l,onMouseMove:u,onMouseLeave:c,onClick:d,edgeUpdaterRadius:f,onEdgeDoubleClick:h,onEdgeUpdateStart:m,onEdgeUpdateEnd:v,rfId:r,ariaLabel:F.ariaLabel,isFocusable:te,isUpdatable:oe,pathOptions:"pathOptions"in F?F.pathOptions:void 0,interactionWidth:F.interactionWidth},F.id)})})]},I)),y]}):null};Gv.displayName="EdgeRenderer";var Tx=N.memo(Gv);const Cx=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function Ix({children:e}){const t=le(Cx);return E("div",{className:"react-flow__viewport react-flow__container",style:{transform:t},children:e})}function bx(e){const t=Sd(),n=N.useRef(!1);N.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const Ax={[Y.Left]:Y.Right,[Y.Right]:Y.Left,[Y.Top]:Y.Bottom,[Y.Bottom]:Y.Top},Yv=({nodeId:e,handleType:t,style:n,type:r=zn.Bezier,CustomComponent:o,connectionStatus:i})=>{var R,C,L;const{fromNode:s,handleId:a,toX:l,toY:u,connectionMode:c}=le(N.useCallback(B=>({fromNode:B.nodeInternals.get(e),handleId:B.connectionHandleId,toX:(B.connectionPosition.x-B.transform[0])/B.transform[2],toY:(B.connectionPosition.y-B.transform[1])/B.transform[2],connectionMode:B.connectionMode}),[e]),ze),d=(R=s==null?void 0:s[we])==null?void 0:R.handleBounds;let f=d==null?void 0:d[t];if(c===Hn.Loose&&(f=f||(d==null?void 0:d[t==="source"?"target":"source"])),!s||!f)return null;const h=a?f.find(B=>B.id===a):f[0],m=h?h.x+h.width/2:(s.width??0)/2,v=h?h.y+h.height/2:s.height??0,y=(((C=s.positionAbsolute)==null?void 0:C.x)??0)+m,p=(((L=s.positionAbsolute)==null?void 0:L.y)??0)+v,g=h==null?void 0:h.position,S=g?Ax[g]:null;if(!g||!S)return null;if(o)return E(o,{connectionLineType:r,connectionLineStyle:n,fromNode:s,fromHandle:h,fromX:y,fromY:p,toX:l,toY:u,fromPosition:g,toPosition:S,connectionStatus:i});let _="";const w={sourceX:y,sourceY:p,sourcePosition:g,targetX:l,targetY:u,targetPosition:S};return r===zn.Bezier?[_]=qm(w):r===zn.Step?[_]=ji({...w,borderRadius:0}):r===zn.SmoothStep?[_]=ji(w):r===zn.SimpleBezier?[_]=Wm(w):_=`M${y},${p} ${l},${u}`,E("path",{d:_,fill:"none",className:"react-flow__connection-path",style:n})};Yv.displayName="ConnectionLine";const Lx=e=>({nodeId:e.connectionNodeId,handleType:e.connectionHandleType,nodesConnectable:e.nodesConnectable,connectionStatus:e.connectionStatus,width:e.width,height:e.height});function Dx({containerStyle:e,style:t,type:n,component:r}){const{nodeId:o,handleType:i,nodesConnectable:s,width:a,height:l,connectionStatus:u}=le(Lx,ze);return!(o&&i&&a&&s)?null:E("svg",{style:e,width:a,height:l,className:"react-flow__edges react-flow__connectionline react-flow__container",children:E("g",{className:Je(["react-flow__connection",u]),children:E(Yv,{nodeId:o,handleType:i,style:t,type:n,CustomComponent:r,connectionStatus:u})})})}const Wv=({nodeTypes:e,edgeTypes:t,onMove:n,onMoveStart:r,onMoveEnd:o,onInit:i,onNodeClick:s,onEdgeClick:a,onNodeDoubleClick:l,onEdgeDoubleClick:u,onNodeMouseEnter:c,onNodeMouseMove:d,onNodeMouseLeave:f,onNodeContextMenu:h,onSelectionContextMenu:m,onSelectionStart:v,onSelectionEnd:y,connectionLineType:p,connectionLineStyle:g,connectionLineComponent:S,connectionLineContainerStyle:_,selectionKeyCode:w,selectionOnDrag:R,selectionMode:C,multiSelectionKeyCode:L,panActivationKeyCode:B,zoomActivationKeyCode:I,deleteKeyCode:V,onlyRenderVisibleElements:$,elementsSelectable:F,selectNodesOnDrag:O,defaultViewport:M,translateExtent:D,minZoom:A,maxZoom:T,preventScrolling:P,defaultMarkerColor:U,zoomOnScroll:H,zoomOnPinch:j,panOnScroll:K,panOnScrollSpeed:W,panOnScrollMode:Z,zoomOnDoubleClick:X,panOnDrag:te,onPaneClick:oe,onPaneMouseEnter:ge,onPaneMouseMove:ue,onPaneMouseLeave:Te,onPaneScroll:Ye,onPaneContextMenu:ft,onEdgeUpdate:me,onEdgeContextMenu:de,onEdgeMouseEnter:tt,onEdgeMouseMove:Q,onEdgeMouseLeave:Zn,edgeUpdaterRadius:Tr,onEdgeUpdateStart:us,onEdgeUpdateEnd:cs,noDragClassName:ko,noWheelClassName:Cr,noPanClassName:Jn,elevateEdgesOnSelect:Po,disableKeyboardA11y:er,nodeOrigin:Ir,nodeExtent:ds,rfId:Mo})=>(bx(i),E(px,{onPaneClick:oe,onPaneMouseEnter:ge,onPaneMouseMove:ue,onPaneMouseLeave:Te,onPaneContextMenu:ft,onPaneScroll:Ye,deleteKeyCode:V,selectionKeyCode:w,selectionOnDrag:R,selectionMode:C,onSelectionStart:v,onSelectionEnd:y,multiSelectionKeyCode:L,panActivationKeyCode:B,zoomActivationKeyCode:I,elementsSelectable:F,onMove:n,onMoveStart:r,onMoveEnd:o,zoomOnScroll:H,zoomOnPinch:j,zoomOnDoubleClick:X,panOnScroll:K,panOnScrollSpeed:W,panOnScrollMode:Z,panOnDrag:te,defaultViewport:M,translateExtent:D,minZoom:A,maxZoom:T,onSelectionContextMenu:m,preventScrolling:P,noDragClassName:ko,noWheelClassName:Cr,noPanClassName:Jn,disableKeyboardA11y:er,children:k(Ix,{children:[E(Tx,{edgeTypes:t,onEdgeClick:a,onEdgeDoubleClick:u,onEdgeUpdate:me,onlyRenderVisibleElements:$,onEdgeContextMenu:de,onEdgeMouseEnter:tt,onEdgeMouseMove:Q,onEdgeMouseLeave:Zn,onEdgeUpdateStart:us,onEdgeUpdateEnd:cs,edgeUpdaterRadius:Tr,defaultMarkerColor:U,noPanClassName:Jn,elevateEdgesOnSelect:!!Po,disableKeyboardA11y:er,rfId:Mo,children:E(Dx,{style:g,type:p,component:S,containerStyle:_})}),E("div",{className:"react-flow__edgelabel-renderer"}),E(mx,{nodeTypes:e,onNodeClick:s,onNodeDoubleClick:l,onNodeMouseEnter:c,onNodeMouseMove:d,onNodeMouseLeave:f,onNodeContextMenu:h,selectNodesOnDrag:O,onlyRenderVisibleElements:$,noPanClassName:Jn,noDragClassName:ko,disableKeyboardA11y:er,nodeOrigin:Ir,nodeExtent:ds,rfId:Mo})]})}));Wv.displayName="GraphView";var kx=N.memo(Wv);const Nd=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Gn={rfId:"1",width:0,height:0,transform:[0,0,1],nodeInternals:new Map,edges:[],onNodesChange:null,onEdgesChange:null,hasDefaultNodes:!1,hasDefaultEdges:!1,d3Zoom:null,d3Selection:null,d3ZoomHandler:void 0,minZoom:.5,maxZoom:2,translateExtent:Nd,nodeExtent:Nd,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionNodeId:null,connectionHandleId:null,connectionHandleType:"source",connectionPosition:{x:0,y:0},connectionStatus:null,connectionMode:Hn.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:[0,0],snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesUpdatable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,fitViewOnInit:!1,fitViewOnInitDone:!1,fitViewOnInitOptions:void 0,multiSelectionActive:!1,connectionStartHandle:null,connectionEndHandle:null,connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,connectionRadius:20,onError:uO,isValidConnection:void 0},Px=()=>Bg((e,t)=>({...Gn,setNodes:n=>{const{nodeInternals:r,nodeOrigin:o,elevateNodesOnSelect:i}=t();e({nodeInternals:Ed(n,r,o,i)})},getNodes:()=>Array.from(t().nodeInternals.values()),setEdges:n=>{const{defaultEdgeOptions:r={}}=t();e({edges:n.map(o=>({...r,...o}))})},setDefaultNodesAndEdges:(n,r)=>{const o=typeof n<"u",i=typeof r<"u",s=o?Ed(n,new Map,t().nodeOrigin,t().elevateNodesOnSelect):new Map;e({nodeInternals:s,edges:i?r:[],hasDefaultNodes:o,hasDefaultEdges:i})},updateNodeDimensions:n=>{const{onNodesChange:r,nodeInternals:o,fitViewOnInit:i,fitViewOnInitDone:s,fitViewOnInitOptions:a,domNode:l,nodeOrigin:u}=t(),c=l==null?void 0:l.querySelector(".react-flow__viewport");if(!c)return;const d=window.getComputedStyle(c),{m22:f}=new window.DOMMatrixReadOnly(d.transform),h=n.reduce((v,y)=>{const p=o.get(y.id);if(p){const g=od(y.nodeElement);!!(g.width&&g.height&&(p.width!==g.width||p.height!==g.height||y.forceUpdate))&&(o.set(p.id,{...p,[we]:{...p[we],handleBounds:{source:Cv(".source",y.nodeElement,f,u),target:Cv(".target",y.nodeElement,f,u)}},...g}),v.push({id:p.id,type:"dimensions",dimensions:g}))}return v},[]);kv(o,u);const m=s||i&&!s&&Pv(t,{initial:!0,...a});e({nodeInternals:new Map(o),fitViewOnInitDone:m}),(h==null?void 0:h.length)>0&&(r==null||r(h))},updateNodePositions:(n,r=!0,o=!1)=>{const{triggerNodeChanges:i}=t(),s=n.map(a=>{const l={id:a.id,type:"position",dragging:o};return r&&(l.positionAbsolute=a.positionAbsolute,l.position=a.position),l});i(s)},triggerNodeChanges:n=>{const{onNodesChange:r,nodeInternals:o,hasDefaultNodes:i,nodeOrigin:s,getNodes:a,elevateNodesOnSelect:l}=t();if(n!=null&&n.length){if(i){const u=Vv(n,a()),c=Ed(u,o,s,l);e({nodeInternals:c})}r==null||r(n)}},addSelectedNodes:n=>{const{multiSelectionActive:r,edges:o,getNodes:i}=t();let s,a=null;r?s=n.map(l=>jn(l,!0)):(s=Io(i(),n),a=Io(o,[])),el({changedNodes:s,changedEdges:a,get:t,set:e})},addSelectedEdges:n=>{const{multiSelectionActive:r,edges:o,getNodes:i}=t();let s,a=null;r?s=n.map(l=>jn(l,!0)):(s=Io(o,n),a=Io(i(),[])),el({changedNodes:a,changedEdges:s,get:t,set:e})},unselectNodesAndEdges:({nodes:n,edges:r}={})=>{const{edges:o,getNodes:i}=t(),s=n||i(),a=r||o,l=s.map(c=>(c.selected=!1,jn(c.id,!1))),u=a.map(c=>jn(c.id,!1));el({changedNodes:l,changedEdges:u,get:t,set:e})},setMinZoom:n=>{const{d3Zoom:r,maxZoom:o}=t();r==null||r.scaleExtent([n,o]),e({minZoom:n})},setMaxZoom:n=>{const{d3Zoom:r,minZoom:o}=t();r==null||r.scaleExtent([o,n]),e({maxZoom:n})},setTranslateExtent:n=>{var r;(r=t().d3Zoom)==null||r.translateExtent(n),e({translateExtent:n})},resetSelectedElements:()=>{const{edges:n,getNodes:r}=t(),i=r().filter(a=>a.selected).map(a=>jn(a.id,!1)),s=n.filter(a=>a.selected).map(a=>jn(a.id,!1));el({changedNodes:i,changedEdges:s,get:t,set:e})},setNodeExtent:n=>{const{nodeInternals:r}=t();r.forEach(o=>{o.positionAbsolute=id(o.position,n)}),e({nodeExtent:n,nodeInternals:new Map(r)})},panBy:n=>{const{transform:r,width:o,height:i,d3Zoom:s,d3Selection:a,translateExtent:l}=t();if(!s||!a||!n.x&&!n.y)return;const u=Vn.translate(r[0]+n.x,r[1]+n.y).scale(r[2]),c=[[0,0],[o,i]],d=s==null?void 0:s.constrain()(u,c,l);s.transform(a,d)},cancelConnection:()=>e({connectionNodeId:Gn.connectionNodeId,connectionHandleId:Gn.connectionHandleId,connectionHandleType:Gn.connectionHandleType,connectionStatus:Gn.connectionStatus,connectionStartHandle:Gn.connectionStartHandle,connectionEndHandle:Gn.connectionEndHandle}),reset:()=>e({...Gn})})),Kv=({children:e})=>{const t=N.useRef(null);return t.current||(t.current=Px()),E(tO,{value:t.current,children:e})};Kv.displayName="ReactFlowProvider";const Qv=({children:e})=>N.useContext(Qa)?E(ve,{children:e}):E(Kv,{children:e});Qv.displayName="ReactFlowWrapper";function Xv(e,t){return N.useRef(null),N.useMemo(()=>t(e),[e])}const Mx={input:pv,default:hd,output:gv,group:gd},Ux={default:Za,straight:cd,step:ud,smoothstep:Xa,simplebezier:ld},Fx=[0,0],Vx=[15,15],Bx={x:0,y:0,zoom:1},$x={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0},qv=N.forwardRef(({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:o,nodeTypes:i=Mx,edgeTypes:s=Ux,onNodeClick:a,onEdgeClick:l,onInit:u,onMove:c,onMoveStart:d,onMoveEnd:f,onConnect:h,onConnectStart:m,onConnectEnd:v,onClickConnectStart:y,onClickConnectEnd:p,onNodeMouseEnter:g,onNodeMouseMove:S,onNodeMouseLeave:_,onNodeContextMenu:w,onNodeDoubleClick:R,onNodeDragStart:C,onNodeDrag:L,onNodeDragStop:B,onNodesDelete:I,onEdgesDelete:V,onSelectionChange:$,onSelectionDragStart:F,onSelectionDrag:O,onSelectionDragStop:M,onSelectionContextMenu:D,onSelectionStart:A,onSelectionEnd:T,connectionMode:P=Hn.Strict,connectionLineType:U=zn.Bezier,connectionLineStyle:H,connectionLineComponent:j,connectionLineContainerStyle:K,deleteKeyCode:W="Backspace",selectionKeyCode:Z="Shift",selectionOnDrag:X=!1,selectionMode:te=Hi.Full,panActivationKeyCode:oe="Space",multiSelectionKeyCode:ge="Meta",zoomActivationKeyCode:ue="Meta",snapToGrid:Te=!1,snapGrid:Ye=Vx,onlyRenderVisibleElements:ft=!1,selectNodesOnDrag:me=!0,nodesDraggable:de,nodesConnectable:tt,nodesFocusable:Q,nodeOrigin:Zn=Fx,edgesFocusable:Tr,edgesUpdatable:us,elementsSelectable:cs,defaultViewport:ko=Bx,minZoom:Cr=.5,maxZoom:Jn=2,translateExtent:Po=Nd,preventScrolling:er=!0,nodeExtent:Ir,defaultMarkerColor:ds="#b1b1b7",zoomOnScroll:Mo=!0,zoomOnPinch:nt=!0,panOnScroll:Ft=!1,panOnScrollSpeed:br=.5,panOnScrollMode:Ar=_o.Free,zoomOnDoubleClick:Lr=!0,panOnDrag:El=!0,onPaneClick:Dr,onPaneMouseEnter:df,onPaneMouseMove:ff,onPaneMouseLeave:fs,onPaneScroll:pf,onPaneContextMenu:q0,children:kr,onEdgeUpdate:ZA,onEdgeContextMenu:JA,onEdgeDoubleClick:eL,onEdgeMouseEnter:tL,onEdgeMouseMove:nL,onEdgeMouseLeave:rL,onEdgeUpdateStart:oL,onEdgeUpdateEnd:iL,edgeUpdaterRadius:sL=10,onNodesChange:aL,onEdgesChange:lL,noDragClassName:uL="nodrag",noWheelClassName:cL="nowheel",noPanClassName:Z0="nopan",fitView:dL=!1,fitViewOptions:fL,connectOnClick:pL=!0,attributionPosition:hL,proOptions:gL,defaultEdgeOptions:mL,elevateNodesOnSelect:vL=!0,elevateEdgesOnSelect:yL=!1,disableKeyboardA11y:J0=!1,autoPanOnConnect:EL=!0,autoPanOnNodeDrag:SL=!0,connectionRadius:_L=20,isValidConnection:wL,onError:RL,style:NL,id:eE,...OL},xL)=>{const TL=Xv(i,YO),CL=Xv(s,$O),hf=eE||"1";return E("div",{...OL,style:{...NL,...$x},ref:xL,className:Je(["react-flow",o]),"data-testid":"rf__wrapper",id:eE,children:k(Qv,{children:[E(kx,{onInit:u,onMove:c,onMoveStart:d,onMoveEnd:f,onNodeClick:a,onEdgeClick:l,onNodeMouseEnter:g,onNodeMouseMove:S,onNodeMouseLeave:_,onNodeContextMenu:w,onNodeDoubleClick:R,nodeTypes:TL,edgeTypes:CL,connectionLineType:U,connectionLineStyle:H,connectionLineComponent:j,connectionLineContainerStyle:K,selectionKeyCode:Z,selectionOnDrag:X,selectionMode:te,deleteKeyCode:W,multiSelectionKeyCode:ge,panActivationKeyCode:oe,zoomActivationKeyCode:ue,onlyRenderVisibleElements:ft,selectNodesOnDrag:me,defaultViewport:ko,translateExtent:Po,minZoom:Cr,maxZoom:Jn,preventScrolling:er,zoomOnScroll:Mo,zoomOnPinch:nt,zoomOnDoubleClick:Lr,panOnScroll:Ft,panOnScrollSpeed:br,panOnScrollMode:Ar,panOnDrag:El,onPaneClick:Dr,onPaneMouseEnter:df,onPaneMouseMove:ff,onPaneMouseLeave:fs,onPaneScroll:pf,onPaneContextMenu:q0,onSelectionContextMenu:D,onSelectionStart:A,onSelectionEnd:T,onEdgeUpdate:ZA,onEdgeContextMenu:JA,onEdgeDoubleClick:eL,onEdgeMouseEnter:tL,onEdgeMouseMove:nL,onEdgeMouseLeave:rL,onEdgeUpdateStart:oL,onEdgeUpdateEnd:iL,edgeUpdaterRadius:sL,defaultMarkerColor:ds,noDragClassName:uL,noWheelClassName:cL,noPanClassName:Z0,elevateEdgesOnSelect:yL,rfId:hf,disableKeyboardA11y:J0,nodeOrigin:Zn,nodeExtent:Ir}),E(LO,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:h,onConnectStart:m,onConnectEnd:v,onClickConnectStart:y,onClickConnectEnd:p,nodesDraggable:de,nodesConnectable:tt,nodesFocusable:Q,edgesFocusable:Tr,edgesUpdatable:us,elementsSelectable:cs,elevateNodesOnSelect:vL,minZoom:Cr,maxZoom:Jn,nodeExtent:Ir,onNodesChange:aL,onEdgesChange:lL,snapToGrid:Te,snapGrid:Ye,connectionMode:P,translateExtent:Po,connectOnClick:pL,defaultEdgeOptions:mL,fitView:dL,fitViewOptions:fL,onNodesDelete:I,onEdgesDelete:V,onNodeDragStart:C,onNodeDrag:L,onNodeDragStop:B,onSelectionDrag:O,onSelectionDragStart:F,onSelectionDragStop:M,noPanClassName:Z0,nodeOrigin:Zn,rfId:hf,autoPanOnConnect:EL,autoPanOnNodeDrag:SL,onError:RL,connectionRadius:_L,isValidConnection:wL}),E(bO,{onSelectionChange:$}),kr,E(rO,{proOptions:gL,position:hL}),E(UO,{rfId:hf,disableKeyboardA11y:J0})]})})});qv.displayName="ReactFlow";function Hx(){const e=xe();return N.useCallback(t=>{const{domNode:n,updateNodeDimensions:r}=e.getState(),o=n==null?void 0:n.querySelector(`.react-flow__node[data-id="${t}"]`);o&&requestAnimationFrame(()=>r([{id:t,nodeElement:o,forceUpdate:!0}]))},[])}const zx=e=>t=>t.nodeInternals.size===0?!1:t.getNodes().filter(n=>e.includeHiddenNodes?!0:!n.hidden).every(n=>{var r;return((r=n[we])==null?void 0:r.handleBounds)!==void 0}),jx={includeHiddenNodes:!1};function Gx(e=jx){return le(zx(e))}function Yx(){return E("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:E("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function Wx(){return E("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:E("path",{d:"M0 0h32v4.2H0z"})})}function Kx(){return E("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:E("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function Qx(){return E("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:E("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function Xx(){return E("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:E("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}const bo=({children:e,className:t,...n})=>E("button",{type:"button",className:Je(["react-flow__controls-button",t]),...n,children:e});bo.displayName="ControlButton";const qx=e=>e.nodesDraggable&&e.nodesConnectable&&e.elementsSelectable,Zv=({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:o,onZoomIn:i,onZoomOut:s,onFitView:a,onInteractiveChange:l,className:u,children:c,position:d="bottom-left"})=>{const f=xe(),[h,m]=N.useState(!1),v=le(qx),{zoomIn:y,zoomOut:p,fitView:g}=Sd();if(N.useEffect(()=>{m(!0)},[]),!h)return null;const S=()=>{y(),i==null||i()},_=()=>{p(),s==null||s()},w=()=>{g(o),a==null||a()},R=()=>{f.setState({nodesDraggable:!v,nodesConnectable:!v,elementsSelectable:!v}),l==null||l(!v)};return k(rd,{className:Je(["react-flow__controls",u]),position:d,style:e,"data-testid":"rf__controls",children:[t&&k(ve,{children:[E(bo,{onClick:S,className:"react-flow__controls-zoomin",title:"zoom in","aria-label":"zoom in",children:E(Yx,{})}),E(bo,{onClick:_,className:"react-flow__controls-zoomout",title:"zoom out","aria-label":"zoom out",children:E(Wx,{})})]}),n&&E(bo,{className:"react-flow__controls-fitview",onClick:w,title:"fit view","aria-label":"fit view",children:E(Kx,{})}),r&&E(bo,{className:"react-flow__controls-interactive",onClick:R,title:"toggle interactivity","aria-label":"toggle interactivity",children:v?E(Xx,{}):E(Qx,{})}),c]})};Zv.displayName="Controls";var Zx=N.memo(Zv);const Jx=!1,Jv="0.0.1",ey="0.0.0",ty="sw/nodeType",ny=640,ry={type:"floating",markerEnd:{type:zi.Arrow,width:20,height:20,color:"#c2c8d1"},style:{stroke:"#c2c8d1",strokeWidth:1.5}},eT="422",tT="404";let nT=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce((t,n)=>(n&=63,n<36?t+=n.toString(36):n<62?t+=(n-26).toString(36).toUpperCase():n>62?t+="-":t+="_",t),"");const Re=()=>nT(),rT=()=>{const e={},t=document.querySelector('meta[name="csrf-token"]');return t&&(e["X-CSRF-Token"]=t==null?void 0:t.content),e},oT=(e,t)=>{var i;const n=new Blob([JSON.stringify({nodes:e,edges:t},null,2)],{type:"application/json"}),r=window.URL.createObjectURL(n),o=window.open();(i=o==null?void 0:o.location)!=null&&i.href&&(o.location.href=r)},iT=e=>e.map(t=>typeof t=="string"?t.trim():t).filter(Boolean).join(),Od=e=>e.split(",").map(t=>t.trim()).filter(Boolean),sT=e=>({...e,...ry}),aT=e=>e.type==="handleCall"?{...e,deletable:!1}:e,oy=e=>e==="success"?"positive":"negative",lT=e=>e.toLowerCase().replace(/ /g,"-"),xd=()=>[{result:"success",id:Re()},{result:"noAnswer",id:Re()},{result:"busy",id:Re()},{result:"decline",id:Re()},{result:"error",id:Re()}],iy={answer:()=>({}),forwardAddress:()=>({destinations:[],destinationType:"address",options:xd(),sessionTimeout:void 0,type:"single"}),forwardPhone:()=>({destinations:[],destinationType:"phone",options:xd(),sessionTimeout:void 0,type:"single"}),forwardResource:()=>({destinations:[],destinationType:"resource",options:xd(),sessionTimeout:void 0,type:"single"}),hangup:()=>({}),play:()=>({selected:"",text:"",url:""}),promptPlay:()=>({initialTimeout:5,options:[],results:[{id:Re(),result:"no_match"},{id:Re(),result:"no_input"}],selected:"",text:"",url:""}),record:()=>({beep:!1,format:"wav",stereo:!1,terminators:""}),recordCallStart:()=>({beep:!1,controlId:Re(),format:"wav",label:"",stereo:!1,terminators:""}),recordCallStop:()=>({controlId:""}),sendSms:()=>({body:"",fromNumber:"",media:[],region:"",tags:[],toNumber:""}),set:()=>({variables:[]}),unset:()=>({variables:[]}),request:()=>({url:"",method:"POST",headers:{},body:"",options:[{id:Re(),result:"success"},{id:Re(),result:"failed"}]}),cond:()=>({options:[],fallback:Re()}),condRequest:()=>({body:"",error:Re(),fallback:Re(),headers:{},method:"POST",options:[],url:""})};function kt(e){return kt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},kt(e)}function _t(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function uT(e,t){if(kt(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(kt(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function sy(e){var t=uT(e,"string");return kt(t)==="symbol"?t:String(t)}function ay(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,sy(r.key),r)}}function wt(e,t,n){return t&&ay(e.prototype,t),n&&ay(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Yn(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Td(e,t){return Td=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},Td(e,t)}function tl(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Td(e,t)}function Ki(e,t){if(t&&(kt(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Yn(e)}function Wt(e){return Wt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Wt(e)}function hn(e,t,n){return t=sy(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function cT(e){if(Array.isArray(e))return e}function dT(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function ly(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function fT(e,t){if(e){if(typeof e=="string")return ly(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ly(e,t)}}function pT(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
61
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function hT(e){return cT(e)||dT(e)||fT(e)||pT()}function uy(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function cy(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?uy(Object(n),!0).forEach(function(r){hn(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):uy(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var gT={type:"logger",log:function(t){this.output("log",t)},warn:function(t){this.output("warn",t)},error:function(t){this.output("error",t)},output:function(t,n){console&&console[t]&&console[t].apply(console,n)}},mT=function(){function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};_t(this,e),this.init(t,n)}return wt(e,[{key:"init",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=r.prefix||"i18next:",this.logger=n||gT,this.options=r,this.debug=r.debug}},{key:"setDebug",value:function(n){this.debug=n}},{key:"log",value:function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return this.forward(r,"log","",!0)}},{key:"warn",value:function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return this.forward(r,"warn","",!0)}},{key:"error",value:function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return this.forward(r,"error","")}},{key:"deprecate",value:function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return this.forward(r,"warn","WARNING DEPRECATED: ",!0)}},{key:"forward",value:function(n,r,o,i){return i&&!this.debug?null:(typeof n[0]=="string"&&(n[0]="".concat(o).concat(this.prefix," ").concat(n[0])),this.logger[r](n))}},{key:"create",value:function(n){return new e(this.logger,cy(cy({},{prefix:"".concat(this.prefix,":").concat(n,":")}),this.options))}},{key:"clone",value:function(n){return n=n||this.options,n.prefix=n.prefix||this.prefix,new e(this.logger,n)}}]),e}(),Kt=new mT,Wn=function(){function e(){_t(this,e),this.observers={}}return wt(e,[{key:"on",value:function(n,r){var o=this;return n.split(" ").forEach(function(i){o.observers[i]=o.observers[i]||[],o.observers[i].push(r)}),this}},{key:"off",value:function(n,r){if(this.observers[n]){if(!r){delete this.observers[n];return}this.observers[n]=this.observers[n].filter(function(o){return o!==r})}}},{key:"emit",value: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];if(this.observers[n]){var s=[].concat(this.observers[n]);s.forEach(function(l){l.apply(void 0,o)})}if(this.observers["*"]){var a=[].concat(this.observers["*"]);a.forEach(function(l){l.apply(l,[n].concat(o))})}}}]),e}();function Qi(){var e,t,n=new Promise(function(r,o){e=r,t=o});return n.resolve=e,n.reject=t,n}function dy(e){return e==null?"":""+e}function vT(e,t,n){e.forEach(function(r){t[r]&&(n[r]=t[r])})}function Cd(e,t,n){function r(a){return a&&a.indexOf("###")>-1?a.replace(/###/g,"."):a}function o(){return!e||typeof e=="string"}for(var i=typeof t!="string"?[].concat(t):t.split(".");i.length>1;){if(o())return{};var s=r(i.shift());!e[s]&&n&&(e[s]=new n),Object.prototype.hasOwnProperty.call(e,s)?e=e[s]:e={}}return o()?{}:{obj:e,k:r(i.shift())}}function fy(e,t,n){var r=Cd(e,t,Object),o=r.obj,i=r.k;o[i]=n}function yT(e,t,n,r){var o=Cd(e,t,Object),i=o.obj,s=o.k;i[s]=i[s]||[],r&&(i[s]=i[s].concat(n)),r||i[s].push(n)}function nl(e,t){var n=Cd(e,t),r=n.obj,o=n.k;if(r)return r[o]}function py(e,t,n){var r=nl(e,n);return r!==void 0?r:nl(t,n)}function hy(e,t,n){for(var r in t)r!=="__proto__"&&r!=="constructor"&&(r in e?typeof e[r]=="string"||e[r]instanceof String||typeof t[r]=="string"||t[r]instanceof String?n&&(e[r]=t[r]):hy(e[r],t[r],n):e[r]=t[r]);return e}function Ao(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var ET={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};function ST(e){return typeof e=="string"?e.replace(/[&<>"'\/]/g,function(t){return ET[t]}):e}var rl=typeof window<"u"&&window.navigator&&typeof window.navigator.userAgentData>"u"&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,_T=[" ",",","?","!",";"];function wT(e,t,n){t=t||"",n=n||"";var r=_T.filter(function(a){return t.indexOf(a)<0&&n.indexOf(a)<0});if(r.length===0)return!0;var o=new RegExp("(".concat(r.map(function(a){return a==="?"?"\\?":a}).join("|"),")")),i=!o.test(e);if(!i){var s=e.indexOf(n);s>0&&!o.test(e.substring(0,s))&&(i=!0)}return i}function gy(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function ol(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?gy(Object(n),!0).forEach(function(r){hn(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gy(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function RT(e){var t=NT();return function(){var r=Wt(e),o;if(t){var i=Wt(this).constructor;o=Reflect.construct(r,arguments,i)}else o=r.apply(this,arguments);return Ki(this,o)}}function NT(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function my(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(e){if(e[t])return e[t];for(var r=t.split(n),o=e,i=0;i<r.length;++i){if(!o||typeof o[r[i]]=="string"&&i+1<r.length)return;if(o[r[i]]===void 0){for(var s=2,a=r.slice(i,i+s).join(n),l=o[a];l===void 0&&r.length>i+s;)s++,a=r.slice(i,i+s).join(n),l=o[a];if(l===void 0)return;if(l===null)return null;if(t.endsWith(a)){if(typeof l=="string")return l;if(a&&typeof l[a]=="string")return l[a]}var u=r.slice(i+s).join(n);return u?my(l,u,n):void 0}o=o[r[i]]}return o}}var OT=function(e){tl(n,e);var t=RT(n);function n(r){var o,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};return _t(this,n),o=t.call(this),rl&&Wn.call(Yn(o)),o.data=r||{},o.options=i,o.options.keySeparator===void 0&&(o.options.keySeparator="."),o.options.ignoreJSONStructure===void 0&&(o.options.ignoreJSONStructure=!0),o}return wt(n,[{key:"addNamespaces",value:function(o){this.options.ns.indexOf(o)<0&&this.options.ns.push(o)}},{key:"removeNamespaces",value:function(o){var i=this.options.ns.indexOf(o);i>-1&&this.options.ns.splice(i,1)}},{key:"getResource",value:function(o,i,s){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},l=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator,u=a.ignoreJSONStructure!==void 0?a.ignoreJSONStructure:this.options.ignoreJSONStructure,c=[o,i];s&&typeof s!="string"&&(c=c.concat(s)),s&&typeof s=="string"&&(c=c.concat(l?s.split(l):s)),o.indexOf(".")>-1&&(c=o.split("."));var d=nl(this.data,c);return d||!u||typeof s!="string"?d:my(this.data&&this.data[o]&&this.data[o][i],s,l)}},{key:"addResource",value:function(o,i,s,a){var l=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1},u=this.options.keySeparator;u===void 0&&(u=".");var c=[o,i];s&&(c=c.concat(u?s.split(u):s)),o.indexOf(".")>-1&&(c=o.split("."),a=i,i=c[1]),this.addNamespaces(i),fy(this.data,c,a),l.silent||this.emit("added",o,i,s,a)}},{key:"addResources",value:function(o,i,s){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(var l in s)(typeof s[l]=="string"||Object.prototype.toString.apply(s[l])==="[object Array]")&&this.addResource(o,i,l,s[l],{silent:!0});a.silent||this.emit("added",o,i,s)}},{key:"addResourceBundle",value:function(o,i,s,a,l){var u=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1},c=[o,i];o.indexOf(".")>-1&&(c=o.split("."),a=s,s=i,i=c[1]),this.addNamespaces(i);var d=nl(this.data,c)||{};a?hy(d,s,l):d=ol(ol({},d),s),fy(this.data,c,d),u.silent||this.emit("added",o,i,s)}},{key:"removeResourceBundle",value:function(o,i){this.hasResourceBundle(o,i)&&delete this.data[o][i],this.removeNamespaces(i),this.emit("removed",o,i)}},{key:"hasResourceBundle",value:function(o,i){return this.getResource(o,i)!==void 0}},{key:"getResourceBundle",value:function(o,i){return i||(i=this.options.defaultNS),this.options.compatibilityAPI==="v1"?ol(ol({},{}),this.getResource(o,i)):this.getResource(o,i)}},{key:"getDataByLanguage",value:function(o){return this.data[o]}},{key:"hasLanguageSomeTranslations",value:function(o){var i=this.getDataByLanguage(o),s=i&&Object.keys(i)||[];return!!s.find(function(a){return i[a]&&Object.keys(i[a]).length>0})}},{key:"toJSON",value:function(){return this.data}}]),n}(Wn),vy={processors:{},addPostProcessor:function(t){this.processors[t.name]=t},handle:function(t,n,r,o,i){var s=this;return t.forEach(function(a){s.processors[a]&&(n=s.processors[a].process(n,r,o,i))}),n}};function yy(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function je(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?yy(Object(n),!0).forEach(function(r){hn(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yy(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function xT(e){var t=TT();return function(){var r=Wt(e),o;if(t){var i=Wt(this).constructor;o=Reflect.construct(r,arguments,i)}else o=r.apply(this,arguments);return Ki(this,o)}}function TT(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var Ey={},Sy=function(e){tl(n,e);var t=xT(n);function n(r){var o,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return _t(this,n),o=t.call(this),rl&&Wn.call(Yn(o)),vT(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],r,Yn(o)),o.options=i,o.options.keySeparator===void 0&&(o.options.keySeparator="."),o.logger=Kt.create("translator"),o}return wt(n,[{key:"changeLanguage",value:function(o){o&&(this.language=o)}},{key:"exists",value:function(o){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(o==null)return!1;var s=this.resolve(o,i);return s&&s.res!==void 0}},{key:"extractFromKey",value:function(o,i){var s=i.nsSeparator!==void 0?i.nsSeparator:this.options.nsSeparator;s===void 0&&(s=":");var a=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,l=i.ns||this.options.defaultNS||[],u=s&&o.indexOf(s)>-1,c=!this.options.userDefinedKeySeparator&&!i.keySeparator&&!this.options.userDefinedNsSeparator&&!i.nsSeparator&&!wT(o,s,a);if(u&&!c){var d=o.match(this.interpolator.nestingRegexp);if(d&&d.length>0)return{key:o,namespaces:l};var f=o.split(s);(s!==a||s===a&&this.options.ns.indexOf(f[0])>-1)&&(l=f.shift()),o=f.join(a)}return typeof l=="string"&&(l=[l]),{key:o,namespaces:l}}},{key:"translate",value:function(o,i,s){var a=this;if(kt(i)!=="object"&&this.options.overloadTranslationOptionHandler&&(i=this.options.overloadTranslationOptionHandler(arguments)),i||(i={}),o==null)return"";Array.isArray(o)||(o=[String(o)]);var l=i.returnDetails!==void 0?i.returnDetails:this.options.returnDetails,u=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,c=this.extractFromKey(o[o.length-1],i),d=c.key,f=c.namespaces,h=f[f.length-1],m=i.lng||this.language,v=i.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(m&&m.toLowerCase()==="cimode"){if(v){var y=i.nsSeparator||this.options.nsSeparator;return l?{res:"".concat(h).concat(y).concat(d),usedKey:d,exactUsedKey:d,usedLng:m,usedNS:h}:"".concat(h).concat(y).concat(d)}return l?{res:d,usedKey:d,exactUsedKey:d,usedLng:m,usedNS:h}:d}var p=this.resolve(o,i),g=p&&p.res,S=p&&p.usedKey||d,_=p&&p.exactUsedKey||d,w=Object.prototype.toString.apply(g),R=["[object Number]","[object Function]","[object RegExp]"],C=i.joinArrays!==void 0?i.joinArrays:this.options.joinArrays,L=!this.i18nFormat||this.i18nFormat.handleAsObject,B=typeof g!="string"&&typeof g!="boolean"&&typeof g!="number";if(L&&g&&B&&R.indexOf(w)<0&&!(typeof C=="string"&&w==="[object Array]")){if(!i.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");var I=this.options.returnedObjectHandler?this.options.returnedObjectHandler(S,g,je(je({},i),{},{ns:f})):"key '".concat(d," (").concat(this.language,")' returned an object instead of string.");return l?(p.res=I,p):I}if(u){var V=w==="[object Array]",$=V?[]:{},F=V?_:S;for(var O in g)if(Object.prototype.hasOwnProperty.call(g,O)){var M="".concat(F).concat(u).concat(O);$[O]=this.translate(M,je(je({},i),{joinArrays:!1,ns:f})),$[O]===M&&($[O]=g[O])}g=$}}else if(L&&typeof C=="string"&&w==="[object Array]")g=g.join(C),g&&(g=this.extendTranslation(g,o,i,s));else{var D=!1,A=!1,T=i.count!==void 0&&typeof i.count!="string",P=n.hasDefaultValue(i),U=T?this.pluralResolver.getSuffix(m,i.count,i):"",H=i["defaultValue".concat(U)]||i.defaultValue;!this.isValidLookup(g)&&P&&(D=!0,g=H),this.isValidLookup(g)||(A=!0,g=d);var j=i.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey,K=j&&A?void 0:g,W=P&&H!==g&&this.options.updateMissing;if(A||D||W){if(this.logger.log(W?"updateKey":"missingKey",m,h,d,W?H:g),u){var Z=this.resolve(d,je(je({},i),{},{keySeparator:!1}));Z&&Z.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var X=[],te=this.languageUtils.getFallbackCodes(this.options.fallbackLng,i.lng||this.language);if(this.options.saveMissingTo==="fallback"&&te&&te[0])for(var oe=0;oe<te.length;oe++)X.push(te[oe]);else this.options.saveMissingTo==="all"?X=this.languageUtils.toResolveHierarchy(i.lng||this.language):X.push(i.lng||this.language);var ge=function(Te,Ye,ft){var me=P&&ft!==g?ft:K;a.options.missingKeyHandler?a.options.missingKeyHandler(Te,h,Ye,me,W,i):a.backendConnector&&a.backendConnector.saveMissing&&a.backendConnector.saveMissing(Te,h,Ye,me,W,i),a.emit("missingKey",Te,h,Ye,g)};this.options.saveMissing&&(this.options.saveMissingPlurals&&T?X.forEach(function(ue){a.pluralResolver.getSuffixes(ue,i).forEach(function(Te){ge([ue],d+Te,i["defaultValue".concat(Te)]||H)})}):ge(X,d,H))}g=this.extendTranslation(g,o,i,p,s),A&&g===d&&this.options.appendNamespaceToMissingKey&&(g="".concat(h,":").concat(d)),(A||D)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?g=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?"".concat(h,":").concat(d):d,D?g:void 0):g=this.options.parseMissingKeyHandler(g))}return l?(p.res=g,p):g}},{key:"extendTranslation",value:function(o,i,s,a,l){var u=this;if(this.i18nFormat&&this.i18nFormat.parse)o=this.i18nFormat.parse(o,je(je({},this.options.interpolation.defaultVariables),s),a.usedLng,a.usedNS,a.usedKey,{resolved:a});else if(!s.skipInterpolation){s.interpolation&&this.interpolator.init(je(je({},s),{interpolation:je(je({},this.options.interpolation),s.interpolation)}));var c=typeof o=="string"&&(s&&s.interpolation&&s.interpolation.skipOnVariables!==void 0?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables),d;if(c){var f=o.match(this.interpolator.nestingRegexp);d=f&&f.length}var h=s.replace&&typeof s.replace!="string"?s.replace:s;if(this.options.interpolation.defaultVariables&&(h=je(je({},this.options.interpolation.defaultVariables),h)),o=this.interpolator.interpolate(o,h,s.lng||this.language,s),c){var m=o.match(this.interpolator.nestingRegexp),v=m&&m.length;d<v&&(s.nest=!1)}s.nest!==!1&&(o=this.interpolator.nest(o,function(){for(var g=arguments.length,S=new Array(g),_=0;_<g;_++)S[_]=arguments[_];return l&&l[0]===S[0]&&!s.context?(u.logger.warn("It seems you are nesting recursively key: ".concat(S[0]," in key: ").concat(i[0])),null):u.translate.apply(u,S.concat([i]))},s)),s.interpolation&&this.interpolator.reset()}var y=s.postProcess||this.options.postProcess,p=typeof y=="string"?[y]:y;return o!=null&&p&&p.length&&s.applyPostProcessor!==!1&&(o=vy.handle(p,o,i,this.options&&this.options.postProcessPassResolved?je({i18nResolved:a},s):s,this)),o}},{key:"resolve",value:function(o){var i=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a,l,u,c,d;return typeof o=="string"&&(o=[o]),o.forEach(function(f){if(!i.isValidLookup(a)){var h=i.extractFromKey(f,s),m=h.key;l=m;var v=h.namespaces;i.options.fallbackNS&&(v=v.concat(i.options.fallbackNS));var y=s.count!==void 0&&typeof s.count!="string",p=y&&!s.ordinal&&s.count===0&&i.pluralResolver.shouldUseIntlApi(),g=s.context!==void 0&&(typeof s.context=="string"||typeof s.context=="number")&&s.context!=="",S=s.lngs?s.lngs:i.languageUtils.toResolveHierarchy(s.lng||i.language,s.fallbackLng);v.forEach(function(_){i.isValidLookup(a)||(d=_,!Ey["".concat(S[0],"-").concat(_)]&&i.utils&&i.utils.hasLoadedNamespace&&!i.utils.hasLoadedNamespace(d)&&(Ey["".concat(S[0],"-").concat(_)]=!0,i.logger.warn('key "'.concat(l,'" for languages "').concat(S.join(", "),`" won't get resolved as namespace "`).concat(d,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),S.forEach(function(w){if(!i.isValidLookup(a)){c=w;var R=[m];if(i.i18nFormat&&i.i18nFormat.addLookupKeys)i.i18nFormat.addLookupKeys(R,m,w,_,s);else{var C;y&&(C=i.pluralResolver.getSuffix(w,s.count,s));var L="".concat(i.options.pluralSeparator,"zero");if(y&&(R.push(m+C),p&&R.push(m+L)),g){var B="".concat(m).concat(i.options.contextSeparator).concat(s.context);R.push(B),y&&(R.push(B+C),p&&R.push(B+L))}}for(var I;I=R.pop();)i.isValidLookup(a)||(u=I,a=i.getResource(w,_,I,s))}}))})}}),{res:a,usedKey:l,exactUsedKey:u,usedLng:c,usedNS:d}}},{key:"isValidLookup",value:function(o){return o!==void 0&&!(!this.options.returnNull&&o===null)&&!(!this.options.returnEmptyString&&o==="")}},{key:"getResource",value:function(o,i,s){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(o,i,s,a):this.resourceStore.getResource(o,i,s,a)}}],[{key:"hasDefaultValue",value:function(o){var i="defaultValue";for(var s in o)if(Object.prototype.hasOwnProperty.call(o,s)&&i===s.substring(0,i.length)&&o[s]!==void 0)return!0;return!1}}]),n}(Wn);function Id(e){return e.charAt(0).toUpperCase()+e.slice(1)}var _y=function(){function e(t){_t(this,e),this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Kt.create("languageUtils")}return wt(e,[{key:"getScriptPartFromCode",value:function(n){if(!n||n.indexOf("-")<0)return null;var r=n.split("-");return r.length===2||(r.pop(),r[r.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(r.join("-"))}},{key:"getLanguagePartFromCode",value:function(n){if(!n||n.indexOf("-")<0)return n;var r=n.split("-");return this.formatLanguageCode(r[0])}},{key:"formatLanguageCode",value:function(n){if(typeof n=="string"&&n.indexOf("-")>-1){var r=["hans","hant","latn","cyrl","cans","mong","arab"],o=n.split("-");return this.options.lowerCaseLng?o=o.map(function(i){return i.toLowerCase()}):o.length===2?(o[0]=o[0].toLowerCase(),o[1]=o[1].toUpperCase(),r.indexOf(o[1].toLowerCase())>-1&&(o[1]=Id(o[1].toLowerCase()))):o.length===3&&(o[0]=o[0].toLowerCase(),o[1].length===2&&(o[1]=o[1].toUpperCase()),o[0]!=="sgn"&&o[2].length===2&&(o[2]=o[2].toUpperCase()),r.indexOf(o[1].toLowerCase())>-1&&(o[1]=Id(o[1].toLowerCase())),r.indexOf(o[2].toLowerCase())>-1&&(o[2]=Id(o[2].toLowerCase()))),o.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?n.toLowerCase():n}},{key:"isSupportedCode",value:function(n){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(n=this.getLanguagePartFromCode(n)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(n)>-1}},{key:"getBestMatchFromCodes",value:function(n){var r=this;if(!n)return null;var o;return n.forEach(function(i){if(!o){var s=r.formatLanguageCode(i);(!r.options.supportedLngs||r.isSupportedCode(s))&&(o=s)}}),!o&&this.options.supportedLngs&&n.forEach(function(i){if(!o){var s=r.getLanguagePartFromCode(i);if(r.isSupportedCode(s))return o=s;o=r.options.supportedLngs.find(function(a){if(a.indexOf(s)===0)return a})}}),o||(o=this.getFallbackCodes(this.options.fallbackLng)[0]),o}},{key:"getFallbackCodes",value:function(n,r){if(!n)return[];if(typeof n=="function"&&(n=n(r)),typeof n=="string"&&(n=[n]),Object.prototype.toString.apply(n)==="[object Array]")return n;if(!r)return n.default||[];var o=n[r];return o||(o=n[this.getScriptPartFromCode(r)]),o||(o=n[this.formatLanguageCode(r)]),o||(o=n[this.getLanguagePartFromCode(r)]),o||(o=n.default),o||[]}},{key:"toResolveHierarchy",value:function(n,r){var o=this,i=this.getFallbackCodes(r||this.options.fallbackLng||[],n),s=[],a=function(u){u&&(o.isSupportedCode(u)?s.push(u):o.logger.warn("rejecting language code not found in supportedLngs: ".concat(u)))};return typeof n=="string"&&n.indexOf("-")>-1?(this.options.load!=="languageOnly"&&a(this.formatLanguageCode(n)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&a(this.getScriptPartFromCode(n)),this.options.load!=="currentOnly"&&a(this.getLanguagePartFromCode(n))):typeof n=="string"&&a(this.formatLanguageCode(n)),i.forEach(function(l){s.indexOf(l)<0&&a(o.formatLanguageCode(l))}),s}}]),e}(),CT=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],IT={1:function(t){return Number(t>1)},2:function(t){return Number(t!=1)},3:function(t){return 0},4:function(t){return Number(t%10==1&&t%100!=11?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2)},5:function(t){return Number(t==0?0:t==1?1:t==2?2:t%100>=3&&t%100<=10?3:t%100>=11?4:5)},6:function(t){return Number(t==1?0:t>=2&&t<=4?1:2)},7:function(t){return Number(t==1?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2)},8:function(t){return Number(t==1?0:t==2?1:t!=8&&t!=11?2:3)},9:function(t){return Number(t>=2)},10:function(t){return Number(t==1?0:t==2?1:t<7?2:t<11?3:4)},11:function(t){return Number(t==1||t==11?0:t==2||t==12?1:t>2&&t<20?2:3)},12:function(t){return Number(t%10!=1||t%100==11)},13:function(t){return Number(t!==0)},14:function(t){return Number(t==1?0:t==2?1:t==3?2:3)},15:function(t){return Number(t%10==1&&t%100!=11?0:t%10>=2&&(t%100<10||t%100>=20)?1:2)},16:function(t){return Number(t%10==1&&t%100!=11?0:t!==0?1:2)},17:function(t){return Number(t==1||t%10==1&&t%100!=11?0:1)},18:function(t){return Number(t==0?0:t==1?1:2)},19:function(t){return Number(t==1?0:t==0||t%100>1&&t%100<11?1:t%100>10&&t%100<20?2:3)},20:function(t){return Number(t==1?0:t==0||t%100>0&&t%100<20?1:2)},21:function(t){return Number(t%100==1?1:t%100==2?2:t%100==3||t%100==4?3:0)},22:function(t){return Number(t==1?0:t==2?1:(t<0||t>10)&&t%10==0?2:3)}},bT=["v1","v2","v3"],wy={zero:0,one:1,two:2,few:3,many:4,other:5};function AT(){var e={};return CT.forEach(function(t){t.lngs.forEach(function(n){e[n]={numbers:t.nr,plurals:IT[t.fc]}})}),e}var LT=function(){function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};_t(this,e),this.languageUtils=t,this.options=n,this.logger=Kt.create("pluralResolver"),(!this.options.compatibilityJSON||this.options.compatibilityJSON==="v4")&&(typeof Intl>"u"||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=AT()}return wt(e,[{key:"addRule",value:function(n,r){this.rules[n]=r}},{key:"getRule",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(n,{type:r.ordinal?"ordinal":"cardinal"})}catch{return}return this.rules[n]||this.rules[this.languageUtils.getLanguagePartFromCode(n)]}},{key:"needsPlural",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=this.getRule(n,r);return this.shouldUseIntlApi()?o&&o.resolvedOptions().pluralCategories.length>1:o&&o.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(n,r){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(n,o).map(function(i){return"".concat(r).concat(i)})}},{key:"getSuffixes",value:function(n){var r=this,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=this.getRule(n,o);return i?this.shouldUseIntlApi()?i.resolvedOptions().pluralCategories.sort(function(s,a){return wy[s]-wy[a]}).map(function(s){return"".concat(r.options.prepend).concat(s)}):i.numbers.map(function(s){return r.getSuffix(n,s,o)}):[]}},{key:"getSuffix",value:function(n,r){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=this.getRule(n,o);return i?this.shouldUseIntlApi()?"".concat(this.options.prepend).concat(i.select(r)):this.getSuffixRetroCompatible(i,r):(this.logger.warn("no plural rule found for: ".concat(n)),"")}},{key:"getSuffixRetroCompatible",value:function(n,r){var o=this,i=n.noAbs?n.plurals(r):n.plurals(Math.abs(r)),s=n.numbers[i];this.options.simplifyPluralSuffix&&n.numbers.length===2&&n.numbers[0]===1&&(s===2?s="plural":s===1&&(s=""));var a=function(){return o.options.prepend&&s.toString()?o.options.prepend+s.toString():s.toString()};return this.options.compatibilityJSON==="v1"?s===1?"":typeof s=="number"?"_plural_".concat(s.toString()):a():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&n.numbers.length===2&&n.numbers[0]===1?a():this.options.prepend&&i.toString()?this.options.prepend+i.toString():i.toString()}},{key:"shouldUseIntlApi",value:function(){return!bT.includes(this.options.compatibilityJSON)}}]),e}();function Ry(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Pt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Ry(Object(n),!0).forEach(function(r){hn(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ry(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var DT=function(){function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};_t(this,e),this.logger=Kt.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||function(n){return n},this.init(t)}return wt(e,[{key:"init",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};n.interpolation||(n.interpolation={escapeValue:!0});var r=n.interpolation;this.escape=r.escape!==void 0?r.escape:ST,this.escapeValue=r.escapeValue!==void 0?r.escapeValue:!0,this.useRawValueToEscape=r.useRawValueToEscape!==void 0?r.useRawValueToEscape:!1,this.prefix=r.prefix?Ao(r.prefix):r.prefixEscaped||"{{",this.suffix=r.suffix?Ao(r.suffix):r.suffixEscaped||"}}",this.formatSeparator=r.formatSeparator?r.formatSeparator:r.formatSeparator||",",this.unescapePrefix=r.unescapeSuffix?"":r.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":r.unescapeSuffix||"",this.nestingPrefix=r.nestingPrefix?Ao(r.nestingPrefix):r.nestingPrefixEscaped||Ao("$t("),this.nestingSuffix=r.nestingSuffix?Ao(r.nestingSuffix):r.nestingSuffixEscaped||Ao(")"),this.nestingOptionsSeparator=r.nestingOptionsSeparator?r.nestingOptionsSeparator:r.nestingOptionsSeparator||",",this.maxReplaces=r.maxReplaces?r.maxReplaces:1e3,this.alwaysFormat=r.alwaysFormat!==void 0?r.alwaysFormat:!1,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var n="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(n,"g");var r="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(r,"g");var o="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(o,"g")}},{key:"interpolate",value:function(n,r,o,i){var s=this,a,l,u,c=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function d(y){return y.replace(/\$/g,"$$$$")}var f=function(p){if(p.indexOf(s.formatSeparator)<0){var g=py(r,c,p);return s.alwaysFormat?s.format(g,void 0,o,Pt(Pt(Pt({},i),r),{},{interpolationkey:p})):g}var S=p.split(s.formatSeparator),_=S.shift().trim(),w=S.join(s.formatSeparator).trim();return s.format(py(r,c,_),w,o,Pt(Pt(Pt({},i),r),{},{interpolationkey:_}))};this.resetRegExp();var h=i&&i.missingInterpolationHandler||this.options.missingInterpolationHandler,m=i&&i.interpolation&&i.interpolation.skipOnVariables!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables,v=[{regex:this.regexpUnescape,safeValue:function(p){return d(p)}},{regex:this.regexp,safeValue:function(p){return s.escapeValue?d(s.escape(p)):d(p)}}];return v.forEach(function(y){for(u=0;a=y.regex.exec(n);){var p=a[1].trim();if(l=f(p),l===void 0)if(typeof h=="function"){var g=h(n,a,i);l=typeof g=="string"?g:""}else if(i&&Object.prototype.hasOwnProperty.call(i,p))l="";else if(m){l=a[0];continue}else s.logger.warn("missed to pass in variable ".concat(p," for interpolating ").concat(n)),l="";else typeof l!="string"&&!s.useRawValueToEscape&&(l=dy(l));var S=y.safeValue(l);if(n=n.replace(a[0],S),m?(y.regex.lastIndex+=l.length,y.regex.lastIndex-=a[0].length):y.regex.lastIndex=0,u++,u>=s.maxReplaces)break}}),n}},{key:"nest",value:function(n,r){var o=this,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s,a,l;function u(h,m){var v=this.nestingOptionsSeparator;if(h.indexOf(v)<0)return h;var y=h.split(new RegExp("".concat(v,"[ ]*{"))),p="{".concat(y[1]);h=y[0],p=this.interpolate(p,l);var g=p.match(/'/g),S=p.match(/"/g);(g&&g.length%2===0&&!S||S.length%2!==0)&&(p=p.replace(/'/g,'"'));try{l=JSON.parse(p),m&&(l=Pt(Pt({},m),l))}catch(_){return this.logger.warn("failed parsing options string in nesting for key ".concat(h),_),"".concat(h).concat(v).concat(p)}return delete l.defaultValue,h}for(;s=this.nestingRegexp.exec(n);){var c=[];l=Pt({},i),l=l.replace&&typeof l.replace!="string"?l.replace:l,l.applyPostProcessor=!1,delete l.defaultValue;var d=!1;if(s[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(s[1])){var f=s[1].split(this.formatSeparator).map(function(h){return h.trim()});s[1]=f.shift(),c=f,d=!0}if(a=r(u.call(this,s[1].trim(),l),l),a&&s[0]===n&&typeof a!="string")return a;typeof a!="string"&&(a=dy(a)),a||(this.logger.warn("missed to resolve ".concat(s[1]," for nesting ").concat(n)),a=""),d&&(a=c.reduce(function(h,m){return o.format(h,m,i.lng,Pt(Pt({},i),{},{interpolationkey:s[1].trim()}))},a.trim())),n=n.replace(s[0],a),this.regexp.lastIndex=0}return n}}]),e}();function Ny(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function gn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Ny(Object(n),!0).forEach(function(r){hn(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ny(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function kT(e){var t=e.toLowerCase().trim(),n={};if(e.indexOf("(")>-1){var r=e.split("(");t=r[0].toLowerCase().trim();var o=r[1].substring(0,r[1].length-1);if(t==="currency"&&o.indexOf(":")<0)n.currency||(n.currency=o.trim());else if(t==="relativetime"&&o.indexOf(":")<0)n.range||(n.range=o.trim());else{var i=o.split(";");i.forEach(function(s){if(s){var a=s.split(":"),l=hT(a),u=l[0],c=l.slice(1),d=c.join(":").trim().replace(/^'+|'+$/g,"");n[u.trim()]||(n[u.trim()]=d),d==="false"&&(n[u.trim()]=!1),d==="true"&&(n[u.trim()]=!0),isNaN(d)||(n[u.trim()]=parseInt(d,10))}})}}return{formatName:t,formatOptions:n}}function Lo(e){var t={};return function(r,o,i){var s=o+JSON.stringify(i),a=t[s];return a||(a=e(o,i),t[s]=a),a(r)}}var PT=function(){function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};_t(this,e),this.logger=Kt.create("formatter"),this.options=t,this.formats={number:Lo(function(n,r){var o=new Intl.NumberFormat(n,gn({},r));return function(i){return o.format(i)}}),currency:Lo(function(n,r){var o=new Intl.NumberFormat(n,gn(gn({},r),{},{style:"currency"}));return function(i){return o.format(i)}}),datetime:Lo(function(n,r){var o=new Intl.DateTimeFormat(n,gn({},r));return function(i){return o.format(i)}}),relativetime:Lo(function(n,r){var o=new Intl.RelativeTimeFormat(n,gn({},r));return function(i){return o.format(i,r.range||"day")}}),list:Lo(function(n,r){var o=new Intl.ListFormat(n,gn({},r));return function(i){return o.format(i)}})},this.init(t)}return wt(e,[{key:"init",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}},o=r.interpolation;this.formatSeparator=o.formatSeparator?o.formatSeparator:o.formatSeparator||","}},{key:"add",value:function(n,r){this.formats[n.toLowerCase().trim()]=r}},{key:"addCached",value:function(n,r){this.formats[n.toLowerCase().trim()]=Lo(r)}},{key:"format",value:function(n,r,o){var i=this,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},a=r.split(this.formatSeparator),l=a.reduce(function(u,c){var d=kT(c),f=d.formatName,h=d.formatOptions;if(i.formats[f]){var m=u;try{var v=s&&s.formatParams&&s.formatParams[s.interpolationkey]||{},y=v.locale||v.lng||s.locale||s.lng||o;m=i.formats[f](u,y,gn(gn(gn({},h),s),v))}catch(p){i.logger.warn(p)}return m}else i.logger.warn("there was no format function for ".concat(f));return u},n);return l}}]),e}();function Oy(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function xy(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Oy(Object(n),!0).forEach(function(r){hn(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Oy(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function MT(e){var t=UT();return function(){var r=Wt(e),o;if(t){var i=Wt(this).constructor;o=Reflect.construct(r,arguments,i)}else o=r.apply(this,arguments);return Ki(this,o)}}function UT(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function FT(e,t){e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)}var VT=function(e){tl(n,e);var t=MT(n);function n(r,o,i){var s,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return _t(this,n),s=t.call(this),rl&&Wn.call(Yn(s)),s.backend=r,s.store=o,s.services=i,s.languageUtils=i.languageUtils,s.options=a,s.logger=Kt.create("backendConnector"),s.waitingReads=[],s.maxParallelReads=a.maxParallelReads||10,s.readingCalls=0,s.maxRetries=a.maxRetries>=0?a.maxRetries:5,s.retryTimeout=a.retryTimeout>=1?a.retryTimeout:350,s.state={},s.queue=[],s.backend&&s.backend.init&&s.backend.init(i,a.backend,a),s}return wt(n,[{key:"queueLoad",value:function(o,i,s,a){var l=this,u={},c={},d={},f={};return o.forEach(function(h){var m=!0;i.forEach(function(v){var y="".concat(h,"|").concat(v);!s.reload&&l.store.hasResourceBundle(h,v)?l.state[y]=2:l.state[y]<0||(l.state[y]===1?c[y]===void 0&&(c[y]=!0):(l.state[y]=1,m=!1,c[y]===void 0&&(c[y]=!0),u[y]===void 0&&(u[y]=!0),f[v]===void 0&&(f[v]=!0)))}),m||(d[h]=!0)}),(Object.keys(u).length||Object.keys(c).length)&&this.queue.push({pending:c,pendingCount:Object.keys(c).length,loaded:{},errors:[],callback:a}),{toLoad:Object.keys(u),pending:Object.keys(c),toLoadLanguages:Object.keys(d),toLoadNamespaces:Object.keys(f)}}},{key:"loaded",value:function(o,i,s){var a=o.split("|"),l=a[0],u=a[1];i&&this.emit("failedLoading",l,u,i),s&&this.store.addResourceBundle(l,u,s),this.state[o]=i?-1:2;var c={};this.queue.forEach(function(d){yT(d.loaded,[l],u),FT(d,o),i&&d.errors.push(i),d.pendingCount===0&&!d.done&&(Object.keys(d.loaded).forEach(function(f){c[f]||(c[f]={});var h=d.loaded[f];h.length&&h.forEach(function(m){c[f][m]===void 0&&(c[f][m]=!0)})}),d.done=!0,d.errors.length?d.callback(d.errors):d.callback())}),this.emit("loaded",c),this.queue=this.queue.filter(function(d){return!d.done})}},{key:"read",value:function(o,i,s){var a=this,l=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,u=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,c=arguments.length>5?arguments[5]:void 0;if(!o.length)return c(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:o,ns:i,fcName:s,tried:l,wait:u,callback:c});return}this.readingCalls++;var d=function(v,y){if(a.readingCalls--,a.waitingReads.length>0){var p=a.waitingReads.shift();a.read(p.lng,p.ns,p.fcName,p.tried,p.wait,p.callback)}if(v&&y&&l<a.maxRetries){setTimeout(function(){a.read.call(a,o,i,s,l+1,u*2,c)},u);return}c(v,y)},f=this.backend[s].bind(this.backend);if(f.length===2){try{var h=f(o,i);h&&typeof h.then=="function"?h.then(function(m){return d(null,m)}).catch(d):d(null,h)}catch(m){d(m)}return}return f(o,i,d)}},{key:"prepareLoading",value:function(o,i){var s=this,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},l=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),l&&l();typeof o=="string"&&(o=this.languageUtils.toResolveHierarchy(o)),typeof i=="string"&&(i=[i]);var u=this.queueLoad(o,i,a,l);if(!u.toLoad.length)return u.pending.length||l(),null;u.toLoad.forEach(function(c){s.loadOne(c)})}},{key:"load",value:function(o,i,s){this.prepareLoading(o,i,{},s)}},{key:"reload",value:function(o,i,s){this.prepareLoading(o,i,{reload:!0},s)}},{key:"loadOne",value:function(o){var i=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",a=o.split("|"),l=a[0],u=a[1];this.read(l,u,"read",void 0,void 0,function(c,d){c&&i.logger.warn("".concat(s,"loading namespace ").concat(u," for language ").concat(l," failed"),c),!c&&d&&i.logger.log("".concat(s,"loaded namespace ").concat(u," for language ").concat(l),d),i.loaded(o,c,d)})}},{key:"saveMissing",value:function(o,i,s,a,l){var u=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},c=arguments.length>6&&arguments[6]!==void 0?arguments[6]:function(){};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(i)){this.logger.warn('did not save key "'.concat(s,'" as the namespace "').concat(i,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(s==null||s==="")){if(this.backend&&this.backend.create){var d=xy(xy({},u),{},{isUpdate:l}),f=this.backend.create.bind(this.backend);if(f.length<6)try{var h;f.length===5?h=f(o,i,s,a,d):h=f(o,i,s,a),h&&typeof h.then=="function"?h.then(function(m){return c(null,m)}).catch(c):c(null,h)}catch(m){c(m)}else f(o,i,s,a,c,d)}!o||!o[0]||this.store.addResource(o[0],i,s,a)}}}]),n}(Wn);function Ty(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(t){var n={};if(kt(t[1])==="object"&&(n=t[1]),typeof t[1]=="string"&&(n.defaultValue=t[1]),typeof t[2]=="string"&&(n.tDescription=t[2]),kt(t[2])==="object"||kt(t[3])==="object"){var r=t[3]||t[2];Object.keys(r).forEach(function(o){n[o]=r[o]})}return n},interpolation:{escapeValue:!0,format:function(t,n,r,o){return t},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function Cy(e){return typeof e.ns=="string"&&(e.ns=[e.ns]),typeof e.fallbackLng=="string"&&(e.fallbackLng=[e.fallbackLng]),typeof e.fallbackNS=="string"&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function Iy(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Qt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Iy(Object(n),!0).forEach(function(r){hn(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Iy(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function BT(e){var t=$T();return function(){var r=Wt(e),o;if(t){var i=Wt(this).constructor;o=Reflect.construct(r,arguments,i)}else o=r.apply(this,arguments);return Ki(this,o)}}function $T(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function il(){}function HT(e){var t=Object.getOwnPropertyNames(Object.getPrototypeOf(e));t.forEach(function(n){typeof e[n]=="function"&&(e[n]=e[n].bind(e))})}var sl=function(e){tl(n,e);var t=BT(n);function n(){var r,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;if(_t(this,n),r=t.call(this),rl&&Wn.call(Yn(r)),r.options=Cy(o),r.services={},r.logger=Kt,r.modules={external:[]},HT(Yn(r)),i&&!r.isInitialized&&!o.isClone){if(!r.options.initImmediate)return r.init(o,i),Ki(r,Yn(r));setTimeout(function(){r.init(o,i)},0)}return r}return wt(n,[{key:"init",value:function(){var o=this,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},s=arguments.length>1?arguments[1]:void 0;typeof i=="function"&&(s=i,i={}),!i.defaultNS&&i.defaultNS!==!1&&i.ns&&(typeof i.ns=="string"?i.defaultNS=i.ns:i.ns.indexOf("translation")<0&&(i.defaultNS=i.ns[0]));var a=Ty();this.options=Qt(Qt(Qt({},a),this.options),Cy(i)),this.options.compatibilityAPI!=="v1"&&(this.options.interpolation=Qt(Qt({},a.interpolation),this.options.interpolation)),i.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=i.keySeparator),i.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=i.nsSeparator);function l(p){return p?typeof p=="function"?new p:p:null}if(!this.options.isClone){this.modules.logger?Kt.init(l(this.modules.logger),this.options):Kt.init(null,this.options);var u;this.modules.formatter?u=this.modules.formatter:typeof Intl<"u"&&(u=PT);var c=new _y(this.options);this.store=new OT(this.options.resources,this.options);var d=this.services;d.logger=Kt,d.resourceStore=this.store,d.languageUtils=c,d.pluralResolver=new LT(c,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),u&&(!this.options.interpolation.format||this.options.interpolation.format===a.interpolation.format)&&(d.formatter=l(u),d.formatter.init(d,this.options),this.options.interpolation.format=d.formatter.format.bind(d.formatter)),d.interpolator=new DT(this.options),d.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},d.backendConnector=new VT(l(this.modules.backend),d.resourceStore,d,this.options),d.backendConnector.on("*",function(p){for(var g=arguments.length,S=new Array(g>1?g-1:0),_=1;_<g;_++)S[_-1]=arguments[_];o.emit.apply(o,[p].concat(S))}),this.modules.languageDetector&&(d.languageDetector=l(this.modules.languageDetector),d.languageDetector.init&&d.languageDetector.init(d,this.options.detection,this.options)),this.modules.i18nFormat&&(d.i18nFormat=l(this.modules.i18nFormat),d.i18nFormat.init&&d.i18nFormat.init(this)),this.translator=new Sy(this.services,this.options),this.translator.on("*",function(p){for(var g=arguments.length,S=new Array(g>1?g-1:0),_=1;_<g;_++)S[_-1]=arguments[_];o.emit.apply(o,[p].concat(S))}),this.modules.external.forEach(function(p){p.init&&p.init(o)})}if(this.format=this.options.interpolation.format,s||(s=il),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){var f=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);f.length>0&&f[0]!=="dev"&&(this.options.lng=f[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined");var h=["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"];h.forEach(function(p){o[p]=function(){var g;return(g=o.store)[p].apply(g,arguments)}});var m=["addResource","addResources","addResourceBundle","removeResourceBundle"];m.forEach(function(p){o[p]=function(){var g;return(g=o.store)[p].apply(g,arguments),o}});var v=Qi(),y=function(){var g=function(_,w){o.isInitialized&&!o.initializedStoreOnce&&o.logger.warn("init: i18next is already initialized. You should call init just once!"),o.isInitialized=!0,o.options.isClone||o.logger.log("initialized",o.options),o.emit("initialized",o.options),v.resolve(w),s(_,w)};if(o.languages&&o.options.compatibilityAPI!=="v1"&&!o.isInitialized)return g(null,o.t.bind(o));o.changeLanguage(o.options.lng,g)};return this.options.resources||!this.options.initImmediate?y():setTimeout(y,0),v}},{key:"loadResources",value:function(o){var i=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:il,a=s,l=typeof o=="string"?o:this.language;if(typeof o=="function"&&(a=o),!this.options.resources||this.options.partialBundledLanguages){if(l&&l.toLowerCase()==="cimode")return a();var u=[],c=function(h){if(h){var m=i.services.languageUtils.toResolveHierarchy(h);m.forEach(function(v){u.indexOf(v)<0&&u.push(v)})}};if(l)c(l);else{var d=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);d.forEach(function(f){return c(f)})}this.options.preload&&this.options.preload.forEach(function(f){return c(f)}),this.services.backendConnector.load(u,this.options.ns,function(f){!f&&!i.resolvedLanguage&&i.language&&i.setResolvedLanguage(i.language),a(f)})}else a(null)}},{key:"reloadResources",value:function(o,i,s){var a=Qi();return o||(o=this.languages),i||(i=this.options.ns),s||(s=il),this.services.backendConnector.reload(o,i,function(l){a.resolve(),s(l)}),a}},{key:"use",value:function(o){if(!o)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!o.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return o.type==="backend"&&(this.modules.backend=o),(o.type==="logger"||o.log&&o.warn&&o.error)&&(this.modules.logger=o),o.type==="languageDetector"&&(this.modules.languageDetector=o),o.type==="i18nFormat"&&(this.modules.i18nFormat=o),o.type==="postProcessor"&&vy.addPostProcessor(o),o.type==="formatter"&&(this.modules.formatter=o),o.type==="3rdParty"&&this.modules.external.push(o),this}},{key:"setResolvedLanguage",value:function(o){if(!(!o||!this.languages)&&!(["cimode","dev"].indexOf(o)>-1))for(var i=0;i<this.languages.length;i++){var s=this.languages[i];if(!(["cimode","dev"].indexOf(s)>-1)&&this.store.hasLanguageSomeTranslations(s)){this.resolvedLanguage=s;break}}}},{key:"changeLanguage",value:function(o,i){var s=this;this.isLanguageChangingTo=o;var a=Qi();this.emit("languageChanging",o);var l=function(f){s.language=f,s.languages=s.services.languageUtils.toResolveHierarchy(f),s.resolvedLanguage=void 0,s.setResolvedLanguage(f)},u=function(f,h){h?(l(h),s.translator.changeLanguage(h),s.isLanguageChangingTo=void 0,s.emit("languageChanged",h),s.logger.log("languageChanged",h)):s.isLanguageChangingTo=void 0,a.resolve(function(){return s.t.apply(s,arguments)}),i&&i(f,function(){return s.t.apply(s,arguments)})},c=function(f){!o&&!f&&s.services.languageDetector&&(f=[]);var h=typeof f=="string"?f:s.services.languageUtils.getBestMatchFromCodes(f);h&&(s.language||l(h),s.translator.language||s.translator.changeLanguage(h),s.services.languageDetector&&s.services.languageDetector.cacheUserLanguage&&s.services.languageDetector.cacheUserLanguage(h)),s.loadResources(h,function(m){u(m,h)})};return!o&&this.services.languageDetector&&!this.services.languageDetector.async?c(this.services.languageDetector.detect()):!o&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(c):this.services.languageDetector.detect(c):c(o),a}},{key:"getFixedT",value:function(o,i,s){var a=this,l=function u(c,d){var f;if(kt(d)!=="object"){for(var h=arguments.length,m=new Array(h>2?h-2:0),v=2;v<h;v++)m[v-2]=arguments[v];f=a.options.overloadTranslationOptionHandler([c,d].concat(m))}else f=Qt({},d);f.lng=f.lng||u.lng,f.lngs=f.lngs||u.lngs,f.ns=f.ns||u.ns,f.keyPrefix=f.keyPrefix||s||u.keyPrefix;var y=a.options.keySeparator||".",p;return f.keyPrefix&&Array.isArray(c)?p=c.map(function(g){return"".concat(f.keyPrefix).concat(y).concat(g)}):p=f.keyPrefix?"".concat(f.keyPrefix).concat(y).concat(c):c,a.t(p,f)};return typeof o=="string"?l.lng=o:l.lngs=o,l.ns=i,l.keyPrefix=s,l}},{key:"t",value:function(){var o;return this.translator&&(o=this.translator).translate.apply(o,arguments)}},{key:"exists",value:function(){var o;return this.translator&&(o=this.translator).exists.apply(o,arguments)}},{key:"setDefaultNamespace",value:function(o){this.options.defaultNS=o}},{key:"hasLoadedNamespace",value:function(o){var i=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var a=this.resolvedLanguage||this.languages[0],l=this.options?this.options.fallbackLng:!1,u=this.languages[this.languages.length-1];if(a.toLowerCase()==="cimode")return!0;var c=function(h,m){var v=i.services.backendConnector.state["".concat(h,"|").concat(m)];return v===-1||v===2};if(s.precheck){var d=s.precheck(this,c);if(d!==void 0)return d}return!!(this.hasResourceBundle(a,o)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||c(a,o)&&(!l||c(u,o)))}},{key:"loadNamespaces",value:function(o,i){var s=this,a=Qi();return this.options.ns?(typeof o=="string"&&(o=[o]),o.forEach(function(l){s.options.ns.indexOf(l)<0&&s.options.ns.push(l)}),this.loadResources(function(l){a.resolve(),i&&i(l)}),a):(i&&i(),Promise.resolve())}},{key:"loadLanguages",value:function(o,i){var s=Qi();typeof o=="string"&&(o=[o]);var a=this.options.preload||[],l=o.filter(function(u){return a.indexOf(u)<0});return l.length?(this.options.preload=a.concat(l),this.loadResources(function(u){s.resolve(),i&&i(u)}),s):(i&&i(),Promise.resolve())}},{key:"dir",value:function(o){if(o||(o=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!o)return"rtl";var i=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],s=this.services&&this.services.languageUtils||new _y(Ty());return i.indexOf(s.getLanguagePartFromCode(o))>-1||o.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}},{key:"cloneInstance",value:function(){var o=this,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:il,a=Qt(Qt(Qt({},this.options),i),{isClone:!0}),l=new n(a);(i.debug!==void 0||i.prefix!==void 0)&&(l.logger=l.logger.clone(i));var u=["store","services","language"];return u.forEach(function(c){l[c]=o[c]}),l.services=Qt({},this.services),l.services.utils={hasLoadedNamespace:l.hasLoadedNamespace.bind(l)},l.translator=new Sy(l.services,l.options),l.translator.on("*",function(c){for(var d=arguments.length,f=new Array(d>1?d-1:0),h=1;h<d;h++)f[h-1]=arguments[h];l.emit.apply(l,[c].concat(f))}),l.init(a,s),l.translator.options=l.options,l.translator.backendConnector.services.utils={hasLoadedNamespace:l.hasLoadedNamespace.bind(l)},l}},{key:"toJSON",value:function(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}]),n}(Wn);hn(sl,"createInstance",function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return new sl(e,t)});var be=sl.createInstance();be.createInstance=sl.createInstance,be.createInstance,be.dir,be.init,be.loadResources,be.reloadResources,be.use,be.changeLanguage,be.getFixedT,be.t,be.exists,be.setDefaultNamespace,be.hasLoadedNamespace,be.loadNamespaces,be.loadLanguages;var by=[],zT=by.forEach,jT=by.slice;function GT(e){return zT.call(jT.call(arguments,1),function(t){if(t)for(var n in t)e[n]===void 0&&(e[n]=t[n])}),e}var Ay=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,YT=function(t,n,r){var o=r||{};o.path=o.path||"/";var i=encodeURIComponent(n),s="".concat(t,"=").concat(i);if(o.maxAge>0){var a=o.maxAge-0;if(Number.isNaN(a))throw new Error("maxAge should be a Number");s+="; Max-Age=".concat(Math.floor(a))}if(o.domain){if(!Ay.test(o.domain))throw new TypeError("option domain is invalid");s+="; Domain=".concat(o.domain)}if(o.path){if(!Ay.test(o.path))throw new TypeError("option path is invalid");s+="; Path=".concat(o.path)}if(o.expires){if(typeof o.expires.toUTCString!="function")throw new TypeError("option expires is invalid");s+="; Expires=".concat(o.expires.toUTCString())}if(o.httpOnly&&(s+="; HttpOnly"),o.secure&&(s+="; Secure"),o.sameSite){var l=typeof o.sameSite=="string"?o.sameSite.toLowerCase():o.sameSite;switch(l){case!0:s+="; SameSite=Strict";break;case"lax":s+="; SameSite=Lax";break;case"strict":s+="; SameSite=Strict";break;case"none":s+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return s},Ly={create:function(t,n,r,o){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};r&&(i.expires=new Date,i.expires.setTime(i.expires.getTime()+r*60*1e3)),o&&(i.domain=o),document.cookie=YT(t,encodeURIComponent(n),i)},read:function(t){for(var n="".concat(t,"="),r=document.cookie.split(";"),o=0;o<r.length;o++){for(var i=r[o];i.charAt(0)===" ";)i=i.substring(1,i.length);if(i.indexOf(n)===0)return i.substring(n.length,i.length)}return null},remove:function(t){this.create(t,"",-1)}},WT={name:"cookie",lookup:function(t){var n;if(t.lookupCookie&&typeof document<"u"){var r=Ly.read(t.lookupCookie);r&&(n=r)}return n},cacheUserLanguage:function(t,n){n.lookupCookie&&typeof document<"u"&&Ly.create(n.lookupCookie,t,n.cookieMinutes,n.cookieDomain,n.cookieOptions)}},KT={name:"querystring",lookup:function(t){var n;if(typeof window<"u"){var r=window.location.search;!window.location.search&&window.location.hash&&window.location.hash.indexOf("?")>-1&&(r=window.location.hash.substring(window.location.hash.indexOf("?")));for(var o=r.substring(1),i=o.split("&"),s=0;s<i.length;s++){var a=i[s].indexOf("=");if(a>0){var l=i[s].substring(0,a);l===t.lookupQuerystring&&(n=i[s].substring(a+1))}}}return n}},Xi=null,Dy=function(){if(Xi!==null)return Xi;try{Xi=window!=="undefined"&&window.localStorage!==null;var t="i18next.translate.boo";window.localStorage.setItem(t,"foo"),window.localStorage.removeItem(t)}catch{Xi=!1}return Xi},QT={name:"localStorage",lookup:function(t){var n;if(t.lookupLocalStorage&&Dy()){var r=window.localStorage.getItem(t.lookupLocalStorage);r&&(n=r)}return n},cacheUserLanguage:function(t,n){n.lookupLocalStorage&&Dy()&&window.localStorage.setItem(n.lookupLocalStorage,t)}},qi=null,ky=function(){if(qi!==null)return qi;try{qi=window!=="undefined"&&window.sessionStorage!==null;var t="i18next.translate.boo";window.sessionStorage.setItem(t,"foo"),window.sessionStorage.removeItem(t)}catch{qi=!1}return qi},XT={name:"sessionStorage",lookup:function(t){var n;if(t.lookupSessionStorage&&ky()){var r=window.sessionStorage.getItem(t.lookupSessionStorage);r&&(n=r)}return n},cacheUserLanguage:function(t,n){n.lookupSessionStorage&&ky()&&window.sessionStorage.setItem(n.lookupSessionStorage,t)}},qT={name:"navigator",lookup:function(t){var n=[];if(typeof navigator<"u"){if(navigator.languages)for(var r=0;r<navigator.languages.length;r++)n.push(navigator.languages[r]);navigator.userLanguage&&n.push(navigator.userLanguage),navigator.language&&n.push(navigator.language)}return n.length>0?n:void 0}},ZT={name:"htmlTag",lookup:function(t){var n,r=t.htmlTag||(typeof document<"u"?document.documentElement:null);return r&&typeof r.getAttribute=="function"&&(n=r.getAttribute("lang")),n}},JT={name:"path",lookup:function(t){var n;if(typeof window<"u"){var r=window.location.pathname.match(/\/([a-zA-Z-]*)/g);if(r instanceof Array)if(typeof t.lookupFromPathIndex=="number"){if(typeof r[t.lookupFromPathIndex]!="string")return;n=r[t.lookupFromPathIndex].replace("/","")}else n=r[0].replace("/","")}return n}},eC={name:"subdomain",lookup:function(t){var n=typeof t.lookupFromSubdomainIndex=="number"?t.lookupFromSubdomainIndex+1:1,r=typeof window<"u"&&window.location&&window.location.hostname&&window.location.hostname.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(r)return r[n]}};function tC(){return{order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"]}}var Py=function(){function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};_t(this,e),this.type="languageDetector",this.detectors={},this.init(t,n)}return wt(e,[{key:"init",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=n,this.options=GT(r,this.options||{},tC()),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=o,this.addDetector(WT),this.addDetector(KT),this.addDetector(QT),this.addDetector(XT),this.addDetector(qT),this.addDetector(ZT),this.addDetector(JT),this.addDetector(eC)}},{key:"addDetector",value:function(n){this.detectors[n.name]=n}},{key:"detect",value:function(n){var r=this;n||(n=this.options.order);var o=[];return n.forEach(function(i){if(r.detectors[i]){var s=r.detectors[i].lookup(r.options);s&&typeof s=="string"&&(s=[s]),s&&(o=o.concat(s))}}),this.services.languageUtils.getBestMatchFromCodes?o:o.length>0?o[0]:null}},{key:"cacheUserLanguage",value:function(n,r){var o=this;r||(r=this.options.caches),r&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(n)>-1||r.forEach(function(i){o.detectors[i]&&o.detectors[i].cacheUserLanguage(n,o.options)}))}}]),e}();Py.type="languageDetector";var nC=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,rC={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},oC=function(t){return rC[t]},iC=function(t){return t.replace(nC,oC)};function My(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Uy(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?My(Object(n),!0).forEach(function(r){hn(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):My(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var Fy={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:iC};function sC(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Fy=Uy(Uy({},Fy),e)}var aC={type:"3rdParty",init:function(t){sC(t.options.react)}};N.createContext(),function(){function e(){_t(this,e),this.usedNamespaces={}}return wt(e,[{key:"addUsedNamespaces",value:function(n){var r=this;n.forEach(function(o){r.usedNamespaces[o]||(r.usedNamespaces[o]=!0)})}},{key:"getUsedNamespaces",value:function(){return Object.keys(this.usedNamespaces)}}]),e}();const lC={ABOUT:"About",ACTION:"Action",ADD_CONDITION:"Add Condition",ADD_OPTION:"Add Option",ADD_VARIABLE:"Add Variable",ANSWER_CALL:"Answer Call",API_VERSION:"API Version",APP_VERSION:"App Version",BEEP_SUBTITLE:"Play a beep before recording",BEEP:"Beep",BUILDER_VERSION:"Builder Version",BUSY:"Busy",CALL_ADDRESSES:"Call Addresses",CALL_NUMBERS:"Call Numbers",CALL_RESOURCES:"Call Resources",CALLER_PRESSES:"Caller Presses",CHOOSE_OPTION_SINGLE_MULTIPLE:"Choose single or multiple",CHOOSE_OPTION_TTS_AUDIO:"Choose how to play the message",CLOSE:"Close",COND_NUMBER:"Cond {{index}}",CONDITION_NUMBER:"Condition {{index}}",CONDITIONS:"Conditions",DECISION:"Decision",DECLINE:"Decline",DEPRECATED:"Deprecated",DISCONNECT_CALL_AFTER_RINGING:"Disconnect call after ringing",DOCUMENT_OUT_OF_SYNC:"Document Out of Sync",ELSE:"Else",ENTER_URL:"Enter URL",ERROR_ADD_RECORDING_FIRST:"Please add a Start Call Recording node first.",ERROR_DUPLICATE_RECORDING_LABEL:"This entry already exists. Please use a unique label.",ERROR_DUPLICATE_VARIABLE_KEY:"This variable already exists. Please use a unique key.",ERROR_INVALID_JSON:"Invalid JSON",ERROR_NUMBER_IS_REQUIRED:"A number is required.",ERROR_NUMBER_MIN_MAX_IS_REQUIRED:"A number between {{min}} and {{max}} is required.",ERROR_RECORDING_LABEL_REQUIRED:"A value is required. Maximum 20 characters.",ERROR_TELEPHONE_KEY_REQUIRED:"A value of 0-9, *, or # is required.",ERROR_TERMINATORS:"This value should contain only 0-9, *, or #.",ERROR_TEXT_IS_REQUIRED:"A text value is required.",ERROR_URL_IS_REQUIRED:"A valid URL is required.",ERROR_VALUE_IS_REQUIRED:"A value is required.",ERROR_VARIABLE_KEY_REQUIRED:"Valid characters are lowercase letters, digits, or underscore. Maximum 20 characters.",ERROR:"Error",FAILED:"Failed",FAILURE:"Failure",FEMALE:"Female",FORMAT:"Format",FORWARD_TO_ADDRESS:"Forward to Address",FORWARD_TO_PHONE:"Forward to Phone",FORWARD_TO_RESOURCE:"Forward to Resource",FORWARD:"Forward",FROM_PHONE_NUMBER:"From Phone Number",FROM:"From",GATHER_INPUT:"Gather Input",GENDER:"Gender",GO_BACK:"Go Back",HANDLE_CALL:"Handle Call",HANG_UP_CALL:"Hang Up Call",HANG_UP:"Hang Up",IGNORE:"Ignore",INFO_DEPLOY:"Deploy the latest changes for the current call flow.",INFO_NODE_COND:"Sets branching (when, then, else) based on the specified JavaScript condition.",INFO_NODE_FORWARD_TO_ADDRESS:"Forwards the current call to the specified Address as defined within your SignalWire space.",INFO_NODE_FORWARD_TO_PHONE:"Forwards the current call to the specified phone number (must be E.164 format).",INFO_NODE_FORWARD_TO_RESOURCE:"Forwards the current call to the specified Resource as defined within your SignalWire space.",INFO_NODE_GATHER_INPUT:"Plays an audio file or Text to Speech phrase and waits for a keypress or spoken input from the caller, allowing them to proceed through the call flow based on their input.",INFO_NODE_HANG_UP:"Ends the call with the ability to provide a reason (hangup, busy, or decline).",INFO_NODE_OPTION_REMOVE:"Are you sure? Removing this option will delete the flow connection and move back the following option, if there is one.",INFO_NODE_PLAY:"Plays an audio file or Text to Speech phrase. A valid URL must be provided for the audio file to be played. Text to Speech will read aloud the provided text using the voice option that is selected.",INFO_NODE_RECORD_CALL_START:"Triggers background recording of both sides of the call. Options can be set to enable stereo audio, play a notification beep before recording, set a digit to stop recording (terminator), and specify the recording name and format (WAV or MP3).",INFO_NODE_RECORD_CALL_STOP:"Triggers a background call recording to stop at a specific point in the call flow, if it has not already been terminated.",INFO_NODE_RECORD:"Triggers foreground recording of both sides of the call and waits for the recording to end. Options can be set to enable stereo audio, play a notification beep before recording, set a digit to stop recording (terminator), and specify the recording name and format (WAV or MP3).",INFO_NODE_REQUEST:"Makes an HTTP request (GET/POST/PUT/DELETE HTTP) to the specified URL. Responses can be parsed and stored as variables for further use in your flow.",INFO_NODE_SEND_SMS:"Sends an SMS message to the specified phone number. The 'From' phone number must be enabled for messaging (a 10DLC number assigned to an active TCR campaign or a verified toll free number).",INFO_NODE_SET_VARIABLES_OPTION:"Are you sure you want to remove this variable?",INFO_NODE_SET_VARIABLES:"Sets script variables by accepting an object which maps variable names to values.",INFO_NODE_UNSET_VARIABLES:"Unsets script variables.",INFO_STATUS_ERROR_OUT_OF_SYNC:"This document is locked because another user has made updates to the Call Flow. Refresh the page to discard your changes and unlock the flow with the latest updates.",INFO_STATUS_ERROR:"An error occurred while loading or saving the flow.",INPUT:"Input",KEY:"Key",LANGUAGE:"Language",MALE:"Male",METHOD:"Method",MORE_INFO_DEPLOY_ERROR:"There was an error deploying the Call Flow. Please try again. {{message}}",MORE_INFO_DEPLOY:"Deploying a Call Flow makes it live.",MORE_INFO_STATUS_ERROR:"More info on Flow document error",MORE_INFO_TITLE:"More info {{title}}",MULTIPLE_ADDRESSES:"Multiple Addresses",MULTIPLE_NUMBERS:"Multiple Numbers",MULTIPLE_RESOURCES:"Multiple Resources",NAVIGATE_BACK:"Navigate Back",NO_ANSWER:"No Answer",NO_INPUT:"No Input",NO_VARIABLES_SET:"Please set variables first",NUMBER_OF_VARIABLES_SELECTED_one:"{{count}} variable selected",NUMBER_OF_VARIABLES_SELECTED_other:"{{count}} variables selected",OFF:"Off",ON:"On",OPT_NUMBER:"Opt {{index}}",OPTION_NUMBER:"Option {{index}}",OPTIONAL:"optional",OR_SAYS:"Or says",PHONE_NUMBER:"Phone Number",PLAY_AUDIO_FILE:"Play Audio File",PLAY_AUDIO_TTS:"Play Audio or TTS",REASON:"Reason",RECORD_CALL_START:"Start Call Recording",RECORD_CALL_STOP:"Stop Call Recording",RECORD:"Record",RECORDING_NAME_DEFAULT:"Recording {{index}}",RECORDING_NAME:"Recording Name",RECORDING:"Recording",RELAYML_VERSION:"SWML Version",REMOVE_CONDITION:"Remove Condition {{index}}",REMOVE_EDGE:"Remove Edge",REMOVE_NODE:"Remove Node {{title}}",REMOVE_OPTION:"Remove Option {{index}}",REMOVE_VARIABLE:"Remove Variable {{index}}",REQUEST_BODY:"Body",REQUEST_HEADERS:"Headers (JSON)",REQUEST:"Request",RESYNC:"Resync",SAVE_VARIABLES_SUBTITLE:"Store the response as variables",SAVE_VARIABLES:"Save Variables",SECONDS:"seconds",SELECT_VARIABLES_TO_UNSET:"Select Variables to Unset",SELECT_VARIABLES:"Select Variables",SELECT:"Select",SEND_SMS:"Send SMS",SEQUENTIALLY:"Sequentially",SET_VARIABLES:"Set Variables",SETTINGS:"Settings",SIMULTANEOUSLY:"Simultaneously",SINGLE_ADDRESS:"Single Address",SINGLE_NUMBER:"Single Number",SINGLE_RESOURCE:"Single Resource",SMS_TEXT:"SMS Text",STATUS_DEPLOY_ERROR:"Deploy Error",STATUS_DEPLOY:"Deploy",STATUS_DEPLOYED:"Deployed",STATUS_DEPLOYING:"Deploying...",STATUS_ERROR:"Error",STATUS_LOADING:"Loading...",STATUS_LOCKED:"Locked",STATUS_SAVED:"Saved",STATUS_SAVING:"Saving...",STEREO_SUBTITLE:"Enable stereo audio",STEREO:"Stereo",SUCCESS:"Success",TERMINATORS:"Terminators",TEXT_TO_SPEECH:"Text to Speech",TEXT:"Text",TO_PHONE_NUMBER:"To Phone Number",TO:"To",TOAST_DOCUMENT_OUT_OF_SYNC:'Updates have been made to this Call Flow by another user and your recent changes have not been saved. Choose "Ignore" to view your changes in a locked state or "Resync" to abandon your changes and adopt the latest updates.',UNKNOWN:"Unknown",UNSET_VARIABLES:"Unset Variables",URL:"URL",VALUE:"Value",VARIABLE_KEY:"Variable {{key}}",VOICE:"Voice",VOICEMAIL_RECORDING:"Voicemail Recording",WAIT_FOR_INPUT:"Wait for Input",WRITE_SOMETHING:"Write something"},x={ABOUT:"ABOUT",ACTION:"ACTION",ADD_CONDITION:"ADD_CONDITION",ADD_OPTION:"ADD_OPTION",ADD_VARIABLE:"ADD_VARIABLE",ANSWER_CALL:"ANSWER_CALL",API_VERSION:"API_VERSION",APP_VERSION:"APP_VERSION",BEEP_SUBTITLE:"BEEP_SUBTITLE",BEEP:"BEEP",BUILDER_VERSION:"BUILDER_VERSION",BUSY:"BUSY",CALL_ADDRESSES:"CALL_ADDRESSES",CALL_NUMBERS:"CALL_NUMBERS",CALL_RESOURCES:"CALL_RESOURCES",CALLER_PRESSES:"CALLER_PRESSES",CHOOSE_OPTION_SINGLE_MULTIPLE:"CHOOSE_OPTION_SINGLE_MULTIPLE",CHOOSE_OPTION_TTS_AUDIO:"CHOOSE_OPTION_TTS_AUDIO",CLOSE:"CLOSE",COND_NUMBER:"COND_NUMBER",CONDITION_NUMBER:"CONDITION_NUMBER",CONDITIONS:"CONDITIONS",DECISION:"DECISION",DECLINE:"DECLINE",DEPRECATED:"DEPRECATED",DISCONNECT_CALL_AFTER_RINGING:"DISCONNECT_CALL_AFTER_RINGING",DOCUMENT_OUT_OF_SYNC:"DOCUMENT_OUT_OF_SYNC",ELSE:"ELSE",ENTER_URL:"ENTER_URL",ERROR_ADD_RECORDING_FIRST:"ERROR_ADD_RECORDING_FIRST",ERROR_DUPLICATE_RECORDING_LABEL:"ERROR_DUPLICATE_RECORDING_LABEL",ERROR_DUPLICATE_VARIABLE_KEY:"ERROR_DUPLICATE_VARIABLE_KEY",ERROR_INVALID_JSON:"ERROR_INVALID_JSON",ERROR_NUMBER_IS_REQUIRED:"ERROR_NUMBER_IS_REQUIRED",ERROR_NUMBER_MIN_MAX_IS_REQUIRED:"ERROR_NUMBER_MIN_MAX_IS_REQUIRED",ERROR_RECORDING_LABEL_REQUIRED:"ERROR_RECORDING_LABEL_REQUIRED",ERROR_TELEPHONE_KEY_REQUIRED:"ERROR_TELEPHONE_KEY_REQUIRED",ERROR_TERMINATORS:"ERROR_TERMINATORS",ERROR_TEXT_IS_REQUIRED:"ERROR_TEXT_IS_REQUIRED",ERROR_URL_IS_REQUIRED:"ERROR_URL_IS_REQUIRED",ERROR_VALUE_IS_REQUIRED:"ERROR_VALUE_IS_REQUIRED",ERROR_VARIABLE_KEY_REQUIRED:"ERROR_VARIABLE_KEY_REQUIRED",ERROR:"ERROR",FAILED:"FAILED",FAILURE:"FAILURE",FEMALE:"FEMALE",FORMAT:"FORMAT",FORWARD_TO_ADDRESS:"FORWARD_TO_ADDRESS",FORWARD_TO_PHONE:"FORWARD_TO_PHONE",FORWARD_TO_RESOURCE:"FORWARD_TO_RESOURCE",FORWARD:"FORWARD",FROM_PHONE_NUMBER:"FROM_PHONE_NUMBER",FROM:"FROM",GATHER_INPUT:"GATHER_INPUT",GENDER:"GENDER",GO_BACK:"GO_BACK",HANDLE_CALL:"HANDLE_CALL",HANG_UP_CALL:"HANG_UP_CALL",HANG_UP:"HANG_UP",IGNORE:"IGNORE",INFO_DEPLOY:"INFO_DEPLOY",INFO_NODE_COND:"INFO_NODE_COND",INFO_NODE_FORWARD_TO_ADDRESS:"INFO_NODE_FORWARD_TO_ADDRESS",INFO_NODE_FORWARD_TO_PHONE:"INFO_NODE_FORWARD_TO_PHONE",INFO_NODE_FORWARD_TO_RESOURCE:"INFO_NODE_FORWARD_TO_RESOURCE",INFO_NODE_GATHER_INPUT:"INFO_NODE_GATHER_INPUT",INFO_NODE_HANG_UP:"INFO_NODE_HANG_UP",INFO_NODE_OPTION_REMOVE:"INFO_NODE_OPTION_REMOVE",INFO_NODE_PLAY:"INFO_NODE_PLAY",INFO_NODE_RECORD_CALL_START:"INFO_NODE_RECORD_CALL_START",INFO_NODE_RECORD_CALL_STOP:"INFO_NODE_RECORD_CALL_STOP",INFO_NODE_RECORD:"INFO_NODE_RECORD",INFO_NODE_REQUEST:"INFO_NODE_REQUEST",INFO_NODE_SEND_SMS:"INFO_NODE_SEND_SMS",INFO_NODE_SET_VARIABLES_OPTION:"INFO_NODE_SET_VARIABLES_OPTION",INFO_NODE_SET_VARIABLES:"INFO_NODE_SET_VARIABLES",INFO_NODE_UNSET_VARIABLES:"INFO_NODE_UNSET_VARIABLES",INFO_STATUS_ERROR_OUT_OF_SYNC:"INFO_STATUS_ERROR_OUT_OF_SYNC",INFO_STATUS_ERROR:"INFO_STATUS_ERROR",INPUT:"INPUT",KEY:"KEY",LANGUAGE:"LANGUAGE",MALE:"MALE",METHOD:"METHOD",MORE_INFO_DEPLOY_ERROR:"MORE_INFO_DEPLOY_ERROR",MORE_INFO_DEPLOY:"MORE_INFO_DEPLOY",MORE_INFO_STATUS_ERROR:"MORE_INFO_STATUS_ERROR",MORE_INFO_TITLE:"MORE_INFO_TITLE",MULTIPLE_ADDRESSES:"MULTIPLE_ADDRESSES",MULTIPLE_NUMBERS:"MULTIPLE_NUMBERS",MULTIPLE_RESOURCES:"MULTIPLE_RESOURCES",NAVIGATE_BACK:"NAVIGATE_BACK",NO_ANSWER:"NO_ANSWER",NO_INPUT:"NO_INPUT",NO_VARIABLES_SET:"NO_VARIABLES_SET",NUMBER_OF_VARIABLES_SELECTED:"NUMBER_OF_VARIABLES_SELECTED",OFF:"OFF",ON:"ON",OPT_NUMBER:"OPT_NUMBER",OPTION_NUMBER:"OPTION_NUMBER",OPTIONAL:"OPTIONAL",OR_SAYS:"OR_SAYS",PHONE_NUMBER:"PHONE_NUMBER",PLAY_AUDIO_FILE:"PLAY_AUDIO_FILE",PLAY_AUDIO_TTS:"PLAY_AUDIO_TTS",REASON:"REASON",RECORD_CALL_START:"RECORD_CALL_START",RECORD_CALL_STOP:"RECORD_CALL_STOP",RECORD:"RECORD",RECORDING_NAME_DEFAULT:"RECORDING_NAME_DEFAULT",RECORDING_NAME:"RECORDING_NAME",RECORDING:"RECORDING",RELAYML_VERSION:"RELAYML_VERSION",REMOVE_CONDITION:"REMOVE_CONDITION",REMOVE_EDGE:"REMOVE_EDGE",REMOVE_NODE:"REMOVE_NODE",REMOVE_OPTION:"REMOVE_OPTION",REMOVE_VARIABLE:"REMOVE_VARIABLE",REQUEST_BODY:"REQUEST_BODY",REQUEST_HEADERS:"REQUEST_HEADERS",REQUEST:"REQUEST",RESYNC:"RESYNC",SAVE_VARIABLES_SUBTITLE:"SAVE_VARIABLES_SUBTITLE",SAVE_VARIABLES:"SAVE_VARIABLES",SECONDS:"SECONDS",SELECT_VARIABLES_TO_UNSET:"SELECT_VARIABLES_TO_UNSET",SELECT_VARIABLES:"SELECT_VARIABLES",SELECT:"SELECT",SEND_SMS:"SEND_SMS",SEQUENTIALLY:"SEQUENTIALLY",SET_VARIABLES:"SET_VARIABLES",SETTINGS:"SETTINGS",SIMULTANEOUSLY:"SIMULTANEOUSLY",SINGLE_ADDRESS:"SINGLE_ADDRESS",SINGLE_NUMBER:"SINGLE_NUMBER",SINGLE_RESOURCE:"SINGLE_RESOURCE",SMS_TEXT:"SMS_TEXT",STATUS_DEPLOY_ERROR:"STATUS_DEPLOY_ERROR",STATUS_DEPLOY:"STATUS_DEPLOY",STATUS_DEPLOYED:"STATUS_DEPLOYED",STATUS_DEPLOYING:"STATUS_DEPLOYING",STATUS_ERROR:"STATUS_ERROR",STATUS_LOADING:"STATUS_LOADING",STATUS_LOCKED:"STATUS_LOCKED",STATUS_SAVED:"STATUS_SAVED",STATUS_SAVING:"STATUS_SAVING",STEREO_SUBTITLE:"STEREO_SUBTITLE",STEREO:"STEREO",SUCCESS:"SUCCESS",TERMINATORS:"TERMINATORS",TEXT_TO_SPEECH:"TEXT_TO_SPEECH",TEXT:"TEXT",TO_PHONE_NUMBER:"TO_PHONE_NUMBER",TO:"TO",TOAST_DOCUMENT_OUT_OF_SYNC:"TOAST_DOCUMENT_OUT_OF_SYNC",UNKNOWN:"UNKNOWN",UNSET_VARIABLES:"UNSET_VARIABLES",URL:"URL",VALUE:"VALUE",VARIABLE_KEY:"VARIABLE_KEY",VOICE:"VOICE",VOICEMAIL_RECORDING:"VOICEMAIL_RECORDING",WAIT_FOR_INPUT:"WAIT_FOR_INPUT",WRITE_SOMETHING:"WRITE_SOMETHING"},uC={order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag","path","subdomain"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage","cookie"],excludeCacheFor:["cimode"]},cC={"en-US":{translation:lC}},dC=()=>{be.use(Py).use(aC).init({debug:Jx,detection:uC,fallbackLng:"en-US",interpolation:{escapeValue:!1},keySeparator:!1,resources:cC})};function b(e,t){return t?be.t(e,t):be.t(e)}const fC={entries:[],nextLabelIndex:0},Kn=Ii((e,t)=>({...fC,getEntries(){return t().entries},getEntryValue(n){var r;return(r=t().entries.find(o=>o.controlId===n))==null?void 0:r.label},getGeneratedLabel(){let n="";do this.nextLabelIndex++,n=b(x.RECORDING_NAME_DEFAULT,{index:this.nextLabelIndex});while(this.isValueDuplicate(n));return n},isKeyDuplicate(n){return t().entries.some(r=>r.controlId===n)},isValueDuplicate(n,r){const o=t().entries.reduce((i,s)=>{const{label:a,controlId:l}=s;return a!==""&&a===n&&(!r||l!==r)?[...i,s]:i},[]);return Boolean(o.length)},removeEntry(n){e(r=>({entries:r.entries.filter(o=>o.controlId!==n)}))},upsertEntry:n=>{e(r=>{let o=[...r.entries];const i=Boolean(n.label.trim());return(r.isKeyDuplicate(n.controlId)||!i)&&(o=o.filter(s=>s.controlId!==n.controlId)),i&&o.push({...n}),{entries:o}})}})),pC=e=>{const t=[];e.forEach(n=>{n.type==="recordCallStart"&&n.data.controlId&&n.data.label&&t.push({controlId:n.data.controlId,label:n.data.label})}),Kn.setState({entries:t,nextLabelIndex:t.length})},hC=(e,t)=>{const n=[];return t.forEach(r=>{r.type==="recordCallStart"&&r.data.controlId&&(n.push(r.data.controlId),Kn.getState().removeEntry(r.data.controlId))}),n.length?e.reduce((r,o)=>o.type==="recordCallStop"&&n.includes(o.data.controlId)?[...r,{...o,data:{...o.data,controlId:"",missingRequiredParams:!0}}]:r,[]):[]},Vy={recordCallStart:e=>{const t=Kn.getState().getGeneratedLabel();return Kn.getState().upsertEntry({controlId:e.data.controlId,label:t}),{...e,data:{...e.data,label:t}}}},gC=e=>iy[e]!==void 0,mC=e=>typeof e=="object"&&e!==null&&Object.keys(e).length>0,vC=e=>Vy[e.type]!==void 0,By=(e,t={})=>{const{deletable:n=!0,position:r={x:300,y:250},selected:o=!0}=t,i=()=>({id:Re(),type:e,position:r,deletable:n,data:{missingRequiredParams:!1},selected:o}),s=(l,u)=>({...l,data:{...l.data,...u,missingRequiredParams:!0}});let a=i();if(gC(e)){const l=iy[e]();mC(l)&&(a=s(a,l))}return vC(a)&&(a=Vy[a.type](a)),a},al={apiVersion:void 0,builderVersion:ey,cfbAppVersion:Jv,relayMLVersion:void 0},yC=e=>{const t={...al,...e};al.apiVersion=t.apiVersion,al.builderVersion=t.builderVersion,al.relayMLVersion=t.relayMLVersion},bd=()=>({apiVersion:void 0,builderVersion:ey,cfbAppVersion:Jv,relayMLVersion:void 0}),$y=1e3,Ad=Ze(),EC=e=>(t,n,r)=>{let o,i;const s=async()=>{const{httpService:a,nodes:l,edges:u,documentVersion:c}=n(),{builderVersion:d}=bd();Ad.debug("Saving data to server"),t({dataHandlingStatus:"saving",saveFlowStatus:"saving"}),clearTimeout(i);try{if(!a)throw new Error("Missing httpService");const h={documentVersion:(await a.putFlow({documentVersion:c,builderVersion:d,nodes:l,edges:u})).document_version};switch(n().dataHandlingStatus){case"saving":t({...h,dataHandlingStatus:"queueing",saveFlowStatus:"saved"});break;case"holding":t({...h,saveFlowStatus:"awaiting-save"}),Ad.debug("Setting up a new save for held changes"),i=setTimeout(()=>{s()},$y);break;default:Ad.debug("Saving data to server - invalid state")}}catch(f){console.error("Put Flow",f),f instanceof Error&&f.message.includes(eT)?t({dataHandlingStatus:"holding",flowInteractive:!1,httpError:"document-sync",saveFlowStatus:"error"}):t({dataHandlingStatus:"queueing",saveFlowStatus:"error"})}};return r.setState=(a,l,...u)=>{const{dataHandlingStatus:c,initializing:d}=n(),f=typeof a=="function"?a(n()):a;!d&&(f.nodes||f.edges)?c==="queueing"?(f.saveFlowStatus="awaiting-save",t(f,l,...u),clearTimeout(o),o=setTimeout(()=>{s()},$y)):(f.dataHandlingStatus="holding",t(f,l,...u)):"initializing"in f&&f.initializing!==d?(f.dataHandlingStatus="queueing",f.saveFlowStatus="saved",t(f,l,...u)):t(f,l,...u)},e(r.setState,n,r)},SC={variables:new Map,keyToIdMap:new Map},Er=Ii((e,t)=>({...SC,_dedupeKey(n,r){const o=Array.from(r.values()).find(i=>i.key===n);o&&r.delete(o.id)},isKeyDuplicate(n,r){const o=t().keyToIdMap.get(n);return o?o!==r:!1},removeVariable(n){e(r=>{const o=new Map(r.variables),i=new Map(r.keyToIdMap),s=o.get(n);return s&&(o.delete(n),i.delete(s.key)),{keyToIdMap:i,variables:o}})},setVariables:n=>{e(()=>{const r=new Map,o=new Map;return n.forEach(i=>{const s=o.get(i.key);s&&r.delete(s),r.set(i.id,i),o.set(i.key,i.id)}),{keyToIdMap:o,variables:r}})},upsertVariable:n=>{e(r=>{const o=new Map(r.variables),i=new Map(r.keyToIdMap),s=o.get(n.id),a=i.get(n.key);return a&&o.delete(a),s&&i.delete(s.key),o.set(n.id,n),i.set(n.key,n.id),{keyToIdMap:i,variables:o}})}})),_C=e=>{const t=[];e.forEach(n=>{n.type==="set"&&n.data.variables&&t.push(...n.data.variables)}),Er.getState().setVariables(t)},wC=e=>{if(e!=null&&e.length){const{removeVariable:t}=Er.getState();e.forEach(n=>{n.type==="set"&&n.data.variables&&n.data.variables.forEach(o=>t(o.id))})}},Se=Ze(),RC=By("handleCall",{position:{x:300,y:100},deletable:!1}),Zi={backButtonHref:void 0,colorMode:"light",dataHandlingStatus:"queueing",deployFlowURL:"",documentVersion:0,edges:[],flowId:"",flowInteractive:!0,flowTitle:"",getFlowURL:"",httpError:void 0,httpService:void 0,initializing:!0,isDraggingNode:!1,isEdgeConnecting:!1,isEdgeUpdateSuccessful:!1,nodes:[],reactFlowInstance:void 0,rootAppHeight:void 0,rootAppWidth:void 0,rootElementId:"",saveFlowStatus:"initial",selectedNode:void 0,updateFlowURL:"",updatingSourceHandleId:void 0},NC=(e,t)=>({...Zi,reset:()=>{Se.debug("Reset!"),e({nodes:[...Zi.nodes],edges:[...Zi.edges]})},deployFlow:async()=>{try{Se.info("Deploying...");const{httpService:n,documentVersion:r}=t();if(!n)throw new Error("Missing httpService");const o=await n.deployFlow({documentVersion:r});Se.info("Deploy response",o)}catch(n){throw Se.info("Deploy error",n),n}},exportStoreData:()=>{const{nodes:n,edges:r}=t();oT(n,r)},addNode:({nodeType:n,x:r=150,y:o=150})=>{Se.debug("Add Node",n);const{nodes:i,reactFlowInstance:s,flowInteractive:a}=t();if(!a){Se.debug("Flow is not interactive, not adding node");return}if(!s)throw new Error("ReactFlowInstance not found");const l=By(n,{position:s.project({x:r,y:o})}),u=i.map(c=>({...c,selected:!1}));u.push(l),e({nodes:u,selectedNode:l})},getNodeEdges:n=>t().edges.filter(r=>r.source===n),getTargetEdges:n=>t().edges.filter(r=>r.target===n),partialUpdateNodeData:(n,r)=>{var s;if(Se.debug("partialUpdateNodeData",n,r),!t().flowInteractive){Se.debug("Flow is not interactive, not updating node data");return}const o=[],i=t().nodes.map(a=>{if(a.id===n){if("options"in r&&"options"in a.data){const l=a.data.options.map(c=>c.id),u=r.options.map(c=>c.id);o.push(...l.filter(c=>!u.includes(c)))}return{...a,data:{...a.data,...r}}}return a});if(o.length){const a=t().edges.filter(l=>l.sourceHandle&&o.includes(l.sourceHandle));Se.debug("Remove orphaned edges",{sourceHandleDeleted:o,edgesToDelete:a}),(s=t().reactFlowInstance)==null||s.deleteElements({edges:a})}e({nodes:i})},removeNode:n=>{Se.debug("removeNode",n);const r=t().reactFlowInstance;r&&r.deleteElements({nodes:[{id:n}]})},removeEdge:n=>{Se.debug("removeEdge",n);const r=t().reactFlowInstance;r&&r.deleteElements({edges:[{id:n}]})},onInit:async n=>{const{getFlowURL:r,updateFlowURL:o,deployFlowURL:i}=t();Se.log("onInit",{getFlowURL:r,updateFlowURL:o});try{const s=tw({getFlowURL:r,deployFlowURL:i,updateFlowURL:o,headers:rT()}),a=bd(),{id:l,title:u,document_version:c,flow_data:d}=await s.getFlow();let f=d;f||(f={apiVersion:a.apiVersion,builderVersion:a.builderVersion,relayMLVersion:a.relayMLVersion,edges:Zi.edges,nodes:Zi.nodes.concat([RC])}),e({httpService:s,reactFlowInstance:n,flowId:l,flowTitle:u,documentVersion:c,nodes:f.nodes.map(aT),edges:f.edges.map(sT)}),yC({apiVersion:f.apiVersion,builderVersion:f.builderVersion,relayMLVersion:f.relayMLVersion}),_C(f.nodes),pC(f.nodes)}catch(s){Se.error("Could not load flow. URL:",r);let a="unknown";s instanceof Error&&s.message.includes(tT)&&(a="not-found"),e({httpError:a})}},onNodeDragStart:()=>{e({isDraggingNode:!0})},onNodeDragStop:()=>{e({isDraggingNode:!1})},onNodesChange:n=>{e({nodes:Vv(n,t().nodes)})},onNodesDelete:n=>{Se.debug("onNodesDelete"),wC(n),hC(t().nodes,n).forEach(o=>{ee.getState().partialUpdateNodeData(o.id,o.data)})},onEdgesChange:n=>{e({edges:ax(n,t().edges)})},onEdgesDelete:n=>{Se.debug("onEdgesDelete [noop]",n)},onConnect:n=>{Se.debug("onConnect"),e({edges:Jm(n,t().edges)})},onConnectStart:()=>{Se.debug("onConnectStart"),e({isEdgeConnecting:!0})},onConnectEnd:()=>{Se.debug("onConnectEnd"),e({isEdgeConnecting:!1})},onEdgeUpdateStart:(n,r)=>{Se.debug("onEdgeUpdateStart"),e({isEdgeUpdateSuccessful:!1,updatingSourceHandleId:r.sourceHandle??void 0})},onEdgeUpdate:(n,r)=>{Se.debug("onEdgeUpdate"),e({edges:EO(n,r,t().edges),isEdgeUpdateSuccessful:!0})},onEdgeUpdateEnd:(n,r)=>{var o;Se.debug("onEdgeUpdateEnd"),t().isEdgeUpdateSuccessful?e({isEdgeUpdateSuccessful:!0}):(o=t().reactFlowInstance)==null||o.deleteElements({edges:[{id:r.id}]}),e({updatingSourceHandleId:void 0})},onSelectionChange:({nodes:n})=>{e({selectedNode:n.find(r=>r.selected)})},setColorMode:n=>{e({colorMode:n})}}),ee=Ii()(EC(NC));window.__useRFStore=ee;const OC={"not-found":{title:"Call Flow not found",message:"Please ensure that the Call Flow exists and the URL is correct.",status:"404"},unknown:{title:"Unknown error",message:"An unknown error occurred. Please try again or go back.",status:""}},xC=({errorType:e})=>{const t=ee(i=>i.backButtonHref),{title:n,message:r,status:o}=OC[e];return E("section",{className:"flex min-h-full w-full items-center justify-center bg-background px-6",children:k("div",{className:"text-center",children:[o&&E("p",{className:"text-2xl font-semibold text-foreground/50",children:o}),E("h1",{className:"mt-4 text-3xl font-bold tracking-tight text-foreground",children:n}),E("p",{className:"mt-6 leading-7 text-foreground",children:r}),t&&E("div",{className:"mt-8 flex items-center justify-center gap-x-6",children:E("a",{href:t,className:"rounded-md bg-foreground px-3.5 py-2.5 text-sm font-semibold text-background shadow-sm transition-colors hover:bg-foreground/80 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-foreground",children:b(x.GO_BACK)})})]})})},Dk="";function TC({fromNode:e,fromPosition:t,fromX:n,fromY:r,toX:o,toY:i}){if(!e)return null;const[s]=ji({borderRadius:20,sourceX:n,sourceY:r,sourcePosition:t,targetPosition:Y.Top,targetX:o,targetY:i});return k("g",{children:[E("path",{fill:"none",stroke:"#222",strokeWidth:1.5,className:"animated",d:s}),E("circle",{cx:o,cy:i,fill:"#fff",r:3,stroke:"#222",strokeWidth:1.5})]})}const Ji=40;function CC(e,t,n,r=0,o=!1){const{width:i,height:s,position:a}=n,l=i??0,u=s??0,c=l/2,d=u/2;if(o)return{tx:a.x,ty:a.y+d};const f=a.x+c,h=a.y+d,m=e,v=t,y=(m-f)/l-(v-h)/u,p=(m-f)/u+(v-h)/u,g=1/(Math.abs(y)+Math.abs(p)),S=g*y,_=g*p,w=c*(S+_)+f;return{tx:Math.min(Math.max(w,a.x+r),a.x+l-r),ty:a.y}}const IC=({isCircular:e,sourceX:t,labelX:n,sourceY:r,labelY:o})=>e?{x:t-Ji*1.5,y:r}:{x:n-Ji/2,y:o-Ji/2};function bC(e){const{id:t,source:n,target:r,sourcePosition:o,sourceX:i,sourceY:s}=e,a=ee(p=>p.removeEdge),l=le(N.useCallback(p=>p.nodeInternals.get(n),[n])),u=le(N.useCallback(p=>p.nodeInternals.get(r),[r]));if(!l||!u)return null;const c=n===r,{tx:d,ty:f}=CC(i,s,u,20,c),[h,m,v]=ji({borderRadius:20,sourceX:i,sourceY:s,sourcePosition:o,targetPosition:c?Y.Left:Y.Top,targetX:d,targetY:f}),y=(p,g)=>{p.stopPropagation(),a(g)};return k("g",{className:"group",children:[E(So,{path:h,...e}),E("foreignObject",{width:Ji,height:Ji,className:"hidden group-hover:block",requiredExtensions:"http://www.w3.org/1999/xhtml",...IC({isCircular:c,sourceX:i,labelX:m,sourceY:s,labelY:v}),children:E("div",{className:"h-10 w-10",children:k("button",{className:"flex h-10 w-10 cursor-pointer items-center justify-center rounded-full border border-foreground/10 bg-backgroundAlt",onClick:p=>y(p,t),children:[E(Fe,{tag:"trash-can",className:"text-negative"}),E("span",{className:"sr-only",children:b(x.REMOVE_EDGE)})]})})})]})}var AC={prefix:"fas",iconName:"trash-can",icon:[448,512,[61460,"trash-alt"],"f2ed","M135.2 17.7C140.6 6.8 151.7 0 163.8 0H284.2c12.1 0 23.2 6.8 28.6 17.7L320 32h96c17.7 0 32 14.3 32 32s-14.3 32-32 32H32C14.3 96 0 81.7 0 64S14.3 32 32 32h96l7.2-14.3zM32 128H416V448c0 35.3-28.7 64-64 64H96c-35.3 0-64-28.7-64-64V128zm96 64c-8.8 0-16 7.2-16 16V432c0 8.8 7.2 16 16 16s16-7.2 16-16V208c0-8.8-7.2-16-16-16zm96 0c-8.8 0-16 7.2-16 16V432c0 8.8 7.2 16 16 16s16-7.2 16-16V208c0-8.8-7.2-16-16-16zm96 0c-8.8 0-16 7.2-16 16V432c0 8.8 7.2 16 16 16s16-7.2 16-16V208c0-8.8-7.2-16-16-16z"]},LC={prefix:"fas",iconName:"circle-exclamation",icon:[512,512,["exclamation-circle"],"f06a","M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm0-384c13.3 0 24 10.7 24 24V264c0 13.3-10.7 24-24 24s-24-10.7-24-24V152c0-13.3 10.7-24 24-24zM224 352a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z"]},DC={prefix:"fas",iconName:"arrow-left",icon:[448,512,[8592],"f060","M9.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L109.2 288 416 288c17.7 0 32-14.3 32-32s-14.3-32-32-32l-306.7 0L214.6 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-160 160z"]},kC={prefix:"fas",iconName:"circle-info",icon:[512,512,["info-circle"],"f05a","M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM216 336h24V272H216c-13.3 0-24-10.7-24-24s10.7-24 24-24h48c13.3 0 24 10.7 24 24v88h8c13.3 0 24 10.7 24 24s-10.7 24-24 24H216c-13.3 0-24-10.7-24-24s10.7-24 24-24zm40-208a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]},PC={prefix:"fas",iconName:"xmark",icon:[320,512,[128473,10005,10006,10060,215,"close","multiply","remove","times"],"f00d","M310.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L160 210.7 54.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L114.7 256 9.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L160 301.3 265.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L205.3 256 310.6 150.6z"]},MC={prefix:"fas",iconName:"up-from-bracket",icon:[448,512,[],"e590","M73.9 134.1L196.7 11.3C203.9 4.1 213.8 0 224 0s20.1 4.1 27.3 11.3L374.1 134.1c6.4 6.4 9.9 15 9.9 24c0 18.7-15.2 33.9-33.9 33.9H288V320c0 17.7-14.3 32-32 32H192c-17.7 0-32-14.3-32-32V192H97.9C79.2 192 64 176.8 64 158.1c0-9 3.6-17.6 9.9-24zM64 352v64c0 17.7 14.3 32 32 32H352c17.7 0 32-14.3 32-32V352c0-17.7 14.3-32 32-32s32 14.3 32 32v64c0 53-43 96-96 96H96c-53 0-96-43-96-96V352c0-17.7 14.3-32 32-32s32 14.3 32 32z"]};const UC={"arrow-left":DC,"circle-exclamation":LC,"circle-info":kC,"up-from-bracket":MC,"trash-can":AC,xmark:PC},Fe=N.forwardRef(function({className:t="",size:n="",tag:r},o){const i=UC[r];return i?E("svg",{"aria-hidden":"true","data-prefix":i.prefix,"data-icon":r,className:`svg-inline--fa fa-${r} ${n?`fa-${n}`:""} ${t}`,focusable:"false",ref:o,role:"img",viewBox:`0 0 ${i.icon[0]} ${i.icon[1]}`,xmlns:"http://www.w3.org/2000/svg",children:E("path",{d:i.icon[4],fill:"currentColor"})}):(Ze().debug(`Unknown icon: ${r}`),null)}),FC=({isSelected:e,nodeId:t,nodeTitle:n,showDelete:r})=>{const o=ee(l=>l.removeNode),i=ee(l=>l.isEdgeConnecting);return k("div",{className:"flex w-full items-center justify-between p-4",children:[E("h2",{className:`text-lg font-semibold leading-6 ${e?"text-primary":""}`,children:n}),r&&!i&&k("button",{className:"opacity-0 transition-opacity group-hover/node-wrapper:opacity-100",onClick:()=>{o(t)},children:[E(Fe,{tag:"trash-can",className:"text-negative"}),E("span",{className:"sr-only",children:b(x.REMOVE_NODE,{title:n})})]})]})},VC=({id:e,missingRequiredEntry:t})=>{const n=ee(i=>i.getTargetEdges),[r,o]=N.useState(!1);return N.useEffect(()=>{const i=()=>n(e).length===0;o(i());const s=ee.subscribe((a,l)=>{a.edges.length!==l.edges.length&&o(i()),a.nodes.length!==l.nodes.length&&o(i()),a.isEdgeUpdateSuccessful!==l.isEdgeUpdateSuccessful&&o(i())});return()=>s()},[e,n]),r||t?k("div",{className:"flex flex-col gap-y-6 px-4 pb-4 text-sm italic leading-4",children:[r&&E("p",{children:"Not Connected to Flow"}),t&&E("p",{children:"Missing Required Entry"})]}):null},BC=({id:e,isConnectable:t})=>{if(!e)throw new Error("TargetHandle: id is required");return E(Ro,{type:"target",id:`target-${e}`,position:Y.Top,isConnectable:t,className:"mt-1 h-4 w-full rounded-none rounded-t-md border-none bg-primary opacity-0 transition-opacity hover:opacity-100"})},Ge=({children:e,id:t,isConnectable:n=!0,missingRequiredEntry:r,nodeTitle:o,selected:i,showDelete:s,showValidation:a=!0,target:l=!0})=>k("section",{className:`${i?"shadow-xl":""} group/node-wrapper min-w-[300px] rounded-lg border border-foreground/10 bg-background transition-[visibility]`,children:[l&&t&&E(BC,{id:t,isConnectable:n}),E(FC,{nodeId:t,isSelected:i,nodeTitle:o,showDelete:s}),a&&E(VC,{id:t,missingRequiredEntry:r??!1}),e]}),$C=({children:e,handleClick:t,...n})=>E("li",{role:"presentation",children:k("div",{className:"flex items-center gap-2 rounded-lg bg-secondary p-2 pr-1",role:"option","aria-selected":"true",tabIndex:0,children:[E("span",{className:"text-sm text-foreground",children:e}),k("button",{className:" px-1",onClick:t,onKeyDown:o=>{(o.key==="Backspace"||o.key==="Delete")&&(o.stopPropagation(),t==null||t())},type:"button",...n,children:[E("span",{className:"sr-only",children:"Remove"}),E(Fe,{tag:"xmark",size:"xs"})]})]})}),Mt=e=>E("div",{className:"relative after:absolute after:right-3 after:top-3 after:h-[7px] after:w-[7px] after:rotate-45 after:border-r after:border-b after:border-foreground after:content-['']",children:E("select",{className:"pr-8",...e,children:e.children})}),HC={disabled:"border-disabled cursor-not-allowed",negative:"border-negative hover:bg-negative",positive:"border-positive hover:bg-positive"},Xt=({color:e="positive",enabled:t=!0,id:n,isConnectable:r,position:o=Y.Bottom,positionClasses:i="-bottom-2.5"})=>{if(!n)throw new Error("SourceHandle: id is required");const s=t?e:"disabled",a=ee(f=>f.updatingSourceHandleId),c=!ee(f=>f.edges.some(h=>h.sourceHandle===n))||a===n;return E("div",{className:`absolute top-auto left-1/2 h-5 w-5 -translate-x-1/2 rounded-full ${i} ${c&&r&&t?"":"nodrag cursor-not-allowed"}`,children:E(Ro,{className:`bottom-0 h-full w-full border-[3px] bg-background transition-colors ${HC[s]??""}`,id:n,isConnectable:c&&r&&t,position:o,type:"source"})})},es=({children:e})=>E("div",{className:"divide-foreground/10 flex w-full items-center divide-x",children:e}),mn=({color:e="positive",enabled:t=!0,id:n,isConnectable:r,optionText:o,position:i=Y.Bottom,positionClasses:s="-bottom-2.5"})=>k("div",{className:"relative w-full min-w-[104px] whitespace-nowrap border-t border-foreground/10 py-4",children:[E("div",{className:"flex flex-col items-center justify-center",children:E("p",{className:`${t?"":"text-disabled"} min-h-[1rem] text-sm leading-4`,children:o})}),E(Xt,{color:e,enabled:t,id:n,isConnectable:r,position:i,positionClasses:s})]}),zC=({checked:e=!1,name:t,onClick:n})=>k("button",{name:t,onClick:n,type:"button",className:`${e?"bg-primary":"bg-secondary"} relative inline-flex h-6 w-11 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out`,role:"switch","aria-checked":e?"true":"false",children:[E("span",{className:"sr-only",children:b(e?x.ON:x.OFF)}),E("span",{className:`pointer-events-none inline-block h-5 w-5 ${e?"translate-x-5":"translate-x-0"} transform rounded-full bg-white shadow transition duration-200 ease-in-out`})]}),Ld=({checked:e,clickHandler:t,name:n,subtitle:r,title:o})=>k("div",{className:"mb-2 flex items-center justify-between",children:[k("div",{className:"flex flex-grow flex-col",children:[E("span",{className:"text-base font-medium leading-6 text-foreground",children:o}),r&&E("span",{className:"text-xs text-foreground/50",children:r})]}),E(zC,{checked:e,name:n,onClick:t})]}),Sr=({errorText:e,label:t,name:n,onChange:r,required:o,valid:i,value:s,...a})=>k("label",{children:[E("span",{className:"sr-only",children:t}),E("textarea",{"aria-invalid":i?void 0:"true",className:`peer min-h-[77px] w-full resize-none ${i?"":"invalid"}`,inputMode:"text",minLength:1,name:n,onChange:r,required:o,value:s,...a}),E("p",{className:"requirements",role:"alert",children:e})]});/*!
60
+ */var Ia=N,pw=Uc;function hw(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var gw=typeof Object.is=="function"?Object.is:hw,mw=pw.useSyncExternalStore,vw=Ia.useRef,yw=Ia.useEffect,Ew=Ia.useMemo,Sw=Ia.useDebugValue;Bg.useSyncExternalStoreWithSelector=function(e,t,n,r,o){var i=vw(null);if(i.current===null){var s={hasValue:!1,value:null};i.current=s}else s=i.current;i=Ew(function(){function l(h){if(!u){if(u=!0,c=h,h=r(h),o!==void 0&&s.hasValue){var m=s.value;if(o(m,h))return d=m}return d=h}if(m=d,gw(c,h))return m;var v=r(h);return o!==void 0&&o(m,v)?m:(c=h,d=v)}var u=!1,c,d,f=n===void 0?null:n;return[function(){return l(t())},f===null?void 0:function(){return l(f())}]},[t,n,r,o]);var a=mw(e,i[0],i[1]);return yw(function(){s.hasValue=!0,s.value=a},[a]),Sw(a),a},function(e){e.exports=Bg}(nw);const _w=hf(Mc),{useSyncExternalStoreWithSelector:ww}=_w;function Hg(e,t=e.getState,n){const r=ww(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return N.useDebugValue(r),r}const zg=e=>{var t;((t={VITE_BASE_URL:"",VITE_BASIC_AUTH:"signalwire:1aG93uXk",VITE_DEFAULT_STYLE_HREF:"https://cdn.swire.io/npm/@signalwire/cfb@dev/dist/style.css",VITE_DEFAULT_VOICES_URL:"https://cdn.signalwire.com/npm/@signalwire/cfb@dev/dist/voices.json",BASE_URL:"/cfb/",MODE:"staging",DEV:!1,PROD:!0,SSR:!1})==null?void 0:t.MODE)!=="production"&&typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const n=typeof e=="function"?Vg(e):e,r=(o,i)=>Hg(n,o,i);return Object.assign(r,n),r},Ii=e=>e?zg(e):zg;function ze(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[r,o]of e)if(!Object.is(o,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(let r=0;r<n.length;r++)if(!Object.prototype.hasOwnProperty.call(t,n[r])||!Object.is(e[n[r]],t[n[r]]))return!1;return!0}var Rw={value:()=>{}};function ba(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new Aa(n)}function Aa(e){this._=e}function Nw(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",o=n.indexOf(".");if(o>=0&&(r=n.slice(o+1),n=n.slice(0,o)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}Aa.prototype=ba.prototype={constructor:Aa,on:function(e,t){var n=this._,r=Nw(e+"",n),o,i=-1,s=r.length;if(arguments.length<2){for(;++i<s;)if((o=(e=r[i]).type)&&(o=Ow(n[o],e.name)))return o;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++i<s;)if(o=(e=r[i]).type)n[o]=jg(n[o],e.name,t);else if(t==null)for(o in n)n[o]=jg(n[o],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Aa(e)},call:function(e,t){if((o=arguments.length-2)>0)for(var n=new Array(o),r=0,o,i;r<o;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(i=this._[e],r=0,o=i.length;r<o;++r)i[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],o=0,i=r.length;o<i;++o)r[o].value.apply(t,n)}};function Ow(e,t){for(var n=0,r=e.length,o;n<r;++n)if((o=e[n]).name===t)return o.value}function jg(e,t,n){for(var r=0,o=e.length;r<o;++r)if(e[r].name===t){e[r]=Rw,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var Vc="http://www.w3.org/1999/xhtml";const Gg={svg:"http://www.w3.org/2000/svg",xhtml:Vc,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function La(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),Gg.hasOwnProperty(t)?{space:Gg[t],local:e}:e}function xw(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Vc&&t.documentElement.namespaceURI===Vc?t.createElement(e):t.createElementNS(n,e)}}function Tw(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Yg(e){var t=La(e);return(t.local?Tw:xw)(t)}function Cw(){}function Bc(e){return e==null?Cw:function(){return this.querySelector(e)}}function Iw(e){typeof e!="function"&&(e=Bc(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var i=t[o],s=i.length,a=r[o]=new Array(s),l,u,c=0;c<s;++c)(l=i[c])&&(u=e.call(l,l.__data__,c,i))&&("__data__"in l&&(u.__data__=l.__data__),a[c]=u);return new ut(r,this._parents)}function bw(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function Aw(){return[]}function Wg(e){return e==null?Aw:function(){return this.querySelectorAll(e)}}function Lw(e){return function(){return bw(e.apply(this,arguments))}}function Dw(e){typeof e=="function"?e=Lw(e):e=Wg(e);for(var t=this._groups,n=t.length,r=[],o=[],i=0;i<n;++i)for(var s=t[i],a=s.length,l,u=0;u<a;++u)(l=s[u])&&(r.push(e.call(l,l.__data__,u,s)),o.push(l));return new ut(r,o)}function Kg(e){return function(){return this.matches(e)}}function Qg(e){return function(t){return t.matches(e)}}var kw=Array.prototype.find;function Pw(e){return function(){return kw.call(this.children,e)}}function Mw(){return this.firstElementChild}function Uw(e){return this.select(e==null?Mw:Pw(typeof e=="function"?e:Qg(e)))}var Fw=Array.prototype.filter;function Vw(){return Array.from(this.children)}function Bw(e){return function(){return Fw.call(this.children,e)}}function $w(e){return this.selectAll(e==null?Vw:Bw(typeof e=="function"?e:Qg(e)))}function Hw(e){typeof e!="function"&&(e=Kg(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var i=t[o],s=i.length,a=r[o]=[],l,u=0;u<s;++u)(l=i[u])&&e.call(l,l.__data__,u,i)&&a.push(l);return new ut(r,this._parents)}function Xg(e){return new Array(e.length)}function zw(){return new ut(this._enter||this._groups.map(Xg),this._parents)}function Da(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Da.prototype={constructor:Da,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function jw(e){return function(){return e}}function Gw(e,t,n,r,o,i){for(var s=0,a,l=t.length,u=i.length;s<u;++s)(a=t[s])?(a.__data__=i[s],r[s]=a):n[s]=new Da(e,i[s]);for(;s<l;++s)(a=t[s])&&(o[s]=a)}function Yw(e,t,n,r,o,i,s){var a,l,u=new Map,c=t.length,d=i.length,f=new Array(c),h;for(a=0;a<c;++a)(l=t[a])&&(f[a]=h=s.call(l,l.__data__,a,t)+"",u.has(h)?o[a]=l:u.set(h,l));for(a=0;a<d;++a)h=s.call(e,i[a],a,i)+"",(l=u.get(h))?(r[a]=l,l.__data__=i[a],u.delete(h)):n[a]=new Da(e,i[a]);for(a=0;a<c;++a)(l=t[a])&&u.get(f[a])===l&&(o[a]=l)}function Ww(e){return e.__data__}function Kw(e,t){if(!arguments.length)return Array.from(this,Ww);var n=t?Yw:Gw,r=this._parents,o=this._groups;typeof e!="function"&&(e=jw(e));for(var i=o.length,s=new Array(i),a=new Array(i),l=new Array(i),u=0;u<i;++u){var c=r[u],d=o[u],f=d.length,h=Qw(e.call(c,c&&c.__data__,u,r)),m=h.length,v=a[u]=new Array(m),y=s[u]=new Array(m),p=l[u]=new Array(f);n(c,d,v,y,p,h,t);for(var g=0,S=0,_,w;g<m;++g)if(_=v[g]){for(g>=S&&(S=g+1);!(w=y[S])&&++S<m;);_._next=w||null}}return s=new ut(s,r),s._enter=a,s._exit=l,s}function Qw(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Xw(){return new ut(this._exit||this._groups.map(Xg),this._parents)}function qw(e,t,n){var r=this.enter(),o=this,i=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(o=t(o),o&&(o=o.selection())),n==null?i.remove():n(i),r&&o?r.merge(o).order():o}function Zw(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,o=n.length,i=r.length,s=Math.min(o,i),a=new Array(o),l=0;l<s;++l)for(var u=n[l],c=r[l],d=u.length,f=a[l]=new Array(d),h,m=0;m<d;++m)(h=u[m]||c[m])&&(f[m]=h);for(;l<o;++l)a[l]=n[l];return new ut(a,this._parents)}function Jw(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],o=r.length-1,i=r[o],s;--o>=0;)(s=r[o])&&(i&&s.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(s,i),i=s);return this}function e1(e){e||(e=t1);function t(d,f){return d&&f?e(d.__data__,f.__data__):!d-!f}for(var n=this._groups,r=n.length,o=new Array(r),i=0;i<r;++i){for(var s=n[i],a=s.length,l=o[i]=new Array(a),u,c=0;c<a;++c)(u=s[c])&&(l[c]=u);l.sort(t)}return new ut(o,this._parents).order()}function t1(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function n1(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function r1(){return Array.from(this)}function o1(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],o=0,i=r.length;o<i;++o){var s=r[o];if(s)return s}return null}function i1(){let e=0;for(const t of this)++e;return e}function s1(){return!this.node()}function a1(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var o=t[n],i=0,s=o.length,a;i<s;++i)(a=o[i])&&e.call(a,a.__data__,i,o);return this}function l1(e){return function(){this.removeAttribute(e)}}function u1(e){return function(){this.removeAttributeNS(e.space,e.local)}}function c1(e,t){return function(){this.setAttribute(e,t)}}function d1(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function f1(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function p1(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function h1(e,t){var n=La(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?u1:l1:typeof t=="function"?n.local?p1:f1:n.local?d1:c1)(n,t))}function qg(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function g1(e){return function(){this.style.removeProperty(e)}}function m1(e,t,n){return function(){this.style.setProperty(e,t,n)}}function v1(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function y1(e,t,n){return arguments.length>1?this.each((t==null?g1:typeof t=="function"?v1:m1)(e,t,n??"")):go(this.node(),e)}function go(e,t){return e.style.getPropertyValue(t)||qg(e).getComputedStyle(e,null).getPropertyValue(t)}function E1(e){return function(){delete this[e]}}function S1(e,t){return function(){this[e]=t}}function _1(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function w1(e,t){return arguments.length>1?this.each((t==null?E1:typeof t=="function"?_1:S1)(e,t)):this.node()[e]}function Zg(e){return e.trim().split(/^|\s+/)}function $c(e){return e.classList||new Jg(e)}function Jg(e){this._node=e,this._names=Zg(e.getAttribute("class")||"")}Jg.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function em(e,t){for(var n=$c(e),r=-1,o=t.length;++r<o;)n.add(t[r])}function tm(e,t){for(var n=$c(e),r=-1,o=t.length;++r<o;)n.remove(t[r])}function R1(e){return function(){em(this,e)}}function N1(e){return function(){tm(this,e)}}function O1(e,t){return function(){(t.apply(this,arguments)?em:tm)(this,e)}}function x1(e,t){var n=Zg(e+"");if(arguments.length<2){for(var r=$c(this.node()),o=-1,i=n.length;++o<i;)if(!r.contains(n[o]))return!1;return!0}return this.each((typeof t=="function"?O1:t?R1:N1)(n,t))}function T1(){this.textContent=""}function C1(e){return function(){this.textContent=e}}function I1(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function b1(e){return arguments.length?this.each(e==null?T1:(typeof e=="function"?I1:C1)(e)):this.node().textContent}function A1(){this.innerHTML=""}function L1(e){return function(){this.innerHTML=e}}function D1(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function k1(e){return arguments.length?this.each(e==null?A1:(typeof e=="function"?D1:L1)(e)):this.node().innerHTML}function P1(){this.nextSibling&&this.parentNode.appendChild(this)}function M1(){return this.each(P1)}function U1(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function F1(){return this.each(U1)}function V1(e){var t=typeof e=="function"?e:Yg(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function B1(){return null}function $1(e,t){var n=typeof e=="function"?e:Yg(e),r=t==null?B1:typeof t=="function"?t:Bc(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function H1(){var e=this.parentNode;e&&e.removeChild(this)}function z1(){return this.each(H1)}function j1(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function G1(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Y1(e){return this.select(e?G1:j1)}function W1(e){return arguments.length?this.property("__data__",e):this.node().__data__}function K1(e){return function(t){e.call(this,t,this.__data__)}}function Q1(e){return e.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");return r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function X1(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,o=t.length,i;n<o;++n)i=t[n],(!e.type||i.type===e.type)&&i.name===e.name?this.removeEventListener(i.type,i.listener,i.options):t[++r]=i;++r?t.length=r:delete this.__on}}}function q1(e,t,n){return function(){var r=this.__on,o,i=K1(t);if(r){for(var s=0,a=r.length;s<a;++s)if((o=r[s]).type===e.type&&o.name===e.name){this.removeEventListener(o.type,o.listener,o.options),this.addEventListener(o.type,o.listener=i,o.options=n),o.value=t;return}}this.addEventListener(e.type,i,n),o={type:e.type,name:e.name,value:t,listener:i,options:n},r?r.push(o):this.__on=[o]}}function Z1(e,t,n){var r=Q1(e+""),o,i=r.length,s;if(arguments.length<2){var a=this.node().__on;if(a){for(var l=0,u=a.length,c;l<u;++l)for(o=0,c=a[l];o<i;++o)if((s=r[o]).type===c.type&&s.name===c.name)return c.value}return}for(a=t?q1:X1,o=0;o<i;++o)this.each(a(r[o],t,n));return this}function nm(e,t,n){var r=qg(e),o=r.CustomEvent;typeof o=="function"?o=new o(t,n):(o=r.document.createEvent("Event"),n?(o.initEvent(t,n.bubbles,n.cancelable),o.detail=n.detail):o.initEvent(t,!1,!1)),e.dispatchEvent(o)}function J1(e,t){return function(){return nm(this,e,t)}}function eR(e,t){return function(){return nm(this,e,t.apply(this,arguments))}}function tR(e,t){return this.each((typeof t=="function"?eR:J1)(e,t))}function*nR(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],o=0,i=r.length,s;o<i;++o)(s=r[o])&&(yield s)}var rm=[null];function ut(e,t){this._groups=e,this._parents=t}function bi(){return new ut([[document.documentElement]],rm)}function rR(){return this}ut.prototype=bi.prototype={constructor:ut,select:Iw,selectAll:Dw,selectChild:Uw,selectChildren:$w,filter:Hw,data:Kw,enter:zw,exit:Xw,join:qw,merge:Zw,selection:rR,order:Jw,sort:e1,call:n1,nodes:r1,node:o1,size:i1,empty:s1,each:a1,attr:h1,style:y1,property:w1,classed:x1,text:b1,html:k1,raise:M1,lower:F1,append:V1,insert:$1,remove:z1,clone:Y1,datum:W1,on:Z1,dispatch:tR,[Symbol.iterator]:nR};function At(e){return typeof e=="string"?new ut([[document.querySelector(e)]],[document.documentElement]):new ut([[e]],rm)}function oR(e){let t;for(;t=e.sourceEvent;)e=t;return e}function jt(e,t){if(e=oR(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var o=t.getBoundingClientRect();return[e.clientX-o.left-t.clientLeft,e.clientY-o.top-t.clientTop]}}return[e.pageX,e.pageY]}const iR={passive:!1},Ai={capture:!0,passive:!1};function Hc(e){e.stopImmediatePropagation()}function mo(e){e.preventDefault(),e.stopImmediatePropagation()}function om(e){var t=e.document.documentElement,n=At(e).on("dragstart.drag",mo,Ai);"onselectstart"in t?n.on("selectstart.drag",mo,Ai):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function im(e,t){var n=e.document.documentElement,r=At(e).on("dragstart.drag",null);t&&(r.on("click.drag",mo,Ai),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const ka=e=>()=>e;function zc(e,{sourceEvent:t,subject:n,target:r,identifier:o,active:i,x:s,y:a,dx:l,dy:u,dispatch:c}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:o,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:s,enumerable:!0,configurable:!0},y:{value:a,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:c}})}zc.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function sR(e){return!e.ctrlKey&&!e.button}function aR(){return this.parentNode}function lR(e,t){return t??{x:e.x,y:e.y}}function uR(){return navigator.maxTouchPoints||"ontouchstart"in this}function cR(){var e=sR,t=aR,n=lR,r=uR,o={},i=ba("start","drag","end"),s=0,a,l,u,c,d=0;function f(_){_.on("mousedown.drag",h).filter(r).on("touchstart.drag",y).on("touchmove.drag",p,iR).on("touchend.drag touchcancel.drag",g).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function h(_,w){if(!(c||!e.call(this,_,w))){var R=S(this,t.call(this,_,w),_,w,"mouse");R&&(At(_.view).on("mousemove.drag",m,Ai).on("mouseup.drag",v,Ai),om(_.view),Hc(_),u=!1,a=_.clientX,l=_.clientY,R("start",_))}}function m(_){if(mo(_),!u){var w=_.clientX-a,R=_.clientY-l;u=w*w+R*R>d}o.mouse("drag",_)}function v(_){At(_.view).on("mousemove.drag mouseup.drag",null),im(_.view,u),mo(_),o.mouse("end",_)}function y(_,w){if(e.call(this,_,w)){var R=_.changedTouches,C=t.call(this,_,w),L=R.length,B,I;for(B=0;B<L;++B)(I=S(this,C,_,w,R[B].identifier,R[B]))&&(Hc(_),I("start",_,R[B]))}}function p(_){var w=_.changedTouches,R=w.length,C,L;for(C=0;C<R;++C)(L=o[w[C].identifier])&&(mo(_),L("drag",_,w[C]))}function g(_){var w=_.changedTouches,R=w.length,C,L;for(c&&clearTimeout(c),c=setTimeout(function(){c=null},500),C=0;C<R;++C)(L=o[w[C].identifier])&&(Hc(_),L("end",_,w[C]))}function S(_,w,R,C,L,B){var I=i.copy(),V=jt(B||R,w),$,F,O;if((O=n.call(_,new zc("beforestart",{sourceEvent:R,target:f,identifier:L,active:s,x:V[0],y:V[1],dx:0,dy:0,dispatch:I}),C))!=null)return $=O.x-V[0]||0,F=O.y-V[1]||0,function M(D,A,T){var P=V,U;switch(D){case"start":o[L]=M,U=s++;break;case"end":delete o[L],--s;case"drag":V=jt(T||A,w),U=s;break}I.call(D,_,new zc(D,{sourceEvent:A,subject:O,target:f,identifier:L,active:U,x:V[0]+$,y:V[1]+F,dx:V[0]-P[0],dy:V[1]-P[1],dispatch:I}),C)}}return f.filter=function(_){return arguments.length?(e=typeof _=="function"?_:ka(!!_),f):e},f.container=function(_){return arguments.length?(t=typeof _=="function"?_:ka(_),f):t},f.subject=function(_){return arguments.length?(n=typeof _=="function"?_:ka(_),f):n},f.touchable=function(_){return arguments.length?(r=typeof _=="function"?_:ka(!!_),f):r},f.on=function(){var _=i.on.apply(i,arguments);return _===i?f:_},f.clickDistance=function(_){return arguments.length?(d=(_=+_)*_,f):Math.sqrt(d)},f}function jc(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function sm(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Li(){}var Di=.7,Pa=1/Di,vo="\\s*([+-]?\\d+)\\s*",ki="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Gt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",dR=/^#([0-9a-f]{3,8})$/,fR=new RegExp(`^rgb\\(${vo},${vo},${vo}\\)$`),pR=new RegExp(`^rgb\\(${Gt},${Gt},${Gt}\\)$`),hR=new RegExp(`^rgba\\(${vo},${vo},${vo},${ki}\\)$`),gR=new RegExp(`^rgba\\(${Gt},${Gt},${Gt},${ki}\\)$`),mR=new RegExp(`^hsl\\(${ki},${Gt},${Gt}\\)$`),vR=new RegExp(`^hsla\\(${ki},${Gt},${Gt},${ki}\\)$`),am={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};jc(Li,Pi,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:lm,formatHex:lm,formatHex8:yR,formatHsl:ER,formatRgb:um,toString:um});function lm(){return this.rgb().formatHex()}function yR(){return this.rgb().formatHex8()}function ER(){return hm(this).formatHsl()}function um(){return this.rgb().formatRgb()}function Pi(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=dR.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?cm(t):n===3?new et(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Ma(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Ma(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=fR.exec(e))?new et(t[1],t[2],t[3],1):(t=pR.exec(e))?new et(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=hR.exec(e))?Ma(t[1],t[2],t[3],t[4]):(t=gR.exec(e))?Ma(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=mR.exec(e))?pm(t[1],t[2]/100,t[3]/100,1):(t=vR.exec(e))?pm(t[1],t[2]/100,t[3]/100,t[4]):am.hasOwnProperty(e)?cm(am[e]):e==="transparent"?new et(NaN,NaN,NaN,0):null}function cm(e){return new et(e>>16&255,e>>8&255,e&255,1)}function Ma(e,t,n,r){return r<=0&&(e=t=n=NaN),new et(e,t,n,r)}function SR(e){return e instanceof Li||(e=Pi(e)),e?(e=e.rgb(),new et(e.r,e.g,e.b,e.opacity)):new et}function Gc(e,t,n,r){return arguments.length===1?SR(e):new et(e,t,n,r??1)}function et(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}jc(et,Gc,sm(Li,{brighter(e){return e=e==null?Pa:Math.pow(Pa,e),new et(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Di:Math.pow(Di,e),new et(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new et(gr(this.r),gr(this.g),gr(this.b),Ua(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:dm,formatHex:dm,formatHex8:_R,formatRgb:fm,toString:fm}));function dm(){return`#${mr(this.r)}${mr(this.g)}${mr(this.b)}`}function _R(){return`#${mr(this.r)}${mr(this.g)}${mr(this.b)}${mr((isNaN(this.opacity)?1:this.opacity)*255)}`}function fm(){const e=Ua(this.opacity);return`${e===1?"rgb(":"rgba("}${gr(this.r)}, ${gr(this.g)}, ${gr(this.b)}${e===1?")":`, ${e})`}`}function Ua(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function gr(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function mr(e){return e=gr(e),(e<16?"0":"")+e.toString(16)}function pm(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Lt(e,t,n,r)}function hm(e){if(e instanceof Lt)return new Lt(e.h,e.s,e.l,e.opacity);if(e instanceof Li||(e=Pi(e)),!e)return new Lt;if(e instanceof Lt)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,o=Math.min(t,n,r),i=Math.max(t,n,r),s=NaN,a=i-o,l=(i+o)/2;return a?(t===i?s=(n-r)/a+(n<r)*6:n===i?s=(r-t)/a+2:s=(t-n)/a+4,a/=l<.5?i+o:2-i-o,s*=60):a=l>0&&l<1?0:s,new Lt(s,a,l,e.opacity)}function wR(e,t,n,r){return arguments.length===1?hm(e):new Lt(e,t,n,r??1)}function Lt(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}jc(Lt,wR,sm(Li,{brighter(e){return e=e==null?Pa:Math.pow(Pa,e),new Lt(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Di:Math.pow(Di,e),new Lt(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,o=2*n-r;return new et(Yc(e>=240?e-240:e+120,o,r),Yc(e,o,r),Yc(e<120?e+240:e-120,o,r),this.opacity)},clamp(){return new Lt(gm(this.h),Fa(this.s),Fa(this.l),Ua(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Ua(this.opacity);return`${e===1?"hsl(":"hsla("}${gm(this.h)}, ${Fa(this.s)*100}%, ${Fa(this.l)*100}%${e===1?")":`, ${e})`}`}}));function gm(e){return e=(e||0)%360,e<0?e+360:e}function Fa(e){return Math.max(0,Math.min(1,e||0))}function Yc(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const mm=e=>()=>e;function RR(e,t){return function(n){return e+n*t}}function NR(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function OR(e){return(e=+e)==1?vm:function(t,n){return n-t?NR(t,n,e):mm(isNaN(t)?n:t)}}function vm(e,t){var n=t-e;return n?RR(e,n):mm(isNaN(e)?t:e)}const ym=function e(t){var n=OR(t);function r(o,i){var s=n((o=Gc(o)).r,(i=Gc(i)).r),a=n(o.g,i.g),l=n(o.b,i.b),u=vm(o.opacity,i.opacity);return function(c){return o.r=s(c),o.g=a(c),o.b=l(c),o.opacity=u(c),o+""}}return r.gamma=e,r}(1);function Fn(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}var Wc=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Kc=new RegExp(Wc.source,"g");function xR(e){return function(){return e}}function TR(e){return function(t){return e(t)+""}}function CR(e,t){var n=Wc.lastIndex=Kc.lastIndex=0,r,o,i,s=-1,a=[],l=[];for(e=e+"",t=t+"";(r=Wc.exec(e))&&(o=Kc.exec(t));)(i=o.index)>n&&(i=t.slice(n,i),a[s]?a[s]+=i:a[++s]=i),(r=r[0])===(o=o[0])?a[s]?a[s]+=o:a[++s]=o:(a[++s]=null,l.push({i:s,x:Fn(r,o)})),n=Kc.lastIndex;return n<t.length&&(i=t.slice(n),a[s]?a[s]+=i:a[++s]=i),a.length<2?l[0]?TR(l[0].x):xR(t):(t=l.length,function(u){for(var c=0,d;c<t;++c)a[(d=l[c]).i]=d.x(u);return a.join("")})}var Em=180/Math.PI,Qc={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Sm(e,t,n,r,o,i){var s,a,l;return(s=Math.sqrt(e*e+t*t))&&(e/=s,t/=s),(l=e*n+t*r)&&(n-=e*l,r-=t*l),(a=Math.sqrt(n*n+r*r))&&(n/=a,r/=a,l/=a),e*r<t*n&&(e=-e,t=-t,l=-l,s=-s),{translateX:o,translateY:i,rotate:Math.atan2(t,e)*Em,skewX:Math.atan(l)*Em,scaleX:s,scaleY:a}}var Va;function IR(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Qc:Sm(t.a,t.b,t.c,t.d,t.e,t.f)}function bR(e){return e==null||(Va||(Va=document.createElementNS("http://www.w3.org/2000/svg","g")),Va.setAttribute("transform",e),!(e=Va.transform.baseVal.consolidate()))?Qc:(e=e.matrix,Sm(e.a,e.b,e.c,e.d,e.e,e.f))}function _m(e,t,n,r){function o(u){return u.length?u.pop()+" ":""}function i(u,c,d,f,h,m){if(u!==d||c!==f){var v=h.push("translate(",null,t,null,n);m.push({i:v-4,x:Fn(u,d)},{i:v-2,x:Fn(c,f)})}else(d||f)&&h.push("translate("+d+t+f+n)}function s(u,c,d,f){u!==c?(u-c>180?c+=360:c-u>180&&(u+=360),f.push({i:d.push(o(d)+"rotate(",null,r)-2,x:Fn(u,c)})):c&&d.push(o(d)+"rotate("+c+r)}function a(u,c,d,f){u!==c?f.push({i:d.push(o(d)+"skewX(",null,r)-2,x:Fn(u,c)}):c&&d.push(o(d)+"skewX("+c+r)}function l(u,c,d,f,h,m){if(u!==d||c!==f){var v=h.push(o(h)+"scale(",null,",",null,")");m.push({i:v-4,x:Fn(u,d)},{i:v-2,x:Fn(c,f)})}else(d!==1||f!==1)&&h.push(o(h)+"scale("+d+","+f+")")}return function(u,c){var d=[],f=[];return u=e(u),c=e(c),i(u.translateX,u.translateY,c.translateX,c.translateY,d,f),s(u.rotate,c.rotate,d,f),a(u.skewX,c.skewX,d,f),l(u.scaleX,u.scaleY,c.scaleX,c.scaleY,d,f),u=c=null,function(h){for(var m=-1,v=f.length,y;++m<v;)d[(y=f[m]).i]=y.x(h);return d.join("")}}}var AR=_m(IR,"px, ","px)","deg)"),LR=_m(bR,", ",")",")"),DR=1e-12;function wm(e){return((e=Math.exp(e))+1/e)/2}function kR(e){return((e=Math.exp(e))-1/e)/2}function PR(e){return((e=Math.exp(2*e))-1)/(e+1)}const MR=function e(t,n,r){function o(i,s){var a=i[0],l=i[1],u=i[2],c=s[0],d=s[1],f=s[2],h=c-a,m=d-l,v=h*h+m*m,y,p;if(v<DR)p=Math.log(f/u)/t,y=function(C){return[a+C*h,l+C*m,u*Math.exp(t*C*p)]};else{var g=Math.sqrt(v),S=(f*f-u*u+r*v)/(2*u*n*g),_=(f*f-u*u-r*v)/(2*f*n*g),w=Math.log(Math.sqrt(S*S+1)-S),R=Math.log(Math.sqrt(_*_+1)-_);p=(R-w)/t,y=function(C){var L=C*p,B=wm(w),I=u/(n*g)*(B*PR(t*L+w)-kR(w));return[a+I*h,l+I*m,u*B/wm(t*L+w)]}}return y.duration=p*1e3*t/Math.SQRT2,y}return o.rho=function(i){var s=Math.max(.001,+i),a=s*s,l=a*a;return e(s,a,l)},o}(Math.SQRT2,2,4);var yo=0,Mi=0,Ui=0,Rm=1e3,Ba,Fi,$a=0,vr=0,Ha=0,Vi=typeof performance=="object"&&performance.now?performance:Date,Nm=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Xc(){return vr||(Nm(UR),vr=Vi.now()+Ha)}function UR(){vr=0}function za(){this._call=this._time=this._next=null}za.prototype=Om.prototype={constructor:za,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Xc():+n)+(t==null?0:+t),!this._next&&Fi!==this&&(Fi?Fi._next=this:Ba=this,Fi=this),this._call=e,this._time=n,qc()},stop:function(){this._call&&(this._call=null,this._time=1/0,qc())}};function Om(e,t,n){var r=new za;return r.restart(e,t,n),r}function FR(){Xc(),++yo;for(var e=Ba,t;e;)(t=vr-e._time)>=0&&e._call.call(void 0,t),e=e._next;--yo}function xm(){vr=($a=Vi.now())+Ha,yo=Mi=0;try{FR()}finally{yo=0,BR(),vr=0}}function VR(){var e=Vi.now(),t=e-$a;t>Rm&&(Ha-=t,$a=e)}function BR(){for(var e,t=Ba,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:Ba=n);Fi=e,qc(r)}function qc(e){if(!yo){Mi&&(Mi=clearTimeout(Mi));var t=e-vr;t>24?(e<1/0&&(Mi=setTimeout(xm,e-Vi.now()-Ha)),Ui&&(Ui=clearInterval(Ui))):(Ui||($a=Vi.now(),Ui=setInterval(VR,Rm)),yo=1,Nm(xm))}}function Tm(e,t,n){var r=new za;return t=t==null?0:+t,r.restart(o=>{r.stop(),e(o+t)},t,n),r}var $R=ba("start","end","cancel","interrupt"),HR=[],Cm=0,Im=1,Zc=2,ja=3,bm=4,Jc=5,Ga=6;function Ya(e,t,n,r,o,i){var s=e.__transition;if(!s)e.__transition={};else if(n in s)return;zR(e,n,{name:t,index:r,group:o,on:$R,tween:HR,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:Cm})}function ed(e,t){var n=Dt(e,t);if(n.state>Cm)throw new Error("too late; already scheduled");return n}function Yt(e,t){var n=Dt(e,t);if(n.state>ja)throw new Error("too late; already running");return n}function Dt(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function zR(e,t,n){var r=e.__transition,o;r[t]=n,n.timer=Om(i,0,n.time);function i(u){n.state=Im,n.timer.restart(s,n.delay,n.time),n.delay<=u&&s(u-n.delay)}function s(u){var c,d,f,h;if(n.state!==Im)return l();for(c in r)if(h=r[c],h.name===n.name){if(h.state===ja)return Tm(s);h.state===bm?(h.state=Ga,h.timer.stop(),h.on.call("interrupt",e,e.__data__,h.index,h.group),delete r[c]):+c<t&&(h.state=Ga,h.timer.stop(),h.on.call("cancel",e,e.__data__,h.index,h.group),delete r[c])}if(Tm(function(){n.state===ja&&(n.state=bm,n.timer.restart(a,n.delay,n.time),a(u))}),n.state=Zc,n.on.call("start",e,e.__data__,n.index,n.group),n.state===Zc){for(n.state=ja,o=new Array(f=n.tween.length),c=0,d=-1;c<f;++c)(h=n.tween[c].value.call(e,e.__data__,n.index,n.group))&&(o[++d]=h);o.length=d+1}}function a(u){for(var c=u<n.duration?n.ease.call(null,u/n.duration):(n.timer.restart(l),n.state=Jc,1),d=-1,f=o.length;++d<f;)o[d].call(e,c);n.state===Jc&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){n.state=Ga,n.timer.stop(),delete r[t];for(var u in r)return;delete e.__transition}}function Wa(e,t){var n=e.__transition,r,o,i=!0,s;if(n){t=t==null?null:t+"";for(s in n){if((r=n[s]).name!==t){i=!1;continue}o=r.state>Zc&&r.state<Jc,r.state=Ga,r.timer.stop(),r.on.call(o?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[s]}i&&delete e.__transition}}function jR(e){return this.each(function(){Wa(this,e)})}function GR(e,t){var n,r;return function(){var o=Yt(this,e),i=o.tween;if(i!==n){r=n=i;for(var s=0,a=r.length;s<a;++s)if(r[s].name===t){r=r.slice(),r.splice(s,1);break}}o.tween=r}}function YR(e,t,n){var r,o;if(typeof n!="function")throw new Error;return function(){var i=Yt(this,e),s=i.tween;if(s!==r){o=(r=s).slice();for(var a={name:t,value:n},l=0,u=o.length;l<u;++l)if(o[l].name===t){o[l]=a;break}l===u&&o.push(a)}i.tween=o}}function WR(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=Dt(this.node(),n).tween,o=0,i=r.length,s;o<i;++o)if((s=r[o]).name===e)return s.value;return null}return this.each((t==null?GR:YR)(n,e,t))}function td(e,t,n){var r=e._id;return e.each(function(){var o=Yt(this,r);(o.value||(o.value={}))[t]=n.apply(this,arguments)}),function(o){return Dt(o,r).value[t]}}function Am(e,t){var n;return(typeof t=="number"?Fn:t instanceof Pi?ym:(n=Pi(t))?(t=n,ym):CR)(e,t)}function KR(e){return function(){this.removeAttribute(e)}}function QR(e){return function(){this.removeAttributeNS(e.space,e.local)}}function XR(e,t,n){var r,o=n+"",i;return function(){var s=this.getAttribute(e);return s===o?null:s===r?i:i=t(r=s,n)}}function qR(e,t,n){var r,o=n+"",i;return function(){var s=this.getAttributeNS(e.space,e.local);return s===o?null:s===r?i:i=t(r=s,n)}}function ZR(e,t,n){var r,o,i;return function(){var s,a=n(this),l;return a==null?void this.removeAttribute(e):(s=this.getAttribute(e),l=a+"",s===l?null:s===r&&l===o?i:(o=l,i=t(r=s,a)))}}function JR(e,t,n){var r,o,i;return function(){var s,a=n(this),l;return a==null?void this.removeAttributeNS(e.space,e.local):(s=this.getAttributeNS(e.space,e.local),l=a+"",s===l?null:s===r&&l===o?i:(o=l,i=t(r=s,a)))}}function eN(e,t){var n=La(e),r=n==="transform"?LR:Am;return this.attrTween(e,typeof t=="function"?(n.local?JR:ZR)(n,r,td(this,"attr."+e,t)):t==null?(n.local?QR:KR)(n):(n.local?qR:XR)(n,r,t))}function tN(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function nN(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function rN(e,t){var n,r;function o(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&nN(e,i)),n}return o._value=t,o}function oN(e,t){var n,r;function o(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&tN(e,i)),n}return o._value=t,o}function iN(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var r=La(e);return this.tween(n,(r.local?rN:oN)(r,t))}function sN(e,t){return function(){ed(this,e).delay=+t.apply(this,arguments)}}function aN(e,t){return t=+t,function(){ed(this,e).delay=t}}function lN(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?sN:aN)(t,e)):Dt(this.node(),t).delay}function uN(e,t){return function(){Yt(this,e).duration=+t.apply(this,arguments)}}function cN(e,t){return t=+t,function(){Yt(this,e).duration=t}}function dN(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?uN:cN)(t,e)):Dt(this.node(),t).duration}function fN(e,t){if(typeof t!="function")throw new Error;return function(){Yt(this,e).ease=t}}function pN(e){var t=this._id;return arguments.length?this.each(fN(t,e)):Dt(this.node(),t).ease}function hN(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Yt(this,e).ease=n}}function gN(e){if(typeof e!="function")throw new Error;return this.each(hN(this._id,e))}function mN(e){typeof e!="function"&&(e=Kg(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var i=t[o],s=i.length,a=r[o]=[],l,u=0;u<s;++u)(l=i[u])&&e.call(l,l.__data__,u,i)&&a.push(l);return new dn(r,this._parents,this._name,this._id)}function vN(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,o=n.length,i=Math.min(r,o),s=new Array(r),a=0;a<i;++a)for(var l=t[a],u=n[a],c=l.length,d=s[a]=new Array(c),f,h=0;h<c;++h)(f=l[h]||u[h])&&(d[h]=f);for(;a<r;++a)s[a]=t[a];return new dn(s,this._parents,this._name,this._id)}function yN(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function EN(e,t,n){var r,o,i=yN(t)?ed:Yt;return function(){var s=i(this,e),a=s.on;a!==r&&(o=(r=a).copy()).on(t,n),s.on=o}}function SN(e,t){var n=this._id;return arguments.length<2?Dt(this.node(),n).on.on(e):this.each(EN(n,e,t))}function _N(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function wN(){return this.on("end.remove",_N(this._id))}function RN(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Bc(e));for(var r=this._groups,o=r.length,i=new Array(o),s=0;s<o;++s)for(var a=r[s],l=a.length,u=i[s]=new Array(l),c,d,f=0;f<l;++f)(c=a[f])&&(d=e.call(c,c.__data__,f,a))&&("__data__"in c&&(d.__data__=c.__data__),u[f]=d,Ya(u[f],t,n,f,u,Dt(c,n)));return new dn(i,this._parents,t,n)}function NN(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Wg(e));for(var r=this._groups,o=r.length,i=[],s=[],a=0;a<o;++a)for(var l=r[a],u=l.length,c,d=0;d<u;++d)if(c=l[d]){for(var f=e.call(c,c.__data__,d,l),h,m=Dt(c,n),v=0,y=f.length;v<y;++v)(h=f[v])&&Ya(h,t,n,v,f,m);i.push(f),s.push(c)}return new dn(i,s,t,n)}var ON=bi.prototype.constructor;function xN(){return new ON(this._groups,this._parents)}function TN(e,t){var n,r,o;return function(){var i=go(this,e),s=(this.style.removeProperty(e),go(this,e));return i===s?null:i===n&&s===r?o:o=t(n=i,r=s)}}function Lm(e){return function(){this.style.removeProperty(e)}}function CN(e,t,n){var r,o=n+"",i;return function(){var s=go(this,e);return s===o?null:s===r?i:i=t(r=s,n)}}function IN(e,t,n){var r,o,i;return function(){var s=go(this,e),a=n(this),l=a+"";return a==null&&(l=a=(this.style.removeProperty(e),go(this,e))),s===l?null:s===r&&l===o?i:(o=l,i=t(r=s,a))}}function bN(e,t){var n,r,o,i="style."+t,s="end."+i,a;return function(){var l=Yt(this,e),u=l.on,c=l.value[i]==null?a||(a=Lm(t)):void 0;(u!==n||o!==c)&&(r=(n=u).copy()).on(s,o=c),l.on=r}}function AN(e,t,n){var r=(e+="")=="transform"?AR:Am;return t==null?this.styleTween(e,TN(e,r)).on("end.style."+e,Lm(e)):typeof t=="function"?this.styleTween(e,IN(e,r,td(this,"style."+e,t))).each(bN(this._id,e)):this.styleTween(e,CN(e,r,t),n).on("end.style."+e,null)}function LN(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function DN(e,t,n){var r,o;function i(){var s=t.apply(this,arguments);return s!==o&&(r=(o=s)&&LN(e,s,n)),r}return i._value=t,i}function kN(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;return this.tween(r,DN(e,t,n??""))}function PN(e){return function(){this.textContent=e}}function MN(e){return function(){var t=e(this);this.textContent=t??""}}function UN(e){return this.tween("text",typeof e=="function"?MN(td(this,"text",e)):PN(e==null?"":e+""))}function FN(e){return function(t){this.textContent=e.call(this,t)}}function VN(e){var t,n;function r(){var o=e.apply(this,arguments);return o!==n&&(t=(n=o)&&FN(o)),t}return r._value=e,r}function BN(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,VN(e))}function $N(){for(var e=this._name,t=this._id,n=Dm(),r=this._groups,o=r.length,i=0;i<o;++i)for(var s=r[i],a=s.length,l,u=0;u<a;++u)if(l=s[u]){var c=Dt(l,t);Ya(l,e,n,u,s,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new dn(r,this._parents,e,n)}function HN(){var e,t,n=this,r=n._id,o=n.size();return new Promise(function(i,s){var a={value:s},l={value:function(){--o===0&&i()}};n.each(function(){var u=Yt(this,r),c=u.on;c!==e&&(t=(e=c).copy(),t._.cancel.push(a),t._.interrupt.push(a),t._.end.push(l)),u.on=t}),o===0&&i()})}var zN=0;function dn(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function Dm(){return++zN}var fn=bi.prototype;dn.prototype={constructor:dn,select:RN,selectAll:NN,selectChild:fn.selectChild,selectChildren:fn.selectChildren,filter:mN,merge:vN,selection:xN,transition:$N,call:fn.call,nodes:fn.nodes,node:fn.node,size:fn.size,empty:fn.empty,each:fn.each,on:SN,attr:eN,attrTween:iN,style:AN,styleTween:kN,text:UN,textTween:BN,remove:wN,tween:WR,delay:lN,duration:dN,ease:pN,easeVarying:gN,end:HN,[Symbol.iterator]:fn[Symbol.iterator]};function jN(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var GN={time:null,delay:0,duration:250,ease:jN};function YN(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function WN(e){var t,n;e instanceof dn?(t=e._id,e=e._name):(t=Dm(),(n=GN).time=Xc(),e=e==null?null:e+"");for(var r=this._groups,o=r.length,i=0;i<o;++i)for(var s=r[i],a=s.length,l,u=0;u<a;++u)(l=s[u])&&Ya(l,e,t,u,s,n||YN(l,t));return new dn(r,this._parents,e,t)}bi.prototype.interrupt=jR,bi.prototype.transition=WN;const Ka=e=>()=>e;function KN(e,{sourceEvent:t,target:n,transform:r,dispatch:o}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:o}})}function pn(e,t,n){this.k=e,this.x=t,this.y=n}pn.prototype={constructor:pn,scale:function(e){return e===1?this:new pn(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new pn(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Vn=new pn(1,0,0);pn.prototype;function nd(e){e.stopImmediatePropagation()}function Bi(e){e.preventDefault(),e.stopImmediatePropagation()}function QN(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function XN(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function km(){return this.__zoom||Vn}function qN(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function ZN(){return navigator.maxTouchPoints||"ontouchstart"in this}function JN(e,t,n){var r=e.invertX(t[0][0])-n[0][0],o=e.invertX(t[1][0])-n[1][0],i=e.invertY(t[0][1])-n[0][1],s=e.invertY(t[1][1])-n[1][1];return e.translate(o>r?(r+o)/2:Math.min(0,r)||Math.max(0,o),s>i?(i+s)/2:Math.min(0,i)||Math.max(0,s))}function eO(){var e=QN,t=XN,n=JN,r=qN,o=ZN,i=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],a=250,l=MR,u=ba("start","zoom","end"),c,d,f,h=500,m=150,v=0,y=10;function p(O){O.property("__zoom",km).on("wheel.zoom",L,{passive:!1}).on("mousedown.zoom",B).on("dblclick.zoom",I).filter(o).on("touchstart.zoom",V).on("touchmove.zoom",$).on("touchend.zoom touchcancel.zoom",F).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}p.transform=function(O,M,D,A){var T=O.selection?O.selection():O;T.property("__zoom",km),O!==T?w(O,M,D,A):T.interrupt().each(function(){R(this,arguments).event(A).start().zoom(null,typeof M=="function"?M.apply(this,arguments):M).end()})},p.scaleBy=function(O,M,D,A){p.scaleTo(O,function(){var T=this.__zoom.k,P=typeof M=="function"?M.apply(this,arguments):M;return T*P},D,A)},p.scaleTo=function(O,M,D,A){p.transform(O,function(){var T=t.apply(this,arguments),P=this.__zoom,U=D==null?_(T):typeof D=="function"?D.apply(this,arguments):D,H=P.invert(U),j=typeof M=="function"?M.apply(this,arguments):M;return n(S(g(P,j),U,H),T,s)},D,A)},p.translateBy=function(O,M,D,A){p.transform(O,function(){return n(this.__zoom.translate(typeof M=="function"?M.apply(this,arguments):M,typeof D=="function"?D.apply(this,arguments):D),t.apply(this,arguments),s)},null,A)},p.translateTo=function(O,M,D,A,T){p.transform(O,function(){var P=t.apply(this,arguments),U=this.__zoom,H=A==null?_(P):typeof A=="function"?A.apply(this,arguments):A;return n(Vn.translate(H[0],H[1]).scale(U.k).translate(typeof M=="function"?-M.apply(this,arguments):-M,typeof D=="function"?-D.apply(this,arguments):-D),P,s)},A,T)};function g(O,M){return M=Math.max(i[0],Math.min(i[1],M)),M===O.k?O:new pn(M,O.x,O.y)}function S(O,M,D){var A=M[0]-D[0]*O.k,T=M[1]-D[1]*O.k;return A===O.x&&T===O.y?O:new pn(O.k,A,T)}function _(O){return[(+O[0][0]+ +O[1][0])/2,(+O[0][1]+ +O[1][1])/2]}function w(O,M,D,A){O.on("start.zoom",function(){R(this,arguments).event(A).start()}).on("interrupt.zoom end.zoom",function(){R(this,arguments).event(A).end()}).tween("zoom",function(){var T=this,P=arguments,U=R(T,P).event(A),H=t.apply(T,P),j=D==null?_(H):typeof D=="function"?D.apply(T,P):D,K=Math.max(H[1][0]-H[0][0],H[1][1]-H[0][1]),W=T.__zoom,Z=typeof M=="function"?M.apply(T,P):M,X=l(W.invert(j).concat(K/W.k),Z.invert(j).concat(K/Z.k));return function(te){if(te===1)te=Z;else{var oe=X(te),ge=K/oe[2];te=new pn(ge,j[0]-oe[0]*ge,j[1]-oe[1]*ge)}U.zoom(null,te)}})}function R(O,M,D){return!D&&O.__zooming||new C(O,M)}function C(O,M){this.that=O,this.args=M,this.active=0,this.sourceEvent=null,this.extent=t.apply(O,M),this.taps=0}C.prototype={event:function(O){return O&&(this.sourceEvent=O),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(O,M){return this.mouse&&O!=="mouse"&&(this.mouse[1]=M.invert(this.mouse[0])),this.touch0&&O!=="touch"&&(this.touch0[1]=M.invert(this.touch0[0])),this.touch1&&O!=="touch"&&(this.touch1[1]=M.invert(this.touch1[0])),this.that.__zoom=M,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(O){var M=At(this.that).datum();u.call(O,this.that,new KN(O,{sourceEvent:this.sourceEvent,target:p,type:O,transform:this.that.__zoom,dispatch:u}),M)}};function L(O,...M){if(!e.apply(this,arguments))return;var D=R(this,M).event(O),A=this.__zoom,T=Math.max(i[0],Math.min(i[1],A.k*Math.pow(2,r.apply(this,arguments)))),P=jt(O);if(D.wheel)(D.mouse[0][0]!==P[0]||D.mouse[0][1]!==P[1])&&(D.mouse[1]=A.invert(D.mouse[0]=P)),clearTimeout(D.wheel);else{if(A.k===T)return;D.mouse=[P,A.invert(P)],Wa(this),D.start()}Bi(O),D.wheel=setTimeout(U,m),D.zoom("mouse",n(S(g(A,T),D.mouse[0],D.mouse[1]),D.extent,s));function U(){D.wheel=null,D.end()}}function B(O,...M){if(f||!e.apply(this,arguments))return;var D=O.currentTarget,A=R(this,M,!0).event(O),T=At(O.view).on("mousemove.zoom",j,!0).on("mouseup.zoom",K,!0),P=jt(O,D),U=O.clientX,H=O.clientY;om(O.view),nd(O),A.mouse=[P,this.__zoom.invert(P)],Wa(this),A.start();function j(W){if(Bi(W),!A.moved){var Z=W.clientX-U,X=W.clientY-H;A.moved=Z*Z+X*X>v}A.event(W).zoom("mouse",n(S(A.that.__zoom,A.mouse[0]=jt(W,D),A.mouse[1]),A.extent,s))}function K(W){T.on("mousemove.zoom mouseup.zoom",null),im(W.view,A.moved),Bi(W),A.event(W).end()}}function I(O,...M){if(e.apply(this,arguments)){var D=this.__zoom,A=jt(O.changedTouches?O.changedTouches[0]:O,this),T=D.invert(A),P=D.k*(O.shiftKey?.5:2),U=n(S(g(D,P),A,T),t.apply(this,M),s);Bi(O),a>0?At(this).transition().duration(a).call(w,U,A,O):At(this).call(p.transform,U,A,O)}}function V(O,...M){if(e.apply(this,arguments)){var D=O.touches,A=D.length,T=R(this,M,O.changedTouches.length===A).event(O),P,U,H,j;for(nd(O),U=0;U<A;++U)H=D[U],j=jt(H,this),j=[j,this.__zoom.invert(j),H.identifier],T.touch0?!T.touch1&&T.touch0[2]!==j[2]&&(T.touch1=j,T.taps=0):(T.touch0=j,P=!0,T.taps=1+!!c);c&&(c=clearTimeout(c)),P&&(T.taps<2&&(d=j[0],c=setTimeout(function(){c=null},h)),Wa(this),T.start())}}function $(O,...M){if(this.__zooming){var D=R(this,M).event(O),A=O.changedTouches,T=A.length,P,U,H,j;for(Bi(O),P=0;P<T;++P)U=A[P],H=jt(U,this),D.touch0&&D.touch0[2]===U.identifier?D.touch0[0]=H:D.touch1&&D.touch1[2]===U.identifier&&(D.touch1[0]=H);if(U=D.that.__zoom,D.touch1){var K=D.touch0[0],W=D.touch0[1],Z=D.touch1[0],X=D.touch1[1],te=(te=Z[0]-K[0])*te+(te=Z[1]-K[1])*te,oe=(oe=X[0]-W[0])*oe+(oe=X[1]-W[1])*oe;U=g(U,Math.sqrt(te/oe)),H=[(K[0]+Z[0])/2,(K[1]+Z[1])/2],j=[(W[0]+X[0])/2,(W[1]+X[1])/2]}else if(D.touch0)H=D.touch0[0],j=D.touch0[1];else return;D.zoom("touch",n(S(U,H,j),D.extent,s))}}function F(O,...M){if(this.__zooming){var D=R(this,M).event(O),A=O.changedTouches,T=A.length,P,U;for(nd(O),f&&clearTimeout(f),f=setTimeout(function(){f=null},h),P=0;P<T;++P)U=A[P],D.touch0&&D.touch0[2]===U.identifier?delete D.touch0:D.touch1&&D.touch1[2]===U.identifier&&delete D.touch1;if(D.touch1&&!D.touch0&&(D.touch0=D.touch1,delete D.touch1),D.touch0)D.touch0[1]=this.__zoom.invert(D.touch0[0]);else if(D.end(),D.taps===2&&(U=jt(U,this),Math.hypot(d[0]-U[0],d[1]-U[1])<y)){var H=At(this).on("dblclick.zoom");H&&H.apply(this,arguments)}}}return p.wheelDelta=function(O){return arguments.length?(r=typeof O=="function"?O:Ka(+O),p):r},p.filter=function(O){return arguments.length?(e=typeof O=="function"?O:Ka(!!O),p):e},p.touchable=function(O){return arguments.length?(o=typeof O=="function"?O:Ka(!!O),p):o},p.extent=function(O){return arguments.length?(t=typeof O=="function"?O:Ka([[+O[0][0],+O[0][1]],[+O[1][0],+O[1][1]]]),p):t},p.scaleExtent=function(O){return arguments.length?(i[0]=+O[0],i[1]=+O[1],p):[i[0],i[1]]},p.translateExtent=function(O){return arguments.length?(s[0][0]=+O[0][0],s[1][0]=+O[1][0],s[0][1]=+O[0][1],s[1][1]=+O[1][1],p):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},p.constrain=function(O){return arguments.length?(n=O,p):n},p.duration=function(O){return arguments.length?(a=+O,p):a},p.interpolate=function(O){return arguments.length?(l=O,p):l},p.on=function(){var O=u.on.apply(u,arguments);return O===u?p:O},p.clickDistance=function(O){return arguments.length?(v=(O=+O)*O,p):Math.sqrt(v)},p.tapDistance=function(O){return arguments.length?(y=+O,p):y},p}const Qa=N.createContext(null),tO=Qa.Provider,Bn={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,t)=>`Couldn't create edge for ${e?"target":"source"} handle id: "${e?t.targetHandle:t.sourceHandle}", edge id: ${t.id}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`},Pm=Bn.error001();function le(e,t){const n=N.useContext(Qa);if(n===null)throw new Error(Pm);return Hg(n,e,t)}const xe=()=>{const e=N.useContext(Qa);if(e===null)throw new Error(Pm);return N.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe,destroy:e.destroy}),[e])},nO=e=>e.userSelectionActive?"none":"all";function rd({position:e,children:t,className:n,style:r,...o}){const i=le(nO),s=`${e}`.split("-");return E("div",{className:Je(["react-flow__panel",n,...s]),style:{...r,pointerEvents:i},...o,children:t})}function rO({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:E(rd,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:E("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const oO=({x:e,y:t,label:n,labelStyle:r={},labelShowBg:o=!0,labelBgStyle:i={},labelBgPadding:s=[2,4],labelBgBorderRadius:a=2,children:l,className:u,...c})=>{const d=N.useRef(null),[f,h]=N.useState({x:0,y:0,width:0,height:0}),m=Je(["react-flow__edge-textwrapper",u]);return N.useEffect(()=>{if(d.current){const v=d.current.getBBox();h({x:v.x,y:v.y,width:v.width,height:v.height})}},[n]),typeof n>"u"||!n?null:k("g",{transform:`translate(${e-f.width/2} ${t-f.height/2})`,className:m,visibility:f.width?"visible":"hidden",...c,children:[o&&E("rect",{width:f.width+2*s[0],x:-s[0],y:-s[1],height:f.height+2*s[1],className:"react-flow__edge-textbg",style:i,rx:a,ry:a}),E("text",{className:"react-flow__edge-text",y:f.height/2,dy:"0.3em",ref:d,style:r,children:n}),l]})};var iO=N.memo(oO);const od=e=>({width:e.offsetWidth,height:e.offsetHeight}),Eo=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),id=(e={x:0,y:0},t)=>({x:Eo(e.x,t[0][0],t[1][0]),y:Eo(e.y,t[0][1],t[1][1])}),Mm=(e,t,n)=>e<t?Eo(Math.abs(e-t),1,50)/50:e>n?-Eo(Math.abs(e-n),1,50)/50:0,Um=(e,t)=>{const n=Mm(e.x,35,t.width-35)*20,r=Mm(e.y,35,t.height-35)*20;return[n,r]},Fm=e=>{var t;return((t=e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},sO=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),Vm=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),aO=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),Bm=e=>({...e.positionAbsolute||{x:0,y:0},width:e.width||0,height:e.height||0}),sd=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),r=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*r)},lO=e=>St(e.width)&&St(e.height)&&St(e.x)&&St(e.y),St=e=>!isNaN(e)&&isFinite(e),we=Symbol.for("internals"),$m=["Enter"," ","Escape"],uO=(e,t)=>{},cO=e=>"nativeEvent"in e;function ad(e){var o,i;const t=cO(e)?e.nativeEvent:e,n=((i=(o=t.composedPath)==null?void 0:o.call(t))==null?void 0:i[0])||e.target;return["INPUT","SELECT","TEXTAREA"].includes(n==null?void 0:n.nodeName)||(n==null?void 0:n.hasAttribute("contenteditable"))||!!(n!=null&&n.closest(".nokey"))}const Hm=e=>"clientX"in e,$n=(e,t)=>{var i,s;const n=Hm(e),r=n?e.clientX:(i=e.touches)==null?void 0:i[0].clientX,o=n?e.clientY:(s=e.touches)==null?void 0:s[0].clientY;return{x:r-((t==null?void 0:t.left)??0),y:o-((t==null?void 0:t.top)??0)}},So=({path:e,labelX:t,labelY:n,label:r,labelStyle:o,labelShowBg:i,labelBgStyle:s,labelBgPadding:a,labelBgBorderRadius:l,style:u,markerEnd:c,markerStart:d,interactionWidth:f=20})=>k(ve,{children:[E("path",{style:u,d:e,fill:"none",className:"react-flow__edge-path",markerEnd:c,markerStart:d}),f&&E("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:f,className:"react-flow__edge-interaction"}),r&&St(t)&&St(n)?E(iO,{x:t,y:n,label:r,labelStyle:o,labelShowBg:i,labelBgStyle:s,labelBgPadding:a,labelBgBorderRadius:l}):null]});So.displayName="BaseEdge";function $i(e,t,n){return n===void 0?n:r=>{const o=t().edges.find(i=>i.id===e);o&&n(r,{...o})}}function zm({sourceX:e,sourceY:t,targetX:n,targetY:r}){const o=Math.abs(n-e)/2,i=n<e?n+o:n-o,s=Math.abs(r-t)/2,a=r<t?r+s:r-s;return[i,a,o,s]}function jm({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:o,sourceControlY:i,targetControlX:s,targetControlY:a}){const l=e*.125+o*.375+s*.375+n*.125,u=t*.125+i*.375+a*.375+r*.125,c=Math.abs(l-e),d=Math.abs(u-t);return[l,u,c,d]}var Hn;(function(e){e.Strict="strict",e.Loose="loose"})(Hn||(Hn={}));var _o;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(_o||(_o={}));var Hi;(function(e){e.Partial="partial",e.Full="full"})(Hi||(Hi={}));var zn;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(zn||(zn={}));var zi;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(zi||(zi={}));var Y;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Y||(Y={}));function Gm({pos:e,x1:t,y1:n,x2:r,y2:o}){return e===Y.Left||e===Y.Right?[.5*(t+r),n]:[t,.5*(n+o)]}function Ym({sourceX:e,sourceY:t,sourcePosition:n=Y.Bottom,targetX:r,targetY:o,targetPosition:i=Y.Top}){const[s,a]=Gm({pos:n,x1:e,y1:t,x2:r,y2:o}),[l,u]=Gm({pos:i,x1:r,y1:o,x2:e,y2:t}),[c,d,f,h]=jm({sourceX:e,sourceY:t,targetX:r,targetY:o,sourceControlX:s,sourceControlY:a,targetControlX:l,targetControlY:u});return[`M${e},${t} C${s},${a} ${l},${u} ${r},${o}`,c,d,f,h]}const ld=N.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,sourcePosition:o=Y.Bottom,targetPosition:i=Y.Top,label:s,labelStyle:a,labelShowBg:l,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:d,style:f,markerEnd:h,markerStart:m,interactionWidth:v})=>{const[y,p,g]=Ym({sourceX:e,sourceY:t,sourcePosition:o,targetX:n,targetY:r,targetPosition:i});return E(So,{path:y,labelX:p,labelY:g,label:s,labelStyle:a,labelShowBg:l,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:d,style:f,markerEnd:h,markerStart:m,interactionWidth:v})});ld.displayName="SimpleBezierEdge";const Wm={[Y.Left]:{x:-1,y:0},[Y.Right]:{x:1,y:0},[Y.Top]:{x:0,y:-1},[Y.Bottom]:{x:0,y:1}},dO=({source:e,sourcePosition:t=Y.Bottom,target:n})=>t===Y.Left||t===Y.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},Km=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function fO({source:e,sourcePosition:t=Y.Bottom,target:n,targetPosition:r=Y.Top,center:o,offset:i}){const s=Wm[t],a=Wm[r],l={x:e.x+s.x*i,y:e.y+s.y*i},u={x:n.x+a.x*i,y:n.y+a.y*i},c=dO({source:l,sourcePosition:t,target:u}),d=c.x!==0?"x":"y",f=c[d];let h=[],m,v;const[y,p,g,S]=zm({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(s[d]*a[d]===-1){m=o.x||y,v=o.y||p;const w=[{x:m,y:l.y},{x:m,y:u.y}],R=[{x:l.x,y:v},{x:u.x,y:v}];s[d]===f?h=d==="x"?w:R:h=d==="x"?R:w}else{const w=[{x:l.x,y:u.y}],R=[{x:u.x,y:l.y}];if(d==="x"?h=s.x===f?R:w:h=s.y===f?w:R,t!==r){const C=d==="x"?"y":"x",L=s[d]===a[C],B=l[C]>u[C],I=l[C]<u[C];(s[d]===1&&(!L&&B||L&&I)||s[d]!==1&&(!L&&I||L&&B))&&(h=d==="x"?w:R)}m=h[0].x,v=h[0].y}return[[e,l,...h,u,n],m,v,g,S]}function pO(e,t,n,r){const o=Math.min(Km(e,t)/2,Km(t,n)/2,r),{x:i,y:s}=t;if(e.x===i&&i===n.x||e.y===s&&s===n.y)return`L${i} ${s}`;if(e.y===s){const u=e.x<n.x?-1:1,c=e.y<n.y?1:-1;return`L ${i+o*u},${s}Q ${i},${s} ${i},${s+o*c}`}const a=e.x<n.x?1:-1,l=e.y<n.y?-1:1;return`L ${i},${s+o*l}Q ${i},${s} ${i+o*a},${s}`}function ji({sourceX:e,sourceY:t,sourcePosition:n=Y.Bottom,targetX:r,targetY:o,targetPosition:i=Y.Top,borderRadius:s=5,centerX:a,centerY:l,offset:u=20}){const[c,d,f,h,m]=fO({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:o},targetPosition:i,center:{x:a,y:l},offset:u});return[c.reduce((y,p,g)=>{let S="";return g>0&&g<c.length-1?S=pO(c[g-1],p,c[g+1],s):S=`${g===0?"M":"L"}${p.x} ${p.y}`,y+=S,y},""),d,f,h,m]}const Xa=N.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,label:o,labelStyle:i,labelShowBg:s,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:u,style:c,sourcePosition:d=Y.Bottom,targetPosition:f=Y.Top,markerEnd:h,markerStart:m,pathOptions:v,interactionWidth:y})=>{const[p,g,S]=ji({sourceX:e,sourceY:t,sourcePosition:d,targetX:n,targetY:r,targetPosition:f,borderRadius:v==null?void 0:v.borderRadius,offset:v==null?void 0:v.offset});return E(So,{path:p,labelX:g,labelY:S,label:o,labelStyle:i,labelShowBg:s,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:u,style:c,markerEnd:h,markerStart:m,interactionWidth:y})});Xa.displayName="SmoothStepEdge";const ud=N.memo(e=>{var t;return E(Xa,{...e,pathOptions:N.useMemo(()=>{var n;return{borderRadius:0,offset:(n=e.pathOptions)==null?void 0:n.offset}},[(t=e.pathOptions)==null?void 0:t.offset])})});ud.displayName="StepEdge";function hO({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[o,i,s,a]=zm({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,o,i,s,a]}const cd=N.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,label:o,labelStyle:i,labelShowBg:s,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:u,style:c,markerEnd:d,markerStart:f,interactionWidth:h})=>{const[m,v,y]=hO({sourceX:e,sourceY:t,targetX:n,targetY:r});return E(So,{path:m,labelX:v,labelY:y,label:o,labelStyle:i,labelShowBg:s,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:u,style:c,markerEnd:d,markerStart:f,interactionWidth:h})});cd.displayName="StraightEdge";function qa(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function Qm({pos:e,x1:t,y1:n,x2:r,y2:o,c:i}){switch(e){case Y.Left:return[t-qa(t-r,i),n];case Y.Right:return[t+qa(r-t,i),n];case Y.Top:return[t,n-qa(n-o,i)];case Y.Bottom:return[t,n+qa(o-n,i)]}}function Xm({sourceX:e,sourceY:t,sourcePosition:n=Y.Bottom,targetX:r,targetY:o,targetPosition:i=Y.Top,curvature:s=.25}){const[a,l]=Qm({pos:n,x1:e,y1:t,x2:r,y2:o,c:s}),[u,c]=Qm({pos:i,x1:r,y1:o,x2:e,y2:t,c:s}),[d,f,h,m]=jm({sourceX:e,sourceY:t,targetX:r,targetY:o,sourceControlX:a,sourceControlY:l,targetControlX:u,targetControlY:c});return[`M${e},${t} C${a},${l} ${u},${c} ${r},${o}`,d,f,h,m]}const Za=N.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,sourcePosition:o=Y.Bottom,targetPosition:i=Y.Top,label:s,labelStyle:a,labelShowBg:l,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:d,style:f,markerEnd:h,markerStart:m,pathOptions:v,interactionWidth:y})=>{const[p,g,S]=Xm({sourceX:e,sourceY:t,sourcePosition:o,targetX:n,targetY:r,targetPosition:i,curvature:v==null?void 0:v.curvature});return E(So,{path:p,labelX:g,labelY:S,label:s,labelStyle:a,labelShowBg:l,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:d,style:f,markerEnd:h,markerStart:m,interactionWidth:y})});Za.displayName="BezierEdge";const dd=N.createContext(null),gO=dd.Provider;dd.Consumer;const mO=()=>N.useContext(dd),vO=e=>"id"in e&&"source"in e&&"target"in e,qm=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`reactflow__edge-${e}${t||""}-${n}${r||""}`,fd=(e,t)=>typeof e>"u"?"":typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`,yO=(e,t)=>t.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),Zm=(e,t)=>{if(!e.source||!e.target)return t;let n;return vO(e)?n={...e}:n={...e,id:qm(e)},yO(n,t)?t:t.concat(n)},EO=(e,t,n,r={shouldReplaceId:!0})=>{const{id:o,...i}=e;if(!t.source||!t.target||!n.find(l=>l.id===o))return n;const a={...i,id:r.shouldReplaceId?qm(t):o,source:t.source,target:t.target,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle};return n.filter(l=>l.id!==o).concat(a)},Jm=({x:e,y:t},[n,r,o],i,[s,a])=>{const l={x:(e-n)/o,y:(t-r)/o};return i?{x:s*Math.round(l.x/s),y:a*Math.round(l.y/a)}:l},SO=({x:e,y:t},[n,r,o])=>({x:e*o+n,y:t*o+r}),wo=(e,t=[0,0])=>{if(!e)return{x:0,y:0,positionAbsolute:{x:0,y:0}};const n=(e.width??0)*t[0],r=(e.height??0)*t[1],o={x:e.position.x-n,y:e.position.y-r};return{...o,positionAbsolute:e.positionAbsolute?{x:e.positionAbsolute.x-n,y:e.positionAbsolute.y-r}:o}},ev=(e,t=[0,0])=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((r,o)=>{const{x:i,y:s}=wo(o,t).positionAbsolute;return sO(r,Vm({x:i,y:s,width:o.width||0,height:o.height||0}))},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return aO(n)},tv=(e,t,[n,r,o]=[0,0,1],i=!1,s=!1,a=[0,0])=>{const l={x:(t.x-n)/o,y:(t.y-r)/o,width:t.width/o,height:t.height/o},u=[];return e.forEach(c=>{const{width:d,height:f,selectable:h=!0,hidden:m=!1}=c;if(s&&!h||m)return!1;const{positionAbsolute:v}=wo(c,a),y={x:v.x,y:v.y,width:d||0,height:f||0},p=sd(l,y),g=typeof d>"u"||typeof f>"u"||d===null||f===null,S=i&&p>0,_=(d||0)*(f||0);(g||S||p>=_||c.dragging)&&u.push(c)}),u},nv=(e,t)=>{const n=e.map(r=>r.id);return t.filter(r=>n.includes(r.source)||n.includes(r.target))},rv=(e,t,n,r,o,i=.1)=>{const s=t/(e.width*(1+i)),a=n/(e.height*(1+i)),l=Math.min(s,a),u=Eo(l,r,o),c=e.x+e.width/2,d=e.y+e.height/2,f=t/2-c*u,h=n/2-d*u;return[f,h,u]},yr=(e,t=0)=>e.transition().duration(t);function ov(e,t,n,r){return(t[n]||[]).reduce((o,i)=>{var s,a;return`${e.id}-${i.id}-${n}`!==r&&o.push({id:i.id||null,type:n,nodeId:e.id,x:(((s=e.positionAbsolute)==null?void 0:s.x)??0)+i.x+i.width/2,y:(((a=e.positionAbsolute)==null?void 0:a.y)??0)+i.y+i.height/2}),o},[])}function _O(e,t,n){let r=null,o=1/0;return n.forEach(i=>{const s=Math.sqrt(Math.pow(i.x-e.x,2)+Math.pow(i.y-e.y,2));s<=t&&s<o&&(o=s,r=i)}),r}const wO={source:null,target:null,sourceHandle:null,targetHandle:null};function iv(e,t,n,r,o,i,s,a){const l=i==="target",u=a.querySelector(`.react-flow__handle[data-id="${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`),{x:c,y:d}=$n(e),f=a.elementFromPoint(c,d),h=f!=null&&f.classList.contains("react-flow__handle")?f:u,m={handleDomNode:h,isValid:!1,connection:wO,endHandle:null};if(h){const v=sv(void 0,h),y=h.getAttribute("data-nodeid"),p=h.getAttribute("data-handleid"),g=h.classList.contains("connectable"),S=h.classList.contains("connectableend"),_={source:l?y:r,sourceHandle:l?p:o,target:l?r:y,targetHandle:l?o:p};m.connection=_,g&&S&&(n===Hn.Strict?l&&v==="source"||!l&&v==="target":y!==r||p!==o)&&(m.endHandle={nodeId:y,handleId:p,type:v},m.isValid=s(_))}return m}function RO({nodes:e,nodeId:t,handleId:n,handleType:r}){return e.reduce((o,i)=>{if(i[we]){const{handleBounds:s}=i[we];let a=[],l=[];s&&(a=ov(i,s,"source",`${t}-${n}-${r}`),l=ov(i,s,"target",`${t}-${n}-${r}`)),o.push(...a,...l)}return o},[])}function sv(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function pd(e){e==null||e.classList.remove("valid","connecting","react-flow__handle-valid","react-flow__handle-connecting")}function NO(e,t){let n=null;return t?n="valid":e&&!t&&(n="invalid"),n}function av({event:e,handleId:t,nodeId:n,onConnect:r,isTarget:o,getState:i,setState:s,isValidConnection:a,edgeUpdaterType:l,onEdgeUpdateEnd:u}){const c=Fm(e.target),{connectionMode:d,domNode:f,autoPanOnConnect:h,connectionRadius:m,onConnectStart:v,panBy:y,getNodes:p,cancelConnection:g}=i();let S=0,_;const{x:w,y:R}=$n(e),C=c==null?void 0:c.elementFromPoint(w,R),L=sv(l,C),B=f==null?void 0:f.getBoundingClientRect();if(!B||!L)return;let I,V=$n(e,B),$=!1,F=null,O=!1,M=null;const D=RO({nodes:p(),nodeId:n,handleId:t,handleType:L}),A=()=>{if(!h)return;const[U,H]=Um(V,B);y({x:U,y:H}),S=requestAnimationFrame(A)};s({connectionPosition:V,connectionStatus:null,connectionNodeId:n,connectionHandleId:t,connectionHandleType:L,connectionStartHandle:{nodeId:n,handleId:t,type:L},connectionEndHandle:null}),v==null||v(e,{nodeId:n,handleId:t,handleType:L});function T(U){const{transform:H}=i();V=$n(U,B),_=_O(Jm(V,H,!1,[1,1]),m,D),$||(A(),$=!0);const j=iv(U,_,d,n,t,o?"target":"source",a,c);if(M=j.handleDomNode,F=j.connection,O=j.isValid,s({connectionPosition:_&&O?SO({x:_.x,y:_.y},H):V,connectionStatus:NO(!!_,O),connectionEndHandle:j.endHandle}),!_&&!O&&!M)return pd(I);F.source!==F.target&&M&&(pd(I),I=M,M.classList.add("connecting","react-flow__handle-connecting"),M.classList.toggle("valid",O),M.classList.toggle("react-flow__handle-valid",O))}function P(U){var H,j;(_||M)&&F&&O&&(r==null||r(F)),(j=(H=i()).onConnectEnd)==null||j.call(H,U),l&&(u==null||u(U)),pd(I),g(),cancelAnimationFrame(S),$=!1,O=!1,F=null,M=null,c.removeEventListener("mousemove",T),c.removeEventListener("mouseup",P),c.removeEventListener("touchmove",T),c.removeEventListener("touchend",P)}c.addEventListener("mousemove",T),c.addEventListener("mouseup",P),c.addEventListener("touchmove",T),c.addEventListener("touchend",P)}const lv=()=>!0,OO=e=>({connectionStartHandle:e.connectionStartHandle,connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName}),xO=(e,t,n)=>r=>{const{connectionStartHandle:o,connectionEndHandle:i,connectionClickStartHandle:s}=r;return{connecting:(o==null?void 0:o.nodeId)===e&&(o==null?void 0:o.handleId)===t&&(o==null?void 0:o.type)===n||(i==null?void 0:i.nodeId)===e&&(i==null?void 0:i.handleId)===t&&(i==null?void 0:i.type)===n,clickConnecting:(s==null?void 0:s.nodeId)===e&&(s==null?void 0:s.handleId)===t&&(s==null?void 0:s.type)===n}},uv=N.forwardRef(({type:e="source",position:t=Y.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:o=!0,isConnectableEnd:i=!0,id:s,onConnect:a,children:l,className:u,onMouseDown:c,onTouchStart:d,...f},h)=>{var B,I;const m=s||null,v=e==="target",y=xe(),p=mO(),{connectOnClick:g,noPanClassName:S}=le(OO,ze),{connecting:_,clickConnecting:w}=le(xO(p,m,e));p||(I=(B=y.getState()).onError)==null||I.call(B,"010",Bn.error010());const R=V=>{const{defaultEdgeOptions:$,onConnect:F,hasDefaultEdges:O}=y.getState(),M={...$,...V};if(O){const{edges:D,setEdges:A}=y.getState();A(Zm(M,D))}F==null||F(M),a==null||a(M)},C=V=>{if(!p)return;const $=Hm(V);o&&($&&V.button===0||!$)&&av({event:V,handleId:m,nodeId:p,onConnect:R,isTarget:v,getState:y.getState,setState:y.setState,isValidConnection:n||y.getState().isValidConnection||lv}),$?c==null||c(V):d==null||d(V)},L=V=>{const{onClickConnectStart:$,onClickConnectEnd:F,connectionClickStartHandle:O,connectionMode:M,isValidConnection:D}=y.getState();if(!p||!O&&!o)return;if(!O){$==null||$(V,{nodeId:p,handleId:m,handleType:e}),y.setState({connectionClickStartHandle:{nodeId:p,type:e,handleId:m}});return}const A=Fm(V.target),T=n||D||lv,{connection:P,isValid:U}=iv(V,{nodeId:p,id:m,type:e},M,O.nodeId,O.handleId||null,O.type,T,A);U&&R(P),F==null||F(V),y.setState({connectionClickStartHandle:null})};return E("div",{"data-handleid":m,"data-nodeid":p,"data-handlepos":t,"data-id":`${p}-${m}-${e}`,className:Je(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",S,u,{source:!v,target:v,connectable:r,connectablestart:o,connectableend:i,connecting:w,connectionindicator:r&&(o&&!_||i&&_)}]),onMouseDown:C,onTouchStart:C,onClick:g?L:void 0,ref:h,...f,children:l})});uv.displayName="Handle";var Ro=N.memo(uv);const cv=({data:e,isConnectable:t,targetPosition:n=Y.Top,sourcePosition:r=Y.Bottom})=>k(ve,{children:[E(Ro,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,E(Ro,{type:"source",position:r,isConnectable:t})]});cv.displayName="DefaultNode";var hd=N.memo(cv);const dv=({data:e,isConnectable:t,sourcePosition:n=Y.Bottom})=>k(ve,{children:[e==null?void 0:e.label,E(Ro,{type:"source",position:n,isConnectable:t})]});dv.displayName="InputNode";var fv=N.memo(dv);const pv=({data:e,isConnectable:t,targetPosition:n=Y.Top})=>k(ve,{children:[E(Ro,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]});pv.displayName="OutputNode";var hv=N.memo(pv);const gd=()=>null;gd.displayName="GroupNode";const TO=e=>({selectedNodes:e.getNodes().filter(t=>t.selected),selectedEdges:e.edges.filter(t=>t.selected)}),Ja=e=>e.id;function CO(e,t){return ze(e.selectedNodes.map(Ja),t.selectedNodes.map(Ja))&&ze(e.selectedEdges.map(Ja),t.selectedEdges.map(Ja))}const gv=N.memo(({onSelectionChange:e})=>{const t=xe(),{selectedNodes:n,selectedEdges:r}=le(TO,CO);return N.useEffect(()=>{var i,s;const o={nodes:n,edges:r};e==null||e(o),(s=(i=t.getState()).onSelectionChange)==null||s.call(i,o)},[n,r,e]),null});gv.displayName="SelectionListener";const IO=e=>!!e.onSelectionChange;function bO({onSelectionChange:e}){const t=le(IO);return e||t?E(gv,{onSelectionChange:e}):null}const AO=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset});function No(e,t){N.useEffect(()=>{typeof e<"u"&&t(e)},[e])}function q(e,t,n){N.useEffect(()=>{typeof t<"u"&&n({[e]:t})},[t])}const LO=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:o,onConnectStart:i,onConnectEnd:s,onClickConnectStart:a,onClickConnectEnd:l,nodesDraggable:u,nodesConnectable:c,nodesFocusable:d,edgesFocusable:f,edgesUpdatable:h,elevateNodesOnSelect:m,minZoom:v,maxZoom:y,nodeExtent:p,onNodesChange:g,onEdgesChange:S,elementsSelectable:_,connectionMode:w,snapGrid:R,snapToGrid:C,translateExtent:L,connectOnClick:B,defaultEdgeOptions:I,fitView:V,fitViewOptions:$,onNodesDelete:F,onEdgesDelete:O,onNodeDrag:M,onNodeDragStart:D,onNodeDragStop:A,onSelectionDrag:T,onSelectionDragStart:P,onSelectionDragStop:U,noPanClassName:H,nodeOrigin:j,rfId:K,autoPanOnConnect:W,autoPanOnNodeDrag:Z,onError:X,connectionRadius:te,isValidConnection:oe})=>{const{setNodes:ge,setEdges:ue,setDefaultNodesAndEdges:Te,setMinZoom:Ye,setMaxZoom:ft,setTranslateExtent:me,setNodeExtent:de,reset:tt}=le(AO,ze),Q=xe();return N.useEffect(()=>{const Zn=r==null?void 0:r.map(Tr=>({...Tr,...I}));return Te(n,Zn),()=>{tt()}},[]),q("defaultEdgeOptions",I,Q.setState),q("connectionMode",w,Q.setState),q("onConnect",o,Q.setState),q("onConnectStart",i,Q.setState),q("onConnectEnd",s,Q.setState),q("onClickConnectStart",a,Q.setState),q("onClickConnectEnd",l,Q.setState),q("nodesDraggable",u,Q.setState),q("nodesConnectable",c,Q.setState),q("nodesFocusable",d,Q.setState),q("edgesFocusable",f,Q.setState),q("edgesUpdatable",h,Q.setState),q("elementsSelectable",_,Q.setState),q("elevateNodesOnSelect",m,Q.setState),q("snapToGrid",C,Q.setState),q("snapGrid",R,Q.setState),q("onNodesChange",g,Q.setState),q("onEdgesChange",S,Q.setState),q("connectOnClick",B,Q.setState),q("fitViewOnInit",V,Q.setState),q("fitViewOnInitOptions",$,Q.setState),q("onNodesDelete",F,Q.setState),q("onEdgesDelete",O,Q.setState),q("onNodeDrag",M,Q.setState),q("onNodeDragStart",D,Q.setState),q("onNodeDragStop",A,Q.setState),q("onSelectionDrag",T,Q.setState),q("onSelectionDragStart",P,Q.setState),q("onSelectionDragStop",U,Q.setState),q("noPanClassName",H,Q.setState),q("nodeOrigin",j,Q.setState),q("rfId",K,Q.setState),q("autoPanOnConnect",W,Q.setState),q("autoPanOnNodeDrag",Z,Q.setState),q("onError",X,Q.setState),q("connectionRadius",te,Q.setState),q("isValidConnection",oe,Q.setState),No(e,ge),No(t,ue),No(v,Ye),No(y,ft),No(L,me),No(p,de),null},mv={display:"none"},DO={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},vv="react-flow__node-desc",yv="react-flow__edge-desc",kO="react-flow__aria-live",PO=e=>e.ariaLiveMessage;function MO({rfId:e}){const t=le(PO);return E("div",{id:`${kO}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:DO,children:t})}function UO({rfId:e,disableKeyboardA11y:t}){return k(ve,{children:[k("div",{id:`${vv}-${e}`,style:mv,children:["Press enter or space to select a node.",!t&&"You can then use the arrow keys to move the node around."," Press delete to remove it and escape to cancel."," "]}),E("div",{id:`${yv}-${e}`,style:mv,children:"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel."}),!t&&E(MO,{rfId:e})]})}const FO=(e,t,n)=>n===Y.Left?e-t:n===Y.Right?e+t:e,VO=(e,t,n)=>n===Y.Top?e-t:n===Y.Bottom?e+t:e,Ev="react-flow__edgeupdater",Sv=({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:o,onMouseEnter:i,onMouseOut:s,type:a})=>E("circle",{onMouseDown:o,onMouseEnter:i,onMouseOut:s,className:Je([Ev,`${Ev}-${a}`]),cx:FO(t,r,e),cy:VO(n,r,e),r,stroke:"transparent",fill:"transparent"}),BO=()=>!0;var Oo=e=>{const t=({id:n,className:r,type:o,data:i,onClick:s,onEdgeDoubleClick:a,selected:l,animated:u,label:c,labelStyle:d,labelShowBg:f,labelBgStyle:h,labelBgPadding:m,labelBgBorderRadius:v,style:y,source:p,target:g,sourceX:S,sourceY:_,targetX:w,targetY:R,sourcePosition:C,targetPosition:L,elementsSelectable:B,hidden:I,sourceHandleId:V,targetHandleId:$,onContextMenu:F,onMouseEnter:O,onMouseMove:M,onMouseLeave:D,edgeUpdaterRadius:A,onEdgeUpdate:T,onEdgeUpdateStart:P,onEdgeUpdateEnd:U,markerEnd:H,markerStart:j,rfId:K,ariaLabel:W,isFocusable:Z,isUpdatable:X,pathOptions:te,interactionWidth:oe})=>{const ge=N.useRef(null),[ue,Te]=N.useState(!1),[Ye,ft]=N.useState(!1),me=xe(),de=N.useMemo(()=>`url(#${fd(j,K)})`,[j,K]),tt=N.useMemo(()=>`url(#${fd(H,K)})`,[H,K]);if(I)return null;const Q=nt=>{const{edges:Ft,addSelectedEdges:br}=me.getState();if(B&&(me.setState({nodesSelectionActive:!1}),br([n])),s){const Ar=Ft.find(Lr=>Lr.id===n);s(nt,Ar)}},Zn=$i(n,me.getState,a),Tr=$i(n,me.getState,F),us=$i(n,me.getState,O),cs=$i(n,me.getState,M),ko=$i(n,me.getState,D),Cr=(nt,Ft)=>{if(nt.button!==0)return;const{edges:br,isValidConnection:Ar}=me.getState(),Lr=Ft?g:p,El=(Ft?$:V)||null,Dr=Ft?"target":"source",cf=Ar||BO,df=Ft,fs=br.find(kr=>kr.id===n);ft(!0),P==null||P(nt,fs,Dr);const ff=kr=>{ft(!1),U==null||U(kr,fs,Dr)};av({event:nt,handleId:El,nodeId:Lr,onConnect:kr=>T==null?void 0:T(fs,kr),isTarget:df,getState:me.getState,setState:me.setState,isValidConnection:cf,edgeUpdaterType:Dr,onEdgeUpdateEnd:ff})},Jn=nt=>Cr(nt,!0),Po=nt=>Cr(nt,!1),er=()=>Te(!0),Ir=()=>Te(!1),ds=!B&&!s,Mo=nt=>{var Ft;if($m.includes(nt.key)&&B){const{unselectNodesAndEdges:br,addSelectedEdges:Ar,edges:Lr}=me.getState();nt.key==="Escape"?((Ft=ge.current)==null||Ft.blur(),br({edges:[Lr.find(Dr=>Dr.id===n)]})):Ar([n])}};return k("g",{className:Je(["react-flow__edge",`react-flow__edge-${o}`,r,{selected:l,animated:u,inactive:ds,updating:ue}]),onClick:Q,onDoubleClick:Zn,onContextMenu:Tr,onMouseEnter:us,onMouseMove:cs,onMouseLeave:ko,onKeyDown:Z?Mo:void 0,tabIndex:Z?0:void 0,role:Z?"button":void 0,"data-testid":`rf__edge-${n}`,"aria-label":W===null?void 0:W||`Edge from ${p} to ${g}`,"aria-describedby":Z?`${yv}-${K}`:void 0,ref:ge,children:[!Ye&&E(e,{id:n,source:p,target:g,selected:l,animated:u,label:c,labelStyle:d,labelShowBg:f,labelBgStyle:h,labelBgPadding:m,labelBgBorderRadius:v,data:i,style:y,sourceX:S,sourceY:_,targetX:w,targetY:R,sourcePosition:C,targetPosition:L,sourceHandleId:V,targetHandleId:$,markerStart:de,markerEnd:tt,pathOptions:te,interactionWidth:oe}),X&&k(ve,{children:[(X==="source"||X===!0)&&E(Sv,{position:C,centerX:S,centerY:_,radius:A,onMouseDown:Jn,onMouseEnter:er,onMouseOut:Ir,type:"source"}),(X==="target"||X===!0)&&E(Sv,{position:L,centerX:w,centerY:R,radius:A,onMouseDown:Po,onMouseEnter:er,onMouseOut:Ir,type:"target"})]})]})};return t.displayName="EdgeWrapper",N.memo(t)};function $O(e){const t={default:Oo(e.default||Za),straight:Oo(e.bezier||cd),step:Oo(e.step||ud),smoothstep:Oo(e.step||Xa),simplebezier:Oo(e.simplebezier||ld)},n={},r=Object.keys(e).filter(o=>!["default","bezier"].includes(o)).reduce((o,i)=>(o[i]=Oo(e[i]||Za),o),n);return{...t,...r}}function _v(e,t,n=null){const r=((n==null?void 0:n.x)||0)+t.x,o=((n==null?void 0:n.y)||0)+t.y,i=(n==null?void 0:n.width)||t.width,s=(n==null?void 0:n.height)||t.height;switch(e){case Y.Top:return{x:r+i/2,y:o};case Y.Right:return{x:r+i,y:o+s/2};case Y.Bottom:return{x:r+i/2,y:o+s};case Y.Left:return{x:r,y:o+s/2}}}function wv(e,t){return e?e.length===1||!t?e[0]:t&&e.find(n=>n.id===t)||null:null}const HO=(e,t,n,r,o,i)=>{const s=_v(n,e,t),a=_v(i,r,o);return{sourceX:s.x,sourceY:s.y,targetX:a.x,targetY:a.y}};function zO({sourcePos:e,targetPos:t,sourceWidth:n,sourceHeight:r,targetWidth:o,targetHeight:i,width:s,height:a,transform:l}){const u={x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x+n,t.x+o),y2:Math.max(e.y+r,t.y+i)};u.x===u.x2&&(u.x2+=1),u.y===u.y2&&(u.y2+=1);const c=Vm({x:(0-l[0])/l[2],y:(0-l[1])/l[2],width:s/l[2],height:a/l[2]}),d=Math.max(0,Math.min(c.x2,u.x2)-Math.max(c.x,u.x)),f=Math.max(0,Math.min(c.y2,u.y2)-Math.max(c.y,u.y));return Math.ceil(d*f)>0}function Rv(e){var r,o,i,s,a;const t=((r=e==null?void 0:e[we])==null?void 0:r.handleBounds)||null,n=t&&(e==null?void 0:e.width)&&(e==null?void 0:e.height)&&typeof((o=e==null?void 0:e.positionAbsolute)==null?void 0:o.x)<"u"&&typeof((i=e==null?void 0:e.positionAbsolute)==null?void 0:i.y)<"u";return[{x:((s=e==null?void 0:e.positionAbsolute)==null?void 0:s.x)||0,y:((a=e==null?void 0:e.positionAbsolute)==null?void 0:a.y)||0,width:(e==null?void 0:e.width)||0,height:(e==null?void 0:e.height)||0},t,!!n]}function Nv(e,t){if(!e.parentNode)return!1;const n=t.get(e.parentNode);return n?n.selected?!0:Nv(n,t):!1}function Ov(e,t,n){let r=e;do{if(r!=null&&r.matches(t))return!0;if(r===n.current)return!1;r=r.parentElement}while(r);return!1}function jO(e,t,n,r){return Array.from(e.values()).filter(o=>(o.selected||o.id===r)&&(!o.parentNode||!Nv(o,e))&&(o.draggable||t&&typeof o.draggable>"u")).map(o=>{var i,s;return{id:o.id,position:o.position||{x:0,y:0},positionAbsolute:o.positionAbsolute||{x:0,y:0},distance:{x:n.x-(((i=o.positionAbsolute)==null?void 0:i.x)??0),y:n.y-(((s=o.positionAbsolute)==null?void 0:s.y)??0)},delta:{x:0,y:0},extent:o.extent,parentNode:o.parentNode,width:o.width,height:o.height}})}function xv(e,t,n,r,o=[0,0],i){let s=e.extent||r;if(e.extent==="parent")if(e.parentNode&&e.width&&e.height){const u=n.get(e.parentNode),{x:c,y:d}=wo(u,o).positionAbsolute;s=u&&St(c)&&St(d)&&St(u.width)&&St(u.height)?[[c+e.width*o[0],d+e.height*o[1]],[c+u.width-e.width+e.width*o[0],d+u.height-e.height+e.height*o[1]]]:s}else i==null||i("005",Bn.error005()),s=r;else if(e.extent&&e.parentNode){const u=n.get(e.parentNode),{x:c,y:d}=wo(u,o).positionAbsolute;s=[[e.extent[0][0]+c,e.extent[0][1]+d],[e.extent[1][0]+c,e.extent[1][1]+d]]}let a={x:0,y:0};if(e.parentNode){const u=n.get(e.parentNode);a=wo(u,o).positionAbsolute}const l=s?id(t,s):t;return{position:{x:l.x-a.x,y:l.y-a.y},positionAbsolute:l}}function md({nodeId:e,dragItems:t,nodeInternals:n}){const r=t.map(o=>({...n.get(o.id),position:o.position,positionAbsolute:o.positionAbsolute}));return[e?r.find(o=>o.id===e):r[0],r]}const Tv=(e,t,n,r)=>{const o=t.querySelectorAll(e);if(!o||!o.length)return null;const i=Array.from(o),s=t.getBoundingClientRect(),a={x:s.width*r[0],y:s.height*r[1]};return i.map(l=>{const u=l.getBoundingClientRect();return{id:l.getAttribute("data-handleid"),position:l.getAttribute("data-handlepos"),x:(u.left-s.left-a.x)/n,y:(u.top-s.top-a.y)/n,...od(l)}})};function Gi(e,t,n){return n===void 0?n:r=>{const o=t().nodeInternals.get(e);n(r,{...o})}}function vd({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:o,unselectNodesAndEdges:i,multiSelectionActive:s,nodeInternals:a}=t.getState(),l=a.get(e);t.setState({nodesSelectionActive:!1}),l.selected?(n||l.selected&&s)&&(i({nodes:[l]}),requestAnimationFrame(()=>{var u;return(u=r==null?void 0:r.current)==null?void 0:u.blur()})):o([e])}function GO(){const e=xe();return N.useCallback(({sourceEvent:n})=>{const{transform:r,snapGrid:o,snapToGrid:i}=e.getState(),s=n.touches?n.touches[0].clientX:n.clientX,a=n.touches?n.touches[0].clientY:n.clientY,l={x:(s-r[0])/r[2],y:(a-r[1])/r[2]};return{xSnapped:i?o[0]*Math.round(l.x/o[0]):l.x,ySnapped:i?o[1]*Math.round(l.y/o[1]):l.y,...l}},[])}function yd(e){return(t,n,r)=>e==null?void 0:e(t,r)}function Cv({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:o,isSelectable:i,selectNodesOnDrag:s}){const a=xe(),[l,u]=N.useState(!1),c=N.useRef([]),d=N.useRef({x:null,y:null}),f=N.useRef(0),h=N.useRef(null),m=N.useRef({x:0,y:0}),v=N.useRef(null),y=N.useRef(!1),p=GO();return N.useEffect(()=>{if(e!=null&&e.current){const g=At(e.current),S=({x:w,y:R})=>{const{nodeInternals:C,onNodeDrag:L,onSelectionDrag:B,updateNodePositions:I,nodeExtent:V,snapGrid:$,snapToGrid:F,nodeOrigin:O,onError:M}=a.getState();d.current={x:w,y:R};let D=!1;if(c.current=c.current.map(T=>{const P={x:w-T.distance.x,y:R-T.distance.y};F&&(P.x=$[0]*Math.round(P.x/$[0]),P.y=$[1]*Math.round(P.y/$[1]));const U=xv(T,P,C,V,O,M);return D=D||T.position.x!==U.position.x||T.position.y!==U.position.y,T.position=U.position,T.positionAbsolute=U.positionAbsolute,T}),!D)return;I(c.current,!0,!0),u(!0);const A=o?L:yd(B);if(A&&v.current){const[T,P]=md({nodeId:o,dragItems:c.current,nodeInternals:C});A(v.current,T,P)}},_=()=>{if(!h.current)return;const[w,R]=Um(m.current,h.current);if(w!==0||R!==0){const{transform:C,panBy:L}=a.getState();d.current.x=(d.current.x??0)-w/C[2],d.current.y=(d.current.y??0)-R/C[2],S(d.current),L({x:w,y:R})}f.current=requestAnimationFrame(_)};if(t)g.on(".drag",null);else{const w=cR().on("start",R=>{var D;const{nodeInternals:C,multiSelectionActive:L,domNode:B,nodesDraggable:I,unselectNodesAndEdges:V,onNodeDragStart:$,onSelectionDragStart:F}=a.getState(),O=o?$:yd(F);!s&&!L&&o&&((D=C.get(o))!=null&&D.selected||V()),o&&i&&s&&vd({id:o,store:a,nodeRef:e});const M=p(R);if(d.current=M,c.current=jO(C,I,M,o),O&&c.current){const[A,T]=md({nodeId:o,dragItems:c.current,nodeInternals:C});O(R.sourceEvent,A,T)}h.current=(B==null?void 0:B.getBoundingClientRect())||null,m.current=$n(R.sourceEvent,h.current)}).on("drag",R=>{const C=p(R),{autoPanOnNodeDrag:L}=a.getState();!y.current&&L&&(y.current=!0,_()),(d.current.x!==C.xSnapped||d.current.y!==C.ySnapped)&&c.current&&(v.current=R.sourceEvent,m.current=$n(R.sourceEvent,h.current),S(C))}).on("end",R=>{if(u(!1),y.current=!1,cancelAnimationFrame(f.current),c.current){const{updateNodePositions:C,nodeInternals:L,onNodeDragStop:B,onSelectionDragStop:I}=a.getState(),V=o?B:yd(I);if(C(c.current,!1,!1),V){const[$,F]=md({nodeId:o,dragItems:c.current,nodeInternals:L});V(R.sourceEvent,$,F)}}}).filter(R=>{const C=R.target;return!R.button&&(!n||!Ov(C,`.${n}`,e))&&(!r||Ov(C,r,e))});return g.call(w),()=>{g.on(".drag",null)}}}},[e,t,n,r,i,a,o,s,p]),l}function Iv(){const e=xe();return N.useCallback(n=>{const{nodeInternals:r,nodeExtent:o,updateNodePositions:i,getNodes:s,snapToGrid:a,snapGrid:l,onError:u,nodesDraggable:c}=e.getState(),d=s().filter(g=>g.selected&&(g.draggable||c&&typeof g.draggable>"u")),f=a?l[0]:5,h=a?l[1]:5,m=n.isShiftPressed?4:1,v=n.x*f*m,y=n.y*h*m,p=d.map(g=>{if(g.positionAbsolute){const S={x:g.positionAbsolute.x+v,y:g.positionAbsolute.y+y};a&&(S.x=l[0]*Math.round(S.x/l[0]),S.y=l[1]*Math.round(S.y/l[1]));const{positionAbsolute:_,position:w}=xv(g,S,r,o,void 0,u);g.position=w,g.positionAbsolute=_}return g});i(p,!0,!1)},[])}const xo={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};var Yi=e=>{const t=({id:n,type:r,data:o,xPos:i,yPos:s,xPosOrigin:a,yPosOrigin:l,selected:u,onClick:c,onMouseEnter:d,onMouseMove:f,onMouseLeave:h,onContextMenu:m,onDoubleClick:v,style:y,className:p,isDraggable:g,isSelectable:S,isConnectable:_,isFocusable:w,selectNodesOnDrag:R,sourcePosition:C,targetPosition:L,hidden:B,resizeObserver:I,dragHandle:V,zIndex:$,isParent:F,noDragClassName:O,noPanClassName:M,initialized:D,disableKeyboardA11y:A,ariaLabel:T,rfId:P})=>{const U=xe(),H=N.useRef(null),j=N.useRef(C),K=N.useRef(L),W=N.useRef(r),Z=S||g||c||d||f||h,X=Iv(),te=Gi(n,U.getState,d),oe=Gi(n,U.getState,f),ge=Gi(n,U.getState,h),ue=Gi(n,U.getState,m),Te=Gi(n,U.getState,v),Ye=de=>{if(S&&(!R||!g)&&vd({id:n,store:U,nodeRef:H}),c){const tt=U.getState().nodeInternals.get(n);c(de,{...tt})}},ft=de=>{if(!ad(de))if($m.includes(de.key)&&S){const tt=de.key==="Escape";vd({id:n,store:U,unselect:tt,nodeRef:H})}else!A&&g&&u&&Object.prototype.hasOwnProperty.call(xo,de.key)&&(U.setState({ariaLiveMessage:`Moved selected node ${de.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~i}, y: ${~~s}`}),X({x:xo[de.key].x,y:xo[de.key].y,isShiftPressed:de.shiftKey}))};N.useEffect(()=>{if(H.current&&!B){const de=H.current;return I==null||I.observe(de),()=>I==null?void 0:I.unobserve(de)}},[B]),N.useEffect(()=>{const de=W.current!==r,tt=j.current!==C,Q=K.current!==L;H.current&&(de||tt||Q)&&(de&&(W.current=r),tt&&(j.current=C),Q&&(K.current=L),U.getState().updateNodeDimensions([{id:n,nodeElement:H.current,forceUpdate:!0}]))},[n,r,C,L]);const me=Cv({nodeRef:H,disabled:B||!g,noDragClassName:O,handleSelector:V,nodeId:n,isSelectable:S,selectNodesOnDrag:R});return B?null:E("div",{className:Je(["react-flow__node",`react-flow__node-${r}`,{[M]:g},p,{selected:u,selectable:S,parent:F,dragging:me}]),ref:H,style:{zIndex:$,transform:`translate(${a}px,${l}px)`,pointerEvents:Z?"all":"none",visibility:D?"visible":"hidden",...y},"data-id":n,"data-testid":`rf__node-${n}`,onMouseEnter:te,onMouseMove:oe,onMouseLeave:ge,onContextMenu:ue,onClick:Ye,onDoubleClick:Te,onKeyDown:w?ft:void 0,tabIndex:w?0:void 0,role:w?"button":void 0,"aria-describedby":A?void 0:`${vv}-${P}`,"aria-label":T,children:E(gO,{value:n,children:E(e,{id:n,data:o,type:r,xPos:i,yPos:s,selected:u,isConnectable:_,sourcePosition:C,targetPosition:L,dragging:me,dragHandle:V,zIndex:$})})})};return t.displayName="NodeWrapper",N.memo(t)};function YO(e){const t={input:Yi(e.input||fv),default:Yi(e.default||hd),output:Yi(e.output||hv),group:Yi(e.group||gd)},n={},r=Object.keys(e).filter(o=>!["input","default","output","group"].includes(o)).reduce((o,i)=>(o[i]=Yi(e[i]||hd),o),n);return{...t,...r}}const WO=({x:e,y:t,width:n,height:r,origin:o})=>!n||!r?{x:e,y:t}:o[0]<0||o[1]<0||o[0]>1||o[1]>1?{x:e,y:t}:{x:e-n*o[0],y:t-r*o[1]},KO=typeof document<"u"?document:null;var Wi=(e=null,t={target:KO})=>{const[n,r]=N.useState(!1),o=N.useRef(!1),i=N.useRef(new Set([])),[s,a]=N.useMemo(()=>{if(e!==null){const u=(Array.isArray(e)?e:[e]).filter(d=>typeof d=="string").map(d=>d.split("+")),c=u.reduce((d,f)=>d.concat(...f),[]);return[u,c]}return[[],[]]},[e]);return N.useEffect(()=>{var l,u;if(e!==null){const c=h=>{if(o.current=h.ctrlKey||h.metaKey||h.shiftKey,!o.current&&ad(h))return!1;const m=Av(h.code,a);i.current.add(h[m]),bv(s,i.current,!1)&&(h.preventDefault(),r(!0))},d=h=>{if(!o.current&&ad(h))return!1;const m=Av(h.code,a);bv(s,i.current,!0)?(r(!1),i.current.clear()):i.current.delete(h[m]),o.current=!1},f=()=>{i.current.clear(),r(!1)};return(l=t==null?void 0:t.target)==null||l.addEventListener("keydown",c),(u=t==null?void 0:t.target)==null||u.addEventListener("keyup",d),window.addEventListener("blur",f),()=>{var h,m;(h=t==null?void 0:t.target)==null||h.removeEventListener("keydown",c),(m=t==null?void 0:t.target)==null||m.removeEventListener("keyup",d),window.removeEventListener("blur",f)}}},[e,r]),n};function bv(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(o=>t.has(o)))}function Av(e,t){return t.includes(e)?"code":"key"}function Lv(e,t,n,r){var s,a;if(!e.parentNode)return n;const o=t.get(e.parentNode),i=wo(o,r);return Lv(o,t,{x:(n.x??0)+i.x,y:(n.y??0)+i.y,z:(((s=o[we])==null?void 0:s.z)??0)>(n.z??0)?((a=o[we])==null?void 0:a.z)??0:n.z??0},r)}function Dv(e,t,n){e.forEach(r=>{var o;if(r.parentNode&&!e.has(r.parentNode))throw new Error(`Parent node ${r.parentNode} not found`);if(r.parentNode||n!=null&&n[r.id]){const{x:i,y:s,z:a}=Lv(r,e,{...r.position,z:((o=r[we])==null?void 0:o.z)??0},t);r.positionAbsolute={x:i,y:s},r[we].z=a,n!=null&&n[r.id]&&(r[we].isParent=!0)}})}function Ed(e,t,n,r){const o=new Map,i={},s=r?1e3:0;return e.forEach(a=>{var d;const l=(St(a.zIndex)?a.zIndex:0)+(a.selected?s:0),u=t.get(a.id),c={width:u==null?void 0:u.width,height:u==null?void 0:u.height,...a,positionAbsolute:{x:a.position.x,y:a.position.y}};a.parentNode&&(c.parentNode=a.parentNode,i[a.parentNode]=!0),Object.defineProperty(c,we,{enumerable:!1,value:{handleBounds:(d=u==null?void 0:u[we])==null?void 0:d.handleBounds,z:l}}),o.set(a.id,c)}),Dv(o,n,i),o}function kv(e,t={}){const{getNodes:n,width:r,height:o,minZoom:i,maxZoom:s,d3Zoom:a,d3Selection:l,fitViewOnInitDone:u,fitViewOnInit:c,nodeOrigin:d}=e(),f=t.initial&&!u&&c;if(a&&l&&(f||!t.initial)){const m=n().filter(y=>{var g;const p=t.includeHiddenNodes?y.width&&y.height:!y.hidden;return(g=t.nodes)!=null&&g.length?p&&t.nodes.some(S=>S.id===y.id):p}),v=m.every(y=>y.width&&y.height);if(m.length>0&&v){const y=ev(m,d),[p,g,S]=rv(y,r,o,t.minZoom??i,t.maxZoom??s,t.padding??.1),_=Vn.translate(p,g).scale(S);return typeof t.duration=="number"&&t.duration>0?a.transform(yr(l,t.duration),_):a.transform(l,_),!0}}return!1}function QO(e,t){return e.forEach(n=>{const r=t.get(n.id);r&&t.set(r.id,{...r,[we]:r[we],selected:n.selected})}),new Map(t)}function XO(e,t){return t.map(n=>{const r=e.find(o=>o.id===n.id);return r&&(n.selected=r.selected),n})}function el({changedNodes:e,changedEdges:t,get:n,set:r}){const{nodeInternals:o,edges:i,onNodesChange:s,onEdgesChange:a,hasDefaultNodes:l,hasDefaultEdges:u}=n();e!=null&&e.length&&(l&&r({nodeInternals:QO(e,o)}),s==null||s(e)),t!=null&&t.length&&(u&&r({edges:XO(t,i)}),a==null||a(t))}const To=()=>{},qO={zoomIn:To,zoomOut:To,zoomTo:To,getZoom:()=>1,setViewport:To,getViewport:()=>({x:0,y:0,zoom:1}),fitView:()=>!1,setCenter:To,fitBounds:To,project:e=>e,viewportInitialized:!1},ZO=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection}),JO=()=>{const e=xe(),{d3Zoom:t,d3Selection:n}=le(ZO,ze);return N.useMemo(()=>n&&t?{zoomIn:o=>t.scaleBy(yr(n,o==null?void 0:o.duration),1.2),zoomOut:o=>t.scaleBy(yr(n,o==null?void 0:o.duration),1/1.2),zoomTo:(o,i)=>t.scaleTo(yr(n,i==null?void 0:i.duration),o),getZoom:()=>e.getState().transform[2],setViewport:(o,i)=>{const[s,a,l]=e.getState().transform,u=Vn.translate(o.x??s,o.y??a).scale(o.zoom??l);t.transform(yr(n,i==null?void 0:i.duration),u)},getViewport:()=>{const[o,i,s]=e.getState().transform;return{x:o,y:i,zoom:s}},fitView:o=>kv(e.getState,o),setCenter:(o,i,s)=>{const{width:a,height:l,maxZoom:u}=e.getState(),c=typeof(s==null?void 0:s.zoom)<"u"?s.zoom:u,d=a/2-o*c,f=l/2-i*c,h=Vn.translate(d,f).scale(c);t.transform(yr(n,s==null?void 0:s.duration),h)},fitBounds:(o,i)=>{const{width:s,height:a,minZoom:l,maxZoom:u}=e.getState(),[c,d,f]=rv(o,s,a,l,u,(i==null?void 0:i.padding)??.1),h=Vn.translate(c,d).scale(f);t.transform(yr(n,i==null?void 0:i.duration),h)},project:o=>{const{transform:i,snapToGrid:s,snapGrid:a}=e.getState();return Jm(o,i,s,a)},viewportInitialized:!0}:qO,[t,n])};function Sd(){const e=JO(),t=xe(),n=N.useCallback(()=>t.getState().getNodes().map(v=>({...v})),[]),r=N.useCallback(v=>t.getState().nodeInternals.get(v),[]),o=N.useCallback(()=>{const{edges:v=[]}=t.getState();return v.map(y=>({...y}))},[]),i=N.useCallback(v=>{const{edges:y=[]}=t.getState();return y.find(p=>p.id===v)},[]),s=N.useCallback(v=>{const{getNodes:y,setNodes:p,hasDefaultNodes:g,onNodesChange:S}=t.getState(),_=y(),w=typeof v=="function"?v(_):v;if(g)p(w);else if(S){const R=w.length===0?_.map(C=>({type:"remove",id:C.id})):w.map(C=>({item:C,type:"reset"}));S(R)}},[]),a=N.useCallback(v=>{const{edges:y=[],setEdges:p,hasDefaultEdges:g,onEdgesChange:S}=t.getState(),_=typeof v=="function"?v(y):v;if(g)p(_);else if(S){const w=_.length===0?y.map(R=>({type:"remove",id:R.id})):_.map(R=>({item:R,type:"reset"}));S(w)}},[]),l=N.useCallback(v=>{const y=Array.isArray(v)?v:[v],{getNodes:p,setNodes:g,hasDefaultNodes:S,onNodesChange:_}=t.getState();if(S){const R=[...p(),...y];g(R)}else if(_){const w=y.map(R=>({item:R,type:"add"}));_(w)}},[]),u=N.useCallback(v=>{const y=Array.isArray(v)?v:[v],{edges:p=[],setEdges:g,hasDefaultEdges:S,onEdgesChange:_}=t.getState();if(S)g([...p,...y]);else if(_){const w=y.map(R=>({item:R,type:"add"}));_(w)}},[]),c=N.useCallback(()=>{const{getNodes:v,edges:y=[],transform:p}=t.getState(),[g,S,_]=p;return{nodes:v().map(w=>({...w})),edges:y.map(w=>({...w})),viewport:{x:g,y:S,zoom:_}}},[]),d=N.useCallback(({nodes:v,edges:y})=>{const{nodeInternals:p,getNodes:g,edges:S,hasDefaultNodes:_,hasDefaultEdges:w,onNodesDelete:R,onEdgesDelete:C,onNodesChange:L,onEdgesChange:B}=t.getState(),I=(v||[]).map(M=>M.id),V=(y||[]).map(M=>M.id),$=g().reduce((M,D)=>{const A=!I.includes(D.id)&&D.parentNode&&M.find(P=>P.id===D.parentNode);return(typeof D.deletable=="boolean"?D.deletable:!0)&&(I.includes(D.id)||A)&&M.push(D),M},[]),F=S.filter(M=>typeof M.deletable=="boolean"?M.deletable:!0),O=F.filter(M=>V.includes(M.id));if($||O){const M=nv($,F),D=[...O,...M],A=D.reduce((T,P)=>(T.includes(P.id)||T.push(P.id),T),[]);if((w||_)&&(w&&t.setState({edges:S.filter(T=>!A.includes(T.id))}),_&&($.forEach(T=>{p.delete(T.id)}),t.setState({nodeInternals:new Map(p)}))),A.length>0&&(C==null||C(D),B&&B(A.map(T=>({id:T,type:"remove"})))),$.length>0&&(R==null||R($),L)){const T=$.map(P=>({id:P.id,type:"remove"}));L(T)}}},[]),f=N.useCallback(v=>{const y=lO(v),p=y?null:t.getState().nodeInternals.get(v.id);return[y?v:Bm(p),p,y]},[]),h=N.useCallback((v,y=!0,p)=>{const[g,S,_]=f(v);return g?(p||t.getState().getNodes()).filter(w=>{if(!_&&(w.id===S.id||!w.positionAbsolute))return!1;const R=Bm(w),C=sd(R,g);return y&&C>0||C>=v.width*v.height}):[]},[]),m=N.useCallback((v,y,p=!0)=>{const[g]=f(v);if(!g)return!1;const S=sd(g,y);return p&&S>0||S>=v.width*v.height},[]);return N.useMemo(()=>({...e,getNodes:n,getNode:r,getEdges:o,getEdge:i,setNodes:s,setEdges:a,addNodes:l,addEdges:u,toObject:c,deleteElements:d,getIntersectingNodes:h,isNodeIntersecting:m}),[e,n,r,o,i,s,a,l,u,c,d,h,m])}var ex=({deleteKeyCode:e,multiSelectionKeyCode:t})=>{const n=xe(),{deleteElements:r}=Sd(),o=Wi(e),i=Wi(t);N.useEffect(()=>{if(o){const{edges:s,getNodes:a}=n.getState(),l=a().filter(c=>c.selected),u=s.filter(c=>c.selected);r({nodes:l,edges:u}),n.setState({nodesSelectionActive:!1})}},[o]),N.useEffect(()=>{n.setState({multiSelectionActive:i})},[i])};function tx(e){const t=xe();N.useEffect(()=>{let n;const r=()=>{var i,s;if(!e.current)return;const o=od(e.current);(o.height===0||o.width===0)&&((s=(i=t.getState()).onError)==null||s.call(i,"004",Bn.error004())),t.setState({width:o.width||500,height:o.height||500})};return r(),window.addEventListener("resize",r),e.current&&(n=new ResizeObserver(()=>r()),n.observe(e.current)),()=>{window.removeEventListener("resize",r),n&&e.current&&n.unobserve(e.current)}},[])}const _d={position:"absolute",width:"100%",height:"100%",top:0,left:0},nx=(e,t)=>e.x!==t.x||e.y!==t.y||e.zoom!==t.k,wd=e=>({x:e.x,y:e.y,zoom:e.k}),Co=(e,t)=>e.target.closest(`.${t}`),Pv=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),rx=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection,d3ZoomHandler:e.d3ZoomHandler,userSelectionActive:e.userSelectionActive}),ox=({onMove:e,onMoveStart:t,onMoveEnd:n,onPaneContextMenu:r,zoomOnScroll:o=!0,zoomOnPinch:i=!0,panOnScroll:s=!1,panOnScrollSpeed:a=.5,panOnScrollMode:l=_o.Free,zoomOnDoubleClick:u=!0,elementsSelectable:c,panOnDrag:d=!0,defaultViewport:f,translateExtent:h,minZoom:m,maxZoom:v,zoomActivationKeyCode:y,preventScrolling:p=!0,children:g,noWheelClassName:S,noPanClassName:_})=>{const w=N.useRef(),R=xe(),C=N.useRef(!1),L=N.useRef(!1),B=N.useRef(null),I=N.useRef({x:0,y:0,zoom:0}),{d3Zoom:V,d3Selection:$,d3ZoomHandler:F,userSelectionActive:O}=le(rx,ze),M=Wi(y),D=N.useRef(0);return tx(B),N.useEffect(()=>{if(B.current){const A=B.current.getBoundingClientRect(),T=eO().scaleExtent([m,v]).translateExtent(h),P=At(B.current).call(T),U=Vn.translate(f.x,f.y).scale(Eo(f.zoom,m,v)),H=[[0,0],[A.width,A.height]],j=T.constrain()(U,H,h);T.transform(P,j),R.setState({d3Zoom:T,d3Selection:P,d3ZoomHandler:P.on("wheel.zoom"),transform:[j.x,j.y,j.k],domNode:B.current.closest(".react-flow")})}},[]),N.useEffect(()=>{$&&V&&(s&&!M&&!O?$.on("wheel.zoom",A=>{if(Co(A,S))return!1;A.preventDefault(),A.stopImmediatePropagation();const T=$.property("__zoom").k||1;if(A.ctrlKey&&i){const j=jt(A),K=-A.deltaY*(A.deltaMode===1?.05:A.deltaMode?1:.002)*10,W=T*Math.pow(2,K);V.scaleTo($,W,j);return}const P=A.deltaMode===1?20:1,U=l===_o.Vertical?0:A.deltaX*P,H=l===_o.Horizontal?0:A.deltaY*P;V.translateBy($,-(U/T)*a,-(H/T)*a)},{passive:!1}):typeof F<"u"&&$.on("wheel.zoom",function(A,T){if(!p||Co(A,S))return null;A.preventDefault(),F.call(this,A,T)},{passive:!1}))},[O,s,l,$,V,F,M,i,p,S]),N.useEffect(()=>{V&&V.on("start",A=>{var P;if(!A.sourceEvent)return null;D.current=A.sourceEvent.button;const{onViewportChangeStart:T}=R.getState();if(C.current=!0,((P=A.sourceEvent)==null?void 0:P.type)==="mousedown"&&R.setState({paneDragging:!0}),t||T){const U=wd(A.transform);I.current=U,T==null||T(U),t==null||t(A.sourceEvent,U)}})},[V,t]),N.useEffect(()=>{V&&(O&&!C.current?V.on("zoom",null):O||V.on("zoom",A=>{const{onViewportChange:T}=R.getState();if(R.setState({transform:[A.transform.x,A.transform.y,A.transform.k]}),L.current=!!(r&&Pv(d,D.current??0)),e||T){const P=wd(A.transform);T==null||T(P),e==null||e(A.sourceEvent,P)}}))},[O,V,e,d,r]),N.useEffect(()=>{V&&V.on("end",A=>{if(!A.sourceEvent)return null;const{onViewportChangeEnd:T}=R.getState();if(C.current=!1,R.setState({paneDragging:!1}),r&&Pv(d,D.current??0)&&!L.current&&r(A.sourceEvent),L.current=!1,(n||T)&&nx(I.current,A.transform)){const P=wd(A.transform);I.current=P,clearTimeout(w.current),w.current=setTimeout(()=>{T==null||T(P),n==null||n(A.sourceEvent,P)},s?150:0)}})},[V,s,d,n,r]),N.useEffect(()=>{V&&V.filter(A=>{const T=M||o,P=i&&A.ctrlKey;if(A.button===1&&A.type==="mousedown"&&(Co(A,"react-flow__node")||Co(A,"react-flow__edge")))return!0;if(!d&&!T&&!s&&!u&&!i||O||!u&&A.type==="dblclick"||Co(A,S)&&A.type==="wheel"||Co(A,_)&&A.type!=="wheel"||!i&&A.ctrlKey&&A.type==="wheel"||!T&&!s&&!P&&A.type==="wheel"||!d&&(A.type==="mousedown"||A.type==="touchstart")||Array.isArray(d)&&!d.includes(A.button)&&(A.type==="mousedown"||A.type==="touchstart"))return!1;const U=Array.isArray(d)&&d.includes(A.button)||!A.button||A.button<=1;return(!A.ctrlKey||A.type==="wheel")&&U})},[O,V,o,i,s,u,d,c,M]),E("div",{className:"react-flow__renderer",ref:B,style:_d,children:g})},ix=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function sx(){const{userSelectionActive:e,userSelectionRect:t}=le(ix,ze);return e&&t?E("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}function Mv(e,t){const n=e.find(r=>r.id===t.parentNode);if(n){const r=t.position.x+t.width-n.width,o=t.position.y+t.height-n.height;if(r>0||o>0||t.position.x<0||t.position.y<0){if(n.style={...n.style},n.style.width=n.style.width??n.width,n.style.height=n.style.height??n.height,r>0&&(n.style.width+=r),o>0&&(n.style.height+=o),t.position.x<0){const i=Math.abs(t.position.x);n.position.x=n.position.x-i,n.style.width+=i,t.position.x=0}if(t.position.y<0){const i=Math.abs(t.position.y);n.position.y=n.position.y-i,n.style.height+=i,t.position.y=0}n.width=n.style.width,n.height=n.style.height}}}function Uv(e,t){if(e.some(r=>r.type==="reset"))return e.filter(r=>r.type==="reset").map(r=>r.item);const n=e.filter(r=>r.type==="add").map(r=>r.item);return t.reduce((r,o)=>{const i=e.filter(a=>a.id===o.id);if(i.length===0)return r.push(o),r;const s={...o};for(const a of i)if(a)switch(a.type){case"select":{s.selected=a.selected;break}case"position":{typeof a.position<"u"&&(s.position=a.position),typeof a.positionAbsolute<"u"&&(s.positionAbsolute=a.positionAbsolute),typeof a.dragging<"u"&&(s.dragging=a.dragging),s.expandParent&&Mv(r,s);break}case"dimensions":{typeof a.dimensions<"u"&&(s.width=a.dimensions.width,s.height=a.dimensions.height),typeof a.updateStyle<"u"&&(s.style={...s.style||{},...a.dimensions}),typeof a.resizing=="boolean"&&(s.resizing=a.resizing),s.expandParent&&Mv(r,s);break}case"remove":return r}return r.push(s),r},n)}function Fv(e,t){return Uv(e,t)}function ax(e,t){return Uv(e,t)}const jn=(e,t)=>({id:e,type:"select",selected:t});function Io(e,t){return e.reduce((n,r)=>{const o=t.includes(r.id);return!r.selected&&o?(r.selected=!0,n.push(jn(r.id,!0))):r.selected&&!o&&(r.selected=!1,n.push(jn(r.id,!1))),n},[])}const Rd=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},lx=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging}),Vv=N.memo(({isSelecting:e,selectionMode:t=Hi.Full,panOnDrag:n,onSelectionStart:r,onSelectionEnd:o,onPaneClick:i,onPaneContextMenu:s,onPaneScroll:a,onPaneMouseEnter:l,onPaneMouseMove:u,onPaneMouseLeave:c,children:d})=>{const f=N.useRef(null),h=xe(),m=N.useRef(0),v=N.useRef(0),y=N.useRef(),{userSelectionActive:p,elementsSelectable:g,dragging:S}=le(lx,ze),_=()=>{h.setState({userSelectionActive:!1,userSelectionRect:null}),m.current=0,v.current=0},w=F=>{i==null||i(F),h.getState().resetSelectedElements(),h.setState({nodesSelectionActive:!1})},R=F=>{if(Array.isArray(n)&&(n!=null&&n.includes(2))){F.preventDefault();return}s==null||s(F)},C=a?F=>a(F):void 0,L=F=>{const{resetSelectedElements:O,domNode:M}=h.getState();if(y.current=M==null?void 0:M.getBoundingClientRect(),!g||!e||F.button!==0||F.target!==f.current||!y.current)return;const{x:D,y:A}=$n(F,y.current);O(),h.setState({userSelectionRect:{width:0,height:0,startX:D,startY:A,x:D,y:A}}),r==null||r(F)},B=F=>{const{userSelectionRect:O,nodeInternals:M,edges:D,transform:A,onNodesChange:T,onEdgesChange:P,nodeOrigin:U,getNodes:H}=h.getState();if(!e||!y.current||!O)return;h.setState({userSelectionActive:!0,nodesSelectionActive:!1});const j=$n(F,y.current),K=O.startX??0,W=O.startY??0,Z={...O,x:j.x<K?j.x:K,y:j.y<W?j.y:W,width:Math.abs(j.x-K),height:Math.abs(j.y-W)},X=H(),te=tv(M,Z,A,t===Hi.Partial,!0,U),oe=nv(te,D).map(ue=>ue.id),ge=te.map(ue=>ue.id);if(m.current!==ge.length){m.current=ge.length;const ue=Io(X,ge);ue.length&&(T==null||T(ue))}if(v.current!==oe.length){v.current=oe.length;const ue=Io(D,oe);ue.length&&(P==null||P(ue))}h.setState({userSelectionRect:Z})},I=F=>{if(F.button!==0)return;const{userSelectionRect:O}=h.getState();!p&&O&&F.target===f.current&&(w==null||w(F)),h.setState({nodesSelectionActive:m.current>0}),_(),o==null||o(F)},V=F=>{p&&(h.setState({nodesSelectionActive:m.current>0}),o==null||o(F)),_()},$=g&&(e||p);return k("div",{className:Je(["react-flow__pane",{dragging:S,selection:e}]),onClick:$?void 0:Rd(w,f),onContextMenu:Rd(R,f),onWheel:Rd(C,f),onMouseEnter:$?void 0:l,onMouseDown:$?L:void 0,onMouseMove:$?B:u,onMouseUp:$?I:void 0,onMouseLeave:$?V:c,ref:f,style:_d,children:[d,E(sx,{})]})});Vv.displayName="Pane";const ux=e=>{const t=e.getNodes().filter(n=>n.selected);return{...ev(t,e.nodeOrigin),transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`,userSelectionActive:e.userSelectionActive}};function cx({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=xe(),{width:o,height:i,x:s,y:a,transformString:l,userSelectionActive:u}=le(ux,ze),c=Iv(),d=N.useRef(null);if(N.useEffect(()=>{var m;n||(m=d.current)==null||m.focus({preventScroll:!0})},[n]),Cv({nodeRef:d}),u||!o||!i)return null;const f=e?m=>{const v=r.getState().getNodes().filter(y=>y.selected);e(m,v)}:void 0,h=m=>{Object.prototype.hasOwnProperty.call(xo,m.key)&&c({x:xo[m.key].x,y:xo[m.key].y,isShiftPressed:m.shiftKey})};return E("div",{className:Je(["react-flow__nodesselection","react-flow__container",t]),style:{transform:l},children:E("div",{ref:d,className:"react-flow__nodesselection-rect",onContextMenu:f,tabIndex:n?void 0:-1,onKeyDown:n?void 0:h,style:{width:o,height:i,top:a,left:s}})})}var dx=N.memo(cx);const fx=e=>e.nodesSelectionActive,Bv=({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:o,onPaneContextMenu:i,onPaneScroll:s,deleteKeyCode:a,onMove:l,onMoveStart:u,onMoveEnd:c,selectionKeyCode:d,selectionOnDrag:f,selectionMode:h,onSelectionStart:m,onSelectionEnd:v,multiSelectionKeyCode:y,panActivationKeyCode:p,zoomActivationKeyCode:g,elementsSelectable:S,zoomOnScroll:_,zoomOnPinch:w,panOnScroll:R,panOnScrollSpeed:C,panOnScrollMode:L,zoomOnDoubleClick:B,panOnDrag:I,defaultViewport:V,translateExtent:$,minZoom:F,maxZoom:O,preventScrolling:M,onSelectionContextMenu:D,noWheelClassName:A,noPanClassName:T,disableKeyboardA11y:P})=>{const U=le(fx),H=Wi(d),K=Wi(p)||I,W=H||f&&K!==!0;return ex({deleteKeyCode:a,multiSelectionKeyCode:y}),E(ox,{onMove:l,onMoveStart:u,onMoveEnd:c,onPaneContextMenu:i,elementsSelectable:S,zoomOnScroll:_,zoomOnPinch:w,panOnScroll:R,panOnScrollSpeed:C,panOnScrollMode:L,zoomOnDoubleClick:B,panOnDrag:!H&&K,defaultViewport:V,translateExtent:$,minZoom:F,maxZoom:O,zoomActivationKeyCode:g,preventScrolling:M,noWheelClassName:A,noPanClassName:T,children:k(Vv,{onSelectionStart:m,onSelectionEnd:v,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:o,onPaneContextMenu:i,onPaneScroll:s,panOnDrag:K,isSelecting:!!W,selectionMode:h,children:[e,U&&E(dx,{onSelectionContextMenu:D,noPanClassName:T,disableKeyboardA11y:P})]})})};Bv.displayName="FlowRenderer";var px=N.memo(Bv);function hx(e){return le(N.useCallback(n=>e?tv(n.nodeInternals,{x:0,y:0,width:n.width,height:n.height},n.transform,!0):n.getNodes(),[e]))}const gx=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,updateNodeDimensions:e.updateNodeDimensions,onError:e.onError}),$v=e=>{const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:o,updateNodeDimensions:i,onError:s}=le(gx,ze),a=hx(e.onlyRenderVisibleElements),l=N.useRef(),u=N.useMemo(()=>{if(typeof ResizeObserver>"u")return null;const c=new ResizeObserver(d=>{const f=d.map(h=>({id:h.target.getAttribute("data-id"),nodeElement:h.target,forceUpdate:!0}));i(f)});return l.current=c,c},[]);return N.useEffect(()=>()=>{var c;(c=l==null?void 0:l.current)==null||c.disconnect()},[]),E("div",{className:"react-flow__nodes",style:_d,children:a.map(c=>{var w,R;let d=c.type||"default";e.nodeTypes[d]||(s==null||s("003",Bn.error003(d)),d="default");const f=e.nodeTypes[d]||e.nodeTypes.default,h=!!(c.draggable||t&&typeof c.draggable>"u"),m=!!(c.selectable||o&&typeof c.selectable>"u"),v=!!(c.connectable||n&&typeof c.connectable>"u"),y=!!(c.focusable||r&&typeof c.focusable>"u"),p=e.nodeExtent?id(c.positionAbsolute,e.nodeExtent):c.positionAbsolute,g=(p==null?void 0:p.x)??0,S=(p==null?void 0:p.y)??0,_=WO({x:g,y:S,width:c.width??0,height:c.height??0,origin:e.nodeOrigin});return E(f,{id:c.id,className:c.className,style:c.style,type:d,data:c.data,sourcePosition:c.sourcePosition||Y.Bottom,targetPosition:c.targetPosition||Y.Top,hidden:c.hidden,xPos:g,yPos:S,xPosOrigin:_.x,yPosOrigin:_.y,selectNodesOnDrag:e.selectNodesOnDrag,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,selected:!!c.selected,isDraggable:h,isSelectable:m,isConnectable:v,isFocusable:y,resizeObserver:u,dragHandle:c.dragHandle,zIndex:((w=c[we])==null?void 0:w.z)??0,isParent:!!((R=c[we])!=null&&R.isParent),noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,initialized:!!c.width&&!!c.height,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,ariaLabel:c.ariaLabel},c.id)})})};$v.displayName="NodeRenderer";var mx=N.memo($v);const vx=[{level:0,isMaxLevel:!0,edges:[]}];function yx(e,t,n=!1){let r=-1;const o=e.reduce((s,a)=>{var c,d,f,h;const l=St(a.zIndex);let u=l?a.zIndex:0;return n&&(u=l?a.zIndex:Math.max(((d=(c=t.get(a.source))==null?void 0:c[we])==null?void 0:d.z)||0,((h=(f=t.get(a.target))==null?void 0:f[we])==null?void 0:h.z)||0)),s[u]?s[u].push(a):s[u]=[a],r=u>r?u:r,s},{}),i=Object.entries(o).map(([s,a])=>{const l=+s;return{edges:a,level:l,isMaxLevel:l===r}});return i.length===0?vx:i}function Ex(e,t,n){const r=le(N.useCallback(o=>e?o.edges.filter(i=>{const s=t.get(i.source),a=t.get(i.target);return(s==null?void 0:s.width)&&(s==null?void 0:s.height)&&(a==null?void 0:a.width)&&(a==null?void 0:a.height)&&zO({sourcePos:s.positionAbsolute||{x:0,y:0},targetPos:a.positionAbsolute||{x:0,y:0},sourceWidth:s.width,sourceHeight:s.height,targetWidth:a.width,targetHeight:a.height,width:o.width,height:o.height,transform:o.transform})}):o.edges,[e,t]));return yx(r,t,n)}const Sx=({color:e="none",strokeWidth:t=1})=>E("polyline",{stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:t,fill:"none",points:"-5,-4 0,0 -5,4"}),_x=({color:e="none",strokeWidth:t=1})=>E("polyline",{stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:t,fill:e,points:"-5,-4 0,0 -5,4 -5,-4"}),Hv={[zi.Arrow]:Sx,[zi.ArrowClosed]:_x};function wx(e){const t=xe();return N.useMemo(()=>{var o,i;return Object.prototype.hasOwnProperty.call(Hv,e)?Hv[e]:((i=(o=t.getState()).onError)==null||i.call(o,"009",Bn.error009(e)),null)},[e])}const Rx=({id:e,type:t,color:n,width:r=12.5,height:o=12.5,markerUnits:i="strokeWidth",strokeWidth:s,orient:a="auto-start-reverse"})=>{const l=wx(t);return l?E("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${o}`,viewBox:"-10 -10 20 20",markerUnits:i,orient:a,refX:"0",refY:"0",children:E(l,{color:n,strokeWidth:s})}):null},Nx=({defaultColor:e,rfId:t})=>n=>{const r=[];return n.edges.reduce((o,i)=>([i.markerStart,i.markerEnd].forEach(s=>{if(s&&typeof s=="object"){const a=fd(s,t);r.includes(a)||(o.push({id:a,color:s.color||e,...s}),r.push(a))}}),o),[]).sort((o,i)=>o.id.localeCompare(i.id))},zv=({defaultColor:e,rfId:t})=>{const n=le(N.useCallback(Nx({defaultColor:e,rfId:t}),[e,t]),(r,o)=>!(r.length!==o.length||r.some((i,s)=>i.id!==o[s].id)));return E("defs",{children:n.map(r=>E(Rx,{id:r.id,type:r.type,color:r.color,width:r.width,height:r.height,markerUnits:r.markerUnits,strokeWidth:r.strokeWidth,orient:r.orient},r.id))})};zv.displayName="MarkerDefinitions";var Ox=N.memo(zv);const xx=e=>({nodesConnectable:e.nodesConnectable,edgesFocusable:e.edgesFocusable,edgesUpdatable:e.edgesUpdatable,elementsSelectable:e.elementsSelectable,width:e.width,height:e.height,connectionMode:e.connectionMode,nodeInternals:e.nodeInternals,onError:e.onError}),jv=({defaultMarkerColor:e,onlyRenderVisibleElements:t,elevateEdgesOnSelect:n,rfId:r,edgeTypes:o,noPanClassName:i,onEdgeUpdate:s,onEdgeContextMenu:a,onEdgeMouseEnter:l,onEdgeMouseMove:u,onEdgeMouseLeave:c,onEdgeClick:d,edgeUpdaterRadius:f,onEdgeDoubleClick:h,onEdgeUpdateStart:m,onEdgeUpdateEnd:v,children:y})=>{const{edgesFocusable:p,edgesUpdatable:g,elementsSelectable:S,width:_,height:w,connectionMode:R,nodeInternals:C,onError:L}=le(xx,ze),B=Ex(t,C,n);return _?k(ve,{children:[B.map(({level:I,edges:V,isMaxLevel:$})=>k("svg",{style:{zIndex:I},width:_,height:w,className:"react-flow__edges react-flow__container",children:[$&&E(Ox,{defaultColor:e,rfId:r}),E("g",{children:V.map(F=>{const[O,M,D]=Rv(C.get(F.source)),[A,T,P]=Rv(C.get(F.target));if(!D||!P)return null;let U=F.type||"default";o[U]||(L==null||L("011",Bn.error011(U)),U="default");const H=o[U]||o.default,j=R===Hn.Strict?T.target:(T.target??[]).concat(T.source??[]),K=wv(M.source,F.sourceHandle),W=wv(j,F.targetHandle),Z=(K==null?void 0:K.position)||Y.Bottom,X=(W==null?void 0:W.position)||Y.Top,te=!!(F.focusable||p&&typeof F.focusable>"u"),oe=typeof s<"u"&&(F.updatable||g&&typeof F.updatable>"u");if(!K||!W)return L==null||L("008",Bn.error008(K,F)),null;const{sourceX:ge,sourceY:ue,targetX:Te,targetY:Ye}=HO(O,K,Z,A,W,X);return E(H,{id:F.id,className:Je([F.className,i]),type:U,data:F.data,selected:!!F.selected,animated:!!F.animated,hidden:!!F.hidden,label:F.label,labelStyle:F.labelStyle,labelShowBg:F.labelShowBg,labelBgStyle:F.labelBgStyle,labelBgPadding:F.labelBgPadding,labelBgBorderRadius:F.labelBgBorderRadius,style:F.style,source:F.source,target:F.target,sourceHandleId:F.sourceHandle,targetHandleId:F.targetHandle,markerEnd:F.markerEnd,markerStart:F.markerStart,sourceX:ge,sourceY:ue,targetX:Te,targetY:Ye,sourcePosition:Z,targetPosition:X,elementsSelectable:S,onEdgeUpdate:s,onContextMenu:a,onMouseEnter:l,onMouseMove:u,onMouseLeave:c,onClick:d,edgeUpdaterRadius:f,onEdgeDoubleClick:h,onEdgeUpdateStart:m,onEdgeUpdateEnd:v,rfId:r,ariaLabel:F.ariaLabel,isFocusable:te,isUpdatable:oe,pathOptions:"pathOptions"in F?F.pathOptions:void 0,interactionWidth:F.interactionWidth},F.id)})})]},I)),y]}):null};jv.displayName="EdgeRenderer";var Tx=N.memo(jv);const Cx=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function Ix({children:e}){const t=le(Cx);return E("div",{className:"react-flow__viewport react-flow__container",style:{transform:t},children:e})}function bx(e){const t=Sd(),n=N.useRef(!1);N.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const Ax={[Y.Left]:Y.Right,[Y.Right]:Y.Left,[Y.Top]:Y.Bottom,[Y.Bottom]:Y.Top},Gv=({nodeId:e,handleType:t,style:n,type:r=zn.Bezier,CustomComponent:o,connectionStatus:i})=>{var R,C,L;const{fromNode:s,handleId:a,toX:l,toY:u,connectionMode:c}=le(N.useCallback(B=>({fromNode:B.nodeInternals.get(e),handleId:B.connectionHandleId,toX:(B.connectionPosition.x-B.transform[0])/B.transform[2],toY:(B.connectionPosition.y-B.transform[1])/B.transform[2],connectionMode:B.connectionMode}),[e]),ze),d=(R=s==null?void 0:s[we])==null?void 0:R.handleBounds;let f=d==null?void 0:d[t];if(c===Hn.Loose&&(f=f||(d==null?void 0:d[t==="source"?"target":"source"])),!s||!f)return null;const h=a?f.find(B=>B.id===a):f[0],m=h?h.x+h.width/2:(s.width??0)/2,v=h?h.y+h.height/2:s.height??0,y=(((C=s.positionAbsolute)==null?void 0:C.x)??0)+m,p=(((L=s.positionAbsolute)==null?void 0:L.y)??0)+v,g=h==null?void 0:h.position,S=g?Ax[g]:null;if(!g||!S)return null;if(o)return E(o,{connectionLineType:r,connectionLineStyle:n,fromNode:s,fromHandle:h,fromX:y,fromY:p,toX:l,toY:u,fromPosition:g,toPosition:S,connectionStatus:i});let _="";const w={sourceX:y,sourceY:p,sourcePosition:g,targetX:l,targetY:u,targetPosition:S};return r===zn.Bezier?[_]=Xm(w):r===zn.Step?[_]=ji({...w,borderRadius:0}):r===zn.SmoothStep?[_]=ji(w):r===zn.SimpleBezier?[_]=Ym(w):_=`M${y},${p} ${l},${u}`,E("path",{d:_,fill:"none",className:"react-flow__connection-path",style:n})};Gv.displayName="ConnectionLine";const Lx=e=>({nodeId:e.connectionNodeId,handleType:e.connectionHandleType,nodesConnectable:e.nodesConnectable,connectionStatus:e.connectionStatus,width:e.width,height:e.height});function Dx({containerStyle:e,style:t,type:n,component:r}){const{nodeId:o,handleType:i,nodesConnectable:s,width:a,height:l,connectionStatus:u}=le(Lx,ze);return!(o&&i&&a&&s)?null:E("svg",{style:e,width:a,height:l,className:"react-flow__edges react-flow__connectionline react-flow__container",children:E("g",{className:Je(["react-flow__connection",u]),children:E(Gv,{nodeId:o,handleType:i,style:t,type:n,CustomComponent:r,connectionStatus:u})})})}const Yv=({nodeTypes:e,edgeTypes:t,onMove:n,onMoveStart:r,onMoveEnd:o,onInit:i,onNodeClick:s,onEdgeClick:a,onNodeDoubleClick:l,onEdgeDoubleClick:u,onNodeMouseEnter:c,onNodeMouseMove:d,onNodeMouseLeave:f,onNodeContextMenu:h,onSelectionContextMenu:m,onSelectionStart:v,onSelectionEnd:y,connectionLineType:p,connectionLineStyle:g,connectionLineComponent:S,connectionLineContainerStyle:_,selectionKeyCode:w,selectionOnDrag:R,selectionMode:C,multiSelectionKeyCode:L,panActivationKeyCode:B,zoomActivationKeyCode:I,deleteKeyCode:V,onlyRenderVisibleElements:$,elementsSelectable:F,selectNodesOnDrag:O,defaultViewport:M,translateExtent:D,minZoom:A,maxZoom:T,preventScrolling:P,defaultMarkerColor:U,zoomOnScroll:H,zoomOnPinch:j,panOnScroll:K,panOnScrollSpeed:W,panOnScrollMode:Z,zoomOnDoubleClick:X,panOnDrag:te,onPaneClick:oe,onPaneMouseEnter:ge,onPaneMouseMove:ue,onPaneMouseLeave:Te,onPaneScroll:Ye,onPaneContextMenu:ft,onEdgeUpdate:me,onEdgeContextMenu:de,onEdgeMouseEnter:tt,onEdgeMouseMove:Q,onEdgeMouseLeave:Zn,edgeUpdaterRadius:Tr,onEdgeUpdateStart:us,onEdgeUpdateEnd:cs,noDragClassName:ko,noWheelClassName:Cr,noPanClassName:Jn,elevateEdgesOnSelect:Po,disableKeyboardA11y:er,nodeOrigin:Ir,nodeExtent:ds,rfId:Mo})=>(bx(i),E(px,{onPaneClick:oe,onPaneMouseEnter:ge,onPaneMouseMove:ue,onPaneMouseLeave:Te,onPaneContextMenu:ft,onPaneScroll:Ye,deleteKeyCode:V,selectionKeyCode:w,selectionOnDrag:R,selectionMode:C,onSelectionStart:v,onSelectionEnd:y,multiSelectionKeyCode:L,panActivationKeyCode:B,zoomActivationKeyCode:I,elementsSelectable:F,onMove:n,onMoveStart:r,onMoveEnd:o,zoomOnScroll:H,zoomOnPinch:j,zoomOnDoubleClick:X,panOnScroll:K,panOnScrollSpeed:W,panOnScrollMode:Z,panOnDrag:te,defaultViewport:M,translateExtent:D,minZoom:A,maxZoom:T,onSelectionContextMenu:m,preventScrolling:P,noDragClassName:ko,noWheelClassName:Cr,noPanClassName:Jn,disableKeyboardA11y:er,children:k(Ix,{children:[E(Tx,{edgeTypes:t,onEdgeClick:a,onEdgeDoubleClick:u,onEdgeUpdate:me,onlyRenderVisibleElements:$,onEdgeContextMenu:de,onEdgeMouseEnter:tt,onEdgeMouseMove:Q,onEdgeMouseLeave:Zn,onEdgeUpdateStart:us,onEdgeUpdateEnd:cs,edgeUpdaterRadius:Tr,defaultMarkerColor:U,noPanClassName:Jn,elevateEdgesOnSelect:!!Po,disableKeyboardA11y:er,rfId:Mo,children:E(Dx,{style:g,type:p,component:S,containerStyle:_})}),E("div",{className:"react-flow__edgelabel-renderer"}),E(mx,{nodeTypes:e,onNodeClick:s,onNodeDoubleClick:l,onNodeMouseEnter:c,onNodeMouseMove:d,onNodeMouseLeave:f,onNodeContextMenu:h,selectNodesOnDrag:O,onlyRenderVisibleElements:$,noPanClassName:Jn,noDragClassName:ko,disableKeyboardA11y:er,nodeOrigin:Ir,nodeExtent:ds,rfId:Mo})]})}));Yv.displayName="GraphView";var kx=N.memo(Yv);const Nd=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Gn={rfId:"1",width:0,height:0,transform:[0,0,1],nodeInternals:new Map,edges:[],onNodesChange:null,onEdgesChange:null,hasDefaultNodes:!1,hasDefaultEdges:!1,d3Zoom:null,d3Selection:null,d3ZoomHandler:void 0,minZoom:.5,maxZoom:2,translateExtent:Nd,nodeExtent:Nd,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionNodeId:null,connectionHandleId:null,connectionHandleType:"source",connectionPosition:{x:0,y:0},connectionStatus:null,connectionMode:Hn.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:[0,0],snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesUpdatable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,fitViewOnInit:!1,fitViewOnInitDone:!1,fitViewOnInitOptions:void 0,multiSelectionActive:!1,connectionStartHandle:null,connectionEndHandle:null,connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,connectionRadius:20,onError:uO,isValidConnection:void 0},Px=()=>Vg((e,t)=>({...Gn,setNodes:n=>{const{nodeInternals:r,nodeOrigin:o,elevateNodesOnSelect:i}=t();e({nodeInternals:Ed(n,r,o,i)})},getNodes:()=>Array.from(t().nodeInternals.values()),setEdges:n=>{const{defaultEdgeOptions:r={}}=t();e({edges:n.map(o=>({...r,...o}))})},setDefaultNodesAndEdges:(n,r)=>{const o=typeof n<"u",i=typeof r<"u",s=o?Ed(n,new Map,t().nodeOrigin,t().elevateNodesOnSelect):new Map;e({nodeInternals:s,edges:i?r:[],hasDefaultNodes:o,hasDefaultEdges:i})},updateNodeDimensions:n=>{const{onNodesChange:r,nodeInternals:o,fitViewOnInit:i,fitViewOnInitDone:s,fitViewOnInitOptions:a,domNode:l,nodeOrigin:u}=t(),c=l==null?void 0:l.querySelector(".react-flow__viewport");if(!c)return;const d=window.getComputedStyle(c),{m22:f}=new window.DOMMatrixReadOnly(d.transform),h=n.reduce((v,y)=>{const p=o.get(y.id);if(p){const g=od(y.nodeElement);!!(g.width&&g.height&&(p.width!==g.width||p.height!==g.height||y.forceUpdate))&&(o.set(p.id,{...p,[we]:{...p[we],handleBounds:{source:Tv(".source",y.nodeElement,f,u),target:Tv(".target",y.nodeElement,f,u)}},...g}),v.push({id:p.id,type:"dimensions",dimensions:g}))}return v},[]);Dv(o,u);const m=s||i&&!s&&kv(t,{initial:!0,...a});e({nodeInternals:new Map(o),fitViewOnInitDone:m}),(h==null?void 0:h.length)>0&&(r==null||r(h))},updateNodePositions:(n,r=!0,o=!1)=>{const{triggerNodeChanges:i}=t(),s=n.map(a=>{const l={id:a.id,type:"position",dragging:o};return r&&(l.positionAbsolute=a.positionAbsolute,l.position=a.position),l});i(s)},triggerNodeChanges:n=>{const{onNodesChange:r,nodeInternals:o,hasDefaultNodes:i,nodeOrigin:s,getNodes:a,elevateNodesOnSelect:l}=t();if(n!=null&&n.length){if(i){const u=Fv(n,a()),c=Ed(u,o,s,l);e({nodeInternals:c})}r==null||r(n)}},addSelectedNodes:n=>{const{multiSelectionActive:r,edges:o,getNodes:i}=t();let s,a=null;r?s=n.map(l=>jn(l,!0)):(s=Io(i(),n),a=Io(o,[])),el({changedNodes:s,changedEdges:a,get:t,set:e})},addSelectedEdges:n=>{const{multiSelectionActive:r,edges:o,getNodes:i}=t();let s,a=null;r?s=n.map(l=>jn(l,!0)):(s=Io(o,n),a=Io(i(),[])),el({changedNodes:a,changedEdges:s,get:t,set:e})},unselectNodesAndEdges:({nodes:n,edges:r}={})=>{const{edges:o,getNodes:i}=t(),s=n||i(),a=r||o,l=s.map(c=>(c.selected=!1,jn(c.id,!1))),u=a.map(c=>jn(c.id,!1));el({changedNodes:l,changedEdges:u,get:t,set:e})},setMinZoom:n=>{const{d3Zoom:r,maxZoom:o}=t();r==null||r.scaleExtent([n,o]),e({minZoom:n})},setMaxZoom:n=>{const{d3Zoom:r,minZoom:o}=t();r==null||r.scaleExtent([o,n]),e({maxZoom:n})},setTranslateExtent:n=>{var r;(r=t().d3Zoom)==null||r.translateExtent(n),e({translateExtent:n})},resetSelectedElements:()=>{const{edges:n,getNodes:r}=t(),i=r().filter(a=>a.selected).map(a=>jn(a.id,!1)),s=n.filter(a=>a.selected).map(a=>jn(a.id,!1));el({changedNodes:i,changedEdges:s,get:t,set:e})},setNodeExtent:n=>{const{nodeInternals:r}=t();r.forEach(o=>{o.positionAbsolute=id(o.position,n)}),e({nodeExtent:n,nodeInternals:new Map(r)})},panBy:n=>{const{transform:r,width:o,height:i,d3Zoom:s,d3Selection:a,translateExtent:l}=t();if(!s||!a||!n.x&&!n.y)return;const u=Vn.translate(r[0]+n.x,r[1]+n.y).scale(r[2]),c=[[0,0],[o,i]],d=s==null?void 0:s.constrain()(u,c,l);s.transform(a,d)},cancelConnection:()=>e({connectionNodeId:Gn.connectionNodeId,connectionHandleId:Gn.connectionHandleId,connectionHandleType:Gn.connectionHandleType,connectionStatus:Gn.connectionStatus,connectionStartHandle:Gn.connectionStartHandle,connectionEndHandle:Gn.connectionEndHandle}),reset:()=>e({...Gn})})),Wv=({children:e})=>{const t=N.useRef(null);return t.current||(t.current=Px()),E(tO,{value:t.current,children:e})};Wv.displayName="ReactFlowProvider";const Kv=({children:e})=>N.useContext(Qa)?E(ve,{children:e}):E(Wv,{children:e});Kv.displayName="ReactFlowWrapper";function Qv(e,t){return N.useRef(null),N.useMemo(()=>t(e),[e])}const Mx={input:fv,default:hd,output:hv,group:gd},Ux={default:Za,straight:cd,step:ud,smoothstep:Xa,simplebezier:ld},Fx=[0,0],Vx=[15,15],Bx={x:0,y:0,zoom:1},$x={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0},Xv=N.forwardRef(({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:o,nodeTypes:i=Mx,edgeTypes:s=Ux,onNodeClick:a,onEdgeClick:l,onInit:u,onMove:c,onMoveStart:d,onMoveEnd:f,onConnect:h,onConnectStart:m,onConnectEnd:v,onClickConnectStart:y,onClickConnectEnd:p,onNodeMouseEnter:g,onNodeMouseMove:S,onNodeMouseLeave:_,onNodeContextMenu:w,onNodeDoubleClick:R,onNodeDragStart:C,onNodeDrag:L,onNodeDragStop:B,onNodesDelete:I,onEdgesDelete:V,onSelectionChange:$,onSelectionDragStart:F,onSelectionDrag:O,onSelectionDragStop:M,onSelectionContextMenu:D,onSelectionStart:A,onSelectionEnd:T,connectionMode:P=Hn.Strict,connectionLineType:U=zn.Bezier,connectionLineStyle:H,connectionLineComponent:j,connectionLineContainerStyle:K,deleteKeyCode:W="Backspace",selectionKeyCode:Z="Shift",selectionOnDrag:X=!1,selectionMode:te=Hi.Full,panActivationKeyCode:oe="Space",multiSelectionKeyCode:ge="Meta",zoomActivationKeyCode:ue="Meta",snapToGrid:Te=!1,snapGrid:Ye=Vx,onlyRenderVisibleElements:ft=!1,selectNodesOnDrag:me=!0,nodesDraggable:de,nodesConnectable:tt,nodesFocusable:Q,nodeOrigin:Zn=Fx,edgesFocusable:Tr,edgesUpdatable:us,elementsSelectable:cs,defaultViewport:ko=Bx,minZoom:Cr=.5,maxZoom:Jn=2,translateExtent:Po=Nd,preventScrolling:er=!0,nodeExtent:Ir,defaultMarkerColor:ds="#b1b1b7",zoomOnScroll:Mo=!0,zoomOnPinch:nt=!0,panOnScroll:Ft=!1,panOnScrollSpeed:br=.5,panOnScrollMode:Ar=_o.Free,zoomOnDoubleClick:Lr=!0,panOnDrag:El=!0,onPaneClick:Dr,onPaneMouseEnter:cf,onPaneMouseMove:df,onPaneMouseLeave:fs,onPaneScroll:ff,onPaneContextMenu:q0,children:kr,onEdgeUpdate:ZA,onEdgeContextMenu:JA,onEdgeDoubleClick:eL,onEdgeMouseEnter:tL,onEdgeMouseMove:nL,onEdgeMouseLeave:rL,onEdgeUpdateStart:oL,onEdgeUpdateEnd:iL,edgeUpdaterRadius:sL=10,onNodesChange:aL,onEdgesChange:lL,noDragClassName:uL="nodrag",noWheelClassName:cL="nowheel",noPanClassName:Z0="nopan",fitView:dL=!1,fitViewOptions:fL,connectOnClick:pL=!0,attributionPosition:hL,proOptions:gL,defaultEdgeOptions:mL,elevateNodesOnSelect:vL=!0,elevateEdgesOnSelect:yL=!1,disableKeyboardA11y:J0=!1,autoPanOnConnect:EL=!0,autoPanOnNodeDrag:SL=!0,connectionRadius:_L=20,isValidConnection:wL,onError:RL,style:NL,id:eE,...OL},xL)=>{const TL=Qv(i,YO),CL=Qv(s,$O),pf=eE||"1";return E("div",{...OL,style:{...NL,...$x},ref:xL,className:Je(["react-flow",o]),"data-testid":"rf__wrapper",id:eE,children:k(Kv,{children:[E(kx,{onInit:u,onMove:c,onMoveStart:d,onMoveEnd:f,onNodeClick:a,onEdgeClick:l,onNodeMouseEnter:g,onNodeMouseMove:S,onNodeMouseLeave:_,onNodeContextMenu:w,onNodeDoubleClick:R,nodeTypes:TL,edgeTypes:CL,connectionLineType:U,connectionLineStyle:H,connectionLineComponent:j,connectionLineContainerStyle:K,selectionKeyCode:Z,selectionOnDrag:X,selectionMode:te,deleteKeyCode:W,multiSelectionKeyCode:ge,panActivationKeyCode:oe,zoomActivationKeyCode:ue,onlyRenderVisibleElements:ft,selectNodesOnDrag:me,defaultViewport:ko,translateExtent:Po,minZoom:Cr,maxZoom:Jn,preventScrolling:er,zoomOnScroll:Mo,zoomOnPinch:nt,zoomOnDoubleClick:Lr,panOnScroll:Ft,panOnScrollSpeed:br,panOnScrollMode:Ar,panOnDrag:El,onPaneClick:Dr,onPaneMouseEnter:cf,onPaneMouseMove:df,onPaneMouseLeave:fs,onPaneScroll:ff,onPaneContextMenu:q0,onSelectionContextMenu:D,onSelectionStart:A,onSelectionEnd:T,onEdgeUpdate:ZA,onEdgeContextMenu:JA,onEdgeDoubleClick:eL,onEdgeMouseEnter:tL,onEdgeMouseMove:nL,onEdgeMouseLeave:rL,onEdgeUpdateStart:oL,onEdgeUpdateEnd:iL,edgeUpdaterRadius:sL,defaultMarkerColor:ds,noDragClassName:uL,noWheelClassName:cL,noPanClassName:Z0,elevateEdgesOnSelect:yL,rfId:pf,disableKeyboardA11y:J0,nodeOrigin:Zn,nodeExtent:Ir}),E(LO,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:h,onConnectStart:m,onConnectEnd:v,onClickConnectStart:y,onClickConnectEnd:p,nodesDraggable:de,nodesConnectable:tt,nodesFocusable:Q,edgesFocusable:Tr,edgesUpdatable:us,elementsSelectable:cs,elevateNodesOnSelect:vL,minZoom:Cr,maxZoom:Jn,nodeExtent:Ir,onNodesChange:aL,onEdgesChange:lL,snapToGrid:Te,snapGrid:Ye,connectionMode:P,translateExtent:Po,connectOnClick:pL,defaultEdgeOptions:mL,fitView:dL,fitViewOptions:fL,onNodesDelete:I,onEdgesDelete:V,onNodeDragStart:C,onNodeDrag:L,onNodeDragStop:B,onSelectionDrag:O,onSelectionDragStart:F,onSelectionDragStop:M,noPanClassName:Z0,nodeOrigin:Zn,rfId:pf,autoPanOnConnect:EL,autoPanOnNodeDrag:SL,onError:RL,connectionRadius:_L,isValidConnection:wL}),E(bO,{onSelectionChange:$}),kr,E(rO,{proOptions:gL,position:hL}),E(UO,{rfId:pf,disableKeyboardA11y:J0})]})})});Xv.displayName="ReactFlow";function Hx(){const e=xe();return N.useCallback(t=>{const{domNode:n,updateNodeDimensions:r}=e.getState(),o=n==null?void 0:n.querySelector(`.react-flow__node[data-id="${t}"]`);o&&requestAnimationFrame(()=>r([{id:t,nodeElement:o,forceUpdate:!0}]))},[])}const zx=e=>t=>t.nodeInternals.size===0?!1:t.getNodes().filter(n=>e.includeHiddenNodes?!0:!n.hidden).every(n=>{var r;return((r=n[we])==null?void 0:r.handleBounds)!==void 0}),jx={includeHiddenNodes:!1};function Gx(e=jx){return le(zx(e))}function Yx(){return E("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:E("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function Wx(){return E("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:E("path",{d:"M0 0h32v4.2H0z"})})}function Kx(){return E("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:E("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function Qx(){return E("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:E("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function Xx(){return E("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:E("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}const bo=({children:e,className:t,...n})=>E("button",{type:"button",className:Je(["react-flow__controls-button",t]),...n,children:e});bo.displayName="ControlButton";const qx=e=>e.nodesDraggable&&e.nodesConnectable&&e.elementsSelectable,qv=({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:o,onZoomIn:i,onZoomOut:s,onFitView:a,onInteractiveChange:l,className:u,children:c,position:d="bottom-left"})=>{const f=xe(),[h,m]=N.useState(!1),v=le(qx),{zoomIn:y,zoomOut:p,fitView:g}=Sd();if(N.useEffect(()=>{m(!0)},[]),!h)return null;const S=()=>{y(),i==null||i()},_=()=>{p(),s==null||s()},w=()=>{g(o),a==null||a()},R=()=>{f.setState({nodesDraggable:!v,nodesConnectable:!v,elementsSelectable:!v}),l==null||l(!v)};return k(rd,{className:Je(["react-flow__controls",u]),position:d,style:e,"data-testid":"rf__controls",children:[t&&k(ve,{children:[E(bo,{onClick:S,className:"react-flow__controls-zoomin",title:"zoom in","aria-label":"zoom in",children:E(Yx,{})}),E(bo,{onClick:_,className:"react-flow__controls-zoomout",title:"zoom out","aria-label":"zoom out",children:E(Wx,{})})]}),n&&E(bo,{className:"react-flow__controls-fitview",onClick:w,title:"fit view","aria-label":"fit view",children:E(Kx,{})}),r&&E(bo,{className:"react-flow__controls-interactive",onClick:R,title:"toggle interactivity","aria-label":"toggle interactivity",children:v?E(Xx,{}):E(Qx,{})}),c]})};qv.displayName="Controls";var Zx=N.memo(qv);const Jx=!1,Zv="0.0.1",Jv="0.0.0",ey="sw/nodeType",ty=640,ny={type:"floating",markerEnd:{type:zi.Arrow,width:20,height:20,color:"#c2c8d1"},style:{stroke:"#c2c8d1",strokeWidth:1.5}},eT="422",tT="404";let nT=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce((t,n)=>(n&=63,n<36?t+=n.toString(36):n<62?t+=(n-26).toString(36).toUpperCase():n>62?t+="-":t+="_",t),"");const Re=()=>nT(),rT=()=>{const e={},t=document.querySelector('meta[name="csrf-token"]');return t&&(e["X-CSRF-Token"]=t==null?void 0:t.content),e},oT=(e,t)=>{var i;const n=new Blob([JSON.stringify({nodes:e,edges:t},null,2)],{type:"application/json"}),r=window.URL.createObjectURL(n),o=window.open();(i=o==null?void 0:o.location)!=null&&i.href&&(o.location.href=r)},iT=e=>e.map(t=>typeof t=="string"?t.trim():t).filter(Boolean).join(),Od=e=>e.split(",").map(t=>t.trim()).filter(Boolean),sT=e=>({...e,...ny}),aT=e=>e.type==="handleCall"?{...e,deletable:!1}:e,ry=e=>e==="success"?"positive":"negative",lT=e=>e.toLowerCase().replace(/ /g,"-"),xd=()=>[{result:"success",id:Re()},{result:"noAnswer",id:Re()},{result:"busy",id:Re()},{result:"decline",id:Re()},{result:"error",id:Re()}],oy={answer:()=>({}),forwardAddress:()=>({destinations:[],destinationType:"address",options:xd(),sessionTimeout:void 0,type:"single"}),forwardPhone:()=>({destinations:[],destinationType:"phone",options:xd(),sessionTimeout:void 0,type:"single"}),forwardResource:()=>({destinations:[],destinationType:"resource",options:xd(),sessionTimeout:void 0,type:"single"}),hangup:()=>({}),play:()=>({selected:"",text:"",url:""}),promptPlay:()=>({initialTimeout:5,options:[],results:[{id:Re(),result:"no_match"},{id:Re(),result:"no_input"}],selected:"",text:"",url:""}),record:()=>({beep:!1,format:"wav",stereo:!1,terminators:""}),recordCallStart:()=>({beep:!1,controlId:Re(),format:"wav",label:"",stereo:!1,terminators:""}),recordCallStop:()=>({controlId:""}),sendSms:()=>({body:"",fromNumber:"",media:[],region:"",tags:[],toNumber:""}),set:()=>({variables:[]}),unset:()=>({variables:[]}),request:()=>({url:"",method:"POST",headers:{},body:"",options:[{id:Re(),result:"success"},{id:Re(),result:"failed"}]}),cond:()=>({options:[],fallback:Re()}),condRequest:()=>({body:"",error:Re(),fallback:Re(),headers:{},method:"POST",options:[],url:""})};function kt(e){return kt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},kt(e)}function _t(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function uT(e,t){if(kt(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(kt(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function iy(e){var t=uT(e,"string");return kt(t)==="symbol"?t:String(t)}function sy(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,iy(r.key),r)}}function wt(e,t,n){return t&&sy(e.prototype,t),n&&sy(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Yn(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Td(e,t){return Td=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},Td(e,t)}function tl(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Td(e,t)}function Ki(e,t){if(t&&(kt(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Yn(e)}function Wt(e){return Wt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Wt(e)}function hn(e,t,n){return t=iy(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function cT(e){if(Array.isArray(e))return e}function dT(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function ay(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function fT(e,t){if(e){if(typeof e=="string")return ay(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ay(e,t)}}function pT(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
61
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function hT(e){return cT(e)||dT(e)||fT(e)||pT()}function ly(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function uy(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ly(Object(n),!0).forEach(function(r){hn(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ly(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var gT={type:"logger",log:function(t){this.output("log",t)},warn:function(t){this.output("warn",t)},error:function(t){this.output("error",t)},output:function(t,n){console&&console[t]&&console[t].apply(console,n)}},mT=function(){function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};_t(this,e),this.init(t,n)}return wt(e,[{key:"init",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=r.prefix||"i18next:",this.logger=n||gT,this.options=r,this.debug=r.debug}},{key:"setDebug",value:function(n){this.debug=n}},{key:"log",value:function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return this.forward(r,"log","",!0)}},{key:"warn",value:function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return this.forward(r,"warn","",!0)}},{key:"error",value:function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return this.forward(r,"error","")}},{key:"deprecate",value:function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return this.forward(r,"warn","WARNING DEPRECATED: ",!0)}},{key:"forward",value:function(n,r,o,i){return i&&!this.debug?null:(typeof n[0]=="string"&&(n[0]="".concat(o).concat(this.prefix," ").concat(n[0])),this.logger[r](n))}},{key:"create",value:function(n){return new e(this.logger,uy(uy({},{prefix:"".concat(this.prefix,":").concat(n,":")}),this.options))}},{key:"clone",value:function(n){return n=n||this.options,n.prefix=n.prefix||this.prefix,new e(this.logger,n)}}]),e}(),Kt=new mT,Wn=function(){function e(){_t(this,e),this.observers={}}return wt(e,[{key:"on",value:function(n,r){var o=this;return n.split(" ").forEach(function(i){o.observers[i]=o.observers[i]||[],o.observers[i].push(r)}),this}},{key:"off",value:function(n,r){if(this.observers[n]){if(!r){delete this.observers[n];return}this.observers[n]=this.observers[n].filter(function(o){return o!==r})}}},{key:"emit",value: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];if(this.observers[n]){var s=[].concat(this.observers[n]);s.forEach(function(l){l.apply(void 0,o)})}if(this.observers["*"]){var a=[].concat(this.observers["*"]);a.forEach(function(l){l.apply(l,[n].concat(o))})}}}]),e}();function Qi(){var e,t,n=new Promise(function(r,o){e=r,t=o});return n.resolve=e,n.reject=t,n}function cy(e){return e==null?"":""+e}function vT(e,t,n){e.forEach(function(r){t[r]&&(n[r]=t[r])})}function Cd(e,t,n){function r(a){return a&&a.indexOf("###")>-1?a.replace(/###/g,"."):a}function o(){return!e||typeof e=="string"}for(var i=typeof t!="string"?[].concat(t):t.split(".");i.length>1;){if(o())return{};var s=r(i.shift());!e[s]&&n&&(e[s]=new n),Object.prototype.hasOwnProperty.call(e,s)?e=e[s]:e={}}return o()?{}:{obj:e,k:r(i.shift())}}function dy(e,t,n){var r=Cd(e,t,Object),o=r.obj,i=r.k;o[i]=n}function yT(e,t,n,r){var o=Cd(e,t,Object),i=o.obj,s=o.k;i[s]=i[s]||[],r&&(i[s]=i[s].concat(n)),r||i[s].push(n)}function nl(e,t){var n=Cd(e,t),r=n.obj,o=n.k;if(r)return r[o]}function fy(e,t,n){var r=nl(e,n);return r!==void 0?r:nl(t,n)}function py(e,t,n){for(var r in t)r!=="__proto__"&&r!=="constructor"&&(r in e?typeof e[r]=="string"||e[r]instanceof String||typeof t[r]=="string"||t[r]instanceof String?n&&(e[r]=t[r]):py(e[r],t[r],n):e[r]=t[r]);return e}function Ao(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var ET={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};function ST(e){return typeof e=="string"?e.replace(/[&<>"'\/]/g,function(t){return ET[t]}):e}var rl=typeof window<"u"&&window.navigator&&typeof window.navigator.userAgentData>"u"&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,_T=[" ",",","?","!",";"];function wT(e,t,n){t=t||"",n=n||"";var r=_T.filter(function(a){return t.indexOf(a)<0&&n.indexOf(a)<0});if(r.length===0)return!0;var o=new RegExp("(".concat(r.map(function(a){return a==="?"?"\\?":a}).join("|"),")")),i=!o.test(e);if(!i){var s=e.indexOf(n);s>0&&!o.test(e.substring(0,s))&&(i=!0)}return i}function hy(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function ol(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?hy(Object(n),!0).forEach(function(r){hn(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hy(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function RT(e){var t=NT();return function(){var r=Wt(e),o;if(t){var i=Wt(this).constructor;o=Reflect.construct(r,arguments,i)}else o=r.apply(this,arguments);return Ki(this,o)}}function NT(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function gy(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(e){if(e[t])return e[t];for(var r=t.split(n),o=e,i=0;i<r.length;++i){if(!o||typeof o[r[i]]=="string"&&i+1<r.length)return;if(o[r[i]]===void 0){for(var s=2,a=r.slice(i,i+s).join(n),l=o[a];l===void 0&&r.length>i+s;)s++,a=r.slice(i,i+s).join(n),l=o[a];if(l===void 0)return;if(l===null)return null;if(t.endsWith(a)){if(typeof l=="string")return l;if(a&&typeof l[a]=="string")return l[a]}var u=r.slice(i+s).join(n);return u?gy(l,u,n):void 0}o=o[r[i]]}return o}}var OT=function(e){tl(n,e);var t=RT(n);function n(r){var o,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};return _t(this,n),o=t.call(this),rl&&Wn.call(Yn(o)),o.data=r||{},o.options=i,o.options.keySeparator===void 0&&(o.options.keySeparator="."),o.options.ignoreJSONStructure===void 0&&(o.options.ignoreJSONStructure=!0),o}return wt(n,[{key:"addNamespaces",value:function(o){this.options.ns.indexOf(o)<0&&this.options.ns.push(o)}},{key:"removeNamespaces",value:function(o){var i=this.options.ns.indexOf(o);i>-1&&this.options.ns.splice(i,1)}},{key:"getResource",value:function(o,i,s){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},l=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator,u=a.ignoreJSONStructure!==void 0?a.ignoreJSONStructure:this.options.ignoreJSONStructure,c=[o,i];s&&typeof s!="string"&&(c=c.concat(s)),s&&typeof s=="string"&&(c=c.concat(l?s.split(l):s)),o.indexOf(".")>-1&&(c=o.split("."));var d=nl(this.data,c);return d||!u||typeof s!="string"?d:gy(this.data&&this.data[o]&&this.data[o][i],s,l)}},{key:"addResource",value:function(o,i,s,a){var l=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1},u=this.options.keySeparator;u===void 0&&(u=".");var c=[o,i];s&&(c=c.concat(u?s.split(u):s)),o.indexOf(".")>-1&&(c=o.split("."),a=i,i=c[1]),this.addNamespaces(i),dy(this.data,c,a),l.silent||this.emit("added",o,i,s,a)}},{key:"addResources",value:function(o,i,s){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(var l in s)(typeof s[l]=="string"||Object.prototype.toString.apply(s[l])==="[object Array]")&&this.addResource(o,i,l,s[l],{silent:!0});a.silent||this.emit("added",o,i,s)}},{key:"addResourceBundle",value:function(o,i,s,a,l){var u=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1},c=[o,i];o.indexOf(".")>-1&&(c=o.split("."),a=s,s=i,i=c[1]),this.addNamespaces(i);var d=nl(this.data,c)||{};a?py(d,s,l):d=ol(ol({},d),s),dy(this.data,c,d),u.silent||this.emit("added",o,i,s)}},{key:"removeResourceBundle",value:function(o,i){this.hasResourceBundle(o,i)&&delete this.data[o][i],this.removeNamespaces(i),this.emit("removed",o,i)}},{key:"hasResourceBundle",value:function(o,i){return this.getResource(o,i)!==void 0}},{key:"getResourceBundle",value:function(o,i){return i||(i=this.options.defaultNS),this.options.compatibilityAPI==="v1"?ol(ol({},{}),this.getResource(o,i)):this.getResource(o,i)}},{key:"getDataByLanguage",value:function(o){return this.data[o]}},{key:"hasLanguageSomeTranslations",value:function(o){var i=this.getDataByLanguage(o),s=i&&Object.keys(i)||[];return!!s.find(function(a){return i[a]&&Object.keys(i[a]).length>0})}},{key:"toJSON",value:function(){return this.data}}]),n}(Wn),my={processors:{},addPostProcessor:function(t){this.processors[t.name]=t},handle:function(t,n,r,o,i){var s=this;return t.forEach(function(a){s.processors[a]&&(n=s.processors[a].process(n,r,o,i))}),n}};function vy(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function je(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?vy(Object(n),!0).forEach(function(r){hn(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vy(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function xT(e){var t=TT();return function(){var r=Wt(e),o;if(t){var i=Wt(this).constructor;o=Reflect.construct(r,arguments,i)}else o=r.apply(this,arguments);return Ki(this,o)}}function TT(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var yy={},Ey=function(e){tl(n,e);var t=xT(n);function n(r){var o,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return _t(this,n),o=t.call(this),rl&&Wn.call(Yn(o)),vT(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],r,Yn(o)),o.options=i,o.options.keySeparator===void 0&&(o.options.keySeparator="."),o.logger=Kt.create("translator"),o}return wt(n,[{key:"changeLanguage",value:function(o){o&&(this.language=o)}},{key:"exists",value:function(o){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(o==null)return!1;var s=this.resolve(o,i);return s&&s.res!==void 0}},{key:"extractFromKey",value:function(o,i){var s=i.nsSeparator!==void 0?i.nsSeparator:this.options.nsSeparator;s===void 0&&(s=":");var a=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,l=i.ns||this.options.defaultNS||[],u=s&&o.indexOf(s)>-1,c=!this.options.userDefinedKeySeparator&&!i.keySeparator&&!this.options.userDefinedNsSeparator&&!i.nsSeparator&&!wT(o,s,a);if(u&&!c){var d=o.match(this.interpolator.nestingRegexp);if(d&&d.length>0)return{key:o,namespaces:l};var f=o.split(s);(s!==a||s===a&&this.options.ns.indexOf(f[0])>-1)&&(l=f.shift()),o=f.join(a)}return typeof l=="string"&&(l=[l]),{key:o,namespaces:l}}},{key:"translate",value:function(o,i,s){var a=this;if(kt(i)!=="object"&&this.options.overloadTranslationOptionHandler&&(i=this.options.overloadTranslationOptionHandler(arguments)),i||(i={}),o==null)return"";Array.isArray(o)||(o=[String(o)]);var l=i.returnDetails!==void 0?i.returnDetails:this.options.returnDetails,u=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,c=this.extractFromKey(o[o.length-1],i),d=c.key,f=c.namespaces,h=f[f.length-1],m=i.lng||this.language,v=i.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(m&&m.toLowerCase()==="cimode"){if(v){var y=i.nsSeparator||this.options.nsSeparator;return l?{res:"".concat(h).concat(y).concat(d),usedKey:d,exactUsedKey:d,usedLng:m,usedNS:h}:"".concat(h).concat(y).concat(d)}return l?{res:d,usedKey:d,exactUsedKey:d,usedLng:m,usedNS:h}:d}var p=this.resolve(o,i),g=p&&p.res,S=p&&p.usedKey||d,_=p&&p.exactUsedKey||d,w=Object.prototype.toString.apply(g),R=["[object Number]","[object Function]","[object RegExp]"],C=i.joinArrays!==void 0?i.joinArrays:this.options.joinArrays,L=!this.i18nFormat||this.i18nFormat.handleAsObject,B=typeof g!="string"&&typeof g!="boolean"&&typeof g!="number";if(L&&g&&B&&R.indexOf(w)<0&&!(typeof C=="string"&&w==="[object Array]")){if(!i.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");var I=this.options.returnedObjectHandler?this.options.returnedObjectHandler(S,g,je(je({},i),{},{ns:f})):"key '".concat(d," (").concat(this.language,")' returned an object instead of string.");return l?(p.res=I,p):I}if(u){var V=w==="[object Array]",$=V?[]:{},F=V?_:S;for(var O in g)if(Object.prototype.hasOwnProperty.call(g,O)){var M="".concat(F).concat(u).concat(O);$[O]=this.translate(M,je(je({},i),{joinArrays:!1,ns:f})),$[O]===M&&($[O]=g[O])}g=$}}else if(L&&typeof C=="string"&&w==="[object Array]")g=g.join(C),g&&(g=this.extendTranslation(g,o,i,s));else{var D=!1,A=!1,T=i.count!==void 0&&typeof i.count!="string",P=n.hasDefaultValue(i),U=T?this.pluralResolver.getSuffix(m,i.count,i):"",H=i["defaultValue".concat(U)]||i.defaultValue;!this.isValidLookup(g)&&P&&(D=!0,g=H),this.isValidLookup(g)||(A=!0,g=d);var j=i.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey,K=j&&A?void 0:g,W=P&&H!==g&&this.options.updateMissing;if(A||D||W){if(this.logger.log(W?"updateKey":"missingKey",m,h,d,W?H:g),u){var Z=this.resolve(d,je(je({},i),{},{keySeparator:!1}));Z&&Z.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var X=[],te=this.languageUtils.getFallbackCodes(this.options.fallbackLng,i.lng||this.language);if(this.options.saveMissingTo==="fallback"&&te&&te[0])for(var oe=0;oe<te.length;oe++)X.push(te[oe]);else this.options.saveMissingTo==="all"?X=this.languageUtils.toResolveHierarchy(i.lng||this.language):X.push(i.lng||this.language);var ge=function(Te,Ye,ft){var me=P&&ft!==g?ft:K;a.options.missingKeyHandler?a.options.missingKeyHandler(Te,h,Ye,me,W,i):a.backendConnector&&a.backendConnector.saveMissing&&a.backendConnector.saveMissing(Te,h,Ye,me,W,i),a.emit("missingKey",Te,h,Ye,g)};this.options.saveMissing&&(this.options.saveMissingPlurals&&T?X.forEach(function(ue){a.pluralResolver.getSuffixes(ue,i).forEach(function(Te){ge([ue],d+Te,i["defaultValue".concat(Te)]||H)})}):ge(X,d,H))}g=this.extendTranslation(g,o,i,p,s),A&&g===d&&this.options.appendNamespaceToMissingKey&&(g="".concat(h,":").concat(d)),(A||D)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?g=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?"".concat(h,":").concat(d):d,D?g:void 0):g=this.options.parseMissingKeyHandler(g))}return l?(p.res=g,p):g}},{key:"extendTranslation",value:function(o,i,s,a,l){var u=this;if(this.i18nFormat&&this.i18nFormat.parse)o=this.i18nFormat.parse(o,je(je({},this.options.interpolation.defaultVariables),s),a.usedLng,a.usedNS,a.usedKey,{resolved:a});else if(!s.skipInterpolation){s.interpolation&&this.interpolator.init(je(je({},s),{interpolation:je(je({},this.options.interpolation),s.interpolation)}));var c=typeof o=="string"&&(s&&s.interpolation&&s.interpolation.skipOnVariables!==void 0?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables),d;if(c){var f=o.match(this.interpolator.nestingRegexp);d=f&&f.length}var h=s.replace&&typeof s.replace!="string"?s.replace:s;if(this.options.interpolation.defaultVariables&&(h=je(je({},this.options.interpolation.defaultVariables),h)),o=this.interpolator.interpolate(o,h,s.lng||this.language,s),c){var m=o.match(this.interpolator.nestingRegexp),v=m&&m.length;d<v&&(s.nest=!1)}s.nest!==!1&&(o=this.interpolator.nest(o,function(){for(var g=arguments.length,S=new Array(g),_=0;_<g;_++)S[_]=arguments[_];return l&&l[0]===S[0]&&!s.context?(u.logger.warn("It seems you are nesting recursively key: ".concat(S[0]," in key: ").concat(i[0])),null):u.translate.apply(u,S.concat([i]))},s)),s.interpolation&&this.interpolator.reset()}var y=s.postProcess||this.options.postProcess,p=typeof y=="string"?[y]:y;return o!=null&&p&&p.length&&s.applyPostProcessor!==!1&&(o=my.handle(p,o,i,this.options&&this.options.postProcessPassResolved?je({i18nResolved:a},s):s,this)),o}},{key:"resolve",value:function(o){var i=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a,l,u,c,d;return typeof o=="string"&&(o=[o]),o.forEach(function(f){if(!i.isValidLookup(a)){var h=i.extractFromKey(f,s),m=h.key;l=m;var v=h.namespaces;i.options.fallbackNS&&(v=v.concat(i.options.fallbackNS));var y=s.count!==void 0&&typeof s.count!="string",p=y&&!s.ordinal&&s.count===0&&i.pluralResolver.shouldUseIntlApi(),g=s.context!==void 0&&(typeof s.context=="string"||typeof s.context=="number")&&s.context!=="",S=s.lngs?s.lngs:i.languageUtils.toResolveHierarchy(s.lng||i.language,s.fallbackLng);v.forEach(function(_){i.isValidLookup(a)||(d=_,!yy["".concat(S[0],"-").concat(_)]&&i.utils&&i.utils.hasLoadedNamespace&&!i.utils.hasLoadedNamespace(d)&&(yy["".concat(S[0],"-").concat(_)]=!0,i.logger.warn('key "'.concat(l,'" for languages "').concat(S.join(", "),`" won't get resolved as namespace "`).concat(d,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),S.forEach(function(w){if(!i.isValidLookup(a)){c=w;var R=[m];if(i.i18nFormat&&i.i18nFormat.addLookupKeys)i.i18nFormat.addLookupKeys(R,m,w,_,s);else{var C;y&&(C=i.pluralResolver.getSuffix(w,s.count,s));var L="".concat(i.options.pluralSeparator,"zero");if(y&&(R.push(m+C),p&&R.push(m+L)),g){var B="".concat(m).concat(i.options.contextSeparator).concat(s.context);R.push(B),y&&(R.push(B+C),p&&R.push(B+L))}}for(var I;I=R.pop();)i.isValidLookup(a)||(u=I,a=i.getResource(w,_,I,s))}}))})}}),{res:a,usedKey:l,exactUsedKey:u,usedLng:c,usedNS:d}}},{key:"isValidLookup",value:function(o){return o!==void 0&&!(!this.options.returnNull&&o===null)&&!(!this.options.returnEmptyString&&o==="")}},{key:"getResource",value:function(o,i,s){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(o,i,s,a):this.resourceStore.getResource(o,i,s,a)}}],[{key:"hasDefaultValue",value:function(o){var i="defaultValue";for(var s in o)if(Object.prototype.hasOwnProperty.call(o,s)&&i===s.substring(0,i.length)&&o[s]!==void 0)return!0;return!1}}]),n}(Wn);function Id(e){return e.charAt(0).toUpperCase()+e.slice(1)}var Sy=function(){function e(t){_t(this,e),this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Kt.create("languageUtils")}return wt(e,[{key:"getScriptPartFromCode",value:function(n){if(!n||n.indexOf("-")<0)return null;var r=n.split("-");return r.length===2||(r.pop(),r[r.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(r.join("-"))}},{key:"getLanguagePartFromCode",value:function(n){if(!n||n.indexOf("-")<0)return n;var r=n.split("-");return this.formatLanguageCode(r[0])}},{key:"formatLanguageCode",value:function(n){if(typeof n=="string"&&n.indexOf("-")>-1){var r=["hans","hant","latn","cyrl","cans","mong","arab"],o=n.split("-");return this.options.lowerCaseLng?o=o.map(function(i){return i.toLowerCase()}):o.length===2?(o[0]=o[0].toLowerCase(),o[1]=o[1].toUpperCase(),r.indexOf(o[1].toLowerCase())>-1&&(o[1]=Id(o[1].toLowerCase()))):o.length===3&&(o[0]=o[0].toLowerCase(),o[1].length===2&&(o[1]=o[1].toUpperCase()),o[0]!=="sgn"&&o[2].length===2&&(o[2]=o[2].toUpperCase()),r.indexOf(o[1].toLowerCase())>-1&&(o[1]=Id(o[1].toLowerCase())),r.indexOf(o[2].toLowerCase())>-1&&(o[2]=Id(o[2].toLowerCase()))),o.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?n.toLowerCase():n}},{key:"isSupportedCode",value:function(n){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(n=this.getLanguagePartFromCode(n)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(n)>-1}},{key:"getBestMatchFromCodes",value:function(n){var r=this;if(!n)return null;var o;return n.forEach(function(i){if(!o){var s=r.formatLanguageCode(i);(!r.options.supportedLngs||r.isSupportedCode(s))&&(o=s)}}),!o&&this.options.supportedLngs&&n.forEach(function(i){if(!o){var s=r.getLanguagePartFromCode(i);if(r.isSupportedCode(s))return o=s;o=r.options.supportedLngs.find(function(a){if(a.indexOf(s)===0)return a})}}),o||(o=this.getFallbackCodes(this.options.fallbackLng)[0]),o}},{key:"getFallbackCodes",value:function(n,r){if(!n)return[];if(typeof n=="function"&&(n=n(r)),typeof n=="string"&&(n=[n]),Object.prototype.toString.apply(n)==="[object Array]")return n;if(!r)return n.default||[];var o=n[r];return o||(o=n[this.getScriptPartFromCode(r)]),o||(o=n[this.formatLanguageCode(r)]),o||(o=n[this.getLanguagePartFromCode(r)]),o||(o=n.default),o||[]}},{key:"toResolveHierarchy",value:function(n,r){var o=this,i=this.getFallbackCodes(r||this.options.fallbackLng||[],n),s=[],a=function(u){u&&(o.isSupportedCode(u)?s.push(u):o.logger.warn("rejecting language code not found in supportedLngs: ".concat(u)))};return typeof n=="string"&&n.indexOf("-")>-1?(this.options.load!=="languageOnly"&&a(this.formatLanguageCode(n)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&a(this.getScriptPartFromCode(n)),this.options.load!=="currentOnly"&&a(this.getLanguagePartFromCode(n))):typeof n=="string"&&a(this.formatLanguageCode(n)),i.forEach(function(l){s.indexOf(l)<0&&a(o.formatLanguageCode(l))}),s}}]),e}(),CT=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],IT={1:function(t){return Number(t>1)},2:function(t){return Number(t!=1)},3:function(t){return 0},4:function(t){return Number(t%10==1&&t%100!=11?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2)},5:function(t){return Number(t==0?0:t==1?1:t==2?2:t%100>=3&&t%100<=10?3:t%100>=11?4:5)},6:function(t){return Number(t==1?0:t>=2&&t<=4?1:2)},7:function(t){return Number(t==1?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2)},8:function(t){return Number(t==1?0:t==2?1:t!=8&&t!=11?2:3)},9:function(t){return Number(t>=2)},10:function(t){return Number(t==1?0:t==2?1:t<7?2:t<11?3:4)},11:function(t){return Number(t==1||t==11?0:t==2||t==12?1:t>2&&t<20?2:3)},12:function(t){return Number(t%10!=1||t%100==11)},13:function(t){return Number(t!==0)},14:function(t){return Number(t==1?0:t==2?1:t==3?2:3)},15:function(t){return Number(t%10==1&&t%100!=11?0:t%10>=2&&(t%100<10||t%100>=20)?1:2)},16:function(t){return Number(t%10==1&&t%100!=11?0:t!==0?1:2)},17:function(t){return Number(t==1||t%10==1&&t%100!=11?0:1)},18:function(t){return Number(t==0?0:t==1?1:2)},19:function(t){return Number(t==1?0:t==0||t%100>1&&t%100<11?1:t%100>10&&t%100<20?2:3)},20:function(t){return Number(t==1?0:t==0||t%100>0&&t%100<20?1:2)},21:function(t){return Number(t%100==1?1:t%100==2?2:t%100==3||t%100==4?3:0)},22:function(t){return Number(t==1?0:t==2?1:(t<0||t>10)&&t%10==0?2:3)}},bT=["v1","v2","v3"],_y={zero:0,one:1,two:2,few:3,many:4,other:5};function AT(){var e={};return CT.forEach(function(t){t.lngs.forEach(function(n){e[n]={numbers:t.nr,plurals:IT[t.fc]}})}),e}var LT=function(){function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};_t(this,e),this.languageUtils=t,this.options=n,this.logger=Kt.create("pluralResolver"),(!this.options.compatibilityJSON||this.options.compatibilityJSON==="v4")&&(typeof Intl>"u"||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=AT()}return wt(e,[{key:"addRule",value:function(n,r){this.rules[n]=r}},{key:"getRule",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(n,{type:r.ordinal?"ordinal":"cardinal"})}catch{return}return this.rules[n]||this.rules[this.languageUtils.getLanguagePartFromCode(n)]}},{key:"needsPlural",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=this.getRule(n,r);return this.shouldUseIntlApi()?o&&o.resolvedOptions().pluralCategories.length>1:o&&o.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(n,r){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(n,o).map(function(i){return"".concat(r).concat(i)})}},{key:"getSuffixes",value:function(n){var r=this,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=this.getRule(n,o);return i?this.shouldUseIntlApi()?i.resolvedOptions().pluralCategories.sort(function(s,a){return _y[s]-_y[a]}).map(function(s){return"".concat(r.options.prepend).concat(s)}):i.numbers.map(function(s){return r.getSuffix(n,s,o)}):[]}},{key:"getSuffix",value:function(n,r){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=this.getRule(n,o);return i?this.shouldUseIntlApi()?"".concat(this.options.prepend).concat(i.select(r)):this.getSuffixRetroCompatible(i,r):(this.logger.warn("no plural rule found for: ".concat(n)),"")}},{key:"getSuffixRetroCompatible",value:function(n,r){var o=this,i=n.noAbs?n.plurals(r):n.plurals(Math.abs(r)),s=n.numbers[i];this.options.simplifyPluralSuffix&&n.numbers.length===2&&n.numbers[0]===1&&(s===2?s="plural":s===1&&(s=""));var a=function(){return o.options.prepend&&s.toString()?o.options.prepend+s.toString():s.toString()};return this.options.compatibilityJSON==="v1"?s===1?"":typeof s=="number"?"_plural_".concat(s.toString()):a():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&n.numbers.length===2&&n.numbers[0]===1?a():this.options.prepend&&i.toString()?this.options.prepend+i.toString():i.toString()}},{key:"shouldUseIntlApi",value:function(){return!bT.includes(this.options.compatibilityJSON)}}]),e}();function wy(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Pt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?wy(Object(n),!0).forEach(function(r){hn(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wy(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var DT=function(){function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};_t(this,e),this.logger=Kt.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||function(n){return n},this.init(t)}return wt(e,[{key:"init",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};n.interpolation||(n.interpolation={escapeValue:!0});var r=n.interpolation;this.escape=r.escape!==void 0?r.escape:ST,this.escapeValue=r.escapeValue!==void 0?r.escapeValue:!0,this.useRawValueToEscape=r.useRawValueToEscape!==void 0?r.useRawValueToEscape:!1,this.prefix=r.prefix?Ao(r.prefix):r.prefixEscaped||"{{",this.suffix=r.suffix?Ao(r.suffix):r.suffixEscaped||"}}",this.formatSeparator=r.formatSeparator?r.formatSeparator:r.formatSeparator||",",this.unescapePrefix=r.unescapeSuffix?"":r.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":r.unescapeSuffix||"",this.nestingPrefix=r.nestingPrefix?Ao(r.nestingPrefix):r.nestingPrefixEscaped||Ao("$t("),this.nestingSuffix=r.nestingSuffix?Ao(r.nestingSuffix):r.nestingSuffixEscaped||Ao(")"),this.nestingOptionsSeparator=r.nestingOptionsSeparator?r.nestingOptionsSeparator:r.nestingOptionsSeparator||",",this.maxReplaces=r.maxReplaces?r.maxReplaces:1e3,this.alwaysFormat=r.alwaysFormat!==void 0?r.alwaysFormat:!1,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var n="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(n,"g");var r="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(r,"g");var o="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(o,"g")}},{key:"interpolate",value:function(n,r,o,i){var s=this,a,l,u,c=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function d(y){return y.replace(/\$/g,"$$$$")}var f=function(p){if(p.indexOf(s.formatSeparator)<0){var g=fy(r,c,p);return s.alwaysFormat?s.format(g,void 0,o,Pt(Pt(Pt({},i),r),{},{interpolationkey:p})):g}var S=p.split(s.formatSeparator),_=S.shift().trim(),w=S.join(s.formatSeparator).trim();return s.format(fy(r,c,_),w,o,Pt(Pt(Pt({},i),r),{},{interpolationkey:_}))};this.resetRegExp();var h=i&&i.missingInterpolationHandler||this.options.missingInterpolationHandler,m=i&&i.interpolation&&i.interpolation.skipOnVariables!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables,v=[{regex:this.regexpUnescape,safeValue:function(p){return d(p)}},{regex:this.regexp,safeValue:function(p){return s.escapeValue?d(s.escape(p)):d(p)}}];return v.forEach(function(y){for(u=0;a=y.regex.exec(n);){var p=a[1].trim();if(l=f(p),l===void 0)if(typeof h=="function"){var g=h(n,a,i);l=typeof g=="string"?g:""}else if(i&&Object.prototype.hasOwnProperty.call(i,p))l="";else if(m){l=a[0];continue}else s.logger.warn("missed to pass in variable ".concat(p," for interpolating ").concat(n)),l="";else typeof l!="string"&&!s.useRawValueToEscape&&(l=cy(l));var S=y.safeValue(l);if(n=n.replace(a[0],S),m?(y.regex.lastIndex+=l.length,y.regex.lastIndex-=a[0].length):y.regex.lastIndex=0,u++,u>=s.maxReplaces)break}}),n}},{key:"nest",value:function(n,r){var o=this,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s,a,l;function u(h,m){var v=this.nestingOptionsSeparator;if(h.indexOf(v)<0)return h;var y=h.split(new RegExp("".concat(v,"[ ]*{"))),p="{".concat(y[1]);h=y[0],p=this.interpolate(p,l);var g=p.match(/'/g),S=p.match(/"/g);(g&&g.length%2===0&&!S||S.length%2!==0)&&(p=p.replace(/'/g,'"'));try{l=JSON.parse(p),m&&(l=Pt(Pt({},m),l))}catch(_){return this.logger.warn("failed parsing options string in nesting for key ".concat(h),_),"".concat(h).concat(v).concat(p)}return delete l.defaultValue,h}for(;s=this.nestingRegexp.exec(n);){var c=[];l=Pt({},i),l=l.replace&&typeof l.replace!="string"?l.replace:l,l.applyPostProcessor=!1,delete l.defaultValue;var d=!1;if(s[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(s[1])){var f=s[1].split(this.formatSeparator).map(function(h){return h.trim()});s[1]=f.shift(),c=f,d=!0}if(a=r(u.call(this,s[1].trim(),l),l),a&&s[0]===n&&typeof a!="string")return a;typeof a!="string"&&(a=cy(a)),a||(this.logger.warn("missed to resolve ".concat(s[1]," for nesting ").concat(n)),a=""),d&&(a=c.reduce(function(h,m){return o.format(h,m,i.lng,Pt(Pt({},i),{},{interpolationkey:s[1].trim()}))},a.trim())),n=n.replace(s[0],a),this.regexp.lastIndex=0}return n}}]),e}();function Ry(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function gn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Ry(Object(n),!0).forEach(function(r){hn(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ry(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function kT(e){var t=e.toLowerCase().trim(),n={};if(e.indexOf("(")>-1){var r=e.split("(");t=r[0].toLowerCase().trim();var o=r[1].substring(0,r[1].length-1);if(t==="currency"&&o.indexOf(":")<0)n.currency||(n.currency=o.trim());else if(t==="relativetime"&&o.indexOf(":")<0)n.range||(n.range=o.trim());else{var i=o.split(";");i.forEach(function(s){if(s){var a=s.split(":"),l=hT(a),u=l[0],c=l.slice(1),d=c.join(":").trim().replace(/^'+|'+$/g,"");n[u.trim()]||(n[u.trim()]=d),d==="false"&&(n[u.trim()]=!1),d==="true"&&(n[u.trim()]=!0),isNaN(d)||(n[u.trim()]=parseInt(d,10))}})}}return{formatName:t,formatOptions:n}}function Lo(e){var t={};return function(r,o,i){var s=o+JSON.stringify(i),a=t[s];return a||(a=e(o,i),t[s]=a),a(r)}}var PT=function(){function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};_t(this,e),this.logger=Kt.create("formatter"),this.options=t,this.formats={number:Lo(function(n,r){var o=new Intl.NumberFormat(n,gn({},r));return function(i){return o.format(i)}}),currency:Lo(function(n,r){var o=new Intl.NumberFormat(n,gn(gn({},r),{},{style:"currency"}));return function(i){return o.format(i)}}),datetime:Lo(function(n,r){var o=new Intl.DateTimeFormat(n,gn({},r));return function(i){return o.format(i)}}),relativetime:Lo(function(n,r){var o=new Intl.RelativeTimeFormat(n,gn({},r));return function(i){return o.format(i,r.range||"day")}}),list:Lo(function(n,r){var o=new Intl.ListFormat(n,gn({},r));return function(i){return o.format(i)}})},this.init(t)}return wt(e,[{key:"init",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}},o=r.interpolation;this.formatSeparator=o.formatSeparator?o.formatSeparator:o.formatSeparator||","}},{key:"add",value:function(n,r){this.formats[n.toLowerCase().trim()]=r}},{key:"addCached",value:function(n,r){this.formats[n.toLowerCase().trim()]=Lo(r)}},{key:"format",value:function(n,r,o){var i=this,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},a=r.split(this.formatSeparator),l=a.reduce(function(u,c){var d=kT(c),f=d.formatName,h=d.formatOptions;if(i.formats[f]){var m=u;try{var v=s&&s.formatParams&&s.formatParams[s.interpolationkey]||{},y=v.locale||v.lng||s.locale||s.lng||o;m=i.formats[f](u,y,gn(gn(gn({},h),s),v))}catch(p){i.logger.warn(p)}return m}else i.logger.warn("there was no format function for ".concat(f));return u},n);return l}}]),e}();function Ny(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Oy(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Ny(Object(n),!0).forEach(function(r){hn(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ny(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function MT(e){var t=UT();return function(){var r=Wt(e),o;if(t){var i=Wt(this).constructor;o=Reflect.construct(r,arguments,i)}else o=r.apply(this,arguments);return Ki(this,o)}}function UT(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function FT(e,t){e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)}var VT=function(e){tl(n,e);var t=MT(n);function n(r,o,i){var s,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return _t(this,n),s=t.call(this),rl&&Wn.call(Yn(s)),s.backend=r,s.store=o,s.services=i,s.languageUtils=i.languageUtils,s.options=a,s.logger=Kt.create("backendConnector"),s.waitingReads=[],s.maxParallelReads=a.maxParallelReads||10,s.readingCalls=0,s.maxRetries=a.maxRetries>=0?a.maxRetries:5,s.retryTimeout=a.retryTimeout>=1?a.retryTimeout:350,s.state={},s.queue=[],s.backend&&s.backend.init&&s.backend.init(i,a.backend,a),s}return wt(n,[{key:"queueLoad",value:function(o,i,s,a){var l=this,u={},c={},d={},f={};return o.forEach(function(h){var m=!0;i.forEach(function(v){var y="".concat(h,"|").concat(v);!s.reload&&l.store.hasResourceBundle(h,v)?l.state[y]=2:l.state[y]<0||(l.state[y]===1?c[y]===void 0&&(c[y]=!0):(l.state[y]=1,m=!1,c[y]===void 0&&(c[y]=!0),u[y]===void 0&&(u[y]=!0),f[v]===void 0&&(f[v]=!0)))}),m||(d[h]=!0)}),(Object.keys(u).length||Object.keys(c).length)&&this.queue.push({pending:c,pendingCount:Object.keys(c).length,loaded:{},errors:[],callback:a}),{toLoad:Object.keys(u),pending:Object.keys(c),toLoadLanguages:Object.keys(d),toLoadNamespaces:Object.keys(f)}}},{key:"loaded",value:function(o,i,s){var a=o.split("|"),l=a[0],u=a[1];i&&this.emit("failedLoading",l,u,i),s&&this.store.addResourceBundle(l,u,s),this.state[o]=i?-1:2;var c={};this.queue.forEach(function(d){yT(d.loaded,[l],u),FT(d,o),i&&d.errors.push(i),d.pendingCount===0&&!d.done&&(Object.keys(d.loaded).forEach(function(f){c[f]||(c[f]={});var h=d.loaded[f];h.length&&h.forEach(function(m){c[f][m]===void 0&&(c[f][m]=!0)})}),d.done=!0,d.errors.length?d.callback(d.errors):d.callback())}),this.emit("loaded",c),this.queue=this.queue.filter(function(d){return!d.done})}},{key:"read",value:function(o,i,s){var a=this,l=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,u=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,c=arguments.length>5?arguments[5]:void 0;if(!o.length)return c(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:o,ns:i,fcName:s,tried:l,wait:u,callback:c});return}this.readingCalls++;var d=function(v,y){if(a.readingCalls--,a.waitingReads.length>0){var p=a.waitingReads.shift();a.read(p.lng,p.ns,p.fcName,p.tried,p.wait,p.callback)}if(v&&y&&l<a.maxRetries){setTimeout(function(){a.read.call(a,o,i,s,l+1,u*2,c)},u);return}c(v,y)},f=this.backend[s].bind(this.backend);if(f.length===2){try{var h=f(o,i);h&&typeof h.then=="function"?h.then(function(m){return d(null,m)}).catch(d):d(null,h)}catch(m){d(m)}return}return f(o,i,d)}},{key:"prepareLoading",value:function(o,i){var s=this,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},l=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),l&&l();typeof o=="string"&&(o=this.languageUtils.toResolveHierarchy(o)),typeof i=="string"&&(i=[i]);var u=this.queueLoad(o,i,a,l);if(!u.toLoad.length)return u.pending.length||l(),null;u.toLoad.forEach(function(c){s.loadOne(c)})}},{key:"load",value:function(o,i,s){this.prepareLoading(o,i,{},s)}},{key:"reload",value:function(o,i,s){this.prepareLoading(o,i,{reload:!0},s)}},{key:"loadOne",value:function(o){var i=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",a=o.split("|"),l=a[0],u=a[1];this.read(l,u,"read",void 0,void 0,function(c,d){c&&i.logger.warn("".concat(s,"loading namespace ").concat(u," for language ").concat(l," failed"),c),!c&&d&&i.logger.log("".concat(s,"loaded namespace ").concat(u," for language ").concat(l),d),i.loaded(o,c,d)})}},{key:"saveMissing",value:function(o,i,s,a,l){var u=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},c=arguments.length>6&&arguments[6]!==void 0?arguments[6]:function(){};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(i)){this.logger.warn('did not save key "'.concat(s,'" as the namespace "').concat(i,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(s==null||s==="")){if(this.backend&&this.backend.create){var d=Oy(Oy({},u),{},{isUpdate:l}),f=this.backend.create.bind(this.backend);if(f.length<6)try{var h;f.length===5?h=f(o,i,s,a,d):h=f(o,i,s,a),h&&typeof h.then=="function"?h.then(function(m){return c(null,m)}).catch(c):c(null,h)}catch(m){c(m)}else f(o,i,s,a,c,d)}!o||!o[0]||this.store.addResource(o[0],i,s,a)}}}]),n}(Wn);function xy(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(t){var n={};if(kt(t[1])==="object"&&(n=t[1]),typeof t[1]=="string"&&(n.defaultValue=t[1]),typeof t[2]=="string"&&(n.tDescription=t[2]),kt(t[2])==="object"||kt(t[3])==="object"){var r=t[3]||t[2];Object.keys(r).forEach(function(o){n[o]=r[o]})}return n},interpolation:{escapeValue:!0,format:function(t,n,r,o){return t},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function Ty(e){return typeof e.ns=="string"&&(e.ns=[e.ns]),typeof e.fallbackLng=="string"&&(e.fallbackLng=[e.fallbackLng]),typeof e.fallbackNS=="string"&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function Cy(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Qt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Cy(Object(n),!0).forEach(function(r){hn(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Cy(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function BT(e){var t=$T();return function(){var r=Wt(e),o;if(t){var i=Wt(this).constructor;o=Reflect.construct(r,arguments,i)}else o=r.apply(this,arguments);return Ki(this,o)}}function $T(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function il(){}function HT(e){var t=Object.getOwnPropertyNames(Object.getPrototypeOf(e));t.forEach(function(n){typeof e[n]=="function"&&(e[n]=e[n].bind(e))})}var sl=function(e){tl(n,e);var t=BT(n);function n(){var r,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;if(_t(this,n),r=t.call(this),rl&&Wn.call(Yn(r)),r.options=Ty(o),r.services={},r.logger=Kt,r.modules={external:[]},HT(Yn(r)),i&&!r.isInitialized&&!o.isClone){if(!r.options.initImmediate)return r.init(o,i),Ki(r,Yn(r));setTimeout(function(){r.init(o,i)},0)}return r}return wt(n,[{key:"init",value:function(){var o=this,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},s=arguments.length>1?arguments[1]:void 0;typeof i=="function"&&(s=i,i={}),!i.defaultNS&&i.defaultNS!==!1&&i.ns&&(typeof i.ns=="string"?i.defaultNS=i.ns:i.ns.indexOf("translation")<0&&(i.defaultNS=i.ns[0]));var a=xy();this.options=Qt(Qt(Qt({},a),this.options),Ty(i)),this.options.compatibilityAPI!=="v1"&&(this.options.interpolation=Qt(Qt({},a.interpolation),this.options.interpolation)),i.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=i.keySeparator),i.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=i.nsSeparator);function l(p){return p?typeof p=="function"?new p:p:null}if(!this.options.isClone){this.modules.logger?Kt.init(l(this.modules.logger),this.options):Kt.init(null,this.options);var u;this.modules.formatter?u=this.modules.formatter:typeof Intl<"u"&&(u=PT);var c=new Sy(this.options);this.store=new OT(this.options.resources,this.options);var d=this.services;d.logger=Kt,d.resourceStore=this.store,d.languageUtils=c,d.pluralResolver=new LT(c,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),u&&(!this.options.interpolation.format||this.options.interpolation.format===a.interpolation.format)&&(d.formatter=l(u),d.formatter.init(d,this.options),this.options.interpolation.format=d.formatter.format.bind(d.formatter)),d.interpolator=new DT(this.options),d.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},d.backendConnector=new VT(l(this.modules.backend),d.resourceStore,d,this.options),d.backendConnector.on("*",function(p){for(var g=arguments.length,S=new Array(g>1?g-1:0),_=1;_<g;_++)S[_-1]=arguments[_];o.emit.apply(o,[p].concat(S))}),this.modules.languageDetector&&(d.languageDetector=l(this.modules.languageDetector),d.languageDetector.init&&d.languageDetector.init(d,this.options.detection,this.options)),this.modules.i18nFormat&&(d.i18nFormat=l(this.modules.i18nFormat),d.i18nFormat.init&&d.i18nFormat.init(this)),this.translator=new Ey(this.services,this.options),this.translator.on("*",function(p){for(var g=arguments.length,S=new Array(g>1?g-1:0),_=1;_<g;_++)S[_-1]=arguments[_];o.emit.apply(o,[p].concat(S))}),this.modules.external.forEach(function(p){p.init&&p.init(o)})}if(this.format=this.options.interpolation.format,s||(s=il),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){var f=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);f.length>0&&f[0]!=="dev"&&(this.options.lng=f[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined");var h=["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"];h.forEach(function(p){o[p]=function(){var g;return(g=o.store)[p].apply(g,arguments)}});var m=["addResource","addResources","addResourceBundle","removeResourceBundle"];m.forEach(function(p){o[p]=function(){var g;return(g=o.store)[p].apply(g,arguments),o}});var v=Qi(),y=function(){var g=function(_,w){o.isInitialized&&!o.initializedStoreOnce&&o.logger.warn("init: i18next is already initialized. You should call init just once!"),o.isInitialized=!0,o.options.isClone||o.logger.log("initialized",o.options),o.emit("initialized",o.options),v.resolve(w),s(_,w)};if(o.languages&&o.options.compatibilityAPI!=="v1"&&!o.isInitialized)return g(null,o.t.bind(o));o.changeLanguage(o.options.lng,g)};return this.options.resources||!this.options.initImmediate?y():setTimeout(y,0),v}},{key:"loadResources",value:function(o){var i=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:il,a=s,l=typeof o=="string"?o:this.language;if(typeof o=="function"&&(a=o),!this.options.resources||this.options.partialBundledLanguages){if(l&&l.toLowerCase()==="cimode")return a();var u=[],c=function(h){if(h){var m=i.services.languageUtils.toResolveHierarchy(h);m.forEach(function(v){u.indexOf(v)<0&&u.push(v)})}};if(l)c(l);else{var d=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);d.forEach(function(f){return c(f)})}this.options.preload&&this.options.preload.forEach(function(f){return c(f)}),this.services.backendConnector.load(u,this.options.ns,function(f){!f&&!i.resolvedLanguage&&i.language&&i.setResolvedLanguage(i.language),a(f)})}else a(null)}},{key:"reloadResources",value:function(o,i,s){var a=Qi();return o||(o=this.languages),i||(i=this.options.ns),s||(s=il),this.services.backendConnector.reload(o,i,function(l){a.resolve(),s(l)}),a}},{key:"use",value:function(o){if(!o)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!o.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return o.type==="backend"&&(this.modules.backend=o),(o.type==="logger"||o.log&&o.warn&&o.error)&&(this.modules.logger=o),o.type==="languageDetector"&&(this.modules.languageDetector=o),o.type==="i18nFormat"&&(this.modules.i18nFormat=o),o.type==="postProcessor"&&my.addPostProcessor(o),o.type==="formatter"&&(this.modules.formatter=o),o.type==="3rdParty"&&this.modules.external.push(o),this}},{key:"setResolvedLanguage",value:function(o){if(!(!o||!this.languages)&&!(["cimode","dev"].indexOf(o)>-1))for(var i=0;i<this.languages.length;i++){var s=this.languages[i];if(!(["cimode","dev"].indexOf(s)>-1)&&this.store.hasLanguageSomeTranslations(s)){this.resolvedLanguage=s;break}}}},{key:"changeLanguage",value:function(o,i){var s=this;this.isLanguageChangingTo=o;var a=Qi();this.emit("languageChanging",o);var l=function(f){s.language=f,s.languages=s.services.languageUtils.toResolveHierarchy(f),s.resolvedLanguage=void 0,s.setResolvedLanguage(f)},u=function(f,h){h?(l(h),s.translator.changeLanguage(h),s.isLanguageChangingTo=void 0,s.emit("languageChanged",h),s.logger.log("languageChanged",h)):s.isLanguageChangingTo=void 0,a.resolve(function(){return s.t.apply(s,arguments)}),i&&i(f,function(){return s.t.apply(s,arguments)})},c=function(f){!o&&!f&&s.services.languageDetector&&(f=[]);var h=typeof f=="string"?f:s.services.languageUtils.getBestMatchFromCodes(f);h&&(s.language||l(h),s.translator.language||s.translator.changeLanguage(h),s.services.languageDetector&&s.services.languageDetector.cacheUserLanguage&&s.services.languageDetector.cacheUserLanguage(h)),s.loadResources(h,function(m){u(m,h)})};return!o&&this.services.languageDetector&&!this.services.languageDetector.async?c(this.services.languageDetector.detect()):!o&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(c):this.services.languageDetector.detect(c):c(o),a}},{key:"getFixedT",value:function(o,i,s){var a=this,l=function u(c,d){var f;if(kt(d)!=="object"){for(var h=arguments.length,m=new Array(h>2?h-2:0),v=2;v<h;v++)m[v-2]=arguments[v];f=a.options.overloadTranslationOptionHandler([c,d].concat(m))}else f=Qt({},d);f.lng=f.lng||u.lng,f.lngs=f.lngs||u.lngs,f.ns=f.ns||u.ns,f.keyPrefix=f.keyPrefix||s||u.keyPrefix;var y=a.options.keySeparator||".",p;return f.keyPrefix&&Array.isArray(c)?p=c.map(function(g){return"".concat(f.keyPrefix).concat(y).concat(g)}):p=f.keyPrefix?"".concat(f.keyPrefix).concat(y).concat(c):c,a.t(p,f)};return typeof o=="string"?l.lng=o:l.lngs=o,l.ns=i,l.keyPrefix=s,l}},{key:"t",value:function(){var o;return this.translator&&(o=this.translator).translate.apply(o,arguments)}},{key:"exists",value:function(){var o;return this.translator&&(o=this.translator).exists.apply(o,arguments)}},{key:"setDefaultNamespace",value:function(o){this.options.defaultNS=o}},{key:"hasLoadedNamespace",value:function(o){var i=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var a=this.resolvedLanguage||this.languages[0],l=this.options?this.options.fallbackLng:!1,u=this.languages[this.languages.length-1];if(a.toLowerCase()==="cimode")return!0;var c=function(h,m){var v=i.services.backendConnector.state["".concat(h,"|").concat(m)];return v===-1||v===2};if(s.precheck){var d=s.precheck(this,c);if(d!==void 0)return d}return!!(this.hasResourceBundle(a,o)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||c(a,o)&&(!l||c(u,o)))}},{key:"loadNamespaces",value:function(o,i){var s=this,a=Qi();return this.options.ns?(typeof o=="string"&&(o=[o]),o.forEach(function(l){s.options.ns.indexOf(l)<0&&s.options.ns.push(l)}),this.loadResources(function(l){a.resolve(),i&&i(l)}),a):(i&&i(),Promise.resolve())}},{key:"loadLanguages",value:function(o,i){var s=Qi();typeof o=="string"&&(o=[o]);var a=this.options.preload||[],l=o.filter(function(u){return a.indexOf(u)<0});return l.length?(this.options.preload=a.concat(l),this.loadResources(function(u){s.resolve(),i&&i(u)}),s):(i&&i(),Promise.resolve())}},{key:"dir",value:function(o){if(o||(o=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!o)return"rtl";var i=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],s=this.services&&this.services.languageUtils||new Sy(xy());return i.indexOf(s.getLanguagePartFromCode(o))>-1||o.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}},{key:"cloneInstance",value:function(){var o=this,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:il,a=Qt(Qt(Qt({},this.options),i),{isClone:!0}),l=new n(a);(i.debug!==void 0||i.prefix!==void 0)&&(l.logger=l.logger.clone(i));var u=["store","services","language"];return u.forEach(function(c){l[c]=o[c]}),l.services=Qt({},this.services),l.services.utils={hasLoadedNamespace:l.hasLoadedNamespace.bind(l)},l.translator=new Ey(l.services,l.options),l.translator.on("*",function(c){for(var d=arguments.length,f=new Array(d>1?d-1:0),h=1;h<d;h++)f[h-1]=arguments[h];l.emit.apply(l,[c].concat(f))}),l.init(a,s),l.translator.options=l.options,l.translator.backendConnector.services.utils={hasLoadedNamespace:l.hasLoadedNamespace.bind(l)},l}},{key:"toJSON",value:function(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}]),n}(Wn);hn(sl,"createInstance",function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return new sl(e,t)});var be=sl.createInstance();be.createInstance=sl.createInstance,be.createInstance,be.dir,be.init,be.loadResources,be.reloadResources,be.use,be.changeLanguage,be.getFixedT,be.t,be.exists,be.setDefaultNamespace,be.hasLoadedNamespace,be.loadNamespaces,be.loadLanguages;var Iy=[],zT=Iy.forEach,jT=Iy.slice;function GT(e){return zT.call(jT.call(arguments,1),function(t){if(t)for(var n in t)e[n]===void 0&&(e[n]=t[n])}),e}var by=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,YT=function(t,n,r){var o=r||{};o.path=o.path||"/";var i=encodeURIComponent(n),s="".concat(t,"=").concat(i);if(o.maxAge>0){var a=o.maxAge-0;if(Number.isNaN(a))throw new Error("maxAge should be a Number");s+="; Max-Age=".concat(Math.floor(a))}if(o.domain){if(!by.test(o.domain))throw new TypeError("option domain is invalid");s+="; Domain=".concat(o.domain)}if(o.path){if(!by.test(o.path))throw new TypeError("option path is invalid");s+="; Path=".concat(o.path)}if(o.expires){if(typeof o.expires.toUTCString!="function")throw new TypeError("option expires is invalid");s+="; Expires=".concat(o.expires.toUTCString())}if(o.httpOnly&&(s+="; HttpOnly"),o.secure&&(s+="; Secure"),o.sameSite){var l=typeof o.sameSite=="string"?o.sameSite.toLowerCase():o.sameSite;switch(l){case!0:s+="; SameSite=Strict";break;case"lax":s+="; SameSite=Lax";break;case"strict":s+="; SameSite=Strict";break;case"none":s+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return s},Ay={create:function(t,n,r,o){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};r&&(i.expires=new Date,i.expires.setTime(i.expires.getTime()+r*60*1e3)),o&&(i.domain=o),document.cookie=YT(t,encodeURIComponent(n),i)},read:function(t){for(var n="".concat(t,"="),r=document.cookie.split(";"),o=0;o<r.length;o++){for(var i=r[o];i.charAt(0)===" ";)i=i.substring(1,i.length);if(i.indexOf(n)===0)return i.substring(n.length,i.length)}return null},remove:function(t){this.create(t,"",-1)}},WT={name:"cookie",lookup:function(t){var n;if(t.lookupCookie&&typeof document<"u"){var r=Ay.read(t.lookupCookie);r&&(n=r)}return n},cacheUserLanguage:function(t,n){n.lookupCookie&&typeof document<"u"&&Ay.create(n.lookupCookie,t,n.cookieMinutes,n.cookieDomain,n.cookieOptions)}},KT={name:"querystring",lookup:function(t){var n;if(typeof window<"u"){var r=window.location.search;!window.location.search&&window.location.hash&&window.location.hash.indexOf("?")>-1&&(r=window.location.hash.substring(window.location.hash.indexOf("?")));for(var o=r.substring(1),i=o.split("&"),s=0;s<i.length;s++){var a=i[s].indexOf("=");if(a>0){var l=i[s].substring(0,a);l===t.lookupQuerystring&&(n=i[s].substring(a+1))}}}return n}},Xi=null,Ly=function(){if(Xi!==null)return Xi;try{Xi=window!=="undefined"&&window.localStorage!==null;var t="i18next.translate.boo";window.localStorage.setItem(t,"foo"),window.localStorage.removeItem(t)}catch{Xi=!1}return Xi},QT={name:"localStorage",lookup:function(t){var n;if(t.lookupLocalStorage&&Ly()){var r=window.localStorage.getItem(t.lookupLocalStorage);r&&(n=r)}return n},cacheUserLanguage:function(t,n){n.lookupLocalStorage&&Ly()&&window.localStorage.setItem(n.lookupLocalStorage,t)}},qi=null,Dy=function(){if(qi!==null)return qi;try{qi=window!=="undefined"&&window.sessionStorage!==null;var t="i18next.translate.boo";window.sessionStorage.setItem(t,"foo"),window.sessionStorage.removeItem(t)}catch{qi=!1}return qi},XT={name:"sessionStorage",lookup:function(t){var n;if(t.lookupSessionStorage&&Dy()){var r=window.sessionStorage.getItem(t.lookupSessionStorage);r&&(n=r)}return n},cacheUserLanguage:function(t,n){n.lookupSessionStorage&&Dy()&&window.sessionStorage.setItem(n.lookupSessionStorage,t)}},qT={name:"navigator",lookup:function(t){var n=[];if(typeof navigator<"u"){if(navigator.languages)for(var r=0;r<navigator.languages.length;r++)n.push(navigator.languages[r]);navigator.userLanguage&&n.push(navigator.userLanguage),navigator.language&&n.push(navigator.language)}return n.length>0?n:void 0}},ZT={name:"htmlTag",lookup:function(t){var n,r=t.htmlTag||(typeof document<"u"?document.documentElement:null);return r&&typeof r.getAttribute=="function"&&(n=r.getAttribute("lang")),n}},JT={name:"path",lookup:function(t){var n;if(typeof window<"u"){var r=window.location.pathname.match(/\/([a-zA-Z-]*)/g);if(r instanceof Array)if(typeof t.lookupFromPathIndex=="number"){if(typeof r[t.lookupFromPathIndex]!="string")return;n=r[t.lookupFromPathIndex].replace("/","")}else n=r[0].replace("/","")}return n}},eC={name:"subdomain",lookup:function(t){var n=typeof t.lookupFromSubdomainIndex=="number"?t.lookupFromSubdomainIndex+1:1,r=typeof window<"u"&&window.location&&window.location.hostname&&window.location.hostname.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(r)return r[n]}};function tC(){return{order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"]}}var ky=function(){function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};_t(this,e),this.type="languageDetector",this.detectors={},this.init(t,n)}return wt(e,[{key:"init",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=n,this.options=GT(r,this.options||{},tC()),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=o,this.addDetector(WT),this.addDetector(KT),this.addDetector(QT),this.addDetector(XT),this.addDetector(qT),this.addDetector(ZT),this.addDetector(JT),this.addDetector(eC)}},{key:"addDetector",value:function(n){this.detectors[n.name]=n}},{key:"detect",value:function(n){var r=this;n||(n=this.options.order);var o=[];return n.forEach(function(i){if(r.detectors[i]){var s=r.detectors[i].lookup(r.options);s&&typeof s=="string"&&(s=[s]),s&&(o=o.concat(s))}}),this.services.languageUtils.getBestMatchFromCodes?o:o.length>0?o[0]:null}},{key:"cacheUserLanguage",value:function(n,r){var o=this;r||(r=this.options.caches),r&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(n)>-1||r.forEach(function(i){o.detectors[i]&&o.detectors[i].cacheUserLanguage(n,o.options)}))}}]),e}();ky.type="languageDetector";var nC=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,rC={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},oC=function(t){return rC[t]},iC=function(t){return t.replace(nC,oC)};function Py(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function My(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Py(Object(n),!0).forEach(function(r){hn(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Py(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var Uy={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:iC};function sC(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Uy=My(My({},Uy),e)}var aC={type:"3rdParty",init:function(t){sC(t.options.react)}};N.createContext(),function(){function e(){_t(this,e),this.usedNamespaces={}}return wt(e,[{key:"addUsedNamespaces",value:function(n){var r=this;n.forEach(function(o){r.usedNamespaces[o]||(r.usedNamespaces[o]=!0)})}},{key:"getUsedNamespaces",value:function(){return Object.keys(this.usedNamespaces)}}]),e}();const lC={ABOUT:"About",ACTION:"Action",ADD_CONDITION:"Add Condition",ADD_OPTION:"Add Option",ADD_VARIABLE:"Add Variable",ANSWER_CALL:"Answer Call",API_VERSION:"API Version",APP_VERSION:"App Version",BEEP_SUBTITLE:"Play a beep before recording",BEEP:"Beep",BUILDER_VERSION:"Builder Version",BUSY:"Busy",CALL_ADDRESSES:"Call Addresses",CALL_NUMBERS:"Call Numbers",CALL_RESOURCES:"Call Resources",CALLER_PRESSES:"Caller Presses",CHOOSE_OPTION_SINGLE_MULTIPLE:"Choose single or multiple",CHOOSE_OPTION_TTS_AUDIO:"Choose how to play the message",CLOSE:"Close",COND_NUMBER:"Cond {{index}}",CONDITION_NUMBER:"Condition {{index}}",CONDITIONS:"Conditions",DECISION:"Decision",DECLINE:"Decline",DEPRECATED:"Deprecated",DISCONNECT_CALL_AFTER_RINGING:"Disconnect call after ringing",DOCUMENT_OUT_OF_SYNC:"Document Out of Sync",ELSE:"Else",ENTER_URL:"Enter URL",ERROR_ADD_RECORDING_FIRST:"Please add a Start Call Recording node first.",ERROR_DUPLICATE_RECORDING_LABEL:"This entry already exists. Please use a unique label.",ERROR_DUPLICATE_VARIABLE_KEY:"This variable already exists. Please use a unique key.",ERROR_INVALID_JSON:"Invalid JSON",ERROR_NUMBER_IS_REQUIRED:"A number is required.",ERROR_NUMBER_MIN_MAX_IS_REQUIRED:"A number between {{min}} and {{max}} is required.",ERROR_RECORDING_LABEL_REQUIRED:"A value is required. Maximum 20 characters.",ERROR_TELEPHONE_KEY_REQUIRED:"A value of 0-9, *, or # is required.",ERROR_TERMINATORS:"This value should contain only 0-9, *, or #.",ERROR_TEXT_IS_REQUIRED:"A text value is required.",ERROR_URL_IS_REQUIRED:"A valid URL is required.",ERROR_VALUE_IS_REQUIRED:"A value is required.",ERROR_VARIABLE_KEY_REQUIRED:"Valid characters are lowercase letters, digits, or underscore. Maximum 20 characters.",ERROR:"Error",FAILED:"Failed",FAILURE:"Failure",FEMALE:"Female",FORMAT:"Format",FORWARD_TO_ADDRESS:"Forward to Address",FORWARD_TO_PHONE:"Forward to Phone",FORWARD_TO_RESOURCE:"Forward to Resource",FORWARD:"Forward",FROM_PHONE_NUMBER:"From Phone Number",FROM:"From",GATHER_INPUT:"Gather Input",GENDER:"Gender",GO_BACK:"Go Back",HANDLE_CALL:"Handle Call",HANG_UP_CALL:"Hang Up Call",HANG_UP:"Hang Up",IGNORE:"Ignore",INFO_DEPLOY:"Deploy the latest changes for the current call flow.",INFO_NODE_COND:"Sets branching (when, then, else) based on the specified JavaScript condition.",INFO_NODE_FORWARD_TO_ADDRESS:"Forwards the current call to the specified Address as defined within your SignalWire space.",INFO_NODE_FORWARD_TO_PHONE:"Forwards the current call to the specified phone number (must be E.164 format).",INFO_NODE_FORWARD_TO_RESOURCE:"Forwards the current call to the specified Resource as defined within your SignalWire space.",INFO_NODE_GATHER_INPUT:"Plays an audio file or Text to Speech phrase and waits for a keypress or spoken input from the caller, allowing them to proceed through the call flow based on their input.",INFO_NODE_HANG_UP:"Ends the call with the ability to provide a reason (hangup, busy, or decline).",INFO_NODE_OPTION_REMOVE:"Are you sure? Removing this option will delete the flow connection and move back the following option, if there is one.",INFO_NODE_PLAY:"Plays an audio file or Text to Speech phrase. A valid URL must be provided for the audio file to be played. Text to Speech will read aloud the provided text using the voice option that is selected.",INFO_NODE_RECORD_CALL_START:"Triggers background recording of both sides of the call. Options can be set to enable stereo audio, play a notification beep before recording, set a digit to stop recording (terminator), and specify the recording name and format (WAV or MP3).",INFO_NODE_RECORD_CALL_STOP:"Triggers a background call recording to stop at a specific point in the call flow, if it has not already been terminated.",INFO_NODE_RECORD:"Triggers foreground recording of both sides of the call and waits for the recording to end. Options can be set to enable stereo audio, play a notification beep before recording, set a digit to stop recording (terminator), and specify the recording name and format (WAV or MP3).",INFO_NODE_REQUEST:"Makes an HTTP request (GET/POST/PUT/DELETE HTTP) to the specified URL. Responses can be parsed and stored as variables for further use in your flow.",INFO_NODE_SEND_SMS:"Sends an SMS message to the specified phone number. The 'From' phone number must be enabled for messaging (a 10DLC number assigned to an active TCR campaign or a verified toll free number).",INFO_NODE_SET_VARIABLES_OPTION:"Are you sure you want to remove this variable?",INFO_NODE_SET_VARIABLES:"Sets script variables by accepting an object which maps variable names to values.",INFO_NODE_UNSET_VARIABLES:"Unsets script variables.",INFO_STATUS_ERROR_OUT_OF_SYNC:"This document is locked because another user has made updates to the Call Flow. Refresh the page to discard your changes and unlock the flow with the latest updates.",INFO_STATUS_ERROR:"An error occurred while loading or saving the flow.",INPUT:"Input",KEY:"Key",LANGUAGE:"Language",MALE:"Male",METHOD:"Method",MORE_INFO_DEPLOY_ERROR:"There was an error deploying the Call Flow. Please try again. {{message}}",MORE_INFO_DEPLOY:"Deploying a Call Flow makes it live.",MORE_INFO_STATUS_ERROR:"More info on Flow document error",MORE_INFO_TITLE:"More info {{title}}",MULTIPLE_ADDRESSES:"Multiple Addresses",MULTIPLE_NUMBERS:"Multiple Numbers",MULTIPLE_RESOURCES:"Multiple Resources",NAVIGATE_BACK:"Navigate Back",NO_ANSWER:"No Answer",NO_INPUT:"No Input",NO_VARIABLES_SET:"Please set variables first",NUMBER_OF_VARIABLES_SELECTED_one:"{{count}} variable selected",NUMBER_OF_VARIABLES_SELECTED_other:"{{count}} variables selected",OFF:"Off",ON:"On",OPT_NUMBER:"Opt {{index}}",OPTION_NUMBER:"Option {{index}}",OPTIONAL:"optional",OR_SAYS:"Or says",PHONE_NUMBER:"Phone Number",PLAY_AUDIO_FILE:"Play Audio File",PLAY_AUDIO_TTS:"Play Audio or TTS",REASON:"Reason",RECORD_CALL_START:"Start Call Recording",RECORD_CALL_STOP:"Stop Call Recording",RECORD:"Record",RECORDING_NAME_DEFAULT:"Recording {{index}}",RECORDING_NAME:"Recording Name",RECORDING:"Recording",RELAYML_VERSION:"SWML Version",REMOVE_CONDITION:"Remove Condition {{index}}",REMOVE_EDGE:"Remove Edge",REMOVE_NODE:"Remove Node {{title}}",REMOVE_OPTION:"Remove Option {{index}}",REMOVE_VARIABLE:"Remove Variable {{index}}",REQUEST_BODY:"Body",REQUEST_HEADERS:"Headers (JSON)",REQUEST:"Request",RESYNC:"Resync",SAVE_VARIABLES_SUBTITLE:"Store the response as variables",SAVE_VARIABLES:"Save Variables",SECONDS:"seconds",SELECT_VARIABLES_TO_UNSET:"Select Variables to Unset",SELECT_VARIABLES:"Select Variables",SELECT:"Select",SEND_SMS:"Send SMS",SEQUENTIALLY:"Sequentially",SET_VARIABLES:"Set Variables",SETTINGS:"Settings",SIMULTANEOUSLY:"Simultaneously",SINGLE_ADDRESS:"Single Address",SINGLE_NUMBER:"Single Number",SINGLE_RESOURCE:"Single Resource",SMS_TEXT:"SMS Text",STATUS_DEPLOY_ERROR:"Deploy Error",STATUS_DEPLOY:"Deploy",STATUS_DEPLOYED:"Deployed",STATUS_DEPLOYING:"Deploying...",STATUS_ERROR:"Error",STATUS_LOADING:"Loading...",STATUS_LOCKED:"Locked",STATUS_SAVED:"Saved",STATUS_SAVING:"Saving...",STEREO_SUBTITLE:"Enable stereo audio",STEREO:"Stereo",SUCCESS:"Success",TERMINATORS:"Terminators",TEXT_TO_SPEECH:"Text to Speech",TEXT:"Text",TO_PHONE_NUMBER:"To Phone Number",TO:"To",TOAST_DOCUMENT_OUT_OF_SYNC:'Updates have been made to this Call Flow by another user and your recent changes have not been saved. Choose "Ignore" to view your changes in a locked state or "Resync" to abandon your changes and adopt the latest updates.',UNKNOWN:"Unknown",UNSET_VARIABLES:"Unset Variables",URL:"URL",VALUE:"Value",VARIABLE_KEY:"Variable {{key}}",VOICE:"Voice",VOICEMAIL_RECORDING:"Voicemail Recording",WAIT_FOR_INPUT:"Wait for Input",WRITE_SOMETHING:"Write something"},x={ABOUT:"ABOUT",ACTION:"ACTION",ADD_CONDITION:"ADD_CONDITION",ADD_OPTION:"ADD_OPTION",ADD_VARIABLE:"ADD_VARIABLE",ANSWER_CALL:"ANSWER_CALL",API_VERSION:"API_VERSION",APP_VERSION:"APP_VERSION",BEEP_SUBTITLE:"BEEP_SUBTITLE",BEEP:"BEEP",BUILDER_VERSION:"BUILDER_VERSION",BUSY:"BUSY",CALL_ADDRESSES:"CALL_ADDRESSES",CALL_NUMBERS:"CALL_NUMBERS",CALL_RESOURCES:"CALL_RESOURCES",CALLER_PRESSES:"CALLER_PRESSES",CHOOSE_OPTION_SINGLE_MULTIPLE:"CHOOSE_OPTION_SINGLE_MULTIPLE",CHOOSE_OPTION_TTS_AUDIO:"CHOOSE_OPTION_TTS_AUDIO",CLOSE:"CLOSE",COND_NUMBER:"COND_NUMBER",CONDITION_NUMBER:"CONDITION_NUMBER",CONDITIONS:"CONDITIONS",DECISION:"DECISION",DECLINE:"DECLINE",DEPRECATED:"DEPRECATED",DISCONNECT_CALL_AFTER_RINGING:"DISCONNECT_CALL_AFTER_RINGING",DOCUMENT_OUT_OF_SYNC:"DOCUMENT_OUT_OF_SYNC",ELSE:"ELSE",ENTER_URL:"ENTER_URL",ERROR_ADD_RECORDING_FIRST:"ERROR_ADD_RECORDING_FIRST",ERROR_DUPLICATE_RECORDING_LABEL:"ERROR_DUPLICATE_RECORDING_LABEL",ERROR_DUPLICATE_VARIABLE_KEY:"ERROR_DUPLICATE_VARIABLE_KEY",ERROR_INVALID_JSON:"ERROR_INVALID_JSON",ERROR_NUMBER_IS_REQUIRED:"ERROR_NUMBER_IS_REQUIRED",ERROR_NUMBER_MIN_MAX_IS_REQUIRED:"ERROR_NUMBER_MIN_MAX_IS_REQUIRED",ERROR_RECORDING_LABEL_REQUIRED:"ERROR_RECORDING_LABEL_REQUIRED",ERROR_TELEPHONE_KEY_REQUIRED:"ERROR_TELEPHONE_KEY_REQUIRED",ERROR_TERMINATORS:"ERROR_TERMINATORS",ERROR_TEXT_IS_REQUIRED:"ERROR_TEXT_IS_REQUIRED",ERROR_URL_IS_REQUIRED:"ERROR_URL_IS_REQUIRED",ERROR_VALUE_IS_REQUIRED:"ERROR_VALUE_IS_REQUIRED",ERROR_VARIABLE_KEY_REQUIRED:"ERROR_VARIABLE_KEY_REQUIRED",ERROR:"ERROR",FAILED:"FAILED",FAILURE:"FAILURE",FEMALE:"FEMALE",FORMAT:"FORMAT",FORWARD_TO_ADDRESS:"FORWARD_TO_ADDRESS",FORWARD_TO_PHONE:"FORWARD_TO_PHONE",FORWARD_TO_RESOURCE:"FORWARD_TO_RESOURCE",FORWARD:"FORWARD",FROM_PHONE_NUMBER:"FROM_PHONE_NUMBER",FROM:"FROM",GATHER_INPUT:"GATHER_INPUT",GENDER:"GENDER",GO_BACK:"GO_BACK",HANDLE_CALL:"HANDLE_CALL",HANG_UP_CALL:"HANG_UP_CALL",HANG_UP:"HANG_UP",IGNORE:"IGNORE",INFO_DEPLOY:"INFO_DEPLOY",INFO_NODE_COND:"INFO_NODE_COND",INFO_NODE_FORWARD_TO_ADDRESS:"INFO_NODE_FORWARD_TO_ADDRESS",INFO_NODE_FORWARD_TO_PHONE:"INFO_NODE_FORWARD_TO_PHONE",INFO_NODE_FORWARD_TO_RESOURCE:"INFO_NODE_FORWARD_TO_RESOURCE",INFO_NODE_GATHER_INPUT:"INFO_NODE_GATHER_INPUT",INFO_NODE_HANG_UP:"INFO_NODE_HANG_UP",INFO_NODE_OPTION_REMOVE:"INFO_NODE_OPTION_REMOVE",INFO_NODE_PLAY:"INFO_NODE_PLAY",INFO_NODE_RECORD_CALL_START:"INFO_NODE_RECORD_CALL_START",INFO_NODE_RECORD_CALL_STOP:"INFO_NODE_RECORD_CALL_STOP",INFO_NODE_RECORD:"INFO_NODE_RECORD",INFO_NODE_REQUEST:"INFO_NODE_REQUEST",INFO_NODE_SEND_SMS:"INFO_NODE_SEND_SMS",INFO_NODE_SET_VARIABLES_OPTION:"INFO_NODE_SET_VARIABLES_OPTION",INFO_NODE_SET_VARIABLES:"INFO_NODE_SET_VARIABLES",INFO_NODE_UNSET_VARIABLES:"INFO_NODE_UNSET_VARIABLES",INFO_STATUS_ERROR_OUT_OF_SYNC:"INFO_STATUS_ERROR_OUT_OF_SYNC",INFO_STATUS_ERROR:"INFO_STATUS_ERROR",INPUT:"INPUT",KEY:"KEY",LANGUAGE:"LANGUAGE",MALE:"MALE",METHOD:"METHOD",MORE_INFO_DEPLOY_ERROR:"MORE_INFO_DEPLOY_ERROR",MORE_INFO_DEPLOY:"MORE_INFO_DEPLOY",MORE_INFO_STATUS_ERROR:"MORE_INFO_STATUS_ERROR",MORE_INFO_TITLE:"MORE_INFO_TITLE",MULTIPLE_ADDRESSES:"MULTIPLE_ADDRESSES",MULTIPLE_NUMBERS:"MULTIPLE_NUMBERS",MULTIPLE_RESOURCES:"MULTIPLE_RESOURCES",NAVIGATE_BACK:"NAVIGATE_BACK",NO_ANSWER:"NO_ANSWER",NO_INPUT:"NO_INPUT",NO_VARIABLES_SET:"NO_VARIABLES_SET",NUMBER_OF_VARIABLES_SELECTED:"NUMBER_OF_VARIABLES_SELECTED",OFF:"OFF",ON:"ON",OPT_NUMBER:"OPT_NUMBER",OPTION_NUMBER:"OPTION_NUMBER",OPTIONAL:"OPTIONAL",OR_SAYS:"OR_SAYS",PHONE_NUMBER:"PHONE_NUMBER",PLAY_AUDIO_FILE:"PLAY_AUDIO_FILE",PLAY_AUDIO_TTS:"PLAY_AUDIO_TTS",REASON:"REASON",RECORD_CALL_START:"RECORD_CALL_START",RECORD_CALL_STOP:"RECORD_CALL_STOP",RECORD:"RECORD",RECORDING_NAME_DEFAULT:"RECORDING_NAME_DEFAULT",RECORDING_NAME:"RECORDING_NAME",RECORDING:"RECORDING",RELAYML_VERSION:"RELAYML_VERSION",REMOVE_CONDITION:"REMOVE_CONDITION",REMOVE_EDGE:"REMOVE_EDGE",REMOVE_NODE:"REMOVE_NODE",REMOVE_OPTION:"REMOVE_OPTION",REMOVE_VARIABLE:"REMOVE_VARIABLE",REQUEST_BODY:"REQUEST_BODY",REQUEST_HEADERS:"REQUEST_HEADERS",REQUEST:"REQUEST",RESYNC:"RESYNC",SAVE_VARIABLES_SUBTITLE:"SAVE_VARIABLES_SUBTITLE",SAVE_VARIABLES:"SAVE_VARIABLES",SECONDS:"SECONDS",SELECT_VARIABLES_TO_UNSET:"SELECT_VARIABLES_TO_UNSET",SELECT_VARIABLES:"SELECT_VARIABLES",SELECT:"SELECT",SEND_SMS:"SEND_SMS",SEQUENTIALLY:"SEQUENTIALLY",SET_VARIABLES:"SET_VARIABLES",SETTINGS:"SETTINGS",SIMULTANEOUSLY:"SIMULTANEOUSLY",SINGLE_ADDRESS:"SINGLE_ADDRESS",SINGLE_NUMBER:"SINGLE_NUMBER",SINGLE_RESOURCE:"SINGLE_RESOURCE",SMS_TEXT:"SMS_TEXT",STATUS_DEPLOY_ERROR:"STATUS_DEPLOY_ERROR",STATUS_DEPLOY:"STATUS_DEPLOY",STATUS_DEPLOYED:"STATUS_DEPLOYED",STATUS_DEPLOYING:"STATUS_DEPLOYING",STATUS_ERROR:"STATUS_ERROR",STATUS_LOADING:"STATUS_LOADING",STATUS_LOCKED:"STATUS_LOCKED",STATUS_SAVED:"STATUS_SAVED",STATUS_SAVING:"STATUS_SAVING",STEREO_SUBTITLE:"STEREO_SUBTITLE",STEREO:"STEREO",SUCCESS:"SUCCESS",TERMINATORS:"TERMINATORS",TEXT_TO_SPEECH:"TEXT_TO_SPEECH",TEXT:"TEXT",TO_PHONE_NUMBER:"TO_PHONE_NUMBER",TO:"TO",TOAST_DOCUMENT_OUT_OF_SYNC:"TOAST_DOCUMENT_OUT_OF_SYNC",UNKNOWN:"UNKNOWN",UNSET_VARIABLES:"UNSET_VARIABLES",URL:"URL",VALUE:"VALUE",VARIABLE_KEY:"VARIABLE_KEY",VOICE:"VOICE",VOICEMAIL_RECORDING:"VOICEMAIL_RECORDING",WAIT_FOR_INPUT:"WAIT_FOR_INPUT",WRITE_SOMETHING:"WRITE_SOMETHING"},uC={order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag","path","subdomain"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage","cookie"],excludeCacheFor:["cimode"]},cC={"en-US":{translation:lC}},dC=()=>{be.use(ky).use(aC).init({debug:Jx,detection:uC,fallbackLng:"en-US",interpolation:{escapeValue:!1},keySeparator:!1,resources:cC})};function b(e,t){return t?be.t(e,t):be.t(e)}const fC={entries:[],nextLabelIndex:0},Kn=Ii((e,t)=>({...fC,getEntries(){return t().entries},getEntryValue(n){var r;return(r=t().entries.find(o=>o.controlId===n))==null?void 0:r.label},getGeneratedLabel(){let n="";do this.nextLabelIndex++,n=b(x.RECORDING_NAME_DEFAULT,{index:this.nextLabelIndex});while(this.isValueDuplicate(n));return n},isKeyDuplicate(n){return t().entries.some(r=>r.controlId===n)},isValueDuplicate(n,r){const o=t().entries.reduce((i,s)=>{const{label:a,controlId:l}=s;return a!==""&&a===n&&(!r||l!==r)?[...i,s]:i},[]);return Boolean(o.length)},removeEntry(n){e(r=>({entries:r.entries.filter(o=>o.controlId!==n)}))},upsertEntry:n=>{e(r=>{let o=[...r.entries];const i=Boolean(n.label.trim());return(r.isKeyDuplicate(n.controlId)||!i)&&(o=o.filter(s=>s.controlId!==n.controlId)),i&&o.push({...n}),{entries:o}})}})),pC=e=>{const t=[];e.forEach(n=>{n.type==="recordCallStart"&&n.data.controlId&&n.data.label&&t.push({controlId:n.data.controlId,label:n.data.label})}),Kn.setState({entries:t,nextLabelIndex:t.length})},hC=(e,t)=>{const n=[];return t.forEach(r=>{r.type==="recordCallStart"&&r.data.controlId&&(n.push(r.data.controlId),Kn.getState().removeEntry(r.data.controlId))}),n.length?e.reduce((r,o)=>o.type==="recordCallStop"&&n.includes(o.data.controlId)?[...r,{...o,data:{...o.data,controlId:"",missingRequiredParams:!0}}]:r,[]):[]},Fy={recordCallStart:e=>{const t=Kn.getState().getGeneratedLabel();return Kn.getState().upsertEntry({controlId:e.data.controlId,label:t}),{...e,data:{...e.data,label:t}}}},gC=e=>oy[e]!==void 0,mC=e=>typeof e=="object"&&e!==null&&Object.keys(e).length>0,vC=e=>Fy[e.type]!==void 0,Vy=(e,t={})=>{const{deletable:n=!0,position:r={x:300,y:250},selected:o=!0}=t,i=()=>({id:Re(),type:e,position:r,deletable:n,data:{missingRequiredParams:!1},selected:o}),s=(l,u)=>({...l,data:{...l.data,...u,missingRequiredParams:!0}});let a=i();if(gC(e)){const l=oy[e]();mC(l)&&(a=s(a,l))}return vC(a)&&(a=Fy[a.type](a)),a},al={apiVersion:void 0,builderVersion:Jv,cfbAppVersion:Zv,relayMLVersion:void 0},yC=e=>{const t={...al,...e};al.apiVersion=t.apiVersion,al.builderVersion=t.builderVersion,al.relayMLVersion=t.relayMLVersion},bd=()=>({apiVersion:void 0,builderVersion:Jv,cfbAppVersion:Zv,relayMLVersion:void 0}),By=1e3,$y=Ze(),EC=e=>(t,n,r)=>{let o,i;const s=async()=>{const{httpService:a,nodes:l,edges:u,documentVersion:c}=n(),{builderVersion:d}=bd();t({dataHandlingStatus:"saving",saveFlowStatus:"saving"}),clearTimeout(i);try{if(!a)throw new Error("Missing httpService");const h={documentVersion:(await a.putFlow({documentVersion:c,builderVersion:d,nodes:l,edges:u})).document_version},m=n().dataHandlingStatus;switch(m){case"saving":t({...h,dataHandlingStatus:"queueing",saveFlowStatus:"saved"});break;case"holding":t({...h,saveFlowStatus:"awaiting-save"}),$y.debug("Setting up a new save for held changes"),i=setTimeout(()=>{s()},By);break;default:$y.debug("Invalid dataHandlingStatus",m)}}catch(f){console.error("Put Flow",f),f instanceof Error&&f.message.includes(eT)?t({dataHandlingStatus:"holding",flowInteractive:!1,httpError:"document-sync",saveFlowStatus:"error"}):t({dataHandlingStatus:"queueing",saveFlowStatus:"error"})}};return r.setState=(a,l,...u)=>{const{dataHandlingStatus:c,initializing:d}=n(),f=typeof a=="function"?a(n()):a;!d&&(f.nodes||f.edges)?c==="queueing"?(f.saveFlowStatus="awaiting-save",t(f,l,...u),clearTimeout(o),o=setTimeout(()=>{s()},By)):(f.dataHandlingStatus="holding",t(f,l,...u)):"initializing"in f&&f.initializing!==d?(f.dataHandlingStatus="queueing",f.saveFlowStatus="saved",t(f,l,...u)):t(f,l,...u)},e(r.setState,n,r)},SC={variables:new Map,keyToIdMap:new Map},Er=Ii((e,t)=>({...SC,_dedupeKey(n,r){const o=Array.from(r.values()).find(i=>i.key===n);o&&r.delete(o.id)},isKeyDuplicate(n,r){const o=t().keyToIdMap.get(n);return o?o!==r:!1},removeVariable(n){e(r=>{const o=new Map(r.variables),i=new Map(r.keyToIdMap),s=o.get(n);return s&&(o.delete(n),i.delete(s.key)),{keyToIdMap:i,variables:o}})},setVariables:n=>{e(()=>{const r=new Map,o=new Map;return n.forEach(i=>{const s=o.get(i.key);s&&r.delete(s),r.set(i.id,i),o.set(i.key,i.id)}),{keyToIdMap:o,variables:r}})},upsertVariable:n=>{e(r=>{const o=new Map(r.variables),i=new Map(r.keyToIdMap),s=o.get(n.id),a=i.get(n.key);return a&&o.delete(a),s&&i.delete(s.key),o.set(n.id,n),i.set(n.key,n.id),{keyToIdMap:i,variables:o}})}})),_C=e=>{const t=[];e.forEach(n=>{n.type==="set"&&n.data.variables&&t.push(...n.data.variables)}),Er.getState().setVariables(t)},wC=e=>{if(e!=null&&e.length){const{removeVariable:t}=Er.getState();e.forEach(n=>{n.type==="set"&&n.data.variables&&n.data.variables.forEach(o=>t(o.id))})}},Se=Ze(),RC=Vy("handleCall",{position:{x:300,y:100},deletable:!1}),Zi={backButtonHref:void 0,colorMode:"light",dataHandlingStatus:"queueing",deployFlowURL:"",documentVersion:0,edges:[],flowId:"",flowInteractive:!0,flowTitle:"",getFlowURL:"",httpError:void 0,httpService:void 0,initializing:!0,isDraggingNode:!1,isEdgeConnecting:!1,isEdgeUpdateSuccessful:!1,nodes:[],reactFlowInstance:void 0,rootAppHeight:void 0,rootAppWidth:void 0,rootElementId:"",saveFlowStatus:"initial",selectedNode:void 0,updateFlowURL:"",updatingSourceHandleId:void 0},NC=(e,t)=>({...Zi,reset:()=>{Se.debug("Reset!"),e({nodes:[...Zi.nodes],edges:[...Zi.edges]})},deployFlow:async()=>{try{Se.info("Deploying...");const{httpService:n,documentVersion:r}=t();if(!n)throw new Error("Missing httpService");const o=await n.deployFlow({documentVersion:r});Se.info("Deploy response",o)}catch(n){throw Se.info("Deploy error",n),n}},exportStoreData:()=>{const{nodes:n,edges:r}=t();oT(n,r)},addNode:({nodeType:n,x:r=150,y:o=150})=>{Se.debug("Add Node",n);const{nodes:i,reactFlowInstance:s,flowInteractive:a}=t();if(!a){Se.debug("Flow is not interactive, not adding node");return}if(!s)throw new Error("ReactFlowInstance not found");const l=Vy(n,{position:s.project({x:r,y:o})}),u=i.map(c=>({...c,selected:!1}));u.push(l),e({nodes:u,selectedNode:l})},getNodeEdges:n=>t().edges.filter(r=>r.source===n),getTargetEdges:n=>t().edges.filter(r=>r.target===n),partialUpdateNodeData:(n,r)=>{var s;if(Se.debug("partialUpdateNodeData",n,r),!t().flowInteractive){Se.debug("Flow is not interactive, not updating node data");return}const o=[],i=t().nodes.map(a=>{if(a.id===n){if("options"in r&&"options"in a.data){const l=a.data.options.map(c=>c.id),u=r.options.map(c=>c.id);o.push(...l.filter(c=>!u.includes(c)))}return{...a,data:{...a.data,...r}}}return a});if(o.length){const a=t().edges.filter(l=>l.sourceHandle&&o.includes(l.sourceHandle));Se.debug("Remove orphaned edges",{sourceHandleDeleted:o,edgesToDelete:a}),(s=t().reactFlowInstance)==null||s.deleteElements({edges:a})}e({nodes:i})},removeNode:n=>{Se.debug("removeNode",n);const r=t().reactFlowInstance;r&&r.deleteElements({nodes:[{id:n}]})},removeEdge:n=>{Se.debug("removeEdge",n);const r=t().reactFlowInstance;r&&r.deleteElements({edges:[{id:n}]})},onInit:async n=>{const{getFlowURL:r,updateFlowURL:o,deployFlowURL:i}=t();Se.log("onInit",{getFlowURL:r,updateFlowURL:o});try{const s=tw({getFlowURL:r,deployFlowURL:i,updateFlowURL:o,headers:rT()}),a=bd(),{id:l,title:u,document_version:c,flow_data:d}=await s.getFlow();let f=d;f||(f={apiVersion:a.apiVersion,builderVersion:a.builderVersion,relayMLVersion:a.relayMLVersion,edges:Zi.edges,nodes:Zi.nodes.concat([RC])}),e({httpService:s,reactFlowInstance:n,flowId:l,flowTitle:u,documentVersion:c,nodes:f.nodes.map(aT),edges:f.edges.map(sT)}),yC({apiVersion:f.apiVersion,builderVersion:f.builderVersion,relayMLVersion:f.relayMLVersion}),_C(f.nodes),pC(f.nodes)}catch(s){Se.error("Could not load flow. URL:",r);let a="unknown";s instanceof Error&&s.message.includes(tT)&&(a="not-found"),e({httpError:a})}},onNodeDragStart:()=>{e({isDraggingNode:!0})},onNodeDragStop:()=>{e({isDraggingNode:!1})},onNodesChange:n=>{e({nodes:Fv(n,t().nodes)})},onNodesDelete:n=>{Se.debug("onNodesDelete"),wC(n),hC(t().nodes,n).forEach(o=>{ee.getState().partialUpdateNodeData(o.id,o.data)})},onEdgesChange:n=>{e({edges:ax(n,t().edges)})},onEdgesDelete:n=>{Se.debug("onEdgesDelete [noop]",n)},onConnect:n=>{Se.debug("onConnect"),e({edges:Zm(n,t().edges)})},onConnectStart:()=>{Se.debug("onConnectStart"),e({isEdgeConnecting:!0})},onConnectEnd:()=>{Se.debug("onConnectEnd"),e({isEdgeConnecting:!1})},onEdgeUpdateStart:(n,r)=>{Se.debug("onEdgeUpdateStart"),e({isEdgeUpdateSuccessful:!1,updatingSourceHandleId:r.sourceHandle??void 0})},onEdgeUpdate:(n,r)=>{Se.debug("onEdgeUpdate"),e({edges:EO(n,r,t().edges),isEdgeUpdateSuccessful:!0})},onEdgeUpdateEnd:(n,r)=>{var o;Se.debug("onEdgeUpdateEnd"),t().isEdgeUpdateSuccessful?e({isEdgeUpdateSuccessful:!0}):(o=t().reactFlowInstance)==null||o.deleteElements({edges:[{id:r.id}]}),e({updatingSourceHandleId:void 0})},onSelectionChange:({nodes:n})=>{e({selectedNode:n.find(r=>r.selected)})},setColorMode:n=>{e({colorMode:n})}}),ee=Ii()(EC(NC));window.__useRFStore=ee;const OC={"not-found":{title:"Call Flow not found",message:"Please ensure that the Call Flow exists and the URL is correct.",status:"404"},unknown:{title:"Unknown error",message:"An unknown error occurred. Please try again or go back.",status:""}},xC=({errorType:e})=>{const t=ee(i=>i.backButtonHref),{title:n,message:r,status:o}=OC[e];return E("section",{className:"flex min-h-full w-full items-center justify-center bg-background px-6",children:k("div",{className:"text-center",children:[o&&E("p",{className:"text-2xl font-semibold text-foreground/50",children:o}),E("h1",{className:"mt-4 text-3xl font-bold tracking-tight text-foreground",children:n}),E("p",{className:"mt-6 leading-7 text-foreground",children:r}),t&&E("div",{className:"mt-8 flex items-center justify-center gap-x-6",children:E("a",{href:t,className:"rounded-md bg-foreground px-3.5 py-2.5 text-sm font-semibold text-background shadow-sm transition-colors hover:bg-foreground/80 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-foreground",children:b(x.GO_BACK)})})]})})},Dk="";function TC({fromNode:e,fromPosition:t,fromX:n,fromY:r,toX:o,toY:i}){if(!e)return null;const[s]=ji({borderRadius:20,sourceX:n,sourceY:r,sourcePosition:t,targetPosition:Y.Top,targetX:o,targetY:i});return k("g",{children:[E("path",{fill:"none",stroke:"#222",strokeWidth:1.5,className:"animated",d:s}),E("circle",{cx:o,cy:i,fill:"#fff",r:3,stroke:"#222",strokeWidth:1.5})]})}const Ji=40;function CC(e,t,n,r=0,o=!1){const{width:i,height:s,position:a}=n,l=i??0,u=s??0,c=l/2,d=u/2;if(o)return{tx:a.x,ty:a.y+d};const f=a.x+c,h=a.y+d,m=e,v=t,y=(m-f)/l-(v-h)/u,p=(m-f)/u+(v-h)/u,g=1/(Math.abs(y)+Math.abs(p)),S=g*y,_=g*p,w=c*(S+_)+f;return{tx:Math.min(Math.max(w,a.x+r),a.x+l-r),ty:a.y}}const IC=({isCircular:e,sourceX:t,labelX:n,sourceY:r,labelY:o})=>e?{x:t-Ji*1.5,y:r}:{x:n-Ji/2,y:o-Ji/2};function bC(e){const{id:t,source:n,target:r,sourcePosition:o,sourceX:i,sourceY:s}=e,a=ee(p=>p.removeEdge),l=le(N.useCallback(p=>p.nodeInternals.get(n),[n])),u=le(N.useCallback(p=>p.nodeInternals.get(r),[r]));if(!l||!u)return null;const c=n===r,{tx:d,ty:f}=CC(i,s,u,20,c),[h,m,v]=ji({borderRadius:20,sourceX:i,sourceY:s,sourcePosition:o,targetPosition:c?Y.Left:Y.Top,targetX:d,targetY:f}),y=(p,g)=>{p.stopPropagation(),a(g)};return k("g",{className:"group",children:[E(So,{path:h,...e}),E("foreignObject",{width:Ji,height:Ji,className:"hidden group-hover:block",requiredExtensions:"http://www.w3.org/1999/xhtml",...IC({isCircular:c,sourceX:i,labelX:m,sourceY:s,labelY:v}),children:E("div",{className:"h-10 w-10",children:k("button",{className:"flex h-10 w-10 cursor-pointer items-center justify-center rounded-full border border-foreground/10 bg-backgroundAlt",onClick:p=>y(p,t),children:[E(Fe,{tag:"trash-can",className:"text-negative"}),E("span",{className:"sr-only",children:b(x.REMOVE_EDGE)})]})})})]})}var AC={prefix:"fas",iconName:"trash-can",icon:[448,512,[61460,"trash-alt"],"f2ed","M135.2 17.7C140.6 6.8 151.7 0 163.8 0H284.2c12.1 0 23.2 6.8 28.6 17.7L320 32h96c17.7 0 32 14.3 32 32s-14.3 32-32 32H32C14.3 96 0 81.7 0 64S14.3 32 32 32h96l7.2-14.3zM32 128H416V448c0 35.3-28.7 64-64 64H96c-35.3 0-64-28.7-64-64V128zm96 64c-8.8 0-16 7.2-16 16V432c0 8.8 7.2 16 16 16s16-7.2 16-16V208c0-8.8-7.2-16-16-16zm96 0c-8.8 0-16 7.2-16 16V432c0 8.8 7.2 16 16 16s16-7.2 16-16V208c0-8.8-7.2-16-16-16zm96 0c-8.8 0-16 7.2-16 16V432c0 8.8 7.2 16 16 16s16-7.2 16-16V208c0-8.8-7.2-16-16-16z"]},LC={prefix:"fas",iconName:"circle-exclamation",icon:[512,512,["exclamation-circle"],"f06a","M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm0-384c13.3 0 24 10.7 24 24V264c0 13.3-10.7 24-24 24s-24-10.7-24-24V152c0-13.3 10.7-24 24-24zM224 352a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z"]},DC={prefix:"fas",iconName:"arrow-left",icon:[448,512,[8592],"f060","M9.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L109.2 288 416 288c17.7 0 32-14.3 32-32s-14.3-32-32-32l-306.7 0L214.6 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-160 160z"]},kC={prefix:"fas",iconName:"circle-info",icon:[512,512,["info-circle"],"f05a","M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM216 336h24V272H216c-13.3 0-24-10.7-24-24s10.7-24 24-24h48c13.3 0 24 10.7 24 24v88h8c13.3 0 24 10.7 24 24s-10.7 24-24 24H216c-13.3 0-24-10.7-24-24s10.7-24 24-24zm40-208a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]},PC={prefix:"fas",iconName:"xmark",icon:[320,512,[128473,10005,10006,10060,215,"close","multiply","remove","times"],"f00d","M310.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L160 210.7 54.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L114.7 256 9.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L160 301.3 265.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L205.3 256 310.6 150.6z"]},MC={prefix:"fas",iconName:"up-from-bracket",icon:[448,512,[],"e590","M73.9 134.1L196.7 11.3C203.9 4.1 213.8 0 224 0s20.1 4.1 27.3 11.3L374.1 134.1c6.4 6.4 9.9 15 9.9 24c0 18.7-15.2 33.9-33.9 33.9H288V320c0 17.7-14.3 32-32 32H192c-17.7 0-32-14.3-32-32V192H97.9C79.2 192 64 176.8 64 158.1c0-9 3.6-17.6 9.9-24zM64 352v64c0 17.7 14.3 32 32 32H352c17.7 0 32-14.3 32-32V352c0-17.7 14.3-32 32-32s32 14.3 32 32v64c0 53-43 96-96 96H96c-53 0-96-43-96-96V352c0-17.7 14.3-32 32-32s32 14.3 32 32z"]};const UC={"arrow-left":DC,"circle-exclamation":LC,"circle-info":kC,"up-from-bracket":MC,"trash-can":AC,xmark:PC},Fe=N.forwardRef(function({className:t="",size:n="",tag:r},o){const i=UC[r];return i?E("svg",{"aria-hidden":"true","data-prefix":i.prefix,"data-icon":r,className:`svg-inline--fa fa-${r} ${n?`fa-${n}`:""} ${t}`,focusable:"false",ref:o,role:"img",viewBox:`0 0 ${i.icon[0]} ${i.icon[1]}`,xmlns:"http://www.w3.org/2000/svg",children:E("path",{d:i.icon[4],fill:"currentColor"})}):(Ze().debug(`Unknown icon: ${r}`),null)}),FC=({isSelected:e,nodeId:t,nodeTitle:n,showDelete:r})=>{const o=ee(l=>l.removeNode),i=ee(l=>l.isEdgeConnecting);return k("div",{className:"flex w-full items-center justify-between p-4",children:[E("h2",{className:`text-lg font-semibold leading-6 ${e?"text-primary":""}`,children:n}),r&&!i&&k("button",{className:"opacity-0 transition-opacity group-hover/node-wrapper:opacity-100",onClick:()=>{o(t)},children:[E(Fe,{tag:"trash-can",className:"text-negative"}),E("span",{className:"sr-only",children:b(x.REMOVE_NODE,{title:n})})]})]})},VC=({id:e,missingRequiredEntry:t})=>{const n=ee(i=>i.getTargetEdges),[r,o]=N.useState(!1);return N.useEffect(()=>{const i=()=>n(e).length===0;o(i());const s=ee.subscribe((a,l)=>{a.edges.length!==l.edges.length&&o(i()),a.nodes.length!==l.nodes.length&&o(i()),a.isEdgeUpdateSuccessful!==l.isEdgeUpdateSuccessful&&o(i())});return()=>s()},[e,n]),r||t?k("div",{className:"flex flex-col gap-y-6 px-4 pb-4 text-sm italic leading-4",children:[r&&E("p",{children:"Not Connected to Flow"}),t&&E("p",{children:"Missing Required Entry"})]}):null},BC=({id:e,isConnectable:t})=>{if(!e)throw new Error("TargetHandle: id is required");return E(Ro,{type:"target",id:`target-${e}`,position:Y.Top,isConnectable:t,className:"mt-1 h-4 w-full rounded-none rounded-t-md border-none bg-primary opacity-0 transition-opacity hover:opacity-100"})},Ge=({children:e,id:t,isConnectable:n=!0,missingRequiredEntry:r,nodeTitle:o,selected:i,showDelete:s,showValidation:a=!0,target:l=!0})=>k("section",{className:`${i?"shadow-xl":""} group/node-wrapper min-w-[300px] rounded-lg border border-foreground/10 bg-background transition-[visibility]`,children:[l&&t&&E(BC,{id:t,isConnectable:n}),E(FC,{nodeId:t,isSelected:i,nodeTitle:o,showDelete:s}),a&&E(VC,{id:t,missingRequiredEntry:r??!1}),e]}),$C=({children:e,handleClick:t,...n})=>E("li",{role:"presentation",children:k("div",{className:"flex items-center gap-2 rounded-lg bg-secondary p-2 pr-1",role:"option","aria-selected":"true",tabIndex:0,children:[E("span",{className:"text-sm text-foreground",children:e}),k("button",{className:" px-1",onClick:t,onKeyDown:o=>{(o.key==="Backspace"||o.key==="Delete")&&(o.stopPropagation(),t==null||t())},type:"button",...n,children:[E("span",{className:"sr-only",children:"Remove"}),E(Fe,{tag:"xmark",size:"xs"})]})]})}),Mt=e=>E("div",{className:"relative after:absolute after:right-3 after:top-3 after:h-[7px] after:w-[7px] after:rotate-45 after:border-r after:border-b after:border-foreground after:content-['']",children:E("select",{className:"pr-8",...e,children:e.children})}),HC={disabled:"border-disabled cursor-not-allowed",negative:"border-negative hover:bg-negative",positive:"border-positive hover:bg-positive"},Xt=({color:e="positive",enabled:t=!0,id:n,isConnectable:r,position:o=Y.Bottom,positionClasses:i="-bottom-2.5"})=>{if(!n)throw new Error("SourceHandle: id is required");const s=t?e:"disabled",a=ee(f=>f.updatingSourceHandleId),c=!ee(f=>f.edges.some(h=>h.sourceHandle===n))||a===n;return E("div",{className:`absolute top-auto left-1/2 h-5 w-5 -translate-x-1/2 rounded-full ${i} ${c&&r&&t?"":"nodrag cursor-not-allowed"}`,children:E(Ro,{className:`bottom-0 h-full w-full border-[3px] bg-background transition-colors ${HC[s]??""}`,id:n,isConnectable:c&&r&&t,position:o,type:"source"})})},es=({children:e})=>E("div",{className:"divide-foreground/10 flex w-full items-center divide-x",children:e}),mn=({color:e="positive",enabled:t=!0,id:n,isConnectable:r,optionText:o,position:i=Y.Bottom,positionClasses:s="-bottom-2.5"})=>k("div",{className:"relative w-full min-w-[104px] whitespace-nowrap border-t border-foreground/10 py-4",children:[E("div",{className:"flex flex-col items-center justify-center",children:E("p",{className:`${t?"":"text-disabled"} min-h-[1rem] text-sm leading-4`,children:o})}),E(Xt,{color:e,enabled:t,id:n,isConnectable:r,position:i,positionClasses:s})]}),zC=({checked:e=!1,name:t,onClick:n})=>k("button",{name:t,onClick:n,type:"button",className:`${e?"bg-primary":"bg-secondary"} relative inline-flex h-6 w-11 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out`,role:"switch","aria-checked":e?"true":"false",children:[E("span",{className:"sr-only",children:b(e?x.ON:x.OFF)}),E("span",{className:`pointer-events-none inline-block h-5 w-5 ${e?"translate-x-5":"translate-x-0"} transform rounded-full bg-white shadow transition duration-200 ease-in-out`})]}),Ad=({checked:e,clickHandler:t,name:n,subtitle:r,title:o})=>k("div",{className:"mb-2 flex items-center justify-between",children:[k("div",{className:"flex flex-grow flex-col",children:[E("span",{className:"text-base font-medium leading-6 text-foreground",children:o}),r&&E("span",{className:"text-xs text-foreground/50",children:r})]}),E(zC,{checked:e,name:n,onClick:t})]}),Sr=({errorText:e,label:t,name:n,onChange:r,required:o,valid:i,value:s,...a})=>k("label",{children:[E("span",{className:"sr-only",children:t}),E("textarea",{"aria-invalid":i?void 0:"true",className:`peer min-h-[77px] w-full resize-none ${i?"":"invalid"}`,inputMode:"text",minLength:1,name:n,onChange:r,required:o,value:s,...a}),E("p",{className:"requirements",role:"alert",children:e})]});/*!
62
62
  * tabbable 6.1.1
63
63
  * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
64
- */var jC=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],Dd=jC.join(","),Hy=typeof Element>"u",ts=Hy?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,ll=!Hy&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e==null?void 0:e.ownerDocument},ul=function e(t,n){var r;n===void 0&&(n=!0);var o=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"inert"),i=o===""||o==="true",s=i||n&&t&&e(t.parentNode);return s},GC=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},YC=function(t,n,r){if(ul(t))return[];var o=Array.prototype.slice.apply(t.querySelectorAll(Dd));return n&&ts.call(t,Dd)&&o.unshift(t),o=o.filter(r),o},WC=function e(t,n,r){for(var o=[],i=Array.from(t);i.length;){var s=i.shift();if(!ul(s,!1))if(s.tagName==="SLOT"){var a=s.assignedElements(),l=a.length?a:s.children,u=e(l,!0,r);r.flatten?o.push.apply(o,u):o.push({scopeParent:s,candidates:u})}else{var c=ts.call(s,Dd);c&&r.filter(s)&&(n||!t.includes(s))&&o.push(s);var d=s.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(s),f=!ul(d,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(s));if(d&&f){var h=e(d===!0?s.children:d.children,!0,r);r.flatten?o.push.apply(o,h):o.push({scopeParent:s,candidates:h})}else i.unshift.apply(i,s.children)}}return o},zy=function(t,n){return t.tabIndex<0&&(n||/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||GC(t))&&isNaN(parseInt(t.getAttribute("tabindex"),10))?0:t.tabIndex},KC=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},jy=function(t){return t.tagName==="INPUT"},QC=function(t){return jy(t)&&t.type==="hidden"},XC=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},qC=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},ZC=function(t){if(!t.name)return!0;var n=t.form||ll(t),r=function(a){return n.querySelectorAll('input[type="radio"][name="'+a+'"]')},o;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")o=r(window.CSS.escape(t.name));else try{o=r(t.name)}catch(s){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",s.message),!1}var i=qC(o,t.form);return!i||i===t},JC=function(t){return jy(t)&&t.type==="radio"},eI=function(t){return JC(t)&&!ZC(t)},tI=function(t){var n,r=t&&ll(t),o=(n=r)===null||n===void 0?void 0:n.host,i=!1;if(r&&r!==t){var s,a,l;for(i=!!((s=o)!==null&&s!==void 0&&(a=s.ownerDocument)!==null&&a!==void 0&&a.contains(o)||t!=null&&(l=t.ownerDocument)!==null&&l!==void 0&&l.contains(t));!i&&o;){var u,c,d;r=ll(o),o=(u=r)===null||u===void 0?void 0:u.host,i=!!((c=o)!==null&&c!==void 0&&(d=c.ownerDocument)!==null&&d!==void 0&&d.contains(o))}}return i},Gy=function(t){var n=t.getBoundingClientRect(),r=n.width,o=n.height;return r===0&&o===0},nI=function(t,n){var r=n.displayCheck,o=n.getShadowRoot;if(getComputedStyle(t).visibility==="hidden")return!0;var i=ts.call(t,"details>summary:first-of-type"),s=i?t.parentElement:t;if(ts.call(s,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="legacy-full"){if(typeof o=="function"){for(var a=t;t;){var l=t.parentElement,u=ll(t);if(l&&!l.shadowRoot&&o(l)===!0)return Gy(t);t.assignedSlot?t=t.assignedSlot:!l&&u!==t.ownerDocument?t=u.host:t=l}t=a}if(tI(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return Gy(t);return!1},rI=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r<n.children.length;r++){var o=n.children.item(r);if(o.tagName==="LEGEND")return ts.call(n,"fieldset[disabled] *")?!0:!o.contains(t)}return!0}n=n.parentElement}return!1},oI=function(t,n){return!(n.disabled||ul(n)||QC(n)||nI(n,t)||XC(n)||rI(n))},Yy=function(t,n){return!(eI(n)||zy(n)<0||!oI(t,n))},iI=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},sI=function e(t){var n=[],r=[];return t.forEach(function(o,i){var s=!!o.scopeParent,a=s?o.scopeParent:o,l=zy(a,s),u=s?e(o.candidates):a;l===0?s?n.push.apply(n,u):n.push(a):r.push({documentOrder:i,tabIndex:l,item:o,isScope:s,content:u})}),r.sort(KC).reduce(function(o,i){return i.isScope?o.push.apply(o,i.content):o.push(i.content),o},[]).concat(n)},Wy=function(t,n){n=n||{};var r;return n.getShadowRoot?r=WC([t],n.includeContainer,{filter:Yy.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:iI}):r=YC(t,n.includeContainer,Yy.bind(null,n)),sI(r)};function ns(e){return e.split("-")[1]}function kd(e){return e==="y"?"height":"width"}function _r(e){return e.split("-")[0]}function rs(e){return["top","bottom"].includes(_r(e))?"x":"y"}function Ky(e,t,n){let{reference:r,floating:o}=e;const i=r.x+r.width/2-o.width/2,s=r.y+r.height/2-o.height/2,a=rs(t),l=kd(a),u=r[l]/2-o[l]/2,c=a==="x";let d;switch(_r(t)){case"top":d={x:i,y:r.y-o.height};break;case"bottom":d={x:i,y:r.y+r.height};break;case"right":d={x:r.x+r.width,y:s};break;case"left":d={x:r.x-o.width,y:s};break;default:d={x:r.x,y:r.y}}switch(ns(t)){case"start":d[a]-=u*(n&&c?-1:1);break;case"end":d[a]+=u*(n&&c?-1:1)}return d}const aI=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=i.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(t));let u=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:c,y:d}=Ky(u,r,l),f=r,h={},m=0;for(let v=0;v<a.length;v++){const{name:y,fn:p}=a[v],{x:g,y:S,data:_,reset:w}=await p({x:c,y:d,initialPlacement:r,placement:f,strategy:o,middlewareData:h,rects:u,platform:s,elements:{reference:e,floating:t}});c=g??c,d=S??d,h={...h,[y]:{...h[y],..._}},w&&m<=50&&(m++,typeof w=="object"&&(w.placement&&(f=w.placement),w.rects&&(u=w.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):w.rects),{x:c,y:d}=Ky(u,f,l)),v=-1)}return{x:c,y:d,placement:f,strategy:o,middlewareData:h}};function Qy(e){return typeof e!="number"?function(t){return{top:0,right:0,bottom:0,left:0,...t}}(e):{top:e,right:e,bottom:e,left:e}}function Pd(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}async function Xy(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:s,elements:a,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:d="floating",altBoundary:f=!1,padding:h=0}=t,m=Qy(h),v=a[f?d==="floating"?"reference":"floating":d],y=Pd(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(v)))==null||n?v:v.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:u,rootBoundary:c,strategy:l})),p=d==="floating"?{...s.floating,x:r,y:o}:s.reference,g=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),S=await(i.isElement==null?void 0:i.isElement(g))&&await(i.getScale==null?void 0:i.getScale(g))||{x:1,y:1},_=Pd(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({rect:p,offsetParent:g,strategy:l}):p);return{top:(y.top-_.top+m.top)/S.y,bottom:(_.bottom-y.bottom+m.bottom)/S.y,left:(y.left-_.left+m.left)/S.x,right:(_.right-y.right+m.right)/S.x}}const lI=Math.min,uI=Math.max;function Md(e,t,n){return uI(e,lI(t,n))}const qy=e=>({name:"arrow",options:e,async fn(t){const{element:n,padding:r=0}=e||{},{x:o,y:i,placement:s,rects:a,platform:l}=t;if(n==null)return{};const u=Qy(r),c={x:o,y:i},d=rs(s),f=kd(d),h=await l.getDimensions(n),m=d==="y"?"top":"left",v=d==="y"?"bottom":"right",y=a.reference[f]+a.reference[d]-c[d]-a.floating[f],p=c[d]-a.reference[d],g=await(l.getOffsetParent==null?void 0:l.getOffsetParent(n));let S=g?d==="y"?g.clientHeight||0:g.clientWidth||0:0;S===0&&(S=a.floating[f]);const _=y/2-p/2,w=u[m],R=S-h[f]-u[v],C=S/2-h[f]/2+_,L=Md(w,C,R),B=ns(s)!=null&&C!=L&&a.reference[f]/2-(C<w?u[m]:u[v])-h[f]/2<0;return{[d]:c[d]-(B?C<w?w-C:R-C:0),data:{[d]:L,centerOffset:C-L}}}});["top","right","bottom","left"].reduce((e,t)=>e.concat(t,t+"-start",t+"-end"),[]);const cI={left:"right",right:"left",bottom:"top",top:"bottom"};function cl(e){return e.replace(/left|right|bottom|top/g,t=>cI[t])}function dI(e,t,n){n===void 0&&(n=!1);const r=ns(e),o=rs(e),i=kd(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=cl(s)),{main:s,cross:cl(s)}}const fI={start:"end",end:"start"};function Ud(e){return e.replace(/start|end/g,t=>fI[t])}const pI=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n;const{placement:r,middlewareData:o,rects:i,initialPlacement:s,platform:a,elements:l}=t,{mainAxis:u=!0,crossAxis:c=!0,fallbackPlacements:d,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:m=!0,...v}=e,y=_r(r),p=_r(s)===s,g=await(a.isRTL==null?void 0:a.isRTL(l.floating)),S=d||(p||!m?[cl(s)]:function(V){const $=cl(V);return[Ud(V),$,Ud($)]}(s));d||h==="none"||S.push(...function(V,$,F,O){const M=ns(V);let D=function(A,T,P){const U=["left","right"],H=["right","left"],j=["top","bottom"],K=["bottom","top"];switch(A){case"top":case"bottom":return P?T?H:U:T?U:H;case"left":case"right":return T?j:K;default:return[]}}(_r(V),F==="start",O);return M&&(D=D.map(A=>A+"-"+M),$&&(D=D.concat(D.map(Ud)))),D}(s,m,h,g));const _=[s,...S],w=await Xy(t,v),R=[];let C=((n=o.flip)==null?void 0:n.overflows)||[];if(u&&R.push(w[y]),c){const{main:V,cross:$}=dI(r,i,g);R.push(w[V],w[$])}if(C=[...C,{placement:r,overflows:R}],!R.every(V=>V<=0)){var L,B;const V=(((L=o.flip)==null?void 0:L.index)||0)+1,$=_[V];if($)return{data:{index:V,overflows:C},reset:{placement:$}};let F=(B=C.filter(O=>O.overflows[0]<=0).sort((O,M)=>O.overflows[1]-M.overflows[1])[0])==null?void 0:B.placement;if(!F)switch(f){case"bestFit":{var I;const O=(I=C.map(M=>[M.placement,M.overflows.filter(D=>D>0).reduce((D,A)=>D+A,0)]).sort((M,D)=>M[1]-D[1])[0])==null?void 0:I[0];O&&(F=O);break}case"initialPlacement":F=s}if(r!==F)return{reset:{placement:F}}}return{}}}},hI=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){const{x:n,y:r}=t,o=await async function(i,s){const{placement:a,platform:l,elements:u}=i,c=await(l.isRTL==null?void 0:l.isRTL(u.floating)),d=_r(a),f=ns(a),h=rs(a)==="x",m=["left","top"].includes(d)?-1:1,v=c&&h?-1:1,y=typeof s=="function"?s(i):s;let{mainAxis:p,crossAxis:g,alignmentAxis:S}=typeof y=="number"?{mainAxis:y,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...y};return f&&typeof S=="number"&&(g=f==="end"?-1*S:S),h?{x:g*v,y:p*m}:{x:p*m,y:g*v}}(t,e);return{x:n+o.x,y:r+o.y,data:o}}}};function gI(e){return e==="x"?"y":"x"}const mI=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:a={fn:y=>{let{x:p,y:g}=y;return{x:p,y:g}}},...l}=e,u={x:n,y:r},c=await Xy(t,l),d=rs(_r(o)),f=gI(d);let h=u[d],m=u[f];if(i){const y=d==="y"?"bottom":"right";h=Md(h+c[d==="y"?"top":"left"],h,h-c[y])}if(s){const y=f==="y"?"bottom":"right";m=Md(m+c[f==="y"?"top":"left"],m,m-c[y])}const v=a.fn({...t,[d]:h,[f]:m});return{...v,data:{x:v.x-n,y:v.y-r}}}}};function ct(e){var t;return((t=e.ownerDocument)==null?void 0:t.defaultView)||window}function qt(e){return ct(e).getComputedStyle(e)}const Zy=Math.min,os=Math.max,dl=Math.round;function Jy(e){const t=qt(e);let n=parseFloat(t.width),r=parseFloat(t.height);const o=e.offsetWidth,i=e.offsetHeight,s=dl(n)!==o||dl(r)!==i;return s&&(n=o,r=i),{width:n,height:r,fallback:s}}function Qn(e){return t0(e)?(e.nodeName||"").toLowerCase():""}let fl;function e0(){if(fl)return fl;const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?(fl=e.brands.map(t=>t.brand+"/"+t.version).join(" "),fl):navigator.userAgent}function Zt(e){return e instanceof ct(e).HTMLElement}function Ut(e){return e instanceof ct(e).Element}function t0(e){return e instanceof ct(e).Node}function n0(e){return typeof ShadowRoot>"u"?!1:e instanceof ct(e).ShadowRoot||e instanceof ShadowRoot}function pl(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=qt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function vI(e){return["table","td","th"].includes(Qn(e))}function Fd(e){const t=/firefox/i.test(e0()),n=qt(e),r=n.backdropFilter||n.WebkitBackdropFilter;return n.transform!=="none"||n.perspective!=="none"||!!r&&r!=="none"||t&&n.willChange==="filter"||t&&!!n.filter&&n.filter!=="none"||["transform","perspective"].some(o=>n.willChange.includes(o))||["paint","layout","strict","content"].some(o=>{const i=n.contain;return i!=null&&i.includes(o)})}function Vd(){return/^((?!chrome|android).)*safari/i.test(e0())}function Bd(e){return["html","body","#document"].includes(Qn(e))}function r0(e){return Ut(e)?e:e.contextElement}const o0={x:1,y:1};function Do(e){const t=r0(e);if(!Zt(t))return o0;const n=t.getBoundingClientRect(),{width:r,height:o,fallback:i}=Jy(t);let s=(i?dl(n.width):n.width)/r,a=(i?dl(n.height):n.height)/o;return s&&Number.isFinite(s)||(s=1),a&&Number.isFinite(a)||(a=1),{x:s,y:a}}function wr(e,t,n,r){var o,i;t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),a=r0(e);let l=o0;t&&(r?Ut(r)&&(l=Do(r)):l=Do(e));const u=a?ct(a):window,c=Vd()&&n;let d=(s.left+(c&&((o=u.visualViewport)==null?void 0:o.offsetLeft)||0))/l.x,f=(s.top+(c&&((i=u.visualViewport)==null?void 0:i.offsetTop)||0))/l.y,h=s.width/l.x,m=s.height/l.y;if(a){const v=ct(a),y=r&&Ut(r)?ct(r):r;let p=v.frameElement;for(;p&&r&&y!==v;){const g=Do(p),S=p.getBoundingClientRect(),_=getComputedStyle(p);S.x+=(p.clientLeft+parseFloat(_.paddingLeft))*g.x,S.y+=(p.clientTop+parseFloat(_.paddingTop))*g.y,d*=g.x,f*=g.y,h*=g.x,m*=g.y,d+=S.x,f+=S.y,p=ct(p).frameElement}}return{width:h,height:m,top:f,right:d+h,bottom:f+m,left:d,x:d,y:f}}function Xn(e){return((t0(e)?e.ownerDocument:e.document)||window.document).documentElement}function hl(e){return Ut(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function i0(e){return wr(Xn(e)).left+hl(e).scrollLeft}function is(e){if(Qn(e)==="html")return e;const t=e.assignedSlot||e.parentNode||n0(e)&&e.host||Xn(e);return n0(t)?t.host:t}function s0(e){const t=is(e);return Bd(t)?t.ownerDocument.body:Zt(t)&&pl(t)?t:s0(t)}function qn(e,t){var n;t===void 0&&(t=[]);const r=s0(e),o=r===((n=e.ownerDocument)==null?void 0:n.body),i=ct(r);return o?t.concat(i,i.visualViewport||[],pl(r)?r:[]):t.concat(r,qn(r))}function a0(e,t,n){let r;if(t==="viewport")r=function(s,a){const l=ct(s),u=Xn(s),c=l.visualViewport;let d=u.clientWidth,f=u.clientHeight,h=0,m=0;if(c){d=c.width,f=c.height;const v=Vd();(!v||v&&a==="fixed")&&(h=c.offsetLeft,m=c.offsetTop)}return{width:d,height:f,x:h,y:m}}(e,n);else if(t==="document")r=function(s){const a=Xn(s),l=hl(s),u=s.ownerDocument.body,c=os(a.scrollWidth,a.clientWidth,u.scrollWidth,u.clientWidth),d=os(a.scrollHeight,a.clientHeight,u.scrollHeight,u.clientHeight);let f=-l.scrollLeft+i0(s);const h=-l.scrollTop;return qt(u).direction==="rtl"&&(f+=os(a.clientWidth,u.clientWidth)-c),{width:c,height:d,x:f,y:h}}(Xn(e));else if(Ut(t))r=function(s,a){const l=wr(s,!0,a==="fixed"),u=l.top+s.clientTop,c=l.left+s.clientLeft,d=Zt(s)?Do(s):{x:1,y:1};return{width:s.clientWidth*d.x,height:s.clientHeight*d.y,x:c*d.x,y:u*d.y}}(t,n);else{const s={...t};if(Vd()){var o,i;const a=ct(e);s.x-=((o=a.visualViewport)==null?void 0:o.offsetLeft)||0,s.y-=((i=a.visualViewport)==null?void 0:i.offsetTop)||0}r=s}return Pd(r)}function l0(e,t){return Zt(e)&&qt(e).position!=="fixed"?t?t(e):e.offsetParent:null}function u0(e,t){const n=ct(e);let r=l0(e,t);for(;r&&vI(r)&&qt(r).position==="static";)r=l0(r,t);return r&&(Qn(r)==="html"||Qn(r)==="body"&&qt(r).position==="static"&&!Fd(r))?n:r||function(o){let i=is(o);for(;Zt(i)&&!Bd(i);){if(Fd(i))return i;i=is(i)}return null}(e)||n}function yI(e,t,n){const r=Zt(t),o=Xn(t),i=wr(e,!0,n==="fixed",t);let s={scrollLeft:0,scrollTop:0};const a={x:0,y:0};if(r||!r&&n!=="fixed")if((Qn(t)!=="body"||pl(o))&&(s=hl(t)),Zt(t)){const l=wr(t,!0);a.x=l.x+t.clientLeft,a.y=l.y+t.clientTop}else o&&(a.x=i0(o));return{x:i.left+s.scrollLeft-a.x,y:i.top+s.scrollTop-a.y,width:i.width,height:i.height}}const EI={getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=n==="clippingAncestors"?function(u,c){const d=c.get(u);if(d)return d;let f=qn(u).filter(y=>Ut(y)&&Qn(y)!=="body"),h=null;const m=qt(u).position==="fixed";let v=m?is(u):u;for(;Ut(v)&&!Bd(v);){const y=qt(v),p=Fd(v);y.position==="fixed"?h=null:(m?p||h:p||y.position!=="static"||!h||!["absolute","fixed"].includes(h.position))?h=y:f=f.filter(g=>g!==v),v=is(v)}return c.set(u,f),f}(t,this._c):[].concat(n),s=[...i,r],a=s[0],l=s.reduce((u,c)=>{const d=a0(t,c,o);return u.top=os(d.top,u.top),u.right=Zy(d.right,u.right),u.bottom=Zy(d.bottom,u.bottom),u.left=os(d.left,u.left),u},a0(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:n,strategy:r}=e;const o=Zt(n),i=Xn(n);if(n===i)return t;let s={scrollLeft:0,scrollTop:0},a={x:1,y:1};const l={x:0,y:0};if((o||!o&&r!=="fixed")&&((Qn(n)!=="body"||pl(i))&&(s=hl(n)),Zt(n))){const u=wr(n);a=Do(n),l.x=u.x+n.clientLeft,l.y=u.y+n.clientTop}return{width:t.width*a.x,height:t.height*a.y,x:t.x*a.x-s.scrollLeft*a.x+l.x,y:t.y*a.y-s.scrollTop*a.y+l.y}},isElement:Ut,getDimensions:function(e){return Zt(e)?Jy(e):e.getBoundingClientRect()},getOffsetParent:u0,getDocumentElement:Xn,getScale:Do,async getElementRects(e){let{reference:t,floating:n,strategy:r}=e;const o=this.getOffsetParent||u0,i=this.getDimensions;return{reference:yI(t,await o(n),r),floating:{x:0,y:0,...await i(n)}}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>qt(e).direction==="rtl"};function SI(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=!0,animationFrame:a=!1}=r,l=o&&!a,u=l||i?[...Ut(e)?qn(e):e.contextElement?qn(e.contextElement):[],...qn(t)]:[];u.forEach(h=>{l&&h.addEventListener("scroll",n,{passive:!0}),i&&h.addEventListener("resize",n)});let c,d=null;if(s){let h=!0;d=new ResizeObserver(()=>{h||n(),h=!1}),Ut(e)&&!a&&d.observe(e),Ut(e)||!e.contextElement||a||d.observe(e.contextElement),d.observe(t)}let f=a?wr(e):null;return a&&function h(){const m=wr(e);!f||m.x===f.x&&m.y===f.y&&m.width===f.width&&m.height===f.height||n(),f=m,c=requestAnimationFrame(h)}(),n(),()=>{var h;u.forEach(m=>{l&&m.removeEventListener("scroll",n),i&&m.removeEventListener("resize",n)}),(h=d)==null||h.disconnect(),d=null,a&&cancelAnimationFrame(c)}}const _I=(e,t,n)=>{const r=new Map,o={platform:EI,...n},i={...o.platform,_c:r};return aI(e,t,{...o,platform:i})},wI=e=>{const{element:t,padding:n}=e;function r(o){return Object.prototype.hasOwnProperty.call(o,"current")}return{name:"arrow",options:e,fn(o){return r(t)?t.current!=null?qy({element:t.current,padding:n}).fn(o):{}:t?qy({element:t,padding:n}).fn(o):{}}}};var gl=typeof document<"u"?N.useLayoutEffect:N.useEffect;function ml(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!ml(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const i=o[r];if(!(i==="_owner"&&e.$$typeof)&&!ml(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function c0(e){const t=N.useRef(e);return gl(()=>{t.current=e}),t}function RI(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,whileElementsMounted:i,open:s}=e,[a,l]=N.useState({x:null,y:null,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[u,c]=N.useState(r);ml(u,r)||c(r);const d=N.useRef(null),f=N.useRef(null),h=N.useRef(a),m=c0(i),v=c0(o),[y,p]=N.useState(null),[g,S]=N.useState(null),_=N.useCallback(I=>{d.current!==I&&(d.current=I,p(I))},[]),w=N.useCallback(I=>{f.current!==I&&(f.current=I,S(I))},[]),R=N.useCallback(()=>{if(!d.current||!f.current)return;const I={placement:t,strategy:n,middleware:u};v.current&&(I.platform=v.current),_I(d.current,f.current,I).then(V=>{const $={...V,isPositioned:!0};C.current&&!ml(h.current,$)&&(h.current=$,Ur.flushSync(()=>{l($)}))})},[u,t,n,v]);gl(()=>{s===!1&&h.current.isPositioned&&(h.current.isPositioned=!1,l(I=>({...I,isPositioned:!1})))},[s]);const C=N.useRef(!1);gl(()=>(C.current=!0,()=>{C.current=!1}),[]),gl(()=>{if(y&&g){if(m.current)return m.current(y,g,R);R()}},[y,g,R,m]);const L=N.useMemo(()=>({reference:d,floating:f,setReference:_,setFloating:w}),[_,w]),B=N.useMemo(()=>({reference:y,floating:g}),[y,g]);return N.useMemo(()=>({...a,update:R,refs:L,elements:B,reference:_,floating:w}),[a,R,L,B,_,w])}var Rr=typeof document<"u"?N.useLayoutEffect:N.useEffect;let $d=!1,NI=0;const d0=()=>"floating-ui-"+NI++;function OI(){const[e,t]=N.useState(()=>$d?d0():void 0);return Rr(()=>{e==null&&t(d0())},[]),N.useEffect(()=>{$d||($d=!0)},[]),e}const Hd=xf["useId".toString()]||OI;function xI(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(o=>o(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){e.set(t,(e.get(t)||[]).filter(r=>r!==n))}}}const TI=N.createContext(null),CI=N.createContext(null),f0=()=>{var e;return((e=N.useContext(TI))==null?void 0:e.id)||null},zd=()=>N.useContext(CI);function vn(e){return(e==null?void 0:e.ownerDocument)||document}function p0(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function II(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:n,version:r}=t;return n+"/"+r}).join(" "):navigator.userAgent}function jd(e){return vn(e).defaultView||window}function Jt(e){return e?e instanceof jd(e).Element:!1}function h0(e){return e?e instanceof jd(e).HTMLElement:!1}function bI(e){if(typeof ShadowRoot>"u")return!1;const t=jd(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function AI(e){if(e.mozInputSource===0&&e.isTrusted)return!0;const t=/Android/i;return(t.test(p0())||t.test(II()))&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function LI(e){return e.width===0&&e.height===0||e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType!=="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0}function g0(){return/apple/i.test(navigator.vendor)}function DI(){return p0().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function m0(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function v0(e){const t=N.useRef(e);return Rr(()=>{t.current=e}),t}const y0="data-floating-ui-safe-polygon";function Gd(e,t,n){return n&&!m0(n)?0:typeof e=="number"?e:e==null?void 0:e[t]}const kI=function(e,t){let{enabled:n=!0,delay:r=0,handleClose:o=null,mouseOnly:i=!1,restMs:s=0,move:a=!0}=t===void 0?{}:t;const{open:l,onOpenChange:u,dataRef:c,events:d,elements:{domReference:f,floating:h},refs:m}=e,v=zd(),y=f0(),p=v0(o),g=v0(r),S=N.useRef(),_=N.useRef(),w=N.useRef(),R=N.useRef(),C=N.useRef(!0),L=N.useRef(!1),B=N.useRef(()=>{}),I=N.useCallback(()=>{var O;const M=(O=c.current.openEvent)==null?void 0:O.type;return(M==null?void 0:M.includes("mouse"))&&M!=="mousedown"},[c]);N.useEffect(()=>{if(!n)return;function O(){clearTimeout(_.current),clearTimeout(R.current),C.current=!0}return d.on("dismiss",O),()=>{d.off("dismiss",O)}},[n,d]),N.useEffect(()=>{if(!n||!p.current||!l)return;function O(){I()&&u(!1)}const M=vn(h).documentElement;return M.addEventListener("mouseleave",O),()=>{M.removeEventListener("mouseleave",O)}},[h,l,u,n,p,c,I]);const V=N.useCallback(function(O){O===void 0&&(O=!0);const M=Gd(g.current,"close",S.current);M&&!w.current?(clearTimeout(_.current),_.current=setTimeout(()=>u(!1),M)):O&&(clearTimeout(_.current),u(!1))},[g,u]),$=N.useCallback(()=>{B.current(),w.current=void 0},[]),F=N.useCallback(()=>{if(L.current){const O=vn(m.floating.current).body;O.style.pointerEvents="",O.removeAttribute(y0),L.current=!1}},[m]);return N.useEffect(()=>{if(!n)return;function O(){return c.current.openEvent?["click","mousedown"].includes(c.current.openEvent.type):!1}function M(T){if(clearTimeout(_.current),C.current=!1,i&&!m0(S.current)||s>0&&Gd(g.current,"open")===0)return;c.current.openEvent=T;const P=Gd(g.current,"open",S.current);P?_.current=setTimeout(()=>{u(!0)},P):u(!0)}function D(T){if(O())return;B.current();const P=vn(h);if(clearTimeout(R.current),p.current){l||clearTimeout(_.current),w.current=p.current({...e,tree:v,x:T.clientX,y:T.clientY,onClose(){F(),$(),V()}});const U=w.current;P.addEventListener("mousemove",U),B.current=()=>{P.removeEventListener("mousemove",U)};return}V()}function A(T){O()||p.current==null||p.current({...e,tree:v,x:T.clientX,y:T.clientY,onClose(){F(),$(),V()}})(T)}if(Jt(f)){const T=f;return l&&T.addEventListener("mouseleave",A),h==null||h.addEventListener("mouseleave",A),a&&T.addEventListener("mousemove",M,{once:!0}),T.addEventListener("mouseenter",M),T.addEventListener("mouseleave",D),()=>{l&&T.removeEventListener("mouseleave",A),h==null||h.removeEventListener("mouseleave",A),a&&T.removeEventListener("mousemove",M),T.removeEventListener("mouseenter",M),T.removeEventListener("mouseleave",D)}}},[f,h,n,e,i,s,a,V,$,F,u,l,v,g,p,c]),Rr(()=>{var O;if(n&&l&&(O=p.current)!=null&&O.__options.blockPointerEvents&&I()){const A=vn(h).body;if(A.setAttribute(y0,""),A.style.pointerEvents="none",L.current=!0,Jt(f)&&h){var M,D;const T=f,P=v==null||(M=v.nodesRef.current.find(U=>U.id===y))==null||(D=M.context)==null?void 0:D.elements.floating;return P&&(P.style.pointerEvents=""),T.style.pointerEvents="auto",h.style.pointerEvents="auto",()=>{T.style.pointerEvents="",h.style.pointerEvents=""}}}},[n,l,y,h,f,v,p,c,I]),Rr(()=>{l||(S.current=void 0,$(),F())},[l,$,F]),N.useEffect(()=>()=>{$(),clearTimeout(_.current),clearTimeout(R.current),F()},[n,$,F]),N.useMemo(()=>{if(!n)return{};function O(M){S.current=M.pointerType}return{reference:{onPointerDown:O,onPointerEnter:O,onMouseMove(){l||s===0||(clearTimeout(R.current),R.current=setTimeout(()=>{C.current||u(!0)},s))}},floating:{onMouseEnter(){clearTimeout(_.current)},onMouseLeave(){d.emit("dismiss",{type:"mouseLeave",data:{returnFocus:!1}}),V(!1)}}}},[d,n,s,l,u,V])};function Yd(){return Yd=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},Yd.apply(this,arguments)}function E0(e){let t=e.activeElement;for(;((n=t)==null||(r=n.shadowRoot)==null?void 0:r.activeElement)!=null;){var n,r;t=t.shadowRoot.activeElement}return t}function Wd(e,t){if(!e||!t)return!1;const n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&bI(n)){let r=t;do{if(r&&e===r)return!0;r=r.parentNode||r.host}while(r)}return!1}function Kd(e,t){let n=e.filter(o=>{var i;return o.parentId===t&&((i=o.context)==null?void 0:i.open)})||[],r=n;for(;r.length;)r=e.filter(o=>{var i;return(i=r)==null?void 0:i.some(s=>{var a;return o.parentId===s.id&&((a=o.context)==null?void 0:a.open)})})||[],n=n.concat(r);return n}function PI(e){return"composedPath"in e?e.composedPath()[0]:e.target}const S0=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function _0(e,t){const n=Wy(e,S0());t==="prev"&&n.reverse();const r=n.indexOf(E0(vn(e)));return n.slice(r+1)[0]}function MI(){return _0(document.body,"next")}function UI(){return _0(document.body,"prev")}function Qd(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!Wd(n,r)}function FI(e){Wy(e,S0()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function VI(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}const BI=xf["useInsertionEffect".toString()]||(e=>e());function Xd(e){const t=N.useRef(()=>{});return BI(()=>{t.current=e}),N.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}const w0={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0};let qd,Zd;function R0(e){e.key==="Tab"&&(qd=e.target,clearTimeout(Zd))}function $I(e){const t=qd===e.relatedTarget;return qd=e.relatedTarget,clearTimeout(Zd),t}const N0=N.forwardRef(function(t,n){const r=Xd(t.onFocus),[o,i]=N.useState();return Rr(()=>(g0()&&i("button"),document.addEventListener("keydown",R0),()=>{document.removeEventListener("keydown",R0)}),[]),N.createElement("span",Yd({},t,{ref:n,tabIndex:0,role:o,"aria-hidden":o?void 0:!0,"data-floating-ui-focus-guard":"",style:w0,onFocus:s=>{g0()&&DI()&&!$I(s)?(s.persist(),Zd=window.setTimeout(()=>{r(s)},50)):r(s)}}))}),O0=N.createContext(null),HI=function(e){let{id:t,enabled:n=!0}=e===void 0?{}:e;const[r,o]=N.useState(null),i=Hd(),s=jI();return Rr(()=>{if(!n)return;const a=t?document.getElementById(t):null;if(a)a.setAttribute("data-floating-ui-portal",""),o(a);else{const l=document.createElement("div");t!==""&&(l.id=t||i),l.setAttribute("data-floating-ui-portal",""),o(l);const u=(s==null?void 0:s.portalNode)||document.body;return u.appendChild(l),()=>{u.removeChild(l)}}},[t,s,i,n]),r},zI=e=>{let{children:t,id:n,root:r=null,preserveTabOrder:o=!0}=e;const i=HI({id:n,enabled:!r}),[s,a]=N.useState(null),l=N.useRef(null),u=N.useRef(null),c=N.useRef(null),d=N.useRef(null),f=!!s&&!s.modal&&!!(r||i)&&o;return N.useEffect(()=>{if(!i||!o||s!=null&&s.modal)return;function h(m){i&&Qd(m)&&(m.type==="focusin"?VI:FI)(i)}return i.addEventListener("focusin",h,!0),i.addEventListener("focusout",h,!0),()=>{i.removeEventListener("focusin",h,!0),i.removeEventListener("focusout",h,!0)}},[i,o,s==null?void 0:s.modal]),N.createElement(O0.Provider,{value:N.useMemo(()=>({preserveTabOrder:o,beforeOutsideRef:l,afterOutsideRef:u,beforeInsideRef:c,afterInsideRef:d,portalNode:i,setFocusManagerState:a}),[o,i])},f&&i&&N.createElement(N0,{"data-type":"outside",ref:l,onFocus:h=>{if(Qd(h,i)){var m;(m=c.current)==null||m.focus()}else{const v=UI()||(s==null?void 0:s.refs.domReference.current);v==null||v.focus()}}}),f&&i&&N.createElement("span",{"aria-owns":i.id,style:w0}),r?Ur.createPortal(t,r):i?Ur.createPortal(t,i):null,f&&i&&N.createElement(N0,{"data-type":"outside",ref:u,onFocus:h=>{if(Qd(h,i)){var m;(m=d.current)==null||m.focus()}else{const v=MI()||(s==null?void 0:s.refs.domReference.current);v==null||v.focus(),s!=null&&s.closeOnFocusOut&&(s==null||s.onOpenChange(!1))}}}))},jI=()=>N.useContext(O0);function vl(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}const GI={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},YI={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},WI=function(e){var t,n;return e===void 0&&(e=!0),{escapeKeyBubbles:typeof e=="boolean"?e:(t=e.escapeKey)!=null?t:!0,outsidePressBubbles:typeof e=="boolean"?e:(n=e.outsidePress)!=null?n:!0}},KI=function(e,t){let{open:n,onOpenChange:r,events:o,nodeId:i,elements:{reference:s,domReference:a,floating:l},dataRef:u}=e,{enabled:c=!0,escapeKey:d=!0,outsidePress:f=!0,outsidePressEvent:h="pointerdown",referencePress:m=!1,referencePressEvent:v="pointerdown",ancestorScroll:y=!1,bubbles:p=!0}=t===void 0?{}:t;const g=zd(),S=f0()!=null,_=Xd(typeof f=="function"?f:()=>!1),w=typeof f=="function"?_:f,R=N.useRef(!1),{escapeKeyBubbles:C,outsidePressBubbles:L}=WI(p);return N.useEffect(()=>{if(!n||!c)return;u.current.__escapeKeyBubbles=C,u.current.__outsidePressBubbles=L;function B(O){if(O.key==="Escape"){const M=g?Kd(g.nodesRef.current,i):[];if(M.length>0){let D=!0;if(M.forEach(A=>{var T;if((T=A.context)!=null&&T.open&&!A.context.dataRef.current.__escapeKeyBubbles){D=!1;return}}),!D)return}o.emit("dismiss",{type:"escapeKey",data:{returnFocus:{preventScroll:!1}}}),r(!1)}}function I(O){const M=R.current;if(R.current=!1,M||typeof w=="function"&&!w(O))return;const D=PI(O);if(h0(D)&&l){const P=l.ownerDocument.defaultView||window,U=D.scrollWidth>D.clientWidth,H=D.scrollHeight>D.clientHeight;let j=H&&O.offsetX>D.clientWidth;if(H&&P.getComputedStyle(D).direction==="rtl"&&(j=O.offsetX<=D.offsetWidth-D.clientWidth),j||U&&O.offsetY>D.clientHeight)return}const A=g&&Kd(g.nodesRef.current,i).some(P=>{var U;return vl(O,(U=P.context)==null?void 0:U.elements.floating)});if(vl(O,l)||vl(O,a)||A)return;const T=g?Kd(g.nodesRef.current,i):[];if(T.length>0){let P=!0;if(T.forEach(U=>{var H;if((H=U.context)!=null&&H.open&&!U.context.dataRef.current.__outsidePressBubbles){P=!1;return}}),!P)return}o.emit("dismiss",{type:"outsidePress",data:{returnFocus:S?{preventScroll:!0}:AI(O)||LI(O)}}),r(!1)}function V(){r(!1)}const $=vn(l);d&&$.addEventListener("keydown",B),w&&$.addEventListener(h,I);let F=[];return y&&(Jt(a)&&(F=qn(a)),Jt(l)&&(F=F.concat(qn(l))),!Jt(s)&&s&&s.contextElement&&(F=F.concat(qn(s.contextElement)))),F=F.filter(O=>{var M;return O!==((M=$.defaultView)==null?void 0:M.visualViewport)}),F.forEach(O=>{O.addEventListener("scroll",V,{passive:!0})}),()=>{d&&$.removeEventListener("keydown",B),w&&$.removeEventListener(h,I),F.forEach(O=>{O.removeEventListener("scroll",V)})}},[u,l,a,s,d,w,h,o,g,i,n,r,y,c,C,L,S]),N.useEffect(()=>{R.current=!1},[w,h]),N.useMemo(()=>c?{reference:{[GI[v]]:()=>{m&&(o.emit("dismiss",{type:"referencePress",data:{returnFocus:!1}}),r(!1))}},floating:{[YI[h]]:()=>{R.current=!0}}}:{},[c,o,m,h,v,r])},QI=function(e,t){let{open:n,onOpenChange:r,dataRef:o,events:i,refs:s,elements:{floating:a,domReference:l}}=e,{enabled:u=!0,keyboardOnly:c=!0}=t===void 0?{}:t;const d=N.useRef(""),f=N.useRef(!1),h=N.useRef();return N.useEffect(()=>{if(!u)return;const v=vn(a).defaultView||window;function y(){!n&&h0(l)&&l===E0(vn(l))&&(f.current=!0)}return v.addEventListener("blur",y),()=>{v.removeEventListener("blur",y)}},[a,l,n,u]),N.useEffect(()=>{if(!u)return;function m(v){(v.type==="referencePress"||v.type==="escapeKey")&&(f.current=!0)}return i.on("dismiss",m),()=>{i.off("dismiss",m)}},[i,u]),N.useEffect(()=>()=>{clearTimeout(h.current)},[]),N.useMemo(()=>u?{reference:{onPointerDown(m){let{pointerType:v}=m;d.current=v,f.current=!!(v&&c)},onMouseLeave(){f.current=!1},onFocus(m){var v;f.current||m.type==="focus"&&((v=o.current.openEvent)==null?void 0:v.type)==="mousedown"&&o.current.openEvent&&vl(o.current.openEvent,l)||(o.current.openEvent=m.nativeEvent,r(!0))},onBlur(m){f.current=!1;const v=m.relatedTarget,y=Jt(v)&&v.hasAttribute("data-floating-ui-focus-guard")&&v.getAttribute("data-type")==="outside";h.current=setTimeout(()=>{Wd(s.floating.current,v)||Wd(l,v)||y||r(!1)})}}}:{},[u,c,l,s,o,r])};function x0(e){return N.useMemo(()=>e.every(t=>t==null)?null:t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})},e)}const XI=function(e,t){let{open:n}=e,{enabled:r=!0,role:o="dialog"}=t===void 0?{}:t;const i=Hd(),s=Hd();return N.useMemo(()=>{const a={id:i,role:o};return r?o==="tooltip"?{reference:{"aria-describedby":n?i:void 0},floating:a}:{reference:{"aria-expanded":n?"true":"false","aria-haspopup":o==="alertdialog"?"dialog":o,"aria-controls":n?i:void 0,...o==="listbox"&&{role:"combobox"},...o==="menu"&&{id:s}},floating:{...a,...o==="menu"&&{"aria-labelledby":s}}}:{}},[r,o,n,i,s])};function qI(e){e===void 0&&(e={});const{open:t=!1,onOpenChange:n,nodeId:r}=e,o=RI(e),i=zd(),s=N.useRef(null),a=N.useRef({}),l=N.useState(()=>xI())[0],[u,c]=N.useState(null),d=N.useCallback(p=>{const g=Jt(p)?{getBoundingClientRect:()=>p.getBoundingClientRect(),contextElement:p}:p;o.refs.setReference(g)},[o.refs]),f=N.useCallback(p=>{(Jt(p)||p===null)&&(s.current=p,c(p)),(Jt(o.refs.reference.current)||o.refs.reference.current===null||p!==null&&!Jt(p))&&o.refs.setReference(p)},[o.refs]),h=N.useMemo(()=>({...o.refs,setReference:f,setPositionReference:d,domReference:s}),[o.refs,f,d]),m=N.useMemo(()=>({...o.elements,domReference:u}),[o.elements,u]),v=Xd(n),y=N.useMemo(()=>({...o,refs:h,elements:m,dataRef:a,nodeId:r,events:l,open:t,onOpenChange:v}),[o,r,l,t,v,h,m]);return Rr(()=>{const p=i==null?void 0:i.nodesRef.current.find(g=>g.id===r);p&&(p.context=y)}),N.useMemo(()=>({...o,context:y,refs:h,reference:f,positionReference:d}),[o,h,y,f,d])}function Jd(e,t,n){const r=new Map;return{...n==="floating"&&{tabIndex:-1},...e,...t.map(o=>o?o[n]:null).concat(e).reduce((o,i)=>(i&&Object.entries(i).forEach(s=>{let[a,l]=s;if(a.indexOf("on")===0){if(r.has(a)||r.set(a,[]),typeof l=="function"){var u;(u=r.get(a))==null||u.push(l),o[a]=function(){for(var c,d=arguments.length,f=new Array(d),h=0;h<d;h++)f[h]=arguments[h];(c=r.get(a))==null||c.forEach(m=>m(...f))}}}else o[a]=l}),o),{})}}const ZI=function(e){e===void 0&&(e=[]);const t=e,n=N.useCallback(i=>Jd(i,e,"reference"),t),r=N.useCallback(i=>Jd(i,e,"floating"),t),o=N.useCallback(i=>Jd(i,e,"item"),e.map(i=>i==null?void 0:i.item));return N.useMemo(()=>({getReferenceProps:n,getFloatingProps:r,getItemProps:o}),[n,r,o])};function JI({initialOpen:e=!1,placement:t="top",open:n,onOpenChange:r,role:o="tooltip"}={}){const i=pt.useRef(null),[s,a]=pt.useState(e),l=n??s,u=r??a,c=qI({placement:t,open:l,onOpenChange:u,whileElementsMounted:SI,strategy:"fixed",middleware:[hI(8),pI({fallbackPlacements:["top","bottom","left","right"]}),mI({padding:8}),wI({element:i})]}),d=c.context,f=kI(d,{move:!1,enabled:n==null}),h=QI(d,{enabled:n==null}),m=KI(d),v=XI(d,{role:o}),y=ZI([f,h,m,v]);return pt.useMemo(()=>({open:l,setOpen:u,arrowRef:i,...y,...c}),[l,u,y,c])}const T0=pt.createContext(null),ef=()=>{const e=pt.useContext(T0);if(e==null)throw new Error("Tooltip components must be wrapped in <Tooltip />");return e},eb=({children:e,...t})=>{const n=JI(t);return E(T0.Provider,{value:n,children:e})},tb={top:"-bottom-1 before:border-t-0 before:border-l-0",bottom:"-top-1 before:border-b-0 before:border-r-0",left:"-right-1 before:border-r-0 before:border-t-0",right:"-left-1 before:border-l-0 before:border-b-0"},nb=()=>{var s,a;const e=ef(),[t,n]=N.useState(e.middlewareData.arrow);N.useEffect(()=>{e.middlewareData.arrow&&n(e.middlewareData.arrow)},[e.middlewareData.arrow]);const r={left:(t==null?void 0:t.x)!==null?`${t==null?void 0:t.x}px`:"",top:(t==null?void 0:t.y)!==null?`${t==null?void 0:t.y}px`:""},o=((a=(s=e.placement)==null?void 0:s.split("-"))==null?void 0:a[0])||"top",i=`${tb[o]}`;return E("div",{ref:e.arrowRef,style:r,className:`tooltip-arrow absolute h-2 w-2 rotate-45 bg-inherit
64
+ */var jC=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],Ld=jC.join(","),Hy=typeof Element>"u",ts=Hy?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,ll=!Hy&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e==null?void 0:e.ownerDocument},ul=function e(t,n){var r;n===void 0&&(n=!0);var o=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"inert"),i=o===""||o==="true",s=i||n&&t&&e(t.parentNode);return s},GC=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},YC=function(t,n,r){if(ul(t))return[];var o=Array.prototype.slice.apply(t.querySelectorAll(Ld));return n&&ts.call(t,Ld)&&o.unshift(t),o=o.filter(r),o},WC=function e(t,n,r){for(var o=[],i=Array.from(t);i.length;){var s=i.shift();if(!ul(s,!1))if(s.tagName==="SLOT"){var a=s.assignedElements(),l=a.length?a:s.children,u=e(l,!0,r);r.flatten?o.push.apply(o,u):o.push({scopeParent:s,candidates:u})}else{var c=ts.call(s,Ld);c&&r.filter(s)&&(n||!t.includes(s))&&o.push(s);var d=s.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(s),f=!ul(d,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(s));if(d&&f){var h=e(d===!0?s.children:d.children,!0,r);r.flatten?o.push.apply(o,h):o.push({scopeParent:s,candidates:h})}else i.unshift.apply(i,s.children)}}return o},zy=function(t,n){return t.tabIndex<0&&(n||/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||GC(t))&&isNaN(parseInt(t.getAttribute("tabindex"),10))?0:t.tabIndex},KC=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},jy=function(t){return t.tagName==="INPUT"},QC=function(t){return jy(t)&&t.type==="hidden"},XC=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},qC=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},ZC=function(t){if(!t.name)return!0;var n=t.form||ll(t),r=function(a){return n.querySelectorAll('input[type="radio"][name="'+a+'"]')},o;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")o=r(window.CSS.escape(t.name));else try{o=r(t.name)}catch(s){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",s.message),!1}var i=qC(o,t.form);return!i||i===t},JC=function(t){return jy(t)&&t.type==="radio"},eI=function(t){return JC(t)&&!ZC(t)},tI=function(t){var n,r=t&&ll(t),o=(n=r)===null||n===void 0?void 0:n.host,i=!1;if(r&&r!==t){var s,a,l;for(i=!!((s=o)!==null&&s!==void 0&&(a=s.ownerDocument)!==null&&a!==void 0&&a.contains(o)||t!=null&&(l=t.ownerDocument)!==null&&l!==void 0&&l.contains(t));!i&&o;){var u,c,d;r=ll(o),o=(u=r)===null||u===void 0?void 0:u.host,i=!!((c=o)!==null&&c!==void 0&&(d=c.ownerDocument)!==null&&d!==void 0&&d.contains(o))}}return i},Gy=function(t){var n=t.getBoundingClientRect(),r=n.width,o=n.height;return r===0&&o===0},nI=function(t,n){var r=n.displayCheck,o=n.getShadowRoot;if(getComputedStyle(t).visibility==="hidden")return!0;var i=ts.call(t,"details>summary:first-of-type"),s=i?t.parentElement:t;if(ts.call(s,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="legacy-full"){if(typeof o=="function"){for(var a=t;t;){var l=t.parentElement,u=ll(t);if(l&&!l.shadowRoot&&o(l)===!0)return Gy(t);t.assignedSlot?t=t.assignedSlot:!l&&u!==t.ownerDocument?t=u.host:t=l}t=a}if(tI(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return Gy(t);return!1},rI=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r<n.children.length;r++){var o=n.children.item(r);if(o.tagName==="LEGEND")return ts.call(n,"fieldset[disabled] *")?!0:!o.contains(t)}return!0}n=n.parentElement}return!1},oI=function(t,n){return!(n.disabled||ul(n)||QC(n)||nI(n,t)||XC(n)||rI(n))},Yy=function(t,n){return!(eI(n)||zy(n)<0||!oI(t,n))},iI=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},sI=function e(t){var n=[],r=[];return t.forEach(function(o,i){var s=!!o.scopeParent,a=s?o.scopeParent:o,l=zy(a,s),u=s?e(o.candidates):a;l===0?s?n.push.apply(n,u):n.push(a):r.push({documentOrder:i,tabIndex:l,item:o,isScope:s,content:u})}),r.sort(KC).reduce(function(o,i){return i.isScope?o.push.apply(o,i.content):o.push(i.content),o},[]).concat(n)},Wy=function(t,n){n=n||{};var r;return n.getShadowRoot?r=WC([t],n.includeContainer,{filter:Yy.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:iI}):r=YC(t,n.includeContainer,Yy.bind(null,n)),sI(r)};function ns(e){return e.split("-")[1]}function Dd(e){return e==="y"?"height":"width"}function _r(e){return e.split("-")[0]}function rs(e){return["top","bottom"].includes(_r(e))?"x":"y"}function Ky(e,t,n){let{reference:r,floating:o}=e;const i=r.x+r.width/2-o.width/2,s=r.y+r.height/2-o.height/2,a=rs(t),l=Dd(a),u=r[l]/2-o[l]/2,c=a==="x";let d;switch(_r(t)){case"top":d={x:i,y:r.y-o.height};break;case"bottom":d={x:i,y:r.y+r.height};break;case"right":d={x:r.x+r.width,y:s};break;case"left":d={x:r.x-o.width,y:s};break;default:d={x:r.x,y:r.y}}switch(ns(t)){case"start":d[a]-=u*(n&&c?-1:1);break;case"end":d[a]+=u*(n&&c?-1:1)}return d}const aI=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=i.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(t));let u=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:c,y:d}=Ky(u,r,l),f=r,h={},m=0;for(let v=0;v<a.length;v++){const{name:y,fn:p}=a[v],{x:g,y:S,data:_,reset:w}=await p({x:c,y:d,initialPlacement:r,placement:f,strategy:o,middlewareData:h,rects:u,platform:s,elements:{reference:e,floating:t}});c=g??c,d=S??d,h={...h,[y]:{...h[y],..._}},w&&m<=50&&(m++,typeof w=="object"&&(w.placement&&(f=w.placement),w.rects&&(u=w.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):w.rects),{x:c,y:d}=Ky(u,f,l)),v=-1)}return{x:c,y:d,placement:f,strategy:o,middlewareData:h}};function Qy(e){return typeof e!="number"?function(t){return{top:0,right:0,bottom:0,left:0,...t}}(e):{top:e,right:e,bottom:e,left:e}}function kd(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}async function Xy(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:s,elements:a,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:d="floating",altBoundary:f=!1,padding:h=0}=t,m=Qy(h),v=a[f?d==="floating"?"reference":"floating":d],y=kd(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(v)))==null||n?v:v.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:u,rootBoundary:c,strategy:l})),p=d==="floating"?{...s.floating,x:r,y:o}:s.reference,g=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),S=await(i.isElement==null?void 0:i.isElement(g))&&await(i.getScale==null?void 0:i.getScale(g))||{x:1,y:1},_=kd(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({rect:p,offsetParent:g,strategy:l}):p);return{top:(y.top-_.top+m.top)/S.y,bottom:(_.bottom-y.bottom+m.bottom)/S.y,left:(y.left-_.left+m.left)/S.x,right:(_.right-y.right+m.right)/S.x}}const lI=Math.min,uI=Math.max;function Pd(e,t,n){return uI(e,lI(t,n))}const qy=e=>({name:"arrow",options:e,async fn(t){const{element:n,padding:r=0}=e||{},{x:o,y:i,placement:s,rects:a,platform:l}=t;if(n==null)return{};const u=Qy(r),c={x:o,y:i},d=rs(s),f=Dd(d),h=await l.getDimensions(n),m=d==="y"?"top":"left",v=d==="y"?"bottom":"right",y=a.reference[f]+a.reference[d]-c[d]-a.floating[f],p=c[d]-a.reference[d],g=await(l.getOffsetParent==null?void 0:l.getOffsetParent(n));let S=g?d==="y"?g.clientHeight||0:g.clientWidth||0:0;S===0&&(S=a.floating[f]);const _=y/2-p/2,w=u[m],R=S-h[f]-u[v],C=S/2-h[f]/2+_,L=Pd(w,C,R),B=ns(s)!=null&&C!=L&&a.reference[f]/2-(C<w?u[m]:u[v])-h[f]/2<0;return{[d]:c[d]-(B?C<w?w-C:R-C:0),data:{[d]:L,centerOffset:C-L}}}});["top","right","bottom","left"].reduce((e,t)=>e.concat(t,t+"-start",t+"-end"),[]);const cI={left:"right",right:"left",bottom:"top",top:"bottom"};function cl(e){return e.replace(/left|right|bottom|top/g,t=>cI[t])}function dI(e,t,n){n===void 0&&(n=!1);const r=ns(e),o=rs(e),i=Dd(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=cl(s)),{main:s,cross:cl(s)}}const fI={start:"end",end:"start"};function Md(e){return e.replace(/start|end/g,t=>fI[t])}const pI=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n;const{placement:r,middlewareData:o,rects:i,initialPlacement:s,platform:a,elements:l}=t,{mainAxis:u=!0,crossAxis:c=!0,fallbackPlacements:d,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:m=!0,...v}=e,y=_r(r),p=_r(s)===s,g=await(a.isRTL==null?void 0:a.isRTL(l.floating)),S=d||(p||!m?[cl(s)]:function(V){const $=cl(V);return[Md(V),$,Md($)]}(s));d||h==="none"||S.push(...function(V,$,F,O){const M=ns(V);let D=function(A,T,P){const U=["left","right"],H=["right","left"],j=["top","bottom"],K=["bottom","top"];switch(A){case"top":case"bottom":return P?T?H:U:T?U:H;case"left":case"right":return T?j:K;default:return[]}}(_r(V),F==="start",O);return M&&(D=D.map(A=>A+"-"+M),$&&(D=D.concat(D.map(Md)))),D}(s,m,h,g));const _=[s,...S],w=await Xy(t,v),R=[];let C=((n=o.flip)==null?void 0:n.overflows)||[];if(u&&R.push(w[y]),c){const{main:V,cross:$}=dI(r,i,g);R.push(w[V],w[$])}if(C=[...C,{placement:r,overflows:R}],!R.every(V=>V<=0)){var L,B;const V=(((L=o.flip)==null?void 0:L.index)||0)+1,$=_[V];if($)return{data:{index:V,overflows:C},reset:{placement:$}};let F=(B=C.filter(O=>O.overflows[0]<=0).sort((O,M)=>O.overflows[1]-M.overflows[1])[0])==null?void 0:B.placement;if(!F)switch(f){case"bestFit":{var I;const O=(I=C.map(M=>[M.placement,M.overflows.filter(D=>D>0).reduce((D,A)=>D+A,0)]).sort((M,D)=>M[1]-D[1])[0])==null?void 0:I[0];O&&(F=O);break}case"initialPlacement":F=s}if(r!==F)return{reset:{placement:F}}}return{}}}},hI=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){const{x:n,y:r}=t,o=await async function(i,s){const{placement:a,platform:l,elements:u}=i,c=await(l.isRTL==null?void 0:l.isRTL(u.floating)),d=_r(a),f=ns(a),h=rs(a)==="x",m=["left","top"].includes(d)?-1:1,v=c&&h?-1:1,y=typeof s=="function"?s(i):s;let{mainAxis:p,crossAxis:g,alignmentAxis:S}=typeof y=="number"?{mainAxis:y,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...y};return f&&typeof S=="number"&&(g=f==="end"?-1*S:S),h?{x:g*v,y:p*m}:{x:p*m,y:g*v}}(t,e);return{x:n+o.x,y:r+o.y,data:o}}}};function gI(e){return e==="x"?"y":"x"}const mI=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:a={fn:y=>{let{x:p,y:g}=y;return{x:p,y:g}}},...l}=e,u={x:n,y:r},c=await Xy(t,l),d=rs(_r(o)),f=gI(d);let h=u[d],m=u[f];if(i){const y=d==="y"?"bottom":"right";h=Pd(h+c[d==="y"?"top":"left"],h,h-c[y])}if(s){const y=f==="y"?"bottom":"right";m=Pd(m+c[f==="y"?"top":"left"],m,m-c[y])}const v=a.fn({...t,[d]:h,[f]:m});return{...v,data:{x:v.x-n,y:v.y-r}}}}};function ct(e){var t;return((t=e.ownerDocument)==null?void 0:t.defaultView)||window}function qt(e){return ct(e).getComputedStyle(e)}const Zy=Math.min,os=Math.max,dl=Math.round;function Jy(e){const t=qt(e);let n=parseFloat(t.width),r=parseFloat(t.height);const o=e.offsetWidth,i=e.offsetHeight,s=dl(n)!==o||dl(r)!==i;return s&&(n=o,r=i),{width:n,height:r,fallback:s}}function Qn(e){return t0(e)?(e.nodeName||"").toLowerCase():""}let fl;function e0(){if(fl)return fl;const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?(fl=e.brands.map(t=>t.brand+"/"+t.version).join(" "),fl):navigator.userAgent}function Zt(e){return e instanceof ct(e).HTMLElement}function Ut(e){return e instanceof ct(e).Element}function t0(e){return e instanceof ct(e).Node}function n0(e){return typeof ShadowRoot>"u"?!1:e instanceof ct(e).ShadowRoot||e instanceof ShadowRoot}function pl(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=qt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function vI(e){return["table","td","th"].includes(Qn(e))}function Ud(e){const t=/firefox/i.test(e0()),n=qt(e),r=n.backdropFilter||n.WebkitBackdropFilter;return n.transform!=="none"||n.perspective!=="none"||!!r&&r!=="none"||t&&n.willChange==="filter"||t&&!!n.filter&&n.filter!=="none"||["transform","perspective"].some(o=>n.willChange.includes(o))||["paint","layout","strict","content"].some(o=>{const i=n.contain;return i!=null&&i.includes(o)})}function Fd(){return/^((?!chrome|android).)*safari/i.test(e0())}function Vd(e){return["html","body","#document"].includes(Qn(e))}function r0(e){return Ut(e)?e:e.contextElement}const o0={x:1,y:1};function Do(e){const t=r0(e);if(!Zt(t))return o0;const n=t.getBoundingClientRect(),{width:r,height:o,fallback:i}=Jy(t);let s=(i?dl(n.width):n.width)/r,a=(i?dl(n.height):n.height)/o;return s&&Number.isFinite(s)||(s=1),a&&Number.isFinite(a)||(a=1),{x:s,y:a}}function wr(e,t,n,r){var o,i;t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),a=r0(e);let l=o0;t&&(r?Ut(r)&&(l=Do(r)):l=Do(e));const u=a?ct(a):window,c=Fd()&&n;let d=(s.left+(c&&((o=u.visualViewport)==null?void 0:o.offsetLeft)||0))/l.x,f=(s.top+(c&&((i=u.visualViewport)==null?void 0:i.offsetTop)||0))/l.y,h=s.width/l.x,m=s.height/l.y;if(a){const v=ct(a),y=r&&Ut(r)?ct(r):r;let p=v.frameElement;for(;p&&r&&y!==v;){const g=Do(p),S=p.getBoundingClientRect(),_=getComputedStyle(p);S.x+=(p.clientLeft+parseFloat(_.paddingLeft))*g.x,S.y+=(p.clientTop+parseFloat(_.paddingTop))*g.y,d*=g.x,f*=g.y,h*=g.x,m*=g.y,d+=S.x,f+=S.y,p=ct(p).frameElement}}return{width:h,height:m,top:f,right:d+h,bottom:f+m,left:d,x:d,y:f}}function Xn(e){return((t0(e)?e.ownerDocument:e.document)||window.document).documentElement}function hl(e){return Ut(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function i0(e){return wr(Xn(e)).left+hl(e).scrollLeft}function is(e){if(Qn(e)==="html")return e;const t=e.assignedSlot||e.parentNode||n0(e)&&e.host||Xn(e);return n0(t)?t.host:t}function s0(e){const t=is(e);return Vd(t)?t.ownerDocument.body:Zt(t)&&pl(t)?t:s0(t)}function qn(e,t){var n;t===void 0&&(t=[]);const r=s0(e),o=r===((n=e.ownerDocument)==null?void 0:n.body),i=ct(r);return o?t.concat(i,i.visualViewport||[],pl(r)?r:[]):t.concat(r,qn(r))}function a0(e,t,n){let r;if(t==="viewport")r=function(s,a){const l=ct(s),u=Xn(s),c=l.visualViewport;let d=u.clientWidth,f=u.clientHeight,h=0,m=0;if(c){d=c.width,f=c.height;const v=Fd();(!v||v&&a==="fixed")&&(h=c.offsetLeft,m=c.offsetTop)}return{width:d,height:f,x:h,y:m}}(e,n);else if(t==="document")r=function(s){const a=Xn(s),l=hl(s),u=s.ownerDocument.body,c=os(a.scrollWidth,a.clientWidth,u.scrollWidth,u.clientWidth),d=os(a.scrollHeight,a.clientHeight,u.scrollHeight,u.clientHeight);let f=-l.scrollLeft+i0(s);const h=-l.scrollTop;return qt(u).direction==="rtl"&&(f+=os(a.clientWidth,u.clientWidth)-c),{width:c,height:d,x:f,y:h}}(Xn(e));else if(Ut(t))r=function(s,a){const l=wr(s,!0,a==="fixed"),u=l.top+s.clientTop,c=l.left+s.clientLeft,d=Zt(s)?Do(s):{x:1,y:1};return{width:s.clientWidth*d.x,height:s.clientHeight*d.y,x:c*d.x,y:u*d.y}}(t,n);else{const s={...t};if(Fd()){var o,i;const a=ct(e);s.x-=((o=a.visualViewport)==null?void 0:o.offsetLeft)||0,s.y-=((i=a.visualViewport)==null?void 0:i.offsetTop)||0}r=s}return kd(r)}function l0(e,t){return Zt(e)&&qt(e).position!=="fixed"?t?t(e):e.offsetParent:null}function u0(e,t){const n=ct(e);let r=l0(e,t);for(;r&&vI(r)&&qt(r).position==="static";)r=l0(r,t);return r&&(Qn(r)==="html"||Qn(r)==="body"&&qt(r).position==="static"&&!Ud(r))?n:r||function(o){let i=is(o);for(;Zt(i)&&!Vd(i);){if(Ud(i))return i;i=is(i)}return null}(e)||n}function yI(e,t,n){const r=Zt(t),o=Xn(t),i=wr(e,!0,n==="fixed",t);let s={scrollLeft:0,scrollTop:0};const a={x:0,y:0};if(r||!r&&n!=="fixed")if((Qn(t)!=="body"||pl(o))&&(s=hl(t)),Zt(t)){const l=wr(t,!0);a.x=l.x+t.clientLeft,a.y=l.y+t.clientTop}else o&&(a.x=i0(o));return{x:i.left+s.scrollLeft-a.x,y:i.top+s.scrollTop-a.y,width:i.width,height:i.height}}const EI={getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=n==="clippingAncestors"?function(u,c){const d=c.get(u);if(d)return d;let f=qn(u).filter(y=>Ut(y)&&Qn(y)!=="body"),h=null;const m=qt(u).position==="fixed";let v=m?is(u):u;for(;Ut(v)&&!Vd(v);){const y=qt(v),p=Ud(v);y.position==="fixed"?h=null:(m?p||h:p||y.position!=="static"||!h||!["absolute","fixed"].includes(h.position))?h=y:f=f.filter(g=>g!==v),v=is(v)}return c.set(u,f),f}(t,this._c):[].concat(n),s=[...i,r],a=s[0],l=s.reduce((u,c)=>{const d=a0(t,c,o);return u.top=os(d.top,u.top),u.right=Zy(d.right,u.right),u.bottom=Zy(d.bottom,u.bottom),u.left=os(d.left,u.left),u},a0(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:n,strategy:r}=e;const o=Zt(n),i=Xn(n);if(n===i)return t;let s={scrollLeft:0,scrollTop:0},a={x:1,y:1};const l={x:0,y:0};if((o||!o&&r!=="fixed")&&((Qn(n)!=="body"||pl(i))&&(s=hl(n)),Zt(n))){const u=wr(n);a=Do(n),l.x=u.x+n.clientLeft,l.y=u.y+n.clientTop}return{width:t.width*a.x,height:t.height*a.y,x:t.x*a.x-s.scrollLeft*a.x+l.x,y:t.y*a.y-s.scrollTop*a.y+l.y}},isElement:Ut,getDimensions:function(e){return Zt(e)?Jy(e):e.getBoundingClientRect()},getOffsetParent:u0,getDocumentElement:Xn,getScale:Do,async getElementRects(e){let{reference:t,floating:n,strategy:r}=e;const o=this.getOffsetParent||u0,i=this.getDimensions;return{reference:yI(t,await o(n),r),floating:{x:0,y:0,...await i(n)}}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>qt(e).direction==="rtl"};function SI(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=!0,animationFrame:a=!1}=r,l=o&&!a,u=l||i?[...Ut(e)?qn(e):e.contextElement?qn(e.contextElement):[],...qn(t)]:[];u.forEach(h=>{l&&h.addEventListener("scroll",n,{passive:!0}),i&&h.addEventListener("resize",n)});let c,d=null;if(s){let h=!0;d=new ResizeObserver(()=>{h||n(),h=!1}),Ut(e)&&!a&&d.observe(e),Ut(e)||!e.contextElement||a||d.observe(e.contextElement),d.observe(t)}let f=a?wr(e):null;return a&&function h(){const m=wr(e);!f||m.x===f.x&&m.y===f.y&&m.width===f.width&&m.height===f.height||n(),f=m,c=requestAnimationFrame(h)}(),n(),()=>{var h;u.forEach(m=>{l&&m.removeEventListener("scroll",n),i&&m.removeEventListener("resize",n)}),(h=d)==null||h.disconnect(),d=null,a&&cancelAnimationFrame(c)}}const _I=(e,t,n)=>{const r=new Map,o={platform:EI,...n},i={...o.platform,_c:r};return aI(e,t,{...o,platform:i})},wI=e=>{const{element:t,padding:n}=e;function r(o){return Object.prototype.hasOwnProperty.call(o,"current")}return{name:"arrow",options:e,fn(o){return r(t)?t.current!=null?qy({element:t.current,padding:n}).fn(o):{}:t?qy({element:t,padding:n}).fn(o):{}}}};var gl=typeof document<"u"?N.useLayoutEffect:N.useEffect;function ml(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!ml(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const i=o[r];if(!(i==="_owner"&&e.$$typeof)&&!ml(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function c0(e){const t=N.useRef(e);return gl(()=>{t.current=e}),t}function RI(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,whileElementsMounted:i,open:s}=e,[a,l]=N.useState({x:null,y:null,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[u,c]=N.useState(r);ml(u,r)||c(r);const d=N.useRef(null),f=N.useRef(null),h=N.useRef(a),m=c0(i),v=c0(o),[y,p]=N.useState(null),[g,S]=N.useState(null),_=N.useCallback(I=>{d.current!==I&&(d.current=I,p(I))},[]),w=N.useCallback(I=>{f.current!==I&&(f.current=I,S(I))},[]),R=N.useCallback(()=>{if(!d.current||!f.current)return;const I={placement:t,strategy:n,middleware:u};v.current&&(I.platform=v.current),_I(d.current,f.current,I).then(V=>{const $={...V,isPositioned:!0};C.current&&!ml(h.current,$)&&(h.current=$,Ur.flushSync(()=>{l($)}))})},[u,t,n,v]);gl(()=>{s===!1&&h.current.isPositioned&&(h.current.isPositioned=!1,l(I=>({...I,isPositioned:!1})))},[s]);const C=N.useRef(!1);gl(()=>(C.current=!0,()=>{C.current=!1}),[]),gl(()=>{if(y&&g){if(m.current)return m.current(y,g,R);R()}},[y,g,R,m]);const L=N.useMemo(()=>({reference:d,floating:f,setReference:_,setFloating:w}),[_,w]),B=N.useMemo(()=>({reference:y,floating:g}),[y,g]);return N.useMemo(()=>({...a,update:R,refs:L,elements:B,reference:_,floating:w}),[a,R,L,B,_,w])}var Rr=typeof document<"u"?N.useLayoutEffect:N.useEffect;let Bd=!1,NI=0;const d0=()=>"floating-ui-"+NI++;function OI(){const[e,t]=N.useState(()=>Bd?d0():void 0);return Rr(()=>{e==null&&t(d0())},[]),N.useEffect(()=>{Bd||(Bd=!0)},[]),e}const $d=Of["useId".toString()]||OI;function xI(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(o=>o(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){e.set(t,(e.get(t)||[]).filter(r=>r!==n))}}}const TI=N.createContext(null),CI=N.createContext(null),f0=()=>{var e;return((e=N.useContext(TI))==null?void 0:e.id)||null},Hd=()=>N.useContext(CI);function vn(e){return(e==null?void 0:e.ownerDocument)||document}function p0(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function II(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:n,version:r}=t;return n+"/"+r}).join(" "):navigator.userAgent}function zd(e){return vn(e).defaultView||window}function Jt(e){return e?e instanceof zd(e).Element:!1}function h0(e){return e?e instanceof zd(e).HTMLElement:!1}function bI(e){if(typeof ShadowRoot>"u")return!1;const t=zd(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function AI(e){if(e.mozInputSource===0&&e.isTrusted)return!0;const t=/Android/i;return(t.test(p0())||t.test(II()))&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function LI(e){return e.width===0&&e.height===0||e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType!=="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0}function g0(){return/apple/i.test(navigator.vendor)}function DI(){return p0().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function m0(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function v0(e){const t=N.useRef(e);return Rr(()=>{t.current=e}),t}const y0="data-floating-ui-safe-polygon";function jd(e,t,n){return n&&!m0(n)?0:typeof e=="number"?e:e==null?void 0:e[t]}const kI=function(e,t){let{enabled:n=!0,delay:r=0,handleClose:o=null,mouseOnly:i=!1,restMs:s=0,move:a=!0}=t===void 0?{}:t;const{open:l,onOpenChange:u,dataRef:c,events:d,elements:{domReference:f,floating:h},refs:m}=e,v=Hd(),y=f0(),p=v0(o),g=v0(r),S=N.useRef(),_=N.useRef(),w=N.useRef(),R=N.useRef(),C=N.useRef(!0),L=N.useRef(!1),B=N.useRef(()=>{}),I=N.useCallback(()=>{var O;const M=(O=c.current.openEvent)==null?void 0:O.type;return(M==null?void 0:M.includes("mouse"))&&M!=="mousedown"},[c]);N.useEffect(()=>{if(!n)return;function O(){clearTimeout(_.current),clearTimeout(R.current),C.current=!0}return d.on("dismiss",O),()=>{d.off("dismiss",O)}},[n,d]),N.useEffect(()=>{if(!n||!p.current||!l)return;function O(){I()&&u(!1)}const M=vn(h).documentElement;return M.addEventListener("mouseleave",O),()=>{M.removeEventListener("mouseleave",O)}},[h,l,u,n,p,c,I]);const V=N.useCallback(function(O){O===void 0&&(O=!0);const M=jd(g.current,"close",S.current);M&&!w.current?(clearTimeout(_.current),_.current=setTimeout(()=>u(!1),M)):O&&(clearTimeout(_.current),u(!1))},[g,u]),$=N.useCallback(()=>{B.current(),w.current=void 0},[]),F=N.useCallback(()=>{if(L.current){const O=vn(m.floating.current).body;O.style.pointerEvents="",O.removeAttribute(y0),L.current=!1}},[m]);return N.useEffect(()=>{if(!n)return;function O(){return c.current.openEvent?["click","mousedown"].includes(c.current.openEvent.type):!1}function M(T){if(clearTimeout(_.current),C.current=!1,i&&!m0(S.current)||s>0&&jd(g.current,"open")===0)return;c.current.openEvent=T;const P=jd(g.current,"open",S.current);P?_.current=setTimeout(()=>{u(!0)},P):u(!0)}function D(T){if(O())return;B.current();const P=vn(h);if(clearTimeout(R.current),p.current){l||clearTimeout(_.current),w.current=p.current({...e,tree:v,x:T.clientX,y:T.clientY,onClose(){F(),$(),V()}});const U=w.current;P.addEventListener("mousemove",U),B.current=()=>{P.removeEventListener("mousemove",U)};return}V()}function A(T){O()||p.current==null||p.current({...e,tree:v,x:T.clientX,y:T.clientY,onClose(){F(),$(),V()}})(T)}if(Jt(f)){const T=f;return l&&T.addEventListener("mouseleave",A),h==null||h.addEventListener("mouseleave",A),a&&T.addEventListener("mousemove",M,{once:!0}),T.addEventListener("mouseenter",M),T.addEventListener("mouseleave",D),()=>{l&&T.removeEventListener("mouseleave",A),h==null||h.removeEventListener("mouseleave",A),a&&T.removeEventListener("mousemove",M),T.removeEventListener("mouseenter",M),T.removeEventListener("mouseleave",D)}}},[f,h,n,e,i,s,a,V,$,F,u,l,v,g,p,c]),Rr(()=>{var O;if(n&&l&&(O=p.current)!=null&&O.__options.blockPointerEvents&&I()){const A=vn(h).body;if(A.setAttribute(y0,""),A.style.pointerEvents="none",L.current=!0,Jt(f)&&h){var M,D;const T=f,P=v==null||(M=v.nodesRef.current.find(U=>U.id===y))==null||(D=M.context)==null?void 0:D.elements.floating;return P&&(P.style.pointerEvents=""),T.style.pointerEvents="auto",h.style.pointerEvents="auto",()=>{T.style.pointerEvents="",h.style.pointerEvents=""}}}},[n,l,y,h,f,v,p,c,I]),Rr(()=>{l||(S.current=void 0,$(),F())},[l,$,F]),N.useEffect(()=>()=>{$(),clearTimeout(_.current),clearTimeout(R.current),F()},[n,$,F]),N.useMemo(()=>{if(!n)return{};function O(M){S.current=M.pointerType}return{reference:{onPointerDown:O,onPointerEnter:O,onMouseMove(){l||s===0||(clearTimeout(R.current),R.current=setTimeout(()=>{C.current||u(!0)},s))}},floating:{onMouseEnter(){clearTimeout(_.current)},onMouseLeave(){d.emit("dismiss",{type:"mouseLeave",data:{returnFocus:!1}}),V(!1)}}}},[d,n,s,l,u,V])};function Gd(){return Gd=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},Gd.apply(this,arguments)}function E0(e){let t=e.activeElement;for(;((n=t)==null||(r=n.shadowRoot)==null?void 0:r.activeElement)!=null;){var n,r;t=t.shadowRoot.activeElement}return t}function Yd(e,t){if(!e||!t)return!1;const n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&bI(n)){let r=t;do{if(r&&e===r)return!0;r=r.parentNode||r.host}while(r)}return!1}function Wd(e,t){let n=e.filter(o=>{var i;return o.parentId===t&&((i=o.context)==null?void 0:i.open)})||[],r=n;for(;r.length;)r=e.filter(o=>{var i;return(i=r)==null?void 0:i.some(s=>{var a;return o.parentId===s.id&&((a=o.context)==null?void 0:a.open)})})||[],n=n.concat(r);return n}function PI(e){return"composedPath"in e?e.composedPath()[0]:e.target}const S0=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function _0(e,t){const n=Wy(e,S0());t==="prev"&&n.reverse();const r=n.indexOf(E0(vn(e)));return n.slice(r+1)[0]}function MI(){return _0(document.body,"next")}function UI(){return _0(document.body,"prev")}function Kd(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!Yd(n,r)}function FI(e){Wy(e,S0()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function VI(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}const BI=Of["useInsertionEffect".toString()]||(e=>e());function Qd(e){const t=N.useRef(()=>{});return BI(()=>{t.current=e}),N.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}const w0={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0};let Xd,qd;function R0(e){e.key==="Tab"&&(Xd=e.target,clearTimeout(qd))}function $I(e){const t=Xd===e.relatedTarget;return Xd=e.relatedTarget,clearTimeout(qd),t}const N0=N.forwardRef(function(t,n){const r=Qd(t.onFocus),[o,i]=N.useState();return Rr(()=>(g0()&&i("button"),document.addEventListener("keydown",R0),()=>{document.removeEventListener("keydown",R0)}),[]),N.createElement("span",Gd({},t,{ref:n,tabIndex:0,role:o,"aria-hidden":o?void 0:!0,"data-floating-ui-focus-guard":"",style:w0,onFocus:s=>{g0()&&DI()&&!$I(s)?(s.persist(),qd=window.setTimeout(()=>{r(s)},50)):r(s)}}))}),O0=N.createContext(null),HI=function(e){let{id:t,enabled:n=!0}=e===void 0?{}:e;const[r,o]=N.useState(null),i=$d(),s=jI();return Rr(()=>{if(!n)return;const a=t?document.getElementById(t):null;if(a)a.setAttribute("data-floating-ui-portal",""),o(a);else{const l=document.createElement("div");t!==""&&(l.id=t||i),l.setAttribute("data-floating-ui-portal",""),o(l);const u=(s==null?void 0:s.portalNode)||document.body;return u.appendChild(l),()=>{u.removeChild(l)}}},[t,s,i,n]),r},zI=e=>{let{children:t,id:n,root:r=null,preserveTabOrder:o=!0}=e;const i=HI({id:n,enabled:!r}),[s,a]=N.useState(null),l=N.useRef(null),u=N.useRef(null),c=N.useRef(null),d=N.useRef(null),f=!!s&&!s.modal&&!!(r||i)&&o;return N.useEffect(()=>{if(!i||!o||s!=null&&s.modal)return;function h(m){i&&Kd(m)&&(m.type==="focusin"?VI:FI)(i)}return i.addEventListener("focusin",h,!0),i.addEventListener("focusout",h,!0),()=>{i.removeEventListener("focusin",h,!0),i.removeEventListener("focusout",h,!0)}},[i,o,s==null?void 0:s.modal]),N.createElement(O0.Provider,{value:N.useMemo(()=>({preserveTabOrder:o,beforeOutsideRef:l,afterOutsideRef:u,beforeInsideRef:c,afterInsideRef:d,portalNode:i,setFocusManagerState:a}),[o,i])},f&&i&&N.createElement(N0,{"data-type":"outside",ref:l,onFocus:h=>{if(Kd(h,i)){var m;(m=c.current)==null||m.focus()}else{const v=UI()||(s==null?void 0:s.refs.domReference.current);v==null||v.focus()}}}),f&&i&&N.createElement("span",{"aria-owns":i.id,style:w0}),r?Ur.createPortal(t,r):i?Ur.createPortal(t,i):null,f&&i&&N.createElement(N0,{"data-type":"outside",ref:u,onFocus:h=>{if(Kd(h,i)){var m;(m=d.current)==null||m.focus()}else{const v=MI()||(s==null?void 0:s.refs.domReference.current);v==null||v.focus(),s!=null&&s.closeOnFocusOut&&(s==null||s.onOpenChange(!1))}}}))},jI=()=>N.useContext(O0);function vl(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}const GI={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},YI={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},WI=function(e){var t,n;return e===void 0&&(e=!0),{escapeKeyBubbles:typeof e=="boolean"?e:(t=e.escapeKey)!=null?t:!0,outsidePressBubbles:typeof e=="boolean"?e:(n=e.outsidePress)!=null?n:!0}},KI=function(e,t){let{open:n,onOpenChange:r,events:o,nodeId:i,elements:{reference:s,domReference:a,floating:l},dataRef:u}=e,{enabled:c=!0,escapeKey:d=!0,outsidePress:f=!0,outsidePressEvent:h="pointerdown",referencePress:m=!1,referencePressEvent:v="pointerdown",ancestorScroll:y=!1,bubbles:p=!0}=t===void 0?{}:t;const g=Hd(),S=f0()!=null,_=Qd(typeof f=="function"?f:()=>!1),w=typeof f=="function"?_:f,R=N.useRef(!1),{escapeKeyBubbles:C,outsidePressBubbles:L}=WI(p);return N.useEffect(()=>{if(!n||!c)return;u.current.__escapeKeyBubbles=C,u.current.__outsidePressBubbles=L;function B(O){if(O.key==="Escape"){const M=g?Wd(g.nodesRef.current,i):[];if(M.length>0){let D=!0;if(M.forEach(A=>{var T;if((T=A.context)!=null&&T.open&&!A.context.dataRef.current.__escapeKeyBubbles){D=!1;return}}),!D)return}o.emit("dismiss",{type:"escapeKey",data:{returnFocus:{preventScroll:!1}}}),r(!1)}}function I(O){const M=R.current;if(R.current=!1,M||typeof w=="function"&&!w(O))return;const D=PI(O);if(h0(D)&&l){const P=l.ownerDocument.defaultView||window,U=D.scrollWidth>D.clientWidth,H=D.scrollHeight>D.clientHeight;let j=H&&O.offsetX>D.clientWidth;if(H&&P.getComputedStyle(D).direction==="rtl"&&(j=O.offsetX<=D.offsetWidth-D.clientWidth),j||U&&O.offsetY>D.clientHeight)return}const A=g&&Wd(g.nodesRef.current,i).some(P=>{var U;return vl(O,(U=P.context)==null?void 0:U.elements.floating)});if(vl(O,l)||vl(O,a)||A)return;const T=g?Wd(g.nodesRef.current,i):[];if(T.length>0){let P=!0;if(T.forEach(U=>{var H;if((H=U.context)!=null&&H.open&&!U.context.dataRef.current.__outsidePressBubbles){P=!1;return}}),!P)return}o.emit("dismiss",{type:"outsidePress",data:{returnFocus:S?{preventScroll:!0}:AI(O)||LI(O)}}),r(!1)}function V(){r(!1)}const $=vn(l);d&&$.addEventListener("keydown",B),w&&$.addEventListener(h,I);let F=[];return y&&(Jt(a)&&(F=qn(a)),Jt(l)&&(F=F.concat(qn(l))),!Jt(s)&&s&&s.contextElement&&(F=F.concat(qn(s.contextElement)))),F=F.filter(O=>{var M;return O!==((M=$.defaultView)==null?void 0:M.visualViewport)}),F.forEach(O=>{O.addEventListener("scroll",V,{passive:!0})}),()=>{d&&$.removeEventListener("keydown",B),w&&$.removeEventListener(h,I),F.forEach(O=>{O.removeEventListener("scroll",V)})}},[u,l,a,s,d,w,h,o,g,i,n,r,y,c,C,L,S]),N.useEffect(()=>{R.current=!1},[w,h]),N.useMemo(()=>c?{reference:{[GI[v]]:()=>{m&&(o.emit("dismiss",{type:"referencePress",data:{returnFocus:!1}}),r(!1))}},floating:{[YI[h]]:()=>{R.current=!0}}}:{},[c,o,m,h,v,r])},QI=function(e,t){let{open:n,onOpenChange:r,dataRef:o,events:i,refs:s,elements:{floating:a,domReference:l}}=e,{enabled:u=!0,keyboardOnly:c=!0}=t===void 0?{}:t;const d=N.useRef(""),f=N.useRef(!1),h=N.useRef();return N.useEffect(()=>{if(!u)return;const v=vn(a).defaultView||window;function y(){!n&&h0(l)&&l===E0(vn(l))&&(f.current=!0)}return v.addEventListener("blur",y),()=>{v.removeEventListener("blur",y)}},[a,l,n,u]),N.useEffect(()=>{if(!u)return;function m(v){(v.type==="referencePress"||v.type==="escapeKey")&&(f.current=!0)}return i.on("dismiss",m),()=>{i.off("dismiss",m)}},[i,u]),N.useEffect(()=>()=>{clearTimeout(h.current)},[]),N.useMemo(()=>u?{reference:{onPointerDown(m){let{pointerType:v}=m;d.current=v,f.current=!!(v&&c)},onMouseLeave(){f.current=!1},onFocus(m){var v;f.current||m.type==="focus"&&((v=o.current.openEvent)==null?void 0:v.type)==="mousedown"&&o.current.openEvent&&vl(o.current.openEvent,l)||(o.current.openEvent=m.nativeEvent,r(!0))},onBlur(m){f.current=!1;const v=m.relatedTarget,y=Jt(v)&&v.hasAttribute("data-floating-ui-focus-guard")&&v.getAttribute("data-type")==="outside";h.current=setTimeout(()=>{Yd(s.floating.current,v)||Yd(l,v)||y||r(!1)})}}}:{},[u,c,l,s,o,r])};function x0(e){return N.useMemo(()=>e.every(t=>t==null)?null:t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})},e)}const XI=function(e,t){let{open:n}=e,{enabled:r=!0,role:o="dialog"}=t===void 0?{}:t;const i=$d(),s=$d();return N.useMemo(()=>{const a={id:i,role:o};return r?o==="tooltip"?{reference:{"aria-describedby":n?i:void 0},floating:a}:{reference:{"aria-expanded":n?"true":"false","aria-haspopup":o==="alertdialog"?"dialog":o,"aria-controls":n?i:void 0,...o==="listbox"&&{role:"combobox"},...o==="menu"&&{id:s}},floating:{...a,...o==="menu"&&{"aria-labelledby":s}}}:{}},[r,o,n,i,s])};function qI(e){e===void 0&&(e={});const{open:t=!1,onOpenChange:n,nodeId:r}=e,o=RI(e),i=Hd(),s=N.useRef(null),a=N.useRef({}),l=N.useState(()=>xI())[0],[u,c]=N.useState(null),d=N.useCallback(p=>{const g=Jt(p)?{getBoundingClientRect:()=>p.getBoundingClientRect(),contextElement:p}:p;o.refs.setReference(g)},[o.refs]),f=N.useCallback(p=>{(Jt(p)||p===null)&&(s.current=p,c(p)),(Jt(o.refs.reference.current)||o.refs.reference.current===null||p!==null&&!Jt(p))&&o.refs.setReference(p)},[o.refs]),h=N.useMemo(()=>({...o.refs,setReference:f,setPositionReference:d,domReference:s}),[o.refs,f,d]),m=N.useMemo(()=>({...o.elements,domReference:u}),[o.elements,u]),v=Qd(n),y=N.useMemo(()=>({...o,refs:h,elements:m,dataRef:a,nodeId:r,events:l,open:t,onOpenChange:v}),[o,r,l,t,v,h,m]);return Rr(()=>{const p=i==null?void 0:i.nodesRef.current.find(g=>g.id===r);p&&(p.context=y)}),N.useMemo(()=>({...o,context:y,refs:h,reference:f,positionReference:d}),[o,h,y,f,d])}function Zd(e,t,n){const r=new Map;return{...n==="floating"&&{tabIndex:-1},...e,...t.map(o=>o?o[n]:null).concat(e).reduce((o,i)=>(i&&Object.entries(i).forEach(s=>{let[a,l]=s;if(a.indexOf("on")===0){if(r.has(a)||r.set(a,[]),typeof l=="function"){var u;(u=r.get(a))==null||u.push(l),o[a]=function(){for(var c,d=arguments.length,f=new Array(d),h=0;h<d;h++)f[h]=arguments[h];(c=r.get(a))==null||c.forEach(m=>m(...f))}}}else o[a]=l}),o),{})}}const ZI=function(e){e===void 0&&(e=[]);const t=e,n=N.useCallback(i=>Zd(i,e,"reference"),t),r=N.useCallback(i=>Zd(i,e,"floating"),t),o=N.useCallback(i=>Zd(i,e,"item"),e.map(i=>i==null?void 0:i.item));return N.useMemo(()=>({getReferenceProps:n,getFloatingProps:r,getItemProps:o}),[n,r,o])};function JI({initialOpen:e=!1,placement:t="top",open:n,onOpenChange:r,role:o="tooltip"}={}){const i=pt.useRef(null),[s,a]=pt.useState(e),l=n??s,u=r??a,c=qI({placement:t,open:l,onOpenChange:u,whileElementsMounted:SI,strategy:"fixed",middleware:[hI(8),pI({fallbackPlacements:["top","bottom","left","right"]}),mI({padding:8}),wI({element:i})]}),d=c.context,f=kI(d,{move:!1,enabled:n==null}),h=QI(d,{enabled:n==null}),m=KI(d),v=XI(d,{role:o}),y=ZI([f,h,m,v]);return pt.useMemo(()=>({open:l,setOpen:u,arrowRef:i,...y,...c}),[l,u,y,c])}const T0=pt.createContext(null),Jd=()=>{const e=pt.useContext(T0);if(e==null)throw new Error("Tooltip components must be wrapped in <Tooltip />");return e},eb=({children:e,...t})=>{const n=JI(t);return E(T0.Provider,{value:n,children:e})},tb={top:"-bottom-1 before:border-t-0 before:border-l-0",bottom:"-top-1 before:border-b-0 before:border-r-0",left:"-right-1 before:border-r-0 before:border-t-0",right:"-left-1 before:border-l-0 before:border-b-0"},nb=()=>{var s,a;const e=Jd(),[t,n]=N.useState(e.middlewareData.arrow);N.useEffect(()=>{e.middlewareData.arrow&&n(e.middlewareData.arrow)},[e.middlewareData.arrow]);const r={left:(t==null?void 0:t.x)!==null?`${t==null?void 0:t.x}px`:"",top:(t==null?void 0:t.y)!==null?`${t==null?void 0:t.y}px`:""},o=((a=(s=e.placement)==null?void 0:s.split("-"))==null?void 0:a[0])||"top",i=`${tb[o]}`;return E("div",{ref:e.arrowRef,style:r,className:`tooltip-arrow absolute h-2 w-2 rotate-45 bg-inherit
65
65
  before:absolute before:h-2 before:w-2 before:border before:border-foreground/30 before:content-['']
66
- ${i}`})},rb=pt.forwardRef(function(t,n){var l;const r=ee(u=>u.rootElementId),o=N.useRef(null),i=ef(),s=document.getElementById(r);if(s&&!o.current&&(o.current=(l=s.shadowRoot)==null?void 0:l.getRootNode()),!o.current)throw new Error(`shadowRoot id:${r} not found. Floating portal cannot be rendered`);const a=x0([i.refs.setFloating,n]);return E(zI,{root:o.current,children:i.open&&k("div",{className:"relative max-w-md rounded-md bg-foreground p-2 text-sm leading-4 text-background shadow-sm",ref:a,style:{position:i.strategy,top:i.y??0,left:i.x??0,visibility:i.x==null?"hidden":"visible",...t.style},...i.getFloatingProps(t),children:[t.children,E(nb,{})]})})}),ob=pt.forwardRef(function({children:t,asChild:n=!1,...r},o){const i=ef(),s=x0([i.refs.setReference,o,t==null?void 0:t.ref]);return n&&pt.isValidElement(t)?pt.cloneElement(t,i.getReferenceProps({ref:s,...r,...t.props,"data-state":i.open?"open":"closed"})):E("button",{ref:s,"data-state":i.open?"open":"closed",...i.getReferenceProps(r),children:t})}),Nr=({asChild:e=!0,children:t,placement:n="top",trigger:r=E(Fe,{tag:"circle-info"}),...o})=>k(eb,{...o,placement:n,children:[E(ob,{asChild:e,children:r}),E(rb,{children:t})]}),ib=({dragging:e,id:t,isConnectable:n,selected:r})=>E(Ge,{id:t,isConnectable:n,missingRequiredEntry:!1,nodeTitle:"Answer Call",selected:r,showDelete:!e,children:E(Xt,{id:t,isConnectable:n,color:"positive"})}),sb=({id:e,data:t,dragging:n,isConnectable:r,selected:o})=>E(Ge,{id:e,isConnectable:r,missingRequiredEntry:t.missingRequiredParams,nodeTitle:b(x.CONDITIONS),selected:o,showDelete:!n,children:k(es,{children:[t.options.map((i,s)=>{const a=Boolean(i.value);return E(mn,{color:"positive",enabled:a,id:i.id,isConnectable:r,optionText:b(x.COND_NUMBER,{index:s+1})},i.id)}),E(mn,{color:"negative",id:t.fallback,isConnectable:r,optionText:b(x.ELSE)})]})}),ab=({data:e,dragging:t,id:n,isConnectable:r,selected:o})=>{var i;return E(Ge,{id:n,isConnectable:r,missingRequiredEntry:e.missingRequiredParams,nodeTitle:b(x.REQUEST),selected:o,showDelete:!t,children:k(es,{children:[(i=e==null?void 0:e.options)==null?void 0:i.map((s,a)=>E(mn,{color:"positive",enabled:Boolean(s.value),id:s.id,isConnectable:r,optionText:b(x.OPT_NUMBER,{index:a+1})},s.id)),E(mn,{color:"negative",id:e.fallback,isConnectable:r,optionText:b(x.ELSE)}),E(mn,{color:"negative",id:e.error,isConnectable:r,optionText:b(x.FAILURE)})]})})},lb={success:x.SUCCESS,noAnswer:x.NO_ANSWER,busy:x.BUSY,decline:x.DECLINE,error:x.ERROR},ub={address:x.FORWARD_TO_ADDRESS,phone:x.FORWARD_TO_PHONE,resource:x.FORWARD_TO_RESOURCE},tf=({id:e,data:t,dragging:n,isConnectable:r,selected:o})=>k(Ge,{id:e,isConnectable:r,missingRequiredEntry:t.missingRequiredParams,nodeTitle:b(ub[t.destinationType]),selected:o,showDelete:!n,children:[t.destinations.length>0?E("section",{className:"p-4 pt-2",children:E("ul",{className:"space-y-2",children:t.destinations.map((i,s)=>E("li",{className:"text-sm",children:i},`node-${i}-${s}`))})}):null,E(es,{children:t.options.map(i=>E(mn,{id:i.id,optionText:b(lb[i.result]),color:oy(i.result),isConnectable:r},i.id))})]}),cb=({id:e,data:t,dragging:n,isConnectable:r,selected:o})=>E(Ge,{id:e,isConnectable:r,missingRequiredEntry:t.missingRequiredParams,nodeTitle:"Gather Input",selected:o,showDelete:!n,children:k(es,{children:[t.options.map((i,s)=>{const a=Boolean(i.command||i.digit);return E(mn,{color:"positive",enabled:a,id:i.id,isConnectable:r,optionText:b(x.OPT_NUMBER,{index:s+1})},i.id)}),t.results.map(i=>E(mn,{color:"negative",id:i.id,isConnectable:r,optionText:i.result==="no_input"?b(x.NO_INPUT):b(x.UNKNOWN)},i.id))]})}),db=({id:e,isConnectable:t,selected:n})=>E(Ge,{allowDelete:!1,id:e,isConnectable:t,nodeTitle:b(x.HANDLE_CALL),selected:n,showDelete:!1,showValidation:!1,target:!1,children:E(Xt,{id:e,color:"positive",isConnectable:t})}),nf={busy:x.BUSY,decline:x.DECLINE,hangup:x.HANG_UP},fb=({data:e,dragging:t,id:n,isConnectable:r,selected:o})=>E(Ge,{id:n,isConnectable:r,missingRequiredEntry:!1,nodeTitle:b(x.HANG_UP_CALL),selected:o,showDelete:!t,children:e.reason&&E("section",{className:"p-4 pt-2",children:E("p",{children:b(nf[e.reason])})})}),pb=e=>{try{return new URL(e).pathname.split("/").at(-1)}catch{return""}},hb=({data:e,dragging:t,id:n,isConnectable:r,selected:o})=>{let i=e.selected&&e[e.selected];return i&&e.selected==="url"&&(i=pb(i)||"Play Audio"),k(Ge,{id:n,isConnectable:r,missingRequiredEntry:e.missingRequiredParams,nodeTitle:b(x.PLAY_AUDIO_TTS),selected:o,showDelete:!t,children:[i&&E("div",{className:"max-w-[300px] p-4 pt-0",children:e.selected==="url"?E("a",{className:"break-words text-primary underline line-clamp-3",href:e.url,target:"_blank",rel:"noopener noreferrer",children:i}):E("p",{className:"break-words line-clamp-3",children:i})}),E(Xt,{id:n,isConnectable:r})]})},gb=({data:e,dragging:t,id:n,isConnectable:r,selected:o})=>{const{label:i,missingRequiredParams:s}=e;return k(Ge,{id:n,isConnectable:r,missingRequiredEntry:s,nodeTitle:b(x.RECORD_CALL_START),selected:o,showDelete:!t,children:[i&&E("section",{className:"whitespace-nowrap px-4 pb-4 text-sm",children:i}),E(Xt,{id:n,isConnectable:r,color:"positive"})]})},mb=({data:e,dragging:t,id:n,isConnectable:r,selected:o})=>{var a;const i=(a=Kn(l=>l.entries))==null?void 0:a.find(l=>l.controlId===e.controlId),s=i==null?void 0:i.label;return k(Ge,{id:n,isConnectable:r,missingRequiredEntry:!s,nodeTitle:b(x.RECORD_CALL_STOP),selected:o,showDelete:!t,children:[s&&E("section",{className:"whitespace-nowrap px-4 pb-4 text-sm",children:s}),E(Xt,{id:n,color:"positive",isConnectable:r})]})},vb=({data:e,dragging:t,id:n,isConnectable:r,selected:o})=>E(Ge,{id:n,isConnectable:r,missingRequiredEntry:e.missingRequiredParams,nodeTitle:b(x.VOICEMAIL_RECORDING),selected:o,showDelete:!t,children:E(Xt,{id:n,isConnectable:r,color:"positive"})}),yb={success:x.SUCCESS,failed:x.FAILED},Eb={answer:ib,cond:sb,condRequest:ab,forwardAddress:tf,forwardPhone:tf,forwardResource:tf,handleCall:db,hangup:fb,play:hb,promptPlay:cb,record:vb,recordCallStart:gb,recordCallStop:mb,request:({data:e,dragging:t,id:n,isConnectable:r,selected:o})=>{var i;return k(Ge,{id:n,isConnectable:r,missingRequiredEntry:e.missingRequiredParams,nodeTitle:b(x.REQUEST),selected:o,showDelete:!t,children:[E("p",{className:"pl-4 pb-1 text-sm text-foreground/70",children:b(x.DEPRECATED)}),E(es,{children:(i=e==null?void 0:e.options)==null?void 0:i.map(s=>E(mn,{id:s.id,optionText:b(yb[s.result]),color:oy(s.result),isConnectable:r},s.id))})]})},sendSms:({data:e,dragging:t,id:n,isConnectable:r,selected:o})=>k(Ge,{id:n,isConnectable:r,missingRequiredEntry:e.missingRequiredParams,nodeTitle:b(x.SEND_SMS),selected:o,showDelete:!t,children:[(e.body||e.toNumber)&&k("div",{className:"max-w-[300px] p-4 pt-0",children:[e.fromNumber&&k("p",{className:`whitespace-nowrap ${e.body?"pb-2":""}`,children:[b(x.FROM),": ",e.fromNumber]}),e.toNumber&&k("p",{className:`whitespace-nowrap ${e.body?"pb-2":""}`,children:[b(x.TO),": ",e.toNumber]}),e.body&&E("p",{className:"break-words pt-1 line-clamp-3",children:e.body})]}),E(Xt,{id:n,isConnectable:r})]}),set:({id:e,data:t,dragging:n,isConnectable:r,selected:o})=>k(Ge,{id:e,isConnectable:r,missingRequiredEntry:t.missingRequiredParams,nodeTitle:b(x.SET_VARIABLES),selected:o,showDelete:!n,children:[t.variables.length>0&&E("div",{className:"flow-root",children:E("div",{className:"inline-block p-4 pt-0 align-middle",children:k("table",{className:"w-80 table-fixed divide-y divide-foreground/10",children:[E("thead",{children:k("tr",{children:[E("th",{scope:"col",className:"py-3.5 text-left text-sm font-semibold",children:b(x.KEY)}),E("th",{scope:"col",className:"px-2 py-3.5 text-left text-sm font-semibold",children:b(x.VALUE)})]})}),E("tbody",{className:"divide-y divide-foreground/10 bg-background text-sm",children:t.variables.map(i=>i.key?k("tr",{children:[E("td",{className:"overflow-hidden text-ellipsis whitespace-nowrap py-2 text-sm",children:i.key}),E("td",{className:"overflow-hidden text-ellipsis whitespace-nowrap break-all px-2 py-2 text-sm",children:i.value})]},i.id):null)})]})})}),E(Xt,{id:e,isConnectable:r,color:"positive"})]}),unset:({id:e,data:t,dragging:n,isConnectable:r,selected:o})=>{const i=ee(s=>s.partialUpdateNodeData);return N.useEffect(()=>{const s=Er.subscribe(a=>{const u=Array.from(a.variables.values()).reduce((c,d)=>{const f=t.variables.find(h=>h.setId===d.id);return f&&c.push({...f,key:d.key}),c},[]);i(e,{variables:u,missingRequiredParams:u.length===0})});return()=>s()},[i,e,t.variables]),E(Ge,{id:e,isConnectable:r,missingRequiredEntry:t.missingRequiredParams,nodeTitle:b(x.UNSET_VARIABLES),selected:o,showDelete:!n,children:E(Xt,{id:e,isConnectable:r,color:"positive"})})}},Sb={floating:bC},_b={duration:1e3,includeHiddenNodes:!0,padding:.3},wb=e=>({edges:e.edges,nodes:e.nodes,addNode:e.addNode,onConnect:e.onConnect,onConnectEnd:e.onConnectEnd,onConnectStart:e.onConnectStart,onEdgesChange:e.onEdgesChange,onEdgesDelete:e.onEdgesDelete,onEdgeUpdate:e.onEdgeUpdate,onEdgeUpdateEnd:e.onEdgeUpdateEnd,onEdgeUpdateStart:e.onEdgeUpdateStart,onInit:e.onInit,onNodeDragStart:e.onNodeDragStart,onNodeDragStop:e.onNodeDragStop,onNodesChange:e.onNodesChange,onNodesDelete:e.onNodesDelete,onSelectionChange:e.onSelectionChange}),Rb=({children:e})=>{const t=N.useRef(null),{edges:n,nodes:r,addNode:o,onConnect:i,onConnectEnd:s,onConnectStart:a,onEdgesChange:l,onEdgesDelete:u,onEdgeUpdate:c,onEdgeUpdateEnd:d,onEdgeUpdateStart:f,onInit:h,onNodeDragStart:m,onNodeDragStop:v,onNodesChange:y,onNodesDelete:p,onSelectionChange:g}=ee(wb,ze),S=N.useCallback(w=>{w.preventDefault(),w.target instanceof HTMLElement&&w.target.draggable&&(w.dataTransfer.dropEffect="move")},[]),_=N.useCallback(w=>{if(w.preventDefault(),!t.current)return Ze().warn("reactFlowWrapper not available yet");const R=w.dataTransfer.getData(ty);if(!R)return Ze().warn("nodeType not valid");const C=t.current.getBoundingClientRect();o({nodeType:R,x:w.clientX-C.left,y:w.clientY-C.top})},[o]);return E("div",{className:"bg-sw-white !h-auto w-full",ref:t,children:E(qv,{connectionLineComponent:TC,connectionMode:Hn.Strict,deleteKeyCode:"Shift+Backspace",defaultEdgeOptions:ry,edges:n,edgeTypes:Sb,fitView:!0,fitViewOptions:_b,nodes:r,nodeTypes:Eb,onConnect:i,onConnectEnd:s,onConnectStart:a,onDragOver:S,onDrop:_,onEdgesChange:l,onEdgesDelete:u,onEdgeUpdate:c,onEdgeUpdateEnd:d,onEdgeUpdateStart:f,onInit:h,onNodeDragStart:m,onNodeDragStop:v,onNodesChange:y,onNodesDelete:p,onSelectionChange:g,children:e})})},Nb=1e3,Ob=e=>ee.setState({initializing:e}),xb=()=>{const e=ee(i=>i.initializing),t=ee(i=>i.flowInteractive),n=xe(),r=Gx(),o=N.useCallback(i=>{n.setState({nodesDraggable:i,nodesConnectable:i,elementsSelectable:i})},[n]);N.useEffect(()=>{let i;e&&(r?(i&&clearTimeout(i),i=setTimeout(()=>{o(!0),Ob(!1)},Nb)):o(!1))},[e,r,o]),N.useEffect(()=>{e||o(t)},[e,t,o])},Rt=e=>{const[t,n]=N.useReducer((r,o)=>({...r,...o}),e);return[t,n]},Tb={deploy:x.STATUS_DEPLOY,deployed:x.STATUS_DEPLOYED,deploying:x.STATUS_DEPLOYING,error:x.STATUS_DEPLOY_ERROR},Cb=e=>({deployFlowURL:e.deployFlowURL,httpError:e.httpError,saveFlowStatus:e.saveFlowStatus,documentVersion:e.documentVersion,deployFlow:e.deployFlow}),Ib=()=>{const{httpError:e,saveFlowStatus:t,documentVersion:n,deployFlow:r,deployFlowURL:o}=ee(Cb,ze),i={error:void 0,status:"deploy",prevDocVersion:n},[s,a]=Rt(i),l=Tb[s.status],u=async()=>{try{a({status:"deploying",error:void 0}),await r(),a({status:"deployed"})}catch(m){m instanceof Error?a({status:"error",error:m.message}):a({status:"error",error:"Failed to deploy!"})}};N.useEffect(()=>{t==="saved"&&n!==s.prevDocVersion&&a({status:"deploy",prevDocVersion:n})},[s.prevDocVersion,n,t,a]);const c=Boolean(e)||t!=="saved"||s.status==="deployed"||s.status==="deploying",d=c?"text-disabled hover:bg-background hover:text-disabled":"",f=s.status==="deployed"?"text-positive":"",h=s.status==="error"?"text-negative":"";return o?k(bo,{className:`hidden sm:flex ${d} ${f} ${h}`,disabled:c,onClick:u,children:[b(l),E(Nr,{placement:"right",trigger:E("div",{className:"flex items-center justify-center pl-1",role:"tooltip",tabIndex:0,children:s.status==="error"?k(ve,{children:[E("span",{className:"sr-only",children:b(x.MORE_INFO_DEPLOY_ERROR)}),E(Fe,{tag:"circle-exclamation"})]}):k(ve,{children:[E("span",{className:"sr-only",children:b(x.MORE_INFO_DEPLOY)}),E(Fe,{tag:"up-from-bracket"})]})}),children:s.status==="error"?b(x.MORE_INFO_DEPLOY_ERROR,{message:s.error}):b(x.MORE_INFO_DEPLOY)})]}):null},bb="react-flow__controls-button",Ab="min-w-[3.625rem] cursor-auto select-auto text-center hover:bg-background active:bg-background",Lb="hidden sm:flex",C0=N.forwardRef(function({asTag:t="div",children:n,className:r="",hiddenSmallScreen:o=!1,...i},s){const a=t,u=`${bb} ${a==="button"?"":Ab} ${o?Lb:""} ${r}`;return E(a,{className:u,ref:s,...i,children:n})}),Db=()=>{const[e,t]=N.useState(!1);return E(Nr,{open:e,onOpenChange:t,placement:"bottom",role:"dialog",trigger:k(C0,{asTag:"button",onClick:()=>{t(r=>!r)},children:["Help",k("div",{className:"flex items-center justify-center pl-1",children:[E("span",{className:"sr-only",children:b(x.MORE_INFO_STATUS_ERROR)}),E(Fe,{tag:"circle-info"})]})]}),children:k("section",{className:"p-2",children:[E("h2",{className:"mb-4 text-2xl font-semibold",children:"Testing Your Call Flow"}),k("div",{className:"text-sm",children:[E("p",{children:"To test the current working version (draft) of your Call Flow, follow these steps:"}),k("ol",{className:"my-4 list-inside list-decimal",children:[k("li",{className:"mb-2 list-item",children:["Go to the settings tab of the purchased phone number you want to use for testing:  ",E("a",{className:"underline hover:text-background/80",href:"/phone_numbers",target:"_blank",rel:"noopener noreferrer",children:"Purchased Phone Numbers"})]}),k("li",{className:"mb-2",children:["Choose the appropriate Call Flow for handling your calls:  ",E("a",{className:"underline hover:text-background/80",href:"/call_flows",target:"_blank",rel:"noopener noreferrer",children:"Call Flows"})]}),E("li",{className:"mb-2",children:"Select the working version (draft) of the chosen Call Flow."}),E("li",{children:"When you make a call to the number, it should now execute the working version of your Call Flow upon answering."})]}),E("p",{className:"mt-4 mb-2",children:"In an upcoming update, you will be able to test your selected Call Flow directly from the Call Flow Builder, eliminating the need to manually associate the Call Flow with your number."})]})]})})},kb={"awaiting-save":x.STATUS_SAVING,"document-sync":x.STATUS_LOCKED,error:x.STATUS_ERROR,initial:x.STATUS_LOADING,saved:x.STATUS_SAVED,saving:x.STATUS_SAVING},I0=e=>(e.preventDefault(),e.returnValue=""),Pb=()=>{const e=ee(i=>i.saveFlowStatus),t=ee(i=>i.httpError),r=kb[t==="document-sync"?t:e],o=e==="error"||t;return N.useEffect(()=>{if(!(e==="saved"||t))return addEventListener("beforeunload",I0,{capture:!0}),()=>{removeEventListener("beforeunload",I0,{capture:!0})}},[t,e]),k(C0,{"aria-live":o?"assertive":"polite",className:`${o?"text-negative":"text-foreground"}`,hiddenSmallScreen:!0,role:o?"alert":"status",children:[E("p",{children:b(r)}),o&&E(Nr,{placement:"bottom",trigger:k("div",{className:"flex items-center justify-center pl-1",role:"tooltip",tabIndex:0,children:[E("span",{className:"sr-only",children:b(x.MORE_INFO_STATUS_ERROR)}),E(Fe,{tag:"circle-exclamation"})]}),children:b(t==="document-sync"?x.INFO_STATUS_ERROR_OUT_OF_SYNC:x.INFO_STATUS_ERROR)})]})},Mb=()=>{xb();const e=ee(i=>i.isDraggingNode),t=ee(i=>i.rootAppWidth),n=ee(i=>i.httpError),o=!Boolean(t&&t<ny)&&n!=="document-sync";return k(Zx,{className:e?"group/control-buttons":"",position:"top-left",showInteractive:o,children:[E(Pb,{}),E(Ib,{}),E(Db,{})]})},b0=/^[\w\d ']+$/,A0=/^\d+$/,L0=/^\d|\*|#$/,Ub=/^[\d|\*|#$]{0,12}$/,Fb=/^.{1,20}$/,D0=/^[a-z0-9_]{1,20}$/,yl={MIN:1,MAX:99},Or=e=>(/(?:\/\^)(.+)(?:\$\/)/.exec(e.toString())??[])[1],rf=e=>t=>Boolean(e.exec(t)),of=e=>rf(L0)(e),sf=e=>rf(b0)(e),k0=e=>rf(D0)(e),P0=e=>typeof e=="string"&&e===""||Array.isArray(e)&&e.length===0?!1:typeof e=="object"&&e!==null?Object.keys(e).length===0?!1:Object.values(e).every(P0):!0,Vb=e=>{var i;const t=N.useRef(),n=Hx(),r=e&&"options"in e.data?(i=e.data.options)==null?void 0:i.length:0;return t.current=r,{updateDynamicHandles:s=>{"options"in s&&s.options.length!==t.current&&(e&&n(e.id),t.current=s.options.length)}}},Bb=()=>({value:{id:Re(),value:""},valid:!0}),M0=e=>e.every(t=>t.valid),U0=({displayOptions:e,setDisplayData:t,handleOnUpdate:n})=>{const r=c=>{t({options:{value:c,valid:M0(c)}}),n({options:c.map(d=>d.value)})},o=c=>{c.preventDefault();const d=[...e,Bb()];r(d)},i=c=>{const d=e.filter((f,h)=>h!==c);r(d)},s=(c,d)=>c.map(h=>h.value.id===d.value.id?{...h,...d}:h),a=c=>c.map(d=>({...d.value,value:d.value.value.trim()})),l=(c,d)=>{var g;const f=e;f[c]||Ze().error(`Option not found at index ${c}`);const h=f[c],m={...h==null?void 0:h.value,...d},v=Boolean((g=m.value)==null?void 0:g.trim()),p=s(e,{value:m,valid:v});t({options:{value:p,valid:M0(p)}}),n({options:a(p)})},u=(c,d)=>{const f=c.target,{name:h,value:m}=f;switch(h){case"value":d!==void 0&&l(d,{[h]:m});break;default:Ze().error(`Unhandled input name: ${h}`)}};return E("div",{className:"divide-y divide-foreground/10",children:e.map((c,d,f)=>k("div",{className:"mb-3",children:[k("div",{className:"flex items-center",children:[E("h2",{className:"nowrap flex-1 py-4 text-sm font-medium uppercase leading-4 text-foreground/50",children:b(x.CONDITION_NUMBER,{index:d+1})}),Boolean(e.length>1)&&E(Nr,{trigger:k("button",{className:"px-2",onClick:()=>i(d),type:"button",children:[E("span",{className:"sr-only",children:b(x.REMOVE_CONDITION,{index:d+1})}),E(Fe,{tag:"xmark"})]}),children:b(x.INFO_NODE_OPTION_REMOVE)})]}),k("label",{className:"flex flex-col",children:[E("input",{className:`w-full ${c.valid?"":"invalid"}`,defaultValue:c.value.value,name:"value",onChange:h=>u(h,d),placeholder:"%{count} > 3, /hello/.test('%{foo}')",type:"text"}),E("p",{className:"requirements",role:"alert",children:b(x.ERROR_VALUE_IS_REQUIRED)})]}),d===f.length-1&&k("button",{onClick:o,type:"button",className:"mb-3 text-primary",children:["+ ",b(x.ADD_CONDITION)]})]},c.value.id))})},$b=Ze(),ss=(e,t)=>[e,t].filter(Boolean).join("-").toLowerCase(),Hb={idsByKey:{},voiceById:{},languageById:{}},zb=(e,t)=>({...Hb,init:async({voicesURL:n="/voices.json"})=>{try{$b.debug("Load voicesURL",n);const o=await(await fetch(n)).json(),i={},s={},a={};o.forEach(l=>{var y,p,g;const u=Boolean(l.premium),c=l.signalwire_id,d=l.gender.toLowerCase(),f={id:c,key:`${l.language_code}-${d}-${l.signalwire_id}`,name:`${l.friendly_name} ${u?"(premium)":""}`,gender:d,premium:u};i[c]=f,s[l.language_code]={id:l.language_code,name:l.language};const h=ss(l.language_code);h in a||(a[h]=[]),(y=a[h])==null||y.push(f);const m=ss(d);m in a||(a[m]=[]),(p=a[m])==null||p.push(f);const v=ss(l.language_code,d);v in a||(a[v]=[]),(g=a[v])==null||g.push(f)}),e({idsByKey:a,voiceById:i,languageById:s})}catch(r){console.error("Error",r)}},getVoicesByKeys:({languageId:n,gender:r})=>{const{voiceById:o,idsByKey:i}=t(),s=ss(n,r);return s?i[s]??[]:Object.values(o)},getLanguages:()=>Object.values(t().languageById),getGenderByKeys:({languageId:n})=>{var s;const{idsByKey:r}=t(),o=ss(n);if(!o)return["female","male"];const i=new Set;return(s=r[o])==null||s.forEach(a=>{a.gender&&i.add(a.gender)}),Array.from(i).sort((a,l)=>a.toLowerCase().localeCompare(l.toLowerCase()))}}),af=Ii()(zb);window.__useVoiceStore=af;const F0=e=>E("option",{value:e.id,children:e.name},e.key??e.id),jb=e=>({getLanguages:e.getLanguages,getVoicesByKeys:e.getVoicesByKeys,getGenderByKeys:e.getGenderByKeys}),Gb=({onChange:e,languageId:t,gender:n,voiceId:r})=>{const{getLanguages:o,getVoicesByKeys:i,getGenderByKeys:s}=af(jb);return k(ve,{children:[k("label",{children:[b(x.LANGUAGE),k(Mt,{className:"w-full",value:t??"",name:"language",onChange:e,children:[E("option",{value:"",children:b(x.SELECT)}),o().map(F0)]})]}),k("label",{children:[b(x.GENDER),k(Mt,{className:"w-full",value:n??"",name:"gender",onChange:e,children:[E("option",{value:"",children:b(x.SELECT)}),s({languageId:t}).map(a=>E("option",{value:a,children:a},a))]})]}),k("label",{children:[b(x.VOICE),k(Mt,{className:"w-full",value:r??"",name:"voice",onChange:e,children:[E("option",{value:"",children:b(x.SELECT)}),i({languageId:t,gender:n}).map(F0)]})]})]})},V0={url:x.PLAY_AUDIO_FILE,text:x.TEXT_TO_SPEECH},B0=({displayData:e,label:t,handleOnUpdate:n,setDisplayData:r,showDefaultOption:o})=>{var u,c;const i=e.selected.value,s=d=>{const f=d.currentTarget.value;r({selected:{value:f,valid:Boolean(f)||!o}}),n({selected:f})},a=d=>{const f=d.target,{name:h,value:m}=f,v=m.trim();let y=!0;switch(h){case"url":y=f.checkValidity(),r({[h]:{value:m,valid:y}}),n({text:"",url:y?v:""});break;case"text":y=f.checkValidity()&&v.length>0,r({[h]:{value:m,valid:y}}),n({text:y?v:"",url:""});break;default:throw new Error(`Unhandled input name: ${h}`)}},l=d=>{const f=d.target,{name:h,value:m}=f;switch(h){case"language":r({language:{value:m,valid:!0},gender:{value:void 0,valid:!0},voice:{value:void 0,valid:!0}}),n({language:m,gender:void 0,voice:void 0});break;default:r({[h]:{value:m,valid:!0}}),n({[h]:m})}};return k("div",{children:[k("label",{children:[E("span",{className:"sr-only",children:t}),k(Mt,{className:"w-full",name:"selected",onChange:s,value:i,children:[o&&E("option",{value:"",children:b(x.SELECT)}),Object.keys(V0).map(d=>E("option",{value:d,children:b(V0[d])},d))]})]}),i&&E(Yb,{name:i,onChange:a,playSettingsChangeHandler:l,required:!0,selected:i,valid:(u=e[i])==null?void 0:u.valid,value:(c=e[i])==null?void 0:c.value,displayData:e})]})},Yb=({displayData:e,name:t,onChange:n,playSettingsChangeHandler:r,required:o,selected:i,valid:s,value:a})=>{const u={url:E(Sr,{errorText:b(x.ERROR_URL_IS_REQUIRED),inputMode:"url",label:b(x.PLAY_AUDIO_FILE),name:t,onChange:n,placeholder:b(x.ENTER_URL),required:o,valid:s,value:a}),text:k(ve,{children:[E(Gb,{onChange:r,languageId:e.language.value,gender:e.gender.value,voiceId:e.voice.value}),E(Sr,{errorText:b(x.ERROR_VALUE_IS_REQUIRED),inputMode:"text",label:b(x.TEXT_TO_SPEECH),name:t,onChange:n,placeholder:b(x.WRITE_SOMETHING),required:o,valid:s,value:a})]})}[i];return E(ve,{children:u})},Wb=[{field:"stereo",title:x.STEREO,subtitle:x.STEREO_SUBTITLE},{field:"beep",title:x.BEEP,subtitle:x.BEEP_SUBTITLE}],$0=({displayData:e,handleOnUpdate:t,setDisplayData:n})=>{const r=s=>{const a=s.target.name,l=!e[a].value,u={[a]:{value:l}};n(u),t({[a]:l})},o=s=>{const a=s.target,{name:l,value:u}=a,c=a.checkValidity(),d={[l]:{value:u,valid:c}};n(d),t({[l]:c?u.trim():""})},i=s=>{const a=s.target.name,l=s.target.value,u={[a]:{value:l,valid:!0}};n(u),t({[a]:l})};return k(ve,{children:[E("div",{className:"mb-5",children:Wb.map(s=>{const a=e[s.field].value;return E("div",{children:E(Ld,{checked:a,clickHandler:r,name:s.field,subtitle:b(s.subtitle),title:b(s.title)})},s.field)})}),k("label",{children:[b(x.TERMINATORS),E("input",{className:`w-full ${e.terminators.valid?"":"invalid"}`,defaultValue:e.terminators.value||"",name:"terminators",onChange:o,pattern:Or(Ub),placeholder:"#*0",type:"text"}),E("p",{className:"requirements",role:"alert",children:b(x.ERROR_TERMINATORS)})]}),k("label",{children:[b(x.FORMAT),k(Mt,{className:"w-full",value:e.format.value,name:"format",onChange:i,children:[E("option",{value:"mp3",children:"MP3"}),E("option",{value:"wav",children:"WAV"})]})]})]})},dt=({children:e,formRef:t,info:n,handleOnChange:r=()=>null,title:o})=>E("form",{className:"flex h-full flex-col overflow-hidden",noValidate:!0,onChange:r,ref:t,children:k("div",{className:"flex flex-col overflow-hidden",children:[k("legend",{className:"mb-2 flex w-full shrink-0 items-center justify-between px-4",children:[E("span",{className:"text-lg font-semibold leading-6",children:o}),n&&E(Nr,{trigger:k("div",{role:"tooltip",tabIndex:0,children:[E("span",{className:"sr-only",children:b(x.MORE_INFO_TITLE,{title:o})}),E(Fe,{tag:"circle-info"})]}),children:n})]}),E("div",{className:"mx-1 flex-1 overflow-y-auto px-3",children:e})]})}),Kb=["GET","POST","PUT","DELETE"],Qb=e=>{console.log("bodyToTextArea",e);try{return typeof e=="string"?e:JSON.stringify(e)}catch{return e}},Xb=()=>({value:{id:Re(),value:""},valid:!0}),qb=({nodeData:e,handleOnUpdate:t})=>{const n={url:{value:e.url,valid:!0},method:{value:e.method,valid:!0},headers:{value:e.headers,valid:!0},body:{value:e.body,valid:!0},saveVariables:{value:Boolean(e.saveVariables),valid:!0},options:{value:e.options.length?e.options.map(l=>({value:l,valid:Boolean(l.value)})):[Xb()],valid:!0}},[r,o]=Rt(n),i=l=>{const u=l.target,{name:c,value:d}=u,f=typeof d=="string"?d.trim():d;let h=!0;switch(c){case"url":case"method":h=u.checkValidity()&&!!f,o({[c]:{value:d,valid:h}}),t({[c]:h?f:""});break;case"headers":if(!d){o({[c]:{value:{},valid:!0}}),t({[c]:{}});return}try{const m=JSON.parse(d);o({[c]:{valid:!0}}),t({[c]:m})}catch{o({[c]:{valid:!1}}),t({[c]:{}})}break;case"body":try{const m=JSON.parse(d);o({[c]:{value:d,valid:!0}}),t({[c]:m})}catch{o({[c]:{value:d,valid:!0}}),t({[c]:d})}break;default:throw new Error(`Unhandled input name: ${c}`)}},s=l=>{const u=l.target.name,c=l.target.value,d={[u]:c};o(d),t(d)},a=l=>{const u=l.target.name,c=!r[u].value;o({[u]:{value:c}}),t({[u]:c})};return k(dt,{info:b(x.INFO_NODE_REQUEST),title:b(x.REQUEST),children:[k("label",{children:[E("div",{children:b(x.URL)}),E("input",{className:`w-full ${r.url.valid?"":"invalid"}`,defaultValue:r.url.value,name:"url",onChange:i,placeholder:"https://user:password@example.com/api/status",required:!0,type:"text"}),E("p",{className:"requirements w-full",role:"alert",children:b(x.ERROR_VALUE_IS_REQUIRED)})]}),k("label",{className:"mb-3 block",children:[b(x.METHOD),E(Mt,{className:"w-full",value:r.method.value,name:"method",onChange:s,children:Kb.map(l=>E("option",{value:l,children:l},l))})]}),E("div",{className:"mb-4",children:E(Ld,{checked:r.saveVariables.value,clickHandler:a,name:"saveVariables",subtitle:b(x.SAVE_VARIABLES_SUBTITLE),title:b(x.SAVE_VARIABLES)})}),k("label",{children:[E("div",{children:b(x.REQUEST_HEADERS)}),E(Sr,{errorText:b(x.ERROR_INVALID_JSON),inputMode:"text",valid:Boolean(r.headers.valid),label:b(x.REQUEST_HEADERS),name:"headers",onChange:i,placeholder:'{"Content-Type": "application/json", "X-Custom-Header": "foo"}',required:!0,value:JSON.stringify(r.headers.value)})]}),k("label",{children:[E("div",{children:b(x.REQUEST_BODY)}),E(Sr,{inputMode:"text",valid:!0,label:b(x.REQUEST_BODY),name:"body",onChange:i,placeholder:"String or JSON to serialize",value:Qb(r.body.value)})]}),E(U0,{displayOptions:r.options.value,setDisplayData:o,handleOnUpdate:t})]})},as=({displayData:e,formRef:t,setCompleted:n})=>{N.useEffect(()=>{var a,l;const r=t.current,o=new FormData(r),i=Object.fromEntries(o.entries());let s=!0;for(const u of Object.keys(i)){if(((a=e[u])==null?void 0:a.valid)!==void 0&&(s=s&&Boolean((l=e[u])==null?void 0:l.valid),s)){const c=r.elements.namedItem(u);c&&"checkValidity"in c&&(s=s&&c.checkValidity())}if(!s)break}n(s)},[e,t,n])},Zb=()=>({value:{id:Re(),value:""},valid:!0}),Jb=({nodeData:e,handleOnUpdate:t})=>{const n=N.useRef(),r={options:{value:e.options.length?e.options.map(a=>({value:a,valid:Boolean(a.value)})):[Zb()],valid:!0}},[o,i]=Rt(r);return as({displayData:o,formRef:n,setCompleted:a=>{t({},a)}}),E(dt,{formRef:n,info:b(x.INFO_NODE_COND),title:b(x.CONDITIONS),children:E(U0,{displayOptions:o.options.value,handleOnUpdate:t,setDisplayData:i})})},eA={address:{info:x.INFO_NODE_FORWARD_TO_ADDRESS,title:x.FORWARD_TO_ADDRESS,call:x.CALL_ADDRESSES,single:x.SINGLE_ADDRESS,multiple:x.MULTIPLE_ADDRESSES},phone:{info:x.INFO_NODE_FORWARD_TO_PHONE,title:x.FORWARD_TO_PHONE,call:x.CALL_NUMBERS,single:x.SINGLE_NUMBER,multiple:x.MULTIPLE_NUMBERS},resource:{info:x.INFO_NODE_FORWARD_TO_RESOURCE,title:x.FORWARD_TO_RESOURCE,call:x.CALL_RESOURCES,single:x.SINGLE_RESOURCE,multiple:x.MULTIPLE_RESOURCES}},lf=({destinationType:e,nodeData:t,handleOnUpdate:n})=>{const r=N.useRef(),o=eA[e],i={single:o.single,multiple:o.multiple},s={callOrder:{value:"serial"},destinationList:{value:iT(t.destinations),valid:!0},destinationSingle:{value:t.destinations.length===1&&t.destinations[0]?t.destinations[0]:"",valid:!0},sessionTimeout:{value:t.sessionTimeout,valid:!0},type:{value:t.type??"single"}},[a,l]=Rt(s);as({displayData:a,formRef:r,setCompleted:h=>{n({},h)}});const c=h=>{const m=h.currentTarget.value,v=a.destinationSingle.value;let y="single",p=v.trim()?[v.trim()]:[];m==="multiple"&&(y=a.callOrder.value,p=Od(a.destinationList.value)),l({type:{value:y}}),n({destinations:p,type:y})},d=h=>{const m=h.currentTarget.value;l({type:{value:m}}),n({type:m})},f=h=>{const m=h.target,v=m.name,y=m.value;let p=!0;switch(v){case"destinationSingle":p=m.checkValidity()&&y.trim().length>0,l({[v]:{value:y,valid:p}}),n({destinations:p?[y.trim()]:[]});break;case"destinationList":p=m.checkValidity()&&Boolean(Od(y).length),l({[v]:{value:y,valid:p}}),n({destinations:p?Od(y):[]});break;case"sessionTimeout":p=m.checkValidity(),l({[v]:{value:y?Number.parseInt(y,10):void 0,valid:p}}),n({sessionTimeout:p&&y?Number.parseInt(y,10):void 0});break;default:throw new Error(`Unhandled input name: ${v}`)}};return k(dt,{info:b(o.info),title:b(o.title),formRef:r,children:[E("div",{className:"mb-1",children:k("label",{children:[E("span",{className:"sr-only",children:b(x.CHOOSE_OPTION_SINGLE_MULTIPLE)}),E(Mt,{className:"w-full",name:"quantity",onChange:c,value:a.type.value==="single"?"single":"multiple",children:Object.keys(i).map(h=>E("option",{value:h,children:b(i[h])},h))})]})}),E("div",{children:a.type.value==="single"?E(tA,{displayData:a,destinationType:e,handleChange:f}):E(nA,{displayData:a,destinationType:e,handleCallOrderSelectChange:d,handleChange:f,labels:o})}),e!=="phone"&&k("label",{children:[E("div",{children:b(x.DISCONNECT_CALL_AFTER_RINGING)}),k("div",{className:"flex flex-wrap items-center gap-x-2",children:[E("input",{className:`w-14 ${a.sessionTimeout.valid?"":"invalid"}`,defaultValue:a.sessionTimeout.value,min:0,name:"sessionTimeout",onChange:f,pattern:Or(A0),type:"number",inputMode:"numeric"}),b(x.SECONDS),E("p",{className:"requirements w-full",role:"alert",children:b(x.ERROR_NUMBER_IS_REQUIRED)})]})]})]})},tA=({displayData:e,destinationType:t,handleChange:n})=>k(ve,{children:[k("label",{children:[E("span",{className:"sr-only",children:b(x.SINGLE_NUMBER)}),E("input",{className:`w-full ${e.destinationSingle.valid?"":"invalid"}`,defaultValue:e.destinationSingle.value,name:"destinationSingle",onChange:n,placeholder:"+1 (204) 000 0000",required:!0,type:t==="phone"?"tel":"text"}),E("p",{className:"requirements",role:"alert",children:b(x.ERROR_VALUE_IS_REQUIRED)})]}),t!=="phone"&&E("div",{className:"mb-4 pt-4 text-xs uppercase",children:b(x.SETTINGS)})]}),nA=({displayData:e,destinationType:t,handleCallOrderSelectChange:n,handleChange:r,labels:o})=>{const i={serial:x.SEQUENTIALLY,parallel:x.SIMULTANEOUSLY};return k(ve,{children:[k("label",{children:[E("span",{className:"sr-only",children:b(x.MULTIPLE_NUMBERS)}),E("textarea",{className:`min-h-[77px] w-full ${e.destinationList.valid?"":"invalid"}`,name:"destinationList",onChange:r,placeholder:"+1 (204) 123 0000, +1 (204) 456 0000, +1 (204) 789 0000",required:!0,value:e.destinationList.value}),E("p",{className:"requirements",role:"alert",children:b(x.ERROR_VALUE_IS_REQUIRED)})]}),E("div",{className:"mb-4 pt-4 text-xs uppercase",children:b(x.SETTINGS)}),E("div",{className:`${t==="phone"?"":"mb-4"}`,children:k("label",{children:[b(o.call),E(Mt,{className:"w-full",name:"callOrder",onChange:n,value:e.type.value,children:Object.keys(i).map(s=>E("option",{value:s,children:b(i[s])},s))})]})})]})},H0=()=>({value:{id:Re(),command:"",digit:""},valid:!0}),uf=e=>e.every(t=>t.valid),rA=({nodeData:e,handleOnUpdate:t})=>{const n=N.useRef(),r={initialTimeout:{value:e.initialTimeout??5,valid:!0},url:{value:e.url,valid:!0},text:{value:e.text,valid:!0},voice:{value:e.voice,valid:!0},gender:{value:e.gender,valid:!0},language:{value:e.language,valid:!0},selected:{value:e.selected||"text",valid:!0},options:{value:e.options.length?e.options.map(m=>({value:m,valid:Boolean(m.command||m.digit)})):[H0()],valid:!0}},[o,i]=Rt(r);as({displayData:o,formRef:n,setCompleted:m=>{t({},m)}});const a=m=>{m.preventDefault();const v=[...o.options.value,H0()];i({options:{value:v,valid:uf(v)}}),t({options:v.map(y=>y.value)})},l=m=>{const y=o.options.value.filter((p,g)=>g!==m);i({options:{value:y,valid:uf(y)}}),t({options:y.map(p=>p.value)})},u=(m,v)=>m.map(p=>p.value.id===v.value.id?{...p,...v}:p),c=m=>m.map(v=>{const y=v.value.command.trim(),p=v.value.digit.trim();return{...v.value,command:sf(y)?y:"",digit:of(p)?p:""}}),d=(m,v)=>{const y=o.options.value;if(!y[m])throw new Error(`Option not found at index ${m}`);const p=y[m],g={...p==null?void 0:p.value,...v},S=g.command.trim(),_=g.digit.trim(),w=Boolean(S)&&sf(S)||Boolean(_)&&of(_),R={value:g,valid:w},C=u(o.options.value,R);i({options:{value:C,valid:uf(C)}}),t({options:c(C)})},f=(m,v)=>{const y=m.target,{name:p,value:g}=y;let S=!0;switch(p){case"digit":case"command":v!==void 0&&d(v,{[p]:g});break;case"initialTimeout":{S=y.checkValidity(),i({[p]:{value:Number.parseInt(g,10),valid:S}}),t({initialTimeout:S&&g?parseInt(g,10):5});break}default:throw new Error(`Unhandled input name: ${p}`)}},h=o.options.value;return E(dt,{formRef:n,info:b(x.INFO_NODE_GATHER_INPUT),title:b(x.GATHER_INPUT),children:k("div",{className:"divide-y divide-foreground/10",children:[E("div",{className:"mb-2",children:E(B0,{displayData:o,label:b(x.CHOOSE_OPTION_TTS_AUDIO),handleOnUpdate:t,setDisplayData:i})}),E("ul",{children:h.map((m,v,y)=>k("li",{className:"mb-3",children:[k("div",{className:"flex items-center",children:[E("h2",{className:"nowrap flex-1 py-6 text-sm font-medium uppercase leading-4 text-foreground/50",children:b(x.OPTION_NUMBER,{index:v+1})}),Boolean(h.length>1)&&E(Nr,{trigger:k("button",{className:"px-2",onClick:()=>l(v),type:"button",children:[E("span",{className:"sr-only",children:b(x.REMOVE_OPTION,{index:v+1})}),E(Fe,{tag:"xmark"})]}),children:b(x.INFO_NODE_OPTION_REMOVE)})]}),k("label",{className:"flex flex-col",children:[b(x.CALLER_PRESSES),E("input",{className:`w-1/4 ${!m.valid||m.value.digit&&!of(m.value.digit)?"invalid":""}`,defaultValue:m.value.digit,name:"digit",onChange:p=>f(p,v),pattern:Or(L0),type:"text"}),E("p",{className:"requirements",role:"alert",children:b(x.ERROR_TELEPHONE_KEY_REQUIRED)})]}),k("label",{className:"flex flex-col",children:[b(x.OR_SAYS),E("input",{className:`w-full ${!m.valid||m.value.command&&!sf(m.value.command)?"invalid":""}`,defaultValue:m.value.command,name:"command",onChange:p=>f(p,v),pattern:`${Or(b0)}|''`,type:"text"}),E("p",{className:"requirements",role:"alert",children:b(x.ERROR_TEXT_IS_REQUIRED)})]}),v===y.length-1&&k("button",{onClick:a,type:"button",className:"mb-3 text-primary",children:["+ ",b(x.ADD_OPTION)]})]},m.value.id))}),k("div",{className:"pt-6",children:[E("h2",{className:"pb-6 text-sm uppercase leading-4 text-foreground/50",children:b(x.SETTINGS)}),k("label",{children:[E("div",{className:"w-full",children:b(x.WAIT_FOR_INPUT)}),k("div",{className:"flex flex-wrap items-center gap-x-2",children:[E("input",{className:`w-14 ${o.initialTimeout.valid?"":"invalid"}`,defaultValue:o.initialTimeout.value,min:yl.MIN,max:yl.MAX,name:"initialTimeout",onChange:f,pattern:Or(A0),type:"number",inputMode:"numeric"}),b(x.SECONDS),E("p",{className:"requirements w-full",role:"alert",children:b(x.ERROR_NUMBER_MIN_MAX_IS_REQUIRED,{min:yl.MIN,max:yl.MAX})})]})]})]})]})})},oA=({nodeData:e,handleOnChange:t})=>E(dt,{handleOnChange:t,info:b(x.INFO_NODE_HANG_UP),title:b(x.HANG_UP_CALL),children:k("label",{children:[k("p",{className:"mb-2 whitespace-nowrap",children:[b(x.REASON)," (",b(x.OPTIONAL),")"]}),k(Mt,{className:"w-full",defaultValue:e.reason,name:"reason",children:[E("option",{value:"",children:b(x.SELECT)}),Object.keys(nf).map(n=>E("option",{value:n,children:b(nf[n])},n))]})]})}),iA=({nodeData:e,handleOnUpdate:t})=>{const n=N.useRef(),r={url:{value:e.url,valid:!0},text:{value:e.text,valid:!0},voice:{value:e.voice,valid:!0},gender:{value:e.gender,valid:!0},language:{value:e.language,valid:!0},selected:{value:e.selected,valid:Boolean(e.selected)}},[o,i]=Rt(r);return as({displayData:o,formRef:n,setCompleted:a=>{t({},a)}}),E(dt,{formRef:n,info:b(x.INFO_NODE_PLAY),title:b(x.PLAY_AUDIO_TTS),children:E(B0,{displayData:o,label:b(x.CHOOSE_OPTION_TTS_AUDIO),handleOnUpdate:t,setDisplayData:i,showDefaultOption:!0})})},sA=({nodeData:e,handleOnUpdate:t})=>{const n={beep:{value:e.beep},controlId:{value:e.controlId},format:{value:e.format,valid:!0},label:{value:e.label,valid:!0},stereo:{value:e.stereo},terminators:{value:e.terminators,valid:!0}},r=N.useRef(),[o,i]=Rt(n),[s,a]=N.useState(!1),l=Kn(f=>f.upsertEntry),u=Kn(f=>f.isValueDuplicate);as({displayData:o,formRef:r,setCompleted:f=>{t({},f)}});const d=f=>{let h=!0;const m=f.target,{name:v,value:y}=m,p=y.trim(),g=u(p,e.controlId);a(g),h=m.checkValidity()&&Boolean(p)&&!g,i({[v]:{value:y,valid:h}}),t({[v]:h?p:""}),l({controlId:e.controlId,label:h?p:""})};return k(dt,{info:b(x.INFO_NODE_RECORD_CALL_START),title:b(x.RECORD_CALL_START),formRef:r,children:[k("label",{children:[b(x.RECORDING_NAME),E("input",{className:`w-full ${o.label.valid?"":"invalid"}`,defaultValue:o.label.value,name:"label",onChange:d,pattern:Or(Fb),required:!0,type:"text"}),E("p",{className:"requirements",role:"alert",children:b(s?x.ERROR_DUPLICATE_RECORDING_LABEL:x.ERROR_RECORDING_LABEL_REQUIRED)})]}),E($0,{handleOnUpdate:t,displayData:o,setDisplayData:i})]})},aA=({nodeData:e,handleOnChange:t})=>{const r=Kn(o=>o.getEntries)().sort((o,i)=>o.label.toLowerCase().localeCompare(i.label.toLowerCase()));return E(dt,{handleOnChange:t,info:b(x.INFO_NODE_RECORD_CALL_STOP),title:b(x.RECORD_CALL_STOP),children:r.length?k("label",{children:[E("p",{className:"mb-2 whitespace-nowrap",children:b(x.RECORDING_NAME)}),k(Mt,{className:"w-full",defaultValue:e.controlId,name:"controlId",children:[E("option",{value:"",children:b(x.SELECT)}),r.map(o=>E("option",{value:o.controlId,children:o.label},o.controlId))]})]}):E("p",{className:"text-negative",children:b(x.ERROR_ADD_RECORDING_FIRST)})})},lA=({nodeData:e,handleOnUpdate:t})=>{const n={beep:{value:e.beep},format:{value:e.format,valid:!0},stereo:{value:e.stereo},terminators:{value:e.terminators,valid:!0}},[r,o]=Rt(n);return E(dt,{info:b(x.INFO_NODE_RECORD),title:b(x.VOICEMAIL_RECORDING),children:E($0,{handleOnUpdate:t,displayData:r,setDisplayData:o})})},uA=["GET","POST","PUT","DELETE"],cA=e=>{console.log("bodyToTextArea",e);try{return typeof e=="string"?e:JSON.stringify(e)}catch{return e}},dA=({nodeData:e,handleOnUpdate:t})=>{const n={url:{value:e.url,valid:!0},method:{value:e.method,valid:!0},headers:{value:e.headers,valid:!0},body:{value:e.body,valid:!0},saveVariables:{value:Boolean(e.saveVariables),valid:!0}},[r,o]=Rt(n),i=l=>{const u=l.target,{name:c,value:d}=u,f=typeof d=="string"?d.trim():d;let h=!0;switch(c){case"url":case"method":h=u.checkValidity()&&!!f,o({[c]:{value:d,valid:h}}),t({[c]:h?f:""});break;case"headers":if(!d){o({[c]:{value:{},valid:!0}}),t({[c]:{}});return}try{const m=JSON.parse(d);o({[c]:{valid:!0}}),t({[c]:m})}catch{o({[c]:{valid:!1}}),t({[c]:{}})}break;case"body":try{const m=JSON.parse(d);o({[c]:{value:d,valid:!0}}),t({[c]:m})}catch{o({[c]:{value:d,valid:!0}}),t({[c]:d})}break;default:throw new Error(`Unhandled input name: ${c}`)}},s=l=>{const u=l.target.name,c=l.target.value,d={[u]:c};o(d),t(d)},a=l=>{const u=l.target.name,c=!r[u].value;o({[u]:{value:c}}),t({[u]:c})};return k(dt,{info:b(x.INFO_NODE_REQUEST),title:b(x.REQUEST),children:[E("p",{className:"pb-1 text-sm text-foreground/70",children:b(x.DEPRECATED)}),k("label",{children:[E("div",{children:b(x.URL)}),E("input",{className:`w-full ${r.url.valid?"":"invalid"}`,defaultValue:r.url.value,name:"url",onChange:i,placeholder:"https://user:password@example.com/api/status",required:!0,type:"text"}),E("p",{className:"requirements w-full",role:"alert",children:b(x.ERROR_VALUE_IS_REQUIRED)})]}),k("label",{className:"mb-3 block",children:[b(x.METHOD),E(Mt,{className:"w-full",value:r.method.value,name:"method",onChange:s,children:uA.map(l=>E("option",{value:l,children:l},l))})]}),E("div",{className:"mb-4",children:E(Ld,{checked:r.saveVariables.value,clickHandler:a,name:"saveVariables",subtitle:b(x.SAVE_VARIABLES_SUBTITLE),title:b(x.SAVE_VARIABLES)})}),k("label",{children:[E("div",{children:b(x.REQUEST_HEADERS)}),E(Sr,{errorText:b(x.ERROR_INVALID_JSON),inputMode:"text",valid:Boolean(r.headers.valid),label:b(x.REQUEST_HEADERS),name:"headers",onChange:i,placeholder:'{"Content-Type": "application/json", "X-Custom-Header": "foo"}',required:!0,value:JSON.stringify(r.headers.value)})]}),k("label",{children:[E("div",{children:b(x.REQUEST_BODY)}),E(Sr,{inputMode:"text",valid:!0,label:b(x.REQUEST_BODY),name:"body",onChange:i,placeholder:"String or JSON to serialize",value:cA(r.body.value)})]})]})},fA=({nodeData:e,handleOnUpdate:t})=>{const n={body:{value:e.body,valid:!0},fromNumber:{value:e.fromNumber,valid:!0},toNumber:{value:e.toNumber,valid:!0}},[r,o]=Rt(n),i=s=>{const a=s.target,{name:l,value:u}=a,c=typeof u=="string"?u.trim():u;let d=!0;switch(l){case"body":case"fromNumber":case"toNumber":d=a.checkValidity()&&!!c,o({[l]:{value:u,valid:d}}),t({[l]:d?c:""});break;default:throw new Error(`Unhandled input name: ${l}`)}};return k(dt,{info:b(x.INFO_NODE_SEND_SMS),title:b(x.SEND_SMS),children:[k("label",{className:"mb-1",children:[E("div",{children:b(x.FROM_PHONE_NUMBER)}),E("input",{className:`w-full ${r.fromNumber.valid?"":"invalid"}`,defaultValue:r.fromNumber.value,name:"fromNumber",onChange:i,placeholder:"+1 (204) 000 0000",required:!0,type:"tel"}),E("p",{className:"requirements w-full",role:"alert",children:b(x.ERROR_VALUE_IS_REQUIRED)})]}),k("label",{className:"mb-1",children:[E("div",{children:b(x.TO_PHONE_NUMBER)}),E("input",{className:`w-full ${r.toNumber.valid?"":"invalid"}`,defaultValue:r.toNumber.value,name:"toNumber",onChange:i,placeholder:"+1 (204) 000 0000",required:!0,type:"tel"}),E("p",{className:"requirements w-full",role:"alert",children:b(x.ERROR_VALUE_IS_REQUIRED)})]}),k("label",{children:[E("div",{children:b(x.TEXT)}),E(Sr,{errorText:b(x.ERROR_VALUE_IS_REQUIRED),inputMode:"text",valid:Boolean(r.body.valid),label:b(x.SMS_TEXT),name:"body",onChange:i,placeholder:b(x.WRITE_SOMETHING),required:!0,value:r.body.value})]})]})},z0=()=>({id:Re(),key:"",value:"",valid:!0}),j0=e=>e.reduce((t,{id:n,key:r,value:o,valid:i})=>(i&&r.trim().length>0&&t.push({id:n,key:r,value:o}),t),[]),pA=({nodeData:e,handleOnUpdate:t})=>{var v;const n=Er(y=>y.isKeyDuplicate),r={variables:{value:e.variables.length>0?e.variables.map(y=>({...y,valid:!0})):[z0()],valid:!0}},[o,i]=Rt(r),s=Er(y=>y.upsertVariable),a=Er(y=>y.removeVariable),l=y=>{y.preventDefault(),i({variables:{value:[...o.variables.value,z0()],valid:!0}})},u=y=>y.key.trim().length>0&&!n(y.key,y.id)&&k0(y.key),c=y=>y.every(p=>p.valid),d=y=>o.variables.value.map(p=>p.id===y.id?{...p,...y}:p),f=(y,p)=>{const g=o.variables.value[y];if(!g)throw new Error(`Variable not found at index ${y}`);const S={...g,...p};S.valid=u(S);const _=d(S),w=c(_);i({variables:{value:_,valid:w}}),t({variables:j0(_)},w),S.valid?s({id:S.id,key:S.key,value:S.value}):a(S.id)},h=y=>{const p=o.variables.value[y];if(p){const g=o.variables.value.filter((_,w)=>w!==y),S=c(g);i({variables:{value:g,valid:S}}),t({variables:j0(g)},S),a(p.id)}},m=(y,p)=>{const g=y.target,S=g.name;if(g.checkValidity())switch(S){case"key":case"value":f(p,{[S]:g.value});break;default:throw new Error(`Unhandled input name: ${S}`)}else f(p,{[S]:"",valid:!1})};return E(dt,{info:b(x.INFO_NODE_SET_VARIABLES),title:b(x.SET_VARIABLES),children:E("div",{className:"divide-y divide-foreground/10",children:(v=o.variables.value)==null?void 0:v.map((y,p,g)=>{const S=n(y.key,y.id);return k("div",{className:"mb-3",children:[k("div",{className:"flex flex-nowrap",children:[E("h3",{className:"flex-1 overflow-hidden text-ellipsis whitespace-nowrap py-6 text-sm font-medium uppercase leading-4 text-foreground/50",children:b(x.VARIABLE_KEY,{key:y.key})}),Boolean(g.length>1)&&E(Nr,{trigger:k("button",{className:"px-2",onClick:()=>h(p),type:"button",children:[E("span",{className:"sr-only",children:b(x.REMOVE_VARIABLE,{key:y.key})}),E(Fe,{tag:"xmark"})]}),children:b(x.INFO_NODE_SET_VARIABLES_OPTION)})]}),k("label",{className:"flex flex-col",children:[b(x.KEY),E("input",{className:`w-full ${(y.valid||k0(y.key))&&!S?"":"invalid"}`,defaultValue:y.key,name:"key",onChange:_=>m(_,p),pattern:Or(D0),type:"text"}),E("p",{className:"requirements",children:b(S?x.ERROR_DUPLICATE_VARIABLE_KEY:x.ERROR_VARIABLE_KEY_REQUIRED)})]}),k("label",{className:"flex flex-col",children:[b(x.VALUE),E("input",{className:"w-full",defaultValue:y.value,name:"value",onChange:_=>m(_,p),type:"text"}),E("p",{className:"requirements",children:b(x.ERROR_TEXT_IS_REQUIRED)})]}),p===g.length-1&&k("button",{onClick:l,type:"button",className:"mb-3 text-primary",children:["+ ",b(x.ADD_VARIABLE)]})]},y.id)})})})},hA=(e,t)=>{N.useEffect(()=>{var o;const n=(o=e.current)==null?void 0:o.getRootNode(),r=i=>{var a;const s=i.target;s instanceof Node&&!((a=e.current)!=null&&a.contains(s))&&t(i)};return n&&n.addEventListener("pointerdown",r),()=>{n&&n.removeEventListener("pointerdown",r)}},[e,t])},gA=({key:e,setId:t})=>({id:Re(),key:e,setId:t}),mA=e=>e.length>0,vA=({nodeData:e,handleOnUpdate:t})=>{const r={currentFocus:void 0,listOpen:!1,setVariablesList:Array.from(Er(m=>m.variables).values()).map(m=>({...m,selected:Boolean(e.variables.find(v=>v.setId===m.id))})).sort((m,v)=>m.key.toLowerCase().localeCompare(v.key.toLowerCase())),unsetVariables:e.variables},[o,i]=Rt(r),s=m=>o.setVariablesList.map(v=>v.id===m?{...v,selected:!v.selected}:v),a=m=>{const v=o.setVariablesList[m];if(!v)throw new Error("Variable not found");if(v.selected){const y=o.unsetVariables.findIndex(p=>p.setId===v.id);l(y)}else{const y=[...o.unsetVariables,gA({key:v.key,setId:v.id})];i({unsetVariables:y,setVariablesList:s(v.id)}),t({variables:y},!0)}},l=m=>{const v=o.unsetVariables[m];if(!v)throw new Error("Cannot Remove Variable, not found");const y=o.unsetVariables.filter(p=>p.id!==v.id);i({unsetVariables:y,setVariablesList:s(v.setId)}),t({variables:y},mA(y))},u=N.useRef(null);hA(u,()=>i({listOpen:!1}));const c=m=>{(m.key==="Escape"||m.key==="Esc")&&i({listOpen:!1})},d=(m,v)=>{m.preventDefault(),(m.key===" "||m.code==="Space"||m.key==="Enter")&&a(v),c(m)},f=()=>{i({listOpen:!o.listOpen})},h=o.unsetVariables.length;return k(dt,{info:b(x.INFO_NODE_UNSET_VARIABLES),title:b(x.UNSET_VARIABLES),children:[k("div",{className:"my-1 flex flex-col",children:[E("label",{id:"listbox-label",className:"sr-only",children:b(x.SELECT_VARIABLES_TO_UNSET)}),k("div",{className:"relative",ref:u,children:[E("button",{"aria-expanded":"true","aria-haspopup":"listbox","aria-labelledby":"listbox-label",className:`relative w-full cursor-pointer rounded-md border border-foreground/10 bg-transparent py-1.5 px-3 text-left shadow-sm
66
+ ${i}`})},rb=pt.forwardRef(function(t,n){var l;const r=ee(u=>u.rootElementId),o=N.useRef(null),i=Jd(),s=document.getElementById(r);if(s&&!o.current&&(o.current=(l=s.shadowRoot)==null?void 0:l.getRootNode()),!o.current)throw new Error(`shadowRoot id:${r} not found. Floating portal cannot be rendered`);const a=x0([i.refs.setFloating,n]);return E(zI,{root:o.current,children:i.open&&k("div",{className:"relative max-w-md rounded-md bg-foreground p-2 text-sm leading-4 text-background shadow-sm",ref:a,style:{position:i.strategy,top:i.y??0,left:i.x??0,visibility:i.x==null?"hidden":"visible",...t.style},...i.getFloatingProps(t),children:[t.children,E(nb,{})]})})}),ob=pt.forwardRef(function({children:t,asChild:n=!1,...r},o){const i=Jd(),s=x0([i.refs.setReference,o,t==null?void 0:t.ref]);return n&&pt.isValidElement(t)?pt.cloneElement(t,i.getReferenceProps({ref:s,...r,...t.props,"data-state":i.open?"open":"closed"})):E("button",{ref:s,"data-state":i.open?"open":"closed",...i.getReferenceProps(r),children:t})}),Nr=({asChild:e=!0,children:t,placement:n="top",trigger:r=E(Fe,{tag:"circle-info"}),...o})=>k(eb,{...o,placement:n,children:[E(ob,{asChild:e,children:r}),E(rb,{children:t})]}),ib=({dragging:e,id:t,isConnectable:n,selected:r})=>E(Ge,{id:t,isConnectable:n,missingRequiredEntry:!1,nodeTitle:"Answer Call",selected:r,showDelete:!e,children:E(Xt,{id:t,isConnectable:n,color:"positive"})}),sb=({id:e,data:t,dragging:n,isConnectable:r,selected:o})=>E(Ge,{id:e,isConnectable:r,missingRequiredEntry:t.missingRequiredParams,nodeTitle:b(x.CONDITIONS),selected:o,showDelete:!n,children:k(es,{children:[t.options.map((i,s)=>{const a=Boolean(i.value);return E(mn,{color:"positive",enabled:a,id:i.id,isConnectable:r,optionText:b(x.COND_NUMBER,{index:s+1})},i.id)}),E(mn,{color:"negative",id:t.fallback,isConnectable:r,optionText:b(x.ELSE)})]})}),ab=({data:e,dragging:t,id:n,isConnectable:r,selected:o})=>{var i;return E(Ge,{id:n,isConnectable:r,missingRequiredEntry:e.missingRequiredParams,nodeTitle:b(x.REQUEST),selected:o,showDelete:!t,children:k(es,{children:[(i=e==null?void 0:e.options)==null?void 0:i.map((s,a)=>E(mn,{color:"positive",enabled:Boolean(s.value),id:s.id,isConnectable:r,optionText:b(x.OPT_NUMBER,{index:a+1})},s.id)),E(mn,{color:"negative",id:e.fallback,isConnectable:r,optionText:b(x.ELSE)}),E(mn,{color:"negative",id:e.error,isConnectable:r,optionText:b(x.FAILURE)})]})})},lb={success:x.SUCCESS,noAnswer:x.NO_ANSWER,busy:x.BUSY,decline:x.DECLINE,error:x.ERROR},ub={address:x.FORWARD_TO_ADDRESS,phone:x.FORWARD_TO_PHONE,resource:x.FORWARD_TO_RESOURCE},ef=({id:e,data:t,dragging:n,isConnectable:r,selected:o})=>k(Ge,{id:e,isConnectable:r,missingRequiredEntry:t.missingRequiredParams,nodeTitle:b(ub[t.destinationType]),selected:o,showDelete:!n,children:[t.destinations.length>0?E("section",{className:"p-4 pt-2",children:E("ul",{className:"space-y-2",children:t.destinations.map((i,s)=>E("li",{className:"text-sm",children:i},`node-${i}-${s}`))})}):null,E(es,{children:t.options.map(i=>E(mn,{id:i.id,optionText:b(lb[i.result]),color:ry(i.result),isConnectable:r},i.id))})]}),cb=({id:e,data:t,dragging:n,isConnectable:r,selected:o})=>E(Ge,{id:e,isConnectable:r,missingRequiredEntry:t.missingRequiredParams,nodeTitle:"Gather Input",selected:o,showDelete:!n,children:k(es,{children:[t.options.map((i,s)=>{const a=Boolean(i.command||i.digit);return E(mn,{color:"positive",enabled:a,id:i.id,isConnectable:r,optionText:b(x.OPT_NUMBER,{index:s+1})},i.id)}),t.results.map(i=>E(mn,{color:"negative",id:i.id,isConnectable:r,optionText:i.result==="no_input"?b(x.NO_INPUT):b(x.UNKNOWN)},i.id))]})}),db=({id:e,isConnectable:t,selected:n})=>E(Ge,{allowDelete:!1,id:e,isConnectable:t,nodeTitle:b(x.HANDLE_CALL),selected:n,showDelete:!1,showValidation:!1,target:!1,children:E(Xt,{id:e,color:"positive",isConnectable:t})}),tf={busy:x.BUSY,decline:x.DECLINE,hangup:x.HANG_UP},fb=({data:e,dragging:t,id:n,isConnectable:r,selected:o})=>E(Ge,{id:n,isConnectable:r,missingRequiredEntry:!1,nodeTitle:b(x.HANG_UP_CALL),selected:o,showDelete:!t,children:e.reason&&E("section",{className:"p-4 pt-2",children:E("p",{children:b(tf[e.reason])})})}),pb=e=>{try{return new URL(e).pathname.split("/").at(-1)}catch{return""}},hb=({data:e,dragging:t,id:n,isConnectable:r,selected:o})=>{let i=e.selected&&e[e.selected];return i&&e.selected==="url"&&(i=pb(i)||"Play Audio"),k(Ge,{id:n,isConnectable:r,missingRequiredEntry:e.missingRequiredParams,nodeTitle:b(x.PLAY_AUDIO_TTS),selected:o,showDelete:!t,children:[i&&E("div",{className:"max-w-[300px] p-4 pt-0",children:e.selected==="url"?E("a",{className:"break-words text-primary underline line-clamp-3",href:e.url,target:"_blank",rel:"noopener noreferrer",children:i}):E("p",{className:"break-words line-clamp-3",children:i})}),E(Xt,{id:n,isConnectable:r})]})},gb=({data:e,dragging:t,id:n,isConnectable:r,selected:o})=>{const{label:i,missingRequiredParams:s}=e;return k(Ge,{id:n,isConnectable:r,missingRequiredEntry:s,nodeTitle:b(x.RECORD_CALL_START),selected:o,showDelete:!t,children:[i&&E("section",{className:"whitespace-nowrap px-4 pb-4 text-sm",children:i}),E(Xt,{id:n,isConnectable:r,color:"positive"})]})},mb=({data:e,dragging:t,id:n,isConnectable:r,selected:o})=>{var a;const i=(a=Kn(l=>l.entries))==null?void 0:a.find(l=>l.controlId===e.controlId),s=i==null?void 0:i.label;return k(Ge,{id:n,isConnectable:r,missingRequiredEntry:!s,nodeTitle:b(x.RECORD_CALL_STOP),selected:o,showDelete:!t,children:[s&&E("section",{className:"whitespace-nowrap px-4 pb-4 text-sm",children:s}),E(Xt,{id:n,color:"positive",isConnectable:r})]})},vb=({data:e,dragging:t,id:n,isConnectable:r,selected:o})=>E(Ge,{id:n,isConnectable:r,missingRequiredEntry:e.missingRequiredParams,nodeTitle:b(x.VOICEMAIL_RECORDING),selected:o,showDelete:!t,children:E(Xt,{id:n,isConnectable:r,color:"positive"})}),yb={success:x.SUCCESS,failed:x.FAILED},Eb={answer:ib,cond:sb,condRequest:ab,forwardAddress:ef,forwardPhone:ef,forwardResource:ef,handleCall:db,hangup:fb,play:hb,promptPlay:cb,record:vb,recordCallStart:gb,recordCallStop:mb,request:({data:e,dragging:t,id:n,isConnectable:r,selected:o})=>{var i;return k(Ge,{id:n,isConnectable:r,missingRequiredEntry:e.missingRequiredParams,nodeTitle:b(x.REQUEST),selected:o,showDelete:!t,children:[E("p",{className:"pl-4 pb-1 text-sm text-foreground/70",children:b(x.DEPRECATED)}),E(es,{children:(i=e==null?void 0:e.options)==null?void 0:i.map(s=>E(mn,{id:s.id,optionText:b(yb[s.result]),color:ry(s.result),isConnectable:r},s.id))})]})},sendSms:({data:e,dragging:t,id:n,isConnectable:r,selected:o})=>k(Ge,{id:n,isConnectable:r,missingRequiredEntry:e.missingRequiredParams,nodeTitle:b(x.SEND_SMS),selected:o,showDelete:!t,children:[(e.body||e.toNumber)&&k("div",{className:"max-w-[300px] p-4 pt-0",children:[e.fromNumber&&k("p",{className:`whitespace-nowrap ${e.body?"pb-2":""}`,children:[b(x.FROM),": ",e.fromNumber]}),e.toNumber&&k("p",{className:`whitespace-nowrap ${e.body?"pb-2":""}`,children:[b(x.TO),": ",e.toNumber]}),e.body&&E("p",{className:"break-words pt-1 line-clamp-3",children:e.body})]}),E(Xt,{id:n,isConnectable:r})]}),set:({id:e,data:t,dragging:n,isConnectable:r,selected:o})=>k(Ge,{id:e,isConnectable:r,missingRequiredEntry:t.missingRequiredParams,nodeTitle:b(x.SET_VARIABLES),selected:o,showDelete:!n,children:[t.variables.length>0&&E("div",{className:"flow-root",children:E("div",{className:"inline-block p-4 pt-0 align-middle",children:k("table",{className:"w-80 table-fixed divide-y divide-foreground/10",children:[E("thead",{children:k("tr",{children:[E("th",{scope:"col",className:"py-3.5 text-left text-sm font-semibold",children:b(x.KEY)}),E("th",{scope:"col",className:"px-2 py-3.5 text-left text-sm font-semibold",children:b(x.VALUE)})]})}),E("tbody",{className:"divide-y divide-foreground/10 bg-background text-sm",children:t.variables.map(i=>i.key?k("tr",{children:[E("td",{className:"overflow-hidden text-ellipsis whitespace-nowrap py-2 text-sm",children:i.key}),E("td",{className:"overflow-hidden text-ellipsis whitespace-nowrap break-all px-2 py-2 text-sm",children:i.value})]},i.id):null)})]})})}),E(Xt,{id:e,isConnectable:r,color:"positive"})]}),unset:({id:e,data:t,dragging:n,isConnectable:r,selected:o})=>{const i=ee(s=>s.partialUpdateNodeData);return N.useEffect(()=>{const s=Er.subscribe(a=>{const u=Array.from(a.variables.values()).reduce((c,d)=>{const f=t.variables.find(h=>h.setId===d.id);return f&&c.push({...f,key:d.key}),c},[]);i(e,{variables:u,missingRequiredParams:u.length===0})});return()=>s()},[i,e,t.variables]),E(Ge,{id:e,isConnectable:r,missingRequiredEntry:t.missingRequiredParams,nodeTitle:b(x.UNSET_VARIABLES),selected:o,showDelete:!n,children:E(Xt,{id:e,isConnectable:r,color:"positive"})})}},Sb={floating:bC},_b={duration:1e3,includeHiddenNodes:!0,padding:.3},wb=e=>({edges:e.edges,nodes:e.nodes,addNode:e.addNode,onConnect:e.onConnect,onConnectEnd:e.onConnectEnd,onConnectStart:e.onConnectStart,onEdgesChange:e.onEdgesChange,onEdgesDelete:e.onEdgesDelete,onEdgeUpdate:e.onEdgeUpdate,onEdgeUpdateEnd:e.onEdgeUpdateEnd,onEdgeUpdateStart:e.onEdgeUpdateStart,onInit:e.onInit,onNodeDragStart:e.onNodeDragStart,onNodeDragStop:e.onNodeDragStop,onNodesChange:e.onNodesChange,onNodesDelete:e.onNodesDelete,onSelectionChange:e.onSelectionChange}),Rb=({children:e})=>{const t=N.useRef(null),{edges:n,nodes:r,addNode:o,onConnect:i,onConnectEnd:s,onConnectStart:a,onEdgesChange:l,onEdgesDelete:u,onEdgeUpdate:c,onEdgeUpdateEnd:d,onEdgeUpdateStart:f,onInit:h,onNodeDragStart:m,onNodeDragStop:v,onNodesChange:y,onNodesDelete:p,onSelectionChange:g}=ee(wb,ze),S=N.useCallback(w=>{w.preventDefault(),w.target instanceof HTMLElement&&w.target.draggable&&(w.dataTransfer.dropEffect="move")},[]),_=N.useCallback(w=>{if(w.preventDefault(),!t.current)return Ze().warn("reactFlowWrapper not available yet");const R=w.dataTransfer.getData(ey);if(!R)return Ze().warn("nodeType not valid");const C=t.current.getBoundingClientRect();o({nodeType:R,x:w.clientX-C.left,y:w.clientY-C.top})},[o]);return E("div",{className:"bg-sw-white !h-auto w-full",ref:t,children:E(Xv,{connectionLineComponent:TC,connectionMode:Hn.Strict,deleteKeyCode:"Shift+Backspace",defaultEdgeOptions:ny,edges:n,edgeTypes:Sb,fitView:!0,fitViewOptions:_b,nodes:r,nodeTypes:Eb,onConnect:i,onConnectEnd:s,onConnectStart:a,onDragOver:S,onDrop:_,onEdgesChange:l,onEdgesDelete:u,onEdgeUpdate:c,onEdgeUpdateEnd:d,onEdgeUpdateStart:f,onInit:h,onNodeDragStart:m,onNodeDragStop:v,onNodesChange:y,onNodesDelete:p,onSelectionChange:g,children:e})})},Nb=1e3,Ob=e=>ee.setState({initializing:e}),xb=()=>{const e=ee(i=>i.initializing),t=ee(i=>i.flowInteractive),n=xe(),r=Gx(),o=N.useCallback(i=>{n.setState({nodesDraggable:i,nodesConnectable:i,elementsSelectable:i})},[n]);N.useEffect(()=>{let i;e&&(r?(i&&clearTimeout(i),i=setTimeout(()=>{o(!0),Ob(!1)},Nb)):o(!1))},[e,r,o]),N.useEffect(()=>{e||o(t)},[e,t,o])},Rt=e=>{const[t,n]=N.useReducer((r,o)=>({...r,...o}),e);return[t,n]},Tb={deploy:x.STATUS_DEPLOY,deployed:x.STATUS_DEPLOYED,deploying:x.STATUS_DEPLOYING,error:x.STATUS_DEPLOY_ERROR},Cb=e=>({deployFlowURL:e.deployFlowURL,httpError:e.httpError,saveFlowStatus:e.saveFlowStatus,documentVersion:e.documentVersion,deployFlow:e.deployFlow}),Ib=()=>{const{httpError:e,saveFlowStatus:t,documentVersion:n,deployFlow:r,deployFlowURL:o}=ee(Cb,ze),i={error:void 0,status:"deploy",prevDocVersion:n},[s,a]=Rt(i),l=Tb[s.status],u=async()=>{try{a({status:"deploying",error:void 0}),await r(),a({status:"deployed"})}catch(m){m instanceof Error?a({status:"error",error:m.message}):a({status:"error",error:"Failed to deploy!"})}};N.useEffect(()=>{t==="saved"&&n!==s.prevDocVersion&&a({status:"deploy",prevDocVersion:n})},[s.prevDocVersion,n,t,a]);const c=Boolean(e)||t!=="saved"||s.status==="deployed"||s.status==="deploying",d=c?"text-disabled hover:bg-background hover:text-disabled":"",f=s.status==="deployed"?"text-positive":"",h=s.status==="error"?"text-negative":"";return o?k(bo,{className:`hidden sm:flex ${d} ${f} ${h}`,disabled:c,onClick:u,children:[b(l),E(Nr,{placement:"right",trigger:E("div",{className:"flex items-center justify-center pl-1",role:"tooltip",tabIndex:0,children:s.status==="error"?k(ve,{children:[E("span",{className:"sr-only",children:b(x.MORE_INFO_DEPLOY_ERROR)}),E(Fe,{tag:"circle-exclamation"})]}):k(ve,{children:[E("span",{className:"sr-only",children:b(x.MORE_INFO_DEPLOY)}),E(Fe,{tag:"up-from-bracket"})]})}),children:s.status==="error"?b(x.MORE_INFO_DEPLOY_ERROR,{message:s.error}):b(x.MORE_INFO_DEPLOY)})]}):null},bb="react-flow__controls-button",Ab="min-w-[3.625rem] cursor-auto select-auto text-center hover:bg-background active:bg-background",Lb="hidden sm:flex",C0=N.forwardRef(function({asTag:t="div",children:n,className:r="",hiddenSmallScreen:o=!1,...i},s){const a=t,u=`${bb} ${a==="button"?"":Ab} ${o?Lb:""} ${r}`;return E(a,{className:u,ref:s,...i,children:n})}),Db=()=>{const[e,t]=N.useState(!1);return E(Nr,{open:e,onOpenChange:t,placement:"bottom",role:"dialog",trigger:k(C0,{asTag:"button",onClick:()=>{t(r=>!r)},children:["Help",k("div",{className:"flex items-center justify-center pl-1",children:[E("span",{className:"sr-only",children:b(x.MORE_INFO_STATUS_ERROR)}),E(Fe,{tag:"circle-info"})]})]}),children:k("section",{className:"p-2",children:[E("h2",{className:"mb-4 text-2xl font-semibold",children:"Testing Your Call Flow"}),k("div",{className:"text-sm",children:[E("p",{children:"To test the current working version (draft) of your Call Flow, follow these steps:"}),k("ol",{className:"my-4 list-inside list-decimal",children:[k("li",{className:"mb-2 list-item",children:["Go to the settings tab of the purchased phone number you want to use for testing:  ",E("a",{className:"underline hover:text-background/80",href:"/phone_numbers",target:"_blank",rel:"noopener noreferrer",children:"Purchased Phone Numbers"})]}),k("li",{className:"mb-2",children:["Choose the appropriate Call Flow for handling your calls:  ",E("a",{className:"underline hover:text-background/80",href:"/call_flows",target:"_blank",rel:"noopener noreferrer",children:"Call Flows"})]}),E("li",{className:"mb-2",children:"Select the working version (draft) of the chosen Call Flow."}),E("li",{children:"When you make a call to the number, it should now execute the working version of your Call Flow upon answering."})]}),E("p",{className:"mt-4 mb-2",children:"In an upcoming update, you will be able to test your selected Call Flow directly from the Call Flow Builder, eliminating the need to manually associate the Call Flow with your number."})]})]})})},kb={"awaiting-save":x.STATUS_SAVING,"document-sync":x.STATUS_LOCKED,error:x.STATUS_ERROR,initial:x.STATUS_LOADING,saved:x.STATUS_SAVED,saving:x.STATUS_SAVING},I0=e=>(e.preventDefault(),e.returnValue=""),Pb=()=>{const e=ee(i=>i.saveFlowStatus),t=ee(i=>i.httpError),r=kb[t==="document-sync"?t:e],o=e==="error"||t;return N.useEffect(()=>{if(!(e==="saved"||t))return addEventListener("beforeunload",I0,{capture:!0}),()=>{removeEventListener("beforeunload",I0,{capture:!0})}},[t,e]),k(C0,{"aria-live":o?"assertive":"polite",className:`${o?"text-negative":"text-foreground"}`,hiddenSmallScreen:!0,role:o?"alert":"status",children:[E("p",{children:b(r)}),o&&E(Nr,{placement:"bottom",trigger:k("div",{className:"flex items-center justify-center pl-1",role:"tooltip",tabIndex:0,children:[E("span",{className:"sr-only",children:b(x.MORE_INFO_STATUS_ERROR)}),E(Fe,{tag:"circle-exclamation"})]}),children:b(t==="document-sync"?x.INFO_STATUS_ERROR_OUT_OF_SYNC:x.INFO_STATUS_ERROR)})]})},Mb=()=>{xb();const e=ee(i=>i.isDraggingNode),t=ee(i=>i.rootAppWidth),n=ee(i=>i.httpError),o=!Boolean(t&&t<ty)&&n!=="document-sync";return k(Zx,{className:e?"group/control-buttons":"",position:"top-left",showInteractive:o,children:[E(Pb,{}),E(Ib,{}),E(Db,{})]})},b0=/^[\w\d ']+$/,A0=/^\d+$/,L0=/^\d|\*|#$/,Ub=/^[\d|\*|#$]{0,12}$/,Fb=/^.{1,20}$/,D0=/^[a-z0-9_]{1,20}$/,yl={MIN:1,MAX:99},Or=e=>(/(?:\/\^)(.+)(?:\$\/)/.exec(e.toString())??[])[1],nf=e=>t=>Boolean(e.exec(t)),rf=e=>nf(L0)(e),of=e=>nf(b0)(e),k0=e=>nf(D0)(e),P0=e=>typeof e=="string"&&e===""||Array.isArray(e)&&e.length===0?!1:typeof e=="object"&&e!==null?Object.keys(e).length===0?!1:Object.values(e).every(P0):!0,Vb=e=>{var i;const t=N.useRef(),n=Hx(),r=e&&"options"in e.data?(i=e.data.options)==null?void 0:i.length:0;return t.current=r,{updateDynamicHandles:s=>{"options"in s&&s.options.length!==t.current&&(e&&n(e.id),t.current=s.options.length)}}},Bb=()=>({value:{id:Re(),value:""},valid:!0}),M0=e=>e.every(t=>t.valid),U0=({displayOptions:e,setDisplayData:t,handleOnUpdate:n})=>{const r=c=>{t({options:{value:c,valid:M0(c)}}),n({options:c.map(d=>d.value)})},o=c=>{c.preventDefault();const d=[...e,Bb()];r(d)},i=c=>{const d=e.filter((f,h)=>h!==c);r(d)},s=(c,d)=>c.map(h=>h.value.id===d.value.id?{...h,...d}:h),a=c=>c.map(d=>({...d.value,value:d.value.value.trim()})),l=(c,d)=>{var g;const f=e;f[c]||Ze().error(`Option not found at index ${c}`);const h=f[c],m={...h==null?void 0:h.value,...d},v=Boolean((g=m.value)==null?void 0:g.trim()),p=s(e,{value:m,valid:v});t({options:{value:p,valid:M0(p)}}),n({options:a(p)})},u=(c,d)=>{const f=c.target,{name:h,value:m}=f;switch(h){case"value":d!==void 0&&l(d,{[h]:m});break;default:Ze().error(`Unhandled input name: ${h}`)}};return E("div",{className:"divide-y divide-foreground/10",children:e.map((c,d,f)=>k("div",{className:"mb-3",children:[k("div",{className:"flex items-center",children:[E("h2",{className:"nowrap flex-1 py-4 text-sm font-medium uppercase leading-4 text-foreground/50",children:b(x.CONDITION_NUMBER,{index:d+1})}),Boolean(e.length>1)&&E(Nr,{trigger:k("button",{className:"px-2",onClick:()=>i(d),type:"button",children:[E("span",{className:"sr-only",children:b(x.REMOVE_CONDITION,{index:d+1})}),E(Fe,{tag:"xmark"})]}),children:b(x.INFO_NODE_OPTION_REMOVE)})]}),k("label",{className:"flex flex-col",children:[E("input",{className:`w-full ${c.valid?"":"invalid"}`,defaultValue:c.value.value,name:"value",onChange:h=>u(h,d),placeholder:"%{count} > 3, /hello/.test('%{foo}')",type:"text"}),E("p",{className:"requirements",role:"alert",children:b(x.ERROR_VALUE_IS_REQUIRED)})]}),d===f.length-1&&k("button",{onClick:o,type:"button",className:"mb-3 text-primary",children:["+ ",b(x.ADD_CONDITION)]})]},c.value.id))})},$b=Ze(),ss=(e,t)=>[e,t].filter(Boolean).join("-").toLowerCase(),Hb={idsByKey:{},voiceById:{},languageById:{}},zb=(e,t)=>({...Hb,init:async({voicesURL:n="/voices.json"})=>{try{$b.debug("Load voicesURL",n);const o=await(await fetch(n)).json(),i={},s={},a={};o.forEach(l=>{var y,p,g;const u=Boolean(l.premium),c=l.signalwire_id,d=l.gender.toLowerCase(),f={id:c,key:`${l.language_code}-${d}-${l.signalwire_id}`,name:`${l.friendly_name} ${u?"(premium)":""}`,gender:d,premium:u};i[c]=f,s[l.language_code]={id:l.language_code,name:l.language};const h=ss(l.language_code);h in a||(a[h]=[]),(y=a[h])==null||y.push(f);const m=ss(d);m in a||(a[m]=[]),(p=a[m])==null||p.push(f);const v=ss(l.language_code,d);v in a||(a[v]=[]),(g=a[v])==null||g.push(f)}),e({idsByKey:a,voiceById:i,languageById:s})}catch(r){console.error("Error",r)}},getVoicesByKeys:({languageId:n,gender:r})=>{const{voiceById:o,idsByKey:i}=t(),s=ss(n,r);return s?i[s]??[]:Object.values(o)},getLanguages:()=>Object.values(t().languageById),getGenderByKeys:({languageId:n})=>{var s;const{idsByKey:r}=t(),o=ss(n);if(!o)return["female","male"];const i=new Set;return(s=r[o])==null||s.forEach(a=>{a.gender&&i.add(a.gender)}),Array.from(i).sort((a,l)=>a.toLowerCase().localeCompare(l.toLowerCase()))}}),sf=Ii()(zb);window.__useVoiceStore=sf;const F0=e=>E("option",{value:e.id,children:e.name},e.key??e.id),jb=e=>({getLanguages:e.getLanguages,getVoicesByKeys:e.getVoicesByKeys,getGenderByKeys:e.getGenderByKeys}),Gb=({onChange:e,languageId:t,gender:n,voiceId:r})=>{const{getLanguages:o,getVoicesByKeys:i,getGenderByKeys:s}=sf(jb);return k(ve,{children:[k("label",{children:[b(x.LANGUAGE),k(Mt,{className:"w-full",value:t??"",name:"language",onChange:e,children:[E("option",{value:"",children:b(x.SELECT)}),o().map(F0)]})]}),k("label",{children:[b(x.GENDER),k(Mt,{className:"w-full",value:n??"",name:"gender",onChange:e,children:[E("option",{value:"",children:b(x.SELECT)}),s({languageId:t}).map(a=>E("option",{value:a,children:a},a))]})]}),k("label",{children:[b(x.VOICE),k(Mt,{className:"w-full",value:r??"",name:"voice",onChange:e,children:[E("option",{value:"",children:b(x.SELECT)}),i({languageId:t,gender:n}).map(F0)]})]})]})},V0={url:x.PLAY_AUDIO_FILE,text:x.TEXT_TO_SPEECH},B0=({displayData:e,label:t,handleOnUpdate:n,setDisplayData:r,showDefaultOption:o})=>{var u,c;const i=e.selected.value,s=d=>{const f=d.currentTarget.value;r({selected:{value:f,valid:Boolean(f)||!o}}),n({selected:f})},a=d=>{const f=d.target,{name:h,value:m}=f,v=m.trim();let y=!0;switch(h){case"url":y=f.checkValidity(),r({[h]:{value:m,valid:y}}),n({text:"",url:y?v:""});break;case"text":y=f.checkValidity()&&v.length>0,r({[h]:{value:m,valid:y}}),n({text:y?v:"",url:""});break;default:throw new Error(`Unhandled input name: ${h}`)}},l=d=>{const f=d.target,{name:h,value:m}=f;switch(h){case"language":r({language:{value:m,valid:!0},gender:{value:void 0,valid:!0},voice:{value:void 0,valid:!0}}),n({language:m,gender:void 0,voice:void 0});break;case"gender":r({gender:{value:m,valid:!0},voice:{value:void 0,valid:!0}}),n({gender:m,voice:void 0});break;default:r({[h]:{value:m,valid:!0}}),n({[h]:m})}};return k("div",{children:[k("label",{children:[E("span",{className:"sr-only",children:t}),k(Mt,{className:"w-full",name:"selected",onChange:s,value:i,children:[o&&E("option",{value:"",children:b(x.SELECT)}),Object.keys(V0).map(d=>E("option",{value:d,children:b(V0[d])},d))]})]}),i&&E(Yb,{name:i,onChange:a,playSettingsChangeHandler:l,required:!0,selected:i,valid:(u=e[i])==null?void 0:u.valid,value:(c=e[i])==null?void 0:c.value,displayData:e})]})},Yb=({displayData:e,name:t,onChange:n,playSettingsChangeHandler:r,required:o,selected:i,valid:s,value:a})=>{const u={url:E(Sr,{errorText:b(x.ERROR_URL_IS_REQUIRED),inputMode:"url",label:b(x.PLAY_AUDIO_FILE),name:t,onChange:n,placeholder:b(x.ENTER_URL),required:o,valid:s,value:a}),text:k(ve,{children:[E(Gb,{onChange:r,languageId:e.language.value,gender:e.gender.value,voiceId:e.voice.value}),E(Sr,{errorText:b(x.ERROR_VALUE_IS_REQUIRED),inputMode:"text",label:b(x.TEXT_TO_SPEECH),name:t,onChange:n,placeholder:b(x.WRITE_SOMETHING),required:o,valid:s,value:a})]})}[i];return E(ve,{children:u})},Wb=[{field:"stereo",title:x.STEREO,subtitle:x.STEREO_SUBTITLE},{field:"beep",title:x.BEEP,subtitle:x.BEEP_SUBTITLE}],$0=({displayData:e,handleOnUpdate:t,setDisplayData:n})=>{const r=s=>{const a=s.target.name,l=!e[a].value,u={[a]:{value:l}};n(u),t({[a]:l})},o=s=>{const a=s.target,{name:l,value:u}=a,c=a.checkValidity(),d={[l]:{value:u,valid:c}};n(d),t({[l]:c?u.trim():""})},i=s=>{const a=s.target.name,l=s.target.value,u={[a]:{value:l,valid:!0}};n(u),t({[a]:l})};return k(ve,{children:[E("div",{className:"mb-5",children:Wb.map(s=>{const a=e[s.field].value;return E("div",{children:E(Ad,{checked:a,clickHandler:r,name:s.field,subtitle:b(s.subtitle),title:b(s.title)})},s.field)})}),k("label",{children:[b(x.TERMINATORS),E("input",{className:`w-full ${e.terminators.valid?"":"invalid"}`,defaultValue:e.terminators.value||"",name:"terminators",onChange:o,pattern:Or(Ub),placeholder:"#*0",type:"text"}),E("p",{className:"requirements",role:"alert",children:b(x.ERROR_TERMINATORS)})]}),k("label",{children:[b(x.FORMAT),k(Mt,{className:"w-full",value:e.format.value,name:"format",onChange:i,children:[E("option",{value:"mp3",children:"MP3"}),E("option",{value:"wav",children:"WAV"})]})]})]})},dt=({children:e,formRef:t,info:n,handleOnChange:r=()=>null,title:o})=>E("form",{className:"flex h-full flex-col overflow-hidden",noValidate:!0,onChange:r,ref:t,children:k("div",{className:"flex flex-col overflow-hidden",children:[k("legend",{className:"mb-2 flex w-full shrink-0 items-center justify-between px-4",children:[E("span",{className:"text-lg font-semibold leading-6",children:o}),n&&E(Nr,{trigger:k("div",{role:"tooltip",tabIndex:0,children:[E("span",{className:"sr-only",children:b(x.MORE_INFO_TITLE,{title:o})}),E(Fe,{tag:"circle-info"})]}),children:n})]}),E("div",{className:"mx-1 flex-1 overflow-y-auto px-3",children:e})]})}),Kb=["GET","POST","PUT","DELETE"],Qb=e=>{console.log("bodyToTextArea",e);try{return typeof e=="string"?e:JSON.stringify(e)}catch{return e}},Xb=()=>({value:{id:Re(),value:""},valid:!0}),qb=({nodeData:e,handleOnUpdate:t})=>{const n={url:{value:e.url,valid:!0},method:{value:e.method,valid:!0},headers:{value:e.headers,valid:!0},body:{value:e.body,valid:!0},saveVariables:{value:Boolean(e.saveVariables),valid:!0},options:{value:e.options.length?e.options.map(l=>({value:l,valid:Boolean(l.value)})):[Xb()],valid:!0}},[r,o]=Rt(n),i=l=>{const u=l.target,{name:c,value:d}=u,f=typeof d=="string"?d.trim():d;let h=!0;switch(c){case"url":case"method":h=u.checkValidity()&&!!f,o({[c]:{value:d,valid:h}}),t({[c]:h?f:""});break;case"headers":if(!d){o({[c]:{value:{},valid:!0}}),t({[c]:{}});return}try{const m=JSON.parse(d);o({[c]:{valid:!0}}),t({[c]:m})}catch{o({[c]:{valid:!1}}),t({[c]:{}})}break;case"body":try{const m=JSON.parse(d);o({[c]:{value:d,valid:!0}}),t({[c]:m})}catch{o({[c]:{value:d,valid:!0}}),t({[c]:d})}break;default:throw new Error(`Unhandled input name: ${c}`)}},s=l=>{const u=l.target.name,c=l.target.value,d={[u]:c};o(d),t(d)},a=l=>{const u=l.target.name,c=!r[u].value;o({[u]:{value:c}}),t({[u]:c})};return k(dt,{info:b(x.INFO_NODE_REQUEST),title:b(x.REQUEST),children:[k("label",{children:[E("div",{children:b(x.URL)}),E("input",{className:`w-full ${r.url.valid?"":"invalid"}`,defaultValue:r.url.value,name:"url",onChange:i,placeholder:"https://user:password@example.com/api/status",required:!0,type:"text"}),E("p",{className:"requirements w-full",role:"alert",children:b(x.ERROR_VALUE_IS_REQUIRED)})]}),k("label",{className:"mb-3 block",children:[b(x.METHOD),E(Mt,{className:"w-full",value:r.method.value,name:"method",onChange:s,children:Kb.map(l=>E("option",{value:l,children:l},l))})]}),E("div",{className:"mb-4",children:E(Ad,{checked:r.saveVariables.value,clickHandler:a,name:"saveVariables",subtitle:b(x.SAVE_VARIABLES_SUBTITLE),title:b(x.SAVE_VARIABLES)})}),k("label",{children:[E("div",{children:b(x.REQUEST_HEADERS)}),E(Sr,{errorText:b(x.ERROR_INVALID_JSON),inputMode:"text",valid:Boolean(r.headers.valid),label:b(x.REQUEST_HEADERS),name:"headers",onChange:i,placeholder:'{"Content-Type": "application/json", "X-Custom-Header": "foo"}',required:!0,value:JSON.stringify(r.headers.value)})]}),k("label",{children:[E("div",{children:b(x.REQUEST_BODY)}),E(Sr,{inputMode:"text",valid:!0,label:b(x.REQUEST_BODY),name:"body",onChange:i,placeholder:"String or JSON to serialize",value:Qb(r.body.value)})]}),E(U0,{displayOptions:r.options.value,setDisplayData:o,handleOnUpdate:t})]})},as=({displayData:e,formRef:t,setCompleted:n})=>{N.useEffect(()=>{var a,l;const r=t.current,o=new FormData(r),i=Object.fromEntries(o.entries());let s=!0;for(const u of Object.keys(i)){if(((a=e[u])==null?void 0:a.valid)!==void 0&&(s=s&&Boolean((l=e[u])==null?void 0:l.valid),s)){const c=r.elements.namedItem(u);c&&"checkValidity"in c&&(s=s&&c.checkValidity())}if(!s)break}n(s)},[e,t,n])},Zb=()=>({value:{id:Re(),value:""},valid:!0}),Jb=({nodeData:e,handleOnUpdate:t})=>{const n=N.useRef(),r={options:{value:e.options.length?e.options.map(a=>({value:a,valid:Boolean(a.value)})):[Zb()],valid:!0}},[o,i]=Rt(r);return as({displayData:o,formRef:n,setCompleted:a=>{t({},a)}}),E(dt,{formRef:n,info:b(x.INFO_NODE_COND),title:b(x.CONDITIONS),children:E(U0,{displayOptions:o.options.value,handleOnUpdate:t,setDisplayData:i})})},eA={address:{info:x.INFO_NODE_FORWARD_TO_ADDRESS,title:x.FORWARD_TO_ADDRESS,call:x.CALL_ADDRESSES,single:x.SINGLE_ADDRESS,multiple:x.MULTIPLE_ADDRESSES},phone:{info:x.INFO_NODE_FORWARD_TO_PHONE,title:x.FORWARD_TO_PHONE,call:x.CALL_NUMBERS,single:x.SINGLE_NUMBER,multiple:x.MULTIPLE_NUMBERS},resource:{info:x.INFO_NODE_FORWARD_TO_RESOURCE,title:x.FORWARD_TO_RESOURCE,call:x.CALL_RESOURCES,single:x.SINGLE_RESOURCE,multiple:x.MULTIPLE_RESOURCES}},af=({destinationType:e,nodeData:t,handleOnUpdate:n})=>{const r=N.useRef(),o=eA[e],i={single:o.single,multiple:o.multiple},s={callOrder:{value:"serial"},destinationList:{value:iT(t.destinations),valid:!0},destinationSingle:{value:t.destinations.length===1&&t.destinations[0]?t.destinations[0]:"",valid:!0},sessionTimeout:{value:t.sessionTimeout,valid:!0},type:{value:t.type??"single"}},[a,l]=Rt(s);as({displayData:a,formRef:r,setCompleted:h=>{n({},h)}});const c=h=>{const m=h.currentTarget.value,v=a.destinationSingle.value;let y="single",p=v.trim()?[v.trim()]:[];m==="multiple"&&(y=a.callOrder.value,p=Od(a.destinationList.value)),l({type:{value:y}}),n({destinations:p,type:y})},d=h=>{const m=h.currentTarget.value;l({type:{value:m}}),n({type:m})},f=h=>{const m=h.target,v=m.name,y=m.value;let p=!0;switch(v){case"destinationSingle":p=m.checkValidity()&&y.trim().length>0,l({[v]:{value:y,valid:p}}),n({destinations:p?[y.trim()]:[]});break;case"destinationList":p=m.checkValidity()&&Boolean(Od(y).length),l({[v]:{value:y,valid:p}}),n({destinations:p?Od(y):[]});break;case"sessionTimeout":p=m.checkValidity(),l({[v]:{value:y?Number.parseInt(y,10):void 0,valid:p}}),n({sessionTimeout:p&&y?Number.parseInt(y,10):void 0});break;default:throw new Error(`Unhandled input name: ${v}`)}};return k(dt,{info:b(o.info),title:b(o.title),formRef:r,children:[E("div",{className:"mb-1",children:k("label",{children:[E("span",{className:"sr-only",children:b(x.CHOOSE_OPTION_SINGLE_MULTIPLE)}),E(Mt,{className:"w-full",name:"quantity",onChange:c,value:a.type.value==="single"?"single":"multiple",children:Object.keys(i).map(h=>E("option",{value:h,children:b(i[h])},h))})]})}),E("div",{children:a.type.value==="single"?E(tA,{displayData:a,destinationType:e,handleChange:f}):E(nA,{displayData:a,destinationType:e,handleCallOrderSelectChange:d,handleChange:f,labels:o})}),e!=="phone"&&k("label",{children:[E("div",{children:b(x.DISCONNECT_CALL_AFTER_RINGING)}),k("div",{className:"flex flex-wrap items-center gap-x-2",children:[E("input",{className:`w-14 ${a.sessionTimeout.valid?"":"invalid"}`,defaultValue:a.sessionTimeout.value,min:0,name:"sessionTimeout",onChange:f,pattern:Or(A0),type:"number",inputMode:"numeric"}),b(x.SECONDS),E("p",{className:"requirements w-full",role:"alert",children:b(x.ERROR_NUMBER_IS_REQUIRED)})]})]})]})},tA=({displayData:e,destinationType:t,handleChange:n})=>k(ve,{children:[k("label",{children:[E("span",{className:"sr-only",children:b(x.SINGLE_NUMBER)}),E("input",{className:`w-full ${e.destinationSingle.valid?"":"invalid"}`,defaultValue:e.destinationSingle.value,name:"destinationSingle",onChange:n,placeholder:"+1 (204) 000 0000",required:!0,type:t==="phone"?"tel":"text"}),E("p",{className:"requirements",role:"alert",children:b(x.ERROR_VALUE_IS_REQUIRED)})]}),t!=="phone"&&E("div",{className:"mb-4 pt-4 text-xs uppercase",children:b(x.SETTINGS)})]}),nA=({displayData:e,destinationType:t,handleCallOrderSelectChange:n,handleChange:r,labels:o})=>{const i={serial:x.SEQUENTIALLY,parallel:x.SIMULTANEOUSLY};return k(ve,{children:[k("label",{children:[E("span",{className:"sr-only",children:b(x.MULTIPLE_NUMBERS)}),E("textarea",{className:`min-h-[77px] w-full ${e.destinationList.valid?"":"invalid"}`,name:"destinationList",onChange:r,placeholder:"+1 (204) 123 0000, +1 (204) 456 0000, +1 (204) 789 0000",required:!0,value:e.destinationList.value}),E("p",{className:"requirements",role:"alert",children:b(x.ERROR_VALUE_IS_REQUIRED)})]}),E("div",{className:"mb-4 pt-4 text-xs uppercase",children:b(x.SETTINGS)}),E("div",{className:`${t==="phone"?"":"mb-4"}`,children:k("label",{children:[b(o.call),E(Mt,{className:"w-full",name:"callOrder",onChange:n,value:e.type.value,children:Object.keys(i).map(s=>E("option",{value:s,children:b(i[s])},s))})]})})]})},H0=()=>({value:{id:Re(),command:"",digit:""},valid:!0}),lf=e=>e.every(t=>t.valid),rA=({nodeData:e,handleOnUpdate:t})=>{const n=N.useRef(),r={initialTimeout:{value:e.initialTimeout??5,valid:!0},url:{value:e.url,valid:!0},text:{value:e.text,valid:!0},voice:{value:e.voice,valid:!0},gender:{value:e.gender,valid:!0},language:{value:e.language,valid:!0},selected:{value:e.selected||"text",valid:!0},options:{value:e.options.length?e.options.map(m=>({value:m,valid:Boolean(m.command||m.digit)})):[H0()],valid:!0}},[o,i]=Rt(r);as({displayData:o,formRef:n,setCompleted:m=>{t({},m)}});const a=m=>{m.preventDefault();const v=[...o.options.value,H0()];i({options:{value:v,valid:lf(v)}}),t({options:v.map(y=>y.value)})},l=m=>{const y=o.options.value.filter((p,g)=>g!==m);i({options:{value:y,valid:lf(y)}}),t({options:y.map(p=>p.value)})},u=(m,v)=>m.map(p=>p.value.id===v.value.id?{...p,...v}:p),c=m=>m.map(v=>{const y=v.value.command.trim(),p=v.value.digit.trim();return{...v.value,command:of(y)?y:"",digit:rf(p)?p:""}}),d=(m,v)=>{const y=o.options.value;if(!y[m])throw new Error(`Option not found at index ${m}`);const p=y[m],g={...p==null?void 0:p.value,...v},S=g.command.trim(),_=g.digit.trim(),w=Boolean(S)&&of(S)||Boolean(_)&&rf(_),R={value:g,valid:w},C=u(o.options.value,R);i({options:{value:C,valid:lf(C)}}),t({options:c(C)})},f=(m,v)=>{const y=m.target,{name:p,value:g}=y;let S=!0;switch(p){case"digit":case"command":v!==void 0&&d(v,{[p]:g});break;case"initialTimeout":{S=y.checkValidity(),i({[p]:{value:Number.parseInt(g,10),valid:S}}),t({initialTimeout:S&&g?parseInt(g,10):5});break}default:throw new Error(`Unhandled input name: ${p}`)}},h=o.options.value;return E(dt,{formRef:n,info:b(x.INFO_NODE_GATHER_INPUT),title:b(x.GATHER_INPUT),children:k("div",{className:"divide-y divide-foreground/10",children:[E("div",{className:"mb-2",children:E(B0,{displayData:o,label:b(x.CHOOSE_OPTION_TTS_AUDIO),handleOnUpdate:t,setDisplayData:i})}),E("ul",{children:h.map((m,v,y)=>k("li",{className:"mb-3",children:[k("div",{className:"flex items-center",children:[E("h2",{className:"nowrap flex-1 py-6 text-sm font-medium uppercase leading-4 text-foreground/50",children:b(x.OPTION_NUMBER,{index:v+1})}),Boolean(h.length>1)&&E(Nr,{trigger:k("button",{className:"px-2",onClick:()=>l(v),type:"button",children:[E("span",{className:"sr-only",children:b(x.REMOVE_OPTION,{index:v+1})}),E(Fe,{tag:"xmark"})]}),children:b(x.INFO_NODE_OPTION_REMOVE)})]}),k("label",{className:"flex flex-col",children:[b(x.CALLER_PRESSES),E("input",{className:`w-1/4 ${!m.valid||m.value.digit&&!rf(m.value.digit)?"invalid":""}`,defaultValue:m.value.digit,name:"digit",onChange:p=>f(p,v),pattern:Or(L0),type:"text"}),E("p",{className:"requirements",role:"alert",children:b(x.ERROR_TELEPHONE_KEY_REQUIRED)})]}),k("label",{className:"flex flex-col",children:[b(x.OR_SAYS),E("input",{className:`w-full ${!m.valid||m.value.command&&!of(m.value.command)?"invalid":""}`,defaultValue:m.value.command,name:"command",onChange:p=>f(p,v),pattern:`${Or(b0)}|''`,type:"text"}),E("p",{className:"requirements",role:"alert",children:b(x.ERROR_TEXT_IS_REQUIRED)})]}),v===y.length-1&&k("button",{onClick:a,type:"button",className:"mb-3 text-primary",children:["+ ",b(x.ADD_OPTION)]})]},m.value.id))}),k("div",{className:"pt-6",children:[E("h2",{className:"pb-6 text-sm uppercase leading-4 text-foreground/50",children:b(x.SETTINGS)}),k("label",{children:[E("div",{className:"w-full",children:b(x.WAIT_FOR_INPUT)}),k("div",{className:"flex flex-wrap items-center gap-x-2",children:[E("input",{className:`w-14 ${o.initialTimeout.valid?"":"invalid"}`,defaultValue:o.initialTimeout.value,min:yl.MIN,max:yl.MAX,name:"initialTimeout",onChange:f,pattern:Or(A0),type:"number",inputMode:"numeric"}),b(x.SECONDS),E("p",{className:"requirements w-full",role:"alert",children:b(x.ERROR_NUMBER_MIN_MAX_IS_REQUIRED,{min:yl.MIN,max:yl.MAX})})]})]})]})]})})},oA=({nodeData:e,handleOnChange:t})=>E(dt,{handleOnChange:t,info:b(x.INFO_NODE_HANG_UP),title:b(x.HANG_UP_CALL),children:k("label",{children:[k("p",{className:"mb-2 whitespace-nowrap",children:[b(x.REASON)," (",b(x.OPTIONAL),")"]}),k(Mt,{className:"w-full",defaultValue:e.reason,name:"reason",children:[E("option",{value:"",children:b(x.SELECT)}),Object.keys(tf).map(n=>E("option",{value:n,children:b(tf[n])},n))]})]})}),iA=({nodeData:e,handleOnUpdate:t})=>{const n=N.useRef(),r={url:{value:e.url,valid:!0},text:{value:e.text,valid:!0},voice:{value:e.voice,valid:!0},gender:{value:e.gender,valid:!0},language:{value:e.language,valid:!0},selected:{value:e.selected,valid:Boolean(e.selected)}},[o,i]=Rt(r);return as({displayData:o,formRef:n,setCompleted:a=>{t({},a)}}),E(dt,{formRef:n,info:b(x.INFO_NODE_PLAY),title:b(x.PLAY_AUDIO_TTS),children:E(B0,{displayData:o,label:b(x.CHOOSE_OPTION_TTS_AUDIO),handleOnUpdate:t,setDisplayData:i,showDefaultOption:!0})})},sA=({nodeData:e,handleOnUpdate:t})=>{const n={beep:{value:e.beep},controlId:{value:e.controlId},format:{value:e.format,valid:!0},label:{value:e.label,valid:!0},stereo:{value:e.stereo},terminators:{value:e.terminators,valid:!0}},r=N.useRef(),[o,i]=Rt(n),[s,a]=N.useState(!1),l=Kn(f=>f.upsertEntry),u=Kn(f=>f.isValueDuplicate);as({displayData:o,formRef:r,setCompleted:f=>{t({},f)}});const d=f=>{let h=!0;const m=f.target,{name:v,value:y}=m,p=y.trim(),g=u(p,e.controlId);a(g),h=m.checkValidity()&&Boolean(p)&&!g,i({[v]:{value:y,valid:h}}),t({[v]:h?p:""}),l({controlId:e.controlId,label:h?p:""})};return k(dt,{info:b(x.INFO_NODE_RECORD_CALL_START),title:b(x.RECORD_CALL_START),formRef:r,children:[k("label",{children:[b(x.RECORDING_NAME),E("input",{className:`w-full ${o.label.valid?"":"invalid"}`,defaultValue:o.label.value,name:"label",onChange:d,pattern:Or(Fb),required:!0,type:"text"}),E("p",{className:"requirements",role:"alert",children:b(s?x.ERROR_DUPLICATE_RECORDING_LABEL:x.ERROR_RECORDING_LABEL_REQUIRED)})]}),E($0,{handleOnUpdate:t,displayData:o,setDisplayData:i})]})},aA=({nodeData:e,handleOnChange:t})=>{const r=Kn(o=>o.getEntries)().sort((o,i)=>o.label.toLowerCase().localeCompare(i.label.toLowerCase()));return E(dt,{handleOnChange:t,info:b(x.INFO_NODE_RECORD_CALL_STOP),title:b(x.RECORD_CALL_STOP),children:r.length?k("label",{children:[E("p",{className:"mb-2 whitespace-nowrap",children:b(x.RECORDING_NAME)}),k(Mt,{className:"w-full",defaultValue:e.controlId,name:"controlId",children:[E("option",{value:"",children:b(x.SELECT)}),r.map(o=>E("option",{value:o.controlId,children:o.label},o.controlId))]})]}):E("p",{className:"text-negative",children:b(x.ERROR_ADD_RECORDING_FIRST)})})},lA=({nodeData:e,handleOnUpdate:t})=>{const n={beep:{value:e.beep},format:{value:e.format,valid:!0},stereo:{value:e.stereo},terminators:{value:e.terminators,valid:!0}},[r,o]=Rt(n);return E(dt,{info:b(x.INFO_NODE_RECORD),title:b(x.VOICEMAIL_RECORDING),children:E($0,{handleOnUpdate:t,displayData:r,setDisplayData:o})})},uA=["GET","POST","PUT","DELETE"],cA=e=>{console.log("bodyToTextArea",e);try{return typeof e=="string"?e:JSON.stringify(e)}catch{return e}},dA=({nodeData:e,handleOnUpdate:t})=>{const n={url:{value:e.url,valid:!0},method:{value:e.method,valid:!0},headers:{value:e.headers,valid:!0},body:{value:e.body,valid:!0},saveVariables:{value:Boolean(e.saveVariables),valid:!0}},[r,o]=Rt(n),i=l=>{const u=l.target,{name:c,value:d}=u,f=typeof d=="string"?d.trim():d;let h=!0;switch(c){case"url":case"method":h=u.checkValidity()&&!!f,o({[c]:{value:d,valid:h}}),t({[c]:h?f:""});break;case"headers":if(!d){o({[c]:{value:{},valid:!0}}),t({[c]:{}});return}try{const m=JSON.parse(d);o({[c]:{valid:!0}}),t({[c]:m})}catch{o({[c]:{valid:!1}}),t({[c]:{}})}break;case"body":try{const m=JSON.parse(d);o({[c]:{value:d,valid:!0}}),t({[c]:m})}catch{o({[c]:{value:d,valid:!0}}),t({[c]:d})}break;default:throw new Error(`Unhandled input name: ${c}`)}},s=l=>{const u=l.target.name,c=l.target.value,d={[u]:c};o(d),t(d)},a=l=>{const u=l.target.name,c=!r[u].value;o({[u]:{value:c}}),t({[u]:c})};return k(dt,{info:b(x.INFO_NODE_REQUEST),title:b(x.REQUEST),children:[E("p",{className:"pb-1 text-sm text-foreground/70",children:b(x.DEPRECATED)}),k("label",{children:[E("div",{children:b(x.URL)}),E("input",{className:`w-full ${r.url.valid?"":"invalid"}`,defaultValue:r.url.value,name:"url",onChange:i,placeholder:"https://user:password@example.com/api/status",required:!0,type:"text"}),E("p",{className:"requirements w-full",role:"alert",children:b(x.ERROR_VALUE_IS_REQUIRED)})]}),k("label",{className:"mb-3 block",children:[b(x.METHOD),E(Mt,{className:"w-full",value:r.method.value,name:"method",onChange:s,children:uA.map(l=>E("option",{value:l,children:l},l))})]}),E("div",{className:"mb-4",children:E(Ad,{checked:r.saveVariables.value,clickHandler:a,name:"saveVariables",subtitle:b(x.SAVE_VARIABLES_SUBTITLE),title:b(x.SAVE_VARIABLES)})}),k("label",{children:[E("div",{children:b(x.REQUEST_HEADERS)}),E(Sr,{errorText:b(x.ERROR_INVALID_JSON),inputMode:"text",valid:Boolean(r.headers.valid),label:b(x.REQUEST_HEADERS),name:"headers",onChange:i,placeholder:'{"Content-Type": "application/json", "X-Custom-Header": "foo"}',required:!0,value:JSON.stringify(r.headers.value)})]}),k("label",{children:[E("div",{children:b(x.REQUEST_BODY)}),E(Sr,{inputMode:"text",valid:!0,label:b(x.REQUEST_BODY),name:"body",onChange:i,placeholder:"String or JSON to serialize",value:cA(r.body.value)})]})]})},fA=({nodeData:e,handleOnUpdate:t})=>{const n={body:{value:e.body,valid:!0},fromNumber:{value:e.fromNumber,valid:!0},toNumber:{value:e.toNumber,valid:!0}},[r,o]=Rt(n),i=s=>{const a=s.target,{name:l,value:u}=a,c=typeof u=="string"?u.trim():u;let d=!0;switch(l){case"body":case"fromNumber":case"toNumber":d=a.checkValidity()&&!!c,o({[l]:{value:u,valid:d}}),t({[l]:d?c:""});break;default:throw new Error(`Unhandled input name: ${l}`)}};return k(dt,{info:b(x.INFO_NODE_SEND_SMS),title:b(x.SEND_SMS),children:[k("label",{className:"mb-1",children:[E("div",{children:b(x.FROM_PHONE_NUMBER)}),E("input",{className:`w-full ${r.fromNumber.valid?"":"invalid"}`,defaultValue:r.fromNumber.value,name:"fromNumber",onChange:i,placeholder:"+1 (204) 000 0000",required:!0,type:"tel"}),E("p",{className:"requirements w-full",role:"alert",children:b(x.ERROR_VALUE_IS_REQUIRED)})]}),k("label",{className:"mb-1",children:[E("div",{children:b(x.TO_PHONE_NUMBER)}),E("input",{className:`w-full ${r.toNumber.valid?"":"invalid"}`,defaultValue:r.toNumber.value,name:"toNumber",onChange:i,placeholder:"+1 (204) 000 0000",required:!0,type:"tel"}),E("p",{className:"requirements w-full",role:"alert",children:b(x.ERROR_VALUE_IS_REQUIRED)})]}),k("label",{children:[E("div",{children:b(x.TEXT)}),E(Sr,{errorText:b(x.ERROR_VALUE_IS_REQUIRED),inputMode:"text",valid:Boolean(r.body.valid),label:b(x.SMS_TEXT),name:"body",onChange:i,placeholder:b(x.WRITE_SOMETHING),required:!0,value:r.body.value})]})]})},z0=()=>({id:Re(),key:"",value:"",valid:!0}),j0=e=>e.reduce((t,{id:n,key:r,value:o,valid:i})=>(i&&r.trim().length>0&&t.push({id:n,key:r,value:o}),t),[]),pA=({nodeData:e,handleOnUpdate:t})=>{var v;const n=Er(y=>y.isKeyDuplicate),r={variables:{value:e.variables.length>0?e.variables.map(y=>({...y,valid:!0})):[z0()],valid:!0}},[o,i]=Rt(r),s=Er(y=>y.upsertVariable),a=Er(y=>y.removeVariable),l=y=>{y.preventDefault(),i({variables:{value:[...o.variables.value,z0()],valid:!0}})},u=y=>y.key.trim().length>0&&!n(y.key,y.id)&&k0(y.key),c=y=>y.every(p=>p.valid),d=y=>o.variables.value.map(p=>p.id===y.id?{...p,...y}:p),f=(y,p)=>{const g=o.variables.value[y];if(!g)throw new Error(`Variable not found at index ${y}`);const S={...g,...p};S.valid=u(S);const _=d(S),w=c(_);i({variables:{value:_,valid:w}}),t({variables:j0(_)},w),S.valid?s({id:S.id,key:S.key,value:S.value}):a(S.id)},h=y=>{const p=o.variables.value[y];if(p){const g=o.variables.value.filter((_,w)=>w!==y),S=c(g);i({variables:{value:g,valid:S}}),t({variables:j0(g)},S),a(p.id)}},m=(y,p)=>{const g=y.target,S=g.name;if(g.checkValidity())switch(S){case"key":case"value":f(p,{[S]:g.value});break;default:throw new Error(`Unhandled input name: ${S}`)}else f(p,{[S]:"",valid:!1})};return E(dt,{info:b(x.INFO_NODE_SET_VARIABLES),title:b(x.SET_VARIABLES),children:E("div",{className:"divide-y divide-foreground/10",children:(v=o.variables.value)==null?void 0:v.map((y,p,g)=>{const S=n(y.key,y.id);return k("div",{className:"mb-3",children:[k("div",{className:"flex flex-nowrap",children:[E("h3",{className:"flex-1 overflow-hidden text-ellipsis whitespace-nowrap py-6 text-sm font-medium uppercase leading-4 text-foreground/50",children:b(x.VARIABLE_KEY,{key:y.key})}),Boolean(g.length>1)&&E(Nr,{trigger:k("button",{className:"px-2",onClick:()=>h(p),type:"button",children:[E("span",{className:"sr-only",children:b(x.REMOVE_VARIABLE,{key:y.key})}),E(Fe,{tag:"xmark"})]}),children:b(x.INFO_NODE_SET_VARIABLES_OPTION)})]}),k("label",{className:"flex flex-col",children:[b(x.KEY),E("input",{className:`w-full ${(y.valid||k0(y.key))&&!S?"":"invalid"}`,defaultValue:y.key,name:"key",onChange:_=>m(_,p),pattern:Or(D0),type:"text"}),E("p",{className:"requirements",children:b(S?x.ERROR_DUPLICATE_VARIABLE_KEY:x.ERROR_VARIABLE_KEY_REQUIRED)})]}),k("label",{className:"flex flex-col",children:[b(x.VALUE),E("input",{className:"w-full",defaultValue:y.value,name:"value",onChange:_=>m(_,p),type:"text"}),E("p",{className:"requirements",children:b(x.ERROR_TEXT_IS_REQUIRED)})]}),p===g.length-1&&k("button",{onClick:l,type:"button",className:"mb-3 text-primary",children:["+ ",b(x.ADD_VARIABLE)]})]},y.id)})})})},hA=(e,t)=>{N.useEffect(()=>{var o;const n=(o=e.current)==null?void 0:o.getRootNode(),r=i=>{var a;const s=i.target;s instanceof Node&&!((a=e.current)!=null&&a.contains(s))&&t(i)};return n&&n.addEventListener("pointerdown",r),()=>{n&&n.removeEventListener("pointerdown",r)}},[e,t])},gA=({key:e,setId:t})=>({id:Re(),key:e,setId:t}),mA=e=>e.length>0,vA=({nodeData:e,handleOnUpdate:t})=>{const r={currentFocus:void 0,listOpen:!1,setVariablesList:Array.from(Er(m=>m.variables).values()).map(m=>({...m,selected:Boolean(e.variables.find(v=>v.setId===m.id))})).sort((m,v)=>m.key.toLowerCase().localeCompare(v.key.toLowerCase())),unsetVariables:e.variables},[o,i]=Rt(r),s=m=>o.setVariablesList.map(v=>v.id===m?{...v,selected:!v.selected}:v),a=m=>{const v=o.setVariablesList[m];if(!v)throw new Error("Variable not found");if(v.selected){const y=o.unsetVariables.findIndex(p=>p.setId===v.id);l(y)}else{const y=[...o.unsetVariables,gA({key:v.key,setId:v.id})];i({unsetVariables:y,setVariablesList:s(v.id)}),t({variables:y},!0)}},l=m=>{const v=o.unsetVariables[m];if(!v)throw new Error("Cannot Remove Variable, not found");const y=o.unsetVariables.filter(p=>p.id!==v.id);i({unsetVariables:y,setVariablesList:s(v.setId)}),t({variables:y},mA(y))},u=N.useRef(null);hA(u,()=>i({listOpen:!1}));const c=m=>{(m.key==="Escape"||m.key==="Esc")&&i({listOpen:!1})},d=(m,v)=>{m.preventDefault(),(m.key===" "||m.code==="Space"||m.key==="Enter")&&a(v),c(m)},f=()=>{i({listOpen:!o.listOpen})},h=o.unsetVariables.length;return k(dt,{info:b(x.INFO_NODE_UNSET_VARIABLES),title:b(x.UNSET_VARIABLES),children:[k("div",{className:"my-1 flex flex-col",children:[E("label",{id:"listbox-label",className:"sr-only",children:b(x.SELECT_VARIABLES_TO_UNSET)}),k("div",{className:"relative",ref:u,children:[E("button",{"aria-expanded":"true","aria-haspopup":"listbox","aria-labelledby":"listbox-label",className:`relative w-full cursor-pointer rounded-md border border-foreground/10 bg-transparent py-1.5 px-3 text-left shadow-sm
67
67
  after:absolute after:right-3 after:top-3 after:h-[7px] after:w-[7px] after:rotate-45 after:border-r after:border-b after:border-foreground after:content-['']
68
- focus:outline-none focus:ring-1 focus:ring-foreground`,onClick:f,onKeyDown:c,type:"button",children:h>0?b(x.NUMBER_OF_VARIABLES_SELECTED,{count:h}):b(x.SELECT_VARIABLES)}),o.listOpen&&k("ul",{"aria-activedescendant":o.currentFocus,"aria-labelledby":"listbox-label","aria-multiselectable":"true",className:"mt-1 max-h-60 w-full overflow-auto rounded-lg border border-foreground/10 bg-backgroundAlt py-1 shadow-xl",role:"listbox",children:[!o.setVariablesList.length&&E("li",{"aria-disabled":"true",className:"relative",role:"option",children:E("label",{className:"flex select-none items-center py-2 pl-3 pr-9",children:b(x.NO_VARIABLES_SET)})}),o.setVariablesList.map((m,v)=>E("li",{"aria-selected":m.selected,className:"relative",id:m.id,role:"option",children:k("label",{className:"flex select-none items-center py-2 pl-3 pr-9",children:[E("input",{checked:m.selected,className:"mr-2 h-4 w-4 rounded accent-primary",onChange:()=>a(v),onKeyDown:y=>d(y,v),type:"checkbox"}),m.key]})},m.id))]})]})]}),h>0&&k("section",{className:"pt-3",children:[E("h3",{className:"mb-2 leading-5 text-foreground",children:b(x.UNSET_VARIABLES)}),E("ul",{className:"flex flex-wrap gap-2",children:o.unsetVariables.map((m,v)=>E($C,{handleClick:()=>l(v),children:m.key},m.id))})]})]})},yA=(e,t)=>{if("options"in t)switch(e.type){case"promptPlay":case"cond":return!0}return!1},EA=()=>{const e=ee(c=>c.selectedNode),t=ee(c=>c.partialUpdateNodeData),n=e==null?void 0:e.data,r=e==null?void 0:e.id,{updateDynamicHandles:o}=Vb(e);if(!(e&&n&&r))return null;const i=c=>{const d=new FormData(c.currentTarget),f=Object.fromEntries(d.entries());t(r,{...f,missingRequiredParams:!P0(f)})},s=(c,d)=>{typeof d=="boolean"&&(c.missingRequiredParams=!d),yA(e,c)&&o(c),t(r,c)},a={cond:()=>E(Jb,{nodeData:n,handleOnUpdate:s}),condRequest:()=>E(qb,{nodeData:n,handleOnUpdate:s}),forwardAddress:()=>E(lf,{destinationType:"address",nodeData:n,handleOnUpdate:s}),forwardPhone:()=>E(lf,{destinationType:"phone",nodeData:n,handleOnUpdate:s}),forwardResource:()=>E(lf,{destinationType:"resource",nodeData:n,handleOnUpdate:s}),hangup:()=>E(oA,{nodeData:n,handleOnChange:i}),play:()=>E(iA,{nodeData:n,handleOnUpdate:s}),promptPlay:()=>E(rA,{nodeData:n,handleOnUpdate:s}),set:()=>E(pA,{nodeData:n,handleOnUpdate:s}),unset:()=>E(vA,{nodeData:n,handleOnUpdate:s}),record:()=>E(lA,{nodeData:n,handleOnUpdate:s}),recordCallStart:()=>E(sA,{nodeData:n,handleOnUpdate:s}),recordCallStop:()=>E(aA,{nodeData:n,handleOnChange:i}),sendSms:()=>E(fA,{nodeData:n,handleOnUpdate:s}),request:()=>E(dA,{nodeData:n,handleOnUpdate:s})};if(!(c=>Boolean(c in a))(e.type))return null;const u=a[e.type];return E(rd,{className:"nokey flex max-h-[95%] w-[300px] flex-col overflow-hidden rounded-md border border-foreground/10 bg-background py-4",position:"top-right",children:E(u,{})})},SA=({asDialog:e=!1,open:t=!1}={})=>{const[n,r]=pt.useState(t);N.useEffect(()=>{r(t)},[t]);const o=N.useCallback(()=>r(!1),[]),i=N.useCallback(()=>r(!0),[]);return{asDialog:e,isOpen:n,closeContainer:o,openContainer:i}},G0=N.createContext(null),cf=()=>{const e=N.useContext(G0);if(e==null)throw new Error("Toast components must be wrapped in <ToastContainer />");return e},_A=({children:e,...t})=>{const n=SA(t);return E(G0.Provider,{value:n,children:e})},wA=({title:e,children:t})=>{const{asDialog:n}=cf();return k("div",{className:"max-w-xl rounded-lg bg-foreground p-4 text-background shadow-2xl transition-[transform,box-shadow] duration-500 will-change-transform hover:shadow-none",role:n?"dialog":"alert",children:[k("h2",{className:"text-lg font-semibold leading-6 tracking-wide",children:[E("span",{className:"mr-2",children:E(Fe,{tag:"circle-exclamation"})}),e]}),E("div",{className:"mt-2 text-sm leading-5",children:t})]})},RA=({children:e})=>{const{asDialog:t,closeContainer:n,isOpen:r}=cf(),o=N.useRef(null);return N.useEffect(()=>{if(!o.current)return;let i,s;const a=l=>{var u,c;if(l.key==="Escape"&&n(),l.key==="Tab"){const d=(c=(u=document.activeElement)==null?void 0:u.shadowRoot)==null?void 0:c.activeElement;l.shiftKey?d===i&&(s==null||s.focus(),l.preventDefault()):d===s&&(i==null||i.focus(),l.preventDefault())}};if(t){const l=o.current.querySelectorAll("button");i=l[0],s=l[l.length-1],s==null||s.focus(),document.addEventListener("keydown",a)}return()=>{document.removeEventListener("keydown",a)}},[t,n]),r?E("section",{className:`flex w-full justify-center px-6 ${t?"fixed top-0 z-50 h-full items-start py-36 backdrop-blur-sm backdrop-grayscale":"absolute top-10 z-10 translate-y-1/2 items-center"}`,ref:t?o:void 0,children:e}):null},NA=({asDialog:e=!1,open:t,children:n})=>E(_A,{asDialog:e,open:t,children:E(RA,{children:n})}),OA=()=>{const t=ee(n=>n.httpError)==="document-sync";return t?E(NA,{asDialog:!0,open:t,children:E(wA,{title:b(x.DOCUMENT_OUT_OF_SYNC),children:E(xA,{})})}):null},xA=()=>{const{closeContainer:e}=cf(),t=()=>{window.location.reload()};return k(ve,{children:[E("p",{children:b(x.TOAST_DOCUMENT_OUT_OF_SYNC)}),k("div",{className:"mt-11 flex items-center justify-center gap-x-6",children:[E("button",{className:"rounded-md border border-background bg-foreground px-3.5 py-2.5 font-bold tracking-widest text-background",onClick:e,children:b(x.IGNORE)}),E("button",{className:"rounded-md border border-background bg-positive/70 px-3.5 py-2.5 font-bold tracking-widest text-background",onClick:t,children:b(x.RESYNC)})]})]})};function Y0(e){let t;try{t=e()}catch{return}return{getItem:r=>{var o;const i=a=>a===null?null:JSON.parse(a),s=(o=t.getItem(r))!=null?o:null;return s instanceof Promise?s.then(i):i(s)},setItem:(r,o)=>t.setItem(r,JSON.stringify(o)),removeItem:r=>t.removeItem(r)}}const ls=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return ls(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return ls(r)(n)}}}},TA=(e,t)=>(n,r,o)=>{let i={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:y=>y,version:0,merge:(y,p)=>({...p,...y}),...t},s=!1;const a=new Set,l=new Set;let u;try{u=i.getStorage()}catch{}if(!u)return e((...y)=>{console.warn(`[zustand persist middleware] Unable to update item '${i.name}', the given storage is currently unavailable.`),n(...y)},r,o);const c=ls(i.serialize),d=()=>{const y=i.partialize({...r()});let p;const g=c({state:y,version:i.version}).then(S=>u.setItem(i.name,S)).catch(S=>{p=S});if(p)throw p;return g},f=o.setState;o.setState=(y,p)=>{f(y,p),d()};const h=e((...y)=>{n(...y),d()},r,o);let m;const v=()=>{var y;if(!u)return;s=!1,a.forEach(g=>g(r()));const p=((y=i.onRehydrateStorage)==null?void 0:y.call(i,r()))||void 0;return ls(u.getItem.bind(u))(i.name).then(g=>{if(g)return i.deserialize(g)}).then(g=>{if(g)if(typeof g.version=="number"&&g.version!==i.version){if(i.migrate)return i.migrate(g.state,g.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return g.state}).then(g=>{var S;return m=i.merge(g,(S=r())!=null?S:h),n(m,!0),d()}).then(()=>{p==null||p(m,void 0),s=!0,l.forEach(g=>g(m))}).catch(g=>{p==null||p(void 0,g)})};return o.persist={setOptions:y=>{i={...i,...y},y.getStorage&&(u=y.getStorage())},clearStorage:()=>{u==null||u.removeItem(i.name)},getOptions:()=>i,rehydrate:()=>v(),hasHydrated:()=>s,onHydrate:y=>(a.add(y),()=>{a.delete(y)}),onFinishHydration:y=>(l.add(y),()=>{l.delete(y)})},v(),m||h},CA=(e,t)=>(n,r,o)=>{let i={storage:Y0(()=>localStorage),partialize:v=>v,version:0,merge:(v,y)=>({...y,...v}),...t},s=!1;const a=new Set,l=new Set;let u=i.storage;if(!u)return e((...v)=>{console.warn(`[zustand persist middleware] Unable to update item '${i.name}', the given storage is currently unavailable.`),n(...v)},r,o);const c=()=>{const v=i.partialize({...r()});return u.setItem(i.name,{state:v,version:i.version})},d=o.setState;o.setState=(v,y)=>{d(v,y),c()};const f=e((...v)=>{n(...v),c()},r,o);let h;const m=()=>{var v;if(!u)return;s=!1,a.forEach(p=>p(r()));const y=((v=i.onRehydrateStorage)==null?void 0:v.call(i,r()))||void 0;return ls(u.getItem.bind(u))(i.name).then(p=>{if(p)if(typeof p.version=="number"&&p.version!==i.version){if(i.migrate)return i.migrate(p.state,p.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return p.state}).then(p=>{var g;return h=i.merge(p,(g=r())!=null?g:f),n(h,!0),c()}).then(()=>{y==null||y(h,void 0),s=!0,l.forEach(p=>p(h))}).catch(p=>{y==null||y(void 0,p)})};return o.persist={setOptions:v=>{i={...i,...v},v.storage&&(u=v.storage)},clearStorage:()=>{u==null||u.removeItem(i.name)},getOptions:()=>i,rehydrate:()=>m(),hasHydrated:()=>s,onHydrate:v=>(a.add(v),()=>{a.delete(v)}),onFinishHydration:v=>(l.add(v),()=>{l.delete(v)})},m(),h||f},IA=(e,t)=>{var n;return"getStorage"in t||"serialize"in t||"deserialize"in t?(((n={VITE_BASE_URL:"",VITE_BASIC_AUTH:"signalwire:1aG93uXk",VITE_DEFAULT_STYLE_HREF:"https://cdn.swire.io/npm/@signalwire/cfb@dev/dist/style.css",VITE_DEFAULT_VOICES_URL:"https://cdn.signalwire.com/npm/@signalwire/cfb@dev/dist/voices.json",BASE_URL:"/cfb/",MODE:"staging",DEV:!1,PROD:!0,SSR:!1})==null?void 0:n.MODE)!=="production"&&console.warn("[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead."),TA(e,t)):CA(e,t)},W0=window,K0={showAllNodes:!1,showDevOptions:!1},xr=Ii()(IA(e=>({...K0,toggleFlag:t=>{e(n=>({...n,[t]:!n[t]}))}}),{name:"flags",storage:Y0(()=>localStorage),version:0}));xr.subscribe(e=>{console.log("feature flags changed",e)});const bA=e=>{const t=(r,o)=>{xr.setState(i=>({...i,[r]:o}))},n=r=>{const o=xr.getState(),i={...r};return Object.entries(o).forEach(([s,a])=>{s in i&&typeof a=="boolean"&&(i[s]=a)}),i};if(W0){const r=new Proxy(n(e),{get:(o,i)=>Reflect.get(o,i),set:(o,i,s)=>{if(typeof s=="boolean"&&i in o)t(i,s);else throw new Error("unknown flag");return Reflect.set(o,i,s)}});W0.swFlags=r}},AA=()=>bA(K0),{apiVersion:LA,builderVersion:DA,cfbAppVersion:kA,relayMLVersion:PA}=bd(),MA={[x.API_VERSION]:LA,[x.APP_VERSION]:kA,[x.BUILDER_VERSION]:DA,[x.RELAYML_VERSION]:PA},UA=()=>{const e=()=>{var r;((r=n.current)==null?void 0:r.open)===!1&&n.current.showModal()},t=()=>{var r;(r=n.current)!=null&&r.open&&n.current.close()},n=pt.useRef(null);return k("section",{className:"ml-4 mt-4",children:[E("menu",{children:E("button",{className:"text-xs text-foreground hover:underline",onClick:e,children:b(x.ABOUT)})}),E("dialog",{ref:n,className:"aspect-[5/4] w-72 max-w-xs overflow-hidden rounded-lg border border-foreground/10 bg-background text-foreground shadow-xl backdrop:backdrop-blur-sm backdrop:backdrop-brightness-95",children:k("div",{className:"h-full px-2 pb-10",children:[k("div",{className:"flex items-center justify-between",children:[E("h2",{className:"text-2xl leading-10",children:b(x.ABOUT)}),k("button",{className:"my-0.5 -mr-1.5 rounded-md py-0.5 px-1.5 ",onClick:t,children:[E("span",{className:"sr-only",children:b(x.CLOSE)}),E(Fe,{tag:"xmark",size:"lg"})]})]}),k("div",{className:"h-full overflow-y-auto",children:[E("ul",{className:"mt-1 flex flex-col items-center justify-center text-sm",children:Object.entries(MA).map(([r,o])=>E("li",{className:"text-foreground/70",children:k("p",{children:[b(r),": ",o]})},r))}),E("div",{className:"mt-6 flex items-center justify-center ",children:E("button",{className:"rounded-md border border-foreground/10 bg-positive px-3.5 py-2.5 font-bold tracking-widest text-background",onClick:t,children:b(x.CLOSE)})})]})]})})]})},FA=()=>{const e=ee(t=>t.backButtonHref);return e?k("a",{href:e,children:[E("span",{className:"sr-only",children:b(x.NAVIGATE_BACK)}),E(Fe,{tag:"arrow-left",className:"text-negative",size:"lg"})]}):null},VA=()=>k("div",{className:"rounded-sm border border-gray-200 p-2",children:[E("h3",{className:"w-full",children:"Feature Flags"}),k("div",{className:"flex flex-col gap-y-2 py-2",children:[E(Q0,{flagName:"showAllNodes"}),E(Q0,{flagName:"showDevOptions"})]})]}),Q0=({flagName:e})=>{const t=xr(o=>o.toggleFlag),r=xr(o=>o[e])?"translate-x-5 bg-positive":"translate-x-0 bg-negative";return k("label",{className:"flex cursor-pointer items-center",children:[k("div",{className:"relative",children:[E("input",{type:"checkbox",className:"sr-only",onChange:()=>t(e)}),E("div",{className:"h-5 w-10 rounded-full bg-foreground/70",children:E("div",{className:`absolute left-1 top-1 h-3 w-3 rounded-full transition ${r}`})})]}),E("p",{className:"ml-3 text-sm font-medium",children:e})]})},X0={action:{label:x.ACTION,nodes:{answer:{active:!0,label:x.ANSWER_CALL},hangup:{active:!0,label:x.HANG_UP_CALL},sendSms:{active:!0,label:x.SEND_SMS},play:{active:!0,label:x.PLAY_AUDIO_TTS}}},decision:{label:x.DECISION,nodes:{cond:{active:!0,label:x.CONDITIONS},set:{active:!0,label:x.SET_VARIABLES},unset:{active:!0,label:x.UNSET_VARIABLES}}},forwardTo:{label:x.FORWARD,nodes:{forwardAddress:{active:!1,label:x.FORWARD_TO_ADDRESS},forwardPhone:{active:!0,label:x.FORWARD_TO_PHONE},forwardResource:{active:!1,label:x.FORWARD_TO_RESOURCE}}},input:{label:x.INPUT,nodes:{promptPlay:{active:!0,label:x.GATHER_INPUT},request:{active:!0,deprecated:!0,label:x.REQUEST},condRequest:{active:!0,label:x.REQUEST}}},recording:{label:x.RECORD,nodes:{record:{active:!0,label:x.VOICEMAIL_RECORDING},recordCallStart:{active:!0,label:x.RECORD_CALL_START},recordCallStop:{active:!0,label:x.RECORD_CALL_STOP}}}},BA=(e,t)=>({label:b(X0[e].label),nodes:Object.entries(X0[e].nodes).map(([n,r])=>(r.active||t)&&{deprecated:Boolean(r.deprecated),title:b(r.label),type:n}).filter(Boolean).sort((n,r)=>n.title.localeCompare(r.title))}),$A=["action","forwardTo","recording","input","decision"],HA=()=>{const e=xr(u=>u.showAllNodes),t=xr(u=>u.showDevOptions),n=ee(u=>u.addNode),r=ee(u=>u.flowTitle),o=ee(u=>u.exportStoreData),i=N.useRef(null),s=u=>{u.preventDefault(),i.current&&i.current.showModal()},a=N.useCallback(u=>{u.preventDefault();const{nodeType:c}=u.currentTarget.dataset;c&&n({nodeType:c})},[n]),l=N.useCallback(u=>{const{nodeType:c}=u.currentTarget.dataset;c&&(u.dataTransfer.setData(ty,c),u.dataTransfer.effectAllowed="move")},[]);return k(ve,{children:[k("section",{className:"hidden h-full w-1/6 min-w-[160px] shrink-0 flex-col bg-background py-4 text-foreground sm:flex",children:[k("nav",{className:"mx-4 flex shrink-0 items-center justify-between",children:[E(FA,{}),t&&E("button",{className:"rounded bg-positive p-1 px-2 text-xs text-white",onClick:s,children:"Dev Options"})]}),E("h1",{className:"m-4 block shrink-0 text-lg font-semibold leading-tight line-clamp-2",children:r}),E("ul",{className:"overflow-y-auto",id:"sidebar-node-list",children:$A.map(u=>E("li",{children:E(zA,{group:u,handleOnClick:a,handleDragStart:l,showAllNodes:e})},u))}),E(UA,{})]}),t&&E("dialog",{className:"z-50 my-10 rounded-lg border border-foreground/10 bg-background text-foreground",ref:i,children:E("form",{children:k("fieldset",{children:[k("legend",{className:"flex w-full justify-between pb-2",children:[E("h1",{className:"text-2xl leading-10",children:"Dev Options"}),k("button",{className:"p-1 pt-0 font-semibold",formMethod:"dialog",children:[E("span",{className:"sr-only",children:"Close"}),E(Fe,{tag:"xmark",size:"lg"})]})]}),k("div",{className:"mb-1 rounded-sm border border-gray-200 p-2",children:[E("h3",{className:"w-full",children:"Flow Data"}),E("div",{className:"flex flex-row gap-x-2 py-2",children:E("div",{className:"flex items-center",children:E("button",{type:"button",className:"rounded border bg-background px-2 py-1 text-sm hover:scale-105 hover:bg-background/80 active:scale-95",onClick:o,children:"View JSON File"})})})]}),E(VA,{})]})})})]})},zA=({group:e,handleOnClick:t,handleDragStart:n,showAllNodes:r})=>{const o=BA(e,r),i=`ngm-heading-${lT(o.label)}`;return k(ve,{children:[E("h2",{className:"px-4 pb-2 text-sm uppercase text-foreground/50",id:i,children:o.label}),E("ul",{"aria-labelledby":i,className:"flex-1 px-4 pb-2",children:o.nodes.map(s=>E("li",{children:k("button",{className:"mb-2 block w-full rounded-lg border border-foreground/10 p-3 text-center text-sm line-clamp-1 hover:shadow-md",onClick:t,onDragStart:n,"data-node-type":s.type,draggable:!0,children:[s.title,s.deprecated&&k("p",{className:"inline-block text-xs text-foreground/70",children:[" ",b(x.DEPRECATED)]})]})},s.type))})]})},jA=()=>{const e=N.useRef(null),[t,n]=N.useState(),[r,o]=N.useState(null);return N.useLayoutEffect(()=>(e.current=new ResizeObserver(([i])=>n(i)),r&&e.current.observe(r),()=>{var i;return(i=e.current)==null?void 0:i.disconnect()}),[r]),{setTarget:o,observerEntry:t}},GA=e=>{ee.setState({flowInteractive:e})},YA=({rootAppHeight:e,rootAppWidth:t})=>{ee.setState({rootAppHeight:e,rootAppWidth:t})},WA=()=>{const{observerEntry:e,setTarget:t}=jA(),n=ee(o=>o.initializing),r=ee(o=>o.rootAppWidth);return N.useEffect(()=>{!n&&r&&GA(r>=ny)},[n,r]),N.useEffect(()=>{e&&(Ze().log("resized",{rootAppHeight:e.contentRect.height,rootAppWidth:e.contentRect.width}),YA({rootAppHeight:e.contentRect.height,rootAppWidth:e.contentRect.width}))},[e]),{rootTarget:t}},Hk="";function KA(){Ze().debug("Hello World!");const{rootTarget:e}=WA(),t=ee(o=>o.colorMode)??"",n=ee(o=>o.httpError),r=n!==void 0&&n!=="document-sync";return E(ve,{children:E("div",{className:`${t} flex h-full w-full bg-backgroundAlt text-foreground`,ref:e,children:r?E(xC,{errorType:n}):k(ve,{children:[E(HA,{}),E(OA,{}),k(Rb,{children:[E(Mb,{}),E(EA,{})]})]})})})}const QA=`@font-face{font-family:SWInter;font-style:normal;font-weight:400;font-display:swap;src:url(//cdn.signalwire.com/fonts/inter/Inter-Regular.woff2) format("woff2"),url(//cdn.signalwire.com/fonts/inter/Inter-Regular.woff) format("woff")}
69
- `,XA=e=>{if(!e||!e.getFlowURL||!e.updateFlowURL)throw new TypeError("Invalid or missing required params")};function qA(e){XA(e);const{backButtonHref:t,rootElementId:n="sw-cfb-root",styleHref:r="https://cdn.swire.io/npm/@signalwire/cfb@dev/dist/style.css",voicesURL:o="https://cdn.signalwire.com/npm/@signalwire/cfb@dev/dist/voices.json",getFlowURL:i,updateFlowURL:s,deployFlowURL:a}=e;af.getState().init({voicesURL:o}),ee.setState({backButtonHref:t,deployFlowURL:a,getFlowURL:i,rootElementId:n,updateFlowURL:s}),dC(),AA();const l=document.getElementById(n);if(!l)throw new Error(`Id: '${n}' not found in the DOM`);l.attachShadow({mode:"open"}),l.shadowRoot&&Ol.createRoot(l.shadowRoot).render(k(N.StrictMode,{children:[E("link",{type:"text/css",rel:"stylesheet",href:r}),E(KA,{})]}));const u=document.createElement("style");document.head.appendChild(u),u.appendChild(document.createTextNode(QA))}Pr.main=qA,Object.defineProperty(Pr,Symbol.toStringTag,{value:"Module"})});
68
+ focus:outline-none focus:ring-1 focus:ring-foreground`,onClick:f,onKeyDown:c,type:"button",children:h>0?b(x.NUMBER_OF_VARIABLES_SELECTED,{count:h}):b(x.SELECT_VARIABLES)}),o.listOpen&&k("ul",{"aria-activedescendant":o.currentFocus,"aria-labelledby":"listbox-label","aria-multiselectable":"true",className:"mt-1 max-h-60 w-full overflow-auto rounded-lg border border-foreground/10 bg-backgroundAlt py-1 shadow-xl",role:"listbox",children:[!o.setVariablesList.length&&E("li",{"aria-disabled":"true",className:"relative",role:"option",children:E("label",{className:"flex select-none items-center py-2 pl-3 pr-9",children:b(x.NO_VARIABLES_SET)})}),o.setVariablesList.map((m,v)=>E("li",{"aria-selected":m.selected,className:"relative",id:m.id,role:"option",children:k("label",{className:"flex select-none items-center py-2 pl-3 pr-9",children:[E("input",{checked:m.selected,className:"mr-2 h-4 w-4 rounded accent-primary",onChange:()=>a(v),onKeyDown:y=>d(y,v),type:"checkbox"}),m.key]})},m.id))]})]})]}),h>0&&k("section",{className:"pt-3",children:[E("h3",{className:"mb-2 leading-5 text-foreground",children:b(x.UNSET_VARIABLES)}),E("ul",{className:"flex flex-wrap gap-2",children:o.unsetVariables.map((m,v)=>E($C,{handleClick:()=>l(v),children:m.key},m.id))})]})]})},yA=(e,t)=>{if("options"in t)switch(e.type){case"promptPlay":case"cond":return!0}return!1},EA=()=>{const e=ee(c=>c.selectedNode),t=ee(c=>c.partialUpdateNodeData),n=e==null?void 0:e.data,r=e==null?void 0:e.id,{updateDynamicHandles:o}=Vb(e);if(!(e&&n&&r))return null;const i=c=>{const d=new FormData(c.currentTarget),f=Object.fromEntries(d.entries());t(r,{...f,missingRequiredParams:!P0(f)})},s=(c,d)=>{typeof d=="boolean"&&(c.missingRequiredParams=!d),yA(e,c)&&o(c),t(r,c)},a={cond:()=>E(Jb,{nodeData:n,handleOnUpdate:s}),condRequest:()=>E(qb,{nodeData:n,handleOnUpdate:s}),forwardAddress:()=>E(af,{destinationType:"address",nodeData:n,handleOnUpdate:s}),forwardPhone:()=>E(af,{destinationType:"phone",nodeData:n,handleOnUpdate:s}),forwardResource:()=>E(af,{destinationType:"resource",nodeData:n,handleOnUpdate:s}),hangup:()=>E(oA,{nodeData:n,handleOnChange:i}),play:()=>E(iA,{nodeData:n,handleOnUpdate:s}),promptPlay:()=>E(rA,{nodeData:n,handleOnUpdate:s}),set:()=>E(pA,{nodeData:n,handleOnUpdate:s}),unset:()=>E(vA,{nodeData:n,handleOnUpdate:s}),record:()=>E(lA,{nodeData:n,handleOnUpdate:s}),recordCallStart:()=>E(sA,{nodeData:n,handleOnUpdate:s}),recordCallStop:()=>E(aA,{nodeData:n,handleOnChange:i}),sendSms:()=>E(fA,{nodeData:n,handleOnUpdate:s}),request:()=>E(dA,{nodeData:n,handleOnUpdate:s})};if(!(c=>Boolean(c in a))(e.type))return null;const u=a[e.type];return E(rd,{className:"nokey flex max-h-[95%] w-[300px] flex-col overflow-hidden rounded-md border border-foreground/10 bg-background py-4",position:"top-right",children:E(u,{})})},SA=({asDialog:e=!1,open:t=!1}={})=>{const[n,r]=pt.useState(t);N.useEffect(()=>{r(t)},[t]);const o=N.useCallback(()=>r(!1),[]),i=N.useCallback(()=>r(!0),[]);return{asDialog:e,isOpen:n,closeContainer:o,openContainer:i}},G0=N.createContext(null),uf=()=>{const e=N.useContext(G0);if(e==null)throw new Error("Toast components must be wrapped in <ToastContainer />");return e},_A=({children:e,...t})=>{const n=SA(t);return E(G0.Provider,{value:n,children:e})},wA=({title:e,children:t})=>{const{asDialog:n}=uf();return k("div",{className:"max-w-xl rounded-lg bg-foreground p-4 text-background shadow-2xl transition-[transform,box-shadow] duration-500 will-change-transform hover:shadow-none",role:n?"dialog":"alert",children:[k("h2",{className:"text-lg font-semibold leading-6 tracking-wide",children:[E("span",{className:"mr-2",children:E(Fe,{tag:"circle-exclamation"})}),e]}),E("div",{className:"mt-2 text-sm leading-5",children:t})]})},RA=({children:e})=>{const{asDialog:t,closeContainer:n,isOpen:r}=uf(),o=N.useRef(null);return N.useEffect(()=>{if(!o.current)return;let i,s;const a=l=>{var u,c;if(l.key==="Escape"&&n(),l.key==="Tab"){const d=(c=(u=document.activeElement)==null?void 0:u.shadowRoot)==null?void 0:c.activeElement;l.shiftKey?d===i&&(s==null||s.focus(),l.preventDefault()):d===s&&(i==null||i.focus(),l.preventDefault())}};if(t){const l=o.current.querySelectorAll("button");i=l[0],s=l[l.length-1],s==null||s.focus(),document.addEventListener("keydown",a)}return()=>{document.removeEventListener("keydown",a)}},[t,n]),r?E("section",{className:`flex w-full justify-center px-6 ${t?"fixed top-0 z-50 h-full items-start py-36 backdrop-blur-sm backdrop-grayscale":"absolute top-10 z-10 translate-y-1/2 items-center"}`,ref:t?o:void 0,children:e}):null},NA=({asDialog:e=!1,open:t,children:n})=>E(_A,{asDialog:e,open:t,children:E(RA,{children:n})}),OA=()=>{const t=ee(n=>n.httpError)==="document-sync";return t?E(NA,{asDialog:!0,open:t,children:E(wA,{title:b(x.DOCUMENT_OUT_OF_SYNC),children:E(xA,{})})}):null},xA=()=>{const{closeContainer:e}=uf(),t=()=>{window.location.reload()};return k(ve,{children:[E("p",{children:b(x.TOAST_DOCUMENT_OUT_OF_SYNC)}),k("div",{className:"mt-11 flex items-center justify-center gap-x-6",children:[E("button",{className:"rounded-md border border-background bg-foreground px-3.5 py-2.5 font-bold tracking-widest text-background",onClick:e,children:b(x.IGNORE)}),E("button",{className:"rounded-md border border-background bg-positive/70 px-3.5 py-2.5 font-bold tracking-widest text-background",onClick:t,children:b(x.RESYNC)})]})]})};function Y0(e){let t;try{t=e()}catch{return}return{getItem:r=>{var o;const i=a=>a===null?null:JSON.parse(a),s=(o=t.getItem(r))!=null?o:null;return s instanceof Promise?s.then(i):i(s)},setItem:(r,o)=>t.setItem(r,JSON.stringify(o)),removeItem:r=>t.removeItem(r)}}const ls=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return ls(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return ls(r)(n)}}}},TA=(e,t)=>(n,r,o)=>{let i={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:y=>y,version:0,merge:(y,p)=>({...p,...y}),...t},s=!1;const a=new Set,l=new Set;let u;try{u=i.getStorage()}catch{}if(!u)return e((...y)=>{console.warn(`[zustand persist middleware] Unable to update item '${i.name}', the given storage is currently unavailable.`),n(...y)},r,o);const c=ls(i.serialize),d=()=>{const y=i.partialize({...r()});let p;const g=c({state:y,version:i.version}).then(S=>u.setItem(i.name,S)).catch(S=>{p=S});if(p)throw p;return g},f=o.setState;o.setState=(y,p)=>{f(y,p),d()};const h=e((...y)=>{n(...y),d()},r,o);let m;const v=()=>{var y;if(!u)return;s=!1,a.forEach(g=>g(r()));const p=((y=i.onRehydrateStorage)==null?void 0:y.call(i,r()))||void 0;return ls(u.getItem.bind(u))(i.name).then(g=>{if(g)return i.deserialize(g)}).then(g=>{if(g)if(typeof g.version=="number"&&g.version!==i.version){if(i.migrate)return i.migrate(g.state,g.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return g.state}).then(g=>{var S;return m=i.merge(g,(S=r())!=null?S:h),n(m,!0),d()}).then(()=>{p==null||p(m,void 0),s=!0,l.forEach(g=>g(m))}).catch(g=>{p==null||p(void 0,g)})};return o.persist={setOptions:y=>{i={...i,...y},y.getStorage&&(u=y.getStorage())},clearStorage:()=>{u==null||u.removeItem(i.name)},getOptions:()=>i,rehydrate:()=>v(),hasHydrated:()=>s,onHydrate:y=>(a.add(y),()=>{a.delete(y)}),onFinishHydration:y=>(l.add(y),()=>{l.delete(y)})},v(),m||h},CA=(e,t)=>(n,r,o)=>{let i={storage:Y0(()=>localStorage),partialize:v=>v,version:0,merge:(v,y)=>({...y,...v}),...t},s=!1;const a=new Set,l=new Set;let u=i.storage;if(!u)return e((...v)=>{console.warn(`[zustand persist middleware] Unable to update item '${i.name}', the given storage is currently unavailable.`),n(...v)},r,o);const c=()=>{const v=i.partialize({...r()});return u.setItem(i.name,{state:v,version:i.version})},d=o.setState;o.setState=(v,y)=>{d(v,y),c()};const f=e((...v)=>{n(...v),c()},r,o);let h;const m=()=>{var v;if(!u)return;s=!1,a.forEach(p=>p(r()));const y=((v=i.onRehydrateStorage)==null?void 0:v.call(i,r()))||void 0;return ls(u.getItem.bind(u))(i.name).then(p=>{if(p)if(typeof p.version=="number"&&p.version!==i.version){if(i.migrate)return i.migrate(p.state,p.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return p.state}).then(p=>{var g;return h=i.merge(p,(g=r())!=null?g:f),n(h,!0),c()}).then(()=>{y==null||y(h,void 0),s=!0,l.forEach(p=>p(h))}).catch(p=>{y==null||y(void 0,p)})};return o.persist={setOptions:v=>{i={...i,...v},v.storage&&(u=v.storage)},clearStorage:()=>{u==null||u.removeItem(i.name)},getOptions:()=>i,rehydrate:()=>m(),hasHydrated:()=>s,onHydrate:v=>(a.add(v),()=>{a.delete(v)}),onFinishHydration:v=>(l.add(v),()=>{l.delete(v)})},m(),h||f},IA=(e,t)=>{var n;return"getStorage"in t||"serialize"in t||"deserialize"in t?(((n={VITE_BASE_URL:"",VITE_BASIC_AUTH:"signalwire:1aG93uXk",VITE_DEFAULT_STYLE_HREF:"https://cdn.swire.io/npm/@signalwire/cfb@dev/dist/style.css",VITE_DEFAULT_VOICES_URL:"https://cdn.signalwire.com/npm/@signalwire/cfb@dev/dist/voices.json",BASE_URL:"/cfb/",MODE:"staging",DEV:!1,PROD:!0,SSR:!1})==null?void 0:n.MODE)!=="production"&&console.warn("[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead."),TA(e,t)):CA(e,t)},W0=window,K0={showAllNodes:!1,showDevOptions:!1},xr=Ii()(IA(e=>({...K0,toggleFlag:t=>{e(n=>({...n,[t]:!n[t]}))}}),{name:"flags",storage:Y0(()=>localStorage),version:0}));xr.subscribe(e=>{console.log("feature flags changed",e)});const bA=e=>{const t=(r,o)=>{xr.setState(i=>({...i,[r]:o}))},n=r=>{const o=xr.getState(),i={...r};return Object.entries(o).forEach(([s,a])=>{s in i&&typeof a=="boolean"&&(i[s]=a)}),i};if(W0){const r=new Proxy(n(e),{get:(o,i)=>Reflect.get(o,i),set:(o,i,s)=>{if(typeof s=="boolean"&&i in o)t(i,s);else throw new Error("unknown flag");return Reflect.set(o,i,s)}});W0.swFlags=r}},AA=()=>bA(K0),{apiVersion:LA,builderVersion:DA,cfbAppVersion:kA,relayMLVersion:PA}=bd(),MA={[x.API_VERSION]:LA,[x.APP_VERSION]:kA,[x.BUILDER_VERSION]:DA,[x.RELAYML_VERSION]:PA},UA=()=>{const e=()=>{var r;((r=n.current)==null?void 0:r.open)===!1&&n.current.showModal()},t=()=>{var r;(r=n.current)!=null&&r.open&&n.current.close()},n=pt.useRef(null);return k("section",{className:"ml-4 mt-4",children:[E("menu",{children:E("button",{className:"text-xs text-foreground hover:underline",onClick:e,children:b(x.ABOUT)})}),E("dialog",{ref:n,className:"aspect-[5/4] w-72 max-w-xs overflow-hidden rounded-lg border border-foreground/10 bg-background text-foreground shadow-xl backdrop:backdrop-blur-sm backdrop:backdrop-brightness-95",children:k("div",{className:"h-full px-2 pb-10",children:[k("div",{className:"flex items-center justify-between",children:[E("h2",{className:"text-2xl leading-10",children:b(x.ABOUT)}),k("button",{className:"my-0.5 -mr-1.5 rounded-md py-0.5 px-1.5 ",onClick:t,children:[E("span",{className:"sr-only",children:b(x.CLOSE)}),E(Fe,{tag:"xmark",size:"lg"})]})]}),k("div",{className:"h-full overflow-y-auto",children:[E("ul",{className:"mt-1 flex flex-col items-center justify-center text-sm",children:Object.entries(MA).map(([r,o])=>E("li",{className:"text-foreground/70",children:k("p",{children:[b(r),": ",o]})},r))}),E("div",{className:"mt-6 flex items-center justify-center ",children:E("button",{className:"rounded-md border border-foreground/10 bg-positive px-3.5 py-2.5 font-bold tracking-widest text-background",onClick:t,children:b(x.CLOSE)})})]})]})})]})},FA=()=>{const e=ee(t=>t.backButtonHref);return e?k("a",{href:e,children:[E("span",{className:"sr-only",children:b(x.NAVIGATE_BACK)}),E(Fe,{tag:"arrow-left",className:"text-negative",size:"lg"})]}):null},VA=()=>k("div",{className:"rounded-sm border border-gray-200 p-2",children:[E("h3",{className:"w-full",children:"Feature Flags"}),k("div",{className:"flex flex-col gap-y-2 py-2",children:[E(Q0,{flagName:"showAllNodes"}),E(Q0,{flagName:"showDevOptions"})]})]}),Q0=({flagName:e})=>{const t=xr(o=>o.toggleFlag),r=xr(o=>o[e])?"translate-x-5 bg-positive":"translate-x-0 bg-negative";return k("label",{className:"flex cursor-pointer items-center",children:[k("div",{className:"relative",children:[E("input",{type:"checkbox",className:"sr-only",onChange:()=>t(e)}),E("div",{className:"h-5 w-10 rounded-full bg-foreground/70",children:E("div",{className:`absolute left-1 top-1 h-3 w-3 rounded-full transition ${r}`})})]}),E("p",{className:"ml-3 text-sm font-medium",children:e})]})},X0={action:{label:x.ACTION,nodes:{answer:{active:!0,label:x.ANSWER_CALL},hangup:{active:!0,label:x.HANG_UP_CALL},sendSms:{active:!0,label:x.SEND_SMS},play:{active:!0,label:x.PLAY_AUDIO_TTS}}},decision:{label:x.DECISION,nodes:{cond:{active:!0,label:x.CONDITIONS},set:{active:!0,label:x.SET_VARIABLES},unset:{active:!0,label:x.UNSET_VARIABLES}}},forwardTo:{label:x.FORWARD,nodes:{forwardAddress:{active:!1,label:x.FORWARD_TO_ADDRESS},forwardPhone:{active:!0,label:x.FORWARD_TO_PHONE},forwardResource:{active:!1,label:x.FORWARD_TO_RESOURCE}}},input:{label:x.INPUT,nodes:{promptPlay:{active:!0,label:x.GATHER_INPUT},request:{active:!0,deprecated:!0,label:x.REQUEST},condRequest:{active:!0,label:x.REQUEST}}},recording:{label:x.RECORD,nodes:{record:{active:!0,label:x.VOICEMAIL_RECORDING},recordCallStart:{active:!0,label:x.RECORD_CALL_START},recordCallStop:{active:!0,label:x.RECORD_CALL_STOP}}}},BA=(e,t)=>({label:b(X0[e].label),nodes:Object.entries(X0[e].nodes).map(([n,r])=>(r.active||t)&&{deprecated:Boolean(r.deprecated),title:b(r.label),type:n}).filter(Boolean).sort((n,r)=>n.title.localeCompare(r.title))}),$A=["action","forwardTo","recording","input","decision"],HA=()=>{const e=xr(u=>u.showAllNodes),t=xr(u=>u.showDevOptions),n=ee(u=>u.addNode),r=ee(u=>u.flowTitle),o=ee(u=>u.exportStoreData),i=N.useRef(null),s=u=>{u.preventDefault(),i.current&&i.current.showModal()},a=N.useCallback(u=>{u.preventDefault();const{nodeType:c}=u.currentTarget.dataset;c&&n({nodeType:c})},[n]),l=N.useCallback(u=>{const{nodeType:c}=u.currentTarget.dataset;c&&(u.dataTransfer.setData(ey,c),u.dataTransfer.effectAllowed="move")},[]);return k(ve,{children:[k("section",{className:"hidden h-full w-1/6 min-w-[160px] shrink-0 flex-col bg-background py-4 text-foreground sm:flex",children:[k("nav",{className:"mx-4 flex shrink-0 items-center justify-between",children:[E(FA,{}),t&&E("button",{className:"rounded bg-positive p-1 px-2 text-xs text-white",onClick:s,children:"Dev Options"})]}),E("h1",{className:"m-4 block shrink-0 text-lg font-semibold leading-tight line-clamp-2",children:r}),E("ul",{className:"overflow-y-auto",id:"sidebar-node-list",children:$A.map(u=>E("li",{children:E(zA,{group:u,handleOnClick:a,handleDragStart:l,showAllNodes:e})},u))}),E(UA,{})]}),t&&E("dialog",{className:"z-50 my-10 rounded-lg border border-foreground/10 bg-background text-foreground",ref:i,children:E("form",{children:k("fieldset",{children:[k("legend",{className:"flex w-full justify-between pb-2",children:[E("h1",{className:"text-2xl leading-10",children:"Dev Options"}),k("button",{className:"p-1 pt-0 font-semibold",formMethod:"dialog",children:[E("span",{className:"sr-only",children:"Close"}),E(Fe,{tag:"xmark",size:"lg"})]})]}),k("div",{className:"mb-1 rounded-sm border border-gray-200 p-2",children:[E("h3",{className:"w-full",children:"Flow Data"}),E("div",{className:"flex flex-row gap-x-2 py-2",children:E("div",{className:"flex items-center",children:E("button",{type:"button",className:"rounded border bg-background px-2 py-1 text-sm hover:scale-105 hover:bg-background/80 active:scale-95",onClick:o,children:"View JSON File"})})})]}),E(VA,{})]})})})]})},zA=({group:e,handleOnClick:t,handleDragStart:n,showAllNodes:r})=>{const o=BA(e,r),i=`ngm-heading-${lT(o.label)}`;return k(ve,{children:[E("h2",{className:"px-4 pb-2 text-sm uppercase text-foreground/50",id:i,children:o.label}),E("ul",{"aria-labelledby":i,className:"flex-1 px-4 pb-2",children:o.nodes.map(s=>E("li",{children:k("button",{className:"mb-2 block w-full rounded-lg border border-foreground/10 p-3 text-center text-sm line-clamp-1 hover:shadow-md",onClick:t,onDragStart:n,"data-node-type":s.type,draggable:!0,children:[s.title,s.deprecated&&k("p",{className:"inline-block text-xs text-foreground/70",children:[" ",b(x.DEPRECATED)]})]})},s.type))})]})},jA=()=>{const e=N.useRef(null),[t,n]=N.useState(),[r,o]=N.useState(null);return N.useLayoutEffect(()=>(e.current=new ResizeObserver(([i])=>n(i)),r&&e.current.observe(r),()=>{var i;return(i=e.current)==null?void 0:i.disconnect()}),[r]),{setTarget:o,observerEntry:t}},GA=e=>{ee.setState({flowInteractive:e})},YA=({rootAppHeight:e,rootAppWidth:t})=>{ee.setState({rootAppHeight:e,rootAppWidth:t})},WA=()=>{const{observerEntry:e,setTarget:t}=jA(),n=ee(o=>o.initializing),r=ee(o=>o.rootAppWidth);return N.useEffect(()=>{!n&&r&&GA(r>=ty)},[n,r]),N.useEffect(()=>{e&&(Ze().log("resized",{rootAppHeight:e.contentRect.height,rootAppWidth:e.contentRect.width}),YA({rootAppHeight:e.contentRect.height,rootAppWidth:e.contentRect.width}))},[e]),{rootTarget:t}},Hk="";function KA(){Ze().debug("Hello World!");const{rootTarget:e}=WA(),t=ee(o=>o.colorMode)??"",n=ee(o=>o.httpError),r=n!==void 0&&n!=="document-sync";return E(ve,{children:E("div",{className:`${t} flex h-full w-full bg-backgroundAlt text-foreground`,ref:e,children:r?E(xC,{errorType:n}):k(ve,{children:[E(HA,{}),E(OA,{}),k(Rb,{children:[E(Mb,{}),E(EA,{})]})]})})})}const QA=`@font-face{font-family:SWInter;font-style:normal;font-weight:400;font-display:swap;src:url(//cdn.signalwire.com/fonts/inter/Inter-Regular.woff2) format("woff2"),url(//cdn.signalwire.com/fonts/inter/Inter-Regular.woff) format("woff")}
69
+ `,XA=e=>{if(!e||!e.getFlowURL||!e.updateFlowURL)throw new TypeError("Invalid or missing required params")};function qA(e){XA(e);const{backButtonHref:t,rootElementId:n="sw-cfb-root",styleHref:r="https://cdn.swire.io/npm/@signalwire/cfb@dev/dist/style.css",voicesURL:o="https://cdn.signalwire.com/npm/@signalwire/cfb@dev/dist/voices.json",getFlowURL:i,updateFlowURL:s,deployFlowURL:a}=e;sf.getState().init({voicesURL:o}),ee.setState({backButtonHref:t,deployFlowURL:a,getFlowURL:i,rootElementId:n,updateFlowURL:s}),dC(),AA();const l=document.getElementById(n);if(!l)throw new Error(`Id: '${n}' not found in the DOM`);l.attachShadow({mode:"open"}),l.shadowRoot&&Ol.createRoot(l.shadowRoot).render(k(N.StrictMode,{children:[E("link",{type:"text/css",rel:"stylesheet",href:r}),E(KA,{})]}));const u=document.createElement("style");document.head.appendChild(u),u.appendChild(document.createTextNode(QA))}Pr.main=qA,Object.defineProperty(Pr,Symbol.toStringTag,{value:"Module"})});