@signalwire/cfb 0.0.12-dev.202312071600.b820541.0 → 0.0.12

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.
Files changed (2) hide show
  1. package/dist/main.js +23 -23
  2. package/package.json +2 -2
package/dist/main.js CHANGED
@@ -1,8 +1,8 @@
1
1
  (function(Hr,ei){typeof exports=="object"&&typeof module<"u"?ei(exports):typeof define=="function"&&define.amd?define(["exports"],ei):(Hr=typeof globalThis<"u"?globalThis:Hr||self,ei(Hr.CFB={}))})(this,function(Hr){"use strict";/**
2
- * Visual Builder v0.0.11 [b820541] (https://signalwire.com)
2
+ * Visual Builder v0.0.11 [c590a61e] (https://signalwire.com)
3
3
  * Copyright 2018-2023 SignalWire.
4
4
  */
5
- function ei(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 Wl(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Xf={exports:{}},bs={},qf={exports:{}},ee={};/**
5
+ function ei(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 Yl(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Xf={exports:{}},Ls={},qf={exports:{}},ee={};/**
6
6
  * @license React
7
7
  * react.production.min.js
8
8
  *
@@ -10,7 +10,7 @@ function ei(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 ti=Symbol.for("react.element"),R_=Symbol.for("react.portal"),N_=Symbol.for("react.fragment"),w_=Symbol.for("react.strict_mode"),O_=Symbol.for("react.profiler"),T_=Symbol.for("react.provider"),A_=Symbol.for("react.context"),I_=Symbol.for("react.forward_ref"),b_=Symbol.for("react.suspense"),C_=Symbol.for("react.memo"),L_=Symbol.for("react.lazy"),Jf=Symbol.iterator;function D_(e){return e===null||typeof e!="object"?null:(e=Jf&&e[Jf]||e["@@iterator"],typeof e=="function"?e:null)}var Zf={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},ep=Object.assign,tp={};function zr(e,t,n){this.props=e,this.context=t,this.refs=tp,this.updater=n||Zf}zr.prototype.isReactComponent={},zr.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")},zr.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function np(){}np.prototype=zr.prototype;function Gl(e,t,n){this.props=e,this.context=t,this.refs=tp,this.updater=n||Zf}var Yl=Gl.prototype=new np;Yl.constructor=Gl,ep(Yl,zr.prototype),Yl.isPureReactComponent=!0;var rp=Array.isArray,op=Object.prototype.hasOwnProperty,Kl={current:null},ip={key:!0,ref:!0,__self:!0,__source:!0};function sp(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)op.call(t,r)&&!ip.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),c=0;c<a;c++)l[c]=arguments[c+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:ti,type:e,key:i,ref:s,props:o,_owner:Kl.current}}function k_(e,t){return{$$typeof:ti,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Ql(e){return typeof e=="object"&&e!==null&&e.$$typeof===ti}function P_(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var ap=/\/+/g;function Xl(e,t){return typeof e=="object"&&e!==null&&e.key!=null?P_(""+e.key):t.toString(36)}function Cs(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 ti:case R_:s=!0}}if(s)return s=e,o=o(s),e=r===""?"."+Xl(s,0):r,rp(o)?(n="",e!=null&&(n=e.replace(ap,"$&/")+"/"),Cs(o,t,n,"",function(c){return c})):o!=null&&(Ql(o)&&(o=k_(o,n+(!o.key||s&&s.key===o.key?"":(""+o.key).replace(ap,"$&/")+"/")+e)),t.push(o)),1;if(s=0,r=r===""?".":r+":",rp(e))for(var a=0;a<e.length;a++){i=e[a];var l=r+Xl(i,a);s+=Cs(i,t,n,l,o)}else if(l=D_(e),typeof l=="function")for(e=l.call(e),a=0;!(i=e.next()).done;)i=i.value,l=r+Xl(i,a++),s+=Cs(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 Ls(e,t,n){if(e==null)return e;var r=[],o=0;return Cs(e,r,"","",function(i){return t.call(n,i,o++)}),r}function M_(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 Ge={current:null},Ds={transition:null},j_={ReactCurrentDispatcher:Ge,ReactCurrentBatchConfig:Ds,ReactCurrentOwner:Kl};ee.Children={map:Ls,forEach:function(e,t,n){Ls(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Ls(e,function(){t++}),t},toArray:function(e){return Ls(e,function(t){return t})||[]},only:function(e){if(!Ql(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},ee.Component=zr,ee.Fragment=N_,ee.Profiler=O_,ee.PureComponent=Gl,ee.StrictMode=w_,ee.Suspense=b_,ee.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=j_,ee.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=ep({},e.props),o=e.key,i=e.ref,s=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,s=Kl.current),t.key!==void 0&&(o=""+t.key),e.type&&e.type.defaultProps)var a=e.type.defaultProps;for(l in t)op.call(t,l)&&!ip.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 c=0;c<l;c++)a[c]=arguments[c+2];r.children=a}return{$$typeof:ti,type:e.type,key:o,ref:i,props:r,_owner:s}},ee.createContext=function(e){return e={$$typeof:A_,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:T_,_context:e},e.Consumer=e},ee.createElement=sp,ee.createFactory=function(e){var t=sp.bind(null,e);return t.type=e,t},ee.createRef=function(){return{current:null}},ee.forwardRef=function(e){return{$$typeof:I_,render:e}},ee.isValidElement=Ql,ee.lazy=function(e){return{$$typeof:L_,_payload:{_status:-1,_result:e},_init:M_}},ee.memo=function(e,t){return{$$typeof:C_,type:e,compare:t===void 0?null:t}},ee.startTransition=function(e){var t=Ds.transition;Ds.transition={};try{e()}finally{Ds.transition=t}},ee.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")},ee.useCallback=function(e,t){return Ge.current.useCallback(e,t)},ee.useContext=function(e){return Ge.current.useContext(e)},ee.useDebugValue=function(){},ee.useDeferredValue=function(e){return Ge.current.useDeferredValue(e)},ee.useEffect=function(e,t){return Ge.current.useEffect(e,t)},ee.useId=function(){return Ge.current.useId()},ee.useImperativeHandle=function(e,t,n){return Ge.current.useImperativeHandle(e,t,n)},ee.useInsertionEffect=function(e,t){return Ge.current.useInsertionEffect(e,t)},ee.useLayoutEffect=function(e,t){return Ge.current.useLayoutEffect(e,t)},ee.useMemo=function(e,t){return Ge.current.useMemo(e,t)},ee.useReducer=function(e,t,n){return Ge.current.useReducer(e,t,n)},ee.useRef=function(e){return Ge.current.useRef(e)},ee.useState=function(e){return Ge.current.useState(e)},ee.useSyncExternalStore=function(e,t,n){return Ge.current.useSyncExternalStore(e,t,n)},ee.useTransition=function(){return Ge.current.useTransition()},ee.version="18.2.0",qf.exports=ee;var N=qf.exports;const Wr=Wl(N),lp=ei({__proto__:null,default:Wr},[N]);/**
13
+ */var ti=Symbol.for("react.element"),x_=Symbol.for("react.portal"),R_=Symbol.for("react.fragment"),N_=Symbol.for("react.strict_mode"),w_=Symbol.for("react.profiler"),O_=Symbol.for("react.provider"),T_=Symbol.for("react.context"),A_=Symbol.for("react.forward_ref"),I_=Symbol.for("react.suspense"),b_=Symbol.for("react.memo"),C_=Symbol.for("react.lazy"),Jf=Symbol.iterator;function L_(e){return e===null||typeof e!="object"?null:(e=Jf&&e[Jf]||e["@@iterator"],typeof e=="function"?e:null)}var Zf={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},ep=Object.assign,tp={};function zr(e,t,n){this.props=e,this.context=t,this.refs=tp,this.updater=n||Zf}zr.prototype.isReactComponent={},zr.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")},zr.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function np(){}np.prototype=zr.prototype;function Kl(e,t,n){this.props=e,this.context=t,this.refs=tp,this.updater=n||Zf}var Ql=Kl.prototype=new np;Ql.constructor=Kl,ep(Ql,zr.prototype),Ql.isPureReactComponent=!0;var rp=Array.isArray,op=Object.prototype.hasOwnProperty,Xl={current:null},ip={key:!0,ref:!0,__self:!0,__source:!0};function sp(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)op.call(t,r)&&!ip.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),c=0;c<a;c++)l[c]=arguments[c+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:ti,type:e,key:i,ref:s,props:o,_owner:Xl.current}}function D_(e,t){return{$$typeof:ti,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function ql(e){return typeof e=="object"&&e!==null&&e.$$typeof===ti}function k_(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var ap=/\/+/g;function Jl(e,t){return typeof e=="object"&&e!==null&&e.key!=null?k_(""+e.key):t.toString(36)}function Ds(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 ti:case x_:s=!0}}if(s)return s=e,o=o(s),e=r===""?"."+Jl(s,0):r,rp(o)?(n="",e!=null&&(n=e.replace(ap,"$&/")+"/"),Ds(o,t,n,"",function(c){return c})):o!=null&&(ql(o)&&(o=D_(o,n+(!o.key||s&&s.key===o.key?"":(""+o.key).replace(ap,"$&/")+"/")+e)),t.push(o)),1;if(s=0,r=r===""?".":r+":",rp(e))for(var a=0;a<e.length;a++){i=e[a];var l=r+Jl(i,a);s+=Ds(i,t,n,l,o)}else if(l=L_(e),typeof l=="function")for(e=l.call(e),a=0;!(i=e.next()).done;)i=i.value,l=r+Jl(i,a++),s+=Ds(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 ks(e,t,n){if(e==null)return e;var r=[],o=0;return Ds(e,r,"","",function(i){return t.call(n,i,o++)}),r}function P_(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 Ye={current:null},Ps={transition:null},M_={ReactCurrentDispatcher:Ye,ReactCurrentBatchConfig:Ps,ReactCurrentOwner:Xl};ee.Children={map:ks,forEach:function(e,t,n){ks(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return ks(e,function(){t++}),t},toArray:function(e){return ks(e,function(t){return t})||[]},only:function(e){if(!ql(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},ee.Component=zr,ee.Fragment=R_,ee.Profiler=w_,ee.PureComponent=Kl,ee.StrictMode=N_,ee.Suspense=I_,ee.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=M_,ee.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=ep({},e.props),o=e.key,i=e.ref,s=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,s=Xl.current),t.key!==void 0&&(o=""+t.key),e.type&&e.type.defaultProps)var a=e.type.defaultProps;for(l in t)op.call(t,l)&&!ip.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 c=0;c<l;c++)a[c]=arguments[c+2];r.children=a}return{$$typeof:ti,type:e.type,key:o,ref:i,props:r,_owner:s}},ee.createContext=function(e){return e={$$typeof:T_,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:O_,_context:e},e.Consumer=e},ee.createElement=sp,ee.createFactory=function(e){var t=sp.bind(null,e);return t.type=e,t},ee.createRef=function(){return{current:null}},ee.forwardRef=function(e){return{$$typeof:A_,render:e}},ee.isValidElement=ql,ee.lazy=function(e){return{$$typeof:C_,_payload:{_status:-1,_result:e},_init:P_}},ee.memo=function(e,t){return{$$typeof:b_,type:e,compare:t===void 0?null:t}},ee.startTransition=function(e){var t=Ps.transition;Ps.transition={};try{e()}finally{Ps.transition=t}},ee.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")},ee.useCallback=function(e,t){return Ye.current.useCallback(e,t)},ee.useContext=function(e){return Ye.current.useContext(e)},ee.useDebugValue=function(){},ee.useDeferredValue=function(e){return Ye.current.useDeferredValue(e)},ee.useEffect=function(e,t){return Ye.current.useEffect(e,t)},ee.useId=function(){return Ye.current.useId()},ee.useImperativeHandle=function(e,t,n){return Ye.current.useImperativeHandle(e,t,n)},ee.useInsertionEffect=function(e,t){return Ye.current.useInsertionEffect(e,t)},ee.useLayoutEffect=function(e,t){return Ye.current.useLayoutEffect(e,t)},ee.useMemo=function(e,t){return Ye.current.useMemo(e,t)},ee.useReducer=function(e,t,n){return Ye.current.useReducer(e,t,n)},ee.useRef=function(e){return Ye.current.useRef(e)},ee.useState=function(e){return Ye.current.useState(e)},ee.useSyncExternalStore=function(e,t,n){return Ye.current.useSyncExternalStore(e,t,n)},ee.useTransition=function(){return Ye.current.useTransition()},ee.version="18.2.0",qf.exports=ee;var w=qf.exports;const Wr=Yl(w),lp=ei({__proto__:null,default:Wr},[w]);/**
14
14
  * @license React
15
15
  * react-jsx-runtime.production.min.js
16
16
  *
@@ -18,7 +18,7 @@ function ei(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 U_=N,F_=Symbol.for("react.element"),V_=Symbol.for("react.fragment"),$_=Object.prototype.hasOwnProperty,B_=U_.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,H_={key:!0,ref:!0,__self:!0,__source:!0};function cp(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)$_.call(t,r)&&!H_.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:F_,type:e,key:i,ref:s,props:o,_owner:B_.current}}bs.Fragment=V_,bs.jsx=cp,bs.jsxs=cp,Xf.exports=bs;var u=Xf.exports,z_=Object.create,ql=Object.defineProperty,W_=Object.getOwnPropertyDescriptor,G_=Object.getOwnPropertyNames,Y_=Object.getPrototypeOf,K_=Object.prototype.hasOwnProperty,Q_=(e,t,n)=>t in e?ql(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,X_=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),q_=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of G_(t))!K_.call(e,o)&&o!==n&&ql(e,o,{get:()=>t[o],enumerable:!(r=W_(t,o))||r.enumerable});return e},J_=(e,t,n)=>(n=e!=null?z_(Y_(e)):{},q_(t||!e||!e.__esModule?ql(n,"default",{value:e,enumerable:!0}):n,e)),Jl=(e,t,n)=>(Q_(e,typeof t!="symbol"?t+"":t,n),n),Z_=X_((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,g){var m=y[g];if(typeof m.bind=="function")return m.bind(y);try{return Function.prototype.bind.call(m,y)}catch{return function(){return Function.prototype.apply.apply(m,[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 c(y,g){for(var m=0;m<i.length;m++){var _=i[m];this[_]=m<y?n:this.methodFactory(_,y,g)}this.log=this.debug}function d(y,g,m){return function(){typeof console!==r&&(c.call(this,g,m),this[y].apply(this,arguments))}}function f(y,g,m){return l(y)||d.apply(this,arguments)}function p(y,g,m){var _=this,S;g=g??"WARN";var x="loglevel";typeof y=="string"?x+=":"+y:typeof y=="symbol"&&(x=void 0);function R(T){var b=(i[T]||"silent").toUpperCase();if(!(typeof window===r||!x)){try{window.localStorage[x]=b;return}catch{}try{window.document.cookie=encodeURIComponent(x)+"="+b+";"}catch{}}}function I(){var T;if(!(typeof window===r||!x)){try{T=window.localStorage[x]}catch{}if(typeof T===r)try{var b=window.document.cookie,V=b.indexOf(encodeURIComponent(x)+"=");V!==-1&&(T=/^([^;]+)/.exec(b.slice(V))[1])}catch{}return _.levels[T]===void 0&&(T=void 0),T}}function L(){if(!(typeof window===r||!x)){try{window.localStorage.removeItem(x);return}catch{}try{window.document.cookie=encodeURIComponent(x)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch{}}}_.name=y,_.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},_.methodFactory=m||f,_.getLevel=function(){return S},_.setLevel=function(T,b){if(typeof T=="string"&&_.levels[T.toUpperCase()]!==void 0&&(T=_.levels[T.toUpperCase()]),typeof T=="number"&&T>=0&&T<=_.levels.SILENT){if(S=T,b!==!1&&R(T),c.call(_,T,y),typeof console===r&&T<_.levels.SILENT)return"No console available for logging"}else throw"log.setLevel() called with invalid level: "+T},_.setDefaultLevel=function(T){g=T,I()||_.setLevel(T,!1)},_.resetLevel=function(){_.setLevel(g,!1),L()},_.enableAll=function(T){_.setLevel(_.levels.TRACE,T)},_.disableAll=function(T){_.setLevel(_.levels.SILENT,T)};var U=I();U==null&&(U=g),_.setLevel(U,!1)}var h=new p,v={};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 g=v[y];return g||(g=v[y]=new p(y,h.getLevel(),h.methodFactory)),g};var E=typeof window!==r?window.log:void 0;return h.noConflict=function(){return typeof window!==r&&window.log===h&&(window.log=E),h},h.getLoggers=function(){return v},h.default=h,h})}),eS=J_(Z_(),1),tS=()=>new Date().toISOString(),ni=eS.default.getLogger("signalwire"),nS=ni.methodFactory;ni.methodFactory=(e,t,n)=>{let r=nS(e,t,n);return function(...o){o.unshift(tS(),"-"),r(...o)}};var rS=ni.getLevel();ni.setLevel(rS);var Ae=()=>ni,oS="/api/ai/ai_agents",iS=(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),""),up=Ae(),sS=e=>typeof e=="object"&&e!==null&&"id"in e&&"type"in e&&"data"in e&&"position"in e,aS=e=>{if(!sS(e))throw up.error("nodeToDBShape: Invalid node",e),new Error;return{data:e.data,id:e.id,position:e.position,type:e.type}},lS=e=>typeof e=="object"&&e!==null&&"id"in e&&"source"in e&&"sourceHandle"in e&&"target"in e&&"targetHandle"in e,cS=e=>{if(!lS(e))throw up.error("edgeToDBShape: Invalid edge",e),new Error;return{id:e.id,source:e.source,sourceHandle:e.sourceHandle??null,target:e.target,targetHandle:e.targetHandle??null}},dp=e=>{var t;return(t=e==null?void 0:e.trim())==null?void 0:t.toLowerCase()},Gr=e=>e.replace(/\s/g,""),Zl=e=>{if(!(!e||typeof e=="string"&&e.trim().length===0))try{return JSON.parse(e)}catch{return typeof e=="string"?e.trim():e}},ec=e=>typeof e=="string"?e.trim():typeof e=="number"&&isNaN(e)||e==null||typeof e=="object"||typeof e=="function"||typeof e=="symbol"?"":String(e),uS=e=>e.split(",").map(t=>t.trim()).filter(Boolean),ks=e=>{let t=Zl(e);return t&&typeof t=="object"&&Object.keys(t).length?t:void 0},ie=()=>iS(),fp=e=>{let t=e===void 0?void 0:parseInt(e,10);return t===void 0||Number.isNaN(t)||t<=0?void 0:t},tc=({callStateEvents:e,callStateUrl:t,connections:n,defaultFrom:r,defaultTimeout:o,callOrder:i})=>{let s=fp(o),a=Gr(r),l=uS(e),c=t==null?void 0:t.trim(),d=n.map(({connectFrom:p,connectTimeout:h,connectTo:v})=>({call_state_events:l.length>0?l:void 0,call_state_url:c||void 0,from:Gr(p)||a||"%{call.from}",timeout:fp(h)??s,to:Gr(v)}));d.length||d.push({from:"%{call.from}",timeout:void 0,to:""});let f={switch:{case:{connected:[]},default:[{switch:{case:{busy:[],decline:[],error:[],noAnswer:[]},default:["hangup"],variable:"connect_failed_reason"}}],variable:"connect_result"}};switch(i){case"single":return[{connect:d[0]},f];case"serial":return[{connect:{serial:d}},f];case"parallel":return[{connect:{parallel:d}},f];default:return Ae().warn(`The type '${i}' is not supported yet.`),[{connect:d[0]},f]}},dS=/\bmale\b/i,fS=/\bfemale\b/i,pS=e=>{if(e){if(fS.test(e))return"female";if(dS.test(e))return"male"}},pp=(e,t)=>{if(typeof e=="object"&&!Array.isArray(e)){t.language&&(e.say_language=t.language);let n=pS(t.gender);n&&(e.say_gender=n),t.voice&&(e.say_voice=t.voice)}return e},hp=(e,t)=>{var n,r;if(typeof e=="object"&&!Array.isArray(e)){let o="url"in e?e.url:e.play,i,s=(n=t.text)==null?void 0:n.trim();if(Array.isArray(t.url)){let a=t.url.map(l=>l==null?void 0:l.trim()).filter(Boolean);i=(a==null?void 0:a.length)===1?a[0]:a}else i=(r=t.url)==null?void 0:r.trim();(!t.selected||t.selected==="url")&&i?o=i:(!t.selected||t.selected==="text")&&s&&(o=`say:${s}`),"url"in e?e.url=o:e.play=o}return e},hS={aiAgent:({data:{agent:e}})=>({ai:{agent:e}}),answer:({data:{maxDuration:e}})=>e?{answer:{max_duration:e}}:"answer",cond:()=>({cond:[]}),condRequest:({data:e})=>[{request:{body:Zl(e.body),connect_timeout:e.connectTimeout,headers:ks(e.headers),method:e.method,save_variables:e.saveVariables,timeout:e.timeout,url:e.url}},{switch:{case:{success:[]},default:[],variable:"request_result"}}],executeSWML:({data:e})=>({execute:{dest:e.dest,meta:ks(e.meta),params:ks(e.params),result:[]}}),forwardAddress:({data:e})=>tc(e),forwardPhone:({data:e})=>tc(e),forwardResource:({data:e})=>tc(e),handleCall:()=>"start",hangup:({data:{reason:e}})=>e?{hangup:{reason:e}}:"hangup",play:({data:e})=>{let{volume:t}=e,n=pp(hp({url:"say:Unknown TTS"},e),e);return t&&(n.volume=t),{play:n}},promptPlay:({data:e})=>{let{digitTimeout:t,initialTimeout:n,options:r,volume:o}=e,i=pp(hp({play:"say:Unknown value"},e),e);o&&(i.volume=o),n&&(i.initial_timeout=parseInt(n,10)),t&&(i.digit_timeout=parseInt(t,10));let s=r.reduce((a,l)=>{let c=dp(l.command);c&&a.speechHints.push(c);let d=Gr(l.digit);return d&&(a.maxDigits=Math.max(a.maxDigits,d.length)),a},{maxDigits:-1,speechHints:[]});return s.speechHints.length&&(i.speech_hints=s.speechHints,i.speech_language="en-US"),s.maxDigits>0&&(i.max_digits=s.maxDigits),[{prompt:i},{switch:{case:{failed:[{play:"say:Error while gathering input."},"hangup"],no_input:[],no_match:[]},default:[{switch:{case:{},default:[],variable:"prompt_value"}}],variable:"prompt_result"}}]},record:({data:e})=>{var n;let t={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:((n=e.terminators)==null?void 0:n.trim())||void 0};return e.maxLength&&(t.max_length=parseInt(e.maxLength,10)),{record:t}},recordCallStart:({data:e})=>{var t;return{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:((t=e.terminators)==null?void 0:t.trim())||void 0}}},recordCallStop:({data:e})=>({stop_record_call:e.controlId}),request:({data:e})=>[{request:{body:Zl(e.body),connect_timeout:e.connectTimeout,headers:ks(e.headers),method:e.method,save_variables:e.saveVariables,timeout:e.timeout,url:e.url}},{switch:{case:{success:[]},default:[],variable:"request_result"}}],sendSms:({data:e})=>{let{fromNumber:t,toNumber:n,body:r}=e;return{send_sms:{body:r,from_number:Gr(t),to_number:Gr(n)}}},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)})},dr=e=>{try{return hS[e.__type](e.node)}catch(t){throw Ae().error("Unknown Verb",e),t}},gS="1.0.0",mS=e=>{let t=Ae(),n=new Set,r=new Map,o=new Set,i=new Map([["main",[]]]),s=new Map,a="",l=S=>i.has(S),c=S=>o.has(S),d=S=>o.add(S);e.nodes.forEach(S=>{r.set(S.id,{children:[],node:S}),S.type==="handleCall"&&(a=S.id)}),e.edges.forEach(S=>{let x=r.get(S.source),R=r.get(S.target);if(!x||!R)return t.warn("Invalid edge:",S);x.children.push(S.target),S.sourceHandle&&s.set(S.sourceHandle,R),n.has(S.target)&&i.set(S.target,[]),n.add(S.target)});let f=[...i.keys()],p=(S,x)=>{var I,L,U;let R=s.get(x.id);if(R){let T=[];i.set(x.id,T),x.digit&&(S[x.digit]=T);let b=dp(x.command);b&&(S[b]=T);let V=l(R.node.id);if(V){let M={transfer:R.node.id};x.digit&&((I=S[x.digit])==null||I.push(M)),b&&!((L=S[b])!=null&&L.includes(M))&&((U=S[b])==null||U.push(M))}g({current:R,sectionName:V?R.node.id:x.id})}return S},h=(S,x)=>{var I;let R=s.get(x.id);if(R){let L=[];i.set(x.id,L),S[x.result]=L;let U=l(R.node.id);U&&((I=S[x.result])==null||I.push({transfer:R.node.id})),g({current:R,sectionName:U?R.node.id:x.id})}return S},v={else:(S,x)=>{if(x.result==="success")return S;let R=s.get(x.id);if(R){let I=[];i.set(x.id,I),S=I;let L=l(R.node.id);L&&S.push({transfer:R.node.id}),g({current:R,sectionName:L?R.node.id:x.id})}return S},then:(S,x)=>{if(x.result!=="success")return S;let R=s.get(x.id);if(R){let I=[];i.set(x.id,I),S=I;let L=l(R.node.id);L&&S.push({transfer:R.node.id}),g({current:R,sectionName:L?R.node.id:x.id})}return S}},E={fallback:S=>{let x=s.get(S),R={else:[]};if(x){let I=[];i.set(S,I),R.else=I;let L=l(x.node.id);L&&R.else.push({transfer:x.node.id}),g({current:x,sectionName:L?x.node.id:S})}return R},options:(S,x)=>{let R=s.get(x.id),I={then:[],when:x.value};if(R){let L=[];i.set(x.id,L),I.then=L;let U=l(R.node.id);U&&I.then.push({transfer:R.node.id}),S.push(I),g({current:R,sectionName:U?R.node.id:x.id})}return S}},y=S=>{let x=s.get(S),R=[];if(x){let I=[];i.set(S,I),R=I;let L=l(x.node.id);L&&R.push({transfer:x.node.id}),g({current:x,sectionName:L?x.node.id:S})}return R},g=({sectionName:S,current:x})=>{var I,L,U;if(c(x.node.id))return;d(x.node.id);let R=i.get(S);if(!R){t.warn("Unknown section name:",S);return}switch(x.node.type){case"promptPlay":{let T=dr({__type:x.node.type,node:x.node});if(!Array.isArray(T)){t.warn("Invalid gather node",T);return}(L=(I=x.node.data)==null?void 0:I.results)!=null&&L.length&&(T[1].switch.case={...T[1].switch.case,...x.node.data.results.reduce(h,{})}),T[1].switch.default[0].switch.case=x.node.data.options.reduce(p,{}),(U=T[1].switch.case)!=null&&U.no_match&&(T[1].switch.default[0].switch.default=T[1].switch.case.no_match),R.push(...T);return}case"cond":{let T=dr({__type:x.node.type,node:x.node});T.cond=x.node.data.options.reduce(E.options,[]),T.cond.push(E.fallback(x.node.data.fallback)),R.push(T);return}case"condRequest":{let T=dr({__type:x.node.type,node:x.node}),b=x.node.data.options.reduce(E.options,[]),V=E.fallback(x.node.data.fallback),M={cond:[...b,V]};T[1].switch.case.success=[M],T[1].switch.default=y(x.node.data.error),R.push(...T);return}case"executeSWML":{let T=dr({__type:x.node.type,node:x.node}),b=x.node.data.options.reduce(E.options,[]),V=E.fallback(x.node.data.fallback);T.execute.result=[...b,V],R.push(T);return}case"forwardPhone":case"forwardAddress":case"forwardResource":{let T=dr({__type:x.node.type,node:x.node});if(!Array.isArray(T)){t.warn("Invalid connect node",T);return}x.node.data.options.length&&(T[1].switch.case.connected=x.node.data.options.reduce(v.then,[]),T[1].switch.default[0].switch.case=x.node.data.options.filter(b=>b.result!=="success").reduce(h,{})),R.push(...T);return}case"request":{let T=dr({__type:x.node.type,node:x.node});if(!Array.isArray(T)){t.warn("Invalid request node",T);return}T[1].switch.case.success=x.node.data.options.reduce(v.then,[]),T[1].switch.default=x.node.data.options.reduce(v.else,[]),R.push(...T);return}default:{let T=dr({__type:x.node.type,node:x.node});x.node.type!=="handleCall"&&R.push(T),x.children.forEach(b=>{let V=r.get(b);if(!V)return t.warn("Invalid Child Node",b);let M=l(b);M&&R.push({transfer:b}),g({current:V,sectionName:M?b:S})});break}}},m=r.get(a);m&&g({current:m,sectionName:"main"});let _={};return f.forEach(S=>{let x=i.get(S);x&&(_[S]=x)}),t.debug("sections",JSON.stringify(_)),{sections:_,version:gS}},vS=class S_ extends Error{constructor(t,n){super(n),this.code=t,this.message=n,Jl(this,"name","AuthError"),Object.setPrototypeOf(this,S_.prototype)}},ES=class x_ extends Error{constructor(t,n,r){super(n),this.code=t,this.message=n,this.response=r,Jl(this,"name","HttpError"),Object.setPrototypeOf(this,x_.prototype)}};async function yS(e,t){let n=await fetch(e,t);if(!n.ok){if(n.status===401)throw new vS(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 ES(n.status,o,r)}try{n.parsedBody??(n.parsedBody=await n.json())}catch{}return n}var _S=({timeout:e=3e4,...t},n=yS)=>async(r,o)=>{let i={...o!=null&&o.body?{"Content-Type":"application/json"}:{},...t.headers,...o==null?void 0:o.headers},s=xS({...t,...o,headers:i});s.credentials="same-origin";let a;if(e){let l=new AbortController,c=l.signal;s.signal=c,a=setTimeout(()=>{l.abort()},e)}try{return{body:(await n(RS({searchParams:o==null?void 0:o.searchParams,url:r}),s)).parsedBody}}finally{a&&clearTimeout(a)}},SS=e=>typeof e=="string"?e:JSON.stringify(e),xS=e=>Object.entries(e).reduce((t,[n,r])=>n==="body"?{...t,body:SS(r)}:r!=null?{...t,[n]:r}:t,{}),RS=({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()},gp=e=>{let t=Ae(),n=_S(e);return{deployFlow:async r=>{if(!e.deployFlowURL)throw new Error("deployFlowURL is not defined");let o={document_version:r.documentVersion},i=await n(e.deployFlowURL,{body:o,method:"POST"});return t.info("deployFlow",i.body),i.body},getAiAgents:async()=>{try{if(!e.getAiAgentsURL)throw new Error("getAiAgentsURL is not defined");let{body:r}=await n(e.getAiAgentsURL);return t.info("getAiAgents",r),r}catch(r){throw t.error("Could not load AI agents. URL:",e.getAiAgentsURL),r}},getFlow:async()=>{try{if(!e.getFlowURL)throw new Error("getFlowURL is not defined");let{body:r}=await n(e.getFlowURL);return t.info("getFlow",r),r}catch(r){if(t.error("Could not load flow. URL:",e.getFlowURL),r instanceof Error)throw r;return{}}},getFlowVersions:async(r={})=>{if(!e.deployFlowURL)throw new Error("deployFlowURL is not defined");let{pageNumber:o,pageSize:i}=r,s=new URLSearchParams;o&&s.append("page_number",String(o)),i&&s.append("page_size",String(i));let a=s.toString(),l=e.deployFlowURL+(a?`?${a}`:"");try{let{body:c}=await n(l);return t.info("getFlowVersions",c),c.data}catch(c){throw t.error("Could not load flow versions. URL:",l),c}},putFlow:async r=>{if(!e.updateFlowURL)throw new Error("updateFlowURL is not defined");let o={type:"call_flow",document_version:r.documentVersion+1,flow_data:{flowDataVersion:r.flowDataVersion,nodes:r.nodes.map(aS),edges:r.edges.map(cS)},relayml:mS({nodes:r.nodes,edges:r.edges})},i=await n(e.updateFlowURL,{body:o,method:"PUT"});return t.info("putFlow",i.body),i.body}}},nc=[{from:"0.0.0",to:"0.0.1",run:e=>(e.nodes=e.nodes.map(t=>("missingRequiredParams"in t.data&&delete t.data.missingRequiredParams,t.data.initial=!1,"initialTimeout"in t.data&&(t.data.initialTimeout=ec(t.data.initialTimeout)),(t.type==="play"||t.type==="promptPlay")&&"selected"in t.data&&!t.data.selected&&(t.data.url?t.data.selected="url":t.data.text&&(t.data.selected="text")),t)),e)},{from:"0.0.1",to:"0.0.2",run:e=>(e.nodes=e.nodes.map(t=>{if("terminators"in t.data){let{terminators:n=""}=t.data;n.trim()||delete t.data.terminators}return t}),e)},{from:"0.0.2",to:"0.0.3",run:e=>(e.nodes=e.nodes.map(t=>{if(t.type==="forwardAddress"||t.type==="forwardPhone"||t.type==="forwardResource"){let{destinations:n=[],destinationType:r,initial:o,options:i,sessionTimeout:s,type:a,valid:l}=t.data,c=n.map(d=>({connectFrom:"",connectTimeout:"",connectTo:d,id:ie()}));t.data={callOrder:a,connections:c,defaultFrom:"",defaultTimeout:s?`${s}`:"",destinationType:r,initial:o,options:i,valid:l===void 0||l}}return t}),e)},{from:"0.0.3",to:"0.0.4",run:e=>(e.nodes=e.nodes.map(t=>((t.type==="answer"||t.type==="handleCall"||t.type==="hangup")&&(t.data.valid=!0),t)),e)},{from:"0.0.4",to:"0.0.5",run:e=>(e.nodes=e.nodes.map(t=>((t.type==="forwardAddress"||t.type==="forwardPhone"||t.type==="forwardResource")&&(t.data={callStateEvents:"",callStateUrl:"",...t.data}),t)),e)},{from:"0.0.5",to:"0.0.6",run:e=>(e&&"builderVersion"in e&&typeof e.builderVersion=="string"&&(e.flowDataVersion=e.builderVersion,delete e.builderVersion),e)},{from:"0.0.6",to:"0.0.7",run:e=>(e.nodes=e.nodes.map(t=>{if((t.type==="forwardAddress"||t.type==="forwardPhone"||t.type==="forwardResource")&&"connections"in t.data&&"connections"in t.data){let n=()=>({connectFrom:"",connectTimeout:"",connectTo:"",id:ie()});t.data.connections.length===0&&(t.data.connections=[n()],t.data.valid=!1)}return t}),e)},{from:"0.0.7",to:"0.0.8",run:e=>(e.nodes=e.nodes.map(t=>(t.type==="promptPlay"&&!("digitTimeout"in t.data)&&(t.data={...t.data,digitTimeout:""}),t)),e)}],NS=e=>{let t=nc.findIndex(n=>n.from===e);return t>=0?nc.slice(t):nc},mp=class{constructor({dbRecord:t}){Jl(this,"dbRecord"),this.dbRecord=t}get logger(){return Ae()}get flowData(){return this.dbRecord.flow_data}set flowData(t){this.dbRecord.flow_data=t}updateToVersion(t){this.flowData&&("builderVersion"in this.flowData?this.flowData.builderVersion=t:"flowDataVersion"in this.flowData&&(this.flowData.flowDataVersion=t))}versionFrom(){let t="";return this.flowData&&("builderVersion"in this.flowData?t=this.flowData.builderVersion:"flowDataVersion"in this.flowData&&(t=this.flowData.flowDataVersion)),t}migrateTo(t){let n=this.versionFrom();if(this.flowData&&n!==t){this.logger.info(`Migrate data from "${n}" to "${t}"`);let r=NS(n);for(let{run:o,to:i}of r){try{this.flowData=o(this.flowData),this.updateToVersion(i)}catch(s){console.error("Run migration:",s)}if(i===t)break}}else this.logger.info("Flow data up to date. No need to migrate!");return this.dbRecord}},rc={},vp={exports:{}},ct={},Ep={exports:{}},yp={};/**
21
+ */var j_=w,U_=Symbol.for("react.element"),F_=Symbol.for("react.fragment"),V_=Object.prototype.hasOwnProperty,$_=j_.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,B_={key:!0,ref:!0,__self:!0,__source:!0};function cp(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)V_.call(t,r)&&!B_.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:U_,type:e,key:i,ref:s,props:o,_owner:$_.current}}Ls.Fragment=F_,Ls.jsx=cp,Ls.jsxs=cp,Xf.exports=Ls;var u=Xf.exports,H_=Object.create,Zl=Object.defineProperty,z_=Object.getOwnPropertyDescriptor,W_=Object.getOwnPropertyNames,G_=Object.getPrototypeOf,Y_=Object.prototype.hasOwnProperty,K_=(e,t,n)=>t in e?Zl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Q_=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),X_=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of W_(t))!Y_.call(e,o)&&o!==n&&Zl(e,o,{get:()=>t[o],enumerable:!(r=z_(t,o))||r.enumerable});return e},q_=(e,t,n)=>(n=e!=null?H_(G_(e)):{},X_(t||!e||!e.__esModule?Zl(n,"default",{value:e,enumerable:!0}):n,e)),ec=(e,t,n)=>(K_(e,typeof t!="symbol"?t+"":t,n),n),J_=Q_((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,g){var m=y[g];if(typeof m.bind=="function")return m.bind(y);try{return Function.prototype.bind.call(m,y)}catch{return function(){return Function.prototype.apply.apply(m,[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 c(y,g){for(var m=0;m<i.length;m++){var _=i[m];this[_]=m<y?n:this.methodFactory(_,y,g)}this.log=this.debug}function d(y,g,m){return function(){typeof console!==r&&(c.call(this,g,m),this[y].apply(this,arguments))}}function f(y,g,m){return l(y)||d.apply(this,arguments)}function p(y,g,m){var _=this,S;g=g??"WARN";var x="loglevel";typeof y=="string"?x+=":"+y:typeof y=="symbol"&&(x=void 0);function R(A){var b=(i[A]||"silent").toUpperCase();if(!(typeof window===r||!x)){try{window.localStorage[x]=b;return}catch{}try{window.document.cookie=encodeURIComponent(x)+"="+b+";"}catch{}}}function I(){var A;if(!(typeof window===r||!x)){try{A=window.localStorage[x]}catch{}if(typeof A===r)try{var b=window.document.cookie,V=b.indexOf(encodeURIComponent(x)+"=");V!==-1&&(A=/^([^;]+)/.exec(b.slice(V))[1])}catch{}return _.levels[A]===void 0&&(A=void 0),A}}function L(){if(!(typeof window===r||!x)){try{window.localStorage.removeItem(x);return}catch{}try{window.document.cookie=encodeURIComponent(x)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch{}}}_.name=y,_.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},_.methodFactory=m||f,_.getLevel=function(){return S},_.setLevel=function(A,b){if(typeof A=="string"&&_.levels[A.toUpperCase()]!==void 0&&(A=_.levels[A.toUpperCase()]),typeof A=="number"&&A>=0&&A<=_.levels.SILENT){if(S=A,b!==!1&&R(A),c.call(_,A,y),typeof console===r&&A<_.levels.SILENT)return"No console available for logging"}else throw"log.setLevel() called with invalid level: "+A},_.setDefaultLevel=function(A){g=A,I()||_.setLevel(A,!1)},_.resetLevel=function(){_.setLevel(g,!1),L()},_.enableAll=function(A){_.setLevel(_.levels.TRACE,A)},_.disableAll=function(A){_.setLevel(_.levels.SILENT,A)};var U=I();U==null&&(U=g),_.setLevel(U,!1)}var h=new p,E={};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 g=E[y];return g||(g=E[y]=new p(y,h.getLevel(),h.methodFactory)),g};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 E},h.default=h,h})}),Z_=q_(J_(),1),eS=()=>new Date().toISOString(),ni=Z_.default.getLogger("signalwire"),tS=ni.methodFactory;ni.methodFactory=(e,t,n)=>{let r=tS(e,t,n);return function(...o){o.unshift(eS(),"-"),r(...o)}};var nS=ni.getLevel();ni.setLevel(nS);var Ie=()=>ni,rS="/api/ai/ai_agents",oS=(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),""),up=Ie(),iS=e=>typeof e=="object"&&e!==null&&"id"in e&&"type"in e&&"data"in e&&"position"in e,sS=e=>{if(!iS(e))throw up.error("nodeToDBShape: Invalid node",e),new Error;return{data:e.data,id:e.id,position:e.position,type:e.type}},aS=e=>typeof e=="object"&&e!==null&&"id"in e&&"source"in e&&"sourceHandle"in e&&"target"in e&&"targetHandle"in e,lS=e=>{if(!aS(e))throw up.error("edgeToDBShape: Invalid edge",e),new Error;return{id:e.id,source:e.source,sourceHandle:e.sourceHandle??null,target:e.target,targetHandle:e.targetHandle??null}},dp=e=>{var t;return(t=e==null?void 0:e.trim())==null?void 0:t.toLowerCase()},Gr=e=>e.replace(/\s/g,""),tc=e=>{if(!(!e||typeof e=="string"&&e.trim().length===0))try{return JSON.parse(e)}catch{return typeof e=="string"?e.trim():e}},nc=e=>typeof e=="string"?e.trim():typeof e=="number"&&isNaN(e)||e==null||typeof e=="object"||typeof e=="function"||typeof e=="symbol"?"":String(e),cS=e=>e.split(",").map(t=>t.trim()).filter(Boolean),Ms=e=>{let t=tc(e);return t&&typeof t=="object"&&Object.keys(t).length?t:void 0},ie=()=>oS(),fp=e=>{let t=e===void 0?void 0:parseInt(e,10);return t===void 0||Number.isNaN(t)||t<=0?void 0:t},rc=({callStateEvents:e,callStateUrl:t,connections:n,defaultFrom:r,defaultTimeout:o,callOrder:i})=>{let s=fp(o),a=Gr(r),l=cS(e),c=t==null?void 0:t.trim(),d=n.map(({connectFrom:p,connectTimeout:h,connectTo:E})=>({call_state_events:l.length>0?l:void 0,call_state_url:c||void 0,from:Gr(p)||a||"%{call.from}",timeout:fp(h)??s,to:Gr(E)}));d.length||d.push({from:"%{call.from}",timeout:void 0,to:""});let f={switch:{case:{connected:[]},default:[{switch:{case:{busy:[],decline:[],error:[],noAnswer:[]},default:["hangup"],variable:"connect_failed_reason"}}],variable:"connect_result"}};switch(i){case"single":return[{connect:d[0]},f];case"serial":return[{connect:{serial:d}},f];case"parallel":return[{connect:{parallel:d}},f];default:return Ie().warn(`The type '${i}' is not supported yet.`),[{connect:d[0]},f]}},uS=/\bmale\b/i,dS=/\bfemale\b/i,fS=e=>{if(e){if(dS.test(e))return"female";if(uS.test(e))return"male"}},pp=(e,t)=>{if(typeof e=="object"&&!Array.isArray(e)){t.language&&(e.say_language=t.language);let n=fS(t.gender);n&&(e.say_gender=n),t.voice&&(e.say_voice=t.voice)}return e},hp=(e,t)=>{var n,r;if(typeof e=="object"&&!Array.isArray(e)){let o="url"in e?e.url:e.play,i,s=(n=t.text)==null?void 0:n.trim();if(Array.isArray(t.url)){let a=t.url.map(l=>l==null?void 0:l.trim()).filter(Boolean);i=(a==null?void 0:a.length)===1?a[0]:a}else i=(r=t.url)==null?void 0:r.trim();(!t.selected||t.selected==="url")&&i?o=i:(!t.selected||t.selected==="text")&&s&&(o=`say:${s}`),"url"in e?e.url=o:e.play=o}return e},pS={aiAgent:({data:{agent:e}})=>({ai:{agent:e}}),answer:({data:{maxDuration:e}})=>e?{answer:{max_duration:e}}:"answer",cond:()=>({cond:[]}),condRequest:({data:e})=>[{request:{body:tc(e.body),connect_timeout:e.connectTimeout,headers:Ms(e.headers),method:e.method,save_variables:e.saveVariables,timeout:e.timeout,url:e.url}},{switch:{case:{success:[]},default:[],variable:"request_result"}}],executeSWML:({data:e})=>({execute:{dest:e.dest,meta:Ms(e.meta),params:Ms(e.params),result:[]}}),forwardAddress:({data:e})=>rc(e),forwardPhone:({data:e})=>rc(e),forwardResource:({data:e})=>rc(e),handleCall:()=>"start",hangup:({data:{reason:e}})=>e?{hangup:{reason:e}}:"hangup",play:({data:e})=>{let{volume:t}=e,n=pp(hp({url:"say:Unknown TTS"},e),e);return t&&(n.volume=t),{play:n}},promptPlay:({data:e})=>{let{digitTimeout:t,initialTimeout:n,options:r,volume:o}=e,i=pp(hp({play:"say:Unknown value"},e),e);o&&(i.volume=o),n&&(i.initial_timeout=parseInt(n,10)),t&&(i.digit_timeout=parseInt(t,10));let s=r.reduce((a,l)=>{let c=dp(l.command);c&&a.speechHints.push(c);let d=Gr(l.digit);return d&&(a.maxDigits=Math.max(a.maxDigits,d.length)),a},{maxDigits:-1,speechHints:[]});return s.speechHints.length&&(i.speech_hints=s.speechHints,i.speech_language="en-US"),s.maxDigits>0&&(i.max_digits=s.maxDigits),[{prompt:i},{switch:{case:{failed:[{play:"say:Error while gathering input."},"hangup"],no_input:[],no_match:[]},default:[{switch:{case:{},default:[],variable:"prompt_value"}}],variable:"prompt_result"}}]},record:({data:e})=>{var n;let t={beep:e.beep,direction:e.direction,format:e.format,input_sensitivity:e.inputSensitivity,stereo:e.stereo,terminators:((n=e.terminators)==null?void 0:n.trim())||void 0};return e.endSilenceTimeout&&(t.end_silence_timeout=parseInt(e.endSilenceTimeout,10)),e.initialTimeout&&(t.initial_timeout=parseInt(e.initialTimeout,10)),e.maxLength&&(t.max_length=parseInt(e.maxLength,10)),{record:t}},recordCallStart:({data:e})=>{var t;return{record_call:{beep:e.beep,control_id:e.controlId,direction:e.direction,format:e.format,input_sensitivity:e.inputSensitivity,stereo:e.stereo,terminators:((t=e.terminators)==null?void 0:t.trim())||void 0}}},recordCallStop:({data:e})=>({stop_record_call:e.controlId}),request:({data:e})=>[{request:{body:tc(e.body),connect_timeout:e.connectTimeout,headers:Ms(e.headers),method:e.method,save_variables:e.saveVariables,timeout:e.timeout,url:e.url}},{switch:{case:{success:[]},default:[],variable:"request_result"}}],sendSms:({data:e})=>{let{fromNumber:t,toNumber:n,body:r}=e;return{send_sms:{body:r,from_number:Gr(t),to_number:Gr(n)}}},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)})},dr=e=>{try{return pS[e.__type](e.node)}catch(t){throw Ie().error("Unknown Verb",e),t}},hS="1.0.0",gS=e=>{let t=Ie(),n=new Set,r=new Map,o=new Set,i=new Map([["main",[]]]),s=new Map,a="",l=S=>i.has(S),c=S=>o.has(S),d=S=>o.add(S);e.nodes.forEach(S=>{r.set(S.id,{children:[],node:S}),S.type==="handleCall"&&(a=S.id)}),e.edges.forEach(S=>{let x=r.get(S.source),R=r.get(S.target);if(!x||!R)return t.warn("Invalid edge:",S);x.children.push(S.target),S.sourceHandle&&s.set(S.sourceHandle,R),n.has(S.target)&&i.set(S.target,[]),n.add(S.target)});let f=[...i.keys()],p=(S,x)=>{var I,L,U;let R=s.get(x.id);if(R){let A=[];i.set(x.id,A),x.digit&&(S[x.digit]=A);let b=dp(x.command);b&&(S[b]=A);let V=l(R.node.id);if(V){let M={transfer:R.node.id};x.digit&&((I=S[x.digit])==null||I.push(M)),b&&!((L=S[b])!=null&&L.includes(M))&&((U=S[b])==null||U.push(M))}g({current:R,sectionName:V?R.node.id:x.id})}return S},h=(S,x)=>{var I;let R=s.get(x.id);if(R){let L=[];i.set(x.id,L),S[x.result]=L;let U=l(R.node.id);U&&((I=S[x.result])==null||I.push({transfer:R.node.id})),g({current:R,sectionName:U?R.node.id:x.id})}return S},E={else:(S,x)=>{if(x.result==="success")return S;let R=s.get(x.id);if(R){let I=[];i.set(x.id,I),S=I;let L=l(R.node.id);L&&S.push({transfer:R.node.id}),g({current:R,sectionName:L?R.node.id:x.id})}return S},then:(S,x)=>{if(x.result!=="success")return S;let R=s.get(x.id);if(R){let I=[];i.set(x.id,I),S=I;let L=l(R.node.id);L&&S.push({transfer:R.node.id}),g({current:R,sectionName:L?R.node.id:x.id})}return S}},v={fallback:S=>{let x=s.get(S),R={else:[]};if(x){let I=[];i.set(S,I),R.else=I;let L=l(x.node.id);L&&R.else.push({transfer:x.node.id}),g({current:x,sectionName:L?x.node.id:S})}return R},options:(S,x)=>{let R=s.get(x.id),I={then:[],when:x.value};if(R){let L=[];i.set(x.id,L),I.then=L;let U=l(R.node.id);U&&I.then.push({transfer:R.node.id}),S.push(I),g({current:R,sectionName:U?R.node.id:x.id})}return S}},y=S=>{let x=s.get(S),R=[];if(x){let I=[];i.set(S,I),R=I;let L=l(x.node.id);L&&R.push({transfer:x.node.id}),g({current:x,sectionName:L?x.node.id:S})}return R},g=({sectionName:S,current:x})=>{var I,L,U;if(c(x.node.id))return;d(x.node.id);let R=i.get(S);if(!R){t.warn("Unknown section name:",S);return}switch(x.node.type){case"promptPlay":{let A=dr({__type:x.node.type,node:x.node});if(!Array.isArray(A)){t.warn("Invalid gather node",A);return}(L=(I=x.node.data)==null?void 0:I.results)!=null&&L.length&&(A[1].switch.case={...A[1].switch.case,...x.node.data.results.reduce(h,{})}),A[1].switch.default[0].switch.case=x.node.data.options.reduce(p,{}),(U=A[1].switch.case)!=null&&U.no_match&&(A[1].switch.default[0].switch.default=A[1].switch.case.no_match),R.push(...A);return}case"cond":{let A=dr({__type:x.node.type,node:x.node});A.cond=x.node.data.options.reduce(v.options,[]),A.cond.push(v.fallback(x.node.data.fallback)),R.push(A);return}case"condRequest":{let A=dr({__type:x.node.type,node:x.node}),b=x.node.data.options.reduce(v.options,[]),V=v.fallback(x.node.data.fallback),M={cond:[...b,V]};A[1].switch.case.success=[M],A[1].switch.default=y(x.node.data.error),R.push(...A);return}case"executeSWML":{let A=dr({__type:x.node.type,node:x.node}),b=x.node.data.options.reduce(v.options,[]),V=v.fallback(x.node.data.fallback);A.execute.result=[...b,V],R.push(A);return}case"forwardPhone":case"forwardAddress":case"forwardResource":{let A=dr({__type:x.node.type,node:x.node});if(!Array.isArray(A)){t.warn("Invalid connect node",A);return}x.node.data.options.length&&(A[1].switch.case.connected=x.node.data.options.reduce(E.then,[]),A[1].switch.default[0].switch.case=x.node.data.options.filter(b=>b.result!=="success").reduce(h,{})),R.push(...A);return}case"request":{let A=dr({__type:x.node.type,node:x.node});if(!Array.isArray(A)){t.warn("Invalid request node",A);return}A[1].switch.case.success=x.node.data.options.reduce(E.then,[]),A[1].switch.default=x.node.data.options.reduce(E.else,[]),R.push(...A);return}default:{let A=dr({__type:x.node.type,node:x.node});x.node.type!=="handleCall"&&R.push(A),x.children.forEach(b=>{let V=r.get(b);if(!V)return t.warn("Invalid Child Node",b);let M=l(b);M&&R.push({transfer:b}),g({current:V,sectionName:M?b:S})});break}}},m=r.get(a);m&&g({current:m,sectionName:"main"});let _={};return f.forEach(S=>{let x=i.get(S);x&&(_[S]=x)}),t.debug("sections",JSON.stringify(_)),{sections:_,version:hS}},mS=class __ extends Error{constructor(t,n){super(n),this.code=t,this.message=n,ec(this,"name","AuthError"),Object.setPrototypeOf(this,__.prototype)}},ES=class S_ extends Error{constructor(t,n,r){super(n),this.code=t,this.message=n,this.response=r,ec(this,"name","HttpError"),Object.setPrototypeOf(this,S_.prototype)}};async function vS(e,t){let n=await fetch(e,t);if(!n.ok){if(n.status===401)throw new mS(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 ES(n.status,o,r)}try{n.parsedBody??(n.parsedBody=await n.json())}catch{}return n}var yS=({timeout:e=3e4,...t},n=vS)=>async(r,o)=>{let i={...o!=null&&o.body?{"Content-Type":"application/json"}:{},...t.headers,...o==null?void 0:o.headers},s=SS({...t,...o,headers:i});s.credentials="same-origin";let a;if(e){let l=new AbortController,c=l.signal;s.signal=c,a=setTimeout(()=>{l.abort()},e)}try{return{body:(await n(xS({searchParams:o==null?void 0:o.searchParams,url:r}),s)).parsedBody}}finally{a&&clearTimeout(a)}},_S=e=>typeof e=="string"?e:JSON.stringify(e),SS=e=>Object.entries(e).reduce((t,[n,r])=>n==="body"?{...t,body:_S(r)}:r!=null?{...t,[n]:r}:t,{}),xS=({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()},gp=e=>{let t=Ie(),n=yS(e);return{deployFlow:async r=>{if(!e.deployFlowURL)throw new Error("deployFlowURL is not defined");let o={document_version:r.documentVersion},i=await n(e.deployFlowURL,{body:o,method:"POST"});return t.info("deployFlow",i.body),i.body},getAiAgents:async()=>{try{if(!e.getAiAgentsURL)throw new Error("getAiAgentsURL is not defined");let{body:r}=await n(e.getAiAgentsURL);return t.info("getAiAgents",r),r}catch(r){throw t.error("Could not load AI agents. URL:",e.getAiAgentsURL),r}},getFlow:async()=>{try{if(!e.getFlowURL)throw new Error("getFlowURL is not defined");let{body:r}=await n(e.getFlowURL);return t.info("getFlow",r),r}catch(r){if(t.error("Could not load flow. URL:",e.getFlowURL),r instanceof Error)throw r;return{}}},getFlowVersions:async(r={})=>{if(!e.deployFlowURL)throw new Error("deployFlowURL is not defined");let{pageNumber:o,pageSize:i}=r,s=new URLSearchParams;o&&s.append("page_number",String(o)),i&&s.append("page_size",String(i));let a=s.toString(),l=e.deployFlowURL+(a?`?${a}`:"");try{let{body:c}=await n(l);return t.info("getFlowVersions",c),c.data}catch(c){throw t.error("Could not load flow versions. URL:",l),c}},putFlow:async r=>{if(!e.updateFlowURL)throw new Error("updateFlowURL is not defined");let o={type:"call_flow",document_version:r.documentVersion+1,flow_data:{flowDataVersion:r.flowDataVersion,nodes:r.nodes.map(sS),edges:r.edges.map(lS)},relayml:gS({nodes:r.nodes,edges:r.edges})},i=await n(e.updateFlowURL,{body:o,method:"PUT"});return t.info("putFlow",i.body),i.body}}},oc=[{from:"0.0.0",to:"0.0.1",run:e=>(e.nodes=e.nodes.map(t=>("missingRequiredParams"in t.data&&delete t.data.missingRequiredParams,t.data.initial=!1,"initialTimeout"in t.data&&(t.data.initialTimeout=nc(t.data.initialTimeout)),(t.type==="play"||t.type==="promptPlay")&&"selected"in t.data&&!t.data.selected&&(t.data.url?t.data.selected="url":t.data.text&&(t.data.selected="text")),t)),e)},{from:"0.0.1",to:"0.0.2",run:e=>(e.nodes=e.nodes.map(t=>{if("terminators"in t.data){let{terminators:n=""}=t.data;n.trim()||delete t.data.terminators}return t}),e)},{from:"0.0.2",to:"0.0.3",run:e=>(e.nodes=e.nodes.map(t=>{if(t.type==="forwardAddress"||t.type==="forwardPhone"||t.type==="forwardResource"){let{destinations:n=[],destinationType:r,initial:o,options:i,sessionTimeout:s,type:a,valid:l}=t.data,c=n.map(d=>({connectFrom:"",connectTimeout:"",connectTo:d,id:ie()}));t.data={callOrder:a,connections:c,defaultFrom:"",defaultTimeout:s?`${s}`:"",destinationType:r,initial:o,options:i,valid:l===void 0||l}}return t}),e)},{from:"0.0.3",to:"0.0.4",run:e=>(e.nodes=e.nodes.map(t=>((t.type==="answer"||t.type==="handleCall"||t.type==="hangup")&&(t.data.valid=!0),t)),e)},{from:"0.0.4",to:"0.0.5",run:e=>(e.nodes=e.nodes.map(t=>((t.type==="forwardAddress"||t.type==="forwardPhone"||t.type==="forwardResource")&&(t.data={callStateEvents:"",callStateUrl:"",...t.data}),t)),e)},{from:"0.0.5",to:"0.0.6",run:e=>(e&&"builderVersion"in e&&typeof e.builderVersion=="string"&&(e.flowDataVersion=e.builderVersion,delete e.builderVersion),e)},{from:"0.0.6",to:"0.0.7",run:e=>(e.nodes=e.nodes.map(t=>{if((t.type==="forwardAddress"||t.type==="forwardPhone"||t.type==="forwardResource")&&"connections"in t.data&&"connections"in t.data){let n=()=>({connectFrom:"",connectTimeout:"",connectTo:"",id:ie()});t.data.connections.length===0&&(t.data.connections=[n()],t.data.valid=!1)}return t}),e)},{from:"0.0.7",to:"0.0.8",run:e=>(e.nodes=e.nodes.map(t=>(t.type==="promptPlay"&&!("digitTimeout"in t.data)&&(t.data={...t.data,digitTimeout:""}),t)),e)},{from:"0.0.8",to:"0.0.9",run:e=>(e.nodes=e.nodes.map(t=>(t.type==="record"&&(t.data={endSilenceTimeout:"",initialTimeout:"",maxLength:"",...t.data}),t)),e)}],RS=e=>{let t=oc.findIndex(n=>n.from===e);return t>=0?oc.slice(t):oc},mp=class{constructor({dbRecord:t}){ec(this,"dbRecord"),this.dbRecord=t}get logger(){return Ie()}get flowData(){return this.dbRecord.flow_data}set flowData(t){this.dbRecord.flow_data=t}updateToVersion(t){this.flowData&&("builderVersion"in this.flowData?this.flowData.builderVersion=t:"flowDataVersion"in this.flowData&&(this.flowData.flowDataVersion=t))}versionFrom(){let t="";return this.flowData&&("builderVersion"in this.flowData?t=this.flowData.builderVersion:"flowDataVersion"in this.flowData&&(t=this.flowData.flowDataVersion)),t}migrateTo(t){let n=this.versionFrom();if(this.flowData&&n!==t){this.logger.info(`Migrate data from "${n}" to "${t}"`);let r=RS(n);for(let{run:o,to:i}of r){try{this.flowData=o(this.flowData),this.updateToVersion(i)}catch(s){console.error("Run migration:",s)}if(i===t)break}this.logger.debug("Migrated flow data",this.flowData)}else this.logger.info("Flow data up to date. No need to migrate!");return this.dbRecord}},ic={},Ep={exports:{}},ut={},vp={exports:{}},yp={};/**
22
22
  * @license React
23
23
  * scheduler.production.min.js
24
24
  *
@@ -26,7 +26,7 @@ function ei(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(D,C){var k=D.length;D.push(C);e:for(;0<k;){var F=k-1>>>1,B=D[F];if(0<o(B,C))D[F]=C,D[k]=B,k=F;else break e}}function n(D){return D.length===0?null:D[0]}function r(D){if(D.length===0)return null;var C=D[0],k=D.pop();if(k!==C){D[0]=k;e:for(var F=0,B=D.length,z=B>>>1;F<z;){var W=2*(F+1)-1,X=D[W],Q=W+1,J=D[Q];if(0>o(X,k))Q<B&&0>o(J,X)?(D[F]=J,D[Q]=k,F=Q):(D[F]=X,D[W]=k,F=W);else if(Q<B&&0>o(J,k))D[F]=J,D[Q]=k,F=Q;else break e}}return C}function o(D,C){var k=D.sortIndex-C.sortIndex;return k!==0?k:D.id-C.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=[],c=[],d=1,f=null,p=3,h=!1,v=!1,E=!1,y=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,m=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function _(D){for(var C=n(c);C!==null;){if(C.callback===null)r(c);else if(C.startTime<=D)r(c),C.sortIndex=C.expirationTime,t(l,C);else break;C=n(c)}}function S(D){if(E=!1,_(D),!v)if(n(l)!==null)v=!0,P(x);else{var C=n(c);C!==null&&$(S,C.startTime-D)}}function x(D,C){v=!1,E&&(E=!1,g(L),L=-1),h=!0;var k=p;try{for(_(C),f=n(l);f!==null&&(!(f.expirationTime>C)||D&&!b());){var F=f.callback;if(typeof F=="function"){f.callback=null,p=f.priorityLevel;var B=F(f.expirationTime<=C);C=e.unstable_now(),typeof B=="function"?f.callback=B:f===n(l)&&r(l),_(C)}else r(l);f=n(l)}if(f!==null)var z=!0;else{var W=n(c);W!==null&&$(S,W.startTime-C),z=!1}return z}finally{f=null,p=k,h=!1}}var R=!1,I=null,L=-1,U=5,T=-1;function b(){return!(e.unstable_now()-T<U)}function V(){if(I!==null){var D=e.unstable_now();T=D;var C=!0;try{C=I(!0,D)}finally{C?M():(R=!1,I=null)}}else R=!1}var M;if(typeof m=="function")M=function(){m(V)};else if(typeof MessageChannel<"u"){var O=new MessageChannel,j=O.port2;O.port1.onmessage=V,M=function(){j.postMessage(null)}}else M=function(){y(V,0)};function P(D){I=D,R||(R=!0,M())}function $(D,C){L=y(function(){D(e.unstable_now())},C)}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(D){D.callback=null},e.unstable_continueExecution=function(){v||h||(v=!0,P(x))},e.unstable_forceFrameRate=function(D){0>D||125<D?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):U=0<D?Math.floor(1e3/D):5},e.unstable_getCurrentPriorityLevel=function(){return p},e.unstable_getFirstCallbackNode=function(){return n(l)},e.unstable_next=function(D){switch(p){case 1:case 2:case 3:var C=3;break;default:C=p}var k=p;p=C;try{return D()}finally{p=k}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(D,C){switch(D){case 1:case 2:case 3:case 4:case 5:break;default:D=3}var k=p;p=D;try{return C()}finally{p=k}},e.unstable_scheduleCallback=function(D,C,k){var F=e.unstable_now();switch(typeof k=="object"&&k!==null?(k=k.delay,k=typeof k=="number"&&0<k?F+k:F):k=F,D){case 1:var B=-1;break;case 2:B=250;break;case 5:B=1073741823;break;case 4:B=1e4;break;default:B=5e3}return B=k+B,D={id:d++,callback:C,priorityLevel:D,startTime:k,expirationTime:B,sortIndex:-1},k>F?(D.sortIndex=k,t(c,D),n(l)===null&&D===n(c)&&(E?(g(L),L=-1):E=!0,$(S,k-F))):(D.sortIndex=B,t(l,D),v||h||(v=!0,P(x))),D},e.unstable_shouldYield=b,e.unstable_wrapCallback=function(D){var C=p;return function(){var k=p;p=C;try{return D.apply(this,arguments)}finally{p=k}}}})(yp),Ep.exports=yp;var wS=Ep.exports;/**
29
+ */(function(e){function t(D,C){var k=D.length;D.push(C);e:for(;0<k;){var F=k-1>>>1,B=D[F];if(0<o(B,C))D[F]=C,D[k]=B,k=F;else break e}}function n(D){return D.length===0?null:D[0]}function r(D){if(D.length===0)return null;var C=D[0],k=D.pop();if(k!==C){D[0]=k;e:for(var F=0,B=D.length,z=B>>>1;F<z;){var W=2*(F+1)-1,X=D[W],Q=W+1,J=D[Q];if(0>o(X,k))Q<B&&0>o(J,X)?(D[F]=J,D[Q]=k,F=Q):(D[F]=X,D[W]=k,F=W);else if(Q<B&&0>o(J,k))D[F]=J,D[Q]=k,F=Q;else break e}}return C}function o(D,C){var k=D.sortIndex-C.sortIndex;return k!==0?k:D.id-C.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=[],c=[],d=1,f=null,p=3,h=!1,E=!1,v=!1,y=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,m=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function _(D){for(var C=n(c);C!==null;){if(C.callback===null)r(c);else if(C.startTime<=D)r(c),C.sortIndex=C.expirationTime,t(l,C);else break;C=n(c)}}function S(D){if(v=!1,_(D),!E)if(n(l)!==null)E=!0,P(x);else{var C=n(c);C!==null&&$(S,C.startTime-D)}}function x(D,C){E=!1,v&&(v=!1,g(L),L=-1),h=!0;var k=p;try{for(_(C),f=n(l);f!==null&&(!(f.expirationTime>C)||D&&!b());){var F=f.callback;if(typeof F=="function"){f.callback=null,p=f.priorityLevel;var B=F(f.expirationTime<=C);C=e.unstable_now(),typeof B=="function"?f.callback=B:f===n(l)&&r(l),_(C)}else r(l);f=n(l)}if(f!==null)var z=!0;else{var W=n(c);W!==null&&$(S,W.startTime-C),z=!1}return z}finally{f=null,p=k,h=!1}}var R=!1,I=null,L=-1,U=5,A=-1;function b(){return!(e.unstable_now()-A<U)}function V(){if(I!==null){var D=e.unstable_now();A=D;var C=!0;try{C=I(!0,D)}finally{C?M():(R=!1,I=null)}}else R=!1}var M;if(typeof m=="function")M=function(){m(V)};else if(typeof MessageChannel<"u"){var O=new MessageChannel,j=O.port2;O.port1.onmessage=V,M=function(){j.postMessage(null)}}else M=function(){y(V,0)};function P(D){I=D,R||(R=!0,M())}function $(D,C){L=y(function(){D(e.unstable_now())},C)}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(D){D.callback=null},e.unstable_continueExecution=function(){E||h||(E=!0,P(x))},e.unstable_forceFrameRate=function(D){0>D||125<D?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):U=0<D?Math.floor(1e3/D):5},e.unstable_getCurrentPriorityLevel=function(){return p},e.unstable_getFirstCallbackNode=function(){return n(l)},e.unstable_next=function(D){switch(p){case 1:case 2:case 3:var C=3;break;default:C=p}var k=p;p=C;try{return D()}finally{p=k}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(D,C){switch(D){case 1:case 2:case 3:case 4:case 5:break;default:D=3}var k=p;p=D;try{return C()}finally{p=k}},e.unstable_scheduleCallback=function(D,C,k){var F=e.unstable_now();switch(typeof k=="object"&&k!==null?(k=k.delay,k=typeof k=="number"&&0<k?F+k:F):k=F,D){case 1:var B=-1;break;case 2:B=250;break;case 5:B=1073741823;break;case 4:B=1e4;break;default:B=5e3}return B=k+B,D={id:d++,callback:C,priorityLevel:D,startTime:k,expirationTime:B,sortIndex:-1},k>F?(D.sortIndex=k,t(c,D),n(l)===null&&D===n(c)&&(v?(g(L),L=-1):v=!0,$(S,k-F))):(D.sortIndex=B,t(l,D),E||h||(E=!0,P(x))),D},e.unstable_shouldYield=b,e.unstable_wrapCallback=function(D){var C=p;return function(){var k=p;p=C;try{return D.apply(this,arguments)}finally{p=k}}}})(yp),vp.exports=yp;var NS=vp.exports;/**
30
30
  * @license React
31
31
  * react-dom.production.min.js
32
32
  *
@@ -34,14 +34,14 @@ function ei(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 _p=N,ut=wS;function H(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 Sp=new Set,ri={};function fr(e,t){Yr(e,t),Yr(e+"Capture",t)}function Yr(e,t){for(ri[e]=t,e=0;e<t.length;e++)Sp.add(t[e])}var dn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),oc=Object.prototype.hasOwnProperty,OS=/^[: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]*$/,xp={},Rp={};function TS(e){return oc.call(Rp,e)?!0:oc.call(xp,e)?!1:OS.test(e)?Rp[e]=!0:(xp[e]=!0,!1)}function AS(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 IS(e,t,n,r){if(t===null||typeof t>"u"||AS(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 Ye(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 Pe={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Pe[e]=new Ye(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Pe[t]=new Ye(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){Pe[e]=new Ye(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Pe[e]=new Ye(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){Pe[e]=new Ye(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){Pe[e]=new Ye(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){Pe[e]=new Ye(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){Pe[e]=new Ye(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){Pe[e]=new Ye(e,5,!1,e.toLowerCase(),null,!1,!1)});var ic=/[\-:]([a-z])/g;function sc(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(ic,sc);Pe[t]=new Ye(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(ic,sc);Pe[t]=new Ye(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(ic,sc);Pe[t]=new Ye(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){Pe[e]=new Ye(e,1,!1,e.toLowerCase(),null,!1,!1)}),Pe.xlinkHref=new Ye("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){Pe[e]=new Ye(e,1,!1,e.toLowerCase(),null,!0,!0)});function ac(e,t,n,r){var o=Pe.hasOwnProperty(t)?Pe[t]:null;(o!==null?o.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(IS(t,n,o,r)&&(n=null),r||o===null?TS(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 fn=_p.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Ps=Symbol.for("react.element"),Kr=Symbol.for("react.portal"),Qr=Symbol.for("react.fragment"),lc=Symbol.for("react.strict_mode"),cc=Symbol.for("react.profiler"),Np=Symbol.for("react.provider"),wp=Symbol.for("react.context"),uc=Symbol.for("react.forward_ref"),dc=Symbol.for("react.suspense"),fc=Symbol.for("react.suspense_list"),pc=Symbol.for("react.memo"),An=Symbol.for("react.lazy"),Op=Symbol.for("react.offscreen"),Tp=Symbol.iterator;function oi(e){return e===null||typeof e!="object"?null:(e=Tp&&e[Tp]||e["@@iterator"],typeof e=="function"?e:null)}var me=Object.assign,hc;function ii(e){if(hc===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);hc=t&&t[1]||""}return`
38
- `+hc+e}var gc=!1;function mc(e,t){if(!e||gc)return"";gc=!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(c){var r=c}Reflect.construct(e,[],t)}else{try{t.call()}catch(c){r=c}e.call(t.prototype)}else{try{throw Error()}catch(c){r=c}e()}}catch(c){if(c&&r&&typeof c.stack=="string"){for(var o=c.stack.split(`
37
+ */var _p=w,dt=NS;function H(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 Sp=new Set,ri={};function fr(e,t){Yr(e,t),Yr(e+"Capture",t)}function Yr(e,t){for(ri[e]=t,e=0;e<t.length;e++)Sp.add(t[e])}var dn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),sc=Object.prototype.hasOwnProperty,wS=/^[: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]*$/,xp={},Rp={};function OS(e){return sc.call(Rp,e)?!0:sc.call(xp,e)?!1:wS.test(e)?Rp[e]=!0:(xp[e]=!0,!1)}function TS(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 AS(e,t,n,r){if(t===null||typeof t>"u"||TS(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 Ke(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 Me={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Me[e]=new Ke(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Me[t]=new Ke(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){Me[e]=new Ke(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Me[e]=new Ke(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){Me[e]=new Ke(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){Me[e]=new Ke(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){Me[e]=new Ke(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){Me[e]=new Ke(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){Me[e]=new Ke(e,5,!1,e.toLowerCase(),null,!1,!1)});var ac=/[\-:]([a-z])/g;function lc(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(ac,lc);Me[t]=new Ke(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(ac,lc);Me[t]=new Ke(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(ac,lc);Me[t]=new Ke(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){Me[e]=new Ke(e,1,!1,e.toLowerCase(),null,!1,!1)}),Me.xlinkHref=new Ke("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){Me[e]=new Ke(e,1,!1,e.toLowerCase(),null,!0,!0)});function cc(e,t,n,r){var o=Me.hasOwnProperty(t)?Me[t]:null;(o!==null?o.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(AS(t,n,o,r)&&(n=null),r||o===null?OS(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 fn=_p.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,js=Symbol.for("react.element"),Kr=Symbol.for("react.portal"),Qr=Symbol.for("react.fragment"),uc=Symbol.for("react.strict_mode"),dc=Symbol.for("react.profiler"),Np=Symbol.for("react.provider"),wp=Symbol.for("react.context"),fc=Symbol.for("react.forward_ref"),pc=Symbol.for("react.suspense"),hc=Symbol.for("react.suspense_list"),gc=Symbol.for("react.memo"),An=Symbol.for("react.lazy"),Op=Symbol.for("react.offscreen"),Tp=Symbol.iterator;function oi(e){return e===null||typeof e!="object"?null:(e=Tp&&e[Tp]||e["@@iterator"],typeof e=="function"?e:null)}var Ee=Object.assign,mc;function ii(e){if(mc===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);mc=t&&t[1]||""}return`
38
+ `+mc+e}var Ec=!1;function vc(e,t){if(!e||Ec)return"";Ec=!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(c){var r=c}Reflect.construct(e,[],t)}else{try{t.call()}catch(c){r=c}e.call(t.prototype)}else{try{throw Error()}catch(c){r=c}e()}}catch(c){if(c&&r&&typeof c.stack=="string"){for(var o=c.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{gc=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?ii(e):""}function bS(e){switch(e.tag){case 5:return ii(e.type);case 16:return ii("Lazy");case 13:return ii("Suspense");case 19:return ii("SuspenseList");case 0:case 2:case 15:return e=mc(e.type,!1),e;case 11:return e=mc(e.type.render,!1),e;case 1:return e=mc(e.type,!0),e;default:return""}}function vc(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 Qr:return"Fragment";case Kr:return"Portal";case cc:return"Profiler";case lc:return"StrictMode";case dc:return"Suspense";case fc:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case wp:return(e.displayName||"Context")+".Consumer";case Np:return(e._context.displayName||"Context")+".Provider";case uc:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case pc:return t=e.displayName||null,t!==null?t:vc(e.type)||"Memo";case An:t=e._payload,e=e._init;try{return vc(e(t))}catch{}}return null}function CS(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 vc(t);case 8:return t===lc?"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 In(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Ap(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function LS(e){var t=Ap(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 Ms(e){e._valueTracker||(e._valueTracker=LS(e))}function Ip(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Ap(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function js(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 Ec(e,t){var n=t.checked;return me({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function bp(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=In(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 Cp(e,t){t=t.checked,t!=null&&ac(e,"checked",t,!1)}function yc(e,t){Cp(e,t);var n=In(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")?_c(e,t.type,n):t.hasOwnProperty("defaultValue")&&_c(e,t.type,In(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Lp(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 _c(e,t,n){(t!=="number"||js(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var si=Array.isArray;function Xr(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=""+In(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 Sc(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(H(91));return me({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Dp(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(H(92));if(si(n)){if(1<n.length)throw Error(H(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:In(n)}}function kp(e,t){var n=In(t.value),r=In(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 Pp(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Mp(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 xc(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Mp(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Us,jp=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(Us=Us||document.createElement("div"),Us.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Us.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function ai(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var li={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},DS=["Webkit","ms","Moz","O"];Object.keys(li).forEach(function(e){DS.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),li[t]=li[e]})});function Up(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||li.hasOwnProperty(e)&&li[e]?(""+t).trim():t+"px"}function Fp(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=Up(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var kS=me({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 Rc(e,t){if(t){if(kS[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(H(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(H(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(H(61))}if(t.style!=null&&typeof t.style!="object")throw Error(H(62))}}function Nc(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 wc=null;function Oc(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Tc=null,qr=null,Jr=null;function Vp(e){if(e=bi(e)){if(typeof Tc!="function")throw Error(H(280));var t=e.stateNode;t&&(t=aa(t),Tc(e.stateNode,e.type,t))}}function $p(e){qr?Jr?Jr.push(e):Jr=[e]:qr=e}function Bp(){if(qr){var e=qr,t=Jr;if(Jr=qr=null,Vp(e),t)for(e=0;e<t.length;e++)Vp(t[e])}}function Hp(e,t){return e(t)}function zp(){}var Ac=!1;function Wp(e,t,n){if(Ac)return e(t,n);Ac=!0;try{return Hp(e,t,n)}finally{Ac=!1,(qr!==null||Jr!==null)&&(zp(),Bp())}}function ci(e,t){var n=e.stateNode;if(n===null)return null;var r=aa(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(H(231,t,typeof n));return n}var Ic=!1;if(dn)try{var ui={};Object.defineProperty(ui,"passive",{get:function(){Ic=!0}}),window.addEventListener("test",ui,ui),window.removeEventListener("test",ui,ui)}catch{Ic=!1}function PS(e,t,n,r,o,i,s,a,l){var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(d){this.onError(d)}}var di=!1,Fs=null,Vs=!1,bc=null,MS={onError:function(e){di=!0,Fs=e}};function jS(e,t,n,r,o,i,s,a,l){di=!1,Fs=null,PS.apply(MS,arguments)}function US(e,t,n,r,o,i,s,a,l){if(jS.apply(this,arguments),di){if(di){var c=Fs;di=!1,Fs=null}else throw Error(H(198));Vs||(Vs=!0,bc=c)}}function pr(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 Gp(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 Yp(e){if(pr(e)!==e)throw Error(H(188))}function FS(e){var t=e.alternate;if(!t){if(t=pr(e),t===null)throw Error(H(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 Yp(o),e;if(i===r)return Yp(o),t;i=i.sibling}throw Error(H(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(H(189))}}if(n.alternate!==r)throw Error(H(190))}if(n.tag!==3)throw Error(H(188));return n.stateNode.current===n?e:t}function Kp(e){return e=FS(e),e!==null?Qp(e):null}function Qp(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Qp(e);if(t!==null)return t;e=e.sibling}return null}var Xp=ut.unstable_scheduleCallback,qp=ut.unstable_cancelCallback,VS=ut.unstable_shouldYield,$S=ut.unstable_requestPaint,xe=ut.unstable_now,BS=ut.unstable_getCurrentPriorityLevel,Cc=ut.unstable_ImmediatePriority,Jp=ut.unstable_UserBlockingPriority,$s=ut.unstable_NormalPriority,HS=ut.unstable_LowPriority,Zp=ut.unstable_IdlePriority,Bs=null,Qt=null;function zS(e){if(Qt&&typeof Qt.onCommitFiberRoot=="function")try{Qt.onCommitFiberRoot(Bs,e,void 0,(e.current.flags&128)===128)}catch{}}var Lt=Math.clz32?Math.clz32:YS,WS=Math.log,GS=Math.LN2;function YS(e){return e>>>=0,e===0?32:31-(WS(e)/GS|0)|0}var Hs=64,zs=4194304;function fi(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 Ws(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=fi(a):(i&=s,i!==0&&(r=fi(i)))}else s=n&~o,s!==0?r=fi(s):i!==0&&(r=fi(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-Lt(t),o=1<<n,r|=e[n],t&=~o;return r}function KS(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 QS(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,o=e.expirationTimes,i=e.pendingLanes;0<i;){var s=31-Lt(i),a=1<<s,l=o[s];l===-1?(!(a&n)||a&r)&&(o[s]=KS(a,t)):l<=t&&(e.expiredLanes|=a),i&=~a}}function Lc(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function eh(){var e=Hs;return Hs<<=1,!(Hs&4194240)&&(Hs=64),e}function Dc(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function pi(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Lt(t),e[t]=n}function XS(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-Lt(n),i=1<<o;t[o]=0,r[o]=-1,e[o]=-1,n&=~i}}function kc(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Lt(n),o=1<<r;o&t|e[r]&t&&(e[r]|=t),n&=~o}}var se=0;function th(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var nh,Pc,rh,oh,ih,Mc=!1,Gs=[],bn=null,Cn=null,Ln=null,hi=new Map,gi=new Map,Dn=[],qS="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 sh(e,t){switch(e){case"focusin":case"focusout":bn=null;break;case"dragenter":case"dragleave":Cn=null;break;case"mouseover":case"mouseout":Ln=null;break;case"pointerover":case"pointerout":hi.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":gi.delete(t.pointerId)}}function mi(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=bi(t),t!==null&&Pc(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function JS(e,t,n,r,o){switch(t){case"focusin":return bn=mi(bn,e,t,n,r,o),!0;case"dragenter":return Cn=mi(Cn,e,t,n,r,o),!0;case"mouseover":return Ln=mi(Ln,e,t,n,r,o),!0;case"pointerover":var i=o.pointerId;return hi.set(i,mi(hi.get(i)||null,e,t,n,r,o)),!0;case"gotpointercapture":return i=o.pointerId,gi.set(i,mi(gi.get(i)||null,e,t,n,r,o)),!0}return!1}function ah(e){var t=hr(e.target);if(t!==null){var n=pr(t);if(n!==null){if(t=n.tag,t===13){if(t=Gp(n),t!==null){e.blockedOn=t,ih(e.priority,function(){rh(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 Ys(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Uc(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);wc=r,n.target.dispatchEvent(r),wc=null}else return t=bi(n),t!==null&&Pc(t),e.blockedOn=n,!1;t.shift()}return!0}function lh(e,t,n){Ys(e)&&n.delete(t)}function ZS(){Mc=!1,bn!==null&&Ys(bn)&&(bn=null),Cn!==null&&Ys(Cn)&&(Cn=null),Ln!==null&&Ys(Ln)&&(Ln=null),hi.forEach(lh),gi.forEach(lh)}function vi(e,t){e.blockedOn===t&&(e.blockedOn=null,Mc||(Mc=!0,ut.unstable_scheduleCallback(ut.unstable_NormalPriority,ZS)))}function Ei(e){function t(o){return vi(o,e)}if(0<Gs.length){vi(Gs[0],e);for(var n=1;n<Gs.length;n++){var r=Gs[n];r.blockedOn===e&&(r.blockedOn=null)}}for(bn!==null&&vi(bn,e),Cn!==null&&vi(Cn,e),Ln!==null&&vi(Ln,e),hi.forEach(t),gi.forEach(t),n=0;n<Dn.length;n++)r=Dn[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<Dn.length&&(n=Dn[0],n.blockedOn===null);)ah(n),n.blockedOn===null&&Dn.shift()}var Zr=fn.ReactCurrentBatchConfig,Ks=!0;function ex(e,t,n,r){var o=se,i=Zr.transition;Zr.transition=null;try{se=1,jc(e,t,n,r)}finally{se=o,Zr.transition=i}}function tx(e,t,n,r){var o=se,i=Zr.transition;Zr.transition=null;try{se=4,jc(e,t,n,r)}finally{se=o,Zr.transition=i}}function jc(e,t,n,r){if(Ks){var o=Uc(e,t,n,r);if(o===null)tu(e,t,r,Qs,n),sh(e,r);else if(JS(o,e,t,n,r))r.stopPropagation();else if(sh(e,r),t&4&&-1<qS.indexOf(e)){for(;o!==null;){var i=bi(o);if(i!==null&&nh(i),i=Uc(e,t,n,r),i===null&&tu(e,t,r,Qs,n),i===o)break;o=i}o!==null&&r.stopPropagation()}else tu(e,t,r,null,n)}}var Qs=null;function Uc(e,t,n,r){if(Qs=null,e=Oc(r),e=hr(e),e!==null)if(t=pr(e),t===null)e=null;else if(n=t.tag,n===13){if(e=Gp(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 Qs=e,null}function ch(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(BS()){case Cc:return 1;case Jp:return 4;case $s:case HS:return 16;case Zp:return 536870912;default:return 16}default:return 16}}var kn=null,Fc=null,Xs=null;function uh(){if(Xs)return Xs;var e,t=Fc,n=t.length,r,o="value"in kn?kn.value:kn.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 Xs=o.slice(e,1<r?1-r:void 0)}function qs(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 Js(){return!0}function dh(){return!1}function dt(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)?Js:dh,this.isPropagationStopped=dh,this}return me(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=Js)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Js)},persist:function(){},isPersistent:Js}),t}var eo={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Vc=dt(eo),yi=me({},eo,{view:0,detail:0}),nx=dt(yi),$c,Bc,_i,Zs=me({},yi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:zc,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!==_i&&(_i&&e.type==="mousemove"?($c=e.screenX-_i.screenX,Bc=e.screenY-_i.screenY):Bc=$c=0,_i=e),$c)},movementY:function(e){return"movementY"in e?e.movementY:Bc}}),fh=dt(Zs),rx=me({},Zs,{dataTransfer:0}),ox=dt(rx),ix=me({},yi,{relatedTarget:0}),Hc=dt(ix),sx=me({},eo,{animationName:0,elapsedTime:0,pseudoElement:0}),ax=dt(sx),lx=me({},eo,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),cx=dt(lx),ux=me({},eo,{data:0}),ph=dt(ux),dx={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},fx={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"},px={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function hx(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=px[e])?!!t[e]:!1}function zc(){return hx}var gx=me({},yi,{key:function(e){if(e.key){var t=dx[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=qs(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?fx[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:zc,charCode:function(e){return e.type==="keypress"?qs(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?qs(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),mx=dt(gx),vx=me({},Zs,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),hh=dt(vx),Ex=me({},yi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:zc}),yx=dt(Ex),_x=me({},eo,{propertyName:0,elapsedTime:0,pseudoElement:0}),Sx=dt(_x),xx=me({},Zs,{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}),Rx=dt(xx),Nx=[9,13,27,32],Wc=dn&&"CompositionEvent"in window,Si=null;dn&&"documentMode"in document&&(Si=document.documentMode);var wx=dn&&"TextEvent"in window&&!Si,gh=dn&&(!Wc||Si&&8<Si&&11>=Si),mh=String.fromCharCode(32),vh=!1;function Eh(e,t){switch(e){case"keyup":return Nx.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function yh(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var to=!1;function Ox(e,t){switch(e){case"compositionend":return yh(t);case"keypress":return t.which!==32?null:(vh=!0,mh);case"textInput":return e=t.data,e===mh&&vh?null:e;default:return null}}function Tx(e,t){if(to)return e==="compositionend"||!Wc&&Eh(e,t)?(e=uh(),Xs=Fc=kn=null,to=!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 gh&&t.locale!=="ko"?null:t.data;default:return null}}var Ax={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 _h(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Ax[e.type]:t==="textarea"}function Sh(e,t,n,r){$p(r),t=oa(t,"onChange"),0<t.length&&(n=new Vc("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var xi=null,Ri=null;function Ix(e){Fh(e,0)}function ea(e){var t=so(e);if(Ip(t))return e}function bx(e,t){if(e==="change")return t}var xh=!1;if(dn){var Gc;if(dn){var Yc="oninput"in document;if(!Yc){var Rh=document.createElement("div");Rh.setAttribute("oninput","return;"),Yc=typeof Rh.oninput=="function"}Gc=Yc}else Gc=!1;xh=Gc&&(!document.documentMode||9<document.documentMode)}function Nh(){xi&&(xi.detachEvent("onpropertychange",wh),Ri=xi=null)}function wh(e){if(e.propertyName==="value"&&ea(Ri)){var t=[];Sh(t,Ri,e,Oc(e)),Wp(Ix,t)}}function Cx(e,t,n){e==="focusin"?(Nh(),xi=t,Ri=n,xi.attachEvent("onpropertychange",wh)):e==="focusout"&&Nh()}function Lx(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return ea(Ri)}function Dx(e,t){if(e==="click")return ea(t)}function kx(e,t){if(e==="input"||e==="change")return ea(t)}function Px(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Dt=typeof Object.is=="function"?Object.is:Px;function Ni(e,t){if(Dt(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(!oc.call(t,o)||!Dt(e[o],t[o]))return!1}return!0}function Oh(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Th(e,t){var n=Oh(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=Oh(n)}}function Ah(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Ah(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Ih(){for(var e=window,t=js();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=js(e.document)}return t}function Kc(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 Mx(e){var t=Ih(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Ah(n.ownerDocument.documentElement,n)){if(r!==null&&Kc(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=Th(n,i);var s=Th(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 jx=dn&&"documentMode"in document&&11>=document.documentMode,no=null,Qc=null,wi=null,Xc=!1;function bh(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Xc||no==null||no!==js(r)||(r=no,"selectionStart"in r&&Kc(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}),wi&&Ni(wi,r)||(wi=r,r=oa(Qc,"onSelect"),0<r.length&&(t=new Vc("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=no)))}function ta(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var ro={animationend:ta("Animation","AnimationEnd"),animationiteration:ta("Animation","AnimationIteration"),animationstart:ta("Animation","AnimationStart"),transitionend:ta("Transition","TransitionEnd")},qc={},Ch={};dn&&(Ch=document.createElement("div").style,"AnimationEvent"in window||(delete ro.animationend.animation,delete ro.animationiteration.animation,delete ro.animationstart.animation),"TransitionEvent"in window||delete ro.transitionend.transition);function na(e){if(qc[e])return qc[e];if(!ro[e])return e;var t=ro[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Ch)return qc[e]=t[n];return e}var Lh=na("animationend"),Dh=na("animationiteration"),kh=na("animationstart"),Ph=na("transitionend"),Mh=new Map,jh="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 Pn(e,t){Mh.set(e,t),fr(t,[e])}for(var Jc=0;Jc<jh.length;Jc++){var Zc=jh[Jc],Ux=Zc.toLowerCase(),Fx=Zc[0].toUpperCase()+Zc.slice(1);Pn(Ux,"on"+Fx)}Pn(Lh,"onAnimationEnd"),Pn(Dh,"onAnimationIteration"),Pn(kh,"onAnimationStart"),Pn("dblclick","onDoubleClick"),Pn("focusin","onFocus"),Pn("focusout","onBlur"),Pn(Ph,"onTransitionEnd"),Yr("onMouseEnter",["mouseout","mouseover"]),Yr("onMouseLeave",["mouseout","mouseover"]),Yr("onPointerEnter",["pointerout","pointerover"]),Yr("onPointerLeave",["pointerout","pointerover"]),fr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),fr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),fr("onBeforeInput",["compositionend","keypress","textInput","paste"]),fr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),fr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),fr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Oi="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(" "),Vx=new Set("cancel close invalid load scroll toggle".split(" ").concat(Oi));function Uh(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,US(r,t,void 0,e),e.currentTarget=null}function Fh(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,c=a.currentTarget;if(a=a.listener,l!==i&&o.isPropagationStopped())break e;Uh(o,a,c),i=l}else for(s=0;s<r.length;s++){if(a=r[s],l=a.instance,c=a.currentTarget,a=a.listener,l!==i&&o.isPropagationStopped())break e;Uh(o,a,c),i=l}}}if(Vs)throw e=bc,Vs=!1,bc=null,e}function ue(e,t){var n=t[au];n===void 0&&(n=t[au]=new Set);var r=e+"__bubble";n.has(r)||(Vh(t,e,2,!1),n.add(r))}function eu(e,t,n){var r=0;t&&(r|=4),Vh(n,e,r,t)}var ra="_reactListening"+Math.random().toString(36).slice(2);function Ti(e){if(!e[ra]){e[ra]=!0,Sp.forEach(function(n){n!=="selectionchange"&&(Vx.has(n)||eu(n,!1,e),eu(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[ra]||(t[ra]=!0,eu("selectionchange",!1,t))}}function Vh(e,t,n,r){switch(ch(t)){case 1:var o=ex;break;case 4:o=tx;break;default:o=jc}n=o.bind(null,t,n,e),o=void 0,!Ic||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 tu(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=hr(a),s===null)return;if(l=s.tag,l===5||l===6){r=i=s;continue e}a=a.parentNode}}r=r.return}Wp(function(){var c=i,d=Oc(n),f=[];e:{var p=Mh.get(e);if(p!==void 0){var h=Vc,v=e;switch(e){case"keypress":if(qs(n)===0)break e;case"keydown":case"keyup":h=mx;break;case"focusin":v="focus",h=Hc;break;case"focusout":v="blur",h=Hc;break;case"beforeblur":case"afterblur":h=Hc;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=fh;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":h=ox;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":h=yx;break;case Lh:case Dh:case kh:h=ax;break;case Ph:h=Sx;break;case"scroll":h=nx;break;case"wheel":h=Rx;break;case"copy":case"cut":case"paste":h=cx;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":h=hh}var E=(t&4)!==0,y=!E&&e==="scroll",g=E?p!==null?p+"Capture":null:p;E=[];for(var m=c,_;m!==null;){_=m;var S=_.stateNode;if(_.tag===5&&S!==null&&(_=S,g!==null&&(S=ci(m,g),S!=null&&E.push(Ai(m,S,_)))),y)break;m=m.return}0<E.length&&(p=new h(p,v,null,n,d),f.push({event:p,listeners:E}))}}if(!(t&7)){e:{if(p=e==="mouseover"||e==="pointerover",h=e==="mouseout"||e==="pointerout",p&&n!==wc&&(v=n.relatedTarget||n.fromElement)&&(hr(v)||v[pn]))break e;if((h||p)&&(p=d.window===d?d:(p=d.ownerDocument)?p.defaultView||p.parentWindow:window,h?(v=n.relatedTarget||n.toElement,h=c,v=v?hr(v):null,v!==null&&(y=pr(v),v!==y||v.tag!==5&&v.tag!==6)&&(v=null)):(h=null,v=c),h!==v)){if(E=fh,S="onMouseLeave",g="onMouseEnter",m="mouse",(e==="pointerout"||e==="pointerover")&&(E=hh,S="onPointerLeave",g="onPointerEnter",m="pointer"),y=h==null?p:so(h),_=v==null?p:so(v),p=new E(S,m+"leave",h,n,d),p.target=y,p.relatedTarget=_,S=null,hr(d)===c&&(E=new E(g,m+"enter",v,n,d),E.target=_,E.relatedTarget=y,S=E),y=S,h&&v)t:{for(E=h,g=v,m=0,_=E;_;_=oo(_))m++;for(_=0,S=g;S;S=oo(S))_++;for(;0<m-_;)E=oo(E),m--;for(;0<_-m;)g=oo(g),_--;for(;m--;){if(E===g||g!==null&&E===g.alternate)break t;E=oo(E),g=oo(g)}E=null}else E=null;h!==null&&$h(f,p,h,E,!1),v!==null&&y!==null&&$h(f,y,v,E,!0)}}e:{if(p=c?so(c):window,h=p.nodeName&&p.nodeName.toLowerCase(),h==="select"||h==="input"&&p.type==="file")var x=bx;else if(_h(p))if(xh)x=kx;else{x=Lx;var R=Cx}else(h=p.nodeName)&&h.toLowerCase()==="input"&&(p.type==="checkbox"||p.type==="radio")&&(x=Dx);if(x&&(x=x(e,c))){Sh(f,x,n,d);break e}R&&R(e,p,c),e==="focusout"&&(R=p._wrapperState)&&R.controlled&&p.type==="number"&&_c(p,"number",p.value)}switch(R=c?so(c):window,e){case"focusin":(_h(R)||R.contentEditable==="true")&&(no=R,Qc=c,wi=null);break;case"focusout":wi=Qc=no=null;break;case"mousedown":Xc=!0;break;case"contextmenu":case"mouseup":case"dragend":Xc=!1,bh(f,n,d);break;case"selectionchange":if(jx)break;case"keydown":case"keyup":bh(f,n,d)}var I;if(Wc)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 to?Eh(e,n)&&(L="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(L="onCompositionStart");L&&(gh&&n.locale!=="ko"&&(to||L!=="onCompositionStart"?L==="onCompositionEnd"&&to&&(I=uh()):(kn=d,Fc="value"in kn?kn.value:kn.textContent,to=!0)),R=oa(c,L),0<R.length&&(L=new ph(L,e,null,n,d),f.push({event:L,listeners:R}),I?L.data=I:(I=yh(n),I!==null&&(L.data=I)))),(I=wx?Ox(e,n):Tx(e,n))&&(c=oa(c,"onBeforeInput"),0<c.length&&(d=new ph("onBeforeInput","beforeinput",null,n,d),f.push({event:d,listeners:c}),d.data=I))}Fh(f,t)})}function Ai(e,t,n){return{instance:e,listener:t,currentTarget:n}}function oa(e,t){for(var n=t+"Capture",r=[];e!==null;){var o=e,i=o.stateNode;o.tag===5&&i!==null&&(o=i,i=ci(e,n),i!=null&&r.unshift(Ai(e,i,o)),i=ci(e,t),i!=null&&r.push(Ai(e,i,o))),e=e.return}return r}function oo(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function $h(e,t,n,r,o){for(var i=t._reactName,s=[];n!==null&&n!==r;){var a=n,l=a.alternate,c=a.stateNode;if(l!==null&&l===r)break;a.tag===5&&c!==null&&(a=c,o?(l=ci(n,i),l!=null&&s.unshift(Ai(n,l,a))):o||(l=ci(n,i),l!=null&&s.push(Ai(n,l,a)))),n=n.return}s.length!==0&&e.push({event:t,listeners:s})}var $x=/\r\n?/g,Bx=/\u0000|\uFFFD/g;function Bh(e){return(typeof e=="string"?e:""+e).replace($x,`
42
- `).replace(Bx,"")}function ia(e,t,n){if(t=Bh(t),Bh(e)!==t&&n)throw Error(H(425))}function sa(){}var nu=null,ru=null;function ou(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 iu=typeof setTimeout=="function"?setTimeout:void 0,Hx=typeof clearTimeout=="function"?clearTimeout:void 0,Hh=typeof Promise=="function"?Promise:void 0,zx=typeof queueMicrotask=="function"?queueMicrotask:typeof Hh<"u"?function(e){return Hh.resolve(null).then(e).catch(Wx)}:iu;function Wx(e){setTimeout(function(){throw e})}function su(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),Ei(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=o}while(n);Ei(t)}function Mn(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 zh(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 io=Math.random().toString(36).slice(2),Xt="__reactFiber$"+io,Ii="__reactProps$"+io,pn="__reactContainer$"+io,au="__reactEvents$"+io,Gx="__reactListeners$"+io,Yx="__reactHandles$"+io;function hr(e){var t=e[Xt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[pn]||n[Xt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=zh(e);e!==null;){if(n=e[Xt])return n;e=zh(e)}return t}e=n,n=e.parentNode}return null}function bi(e){return e=e[Xt]||e[pn],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function so(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(H(33))}function aa(e){return e[Ii]||null}var lu=[],ao=-1;function jn(e){return{current:e}}function de(e){0>ao||(e.current=lu[ao],lu[ao]=null,ao--)}function ce(e,t){ao++,lu[ao]=e.current,e.current=t}var Un={},Fe=jn(Un),tt=jn(!1),gr=Un;function lo(e,t){var n=e.type.contextTypes;if(!n)return Un;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 nt(e){return e=e.childContextTypes,e!=null}function la(){de(tt),de(Fe)}function Wh(e,t,n){if(Fe.current!==Un)throw Error(H(168));ce(Fe,t),ce(tt,n)}function Gh(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(H(108,CS(e)||"Unknown",o));return me({},n,r)}function ca(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Un,gr=Fe.current,ce(Fe,e),ce(tt,tt.current),!0}function Yh(e,t,n){var r=e.stateNode;if(!r)throw Error(H(169));n?(e=Gh(e,t,gr),r.__reactInternalMemoizedMergedChildContext=e,de(tt),de(Fe),ce(Fe,e)):de(tt),ce(tt,n)}var hn=null,ua=!1,cu=!1;function Kh(e){hn===null?hn=[e]:hn.push(e)}function Kx(e){ua=!0,Kh(e)}function Fn(){if(!cu&&hn!==null){cu=!0;var e=0,t=se;try{var n=hn;for(se=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}hn=null,ua=!1}catch(o){throw hn!==null&&(hn=hn.slice(e+1)),Xp(Cc,Fn),o}finally{se=t,cu=!1}}return null}var co=[],uo=0,da=null,fa=0,yt=[],_t=0,mr=null,gn=1,mn="";function vr(e,t){co[uo++]=fa,co[uo++]=da,da=e,fa=t}function Qh(e,t,n){yt[_t++]=gn,yt[_t++]=mn,yt[_t++]=mr,mr=e;var r=gn;e=mn;var o=32-Lt(r)-1;r&=~(1<<o),n+=1;var i=32-Lt(t)+o;if(30<i){var s=o-o%5;i=(r&(1<<s)-1).toString(32),r>>=s,o-=s,gn=1<<32-Lt(t)+o|n<<o|r,mn=i+e}else gn=1<<i|n<<o|r,mn=e}function uu(e){e.return!==null&&(vr(e,1),Qh(e,1,0))}function du(e){for(;e===da;)da=co[--uo],co[uo]=null,fa=co[--uo],co[uo]=null;for(;e===mr;)mr=yt[--_t],yt[_t]=null,mn=yt[--_t],yt[_t]=null,gn=yt[--_t],yt[_t]=null}var ft=null,pt=null,he=!1,kt=null;function Xh(e,t){var n=Nt(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 qh(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,ft=e,pt=Mn(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,ft=e,pt=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=mr!==null?{id:gn,overflow:mn}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Nt(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,ft=e,pt=null,!0):!1;default:return!1}}function fu(e){return(e.mode&1)!==0&&(e.flags&128)===0}function pu(e){if(he){var t=pt;if(t){var n=t;if(!qh(e,t)){if(fu(e))throw Error(H(418));t=Mn(n.nextSibling);var r=ft;t&&qh(e,t)?Xh(r,n):(e.flags=e.flags&-4097|2,he=!1,ft=e)}}else{if(fu(e))throw Error(H(418));e.flags=e.flags&-4097|2,he=!1,ft=e}}}function Jh(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;ft=e}function pa(e){if(e!==ft)return!1;if(!he)return Jh(e),he=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!ou(e.type,e.memoizedProps)),t&&(t=pt)){if(fu(e))throw Zh(),Error(H(418));for(;t;)Xh(e,t),t=Mn(t.nextSibling)}if(Jh(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(H(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){pt=Mn(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}pt=null}}else pt=ft?Mn(e.stateNode.nextSibling):null;return!0}function Zh(){for(var e=pt;e;)e=Mn(e.nextSibling)}function fo(){pt=ft=null,he=!1}function hu(e){kt===null?kt=[e]:kt.push(e)}var Qx=fn.ReactCurrentBatchConfig;function Pt(e,t){if(e&&e.defaultProps){t=me({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}var ha=jn(null),ga=null,po=null,gu=null;function mu(){gu=po=ga=null}function vu(e){var t=ha.current;de(ha),e._currentValue=t}function Eu(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 ho(e,t){ga=e,gu=po=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(rt=!0),e.firstContext=null)}function St(e){var t=e._currentValue;if(gu!==e)if(e={context:e,memoizedValue:t,next:null},po===null){if(ga===null)throw Error(H(308));po=e,ga.dependencies={lanes:0,firstContext:e}}else po=po.next=e;return t}var Er=null;function yu(e){Er===null?Er=[e]:Er.push(e)}function eg(e,t,n,r){var o=t.interleaved;return o===null?(n.next=n,yu(t)):(n.next=o.next,o.next=n),t.interleaved=n,vn(e,r)}function vn(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 Vn=!1;function _u(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function tg(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 En(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function $n(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,vn(e,n)}return o=r.interleaved,o===null?(t.next=t,yu(r)):(t.next=o.next,o.next=t),r.interleaved=t,vn(e,n)}function ma(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,kc(e,n)}}function ng(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 va(e,t,n,r){var o=e.updateQueue;Vn=!1;var i=o.firstBaseUpdate,s=o.lastBaseUpdate,a=o.shared.pending;if(a!==null){o.shared.pending=null;var l=a,c=l.next;l.next=null,s===null?i=c:s.next=c,s=l;var d=e.alternate;d!==null&&(d=d.updateQueue,a=d.lastBaseUpdate,a!==s&&(a===null?d.firstBaseUpdate=c:a.next=c,d.lastBaseUpdate=l))}if(i!==null){var f=o.baseState;s=0,d=c=l=null,a=i;do{var p=a.lane,h=a.eventTime;if((r&p)===p){d!==null&&(d=d.next={eventTime:h,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var v=e,E=a;switch(p=t,h=n,E.tag){case 1:if(v=E.payload,typeof v=="function"){f=v.call(h,f,p);break e}f=v;break e;case 3:v.flags=v.flags&-65537|128;case 0:if(v=E.payload,p=typeof v=="function"?v.call(h,f,p):v,p==null)break e;f=me({},f,p);break e;case 2:Vn=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,p=o.effects,p===null?o.effects=[a]:p.push(a))}else h={eventTime:h,lane:p,tag:a.tag,payload:a.payload,callback:a.callback,next:null},d===null?(c=d=h,l=f):d=d.next=h,s|=p;if(a=a.next,a===null){if(a=o.shared.pending,a===null)break;p=a,a=p.next,p.next=null,o.lastBaseUpdate=p,o.shared.pending=null}}while(1);if(d===null&&(l=f),o.baseState=l,o.firstBaseUpdate=c,o.lastBaseUpdate=d,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);Sr|=s,e.lanes=s,e.memoizedState=f}}function rg(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(H(191,o));o.call(r)}}}var og=new _p.Component().refs;function Su(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:me({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Ea={isMounted:function(e){return(e=e._reactInternals)?pr(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Qe(),o=Wn(e),i=En(r,o);i.payload=t,n!=null&&(i.callback=n),t=$n(e,i,o),t!==null&&(Ut(t,e,o,r),ma(t,e,o))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Qe(),o=Wn(e),i=En(r,o);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=$n(e,i,o),t!==null&&(Ut(t,e,o,r),ma(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Qe(),r=Wn(e),o=En(n,r);o.tag=2,t!=null&&(o.callback=t),t=$n(e,o,r),t!==null&&(Ut(t,e,r,n),ma(t,e,r))}};function ig(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?!Ni(n,r)||!Ni(o,i):!0}function sg(e,t,n){var r=!1,o=Un,i=t.contextType;return typeof i=="object"&&i!==null?i=St(i):(o=nt(t)?gr:Fe.current,r=t.contextTypes,i=(r=r!=null)?lo(e,o):Un),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 ag(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 xu(e,t,n,r){var o=e.stateNode;o.props=n,o.state=e.memoizedState,o.refs=og,_u(e);var i=t.contextType;typeof i=="object"&&i!==null?o.context=St(i):(i=nt(t)?gr:Fe.current,o.context=lo(e,i)),o.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(Su(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),va(e,n,o,r),o.state=e.memoizedState),typeof o.componentDidMount=="function"&&(e.flags|=4194308)}function Ci(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(H(309));var r=n.stateNode}if(!r)throw Error(H(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===og&&(a=o.refs={}),s===null?delete a[i]:a[i]=s},t._stringRef=i,t)}if(typeof e!="string")throw Error(H(284));if(!n._owner)throw Error(H(290,e))}return e}function ya(e,t){throw e=Object.prototype.toString.call(t),Error(H(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function lg(e){var t=e._init;return t(e._payload)}function cg(e){function t(g,m){if(e){var _=g.deletions;_===null?(g.deletions=[m],g.flags|=16):_.push(m)}}function n(g,m){if(!e)return null;for(;m!==null;)t(g,m),m=m.sibling;return null}function r(g,m){for(g=new Map;m!==null;)m.key!==null?g.set(m.key,m):g.set(m.index,m),m=m.sibling;return g}function o(g,m){return g=Yn(g,m),g.index=0,g.sibling=null,g}function i(g,m,_){return g.index=_,e?(_=g.alternate,_!==null?(_=_.index,_<m?(g.flags|=2,m):_):(g.flags|=2,m)):(g.flags|=1048576,m)}function s(g){return e&&g.alternate===null&&(g.flags|=2),g}function a(g,m,_,S){return m===null||m.tag!==6?(m=id(_,g.mode,S),m.return=g,m):(m=o(m,_),m.return=g,m)}function l(g,m,_,S){var x=_.type;return x===Qr?d(g,m,_.props.children,S,_.key):m!==null&&(m.elementType===x||typeof x=="object"&&x!==null&&x.$$typeof===An&&lg(x)===m.type)?(S=o(m,_.props),S.ref=Ci(g,m,_),S.return=g,S):(S=Ua(_.type,_.key,_.props,null,g.mode,S),S.ref=Ci(g,m,_),S.return=g,S)}function c(g,m,_,S){return m===null||m.tag!==4||m.stateNode.containerInfo!==_.containerInfo||m.stateNode.implementation!==_.implementation?(m=sd(_,g.mode,S),m.return=g,m):(m=o(m,_.children||[]),m.return=g,m)}function d(g,m,_,S,x){return m===null||m.tag!==7?(m=wr(_,g.mode,S,x),m.return=g,m):(m=o(m,_),m.return=g,m)}function f(g,m,_){if(typeof m=="string"&&m!==""||typeof m=="number")return m=id(""+m,g.mode,_),m.return=g,m;if(typeof m=="object"&&m!==null){switch(m.$$typeof){case Ps:return _=Ua(m.type,m.key,m.props,null,g.mode,_),_.ref=Ci(g,null,m),_.return=g,_;case Kr:return m=sd(m,g.mode,_),m.return=g,m;case An:var S=m._init;return f(g,S(m._payload),_)}if(si(m)||oi(m))return m=wr(m,g.mode,_,null),m.return=g,m;ya(g,m)}return null}function p(g,m,_,S){var x=m!==null?m.key:null;if(typeof _=="string"&&_!==""||typeof _=="number")return x!==null?null:a(g,m,""+_,S);if(typeof _=="object"&&_!==null){switch(_.$$typeof){case Ps:return _.key===x?l(g,m,_,S):null;case Kr:return _.key===x?c(g,m,_,S):null;case An:return x=_._init,p(g,m,x(_._payload),S)}if(si(_)||oi(_))return x!==null?null:d(g,m,_,S,null);ya(g,_)}return null}function h(g,m,_,S,x){if(typeof S=="string"&&S!==""||typeof S=="number")return g=g.get(_)||null,a(m,g,""+S,x);if(typeof S=="object"&&S!==null){switch(S.$$typeof){case Ps:return g=g.get(S.key===null?_:S.key)||null,l(m,g,S,x);case Kr:return g=g.get(S.key===null?_:S.key)||null,c(m,g,S,x);case An:var R=S._init;return h(g,m,_,R(S._payload),x)}if(si(S)||oi(S))return g=g.get(_)||null,d(m,g,S,x,null);ya(m,S)}return null}function v(g,m,_,S){for(var x=null,R=null,I=m,L=m=0,U=null;I!==null&&L<_.length;L++){I.index>L?(U=I,I=null):U=I.sibling;var T=p(g,I,_[L],S);if(T===null){I===null&&(I=U);break}e&&I&&T.alternate===null&&t(g,I),m=i(T,m,L),R===null?x=T:R.sibling=T,R=T,I=U}if(L===_.length)return n(g,I),he&&vr(g,L),x;if(I===null){for(;L<_.length;L++)I=f(g,_[L],S),I!==null&&(m=i(I,m,L),R===null?x=I:R.sibling=I,R=I);return he&&vr(g,L),x}for(I=r(g,I);L<_.length;L++)U=h(I,g,L,_[L],S),U!==null&&(e&&U.alternate!==null&&I.delete(U.key===null?L:U.key),m=i(U,m,L),R===null?x=U:R.sibling=U,R=U);return e&&I.forEach(function(b){return t(g,b)}),he&&vr(g,L),x}function E(g,m,_,S){var x=oi(_);if(typeof x!="function")throw Error(H(150));if(_=x.call(_),_==null)throw Error(H(151));for(var R=x=null,I=m,L=m=0,U=null,T=_.next();I!==null&&!T.done;L++,T=_.next()){I.index>L?(U=I,I=null):U=I.sibling;var b=p(g,I,T.value,S);if(b===null){I===null&&(I=U);break}e&&I&&b.alternate===null&&t(g,I),m=i(b,m,L),R===null?x=b:R.sibling=b,R=b,I=U}if(T.done)return n(g,I),he&&vr(g,L),x;if(I===null){for(;!T.done;L++,T=_.next())T=f(g,T.value,S),T!==null&&(m=i(T,m,L),R===null?x=T:R.sibling=T,R=T);return he&&vr(g,L),x}for(I=r(g,I);!T.done;L++,T=_.next())T=h(I,g,L,T.value,S),T!==null&&(e&&T.alternate!==null&&I.delete(T.key===null?L:T.key),m=i(T,m,L),R===null?x=T:R.sibling=T,R=T);return e&&I.forEach(function(V){return t(g,V)}),he&&vr(g,L),x}function y(g,m,_,S){if(typeof _=="object"&&_!==null&&_.type===Qr&&_.key===null&&(_=_.props.children),typeof _=="object"&&_!==null){switch(_.$$typeof){case Ps:e:{for(var x=_.key,R=m;R!==null;){if(R.key===x){if(x=_.type,x===Qr){if(R.tag===7){n(g,R.sibling),m=o(R,_.props.children),m.return=g,g=m;break e}}else if(R.elementType===x||typeof x=="object"&&x!==null&&x.$$typeof===An&&lg(x)===R.type){n(g,R.sibling),m=o(R,_.props),m.ref=Ci(g,R,_),m.return=g,g=m;break e}n(g,R);break}else t(g,R);R=R.sibling}_.type===Qr?(m=wr(_.props.children,g.mode,S,_.key),m.return=g,g=m):(S=Ua(_.type,_.key,_.props,null,g.mode,S),S.ref=Ci(g,m,_),S.return=g,g=S)}return s(g);case Kr:e:{for(R=_.key;m!==null;){if(m.key===R)if(m.tag===4&&m.stateNode.containerInfo===_.containerInfo&&m.stateNode.implementation===_.implementation){n(g,m.sibling),m=o(m,_.children||[]),m.return=g,g=m;break e}else{n(g,m);break}else t(g,m);m=m.sibling}m=sd(_,g.mode,S),m.return=g,g=m}return s(g);case An:return R=_._init,y(g,m,R(_._payload),S)}if(si(_))return v(g,m,_,S);if(oi(_))return E(g,m,_,S);ya(g,_)}return typeof _=="string"&&_!==""||typeof _=="number"?(_=""+_,m!==null&&m.tag===6?(n(g,m.sibling),m=o(m,_),m.return=g,g=m):(n(g,m),m=id(_,g.mode,S),m.return=g,g=m),s(g)):n(g,m)}return y}var go=cg(!0),ug=cg(!1),Li={},qt=jn(Li),Di=jn(Li),ki=jn(Li);function yr(e){if(e===Li)throw Error(H(174));return e}function Ru(e,t){switch(ce(ki,t),ce(Di,e),ce(qt,Li),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:xc(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=xc(t,e)}de(qt),ce(qt,t)}function mo(){de(qt),de(Di),de(ki)}function dg(e){yr(ki.current);var t=yr(qt.current),n=xc(t,e.type);t!==n&&(ce(Di,e),ce(qt,n))}function Nu(e){Di.current===e&&(de(qt),de(Di))}var ve=jn(0);function _a(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 wu=[];function Ou(){for(var e=0;e<wu.length;e++)wu[e]._workInProgressVersionPrimary=null;wu.length=0}var Sa=fn.ReactCurrentDispatcher,Tu=fn.ReactCurrentBatchConfig,_r=0,Ee=null,Ie=null,De=null,xa=!1,Pi=!1,Mi=0,Xx=0;function Ve(){throw Error(H(321))}function Au(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Dt(e[n],t[n]))return!1;return!0}function Iu(e,t,n,r,o,i){if(_r=i,Ee=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Sa.current=e===null||e.memoizedState===null?e1:t1,e=n(r,o),Pi){i=0;do{if(Pi=!1,Mi=0,25<=i)throw Error(H(301));i+=1,De=Ie=null,t.updateQueue=null,Sa.current=n1,e=n(r,o)}while(Pi)}if(Sa.current=wa,t=Ie!==null&&Ie.next!==null,_r=0,De=Ie=Ee=null,xa=!1,t)throw Error(H(300));return e}function bu(){var e=Mi!==0;return Mi=0,e}function Jt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return De===null?Ee.memoizedState=De=e:De=De.next=e,De}function xt(){if(Ie===null){var e=Ee.alternate;e=e!==null?e.memoizedState:null}else e=Ie.next;var t=De===null?Ee.memoizedState:De.next;if(t!==null)De=t,Ie=e;else{if(e===null)throw Error(H(310));Ie=e,e={memoizedState:Ie.memoizedState,baseState:Ie.baseState,baseQueue:Ie.baseQueue,queue:Ie.queue,next:null},De===null?Ee.memoizedState=De=e:De=De.next=e}return De}function ji(e,t){return typeof t=="function"?t(e):t}function Cu(e){var t=xt(),n=t.queue;if(n===null)throw Error(H(311));n.lastRenderedReducer=e;var r=Ie,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,c=i;do{var d=c.lane;if((_r&d)===d)l!==null&&(l=l.next={lane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),r=c.hasEagerState?c.eagerState:e(r,c.action);else{var f={lane:d,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};l===null?(a=l=f,s=r):l=l.next=f,Ee.lanes|=d,Sr|=d}c=c.next}while(c!==null&&c!==i);l===null?s=r:l.next=a,Dt(r,t.memoizedState)||(rt=!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,Ee.lanes|=i,Sr|=i,o=o.next;while(o!==e)}else o===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Lu(e){var t=xt(),n=t.queue;if(n===null)throw Error(H(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);Dt(i,t.memoizedState)||(rt=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function fg(){}function pg(e,t){var n=Ee,r=xt(),o=t(),i=!Dt(r.memoizedState,o);if(i&&(r.memoizedState=o,rt=!0),r=r.queue,Du(mg.bind(null,n,r,e),[e]),r.getSnapshot!==t||i||De!==null&&De.memoizedState.tag&1){if(n.flags|=2048,Ui(9,gg.bind(null,n,r,o,t),void 0,null),ke===null)throw Error(H(349));_r&30||hg(n,t,o)}return o}function hg(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Ee.updateQueue,t===null?(t={lastEffect:null,stores:null},Ee.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function gg(e,t,n,r){t.value=n,t.getSnapshot=r,vg(t)&&Eg(e)}function mg(e,t,n){return n(function(){vg(t)&&Eg(e)})}function vg(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Dt(e,n)}catch{return!0}}function Eg(e){var t=vn(e,1);t!==null&&Ut(t,e,1,-1)}function yg(e){var t=Jt();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:ji,lastRenderedState:e},t.queue=e,e=e.dispatch=Zx.bind(null,Ee,e),[t.memoizedState,e]}function Ui(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=Ee.updateQueue,t===null?(t={lastEffect:null,stores:null},Ee.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 _g(){return xt().memoizedState}function Ra(e,t,n,r){var o=Jt();Ee.flags|=e,o.memoizedState=Ui(1|t,n,void 0,r===void 0?null:r)}function Na(e,t,n,r){var o=xt();r=r===void 0?null:r;var i=void 0;if(Ie!==null){var s=Ie.memoizedState;if(i=s.destroy,r!==null&&Au(r,s.deps)){o.memoizedState=Ui(t,n,i,r);return}}Ee.flags|=e,o.memoizedState=Ui(1|t,n,i,r)}function Sg(e,t){return Ra(8390656,8,e,t)}function Du(e,t){return Na(2048,8,e,t)}function xg(e,t){return Na(4,2,e,t)}function Rg(e,t){return Na(4,4,e,t)}function Ng(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 wg(e,t,n){return n=n!=null?n.concat([e]):null,Na(4,4,Ng.bind(null,t,e),n)}function ku(){}function Og(e,t){var n=xt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Au(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Tg(e,t){var n=xt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Au(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Ag(e,t,n){return _r&21?(Dt(n,t)||(n=eh(),Ee.lanes|=n,Sr|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,rt=!0),e.memoizedState=n)}function qx(e,t){var n=se;se=n!==0&&4>n?n:4,e(!0);var r=Tu.transition;Tu.transition={};try{e(!1),t()}finally{se=n,Tu.transition=r}}function Ig(){return xt().memoizedState}function Jx(e,t,n){var r=Wn(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},bg(e))Cg(t,n);else if(n=eg(e,t,n,r),n!==null){var o=Qe();Ut(n,e,r,o),Lg(n,t,r)}}function Zx(e,t,n){var r=Wn(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(bg(e))Cg(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,Dt(a,s)){var l=t.interleaved;l===null?(o.next=o,yu(t)):(o.next=l.next,l.next=o),t.interleaved=o;return}}catch{}finally{}n=eg(e,t,o,r),n!==null&&(o=Qe(),Ut(n,e,r,o),Lg(n,t,r))}}function bg(e){var t=e.alternate;return e===Ee||t!==null&&t===Ee}function Cg(e,t){Pi=xa=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Lg(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,kc(e,n)}}var wa={readContext:St,useCallback:Ve,useContext:Ve,useEffect:Ve,useImperativeHandle:Ve,useInsertionEffect:Ve,useLayoutEffect:Ve,useMemo:Ve,useReducer:Ve,useRef:Ve,useState:Ve,useDebugValue:Ve,useDeferredValue:Ve,useTransition:Ve,useMutableSource:Ve,useSyncExternalStore:Ve,useId:Ve,unstable_isNewReconciler:!1},e1={readContext:St,useCallback:function(e,t){return Jt().memoizedState=[e,t===void 0?null:t],e},useContext:St,useEffect:Sg,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Ra(4194308,4,Ng.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ra(4194308,4,e,t)},useInsertionEffect:function(e,t){return Ra(4,2,e,t)},useMemo:function(e,t){var n=Jt();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Jt();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=Jx.bind(null,Ee,e),[r.memoizedState,e]},useRef:function(e){var t=Jt();return e={current:e},t.memoizedState=e},useState:yg,useDebugValue:ku,useDeferredValue:function(e){return Jt().memoizedState=e},useTransition:function(){var e=yg(!1),t=e[0];return e=qx.bind(null,e[1]),Jt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Ee,o=Jt();if(he){if(n===void 0)throw Error(H(407));n=n()}else{if(n=t(),ke===null)throw Error(H(349));_r&30||hg(r,t,n)}o.memoizedState=n;var i={value:n,getSnapshot:t};return o.queue=i,Sg(mg.bind(null,r,i,e),[e]),r.flags|=2048,Ui(9,gg.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=Jt(),t=ke.identifierPrefix;if(he){var n=mn,r=gn;n=(r&~(1<<32-Lt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Mi++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=Xx++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},t1={readContext:St,useCallback:Og,useContext:St,useEffect:Du,useImperativeHandle:wg,useInsertionEffect:xg,useLayoutEffect:Rg,useMemo:Tg,useReducer:Cu,useRef:_g,useState:function(){return Cu(ji)},useDebugValue:ku,useDeferredValue:function(e){var t=xt();return Ag(t,Ie.memoizedState,e)},useTransition:function(){var e=Cu(ji)[0],t=xt().memoizedState;return[e,t]},useMutableSource:fg,useSyncExternalStore:pg,useId:Ig,unstable_isNewReconciler:!1},n1={readContext:St,useCallback:Og,useContext:St,useEffect:Du,useImperativeHandle:wg,useInsertionEffect:xg,useLayoutEffect:Rg,useMemo:Tg,useReducer:Lu,useRef:_g,useState:function(){return Lu(ji)},useDebugValue:ku,useDeferredValue:function(e){var t=xt();return Ie===null?t.memoizedState=e:Ag(t,Ie.memoizedState,e)},useTransition:function(){var e=Lu(ji)[0],t=xt().memoizedState;return[e,t]},useMutableSource:fg,useSyncExternalStore:pg,useId:Ig,unstable_isNewReconciler:!1};function vo(e,t){try{var n="",r=t;do n+=bS(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{Ec=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?ii(e):""}function IS(e){switch(e.tag){case 5:return ii(e.type);case 16:return ii("Lazy");case 13:return ii("Suspense");case 19:return ii("SuspenseList");case 0:case 2:case 15:return e=vc(e.type,!1),e;case 11:return e=vc(e.type.render,!1),e;case 1:return e=vc(e.type,!0),e;default:return""}}function yc(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 Qr:return"Fragment";case Kr:return"Portal";case dc:return"Profiler";case uc:return"StrictMode";case pc:return"Suspense";case hc:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case wp:return(e.displayName||"Context")+".Consumer";case Np:return(e._context.displayName||"Context")+".Provider";case fc:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case gc:return t=e.displayName||null,t!==null?t:yc(e.type)||"Memo";case An:t=e._payload,e=e._init;try{return yc(e(t))}catch{}}return null}function bS(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 yc(t);case 8:return t===uc?"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 In(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Ap(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function CS(e){var t=Ap(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 Us(e){e._valueTracker||(e._valueTracker=CS(e))}function Ip(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Ap(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Fs(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 _c(e,t){var n=t.checked;return Ee({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function bp(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=In(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 Cp(e,t){t=t.checked,t!=null&&cc(e,"checked",t,!1)}function Sc(e,t){Cp(e,t);var n=In(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")?xc(e,t.type,n):t.hasOwnProperty("defaultValue")&&xc(e,t.type,In(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Lp(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 xc(e,t,n){(t!=="number"||Fs(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var si=Array.isArray;function Xr(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=""+In(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 Rc(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(H(91));return Ee({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Dp(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(H(92));if(si(n)){if(1<n.length)throw Error(H(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:In(n)}}function kp(e,t){var n=In(t.value),r=In(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 Pp(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Mp(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 Nc(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Mp(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Vs,jp=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(Vs=Vs||document.createElement("div"),Vs.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Vs.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function ai(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var li={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},LS=["Webkit","ms","Moz","O"];Object.keys(li).forEach(function(e){LS.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),li[t]=li[e]})});function Up(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||li.hasOwnProperty(e)&&li[e]?(""+t).trim():t+"px"}function Fp(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=Up(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var DS=Ee({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 wc(e,t){if(t){if(DS[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(H(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(H(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(H(61))}if(t.style!=null&&typeof t.style!="object")throw Error(H(62))}}function Oc(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 Tc=null;function Ac(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ic=null,qr=null,Jr=null;function Vp(e){if(e=bi(e)){if(typeof Ic!="function")throw Error(H(280));var t=e.stateNode;t&&(t=ca(t),Ic(e.stateNode,e.type,t))}}function $p(e){qr?Jr?Jr.push(e):Jr=[e]:qr=e}function Bp(){if(qr){var e=qr,t=Jr;if(Jr=qr=null,Vp(e),t)for(e=0;e<t.length;e++)Vp(t[e])}}function Hp(e,t){return e(t)}function zp(){}var bc=!1;function Wp(e,t,n){if(bc)return e(t,n);bc=!0;try{return Hp(e,t,n)}finally{bc=!1,(qr!==null||Jr!==null)&&(zp(),Bp())}}function ci(e,t){var n=e.stateNode;if(n===null)return null;var r=ca(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(H(231,t,typeof n));return n}var Cc=!1;if(dn)try{var ui={};Object.defineProperty(ui,"passive",{get:function(){Cc=!0}}),window.addEventListener("test",ui,ui),window.removeEventListener("test",ui,ui)}catch{Cc=!1}function kS(e,t,n,r,o,i,s,a,l){var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(d){this.onError(d)}}var di=!1,$s=null,Bs=!1,Lc=null,PS={onError:function(e){di=!0,$s=e}};function MS(e,t,n,r,o,i,s,a,l){di=!1,$s=null,kS.apply(PS,arguments)}function jS(e,t,n,r,o,i,s,a,l){if(MS.apply(this,arguments),di){if(di){var c=$s;di=!1,$s=null}else throw Error(H(198));Bs||(Bs=!0,Lc=c)}}function pr(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 Gp(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 Yp(e){if(pr(e)!==e)throw Error(H(188))}function US(e){var t=e.alternate;if(!t){if(t=pr(e),t===null)throw Error(H(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 Yp(o),e;if(i===r)return Yp(o),t;i=i.sibling}throw Error(H(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(H(189))}}if(n.alternate!==r)throw Error(H(190))}if(n.tag!==3)throw Error(H(188));return n.stateNode.current===n?e:t}function Kp(e){return e=US(e),e!==null?Qp(e):null}function Qp(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Qp(e);if(t!==null)return t;e=e.sibling}return null}var Xp=dt.unstable_scheduleCallback,qp=dt.unstable_cancelCallback,FS=dt.unstable_shouldYield,VS=dt.unstable_requestPaint,Re=dt.unstable_now,$S=dt.unstable_getCurrentPriorityLevel,Dc=dt.unstable_ImmediatePriority,Jp=dt.unstable_UserBlockingPriority,Hs=dt.unstable_NormalPriority,BS=dt.unstable_LowPriority,Zp=dt.unstable_IdlePriority,zs=null,Qt=null;function HS(e){if(Qt&&typeof Qt.onCommitFiberRoot=="function")try{Qt.onCommitFiberRoot(zs,e,void 0,(e.current.flags&128)===128)}catch{}}var Dt=Math.clz32?Math.clz32:GS,zS=Math.log,WS=Math.LN2;function GS(e){return e>>>=0,e===0?32:31-(zS(e)/WS|0)|0}var Ws=64,Gs=4194304;function fi(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 Ys(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=fi(a):(i&=s,i!==0&&(r=fi(i)))}else s=n&~o,s!==0?r=fi(s):i!==0&&(r=fi(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-Dt(t),o=1<<n,r|=e[n],t&=~o;return r}function YS(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 KS(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,o=e.expirationTimes,i=e.pendingLanes;0<i;){var s=31-Dt(i),a=1<<s,l=o[s];l===-1?(!(a&n)||a&r)&&(o[s]=YS(a,t)):l<=t&&(e.expiredLanes|=a),i&=~a}}function kc(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function eh(){var e=Ws;return Ws<<=1,!(Ws&4194240)&&(Ws=64),e}function Pc(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function pi(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Dt(t),e[t]=n}function QS(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-Dt(n),i=1<<o;t[o]=0,r[o]=-1,e[o]=-1,n&=~i}}function Mc(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Dt(n),o=1<<r;o&t|e[r]&t&&(e[r]|=t),n&=~o}}var se=0;function th(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var nh,jc,rh,oh,ih,Uc=!1,Ks=[],bn=null,Cn=null,Ln=null,hi=new Map,gi=new Map,Dn=[],XS="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 sh(e,t){switch(e){case"focusin":case"focusout":bn=null;break;case"dragenter":case"dragleave":Cn=null;break;case"mouseover":case"mouseout":Ln=null;break;case"pointerover":case"pointerout":hi.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":gi.delete(t.pointerId)}}function mi(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=bi(t),t!==null&&jc(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function qS(e,t,n,r,o){switch(t){case"focusin":return bn=mi(bn,e,t,n,r,o),!0;case"dragenter":return Cn=mi(Cn,e,t,n,r,o),!0;case"mouseover":return Ln=mi(Ln,e,t,n,r,o),!0;case"pointerover":var i=o.pointerId;return hi.set(i,mi(hi.get(i)||null,e,t,n,r,o)),!0;case"gotpointercapture":return i=o.pointerId,gi.set(i,mi(gi.get(i)||null,e,t,n,r,o)),!0}return!1}function ah(e){var t=hr(e.target);if(t!==null){var n=pr(t);if(n!==null){if(t=n.tag,t===13){if(t=Gp(n),t!==null){e.blockedOn=t,ih(e.priority,function(){rh(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 Qs(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Vc(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Tc=r,n.target.dispatchEvent(r),Tc=null}else return t=bi(n),t!==null&&jc(t),e.blockedOn=n,!1;t.shift()}return!0}function lh(e,t,n){Qs(e)&&n.delete(t)}function JS(){Uc=!1,bn!==null&&Qs(bn)&&(bn=null),Cn!==null&&Qs(Cn)&&(Cn=null),Ln!==null&&Qs(Ln)&&(Ln=null),hi.forEach(lh),gi.forEach(lh)}function Ei(e,t){e.blockedOn===t&&(e.blockedOn=null,Uc||(Uc=!0,dt.unstable_scheduleCallback(dt.unstable_NormalPriority,JS)))}function vi(e){function t(o){return Ei(o,e)}if(0<Ks.length){Ei(Ks[0],e);for(var n=1;n<Ks.length;n++){var r=Ks[n];r.blockedOn===e&&(r.blockedOn=null)}}for(bn!==null&&Ei(bn,e),Cn!==null&&Ei(Cn,e),Ln!==null&&Ei(Ln,e),hi.forEach(t),gi.forEach(t),n=0;n<Dn.length;n++)r=Dn[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<Dn.length&&(n=Dn[0],n.blockedOn===null);)ah(n),n.blockedOn===null&&Dn.shift()}var Zr=fn.ReactCurrentBatchConfig,Xs=!0;function ZS(e,t,n,r){var o=se,i=Zr.transition;Zr.transition=null;try{se=1,Fc(e,t,n,r)}finally{se=o,Zr.transition=i}}function ex(e,t,n,r){var o=se,i=Zr.transition;Zr.transition=null;try{se=4,Fc(e,t,n,r)}finally{se=o,Zr.transition=i}}function Fc(e,t,n,r){if(Xs){var o=Vc(e,t,n,r);if(o===null)ru(e,t,r,qs,n),sh(e,r);else if(qS(o,e,t,n,r))r.stopPropagation();else if(sh(e,r),t&4&&-1<XS.indexOf(e)){for(;o!==null;){var i=bi(o);if(i!==null&&nh(i),i=Vc(e,t,n,r),i===null&&ru(e,t,r,qs,n),i===o)break;o=i}o!==null&&r.stopPropagation()}else ru(e,t,r,null,n)}}var qs=null;function Vc(e,t,n,r){if(qs=null,e=Ac(r),e=hr(e),e!==null)if(t=pr(e),t===null)e=null;else if(n=t.tag,n===13){if(e=Gp(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 qs=e,null}function ch(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($S()){case Dc:return 1;case Jp:return 4;case Hs:case BS:return 16;case Zp:return 536870912;default:return 16}default:return 16}}var kn=null,$c=null,Js=null;function uh(){if(Js)return Js;var e,t=$c,n=t.length,r,o="value"in kn?kn.value:kn.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 Js=o.slice(e,1<r?1-r:void 0)}function Zs(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 ea(){return!0}function dh(){return!1}function ft(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)?ea:dh,this.isPropagationStopped=dh,this}return Ee(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=ea)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=ea)},persist:function(){},isPersistent:ea}),t}var eo={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Bc=ft(eo),yi=Ee({},eo,{view:0,detail:0}),tx=ft(yi),Hc,zc,_i,ta=Ee({},yi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Gc,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!==_i&&(_i&&e.type==="mousemove"?(Hc=e.screenX-_i.screenX,zc=e.screenY-_i.screenY):zc=Hc=0,_i=e),Hc)},movementY:function(e){return"movementY"in e?e.movementY:zc}}),fh=ft(ta),nx=Ee({},ta,{dataTransfer:0}),rx=ft(nx),ox=Ee({},yi,{relatedTarget:0}),Wc=ft(ox),ix=Ee({},eo,{animationName:0,elapsedTime:0,pseudoElement:0}),sx=ft(ix),ax=Ee({},eo,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),lx=ft(ax),cx=Ee({},eo,{data:0}),ph=ft(cx),ux={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},dx={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"},fx={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function px(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=fx[e])?!!t[e]:!1}function Gc(){return px}var hx=Ee({},yi,{key:function(e){if(e.key){var t=ux[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Zs(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?dx[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Gc,charCode:function(e){return e.type==="keypress"?Zs(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Zs(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),gx=ft(hx),mx=Ee({},ta,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),hh=ft(mx),Ex=Ee({},yi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Gc}),vx=ft(Ex),yx=Ee({},eo,{propertyName:0,elapsedTime:0,pseudoElement:0}),_x=ft(yx),Sx=Ee({},ta,{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}),xx=ft(Sx),Rx=[9,13,27,32],Yc=dn&&"CompositionEvent"in window,Si=null;dn&&"documentMode"in document&&(Si=document.documentMode);var Nx=dn&&"TextEvent"in window&&!Si,gh=dn&&(!Yc||Si&&8<Si&&11>=Si),mh=String.fromCharCode(32),Eh=!1;function vh(e,t){switch(e){case"keyup":return Rx.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function yh(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var to=!1;function wx(e,t){switch(e){case"compositionend":return yh(t);case"keypress":return t.which!==32?null:(Eh=!0,mh);case"textInput":return e=t.data,e===mh&&Eh?null:e;default:return null}}function Ox(e,t){if(to)return e==="compositionend"||!Yc&&vh(e,t)?(e=uh(),Js=$c=kn=null,to=!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 gh&&t.locale!=="ko"?null:t.data;default:return null}}var Tx={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 _h(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Tx[e.type]:t==="textarea"}function Sh(e,t,n,r){$p(r),t=sa(t,"onChange"),0<t.length&&(n=new Bc("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var xi=null,Ri=null;function Ax(e){Fh(e,0)}function na(e){var t=so(e);if(Ip(t))return e}function Ix(e,t){if(e==="change")return t}var xh=!1;if(dn){var Kc;if(dn){var Qc="oninput"in document;if(!Qc){var Rh=document.createElement("div");Rh.setAttribute("oninput","return;"),Qc=typeof Rh.oninput=="function"}Kc=Qc}else Kc=!1;xh=Kc&&(!document.documentMode||9<document.documentMode)}function Nh(){xi&&(xi.detachEvent("onpropertychange",wh),Ri=xi=null)}function wh(e){if(e.propertyName==="value"&&na(Ri)){var t=[];Sh(t,Ri,e,Ac(e)),Wp(Ax,t)}}function bx(e,t,n){e==="focusin"?(Nh(),xi=t,Ri=n,xi.attachEvent("onpropertychange",wh)):e==="focusout"&&Nh()}function Cx(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return na(Ri)}function Lx(e,t){if(e==="click")return na(t)}function Dx(e,t){if(e==="input"||e==="change")return na(t)}function kx(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var kt=typeof Object.is=="function"?Object.is:kx;function Ni(e,t){if(kt(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(!sc.call(t,o)||!kt(e[o],t[o]))return!1}return!0}function Oh(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Th(e,t){var n=Oh(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=Oh(n)}}function Ah(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Ah(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Ih(){for(var e=window,t=Fs();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Fs(e.document)}return t}function Xc(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 Px(e){var t=Ih(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Ah(n.ownerDocument.documentElement,n)){if(r!==null&&Xc(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=Th(n,i);var s=Th(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 Mx=dn&&"documentMode"in document&&11>=document.documentMode,no=null,qc=null,wi=null,Jc=!1;function bh(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Jc||no==null||no!==Fs(r)||(r=no,"selectionStart"in r&&Xc(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}),wi&&Ni(wi,r)||(wi=r,r=sa(qc,"onSelect"),0<r.length&&(t=new Bc("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=no)))}function ra(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var ro={animationend:ra("Animation","AnimationEnd"),animationiteration:ra("Animation","AnimationIteration"),animationstart:ra("Animation","AnimationStart"),transitionend:ra("Transition","TransitionEnd")},Zc={},Ch={};dn&&(Ch=document.createElement("div").style,"AnimationEvent"in window||(delete ro.animationend.animation,delete ro.animationiteration.animation,delete ro.animationstart.animation),"TransitionEvent"in window||delete ro.transitionend.transition);function oa(e){if(Zc[e])return Zc[e];if(!ro[e])return e;var t=ro[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Ch)return Zc[e]=t[n];return e}var Lh=oa("animationend"),Dh=oa("animationiteration"),kh=oa("animationstart"),Ph=oa("transitionend"),Mh=new Map,jh="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 Pn(e,t){Mh.set(e,t),fr(t,[e])}for(var eu=0;eu<jh.length;eu++){var tu=jh[eu],jx=tu.toLowerCase(),Ux=tu[0].toUpperCase()+tu.slice(1);Pn(jx,"on"+Ux)}Pn(Lh,"onAnimationEnd"),Pn(Dh,"onAnimationIteration"),Pn(kh,"onAnimationStart"),Pn("dblclick","onDoubleClick"),Pn("focusin","onFocus"),Pn("focusout","onBlur"),Pn(Ph,"onTransitionEnd"),Yr("onMouseEnter",["mouseout","mouseover"]),Yr("onMouseLeave",["mouseout","mouseover"]),Yr("onPointerEnter",["pointerout","pointerover"]),Yr("onPointerLeave",["pointerout","pointerover"]),fr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),fr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),fr("onBeforeInput",["compositionend","keypress","textInput","paste"]),fr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),fr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),fr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Oi="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(" "),Fx=new Set("cancel close invalid load scroll toggle".split(" ").concat(Oi));function Uh(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,jS(r,t,void 0,e),e.currentTarget=null}function Fh(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,c=a.currentTarget;if(a=a.listener,l!==i&&o.isPropagationStopped())break e;Uh(o,a,c),i=l}else for(s=0;s<r.length;s++){if(a=r[s],l=a.instance,c=a.currentTarget,a=a.listener,l!==i&&o.isPropagationStopped())break e;Uh(o,a,c),i=l}}}if(Bs)throw e=Lc,Bs=!1,Lc=null,e}function ue(e,t){var n=t[cu];n===void 0&&(n=t[cu]=new Set);var r=e+"__bubble";n.has(r)||(Vh(t,e,2,!1),n.add(r))}function nu(e,t,n){var r=0;t&&(r|=4),Vh(n,e,r,t)}var ia="_reactListening"+Math.random().toString(36).slice(2);function Ti(e){if(!e[ia]){e[ia]=!0,Sp.forEach(function(n){n!=="selectionchange"&&(Fx.has(n)||nu(n,!1,e),nu(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[ia]||(t[ia]=!0,nu("selectionchange",!1,t))}}function Vh(e,t,n,r){switch(ch(t)){case 1:var o=ZS;break;case 4:o=ex;break;default:o=Fc}n=o.bind(null,t,n,e),o=void 0,!Cc||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 ru(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=hr(a),s===null)return;if(l=s.tag,l===5||l===6){r=i=s;continue e}a=a.parentNode}}r=r.return}Wp(function(){var c=i,d=Ac(n),f=[];e:{var p=Mh.get(e);if(p!==void 0){var h=Bc,E=e;switch(e){case"keypress":if(Zs(n)===0)break e;case"keydown":case"keyup":h=gx;break;case"focusin":E="focus",h=Wc;break;case"focusout":E="blur",h=Wc;break;case"beforeblur":case"afterblur":h=Wc;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=fh;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":h=rx;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":h=vx;break;case Lh:case Dh:case kh:h=sx;break;case Ph:h=_x;break;case"scroll":h=tx;break;case"wheel":h=xx;break;case"copy":case"cut":case"paste":h=lx;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":h=hh}var v=(t&4)!==0,y=!v&&e==="scroll",g=v?p!==null?p+"Capture":null:p;v=[];for(var m=c,_;m!==null;){_=m;var S=_.stateNode;if(_.tag===5&&S!==null&&(_=S,g!==null&&(S=ci(m,g),S!=null&&v.push(Ai(m,S,_)))),y)break;m=m.return}0<v.length&&(p=new h(p,E,null,n,d),f.push({event:p,listeners:v}))}}if(!(t&7)){e:{if(p=e==="mouseover"||e==="pointerover",h=e==="mouseout"||e==="pointerout",p&&n!==Tc&&(E=n.relatedTarget||n.fromElement)&&(hr(E)||E[pn]))break e;if((h||p)&&(p=d.window===d?d:(p=d.ownerDocument)?p.defaultView||p.parentWindow:window,h?(E=n.relatedTarget||n.toElement,h=c,E=E?hr(E):null,E!==null&&(y=pr(E),E!==y||E.tag!==5&&E.tag!==6)&&(E=null)):(h=null,E=c),h!==E)){if(v=fh,S="onMouseLeave",g="onMouseEnter",m="mouse",(e==="pointerout"||e==="pointerover")&&(v=hh,S="onPointerLeave",g="onPointerEnter",m="pointer"),y=h==null?p:so(h),_=E==null?p:so(E),p=new v(S,m+"leave",h,n,d),p.target=y,p.relatedTarget=_,S=null,hr(d)===c&&(v=new v(g,m+"enter",E,n,d),v.target=_,v.relatedTarget=y,S=v),y=S,h&&E)t:{for(v=h,g=E,m=0,_=v;_;_=oo(_))m++;for(_=0,S=g;S;S=oo(S))_++;for(;0<m-_;)v=oo(v),m--;for(;0<_-m;)g=oo(g),_--;for(;m--;){if(v===g||g!==null&&v===g.alternate)break t;v=oo(v),g=oo(g)}v=null}else v=null;h!==null&&$h(f,p,h,v,!1),E!==null&&y!==null&&$h(f,y,E,v,!0)}}e:{if(p=c?so(c):window,h=p.nodeName&&p.nodeName.toLowerCase(),h==="select"||h==="input"&&p.type==="file")var x=Ix;else if(_h(p))if(xh)x=Dx;else{x=Cx;var R=bx}else(h=p.nodeName)&&h.toLowerCase()==="input"&&(p.type==="checkbox"||p.type==="radio")&&(x=Lx);if(x&&(x=x(e,c))){Sh(f,x,n,d);break e}R&&R(e,p,c),e==="focusout"&&(R=p._wrapperState)&&R.controlled&&p.type==="number"&&xc(p,"number",p.value)}switch(R=c?so(c):window,e){case"focusin":(_h(R)||R.contentEditable==="true")&&(no=R,qc=c,wi=null);break;case"focusout":wi=qc=no=null;break;case"mousedown":Jc=!0;break;case"contextmenu":case"mouseup":case"dragend":Jc=!1,bh(f,n,d);break;case"selectionchange":if(Mx)break;case"keydown":case"keyup":bh(f,n,d)}var I;if(Yc)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 to?vh(e,n)&&(L="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(L="onCompositionStart");L&&(gh&&n.locale!=="ko"&&(to||L!=="onCompositionStart"?L==="onCompositionEnd"&&to&&(I=uh()):(kn=d,$c="value"in kn?kn.value:kn.textContent,to=!0)),R=sa(c,L),0<R.length&&(L=new ph(L,e,null,n,d),f.push({event:L,listeners:R}),I?L.data=I:(I=yh(n),I!==null&&(L.data=I)))),(I=Nx?wx(e,n):Ox(e,n))&&(c=sa(c,"onBeforeInput"),0<c.length&&(d=new ph("onBeforeInput","beforeinput",null,n,d),f.push({event:d,listeners:c}),d.data=I))}Fh(f,t)})}function Ai(e,t,n){return{instance:e,listener:t,currentTarget:n}}function sa(e,t){for(var n=t+"Capture",r=[];e!==null;){var o=e,i=o.stateNode;o.tag===5&&i!==null&&(o=i,i=ci(e,n),i!=null&&r.unshift(Ai(e,i,o)),i=ci(e,t),i!=null&&r.push(Ai(e,i,o))),e=e.return}return r}function oo(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function $h(e,t,n,r,o){for(var i=t._reactName,s=[];n!==null&&n!==r;){var a=n,l=a.alternate,c=a.stateNode;if(l!==null&&l===r)break;a.tag===5&&c!==null&&(a=c,o?(l=ci(n,i),l!=null&&s.unshift(Ai(n,l,a))):o||(l=ci(n,i),l!=null&&s.push(Ai(n,l,a)))),n=n.return}s.length!==0&&e.push({event:t,listeners:s})}var Vx=/\r\n?/g,$x=/\u0000|\uFFFD/g;function Bh(e){return(typeof e=="string"?e:""+e).replace(Vx,`
42
+ `).replace($x,"")}function aa(e,t,n){if(t=Bh(t),Bh(e)!==t&&n)throw Error(H(425))}function la(){}var ou=null,iu=null;function su(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 au=typeof setTimeout=="function"?setTimeout:void 0,Bx=typeof clearTimeout=="function"?clearTimeout:void 0,Hh=typeof Promise=="function"?Promise:void 0,Hx=typeof queueMicrotask=="function"?queueMicrotask:typeof Hh<"u"?function(e){return Hh.resolve(null).then(e).catch(zx)}:au;function zx(e){setTimeout(function(){throw e})}function lu(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),vi(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=o}while(n);vi(t)}function Mn(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 zh(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 io=Math.random().toString(36).slice(2),Xt="__reactFiber$"+io,Ii="__reactProps$"+io,pn="__reactContainer$"+io,cu="__reactEvents$"+io,Wx="__reactListeners$"+io,Gx="__reactHandles$"+io;function hr(e){var t=e[Xt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[pn]||n[Xt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=zh(e);e!==null;){if(n=e[Xt])return n;e=zh(e)}return t}e=n,n=e.parentNode}return null}function bi(e){return e=e[Xt]||e[pn],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function so(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(H(33))}function ca(e){return e[Ii]||null}var uu=[],ao=-1;function jn(e){return{current:e}}function de(e){0>ao||(e.current=uu[ao],uu[ao]=null,ao--)}function ce(e,t){ao++,uu[ao]=e.current,e.current=t}var Un={},Ve=jn(Un),nt=jn(!1),gr=Un;function lo(e,t){var n=e.type.contextTypes;if(!n)return Un;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 rt(e){return e=e.childContextTypes,e!=null}function ua(){de(nt),de(Ve)}function Wh(e,t,n){if(Ve.current!==Un)throw Error(H(168));ce(Ve,t),ce(nt,n)}function Gh(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(H(108,bS(e)||"Unknown",o));return Ee({},n,r)}function da(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Un,gr=Ve.current,ce(Ve,e),ce(nt,nt.current),!0}function Yh(e,t,n){var r=e.stateNode;if(!r)throw Error(H(169));n?(e=Gh(e,t,gr),r.__reactInternalMemoizedMergedChildContext=e,de(nt),de(Ve),ce(Ve,e)):de(nt),ce(nt,n)}var hn=null,fa=!1,du=!1;function Kh(e){hn===null?hn=[e]:hn.push(e)}function Yx(e){fa=!0,Kh(e)}function Fn(){if(!du&&hn!==null){du=!0;var e=0,t=se;try{var n=hn;for(se=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}hn=null,fa=!1}catch(o){throw hn!==null&&(hn=hn.slice(e+1)),Xp(Dc,Fn),o}finally{se=t,du=!1}}return null}var co=[],uo=0,pa=null,ha=0,St=[],xt=0,mr=null,gn=1,mn="";function Er(e,t){co[uo++]=ha,co[uo++]=pa,pa=e,ha=t}function Qh(e,t,n){St[xt++]=gn,St[xt++]=mn,St[xt++]=mr,mr=e;var r=gn;e=mn;var o=32-Dt(r)-1;r&=~(1<<o),n+=1;var i=32-Dt(t)+o;if(30<i){var s=o-o%5;i=(r&(1<<s)-1).toString(32),r>>=s,o-=s,gn=1<<32-Dt(t)+o|n<<o|r,mn=i+e}else gn=1<<i|n<<o|r,mn=e}function fu(e){e.return!==null&&(Er(e,1),Qh(e,1,0))}function pu(e){for(;e===pa;)pa=co[--uo],co[uo]=null,ha=co[--uo],co[uo]=null;for(;e===mr;)mr=St[--xt],St[xt]=null,mn=St[--xt],St[xt]=null,gn=St[--xt],St[xt]=null}var pt=null,ht=null,he=!1,Pt=null;function Xh(e,t){var n=Ot(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 qh(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,pt=e,ht=Mn(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,pt=e,ht=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=mr!==null?{id:gn,overflow:mn}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Ot(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,pt=e,ht=null,!0):!1;default:return!1}}function hu(e){return(e.mode&1)!==0&&(e.flags&128)===0}function gu(e){if(he){var t=ht;if(t){var n=t;if(!qh(e,t)){if(hu(e))throw Error(H(418));t=Mn(n.nextSibling);var r=pt;t&&qh(e,t)?Xh(r,n):(e.flags=e.flags&-4097|2,he=!1,pt=e)}}else{if(hu(e))throw Error(H(418));e.flags=e.flags&-4097|2,he=!1,pt=e}}}function Jh(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;pt=e}function ga(e){if(e!==pt)return!1;if(!he)return Jh(e),he=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!su(e.type,e.memoizedProps)),t&&(t=ht)){if(hu(e))throw Zh(),Error(H(418));for(;t;)Xh(e,t),t=Mn(t.nextSibling)}if(Jh(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(H(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){ht=Mn(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}ht=null}}else ht=pt?Mn(e.stateNode.nextSibling):null;return!0}function Zh(){for(var e=ht;e;)e=Mn(e.nextSibling)}function fo(){ht=pt=null,he=!1}function mu(e){Pt===null?Pt=[e]:Pt.push(e)}var Kx=fn.ReactCurrentBatchConfig;function Mt(e,t){if(e&&e.defaultProps){t=Ee({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}var ma=jn(null),Ea=null,po=null,Eu=null;function vu(){Eu=po=Ea=null}function yu(e){var t=ma.current;de(ma),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 ho(e,t){Ea=e,Eu=po=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(ot=!0),e.firstContext=null)}function Rt(e){var t=e._currentValue;if(Eu!==e)if(e={context:e,memoizedValue:t,next:null},po===null){if(Ea===null)throw Error(H(308));po=e,Ea.dependencies={lanes:0,firstContext:e}}else po=po.next=e;return t}var vr=null;function Su(e){vr===null?vr=[e]:vr.push(e)}function eg(e,t,n,r){var o=t.interleaved;return o===null?(n.next=n,Su(t)):(n.next=o.next,o.next=n),t.interleaved=n,En(e,r)}function En(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 Vn=!1;function xu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function tg(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 vn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function $n(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,En(e,n)}return o=r.interleaved,o===null?(t.next=t,Su(r)):(t.next=o.next,o.next=t),r.interleaved=t,En(e,n)}function va(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,Mc(e,n)}}function ng(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 ya(e,t,n,r){var o=e.updateQueue;Vn=!1;var i=o.firstBaseUpdate,s=o.lastBaseUpdate,a=o.shared.pending;if(a!==null){o.shared.pending=null;var l=a,c=l.next;l.next=null,s===null?i=c:s.next=c,s=l;var d=e.alternate;d!==null&&(d=d.updateQueue,a=d.lastBaseUpdate,a!==s&&(a===null?d.firstBaseUpdate=c:a.next=c,d.lastBaseUpdate=l))}if(i!==null){var f=o.baseState;s=0,d=c=l=null,a=i;do{var p=a.lane,h=a.eventTime;if((r&p)===p){d!==null&&(d=d.next={eventTime:h,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var E=e,v=a;switch(p=t,h=n,v.tag){case 1:if(E=v.payload,typeof E=="function"){f=E.call(h,f,p);break e}f=E;break e;case 3:E.flags=E.flags&-65537|128;case 0:if(E=v.payload,p=typeof E=="function"?E.call(h,f,p):E,p==null)break e;f=Ee({},f,p);break e;case 2:Vn=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,p=o.effects,p===null?o.effects=[a]:p.push(a))}else h={eventTime:h,lane:p,tag:a.tag,payload:a.payload,callback:a.callback,next:null},d===null?(c=d=h,l=f):d=d.next=h,s|=p;if(a=a.next,a===null){if(a=o.shared.pending,a===null)break;p=a,a=p.next,p.next=null,o.lastBaseUpdate=p,o.shared.pending=null}}while(1);if(d===null&&(l=f),o.baseState=l,o.firstBaseUpdate=c,o.lastBaseUpdate=d,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);Sr|=s,e.lanes=s,e.memoizedState=f}}function rg(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(H(191,o));o.call(r)}}}var og=new _p.Component().refs;function Ru(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:Ee({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var _a={isMounted:function(e){return(e=e._reactInternals)?pr(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Xe(),o=Wn(e),i=vn(r,o);i.payload=t,n!=null&&(i.callback=n),t=$n(e,i,o),t!==null&&(Ft(t,e,o,r),va(t,e,o))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Xe(),o=Wn(e),i=vn(r,o);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=$n(e,i,o),t!==null&&(Ft(t,e,o,r),va(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Xe(),r=Wn(e),o=vn(n,r);o.tag=2,t!=null&&(o.callback=t),t=$n(e,o,r),t!==null&&(Ft(t,e,r,n),va(t,e,r))}};function ig(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?!Ni(n,r)||!Ni(o,i):!0}function sg(e,t,n){var r=!1,o=Un,i=t.contextType;return typeof i=="object"&&i!==null?i=Rt(i):(o=rt(t)?gr:Ve.current,r=t.contextTypes,i=(r=r!=null)?lo(e,o):Un),t=new t(n,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=_a,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=i),t}function ag(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&&_a.enqueueReplaceState(t,t.state,null)}function Nu(e,t,n,r){var o=e.stateNode;o.props=n,o.state=e.memoizedState,o.refs=og,xu(e);var i=t.contextType;typeof i=="object"&&i!==null?o.context=Rt(i):(i=rt(t)?gr:Ve.current,o.context=lo(e,i)),o.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(Ru(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&&_a.enqueueReplaceState(o,o.state,null),ya(e,n,o,r),o.state=e.memoizedState),typeof o.componentDidMount=="function"&&(e.flags|=4194308)}function Ci(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(H(309));var r=n.stateNode}if(!r)throw Error(H(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===og&&(a=o.refs={}),s===null?delete a[i]:a[i]=s},t._stringRef=i,t)}if(typeof e!="string")throw Error(H(284));if(!n._owner)throw Error(H(290,e))}return e}function Sa(e,t){throw e=Object.prototype.toString.call(t),Error(H(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function lg(e){var t=e._init;return t(e._payload)}function cg(e){function t(g,m){if(e){var _=g.deletions;_===null?(g.deletions=[m],g.flags|=16):_.push(m)}}function n(g,m){if(!e)return null;for(;m!==null;)t(g,m),m=m.sibling;return null}function r(g,m){for(g=new Map;m!==null;)m.key!==null?g.set(m.key,m):g.set(m.index,m),m=m.sibling;return g}function o(g,m){return g=Yn(g,m),g.index=0,g.sibling=null,g}function i(g,m,_){return g.index=_,e?(_=g.alternate,_!==null?(_=_.index,_<m?(g.flags|=2,m):_):(g.flags|=2,m)):(g.flags|=1048576,m)}function s(g){return e&&g.alternate===null&&(g.flags|=2),g}function a(g,m,_,S){return m===null||m.tag!==6?(m=ad(_,g.mode,S),m.return=g,m):(m=o(m,_),m.return=g,m)}function l(g,m,_,S){var x=_.type;return x===Qr?d(g,m,_.props.children,S,_.key):m!==null&&(m.elementType===x||typeof x=="object"&&x!==null&&x.$$typeof===An&&lg(x)===m.type)?(S=o(m,_.props),S.ref=Ci(g,m,_),S.return=g,S):(S=Va(_.type,_.key,_.props,null,g.mode,S),S.ref=Ci(g,m,_),S.return=g,S)}function c(g,m,_,S){return m===null||m.tag!==4||m.stateNode.containerInfo!==_.containerInfo||m.stateNode.implementation!==_.implementation?(m=ld(_,g.mode,S),m.return=g,m):(m=o(m,_.children||[]),m.return=g,m)}function d(g,m,_,S,x){return m===null||m.tag!==7?(m=wr(_,g.mode,S,x),m.return=g,m):(m=o(m,_),m.return=g,m)}function f(g,m,_){if(typeof m=="string"&&m!==""||typeof m=="number")return m=ad(""+m,g.mode,_),m.return=g,m;if(typeof m=="object"&&m!==null){switch(m.$$typeof){case js:return _=Va(m.type,m.key,m.props,null,g.mode,_),_.ref=Ci(g,null,m),_.return=g,_;case Kr:return m=ld(m,g.mode,_),m.return=g,m;case An:var S=m._init;return f(g,S(m._payload),_)}if(si(m)||oi(m))return m=wr(m,g.mode,_,null),m.return=g,m;Sa(g,m)}return null}function p(g,m,_,S){var x=m!==null?m.key:null;if(typeof _=="string"&&_!==""||typeof _=="number")return x!==null?null:a(g,m,""+_,S);if(typeof _=="object"&&_!==null){switch(_.$$typeof){case js:return _.key===x?l(g,m,_,S):null;case Kr:return _.key===x?c(g,m,_,S):null;case An:return x=_._init,p(g,m,x(_._payload),S)}if(si(_)||oi(_))return x!==null?null:d(g,m,_,S,null);Sa(g,_)}return null}function h(g,m,_,S,x){if(typeof S=="string"&&S!==""||typeof S=="number")return g=g.get(_)||null,a(m,g,""+S,x);if(typeof S=="object"&&S!==null){switch(S.$$typeof){case js:return g=g.get(S.key===null?_:S.key)||null,l(m,g,S,x);case Kr:return g=g.get(S.key===null?_:S.key)||null,c(m,g,S,x);case An:var R=S._init;return h(g,m,_,R(S._payload),x)}if(si(S)||oi(S))return g=g.get(_)||null,d(m,g,S,x,null);Sa(m,S)}return null}function E(g,m,_,S){for(var x=null,R=null,I=m,L=m=0,U=null;I!==null&&L<_.length;L++){I.index>L?(U=I,I=null):U=I.sibling;var A=p(g,I,_[L],S);if(A===null){I===null&&(I=U);break}e&&I&&A.alternate===null&&t(g,I),m=i(A,m,L),R===null?x=A:R.sibling=A,R=A,I=U}if(L===_.length)return n(g,I),he&&Er(g,L),x;if(I===null){for(;L<_.length;L++)I=f(g,_[L],S),I!==null&&(m=i(I,m,L),R===null?x=I:R.sibling=I,R=I);return he&&Er(g,L),x}for(I=r(g,I);L<_.length;L++)U=h(I,g,L,_[L],S),U!==null&&(e&&U.alternate!==null&&I.delete(U.key===null?L:U.key),m=i(U,m,L),R===null?x=U:R.sibling=U,R=U);return e&&I.forEach(function(b){return t(g,b)}),he&&Er(g,L),x}function v(g,m,_,S){var x=oi(_);if(typeof x!="function")throw Error(H(150));if(_=x.call(_),_==null)throw Error(H(151));for(var R=x=null,I=m,L=m=0,U=null,A=_.next();I!==null&&!A.done;L++,A=_.next()){I.index>L?(U=I,I=null):U=I.sibling;var b=p(g,I,A.value,S);if(b===null){I===null&&(I=U);break}e&&I&&b.alternate===null&&t(g,I),m=i(b,m,L),R===null?x=b:R.sibling=b,R=b,I=U}if(A.done)return n(g,I),he&&Er(g,L),x;if(I===null){for(;!A.done;L++,A=_.next())A=f(g,A.value,S),A!==null&&(m=i(A,m,L),R===null?x=A:R.sibling=A,R=A);return he&&Er(g,L),x}for(I=r(g,I);!A.done;L++,A=_.next())A=h(I,g,L,A.value,S),A!==null&&(e&&A.alternate!==null&&I.delete(A.key===null?L:A.key),m=i(A,m,L),R===null?x=A:R.sibling=A,R=A);return e&&I.forEach(function(V){return t(g,V)}),he&&Er(g,L),x}function y(g,m,_,S){if(typeof _=="object"&&_!==null&&_.type===Qr&&_.key===null&&(_=_.props.children),typeof _=="object"&&_!==null){switch(_.$$typeof){case js:e:{for(var x=_.key,R=m;R!==null;){if(R.key===x){if(x=_.type,x===Qr){if(R.tag===7){n(g,R.sibling),m=o(R,_.props.children),m.return=g,g=m;break e}}else if(R.elementType===x||typeof x=="object"&&x!==null&&x.$$typeof===An&&lg(x)===R.type){n(g,R.sibling),m=o(R,_.props),m.ref=Ci(g,R,_),m.return=g,g=m;break e}n(g,R);break}else t(g,R);R=R.sibling}_.type===Qr?(m=wr(_.props.children,g.mode,S,_.key),m.return=g,g=m):(S=Va(_.type,_.key,_.props,null,g.mode,S),S.ref=Ci(g,m,_),S.return=g,g=S)}return s(g);case Kr:e:{for(R=_.key;m!==null;){if(m.key===R)if(m.tag===4&&m.stateNode.containerInfo===_.containerInfo&&m.stateNode.implementation===_.implementation){n(g,m.sibling),m=o(m,_.children||[]),m.return=g,g=m;break e}else{n(g,m);break}else t(g,m);m=m.sibling}m=ld(_,g.mode,S),m.return=g,g=m}return s(g);case An:return R=_._init,y(g,m,R(_._payload),S)}if(si(_))return E(g,m,_,S);if(oi(_))return v(g,m,_,S);Sa(g,_)}return typeof _=="string"&&_!==""||typeof _=="number"?(_=""+_,m!==null&&m.tag===6?(n(g,m.sibling),m=o(m,_),m.return=g,g=m):(n(g,m),m=ad(_,g.mode,S),m.return=g,g=m),s(g)):n(g,m)}return y}var go=cg(!0),ug=cg(!1),Li={},qt=jn(Li),Di=jn(Li),ki=jn(Li);function yr(e){if(e===Li)throw Error(H(174));return e}function wu(e,t){switch(ce(ki,t),ce(Di,e),ce(qt,Li),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Nc(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Nc(t,e)}de(qt),ce(qt,t)}function mo(){de(qt),de(Di),de(ki)}function dg(e){yr(ki.current);var t=yr(qt.current),n=Nc(t,e.type);t!==n&&(ce(Di,e),ce(qt,n))}function Ou(e){Di.current===e&&(de(qt),de(Di))}var ve=jn(0);function xa(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 Tu=[];function Au(){for(var e=0;e<Tu.length;e++)Tu[e]._workInProgressVersionPrimary=null;Tu.length=0}var Ra=fn.ReactCurrentDispatcher,Iu=fn.ReactCurrentBatchConfig,_r=0,ye=null,be=null,ke=null,Na=!1,Pi=!1,Mi=0,Qx=0;function $e(){throw Error(H(321))}function bu(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!kt(e[n],t[n]))return!1;return!0}function Cu(e,t,n,r,o,i){if(_r=i,ye=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Ra.current=e===null||e.memoizedState===null?Zx:e1,e=n(r,o),Pi){i=0;do{if(Pi=!1,Mi=0,25<=i)throw Error(H(301));i+=1,ke=be=null,t.updateQueue=null,Ra.current=t1,e=n(r,o)}while(Pi)}if(Ra.current=Ta,t=be!==null&&be.next!==null,_r=0,ke=be=ye=null,Na=!1,t)throw Error(H(300));return e}function Lu(){var e=Mi!==0;return Mi=0,e}function Jt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ke===null?ye.memoizedState=ke=e:ke=ke.next=e,ke}function Nt(){if(be===null){var e=ye.alternate;e=e!==null?e.memoizedState:null}else e=be.next;var t=ke===null?ye.memoizedState:ke.next;if(t!==null)ke=t,be=e;else{if(e===null)throw Error(H(310));be=e,e={memoizedState:be.memoizedState,baseState:be.baseState,baseQueue:be.baseQueue,queue:be.queue,next:null},ke===null?ye.memoizedState=ke=e:ke=ke.next=e}return ke}function ji(e,t){return typeof t=="function"?t(e):t}function Du(e){var t=Nt(),n=t.queue;if(n===null)throw Error(H(311));n.lastRenderedReducer=e;var r=be,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,c=i;do{var d=c.lane;if((_r&d)===d)l!==null&&(l=l.next={lane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),r=c.hasEagerState?c.eagerState:e(r,c.action);else{var f={lane:d,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};l===null?(a=l=f,s=r):l=l.next=f,ye.lanes|=d,Sr|=d}c=c.next}while(c!==null&&c!==i);l===null?s=r:l.next=a,kt(r,t.memoizedState)||(ot=!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,ye.lanes|=i,Sr|=i,o=o.next;while(o!==e)}else o===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function ku(e){var t=Nt(),n=t.queue;if(n===null)throw Error(H(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);kt(i,t.memoizedState)||(ot=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function fg(){}function pg(e,t){var n=ye,r=Nt(),o=t(),i=!kt(r.memoizedState,o);if(i&&(r.memoizedState=o,ot=!0),r=r.queue,Pu(mg.bind(null,n,r,e),[e]),r.getSnapshot!==t||i||ke!==null&&ke.memoizedState.tag&1){if(n.flags|=2048,Ui(9,gg.bind(null,n,r,o,t),void 0,null),Pe===null)throw Error(H(349));_r&30||hg(n,t,o)}return o}function hg(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=ye.updateQueue,t===null?(t={lastEffect:null,stores:null},ye.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function gg(e,t,n,r){t.value=n,t.getSnapshot=r,Eg(t)&&vg(e)}function mg(e,t,n){return n(function(){Eg(t)&&vg(e)})}function Eg(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!kt(e,n)}catch{return!0}}function vg(e){var t=En(e,1);t!==null&&Ft(t,e,1,-1)}function yg(e){var t=Jt();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:ji,lastRenderedState:e},t.queue=e,e=e.dispatch=Jx.bind(null,ye,e),[t.memoizedState,e]}function Ui(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=ye.updateQueue,t===null?(t={lastEffect:null,stores:null},ye.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 _g(){return Nt().memoizedState}function wa(e,t,n,r){var o=Jt();ye.flags|=e,o.memoizedState=Ui(1|t,n,void 0,r===void 0?null:r)}function Oa(e,t,n,r){var o=Nt();r=r===void 0?null:r;var i=void 0;if(be!==null){var s=be.memoizedState;if(i=s.destroy,r!==null&&bu(r,s.deps)){o.memoizedState=Ui(t,n,i,r);return}}ye.flags|=e,o.memoizedState=Ui(1|t,n,i,r)}function Sg(e,t){return wa(8390656,8,e,t)}function Pu(e,t){return Oa(2048,8,e,t)}function xg(e,t){return Oa(4,2,e,t)}function Rg(e,t){return Oa(4,4,e,t)}function Ng(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 wg(e,t,n){return n=n!=null?n.concat([e]):null,Oa(4,4,Ng.bind(null,t,e),n)}function Mu(){}function Og(e,t){var n=Nt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&bu(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Tg(e,t){var n=Nt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&bu(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Ag(e,t,n){return _r&21?(kt(n,t)||(n=eh(),ye.lanes|=n,Sr|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,ot=!0),e.memoizedState=n)}function Xx(e,t){var n=se;se=n!==0&&4>n?n:4,e(!0);var r=Iu.transition;Iu.transition={};try{e(!1),t()}finally{se=n,Iu.transition=r}}function Ig(){return Nt().memoizedState}function qx(e,t,n){var r=Wn(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},bg(e))Cg(t,n);else if(n=eg(e,t,n,r),n!==null){var o=Xe();Ft(n,e,r,o),Lg(n,t,r)}}function Jx(e,t,n){var r=Wn(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(bg(e))Cg(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,kt(a,s)){var l=t.interleaved;l===null?(o.next=o,Su(t)):(o.next=l.next,l.next=o),t.interleaved=o;return}}catch{}finally{}n=eg(e,t,o,r),n!==null&&(o=Xe(),Ft(n,e,r,o),Lg(n,t,r))}}function bg(e){var t=e.alternate;return e===ye||t!==null&&t===ye}function Cg(e,t){Pi=Na=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Lg(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Mc(e,n)}}var Ta={readContext:Rt,useCallback:$e,useContext:$e,useEffect:$e,useImperativeHandle:$e,useInsertionEffect:$e,useLayoutEffect:$e,useMemo:$e,useReducer:$e,useRef:$e,useState:$e,useDebugValue:$e,useDeferredValue:$e,useTransition:$e,useMutableSource:$e,useSyncExternalStore:$e,useId:$e,unstable_isNewReconciler:!1},Zx={readContext:Rt,useCallback:function(e,t){return Jt().memoizedState=[e,t===void 0?null:t],e},useContext:Rt,useEffect:Sg,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,wa(4194308,4,Ng.bind(null,t,e),n)},useLayoutEffect:function(e,t){return wa(4194308,4,e,t)},useInsertionEffect:function(e,t){return wa(4,2,e,t)},useMemo:function(e,t){var n=Jt();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Jt();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=qx.bind(null,ye,e),[r.memoizedState,e]},useRef:function(e){var t=Jt();return e={current:e},t.memoizedState=e},useState:yg,useDebugValue:Mu,useDeferredValue:function(e){return Jt().memoizedState=e},useTransition:function(){var e=yg(!1),t=e[0];return e=Xx.bind(null,e[1]),Jt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=ye,o=Jt();if(he){if(n===void 0)throw Error(H(407));n=n()}else{if(n=t(),Pe===null)throw Error(H(349));_r&30||hg(r,t,n)}o.memoizedState=n;var i={value:n,getSnapshot:t};return o.queue=i,Sg(mg.bind(null,r,i,e),[e]),r.flags|=2048,Ui(9,gg.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=Jt(),t=Pe.identifierPrefix;if(he){var n=mn,r=gn;n=(r&~(1<<32-Dt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Mi++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=Qx++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},e1={readContext:Rt,useCallback:Og,useContext:Rt,useEffect:Pu,useImperativeHandle:wg,useInsertionEffect:xg,useLayoutEffect:Rg,useMemo:Tg,useReducer:Du,useRef:_g,useState:function(){return Du(ji)},useDebugValue:Mu,useDeferredValue:function(e){var t=Nt();return Ag(t,be.memoizedState,e)},useTransition:function(){var e=Du(ji)[0],t=Nt().memoizedState;return[e,t]},useMutableSource:fg,useSyncExternalStore:pg,useId:Ig,unstable_isNewReconciler:!1},t1={readContext:Rt,useCallback:Og,useContext:Rt,useEffect:Pu,useImperativeHandle:wg,useInsertionEffect:xg,useLayoutEffect:Rg,useMemo:Tg,useReducer:ku,useRef:_g,useState:function(){return ku(ji)},useDebugValue:Mu,useDeferredValue:function(e){var t=Nt();return be===null?t.memoizedState=e:Ag(t,be.memoizedState,e)},useTransition:function(){var e=ku(ji)[0],t=Nt().memoizedState;return[e,t]},useMutableSource:fg,useSyncExternalStore:pg,useId:Ig,unstable_isNewReconciler:!1};function Eo(e,t){try{var n="",r=t;do n+=IS(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 Pu(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Mu(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var r1=typeof WeakMap=="function"?WeakMap:Map;function Dg(e,t,n){n=En(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){La||(La=!0,qu=r),Mu(e,t)},n}function kg(e,t,n){n=En(-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(){Mu(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){Mu(e,t),typeof r!="function"&&(Hn===null?Hn=new Set([this]):Hn.add(this));var s=t.stack;this.componentDidCatch(t.value,{componentStack:s!==null?s:""})}),n}function Pg(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new r1;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=v1.bind(null,e,t,n),t.then(e,e))}function Mg(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 jg(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=En(-1,1),t.tag=2,$n(n,t,1))),n.lanes|=1),e)}var o1=fn.ReactCurrentOwner,rt=!1;function Ke(e,t,n,r){t.child=e===null?ug(t,null,n,r):go(t,e.child,n,r)}function Ug(e,t,n,r,o){n=n.render;var i=t.ref;return ho(t,o),r=Iu(e,t,n,r,i,o),n=bu(),e!==null&&!rt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,yn(e,t,o)):(he&&n&&uu(t),t.flags|=1,Ke(e,t,r,o),t.child)}function Fg(e,t,n,r,o){if(e===null){var i=n.type;return typeof i=="function"&&!od(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,Vg(e,t,i,r,o)):(e=Ua(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:Ni,n(s,r)&&e.ref===t.ref)return yn(e,t,o)}return t.flags|=1,e=Yn(i,r),e.ref=t.ref,e.return=t,t.child=e}function Vg(e,t,n,r,o){if(e!==null){var i=e.memoizedProps;if(Ni(i,r)&&e.ref===t.ref)if(rt=!1,t.pendingProps=r=i,(e.lanes&o)!==0)e.flags&131072&&(rt=!0);else return t.lanes=e.lanes,yn(e,t,o)}return ju(e,t,n,r,o)}function $g(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},ce(yo,ht),ht|=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,ce(yo,ht),ht|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,ce(yo,ht),ht|=r}else i!==null?(r=i.baseLanes|n,t.memoizedState=null):r=n,ce(yo,ht),ht|=r;return Ke(e,t,o,n),t.child}function Bg(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function ju(e,t,n,r,o){var i=nt(n)?gr:Fe.current;return i=lo(t,i),ho(t,o),n=Iu(e,t,n,r,i,o),r=bu(),e!==null&&!rt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,yn(e,t,o)):(he&&r&&uu(t),t.flags|=1,Ke(e,t,n,o),t.child)}function Hg(e,t,n,r,o){if(nt(n)){var i=!0;ca(t)}else i=!1;if(ho(t,o),t.stateNode===null)Ta(e,t),sg(t,n,r),xu(t,n,r,o),r=!0;else if(e===null){var s=t.stateNode,a=t.memoizedProps;s.props=a;var l=s.context,c=n.contextType;typeof c=="object"&&c!==null?c=St(c):(c=nt(n)?gr:Fe.current,c=lo(t,c));var d=n.getDerivedStateFromProps,f=typeof d=="function"||typeof s.getSnapshotBeforeUpdate=="function";f||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==r||l!==c)&&ag(t,s,r,c),Vn=!1;var p=t.memoizedState;s.state=p,va(t,r,s,o),l=t.memoizedState,a!==r||p!==l||tt.current||Vn?(typeof d=="function"&&(Su(t,n,d,r),l=t.memoizedState),(a=Vn||ig(t,n,a,r,p,l,c))?(f||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=c,r=a):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{s=t.stateNode,tg(e,t),a=t.memoizedProps,c=t.type===t.elementType?a:Pt(t.type,a),s.props=c,f=t.pendingProps,p=s.context,l=n.contextType,typeof l=="object"&&l!==null?l=St(l):(l=nt(n)?gr:Fe.current,l=lo(t,l));var h=n.getDerivedStateFromProps;(d=typeof h=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==f||p!==l)&&ag(t,s,r,l),Vn=!1,p=t.memoizedState,s.state=p,va(t,r,s,o);var v=t.memoizedState;a!==f||p!==v||tt.current||Vn?(typeof h=="function"&&(Su(t,n,h,r),v=t.memoizedState),(c=Vn||ig(t,n,c,r,p,v,l)||!1)?(d||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(r,v,l),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(r,v,l)),typeof s.componentDidUpdate=="function"&&(t.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof s.componentDidUpdate!="function"||a===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=v),s.props=r,s.state=v,s.context=l,r=c):(typeof s.componentDidUpdate!="function"||a===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),r=!1)}return Uu(e,t,n,r,i,o)}function Uu(e,t,n,r,o,i){Bg(e,t);var s=(t.flags&128)!==0;if(!r&&!s)return o&&Yh(t,n,!1),yn(e,t,i);r=t.stateNode,o1.current=t;var a=s&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&s?(t.child=go(t,e.child,null,i),t.child=go(t,null,a,i)):Ke(e,t,a,i),t.memoizedState=r.state,o&&Yh(t,n,!0),t.child}function zg(e){var t=e.stateNode;t.pendingContext?Wh(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Wh(e,t.context,!1),Ru(e,t.containerInfo)}function Wg(e,t,n,r,o){return fo(),hu(o),t.flags|=256,Ke(e,t,n,r),t.child}var Fu={dehydrated:null,treeContext:null,retryLane:0};function Vu(e){return{baseLanes:e,cachePool:null,transitions:null}}function Gg(e,t,n){var r=t.pendingProps,o=ve.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),ce(ve,o&1),e===null)return pu(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=Fa(s,r,0,null),e=wr(e,r,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=Vu(n),t.memoizedState=Fu,e):$u(t,s));if(o=e.memoizedState,o!==null&&(a=o.dehydrated,a!==null))return i1(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=Yn(o,l),r.subtreeFlags=o.subtreeFlags&14680064),a!==null?i=Yn(a,i):(i=wr(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?Vu(n):{baseLanes:s.baseLanes|n,cachePool:null,transitions:s.transitions},i.memoizedState=s,i.childLanes=e.childLanes&~n,t.memoizedState=Fu,r}return i=e.child,e=i.sibling,r=Yn(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 $u(e,t){return t=Fa({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Oa(e,t,n,r){return r!==null&&hu(r),go(t,e.child,null,n),e=$u(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function i1(e,t,n,r,o,i,s){if(n)return t.flags&256?(t.flags&=-257,r=Pu(Error(H(422))),Oa(e,t,s,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=r.fallback,o=t.mode,r=Fa({mode:"visible",children:r.children},o,0,null),i=wr(i,o,s,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,t.mode&1&&go(t,e.child,null,s),t.child.memoizedState=Vu(s),t.memoizedState=Fu,i);if(!(t.mode&1))return Oa(e,t,s,null);if(o.data==="$!"){if(r=o.nextSibling&&o.nextSibling.dataset,r)var a=r.dgst;return r=a,i=Error(H(419)),r=Pu(i,r,void 0),Oa(e,t,s,r)}if(a=(s&e.childLanes)!==0,rt||a){if(r=ke,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,vn(e,o),Ut(r,e,o,-1))}return rd(),r=Pu(Error(H(421))),Oa(e,t,s,r)}return o.data==="$?"?(t.flags|=128,t.child=e.child,t=E1.bind(null,e),o._reactRetry=t,null):(e=i.treeContext,pt=Mn(o.nextSibling),ft=t,he=!0,kt=null,e!==null&&(yt[_t++]=gn,yt[_t++]=mn,yt[_t++]=mr,gn=e.id,mn=e.overflow,mr=t),t=$u(t,r.children),t.flags|=4096,t)}function Yg(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Eu(e.return,t,n)}function Bu(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 Kg(e,t,n){var r=t.pendingProps,o=r.revealOrder,i=r.tail;if(Ke(e,t,r.children,n),r=ve.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&&Yg(e,n,t);else if(e.tag===19)Yg(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(ce(ve,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&&_a(e)===null&&(o=n),n=n.sibling;n=o,n===null?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),Bu(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&&_a(e)===null){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}Bu(t,!0,n,null,i);break;case"together":Bu(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Ta(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function yn(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Sr|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(H(153));if(t.child!==null){for(e=t.child,n=Yn(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Yn(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function s1(e,t,n){switch(t.tag){case 3:zg(t),fo();break;case 5:dg(t);break;case 1:nt(t.type)&&ca(t);break;case 4:Ru(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,o=t.memoizedProps.value;ce(ha,r._currentValue),r._currentValue=o;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(ce(ve,ve.current&1),t.flags|=128,null):n&t.child.childLanes?Gg(e,t,n):(ce(ve,ve.current&1),e=yn(e,t,n),e!==null?e.sibling:null);ce(ve,ve.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return Kg(e,t,n);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),ce(ve,ve.current),r)break;return null;case 22:case 23:return t.lanes=0,$g(e,t,n)}return yn(e,t,n)}var Qg,Hu,Xg,qg;Qg=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}},Hu=function(){},Xg=function(e,t,n,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,yr(qt.current);var i=null;switch(n){case"input":o=Ec(e,o),r=Ec(e,r),i=[];break;case"select":o=me({},o,{value:void 0}),r=me({},r,{value:void 0}),i=[];break;case"textarea":o=Sc(e,o),r=Sc(e,r),i=[];break;default:typeof o.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=sa)}Rc(n,r);var s;n=null;for(c in o)if(!r.hasOwnProperty(c)&&o.hasOwnProperty(c)&&o[c]!=null)if(c==="style"){var a=o[c];for(s in a)a.hasOwnProperty(s)&&(n||(n={}),n[s]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(ri.hasOwnProperty(c)?i||(i=[]):(i=i||[]).push(c,null));for(c in r){var l=r[c];if(a=o!=null?o[c]:void 0,r.hasOwnProperty(c)&&l!==a&&(l!=null||a!=null))if(c==="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(c,n)),n=l;else c==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,a=a?a.__html:void 0,l!=null&&a!==l&&(i=i||[]).push(c,l)):c==="children"?typeof l!="string"&&typeof l!="number"||(i=i||[]).push(c,""+l):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(ri.hasOwnProperty(c)?(l!=null&&c==="onScroll"&&ue("scroll",e),i||a===l||(i=[])):(i=i||[]).push(c,l))}n&&(i=i||[]).push("style",n);var c=i;(t.updateQueue=c)&&(t.flags|=4)}},qg=function(e,t,n,r){n!==r&&(t.flags|=4)};function Fi(e,t){if(!he)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 $e(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 a1(e,t,n){var r=t.pendingProps;switch(du(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return $e(t),null;case 1:return nt(t.type)&&la(),$e(t),null;case 3:return r=t.stateNode,mo(),de(tt),de(Fe),Ou(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(pa(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,kt!==null&&(ed(kt),kt=null))),Hu(e,t),$e(t),null;case 5:Nu(t);var o=yr(ki.current);if(n=t.type,e!==null&&t.stateNode!=null)Xg(e,t,n,r,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(H(166));return $e(t),null}if(e=yr(qt.current),pa(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[Xt]=t,r[Ii]=i,e=(t.mode&1)!==0,n){case"dialog":ue("cancel",r),ue("close",r);break;case"iframe":case"object":case"embed":ue("load",r);break;case"video":case"audio":for(o=0;o<Oi.length;o++)ue(Oi[o],r);break;case"source":ue("error",r);break;case"img":case"image":case"link":ue("error",r),ue("load",r);break;case"details":ue("toggle",r);break;case"input":bp(r,i),ue("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},ue("invalid",r);break;case"textarea":Dp(r,i),ue("invalid",r)}Rc(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&&ia(r.textContent,a,e),o=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(i.suppressHydrationWarning!==!0&&ia(r.textContent,a,e),o=["children",""+a]):ri.hasOwnProperty(s)&&a!=null&&s==="onScroll"&&ue("scroll",r)}switch(n){case"input":Ms(r),Lp(r,i,!0);break;case"textarea":Ms(r),Pp(r);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(r.onclick=sa)}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=Mp(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[Xt]=t,e[Ii]=r,Qg(e,t,!1,!1),t.stateNode=e;e:{switch(s=Nc(n,r),n){case"dialog":ue("cancel",e),ue("close",e),o=r;break;case"iframe":case"object":case"embed":ue("load",e),o=r;break;case"video":case"audio":for(o=0;o<Oi.length;o++)ue(Oi[o],e);o=r;break;case"source":ue("error",e),o=r;break;case"img":case"image":case"link":ue("error",e),ue("load",e),o=r;break;case"details":ue("toggle",e),o=r;break;case"input":bp(e,r),o=Ec(e,r),ue("invalid",e);break;case"option":o=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},o=me({},r,{value:void 0}),ue("invalid",e);break;case"textarea":Dp(e,r),o=Sc(e,r),ue("invalid",e);break;default:o=r}Rc(n,o),a=o;for(i in a)if(a.hasOwnProperty(i)){var l=a[i];i==="style"?Fp(e,l):i==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&jp(e,l)):i==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&ai(e,l):typeof l=="number"&&ai(e,""+l):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(ri.hasOwnProperty(i)?l!=null&&i==="onScroll"&&ue("scroll",e):l!=null&&ac(e,i,l,s))}switch(n){case"input":Ms(e),Lp(e,r,!1);break;case"textarea":Ms(e),Pp(e);break;case"option":r.value!=null&&e.setAttribute("value",""+In(r.value));break;case"select":e.multiple=!!r.multiple,i=r.value,i!=null?Xr(e,!!r.multiple,i,!1):r.defaultValue!=null&&Xr(e,!!r.multiple,r.defaultValue,!0);break;default:typeof o.onClick=="function"&&(e.onclick=sa)}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 $e(t),null;case 6:if(e&&t.stateNode!=null)qg(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(H(166));if(n=yr(ki.current),yr(qt.current),pa(t)){if(r=t.stateNode,n=t.memoizedProps,r[Xt]=t,(i=r.nodeValue!==n)&&(e=ft,e!==null))switch(e.tag){case 3:ia(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&ia(r.nodeValue,n,(e.mode&1)!==0)}i&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Xt]=t,t.stateNode=r}return $e(t),null;case 13:if(de(ve),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(he&&pt!==null&&t.mode&1&&!(t.flags&128))Zh(),fo(),t.flags|=98560,i=!1;else if(i=pa(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(H(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(H(317));i[Xt]=t}else fo(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;$e(t),i=!1}else kt!==null&&(ed(kt),kt=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||ve.current&1?be===0&&(be=3):rd())),t.updateQueue!==null&&(t.flags|=4),$e(t),null);case 4:return mo(),Hu(e,t),e===null&&Ti(t.stateNode.containerInfo),$e(t),null;case 10:return vu(t.type._context),$e(t),null;case 17:return nt(t.type)&&la(),$e(t),null;case 19:if(de(ve),i=t.memoizedState,i===null)return $e(t),null;if(r=(t.flags&128)!==0,s=i.rendering,s===null)if(r)Fi(i,!1);else{if(be!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(s=_a(e),s!==null){for(t.flags|=128,Fi(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 ce(ve,ve.current&1|2),t.child}e=e.sibling}i.tail!==null&&xe()>_o&&(t.flags|=128,r=!0,Fi(i,!1),t.lanes=4194304)}else{if(!r)if(e=_a(s),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Fi(i,!0),i.tail===null&&i.tailMode==="hidden"&&!s.alternate&&!he)return $e(t),null}else 2*xe()-i.renderingStartTime>_o&&n!==1073741824&&(t.flags|=128,r=!0,Fi(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=xe(),t.sibling=null,n=ve.current,ce(ve,r?n&1|2:n&1),t):($e(t),null);case 22:case 23:return nd(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?ht&1073741824&&($e(t),t.subtreeFlags&6&&(t.flags|=8192)):$e(t),null;case 24:return null;case 25:return null}throw Error(H(156,t.tag))}function l1(e,t){switch(du(t),t.tag){case 1:return nt(t.type)&&la(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return mo(),de(tt),de(Fe),Ou(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Nu(t),null;case 13:if(de(ve),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(H(340));fo()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return de(ve),null;case 4:return mo(),null;case 10:return vu(t.type._context),null;case 22:case 23:return nd(),null;case 24:return null;default:return null}}var Aa=!1,Be=!1,c1=typeof WeakSet=="function"?WeakSet:Set,G=null;function Eo(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){_e(e,t,r)}else n.current=null}function zu(e,t,n){try{n()}catch(r){_e(e,t,r)}}var Jg=!1;function u1(e,t){if(nu=Ks,e=Ih(),Kc(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,c=0,d=0,f=e,p=null;t:for(;;){for(var h;f!==n||o!==0&&f.nodeType!==3||(a=s+o),f!==i||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(h=f.firstChild)!==null;)p=f,f=h;for(;;){if(f===e)break t;if(p===n&&++c===o&&(a=s),p===i&&++d===r&&(l=s),(h=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=h}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(ru={focusedElem:e,selectionRange:n},Ks=!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 v=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(v!==null){var E=v.memoizedProps,y=v.memoizedState,g=t.stateNode,m=g.getSnapshotBeforeUpdate(t.elementType===t.type?E:Pt(t.type,E),y);g.__reactInternalSnapshotBeforeUpdate=m}break;case 3:var _=t.stateNode.containerInfo;_.nodeType===1?_.textContent="":_.nodeType===9&&_.documentElement&&_.removeChild(_.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(H(163))}}catch(S){_e(t,t.return,S)}if(e=t.sibling,e!==null){e.return=t.return,G=e;break}G=t.return}return v=Jg,Jg=!1,v}function Vi(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&&zu(t,n,i)}o=o.next}while(o!==r)}}function Ia(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 Wu(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 Zg(e){var t=e.alternate;t!==null&&(e.alternate=null,Zg(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Xt],delete t[Ii],delete t[au],delete t[Gx],delete t[Yx])),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 em(e){return e.tag===5||e.tag===3||e.tag===4}function tm(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||em(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 Gu(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=sa));else if(r!==4&&(e=e.child,e!==null))for(Gu(e,t,n),e=e.sibling;e!==null;)Gu(e,t,n),e=e.sibling}function Yu(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(Yu(e,t,n),e=e.sibling;e!==null;)Yu(e,t,n),e=e.sibling}var Me=null,Mt=!1;function Bn(e,t,n){for(n=n.child;n!==null;)nm(e,t,n),n=n.sibling}function nm(e,t,n){if(Qt&&typeof Qt.onCommitFiberUnmount=="function")try{Qt.onCommitFiberUnmount(Bs,n)}catch{}switch(n.tag){case 5:Be||Eo(n,t);case 6:var r=Me,o=Mt;Me=null,Bn(e,t,n),Me=r,Mt=o,Me!==null&&(Mt?(e=Me,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Me.removeChild(n.stateNode));break;case 18:Me!==null&&(Mt?(e=Me,n=n.stateNode,e.nodeType===8?su(e.parentNode,n):e.nodeType===1&&su(e,n),Ei(e)):su(Me,n.stateNode));break;case 4:r=Me,o=Mt,Me=n.stateNode.containerInfo,Mt=!0,Bn(e,t,n),Me=r,Mt=o;break;case 0:case 11:case 14:case 15:if(!Be&&(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)&&zu(n,t,s),o=o.next}while(o!==r)}Bn(e,t,n);break;case 1:if(!Be&&(Eo(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){_e(n,t,a)}Bn(e,t,n);break;case 21:Bn(e,t,n);break;case 22:n.mode&1?(Be=(r=Be)||n.memoizedState!==null,Bn(e,t,n),Be=r):Bn(e,t,n);break;default:Bn(e,t,n)}}function rm(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new c1),t.forEach(function(r){var o=y1.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function jt(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:Me=a.stateNode,Mt=!1;break e;case 3:Me=a.stateNode.containerInfo,Mt=!0;break e;case 4:Me=a.stateNode.containerInfo,Mt=!0;break e}a=a.return}if(Me===null)throw Error(H(160));nm(i,s,o),Me=null,Mt=!1;var l=o.alternate;l!==null&&(l.return=null),o.return=null}catch(c){_e(o,t,c)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)om(t,e),t=t.sibling}function om(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(jt(t,e),Zt(e),r&4){try{Vi(3,e,e.return),Ia(3,e)}catch(E){_e(e,e.return,E)}try{Vi(5,e,e.return)}catch(E){_e(e,e.return,E)}}break;case 1:jt(t,e),Zt(e),r&512&&n!==null&&Eo(n,n.return);break;case 5:if(jt(t,e),Zt(e),r&512&&n!==null&&Eo(n,n.return),e.flags&32){var o=e.stateNode;try{ai(o,"")}catch(E){_e(e,e.return,E)}}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&&Cp(o,i),Nc(a,s);var c=Nc(a,i);for(s=0;s<l.length;s+=2){var d=l[s],f=l[s+1];d==="style"?Fp(o,f):d==="dangerouslySetInnerHTML"?jp(o,f):d==="children"?ai(o,f):ac(o,d,f,c)}switch(a){case"input":yc(o,i);break;case"textarea":kp(o,i);break;case"select":var p=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!i.multiple;var h=i.value;h!=null?Xr(o,!!i.multiple,h,!1):p!==!!i.multiple&&(i.defaultValue!=null?Xr(o,!!i.multiple,i.defaultValue,!0):Xr(o,!!i.multiple,i.multiple?[]:"",!1))}o[Ii]=i}catch(E){_e(e,e.return,E)}}break;case 6:if(jt(t,e),Zt(e),r&4){if(e.stateNode===null)throw Error(H(162));o=e.stateNode,i=e.memoizedProps;try{o.nodeValue=i}catch(E){_e(e,e.return,E)}}break;case 3:if(jt(t,e),Zt(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Ei(t.containerInfo)}catch(E){_e(e,e.return,E)}break;case 4:jt(t,e),Zt(e);break;case 13:jt(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||(Xu=xe())),r&4&&rm(e);break;case 22:if(d=n!==null&&n.memoizedState!==null,e.mode&1?(Be=(c=Be)||d,jt(t,e),Be=c):jt(t,e),Zt(e),r&8192){if(c=e.memoizedState!==null,(e.stateNode.isHidden=c)&&!d&&e.mode&1)for(G=e,d=e.child;d!==null;){for(f=G=d;G!==null;){switch(p=G,h=p.child,p.tag){case 0:case 11:case 14:case 15:Vi(4,p,p.return);break;case 1:Eo(p,p.return);var v=p.stateNode;if(typeof v.componentWillUnmount=="function"){r=p,n=p.return;try{t=r,v.props=t.memoizedProps,v.state=t.memoizedState,v.componentWillUnmount()}catch(E){_e(r,n,E)}}break;case 5:Eo(p,p.return);break;case 22:if(p.memoizedState!==null){am(f);continue}}h!==null?(h.return=p,G=h):am(f)}d=d.sibling}e:for(d=null,f=e;;){if(f.tag===5){if(d===null){d=f;try{o=f.stateNode,c?(i=o.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(a=f.stateNode,l=f.memoizedProps.style,s=l!=null&&l.hasOwnProperty("display")?l.display:null,a.style.display=Up("display",s))}catch(E){_e(e,e.return,E)}}}else if(f.tag===6){if(d===null)try{f.stateNode.nodeValue=c?"":f.memoizedProps}catch(E){_e(e,e.return,E)}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===e)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===e)break e;for(;f.sibling===null;){if(f.return===null||f.return===e)break e;d===f&&(d=null),f=f.return}d===f&&(d=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:jt(t,e),Zt(e),r&4&&rm(e);break;case 21:break;default:jt(t,e),Zt(e)}}function Zt(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(em(n)){var r=n;break e}n=n.return}throw Error(H(160))}switch(r.tag){case 5:var o=r.stateNode;r.flags&32&&(ai(o,""),r.flags&=-33);var i=tm(e);Yu(e,i,o);break;case 3:case 4:var s=r.stateNode.containerInfo,a=tm(e);Gu(e,a,s);break;default:throw Error(H(161))}}catch(l){_e(e,e.return,l)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function d1(e,t,n){G=e,im(e)}function im(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||Aa;if(!s){var a=o.alternate,l=a!==null&&a.memoizedState!==null||Be;a=Aa;var c=Be;if(Aa=s,(Be=l)&&!c)for(G=o;G!==null;)s=G,l=s.child,s.tag===22&&s.memoizedState!==null?lm(o):l!==null?(l.return=s,G=l):lm(o);for(;i!==null;)G=i,im(i),i=i.sibling;G=o,Aa=a,Be=c}sm(e)}else o.subtreeFlags&8772&&i!==null?(i.return=o,G=i):sm(e)}}function sm(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:Be||Ia(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Be)if(n===null)r.componentDidMount();else{var o=t.elementType===t.type?n.memoizedProps:Pt(t.type,n.memoizedProps);r.componentDidUpdate(o,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&rg(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}rg(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 c=t.alternate;if(c!==null){var d=c.memoizedState;if(d!==null){var f=d.dehydrated;f!==null&&Ei(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(H(163))}Be||t.flags&512&&Wu(t)}catch(p){_e(t,t.return,p)}}if(t===e){G=null;break}if(n=t.sibling,n!==null){n.return=t.return,G=n;break}G=t.return}}function am(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 lm(e){for(;G!==null;){var t=G;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Ia(4,t)}catch(l){_e(t,n,l)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var o=t.return;try{r.componentDidMount()}catch(l){_e(t,o,l)}}var i=t.return;try{Wu(t)}catch(l){_e(t,i,l)}break;case 5:var s=t.return;try{Wu(t)}catch(l){_e(t,s,l)}}}catch(l){_e(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 f1=Math.ceil,ba=fn.ReactCurrentDispatcher,Ku=fn.ReactCurrentOwner,Rt=fn.ReactCurrentBatchConfig,ne=0,ke=null,we=null,je=0,ht=0,yo=jn(0),be=0,$i=null,Sr=0,Ca=0,Qu=0,Bi=null,ot=null,Xu=0,_o=1/0,_n=null,La=!1,qu=null,Hn=null,Da=!1,zn=null,ka=0,Hi=0,Ju=null,Pa=-1,Ma=0;function Qe(){return ne&6?xe():Pa!==-1?Pa:Pa=xe()}function Wn(e){return e.mode&1?ne&2&&je!==0?je&-je:Qx.transition!==null?(Ma===0&&(Ma=eh()),Ma):(e=se,e!==0||(e=window.event,e=e===void 0?16:ch(e.type)),e):1}function Ut(e,t,n,r){if(50<Hi)throw Hi=0,Ju=null,Error(H(185));pi(e,n,r),(!(ne&2)||e!==ke)&&(e===ke&&(!(ne&2)&&(Ca|=n),be===4&&Gn(e,je)),it(e,r),n===1&&ne===0&&!(t.mode&1)&&(_o=xe()+500,ua&&Fn()))}function it(e,t){var n=e.callbackNode;QS(e,t);var r=Ws(e,e===ke?je:0);if(r===0)n!==null&&qp(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&qp(n),t===1)e.tag===0?Kx(um.bind(null,e)):Kh(um.bind(null,e)),zx(function(){!(ne&6)&&Fn()}),n=null;else{switch(th(r)){case 1:n=Cc;break;case 4:n=Jp;break;case 16:n=$s;break;case 536870912:n=Zp;break;default:n=$s}n=Em(n,cm.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function cm(e,t){if(Pa=-1,Ma=0,ne&6)throw Error(H(327));var n=e.callbackNode;if(So()&&e.callbackNode!==n)return null;var r=Ws(e,e===ke?je:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=ja(e,r);else{t=r;var o=ne;ne|=2;var i=fm();(ke!==e||je!==t)&&(_n=null,_o=xe()+500,Rr(e,t));do try{g1();break}catch(a){dm(e,a)}while(1);mu(),ba.current=i,ne=o,we!==null?t=0:(ke=null,je=0,t=be)}if(t!==0){if(t===2&&(o=Lc(e),o!==0&&(r=o,t=Zu(e,o))),t===1)throw n=$i,Rr(e,0),Gn(e,r),it(e,xe()),n;if(t===6)Gn(e,r);else{if(o=e.current.alternate,!(r&30)&&!p1(o)&&(t=ja(e,r),t===2&&(i=Lc(e),i!==0&&(r=i,t=Zu(e,i))),t===1))throw n=$i,Rr(e,0),Gn(e,r),it(e,xe()),n;switch(e.finishedWork=o,e.finishedLanes=r,t){case 0:case 1:throw Error(H(345));case 2:Nr(e,ot,_n);break;case 3:if(Gn(e,r),(r&130023424)===r&&(t=Xu+500-xe(),10<t)){if(Ws(e,0)!==0)break;if(o=e.suspendedLanes,(o&r)!==r){Qe(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=iu(Nr.bind(null,e,ot,_n),t);break}Nr(e,ot,_n);break;case 4:if(Gn(e,r),(r&4194240)===r)break;for(t=e.eventTimes,o=-1;0<r;){var s=31-Lt(r);i=1<<s,s=t[s],s>o&&(o=s),r&=~i}if(r=o,r=xe()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*f1(r/1960))-r,10<r){e.timeoutHandle=iu(Nr.bind(null,e,ot,_n),r);break}Nr(e,ot,_n);break;case 5:Nr(e,ot,_n);break;default:throw Error(H(329))}}}return it(e,xe()),e.callbackNode===n?cm.bind(null,e):null}function Zu(e,t){var n=Bi;return e.current.memoizedState.isDehydrated&&(Rr(e,t).flags|=256),e=ja(e,t),e!==2&&(t=ot,ot=n,t!==null&&ed(t)),e}function ed(e){ot===null?ot=e:ot.push.apply(ot,e)}function p1(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(!Dt(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 Gn(e,t){for(t&=~Qu,t&=~Ca,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Lt(t),r=1<<n;e[n]=-1,t&=~r}}function um(e){if(ne&6)throw Error(H(327));So();var t=Ws(e,0);if(!(t&1))return it(e,xe()),null;var n=ja(e,t);if(e.tag!==0&&n===2){var r=Lc(e);r!==0&&(t=r,n=Zu(e,r))}if(n===1)throw n=$i,Rr(e,0),Gn(e,t),it(e,xe()),n;if(n===6)throw Error(H(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Nr(e,ot,_n),it(e,xe()),null}function td(e,t){var n=ne;ne|=1;try{return e(t)}finally{ne=n,ne===0&&(_o=xe()+500,ua&&Fn())}}function xr(e){zn!==null&&zn.tag===0&&!(ne&6)&&So();var t=ne;ne|=1;var n=Rt.transition,r=se;try{if(Rt.transition=null,se=1,e)return e()}finally{se=r,Rt.transition=n,ne=t,!(ne&6)&&Fn()}}function nd(){ht=yo.current,de(yo)}function Rr(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,Hx(n)),we!==null)for(n=we.return;n!==null;){var r=n;switch(du(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&la();break;case 3:mo(),de(tt),de(Fe),Ou();break;case 5:Nu(r);break;case 4:mo();break;case 13:de(ve);break;case 19:de(ve);break;case 10:vu(r.type._context);break;case 22:case 23:nd()}n=n.return}if(ke=e,we=e=Yn(e.current,null),je=ht=t,be=0,$i=null,Qu=Ca=Sr=0,ot=Bi=null,Er!==null){for(t=0;t<Er.length;t++)if(n=Er[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}Er=null}return e}function dm(e,t){do{var n=we;try{if(mu(),Sa.current=wa,xa){for(var r=Ee.memoizedState;r!==null;){var o=r.queue;o!==null&&(o.pending=null),r=r.next}xa=!1}if(_r=0,De=Ie=Ee=null,Pi=!1,Mi=0,Ku.current=null,n===null||n.return===null){be=1,$i=t,we=null;break}e:{var i=e,s=n.return,a=n,l=t;if(t=je,a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var c=l,d=a,f=d.tag;if(!(d.mode&1)&&(f===0||f===11||f===15)){var p=d.alternate;p?(d.updateQueue=p.updateQueue,d.memoizedState=p.memoizedState,d.lanes=p.lanes):(d.updateQueue=null,d.memoizedState=null)}var h=Mg(s);if(h!==null){h.flags&=-257,jg(h,s,a,i,t),h.mode&1&&Pg(i,c,t),t=h,l=c;var v=t.updateQueue;if(v===null){var E=new Set;E.add(l),t.updateQueue=E}else v.add(l);break e}else{if(!(t&1)){Pg(i,c,t),rd();break e}l=Error(H(426))}}else if(he&&a.mode&1){var y=Mg(s);if(y!==null){!(y.flags&65536)&&(y.flags|=256),jg(y,s,a,i,t),hu(vo(l,a));break e}}i=l=vo(l,a),be!==4&&(be=2),Bi===null?Bi=[i]:Bi.push(i),i=s;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var g=Dg(i,l,t);ng(i,g);break e;case 1:a=l;var m=i.type,_=i.stateNode;if(!(i.flags&128)&&(typeof m.getDerivedStateFromError=="function"||_!==null&&typeof _.componentDidCatch=="function"&&(Hn===null||!Hn.has(_)))){i.flags|=65536,t&=-t,i.lanes|=t;var S=kg(i,a,t);ng(i,S);break e}}i=i.return}while(i!==null)}hm(n)}catch(x){t=x,we===n&&n!==null&&(we=n=n.return);continue}break}while(1)}function fm(){var e=ba.current;return ba.current=wa,e===null?wa:e}function rd(){(be===0||be===3||be===2)&&(be=4),ke===null||!(Sr&268435455)&&!(Ca&268435455)||Gn(ke,je)}function ja(e,t){var n=ne;ne|=2;var r=fm();(ke!==e||je!==t)&&(_n=null,Rr(e,t));do try{h1();break}catch(o){dm(e,o)}while(1);if(mu(),ne=n,ba.current=r,we!==null)throw Error(H(261));return ke=null,je=0,be}function h1(){for(;we!==null;)pm(we)}function g1(){for(;we!==null&&!VS();)pm(we)}function pm(e){var t=vm(e.alternate,e,ht);e.memoizedProps=e.pendingProps,t===null?hm(e):we=t,Ku.current=null}function hm(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=l1(n,t),n!==null){n.flags&=32767,we=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{be=6,we=null;return}}else if(n=a1(n,t,ht),n!==null){we=n;return}if(t=t.sibling,t!==null){we=t;return}we=t=e}while(t!==null);be===0&&(be=5)}function Nr(e,t,n){var r=se,o=Rt.transition;try{Rt.transition=null,se=1,m1(e,t,n,r)}finally{Rt.transition=o,se=r}return null}function m1(e,t,n,r){do So();while(zn!==null);if(ne&6)throw Error(H(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(H(177));e.callbackNode=null,e.callbackPriority=0;var i=n.lanes|n.childLanes;if(XS(e,i),e===ke&&(we=ke=null,je=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Da||(Da=!0,Em($s,function(){return So(),null})),i=(n.flags&15990)!==0,n.subtreeFlags&15990||i){i=Rt.transition,Rt.transition=null;var s=se;se=1;var a=ne;ne|=4,Ku.current=null,u1(e,n),om(n,e),Mx(ru),Ks=!!nu,ru=nu=null,e.current=n,d1(n),$S(),ne=a,se=s,Rt.transition=i}else e.current=n;if(Da&&(Da=!1,zn=e,ka=o),i=e.pendingLanes,i===0&&(Hn=null),zS(n.stateNode),it(e,xe()),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(La)throw La=!1,e=qu,qu=null,e;return ka&1&&e.tag!==0&&So(),i=e.pendingLanes,i&1?e===Ju?Hi++:(Hi=0,Ju=e):Hi=0,Fn(),null}function So(){if(zn!==null){var e=th(ka),t=Rt.transition,n=se;try{if(Rt.transition=null,se=16>e?16:e,zn===null)var r=!1;else{if(e=zn,zn=null,ka=0,ne&6)throw Error(H(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 c=a[l];for(G=c;G!==null;){var d=G;switch(d.tag){case 0:case 11:case 15:Vi(8,d,i)}var f=d.child;if(f!==null)f.return=d,G=f;else for(;G!==null;){d=G;var p=d.sibling,h=d.return;if(Zg(d),d===c){G=null;break}if(p!==null){p.return=h,G=p;break}G=h}}}var v=i.alternate;if(v!==null){var E=v.child;if(E!==null){v.child=null;do{var y=E.sibling;E.sibling=null,E=y}while(E!==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:Vi(9,i,i.return)}var g=i.sibling;if(g!==null){g.return=i.return,G=g;break e}G=i.return}}var m=e.current;for(G=m;G!==null;){s=G;var _=s.child;if(s.subtreeFlags&2064&&_!==null)_.return=s,G=_;else e:for(s=m;G!==null;){if(a=G,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:Ia(9,a)}}catch(x){_e(a,a.return,x)}if(a===s){G=null;break e}var S=a.sibling;if(S!==null){S.return=a.return,G=S;break e}G=a.return}}if(ne=o,Fn(),Qt&&typeof Qt.onPostCommitFiberRoot=="function")try{Qt.onPostCommitFiberRoot(Bs,e)}catch{}r=!0}return r}finally{se=n,Rt.transition=t}}return!1}function gm(e,t,n){t=vo(n,t),t=Dg(e,t,1),e=$n(e,t,1),t=Qe(),e!==null&&(pi(e,1,t),it(e,t))}function _e(e,t,n){if(e.tag===3)gm(e,e,n);else for(;t!==null;){if(t.tag===3){gm(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Hn===null||!Hn.has(r))){e=vo(n,e),e=kg(t,e,1),t=$n(t,e,1),e=Qe(),t!==null&&(pi(t,1,e),it(t,e));break}}t=t.return}}function v1(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Qe(),e.pingedLanes|=e.suspendedLanes&n,ke===e&&(je&n)===n&&(be===4||be===3&&(je&130023424)===je&&500>xe()-Xu?Rr(e,0):Qu|=n),it(e,t)}function mm(e,t){t===0&&(e.mode&1?(t=zs,zs<<=1,!(zs&130023424)&&(zs=4194304)):t=1);var n=Qe();e=vn(e,t),e!==null&&(pi(e,t,n),it(e,n))}function E1(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),mm(e,n)}function y1(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(H(314))}r!==null&&r.delete(t),mm(e,n)}var vm;vm=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||tt.current)rt=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return rt=!1,s1(e,t,n);rt=!!(e.flags&131072)}else rt=!1,he&&t.flags&1048576&&Qh(t,fa,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Ta(e,t),e=t.pendingProps;var o=lo(t,Fe.current);ho(t,n),o=Iu(null,t,r,e,o,n);var i=bu();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,nt(r)?(i=!0,ca(t)):i=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,_u(t),o.updater=Ea,t.stateNode=o,o._reactInternals=t,xu(t,r,e,n),t=Uu(null,t,r,!0,i,n)):(t.tag=0,he&&i&&uu(t),Ke(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Ta(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=S1(r),e=Pt(r,e),o){case 0:t=ju(null,t,r,e,n);break e;case 1:t=Hg(null,t,r,e,n);break e;case 11:t=Ug(null,t,r,e,n);break e;case 14:t=Fg(null,t,r,Pt(r.type,e),n);break e}throw Error(H(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Pt(r,o),ju(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Pt(r,o),Hg(e,t,r,o,n);case 3:e:{if(zg(t),e===null)throw Error(H(387));r=t.pendingProps,i=t.memoizedState,o=i.element,tg(e,t),va(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=vo(Error(H(423)),t),t=Wg(e,t,r,n,o);break e}else if(r!==o){o=vo(Error(H(424)),t),t=Wg(e,t,r,n,o);break e}else for(pt=Mn(t.stateNode.containerInfo.firstChild),ft=t,he=!0,kt=null,n=ug(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(fo(),r===o){t=yn(e,t,n);break e}Ke(e,t,r,n)}t=t.child}return t;case 5:return dg(t),e===null&&pu(t),r=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,s=o.children,ou(r,o)?s=null:i!==null&&ou(r,i)&&(t.flags|=32),Bg(e,t),Ke(e,t,s,n),t.child;case 6:return e===null&&pu(t),null;case 13:return Gg(e,t,n);case 4:return Ru(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=go(t,null,r,n):Ke(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Pt(r,o),Ug(e,t,r,o,n);case 7:return Ke(e,t,t.pendingProps,n),t.child;case 8:return Ke(e,t,t.pendingProps.children,n),t.child;case 12:return Ke(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,ce(ha,r._currentValue),r._currentValue=s,i!==null)if(Dt(i.value,s)){if(i.children===o.children&&!tt.current){t=yn(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=En(-1,n&-n),l.tag=2;var c=i.updateQueue;if(c!==null){c=c.shared;var d=c.pending;d===null?l.next=l:(l.next=d.next,d.next=l),c.pending=l}}i.lanes|=n,l=i.alternate,l!==null&&(l.lanes|=n),Eu(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(H(341));s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),Eu(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}Ke(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,ho(t,n),o=St(o),r=r(o),t.flags|=1,Ke(e,t,r,n),t.child;case 14:return r=t.type,o=Pt(r,t.pendingProps),o=Pt(r.type,o),Fg(e,t,r,o,n);case 15:return Vg(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Pt(r,o),Ta(e,t),t.tag=1,nt(r)?(e=!0,ca(t)):e=!1,ho(t,n),sg(t,r,o),xu(t,r,o,n),Uu(null,t,r,!0,e,n);case 19:return Kg(e,t,n);case 22:return $g(e,t,n)}throw Error(H(156,t.tag))};function Em(e,t){return Xp(e,t)}function _1(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 Nt(e,t,n,r){return new _1(e,t,n,r)}function od(e){return e=e.prototype,!(!e||!e.isReactComponent)}function S1(e){if(typeof e=="function")return od(e)?1:0;if(e!=null){if(e=e.$$typeof,e===uc)return 11;if(e===pc)return 14}return 2}function Yn(e,t){var n=e.alternate;return n===null?(n=Nt(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 Ua(e,t,n,r,o,i){var s=2;if(r=e,typeof e=="function")od(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case Qr:return wr(n.children,o,i,t);case lc:s=8,o|=8;break;case cc:return e=Nt(12,n,t,o|2),e.elementType=cc,e.lanes=i,e;case dc:return e=Nt(13,n,t,o),e.elementType=dc,e.lanes=i,e;case fc:return e=Nt(19,n,t,o),e.elementType=fc,e.lanes=i,e;case Op:return Fa(n,o,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Np:s=10;break e;case wp:s=9;break e;case uc:s=11;break e;case pc:s=14;break e;case An:s=16,r=null;break e}throw Error(H(130,e==null?e:typeof e,""))}return t=Nt(s,n,t,o),t.elementType=e,t.type=r,t.lanes=i,t}function wr(e,t,n,r){return e=Nt(7,e,r,t),e.lanes=n,e}function Fa(e,t,n,r){return e=Nt(22,e,r,t),e.elementType=Op,e.lanes=n,e.stateNode={isHidden:!1},e}function id(e,t,n){return e=Nt(6,e,null,t),e.lanes=n,e}function sd(e,t,n){return t=Nt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function x1(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=Dc(0),this.expirationTimes=Dc(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Dc(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function ad(e,t,n,r,o,i,s,a,l){return e=new x1(e,t,n,a,l),t===1?(t=1,i===!0&&(t|=8)):t=0,i=Nt(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},_u(i),e}function R1(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Kr,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function ym(e){if(!e)return Un;e=e._reactInternals;e:{if(pr(e)!==e||e.tag!==1)throw Error(H(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(nt(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(H(171))}if(e.tag===1){var n=e.type;if(nt(n))return Gh(e,n,t)}return t}function _m(e,t,n,r,o,i,s,a,l){return e=ad(n,r,!0,e,o,i,s,a,l),e.context=ym(null),n=e.current,r=Qe(),o=Wn(n),i=En(r,o),i.callback=t??null,$n(n,i,o),e.current.lanes=o,pi(e,o,r),it(e,r),e}function Va(e,t,n,r){var o=t.current,i=Qe(),s=Wn(o);return n=ym(n),t.context===null?t.context=n:t.pendingContext=n,t=En(i,s),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=$n(o,t,s),e!==null&&(Ut(e,o,s,i),ma(e,o,s)),s}function $a(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 Sm(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ld(e,t){Sm(e,t),(e=e.alternate)&&Sm(e,t)}function N1(){return null}var xm=typeof reportError=="function"?reportError:function(e){console.error(e)};function cd(e){this._internalRoot=e}Ba.prototype.render=cd.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(H(409));Va(e,t,null,null)},Ba.prototype.unmount=cd.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;xr(function(){Va(null,e,null,null)}),t[pn]=null}};function Ba(e){this._internalRoot=e}Ba.prototype.unstable_scheduleHydration=function(e){if(e){var t=oh();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Dn.length&&t!==0&&t<Dn[n].priority;n++);Dn.splice(n,0,e),n===0&&ah(e)}};function ud(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Ha(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Rm(){}function w1(e,t,n,r,o){if(o){if(typeof r=="function"){var i=r;r=function(){var c=$a(s);i.call(c)}}var s=_m(t,r,e,0,null,!1,!1,"",Rm);return e._reactRootContainer=s,e[pn]=s.current,Ti(e.nodeType===8?e.parentNode:e),xr(),s}for(;o=e.lastChild;)e.removeChild(o);if(typeof r=="function"){var a=r;r=function(){var c=$a(l);a.call(c)}}var l=ad(e,0,!1,null,null,!1,!1,"",Rm);return e._reactRootContainer=l,e[pn]=l.current,Ti(e.nodeType===8?e.parentNode:e),xr(function(){Va(t,l,n,r)}),l}function za(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=$a(s);a.call(l)}}Va(t,s,e,o)}else s=w1(n,t,e,o,r);return $a(s)}nh=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=fi(t.pendingLanes);n!==0&&(kc(t,n|1),it(t,xe()),!(ne&6)&&(_o=xe()+500,Fn()))}break;case 13:xr(function(){var r=vn(e,1);if(r!==null){var o=Qe();Ut(r,e,1,o)}}),ld(e,1)}},Pc=function(e){if(e.tag===13){var t=vn(e,134217728);if(t!==null){var n=Qe();Ut(t,e,134217728,n)}ld(e,134217728)}},rh=function(e){if(e.tag===13){var t=Wn(e),n=vn(e,t);if(n!==null){var r=Qe();Ut(n,e,t,r)}ld(e,t)}},oh=function(){return se},ih=function(e,t){var n=se;try{return se=e,t()}finally{se=n}},Tc=function(e,t,n){switch(t){case"input":if(yc(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=aa(r);if(!o)throw Error(H(90));Ip(r),yc(r,o)}}}break;case"textarea":kp(e,n);break;case"select":t=n.value,t!=null&&Xr(e,!!n.multiple,t,!1)}},Hp=td,zp=xr;var O1={usingClientEntryPoint:!1,Events:[bi,so,aa,$p,Bp,td]},zi={findFiberByHostInstance:hr,bundleType:0,version:"18.2.0",rendererPackageName:"react-dom"},T1={bundleType:zi.bundleType,version:zi.version,rendererPackageName:zi.rendererPackageName,rendererConfig:zi.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:fn.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Kp(e),e===null?null:e.stateNode},findFiberByHostInstance:zi.findFiberByHostInstance||N1,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 Wa=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Wa.isDisabled&&Wa.supportsFiber)try{Bs=Wa.inject(T1),Qt=Wa}catch{}}ct.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=O1,ct.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!ud(t))throw Error(H(200));return R1(e,t,null,n)},ct.createRoot=function(e,t){if(!ud(e))throw Error(H(299));var n=!1,r="",o=xm;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=ad(e,1,!1,null,null,n,!1,r,o),e[pn]=t.current,Ti(e.nodeType===8?e.parentNode:e),new cd(t)},ct.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(H(188)):(e=Object.keys(e).join(","),Error(H(268,e)));return e=Kp(t),e=e===null?null:e.stateNode,e},ct.flushSync=function(e){return xr(e)},ct.hydrate=function(e,t,n){if(!Ha(t))throw Error(H(200));return za(null,e,t,!0,n)},ct.hydrateRoot=function(e,t,n){if(!ud(e))throw Error(H(405));var r=n!=null&&n.hydratedSources||null,o=!1,i="",s=xm;if(n!=null&&(n.unstable_strictMode===!0&&(o=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(s=n.onRecoverableError)),t=_m(t,null,e,1,n??null,o,!1,i,s),e[pn]=t.current,Ti(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 Ba(t)},ct.render=function(e,t,n){if(!Ha(t))throw Error(H(200));return za(null,e,t,!1,n)},ct.unmountComponentAtNode=function(e){if(!Ha(e))throw Error(H(40));return e._reactRootContainer?(xr(function(){za(null,null,e,!1,function(){e._reactRootContainer=null,e[pn]=null})}),!0):!1},ct.unstable_batchedUpdates=td,ct.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Ha(n))throw Error(H(200));if(e==null||e._reactInternals===void 0)throw Error(H(38));return za(e,t,n,!1,r)},ct.version="18.2.0-next-9e3b772b8-20220608";function Nm(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Nm)}catch(e){console.error(e)}}Nm(),vp.exports=ct;var xo=vp.exports,wm=xo;rc.createRoot=wm.createRoot,rc.hydrateRoot=wm.hydrateRoot;function Xe(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=Xe(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var Om={exports:{}},Tm={},Am={exports:{}},Im={};/**
44
+ `+i.stack}return{value:e,source:t,stack:o,digest:null}}function ju(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Uu(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var n1=typeof WeakMap=="function"?WeakMap:Map;function Dg(e,t,n){n=vn(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){ka||(ka=!0,Zu=r),Uu(e,t)},n}function kg(e,t,n){n=vn(-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(){Uu(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){Uu(e,t),typeof r!="function"&&(Hn===null?Hn=new Set([this]):Hn.add(this));var s=t.stack;this.componentDidCatch(t.value,{componentStack:s!==null?s:""})}),n}function Pg(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new n1;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=m1.bind(null,e,t,n),t.then(e,e))}function Mg(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 jg(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=vn(-1,1),t.tag=2,$n(n,t,1))),n.lanes|=1),e)}var r1=fn.ReactCurrentOwner,ot=!1;function Qe(e,t,n,r){t.child=e===null?ug(t,null,n,r):go(t,e.child,n,r)}function Ug(e,t,n,r,o){n=n.render;var i=t.ref;return ho(t,o),r=Cu(e,t,n,r,i,o),n=Lu(),e!==null&&!ot?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,yn(e,t,o)):(he&&n&&fu(t),t.flags|=1,Qe(e,t,r,o),t.child)}function Fg(e,t,n,r,o){if(e===null){var i=n.type;return typeof i=="function"&&!sd(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,Vg(e,t,i,r,o)):(e=Va(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:Ni,n(s,r)&&e.ref===t.ref)return yn(e,t,o)}return t.flags|=1,e=Yn(i,r),e.ref=t.ref,e.return=t,t.child=e}function Vg(e,t,n,r,o){if(e!==null){var i=e.memoizedProps;if(Ni(i,r)&&e.ref===t.ref)if(ot=!1,t.pendingProps=r=i,(e.lanes&o)!==0)e.flags&131072&&(ot=!0);else return t.lanes=e.lanes,yn(e,t,o)}return Fu(e,t,n,r,o)}function $g(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},ce(yo,gt),gt|=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,ce(yo,gt),gt|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,ce(yo,gt),gt|=r}else i!==null?(r=i.baseLanes|n,t.memoizedState=null):r=n,ce(yo,gt),gt|=r;return Qe(e,t,o,n),t.child}function Bg(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Fu(e,t,n,r,o){var i=rt(n)?gr:Ve.current;return i=lo(t,i),ho(t,o),n=Cu(e,t,n,r,i,o),r=Lu(),e!==null&&!ot?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,yn(e,t,o)):(he&&r&&fu(t),t.flags|=1,Qe(e,t,n,o),t.child)}function Hg(e,t,n,r,o){if(rt(n)){var i=!0;da(t)}else i=!1;if(ho(t,o),t.stateNode===null)Ia(e,t),sg(t,n,r),Nu(t,n,r,o),r=!0;else if(e===null){var s=t.stateNode,a=t.memoizedProps;s.props=a;var l=s.context,c=n.contextType;typeof c=="object"&&c!==null?c=Rt(c):(c=rt(n)?gr:Ve.current,c=lo(t,c));var d=n.getDerivedStateFromProps,f=typeof d=="function"||typeof s.getSnapshotBeforeUpdate=="function";f||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==r||l!==c)&&ag(t,s,r,c),Vn=!1;var p=t.memoizedState;s.state=p,ya(t,r,s,o),l=t.memoizedState,a!==r||p!==l||nt.current||Vn?(typeof d=="function"&&(Ru(t,n,d,r),l=t.memoizedState),(a=Vn||ig(t,n,a,r,p,l,c))?(f||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=c,r=a):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{s=t.stateNode,tg(e,t),a=t.memoizedProps,c=t.type===t.elementType?a:Mt(t.type,a),s.props=c,f=t.pendingProps,p=s.context,l=n.contextType,typeof l=="object"&&l!==null?l=Rt(l):(l=rt(n)?gr:Ve.current,l=lo(t,l));var h=n.getDerivedStateFromProps;(d=typeof h=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==f||p!==l)&&ag(t,s,r,l),Vn=!1,p=t.memoizedState,s.state=p,ya(t,r,s,o);var E=t.memoizedState;a!==f||p!==E||nt.current||Vn?(typeof h=="function"&&(Ru(t,n,h,r),E=t.memoizedState),(c=Vn||ig(t,n,c,r,p,E,l)||!1)?(d||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(r,E,l),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(r,E,l)),typeof s.componentDidUpdate=="function"&&(t.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof s.componentDidUpdate!="function"||a===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=E),s.props=r,s.state=E,s.context=l,r=c):(typeof s.componentDidUpdate!="function"||a===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),r=!1)}return Vu(e,t,n,r,i,o)}function Vu(e,t,n,r,o,i){Bg(e,t);var s=(t.flags&128)!==0;if(!r&&!s)return o&&Yh(t,n,!1),yn(e,t,i);r=t.stateNode,r1.current=t;var a=s&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&s?(t.child=go(t,e.child,null,i),t.child=go(t,null,a,i)):Qe(e,t,a,i),t.memoizedState=r.state,o&&Yh(t,n,!0),t.child}function zg(e){var t=e.stateNode;t.pendingContext?Wh(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Wh(e,t.context,!1),wu(e,t.containerInfo)}function Wg(e,t,n,r,o){return fo(),mu(o),t.flags|=256,Qe(e,t,n,r),t.child}var $u={dehydrated:null,treeContext:null,retryLane:0};function Bu(e){return{baseLanes:e,cachePool:null,transitions:null}}function Gg(e,t,n){var r=t.pendingProps,o=ve.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),ce(ve,o&1),e===null)return gu(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=wr(e,r,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=Bu(n),t.memoizedState=$u,e):Hu(t,s));if(o=e.memoizedState,o!==null&&(a=o.dehydrated,a!==null))return o1(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=Yn(o,l),r.subtreeFlags=o.subtreeFlags&14680064),a!==null?i=Yn(a,i):(i=wr(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?Bu(n):{baseLanes:s.baseLanes|n,cachePool:null,transitions:s.transitions},i.memoizedState=s,i.childLanes=e.childLanes&~n,t.memoizedState=$u,r}return i=e.child,e=i.sibling,r=Yn(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 Hu(e,t){return t=$a({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Aa(e,t,n,r){return r!==null&&mu(r),go(t,e.child,null,n),e=Hu(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function o1(e,t,n,r,o,i,s){if(n)return t.flags&256?(t.flags&=-257,r=ju(Error(H(422))),Aa(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=wr(i,o,s,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,t.mode&1&&go(t,e.child,null,s),t.child.memoizedState=Bu(s),t.memoizedState=$u,i);if(!(t.mode&1))return Aa(e,t,s,null);if(o.data==="$!"){if(r=o.nextSibling&&o.nextSibling.dataset,r)var a=r.dgst;return r=a,i=Error(H(419)),r=ju(i,r,void 0),Aa(e,t,s,r)}if(a=(s&e.childLanes)!==0,ot||a){if(r=Pe,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,En(e,o),Ft(r,e,o,-1))}return id(),r=ju(Error(H(421))),Aa(e,t,s,r)}return o.data==="$?"?(t.flags|=128,t.child=e.child,t=E1.bind(null,e),o._reactRetry=t,null):(e=i.treeContext,ht=Mn(o.nextSibling),pt=t,he=!0,Pt=null,e!==null&&(St[xt++]=gn,St[xt++]=mn,St[xt++]=mr,gn=e.id,mn=e.overflow,mr=t),t=Hu(t,r.children),t.flags|=4096,t)}function Yg(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),_u(e.return,t,n)}function zu(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 Kg(e,t,n){var r=t.pendingProps,o=r.revealOrder,i=r.tail;if(Qe(e,t,r.children,n),r=ve.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&&Yg(e,n,t);else if(e.tag===19)Yg(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(ce(ve,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&&xa(e)===null&&(o=n),n=n.sibling;n=o,n===null?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),zu(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&&xa(e)===null){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}zu(t,!0,n,null,i);break;case"together":zu(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Ia(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function yn(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Sr|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(H(153));if(t.child!==null){for(e=t.child,n=Yn(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Yn(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function i1(e,t,n){switch(t.tag){case 3:zg(t),fo();break;case 5:dg(t);break;case 1:rt(t.type)&&da(t);break;case 4:wu(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,o=t.memoizedProps.value;ce(ma,r._currentValue),r._currentValue=o;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(ce(ve,ve.current&1),t.flags|=128,null):n&t.child.childLanes?Gg(e,t,n):(ce(ve,ve.current&1),e=yn(e,t,n),e!==null?e.sibling:null);ce(ve,ve.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return Kg(e,t,n);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),ce(ve,ve.current),r)break;return null;case 22:case 23:return t.lanes=0,$g(e,t,n)}return yn(e,t,n)}var Qg,Wu,Xg,qg;Qg=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}},Wu=function(){},Xg=function(e,t,n,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,yr(qt.current);var i=null;switch(n){case"input":o=_c(e,o),r=_c(e,r),i=[];break;case"select":o=Ee({},o,{value:void 0}),r=Ee({},r,{value:void 0}),i=[];break;case"textarea":o=Rc(e,o),r=Rc(e,r),i=[];break;default:typeof o.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=la)}wc(n,r);var s;n=null;for(c in o)if(!r.hasOwnProperty(c)&&o.hasOwnProperty(c)&&o[c]!=null)if(c==="style"){var a=o[c];for(s in a)a.hasOwnProperty(s)&&(n||(n={}),n[s]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(ri.hasOwnProperty(c)?i||(i=[]):(i=i||[]).push(c,null));for(c in r){var l=r[c];if(a=o!=null?o[c]:void 0,r.hasOwnProperty(c)&&l!==a&&(l!=null||a!=null))if(c==="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(c,n)),n=l;else c==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,a=a?a.__html:void 0,l!=null&&a!==l&&(i=i||[]).push(c,l)):c==="children"?typeof l!="string"&&typeof l!="number"||(i=i||[]).push(c,""+l):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(ri.hasOwnProperty(c)?(l!=null&&c==="onScroll"&&ue("scroll",e),i||a===l||(i=[])):(i=i||[]).push(c,l))}n&&(i=i||[]).push("style",n);var c=i;(t.updateQueue=c)&&(t.flags|=4)}},qg=function(e,t,n,r){n!==r&&(t.flags|=4)};function Fi(e,t){if(!he)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 Be(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 s1(e,t,n){var r=t.pendingProps;switch(pu(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Be(t),null;case 1:return rt(t.type)&&ua(),Be(t),null;case 3:return r=t.stateNode,mo(),de(nt),de(Ve),Au(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(ga(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Pt!==null&&(nd(Pt),Pt=null))),Wu(e,t),Be(t),null;case 5:Ou(t);var o=yr(ki.current);if(n=t.type,e!==null&&t.stateNode!=null)Xg(e,t,n,r,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(H(166));return Be(t),null}if(e=yr(qt.current),ga(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[Xt]=t,r[Ii]=i,e=(t.mode&1)!==0,n){case"dialog":ue("cancel",r),ue("close",r);break;case"iframe":case"object":case"embed":ue("load",r);break;case"video":case"audio":for(o=0;o<Oi.length;o++)ue(Oi[o],r);break;case"source":ue("error",r);break;case"img":case"image":case"link":ue("error",r),ue("load",r);break;case"details":ue("toggle",r);break;case"input":bp(r,i),ue("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},ue("invalid",r);break;case"textarea":Dp(r,i),ue("invalid",r)}wc(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&&aa(r.textContent,a,e),o=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(i.suppressHydrationWarning!==!0&&aa(r.textContent,a,e),o=["children",""+a]):ri.hasOwnProperty(s)&&a!=null&&s==="onScroll"&&ue("scroll",r)}switch(n){case"input":Us(r),Lp(r,i,!0);break;case"textarea":Us(r),Pp(r);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(r.onclick=la)}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=Mp(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[Xt]=t,e[Ii]=r,Qg(e,t,!1,!1),t.stateNode=e;e:{switch(s=Oc(n,r),n){case"dialog":ue("cancel",e),ue("close",e),o=r;break;case"iframe":case"object":case"embed":ue("load",e),o=r;break;case"video":case"audio":for(o=0;o<Oi.length;o++)ue(Oi[o],e);o=r;break;case"source":ue("error",e),o=r;break;case"img":case"image":case"link":ue("error",e),ue("load",e),o=r;break;case"details":ue("toggle",e),o=r;break;case"input":bp(e,r),o=_c(e,r),ue("invalid",e);break;case"option":o=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},o=Ee({},r,{value:void 0}),ue("invalid",e);break;case"textarea":Dp(e,r),o=Rc(e,r),ue("invalid",e);break;default:o=r}wc(n,o),a=o;for(i in a)if(a.hasOwnProperty(i)){var l=a[i];i==="style"?Fp(e,l):i==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&jp(e,l)):i==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&ai(e,l):typeof l=="number"&&ai(e,""+l):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(ri.hasOwnProperty(i)?l!=null&&i==="onScroll"&&ue("scroll",e):l!=null&&cc(e,i,l,s))}switch(n){case"input":Us(e),Lp(e,r,!1);break;case"textarea":Us(e),Pp(e);break;case"option":r.value!=null&&e.setAttribute("value",""+In(r.value));break;case"select":e.multiple=!!r.multiple,i=r.value,i!=null?Xr(e,!!r.multiple,i,!1):r.defaultValue!=null&&Xr(e,!!r.multiple,r.defaultValue,!0);break;default:typeof o.onClick=="function"&&(e.onclick=la)}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 Be(t),null;case 6:if(e&&t.stateNode!=null)qg(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(H(166));if(n=yr(ki.current),yr(qt.current),ga(t)){if(r=t.stateNode,n=t.memoizedProps,r[Xt]=t,(i=r.nodeValue!==n)&&(e=pt,e!==null))switch(e.tag){case 3:aa(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&aa(r.nodeValue,n,(e.mode&1)!==0)}i&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Xt]=t,t.stateNode=r}return Be(t),null;case 13:if(de(ve),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(he&&ht!==null&&t.mode&1&&!(t.flags&128))Zh(),fo(),t.flags|=98560,i=!1;else if(i=ga(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(H(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(H(317));i[Xt]=t}else fo(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Be(t),i=!1}else Pt!==null&&(nd(Pt),Pt=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||ve.current&1?Ce===0&&(Ce=3):id())),t.updateQueue!==null&&(t.flags|=4),Be(t),null);case 4:return mo(),Wu(e,t),e===null&&Ti(t.stateNode.containerInfo),Be(t),null;case 10:return yu(t.type._context),Be(t),null;case 17:return rt(t.type)&&ua(),Be(t),null;case 19:if(de(ve),i=t.memoizedState,i===null)return Be(t),null;if(r=(t.flags&128)!==0,s=i.rendering,s===null)if(r)Fi(i,!1);else{if(Ce!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(s=xa(e),s!==null){for(t.flags|=128,Fi(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 ce(ve,ve.current&1|2),t.child}e=e.sibling}i.tail!==null&&Re()>_o&&(t.flags|=128,r=!0,Fi(i,!1),t.lanes=4194304)}else{if(!r)if(e=xa(s),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Fi(i,!0),i.tail===null&&i.tailMode==="hidden"&&!s.alternate&&!he)return Be(t),null}else 2*Re()-i.renderingStartTime>_o&&n!==1073741824&&(t.flags|=128,r=!0,Fi(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=Re(),t.sibling=null,n=ve.current,ce(ve,r?n&1|2:n&1),t):(Be(t),null);case 22:case 23:return od(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?gt&1073741824&&(Be(t),t.subtreeFlags&6&&(t.flags|=8192)):Be(t),null;case 24:return null;case 25:return null}throw Error(H(156,t.tag))}function a1(e,t){switch(pu(t),t.tag){case 1:return rt(t.type)&&ua(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return mo(),de(nt),de(Ve),Au(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Ou(t),null;case 13:if(de(ve),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(H(340));fo()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return de(ve),null;case 4:return mo(),null;case 10:return yu(t.type._context),null;case 22:case 23:return od(),null;case 24:return null;default:return null}}var ba=!1,He=!1,l1=typeof WeakSet=="function"?WeakSet:Set,G=null;function vo(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Se(e,t,r)}else n.current=null}function Gu(e,t,n){try{n()}catch(r){Se(e,t,r)}}var Jg=!1;function c1(e,t){if(ou=Xs,e=Ih(),Xc(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,c=0,d=0,f=e,p=null;t:for(;;){for(var h;f!==n||o!==0&&f.nodeType!==3||(a=s+o),f!==i||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(h=f.firstChild)!==null;)p=f,f=h;for(;;){if(f===e)break t;if(p===n&&++c===o&&(a=s),p===i&&++d===r&&(l=s),(h=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=h}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(iu={focusedElem:e,selectionRange:n},Xs=!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 E=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(E!==null){var v=E.memoizedProps,y=E.memoizedState,g=t.stateNode,m=g.getSnapshotBeforeUpdate(t.elementType===t.type?v:Mt(t.type,v),y);g.__reactInternalSnapshotBeforeUpdate=m}break;case 3:var _=t.stateNode.containerInfo;_.nodeType===1?_.textContent="":_.nodeType===9&&_.documentElement&&_.removeChild(_.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(H(163))}}catch(S){Se(t,t.return,S)}if(e=t.sibling,e!==null){e.return=t.return,G=e;break}G=t.return}return E=Jg,Jg=!1,E}function Vi(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&&Gu(t,n,i)}o=o.next}while(o!==r)}}function Ca(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 Yu(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 Zg(e){var t=e.alternate;t!==null&&(e.alternate=null,Zg(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Xt],delete t[Ii],delete t[cu],delete t[Wx],delete t[Gx])),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 em(e){return e.tag===5||e.tag===3||e.tag===4}function tm(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||em(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 Ku(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=la));else if(r!==4&&(e=e.child,e!==null))for(Ku(e,t,n),e=e.sibling;e!==null;)Ku(e,t,n),e=e.sibling}function Qu(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(Qu(e,t,n),e=e.sibling;e!==null;)Qu(e,t,n),e=e.sibling}var je=null,jt=!1;function Bn(e,t,n){for(n=n.child;n!==null;)nm(e,t,n),n=n.sibling}function nm(e,t,n){if(Qt&&typeof Qt.onCommitFiberUnmount=="function")try{Qt.onCommitFiberUnmount(zs,n)}catch{}switch(n.tag){case 5:He||vo(n,t);case 6:var r=je,o=jt;je=null,Bn(e,t,n),je=r,jt=o,je!==null&&(jt?(e=je,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):je.removeChild(n.stateNode));break;case 18:je!==null&&(jt?(e=je,n=n.stateNode,e.nodeType===8?lu(e.parentNode,n):e.nodeType===1&&lu(e,n),vi(e)):lu(je,n.stateNode));break;case 4:r=je,o=jt,je=n.stateNode.containerInfo,jt=!0,Bn(e,t,n),je=r,jt=o;break;case 0:case 11:case 14:case 15:if(!He&&(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)&&Gu(n,t,s),o=o.next}while(o!==r)}Bn(e,t,n);break;case 1:if(!He&&(vo(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){Se(n,t,a)}Bn(e,t,n);break;case 21:Bn(e,t,n);break;case 22:n.mode&1?(He=(r=He)||n.memoizedState!==null,Bn(e,t,n),He=r):Bn(e,t,n);break;default:Bn(e,t,n)}}function rm(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new l1),t.forEach(function(r){var o=v1.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function Ut(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:je=a.stateNode,jt=!1;break e;case 3:je=a.stateNode.containerInfo,jt=!0;break e;case 4:je=a.stateNode.containerInfo,jt=!0;break e}a=a.return}if(je===null)throw Error(H(160));nm(i,s,o),je=null,jt=!1;var l=o.alternate;l!==null&&(l.return=null),o.return=null}catch(c){Se(o,t,c)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)om(t,e),t=t.sibling}function om(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Ut(t,e),Zt(e),r&4){try{Vi(3,e,e.return),Ca(3,e)}catch(v){Se(e,e.return,v)}try{Vi(5,e,e.return)}catch(v){Se(e,e.return,v)}}break;case 1:Ut(t,e),Zt(e),r&512&&n!==null&&vo(n,n.return);break;case 5:if(Ut(t,e),Zt(e),r&512&&n!==null&&vo(n,n.return),e.flags&32){var o=e.stateNode;try{ai(o,"")}catch(v){Se(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&&Cp(o,i),Oc(a,s);var c=Oc(a,i);for(s=0;s<l.length;s+=2){var d=l[s],f=l[s+1];d==="style"?Fp(o,f):d==="dangerouslySetInnerHTML"?jp(o,f):d==="children"?ai(o,f):cc(o,d,f,c)}switch(a){case"input":Sc(o,i);break;case"textarea":kp(o,i);break;case"select":var p=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!i.multiple;var h=i.value;h!=null?Xr(o,!!i.multiple,h,!1):p!==!!i.multiple&&(i.defaultValue!=null?Xr(o,!!i.multiple,i.defaultValue,!0):Xr(o,!!i.multiple,i.multiple?[]:"",!1))}o[Ii]=i}catch(v){Se(e,e.return,v)}}break;case 6:if(Ut(t,e),Zt(e),r&4){if(e.stateNode===null)throw Error(H(162));o=e.stateNode,i=e.memoizedProps;try{o.nodeValue=i}catch(v){Se(e,e.return,v)}}break;case 3:if(Ut(t,e),Zt(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{vi(t.containerInfo)}catch(v){Se(e,e.return,v)}break;case 4:Ut(t,e),Zt(e);break;case 13:Ut(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||(Ju=Re())),r&4&&rm(e);break;case 22:if(d=n!==null&&n.memoizedState!==null,e.mode&1?(He=(c=He)||d,Ut(t,e),He=c):Ut(t,e),Zt(e),r&8192){if(c=e.memoizedState!==null,(e.stateNode.isHidden=c)&&!d&&e.mode&1)for(G=e,d=e.child;d!==null;){for(f=G=d;G!==null;){switch(p=G,h=p.child,p.tag){case 0:case 11:case 14:case 15:Vi(4,p,p.return);break;case 1:vo(p,p.return);var E=p.stateNode;if(typeof E.componentWillUnmount=="function"){r=p,n=p.return;try{t=r,E.props=t.memoizedProps,E.state=t.memoizedState,E.componentWillUnmount()}catch(v){Se(r,n,v)}}break;case 5:vo(p,p.return);break;case 22:if(p.memoizedState!==null){am(f);continue}}h!==null?(h.return=p,G=h):am(f)}d=d.sibling}e:for(d=null,f=e;;){if(f.tag===5){if(d===null){d=f;try{o=f.stateNode,c?(i=o.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(a=f.stateNode,l=f.memoizedProps.style,s=l!=null&&l.hasOwnProperty("display")?l.display:null,a.style.display=Up("display",s))}catch(v){Se(e,e.return,v)}}}else if(f.tag===6){if(d===null)try{f.stateNode.nodeValue=c?"":f.memoizedProps}catch(v){Se(e,e.return,v)}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===e)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===e)break e;for(;f.sibling===null;){if(f.return===null||f.return===e)break e;d===f&&(d=null),f=f.return}d===f&&(d=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:Ut(t,e),Zt(e),r&4&&rm(e);break;case 21:break;default:Ut(t,e),Zt(e)}}function Zt(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(em(n)){var r=n;break e}n=n.return}throw Error(H(160))}switch(r.tag){case 5:var o=r.stateNode;r.flags&32&&(ai(o,""),r.flags&=-33);var i=tm(e);Qu(e,i,o);break;case 3:case 4:var s=r.stateNode.containerInfo,a=tm(e);Ku(e,a,s);break;default:throw Error(H(161))}}catch(l){Se(e,e.return,l)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function u1(e,t,n){G=e,im(e)}function im(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||ba;if(!s){var a=o.alternate,l=a!==null&&a.memoizedState!==null||He;a=ba;var c=He;if(ba=s,(He=l)&&!c)for(G=o;G!==null;)s=G,l=s.child,s.tag===22&&s.memoizedState!==null?lm(o):l!==null?(l.return=s,G=l):lm(o);for(;i!==null;)G=i,im(i),i=i.sibling;G=o,ba=a,He=c}sm(e)}else o.subtreeFlags&8772&&i!==null?(i.return=o,G=i):sm(e)}}function sm(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:He||Ca(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!He)if(n===null)r.componentDidMount();else{var o=t.elementType===t.type?n.memoizedProps:Mt(t.type,n.memoizedProps);r.componentDidUpdate(o,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&rg(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}rg(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 c=t.alternate;if(c!==null){var d=c.memoizedState;if(d!==null){var f=d.dehydrated;f!==null&&vi(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(H(163))}He||t.flags&512&&Yu(t)}catch(p){Se(t,t.return,p)}}if(t===e){G=null;break}if(n=t.sibling,n!==null){n.return=t.return,G=n;break}G=t.return}}function am(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 lm(e){for(;G!==null;){var t=G;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Ca(4,t)}catch(l){Se(t,n,l)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var o=t.return;try{r.componentDidMount()}catch(l){Se(t,o,l)}}var i=t.return;try{Yu(t)}catch(l){Se(t,i,l)}break;case 5:var s=t.return;try{Yu(t)}catch(l){Se(t,s,l)}}}catch(l){Se(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 d1=Math.ceil,La=fn.ReactCurrentDispatcher,Xu=fn.ReactCurrentOwner,wt=fn.ReactCurrentBatchConfig,ne=0,Pe=null,Oe=null,Ue=0,gt=0,yo=jn(0),Ce=0,$i=null,Sr=0,Da=0,qu=0,Bi=null,it=null,Ju=0,_o=1/0,_n=null,ka=!1,Zu=null,Hn=null,Pa=!1,zn=null,Ma=0,Hi=0,ed=null,ja=-1,Ua=0;function Xe(){return ne&6?Re():ja!==-1?ja:ja=Re()}function Wn(e){return e.mode&1?ne&2&&Ue!==0?Ue&-Ue:Kx.transition!==null?(Ua===0&&(Ua=eh()),Ua):(e=se,e!==0||(e=window.event,e=e===void 0?16:ch(e.type)),e):1}function Ft(e,t,n,r){if(50<Hi)throw Hi=0,ed=null,Error(H(185));pi(e,n,r),(!(ne&2)||e!==Pe)&&(e===Pe&&(!(ne&2)&&(Da|=n),Ce===4&&Gn(e,Ue)),st(e,r),n===1&&ne===0&&!(t.mode&1)&&(_o=Re()+500,fa&&Fn()))}function st(e,t){var n=e.callbackNode;KS(e,t);var r=Ys(e,e===Pe?Ue:0);if(r===0)n!==null&&qp(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&qp(n),t===1)e.tag===0?Yx(um.bind(null,e)):Kh(um.bind(null,e)),Hx(function(){!(ne&6)&&Fn()}),n=null;else{switch(th(r)){case 1:n=Dc;break;case 4:n=Jp;break;case 16:n=Hs;break;case 536870912:n=Zp;break;default:n=Hs}n=vm(n,cm.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function cm(e,t){if(ja=-1,Ua=0,ne&6)throw Error(H(327));var n=e.callbackNode;if(So()&&e.callbackNode!==n)return null;var r=Ys(e,e===Pe?Ue:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Fa(e,r);else{t=r;var o=ne;ne|=2;var i=fm();(Pe!==e||Ue!==t)&&(_n=null,_o=Re()+500,Rr(e,t));do try{h1();break}catch(a){dm(e,a)}while(1);vu(),La.current=i,ne=o,Oe!==null?t=0:(Pe=null,Ue=0,t=Ce)}if(t!==0){if(t===2&&(o=kc(e),o!==0&&(r=o,t=td(e,o))),t===1)throw n=$i,Rr(e,0),Gn(e,r),st(e,Re()),n;if(t===6)Gn(e,r);else{if(o=e.current.alternate,!(r&30)&&!f1(o)&&(t=Fa(e,r),t===2&&(i=kc(e),i!==0&&(r=i,t=td(e,i))),t===1))throw n=$i,Rr(e,0),Gn(e,r),st(e,Re()),n;switch(e.finishedWork=o,e.finishedLanes=r,t){case 0:case 1:throw Error(H(345));case 2:Nr(e,it,_n);break;case 3:if(Gn(e,r),(r&130023424)===r&&(t=Ju+500-Re(),10<t)){if(Ys(e,0)!==0)break;if(o=e.suspendedLanes,(o&r)!==r){Xe(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=au(Nr.bind(null,e,it,_n),t);break}Nr(e,it,_n);break;case 4:if(Gn(e,r),(r&4194240)===r)break;for(t=e.eventTimes,o=-1;0<r;){var s=31-Dt(r);i=1<<s,s=t[s],s>o&&(o=s),r&=~i}if(r=o,r=Re()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*d1(r/1960))-r,10<r){e.timeoutHandle=au(Nr.bind(null,e,it,_n),r);break}Nr(e,it,_n);break;case 5:Nr(e,it,_n);break;default:throw Error(H(329))}}}return st(e,Re()),e.callbackNode===n?cm.bind(null,e):null}function td(e,t){var n=Bi;return e.current.memoizedState.isDehydrated&&(Rr(e,t).flags|=256),e=Fa(e,t),e!==2&&(t=it,it=n,t!==null&&nd(t)),e}function nd(e){it===null?it=e:it.push.apply(it,e)}function f1(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(!kt(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 Gn(e,t){for(t&=~qu,t&=~Da,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Dt(t),r=1<<n;e[n]=-1,t&=~r}}function um(e){if(ne&6)throw Error(H(327));So();var t=Ys(e,0);if(!(t&1))return st(e,Re()),null;var n=Fa(e,t);if(e.tag!==0&&n===2){var r=kc(e);r!==0&&(t=r,n=td(e,r))}if(n===1)throw n=$i,Rr(e,0),Gn(e,t),st(e,Re()),n;if(n===6)throw Error(H(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Nr(e,it,_n),st(e,Re()),null}function rd(e,t){var n=ne;ne|=1;try{return e(t)}finally{ne=n,ne===0&&(_o=Re()+500,fa&&Fn())}}function xr(e){zn!==null&&zn.tag===0&&!(ne&6)&&So();var t=ne;ne|=1;var n=wt.transition,r=se;try{if(wt.transition=null,se=1,e)return e()}finally{se=r,wt.transition=n,ne=t,!(ne&6)&&Fn()}}function od(){gt=yo.current,de(yo)}function Rr(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,Bx(n)),Oe!==null)for(n=Oe.return;n!==null;){var r=n;switch(pu(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&ua();break;case 3:mo(),de(nt),de(Ve),Au();break;case 5:Ou(r);break;case 4:mo();break;case 13:de(ve);break;case 19:de(ve);break;case 10:yu(r.type._context);break;case 22:case 23:od()}n=n.return}if(Pe=e,Oe=e=Yn(e.current,null),Ue=gt=t,Ce=0,$i=null,qu=Da=Sr=0,it=Bi=null,vr!==null){for(t=0;t<vr.length;t++)if(n=vr[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}vr=null}return e}function dm(e,t){do{var n=Oe;try{if(vu(),Ra.current=Ta,Na){for(var r=ye.memoizedState;r!==null;){var o=r.queue;o!==null&&(o.pending=null),r=r.next}Na=!1}if(_r=0,ke=be=ye=null,Pi=!1,Mi=0,Xu.current=null,n===null||n.return===null){Ce=1,$i=t,Oe=null;break}e:{var i=e,s=n.return,a=n,l=t;if(t=Ue,a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var c=l,d=a,f=d.tag;if(!(d.mode&1)&&(f===0||f===11||f===15)){var p=d.alternate;p?(d.updateQueue=p.updateQueue,d.memoizedState=p.memoizedState,d.lanes=p.lanes):(d.updateQueue=null,d.memoizedState=null)}var h=Mg(s);if(h!==null){h.flags&=-257,jg(h,s,a,i,t),h.mode&1&&Pg(i,c,t),t=h,l=c;var E=t.updateQueue;if(E===null){var v=new Set;v.add(l),t.updateQueue=v}else E.add(l);break e}else{if(!(t&1)){Pg(i,c,t),id();break e}l=Error(H(426))}}else if(he&&a.mode&1){var y=Mg(s);if(y!==null){!(y.flags&65536)&&(y.flags|=256),jg(y,s,a,i,t),mu(Eo(l,a));break e}}i=l=Eo(l,a),Ce!==4&&(Ce=2),Bi===null?Bi=[i]:Bi.push(i),i=s;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var g=Dg(i,l,t);ng(i,g);break e;case 1:a=l;var m=i.type,_=i.stateNode;if(!(i.flags&128)&&(typeof m.getDerivedStateFromError=="function"||_!==null&&typeof _.componentDidCatch=="function"&&(Hn===null||!Hn.has(_)))){i.flags|=65536,t&=-t,i.lanes|=t;var S=kg(i,a,t);ng(i,S);break e}}i=i.return}while(i!==null)}hm(n)}catch(x){t=x,Oe===n&&n!==null&&(Oe=n=n.return);continue}break}while(1)}function fm(){var e=La.current;return La.current=Ta,e===null?Ta:e}function id(){(Ce===0||Ce===3||Ce===2)&&(Ce=4),Pe===null||!(Sr&268435455)&&!(Da&268435455)||Gn(Pe,Ue)}function Fa(e,t){var n=ne;ne|=2;var r=fm();(Pe!==e||Ue!==t)&&(_n=null,Rr(e,t));do try{p1();break}catch(o){dm(e,o)}while(1);if(vu(),ne=n,La.current=r,Oe!==null)throw Error(H(261));return Pe=null,Ue=0,Ce}function p1(){for(;Oe!==null;)pm(Oe)}function h1(){for(;Oe!==null&&!FS();)pm(Oe)}function pm(e){var t=Em(e.alternate,e,gt);e.memoizedProps=e.pendingProps,t===null?hm(e):Oe=t,Xu.current=null}function hm(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=a1(n,t),n!==null){n.flags&=32767,Oe=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Ce=6,Oe=null;return}}else if(n=s1(n,t,gt),n!==null){Oe=n;return}if(t=t.sibling,t!==null){Oe=t;return}Oe=t=e}while(t!==null);Ce===0&&(Ce=5)}function Nr(e,t,n){var r=se,o=wt.transition;try{wt.transition=null,se=1,g1(e,t,n,r)}finally{wt.transition=o,se=r}return null}function g1(e,t,n,r){do So();while(zn!==null);if(ne&6)throw Error(H(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(H(177));e.callbackNode=null,e.callbackPriority=0;var i=n.lanes|n.childLanes;if(QS(e,i),e===Pe&&(Oe=Pe=null,Ue=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Pa||(Pa=!0,vm(Hs,function(){return So(),null})),i=(n.flags&15990)!==0,n.subtreeFlags&15990||i){i=wt.transition,wt.transition=null;var s=se;se=1;var a=ne;ne|=4,Xu.current=null,c1(e,n),om(n,e),Px(iu),Xs=!!ou,iu=ou=null,e.current=n,u1(n),VS(),ne=a,se=s,wt.transition=i}else e.current=n;if(Pa&&(Pa=!1,zn=e,Ma=o),i=e.pendingLanes,i===0&&(Hn=null),HS(n.stateNode),st(e,Re()),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(ka)throw ka=!1,e=Zu,Zu=null,e;return Ma&1&&e.tag!==0&&So(),i=e.pendingLanes,i&1?e===ed?Hi++:(Hi=0,ed=e):Hi=0,Fn(),null}function So(){if(zn!==null){var e=th(Ma),t=wt.transition,n=se;try{if(wt.transition=null,se=16>e?16:e,zn===null)var r=!1;else{if(e=zn,zn=null,Ma=0,ne&6)throw Error(H(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 c=a[l];for(G=c;G!==null;){var d=G;switch(d.tag){case 0:case 11:case 15:Vi(8,d,i)}var f=d.child;if(f!==null)f.return=d,G=f;else for(;G!==null;){d=G;var p=d.sibling,h=d.return;if(Zg(d),d===c){G=null;break}if(p!==null){p.return=h,G=p;break}G=h}}}var E=i.alternate;if(E!==null){var v=E.child;if(v!==null){E.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:Vi(9,i,i.return)}var g=i.sibling;if(g!==null){g.return=i.return,G=g;break e}G=i.return}}var m=e.current;for(G=m;G!==null;){s=G;var _=s.child;if(s.subtreeFlags&2064&&_!==null)_.return=s,G=_;else e:for(s=m;G!==null;){if(a=G,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:Ca(9,a)}}catch(x){Se(a,a.return,x)}if(a===s){G=null;break e}var S=a.sibling;if(S!==null){S.return=a.return,G=S;break e}G=a.return}}if(ne=o,Fn(),Qt&&typeof Qt.onPostCommitFiberRoot=="function")try{Qt.onPostCommitFiberRoot(zs,e)}catch{}r=!0}return r}finally{se=n,wt.transition=t}}return!1}function gm(e,t,n){t=Eo(n,t),t=Dg(e,t,1),e=$n(e,t,1),t=Xe(),e!==null&&(pi(e,1,t),st(e,t))}function Se(e,t,n){if(e.tag===3)gm(e,e,n);else for(;t!==null;){if(t.tag===3){gm(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Hn===null||!Hn.has(r))){e=Eo(n,e),e=kg(t,e,1),t=$n(t,e,1),e=Xe(),t!==null&&(pi(t,1,e),st(t,e));break}}t=t.return}}function m1(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Xe(),e.pingedLanes|=e.suspendedLanes&n,Pe===e&&(Ue&n)===n&&(Ce===4||Ce===3&&(Ue&130023424)===Ue&&500>Re()-Ju?Rr(e,0):qu|=n),st(e,t)}function mm(e,t){t===0&&(e.mode&1?(t=Gs,Gs<<=1,!(Gs&130023424)&&(Gs=4194304)):t=1);var n=Xe();e=En(e,t),e!==null&&(pi(e,t,n),st(e,n))}function E1(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),mm(e,n)}function v1(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(H(314))}r!==null&&r.delete(t),mm(e,n)}var Em;Em=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||nt.current)ot=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return ot=!1,i1(e,t,n);ot=!!(e.flags&131072)}else ot=!1,he&&t.flags&1048576&&Qh(t,ha,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Ia(e,t),e=t.pendingProps;var o=lo(t,Ve.current);ho(t,n),o=Cu(null,t,r,e,o,n);var i=Lu();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,rt(r)?(i=!0,da(t)):i=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,xu(t),o.updater=_a,t.stateNode=o,o._reactInternals=t,Nu(t,r,e,n),t=Vu(null,t,r,!0,i,n)):(t.tag=0,he&&i&&fu(t),Qe(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Ia(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=_1(r),e=Mt(r,e),o){case 0:t=Fu(null,t,r,e,n);break e;case 1:t=Hg(null,t,r,e,n);break e;case 11:t=Ug(null,t,r,e,n);break e;case 14:t=Fg(null,t,r,Mt(r.type,e),n);break e}throw Error(H(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Mt(r,o),Fu(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Mt(r,o),Hg(e,t,r,o,n);case 3:e:{if(zg(t),e===null)throw Error(H(387));r=t.pendingProps,i=t.memoizedState,o=i.element,tg(e,t),ya(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=Eo(Error(H(423)),t),t=Wg(e,t,r,n,o);break e}else if(r!==o){o=Eo(Error(H(424)),t),t=Wg(e,t,r,n,o);break e}else for(ht=Mn(t.stateNode.containerInfo.firstChild),pt=t,he=!0,Pt=null,n=ug(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(fo(),r===o){t=yn(e,t,n);break e}Qe(e,t,r,n)}t=t.child}return t;case 5:return dg(t),e===null&&gu(t),r=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,s=o.children,su(r,o)?s=null:i!==null&&su(r,i)&&(t.flags|=32),Bg(e,t),Qe(e,t,s,n),t.child;case 6:return e===null&&gu(t),null;case 13:return Gg(e,t,n);case 4:return wu(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=go(t,null,r,n):Qe(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Mt(r,o),Ug(e,t,r,o,n);case 7:return Qe(e,t,t.pendingProps,n),t.child;case 8:return Qe(e,t,t.pendingProps.children,n),t.child;case 12:return Qe(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,ce(ma,r._currentValue),r._currentValue=s,i!==null)if(kt(i.value,s)){if(i.children===o.children&&!nt.current){t=yn(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=vn(-1,n&-n),l.tag=2;var c=i.updateQueue;if(c!==null){c=c.shared;var d=c.pending;d===null?l.next=l:(l.next=d.next,d.next=l),c.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(H(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}Qe(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,ho(t,n),o=Rt(o),r=r(o),t.flags|=1,Qe(e,t,r,n),t.child;case 14:return r=t.type,o=Mt(r,t.pendingProps),o=Mt(r.type,o),Fg(e,t,r,o,n);case 15:return Vg(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Mt(r,o),Ia(e,t),t.tag=1,rt(r)?(e=!0,da(t)):e=!1,ho(t,n),sg(t,r,o),Nu(t,r,o,n),Vu(null,t,r,!0,e,n);case 19:return Kg(e,t,n);case 22:return $g(e,t,n)}throw Error(H(156,t.tag))};function vm(e,t){return Xp(e,t)}function y1(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 Ot(e,t,n,r){return new y1(e,t,n,r)}function sd(e){return e=e.prototype,!(!e||!e.isReactComponent)}function _1(e){if(typeof e=="function")return sd(e)?1:0;if(e!=null){if(e=e.$$typeof,e===fc)return 11;if(e===gc)return 14}return 2}function Yn(e,t){var n=e.alternate;return n===null?(n=Ot(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 Va(e,t,n,r,o,i){var s=2;if(r=e,typeof e=="function")sd(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case Qr:return wr(n.children,o,i,t);case uc:s=8,o|=8;break;case dc:return e=Ot(12,n,t,o|2),e.elementType=dc,e.lanes=i,e;case pc:return e=Ot(13,n,t,o),e.elementType=pc,e.lanes=i,e;case hc:return e=Ot(19,n,t,o),e.elementType=hc,e.lanes=i,e;case Op:return $a(n,o,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Np:s=10;break e;case wp:s=9;break e;case fc:s=11;break e;case gc:s=14;break e;case An:s=16,r=null;break e}throw Error(H(130,e==null?e:typeof e,""))}return t=Ot(s,n,t,o),t.elementType=e,t.type=r,t.lanes=i,t}function wr(e,t,n,r){return e=Ot(7,e,r,t),e.lanes=n,e}function $a(e,t,n,r){return e=Ot(22,e,r,t),e.elementType=Op,e.lanes=n,e.stateNode={isHidden:!1},e}function ad(e,t,n){return e=Ot(6,e,null,t),e.lanes=n,e}function ld(e,t,n){return t=Ot(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function S1(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=Pc(0),this.expirationTimes=Pc(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Pc(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function cd(e,t,n,r,o,i,s,a,l){return e=new S1(e,t,n,a,l),t===1?(t=1,i===!0&&(t|=8)):t=0,i=Ot(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},xu(i),e}function x1(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Kr,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function ym(e){if(!e)return Un;e=e._reactInternals;e:{if(pr(e)!==e||e.tag!==1)throw Error(H(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(rt(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(H(171))}if(e.tag===1){var n=e.type;if(rt(n))return Gh(e,n,t)}return t}function _m(e,t,n,r,o,i,s,a,l){return e=cd(n,r,!0,e,o,i,s,a,l),e.context=ym(null),n=e.current,r=Xe(),o=Wn(n),i=vn(r,o),i.callback=t??null,$n(n,i,o),e.current.lanes=o,pi(e,o,r),st(e,r),e}function Ba(e,t,n,r){var o=t.current,i=Xe(),s=Wn(o);return n=ym(n),t.context===null?t.context=n:t.pendingContext=n,t=vn(i,s),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=$n(o,t,s),e!==null&&(Ft(e,o,s,i),va(e,o,s)),s}function Ha(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 Sm(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ud(e,t){Sm(e,t),(e=e.alternate)&&Sm(e,t)}function R1(){return null}var xm=typeof reportError=="function"?reportError:function(e){console.error(e)};function dd(e){this._internalRoot=e}za.prototype.render=dd.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(H(409));Ba(e,t,null,null)},za.prototype.unmount=dd.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;xr(function(){Ba(null,e,null,null)}),t[pn]=null}};function za(e){this._internalRoot=e}za.prototype.unstable_scheduleHydration=function(e){if(e){var t=oh();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Dn.length&&t!==0&&t<Dn[n].priority;n++);Dn.splice(n,0,e),n===0&&ah(e)}};function fd(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Wa(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Rm(){}function N1(e,t,n,r,o){if(o){if(typeof r=="function"){var i=r;r=function(){var c=Ha(s);i.call(c)}}var s=_m(t,r,e,0,null,!1,!1,"",Rm);return e._reactRootContainer=s,e[pn]=s.current,Ti(e.nodeType===8?e.parentNode:e),xr(),s}for(;o=e.lastChild;)e.removeChild(o);if(typeof r=="function"){var a=r;r=function(){var c=Ha(l);a.call(c)}}var l=cd(e,0,!1,null,null,!1,!1,"",Rm);return e._reactRootContainer=l,e[pn]=l.current,Ti(e.nodeType===8?e.parentNode:e),xr(function(){Ba(t,l,n,r)}),l}function Ga(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=Ha(s);a.call(l)}}Ba(t,s,e,o)}else s=N1(n,t,e,o,r);return Ha(s)}nh=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=fi(t.pendingLanes);n!==0&&(Mc(t,n|1),st(t,Re()),!(ne&6)&&(_o=Re()+500,Fn()))}break;case 13:xr(function(){var r=En(e,1);if(r!==null){var o=Xe();Ft(r,e,1,o)}}),ud(e,1)}},jc=function(e){if(e.tag===13){var t=En(e,134217728);if(t!==null){var n=Xe();Ft(t,e,134217728,n)}ud(e,134217728)}},rh=function(e){if(e.tag===13){var t=Wn(e),n=En(e,t);if(n!==null){var r=Xe();Ft(n,e,t,r)}ud(e,t)}},oh=function(){return se},ih=function(e,t){var n=se;try{return se=e,t()}finally{se=n}},Ic=function(e,t,n){switch(t){case"input":if(Sc(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=ca(r);if(!o)throw Error(H(90));Ip(r),Sc(r,o)}}}break;case"textarea":kp(e,n);break;case"select":t=n.value,t!=null&&Xr(e,!!n.multiple,t,!1)}},Hp=rd,zp=xr;var w1={usingClientEntryPoint:!1,Events:[bi,so,ca,$p,Bp,rd]},zi={findFiberByHostInstance:hr,bundleType:0,version:"18.2.0",rendererPackageName:"react-dom"},O1={bundleType:zi.bundleType,version:zi.version,rendererPackageName:zi.rendererPackageName,rendererConfig:zi.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:fn.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Kp(e),e===null?null:e.stateNode},findFiberByHostInstance:zi.findFiberByHostInstance||R1,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 Ya=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ya.isDisabled&&Ya.supportsFiber)try{zs=Ya.inject(O1),Qt=Ya}catch{}}ut.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=w1,ut.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!fd(t))throw Error(H(200));return x1(e,t,null,n)},ut.createRoot=function(e,t){if(!fd(e))throw Error(H(299));var n=!1,r="",o=xm;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=cd(e,1,!1,null,null,n,!1,r,o),e[pn]=t.current,Ti(e.nodeType===8?e.parentNode:e),new dd(t)},ut.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(H(188)):(e=Object.keys(e).join(","),Error(H(268,e)));return e=Kp(t),e=e===null?null:e.stateNode,e},ut.flushSync=function(e){return xr(e)},ut.hydrate=function(e,t,n){if(!Wa(t))throw Error(H(200));return Ga(null,e,t,!0,n)},ut.hydrateRoot=function(e,t,n){if(!fd(e))throw Error(H(405));var r=n!=null&&n.hydratedSources||null,o=!1,i="",s=xm;if(n!=null&&(n.unstable_strictMode===!0&&(o=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(s=n.onRecoverableError)),t=_m(t,null,e,1,n??null,o,!1,i,s),e[pn]=t.current,Ti(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 za(t)},ut.render=function(e,t,n){if(!Wa(t))throw Error(H(200));return Ga(null,e,t,!1,n)},ut.unmountComponentAtNode=function(e){if(!Wa(e))throw Error(H(40));return e._reactRootContainer?(xr(function(){Ga(null,null,e,!1,function(){e._reactRootContainer=null,e[pn]=null})}),!0):!1},ut.unstable_batchedUpdates=rd,ut.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Wa(n))throw Error(H(200));if(e==null||e._reactInternals===void 0)throw Error(H(38));return Ga(e,t,n,!1,r)},ut.version="18.2.0-next-9e3b772b8-20220608";function Nm(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Nm)}catch(e){console.error(e)}}Nm(),Ep.exports=ut;var xo=Ep.exports,wm=xo;ic.createRoot=wm.createRoot,ic.hydrateRoot=wm.hydrateRoot;function qe(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=qe(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var Om={exports:{}},Tm={},Am={exports:{}},Im={};/**
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 Ro=N;function A1(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var I1=typeof Object.is=="function"?Object.is:A1,b1=Ro.useState,C1=Ro.useEffect,L1=Ro.useLayoutEffect,D1=Ro.useDebugValue;function k1(e,t){var n=t(),r=b1({inst:{value:n,getSnapshot:t}}),o=r[0].inst,i=r[1];return L1(function(){o.value=n,o.getSnapshot=t,dd(o)&&i({inst:o})},[e,n,t]),C1(function(){return dd(o)&&i({inst:o}),e(function(){dd(o)&&i({inst:o})})},[e]),D1(n),n}function dd(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!I1(e,n)}catch{return!0}}function P1(e,t){return t()}var M1=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?P1:k1;Im.useSyncExternalStore=Ro.useSyncExternalStore!==void 0?Ro.useSyncExternalStore:M1,Am.exports=Im;var j1=Am.exports;/**
52
+ */var Ro=w;function T1(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var A1=typeof Object.is=="function"?Object.is:T1,I1=Ro.useState,b1=Ro.useEffect,C1=Ro.useLayoutEffect,L1=Ro.useDebugValue;function D1(e,t){var n=t(),r=I1({inst:{value:n,getSnapshot:t}}),o=r[0].inst,i=r[1];return C1(function(){o.value=n,o.getSnapshot=t,pd(o)&&i({inst:o})},[e,n,t]),b1(function(){return pd(o)&&i({inst:o}),e(function(){pd(o)&&i({inst:o})})},[e]),L1(n),n}function pd(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!A1(e,n)}catch{return!0}}function k1(e,t){return t()}var P1=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?k1:D1;Im.useSyncExternalStore=Ro.useSyncExternalStore!==void 0?Ro.useSyncExternalStore:P1,Am.exports=Im;var M1=Am.exports;/**
53
53
  * @license React
54
54
  * use-sync-external-store-shim/with-selector.production.min.js
55
55
  *
@@ -57,19 +57,19 @@ 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 Ga=N,U1=j1;function F1(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var V1=typeof Object.is=="function"?Object.is:F1,$1=U1.useSyncExternalStore,B1=Ga.useRef,H1=Ga.useEffect,z1=Ga.useMemo,W1=Ga.useDebugValue;Tm.useSyncExternalStoreWithSelector=function(e,t,n,r,o){var i=B1(null);if(i.current===null){var s={hasValue:!1,value:null};i.current=s}else s=i.current;i=z1(function(){function l(h){if(!c){if(c=!0,d=h,h=r(h),o!==void 0&&s.hasValue){var v=s.value;if(o(v,h))return f=v}return f=h}if(v=f,V1(d,h))return v;var E=r(h);return o!==void 0&&o(v,E)?v:(d=h,f=E)}var c=!1,d,f,p=n===void 0?null:n;return[function(){return l(t())},p===null?void 0:function(){return l(p())}]},[t,n,r,o]);var a=$1(e,i[0],i[1]);return H1(function(){s.hasValue=!0,s.value=a},[a]),W1(a),a},Om.exports=Tm;var G1=Om.exports;const bm=Wl(G1),Cm=e=>{let t;const n=new Set,r=(l,c)=>{const d=typeof l=="function"?l(t):l;if(!Object.is(d,t)){const f=t;t=c??typeof d!="object"?d:Object.assign({},t,d),n.forEach(p=>p(t,f))}},o=()=>t,a={setState:r,getState:o,subscribe:l=>(n.add(l),()=>n.delete(l)),destroy:()=>{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},Lm=e=>e?Cm(e):Cm,{useSyncExternalStoreWithSelector:Y1}=bm;function Dm(e,t=e.getState,n){const r=Y1(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return N.useDebugValue(r),r}const km=(e,t)=>{const n=Lm(e),r=(o,i=t)=>Dm(n,o,i);return Object.assign(r,n),r},K1=(e,t)=>e?km(e,t):km;function He(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 Q1={value:()=>{}};function Ya(){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 Ka(n)}function Ka(e){this._=e}function X1(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}})}Ka.prototype=Ya.prototype={constructor:Ka,on:function(e,t){var n=this._,r=X1(e+"",n),o,i=-1,s=r.length;if(arguments.length<2){for(;++i<s;)if((o=(e=r[i]).type)&&(o=q1(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]=Pm(n[o],e.name,t);else if(t==null)for(o in n)n[o]=Pm(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 Ka(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 q1(e,t){for(var n=0,r=e.length,o;n<r;++n)if((o=e[n]).name===t)return o.value}function Pm(e,t,n){for(var r=0,o=e.length;r<o;++r)if(e[r].name===t){e[r]=Q1,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var fd="http://www.w3.org/1999/xhtml";const Mm={svg:"http://www.w3.org/2000/svg",xhtml:fd,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Qa(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),Mm.hasOwnProperty(t)?{space:Mm[t],local:e}:e}function J1(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===fd&&t.documentElement.namespaceURI===fd?t.createElement(e):t.createElementNS(n,e)}}function Z1(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function jm(e){var t=Qa(e);return(t.local?Z1:J1)(t)}function eR(){}function pd(e){return e==null?eR:function(){return this.querySelector(e)}}function tR(e){typeof e!="function"&&(e=pd(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,c,d=0;d<s;++d)(l=i[d])&&(c=e.call(l,l.__data__,d,i))&&("__data__"in l&&(c.__data__=l.__data__),a[d]=c);return new gt(r,this._parents)}function nR(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function rR(){return[]}function Um(e){return e==null?rR:function(){return this.querySelectorAll(e)}}function oR(e){return function(){return nR(e.apply(this,arguments))}}function iR(e){typeof e=="function"?e=oR(e):e=Um(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,c=0;c<a;++c)(l=s[c])&&(r.push(e.call(l,l.__data__,c,s)),o.push(l));return new gt(r,o)}function Fm(e){return function(){return this.matches(e)}}function Vm(e){return function(t){return t.matches(e)}}var sR=Array.prototype.find;function aR(e){return function(){return sR.call(this.children,e)}}function lR(){return this.firstElementChild}function cR(e){return this.select(e==null?lR:aR(typeof e=="function"?e:Vm(e)))}var uR=Array.prototype.filter;function dR(){return Array.from(this.children)}function fR(e){return function(){return uR.call(this.children,e)}}function pR(e){return this.selectAll(e==null?dR:fR(typeof e=="function"?e:Vm(e)))}function hR(e){typeof e!="function"&&(e=Fm(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,c=0;c<s;++c)(l=i[c])&&e.call(l,l.__data__,c,i)&&a.push(l);return new gt(r,this._parents)}function $m(e){return new Array(e.length)}function gR(){return new gt(this._enter||this._groups.map($m),this._parents)}function Xa(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Xa.prototype={constructor:Xa,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 mR(e){return function(){return e}}function vR(e,t,n,r,o,i){for(var s=0,a,l=t.length,c=i.length;s<c;++s)(a=t[s])?(a.__data__=i[s],r[s]=a):n[s]=new Xa(e,i[s]);for(;s<l;++s)(a=t[s])&&(o[s]=a)}function ER(e,t,n,r,o,i,s){var a,l,c=new Map,d=t.length,f=i.length,p=new Array(d),h;for(a=0;a<d;++a)(l=t[a])&&(p[a]=h=s.call(l,l.__data__,a,t)+"",c.has(h)?o[a]=l:c.set(h,l));for(a=0;a<f;++a)h=s.call(e,i[a],a,i)+"",(l=c.get(h))?(r[a]=l,l.__data__=i[a],c.delete(h)):n[a]=new Xa(e,i[a]);for(a=0;a<d;++a)(l=t[a])&&c.get(p[a])===l&&(o[a]=l)}function yR(e){return e.__data__}function _R(e,t){if(!arguments.length)return Array.from(this,yR);var n=t?ER:vR,r=this._parents,o=this._groups;typeof e!="function"&&(e=mR(e));for(var i=o.length,s=new Array(i),a=new Array(i),l=new Array(i),c=0;c<i;++c){var d=r[c],f=o[c],p=f.length,h=SR(e.call(d,d&&d.__data__,c,r)),v=h.length,E=a[c]=new Array(v),y=s[c]=new Array(v),g=l[c]=new Array(p);n(d,f,E,y,g,h,t);for(var m=0,_=0,S,x;m<v;++m)if(S=E[m]){for(m>=_&&(_=m+1);!(x=y[_])&&++_<v;);S._next=x||null}}return s=new gt(s,r),s._enter=a,s._exit=l,s}function SR(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function xR(){return new gt(this._exit||this._groups.map($m),this._parents)}function RR(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 NR(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 c=n[l],d=r[l],f=c.length,p=a[l]=new Array(f),h,v=0;v<f;++v)(h=c[v]||d[v])&&(p[v]=h);for(;l<o;++l)a[l]=n[l];return new gt(a,this._parents)}function wR(){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 OR(e){e||(e=TR);function t(f,p){return f&&p?e(f.__data__,p.__data__):!f-!p}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),c,d=0;d<a;++d)(c=s[d])&&(l[d]=c);l.sort(t)}return new gt(o,this._parents).order()}function TR(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function AR(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function IR(){return Array.from(this)}function bR(){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 CR(){let e=0;for(const t of this)++e;return e}function LR(){return!this.node()}function DR(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 kR(e){return function(){this.removeAttribute(e)}}function PR(e){return function(){this.removeAttributeNS(e.space,e.local)}}function MR(e,t){return function(){this.setAttribute(e,t)}}function jR(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function UR(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function FR(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 VR(e,t){var n=Qa(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?PR:kR:typeof t=="function"?n.local?FR:UR:n.local?jR:MR)(n,t))}function Bm(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function $R(e){return function(){this.style.removeProperty(e)}}function BR(e,t,n){return function(){this.style.setProperty(e,t,n)}}function HR(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function zR(e,t,n){return arguments.length>1?this.each((t==null?$R:typeof t=="function"?HR:BR)(e,t,n??"")):No(this.node(),e)}function No(e,t){return e.style.getPropertyValue(t)||Bm(e).getComputedStyle(e,null).getPropertyValue(t)}function WR(e){return function(){delete this[e]}}function GR(e,t){return function(){this[e]=t}}function YR(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function KR(e,t){return arguments.length>1?this.each((t==null?WR:typeof t=="function"?YR:GR)(e,t)):this.node()[e]}function Hm(e){return e.trim().split(/^|\s+/)}function hd(e){return e.classList||new zm(e)}function zm(e){this._node=e,this._names=Hm(e.getAttribute("class")||"")}zm.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 Wm(e,t){for(var n=hd(e),r=-1,o=t.length;++r<o;)n.add(t[r])}function Gm(e,t){for(var n=hd(e),r=-1,o=t.length;++r<o;)n.remove(t[r])}function QR(e){return function(){Wm(this,e)}}function XR(e){return function(){Gm(this,e)}}function qR(e,t){return function(){(t.apply(this,arguments)?Wm:Gm)(this,e)}}function JR(e,t){var n=Hm(e+"");if(arguments.length<2){for(var r=hd(this.node()),o=-1,i=n.length;++o<i;)if(!r.contains(n[o]))return!1;return!0}return this.each((typeof t=="function"?qR:t?QR:XR)(n,t))}function ZR(){this.textContent=""}function eN(e){return function(){this.textContent=e}}function tN(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function nN(e){return arguments.length?this.each(e==null?ZR:(typeof e=="function"?tN:eN)(e)):this.node().textContent}function rN(){this.innerHTML=""}function oN(e){return function(){this.innerHTML=e}}function iN(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function sN(e){return arguments.length?this.each(e==null?rN:(typeof e=="function"?iN:oN)(e)):this.node().innerHTML}function aN(){this.nextSibling&&this.parentNode.appendChild(this)}function lN(){return this.each(aN)}function cN(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function uN(){return this.each(cN)}function dN(e){var t=typeof e=="function"?e:jm(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function fN(){return null}function pN(e,t){var n=typeof e=="function"?e:jm(e),r=t==null?fN:typeof t=="function"?t:pd(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function hN(){var e=this.parentNode;e&&e.removeChild(this)}function gN(){return this.each(hN)}function mN(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function vN(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function EN(e){return this.select(e?vN:mN)}function yN(e){return arguments.length?this.property("__data__",e):this.node().__data__}function _N(e){return function(t){e.call(this,t,this.__data__)}}function SN(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 xN(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 RN(e,t,n){return function(){var r=this.__on,o,i=_N(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 NN(e,t,n){var r=SN(e+""),o,i=r.length,s;if(arguments.length<2){var a=this.node().__on;if(a){for(var l=0,c=a.length,d;l<c;++l)for(o=0,d=a[l];o<i;++o)if((s=r[o]).type===d.type&&s.name===d.name)return d.value}return}for(a=t?RN:xN,o=0;o<i;++o)this.each(a(r[o],t,n));return this}function Ym(e,t,n){var r=Bm(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 wN(e,t){return function(){return Ym(this,e,t)}}function ON(e,t){return function(){return Ym(this,e,t.apply(this,arguments))}}function TN(e,t){return this.each((typeof t=="function"?ON:wN)(e,t))}function*AN(){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 Km=[null];function gt(e,t){this._groups=e,this._parents=t}function Wi(){return new gt([[document.documentElement]],Km)}function IN(){return this}gt.prototype=Wi.prototype={constructor:gt,select:tR,selectAll:iR,selectChild:cR,selectChildren:pR,filter:hR,data:_R,enter:gR,exit:xR,join:RR,merge:NR,selection:IN,order:wR,sort:OR,call:AR,nodes:IR,node:bR,size:CR,empty:LR,each:DR,attr:VR,style:zR,property:KR,classed:JR,text:nN,html:sN,raise:lN,lower:uN,append:dN,insert:pN,remove:gN,clone:EN,datum:yN,on:NN,dispatch:TN,[Symbol.iterator]:AN};function Ft(e){return typeof e=="string"?new gt([[document.querySelector(e)]],[document.documentElement]):new gt([[e]],Km)}function bN(e){let t;for(;t=e.sourceEvent;)e=t;return e}function en(e,t){if(e=bN(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 CN={passive:!1},Gi={capture:!0,passive:!1};function gd(e){e.stopImmediatePropagation()}function wo(e){e.preventDefault(),e.stopImmediatePropagation()}function Qm(e){var t=e.document.documentElement,n=Ft(e).on("dragstart.drag",wo,Gi);"onselectstart"in t?n.on("selectstart.drag",wo,Gi):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function Xm(e,t){var n=e.document.documentElement,r=Ft(e).on("dragstart.drag",null);t&&(r.on("click.drag",wo,Gi),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 qa=e=>()=>e;function md(e,{sourceEvent:t,subject:n,target:r,identifier:o,active:i,x:s,y:a,dx:l,dy:c,dispatch:d}){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:c,enumerable:!0,configurable:!0},_:{value:d}})}md.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function LN(e){return!e.ctrlKey&&!e.button}function DN(){return this.parentNode}function kN(e,t){return t??{x:e.x,y:e.y}}function PN(){return navigator.maxTouchPoints||"ontouchstart"in this}function MN(){var e=LN,t=DN,n=kN,r=PN,o={},i=Ya("start","drag","end"),s=0,a,l,c,d,f=0;function p(S){S.on("mousedown.drag",h).filter(r).on("touchstart.drag",y).on("touchmove.drag",g,CN).on("touchend.drag touchcancel.drag",m).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function h(S,x){if(!(d||!e.call(this,S,x))){var R=_(this,t.call(this,S,x),S,x,"mouse");R&&(Ft(S.view).on("mousemove.drag",v,Gi).on("mouseup.drag",E,Gi),Qm(S.view),gd(S),c=!1,a=S.clientX,l=S.clientY,R("start",S))}}function v(S){if(wo(S),!c){var x=S.clientX-a,R=S.clientY-l;c=x*x+R*R>f}o.mouse("drag",S)}function E(S){Ft(S.view).on("mousemove.drag mouseup.drag",null),Xm(S.view,c),wo(S),o.mouse("end",S)}function y(S,x){if(e.call(this,S,x)){var R=S.changedTouches,I=t.call(this,S,x),L=R.length,U,T;for(U=0;U<L;++U)(T=_(this,I,S,x,R[U].identifier,R[U]))&&(gd(S),T("start",S,R[U]))}}function g(S){var x=S.changedTouches,R=x.length,I,L;for(I=0;I<R;++I)(L=o[x[I].identifier])&&(wo(S),L("drag",S,x[I]))}function m(S){var x=S.changedTouches,R=x.length,I,L;for(d&&clearTimeout(d),d=setTimeout(function(){d=null},500),I=0;I<R;++I)(L=o[x[I].identifier])&&(gd(S),L("end",S,x[I]))}function _(S,x,R,I,L,U){var T=i.copy(),b=en(U||R,x),V,M,O;if((O=n.call(S,new md("beforestart",{sourceEvent:R,target:p,identifier:L,active:s,x:b[0],y:b[1],dx:0,dy:0,dispatch:T}),I))!=null)return V=O.x-b[0]||0,M=O.y-b[1]||0,function j(P,$,D){var C=b,k;switch(P){case"start":o[L]=j,k=s++;break;case"end":delete o[L],--s;case"drag":b=en(D||$,x),k=s;break}T.call(P,S,new md(P,{sourceEvent:$,subject:O,target:p,identifier:L,active:k,x:b[0]+V,y:b[1]+M,dx:b[0]-C[0],dy:b[1]-C[1],dispatch:T}),I)}}return p.filter=function(S){return arguments.length?(e=typeof S=="function"?S:qa(!!S),p):e},p.container=function(S){return arguments.length?(t=typeof S=="function"?S:qa(S),p):t},p.subject=function(S){return arguments.length?(n=typeof S=="function"?S:qa(S),p):n},p.touchable=function(S){return arguments.length?(r=typeof S=="function"?S:qa(!!S),p):r},p.on=function(){var S=i.on.apply(i,arguments);return S===i?p:S},p.clickDistance=function(S){return arguments.length?(f=(S=+S)*S,p):Math.sqrt(f)},p}function vd(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function qm(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Yi(){}var Ki=.7,Ja=1/Ki,Oo="\\s*([+-]?\\d+)\\s*",Qi="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",tn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",jN=/^#([0-9a-f]{3,8})$/,UN=new RegExp(`^rgb\\(${Oo},${Oo},${Oo}\\)$`),FN=new RegExp(`^rgb\\(${tn},${tn},${tn}\\)$`),VN=new RegExp(`^rgba\\(${Oo},${Oo},${Oo},${Qi}\\)$`),$N=new RegExp(`^rgba\\(${tn},${tn},${tn},${Qi}\\)$`),BN=new RegExp(`^hsl\\(${Qi},${tn},${tn}\\)$`),HN=new RegExp(`^hsla\\(${Qi},${tn},${tn},${Qi}\\)$`),Jm={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};vd(Yi,Xi,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Zm,formatHex:Zm,formatHex8:zN,formatHsl:WN,formatRgb:ev,toString:ev});function Zm(){return this.rgb().formatHex()}function zN(){return this.rgb().formatHex8()}function WN(){return iv(this).formatHsl()}function ev(){return this.rgb().formatRgb()}function Xi(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=jN.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?tv(t):n===3?new st(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Za(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Za(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=UN.exec(e))?new st(t[1],t[2],t[3],1):(t=FN.exec(e))?new st(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=VN.exec(e))?Za(t[1],t[2],t[3],t[4]):(t=$N.exec(e))?Za(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=BN.exec(e))?ov(t[1],t[2]/100,t[3]/100,1):(t=HN.exec(e))?ov(t[1],t[2]/100,t[3]/100,t[4]):Jm.hasOwnProperty(e)?tv(Jm[e]):e==="transparent"?new st(NaN,NaN,NaN,0):null}function tv(e){return new st(e>>16&255,e>>8&255,e&255,1)}function Za(e,t,n,r){return r<=0&&(e=t=n=NaN),new st(e,t,n,r)}function GN(e){return e instanceof Yi||(e=Xi(e)),e?(e=e.rgb(),new st(e.r,e.g,e.b,e.opacity)):new st}function Ed(e,t,n,r){return arguments.length===1?GN(e):new st(e,t,n,r??1)}function st(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}vd(st,Ed,qm(Yi,{brighter(e){return e=e==null?Ja:Math.pow(Ja,e),new st(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Ki:Math.pow(Ki,e),new st(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new st(Or(this.r),Or(this.g),Or(this.b),el(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:nv,formatHex:nv,formatHex8:YN,formatRgb:rv,toString:rv}));function nv(){return`#${Tr(this.r)}${Tr(this.g)}${Tr(this.b)}`}function YN(){return`#${Tr(this.r)}${Tr(this.g)}${Tr(this.b)}${Tr((isNaN(this.opacity)?1:this.opacity)*255)}`}function rv(){const e=el(this.opacity);return`${e===1?"rgb(":"rgba("}${Or(this.r)}, ${Or(this.g)}, ${Or(this.b)}${e===1?")":`, ${e})`}`}function el(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Or(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Tr(e){return e=Or(e),(e<16?"0":"")+e.toString(16)}function ov(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Vt(e,t,n,r)}function iv(e){if(e instanceof Vt)return new Vt(e.h,e.s,e.l,e.opacity);if(e instanceof Yi||(e=Xi(e)),!e)return new Vt;if(e instanceof Vt)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 Vt(s,a,l,e.opacity)}function KN(e,t,n,r){return arguments.length===1?iv(e):new Vt(e,t,n,r??1)}function Vt(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}vd(Vt,KN,qm(Yi,{brighter(e){return e=e==null?Ja:Math.pow(Ja,e),new Vt(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Ki:Math.pow(Ki,e),new Vt(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 st(yd(e>=240?e-240:e+120,o,r),yd(e,o,r),yd(e<120?e+240:e-120,o,r),this.opacity)},clamp(){return new Vt(sv(this.h),tl(this.s),tl(this.l),el(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=el(this.opacity);return`${e===1?"hsl(":"hsla("}${sv(this.h)}, ${tl(this.s)*100}%, ${tl(this.l)*100}%${e===1?")":`, ${e})`}`}}));function sv(e){return e=(e||0)%360,e<0?e+360:e}function tl(e){return Math.max(0,Math.min(1,e||0))}function yd(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 av=e=>()=>e;function QN(e,t){return function(n){return e+n*t}}function XN(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 qN(e){return(e=+e)==1?lv:function(t,n){return n-t?XN(t,n,e):av(isNaN(t)?n:t)}}function lv(e,t){var n=t-e;return n?QN(e,n):av(isNaN(e)?t:e)}const cv=function e(t){var n=qN(t);function r(o,i){var s=n((o=Ed(o)).r,(i=Ed(i)).r),a=n(o.g,i.g),l=n(o.b,i.b),c=lv(o.opacity,i.opacity);return function(d){return o.r=s(d),o.g=a(d),o.b=l(d),o.opacity=c(d),o+""}}return r.gamma=e,r}(1);function Kn(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}var _d=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Sd=new RegExp(_d.source,"g");function JN(e){return function(){return e}}function ZN(e){return function(t){return e(t)+""}}function ew(e,t){var n=_d.lastIndex=Sd.lastIndex=0,r,o,i,s=-1,a=[],l=[];for(e=e+"",t=t+"";(r=_d.exec(e))&&(o=Sd.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:Kn(r,o)})),n=Sd.lastIndex;return n<t.length&&(i=t.slice(n),a[s]?a[s]+=i:a[++s]=i),a.length<2?l[0]?ZN(l[0].x):JN(t):(t=l.length,function(c){for(var d=0,f;d<t;++d)a[(f=l[d]).i]=f.x(c);return a.join("")})}var uv=180/Math.PI,xd={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function dv(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)*uv,skewX:Math.atan(l)*uv,scaleX:s,scaleY:a}}var nl;function tw(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?xd:dv(t.a,t.b,t.c,t.d,t.e,t.f)}function nw(e){return e==null||(nl||(nl=document.createElementNS("http://www.w3.org/2000/svg","g")),nl.setAttribute("transform",e),!(e=nl.transform.baseVal.consolidate()))?xd:(e=e.matrix,dv(e.a,e.b,e.c,e.d,e.e,e.f))}function fv(e,t,n,r){function o(c){return c.length?c.pop()+" ":""}function i(c,d,f,p,h,v){if(c!==f||d!==p){var E=h.push("translate(",null,t,null,n);v.push({i:E-4,x:Kn(c,f)},{i:E-2,x:Kn(d,p)})}else(f||p)&&h.push("translate("+f+t+p+n)}function s(c,d,f,p){c!==d?(c-d>180?d+=360:d-c>180&&(c+=360),p.push({i:f.push(o(f)+"rotate(",null,r)-2,x:Kn(c,d)})):d&&f.push(o(f)+"rotate("+d+r)}function a(c,d,f,p){c!==d?p.push({i:f.push(o(f)+"skewX(",null,r)-2,x:Kn(c,d)}):d&&f.push(o(f)+"skewX("+d+r)}function l(c,d,f,p,h,v){if(c!==f||d!==p){var E=h.push(o(h)+"scale(",null,",",null,")");v.push({i:E-4,x:Kn(c,f)},{i:E-2,x:Kn(d,p)})}else(f!==1||p!==1)&&h.push(o(h)+"scale("+f+","+p+")")}return function(c,d){var f=[],p=[];return c=e(c),d=e(d),i(c.translateX,c.translateY,d.translateX,d.translateY,f,p),s(c.rotate,d.rotate,f,p),a(c.skewX,d.skewX,f,p),l(c.scaleX,c.scaleY,d.scaleX,d.scaleY,f,p),c=d=null,function(h){for(var v=-1,E=p.length,y;++v<E;)f[(y=p[v]).i]=y.x(h);return f.join("")}}}var rw=fv(tw,"px, ","px)","deg)"),ow=fv(nw,", ",")",")"),iw=1e-12;function pv(e){return((e=Math.exp(e))+1/e)/2}function sw(e){return((e=Math.exp(e))-1/e)/2}function aw(e){return((e=Math.exp(2*e))-1)/(e+1)}const lw=function e(t,n,r){function o(i,s){var a=i[0],l=i[1],c=i[2],d=s[0],f=s[1],p=s[2],h=d-a,v=f-l,E=h*h+v*v,y,g;if(E<iw)g=Math.log(p/c)/t,y=function(I){return[a+I*h,l+I*v,c*Math.exp(t*I*g)]};else{var m=Math.sqrt(E),_=(p*p-c*c+r*E)/(2*c*n*m),S=(p*p-c*c-r*E)/(2*p*n*m),x=Math.log(Math.sqrt(_*_+1)-_),R=Math.log(Math.sqrt(S*S+1)-S);g=(R-x)/t,y=function(I){var L=I*g,U=pv(x),T=c/(n*m)*(U*aw(t*L+x)-sw(x));return[a+T*h,l+T*v,c*U/pv(t*L+x)]}}return y.duration=g*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 To=0,qi=0,Ji=0,hv=1e3,rl,Zi,ol=0,Ar=0,il=0,es=typeof performance=="object"&&performance.now?performance:Date,gv=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Rd(){return Ar||(gv(cw),Ar=es.now()+il)}function cw(){Ar=0}function sl(){this._call=this._time=this._next=null}sl.prototype=mv.prototype={constructor:sl,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Rd():+n)+(t==null?0:+t),!this._next&&Zi!==this&&(Zi?Zi._next=this:rl=this,Zi=this),this._call=e,this._time=n,Nd()},stop:function(){this._call&&(this._call=null,this._time=1/0,Nd())}};function mv(e,t,n){var r=new sl;return r.restart(e,t,n),r}function uw(){Rd(),++To;for(var e=rl,t;e;)(t=Ar-e._time)>=0&&e._call.call(void 0,t),e=e._next;--To}function vv(){Ar=(ol=es.now())+il,To=qi=0;try{uw()}finally{To=0,fw(),Ar=0}}function dw(){var e=es.now(),t=e-ol;t>hv&&(il-=t,ol=e)}function fw(){for(var e,t=rl,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:rl=n);Zi=e,Nd(r)}function Nd(e){if(!To){qi&&(qi=clearTimeout(qi));var t=e-Ar;t>24?(e<1/0&&(qi=setTimeout(vv,e-es.now()-il)),Ji&&(Ji=clearInterval(Ji))):(Ji||(ol=es.now(),Ji=setInterval(dw,hv)),To=1,gv(vv))}}function Ev(e,t,n){var r=new sl;return t=t==null?0:+t,r.restart(o=>{r.stop(),e(o+t)},t,n),r}var pw=Ya("start","end","cancel","interrupt"),hw=[],yv=0,_v=1,wd=2,al=3,Sv=4,Od=5,ll=6;function cl(e,t,n,r,o,i){var s=e.__transition;if(!s)e.__transition={};else if(n in s)return;gw(e,n,{name:t,index:r,group:o,on:pw,tween:hw,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:yv})}function Td(e,t){var n=$t(e,t);if(n.state>yv)throw new Error("too late; already scheduled");return n}function nn(e,t){var n=$t(e,t);if(n.state>al)throw new Error("too late; already running");return n}function $t(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function gw(e,t,n){var r=e.__transition,o;r[t]=n,n.timer=mv(i,0,n.time);function i(c){n.state=_v,n.timer.restart(s,n.delay,n.time),n.delay<=c&&s(c-n.delay)}function s(c){var d,f,p,h;if(n.state!==_v)return l();for(d in r)if(h=r[d],h.name===n.name){if(h.state===al)return Ev(s);h.state===Sv?(h.state=ll,h.timer.stop(),h.on.call("interrupt",e,e.__data__,h.index,h.group),delete r[d]):+d<t&&(h.state=ll,h.timer.stop(),h.on.call("cancel",e,e.__data__,h.index,h.group),delete r[d])}if(Ev(function(){n.state===al&&(n.state=Sv,n.timer.restart(a,n.delay,n.time),a(c))}),n.state=wd,n.on.call("start",e,e.__data__,n.index,n.group),n.state===wd){for(n.state=al,o=new Array(p=n.tween.length),d=0,f=-1;d<p;++d)(h=n.tween[d].value.call(e,e.__data__,n.index,n.group))&&(o[++f]=h);o.length=f+1}}function a(c){for(var d=c<n.duration?n.ease.call(null,c/n.duration):(n.timer.restart(l),n.state=Od,1),f=-1,p=o.length;++f<p;)o[f].call(e,d);n.state===Od&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){n.state=ll,n.timer.stop(),delete r[t];for(var c in r)return;delete e.__transition}}function ul(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>wd&&r.state<Od,r.state=ll,r.timer.stop(),r.on.call(o?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[s]}i&&delete e.__transition}}function mw(e){return this.each(function(){ul(this,e)})}function vw(e,t){var n,r;return function(){var o=nn(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 Ew(e,t,n){var r,o;if(typeof n!="function")throw new Error;return function(){var i=nn(this,e),s=i.tween;if(s!==r){o=(r=s).slice();for(var a={name:t,value:n},l=0,c=o.length;l<c;++l)if(o[l].name===t){o[l]=a;break}l===c&&o.push(a)}i.tween=o}}function yw(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=$t(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?vw:Ew)(n,e,t))}function Ad(e,t,n){var r=e._id;return e.each(function(){var o=nn(this,r);(o.value||(o.value={}))[t]=n.apply(this,arguments)}),function(o){return $t(o,r).value[t]}}function xv(e,t){var n;return(typeof t=="number"?Kn:t instanceof Xi?cv:(n=Xi(t))?(t=n,cv):ew)(e,t)}function _w(e){return function(){this.removeAttribute(e)}}function Sw(e){return function(){this.removeAttributeNS(e.space,e.local)}}function xw(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 Rw(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 Nw(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 ww(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 Ow(e,t){var n=Qa(e),r=n==="transform"?ow:xv;return this.attrTween(e,typeof t=="function"?(n.local?ww:Nw)(n,r,Ad(this,"attr."+e,t)):t==null?(n.local?Sw:_w)(n):(n.local?Rw:xw)(n,r,t))}function Tw(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function Aw(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function Iw(e,t){var n,r;function o(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&Aw(e,i)),n}return o._value=t,o}function bw(e,t){var n,r;function o(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&Tw(e,i)),n}return o._value=t,o}function Cw(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=Qa(e);return this.tween(n,(r.local?Iw:bw)(r,t))}function Lw(e,t){return function(){Td(this,e).delay=+t.apply(this,arguments)}}function Dw(e,t){return t=+t,function(){Td(this,e).delay=t}}function kw(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Lw:Dw)(t,e)):$t(this.node(),t).delay}function Pw(e,t){return function(){nn(this,e).duration=+t.apply(this,arguments)}}function Mw(e,t){return t=+t,function(){nn(this,e).duration=t}}function jw(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Pw:Mw)(t,e)):$t(this.node(),t).duration}function Uw(e,t){if(typeof t!="function")throw new Error;return function(){nn(this,e).ease=t}}function Fw(e){var t=this._id;return arguments.length?this.each(Uw(t,e)):$t(this.node(),t).ease}function Vw(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;nn(this,e).ease=n}}function $w(e){if(typeof e!="function")throw new Error;return this.each(Vw(this._id,e))}function Bw(e){typeof e!="function"&&(e=Fm(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,c=0;c<s;++c)(l=i[c])&&e.call(l,l.__data__,c,i)&&a.push(l);return new Sn(r,this._parents,this._name,this._id)}function Hw(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],c=n[a],d=l.length,f=s[a]=new Array(d),p,h=0;h<d;++h)(p=l[h]||c[h])&&(f[h]=p);for(;a<r;++a)s[a]=t[a];return new Sn(s,this._parents,this._name,this._id)}function zw(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 Ww(e,t,n){var r,o,i=zw(t)?Td:nn;return function(){var s=i(this,e),a=s.on;a!==r&&(o=(r=a).copy()).on(t,n),s.on=o}}function Gw(e,t){var n=this._id;return arguments.length<2?$t(this.node(),n).on.on(e):this.each(Ww(n,e,t))}function Yw(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function Kw(){return this.on("end.remove",Yw(this._id))}function Qw(e){var t=this._name,n=this._id;typeof e!="function"&&(e=pd(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,c=i[s]=new Array(l),d,f,p=0;p<l;++p)(d=a[p])&&(f=e.call(d,d.__data__,p,a))&&("__data__"in d&&(f.__data__=d.__data__),c[p]=f,cl(c[p],t,n,p,c,$t(d,n)));return new Sn(i,this._parents,t,n)}function Xw(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Um(e));for(var r=this._groups,o=r.length,i=[],s=[],a=0;a<o;++a)for(var l=r[a],c=l.length,d,f=0;f<c;++f)if(d=l[f]){for(var p=e.call(d,d.__data__,f,l),h,v=$t(d,n),E=0,y=p.length;E<y;++E)(h=p[E])&&cl(h,t,n,E,p,v);i.push(p),s.push(d)}return new Sn(i,s,t,n)}var qw=Wi.prototype.constructor;function Jw(){return new qw(this._groups,this._parents)}function Zw(e,t){var n,r,o;return function(){var i=No(this,e),s=(this.style.removeProperty(e),No(this,e));return i===s?null:i===n&&s===r?o:o=t(n=i,r=s)}}function Rv(e){return function(){this.style.removeProperty(e)}}function eO(e,t,n){var r,o=n+"",i;return function(){var s=No(this,e);return s===o?null:s===r?i:i=t(r=s,n)}}function tO(e,t,n){var r,o,i;return function(){var s=No(this,e),a=n(this),l=a+"";return a==null&&(l=a=(this.style.removeProperty(e),No(this,e))),s===l?null:s===r&&l===o?i:(o=l,i=t(r=s,a))}}function nO(e,t){var n,r,o,i="style."+t,s="end."+i,a;return function(){var l=nn(this,e),c=l.on,d=l.value[i]==null?a||(a=Rv(t)):void 0;(c!==n||o!==d)&&(r=(n=c).copy()).on(s,o=d),l.on=r}}function rO(e,t,n){var r=(e+="")=="transform"?rw:xv;return t==null?this.styleTween(e,Zw(e,r)).on("end.style."+e,Rv(e)):typeof t=="function"?this.styleTween(e,tO(e,r,Ad(this,"style."+e,t))).each(nO(this._id,e)):this.styleTween(e,eO(e,r,t),n).on("end.style."+e,null)}function oO(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function iO(e,t,n){var r,o;function i(){var s=t.apply(this,arguments);return s!==o&&(r=(o=s)&&oO(e,s,n)),r}return i._value=t,i}function sO(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,iO(e,t,n??""))}function aO(e){return function(){this.textContent=e}}function lO(e){return function(){var t=e(this);this.textContent=t??""}}function cO(e){return this.tween("text",typeof e=="function"?lO(Ad(this,"text",e)):aO(e==null?"":e+""))}function uO(e){return function(t){this.textContent=e.call(this,t)}}function dO(e){var t,n;function r(){var o=e.apply(this,arguments);return o!==n&&(t=(n=o)&&uO(o)),t}return r._value=e,r}function fO(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,dO(e))}function pO(){for(var e=this._name,t=this._id,n=Nv(),r=this._groups,o=r.length,i=0;i<o;++i)for(var s=r[i],a=s.length,l,c=0;c<a;++c)if(l=s[c]){var d=$t(l,t);cl(l,e,n,c,s,{time:d.time+d.delay+d.duration,delay:0,duration:d.duration,ease:d.ease})}return new Sn(r,this._parents,e,n)}function hO(){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 c=nn(this,r),d=c.on;d!==e&&(t=(e=d).copy(),t._.cancel.push(a),t._.interrupt.push(a),t._.end.push(l)),c.on=t}),o===0&&i()})}var gO=0;function Sn(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function Nv(){return++gO}var xn=Wi.prototype;Sn.prototype={constructor:Sn,select:Qw,selectAll:Xw,selectChild:xn.selectChild,selectChildren:xn.selectChildren,filter:Bw,merge:Hw,selection:Jw,transition:pO,call:xn.call,nodes:xn.nodes,node:xn.node,size:xn.size,empty:xn.empty,each:xn.each,on:Gw,attr:Ow,attrTween:Cw,style:rO,styleTween:sO,text:cO,textTween:fO,remove:Kw,tween:yw,delay:kw,duration:jw,ease:Fw,easeVarying:$w,end:hO,[Symbol.iterator]:xn[Symbol.iterator]};function mO(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var vO={time:null,delay:0,duration:250,ease:mO};function EO(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 yO(e){var t,n;e instanceof Sn?(t=e._id,e=e._name):(t=Nv(),(n=vO).time=Rd(),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,c=0;c<a;++c)(l=s[c])&&cl(l,e,t,c,s,n||EO(l,t));return new Sn(r,this._parents,e,t)}Wi.prototype.interrupt=mw,Wi.prototype.transition=yO;const dl=e=>()=>e;function _O(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 Rn(e,t,n){this.k=e,this.x=t,this.y=n}Rn.prototype={constructor:Rn,scale:function(e){return e===1?this:new Rn(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Rn(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 Qn=new Rn(1,0,0);Rn.prototype;function Id(e){e.stopImmediatePropagation()}function ts(e){e.preventDefault(),e.stopImmediatePropagation()}function SO(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function xO(){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 wv(){return this.__zoom||Qn}function RO(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function NO(){return navigator.maxTouchPoints||"ontouchstart"in this}function wO(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 OO(){var e=SO,t=xO,n=wO,r=RO,o=NO,i=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],a=250,l=lw,c=Ya("start","zoom","end"),d,f,p,h=500,v=150,E=0,y=10;function g(O){O.property("__zoom",wv).on("wheel.zoom",L,{passive:!1}).on("mousedown.zoom",U).on("dblclick.zoom",T).filter(o).on("touchstart.zoom",b).on("touchmove.zoom",V).on("touchend.zoom touchcancel.zoom",M).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}g.transform=function(O,j,P,$){var D=O.selection?O.selection():O;D.property("__zoom",wv),O!==D?x(O,j,P,$):D.interrupt().each(function(){R(this,arguments).event($).start().zoom(null,typeof j=="function"?j.apply(this,arguments):j).end()})},g.scaleBy=function(O,j,P,$){g.scaleTo(O,function(){var D=this.__zoom.k,C=typeof j=="function"?j.apply(this,arguments):j;return D*C},P,$)},g.scaleTo=function(O,j,P,$){g.transform(O,function(){var D=t.apply(this,arguments),C=this.__zoom,k=P==null?S(D):typeof P=="function"?P.apply(this,arguments):P,F=C.invert(k),B=typeof j=="function"?j.apply(this,arguments):j;return n(_(m(C,B),k,F),D,s)},P,$)},g.translateBy=function(O,j,P,$){g.transform(O,function(){return n(this.__zoom.translate(typeof j=="function"?j.apply(this,arguments):j,typeof P=="function"?P.apply(this,arguments):P),t.apply(this,arguments),s)},null,$)},g.translateTo=function(O,j,P,$,D){g.transform(O,function(){var C=t.apply(this,arguments),k=this.__zoom,F=$==null?S(C):typeof $=="function"?$.apply(this,arguments):$;return n(Qn.translate(F[0],F[1]).scale(k.k).translate(typeof j=="function"?-j.apply(this,arguments):-j,typeof P=="function"?-P.apply(this,arguments):-P),C,s)},$,D)};function m(O,j){return j=Math.max(i[0],Math.min(i[1],j)),j===O.k?O:new Rn(j,O.x,O.y)}function _(O,j,P){var $=j[0]-P[0]*O.k,D=j[1]-P[1]*O.k;return $===O.x&&D===O.y?O:new Rn(O.k,$,D)}function S(O){return[(+O[0][0]+ +O[1][0])/2,(+O[0][1]+ +O[1][1])/2]}function x(O,j,P,$){O.on("start.zoom",function(){R(this,arguments).event($).start()}).on("interrupt.zoom end.zoom",function(){R(this,arguments).event($).end()}).tween("zoom",function(){var D=this,C=arguments,k=R(D,C).event($),F=t.apply(D,C),B=P==null?S(F):typeof P=="function"?P.apply(D,C):P,z=Math.max(F[1][0]-F[0][0],F[1][1]-F[0][1]),W=D.__zoom,X=typeof j=="function"?j.apply(D,C):j,Q=l(W.invert(B).concat(z/W.k),X.invert(B).concat(z/X.k));return function(J){if(J===1)J=X;else{var re=Q(J),pe=z/re[2];J=new Rn(pe,B[0]-re[0]*pe,B[1]-re[1]*pe)}k.zoom(null,J)}})}function R(O,j,P){return!P&&O.__zooming||new I(O,j)}function I(O,j){this.that=O,this.args=j,this.active=0,this.sourceEvent=null,this.extent=t.apply(O,j),this.taps=0}I.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,j){return this.mouse&&O!=="mouse"&&(this.mouse[1]=j.invert(this.mouse[0])),this.touch0&&O!=="touch"&&(this.touch0[1]=j.invert(this.touch0[0])),this.touch1&&O!=="touch"&&(this.touch1[1]=j.invert(this.touch1[0])),this.that.__zoom=j,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(O){var j=Ft(this.that).datum();c.call(O,this.that,new _O(O,{sourceEvent:this.sourceEvent,target:g,type:O,transform:this.that.__zoom,dispatch:c}),j)}};function L(O,...j){if(!e.apply(this,arguments))return;var P=R(this,j).event(O),$=this.__zoom,D=Math.max(i[0],Math.min(i[1],$.k*Math.pow(2,r.apply(this,arguments)))),C=en(O);if(P.wheel)(P.mouse[0][0]!==C[0]||P.mouse[0][1]!==C[1])&&(P.mouse[1]=$.invert(P.mouse[0]=C)),clearTimeout(P.wheel);else{if($.k===D)return;P.mouse=[C,$.invert(C)],ul(this),P.start()}ts(O),P.wheel=setTimeout(k,v),P.zoom("mouse",n(_(m($,D),P.mouse[0],P.mouse[1]),P.extent,s));function k(){P.wheel=null,P.end()}}function U(O,...j){if(p||!e.apply(this,arguments))return;var P=O.currentTarget,$=R(this,j,!0).event(O),D=Ft(O.view).on("mousemove.zoom",B,!0).on("mouseup.zoom",z,!0),C=en(O,P),k=O.clientX,F=O.clientY;Qm(O.view),Id(O),$.mouse=[C,this.__zoom.invert(C)],ul(this),$.start();function B(W){if(ts(W),!$.moved){var X=W.clientX-k,Q=W.clientY-F;$.moved=X*X+Q*Q>E}$.event(W).zoom("mouse",n(_($.that.__zoom,$.mouse[0]=en(W,P),$.mouse[1]),$.extent,s))}function z(W){D.on("mousemove.zoom mouseup.zoom",null),Xm(W.view,$.moved),ts(W),$.event(W).end()}}function T(O,...j){if(e.apply(this,arguments)){var P=this.__zoom,$=en(O.changedTouches?O.changedTouches[0]:O,this),D=P.invert($),C=P.k*(O.shiftKey?.5:2),k=n(_(m(P,C),$,D),t.apply(this,j),s);ts(O),a>0?Ft(this).transition().duration(a).call(x,k,$,O):Ft(this).call(g.transform,k,$,O)}}function b(O,...j){if(e.apply(this,arguments)){var P=O.touches,$=P.length,D=R(this,j,O.changedTouches.length===$).event(O),C,k,F,B;for(Id(O),k=0;k<$;++k)F=P[k],B=en(F,this),B=[B,this.__zoom.invert(B),F.identifier],D.touch0?!D.touch1&&D.touch0[2]!==B[2]&&(D.touch1=B,D.taps=0):(D.touch0=B,C=!0,D.taps=1+!!d);d&&(d=clearTimeout(d)),C&&(D.taps<2&&(f=B[0],d=setTimeout(function(){d=null},h)),ul(this),D.start())}}function V(O,...j){if(this.__zooming){var P=R(this,j).event(O),$=O.changedTouches,D=$.length,C,k,F,B;for(ts(O),C=0;C<D;++C)k=$[C],F=en(k,this),P.touch0&&P.touch0[2]===k.identifier?P.touch0[0]=F:P.touch1&&P.touch1[2]===k.identifier&&(P.touch1[0]=F);if(k=P.that.__zoom,P.touch1){var z=P.touch0[0],W=P.touch0[1],X=P.touch1[0],Q=P.touch1[1],J=(J=X[0]-z[0])*J+(J=X[1]-z[1])*J,re=(re=Q[0]-W[0])*re+(re=Q[1]-W[1])*re;k=m(k,Math.sqrt(J/re)),F=[(z[0]+X[0])/2,(z[1]+X[1])/2],B=[(W[0]+Q[0])/2,(W[1]+Q[1])/2]}else if(P.touch0)F=P.touch0[0],B=P.touch0[1];else return;P.zoom("touch",n(_(k,F,B),P.extent,s))}}function M(O,...j){if(this.__zooming){var P=R(this,j).event(O),$=O.changedTouches,D=$.length,C,k;for(Id(O),p&&clearTimeout(p),p=setTimeout(function(){p=null},h),C=0;C<D;++C)k=$[C],P.touch0&&P.touch0[2]===k.identifier?delete P.touch0:P.touch1&&P.touch1[2]===k.identifier&&delete P.touch1;if(P.touch1&&!P.touch0&&(P.touch0=P.touch1,delete P.touch1),P.touch0)P.touch0[1]=this.__zoom.invert(P.touch0[0]);else if(P.end(),P.taps===2&&(k=en(k,this),Math.hypot(f[0]-k[0],f[1]-k[1])<y)){var F=Ft(this).on("dblclick.zoom");F&&F.apply(this,arguments)}}}return g.wheelDelta=function(O){return arguments.length?(r=typeof O=="function"?O:dl(+O),g):r},g.filter=function(O){return arguments.length?(e=typeof O=="function"?O:dl(!!O),g):e},g.touchable=function(O){return arguments.length?(o=typeof O=="function"?O:dl(!!O),g):o},g.extent=function(O){return arguments.length?(t=typeof O=="function"?O:dl([[+O[0][0],+O[0][1]],[+O[1][0],+O[1][1]]]),g):t},g.scaleExtent=function(O){return arguments.length?(i[0]=+O[0],i[1]=+O[1],g):[i[0],i[1]]},g.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],g):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},g.constrain=function(O){return arguments.length?(n=O,g):n},g.duration=function(O){return arguments.length?(a=+O,g):a},g.interpolate=function(O){return arguments.length?(l=O,g):l},g.on=function(){var O=c.on.apply(c,arguments);return O===c?g:O},g.clickDistance=function(O){return arguments.length?(E=(O=+O)*O,g):Math.sqrt(E)},g.tapDistance=function(O){return arguments.length?(y=+O,g):y},g}const fl=N.createContext(null),TO=fl.Provider,Nn={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".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`},Ov=Nn.error001();function ae(e,t){const n=N.useContext(fl);if(n===null)throw new Error(Ov);return Dm(n,e,t)}const Oe=()=>{const e=N.useContext(fl);if(e===null)throw new Error(Ov);return N.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe,destroy:e.destroy}),[e])},AO=e=>e.userSelectionActive?"none":"all";function ns({position:e,children:t,className:n,style:r,...o}){const i=ae(AO),s=`${e}`.split("-");return u.jsx("div",{className:Xe(["react-flow__panel",n,...s]),style:{...r,pointerEvents:i},...o,children:t})}function IO({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:u.jsx(ns,{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:u.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const bO=({x:e,y:t,label:n,labelStyle:r={},labelShowBg:o=!0,labelBgStyle:i={},labelBgPadding:s=[2,4],labelBgBorderRadius:a=2,children:l,className:c,...d})=>{const f=N.useRef(null),[p,h]=N.useState({x:0,y:0,width:0,height:0}),v=Xe(["react-flow__edge-textwrapper",c]);return N.useEffect(()=>{if(f.current){const E=f.current.getBBox();h({x:E.x,y:E.y,width:E.width,height:E.height})}},[n]),typeof n>"u"||!n?null:u.jsxs("g",{transform:`translate(${e-p.width/2} ${t-p.height/2})`,className:v,visibility:p.width?"visible":"hidden",...d,children:[o&&u.jsx("rect",{width:p.width+2*s[0],x:-s[0],y:-s[1],height:p.height+2*s[1],className:"react-flow__edge-textbg",style:i,rx:a,ry:a}),u.jsx("text",{className:"react-flow__edge-text",y:p.height/2,dy:"0.3em",ref:f,style:r,children:n}),l]})};var CO=N.memo(bO);const bd=e=>({width:e.offsetWidth,height:e.offsetHeight}),Ao=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Cd=(e={x:0,y:0},t)=>({x:Ao(e.x,t[0][0],t[1][0]),y:Ao(e.y,t[0][1],t[1][1])}),Tv=(e,t,n)=>e<t?Ao(Math.abs(e-t),1,50)/50:e>n?-Ao(Math.abs(e-n),1,50)/50:0,Av=(e,t)=>{const n=Tv(e.x,35,t.width-35)*20,r=Tv(e.y,35,t.height-35)*20;return[n,r]},Iv=e=>{var t;return((t=e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},LO=(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)}),Ld=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),DO=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),bv=e=>({...e.positionAbsolute||{x:0,y:0},width:e.width||0,height:e.height||0}),Dd=(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)},kO=e=>wt(e.width)&&wt(e.height)&&wt(e.x)&&wt(e.y),wt=e=>!isNaN(e)&&isFinite(e),Te=Symbol.for("internals"),Cv=["Enter"," ","Escape"],PO=(e,t)=>{},MO=e=>"nativeEvent"in e;function kd(e){var o,i;const t=MO(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 Lv=e=>"clientX"in e,Xn=(e,t)=>{var i,s;const n=Lv(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)}},pl=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0},Io=({id:e,path:t,labelX:n,labelY:r,label:o,labelStyle:i,labelShowBg:s,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:c,style:d,markerEnd:f,markerStart:p,interactionWidth:h=20})=>u.jsxs(u.Fragment,{children:[u.jsx("path",{id:e,style:d,d:t,fill:"none",className:"react-flow__edge-path",markerEnd:f,markerStart:p}),h&&u.jsx("path",{d:t,fill:"none",strokeOpacity:0,strokeWidth:h,className:"react-flow__edge-interaction"}),o&&wt(n)&&wt(r)?u.jsx(CO,{x:n,y:r,label:o,labelStyle:i,labelShowBg:s,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:c}):null]});Io.displayName="BaseEdge";function rs(e,t,n){return n===void 0?n:r=>{const o=t().edges.find(i=>i.id===e);o&&n(r,{...o})}}function Dv({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 kv({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,c=t*.125+i*.375+a*.375+r*.125,d=Math.abs(l-e),f=Math.abs(c-t);return[l,c,d,f]}var qn;(function(e){e.Strict="strict",e.Loose="loose"})(qn||(qn={}));var Ir;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Ir||(Ir={}));var os;(function(e){e.Partial="partial",e.Full="full"})(os||(os={}));var Jn;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Jn||(Jn={}));var is;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(is||(is={}));var K;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(K||(K={}));function Pv({pos:e,x1:t,y1:n,x2:r,y2:o}){return e===K.Left||e===K.Right?[.5*(t+r),n]:[t,.5*(n+o)]}function Mv({sourceX:e,sourceY:t,sourcePosition:n=K.Bottom,targetX:r,targetY:o,targetPosition:i=K.Top}){const[s,a]=Pv({pos:n,x1:e,y1:t,x2:r,y2:o}),[l,c]=Pv({pos:i,x1:r,y1:o,x2:e,y2:t}),[d,f,p,h]=kv({sourceX:e,sourceY:t,targetX:r,targetY:o,sourceControlX:s,sourceControlY:a,targetControlX:l,targetControlY:c});return[`M${e},${t} C${s},${a} ${l},${c} ${r},${o}`,d,f,p,h]}const Pd=N.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,sourcePosition:o=K.Bottom,targetPosition:i=K.Top,label:s,labelStyle:a,labelShowBg:l,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:f,style:p,markerEnd:h,markerStart:v,interactionWidth:E})=>{const[y,g,m]=Mv({sourceX:e,sourceY:t,sourcePosition:o,targetX:n,targetY:r,targetPosition:i});return u.jsx(Io,{path:y,labelX:g,labelY:m,label:s,labelStyle:a,labelShowBg:l,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:f,style:p,markerEnd:h,markerStart:v,interactionWidth:E})});Pd.displayName="SimpleBezierEdge";const jv={[K.Left]:{x:-1,y:0},[K.Right]:{x:1,y:0},[K.Top]:{x:0,y:-1},[K.Bottom]:{x:0,y:1}},jO=({source:e,sourcePosition:t=K.Bottom,target:n})=>t===K.Left||t===K.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},Uv=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function UO({source:e,sourcePosition:t=K.Bottom,target:n,targetPosition:r=K.Top,center:o,offset:i}){const s=jv[t],a=jv[r],l={x:e.x+s.x*i,y:e.y+s.y*i},c={x:n.x+a.x*i,y:n.y+a.y*i},d=jO({source:l,sourcePosition:t,target:c}),f=d.x!==0?"x":"y",p=d[f];let h=[],v,E;const y={x:0,y:0},g={x:0,y:0},[m,_,S,x]=Dv({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(s[f]*a[f]===-1){v=o.x||m,E=o.y||_;const I=[{x:v,y:l.y},{x:v,y:c.y}],L=[{x:l.x,y:E},{x:c.x,y:E}];s[f]===p?h=f==="x"?I:L:h=f==="x"?L:I}else{const I=[{x:l.x,y:c.y}],L=[{x:c.x,y:l.y}];if(f==="x"?h=s.x===p?L:I:h=s.y===p?I:L,t===r){const M=Math.abs(e[f]-n[f]);if(M<=i){const O=Math.min(i-1,i-M);s[f]===p?y[f]=(l[f]>e[f]?-1:1)*O:g[f]=(c[f]>n[f]?-1:1)*O}}if(t!==r){const M=f==="x"?"y":"x",O=s[f]===a[M],j=l[M]>c[M],P=l[M]<c[M];(s[f]===1&&(!O&&j||O&&P)||s[f]!==1&&(!O&&P||O&&j))&&(h=f==="x"?I:L)}const U={x:l.x+y.x,y:l.y+y.y},T={x:c.x+g.x,y:c.y+g.y},b=Math.max(Math.abs(U.x-h[0].x),Math.abs(T.x-h[0].x)),V=Math.max(Math.abs(U.y-h[0].y),Math.abs(T.y-h[0].y));b>=V?(v=(U.x+T.x)/2,E=h[0].y):(v=h[0].x,E=(U.y+T.y)/2)}return[[e,{x:l.x+y.x,y:l.y+y.y},...h,{x:c.x+g.x,y:c.y+g.y},n],v,E,S,x]}function FO(e,t,n,r){const o=Math.min(Uv(e,t)/2,Uv(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 c=e.x<n.x?-1:1,d=e.y<n.y?1:-1;return`L ${i+o*c},${s}Q ${i},${s} ${i},${s+o*d}`}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 ss({sourceX:e,sourceY:t,sourcePosition:n=K.Bottom,targetX:r,targetY:o,targetPosition:i=K.Top,borderRadius:s=5,centerX:a,centerY:l,offset:c=20}){const[d,f,p,h,v]=UO({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:o},targetPosition:i,center:{x:a,y:l},offset:c});return[d.reduce((y,g,m)=>{let _="";return m>0&&m<d.length-1?_=FO(d[m-1],g,d[m+1],s):_=`${m===0?"M":"L"}${g.x} ${g.y}`,y+=_,y},""),f,p,h,v]}const hl=N.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,label:o,labelStyle:i,labelShowBg:s,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:c,style:d,sourcePosition:f=K.Bottom,targetPosition:p=K.Top,markerEnd:h,markerStart:v,pathOptions:E,interactionWidth:y})=>{const[g,m,_]=ss({sourceX:e,sourceY:t,sourcePosition:f,targetX:n,targetY:r,targetPosition:p,borderRadius:E==null?void 0:E.borderRadius,offset:E==null?void 0:E.offset});return u.jsx(Io,{path:g,labelX:m,labelY:_,label:o,labelStyle:i,labelShowBg:s,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:c,style:d,markerEnd:h,markerStart:v,interactionWidth:y})});hl.displayName="SmoothStepEdge";const Md=N.memo(e=>{var t;return u.jsx(hl,{...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])})});Md.displayName="StepEdge";function VO({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[o,i,s,a]=Dv({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,o,i,s,a]}const jd=N.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,label:o,labelStyle:i,labelShowBg:s,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:c,style:d,markerEnd:f,markerStart:p,interactionWidth:h})=>{const[v,E,y]=VO({sourceX:e,sourceY:t,targetX:n,targetY:r});return u.jsx(Io,{path:v,labelX:E,labelY:y,label:o,labelStyle:i,labelShowBg:s,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:c,style:d,markerEnd:f,markerStart:p,interactionWidth:h})});jd.displayName="StraightEdge";function gl(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function Fv({pos:e,x1:t,y1:n,x2:r,y2:o,c:i}){switch(e){case K.Left:return[t-gl(t-r,i),n];case K.Right:return[t+gl(r-t,i),n];case K.Top:return[t,n-gl(n-o,i)];case K.Bottom:return[t,n+gl(o-n,i)]}}function Vv({sourceX:e,sourceY:t,sourcePosition:n=K.Bottom,targetX:r,targetY:o,targetPosition:i=K.Top,curvature:s=.25}){const[a,l]=Fv({pos:n,x1:e,y1:t,x2:r,y2:o,c:s}),[c,d]=Fv({pos:i,x1:r,y1:o,x2:e,y2:t,c:s}),[f,p,h,v]=kv({sourceX:e,sourceY:t,targetX:r,targetY:o,sourceControlX:a,sourceControlY:l,targetControlX:c,targetControlY:d});return[`M${e},${t} C${a},${l} ${c},${d} ${r},${o}`,f,p,h,v]}const ml=N.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,sourcePosition:o=K.Bottom,targetPosition:i=K.Top,label:s,labelStyle:a,labelShowBg:l,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:f,style:p,markerEnd:h,markerStart:v,pathOptions:E,interactionWidth:y})=>{const[g,m,_]=Vv({sourceX:e,sourceY:t,sourcePosition:o,targetX:n,targetY:r,targetPosition:i,curvature:E==null?void 0:E.curvature});return u.jsx(Io,{path:g,labelX:m,labelY:_,label:s,labelStyle:a,labelShowBg:l,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:f,style:p,markerEnd:h,markerStart:v,interactionWidth:y})});ml.displayName="BezierEdge";const Ud=N.createContext(null),$O=Ud.Provider;Ud.Consumer;const BO=()=>N.useContext(Ud),HO=e=>"id"in e&&"source"in e&&"target"in e,$v=({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("&")}`,zO=(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)),Bv=(e,t)=>{if(!e.source||!e.target)return t;let n;return HO(e)?n={...e}:n={...e,id:$v(e)},zO(n,t)?t:t.concat(n)},WO=(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?$v(t):o,source:t.source,target:t.target,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle};return n.filter(l=>l.id!==o).concat(a)},Hv=({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},GO=({x:e,y:t},[n,r,o])=>({x:e*o+n,y:t*o+r}),bo=(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}},Vd=(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}=bo(o,t).positionAbsolute;return LO(r,Ld({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 DO(n)},zv=(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},c=[];return e.forEach(d=>{const{width:f,height:p,selectable:h=!0,hidden:v=!1}=d;if(s&&!h||v)return!1;const{positionAbsolute:E}=bo(d,a),y={x:E.x,y:E.y,width:f||0,height:p||0},g=Dd(l,y),m=typeof f>"u"||typeof p>"u"||f===null||p===null,_=i&&g>0,S=(f||0)*(p||0);(m||_||g>=S||d.dragging)&&c.push(d)}),c},Wv=(e,t)=>{const n=e.map(r=>r.id);return t.filter(r=>n.includes(r.source)||n.includes(r.target))},Gv=(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),c=Ao(l,r,o),d=e.x+e.width/2,f=e.y+e.height/2,p=t/2-d*c,h=n/2-f*c;return[p,h,c]},br=(e,t=0)=>e.transition().duration(t);function Yv(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 YO(e,t,n,r,o,i){const{x:s,y:a}=Xn(e),c=t.elementsFromPoint(s,a).find(v=>v.classList.contains("react-flow__handle"));if(c){const v=c.getAttribute("data-nodeid");if(v){const E=$d(void 0,c),y=c.getAttribute("data-handleid"),g=i({nodeId:v,id:y,type:E});if(g)return{handle:{id:y,type:E,nodeId:v,x:n.x,y:n.y},validHandleResult:g}}}let d=[],f=1/0;if(o.forEach(v=>{const E=Math.sqrt((v.x-n.x)**2+(v.y-n.y)**2);if(E<=r){const y=i(v);E<=f&&(E<f?d=[{handle:v,validHandleResult:y}]:E===f&&d.push({handle:v,validHandleResult:y}),f=E)}}),!d.length)return{handle:null,validHandleResult:Kv()};if(d.length===1)return d[0];const p=d.some(({validHandleResult:v})=>v.isValid),h=d.some(({handle:v})=>v.type==="target");return d.find(({handle:v,validHandleResult:E})=>h?v.type==="target":p?E.isValid:!0)||d[0]}const KO={source:null,target:null,sourceHandle:null,targetHandle:null},Kv=()=>({handleDomNode:null,isValid:!1,connection:KO,endHandle:null});function Qv(e,t,n,r,o,i,s){const a=o==="target",l=s.querySelector(`.react-flow__handle[data-id="${e==null?void 0:e.nodeId}-${e==null?void 0:e.id}-${e==null?void 0:e.type}"]`),c={...Kv(),handleDomNode:l};if(l){const d=$d(void 0,l),f=l.getAttribute("data-nodeid"),p=l.getAttribute("data-handleid"),h=l.classList.contains("connectable"),v=l.classList.contains("connectableend"),E={source:a?f:n,sourceHandle:a?p:r,target:a?n:f,targetHandle:a?r:p};c.connection=E,h&&v&&(t===qn.Strict?a&&d==="source"||!a&&d==="target":f!==n||p!==r)&&(c.endHandle={nodeId:f,handleId:p,type:d},c.isValid=i(E))}return c}function QO({nodes:e,nodeId:t,handleId:n,handleType:r}){return e.reduce((o,i)=>{if(i[Te]){const{handleBounds:s}=i[Te];let a=[],l=[];s&&(a=Yv(i,s,"source",`${t}-${n}-${r}`),l=Yv(i,s,"target",`${t}-${n}-${r}`)),o.push(...a,...l)}return o},[])}function $d(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function Bd(e){e==null||e.classList.remove("valid","connecting","react-flow__handle-valid","react-flow__handle-connecting")}function XO(e,t){let n=null;return t?n="valid":e&&!t&&(n="invalid"),n}function Xv({event:e,handleId:t,nodeId:n,onConnect:r,isTarget:o,getState:i,setState:s,isValidConnection:a,edgeUpdaterType:l,onEdgeUpdateEnd:c}){const d=Iv(e.target),{connectionMode:f,domNode:p,autoPanOnConnect:h,connectionRadius:v,onConnectStart:E,panBy:y,getNodes:g,cancelConnection:m}=i();let _=0,S;const{x,y:R}=Xn(e),I=d==null?void 0:d.elementFromPoint(x,R),L=$d(l,I),U=p==null?void 0:p.getBoundingClientRect();if(!U||!L)return;let T,b=Xn(e,U),V=!1,M=null,O=!1,j=null;const P=QO({nodes:g(),nodeId:n,handleId:t,handleType:L}),$=()=>{if(!h)return;const[k,F]=Av(b,U);y({x:k,y:F}),_=requestAnimationFrame($)};s({connectionPosition:b,connectionStatus:null,connectionNodeId:n,connectionHandleId:t,connectionHandleType:L,connectionStartHandle:{nodeId:n,handleId:t,type:L},connectionEndHandle:null}),E==null||E(e,{nodeId:n,handleId:t,handleType:L});function D(k){const{transform:F}=i();b=Xn(k,U);const{handle:B,validHandleResult:z}=YO(k,d,Hv(b,F,!1,[1,1]),v,P,W=>Qv(W,f,n,t,o?"target":"source",a,d));if(S=B,V||($(),V=!0),j=z.handleDomNode,M=z.connection,O=z.isValid,s({connectionPosition:S&&O?GO({x:S.x,y:S.y},F):b,connectionStatus:XO(!!S,O),connectionEndHandle:z.endHandle}),!S&&!O&&!j)return Bd(T);M.source!==M.target&&j&&(Bd(T),T=j,j.classList.add("connecting","react-flow__handle-connecting"),j.classList.toggle("valid",O),j.classList.toggle("react-flow__handle-valid",O))}function C(k){var F,B;(S||j)&&M&&O&&(r==null||r(M)),(B=(F=i()).onConnectEnd)==null||B.call(F,k),l&&(c==null||c(k)),Bd(T),m(),cancelAnimationFrame(_),V=!1,O=!1,M=null,j=null,d.removeEventListener("mousemove",D),d.removeEventListener("mouseup",C),d.removeEventListener("touchmove",D),d.removeEventListener("touchend",C)}d.addEventListener("mousemove",D),d.addEventListener("mouseup",C),d.addEventListener("touchmove",D),d.addEventListener("touchend",C)}const qv=()=>!0,qO=e=>({connectionStartHandle:e.connectionStartHandle,connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName}),JO=(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}},Jv=N.forwardRef(({type:e="source",position:t=K.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:o=!0,isConnectableEnd:i=!0,id:s,onConnect:a,children:l,className:c,onMouseDown:d,onTouchStart:f,...p},h)=>{var U,T;const v=s||null,E=e==="target",y=Oe(),g=BO(),{connectOnClick:m,noPanClassName:_}=ae(qO,He),{connecting:S,clickConnecting:x}=ae(JO(g,v,e),He);g||(T=(U=y.getState()).onError)==null||T.call(U,"010",Nn.error010());const R=b=>{const{defaultEdgeOptions:V,onConnect:M,hasDefaultEdges:O}=y.getState(),j={...V,...b};if(O){const{edges:P,setEdges:$}=y.getState();$(Bv(j,P))}M==null||M(j),a==null||a(j)},I=b=>{if(!g)return;const V=Lv(b);o&&(V&&b.button===0||!V)&&Xv({event:b,handleId:v,nodeId:g,onConnect:R,isTarget:E,getState:y.getState,setState:y.setState,isValidConnection:n||y.getState().isValidConnection||qv}),V?d==null||d(b):f==null||f(b)},L=b=>{const{onClickConnectStart:V,onClickConnectEnd:M,connectionClickStartHandle:O,connectionMode:j,isValidConnection:P}=y.getState();if(!g||!O&&!o)return;if(!O){V==null||V(b,{nodeId:g,handleId:v,handleType:e}),y.setState({connectionClickStartHandle:{nodeId:g,type:e,handleId:v}});return}const $=Iv(b.target),D=n||P||qv,{connection:C,isValid:k}=Qv({nodeId:g,id:v,type:e},j,O.nodeId,O.handleId||null,O.type,D,$);k&&R(C),M==null||M(b),y.setState({connectionClickStartHandle:null})};return u.jsx("div",{"data-handleid":v,"data-nodeid":g,"data-handlepos":t,"data-id":`${g}-${v}-${e}`,className:Xe(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",_,c,{source:!E,target:E,connectable:r,connectablestart:o,connectableend:i,connecting:x,connectionindicator:r&&(o&&!S||i&&S)}]),onMouseDown:I,onTouchStart:I,onClick:m?L:void 0,ref:h,...p,children:l})});Jv.displayName="Handle";var Co=N.memo(Jv);const Zv=({data:e,isConnectable:t,targetPosition:n=K.Top,sourcePosition:r=K.Bottom})=>u.jsxs(u.Fragment,{children:[u.jsx(Co,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,u.jsx(Co,{type:"source",position:r,isConnectable:t})]});Zv.displayName="DefaultNode";var Hd=N.memo(Zv);const eE=({data:e,isConnectable:t,sourcePosition:n=K.Bottom})=>u.jsxs(u.Fragment,{children:[e==null?void 0:e.label,u.jsx(Co,{type:"source",position:n,isConnectable:t})]});eE.displayName="InputNode";var tE=N.memo(eE);const nE=({data:e,isConnectable:t,targetPosition:n=K.Top})=>u.jsxs(u.Fragment,{children:[u.jsx(Co,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]});nE.displayName="OutputNode";var rE=N.memo(nE);const zd=()=>null;zd.displayName="GroupNode";const ZO=e=>({selectedNodes:e.getNodes().filter(t=>t.selected),selectedEdges:e.edges.filter(t=>t.selected)}),vl=e=>e.id;function eT(e,t){return He(e.selectedNodes.map(vl),t.selectedNodes.map(vl))&&He(e.selectedEdges.map(vl),t.selectedEdges.map(vl))}const oE=N.memo(({onSelectionChange:e})=>{const t=Oe(),{selectedNodes:n,selectedEdges:r}=ae(ZO,eT);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});oE.displayName="SelectionListener";const tT=e=>!!e.onSelectionChange;function nT({onSelectionChange:e}){const t=ae(tT);return e||t?u.jsx(oE,{onSelectionChange:e}):null}const rT=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 Lo(e,t){N.useEffect(()=>{typeof e<"u"&&t(e)},[e])}function Z(e,t,n){N.useEffect(()=>{typeof t<"u"&&n({[e]:t})},[t])}const oT=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:o,onConnectStart:i,onConnectEnd:s,onClickConnectStart:a,onClickConnectEnd:l,nodesDraggable:c,nodesConnectable:d,nodesFocusable:f,edgesFocusable:p,edgesUpdatable:h,elevateNodesOnSelect:v,minZoom:E,maxZoom:y,nodeExtent:g,onNodesChange:m,onEdgesChange:_,elementsSelectable:S,connectionMode:x,snapGrid:R,snapToGrid:I,translateExtent:L,connectOnClick:U,defaultEdgeOptions:T,fitView:b,fitViewOptions:V,onNodesDelete:M,onEdgesDelete:O,onNodeDrag:j,onNodeDragStart:P,onNodeDragStop:$,onSelectionDrag:D,onSelectionDragStart:C,onSelectionDragStop:k,noPanClassName:F,nodeOrigin:B,rfId:z,autoPanOnConnect:W,autoPanOnNodeDrag:X,onError:Q,connectionRadius:J,isValidConnection:re})=>{const{setNodes:pe,setEdges:le,setDefaultNodesAndEdges:Ne,setMinZoom:Ze,setMaxZoom:vt,setTranslateExtent:ye,setNodeExtent:ge,reset:et}=ae(rT,He),q=Oe();return N.useEffect(()=>{const lr=r==null?void 0:r.map(Pr=>({...Pr,...T}));return Ne(n,lr),()=>{et()}},[]),Z("defaultEdgeOptions",T,q.setState),Z("connectionMode",x,q.setState),Z("onConnect",o,q.setState),Z("onConnectStart",i,q.setState),Z("onConnectEnd",s,q.setState),Z("onClickConnectStart",a,q.setState),Z("onClickConnectEnd",l,q.setState),Z("nodesDraggable",c,q.setState),Z("nodesConnectable",d,q.setState),Z("nodesFocusable",f,q.setState),Z("edgesFocusable",p,q.setState),Z("edgesUpdatable",h,q.setState),Z("elementsSelectable",S,q.setState),Z("elevateNodesOnSelect",v,q.setState),Z("snapToGrid",I,q.setState),Z("snapGrid",R,q.setState),Z("onNodesChange",m,q.setState),Z("onEdgesChange",_,q.setState),Z("connectOnClick",U,q.setState),Z("fitViewOnInit",b,q.setState),Z("fitViewOnInitOptions",V,q.setState),Z("onNodesDelete",M,q.setState),Z("onEdgesDelete",O,q.setState),Z("onNodeDrag",j,q.setState),Z("onNodeDragStart",P,q.setState),Z("onNodeDragStop",$,q.setState),Z("onSelectionDrag",D,q.setState),Z("onSelectionDragStart",C,q.setState),Z("onSelectionDragStop",k,q.setState),Z("noPanClassName",F,q.setState),Z("nodeOrigin",B,q.setState),Z("rfId",z,q.setState),Z("autoPanOnConnect",W,q.setState),Z("autoPanOnNodeDrag",X,q.setState),Z("onError",Q,q.setState),Z("connectionRadius",J,q.setState),Z("isValidConnection",re,q.setState),Lo(e,pe),Lo(t,le),Lo(E,Ze),Lo(y,vt),Lo(L,ye),Lo(g,ge),null},iE={display:"none"},iT={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},sE="react-flow__node-desc",aE="react-flow__edge-desc",sT="react-flow__aria-live",aT=e=>e.ariaLiveMessage;function lT({rfId:e}){const t=ae(aT);return u.jsx("div",{id:`${sT}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:iT,children:t})}function cT({rfId:e,disableKeyboardA11y:t}){return u.jsxs(u.Fragment,{children:[u.jsxs("div",{id:`${sE}-${e}`,style:iE,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."," "]}),u.jsx("div",{id:`${aE}-${e}`,style:iE,children:"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel."}),!t&&u.jsx(lT,{rfId:e})]})}const uT=typeof document<"u"?document:null;var Do=(e=null,t={target:uT})=>{const[n,r]=N.useState(!1),o=N.useRef(!1),i=N.useRef(new Set([])),[s,a]=N.useMemo(()=>{if(e!==null){const c=(Array.isArray(e)?e:[e]).filter(f=>typeof f=="string").map(f=>f.split("+")),d=c.reduce((f,p)=>f.concat(...p),[]);return[c,d]}return[[],[]]},[e]);return N.useEffect(()=>{var l,c;if(e!==null){const d=h=>{if(o.current=h.ctrlKey||h.metaKey||h.shiftKey,!o.current&&kd(h))return!1;const v=cE(h.code,a);i.current.add(h[v]),lE(s,i.current,!1)&&(h.preventDefault(),r(!0))},f=h=>{if(!o.current&&kd(h))return!1;const v=cE(h.code,a);lE(s,i.current,!0)?(r(!1),i.current.clear()):i.current.delete(h[v]),h.key==="Meta"&&i.current.clear(),o.current=!1},p=()=>{i.current.clear(),r(!1)};return(l=t==null?void 0:t.target)==null||l.addEventListener("keydown",d),(c=t==null?void 0:t.target)==null||c.addEventListener("keyup",f),window.addEventListener("blur",p),()=>{var h,v;(h=t==null?void 0:t.target)==null||h.removeEventListener("keydown",d),(v=t==null?void 0:t.target)==null||v.removeEventListener("keyup",f),window.removeEventListener("blur",p)}}},[e,r]),n};function lE(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(o=>t.has(o)))}function cE(e,t){return t.includes(e)?"code":"key"}function uE(e,t,n,r){var s,a;if(!e.parentNode)return n;const o=t.get(e.parentNode),i=bo(o,r);return uE(o,t,{x:(n.x??0)+i.x,y:(n.y??0)+i.y,z:(((s=o[Te])==null?void 0:s.z)??0)>(n.z??0)?((a=o[Te])==null?void 0:a.z)??0:n.z??0},r)}function dE(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}=uE(r,e,{...r.position,z:((o=r[Te])==null?void 0:o.z)??0},t);r.positionAbsolute={x:i,y:s},r[Te].z=a,n!=null&&n[r.id]&&(r[Te].isParent=!0)}})}function Wd(e,t,n,r){const o=new Map,i={},s=r?1e3:0;return e.forEach(a=>{var f;const l=(wt(a.zIndex)?a.zIndex:0)+(a.selected?s:0),c=t.get(a.id),d={width:c==null?void 0:c.width,height:c==null?void 0:c.height,...a,positionAbsolute:{x:a.position.x,y:a.position.y}};a.parentNode&&(d.parentNode=a.parentNode,i[a.parentNode]=!0),Object.defineProperty(d,Te,{enumerable:!1,value:{handleBounds:(f=c==null?void 0:c[Te])==null?void 0:f.handleBounds,z:l}}),o.set(a.id,d)}),dE(o,n,i),o}function fE(e,t={}){const{getNodes:n,width:r,height:o,minZoom:i,maxZoom:s,d3Zoom:a,d3Selection:l,fitViewOnInitDone:c,fitViewOnInit:d,nodeOrigin:f}=e(),p=t.initial&&!c&&d;if(a&&l&&(p||!t.initial)){const v=n().filter(y=>{var m;const g=t.includeHiddenNodes?y.width&&y.height:!y.hidden;return(m=t.nodes)!=null&&m.length?g&&t.nodes.some(_=>_.id===y.id):g}),E=v.every(y=>y.width&&y.height);if(v.length>0&&E){const y=Vd(v,f),[g,m,_]=Gv(y,r,o,t.minZoom??i,t.maxZoom??s,t.padding??.1),S=Qn.translate(g,m).scale(_);return typeof t.duration=="number"&&t.duration>0?a.transform(br(l,t.duration),S):a.transform(l,S),!0}}return!1}function dT(e,t){return e.forEach(n=>{const r=t.get(n.id);r&&t.set(r.id,{...r,[Te]:r[Te],selected:n.selected})}),new Map(t)}function fT(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:c}=n();e!=null&&e.length&&(l&&r({nodeInternals:dT(e,o)}),s==null||s(e)),t!=null&&t.length&&(c&&r({edges:fT(t,i)}),a==null||a(t))}const ko=()=>{},pT={zoomIn:ko,zoomOut:ko,zoomTo:ko,getZoom:()=>1,setViewport:ko,getViewport:()=>({x:0,y:0,zoom:1}),fitView:()=>!1,setCenter:ko,fitBounds:ko,project:e=>e,viewportInitialized:!1},hT=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection}),gT=()=>{const e=Oe(),{d3Zoom:t,d3Selection:n}=ae(hT,He);return N.useMemo(()=>n&&t?{zoomIn:o=>t.scaleBy(br(n,o==null?void 0:o.duration),1.2),zoomOut:o=>t.scaleBy(br(n,o==null?void 0:o.duration),1/1.2),zoomTo:(o,i)=>t.scaleTo(br(n,i==null?void 0:i.duration),o),getZoom:()=>e.getState().transform[2],setViewport:(o,i)=>{const[s,a,l]=e.getState().transform,c=Qn.translate(o.x??s,o.y??a).scale(o.zoom??l);t.transform(br(n,i==null?void 0:i.duration),c)},getViewport:()=>{const[o,i,s]=e.getState().transform;return{x:o,y:i,zoom:s}},fitView:o=>fE(e.getState,o),setCenter:(o,i,s)=>{const{width:a,height:l,maxZoom:c}=e.getState(),d=typeof(s==null?void 0:s.zoom)<"u"?s.zoom:c,f=a/2-o*d,p=l/2-i*d,h=Qn.translate(f,p).scale(d);t.transform(br(n,s==null?void 0:s.duration),h)},fitBounds:(o,i)=>{const{width:s,height:a,minZoom:l,maxZoom:c}=e.getState(),[d,f,p]=Gv(o,s,a,l,c,(i==null?void 0:i.padding)??.1),h=Qn.translate(d,f).scale(p);t.transform(br(n,i==null?void 0:i.duration),h)},project:o=>{const{transform:i,snapToGrid:s,snapGrid:a}=e.getState();return Hv(o,i,s,a)},viewportInitialized:!0}:pT,[t,n])};function Gd(){const e=gT(),t=Oe(),n=N.useCallback(()=>t.getState().getNodes().map(E=>({...E})),[]),r=N.useCallback(E=>t.getState().nodeInternals.get(E),[]),o=N.useCallback(()=>{const{edges:E=[]}=t.getState();return E.map(y=>({...y}))},[]),i=N.useCallback(E=>{const{edges:y=[]}=t.getState();return y.find(g=>g.id===E)},[]),s=N.useCallback(E=>{const{getNodes:y,setNodes:g,hasDefaultNodes:m,onNodesChange:_}=t.getState(),S=y(),x=typeof E=="function"?E(S):E;if(m)g(x);else if(_){const R=x.length===0?S.map(I=>({type:"remove",id:I.id})):x.map(I=>({item:I,type:"reset"}));_(R)}},[]),a=N.useCallback(E=>{const{edges:y=[],setEdges:g,hasDefaultEdges:m,onEdgesChange:_}=t.getState(),S=typeof E=="function"?E(y):E;if(m)g(S);else if(_){const x=S.length===0?y.map(R=>({type:"remove",id:R.id})):S.map(R=>({item:R,type:"reset"}));_(x)}},[]),l=N.useCallback(E=>{const y=Array.isArray(E)?E:[E],{getNodes:g,setNodes:m,hasDefaultNodes:_,onNodesChange:S}=t.getState();if(_){const R=[...g(),...y];m(R)}else if(S){const x=y.map(R=>({item:R,type:"add"}));S(x)}},[]),c=N.useCallback(E=>{const y=Array.isArray(E)?E:[E],{edges:g=[],setEdges:m,hasDefaultEdges:_,onEdgesChange:S}=t.getState();if(_)m([...g,...y]);else if(S){const x=y.map(R=>({item:R,type:"add"}));S(x)}},[]),d=N.useCallback(()=>{const{getNodes:E,edges:y=[],transform:g}=t.getState(),[m,_,S]=g;return{nodes:E().map(x=>({...x})),edges:y.map(x=>({...x})),viewport:{x:m,y:_,zoom:S}}},[]),f=N.useCallback(({nodes:E,edges:y})=>{const{nodeInternals:g,getNodes:m,edges:_,hasDefaultNodes:S,hasDefaultEdges:x,onNodesDelete:R,onEdgesDelete:I,onNodesChange:L,onEdgesChange:U}=t.getState(),T=(E||[]).map(j=>j.id),b=(y||[]).map(j=>j.id),V=m().reduce((j,P)=>{const $=!T.includes(P.id)&&P.parentNode&&j.find(C=>C.id===P.parentNode);return(typeof P.deletable=="boolean"?P.deletable:!0)&&(T.includes(P.id)||$)&&j.push(P),j},[]),M=_.filter(j=>typeof j.deletable=="boolean"?j.deletable:!0),O=M.filter(j=>b.includes(j.id));if(V||O){const j=Wv(V,M),P=[...O,...j],$=P.reduce((D,C)=>(D.includes(C.id)||D.push(C.id),D),[]);if((x||S)&&(x&&t.setState({edges:_.filter(D=>!$.includes(D.id))}),S&&(V.forEach(D=>{g.delete(D.id)}),t.setState({nodeInternals:new Map(g)}))),$.length>0&&(I==null||I(P),U&&U($.map(D=>({id:D,type:"remove"})))),V.length>0&&(R==null||R(V),L)){const D=V.map(C=>({id:C.id,type:"remove"}));L(D)}}},[]),p=N.useCallback(E=>{const y=kO(E),g=y?null:t.getState().nodeInternals.get(E.id);return[y?E:bv(g),g,y]},[]),h=N.useCallback((E,y=!0,g)=>{const[m,_,S]=p(E);return m?(g||t.getState().getNodes()).filter(x=>{if(!S&&(x.id===_.id||!x.positionAbsolute))return!1;const R=bv(x),I=Dd(R,m);return y&&I>0||I>=E.width*E.height}):[]},[]),v=N.useCallback((E,y,g=!0)=>{const[m]=p(E);if(!m)return!1;const _=Dd(m,y);return g&&_>0||_>=E.width*E.height},[]);return N.useMemo(()=>({...e,getNodes:n,getNode:r,getEdges:o,getEdge:i,setNodes:s,setEdges:a,addNodes:l,addEdges:c,toObject:d,deleteElements:f,getIntersectingNodes:h,isNodeIntersecting:v}),[e,n,r,o,i,s,a,l,c,d,f,h,v])}var mT=({deleteKeyCode:e,multiSelectionKeyCode:t})=>{const n=Oe(),{deleteElements:r}=Gd(),o=Do(e),i=Do(t);N.useEffect(()=>{if(o){const{edges:s,getNodes:a}=n.getState(),l=a().filter(d=>d.selected),c=s.filter(d=>d.selected);r({nodes:l,edges:c}),n.setState({nodesSelectionActive:!1})}},[o]),N.useEffect(()=>{n.setState({multiSelectionActive:i})},[i])};function vT(e){const t=Oe();N.useEffect(()=>{let n;const r=()=>{var i,s;if(!e.current)return;const o=bd(e.current);(o.height===0||o.width===0)&&((s=(i=t.getState()).onError)==null||s.call(i,"004",Nn.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 Yd={position:"absolute",width:"100%",height:"100%",top:0,left:0},ET=(e,t)=>e.x!==t.x||e.y!==t.y||e.zoom!==t.k,yl=e=>({x:e.x,y:e.y,zoom:e.k}),Po=(e,t)=>e.target.closest(`.${t}`),pE=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),hE=e=>{const t=e.ctrlKey&&pl()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t},yT=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection,d3ZoomHandler:e.d3ZoomHandler,userSelectionActive:e.userSelectionActive}),_T=({onMove:e,onMoveStart:t,onMoveEnd:n,onPaneContextMenu:r,zoomOnScroll:o=!0,zoomOnPinch:i=!0,panOnScroll:s=!1,panOnScrollSpeed:a=.5,panOnScrollMode:l=Ir.Free,zoomOnDoubleClick:c=!0,elementsSelectable:d,panOnDrag:f=!0,defaultViewport:p,translateExtent:h,minZoom:v,maxZoom:E,zoomActivationKeyCode:y,preventScrolling:g=!0,children:m,noWheelClassName:_,noPanClassName:S})=>{const x=N.useRef(),R=Oe(),I=N.useRef(!1),L=N.useRef(!1),U=N.useRef(null),T=N.useRef({x:0,y:0,zoom:0}),{d3Zoom:b,d3Selection:V,d3ZoomHandler:M,userSelectionActive:O}=ae(yT,He),j=Do(y),P=N.useRef(0),$=N.useRef(!1),D=N.useRef();return vT(U),N.useEffect(()=>{if(U.current){const C=U.current.getBoundingClientRect(),k=OO().scaleExtent([v,E]).translateExtent(h),F=Ft(U.current).call(k),B=Qn.translate(p.x,p.y).scale(Ao(p.zoom,v,E)),z=[[0,0],[C.width,C.height]],W=k.constrain()(B,z,h);k.transform(F,W),k.wheelDelta(hE),R.setState({d3Zoom:k,d3Selection:F,d3ZoomHandler:F.on("wheel.zoom"),transform:[W.x,W.y,W.k],domNode:U.current.closest(".react-flow")})}},[]),N.useEffect(()=>{V&&b&&(s&&!j&&!O?V.on("wheel.zoom",C=>{if(Po(C,_))return!1;C.preventDefault(),C.stopImmediatePropagation();const k=V.property("__zoom").k||1,F=pl();if(C.ctrlKey&&i&&F){const pe=en(C),le=hE(C),Ne=k*Math.pow(2,le);b.scaleTo(V,Ne,pe,C);return}const B=C.deltaMode===1?20:1;let z=l===Ir.Vertical?0:C.deltaX*B,W=l===Ir.Horizontal?0:C.deltaY*B;!F&&C.shiftKey&&l!==Ir.Vertical&&(z=C.deltaY*B,W=0),b.translateBy(V,-(z/k)*a,-(W/k)*a,{internal:!0});const X=yl(V.property("__zoom")),{onViewportChangeStart:Q,onViewportChange:J,onViewportChangeEnd:re}=R.getState();clearTimeout(D.current),$.current||($.current=!0,t==null||t(C,X),Q==null||Q(X)),$.current&&(e==null||e(C,X),J==null||J(X),D.current=setTimeout(()=>{n==null||n(C,X),re==null||re(X),$.current=!1},150))},{passive:!1}):typeof M<"u"&&V.on("wheel.zoom",function(C,k){if(!g||Po(C,_))return null;C.preventDefault(),M.call(this,C,k)},{passive:!1}))},[O,s,l,V,b,M,j,i,g,_,t,e,n]),N.useEffect(()=>{b&&b.on("start",C=>{var B,z;if(!C.sourceEvent||C.sourceEvent.internal)return null;P.current=(B=C.sourceEvent)==null?void 0:B.button;const{onViewportChangeStart:k}=R.getState(),F=yl(C.transform);I.current=!0,T.current=F,((z=C.sourceEvent)==null?void 0:z.type)==="mousedown"&&R.setState({paneDragging:!0}),k==null||k(F),t==null||t(C.sourceEvent,F)})},[b,t]),N.useEffect(()=>{b&&(O&&!I.current?b.on("zoom",null):O||b.on("zoom",C=>{var F;const{onViewportChange:k}=R.getState();if(R.setState({transform:[C.transform.x,C.transform.y,C.transform.k]}),L.current=!!(r&&pE(f,P.current??0)),(e||k)&&!((F=C.sourceEvent)!=null&&F.internal)){const B=yl(C.transform);k==null||k(B),e==null||e(C.sourceEvent,B)}}))},[O,b,e,f,r]),N.useEffect(()=>{b&&b.on("end",C=>{if(!C.sourceEvent||C.sourceEvent.internal)return null;const{onViewportChangeEnd:k}=R.getState();if(I.current=!1,R.setState({paneDragging:!1}),r&&pE(f,P.current??0)&&!L.current&&r(C.sourceEvent),L.current=!1,(n||k)&&ET(T.current,C.transform)){const F=yl(C.transform);T.current=F,clearTimeout(x.current),x.current=setTimeout(()=>{k==null||k(F),n==null||n(C.sourceEvent,F)},s?150:0)}})},[b,s,f,n,r]),N.useEffect(()=>{b&&b.filter(C=>{const k=j||o,F=i&&C.ctrlKey;if(C.button===1&&C.type==="mousedown"&&(Po(C,"react-flow__node")||Po(C,"react-flow__edge")))return!0;if(!f&&!k&&!s&&!c&&!i||O||!c&&C.type==="dblclick"||Po(C,_)&&C.type==="wheel"||Po(C,S)&&C.type!=="wheel"||!i&&C.ctrlKey&&C.type==="wheel"||!k&&!s&&!F&&C.type==="wheel"||!f&&(C.type==="mousedown"||C.type==="touchstart")||Array.isArray(f)&&!f.includes(C.button)&&(C.type==="mousedown"||C.type==="touchstart"))return!1;const B=Array.isArray(f)&&f.includes(C.button)||!C.button||C.button<=1;return(!C.ctrlKey||C.type==="wheel")&&B})},[O,b,o,i,s,c,f,d,j]),u.jsx("div",{className:"react-flow__renderer",ref:U,style:Yd,children:m})},ST=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function xT(){const{userSelectionActive:e,userSelectionRect:t}=ae(ST,He);return e&&t?u.jsx("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 gE(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 mE(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&&gE(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&&gE(r,s);break}case"remove":return r}return r.push(s),r},n)}function vE(e,t){return mE(e,t)}function RT(e,t){return mE(e,t)}const Zn=(e,t)=>({id:e,type:"select",selected:t});function Mo(e,t){return e.reduce((n,r)=>{const o=t.includes(r.id);return!r.selected&&o?(r.selected=!0,n.push(Zn(r.id,!0))):r.selected&&!o&&(r.selected=!1,n.push(Zn(r.id,!1))),n},[])}const Kd=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},NT=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging}),EE=N.memo(({isSelecting:e,selectionMode:t=os.Full,panOnDrag:n,onSelectionStart:r,onSelectionEnd:o,onPaneClick:i,onPaneContextMenu:s,onPaneScroll:a,onPaneMouseEnter:l,onPaneMouseMove:c,onPaneMouseLeave:d,children:f})=>{const p=N.useRef(null),h=Oe(),v=N.useRef(0),E=N.useRef(0),y=N.useRef(),{userSelectionActive:g,elementsSelectable:m,dragging:_}=ae(NT,He),S=()=>{h.setState({userSelectionActive:!1,userSelectionRect:null}),v.current=0,E.current=0},x=M=>{i==null||i(M),h.getState().resetSelectedElements(),h.setState({nodesSelectionActive:!1})},R=M=>{if(Array.isArray(n)&&(n!=null&&n.includes(2))){M.preventDefault();return}s==null||s(M)},I=a?M=>a(M):void 0,L=M=>{const{resetSelectedElements:O,domNode:j}=h.getState();if(y.current=j==null?void 0:j.getBoundingClientRect(),!m||!e||M.button!==0||M.target!==p.current||!y.current)return;const{x:P,y:$}=Xn(M,y.current);O(),h.setState({userSelectionRect:{width:0,height:0,startX:P,startY:$,x:P,y:$}}),r==null||r(M)},U=M=>{const{userSelectionRect:O,nodeInternals:j,edges:P,transform:$,onNodesChange:D,onEdgesChange:C,nodeOrigin:k,getNodes:F}=h.getState();if(!e||!y.current||!O)return;h.setState({userSelectionActive:!0,nodesSelectionActive:!1});const B=Xn(M,y.current),z=O.startX??0,W=O.startY??0,X={...O,x:B.x<z?B.x:z,y:B.y<W?B.y:W,width:Math.abs(B.x-z),height:Math.abs(B.y-W)},Q=F(),J=zv(j,X,$,t===os.Partial,!0,k),re=Wv(J,P).map(le=>le.id),pe=J.map(le=>le.id);if(v.current!==pe.length){v.current=pe.length;const le=Mo(Q,pe);le.length&&(D==null||D(le))}if(E.current!==re.length){E.current=re.length;const le=Mo(P,re);le.length&&(C==null||C(le))}h.setState({userSelectionRect:X})},T=M=>{if(M.button!==0)return;const{userSelectionRect:O}=h.getState();!g&&O&&M.target===p.current&&(x==null||x(M)),h.setState({nodesSelectionActive:v.current>0}),S(),o==null||o(M)},b=M=>{g&&(h.setState({nodesSelectionActive:v.current>0}),o==null||o(M)),S()},V=m&&(e||g);return u.jsxs("div",{className:Xe(["react-flow__pane",{dragging:_,selection:e}]),onClick:V?void 0:Kd(x,p),onContextMenu:Kd(R,p),onWheel:Kd(I,p),onMouseEnter:V?void 0:l,onMouseDown:V?L:void 0,onMouseMove:V?U:c,onMouseUp:V?T:void 0,onMouseLeave:V?b:d,ref:p,style:Yd,children:[f,u.jsx(xT,{})]})});EE.displayName="Pane";function yE(e,t){if(!e.parentNode)return!1;const n=t.get(e.parentNode);return n?n.selected?!0:yE(n,t):!1}function _E(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 wT(e,t,n,r){return Array.from(e.values()).filter(o=>(o.selected||o.id===r)&&(!o.parentNode||!yE(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 OT(e,t){return!t||t==="parent"?t:[t[0],[t[1][0]-(e.width||0),t[1][1]-(e.height||0)]]}function SE(e,t,n,r,o=[0,0],i){const s=OT(e,e.extent||r);let a=s;if(e.extent==="parent")if(e.parentNode&&e.width&&e.height){const d=n.get(e.parentNode),{x:f,y:p}=bo(d,o).positionAbsolute;a=d&&wt(f)&&wt(p)&&wt(d.width)&&wt(d.height)?[[f+e.width*o[0],p+e.height*o[1]],[f+d.width-e.width+e.width*o[0],p+d.height-e.height+e.height*o[1]]]:a}else i==null||i("005",Nn.error005()),a=s;else if(e.extent&&e.parentNode){const d=n.get(e.parentNode),{x:f,y:p}=bo(d,o).positionAbsolute;a=[[e.extent[0][0]+f,e.extent[0][1]+p],[e.extent[1][0]+f,e.extent[1][1]+p]]}let l={x:0,y:0};if(e.parentNode){const d=n.get(e.parentNode);l=bo(d,o).positionAbsolute}const c=a&&a!=="parent"?Cd(t,a):t;return{position:{x:c.x-l.x,y:c.y-l.y},positionAbsolute:c}}function Qd({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 xE=(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 c=l.getBoundingClientRect();return{id:l.getAttribute("data-handleid"),position:l.getAttribute("data-handlepos"),x:(c.left-s.left-a.x)/n,y:(c.top-s.top-a.y)/n,...bd(l)}})};function as(e,t,n){return n===void 0?n:r=>{const o=t().nodeInternals.get(e);o&&n(r,{...o})}}function Xd({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:o,unselectNodesAndEdges:i,multiSelectionActive:s,nodeInternals:a,onError:l}=t.getState(),c=a.get(e);if(!c){l==null||l("012",Nn.error012(e));return}t.setState({nodesSelectionActive:!1}),c.selected?(n||c.selected&&s)&&(i({nodes:[c]}),requestAnimationFrame(()=>{var d;return(d=r==null?void 0:r.current)==null?void 0:d.blur()})):o([e])}function TT(){const e=Oe();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 qd(e){return(t,n,r)=>e==null?void 0:e(t,r)}function RE({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:o,isSelectable:i,selectNodesOnDrag:s}){const a=Oe(),[l,c]=N.useState(!1),d=N.useRef([]),f=N.useRef({x:null,y:null}),p=N.useRef(0),h=N.useRef(null),v=N.useRef({x:0,y:0}),E=N.useRef(null),y=N.useRef(!1),g=TT();return N.useEffect(()=>{if(e!=null&&e.current){const m=Ft(e.current),_=({x,y:R})=>{const{nodeInternals:I,onNodeDrag:L,onSelectionDrag:U,updateNodePositions:T,nodeExtent:b,snapGrid:V,snapToGrid:M,nodeOrigin:O,onError:j}=a.getState();f.current={x,y:R};let P=!1,$={x:0,y:0,x2:0,y2:0};if(d.current.length>1&&b){const C=Vd(d.current,O);$=Ld(C)}if(d.current=d.current.map(C=>{const k={x:x-C.distance.x,y:R-C.distance.y};M&&(k.x=V[0]*Math.round(k.x/V[0]),k.y=V[1]*Math.round(k.y/V[1]));const F=[[b[0][0],b[0][1]],[b[1][0],b[1][1]]];d.current.length>1&&b&&!C.extent&&(F[0][0]=C.positionAbsolute.x-$.x+b[0][0],F[1][0]=C.positionAbsolute.x+(C.width??0)-$.x2+b[1][0],F[0][1]=C.positionAbsolute.y-$.y+b[0][1],F[1][1]=C.positionAbsolute.y+(C.height??0)-$.y2+b[1][1]);const B=SE(C,k,I,F,O,j);return P=P||C.position.x!==B.position.x||C.position.y!==B.position.y,C.position=B.position,C.positionAbsolute=B.positionAbsolute,C}),!P)return;T(d.current,!0,!0),c(!0);const D=o?L:qd(U);if(D&&E.current){const[C,k]=Qd({nodeId:o,dragItems:d.current,nodeInternals:I});D(E.current,C,k)}},S=()=>{if(!h.current)return;const[x,R]=Av(v.current,h.current);if(x!==0||R!==0){const{transform:I,panBy:L}=a.getState();f.current.x=(f.current.x??0)-x/I[2],f.current.y=(f.current.y??0)-R/I[2],L({x,y:R})&&_(f.current)}p.current=requestAnimationFrame(S)};if(t)m.on(".drag",null);else{const x=MN().on("start",R=>{var P;const{nodeInternals:I,multiSelectionActive:L,domNode:U,nodesDraggable:T,unselectNodesAndEdges:b,onNodeDragStart:V,onSelectionDragStart:M}=a.getState(),O=o?V:qd(M);!s&&!L&&o&&((P=I.get(o))!=null&&P.selected||b()),o&&i&&s&&Xd({id:o,store:a,nodeRef:e});const j=g(R);if(f.current=j,d.current=wT(I,T,j,o),O&&d.current){const[$,D]=Qd({nodeId:o,dragItems:d.current,nodeInternals:I});O(R.sourceEvent,$,D)}h.current=(U==null?void 0:U.getBoundingClientRect())||null,v.current=Xn(R.sourceEvent,h.current)}).on("drag",R=>{const I=g(R),{autoPanOnNodeDrag:L}=a.getState();!y.current&&L&&(y.current=!0,S()),(f.current.x!==I.xSnapped||f.current.y!==I.ySnapped)&&d.current&&(E.current=R.sourceEvent,v.current=Xn(R.sourceEvent,h.current),_(I))}).on("end",R=>{if(c(!1),y.current=!1,cancelAnimationFrame(p.current),d.current){const{updateNodePositions:I,nodeInternals:L,onNodeDragStop:U,onSelectionDragStop:T}=a.getState(),b=o?U:qd(T);if(I(d.current,!1,!1),b){const[V,M]=Qd({nodeId:o,dragItems:d.current,nodeInternals:L});b(R.sourceEvent,V,M)}}}).filter(R=>{const I=R.target;return!R.button&&(!n||!_E(I,`.${n}`,e))&&(!r||_E(I,r,e))});return m.call(x),()=>{m.on(".drag",null)}}}},[e,t,n,r,i,a,o,s,g]),l}function NE(){const e=Oe();return N.useCallback(n=>{const{nodeInternals:r,nodeExtent:o,updateNodePositions:i,getNodes:s,snapToGrid:a,snapGrid:l,onError:c,nodesDraggable:d}=e.getState(),f=s().filter(m=>m.selected&&(m.draggable||d&&typeof m.draggable>"u")),p=a?l[0]:5,h=a?l[1]:5,v=n.isShiftPressed?4:1,E=n.x*p*v,y=n.y*h*v,g=f.map(m=>{if(m.positionAbsolute){const _={x:m.positionAbsolute.x+E,y:m.positionAbsolute.y+y};a&&(_.x=l[0]*Math.round(_.x/l[0]),_.y=l[1]*Math.round(_.y/l[1]));const{positionAbsolute:S,position:x}=SE(m,_,r,o,void 0,c);m.position=x,m.positionAbsolute=S}return m});i(g,!0,!1)},[])}const jo={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};var ls=e=>{const t=({id:n,type:r,data:o,xPos:i,yPos:s,xPosOrigin:a,yPosOrigin:l,selected:c,onClick:d,onMouseEnter:f,onMouseMove:p,onMouseLeave:h,onContextMenu:v,onDoubleClick:E,style:y,className:g,isDraggable:m,isSelectable:_,isConnectable:S,isFocusable:x,selectNodesOnDrag:R,sourcePosition:I,targetPosition:L,hidden:U,resizeObserver:T,dragHandle:b,zIndex:V,isParent:M,noDragClassName:O,noPanClassName:j,initialized:P,disableKeyboardA11y:$,ariaLabel:D,rfId:C})=>{const k=Oe(),F=N.useRef(null),B=N.useRef(I),z=N.useRef(L),W=N.useRef(r),X=_||m||d||f||p||h,Q=NE(),J=as(n,k.getState,f),re=as(n,k.getState,p),pe=as(n,k.getState,h),le=as(n,k.getState,v),Ne=as(n,k.getState,E),Ze=ge=>{if(_&&(!R||!m)&&Xd({id:n,store:k,nodeRef:F}),d){const et=k.getState().nodeInternals.get(n);et&&d(ge,{...et})}},vt=ge=>{if(!kd(ge))if(Cv.includes(ge.key)&&_){const et=ge.key==="Escape";Xd({id:n,store:k,unselect:et,nodeRef:F})}else!$&&m&&c&&Object.prototype.hasOwnProperty.call(jo,ge.key)&&(k.setState({ariaLiveMessage:`Moved selected node ${ge.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~i}, y: ${~~s}`}),Q({x:jo[ge.key].x,y:jo[ge.key].y,isShiftPressed:ge.shiftKey}))};N.useEffect(()=>{if(F.current&&!U){const ge=F.current;return T==null||T.observe(ge),()=>T==null?void 0:T.unobserve(ge)}},[U]),N.useEffect(()=>{const ge=W.current!==r,et=B.current!==I,q=z.current!==L;F.current&&(ge||et||q)&&(ge&&(W.current=r),et&&(B.current=I),q&&(z.current=L),k.getState().updateNodeDimensions([{id:n,nodeElement:F.current,forceUpdate:!0}]))},[n,r,I,L]);const ye=RE({nodeRef:F,disabled:U||!m,noDragClassName:O,handleSelector:b,nodeId:n,isSelectable:_,selectNodesOnDrag:R});return U?null:u.jsx("div",{className:Xe(["react-flow__node",`react-flow__node-${r}`,{[j]:m},g,{selected:c,selectable:_,parent:M,dragging:ye}]),ref:F,style:{zIndex:V,transform:`translate(${a}px,${l}px)`,pointerEvents:X?"all":"none",visibility:P?"visible":"hidden",...y},"data-id":n,"data-testid":`rf__node-${n}`,onMouseEnter:J,onMouseMove:re,onMouseLeave:pe,onContextMenu:le,onClick:Ze,onDoubleClick:Ne,onKeyDown:x?vt:void 0,tabIndex:x?0:void 0,role:x?"button":void 0,"aria-describedby":$?void 0:`${sE}-${C}`,"aria-label":D,children:u.jsx($O,{value:n,children:u.jsx(e,{id:n,data:o,type:r,xPos:i,yPos:s,selected:c,isConnectable:S,sourcePosition:I,targetPosition:L,dragging:ye,dragHandle:b,zIndex:V})})})};return t.displayName="NodeWrapper",N.memo(t)};const AT=e=>{const t=e.getNodes().filter(n=>n.selected);return{...Vd(t,e.nodeOrigin),transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`,userSelectionActive:e.userSelectionActive}};function IT({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=Oe(),{width:o,height:i,x:s,y:a,transformString:l,userSelectionActive:c}=ae(AT,He),d=NE(),f=N.useRef(null);if(N.useEffect(()=>{var v;n||(v=f.current)==null||v.focus({preventScroll:!0})},[n]),RE({nodeRef:f}),c||!o||!i)return null;const p=e?v=>{const E=r.getState().getNodes().filter(y=>y.selected);e(v,E)}:void 0,h=v=>{Object.prototype.hasOwnProperty.call(jo,v.key)&&d({x:jo[v.key].x,y:jo[v.key].y,isShiftPressed:v.shiftKey})};return u.jsx("div",{className:Xe(["react-flow__nodesselection","react-flow__container",t]),style:{transform:l},children:u.jsx("div",{ref:f,className:"react-flow__nodesselection-rect",onContextMenu:p,tabIndex:n?void 0:-1,onKeyDown:n?void 0:h,style:{width:o,height:i,top:a,left:s}})})}var bT=N.memo(IT);const CT=e=>e.nodesSelectionActive,wE=({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:o,onPaneContextMenu:i,onPaneScroll:s,deleteKeyCode:a,onMove:l,onMoveStart:c,onMoveEnd:d,selectionKeyCode:f,selectionOnDrag:p,selectionMode:h,onSelectionStart:v,onSelectionEnd:E,multiSelectionKeyCode:y,panActivationKeyCode:g,zoomActivationKeyCode:m,elementsSelectable:_,zoomOnScroll:S,zoomOnPinch:x,panOnScroll:R,panOnScrollSpeed:I,panOnScrollMode:L,zoomOnDoubleClick:U,panOnDrag:T,defaultViewport:b,translateExtent:V,minZoom:M,maxZoom:O,preventScrolling:j,onSelectionContextMenu:P,noWheelClassName:$,noPanClassName:D,disableKeyboardA11y:C})=>{const k=ae(CT),F=Do(f),z=Do(g)||T,W=F||p&&z!==!0;return mT({deleteKeyCode:a,multiSelectionKeyCode:y}),u.jsx(_T,{onMove:l,onMoveStart:c,onMoveEnd:d,onPaneContextMenu:i,elementsSelectable:_,zoomOnScroll:S,zoomOnPinch:x,panOnScroll:R,panOnScrollSpeed:I,panOnScrollMode:L,zoomOnDoubleClick:U,panOnDrag:!F&&z,defaultViewport:b,translateExtent:V,minZoom:M,maxZoom:O,zoomActivationKeyCode:m,preventScrolling:j,noWheelClassName:$,noPanClassName:D,children:u.jsxs(EE,{onSelectionStart:v,onSelectionEnd:E,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:o,onPaneContextMenu:i,onPaneScroll:s,panOnDrag:z,isSelecting:!!W,selectionMode:h,children:[e,k&&u.jsx(bT,{onSelectionContextMenu:P,noPanClassName:D,disableKeyboardA11y:C})]})})};wE.displayName="FlowRenderer";var LT=N.memo(wE);function DT(e){return ae(N.useCallback(n=>e?zv(n.nodeInternals,{x:0,y:0,width:n.width,height:n.height},n.transform,!0):n.getNodes(),[e]))}function kT(e){const t={input:ls(e.input||tE),default:ls(e.default||Hd),output:ls(e.output||rE),group:ls(e.group||zd)},n={},r=Object.keys(e).filter(o=>!["input","default","output","group"].includes(o)).reduce((o,i)=>(o[i]=ls(e[i]||Hd),o),n);return{...t,...r}}const PT=({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]},MT=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,updateNodeDimensions:e.updateNodeDimensions,onError:e.onError}),OE=e=>{const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:o,updateNodeDimensions:i,onError:s}=ae(MT,He),a=DT(e.onlyRenderVisibleElements),l=N.useRef(),c=N.useMemo(()=>{if(typeof ResizeObserver>"u")return null;const d=new ResizeObserver(f=>{const p=f.map(h=>({id:h.target.getAttribute("data-id"),nodeElement:h.target,forceUpdate:!0}));i(p)});return l.current=d,d},[]);return N.useEffect(()=>()=>{var d;(d=l==null?void 0:l.current)==null||d.disconnect()},[]),u.jsx("div",{className:"react-flow__nodes",style:Yd,children:a.map(d=>{var x,R;let f=d.type||"default";e.nodeTypes[f]||(s==null||s("003",Nn.error003(f)),f="default");const p=e.nodeTypes[f]||e.nodeTypes.default,h=!!(d.draggable||t&&typeof d.draggable>"u"),v=!!(d.selectable||o&&typeof d.selectable>"u"),E=!!(d.connectable||n&&typeof d.connectable>"u"),y=!!(d.focusable||r&&typeof d.focusable>"u"),g=e.nodeExtent?Cd(d.positionAbsolute,e.nodeExtent):d.positionAbsolute,m=(g==null?void 0:g.x)??0,_=(g==null?void 0:g.y)??0,S=PT({x:m,y:_,width:d.width??0,height:d.height??0,origin:e.nodeOrigin});return u.jsx(p,{id:d.id,className:d.className,style:d.style,type:f,data:d.data,sourcePosition:d.sourcePosition||K.Bottom,targetPosition:d.targetPosition||K.Top,hidden:d.hidden,xPos:m,yPos:_,xPosOrigin:S.x,yPosOrigin:S.y,selectNodesOnDrag:e.selectNodesOnDrag,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,selected:!!d.selected,isDraggable:h,isSelectable:v,isConnectable:E,isFocusable:y,resizeObserver:c,dragHandle:d.dragHandle,zIndex:((x=d[Te])==null?void 0:x.z)??0,isParent:!!((R=d[Te])!=null&&R.isParent),noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,initialized:!!d.width&&!!d.height,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,ariaLabel:d.ariaLabel},d.id)})})};OE.displayName="NodeRenderer";var jT=N.memo(OE);const UT=(e,t,n)=>n===K.Left?e-t:n===K.Right?e+t:e,FT=(e,t,n)=>n===K.Top?e-t:n===K.Bottom?e+t:e,TE="react-flow__edgeupdater",AE=({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:o,onMouseEnter:i,onMouseOut:s,type:a})=>u.jsx("circle",{onMouseDown:o,onMouseEnter:i,onMouseOut:s,className:Xe([TE,`${TE}-${a}`]),cx:UT(t,r,e),cy:FT(n,r,e),r,stroke:"transparent",fill:"transparent"}),VT=()=>!0;var Uo=e=>{const t=({id:n,className:r,type:o,data:i,onClick:s,onEdgeDoubleClick:a,selected:l,animated:c,label:d,labelStyle:f,labelShowBg:p,labelBgStyle:h,labelBgPadding:v,labelBgBorderRadius:E,style:y,source:g,target:m,sourceX:_,sourceY:S,targetX:x,targetY:R,sourcePosition:I,targetPosition:L,elementsSelectable:U,hidden:T,sourceHandleId:b,targetHandleId:V,onContextMenu:M,onMouseEnter:O,onMouseMove:j,onMouseLeave:P,edgeUpdaterRadius:$,onEdgeUpdate:D,onEdgeUpdateStart:C,onEdgeUpdateEnd:k,markerEnd:F,markerStart:B,rfId:z,ariaLabel:W,isFocusable:X,isUpdatable:Q,pathOptions:J,interactionWidth:re})=>{const pe=N.useRef(null),[le,Ne]=N.useState(!1),[Ze,vt]=N.useState(!1),ye=Oe(),ge=N.useMemo(()=>`url(#${Fd(B,z)})`,[B,z]),et=N.useMemo(()=>`url(#${Fd(F,z)})`,[F,z]);if(T)return null;const q=We=>{const{edges:Et,addSelectedEdges:Ur}=ye.getState();if(U&&(ye.setState({nodesSelectionActive:!1}),Ur([n])),s){const Fr=Et.find(Vr=>Vr.id===n);s(We,Fr)}},lr=rs(n,ye.getState,a),Pr=rs(n,ye.getState,M),Os=rs(n,ye.getState,O),Ts=rs(n,ye.getState,j),qo=rs(n,ye.getState,P),Mr=(We,Et)=>{if(We.button!==0)return;const{edges:Ur,isValidConnection:Fr}=ye.getState(),Vr=Et?m:g,zl=(Et?V:b)||null,$r=Et?"target":"source",Gf=Fr||VT,Yf=Et,Is=Ur.find(Br=>Br.id===n);vt(!0),C==null||C(We,Is,$r);const Kf=Br=>{vt(!1),k==null||k(Br,Is,$r)};Xv({event:We,handleId:zl,nodeId:Vr,onConnect:Br=>D==null?void 0:D(Is,Br),isTarget:Yf,getState:ye.getState,setState:ye.setState,isValidConnection:Gf,edgeUpdaterType:$r,onEdgeUpdateEnd:Kf})},cr=We=>Mr(We,!0),Jo=We=>Mr(We,!1),ur=()=>Ne(!0),jr=()=>Ne(!1),As=!U&&!s,Zo=We=>{var Et;if(Cv.includes(We.key)&&U){const{unselectNodesAndEdges:Ur,addSelectedEdges:Fr,edges:Vr}=ye.getState();We.key==="Escape"?((Et=pe.current)==null||Et.blur(),Ur({edges:[Vr.find($r=>$r.id===n)]})):Fr([n])}};return u.jsxs("g",{className:Xe(["react-flow__edge",`react-flow__edge-${o}`,r,{selected:l,animated:c,inactive:As,updating:le}]),onClick:q,onDoubleClick:lr,onContextMenu:Pr,onMouseEnter:Os,onMouseMove:Ts,onMouseLeave:qo,onKeyDown:X?Zo:void 0,tabIndex:X?0:void 0,role:X?"button":"img","data-testid":`rf__edge-${n}`,"aria-label":W===null?void 0:W||`Edge from ${g} to ${m}`,"aria-describedby":X?`${aE}-${z}`:void 0,ref:pe,children:[!Ze&&u.jsx(e,{id:n,source:g,target:m,selected:l,animated:c,label:d,labelStyle:f,labelShowBg:p,labelBgStyle:h,labelBgPadding:v,labelBgBorderRadius:E,data:i,style:y,sourceX:_,sourceY:S,targetX:x,targetY:R,sourcePosition:I,targetPosition:L,sourceHandleId:b,targetHandleId:V,markerStart:ge,markerEnd:et,pathOptions:J,interactionWidth:re}),Q&&u.jsxs(u.Fragment,{children:[(Q==="source"||Q===!0)&&u.jsx(AE,{position:I,centerX:_,centerY:S,radius:$,onMouseDown:cr,onMouseEnter:ur,onMouseOut:jr,type:"source"}),(Q==="target"||Q===!0)&&u.jsx(AE,{position:L,centerX:x,centerY:R,radius:$,onMouseDown:Jo,onMouseEnter:ur,onMouseOut:jr,type:"target"})]})]})};return t.displayName="EdgeWrapper",N.memo(t)};function $T(e){const t={default:Uo(e.default||ml),straight:Uo(e.bezier||jd),step:Uo(e.step||Md),smoothstep:Uo(e.step||hl),simplebezier:Uo(e.simplebezier||Pd)},n={},r=Object.keys(e).filter(o=>!["default","bezier"].includes(o)).reduce((o,i)=>(o[i]=Uo(e[i]||ml),o),n);return{...t,...r}}function IE(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 K.Top:return{x:r+i/2,y:o};case K.Right:return{x:r+i,y:o+s/2};case K.Bottom:return{x:r+i/2,y:o+s};case K.Left:return{x:r,y:o+s/2}}}function bE(e,t){return e?e.length===1||!t?e[0]:t&&e.find(n=>n.id===t)||null:null}const BT=(e,t,n,r,o,i)=>{const s=IE(n,e,t),a=IE(i,r,o);return{sourceX:s.x,sourceY:s.y,targetX:a.x,targetY:a.y}};function HT({sourcePos:e,targetPos:t,sourceWidth:n,sourceHeight:r,targetWidth:o,targetHeight:i,width:s,height:a,transform:l}){const c={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)};c.x===c.x2&&(c.x2+=1),c.y===c.y2&&(c.y2+=1);const d=Ld({x:(0-l[0])/l[2],y:(0-l[1])/l[2],width:s/l[2],height:a/l[2]}),f=Math.max(0,Math.min(d.x2,c.x2)-Math.max(d.x,c.x)),p=Math.max(0,Math.min(d.y2,c.y2)-Math.max(d.y,c.y));return Math.ceil(f*p)>0}function CE(e){var r,o,i,s,a;const t=((r=e==null?void 0:e[Te])==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]}const zT=[{level:0,isMaxLevel:!0,edges:[]}];function WT(e,t,n=!1){let r=-1;const o=e.reduce((s,a)=>{var d,f;const l=wt(a.zIndex);let c=l?a.zIndex:0;if(n){const p=t.get(a.target),h=t.get(a.source),v=a.selected||(p==null?void 0:p.selected)||(h==null?void 0:h.selected),E=Math.max(((d=h==null?void 0:h[Te])==null?void 0:d.z)||0,((f=p==null?void 0:p[Te])==null?void 0:f.z)||0,1e3);c=(l?a.zIndex:0)+(v?E:0)}return s[c]?s[c].push(a):s[c]=[a],r=c>r?c:r,s},{}),i=Object.entries(o).map(([s,a])=>{const l=+s;return{edges:a,level:l,isMaxLevel:l===r}});return i.length===0?zT:i}function GT(e,t,n){const r=ae(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)&&HT({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 WT(r,t,n)}const YT=({color:e="none",strokeWidth:t=1})=>u.jsx("polyline",{stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:t,fill:"none",points:"-5,-4 0,0 -5,4"}),KT=({color:e="none",strokeWidth:t=1})=>u.jsx("polyline",{stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:t,fill:e,points:"-5,-4 0,0 -5,4 -5,-4"}),LE={[is.Arrow]:YT,[is.ArrowClosed]:KT};function QT(e){const t=Oe();return N.useMemo(()=>{var o,i;return Object.prototype.hasOwnProperty.call(LE,e)?LE[e]:((i=(o=t.getState()).onError)==null||i.call(o,"009",Nn.error009(e)),null)},[e])}const XT=({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=QT(t);return l?u.jsx("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:u.jsx(l,{color:n,strokeWidth:s})}):null},qT=({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))},DE=({defaultColor:e,rfId:t})=>{const n=ae(N.useCallback(qT({defaultColor:e,rfId:t}),[e,t]),(r,o)=>!(r.length!==o.length||r.some((i,s)=>i.id!==o[s].id)));return u.jsx("defs",{children:n.map(r=>u.jsx(XT,{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))})};DE.displayName="MarkerDefinitions";var JT=N.memo(DE);const ZT=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}),kE=({defaultMarkerColor:e,onlyRenderVisibleElements:t,elevateEdgesOnSelect:n,rfId:r,edgeTypes:o,noPanClassName:i,onEdgeUpdate:s,onEdgeContextMenu:a,onEdgeMouseEnter:l,onEdgeMouseMove:c,onEdgeMouseLeave:d,onEdgeClick:f,edgeUpdaterRadius:p,onEdgeDoubleClick:h,onEdgeUpdateStart:v,onEdgeUpdateEnd:E,children:y})=>{const{edgesFocusable:g,edgesUpdatable:m,elementsSelectable:_,width:S,height:x,connectionMode:R,nodeInternals:I,onError:L}=ae(ZT,He),U=GT(t,I,n);return S?u.jsxs(u.Fragment,{children:[U.map(({level:T,edges:b,isMaxLevel:V})=>u.jsxs("svg",{style:{zIndex:T},width:S,height:x,className:"react-flow__edges react-flow__container",children:[V&&u.jsx(JT,{defaultColor:e,rfId:r}),u.jsx("g",{children:b.map(M=>{const[O,j,P]=CE(I.get(M.source)),[$,D,C]=CE(I.get(M.target));if(!P||!C)return null;let k=M.type||"default";o[k]||(L==null||L("011",Nn.error011(k)),k="default");const F=o[k]||o.default,B=R===qn.Strict?D.target:(D.target??[]).concat(D.source??[]),z=bE(j.source,M.sourceHandle),W=bE(B,M.targetHandle),X=(z==null?void 0:z.position)||K.Bottom,Q=(W==null?void 0:W.position)||K.Top,J=!!(M.focusable||g&&typeof M.focusable>"u"),re=typeof s<"u"&&(M.updatable||m&&typeof M.updatable>"u");if(!z||!W)return L==null||L("008",Nn.error008(z,M)),null;const{sourceX:pe,sourceY:le,targetX:Ne,targetY:Ze}=BT(O,z,X,$,W,Q);return u.jsx(F,{id:M.id,className:Xe([M.className,i]),type:k,data:M.data,selected:!!M.selected,animated:!!M.animated,hidden:!!M.hidden,label:M.label,labelStyle:M.labelStyle,labelShowBg:M.labelShowBg,labelBgStyle:M.labelBgStyle,labelBgPadding:M.labelBgPadding,labelBgBorderRadius:M.labelBgBorderRadius,style:M.style,source:M.source,target:M.target,sourceHandleId:M.sourceHandle,targetHandleId:M.targetHandle,markerEnd:M.markerEnd,markerStart:M.markerStart,sourceX:pe,sourceY:le,targetX:Ne,targetY:Ze,sourcePosition:X,targetPosition:Q,elementsSelectable:_,onEdgeUpdate:s,onContextMenu:a,onMouseEnter:l,onMouseMove:c,onMouseLeave:d,onClick:f,edgeUpdaterRadius:p,onEdgeDoubleClick:h,onEdgeUpdateStart:v,onEdgeUpdateEnd:E,rfId:r,ariaLabel:M.ariaLabel,isFocusable:J,isUpdatable:re,pathOptions:"pathOptions"in M?M.pathOptions:void 0,interactionWidth:M.interactionWidth},M.id)})})]},T)),y]}):null};kE.displayName="EdgeRenderer";var eA=N.memo(kE);const tA=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function nA({children:e}){const t=ae(tA);return u.jsx("div",{className:"react-flow__viewport react-flow__container",style:{transform:t},children:e})}function rA(e){const t=Gd(),n=N.useRef(!1);N.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const oA={[K.Left]:K.Right,[K.Right]:K.Left,[K.Top]:K.Bottom,[K.Bottom]:K.Top},PE=({nodeId:e,handleType:t,style:n,type:r=Jn.Bezier,CustomComponent:o,connectionStatus:i})=>{var R,I,L;const{fromNode:s,handleId:a,toX:l,toY:c,connectionMode:d}=ae(N.useCallback(U=>({fromNode:U.nodeInternals.get(e),handleId:U.connectionHandleId,toX:(U.connectionPosition.x-U.transform[0])/U.transform[2],toY:(U.connectionPosition.y-U.transform[1])/U.transform[2],connectionMode:U.connectionMode}),[e]),He),f=(R=s==null?void 0:s[Te])==null?void 0:R.handleBounds;let p=f==null?void 0:f[t];if(d===qn.Loose&&(p=p||(f==null?void 0:f[t==="source"?"target":"source"])),!s||!p)return null;const h=a?p.find(U=>U.id===a):p[0],v=h?h.x+h.width/2:(s.width??0)/2,E=h?h.y+h.height/2:s.height??0,y=(((I=s.positionAbsolute)==null?void 0:I.x)??0)+v,g=(((L=s.positionAbsolute)==null?void 0:L.y)??0)+E,m=h==null?void 0:h.position,_=m?oA[m]:null;if(!m||!_)return null;if(o)return u.jsx(o,{connectionLineType:r,connectionLineStyle:n,fromNode:s,fromHandle:h,fromX:y,fromY:g,toX:l,toY:c,fromPosition:m,toPosition:_,connectionStatus:i});let S="";const x={sourceX:y,sourceY:g,sourcePosition:m,targetX:l,targetY:c,targetPosition:_};return r===Jn.Bezier?[S]=Vv(x):r===Jn.Step?[S]=ss({...x,borderRadius:0}):r===Jn.SmoothStep?[S]=ss(x):r===Jn.SimpleBezier?[S]=Mv(x):S=`M${y},${g} ${l},${c}`,u.jsx("path",{d:S,fill:"none",className:"react-flow__connection-path",style:n})};PE.displayName="ConnectionLine";const iA=e=>({nodeId:e.connectionNodeId,handleType:e.connectionHandleType,nodesConnectable:e.nodesConnectable,connectionStatus:e.connectionStatus,width:e.width,height:e.height});function sA({containerStyle:e,style:t,type:n,component:r}){const{nodeId:o,handleType:i,nodesConnectable:s,width:a,height:l,connectionStatus:c}=ae(iA,He);return!(o&&i&&a&&s)?null:u.jsx("svg",{style:e,width:a,height:l,className:"react-flow__edges react-flow__connectionline react-flow__container",children:u.jsx("g",{className:Xe(["react-flow__connection",c]),children:u.jsx(PE,{nodeId:o,handleType:i,style:t,type:n,CustomComponent:r,connectionStatus:c})})})}function ME(e,t){return N.useRef(null),Oe(),N.useMemo(()=>t(e),[e])}const jE=({nodeTypes:e,edgeTypes:t,onMove:n,onMoveStart:r,onMoveEnd:o,onInit:i,onNodeClick:s,onEdgeClick:a,onNodeDoubleClick:l,onEdgeDoubleClick:c,onNodeMouseEnter:d,onNodeMouseMove:f,onNodeMouseLeave:p,onNodeContextMenu:h,onSelectionContextMenu:v,onSelectionStart:E,onSelectionEnd:y,connectionLineType:g,connectionLineStyle:m,connectionLineComponent:_,connectionLineContainerStyle:S,selectionKeyCode:x,selectionOnDrag:R,selectionMode:I,multiSelectionKeyCode:L,panActivationKeyCode:U,zoomActivationKeyCode:T,deleteKeyCode:b,onlyRenderVisibleElements:V,elementsSelectable:M,selectNodesOnDrag:O,defaultViewport:j,translateExtent:P,minZoom:$,maxZoom:D,preventScrolling:C,defaultMarkerColor:k,zoomOnScroll:F,zoomOnPinch:B,panOnScroll:z,panOnScrollSpeed:W,panOnScrollMode:X,zoomOnDoubleClick:Q,panOnDrag:J,onPaneClick:re,onPaneMouseEnter:pe,onPaneMouseMove:le,onPaneMouseLeave:Ne,onPaneScroll:Ze,onPaneContextMenu:vt,onEdgeUpdate:ye,onEdgeContextMenu:ge,onEdgeMouseEnter:et,onEdgeMouseMove:q,onEdgeMouseLeave:lr,edgeUpdaterRadius:Pr,onEdgeUpdateStart:Os,onEdgeUpdateEnd:Ts,noDragClassName:qo,noWheelClassName:Mr,noPanClassName:cr,elevateEdgesOnSelect:Jo,disableKeyboardA11y:ur,nodeOrigin:jr,nodeExtent:As,rfId:Zo})=>{const We=ME(e,kT),Et=ME(t,$T);return rA(i),u.jsx(LT,{onPaneClick:re,onPaneMouseEnter:pe,onPaneMouseMove:le,onPaneMouseLeave:Ne,onPaneContextMenu:vt,onPaneScroll:Ze,deleteKeyCode:b,selectionKeyCode:x,selectionOnDrag:R,selectionMode:I,onSelectionStart:E,onSelectionEnd:y,multiSelectionKeyCode:L,panActivationKeyCode:U,zoomActivationKeyCode:T,elementsSelectable:M,onMove:n,onMoveStart:r,onMoveEnd:o,zoomOnScroll:F,zoomOnPinch:B,zoomOnDoubleClick:Q,panOnScroll:z,panOnScrollSpeed:W,panOnScrollMode:X,panOnDrag:J,defaultViewport:j,translateExtent:P,minZoom:$,maxZoom:D,onSelectionContextMenu:v,preventScrolling:C,noDragClassName:qo,noWheelClassName:Mr,noPanClassName:cr,disableKeyboardA11y:ur,children:u.jsxs(nA,{children:[u.jsx(eA,{edgeTypes:Et,onEdgeClick:a,onEdgeDoubleClick:c,onEdgeUpdate:ye,onlyRenderVisibleElements:V,onEdgeContextMenu:ge,onEdgeMouseEnter:et,onEdgeMouseMove:q,onEdgeMouseLeave:lr,onEdgeUpdateStart:Os,onEdgeUpdateEnd:Ts,edgeUpdaterRadius:Pr,defaultMarkerColor:k,noPanClassName:cr,elevateEdgesOnSelect:!!Jo,disableKeyboardA11y:ur,rfId:Zo,children:u.jsx(sA,{style:m,type:g,component:_,containerStyle:S})}),u.jsx("div",{className:"react-flow__edgelabel-renderer"}),u.jsx(jT,{nodeTypes:We,onNodeClick:s,onNodeDoubleClick:l,onNodeMouseEnter:d,onNodeMouseMove:f,onNodeMouseLeave:p,onNodeContextMenu:h,selectNodesOnDrag:O,onlyRenderVisibleElements:V,noPanClassName:cr,noDragClassName:qo,disableKeyboardA11y:ur,nodeOrigin:jr,nodeExtent:As,rfId:Zo})]})})};jE.displayName="GraphView";var aA=N.memo(jE);const Jd=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],er={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:Jd,nodeExtent:Jd,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionNodeId:null,connectionHandleId:null,connectionHandleType:"source",connectionPosition:{x:0,y:0},connectionStatus:null,connectionMode:qn.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:PO,isValidConnection:void 0},lA=()=>K1((e,t)=>({...er,setNodes:n=>{const{nodeInternals:r,nodeOrigin:o,elevateNodesOnSelect:i}=t();e({nodeInternals:Wd(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?Wd(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:c}=t(),d=l==null?void 0:l.querySelector(".react-flow__viewport");if(!d)return;const f=window.getComputedStyle(d),{m22:p}=new window.DOMMatrixReadOnly(f.transform),h=n.reduce((E,y)=>{const g=o.get(y.id);if(g){const m=bd(y.nodeElement);!!(m.width&&m.height&&(g.width!==m.width||g.height!==m.height||y.forceUpdate))&&(o.set(g.id,{...g,[Te]:{...g[Te],handleBounds:{source:xE(".source",y.nodeElement,p,c),target:xE(".target",y.nodeElement,p,c)}},...m}),E.push({id:g.id,type:"dimensions",dimensions:m}))}return E},[]);dE(o,c);const v=s||i&&!s&&fE(t,{initial:!0,...a});e({nodeInternals:new Map(o),fitViewOnInitDone:v}),(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 c=vE(n,a()),d=Wd(c,o,s,l);e({nodeInternals:d})}r==null||r(n)}},addSelectedNodes:n=>{const{multiSelectionActive:r,edges:o,getNodes:i}=t();let s,a=null;r?s=n.map(l=>Zn(l,!0)):(s=Mo(i(),n),a=Mo(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=>Zn(l,!0)):(s=Mo(o,n),a=Mo(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(d=>(d.selected=!1,Zn(d.id,!1))),c=a.map(d=>Zn(d.id,!1));El({changedNodes:l,changedEdges:c,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=>Zn(a.id,!1)),s=n.filter(a=>a.selected).map(a=>Zn(a.id,!1));El({changedNodes:i,changedEdges:s,get:t,set:e})},setNodeExtent:n=>{const{nodeInternals:r}=t();r.forEach(o=>{o.positionAbsolute=Cd(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!1;const c=Qn.translate(r[0]+n.x,r[1]+n.y).scale(r[2]),d=[[0,0],[o,i]],f=s==null?void 0:s.constrain()(c,d,l);return s.transform(a,f),r[0]!==f.x||r[1]!==f.y||r[2]!==f.k},cancelConnection:()=>e({connectionNodeId:er.connectionNodeId,connectionHandleId:er.connectionHandleId,connectionHandleType:er.connectionHandleType,connectionStatus:er.connectionStatus,connectionStartHandle:er.connectionStartHandle,connectionEndHandle:er.connectionEndHandle}),reset:()=>e({...er})}),Object.is),Zd=({children:e})=>{const t=N.useRef(null);return t.current||(t.current=lA()),u.jsx(TO,{value:t.current,children:e})};Zd.displayName="ReactFlowProvider";const UE=({children:e})=>N.useContext(fl)?u.jsx(u.Fragment,{children:e}):u.jsx(Zd,{children:e});UE.displayName="ReactFlowWrapper";const cA={input:tE,default:Hd,output:rE,group:zd},uA={default:ml,straight:jd,step:Md,smoothstep:hl,simplebezier:Pd},dA=[0,0],fA=[15,15],pA={x:0,y:0,zoom:1},hA={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0},FE=N.forwardRef(({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:o,nodeTypes:i=cA,edgeTypes:s=uA,onNodeClick:a,onEdgeClick:l,onInit:c,onMove:d,onMoveStart:f,onMoveEnd:p,onConnect:h,onConnectStart:v,onConnectEnd:E,onClickConnectStart:y,onClickConnectEnd:g,onNodeMouseEnter:m,onNodeMouseMove:_,onNodeMouseLeave:S,onNodeContextMenu:x,onNodeDoubleClick:R,onNodeDragStart:I,onNodeDrag:L,onNodeDragStop:U,onNodesDelete:T,onEdgesDelete:b,onSelectionChange:V,onSelectionDragStart:M,onSelectionDrag:O,onSelectionDragStop:j,onSelectionContextMenu:P,onSelectionStart:$,onSelectionEnd:D,connectionMode:C=qn.Strict,connectionLineType:k=Jn.Bezier,connectionLineStyle:F,connectionLineComponent:B,connectionLineContainerStyle:z,deleteKeyCode:W="Backspace",selectionKeyCode:X="Shift",selectionOnDrag:Q=!1,selectionMode:J=os.Full,panActivationKeyCode:re="Space",multiSelectionKeyCode:pe=pl()?"Meta":"Control",zoomActivationKeyCode:le=pl()?"Meta":"Control",snapToGrid:Ne=!1,snapGrid:Ze=fA,onlyRenderVisibleElements:vt=!1,selectNodesOnDrag:ye=!0,nodesDraggable:ge,nodesConnectable:et,nodesFocusable:q,nodeOrigin:lr=dA,edgesFocusable:Pr,edgesUpdatable:Os,elementsSelectable:Ts,defaultViewport:qo=pA,minZoom:Mr=.5,maxZoom:cr=2,translateExtent:Jo=Jd,preventScrolling:ur=!0,nodeExtent:jr,defaultMarkerColor:As="#b1b1b7",zoomOnScroll:Zo=!0,zoomOnPinch:We=!0,panOnScroll:Et=!1,panOnScrollSpeed:Ur=.5,panOnScrollMode:Fr=Ir.Free,zoomOnDoubleClick:Vr=!0,panOnDrag:zl=!0,onPaneClick:$r,onPaneMouseEnter:Gf,onPaneMouseMove:Yf,onPaneMouseLeave:Is,onPaneScroll:Kf,onPaneContextMenu:v_,children:Br,onEdgeUpdate:r3,onEdgeContextMenu:o3,onEdgeDoubleClick:i3,onEdgeMouseEnter:s3,onEdgeMouseMove:a3,onEdgeMouseLeave:l3,onEdgeUpdateStart:c3,onEdgeUpdateEnd:u3,edgeUpdaterRadius:d3=10,onNodesChange:f3,onEdgesChange:p3,noDragClassName:h3="nodrag",noWheelClassName:g3="nowheel",noPanClassName:E_="nopan",fitView:m3=!1,fitViewOptions:v3,connectOnClick:E3=!0,attributionPosition:y3,proOptions:_3,defaultEdgeOptions:S3,elevateNodesOnSelect:x3=!0,elevateEdgesOnSelect:R3=!1,disableKeyboardA11y:y_=!1,autoPanOnConnect:N3=!0,autoPanOnNodeDrag:w3=!0,connectionRadius:O3=20,isValidConnection:T3,onError:A3,style:I3,id:__,...b3},C3)=>{const Qf=__||"1";return u.jsx("div",{...b3,style:{...I3,...hA},ref:C3,className:Xe(["react-flow",o]),"data-testid":"rf__wrapper",id:__,children:u.jsxs(UE,{children:[u.jsx(aA,{onInit:c,onMove:d,onMoveStart:f,onMoveEnd:p,onNodeClick:a,onEdgeClick:l,onNodeMouseEnter:m,onNodeMouseMove:_,onNodeMouseLeave:S,onNodeContextMenu:x,onNodeDoubleClick:R,nodeTypes:i,edgeTypes:s,connectionLineType:k,connectionLineStyle:F,connectionLineComponent:B,connectionLineContainerStyle:z,selectionKeyCode:X,selectionOnDrag:Q,selectionMode:J,deleteKeyCode:W,multiSelectionKeyCode:pe,panActivationKeyCode:re,zoomActivationKeyCode:le,onlyRenderVisibleElements:vt,selectNodesOnDrag:ye,defaultViewport:qo,translateExtent:Jo,minZoom:Mr,maxZoom:cr,preventScrolling:ur,zoomOnScroll:Zo,zoomOnPinch:We,zoomOnDoubleClick:Vr,panOnScroll:Et,panOnScrollSpeed:Ur,panOnScrollMode:Fr,panOnDrag:zl,onPaneClick:$r,onPaneMouseEnter:Gf,onPaneMouseMove:Yf,onPaneMouseLeave:Is,onPaneScroll:Kf,onPaneContextMenu:v_,onSelectionContextMenu:P,onSelectionStart:$,onSelectionEnd:D,onEdgeUpdate:r3,onEdgeContextMenu:o3,onEdgeDoubleClick:i3,onEdgeMouseEnter:s3,onEdgeMouseMove:a3,onEdgeMouseLeave:l3,onEdgeUpdateStart:c3,onEdgeUpdateEnd:u3,edgeUpdaterRadius:d3,defaultMarkerColor:As,noDragClassName:h3,noWheelClassName:g3,noPanClassName:E_,elevateEdgesOnSelect:R3,rfId:Qf,disableKeyboardA11y:y_,nodeOrigin:lr,nodeExtent:jr}),u.jsx(oT,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:h,onConnectStart:v,onConnectEnd:E,onClickConnectStart:y,onClickConnectEnd:g,nodesDraggable:ge,nodesConnectable:et,nodesFocusable:q,edgesFocusable:Pr,edgesUpdatable:Os,elementsSelectable:Ts,elevateNodesOnSelect:x3,minZoom:Mr,maxZoom:cr,nodeExtent:jr,onNodesChange:f3,onEdgesChange:p3,snapToGrid:Ne,snapGrid:Ze,connectionMode:C,translateExtent:Jo,connectOnClick:E3,defaultEdgeOptions:S3,fitView:m3,fitViewOptions:v3,onNodesDelete:T,onEdgesDelete:b,onNodeDragStart:I,onNodeDrag:L,onNodeDragStop:U,onSelectionDrag:O,onSelectionDragStart:M,onSelectionDragStop:j,noPanClassName:E_,nodeOrigin:lr,rfId:Qf,autoPanOnConnect:N3,autoPanOnNodeDrag:w3,onError:A3,connectionRadius:O3,isValidConnection:T3}),u.jsx(nT,{onSelectionChange:V}),Br,u.jsx(IO,{proOptions:_3,position:y3}),u.jsx(cT,{rfId:Qf,disableKeyboardA11y:y_})]})})});FE.displayName="ReactFlow";const gA=e=>{var t;return(t=e.domNode)==null?void 0:t.querySelector(".react-flow__edgelabel-renderer")};function mA({children:e}){const t=ae(gA);return t?xo.createPortal(e,t):null}function vA(){const e=Oe();return N.useCallback(t=>{const{domNode:n,updateNodeDimensions:r}=e.getState(),i=(Array.isArray(t)?t:[t]).reduce((s,a)=>{const l=n==null?void 0:n.querySelector(`.react-flow__node[data-id="${a}"]`);return l&&s.push({id:a,nodeElement:l,forceUpdate:!0}),s},[]);requestAnimationFrame(()=>r(i))},[])}function EA({onStart:e,onChange:t,onEnd:n}){const r=Oe();N.useEffect(()=>{r.setState({onViewportChangeStart:e})},[e]),N.useEffect(()=>{r.setState({onViewportChange:t})},[t]),N.useEffect(()=>{r.setState({onViewportChangeEnd:n})},[n])}const yA=e=>t=>t.nodeInternals.size===0?!1:t.getNodes().filter(n=>e.includeHiddenNodes?!0:!n.hidden).every(n=>{var r;return((r=n[Te])==null?void 0:r.handleBounds)!==void 0}),_A={includeHiddenNodes:!1};function SA(e=_A){return ae(yA(e))}function xA(){return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:u.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function RA(){return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:u.jsx("path",{d:"M0 0h32v4.2H0z"})})}function NA(){return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:u.jsx("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 wA(){return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:u.jsx("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 OA(){return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:u.jsx("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 cs=({children:e,className:t,...n})=>u.jsx("button",{type:"button",className:Xe(["react-flow__controls-button",t]),...n,children:e});cs.displayName="ControlButton";const TA=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom}),VE=({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:o,onZoomIn:i,onZoomOut:s,onFitView:a,onInteractiveChange:l,className:c,children:d,position:f="bottom-left"})=>{const p=Oe(),[h,v]=N.useState(!1),{isInteractive:E,minZoomReached:y,maxZoomReached:g}=ae(TA,He),{zoomIn:m,zoomOut:_,fitView:S}=Gd();if(N.useEffect(()=>{v(!0)},[]),!h)return null;const x=()=>{m(),i==null||i()},R=()=>{_(),s==null||s()},I=()=>{S(o),a==null||a()},L=()=>{p.setState({nodesDraggable:!E,nodesConnectable:!E,elementsSelectable:!E}),l==null||l(!E)};return u.jsxs(ns,{className:Xe(["react-flow__controls",c]),position:f,style:e,"data-testid":"rf__controls",children:[t&&u.jsxs(u.Fragment,{children:[u.jsx(cs,{onClick:x,className:"react-flow__controls-zoomin",title:"zoom in","aria-label":"zoom in",disabled:g,children:u.jsx(xA,{})}),u.jsx(cs,{onClick:R,className:"react-flow__controls-zoomout",title:"zoom out","aria-label":"zoom out",disabled:y,children:u.jsx(RA,{})})]}),n&&u.jsx(cs,{className:"react-flow__controls-fitview",onClick:I,title:"fit view","aria-label":"fit view",children:u.jsx(NA,{})}),r&&u.jsx(cs,{className:"react-flow__controls-interactive",onClick:L,title:"toggle interactivity","aria-label":"toggle interactivity",children:E?u.jsx(OA,{}):u.jsx(wA,{})}),d]})};VE.displayName="Controls";var AA=N.memo(VE),Ot;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Ot||(Ot={}));function IA({color:e,dimensions:t,lineWidth:n}){return u.jsx("path",{stroke:e,strokeWidth:n,d:`M${t[0]/2} 0 V${t[1]} M0 ${t[1]/2} H${t[0]}`})}function bA({color:e,radius:t}){return u.jsx("circle",{cx:t,cy:t,r:t,fill:e})}const CA={[Ot.Dots]:"#91919a",[Ot.Lines]:"#eee",[Ot.Cross]:"#e2e2e2"},LA={[Ot.Dots]:1,[Ot.Lines]:1,[Ot.Cross]:6},DA=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function $E({id:e,variant:t=Ot.Dots,gap:n=20,size:r,lineWidth:o=1,offset:i=2,color:s,style:a,className:l}){const c=N.useRef(null),{transform:d,patternId:f}=ae(DA,He),p=s||CA[t],h=r||LA[t],v=t===Ot.Dots,E=t===Ot.Cross,y=Array.isArray(n)?n:[n,n],g=[y[0]*d[2]||1,y[1]*d[2]||1],m=h*d[2],_=E?[m,m]:g,S=v?[m/i,m/i]:[_[0]/i,_[1]/i];return u.jsxs("svg",{className:Xe(["react-flow__background",l]),style:{...a,position:"absolute",width:"100%",height:"100%",top:0,left:0},ref:c,"data-testid":"rf__background",children:[u.jsx("pattern",{id:f+e,x:d[0]%g[0],y:d[1]%g[1],width:g[0],height:g[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${S[0]},-${S[1]})`,children:v?u.jsx(bA,{color:p,radius:m/i}):u.jsx(IA,{dimensions:_,color:p,lineWidth:o})}),u.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${f+e})`})]})}$E.displayName="Background";var kA=N.memo($E);const{useSyncExternalStoreWithSelector:PA}=bm;let BE=!1;function MA(e,t=e.getState,n){n&&!BE&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),BE=!0);const r=PA(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return N.useDebugValue(r),r}const HE=e=>{typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const t=typeof e=="function"?Lm(e):e,n=(r,o)=>MA(t,r,o);return Object.assign(n,t),n},us=e=>e?HE(e):HE,jA=!1,UA=(()=>"staging")(),FA="0.0.11",ds="0.0.8",zE=230,VA=640,WE=20,Fo={markerEnd:{height:20,type:is.ArrowClosed,width:20},style:{stroke:"inherit",strokeWidth:1.5},type:"floating"},$A="422",BA="404",GE="document-sync",ef=1e3,HA=1e3,zA=300,WA=5e3,GA="Shift+Backspace",YA="Meta",KA="Shift",_l=25,tf={duration:ef,includeHiddenNodes:!1,padding:.3},YE=()=>{const e={},t=document.querySelector('meta[name="csrf-token"]');return t&&(e["X-CSRF-Token"]=t==null?void 0:t.content),e},QA=(e,t)=>{var i;const n=new Blob([JSON.stringify({edges:t,nodes:e},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)},KE=e=>({...e,...Fo}),QE=e=>e.type==="handleCall"?{...e,deletable:!1}:e,XE=e=>e==="success"?"positive":"negative",XA=e=>e.toLowerCase().replace(/ /g,"-"),Tt=e=>typeof e=="string"?e.trim():e,qA=(e,t,n)=>e.sort((r,o)=>{const i=n?r[n]:r,s=n?o[n]:o;if(typeof i=="string"&&typeof s=="string")return t==="asc"?i.toLowerCase().localeCompare(s.toLowerCase()):s.toLowerCase().localeCompare(i.toLowerCase());if(typeof i=="number"&&typeof s=="number")return t==="asc"?i-s:s-i;throw new Error(`sort fn can only sort strings & numbers, but got ${typeof i} and ${typeof s}`)}),JA=e=>{try{return new URL(e).pathname.split("/").at(-1)}catch{return""}};function qE(e,t){const n=[{divisor:1,threshold:60,unit:"second"},{divisor:60,threshold:3600,unit:"minute"},{divisor:3600,threshold:86400,unit:"hour"},{divisor:86400,threshold:86400,unit:"day"}],r=new Intl.RelativeTimeFormat(e,{numeric:"always",...t});return function(i,s={}){const{excludeUnits:a={}}=s,l=new Date().getTime(),c=new Date(i).getTime(),d=Math.floor((l-c)/1e3),f=n.filter(({unit:E})=>!a[E]),{divisor:p,unit:h}=f.find(({threshold:E})=>Math.abs(d)<E)??f[f.length-1],v=Math.floor(d/p);return r.format(-v,h)}}function JE(e){return new Promise(t=>setTimeout(t,e))}const nf=()=>({callOrder:"single",callStateEvents:"",callStateUrl:"",connections:[{connectFrom:"",connectTimeout:"",connectTo:"",id:ie()}],defaultFrom:"",defaultTimeout:"",destinationType:"phone",options:[{id:ie(),result:"success"},{id:ie(),result:"noAnswer"},{id:ie(),result:"busy"},{id:ie(),result:"decline"},{id:ie(),result:"error"}]}),ZE={aiAgent:()=>({agent:""}),answer:()=>({valid:!0}),cond:()=>({fallback:ie(),options:[{id:ie(),value:""}]}),condRequest:()=>({body:"",error:ie(),fallback:ie(),headers:"",method:"POST",options:[{id:ie(),value:""}],url:""}),executeSWML:()=>({dest:"",fallback:ie(),meta:"",options:[{id:ie(),value:""}],params:""}),forwardAddress:()=>({...nf(),destinationType:"address"}),forwardPhone:()=>({...nf(),destinationType:"phone"}),forwardResource:()=>({...nf(),destinationType:"resource"}),handleCall:()=>({valid:!0}),hangup:()=>({valid:!0}),play:()=>({selected:"",text:"",url:""}),promptPlay:()=>({digitTimeout:"",initialTimeout:"",options:[{command:"",digit:"",id:ie()}],results:[{id:ie(),result:"no_match"},{id:ie(),result:"no_input"}],selected:"",text:"",url:""}),record:()=>({beep:!1,format:"wav",maxLength:"",stereo:!1,terminators:"",valid:!0}),recordCallStart:()=>({beep:!1,controlId:ie(),format:"wav",label:"",stereo:!1,terminators:""}),recordCallStop:()=>({controlId:""}),request:()=>({body:"",headers:"",method:"POST",options:[{id:ie(),result:"success"},{id:ie(),result:"failed"}],url:""}),sendSms:()=>({body:"",fromNumber:"",media:[],region:"",tags:[],toNumber:""}),set:()=>({variables:[{duplicate:!1,id:ie(),key:"",value:""}]}),unset:()=>({variables:[]})};function ze(e){"@babel/helpers - typeof";return ze=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},ze(e)}function At(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ZA(e,t){if(ze(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(ze(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ey(e){var t=ZA(e,"string");return ze(t)==="symbol"?t:String(t)}function ty(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,ey(r.key),r)}}function It(e,t,n){return t&&ty(e.prototype,t),n&&ty(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function tr(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function rf(e,t){return rf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},rf(e,t)}function Sl(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&&rf(e,t)}function fs(e,t){if(t&&(ze(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return tr(e)}function rn(e){return rn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},rn(e)}function Bt(e,t,n){return t=ey(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function eI(e){if(Array.isArray(e))return e}function tI(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function ny(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 nI(e,t){if(e){if(typeof e=="string")return ny(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 ny(e,t)}}function rI(){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 oI(e){return eI(e)||tI(e)||nI(e)||rI()}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 oy(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){Bt(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 iI={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)}},sI=function(){function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};At(this,e),this.init(t,n)}return It(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||iI,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,oy(oy({},{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}(),on=new sI,nr=function(){function e(){At(this,e),this.observers={}}return It(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 ps(){var e,t,n=new Promise(function(r,o){e=r,t=o});return n.resolve=e,n.reject=t,n}function iy(e){return e==null?"":""+e}function aI(e,t,n){e.forEach(function(r){t[r]&&(n[r]=t[r])})}function of(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 sy(e,t,n){var r=of(e,t,Object),o=r.obj,i=r.k;o[i]=n}function lI(e,t,n,r){var o=of(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 xl(e,t){var n=of(e,t),r=n.obj,o=n.k;if(r)return r[o]}function ay(e,t,n){var r=xl(e,n);return r!==void 0?r:xl(t,n)}function ly(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]):ly(e[r],t[r],n):e[r]=t[r]);return e}function Vo(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var cI={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};function uI(e){return typeof e=="string"?e.replace(/[&<>"'\/]/g,function(t){return cI[t]}):e}var Rl=typeof window<"u"&&window.navigator&&typeof window.navigator.userAgentData>"u"&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,dI=[" ",",","?","!",";"];function fI(e,t,n){t=t||"",n=n||"";var r=dI.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 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 Nl(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){Bt(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 pI(e){var t=hI();return function(){var r=rn(e),o;if(t){var i=rn(this).constructor;o=Reflect.construct(r,arguments,i)}else o=r.apply(this,arguments);return fs(this,o)}}function hI(){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 uy(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 c=r.slice(i+s).join(n);return c?uy(l,c,n):void 0}o=o[r[i]]}return o}}var gI=function(e){Sl(n,e);var t=pI(n);function n(r){var o,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};return At(this,n),o=t.call(this),Rl&&nr.call(tr(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 It(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,c=a.ignoreJSONStructure!==void 0?a.ignoreJSONStructure:this.options.ignoreJSONStructure,d=[o,i];s&&typeof s!="string"&&(d=d.concat(s)),s&&typeof s=="string"&&(d=d.concat(l?s.split(l):s)),o.indexOf(".")>-1&&(d=o.split("."));var f=xl(this.data,d);return f||!c||typeof s!="string"?f:uy(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},c=this.options.keySeparator;c===void 0&&(c=".");var d=[o,i];s&&(d=d.concat(c?s.split(c):s)),o.indexOf(".")>-1&&(d=o.split("."),a=i,i=d[1]),this.addNamespaces(i),sy(this.data,d,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 c=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1},d=[o,i];o.indexOf(".")>-1&&(d=o.split("."),a=s,s=i,i=d[1]),this.addNamespaces(i);var f=xl(this.data,d)||{};a?ly(f,s,l):f=Nl(Nl({},f),s),sy(this.data,d,f),c.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"?Nl(Nl({},{}),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}(nr),dy={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 fy(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 qe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?fy(Object(n),!0).forEach(function(r){Bt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fy(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function mI(e){var t=vI();return function(){var r=rn(e),o;if(t){var i=rn(this).constructor;o=Reflect.construct(r,arguments,i)}else o=r.apply(this,arguments);return fs(this,o)}}function vI(){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 py={},hy=function(e){Sl(n,e);var t=mI(n);function n(r){var o,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return At(this,n),o=t.call(this),Rl&&nr.call(tr(o)),aI(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],r,tr(o)),o.options=i,o.options.keySeparator===void 0&&(o.options.keySeparator="."),o.logger=on.create("translator"),o}return It(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||[],c=s&&o.indexOf(s)>-1,d=!this.options.userDefinedKeySeparator&&!i.keySeparator&&!this.options.userDefinedNsSeparator&&!i.nsSeparator&&!fI(o,s,a);if(c&&!d){var f=o.match(this.interpolator.nestingRegexp);if(f&&f.length>0)return{key:o,namespaces:l};var p=o.split(s);(s!==a||s===a&&this.options.ns.indexOf(p[0])>-1)&&(l=p.shift()),o=p.join(a)}return typeof l=="string"&&(l=[l]),{key:o,namespaces:l}}},{key:"translate",value:function(o,i,s){var a=this;if(ze(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,c=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,d=this.extractFromKey(o[o.length-1],i),f=d.key,p=d.namespaces,h=p[p.length-1],v=i.lng||this.language,E=i.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(v&&v.toLowerCase()==="cimode"){if(E){var y=i.nsSeparator||this.options.nsSeparator;return l?{res:"".concat(h).concat(y).concat(f),usedKey:f,exactUsedKey:f,usedLng:v,usedNS:h}:"".concat(h).concat(y).concat(f)}return l?{res:f,usedKey:f,exactUsedKey:f,usedLng:v,usedNS:h}:f}var g=this.resolve(o,i),m=g&&g.res,_=g&&g.usedKey||f,S=g&&g.exactUsedKey||f,x=Object.prototype.toString.apply(m),R=["[object Number]","[object Function]","[object RegExp]"],I=i.joinArrays!==void 0?i.joinArrays:this.options.joinArrays,L=!this.i18nFormat||this.i18nFormat.handleAsObject,U=typeof m!="string"&&typeof m!="boolean"&&typeof m!="number";if(L&&m&&U&&R.indexOf(x)<0&&!(typeof I=="string"&&x==="[object Array]")){if(!i.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");var T=this.options.returnedObjectHandler?this.options.returnedObjectHandler(_,m,qe(qe({},i),{},{ns:p})):"key '".concat(f," (").concat(this.language,")' returned an object instead of string.");return l?(g.res=T,g):T}if(c){var b=x==="[object Array]",V=b?[]:{},M=b?S:_;for(var O in m)if(Object.prototype.hasOwnProperty.call(m,O)){var j="".concat(M).concat(c).concat(O);V[O]=this.translate(j,qe(qe({},i),{joinArrays:!1,ns:p})),V[O]===j&&(V[O]=m[O])}m=V}}else if(L&&typeof I=="string"&&x==="[object Array]")m=m.join(I),m&&(m=this.extendTranslation(m,o,i,s));else{var P=!1,$=!1,D=i.count!==void 0&&typeof i.count!="string",C=n.hasDefaultValue(i),k=D?this.pluralResolver.getSuffix(v,i.count,i):"",F=i["defaultValue".concat(k)]||i.defaultValue;!this.isValidLookup(m)&&C&&(P=!0,m=F),this.isValidLookup(m)||($=!0,m=f);var B=i.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey,z=B&&$?void 0:m,W=C&&F!==m&&this.options.updateMissing;if($||P||W){if(this.logger.log(W?"updateKey":"missingKey",v,h,f,W?F:m),c){var X=this.resolve(f,qe(qe({},i),{},{keySeparator:!1}));X&&X.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 Q=[],J=this.languageUtils.getFallbackCodes(this.options.fallbackLng,i.lng||this.language);if(this.options.saveMissingTo==="fallback"&&J&&J[0])for(var re=0;re<J.length;re++)Q.push(J[re]);else this.options.saveMissingTo==="all"?Q=this.languageUtils.toResolveHierarchy(i.lng||this.language):Q.push(i.lng||this.language);var pe=function(Ne,Ze,vt){var ye=C&&vt!==m?vt:z;a.options.missingKeyHandler?a.options.missingKeyHandler(Ne,h,Ze,ye,W,i):a.backendConnector&&a.backendConnector.saveMissing&&a.backendConnector.saveMissing(Ne,h,Ze,ye,W,i),a.emit("missingKey",Ne,h,Ze,m)};this.options.saveMissing&&(this.options.saveMissingPlurals&&D?Q.forEach(function(le){a.pluralResolver.getSuffixes(le,i).forEach(function(Ne){pe([le],f+Ne,i["defaultValue".concat(Ne)]||F)})}):pe(Q,f,F))}m=this.extendTranslation(m,o,i,g,s),$&&m===f&&this.options.appendNamespaceToMissingKey&&(m="".concat(h,":").concat(f)),($||P)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?m=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?"".concat(h,":").concat(f):f,P?m:void 0):m=this.options.parseMissingKeyHandler(m))}return l?(g.res=m,g):m}},{key:"extendTranslation",value:function(o,i,s,a,l){var c=this;if(this.i18nFormat&&this.i18nFormat.parse)o=this.i18nFormat.parse(o,qe(qe({},this.options.interpolation.defaultVariables),s),a.usedLng,a.usedNS,a.usedKey,{resolved:a});else if(!s.skipInterpolation){s.interpolation&&this.interpolator.init(qe(qe({},s),{interpolation:qe(qe({},this.options.interpolation),s.interpolation)}));var d=typeof o=="string"&&(s&&s.interpolation&&s.interpolation.skipOnVariables!==void 0?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables),f;if(d){var p=o.match(this.interpolator.nestingRegexp);f=p&&p.length}var h=s.replace&&typeof s.replace!="string"?s.replace:s;if(this.options.interpolation.defaultVariables&&(h=qe(qe({},this.options.interpolation.defaultVariables),h)),o=this.interpolator.interpolate(o,h,s.lng||this.language,s),d){var v=o.match(this.interpolator.nestingRegexp),E=v&&v.length;f<E&&(s.nest=!1)}s.nest!==!1&&(o=this.interpolator.nest(o,function(){for(var m=arguments.length,_=new Array(m),S=0;S<m;S++)_[S]=arguments[S];return l&&l[0]===_[0]&&!s.context?(c.logger.warn("It seems you are nesting recursively key: ".concat(_[0]," in key: ").concat(i[0])),null):c.translate.apply(c,_.concat([i]))},s)),s.interpolation&&this.interpolator.reset()}var y=s.postProcess||this.options.postProcess,g=typeof y=="string"?[y]:y;return o!=null&&g&&g.length&&s.applyPostProcessor!==!1&&(o=dy.handle(g,o,i,this.options&&this.options.postProcessPassResolved?qe({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,c,d,f;return typeof o=="string"&&(o=[o]),o.forEach(function(p){if(!i.isValidLookup(a)){var h=i.extractFromKey(p,s),v=h.key;l=v;var E=h.namespaces;i.options.fallbackNS&&(E=E.concat(i.options.fallbackNS));var y=s.count!==void 0&&typeof s.count!="string",g=y&&!s.ordinal&&s.count===0&&i.pluralResolver.shouldUseIntlApi(),m=s.context!==void 0&&(typeof s.context=="string"||typeof s.context=="number")&&s.context!=="",_=s.lngs?s.lngs:i.languageUtils.toResolveHierarchy(s.lng||i.language,s.fallbackLng);E.forEach(function(S){i.isValidLookup(a)||(f=S,!py["".concat(_[0],"-").concat(S)]&&i.utils&&i.utils.hasLoadedNamespace&&!i.utils.hasLoadedNamespace(f)&&(py["".concat(_[0],"-").concat(S)]=!0,i.logger.warn('key "'.concat(l,'" for languages "').concat(_.join(", "),`" won't get resolved as namespace "`).concat(f,'" 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!!!")),_.forEach(function(x){if(!i.isValidLookup(a)){d=x;var R=[v];if(i.i18nFormat&&i.i18nFormat.addLookupKeys)i.i18nFormat.addLookupKeys(R,v,x,S,s);else{var I;y&&(I=i.pluralResolver.getSuffix(x,s.count,s));var L="".concat(i.options.pluralSeparator,"zero");if(y&&(R.push(v+I),g&&R.push(v+L)),m){var U="".concat(v).concat(i.options.contextSeparator).concat(s.context);R.push(U),y&&(R.push(U+I),g&&R.push(U+L))}}for(var T;T=R.pop();)i.isValidLookup(a)||(c=T,a=i.getResource(x,S,T,s))}}))})}}),{res:a,usedKey:l,exactUsedKey:c,usedLng:d,usedNS:f}}},{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}(nr);function sf(e){return e.charAt(0).toUpperCase()+e.slice(1)}var gy=function(){function e(t){At(this,e),this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=on.create("languageUtils")}return It(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]=sf(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]=sf(o[1].toLowerCase())),r.indexOf(o[2].toLowerCase())>-1&&(o[2]=sf(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(c){c&&(o.isSupportedCode(c)?s.push(c):o.logger.warn("rejecting language code not found in supportedLngs: ".concat(c)))};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}(),EI=[{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}],yI={1:function(t){return+(t>1)},2:function(t){return+(t!=1)},3:function(t){return 0},4:function(t){return 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 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 t==1?0:t>=2&&t<=4?1:2},7:function(t){return t==1?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2},8:function(t){return t==1?0:t==2?1:t!=8&&t!=11?2:3},9:function(t){return+(t>=2)},10:function(t){return t==1?0:t==2?1:t<7?2:t<11?3:4},11:function(t){return t==1||t==11?0:t==2||t==12?1:t>2&&t<20?2:3},12:function(t){return+(t%10!=1||t%100==11)},13:function(t){return+(t!==0)},14:function(t){return t==1?0:t==2?1:t==3?2:3},15:function(t){return t%10==1&&t%100!=11?0:t%10>=2&&(t%100<10||t%100>=20)?1:2},16:function(t){return t%10==1&&t%100!=11?0:t!==0?1:2},17:function(t){return t==1||t%10==1&&t%100!=11?0:1},18:function(t){return t==0?0:t==1?1:2},19:function(t){return t==1?0:t==0||t%100>1&&t%100<11?1:t%100>10&&t%100<20?2:3},20:function(t){return t==1?0:t==0||t%100>0&&t%100<20?1:2},21:function(t){return t%100==1?1:t%100==2?2:t%100==3||t%100==4?3:0},22:function(t){return t==1?0:t==2?1:(t<0||t>10)&&t%10==0?2:3}},_I=["v1","v2","v3"],my={zero:0,one:1,two:2,few:3,many:4,other:5};function SI(){var e={};return EI.forEach(function(t){t.lngs.forEach(function(n){e[n]={numbers:t.nr,plurals:yI[t.fc]}})}),e}var xI=function(){function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};At(this,e),this.languageUtils=t,this.options=n,this.logger=on.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=SI()}return It(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 my[s]-my[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!_I.includes(this.options.compatibilityJSON)}}]),e}();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 Ht(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){Bt(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}var RI=function(){function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};At(this,e),this.logger=on.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||function(n){return n},this.init(t)}return It(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:uI,this.escapeValue=r.escapeValue!==void 0?r.escapeValue:!0,this.useRawValueToEscape=r.useRawValueToEscape!==void 0?r.useRawValueToEscape:!1,this.prefix=r.prefix?Vo(r.prefix):r.prefixEscaped||"{{",this.suffix=r.suffix?Vo(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?Vo(r.nestingPrefix):r.nestingPrefixEscaped||Vo("$t("),this.nestingSuffix=r.nestingSuffix?Vo(r.nestingSuffix):r.nestingSuffixEscaped||Vo(")"),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,c,d=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function f(y){return y.replace(/\$/g,"$$$$")}var p=function(g){if(g.indexOf(s.formatSeparator)<0){var m=ay(r,d,g);return s.alwaysFormat?s.format(m,void 0,o,Ht(Ht(Ht({},i),r),{},{interpolationkey:g})):m}var _=g.split(s.formatSeparator),S=_.shift().trim(),x=_.join(s.formatSeparator).trim();return s.format(ay(r,d,S),x,o,Ht(Ht(Ht({},i),r),{},{interpolationkey:S}))};this.resetRegExp();var h=i&&i.missingInterpolationHandler||this.options.missingInterpolationHandler,v=i&&i.interpolation&&i.interpolation.skipOnVariables!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables,E=[{regex:this.regexpUnescape,safeValue:function(g){return f(g)}},{regex:this.regexp,safeValue:function(g){return s.escapeValue?f(s.escape(g)):f(g)}}];return E.forEach(function(y){for(c=0;a=y.regex.exec(n);){var g=a[1].trim();if(l=p(g),l===void 0)if(typeof h=="function"){var m=h(n,a,i);l=typeof m=="string"?m:""}else if(i&&Object.prototype.hasOwnProperty.call(i,g))l="";else if(v){l=a[0];continue}else s.logger.warn("missed to pass in variable ".concat(g," for interpolating ").concat(n)),l="";else typeof l!="string"&&!s.useRawValueToEscape&&(l=iy(l));var _=y.safeValue(l);if(n=n.replace(a[0],_),v?(y.regex.lastIndex+=l.length,y.regex.lastIndex-=a[0].length):y.regex.lastIndex=0,c++,c>=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 c(h,v){var E=this.nestingOptionsSeparator;if(h.indexOf(E)<0)return h;var y=h.split(new RegExp("".concat(E,"[ ]*{"))),g="{".concat(y[1]);h=y[0],g=this.interpolate(g,l);var m=g.match(/'/g),_=g.match(/"/g);(m&&m.length%2===0&&!_||_.length%2!==0)&&(g=g.replace(/'/g,'"'));try{l=JSON.parse(g),v&&(l=Ht(Ht({},v),l))}catch(S){return this.logger.warn("failed parsing options string in nesting for key ".concat(h),S),"".concat(h).concat(E).concat(g)}return delete l.defaultValue,h}for(;s=this.nestingRegexp.exec(n);){var d=[];l=Ht({},i),l=l.replace&&typeof l.replace!="string"?l.replace:l,l.applyPostProcessor=!1,delete l.defaultValue;var f=!1;if(s[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(s[1])){var p=s[1].split(this.formatSeparator).map(function(h){return h.trim()});s[1]=p.shift(),d=p,f=!0}if(a=r(c.call(this,s[1].trim(),l),l),a&&s[0]===n&&typeof a!="string")return a;typeof a!="string"&&(a=iy(a)),a||(this.logger.warn("missed to resolve ".concat(s[1]," for nesting ").concat(n)),a=""),f&&(a=d.reduce(function(h,v){return o.format(h,v,i.lng,Ht(Ht({},i),{},{interpolationkey:s[1].trim()}))},a.trim())),n=n.replace(s[0],a),this.regexp.lastIndex=0}return n}}]),e}();function Ey(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 wn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Ey(Object(n),!0).forEach(function(r){Bt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ey(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function NI(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=oI(a),c=l[0],d=l.slice(1),f=d.join(":").trim().replace(/^'+|'+$/g,"");n[c.trim()]||(n[c.trim()]=f),f==="false"&&(n[c.trim()]=!1),f==="true"&&(n[c.trim()]=!0),isNaN(f)||(n[c.trim()]=parseInt(f,10))}})}}return{formatName:t,formatOptions:n}}function $o(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 wI=function(){function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};At(this,e),this.logger=on.create("formatter"),this.options=t,this.formats={number:$o(function(n,r){var o=new Intl.NumberFormat(n,wn({},r));return function(i){return o.format(i)}}),currency:$o(function(n,r){var o=new Intl.NumberFormat(n,wn(wn({},r),{},{style:"currency"}));return function(i){return o.format(i)}}),datetime:$o(function(n,r){var o=new Intl.DateTimeFormat(n,wn({},r));return function(i){return o.format(i)}}),relativetime:$o(function(n,r){var o=new Intl.RelativeTimeFormat(n,wn({},r));return function(i){return o.format(i,r.range||"day")}}),list:$o(function(n,r){var o=new Intl.ListFormat(n,wn({},r));return function(i){return o.format(i)}})},this.init(t)}return It(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()]=$o(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(c,d){var f=NI(d),p=f.formatName,h=f.formatOptions;if(i.formats[p]){var v=c;try{var E=s&&s.formatParams&&s.formatParams[s.interpolationkey]||{},y=E.locale||E.lng||s.locale||s.lng||o;v=i.formats[p](c,y,wn(wn(wn({},h),s),E))}catch(g){i.logger.warn(g)}return v}else i.logger.warn("there was no format function for ".concat(p));return c},n);return l}}]),e}();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 _y(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){Bt(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 OI(e){var t=TI();return function(){var r=rn(e),o;if(t){var i=rn(this).constructor;o=Reflect.construct(r,arguments,i)}else o=r.apply(this,arguments);return fs(this,o)}}function TI(){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 AI(e,t){e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)}var II=function(e){Sl(n,e);var t=OI(n);function n(r,o,i){var s,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return At(this,n),s=t.call(this),Rl&&nr.call(tr(s)),s.backend=r,s.store=o,s.services=i,s.languageUtils=i.languageUtils,s.options=a,s.logger=on.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 It(n,[{key:"queueLoad",value:function(o,i,s,a){var l=this,c={},d={},f={},p={};return o.forEach(function(h){var v=!0;i.forEach(function(E){var y="".concat(h,"|").concat(E);!s.reload&&l.store.hasResourceBundle(h,E)?l.state[y]=2:l.state[y]<0||(l.state[y]===1?d[y]===void 0&&(d[y]=!0):(l.state[y]=1,v=!1,d[y]===void 0&&(d[y]=!0),c[y]===void 0&&(c[y]=!0),p[E]===void 0&&(p[E]=!0)))}),v||(f[h]=!0)}),(Object.keys(c).length||Object.keys(d).length)&&this.queue.push({pending:d,pendingCount:Object.keys(d).length,loaded:{},errors:[],callback:a}),{toLoad:Object.keys(c),pending:Object.keys(d),toLoadLanguages:Object.keys(f),toLoadNamespaces:Object.keys(p)}}},{key:"loaded",value:function(o,i,s){var a=o.split("|"),l=a[0],c=a[1];i&&this.emit("failedLoading",l,c,i),s&&this.store.addResourceBundle(l,c,s),this.state[o]=i?-1:2;var d={};this.queue.forEach(function(f){lI(f.loaded,[l],c),AI(f,o),i&&f.errors.push(i),f.pendingCount===0&&!f.done&&(Object.keys(f.loaded).forEach(function(p){d[p]||(d[p]={});var h=f.loaded[p];h.length&&h.forEach(function(v){d[p][v]===void 0&&(d[p][v]=!0)})}),f.done=!0,f.errors.length?f.callback(f.errors):f.callback())}),this.emit("loaded",d),this.queue=this.queue.filter(function(f){return!f.done})}},{key:"read",value:function(o,i,s){var a=this,l=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,c=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,d=arguments.length>5?arguments[5]:void 0;if(!o.length)return d(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:o,ns:i,fcName:s,tried:l,wait:c,callback:d});return}this.readingCalls++;var f=function(E,y){if(a.readingCalls--,a.waitingReads.length>0){var g=a.waitingReads.shift();a.read(g.lng,g.ns,g.fcName,g.tried,g.wait,g.callback)}if(E&&y&&l<a.maxRetries){setTimeout(function(){a.read.call(a,o,i,s,l+1,c*2,d)},c);return}d(E,y)},p=this.backend[s].bind(this.backend);if(p.length===2){try{var h=p(o,i);h&&typeof h.then=="function"?h.then(function(v){return f(null,v)}).catch(f):f(null,h)}catch(v){f(v)}return}return p(o,i,f)}},{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 c=this.queueLoad(o,i,a,l);if(!c.toLoad.length)return c.pending.length||l(),null;c.toLoad.forEach(function(d){s.loadOne(d)})}},{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],c=a[1];this.read(l,c,"read",void 0,void 0,function(d,f){d&&i.logger.warn("".concat(s,"loading namespace ").concat(c," for language ").concat(l," failed"),d),!d&&f&&i.logger.log("".concat(s,"loaded namespace ").concat(c," for language ").concat(l),f),i.loaded(o,d,f)})}},{key:"saveMissing",value:function(o,i,s,a,l){var c=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},d=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 f=_y(_y({},c),{},{isUpdate:l}),p=this.backend.create.bind(this.backend);if(p.length<6)try{var h;p.length===5?h=p(o,i,s,a,f):h=p(o,i,s,a),h&&typeof h.then=="function"?h.then(function(v){return d(null,v)}).catch(d):d(null,h)}catch(v){d(v)}else p(o,i,s,a,d,f)}!o||!o[0]||this.store.addResource(o[0],i,s,a)}}}]),n}(nr);function Sy(){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(ze(t[1])==="object"&&(n=t[1]),typeof t[1]=="string"&&(n.defaultValue=t[1]),typeof t[2]=="string"&&(n.tDescription=t[2]),ze(t[2])==="object"||ze(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 xy(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 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 sn(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){Bt(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 bI(e){var t=CI();return function(){var r=rn(e),o;if(t){var i=rn(this).constructor;o=Reflect.construct(r,arguments,i)}else o=r.apply(this,arguments);return fs(this,o)}}function CI(){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 wl(){}function LI(e){var t=Object.getOwnPropertyNames(Object.getPrototypeOf(e));t.forEach(function(n){typeof e[n]=="function"&&(e[n]=e[n].bind(e))})}var Ol=function(e){Sl(n,e);var t=bI(n);function n(){var r,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;if(At(this,n),r=t.call(this),Rl&&nr.call(tr(r)),r.options=xy(o),r.services={},r.logger=on,r.modules={external:[]},LI(tr(r)),i&&!r.isInitialized&&!o.isClone){if(!r.options.initImmediate)return r.init(o,i),fs(r,tr(r));setTimeout(function(){r.init(o,i)},0)}return r}return It(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=Sy();this.options=sn(sn(sn({},a),this.options),xy(i)),this.options.compatibilityAPI!=="v1"&&(this.options.interpolation=sn(sn({},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(g){return g?typeof g=="function"?new g:g:null}if(!this.options.isClone){this.modules.logger?on.init(l(this.modules.logger),this.options):on.init(null,this.options);var c;this.modules.formatter?c=this.modules.formatter:typeof Intl<"u"&&(c=wI);var d=new gy(this.options);this.store=new gI(this.options.resources,this.options);var f=this.services;f.logger=on,f.resourceStore=this.store,f.languageUtils=d,f.pluralResolver=new xI(d,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),c&&(!this.options.interpolation.format||this.options.interpolation.format===a.interpolation.format)&&(f.formatter=l(c),f.formatter.init(f,this.options),this.options.interpolation.format=f.formatter.format.bind(f.formatter)),f.interpolator=new RI(this.options),f.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},f.backendConnector=new II(l(this.modules.backend),f.resourceStore,f,this.options),f.backendConnector.on("*",function(g){for(var m=arguments.length,_=new Array(m>1?m-1:0),S=1;S<m;S++)_[S-1]=arguments[S];o.emit.apply(o,[g].concat(_))}),this.modules.languageDetector&&(f.languageDetector=l(this.modules.languageDetector),f.languageDetector.init&&f.languageDetector.init(f,this.options.detection,this.options)),this.modules.i18nFormat&&(f.i18nFormat=l(this.modules.i18nFormat),f.i18nFormat.init&&f.i18nFormat.init(this)),this.translator=new hy(this.services,this.options),this.translator.on("*",function(g){for(var m=arguments.length,_=new Array(m>1?m-1:0),S=1;S<m;S++)_[S-1]=arguments[S];o.emit.apply(o,[g].concat(_))}),this.modules.external.forEach(function(g){g.init&&g.init(o)})}if(this.format=this.options.interpolation.format,s||(s=wl),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){var p=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);p.length>0&&p[0]!=="dev"&&(this.options.lng=p[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(g){o[g]=function(){var m;return(m=o.store)[g].apply(m,arguments)}});var v=["addResource","addResources","addResourceBundle","removeResourceBundle"];v.forEach(function(g){o[g]=function(){var m;return(m=o.store)[g].apply(m,arguments),o}});var E=ps(),y=function(){var m=function(S,x){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),E.resolve(x),s(S,x)};if(o.languages&&o.options.compatibilityAPI!=="v1"&&!o.isInitialized)return m(null,o.t.bind(o));o.changeLanguage(o.options.lng,m)};return this.options.resources||!this.options.initImmediate?y():setTimeout(y,0),E}},{key:"loadResources",value:function(o){var i=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:wl,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 c=[],d=function(h){if(h){var v=i.services.languageUtils.toResolveHierarchy(h);v.forEach(function(E){c.indexOf(E)<0&&c.push(E)})}};if(l)d(l);else{var f=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);f.forEach(function(p){return d(p)})}this.options.preload&&this.options.preload.forEach(function(p){return d(p)}),this.services.backendConnector.load(c,this.options.ns,function(p){!p&&!i.resolvedLanguage&&i.language&&i.setResolvedLanguage(i.language),a(p)})}else a(null)}},{key:"reloadResources",value:function(o,i,s){var a=ps();return o||(o=this.languages),i||(i=this.options.ns),s||(s=wl),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"&&dy.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=ps();this.emit("languageChanging",o);var l=function(p){s.language=p,s.languages=s.services.languageUtils.toResolveHierarchy(p),s.resolvedLanguage=void 0,s.setResolvedLanguage(p)},c=function(p,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(p,function(){return s.t.apply(s,arguments)})},d=function(p){!o&&!p&&s.services.languageDetector&&(p=[]);var h=typeof p=="string"?p:s.services.languageUtils.getBestMatchFromCodes(p);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(v){c(v,h)})};return!o&&this.services.languageDetector&&!this.services.languageDetector.async?d(this.services.languageDetector.detect()):!o&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(d):this.services.languageDetector.detect(d):d(o),a}},{key:"getFixedT",value:function(o,i,s){var a=this,l=function c(d,f){var p;if(ze(f)!=="object"){for(var h=arguments.length,v=new Array(h>2?h-2:0),E=2;E<h;E++)v[E-2]=arguments[E];p=a.options.overloadTranslationOptionHandler([d,f].concat(v))}else p=sn({},f);p.lng=p.lng||c.lng,p.lngs=p.lngs||c.lngs,p.ns=p.ns||c.ns,p.keyPrefix=p.keyPrefix||s||c.keyPrefix;var y=a.options.keySeparator||".",g;return p.keyPrefix&&Array.isArray(d)?g=d.map(function(m){return"".concat(p.keyPrefix).concat(y).concat(m)}):g=p.keyPrefix?"".concat(p.keyPrefix).concat(y).concat(d):d,a.t(g,p)};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,c=this.languages[this.languages.length-1];if(a.toLowerCase()==="cimode")return!0;var d=function(h,v){var E=i.services.backendConnector.state["".concat(h,"|").concat(v)];return E===-1||E===2};if(s.precheck){var f=s.precheck(this,d);if(f!==void 0)return f}return!!(this.hasResourceBundle(a,o)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||d(a,o)&&(!l||d(c,o)))}},{key:"loadNamespaces",value:function(o,i){var s=this,a=ps();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=ps();typeof o=="string"&&(o=[o]);var a=this.options.preload||[],l=o.filter(function(c){return a.indexOf(c)<0});return l.length?(this.options.preload=a.concat(l),this.loadResources(function(c){s.resolve(),i&&i(c)}),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 gy(Sy());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]:wl,a=sn(sn(sn({},this.options),i),{isClone:!0}),l=new n(a);(i.debug!==void 0||i.prefix!==void 0)&&(l.logger=l.logger.clone(i));var c=["store","services","language"];return c.forEach(function(d){l[d]=o[d]}),l.services=sn({},this.services),l.services.utils={hasLoadedNamespace:l.hasLoadedNamespace.bind(l)},l.translator=new hy(l.services,l.options),l.translator.on("*",function(d){for(var f=arguments.length,p=new Array(f>1?f-1:0),h=1;h<f;h++)p[h-1]=arguments[h];l.emit.apply(l,[d].concat(p))}),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}(nr);Bt(Ol,"createInstance",function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return new Ol(e,t)});var Ce=Ol.createInstance();Ce.createInstance=Ol.createInstance,Ce.createInstance,Ce.dir,Ce.init,Ce.loadResources,Ce.reloadResources,Ce.use,Ce.changeLanguage,Ce.getFixedT,Ce.t,Ce.exists,Ce.setDefaultNamespace,Ce.hasLoadedNamespace,Ce.loadNamespaces,Ce.loadLanguages;var Ny=[],DI=Ny.forEach,kI=Ny.slice;function PI(e){return DI.call(kI.call(arguments,1),function(t){if(t)for(var n in t)e[n]===void 0&&(e[n]=t[n])}),e}var wy=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,MI=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(!wy.test(o.domain))throw new TypeError("option domain is invalid");s+="; Domain=".concat(o.domain)}if(o.path){if(!wy.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},Oy={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=MI(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)}},jI={name:"cookie",lookup:function(t){var n;if(t.lookupCookie&&typeof document<"u"){var r=Oy.read(t.lookupCookie);r&&(n=r)}return n},cacheUserLanguage:function(t,n){n.lookupCookie&&typeof document<"u"&&Oy.create(n.lookupCookie,t,n.cookieMinutes,n.cookieDomain,n.cookieOptions)}},UI={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}},hs=null,Ty=function(){if(hs!==null)return hs;try{hs=window!=="undefined"&&window.localStorage!==null;var t="i18next.translate.boo";window.localStorage.setItem(t,"foo"),window.localStorage.removeItem(t)}catch{hs=!1}return hs},FI={name:"localStorage",lookup:function(t){var n;if(t.lookupLocalStorage&&Ty()){var r=window.localStorage.getItem(t.lookupLocalStorage);r&&(n=r)}return n},cacheUserLanguage:function(t,n){n.lookupLocalStorage&&Ty()&&window.localStorage.setItem(n.lookupLocalStorage,t)}},gs=null,Ay=function(){if(gs!==null)return gs;try{gs=window!=="undefined"&&window.sessionStorage!==null;var t="i18next.translate.boo";window.sessionStorage.setItem(t,"foo"),window.sessionStorage.removeItem(t)}catch{gs=!1}return gs},VI={name:"sessionStorage",lookup:function(t){var n;if(t.lookupSessionStorage&&Ay()){var r=window.sessionStorage.getItem(t.lookupSessionStorage);r&&(n=r)}return n},cacheUserLanguage:function(t,n){n.lookupSessionStorage&&Ay()&&window.sessionStorage.setItem(n.lookupSessionStorage,t)}},$I={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}},BI={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}},HI={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}},zI={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 WI(){return{order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"]}}var Iy=function(){function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};At(this,e),this.type="languageDetector",this.detectors={},this.init(t,n)}return It(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=PI(r,this.options||{},WI()),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=o,this.addDetector(jI),this.addDetector(UI),this.addDetector(FI),this.addDetector(VI),this.addDetector($I),this.addDetector(BI),this.addDetector(HI),this.addDetector(zI)}},{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}();Iy.type="languageDetector";function GI(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i<r.length;i++)o=r[i],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}function af(e,t){if(e==null)return{};var n=GI(e,t),r,o;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)r=i[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}var YI={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0};const KI=Wl(YI);var QI=/\s([^'"/\s><]+?)[\s/>]|([^\s=]+)=\s?(".*?"|'.*?')/g;function by(e){var t={type:"tag",name:"",voidElement:!1,attrs:{},children:[]},n=e.match(/<\/?([^\s]+?)[/\s>]/);if(n&&(t.name=n[1],(KI[n[1]]||e.charAt(e.length-2)==="/")&&(t.voidElement=!0),t.name.startsWith("!--"))){var r=e.indexOf("-->");return{type:"comment",comment:r!==-1?e.slice(4,r):""}}for(var o=new RegExp(QI),i=null;(i=o.exec(e))!==null;)if(i[0].trim())if(i[1]){var s=i[1].trim(),a=[s,""];s.indexOf("=")>-1&&(a=s.split("=")),t.attrs[a[0]]=a[1],o.lastIndex--}else i[2]&&(t.attrs[i[2]]=i[3].trim().substring(1,i[3].length-1));return t}var XI=/<[a-zA-Z0-9\-\!\/](?:"[^"]*"|'[^']*'|[^'">])*>/g,qI=/^\s*$/,JI=Object.create(null);function Cy(e,t){switch(t.type){case"text":return e+t.content;case"tag":return e+="<"+t.name+(t.attrs?function(n){var r=[];for(var o in n)r.push(o+'="'+n[o]+'"');return r.length?" "+r.join(" "):""}(t.attrs):"")+(t.voidElement?"/>":">"),t.voidElement?e:e+t.children.reduce(Cy,"")+"</"+t.name+">";case"comment":return e+"<!--"+t.comment+"-->"}}var ZI={parse:function(e,t){t||(t={}),t.components||(t.components=JI);var n,r=[],o=[],i=-1,s=!1;if(e.indexOf("<")!==0){var a=e.indexOf("<");r.push({type:"text",content:a===-1?e:e.substring(0,a)})}return e.replace(XI,function(l,c){if(s){if(l!=="</"+n.name+">")return;s=!1}var d,f=l.charAt(1)!=="/",p=l.startsWith("<!--"),h=c+l.length,v=e.charAt(h);if(p){var E=by(l);return i<0?(r.push(E),r):((d=o[i]).children.push(E),r)}if(f&&(i++,(n=by(l)).type==="tag"&&t.components[n.name]&&(n.type="component",s=!0),n.voidElement||s||!v||v==="<"||n.children.push({type:"text",content:e.slice(h,e.indexOf("<",h))}),i===0&&r.push(n),(d=o[i-1])&&d.children.push(n),o[i]=n),(!f||n.voidElement)&&(i>-1&&(n.voidElement||n.name===l.slice(2,-1))&&(i--,n=i===-1?r:o[i]),!s&&v!=="<"&&v)){d=i===-1?r:o[i].children;var y=e.indexOf("<",h),g=e.slice(h,y===-1?void 0:y);qI.test(g)&&(g=" "),(y>-1&&i+d.length>=0||g!==" ")&&d.push({type:"text",content:g})}}),r},stringify:function(e){return e.reduce(function(t,n){return t+Cy("",n)},"")}};function Tl(){if(console&&console.warn){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];typeof n[0]=="string"&&(n[0]="react-i18next:: ".concat(n[0])),(e=console).warn.apply(e,n)}}var Ly={};function eb(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];typeof t[0]=="string"&&Ly[t[0]]||(typeof t[0]=="string"&&(Ly[t[0]]=new Date),Tl.apply(void 0,t))}var tb=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,nb={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},rb=function(t){return nb[t]},ob=function(t){return t.replace(tb,rb)};function Dy(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 ky(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Dy(Object(n),!0).forEach(function(r){Bt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Dy(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var lf={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:ob};function ib(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};lf=ky(ky({},lf),e)}function sb(){return lf}var Py;function ab(e){Py=e}function My(){return Py}var lb=["format"],cb=["children","count","parent","i18nKey","context","tOptions","values","defaults","components","ns","i18n","t","shouldUnescape"];function jy(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 Le(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?jy(Object(n),!0).forEach(function(r){Bt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jy(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function cf(e,t){if(!e)return!1;var n=e.props?e.props.children:e.children;return t?n.length>0:!!n}function uf(e){return e?e.props?e.props.children:e.children:[]}function ub(e){return Object.prototype.toString.call(e)!=="[object Array]"?!1:e.every(function(t){return N.isValidElement(t)})}function ms(e){return Array.isArray(e)?e:[e]}function db(e,t){var n=Le({},t);return n.props=Object.assign(e.props,t.props),n}function Uy(e,t){if(!e)return"";var n="",r=ms(e),o=t.transSupportBasicHtmlNodes&&t.transKeepBasicHtmlNodesFor?t.transKeepBasicHtmlNodesFor:[];return r.forEach(function(i,s){if(typeof i=="string")n+="".concat(i);else if(N.isValidElement(i)){var a=Object.keys(i.props).length,l=o.indexOf(i.type)>-1,c=i.props.children;if(!c&&l&&a===0)n+="<".concat(i.type,"/>");else if(!c&&(!l||a!==0))n+="<".concat(s,"></").concat(s,">");else if(i.props.i18nIsDynamicList)n+="<".concat(s,"></").concat(s,">");else if(l&&a===1&&typeof c=="string")n+="<".concat(i.type,">").concat(c,"</").concat(i.type,">");else{var d=Uy(c,t);n+="<".concat(s,">").concat(d,"</").concat(s,">")}}else if(i===null)Tl("Trans: the passed in value is invalid - seems you passed in a null child.");else if(ze(i)==="object"){var f=i.format,p=af(i,lb),h=Object.keys(p);if(h.length===1){var v=f?"".concat(h[0],", ").concat(f):h[0];n+="{{".concat(v,"}}")}else Tl("react-i18next: the passed in object contained more than one variable - the object should look like {{ value, format }} where format is optional.",i)}else Tl("Trans: the passed in value is invalid - seems you passed in a variable like {number} - please pass in variables for interpolation as full objects like {{number}}.",i)}),n}function fb(e,t,n,r,o,i){if(t==="")return[];var s=r.transKeepBasicHtmlNodesFor||[],a=t&&new RegExp(s.join("|")).test(t);if(!e&&!a)return[t];var l={};function c(y){var g=ms(y);g.forEach(function(m){typeof m!="string"&&(cf(m)?c(uf(m)):ze(m)==="object"&&!N.isValidElement(m)&&Object.assign(l,m))})}c(e);var d=ZI.parse("<0>".concat(t,"</0>")),f=Le(Le({},l),o);function p(y,g,m){var _=uf(y),S=v(_,g.children,m);return ub(_)&&S.length===0?_:S}function h(y,g,m,_,S){y.dummy&&(y.children=g),m.push(N.cloneElement(y,Le(Le({},y.props),{},{key:_}),S?void 0:g))}function v(y,g,m){var _=ms(y),S=ms(g);return S.reduce(function(x,R,I){var L=R.children&&R.children[0]&&R.children[0].content&&n.services.interpolator.interpolate(R.children[0].content,f,n.language);if(R.type==="tag"){var U=_[parseInt(R.name,10)];!U&&m.length===1&&m[0][R.name]&&(U=m[0][R.name]),U||(U={});var T=Object.keys(R.attrs).length!==0?db({props:R.attrs},U):U,b=N.isValidElement(T),V=b&&cf(R,!0)&&!R.voidElement,M=a&&ze(T)==="object"&&T.dummy&&!b,O=ze(e)==="object"&&e!==null&&Object.hasOwnProperty.call(e,R.name);if(typeof T=="string"){var j=n.services.interpolator.interpolate(T,f,n.language);x.push(j)}else if(cf(T)||V){var P=p(T,R,m);h(T,P,x,I)}else if(M){var $=v(_,R.children,m);x.push(N.cloneElement(T,Le(Le({},T.props),{},{key:I}),$))}else if(Number.isNaN(parseFloat(R.name)))if(O){var D=p(T,R,m);h(T,D,x,I,R.voidElement)}else if(r.transSupportBasicHtmlNodes&&s.indexOf(R.name)>-1)if(R.voidElement)x.push(N.createElement(R.name,{key:"".concat(R.name,"-").concat(I)}));else{var C=v(_,R.children,m);x.push(N.createElement(R.name,{key:"".concat(R.name,"-").concat(I)},C))}else if(R.voidElement)x.push("<".concat(R.name," />"));else{var k=v(_,R.children,m);x.push("<".concat(R.name,">").concat(k,"</").concat(R.name,">"))}else if(ze(T)==="object"&&!b){var F=R.children[0]?L:null;F&&x.push(F)}else R.children.length===1&&L?x.push(N.cloneElement(T,Le(Le({},T.props),{},{key:I}),L)):x.push(N.cloneElement(T,Le(Le({},T.props),{},{key:I})))}else if(R.type==="text"){var B=r.transWrapTextNodes,z=i?r.unescape(n.services.interpolator.interpolate(R.content,f,n.language)):n.services.interpolator.interpolate(R.content,f,n.language);B?x.push(N.createElement(B,{key:"".concat(R.name,"-").concat(I)},z)):x.push(z)}return x},[])}var E=v([{dummy:!0,children:e||[]}],d,ms(e||[]));return uf(E[0])}function pb(e){var t=e.children,n=e.count,r=e.parent,o=e.i18nKey,i=e.context,s=e.tOptions,a=s===void 0?{}:s,l=e.values,c=e.defaults,d=e.components,f=e.ns,p=e.i18n,h=e.t,v=e.shouldUnescape,E=af(e,cb),y=p||My();if(!y)return eb("You will need to pass in an i18next instance by using i18nextReactModule"),t;var g=h||y.t.bind(y)||function(V){return V};i&&(a.context=i);var m=Le(Le({},sb()),y.options&&y.options.react),_=f||g.ns||y.options&&y.options.defaultNS;_=typeof _=="string"?[_]:_||["translation"];var S=c||Uy(t,m)||m.transEmptyNodeValue||o,x=m.hashTransKey,R=o||(x?x(S):S),I=l?a.interpolation:{interpolation:Le(Le({},a.interpolation),{},{prefix:"#$?",suffix:"?$#"})},L=Le(Le(Le(Le({},a),{},{count:n},l),I),{},{defaultValue:S,ns:_}),U=R?g(R,L):S,T=fb(d||t,U,y,m,L,v),b=r!==void 0?r:m.defaultTransParent;return b?N.createElement(b,E,T):T}var hb={type:"3rdParty",init:function(t){ib(t.options.react),ab(t)}},gb=N.createContext();(function(){function e(){At(this,e),this.usedNamespaces={}}return It(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})();var mb=["children","count","parent","i18nKey","context","tOptions","values","defaults","components","ns","i18n","t","shouldUnescape"];function Fy(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 vb(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Fy(Object(n),!0).forEach(function(r){Bt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Fy(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Eb(e){var t=e.children,n=e.count,r=e.parent,o=e.i18nKey,i=e.context,s=e.tOptions,a=s===void 0?{}:s,l=e.values,c=e.defaults,d=e.components,f=e.ns,p=e.i18n,h=e.t,v=e.shouldUnescape,E=af(e,mb),y=N.useContext(gb)||{},g=y.i18n,m=y.defaultNS,_=p||g||My(),S=h||_&&_.t.bind(_);return pb(vb({children:t,count:n,parent:r,i18nKey:o,context:i,tOptions:a,values:l,defaults:c,components:d,ns:f||S&&S.ns||m||_&&_.options&&_.options.defaultNS,i18n:_,t:h,shouldUnescape:v},E))}var yb={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"]},_b={prefix:"fas",iconName:"bars",icon:[448,512,["navicon"],"f0c9","M0 96C0 78.3 14.3 64 32 64H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H32C14.3 128 0 113.7 0 96zM0 256c0-17.7 14.3-32 32-32H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H32c-17.7 0-32-14.3-32-32zM448 416c0 17.7-14.3 32-32 32H32c-17.7 0-32-14.3-32-32s14.3-32 32-32H416c17.7 0 32 14.3 32 32z"]},Sb={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"]},xb={prefix:"fas",iconName:"circle-dot",icon:[512,512,[128280,"dot-circle"],"f192","M256 512c141.4 0 256-114.6 256-256S397.4 0 256 0S0 114.6 0 256S114.6 512 256 512zm0-160c-53 0-96-43-96-96s43-96 96-96s96 43 96 96s-43 96-96 96z"]},Rb=xb,Nb={prefix:"fas",iconName:"diamond-exclamation",icon:[512,512,[],"e405","M227.7 11.7c15.6-15.6 40.9-15.6 56.6 0l216 216c15.6 15.6 15.6 40.9 0 56.6l-216 216c-15.6 15.6-40.9 15.6-56.6 0l-216-216c-15.6-15.6-15.6-40.9 0-56.6l216-216zM256 128c-13.3 0-24 10.7-24 24V264c0 13.3 10.7 24 24 24s24-10.7 24-24V152c0-13.3-10.7-24-24-24zm32 224a32 32 0 1 0 -64 0 32 32 0 1 0 64 0z"]},wb={prefix:"fas",iconName:"circle-check",icon:[512,512,[61533,"check-circle"],"f058","M256 512c141.4 0 256-114.6 256-256S397.4 0 256 0S0 114.6 0 256S114.6 512 256 512zM369 209L241 337c-9.4 9.4-24.6 9.4-33.9 0l-64-64c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l47 47L335 175c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9z"]},Ob={prefix:"fas",iconName:"arrows-rotate",icon:[512,512,[128472,"refresh","sync"],"f021","M89.1 202.6c7.7-21.8 20.2-42.3 37.8-59.8c62.5-62.5 163.8-62.5 226.3 0L370.3 160H320c-17.7 0-32 14.3-32 32s14.3 32 32 32H447.5c0 0 0 0 0 0h.4c17.7 0 32-14.3 32-32V64c0-17.7-14.3-32-32-32s-32 14.3-32 32v51.2L398.4 97.6c-87.5-87.5-229.3-87.5-316.8 0C57.2 122 39.6 150.7 28.8 181.4c-5.9 16.7 2.9 34.9 19.5 40.8s34.9-2.9 40.8-19.5zM23 289.3c-5 1.5-9.8 4.2-13.7 8.2c-4 4-6.7 8.8-8.1 14c-.3 1.2-.6 2.5-.8 3.8c-.3 1.7-.4 3.4-.4 5.1V448c0 17.7 14.3 32 32 32s32-14.3 32-32V396.9l17.6 17.5 0 0c87.5 87.4 229.3 87.4 316.7 0c24.4-24.4 42.1-53.1 52.9-83.7c5.9-16.7-2.9-34.9-19.5-40.8s-34.9 2.9-40.8 19.5c-7.7 21.8-20.2 42.3-37.8 59.8c-62.5 62.5-163.8 62.5-226.3 0l-.1-.1L109.6 352H160c17.7 0 32-14.3 32-32s-14.3-32-32-32H32.4c-1.6 0-3.2 .1-4.8 .3s-3.1 .5-4.6 1z"]},Tb={prefix:"fas",iconName:"arrow-turn-down-right",icon:[512,512,[],"e3d6","M64 64c0-17.7-14.3-32-32-32S0 46.3 0 64V224c0 53 43 96 96 96H402.7l-73.4 73.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l128-128c12.5-12.5 12.5-32.8 0-45.3l-128-128c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L402.7 256H96c-17.7 0-32-14.3-32-32V64z"]},Ab={prefix:"fas",iconName:"arrow-right",icon:[448,512,[8594],"f061","M438.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L338.8 224 32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l306.7 0L233.4 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l160-160z"]},Ib={prefix:"fas",iconName:"circle-question",icon:[512,512,[62108,"question-circle"],"f059","M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM169.8 165.3c7.9-22.3 29.1-37.3 52.8-37.3h58.3c34.9 0 63.1 28.3 63.1 63.1c0 22.6-12.1 43.5-31.7 54.8L280 264.4c-.2 13-10.9 23.6-24 23.6c-13.3 0-24-10.7-24-24V250.5c0-8.6 4.6-16.5 12.1-20.8l44.3-25.4c4.7-2.7 7.6-7.7 7.6-13.1c0-8.4-6.8-15.1-15.1-15.1H222.6c-3.4 0-6.4 2.1-7.5 5.3l-.4 1.2c-4.4 12.5-18.2 19-30.6 14.6s-19-18.2-14.6-30.6l.4-1.2zM224 352a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z"]},bb={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"]},Cb={prefix:"fas",iconName:"circle-small",icon:[320,512,[],"e122","M320 256c0 88.4-71.6 160-160 160S0 344.4 0 256S71.6 96 160 96s160 71.6 160 160z"]},Lb={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"]},Db={prefix:"fas",iconName:"bolt",icon:[384,512,[9889,"zap"],"f0e7","M317.4 44.6c5.9-13.7 1.5-29.7-10.6-38.5s-28.6-8-39.9 1.8l-256 224C.9 240.7-2.6 254.8 2 267.3S18.7 288 32 288H143.5L66.6 467.4c-5.9 13.7-1.5 29.7 10.6 38.5s28.6 8 39.9-1.8l256-224c10-8.8 13.6-22.9 8.9-35.3s-16.6-20.7-30-20.7H240.5L317.4 44.6z"]},kb={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"]},Pb={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"]},Mb={prefix:"fas",iconName:"clock-rotate-left",icon:[512,512,["history"],"f1da","M75 75L41 41C25.9 25.9 0 36.6 0 57.9V168c0 13.3 10.7 24 24 24H134.1c21.4 0 32.1-25.9 17-41l-30.8-30.8C155 85.5 203 64 256 64c106 0 192 86 192 192s-86 192-192 192c-40.8 0-78.6-12.7-109.7-34.4c-14.5-10.1-34.4-6.6-44.6 7.9s-6.6 34.4 7.9 44.6C151.2 495 201.7 512 256 512c141.4 0 256-114.6 256-256S397.4 0 256 0C185.3 0 121.3 28.7 75 75zm181 53c-13.3 0-24 10.7-24 24V256c0 6.4 2.5 12.5 7 17l72 72c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-65-65V152c0-13.3-10.7-24-24-24z"]},jb={prefix:"fas",iconName:"triangle-exclamation",icon:[512,512,[9888,"exclamation-triangle","warning"],"f071","M256 32c14.2 0 27.3 7.5 34.5 19.8l216 368c7.3 12.4 7.3 27.7 .2 40.1S486.3 480 472 480H40c-14.3 0-27.6-7.7-34.7-20.1s-7-27.8 .2-40.1l216-368C228.7 39.5 241.8 32 256 32zm0 128c-13.3 0-24 10.7-24 24V296c0 13.3 10.7 24 24 24s24-10.7 24-24V184c0-13.3-10.7-24-24-24zm32 224a32 32 0 1 0 -64 0 32 32 0 1 0 64 0z"]},Ub={prefix:"fas",iconName:"circle-xmark",icon:[512,512,[61532,"times-circle","xmark-circle"],"f057","M256 512c141.4 0 256-114.6 256-256S397.4 0 256 0S0 114.6 0 256S114.6 512 256 512zM175 175c9.4-9.4 24.6-9.4 33.9 0l47 47 47-47c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-47 47 47 47c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-47-47-47 47c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l47-47-47-47c-9.4-9.4-9.4-24.6 0-33.9z"]};const Fb={"arrow-left":bb,"arrow-right":Ab,"arrow-turn-down-right":Tb,"arrows-rotate":Ob,bars:_b,bolt:Db,"circle-check":wb,"circle-exclamation":Sb,"circle-info":Lb,"circle-question":Ib,"circle-small":Cb,"circle-xmark":Ub,"clock-rotate-left":Mb,"diamond-exclamation":Nb,"dot-circle":Rb,"trash-can":yb,"triangle-exclamation":jb,"up-from-bracket":Pb,xmark:kb},te=N.forwardRef(function({className:t="",size:n="",tag:r},o){const i=Fb[r];return i?u.jsx("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:u.jsx("path",{d:i.icon[4],fill:"currentColor"})}):(Ae().debug(`Unknown icon: ${r}`),null)}),Bo=({className:e="",confirm:t=!0,handleDelete:n,label:r,scale:o=1,show:i=!0,showLabel:s=!1,size:a})=>{const[l,c]=N.useState(!1),[d,f]=N.useState(o);o!==d&&(c(!1),f(o));const p=v=>{v.preventDefault(),c(E=>!E)},h=v=>{v.preventDefault(),n(v)};return u.jsx(sr,{enable:t,open:l,onOpenChange:c,placement:"top",scale:o,trigger:u.jsxs("button",{className:`${i?"visible opacity-100":"invisible opacity-0"} text-xs text-foreground/20 hover:text-negative group-hover/node-wrapper:visible group-hover/node-wrapper:animate-delay-opacity ${e}`,onClick:v=>p(v),children:[u.jsx(te,{tag:"trash-can",size:a})," ",u.jsx("span",{className:`${s?"whitespace-nowrap text-foreground/40 underline hover:text-negative":"sr-only"}`,children:r})]}),children:u.jsxs("div",{className:"text-xs font-semibold",children:[u.jsx("p",{className:"w-full pb-2 text-center",children:A(w.ARE_YOU_SURE)}),u.jsxs("div",{className:"align-center flex justify-between gap-2",children:[u.jsx("button",{className:"rounded bg-secondary py-1 px-2",onClick:v=>p(v),children:A(w.CANCEL)}),u.jsx("button",{className:"rounded bg-negative py-1 px-2",onClick:v=>h(v),children:A(w.DELETE)})]})]})})},Vb=e=>{const t=Y(n=>n.viewport.zoom);return u.jsx(Bo,{scale:t,...e})},$b=Ae(),Bb=100,Hb=100,Vy=({children:e,className:t="",onClickListItem:n})=>{const r=Y(c=>c.nodes),o=Y(c=>c.reactFlowInstance),i=Y(c=>c.validationWarnings),{setSelectedNodes:s}=Se();if(i.size===0)return null;const a=Array.from(i.values());a.sort((c,d)=>c.nodeTitle.toLowerCase().localeCompare(d.nodeTitle.toLowerCase()));const l=c=>{var h,v;const d=r.find(E=>E.id===c);if(!d){$b.error(`Node with id ${c} not found`);return}const f=((h=o==null?void 0:o.getNode(c))==null?void 0:h.height)??Hb,p=((v=o==null?void 0:o.getNode(c))==null?void 0:v.width)??zE;o==null||o.fitBounds({height:f+Bb,width:p,x:d.position.x,y:d.position.y},{duration:ef}),setTimeout(()=>s([d.id]),ef),n==null||n()};return u.jsxs("div",{className:`hidden max-h-60 flex-col sm:flex ${t}`,children:[e,u.jsxs("p",{className:"mb-2 text-xs",children:[A(w.NUMBER_OF_VALIDATION_WARNINGS,{count:a.length}),":"]}),u.jsx("div",{className:"flex-auto overflow-y-auto",children:u.jsx("ol",{className:"list-inside",children:a.map(c=>u.jsxs("li",{className:"mb-2 text-xs",children:[u.jsx("button",{className:"text-warning underline",onClick:()=>l(c.nodeId),children:A(c.nodeTitle)}),u.jsxs("ol",{className:"my-1 ml-4 flex list-inside flex-col gap-y-1",children:[!c.connected&&u.jsx("li",{children:A(w.NOT_CONNECTED_TO_FLOW)}),!c.valid&&u.jsx("li",{children:A(w.INVALID_SETTINGS)})]})]},c.id))})})]})},vs=e=>{const{className:t="",direction:n="from",valid:r=!0,...o}=e,i=n==="from";return u.jsxs("div",{className:`relative ${t} ${r?"":"invalid"}`,children:[u.jsx("input",{className:`w-full !pl-5 ${r?"":"invalid"}`,placeholder:A(i?w.FROM:w.TO),...o}),u.jsx(te,{className:"absolute left-[.25rem] top-[.5rem] text-foreground/40",tag:i?"arrow-left":"arrow-right"})]})},zb=({children:e})=>u.jsx("span",{className:"whitespace-wrap inline-block",children:u.jsx("code",{className:"mr-[0.5ch] whitespace-pre-wrap rounded-md bg-background p-0 px-[0.5ch] text-sm leading-4 tracking-tighter text-foreground",children:e})}),bt=({children:e})=>u.jsxs("section",{className:"flex gap-2 overflow-hidden px-4 pb-3 text-xs leading-5",children:[u.jsx("div",{className:"shrink-0 pl-1 text-secondary",children:u.jsx(te,{size:"lg",tag:"arrow-turn-down-right"})}),u.jsx("div",{className:"w-full overflow-hidden",children:e})]}),Wb=({connected:e=!1,deletable:t=!0,isRoot:n=!1,nodeId:r,nodeTitle:o,selected:i=!1})=>{const{removeNode:s}=Se(),a=Y(c=>c.isEdgeConnecting),l=(c=>c?"bg-positive/10 text-positive":e?"bg-focus/30 text-primary":"bg-foreground/10 text-foreground/50")(n);return u.jsxs("div",{className:"flex w-full items-center justify-start gap-x-2 p-4",children:[u.jsx("div",{className:`${l} flex h-5 w-5 shrink-0 items-center justify-center rounded-full`,children:u.jsx(te,{tag:"circle-small"})}),u.jsxs("div",{className:"flex-1",children:[u.jsx("h2",{className:"text-xs font-semibold",children:o}),!e&&u.jsxs("div",{className:"flex items-center justify-start text-tiny font-semibold leading-[14px] text-secondary",children:[u.jsx(te,{className:"px-1 text-warning",size:"lg",tag:"bolt"}),A(w.NOT_CONNECTED_TO_FLOW)]})]}),t&&!a&&u.jsx(Vb,{handleDelete:()=>s(r),label:A(w.REMOVE_NODE,{title:o}),show:i})]})},Gb=({valid:e})=>e?null:u.jsx("div",{className:"m-4 mt-0 inline-block",children:u.jsxs("div",{className:"flex items-start justify-start gap-2 rounded bg-negative/10 px-2 py-1 text-xs text-negative",children:[u.jsx(sr,{placement:"bottom",trigger:u.jsx("div",{role:"tooltip",tabIndex:0,children:u.jsx(te,{size:"lg",tag:"triangle-exclamation"})}),children:A(w.INFO_INVALID_SETTINGS)}),A(w.INVALID_SETTINGS)]})}),Yb=({nodeId:e,valid:t})=>{const{deleteValidationWarning:n,getTargetEdges:r,partialUpdateValidationWarning:o}=Se(),[i,s]=N.useState(!1);return N.useEffect(()=>{let a;const l=()=>{n(e),typeof a=="function"&&a()},c=()=>{const d=Y.getState().nodes.find(f=>f.id===e);if(!d)l();else{const f=r(e).length>0;s(f),o(e,{connected:f,nodeId:e,nodeType:d.type,valid:t})}};return c(),a=Y.subscribe((d,f)=>{const p=d.nodes.length!==f.nodes.length,h=d.edges.length!==f.edges.length,v=d.isEdgeUpdateSuccessful!==f.isEdgeUpdateSuccessful;(h||p||v)&&c()}),()=>{l()}},[n,r,e,o,t]),{isConnectedToFlow:i}},Kb=({id:e,isConnectable:t})=>{if(!e)throw new Error("TargetHandle: id is required");return u.jsx("div",{className:"absolute left-0 top-5 h-3 w-3 -translate-x-1/2",children:u.jsx(Co,{className:"-left-[2px] h-full w-full border-2 border-foreground/40 bg-background transition-colors hover:border-foreground/80",id:`target-${e}`,isConnectable:t,position:K.Left,type:"target"})})},Ue=({children:e,id:t,isConnectable:n=!0,isRoot:r=!1,nodeTitle:o,selected:i,deletable:s=!0,showValidation:a=!0,target:l=!0,valid:c=!0})=>{const{isConnectedToFlow:d}=Yb({nodeId:t,valid:c});return u.jsx("section",{className:`${i?"!border-focus":""} group/node-wrapper rounded-xl border-2 border-background shadow-[0_4px_12px_0_rgba(0,0,0,0.08)] transition-[visibility]`,children:u.jsxs("div",{className:"group/node-wrapper relative rounded-xl bg-background",style:{width:zE},children:[l&&t&&u.jsx(Kb,{id:t,isConnectable:n}),u.jsx(Wb,{connected:!l||d,deletable:s,isRoot:r,nodeId:t,nodeTitle:o,selected:i}),a&&u.jsx(Gb,{valid:c}),e]})})},Qb=({children:e,handleClick:t,...n})=>{const r=o=>{(o.key==="Backspace"||o.key==="Delete")&&(o.stopPropagation(),t==null||t())};return u.jsx("li",{role:"presentation",children:u.jsxs("div",{className:"flex items-center gap-2 rounded-lg bg-primary/20 p-1 pl-2 text-xs font-medium text-foreground",role:"option","aria-selected":"true",tabIndex:0,children:[e,u.jsxs("button",{className:"px-1",onClick:t,onKeyDown:r,type:"button",...n,children:[u.jsx("span",{className:"sr-only",children:"Remove"}),u.jsx(te,{tag:"xmark",size:"xs"})]})]})})},$y=({data:e})=>{let t=e.selected&&e[e.selected].trim();return t&&e.selected==="url"&&(t=JA(t)||A(w.PLAY_AUDIO)),t?u.jsx(bt,{children:u.jsx("div",{className:"max-w-max",children:e.selected==="url"?u.jsx("a",{className:"break-words text-primary underline line-clamp-2",href:e.url,target:"_blank",rel:"noopener noreferrer",children:t}):u.jsx("p",{className:"break-words line-clamp-2",children:t})})}):null},By=e=>{const{children:t,className:n="",disabled:r=!1,...o}=e;return u.jsxs("div",{className:`relative mb-2 after:pointer-events-none after:absolute after:top-[.725rem] after:right-3 after:h-0 after:w-0 after:border-[5px] after:border-t-[6px] after:border-b-0 after:border-r-transparent after:border-l-transparent after:content-['']
62
- ${r?"after:border-t-foreground/40":"after:border-t-foreground"}`,children:[u.jsx("select",{className:`pr-8 ${n}`,disabled:r,...o,children:t}),u.jsx("p",{className:"requirements w-full",role:"alert",children:A(w.ERROR_SELECTION_REQUIRED)})]})},an=e=>{const{label:t="",id:n="",...r}=e,o=N.useId(),i=n||o;return u.jsxs(u.Fragment,{children:[t&&u.jsx("label",{className:"block pb-1 font-medium",htmlFor:i,children:t}),u.jsx(By,{id:i,...r})]})},Xb=({label:e,vars:t={}})=>u.jsx(Eb,{components:{a:u.jsx("a",{className:"underline hover:text-background/80",href:t.linkTo||"#",target:"_blank",rel:"noopener noreferrer"}),code:u.jsx(zb,{}),p:u.jsx("p",{className:"mb-2"})},i18nKey:e}),qb={disabled:"border-disabled cursor-not-allowed",negative:"border-negative hover:bg-negative",positive:"border-positive hover:bg-positive"},zt=({color:e="positive",enabled:t=!0,id:n,isConnectable:r})=>{if(!n)throw new Error("SourceHandle: id is required");const o=t?e:"disabled",i=Y(d=>d.updatingSourceHandleId),l=!Y(d=>d.edges.some(f=>f.sourceHandle===n))||i===n,c=l&&r&&t;return u.jsx("div",{className:`absolute right-0 top-1/2 h-3 w-3 -translate-y-1/2 translate-x-1/2 ${c?"":"nodrag cursor-not-allowed"}`,children:u.jsx(Co,{className:`-right-[2px] h-full w-full border-2 bg-background transition-colors ${qb[o]??""}`,id:n,isConnectable:l&&r&&t,position:K.Right,type:"source"})})},Ho=({children:e})=>u.jsx("div",{className:"flex w-full flex-col items-start text-xs",children:e}),Wt=({color:e="positive",enabled:t=!0,id:n,isConnectable:r,optionSubtitle:o="",optionTitle:i})=>u.jsxs("div",{className:"relative w-full min-w-[104px] whitespace-nowrap border-t border-foreground/10 py-3",children:[u.jsx("div",{className:"flex flex-col items-start justify-center px-4",children:u.jsxs("div",{className:`${t?"":"text-disabled"} min-h-[1rem] w-full overflow-hidden`,children:[i,o?u.jsx("span",{className:"block text-xxs text-secondary",children:o}):null]})}),u.jsx(zt,{color:e,enabled:t,id:n,isConnectable:r})]}),Jb=({checked:e=!1,name:t,onClick:n})=>u.jsxs("button",{name:t,onClick:n,type:"button",className:`${e?"bg-primary":"bg-secondary"} relative inline-flex h-4 w-6 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:[u.jsx("span",{className:"sr-only",children:A(e?w.ON:w.OFF)}),u.jsx("span",{className:`pointer-events-none inline-block h-3 w-3 ${e?"translate-x-2":"translate-x-0"} transform rounded-full bg-white shadow transition duration-200 ease-in-out`})]}),df=({checked:e,clickHandler:t,name:n,subtitle:r,title:o})=>u.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[u.jsxs("div",{className:"flex flex-grow flex-col",children:[u.jsx("span",{className:"text-xs",children:o}),r&&u.jsx("span",{className:"text-xxs text-foreground/50",children:r})]}),u.jsx(Jb,{checked:e,name:n,onClick:t})]}),On=({errorText:e,label:t,name:n,onChange:r,required:o,valid:i,value:s,...a})=>u.jsxs(u.Fragment,{children:[t!=null&&t.trim()?u.jsx("div",{className:"pb-1",children:t}):null,u.jsx("textarea",{"aria-invalid":i?void 0:"true",className:`peer min-h-[77px] w-full resize-y ${i?"":"invalid"}`,inputMode:"text",minLength:1,name:n,onChange:r,required:o,value:s,...a}),u.jsx("p",{className:"requirements",role:"alert",children:e})]});/*!
60
+ */var Ka=w,j1=M1;function U1(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var F1=typeof Object.is=="function"?Object.is:U1,V1=j1.useSyncExternalStore,$1=Ka.useRef,B1=Ka.useEffect,H1=Ka.useMemo,z1=Ka.useDebugValue;Tm.useSyncExternalStoreWithSelector=function(e,t,n,r,o){var i=$1(null);if(i.current===null){var s={hasValue:!1,value:null};i.current=s}else s=i.current;i=H1(function(){function l(h){if(!c){if(c=!0,d=h,h=r(h),o!==void 0&&s.hasValue){var E=s.value;if(o(E,h))return f=E}return f=h}if(E=f,F1(d,h))return E;var v=r(h);return o!==void 0&&o(E,v)?E:(d=h,f=v)}var c=!1,d,f,p=n===void 0?null:n;return[function(){return l(t())},p===null?void 0:function(){return l(p())}]},[t,n,r,o]);var a=V1(e,i[0],i[1]);return B1(function(){s.hasValue=!0,s.value=a},[a]),z1(a),a},Om.exports=Tm;var W1=Om.exports;const bm=Yl(W1),Cm=e=>{let t;const n=new Set,r=(l,c)=>{const d=typeof l=="function"?l(t):l;if(!Object.is(d,t)){const f=t;t=c??typeof d!="object"?d:Object.assign({},t,d),n.forEach(p=>p(t,f))}},o=()=>t,a={setState:r,getState:o,subscribe:l=>(n.add(l),()=>n.delete(l)),destroy:()=>{n.clear()}};return t=e(r,o,a),a},Lm=e=>e?Cm(e):Cm,{useSyncExternalStoreWithSelector:G1}=bm;function Dm(e,t=e.getState,n){const r=G1(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return w.useDebugValue(r),r}const km=(e,t)=>{const n=Lm(e),r=(o,i=t)=>Dm(n,o,i);return Object.assign(r,n),r},Y1=(e,t)=>e?km(e,t):km;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 K1={value:()=>{}};function Qa(){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 Xa(n)}function Xa(e){this._=e}function Q1(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}})}Xa.prototype=Qa.prototype={constructor:Xa,on:function(e,t){var n=this._,r=Q1(e+"",n),o,i=-1,s=r.length;if(arguments.length<2){for(;++i<s;)if((o=(e=r[i]).type)&&(o=X1(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]=Pm(n[o],e.name,t);else if(t==null)for(o in n)n[o]=Pm(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 Xa(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 X1(e,t){for(var n=0,r=e.length,o;n<r;++n)if((o=e[n]).name===t)return o.value}function Pm(e,t,n){for(var r=0,o=e.length;r<o;++r)if(e[r].name===t){e[r]=K1,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var hd="http://www.w3.org/1999/xhtml";const Mm={svg:"http://www.w3.org/2000/svg",xhtml:hd,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function qa(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),Mm.hasOwnProperty(t)?{space:Mm[t],local:e}:e}function q1(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===hd&&t.documentElement.namespaceURI===hd?t.createElement(e):t.createElementNS(n,e)}}function J1(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function jm(e){var t=qa(e);return(t.local?J1:q1)(t)}function Z1(){}function gd(e){return e==null?Z1:function(){return this.querySelector(e)}}function eR(e){typeof e!="function"&&(e=gd(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,c,d=0;d<s;++d)(l=i[d])&&(c=e.call(l,l.__data__,d,i))&&("__data__"in l&&(c.__data__=l.__data__),a[d]=c);return new mt(r,this._parents)}function tR(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function nR(){return[]}function Um(e){return e==null?nR:function(){return this.querySelectorAll(e)}}function rR(e){return function(){return tR(e.apply(this,arguments))}}function oR(e){typeof e=="function"?e=rR(e):e=Um(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,c=0;c<a;++c)(l=s[c])&&(r.push(e.call(l,l.__data__,c,s)),o.push(l));return new mt(r,o)}function Fm(e){return function(){return this.matches(e)}}function Vm(e){return function(t){return t.matches(e)}}var iR=Array.prototype.find;function sR(e){return function(){return iR.call(this.children,e)}}function aR(){return this.firstElementChild}function lR(e){return this.select(e==null?aR:sR(typeof e=="function"?e:Vm(e)))}var cR=Array.prototype.filter;function uR(){return Array.from(this.children)}function dR(e){return function(){return cR.call(this.children,e)}}function fR(e){return this.selectAll(e==null?uR:dR(typeof e=="function"?e:Vm(e)))}function pR(e){typeof e!="function"&&(e=Fm(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,c=0;c<s;++c)(l=i[c])&&e.call(l,l.__data__,c,i)&&a.push(l);return new mt(r,this._parents)}function $m(e){return new Array(e.length)}function hR(){return new mt(this._enter||this._groups.map($m),this._parents)}function Ja(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Ja.prototype={constructor:Ja,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 gR(e){return function(){return e}}function mR(e,t,n,r,o,i){for(var s=0,a,l=t.length,c=i.length;s<c;++s)(a=t[s])?(a.__data__=i[s],r[s]=a):n[s]=new Ja(e,i[s]);for(;s<l;++s)(a=t[s])&&(o[s]=a)}function ER(e,t,n,r,o,i,s){var a,l,c=new Map,d=t.length,f=i.length,p=new Array(d),h;for(a=0;a<d;++a)(l=t[a])&&(p[a]=h=s.call(l,l.__data__,a,t)+"",c.has(h)?o[a]=l:c.set(h,l));for(a=0;a<f;++a)h=s.call(e,i[a],a,i)+"",(l=c.get(h))?(r[a]=l,l.__data__=i[a],c.delete(h)):n[a]=new Ja(e,i[a]);for(a=0;a<d;++a)(l=t[a])&&c.get(p[a])===l&&(o[a]=l)}function vR(e){return e.__data__}function yR(e,t){if(!arguments.length)return Array.from(this,vR);var n=t?ER:mR,r=this._parents,o=this._groups;typeof e!="function"&&(e=gR(e));for(var i=o.length,s=new Array(i),a=new Array(i),l=new Array(i),c=0;c<i;++c){var d=r[c],f=o[c],p=f.length,h=_R(e.call(d,d&&d.__data__,c,r)),E=h.length,v=a[c]=new Array(E),y=s[c]=new Array(E),g=l[c]=new Array(p);n(d,f,v,y,g,h,t);for(var m=0,_=0,S,x;m<E;++m)if(S=v[m]){for(m>=_&&(_=m+1);!(x=y[_])&&++_<E;);S._next=x||null}}return s=new mt(s,r),s._enter=a,s._exit=l,s}function _R(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function SR(){return new mt(this._exit||this._groups.map($m),this._parents)}function xR(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 RR(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 c=n[l],d=r[l],f=c.length,p=a[l]=new Array(f),h,E=0;E<f;++E)(h=c[E]||d[E])&&(p[E]=h);for(;l<o;++l)a[l]=n[l];return new mt(a,this._parents)}function NR(){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 wR(e){e||(e=OR);function t(f,p){return f&&p?e(f.__data__,p.__data__):!f-!p}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),c,d=0;d<a;++d)(c=s[d])&&(l[d]=c);l.sort(t)}return new mt(o,this._parents).order()}function OR(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function TR(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function AR(){return Array.from(this)}function IR(){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 bR(){let e=0;for(const t of this)++e;return e}function CR(){return!this.node()}function LR(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 DR(e){return function(){this.removeAttribute(e)}}function kR(e){return function(){this.removeAttributeNS(e.space,e.local)}}function PR(e,t){return function(){this.setAttribute(e,t)}}function MR(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function jR(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function UR(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 FR(e,t){var n=qa(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?kR:DR:typeof t=="function"?n.local?UR:jR:n.local?MR:PR)(n,t))}function Bm(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function VR(e){return function(){this.style.removeProperty(e)}}function $R(e,t,n){return function(){this.style.setProperty(e,t,n)}}function BR(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function HR(e,t,n){return arguments.length>1?this.each((t==null?VR:typeof t=="function"?BR:$R)(e,t,n??"")):No(this.node(),e)}function No(e,t){return e.style.getPropertyValue(t)||Bm(e).getComputedStyle(e,null).getPropertyValue(t)}function zR(e){return function(){delete this[e]}}function WR(e,t){return function(){this[e]=t}}function GR(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function YR(e,t){return arguments.length>1?this.each((t==null?zR:typeof t=="function"?GR:WR)(e,t)):this.node()[e]}function Hm(e){return e.trim().split(/^|\s+/)}function md(e){return e.classList||new zm(e)}function zm(e){this._node=e,this._names=Hm(e.getAttribute("class")||"")}zm.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 Wm(e,t){for(var n=md(e),r=-1,o=t.length;++r<o;)n.add(t[r])}function Gm(e,t){for(var n=md(e),r=-1,o=t.length;++r<o;)n.remove(t[r])}function KR(e){return function(){Wm(this,e)}}function QR(e){return function(){Gm(this,e)}}function XR(e,t){return function(){(t.apply(this,arguments)?Wm:Gm)(this,e)}}function qR(e,t){var n=Hm(e+"");if(arguments.length<2){for(var r=md(this.node()),o=-1,i=n.length;++o<i;)if(!r.contains(n[o]))return!1;return!0}return this.each((typeof t=="function"?XR:t?KR:QR)(n,t))}function JR(){this.textContent=""}function ZR(e){return function(){this.textContent=e}}function eN(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function tN(e){return arguments.length?this.each(e==null?JR:(typeof e=="function"?eN:ZR)(e)):this.node().textContent}function nN(){this.innerHTML=""}function rN(e){return function(){this.innerHTML=e}}function oN(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function iN(e){return arguments.length?this.each(e==null?nN:(typeof e=="function"?oN:rN)(e)):this.node().innerHTML}function sN(){this.nextSibling&&this.parentNode.appendChild(this)}function aN(){return this.each(sN)}function lN(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function cN(){return this.each(lN)}function uN(e){var t=typeof e=="function"?e:jm(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function dN(){return null}function fN(e,t){var n=typeof e=="function"?e:jm(e),r=t==null?dN:typeof t=="function"?t:gd(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function pN(){var e=this.parentNode;e&&e.removeChild(this)}function hN(){return this.each(pN)}function gN(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function mN(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function EN(e){return this.select(e?mN:gN)}function vN(e){return arguments.length?this.property("__data__",e):this.node().__data__}function yN(e){return function(t){e.call(this,t,this.__data__)}}function _N(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 SN(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 xN(e,t,n){return function(){var r=this.__on,o,i=yN(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 RN(e,t,n){var r=_N(e+""),o,i=r.length,s;if(arguments.length<2){var a=this.node().__on;if(a){for(var l=0,c=a.length,d;l<c;++l)for(o=0,d=a[l];o<i;++o)if((s=r[o]).type===d.type&&s.name===d.name)return d.value}return}for(a=t?xN:SN,o=0;o<i;++o)this.each(a(r[o],t,n));return this}function Ym(e,t,n){var r=Bm(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 NN(e,t){return function(){return Ym(this,e,t)}}function wN(e,t){return function(){return Ym(this,e,t.apply(this,arguments))}}function ON(e,t){return this.each((typeof t=="function"?wN:NN)(e,t))}function*TN(){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 Km=[null];function mt(e,t){this._groups=e,this._parents=t}function Wi(){return new mt([[document.documentElement]],Km)}function AN(){return this}mt.prototype=Wi.prototype={constructor:mt,select:eR,selectAll:oR,selectChild:lR,selectChildren:fR,filter:pR,data:yR,enter:hR,exit:SR,join:xR,merge:RR,selection:AN,order:NR,sort:wR,call:TR,nodes:AR,node:IR,size:bR,empty:CR,each:LR,attr:FR,style:HR,property:YR,classed:qR,text:tN,html:iN,raise:aN,lower:cN,append:uN,insert:fN,remove:hN,clone:EN,datum:vN,on:RN,dispatch:ON,[Symbol.iterator]:TN};function Vt(e){return typeof e=="string"?new mt([[document.querySelector(e)]],[document.documentElement]):new mt([[e]],Km)}function IN(e){let t;for(;t=e.sourceEvent;)e=t;return e}function en(e,t){if(e=IN(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 bN={passive:!1},Gi={capture:!0,passive:!1};function Ed(e){e.stopImmediatePropagation()}function wo(e){e.preventDefault(),e.stopImmediatePropagation()}function Qm(e){var t=e.document.documentElement,n=Vt(e).on("dragstart.drag",wo,Gi);"onselectstart"in t?n.on("selectstart.drag",wo,Gi):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function Xm(e,t){var n=e.document.documentElement,r=Vt(e).on("dragstart.drag",null);t&&(r.on("click.drag",wo,Gi),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 Za=e=>()=>e;function vd(e,{sourceEvent:t,subject:n,target:r,identifier:o,active:i,x:s,y:a,dx:l,dy:c,dispatch:d}){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:c,enumerable:!0,configurable:!0},_:{value:d}})}vd.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function CN(e){return!e.ctrlKey&&!e.button}function LN(){return this.parentNode}function DN(e,t){return t??{x:e.x,y:e.y}}function kN(){return navigator.maxTouchPoints||"ontouchstart"in this}function PN(){var e=CN,t=LN,n=DN,r=kN,o={},i=Qa("start","drag","end"),s=0,a,l,c,d,f=0;function p(S){S.on("mousedown.drag",h).filter(r).on("touchstart.drag",y).on("touchmove.drag",g,bN).on("touchend.drag touchcancel.drag",m).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function h(S,x){if(!(d||!e.call(this,S,x))){var R=_(this,t.call(this,S,x),S,x,"mouse");R&&(Vt(S.view).on("mousemove.drag",E,Gi).on("mouseup.drag",v,Gi),Qm(S.view),Ed(S),c=!1,a=S.clientX,l=S.clientY,R("start",S))}}function E(S){if(wo(S),!c){var x=S.clientX-a,R=S.clientY-l;c=x*x+R*R>f}o.mouse("drag",S)}function v(S){Vt(S.view).on("mousemove.drag mouseup.drag",null),Xm(S.view,c),wo(S),o.mouse("end",S)}function y(S,x){if(e.call(this,S,x)){var R=S.changedTouches,I=t.call(this,S,x),L=R.length,U,A;for(U=0;U<L;++U)(A=_(this,I,S,x,R[U].identifier,R[U]))&&(Ed(S),A("start",S,R[U]))}}function g(S){var x=S.changedTouches,R=x.length,I,L;for(I=0;I<R;++I)(L=o[x[I].identifier])&&(wo(S),L("drag",S,x[I]))}function m(S){var x=S.changedTouches,R=x.length,I,L;for(d&&clearTimeout(d),d=setTimeout(function(){d=null},500),I=0;I<R;++I)(L=o[x[I].identifier])&&(Ed(S),L("end",S,x[I]))}function _(S,x,R,I,L,U){var A=i.copy(),b=en(U||R,x),V,M,O;if((O=n.call(S,new vd("beforestart",{sourceEvent:R,target:p,identifier:L,active:s,x:b[0],y:b[1],dx:0,dy:0,dispatch:A}),I))!=null)return V=O.x-b[0]||0,M=O.y-b[1]||0,function j(P,$,D){var C=b,k;switch(P){case"start":o[L]=j,k=s++;break;case"end":delete o[L],--s;case"drag":b=en(D||$,x),k=s;break}A.call(P,S,new vd(P,{sourceEvent:$,subject:O,target:p,identifier:L,active:k,x:b[0]+V,y:b[1]+M,dx:b[0]-C[0],dy:b[1]-C[1],dispatch:A}),I)}}return p.filter=function(S){return arguments.length?(e=typeof S=="function"?S:Za(!!S),p):e},p.container=function(S){return arguments.length?(t=typeof S=="function"?S:Za(S),p):t},p.subject=function(S){return arguments.length?(n=typeof S=="function"?S:Za(S),p):n},p.touchable=function(S){return arguments.length?(r=typeof S=="function"?S:Za(!!S),p):r},p.on=function(){var S=i.on.apply(i,arguments);return S===i?p:S},p.clickDistance=function(S){return arguments.length?(f=(S=+S)*S,p):Math.sqrt(f)},p}function yd(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function qm(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Yi(){}var Ki=.7,el=1/Ki,Oo="\\s*([+-]?\\d+)\\s*",Qi="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",tn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",MN=/^#([0-9a-f]{3,8})$/,jN=new RegExp(`^rgb\\(${Oo},${Oo},${Oo}\\)$`),UN=new RegExp(`^rgb\\(${tn},${tn},${tn}\\)$`),FN=new RegExp(`^rgba\\(${Oo},${Oo},${Oo},${Qi}\\)$`),VN=new RegExp(`^rgba\\(${tn},${tn},${tn},${Qi}\\)$`),$N=new RegExp(`^hsl\\(${Qi},${tn},${tn}\\)$`),BN=new RegExp(`^hsla\\(${Qi},${tn},${tn},${Qi}\\)$`),Jm={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};yd(Yi,Xi,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Zm,formatHex:Zm,formatHex8:HN,formatHsl:zN,formatRgb:eE,toString:eE});function Zm(){return this.rgb().formatHex()}function HN(){return this.rgb().formatHex8()}function zN(){return iE(this).formatHsl()}function eE(){return this.rgb().formatRgb()}function Xi(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=MN.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?tE(t):n===3?new at(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?tl(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?tl(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=jN.exec(e))?new at(t[1],t[2],t[3],1):(t=UN.exec(e))?new at(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=FN.exec(e))?tl(t[1],t[2],t[3],t[4]):(t=VN.exec(e))?tl(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=$N.exec(e))?oE(t[1],t[2]/100,t[3]/100,1):(t=BN.exec(e))?oE(t[1],t[2]/100,t[3]/100,t[4]):Jm.hasOwnProperty(e)?tE(Jm[e]):e==="transparent"?new at(NaN,NaN,NaN,0):null}function tE(e){return new at(e>>16&255,e>>8&255,e&255,1)}function tl(e,t,n,r){return r<=0&&(e=t=n=NaN),new at(e,t,n,r)}function WN(e){return e instanceof Yi||(e=Xi(e)),e?(e=e.rgb(),new at(e.r,e.g,e.b,e.opacity)):new at}function _d(e,t,n,r){return arguments.length===1?WN(e):new at(e,t,n,r??1)}function at(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}yd(at,_d,qm(Yi,{brighter(e){return e=e==null?el:Math.pow(el,e),new at(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Ki:Math.pow(Ki,e),new at(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new at(Or(this.r),Or(this.g),Or(this.b),nl(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:nE,formatHex:nE,formatHex8:GN,formatRgb:rE,toString:rE}));function nE(){return`#${Tr(this.r)}${Tr(this.g)}${Tr(this.b)}`}function GN(){return`#${Tr(this.r)}${Tr(this.g)}${Tr(this.b)}${Tr((isNaN(this.opacity)?1:this.opacity)*255)}`}function rE(){const e=nl(this.opacity);return`${e===1?"rgb(":"rgba("}${Or(this.r)}, ${Or(this.g)}, ${Or(this.b)}${e===1?")":`, ${e})`}`}function nl(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Or(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Tr(e){return e=Or(e),(e<16?"0":"")+e.toString(16)}function oE(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new $t(e,t,n,r)}function iE(e){if(e instanceof $t)return new $t(e.h,e.s,e.l,e.opacity);if(e instanceof Yi||(e=Xi(e)),!e)return new $t;if(e instanceof $t)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 $t(s,a,l,e.opacity)}function YN(e,t,n,r){return arguments.length===1?iE(e):new $t(e,t,n,r??1)}function $t(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}yd($t,YN,qm(Yi,{brighter(e){return e=e==null?el:Math.pow(el,e),new $t(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Ki:Math.pow(Ki,e),new $t(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 at(Sd(e>=240?e-240:e+120,o,r),Sd(e,o,r),Sd(e<120?e+240:e-120,o,r),this.opacity)},clamp(){return new $t(sE(this.h),rl(this.s),rl(this.l),nl(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=nl(this.opacity);return`${e===1?"hsl(":"hsla("}${sE(this.h)}, ${rl(this.s)*100}%, ${rl(this.l)*100}%${e===1?")":`, ${e})`}`}}));function sE(e){return e=(e||0)%360,e<0?e+360:e}function rl(e){return Math.max(0,Math.min(1,e||0))}function Sd(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 aE=e=>()=>e;function KN(e,t){return function(n){return e+n*t}}function QN(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 XN(e){return(e=+e)==1?lE:function(t,n){return n-t?QN(t,n,e):aE(isNaN(t)?n:t)}}function lE(e,t){var n=t-e;return n?KN(e,n):aE(isNaN(e)?t:e)}const cE=function e(t){var n=XN(t);function r(o,i){var s=n((o=_d(o)).r,(i=_d(i)).r),a=n(o.g,i.g),l=n(o.b,i.b),c=lE(o.opacity,i.opacity);return function(d){return o.r=s(d),o.g=a(d),o.b=l(d),o.opacity=c(d),o+""}}return r.gamma=e,r}(1);function Kn(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}var xd=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Rd=new RegExp(xd.source,"g");function qN(e){return function(){return e}}function JN(e){return function(t){return e(t)+""}}function ZN(e,t){var n=xd.lastIndex=Rd.lastIndex=0,r,o,i,s=-1,a=[],l=[];for(e=e+"",t=t+"";(r=xd.exec(e))&&(o=Rd.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:Kn(r,o)})),n=Rd.lastIndex;return n<t.length&&(i=t.slice(n),a[s]?a[s]+=i:a[++s]=i),a.length<2?l[0]?JN(l[0].x):qN(t):(t=l.length,function(c){for(var d=0,f;d<t;++d)a[(f=l[d]).i]=f.x(c);return a.join("")})}var uE=180/Math.PI,Nd={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function dE(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)*uE,skewX:Math.atan(l)*uE,scaleX:s,scaleY:a}}var ol;function ew(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Nd:dE(t.a,t.b,t.c,t.d,t.e,t.f)}function tw(e){return e==null||(ol||(ol=document.createElementNS("http://www.w3.org/2000/svg","g")),ol.setAttribute("transform",e),!(e=ol.transform.baseVal.consolidate()))?Nd:(e=e.matrix,dE(e.a,e.b,e.c,e.d,e.e,e.f))}function fE(e,t,n,r){function o(c){return c.length?c.pop()+" ":""}function i(c,d,f,p,h,E){if(c!==f||d!==p){var v=h.push("translate(",null,t,null,n);E.push({i:v-4,x:Kn(c,f)},{i:v-2,x:Kn(d,p)})}else(f||p)&&h.push("translate("+f+t+p+n)}function s(c,d,f,p){c!==d?(c-d>180?d+=360:d-c>180&&(c+=360),p.push({i:f.push(o(f)+"rotate(",null,r)-2,x:Kn(c,d)})):d&&f.push(o(f)+"rotate("+d+r)}function a(c,d,f,p){c!==d?p.push({i:f.push(o(f)+"skewX(",null,r)-2,x:Kn(c,d)}):d&&f.push(o(f)+"skewX("+d+r)}function l(c,d,f,p,h,E){if(c!==f||d!==p){var v=h.push(o(h)+"scale(",null,",",null,")");E.push({i:v-4,x:Kn(c,f)},{i:v-2,x:Kn(d,p)})}else(f!==1||p!==1)&&h.push(o(h)+"scale("+f+","+p+")")}return function(c,d){var f=[],p=[];return c=e(c),d=e(d),i(c.translateX,c.translateY,d.translateX,d.translateY,f,p),s(c.rotate,d.rotate,f,p),a(c.skewX,d.skewX,f,p),l(c.scaleX,c.scaleY,d.scaleX,d.scaleY,f,p),c=d=null,function(h){for(var E=-1,v=p.length,y;++E<v;)f[(y=p[E]).i]=y.x(h);return f.join("")}}}var nw=fE(ew,"px, ","px)","deg)"),rw=fE(tw,", ",")",")"),ow=1e-12;function pE(e){return((e=Math.exp(e))+1/e)/2}function iw(e){return((e=Math.exp(e))-1/e)/2}function sw(e){return((e=Math.exp(2*e))-1)/(e+1)}const aw=function e(t,n,r){function o(i,s){var a=i[0],l=i[1],c=i[2],d=s[0],f=s[1],p=s[2],h=d-a,E=f-l,v=h*h+E*E,y,g;if(v<ow)g=Math.log(p/c)/t,y=function(I){return[a+I*h,l+I*E,c*Math.exp(t*I*g)]};else{var m=Math.sqrt(v),_=(p*p-c*c+r*v)/(2*c*n*m),S=(p*p-c*c-r*v)/(2*p*n*m),x=Math.log(Math.sqrt(_*_+1)-_),R=Math.log(Math.sqrt(S*S+1)-S);g=(R-x)/t,y=function(I){var L=I*g,U=pE(x),A=c/(n*m)*(U*sw(t*L+x)-iw(x));return[a+A*h,l+A*E,c*U/pE(t*L+x)]}}return y.duration=g*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 To=0,qi=0,Ji=0,hE=1e3,il,Zi,sl=0,Ar=0,al=0,es=typeof performance=="object"&&performance.now?performance:Date,gE=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function wd(){return Ar||(gE(lw),Ar=es.now()+al)}function lw(){Ar=0}function ll(){this._call=this._time=this._next=null}ll.prototype=mE.prototype={constructor:ll,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?wd():+n)+(t==null?0:+t),!this._next&&Zi!==this&&(Zi?Zi._next=this:il=this,Zi=this),this._call=e,this._time=n,Od()},stop:function(){this._call&&(this._call=null,this._time=1/0,Od())}};function mE(e,t,n){var r=new ll;return r.restart(e,t,n),r}function cw(){wd(),++To;for(var e=il,t;e;)(t=Ar-e._time)>=0&&e._call.call(void 0,t),e=e._next;--To}function EE(){Ar=(sl=es.now())+al,To=qi=0;try{cw()}finally{To=0,dw(),Ar=0}}function uw(){var e=es.now(),t=e-sl;t>hE&&(al-=t,sl=e)}function dw(){for(var e,t=il,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:il=n);Zi=e,Od(r)}function Od(e){if(!To){qi&&(qi=clearTimeout(qi));var t=e-Ar;t>24?(e<1/0&&(qi=setTimeout(EE,e-es.now()-al)),Ji&&(Ji=clearInterval(Ji))):(Ji||(sl=es.now(),Ji=setInterval(uw,hE)),To=1,gE(EE))}}function vE(e,t,n){var r=new ll;return t=t==null?0:+t,r.restart(o=>{r.stop(),e(o+t)},t,n),r}var fw=Qa("start","end","cancel","interrupt"),pw=[],yE=0,_E=1,Td=2,cl=3,SE=4,Ad=5,ul=6;function dl(e,t,n,r,o,i){var s=e.__transition;if(!s)e.__transition={};else if(n in s)return;hw(e,n,{name:t,index:r,group:o,on:fw,tween:pw,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:yE})}function Id(e,t){var n=Bt(e,t);if(n.state>yE)throw new Error("too late; already scheduled");return n}function nn(e,t){var n=Bt(e,t);if(n.state>cl)throw new Error("too late; already running");return n}function Bt(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function hw(e,t,n){var r=e.__transition,o;r[t]=n,n.timer=mE(i,0,n.time);function i(c){n.state=_E,n.timer.restart(s,n.delay,n.time),n.delay<=c&&s(c-n.delay)}function s(c){var d,f,p,h;if(n.state!==_E)return l();for(d in r)if(h=r[d],h.name===n.name){if(h.state===cl)return vE(s);h.state===SE?(h.state=ul,h.timer.stop(),h.on.call("interrupt",e,e.__data__,h.index,h.group),delete r[d]):+d<t&&(h.state=ul,h.timer.stop(),h.on.call("cancel",e,e.__data__,h.index,h.group),delete r[d])}if(vE(function(){n.state===cl&&(n.state=SE,n.timer.restart(a,n.delay,n.time),a(c))}),n.state=Td,n.on.call("start",e,e.__data__,n.index,n.group),n.state===Td){for(n.state=cl,o=new Array(p=n.tween.length),d=0,f=-1;d<p;++d)(h=n.tween[d].value.call(e,e.__data__,n.index,n.group))&&(o[++f]=h);o.length=f+1}}function a(c){for(var d=c<n.duration?n.ease.call(null,c/n.duration):(n.timer.restart(l),n.state=Ad,1),f=-1,p=o.length;++f<p;)o[f].call(e,d);n.state===Ad&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){n.state=ul,n.timer.stop(),delete r[t];for(var c in r)return;delete e.__transition}}function fl(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>Td&&r.state<Ad,r.state=ul,r.timer.stop(),r.on.call(o?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[s]}i&&delete e.__transition}}function gw(e){return this.each(function(){fl(this,e)})}function mw(e,t){var n,r;return function(){var o=nn(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 Ew(e,t,n){var r,o;if(typeof n!="function")throw new Error;return function(){var i=nn(this,e),s=i.tween;if(s!==r){o=(r=s).slice();for(var a={name:t,value:n},l=0,c=o.length;l<c;++l)if(o[l].name===t){o[l]=a;break}l===c&&o.push(a)}i.tween=o}}function vw(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=Bt(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?mw:Ew)(n,e,t))}function bd(e,t,n){var r=e._id;return e.each(function(){var o=nn(this,r);(o.value||(o.value={}))[t]=n.apply(this,arguments)}),function(o){return Bt(o,r).value[t]}}function xE(e,t){var n;return(typeof t=="number"?Kn:t instanceof Xi?cE:(n=Xi(t))?(t=n,cE):ZN)(e,t)}function yw(e){return function(){this.removeAttribute(e)}}function _w(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Sw(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 xw(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 Rw(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 Nw(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 ww(e,t){var n=qa(e),r=n==="transform"?rw:xE;return this.attrTween(e,typeof t=="function"?(n.local?Nw:Rw)(n,r,bd(this,"attr."+e,t)):t==null?(n.local?_w:yw)(n):(n.local?xw:Sw)(n,r,t))}function Ow(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function Tw(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function Aw(e,t){var n,r;function o(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&Tw(e,i)),n}return o._value=t,o}function Iw(e,t){var n,r;function o(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&Ow(e,i)),n}return o._value=t,o}function bw(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=qa(e);return this.tween(n,(r.local?Aw:Iw)(r,t))}function Cw(e,t){return function(){Id(this,e).delay=+t.apply(this,arguments)}}function Lw(e,t){return t=+t,function(){Id(this,e).delay=t}}function Dw(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Cw:Lw)(t,e)):Bt(this.node(),t).delay}function kw(e,t){return function(){nn(this,e).duration=+t.apply(this,arguments)}}function Pw(e,t){return t=+t,function(){nn(this,e).duration=t}}function Mw(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?kw:Pw)(t,e)):Bt(this.node(),t).duration}function jw(e,t){if(typeof t!="function")throw new Error;return function(){nn(this,e).ease=t}}function Uw(e){var t=this._id;return arguments.length?this.each(jw(t,e)):Bt(this.node(),t).ease}function Fw(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;nn(this,e).ease=n}}function Vw(e){if(typeof e!="function")throw new Error;return this.each(Fw(this._id,e))}function $w(e){typeof e!="function"&&(e=Fm(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,c=0;c<s;++c)(l=i[c])&&e.call(l,l.__data__,c,i)&&a.push(l);return new Sn(r,this._parents,this._name,this._id)}function Bw(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],c=n[a],d=l.length,f=s[a]=new Array(d),p,h=0;h<d;++h)(p=l[h]||c[h])&&(f[h]=p);for(;a<r;++a)s[a]=t[a];return new Sn(s,this._parents,this._name,this._id)}function Hw(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 zw(e,t,n){var r,o,i=Hw(t)?Id:nn;return function(){var s=i(this,e),a=s.on;a!==r&&(o=(r=a).copy()).on(t,n),s.on=o}}function Ww(e,t){var n=this._id;return arguments.length<2?Bt(this.node(),n).on.on(e):this.each(zw(n,e,t))}function Gw(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function Yw(){return this.on("end.remove",Gw(this._id))}function Kw(e){var t=this._name,n=this._id;typeof e!="function"&&(e=gd(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,c=i[s]=new Array(l),d,f,p=0;p<l;++p)(d=a[p])&&(f=e.call(d,d.__data__,p,a))&&("__data__"in d&&(f.__data__=d.__data__),c[p]=f,dl(c[p],t,n,p,c,Bt(d,n)));return new Sn(i,this._parents,t,n)}function Qw(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Um(e));for(var r=this._groups,o=r.length,i=[],s=[],a=0;a<o;++a)for(var l=r[a],c=l.length,d,f=0;f<c;++f)if(d=l[f]){for(var p=e.call(d,d.__data__,f,l),h,E=Bt(d,n),v=0,y=p.length;v<y;++v)(h=p[v])&&dl(h,t,n,v,p,E);i.push(p),s.push(d)}return new Sn(i,s,t,n)}var Xw=Wi.prototype.constructor;function qw(){return new Xw(this._groups,this._parents)}function Jw(e,t){var n,r,o;return function(){var i=No(this,e),s=(this.style.removeProperty(e),No(this,e));return i===s?null:i===n&&s===r?o:o=t(n=i,r=s)}}function RE(e){return function(){this.style.removeProperty(e)}}function Zw(e,t,n){var r,o=n+"",i;return function(){var s=No(this,e);return s===o?null:s===r?i:i=t(r=s,n)}}function eO(e,t,n){var r,o,i;return function(){var s=No(this,e),a=n(this),l=a+"";return a==null&&(l=a=(this.style.removeProperty(e),No(this,e))),s===l?null:s===r&&l===o?i:(o=l,i=t(r=s,a))}}function tO(e,t){var n,r,o,i="style."+t,s="end."+i,a;return function(){var l=nn(this,e),c=l.on,d=l.value[i]==null?a||(a=RE(t)):void 0;(c!==n||o!==d)&&(r=(n=c).copy()).on(s,o=d),l.on=r}}function nO(e,t,n){var r=(e+="")=="transform"?nw:xE;return t==null?this.styleTween(e,Jw(e,r)).on("end.style."+e,RE(e)):typeof t=="function"?this.styleTween(e,eO(e,r,bd(this,"style."+e,t))).each(tO(this._id,e)):this.styleTween(e,Zw(e,r,t),n).on("end.style."+e,null)}function rO(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function oO(e,t,n){var r,o;function i(){var s=t.apply(this,arguments);return s!==o&&(r=(o=s)&&rO(e,s,n)),r}return i._value=t,i}function iO(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,oO(e,t,n??""))}function sO(e){return function(){this.textContent=e}}function aO(e){return function(){var t=e(this);this.textContent=t??""}}function lO(e){return this.tween("text",typeof e=="function"?aO(bd(this,"text",e)):sO(e==null?"":e+""))}function cO(e){return function(t){this.textContent=e.call(this,t)}}function uO(e){var t,n;function r(){var o=e.apply(this,arguments);return o!==n&&(t=(n=o)&&cO(o)),t}return r._value=e,r}function dO(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,uO(e))}function fO(){for(var e=this._name,t=this._id,n=NE(),r=this._groups,o=r.length,i=0;i<o;++i)for(var s=r[i],a=s.length,l,c=0;c<a;++c)if(l=s[c]){var d=Bt(l,t);dl(l,e,n,c,s,{time:d.time+d.delay+d.duration,delay:0,duration:d.duration,ease:d.ease})}return new Sn(r,this._parents,e,n)}function pO(){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 c=nn(this,r),d=c.on;d!==e&&(t=(e=d).copy(),t._.cancel.push(a),t._.interrupt.push(a),t._.end.push(l)),c.on=t}),o===0&&i()})}var hO=0;function Sn(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function NE(){return++hO}var xn=Wi.prototype;Sn.prototype={constructor:Sn,select:Kw,selectAll:Qw,selectChild:xn.selectChild,selectChildren:xn.selectChildren,filter:$w,merge:Bw,selection:qw,transition:fO,call:xn.call,nodes:xn.nodes,node:xn.node,size:xn.size,empty:xn.empty,each:xn.each,on:Ww,attr:ww,attrTween:bw,style:nO,styleTween:iO,text:lO,textTween:dO,remove:Yw,tween:vw,delay:Dw,duration:Mw,ease:Uw,easeVarying:Vw,end:pO,[Symbol.iterator]:xn[Symbol.iterator]};function gO(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var mO={time:null,delay:0,duration:250,ease:gO};function EO(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 vO(e){var t,n;e instanceof Sn?(t=e._id,e=e._name):(t=NE(),(n=mO).time=wd(),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,c=0;c<a;++c)(l=s[c])&&dl(l,e,t,c,s,n||EO(l,t));return new Sn(r,this._parents,e,t)}Wi.prototype.interrupt=gw,Wi.prototype.transition=vO;const pl=e=>()=>e;function yO(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 Rn(e,t,n){this.k=e,this.x=t,this.y=n}Rn.prototype={constructor:Rn,scale:function(e){return e===1?this:new Rn(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Rn(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 Qn=new Rn(1,0,0);Rn.prototype;function Cd(e){e.stopImmediatePropagation()}function ts(e){e.preventDefault(),e.stopImmediatePropagation()}function _O(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function SO(){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 wE(){return this.__zoom||Qn}function xO(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function RO(){return navigator.maxTouchPoints||"ontouchstart"in this}function NO(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 wO(){var e=_O,t=SO,n=NO,r=xO,o=RO,i=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],a=250,l=aw,c=Qa("start","zoom","end"),d,f,p,h=500,E=150,v=0,y=10;function g(O){O.property("__zoom",wE).on("wheel.zoom",L,{passive:!1}).on("mousedown.zoom",U).on("dblclick.zoom",A).filter(o).on("touchstart.zoom",b).on("touchmove.zoom",V).on("touchend.zoom touchcancel.zoom",M).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}g.transform=function(O,j,P,$){var D=O.selection?O.selection():O;D.property("__zoom",wE),O!==D?x(O,j,P,$):D.interrupt().each(function(){R(this,arguments).event($).start().zoom(null,typeof j=="function"?j.apply(this,arguments):j).end()})},g.scaleBy=function(O,j,P,$){g.scaleTo(O,function(){var D=this.__zoom.k,C=typeof j=="function"?j.apply(this,arguments):j;return D*C},P,$)},g.scaleTo=function(O,j,P,$){g.transform(O,function(){var D=t.apply(this,arguments),C=this.__zoom,k=P==null?S(D):typeof P=="function"?P.apply(this,arguments):P,F=C.invert(k),B=typeof j=="function"?j.apply(this,arguments):j;return n(_(m(C,B),k,F),D,s)},P,$)},g.translateBy=function(O,j,P,$){g.transform(O,function(){return n(this.__zoom.translate(typeof j=="function"?j.apply(this,arguments):j,typeof P=="function"?P.apply(this,arguments):P),t.apply(this,arguments),s)},null,$)},g.translateTo=function(O,j,P,$,D){g.transform(O,function(){var C=t.apply(this,arguments),k=this.__zoom,F=$==null?S(C):typeof $=="function"?$.apply(this,arguments):$;return n(Qn.translate(F[0],F[1]).scale(k.k).translate(typeof j=="function"?-j.apply(this,arguments):-j,typeof P=="function"?-P.apply(this,arguments):-P),C,s)},$,D)};function m(O,j){return j=Math.max(i[0],Math.min(i[1],j)),j===O.k?O:new Rn(j,O.x,O.y)}function _(O,j,P){var $=j[0]-P[0]*O.k,D=j[1]-P[1]*O.k;return $===O.x&&D===O.y?O:new Rn(O.k,$,D)}function S(O){return[(+O[0][0]+ +O[1][0])/2,(+O[0][1]+ +O[1][1])/2]}function x(O,j,P,$){O.on("start.zoom",function(){R(this,arguments).event($).start()}).on("interrupt.zoom end.zoom",function(){R(this,arguments).event($).end()}).tween("zoom",function(){var D=this,C=arguments,k=R(D,C).event($),F=t.apply(D,C),B=P==null?S(F):typeof P=="function"?P.apply(D,C):P,z=Math.max(F[1][0]-F[0][0],F[1][1]-F[0][1]),W=D.__zoom,X=typeof j=="function"?j.apply(D,C):j,Q=l(W.invert(B).concat(z/W.k),X.invert(B).concat(z/X.k));return function(J){if(J===1)J=X;else{var re=Q(J),pe=z/re[2];J=new Rn(pe,B[0]-re[0]*pe,B[1]-re[1]*pe)}k.zoom(null,J)}})}function R(O,j,P){return!P&&O.__zooming||new I(O,j)}function I(O,j){this.that=O,this.args=j,this.active=0,this.sourceEvent=null,this.extent=t.apply(O,j),this.taps=0}I.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,j){return this.mouse&&O!=="mouse"&&(this.mouse[1]=j.invert(this.mouse[0])),this.touch0&&O!=="touch"&&(this.touch0[1]=j.invert(this.touch0[0])),this.touch1&&O!=="touch"&&(this.touch1[1]=j.invert(this.touch1[0])),this.that.__zoom=j,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(O){var j=Vt(this.that).datum();c.call(O,this.that,new yO(O,{sourceEvent:this.sourceEvent,target:g,type:O,transform:this.that.__zoom,dispatch:c}),j)}};function L(O,...j){if(!e.apply(this,arguments))return;var P=R(this,j).event(O),$=this.__zoom,D=Math.max(i[0],Math.min(i[1],$.k*Math.pow(2,r.apply(this,arguments)))),C=en(O);if(P.wheel)(P.mouse[0][0]!==C[0]||P.mouse[0][1]!==C[1])&&(P.mouse[1]=$.invert(P.mouse[0]=C)),clearTimeout(P.wheel);else{if($.k===D)return;P.mouse=[C,$.invert(C)],fl(this),P.start()}ts(O),P.wheel=setTimeout(k,E),P.zoom("mouse",n(_(m($,D),P.mouse[0],P.mouse[1]),P.extent,s));function k(){P.wheel=null,P.end()}}function U(O,...j){if(p||!e.apply(this,arguments))return;var P=O.currentTarget,$=R(this,j,!0).event(O),D=Vt(O.view).on("mousemove.zoom",B,!0).on("mouseup.zoom",z,!0),C=en(O,P),k=O.clientX,F=O.clientY;Qm(O.view),Cd(O),$.mouse=[C,this.__zoom.invert(C)],fl(this),$.start();function B(W){if(ts(W),!$.moved){var X=W.clientX-k,Q=W.clientY-F;$.moved=X*X+Q*Q>v}$.event(W).zoom("mouse",n(_($.that.__zoom,$.mouse[0]=en(W,P),$.mouse[1]),$.extent,s))}function z(W){D.on("mousemove.zoom mouseup.zoom",null),Xm(W.view,$.moved),ts(W),$.event(W).end()}}function A(O,...j){if(e.apply(this,arguments)){var P=this.__zoom,$=en(O.changedTouches?O.changedTouches[0]:O,this),D=P.invert($),C=P.k*(O.shiftKey?.5:2),k=n(_(m(P,C),$,D),t.apply(this,j),s);ts(O),a>0?Vt(this).transition().duration(a).call(x,k,$,O):Vt(this).call(g.transform,k,$,O)}}function b(O,...j){if(e.apply(this,arguments)){var P=O.touches,$=P.length,D=R(this,j,O.changedTouches.length===$).event(O),C,k,F,B;for(Cd(O),k=0;k<$;++k)F=P[k],B=en(F,this),B=[B,this.__zoom.invert(B),F.identifier],D.touch0?!D.touch1&&D.touch0[2]!==B[2]&&(D.touch1=B,D.taps=0):(D.touch0=B,C=!0,D.taps=1+!!d);d&&(d=clearTimeout(d)),C&&(D.taps<2&&(f=B[0],d=setTimeout(function(){d=null},h)),fl(this),D.start())}}function V(O,...j){if(this.__zooming){var P=R(this,j).event(O),$=O.changedTouches,D=$.length,C,k,F,B;for(ts(O),C=0;C<D;++C)k=$[C],F=en(k,this),P.touch0&&P.touch0[2]===k.identifier?P.touch0[0]=F:P.touch1&&P.touch1[2]===k.identifier&&(P.touch1[0]=F);if(k=P.that.__zoom,P.touch1){var z=P.touch0[0],W=P.touch0[1],X=P.touch1[0],Q=P.touch1[1],J=(J=X[0]-z[0])*J+(J=X[1]-z[1])*J,re=(re=Q[0]-W[0])*re+(re=Q[1]-W[1])*re;k=m(k,Math.sqrt(J/re)),F=[(z[0]+X[0])/2,(z[1]+X[1])/2],B=[(W[0]+Q[0])/2,(W[1]+Q[1])/2]}else if(P.touch0)F=P.touch0[0],B=P.touch0[1];else return;P.zoom("touch",n(_(k,F,B),P.extent,s))}}function M(O,...j){if(this.__zooming){var P=R(this,j).event(O),$=O.changedTouches,D=$.length,C,k;for(Cd(O),p&&clearTimeout(p),p=setTimeout(function(){p=null},h),C=0;C<D;++C)k=$[C],P.touch0&&P.touch0[2]===k.identifier?delete P.touch0:P.touch1&&P.touch1[2]===k.identifier&&delete P.touch1;if(P.touch1&&!P.touch0&&(P.touch0=P.touch1,delete P.touch1),P.touch0)P.touch0[1]=this.__zoom.invert(P.touch0[0]);else if(P.end(),P.taps===2&&(k=en(k,this),Math.hypot(f[0]-k[0],f[1]-k[1])<y)){var F=Vt(this).on("dblclick.zoom");F&&F.apply(this,arguments)}}}return g.wheelDelta=function(O){return arguments.length?(r=typeof O=="function"?O:pl(+O),g):r},g.filter=function(O){return arguments.length?(e=typeof O=="function"?O:pl(!!O),g):e},g.touchable=function(O){return arguments.length?(o=typeof O=="function"?O:pl(!!O),g):o},g.extent=function(O){return arguments.length?(t=typeof O=="function"?O:pl([[+O[0][0],+O[0][1]],[+O[1][0],+O[1][1]]]),g):t},g.scaleExtent=function(O){return arguments.length?(i[0]=+O[0],i[1]=+O[1],g):[i[0],i[1]]},g.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],g):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},g.constrain=function(O){return arguments.length?(n=O,g):n},g.duration=function(O){return arguments.length?(a=+O,g):a},g.interpolate=function(O){return arguments.length?(l=O,g):l},g.on=function(){var O=c.on.apply(c,arguments);return O===c?g:O},g.clickDistance=function(O){return arguments.length?(v=(O=+O)*O,g):Math.sqrt(v)},g.tapDistance=function(O){return arguments.length?(y=+O,g):y},g}const hl=w.createContext(null),OO=hl.Provider,Nn={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".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`},OE=Nn.error001();function ae(e,t){const n=w.useContext(hl);if(n===null)throw new Error(OE);return Dm(n,e,t)}const Te=()=>{const e=w.useContext(hl);if(e===null)throw new Error(OE);return w.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe,destroy:e.destroy}),[e])},TO=e=>e.userSelectionActive?"none":"all";function ns({position:e,children:t,className:n,style:r,...o}){const i=ae(TO),s=`${e}`.split("-");return u.jsx("div",{className:qe(["react-flow__panel",n,...s]),style:{...r,pointerEvents:i},...o,children:t})}function AO({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:u.jsx(ns,{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:u.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const IO=({x:e,y:t,label:n,labelStyle:r={},labelShowBg:o=!0,labelBgStyle:i={},labelBgPadding:s=[2,4],labelBgBorderRadius:a=2,children:l,className:c,...d})=>{const f=w.useRef(null),[p,h]=w.useState({x:0,y:0,width:0,height:0}),E=qe(["react-flow__edge-textwrapper",c]);return w.useEffect(()=>{if(f.current){const v=f.current.getBBox();h({x:v.x,y:v.y,width:v.width,height:v.height})}},[n]),typeof n>"u"||!n?null:u.jsxs("g",{transform:`translate(${e-p.width/2} ${t-p.height/2})`,className:E,visibility:p.width?"visible":"hidden",...d,children:[o&&u.jsx("rect",{width:p.width+2*s[0],x:-s[0],y:-s[1],height:p.height+2*s[1],className:"react-flow__edge-textbg",style:i,rx:a,ry:a}),u.jsx("text",{className:"react-flow__edge-text",y:p.height/2,dy:"0.3em",ref:f,style:r,children:n}),l]})};var bO=w.memo(IO);const Ld=e=>({width:e.offsetWidth,height:e.offsetHeight}),Ao=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Dd=(e={x:0,y:0},t)=>({x:Ao(e.x,t[0][0],t[1][0]),y:Ao(e.y,t[0][1],t[1][1])}),TE=(e,t,n)=>e<t?Ao(Math.abs(e-t),1,50)/50:e>n?-Ao(Math.abs(e-n),1,50)/50:0,AE=(e,t)=>{const n=TE(e.x,35,t.width-35)*20,r=TE(e.y,35,t.height-35)*20;return[n,r]},IE=e=>{var t;return((t=e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},CO=(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)}),kd=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),LO=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),bE=e=>({...e.positionAbsolute||{x:0,y:0},width:e.width||0,height:e.height||0}),Pd=(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)},DO=e=>Tt(e.width)&&Tt(e.height)&&Tt(e.x)&&Tt(e.y),Tt=e=>!isNaN(e)&&isFinite(e),Ae=Symbol.for("internals"),CE=["Enter"," ","Escape"],kO=(e,t)=>{},PO=e=>"nativeEvent"in e;function Md(e){var o,i;const t=PO(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 LE=e=>"clientX"in e,Xn=(e,t)=>{var i,s;const n=LE(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)}},gl=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0},Io=({id:e,path:t,labelX:n,labelY:r,label:o,labelStyle:i,labelShowBg:s,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:c,style:d,markerEnd:f,markerStart:p,interactionWidth:h=20})=>u.jsxs(u.Fragment,{children:[u.jsx("path",{id:e,style:d,d:t,fill:"none",className:"react-flow__edge-path",markerEnd:f,markerStart:p}),h&&u.jsx("path",{d:t,fill:"none",strokeOpacity:0,strokeWidth:h,className:"react-flow__edge-interaction"}),o&&Tt(n)&&Tt(r)?u.jsx(bO,{x:n,y:r,label:o,labelStyle:i,labelShowBg:s,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:c}):null]});Io.displayName="BaseEdge";function rs(e,t,n){return n===void 0?n:r=>{const o=t().edges.find(i=>i.id===e);o&&n(r,{...o})}}function DE({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 kE({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,c=t*.125+i*.375+a*.375+r*.125,d=Math.abs(l-e),f=Math.abs(c-t);return[l,c,d,f]}var qn;(function(e){e.Strict="strict",e.Loose="loose"})(qn||(qn={}));var Ir;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Ir||(Ir={}));var os;(function(e){e.Partial="partial",e.Full="full"})(os||(os={}));var Jn;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Jn||(Jn={}));var is;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(is||(is={}));var K;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(K||(K={}));function PE({pos:e,x1:t,y1:n,x2:r,y2:o}){return e===K.Left||e===K.Right?[.5*(t+r),n]:[t,.5*(n+o)]}function ME({sourceX:e,sourceY:t,sourcePosition:n=K.Bottom,targetX:r,targetY:o,targetPosition:i=K.Top}){const[s,a]=PE({pos:n,x1:e,y1:t,x2:r,y2:o}),[l,c]=PE({pos:i,x1:r,y1:o,x2:e,y2:t}),[d,f,p,h]=kE({sourceX:e,sourceY:t,targetX:r,targetY:o,sourceControlX:s,sourceControlY:a,targetControlX:l,targetControlY:c});return[`M${e},${t} C${s},${a} ${l},${c} ${r},${o}`,d,f,p,h]}const jd=w.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,sourcePosition:o=K.Bottom,targetPosition:i=K.Top,label:s,labelStyle:a,labelShowBg:l,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:f,style:p,markerEnd:h,markerStart:E,interactionWidth:v})=>{const[y,g,m]=ME({sourceX:e,sourceY:t,sourcePosition:o,targetX:n,targetY:r,targetPosition:i});return u.jsx(Io,{path:y,labelX:g,labelY:m,label:s,labelStyle:a,labelShowBg:l,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:f,style:p,markerEnd:h,markerStart:E,interactionWidth:v})});jd.displayName="SimpleBezierEdge";const jE={[K.Left]:{x:-1,y:0},[K.Right]:{x:1,y:0},[K.Top]:{x:0,y:-1},[K.Bottom]:{x:0,y:1}},MO=({source:e,sourcePosition:t=K.Bottom,target:n})=>t===K.Left||t===K.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},UE=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function jO({source:e,sourcePosition:t=K.Bottom,target:n,targetPosition:r=K.Top,center:o,offset:i}){const s=jE[t],a=jE[r],l={x:e.x+s.x*i,y:e.y+s.y*i},c={x:n.x+a.x*i,y:n.y+a.y*i},d=MO({source:l,sourcePosition:t,target:c}),f=d.x!==0?"x":"y",p=d[f];let h=[],E,v;const y={x:0,y:0},g={x:0,y:0},[m,_,S,x]=DE({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(s[f]*a[f]===-1){E=o.x||m,v=o.y||_;const I=[{x:E,y:l.y},{x:E,y:c.y}],L=[{x:l.x,y:v},{x:c.x,y:v}];s[f]===p?h=f==="x"?I:L:h=f==="x"?L:I}else{const I=[{x:l.x,y:c.y}],L=[{x:c.x,y:l.y}];if(f==="x"?h=s.x===p?L:I:h=s.y===p?I:L,t===r){const M=Math.abs(e[f]-n[f]);if(M<=i){const O=Math.min(i-1,i-M);s[f]===p?y[f]=(l[f]>e[f]?-1:1)*O:g[f]=(c[f]>n[f]?-1:1)*O}}if(t!==r){const M=f==="x"?"y":"x",O=s[f]===a[M],j=l[M]>c[M],P=l[M]<c[M];(s[f]===1&&(!O&&j||O&&P)||s[f]!==1&&(!O&&P||O&&j))&&(h=f==="x"?I:L)}const U={x:l.x+y.x,y:l.y+y.y},A={x:c.x+g.x,y:c.y+g.y},b=Math.max(Math.abs(U.x-h[0].x),Math.abs(A.x-h[0].x)),V=Math.max(Math.abs(U.y-h[0].y),Math.abs(A.y-h[0].y));b>=V?(E=(U.x+A.x)/2,v=h[0].y):(E=h[0].x,v=(U.y+A.y)/2)}return[[e,{x:l.x+y.x,y:l.y+y.y},...h,{x:c.x+g.x,y:c.y+g.y},n],E,v,S,x]}function UO(e,t,n,r){const o=Math.min(UE(e,t)/2,UE(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 c=e.x<n.x?-1:1,d=e.y<n.y?1:-1;return`L ${i+o*c},${s}Q ${i},${s} ${i},${s+o*d}`}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 ss({sourceX:e,sourceY:t,sourcePosition:n=K.Bottom,targetX:r,targetY:o,targetPosition:i=K.Top,borderRadius:s=5,centerX:a,centerY:l,offset:c=20}){const[d,f,p,h,E]=jO({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:o},targetPosition:i,center:{x:a,y:l},offset:c});return[d.reduce((y,g,m)=>{let _="";return m>0&&m<d.length-1?_=UO(d[m-1],g,d[m+1],s):_=`${m===0?"M":"L"}${g.x} ${g.y}`,y+=_,y},""),f,p,h,E]}const ml=w.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,label:o,labelStyle:i,labelShowBg:s,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:c,style:d,sourcePosition:f=K.Bottom,targetPosition:p=K.Top,markerEnd:h,markerStart:E,pathOptions:v,interactionWidth:y})=>{const[g,m,_]=ss({sourceX:e,sourceY:t,sourcePosition:f,targetX:n,targetY:r,targetPosition:p,borderRadius:v==null?void 0:v.borderRadius,offset:v==null?void 0:v.offset});return u.jsx(Io,{path:g,labelX:m,labelY:_,label:o,labelStyle:i,labelShowBg:s,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:c,style:d,markerEnd:h,markerStart:E,interactionWidth:y})});ml.displayName="SmoothStepEdge";const Ud=w.memo(e=>{var t;return u.jsx(ml,{...e,pathOptions:w.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 FO({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[o,i,s,a]=DE({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,o,i,s,a]}const Fd=w.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,label:o,labelStyle:i,labelShowBg:s,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:c,style:d,markerEnd:f,markerStart:p,interactionWidth:h})=>{const[E,v,y]=FO({sourceX:e,sourceY:t,targetX:n,targetY:r});return u.jsx(Io,{path:E,labelX:v,labelY:y,label:o,labelStyle:i,labelShowBg:s,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:c,style:d,markerEnd:f,markerStart:p,interactionWidth:h})});Fd.displayName="StraightEdge";function El(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function FE({pos:e,x1:t,y1:n,x2:r,y2:o,c:i}){switch(e){case K.Left:return[t-El(t-r,i),n];case K.Right:return[t+El(r-t,i),n];case K.Top:return[t,n-El(n-o,i)];case K.Bottom:return[t,n+El(o-n,i)]}}function VE({sourceX:e,sourceY:t,sourcePosition:n=K.Bottom,targetX:r,targetY:o,targetPosition:i=K.Top,curvature:s=.25}){const[a,l]=FE({pos:n,x1:e,y1:t,x2:r,y2:o,c:s}),[c,d]=FE({pos:i,x1:r,y1:o,x2:e,y2:t,c:s}),[f,p,h,E]=kE({sourceX:e,sourceY:t,targetX:r,targetY:o,sourceControlX:a,sourceControlY:l,targetControlX:c,targetControlY:d});return[`M${e},${t} C${a},${l} ${c},${d} ${r},${o}`,f,p,h,E]}const vl=w.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,sourcePosition:o=K.Bottom,targetPosition:i=K.Top,label:s,labelStyle:a,labelShowBg:l,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:f,style:p,markerEnd:h,markerStart:E,pathOptions:v,interactionWidth:y})=>{const[g,m,_]=VE({sourceX:e,sourceY:t,sourcePosition:o,targetX:n,targetY:r,targetPosition:i,curvature:v==null?void 0:v.curvature});return u.jsx(Io,{path:g,labelX:m,labelY:_,label:s,labelStyle:a,labelShowBg:l,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:f,style:p,markerEnd:h,markerStart:E,interactionWidth:y})});vl.displayName="BezierEdge";const Vd=w.createContext(null),VO=Vd.Provider;Vd.Consumer;const $O=()=>w.useContext(Vd),BO=e=>"id"in e&&"source"in e&&"target"in e,$E=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`reactflow__edge-${e}${t||""}-${n}${r||""}`,$d=(e,t)=>typeof e>"u"?"":typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`,HO=(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)),BE=(e,t)=>{if(!e.source||!e.target)return t;let n;return BO(e)?n={...e}:n={...e,id:$E(e)},HO(n,t)?t:t.concat(n)},zO=(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?$E(t):o,source:t.source,target:t.target,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle};return n.filter(l=>l.id!==o).concat(a)},HE=({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},WO=({x:e,y:t},[n,r,o])=>({x:e*o+n,y:t*o+r}),bo=(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}},Bd=(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}=bo(o,t).positionAbsolute;return CO(r,kd({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 LO(n)},zE=(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},c=[];return e.forEach(d=>{const{width:f,height:p,selectable:h=!0,hidden:E=!1}=d;if(s&&!h||E)return!1;const{positionAbsolute:v}=bo(d,a),y={x:v.x,y:v.y,width:f||0,height:p||0},g=Pd(l,y),m=typeof f>"u"||typeof p>"u"||f===null||p===null,_=i&&g>0,S=(f||0)*(p||0);(m||_||g>=S||d.dragging)&&c.push(d)}),c},WE=(e,t)=>{const n=e.map(r=>r.id);return t.filter(r=>n.includes(r.source)||n.includes(r.target))},GE=(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),c=Ao(l,r,o),d=e.x+e.width/2,f=e.y+e.height/2,p=t/2-d*c,h=n/2-f*c;return[p,h,c]},br=(e,t=0)=>e.transition().duration(t);function YE(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 GO(e,t,n,r,o,i){const{x:s,y:a}=Xn(e),c=t.elementsFromPoint(s,a).find(E=>E.classList.contains("react-flow__handle"));if(c){const E=c.getAttribute("data-nodeid");if(E){const v=Hd(void 0,c),y=c.getAttribute("data-handleid"),g=i({nodeId:E,id:y,type:v});if(g)return{handle:{id:y,type:v,nodeId:E,x:n.x,y:n.y},validHandleResult:g}}}let d=[],f=1/0;if(o.forEach(E=>{const v=Math.sqrt((E.x-n.x)**2+(E.y-n.y)**2);if(v<=r){const y=i(E);v<=f&&(v<f?d=[{handle:E,validHandleResult:y}]:v===f&&d.push({handle:E,validHandleResult:y}),f=v)}}),!d.length)return{handle:null,validHandleResult:KE()};if(d.length===1)return d[0];const p=d.some(({validHandleResult:E})=>E.isValid),h=d.some(({handle:E})=>E.type==="target");return d.find(({handle:E,validHandleResult:v})=>h?E.type==="target":p?v.isValid:!0)||d[0]}const YO={source:null,target:null,sourceHandle:null,targetHandle:null},KE=()=>({handleDomNode:null,isValid:!1,connection:YO,endHandle:null});function QE(e,t,n,r,o,i,s){const a=o==="target",l=s.querySelector(`.react-flow__handle[data-id="${e==null?void 0:e.nodeId}-${e==null?void 0:e.id}-${e==null?void 0:e.type}"]`),c={...KE(),handleDomNode:l};if(l){const d=Hd(void 0,l),f=l.getAttribute("data-nodeid"),p=l.getAttribute("data-handleid"),h=l.classList.contains("connectable"),E=l.classList.contains("connectableend"),v={source:a?f:n,sourceHandle:a?p:r,target:a?n:f,targetHandle:a?r:p};c.connection=v,h&&E&&(t===qn.Strict?a&&d==="source"||!a&&d==="target":f!==n||p!==r)&&(c.endHandle={nodeId:f,handleId:p,type:d},c.isValid=i(v))}return c}function KO({nodes:e,nodeId:t,handleId:n,handleType:r}){return e.reduce((o,i)=>{if(i[Ae]){const{handleBounds:s}=i[Ae];let a=[],l=[];s&&(a=YE(i,s,"source",`${t}-${n}-${r}`),l=YE(i,s,"target",`${t}-${n}-${r}`)),o.push(...a,...l)}return o},[])}function Hd(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function zd(e){e==null||e.classList.remove("valid","connecting","react-flow__handle-valid","react-flow__handle-connecting")}function QO(e,t){let n=null;return t?n="valid":e&&!t&&(n="invalid"),n}function XE({event:e,handleId:t,nodeId:n,onConnect:r,isTarget:o,getState:i,setState:s,isValidConnection:a,edgeUpdaterType:l,onEdgeUpdateEnd:c}){const d=IE(e.target),{connectionMode:f,domNode:p,autoPanOnConnect:h,connectionRadius:E,onConnectStart:v,panBy:y,getNodes:g,cancelConnection:m}=i();let _=0,S;const{x,y:R}=Xn(e),I=d==null?void 0:d.elementFromPoint(x,R),L=Hd(l,I),U=p==null?void 0:p.getBoundingClientRect();if(!U||!L)return;let A,b=Xn(e,U),V=!1,M=null,O=!1,j=null;const P=KO({nodes:g(),nodeId:n,handleId:t,handleType:L}),$=()=>{if(!h)return;const[k,F]=AE(b,U);y({x:k,y:F}),_=requestAnimationFrame($)};s({connectionPosition:b,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 D(k){const{transform:F}=i();b=Xn(k,U);const{handle:B,validHandleResult:z}=GO(k,d,HE(b,F,!1,[1,1]),E,P,W=>QE(W,f,n,t,o?"target":"source",a,d));if(S=B,V||($(),V=!0),j=z.handleDomNode,M=z.connection,O=z.isValid,s({connectionPosition:S&&O?WO({x:S.x,y:S.y},F):b,connectionStatus:QO(!!S,O),connectionEndHandle:z.endHandle}),!S&&!O&&!j)return zd(A);M.source!==M.target&&j&&(zd(A),A=j,j.classList.add("connecting","react-flow__handle-connecting"),j.classList.toggle("valid",O),j.classList.toggle("react-flow__handle-valid",O))}function C(k){var F,B;(S||j)&&M&&O&&(r==null||r(M)),(B=(F=i()).onConnectEnd)==null||B.call(F,k),l&&(c==null||c(k)),zd(A),m(),cancelAnimationFrame(_),V=!1,O=!1,M=null,j=null,d.removeEventListener("mousemove",D),d.removeEventListener("mouseup",C),d.removeEventListener("touchmove",D),d.removeEventListener("touchend",C)}d.addEventListener("mousemove",D),d.addEventListener("mouseup",C),d.addEventListener("touchmove",D),d.addEventListener("touchend",C)}const qE=()=>!0,XO=e=>({connectionStartHandle:e.connectionStartHandle,connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName}),qO=(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}},JE=w.forwardRef(({type:e="source",position:t=K.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:o=!0,isConnectableEnd:i=!0,id:s,onConnect:a,children:l,className:c,onMouseDown:d,onTouchStart:f,...p},h)=>{var U,A;const E=s||null,v=e==="target",y=Te(),g=$O(),{connectOnClick:m,noPanClassName:_}=ae(XO,ze),{connecting:S,clickConnecting:x}=ae(qO(g,E,e),ze);g||(A=(U=y.getState()).onError)==null||A.call(U,"010",Nn.error010());const R=b=>{const{defaultEdgeOptions:V,onConnect:M,hasDefaultEdges:O}=y.getState(),j={...V,...b};if(O){const{edges:P,setEdges:$}=y.getState();$(BE(j,P))}M==null||M(j),a==null||a(j)},I=b=>{if(!g)return;const V=LE(b);o&&(V&&b.button===0||!V)&&XE({event:b,handleId:E,nodeId:g,onConnect:R,isTarget:v,getState:y.getState,setState:y.setState,isValidConnection:n||y.getState().isValidConnection||qE}),V?d==null||d(b):f==null||f(b)},L=b=>{const{onClickConnectStart:V,onClickConnectEnd:M,connectionClickStartHandle:O,connectionMode:j,isValidConnection:P}=y.getState();if(!g||!O&&!o)return;if(!O){V==null||V(b,{nodeId:g,handleId:E,handleType:e}),y.setState({connectionClickStartHandle:{nodeId:g,type:e,handleId:E}});return}const $=IE(b.target),D=n||P||qE,{connection:C,isValid:k}=QE({nodeId:g,id:E,type:e},j,O.nodeId,O.handleId||null,O.type,D,$);k&&R(C),M==null||M(b),y.setState({connectionClickStartHandle:null})};return u.jsx("div",{"data-handleid":E,"data-nodeid":g,"data-handlepos":t,"data-id":`${g}-${E}-${e}`,className:qe(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",_,c,{source:!v,target:v,connectable:r,connectablestart:o,connectableend:i,connecting:x,connectionindicator:r&&(o&&!S||i&&S)}]),onMouseDown:I,onTouchStart:I,onClick:m?L:void 0,ref:h,...p,children:l})});JE.displayName="Handle";var Co=w.memo(JE);const ZE=({data:e,isConnectable:t,targetPosition:n=K.Top,sourcePosition:r=K.Bottom})=>u.jsxs(u.Fragment,{children:[u.jsx(Co,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,u.jsx(Co,{type:"source",position:r,isConnectable:t})]});ZE.displayName="DefaultNode";var Wd=w.memo(ZE);const ev=({data:e,isConnectable:t,sourcePosition:n=K.Bottom})=>u.jsxs(u.Fragment,{children:[e==null?void 0:e.label,u.jsx(Co,{type:"source",position:n,isConnectable:t})]});ev.displayName="InputNode";var tv=w.memo(ev);const nv=({data:e,isConnectable:t,targetPosition:n=K.Top})=>u.jsxs(u.Fragment,{children:[u.jsx(Co,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]});nv.displayName="OutputNode";var rv=w.memo(nv);const Gd=()=>null;Gd.displayName="GroupNode";const JO=e=>({selectedNodes:e.getNodes().filter(t=>t.selected),selectedEdges:e.edges.filter(t=>t.selected)}),yl=e=>e.id;function ZO(e,t){return ze(e.selectedNodes.map(yl),t.selectedNodes.map(yl))&&ze(e.selectedEdges.map(yl),t.selectedEdges.map(yl))}const ov=w.memo(({onSelectionChange:e})=>{const t=Te(),{selectedNodes:n,selectedEdges:r}=ae(JO,ZO);return w.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});ov.displayName="SelectionListener";const eT=e=>!!e.onSelectionChange;function tT({onSelectionChange:e}){const t=ae(eT);return e||t?u.jsx(ov,{onSelectionChange:e}):null}const nT=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 Lo(e,t){w.useEffect(()=>{typeof e<"u"&&t(e)},[e])}function Z(e,t,n){w.useEffect(()=>{typeof t<"u"&&n({[e]:t})},[t])}const rT=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:o,onConnectStart:i,onConnectEnd:s,onClickConnectStart:a,onClickConnectEnd:l,nodesDraggable:c,nodesConnectable:d,nodesFocusable:f,edgesFocusable:p,edgesUpdatable:h,elevateNodesOnSelect:E,minZoom:v,maxZoom:y,nodeExtent:g,onNodesChange:m,onEdgesChange:_,elementsSelectable:S,connectionMode:x,snapGrid:R,snapToGrid:I,translateExtent:L,connectOnClick:U,defaultEdgeOptions:A,fitView:b,fitViewOptions:V,onNodesDelete:M,onEdgesDelete:O,onNodeDrag:j,onNodeDragStart:P,onNodeDragStop:$,onSelectionDrag:D,onSelectionDragStart:C,onSelectionDragStop:k,noPanClassName:F,nodeOrigin:B,rfId:z,autoPanOnConnect:W,autoPanOnNodeDrag:X,onError:Q,connectionRadius:J,isValidConnection:re})=>{const{setNodes:pe,setEdges:le,setDefaultNodesAndEdges:we,setMinZoom:et,setMaxZoom:yt,setTranslateExtent:_e,setNodeExtent:me,reset:tt}=ae(nT,ze),q=Te();return w.useEffect(()=>{const lr=r==null?void 0:r.map(Pr=>({...Pr,...A}));return we(n,lr),()=>{tt()}},[]),Z("defaultEdgeOptions",A,q.setState),Z("connectionMode",x,q.setState),Z("onConnect",o,q.setState),Z("onConnectStart",i,q.setState),Z("onConnectEnd",s,q.setState),Z("onClickConnectStart",a,q.setState),Z("onClickConnectEnd",l,q.setState),Z("nodesDraggable",c,q.setState),Z("nodesConnectable",d,q.setState),Z("nodesFocusable",f,q.setState),Z("edgesFocusable",p,q.setState),Z("edgesUpdatable",h,q.setState),Z("elementsSelectable",S,q.setState),Z("elevateNodesOnSelect",E,q.setState),Z("snapToGrid",I,q.setState),Z("snapGrid",R,q.setState),Z("onNodesChange",m,q.setState),Z("onEdgesChange",_,q.setState),Z("connectOnClick",U,q.setState),Z("fitViewOnInit",b,q.setState),Z("fitViewOnInitOptions",V,q.setState),Z("onNodesDelete",M,q.setState),Z("onEdgesDelete",O,q.setState),Z("onNodeDrag",j,q.setState),Z("onNodeDragStart",P,q.setState),Z("onNodeDragStop",$,q.setState),Z("onSelectionDrag",D,q.setState),Z("onSelectionDragStart",C,q.setState),Z("onSelectionDragStop",k,q.setState),Z("noPanClassName",F,q.setState),Z("nodeOrigin",B,q.setState),Z("rfId",z,q.setState),Z("autoPanOnConnect",W,q.setState),Z("autoPanOnNodeDrag",X,q.setState),Z("onError",Q,q.setState),Z("connectionRadius",J,q.setState),Z("isValidConnection",re,q.setState),Lo(e,pe),Lo(t,le),Lo(v,et),Lo(y,yt),Lo(L,_e),Lo(g,me),null},iv={display:"none"},oT={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},sv="react-flow__node-desc",av="react-flow__edge-desc",iT="react-flow__aria-live",sT=e=>e.ariaLiveMessage;function aT({rfId:e}){const t=ae(sT);return u.jsx("div",{id:`${iT}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:oT,children:t})}function lT({rfId:e,disableKeyboardA11y:t}){return u.jsxs(u.Fragment,{children:[u.jsxs("div",{id:`${sv}-${e}`,style:iv,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."," "]}),u.jsx("div",{id:`${av}-${e}`,style:iv,children:"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel."}),!t&&u.jsx(aT,{rfId:e})]})}const cT=typeof document<"u"?document:null;var Do=(e=null,t={target:cT})=>{const[n,r]=w.useState(!1),o=w.useRef(!1),i=w.useRef(new Set([])),[s,a]=w.useMemo(()=>{if(e!==null){const c=(Array.isArray(e)?e:[e]).filter(f=>typeof f=="string").map(f=>f.split("+")),d=c.reduce((f,p)=>f.concat(...p),[]);return[c,d]}return[[],[]]},[e]);return w.useEffect(()=>{var l,c;if(e!==null){const d=h=>{if(o.current=h.ctrlKey||h.metaKey||h.shiftKey,!o.current&&Md(h))return!1;const E=cv(h.code,a);i.current.add(h[E]),lv(s,i.current,!1)&&(h.preventDefault(),r(!0))},f=h=>{if(!o.current&&Md(h))return!1;const E=cv(h.code,a);lv(s,i.current,!0)?(r(!1),i.current.clear()):i.current.delete(h[E]),h.key==="Meta"&&i.current.clear(),o.current=!1},p=()=>{i.current.clear(),r(!1)};return(l=t==null?void 0:t.target)==null||l.addEventListener("keydown",d),(c=t==null?void 0:t.target)==null||c.addEventListener("keyup",f),window.addEventListener("blur",p),()=>{var h,E;(h=t==null?void 0:t.target)==null||h.removeEventListener("keydown",d),(E=t==null?void 0:t.target)==null||E.removeEventListener("keyup",f),window.removeEventListener("blur",p)}}},[e,r]),n};function lv(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(o=>t.has(o)))}function cv(e,t){return t.includes(e)?"code":"key"}function uv(e,t,n,r){var s,a;if(!e.parentNode)return n;const o=t.get(e.parentNode),i=bo(o,r);return uv(o,t,{x:(n.x??0)+i.x,y:(n.y??0)+i.y,z:(((s=o[Ae])==null?void 0:s.z)??0)>(n.z??0)?((a=o[Ae])==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}=uv(r,e,{...r.position,z:((o=r[Ae])==null?void 0:o.z)??0},t);r.positionAbsolute={x:i,y:s},r[Ae].z=a,n!=null&&n[r.id]&&(r[Ae].isParent=!0)}})}function Yd(e,t,n,r){const o=new Map,i={},s=r?1e3:0;return e.forEach(a=>{var f;const l=(Tt(a.zIndex)?a.zIndex:0)+(a.selected?s:0),c=t.get(a.id),d={width:c==null?void 0:c.width,height:c==null?void 0:c.height,...a,positionAbsolute:{x:a.position.x,y:a.position.y}};a.parentNode&&(d.parentNode=a.parentNode,i[a.parentNode]=!0),Object.defineProperty(d,Ae,{enumerable:!1,value:{handleBounds:(f=c==null?void 0:c[Ae])==null?void 0:f.handleBounds,z:l}}),o.set(a.id,d)}),dv(o,n,i),o}function fv(e,t={}){const{getNodes:n,width:r,height:o,minZoom:i,maxZoom:s,d3Zoom:a,d3Selection:l,fitViewOnInitDone:c,fitViewOnInit:d,nodeOrigin:f}=e(),p=t.initial&&!c&&d;if(a&&l&&(p||!t.initial)){const E=n().filter(y=>{var m;const g=t.includeHiddenNodes?y.width&&y.height:!y.hidden;return(m=t.nodes)!=null&&m.length?g&&t.nodes.some(_=>_.id===y.id):g}),v=E.every(y=>y.width&&y.height);if(E.length>0&&v){const y=Bd(E,f),[g,m,_]=GE(y,r,o,t.minZoom??i,t.maxZoom??s,t.padding??.1),S=Qn.translate(g,m).scale(_);return typeof t.duration=="number"&&t.duration>0?a.transform(br(l,t.duration),S):a.transform(l,S),!0}}return!1}function uT(e,t){return e.forEach(n=>{const r=t.get(n.id);r&&t.set(r.id,{...r,[Ae]:r[Ae],selected:n.selected})}),new Map(t)}function dT(e,t){return t.map(n=>{const r=e.find(o=>o.id===n.id);return r&&(n.selected=r.selected),n})}function _l({changedNodes:e,changedEdges:t,get:n,set:r}){const{nodeInternals:o,edges:i,onNodesChange:s,onEdgesChange:a,hasDefaultNodes:l,hasDefaultEdges:c}=n();e!=null&&e.length&&(l&&r({nodeInternals:uT(e,o)}),s==null||s(e)),t!=null&&t.length&&(c&&r({edges:dT(t,i)}),a==null||a(t))}const ko=()=>{},fT={zoomIn:ko,zoomOut:ko,zoomTo:ko,getZoom:()=>1,setViewport:ko,getViewport:()=>({x:0,y:0,zoom:1}),fitView:()=>!1,setCenter:ko,fitBounds:ko,project:e=>e,viewportInitialized:!1},pT=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection}),hT=()=>{const e=Te(),{d3Zoom:t,d3Selection:n}=ae(pT,ze);return w.useMemo(()=>n&&t?{zoomIn:o=>t.scaleBy(br(n,o==null?void 0:o.duration),1.2),zoomOut:o=>t.scaleBy(br(n,o==null?void 0:o.duration),1/1.2),zoomTo:(o,i)=>t.scaleTo(br(n,i==null?void 0:i.duration),o),getZoom:()=>e.getState().transform[2],setViewport:(o,i)=>{const[s,a,l]=e.getState().transform,c=Qn.translate(o.x??s,o.y??a).scale(o.zoom??l);t.transform(br(n,i==null?void 0:i.duration),c)},getViewport:()=>{const[o,i,s]=e.getState().transform;return{x:o,y:i,zoom:s}},fitView:o=>fv(e.getState,o),setCenter:(o,i,s)=>{const{width:a,height:l,maxZoom:c}=e.getState(),d=typeof(s==null?void 0:s.zoom)<"u"?s.zoom:c,f=a/2-o*d,p=l/2-i*d,h=Qn.translate(f,p).scale(d);t.transform(br(n,s==null?void 0:s.duration),h)},fitBounds:(o,i)=>{const{width:s,height:a,minZoom:l,maxZoom:c}=e.getState(),[d,f,p]=GE(o,s,a,l,c,(i==null?void 0:i.padding)??.1),h=Qn.translate(d,f).scale(p);t.transform(br(n,i==null?void 0:i.duration),h)},project:o=>{const{transform:i,snapToGrid:s,snapGrid:a}=e.getState();return HE(o,i,s,a)},viewportInitialized:!0}:fT,[t,n])};function Kd(){const e=hT(),t=Te(),n=w.useCallback(()=>t.getState().getNodes().map(v=>({...v})),[]),r=w.useCallback(v=>t.getState().nodeInternals.get(v),[]),o=w.useCallback(()=>{const{edges:v=[]}=t.getState();return v.map(y=>({...y}))},[]),i=w.useCallback(v=>{const{edges:y=[]}=t.getState();return y.find(g=>g.id===v)},[]),s=w.useCallback(v=>{const{getNodes:y,setNodes:g,hasDefaultNodes:m,onNodesChange:_}=t.getState(),S=y(),x=typeof v=="function"?v(S):v;if(m)g(x);else if(_){const R=x.length===0?S.map(I=>({type:"remove",id:I.id})):x.map(I=>({item:I,type:"reset"}));_(R)}},[]),a=w.useCallback(v=>{const{edges:y=[],setEdges:g,hasDefaultEdges:m,onEdgesChange:_}=t.getState(),S=typeof v=="function"?v(y):v;if(m)g(S);else if(_){const x=S.length===0?y.map(R=>({type:"remove",id:R.id})):S.map(R=>({item:R,type:"reset"}));_(x)}},[]),l=w.useCallback(v=>{const y=Array.isArray(v)?v:[v],{getNodes:g,setNodes:m,hasDefaultNodes:_,onNodesChange:S}=t.getState();if(_){const R=[...g(),...y];m(R)}else if(S){const x=y.map(R=>({item:R,type:"add"}));S(x)}},[]),c=w.useCallback(v=>{const y=Array.isArray(v)?v:[v],{edges:g=[],setEdges:m,hasDefaultEdges:_,onEdgesChange:S}=t.getState();if(_)m([...g,...y]);else if(S){const x=y.map(R=>({item:R,type:"add"}));S(x)}},[]),d=w.useCallback(()=>{const{getNodes:v,edges:y=[],transform:g}=t.getState(),[m,_,S]=g;return{nodes:v().map(x=>({...x})),edges:y.map(x=>({...x})),viewport:{x:m,y:_,zoom:S}}},[]),f=w.useCallback(({nodes:v,edges:y})=>{const{nodeInternals:g,getNodes:m,edges:_,hasDefaultNodes:S,hasDefaultEdges:x,onNodesDelete:R,onEdgesDelete:I,onNodesChange:L,onEdgesChange:U}=t.getState(),A=(v||[]).map(j=>j.id),b=(y||[]).map(j=>j.id),V=m().reduce((j,P)=>{const $=!A.includes(P.id)&&P.parentNode&&j.find(C=>C.id===P.parentNode);return(typeof P.deletable=="boolean"?P.deletable:!0)&&(A.includes(P.id)||$)&&j.push(P),j},[]),M=_.filter(j=>typeof j.deletable=="boolean"?j.deletable:!0),O=M.filter(j=>b.includes(j.id));if(V||O){const j=WE(V,M),P=[...O,...j],$=P.reduce((D,C)=>(D.includes(C.id)||D.push(C.id),D),[]);if((x||S)&&(x&&t.setState({edges:_.filter(D=>!$.includes(D.id))}),S&&(V.forEach(D=>{g.delete(D.id)}),t.setState({nodeInternals:new Map(g)}))),$.length>0&&(I==null||I(P),U&&U($.map(D=>({id:D,type:"remove"})))),V.length>0&&(R==null||R(V),L)){const D=V.map(C=>({id:C.id,type:"remove"}));L(D)}}},[]),p=w.useCallback(v=>{const y=DO(v),g=y?null:t.getState().nodeInternals.get(v.id);return[y?v:bE(g),g,y]},[]),h=w.useCallback((v,y=!0,g)=>{const[m,_,S]=p(v);return m?(g||t.getState().getNodes()).filter(x=>{if(!S&&(x.id===_.id||!x.positionAbsolute))return!1;const R=bE(x),I=Pd(R,m);return y&&I>0||I>=v.width*v.height}):[]},[]),E=w.useCallback((v,y,g=!0)=>{const[m]=p(v);if(!m)return!1;const _=Pd(m,y);return g&&_>0||_>=v.width*v.height},[]);return w.useMemo(()=>({...e,getNodes:n,getNode:r,getEdges:o,getEdge:i,setNodes:s,setEdges:a,addNodes:l,addEdges:c,toObject:d,deleteElements:f,getIntersectingNodes:h,isNodeIntersecting:E}),[e,n,r,o,i,s,a,l,c,d,f,h,E])}var gT=({deleteKeyCode:e,multiSelectionKeyCode:t})=>{const n=Te(),{deleteElements:r}=Kd(),o=Do(e),i=Do(t);w.useEffect(()=>{if(o){const{edges:s,getNodes:a}=n.getState(),l=a().filter(d=>d.selected),c=s.filter(d=>d.selected);r({nodes:l,edges:c}),n.setState({nodesSelectionActive:!1})}},[o]),w.useEffect(()=>{n.setState({multiSelectionActive:i})},[i])};function mT(e){const t=Te();w.useEffect(()=>{let n;const r=()=>{var i,s;if(!e.current)return;const o=Ld(e.current);(o.height===0||o.width===0)&&((s=(i=t.getState()).onError)==null||s.call(i,"004",Nn.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 Qd={position:"absolute",width:"100%",height:"100%",top:0,left:0},ET=(e,t)=>e.x!==t.x||e.y!==t.y||e.zoom!==t.k,Sl=e=>({x:e.x,y:e.y,zoom:e.k}),Po=(e,t)=>e.target.closest(`.${t}`),pv=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),hv=e=>{const t=e.ctrlKey&&gl()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t},vT=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection,d3ZoomHandler:e.d3ZoomHandler,userSelectionActive:e.userSelectionActive}),yT=({onMove:e,onMoveStart:t,onMoveEnd:n,onPaneContextMenu:r,zoomOnScroll:o=!0,zoomOnPinch:i=!0,panOnScroll:s=!1,panOnScrollSpeed:a=.5,panOnScrollMode:l=Ir.Free,zoomOnDoubleClick:c=!0,elementsSelectable:d,panOnDrag:f=!0,defaultViewport:p,translateExtent:h,minZoom:E,maxZoom:v,zoomActivationKeyCode:y,preventScrolling:g=!0,children:m,noWheelClassName:_,noPanClassName:S})=>{const x=w.useRef(),R=Te(),I=w.useRef(!1),L=w.useRef(!1),U=w.useRef(null),A=w.useRef({x:0,y:0,zoom:0}),{d3Zoom:b,d3Selection:V,d3ZoomHandler:M,userSelectionActive:O}=ae(vT,ze),j=Do(y),P=w.useRef(0),$=w.useRef(!1),D=w.useRef();return mT(U),w.useEffect(()=>{if(U.current){const C=U.current.getBoundingClientRect(),k=wO().scaleExtent([E,v]).translateExtent(h),F=Vt(U.current).call(k),B=Qn.translate(p.x,p.y).scale(Ao(p.zoom,E,v)),z=[[0,0],[C.width,C.height]],W=k.constrain()(B,z,h);k.transform(F,W),k.wheelDelta(hv),R.setState({d3Zoom:k,d3Selection:F,d3ZoomHandler:F.on("wheel.zoom"),transform:[W.x,W.y,W.k],domNode:U.current.closest(".react-flow")})}},[]),w.useEffect(()=>{V&&b&&(s&&!j&&!O?V.on("wheel.zoom",C=>{if(Po(C,_))return!1;C.preventDefault(),C.stopImmediatePropagation();const k=V.property("__zoom").k||1,F=gl();if(C.ctrlKey&&i&&F){const pe=en(C),le=hv(C),we=k*Math.pow(2,le);b.scaleTo(V,we,pe,C);return}const B=C.deltaMode===1?20:1;let z=l===Ir.Vertical?0:C.deltaX*B,W=l===Ir.Horizontal?0:C.deltaY*B;!F&&C.shiftKey&&l!==Ir.Vertical&&(z=C.deltaY*B,W=0),b.translateBy(V,-(z/k)*a,-(W/k)*a,{internal:!0});const X=Sl(V.property("__zoom")),{onViewportChangeStart:Q,onViewportChange:J,onViewportChangeEnd:re}=R.getState();clearTimeout(D.current),$.current||($.current=!0,t==null||t(C,X),Q==null||Q(X)),$.current&&(e==null||e(C,X),J==null||J(X),D.current=setTimeout(()=>{n==null||n(C,X),re==null||re(X),$.current=!1},150))},{passive:!1}):typeof M<"u"&&V.on("wheel.zoom",function(C,k){if(!g||Po(C,_))return null;C.preventDefault(),M.call(this,C,k)},{passive:!1}))},[O,s,l,V,b,M,j,i,g,_,t,e,n]),w.useEffect(()=>{b&&b.on("start",C=>{var B,z;if(!C.sourceEvent||C.sourceEvent.internal)return null;P.current=(B=C.sourceEvent)==null?void 0:B.button;const{onViewportChangeStart:k}=R.getState(),F=Sl(C.transform);I.current=!0,A.current=F,((z=C.sourceEvent)==null?void 0:z.type)==="mousedown"&&R.setState({paneDragging:!0}),k==null||k(F),t==null||t(C.sourceEvent,F)})},[b,t]),w.useEffect(()=>{b&&(O&&!I.current?b.on("zoom",null):O||b.on("zoom",C=>{var F;const{onViewportChange:k}=R.getState();if(R.setState({transform:[C.transform.x,C.transform.y,C.transform.k]}),L.current=!!(r&&pv(f,P.current??0)),(e||k)&&!((F=C.sourceEvent)!=null&&F.internal)){const B=Sl(C.transform);k==null||k(B),e==null||e(C.sourceEvent,B)}}))},[O,b,e,f,r]),w.useEffect(()=>{b&&b.on("end",C=>{if(!C.sourceEvent||C.sourceEvent.internal)return null;const{onViewportChangeEnd:k}=R.getState();if(I.current=!1,R.setState({paneDragging:!1}),r&&pv(f,P.current??0)&&!L.current&&r(C.sourceEvent),L.current=!1,(n||k)&&ET(A.current,C.transform)){const F=Sl(C.transform);A.current=F,clearTimeout(x.current),x.current=setTimeout(()=>{k==null||k(F),n==null||n(C.sourceEvent,F)},s?150:0)}})},[b,s,f,n,r]),w.useEffect(()=>{b&&b.filter(C=>{const k=j||o,F=i&&C.ctrlKey;if(C.button===1&&C.type==="mousedown"&&(Po(C,"react-flow__node")||Po(C,"react-flow__edge")))return!0;if(!f&&!k&&!s&&!c&&!i||O||!c&&C.type==="dblclick"||Po(C,_)&&C.type==="wheel"||Po(C,S)&&C.type!=="wheel"||!i&&C.ctrlKey&&C.type==="wheel"||!k&&!s&&!F&&C.type==="wheel"||!f&&(C.type==="mousedown"||C.type==="touchstart")||Array.isArray(f)&&!f.includes(C.button)&&(C.type==="mousedown"||C.type==="touchstart"))return!1;const B=Array.isArray(f)&&f.includes(C.button)||!C.button||C.button<=1;return(!C.ctrlKey||C.type==="wheel")&&B})},[O,b,o,i,s,c,f,d,j]),u.jsx("div",{className:"react-flow__renderer",ref:U,style:Qd,children:m})},_T=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function ST(){const{userSelectionActive:e,userSelectionRect:t}=ae(_T,ze);return e&&t?u.jsx("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 gv(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 mv(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&&gv(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&&gv(r,s);break}case"remove":return r}return r.push(s),r},n)}function Ev(e,t){return mv(e,t)}function xT(e,t){return mv(e,t)}const Zn=(e,t)=>({id:e,type:"select",selected:t});function Mo(e,t){return e.reduce((n,r)=>{const o=t.includes(r.id);return!r.selected&&o?(r.selected=!0,n.push(Zn(r.id,!0))):r.selected&&!o&&(r.selected=!1,n.push(Zn(r.id,!1))),n},[])}const Xd=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},RT=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging}),vv=w.memo(({isSelecting:e,selectionMode:t=os.Full,panOnDrag:n,onSelectionStart:r,onSelectionEnd:o,onPaneClick:i,onPaneContextMenu:s,onPaneScroll:a,onPaneMouseEnter:l,onPaneMouseMove:c,onPaneMouseLeave:d,children:f})=>{const p=w.useRef(null),h=Te(),E=w.useRef(0),v=w.useRef(0),y=w.useRef(),{userSelectionActive:g,elementsSelectable:m,dragging:_}=ae(RT,ze),S=()=>{h.setState({userSelectionActive:!1,userSelectionRect:null}),E.current=0,v.current=0},x=M=>{i==null||i(M),h.getState().resetSelectedElements(),h.setState({nodesSelectionActive:!1})},R=M=>{if(Array.isArray(n)&&(n!=null&&n.includes(2))){M.preventDefault();return}s==null||s(M)},I=a?M=>a(M):void 0,L=M=>{const{resetSelectedElements:O,domNode:j}=h.getState();if(y.current=j==null?void 0:j.getBoundingClientRect(),!m||!e||M.button!==0||M.target!==p.current||!y.current)return;const{x:P,y:$}=Xn(M,y.current);O(),h.setState({userSelectionRect:{width:0,height:0,startX:P,startY:$,x:P,y:$}}),r==null||r(M)},U=M=>{const{userSelectionRect:O,nodeInternals:j,edges:P,transform:$,onNodesChange:D,onEdgesChange:C,nodeOrigin:k,getNodes:F}=h.getState();if(!e||!y.current||!O)return;h.setState({userSelectionActive:!0,nodesSelectionActive:!1});const B=Xn(M,y.current),z=O.startX??0,W=O.startY??0,X={...O,x:B.x<z?B.x:z,y:B.y<W?B.y:W,width:Math.abs(B.x-z),height:Math.abs(B.y-W)},Q=F(),J=zE(j,X,$,t===os.Partial,!0,k),re=WE(J,P).map(le=>le.id),pe=J.map(le=>le.id);if(E.current!==pe.length){E.current=pe.length;const le=Mo(Q,pe);le.length&&(D==null||D(le))}if(v.current!==re.length){v.current=re.length;const le=Mo(P,re);le.length&&(C==null||C(le))}h.setState({userSelectionRect:X})},A=M=>{if(M.button!==0)return;const{userSelectionRect:O}=h.getState();!g&&O&&M.target===p.current&&(x==null||x(M)),h.setState({nodesSelectionActive:E.current>0}),S(),o==null||o(M)},b=M=>{g&&(h.setState({nodesSelectionActive:E.current>0}),o==null||o(M)),S()},V=m&&(e||g);return u.jsxs("div",{className:qe(["react-flow__pane",{dragging:_,selection:e}]),onClick:V?void 0:Xd(x,p),onContextMenu:Xd(R,p),onWheel:Xd(I,p),onMouseEnter:V?void 0:l,onMouseDown:V?L:void 0,onMouseMove:V?U:c,onMouseUp:V?A:void 0,onMouseLeave:V?b:d,ref:p,style:Qd,children:[f,u.jsx(ST,{})]})});vv.displayName="Pane";function yv(e,t){if(!e.parentNode)return!1;const n=t.get(e.parentNode);return n?n.selected?!0:yv(n,t):!1}function _v(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 NT(e,t,n,r){return Array.from(e.values()).filter(o=>(o.selected||o.id===r)&&(!o.parentNode||!yv(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 wT(e,t){return!t||t==="parent"?t:[t[0],[t[1][0]-(e.width||0),t[1][1]-(e.height||0)]]}function Sv(e,t,n,r,o=[0,0],i){const s=wT(e,e.extent||r);let a=s;if(e.extent==="parent")if(e.parentNode&&e.width&&e.height){const d=n.get(e.parentNode),{x:f,y:p}=bo(d,o).positionAbsolute;a=d&&Tt(f)&&Tt(p)&&Tt(d.width)&&Tt(d.height)?[[f+e.width*o[0],p+e.height*o[1]],[f+d.width-e.width+e.width*o[0],p+d.height-e.height+e.height*o[1]]]:a}else i==null||i("005",Nn.error005()),a=s;else if(e.extent&&e.parentNode){const d=n.get(e.parentNode),{x:f,y:p}=bo(d,o).positionAbsolute;a=[[e.extent[0][0]+f,e.extent[0][1]+p],[e.extent[1][0]+f,e.extent[1][1]+p]]}let l={x:0,y:0};if(e.parentNode){const d=n.get(e.parentNode);l=bo(d,o).positionAbsolute}const c=a&&a!=="parent"?Dd(t,a):t;return{position:{x:c.x-l.x,y:c.y-l.y},positionAbsolute:c}}function qd({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 xv=(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 c=l.getBoundingClientRect();return{id:l.getAttribute("data-handleid"),position:l.getAttribute("data-handlepos"),x:(c.left-s.left-a.x)/n,y:(c.top-s.top-a.y)/n,...Ld(l)}})};function as(e,t,n){return n===void 0?n:r=>{const o=t().nodeInternals.get(e);o&&n(r,{...o})}}function Jd({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:o,unselectNodesAndEdges:i,multiSelectionActive:s,nodeInternals:a,onError:l}=t.getState(),c=a.get(e);if(!c){l==null||l("012",Nn.error012(e));return}t.setState({nodesSelectionActive:!1}),c.selected?(n||c.selected&&s)&&(i({nodes:[c]}),requestAnimationFrame(()=>{var d;return(d=r==null?void 0:r.current)==null?void 0:d.blur()})):o([e])}function OT(){const e=Te();return w.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 Zd(e){return(t,n,r)=>e==null?void 0:e(t,r)}function Rv({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:o,isSelectable:i,selectNodesOnDrag:s}){const a=Te(),[l,c]=w.useState(!1),d=w.useRef([]),f=w.useRef({x:null,y:null}),p=w.useRef(0),h=w.useRef(null),E=w.useRef({x:0,y:0}),v=w.useRef(null),y=w.useRef(!1),g=OT();return w.useEffect(()=>{if(e!=null&&e.current){const m=Vt(e.current),_=({x,y:R})=>{const{nodeInternals:I,onNodeDrag:L,onSelectionDrag:U,updateNodePositions:A,nodeExtent:b,snapGrid:V,snapToGrid:M,nodeOrigin:O,onError:j}=a.getState();f.current={x,y:R};let P=!1,$={x:0,y:0,x2:0,y2:0};if(d.current.length>1&&b){const C=Bd(d.current,O);$=kd(C)}if(d.current=d.current.map(C=>{const k={x:x-C.distance.x,y:R-C.distance.y};M&&(k.x=V[0]*Math.round(k.x/V[0]),k.y=V[1]*Math.round(k.y/V[1]));const F=[[b[0][0],b[0][1]],[b[1][0],b[1][1]]];d.current.length>1&&b&&!C.extent&&(F[0][0]=C.positionAbsolute.x-$.x+b[0][0],F[1][0]=C.positionAbsolute.x+(C.width??0)-$.x2+b[1][0],F[0][1]=C.positionAbsolute.y-$.y+b[0][1],F[1][1]=C.positionAbsolute.y+(C.height??0)-$.y2+b[1][1]);const B=Sv(C,k,I,F,O,j);return P=P||C.position.x!==B.position.x||C.position.y!==B.position.y,C.position=B.position,C.positionAbsolute=B.positionAbsolute,C}),!P)return;A(d.current,!0,!0),c(!0);const D=o?L:Zd(U);if(D&&v.current){const[C,k]=qd({nodeId:o,dragItems:d.current,nodeInternals:I});D(v.current,C,k)}},S=()=>{if(!h.current)return;const[x,R]=AE(E.current,h.current);if(x!==0||R!==0){const{transform:I,panBy:L}=a.getState();f.current.x=(f.current.x??0)-x/I[2],f.current.y=(f.current.y??0)-R/I[2],L({x,y:R})&&_(f.current)}p.current=requestAnimationFrame(S)};if(t)m.on(".drag",null);else{const x=PN().on("start",R=>{var P;const{nodeInternals:I,multiSelectionActive:L,domNode:U,nodesDraggable:A,unselectNodesAndEdges:b,onNodeDragStart:V,onSelectionDragStart:M}=a.getState(),O=o?V:Zd(M);!s&&!L&&o&&((P=I.get(o))!=null&&P.selected||b()),o&&i&&s&&Jd({id:o,store:a,nodeRef:e});const j=g(R);if(f.current=j,d.current=NT(I,A,j,o),O&&d.current){const[$,D]=qd({nodeId:o,dragItems:d.current,nodeInternals:I});O(R.sourceEvent,$,D)}h.current=(U==null?void 0:U.getBoundingClientRect())||null,E.current=Xn(R.sourceEvent,h.current)}).on("drag",R=>{const I=g(R),{autoPanOnNodeDrag:L}=a.getState();!y.current&&L&&(y.current=!0,S()),(f.current.x!==I.xSnapped||f.current.y!==I.ySnapped)&&d.current&&(v.current=R.sourceEvent,E.current=Xn(R.sourceEvent,h.current),_(I))}).on("end",R=>{if(c(!1),y.current=!1,cancelAnimationFrame(p.current),d.current){const{updateNodePositions:I,nodeInternals:L,onNodeDragStop:U,onSelectionDragStop:A}=a.getState(),b=o?U:Zd(A);if(I(d.current,!1,!1),b){const[V,M]=qd({nodeId:o,dragItems:d.current,nodeInternals:L});b(R.sourceEvent,V,M)}}}).filter(R=>{const I=R.target;return!R.button&&(!n||!_v(I,`.${n}`,e))&&(!r||_v(I,r,e))});return m.call(x),()=>{m.on(".drag",null)}}}},[e,t,n,r,i,a,o,s,g]),l}function Nv(){const e=Te();return w.useCallback(n=>{const{nodeInternals:r,nodeExtent:o,updateNodePositions:i,getNodes:s,snapToGrid:a,snapGrid:l,onError:c,nodesDraggable:d}=e.getState(),f=s().filter(m=>m.selected&&(m.draggable||d&&typeof m.draggable>"u")),p=a?l[0]:5,h=a?l[1]:5,E=n.isShiftPressed?4:1,v=n.x*p*E,y=n.y*h*E,g=f.map(m=>{if(m.positionAbsolute){const _={x:m.positionAbsolute.x+v,y:m.positionAbsolute.y+y};a&&(_.x=l[0]*Math.round(_.x/l[0]),_.y=l[1]*Math.round(_.y/l[1]));const{positionAbsolute:S,position:x}=Sv(m,_,r,o,void 0,c);m.position=x,m.positionAbsolute=S}return m});i(g,!0,!1)},[])}const jo={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};var ls=e=>{const t=({id:n,type:r,data:o,xPos:i,yPos:s,xPosOrigin:a,yPosOrigin:l,selected:c,onClick:d,onMouseEnter:f,onMouseMove:p,onMouseLeave:h,onContextMenu:E,onDoubleClick:v,style:y,className:g,isDraggable:m,isSelectable:_,isConnectable:S,isFocusable:x,selectNodesOnDrag:R,sourcePosition:I,targetPosition:L,hidden:U,resizeObserver:A,dragHandle:b,zIndex:V,isParent:M,noDragClassName:O,noPanClassName:j,initialized:P,disableKeyboardA11y:$,ariaLabel:D,rfId:C})=>{const k=Te(),F=w.useRef(null),B=w.useRef(I),z=w.useRef(L),W=w.useRef(r),X=_||m||d||f||p||h,Q=Nv(),J=as(n,k.getState,f),re=as(n,k.getState,p),pe=as(n,k.getState,h),le=as(n,k.getState,E),we=as(n,k.getState,v),et=me=>{if(_&&(!R||!m)&&Jd({id:n,store:k,nodeRef:F}),d){const tt=k.getState().nodeInternals.get(n);tt&&d(me,{...tt})}},yt=me=>{if(!Md(me))if(CE.includes(me.key)&&_){const tt=me.key==="Escape";Jd({id:n,store:k,unselect:tt,nodeRef:F})}else!$&&m&&c&&Object.prototype.hasOwnProperty.call(jo,me.key)&&(k.setState({ariaLiveMessage:`Moved selected node ${me.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~i}, y: ${~~s}`}),Q({x:jo[me.key].x,y:jo[me.key].y,isShiftPressed:me.shiftKey}))};w.useEffect(()=>{if(F.current&&!U){const me=F.current;return A==null||A.observe(me),()=>A==null?void 0:A.unobserve(me)}},[U]),w.useEffect(()=>{const me=W.current!==r,tt=B.current!==I,q=z.current!==L;F.current&&(me||tt||q)&&(me&&(W.current=r),tt&&(B.current=I),q&&(z.current=L),k.getState().updateNodeDimensions([{id:n,nodeElement:F.current,forceUpdate:!0}]))},[n,r,I,L]);const _e=Rv({nodeRef:F,disabled:U||!m,noDragClassName:O,handleSelector:b,nodeId:n,isSelectable:_,selectNodesOnDrag:R});return U?null:u.jsx("div",{className:qe(["react-flow__node",`react-flow__node-${r}`,{[j]:m},g,{selected:c,selectable:_,parent:M,dragging:_e}]),ref:F,style:{zIndex:V,transform:`translate(${a}px,${l}px)`,pointerEvents:X?"all":"none",visibility:P?"visible":"hidden",...y},"data-id":n,"data-testid":`rf__node-${n}`,onMouseEnter:J,onMouseMove:re,onMouseLeave:pe,onContextMenu:le,onClick:et,onDoubleClick:we,onKeyDown:x?yt:void 0,tabIndex:x?0:void 0,role:x?"button":void 0,"aria-describedby":$?void 0:`${sv}-${C}`,"aria-label":D,children:u.jsx(VO,{value:n,children:u.jsx(e,{id:n,data:o,type:r,xPos:i,yPos:s,selected:c,isConnectable:S,sourcePosition:I,targetPosition:L,dragging:_e,dragHandle:b,zIndex:V})})})};return t.displayName="NodeWrapper",w.memo(t)};const TT=e=>{const t=e.getNodes().filter(n=>n.selected);return{...Bd(t,e.nodeOrigin),transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`,userSelectionActive:e.userSelectionActive}};function AT({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=Te(),{width:o,height:i,x:s,y:a,transformString:l,userSelectionActive:c}=ae(TT,ze),d=Nv(),f=w.useRef(null);if(w.useEffect(()=>{var E;n||(E=f.current)==null||E.focus({preventScroll:!0})},[n]),Rv({nodeRef:f}),c||!o||!i)return null;const p=e?E=>{const v=r.getState().getNodes().filter(y=>y.selected);e(E,v)}:void 0,h=E=>{Object.prototype.hasOwnProperty.call(jo,E.key)&&d({x:jo[E.key].x,y:jo[E.key].y,isShiftPressed:E.shiftKey})};return u.jsx("div",{className:qe(["react-flow__nodesselection","react-flow__container",t]),style:{transform:l},children:u.jsx("div",{ref:f,className:"react-flow__nodesselection-rect",onContextMenu:p,tabIndex:n?void 0:-1,onKeyDown:n?void 0:h,style:{width:o,height:i,top:a,left:s}})})}var IT=w.memo(AT);const bT=e=>e.nodesSelectionActive,wv=({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:o,onPaneContextMenu:i,onPaneScroll:s,deleteKeyCode:a,onMove:l,onMoveStart:c,onMoveEnd:d,selectionKeyCode:f,selectionOnDrag:p,selectionMode:h,onSelectionStart:E,onSelectionEnd:v,multiSelectionKeyCode:y,panActivationKeyCode:g,zoomActivationKeyCode:m,elementsSelectable:_,zoomOnScroll:S,zoomOnPinch:x,panOnScroll:R,panOnScrollSpeed:I,panOnScrollMode:L,zoomOnDoubleClick:U,panOnDrag:A,defaultViewport:b,translateExtent:V,minZoom:M,maxZoom:O,preventScrolling:j,onSelectionContextMenu:P,noWheelClassName:$,noPanClassName:D,disableKeyboardA11y:C})=>{const k=ae(bT),F=Do(f),z=Do(g)||A,W=F||p&&z!==!0;return gT({deleteKeyCode:a,multiSelectionKeyCode:y}),u.jsx(yT,{onMove:l,onMoveStart:c,onMoveEnd:d,onPaneContextMenu:i,elementsSelectable:_,zoomOnScroll:S,zoomOnPinch:x,panOnScroll:R,panOnScrollSpeed:I,panOnScrollMode:L,zoomOnDoubleClick:U,panOnDrag:!F&&z,defaultViewport:b,translateExtent:V,minZoom:M,maxZoom:O,zoomActivationKeyCode:m,preventScrolling:j,noWheelClassName:$,noPanClassName:D,children:u.jsxs(vv,{onSelectionStart:E,onSelectionEnd:v,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:o,onPaneContextMenu:i,onPaneScroll:s,panOnDrag:z,isSelecting:!!W,selectionMode:h,children:[e,k&&u.jsx(IT,{onSelectionContextMenu:P,noPanClassName:D,disableKeyboardA11y:C})]})})};wv.displayName="FlowRenderer";var CT=w.memo(wv);function LT(e){return ae(w.useCallback(n=>e?zE(n.nodeInternals,{x:0,y:0,width:n.width,height:n.height},n.transform,!0):n.getNodes(),[e]))}function DT(e){const t={input:ls(e.input||tv),default:ls(e.default||Wd),output:ls(e.output||rv),group:ls(e.group||Gd)},n={},r=Object.keys(e).filter(o=>!["input","default","output","group"].includes(o)).reduce((o,i)=>(o[i]=ls(e[i]||Wd),o),n);return{...t,...r}}const kT=({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]},PT=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,updateNodeDimensions:e.updateNodeDimensions,onError:e.onError}),Ov=e=>{const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:o,updateNodeDimensions:i,onError:s}=ae(PT,ze),a=LT(e.onlyRenderVisibleElements),l=w.useRef(),c=w.useMemo(()=>{if(typeof ResizeObserver>"u")return null;const d=new ResizeObserver(f=>{const p=f.map(h=>({id:h.target.getAttribute("data-id"),nodeElement:h.target,forceUpdate:!0}));i(p)});return l.current=d,d},[]);return w.useEffect(()=>()=>{var d;(d=l==null?void 0:l.current)==null||d.disconnect()},[]),u.jsx("div",{className:"react-flow__nodes",style:Qd,children:a.map(d=>{var x,R;let f=d.type||"default";e.nodeTypes[f]||(s==null||s("003",Nn.error003(f)),f="default");const p=e.nodeTypes[f]||e.nodeTypes.default,h=!!(d.draggable||t&&typeof d.draggable>"u"),E=!!(d.selectable||o&&typeof d.selectable>"u"),v=!!(d.connectable||n&&typeof d.connectable>"u"),y=!!(d.focusable||r&&typeof d.focusable>"u"),g=e.nodeExtent?Dd(d.positionAbsolute,e.nodeExtent):d.positionAbsolute,m=(g==null?void 0:g.x)??0,_=(g==null?void 0:g.y)??0,S=kT({x:m,y:_,width:d.width??0,height:d.height??0,origin:e.nodeOrigin});return u.jsx(p,{id:d.id,className:d.className,style:d.style,type:f,data:d.data,sourcePosition:d.sourcePosition||K.Bottom,targetPosition:d.targetPosition||K.Top,hidden:d.hidden,xPos:m,yPos:_,xPosOrigin:S.x,yPosOrigin:S.y,selectNodesOnDrag:e.selectNodesOnDrag,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,selected:!!d.selected,isDraggable:h,isSelectable:E,isConnectable:v,isFocusable:y,resizeObserver:c,dragHandle:d.dragHandle,zIndex:((x=d[Ae])==null?void 0:x.z)??0,isParent:!!((R=d[Ae])!=null&&R.isParent),noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,initialized:!!d.width&&!!d.height,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,ariaLabel:d.ariaLabel},d.id)})})};Ov.displayName="NodeRenderer";var MT=w.memo(Ov);const jT=(e,t,n)=>n===K.Left?e-t:n===K.Right?e+t:e,UT=(e,t,n)=>n===K.Top?e-t:n===K.Bottom?e+t:e,Tv="react-flow__edgeupdater",Av=({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:o,onMouseEnter:i,onMouseOut:s,type:a})=>u.jsx("circle",{onMouseDown:o,onMouseEnter:i,onMouseOut:s,className:qe([Tv,`${Tv}-${a}`]),cx:jT(t,r,e),cy:UT(n,r,e),r,stroke:"transparent",fill:"transparent"}),FT=()=>!0;var Uo=e=>{const t=({id:n,className:r,type:o,data:i,onClick:s,onEdgeDoubleClick:a,selected:l,animated:c,label:d,labelStyle:f,labelShowBg:p,labelBgStyle:h,labelBgPadding:E,labelBgBorderRadius:v,style:y,source:g,target:m,sourceX:_,sourceY:S,targetX:x,targetY:R,sourcePosition:I,targetPosition:L,elementsSelectable:U,hidden:A,sourceHandleId:b,targetHandleId:V,onContextMenu:M,onMouseEnter:O,onMouseMove:j,onMouseLeave:P,edgeUpdaterRadius:$,onEdgeUpdate:D,onEdgeUpdateStart:C,onEdgeUpdateEnd:k,markerEnd:F,markerStart:B,rfId:z,ariaLabel:W,isFocusable:X,isUpdatable:Q,pathOptions:J,interactionWidth:re})=>{const pe=w.useRef(null),[le,we]=w.useState(!1),[et,yt]=w.useState(!1),_e=Te(),me=w.useMemo(()=>`url(#${$d(B,z)})`,[B,z]),tt=w.useMemo(()=>`url(#${$d(F,z)})`,[F,z]);if(A)return null;const q=Ge=>{const{edges:_t,addSelectedEdges:Ur}=_e.getState();if(U&&(_e.setState({nodesSelectionActive:!1}),Ur([n])),s){const Fr=_t.find(Vr=>Vr.id===n);s(Ge,Fr)}},lr=rs(n,_e.getState,a),Pr=rs(n,_e.getState,M),As=rs(n,_e.getState,O),Is=rs(n,_e.getState,j),qo=rs(n,_e.getState,P),Mr=(Ge,_t)=>{if(Ge.button!==0)return;const{edges:Ur,isValidConnection:Fr}=_e.getState(),Vr=_t?m:g,Gl=(_t?V:b)||null,$r=_t?"target":"source",Gf=Fr||FT,Yf=_t,Cs=Ur.find(Br=>Br.id===n);yt(!0),C==null||C(Ge,Cs,$r);const Kf=Br=>{yt(!1),k==null||k(Br,Cs,$r)};XE({event:Ge,handleId:Gl,nodeId:Vr,onConnect:Br=>D==null?void 0:D(Cs,Br),isTarget:Yf,getState:_e.getState,setState:_e.setState,isValidConnection:Gf,edgeUpdaterType:$r,onEdgeUpdateEnd:Kf})},cr=Ge=>Mr(Ge,!0),Jo=Ge=>Mr(Ge,!1),ur=()=>we(!0),jr=()=>we(!1),bs=!U&&!s,Zo=Ge=>{var _t;if(CE.includes(Ge.key)&&U){const{unselectNodesAndEdges:Ur,addSelectedEdges:Fr,edges:Vr}=_e.getState();Ge.key==="Escape"?((_t=pe.current)==null||_t.blur(),Ur({edges:[Vr.find($r=>$r.id===n)]})):Fr([n])}};return u.jsxs("g",{className:qe(["react-flow__edge",`react-flow__edge-${o}`,r,{selected:l,animated:c,inactive:bs,updating:le}]),onClick:q,onDoubleClick:lr,onContextMenu:Pr,onMouseEnter:As,onMouseMove:Is,onMouseLeave:qo,onKeyDown:X?Zo:void 0,tabIndex:X?0:void 0,role:X?"button":"img","data-testid":`rf__edge-${n}`,"aria-label":W===null?void 0:W||`Edge from ${g} to ${m}`,"aria-describedby":X?`${av}-${z}`:void 0,ref:pe,children:[!et&&u.jsx(e,{id:n,source:g,target:m,selected:l,animated:c,label:d,labelStyle:f,labelShowBg:p,labelBgStyle:h,labelBgPadding:E,labelBgBorderRadius:v,data:i,style:y,sourceX:_,sourceY:S,targetX:x,targetY:R,sourcePosition:I,targetPosition:L,sourceHandleId:b,targetHandleId:V,markerStart:me,markerEnd:tt,pathOptions:J,interactionWidth:re}),Q&&u.jsxs(u.Fragment,{children:[(Q==="source"||Q===!0)&&u.jsx(Av,{position:I,centerX:_,centerY:S,radius:$,onMouseDown:cr,onMouseEnter:ur,onMouseOut:jr,type:"source"}),(Q==="target"||Q===!0)&&u.jsx(Av,{position:L,centerX:x,centerY:R,radius:$,onMouseDown:Jo,onMouseEnter:ur,onMouseOut:jr,type:"target"})]})]})};return t.displayName="EdgeWrapper",w.memo(t)};function VT(e){const t={default:Uo(e.default||vl),straight:Uo(e.bezier||Fd),step:Uo(e.step||Ud),smoothstep:Uo(e.step||ml),simplebezier:Uo(e.simplebezier||jd)},n={},r=Object.keys(e).filter(o=>!["default","bezier"].includes(o)).reduce((o,i)=>(o[i]=Uo(e[i]||vl),o),n);return{...t,...r}}function Iv(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 K.Top:return{x:r+i/2,y:o};case K.Right:return{x:r+i,y:o+s/2};case K.Bottom:return{x:r+i/2,y:o+s};case K.Left:return{x:r,y:o+s/2}}}function bv(e,t){return e?e.length===1||!t?e[0]:t&&e.find(n=>n.id===t)||null:null}const $T=(e,t,n,r,o,i)=>{const s=Iv(n,e,t),a=Iv(i,r,o);return{sourceX:s.x,sourceY:s.y,targetX:a.x,targetY:a.y}};function BT({sourcePos:e,targetPos:t,sourceWidth:n,sourceHeight:r,targetWidth:o,targetHeight:i,width:s,height:a,transform:l}){const c={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)};c.x===c.x2&&(c.x2+=1),c.y===c.y2&&(c.y2+=1);const d=kd({x:(0-l[0])/l[2],y:(0-l[1])/l[2],width:s/l[2],height:a/l[2]}),f=Math.max(0,Math.min(d.x2,c.x2)-Math.max(d.x,c.x)),p=Math.max(0,Math.min(d.y2,c.y2)-Math.max(d.y,c.y));return Math.ceil(f*p)>0}function Cv(e){var r,o,i,s,a;const t=((r=e==null?void 0:e[Ae])==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]}const HT=[{level:0,isMaxLevel:!0,edges:[]}];function zT(e,t,n=!1){let r=-1;const o=e.reduce((s,a)=>{var d,f;const l=Tt(a.zIndex);let c=l?a.zIndex:0;if(n){const p=t.get(a.target),h=t.get(a.source),E=a.selected||(p==null?void 0:p.selected)||(h==null?void 0:h.selected),v=Math.max(((d=h==null?void 0:h[Ae])==null?void 0:d.z)||0,((f=p==null?void 0:p[Ae])==null?void 0:f.z)||0,1e3);c=(l?a.zIndex:0)+(E?v:0)}return s[c]?s[c].push(a):s[c]=[a],r=c>r?c:r,s},{}),i=Object.entries(o).map(([s,a])=>{const l=+s;return{edges:a,level:l,isMaxLevel:l===r}});return i.length===0?HT:i}function WT(e,t,n){const r=ae(w.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)&&BT({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 zT(r,t,n)}const GT=({color:e="none",strokeWidth:t=1})=>u.jsx("polyline",{stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:t,fill:"none",points:"-5,-4 0,0 -5,4"}),YT=({color:e="none",strokeWidth:t=1})=>u.jsx("polyline",{stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:t,fill:e,points:"-5,-4 0,0 -5,4 -5,-4"}),Lv={[is.Arrow]:GT,[is.ArrowClosed]:YT};function KT(e){const t=Te();return w.useMemo(()=>{var o,i;return Object.prototype.hasOwnProperty.call(Lv,e)?Lv[e]:((i=(o=t.getState()).onError)==null||i.call(o,"009",Nn.error009(e)),null)},[e])}const QT=({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=KT(t);return l?u.jsx("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:u.jsx(l,{color:n,strokeWidth:s})}):null},XT=({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=$d(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))},Dv=({defaultColor:e,rfId:t})=>{const n=ae(w.useCallback(XT({defaultColor:e,rfId:t}),[e,t]),(r,o)=>!(r.length!==o.length||r.some((i,s)=>i.id!==o[s].id)));return u.jsx("defs",{children:n.map(r=>u.jsx(QT,{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))})};Dv.displayName="MarkerDefinitions";var qT=w.memo(Dv);const JT=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}),kv=({defaultMarkerColor:e,onlyRenderVisibleElements:t,elevateEdgesOnSelect:n,rfId:r,edgeTypes:o,noPanClassName:i,onEdgeUpdate:s,onEdgeContextMenu:a,onEdgeMouseEnter:l,onEdgeMouseMove:c,onEdgeMouseLeave:d,onEdgeClick:f,edgeUpdaterRadius:p,onEdgeDoubleClick:h,onEdgeUpdateStart:E,onEdgeUpdateEnd:v,children:y})=>{const{edgesFocusable:g,edgesUpdatable:m,elementsSelectable:_,width:S,height:x,connectionMode:R,nodeInternals:I,onError:L}=ae(JT,ze),U=WT(t,I,n);return S?u.jsxs(u.Fragment,{children:[U.map(({level:A,edges:b,isMaxLevel:V})=>u.jsxs("svg",{style:{zIndex:A},width:S,height:x,className:"react-flow__edges react-flow__container",children:[V&&u.jsx(qT,{defaultColor:e,rfId:r}),u.jsx("g",{children:b.map(M=>{const[O,j,P]=Cv(I.get(M.source)),[$,D,C]=Cv(I.get(M.target));if(!P||!C)return null;let k=M.type||"default";o[k]||(L==null||L("011",Nn.error011(k)),k="default");const F=o[k]||o.default,B=R===qn.Strict?D.target:(D.target??[]).concat(D.source??[]),z=bv(j.source,M.sourceHandle),W=bv(B,M.targetHandle),X=(z==null?void 0:z.position)||K.Bottom,Q=(W==null?void 0:W.position)||K.Top,J=!!(M.focusable||g&&typeof M.focusable>"u"),re=typeof s<"u"&&(M.updatable||m&&typeof M.updatable>"u");if(!z||!W)return L==null||L("008",Nn.error008(z,M)),null;const{sourceX:pe,sourceY:le,targetX:we,targetY:et}=$T(O,z,X,$,W,Q);return u.jsx(F,{id:M.id,className:qe([M.className,i]),type:k,data:M.data,selected:!!M.selected,animated:!!M.animated,hidden:!!M.hidden,label:M.label,labelStyle:M.labelStyle,labelShowBg:M.labelShowBg,labelBgStyle:M.labelBgStyle,labelBgPadding:M.labelBgPadding,labelBgBorderRadius:M.labelBgBorderRadius,style:M.style,source:M.source,target:M.target,sourceHandleId:M.sourceHandle,targetHandleId:M.targetHandle,markerEnd:M.markerEnd,markerStart:M.markerStart,sourceX:pe,sourceY:le,targetX:we,targetY:et,sourcePosition:X,targetPosition:Q,elementsSelectable:_,onEdgeUpdate:s,onContextMenu:a,onMouseEnter:l,onMouseMove:c,onMouseLeave:d,onClick:f,edgeUpdaterRadius:p,onEdgeDoubleClick:h,onEdgeUpdateStart:E,onEdgeUpdateEnd:v,rfId:r,ariaLabel:M.ariaLabel,isFocusable:J,isUpdatable:re,pathOptions:"pathOptions"in M?M.pathOptions:void 0,interactionWidth:M.interactionWidth},M.id)})})]},A)),y]}):null};kv.displayName="EdgeRenderer";var ZT=w.memo(kv);const eA=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function tA({children:e}){const t=ae(eA);return u.jsx("div",{className:"react-flow__viewport react-flow__container",style:{transform:t},children:e})}function nA(e){const t=Kd(),n=w.useRef(!1);w.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const rA={[K.Left]:K.Right,[K.Right]:K.Left,[K.Top]:K.Bottom,[K.Bottom]:K.Top},Pv=({nodeId:e,handleType:t,style:n,type:r=Jn.Bezier,CustomComponent:o,connectionStatus:i})=>{var R,I,L;const{fromNode:s,handleId:a,toX:l,toY:c,connectionMode:d}=ae(w.useCallback(U=>({fromNode:U.nodeInternals.get(e),handleId:U.connectionHandleId,toX:(U.connectionPosition.x-U.transform[0])/U.transform[2],toY:(U.connectionPosition.y-U.transform[1])/U.transform[2],connectionMode:U.connectionMode}),[e]),ze),f=(R=s==null?void 0:s[Ae])==null?void 0:R.handleBounds;let p=f==null?void 0:f[t];if(d===qn.Loose&&(p=p||(f==null?void 0:f[t==="source"?"target":"source"])),!s||!p)return null;const h=a?p.find(U=>U.id===a):p[0],E=h?h.x+h.width/2:(s.width??0)/2,v=h?h.y+h.height/2:s.height??0,y=(((I=s.positionAbsolute)==null?void 0:I.x)??0)+E,g=(((L=s.positionAbsolute)==null?void 0:L.y)??0)+v,m=h==null?void 0:h.position,_=m?rA[m]:null;if(!m||!_)return null;if(o)return u.jsx(o,{connectionLineType:r,connectionLineStyle:n,fromNode:s,fromHandle:h,fromX:y,fromY:g,toX:l,toY:c,fromPosition:m,toPosition:_,connectionStatus:i});let S="";const x={sourceX:y,sourceY:g,sourcePosition:m,targetX:l,targetY:c,targetPosition:_};return r===Jn.Bezier?[S]=VE(x):r===Jn.Step?[S]=ss({...x,borderRadius:0}):r===Jn.SmoothStep?[S]=ss(x):r===Jn.SimpleBezier?[S]=ME(x):S=`M${y},${g} ${l},${c}`,u.jsx("path",{d:S,fill:"none",className:"react-flow__connection-path",style:n})};Pv.displayName="ConnectionLine";const oA=e=>({nodeId:e.connectionNodeId,handleType:e.connectionHandleType,nodesConnectable:e.nodesConnectable,connectionStatus:e.connectionStatus,width:e.width,height:e.height});function iA({containerStyle:e,style:t,type:n,component:r}){const{nodeId:o,handleType:i,nodesConnectable:s,width:a,height:l,connectionStatus:c}=ae(oA,ze);return!(o&&i&&a&&s)?null:u.jsx("svg",{style:e,width:a,height:l,className:"react-flow__edges react-flow__connectionline react-flow__container",children:u.jsx("g",{className:qe(["react-flow__connection",c]),children:u.jsx(Pv,{nodeId:o,handleType:i,style:t,type:n,CustomComponent:r,connectionStatus:c})})})}function Mv(e,t){return w.useRef(null),Te(),w.useMemo(()=>t(e),[e])}const jv=({nodeTypes:e,edgeTypes:t,onMove:n,onMoveStart:r,onMoveEnd:o,onInit:i,onNodeClick:s,onEdgeClick:a,onNodeDoubleClick:l,onEdgeDoubleClick:c,onNodeMouseEnter:d,onNodeMouseMove:f,onNodeMouseLeave:p,onNodeContextMenu:h,onSelectionContextMenu:E,onSelectionStart:v,onSelectionEnd:y,connectionLineType:g,connectionLineStyle:m,connectionLineComponent:_,connectionLineContainerStyle:S,selectionKeyCode:x,selectionOnDrag:R,selectionMode:I,multiSelectionKeyCode:L,panActivationKeyCode:U,zoomActivationKeyCode:A,deleteKeyCode:b,onlyRenderVisibleElements:V,elementsSelectable:M,selectNodesOnDrag:O,defaultViewport:j,translateExtent:P,minZoom:$,maxZoom:D,preventScrolling:C,defaultMarkerColor:k,zoomOnScroll:F,zoomOnPinch:B,panOnScroll:z,panOnScrollSpeed:W,panOnScrollMode:X,zoomOnDoubleClick:Q,panOnDrag:J,onPaneClick:re,onPaneMouseEnter:pe,onPaneMouseMove:le,onPaneMouseLeave:we,onPaneScroll:et,onPaneContextMenu:yt,onEdgeUpdate:_e,onEdgeContextMenu:me,onEdgeMouseEnter:tt,onEdgeMouseMove:q,onEdgeMouseLeave:lr,edgeUpdaterRadius:Pr,onEdgeUpdateStart:As,onEdgeUpdateEnd:Is,noDragClassName:qo,noWheelClassName:Mr,noPanClassName:cr,elevateEdgesOnSelect:Jo,disableKeyboardA11y:ur,nodeOrigin:jr,nodeExtent:bs,rfId:Zo})=>{const Ge=Mv(e,DT),_t=Mv(t,VT);return nA(i),u.jsx(CT,{onPaneClick:re,onPaneMouseEnter:pe,onPaneMouseMove:le,onPaneMouseLeave:we,onPaneContextMenu:yt,onPaneScroll:et,deleteKeyCode:b,selectionKeyCode:x,selectionOnDrag:R,selectionMode:I,onSelectionStart:v,onSelectionEnd:y,multiSelectionKeyCode:L,panActivationKeyCode:U,zoomActivationKeyCode:A,elementsSelectable:M,onMove:n,onMoveStart:r,onMoveEnd:o,zoomOnScroll:F,zoomOnPinch:B,zoomOnDoubleClick:Q,panOnScroll:z,panOnScrollSpeed:W,panOnScrollMode:X,panOnDrag:J,defaultViewport:j,translateExtent:P,minZoom:$,maxZoom:D,onSelectionContextMenu:E,preventScrolling:C,noDragClassName:qo,noWheelClassName:Mr,noPanClassName:cr,disableKeyboardA11y:ur,children:u.jsxs(tA,{children:[u.jsx(ZT,{edgeTypes:_t,onEdgeClick:a,onEdgeDoubleClick:c,onEdgeUpdate:_e,onlyRenderVisibleElements:V,onEdgeContextMenu:me,onEdgeMouseEnter:tt,onEdgeMouseMove:q,onEdgeMouseLeave:lr,onEdgeUpdateStart:As,onEdgeUpdateEnd:Is,edgeUpdaterRadius:Pr,defaultMarkerColor:k,noPanClassName:cr,elevateEdgesOnSelect:!!Jo,disableKeyboardA11y:ur,rfId:Zo,children:u.jsx(iA,{style:m,type:g,component:_,containerStyle:S})}),u.jsx("div",{className:"react-flow__edgelabel-renderer"}),u.jsx(MT,{nodeTypes:Ge,onNodeClick:s,onNodeDoubleClick:l,onNodeMouseEnter:d,onNodeMouseMove:f,onNodeMouseLeave:p,onNodeContextMenu:h,selectNodesOnDrag:O,onlyRenderVisibleElements:V,noPanClassName:cr,noDragClassName:qo,disableKeyboardA11y:ur,nodeOrigin:jr,nodeExtent:bs,rfId:Zo})]})})};jv.displayName="GraphView";var sA=w.memo(jv);const ef=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],er={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:ef,nodeExtent:ef,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionNodeId:null,connectionHandleId:null,connectionHandleType:"source",connectionPosition:{x:0,y:0},connectionStatus:null,connectionMode:qn.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:kO,isValidConnection:void 0},aA=()=>Y1((e,t)=>({...er,setNodes:n=>{const{nodeInternals:r,nodeOrigin:o,elevateNodesOnSelect:i}=t();e({nodeInternals:Yd(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?Yd(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:c}=t(),d=l==null?void 0:l.querySelector(".react-flow__viewport");if(!d)return;const f=window.getComputedStyle(d),{m22:p}=new window.DOMMatrixReadOnly(f.transform),h=n.reduce((v,y)=>{const g=o.get(y.id);if(g){const m=Ld(y.nodeElement);!!(m.width&&m.height&&(g.width!==m.width||g.height!==m.height||y.forceUpdate))&&(o.set(g.id,{...g,[Ae]:{...g[Ae],handleBounds:{source:xv(".source",y.nodeElement,p,c),target:xv(".target",y.nodeElement,p,c)}},...m}),v.push({id:g.id,type:"dimensions",dimensions:m}))}return v},[]);dv(o,c);const E=s||i&&!s&&fv(t,{initial:!0,...a});e({nodeInternals:new Map(o),fitViewOnInitDone:E}),(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 c=Ev(n,a()),d=Yd(c,o,s,l);e({nodeInternals:d})}r==null||r(n)}},addSelectedNodes:n=>{const{multiSelectionActive:r,edges:o,getNodes:i}=t();let s,a=null;r?s=n.map(l=>Zn(l,!0)):(s=Mo(i(),n),a=Mo(o,[])),_l({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=>Zn(l,!0)):(s=Mo(o,n),a=Mo(i(),[])),_l({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(d=>(d.selected=!1,Zn(d.id,!1))),c=a.map(d=>Zn(d.id,!1));_l({changedNodes:l,changedEdges:c,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=>Zn(a.id,!1)),s=n.filter(a=>a.selected).map(a=>Zn(a.id,!1));_l({changedNodes:i,changedEdges:s,get:t,set:e})},setNodeExtent:n=>{const{nodeInternals:r}=t();r.forEach(o=>{o.positionAbsolute=Dd(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!1;const c=Qn.translate(r[0]+n.x,r[1]+n.y).scale(r[2]),d=[[0,0],[o,i]],f=s==null?void 0:s.constrain()(c,d,l);return s.transform(a,f),r[0]!==f.x||r[1]!==f.y||r[2]!==f.k},cancelConnection:()=>e({connectionNodeId:er.connectionNodeId,connectionHandleId:er.connectionHandleId,connectionHandleType:er.connectionHandleType,connectionStatus:er.connectionStatus,connectionStartHandle:er.connectionStartHandle,connectionEndHandle:er.connectionEndHandle}),reset:()=>e({...er})}),Object.is),tf=({children:e})=>{const t=w.useRef(null);return t.current||(t.current=aA()),u.jsx(OO,{value:t.current,children:e})};tf.displayName="ReactFlowProvider";const Uv=({children:e})=>w.useContext(hl)?u.jsx(u.Fragment,{children:e}):u.jsx(tf,{children:e});Uv.displayName="ReactFlowWrapper";const lA={input:tv,default:Wd,output:rv,group:Gd},cA={default:vl,straight:Fd,step:Ud,smoothstep:ml,simplebezier:jd},uA=[0,0],dA=[15,15],fA={x:0,y:0,zoom:1},pA={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0},Fv=w.forwardRef(({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:o,nodeTypes:i=lA,edgeTypes:s=cA,onNodeClick:a,onEdgeClick:l,onInit:c,onMove:d,onMoveStart:f,onMoveEnd:p,onConnect:h,onConnectStart:E,onConnectEnd:v,onClickConnectStart:y,onClickConnectEnd:g,onNodeMouseEnter:m,onNodeMouseMove:_,onNodeMouseLeave:S,onNodeContextMenu:x,onNodeDoubleClick:R,onNodeDragStart:I,onNodeDrag:L,onNodeDragStop:U,onNodesDelete:A,onEdgesDelete:b,onSelectionChange:V,onSelectionDragStart:M,onSelectionDrag:O,onSelectionDragStop:j,onSelectionContextMenu:P,onSelectionStart:$,onSelectionEnd:D,connectionMode:C=qn.Strict,connectionLineType:k=Jn.Bezier,connectionLineStyle:F,connectionLineComponent:B,connectionLineContainerStyle:z,deleteKeyCode:W="Backspace",selectionKeyCode:X="Shift",selectionOnDrag:Q=!1,selectionMode:J=os.Full,panActivationKeyCode:re="Space",multiSelectionKeyCode:pe=gl()?"Meta":"Control",zoomActivationKeyCode:le=gl()?"Meta":"Control",snapToGrid:we=!1,snapGrid:et=dA,onlyRenderVisibleElements:yt=!1,selectNodesOnDrag:_e=!0,nodesDraggable:me,nodesConnectable:tt,nodesFocusable:q,nodeOrigin:lr=uA,edgesFocusable:Pr,edgesUpdatable:As,elementsSelectable:Is,defaultViewport:qo=fA,minZoom:Mr=.5,maxZoom:cr=2,translateExtent:Jo=ef,preventScrolling:ur=!0,nodeExtent:jr,defaultMarkerColor:bs="#b1b1b7",zoomOnScroll:Zo=!0,zoomOnPinch:Ge=!0,panOnScroll:_t=!1,panOnScrollSpeed:Ur=.5,panOnScrollMode:Fr=Ir.Free,zoomOnDoubleClick:Vr=!0,panOnDrag:Gl=!0,onPaneClick:$r,onPaneMouseEnter:Gf,onPaneMouseMove:Yf,onPaneMouseLeave:Cs,onPaneScroll:Kf,onPaneContextMenu:m_,children:Br,onEdgeUpdate:r3,onEdgeContextMenu:o3,onEdgeDoubleClick:i3,onEdgeMouseEnter:s3,onEdgeMouseMove:a3,onEdgeMouseLeave:l3,onEdgeUpdateStart:c3,onEdgeUpdateEnd:u3,edgeUpdaterRadius:d3=10,onNodesChange:f3,onEdgesChange:p3,noDragClassName:h3="nodrag",noWheelClassName:g3="nowheel",noPanClassName:E_="nopan",fitView:m3=!1,fitViewOptions:E3,connectOnClick:v3=!0,attributionPosition:y3,proOptions:_3,defaultEdgeOptions:S3,elevateNodesOnSelect:x3=!0,elevateEdgesOnSelect:R3=!1,disableKeyboardA11y:v_=!1,autoPanOnConnect:N3=!0,autoPanOnNodeDrag:w3=!0,connectionRadius:O3=20,isValidConnection:T3,onError:A3,style:I3,id:y_,...b3},C3)=>{const Qf=y_||"1";return u.jsx("div",{...b3,style:{...I3,...pA},ref:C3,className:qe(["react-flow",o]),"data-testid":"rf__wrapper",id:y_,children:u.jsxs(Uv,{children:[u.jsx(sA,{onInit:c,onMove:d,onMoveStart:f,onMoveEnd:p,onNodeClick:a,onEdgeClick:l,onNodeMouseEnter:m,onNodeMouseMove:_,onNodeMouseLeave:S,onNodeContextMenu:x,onNodeDoubleClick:R,nodeTypes:i,edgeTypes:s,connectionLineType:k,connectionLineStyle:F,connectionLineComponent:B,connectionLineContainerStyle:z,selectionKeyCode:X,selectionOnDrag:Q,selectionMode:J,deleteKeyCode:W,multiSelectionKeyCode:pe,panActivationKeyCode:re,zoomActivationKeyCode:le,onlyRenderVisibleElements:yt,selectNodesOnDrag:_e,defaultViewport:qo,translateExtent:Jo,minZoom:Mr,maxZoom:cr,preventScrolling:ur,zoomOnScroll:Zo,zoomOnPinch:Ge,zoomOnDoubleClick:Vr,panOnScroll:_t,panOnScrollSpeed:Ur,panOnScrollMode:Fr,panOnDrag:Gl,onPaneClick:$r,onPaneMouseEnter:Gf,onPaneMouseMove:Yf,onPaneMouseLeave:Cs,onPaneScroll:Kf,onPaneContextMenu:m_,onSelectionContextMenu:P,onSelectionStart:$,onSelectionEnd:D,onEdgeUpdate:r3,onEdgeContextMenu:o3,onEdgeDoubleClick:i3,onEdgeMouseEnter:s3,onEdgeMouseMove:a3,onEdgeMouseLeave:l3,onEdgeUpdateStart:c3,onEdgeUpdateEnd:u3,edgeUpdaterRadius:d3,defaultMarkerColor:bs,noDragClassName:h3,noWheelClassName:g3,noPanClassName:E_,elevateEdgesOnSelect:R3,rfId:Qf,disableKeyboardA11y:v_,nodeOrigin:lr,nodeExtent:jr}),u.jsx(rT,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:h,onConnectStart:E,onConnectEnd:v,onClickConnectStart:y,onClickConnectEnd:g,nodesDraggable:me,nodesConnectable:tt,nodesFocusable:q,edgesFocusable:Pr,edgesUpdatable:As,elementsSelectable:Is,elevateNodesOnSelect:x3,minZoom:Mr,maxZoom:cr,nodeExtent:jr,onNodesChange:f3,onEdgesChange:p3,snapToGrid:we,snapGrid:et,connectionMode:C,translateExtent:Jo,connectOnClick:v3,defaultEdgeOptions:S3,fitView:m3,fitViewOptions:E3,onNodesDelete:A,onEdgesDelete:b,onNodeDragStart:I,onNodeDrag:L,onNodeDragStop:U,onSelectionDrag:O,onSelectionDragStart:M,onSelectionDragStop:j,noPanClassName:E_,nodeOrigin:lr,rfId:Qf,autoPanOnConnect:N3,autoPanOnNodeDrag:w3,onError:A3,connectionRadius:O3,isValidConnection:T3}),u.jsx(tT,{onSelectionChange:V}),Br,u.jsx(AO,{proOptions:_3,position:y3}),u.jsx(lT,{rfId:Qf,disableKeyboardA11y:v_})]})})});Fv.displayName="ReactFlow";const hA=e=>{var t;return(t=e.domNode)==null?void 0:t.querySelector(".react-flow__edgelabel-renderer")};function gA({children:e}){const t=ae(hA);return t?xo.createPortal(e,t):null}function mA(){const e=Te();return w.useCallback(t=>{const{domNode:n,updateNodeDimensions:r}=e.getState(),i=(Array.isArray(t)?t:[t]).reduce((s,a)=>{const l=n==null?void 0:n.querySelector(`.react-flow__node[data-id="${a}"]`);return l&&s.push({id:a,nodeElement:l,forceUpdate:!0}),s},[]);requestAnimationFrame(()=>r(i))},[])}function EA({onStart:e,onChange:t,onEnd:n}){const r=Te();w.useEffect(()=>{r.setState({onViewportChangeStart:e})},[e]),w.useEffect(()=>{r.setState({onViewportChange:t})},[t]),w.useEffect(()=>{r.setState({onViewportChangeEnd:n})},[n])}const vA=e=>t=>t.nodeInternals.size===0?!1:t.getNodes().filter(n=>e.includeHiddenNodes?!0:!n.hidden).every(n=>{var r;return((r=n[Ae])==null?void 0:r.handleBounds)!==void 0}),yA={includeHiddenNodes:!1};function _A(e=yA){return ae(vA(e))}function SA(){return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:u.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function xA(){return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:u.jsx("path",{d:"M0 0h32v4.2H0z"})})}function RA(){return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:u.jsx("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 NA(){return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:u.jsx("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 wA(){return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:u.jsx("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 cs=({children:e,className:t,...n})=>u.jsx("button",{type:"button",className:qe(["react-flow__controls-button",t]),...n,children:e});cs.displayName="ControlButton";const OA=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom}),Vv=({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:o,onZoomIn:i,onZoomOut:s,onFitView:a,onInteractiveChange:l,className:c,children:d,position:f="bottom-left"})=>{const p=Te(),[h,E]=w.useState(!1),{isInteractive:v,minZoomReached:y,maxZoomReached:g}=ae(OA,ze),{zoomIn:m,zoomOut:_,fitView:S}=Kd();if(w.useEffect(()=>{E(!0)},[]),!h)return null;const x=()=>{m(),i==null||i()},R=()=>{_(),s==null||s()},I=()=>{S(o),a==null||a()},L=()=>{p.setState({nodesDraggable:!v,nodesConnectable:!v,elementsSelectable:!v}),l==null||l(!v)};return u.jsxs(ns,{className:qe(["react-flow__controls",c]),position:f,style:e,"data-testid":"rf__controls",children:[t&&u.jsxs(u.Fragment,{children:[u.jsx(cs,{onClick:x,className:"react-flow__controls-zoomin",title:"zoom in","aria-label":"zoom in",disabled:g,children:u.jsx(SA,{})}),u.jsx(cs,{onClick:R,className:"react-flow__controls-zoomout",title:"zoom out","aria-label":"zoom out",disabled:y,children:u.jsx(xA,{})})]}),n&&u.jsx(cs,{className:"react-flow__controls-fitview",onClick:I,title:"fit view","aria-label":"fit view",children:u.jsx(RA,{})}),r&&u.jsx(cs,{className:"react-flow__controls-interactive",onClick:L,title:"toggle interactivity","aria-label":"toggle interactivity",children:v?u.jsx(wA,{}):u.jsx(NA,{})}),d]})};Vv.displayName="Controls";var TA=w.memo(Vv),At;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(At||(At={}));function AA({color:e,dimensions:t,lineWidth:n}){return u.jsx("path",{stroke:e,strokeWidth:n,d:`M${t[0]/2} 0 V${t[1]} M0 ${t[1]/2} H${t[0]}`})}function IA({color:e,radius:t}){return u.jsx("circle",{cx:t,cy:t,r:t,fill:e})}const bA={[At.Dots]:"#91919a",[At.Lines]:"#eee",[At.Cross]:"#e2e2e2"},CA={[At.Dots]:1,[At.Lines]:1,[At.Cross]:6},LA=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function $v({id:e,variant:t=At.Dots,gap:n=20,size:r,lineWidth:o=1,offset:i=2,color:s,style:a,className:l}){const c=w.useRef(null),{transform:d,patternId:f}=ae(LA,ze),p=s||bA[t],h=r||CA[t],E=t===At.Dots,v=t===At.Cross,y=Array.isArray(n)?n:[n,n],g=[y[0]*d[2]||1,y[1]*d[2]||1],m=h*d[2],_=v?[m,m]:g,S=E?[m/i,m/i]:[_[0]/i,_[1]/i];return u.jsxs("svg",{className:qe(["react-flow__background",l]),style:{...a,position:"absolute",width:"100%",height:"100%",top:0,left:0},ref:c,"data-testid":"rf__background",children:[u.jsx("pattern",{id:f+e,x:d[0]%g[0],y:d[1]%g[1],width:g[0],height:g[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${S[0]},-${S[1]})`,children:E?u.jsx(IA,{color:p,radius:m/i}):u.jsx(AA,{dimensions:_,color:p,lineWidth:o})}),u.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${f+e})`})]})}$v.displayName="Background";var DA=w.memo($v);const{useSyncExternalStoreWithSelector:kA}=bm;let L3=!1;function PA(e,t=e.getState,n){const r=kA(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return w.useDebugValue(r),r}const Bv=e=>{const t=typeof e=="function"?Lm(e):e,n=(r,o)=>PA(t,r,o);return Object.assign(n,t),n},us=e=>e?Bv(e):Bv,MA=!1,jA={}.VITE_IS_STAGING,UA=(()=>jA?"staging":"prod")(),FA="0.0.11",ds="0.0.9",Hv=230,VA=640,zv=20,Fo={markerEnd:{height:20,type:is.ArrowClosed,width:20},style:{stroke:"inherit",strokeWidth:1.5},type:"floating"},$A="422",BA="404",Wv="document-sync",nf=1e3,HA=1e3,zA=300,WA=5e3,GA="Shift+Backspace",YA="Meta",KA="Shift",xl=25,rf={duration:nf,includeHiddenNodes:!1,padding:.3},Gv=()=>{const e={},t=document.querySelector('meta[name="csrf-token"]');return t&&(e["X-CSRF-Token"]=t==null?void 0:t.content),e},QA=(e,t)=>{var i;const n=new Blob([JSON.stringify({edges:t,nodes:e},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)},Yv=e=>({...e,...Fo}),Kv=e=>e.type==="handleCall"?{...e,deletable:!1}:e,Qv=e=>e==="success"?"positive":"negative",XA=e=>e.toLowerCase().replace(/ /g,"-"),It=e=>typeof e=="string"?e.trim():e,qA=(e,t,n)=>e.sort((r,o)=>{const i=n?r[n]:r,s=n?o[n]:o;if(typeof i=="string"&&typeof s=="string")return t==="asc"?i.toLowerCase().localeCompare(s.toLowerCase()):s.toLowerCase().localeCompare(i.toLowerCase());if(typeof i=="number"&&typeof s=="number")return t==="asc"?i-s:s-i;throw new Error(`sort fn can only sort strings & numbers, but got ${typeof i} and ${typeof s}`)}),JA=e=>{try{return new URL(e).pathname.split("/").at(-1)}catch{return""}};function Xv(e,t){const n=[{divisor:1,threshold:60,unit:"second"},{divisor:60,threshold:3600,unit:"minute"},{divisor:3600,threshold:86400,unit:"hour"},{divisor:86400,threshold:86400,unit:"day"}],r=new Intl.RelativeTimeFormat(e,{numeric:"always",...t});return function(i,s={}){const{excludeUnits:a={}}=s,l=new Date().getTime(),c=new Date(i).getTime(),d=Math.floor((l-c)/1e3),f=n.filter(({unit:v})=>!a[v]),{divisor:p,unit:h}=f.find(({threshold:v})=>Math.abs(d)<v)??f[f.length-1],E=Math.floor(d/p);return r.format(-E,h)}}function qv(e){return new Promise(t=>setTimeout(t,e))}const of=()=>({callOrder:"single",callStateEvents:"",callStateUrl:"",connections:[{connectFrom:"",connectTimeout:"",connectTo:"",id:ie()}],defaultFrom:"",defaultTimeout:"",destinationType:"phone",options:[{id:ie(),result:"success"},{id:ie(),result:"noAnswer"},{id:ie(),result:"busy"},{id:ie(),result:"decline"},{id:ie(),result:"error"}]}),Jv={aiAgent:()=>({agent:""}),answer:()=>({valid:!0}),cond:()=>({fallback:ie(),options:[{id:ie(),value:""}]}),condRequest:()=>({body:"",error:ie(),fallback:ie(),headers:"",method:"POST",options:[{id:ie(),value:""}],url:""}),executeSWML:()=>({dest:"",fallback:ie(),meta:"",options:[{id:ie(),value:""}],params:""}),forwardAddress:()=>({...of(),destinationType:"address"}),forwardPhone:()=>({...of(),destinationType:"phone"}),forwardResource:()=>({...of(),destinationType:"resource"}),handleCall:()=>({valid:!0}),hangup:()=>({valid:!0}),play:()=>({selected:"",text:"",url:""}),promptPlay:()=>({digitTimeout:"",initialTimeout:"",options:[{command:"",digit:"",id:ie()}],results:[{id:ie(),result:"no_match"},{id:ie(),result:"no_input"}],selected:"",text:"",url:""}),record:()=>({beep:!1,endSilenceTimeout:"",format:"wav",initialTimeout:"",maxLength:"",stereo:!1,terminators:"",valid:!0}),recordCallStart:()=>({beep:!1,controlId:ie(),format:"wav",label:"",stereo:!1,terminators:""}),recordCallStop:()=>({controlId:""}),request:()=>({body:"",headers:"",method:"POST",options:[{id:ie(),result:"success"},{id:ie(),result:"failed"}],url:""}),sendSms:()=>({body:"",fromNumber:"",media:[],region:"",tags:[],toNumber:""}),set:()=>({variables:[{duplicate:!1,id:ie(),key:"",value:""}]}),unset:()=>({variables:[]})};function We(e){"@babel/helpers - typeof";return We=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},We(e)}function bt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ZA(e,t){if(We(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(We(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Zv(e){var t=ZA(e,"string");return We(t)==="symbol"?t:String(t)}function ey(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,Zv(r.key),r)}}function Ct(e,t,n){return t&&ey(e.prototype,t),n&&ey(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function tr(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function sf(e,t){return sf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},sf(e,t)}function Rl(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&&sf(e,t)}function fs(e,t){if(t&&(We(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return tr(e)}function rn(e){return rn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},rn(e)}function Ht(e,t,n){return t=Zv(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function eI(e){if(Array.isArray(e))return e}function tI(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function ty(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 nI(e,t){if(e){if(typeof e=="string")return ty(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 ty(e,t)}}function rI(){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 oI(e){return eI(e)||tI(e)||nI(e)||rI()}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 ry(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){Ht(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}var iI={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)}},sI=function(){function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};bt(this,e),this.init(t,n)}return Ct(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||iI,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,ry(ry({},{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}(),on=new sI,nr=function(){function e(){bt(this,e),this.observers={}}return Ct(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 ps(){var e,t,n=new Promise(function(r,o){e=r,t=o});return n.resolve=e,n.reject=t,n}function oy(e){return e==null?"":""+e}function aI(e,t,n){e.forEach(function(r){t[r]&&(n[r]=t[r])})}function af(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 iy(e,t,n){var r=af(e,t,Object),o=r.obj,i=r.k;o[i]=n}function lI(e,t,n,r){var o=af(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=af(e,t),r=n.obj,o=n.k;if(r)return r[o]}function sy(e,t,n){var r=Nl(e,n);return r!==void 0?r:Nl(t,n)}function ay(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]):ay(e[r],t[r],n):e[r]=t[r]);return e}function Vo(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var cI={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};function uI(e){return typeof e=="string"?e.replace(/[&<>"'\/]/g,function(t){return cI[t]}):e}var wl=typeof window<"u"&&window.navigator&&typeof window.navigator.userAgentData>"u"&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,dI=[" ",",","?","!",";"];function fI(e,t,n){t=t||"",n=n||"";var r=dI.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 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 Ol(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){Ht(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}function pI(e){var t=hI();return function(){var r=rn(e),o;if(t){var i=rn(this).constructor;o=Reflect.construct(r,arguments,i)}else o=r.apply(this,arguments);return fs(this,o)}}function hI(){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 cy(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 c=r.slice(i+s).join(n);return c?cy(l,c,n):void 0}o=o[r[i]]}return o}}var gI=function(e){Rl(n,e);var t=pI(n);function n(r){var o,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};return bt(this,n),o=t.call(this),wl&&nr.call(tr(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 Ct(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,c=a.ignoreJSONStructure!==void 0?a.ignoreJSONStructure:this.options.ignoreJSONStructure,d=[o,i];s&&typeof s!="string"&&(d=d.concat(s)),s&&typeof s=="string"&&(d=d.concat(l?s.split(l):s)),o.indexOf(".")>-1&&(d=o.split("."));var f=Nl(this.data,d);return f||!c||typeof s!="string"?f:cy(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},c=this.options.keySeparator;c===void 0&&(c=".");var d=[o,i];s&&(d=d.concat(c?s.split(c):s)),o.indexOf(".")>-1&&(d=o.split("."),a=i,i=d[1]),this.addNamespaces(i),iy(this.data,d,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 c=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1},d=[o,i];o.indexOf(".")>-1&&(d=o.split("."),a=s,s=i,i=d[1]),this.addNamespaces(i);var f=Nl(this.data,d)||{};a?ay(f,s,l):f=Ol(Ol({},f),s),iy(this.data,d,f),c.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}(nr),uy={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 dy(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?dy(Object(n),!0).forEach(function(r){Ht(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dy(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function mI(e){var t=EI();return function(){var r=rn(e),o;if(t){var i=rn(this).constructor;o=Reflect.construct(r,arguments,i)}else o=r.apply(this,arguments);return fs(this,o)}}function EI(){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 fy={},py=function(e){Rl(n,e);var t=mI(n);function n(r){var o,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return bt(this,n),o=t.call(this),wl&&nr.call(tr(o)),aI(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],r,tr(o)),o.options=i,o.options.keySeparator===void 0&&(o.options.keySeparator="."),o.logger=on.create("translator"),o}return Ct(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||[],c=s&&o.indexOf(s)>-1,d=!this.options.userDefinedKeySeparator&&!i.keySeparator&&!this.options.userDefinedNsSeparator&&!i.nsSeparator&&!fI(o,s,a);if(c&&!d){var f=o.match(this.interpolator.nestingRegexp);if(f&&f.length>0)return{key:o,namespaces:l};var p=o.split(s);(s!==a||s===a&&this.options.ns.indexOf(p[0])>-1)&&(l=p.shift()),o=p.join(a)}return typeof l=="string"&&(l=[l]),{key:o,namespaces:l}}},{key:"translate",value:function(o,i,s){var a=this;if(We(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,c=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,d=this.extractFromKey(o[o.length-1],i),f=d.key,p=d.namespaces,h=p[p.length-1],E=i.lng||this.language,v=i.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(E&&E.toLowerCase()==="cimode"){if(v){var y=i.nsSeparator||this.options.nsSeparator;return l?{res:"".concat(h).concat(y).concat(f),usedKey:f,exactUsedKey:f,usedLng:E,usedNS:h}:"".concat(h).concat(y).concat(f)}return l?{res:f,usedKey:f,exactUsedKey:f,usedLng:E,usedNS:h}:f}var g=this.resolve(o,i),m=g&&g.res,_=g&&g.usedKey||f,S=g&&g.exactUsedKey||f,x=Object.prototype.toString.apply(m),R=["[object Number]","[object Function]","[object RegExp]"],I=i.joinArrays!==void 0?i.joinArrays:this.options.joinArrays,L=!this.i18nFormat||this.i18nFormat.handleAsObject,U=typeof m!="string"&&typeof m!="boolean"&&typeof m!="number";if(L&&m&&U&&R.indexOf(x)<0&&!(typeof I=="string"&&x==="[object Array]")){if(!i.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");var A=this.options.returnedObjectHandler?this.options.returnedObjectHandler(_,m,Je(Je({},i),{},{ns:p})):"key '".concat(f," (").concat(this.language,")' returned an object instead of string.");return l?(g.res=A,g):A}if(c){var b=x==="[object Array]",V=b?[]:{},M=b?S:_;for(var O in m)if(Object.prototype.hasOwnProperty.call(m,O)){var j="".concat(M).concat(c).concat(O);V[O]=this.translate(j,Je(Je({},i),{joinArrays:!1,ns:p})),V[O]===j&&(V[O]=m[O])}m=V}}else if(L&&typeof I=="string"&&x==="[object Array]")m=m.join(I),m&&(m=this.extendTranslation(m,o,i,s));else{var P=!1,$=!1,D=i.count!==void 0&&typeof i.count!="string",C=n.hasDefaultValue(i),k=D?this.pluralResolver.getSuffix(E,i.count,i):"",F=i["defaultValue".concat(k)]||i.defaultValue;!this.isValidLookup(m)&&C&&(P=!0,m=F),this.isValidLookup(m)||($=!0,m=f);var B=i.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey,z=B&&$?void 0:m,W=C&&F!==m&&this.options.updateMissing;if($||P||W){if(this.logger.log(W?"updateKey":"missingKey",E,h,f,W?F:m),c){var X=this.resolve(f,Je(Je({},i),{},{keySeparator:!1}));X&&X.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 Q=[],J=this.languageUtils.getFallbackCodes(this.options.fallbackLng,i.lng||this.language);if(this.options.saveMissingTo==="fallback"&&J&&J[0])for(var re=0;re<J.length;re++)Q.push(J[re]);else this.options.saveMissingTo==="all"?Q=this.languageUtils.toResolveHierarchy(i.lng||this.language):Q.push(i.lng||this.language);var pe=function(we,et,yt){var _e=C&&yt!==m?yt:z;a.options.missingKeyHandler?a.options.missingKeyHandler(we,h,et,_e,W,i):a.backendConnector&&a.backendConnector.saveMissing&&a.backendConnector.saveMissing(we,h,et,_e,W,i),a.emit("missingKey",we,h,et,m)};this.options.saveMissing&&(this.options.saveMissingPlurals&&D?Q.forEach(function(le){a.pluralResolver.getSuffixes(le,i).forEach(function(we){pe([le],f+we,i["defaultValue".concat(we)]||F)})}):pe(Q,f,F))}m=this.extendTranslation(m,o,i,g,s),$&&m===f&&this.options.appendNamespaceToMissingKey&&(m="".concat(h,":").concat(f)),($||P)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?m=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?"".concat(h,":").concat(f):f,P?m:void 0):m=this.options.parseMissingKeyHandler(m))}return l?(g.res=m,g):m}},{key:"extendTranslation",value:function(o,i,s,a,l){var c=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 d=typeof o=="string"&&(s&&s.interpolation&&s.interpolation.skipOnVariables!==void 0?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables),f;if(d){var p=o.match(this.interpolator.nestingRegexp);f=p&&p.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),d){var E=o.match(this.interpolator.nestingRegexp),v=E&&E.length;f<v&&(s.nest=!1)}s.nest!==!1&&(o=this.interpolator.nest(o,function(){for(var m=arguments.length,_=new Array(m),S=0;S<m;S++)_[S]=arguments[S];return l&&l[0]===_[0]&&!s.context?(c.logger.warn("It seems you are nesting recursively key: ".concat(_[0]," in key: ").concat(i[0])),null):c.translate.apply(c,_.concat([i]))},s)),s.interpolation&&this.interpolator.reset()}var y=s.postProcess||this.options.postProcess,g=typeof y=="string"?[y]:y;return o!=null&&g&&g.length&&s.applyPostProcessor!==!1&&(o=uy.handle(g,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,c,d,f;return typeof o=="string"&&(o=[o]),o.forEach(function(p){if(!i.isValidLookup(a)){var h=i.extractFromKey(p,s),E=h.key;l=E;var v=h.namespaces;i.options.fallbackNS&&(v=v.concat(i.options.fallbackNS));var y=s.count!==void 0&&typeof s.count!="string",g=y&&!s.ordinal&&s.count===0&&i.pluralResolver.shouldUseIntlApi(),m=s.context!==void 0&&(typeof s.context=="string"||typeof s.context=="number")&&s.context!=="",_=s.lngs?s.lngs:i.languageUtils.toResolveHierarchy(s.lng||i.language,s.fallbackLng);v.forEach(function(S){i.isValidLookup(a)||(f=S,!fy["".concat(_[0],"-").concat(S)]&&i.utils&&i.utils.hasLoadedNamespace&&!i.utils.hasLoadedNamespace(f)&&(fy["".concat(_[0],"-").concat(S)]=!0,i.logger.warn('key "'.concat(l,'" for languages "').concat(_.join(", "),`" won't get resolved as namespace "`).concat(f,'" 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!!!")),_.forEach(function(x){if(!i.isValidLookup(a)){d=x;var R=[E];if(i.i18nFormat&&i.i18nFormat.addLookupKeys)i.i18nFormat.addLookupKeys(R,E,x,S,s);else{var I;y&&(I=i.pluralResolver.getSuffix(x,s.count,s));var L="".concat(i.options.pluralSeparator,"zero");if(y&&(R.push(E+I),g&&R.push(E+L)),m){var U="".concat(E).concat(i.options.contextSeparator).concat(s.context);R.push(U),y&&(R.push(U+I),g&&R.push(U+L))}}for(var A;A=R.pop();)i.isValidLookup(a)||(c=A,a=i.getResource(x,S,A,s))}}))})}}),{res:a,usedKey:l,exactUsedKey:c,usedLng:d,usedNS:f}}},{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}(nr);function lf(e){return e.charAt(0).toUpperCase()+e.slice(1)}var hy=function(){function e(t){bt(this,e),this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=on.create("languageUtils")}return Ct(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]=lf(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]=lf(o[1].toLowerCase())),r.indexOf(o[2].toLowerCase())>-1&&(o[2]=lf(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(c){c&&(o.isSupportedCode(c)?s.push(c):o.logger.warn("rejecting language code not found in supportedLngs: ".concat(c)))};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}(),vI=[{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}],yI={1:function(t){return+(t>1)},2:function(t){return+(t!=1)},3:function(t){return 0},4:function(t){return 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 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 t==1?0:t>=2&&t<=4?1:2},7:function(t){return t==1?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2},8:function(t){return t==1?0:t==2?1:t!=8&&t!=11?2:3},9:function(t){return+(t>=2)},10:function(t){return t==1?0:t==2?1:t<7?2:t<11?3:4},11:function(t){return t==1||t==11?0:t==2||t==12?1:t>2&&t<20?2:3},12:function(t){return+(t%10!=1||t%100==11)},13:function(t){return+(t!==0)},14:function(t){return t==1?0:t==2?1:t==3?2:3},15:function(t){return t%10==1&&t%100!=11?0:t%10>=2&&(t%100<10||t%100>=20)?1:2},16:function(t){return t%10==1&&t%100!=11?0:t!==0?1:2},17:function(t){return t==1||t%10==1&&t%100!=11?0:1},18:function(t){return t==0?0:t==1?1:2},19:function(t){return t==1?0:t==0||t%100>1&&t%100<11?1:t%100>10&&t%100<20?2:3},20:function(t){return t==1?0:t==0||t%100>0&&t%100<20?1:2},21:function(t){return t%100==1?1:t%100==2?2:t%100==3||t%100==4?3:0},22:function(t){return t==1?0:t==2?1:(t<0||t>10)&&t%10==0?2:3}},_I=["v1","v2","v3"],gy={zero:0,one:1,two:2,few:3,many:4,other:5};function SI(){var e={};return vI.forEach(function(t){t.lngs.forEach(function(n){e[n]={numbers:t.nr,plurals:yI[t.fc]}})}),e}var xI=function(){function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};bt(this,e),this.languageUtils=t,this.options=n,this.logger=on.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=SI()}return Ct(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 gy[s]-gy[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!_I.includes(this.options.compatibilityJSON)}}]),e}();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 zt(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){Ht(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 RI=function(){function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};bt(this,e),this.logger=on.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||function(n){return n},this.init(t)}return Ct(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:uI,this.escapeValue=r.escapeValue!==void 0?r.escapeValue:!0,this.useRawValueToEscape=r.useRawValueToEscape!==void 0?r.useRawValueToEscape:!1,this.prefix=r.prefix?Vo(r.prefix):r.prefixEscaped||"{{",this.suffix=r.suffix?Vo(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?Vo(r.nestingPrefix):r.nestingPrefixEscaped||Vo("$t("),this.nestingSuffix=r.nestingSuffix?Vo(r.nestingSuffix):r.nestingSuffixEscaped||Vo(")"),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,c,d=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function f(y){return y.replace(/\$/g,"$$$$")}var p=function(g){if(g.indexOf(s.formatSeparator)<0){var m=sy(r,d,g);return s.alwaysFormat?s.format(m,void 0,o,zt(zt(zt({},i),r),{},{interpolationkey:g})):m}var _=g.split(s.formatSeparator),S=_.shift().trim(),x=_.join(s.formatSeparator).trim();return s.format(sy(r,d,S),x,o,zt(zt(zt({},i),r),{},{interpolationkey:S}))};this.resetRegExp();var h=i&&i.missingInterpolationHandler||this.options.missingInterpolationHandler,E=i&&i.interpolation&&i.interpolation.skipOnVariables!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables,v=[{regex:this.regexpUnescape,safeValue:function(g){return f(g)}},{regex:this.regexp,safeValue:function(g){return s.escapeValue?f(s.escape(g)):f(g)}}];return v.forEach(function(y){for(c=0;a=y.regex.exec(n);){var g=a[1].trim();if(l=p(g),l===void 0)if(typeof h=="function"){var m=h(n,a,i);l=typeof m=="string"?m:""}else if(i&&Object.prototype.hasOwnProperty.call(i,g))l="";else if(E){l=a[0];continue}else s.logger.warn("missed to pass in variable ".concat(g," for interpolating ").concat(n)),l="";else typeof l!="string"&&!s.useRawValueToEscape&&(l=oy(l));var _=y.safeValue(l);if(n=n.replace(a[0],_),E?(y.regex.lastIndex+=l.length,y.regex.lastIndex-=a[0].length):y.regex.lastIndex=0,c++,c>=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 c(h,E){var v=this.nestingOptionsSeparator;if(h.indexOf(v)<0)return h;var y=h.split(new RegExp("".concat(v,"[ ]*{"))),g="{".concat(y[1]);h=y[0],g=this.interpolate(g,l);var m=g.match(/'/g),_=g.match(/"/g);(m&&m.length%2===0&&!_||_.length%2!==0)&&(g=g.replace(/'/g,'"'));try{l=JSON.parse(g),E&&(l=zt(zt({},E),l))}catch(S){return this.logger.warn("failed parsing options string in nesting for key ".concat(h),S),"".concat(h).concat(v).concat(g)}return delete l.defaultValue,h}for(;s=this.nestingRegexp.exec(n);){var d=[];l=zt({},i),l=l.replace&&typeof l.replace!="string"?l.replace:l,l.applyPostProcessor=!1,delete l.defaultValue;var f=!1;if(s[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(s[1])){var p=s[1].split(this.formatSeparator).map(function(h){return h.trim()});s[1]=p.shift(),d=p,f=!0}if(a=r(c.call(this,s[1].trim(),l),l),a&&s[0]===n&&typeof a!="string")return a;typeof a!="string"&&(a=oy(a)),a||(this.logger.warn("missed to resolve ".concat(s[1]," for nesting ").concat(n)),a=""),f&&(a=d.reduce(function(h,E){return o.format(h,E,i.lng,zt(zt({},i),{},{interpolationkey:s[1].trim()}))},a.trim())),n=n.replace(s[0],a),this.regexp.lastIndex=0}return n}}]),e}();function Ey(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 wn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Ey(Object(n),!0).forEach(function(r){Ht(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ey(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function NI(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=oI(a),c=l[0],d=l.slice(1),f=d.join(":").trim().replace(/^'+|'+$/g,"");n[c.trim()]||(n[c.trim()]=f),f==="false"&&(n[c.trim()]=!1),f==="true"&&(n[c.trim()]=!0),isNaN(f)||(n[c.trim()]=parseInt(f,10))}})}}return{formatName:t,formatOptions:n}}function $o(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 wI=function(){function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};bt(this,e),this.logger=on.create("formatter"),this.options=t,this.formats={number:$o(function(n,r){var o=new Intl.NumberFormat(n,wn({},r));return function(i){return o.format(i)}}),currency:$o(function(n,r){var o=new Intl.NumberFormat(n,wn(wn({},r),{},{style:"currency"}));return function(i){return o.format(i)}}),datetime:$o(function(n,r){var o=new Intl.DateTimeFormat(n,wn({},r));return function(i){return o.format(i)}}),relativetime:$o(function(n,r){var o=new Intl.RelativeTimeFormat(n,wn({},r));return function(i){return o.format(i,r.range||"day")}}),list:$o(function(n,r){var o=new Intl.ListFormat(n,wn({},r));return function(i){return o.format(i)}})},this.init(t)}return Ct(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()]=$o(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(c,d){var f=NI(d),p=f.formatName,h=f.formatOptions;if(i.formats[p]){var E=c;try{var v=s&&s.formatParams&&s.formatParams[s.interpolationkey]||{},y=v.locale||v.lng||s.locale||s.lng||o;E=i.formats[p](c,y,wn(wn(wn({},h),s),v))}catch(g){i.logger.warn(g)}return E}else i.logger.warn("there was no format function for ".concat(p));return c},n);return l}}]),e}();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 yy(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){Ht(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 OI(e){var t=TI();return function(){var r=rn(e),o;if(t){var i=rn(this).constructor;o=Reflect.construct(r,arguments,i)}else o=r.apply(this,arguments);return fs(this,o)}}function TI(){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 AI(e,t){e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)}var II=function(e){Rl(n,e);var t=OI(n);function n(r,o,i){var s,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return bt(this,n),s=t.call(this),wl&&nr.call(tr(s)),s.backend=r,s.store=o,s.services=i,s.languageUtils=i.languageUtils,s.options=a,s.logger=on.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 Ct(n,[{key:"queueLoad",value:function(o,i,s,a){var l=this,c={},d={},f={},p={};return o.forEach(function(h){var E=!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?d[y]===void 0&&(d[y]=!0):(l.state[y]=1,E=!1,d[y]===void 0&&(d[y]=!0),c[y]===void 0&&(c[y]=!0),p[v]===void 0&&(p[v]=!0)))}),E||(f[h]=!0)}),(Object.keys(c).length||Object.keys(d).length)&&this.queue.push({pending:d,pendingCount:Object.keys(d).length,loaded:{},errors:[],callback:a}),{toLoad:Object.keys(c),pending:Object.keys(d),toLoadLanguages:Object.keys(f),toLoadNamespaces:Object.keys(p)}}},{key:"loaded",value:function(o,i,s){var a=o.split("|"),l=a[0],c=a[1];i&&this.emit("failedLoading",l,c,i),s&&this.store.addResourceBundle(l,c,s),this.state[o]=i?-1:2;var d={};this.queue.forEach(function(f){lI(f.loaded,[l],c),AI(f,o),i&&f.errors.push(i),f.pendingCount===0&&!f.done&&(Object.keys(f.loaded).forEach(function(p){d[p]||(d[p]={});var h=f.loaded[p];h.length&&h.forEach(function(E){d[p][E]===void 0&&(d[p][E]=!0)})}),f.done=!0,f.errors.length?f.callback(f.errors):f.callback())}),this.emit("loaded",d),this.queue=this.queue.filter(function(f){return!f.done})}},{key:"read",value:function(o,i,s){var a=this,l=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,c=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,d=arguments.length>5?arguments[5]:void 0;if(!o.length)return d(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:o,ns:i,fcName:s,tried:l,wait:c,callback:d});return}this.readingCalls++;var f=function(v,y){if(a.readingCalls--,a.waitingReads.length>0){var g=a.waitingReads.shift();a.read(g.lng,g.ns,g.fcName,g.tried,g.wait,g.callback)}if(v&&y&&l<a.maxRetries){setTimeout(function(){a.read.call(a,o,i,s,l+1,c*2,d)},c);return}d(v,y)},p=this.backend[s].bind(this.backend);if(p.length===2){try{var h=p(o,i);h&&typeof h.then=="function"?h.then(function(E){return f(null,E)}).catch(f):f(null,h)}catch(E){f(E)}return}return p(o,i,f)}},{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 c=this.queueLoad(o,i,a,l);if(!c.toLoad.length)return c.pending.length||l(),null;c.toLoad.forEach(function(d){s.loadOne(d)})}},{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],c=a[1];this.read(l,c,"read",void 0,void 0,function(d,f){d&&i.logger.warn("".concat(s,"loading namespace ").concat(c," for language ").concat(l," failed"),d),!d&&f&&i.logger.log("".concat(s,"loaded namespace ").concat(c," for language ").concat(l),f),i.loaded(o,d,f)})}},{key:"saveMissing",value:function(o,i,s,a,l){var c=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},d=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 f=yy(yy({},c),{},{isUpdate:l}),p=this.backend.create.bind(this.backend);if(p.length<6)try{var h;p.length===5?h=p(o,i,s,a,f):h=p(o,i,s,a),h&&typeof h.then=="function"?h.then(function(E){return d(null,E)}).catch(d):d(null,h)}catch(E){d(E)}else p(o,i,s,a,d,f)}!o||!o[0]||this.store.addResource(o[0],i,s,a)}}}]),n}(nr);function _y(){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(We(t[1])==="object"&&(n=t[1]),typeof t[1]=="string"&&(n.defaultValue=t[1]),typeof t[2]=="string"&&(n.tDescription=t[2]),We(t[2])==="object"||We(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 Sy(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 xy(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 sn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?xy(Object(n),!0).forEach(function(r){Ht(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xy(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function bI(e){var t=CI();return function(){var r=rn(e),o;if(t){var i=rn(this).constructor;o=Reflect.construct(r,arguments,i)}else o=r.apply(this,arguments);return fs(this,o)}}function CI(){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 Tl(){}function LI(e){var t=Object.getOwnPropertyNames(Object.getPrototypeOf(e));t.forEach(function(n){typeof e[n]=="function"&&(e[n]=e[n].bind(e))})}var Al=function(e){Rl(n,e);var t=bI(n);function n(){var r,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;if(bt(this,n),r=t.call(this),wl&&nr.call(tr(r)),r.options=Sy(o),r.services={},r.logger=on,r.modules={external:[]},LI(tr(r)),i&&!r.isInitialized&&!o.isClone){if(!r.options.initImmediate)return r.init(o,i),fs(r,tr(r));setTimeout(function(){r.init(o,i)},0)}return r}return Ct(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=_y();this.options=sn(sn(sn({},a),this.options),Sy(i)),this.options.compatibilityAPI!=="v1"&&(this.options.interpolation=sn(sn({},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(g){return g?typeof g=="function"?new g:g:null}if(!this.options.isClone){this.modules.logger?on.init(l(this.modules.logger),this.options):on.init(null,this.options);var c;this.modules.formatter?c=this.modules.formatter:typeof Intl<"u"&&(c=wI);var d=new hy(this.options);this.store=new gI(this.options.resources,this.options);var f=this.services;f.logger=on,f.resourceStore=this.store,f.languageUtils=d,f.pluralResolver=new xI(d,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),c&&(!this.options.interpolation.format||this.options.interpolation.format===a.interpolation.format)&&(f.formatter=l(c),f.formatter.init(f,this.options),this.options.interpolation.format=f.formatter.format.bind(f.formatter)),f.interpolator=new RI(this.options),f.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},f.backendConnector=new II(l(this.modules.backend),f.resourceStore,f,this.options),f.backendConnector.on("*",function(g){for(var m=arguments.length,_=new Array(m>1?m-1:0),S=1;S<m;S++)_[S-1]=arguments[S];o.emit.apply(o,[g].concat(_))}),this.modules.languageDetector&&(f.languageDetector=l(this.modules.languageDetector),f.languageDetector.init&&f.languageDetector.init(f,this.options.detection,this.options)),this.modules.i18nFormat&&(f.i18nFormat=l(this.modules.i18nFormat),f.i18nFormat.init&&f.i18nFormat.init(this)),this.translator=new py(this.services,this.options),this.translator.on("*",function(g){for(var m=arguments.length,_=new Array(m>1?m-1:0),S=1;S<m;S++)_[S-1]=arguments[S];o.emit.apply(o,[g].concat(_))}),this.modules.external.forEach(function(g){g.init&&g.init(o)})}if(this.format=this.options.interpolation.format,s||(s=Tl),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){var p=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);p.length>0&&p[0]!=="dev"&&(this.options.lng=p[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(g){o[g]=function(){var m;return(m=o.store)[g].apply(m,arguments)}});var E=["addResource","addResources","addResourceBundle","removeResourceBundle"];E.forEach(function(g){o[g]=function(){var m;return(m=o.store)[g].apply(m,arguments),o}});var v=ps(),y=function(){var m=function(S,x){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(x),s(S,x)};if(o.languages&&o.options.compatibilityAPI!=="v1"&&!o.isInitialized)return m(null,o.t.bind(o));o.changeLanguage(o.options.lng,m)};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]:Tl,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 c=[],d=function(h){if(h){var E=i.services.languageUtils.toResolveHierarchy(h);E.forEach(function(v){c.indexOf(v)<0&&c.push(v)})}};if(l)d(l);else{var f=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);f.forEach(function(p){return d(p)})}this.options.preload&&this.options.preload.forEach(function(p){return d(p)}),this.services.backendConnector.load(c,this.options.ns,function(p){!p&&!i.resolvedLanguage&&i.language&&i.setResolvedLanguage(i.language),a(p)})}else a(null)}},{key:"reloadResources",value:function(o,i,s){var a=ps();return o||(o=this.languages),i||(i=this.options.ns),s||(s=Tl),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"&&uy.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=ps();this.emit("languageChanging",o);var l=function(p){s.language=p,s.languages=s.services.languageUtils.toResolveHierarchy(p),s.resolvedLanguage=void 0,s.setResolvedLanguage(p)},c=function(p,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(p,function(){return s.t.apply(s,arguments)})},d=function(p){!o&&!p&&s.services.languageDetector&&(p=[]);var h=typeof p=="string"?p:s.services.languageUtils.getBestMatchFromCodes(p);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(E){c(E,h)})};return!o&&this.services.languageDetector&&!this.services.languageDetector.async?d(this.services.languageDetector.detect()):!o&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(d):this.services.languageDetector.detect(d):d(o),a}},{key:"getFixedT",value:function(o,i,s){var a=this,l=function c(d,f){var p;if(We(f)!=="object"){for(var h=arguments.length,E=new Array(h>2?h-2:0),v=2;v<h;v++)E[v-2]=arguments[v];p=a.options.overloadTranslationOptionHandler([d,f].concat(E))}else p=sn({},f);p.lng=p.lng||c.lng,p.lngs=p.lngs||c.lngs,p.ns=p.ns||c.ns,p.keyPrefix=p.keyPrefix||s||c.keyPrefix;var y=a.options.keySeparator||".",g;return p.keyPrefix&&Array.isArray(d)?g=d.map(function(m){return"".concat(p.keyPrefix).concat(y).concat(m)}):g=p.keyPrefix?"".concat(p.keyPrefix).concat(y).concat(d):d,a.t(g,p)};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,c=this.languages[this.languages.length-1];if(a.toLowerCase()==="cimode")return!0;var d=function(h,E){var v=i.services.backendConnector.state["".concat(h,"|").concat(E)];return v===-1||v===2};if(s.precheck){var f=s.precheck(this,d);if(f!==void 0)return f}return!!(this.hasResourceBundle(a,o)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||d(a,o)&&(!l||d(c,o)))}},{key:"loadNamespaces",value:function(o,i){var s=this,a=ps();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=ps();typeof o=="string"&&(o=[o]);var a=this.options.preload||[],l=o.filter(function(c){return a.indexOf(c)<0});return l.length?(this.options.preload=a.concat(l),this.loadResources(function(c){s.resolve(),i&&i(c)}),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 hy(_y());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]:Tl,a=sn(sn(sn({},this.options),i),{isClone:!0}),l=new n(a);(i.debug!==void 0||i.prefix!==void 0)&&(l.logger=l.logger.clone(i));var c=["store","services","language"];return c.forEach(function(d){l[d]=o[d]}),l.services=sn({},this.services),l.services.utils={hasLoadedNamespace:l.hasLoadedNamespace.bind(l)},l.translator=new py(l.services,l.options),l.translator.on("*",function(d){for(var f=arguments.length,p=new Array(f>1?f-1:0),h=1;h<f;h++)p[h-1]=arguments[h];l.emit.apply(l,[d].concat(p))}),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}(nr);Ht(Al,"createInstance",function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return new Al(e,t)});var Le=Al.createInstance();Le.createInstance=Al.createInstance,Le.createInstance,Le.dir,Le.init,Le.loadResources,Le.reloadResources,Le.use,Le.changeLanguage,Le.getFixedT,Le.t,Le.exists,Le.setDefaultNamespace,Le.hasLoadedNamespace,Le.loadNamespaces,Le.loadLanguages;var Ry=[],DI=Ry.forEach,kI=Ry.slice;function PI(e){return DI.call(kI.call(arguments,1),function(t){if(t)for(var n in t)e[n]===void 0&&(e[n]=t[n])}),e}var Ny=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,MI=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(!Ny.test(o.domain))throw new TypeError("option domain is invalid");s+="; Domain=".concat(o.domain)}if(o.path){if(!Ny.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},wy={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=MI(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)}},jI={name:"cookie",lookup:function(t){var n;if(t.lookupCookie&&typeof document<"u"){var r=wy.read(t.lookupCookie);r&&(n=r)}return n},cacheUserLanguage:function(t,n){n.lookupCookie&&typeof document<"u"&&wy.create(n.lookupCookie,t,n.cookieMinutes,n.cookieDomain,n.cookieOptions)}},UI={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}},hs=null,Oy=function(){if(hs!==null)return hs;try{hs=window!=="undefined"&&window.localStorage!==null;var t="i18next.translate.boo";window.localStorage.setItem(t,"foo"),window.localStorage.removeItem(t)}catch{hs=!1}return hs},FI={name:"localStorage",lookup:function(t){var n;if(t.lookupLocalStorage&&Oy()){var r=window.localStorage.getItem(t.lookupLocalStorage);r&&(n=r)}return n},cacheUserLanguage:function(t,n){n.lookupLocalStorage&&Oy()&&window.localStorage.setItem(n.lookupLocalStorage,t)}},gs=null,Ty=function(){if(gs!==null)return gs;try{gs=window!=="undefined"&&window.sessionStorage!==null;var t="i18next.translate.boo";window.sessionStorage.setItem(t,"foo"),window.sessionStorage.removeItem(t)}catch{gs=!1}return gs},VI={name:"sessionStorage",lookup:function(t){var n;if(t.lookupSessionStorage&&Ty()){var r=window.sessionStorage.getItem(t.lookupSessionStorage);r&&(n=r)}return n},cacheUserLanguage:function(t,n){n.lookupSessionStorage&&Ty()&&window.sessionStorage.setItem(n.lookupSessionStorage,t)}},$I={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}},BI={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}},HI={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}},zI={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 WI(){return{order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"]}}var Ay=function(){function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};bt(this,e),this.type="languageDetector",this.detectors={},this.init(t,n)}return Ct(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=PI(r,this.options||{},WI()),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=o,this.addDetector(jI),this.addDetector(UI),this.addDetector(FI),this.addDetector(VI),this.addDetector($I),this.addDetector(BI),this.addDetector(HI),this.addDetector(zI)}},{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}();Ay.type="languageDetector";function GI(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i<r.length;i++)o=r[i],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}function cf(e,t){if(e==null)return{};var n=GI(e,t),r,o;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)r=i[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}var YI={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0};const KI=Yl(YI);var QI=/\s([^'"/\s><]+?)[\s/>]|([^\s=]+)=\s?(".*?"|'.*?')/g;function Iy(e){var t={type:"tag",name:"",voidElement:!1,attrs:{},children:[]},n=e.match(/<\/?([^\s]+?)[/\s>]/);if(n&&(t.name=n[1],(KI[n[1]]||e.charAt(e.length-2)==="/")&&(t.voidElement=!0),t.name.startsWith("!--"))){var r=e.indexOf("-->");return{type:"comment",comment:r!==-1?e.slice(4,r):""}}for(var o=new RegExp(QI),i=null;(i=o.exec(e))!==null;)if(i[0].trim())if(i[1]){var s=i[1].trim(),a=[s,""];s.indexOf("=")>-1&&(a=s.split("=")),t.attrs[a[0]]=a[1],o.lastIndex--}else i[2]&&(t.attrs[i[2]]=i[3].trim().substring(1,i[3].length-1));return t}var XI=/<[a-zA-Z0-9\-\!\/](?:"[^"]*"|'[^']*'|[^'">])*>/g,qI=/^\s*$/,JI=Object.create(null);function by(e,t){switch(t.type){case"text":return e+t.content;case"tag":return e+="<"+t.name+(t.attrs?function(n){var r=[];for(var o in n)r.push(o+'="'+n[o]+'"');return r.length?" "+r.join(" "):""}(t.attrs):"")+(t.voidElement?"/>":">"),t.voidElement?e:e+t.children.reduce(by,"")+"</"+t.name+">";case"comment":return e+"<!--"+t.comment+"-->"}}var ZI={parse:function(e,t){t||(t={}),t.components||(t.components=JI);var n,r=[],o=[],i=-1,s=!1;if(e.indexOf("<")!==0){var a=e.indexOf("<");r.push({type:"text",content:a===-1?e:e.substring(0,a)})}return e.replace(XI,function(l,c){if(s){if(l!=="</"+n.name+">")return;s=!1}var d,f=l.charAt(1)!=="/",p=l.startsWith("<!--"),h=c+l.length,E=e.charAt(h);if(p){var v=Iy(l);return i<0?(r.push(v),r):((d=o[i]).children.push(v),r)}if(f&&(i++,(n=Iy(l)).type==="tag"&&t.components[n.name]&&(n.type="component",s=!0),n.voidElement||s||!E||E==="<"||n.children.push({type:"text",content:e.slice(h,e.indexOf("<",h))}),i===0&&r.push(n),(d=o[i-1])&&d.children.push(n),o[i]=n),(!f||n.voidElement)&&(i>-1&&(n.voidElement||n.name===l.slice(2,-1))&&(i--,n=i===-1?r:o[i]),!s&&E!=="<"&&E)){d=i===-1?r:o[i].children;var y=e.indexOf("<",h),g=e.slice(h,y===-1?void 0:y);qI.test(g)&&(g=" "),(y>-1&&i+d.length>=0||g!==" ")&&d.push({type:"text",content:g})}}),r},stringify:function(e){return e.reduce(function(t,n){return t+by("",n)},"")}};function Il(){if(console&&console.warn){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];typeof n[0]=="string"&&(n[0]="react-i18next:: ".concat(n[0])),(e=console).warn.apply(e,n)}}var Cy={};function eb(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];typeof t[0]=="string"&&Cy[t[0]]||(typeof t[0]=="string"&&(Cy[t[0]]=new Date),Il.apply(void 0,t))}var tb=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,nb={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},rb=function(t){return nb[t]},ob=function(t){return t.replace(tb,rb)};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 Dy(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){Ht(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 uf={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:ob};function ib(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};uf=Dy(Dy({},uf),e)}function sb(){return uf}var ky;function ab(e){ky=e}function Py(){return ky}var lb=["format"],cb=["children","count","parent","i18nKey","context","tOptions","values","defaults","components","ns","i18n","t","shouldUnescape"];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 De(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){Ht(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}function df(e,t){if(!e)return!1;var n=e.props?e.props.children:e.children;return t?n.length>0:!!n}function ff(e){return e?e.props?e.props.children:e.children:[]}function ub(e){return Object.prototype.toString.call(e)!=="[object Array]"?!1:e.every(function(t){return w.isValidElement(t)})}function ms(e){return Array.isArray(e)?e:[e]}function db(e,t){var n=De({},t);return n.props=Object.assign(e.props,t.props),n}function jy(e,t){if(!e)return"";var n="",r=ms(e),o=t.transSupportBasicHtmlNodes&&t.transKeepBasicHtmlNodesFor?t.transKeepBasicHtmlNodesFor:[];return r.forEach(function(i,s){if(typeof i=="string")n+="".concat(i);else if(w.isValidElement(i)){var a=Object.keys(i.props).length,l=o.indexOf(i.type)>-1,c=i.props.children;if(!c&&l&&a===0)n+="<".concat(i.type,"/>");else if(!c&&(!l||a!==0))n+="<".concat(s,"></").concat(s,">");else if(i.props.i18nIsDynamicList)n+="<".concat(s,"></").concat(s,">");else if(l&&a===1&&typeof c=="string")n+="<".concat(i.type,">").concat(c,"</").concat(i.type,">");else{var d=jy(c,t);n+="<".concat(s,">").concat(d,"</").concat(s,">")}}else if(i===null)Il("Trans: the passed in value is invalid - seems you passed in a null child.");else if(We(i)==="object"){var f=i.format,p=cf(i,lb),h=Object.keys(p);if(h.length===1){var E=f?"".concat(h[0],", ").concat(f):h[0];n+="{{".concat(E,"}}")}else Il("react-i18next: the passed in object contained more than one variable - the object should look like {{ value, format }} where format is optional.",i)}else Il("Trans: the passed in value is invalid - seems you passed in a variable like {number} - please pass in variables for interpolation as full objects like {{number}}.",i)}),n}function fb(e,t,n,r,o,i){if(t==="")return[];var s=r.transKeepBasicHtmlNodesFor||[],a=t&&new RegExp(s.join("|")).test(t);if(!e&&!a)return[t];var l={};function c(y){var g=ms(y);g.forEach(function(m){typeof m!="string"&&(df(m)?c(ff(m)):We(m)==="object"&&!w.isValidElement(m)&&Object.assign(l,m))})}c(e);var d=ZI.parse("<0>".concat(t,"</0>")),f=De(De({},l),o);function p(y,g,m){var _=ff(y),S=E(_,g.children,m);return ub(_)&&S.length===0?_:S}function h(y,g,m,_,S){y.dummy&&(y.children=g),m.push(w.cloneElement(y,De(De({},y.props),{},{key:_}),S?void 0:g))}function E(y,g,m){var _=ms(y),S=ms(g);return S.reduce(function(x,R,I){var L=R.children&&R.children[0]&&R.children[0].content&&n.services.interpolator.interpolate(R.children[0].content,f,n.language);if(R.type==="tag"){var U=_[parseInt(R.name,10)];!U&&m.length===1&&m[0][R.name]&&(U=m[0][R.name]),U||(U={});var A=Object.keys(R.attrs).length!==0?db({props:R.attrs},U):U,b=w.isValidElement(A),V=b&&df(R,!0)&&!R.voidElement,M=a&&We(A)==="object"&&A.dummy&&!b,O=We(e)==="object"&&e!==null&&Object.hasOwnProperty.call(e,R.name);if(typeof A=="string"){var j=n.services.interpolator.interpolate(A,f,n.language);x.push(j)}else if(df(A)||V){var P=p(A,R,m);h(A,P,x,I)}else if(M){var $=E(_,R.children,m);x.push(w.cloneElement(A,De(De({},A.props),{},{key:I}),$))}else if(Number.isNaN(parseFloat(R.name)))if(O){var D=p(A,R,m);h(A,D,x,I,R.voidElement)}else if(r.transSupportBasicHtmlNodes&&s.indexOf(R.name)>-1)if(R.voidElement)x.push(w.createElement(R.name,{key:"".concat(R.name,"-").concat(I)}));else{var C=E(_,R.children,m);x.push(w.createElement(R.name,{key:"".concat(R.name,"-").concat(I)},C))}else if(R.voidElement)x.push("<".concat(R.name," />"));else{var k=E(_,R.children,m);x.push("<".concat(R.name,">").concat(k,"</").concat(R.name,">"))}else if(We(A)==="object"&&!b){var F=R.children[0]?L:null;F&&x.push(F)}else R.children.length===1&&L?x.push(w.cloneElement(A,De(De({},A.props),{},{key:I}),L)):x.push(w.cloneElement(A,De(De({},A.props),{},{key:I})))}else if(R.type==="text"){var B=r.transWrapTextNodes,z=i?r.unescape(n.services.interpolator.interpolate(R.content,f,n.language)):n.services.interpolator.interpolate(R.content,f,n.language);B?x.push(w.createElement(B,{key:"".concat(R.name,"-").concat(I)},z)):x.push(z)}return x},[])}var v=E([{dummy:!0,children:e||[]}],d,ms(e||[]));return ff(v[0])}function pb(e){var t=e.children,n=e.count,r=e.parent,o=e.i18nKey,i=e.context,s=e.tOptions,a=s===void 0?{}:s,l=e.values,c=e.defaults,d=e.components,f=e.ns,p=e.i18n,h=e.t,E=e.shouldUnescape,v=cf(e,cb),y=p||Py();if(!y)return eb("You will need to pass in an i18next instance by using i18nextReactModule"),t;var g=h||y.t.bind(y)||function(V){return V};i&&(a.context=i);var m=De(De({},sb()),y.options&&y.options.react),_=f||g.ns||y.options&&y.options.defaultNS;_=typeof _=="string"?[_]:_||["translation"];var S=c||jy(t,m)||m.transEmptyNodeValue||o,x=m.hashTransKey,R=o||(x?x(S):S),I=l?a.interpolation:{interpolation:De(De({},a.interpolation),{},{prefix:"#$?",suffix:"?$#"})},L=De(De(De(De({},a),{},{count:n},l),I),{},{defaultValue:S,ns:_}),U=R?g(R,L):S,A=fb(d||t,U,y,m,L,E),b=r!==void 0?r:m.defaultTransParent;return b?w.createElement(b,v,A):A}var hb={type:"3rdParty",init:function(t){ib(t.options.react),ab(t)}},gb=w.createContext();(function(){function e(){bt(this,e),this.usedNamespaces={}}return Ct(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})();var mb=["children","count","parent","i18nKey","context","tOptions","values","defaults","components","ns","i18n","t","shouldUnescape"];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 Eb(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){Ht(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}function vb(e){var t=e.children,n=e.count,r=e.parent,o=e.i18nKey,i=e.context,s=e.tOptions,a=s===void 0?{}:s,l=e.values,c=e.defaults,d=e.components,f=e.ns,p=e.i18n,h=e.t,E=e.shouldUnescape,v=cf(e,mb),y=w.useContext(gb)||{},g=y.i18n,m=y.defaultNS,_=p||g||Py(),S=h||_&&_.t.bind(_);return pb(Eb({children:t,count:n,parent:r,i18nKey:o,context:i,tOptions:a,values:l,defaults:c,components:d,ns:f||S&&S.ns||m||_&&_.options&&_.options.defaultNS,i18n:_,t:h,shouldUnescape:E},v))}var yb={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"]},_b={prefix:"fas",iconName:"bars",icon:[448,512,["navicon"],"f0c9","M0 96C0 78.3 14.3 64 32 64H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H32C14.3 128 0 113.7 0 96zM0 256c0-17.7 14.3-32 32-32H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H32c-17.7 0-32-14.3-32-32zM448 416c0 17.7-14.3 32-32 32H32c-17.7 0-32-14.3-32-32s14.3-32 32-32H416c17.7 0 32 14.3 32 32z"]},Sb={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"]},xb={prefix:"fas",iconName:"circle-dot",icon:[512,512,[128280,"dot-circle"],"f192","M256 512c141.4 0 256-114.6 256-256S397.4 0 256 0S0 114.6 0 256S114.6 512 256 512zm0-160c-53 0-96-43-96-96s43-96 96-96s96 43 96 96s-43 96-96 96z"]},Rb=xb,Nb={prefix:"fas",iconName:"diamond-exclamation",icon:[512,512,[],"e405","M227.7 11.7c15.6-15.6 40.9-15.6 56.6 0l216 216c15.6 15.6 15.6 40.9 0 56.6l-216 216c-15.6 15.6-40.9 15.6-56.6 0l-216-216c-15.6-15.6-15.6-40.9 0-56.6l216-216zM256 128c-13.3 0-24 10.7-24 24V264c0 13.3 10.7 24 24 24s24-10.7 24-24V152c0-13.3-10.7-24-24-24zm32 224a32 32 0 1 0 -64 0 32 32 0 1 0 64 0z"]},wb={prefix:"fas",iconName:"circle-check",icon:[512,512,[61533,"check-circle"],"f058","M256 512c141.4 0 256-114.6 256-256S397.4 0 256 0S0 114.6 0 256S114.6 512 256 512zM369 209L241 337c-9.4 9.4-24.6 9.4-33.9 0l-64-64c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l47 47L335 175c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9z"]},Ob={prefix:"fas",iconName:"arrows-rotate",icon:[512,512,[128472,"refresh","sync"],"f021","M89.1 202.6c7.7-21.8 20.2-42.3 37.8-59.8c62.5-62.5 163.8-62.5 226.3 0L370.3 160H320c-17.7 0-32 14.3-32 32s14.3 32 32 32H447.5c0 0 0 0 0 0h.4c17.7 0 32-14.3 32-32V64c0-17.7-14.3-32-32-32s-32 14.3-32 32v51.2L398.4 97.6c-87.5-87.5-229.3-87.5-316.8 0C57.2 122 39.6 150.7 28.8 181.4c-5.9 16.7 2.9 34.9 19.5 40.8s34.9-2.9 40.8-19.5zM23 289.3c-5 1.5-9.8 4.2-13.7 8.2c-4 4-6.7 8.8-8.1 14c-.3 1.2-.6 2.5-.8 3.8c-.3 1.7-.4 3.4-.4 5.1V448c0 17.7 14.3 32 32 32s32-14.3 32-32V396.9l17.6 17.5 0 0c87.5 87.4 229.3 87.4 316.7 0c24.4-24.4 42.1-53.1 52.9-83.7c5.9-16.7-2.9-34.9-19.5-40.8s-34.9 2.9-40.8 19.5c-7.7 21.8-20.2 42.3-37.8 59.8c-62.5 62.5-163.8 62.5-226.3 0l-.1-.1L109.6 352H160c17.7 0 32-14.3 32-32s-14.3-32-32-32H32.4c-1.6 0-3.2 .1-4.8 .3s-3.1 .5-4.6 1z"]},Tb={prefix:"fas",iconName:"arrow-turn-down-right",icon:[512,512,[],"e3d6","M64 64c0-17.7-14.3-32-32-32S0 46.3 0 64V224c0 53 43 96 96 96H402.7l-73.4 73.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l128-128c12.5-12.5 12.5-32.8 0-45.3l-128-128c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L402.7 256H96c-17.7 0-32-14.3-32-32V64z"]},Ab={prefix:"fas",iconName:"arrow-right",icon:[448,512,[8594],"f061","M438.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L338.8 224 32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l306.7 0L233.4 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l160-160z"]},Ib={prefix:"fas",iconName:"circle-question",icon:[512,512,[62108,"question-circle"],"f059","M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM169.8 165.3c7.9-22.3 29.1-37.3 52.8-37.3h58.3c34.9 0 63.1 28.3 63.1 63.1c0 22.6-12.1 43.5-31.7 54.8L280 264.4c-.2 13-10.9 23.6-24 23.6c-13.3 0-24-10.7-24-24V250.5c0-8.6 4.6-16.5 12.1-20.8l44.3-25.4c4.7-2.7 7.6-7.7 7.6-13.1c0-8.4-6.8-15.1-15.1-15.1H222.6c-3.4 0-6.4 2.1-7.5 5.3l-.4 1.2c-4.4 12.5-18.2 19-30.6 14.6s-19-18.2-14.6-30.6l.4-1.2zM224 352a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z"]},bb={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"]},Cb={prefix:"fas",iconName:"circle-small",icon:[320,512,[],"e122","M320 256c0 88.4-71.6 160-160 160S0 344.4 0 256S71.6 96 160 96s160 71.6 160 160z"]},Lb={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"]},Db={prefix:"fas",iconName:"bolt",icon:[384,512,[9889,"zap"],"f0e7","M317.4 44.6c5.9-13.7 1.5-29.7-10.6-38.5s-28.6-8-39.9 1.8l-256 224C.9 240.7-2.6 254.8 2 267.3S18.7 288 32 288H143.5L66.6 467.4c-5.9 13.7-1.5 29.7 10.6 38.5s28.6 8 39.9-1.8l256-224c10-8.8 13.6-22.9 8.9-35.3s-16.6-20.7-30-20.7H240.5L317.4 44.6z"]},kb={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"]},Pb={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"]},Mb={prefix:"fas",iconName:"clock-rotate-left",icon:[512,512,["history"],"f1da","M75 75L41 41C25.9 25.9 0 36.6 0 57.9V168c0 13.3 10.7 24 24 24H134.1c21.4 0 32.1-25.9 17-41l-30.8-30.8C155 85.5 203 64 256 64c106 0 192 86 192 192s-86 192-192 192c-40.8 0-78.6-12.7-109.7-34.4c-14.5-10.1-34.4-6.6-44.6 7.9s-6.6 34.4 7.9 44.6C151.2 495 201.7 512 256 512c141.4 0 256-114.6 256-256S397.4 0 256 0C185.3 0 121.3 28.7 75 75zm181 53c-13.3 0-24 10.7-24 24V256c0 6.4 2.5 12.5 7 17l72 72c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-65-65V152c0-13.3-10.7-24-24-24z"]},jb={prefix:"fas",iconName:"triangle-exclamation",icon:[512,512,[9888,"exclamation-triangle","warning"],"f071","M256 32c14.2 0 27.3 7.5 34.5 19.8l216 368c7.3 12.4 7.3 27.7 .2 40.1S486.3 480 472 480H40c-14.3 0-27.6-7.7-34.7-20.1s-7-27.8 .2-40.1l216-368C228.7 39.5 241.8 32 256 32zm0 128c-13.3 0-24 10.7-24 24V296c0 13.3 10.7 24 24 24s24-10.7 24-24V184c0-13.3-10.7-24-24-24zm32 224a32 32 0 1 0 -64 0 32 32 0 1 0 64 0z"]},Ub={prefix:"fas",iconName:"circle-xmark",icon:[512,512,[61532,"times-circle","xmark-circle"],"f057","M256 512c141.4 0 256-114.6 256-256S397.4 0 256 0S0 114.6 0 256S114.6 512 256 512zM175 175c9.4-9.4 24.6-9.4 33.9 0l47 47 47-47c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-47 47 47 47c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-47-47-47 47c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l47-47-47-47c-9.4-9.4-9.4-24.6 0-33.9z"]};const Fb={"arrow-left":bb,"arrow-right":Ab,"arrow-turn-down-right":Tb,"arrows-rotate":Ob,bars:_b,bolt:Db,"circle-check":wb,"circle-exclamation":Sb,"circle-info":Lb,"circle-question":Ib,"circle-small":Cb,"circle-xmark":Ub,"clock-rotate-left":Mb,"diamond-exclamation":Nb,"dot-circle":Rb,"trash-can":yb,"triangle-exclamation":jb,"up-from-bracket":Pb,xmark:kb},te=w.forwardRef(function({className:t="",size:n="",tag:r},o){const i=Fb[r];return i?u.jsx("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:u.jsx("path",{d:i.icon[4],fill:"currentColor"})}):(Ie().debug(`Unknown icon: ${r}`),null)}),Bo=({className:e="",confirm:t=!0,handleDelete:n,label:r,scale:o=1,show:i=!0,showLabel:s=!1,size:a})=>{const[l,c]=w.useState(!1),[d,f]=w.useState(o);o!==d&&(c(!1),f(o));const p=E=>{E.preventDefault(),c(v=>!v)},h=E=>{E.preventDefault(),n(E)};return u.jsx(sr,{enable:t,open:l,onOpenChange:c,placement:"top",scale:o,trigger:u.jsxs("button",{className:`${i?"visible opacity-100":"invisible opacity-0"} text-xs text-foreground/20 hover:text-negative group-hover/node-wrapper:visible group-hover/node-wrapper:animate-delay-opacity ${e}`,onClick:E=>p(E),children:[u.jsx(te,{tag:"trash-can",size:a})," ",u.jsx("span",{className:`${s?"whitespace-nowrap text-foreground/40 underline hover:text-negative":"sr-only"}`,children:r})]}),children:u.jsxs("div",{className:"text-xs font-semibold",children:[u.jsx("p",{className:"w-full pb-2 text-center",children:T(N.ARE_YOU_SURE)}),u.jsxs("div",{className:"align-center flex justify-between gap-2",children:[u.jsx("button",{className:"rounded bg-secondary py-1 px-2",onClick:E=>p(E),children:T(N.CANCEL)}),u.jsx("button",{className:"rounded bg-negative py-1 px-2",onClick:E=>h(E),children:T(N.DELETE)})]})]})})},Vb=e=>{const t=Y(n=>n.viewport.zoom);return u.jsx(Bo,{scale:t,...e})},$b=Ie(),Bb=100,Hb=100,Fy=({children:e,className:t="",onClickListItem:n})=>{const r=Y(c=>c.nodes),o=Y(c=>c.reactFlowInstance),i=Y(c=>c.validationWarnings),{setSelectedNodes:s}=xe();if(i.size===0)return null;const a=Array.from(i.values());a.sort((c,d)=>c.nodeTitle.toLowerCase().localeCompare(d.nodeTitle.toLowerCase()));const l=c=>{var h,E;const d=r.find(v=>v.id===c);if(!d){$b.error(`Node with id ${c} not found`);return}const f=((h=o==null?void 0:o.getNode(c))==null?void 0:h.height)??Hb,p=((E=o==null?void 0:o.getNode(c))==null?void 0:E.width)??Hv;o==null||o.fitBounds({height:f+Bb,width:p,x:d.position.x,y:d.position.y},{duration:nf}),setTimeout(()=>s([d.id]),nf),n==null||n()};return u.jsxs("div",{className:`hidden max-h-60 flex-col sm:flex ${t}`,children:[e,u.jsxs("p",{className:"mb-2 text-xs",children:[T(N.NUMBER_OF_VALIDATION_WARNINGS,{count:a.length}),":"]}),u.jsx("div",{className:"flex-auto overflow-y-auto",children:u.jsx("ol",{className:"list-inside",children:a.map(c=>u.jsxs("li",{className:"mb-2 text-xs",children:[u.jsx("button",{className:"text-warning underline",onClick:()=>l(c.nodeId),children:T(c.nodeTitle)}),u.jsxs("ol",{className:"my-1 ml-4 flex list-inside flex-col gap-y-1",children:[!c.connected&&u.jsx("li",{children:T(N.NOT_CONNECTED_TO_FLOW)}),!c.valid&&u.jsx("li",{children:T(N.INVALID_SETTINGS)})]})]},c.id))})})]})},Es=e=>{const{className:t="",direction:n="from",valid:r=!0,...o}=e,i=n==="from";return u.jsxs("div",{className:`relative ${t} ${r?"":"invalid"}`,children:[u.jsx("input",{className:`w-full !pl-5 ${r?"":"invalid"}`,placeholder:T(i?N.FROM:N.TO),...o}),u.jsx(te,{className:"absolute left-[.25rem] top-[.5rem] text-foreground/40",tag:i?"arrow-left":"arrow-right"})]})},zb=({children:e})=>u.jsx("span",{className:"whitespace-wrap inline-block",children:u.jsx("code",{className:"mr-[0.5ch] whitespace-pre-wrap rounded-md bg-background p-0 px-[0.5ch] text-sm leading-4 tracking-tighter text-foreground",children:e})}),Lt=({children:e})=>u.jsxs("section",{className:"flex gap-2 overflow-hidden px-4 pb-3 text-xs leading-5",children:[u.jsx("div",{className:"shrink-0 pl-1 text-secondary",children:u.jsx(te,{size:"lg",tag:"arrow-turn-down-right"})}),u.jsx("div",{className:"w-full overflow-hidden",children:e})]}),Wb=({connected:e=!1,deletable:t=!0,isRoot:n=!1,nodeId:r,nodeTitle:o,selected:i=!1})=>{const{removeNode:s}=xe(),a=Y(c=>c.isEdgeConnecting),l=(c=>c?"bg-positive/10 text-positive":e?"bg-focus/30 text-primary":"bg-foreground/10 text-foreground/50")(n);return u.jsxs("div",{className:"flex w-full items-center justify-start gap-x-2 p-4",children:[u.jsx("div",{className:`${l} flex h-5 w-5 shrink-0 items-center justify-center rounded-full`,children:u.jsx(te,{tag:"circle-small"})}),u.jsxs("div",{className:"flex-1",children:[u.jsx("h2",{className:"text-xs font-semibold",children:o}),!e&&u.jsxs("div",{className:"flex items-center justify-start text-tiny font-semibold leading-[14px] text-secondary",children:[u.jsx(te,{className:"px-1 text-warning",size:"lg",tag:"bolt"}),T(N.NOT_CONNECTED_TO_FLOW)]})]}),t&&!a&&u.jsx(Vb,{handleDelete:()=>s(r),label:T(N.REMOVE_NODE,{title:o}),show:i})]})},Gb=({valid:e})=>e?null:u.jsx("div",{className:"m-4 mt-0 inline-block",children:u.jsxs("div",{className:"flex items-start justify-start gap-2 rounded bg-negative/10 px-2 py-1 text-xs text-negative",children:[u.jsx(sr,{placement:"bottom",trigger:u.jsx("div",{role:"tooltip",tabIndex:0,children:u.jsx(te,{size:"lg",tag:"triangle-exclamation"})}),children:T(N.INFO_INVALID_SETTINGS)}),T(N.INVALID_SETTINGS)]})}),Yb=({nodeId:e,valid:t})=>{const{deleteValidationWarning:n,getTargetEdges:r,partialUpdateValidationWarning:o}=xe(),[i,s]=w.useState(!1);return w.useEffect(()=>{let a;const l=()=>{n(e),typeof a=="function"&&a()},c=()=>{const d=Y.getState().nodes.find(f=>f.id===e);if(!d)l();else{const f=r(e).length>0;s(f),o(e,{connected:f,nodeId:e,nodeType:d.type,valid:t})}};return c(),a=Y.subscribe((d,f)=>{const p=d.nodes.length!==f.nodes.length,h=d.edges.length!==f.edges.length,E=d.isEdgeUpdateSuccessful!==f.isEdgeUpdateSuccessful;(h||p||E)&&c()}),()=>{l()}},[n,r,e,o,t]),{isConnectedToFlow:i}},Kb=({id:e,isConnectable:t})=>{if(!e)throw new Error("TargetHandle: id is required");return u.jsx("div",{className:"absolute left-0 top-5 h-3 w-3 -translate-x-1/2",children:u.jsx(Co,{className:"-left-[2px] h-full w-full border-2 border-foreground/40 bg-background transition-colors hover:border-foreground/80",id:`target-${e}`,isConnectable:t,position:K.Left,type:"target"})})},Fe=({children:e,id:t,isConnectable:n=!0,isRoot:r=!1,nodeTitle:o,selected:i,deletable:s=!0,showValidation:a=!0,target:l=!0,valid:c=!0})=>{const{isConnectedToFlow:d}=Yb({nodeId:t,valid:c});return u.jsx("section",{className:`${i?"!border-focus":""} group/node-wrapper rounded-xl border-2 border-background shadow-[0_4px_12px_0_rgba(0,0,0,0.08)] transition-[visibility]`,children:u.jsxs("div",{className:"group/node-wrapper relative rounded-xl bg-background",style:{width:Hv},children:[l&&t&&u.jsx(Kb,{id:t,isConnectable:n}),u.jsx(Wb,{connected:!l||d,deletable:s,isRoot:r,nodeId:t,nodeTitle:o,selected:i}),a&&u.jsx(Gb,{valid:c}),e]})})},Qb=({children:e,handleClick:t,...n})=>{const r=o=>{(o.key==="Backspace"||o.key==="Delete")&&(o.stopPropagation(),t==null||t())};return u.jsx("li",{role:"presentation",children:u.jsxs("div",{className:"flex items-center gap-2 rounded-lg bg-primary/20 p-1 pl-2 text-xs font-medium text-foreground",role:"option","aria-selected":"true",tabIndex:0,children:[e,u.jsxs("button",{className:"px-1",onClick:t,onKeyDown:r,type:"button",...n,children:[u.jsx("span",{className:"sr-only",children:"Remove"}),u.jsx(te,{tag:"xmark",size:"xs"})]})]})})},Vy=({data:e})=>{let t=e.selected&&e[e.selected].trim();return t&&e.selected==="url"&&(t=JA(t)||T(N.PLAY_AUDIO)),t?u.jsx(Lt,{children:u.jsx("div",{className:"max-w-max",children:e.selected==="url"?u.jsx("a",{className:"break-words text-primary underline line-clamp-2",href:e.url,target:"_blank",rel:"noopener noreferrer",children:t}):u.jsx("p",{className:"break-words line-clamp-2",children:t})})}):null},$y=e=>{const{children:t,className:n="",disabled:r=!1,...o}=e;return u.jsxs("div",{className:`relative mb-2 after:pointer-events-none after:absolute after:top-[.725rem] after:right-3 after:h-0 after:w-0 after:border-[5px] after:border-t-[6px] after:border-b-0 after:border-r-transparent after:border-l-transparent after:content-['']
62
+ ${r?"after:border-t-foreground/40":"after:border-t-foreground"}`,children:[u.jsx("select",{className:`pr-8 ${n}`,disabled:r,...o,children:t}),u.jsx("p",{className:"requirements w-full",role:"alert",children:T(N.ERROR_SELECTION_REQUIRED)})]})},an=e=>{const{label:t="",id:n="",...r}=e,o=w.useId(),i=n||o;return u.jsxs(u.Fragment,{children:[t&&u.jsx("label",{className:"block pb-1 font-medium",htmlFor:i,children:t}),u.jsx($y,{id:i,...r})]})},Xb=({label:e,vars:t={}})=>u.jsx(vb,{components:{a:u.jsx("a",{className:"underline hover:text-background/80",href:t.linkTo||"#",target:"_blank",rel:"noopener noreferrer"}),code:u.jsx(zb,{}),p:u.jsx("p",{className:"mb-2"})},i18nKey:e}),qb={disabled:"border-disabled cursor-not-allowed",negative:"border-negative hover:bg-negative",positive:"border-positive hover:bg-positive"},Wt=({color:e="positive",enabled:t=!0,id:n,isConnectable:r})=>{if(!n)throw new Error("SourceHandle: id is required");const o=t?e:"disabled",i=Y(d=>d.updatingSourceHandleId),l=!Y(d=>d.edges.some(f=>f.sourceHandle===n))||i===n,c=l&&r&&t;return u.jsx("div",{className:`absolute right-0 top-1/2 h-3 w-3 -translate-y-1/2 translate-x-1/2 ${c?"":"nodrag cursor-not-allowed"}`,children:u.jsx(Co,{className:`-right-[2px] h-full w-full border-2 bg-background transition-colors ${qb[o]??""}`,id:n,isConnectable:l&&r&&t,position:K.Right,type:"source"})})},Ho=({children:e})=>u.jsx("div",{className:"flex w-full flex-col items-start text-xs",children:e}),Gt=({color:e="positive",enabled:t=!0,id:n,isConnectable:r,optionSubtitle:o="",optionTitle:i})=>u.jsxs("div",{className:"relative w-full min-w-[104px] whitespace-nowrap border-t border-foreground/10 py-3",children:[u.jsx("div",{className:"flex flex-col items-start justify-center px-4",children:u.jsxs("div",{className:`${t?"":"text-disabled"} min-h-[1rem] w-full overflow-hidden`,children:[i,o?u.jsx("span",{className:"block text-xxs text-secondary",children:o}):null]})}),u.jsx(Wt,{color:e,enabled:t,id:n,isConnectable:r})]}),Jb=({checked:e=!1,name:t,onClick:n})=>u.jsxs("button",{name:t,onClick:n,type:"button",className:`${e?"bg-primary":"bg-secondary"} relative inline-flex h-4 w-6 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:[u.jsx("span",{className:"sr-only",children:T(e?N.ON:N.OFF)}),u.jsx("span",{className:`pointer-events-none inline-block h-3 w-3 ${e?"translate-x-2":"translate-x-0"} transform rounded-full bg-white shadow transition duration-200 ease-in-out`})]}),pf=({checked:e,clickHandler:t,name:n,subtitle:r,title:o})=>u.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[u.jsxs("div",{className:"flex flex-grow flex-col",children:[u.jsx("span",{className:"text-xs",children:o}),r&&u.jsx("span",{className:"text-xxs text-foreground/50",children:r})]}),u.jsx(Jb,{checked:e,name:n,onClick:t})]}),On=({errorText:e,label:t,name:n,onChange:r,required:o,valid:i,value:s,...a})=>u.jsxs(u.Fragment,{children:[t!=null&&t.trim()?u.jsx("div",{className:"pb-1",children:t}):null,u.jsx("textarea",{"aria-invalid":i?void 0:"true",className:`peer min-h-[77px] w-full resize-y ${i?"":"invalid"}`,inputMode:"text",minLength:1,name:n,onChange:r,required:o,value:s,...a}),u.jsx("p",{className:"requirements",role:"alert",children:e})]});/*!
63
63
  * tabbable 6.1.1
64
64
  * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
65
- */var Zb=["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])"],ff=Zb.join(","),Hy=typeof Element>"u",Es=Hy?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Al=!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},Il=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},e2=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},t2=function(t,n,r){if(Il(t))return[];var o=Array.prototype.slice.apply(t.querySelectorAll(ff));return n&&Es.call(t,ff)&&o.unshift(t),o=o.filter(r),o},n2=function e(t,n,r){for(var o=[],i=Array.from(t);i.length;){var s=i.shift();if(!Il(s,!1))if(s.tagName==="SLOT"){var a=s.assignedElements(),l=a.length?a:s.children,c=e(l,!0,r);r.flatten?o.push.apply(o,c):o.push({scopeParent:s,candidates:c})}else{var d=Es.call(s,ff);d&&r.filter(s)&&(n||!t.includes(s))&&o.push(s);var f=s.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(s),p=!Il(f,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(s));if(f&&p){var h=e(f===!0?s.children:f.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)||e2(t))&&isNaN(parseInt(t.getAttribute("tabindex"),10))?0:t.tabIndex},r2=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},Wy=function(t){return t.tagName==="INPUT"},o2=function(t){return Wy(t)&&t.type==="hidden"},i2=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},s2=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},a2=function(t){if(!t.name)return!0;var n=t.form||Al(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=s2(o,t.form);return!i||i===t},l2=function(t){return Wy(t)&&t.type==="radio"},c2=function(t){return l2(t)&&!a2(t)},u2=function(t){var n,r=t&&Al(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 c,d,f;r=Al(o),o=(c=r)===null||c===void 0?void 0:c.host,i=!!((d=o)!==null&&d!==void 0&&(f=d.ownerDocument)!==null&&f!==void 0&&f.contains(o))}}return i},Gy=function(t){var n=t.getBoundingClientRect(),r=n.width,o=n.height;return r===0&&o===0},d2=function(t,n){var r=n.displayCheck,o=n.getShadowRoot;if(getComputedStyle(t).visibility==="hidden")return!0;var i=Es.call(t,"details>summary:first-of-type"),s=i?t.parentElement:t;if(Es.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,c=Al(t);if(l&&!l.shadowRoot&&o(l)===!0)return Gy(t);t.assignedSlot?t=t.assignedSlot:!l&&c!==t.ownerDocument?t=c.host:t=l}t=a}if(u2(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return Gy(t);return!1},f2=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 Es.call(n,"fieldset[disabled] *")?!0:!o.contains(t)}return!0}n=n.parentElement}return!1},p2=function(t,n){return!(n.disabled||Il(n)||o2(n)||d2(n,t)||i2(n)||f2(n))},Yy=function(t,n){return!(c2(n)||zy(n)<0||!p2(t,n))},h2=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},g2=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),c=s?e(o.candidates):a;l===0?s?n.push.apply(n,c):n.push(a):r.push({documentOrder:i,tabIndex:l,item:o,isScope:s,content:c})}),r.sort(r2).reduce(function(o,i){return i.isScope?o.push.apply(o,i.content):o.push(i.content),o},[]).concat(n)},Ky=function(t,n){n=n||{};var r;return n.getShadowRoot?r=n2([t],n.includeContainer,{filter:Yy.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:h2}):r=t2(t,n.includeContainer,Yy.bind(null,n)),g2(r)};function ys(e){return e.split("-")[1]}function pf(e){return e==="y"?"height":"width"}function Cr(e){return e.split("-")[0]}function _s(e){return["top","bottom"].includes(Cr(e))?"x":"y"}function Qy(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=_s(t),l=pf(a),c=r[l]/2-o[l]/2,d=a==="x";let f;switch(Cr(t)){case"top":f={x:i,y:r.y-o.height};break;case"bottom":f={x:i,y:r.y+r.height};break;case"right":f={x:r.x+r.width,y:s};break;case"left":f={x:r.x-o.width,y:s};break;default:f={x:r.x,y:r.y}}switch(ys(t)){case"start":f[a]-=c*(n&&d?-1:1);break;case"end":f[a]+=c*(n&&d?-1:1)}return f}const m2=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 c=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:f}=Qy(c,r,l),p=r,h={},v=0;for(let E=0;E<a.length;E++){const{name:y,fn:g}=a[E],{x:m,y:_,data:S,reset:x}=await g({x:d,y:f,initialPlacement:r,placement:p,strategy:o,middlewareData:h,rects:c,platform:s,elements:{reference:e,floating:t}});d=m??d,f=_??f,h={...h,[y]:{...h[y],...S}},x&&v<=50&&(v++,typeof x=="object"&&(x.placement&&(p=x.placement),x.rects&&(c=x.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):x.rects),{x:d,y:f}=Qy(c,p,l)),E=-1)}return{x:d,y:f,placement:p,strategy:o,middlewareData:h}};function Xy(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 hf(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}async function qy(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:s,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:f="floating",altBoundary:p=!1,padding:h=0}=t,v=Xy(h),E=a[p?f==="floating"?"reference":"floating":f],y=hf(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(E)))==null||n?E:E.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:d,strategy:l})),g=f==="floating"?{...s.floating,x:r,y:o}:s.reference,m=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),_=await(i.isElement==null?void 0:i.isElement(m))&&await(i.getScale==null?void 0:i.getScale(m))||{x:1,y:1},S=hf(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({rect:g,offsetParent:m,strategy:l}):g);return{top:(y.top-S.top+v.top)/_.y,bottom:(S.bottom-y.bottom+v.bottom)/_.y,left:(y.left-S.left+v.left)/_.x,right:(S.right-y.right+v.right)/_.x}}const v2=Math.min,E2=Math.max;function gf(e,t,n){return E2(e,v2(t,n))}const Jy=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 c=Xy(r),d={x:o,y:i},f=_s(s),p=pf(f),h=await l.getDimensions(n),v=f==="y"?"top":"left",E=f==="y"?"bottom":"right",y=a.reference[p]+a.reference[f]-d[f]-a.floating[p],g=d[f]-a.reference[f],m=await(l.getOffsetParent==null?void 0:l.getOffsetParent(n));let _=m?f==="y"?m.clientHeight||0:m.clientWidth||0:0;_===0&&(_=a.floating[p]);const S=y/2-g/2,x=c[v],R=_-h[p]-c[E],I=_/2-h[p]/2+S,L=gf(x,I,R),U=ys(s)!=null&&I!=L&&a.reference[p]/2-(I<x?c[v]:c[E])-h[p]/2<0;return{[f]:d[f]-(U?I<x?x-I:R-I:0),data:{[f]:L,centerOffset:I-L}}}});["top","right","bottom","left"].reduce((e,t)=>e.concat(t,t+"-start",t+"-end"),[]);const y2={left:"right",right:"left",bottom:"top",top:"bottom"};function bl(e){return e.replace(/left|right|bottom|top/g,t=>y2[t])}function _2(e,t,n){n===void 0&&(n=!1);const r=ys(e),o=_s(e),i=pf(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=bl(s)),{main:s,cross:bl(s)}}const S2={start:"end",end:"start"};function mf(e){return e.replace(/start|end/g,t=>S2[t])}const x2=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:c=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:v=!0,...E}=e,y=Cr(r),g=Cr(s)===s,m=await(a.isRTL==null?void 0:a.isRTL(l.floating)),_=f||(g||!v?[bl(s)]:function(b){const V=bl(b);return[mf(b),V,mf(V)]}(s));f||h==="none"||_.push(...function(b,V,M,O){const j=ys(b);let P=function($,D,C){const k=["left","right"],F=["right","left"],B=["top","bottom"],z=["bottom","top"];switch($){case"top":case"bottom":return C?D?F:k:D?k:F;case"left":case"right":return D?B:z;default:return[]}}(Cr(b),M==="start",O);return j&&(P=P.map($=>$+"-"+j),V&&(P=P.concat(P.map(mf)))),P}(s,v,h,m));const S=[s,..._],x=await qy(t,E),R=[];let I=((n=o.flip)==null?void 0:n.overflows)||[];if(c&&R.push(x[y]),d){const{main:b,cross:V}=_2(r,i,m);R.push(x[b],x[V])}if(I=[...I,{placement:r,overflows:R}],!R.every(b=>b<=0)){var L,U;const b=(((L=o.flip)==null?void 0:L.index)||0)+1,V=S[b];if(V)return{data:{index:b,overflows:I},reset:{placement:V}};let M=(U=I.filter(O=>O.overflows[0]<=0).sort((O,j)=>O.overflows[1]-j.overflows[1])[0])==null?void 0:U.placement;if(!M)switch(p){case"bestFit":{var T;const O=(T=I.map(j=>[j.placement,j.overflows.filter(P=>P>0).reduce((P,$)=>P+$,0)]).sort((j,P)=>j[1]-P[1])[0])==null?void 0:T[0];O&&(M=O);break}case"initialPlacement":M=s}if(r!==M)return{reset:{placement:M}}}return{}}}},R2=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:c}=i,d=await(l.isRTL==null?void 0:l.isRTL(c.floating)),f=Cr(a),p=ys(a),h=_s(a)==="x",v=["left","top"].includes(f)?-1:1,E=d&&h?-1:1,y=typeof s=="function"?s(i):s;let{mainAxis:g,crossAxis:m,alignmentAxis:_}=typeof y=="number"?{mainAxis:y,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...y};return p&&typeof _=="number"&&(m=p==="end"?-1*_:_),h?{x:m*E,y:g*v}:{x:g*v,y:m*E}}(t,e);return{x:n+o.x,y:r+o.y,data:o}}}};function N2(e){return e==="x"?"y":"x"}const w2=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:g,y:m}=y;return{x:g,y:m}}},...l}=e,c={x:n,y:r},d=await qy(t,l),f=_s(Cr(o)),p=N2(f);let h=c[f],v=c[p];if(i){const y=f==="y"?"bottom":"right";h=gf(h+d[f==="y"?"top":"left"],h,h-d[y])}if(s){const y=p==="y"?"bottom":"right";v=gf(v+d[p==="y"?"top":"left"],v,v-d[y])}const E=a.fn({...t,[f]:h,[p]:v});return{...E,data:{x:E.x-n,y:E.y-r}}}}};function mt(e){var t;return((t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ln(e){return mt(e).getComputedStyle(e)}const Zy=Math.min,Ss=Math.max,Cl=Math.round;function e0(e){const t=ln(e);let n=parseFloat(t.width),r=parseFloat(t.height);const o=e.offsetWidth,i=e.offsetHeight,s=Cl(n)!==o||Cl(r)!==i;return s&&(n=o,r=i),{width:n,height:r,fallback:s}}function rr(e){return n0(e)?(e.nodeName||"").toLowerCase():""}let Ll;function t0(){if(Ll)return Ll;const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?(Ll=e.brands.map(t=>t.brand+"/"+t.version).join(" "),Ll):navigator.userAgent}function cn(e){return e instanceof mt(e).HTMLElement}function Gt(e){return e instanceof mt(e).Element}function n0(e){return e instanceof mt(e).Node}function r0(e){return typeof ShadowRoot>"u"?!1:e instanceof mt(e).ShadowRoot||e instanceof ShadowRoot}function Dl(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=ln(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function O2(e){return["table","td","th"].includes(rr(e))}function vf(e){const t=/firefox/i.test(t0()),n=ln(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 Ef(){return/^((?!chrome|android).)*safari/i.test(t0())}function yf(e){return["html","body","#document"].includes(rr(e))}function o0(e){return Gt(e)?e:e.contextElement}const i0={x:1,y:1};function zo(e){const t=o0(e);if(!cn(t))return i0;const n=t.getBoundingClientRect(),{width:r,height:o,fallback:i}=e0(t);let s=(i?Cl(n.width):n.width)/r,a=(i?Cl(n.height):n.height)/o;return s&&Number.isFinite(s)||(s=1),a&&Number.isFinite(a)||(a=1),{x:s,y:a}}function Lr(e,t,n,r){var o,i;t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),a=o0(e);let l=i0;t&&(r?Gt(r)&&(l=zo(r)):l=zo(e));const c=a?mt(a):window,d=Ef()&&n;let f=(s.left+(d&&((o=c.visualViewport)==null?void 0:o.offsetLeft)||0))/l.x,p=(s.top+(d&&((i=c.visualViewport)==null?void 0:i.offsetTop)||0))/l.y,h=s.width/l.x,v=s.height/l.y;if(a){const E=mt(a),y=r&&Gt(r)?mt(r):r;let g=E.frameElement;for(;g&&r&&y!==E;){const m=zo(g),_=g.getBoundingClientRect(),S=getComputedStyle(g);_.x+=(g.clientLeft+parseFloat(S.paddingLeft))*m.x,_.y+=(g.clientTop+parseFloat(S.paddingTop))*m.y,f*=m.x,p*=m.y,h*=m.x,v*=m.y,f+=_.x,p+=_.y,g=mt(g).frameElement}}return{width:h,height:v,top:p,right:f+h,bottom:p+v,left:f,x:f,y:p}}function or(e){return((n0(e)?e.ownerDocument:e.document)||window.document).documentElement}function kl(e){return Gt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function s0(e){return Lr(or(e)).left+kl(e).scrollLeft}function xs(e){if(rr(e)==="html")return e;const t=e.assignedSlot||e.parentNode||r0(e)&&e.host||or(e);return r0(t)?t.host:t}function a0(e){const t=xs(e);return yf(t)?t.ownerDocument.body:cn(t)&&Dl(t)?t:a0(t)}function ir(e,t){var n;t===void 0&&(t=[]);const r=a0(e),o=r===((n=e.ownerDocument)==null?void 0:n.body),i=mt(r);return o?t.concat(i,i.visualViewport||[],Dl(r)?r:[]):t.concat(r,ir(r))}function l0(e,t,n){let r;if(t==="viewport")r=function(s,a){const l=mt(s),c=or(s),d=l.visualViewport;let f=c.clientWidth,p=c.clientHeight,h=0,v=0;if(d){f=d.width,p=d.height;const E=Ef();(!E||E&&a==="fixed")&&(h=d.offsetLeft,v=d.offsetTop)}return{width:f,height:p,x:h,y:v}}(e,n);else if(t==="document")r=function(s){const a=or(s),l=kl(s),c=s.ownerDocument.body,d=Ss(a.scrollWidth,a.clientWidth,c.scrollWidth,c.clientWidth),f=Ss(a.scrollHeight,a.clientHeight,c.scrollHeight,c.clientHeight);let p=-l.scrollLeft+s0(s);const h=-l.scrollTop;return ln(c).direction==="rtl"&&(p+=Ss(a.clientWidth,c.clientWidth)-d),{width:d,height:f,x:p,y:h}}(or(e));else if(Gt(t))r=function(s,a){const l=Lr(s,!0,a==="fixed"),c=l.top+s.clientTop,d=l.left+s.clientLeft,f=cn(s)?zo(s):{x:1,y:1};return{width:s.clientWidth*f.x,height:s.clientHeight*f.y,x:d*f.x,y:c*f.y}}(t,n);else{const s={...t};if(Ef()){var o,i;const a=mt(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 hf(r)}function c0(e,t){return cn(e)&&ln(e).position!=="fixed"?t?t(e):e.offsetParent:null}function u0(e,t){const n=mt(e);let r=c0(e,t);for(;r&&O2(r)&&ln(r).position==="static";)r=c0(r,t);return r&&(rr(r)==="html"||rr(r)==="body"&&ln(r).position==="static"&&!vf(r))?n:r||function(o){let i=xs(o);for(;cn(i)&&!yf(i);){if(vf(i))return i;i=xs(i)}return null}(e)||n}function T2(e,t,n){const r=cn(t),o=or(t),i=Lr(e,!0,n==="fixed",t);let s={scrollLeft:0,scrollTop:0};const a={x:0,y:0};if(r||!r&&n!=="fixed")if((rr(t)!=="body"||Dl(o))&&(s=kl(t)),cn(t)){const l=Lr(t,!0);a.x=l.x+t.clientLeft,a.y=l.y+t.clientTop}else o&&(a.x=s0(o));return{x:i.left+s.scrollLeft-a.x,y:i.top+s.scrollTop-a.y,width:i.width,height:i.height}}const A2={getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=n==="clippingAncestors"?function(c,d){const f=d.get(c);if(f)return f;let p=ir(c).filter(y=>Gt(y)&&rr(y)!=="body"),h=null;const v=ln(c).position==="fixed";let E=v?xs(c):c;for(;Gt(E)&&!yf(E);){const y=ln(E),g=vf(E);y.position==="fixed"?h=null:(v?g||h:g||y.position!=="static"||!h||!["absolute","fixed"].includes(h.position))?h=y:p=p.filter(m=>m!==E),E=xs(E)}return d.set(c,p),p}(t,this._c):[].concat(n),s=[...i,r],a=s[0],l=s.reduce((c,d)=>{const f=l0(t,d,o);return c.top=Ss(f.top,c.top),c.right=Zy(f.right,c.right),c.bottom=Zy(f.bottom,c.bottom),c.left=Ss(f.left,c.left),c},l0(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=cn(n),i=or(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")&&((rr(n)!=="body"||Dl(i))&&(s=kl(n)),cn(n))){const c=Lr(n);a=zo(n),l.x=c.x+n.clientLeft,l.y=c.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:Gt,getDimensions:function(e){return cn(e)?e0(e):e.getBoundingClientRect()},getOffsetParent:u0,getDocumentElement:or,getScale:zo,async getElementRects(e){let{reference:t,floating:n,strategy:r}=e;const o=this.getOffsetParent||u0,i=this.getDimensions;return{reference:T2(t,await o(n),r),floating:{x:0,y:0,...await i(n)}}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>ln(e).direction==="rtl"};function I2(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,c=l||i?[...Gt(e)?ir(e):e.contextElement?ir(e.contextElement):[],...ir(t)]:[];c.forEach(h=>{l&&h.addEventListener("scroll",n,{passive:!0}),i&&h.addEventListener("resize",n)});let d,f=null;if(s){let h=!0;f=new ResizeObserver(()=>{h||n(),h=!1}),Gt(e)&&!a&&f.observe(e),Gt(e)||!e.contextElement||a||f.observe(e.contextElement),f.observe(t)}let p=a?Lr(e):null;return a&&function h(){const v=Lr(e);!p||v.x===p.x&&v.y===p.y&&v.width===p.width&&v.height===p.height||n(),p=v,d=requestAnimationFrame(h)}(),n(),()=>{var h;c.forEach(v=>{l&&v.removeEventListener("scroll",n),i&&v.removeEventListener("resize",n)}),(h=f)==null||h.disconnect(),f=null,a&&cancelAnimationFrame(d)}}const b2=(e,t,n)=>{const r=new Map,o={platform:A2,...n},i={...o.platform,_c:r};return m2(e,t,{...o,platform:i})},C2=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?Jy({element:t.current,padding:n}).fn(o):{}:t?Jy({element:t,padding:n}).fn(o):{}}}};var Pl=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 d0(e){const t=N.useRef(e);return Pl(()=>{t.current=e}),t}function L2(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}),[c,d]=N.useState(r);Ml(c,r)||d(r);const f=N.useRef(null),p=N.useRef(null),h=N.useRef(a),v=d0(i),E=d0(o),[y,g]=N.useState(null),[m,_]=N.useState(null),S=N.useCallback(T=>{f.current!==T&&(f.current=T,g(T))},[]),x=N.useCallback(T=>{p.current!==T&&(p.current=T,_(T))},[]),R=N.useCallback(()=>{if(!f.current||!p.current)return;const T={placement:t,strategy:n,middleware:c};E.current&&(T.platform=E.current),b2(f.current,p.current,T).then(b=>{const V={...b,isPositioned:!0};I.current&&!Ml(h.current,V)&&(h.current=V,xo.flushSync(()=>{l(V)}))})},[c,t,n,E]);Pl(()=>{s===!1&&h.current.isPositioned&&(h.current.isPositioned=!1,l(T=>({...T,isPositioned:!1})))},[s]);const I=N.useRef(!1);Pl(()=>(I.current=!0,()=>{I.current=!1}),[]),Pl(()=>{if(y&&m){if(v.current)return v.current(y,m,R);R()}},[y,m,R,v]);const L=N.useMemo(()=>({reference:f,floating:p,setReference:S,setFloating:x}),[S,x]),U=N.useMemo(()=>({reference:y,floating:m}),[y,m]);return N.useMemo(()=>({...a,update:R,refs:L,elements:U,reference:S,floating:x}),[a,R,L,U,S,x])}var Dr=typeof document<"u"?N.useLayoutEffect:N.useEffect;let _f=!1,D2=0;const f0=()=>"floating-ui-"+D2++;function k2(){const[e,t]=N.useState(()=>_f?f0():void 0);return Dr(()=>{e==null&&t(f0())},[]),N.useEffect(()=>{_f||(_f=!0)},[]),e}const Sf=lp["useId".toString()]||k2;function P2(){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 M2=N.createContext(null),j2=N.createContext(null),p0=()=>{var e;return((e=N.useContext(M2))==null?void 0:e.id)||null},xf=()=>N.useContext(j2);function Tn(e){return(e==null?void 0:e.ownerDocument)||document}function h0(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function U2(){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 Rf(e){return Tn(e).defaultView||window}function Yt(e){return e?e instanceof Rf(e).Element:!1}function g0(e){return e?e instanceof Rf(e).HTMLElement:!1}function F2(e){if(typeof ShadowRoot>"u")return!1;const t=Rf(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function V2(e){if(e.mozInputSource===0&&e.isTrusted)return!0;const t=/Android/i;return(t.test(h0())||t.test(U2()))&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function $2(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 m0(){return/apple/i.test(navigator.vendor)}function B2(){return h0().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function v0(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function E0(e){const t=N.useRef(e);return Dr(()=>{t.current=e}),t}const y0="data-floating-ui-safe-polygon";function Nf(e,t,n){return n&&!v0(n)?0:typeof e=="number"?e:e==null?void 0:e[t]}const H2=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:c,dataRef:d,events:f,elements:{domReference:p,floating:h},refs:v}=e,E=xf(),y=p0(),g=E0(o),m=E0(r),_=N.useRef(),S=N.useRef(),x=N.useRef(),R=N.useRef(),I=N.useRef(!0),L=N.useRef(!1),U=N.useRef(()=>{}),T=N.useCallback(()=>{var O;const j=(O=d.current.openEvent)==null?void 0:O.type;return(j==null?void 0:j.includes("mouse"))&&j!=="mousedown"},[d]);N.useEffect(()=>{if(!n)return;function O(){clearTimeout(S.current),clearTimeout(R.current),I.current=!0}return f.on("dismiss",O),()=>{f.off("dismiss",O)}},[n,f]),N.useEffect(()=>{if(!n||!g.current||!l)return;function O(){T()&&c(!1)}const j=Tn(h).documentElement;return j.addEventListener("mouseleave",O),()=>{j.removeEventListener("mouseleave",O)}},[h,l,c,n,g,d,T]);const b=N.useCallback(function(O){O===void 0&&(O=!0);const j=Nf(m.current,"close",_.current);j&&!x.current?(clearTimeout(S.current),S.current=setTimeout(()=>c(!1),j)):O&&(clearTimeout(S.current),c(!1))},[m,c]),V=N.useCallback(()=>{U.current(),x.current=void 0},[]),M=N.useCallback(()=>{if(L.current){const O=Tn(v.floating.current).body;O.style.pointerEvents="",O.removeAttribute(y0),L.current=!1}},[v]);return N.useEffect(()=>{if(!n)return;function O(){return d.current.openEvent?["click","mousedown"].includes(d.current.openEvent.type):!1}function j(D){if(clearTimeout(S.current),I.current=!1,i&&!v0(_.current)||s>0&&Nf(m.current,"open")===0)return;d.current.openEvent=D;const C=Nf(m.current,"open",_.current);C?S.current=setTimeout(()=>{c(!0)},C):c(!0)}function P(D){if(O())return;U.current();const C=Tn(h);if(clearTimeout(R.current),g.current){l||clearTimeout(S.current),x.current=g.current({...e,tree:E,x:D.clientX,y:D.clientY,onClose(){M(),V(),b()}});const k=x.current;C.addEventListener("mousemove",k),U.current=()=>{C.removeEventListener("mousemove",k)};return}b()}function $(D){O()||g.current==null||g.current({...e,tree:E,x:D.clientX,y:D.clientY,onClose(){M(),V(),b()}})(D)}if(Yt(p)){const D=p;return l&&D.addEventListener("mouseleave",$),h==null||h.addEventListener("mouseleave",$),a&&D.addEventListener("mousemove",j,{once:!0}),D.addEventListener("mouseenter",j),D.addEventListener("mouseleave",P),()=>{l&&D.removeEventListener("mouseleave",$),h==null||h.removeEventListener("mouseleave",$),a&&D.removeEventListener("mousemove",j),D.removeEventListener("mouseenter",j),D.removeEventListener("mouseleave",P)}}},[p,h,n,e,i,s,a,b,V,M,c,l,E,m,g,d]),Dr(()=>{var O;if(n&&l&&(O=g.current)!=null&&O.__options.blockPointerEvents&&T()){const $=Tn(h).body;if($.setAttribute(y0,""),$.style.pointerEvents="none",L.current=!0,Yt(p)&&h){var j,P;const D=p,C=E==null||(j=E.nodesRef.current.find(k=>k.id===y))==null||(P=j.context)==null?void 0:P.elements.floating;return C&&(C.style.pointerEvents=""),D.style.pointerEvents="auto",h.style.pointerEvents="auto",()=>{D.style.pointerEvents="",h.style.pointerEvents=""}}}},[n,l,y,h,p,E,g,d,T]),Dr(()=>{l||(_.current=void 0,V(),M())},[l,V,M]),N.useEffect(()=>()=>{V(),clearTimeout(S.current),clearTimeout(R.current),M()},[n,V,M]),N.useMemo(()=>{if(!n)return{};function O(j){_.current=j.pointerType}return{reference:{onPointerDown:O,onPointerEnter:O,onMouseMove(){l||s===0||(clearTimeout(R.current),R.current=setTimeout(()=>{I.current||c(!0)},s))}},floating:{onMouseEnter(){clearTimeout(S.current)},onMouseLeave(){f.emit("dismiss",{type:"mouseLeave",data:{returnFocus:!1}}),b(!1)}}}},[f,n,s,l,c,b])};function wf(){return wf=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},wf.apply(this,arguments)}function _0(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 Wo(e,t){if(!e||!t)return!1;const n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&F2(n)){let r=t;do{if(r&&e===r)return!0;r=r.parentNode||r.host}while(r)}return!1}function jl(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 S0(e){return"composedPath"in e?e.composedPath()[0]:e.target}const x0=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function R0(e,t){const n=Ky(e,x0());t==="prev"&&n.reverse();const r=n.indexOf(_0(Tn(e)));return n.slice(r+1)[0]}function z2(){return R0(document.body,"next")}function W2(){return R0(document.body,"prev")}function Of(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!Wo(n,r)}function G2(e){Ky(e,x0()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function Y2(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 K2=lp["useInsertionEffect".toString()]||(e=>e());function Tf(e){const t=N.useRef(()=>{});return K2(()=>{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 N0={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 Af,If;function w0(e){e.key==="Tab"&&(Af=e.target,clearTimeout(If))}function Q2(e){const t=Af===e.relatedTarget;return Af=e.relatedTarget,clearTimeout(If),t}const O0=N.forwardRef(function(t,n){const r=Tf(t.onFocus),[o,i]=N.useState();return Dr(()=>(m0()&&i("button"),document.addEventListener("keydown",w0),()=>{document.removeEventListener("keydown",w0)}),[]),N.createElement("span",wf({},t,{ref:n,tabIndex:0,role:o,"aria-hidden":o?void 0:!0,"data-floating-ui-focus-guard":"",style:N0,onFocus:s=>{m0()&&B2()&&!Q2(s)?(s.persist(),If=window.setTimeout(()=>{r(s)},50)):r(s)}}))}),T0=N.createContext(null),X2=function(e){let{id:t,enabled:n=!0}=e===void 0?{}:e;const[r,o]=N.useState(null),i=Sf(),s=q2();return Dr(()=>{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 c=(s==null?void 0:s.portalNode)||document.body;return c.appendChild(l),()=>{c.removeChild(l)}}},[t,s,i,n]),r},A0=e=>{let{children:t,id:n,root:r=null,preserveTabOrder:o=!0}=e;const i=X2({id:n,enabled:!r}),[s,a]=N.useState(null),l=N.useRef(null),c=N.useRef(null),d=N.useRef(null),f=N.useRef(null),p=!!s&&!s.modal&&!!(r||i)&&o;return N.useEffect(()=>{if(!i||!o||s!=null&&s.modal)return;function h(v){i&&Of(v)&&(v.type==="focusin"?Y2:G2)(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(T0.Provider,{value:N.useMemo(()=>({preserveTabOrder:o,beforeOutsideRef:l,afterOutsideRef:c,beforeInsideRef:d,afterInsideRef:f,portalNode:i,setFocusManagerState:a}),[o,i])},p&&i&&N.createElement(O0,{"data-type":"outside",ref:l,onFocus:h=>{if(Of(h,i)){var v;(v=d.current)==null||v.focus()}else{const E=W2()||(s==null?void 0:s.refs.domReference.current);E==null||E.focus()}}}),p&&i&&N.createElement("span",{"aria-owns":i.id,style:N0}),r?xo.createPortal(t,r):i?xo.createPortal(t,i):null,p&&i&&N.createElement(O0,{"data-type":"outside",ref:c,onFocus:h=>{if(Of(h,i)){var v;(v=f.current)==null||v.focus()}else{const E=z2()||(s==null?void 0:s.refs.domReference.current);E==null||E.focus(),s!=null&&s.closeOnFocusOut&&(s==null||s.onOpenChange(!1))}}}))},q2=()=>N.useContext(T0);function Ul(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 J2={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},Z2={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},eC=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}},tC=function(e,t){let{open:n,onOpenChange:r,events:o,nodeId:i,elements:{reference:s,domReference:a,floating:l},dataRef:c}=e,{enabled:d=!0,escapeKey:f=!0,outsidePress:p=!0,outsidePressEvent:h="pointerdown",referencePress:v=!1,referencePressEvent:E="pointerdown",ancestorScroll:y=!1,bubbles:g=!0}=t===void 0?{}:t;const m=xf(),_=p0()!=null,S=Tf(typeof p=="function"?p:()=>!1),x=typeof p=="function"?S:p,R=N.useRef(!1),{escapeKeyBubbles:I,outsidePressBubbles:L}=eC(g);return N.useEffect(()=>{if(!n||!d)return;c.current.__escapeKeyBubbles=I,c.current.__outsidePressBubbles=L;function U(O){if(O.key==="Escape"){const j=m?jl(m.nodesRef.current,i):[];if(j.length>0){let P=!0;if(j.forEach($=>{var D;if((D=$.context)!=null&&D.open&&!$.context.dataRef.current.__escapeKeyBubbles){P=!1;return}}),!P)return}o.emit("dismiss",{type:"escapeKey",data:{returnFocus:{preventScroll:!1}}}),r(!1)}}function T(O){const j=R.current;if(R.current=!1,j||typeof x=="function"&&!x(O))return;const P=S0(O);if(g0(P)&&l){const C=l.ownerDocument.defaultView||window,k=P.scrollWidth>P.clientWidth,F=P.scrollHeight>P.clientHeight;let B=F&&O.offsetX>P.clientWidth;if(F&&C.getComputedStyle(P).direction==="rtl"&&(B=O.offsetX<=P.offsetWidth-P.clientWidth),B||k&&O.offsetY>P.clientHeight)return}const $=m&&jl(m.nodesRef.current,i).some(C=>{var k;return Ul(O,(k=C.context)==null?void 0:k.elements.floating)});if(Ul(O,l)||Ul(O,a)||$)return;const D=m?jl(m.nodesRef.current,i):[];if(D.length>0){let C=!0;if(D.forEach(k=>{var F;if((F=k.context)!=null&&F.open&&!k.context.dataRef.current.__outsidePressBubbles){C=!1;return}}),!C)return}o.emit("dismiss",{type:"outsidePress",data:{returnFocus:_?{preventScroll:!0}:V2(O)||$2(O)}}),r(!1)}function b(){r(!1)}const V=Tn(l);f&&V.addEventListener("keydown",U),x&&V.addEventListener(h,T);let M=[];return y&&(Yt(a)&&(M=ir(a)),Yt(l)&&(M=M.concat(ir(l))),!Yt(s)&&s&&s.contextElement&&(M=M.concat(ir(s.contextElement)))),M=M.filter(O=>{var j;return O!==((j=V.defaultView)==null?void 0:j.visualViewport)}),M.forEach(O=>{O.addEventListener("scroll",b,{passive:!0})}),()=>{f&&V.removeEventListener("keydown",U),x&&V.removeEventListener(h,T),M.forEach(O=>{O.removeEventListener("scroll",b)})}},[c,l,a,s,f,x,h,o,m,i,n,r,y,d,I,L,_]),N.useEffect(()=>{R.current=!1},[x,h]),N.useMemo(()=>d?{reference:{[J2[E]]:()=>{v&&(o.emit("dismiss",{type:"referencePress",data:{returnFocus:!1}}),r(!1))}},floating:{[Z2[h]]:()=>{R.current=!0}}}:{},[d,o,v,h,E,r])},nC=function(e,t){let{open:n,onOpenChange:r,dataRef:o,events:i,refs:s,elements:{floating:a,domReference:l}}=e,{enabled:c=!0,keyboardOnly:d=!0}=t===void 0?{}:t;const f=N.useRef(""),p=N.useRef(!1),h=N.useRef();return N.useEffect(()=>{if(!c)return;const E=Tn(a).defaultView||window;function y(){!n&&g0(l)&&l===_0(Tn(l))&&(p.current=!0)}return E.addEventListener("blur",y),()=>{E.removeEventListener("blur",y)}},[a,l,n,c]),N.useEffect(()=>{if(!c)return;function v(E){(E.type==="referencePress"||E.type==="escapeKey")&&(p.current=!0)}return i.on("dismiss",v),()=>{i.off("dismiss",v)}},[i,c]),N.useEffect(()=>()=>{clearTimeout(h.current)},[]),N.useMemo(()=>c?{reference:{onPointerDown(v){let{pointerType:E}=v;f.current=E,p.current=!!(E&&d)},onMouseLeave(){p.current=!1},onFocus(v){var E;p.current||v.type==="focus"&&((E=o.current.openEvent)==null?void 0:E.type)==="mousedown"&&o.current.openEvent&&Ul(o.current.openEvent,l)||(o.current.openEvent=v.nativeEvent,r(!0))},onBlur(v){p.current=!1;const E=v.relatedTarget,y=Yt(E)&&E.hasAttribute("data-floating-ui-focus-guard")&&E.getAttribute("data-type")==="outside";h.current=setTimeout(()=>{Wo(s.floating.current,E)||Wo(l,E)||y||r(!1)})}}}:{},[c,d,l,s,o,r])};function I0(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 rC=function(e,t){let{open:n}=e,{enabled:r=!0,role:o="dialog"}=t===void 0?{}:t;const i=Sf(),s=Sf();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 oC(e,t){const[n,r]=e;let o=!1;const i=t.length;for(let s=0,a=i-1;s<i;a=s++){const[l,c]=t[s]||[0,0],[d,f]=t[a]||[0,0];c>=r!=f>=r&&n<=(d-l)*(r-c)/(f-c)+l&&(o=!o)}return o}function iC(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}function sC(e){let{restMs:t=0,buffer:n=.5,blockPointerEvents:r=!1}=e===void 0?{}:e,o,i=!1,s=!1;const a=l=>{let{x:c,y:d,placement:f,elements:p,onClose:h,nodeId:v,tree:E}=l;return function(g){function m(){clearTimeout(o),h()}if(clearTimeout(o),!p.domReference||!p.floating||f==null||c==null||d==null)return;const{clientX:_,clientY:S}=g,x=[_,S],R=S0(g),I=g.type==="mouseleave",L=Wo(p.floating,R),U=Wo(p.domReference,R),T=p.domReference.getBoundingClientRect(),b=p.floating.getBoundingClientRect(),V=f.split("-")[0],M=c>b.right-b.width/2,O=d>b.bottom-b.height/2,j=iC(x,T);if(L&&(s=!0,!I))return;if(U&&(s=!1),U&&!I){s=!0;return}if(I&&Yt(g.relatedTarget)&&Wo(p.floating,g.relatedTarget)||E&&jl(E.nodesRef.current,v).some(C=>{let{context:k}=C;return k==null?void 0:k.open}))return;if(V==="top"&&d>=T.bottom-1||V==="bottom"&&d<=T.top+1||V==="left"&&c>=T.right-1||V==="right"&&c<=T.left+1)return m();let P=[];switch(V){case"top":P=[[b.left,T.top+1],[b.left,b.bottom-1],[b.right,b.bottom-1],[b.right,T.top+1]],i=_>=b.left&&_<=b.right&&S>=b.top&&S<=T.top+1;break;case"bottom":P=[[b.left,b.top+1],[b.left,T.bottom-1],[b.right,T.bottom-1],[b.right,b.top+1]],i=_>=b.left&&_<=b.right&&S>=T.bottom-1&&S<=b.bottom;break;case"left":P=[[b.right-1,b.bottom],[b.right-1,b.top],[T.left+1,b.top],[T.left+1,b.bottom]],i=_>=b.left&&_<=T.left+1&&S>=b.top&&S<=b.bottom;break;case"right":P=[[T.right-1,b.bottom],[T.right-1,b.top],[b.left+1,b.top],[b.left+1,b.bottom]],i=_>=T.right-1&&_<=b.right&&S>=b.top&&S<=b.bottom;break}function $(C){let[k,F]=C;const B=b.width>T.width,z=b.height>T.height;switch(V){case"top":{const W=[B?k+n/2:M?k+n*4:k-n*4,F+n+1],X=[B?k-n/2:M?k+n*4:k-n*4,F+n+1],Q=[[b.left,M||B?b.bottom-n:b.top],[b.right,M?B?b.bottom-n:b.top:b.bottom-n]];return[W,X,...Q]}case"bottom":{const W=[B?k+n/2:M?k+n*4:k-n*4,F-n],X=[B?k-n/2:M?k+n*4:k-n*4,F-n],Q=[[b.left,M||B?b.top+n:b.bottom],[b.right,M?B?b.top+n:b.bottom:b.top+n]];return[W,X,...Q]}case"left":{const W=[k+n+1,z?F+n/2:O?F+n*4:F-n*4],X=[k+n+1,z?F-n/2:O?F+n*4:F-n*4];return[...[[O||z?b.right-n:b.left,b.top],[O?z?b.right-n:b.left:b.right-n,b.bottom]],W,X]}case"right":{const W=[k-n,z?F+n/2:O?F+n*4:F-n*4],X=[k-n,z?F-n/2:O?F+n*4:F-n*4],Q=[[O||z?b.left+n:b.right,b.top],[O?z?b.left+n:b.right:b.left+n,b.bottom]];return[W,X,...Q]}}}const D=i?P:$([c,d]);if(!i){if(s&&!j)return m();oC([_,S],D)?t&&!s&&(o=setTimeout(m,t)):m()}}};return a.__options={blockPointerEvents:r},a}function aC(e){e===void 0&&(e={});const{open:t=!1,onOpenChange:n,nodeId:r}=e,o=L2(e),i=xf(),s=N.useRef(null),a=N.useRef({}),l=N.useState(()=>P2())[0],[c,d]=N.useState(null),f=N.useCallback(g=>{const m=Yt(g)?{getBoundingClientRect:()=>g.getBoundingClientRect(),contextElement:g}:g;o.refs.setReference(m)},[o.refs]),p=N.useCallback(g=>{(Yt(g)||g===null)&&(s.current=g,d(g)),(Yt(o.refs.reference.current)||o.refs.reference.current===null||g!==null&&!Yt(g))&&o.refs.setReference(g)},[o.refs]),h=N.useMemo(()=>({...o.refs,setReference:p,setPositionReference:f,domReference:s}),[o.refs,p,f]),v=N.useMemo(()=>({...o.elements,domReference:c}),[o.elements,c]),E=Tf(n),y=N.useMemo(()=>({...o,refs:h,elements:v,dataRef:a,nodeId:r,events:l,open:t,onOpenChange:E}),[o,r,l,t,E,h,v]);return Dr(()=>{const g=i==null?void 0:i.nodesRef.current.find(m=>m.id===r);g&&(g.context=y)}),N.useMemo(()=>({...o,context:y,refs:h,reference:p,positionReference:f}),[o,h,y,p,f])}function bf(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 c;(c=r.get(a))==null||c.push(l),o[a]=function(){for(var d,f=arguments.length,p=new Array(f),h=0;h<f;h++)p[h]=arguments[h];(d=r.get(a))==null||d.forEach(v=>v(...p))}}}else o[a]=l}),o),{})}}const lC=function(e){e===void 0&&(e=[]);const t=e,n=N.useCallback(i=>bf(i,e,"reference"),t),r=N.useCallback(i=>bf(i,e,"floating"),t),o=N.useCallback(i=>bf(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 cC({arrowPadding:e,escapeKey:t=!0,initialOpen:n=!1,keepOpenOverContent:r=!1,onOpenChange:o,open:i,outsidePress:s=!0,placement:a,role:l="tooltip"}){const c=Y(R=>R.rootElementId),d=N.useRef(null),[f,p]=N.useState(n),h=i??f,v=o??p,E=aC({middleware:[R2(8),x2({boundary:document.querySelector(`#${c}`)||void 0}),w2({padding:4}),C2({element:d,padding:e??{bottom:0,left:8,right:8,top:8}})],onOpenChange:v,open:h,placement:a,strategy:"fixed",whileElementsMounted:I2}),y=E.context,g=H2(y,{enabled:i==null,handleClose:r?sC():null,move:!1}),m=nC(y,{enabled:i==null}),_=tC(y,{escapeKey:t,outsidePress:s}),S=rC(y,{role:l}),x=lC([g,m,_,S]);return N.useMemo(()=>({arrowRef:d,open:h,setOpen:v,...x,...E}),[h,v,x,E])}const b0=Wr.createContext(null),Cf=()=>{const e=Wr.useContext(b0);if(e==null)throw new Error("Tooltip components must be wrapped in <Tooltip />");return e},uC=({children:e,...t})=>{const n=cC(t);return u.jsx(b0.Provider,{value:n,children:e})},dC={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",top:"-bottom-1 before:border-t-0 before:border-l-0"},fC=()=>{var s,a;const e=Cf(),[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=`${dC[o]}`;return u.jsx("div",{ref:e.arrowRef,style:r,className:`tooltip-arrow absolute h-2 w-2 rotate-45 bg-inherit
65
+ */var Zb=["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])"],hf=Zb.join(","),By=typeof Element>"u",vs=By?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,bl=!By&&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},Cl=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},e2=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},t2=function(t,n,r){if(Cl(t))return[];var o=Array.prototype.slice.apply(t.querySelectorAll(hf));return n&&vs.call(t,hf)&&o.unshift(t),o=o.filter(r),o},n2=function e(t,n,r){for(var o=[],i=Array.from(t);i.length;){var s=i.shift();if(!Cl(s,!1))if(s.tagName==="SLOT"){var a=s.assignedElements(),l=a.length?a:s.children,c=e(l,!0,r);r.flatten?o.push.apply(o,c):o.push({scopeParent:s,candidates:c})}else{var d=vs.call(s,hf);d&&r.filter(s)&&(n||!t.includes(s))&&o.push(s);var f=s.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(s),p=!Cl(f,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(s));if(f&&p){var h=e(f===!0?s.children:f.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},Hy=function(t,n){return t.tabIndex<0&&(n||/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||e2(t))&&isNaN(parseInt(t.getAttribute("tabindex"),10))?0:t.tabIndex},r2=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},zy=function(t){return t.tagName==="INPUT"},o2=function(t){return zy(t)&&t.type==="hidden"},i2=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},s2=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},a2=function(t){if(!t.name)return!0;var n=t.form||bl(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=s2(o,t.form);return!i||i===t},l2=function(t){return zy(t)&&t.type==="radio"},c2=function(t){return l2(t)&&!a2(t)},u2=function(t){var n,r=t&&bl(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 c,d,f;r=bl(o),o=(c=r)===null||c===void 0?void 0:c.host,i=!!((d=o)!==null&&d!==void 0&&(f=d.ownerDocument)!==null&&f!==void 0&&f.contains(o))}}return i},Wy=function(t){var n=t.getBoundingClientRect(),r=n.width,o=n.height;return r===0&&o===0},d2=function(t,n){var r=n.displayCheck,o=n.getShadowRoot;if(getComputedStyle(t).visibility==="hidden")return!0;var i=vs.call(t,"details>summary:first-of-type"),s=i?t.parentElement:t;if(vs.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,c=bl(t);if(l&&!l.shadowRoot&&o(l)===!0)return Wy(t);t.assignedSlot?t=t.assignedSlot:!l&&c!==t.ownerDocument?t=c.host:t=l}t=a}if(u2(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return Wy(t);return!1},f2=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 vs.call(n,"fieldset[disabled] *")?!0:!o.contains(t)}return!0}n=n.parentElement}return!1},p2=function(t,n){return!(n.disabled||Cl(n)||o2(n)||d2(n,t)||i2(n)||f2(n))},Gy=function(t,n){return!(c2(n)||Hy(n)<0||!p2(t,n))},h2=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},g2=function e(t){var n=[],r=[];return t.forEach(function(o,i){var s=!!o.scopeParent,a=s?o.scopeParent:o,l=Hy(a,s),c=s?e(o.candidates):a;l===0?s?n.push.apply(n,c):n.push(a):r.push({documentOrder:i,tabIndex:l,item:o,isScope:s,content:c})}),r.sort(r2).reduce(function(o,i){return i.isScope?o.push.apply(o,i.content):o.push(i.content),o},[]).concat(n)},Yy=function(t,n){n=n||{};var r;return n.getShadowRoot?r=n2([t],n.includeContainer,{filter:Gy.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:h2}):r=t2(t,n.includeContainer,Gy.bind(null,n)),g2(r)};function ys(e){return e.split("-")[1]}function gf(e){return e==="y"?"height":"width"}function Cr(e){return e.split("-")[0]}function _s(e){return["top","bottom"].includes(Cr(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=_s(t),l=gf(a),c=r[l]/2-o[l]/2,d=a==="x";let f;switch(Cr(t)){case"top":f={x:i,y:r.y-o.height};break;case"bottom":f={x:i,y:r.y+r.height};break;case"right":f={x:r.x+r.width,y:s};break;case"left":f={x:r.x-o.width,y:s};break;default:f={x:r.x,y:r.y}}switch(ys(t)){case"start":f[a]-=c*(n&&d?-1:1);break;case"end":f[a]+=c*(n&&d?-1:1)}return f}const m2=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 c=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:f}=Ky(c,r,l),p=r,h={},E=0;for(let v=0;v<a.length;v++){const{name:y,fn:g}=a[v],{x:m,y:_,data:S,reset:x}=await g({x:d,y:f,initialPlacement:r,placement:p,strategy:o,middlewareData:h,rects:c,platform:s,elements:{reference:e,floating:t}});d=m??d,f=_??f,h={...h,[y]:{...h[y],...S}},x&&E<=50&&(E++,typeof x=="object"&&(x.placement&&(p=x.placement),x.rects&&(c=x.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):x.rects),{x:d,y:f}=Ky(c,p,l)),v=-1)}return{x:d,y:f,placement:p,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 mf(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:c="clippingAncestors",rootBoundary:d="viewport",elementContext:f="floating",altBoundary:p=!1,padding:h=0}=t,E=Qy(h),v=a[p?f==="floating"?"reference":"floating":f],y=mf(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:c,rootBoundary:d,strategy:l})),g=f==="floating"?{...s.floating,x:r,y:o}:s.reference,m=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),_=await(i.isElement==null?void 0:i.isElement(m))&&await(i.getScale==null?void 0:i.getScale(m))||{x:1,y:1},S=mf(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({rect:g,offsetParent:m,strategy:l}):g);return{top:(y.top-S.top+E.top)/_.y,bottom:(S.bottom-y.bottom+E.bottom)/_.y,left:(y.left-S.left+E.left)/_.x,right:(S.right-y.right+E.right)/_.x}}const E2=Math.min,v2=Math.max;function Ef(e,t,n){return v2(e,E2(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 c=Qy(r),d={x:o,y:i},f=_s(s),p=gf(f),h=await l.getDimensions(n),E=f==="y"?"top":"left",v=f==="y"?"bottom":"right",y=a.reference[p]+a.reference[f]-d[f]-a.floating[p],g=d[f]-a.reference[f],m=await(l.getOffsetParent==null?void 0:l.getOffsetParent(n));let _=m?f==="y"?m.clientHeight||0:m.clientWidth||0:0;_===0&&(_=a.floating[p]);const S=y/2-g/2,x=c[E],R=_-h[p]-c[v],I=_/2-h[p]/2+S,L=Ef(x,I,R),U=ys(s)!=null&&I!=L&&a.reference[p]/2-(I<x?c[E]:c[v])-h[p]/2<0;return{[f]:d[f]-(U?I<x?x-I:R-I:0),data:{[f]:L,centerOffset:I-L}}}});["top","right","bottom","left"].reduce((e,t)=>e.concat(t,t+"-start",t+"-end"),[]);const y2={left:"right",right:"left",bottom:"top",top:"bottom"};function Ll(e){return e.replace(/left|right|bottom|top/g,t=>y2[t])}function _2(e,t,n){n===void 0&&(n=!1);const r=ys(e),o=_s(e),i=gf(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=Ll(s)),{main:s,cross:Ll(s)}}const S2={start:"end",end:"start"};function vf(e){return e.replace(/start|end/g,t=>S2[t])}const x2=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:c=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:E=!0,...v}=e,y=Cr(r),g=Cr(s)===s,m=await(a.isRTL==null?void 0:a.isRTL(l.floating)),_=f||(g||!E?[Ll(s)]:function(b){const V=Ll(b);return[vf(b),V,vf(V)]}(s));f||h==="none"||_.push(...function(b,V,M,O){const j=ys(b);let P=function($,D,C){const k=["left","right"],F=["right","left"],B=["top","bottom"],z=["bottom","top"];switch($){case"top":case"bottom":return C?D?F:k:D?k:F;case"left":case"right":return D?B:z;default:return[]}}(Cr(b),M==="start",O);return j&&(P=P.map($=>$+"-"+j),V&&(P=P.concat(P.map(vf)))),P}(s,E,h,m));const S=[s,..._],x=await Xy(t,v),R=[];let I=((n=o.flip)==null?void 0:n.overflows)||[];if(c&&R.push(x[y]),d){const{main:b,cross:V}=_2(r,i,m);R.push(x[b],x[V])}if(I=[...I,{placement:r,overflows:R}],!R.every(b=>b<=0)){var L,U;const b=(((L=o.flip)==null?void 0:L.index)||0)+1,V=S[b];if(V)return{data:{index:b,overflows:I},reset:{placement:V}};let M=(U=I.filter(O=>O.overflows[0]<=0).sort((O,j)=>O.overflows[1]-j.overflows[1])[0])==null?void 0:U.placement;if(!M)switch(p){case"bestFit":{var A;const O=(A=I.map(j=>[j.placement,j.overflows.filter(P=>P>0).reduce((P,$)=>P+$,0)]).sort((j,P)=>j[1]-P[1])[0])==null?void 0:A[0];O&&(M=O);break}case"initialPlacement":M=s}if(r!==M)return{reset:{placement:M}}}return{}}}},R2=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:c}=i,d=await(l.isRTL==null?void 0:l.isRTL(c.floating)),f=Cr(a),p=ys(a),h=_s(a)==="x",E=["left","top"].includes(f)?-1:1,v=d&&h?-1:1,y=typeof s=="function"?s(i):s;let{mainAxis:g,crossAxis:m,alignmentAxis:_}=typeof y=="number"?{mainAxis:y,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...y};return p&&typeof _=="number"&&(m=p==="end"?-1*_:_),h?{x:m*v,y:g*E}:{x:g*E,y:m*v}}(t,e);return{x:n+o.x,y:r+o.y,data:o}}}};function N2(e){return e==="x"?"y":"x"}const w2=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:g,y:m}=y;return{x:g,y:m}}},...l}=e,c={x:n,y:r},d=await Xy(t,l),f=_s(Cr(o)),p=N2(f);let h=c[f],E=c[p];if(i){const y=f==="y"?"bottom":"right";h=Ef(h+d[f==="y"?"top":"left"],h,h-d[y])}if(s){const y=p==="y"?"bottom":"right";E=Ef(E+d[p==="y"?"top":"left"],E,E-d[y])}const v=a.fn({...t,[f]:h,[p]:E});return{...v,data:{x:v.x-n,y:v.y-r}}}}};function Et(e){var t;return((t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ln(e){return Et(e).getComputedStyle(e)}const Jy=Math.min,Ss=Math.max,Dl=Math.round;function Zy(e){const t=ln(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 rr(e){return t0(e)?(e.nodeName||"").toLowerCase():""}let kl;function e0(){if(kl)return kl;const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?(kl=e.brands.map(t=>t.brand+"/"+t.version).join(" "),kl):navigator.userAgent}function cn(e){return e instanceof Et(e).HTMLElement}function Yt(e){return e instanceof Et(e).Element}function t0(e){return e instanceof Et(e).Node}function n0(e){return typeof ShadowRoot>"u"?!1:e instanceof Et(e).ShadowRoot||e instanceof ShadowRoot}function Pl(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=ln(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function O2(e){return["table","td","th"].includes(rr(e))}function yf(e){const t=/firefox/i.test(e0()),n=ln(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 _f(){return/^((?!chrome|android).)*safari/i.test(e0())}function Sf(e){return["html","body","#document"].includes(rr(e))}function r0(e){return Yt(e)?e:e.contextElement}const o0={x:1,y:1};function zo(e){const t=r0(e);if(!cn(t))return o0;const n=t.getBoundingClientRect(),{width:r,height:o,fallback:i}=Zy(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 Lr(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?Yt(r)&&(l=zo(r)):l=zo(e));const c=a?Et(a):window,d=_f()&&n;let f=(s.left+(d&&((o=c.visualViewport)==null?void 0:o.offsetLeft)||0))/l.x,p=(s.top+(d&&((i=c.visualViewport)==null?void 0:i.offsetTop)||0))/l.y,h=s.width/l.x,E=s.height/l.y;if(a){const v=Et(a),y=r&&Yt(r)?Et(r):r;let g=v.frameElement;for(;g&&r&&y!==v;){const m=zo(g),_=g.getBoundingClientRect(),S=getComputedStyle(g);_.x+=(g.clientLeft+parseFloat(S.paddingLeft))*m.x,_.y+=(g.clientTop+parseFloat(S.paddingTop))*m.y,f*=m.x,p*=m.y,h*=m.x,E*=m.y,f+=_.x,p+=_.y,g=Et(g).frameElement}}return{width:h,height:E,top:p,right:f+h,bottom:p+E,left:f,x:f,y:p}}function or(e){return((t0(e)?e.ownerDocument:e.document)||window.document).documentElement}function Ml(e){return Yt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function i0(e){return Lr(or(e)).left+Ml(e).scrollLeft}function xs(e){if(rr(e)==="html")return e;const t=e.assignedSlot||e.parentNode||n0(e)&&e.host||or(e);return n0(t)?t.host:t}function s0(e){const t=xs(e);return Sf(t)?t.ownerDocument.body:cn(t)&&Pl(t)?t:s0(t)}function ir(e,t){var n;t===void 0&&(t=[]);const r=s0(e),o=r===((n=e.ownerDocument)==null?void 0:n.body),i=Et(r);return o?t.concat(i,i.visualViewport||[],Pl(r)?r:[]):t.concat(r,ir(r))}function a0(e,t,n){let r;if(t==="viewport")r=function(s,a){const l=Et(s),c=or(s),d=l.visualViewport;let f=c.clientWidth,p=c.clientHeight,h=0,E=0;if(d){f=d.width,p=d.height;const v=_f();(!v||v&&a==="fixed")&&(h=d.offsetLeft,E=d.offsetTop)}return{width:f,height:p,x:h,y:E}}(e,n);else if(t==="document")r=function(s){const a=or(s),l=Ml(s),c=s.ownerDocument.body,d=Ss(a.scrollWidth,a.clientWidth,c.scrollWidth,c.clientWidth),f=Ss(a.scrollHeight,a.clientHeight,c.scrollHeight,c.clientHeight);let p=-l.scrollLeft+i0(s);const h=-l.scrollTop;return ln(c).direction==="rtl"&&(p+=Ss(a.clientWidth,c.clientWidth)-d),{width:d,height:f,x:p,y:h}}(or(e));else if(Yt(t))r=function(s,a){const l=Lr(s,!0,a==="fixed"),c=l.top+s.clientTop,d=l.left+s.clientLeft,f=cn(s)?zo(s):{x:1,y:1};return{width:s.clientWidth*f.x,height:s.clientHeight*f.y,x:d*f.x,y:c*f.y}}(t,n);else{const s={...t};if(_f()){var o,i;const a=Et(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 mf(r)}function l0(e,t){return cn(e)&&ln(e).position!=="fixed"?t?t(e):e.offsetParent:null}function c0(e,t){const n=Et(e);let r=l0(e,t);for(;r&&O2(r)&&ln(r).position==="static";)r=l0(r,t);return r&&(rr(r)==="html"||rr(r)==="body"&&ln(r).position==="static"&&!yf(r))?n:r||function(o){let i=xs(o);for(;cn(i)&&!Sf(i);){if(yf(i))return i;i=xs(i)}return null}(e)||n}function T2(e,t,n){const r=cn(t),o=or(t),i=Lr(e,!0,n==="fixed",t);let s={scrollLeft:0,scrollTop:0};const a={x:0,y:0};if(r||!r&&n!=="fixed")if((rr(t)!=="body"||Pl(o))&&(s=Ml(t)),cn(t)){const l=Lr(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 A2={getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=n==="clippingAncestors"?function(c,d){const f=d.get(c);if(f)return f;let p=ir(c).filter(y=>Yt(y)&&rr(y)!=="body"),h=null;const E=ln(c).position==="fixed";let v=E?xs(c):c;for(;Yt(v)&&!Sf(v);){const y=ln(v),g=yf(v);y.position==="fixed"?h=null:(E?g||h:g||y.position!=="static"||!h||!["absolute","fixed"].includes(h.position))?h=y:p=p.filter(m=>m!==v),v=xs(v)}return d.set(c,p),p}(t,this._c):[].concat(n),s=[...i,r],a=s[0],l=s.reduce((c,d)=>{const f=a0(t,d,o);return c.top=Ss(f.top,c.top),c.right=Jy(f.right,c.right),c.bottom=Jy(f.bottom,c.bottom),c.left=Ss(f.left,c.left),c},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=cn(n),i=or(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")&&((rr(n)!=="body"||Pl(i))&&(s=Ml(n)),cn(n))){const c=Lr(n);a=zo(n),l.x=c.x+n.clientLeft,l.y=c.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:Yt,getDimensions:function(e){return cn(e)?Zy(e):e.getBoundingClientRect()},getOffsetParent:c0,getDocumentElement:or,getScale:zo,async getElementRects(e){let{reference:t,floating:n,strategy:r}=e;const o=this.getOffsetParent||c0,i=this.getDimensions;return{reference:T2(t,await o(n),r),floating:{x:0,y:0,...await i(n)}}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>ln(e).direction==="rtl"};function I2(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,c=l||i?[...Yt(e)?ir(e):e.contextElement?ir(e.contextElement):[],...ir(t)]:[];c.forEach(h=>{l&&h.addEventListener("scroll",n,{passive:!0}),i&&h.addEventListener("resize",n)});let d,f=null;if(s){let h=!0;f=new ResizeObserver(()=>{h||n(),h=!1}),Yt(e)&&!a&&f.observe(e),Yt(e)||!e.contextElement||a||f.observe(e.contextElement),f.observe(t)}let p=a?Lr(e):null;return a&&function h(){const E=Lr(e);!p||E.x===p.x&&E.y===p.y&&E.width===p.width&&E.height===p.height||n(),p=E,d=requestAnimationFrame(h)}(),n(),()=>{var h;c.forEach(E=>{l&&E.removeEventListener("scroll",n),i&&E.removeEventListener("resize",n)}),(h=f)==null||h.disconnect(),f=null,a&&cancelAnimationFrame(d)}}const b2=(e,t,n)=>{const r=new Map,o={platform:A2,...n},i={...o.platform,_c:r};return m2(e,t,{...o,platform:i})},C2=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 jl=typeof document<"u"?w.useLayoutEffect:w.useEffect;function Ul(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(!Ul(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)&&!Ul(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function u0(e){const t=w.useRef(e);return jl(()=>{t.current=e}),t}function L2(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,whileElementsMounted:i,open:s}=e,[a,l]=w.useState({x:null,y:null,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[c,d]=w.useState(r);Ul(c,r)||d(r);const f=w.useRef(null),p=w.useRef(null),h=w.useRef(a),E=u0(i),v=u0(o),[y,g]=w.useState(null),[m,_]=w.useState(null),S=w.useCallback(A=>{f.current!==A&&(f.current=A,g(A))},[]),x=w.useCallback(A=>{p.current!==A&&(p.current=A,_(A))},[]),R=w.useCallback(()=>{if(!f.current||!p.current)return;const A={placement:t,strategy:n,middleware:c};v.current&&(A.platform=v.current),b2(f.current,p.current,A).then(b=>{const V={...b,isPositioned:!0};I.current&&!Ul(h.current,V)&&(h.current=V,xo.flushSync(()=>{l(V)}))})},[c,t,n,v]);jl(()=>{s===!1&&h.current.isPositioned&&(h.current.isPositioned=!1,l(A=>({...A,isPositioned:!1})))},[s]);const I=w.useRef(!1);jl(()=>(I.current=!0,()=>{I.current=!1}),[]),jl(()=>{if(y&&m){if(E.current)return E.current(y,m,R);R()}},[y,m,R,E]);const L=w.useMemo(()=>({reference:f,floating:p,setReference:S,setFloating:x}),[S,x]),U=w.useMemo(()=>({reference:y,floating:m}),[y,m]);return w.useMemo(()=>({...a,update:R,refs:L,elements:U,reference:S,floating:x}),[a,R,L,U,S,x])}var Dr=typeof document<"u"?w.useLayoutEffect:w.useEffect;let xf=!1,D2=0;const d0=()=>"floating-ui-"+D2++;function k2(){const[e,t]=w.useState(()=>xf?d0():void 0);return Dr(()=>{e==null&&t(d0())},[]),w.useEffect(()=>{xf||(xf=!0)},[]),e}const Rf=lp["useId".toString()]||k2;function P2(){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 M2=w.createContext(null),j2=w.createContext(null),f0=()=>{var e;return((e=w.useContext(M2))==null?void 0:e.id)||null},Nf=()=>w.useContext(j2);function Tn(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 U2(){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 wf(e){return Tn(e).defaultView||window}function Kt(e){return e?e instanceof wf(e).Element:!1}function h0(e){return e?e instanceof wf(e).HTMLElement:!1}function F2(e){if(typeof ShadowRoot>"u")return!1;const t=wf(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function V2(e){if(e.mozInputSource===0&&e.isTrusted)return!0;const t=/Android/i;return(t.test(p0())||t.test(U2()))&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function $2(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 B2(){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 E0(e){const t=w.useRef(e);return Dr(()=>{t.current=e}),t}const v0="data-floating-ui-safe-polygon";function Of(e,t,n){return n&&!m0(n)?0:typeof e=="number"?e:e==null?void 0:e[t]}const H2=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:c,dataRef:d,events:f,elements:{domReference:p,floating:h},refs:E}=e,v=Nf(),y=f0(),g=E0(o),m=E0(r),_=w.useRef(),S=w.useRef(),x=w.useRef(),R=w.useRef(),I=w.useRef(!0),L=w.useRef(!1),U=w.useRef(()=>{}),A=w.useCallback(()=>{var O;const j=(O=d.current.openEvent)==null?void 0:O.type;return(j==null?void 0:j.includes("mouse"))&&j!=="mousedown"},[d]);w.useEffect(()=>{if(!n)return;function O(){clearTimeout(S.current),clearTimeout(R.current),I.current=!0}return f.on("dismiss",O),()=>{f.off("dismiss",O)}},[n,f]),w.useEffect(()=>{if(!n||!g.current||!l)return;function O(){A()&&c(!1)}const j=Tn(h).documentElement;return j.addEventListener("mouseleave",O),()=>{j.removeEventListener("mouseleave",O)}},[h,l,c,n,g,d,A]);const b=w.useCallback(function(O){O===void 0&&(O=!0);const j=Of(m.current,"close",_.current);j&&!x.current?(clearTimeout(S.current),S.current=setTimeout(()=>c(!1),j)):O&&(clearTimeout(S.current),c(!1))},[m,c]),V=w.useCallback(()=>{U.current(),x.current=void 0},[]),M=w.useCallback(()=>{if(L.current){const O=Tn(E.floating.current).body;O.style.pointerEvents="",O.removeAttribute(v0),L.current=!1}},[E]);return w.useEffect(()=>{if(!n)return;function O(){return d.current.openEvent?["click","mousedown"].includes(d.current.openEvent.type):!1}function j(D){if(clearTimeout(S.current),I.current=!1,i&&!m0(_.current)||s>0&&Of(m.current,"open")===0)return;d.current.openEvent=D;const C=Of(m.current,"open",_.current);C?S.current=setTimeout(()=>{c(!0)},C):c(!0)}function P(D){if(O())return;U.current();const C=Tn(h);if(clearTimeout(R.current),g.current){l||clearTimeout(S.current),x.current=g.current({...e,tree:v,x:D.clientX,y:D.clientY,onClose(){M(),V(),b()}});const k=x.current;C.addEventListener("mousemove",k),U.current=()=>{C.removeEventListener("mousemove",k)};return}b()}function $(D){O()||g.current==null||g.current({...e,tree:v,x:D.clientX,y:D.clientY,onClose(){M(),V(),b()}})(D)}if(Kt(p)){const D=p;return l&&D.addEventListener("mouseleave",$),h==null||h.addEventListener("mouseleave",$),a&&D.addEventListener("mousemove",j,{once:!0}),D.addEventListener("mouseenter",j),D.addEventListener("mouseleave",P),()=>{l&&D.removeEventListener("mouseleave",$),h==null||h.removeEventListener("mouseleave",$),a&&D.removeEventListener("mousemove",j),D.removeEventListener("mouseenter",j),D.removeEventListener("mouseleave",P)}}},[p,h,n,e,i,s,a,b,V,M,c,l,v,m,g,d]),Dr(()=>{var O;if(n&&l&&(O=g.current)!=null&&O.__options.blockPointerEvents&&A()){const $=Tn(h).body;if($.setAttribute(v0,""),$.style.pointerEvents="none",L.current=!0,Kt(p)&&h){var j,P;const D=p,C=v==null||(j=v.nodesRef.current.find(k=>k.id===y))==null||(P=j.context)==null?void 0:P.elements.floating;return C&&(C.style.pointerEvents=""),D.style.pointerEvents="auto",h.style.pointerEvents="auto",()=>{D.style.pointerEvents="",h.style.pointerEvents=""}}}},[n,l,y,h,p,v,g,d,A]),Dr(()=>{l||(_.current=void 0,V(),M())},[l,V,M]),w.useEffect(()=>()=>{V(),clearTimeout(S.current),clearTimeout(R.current),M()},[n,V,M]),w.useMemo(()=>{if(!n)return{};function O(j){_.current=j.pointerType}return{reference:{onPointerDown:O,onPointerEnter:O,onMouseMove(){l||s===0||(clearTimeout(R.current),R.current=setTimeout(()=>{I.current||c(!0)},s))}},floating:{onMouseEnter(){clearTimeout(S.current)},onMouseLeave(){f.emit("dismiss",{type:"mouseLeave",data:{returnFocus:!1}}),b(!1)}}}},[f,n,s,l,c,b])};function Tf(){return Tf=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},Tf.apply(this,arguments)}function y0(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 Wo(e,t){if(!e||!t)return!1;const n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&F2(n)){let r=t;do{if(r&&e===r)return!0;r=r.parentNode||r.host}while(r)}return!1}function Fl(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 _0(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 x0(e,t){const n=Yy(e,S0());t==="prev"&&n.reverse();const r=n.indexOf(y0(Tn(e)));return n.slice(r+1)[0]}function z2(){return x0(document.body,"next")}function W2(){return x0(document.body,"prev")}function Af(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!Wo(n,r)}function G2(e){Yy(e,S0()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function Y2(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 K2=lp["useInsertionEffect".toString()]||(e=>e());function If(e){const t=w.useRef(()=>{});return K2(()=>{t.current=e}),w.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 R0={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 bf,Cf;function N0(e){e.key==="Tab"&&(bf=e.target,clearTimeout(Cf))}function Q2(e){const t=bf===e.relatedTarget;return bf=e.relatedTarget,clearTimeout(Cf),t}const w0=w.forwardRef(function(t,n){const r=If(t.onFocus),[o,i]=w.useState();return Dr(()=>(g0()&&i("button"),document.addEventListener("keydown",N0),()=>{document.removeEventListener("keydown",N0)}),[]),w.createElement("span",Tf({},t,{ref:n,tabIndex:0,role:o,"aria-hidden":o?void 0:!0,"data-floating-ui-focus-guard":"",style:R0,onFocus:s=>{g0()&&B2()&&!Q2(s)?(s.persist(),Cf=window.setTimeout(()=>{r(s)},50)):r(s)}}))}),O0=w.createContext(null),X2=function(e){let{id:t,enabled:n=!0}=e===void 0?{}:e;const[r,o]=w.useState(null),i=Rf(),s=q2();return Dr(()=>{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 c=(s==null?void 0:s.portalNode)||document.body;return c.appendChild(l),()=>{c.removeChild(l)}}},[t,s,i,n]),r},T0=e=>{let{children:t,id:n,root:r=null,preserveTabOrder:o=!0}=e;const i=X2({id:n,enabled:!r}),[s,a]=w.useState(null),l=w.useRef(null),c=w.useRef(null),d=w.useRef(null),f=w.useRef(null),p=!!s&&!s.modal&&!!(r||i)&&o;return w.useEffect(()=>{if(!i||!o||s!=null&&s.modal)return;function h(E){i&&Af(E)&&(E.type==="focusin"?Y2:G2)(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]),w.createElement(O0.Provider,{value:w.useMemo(()=>({preserveTabOrder:o,beforeOutsideRef:l,afterOutsideRef:c,beforeInsideRef:d,afterInsideRef:f,portalNode:i,setFocusManagerState:a}),[o,i])},p&&i&&w.createElement(w0,{"data-type":"outside",ref:l,onFocus:h=>{if(Af(h,i)){var E;(E=d.current)==null||E.focus()}else{const v=W2()||(s==null?void 0:s.refs.domReference.current);v==null||v.focus()}}}),p&&i&&w.createElement("span",{"aria-owns":i.id,style:R0}),r?xo.createPortal(t,r):i?xo.createPortal(t,i):null,p&&i&&w.createElement(w0,{"data-type":"outside",ref:c,onFocus:h=>{if(Af(h,i)){var E;(E=f.current)==null||E.focus()}else{const v=z2()||(s==null?void 0:s.refs.domReference.current);v==null||v.focus(),s!=null&&s.closeOnFocusOut&&(s==null||s.onOpenChange(!1))}}}))},q2=()=>w.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 J2={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},Z2={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},eC=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}},tC=function(e,t){let{open:n,onOpenChange:r,events:o,nodeId:i,elements:{reference:s,domReference:a,floating:l},dataRef:c}=e,{enabled:d=!0,escapeKey:f=!0,outsidePress:p=!0,outsidePressEvent:h="pointerdown",referencePress:E=!1,referencePressEvent:v="pointerdown",ancestorScroll:y=!1,bubbles:g=!0}=t===void 0?{}:t;const m=Nf(),_=f0()!=null,S=If(typeof p=="function"?p:()=>!1),x=typeof p=="function"?S:p,R=w.useRef(!1),{escapeKeyBubbles:I,outsidePressBubbles:L}=eC(g);return w.useEffect(()=>{if(!n||!d)return;c.current.__escapeKeyBubbles=I,c.current.__outsidePressBubbles=L;function U(O){if(O.key==="Escape"){const j=m?Fl(m.nodesRef.current,i):[];if(j.length>0){let P=!0;if(j.forEach($=>{var D;if((D=$.context)!=null&&D.open&&!$.context.dataRef.current.__escapeKeyBubbles){P=!1;return}}),!P)return}o.emit("dismiss",{type:"escapeKey",data:{returnFocus:{preventScroll:!1}}}),r(!1)}}function A(O){const j=R.current;if(R.current=!1,j||typeof x=="function"&&!x(O))return;const P=_0(O);if(h0(P)&&l){const C=l.ownerDocument.defaultView||window,k=P.scrollWidth>P.clientWidth,F=P.scrollHeight>P.clientHeight;let B=F&&O.offsetX>P.clientWidth;if(F&&C.getComputedStyle(P).direction==="rtl"&&(B=O.offsetX<=P.offsetWidth-P.clientWidth),B||k&&O.offsetY>P.clientHeight)return}const $=m&&Fl(m.nodesRef.current,i).some(C=>{var k;return Vl(O,(k=C.context)==null?void 0:k.elements.floating)});if(Vl(O,l)||Vl(O,a)||$)return;const D=m?Fl(m.nodesRef.current,i):[];if(D.length>0){let C=!0;if(D.forEach(k=>{var F;if((F=k.context)!=null&&F.open&&!k.context.dataRef.current.__outsidePressBubbles){C=!1;return}}),!C)return}o.emit("dismiss",{type:"outsidePress",data:{returnFocus:_?{preventScroll:!0}:V2(O)||$2(O)}}),r(!1)}function b(){r(!1)}const V=Tn(l);f&&V.addEventListener("keydown",U),x&&V.addEventListener(h,A);let M=[];return y&&(Kt(a)&&(M=ir(a)),Kt(l)&&(M=M.concat(ir(l))),!Kt(s)&&s&&s.contextElement&&(M=M.concat(ir(s.contextElement)))),M=M.filter(O=>{var j;return O!==((j=V.defaultView)==null?void 0:j.visualViewport)}),M.forEach(O=>{O.addEventListener("scroll",b,{passive:!0})}),()=>{f&&V.removeEventListener("keydown",U),x&&V.removeEventListener(h,A),M.forEach(O=>{O.removeEventListener("scroll",b)})}},[c,l,a,s,f,x,h,o,m,i,n,r,y,d,I,L,_]),w.useEffect(()=>{R.current=!1},[x,h]),w.useMemo(()=>d?{reference:{[J2[v]]:()=>{E&&(o.emit("dismiss",{type:"referencePress",data:{returnFocus:!1}}),r(!1))}},floating:{[Z2[h]]:()=>{R.current=!0}}}:{},[d,o,E,h,v,r])},nC=function(e,t){let{open:n,onOpenChange:r,dataRef:o,events:i,refs:s,elements:{floating:a,domReference:l}}=e,{enabled:c=!0,keyboardOnly:d=!0}=t===void 0?{}:t;const f=w.useRef(""),p=w.useRef(!1),h=w.useRef();return w.useEffect(()=>{if(!c)return;const v=Tn(a).defaultView||window;function y(){!n&&h0(l)&&l===y0(Tn(l))&&(p.current=!0)}return v.addEventListener("blur",y),()=>{v.removeEventListener("blur",y)}},[a,l,n,c]),w.useEffect(()=>{if(!c)return;function E(v){(v.type==="referencePress"||v.type==="escapeKey")&&(p.current=!0)}return i.on("dismiss",E),()=>{i.off("dismiss",E)}},[i,c]),w.useEffect(()=>()=>{clearTimeout(h.current)},[]),w.useMemo(()=>c?{reference:{onPointerDown(E){let{pointerType:v}=E;f.current=v,p.current=!!(v&&d)},onMouseLeave(){p.current=!1},onFocus(E){var v;p.current||E.type==="focus"&&((v=o.current.openEvent)==null?void 0:v.type)==="mousedown"&&o.current.openEvent&&Vl(o.current.openEvent,l)||(o.current.openEvent=E.nativeEvent,r(!0))},onBlur(E){p.current=!1;const v=E.relatedTarget,y=Kt(v)&&v.hasAttribute("data-floating-ui-focus-guard")&&v.getAttribute("data-type")==="outside";h.current=setTimeout(()=>{Wo(s.floating.current,v)||Wo(l,v)||y||r(!1)})}}}:{},[c,d,l,s,o,r])};function A0(e){return w.useMemo(()=>e.every(t=>t==null)?null:t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})},e)}const rC=function(e,t){let{open:n}=e,{enabled:r=!0,role:o="dialog"}=t===void 0?{}:t;const i=Rf(),s=Rf();return w.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 oC(e,t){const[n,r]=e;let o=!1;const i=t.length;for(let s=0,a=i-1;s<i;a=s++){const[l,c]=t[s]||[0,0],[d,f]=t[a]||[0,0];c>=r!=f>=r&&n<=(d-l)*(r-c)/(f-c)+l&&(o=!o)}return o}function iC(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}function sC(e){let{restMs:t=0,buffer:n=.5,blockPointerEvents:r=!1}=e===void 0?{}:e,o,i=!1,s=!1;const a=l=>{let{x:c,y:d,placement:f,elements:p,onClose:h,nodeId:E,tree:v}=l;return function(g){function m(){clearTimeout(o),h()}if(clearTimeout(o),!p.domReference||!p.floating||f==null||c==null||d==null)return;const{clientX:_,clientY:S}=g,x=[_,S],R=_0(g),I=g.type==="mouseleave",L=Wo(p.floating,R),U=Wo(p.domReference,R),A=p.domReference.getBoundingClientRect(),b=p.floating.getBoundingClientRect(),V=f.split("-")[0],M=c>b.right-b.width/2,O=d>b.bottom-b.height/2,j=iC(x,A);if(L&&(s=!0,!I))return;if(U&&(s=!1),U&&!I){s=!0;return}if(I&&Kt(g.relatedTarget)&&Wo(p.floating,g.relatedTarget)||v&&Fl(v.nodesRef.current,E).some(C=>{let{context:k}=C;return k==null?void 0:k.open}))return;if(V==="top"&&d>=A.bottom-1||V==="bottom"&&d<=A.top+1||V==="left"&&c>=A.right-1||V==="right"&&c<=A.left+1)return m();let P=[];switch(V){case"top":P=[[b.left,A.top+1],[b.left,b.bottom-1],[b.right,b.bottom-1],[b.right,A.top+1]],i=_>=b.left&&_<=b.right&&S>=b.top&&S<=A.top+1;break;case"bottom":P=[[b.left,b.top+1],[b.left,A.bottom-1],[b.right,A.bottom-1],[b.right,b.top+1]],i=_>=b.left&&_<=b.right&&S>=A.bottom-1&&S<=b.bottom;break;case"left":P=[[b.right-1,b.bottom],[b.right-1,b.top],[A.left+1,b.top],[A.left+1,b.bottom]],i=_>=b.left&&_<=A.left+1&&S>=b.top&&S<=b.bottom;break;case"right":P=[[A.right-1,b.bottom],[A.right-1,b.top],[b.left+1,b.top],[b.left+1,b.bottom]],i=_>=A.right-1&&_<=b.right&&S>=b.top&&S<=b.bottom;break}function $(C){let[k,F]=C;const B=b.width>A.width,z=b.height>A.height;switch(V){case"top":{const W=[B?k+n/2:M?k+n*4:k-n*4,F+n+1],X=[B?k-n/2:M?k+n*4:k-n*4,F+n+1],Q=[[b.left,M||B?b.bottom-n:b.top],[b.right,M?B?b.bottom-n:b.top:b.bottom-n]];return[W,X,...Q]}case"bottom":{const W=[B?k+n/2:M?k+n*4:k-n*4,F-n],X=[B?k-n/2:M?k+n*4:k-n*4,F-n],Q=[[b.left,M||B?b.top+n:b.bottom],[b.right,M?B?b.top+n:b.bottom:b.top+n]];return[W,X,...Q]}case"left":{const W=[k+n+1,z?F+n/2:O?F+n*4:F-n*4],X=[k+n+1,z?F-n/2:O?F+n*4:F-n*4];return[...[[O||z?b.right-n:b.left,b.top],[O?z?b.right-n:b.left:b.right-n,b.bottom]],W,X]}case"right":{const W=[k-n,z?F+n/2:O?F+n*4:F-n*4],X=[k-n,z?F-n/2:O?F+n*4:F-n*4],Q=[[O||z?b.left+n:b.right,b.top],[O?z?b.left+n:b.right:b.left+n,b.bottom]];return[W,X,...Q]}}}const D=i?P:$([c,d]);if(!i){if(s&&!j)return m();oC([_,S],D)?t&&!s&&(o=setTimeout(m,t)):m()}}};return a.__options={blockPointerEvents:r},a}function aC(e){e===void 0&&(e={});const{open:t=!1,onOpenChange:n,nodeId:r}=e,o=L2(e),i=Nf(),s=w.useRef(null),a=w.useRef({}),l=w.useState(()=>P2())[0],[c,d]=w.useState(null),f=w.useCallback(g=>{const m=Kt(g)?{getBoundingClientRect:()=>g.getBoundingClientRect(),contextElement:g}:g;o.refs.setReference(m)},[o.refs]),p=w.useCallback(g=>{(Kt(g)||g===null)&&(s.current=g,d(g)),(Kt(o.refs.reference.current)||o.refs.reference.current===null||g!==null&&!Kt(g))&&o.refs.setReference(g)},[o.refs]),h=w.useMemo(()=>({...o.refs,setReference:p,setPositionReference:f,domReference:s}),[o.refs,p,f]),E=w.useMemo(()=>({...o.elements,domReference:c}),[o.elements,c]),v=If(n),y=w.useMemo(()=>({...o,refs:h,elements:E,dataRef:a,nodeId:r,events:l,open:t,onOpenChange:v}),[o,r,l,t,v,h,E]);return Dr(()=>{const g=i==null?void 0:i.nodesRef.current.find(m=>m.id===r);g&&(g.context=y)}),w.useMemo(()=>({...o,context:y,refs:h,reference:p,positionReference:f}),[o,h,y,p,f])}function Lf(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 c;(c=r.get(a))==null||c.push(l),o[a]=function(){for(var d,f=arguments.length,p=new Array(f),h=0;h<f;h++)p[h]=arguments[h];(d=r.get(a))==null||d.forEach(E=>E(...p))}}}else o[a]=l}),o),{})}}const lC=function(e){e===void 0&&(e=[]);const t=e,n=w.useCallback(i=>Lf(i,e,"reference"),t),r=w.useCallback(i=>Lf(i,e,"floating"),t),o=w.useCallback(i=>Lf(i,e,"item"),e.map(i=>i==null?void 0:i.item));return w.useMemo(()=>({getReferenceProps:n,getFloatingProps:r,getItemProps:o}),[n,r,o])};function cC({arrowPadding:e,escapeKey:t=!0,initialOpen:n=!1,keepOpenOverContent:r=!1,onOpenChange:o,open:i,outsidePress:s=!0,placement:a,role:l="tooltip"}){const c=Y(R=>R.rootElementId),d=w.useRef(null),[f,p]=w.useState(n),h=i??f,E=o??p,v=aC({middleware:[R2(8),x2({boundary:document.querySelector(`#${c}`)||void 0}),w2({padding:4}),C2({element:d,padding:e??{bottom:0,left:8,right:8,top:8}})],onOpenChange:E,open:h,placement:a,strategy:"fixed",whileElementsMounted:I2}),y=v.context,g=H2(y,{enabled:i==null,handleClose:r?sC():null,move:!1}),m=nC(y,{enabled:i==null}),_=tC(y,{escapeKey:t,outsidePress:s}),S=rC(y,{role:l}),x=lC([g,m,_,S]);return w.useMemo(()=>({arrowRef:d,open:h,setOpen:E,...x,...v}),[h,E,x,v])}const I0=Wr.createContext(null),Df=()=>{const e=Wr.useContext(I0);if(e==null)throw new Error("Tooltip components must be wrapped in <Tooltip />");return e},uC=({children:e,...t})=>{const n=cC(t);return u.jsx(I0.Provider,{value:n,children:e})},dC={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",top:"-bottom-1 before:border-t-0 before:border-l-0"},fC=()=>{var s,a;const e=Df(),[t,n]=w.useState(e.middlewareData.arrow);w.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=`${dC[o]}`;return u.jsx("div",{ref:e.arrowRef,style:r,className:`tooltip-arrow absolute h-2 w-2 rotate-45 bg-inherit
66
66
  before:absolute before:h-2 before:w-2 before:border before:border-foreground/30 before:content-['']
67
- ${i}`})},pC=Wr.forwardRef(function(t,n){const{children:r,style:o,...i}=t,{getRootElement:s}=Se(),a=s(),l=Cf(),c=I0([l.refs.setFloating,n]);return u.jsx(A0,{root:a,children:l.open&&u.jsxs("div",{className:"relative max-w-md rounded-md bg-foreground p-2 text-sm text-background shadow-sm",ref:c,style:{left:l.x??0,position:l.strategy,top:l.y??0,visibility:l.x==null?"hidden":"visible",...o},...l.getFloatingProps(i),children:[u.jsx("div",{className:"overflow-hidden",children:r}),u.jsx(fC,{})]})})}),hC=N.forwardRef(function({children:t,asChild:n=!1,...r},o){const i=Cf(),s=I0([i.refs.setReference,o,t==null?void 0:t.ref]);return n&&N.isValidElement(t)?N.cloneElement(t,i.getReferenceProps({ref:s,...r,...t.props,"data-state":i.open?"open":"closed"})):u.jsx("button",{ref:s,"data-state":i.open?"open":"closed",...i.getReferenceProps(r),children:t})}),C0={bottom:"top",left:"right",right:"left",top:"bottom"},sr=({asChild:e=!0,children:t,enable:n=!0,placement:r="right",scale:o=1,trigger:i=u.jsx(te,{tag:"circle-info"}),...s})=>{let a=r.split("-")[0];return a=Object.keys(C0).includes(a)?a:"right",n?u.jsxs(uC,{...s,placement:r,children:[u.jsx(hC,{asChild:e,children:i}),u.jsx(pC,{style:o!==1?{transform:`scale(${o})`,transformOrigin:C0[a]}:void 0,children:t})]}):u.jsx(u.Fragment,{children:i})},gC={ABOUT:"About",ACTION:"Action",ADD_ADDRESS:"Add address",ADD_AI_AGENT:"Add AI agent",ADD_CONDITION:"Add condition",ADD_OPTION:"Add option",ADD_PHONE_NUMBER:"Add phone number",ADD_RESOURCE:"Add resource",ADD_VARIABLE:"Add variable",ADDRESS_NUMBER:"Address {{index}}",AI_AGENT:"AI Agent",AI_AGENT_NAME:"AI Agent Name",ANSWER_CALL:"Answer Call",API_VERSION:"API Version",ARE_YOU_SURE:"Are you sure?",AUDIO_FILE:"Audio File",BEEP:"Beep",BEEP_SUBTITLE:"Play a beep before recording",BUSY:"Busy",CALL_ADDRESSES:"Call Addresses",CALL_NUMBERS:"Call Numbers",CALL_RESOURCES:"Call Resources",CALL_STATE_EVENTS:"Call State Events",CALL_STATE_URL:"Call State URL",CALLER_PRESSES:"Caller presses",CALLER_SAYS:"Caller says",CANCEL:"Cancel",CAUTION:"Caution",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",CONFIRMATION_REMOVE_OPTION:"Are you sure? Removing this option will delete the flow connection and move back the following option, if there is one.",CONFIRMATION_REMOVE_VARIABLE:"Are you sure you want to remove this variable?",DECISION:"Decision",DECLINE:"Decline",DEFAULT_FROM:"Default From",DEFAULT_TIMEOUT:"Default Timeout",DELETE:"Delete",DELETE_NODE:"Delete node",DEPLOY:"Deploy",DEPLOY_WARNING:"Caution - Confirm Deploy",DEPRECATED:"Deprecated",DISCONNECT_CALL_AFTER_RINGING:"Disconnect call after ringing",DOCUMENT_OUT_OF_SYNC:"Document Out of Sync",EDIT_SELECTED_AI_AGENT:"Edit Selected AI Agent",ELSE:"Else",ENTER_URL:"Enter URL",ERROR:"Error",ERROR_ADD_AI_AGENT_FIRST:"Please add an AI Agent first.",ERROR_ADD_RECORDING_FIRST:"Please add a Start Call Recording node first.",ERROR_DUPLICATE_COMMAND:"This command is already used. Please use a unique phrase.",ERROR_DUPLICATE_RECORDING_LABEL:"This entry already exists. Please use a unique label.",ERROR_DUPLICATE_TELEPHONE_KEY:"This key is already used. Please use a unique key.",ERROR_DUPLICATE_VARIABLE_KEY:"This variable already exists. Please use a unique key.",ERROR_FETCHING_AI_AGENTS:"Error fetching AI Agents.",ERROR_FETCHING_DEPLOYED_VERSIONS:"Error fetching deployed versions.",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_SELECTION_REQUIRED:"A selection is required.",ERROR_STRING_VALUE_REQUIRED:"Invalid character. String value is required.",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.",EXECUTE_SWML:"Execute SWML",FAILED:"Failed",FAILURE:"Failure",FEMALE:"Female",FLOW_DATA_VERSION:"Flow Data Version",FORMAT:"Format",FORWARD:"Forward",FORWARD_TO_ADDRESS:"Forward to Address",FORWARD_TO_PHONE:"Forward to Phone",FORWARD_TO_RESOURCE:"Forward to Resource",FROM:"From",FROM_PHONE_NUMBER:"From Phone Number",GATHER_INPUT:"Gather Input",GENDER:"Gender",GO_BACK:"Go Back",HANDLE_CALL:"Handle Call",HANG_UP:"Hang Up",HANG_UP_CALL:"Hang Up Call",HELP:"Help",HIDDEN:"Hidden",IGNORE:"Ignore",INFO_DEPLOY:"Deploy the latest changes for the current call flow.",INFO_INVALID_SETTINGS:"Please check the settings and ensure that all required fields are filled in correctly.",INFO_NODE_AI_AGENT:"<p>Used to connect to a conversational AI Agent for processing.</p><p>Choose the appropriate AI Agent or create a new one: <a>AI Agents</a></p>",INFO_NODE_COND:`<p>A condition works like a JavaScript <code>if</code> statement.</p><p>A condition field can reference variables that have been set in the flow with <code>%{Key}</code>, Request node responses accessed with <code>%{request_response['object_field']}</code>, or call parameters such as <code>%{call.from}</code>.</p><p>Add additional conditions to create <code>else if</code> conditions.</p><p>The "Cond #" path will be executed for a truthy condition. The "Else" path will be executed for a falsy condition.</p>`,INFO_NODE_CONDREQUEST:"<p>Send a GET, POST, PUT, or DELETE request to any webhook.</p><p>This can be used to submit variables and information about an inbound call to an external server, or you can retrieve information from external servers and use them as variables throughout the call flow. You can also build conditions directly into this module.</p><p>Response variables can be accessed with <code>%{request_response['object_field']}</code>.</p><p>Headers should be input in JSON format. Valid header values are <code>Accept</code>, <code>Authorization</code>, <code>Content-Type</code>, <code>Range</code>, and <code>custom X- headers</code>.</p>",INFO_NODE_EXECUTE_SWML:"Execute a remote SWML document and return to the current document. Use <code>%{return_value.['object_field']}</code> to reference the return values from the external SWML.",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_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:"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_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_REQUEST:"<p>Send a GET, POST, PUT, or DELETE request to any webhook.</p><p>This can be used to submit variables and information about an inbound call to an external server, or you can retrieve information from external servers and use them as variables throughout the call flow. You can also build conditions directly into this module.</p><p>Response variables can be accessed with <code>%{request_response['object_field']}</code>.</p><p>Headers should be input in JSON format. Valid header values are <code>Accept</code>, <code>Authorization</code>, <code>Content-Type</code>, <code>Range</code>, and <code>custom X- headers</code>.</p>",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:`<p>Set variables that can be accessed from other node blocks in the call flow.</p><p>The value can be a static value <code>("value")</code>, a variable from another node such as a request response <code>%{request_response.['object_field']}</code>, or a call parameter <code>%{call.from}</code>.</p><p>Access these variables in other blocks with <code>%{Key}</code> and unset variables with the Unset Variables block.</p>`,INFO_NODE_UNSET_VARIABLES:"Unsets script variables.",INFO_NOT_CONNECTED_TO_FLOW:"This node is not connected to the flow and will not be executed during the call. Please connect the node to the flow if you wish to use it.",INFO_STATUS_ERROR:"An error occurred while loading or saving the flow.",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.",INPUT:"Input",INVALID_SETTINGS:"Invalid settings",JSON_OBJECT:"JSON object to serialize",KEY:"Key",KEYPAD_VALUE:"Keypad value",LANGUAGE:"Language",MALE:"Male",MAXIMUM_RECORDING_LENGTH:"Maximum Recording Length",META:"Meta",METHOD:"Method",MORE_INFO_DEPLOY:"Deploying a Call Flow makes it live.",MORE_INFO_DEPLOY_ERROR:"There was an error deploying the Call Flow. Please try again. {{message}}",MORE_INFO_STATUS_ERROR:"More info on Flow document error",MORE_INFO_TESTING_YOUR_FLOW:"Info on testing your call flow",MORE_INFO_TITLE:"More info {{title}}",MORE_WITH_COUNT:"{{count}} more",NAVIGATE_BACK:"Navigate Back",NO_ANSWER:"No Answer",NO_DEPLOYED_VERSIONS:"<p>No deployed versions found.</p> <p>Deploy a flow to view the history.</p>",NO_INPUT:"No Input",NO_VARIABLES_SET:"Please set variables first",NOT_CONNECTED_TO_FLOW:"Not connected to flow",NUMBER_OF_VALIDATION_WARNINGS_one:"There is {{count}} validation warning in your flow",NUMBER_OF_VALIDATION_WARNINGS_other:"There are {{count}} validation warnings in your flow",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_CALLER_SAYS:"or says",OR_SAYS:"Or says",PARAMS:"Params",PHONE_NUMBER:"Phone Number",PHONE_NUMBER_NUMBER:"Phone Number {{index}}",PKG_VERSION:"Package Version",PLAY_AUDIO:"Play Audio",PLAY_AUDIO_FILE:"Play Audio File",PLAY_AUDIO_TTS:"Play Audio or TTS",PREVIEW_DEPLOYED_VERSION:"You are previewing this version.",REASON:"Reason",RECORD:"Record",RECORD_CALL_START:"Start Call Recording",RECORD_CALL_STOP:"Stop Call Recording",RECORDING:"Recording",RECORDING_NAME:"Recording Name",RECORDING_NAME_DEFAULT:"Recording {{index}}",REMOVE_ADDRESS:"Remove Address {{index}}",REMOVE_CONDITION:"Remove Condition {{index}}",REMOVE_EDGE:"Remove Edge",REMOVE_NODE:"Remove Node {{title}}",REMOVE_OPTION:"Remove Option {{index}}",REMOVE_PHONE_NUMBER:"Remove Phone Number {{index}}",REMOVE_RESOURCE:"Remove Resource {{index}}",REMOVE_VARIABLE:"Remove Variable {{index}}",REQUEST:"Request",REQUEST_BODY:"Body",REQUEST_HEADERS:"Headers (JSON)",REQUIRED_SETTINGS:"Required Settings",RESOURCE_NUMBER:"Resource {{index}}",RESTORE:"Restore",RESTORE_THIS_VERSION:"Restore this version",RESYNC:"Resync",RESYNC_AI_AGENTS:"Resync AI Agents",SAVED:"Saved",SAVE_VARIABLES:"Save Variables",SAVE_VARIABLES_SUBTITLE:"Store the response as variables",SECONDS:"Seconds",SELECT:"Select",SELECT_VARIABLES:"Select Variables",SELECT_VARIABLES_TO_UNSET:"Select Variables to Unset",SEND_SMS:"Send SMS",SEPARATE_WITH_COMMAS:"Separate with commas",SEQUENTIALLY:"Sequentially",SET_VARIABLES:"Set Variables",SIMULTANEOUSLY:"Simultaneously",SMS_TEXT:"SMS Text",SPOKEN_PROMPT:"Spoken prompt",STATUS_DEPLOY:"Deploy",STATUS_DEPLOY_ERROR:"Deploy Error",STATUS_DEPLOYED:"Deployed",STATUS_DEPLOYING:"Deploying...",STATUS_ERROR:"Error",STATUS_LOADING:"Loading...",STATUS_LOCKED:"Locked",STATUS_SAVED:"Saved",STATUS_SAVING:"Saving...",STEREO:"Stereo",STEREO_SUBTITLE:"Enable stereo audio",STRING_OR_JSON:"String or JSON to serialize",SUCCESS:"Success",SWML_VERSION:"SWML Version",TERMINATORS:"Terminators",TEXT:"Text",TEXT_TO_SPEECH:"Text to Speech",TIMEOUT:"Timeout",TO:"To",TO_PHONE_NUMBER:"To Phone Number",TOAST_DEPLOY_WARNING:'<p>There are inconsistencies in your Call Flow which may cause unexpected behavior. Please review the Call Flow before deploying.</p><p>Choose "Deploy" to deploy the Call Flow or "Cancel" to return to editing.</p>',TOAST_DOCUMENT_OUT_OF_SYNC:'<p>Updates have been made to this Call Flow by another user and your recent changes have not been saved.</p><p>Choose "Ignore" to view your changes in a locked state or "Resync" to abandon your changes and adopt the latest updates.</p>',UNKNOWN:"Unknown",UNSET_VARIABLES:"Unset Variables",URL:"URL",VALUE:"Value",VARIABLE_KEY:"Variable {{key}}",VARIABLE_NUMBER:"Variable {{index}}",VERSION_HISTORY:"Version History",VERSION_LIST_ITEM:"Version {{number}}",VERSION_RESTORED:"Version restored",VOICE:"Voice",VOICEMAIL_RECORDING:"Voicemail Recording",WAIT_FOR_DIGIT:"Wait for Digit",WAIT_FOR_INPUT:"Wait for Input",WARNING:"Warning",WRITE_SOMETHING:"Write something"},w={ABOUT:"ABOUT",ACTION:"ACTION",ADDRESS_NUMBER:"ADDRESS_NUMBER",ADD_ADDRESS:"ADD_ADDRESS",ADD_AI_AGENT:"ADD_AI_AGENT",ADD_CONDITION:"ADD_CONDITION",ADD_OPTION:"ADD_OPTION",ADD_PHONE_NUMBER:"ADD_PHONE_NUMBER",ADD_RESOURCE:"ADD_RESOURCE",ADD_VARIABLE:"ADD_VARIABLE",AI_AGENT:"AI_AGENT",AI_AGENT_NAME:"AI_AGENT_NAME",ANSWER_CALL:"ANSWER_CALL",API_VERSION:"API_VERSION",ARE_YOU_SURE:"ARE_YOU_SURE",AUDIO_FILE:"AUDIO_FILE",BEEP:"BEEP",BEEP_SUBTITLE:"BEEP_SUBTITLE",BUSY:"BUSY",CALLER_PRESSES:"CALLER_PRESSES",CALLER_SAYS:"CALLER_SAYS",CALL_ADDRESSES:"CALL_ADDRESSES",CALL_NUMBERS:"CALL_NUMBERS",CALL_RESOURCES:"CALL_RESOURCES",CALL_STATE_EVENTS:"CALL_STATE_EVENTS",CALL_STATE_URL:"CALL_STATE_URL",CANCEL:"CANCEL",CAUTION:"CAUTION",CHOOSE_OPTION_SINGLE_MULTIPLE:"CHOOSE_OPTION_SINGLE_MULTIPLE",CHOOSE_OPTION_TTS_AUDIO:"CHOOSE_OPTION_TTS_AUDIO",CLOSE:"CLOSE",CONDITIONS:"CONDITIONS",CONDITION_NUMBER:"CONDITION_NUMBER",COND_NUMBER:"COND_NUMBER",CONFIRMATION_REMOVE_OPTION:"CONFIRMATION_REMOVE_OPTION",CONFIRMATION_REMOVE_VARIABLE:"CONFIRMATION_REMOVE_VARIABLE",DECISION:"DECISION",DECLINE:"DECLINE",DEFAULT_FROM:"DEFAULT_FROM",DEFAULT_TIMEOUT:"DEFAULT_TIMEOUT",DELETE:"DELETE",DELETE_NODE:"DELETE_NODE",DEPLOY:"DEPLOY",DEPLOY_WARNING:"DEPLOY_WARNING",DEPRECATED:"DEPRECATED",DISCONNECT_CALL_AFTER_RINGING:"DISCONNECT_CALL_AFTER_RINGING",DOCUMENT_OUT_OF_SYNC:"DOCUMENT_OUT_OF_SYNC",EDIT_SELECTED_AI_AGENT:"EDIT_SELECTED_AI_AGENT",ELSE:"ELSE",ENTER_URL:"ENTER_URL",ERROR:"ERROR",ERROR_ADD_AI_AGENT_FIRST:"ERROR_ADD_AI_AGENT_FIRST",ERROR_ADD_RECORDING_FIRST:"ERROR_ADD_RECORDING_FIRST",ERROR_DUPLICATE_COMMAND:"ERROR_DUPLICATE_COMMAND",ERROR_DUPLICATE_RECORDING_LABEL:"ERROR_DUPLICATE_RECORDING_LABEL",ERROR_DUPLICATE_TELEPHONE_KEY:"ERROR_DUPLICATE_TELEPHONE_KEY",ERROR_DUPLICATE_VARIABLE_KEY:"ERROR_DUPLICATE_VARIABLE_KEY",ERROR_FETCHING_AI_AGENTS:"ERROR_FETCHING_AI_AGENTS",ERROR_FETCHING_DEPLOYED_VERSIONS:"ERROR_FETCHING_DEPLOYED_VERSIONS",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_SELECTION_REQUIRED:"ERROR_SELECTION_REQUIRED",ERROR_STRING_VALUE_REQUIRED:"ERROR_STRING_VALUE_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",EXECUTE_SWML:"EXECUTE_SWML",FAILED:"FAILED",FAILURE:"FAILURE",FEMALE:"FEMALE",FLOW_DATA_VERSION:"FLOW_DATA_VERSION",FORMAT:"FORMAT",FORWARD:"FORWARD",FORWARD_TO_ADDRESS:"FORWARD_TO_ADDRESS",FORWARD_TO_PHONE:"FORWARD_TO_PHONE",FORWARD_TO_RESOURCE:"FORWARD_TO_RESOURCE",FROM:"FROM",FROM_PHONE_NUMBER:"FROM_PHONE_NUMBER",GATHER_INPUT:"GATHER_INPUT",GENDER:"GENDER",GO_BACK:"GO_BACK",HANDLE_CALL:"HANDLE_CALL",HANG_UP:"HANG_UP",HANG_UP_CALL:"HANG_UP_CALL",HELP:"HELP",HIDDEN:"HIDDEN",IGNORE:"IGNORE",INFO_DEPLOY:"INFO_DEPLOY",INFO_INVALID_SETTINGS:"INFO_INVALID_SETTINGS",INFO_NODE_AI_AGENT:"INFO_NODE_AI_AGENT",INFO_NODE_COND:"INFO_NODE_COND",INFO_NODE_CONDREQUEST:"INFO_NODE_CONDREQUEST",INFO_NODE_EXECUTE_SWML:"INFO_NODE_EXECUTE_SWML",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_PLAY:"INFO_NODE_PLAY",INFO_NODE_RECORD:"INFO_NODE_RECORD",INFO_NODE_RECORD_CALL_START:"INFO_NODE_RECORD_CALL_START",INFO_NODE_RECORD_CALL_STOP:"INFO_NODE_RECORD_CALL_STOP",INFO_NODE_REQUEST:"INFO_NODE_REQUEST",INFO_NODE_SEND_SMS:"INFO_NODE_SEND_SMS",INFO_NODE_SET_VARIABLES:"INFO_NODE_SET_VARIABLES",INFO_NODE_UNSET_VARIABLES:"INFO_NODE_UNSET_VARIABLES",INFO_NOT_CONNECTED_TO_FLOW:"INFO_NOT_CONNECTED_TO_FLOW",INFO_STATUS_ERROR:"INFO_STATUS_ERROR",INFO_STATUS_ERROR_OUT_OF_SYNC:"INFO_STATUS_ERROR_OUT_OF_SYNC",INPUT:"INPUT",INVALID_SETTINGS:"INVALID_SETTINGS",JSON_OBJECT:"JSON_OBJECT",KEY:"KEY",KEYPAD_VALUE:"KEYPAD_VALUE",LANGUAGE:"LANGUAGE",MALE:"MALE",MAXIMUM_RECORDING_LENGTH:"MAXIMUM_RECORDING_LENGTH",META:"META",METHOD:"METHOD",MORE_INFO_DEPLOY:"MORE_INFO_DEPLOY",MORE_INFO_DEPLOY_ERROR:"MORE_INFO_DEPLOY_ERROR",MORE_INFO_STATUS_ERROR:"MORE_INFO_STATUS_ERROR",MORE_INFO_TESTING_YOUR_FLOW:"MORE_INFO_TESTING_YOUR_FLOW",MORE_INFO_TITLE:"MORE_INFO_TITLE",MORE_WITH_COUNT:"MORE_WITH_COUNT",NAVIGATE_BACK:"NAVIGATE_BACK",NOT_CONNECTED_TO_FLOW:"NOT_CONNECTED_TO_FLOW",NO_ANSWER:"NO_ANSWER",NO_DEPLOYED_VERSIONS:"NO_DEPLOYED_VERSIONS",NO_INPUT:"NO_INPUT",NO_VARIABLES_SET:"NO_VARIABLES_SET",NUMBER_OF_VALIDATION_WARNINGS:"NUMBER_OF_VALIDATION_WARNINGS",NUMBER_OF_VARIABLES_SELECTED:"NUMBER_OF_VARIABLES_SELECTED",OFF:"OFF",ON:"ON",OPTIONAL:"OPTIONAL",OPTION_NUMBER:"OPTION_NUMBER",OPT_NUMBER:"OPTION_NUMBER",OR_CALLER_SAYS:"OR_CALLER_SAYS",OR_SAYS:"OR_SAYS",PARAMS:"PARAMS",PHONE_NUMBER:"PHONE_NUMBER",PHONE_NUMBER_NUMBER:"PHONE_NUMBER_NUMBER",PKG_VERSION:"PKG_VERSION",PLAY_AUDIO:"PLAY_AUDIO",PLAY_AUDIO_FILE:"PLAY_AUDIO_FILE",PLAY_AUDIO_TTS:"PLAY_AUDIO_TTS",PREVIEW_DEPLOYED_VERSION:"PREVIEW_DEPLOYED_VERSION",REASON:"REASON",RECORD:"RECORD",RECORDING:"RECORDING",RECORDING_NAME:"RECORDING_NAME",RECORDING_NAME_DEFAULT:"RECORDING_NAME_DEFAULT",RECORD_CALL_START:"RECORD_CALL_START",RECORD_CALL_STOP:"RECORD_CALL_STOP",REMOVE_ADDRESS:"REMOVE_ADDRESS",REMOVE_CONDITION:"REMOVE_CONDITION",REMOVE_EDGE:"REMOVE_EDGE",REMOVE_NODE:"REMOVE_NODE",REMOVE_OPTION:"REMOVE_OPTION",REMOVE_PHONE_NUMBER:"REMOVE_PHONE_NUMBER",REMOVE_RESOURCE:"REMOVE_RESOURCE",REMOVE_VARIABLE:"REMOVE_VARIABLE",REQUEST:"REQUEST",REQUEST_BODY:"REQUEST_BODY",REQUEST_HEADERS:"REQUEST_HEADERS",RESOURCE_NUMBER:"RESOURCE_NUMBER",RESTORE:"RESTORE",RESTORE_THIS_VERSION:"RESTORE_THIS_VERSION",RESYNC:"RESYNC",RESYNC_AI_AGENTS:"RESYNC_AI_AGENTS",SAVED:"SAVED",SAVE_VARIABLES:"SAVE_VARIABLES",SAVE_VARIABLES_SUBTITLE:"SAVE_VARIABLES_SUBTITLE",SECONDS:"SECONDS",SELECT:"SELECT",SELECT_VARIABLES:"SELECT_VARIABLES",SELECT_VARIABLES_TO_UNSET:"SELECT_VARIABLES_TO_UNSET",SEND_SMS:"SEND_SMS",SEPARATE_WITH_COMMAS:"SEPARATE_WITH_COMMAS",SEQUENTIALLY:"SEQUENTIALLY",SET_VARIABLES:"SET_VARIABLES",SIMULTANEOUSLY:"SIMULTANEOUSLY",SMS_TEXT:"SMS_TEXT",SPOKEN_PROMPT:"SPOKEN_PROMPT",STATUS_DEPLOY:"STATUS_DEPLOY",STATUS_DEPLOYED:"STATUS_DEPLOYED",STATUS_DEPLOYING:"STATUS_DEPLOYING",STATUS_DEPLOY_ERROR:"STATUS_DEPLOY_ERROR",STATUS_ERROR:"STATUS_ERROR",STATUS_LOADING:"STATUS_LOADING",STATUS_LOCKED:"STATUS_LOCKED",STATUS_SAVED:"STATUS_SAVED",STATUS_SAVING:"STATUS_SAVING",STEREO:"STEREO",STEREO_SUBTITLE:"STEREO_SUBTITLE",STRING_OR_JSON:"STRING_OR_JSON",SUCCESS:"SUCCESS",SWML_VERSION:"SWML_VERSION",TERMINATORS:"TERMINATORS",TEXT:"TEXT",TEXT_TO_SPEECH:"TEXT_TO_SPEECH",TIMEOUT:"TIMEOUT",TO:"TO",TOAST_DEPLOY_WARNING:"TOAST_DEPLOY_WARNING",TOAST_DOCUMENT_OUT_OF_SYNC:"TOAST_DOCUMENT_OUT_OF_SYNC",TO_PHONE_NUMBER:"TO_PHONE_NUMBER",UNKNOWN:"UNKNOWN",UNSET_VARIABLES:"UNSET_VARIABLES",URL:"URL",VALUE:"VALUE",VARIABLE_KEY:"VARIABLE_KEY",VARIABLE_NUMBER:"VARIABLE_NUMBER",VERSION_HISTORY:"VERSION_HISTORY",VERSION_LIST_ITEM:"VERSION_LIST_ITEM",VERSION_RESTORED:"VERSION_RESTORED",VOICE:"VOICE",VOICEMAIL_RECORDING:"VOICEMAIL_RECORDING",WAIT_FOR_DIGIT:"WAIT_FOR_DIGIT",WAIT_FOR_INPUT:"WAIT_FOR_INPUT",WARNING:"WARNING",WRITE_SOMETHING:"WRITE_SOMETHING"},mC={order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag","path","subdomain"],lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupQuerystring:"lng",lookupSessionStorage:"i18nextLng",caches:["localStorage","cookie"],excludeCacheFor:["cimode"]},vC={"en-US":{translation:gC}},EC=async()=>{await Ce.use(Iy).use(hb).init({debug:jA,detection:mC,fallbackLng:"en-US",interpolation:{escapeValue:!1},keySeparator:!1,resources:vC})};function A(e,t){return t?Ce.t(e,t):Ce.t(e)}function Fl(e,t={}){return u.jsx(Xb,{label:e,vars:t})}const L0=()=>Ce.resolvedLanguage,yC={entries:[],nextLabelIndex:0},Go=us((e,t)=>({...yC,actions:{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="",r=t().nextLabelIndex;do r++,n=A(w.RECORDING_NAME_DEFAULT,{index:r});while(this.isValueDuplicate(n));return e({nextLabelIndex:r}),n},isKeyDuplicate(n){return t().entries.some(r=>r.controlId===n)},isValueDuplicate(n,r){const o=n.trim();return!!t().entries.reduce((s,a)=>{const{label:l,controlId:c}=a;return l!==""&&l===o&&(!r||c!==r)?[...s,a]:s},[]).length},removeEntry(n){e(r=>({entries:r.entries.filter(o=>o.controlId!==n)}))},upsertEntry:n=>{const{actions:r}=t(),{isKeyDuplicate:o}=r;e(i=>{let s=[...i.entries];const a=n.label.trim(),l=!!a;return(o(n.controlId)||!l)&&(s=s.filter(c=>c.controlId!==n.controlId)),l&&s.push({...n,label:a}),{entries:s}})}}})),Lf=()=>Go.getState().actions,D0=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})}),Go.setState({entries:t,nextLabelIndex:t.length})},_C=(e,t)=>{const n=[];return t.forEach(r=>{r.type==="recordCallStart"&&r.data.controlId&&(n.push(r.data.controlId),Go.getState().actions.removeEntry(r.data.controlId))}),n.length?e.reduce((r,o)=>o.type==="recordCallStop"&&n.includes(o.data.controlId)?[...r,{...o,data:{...o.data,controlId:""}}]:r,[]):[]},k0={recordCallStart:e=>{const t=Go.getState().actions.getGeneratedLabel();return Go.getState().actions.upsertEntry({controlId:e.data.controlId,label:t}),{...e,data:{...e.data,label:t}}}},SC=e=>typeof e=="object"&&e!==null&&Object.keys(e).length>0,xC=e=>k0[e.type]!==void 0,P0=(e,t={})=>{const{deletable:n=!0,position:r={x:300,y:250},selected:o=!0}=t,i=()=>({data:{initial:!0,valid:!1},deletable:n,id:ie(),position:r,selected:o,type:e}),s=(c,d)=>({...c,data:{...c.data,...d}});let a=i();const l=ZE[e]();return SC(l)&&(a=s(a,l)),xC(a)&&(a=k0[a.type](a)),a},Vl={action:{label:w.ACTION,nodes:{answer:{active:!0,label:w.ANSWER_CALL},hangup:{active:!0,infoLabel:w.INFO_NODE_HANG_UP,label:w.HANG_UP_CALL},play:{active:!0,infoLabel:w.INFO_NODE_PLAY,label:w.PLAY_AUDIO_TTS},sendSms:{active:!0,infoLabel:w.INFO_NODE_SEND_SMS,label:w.SEND_SMS}}},decision:{label:w.DECISION,nodes:{cond:{active:!0,infoLabel:w.INFO_NODE_COND,label:w.CONDITIONS},executeSWML:{active:!0,infoLabel:w.INFO_NODE_EXECUTE_SWML,label:w.EXECUTE_SWML},set:{active:!0,infoLabel:w.INFO_NODE_SET_VARIABLES,label:w.SET_VARIABLES},unset:{active:!0,infoLabel:w.INFO_NODE_UNSET_VARIABLES,label:w.UNSET_VARIABLES}}},forwardTo:{label:w.FORWARD,nodes:{forwardAddress:{active:!1,infoLabel:w.INFO_NODE_FORWARD_TO_ADDRESS,label:w.FORWARD_TO_ADDRESS},forwardPhone:{active:!0,infoLabel:w.INFO_NODE_FORWARD_TO_PHONE,label:w.FORWARD_TO_PHONE},forwardResource:{active:!1,infoLabel:w.INFO_NODE_FORWARD_TO_RESOURCE,label:w.FORWARD_TO_RESOURCE}}},hidden:{label:w.HIDDEN,nodes:{handleCall:{active:!0,label:w.HANDLE_CALL}}},input:{label:w.INPUT,nodes:{aiAgent:{active:!0,infoLabel:w.INFO_NODE_AI_AGENT,label:w.AI_AGENT},condRequest:{active:!0,infoLabel:w.INFO_NODE_CONDREQUEST,label:w.REQUEST},promptPlay:{active:!0,infoLabel:w.INFO_NODE_GATHER_INPUT,label:w.GATHER_INPUT},request:{active:!1,deprecated:!0,infoLabel:w.INFO_NODE_REQUEST,label:w.REQUEST}}},recording:{label:w.RECORD,nodes:{record:{active:!0,infoLabel:w.INFO_NODE_RECORD,label:w.VOICEMAIL_RECORDING},recordCallStart:{active:!0,infoLabel:w.INFO_NODE_RECORD_CALL_START,label:w.RECORD_CALL_START},recordCallStop:{active:!0,infoLabel:w.INFO_NODE_RECORD_CALL_STOP,label:w.RECORD_CALL_STOP}}}},RC=Object.entries(Vl).reduce((e,[,{nodes:t}])=>(Object.entries(t).forEach(([n,{label:r}])=>{e.set(n,r)}),e),new Map),NC=Object.entries(Vl).reduce((e,[,{nodes:t}])=>(Object.entries(t).forEach(([n,{infoLabel:r}])=>{e.set(n,r)}),e),new Map),$l=Ae(),wC={aiAgentMap:new Map,error:"",status:"initial"},OC=(e,t)=>({...wC,actions:{fetchAiAgents:async()=>{try{const{actions:n}=t(),{getAiAgents:r}=n;if(!r){$l.error("getAiAgents is not defined");return}e({status:"loading"});const o=await r(),i=qA(o.data,"asc","display_name"),s=new Map(i.map(a=>[a.id,a]));e({aiAgentMap:s,error:"",status:"loaded"})}catch(n){let r="Unknown error";$l.error("Error fetching aiAgents ",n),n instanceof Error&&(r=n.message),e({aiAgentMap:new Map,error:r,status:"error"})}},init:({getAiAgentsURL:n})=>{if(!n){$l.error("getAiAgentsURL is not defined");return}const r=gp({getAiAgentsURL:n,headers:YE()}),o=async()=>await r.getAiAgents();e(i=>({...i,actions:{...i.actions,getAiAgents:o}}))}}}),M0=(e,t)=>{if(e.find(r=>r.type==="aiAgent")){const{fetchAiAgents:r}=un.getState().actions;r().then(()=>{const{aiAgentMap:o,status:i}=un.getState();i==="loaded"&&e.forEach(s=>{if(s.data&&"agent"in s.data){const a=o.has(s.data.agent);a||t(s.id,{agent:a?s.data.agent:"",valid:a})}})}).catch(o=>$l.error("Error rehydrating AiAgentStore",o))}},un=us()(OC),TC=()=>un.getState().actions;window.__useAiAgentStore=un;const AC=e=>!!(e&&e>=VA),IC=e=>(t,n,r)=>(r.setState=(o,i,...s)=>{const{edges:a,detachedMode:l,httpError:c,initializing:d,isCanvasInteractive:f,isInteractiveControlOn:p,nodes:h,rootAppWidth:v,viewportChanging:E}=n(),y=typeof o=="function"?o(n()):o,g=["detachedMode","httpError","initializing","isInteractiveControlOn","rootAppWidth","viewportChanging"],m="initializing"in y?y.initializing:d;if(g.some(_=>_ in y)){const _=AC("rootAppWidth"in y?y.rootAppWidth:v),S="isInteractiveControlOn"in y?y.isInteractiveControlOn:p,x="detachedMode"in y?y.detachedMode:l,R=("httpError"in y?y.httpError:c)===GE,I="viewportChanging"in y?y.viewportChanging:E;if(y.isCanvasInteractive=!!(_&&S&&!x&&!m&&!R&&!I),y.showInteractiveControl=_&&!R&&!x,f&&!y.isCanvasInteractive){const L="nodes"in y?y.nodes:h;y.nodes=L.map(T=>({...T,selected:!1}));const U="edges"in y?y.edges:a;y.edges=U.map(T=>({...T,selected:!1})),y.selectedNode=void 0}}t(y,i,...s)},e(r.setState,n,r)),j0=1e3,Rs=Ae(),bC=e=>(t,n,r)=>{let o,i;const s=async()=>{const{httpService:a,nodes:l,edges:c,documentVersion:d}=n();t({dataHandlingStatus:"saving",saveFlowStatus:"saving"}),clearTimeout(i);try{if(!a)throw new Error("Missing httpService");const f=await a.putFlow({documentVersion:d,edges:c,flowDataVersion:ds,nodes:l}),p={documentLastUpdated:f.updated_at,documentVersion:f.document_version},h=n().dataHandlingStatus;switch(h){case"saving":t({...p,dataHandlingStatus:"queueing",deployFlowStatus:"deploy",saveFlowStatus:"saved"});break;case"holding":t({...p,saveFlowStatus:"awaiting-save"}),Rs.debug("Setting up a new save for held changes"),i=setTimeout(()=>{s().catch(v=>{Rs.error("Error Save Flow",v)})},j0);break;default:Rs.debug("Invalid dataHandlingStatus",h)}}catch(f){Rs.error("Put Flow",f),f instanceof Error&&f.message.includes($A)?t({dataHandlingStatus:"holding",httpError:"document-sync",saveFlowStatus:"error"}):t({dataHandlingStatus:"queueing",saveFlowStatus:"error"})}};return r.setState=(a,l,...c)=>{const{dataHandlingStatus:d,detachedMode:f,initializing:p,saveFlowStatus:h}=n(),v=typeof a=="function"?a(n()):a,E="initializing"in v?v.initializing:p,y="detachedMode"in v?v.detachedMode:f;!E&&!y&&(v.nodes||v.edges)?d==="queueing"?(v.saveFlowStatus="awaiting-save",t(v,l,...c),clearTimeout(o),o=setTimeout(()=>{s().catch(m=>{Rs.error("Error Save Flow",m)})},j0)):(v.dataHandlingStatus="holding",t(v,l,...c)):"initializing"in v&&!v.initializing?(v.dataHandlingStatus="queueing",h!=="error"&&(v.saveFlowStatus="saved"),t(v,l,...c)):t(v,l,...c)},e(r.setState,n,r)},U0=500,CC=100,Re=Ae(),LC=P0("handleCall",{deletable:!1,position:{x:300,y:100}}),Df={backButtonHref:void 0,colorMode:"light",dataHandlingStatus:"queueing",deployFlowStatus:"deploy",deployFlowURL:"",deployedVersionsList:[],detachedMode:!1,documentLastUpdated:void 0,documentVersion:0,dragNodeType:void 0,edges:[],flowId:"",flowTitle:"",flowWrapperElement:void 0,getFlowURL:"",httpError:void 0,httpService:void 0,initializing:!0,isCanvasInteractive:!1,isDraggingNode:!1,isEdgeConnecting:!1,isEdgeUpdateSuccessful:!1,isInteractiveControlOn:!0,nodes:[],reactFlowInstance:void 0,rootAppHeight:void 0,rootAppWidth:void 0,rootElement:void 0,rootElementId:"",saveFlowStatus:"initial",selectedNode:void 0,showDeployWarning:!1,showDeployedHistory:!1,showDeployedHistoryToast:!1,showInteractiveControl:!0,showValidationWarnings:!1,toastsMap:new Map,updateFlowURL:"",updatingSourceHandleId:void 0,validationWarnings:new Map,viewport:{x:0,y:0,zoom:1},viewportChanging:!1,workingFlowCopy:void 0},DC=(e,t)=>({...Df,actions:{addNode:({nodeType:n,x:r=150,y:o=150})=>{Re.debug("Add Node",n);const{nodes:i,reactFlowInstance:s}=t();if(!s)throw new Error("ReactFlowInstance not found");const a=P0(n,{position:s.project({x:r,y:o})}),l=i.map(c=>({...c,selected:!1}));l.push(a),e({nodes:l,selectedNode:a})},addToast:n=>{const{toastsMap:r}=t(),o=ie();r.set(o,{...n,id:o}),e({toastsMap:new Map(r)})},cancelDetachedMode:async()=>{const{actions:n,workingFlowCopy:r}=t(),{cleanUpDetachedMode:o}=n;if(r){const{edges:i,nodes:s,saveFlowStatus:a}=r;e({edges:[],initializing:!0,nodes:[]}),await JE(U0),e({edges:i,nodes:s,saveFlowStatus:a})}else Re.error("There was no working flow to restore");o()},cleanUpDetachedMode:()=>{e({detachedMode:!1,showDeployedHistory:!1,showDeployedHistoryToast:!1,workingFlowCopy:void 0})},deleteToast:n=>{const{toastsMap:r}=t();r.delete(n)&&e({toastsMap:new Map(r)})},deleteValidationWarning:n=>{const{validationWarnings:r}=t();r.delete(n)&&e({validationWarnings:new Map(r)})},deployFlow:async()=>{Re.info("Deploying..."),e({deployFlowStatus:"deploying"});try{const{httpService:n,documentVersion:r}=t();if(!n)throw new Error("Missing httpService");const o=await n.deployFlow({documentVersion:r});Re.info("Deploy response",o),e({deployFlowStatus:"deployed"})}catch(n){throw Re.info("Deploy error",n),e({deployFlowStatus:"error"}),n}},exportStoreData:()=>{const{nodes:n,edges:r}=t();QA(n,r)},getDeployedVersionsList:async n=>{try{const{httpService:r}=t();if(!r)throw new Error("Missing httpService");const o=await r.getFlowVersions(n),i=qE(L0());return e({deployedVersionsList:o.map((s,a)=>({id:s.id,relativeTimeSince:i(s.created_at),version:(o.length-a).toFixed(1)}))}),o}catch(r){throw Re.error("Could not get deployed versions",r),e({deployedVersionsList:[]}),r}},getNodeType:n=>{const r=t().nodes.find(o=>o.id===n);return r==null?void 0:r.type},getRootElement:()=>{const{rootElement:n,rootElementId:r}=t();if(!n)throw new Error(`Root element not found for ID ${r}`);return n.shadowRoot?n.shadowRoot.getRootNode():n},getTargetEdges:n=>t().edges.filter(r=>{const o=r.target===n,i=r.source!==r.target;return o&&i}),getValidationWarnings:()=>t().validationWarnings,migrateAndLoadDeployedFlow:async n=>{const{actions:r,workingFlowCopy:o}=t(),{partialUpdateNodeData:i,saveWorkingFlowCopy:s}=r,l=new mp({dbRecord:n}).migrateTo(ds),{flow_data:c}=l;if(!c)Re.error("Cannot load flow: missing flowData",c);else{o||s();const d=c.nodes.map(QE),f=c.edges.map(KE);e({detachedMode:!0,edges:[],initializing:!0,nodes:[]}),await JE(U0),e({edges:f,nodes:d,showDeployedHistoryToast:!0}),D0(d),M0(d,i)}},onConnect:n=>{Re.debug("onConnect"),e({edges:Bv(n,t().edges)})},onConnectEnd:()=>{Re.debug("onConnectEnd"),e({isEdgeConnecting:!1})},onConnectStart:()=>{Re.debug("onConnectStart"),e({isEdgeConnecting:!0})},onEdgeUpdate:(n,r)=>{Re.debug("onEdgeUpdate"),e({edges:WO(n,r,t().edges),isEdgeUpdateSuccessful:!0})},onEdgeUpdateEnd:(n,r)=>{var o;Re.debug("onEdgeUpdateEnd"),t().isEdgeUpdateSuccessful?e({isEdgeUpdateSuccessful:!0}):(o=t().reactFlowInstance)==null||o.deleteElements({edges:[{id:r.id}]}),e({updatingSourceHandleId:void 0})},onEdgeUpdateStart:(n,r)=>{Re.debug("onEdgeUpdateStart"),e({isEdgeUpdateSuccessful:!1,updatingSourceHandleId:r.sourceHandle??void 0})},onEdgesChange:n=>{e({edges:RT(n,t().edges)})},onEdgesDelete:n=>{Re.debug("onEdgesDelete [noop]",n)},onInit:async n=>{const{actions:r,deployFlowURL:o,getFlowURL:i,updateFlowURL:s}=t(),{partialUpdateNodeData:a}=r;Re.log("onInit",{getFlowURL:i,updateFlowURL:s});try{const l=gp({deployFlowURL:o,getFlowURL:i,headers:YE(),updateFlowURL:s}),[c,d]=await Promise.all([l.getFlow(),l.getFlowVersions({pageSize:1})]),p=new mp({dbRecord:c}).migrateTo(ds),{document_version:h,flow_data:v,id:E,title:y,updated_at:g}=p;if(d.length&&d[0]){const{document_version:_}=d[0];_===h&&e({deployFlowStatus:"deployed"})}let m=v;m||(m={edges:Df.edges,flowDataVersion:ds,nodes:Df.nodes.concat([LC])}),e({documentLastUpdated:g,documentVersion:h,edges:m.edges.map(KE),flowId:E,flowTitle:y,httpService:l,nodes:m.nodes.map(QE),reactFlowInstance:n}),D0(m.nodes),M0(m.nodes,a)}catch(l){Re.error("Could not load flow. URL:",i);let c="unknown";l instanceof Error&&l.message.includes(BA)&&(c="not-found"),e({httpError:c})}},onNodeDragStart:()=>{e({isDraggingNode:!0})},onNodeDragStop:()=>{e({isDraggingNode:!1})},onNodesChange:n=>{const r=n.filter(o=>o.type!=="dimensions");r.length>0&&e({nodes:vE(r,t().nodes)})},onNodesDelete:n=>{Re.debug("onNodesDelete");const{actions:r}=t(),{partialUpdateNodeData:o}=r;_C(t().nodes,n).forEach(s=>{o(s.id,s.data)})},onSelectionChange:({nodes:n})=>{e({selectedNode:n.find(r=>r.selected)})},onViewportChange:(()=>{let n;function r(o){n&&clearTimeout(n),n=setTimeout(()=>{e({viewportChanging:!1})},CC),e({viewport:{...o},viewportChanging:!0})}return r})(),onViewportChangeEnd:()=>{},onViewportChangeStart:()=>{},partialUpdateNodeData:(n,r)=>{var s;Re.debug("partialUpdateNodeData",n,r);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(d=>d.id),c=r.options.map(d=>d.id);o.push(...l.filter(d=>!c.includes(d)))}return{...a,data:{...a.data,...r}}}return a});if(o.length){const a=t().edges.filter(l=>l.sourceHandle&&o.includes(l.sourceHandle));Re.debug("Remove orphaned edges",{edgesToDelete:a,sourceHandleDeleted:o}),(s=t().reactFlowInstance)==null||s.deleteElements({edges:a})}e({nodes:i})},partialUpdateValidationWarning:(n,r)=>{const{validationWarnings:o}=t(),i=a=>a.connected===!1||a.valid===!1,s=o.get(n);if(r.nodeType!=="handleCall"&&!s&&i(r)){const a=RC.get(r.nodeType),l={connected:r.connected,id:ie(),nodeId:r.nodeId,nodeTitle:a,nodeType:r.nodeType,valid:r.valid};o.set(n,l)}else if(s){const a={...s,...r};i(a)?o.set(n,a):o.delete(n)}e({validationWarnings:new Map(o)})},removeEdge:n=>{Re.debug("removeEdge",n);const r=t().reactFlowInstance;r&&r.deleteElements({edges:[{id:n}]})},removeNode:n=>{Re.debug("removeNode",n);const r=t().reactFlowInstance;r&&r.deleteElements({nodes:[{id:n}]})},restoreDeployedFlow:()=>{const{actions:n,edges:r,nodes:o}=t(),{cleanUpDetachedMode:i}=n;e({detachedMode:!1,edges:r,nodes:o}),i()},saveWorkingFlowCopy:()=>{const{edges:n,nodes:r,saveFlowStatus:o}=t();e({workingFlowCopy:{edges:n,nodes:r,saveFlowStatus:o}})},setColorMode:n=>{e({colorMode:n})},setDragNodeType:n=>{e({dragNodeType:n})},setFlowWrapperElement:n=>{e({flowWrapperElement:n||void 0})},setInitializing:n=>{e({initializing:n})},setSelectedNodes:n=>{const{nodes:r}=t(),o=r.map(i=>({...i,selected:n.includes(i.id)}));e({nodes:o})},setShowDeployWarning:n=>{e({showDeployWarning:n})},setShowDeployedHistory:n=>{e({showDeployedHistory:n})},setShowValidationWarnings:n=>{e({showValidationWarnings:n})},setViewportChanging:n=>{e({viewportChanging:n})}}}),Y=us()(IC(bC(DC))),Se=()=>Y.getState().actions;window.__useRFStore=Y;const kC={"not-found":{message:"Please ensure that the Call Flow exists and the URL is correct.",status:"404",title:"Call Flow not found"},unknown:{message:"An unknown error occurred. Please try again or go back.",status:"",title:"Unknown error"}},PC=({errorType:e})=>{const t=Y(i=>i.backButtonHref),{title:n,message:r,status:o}=kC[e];return u.jsx("section",{className:"flex min-h-full w-full items-center justify-center bg-background px-6",children:u.jsxs("div",{className:"text-center",children:[o&&u.jsx("p",{className:"text-2xl font-semibold text-foreground/50",children:o}),u.jsx("h1",{className:"mt-4 text-3xl font-bold tracking-tight text-foreground",children:n}),u.jsx("p",{className:"mt-6 leading-7 text-foreground",children:r}),t&&u.jsx("div",{className:"mt-8 flex items-center justify-center gap-x-6",children:u.jsx("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:A(w.GO_BACK)})})]})})},qj="",F0=({height:e,strokeWidth:t,toX:n,toY:r,width:o})=>u.jsx("svg",{x:n-o*t/2,y:r-e*t/2,height:e*t,width:o*t,viewBox:`-${o/2} -${e/2} ${o} ${e}`,children:u.jsx("g",{children:u.jsx("polyline",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:t,points:"-5,-4 0,0 -5,4 -5,-4"})})}),MC=({fromHandle:e,fromNode:t,fromPosition:n,fromX:r,fromY:o,toPosition:i,toX:s,toY:a})=>{if(!t)return null;const[l]=ss({borderRadius:WE,sourcePosition:n,sourceX:r,sourceY:o,targetPosition:i,targetX:s,targetY:a}),{height:c,strokeWidth:d,width:f}={...Fo.markerEnd,...Fo.style},p=(e==null?void 0:e.position)===K.Left,h=p?r:s,v=p?o:a;return u.jsxs("g",{className:"cfb-connection-line",children:[u.jsx("path",{fill:"none",strokeWidth:d,className:"animated",d:l}),u.jsx(F0,{height:c,strokeWidth:d,toX:h,toY:v,width:f}),p&&u.jsx("circle",{cx:s-2,cy:a,fill:"none",r:4,strokeWidth:d})]})};function jC({isCircular:e=!1,targetNode:t,targetX:n,targetY:r}){const{width:o,height:i,position:s}=t,a=o??0,l=i??0,c=a/2;return e?{tx:s.x+c,ty:s.y+l}:{tx:n,ty:r}}const UC=e=>{const t={...e,interactionWidth:40},{id:n,source:r,target:o,sourcePosition:i,sourceX:s,sourceY:a,targetX:l,targetY:c}=t,{removeEdge:d}=Se(),f=N.useRef(null),p=ae(N.useCallback(T=>T.nodeInternals.get(r),[r])),h=ae(N.useCallback(T=>T.nodeInternals.get(o),[o]));if(!p||!h)return null;const v=r===o,{tx:E,ty:y}=jC({isCircular:v,targetNode:h,targetX:l,targetY:c}),[g,m,_]=ss({borderRadius:WE,sourcePosition:i,sourceX:s,sourceY:a,targetPosition:v?K.Bottom:K.Left,targetX:E,targetY:y}),S=(T,b)=>{T.stopPropagation(),d(b)},x=T=>{var b,V,M;(b=T.currentTarget)==null||b.classList.add("highlight"),(V=f.current)==null||V.classList.add("animate-delay-opacity","flex"),(M=f.current)==null||M.classList.remove("hidden")},R=T=>{var b,V,M;(b=T.currentTarget)==null||b.classList.remove("highlight"),(V=f.current)==null||V.classList.remove("animate-delay-opacity","flex"),(M=f.current)==null||M.classList.add("hidden")},{height:I,strokeWidth:L,width:U}={...Fo.markerEnd,...Fo.style};return u.jsxs("g",{onMouseEnter:x,onMouseLeave:R,children:[u.jsx(Io,{path:g,...t}),u.jsx(F0,{height:I,strokeWidth:L,toX:E,toY:y,width:U}),u.jsx(mA,{children:u.jsxs("button",{className:"nodrag nopan pointer-events-auto absolute hidden h-[18px] w-[26px] cursor-pointer items-center justify-center rounded-full bg-foreground/90 opacity-0 hover:h-[22px] hover:w-[30px] hover:border-2 hover:border-focus",onClick:T=>S(T,n),ref:f,style:{transform:`translate(-50%, -50%) translate(${m}px,${_}px)`},children:[u.jsx(te,{tag:"trash-can",className:"py-0.5 px-1.5 text-background"}),u.jsx("span",{className:"sr-only",children:A(w.REMOVE_EDGE)})]})})]})},FC=/^[\w\d -']+$/,VC=/^\d+$/,$C=/^\d|\*|#$/,BC=/^[\d*#$]{0,12}$/,HC=/^.{1,20}$/,Yo={MAX:3600,MIN:0},zC=/^[a-z0-9_]{1,20}$/,Ct={MAX:99,MIN:1},Ko=e=>t=>!!e.exec(t),Kt=e=>Tt(e)?Ko(VC)(e):!0,WC=e=>Tt(e)?Ko($C)(e):!0,GC=e=>Tt(e)?Ko(FC)(e):!0,YC=e=>Tt(e)?Ko(zC)(e):!0,V0=e=>Tt(e)?Ko(BC)(e):!0,KC=e=>Tt(e)?Ko(HC)(e):!0,Bl=e=>{if(!Tt(e))return!0;try{return JSON.parse(e),!0}catch{return!1}},fe=e=>!!Tt(e),kf=(e,t)=>{if(typeof e=="string"&&!Tt(e))return!0;const n=typeof e!="number"?parseInt(e,10):e;return!Number.isNaN(n)&&n>=t},Pf=(e,t)=>{if(typeof e=="string"&&!Tt(e))return!0;const n=typeof e!="number"?parseInt(e,10):e;return!Number.isNaN(n)&&n<=t},ar=(e,t)=>{const n=new Set,r=e.reduce((o,i)=>{const s=i[t];if(typeof s=="string"){const a=s.trim();a&&(n.has(a)&&o.add(a),n.add(a))}return o},new Set);return o=>r.has(o.trim())},Qo={aiAgent:{fieldValidators:{agent:[fe]},validate:e=>Xo({nodeData:e,nodeType:"aiAgent"}),validateField:(e,t)=>oe({name:e,nodeType:"aiAgent",value:t})},cond:{fieldValidators:{value:[fe]},validate:e=>Mf("cond",e),validateField:(e,t)=>oe({name:e,nodeType:"cond",value:t})},condRequest:{fieldValidators:{body:[],headers:[Bl],method:[fe],saveVariables:[],url:[fe],value:[fe]},validate:e=>{const t=e,n=[];return["body","headers","method","saveVariables","url"].forEach(o=>{oe({name:o,nodeType:"condRequest",value:t[o]})||n.push(o)}),[...n,...Mf("condRequest",e)]},validateField:(e,t)=>oe({name:e,nodeType:"condRequest",value:t})},executeSWML:{fieldValidators:{dest:[fe],meta:[Bl],params:[Bl]},validate:e=>{const t=e,n=[];return["dest","params","meta"].forEach(o=>{oe({name:o,nodeType:"executeSWML",value:t[o]})||n.push(o)}),[...n,...Mf("executeSWML",e)]},validateField:(e,t)=>oe({name:e,nodeType:"executeSWML",value:t})},forwardAddress:{fieldValidators:{callOrder:[],callStateEvents:[],callStateUrl:[],connectFrom:[],connectTimeout:[Kt],connectTo:[fe],defaultFrom:[],defaultTimeout:[Kt],sessionTimeout:[Kt]},validate:e=>jf("forwardAddress",e),validateField:(e,t)=>oe({name:e,nodeType:"forwardAddress",value:t})},forwardPhone:{fieldValidators:{callOrder:[],callStateEvents:[],callStateUrl:[],connectFrom:[],connectTimeout:[Kt],connectTo:[fe],defaultFrom:[],defaultTimeout:[Kt]},validate:e=>jf("forwardPhone",e),validateField:(e,t)=>oe({name:e,nodeType:"forwardPhone",value:t})},forwardResource:{fieldValidators:{callOrder:[],callStateEvents:[],callStateUrl:[],connectFrom:[],connectTimeout:[Kt],connectTo:[fe],defaultFrom:[],defaultTimeout:[Kt],sessionTimeout:[Kt]},validate:e=>jf("forwardResource",e),validateField:(e,t)=>oe({name:e,nodeType:"forwardResource",value:t})},hangup:{fieldValidators:{reason:[]},validate:e=>Uf("hangup",e),validateField:(e,t)=>oe({name:e,nodeType:"hangup",value:t})},play:{fieldValidators:{selected:[fe],text:[fe],url:[fe]},validate:e=>Uf("play",e),validateField:(e,t)=>oe({name:e,nodeType:"play",value:t})},promptPlay:{fieldValidators:{command:[GC],digit:[WC],digitTimeout:[Kt,{test:kf,testValue:Ct.MIN},{test:Pf,testValue:Ct.MAX}],initialTimeout:[Kt,{test:kf,testValue:Ct.MIN},{test:Pf,testValue:Ct.MAX}],selected:[fe],text:[fe],url:[fe]},validate:e=>{const t="promptPlay",n=e,r=ar(n.options,"command"),o=ar(n.options,"digit"),i=Uf("promptPlay",n),s=ec(n.initialTimeout);s!=null&&s.trim()&&!oe({name:"initialTimeout",nodeType:t,value:s})&&i.push("initialTimeout");const a=ec(n.digitTimeout);return a!=null&&a.trim()&&!oe({name:"digitTimeout",nodeType:t,value:a})&&i.push("digitTimeout"),n.options.forEach(l=>{const c=oe({name:"command",nodeType:t,value:l.command})&&!r(l.command),d=oe({name:"digit",nodeType:t,value:l.digit})&&!o(l.digit);c&&d&&(l.command||l.digit)||i.push(`option_${l.id}`)}),i},validateField:(e,t)=>oe({name:e,nodeType:"promptPlay",value:t})},record:{fieldValidators:{beep:[],format:[fe],maxLength:[Kt,{test:kf,testValue:Yo.MIN},{test:Pf,testValue:Yo.MAX}],stereo:[],terminators:[V0]},validate:e=>Xo({nodeData:e,nodeType:"record"}),validateField:(e,t)=>oe({name:e,nodeType:"record",value:t})},recordCallStart:{fieldValidators:{beep:[],controlId:[],format:[fe],label:[fe,KC],stereo:[],terminators:[V0]},validate:e=>Xo({nodeData:e,nodeType:"recordCallStart"}),validateField:(e,t)=>oe({name:e,nodeType:"recordCallStart",value:t})},recordCallStop:{fieldValidators:{controlId:[fe]},validate:e=>Xo({nodeData:e,nodeType:"recordCallStop"}),validateField:(e,t)=>oe({name:e,nodeType:"recordCallStop",value:t})},request:{fieldValidators:{body:[],headers:[Bl],method:[fe],saveVariables:[],url:[fe]},validate:e=>Xo({nodeData:e,nodeType:"request"}),validateField:(e,t)=>oe({name:e,nodeType:"request",value:t})},sendSms:{fieldValidators:{body:[fe],fromNumber:[fe],toNumber:[fe]},validate:e=>Xo({nodeData:e,nodeType:"sendSms"}),validateField:(e,t)=>oe({name:e,nodeType:"sendSms",value:t})},set:{fieldValidators:{key:[fe,YC],value:[]},validate:e=>{const t=e,n="set",r=[],o=ar(t.variables,"key");return t.variables.forEach(i=>{const s=oe({name:"key",nodeType:n,value:i.key})&&!o(i.key),a=oe({name:"value",nodeType:n,value:i.value});s&&a||r.push(`variable_${i.id}`)}),r},validateField:(e,t)=>oe({name:e,nodeType:"set",value:t})},unset:{fieldValidators:{},validate:e=>e.variables.length>0?[]:["variables"],validateField:(e,t)=>oe({name:e,nodeType:"unset",value:t})}},at=e=>{const t=Qo==null?void 0:Qo[e];return{validate:t==null?void 0:t.validate,validateField:t==null?void 0:t.validateField}},$0=(e,t)=>{var r;const n=(r=Qo[e])==null?void 0:r.validate;return n===void 0?[]:n(t)},B0=(e,t)=>{var n;return!e||!t?!1:((n=$0(e,t))==null?void 0:n.length)===0},oe=({name:e,nodeType:t,value:n})=>{var i,s;let r=!0;const o=(s=(i=Qo[t])==null?void 0:i.fieldValidators)==null?void 0:s[e];return o==null||o.forEach(a=>{typeof a=="function"?r=r&&a(n):r=r&&a.test(n,a.testValue)}),r},Xo=({nodeData:e,nodeType:t})=>{var o;const n=((o=Qo[t])==null?void 0:o.fieldValidators)??{},r=[];return Object.keys(n).forEach(i=>{const s=i;oe({name:i,nodeType:t,value:(e==null?void 0:e[s])??""})||r.push(i)}),r},Mf=(e,t)=>{const n=t,r=[];return n.options.forEach(o=>{oe({name:"value",nodeType:e,value:o.value})||r.push(`condition_${o.id}`)}),r},jf=(e,t)=>{var i;const n=[];["callOrder","callStateEvents","callStateUrl","defaultFrom","defaultTimeout"].forEach(s=>{oe({name:s,nodeType:e,value:t[s]})||n.push(s)});const o=["connectFrom","connectTo","connectTimeout"];return(i=t.connections)==null||i.forEach(s=>{o.forEach(a=>{oe({name:a,nodeType:e,value:s[a]})||n.push(`${a}_${s.id}`)})}),n},Uf=(e,t)=>{const n=[];return oe({name:"selected",nodeType:e,value:t==null?void 0:t.selected})||n.push("selected"),t.selected==="url"?oe({name:"url",nodeType:e,value:t.url})||n.push("url"):t.selected==="text"&&(oe({name:"text",nodeType:e,value:t.text})||n.push("text")),n},lt=({data:e,id:t})=>{const n=Y(a=>a.isCanvasInteractive),{getNodeType:r,partialUpdateNodeData:o}=Se(),{isValueDuplicate:i}=Lf(),s=r(t);return N.useEffect(()=>{if(s&&n){let a=B0(s,e);s==="recordCallStart"&&"label"in e&&(a=a&&!i(e.label,e.controlId)),a!==e.valid&&o(t,{valid:a})}},[e,t,n,i,o,s]),N.useEffect(()=>{if(s==="aiAgent"&&n){const a=un.subscribe(l=>{if(l.status==="loaded"&&"agent"in e){const c=l.aiAgentMap.has(e.agent),d=c&&B0(s,e);d!==e.valid&&o(t,{agent:c?e.agent:"",valid:d})}});return()=>{a()}}},[e,t,n,o,s]),{getInvalidFields:()=>!s||e.valid?[]:$0(s,e),valid:()=>e.valid}},QC=({data:e,id:t,isConnectable:n,selected:r})=>{lt({data:e,id:t});const o=un(s=>s.aiAgentMap.get(e.agent)),i=o==null?void 0:o.display_name;return u.jsxs(Ue,{id:t,isConnectable:n,nodeTitle:A(w.AI_AGENT),selected:r,valid:e.valid,children:[i&&u.jsx(bt,{children:u.jsx("p",{className:"truncate text-xs",children:i})}),u.jsx(zt,{id:t,color:"positive",isConnectable:n})]})},XC=({data:e,id:t,isConnectable:n,selected:r})=>u.jsx(Ue,{id:t,isConnectable:n,nodeTitle:A(w.ANSWER_CALL),selected:r,valid:e.valid,children:u.jsx(zt,{id:t,isConnectable:n,color:"positive"})}),qC=({id:e,data:t,isConnectable:n,selected:r})=>(lt({data:t,id:e}),u.jsx(Ue,{id:e,isConnectable:n,nodeTitle:A(w.CONDITIONS),selected:r,valid:t.valid,children:u.jsxs(Ho,{children:[t.options.map((o,i)=>{const s=o.value.trim();return u.jsx(Wt,{color:"positive",enabled:!!s,id:o.id,isConnectable:n,optionTitle:s?u.jsx("div",{className:"truncate",children:s}):A(w.CONDITION_NUMBER,{index:i+1})},o.id)}),u.jsx(Wt,{color:"negative",id:t.fallback,isConnectable:n,optionTitle:A(w.ELSE)})]})})),JC=({data:e,id:t,isConnectable:n,selected:r})=>{var i;lt({data:e,id:t});const o=e.url.trim();return u.jsxs(Ue,{id:t,isConnectable:n,nodeTitle:A(w.REQUEST),selected:r,valid:e.valid,children:[o&&u.jsx(bt,{children:u.jsx("div",{className:"break-all line-clamp-3",children:o})}),u.jsxs(Ho,{children:[(i=e==null?void 0:e.options)==null?void 0:i.map((s,a)=>{const l=s.value.trim();return u.jsx(Wt,{color:"positive",enabled:!!l,id:s.id,isConnectable:n,optionTitle:l?u.jsx("div",{className:"truncate",children:l}):A(w.CONDITION_NUMBER,{index:a+1})},s.id)}),u.jsx(Wt,{color:"negative",id:e.fallback,isConnectable:n,optionTitle:A(w.ELSE)}),u.jsx(Wt,{color:"negative",id:e.error,isConnectable:n,optionTitle:A(w.FAILURE)})]})]})},ZC=({data:e,id:t,isConnectable:n,selected:r})=>{var i;lt({data:e,id:t});const o=e.dest.trim();return u.jsxs(Ue,{id:t,isConnectable:n,nodeTitle:A(w.EXECUTE_SWML),selected:r,valid:e.valid,children:[o&&u.jsx(bt,{children:u.jsx("div",{className:"break-all line-clamp-3",children:o})}),u.jsxs(Ho,{children:[(i=e==null?void 0:e.options)==null?void 0:i.map((s,a)=>{const l=s.value.trim();return u.jsx(Wt,{color:"positive",enabled:!!l,id:s.id,isConnectable:n,optionTitle:l?u.jsx("div",{className:"truncate",children:l}):A(w.CONDITION_NUMBER,{index:a+1})},s.id)}),u.jsx(Wt,{color:"negative",id:e.fallback,isConnectable:n,optionTitle:A(w.ELSE)})]})]})},Ff=3,eL={busy:w.BUSY,decline:w.DECLINE,error:w.ERROR,noAnswer:w.NO_ANSWER,success:w.SUCCESS},tL={address:w.FORWARD_TO_ADDRESS,phone:w.FORWARD_TO_PHONE,resource:w.FORWARD_TO_RESOURCE},Vf=({id:e,data:t,isConnectable:n,selected:r})=>{lt({data:t,id:e});const o=t.connections.filter(s=>s.connectTo),i=o.slice(0,Ff);return u.jsxs(Ue,{id:e,isConnectable:n,nodeTitle:A(tL[t.destinationType]),selected:r,valid:t.valid,children:[o.length?u.jsxs(bt,{children:[u.jsx("ul",{children:i.map(s=>u.jsx("li",{className:"pb-2",children:u.jsx("div",{className:"max-w-max truncate rounded bg-secondary/20 px-1 ",children:s.connectTo})},`node-${s.id}`))}),o.length>Ff&&u.jsx("div",{children:`+ ${A(w.MORE_WITH_COUNT,{count:o.length-Ff})}`})]}):null,u.jsx(Ho,{children:t.options.map(s=>u.jsx(Wt,{color:XE(s.result),id:s.id,isConnectable:n,optionTitle:A(eL[s.result])},s.id))})]})},nL=({id:e,data:t,isConnectable:n,selected:r})=>{lt({data:t,id:e});const o=ar(t.options,"command"),i=ar(t.options,"digit");return u.jsxs(Ue,{id:e,isConnectable:n,nodeTitle:A(w.GATHER_INPUT),selected:r,valid:t.valid,children:[u.jsx($y,{data:t}),u.jsxs(Ho,{children:[t.options.map((s,a)=>{const l=s.command.trim(),c=s.digit.trim(),d=!!(l||c)&&!o(s.command)&&!i(s.digit),f=u.jsxs("div",{className:"flex gap-1",children:[A(w.CALLER_PRESSES)," ",u.jsx("span",{className:"truncate rounded bg-secondary/20 px-1",children:c})]}),p=E=>u.jsxs("div",{className:"flex",children:[A(E?w.CALLER_SAYS:w.OR_CALLER_SAYS)," '",u.jsx("span",{className:"truncate",children:l}),"'"]});let h=A(w.OPTION_NUMBER,{index:a+1}),v="";switch(!0){case!!(l&&!c):h=p(!0);break;case!!(!l&&c):h=f;break;case!!(l&&c):h=f,v=p(!1);break}return u.jsx(Wt,{color:"positive",enabled:d,id:s.id,isConnectable:n,optionTitle:h,optionSubtitle:v},s.id)}),t.results.map(s=>u.jsx(Wt,{color:"negative",id:s.id,isConnectable:n,optionTitle:s.result==="no_input"?A(w.NO_INPUT):A(w.UNKNOWN)},s.id))]})]})},rL=({id:e,isConnectable:t,selected:n})=>u.jsx(Ue,{id:e,isConnectable:t,isRoot:!0,nodeTitle:A(w.HANDLE_CALL),selected:n,deletable:!1,showValidation:!1,target:!1,children:u.jsx(zt,{id:e,color:"positive",isConnectable:t})}),$f={busy:w.BUSY,decline:w.DECLINE,hangup:w.HANG_UP},oL=({data:e,id:t,isConnectable:n,selected:r})=>u.jsx(Ue,{id:t,isConnectable:n,nodeTitle:A(w.HANG_UP_CALL),selected:r,valid:e.valid,children:e.reason&&u.jsx(bt,{children:u.jsx("section",{className:"text-xs",children:u.jsx("p",{children:A($f[e.reason])})})})}),iL=({data:e,id:t,isConnectable:n,selected:r})=>(lt({data:e,id:t}),u.jsxs(Ue,{id:t,isConnectable:n,nodeTitle:A(w.PLAY_AUDIO_TTS),selected:r,valid:e.valid,children:[u.jsx($y,{data:e}),u.jsx(zt,{id:t,isConnectable:n})]})),sL=({data:e,id:t,isConnectable:n,selected:r})=>{const{label:o,valid:i}=e;return lt({data:e,id:t}),u.jsxs(Ue,{id:t,isConnectable:n,nodeTitle:A(w.RECORD_CALL_START),selected:r,valid:i,children:[o&&i&&u.jsx(bt,{children:u.jsx("p",{className:"truncate text-xs leading-5",children:o})}),u.jsx(zt,{id:t,isConnectable:n,color:"positive"})]})},aL=({data:e,id:t,isConnectable:n,selected:r})=>{var s;lt({data:e,id:t});const o=(s=Go(a=>a.entries))==null?void 0:s.find(a=>a.controlId===e.controlId),i=o==null?void 0:o.label;return u.jsxs(Ue,{id:t,isConnectable:n,nodeTitle:A(w.RECORD_CALL_STOP),selected:r,valid:e.valid,children:[i&&u.jsx(bt,{children:u.jsx("p",{className:"truncate text-xs leading-5",children:i})}),u.jsx(zt,{id:t,color:"positive",isConnectable:n})]})},lL=({data:e,id:t,isConnectable:n,selected:r})=>{lt({data:e,id:t});const o=new Set(e.terminators);return u.jsxs(Ue,{id:t,isConnectable:n,nodeTitle:A(w.VOICEMAIL_RECORDING),selected:r,valid:e.valid,children:[e.terminators?u.jsxs(bt,{children:[A(w.TERMINATORS),":"," ",u.jsx("ul",{className:"inline-flex flex-wrap justify-start gap-1",children:[...o].sort().map((i,s)=>u.jsx("li",{className:"rounded bg-secondary/20 px-1",children:i},`${s}-${i}`))})]}):null,u.jsx(zt,{id:t,isConnectable:n,color:"positive"})]})},cL={failed:w.FAILED,success:w.SUCCESS},H0={aiAgent:QC,answer:XC,cond:qC,condRequest:JC,executeSWML:ZC,forwardAddress:Vf,forwardPhone:Vf,forwardResource:Vf,handleCall:rL,hangup:oL,play:iL,promptPlay:nL,record:lL,recordCallStart:sL,recordCallStop:aL,request:({data:e,id:t,isConnectable:n,selected:r})=>{var o;return lt({data:e,id:t}),u.jsxs(Ue,{id:t,isConnectable:n,nodeTitle:A(w.REQUEST),selected:r,valid:e.valid,children:[u.jsx("p",{className:"p-4 pt-0 text-xs text-negative",children:A(w.DEPRECATED)}),u.jsx(Ho,{children:(o=e==null?void 0:e.options)==null?void 0:o.map(i=>u.jsx(Wt,{color:XE(i.result),id:i.id,isConnectable:n,optionTitle:A(cL[i.result])},i.id))})]})},sendSms:({data:e,id:t,isConnectable:n,selected:r})=>(lt({data:e,id:t}),u.jsxs(Ue,{id:t,isConnectable:n,nodeTitle:A(w.SEND_SMS),selected:r,valid:e.valid,children:[e.body&&u.jsx(bt,{children:u.jsx("p",{className:"break-words line-clamp-3",children:e.body})}),u.jsx(zt,{id:t,isConnectable:n})]})),set:({id:e,data:t,isConnectable:n,selected:r})=>{const{getInvalidFields:o}=lt({data:t,id:e}),i=o().reduce((a,l)=>(l.startsWith("variable_")&&a.push(l.replace("variable_","")),a),[]),s=t.variables.filter(a=>!!a.key);return u.jsxs(Ue,{id:e,isConnectable:n,nodeTitle:A(w.SET_VARIABLES),selected:r,valid:t.valid,children:[s.length>0&&u.jsx(bt,{children:u.jsx("ul",{className:"flex flex-col",children:s.map(a=>u.jsxs("li",{className:"flex w-full gap-1 pb-2",children:[u.jsx("div",{className:`max-w-[50%] shrink-0 truncate rounded px-1 ${i.includes(a.id)?"bg-negative/10 text-negative":"bg-secondary/20"}`,children:a.key}),"=",a.value&&u.jsx("div",{className:"truncate",children:a.value})]},a.id))})}),u.jsx(zt,{id:e,isConnectable:n,color:"positive"})]})},unset:({id:e,data:t,isConnectable:n,selected:r})=>{lt({data:t,id:e});const o=t.variables.filter(i=>!!i.key);return u.jsxs(Ue,{id:e,isConnectable:n,nodeTitle:A(w.UNSET_VARIABLES),selected:r,valid:t.valid,children:[o.length>0&&u.jsx(bt,{children:u.jsx("ul",{children:o.map(i=>u.jsx("li",{className:"pb-2",children:u.jsx("div",{className:"max-w-max truncate rounded bg-secondary/20 px-1",children:i.key})},i.id))})}),u.jsx(zt,{id:e,isConnectable:n,color:"positive"})]})}},uL={floating:UC},dL=({children:e})=>{const t=Y(_=>_.nodes),n=Y(_=>_.edges),r=Y(_=>_.isCanvasInteractive),{onConnect:o,onConnectEnd:i,onConnectStart:s,onEdgesChange:a,onEdgesDelete:l,onEdgeUpdate:c,onEdgeUpdateEnd:d,onEdgeUpdateStart:f,onInit:p,onNodeDragStart:h,onNodeDragStop:v,onNodesChange:E,onNodesDelete:y,onSelectionChange:g,setFlowWrapperElement:m}=Se();return u.jsx("div",{className:"bg-sw-white !h-auto w-full",ref:_=>m(_),children:u.jsxs(FE,{attributionPosition:"bottom-left",connectionLineComponent:MC,connectionMode:qn.Strict,deleteKeyCode:r?GA:null,defaultEdgeOptions:Fo,edges:n,edgeTypes:uL,elementsSelectable:r,fitViewOptions:tf,multiSelectionKeyCode:r?YA:null,nodes:t,nodesConnectable:r,nodesDraggable:r,nodeTypes:H0,onConnect:o,onConnectEnd:i,onConnectStart:s,onEdgesChange:a,onEdgesDelete:l,onEdgeUpdate:r?c:void 0,onEdgeUpdateEnd:d,onEdgeUpdateStart:f,onInit:p,onNodeDragStart:h,onNodeDragStop:v,onNodesChange:E,onNodesDelete:y,onSelectionChange:g,selectionKeyCode:r?KA:null,snapGrid:[_l,_l],snapToGrid:!0,children:[u.jsx(kA,{className:"bg-background-alt text-grid",color:"currentColor",gap:[_l,_l],variant:Ot.Dots}),e]})})},fL=()=>{const e=Y(a=>a.initializing),t=Y(a=>a.reactFlowInstance),{setInitializing:n,setViewportChanging:r}=Se(),o=N.useRef(!1),i=SA({includeHiddenNodes:!0}),s=N.useMemo(()=>()=>{t==null||t.fitView(tf)},[t]);N.useEffect(()=>{let a;e?!o.current&&!i?o.current=!0:o.current&&i&&(clearTimeout(a),r(!0),s(),a=setTimeout(()=>{r(!1)},tf.duration),n(!1),o.current=!1):o.current=!1},[e,s,i,n,r])},pL=()=>{const{onViewportChange:e,onViewportChangeEnd:t,onViewportChangeStart:n}=Se();return fL(),EA({onChange:e,onEnd:t,onStart:n}),null},hL=()=>{const e=Y(n=>n.selectedNode),t=e?NC.get(e.type):void 0;return t?u.jsx(ns,{className:"z-40 max-w-[40%] rounded-md bg-background",position:"bottom-center",children:u.jsxs("div",{className:"justify-left flex items-center gap-2 rounded-md bg-primary/10 p-3 py-4","data-testid":"cfb__info",children:[u.jsx(te,{className:"shrink-0 text-primary",tag:"circle-info",size:"xl"}),u.jsx("div",{className:"text-xs font-medium",children:Fl(t)})]})}):null},gL=e=>{var i;const t=N.useRef(),n=vA(),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)}}},mL="/hello/.test('%{foo}')",vL=()=>({id:ie(),value:""}),Bf=({nodeData:e,handleOnUpdate:t,placeholder:n=mL})=>{const{validateField:r}=at("cond"),[o,i]=N.useState({options:e.options.map(f=>({id:!0,initial:e.initial,value:r("value",f.value)}))}),s=f=>{f.preventDefault(),i({...o,options:[...o.options,{initial:!0,value:!0}]}),t({options:[...e.options,vL()]})},a=f=>p=>{p.preventDefault();const h=[...o.options];h.splice(f,1),i({...o,options:h});const v=[...e.options];v.splice(f,1),t({options:v})},l=(f,p)=>{const h=[...e.options];if(!h[f])throw new Error(`Option not found at index ${f}`);const{name:v,value:E}=p,y=[...o.options];y[f]={...y[f],initial:!1,[v]:r(v,E)},i({...o,options:y}),h[f]={...h[f],[v]:E},t({options:h})},c=(f,p)=>{const h=f.target,{name:v,value:E}=h;switch(t({initial:!1}),v){case"value":p!==void 0&&l(p,{name:v,value:E});break;default:Ae().error(`Unhandled input name: ${v}`)}},d=({index:f,name:p})=>{const h=o.options[f];return(h==null?void 0:h[p])||(h==null?void 0:h.initial)};return u.jsxs(u.Fragment,{children:[u.jsx("ol",{className:"divide-y-4 divide-foreground/10 border-b-4 border-foreground/10",children:e.options.map((f,p,h)=>u.jsxs("li",{className:"flex pt-3",children:[u.jsx("div",{className:"w-8 shrink-0 text-center",children:u.jsx(te,{className:"text-foreground/60",size:"xs",tag:"bars"})}),u.jsxs("div",{className:"relative mr-3",children:[h.length>1&&u.jsx(Bo,{className:"absolute right-0 top-0",handleDelete:a(p),label:A(w.REMOVE_CONDITION,{index:p+1}),size:"sm",show:!0}),u.jsxs("label",{className:"mb-2 block",children:[A(w.CONDITION_NUMBER,{index:p+1}),u.jsx("input",{className:`w-full ${d({index:p,name:"value"})?"":"invalid"}`,name:"value",onChange:v=>c(v,p),placeholder:n,type:"text",value:f.value}),u.jsx("p",{className:"requirements",role:"alert",children:A(w.ERROR_VALUE_IS_REQUIRED)})]})]})]},f.id))}),u.jsx("div",{className:"p-3 text-right",children:u.jsx("button",{className:"rounded bg-foreground/10 py-1 px-2 font-medium",onClick:s,type:"button",children:A(w.ADD_CONDITION)})})]})},EL=Ae(),Ns=(e,t)=>[e,t].filter(Boolean).join("-").toLowerCase(),yL={idsByKey:{},languageById:{},voiceById:{}},_L=(e,t)=>({...yL,actions:{getGenderByKeys:({languageId:n})=>{const{idsByKey:r}=t(),o=(n==null?void 0:n.split(",").map(s=>Ns(s)))??[];if(!o.length)return["female","male"];const i=new Set;return o.forEach(s=>{var a;return(a=r[s])==null?void 0:a.forEach(l=>{l.gender&&i.add(l.gender)})}),Array.from(i).sort((s,a)=>s.toLowerCase().localeCompare(a.toLowerCase()))},getLanguages:()=>Object.values(t().languageById).sort((n,r)=>n.name.toLowerCase().localeCompare(r.name.toLowerCase())),getVoicesByKeys:({languageId:n,gender:r})=>{const{voiceById:o,idsByKey:i}=t(),s=(n==null?void 0:n.split(",").map(l=>Ns(l,r)))??[];let a=[];return!s.length||s[0]===""?a=Object.values(o):s.forEach(l=>{a=a.concat(i[l]??[])}),a.sort((l,c)=>{const d=/^\w{2,3}-\w{2,}-.+/;return l.name.match(d)&&!c.name.match(d)?1:!l.name.match(d)&&c.name.match(d)?-1:l.name.toLowerCase().localeCompare(c.name.toLowerCase())})},init:async({voicesURL:n="/voices.json"})=>{try{EL.debug("Load voicesURL",n);const o=await(await fetch(n)).json(),i={},s={},a={};o.forEach(l=>{var y,g,m;const c=!!l.premium,d=l.signalwire_id,f=l.gender.toLowerCase(),p={gender:f,id:d,key:`${l.language_code}-${f}-${l.signalwire_id}`,name:`${l.friendly_name.trim()} ${c?"(premium)":""}`,premium:c};i[d]=p,s[l.language_code]={id:l.language_code,name:l.language};const h=Ns(l.language_code);h in a||(a[h]=[]),(y=a[h])==null||y.push(p);const v=Ns(f);v in a||(a[v]=[]),(g=a[v])==null||g.push(p);const E=Ns(l.language_code,f);E in a||(a[E]=[]),(m=a[E])==null||m.push(p)}),e({idsByKey:a,languageById:s,voiceById:i})}catch(r){console.error("Error",r)}}}}),Hf=us()(_L),SL=()=>Hf.getState().actions;window.__useVoiceStore=Hf;const z0=e=>u.jsx("option",{value:e.id,children:e.name},e.key??e.id),xL=({onChange:e,languageId:t,gender:n,voiceId:r})=>{const{getLanguages:o,getVoicesByKeys:i,getGenderByKeys:s}=SL();return u.jsxs(u.Fragment,{children:[u.jsxs(an,{className:"w-full",label:A(w.LANGUAGE),name:"language",onChange:e,value:t??"",children:[u.jsx("option",{value:"",children:A(w.SELECT)}),o().map(z0)]}),u.jsxs(an,{className:"w-full capitalize",label:A(w.GENDER),name:"gender",onChange:e,value:n??"",children:[u.jsx("option",{value:"",children:A(w.SELECT)}),s({languageId:t}).map(a=>u.jsx("option",{value:a,children:a},a))]}),u.jsxs(an,{className:"w-full",label:A(w.VOICE),name:"voice",onChange:e,value:r??"",children:[u.jsx("option",{value:"",children:A(w.SELECT)}),i({gender:n,languageId:t}).map(z0)]})]})},W0={text:w.TEXT_TO_SPEECH,url:w.PLAY_AUDIO_FILE},G0=({handleOnUpdate:e,label:t,nodeData:n,showDefaultOption:r})=>{const{validateField:o}=at("play"),[i,s]=N.useState({gender:!0,language:!0,selected:n.initial||o("selected",n.selected),text:n.initial||o("text",n.text),url:n.initial||o("url",n.url),voice:!0}),a=n.selected;N.useEffect(()=>{!a&&!r&&e({selected:"url"})},[e,a,r]);const l=d=>{const f=d.target,{name:p,value:h}=f;switch(p){case"selected":case"text":case"url":s({...i,[p]:o(p,h)}),e({initial:!1,[p]:h});break;default:throw new Error(`Unhandled input name: ${p}`)}},c=d=>{const f=d.target,{name:p,value:h}=f;switch(p){case"language":e({gender:void 0,language:h,voice:void 0});break;case"gender":e({gender:h,voice:void 0});break;default:e({[p]:h})}};return u.jsxs(u.Fragment,{children:[u.jsxs("label",{className:"mb-2",children:[u.jsx("span",{className:"sr-only",children:t}),u.jsxs(By,{className:`w-full ${i.selected?"":"invalid"}`,name:"selected",onChange:l,value:a,children:[r&&u.jsx("option",{value:"",children:A(w.SELECT)}),Object.keys(W0).map(d=>u.jsx("option",{value:d,children:A(W0[d])},d))]})]}),a&&u.jsx(RL,{nodeData:n,onChange:l,voiceSettingsChangeHandler:c,selected:a,valid:i[a]})]})},RL=({nodeData:e,onChange:t,voiceSettingsChangeHandler:n,selected:r,valid:o})=>{const i=e[r],a={text:u.jsxs(u.Fragment,{children:[u.jsx(xL,{onChange:n,languageId:e.language,gender:e.gender,voiceId:e.voice}),u.jsx(On,{errorText:A(w.ERROR_VALUE_IS_REQUIRED),inputMode:"text",label:A(w.TEXT),name:r,onChange:t,placeholder:A(w.WRITE_SOMETHING),valid:o,value:i})]}),url:u.jsx(On,{errorText:A(w.ERROR_URL_IS_REQUIRED),inputMode:"url",label:A(w.AUDIO_FILE),name:r,onChange:t,placeholder:A(w.ENTER_URL),valid:o,value:i})}[r];return u.jsx(u.Fragment,{children:a})},NL=[{field:"stereo",subtitle:w.STEREO_SUBTITLE,title:w.STEREO},{field:"beep",subtitle:w.BEEP_SUBTITLE,title:w.BEEP}],Y0=({handleOnUpdate:e,nodeData:t,type:n})=>{const{validateField:r}=at("record"),[o,i]=N.useState({beep:!0,format:!0,maxLength:t.initial||r("maxLength",t.maxLength),stereo:!0,terminators:t.initial||r("terminators",t.terminators)});t.format||e({format:"mp3"});const s=l=>{const c=l.target.name;e({[c]:!t[c]})},a=l=>{const c=l.target,{name:d,value:f}=c;switch(d){case"format":case"maxLength":case"terminators":i({...o,[d]:r(d,f)}),e({initial:!1,[d]:f});break;default:throw new Error(`Unhandled input name: ${d}`)}};return u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"mb-2",children:NL.map(l=>{const c=t[l.field];return u.jsx("div",{children:u.jsx(df,{checked:c,clickHandler:s,name:l.field,subtitle:A(l.subtitle),title:A(l.title)})},l.field)})}),u.jsxs("label",{className:"mb-2 block",children:[A(w.TERMINATORS),u.jsx("span",{className:"block text-xxs text-foreground/50",children:A(w.SEPARATE_WITH_COMMAS)}),u.jsx("input",{className:`w-full ${o.terminators?"":"invalid"}`,name:"terminators",onChange:a,placeholder:"#*0",type:"text",value:t.terminators}),u.jsx("p",{className:"requirements",role:"alert",children:A(w.ERROR_TERMINATORS)})]}),n==="voicemail"&&u.jsxs("label",{className:"mb-2 block",children:[u.jsx("div",{className:"w-full",children:A(w.MAXIMUM_RECORDING_LENGTH)}),u.jsxs("div",{className:"flex flex-wrap items-center gap-x-2",children:[u.jsx("input",{className:`w-14 ${o.maxLength?"":"invalid"}`,inputMode:"numeric",min:Yo.MIN,max:Yo.MAX,name:"maxLength",onChange:a,placeholder:A(w.SECONDS),type:"number",value:t.maxLength}),u.jsx("p",{className:"requirements w-full",role:"alert",children:A(w.ERROR_NUMBER_MIN_MAX_IS_REQUIRED,{max:Yo.MAX,min:Yo.MIN})})]})]}),u.jsxs(an,{className:"w-full",label:A(w.FORMAT),name:"format",onChange:a,value:t.format,children:[u.jsx("option",{value:"mp3",children:"MP3"}),u.jsx("option",{value:"wav",children:"WAV"})]})]})},Je=({children:e,formRef:t,handleOnChange:n=()=>null,title:r})=>u.jsxs("div",{className:"flex flex-col overflow-hidden","data-testid":"cfb__settings",children:[u.jsxs("div",{className:"flex w-full items-center justify-start gap-x-2 px-4 pb-3",children:[u.jsx("div",{className:"flex h-5 w-5 shrink-0 items-center justify-center rounded-full bg-focus/30 text-primary",children:u.jsx(te,{tag:"circle-small"})}),u.jsx("div",{className:"flex-1",children:u.jsx("h2",{className:"text-xs font-semibold",children:r})})]}),u.jsx("form",{className:"flex h-full flex-col overflow-hidden text-xs",noValidate:!0,onChange:n,ref:t,children:u.jsx("div",{className:"flex-1 overflow-y-auto pt-1 pb-4",children:e})})]}),wL=({nodeData:e,handleOnUpdate:t})=>{const{validateField:n}=at("aiAgent"),[r,o]=N.useState({agent:e.initial||n("agent",e.agent)}),i=un(E=>E.aiAgentMap.values()),s=un(E=>E.error),a=un(E=>E.status),{fetchAiAgents:l}=TC();N.useEffect(()=>{l()},[l]);const c=Array.from(i),d=a==="loading",f=!!s||a==="error",p=f||a==="initial",h=E=>{const y=E.target,{name:g,value:m}=y;o({...r,[g]:n(g,m)}),t({initial:!1,[g]:m})},v=N.useId();return u.jsx(Je,{title:A(w.AI_AGENT),children:u.jsx("div",{className:"mx-3",children:!f&&c.length?u.jsxs("div",{className:"relative",children:[u.jsxs(an,{id:v,className:`${r.agent?"":"invalid"}`,disabled:p,label:A(w.AI_AGENT_NAME),name:"agent",onChange:h,value:e.agent,children:[u.jsx("option",{value:"",children:A(w.SELECT)}),c.map(E=>u.jsx("option",{value:E.id,children:E.display_name},E.id))]}),u.jsx(K0,{className:"absolute top-0 right-0 mx-1",handleClickResync:l,isLoading:d}),e.agent&&u.jsx("p",{children:u.jsx(Q0,{agent:e.agent,mode:"edit",className:"mb-2",children:A(w.EDIT_SELECTED_AI_AGENT)})})]}):u.jsxs("div",{className:"flex items-end justify-between",children:[u.jsx("p",{role:"alert",className:"text-negative",children:f?u.jsx(u.Fragment,{children:A(w.ERROR_FETCHING_AI_AGENTS)}):u.jsxs(u.Fragment,{children:[A(w.ERROR_ADD_AI_AGENT_FIRST),u.jsx(Q0,{mode:"add",className:"mt-2 block",children:A(w.ADD_AI_AGENT)})]})}),u.jsx(K0,{className:"mx-1",handleClickResync:l,isLoading:d})]})})})},K0=({className:e="",isLoading:t,handleClickResync:n})=>u.jsx(sr,{placement:"bottom-end",trigger:u.jsxs("button",{className:`overflow-hidden ${t?"text-disabled":""} ${e}`,disabled:t,onClick:n,type:"button",children:[u.jsx(te,{className:`${t?"animate-spin":""}`,tag:"arrows-rotate"}),u.jsx("span",{className:"sr-only",children:A(w.RESYNC_AI_AGENTS)})]}),children:u.jsx("p",{className:"text-sm",children:A(w.RESYNC_AI_AGENTS)})}),Q0=({agent:e="",children:t,className:n="",mode:r})=>{const o={add:"",edit:`${e}/edit`};return u.jsx("a",{className:`w-fit text-foreground underline hover:text-foreground/80 ${n}`,href:`/ai_agents/${o[r]}`,target:"_blank",rel:"noopener noreferrer",children:t})},OL=["GET","POST","PUT","DELETE"],TL=({nodeData:e,handleOnUpdate:t})=>{const{validateField:n}=at("condRequest"),[r,o]=N.useState({body:e.initial||n("body",e.body),headers:e.initial||n("headers",e.headers),method:e.initial||n("method",e.method),saveVariables:e.initial||n("saveVariables",e.saveVariables),url:e.initial||n("url",e.url)}),i=l=>{const c=l.target,{name:d,value:f}=c;switch(t({initial:!1}),d){case"url":case"method":o({...r,[d]:n(d,f)}),t({[d]:f});break;case"headers":o({...r,[d]:n(d,f)}),t({[d]:f});break;case"body":o({...r,[d]:n(d,f)}),t({[d]:f});break;default:throw new Error(`Unhandled input name: ${d}`)}},s=l=>{const{name:c,value:d}=l.target;t({[c]:d})},a=l=>{const{name:c}=l.target,d=!e[c];t({[c]:d})};return u.jsxs(Je,{title:A(w.REQUEST),children:[u.jsxs("div",{className:"border-b-4 border-foreground/10 px-3",children:[u.jsxs("label",{className:"mb-2 block",children:[A(w.URL),u.jsx("input",{className:`w-full ${r.url?"":"invalid"}`,name:"url",onChange:i,placeholder:"https://u:p@example.com/api/status",type:"text",value:e.url}),u.jsx("p",{className:"requirements w-full",role:"alert",children:A(w.ERROR_VALUE_IS_REQUIRED)})]}),u.jsx("div",{className:"mb-1",children:u.jsx(an,{className:"w-full",label:A(w.METHOD),name:"method",onChange:s,value:e.method,children:OL.map(l=>u.jsx("option",{value:l,children:l},l))})}),u.jsx("div",{className:"mb-4",children:u.jsx(df,{checked:e.saveVariables,clickHandler:a,name:"saveVariables",subtitle:A(w.SAVE_VARIABLES_SUBTITLE),title:A(w.SAVE_VARIABLES)})}),u.jsx("label",{className:"mb-2 block",children:u.jsx(On,{errorText:A(w.ERROR_INVALID_JSON),inputMode:"text",label:A(w.REQUEST_HEADERS),name:"headers",onChange:i,placeholder:'{"Content-Type": "application/json", "X-Custom-Header": "foo"}',valid:r.headers,value:e.headers})}),u.jsx("label",{className:"mb-2 block",children:u.jsx(On,{errorText:A(w.ERROR_INVALID_JSON),inputMode:"text",label:A(w.REQUEST_BODY),name:"body",onChange:i,placeholder:A(w.STRING_OR_JSON),valid:r.body,value:e.body??""})})]}),u.jsx(Bf,{nodeData:e,handleOnUpdate:t})]})},AL=({nodeData:e,handleOnUpdate:t})=>{const n=N.useRef();return u.jsx(Je,{formRef:n,title:A(w.CONDITIONS),children:u.jsx("div",{children:u.jsx(Bf,{nodeData:e,handleOnUpdate:t})})})},IL=({nodeData:e,handleOnUpdate:t})=>{const{validateField:n}=at("executeSWML"),[r,o]=N.useState({dest:e.initial||n("dest",e.dest),meta:e.initial||n("meta",e.meta),params:e.initial||n("params",e.params)}),i=s=>{const a=s.target,{name:l,value:c}=a;switch(t({initial:!1}),l){case"dest":case"params":case"meta":o({...r,[l]:n(l,c)}),t({[l]:c});break;default:throw new Error(`Unhandled input name: ${l}`)}};return u.jsxs(Je,{title:A(w.EXECUTE_SWML),children:[u.jsxs("div",{className:"border-b-4 border-foreground/10 px-3",children:[u.jsxs("label",{className:"mb-2 block",children:[A(w.URL),u.jsx("input",{className:`w-full ${r.dest?"":"invalid"}`,name:"dest",onChange:i,placeholder:"https://u:p@test.com/go.swml",type:"text",value:e.dest}),u.jsx("p",{className:"requirements w-full",role:"alert",children:A(w.ERROR_VALUE_IS_REQUIRED)})]}),u.jsx("label",{className:"mb-2 block",children:u.jsx(On,{errorText:A(w.ERROR_INVALID_JSON),inputMode:"text",label:A(w.PARAMS),name:"params",onChange:i,placeholder:'{"Content-Type": "application/json", "X-Custom-Header": "foo"}',valid:r.params,value:e.params??""})}),u.jsx("label",{className:"mb-2 block",children:u.jsx(On,{errorText:A(w.ERROR_INVALID_JSON),inputMode:"text",label:A(w.META),name:"meta",onChange:i,placeholder:A(w.JSON_OBJECT),valid:r.meta,value:e.meta??""})})]}),u.jsx(Bf,{nodeData:e,handleOnUpdate:t,placeholder:"return_value === '1'"})]})},bL={forwardAddress:{add:w.ADD_ADDRESS,call:w.CALL_ADDRESSES,optionNumber:w.ADDRESS_NUMBER,remove:w.REMOVE_ADDRESS,title:w.FORWARD_TO_ADDRESS},forwardPhone:{add:w.ADD_PHONE_NUMBER,call:w.CALL_NUMBERS,optionNumber:w.PHONE_NUMBER_NUMBER,remove:w.REMOVE_PHONE_NUMBER,title:w.FORWARD_TO_PHONE},forwardResource:{add:w.ADD_RESOURCE,call:w.CALL_RESOURCES,optionNumber:w.RESOURCE_NUMBER,remove:w.REMOVE_RESOURCE,title:w.FORWARD_TO_RESOURCE}},X0={parallel:w.SIMULTANEOUSLY,serial:w.SEQUENTIALLY},CL=()=>({connectFrom:"",connectTimeout:"",connectTo:"",id:ie()}),zf=({nodeType:e,nodeData:t,handleOnUpdate:n})=>{var y,g,m;const{validateField:r}=at(e),o=N.useRef(),[i,s]=N.useState(["serial","parallel"].includes(t.callOrder)?t.callOrder:"serial"),a=bL[e],[l,c]=N.useState({callOrder:t.initial||r("callOrder",i),callStateEvents:t.initial||r("callStateEvents",i),callStateUrl:t.initial||r("callStateUrl",i),connections:(y=t.connections)==null?void 0:y.map(_=>({connectFrom:r("connectFrom",_.connectFrom),connectTimeout:r("connectTimeout",_.connectTimeout),connectTo:r("connectTo",_.connectTo),initial:t.initial})),defaultFrom:t.initial||r("defaultFrom",t.defaultFrom),defaultTimeout:t.initial||r("defaultTimeout",t.defaultTimeout)}),d=_=>{_.preventDefault(),c({...l,connections:[...l.connections,{connectFrom:!0,connectTimeout:!0,connectTo:!0,initial:!0}]}),n({callOrder:i,connections:[...t.connections,CL()]})},f=_=>S=>{S.preventDefault();const x=[...l.connections];x.splice(_,1),c({...l,connections:x});const R=[...t.connections];R.splice(_,1),n({callOrder:R.length===1?"single":i,connections:R})},p=(_,S)=>{const x=[...t.connections];if(!x[_])throw new Error(`Option not found at index ${_}`);const{name:R,value:I}=S,L=[...l.connections];L[_]={...L[_],initial:!1,[R]:r(R,I)},c({...l,connections:L}),x[_]={...x[_],[R]:I},n({connections:x,initial:!1})},h=_=>{const S=_.currentTarget.value;s(S),n({callOrder:S})},v=(_,S)=>{const x=_.target,{name:R,value:I}=x;switch(R){case"callStateEvents":case"callStateUrl":case"defaultTimeout":case"defaultFrom":c({...l,[R]:r(R,I)}),n({initial:!1,[R]:I});break;case"connectFrom":case"connectTimeout":case"connectTo":if(S===void 0)throw new Error(`Option index not provided: ${R}`);p(S,{name:R,value:I});break;default:throw new Error(`Unhandled input name: ${R}`)}},E=({index:_,name:S})=>{const x=l.connections[_];return!!(x!=null&&x[S]||x!=null&&x.initial)};return u.jsxs(Je,{title:A(a.title),formRef:o,children:[u.jsxs("div",{className:"border-b-4 border-foreground/10 px-3 pb-3",children:[u.jsxs("label",{className:"mb-2 block",children:[A(w.DEFAULT_FROM),u.jsx(vs,{className:"w-full",direction:"from",name:"defaultFrom",onChange:v,placeholder:A(w.FROM),type:"tel",value:t.defaultFrom,valid:l.defaultFrom}),u.jsx("p",{className:"requirements w-full",role:"alert",children:A(w.ERROR_VALUE_IS_REQUIRED)})]}),u.jsxs("label",{className:"mb-2 block",children:[A(w.DEFAULT_TIMEOUT),u.jsxs("div",{className:"flex flex-wrap items-center gap-x-2",children:[u.jsx("input",{className:`w-14 ${l.defaultTimeout?"":"invalid"}`,inputMode:"numeric",min:0,name:"defaultTimeout",onChange:v,placeholder:A(w.SECONDS),type:"number",value:t.defaultTimeout}),u.jsx("p",{className:"requirements w-full",role:"alert",children:A(w.ERROR_NUMBER_IS_REQUIRED)})]})]}),u.jsxs("label",{className:"mb-2 block",children:[A(w.CALL_STATE_URL),u.jsx("input",{className:`w-full ${l.callStateUrl?"":"invalid"}`,name:"callStateUrl",onChange:v,placeholder:"https://example.com/api",type:"url",value:t.callStateUrl}),u.jsx("p",{className:"requirements w-full",role:"alert",children:A(w.ERROR_VALUE_IS_REQUIRED)})]}),u.jsxs("label",{className:"mb-2 block",children:[A(w.CALL_STATE_EVENTS),u.jsx("input",{className:`w-full ${l.callStateEvents?"":"invalid"}`,name:"callStateEvents",onChange:v,placeholder:"Created, ringing, answered, ended",type:"text",value:t.callStateEvents}),u.jsx("p",{className:"requirements w-full",role:"alert",children:A(w.ERROR_VALUE_IS_REQUIRED)})]})]}),u.jsx("ul",{className:"border-foreground-10 divide-y-4 divide-foreground/10 border-b-4",children:(g=t.connections)==null?void 0:g.map((_,S,x)=>u.jsxs("li",{className:"flex pt-3",children:[u.jsx("div",{className:"w-8 shrink-0 text-center",children:u.jsx(te,{className:"text-foreground/60",size:"xs",tag:"bars"})}),u.jsxs("div",{className:"relative mr-3",children:[x.length>1&&u.jsx(Bo,{className:"absolute right-0 top-0",handleDelete:f(S),label:A(a.remove,{index:S+1}),size:"sm",show:!0}),u.jsxs("fieldset",{children:[u.jsx("legend",{children:A(a.optionNumber,{index:S+1})}),u.jsxs("label",{className:"mb-1 block",children:[u.jsx("div",{className:"sr-only",children:A(w.TO)}),u.jsx(vs,{className:"w-full",direction:"to",name:"connectTo",onChange:R=>v(R,S),type:e==="forwardPhone"?"tel":"text",valid:E({index:S,name:"connectTo"}),value:_.connectTo}),u.jsx("p",{className:"requirements",role:"alert",children:A(w.ERROR_VALUE_IS_REQUIRED)})]}),u.jsxs("label",{className:"mb-2 block",children:[u.jsx("div",{className:"sr-only",children:A(w.FROM)}),u.jsx(vs,{className:"w-full",direction:"from",name:"connectFrom",onChange:R=>v(R,S),placeholder:A(w.FROM),type:"text",valid:E({index:S,name:"connectFrom"}),value:_.connectFrom}),u.jsx("p",{className:"requirements",role:"alert",children:A(w.ERROR_VALUE_IS_REQUIRED)})]}),u.jsxs("label",{className:"mb-2 block",children:[A(w.TIMEOUT),u.jsxs("div",{className:"flex flex-wrap items-center gap-x-2",children:[u.jsx("input",{className:`w-14 ${E({index:S,name:"connectTimeout"})?"":"invalid"}`,inputMode:"numeric",min:0,name:"connectTimeout",onChange:R=>v(R,S),placeholder:A(w.SECONDS),type:"number",value:_.connectTimeout}),u.jsx("p",{className:"requirements w-full",role:"alert",children:A(w.ERROR_NUMBER_IS_REQUIRED)})]})]})]})]})]},_.id))}),u.jsx("div",{className:"p-3 pb-6 text-right",children:u.jsx("button",{className:"rounded bg-foreground/10 py-1 px-2 font-medium",onClick:d,type:"button",children:A(a.add)})}),((m=t.connections)==null?void 0:m.length)>1&&u.jsx("div",{className:"mb-4 px-3",children:u.jsx(an,{className:"w-full",label:A(a.call),name:"callOrder",onChange:h,value:i,children:Object.keys(X0).map(_=>u.jsx("option",{value:_,children:A(X0[_])},_))})})]})},LL=()=>({command:"",digit:"",id:ie()}),DL=({nodeData:e,handleOnUpdate:t})=>{const{validateField:n}=at("promptPlay"),r=N.useRef(),[o,i]=N.useState({digitTimeout:e.initial||n("digitTimeout",e.digitTimeout),initialTimeout:e.initial||n("initialTimeout",e.initialTimeout),options:e.options.map(h=>({command:n("command",h.command),digit:n("digit",h.digit),initial:e.initial}))}),s=ar(e.options,"command"),a=ar(e.options,"digit"),l=h=>{h.preventDefault(),i({...o,options:[...o.options,{command:!0,digit:!0,initial:!0}]}),t({options:[...e.options,LL()]})},c=h=>v=>{v.preventDefault();const E=[...o.options];E.splice(h,1),i({...o,options:E});const y=[...e.options];y.splice(h,1),t({options:y})},d=(h,v)=>{const E=[...e.options];if(!E[h])throw new Error(`Option not found at index ${h}`);const{name:y,value:g}=v,m=[...o.options];m[h]={...m[h],initial:!1,[y]:n(y,g)},i({...o,options:m}),E[h]={...E[h],[y]:g},t({options:E})},f=(h,v)=>{const E=h.target,{name:y,value:g}=E;switch(t({initial:!1}),y){case"digit":case"command":v!==void 0&&d(v,{name:y,value:g});break;case"digitTimeout":case"initialTimeout":{i({...o,[y]:n(y,g)}),t({[y]:g});break}default:throw new Error(`Unhandled input field name: ${y}`)}},p=({index:h,name:v})=>{var g;const E=o.options[h];if(E!=null&&E.initial)return!0;if(!(E!=null&&E[v]))return!1;const y=(g=e.options)==null?void 0:g[h];return Tt(y==null?void 0:y.digit)||Tt(y==null?void 0:y.command)};return u.jsxs(Je,{formRef:r,title:A(w.GATHER_INPUT),children:[u.jsx("div",{className:"border-b-4 border-foreground/10 px-3 pb-3",children:u.jsx(G0,{handleOnUpdate:t,label:A(w.CHOOSE_OPTION_TTS_AUDIO),nodeData:e})}),u.jsx("ol",{className:"divide-y-4 divide-foreground/10 border-b-4 border-foreground/10",children:e.options.map((h,v,E)=>{const y=s(h.command),g=a(h.digit);return u.jsxs("li",{className:"flex pt-3",children:[u.jsx("div",{className:"w-8 shrink-0 text-center",children:u.jsx(te,{className:"text-foreground/60",size:"xs",tag:"bars"})}),u.jsxs("div",{className:"relative mr-3",children:[E.length>1&&u.jsx(Bo,{className:"absolute right-0 top-0",handleDelete:c(v),label:A(w.REMOVE_OPTION,{index:v+1}),size:"sm",show:!0}),u.jsxs("fieldset",{children:[u.jsx("legend",{className:"sr-only",children:A(w.OPTION_NUMBER,{index:v+1})}),u.jsxs("label",{className:"mb-2 block",children:[A(w.CALLER_PRESSES),u.jsx("input",{className:`${p({index:v,name:"digit"})&&!g?"":"invalid"}`,name:"digit",onChange:m=>f(m,v),placeholder:A(w.KEYPAD_VALUE),type:"text",value:h.digit}),u.jsx("p",{className:"requirements",role:"alert",children:A(g?w.ERROR_DUPLICATE_TELEPHONE_KEY:w.ERROR_TELEPHONE_KEY_REQUIRED)})]}),u.jsxs("label",{className:"mb-2 block",children:[A(w.OR_SAYS),u.jsx("input",{className:`w-full ${p({index:v,name:"command"})&&!y?"":"invalid"}`,name:"command",onChange:m=>f(m,v),placeholder:A(w.SPOKEN_PROMPT),type:"text",value:h.command}),u.jsx("p",{className:"requirements",role:"alert",children:A(y?w.ERROR_DUPLICATE_COMMAND:w.ERROR_TEXT_IS_REQUIRED)})]})]})]})]},h.id)})}),u.jsx("div",{className:"p-3 pb-6 text-right",children:u.jsx("button",{className:"rounded bg-foreground/10 py-1 px-2 font-medium",onClick:l,type:"button",children:A(w.ADD_OPTION)})}),u.jsxs("div",{className:"px-3",children:[u.jsxs("label",{className:"mb-2 block",children:[u.jsx("div",{className:"w-full",children:A(w.WAIT_FOR_INPUT)}),u.jsxs("div",{className:"flex flex-wrap items-center gap-x-2",children:[u.jsx("input",{className:`w-14 ${o.initialTimeout?"":"invalid"}`,inputMode:"numeric",min:Ct.MIN,max:Ct.MAX,name:"initialTimeout",onChange:f,placeholder:A(w.SECONDS),type:"number",value:e.initialTimeout}),u.jsx("p",{className:"requirements w-full",role:"alert",children:A(w.ERROR_NUMBER_MIN_MAX_IS_REQUIRED,{max:Ct.MAX,min:Ct.MIN})})]})]}),u.jsxs("label",{children:[u.jsx("div",{className:"w-full",children:A(w.WAIT_FOR_DIGIT)}),u.jsxs("div",{className:"flex flex-wrap items-center gap-x-2",children:[u.jsx("input",{className:`w-14 ${o.digitTimeout?"":"invalid"}`,inputMode:"numeric",min:Ct.MIN,max:Ct.MAX,name:"digitTimeout",onChange:f,placeholder:A(w.SECONDS),type:"number",value:e.digitTimeout}),u.jsx("p",{className:"requirements w-full",role:"alert",children:A(w.ERROR_NUMBER_MIN_MAX_IS_REQUIRED,{max:Ct.MAX,min:Ct.MIN})})]})]})]})]})},kL=({handleOnUpdate:e,nodeData:t})=>{const{validateField:n}=at("play"),[r,o]=N.useState({reason:t.initial||n("reason",t.reason)}),i=s=>{const a=s.target,{name:l,value:c}=a;switch(l){case"reason":o({...r,[l]:n(l,c)}),e({initial:!1,[l]:c});break;default:throw new Error(`Unhandled input name: ${l}`)}};return u.jsx(Je,{title:A(w.HANG_UP_CALL),children:u.jsx("div",{className:"mx-3",children:u.jsxs(an,{className:"w-full",label:`${A(w.REASON)} (${A(w.OPTIONAL)})`,name:"reason",onChange:i,value:t.reason,children:[u.jsx("option",{value:"",children:A(w.SELECT)}),Object.keys($f).map(s=>u.jsx("option",{value:s,children:A($f[s])},s))]})})})},PL=({nodeData:e,handleOnUpdate:t})=>{const n=N.useRef();return u.jsx(Je,{formRef:n,title:A(w.PLAY_AUDIO_TTS),children:u.jsx("div",{className:"mx-3",children:u.jsx(G0,{handleOnUpdate:t,label:A(w.CHOOSE_OPTION_TTS_AUDIO),nodeData:e,showDefaultOption:!0})})})},ML=({nodeData:e,handleOnUpdate:t})=>{const n=N.useRef(),{validateField:r}=at("recordCallStart"),[o,i]=N.useState({label:e.initial||r("label",e.label)}),[s,a]=N.useState(!1),{upsertEntry:l,isValueDuplicate:c}=Lf();N.useEffect(()=>{a(c(e.label,e.controlId))},[c,e.controlId,e.label]);const d=f=>{const p=f.target,{name:h,value:v}=p;i({...o,[h]:r(h,v)}),t({initial:!1,[h]:v}),l({controlId:e.controlId,label:v})};return u.jsxs(Je,{title:A(w.RECORD_CALL_START),formRef:n,children:[u.jsx("div",{className:"px-3 pb-3",children:u.jsxs("label",{children:[A(w.RECORDING_NAME),u.jsx("input",{className:`w-full ${o.label&&!s?"":"invalid"}`,name:"label",onChange:d,type:"text",value:e.label}),u.jsx("p",{className:"requirements",role:"alert",children:A(s?w.ERROR_DUPLICATE_RECORDING_LABEL:w.ERROR_RECORDING_LABEL_REQUIRED)})]})}),u.jsx("div",{className:"px-3",children:u.jsx(Y0,{handleOnUpdate:t,nodeData:e,type:"call"})})]})},jL=({nodeData:e,handleOnUpdate:t})=>{const{validateField:n}=at("recordCallStop"),[r,o]=N.useState({controlId:e.initial||n("controlId",e.controlId)}),{getEntries:i}=Lf(),s=i().sort((l,c)=>l.label.toLowerCase().localeCompare(c.label.toLowerCase())),a=l=>{const c=l.target,{name:d,value:f}=c;o({...r,[d]:n(d,f)}),t({initial:!1,[d]:f})};return u.jsx(Je,{title:A(w.RECORD_CALL_STOP),children:u.jsx("div",{className:"px-3",children:s.length?u.jsxs(an,{className:`w-full ${r.controlId?"":"invalid"}`,label:A(w.RECORDING_NAME),name:"controlId",value:e.controlId,onChange:a,children:[u.jsx("option",{value:"",children:A(w.SELECT)}),s.map(l=>u.jsx("option",{value:l.controlId,children:l.label},l.controlId))]}):u.jsx("p",{role:"alert",className:"text-negative",children:A(w.ERROR_ADD_RECORDING_FIRST)})})})},UL=({nodeData:e,handleOnUpdate:t})=>u.jsx(Je,{title:A(w.VOICEMAIL_RECORDING),children:u.jsx("div",{className:"mx-3",children:u.jsx(Y0,{handleOnUpdate:t,nodeData:e,type:"voicemail"})})}),FL=["GET","POST","PUT","DELETE"],VL=({nodeData:e,handleOnUpdate:t})=>{const{validateField:n}=at("request"),[r,o]=N.useState({body:e.initial||n("body",e.body),headers:e.initial||n("headers",e.headers),method:e.initial||n("method",e.method),saveVariables:e.initial||n("saveVariables",e.saveVariables),url:e.initial||n("url",e.url)}),i=l=>{const c=l.target,{name:d,value:f}=c;switch(t({initial:!1}),d){case"url":case"method":o({...r,[d]:n(d,f)}),t({[d]:f});break;case"headers":o({...r,[d]:n(d,f)}),t({[d]:f});break;case"body":o({...r,[d]:n(d,f)}),t({[d]:f});break;default:throw new Error(`Unhandled input name: ${d}`)}},s=l=>{const{name:c,value:d}=l.target;t({[c]:d})},a=l=>{const{name:c}=l.target,d=!e[c];t({[c]:d})};return u.jsx(Je,{title:A(w.REQUEST),children:u.jsxs("div",{className:"px-3",children:[u.jsxs("label",{className:"mb-2 block",children:[A(w.URL),u.jsx("input",{className:`w-full ${r.url?"":"invalid"}`,name:"url",onChange:i,placeholder:"https://u:p@example.com/api/status",type:"text",value:e.url}),u.jsx("p",{className:"requirements w-full",role:"alert",children:A(w.ERROR_VALUE_IS_REQUIRED)})]}),u.jsx("div",{className:"mb-1",children:u.jsx(an,{className:"w-full",label:A(w.METHOD),name:"method",onChange:s,value:e.method,children:FL.map(l=>u.jsx("option",{value:l,children:l},l))})}),u.jsx("div",{className:"mb-4",children:u.jsx(df,{checked:e.saveVariables,clickHandler:a,name:"saveVariables",subtitle:A(w.SAVE_VARIABLES_SUBTITLE),title:A(w.SAVE_VARIABLES)})}),u.jsx("label",{className:"mb-2 block",children:u.jsx(On,{errorText:A(w.ERROR_INVALID_JSON),inputMode:"text",label:A(w.REQUEST_HEADERS),name:"headers",onChange:i,placeholder:'{"Content-Type": "application/json", "X-Custom-Header": "foo"}',valid:r.headers,value:e.headers})}),u.jsx("label",{children:u.jsx(On,{errorText:A(w.ERROR_INVALID_JSON),inputMode:"text",label:A(w.REQUEST_BODY),name:"body",onChange:i,placeholder:A(w.STRING_OR_JSON),valid:r.body,value:e.body??""})})]})})},$L=({nodeData:e,handleOnUpdate:t})=>{const{validateField:n}=at("sendSms"),[r,o]=N.useState({body:e.initial||n("body",e.body),fromNumber:e.initial||n("fromNumber",e.fromNumber),toNumber:e.initial||n("toNumber",e.toNumber)}),i=s=>{const a=s.target,{name:l,value:c}=a;switch(l){case"body":case"fromNumber":case"toNumber":o({...r,[l]:n(l,c)}),t({initial:!1,[l]:c});break;default:throw new Error(`Unhandled input name: ${l}`)}};return u.jsx(Je,{title:A(w.SEND_SMS),children:u.jsxs("div",{className:"mx-3",children:[u.jsxs("label",{className:"mb-2 block",children:[A(w.TO_PHONE_NUMBER),u.jsx(vs,{className:"w-full",direction:"to",name:"toNumber",onChange:i,placeholder:"+12405550000",type:"tel",valid:r.toNumber,value:e.toNumber}),u.jsx("p",{className:"requirements w-full",role:"alert",children:A(w.ERROR_VALUE_IS_REQUIRED)})]}),u.jsxs("label",{className:"mb-2 block",children:[A(w.FROM_PHONE_NUMBER),u.jsx(vs,{className:"w-full",direction:"from",name:"fromNumber",onChange:i,placeholder:"+12405550000",type:"tel",valid:r.fromNumber,value:e.fromNumber}),u.jsx("p",{className:"requirements w-full",role:"alert",children:A(w.ERROR_VALUE_IS_REQUIRED)})]}),u.jsx("label",{children:u.jsx(On,{errorText:A(w.ERROR_VALUE_IS_REQUIRED),inputMode:"text",label:A(w.SMS_TEXT),name:"body",onChange:i,placeholder:A(w.WRITE_SOMETHING),valid:r.body,value:e.body})})]})})},BL=()=>({id:ie(),key:"",value:""}),HL=({nodeData:e,handleOnUpdate:t})=>{var f;const{validateField:n}=at("set"),[r,o]=N.useState({variables:e.variables.map(p=>({key:e.initial||n("key",p.key),value:e.initial||n("value",p.value)}))}),i=ar(e.variables,"key"),s=p=>{p==null||p.preventDefault(),o({...r,variables:[...r.variables,{key:!0,value:!0}]}),t({variables:[...e.variables,BL()]})},a=(p,h)=>{const v=[...e.variables];let E=v[p];if(!E)throw new Error(`Variable not found at index ${p}`);const{name:y,value:g}=h,m=[...r.variables];m[p]={...m[p],[y]:n(y,g)},o({...r,variables:m}),E={...v[p],[y]:g},v[p]=E,t({initial:!1,variables:v})},l=p=>h=>{h.preventDefault();const v=[...r.variables];v.splice(p,1),o({...r,variables:v});const E=[...e.variables];E.splice(p,1),t({variables:E})},c=(p,h)=>{const v=p.target,{name:E,value:y}=v;switch(E){case"key":case"value":h!==void 0&&a(h,{name:E,value:y});break;default:throw new Error(`Unhandled input name: ${E}`)}},d=({index:p,name:h})=>{const v=r.variables[p];return v==null?void 0:v[h]};return u.jsxs(Je,{title:A(w.SET_VARIABLES),children:[u.jsx("ol",{className:"divide-y-4 divide-foreground/10 border-b-4 border-foreground/10",children:(f=e.variables)==null?void 0:f.map((p,h,v)=>{const E=i(p.key);return u.jsxs("li",{className:"flex pt-3",children:[u.jsx("div",{className:"w-8 shrink-0 text-center",children:u.jsx(te,{className:"text-foreground/60",size:"xs",tag:"bars"})}),u.jsxs("div",{className:"relative mr-3",children:[v.length>1&&u.jsx(Bo,{className:"absolute right-0 top-0",handleDelete:l(h),label:A(w.REMOVE_VARIABLE,{index:h+1}),size:"sm",show:!0}),u.jsxs("fieldset",{children:[u.jsx("legend",{className:"sr-only",children:A(w.VARIABLE_NUMBER,{index:h+1})}),u.jsxs("label",{className:"mb-2 block",children:[A(w.KEY),u.jsx("input",{className:`w-full ${d({index:h,name:"key"})&&!E?"":"invalid"}`,name:"key",onChange:y=>c(y,h),type:"text",value:p.key}),u.jsx("p",{className:"requirements",role:"alert",children:A(E?w.ERROR_DUPLICATE_VARIABLE_KEY:w.ERROR_VARIABLE_KEY_REQUIRED)})]}),u.jsxs("label",{className:"mb-2 block",children:[A(w.VALUE),u.jsx("input",{className:`w-full ${d({index:h,name:"value"})?"":"invalid"}`,name:"value",onChange:y=>c(y,h),type:"text",value:p.value}),u.jsx("p",{className:"requirements",role:"alert",children:A(w.ERROR_TEXT_IS_REQUIRED)})]})]})]})]},p.id)})}),u.jsx("div",{className:"p-3 text-right",children:u.jsx("button",{className:"rounded bg-foreground/10 py-1 px-2 font-medium",onClick:s,type:"button",children:A(w.ADD_VARIABLE)})})]})},zL=(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])},q0=e=>{const[t,n]=N.useReducer((r,o)=>({...r,...o}),e);return[t,n]},WL=e=>({id:ie(),key:e}),GL=({nodeData:e,handleOnUpdate:t})=>{const i={currentFocus:void 0,listOpen:!1,setVariablesList:Y(y=>y.nodes).reduce((y,g)=>{if(g.type==="set"){const m=g.data.variables.map(_=>({id:_.id,key:_.key}));return[...y,...m]}else if(g.type==="unset")return[...y,...g.data.variables];return y},[]).reduce((y,g)=>(y.find(m=>m.key===g.key)||y.push(g),y),[]).map(y=>({...y,selected:!!e.variables.find(g=>g.key===y.key)})).sort((y,g)=>y.key.toLowerCase().localeCompare(g.key.toLowerCase()))},[s,a]=q0(i),l=y=>s.setVariablesList.map(g=>g.id===y?{...g,selected:!g.selected}:g),c=y=>{const g=s.setVariablesList.find(m=>m.id===y);if(!g)throw new Error("Variable not found");if(g.selected)d(g.id);else{const m=[...e.variables,WL(g.key)];a({setVariablesList:l(g.id)}),t({variables:m})}},d=y=>{const g=s.setVariablesList.filter(m=>m.selected&&m.id!==y);a({setVariablesList:l(y)}),t({variables:g})},f=N.useRef(null);zL(f,()=>a({listOpen:!1}));const p=y=>{(y.key==="Escape"||y.key==="Esc")&&a({listOpen:!1})},h=(y,g)=>{y.preventDefault(),(y.key===" "||y.code==="Space"||y.key==="Enter")&&c(g),p(y)},v=()=>{a({listOpen:!s.listOpen})},E=e.variables.length;return u.jsx(Je,{title:A(w.UNSET_VARIABLES),children:u.jsxs("div",{className:"px-3",children:[u.jsxs("div",{className:"mb-2 flex flex-col",children:[u.jsx("label",{id:"listbox-label",className:"sr-only",children:A(w.SELECT_VARIABLES_TO_UNSET)}),u.jsxs("div",{className:"relative",ref:f,children:[u.jsx("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
68
- after:absolute after:top-[.725rem] after:right-3 after:h-0 after:w-0 after:border-[5px] after:border-t-[6px] after:border-b-0 after:border-r-transparent after:border-l-transparent after:border-t-foreground after:content-['']`,onClick:v,onKeyDown:p,type:"button",children:E>0?A(w.NUMBER_OF_VARIABLES_SELECTED,{count:E}):A(w.SELECT_VARIABLES)}),s.listOpen&&u.jsxs("ul",{"aria-activedescendant":s.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:[!s.setVariablesList.length&&u.jsx("li",{"aria-disabled":"true",className:"relative",role:"option",children:u.jsx("label",{className:"flex select-none items-center py-2 pl-3 pr-9",children:A(w.NO_VARIABLES_SET)})}),s.setVariablesList.map(y=>{if(y.key)return u.jsx("li",{"aria-selected":y.selected,className:"relative",id:y.id,role:"option",children:u.jsxs("label",{className:"flex select-none items-center py-2 pl-3 pr-9",children:[u.jsx("input",{checked:y.selected,className:"mr-2 h-4 w-4 rounded accent-primary",onChange:()=>c(y.id),onKeyDown:g=>h(g,y.id),type:"checkbox"}),y.key]})},y.id)})]})]})]}),E>0&&u.jsxs("section",{className:"pt-3",children:[u.jsx("h3",{className:"mb-2 text-xs font-medium text-foreground",children:A(w.UNSET_VARIABLES)}),u.jsx("ul",{className:"flex flex-wrap gap-2",children:s.setVariablesList.map(y=>y.selected&&u.jsx(Qb,{handleClick:()=>d(y.id),children:y.key},y.id))})]})]})})},J0={aiAgent:({data:e,formUpdate:t})=>u.jsx(wL,{handleOnUpdate:t,nodeData:e}),cond:({data:e,formUpdate:t})=>u.jsx(AL,{handleOnUpdate:t,nodeData:e}),condRequest:({data:e,formUpdate:t})=>u.jsx(TL,{handleOnUpdate:t,nodeData:e}),executeSWML:({data:e,formUpdate:t})=>u.jsx(IL,{handleOnUpdate:t,nodeData:e}),forwardAddress:({data:e,formUpdate:t})=>u.jsx(zf,{handleOnUpdate:t,nodeData:e,nodeType:"forwardAddress"}),forwardPhone:({data:e,formUpdate:t})=>u.jsx(zf,{handleOnUpdate:t,nodeData:e,nodeType:"forwardPhone"}),forwardResource:({data:e,formUpdate:t})=>u.jsx(zf,{handleOnUpdate:t,nodeData:e,nodeType:"forwardResource"}),hangup:({data:e,formUpdate:t})=>u.jsx(kL,{handleOnUpdate:t,nodeData:e}),play:({data:e,formUpdate:t})=>u.jsx(PL,{handleOnUpdate:t,nodeData:e}),promptPlay:({data:e,formUpdate:t})=>u.jsx(DL,{handleOnUpdate:t,nodeData:e}),record:({data:e,formUpdate:t})=>u.jsx(UL,{handleOnUpdate:t,nodeData:e}),recordCallStart:({data:e,formUpdate:t})=>u.jsx(ML,{handleOnUpdate:t,nodeData:e}),recordCallStop:({data:e,formUpdate:t})=>u.jsx(jL,{handleOnUpdate:t,nodeData:e}),request:({data:e,formUpdate:t})=>u.jsx(VL,{handleOnUpdate:t,nodeData:e}),sendSms:({data:e,formUpdate:t})=>u.jsx($L,{handleOnUpdate:t,nodeData:e}),set:({data:e,formUpdate:t})=>u.jsx(HL,{handleOnUpdate:t,nodeData:e}),unset:({data:e,formUpdate:t})=>u.jsx(GL,{handleOnUpdate:t,nodeData:e})},YL=(e,t)=>{if("options"in t)switch(e.type){case"promptPlay":case"cond":case"condRequest":return!0}return!1},KL=e=>{if(e in J0)return J0[e]},QL=()=>{var c;const{partialUpdateNodeData:e,removeNode:t}=Se(),n=Y(d=>d.selectedNode),r=n==null?void 0:n.id,i=(c=Y(d=>d.nodes).find(d=>d.id===r))==null?void 0:c.data,{updateDynamicHandles:s}=gL(n);if(!(n&&i&&r))return null;const a=d=>{YL(n,d)&&s(d),e(r,d)},l=KL(n.type);return l?u.jsxs(ns,{className:"nokey m-0 flex h-full w-[260px] flex-col overflow-hidden rounded-none border border-foreground/10 bg-background pt-4",position:"top-right",children:[u.jsx(l,{data:i,formUpdate:a},r),n.deletable!==!1&&u.jsx("div",{className:"border-t border-foreground/10 p-3",children:u.jsx(Bo,{handleDelete:()=>t(r),label:A(w.DELETE_NODE),show:!0,showLabel:!0})})]}):null},Z0=N.forwardRef(function({animate:t=!0,children:n,className:r="",iconTag:o="circle-info",message:i,role:s="alertdialog",status:a},l){const d=a?{error:"bg-negative text-background",success:"bg-positive text-background"}[a]:"";return u.jsxs("div",{className:`flex items-center justify-between rounded-lg bg-foreground p-2
67
+ ${i}`})},pC=Wr.forwardRef(function(t,n){const{children:r,style:o,...i}=t,{getRootElement:s}=xe(),a=s(),l=Df(),c=A0([l.refs.setFloating,n]);return u.jsx(T0,{root:a,children:l.open&&u.jsxs("div",{className:"relative max-w-md rounded-md bg-foreground p-2 text-sm text-background shadow-sm",ref:c,style:{left:l.x??0,position:l.strategy,top:l.y??0,visibility:l.x==null?"hidden":"visible",...o},...l.getFloatingProps(i),children:[u.jsx("div",{className:"overflow-hidden",children:r}),u.jsx(fC,{})]})})}),hC=w.forwardRef(function({children:t,asChild:n=!1,...r},o){const i=Df(),s=A0([i.refs.setReference,o,t==null?void 0:t.ref]);return n&&w.isValidElement(t)?w.cloneElement(t,i.getReferenceProps({ref:s,...r,...t.props,"data-state":i.open?"open":"closed"})):u.jsx("button",{ref:s,"data-state":i.open?"open":"closed",...i.getReferenceProps(r),children:t})}),b0={bottom:"top",left:"right",right:"left",top:"bottom"},sr=({asChild:e=!0,children:t,enable:n=!0,placement:r="right",scale:o=1,trigger:i=u.jsx(te,{tag:"circle-info"}),...s})=>{let a=r.split("-")[0];return a=Object.keys(b0).includes(a)?a:"right",n?u.jsxs(uC,{...s,placement:r,children:[u.jsx(hC,{asChild:e,children:i}),u.jsx(pC,{style:o!==1?{transform:`scale(${o})`,transformOrigin:b0[a]}:void 0,children:t})]}):u.jsx(u.Fragment,{children:i})},gC={ABOUT:"About",ACTION:"Action",ADD_ADDRESS:"Add address",ADD_AI_AGENT:"Add AI agent",ADD_CONDITION:"Add condition",ADD_OPTION:"Add option",ADD_PHONE_NUMBER:"Add phone number",ADD_RESOURCE:"Add resource",ADD_VARIABLE:"Add variable",ADDRESS_NUMBER:"Address {{index}}",AI_AGENT:"AI Agent",AI_AGENT_NAME:"AI Agent Name",ANSWER_CALL:"Answer Call",API_VERSION:"API Version",ARE_YOU_SURE:"Are you sure?",AUDIO_FILE:"Audio File",BEEP:"Beep",BEEP_SUBTITLE:"Play a beep before recording",BUSY:"Busy",CALL_ADDRESSES:"Call Addresses",CALL_NUMBERS:"Call Numbers",CALL_RESOURCES:"Call Resources",CALL_STATE_EVENTS:"Call State Events",CALL_STATE_URL:"Call State URL",CALLER_PRESSES:"Caller presses",CALLER_SAYS:"Caller says",CANCEL:"Cancel",CAUTION:"Caution",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",CONFIRMATION_REMOVE_OPTION:"Are you sure? Removing this option will delete the flow connection and move back the following option, if there is one.",CONFIRMATION_REMOVE_VARIABLE:"Are you sure you want to remove this variable?",DECISION:"Decision",DECLINE:"Decline",DEFAULT_FROM:"Default From",DEFAULT_TIMEOUT:"Default Timeout",DELETE:"Delete",DELETE_NODE:"Delete node",DEPLOY:"Deploy",DEPLOY_WARNING:"Caution - Confirm Deploy",DEPRECATED:"Deprecated",DISCONNECT_CALL_AFTER_RINGING:"Disconnect call after ringing",DOCUMENT_OUT_OF_SYNC:"Document Out of Sync",EDIT_SELECTED_AI_AGENT:"Edit Selected AI Agent",ELSE:"Else",END_SILENCE_TIMEOUT:"End Silence Timeout",ENTER_URL:"Enter URL",ERROR:"Error",ERROR_ADD_AI_AGENT_FIRST:"Please add an AI Agent first.",ERROR_ADD_RECORDING_FIRST:"Please add a Start Call Recording node first.",ERROR_DUPLICATE_COMMAND:"This command is already used. Please use a unique phrase.",ERROR_DUPLICATE_RECORDING_LABEL:"This entry already exists. Please use a unique label.",ERROR_DUPLICATE_TELEPHONE_KEY:"This key is already used. Please use a unique key.",ERROR_DUPLICATE_VARIABLE_KEY:"This variable already exists. Please use a unique key.",ERROR_FETCHING_AI_AGENTS:"Error fetching AI Agents.",ERROR_FETCHING_DEPLOYED_VERSIONS:"Error fetching deployed versions.",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_SELECTION_REQUIRED:"A selection is required.",ERROR_STRING_VALUE_REQUIRED:"Invalid character. String value is required.",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.",EXECUTE_SWML:"Execute SWML",FAILED:"Failed",FAILURE:"Failure",FEMALE:"Female",FLOW_DATA_VERSION:"Flow Data Version",FORMAT:"Format",FORWARD:"Forward",FORWARD_TO_ADDRESS:"Forward to Address",FORWARD_TO_PHONE:"Forward to Phone",FORWARD_TO_RESOURCE:"Forward to Resource",FROM:"From",FROM_PHONE_NUMBER:"From Phone Number",GATHER_INPUT:"Gather Input",GENDER:"Gender",GO_BACK:"Go Back",HANDLE_CALL:"Handle Call",HANG_UP:"Hang Up",HANG_UP_CALL:"Hang Up Call",HELP:"Help",HIDDEN:"Hidden",IGNORE:"Ignore",INFO_DEPLOY:"Deploy the latest changes for the current call flow.",INFO_INVALID_SETTINGS:"Please check the settings and ensure that all required fields are filled in correctly.",INFO_NODE_AI_AGENT:"<p>Used to connect to a conversational AI Agent for processing.</p><p>Choose the appropriate AI Agent or create a new one: <a>AI Agents</a></p>",INFO_NODE_COND:`<p>A condition works like a JavaScript <code>if</code> statement.</p><p>A condition field can reference variables that have been set in the flow with <code>%{Key}</code>, Request node responses accessed with <code>%{request_response['object_field']}</code>, or call parameters such as <code>%{call.from}</code>.</p><p>Add additional conditions to create <code>else if</code> conditions.</p><p>The "Cond #" path will be executed for a truthy condition. The "Else" path will be executed for a falsy condition.</p>`,INFO_NODE_CONDREQUEST:"<p>Send a GET, POST, PUT, or DELETE request to any webhook.</p><p>This can be used to submit variables and information about an inbound call to an external server, or you can retrieve information from external servers and use them as variables throughout the call flow. You can also build conditions directly into this module.</p><p>Response variables can be accessed with <code>%{request_response['object_field']}</code>.</p><p>Headers should be input in JSON format. Valid header values are <code>Accept</code>, <code>Authorization</code>, <code>Content-Type</code>, <code>Range</code>, and <code>custom X- headers</code>.</p>",INFO_NODE_EXECUTE_SWML:"Execute a remote SWML document and return to the current document. Use <code>%{return_value.['object_field']}</code> to reference the return values from the external SWML.",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_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:"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_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_REQUEST:"<p>Send a GET, POST, PUT, or DELETE request to any webhook.</p><p>This can be used to submit variables and information about an inbound call to an external server, or you can retrieve information from external servers and use them as variables throughout the call flow. You can also build conditions directly into this module.</p><p>Response variables can be accessed with <code>%{request_response['object_field']}</code>.</p><p>Headers should be input in JSON format. Valid header values are <code>Accept</code>, <code>Authorization</code>, <code>Content-Type</code>, <code>Range</code>, and <code>custom X- headers</code>.</p>",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:`<p>Set variables that can be accessed from other node blocks in the call flow.</p><p>The value can be a static value <code>("value")</code>, a variable from another node such as a request response <code>%{request_response.['object_field']}</code>, or a call parameter <code>%{call.from}</code>.</p><p>Access these variables in other blocks with <code>%{Key}</code> and unset variables with the Unset Variables block.</p>`,INFO_NODE_UNSET_VARIABLES:"Unsets script variables.",INFO_NOT_CONNECTED_TO_FLOW:"This node is not connected to the flow and will not be executed during the call. Please connect the node to the flow if you wish to use it.",INFO_STATUS_ERROR:"An error occurred while loading or saving the flow.",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.",INITIAL_TIMEOUT:"Initial Timeout",INPUT:"Input",INVALID_SETTINGS:"Invalid settings",JSON_OBJECT:"JSON object to serialize",KEY:"Key",KEYPAD_VALUE:"Keypad value",LANGUAGE:"Language",MALE:"Male",MAXIMUM_RECORDING_LENGTH:"Maximum Recording Length",META:"Meta",METHOD:"Method",MORE_INFO_DEPLOY:"Deploying a Call Flow makes it live.",MORE_INFO_DEPLOY_ERROR:"There was an error deploying the Call Flow. Please try again. {{message}}",MORE_INFO_STATUS_ERROR:"More info on Flow document error",MORE_INFO_TESTING_YOUR_FLOW:"Info on testing your call flow",MORE_INFO_TITLE:"More info {{title}}",MORE_WITH_COUNT:"{{count}} more",NAVIGATE_BACK:"Navigate Back",NO_ANSWER:"No Answer",NO_DEPLOYED_VERSIONS:"<p>No deployed versions found.</p> <p>Deploy a flow to view the history.</p>",NO_INPUT:"No Input",NO_VARIABLES_SET:"Please set variables first",NOT_CONNECTED_TO_FLOW:"Not connected to flow",NUMBER_OF_VALIDATION_WARNINGS_one:"There is {{count}} validation warning in your flow",NUMBER_OF_VALIDATION_WARNINGS_other:"There are {{count}} validation warnings in your flow",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_CALLER_SAYS:"or says",OR_SAYS:"Or says",PARAMS:"Params",PHONE_NUMBER:"Phone Number",PHONE_NUMBER_NUMBER:"Phone Number {{index}}",PKG_VERSION:"Package Version",PLAY_AUDIO:"Play Audio",PLAY_AUDIO_FILE:"Play Audio File",PLAY_AUDIO_TTS:"Play Audio or TTS",PREVIEW_DEPLOYED_VERSION:"You are previewing this version.",REASON:"Reason",RECORD:"Record",RECORD_CALL_START:"Start Call Recording",RECORD_CALL_STOP:"Stop Call Recording",RECORDING:"Recording",RECORDING_NAME:"Recording Name",RECORDING_NAME_DEFAULT:"Recording {{index}}",REMOVE_ADDRESS:"Remove Address {{index}}",REMOVE_CONDITION:"Remove Condition {{index}}",REMOVE_EDGE:"Remove Edge",REMOVE_NODE:"Remove Node {{title}}",REMOVE_OPTION:"Remove Option {{index}}",REMOVE_PHONE_NUMBER:"Remove Phone Number {{index}}",REMOVE_RESOURCE:"Remove Resource {{index}}",REMOVE_VARIABLE:"Remove Variable {{index}}",REQUEST:"Request",REQUEST_BODY:"Body",REQUEST_HEADERS:"Headers (JSON)",REQUIRED_SETTINGS:"Required Settings",RESOURCE_NUMBER:"Resource {{index}}",RESTORE:"Restore",RESTORE_THIS_VERSION:"Restore this version",RESYNC:"Resync",RESYNC_AI_AGENTS:"Resync AI Agents",SAVED:"Saved",SAVE_VARIABLES:"Save Variables",SAVE_VARIABLES_SUBTITLE:"Store the response as variables",SECONDS:"Seconds",SELECT:"Select",SELECT_VARIABLES:"Select Variables",SELECT_VARIABLES_TO_UNSET:"Select Variables to Unset",SEND_SMS:"Send SMS",SEPARATE_WITH_COMMAS:"Separate with commas",SEQUENTIALLY:"Sequentially",SET_VARIABLES:"Set Variables",SIMULTANEOUSLY:"Simultaneously",SMS_TEXT:"SMS Text",SPOKEN_PROMPT:"Spoken prompt",STATUS_DEPLOY:"Deploy",STATUS_DEPLOY_ERROR:"Deploy Error",STATUS_DEPLOYED:"Deployed",STATUS_DEPLOYING:"Deploying...",STATUS_ERROR:"Error",STATUS_LOADING:"Loading...",STATUS_LOCKED:"Locked",STATUS_SAVED:"Saved",STATUS_SAVING:"Saving...",STEREO:"Stereo",STEREO_SUBTITLE:"Enable stereo audio",STRING_OR_JSON:"String or JSON to serialize",SUCCESS:"Success",SWML_VERSION:"SWML Version",TERMINATORS:"Terminators",TEXT:"Text",TEXT_TO_SPEECH:"Text to Speech",TIMEOUT:"Timeout",TO:"To",TO_PHONE_NUMBER:"To Phone Number",TOAST_DEPLOY_WARNING:'<p>There are inconsistencies in your Call Flow which may cause unexpected behavior. Please review the Call Flow before deploying.</p><p>Choose "Deploy" to deploy the Call Flow or "Cancel" to return to editing.</p>',TOAST_DOCUMENT_OUT_OF_SYNC:'<p>Updates have been made to this Call Flow by another user and your recent changes have not been saved.</p><p>Choose "Ignore" to view your changes in a locked state or "Resync" to abandon your changes and adopt the latest updates.</p>',UNKNOWN:"Unknown",UNSET_VARIABLES:"Unset Variables",URL:"URL",VALUE:"Value",VARIABLE_KEY:"Variable {{key}}",VARIABLE_NUMBER:"Variable {{index}}",VERSION_HISTORY:"Version History",VERSION_LIST_ITEM:"Version {{number}}",VERSION_RESTORED:"Version restored",VOICE:"Voice",VOICEMAIL_RECORDING:"Voicemail Recording",WAIT_FOR_DIGIT:"Wait for Digit",WAIT_FOR_INPUT:"Wait for Input",WARNING:"Warning",WRITE_SOMETHING:"Write something"},N={ABOUT:"ABOUT",ACTION:"ACTION",ADDRESS_NUMBER:"ADDRESS_NUMBER",ADD_ADDRESS:"ADD_ADDRESS",ADD_AI_AGENT:"ADD_AI_AGENT",ADD_CONDITION:"ADD_CONDITION",ADD_OPTION:"ADD_OPTION",ADD_PHONE_NUMBER:"ADD_PHONE_NUMBER",ADD_RESOURCE:"ADD_RESOURCE",ADD_VARIABLE:"ADD_VARIABLE",AI_AGENT:"AI_AGENT",AI_AGENT_NAME:"AI_AGENT_NAME",ANSWER_CALL:"ANSWER_CALL",API_VERSION:"API_VERSION",ARE_YOU_SURE:"ARE_YOU_SURE",AUDIO_FILE:"AUDIO_FILE",BEEP:"BEEP",BEEP_SUBTITLE:"BEEP_SUBTITLE",BUSY:"BUSY",CALLER_PRESSES:"CALLER_PRESSES",CALLER_SAYS:"CALLER_SAYS",CALL_ADDRESSES:"CALL_ADDRESSES",CALL_NUMBERS:"CALL_NUMBERS",CALL_RESOURCES:"CALL_RESOURCES",CALL_STATE_EVENTS:"CALL_STATE_EVENTS",CALL_STATE_URL:"CALL_STATE_URL",CANCEL:"CANCEL",CAUTION:"CAUTION",CHOOSE_OPTION_SINGLE_MULTIPLE:"CHOOSE_OPTION_SINGLE_MULTIPLE",CHOOSE_OPTION_TTS_AUDIO:"CHOOSE_OPTION_TTS_AUDIO",CLOSE:"CLOSE",CONDITIONS:"CONDITIONS",CONDITION_NUMBER:"CONDITION_NUMBER",COND_NUMBER:"COND_NUMBER",CONFIRMATION_REMOVE_OPTION:"CONFIRMATION_REMOVE_OPTION",CONFIRMATION_REMOVE_VARIABLE:"CONFIRMATION_REMOVE_VARIABLE",DECISION:"DECISION",DECLINE:"DECLINE",DEFAULT_FROM:"DEFAULT_FROM",DEFAULT_TIMEOUT:"DEFAULT_TIMEOUT",DELETE:"DELETE",DELETE_NODE:"DELETE_NODE",DEPLOY:"DEPLOY",DEPLOY_WARNING:"DEPLOY_WARNING",DEPRECATED:"DEPRECATED",DISCONNECT_CALL_AFTER_RINGING:"DISCONNECT_CALL_AFTER_RINGING",DOCUMENT_OUT_OF_SYNC:"DOCUMENT_OUT_OF_SYNC",EDIT_SELECTED_AI_AGENT:"EDIT_SELECTED_AI_AGENT",ELSE:"ELSE",END_SILENCE_TIMEOUT:"END_SILENCE_TIMEOUT",ENTER_URL:"ENTER_URL",ERROR:"ERROR",ERROR_ADD_AI_AGENT_FIRST:"ERROR_ADD_AI_AGENT_FIRST",ERROR_ADD_RECORDING_FIRST:"ERROR_ADD_RECORDING_FIRST",ERROR_DUPLICATE_COMMAND:"ERROR_DUPLICATE_COMMAND",ERROR_DUPLICATE_RECORDING_LABEL:"ERROR_DUPLICATE_RECORDING_LABEL",ERROR_DUPLICATE_TELEPHONE_KEY:"ERROR_DUPLICATE_TELEPHONE_KEY",ERROR_DUPLICATE_VARIABLE_KEY:"ERROR_DUPLICATE_VARIABLE_KEY",ERROR_FETCHING_AI_AGENTS:"ERROR_FETCHING_AI_AGENTS",ERROR_FETCHING_DEPLOYED_VERSIONS:"ERROR_FETCHING_DEPLOYED_VERSIONS",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_SELECTION_REQUIRED:"ERROR_SELECTION_REQUIRED",ERROR_STRING_VALUE_REQUIRED:"ERROR_STRING_VALUE_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",EXECUTE_SWML:"EXECUTE_SWML",FAILED:"FAILED",FAILURE:"FAILURE",FEMALE:"FEMALE",FLOW_DATA_VERSION:"FLOW_DATA_VERSION",FORMAT:"FORMAT",FORWARD:"FORWARD",FORWARD_TO_ADDRESS:"FORWARD_TO_ADDRESS",FORWARD_TO_PHONE:"FORWARD_TO_PHONE",FORWARD_TO_RESOURCE:"FORWARD_TO_RESOURCE",FROM:"FROM",FROM_PHONE_NUMBER:"FROM_PHONE_NUMBER",GATHER_INPUT:"GATHER_INPUT",GENDER:"GENDER",GO_BACK:"GO_BACK",HANDLE_CALL:"HANDLE_CALL",HANG_UP:"HANG_UP",HANG_UP_CALL:"HANG_UP_CALL",HELP:"HELP",HIDDEN:"HIDDEN",IGNORE:"IGNORE",INFO_DEPLOY:"INFO_DEPLOY",INFO_INVALID_SETTINGS:"INFO_INVALID_SETTINGS",INFO_NODE_AI_AGENT:"INFO_NODE_AI_AGENT",INFO_NODE_COND:"INFO_NODE_COND",INFO_NODE_CONDREQUEST:"INFO_NODE_CONDREQUEST",INFO_NODE_EXECUTE_SWML:"INFO_NODE_EXECUTE_SWML",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_PLAY:"INFO_NODE_PLAY",INFO_NODE_RECORD:"INFO_NODE_RECORD",INFO_NODE_RECORD_CALL_START:"INFO_NODE_RECORD_CALL_START",INFO_NODE_RECORD_CALL_STOP:"INFO_NODE_RECORD_CALL_STOP",INFO_NODE_REQUEST:"INFO_NODE_REQUEST",INFO_NODE_SEND_SMS:"INFO_NODE_SEND_SMS",INFO_NODE_SET_VARIABLES:"INFO_NODE_SET_VARIABLES",INFO_NODE_UNSET_VARIABLES:"INFO_NODE_UNSET_VARIABLES",INFO_NOT_CONNECTED_TO_FLOW:"INFO_NOT_CONNECTED_TO_FLOW",INFO_STATUS_ERROR:"INFO_STATUS_ERROR",INFO_STATUS_ERROR_OUT_OF_SYNC:"INFO_STATUS_ERROR_OUT_OF_SYNC",INITIAL_TIMEOUT:"INITIAL_TIMEOUT",INPUT:"INPUT",INVALID_SETTINGS:"INVALID_SETTINGS",JSON_OBJECT:"JSON_OBJECT",KEY:"KEY",KEYPAD_VALUE:"KEYPAD_VALUE",LANGUAGE:"LANGUAGE",MALE:"MALE",MAXIMUM_RECORDING_LENGTH:"MAXIMUM_RECORDING_LENGTH",META:"META",METHOD:"METHOD",MORE_INFO_DEPLOY:"MORE_INFO_DEPLOY",MORE_INFO_DEPLOY_ERROR:"MORE_INFO_DEPLOY_ERROR",MORE_INFO_STATUS_ERROR:"MORE_INFO_STATUS_ERROR",MORE_INFO_TESTING_YOUR_FLOW:"MORE_INFO_TESTING_YOUR_FLOW",MORE_INFO_TITLE:"MORE_INFO_TITLE",MORE_WITH_COUNT:"MORE_WITH_COUNT",NAVIGATE_BACK:"NAVIGATE_BACK",NOT_CONNECTED_TO_FLOW:"NOT_CONNECTED_TO_FLOW",NO_ANSWER:"NO_ANSWER",NO_DEPLOYED_VERSIONS:"NO_DEPLOYED_VERSIONS",NO_INPUT:"NO_INPUT",NO_VARIABLES_SET:"NO_VARIABLES_SET",NUMBER_OF_VALIDATION_WARNINGS:"NUMBER_OF_VALIDATION_WARNINGS",NUMBER_OF_VARIABLES_SELECTED:"NUMBER_OF_VARIABLES_SELECTED",OFF:"OFF",ON:"ON",OPTIONAL:"OPTIONAL",OPTION_NUMBER:"OPTION_NUMBER",OPT_NUMBER:"OPTION_NUMBER",OR_CALLER_SAYS:"OR_CALLER_SAYS",OR_SAYS:"OR_SAYS",PARAMS:"PARAMS",PHONE_NUMBER:"PHONE_NUMBER",PHONE_NUMBER_NUMBER:"PHONE_NUMBER_NUMBER",PKG_VERSION:"PKG_VERSION",PLAY_AUDIO:"PLAY_AUDIO",PLAY_AUDIO_FILE:"PLAY_AUDIO_FILE",PLAY_AUDIO_TTS:"PLAY_AUDIO_TTS",PREVIEW_DEPLOYED_VERSION:"PREVIEW_DEPLOYED_VERSION",REASON:"REASON",RECORD:"RECORD",RECORDING:"RECORDING",RECORDING_NAME:"RECORDING_NAME",RECORDING_NAME_DEFAULT:"RECORDING_NAME_DEFAULT",RECORD_CALL_START:"RECORD_CALL_START",RECORD_CALL_STOP:"RECORD_CALL_STOP",REMOVE_ADDRESS:"REMOVE_ADDRESS",REMOVE_CONDITION:"REMOVE_CONDITION",REMOVE_EDGE:"REMOVE_EDGE",REMOVE_NODE:"REMOVE_NODE",REMOVE_OPTION:"REMOVE_OPTION",REMOVE_PHONE_NUMBER:"REMOVE_PHONE_NUMBER",REMOVE_RESOURCE:"REMOVE_RESOURCE",REMOVE_VARIABLE:"REMOVE_VARIABLE",REQUEST:"REQUEST",REQUEST_BODY:"REQUEST_BODY",REQUEST_HEADERS:"REQUEST_HEADERS",RESOURCE_NUMBER:"RESOURCE_NUMBER",RESTORE:"RESTORE",RESTORE_THIS_VERSION:"RESTORE_THIS_VERSION",RESYNC:"RESYNC",RESYNC_AI_AGENTS:"RESYNC_AI_AGENTS",SAVED:"SAVED",SAVE_VARIABLES:"SAVE_VARIABLES",SAVE_VARIABLES_SUBTITLE:"SAVE_VARIABLES_SUBTITLE",SECONDS:"SECONDS",SELECT:"SELECT",SELECT_VARIABLES:"SELECT_VARIABLES",SELECT_VARIABLES_TO_UNSET:"SELECT_VARIABLES_TO_UNSET",SEND_SMS:"SEND_SMS",SEPARATE_WITH_COMMAS:"SEPARATE_WITH_COMMAS",SEQUENTIALLY:"SEQUENTIALLY",SET_VARIABLES:"SET_VARIABLES",SIMULTANEOUSLY:"SIMULTANEOUSLY",SMS_TEXT:"SMS_TEXT",SPOKEN_PROMPT:"SPOKEN_PROMPT",STATUS_DEPLOY:"STATUS_DEPLOY",STATUS_DEPLOYED:"STATUS_DEPLOYED",STATUS_DEPLOYING:"STATUS_DEPLOYING",STATUS_DEPLOY_ERROR:"STATUS_DEPLOY_ERROR",STATUS_ERROR:"STATUS_ERROR",STATUS_LOADING:"STATUS_LOADING",STATUS_LOCKED:"STATUS_LOCKED",STATUS_SAVED:"STATUS_SAVED",STATUS_SAVING:"STATUS_SAVING",STEREO:"STEREO",STEREO_SUBTITLE:"STEREO_SUBTITLE",STRING_OR_JSON:"STRING_OR_JSON",SUCCESS:"SUCCESS",SWML_VERSION:"SWML_VERSION",TERMINATORS:"TERMINATORS",TEXT:"TEXT",TEXT_TO_SPEECH:"TEXT_TO_SPEECH",TIMEOUT:"TIMEOUT",TO:"TO",TOAST_DEPLOY_WARNING:"TOAST_DEPLOY_WARNING",TOAST_DOCUMENT_OUT_OF_SYNC:"TOAST_DOCUMENT_OUT_OF_SYNC",TO_PHONE_NUMBER:"TO_PHONE_NUMBER",UNKNOWN:"UNKNOWN",UNSET_VARIABLES:"UNSET_VARIABLES",URL:"URL",VALUE:"VALUE",VARIABLE_KEY:"VARIABLE_KEY",VARIABLE_NUMBER:"VARIABLE_NUMBER",VERSION_HISTORY:"VERSION_HISTORY",VERSION_LIST_ITEM:"VERSION_LIST_ITEM",VERSION_RESTORED:"VERSION_RESTORED",VOICE:"VOICE",VOICEMAIL_RECORDING:"VOICEMAIL_RECORDING",WAIT_FOR_DIGIT:"WAIT_FOR_DIGIT",WAIT_FOR_INPUT:"WAIT_FOR_INPUT",WARNING:"WARNING",WRITE_SOMETHING:"WRITE_SOMETHING"},mC={order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag","path","subdomain"],lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupQuerystring:"lng",lookupSessionStorage:"i18nextLng",caches:["localStorage","cookie"],excludeCacheFor:["cimode"]},EC={"en-US":{translation:gC}},vC=async()=>{await Le.use(Ay).use(hb).init({debug:MA,detection:mC,fallbackLng:"en-US",interpolation:{escapeValue:!1},keySeparator:!1,resources:EC})};function T(e,t){return t?Le.t(e,t):Le.t(e)}function $l(e,t={}){return u.jsx(Xb,{label:e,vars:t})}const C0=()=>Le.resolvedLanguage,yC={entries:[],nextLabelIndex:0},Go=us((e,t)=>({...yC,actions:{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="",r=t().nextLabelIndex;do r++,n=T(N.RECORDING_NAME_DEFAULT,{index:r});while(this.isValueDuplicate(n));return e({nextLabelIndex:r}),n},isKeyDuplicate(n){return t().entries.some(r=>r.controlId===n)},isValueDuplicate(n,r){const o=n.trim();return!!t().entries.reduce((s,a)=>{const{label:l,controlId:c}=a;return l!==""&&l===o&&(!r||c!==r)?[...s,a]:s},[]).length},removeEntry(n){e(r=>({entries:r.entries.filter(o=>o.controlId!==n)}))},upsertEntry:n=>{const{actions:r}=t(),{isKeyDuplicate:o}=r;e(i=>{let s=[...i.entries];const a=n.label.trim(),l=!!a;return(o(n.controlId)||!l)&&(s=s.filter(c=>c.controlId!==n.controlId)),l&&s.push({...n,label:a}),{entries:s}})}}})),kf=()=>Go.getState().actions,L0=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})}),Go.setState({entries:t,nextLabelIndex:t.length})},_C=(e,t)=>{const n=[];return t.forEach(r=>{r.type==="recordCallStart"&&r.data.controlId&&(n.push(r.data.controlId),Go.getState().actions.removeEntry(r.data.controlId))}),n.length?e.reduce((r,o)=>o.type==="recordCallStop"&&n.includes(o.data.controlId)?[...r,{...o,data:{...o.data,controlId:""}}]:r,[]):[]},D0={recordCallStart:e=>{const t=Go.getState().actions.getGeneratedLabel();return Go.getState().actions.upsertEntry({controlId:e.data.controlId,label:t}),{...e,data:{...e.data,label:t}}}},SC=e=>typeof e=="object"&&e!==null&&Object.keys(e).length>0,xC=e=>D0[e.type]!==void 0,k0=(e,t={})=>{const{deletable:n=!0,position:r={x:300,y:250},selected:o=!0}=t,i=()=>({data:{initial:!0,valid:!1},deletable:n,id:ie(),position:r,selected:o,type:e}),s=(c,d)=>({...c,data:{...c.data,...d}});let a=i();const l=Jv[e]();return SC(l)&&(a=s(a,l)),xC(a)&&(a=D0[a.type](a)),a},Bl={action:{label:N.ACTION,nodes:{answer:{active:!0,label:N.ANSWER_CALL},hangup:{active:!0,infoLabel:N.INFO_NODE_HANG_UP,label:N.HANG_UP_CALL},play:{active:!0,infoLabel:N.INFO_NODE_PLAY,label:N.PLAY_AUDIO_TTS},sendSms:{active:!0,infoLabel:N.INFO_NODE_SEND_SMS,label:N.SEND_SMS}}},decision:{label:N.DECISION,nodes:{cond:{active:!0,infoLabel:N.INFO_NODE_COND,label:N.CONDITIONS},executeSWML:{active:!0,infoLabel:N.INFO_NODE_EXECUTE_SWML,label:N.EXECUTE_SWML},set:{active:!0,infoLabel:N.INFO_NODE_SET_VARIABLES,label:N.SET_VARIABLES},unset:{active:!0,infoLabel:N.INFO_NODE_UNSET_VARIABLES,label:N.UNSET_VARIABLES}}},forwardTo:{label:N.FORWARD,nodes:{forwardAddress:{active:!1,infoLabel:N.INFO_NODE_FORWARD_TO_ADDRESS,label:N.FORWARD_TO_ADDRESS},forwardPhone:{active:!0,infoLabel:N.INFO_NODE_FORWARD_TO_PHONE,label:N.FORWARD_TO_PHONE},forwardResource:{active:!1,infoLabel:N.INFO_NODE_FORWARD_TO_RESOURCE,label:N.FORWARD_TO_RESOURCE}}},hidden:{label:N.HIDDEN,nodes:{handleCall:{active:!0,label:N.HANDLE_CALL}}},input:{label:N.INPUT,nodes:{aiAgent:{active:!0,infoLabel:N.INFO_NODE_AI_AGENT,label:N.AI_AGENT},condRequest:{active:!0,infoLabel:N.INFO_NODE_CONDREQUEST,label:N.REQUEST},promptPlay:{active:!0,infoLabel:N.INFO_NODE_GATHER_INPUT,label:N.GATHER_INPUT},request:{active:!1,deprecated:!0,infoLabel:N.INFO_NODE_REQUEST,label:N.REQUEST}}},recording:{label:N.RECORD,nodes:{record:{active:!0,infoLabel:N.INFO_NODE_RECORD,label:N.VOICEMAIL_RECORDING},recordCallStart:{active:!0,infoLabel:N.INFO_NODE_RECORD_CALL_START,label:N.RECORD_CALL_START},recordCallStop:{active:!0,infoLabel:N.INFO_NODE_RECORD_CALL_STOP,label:N.RECORD_CALL_STOP}}}},RC=Object.entries(Bl).reduce((e,[,{nodes:t}])=>(Object.entries(t).forEach(([n,{label:r}])=>{e.set(n,r)}),e),new Map),NC=Object.entries(Bl).reduce((e,[,{nodes:t}])=>(Object.entries(t).forEach(([n,{infoLabel:r}])=>{e.set(n,r)}),e),new Map),Hl=Ie(),wC={aiAgentMap:new Map,error:"",status:"initial"},OC=(e,t)=>({...wC,actions:{fetchAiAgents:async()=>{try{const{actions:n}=t(),{getAiAgents:r}=n;if(!r){Hl.error("getAiAgents is not defined");return}e({status:"loading"});const o=await r(),i=qA(o.data,"asc","display_name"),s=new Map(i.map(a=>[a.id,a]));e({aiAgentMap:s,error:"",status:"loaded"})}catch(n){let r="Unknown error";Hl.error("Error fetching aiAgents ",n),n instanceof Error&&(r=n.message),e({aiAgentMap:new Map,error:r,status:"error"})}},init:({getAiAgentsURL:n})=>{if(!n){Hl.error("getAiAgentsURL is not defined");return}const r=gp({getAiAgentsURL:n,headers:Gv()}),o=async()=>await r.getAiAgents();e(i=>({...i,actions:{...i.actions,getAiAgents:o}}))}}}),P0=(e,t)=>{if(e.find(r=>r.type==="aiAgent")){const{fetchAiAgents:r}=un.getState().actions;r().then(()=>{const{aiAgentMap:o,status:i}=un.getState();i==="loaded"&&e.forEach(s=>{if(s.data&&"agent"in s.data){const a=o.has(s.data.agent);a||t(s.id,{agent:a?s.data.agent:"",valid:a})}})}).catch(o=>Hl.error("Error rehydrating AiAgentStore",o))}},un=us()(OC),TC=()=>un.getState().actions;window.__useAiAgentStore=un;const AC=e=>!!(e&&e>=VA),IC=e=>(t,n,r)=>(r.setState=(o,i,...s)=>{const{edges:a,detachedMode:l,httpError:c,initializing:d,isCanvasInteractive:f,isInteractiveControlOn:p,nodes:h,rootAppWidth:E,viewportChanging:v}=n(),y=typeof o=="function"?o(n()):o,g=["detachedMode","httpError","initializing","isInteractiveControlOn","rootAppWidth","viewportChanging"],m="initializing"in y?y.initializing:d;if(g.some(_=>_ in y)){const _=AC("rootAppWidth"in y?y.rootAppWidth:E),S="isInteractiveControlOn"in y?y.isInteractiveControlOn:p,x="detachedMode"in y?y.detachedMode:l,R=("httpError"in y?y.httpError:c)===Wv,I="viewportChanging"in y?y.viewportChanging:v;if(y.isCanvasInteractive=!!(_&&S&&!x&&!m&&!R&&!I),y.showInteractiveControl=_&&!R&&!x,f&&!y.isCanvasInteractive){const L="nodes"in y?y.nodes:h;y.nodes=L.map(A=>({...A,selected:!1}));const U="edges"in y?y.edges:a;y.edges=U.map(A=>({...A,selected:!1})),y.selectedNode=void 0}}t(y,i,...s)},e(r.setState,n,r)),M0=1e3,Rs=Ie(),bC=e=>(t,n,r)=>{let o,i;const s=async()=>{const{httpService:a,nodes:l,edges:c,documentVersion:d}=n();t({dataHandlingStatus:"saving",saveFlowStatus:"saving"}),clearTimeout(i);try{if(!a)throw new Error("Missing httpService");const f=await a.putFlow({documentVersion:d,edges:c,flowDataVersion:ds,nodes:l}),p={documentLastUpdated:f.updated_at,documentVersion:f.document_version},h=n().dataHandlingStatus;switch(h){case"saving":t({...p,dataHandlingStatus:"queueing",deployFlowStatus:"deploy",saveFlowStatus:"saved"});break;case"holding":t({...p,saveFlowStatus:"awaiting-save"}),Rs.debug("Setting up a new save for held changes"),i=setTimeout(()=>{s().catch(E=>{Rs.error("Error Save Flow",E)})},M0);break;default:Rs.debug("Invalid dataHandlingStatus",h)}}catch(f){Rs.error("Put Flow",f),f instanceof Error&&f.message.includes($A)?t({dataHandlingStatus:"holding",httpError:"document-sync",saveFlowStatus:"error"}):t({dataHandlingStatus:"queueing",saveFlowStatus:"error"})}};return r.setState=(a,l,...c)=>{const{dataHandlingStatus:d,detachedMode:f,initializing:p,saveFlowStatus:h}=n(),E=typeof a=="function"?a(n()):a,v="initializing"in E?E.initializing:p,y="detachedMode"in E?E.detachedMode:f;!v&&!y&&(E.nodes||E.edges)?d==="queueing"?(E.saveFlowStatus="awaiting-save",t(E,l,...c),clearTimeout(o),o=setTimeout(()=>{s().catch(m=>{Rs.error("Error Save Flow",m)})},M0)):(E.dataHandlingStatus="holding",t(E,l,...c)):"initializing"in E&&!E.initializing?(E.dataHandlingStatus="queueing",h!=="error"&&(E.saveFlowStatus="saved"),t(E,l,...c)):t(E,l,...c)},e(r.setState,n,r)},j0=500,CC=100,Ne=Ie(),LC=k0("handleCall",{deletable:!1,position:{x:300,y:100}}),Pf={backButtonHref:void 0,colorMode:"light",dataHandlingStatus:"queueing",deployFlowStatus:"deploy",deployFlowURL:"",deployedVersionsList:[],detachedMode:!1,documentLastUpdated:void 0,documentVersion:0,dragNodeType:void 0,edges:[],flowId:"",flowTitle:"",flowWrapperElement:void 0,getFlowURL:"",httpError:void 0,httpService:void 0,initializing:!0,isCanvasInteractive:!1,isDraggingNode:!1,isEdgeConnecting:!1,isEdgeUpdateSuccessful:!1,isInteractiveControlOn:!0,nodes:[],reactFlowInstance:void 0,rootAppHeight:void 0,rootAppWidth:void 0,rootElement:void 0,rootElementId:"",saveFlowStatus:"initial",selectedNode:void 0,showDeployWarning:!1,showDeployedHistory:!1,showDeployedHistoryToast:!1,showInteractiveControl:!0,showValidationWarnings:!1,toastsMap:new Map,updateFlowURL:"",updatingSourceHandleId:void 0,validationWarnings:new Map,viewport:{x:0,y:0,zoom:1},viewportChanging:!1,workingFlowCopy:void 0},DC=(e,t)=>({...Pf,actions:{addNode:({nodeType:n,x:r=150,y:o=150})=>{Ne.debug("Add Node",n);const{nodes:i,reactFlowInstance:s}=t();if(!s)throw new Error("ReactFlowInstance not found");const a=k0(n,{position:s.project({x:r,y:o})}),l=i.map(c=>({...c,selected:!1}));l.push(a),e({nodes:l,selectedNode:a})},addToast:n=>{const{toastsMap:r}=t(),o=ie();r.set(o,{...n,id:o}),e({toastsMap:new Map(r)})},cancelDetachedMode:async()=>{const{actions:n,workingFlowCopy:r}=t(),{cleanUpDetachedMode:o}=n;if(r){const{edges:i,nodes:s,saveFlowStatus:a}=r;e({edges:[],initializing:!0,nodes:[]}),await qv(j0),e({edges:i,nodes:s,saveFlowStatus:a})}else Ne.error("There was no working flow to restore");o()},cleanUpDetachedMode:()=>{e({detachedMode:!1,showDeployedHistory:!1,showDeployedHistoryToast:!1,workingFlowCopy:void 0})},deleteToast:n=>{const{toastsMap:r}=t();r.delete(n)&&e({toastsMap:new Map(r)})},deleteValidationWarning:n=>{const{validationWarnings:r}=t();r.delete(n)&&e({validationWarnings:new Map(r)})},deployFlow:async()=>{Ne.info("Deploying..."),e({deployFlowStatus:"deploying"});try{const{httpService:n,documentVersion:r}=t();if(!n)throw new Error("Missing httpService");const o=await n.deployFlow({documentVersion:r});Ne.info("Deploy response",o),e({deployFlowStatus:"deployed"})}catch(n){throw Ne.info("Deploy error",n),e({deployFlowStatus:"error"}),n}},exportStoreData:()=>{const{nodes:n,edges:r}=t();QA(n,r)},getDeployedVersionsList:async n=>{try{const{httpService:r}=t();if(!r)throw new Error("Missing httpService");const o=await r.getFlowVersions(n),i=Xv(C0());return e({deployedVersionsList:o.map((s,a)=>({id:s.id,relativeTimeSince:i(s.created_at),version:(o.length-a).toFixed(1)}))}),o}catch(r){throw Ne.error("Could not get deployed versions",r),e({deployedVersionsList:[]}),r}},getNodeType:n=>{const r=t().nodes.find(o=>o.id===n);return r==null?void 0:r.type},getRootElement:()=>{const{rootElement:n,rootElementId:r}=t();if(!n)throw new Error(`Root element not found for ID ${r}`);return n.shadowRoot?n.shadowRoot.getRootNode():n},getTargetEdges:n=>t().edges.filter(r=>{const o=r.target===n,i=r.source!==r.target;return o&&i}),getValidationWarnings:()=>t().validationWarnings,migrateAndLoadDeployedFlow:async n=>{const{actions:r,workingFlowCopy:o}=t(),{partialUpdateNodeData:i,saveWorkingFlowCopy:s}=r,l=new mp({dbRecord:n}).migrateTo(ds),{flow_data:c}=l;if(!c)Ne.error("Cannot load flow: missing flowData",c);else{o||s();const d=c.nodes.map(Kv),f=c.edges.map(Yv);e({detachedMode:!0,edges:[],initializing:!0,nodes:[]}),await qv(j0),e({edges:f,nodes:d,showDeployedHistoryToast:!0}),L0(d),P0(d,i)}},onConnect:n=>{Ne.debug("onConnect"),e({edges:BE(n,t().edges)})},onConnectEnd:()=>{Ne.debug("onConnectEnd"),e({isEdgeConnecting:!1})},onConnectStart:()=>{Ne.debug("onConnectStart"),e({isEdgeConnecting:!0})},onEdgeUpdate:(n,r)=>{Ne.debug("onEdgeUpdate"),e({edges:zO(n,r,t().edges),isEdgeUpdateSuccessful:!0})},onEdgeUpdateEnd:(n,r)=>{var o;Ne.debug("onEdgeUpdateEnd"),t().isEdgeUpdateSuccessful?e({isEdgeUpdateSuccessful:!0}):(o=t().reactFlowInstance)==null||o.deleteElements({edges:[{id:r.id}]}),e({updatingSourceHandleId:void 0})},onEdgeUpdateStart:(n,r)=>{Ne.debug("onEdgeUpdateStart"),e({isEdgeUpdateSuccessful:!1,updatingSourceHandleId:r.sourceHandle??void 0})},onEdgesChange:n=>{e({edges:xT(n,t().edges)})},onEdgesDelete:n=>{Ne.debug("onEdgesDelete [noop]",n)},onInit:async n=>{const{actions:r,deployFlowURL:o,getFlowURL:i,updateFlowURL:s}=t(),{partialUpdateNodeData:a}=r;Ne.log("onInit",{getFlowURL:i,updateFlowURL:s});try{const l=gp({deployFlowURL:o,getFlowURL:i,headers:Gv(),updateFlowURL:s}),[c,d]=await Promise.all([l.getFlow(),l.getFlowVersions({pageSize:1})]),p=new mp({dbRecord:c}).migrateTo(ds),{document_version:h,flow_data:E,id:v,title:y,updated_at:g}=p;if(d.length&&d[0]){const{document_version:_}=d[0];_===h&&e({deployFlowStatus:"deployed"})}let m=E;m||(m={edges:Pf.edges,flowDataVersion:ds,nodes:Pf.nodes.concat([LC])}),e({documentLastUpdated:g,documentVersion:h,edges:m.edges.map(Yv),flowId:v,flowTitle:y,httpService:l,nodes:m.nodes.map(Kv),reactFlowInstance:n}),L0(m.nodes),P0(m.nodes,a)}catch(l){Ne.error("Could not load flow. URL:",i);let c="unknown";l instanceof Error&&l.message.includes(BA)&&(c="not-found"),e({httpError:c})}},onNodeDragStart:()=>{e({isDraggingNode:!0})},onNodeDragStop:()=>{e({isDraggingNode:!1})},onNodesChange:n=>{const r=n.filter(o=>o.type!=="dimensions");r.length>0&&e({nodes:Ev(r,t().nodes)})},onNodesDelete:n=>{Ne.debug("onNodesDelete");const{actions:r}=t(),{partialUpdateNodeData:o}=r;_C(t().nodes,n).forEach(s=>{o(s.id,s.data)})},onSelectionChange:({nodes:n})=>{e({selectedNode:n.find(r=>r.selected)})},onViewportChange:(()=>{let n;function r(o){n&&clearTimeout(n),n=setTimeout(()=>{e({viewportChanging:!1})},CC),e({viewport:{...o},viewportChanging:!0})}return r})(),onViewportChangeEnd:()=>{},onViewportChangeStart:()=>{},partialUpdateNodeData:(n,r)=>{var s;Ne.debug("partialUpdateNodeData",n,r);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(d=>d.id),c=r.options.map(d=>d.id);o.push(...l.filter(d=>!c.includes(d)))}return{...a,data:{...a.data,...r}}}return a});if(o.length){const a=t().edges.filter(l=>l.sourceHandle&&o.includes(l.sourceHandle));Ne.debug("Remove orphaned edges",{edgesToDelete:a,sourceHandleDeleted:o}),(s=t().reactFlowInstance)==null||s.deleteElements({edges:a})}e({nodes:i})},partialUpdateValidationWarning:(n,r)=>{const{validationWarnings:o}=t(),i=a=>a.connected===!1||a.valid===!1,s=o.get(n);if(r.nodeType!=="handleCall"&&!s&&i(r)){const a=RC.get(r.nodeType),l={connected:r.connected,id:ie(),nodeId:r.nodeId,nodeTitle:a,nodeType:r.nodeType,valid:r.valid};o.set(n,l)}else if(s){const a={...s,...r};i(a)?o.set(n,a):o.delete(n)}e({validationWarnings:new Map(o)})},removeEdge:n=>{Ne.debug("removeEdge",n);const r=t().reactFlowInstance;r&&r.deleteElements({edges:[{id:n}]})},removeNode:n=>{Ne.debug("removeNode",n);const r=t().reactFlowInstance;r&&r.deleteElements({nodes:[{id:n}]})},restoreDeployedFlow:()=>{const{actions:n,edges:r,nodes:o}=t(),{cleanUpDetachedMode:i}=n;e({detachedMode:!1,edges:r,nodes:o}),i()},saveWorkingFlowCopy:()=>{const{edges:n,nodes:r,saveFlowStatus:o}=t();e({workingFlowCopy:{edges:n,nodes:r,saveFlowStatus:o}})},setColorMode:n=>{e({colorMode:n})},setDragNodeType:n=>{e({dragNodeType:n})},setFlowWrapperElement:n=>{e({flowWrapperElement:n||void 0})},setInitializing:n=>{e({initializing:n})},setSelectedNodes:n=>{const{nodes:r}=t(),o=r.map(i=>({...i,selected:n.includes(i.id)}));e({nodes:o})},setShowDeployWarning:n=>{e({showDeployWarning:n})},setShowDeployedHistory:n=>{e({showDeployedHistory:n})},setShowValidationWarnings:n=>{e({showValidationWarnings:n})},setViewportChanging:n=>{e({viewportChanging:n})}}}),Y=us()(IC(bC(DC))),xe=()=>Y.getState().actions;window.__useRFStore=Y;const kC={"not-found":{message:"Please ensure that the Call Flow exists and the URL is correct.",status:"404",title:"Call Flow not found"},unknown:{message:"An unknown error occurred. Please try again or go back.",status:"",title:"Unknown error"}},PC=({errorType:e})=>{const t=Y(i=>i.backButtonHref),{title:n,message:r,status:o}=kC[e];return u.jsx("section",{className:"flex min-h-full w-full items-center justify-center bg-background px-6",children:u.jsxs("div",{className:"text-center",children:[o&&u.jsx("p",{className:"text-2xl font-semibold text-foreground/50",children:o}),u.jsx("h1",{className:"mt-4 text-3xl font-bold tracking-tight text-foreground",children:n}),u.jsx("p",{className:"mt-6 leading-7 text-foreground",children:r}),t&&u.jsx("div",{className:"mt-8 flex items-center justify-center gap-x-6",children:u.jsx("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:T(N.GO_BACK)})})]})})},e4="",U0=({height:e,strokeWidth:t,toX:n,toY:r,width:o})=>u.jsx("svg",{x:n-o*t/2,y:r-e*t/2,height:e*t,width:o*t,viewBox:`-${o/2} -${e/2} ${o} ${e}`,children:u.jsx("g",{children:u.jsx("polyline",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:t,points:"-5,-4 0,0 -5,4 -5,-4"})})}),MC=({fromHandle:e,fromNode:t,fromPosition:n,fromX:r,fromY:o,toPosition:i,toX:s,toY:a})=>{if(!t)return null;const[l]=ss({borderRadius:zv,sourcePosition:n,sourceX:r,sourceY:o,targetPosition:i,targetX:s,targetY:a}),{height:c,strokeWidth:d,width:f}={...Fo.markerEnd,...Fo.style},p=(e==null?void 0:e.position)===K.Left,h=p?r:s,E=p?o:a;return u.jsxs("g",{className:"cfb-connection-line",children:[u.jsx("path",{fill:"none",strokeWidth:d,className:"animated",d:l}),u.jsx(U0,{height:c,strokeWidth:d,toX:h,toY:E,width:f}),p&&u.jsx("circle",{cx:s-2,cy:a,fill:"none",r:4,strokeWidth:d})]})};function jC({isCircular:e=!1,targetNode:t,targetX:n,targetY:r}){const{width:o,height:i,position:s}=t,a=o??0,l=i??0,c=a/2;return e?{tx:s.x+c,ty:s.y+l}:{tx:n,ty:r}}const UC=e=>{const t={...e,interactionWidth:40},{id:n,source:r,target:o,sourcePosition:i,sourceX:s,sourceY:a,targetX:l,targetY:c}=t,{removeEdge:d}=xe(),f=w.useRef(null),p=ae(w.useCallback(A=>A.nodeInternals.get(r),[r])),h=ae(w.useCallback(A=>A.nodeInternals.get(o),[o]));if(!p||!h)return null;const E=r===o,{tx:v,ty:y}=jC({isCircular:E,targetNode:h,targetX:l,targetY:c}),[g,m,_]=ss({borderRadius:zv,sourcePosition:i,sourceX:s,sourceY:a,targetPosition:E?K.Bottom:K.Left,targetX:v,targetY:y}),S=(A,b)=>{A.stopPropagation(),d(b)},x=A=>{var b,V,M;(b=A.currentTarget)==null||b.classList.add("highlight"),(V=f.current)==null||V.classList.add("animate-delay-opacity","flex"),(M=f.current)==null||M.classList.remove("hidden")},R=A=>{var b,V,M;(b=A.currentTarget)==null||b.classList.remove("highlight"),(V=f.current)==null||V.classList.remove("animate-delay-opacity","flex"),(M=f.current)==null||M.classList.add("hidden")},{height:I,strokeWidth:L,width:U}={...Fo.markerEnd,...Fo.style};return u.jsxs("g",{onMouseEnter:x,onMouseLeave:R,children:[u.jsx(Io,{path:g,...t}),u.jsx(U0,{height:I,strokeWidth:L,toX:v,toY:y,width:U}),u.jsx(gA,{children:u.jsxs("button",{className:"nodrag nopan pointer-events-auto absolute hidden h-[18px] w-[26px] cursor-pointer items-center justify-center rounded-full bg-foreground/90 opacity-0 hover:h-[22px] hover:w-[30px] hover:border-2 hover:border-focus",onClick:A=>S(A,n),ref:f,style:{transform:`translate(-50%, -50%) translate(${m}px,${_}px)`},children:[u.jsx(te,{tag:"trash-can",className:"py-0.5 px-1.5 text-background"}),u.jsx("span",{className:"sr-only",children:T(N.REMOVE_EDGE)})]})})]})},FC=/^[\w\d -']+$/,VC=/^\d+$/,$C=/^\d|\*|#$/,BC=/^[\d*#$]{0,12}$/,HC=/^.{1,20}$/,Yo={MAX:3600,MIN:0},zC=/^[a-z0-9_]{1,20}$/,ge={MAX:99,MIN:1},Ko=e=>t=>!!e.exec(t),vt=e=>It(e)?Ko(VC)(e):!0,WC=e=>It(e)?Ko($C)(e):!0,GC=e=>It(e)?Ko(FC)(e):!0,YC=e=>It(e)?Ko(zC)(e):!0,F0=e=>It(e)?Ko(BC)(e):!0,KC=e=>It(e)?Ko(HC)(e):!0,zl=e=>{if(!It(e))return!0;try{return JSON.parse(e),!0}catch{return!1}},fe=e=>!!It(e),Ns=(e,t)=>{if(typeof e=="string"&&!It(e))return!0;const n=typeof e!="number"?parseInt(e,10):e;return!Number.isNaN(n)&&n>=t},ws=(e,t)=>{if(typeof e=="string"&&!It(e))return!0;const n=typeof e!="number"?parseInt(e,10):e;return!Number.isNaN(n)&&n<=t},ar=(e,t)=>{const n=new Set,r=e.reduce((o,i)=>{const s=i[t];if(typeof s=="string"){const a=s.trim();a&&(n.has(a)&&o.add(a),n.add(a))}return o},new Set);return o=>r.has(o.trim())},Qo={aiAgent:{fieldValidators:{agent:[fe]},validate:e=>Xo({nodeData:e,nodeType:"aiAgent"}),validateField:(e,t)=>oe({name:e,nodeType:"aiAgent",value:t})},cond:{fieldValidators:{value:[fe]},validate:e=>Mf("cond",e),validateField:(e,t)=>oe({name:e,nodeType:"cond",value:t})},condRequest:{fieldValidators:{body:[],headers:[zl],method:[fe],saveVariables:[],url:[fe],value:[fe]},validate:e=>{const t=e,n=[];return["body","headers","method","saveVariables","url"].forEach(o=>{oe({name:o,nodeType:"condRequest",value:t[o]})||n.push(o)}),[...n,...Mf("condRequest",e)]},validateField:(e,t)=>oe({name:e,nodeType:"condRequest",value:t})},executeSWML:{fieldValidators:{dest:[fe],meta:[zl],params:[zl]},validate:e=>{const t=e,n=[];return["dest","params","meta"].forEach(o=>{oe({name:o,nodeType:"executeSWML",value:t[o]})||n.push(o)}),[...n,...Mf("executeSWML",e)]},validateField:(e,t)=>oe({name:e,nodeType:"executeSWML",value:t})},forwardAddress:{fieldValidators:{callOrder:[],callStateEvents:[],callStateUrl:[],connectFrom:[],connectTimeout:[vt],connectTo:[fe],defaultFrom:[],defaultTimeout:[vt],sessionTimeout:[vt]},validate:e=>jf("forwardAddress",e),validateField:(e,t)=>oe({name:e,nodeType:"forwardAddress",value:t})},forwardPhone:{fieldValidators:{callOrder:[],callStateEvents:[],callStateUrl:[],connectFrom:[],connectTimeout:[vt],connectTo:[fe],defaultFrom:[],defaultTimeout:[vt]},validate:e=>jf("forwardPhone",e),validateField:(e,t)=>oe({name:e,nodeType:"forwardPhone",value:t})},forwardResource:{fieldValidators:{callOrder:[],callStateEvents:[],callStateUrl:[],connectFrom:[],connectTimeout:[vt],connectTo:[fe],defaultFrom:[],defaultTimeout:[vt],sessionTimeout:[vt]},validate:e=>jf("forwardResource",e),validateField:(e,t)=>oe({name:e,nodeType:"forwardResource",value:t})},hangup:{fieldValidators:{reason:[]},validate:e=>Uf("hangup",e),validateField:(e,t)=>oe({name:e,nodeType:"hangup",value:t})},play:{fieldValidators:{selected:[fe],text:[fe],url:[fe]},validate:e=>Uf("play",e),validateField:(e,t)=>oe({name:e,nodeType:"play",value:t})},promptPlay:{fieldValidators:{command:[GC],digit:[WC],digitTimeout:[vt,{test:Ns,testValue:ge.MIN},{test:ws,testValue:ge.MAX}],initialTimeout:[vt,{test:Ns,testValue:ge.MIN},{test:ws,testValue:ge.MAX}],selected:[fe],text:[fe],url:[fe]},validate:e=>{const t="promptPlay",n=e,r=ar(n.options,"command"),o=ar(n.options,"digit"),i=Uf("promptPlay",n),s=nc(n.initialTimeout);s!=null&&s.trim()&&!oe({name:"initialTimeout",nodeType:t,value:s})&&i.push("initialTimeout");const a=nc(n.digitTimeout);return a!=null&&a.trim()&&!oe({name:"digitTimeout",nodeType:t,value:a})&&i.push("digitTimeout"),n.options.forEach(l=>{const c=oe({name:"command",nodeType:t,value:l.command})&&!r(l.command),d=oe({name:"digit",nodeType:t,value:l.digit})&&!o(l.digit);c&&d&&(l.command||l.digit)||i.push(`option_${l.id}`)}),i},validateField:(e,t)=>oe({name:e,nodeType:"promptPlay",value:t})},record:{fieldValidators:{beep:[],endSilenceTimeout:[vt,{test:Ns,testValue:ge.MIN},{test:ws,testValue:ge.MAX}],format:[fe],initialTimeout:[vt,{test:Ns,testValue:ge.MIN},{test:ws,testValue:ge.MAX}],maxLength:[vt,{test:Ns,testValue:Yo.MIN},{test:ws,testValue:Yo.MAX}],stereo:[],terminators:[F0]},validate:e=>Xo({nodeData:e,nodeType:"record"}),validateField:(e,t)=>oe({name:e,nodeType:"record",value:t})},recordCallStart:{fieldValidators:{beep:[],controlId:[],format:[fe],label:[fe,KC],stereo:[],terminators:[F0]},validate:e=>Xo({nodeData:e,nodeType:"recordCallStart"}),validateField:(e,t)=>oe({name:e,nodeType:"recordCallStart",value:t})},recordCallStop:{fieldValidators:{controlId:[fe]},validate:e=>Xo({nodeData:e,nodeType:"recordCallStop"}),validateField:(e,t)=>oe({name:e,nodeType:"recordCallStop",value:t})},request:{fieldValidators:{body:[],headers:[zl],method:[fe],saveVariables:[],url:[fe]},validate:e=>Xo({nodeData:e,nodeType:"request"}),validateField:(e,t)=>oe({name:e,nodeType:"request",value:t})},sendSms:{fieldValidators:{body:[fe],fromNumber:[fe],toNumber:[fe]},validate:e=>Xo({nodeData:e,nodeType:"sendSms"}),validateField:(e,t)=>oe({name:e,nodeType:"sendSms",value:t})},set:{fieldValidators:{key:[fe,YC],value:[]},validate:e=>{const t=e,n="set",r=[],o=ar(t.variables,"key");return t.variables.forEach(i=>{const s=oe({name:"key",nodeType:n,value:i.key})&&!o(i.key),a=oe({name:"value",nodeType:n,value:i.value});s&&a||r.push(`variable_${i.id}`)}),r},validateField:(e,t)=>oe({name:e,nodeType:"set",value:t})},unset:{fieldValidators:{},validate:e=>e.variables.length>0?[]:["variables"],validateField:(e,t)=>oe({name:e,nodeType:"unset",value:t})}},lt=e=>{const t=Qo==null?void 0:Qo[e];return{validate:t==null?void 0:t.validate,validateField:t==null?void 0:t.validateField}},V0=(e,t)=>{var r;const n=(r=Qo[e])==null?void 0:r.validate;return n===void 0?[]:n(t)},$0=(e,t)=>{var n;return!e||!t?!1:((n=V0(e,t))==null?void 0:n.length)===0},oe=({name:e,nodeType:t,value:n})=>{var i,s;let r=!0;const o=(s=(i=Qo[t])==null?void 0:i.fieldValidators)==null?void 0:s[e];return o==null||o.forEach(a=>{typeof a=="function"?r=r&&a(n):r=r&&a.test(n,a.testValue)}),r},Xo=({nodeData:e,nodeType:t})=>{var o;const n=((o=Qo[t])==null?void 0:o.fieldValidators)??{},r=[];return Object.keys(n).forEach(i=>{const s=i;oe({name:i,nodeType:t,value:(e==null?void 0:e[s])??""})||r.push(i)}),r},Mf=(e,t)=>{const n=t,r=[];return n.options.forEach(o=>{oe({name:"value",nodeType:e,value:o.value})||r.push(`condition_${o.id}`)}),r},jf=(e,t)=>{var i;const n=[];["callOrder","callStateEvents","callStateUrl","defaultFrom","defaultTimeout"].forEach(s=>{oe({name:s,nodeType:e,value:t[s]})||n.push(s)});const o=["connectFrom","connectTo","connectTimeout"];return(i=t.connections)==null||i.forEach(s=>{o.forEach(a=>{oe({name:a,nodeType:e,value:s[a]})||n.push(`${a}_${s.id}`)})}),n},Uf=(e,t)=>{const n=[];return oe({name:"selected",nodeType:e,value:t==null?void 0:t.selected})||n.push("selected"),t.selected==="url"?oe({name:"url",nodeType:e,value:t.url})||n.push("url"):t.selected==="text"&&(oe({name:"text",nodeType:e,value:t.text})||n.push("text")),n},ct=({data:e,id:t})=>{const n=Y(a=>a.isCanvasInteractive),{getNodeType:r,partialUpdateNodeData:o}=xe(),{isValueDuplicate:i}=kf(),s=r(t);return w.useEffect(()=>{if(s&&n){let a=$0(s,e);s==="recordCallStart"&&"label"in e&&(a=a&&!i(e.label,e.controlId)),a!==e.valid&&o(t,{valid:a})}},[e,t,n,i,o,s]),w.useEffect(()=>{if(s==="aiAgent"&&n){const a=un.subscribe(l=>{if(l.status==="loaded"&&"agent"in e){const c=l.aiAgentMap.has(e.agent),d=c&&$0(s,e);d!==e.valid&&o(t,{agent:c?e.agent:"",valid:d})}});return()=>{a()}}},[e,t,n,o,s]),{getInvalidFields:()=>!s||e.valid?[]:V0(s,e),valid:()=>e.valid}},QC=({data:e,id:t,isConnectable:n,selected:r})=>{ct({data:e,id:t});const o=un(s=>s.aiAgentMap.get(e.agent)),i=o==null?void 0:o.display_name;return u.jsxs(Fe,{id:t,isConnectable:n,nodeTitle:T(N.AI_AGENT),selected:r,valid:e.valid,children:[i&&u.jsx(Lt,{children:u.jsx("p",{className:"truncate text-xs",children:i})}),u.jsx(Wt,{id:t,color:"positive",isConnectable:n})]})},XC=({data:e,id:t,isConnectable:n,selected:r})=>u.jsx(Fe,{id:t,isConnectable:n,nodeTitle:T(N.ANSWER_CALL),selected:r,valid:e.valid,children:u.jsx(Wt,{id:t,isConnectable:n,color:"positive"})}),qC=({id:e,data:t,isConnectable:n,selected:r})=>(ct({data:t,id:e}),u.jsx(Fe,{id:e,isConnectable:n,nodeTitle:T(N.CONDITIONS),selected:r,valid:t.valid,children:u.jsxs(Ho,{children:[t.options.map((o,i)=>{const s=o.value.trim();return u.jsx(Gt,{color:"positive",enabled:!!s,id:o.id,isConnectable:n,optionTitle:s?u.jsx("div",{className:"truncate",children:s}):T(N.CONDITION_NUMBER,{index:i+1})},o.id)}),u.jsx(Gt,{color:"negative",id:t.fallback,isConnectable:n,optionTitle:T(N.ELSE)})]})})),JC=({data:e,id:t,isConnectable:n,selected:r})=>{var i;ct({data:e,id:t});const o=e.url.trim();return u.jsxs(Fe,{id:t,isConnectable:n,nodeTitle:T(N.REQUEST),selected:r,valid:e.valid,children:[o&&u.jsx(Lt,{children:u.jsx("div",{className:"break-all line-clamp-3",children:o})}),u.jsxs(Ho,{children:[(i=e==null?void 0:e.options)==null?void 0:i.map((s,a)=>{const l=s.value.trim();return u.jsx(Gt,{color:"positive",enabled:!!l,id:s.id,isConnectable:n,optionTitle:l?u.jsx("div",{className:"truncate",children:l}):T(N.CONDITION_NUMBER,{index:a+1})},s.id)}),u.jsx(Gt,{color:"negative",id:e.fallback,isConnectable:n,optionTitle:T(N.ELSE)}),u.jsx(Gt,{color:"negative",id:e.error,isConnectable:n,optionTitle:T(N.FAILURE)})]})]})},ZC=({data:e,id:t,isConnectable:n,selected:r})=>{var i;ct({data:e,id:t});const o=e.dest.trim();return u.jsxs(Fe,{id:t,isConnectable:n,nodeTitle:T(N.EXECUTE_SWML),selected:r,valid:e.valid,children:[o&&u.jsx(Lt,{children:u.jsx("div",{className:"break-all line-clamp-3",children:o})}),u.jsxs(Ho,{children:[(i=e==null?void 0:e.options)==null?void 0:i.map((s,a)=>{const l=s.value.trim();return u.jsx(Gt,{color:"positive",enabled:!!l,id:s.id,isConnectable:n,optionTitle:l?u.jsx("div",{className:"truncate",children:l}):T(N.CONDITION_NUMBER,{index:a+1})},s.id)}),u.jsx(Gt,{color:"negative",id:e.fallback,isConnectable:n,optionTitle:T(N.ELSE)})]})]})},Ff=3,eL={busy:N.BUSY,decline:N.DECLINE,error:N.ERROR,noAnswer:N.NO_ANSWER,success:N.SUCCESS},tL={address:N.FORWARD_TO_ADDRESS,phone:N.FORWARD_TO_PHONE,resource:N.FORWARD_TO_RESOURCE},Vf=({id:e,data:t,isConnectable:n,selected:r})=>{ct({data:t,id:e});const o=t.connections.filter(s=>s.connectTo),i=o.slice(0,Ff);return u.jsxs(Fe,{id:e,isConnectable:n,nodeTitle:T(tL[t.destinationType]),selected:r,valid:t.valid,children:[o.length?u.jsxs(Lt,{children:[u.jsx("ul",{children:i.map(s=>u.jsx("li",{className:"pb-2",children:u.jsx("div",{className:"max-w-max truncate rounded bg-secondary/20 px-1 ",children:s.connectTo})},`node-${s.id}`))}),o.length>Ff&&u.jsx("div",{children:`+ ${T(N.MORE_WITH_COUNT,{count:o.length-Ff})}`})]}):null,u.jsx(Ho,{children:t.options.map(s=>u.jsx(Gt,{color:Qv(s.result),id:s.id,isConnectable:n,optionTitle:T(eL[s.result])},s.id))})]})},nL=({id:e,data:t,isConnectable:n,selected:r})=>{ct({data:t,id:e});const o=ar(t.options,"command"),i=ar(t.options,"digit");return u.jsxs(Fe,{id:e,isConnectable:n,nodeTitle:T(N.GATHER_INPUT),selected:r,valid:t.valid,children:[u.jsx(Vy,{data:t}),u.jsxs(Ho,{children:[t.options.map((s,a)=>{const l=s.command.trim(),c=s.digit.trim(),d=!!(l||c)&&!o(s.command)&&!i(s.digit),f=u.jsxs("div",{className:"flex gap-1",children:[T(N.CALLER_PRESSES)," ",u.jsx("span",{className:"truncate rounded bg-secondary/20 px-1",children:c})]}),p=v=>u.jsxs("div",{className:"flex",children:[T(v?N.CALLER_SAYS:N.OR_CALLER_SAYS)," '",u.jsx("span",{className:"truncate",children:l}),"'"]});let h=T(N.OPTION_NUMBER,{index:a+1}),E="";switch(!0){case!!(l&&!c):h=p(!0);break;case!!(!l&&c):h=f;break;case!!(l&&c):h=f,E=p(!1);break}return u.jsx(Gt,{color:"positive",enabled:d,id:s.id,isConnectable:n,optionTitle:h,optionSubtitle:E},s.id)}),t.results.map(s=>u.jsx(Gt,{color:"negative",id:s.id,isConnectable:n,optionTitle:s.result==="no_input"?T(N.NO_INPUT):T(N.UNKNOWN)},s.id))]})]})},rL=({id:e,isConnectable:t,selected:n})=>u.jsx(Fe,{id:e,isConnectable:t,isRoot:!0,nodeTitle:T(N.HANDLE_CALL),selected:n,deletable:!1,showValidation:!1,target:!1,children:u.jsx(Wt,{id:e,color:"positive",isConnectable:t})}),$f={busy:N.BUSY,decline:N.DECLINE,hangup:N.HANG_UP},oL=({data:e,id:t,isConnectable:n,selected:r})=>u.jsx(Fe,{id:t,isConnectable:n,nodeTitle:T(N.HANG_UP_CALL),selected:r,valid:e.valid,children:e.reason&&u.jsx(Lt,{children:u.jsx("section",{className:"text-xs",children:u.jsx("p",{children:T($f[e.reason])})})})}),iL=({data:e,id:t,isConnectable:n,selected:r})=>(ct({data:e,id:t}),u.jsxs(Fe,{id:t,isConnectable:n,nodeTitle:T(N.PLAY_AUDIO_TTS),selected:r,valid:e.valid,children:[u.jsx(Vy,{data:e}),u.jsx(Wt,{id:t,isConnectable:n})]})),sL=({data:e,id:t,isConnectable:n,selected:r})=>{const{label:o,valid:i}=e;return ct({data:e,id:t}),u.jsxs(Fe,{id:t,isConnectable:n,nodeTitle:T(N.RECORD_CALL_START),selected:r,valid:i,children:[o&&i&&u.jsx(Lt,{children:u.jsx("p",{className:"truncate text-xs leading-5",children:o})}),u.jsx(Wt,{id:t,isConnectable:n,color:"positive"})]})},aL=({data:e,id:t,isConnectable:n,selected:r})=>{var s;ct({data:e,id:t});const o=(s=Go(a=>a.entries))==null?void 0:s.find(a=>a.controlId===e.controlId),i=o==null?void 0:o.label;return u.jsxs(Fe,{id:t,isConnectable:n,nodeTitle:T(N.RECORD_CALL_STOP),selected:r,valid:e.valid,children:[i&&u.jsx(Lt,{children:u.jsx("p",{className:"truncate text-xs leading-5",children:i})}),u.jsx(Wt,{id:t,color:"positive",isConnectable:n})]})},lL=({data:e,id:t,isConnectable:n,selected:r})=>{ct({data:e,id:t});const o=new Set(e.terminators);return u.jsxs(Fe,{id:t,isConnectable:n,nodeTitle:T(N.VOICEMAIL_RECORDING),selected:r,valid:e.valid,children:[e.terminators?u.jsxs(Lt,{children:[T(N.TERMINATORS),":"," ",u.jsx("ul",{className:"inline-flex flex-wrap justify-start gap-1",children:[...o].sort().map((i,s)=>u.jsx("li",{className:"rounded bg-secondary/20 px-1",children:i},`${s}-${i}`))})]}):null,u.jsx(Wt,{id:t,isConnectable:n,color:"positive"})]})},cL={failed:N.FAILED,success:N.SUCCESS},B0={aiAgent:QC,answer:XC,cond:qC,condRequest:JC,executeSWML:ZC,forwardAddress:Vf,forwardPhone:Vf,forwardResource:Vf,handleCall:rL,hangup:oL,play:iL,promptPlay:nL,record:lL,recordCallStart:sL,recordCallStop:aL,request:({data:e,id:t,isConnectable:n,selected:r})=>{var o;return ct({data:e,id:t}),u.jsxs(Fe,{id:t,isConnectable:n,nodeTitle:T(N.REQUEST),selected:r,valid:e.valid,children:[u.jsx("p",{className:"p-4 pt-0 text-xs text-negative",children:T(N.DEPRECATED)}),u.jsx(Ho,{children:(o=e==null?void 0:e.options)==null?void 0:o.map(i=>u.jsx(Gt,{color:Qv(i.result),id:i.id,isConnectable:n,optionTitle:T(cL[i.result])},i.id))})]})},sendSms:({data:e,id:t,isConnectable:n,selected:r})=>(ct({data:e,id:t}),u.jsxs(Fe,{id:t,isConnectable:n,nodeTitle:T(N.SEND_SMS),selected:r,valid:e.valid,children:[e.body&&u.jsx(Lt,{children:u.jsx("p",{className:"break-words line-clamp-3",children:e.body})}),u.jsx(Wt,{id:t,isConnectable:n})]})),set:({id:e,data:t,isConnectable:n,selected:r})=>{const{getInvalidFields:o}=ct({data:t,id:e}),i=o().reduce((a,l)=>(l.startsWith("variable_")&&a.push(l.replace("variable_","")),a),[]),s=t.variables.filter(a=>!!a.key);return u.jsxs(Fe,{id:e,isConnectable:n,nodeTitle:T(N.SET_VARIABLES),selected:r,valid:t.valid,children:[s.length>0&&u.jsx(Lt,{children:u.jsx("ul",{className:"flex flex-col",children:s.map(a=>u.jsxs("li",{className:"flex w-full gap-1 pb-2",children:[u.jsx("div",{className:`max-w-[50%] shrink-0 truncate rounded px-1 ${i.includes(a.id)?"bg-negative/10 text-negative":"bg-secondary/20"}`,children:a.key}),"=",a.value&&u.jsx("div",{className:"truncate",children:a.value})]},a.id))})}),u.jsx(Wt,{id:e,isConnectable:n,color:"positive"})]})},unset:({id:e,data:t,isConnectable:n,selected:r})=>{ct({data:t,id:e});const o=t.variables.filter(i=>!!i.key);return u.jsxs(Fe,{id:e,isConnectable:n,nodeTitle:T(N.UNSET_VARIABLES),selected:r,valid:t.valid,children:[o.length>0&&u.jsx(Lt,{children:u.jsx("ul",{children:o.map(i=>u.jsx("li",{className:"pb-2",children:u.jsx("div",{className:"max-w-max truncate rounded bg-secondary/20 px-1",children:i.key})},i.id))})}),u.jsx(Wt,{id:e,isConnectable:n,color:"positive"})]})}},uL={floating:UC},dL=({children:e})=>{const t=Y(_=>_.nodes),n=Y(_=>_.edges),r=Y(_=>_.isCanvasInteractive),{onConnect:o,onConnectEnd:i,onConnectStart:s,onEdgesChange:a,onEdgesDelete:l,onEdgeUpdate:c,onEdgeUpdateEnd:d,onEdgeUpdateStart:f,onInit:p,onNodeDragStart:h,onNodeDragStop:E,onNodesChange:v,onNodesDelete:y,onSelectionChange:g,setFlowWrapperElement:m}=xe();return u.jsx("div",{className:"bg-sw-white !h-auto w-full",ref:_=>m(_),children:u.jsxs(Fv,{attributionPosition:"bottom-left",connectionLineComponent:MC,connectionMode:qn.Strict,deleteKeyCode:r?GA:null,defaultEdgeOptions:Fo,edges:n,edgeTypes:uL,elementsSelectable:r,fitViewOptions:rf,multiSelectionKeyCode:r?YA:null,nodes:t,nodesConnectable:r,nodesDraggable:r,nodeTypes:B0,onConnect:o,onConnectEnd:i,onConnectStart:s,onEdgesChange:a,onEdgesDelete:l,onEdgeUpdate:r?c:void 0,onEdgeUpdateEnd:d,onEdgeUpdateStart:f,onInit:p,onNodeDragStart:h,onNodeDragStop:E,onNodesChange:v,onNodesDelete:y,onSelectionChange:g,selectionKeyCode:r?KA:null,snapGrid:[xl,xl],snapToGrid:!0,children:[u.jsx(DA,{className:"bg-background-alt text-grid",color:"currentColor",gap:[xl,xl],variant:At.Dots}),e]})})},fL=()=>{const e=Y(a=>a.initializing),t=Y(a=>a.reactFlowInstance),{setInitializing:n,setViewportChanging:r}=xe(),o=w.useRef(!1),i=_A({includeHiddenNodes:!0}),s=w.useMemo(()=>()=>{t==null||t.fitView(rf)},[t]);w.useEffect(()=>{let a;e?!o.current&&!i?o.current=!0:o.current&&i&&(clearTimeout(a),r(!0),s(),a=setTimeout(()=>{r(!1)},rf.duration),n(!1),o.current=!1):o.current=!1},[e,s,i,n,r])},pL=()=>{const{onViewportChange:e,onViewportChangeEnd:t,onViewportChangeStart:n}=xe();return fL(),EA({onChange:e,onEnd:t,onStart:n}),null},hL=()=>{const e=Y(n=>n.selectedNode),t=e?NC.get(e.type):void 0;return t?u.jsx(ns,{className:"z-40 max-w-[40%] rounded-md bg-background",position:"bottom-center",children:u.jsxs("div",{className:"justify-left flex items-center gap-2 rounded-md bg-primary/10 p-3 py-4","data-testid":"cfb__info",children:[u.jsx(te,{className:"shrink-0 text-primary",tag:"circle-info",size:"xl"}),u.jsx("div",{className:"text-xs font-medium",children:$l(t)})]})}):null},gL=e=>{var i;const t=w.useRef(),n=mA(),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)}}},mL="/hello/.test('%{foo}')",EL=()=>({id:ie(),value:""}),Bf=({nodeData:e,handleOnUpdate:t,placeholder:n=mL})=>{const{validateField:r}=lt("cond"),[o,i]=w.useState({options:e.options.map(f=>({id:!0,initial:e.initial,value:r("value",f.value)}))}),s=f=>{f.preventDefault(),i({...o,options:[...o.options,{initial:!0,value:!0}]}),t({options:[...e.options,EL()]})},a=f=>p=>{p.preventDefault();const h=[...o.options];h.splice(f,1),i({...o,options:h});const E=[...e.options];E.splice(f,1),t({options:E})},l=(f,p)=>{const h=[...e.options];if(!h[f])throw new Error(`Option not found at index ${f}`);const{name:E,value:v}=p,y=[...o.options];y[f]={...y[f],initial:!1,[E]:r(E,v)},i({...o,options:y}),h[f]={...h[f],[E]:v},t({options:h})},c=(f,p)=>{const h=f.target,{name:E,value:v}=h;switch(t({initial:!1}),E){case"value":p!==void 0&&l(p,{name:E,value:v});break;default:Ie().error(`Unhandled input name: ${E}`)}},d=({index:f,name:p})=>{const h=o.options[f];return(h==null?void 0:h[p])||(h==null?void 0:h.initial)};return u.jsxs(u.Fragment,{children:[u.jsx("ol",{className:"divide-y-4 divide-foreground/10 border-b-4 border-foreground/10",children:e.options.map((f,p,h)=>u.jsxs("li",{className:"flex pt-3",children:[u.jsx("div",{className:"w-8 shrink-0 text-center",children:u.jsx(te,{className:"text-foreground/60",size:"xs",tag:"bars"})}),u.jsxs("div",{className:"relative mr-3",children:[h.length>1&&u.jsx(Bo,{className:"absolute right-0 top-0",handleDelete:a(p),label:T(N.REMOVE_CONDITION,{index:p+1}),size:"sm",show:!0}),u.jsxs("label",{className:"mb-2 block",children:[T(N.CONDITION_NUMBER,{index:p+1}),u.jsx("input",{className:`w-full ${d({index:p,name:"value"})?"":"invalid"}`,name:"value",onChange:E=>c(E,p),placeholder:n,type:"text",value:f.value}),u.jsx("p",{className:"requirements",role:"alert",children:T(N.ERROR_VALUE_IS_REQUIRED)})]})]})]},f.id))}),u.jsx("div",{className:"p-3 text-right",children:u.jsx("button",{className:"rounded bg-foreground/10 py-1 px-2 font-medium",onClick:s,type:"button",children:T(N.ADD_CONDITION)})})]})},vL=Ie(),Os=(e,t)=>[e,t].filter(Boolean).join("-").toLowerCase(),yL={idsByKey:{},languageById:{},voiceById:{}},_L=(e,t)=>({...yL,actions:{getGenderByKeys:({languageId:n})=>{const{idsByKey:r}=t(),o=(n==null?void 0:n.split(",").map(s=>Os(s)))??[];if(!o.length)return["female","male"];const i=new Set;return o.forEach(s=>{var a;return(a=r[s])==null?void 0:a.forEach(l=>{l.gender&&i.add(l.gender)})}),Array.from(i).sort((s,a)=>s.toLowerCase().localeCompare(a.toLowerCase()))},getLanguages:()=>Object.values(t().languageById).sort((n,r)=>n.name.toLowerCase().localeCompare(r.name.toLowerCase())),getVoicesByKeys:({languageId:n,gender:r})=>{const{voiceById:o,idsByKey:i}=t(),s=(n==null?void 0:n.split(",").map(l=>Os(l,r)))??[];let a=[];return!s.length||s[0]===""?a=Object.values(o):s.forEach(l=>{a=a.concat(i[l]??[])}),a.sort((l,c)=>{const d=/^\w{2,3}-\w{2,}-.+/;return l.name.match(d)&&!c.name.match(d)?1:!l.name.match(d)&&c.name.match(d)?-1:l.name.toLowerCase().localeCompare(c.name.toLowerCase())})},init:async({voicesURL:n="/voices.json"})=>{try{vL.debug("Load voicesURL",n);const o=await(await fetch(n)).json(),i={},s={},a={};o.forEach(l=>{var y,g,m;const c=!!l.premium,d=l.signalwire_id,f=l.gender.toLowerCase(),p={gender:f,id:d,key:`${l.language_code}-${f}-${l.signalwire_id}`,name:`${l.friendly_name.trim()} ${c?"(premium)":""}`,premium:c};i[d]=p,s[l.language_code]={id:l.language_code,name:l.language};const h=Os(l.language_code);h in a||(a[h]=[]),(y=a[h])==null||y.push(p);const E=Os(f);E in a||(a[E]=[]),(g=a[E])==null||g.push(p);const v=Os(l.language_code,f);v in a||(a[v]=[]),(m=a[v])==null||m.push(p)}),e({idsByKey:a,languageById:s,voiceById:i})}catch(r){console.error("Error",r)}}}}),Hf=us()(_L),SL=()=>Hf.getState().actions;window.__useVoiceStore=Hf;const H0=e=>u.jsx("option",{value:e.id,children:e.name},e.key??e.id),xL=({onChange:e,languageId:t,gender:n,voiceId:r})=>{const{getLanguages:o,getVoicesByKeys:i,getGenderByKeys:s}=SL();return u.jsxs(u.Fragment,{children:[u.jsxs(an,{className:"w-full",label:T(N.LANGUAGE),name:"language",onChange:e,value:t??"",children:[u.jsx("option",{value:"",children:T(N.SELECT)}),o().map(H0)]}),u.jsxs(an,{className:"w-full capitalize",label:T(N.GENDER),name:"gender",onChange:e,value:n??"",children:[u.jsx("option",{value:"",children:T(N.SELECT)}),s({languageId:t}).map(a=>u.jsx("option",{value:a,children:a},a))]}),u.jsxs(an,{className:"w-full",label:T(N.VOICE),name:"voice",onChange:e,value:r??"",children:[u.jsx("option",{value:"",children:T(N.SELECT)}),i({gender:n,languageId:t}).map(H0)]})]})},z0={text:N.TEXT_TO_SPEECH,url:N.PLAY_AUDIO_FILE},W0=({handleOnUpdate:e,label:t,nodeData:n,showDefaultOption:r})=>{const{validateField:o}=lt("play"),[i,s]=w.useState({gender:!0,language:!0,selected:n.initial||o("selected",n.selected),text:n.initial||o("text",n.text),url:n.initial||o("url",n.url),voice:!0}),a=n.selected;w.useEffect(()=>{!a&&!r&&e({selected:"url"})},[e,a,r]);const l=d=>{const f=d.target,{name:p,value:h}=f;switch(p){case"selected":case"text":case"url":s({...i,[p]:o(p,h)}),e({initial:!1,[p]:h});break;default:throw new Error(`Unhandled input name: ${p}`)}},c=d=>{const f=d.target,{name:p,value:h}=f;switch(p){case"language":e({gender:void 0,language:h,voice:void 0});break;case"gender":e({gender:h,voice:void 0});break;default:e({[p]:h})}};return u.jsxs(u.Fragment,{children:[u.jsxs("label",{className:"mb-2",children:[u.jsx("span",{className:"sr-only",children:t}),u.jsxs($y,{className:`w-full ${i.selected?"":"invalid"}`,name:"selected",onChange:l,value:a,children:[r&&u.jsx("option",{value:"",children:T(N.SELECT)}),Object.keys(z0).map(d=>u.jsx("option",{value:d,children:T(z0[d])},d))]})]}),a&&u.jsx(RL,{nodeData:n,onChange:l,voiceSettingsChangeHandler:c,selected:a,valid:i[a]})]})},RL=({nodeData:e,onChange:t,voiceSettingsChangeHandler:n,selected:r,valid:o})=>{const i=e[r],a={text:u.jsxs(u.Fragment,{children:[u.jsx(xL,{onChange:n,languageId:e.language,gender:e.gender,voiceId:e.voice}),u.jsx(On,{errorText:T(N.ERROR_VALUE_IS_REQUIRED),inputMode:"text",label:T(N.TEXT),name:r,onChange:t,placeholder:T(N.WRITE_SOMETHING),valid:o,value:i})]}),url:u.jsx(On,{errorText:T(N.ERROR_URL_IS_REQUIRED),inputMode:"url",label:T(N.AUDIO_FILE),name:r,onChange:t,placeholder:T(N.ENTER_URL),valid:o,value:i})}[r];return u.jsx(u.Fragment,{children:a})},NL=[{field:"stereo",subtitle:N.STEREO_SUBTITLE,title:N.STEREO},{field:"beep",subtitle:N.BEEP_SUBTITLE,title:N.BEEP}],G0=({handleOnUpdate:e,nodeData:t,type:n})=>{const{validateField:r}=lt("record"),[o,i]=w.useState({beep:!0,endSilenceTimeout:t.initial||r("endSilenceTimeout",t.endSilenceTimeout),format:!0,initialTimeout:t.initial||r("initialTimeout",t.initialTimeout),maxLength:t.initial||r("maxLength",t.maxLength),stereo:!0,terminators:t.initial||r("terminators",t.terminators)});t.format||e({format:"mp3"});const s=l=>{const c=l.target.name;e({[c]:!t[c]})},a=l=>{const c=l.target,{name:d,value:f}=c;switch(d){case"endSilenceTimeout":case"format":case"initialTimeout":case"maxLength":case"terminators":i({...o,[d]:r(d,f)}),e({initial:!1,[d]:f});break;default:throw new Error(`Unhandled input name: ${d}`)}};return u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"mb-2",children:NL.map(l=>{const c=t[l.field];return u.jsx("div",{children:u.jsx(pf,{checked:c,clickHandler:s,name:l.field,subtitle:T(l.subtitle),title:T(l.title)})},l.field)})}),u.jsxs("label",{className:"mb-2 block",children:[T(N.TERMINATORS),u.jsx("span",{className:"block text-xxs text-foreground/50",children:T(N.SEPARATE_WITH_COMMAS)}),u.jsx("input",{className:`w-full ${o.terminators?"":"invalid"}`,name:"terminators",onChange:a,placeholder:"#*0",type:"text",value:t.terminators}),u.jsx("p",{className:"requirements",role:"alert",children:T(N.ERROR_TERMINATORS)})]}),n==="voicemail"&&u.jsxs(u.Fragment,{children:[u.jsxs("label",{className:"mb-2 block",children:[u.jsx("div",{className:"w-full",children:T(N.MAXIMUM_RECORDING_LENGTH)}),u.jsxs("div",{className:"flex flex-wrap items-center gap-x-2",children:[u.jsx("input",{className:`w-14 ${o.maxLength?"":"invalid"}`,inputMode:"numeric",min:Yo.MIN,max:Yo.MAX,name:"maxLength",onChange:a,placeholder:T(N.SECONDS),type:"number",value:t.maxLength}),u.jsx("p",{className:"requirements w-full",role:"alert",children:T(N.ERROR_NUMBER_MIN_MAX_IS_REQUIRED,{max:Yo.MAX,min:Yo.MIN})})]})]}),u.jsxs("label",{className:"mb-2 block",children:[u.jsx("div",{className:"w-full",children:T(N.INITIAL_TIMEOUT)}),u.jsxs("div",{className:"flex flex-wrap items-center gap-x-2",children:[u.jsx("input",{className:`w-14 ${o.initialTimeout?"":"invalid"}`,inputMode:"numeric",min:ge.MIN,max:ge.MAX,name:"initialTimeout",onChange:a,placeholder:T(N.SECONDS),type:"number",value:t.initialTimeout}),u.jsx("p",{className:"requirements w-full",role:"alert",children:T(N.ERROR_NUMBER_MIN_MAX_IS_REQUIRED,{max:ge.MAX,min:ge.MIN})})]})]}),u.jsxs("label",{className:"mb-2 block",children:[u.jsx("div",{className:"w-full",children:T(N.END_SILENCE_TIMEOUT)}),u.jsxs("div",{className:"flex flex-wrap items-center gap-x-2",children:[u.jsx("input",{className:`w-14 ${o.endSilenceTimeout?"":"invalid"}`,inputMode:"numeric",min:ge.MIN,max:ge.MAX,name:"endSilenceTimeout",onChange:a,placeholder:T(N.SECONDS),type:"number",value:t.endSilenceTimeout}),u.jsx("p",{className:"requirements w-full",role:"alert",children:T(N.ERROR_NUMBER_MIN_MAX_IS_REQUIRED,{max:ge.MAX,min:ge.MIN})})]})]})]}),u.jsxs(an,{className:"w-full",label:T(N.FORMAT),name:"format",onChange:a,value:t.format,children:[u.jsx("option",{value:"mp3",children:"MP3"}),u.jsx("option",{value:"wav",children:"WAV"})]})]})},Ze=({children:e,formRef:t,handleOnChange:n=()=>null,title:r})=>u.jsxs("div",{className:"flex flex-col overflow-hidden","data-testid":"cfb__settings",children:[u.jsxs("div",{className:"flex w-full items-center justify-start gap-x-2 px-4 pb-3",children:[u.jsx("div",{className:"flex h-5 w-5 shrink-0 items-center justify-center rounded-full bg-focus/30 text-primary",children:u.jsx(te,{tag:"circle-small"})}),u.jsx("div",{className:"flex-1",children:u.jsx("h2",{className:"text-xs font-semibold",children:r})})]}),u.jsx("form",{className:"flex h-full flex-col overflow-hidden text-xs",noValidate:!0,onChange:n,ref:t,children:u.jsx("div",{className:"flex-1 overflow-y-auto pt-1 pb-4",children:e})})]}),wL=({nodeData:e,handleOnUpdate:t})=>{const{validateField:n}=lt("aiAgent"),[r,o]=w.useState({agent:e.initial||n("agent",e.agent)}),i=un(v=>v.aiAgentMap.values()),s=un(v=>v.error),a=un(v=>v.status),{fetchAiAgents:l}=TC();w.useEffect(()=>{l()},[l]);const c=Array.from(i),d=a==="loading",f=!!s||a==="error",p=f||a==="initial",h=v=>{const y=v.target,{name:g,value:m}=y;o({...r,[g]:n(g,m)}),t({initial:!1,[g]:m})},E=w.useId();return u.jsx(Ze,{title:T(N.AI_AGENT),children:u.jsx("div",{className:"mx-3",children:!f&&c.length?u.jsxs("div",{className:"relative",children:[u.jsxs(an,{id:E,className:`${r.agent?"":"invalid"}`,disabled:p,label:T(N.AI_AGENT_NAME),name:"agent",onChange:h,value:e.agent,children:[u.jsx("option",{value:"",children:T(N.SELECT)}),c.map(v=>u.jsx("option",{value:v.id,children:v.display_name},v.id))]}),u.jsx(Y0,{className:"absolute top-0 right-0 mx-1",handleClickResync:l,isLoading:d}),e.agent&&u.jsx("p",{children:u.jsx(K0,{agent:e.agent,mode:"edit",className:"mb-2",children:T(N.EDIT_SELECTED_AI_AGENT)})})]}):u.jsxs("div",{className:"flex items-end justify-between",children:[u.jsx("p",{role:"alert",className:"text-negative",children:f?u.jsx(u.Fragment,{children:T(N.ERROR_FETCHING_AI_AGENTS)}):u.jsxs(u.Fragment,{children:[T(N.ERROR_ADD_AI_AGENT_FIRST),u.jsx(K0,{mode:"add",className:"mt-2 block",children:T(N.ADD_AI_AGENT)})]})}),u.jsx(Y0,{className:"mx-1",handleClickResync:l,isLoading:d})]})})})},Y0=({className:e="",isLoading:t,handleClickResync:n})=>u.jsx(sr,{placement:"bottom-end",trigger:u.jsxs("button",{className:`overflow-hidden ${t?"text-disabled":""} ${e}`,disabled:t,onClick:n,type:"button",children:[u.jsx(te,{className:`${t?"animate-spin":""}`,tag:"arrows-rotate"}),u.jsx("span",{className:"sr-only",children:T(N.RESYNC_AI_AGENTS)})]}),children:u.jsx("p",{className:"text-sm",children:T(N.RESYNC_AI_AGENTS)})}),K0=({agent:e="",children:t,className:n="",mode:r})=>{const o={add:"",edit:`${e}/edit`};return u.jsx("a",{className:`w-fit text-foreground underline hover:text-foreground/80 ${n}`,href:`/ai_agents/${o[r]}`,target:"_blank",rel:"noopener noreferrer",children:t})},OL=["GET","POST","PUT","DELETE"],TL=({nodeData:e,handleOnUpdate:t})=>{const{validateField:n}=lt("condRequest"),[r,o]=w.useState({body:e.initial||n("body",e.body),headers:e.initial||n("headers",e.headers),method:e.initial||n("method",e.method),saveVariables:e.initial||n("saveVariables",e.saveVariables),url:e.initial||n("url",e.url)}),i=l=>{const c=l.target,{name:d,value:f}=c;switch(t({initial:!1}),d){case"url":case"method":o({...r,[d]:n(d,f)}),t({[d]:f});break;case"headers":o({...r,[d]:n(d,f)}),t({[d]:f});break;case"body":o({...r,[d]:n(d,f)}),t({[d]:f});break;default:throw new Error(`Unhandled input name: ${d}`)}},s=l=>{const{name:c,value:d}=l.target;t({[c]:d})},a=l=>{const{name:c}=l.target,d=!e[c];t({[c]:d})};return u.jsxs(Ze,{title:T(N.REQUEST),children:[u.jsxs("div",{className:"border-b-4 border-foreground/10 px-3",children:[u.jsxs("label",{className:"mb-2 block",children:[T(N.URL),u.jsx("input",{className:`w-full ${r.url?"":"invalid"}`,name:"url",onChange:i,placeholder:"https://u:p@example.com/api/status",type:"text",value:e.url}),u.jsx("p",{className:"requirements w-full",role:"alert",children:T(N.ERROR_VALUE_IS_REQUIRED)})]}),u.jsx("div",{className:"mb-1",children:u.jsx(an,{className:"w-full",label:T(N.METHOD),name:"method",onChange:s,value:e.method,children:OL.map(l=>u.jsx("option",{value:l,children:l},l))})}),u.jsx("div",{className:"mb-4",children:u.jsx(pf,{checked:e.saveVariables,clickHandler:a,name:"saveVariables",subtitle:T(N.SAVE_VARIABLES_SUBTITLE),title:T(N.SAVE_VARIABLES)})}),u.jsx("label",{className:"mb-2 block",children:u.jsx(On,{errorText:T(N.ERROR_INVALID_JSON),inputMode:"text",label:T(N.REQUEST_HEADERS),name:"headers",onChange:i,placeholder:'{"Content-Type": "application/json", "X-Custom-Header": "foo"}',valid:r.headers,value:e.headers})}),u.jsx("label",{className:"mb-2 block",children:u.jsx(On,{errorText:T(N.ERROR_INVALID_JSON),inputMode:"text",label:T(N.REQUEST_BODY),name:"body",onChange:i,placeholder:T(N.STRING_OR_JSON),valid:r.body,value:e.body??""})})]}),u.jsx(Bf,{nodeData:e,handleOnUpdate:t})]})},AL=({nodeData:e,handleOnUpdate:t})=>{const n=w.useRef();return u.jsx(Ze,{formRef:n,title:T(N.CONDITIONS),children:u.jsx("div",{children:u.jsx(Bf,{nodeData:e,handleOnUpdate:t})})})},IL=({nodeData:e,handleOnUpdate:t})=>{const{validateField:n}=lt("executeSWML"),[r,o]=w.useState({dest:e.initial||n("dest",e.dest),meta:e.initial||n("meta",e.meta),params:e.initial||n("params",e.params)}),i=s=>{const a=s.target,{name:l,value:c}=a;switch(t({initial:!1}),l){case"dest":case"params":case"meta":o({...r,[l]:n(l,c)}),t({[l]:c});break;default:throw new Error(`Unhandled input name: ${l}`)}};return u.jsxs(Ze,{title:T(N.EXECUTE_SWML),children:[u.jsxs("div",{className:"border-b-4 border-foreground/10 px-3",children:[u.jsxs("label",{className:"mb-2 block",children:[T(N.URL),u.jsx("input",{className:`w-full ${r.dest?"":"invalid"}`,name:"dest",onChange:i,placeholder:"https://u:p@test.com/go.swml",type:"text",value:e.dest}),u.jsx("p",{className:"requirements w-full",role:"alert",children:T(N.ERROR_VALUE_IS_REQUIRED)})]}),u.jsx("label",{className:"mb-2 block",children:u.jsx(On,{errorText:T(N.ERROR_INVALID_JSON),inputMode:"text",label:T(N.PARAMS),name:"params",onChange:i,placeholder:'{"Content-Type": "application/json", "X-Custom-Header": "foo"}',valid:r.params,value:e.params??""})}),u.jsx("label",{className:"mb-2 block",children:u.jsx(On,{errorText:T(N.ERROR_INVALID_JSON),inputMode:"text",label:T(N.META),name:"meta",onChange:i,placeholder:T(N.JSON_OBJECT),valid:r.meta,value:e.meta??""})})]}),u.jsx(Bf,{nodeData:e,handleOnUpdate:t,placeholder:"return_value === '1'"})]})},bL={forwardAddress:{add:N.ADD_ADDRESS,call:N.CALL_ADDRESSES,optionNumber:N.ADDRESS_NUMBER,remove:N.REMOVE_ADDRESS,title:N.FORWARD_TO_ADDRESS},forwardPhone:{add:N.ADD_PHONE_NUMBER,call:N.CALL_NUMBERS,optionNumber:N.PHONE_NUMBER_NUMBER,remove:N.REMOVE_PHONE_NUMBER,title:N.FORWARD_TO_PHONE},forwardResource:{add:N.ADD_RESOURCE,call:N.CALL_RESOURCES,optionNumber:N.RESOURCE_NUMBER,remove:N.REMOVE_RESOURCE,title:N.FORWARD_TO_RESOURCE}},Q0={parallel:N.SIMULTANEOUSLY,serial:N.SEQUENTIALLY},CL=()=>({connectFrom:"",connectTimeout:"",connectTo:"",id:ie()}),zf=({nodeType:e,nodeData:t,handleOnUpdate:n})=>{var y,g,m;const{validateField:r}=lt(e),o=w.useRef(),[i,s]=w.useState(["serial","parallel"].includes(t.callOrder)?t.callOrder:"serial"),a=bL[e],[l,c]=w.useState({callOrder:t.initial||r("callOrder",i),callStateEvents:t.initial||r("callStateEvents",i),callStateUrl:t.initial||r("callStateUrl",i),connections:(y=t.connections)==null?void 0:y.map(_=>({connectFrom:r("connectFrom",_.connectFrom),connectTimeout:r("connectTimeout",_.connectTimeout),connectTo:r("connectTo",_.connectTo),initial:t.initial})),defaultFrom:t.initial||r("defaultFrom",t.defaultFrom),defaultTimeout:t.initial||r("defaultTimeout",t.defaultTimeout)}),d=_=>{_.preventDefault(),c({...l,connections:[...l.connections,{connectFrom:!0,connectTimeout:!0,connectTo:!0,initial:!0}]}),n({callOrder:i,connections:[...t.connections,CL()]})},f=_=>S=>{S.preventDefault();const x=[...l.connections];x.splice(_,1),c({...l,connections:x});const R=[...t.connections];R.splice(_,1),n({callOrder:R.length===1?"single":i,connections:R})},p=(_,S)=>{const x=[...t.connections];if(!x[_])throw new Error(`Option not found at index ${_}`);const{name:R,value:I}=S,L=[...l.connections];L[_]={...L[_],initial:!1,[R]:r(R,I)},c({...l,connections:L}),x[_]={...x[_],[R]:I},n({connections:x,initial:!1})},h=_=>{const S=_.currentTarget.value;s(S),n({callOrder:S})},E=(_,S)=>{const x=_.target,{name:R,value:I}=x;switch(R){case"callStateEvents":case"callStateUrl":case"defaultTimeout":case"defaultFrom":c({...l,[R]:r(R,I)}),n({initial:!1,[R]:I});break;case"connectFrom":case"connectTimeout":case"connectTo":if(S===void 0)throw new Error(`Option index not provided: ${R}`);p(S,{name:R,value:I});break;default:throw new Error(`Unhandled input name: ${R}`)}},v=({index:_,name:S})=>{const x=l.connections[_];return!!(x!=null&&x[S]||x!=null&&x.initial)};return u.jsxs(Ze,{title:T(a.title),formRef:o,children:[u.jsxs("div",{className:"border-b-4 border-foreground/10 px-3 pb-3",children:[u.jsxs("label",{className:"mb-2 block",children:[T(N.DEFAULT_FROM),u.jsx(Es,{className:"w-full",direction:"from",name:"defaultFrom",onChange:E,placeholder:T(N.FROM),type:"tel",value:t.defaultFrom,valid:l.defaultFrom}),u.jsx("p",{className:"requirements w-full",role:"alert",children:T(N.ERROR_VALUE_IS_REQUIRED)})]}),u.jsxs("label",{className:"mb-2 block",children:[T(N.DEFAULT_TIMEOUT),u.jsxs("div",{className:"flex flex-wrap items-center gap-x-2",children:[u.jsx("input",{className:`w-14 ${l.defaultTimeout?"":"invalid"}`,inputMode:"numeric",min:0,name:"defaultTimeout",onChange:E,placeholder:T(N.SECONDS),type:"number",value:t.defaultTimeout}),u.jsx("p",{className:"requirements w-full",role:"alert",children:T(N.ERROR_NUMBER_IS_REQUIRED)})]})]}),u.jsxs("label",{className:"mb-2 block",children:[T(N.CALL_STATE_URL),u.jsx("input",{className:`w-full ${l.callStateUrl?"":"invalid"}`,name:"callStateUrl",onChange:E,placeholder:"https://example.com/api",type:"url",value:t.callStateUrl}),u.jsx("p",{className:"requirements w-full",role:"alert",children:T(N.ERROR_VALUE_IS_REQUIRED)})]}),u.jsxs("label",{className:"mb-2 block",children:[T(N.CALL_STATE_EVENTS),u.jsx("input",{className:`w-full ${l.callStateEvents?"":"invalid"}`,name:"callStateEvents",onChange:E,placeholder:"Created, ringing, answered, ended",type:"text",value:t.callStateEvents}),u.jsx("p",{className:"requirements w-full",role:"alert",children:T(N.ERROR_VALUE_IS_REQUIRED)})]})]}),u.jsx("ul",{className:"border-foreground-10 divide-y-4 divide-foreground/10 border-b-4",children:(g=t.connections)==null?void 0:g.map((_,S,x)=>u.jsxs("li",{className:"flex pt-3",children:[u.jsx("div",{className:"w-8 shrink-0 text-center",children:u.jsx(te,{className:"text-foreground/60",size:"xs",tag:"bars"})}),u.jsxs("div",{className:"relative mr-3",children:[x.length>1&&u.jsx(Bo,{className:"absolute right-0 top-0",handleDelete:f(S),label:T(a.remove,{index:S+1}),size:"sm",show:!0}),u.jsxs("fieldset",{children:[u.jsx("legend",{children:T(a.optionNumber,{index:S+1})}),u.jsxs("label",{className:"mb-1 block",children:[u.jsx("div",{className:"sr-only",children:T(N.TO)}),u.jsx(Es,{className:"w-full",direction:"to",name:"connectTo",onChange:R=>E(R,S),type:e==="forwardPhone"?"tel":"text",valid:v({index:S,name:"connectTo"}),value:_.connectTo}),u.jsx("p",{className:"requirements",role:"alert",children:T(N.ERROR_VALUE_IS_REQUIRED)})]}),u.jsxs("label",{className:"mb-2 block",children:[u.jsx("div",{className:"sr-only",children:T(N.FROM)}),u.jsx(Es,{className:"w-full",direction:"from",name:"connectFrom",onChange:R=>E(R,S),placeholder:T(N.FROM),type:"text",valid:v({index:S,name:"connectFrom"}),value:_.connectFrom}),u.jsx("p",{className:"requirements",role:"alert",children:T(N.ERROR_VALUE_IS_REQUIRED)})]}),u.jsxs("label",{className:"mb-2 block",children:[T(N.TIMEOUT),u.jsxs("div",{className:"flex flex-wrap items-center gap-x-2",children:[u.jsx("input",{className:`w-14 ${v({index:S,name:"connectTimeout"})?"":"invalid"}`,inputMode:"numeric",min:0,name:"connectTimeout",onChange:R=>E(R,S),placeholder:T(N.SECONDS),type:"number",value:_.connectTimeout}),u.jsx("p",{className:"requirements w-full",role:"alert",children:T(N.ERROR_NUMBER_IS_REQUIRED)})]})]})]})]})]},_.id))}),u.jsx("div",{className:"p-3 pb-6 text-right",children:u.jsx("button",{className:"rounded bg-foreground/10 py-1 px-2 font-medium",onClick:d,type:"button",children:T(a.add)})}),((m=t.connections)==null?void 0:m.length)>1&&u.jsx("div",{className:"mb-4 px-3",children:u.jsx(an,{className:"w-full",label:T(a.call),name:"callOrder",onChange:h,value:i,children:Object.keys(Q0).map(_=>u.jsx("option",{value:_,children:T(Q0[_])},_))})})]})},LL=()=>({command:"",digit:"",id:ie()}),DL=({nodeData:e,handleOnUpdate:t})=>{const{validateField:n}=lt("promptPlay"),r=w.useRef(),[o,i]=w.useState({digitTimeout:e.initial||n("digitTimeout",e.digitTimeout),initialTimeout:e.initial||n("initialTimeout",e.initialTimeout),options:e.options.map(h=>({command:n("command",h.command),digit:n("digit",h.digit),initial:e.initial}))}),s=ar(e.options,"command"),a=ar(e.options,"digit"),l=h=>{h.preventDefault(),i({...o,options:[...o.options,{command:!0,digit:!0,initial:!0}]}),t({options:[...e.options,LL()]})},c=h=>E=>{E.preventDefault();const v=[...o.options];v.splice(h,1),i({...o,options:v});const y=[...e.options];y.splice(h,1),t({options:y})},d=(h,E)=>{const v=[...e.options];if(!v[h])throw new Error(`Option not found at index ${h}`);const{name:y,value:g}=E,m=[...o.options];m[h]={...m[h],initial:!1,[y]:n(y,g)},i({...o,options:m}),v[h]={...v[h],[y]:g},t({options:v})},f=(h,E)=>{const v=h.target,{name:y,value:g}=v;switch(t({initial:!1}),y){case"digit":case"command":E!==void 0&&d(E,{name:y,value:g});break;case"digitTimeout":case"initialTimeout":{i({...o,[y]:n(y,g)}),t({[y]:g});break}default:throw new Error(`Unhandled input field name: ${y}`)}},p=({index:h,name:E})=>{var g;const v=o.options[h];if(v!=null&&v.initial)return!0;if(!(v!=null&&v[E]))return!1;const y=(g=e.options)==null?void 0:g[h];return It(y==null?void 0:y.digit)||It(y==null?void 0:y.command)};return u.jsxs(Ze,{formRef:r,title:T(N.GATHER_INPUT),children:[u.jsx("div",{className:"border-b-4 border-foreground/10 px-3 pb-3",children:u.jsx(W0,{handleOnUpdate:t,label:T(N.CHOOSE_OPTION_TTS_AUDIO),nodeData:e})}),u.jsx("ol",{className:"divide-y-4 divide-foreground/10 border-b-4 border-foreground/10",children:e.options.map((h,E,v)=>{const y=s(h.command),g=a(h.digit);return u.jsxs("li",{className:"flex pt-3",children:[u.jsx("div",{className:"w-8 shrink-0 text-center",children:u.jsx(te,{className:"text-foreground/60",size:"xs",tag:"bars"})}),u.jsxs("div",{className:"relative mr-3",children:[v.length>1&&u.jsx(Bo,{className:"absolute right-0 top-0",handleDelete:c(E),label:T(N.REMOVE_OPTION,{index:E+1}),size:"sm",show:!0}),u.jsxs("fieldset",{children:[u.jsx("legend",{className:"sr-only",children:T(N.OPTION_NUMBER,{index:E+1})}),u.jsxs("label",{className:"mb-2 block",children:[T(N.CALLER_PRESSES),u.jsx("input",{className:`${p({index:E,name:"digit"})&&!g?"":"invalid"}`,name:"digit",onChange:m=>f(m,E),placeholder:T(N.KEYPAD_VALUE),type:"text",value:h.digit}),u.jsx("p",{className:"requirements",role:"alert",children:T(g?N.ERROR_DUPLICATE_TELEPHONE_KEY:N.ERROR_TELEPHONE_KEY_REQUIRED)})]}),u.jsxs("label",{className:"mb-2 block",children:[T(N.OR_SAYS),u.jsx("input",{className:`w-full ${p({index:E,name:"command"})&&!y?"":"invalid"}`,name:"command",onChange:m=>f(m,E),placeholder:T(N.SPOKEN_PROMPT),type:"text",value:h.command}),u.jsx("p",{className:"requirements",role:"alert",children:T(y?N.ERROR_DUPLICATE_COMMAND:N.ERROR_TEXT_IS_REQUIRED)})]})]})]})]},h.id)})}),u.jsx("div",{className:"p-3 pb-6 text-right",children:u.jsx("button",{className:"rounded bg-foreground/10 py-1 px-2 font-medium",onClick:l,type:"button",children:T(N.ADD_OPTION)})}),u.jsxs("div",{className:"px-3",children:[u.jsxs("label",{className:"mb-2 block",children:[u.jsx("div",{className:"w-full",children:T(N.WAIT_FOR_INPUT)}),u.jsxs("div",{className:"flex flex-wrap items-center gap-x-2",children:[u.jsx("input",{className:`w-14 ${o.initialTimeout?"":"invalid"}`,inputMode:"numeric",min:ge.MIN,max:ge.MAX,name:"initialTimeout",onChange:f,placeholder:T(N.SECONDS),type:"number",value:e.initialTimeout}),u.jsx("p",{className:"requirements w-full",role:"alert",children:T(N.ERROR_NUMBER_MIN_MAX_IS_REQUIRED,{max:ge.MAX,min:ge.MIN})})]})]}),u.jsxs("label",{children:[u.jsx("div",{className:"w-full",children:T(N.WAIT_FOR_DIGIT)}),u.jsxs("div",{className:"flex flex-wrap items-center gap-x-2",children:[u.jsx("input",{className:`w-14 ${o.digitTimeout?"":"invalid"}`,inputMode:"numeric",min:ge.MIN,max:ge.MAX,name:"digitTimeout",onChange:f,placeholder:T(N.SECONDS),type:"number",value:e.digitTimeout}),u.jsx("p",{className:"requirements w-full",role:"alert",children:T(N.ERROR_NUMBER_MIN_MAX_IS_REQUIRED,{max:ge.MAX,min:ge.MIN})})]})]})]})]})},kL=({handleOnUpdate:e,nodeData:t})=>{const{validateField:n}=lt("play"),[r,o]=w.useState({reason:t.initial||n("reason",t.reason)}),i=s=>{const a=s.target,{name:l,value:c}=a;switch(l){case"reason":o({...r,[l]:n(l,c)}),e({initial:!1,[l]:c});break;default:throw new Error(`Unhandled input name: ${l}`)}};return u.jsx(Ze,{title:T(N.HANG_UP_CALL),children:u.jsx("div",{className:"mx-3",children:u.jsxs(an,{className:"w-full",label:`${T(N.REASON)} (${T(N.OPTIONAL)})`,name:"reason",onChange:i,value:t.reason,children:[u.jsx("option",{value:"",children:T(N.SELECT)}),Object.keys($f).map(s=>u.jsx("option",{value:s,children:T($f[s])},s))]})})})},PL=({nodeData:e,handleOnUpdate:t})=>{const n=w.useRef();return u.jsx(Ze,{formRef:n,title:T(N.PLAY_AUDIO_TTS),children:u.jsx("div",{className:"mx-3",children:u.jsx(W0,{handleOnUpdate:t,label:T(N.CHOOSE_OPTION_TTS_AUDIO),nodeData:e,showDefaultOption:!0})})})},ML=({nodeData:e,handleOnUpdate:t})=>{const n=w.useRef(),{validateField:r}=lt("recordCallStart"),[o,i]=w.useState({label:e.initial||r("label",e.label)}),[s,a]=w.useState(!1),{upsertEntry:l,isValueDuplicate:c}=kf();w.useEffect(()=>{a(c(e.label,e.controlId))},[c,e.controlId,e.label]);const d=f=>{const p=f.target,{name:h,value:E}=p;i({...o,[h]:r(h,E)}),t({initial:!1,[h]:E}),l({controlId:e.controlId,label:E})};return u.jsxs(Ze,{title:T(N.RECORD_CALL_START),formRef:n,children:[u.jsx("div",{className:"px-3 pb-3",children:u.jsxs("label",{children:[T(N.RECORDING_NAME),u.jsx("input",{className:`w-full ${o.label&&!s?"":"invalid"}`,name:"label",onChange:d,type:"text",value:e.label}),u.jsx("p",{className:"requirements",role:"alert",children:T(s?N.ERROR_DUPLICATE_RECORDING_LABEL:N.ERROR_RECORDING_LABEL_REQUIRED)})]})}),u.jsx("div",{className:"px-3",children:u.jsx(G0,{handleOnUpdate:t,nodeData:e,type:"call"})})]})},jL=({nodeData:e,handleOnUpdate:t})=>{const{validateField:n}=lt("recordCallStop"),[r,o]=w.useState({controlId:e.initial||n("controlId",e.controlId)}),{getEntries:i}=kf(),s=i().sort((l,c)=>l.label.toLowerCase().localeCompare(c.label.toLowerCase())),a=l=>{const c=l.target,{name:d,value:f}=c;o({...r,[d]:n(d,f)}),t({initial:!1,[d]:f})};return u.jsx(Ze,{title:T(N.RECORD_CALL_STOP),children:u.jsx("div",{className:"px-3",children:s.length?u.jsxs(an,{className:`w-full ${r.controlId?"":"invalid"}`,label:T(N.RECORDING_NAME),name:"controlId",value:e.controlId,onChange:a,children:[u.jsx("option",{value:"",children:T(N.SELECT)}),s.map(l=>u.jsx("option",{value:l.controlId,children:l.label},l.controlId))]}):u.jsx("p",{role:"alert",className:"text-negative",children:T(N.ERROR_ADD_RECORDING_FIRST)})})})},UL=({nodeData:e,handleOnUpdate:t})=>u.jsx(Ze,{title:T(N.VOICEMAIL_RECORDING),children:u.jsx("div",{className:"mx-3",children:u.jsx(G0,{handleOnUpdate:t,nodeData:e,type:"voicemail"})})}),FL=["GET","POST","PUT","DELETE"],VL=({nodeData:e,handleOnUpdate:t})=>{const{validateField:n}=lt("request"),[r,o]=w.useState({body:e.initial||n("body",e.body),headers:e.initial||n("headers",e.headers),method:e.initial||n("method",e.method),saveVariables:e.initial||n("saveVariables",e.saveVariables),url:e.initial||n("url",e.url)}),i=l=>{const c=l.target,{name:d,value:f}=c;switch(t({initial:!1}),d){case"url":case"method":o({...r,[d]:n(d,f)}),t({[d]:f});break;case"headers":o({...r,[d]:n(d,f)}),t({[d]:f});break;case"body":o({...r,[d]:n(d,f)}),t({[d]:f});break;default:throw new Error(`Unhandled input name: ${d}`)}},s=l=>{const{name:c,value:d}=l.target;t({[c]:d})},a=l=>{const{name:c}=l.target,d=!e[c];t({[c]:d})};return u.jsx(Ze,{title:T(N.REQUEST),children:u.jsxs("div",{className:"px-3",children:[u.jsxs("label",{className:"mb-2 block",children:[T(N.URL),u.jsx("input",{className:`w-full ${r.url?"":"invalid"}`,name:"url",onChange:i,placeholder:"https://u:p@example.com/api/status",type:"text",value:e.url}),u.jsx("p",{className:"requirements w-full",role:"alert",children:T(N.ERROR_VALUE_IS_REQUIRED)})]}),u.jsx("div",{className:"mb-1",children:u.jsx(an,{className:"w-full",label:T(N.METHOD),name:"method",onChange:s,value:e.method,children:FL.map(l=>u.jsx("option",{value:l,children:l},l))})}),u.jsx("div",{className:"mb-4",children:u.jsx(pf,{checked:e.saveVariables,clickHandler:a,name:"saveVariables",subtitle:T(N.SAVE_VARIABLES_SUBTITLE),title:T(N.SAVE_VARIABLES)})}),u.jsx("label",{className:"mb-2 block",children:u.jsx(On,{errorText:T(N.ERROR_INVALID_JSON),inputMode:"text",label:T(N.REQUEST_HEADERS),name:"headers",onChange:i,placeholder:'{"Content-Type": "application/json", "X-Custom-Header": "foo"}',valid:r.headers,value:e.headers})}),u.jsx("label",{children:u.jsx(On,{errorText:T(N.ERROR_INVALID_JSON),inputMode:"text",label:T(N.REQUEST_BODY),name:"body",onChange:i,placeholder:T(N.STRING_OR_JSON),valid:r.body,value:e.body??""})})]})})},$L=({nodeData:e,handleOnUpdate:t})=>{const{validateField:n}=lt("sendSms"),[r,o]=w.useState({body:e.initial||n("body",e.body),fromNumber:e.initial||n("fromNumber",e.fromNumber),toNumber:e.initial||n("toNumber",e.toNumber)}),i=s=>{const a=s.target,{name:l,value:c}=a;switch(l){case"body":case"fromNumber":case"toNumber":o({...r,[l]:n(l,c)}),t({initial:!1,[l]:c});break;default:throw new Error(`Unhandled input name: ${l}`)}};return u.jsx(Ze,{title:T(N.SEND_SMS),children:u.jsxs("div",{className:"mx-3",children:[u.jsxs("label",{className:"mb-2 block",children:[T(N.TO_PHONE_NUMBER),u.jsx(Es,{className:"w-full",direction:"to",name:"toNumber",onChange:i,placeholder:"+12405550000",type:"tel",valid:r.toNumber,value:e.toNumber}),u.jsx("p",{className:"requirements w-full",role:"alert",children:T(N.ERROR_VALUE_IS_REQUIRED)})]}),u.jsxs("label",{className:"mb-2 block",children:[T(N.FROM_PHONE_NUMBER),u.jsx(Es,{className:"w-full",direction:"from",name:"fromNumber",onChange:i,placeholder:"+12405550000",type:"tel",valid:r.fromNumber,value:e.fromNumber}),u.jsx("p",{className:"requirements w-full",role:"alert",children:T(N.ERROR_VALUE_IS_REQUIRED)})]}),u.jsx("label",{children:u.jsx(On,{errorText:T(N.ERROR_VALUE_IS_REQUIRED),inputMode:"text",label:T(N.SMS_TEXT),name:"body",onChange:i,placeholder:T(N.WRITE_SOMETHING),valid:r.body,value:e.body})})]})})},BL=()=>({id:ie(),key:"",value:""}),HL=({nodeData:e,handleOnUpdate:t})=>{var f;const{validateField:n}=lt("set"),[r,o]=w.useState({variables:e.variables.map(p=>({key:e.initial||n("key",p.key),value:e.initial||n("value",p.value)}))}),i=ar(e.variables,"key"),s=p=>{p==null||p.preventDefault(),o({...r,variables:[...r.variables,{key:!0,value:!0}]}),t({variables:[...e.variables,BL()]})},a=(p,h)=>{const E=[...e.variables];let v=E[p];if(!v)throw new Error(`Variable not found at index ${p}`);const{name:y,value:g}=h,m=[...r.variables];m[p]={...m[p],[y]:n(y,g)},o({...r,variables:m}),v={...E[p],[y]:g},E[p]=v,t({initial:!1,variables:E})},l=p=>h=>{h.preventDefault();const E=[...r.variables];E.splice(p,1),o({...r,variables:E});const v=[...e.variables];v.splice(p,1),t({variables:v})},c=(p,h)=>{const E=p.target,{name:v,value:y}=E;switch(v){case"key":case"value":h!==void 0&&a(h,{name:v,value:y});break;default:throw new Error(`Unhandled input name: ${v}`)}},d=({index:p,name:h})=>{const E=r.variables[p];return E==null?void 0:E[h]};return u.jsxs(Ze,{title:T(N.SET_VARIABLES),children:[u.jsx("ol",{className:"divide-y-4 divide-foreground/10 border-b-4 border-foreground/10",children:(f=e.variables)==null?void 0:f.map((p,h,E)=>{const v=i(p.key);return u.jsxs("li",{className:"flex pt-3",children:[u.jsx("div",{className:"w-8 shrink-0 text-center",children:u.jsx(te,{className:"text-foreground/60",size:"xs",tag:"bars"})}),u.jsxs("div",{className:"relative mr-3",children:[E.length>1&&u.jsx(Bo,{className:"absolute right-0 top-0",handleDelete:l(h),label:T(N.REMOVE_VARIABLE,{index:h+1}),size:"sm",show:!0}),u.jsxs("fieldset",{children:[u.jsx("legend",{className:"sr-only",children:T(N.VARIABLE_NUMBER,{index:h+1})}),u.jsxs("label",{className:"mb-2 block",children:[T(N.KEY),u.jsx("input",{className:`w-full ${d({index:h,name:"key"})&&!v?"":"invalid"}`,name:"key",onChange:y=>c(y,h),type:"text",value:p.key}),u.jsx("p",{className:"requirements",role:"alert",children:T(v?N.ERROR_DUPLICATE_VARIABLE_KEY:N.ERROR_VARIABLE_KEY_REQUIRED)})]}),u.jsxs("label",{className:"mb-2 block",children:[T(N.VALUE),u.jsx("input",{className:`w-full ${d({index:h,name:"value"})?"":"invalid"}`,name:"value",onChange:y=>c(y,h),type:"text",value:p.value}),u.jsx("p",{className:"requirements",role:"alert",children:T(N.ERROR_TEXT_IS_REQUIRED)})]})]})]})]},p.id)})}),u.jsx("div",{className:"p-3 text-right",children:u.jsx("button",{className:"rounded bg-foreground/10 py-1 px-2 font-medium",onClick:s,type:"button",children:T(N.ADD_VARIABLE)})})]})},zL=(e,t)=>{w.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])},X0=e=>{const[t,n]=w.useReducer((r,o)=>({...r,...o}),e);return[t,n]},WL=e=>({id:ie(),key:e}),GL=({nodeData:e,handleOnUpdate:t})=>{const i={currentFocus:void 0,listOpen:!1,setVariablesList:Y(y=>y.nodes).reduce((y,g)=>{if(g.type==="set"){const m=g.data.variables.map(_=>({id:_.id,key:_.key}));return[...y,...m]}else if(g.type==="unset")return[...y,...g.data.variables];return y},[]).reduce((y,g)=>(y.find(m=>m.key===g.key)||y.push(g),y),[]).map(y=>({...y,selected:!!e.variables.find(g=>g.key===y.key)})).sort((y,g)=>y.key.toLowerCase().localeCompare(g.key.toLowerCase()))},[s,a]=X0(i),l=y=>s.setVariablesList.map(g=>g.id===y?{...g,selected:!g.selected}:g),c=y=>{const g=s.setVariablesList.find(m=>m.id===y);if(!g)throw new Error("Variable not found");if(g.selected)d(g.id);else{const m=[...e.variables,WL(g.key)];a({setVariablesList:l(g.id)}),t({variables:m})}},d=y=>{const g=s.setVariablesList.filter(m=>m.selected&&m.id!==y);a({setVariablesList:l(y)}),t({variables:g})},f=w.useRef(null);zL(f,()=>a({listOpen:!1}));const p=y=>{(y.key==="Escape"||y.key==="Esc")&&a({listOpen:!1})},h=(y,g)=>{y.preventDefault(),(y.key===" "||y.code==="Space"||y.key==="Enter")&&c(g),p(y)},E=()=>{a({listOpen:!s.listOpen})},v=e.variables.length;return u.jsx(Ze,{title:T(N.UNSET_VARIABLES),children:u.jsxs("div",{className:"px-3",children:[u.jsxs("div",{className:"mb-2 flex flex-col",children:[u.jsx("label",{id:"listbox-label",className:"sr-only",children:T(N.SELECT_VARIABLES_TO_UNSET)}),u.jsxs("div",{className:"relative",ref:f,children:[u.jsx("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
68
+ after:absolute after:top-[.725rem] after:right-3 after:h-0 after:w-0 after:border-[5px] after:border-t-[6px] after:border-b-0 after:border-r-transparent after:border-l-transparent after:border-t-foreground after:content-['']`,onClick:E,onKeyDown:p,type:"button",children:v>0?T(N.NUMBER_OF_VARIABLES_SELECTED,{count:v}):T(N.SELECT_VARIABLES)}),s.listOpen&&u.jsxs("ul",{"aria-activedescendant":s.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:[!s.setVariablesList.length&&u.jsx("li",{"aria-disabled":"true",className:"relative",role:"option",children:u.jsx("label",{className:"flex select-none items-center py-2 pl-3 pr-9",children:T(N.NO_VARIABLES_SET)})}),s.setVariablesList.map(y=>{if(y.key)return u.jsx("li",{"aria-selected":y.selected,className:"relative",id:y.id,role:"option",children:u.jsxs("label",{className:"flex select-none items-center py-2 pl-3 pr-9",children:[u.jsx("input",{checked:y.selected,className:"mr-2 h-4 w-4 rounded accent-primary",onChange:()=>c(y.id),onKeyDown:g=>h(g,y.id),type:"checkbox"}),y.key]})},y.id)})]})]})]}),v>0&&u.jsxs("section",{className:"pt-3",children:[u.jsx("h3",{className:"mb-2 text-xs font-medium text-foreground",children:T(N.UNSET_VARIABLES)}),u.jsx("ul",{className:"flex flex-wrap gap-2",children:s.setVariablesList.map(y=>y.selected&&u.jsx(Qb,{handleClick:()=>d(y.id),children:y.key},y.id))})]})]})})},q0={aiAgent:({data:e,formUpdate:t})=>u.jsx(wL,{handleOnUpdate:t,nodeData:e}),cond:({data:e,formUpdate:t})=>u.jsx(AL,{handleOnUpdate:t,nodeData:e}),condRequest:({data:e,formUpdate:t})=>u.jsx(TL,{handleOnUpdate:t,nodeData:e}),executeSWML:({data:e,formUpdate:t})=>u.jsx(IL,{handleOnUpdate:t,nodeData:e}),forwardAddress:({data:e,formUpdate:t})=>u.jsx(zf,{handleOnUpdate:t,nodeData:e,nodeType:"forwardAddress"}),forwardPhone:({data:e,formUpdate:t})=>u.jsx(zf,{handleOnUpdate:t,nodeData:e,nodeType:"forwardPhone"}),forwardResource:({data:e,formUpdate:t})=>u.jsx(zf,{handleOnUpdate:t,nodeData:e,nodeType:"forwardResource"}),hangup:({data:e,formUpdate:t})=>u.jsx(kL,{handleOnUpdate:t,nodeData:e}),play:({data:e,formUpdate:t})=>u.jsx(PL,{handleOnUpdate:t,nodeData:e}),promptPlay:({data:e,formUpdate:t})=>u.jsx(DL,{handleOnUpdate:t,nodeData:e}),record:({data:e,formUpdate:t})=>u.jsx(UL,{handleOnUpdate:t,nodeData:e}),recordCallStart:({data:e,formUpdate:t})=>u.jsx(ML,{handleOnUpdate:t,nodeData:e}),recordCallStop:({data:e,formUpdate:t})=>u.jsx(jL,{handleOnUpdate:t,nodeData:e}),request:({data:e,formUpdate:t})=>u.jsx(VL,{handleOnUpdate:t,nodeData:e}),sendSms:({data:e,formUpdate:t})=>u.jsx($L,{handleOnUpdate:t,nodeData:e}),set:({data:e,formUpdate:t})=>u.jsx(HL,{handleOnUpdate:t,nodeData:e}),unset:({data:e,formUpdate:t})=>u.jsx(GL,{handleOnUpdate:t,nodeData:e})},YL=(e,t)=>{if("options"in t)switch(e.type){case"promptPlay":case"cond":case"condRequest":return!0}return!1},KL=e=>{if(e in q0)return q0[e]},QL=()=>{var c;const{partialUpdateNodeData:e,removeNode:t}=xe(),n=Y(d=>d.selectedNode),r=n==null?void 0:n.id,i=(c=Y(d=>d.nodes).find(d=>d.id===r))==null?void 0:c.data,{updateDynamicHandles:s}=gL(n);if(!(n&&i&&r))return null;const a=d=>{YL(n,d)&&s(d),e(r,d)},l=KL(n.type);return l?u.jsxs(ns,{className:"nokey m-0 flex h-full w-[260px] flex-col overflow-hidden rounded-none border border-foreground/10 bg-background pt-4",position:"top-right",children:[u.jsx(l,{data:i,formUpdate:a},r),n.deletable!==!1&&u.jsx("div",{className:"border-t border-foreground/10 p-3",children:u.jsx(Bo,{handleDelete:()=>t(r),label:T(N.DELETE_NODE),show:!0,showLabel:!0})})]}):null},J0=w.forwardRef(function({animate:t=!0,children:n,className:r="",iconTag:o="circle-info",message:i,role:s="alertdialog",status:a},l){const d=a?{error:"bg-negative text-background",success:"bg-positive text-background"}[a]:"";return u.jsxs("div",{className:`flex items-center justify-between rounded-lg bg-foreground p-2
69
69
  text-background shadow-lg transition-[box-shadow] hover:shadow-none
70
- ${d} ${t?"animate-from-bottom":""} ${r}`,ref:l,role:s,children:[u.jsxs("div",{className:"flex items-center justify-center gap-x-2",children:[u.jsx(te,{className:"flex-shrink-0 self-start",tag:o}),u.jsx("p",{className:"text-xs font-semibold",children:i})]}),n]})}),XL=()=>{const{addToast:e,restoreDeployedFlow:t,cancelDetachedMode:n}=Se();if(!Y(s=>s.showDeployedHistoryToast))return null;const o=()=>{t(),e({message:A(w.VERSION_RESTORED),status:"success"})},i=()=>{n()};return u.jsx(Z0,{animate:!1,className:"gap-x-14",message:A(w.PREVIEW_DEPLOYED_VERSION),role:"dialog",children:u.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-x-2 gap-y-1",children:[u.jsx("button",{className:"rounded bg-primary px-1.5 py-0.5 text-xs font-medium text-background transition-colors hover:bg-primary/90",onClick:o,children:A(w.RESTORE_THIS_VERSION)}),u.jsx("button",{className:"rounded bg-secondary/50 px-1.5 py-0.5 text-xs font-medium text-background transition-colors hover:bg-secondary/40",onClick:i,children:A(w.CANCEL)})]})})},e_=({onKeyPress:e})=>{const t=Do(["Escape","Esc"]);return N.useEffect(()=>{t&&typeof e=="function"&&e()},[t,e]),{isPressed:t}},qL={offset:[0,.5,1],opacity:[1,0,0],pointerEvents:["none","none","auto"],transform:["scale(1.1) translateY(0%)","scale(0.5) translateY(-100%)"]},JL={duration:zA*2,easing:"ease-in-out",fill:"forwards"},ZL=({durationMs:e,id:t,permanent:n})=>{const r=e??WA,[o,i]=N.useState(null),{deleteToast:s}=Se(),a=N.useCallback(()=>{let l;const c=()=>s(t);return o instanceof HTMLElement?(l=o.animate(qL,JL),l.addEventListener("finish",c,{once:!0})):c(),()=>l==null?void 0:l.removeEventListener("finish",c)},[t,s,o]);return e_({onKeyPress:a}),N.useEffect(()=>{if(n)return;let l,c;const d=()=>{clearTimeout(l)},f=()=>{d(),l=setTimeout(()=>{c=a()},r)};return f(),o instanceof HTMLElement&&(o.addEventListener("mouseenter",d),o.addEventListener("mouseleave",f)),()=>{d(),o instanceof HTMLElement&&(o.removeEventListener("mouseenter",d),o.removeEventListener("mouseleave",f),c==null||c())}},[a,r,n,o]),{deleteToastCallback:a,setToastRef:i,toastRef:o}},t_=({durationMs:e,id:t,message:n,permanent:r,status:o})=>{const{deleteToastCallback:i,setToastRef:s}=ZL({durationMs:e,id:t,permanent:r});return u.jsx(Z0,{className:"w-full max-w-sm",iconTag:o==="success"?"circle-check":"circle-exclamation",message:n,ref:s,status:o,children:u.jsxs("button",{className:"flex-shrink-0 self-start opacity-40 transition-opacity hover:opacity-70",onClick:i,children:[u.jsx(te,{tag:"circle-xmark",size:"xl"}),u.jsx("span",{className:"sr-only",children:A(w.CLOSE)})]})})},eD={error:t_,success:t_},tD=()=>{const e=Y(n=>n.toastsMap);if(e.size===0)return null;const t=Array.from(e.values());return u.jsx("div",{className:"flex w-full flex-col items-center gap-y-1",children:t.map(n=>{const r=eD[n.status];return u.jsx(r,{durationMs:n.durationMs,id:n.id,message:n.message,permanent:n.permanent,status:n.status},n.id)})})},nD=({asRole:e="alert",open:t=!1,type:n="overlay"})=>{const[r,o]=Wr.useState(t);N.useEffect(()=>{o(t)},[t]);const i=N.useCallback(()=>o(!1),[]),s=N.useCallback(()=>o(!0),[]);return{asRole:e,closeContainer:i,isOpen:r,openContainer:s,type:n}},n_=N.createContext(null),Wf=()=>{const e=N.useContext(n_);if(e==null)throw new Error("Toast components must be wrapped in <ToastContainer />");return e},rD=({children:e,...t})=>{const n=nD(t);return u.jsx(n_.Provider,{value:n,children:e})},r_=({iconAs:e,title:t,children:n})=>{const{asRole:r}=Wf();return u.jsxs("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:r,children:[u.jsxs("h2",{className:"text-lg font-semibold leading-6 tracking-wide",children:[u.jsx("span",{className:"mr-2",children:u.jsx(te,{tag:e??"circle-exclamation"})}),t]}),u.jsx("div",{className:"mt-2 text-sm leading-5",children:n})]})},oD=({children:e})=>{const{closeContainer:t,isOpen:n,type:r}=Wf(),{getRootElement:o}=Se(),i=o(),s=N.useRef(null);return N.useEffect(()=>{if(!s.current)return;let a,l;const c=d=>{var f,p;if(d.key==="Escape"&&t(),d.key==="Tab"){const h=(p=(f=document.activeElement)==null?void 0:f.shadowRoot)==null?void 0:p.activeElement;d.shiftKey?h===a&&(l==null||l.focus(),d.preventDefault()):h===l&&(a==null||a.focus(),d.preventDefault())}};if(r==="overlay"){const d=s.current.querySelectorAll("button");a=d[0],l=d[d.length-1],l==null||l.focus(),document.addEventListener("keydown",c)}return()=>{document.removeEventListener("keydown",c)}},[t,r]),n?xo.createPortal(u.jsx("section",{className:`flex justify-center ${r==="overlay"?"fixed top-0 z-50 h-full w-full items-start px-6 py-36 backdrop-blur-sm backdrop-grayscale":"absolute top-10 left-1/2 z-10 -translate-x-1/2 translate-y-1/2 items-center"}`,ref:r==="overlay"?s:void 0,children:e}),i):null},o_=({asRole:e,open:t,children:n,type:r})=>u.jsx(rD,{asRole:e,open:t,type:r,children:u.jsx(oD,{children:n})}),iD=()=>{const t=Y(n=>n.httpError)===GE;return t?u.jsx(o_,{asRole:"dialog",open:t,type:"overlay",children:u.jsx(r_,{title:A(w.DOCUMENT_OUT_OF_SYNC),children:u.jsx(sD,{})})}):null},sD=()=>{const{closeContainer:e}=Wf(),t=()=>{window.location.reload()};return u.jsxs(u.Fragment,{children:[Fl(w.TOAST_DOCUMENT_OUT_OF_SYNC),u.jsxs("div",{className:"mt-11 flex items-center justify-center gap-x-6",children:[u.jsx("button",{className:"rounded-md border border-background bg-foreground px-3.5 py-2.5 font-bold tracking-widest text-background",onClick:e,children:A(w.IGNORE)}),u.jsx("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:A(w.RESYNC)})]})]})},aD=Ae(),lD=()=>{const e=Y(t=>t.showDeployWarning);return u.jsx(o_,{asRole:"dialog",open:e,type:"overlay",children:u.jsx(r_,{title:A(w.DEPLOY_WARNING),children:u.jsx(cD,{})})})},cD=()=>{const{deployFlow:e,setShowDeployWarning:t,setShowValidationWarnings:n}=Se(),r=()=>{t(!1),n(!0)},o=()=>{t(!1)},i=()=>{e().catch(s=>{aD.error(s)}),o()};return u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"mb-4",children:Fl(w.TOAST_DEPLOY_WARNING)}),u.jsx(Vy,{onClickListItem:r}),u.jsxs("div",{className:"mt-11 flex items-center justify-center gap-x-6",children:[u.jsx("button",{className:"rounded-md border border-background bg-foreground px-3.5 py-2.5 font-bold tracking-widest text-background",onClick:o,children:A(w.CANCEL)}),u.jsx("button",{className:"rounded-md border border-background bg-positive/70 px-3.5 py-2.5 font-bold tracking-widest text-background",onClick:i,children:A(w.DEPLOY)})]})]})},uD="react-flow__controls-button",dD="min-w-[3.625rem] cursor-auto select-auto text-center hover:bg-background active:bg-background",fD="hidden sm:flex",pD=N.forwardRef(function({asTag:t="div",children:n,className:r="",hiddenSmallScreen:o=!1,...i},s){const a=t,c=`${uD} ${a==="button"?"":dD} ${o?fD:""} ${r}`;return u.jsx(a,{className:c,ref:s,...i,children:n})}),hD=()=>{const e=Y(s=>s.showValidationWarnings),t=Y(s=>s.validationWarnings),n=Y(s=>s.detachedMode),{setShowValidationWarnings:r}=Se(),o=()=>r(!e),i=()=>{e&&r(!1)};return!t.size||n?(i(),null):u.jsx(sr,{onOpenChange:r,open:e,outsidePress:!1,placement:"bottom-start",role:"dialog",trigger:u.jsxs(pD,{className:"text-xs",asTag:"button",onClick:o,hiddenSmallScreen:!0,children:[A(w.WARNING),u.jsxs("div",{className:"flex items-center justify-center pl-1",children:[u.jsx("span",{className:"sr-only",children:A(w.MORE_INFO_STATUS_ERROR)}),u.jsx(te,{className:"text-warning",tag:"circle-exclamation"})]})]}),children:u.jsx(Vy,{children:u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("h2",{className:"text-xs font-semibold",children:[u.jsx(te,{className:"mr-1",tag:"circle-exclamation"}),A(w.CAUTION)]}),u.jsxs("button",{className:"my-0.5 rounded-md py-0.5 px-1.5",onClick:i,children:[u.jsx("span",{className:"sr-only",children:A(w.CLOSE)}),u.jsx(te,{tag:"xmark",size:"lg"})]})]})})})},gD=()=>{const e=Y(r=>r.isDraggingNode),t=Y(r=>r.showInteractiveControl),n=r=>{Y.setState({isInteractiveControlOn:r})};return u.jsx(AA,{className:`mt-2.5 rounded-[0.25rem] ${e?"group/control-buttons":""}`,position:"top-left",onInteractiveChange:n,showInteractive:t,children:u.jsx(hD,{})})},mD=".react-flow__panel",vD=16,i_={cursor:"no-drop",transform:"translate(0px, 0px) scale(1)",visibility:"hidden"},s_=e=>{const t=e.getBoundingClientRect();return{isCursorIntersecting:({clientX:n,clientY:r})=>t.top<=r&&t.bottom>=r&&t.left<=n&&t.right>=n}},ED=e=>{const t=e.querySelectorAll(mD);return Array.from(t).map(n=>s_(n).isCursorIntersecting)},yD=e=>({resetDragNodeStyles:()=>{Object.entries(i_).forEach(([t,n])=>{e.style[t]=n})},updateDragNodeStyles:({isOverDropTarget:t,scale:n,xPos:r,yPos:o})=>{e.style.visibility="visible",e.style.cursor=t?"grabbing":"no-drop",e.style.transform=`translate(${r}px, ${o}px) scale(${n})`}}),_D=({handleMouseMove:e,handleMouseUp:t,root:n})=>(n.addEventListener("mousemove",e),n.addEventListener("mouseup",t),{removeListeners:()=>{n.removeEventListener("mousemove",e),n.removeEventListener("mouseup",t)}}),SD=()=>{const e=N.useRef(null),t=Y(p=>p.dragNodeType),n=Y(p=>p.flowWrapperElement),r=Y(p=>p.viewport.zoom),{addNode:o,getRootElement:i,setDragNodeType:s}=Se(),a=i();if(N.useEffect(()=>{if(e.current&&t&&n&&a){let p=!1;const h=vD*r,v=e.current,E=s_(n).isCursorIntersecting,y=ED(n),{resetDragNodeStyles:g,updateDragNodeStyles:m}=yD(v),{removeListeners:_}=_D({handleMouseMove:S=>{const{clientX:x,clientY:R}=S,I=x-h,L=R-h;p=E({clientX:x,clientY:R})&&!y.some(U=>U({clientX:x,clientY:R})),m({isOverDropTarget:p,scale:p?r:1,xPos:I,yPos:L})},handleMouseUp:S=>{if(p){const x=n.getBoundingClientRect();o({nodeType:t,x:S.clientX-x.left-h,y:S.clientY-x.top-h})}s(void 0)},root:a});return()=>{_(),g()}}},[o,t,n,a,s,r]),!t)return null;const l=H0[t],c=ZE[t](),d=ie(),f={...c,initial:!1,valid:!0};return u.jsx(A0,{root:a,children:u.jsx("section",{className:"react-flow__node fixed left-0 top-0",ref:e,style:i_,children:u.jsx(l,{data:f,dragging:!0,id:d,isConnectable:!0,selected:!0,type:t,xPos:0,yPos:0,zIndex:0})})})};function a_(e,t){let n;try{n=e()}catch{return}return{getItem:o=>{var i;const s=l=>l===null?null:JSON.parse(l,t==null?void 0:t.reviver),a=(i=n.getItem(o))!=null?i:null;return a instanceof Promise?a.then(s):s(a)},setItem:(o,i)=>n.setItem(o,JSON.stringify(i,t==null?void 0:t.replacer)),removeItem:o=>n.removeItem(o)}}const ws=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return ws(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return ws(r)(n)}}}},xD=(e,t)=>(n,r,o)=>{let i={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:y=>y,version:0,merge:(y,g)=>({...g,...y}),...t},s=!1;const a=new Set,l=new Set;let c;try{c=i.getStorage()}catch{}if(!c)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 d=ws(i.serialize),f=()=>{const y=i.partialize({...r()});let g;const m=d({state:y,version:i.version}).then(_=>c.setItem(i.name,_)).catch(_=>{g=_});if(g)throw g;return m},p=o.setState;o.setState=(y,g)=>{p(y,g),f()};const h=e((...y)=>{n(...y),f()},r,o);let v;const E=()=>{var y;if(!c)return;s=!1,a.forEach(m=>m(r()));const g=((y=i.onRehydrateStorage)==null?void 0:y.call(i,r()))||void 0;return ws(c.getItem.bind(c))(i.name).then(m=>{if(m)return i.deserialize(m)}).then(m=>{if(m)if(typeof m.version=="number"&&m.version!==i.version){if(i.migrate)return i.migrate(m.state,m.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return m.state}).then(m=>{var _;return v=i.merge(m,(_=r())!=null?_:h),n(v,!0),f()}).then(()=>{g==null||g(v,void 0),s=!0,l.forEach(m=>m(v))}).catch(m=>{g==null||g(void 0,m)})};return o.persist={setOptions:y=>{i={...i,...y},y.getStorage&&(c=y.getStorage())},clearStorage:()=>{c==null||c.removeItem(i.name)},getOptions:()=>i,rehydrate:()=>E(),hasHydrated:()=>s,onHydrate:y=>(a.add(y),()=>{a.delete(y)}),onFinishHydration:y=>(l.add(y),()=>{l.delete(y)})},E(),v||h},RD=(e,t)=>(n,r,o)=>{let i={storage:a_(()=>localStorage),partialize:E=>E,version:0,merge:(E,y)=>({...y,...E}),...t},s=!1;const a=new Set,l=new Set;let c=i.storage;if(!c)return e((...E)=>{console.warn(`[zustand persist middleware] Unable to update item '${i.name}', the given storage is currently unavailable.`),n(...E)},r,o);const d=()=>{const E=i.partialize({...r()});return c.setItem(i.name,{state:E,version:i.version})},f=o.setState;o.setState=(E,y)=>{f(E,y),d()};const p=e((...E)=>{n(...E),d()},r,o);let h;const v=()=>{var E,y;if(!c)return;s=!1,a.forEach(m=>{var _;return m((_=r())!=null?_:p)});const g=((y=i.onRehydrateStorage)==null?void 0:y.call(i,(E=r())!=null?E:p))||void 0;return ws(c.getItem.bind(c))(i.name).then(m=>{if(m)if(typeof m.version=="number"&&m.version!==i.version){if(i.migrate)return i.migrate(m.state,m.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return m.state}).then(m=>{var _;return h=i.merge(m,(_=r())!=null?_:p),n(h,!0),d()}).then(()=>{g==null||g(h,void 0),h=r(),s=!0,l.forEach(m=>m(h))}).catch(m=>{g==null||g(void 0,m)})};return o.persist={setOptions:E=>{i={...i,...E},E.storage&&(c=E.storage)},clearStorage:()=>{c==null||c.removeItem(i.name)},getOptions:()=>i,rehydrate:()=>v(),hasHydrated:()=>s,onHydrate:E=>(a.add(E),()=>{a.delete(E)}),onFinishHydration:E=>(l.add(E),()=>{l.delete(E)})},i.skipHydration||v(),h||p},ND=(e,t)=>"getStorage"in t||"serialize"in t||"deserialize"in t?(console.warn("[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead."),xD(e,t)):RD(e,t),l_=window,c_={showAllNodes:!1,showDevOptions:!1},kr=us()(ND((e,t)=>({...c_,actions:{getFlagNames:()=>{const n=t();return Object.keys(n).filter(r=>r!=="actions")},toggleFlag:n=>e(r=>({...r,[n]:!r[n]}))}}),{name:"flags",partialize:e=>Object.fromEntries(Object.entries(e).filter(([t])=>t!=="actions")),storage:a_(()=>localStorage),version:0})),u_=()=>kr.getState().actions;kr.subscribe(e=>{console.log("feature flags changed",e)});const wD=e=>{const t=(r,o)=>{kr.setState(i=>({...i,[r]:o}))},n=r=>{const o=kr.getState(),i={...r};return Object.entries(o).forEach(([s,a])=>{s in i&&typeof a=="boolean"&&(i[s]=a)}),i};if(l_){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)}});l_.swFlags=r}},OD=()=>wD(c_),Hl={currentColor:{negative:"fill-current",primary:"fill-current"},light:{negative:"fill-negative",primary:"fill-primary"}},TD={"2xl":"w-[2em] h-[2em]","2xs":"w-[0.75em] h-[0.75em]",lg:"w-[1.25em] h-[1.25em]",md:"w-[1em] h-[1em]",sm:"w-[0.875em] h-[0.875em]",xl:"w-[1.5em] h-[1.5em]",xs:"w-[0.75em] h-[0.75em]"},AD=N.forwardRef(function({className:t="",size:n="md",type:r="light"},o){const i=TD[n];return u.jsxs("svg",{"aria-hidden":"true",className:`${i} ${t}`,focusable:"false",fill:"none",ref:o,role:"img",viewBox:"0 0 64 73",xmlns:"http://www.w3.org/2000/svg",children:[u.jsx("path",{d:"M63.9998 46.5209C63.9998 48.596 63.4369 49.9545 62.3171 51.0736C55.6065 57.7826 48.8931 64.4815 42.177 71.1703C39.841 73.495 36.4374 73.6097 34.1234 71.4843C31.6868 69.2442 31.5903 65.569 33.9726 63.1356C36.9983 60.0482 40.0681 57.003 43.132 53.9537C46.8137 50.2907 50.5034 46.6369 54.2012 42.9926C55.9925 41.2315 58.3929 40.7666 60.5902 41.7669C62.7876 42.7672 63.9315 44.5686 63.9998 46.5209Z",className:Hl[r].primary}),u.jsx("path",{d:"M0.000812669 25.3858C0.0329789 24.3372 0.589857 23.0088 1.68351 21.9159C8.37007 15.2378 15.058 8.56035 21.7472 1.88357C23.1384 0.492799 24.7789 -0.219695 26.739 0.0600696C29.061 0.402228 30.6834 1.69438 31.4393 3.92847C32.1952 6.16256 31.6725 8.18129 30.032 9.85183C26.8355 13.1003 23.5988 16.3166 20.3822 19.5329C16.868 23.0309 13.3444 26.5196 9.81152 29.9989C8.01423 31.762 5.61985 32.1947 3.41647 31.2307C1.27339 30.2988 -0.0373848 28.2438 0.000812669 25.3858Z",className:Hl[r].primary}),u.jsx("path",{d:"M4.59424 32.9836C5.35618 32.9494 5.98342 32.9675 6.60463 32.8849C8.18055 32.688 9.64041 31.953 10.738 30.8038C12.0206 29.4936 13.3093 28.1873 14.6241 26.8489C14.8714 27.0683 15.0262 27.191 15.1609 27.3279C20.1078 32.2791 25.054 37.2324 29.9995 42.1876C31.6219 43.8179 32.1909 45.7843 31.5395 47.9983C30.9123 50.1257 29.4507 51.4883 27.2835 51.9774C25.4078 52.398 23.6186 52.0398 22.2435 50.6751C16.3671 44.8484 10.551 38.9673 4.59424 32.9836Z",className:Hl[r].negative}),u.jsx("path",{d:"M59.4545 40.0944C56.4389 39.7865 54.2878 40.9519 52.4744 42.9585C51.4933 44.0454 50.4178 45.0477 49.3583 46.1164C49.1372 45.9152 48.9824 45.7964 48.8436 45.6555C43.8914 40.7003 38.9418 35.7464 33.9949 30.7938C32.3745 29.1635 31.8076 27.1931 32.4751 24.9791C33.1164 22.8537 34.5799 21.4951 36.7532 21.0181C38.6751 20.5955 40.4623 21.0181 41.8676 22.4109C47.6307 28.1229 53.3677 33.8571 59.0785 39.6134C59.163 39.6899 59.2273 39.7966 59.4545 40.0944Z",className:Hl[r].negative})]})}),ID={[w.FLOW_DATA_VERSION]:ds,[w.PKG_VERSION]:FA},bD=()=>{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=Wr.useRef(null);return u.jsxs(u.Fragment,{children:[u.jsxs("button",{className:"group flex items-center justify-center gap-x-2 text-foreground/50 transition-colors hover:text-foreground/70",onClick:e,children:[u.jsx(AD,{className:"text-foreground/40 transition-colors group-hover:text-foreground/50",size:"xl",type:"currentColor"}),u.jsx("span",{className:"text-xs font-semibold",children:A(w.ABOUT)})]}),u.jsx("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:u.jsxs("div",{className:"h-full px-2 pb-10",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("h2",{className:"text-2xl leading-10",children:A(w.ABOUT)}),u.jsxs("button",{className:"my-0.5 -mr-1.5 rounded-md py-0.5 px-1.5 ",onClick:t,children:[u.jsx("span",{className:"sr-only",children:A(w.CLOSE)}),u.jsx(te,{tag:"xmark",size:"lg"})]})]}),u.jsxs("div",{className:"h-full overflow-y-auto",children:[u.jsx("ul",{className:"mt-1 flex flex-col items-center justify-center text-sm",children:Object.entries(ID).map(([r,o])=>u.jsx("li",{className:"text-foreground/70",children:u.jsxs("p",{children:[A(r),": ",o]})},r))}),u.jsx("div",{className:"mt-6 flex items-center justify-center ",children:u.jsx("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:A(w.CLOSE)})})]})]})})]})},CD={deploy:w.STATUS_DEPLOY,deployed:w.STATUS_DEPLOYED,deploying:w.STATUS_DEPLOYING,error:w.STATUS_DEPLOY_ERROR},d_={deploy:"text-background border-hidden hover:bg-primary/90",deployed:"bg-background text-positive border-positive/20",deploying:"bg-background text-foreground/50 border-foreground/10",error:"bg-negative text-background border-hidden"},LD=()=>{const e=Y(m=>m.deployFlowStatus),t=Y(m=>m.deployFlowURL),n=Y(m=>m.detachedMode),r=Y(m=>m.documentVersion),o=Y(m=>m.httpError),i=Y(m=>m.saveFlowStatus),{deployFlow:s,getValidationWarnings:a,setShowDeployWarning:l}=Se(),c={error:void 0,prevDocVersion:r},[d,f]=q0(c),p=CD[e],h=async()=>{if(a().size>0)l(!0);else try{f({error:void 0}),await s()}catch(m){m instanceof Error?f({error:m.message}):f({error:"Failed to deploy!"})}};N.useEffect(()=>{i==="saved"&&r!==d.prevDocVersion&&f({prevDocVersion:r})},[d.prevDocVersion,r,i,f]);const v=i!=="saved"||e==="deployed"||e==="deploying",E=o==="document-sync"?d_.deploying:d_[e];let y="";e==="deploy"&&(y=i==="saved"?"bg-primary":"bg-focus");const g=`${y} ${E}`;return!t||n?null:u.jsxs("button",{"data-testid":"cfb__deploy-button",className:`flex items-center justify-center rounded border px-1.5 py-0.5
71
- text-xs font-medium transition-colors ${g}`,disabled:v,onClick:h,children:[A(p),u.jsx(sr,{placement:"right",trigger:u.jsx("span",{className:"flex items-center justify-center pl-1",role:"tooltip",tabIndex:0,children:e==="error"?u.jsx(te,{tag:"circle-exclamation"}):u.jsx(u.Fragment,{})}),children:e==="error"?A(w.MORE_INFO_DEPLOY_ERROR,{message:d.error}):A(w.MORE_INFO_DEPLOY)})]})},DD=()=>{const e=Y(t=>t.backButtonHref);return e?u.jsxs("a",{href:e,children:[u.jsx("span",{className:"sr-only",children:A(w.NAVIGATE_BACK)}),u.jsx(te,{tag:"arrow-left",className:"text-negative",size:"lg"})]}):null},kD=()=>{const e=Y(s=>s.showDeployedHistory),t=Y(s=>s.httpError==="document-sync"),{cancelDetachedMode:n,setShowDeployedHistory:r}=Se(),o=()=>{e?n():r(!0)},i=e?"text-background bg-foreground":"text-foreground bg-foreground/10";return u.jsx(sr,{placement:"top",trigger:u.jsxs("button",{className:`flex items-center justify-center rounded border border-transparent p-1 transition-colors ${i}`,disabled:t,onClick:o,type:"button",children:[u.jsx("span",{className:"sr-only",children:A(w.VERSION_HISTORY)}),u.jsx(te,{tag:"clock-rotate-left",size:"xs"})]}),children:A(w.VERSION_HISTORY)})},PD=({isDisabled:e,isSelected:t,itemIndex:n,onClick:r,onSelected:o,relativeTimeSince:i,version:s})=>{var f;const a=N.useRef(null),l=p=>{o(p)},c=()=>{t||(l(n),r(n))},d=p=>{p.preventDefault();const{key:h}=p;(h==="Enter"||h===" ")&&r(n),h==="ArrowUp"&&l(n-1),h==="ArrowDown"&&l(n+1)};return t&&((f=a.current)==null||f.focus()),u.jsx("li",{className:`border-l-2 transition-colors ${t?"border-l-primary/50 bg-primary/10":"border-l-transparent bg-background hover:bg-primary/5"}`,role:"presentation",children:u.jsxs("button",{"aria-selected":t?"true":"false",className:`flex w-full items-start gap-x-2 p-2 pr-4 ${e?"text-disabled":""}`,disabled:e,onClick:c,onKeyDown:d,type:"button",tabIndex:t?0:-1,ref:a,children:[u.jsx(te,{className:`p-1 ${t?"text-primary":"text-foreground/30"}`,tag:"dot-circle"}),u.jsxs("div",{className:"flex flex-col items-start justify-center",children:[u.jsx("h3",{className:"text-xs font-medium",children:A(w.VERSION_LIST_ITEM,{number:s})}),u.jsx("p",{className:"text-xxs",children:u.jsx("time",{children:i})})]})]})})},MD=200,f_=Ae(),jD=()=>{const e=Y(g=>g.deployedVersionsList),t=Y(g=>g.saveFlowStatus),n=Y(g=>g.showDeployedHistory),{cancelDetachedMode:r,getDeployedVersionsList:o,migrateAndLoadDeployedFlow:i}=Se();e_({onKeyPress:n?r:void 0});const s=N.useRef(),[a,l]=N.useState("loading"),[c,d]=N.useState(null);c!==null&&!n&&d(null);const f=N.useCallback(g=>{g>=0&&g<=e.length-1?d(g):d(null)},[e.length]),p=N.useCallback(g=>{var _;const m=(_=s.current)==null?void 0:_[g];m?(f_.info("load version",m.id),i(m)):f_.error("version not found")},[i]),h=N.useCallback(()=>{l("loading"),o({pageSize:MD}).then(g=>{l("loaded"),s.current=g}).catch(()=>{l("error"),s.current=void 0})},[o]);N.useLayoutEffect(()=>{n&&h()},[h,n]);const v=a==="error",E=e.length>0,y=t==="saved";return n?u.jsxs("div",{"data-testid":"cfb__deployed-versions-sidebar",className:"flex h-full flex-col py-3",children:[u.jsxs("section",{className:"flex items-center justify-between self-stretch px-4 pb-1",children:[u.jsxs("h2",{className:"flex items-center gap-1 text-tiny font-bold uppercase leading-none tracking-wide",children:[u.jsx(te,{className:"text-xs text-foreground/50",tag:"clock-rotate-left"}),A(w.VERSION_HISTORY)]}),u.jsxs("button",{className:"flex items-center justify-center px-0.5",onClick:r,type:"button",children:[u.jsx("span",{className:"sr-only",children:A(w.CLOSE)}),u.jsx(te,{tag:"xmark"})]})]}),u.jsxs("div",{className:`${E?"overflow-y-auto":"h-full"}`,children:[a!=="loaded"?u.jsxs("div",{className:`flex flex-col justify-center gap-y-4 p-4 text-sm leading-none tracking-wide text-foreground/50 ${E?"":"h-full"}`,children:[u.jsxs("div",{className:"flex flex-col items-center justify-center gap-y-2 gap-x-2",children:[v?u.jsx(te,{className:"text-negative",tag:"circle-exclamation"}):u.jsx(te,{className:"animate-spin",tag:"arrows-rotate"}),u.jsx("p",{"aria-live":v?"assertive":"polite",className:`${v?"text-negative":"font-bold uppercase text-foreground/50"}`,role:v?"alert":"status",children:A(v?w.ERROR_FETCHING_DEPLOYED_VERSIONS:w.STATUS_LOADING)})]}),v?u.jsx("div",{className:"flex w-full items-center justify-center",children:u.jsx("button",{className:"rounded border border-primary/50 bg-primary/10 px-3 py-1.5 text-sm font-bold leading-tight tracking-wider text-primary",onClick:h,type:"button",children:A(w.RESYNC)})}):null]}):null,!E&&a==="loaded"?u.jsx("div",{className:`flex h-full flex-col justify-center gap-y-4 p-4 text-sm leading-none tracking-wide text-foreground/50
72
- `,children:u.jsxs("div",{className:"flex flex-col items-center justify-center gap-y-2 gap-x-2",children:[u.jsx(te,{tag:"circle-exclamation"}),Fl(w.NO_DEPLOYED_VERSIONS)]})}):null,E?u.jsx("ol",{children:e.map((g,m)=>u.jsx(PD,{itemIndex:m,isDisabled:!y,isSelected:m===c,onClick:p,onSelected:f,relativeTimeSince:g.relativeTimeSince,version:g.version},g.id))}):null]})]}):null},UD=()=>{const{getFlagNames:e}=u_();return u.jsxs("div",{className:"rounded-sm border border-gray-200 p-2",children:[u.jsx("h3",{className:"w-full",children:"Feature Flags"}),u.jsx("div",{className:"flex flex-col gap-y-2 py-2",children:e().map(t=>u.jsx(FD,{flagName:t},t))})]})},FD=({flagName:e})=>{const{toggleFlag:t}=u_(),r=kr(o=>o[e])?"translate-x-5 bg-positive":"translate-x-0 bg-negative";return u.jsxs("label",{className:"flex cursor-pointer items-center",children:[u.jsxs("div",{className:"relative",children:[u.jsx("input",{type:"checkbox",className:"sr-only",onChange:()=>t(e)}),u.jsx("div",{className:"h-5 w-10 rounded-full bg-secondary/20",children:u.jsx("div",{className:`absolute left-1 top-1 h-3 w-3 rounded-full transition ${r}`})})]}),u.jsx("p",{className:"ml-3 text-sm font-medium",children:e})]})},VD=()=>{const[e,t]=N.useState(!1),n=()=>{t(r=>!r)};return u.jsx(sr,{open:e,onOpenChange:t,placement:"bottom",role:"dialog",trigger:u.jsxs("button",{className:"group flex items-center justify-center gap-x-2 text-foreground/50 transition-colors hover:text-foreground/70",onClick:n,children:[u.jsx(te,{className:"text-foreground/40 transition-colors group-hover:text-foreground/50",size:"xl",tag:"circle-question"}),u.jsxs("span",{className:"text-xs font-semibold",children:[A(w.HELP),u.jsx("span",{className:"sr-only",children:A(w.MORE_INFO_TESTING_YOUR_FLOW)})]})]}),children:u.jsxs("section",{className:"p-2",children:[u.jsx("h2",{className:"mb-4 text-2xl font-semibold",children:"Testing Your Call Flow"}),u.jsxs("div",{className:"text-sm",children:[u.jsx("p",{children:"To test the current working version (draft) of your Call Flow, follow these steps:"}),u.jsxs("ol",{className:"my-4 list-inside list-decimal",children:[u.jsxs("li",{className:"mb-2 list-item",children:["Go to the settings tab of the purchased phone number you want to use for testing:  ",u.jsx("a",{className:"underline hover:text-background/80",href:"/phone_numbers",target:"_blank",rel:"noopener noreferrer",children:"Purchased Phone Numbers"})]}),u.jsxs("li",{className:"mb-2",children:["Choose the appropriate Call Flow for handling your calls:  ",u.jsx("a",{className:"underline hover:text-background/80",href:"/call_flows",target:"_blank",rel:"noopener noreferrer",children:"Call Flows"})]}),u.jsx("li",{className:"mb-2",children:"Select the working version (draft) of the chosen Call Flow."}),u.jsx("li",{children:"When you make a call to the number, it should now execute the working version of your Call Flow upon answering."})]}),u.jsx("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."})]})]})})},$D=(e,t)=>({label:A(Vl[e].label),nodes:Object.entries(Vl[e].nodes).reduce((n,[r,o])=>(((typeof o.active=="boolean"?o.active:o.active[UA])||t)&&n.push({deprecated:!!o.deprecated,title:A(o.label),type:r}),n),[]).sort((n,r)=>n.title.localeCompare(r.title))}),p_=Ae(),BD=["action","forwardTo","recording","input","decision"],HD=()=>{const e=kr(s=>s.showAllNodes),t=Y(s=>s.isCanvasInteractive),{addNode:n,setDragNodeType:r}=Se(),o=N.useCallback(s=>{s.preventDefault();const{nodeType:a}=s.currentTarget.dataset;a?n({nodeType:a}):p_.error("No nodeType found on click event")},[n]),i=N.useCallback(s=>{s.preventDefault();const{nodeType:a}=s.currentTarget.dataset;a?r(a):p_.error("No nodeType found on drag event")},[r]);return u.jsx("ul",{className:"py-3 px-2",id:"sidebar-node-list",children:BD.map(s=>u.jsx("li",{children:u.jsx(zD,{enableNodeButtons:t,group:s,handleOnClick:o,handleDragStart:i,showAllNodes:e})},s))})},zD=({enableNodeButtons:e=!0,group:t,handleOnClick:n,handleDragStart:r,showAllNodes:o})=>{const i=$D(t,o),s=`ngm-heading-${XA(i.label)}`;return u.jsxs(u.Fragment,{children:[u.jsx("h2",{className:"px-2 pb-1 text-tiny font-bold uppercase tracking-wide text-foreground/50",id:s,children:i.label}),u.jsx("ul",{"aria-labelledby":s,className:"flex flex-1 flex-col gap-y-1 pb-2",children:i.nodes.map(a=>u.jsx("li",{children:u.jsxs("button",{className:`flex w-full items-start gap-2 rounded-lg border border-dashed border-transparent bg-primary/5 p-2 transition-colors
73
- hover:border-primary hover:bg-primary/20 enabled:hover:shadow-md`,"data-node-type":a.type,disabled:!e,draggable:e,onClick:e?n:void 0,onDragStart:e?r:void 0,children:[u.jsx(te,{tag:"circle-small",className:"text-primary"}),u.jsxs("span",{className:"text-left text-xs font-medium line-clamp-2",children:[a.title,a.deprecated&&u.jsxs("span",{className:"text-foreground/70",children:[" ",A(w.DEPRECATED)]})]})]})},a.type))})]})},WD=()=>{const{addToast:e,restoreDeployedFlow:t}=Se(),n=Y(o=>o.workingFlowCopy),r=()=>{t(),e({message:A(w.VERSION_RESTORED),status:"success"})};return n?u.jsx("button",{className:`flex items-center justify-center rounded border bg-primary px-1.5 py-0.5 text-xs font-medium
74
- text-background transition-colors hover:bg-primary/90`,onClick:r,children:A(w.RESTORE)}):null},GD={"awaiting-save":w.STATUS_SAVING,"document-sync":w.STATUS_LOCKED,error:w.STATUS_ERROR,initial:w.STATUS_LOADING,saved:w.STATUS_SAVED,saving:w.STATUS_SAVING},h_=e=>(e.preventDefault(),e.returnValue=""),g_=(e,t)=>e==="document-sync"?e:t,YD=()=>{const e=Y(p=>p.detachedMode),t=Y(p=>p.saveFlowStatus),n=Y(p=>p.httpError),[r,o]=N.useState(!0),[i,s]=N.useState(g_(n,t)),a=GD[i],l=t==="error"||n,c=g_(n,t),d=N.useRef(!1);N.useEffect(()=>{c==="initial"&&!d.current?(d.current=!0,s(c),o(!1),setTimeout(()=>{o(!0)},HA)):c!=="initial"&&r&&(d.current=!1,s(c))},[r,c]),N.useEffect(()=>{if(!(t==="saved"||n))return addEventListener("beforeunload",h_,{capture:!0}),()=>{removeEventListener("beforeunload",h_,{capture:!0})}},[n,t]);let f="";switch(!0){case l:f="px-1.5 py-0.5 bg-negative/20 text-negative";break;case i==="saved":f="text-foreground/50";break;default:f="px-1.5 py-0.5 bg-foreground/30 text-background"}return e?null:u.jsx("div",{"aria-live":l?"assertive":"polite","data-testid":"cfb__status",className:"flex",role:l?"alert":"status",children:u.jsxs("div",{className:`flex gap-x-1 rounded text-xxs ${f}`,children:[u.jsx("p",{children:a==="STATUS_SAVED"?u.jsx(KD,{}):A(a)}),l&&u.jsx(sr,{placement:"bottom",trigger:u.jsxs("div",{role:"tooltip",tabIndex:0,children:[u.jsx("span",{className:"sr-only",children:A(w.MORE_INFO_STATUS_ERROR)}),u.jsx(te,{tag:"circle-exclamation"})]}),children:A(n==="document-sync"?w.INFO_STATUS_ERROR_OUT_OF_SYNC:w.INFO_STATUS_ERROR)})]})})},KD=()=>{const e=Y(i=>i.documentLastUpdated),t=N.useCallback((i,...s)=>qE(L0(),{numeric:"always",style:"narrow"})(i,{excludeUnits:{second:!0},...s}),[]),n=e?t(e):void 0,[r,o]=N.useState(n);return N.useEffect(()=>{if(!e)return;const i=setInterval(()=>{o(t(e))},1e3);return()=>clearInterval(i)},[e,t]),u.jsxs(u.Fragment,{children:[A(w.SAVED)," ",u.jsx("time",{children:r})]})},QD=()=>{const e=kr(s=>s.showDevOptions),{exportStoreData:t}=Se(),n=Y(s=>s.flowTitle),r=Y(s=>s.showDeployedHistory),o=N.useRef(null),i=s=>{s.preventDefault(),o.current&&o.current.showModal()};return u.jsxs(u.Fragment,{children:[u.jsxs("section",{className:"hidden h-full w-1/6 min-w-[160px] shrink-0 flex-col bg-background text-foreground sm:flex",children:[u.jsxs("nav",{className:"flex shrink-0 items-center justify-between px-3 py-2",children:[u.jsx(DD,{}),e&&u.jsx("button",{className:"rounded bg-positive p-1 px-2 text-xs text-background",onClick:i,children:"Dev Options"})]}),u.jsx("section",{className:"px-2 py-2",children:u.jsxs("div",{className:"divide-y divide-foreground/10 rounded-lg border border-foreground/10",children:[u.jsx("h1",{className:"block w-full shrink-0 p-2 text-sm font-semibold leading-tight line-clamp-2",children:n||u.jsx(u.Fragment,{children:" "})}),u.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-x-1 gap-y-2 p-2",children:[u.jsx("div",{className:"flex-1",children:u.jsx(YD,{})}),u.jsxs("menu",{className:"flex items-center justify-center gap-x-1",children:[r?u.jsx(WD,{}):u.jsx(LD,{}),u.jsx(kD,{})]})]})]})}),u.jsxs("section",{className:"h-full overflow-y-auto",children:[r?null:u.jsx(HD,{}),u.jsx(jD,{})]}),u.jsx("section",{className:"flex flex-col items-start justify-center gap-y-5 px-2 pt-3 pb-4",children:u.jsxs("div",{className:"flex flex-col items-start justify-center gap-y-3 px-2",children:[u.jsx(bD,{}),u.jsx(VD,{})]})})]}),e&&u.jsx("dialog",{className:"z-50 my-10 rounded-lg border border-foreground/10 bg-background text-foreground",ref:o,children:u.jsx("form",{children:u.jsxs("fieldset",{children:[u.jsxs("legend",{className:"flex w-full justify-between pb-2",children:[u.jsx("h1",{className:"text-2xl leading-10",children:"Dev Options"}),u.jsxs("button",{className:"p-1 pt-0 font-semibold",formMethod:"dialog",children:[u.jsx("span",{className:"sr-only",children:"Close"}),u.jsx(te,{tag:"xmark",size:"lg"})]})]}),u.jsxs("div",{className:"mb-1 rounded-sm border border-gray-200 p-2",children:[u.jsx("h3",{className:"w-full",children:"Flow Data"}),u.jsx("div",{className:"flex flex-row gap-x-2 py-2",children:u.jsx("div",{className:"flex items-center",children:u.jsx("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:t,children:"View JSON File"})})})]}),u.jsx(UD,{})]})})})]})},XD=()=>{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]),{observerEntry:t,setTarget:o}},qD=({rootAppHeight:e,rootAppWidth:t})=>{Y.setState({rootAppHeight:e,rootAppWidth:t})},JD=()=>{const{observerEntry:e,setTarget:t}=XD();return N.useEffect(()=>{e&&(Ae().log("resized",{rootAppHeight:e.contentRect.height,rootAppWidth:e.contentRect.width}),qD({rootAppHeight:e.contentRect.height,rootAppWidth:e.contentRect.width}))},[e]),{rootTarget:t}},r4="";function ZD(){Ae().debug("Hello World!");const{rootTarget:e}=JD(),t=Y(o=>o.colorMode)??"",n=Y(o=>o.httpError),r=n!==void 0&&n!=="document-sync";return u.jsx(u.Fragment,{children:u.jsx("div",{className:`${t} flex h-full w-full bg-backgroundAlt text-foreground`,ref:e,children:r?u.jsx(PC,{errorType:n}):u.jsxs(u.Fragment,{children:[u.jsx(QD,{}),u.jsx(iD,{}),u.jsx(lD,{}),u.jsxs(Zd,{children:[u.jsx(pL,{}),u.jsxs(dL,{children:[u.jsxs(ns,{className:"z-50 m-0 mx-auto mt-2.5 flex w-full min-w-[320px] max-w-lg flex-col items-center gap-y-2 px-4",position:"top-center",children:[u.jsx(XL,{}),u.jsx(tD,{})]}),u.jsx(SD,{}),u.jsx(gD,{}),u.jsx(QL,{}),u.jsx(hL,{})]})]})]})})})}const e3=`@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")}@font-face{font-family:SWInter;font-style:normal;font-weight:500;font-display:swap;src:url(//cdn.signalwire.com/fonts/inter/Inter-Medium.woff2) format("woff2"),url(//cdn.signalwire.com/fonts/inter/Inter-Medium.woff) format("woff")}
75
- `,m_=Ae(),t3=e=>{if(!e||!e.getFlowURL||!e.updateFlowURL)throw new TypeError("Invalid or missing required params")};function n3(e){t3(e);const{getAiAgentsURL:t=`${window.location.origin}${oS}`,backButtonHref:n,rootElementId:r="sw-cfb-root",styleHref:o="https://cdn.swire.io/npm/@signalwire/cfb@dev/dist/style.css",voicesURL:i="https://cdn.signalwire.com/npm/@signalwire/cfb@dev/dist/voices.json",getFlowURL:s,updateFlowURL:a,deployFlowURL:l}=e;Hf.getState().actions.init({voicesURL:i}).catch(f=>{m_.error("Error initializing voices",f)});const c=document.getElementById(r);if(Y.setState({backButtonHref:n,deployFlowURL:l,getFlowURL:s,rootElement:c,rootElementId:r,updateFlowURL:a}),t&&un.getState().actions.init({getAiAgentsURL:t}),EC().catch(f=>{m_.error("Error initializing i18n",f)}),OD(),!c)throw new Error(`Id: '${r}' not found in the DOM`);c.attachShadow({mode:"open"}),c.shadowRoot&&rc.createRoot(c.shadowRoot).render(u.jsxs(N.StrictMode,{children:[u.jsx("link",{type:"text/css",rel:"stylesheet",href:o}),u.jsx(ZD,{})]}));const d=document.createElement("style");document.head.appendChild(d),d.appendChild(document.createTextNode(e3))}Hr.main=n3,Object.defineProperty(Hr,Symbol.toStringTag,{value:"Module"})});
70
+ ${d} ${t?"animate-from-bottom":""} ${r}`,ref:l,role:s,children:[u.jsxs("div",{className:"flex items-center justify-center gap-x-2",children:[u.jsx(te,{className:"flex-shrink-0 self-start",tag:o}),u.jsx("p",{className:"text-xs font-semibold",children:i})]}),n]})}),XL=()=>{const{addToast:e,restoreDeployedFlow:t,cancelDetachedMode:n}=xe();if(!Y(s=>s.showDeployedHistoryToast))return null;const o=()=>{t(),e({message:T(N.VERSION_RESTORED),status:"success"})},i=()=>{n()};return u.jsx(J0,{animate:!1,className:"gap-x-14",message:T(N.PREVIEW_DEPLOYED_VERSION),role:"dialog",children:u.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-x-2 gap-y-1",children:[u.jsx("button",{className:"rounded bg-primary px-1.5 py-0.5 text-xs font-medium text-background transition-colors hover:bg-primary/90",onClick:o,children:T(N.RESTORE_THIS_VERSION)}),u.jsx("button",{className:"rounded bg-secondary/50 px-1.5 py-0.5 text-xs font-medium text-background transition-colors hover:bg-secondary/40",onClick:i,children:T(N.CANCEL)})]})})},Z0=({onKeyPress:e})=>{const t=Do(["Escape","Esc"]);return w.useEffect(()=>{t&&typeof e=="function"&&e()},[t,e]),{isPressed:t}},qL={offset:[0,.5,1],opacity:[1,0,0],pointerEvents:["none","none","auto"],transform:["scale(1.1) translateY(0%)","scale(0.5) translateY(-100%)"]},JL={duration:zA*2,easing:"ease-in-out",fill:"forwards"},ZL=({durationMs:e,id:t,permanent:n})=>{const r=e??WA,[o,i]=w.useState(null),{deleteToast:s}=xe(),a=w.useCallback(()=>{let l;const c=()=>s(t);return o instanceof HTMLElement?(l=o.animate(qL,JL),l.addEventListener("finish",c,{once:!0})):c(),()=>l==null?void 0:l.removeEventListener("finish",c)},[t,s,o]);return Z0({onKeyPress:a}),w.useEffect(()=>{if(n)return;let l,c;const d=()=>{clearTimeout(l)},f=()=>{d(),l=setTimeout(()=>{c=a()},r)};return f(),o instanceof HTMLElement&&(o.addEventListener("mouseenter",d),o.addEventListener("mouseleave",f)),()=>{d(),o instanceof HTMLElement&&(o.removeEventListener("mouseenter",d),o.removeEventListener("mouseleave",f),c==null||c())}},[a,r,n,o]),{deleteToastCallback:a,setToastRef:i,toastRef:o}},e_=({durationMs:e,id:t,message:n,permanent:r,status:o})=>{const{deleteToastCallback:i,setToastRef:s}=ZL({durationMs:e,id:t,permanent:r});return u.jsx(J0,{className:"w-full max-w-sm",iconTag:o==="success"?"circle-check":"circle-exclamation",message:n,ref:s,status:o,children:u.jsxs("button",{className:"flex-shrink-0 self-start opacity-40 transition-opacity hover:opacity-70",onClick:i,children:[u.jsx(te,{tag:"circle-xmark",size:"xl"}),u.jsx("span",{className:"sr-only",children:T(N.CLOSE)})]})})},eD={error:e_,success:e_},tD=()=>{const e=Y(n=>n.toastsMap);if(e.size===0)return null;const t=Array.from(e.values());return u.jsx("div",{className:"flex w-full flex-col items-center gap-y-1",children:t.map(n=>{const r=eD[n.status];return u.jsx(r,{durationMs:n.durationMs,id:n.id,message:n.message,permanent:n.permanent,status:n.status},n.id)})})},nD=({asRole:e="alert",open:t=!1,type:n="overlay"})=>{const[r,o]=Wr.useState(t);w.useEffect(()=>{o(t)},[t]);const i=w.useCallback(()=>o(!1),[]),s=w.useCallback(()=>o(!0),[]);return{asRole:e,closeContainer:i,isOpen:r,openContainer:s,type:n}},t_=w.createContext(null),Wf=()=>{const e=w.useContext(t_);if(e==null)throw new Error("Toast components must be wrapped in <ToastContainer />");return e},rD=({children:e,...t})=>{const n=nD(t);return u.jsx(t_.Provider,{value:n,children:e})},n_=({iconAs:e,title:t,children:n})=>{const{asRole:r}=Wf();return u.jsxs("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:r,children:[u.jsxs("h2",{className:"text-lg font-semibold leading-6 tracking-wide",children:[u.jsx("span",{className:"mr-2",children:u.jsx(te,{tag:e??"circle-exclamation"})}),t]}),u.jsx("div",{className:"mt-2 text-sm leading-5",children:n})]})},oD=({children:e})=>{const{closeContainer:t,isOpen:n,type:r}=Wf(),{getRootElement:o}=xe(),i=o(),s=w.useRef(null);return w.useEffect(()=>{if(!s.current)return;let a,l;const c=d=>{var f,p;if(d.key==="Escape"&&t(),d.key==="Tab"){const h=(p=(f=document.activeElement)==null?void 0:f.shadowRoot)==null?void 0:p.activeElement;d.shiftKey?h===a&&(l==null||l.focus(),d.preventDefault()):h===l&&(a==null||a.focus(),d.preventDefault())}};if(r==="overlay"){const d=s.current.querySelectorAll("button");a=d[0],l=d[d.length-1],l==null||l.focus(),document.addEventListener("keydown",c)}return()=>{document.removeEventListener("keydown",c)}},[t,r]),n?xo.createPortal(u.jsx("section",{className:`flex justify-center ${r==="overlay"?"fixed top-0 z-50 h-full w-full items-start px-6 py-36 backdrop-blur-sm backdrop-grayscale":"absolute top-10 left-1/2 z-10 -translate-x-1/2 translate-y-1/2 items-center"}`,ref:r==="overlay"?s:void 0,children:e}),i):null},r_=({asRole:e,open:t,children:n,type:r})=>u.jsx(rD,{asRole:e,open:t,type:r,children:u.jsx(oD,{children:n})}),iD=()=>{const t=Y(n=>n.httpError)===Wv;return t?u.jsx(r_,{asRole:"dialog",open:t,type:"overlay",children:u.jsx(n_,{title:T(N.DOCUMENT_OUT_OF_SYNC),children:u.jsx(sD,{})})}):null},sD=()=>{const{closeContainer:e}=Wf(),t=()=>{window.location.reload()};return u.jsxs(u.Fragment,{children:[$l(N.TOAST_DOCUMENT_OUT_OF_SYNC),u.jsxs("div",{className:"mt-11 flex items-center justify-center gap-x-6",children:[u.jsx("button",{className:"rounded-md border border-background bg-foreground px-3.5 py-2.5 font-bold tracking-widest text-background",onClick:e,children:T(N.IGNORE)}),u.jsx("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:T(N.RESYNC)})]})]})},aD=Ie(),lD=()=>{const e=Y(t=>t.showDeployWarning);return u.jsx(r_,{asRole:"dialog",open:e,type:"overlay",children:u.jsx(n_,{title:T(N.DEPLOY_WARNING),children:u.jsx(cD,{})})})},cD=()=>{const{deployFlow:e,setShowDeployWarning:t,setShowValidationWarnings:n}=xe(),r=()=>{t(!1),n(!0)},o=()=>{t(!1)},i=()=>{e().catch(s=>{aD.error(s)}),o()};return u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"mb-4",children:$l(N.TOAST_DEPLOY_WARNING)}),u.jsx(Fy,{onClickListItem:r}),u.jsxs("div",{className:"mt-11 flex items-center justify-center gap-x-6",children:[u.jsx("button",{className:"rounded-md border border-background bg-foreground px-3.5 py-2.5 font-bold tracking-widest text-background",onClick:o,children:T(N.CANCEL)}),u.jsx("button",{className:"rounded-md border border-background bg-positive/70 px-3.5 py-2.5 font-bold tracking-widest text-background",onClick:i,children:T(N.DEPLOY)})]})]})},uD="react-flow__controls-button",dD="min-w-[3.625rem] cursor-auto select-auto text-center hover:bg-background active:bg-background",fD="hidden sm:flex",pD=w.forwardRef(function({asTag:t="div",children:n,className:r="",hiddenSmallScreen:o=!1,...i},s){const a=t,c=`${uD} ${a==="button"?"":dD} ${o?fD:""} ${r}`;return u.jsx(a,{className:c,ref:s,...i,children:n})}),hD=()=>{const e=Y(s=>s.showValidationWarnings),t=Y(s=>s.validationWarnings),n=Y(s=>s.detachedMode),{setShowValidationWarnings:r}=xe(),o=()=>r(!e),i=()=>{e&&r(!1)};return!t.size||n?(i(),null):u.jsx(sr,{onOpenChange:r,open:e,outsidePress:!1,placement:"bottom-start",role:"dialog",trigger:u.jsxs(pD,{className:"text-xs",asTag:"button",onClick:o,hiddenSmallScreen:!0,children:[T(N.WARNING),u.jsxs("div",{className:"flex items-center justify-center pl-1",children:[u.jsx("span",{className:"sr-only",children:T(N.MORE_INFO_STATUS_ERROR)}),u.jsx(te,{className:"text-warning",tag:"circle-exclamation"})]})]}),children:u.jsx(Fy,{children:u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("h2",{className:"text-xs font-semibold",children:[u.jsx(te,{className:"mr-1",tag:"circle-exclamation"}),T(N.CAUTION)]}),u.jsxs("button",{className:"my-0.5 rounded-md py-0.5 px-1.5",onClick:i,children:[u.jsx("span",{className:"sr-only",children:T(N.CLOSE)}),u.jsx(te,{tag:"xmark",size:"lg"})]})]})})})},gD=()=>{const e=Y(r=>r.isDraggingNode),t=Y(r=>r.showInteractiveControl),n=r=>{Y.setState({isInteractiveControlOn:r})};return u.jsx(TA,{className:`mt-2.5 rounded-[0.25rem] ${e?"group/control-buttons":""}`,position:"top-left",onInteractiveChange:n,showInteractive:t,children:u.jsx(hD,{})})},mD=".react-flow__panel",ED=16,o_={cursor:"no-drop",transform:"translate(0px, 0px) scale(1)",visibility:"hidden"},i_=e=>{const t=e.getBoundingClientRect();return{isCursorIntersecting:({clientX:n,clientY:r})=>t.top<=r&&t.bottom>=r&&t.left<=n&&t.right>=n}},vD=e=>{const t=e.querySelectorAll(mD);return Array.from(t).map(n=>i_(n).isCursorIntersecting)},yD=e=>({resetDragNodeStyles:()=>{Object.entries(o_).forEach(([t,n])=>{e.style[t]=n})},updateDragNodeStyles:({isOverDropTarget:t,scale:n,xPos:r,yPos:o})=>{e.style.visibility="visible",e.style.cursor=t?"grabbing":"no-drop",e.style.transform=`translate(${r}px, ${o}px) scale(${n})`}}),_D=({handleMouseMove:e,handleMouseUp:t,root:n})=>(n.addEventListener("mousemove",e),n.addEventListener("mouseup",t),{removeListeners:()=>{n.removeEventListener("mousemove",e),n.removeEventListener("mouseup",t)}}),SD=()=>{const e=w.useRef(null),t=Y(p=>p.dragNodeType),n=Y(p=>p.flowWrapperElement),r=Y(p=>p.viewport.zoom),{addNode:o,getRootElement:i,setDragNodeType:s}=xe(),a=i();if(w.useEffect(()=>{if(e.current&&t&&n&&a){let p=!1;const h=ED*r,E=e.current,v=i_(n).isCursorIntersecting,y=vD(n),{resetDragNodeStyles:g,updateDragNodeStyles:m}=yD(E),{removeListeners:_}=_D({handleMouseMove:S=>{const{clientX:x,clientY:R}=S,I=x-h,L=R-h;p=v({clientX:x,clientY:R})&&!y.some(U=>U({clientX:x,clientY:R})),m({isOverDropTarget:p,scale:p?r:1,xPos:I,yPos:L})},handleMouseUp:S=>{if(p){const x=n.getBoundingClientRect();o({nodeType:t,x:S.clientX-x.left-h,y:S.clientY-x.top-h})}s(void 0)},root:a});return()=>{_(),g()}}},[o,t,n,a,s,r]),!t)return null;const l=B0[t],c=Jv[t](),d=ie(),f={...c,initial:!1,valid:!0};return u.jsx(T0,{root:a,children:u.jsx("section",{className:"react-flow__node fixed left-0 top-0",ref:e,style:o_,children:u.jsx(l,{data:f,dragging:!0,id:d,isConnectable:!0,selected:!0,type:t,xPos:0,yPos:0,zIndex:0})})})};function s_(e,t){let n;try{n=e()}catch{return}return{getItem:o=>{var i;const s=l=>l===null?null:JSON.parse(l,t==null?void 0:t.reviver),a=(i=n.getItem(o))!=null?i:null;return a instanceof Promise?a.then(s):s(a)},setItem:(o,i)=>n.setItem(o,JSON.stringify(i,t==null?void 0:t.replacer)),removeItem:o=>n.removeItem(o)}}const Ts=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return Ts(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return Ts(r)(n)}}}},xD=(e,t)=>(n,r,o)=>{let i={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:y=>y,version:0,merge:(y,g)=>({...g,...y}),...t},s=!1;const a=new Set,l=new Set;let c;try{c=i.getStorage()}catch{}if(!c)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 d=Ts(i.serialize),f=()=>{const y=i.partialize({...r()});let g;const m=d({state:y,version:i.version}).then(_=>c.setItem(i.name,_)).catch(_=>{g=_});if(g)throw g;return m},p=o.setState;o.setState=(y,g)=>{p(y,g),f()};const h=e((...y)=>{n(...y),f()},r,o);let E;const v=()=>{var y;if(!c)return;s=!1,a.forEach(m=>m(r()));const g=((y=i.onRehydrateStorage)==null?void 0:y.call(i,r()))||void 0;return Ts(c.getItem.bind(c))(i.name).then(m=>{if(m)return i.deserialize(m)}).then(m=>{if(m)if(typeof m.version=="number"&&m.version!==i.version){if(i.migrate)return i.migrate(m.state,m.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return m.state}).then(m=>{var _;return E=i.merge(m,(_=r())!=null?_:h),n(E,!0),f()}).then(()=>{g==null||g(E,void 0),s=!0,l.forEach(m=>m(E))}).catch(m=>{g==null||g(void 0,m)})};return o.persist={setOptions:y=>{i={...i,...y},y.getStorage&&(c=y.getStorage())},clearStorage:()=>{c==null||c.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(),E||h},RD=(e,t)=>(n,r,o)=>{let i={storage:s_(()=>localStorage),partialize:v=>v,version:0,merge:(v,y)=>({...y,...v}),...t},s=!1;const a=new Set,l=new Set;let c=i.storage;if(!c)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 d=()=>{const v=i.partialize({...r()});return c.setItem(i.name,{state:v,version:i.version})},f=o.setState;o.setState=(v,y)=>{f(v,y),d()};const p=e((...v)=>{n(...v),d()},r,o);let h;const E=()=>{var v,y;if(!c)return;s=!1,a.forEach(m=>{var _;return m((_=r())!=null?_:p)});const g=((y=i.onRehydrateStorage)==null?void 0:y.call(i,(v=r())!=null?v:p))||void 0;return Ts(c.getItem.bind(c))(i.name).then(m=>{if(m)if(typeof m.version=="number"&&m.version!==i.version){if(i.migrate)return i.migrate(m.state,m.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return m.state}).then(m=>{var _;return h=i.merge(m,(_=r())!=null?_:p),n(h,!0),d()}).then(()=>{g==null||g(h,void 0),h=r(),s=!0,l.forEach(m=>m(h))}).catch(m=>{g==null||g(void 0,m)})};return o.persist={setOptions:v=>{i={...i,...v},v.storage&&(c=v.storage)},clearStorage:()=>{c==null||c.removeItem(i.name)},getOptions:()=>i,rehydrate:()=>E(),hasHydrated:()=>s,onHydrate:v=>(a.add(v),()=>{a.delete(v)}),onFinishHydration:v=>(l.add(v),()=>{l.delete(v)})},i.skipHydration||E(),h||p},ND=(e,t)=>"getStorage"in t||"serialize"in t||"deserialize"in t?xD(e,t):RD(e,t),a_=window,l_={showAllNodes:!1,showDevOptions:!1},kr=us()(ND((e,t)=>({...l_,actions:{getFlagNames:()=>{const n=t();return Object.keys(n).filter(r=>r!=="actions")},toggleFlag:n=>e(r=>({...r,[n]:!r[n]}))}}),{name:"flags",partialize:e=>Object.fromEntries(Object.entries(e).filter(([t])=>t!=="actions")),storage:s_(()=>localStorage),version:0})),c_=()=>kr.getState().actions;kr.subscribe(e=>{console.log("feature flags changed",e)});const wD=e=>{const t=(r,o)=>{kr.setState(i=>({...i,[r]:o}))},n=r=>{const o=kr.getState(),i={...r};return Object.entries(o).forEach(([s,a])=>{s in i&&typeof a=="boolean"&&(i[s]=a)}),i};if(a_){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)}});a_.swFlags=r}},OD=()=>wD(l_),Wl={currentColor:{negative:"fill-current",primary:"fill-current"},light:{negative:"fill-negative",primary:"fill-primary"}},TD={"2xl":"w-[2em] h-[2em]","2xs":"w-[0.75em] h-[0.75em]",lg:"w-[1.25em] h-[1.25em]",md:"w-[1em] h-[1em]",sm:"w-[0.875em] h-[0.875em]",xl:"w-[1.5em] h-[1.5em]",xs:"w-[0.75em] h-[0.75em]"},AD=w.forwardRef(function({className:t="",size:n="md",type:r="light"},o){const i=TD[n];return u.jsxs("svg",{"aria-hidden":"true",className:`${i} ${t}`,focusable:"false",fill:"none",ref:o,role:"img",viewBox:"0 0 64 73",xmlns:"http://www.w3.org/2000/svg",children:[u.jsx("path",{d:"M63.9998 46.5209C63.9998 48.596 63.4369 49.9545 62.3171 51.0736C55.6065 57.7826 48.8931 64.4815 42.177 71.1703C39.841 73.495 36.4374 73.6097 34.1234 71.4843C31.6868 69.2442 31.5903 65.569 33.9726 63.1356C36.9983 60.0482 40.0681 57.003 43.132 53.9537C46.8137 50.2907 50.5034 46.6369 54.2012 42.9926C55.9925 41.2315 58.3929 40.7666 60.5902 41.7669C62.7876 42.7672 63.9315 44.5686 63.9998 46.5209Z",className:Wl[r].primary}),u.jsx("path",{d:"M0.000812669 25.3858C0.0329789 24.3372 0.589857 23.0088 1.68351 21.9159C8.37007 15.2378 15.058 8.56035 21.7472 1.88357C23.1384 0.492799 24.7789 -0.219695 26.739 0.0600696C29.061 0.402228 30.6834 1.69438 31.4393 3.92847C32.1952 6.16256 31.6725 8.18129 30.032 9.85183C26.8355 13.1003 23.5988 16.3166 20.3822 19.5329C16.868 23.0309 13.3444 26.5196 9.81152 29.9989C8.01423 31.762 5.61985 32.1947 3.41647 31.2307C1.27339 30.2988 -0.0373848 28.2438 0.000812669 25.3858Z",className:Wl[r].primary}),u.jsx("path",{d:"M4.59424 32.9836C5.35618 32.9494 5.98342 32.9675 6.60463 32.8849C8.18055 32.688 9.64041 31.953 10.738 30.8038C12.0206 29.4936 13.3093 28.1873 14.6241 26.8489C14.8714 27.0683 15.0262 27.191 15.1609 27.3279C20.1078 32.2791 25.054 37.2324 29.9995 42.1876C31.6219 43.8179 32.1909 45.7843 31.5395 47.9983C30.9123 50.1257 29.4507 51.4883 27.2835 51.9774C25.4078 52.398 23.6186 52.0398 22.2435 50.6751C16.3671 44.8484 10.551 38.9673 4.59424 32.9836Z",className:Wl[r].negative}),u.jsx("path",{d:"M59.4545 40.0944C56.4389 39.7865 54.2878 40.9519 52.4744 42.9585C51.4933 44.0454 50.4178 45.0477 49.3583 46.1164C49.1372 45.9152 48.9824 45.7964 48.8436 45.6555C43.8914 40.7003 38.9418 35.7464 33.9949 30.7938C32.3745 29.1635 31.8076 27.1931 32.4751 24.9791C33.1164 22.8537 34.5799 21.4951 36.7532 21.0181C38.6751 20.5955 40.4623 21.0181 41.8676 22.4109C47.6307 28.1229 53.3677 33.8571 59.0785 39.6134C59.163 39.6899 59.2273 39.7966 59.4545 40.0944Z",className:Wl[r].negative})]})}),ID={[N.FLOW_DATA_VERSION]:ds,[N.PKG_VERSION]:FA},bD=()=>{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=Wr.useRef(null);return u.jsxs(u.Fragment,{children:[u.jsxs("button",{className:"group flex items-center justify-center gap-x-2 text-foreground/50 transition-colors hover:text-foreground/70",onClick:e,children:[u.jsx(AD,{className:"text-foreground/40 transition-colors group-hover:text-foreground/50",size:"xl",type:"currentColor"}),u.jsx("span",{className:"text-xs font-semibold",children:T(N.ABOUT)})]}),u.jsx("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:u.jsxs("div",{className:"h-full px-2 pb-10",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("h2",{className:"text-2xl leading-10",children:T(N.ABOUT)}),u.jsxs("button",{className:"my-0.5 -mr-1.5 rounded-md py-0.5 px-1.5 ",onClick:t,children:[u.jsx("span",{className:"sr-only",children:T(N.CLOSE)}),u.jsx(te,{tag:"xmark",size:"lg"})]})]}),u.jsxs("div",{className:"h-full overflow-y-auto",children:[u.jsx("ul",{className:"mt-1 flex flex-col items-center justify-center text-sm",children:Object.entries(ID).map(([r,o])=>u.jsx("li",{className:"text-foreground/70",children:u.jsxs("p",{children:[T(r),": ",o]})},r))}),u.jsx("div",{className:"mt-6 flex items-center justify-center ",children:u.jsx("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:T(N.CLOSE)})})]})]})})]})},CD={deploy:N.STATUS_DEPLOY,deployed:N.STATUS_DEPLOYED,deploying:N.STATUS_DEPLOYING,error:N.STATUS_DEPLOY_ERROR},u_={deploy:"text-background border-hidden hover:bg-primary/90",deployed:"bg-background text-positive border-positive/20",deploying:"bg-background text-foreground/50 border-foreground/10",error:"bg-negative text-background border-hidden"},LD=()=>{const e=Y(m=>m.deployFlowStatus),t=Y(m=>m.deployFlowURL),n=Y(m=>m.detachedMode),r=Y(m=>m.documentVersion),o=Y(m=>m.httpError),i=Y(m=>m.saveFlowStatus),{deployFlow:s,getValidationWarnings:a,setShowDeployWarning:l}=xe(),c={error:void 0,prevDocVersion:r},[d,f]=X0(c),p=CD[e],h=async()=>{if(a().size>0)l(!0);else try{f({error:void 0}),await s()}catch(m){m instanceof Error?f({error:m.message}):f({error:"Failed to deploy!"})}};w.useEffect(()=>{i==="saved"&&r!==d.prevDocVersion&&f({prevDocVersion:r})},[d.prevDocVersion,r,i,f]);const E=i!=="saved"||e==="deployed"||e==="deploying",v=o==="document-sync"?u_.deploying:u_[e];let y="";e==="deploy"&&(y=i==="saved"?"bg-primary":"bg-focus");const g=`${y} ${v}`;return!t||n?null:u.jsxs("button",{"data-testid":"cfb__deploy-button",className:`flex items-center justify-center rounded border px-1.5 py-0.5
71
+ text-xs font-medium transition-colors ${g}`,disabled:E,onClick:h,children:[T(p),u.jsx(sr,{placement:"right",trigger:u.jsx("span",{className:"flex items-center justify-center pl-1",role:"tooltip",tabIndex:0,children:e==="error"?u.jsx(te,{tag:"circle-exclamation"}):u.jsx(u.Fragment,{})}),children:e==="error"?T(N.MORE_INFO_DEPLOY_ERROR,{message:d.error}):T(N.MORE_INFO_DEPLOY)})]})},DD=()=>{const e=Y(t=>t.backButtonHref);return e?u.jsxs("a",{href:e,children:[u.jsx("span",{className:"sr-only",children:T(N.NAVIGATE_BACK)}),u.jsx(te,{tag:"arrow-left",className:"text-negative",size:"lg"})]}):null},kD=()=>{const e=Y(s=>s.showDeployedHistory),t=Y(s=>s.httpError==="document-sync"),{cancelDetachedMode:n,setShowDeployedHistory:r}=xe(),o=()=>{e?n():r(!0)},i=e?"text-background bg-foreground":"text-foreground bg-foreground/10";return u.jsx(sr,{placement:"top",trigger:u.jsxs("button",{className:`flex items-center justify-center rounded border border-transparent p-1 transition-colors ${i}`,disabled:t,onClick:o,type:"button",children:[u.jsx("span",{className:"sr-only",children:T(N.VERSION_HISTORY)}),u.jsx(te,{tag:"clock-rotate-left",size:"xs"})]}),children:T(N.VERSION_HISTORY)})},PD=({isDisabled:e,isSelected:t,itemIndex:n,onClick:r,onSelected:o,relativeTimeSince:i,version:s})=>{var f;const a=w.useRef(null),l=p=>{o(p)},c=()=>{t||(l(n),r(n))},d=p=>{p.preventDefault();const{key:h}=p;(h==="Enter"||h===" ")&&r(n),h==="ArrowUp"&&l(n-1),h==="ArrowDown"&&l(n+1)};return t&&((f=a.current)==null||f.focus()),u.jsx("li",{className:`border-l-2 transition-colors ${t?"border-l-primary/50 bg-primary/10":"border-l-transparent bg-background hover:bg-primary/5"}`,role:"presentation",children:u.jsxs("button",{"aria-selected":t?"true":"false",className:`flex w-full items-start gap-x-2 p-2 pr-4 ${e?"text-disabled":""}`,disabled:e,onClick:c,onKeyDown:d,type:"button",tabIndex:t?0:-1,ref:a,children:[u.jsx(te,{className:`p-1 ${t?"text-primary":"text-foreground/30"}`,tag:"dot-circle"}),u.jsxs("div",{className:"flex flex-col items-start justify-center",children:[u.jsx("h3",{className:"text-xs font-medium",children:T(N.VERSION_LIST_ITEM,{number:s})}),u.jsx("p",{className:"text-xxs",children:u.jsx("time",{children:i})})]})]})})},MD=200,d_=Ie(),jD=()=>{const e=Y(g=>g.deployedVersionsList),t=Y(g=>g.saveFlowStatus),n=Y(g=>g.showDeployedHistory),{cancelDetachedMode:r,getDeployedVersionsList:o,migrateAndLoadDeployedFlow:i}=xe();Z0({onKeyPress:n?r:void 0});const s=w.useRef(),[a,l]=w.useState("loading"),[c,d]=w.useState(null);c!==null&&!n&&d(null);const f=w.useCallback(g=>{g>=0&&g<=e.length-1?d(g):d(null)},[e.length]),p=w.useCallback(g=>{var _;const m=(_=s.current)==null?void 0:_[g];m?(d_.info("load version",m.id),i(m)):d_.error("version not found")},[i]),h=w.useCallback(()=>{l("loading"),o({pageSize:MD}).then(g=>{l("loaded"),s.current=g}).catch(()=>{l("error"),s.current=void 0})},[o]);w.useLayoutEffect(()=>{n&&h()},[h,n]);const E=a==="error",v=e.length>0,y=t==="saved";return n?u.jsxs("div",{"data-testid":"cfb__deployed-versions-sidebar",className:"flex h-full flex-col py-3",children:[u.jsxs("section",{className:"flex items-center justify-between self-stretch px-4 pb-1",children:[u.jsxs("h2",{className:"flex items-center gap-1 text-tiny font-bold uppercase leading-none tracking-wide",children:[u.jsx(te,{className:"text-xs text-foreground/50",tag:"clock-rotate-left"}),T(N.VERSION_HISTORY)]}),u.jsxs("button",{className:"flex items-center justify-center px-0.5",onClick:r,type:"button",children:[u.jsx("span",{className:"sr-only",children:T(N.CLOSE)}),u.jsx(te,{tag:"xmark"})]})]}),u.jsxs("div",{className:`${v?"overflow-y-auto":"h-full"}`,children:[a!=="loaded"?u.jsxs("div",{className:`flex flex-col justify-center gap-y-4 p-4 text-sm leading-none tracking-wide text-foreground/50 ${v?"":"h-full"}`,children:[u.jsxs("div",{className:"flex flex-col items-center justify-center gap-y-2 gap-x-2",children:[E?u.jsx(te,{className:"text-negative",tag:"circle-exclamation"}):u.jsx(te,{className:"animate-spin",tag:"arrows-rotate"}),u.jsx("p",{"aria-live":E?"assertive":"polite",className:`${E?"text-negative":"font-bold uppercase text-foreground/50"}`,role:E?"alert":"status",children:T(E?N.ERROR_FETCHING_DEPLOYED_VERSIONS:N.STATUS_LOADING)})]}),E?u.jsx("div",{className:"flex w-full items-center justify-center",children:u.jsx("button",{className:"rounded border border-primary/50 bg-primary/10 px-3 py-1.5 text-sm font-bold leading-tight tracking-wider text-primary",onClick:h,type:"button",children:T(N.RESYNC)})}):null]}):null,!v&&a==="loaded"?u.jsx("div",{className:`flex h-full flex-col justify-center gap-y-4 p-4 text-sm leading-none tracking-wide text-foreground/50
72
+ `,children:u.jsxs("div",{className:"flex flex-col items-center justify-center gap-y-2 gap-x-2",children:[u.jsx(te,{tag:"circle-exclamation"}),$l(N.NO_DEPLOYED_VERSIONS)]})}):null,v?u.jsx("ol",{children:e.map((g,m)=>u.jsx(PD,{itemIndex:m,isDisabled:!y,isSelected:m===c,onClick:p,onSelected:f,relativeTimeSince:g.relativeTimeSince,version:g.version},g.id))}):null]})]}):null},UD=()=>{const{getFlagNames:e}=c_();return u.jsxs("div",{className:"rounded-sm border border-gray-200 p-2",children:[u.jsx("h3",{className:"w-full",children:"Feature Flags"}),u.jsx("div",{className:"flex flex-col gap-y-2 py-2",children:e().map(t=>u.jsx(FD,{flagName:t},t))})]})},FD=({flagName:e})=>{const{toggleFlag:t}=c_(),r=kr(o=>o[e])?"translate-x-5 bg-positive":"translate-x-0 bg-negative";return u.jsxs("label",{className:"flex cursor-pointer items-center",children:[u.jsxs("div",{className:"relative",children:[u.jsx("input",{type:"checkbox",className:"sr-only",onChange:()=>t(e)}),u.jsx("div",{className:"h-5 w-10 rounded-full bg-secondary/20",children:u.jsx("div",{className:`absolute left-1 top-1 h-3 w-3 rounded-full transition ${r}`})})]}),u.jsx("p",{className:"ml-3 text-sm font-medium",children:e})]})},VD=()=>{const[e,t]=w.useState(!1),n=()=>{t(r=>!r)};return u.jsx(sr,{open:e,onOpenChange:t,placement:"bottom",role:"dialog",trigger:u.jsxs("button",{className:"group flex items-center justify-center gap-x-2 text-foreground/50 transition-colors hover:text-foreground/70",onClick:n,children:[u.jsx(te,{className:"text-foreground/40 transition-colors group-hover:text-foreground/50",size:"xl",tag:"circle-question"}),u.jsxs("span",{className:"text-xs font-semibold",children:[T(N.HELP),u.jsx("span",{className:"sr-only",children:T(N.MORE_INFO_TESTING_YOUR_FLOW)})]})]}),children:u.jsxs("section",{className:"p-2",children:[u.jsx("h2",{className:"mb-4 text-2xl font-semibold",children:"Testing Your Call Flow"}),u.jsxs("div",{className:"text-sm",children:[u.jsx("p",{children:"To test the current working version (draft) of your Call Flow, follow these steps:"}),u.jsxs("ol",{className:"my-4 list-inside list-decimal",children:[u.jsxs("li",{className:"mb-2 list-item",children:["Go to the settings tab of the purchased phone number you want to use for testing:  ",u.jsx("a",{className:"underline hover:text-background/80",href:"/phone_numbers",target:"_blank",rel:"noopener noreferrer",children:"Purchased Phone Numbers"})]}),u.jsxs("li",{className:"mb-2",children:["Choose the appropriate Call Flow for handling your calls:  ",u.jsx("a",{className:"underline hover:text-background/80",href:"/call_flows",target:"_blank",rel:"noopener noreferrer",children:"Call Flows"})]}),u.jsx("li",{className:"mb-2",children:"Select the working version (draft) of the chosen Call Flow."}),u.jsx("li",{children:"When you make a call to the number, it should now execute the working version of your Call Flow upon answering."})]}),u.jsx("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."})]})]})})},$D=(e,t)=>({label:T(Bl[e].label),nodes:Object.entries(Bl[e].nodes).reduce((n,[r,o])=>(((typeof o.active=="boolean"?o.active:o.active[UA])||t)&&n.push({deprecated:!!o.deprecated,title:T(o.label),type:r}),n),[]).sort((n,r)=>n.title.localeCompare(r.title))}),f_=Ie(),BD=["action","forwardTo","recording","input","decision"],HD=()=>{const e=kr(s=>s.showAllNodes),t=Y(s=>s.isCanvasInteractive),{addNode:n,setDragNodeType:r}=xe(),o=w.useCallback(s=>{s.preventDefault();const{nodeType:a}=s.currentTarget.dataset;a?n({nodeType:a}):f_.error("No nodeType found on click event")},[n]),i=w.useCallback(s=>{s.preventDefault();const{nodeType:a}=s.currentTarget.dataset;a?r(a):f_.error("No nodeType found on drag event")},[r]);return u.jsx("ul",{className:"py-3 px-2",id:"sidebar-node-list",children:BD.map(s=>u.jsx("li",{children:u.jsx(zD,{enableNodeButtons:t,group:s,handleOnClick:o,handleDragStart:i,showAllNodes:e})},s))})},zD=({enableNodeButtons:e=!0,group:t,handleOnClick:n,handleDragStart:r,showAllNodes:o})=>{const i=$D(t,o),s=`ngm-heading-${XA(i.label)}`;return u.jsxs(u.Fragment,{children:[u.jsx("h2",{className:"px-2 pb-1 text-tiny font-bold uppercase tracking-wide text-foreground/50",id:s,children:i.label}),u.jsx("ul",{"aria-labelledby":s,className:"flex flex-1 flex-col gap-y-1 pb-2",children:i.nodes.map(a=>u.jsx("li",{children:u.jsxs("button",{className:`flex w-full items-start gap-2 rounded-lg border border-dashed border-transparent bg-primary/5 p-2 transition-colors
73
+ hover:border-primary hover:bg-primary/20 enabled:hover:shadow-md`,"data-node-type":a.type,disabled:!e,draggable:e,onClick:e?n:void 0,onDragStart:e?r:void 0,children:[u.jsx(te,{tag:"circle-small",className:"text-primary"}),u.jsxs("span",{className:"text-left text-xs font-medium line-clamp-2",children:[a.title,a.deprecated&&u.jsxs("span",{className:"text-foreground/70",children:[" ",T(N.DEPRECATED)]})]})]})},a.type))})]})},WD=()=>{const{addToast:e,restoreDeployedFlow:t}=xe(),n=Y(o=>o.workingFlowCopy),r=()=>{t(),e({message:T(N.VERSION_RESTORED),status:"success"})};return n?u.jsx("button",{className:`flex items-center justify-center rounded border bg-primary px-1.5 py-0.5 text-xs font-medium
74
+ text-background transition-colors hover:bg-primary/90`,onClick:r,children:T(N.RESTORE)}):null},GD={"awaiting-save":N.STATUS_SAVING,"document-sync":N.STATUS_LOCKED,error:N.STATUS_ERROR,initial:N.STATUS_LOADING,saved:N.STATUS_SAVED,saving:N.STATUS_SAVING},p_=e=>(e.preventDefault(),e.returnValue=""),h_=(e,t)=>e==="document-sync"?e:t,YD=()=>{const e=Y(p=>p.detachedMode),t=Y(p=>p.saveFlowStatus),n=Y(p=>p.httpError),[r,o]=w.useState(!0),[i,s]=w.useState(h_(n,t)),a=GD[i],l=t==="error"||n,c=h_(n,t),d=w.useRef(!1);w.useEffect(()=>{c==="initial"&&!d.current?(d.current=!0,s(c),o(!1),setTimeout(()=>{o(!0)},HA)):c!=="initial"&&r&&(d.current=!1,s(c))},[r,c]),w.useEffect(()=>{if(!(t==="saved"||n))return addEventListener("beforeunload",p_,{capture:!0}),()=>{removeEventListener("beforeunload",p_,{capture:!0})}},[n,t]);let f="";switch(!0){case l:f="px-1.5 py-0.5 bg-negative/20 text-negative";break;case i==="saved":f="text-foreground/50";break;default:f="px-1.5 py-0.5 bg-foreground/30 text-background"}return e?null:u.jsx("div",{"aria-live":l?"assertive":"polite","data-testid":"cfb__status",className:"flex",role:l?"alert":"status",children:u.jsxs("div",{className:`flex gap-x-1 rounded text-xxs ${f}`,children:[u.jsx("p",{children:a==="STATUS_SAVED"?u.jsx(KD,{}):T(a)}),l&&u.jsx(sr,{placement:"bottom",trigger:u.jsxs("div",{role:"tooltip",tabIndex:0,children:[u.jsx("span",{className:"sr-only",children:T(N.MORE_INFO_STATUS_ERROR)}),u.jsx(te,{tag:"circle-exclamation"})]}),children:T(n==="document-sync"?N.INFO_STATUS_ERROR_OUT_OF_SYNC:N.INFO_STATUS_ERROR)})]})})},KD=()=>{const e=Y(i=>i.documentLastUpdated),t=w.useCallback((i,...s)=>Xv(C0(),{numeric:"always",style:"narrow"})(i,{excludeUnits:{second:!0},...s}),[]),n=e?t(e):void 0,[r,o]=w.useState(n);return w.useEffect(()=>{if(!e)return;const i=setInterval(()=>{o(t(e))},1e3);return()=>clearInterval(i)},[e,t]),u.jsxs(u.Fragment,{children:[T(N.SAVED)," ",u.jsx("time",{children:r})]})},QD=()=>{const e=kr(s=>s.showDevOptions),{exportStoreData:t}=xe(),n=Y(s=>s.flowTitle),r=Y(s=>s.showDeployedHistory),o=w.useRef(null),i=s=>{s.preventDefault(),o.current&&o.current.showModal()};return u.jsxs(u.Fragment,{children:[u.jsxs("section",{className:"hidden h-full w-1/6 min-w-[160px] shrink-0 flex-col bg-background text-foreground sm:flex",children:[u.jsxs("nav",{className:"flex shrink-0 items-center justify-between px-3 py-2",children:[u.jsx(DD,{}),e&&u.jsx("button",{className:"rounded bg-positive p-1 px-2 text-xs text-background",onClick:i,children:"Dev Options"})]}),u.jsx("section",{className:"px-2 py-2",children:u.jsxs("div",{className:"divide-y divide-foreground/10 rounded-lg border border-foreground/10",children:[u.jsx("h1",{className:"block w-full shrink-0 p-2 text-sm font-semibold leading-tight line-clamp-2",children:n||u.jsx(u.Fragment,{children:" "})}),u.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-x-1 gap-y-2 p-2",children:[u.jsx("div",{className:"flex-1",children:u.jsx(YD,{})}),u.jsxs("menu",{className:"flex items-center justify-center gap-x-1",children:[r?u.jsx(WD,{}):u.jsx(LD,{}),u.jsx(kD,{})]})]})]})}),u.jsxs("section",{className:"h-full overflow-y-auto",children:[r?null:u.jsx(HD,{}),u.jsx(jD,{})]}),u.jsx("section",{className:"flex flex-col items-start justify-center gap-y-5 px-2 pt-3 pb-4",children:u.jsxs("div",{className:"flex flex-col items-start justify-center gap-y-3 px-2",children:[u.jsx(bD,{}),u.jsx(VD,{})]})})]}),e&&u.jsx("dialog",{className:"z-50 my-10 rounded-lg border border-foreground/10 bg-background text-foreground",ref:o,children:u.jsx("form",{children:u.jsxs("fieldset",{children:[u.jsxs("legend",{className:"flex w-full justify-between pb-2",children:[u.jsx("h1",{className:"text-2xl leading-10",children:"Dev Options"}),u.jsxs("button",{className:"p-1 pt-0 font-semibold",formMethod:"dialog",children:[u.jsx("span",{className:"sr-only",children:"Close"}),u.jsx(te,{tag:"xmark",size:"lg"})]})]}),u.jsxs("div",{className:"mb-1 rounded-sm border border-gray-200 p-2",children:[u.jsx("h3",{className:"w-full",children:"Flow Data"}),u.jsx("div",{className:"flex flex-row gap-x-2 py-2",children:u.jsx("div",{className:"flex items-center",children:u.jsx("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:t,children:"View JSON File"})})})]}),u.jsx(UD,{})]})})})]})},XD=()=>{const e=w.useRef(null),[t,n]=w.useState(),[r,o]=w.useState(null);return w.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]),{observerEntry:t,setTarget:o}},qD=({rootAppHeight:e,rootAppWidth:t})=>{Y.setState({rootAppHeight:e,rootAppWidth:t})},JD=()=>{const{observerEntry:e,setTarget:t}=XD();return w.useEffect(()=>{e&&(Ie().log("resized",{rootAppHeight:e.contentRect.height,rootAppWidth:e.contentRect.width}),qD({rootAppHeight:e.contentRect.height,rootAppWidth:e.contentRect.width}))},[e]),{rootTarget:t}},s4="";function ZD(){Ie().debug("Hello World!");const{rootTarget:e}=JD(),t=Y(o=>o.colorMode)??"",n=Y(o=>o.httpError),r=n!==void 0&&n!=="document-sync";return u.jsx(u.Fragment,{children:u.jsx("div",{className:`${t} flex h-full w-full bg-backgroundAlt text-foreground`,ref:e,children:r?u.jsx(PC,{errorType:n}):u.jsxs(u.Fragment,{children:[u.jsx(QD,{}),u.jsx(iD,{}),u.jsx(lD,{}),u.jsxs(tf,{children:[u.jsx(pL,{}),u.jsxs(dL,{children:[u.jsxs(ns,{className:"z-50 m-0 mx-auto mt-2.5 flex w-full min-w-[320px] max-w-lg flex-col items-center gap-y-2 px-4",position:"top-center",children:[u.jsx(XL,{}),u.jsx(tD,{})]}),u.jsx(SD,{}),u.jsx(gD,{}),u.jsx(QL,{}),u.jsx(hL,{})]})]})]})})})}const e3=`@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")}@font-face{font-family:SWInter;font-style:normal;font-weight:500;font-display:swap;src:url(//cdn.signalwire.com/fonts/inter/Inter-Medium.woff2) format("woff2"),url(//cdn.signalwire.com/fonts/inter/Inter-Medium.woff) format("woff")}
75
+ `,g_=Ie(),t3=e=>{if(!e||!e.getFlowURL||!e.updateFlowURL)throw new TypeError("Invalid or missing required params")};function n3(e){t3(e);const{getAiAgentsURL:t=`${window.location.origin}${rS}`,backButtonHref:n,rootElementId:r="sw-cfb-root",styleHref:o="https://cdn.signalwire.com/npm/@signalwire/cfb@latest/dist/style.css",voicesURL:i="https://cdn.signalwire.com/npm/@signalwire/cfb@latest/dist/voices.json",getFlowURL:s,updateFlowURL:a,deployFlowURL:l}=e;Hf.getState().actions.init({voicesURL:i}).catch(f=>{g_.error("Error initializing voices",f)});const c=document.getElementById(r);if(Y.setState({backButtonHref:n,deployFlowURL:l,getFlowURL:s,rootElement:c,rootElementId:r,updateFlowURL:a}),t&&un.getState().actions.init({getAiAgentsURL:t}),vC().catch(f=>{g_.error("Error initializing i18n",f)}),OD(),!c)throw new Error(`Id: '${r}' not found in the DOM`);c.attachShadow({mode:"open"}),c.shadowRoot&&ic.createRoot(c.shadowRoot).render(u.jsxs(w.StrictMode,{children:[u.jsx("link",{type:"text/css",rel:"stylesheet",href:o}),u.jsx(ZD,{})]}));const d=document.createElement("style");document.head.appendChild(d),d.appendChild(document.createTextNode(e3))}Hr.main=n3,Object.defineProperty(Hr,Symbol.toStringTag,{value:"Module"})});