@api-doc-tor/express 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chat-proxy.d.ts +12 -0
- package/dist/chat-proxy.d.ts.map +1 -0
- package/dist/chat-proxy.js +44 -0
- package/dist/chat-proxy.js.map +1 -0
- package/dist/docs-access-express.d.ts +16 -0
- package/dist/docs-access-express.d.ts.map +1 -0
- package/dist/docs-access-express.js +187 -0
- package/dist/docs-access-express.js.map +1 -0
- package/dist/index.d.ts +64 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +134 -0
- package/dist/index.js.map +1 -0
- package/package.json +36 -0
- package/static/assets/index-2Nv3pxOm.css +1 -0
- package/static/assets/index-6tehJlKh.js +214 -0
- package/static/assets/index-B148KlKZ.js +247 -0
- package/static/assets/index-B7AxOqhh.js +247 -0
- package/static/assets/index-BAVM9zLs.css +1 -0
- package/static/assets/index-BD4qyClR.js +216 -0
- package/static/assets/index-BZaQe_xi.css +1 -0
- package/static/assets/index-BjWlpH_h.js +216 -0
- package/static/assets/index-BmiFV0rx.css +1 -0
- package/static/assets/index-BqIvYIJT.js +247 -0
- package/static/assets/index-BwOiuEB4.js +216 -0
- package/static/assets/index-C372jkHK.js +214 -0
- package/static/assets/index-C9S9wEor.js +217 -0
- package/static/assets/index-Cd9PPQz6.css +1 -0
- package/static/assets/index-Cf2mt1FM.css +1 -0
- package/static/assets/index-Cfn42GaL.css +1 -0
- package/static/assets/index-Ckm4kbAk.css +1 -0
- package/static/assets/index-CzGmm9SR.css +1 -0
- package/static/assets/index-D0jOSazL.js +187 -0
- package/static/assets/index-D3-lCeHu.js +214 -0
- package/static/assets/index-DDRNEd4n.js +247 -0
- package/static/assets/index-DOyViYzn.js +247 -0
- package/static/assets/index-DZsbTHIg.js +214 -0
- package/static/assets/index-DaYbWEw0.js +190 -0
- package/static/assets/index-Djqsib7P.css +1 -0
- package/static/assets/index-Ds4IYSZ4.css +1 -0
- package/static/assets/index-Dzo0Xwn5.css +1 -0
- package/static/assets/index-L47Yb4hH.js +187 -0
- package/static/assets/index-NKfaEJl0.css +1 -0
- package/static/assets/index-U9Pdo8dD.js +214 -0
- package/static/assets/index-UVEGH1D3.css +1 -0
- package/static/assets/index-mZYiGRwU.css +1 -0
- package/static/assets/index-pOjZ5m-I.js +247 -0
- package/static/assets/index-rCcLuTWw.js +216 -0
- package/static/index.html +21 -0
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
var uy=Object.defineProperty;var cy=(t,r,i)=>r in t?uy(t,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[r]=i;var ga=(t,r,i)=>cy(t,typeof r!="symbol"?r+"":r,i);(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))s(l);new MutationObserver(l=>{for(const c of l)if(c.type==="childList")for(const d of c.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&s(d)}).observe(document,{childList:!0,subtree:!0});function i(l){const c={};return l.integrity&&(c.integrity=l.integrity),l.referrerPolicy&&(c.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?c.credentials="include":l.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function s(l){if(l.ep)return;l.ep=!0;const c=i(l);fetch(l.href,c)}})();var fy=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function wu(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Gc={exports:{}},ya={},Jc={exports:{}},ht={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react.production.min.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var Kp;function dy(){if(Kp)return ht;Kp=1;var t=Symbol.for("react.element"),r=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),c=Symbol.for("react.provider"),d=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),y=Symbol.for("react.suspense"),b=Symbol.for("react.memo"),k=Symbol.for("react.lazy"),w=Symbol.iterator;function S(A){return A===null||typeof A!="object"?null:(A=w&&A[w]||A["@@iterator"],typeof A=="function"?A:null)}var C={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},j=Object.assign,$={};function T(A,K,be){this.props=A,this.context=K,this.refs=$,this.updater=be||C}T.prototype.isReactComponent={},T.prototype.setState=function(A,K){if(typeof A!="object"&&typeof A!="function"&&A!=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,A,K,"setState")},T.prototype.forceUpdate=function(A){this.updater.enqueueForceUpdate(this,A,"forceUpdate")};function I(){}I.prototype=T.prototype;function U(A,K,be){this.props=A,this.context=K,this.refs=$,this.updater=be||C}var P=U.prototype=new I;P.constructor=U,j(P,T.prototype),P.isPureReactComponent=!0;var R=Array.isArray,H=Object.prototype.hasOwnProperty,V={current:null},Q={key:!0,ref:!0,__self:!0,__source:!0};function ce(A,K,be){var Se,Me={},Ie=null,Ae=null;if(K!=null)for(Se in K.ref!==void 0&&(Ae=K.ref),K.key!==void 0&&(Ie=""+K.key),K)H.call(K,Se)&&!Q.hasOwnProperty(Se)&&(Me[Se]=K[Se]);var _e=arguments.length-2;if(_e===1)Me.children=be;else if(1<_e){for(var ze=Array(_e),ke=0;ke<_e;ke++)ze[ke]=arguments[ke+2];Me.children=ze}if(A&&A.defaultProps)for(Se in _e=A.defaultProps,_e)Me[Se]===void 0&&(Me[Se]=_e[Se]);return{$$typeof:t,type:A,key:Ie,ref:Ae,props:Me,_owner:V.current}}function de(A,K){return{$$typeof:t,type:A.type,key:K,ref:A.ref,props:A.props,_owner:A._owner}}function we(A){return typeof A=="object"&&A!==null&&A.$$typeof===t}function q(A){var K={"=":"=0",":":"=2"};return"$"+A.replace(/[=:]/g,function(be){return K[be]})}var fe=/\/+/g;function xe(A,K){return typeof A=="object"&&A!==null&&A.key!=null?q(""+A.key):K.toString(36)}function L(A,K,be,Se,Me){var Ie=typeof A;(Ie==="undefined"||Ie==="boolean")&&(A=null);var Ae=!1;if(A===null)Ae=!0;else switch(Ie){case"string":case"number":Ae=!0;break;case"object":switch(A.$$typeof){case t:case r:Ae=!0}}if(Ae)return Ae=A,Me=Me(Ae),A=Se===""?"."+xe(Ae,0):Se,R(Me)?(be="",A!=null&&(be=A.replace(fe,"$&/")+"/"),L(Me,K,be,"",function(ke){return ke})):Me!=null&&(we(Me)&&(Me=de(Me,be+(!Me.key||Ae&&Ae.key===Me.key?"":(""+Me.key).replace(fe,"$&/")+"/")+A)),K.push(Me)),1;if(Ae=0,Se=Se===""?".":Se+":",R(A))for(var _e=0;_e<A.length;_e++){Ie=A[_e];var ze=Se+xe(Ie,_e);Ae+=L(Ie,K,be,ze,Me)}else if(ze=S(A),typeof ze=="function")for(A=ze.call(A),_e=0;!(Ie=A.next()).done;)Ie=Ie.value,ze=Se+xe(Ie,_e++),Ae+=L(Ie,K,be,ze,Me);else if(Ie==="object")throw K=String(A),Error("Objects are not valid as a React child (found: "+(K==="[object Object]"?"object with keys {"+Object.keys(A).join(", ")+"}":K)+"). If you meant to render a collection of children, use an array instead.");return Ae}function le(A,K,be){if(A==null)return A;var Se=[],Me=0;return L(A,Se,"","",function(Ie){return K.call(be,Ie,Me++)}),Se}function G(A){if(A._status===-1){var K=A._result;K=K(),K.then(function(be){(A._status===0||A._status===-1)&&(A._status=1,A._result=be)},function(be){(A._status===0||A._status===-1)&&(A._status=2,A._result=be)}),A._status===-1&&(A._status=0,A._result=K)}if(A._status===1)return A._result.default;throw A._result}var ie={current:null},F={transition:null},W={ReactCurrentDispatcher:ie,ReactCurrentBatchConfig:F,ReactCurrentOwner:V};function B(){throw Error("act(...) is not supported in production builds of React.")}return ht.Children={map:le,forEach:function(A,K,be){le(A,function(){K.apply(this,arguments)},be)},count:function(A){var K=0;return le(A,function(){K++}),K},toArray:function(A){return le(A,function(K){return K})||[]},only:function(A){if(!we(A))throw Error("React.Children.only expected to receive a single React element child.");return A}},ht.Component=T,ht.Fragment=i,ht.Profiler=l,ht.PureComponent=U,ht.StrictMode=s,ht.Suspense=y,ht.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=W,ht.act=B,ht.cloneElement=function(A,K,be){if(A==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+A+".");var Se=j({},A.props),Me=A.key,Ie=A.ref,Ae=A._owner;if(K!=null){if(K.ref!==void 0&&(Ie=K.ref,Ae=V.current),K.key!==void 0&&(Me=""+K.key),A.type&&A.type.defaultProps)var _e=A.type.defaultProps;for(ze in K)H.call(K,ze)&&!Q.hasOwnProperty(ze)&&(Se[ze]=K[ze]===void 0&&_e!==void 0?_e[ze]:K[ze])}var ze=arguments.length-2;if(ze===1)Se.children=be;else if(1<ze){_e=Array(ze);for(var ke=0;ke<ze;ke++)_e[ke]=arguments[ke+2];Se.children=_e}return{$$typeof:t,type:A.type,key:Me,ref:Ie,props:Se,_owner:Ae}},ht.createContext=function(A){return A={$$typeof:d,_currentValue:A,_currentValue2:A,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},A.Provider={$$typeof:c,_context:A},A.Consumer=A},ht.createElement=ce,ht.createFactory=function(A){var K=ce.bind(null,A);return K.type=A,K},ht.createRef=function(){return{current:null}},ht.forwardRef=function(A){return{$$typeof:h,render:A}},ht.isValidElement=we,ht.lazy=function(A){return{$$typeof:k,_payload:{_status:-1,_result:A},_init:G}},ht.memo=function(A,K){return{$$typeof:b,type:A,compare:K===void 0?null:K}},ht.startTransition=function(A){var K=F.transition;F.transition={};try{A()}finally{F.transition=K}},ht.unstable_act=B,ht.useCallback=function(A,K){return ie.current.useCallback(A,K)},ht.useContext=function(A){return ie.current.useContext(A)},ht.useDebugValue=function(){},ht.useDeferredValue=function(A){return ie.current.useDeferredValue(A)},ht.useEffect=function(A,K){return ie.current.useEffect(A,K)},ht.useId=function(){return ie.current.useId()},ht.useImperativeHandle=function(A,K,be){return ie.current.useImperativeHandle(A,K,be)},ht.useInsertionEffect=function(A,K){return ie.current.useInsertionEffect(A,K)},ht.useLayoutEffect=function(A,K){return ie.current.useLayoutEffect(A,K)},ht.useMemo=function(A,K){return ie.current.useMemo(A,K)},ht.useReducer=function(A,K,be){return ie.current.useReducer(A,K,be)},ht.useRef=function(A){return ie.current.useRef(A)},ht.useState=function(A){return ie.current.useState(A)},ht.useSyncExternalStore=function(A,K,be){return ie.current.useSyncExternalStore(A,K,be)},ht.useTransition=function(){return ie.current.useTransition()},ht.version="18.3.1",ht}var qp;function Ia(){return qp||(qp=1,Jc.exports=dy()),Jc.exports}/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react-jsx-runtime.production.min.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var Wp;function py(){if(Wp)return ya;Wp=1;var t=Ia(),r=Symbol.for("react.element"),i=Symbol.for("react.fragment"),s=Object.prototype.hasOwnProperty,l=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,c={key:!0,ref:!0,__self:!0,__source:!0};function d(h,y,b){var k,w={},S=null,C=null;b!==void 0&&(S=""+b),y.key!==void 0&&(S=""+y.key),y.ref!==void 0&&(C=y.ref);for(k in y)s.call(y,k)&&!c.hasOwnProperty(k)&&(w[k]=y[k]);if(h&&h.defaultProps)for(k in y=h.defaultProps,y)w[k]===void 0&&(w[k]=y[k]);return{$$typeof:r,type:h,key:S,ref:C,props:w,_owner:l.current}}return ya.Fragment=i,ya.jsx=d,ya.jsxs=d,ya}var Yp;function hy(){return Yp||(Yp=1,Gc.exports=py()),Gc.exports}var x=hy(),Y=Ia();const gm=wu(Y);var Vl={},Zc={exports:{}},Vn={},ef={exports:{}},tf={};/**
|
|
18
|
+
* @license React
|
|
19
|
+
* scheduler.production.min.js
|
|
20
|
+
*
|
|
21
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
22
|
+
*
|
|
23
|
+
* This source code is licensed under the MIT license found in the
|
|
24
|
+
* LICENSE file in the root directory of this source tree.
|
|
25
|
+
*/var Xp;function my(){return Xp||(Xp=1,(function(t){function r(F,W){var B=F.length;F.push(W);e:for(;0<B;){var A=B-1>>>1,K=F[A];if(0<l(K,W))F[A]=W,F[B]=K,B=A;else break e}}function i(F){return F.length===0?null:F[0]}function s(F){if(F.length===0)return null;var W=F[0],B=F.pop();if(B!==W){F[0]=B;e:for(var A=0,K=F.length,be=K>>>1;A<be;){var Se=2*(A+1)-1,Me=F[Se],Ie=Se+1,Ae=F[Ie];if(0>l(Me,B))Ie<K&&0>l(Ae,Me)?(F[A]=Ae,F[Ie]=B,A=Ie):(F[A]=Me,F[Se]=B,A=Se);else if(Ie<K&&0>l(Ae,B))F[A]=Ae,F[Ie]=B,A=Ie;else break e}}return W}function l(F,W){var B=F.sortIndex-W.sortIndex;return B!==0?B:F.id-W.id}if(typeof performance=="object"&&typeof performance.now=="function"){var c=performance;t.unstable_now=function(){return c.now()}}else{var d=Date,h=d.now();t.unstable_now=function(){return d.now()-h}}var y=[],b=[],k=1,w=null,S=3,C=!1,j=!1,$=!1,T=typeof setTimeout=="function"?setTimeout:null,I=typeof clearTimeout=="function"?clearTimeout:null,U=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function P(F){for(var W=i(b);W!==null;){if(W.callback===null)s(b);else if(W.startTime<=F)s(b),W.sortIndex=W.expirationTime,r(y,W);else break;W=i(b)}}function R(F){if($=!1,P(F),!j)if(i(y)!==null)j=!0,G(H);else{var W=i(b);W!==null&&ie(R,W.startTime-F)}}function H(F,W){j=!1,$&&($=!1,I(ce),ce=-1),C=!0;var B=S;try{for(P(W),w=i(y);w!==null&&(!(w.expirationTime>W)||F&&!q());){var A=w.callback;if(typeof A=="function"){w.callback=null,S=w.priorityLevel;var K=A(w.expirationTime<=W);W=t.unstable_now(),typeof K=="function"?w.callback=K:w===i(y)&&s(y),P(W)}else s(y);w=i(y)}if(w!==null)var be=!0;else{var Se=i(b);Se!==null&&ie(R,Se.startTime-W),be=!1}return be}finally{w=null,S=B,C=!1}}var V=!1,Q=null,ce=-1,de=5,we=-1;function q(){return!(t.unstable_now()-we<de)}function fe(){if(Q!==null){var F=t.unstable_now();we=F;var W=!0;try{W=Q(!0,F)}finally{W?xe():(V=!1,Q=null)}}else V=!1}var xe;if(typeof U=="function")xe=function(){U(fe)};else if(typeof MessageChannel<"u"){var L=new MessageChannel,le=L.port2;L.port1.onmessage=fe,xe=function(){le.postMessage(null)}}else xe=function(){T(fe,0)};function G(F){Q=F,V||(V=!0,xe())}function ie(F,W){ce=T(function(){F(t.unstable_now())},W)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(F){F.callback=null},t.unstable_continueExecution=function(){j||C||(j=!0,G(H))},t.unstable_forceFrameRate=function(F){0>F||125<F?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):de=0<F?Math.floor(1e3/F):5},t.unstable_getCurrentPriorityLevel=function(){return S},t.unstable_getFirstCallbackNode=function(){return i(y)},t.unstable_next=function(F){switch(S){case 1:case 2:case 3:var W=3;break;default:W=S}var B=S;S=W;try{return F()}finally{S=B}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(F,W){switch(F){case 1:case 2:case 3:case 4:case 5:break;default:F=3}var B=S;S=F;try{return W()}finally{S=B}},t.unstable_scheduleCallback=function(F,W,B){var A=t.unstable_now();switch(typeof B=="object"&&B!==null?(B=B.delay,B=typeof B=="number"&&0<B?A+B:A):B=A,F){case 1:var K=-1;break;case 2:K=250;break;case 5:K=1073741823;break;case 4:K=1e4;break;default:K=5e3}return K=B+K,F={id:k++,callback:W,priorityLevel:F,startTime:B,expirationTime:K,sortIndex:-1},B>A?(F.sortIndex=B,r(b,F),i(y)===null&&F===i(b)&&($?(I(ce),ce=-1):$=!0,ie(R,B-A))):(F.sortIndex=K,r(y,F),j||C||(j=!0,G(H))),F},t.unstable_shouldYield=q,t.unstable_wrapCallback=function(F){var W=S;return function(){var B=S;S=W;try{return F.apply(this,arguments)}finally{S=B}}}})(tf)),tf}var Qp;function gy(){return Qp||(Qp=1,ef.exports=my()),ef.exports}/**
|
|
26
|
+
* @license React
|
|
27
|
+
* react-dom.production.min.js
|
|
28
|
+
*
|
|
29
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
30
|
+
*
|
|
31
|
+
* This source code is licensed under the MIT license found in the
|
|
32
|
+
* LICENSE file in the root directory of this source tree.
|
|
33
|
+
*/var Gp;function yy(){if(Gp)return Vn;Gp=1;var t=Ia(),r=gy();function i(e){for(var n="https://reactjs.org/docs/error-decoder.html?invariant="+e,o=1;o<arguments.length;o++)n+="&args[]="+encodeURIComponent(arguments[o]);return"Minified React error #"+e+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var s=new Set,l={};function c(e,n){d(e,n),d(e+"Capture",n)}function d(e,n){for(l[e]=n,e=0;e<n.length;e++)s.add(n[e])}var h=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),y=Object.prototype.hasOwnProperty,b=/^[: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]*$/,k={},w={};function S(e){return y.call(w,e)?!0:y.call(k,e)?!1:b.test(e)?w[e]=!0:(k[e]=!0,!1)}function C(e,n,o,u){if(o!==null&&o.type===0)return!1;switch(typeof n){case"function":case"symbol":return!0;case"boolean":return u?!1:o!==null?!o.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function j(e,n,o,u){if(n===null||typeof n>"u"||C(e,n,o,u))return!0;if(u)return!1;if(o!==null)switch(o.type){case 3:return!n;case 4:return n===!1;case 5:return isNaN(n);case 6:return isNaN(n)||1>n}return!1}function $(e,n,o,u,p,g,E){this.acceptsBooleans=n===2||n===3||n===4,this.attributeName=u,this.attributeNamespace=p,this.mustUseProperty=o,this.propertyName=e,this.type=n,this.sanitizeURL=g,this.removeEmptyString=E}var T={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){T[e]=new $(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var n=e[0];T[n]=new $(n,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){T[e]=new $(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){T[e]=new $(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){T[e]=new $(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){T[e]=new $(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){T[e]=new $(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){T[e]=new $(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){T[e]=new $(e,5,!1,e.toLowerCase(),null,!1,!1)});var I=/[\-:]([a-z])/g;function U(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 n=e.replace(I,U);T[n]=new $(n,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var n=e.replace(I,U);T[n]=new $(n,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var n=e.replace(I,U);T[n]=new $(n,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){T[e]=new $(e,1,!1,e.toLowerCase(),null,!1,!1)}),T.xlinkHref=new $("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){T[e]=new $(e,1,!1,e.toLowerCase(),null,!0,!0)});function P(e,n,o,u){var p=T.hasOwnProperty(n)?T[n]:null;(p!==null?p.type!==0:u||!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(j(n,o,p,u)&&(o=null),u||p===null?S(n)&&(o===null?e.removeAttribute(n):e.setAttribute(n,""+o)):p.mustUseProperty?e[p.propertyName]=o===null?p.type===3?!1:"":o:(n=p.attributeName,u=p.attributeNamespace,o===null?e.removeAttribute(n):(p=p.type,o=p===3||p===4&&o===!0?"":""+o,u?e.setAttributeNS(u,n,o):e.setAttribute(n,o))))}var R=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,H=Symbol.for("react.element"),V=Symbol.for("react.portal"),Q=Symbol.for("react.fragment"),ce=Symbol.for("react.strict_mode"),de=Symbol.for("react.profiler"),we=Symbol.for("react.provider"),q=Symbol.for("react.context"),fe=Symbol.for("react.forward_ref"),xe=Symbol.for("react.suspense"),L=Symbol.for("react.suspense_list"),le=Symbol.for("react.memo"),G=Symbol.for("react.lazy"),ie=Symbol.for("react.offscreen"),F=Symbol.iterator;function W(e){return e===null||typeof e!="object"?null:(e=F&&e[F]||e["@@iterator"],typeof e=="function"?e:null)}var B=Object.assign,A;function K(e){if(A===void 0)try{throw Error()}catch(o){var n=o.stack.trim().match(/\n( *(at )?)/);A=n&&n[1]||""}return`
|
|
34
|
+
`+A+e}var be=!1;function Se(e,n){if(!e||be)return"";be=!0;var o=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(n)if(n=function(){throw Error()},Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(n,[])}catch(ye){var u=ye}Reflect.construct(e,[],n)}else{try{n.call()}catch(ye){u=ye}e.call(n.prototype)}else{try{throw Error()}catch(ye){u=ye}e()}}catch(ye){if(ye&&u&&typeof ye.stack=="string"){for(var p=ye.stack.split(`
|
|
35
|
+
`),g=u.stack.split(`
|
|
36
|
+
`),E=p.length-1,D=g.length-1;1<=E&&0<=D&&p[E]!==g[D];)D--;for(;1<=E&&0<=D;E--,D--)if(p[E]!==g[D]){if(E!==1||D!==1)do if(E--,D--,0>D||p[E]!==g[D]){var X=`
|
|
37
|
+
`+p[E].replace(" at new "," at ");return e.displayName&&X.includes("<anonymous>")&&(X=X.replace("<anonymous>",e.displayName)),X}while(1<=E&&0<=D);break}}}finally{be=!1,Error.prepareStackTrace=o}return(e=e?e.displayName||e.name:"")?K(e):""}function Me(e){switch(e.tag){case 5:return K(e.type);case 16:return K("Lazy");case 13:return K("Suspense");case 19:return K("SuspenseList");case 0:case 2:case 15:return e=Se(e.type,!1),e;case 11:return e=Se(e.type.render,!1),e;case 1:return e=Se(e.type,!0),e;default:return""}}function Ie(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 Q:return"Fragment";case V:return"Portal";case de:return"Profiler";case ce:return"StrictMode";case xe:return"Suspense";case L:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case q:return(e.displayName||"Context")+".Consumer";case we:return(e._context.displayName||"Context")+".Provider";case fe:var n=e.render;return e=e.displayName,e||(e=n.displayName||n.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case le:return n=e.displayName||null,n!==null?n:Ie(e.type)||"Memo";case G:n=e._payload,e=e._init;try{return Ie(e(n))}catch{}}return null}function Ae(e){var n=e.type;switch(e.tag){case 24:return"Cache";case 9:return(n.displayName||"Context")+".Consumer";case 10:return(n._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=n.render,e=e.displayName||e.name||"",n.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return n;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Ie(n);case 8:return n===ce?"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 n=="function")return n.displayName||n.name||null;if(typeof n=="string")return n}return null}function _e(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function ze(e){var n=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function ke(e){var n=ze(e)?"checked":"value",o=Object.getOwnPropertyDescriptor(e.constructor.prototype,n),u=""+e[n];if(!e.hasOwnProperty(n)&&typeof o<"u"&&typeof o.get=="function"&&typeof o.set=="function"){var p=o.get,g=o.set;return Object.defineProperty(e,n,{configurable:!0,get:function(){return p.call(this)},set:function(E){u=""+E,g.call(this,E)}}),Object.defineProperty(e,n,{enumerable:o.enumerable}),{getValue:function(){return u},setValue:function(E){u=""+E},stopTracking:function(){e._valueTracker=null,delete e[n]}}}}function Be(e){e._valueTracker||(e._valueTracker=ke(e))}function Re(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var o=n.getValue(),u="";return e&&(u=ze(e)?e.checked?"true":"false":e.value),e=u,e!==o?(n.setValue(e),!0):!1}function Ue(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 lt(e,n){var o=n.checked;return B({},n,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:o??e._wrapperState.initialChecked})}function ut(e,n){var o=n.defaultValue==null?"":n.defaultValue,u=n.checked!=null?n.checked:n.defaultChecked;o=_e(n.value!=null?n.value:o),e._wrapperState={initialChecked:u,initialValue:o,controlled:n.type==="checkbox"||n.type==="radio"?n.checked!=null:n.value!=null}}function it(e,n){n=n.checked,n!=null&&P(e,"checked",n,!1)}function Ct(e,n){it(e,n);var o=_e(n.value),u=n.type;if(o!=null)u==="number"?(o===0&&e.value===""||e.value!=o)&&(e.value=""+o):e.value!==""+o&&(e.value=""+o);else if(u==="submit"||u==="reset"){e.removeAttribute("value");return}n.hasOwnProperty("value")?Gt(e,n.type,o):n.hasOwnProperty("defaultValue")&&Gt(e,n.type,_e(n.defaultValue)),n.checked==null&&n.defaultChecked!=null&&(e.defaultChecked=!!n.defaultChecked)}function qt(e,n,o){if(n.hasOwnProperty("value")||n.hasOwnProperty("defaultValue")){var u=n.type;if(!(u!=="submit"&&u!=="reset"||n.value!==void 0&&n.value!==null))return;n=""+e._wrapperState.initialValue,o||n===e.value||(e.value=n),e.defaultValue=n}o=e.name,o!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,o!==""&&(e.name=o)}function Gt(e,n,o){(n!=="number"||Ue(e.ownerDocument)!==e)&&(o==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+o&&(e.defaultValue=""+o))}var Rt=Array.isArray;function Nt(e,n,o,u){if(e=e.options,n){n={};for(var p=0;p<o.length;p++)n["$"+o[p]]=!0;for(o=0;o<e.length;o++)p=n.hasOwnProperty("$"+e[o].value),e[o].selected!==p&&(e[o].selected=p),p&&u&&(e[o].defaultSelected=!0)}else{for(o=""+_e(o),n=null,p=0;p<e.length;p++){if(e[p].value===o){e[p].selected=!0,u&&(e[p].defaultSelected=!0);return}n!==null||e[p].disabled||(n=e[p])}n!==null&&(n.selected=!0)}}function pn(e,n){if(n.dangerouslySetInnerHTML!=null)throw Error(i(91));return B({},n,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function on(e,n){var o=n.value;if(o==null){if(o=n.children,n=n.defaultValue,o!=null){if(n!=null)throw Error(i(92));if(Rt(o)){if(1<o.length)throw Error(i(93));o=o[0]}n=o}n==null&&(n=""),o=n}e._wrapperState={initialValue:_e(o)}}function Wt(e,n){var o=_e(n.value),u=_e(n.defaultValue);o!=null&&(o=""+o,o!==e.value&&(e.value=o),n.defaultValue==null&&e.defaultValue!==o&&(e.defaultValue=o)),u!=null&&(e.defaultValue=""+u)}function Nn(e){var n=e.textContent;n===e._wrapperState.initialValue&&n!==""&&n!==null&&(e.value=n)}function pt(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 Yt(e,n){return e==null||e==="http://www.w3.org/1999/xhtml"?pt(n):e==="http://www.w3.org/2000/svg"&&n==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var hn,mn=(function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(n,o,u,p){MSApp.execUnsafeLocalFunction(function(){return e(n,o,u,p)})}:e})(function(e,n){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=n;else{for(hn=hn||document.createElement("div"),hn.innerHTML="<svg>"+n.valueOf().toString()+"</svg>",n=hn.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;n.firstChild;)e.appendChild(n.firstChild)}});function sn(e,n){if(n){var o=e.firstChild;if(o&&o===e.lastChild&&o.nodeType===3){o.nodeValue=n;return}}e.textContent=n}var En={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},Kn=["Webkit","ms","Moz","O"];Object.keys(En).forEach(function(e){Kn.forEach(function(n){n=n+e.charAt(0).toUpperCase()+e.substring(1),En[n]=En[e]})});function _r(e,n,o){return n==null||typeof n=="boolean"||n===""?"":o||typeof n!="number"||n===0||En.hasOwnProperty(e)&&En[e]?(""+n).trim():n+"px"}function Br(e,n){e=e.style;for(var o in n)if(n.hasOwnProperty(o)){var u=o.indexOf("--")===0,p=_r(o,n[o],u);o==="float"&&(o="cssFloat"),u?e.setProperty(o,p):e[o]=p}}var Cn=B({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 qe(e,n){if(n){if(Cn[e]&&(n.children!=null||n.dangerouslySetInnerHTML!=null))throw Error(i(137,e));if(n.dangerouslySetInnerHTML!=null){if(n.children!=null)throw Error(i(60));if(typeof n.dangerouslySetInnerHTML!="object"||!("__html"in n.dangerouslySetInnerHTML))throw Error(i(61))}if(n.style!=null&&typeof n.style!="object")throw Error(i(62))}}function qn(e,n){if(e.indexOf("-")===-1)return typeof n.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 jn=null;function ar(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var He=null,An=null,Jt=null;function lr(e){if(e=ta(e)){if(typeof He!="function")throw Error(i(280));var n=e.stateNode;n&&(n=ol(n),He(e.stateNode,e.type,n))}}function ro(e){An?Jt?Jt.push(e):Jt=[e]:An=e}function Hr(){if(An){var e=An,n=Jt;if(Jt=An=null,lr(e),n)for(e=0;e<n.length;e++)lr(n[e])}}function Oo(e,n){return e(n)}function Ro(){}var On=!1;function Wn(e,n,o){if(On)return e(n,o);On=!0;try{return Oo(e,n,o)}finally{On=!1,(An!==null||Jt!==null)&&(Ro(),Hr())}}function Yn(e,n){var o=e.stateNode;if(o===null)return null;var u=ol(o);if(u===null)return null;o=u[n];e:switch(n){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(u=!u.disabled)||(e=e.type,u=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!u;break e;default:e=!1}if(e)return null;if(o&&typeof o!="function")throw Error(i(231,n,typeof o));return o}var ur=!1;if(h)try{var gt={};Object.defineProperty(gt,"passive",{get:function(){ur=!0}}),window.addEventListener("test",gt,gt),window.removeEventListener("test",gt,gt)}catch{ur=!1}function Tt(e,n,o,u,p,g,E,D,X){var ye=Array.prototype.slice.call(arguments,3);try{n.apply(o,ye)}catch(Pe){this.onError(Pe)}}var cr=!1,Xn=null,Qn=!1,fr=null,Lo={onError:function(e){cr=!0,Xn=e}};function gn(e,n,o,u,p,g,E,D,X){cr=!1,Xn=null,Tt.apply(Lo,arguments)}function Gn(e,n,o,u,p,g,E,D,X){if(gn.apply(this,arguments),cr){if(cr){var ye=Xn;cr=!1,Xn=null}else throw Error(i(198));Qn||(Qn=!0,fr=ye)}}function z(e){var n=e,o=e;if(e.alternate)for(;n.return;)n=n.return;else{e=n;do n=e,(n.flags&4098)!==0&&(o=n.return),e=n.return;while(e)}return n.tag===3?o:null}function Oe(e){if(e.tag===13){var n=e.memoizedState;if(n===null&&(e=e.alternate,e!==null&&(n=e.memoizedState)),n!==null)return n.dehydrated}return null}function We(e){if(z(e)!==e)throw Error(i(188))}function ct(e){var n=e.alternate;if(!n){if(n=z(e),n===null)throw Error(i(188));return n!==e?null:e}for(var o=e,u=n;;){var p=o.return;if(p===null)break;var g=p.alternate;if(g===null){if(u=p.return,u!==null){o=u;continue}break}if(p.child===g.child){for(g=p.child;g;){if(g===o)return We(p),e;if(g===u)return We(p),n;g=g.sibling}throw Error(i(188))}if(o.return!==u.return)o=p,u=g;else{for(var E=!1,D=p.child;D;){if(D===o){E=!0,o=p,u=g;break}if(D===u){E=!0,u=p,o=g;break}D=D.sibling}if(!E){for(D=g.child;D;){if(D===o){E=!0,o=g,u=p;break}if(D===u){E=!0,u=g,o=p;break}D=D.sibling}if(!E)throw Error(i(189))}}if(o.alternate!==u)throw Error(i(190))}if(o.tag!==3)throw Error(i(188));return o.stateNode.current===o?e:n}function Pn(e){return e=ct(e),e!==null?Ht(e):null}function Ht(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var n=Ht(e);if(n!==null)return n;e=e.sibling}return null}var yn=r.unstable_scheduleCallback,Mn=r.unstable_cancelCallback,kt=r.unstable_shouldYield,an=r.unstable_requestPaint,mt=r.unstable_now,oo=r.unstable_getCurrentPriorityLevel,Jn=r.unstable_ImmediatePriority,Zn=r.unstable_UserBlockingPriority,dr=r.unstable_NormalPriority,Sr=r.unstable_LowPriority,di=r.unstable_IdlePriority,pr=null,$n=null;function ft(e){if($n&&typeof $n.onCommitFiberRoot=="function")try{$n.onCommitFiberRoot(pr,e,void 0,(e.current.flags&128)===128)}catch{}}var vn=Math.clz32?Math.clz32:io,Hi=Math.log,Do=Math.LN2;function io(e){return e>>>=0,e===0?32:31-(Hi(e)/Do|0)|0}var so=64,ao=4194304;function er(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 xt(e,n){var o=e.pendingLanes;if(o===0)return 0;var u=0,p=e.suspendedLanes,g=e.pingedLanes,E=o&268435455;if(E!==0){var D=E&~p;D!==0?u=er(D):(g&=E,g!==0&&(u=er(g)))}else E=o&~p,E!==0?u=er(E):g!==0&&(u=er(g));if(u===0)return 0;if(n!==0&&n!==u&&(n&p)===0&&(p=u&-u,g=n&-n,p>=g||p===16&&(g&4194240)!==0))return n;if((u&4)!==0&&(u|=o&16),n=e.entangledLanes,n!==0)for(e=e.entanglements,n&=u;0<n;)o=31-vn(n),p=1<<o,u|=e[o],n&=~p;return u}function Vr(e,n){switch(e){case 1:case 2:case 4:return n+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 n+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 lo(e,n){for(var o=e.suspendedLanes,u=e.pingedLanes,p=e.expirationTimes,g=e.pendingLanes;0<g;){var E=31-vn(g),D=1<<E,X=p[E];X===-1?((D&o)===0||(D&u)!==0)&&(p[E]=Vr(D,n)):X<=n&&(e.expiredLanes|=D),g&=~D}}function hr(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Ur(){var e=so;return so<<=1,(so&4194240)===0&&(so=64),e}function uo(e){for(var n=[],o=0;31>o;o++)n.push(e);return n}function mr(e,n,o){e.pendingLanes|=n,n!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,n=31-vn(n),e[n]=o}function pi(e,n){var o=e.pendingLanes&~n;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=n,e.mutableReadLanes&=n,e.entangledLanes&=n,n=e.entanglements;var u=e.eventTimes;for(e=e.expirationTimes;0<o;){var p=31-vn(o),g=1<<p;n[p]=0,u[p]=-1,e[p]=-1,o&=~g}}function zo(e,n){var o=e.entangledLanes|=n;for(e=e.entanglements;o;){var u=31-vn(o),p=1<<u;p&n|e[u]&n&&(e[u]|=n),o&=~p}}var bt=0;function Ba(e){return e&=-e,1<e?4<e?(e&268435455)!==0?16:536870912:4:1}var yt,Vi,Ha,Va,xn,Kr=!1,co=[],ln=null,kr=null,Nr=null,It=new Map,un=new Map,Rn=[],hi="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 Ui(e,n){switch(e){case"focusin":case"focusout":ln=null;break;case"dragenter":case"dragleave":kr=null;break;case"mouseover":case"mouseout":Nr=null;break;case"pointerover":case"pointerout":It.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":un.delete(n.pointerId)}}function Ln(e,n,o,u,p,g){return e===null||e.nativeEvent!==g?(e={blockedOn:n,domEventName:o,eventSystemFlags:u,nativeEvent:g,targetContainers:[p]},n!==null&&(n=ta(n),n!==null&&Vi(n)),e):(e.eventSystemFlags|=u,n=e.targetContainers,p!==null&&n.indexOf(p)===-1&&n.push(p),e)}function Ou(e,n,o,u,p){switch(n){case"focusin":return ln=Ln(ln,e,n,o,u,p),!0;case"dragenter":return kr=Ln(kr,e,n,o,u,p),!0;case"mouseover":return Nr=Ln(Nr,e,n,o,u,p),!0;case"pointerover":var g=p.pointerId;return It.set(g,Ln(It.get(g)||null,e,n,o,u,p)),!0;case"gotpointercapture":return g=p.pointerId,un.set(g,Ln(un.get(g)||null,e,n,o,u,p)),!0}return!1}function tr(e){var n=_i(e.target);if(n!==null){var o=z(n);if(o!==null){if(n=o.tag,n===13){if(n=Oe(o),n!==null){e.blockedOn=n,xn(e.priority,function(){Ha(o)});return}}else if(n===3&&o.stateNode.current.memoizedState.isDehydrated){e.blockedOn=o.tag===3?o.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Fo(e){if(e.blockedOn!==null)return!1;for(var n=e.targetContainers;0<n.length;){var o=Bo(e.domEventName,e.eventSystemFlags,n[0],e.nativeEvent);if(o===null){o=e.nativeEvent;var u=new o.constructor(o.type,o);jn=u,o.target.dispatchEvent(u),jn=null}else return n=ta(o),n!==null&&Vi(n),e.blockedOn=o,!1;n.shift()}return!0}function Ls(e,n,o){Fo(e)&&o.delete(n)}function Ds(){Kr=!1,ln!==null&&Fo(ln)&&(ln=null),kr!==null&&Fo(kr)&&(kr=null),Nr!==null&&Fo(Nr)&&(Nr=null),It.forEach(Ls),un.forEach(Ls)}function Er(e,n){e.blockedOn===n&&(e.blockedOn=null,Kr||(Kr=!0,r.unstable_scheduleCallback(r.unstable_NormalPriority,Ds)))}function fo(e){function n(p){return Er(p,e)}if(0<co.length){Er(co[0],e);for(var o=1;o<co.length;o++){var u=co[o];u.blockedOn===e&&(u.blockedOn=null)}}for(ln!==null&&Er(ln,e),kr!==null&&Er(kr,e),Nr!==null&&Er(Nr,e),It.forEach(n),un.forEach(n),o=0;o<Rn.length;o++)u=Rn[o],u.blockedOn===e&&(u.blockedOn=null);for(;0<Rn.length&&(o=Rn[0],o.blockedOn===null);)tr(o),o.blockedOn===null&&Rn.shift()}var po=R.ReactCurrentBatchConfig,Ki=!0;function mi(e,n,o,u){var p=bt,g=po.transition;po.transition=null;try{bt=1,zs(e,n,o,u)}finally{bt=p,po.transition=g}}function Ru(e,n,o,u){var p=bt,g=po.transition;po.transition=null;try{bt=4,zs(e,n,o,u)}finally{bt=p,po.transition=g}}function zs(e,n,o,u){if(Ki){var p=Bo(e,n,o,u);if(p===null)Bu(e,n,u,ho,o),Ui(e,u);else if(Ou(p,e,n,o,u))u.stopPropagation();else if(Ui(e,u),n&4&&-1<hi.indexOf(e)){for(;p!==null;){var g=ta(p);if(g!==null&&yt(g),g=Bo(e,n,o,u),g===null&&Bu(e,n,u,ho,o),g===p)break;p=g}p!==null&&u.stopPropagation()}else Bu(e,n,u,null,o)}}var ho=null;function Bo(e,n,o,u){if(ho=null,e=ar(u),e=_i(e),e!==null)if(n=z(e),n===null)e=null;else if(o=n.tag,o===13){if(e=Oe(n),e!==null)return e;e=null}else if(o===3){if(n.stateNode.current.memoizedState.isDehydrated)return n.tag===3?n.stateNode.containerInfo:null;e=null}else n!==e&&(e=null);return ho=e,null}function qi(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(oo()){case Jn:return 1;case Zn:return 4;case dr:case Sr:return 16;case di:return 536870912;default:return 16}default:return 16}}var qr=null,Fs=null,Wi=null;function Yi(){if(Wi)return Wi;var e,n=Fs,o=n.length,u,p="value"in qr?qr.value:qr.textContent,g=p.length;for(e=0;e<o&&n[e]===p[e];e++);var E=o-e;for(u=1;u<=E&&n[o-u]===p[g-u];u++);return Wi=p.slice(e,1<u?1-u:void 0)}function Ho(e){var n=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&n===13&&(e=13)):e=n,e===10&&(e=13),32<=e||e===13?e:0}function gi(){return!0}function yi(){return!1}function Zt(e){function n(o,u,p,g,E){this._reactName=o,this._targetInst=p,this.type=u,this.nativeEvent=g,this.target=E,this.currentTarget=null;for(var D in e)e.hasOwnProperty(D)&&(o=e[D],this[D]=o?o(g):g[D]);return this.isDefaultPrevented=(g.defaultPrevented!=null?g.defaultPrevented:g.returnValue===!1)?gi:yi,this.isPropagationStopped=yi,this}return B(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var o=this.nativeEvent;o&&(o.preventDefault?o.preventDefault():typeof o.returnValue!="unknown"&&(o.returnValue=!1),this.isDefaultPrevented=gi)},stopPropagation:function(){var o=this.nativeEvent;o&&(o.stopPropagation?o.stopPropagation():typeof o.cancelBubble!="unknown"&&(o.cancelBubble=!0),this.isPropagationStopped=gi)},persist:function(){},isPersistent:gi}),n}var Cr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Xi=Zt(Cr),vi=B({},Cr,{view:0,detail:0}),Vo=Zt(vi),mo,xi,go,Uo=B({},vi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ts,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!==go&&(go&&e.type==="mousemove"?(mo=e.screenX-go.screenX,xi=e.screenY-go.screenY):xi=mo=0,go=e),mo)},movementY:function(e){return"movementY"in e?e.movementY:xi}}),Qi=Zt(Uo),en=B({},Uo,{dataTransfer:0}),wi=Zt(en),bi=B({},vi,{relatedTarget:0}),Gi=Zt(bi),Ji=B({},Cr,{animationName:0,elapsedTime:0,pseudoElement:0}),Ua=Zt(Ji),Ka=B({},Cr,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Zi=Zt(Ka),Bs=B({},Cr,{data:0}),Wr=Zt(Bs),Hs={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Vs={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"},es={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Us(e){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(e):(e=es[e])?!!n[e]:!1}function ts(){return Us}var Lu=B({},vi,{key:function(e){if(e.key){var n=Hs[e.key]||e.key;if(n!=="Unidentified")return n}return e.type==="keypress"?(e=Ho(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Vs[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ts,charCode:function(e){return e.type==="keypress"?Ho(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Ho(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Ks=Zt(Lu),ns=B({},Uo,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),qa=Zt(ns),qs=B({},vi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ts}),Ws=Zt(qs),Du=B({},Cr,{propertyName:0,elapsedTime:0,pseudoElement:0}),Wa=Zt(Du),zu=B({},Uo,{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}),Ya=Zt(zu),Xa=[9,13,27,32],Ys=h&&"CompositionEvent"in window,Ko=null;h&&"documentMode"in document&&(Ko=document.documentMode);var Xs=h&&"TextEvent"in window&&!Ko,Qs=h&&(!Ys||Ko&&8<Ko&&11>=Ko),Gs=" ",Qa=!1;function Ga(e,n){switch(e){case"keyup":return Xa.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ja(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var jr=!1;function Pr(e,n){switch(e){case"compositionend":return Ja(n);case"keypress":return n.which!==32?null:(Qa=!0,Gs);case"textInput":return e=n.data,e===Gs&&Qa?null:e;default:return null}}function Lt(e,n){if(jr)return e==="compositionend"||!Ys&&Ga(e,n)?(e=Yi(),Wi=Fs=qr=null,jr=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1<n.char.length)return n.char;if(n.which)return String.fromCharCode(n.which)}return null;case"compositionend":return Qs&&n.locale!=="ko"?null:n.data;default:return null}}var rs={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 yo(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n==="input"?!!rs[e.type]:n==="textarea"}function Za(e,n,o,u){ro(u),n=tl(n,"onChange"),0<n.length&&(o=new Xi("onChange","change",null,o,u),e.push({event:o,listeners:n}))}var vo=null,qo=null;function xo(e){ad(e,0)}function Wo(e){var n=as(e);if(Re(n))return e}function Yo(e,n){if(e==="change")return n}var Mr=!1;if(h){var os;if(h){var a="oninput"in document;if(!a){var f=document.createElement("div");f.setAttribute("oninput","return;"),a=typeof f.oninput=="function"}os=a}else os=!1;Mr=os&&(!document.documentMode||9<document.documentMode)}function m(){vo&&(vo.detachEvent("onpropertychange",v),qo=vo=null)}function v(e){if(e.propertyName==="value"&&Wo(qo)){var n=[];Za(n,qo,e,ar(e)),Wn(xo,n)}}function _(e,n,o){e==="focusin"?(m(),vo=n,qo=o,vo.attachEvent("onpropertychange",v)):e==="focusout"&&m()}function N(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Wo(qo)}function M(e,n){if(e==="click")return Wo(n)}function O(e,n){if(e==="input"||e==="change")return Wo(n)}function Z(e,n){return e===n&&(e!==0||1/e===1/n)||e!==e&&n!==n}var ue=typeof Object.is=="function"?Object.is:Z;function te(e,n){if(ue(e,n))return!0;if(typeof e!="object"||e===null||typeof n!="object"||n===null)return!1;var o=Object.keys(e),u=Object.keys(n);if(o.length!==u.length)return!1;for(u=0;u<o.length;u++){var p=o[u];if(!y.call(n,p)||!ue(e[p],n[p]))return!1}return!0}function J(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function ee(e,n){var o=J(e);e=0;for(var u;o;){if(o.nodeType===3){if(u=e+o.textContent.length,e<=n&&u>=n)return{node:o,offset:n-e};e=u}e:{for(;o;){if(o.nextSibling){o=o.nextSibling;break e}o=o.parentNode}o=void 0}o=J(o)}}function ae(e,n){return e&&n?e===n?!0:e&&e.nodeType===3?!1:n&&n.nodeType===3?ae(e,n.parentNode):"contains"in e?e.contains(n):e.compareDocumentPosition?!!(e.compareDocumentPosition(n)&16):!1:!1}function oe(){for(var e=window,n=Ue();n instanceof e.HTMLIFrameElement;){try{var o=typeof n.contentWindow.location.href=="string"}catch{o=!1}if(o)e=n.contentWindow;else break;n=Ue(e.document)}return n}function re(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n&&(n==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||n==="textarea"||e.contentEditable==="true")}function se(e){var n=oe(),o=e.focusedElem,u=e.selectionRange;if(n!==o&&o&&o.ownerDocument&&ae(o.ownerDocument.documentElement,o)){if(u!==null&&re(o)){if(n=u.start,e=u.end,e===void 0&&(e=n),"selectionStart"in o)o.selectionStart=n,o.selectionEnd=Math.min(e,o.value.length);else if(e=(n=o.ownerDocument||document)&&n.defaultView||window,e.getSelection){e=e.getSelection();var p=o.textContent.length,g=Math.min(u.start,p);u=u.end===void 0?g:Math.min(u.end,p),!e.extend&&g>u&&(p=u,u=g,g=p),p=ee(o,g);var E=ee(o,u);p&&E&&(e.rangeCount!==1||e.anchorNode!==p.node||e.anchorOffset!==p.offset||e.focusNode!==E.node||e.focusOffset!==E.offset)&&(n=n.createRange(),n.setStart(p.node,p.offset),e.removeAllRanges(),g>u?(e.addRange(n),e.extend(E.node,E.offset)):(n.setEnd(E.node,E.offset),e.addRange(n)))}}for(n=[],e=o;e=e.parentNode;)e.nodeType===1&&n.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof o.focus=="function"&&o.focus(),o=0;o<n.length;o++)e=n[o],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var ge=h&&"documentMode"in document&&11>=document.documentMode,pe=null,ve=null,Ne=null,Ce=!1;function De(e,n,o){var u=o.window===o?o.document:o.nodeType===9?o:o.ownerDocument;Ce||pe==null||pe!==Ue(u)||(u=pe,"selectionStart"in u&&re(u)?u={start:u.selectionStart,end:u.selectionEnd}:(u=(u.ownerDocument&&u.ownerDocument.defaultView||window).getSelection(),u={anchorNode:u.anchorNode,anchorOffset:u.anchorOffset,focusNode:u.focusNode,focusOffset:u.focusOffset}),Ne&&te(Ne,u)||(Ne=u,u=tl(ve,"onSelect"),0<u.length&&(n=new Xi("onSelect","select",null,n,o),e.push({event:n,listeners:u}),n.target=pe)))}function $e(e,n){var o={};return o[e.toLowerCase()]=n.toLowerCase(),o["Webkit"+e]="webkit"+n,o["Moz"+e]="moz"+n,o}var Ve={animationend:$e("Animation","AnimationEnd"),animationiteration:$e("Animation","AnimationIteration"),animationstart:$e("Animation","AnimationStart"),transitionend:$e("Transition","TransitionEnd")},Le={},Ye={};h&&(Ye=document.createElement("div").style,"AnimationEvent"in window||(delete Ve.animationend.animation,delete Ve.animationiteration.animation,delete Ve.animationstart.animation),"TransitionEvent"in window||delete Ve.transitionend.transition);function Ee(e){if(Le[e])return Le[e];if(!Ve[e])return e;var n=Ve[e],o;for(o in n)if(n.hasOwnProperty(o)&&o in Ye)return Le[e]=n[o];return e}var nt=Ee("animationend"),rt=Ee("animationiteration"),at=Ee("animationstart"),dt=Ee("transitionend"),wn=new Map,st="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 jt(e,n){wn.set(e,n),c(n,[e])}for(var Vt=0;Vt<st.length;Vt++){var Xo=st[Vt],cn=Xo.toLowerCase(),wo=Xo[0].toUpperCase()+Xo.slice(1);jt(cn,"on"+wo)}jt(nt,"onAnimationEnd"),jt(rt,"onAnimationIteration"),jt(at,"onAnimationStart"),jt("dblclick","onDoubleClick"),jt("focusin","onFocus"),jt("focusout","onBlur"),jt(dt,"onTransitionEnd"),d("onMouseEnter",["mouseout","mouseover"]),d("onMouseLeave",["mouseout","mouseover"]),d("onPointerEnter",["pointerout","pointerover"]),d("onPointerLeave",["pointerout","pointerover"]),c("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),c("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),c("onBeforeInput",["compositionend","keypress","textInput","paste"]),c("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),c("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),c("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var bo="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(" "),w0=new Set("cancel close invalid load scroll toggle".split(" ").concat(bo));function sd(e,n,o){var u=e.type||"unknown-event";e.currentTarget=o,Gn(u,n,void 0,e),e.currentTarget=null}function ad(e,n){n=(n&4)!==0;for(var o=0;o<e.length;o++){var u=e[o],p=u.event;u=u.listeners;e:{var g=void 0;if(n)for(var E=u.length-1;0<=E;E--){var D=u[E],X=D.instance,ye=D.currentTarget;if(D=D.listener,X!==g&&p.isPropagationStopped())break e;sd(p,D,ye),g=X}else for(E=0;E<u.length;E++){if(D=u[E],X=D.instance,ye=D.currentTarget,D=D.listener,X!==g&&p.isPropagationStopped())break e;sd(p,D,ye),g=X}}}if(Qn)throw e=fr,Qn=!1,fr=null,e}function Pt(e,n){var o=n[Wu];o===void 0&&(o=n[Wu]=new Set);var u=e+"__bubble";o.has(u)||(ld(n,e,2,!1),o.add(u))}function Fu(e,n,o){var u=0;n&&(u|=4),ld(o,e,u,n)}var el="_reactListening"+Math.random().toString(36).slice(2);function Js(e){if(!e[el]){e[el]=!0,s.forEach(function(o){o!=="selectionchange"&&(w0.has(o)||Fu(o,!1,e),Fu(o,!0,e))});var n=e.nodeType===9?e:e.ownerDocument;n===null||n[el]||(n[el]=!0,Fu("selectionchange",!1,n))}}function ld(e,n,o,u){switch(qi(n)){case 1:var p=mi;break;case 4:p=Ru;break;default:p=zs}o=p.bind(null,n,o,e),p=void 0,!ur||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(p=!0),u?p!==void 0?e.addEventListener(n,o,{capture:!0,passive:p}):e.addEventListener(n,o,!0):p!==void 0?e.addEventListener(n,o,{passive:p}):e.addEventListener(n,o,!1)}function Bu(e,n,o,u,p){var g=u;if((n&1)===0&&(n&2)===0&&u!==null)e:for(;;){if(u===null)return;var E=u.tag;if(E===3||E===4){var D=u.stateNode.containerInfo;if(D===p||D.nodeType===8&&D.parentNode===p)break;if(E===4)for(E=u.return;E!==null;){var X=E.tag;if((X===3||X===4)&&(X=E.stateNode.containerInfo,X===p||X.nodeType===8&&X.parentNode===p))return;E=E.return}for(;D!==null;){if(E=_i(D),E===null)return;if(X=E.tag,X===5||X===6){u=g=E;continue e}D=D.parentNode}}u=u.return}Wn(function(){var ye=g,Pe=ar(o),Te=[];e:{var je=wn.get(e);if(je!==void 0){var Ke=Xi,Qe=e;switch(e){case"keypress":if(Ho(o)===0)break e;case"keydown":case"keyup":Ke=Ks;break;case"focusin":Qe="focus",Ke=Gi;break;case"focusout":Qe="blur",Ke=Gi;break;case"beforeblur":case"afterblur":Ke=Gi;break;case"click":if(o.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Ke=Qi;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Ke=wi;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Ke=Ws;break;case nt:case rt:case at:Ke=Ua;break;case dt:Ke=Wa;break;case"scroll":Ke=Vo;break;case"wheel":Ke=Ya;break;case"copy":case"cut":case"paste":Ke=Zi;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Ke=qa}var Ge=(n&4)!==0,Bt=!Ge&&e==="scroll",he=Ge?je!==null?je+"Capture":null:je;Ge=[];for(var ne=ye,me;ne!==null;){me=ne;var Fe=me.stateNode;if(me.tag===5&&Fe!==null&&(me=Fe,he!==null&&(Fe=Yn(ne,he),Fe!=null&&Ge.push(Zs(ne,Fe,me)))),Bt)break;ne=ne.return}0<Ge.length&&(je=new Ke(je,Qe,null,o,Pe),Te.push({event:je,listeners:Ge}))}}if((n&7)===0){e:{if(je=e==="mouseover"||e==="pointerover",Ke=e==="mouseout"||e==="pointerout",je&&o!==jn&&(Qe=o.relatedTarget||o.fromElement)&&(_i(Qe)||Qe[_o]))break e;if((Ke||je)&&(je=Pe.window===Pe?Pe:(je=Pe.ownerDocument)?je.defaultView||je.parentWindow:window,Ke?(Qe=o.relatedTarget||o.toElement,Ke=ye,Qe=Qe?_i(Qe):null,Qe!==null&&(Bt=z(Qe),Qe!==Bt||Qe.tag!==5&&Qe.tag!==6)&&(Qe=null)):(Ke=null,Qe=ye),Ke!==Qe)){if(Ge=Qi,Fe="onMouseLeave",he="onMouseEnter",ne="mouse",(e==="pointerout"||e==="pointerover")&&(Ge=qa,Fe="onPointerLeave",he="onPointerEnter",ne="pointer"),Bt=Ke==null?je:as(Ke),me=Qe==null?je:as(Qe),je=new Ge(Fe,ne+"leave",Ke,o,Pe),je.target=Bt,je.relatedTarget=me,Fe=null,_i(Pe)===ye&&(Ge=new Ge(he,ne+"enter",Qe,o,Pe),Ge.target=me,Ge.relatedTarget=Bt,Fe=Ge),Bt=Fe,Ke&&Qe)t:{for(Ge=Ke,he=Qe,ne=0,me=Ge;me;me=is(me))ne++;for(me=0,Fe=he;Fe;Fe=is(Fe))me++;for(;0<ne-me;)Ge=is(Ge),ne--;for(;0<me-ne;)he=is(he),me--;for(;ne--;){if(Ge===he||he!==null&&Ge===he.alternate)break t;Ge=is(Ge),he=is(he)}Ge=null}else Ge=null;Ke!==null&&ud(Te,je,Ke,Ge,!1),Qe!==null&&Bt!==null&&ud(Te,Bt,Qe,Ge,!0)}}e:{if(je=ye?as(ye):window,Ke=je.nodeName&&je.nodeName.toLowerCase(),Ke==="select"||Ke==="input"&&je.type==="file")var Je=Yo;else if(yo(je))if(Mr)Je=O;else{Je=N;var et=_}else(Ke=je.nodeName)&&Ke.toLowerCase()==="input"&&(je.type==="checkbox"||je.type==="radio")&&(Je=M);if(Je&&(Je=Je(e,ye))){Za(Te,Je,o,Pe);break e}et&&et(e,je,ye),e==="focusout"&&(et=je._wrapperState)&&et.controlled&&je.type==="number"&&Gt(je,"number",je.value)}switch(et=ye?as(ye):window,e){case"focusin":(yo(et)||et.contentEditable==="true")&&(pe=et,ve=ye,Ne=null);break;case"focusout":Ne=ve=pe=null;break;case"mousedown":Ce=!0;break;case"contextmenu":case"mouseup":case"dragend":Ce=!1,De(Te,o,Pe);break;case"selectionchange":if(ge)break;case"keydown":case"keyup":De(Te,o,Pe)}var tt;if(Ys)e:{switch(e){case"compositionstart":var ot="onCompositionStart";break e;case"compositionend":ot="onCompositionEnd";break e;case"compositionupdate":ot="onCompositionUpdate";break e}ot=void 0}else jr?Ga(e,o)&&(ot="onCompositionEnd"):e==="keydown"&&o.keyCode===229&&(ot="onCompositionStart");ot&&(Qs&&o.locale!=="ko"&&(jr||ot!=="onCompositionStart"?ot==="onCompositionEnd"&&jr&&(tt=Yi()):(qr=Pe,Fs="value"in qr?qr.value:qr.textContent,jr=!0)),et=tl(ye,ot),0<et.length&&(ot=new Wr(ot,e,null,o,Pe),Te.push({event:ot,listeners:et}),tt?ot.data=tt:(tt=Ja(o),tt!==null&&(ot.data=tt)))),(tt=Xs?Pr(e,o):Lt(e,o))&&(ye=tl(ye,"onBeforeInput"),0<ye.length&&(Pe=new Wr("onBeforeInput","beforeinput",null,o,Pe),Te.push({event:Pe,listeners:ye}),Pe.data=tt))}ad(Te,n)})}function Zs(e,n,o){return{instance:e,listener:n,currentTarget:o}}function tl(e,n){for(var o=n+"Capture",u=[];e!==null;){var p=e,g=p.stateNode;p.tag===5&&g!==null&&(p=g,g=Yn(e,o),g!=null&&u.unshift(Zs(e,g,p)),g=Yn(e,n),g!=null&&u.push(Zs(e,g,p))),e=e.return}return u}function is(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function ud(e,n,o,u,p){for(var g=n._reactName,E=[];o!==null&&o!==u;){var D=o,X=D.alternate,ye=D.stateNode;if(X!==null&&X===u)break;D.tag===5&&ye!==null&&(D=ye,p?(X=Yn(o,g),X!=null&&E.unshift(Zs(o,X,D))):p||(X=Yn(o,g),X!=null&&E.push(Zs(o,X,D)))),o=o.return}E.length!==0&&e.push({event:n,listeners:E})}var b0=/\r\n?/g,_0=/\u0000|\uFFFD/g;function cd(e){return(typeof e=="string"?e:""+e).replace(b0,`
|
|
38
|
+
`).replace(_0,"")}function nl(e,n,o){if(n=cd(n),cd(e)!==n&&o)throw Error(i(425))}function rl(){}var Hu=null,Vu=null;function Uu(e,n){return e==="textarea"||e==="noscript"||typeof n.children=="string"||typeof n.children=="number"||typeof n.dangerouslySetInnerHTML=="object"&&n.dangerouslySetInnerHTML!==null&&n.dangerouslySetInnerHTML.__html!=null}var Ku=typeof setTimeout=="function"?setTimeout:void 0,S0=typeof clearTimeout=="function"?clearTimeout:void 0,fd=typeof Promise=="function"?Promise:void 0,k0=typeof queueMicrotask=="function"?queueMicrotask:typeof fd<"u"?function(e){return fd.resolve(null).then(e).catch(N0)}:Ku;function N0(e){setTimeout(function(){throw e})}function qu(e,n){var o=n,u=0;do{var p=o.nextSibling;if(e.removeChild(o),p&&p.nodeType===8)if(o=p.data,o==="/$"){if(u===0){e.removeChild(p),fo(n);return}u--}else o!=="$"&&o!=="$?"&&o!=="$!"||u++;o=p}while(o);fo(n)}function Qo(e){for(;e!=null;e=e.nextSibling){var n=e.nodeType;if(n===1||n===3)break;if(n===8){if(n=e.data,n==="$"||n==="$!"||n==="$?")break;if(n==="/$")return null}}return e}function dd(e){e=e.previousSibling;for(var n=0;e;){if(e.nodeType===8){var o=e.data;if(o==="$"||o==="$!"||o==="$?"){if(n===0)return e;n--}else o==="/$"&&n++}e=e.previousSibling}return null}var ss=Math.random().toString(36).slice(2),Yr="__reactFiber$"+ss,ea="__reactProps$"+ss,_o="__reactContainer$"+ss,Wu="__reactEvents$"+ss,E0="__reactListeners$"+ss,C0="__reactHandles$"+ss;function _i(e){var n=e[Yr];if(n)return n;for(var o=e.parentNode;o;){if(n=o[_o]||o[Yr]){if(o=n.alternate,n.child!==null||o!==null&&o.child!==null)for(e=dd(e);e!==null;){if(o=e[Yr])return o;e=dd(e)}return n}e=o,o=e.parentNode}return null}function ta(e){return e=e[Yr]||e[_o],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function as(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(i(33))}function ol(e){return e[ea]||null}var Yu=[],ls=-1;function Go(e){return{current:e}}function Mt(e){0>ls||(e.current=Yu[ls],Yu[ls]=null,ls--)}function Et(e,n){ls++,Yu[ls]=e.current,e.current=n}var Jo={},bn=Go(Jo),Dn=Go(!1),Si=Jo;function us(e,n){var o=e.type.contextTypes;if(!o)return Jo;var u=e.stateNode;if(u&&u.__reactInternalMemoizedUnmaskedChildContext===n)return u.__reactInternalMemoizedMaskedChildContext;var p={},g;for(g in o)p[g]=n[g];return u&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=n,e.__reactInternalMemoizedMaskedChildContext=p),p}function zn(e){return e=e.childContextTypes,e!=null}function il(){Mt(Dn),Mt(bn)}function pd(e,n,o){if(bn.current!==Jo)throw Error(i(168));Et(bn,n),Et(Dn,o)}function hd(e,n,o){var u=e.stateNode;if(n=n.childContextTypes,typeof u.getChildContext!="function")return o;u=u.getChildContext();for(var p in u)if(!(p in n))throw Error(i(108,Ae(e)||"Unknown",p));return B({},o,u)}function sl(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Jo,Si=bn.current,Et(bn,e),Et(Dn,Dn.current),!0}function md(e,n,o){var u=e.stateNode;if(!u)throw Error(i(169));o?(e=hd(e,n,Si),u.__reactInternalMemoizedMergedChildContext=e,Mt(Dn),Mt(bn),Et(bn,e)):Mt(Dn),Et(Dn,o)}var So=null,al=!1,Xu=!1;function gd(e){So===null?So=[e]:So.push(e)}function j0(e){al=!0,gd(e)}function Zo(){if(!Xu&&So!==null){Xu=!0;var e=0,n=bt;try{var o=So;for(bt=1;e<o.length;e++){var u=o[e];do u=u(!0);while(u!==null)}So=null,al=!1}catch(p){throw So!==null&&(So=So.slice(e+1)),yn(Jn,Zo),p}finally{bt=n,Xu=!1}}return null}var cs=[],fs=0,ll=null,ul=0,gr=[],yr=0,ki=null,ko=1,No="";function Ni(e,n){cs[fs++]=ul,cs[fs++]=ll,ll=e,ul=n}function yd(e,n,o){gr[yr++]=ko,gr[yr++]=No,gr[yr++]=ki,ki=e;var u=ko;e=No;var p=32-vn(u)-1;u&=~(1<<p),o+=1;var g=32-vn(n)+p;if(30<g){var E=p-p%5;g=(u&(1<<E)-1).toString(32),u>>=E,p-=E,ko=1<<32-vn(n)+p|o<<p|u,No=g+e}else ko=1<<g|o<<p|u,No=e}function Qu(e){e.return!==null&&(Ni(e,1),yd(e,1,0))}function Gu(e){for(;e===ll;)ll=cs[--fs],cs[fs]=null,ul=cs[--fs],cs[fs]=null;for(;e===ki;)ki=gr[--yr],gr[yr]=null,No=gr[--yr],gr[yr]=null,ko=gr[--yr],gr[yr]=null}var nr=null,rr=null,At=!1,$r=null;function vd(e,n){var o=br(5,null,null,0);o.elementType="DELETED",o.stateNode=n,o.return=e,n=e.deletions,n===null?(e.deletions=[o],e.flags|=16):n.push(o)}function xd(e,n){switch(e.tag){case 5:var o=e.type;return n=n.nodeType!==1||o.toLowerCase()!==n.nodeName.toLowerCase()?null:n,n!==null?(e.stateNode=n,nr=e,rr=Qo(n.firstChild),!0):!1;case 6:return n=e.pendingProps===""||n.nodeType!==3?null:n,n!==null?(e.stateNode=n,nr=e,rr=null,!0):!1;case 13:return n=n.nodeType!==8?null:n,n!==null?(o=ki!==null?{id:ko,overflow:No}:null,e.memoizedState={dehydrated:n,treeContext:o,retryLane:1073741824},o=br(18,null,null,0),o.stateNode=n,o.return=e,e.child=o,nr=e,rr=null,!0):!1;default:return!1}}function Ju(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Zu(e){if(At){var n=rr;if(n){var o=n;if(!xd(e,n)){if(Ju(e))throw Error(i(418));n=Qo(o.nextSibling);var u=nr;n&&xd(e,n)?vd(u,o):(e.flags=e.flags&-4097|2,At=!1,nr=e)}}else{if(Ju(e))throw Error(i(418));e.flags=e.flags&-4097|2,At=!1,nr=e}}}function wd(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;nr=e}function cl(e){if(e!==nr)return!1;if(!At)return wd(e),At=!0,!1;var n;if((n=e.tag!==3)&&!(n=e.tag!==5)&&(n=e.type,n=n!=="head"&&n!=="body"&&!Uu(e.type,e.memoizedProps)),n&&(n=rr)){if(Ju(e))throw bd(),Error(i(418));for(;n;)vd(e,n),n=Qo(n.nextSibling)}if(wd(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(317));e:{for(e=e.nextSibling,n=0;e;){if(e.nodeType===8){var o=e.data;if(o==="/$"){if(n===0){rr=Qo(e.nextSibling);break e}n--}else o!=="$"&&o!=="$!"&&o!=="$?"||n++}e=e.nextSibling}rr=null}}else rr=nr?Qo(e.stateNode.nextSibling):null;return!0}function bd(){for(var e=rr;e;)e=Qo(e.nextSibling)}function ds(){rr=nr=null,At=!1}function ec(e){$r===null?$r=[e]:$r.push(e)}var P0=R.ReactCurrentBatchConfig;function na(e,n,o){if(e=o.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(o._owner){if(o=o._owner,o){if(o.tag!==1)throw Error(i(309));var u=o.stateNode}if(!u)throw Error(i(147,e));var p=u,g=""+e;return n!==null&&n.ref!==null&&typeof n.ref=="function"&&n.ref._stringRef===g?n.ref:(n=function(E){var D=p.refs;E===null?delete D[g]:D[g]=E},n._stringRef=g,n)}if(typeof e!="string")throw Error(i(284));if(!o._owner)throw Error(i(290,e))}return e}function fl(e,n){throw e=Object.prototype.toString.call(n),Error(i(31,e==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":e))}function _d(e){var n=e._init;return n(e._payload)}function Sd(e){function n(he,ne){if(e){var me=he.deletions;me===null?(he.deletions=[ne],he.flags|=16):me.push(ne)}}function o(he,ne){if(!e)return null;for(;ne!==null;)n(he,ne),ne=ne.sibling;return null}function u(he,ne){for(he=new Map;ne!==null;)ne.key!==null?he.set(ne.key,ne):he.set(ne.index,ne),ne=ne.sibling;return he}function p(he,ne){return he=ai(he,ne),he.index=0,he.sibling=null,he}function g(he,ne,me){return he.index=me,e?(me=he.alternate,me!==null?(me=me.index,me<ne?(he.flags|=2,ne):me):(he.flags|=2,ne)):(he.flags|=1048576,ne)}function E(he){return e&&he.alternate===null&&(he.flags|=2),he}function D(he,ne,me,Fe){return ne===null||ne.tag!==6?(ne=Kc(me,he.mode,Fe),ne.return=he,ne):(ne=p(ne,me),ne.return=he,ne)}function X(he,ne,me,Fe){var Je=me.type;return Je===Q?Pe(he,ne,me.props.children,Fe,me.key):ne!==null&&(ne.elementType===Je||typeof Je=="object"&&Je!==null&&Je.$$typeof===G&&_d(Je)===ne.type)?(Fe=p(ne,me.props),Fe.ref=na(he,ne,me),Fe.return=he,Fe):(Fe=Ol(me.type,me.key,me.props,null,he.mode,Fe),Fe.ref=na(he,ne,me),Fe.return=he,Fe)}function ye(he,ne,me,Fe){return ne===null||ne.tag!==4||ne.stateNode.containerInfo!==me.containerInfo||ne.stateNode.implementation!==me.implementation?(ne=qc(me,he.mode,Fe),ne.return=he,ne):(ne=p(ne,me.children||[]),ne.return=he,ne)}function Pe(he,ne,me,Fe,Je){return ne===null||ne.tag!==7?(ne=Ii(me,he.mode,Fe,Je),ne.return=he,ne):(ne=p(ne,me),ne.return=he,ne)}function Te(he,ne,me){if(typeof ne=="string"&&ne!==""||typeof ne=="number")return ne=Kc(""+ne,he.mode,me),ne.return=he,ne;if(typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case H:return me=Ol(ne.type,ne.key,ne.props,null,he.mode,me),me.ref=na(he,null,ne),me.return=he,me;case V:return ne=qc(ne,he.mode,me),ne.return=he,ne;case G:var Fe=ne._init;return Te(he,Fe(ne._payload),me)}if(Rt(ne)||W(ne))return ne=Ii(ne,he.mode,me,null),ne.return=he,ne;fl(he,ne)}return null}function je(he,ne,me,Fe){var Je=ne!==null?ne.key:null;if(typeof me=="string"&&me!==""||typeof me=="number")return Je!==null?null:D(he,ne,""+me,Fe);if(typeof me=="object"&&me!==null){switch(me.$$typeof){case H:return me.key===Je?X(he,ne,me,Fe):null;case V:return me.key===Je?ye(he,ne,me,Fe):null;case G:return Je=me._init,je(he,ne,Je(me._payload),Fe)}if(Rt(me)||W(me))return Je!==null?null:Pe(he,ne,me,Fe,null);fl(he,me)}return null}function Ke(he,ne,me,Fe,Je){if(typeof Fe=="string"&&Fe!==""||typeof Fe=="number")return he=he.get(me)||null,D(ne,he,""+Fe,Je);if(typeof Fe=="object"&&Fe!==null){switch(Fe.$$typeof){case H:return he=he.get(Fe.key===null?me:Fe.key)||null,X(ne,he,Fe,Je);case V:return he=he.get(Fe.key===null?me:Fe.key)||null,ye(ne,he,Fe,Je);case G:var et=Fe._init;return Ke(he,ne,me,et(Fe._payload),Je)}if(Rt(Fe)||W(Fe))return he=he.get(me)||null,Pe(ne,he,Fe,Je,null);fl(ne,Fe)}return null}function Qe(he,ne,me,Fe){for(var Je=null,et=null,tt=ne,ot=ne=0,rn=null;tt!==null&&ot<me.length;ot++){tt.index>ot?(rn=tt,tt=null):rn=tt.sibling;var _t=je(he,tt,me[ot],Fe);if(_t===null){tt===null&&(tt=rn);break}e&&tt&&_t.alternate===null&&n(he,tt),ne=g(_t,ne,ot),et===null?Je=_t:et.sibling=_t,et=_t,tt=rn}if(ot===me.length)return o(he,tt),At&&Ni(he,ot),Je;if(tt===null){for(;ot<me.length;ot++)tt=Te(he,me[ot],Fe),tt!==null&&(ne=g(tt,ne,ot),et===null?Je=tt:et.sibling=tt,et=tt);return At&&Ni(he,ot),Je}for(tt=u(he,tt);ot<me.length;ot++)rn=Ke(tt,he,ot,me[ot],Fe),rn!==null&&(e&&rn.alternate!==null&&tt.delete(rn.key===null?ot:rn.key),ne=g(rn,ne,ot),et===null?Je=rn:et.sibling=rn,et=rn);return e&&tt.forEach(function(li){return n(he,li)}),At&&Ni(he,ot),Je}function Ge(he,ne,me,Fe){var Je=W(me);if(typeof Je!="function")throw Error(i(150));if(me=Je.call(me),me==null)throw Error(i(151));for(var et=Je=null,tt=ne,ot=ne=0,rn=null,_t=me.next();tt!==null&&!_t.done;ot++,_t=me.next()){tt.index>ot?(rn=tt,tt=null):rn=tt.sibling;var li=je(he,tt,_t.value,Fe);if(li===null){tt===null&&(tt=rn);break}e&&tt&&li.alternate===null&&n(he,tt),ne=g(li,ne,ot),et===null?Je=li:et.sibling=li,et=li,tt=rn}if(_t.done)return o(he,tt),At&&Ni(he,ot),Je;if(tt===null){for(;!_t.done;ot++,_t=me.next())_t=Te(he,_t.value,Fe),_t!==null&&(ne=g(_t,ne,ot),et===null?Je=_t:et.sibling=_t,et=_t);return At&&Ni(he,ot),Je}for(tt=u(he,tt);!_t.done;ot++,_t=me.next())_t=Ke(tt,he,ot,_t.value,Fe),_t!==null&&(e&&_t.alternate!==null&&tt.delete(_t.key===null?ot:_t.key),ne=g(_t,ne,ot),et===null?Je=_t:et.sibling=_t,et=_t);return e&&tt.forEach(function(ly){return n(he,ly)}),At&&Ni(he,ot),Je}function Bt(he,ne,me,Fe){if(typeof me=="object"&&me!==null&&me.type===Q&&me.key===null&&(me=me.props.children),typeof me=="object"&&me!==null){switch(me.$$typeof){case H:e:{for(var Je=me.key,et=ne;et!==null;){if(et.key===Je){if(Je=me.type,Je===Q){if(et.tag===7){o(he,et.sibling),ne=p(et,me.props.children),ne.return=he,he=ne;break e}}else if(et.elementType===Je||typeof Je=="object"&&Je!==null&&Je.$$typeof===G&&_d(Je)===et.type){o(he,et.sibling),ne=p(et,me.props),ne.ref=na(he,et,me),ne.return=he,he=ne;break e}o(he,et);break}else n(he,et);et=et.sibling}me.type===Q?(ne=Ii(me.props.children,he.mode,Fe,me.key),ne.return=he,he=ne):(Fe=Ol(me.type,me.key,me.props,null,he.mode,Fe),Fe.ref=na(he,ne,me),Fe.return=he,he=Fe)}return E(he);case V:e:{for(et=me.key;ne!==null;){if(ne.key===et)if(ne.tag===4&&ne.stateNode.containerInfo===me.containerInfo&&ne.stateNode.implementation===me.implementation){o(he,ne.sibling),ne=p(ne,me.children||[]),ne.return=he,he=ne;break e}else{o(he,ne);break}else n(he,ne);ne=ne.sibling}ne=qc(me,he.mode,Fe),ne.return=he,he=ne}return E(he);case G:return et=me._init,Bt(he,ne,et(me._payload),Fe)}if(Rt(me))return Qe(he,ne,me,Fe);if(W(me))return Ge(he,ne,me,Fe);fl(he,me)}return typeof me=="string"&&me!==""||typeof me=="number"?(me=""+me,ne!==null&&ne.tag===6?(o(he,ne.sibling),ne=p(ne,me),ne.return=he,he=ne):(o(he,ne),ne=Kc(me,he.mode,Fe),ne.return=he,he=ne),E(he)):o(he,ne)}return Bt}var ps=Sd(!0),kd=Sd(!1),dl=Go(null),pl=null,hs=null,tc=null;function nc(){tc=hs=pl=null}function rc(e){var n=dl.current;Mt(dl),e._currentValue=n}function oc(e,n,o){for(;e!==null;){var u=e.alternate;if((e.childLanes&n)!==n?(e.childLanes|=n,u!==null&&(u.childLanes|=n)):u!==null&&(u.childLanes&n)!==n&&(u.childLanes|=n),e===o)break;e=e.return}}function ms(e,n){pl=e,tc=hs=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&n)!==0&&(Fn=!0),e.firstContext=null)}function vr(e){var n=e._currentValue;if(tc!==e)if(e={context:e,memoizedValue:n,next:null},hs===null){if(pl===null)throw Error(i(308));hs=e,pl.dependencies={lanes:0,firstContext:e}}else hs=hs.next=e;return n}var Ei=null;function ic(e){Ei===null?Ei=[e]:Ei.push(e)}function Nd(e,n,o,u){var p=n.interleaved;return p===null?(o.next=o,ic(n)):(o.next=p.next,p.next=o),n.interleaved=o,Eo(e,u)}function Eo(e,n){e.lanes|=n;var o=e.alternate;for(o!==null&&(o.lanes|=n),o=e,e=e.return;e!==null;)e.childLanes|=n,o=e.alternate,o!==null&&(o.childLanes|=n),o=e,e=e.return;return o.tag===3?o.stateNode:null}var ei=!1;function sc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Ed(e,n){e=e.updateQueue,n.updateQueue===e&&(n.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Co(e,n){return{eventTime:e,lane:n,tag:0,payload:null,callback:null,next:null}}function ti(e,n,o){var u=e.updateQueue;if(u===null)return null;if(u=u.shared,(wt&2)!==0){var p=u.pending;return p===null?n.next=n:(n.next=p.next,p.next=n),u.pending=n,Eo(e,o)}return p=u.interleaved,p===null?(n.next=n,ic(u)):(n.next=p.next,p.next=n),u.interleaved=n,Eo(e,o)}function hl(e,n,o){if(n=n.updateQueue,n!==null&&(n=n.shared,(o&4194240)!==0)){var u=n.lanes;u&=e.pendingLanes,o|=u,n.lanes=o,zo(e,o)}}function Cd(e,n){var o=e.updateQueue,u=e.alternate;if(u!==null&&(u=u.updateQueue,o===u)){var p=null,g=null;if(o=o.firstBaseUpdate,o!==null){do{var E={eventTime:o.eventTime,lane:o.lane,tag:o.tag,payload:o.payload,callback:o.callback,next:null};g===null?p=g=E:g=g.next=E,o=o.next}while(o!==null);g===null?p=g=n:g=g.next=n}else p=g=n;o={baseState:u.baseState,firstBaseUpdate:p,lastBaseUpdate:g,shared:u.shared,effects:u.effects},e.updateQueue=o;return}e=o.lastBaseUpdate,e===null?o.firstBaseUpdate=n:e.next=n,o.lastBaseUpdate=n}function ml(e,n,o,u){var p=e.updateQueue;ei=!1;var g=p.firstBaseUpdate,E=p.lastBaseUpdate,D=p.shared.pending;if(D!==null){p.shared.pending=null;var X=D,ye=X.next;X.next=null,E===null?g=ye:E.next=ye,E=X;var Pe=e.alternate;Pe!==null&&(Pe=Pe.updateQueue,D=Pe.lastBaseUpdate,D!==E&&(D===null?Pe.firstBaseUpdate=ye:D.next=ye,Pe.lastBaseUpdate=X))}if(g!==null){var Te=p.baseState;E=0,Pe=ye=X=null,D=g;do{var je=D.lane,Ke=D.eventTime;if((u&je)===je){Pe!==null&&(Pe=Pe.next={eventTime:Ke,lane:0,tag:D.tag,payload:D.payload,callback:D.callback,next:null});e:{var Qe=e,Ge=D;switch(je=n,Ke=o,Ge.tag){case 1:if(Qe=Ge.payload,typeof Qe=="function"){Te=Qe.call(Ke,Te,je);break e}Te=Qe;break e;case 3:Qe.flags=Qe.flags&-65537|128;case 0:if(Qe=Ge.payload,je=typeof Qe=="function"?Qe.call(Ke,Te,je):Qe,je==null)break e;Te=B({},Te,je);break e;case 2:ei=!0}}D.callback!==null&&D.lane!==0&&(e.flags|=64,je=p.effects,je===null?p.effects=[D]:je.push(D))}else Ke={eventTime:Ke,lane:je,tag:D.tag,payload:D.payload,callback:D.callback,next:null},Pe===null?(ye=Pe=Ke,X=Te):Pe=Pe.next=Ke,E|=je;if(D=D.next,D===null){if(D=p.shared.pending,D===null)break;je=D,D=je.next,je.next=null,p.lastBaseUpdate=je,p.shared.pending=null}}while(!0);if(Pe===null&&(X=Te),p.baseState=X,p.firstBaseUpdate=ye,p.lastBaseUpdate=Pe,n=p.shared.interleaved,n!==null){p=n;do E|=p.lane,p=p.next;while(p!==n)}else g===null&&(p.shared.lanes=0);Pi|=E,e.lanes=E,e.memoizedState=Te}}function jd(e,n,o){if(e=n.effects,n.effects=null,e!==null)for(n=0;n<e.length;n++){var u=e[n],p=u.callback;if(p!==null){if(u.callback=null,u=o,typeof p!="function")throw Error(i(191,p));p.call(u)}}}var ra={},Xr=Go(ra),oa=Go(ra),ia=Go(ra);function Ci(e){if(e===ra)throw Error(i(174));return e}function ac(e,n){switch(Et(ia,n),Et(oa,e),Et(Xr,ra),e=n.nodeType,e){case 9:case 11:n=(n=n.documentElement)?n.namespaceURI:Yt(null,"");break;default:e=e===8?n.parentNode:n,n=e.namespaceURI||null,e=e.tagName,n=Yt(n,e)}Mt(Xr),Et(Xr,n)}function gs(){Mt(Xr),Mt(oa),Mt(ia)}function Pd(e){Ci(ia.current);var n=Ci(Xr.current),o=Yt(n,e.type);n!==o&&(Et(oa,e),Et(Xr,o))}function lc(e){oa.current===e&&(Mt(Xr),Mt(oa))}var Dt=Go(0);function gl(e){for(var n=e;n!==null;){if(n.tag===13){var o=n.memoizedState;if(o!==null&&(o=o.dehydrated,o===null||o.data==="$?"||o.data==="$!"))return n}else if(n.tag===19&&n.memoizedProps.revealOrder!==void 0){if((n.flags&128)!==0)return n}else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}var uc=[];function cc(){for(var e=0;e<uc.length;e++)uc[e]._workInProgressVersionPrimary=null;uc.length=0}var yl=R.ReactCurrentDispatcher,fc=R.ReactCurrentBatchConfig,ji=0,zt=null,Xt=null,tn=null,vl=!1,sa=!1,aa=0,M0=0;function _n(){throw Error(i(321))}function dc(e,n){if(n===null)return!1;for(var o=0;o<n.length&&o<e.length;o++)if(!ue(e[o],n[o]))return!1;return!0}function pc(e,n,o,u,p,g){if(ji=g,zt=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,yl.current=e===null||e.memoizedState===null?A0:O0,e=o(u,p),sa){g=0;do{if(sa=!1,aa=0,25<=g)throw Error(i(301));g+=1,tn=Xt=null,n.updateQueue=null,yl.current=R0,e=o(u,p)}while(sa)}if(yl.current=bl,n=Xt!==null&&Xt.next!==null,ji=0,tn=Xt=zt=null,vl=!1,n)throw Error(i(300));return e}function hc(){var e=aa!==0;return aa=0,e}function Qr(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return tn===null?zt.memoizedState=tn=e:tn=tn.next=e,tn}function xr(){if(Xt===null){var e=zt.alternate;e=e!==null?e.memoizedState:null}else e=Xt.next;var n=tn===null?zt.memoizedState:tn.next;if(n!==null)tn=n,Xt=e;else{if(e===null)throw Error(i(310));Xt=e,e={memoizedState:Xt.memoizedState,baseState:Xt.baseState,baseQueue:Xt.baseQueue,queue:Xt.queue,next:null},tn===null?zt.memoizedState=tn=e:tn=tn.next=e}return tn}function la(e,n){return typeof n=="function"?n(e):n}function mc(e){var n=xr(),o=n.queue;if(o===null)throw Error(i(311));o.lastRenderedReducer=e;var u=Xt,p=u.baseQueue,g=o.pending;if(g!==null){if(p!==null){var E=p.next;p.next=g.next,g.next=E}u.baseQueue=p=g,o.pending=null}if(p!==null){g=p.next,u=u.baseState;var D=E=null,X=null,ye=g;do{var Pe=ye.lane;if((ji&Pe)===Pe)X!==null&&(X=X.next={lane:0,action:ye.action,hasEagerState:ye.hasEagerState,eagerState:ye.eagerState,next:null}),u=ye.hasEagerState?ye.eagerState:e(u,ye.action);else{var Te={lane:Pe,action:ye.action,hasEagerState:ye.hasEagerState,eagerState:ye.eagerState,next:null};X===null?(D=X=Te,E=u):X=X.next=Te,zt.lanes|=Pe,Pi|=Pe}ye=ye.next}while(ye!==null&&ye!==g);X===null?E=u:X.next=D,ue(u,n.memoizedState)||(Fn=!0),n.memoizedState=u,n.baseState=E,n.baseQueue=X,o.lastRenderedState=u}if(e=o.interleaved,e!==null){p=e;do g=p.lane,zt.lanes|=g,Pi|=g,p=p.next;while(p!==e)}else p===null&&(o.lanes=0);return[n.memoizedState,o.dispatch]}function gc(e){var n=xr(),o=n.queue;if(o===null)throw Error(i(311));o.lastRenderedReducer=e;var u=o.dispatch,p=o.pending,g=n.memoizedState;if(p!==null){o.pending=null;var E=p=p.next;do g=e(g,E.action),E=E.next;while(E!==p);ue(g,n.memoizedState)||(Fn=!0),n.memoizedState=g,n.baseQueue===null&&(n.baseState=g),o.lastRenderedState=g}return[g,u]}function Md(){}function $d(e,n){var o=zt,u=xr(),p=n(),g=!ue(u.memoizedState,p);if(g&&(u.memoizedState=p,Fn=!0),u=u.queue,yc(Ad.bind(null,o,u,e),[e]),u.getSnapshot!==n||g||tn!==null&&tn.memoizedState.tag&1){if(o.flags|=2048,ua(9,Id.bind(null,o,u,p,n),void 0,null),nn===null)throw Error(i(349));(ji&30)!==0||Td(o,n,p)}return p}function Td(e,n,o){e.flags|=16384,e={getSnapshot:n,value:o},n=zt.updateQueue,n===null?(n={lastEffect:null,stores:null},zt.updateQueue=n,n.stores=[e]):(o=n.stores,o===null?n.stores=[e]:o.push(e))}function Id(e,n,o,u){n.value=o,n.getSnapshot=u,Od(n)&&Rd(e)}function Ad(e,n,o){return o(function(){Od(n)&&Rd(e)})}function Od(e){var n=e.getSnapshot;e=e.value;try{var o=n();return!ue(e,o)}catch{return!0}}function Rd(e){var n=Eo(e,1);n!==null&&Or(n,e,1,-1)}function Ld(e){var n=Qr();return typeof e=="function"&&(e=e()),n.memoizedState=n.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:la,lastRenderedState:e},n.queue=e,e=e.dispatch=I0.bind(null,zt,e),[n.memoizedState,e]}function ua(e,n,o,u){return e={tag:e,create:n,destroy:o,deps:u,next:null},n=zt.updateQueue,n===null?(n={lastEffect:null,stores:null},zt.updateQueue=n,n.lastEffect=e.next=e):(o=n.lastEffect,o===null?n.lastEffect=e.next=e:(u=o.next,o.next=e,e.next=u,n.lastEffect=e)),e}function Dd(){return xr().memoizedState}function xl(e,n,o,u){var p=Qr();zt.flags|=e,p.memoizedState=ua(1|n,o,void 0,u===void 0?null:u)}function wl(e,n,o,u){var p=xr();u=u===void 0?null:u;var g=void 0;if(Xt!==null){var E=Xt.memoizedState;if(g=E.destroy,u!==null&&dc(u,E.deps)){p.memoizedState=ua(n,o,g,u);return}}zt.flags|=e,p.memoizedState=ua(1|n,o,g,u)}function zd(e,n){return xl(8390656,8,e,n)}function yc(e,n){return wl(2048,8,e,n)}function Fd(e,n){return wl(4,2,e,n)}function Bd(e,n){return wl(4,4,e,n)}function Hd(e,n){if(typeof n=="function")return e=e(),n(e),function(){n(null)};if(n!=null)return e=e(),n.current=e,function(){n.current=null}}function Vd(e,n,o){return o=o!=null?o.concat([e]):null,wl(4,4,Hd.bind(null,n,e),o)}function vc(){}function Ud(e,n){var o=xr();n=n===void 0?null:n;var u=o.memoizedState;return u!==null&&n!==null&&dc(n,u[1])?u[0]:(o.memoizedState=[e,n],e)}function Kd(e,n){var o=xr();n=n===void 0?null:n;var u=o.memoizedState;return u!==null&&n!==null&&dc(n,u[1])?u[0]:(e=e(),o.memoizedState=[e,n],e)}function qd(e,n,o){return(ji&21)===0?(e.baseState&&(e.baseState=!1,Fn=!0),e.memoizedState=o):(ue(o,n)||(o=Ur(),zt.lanes|=o,Pi|=o,e.baseState=!0),n)}function $0(e,n){var o=bt;bt=o!==0&&4>o?o:4,e(!0);var u=fc.transition;fc.transition={};try{e(!1),n()}finally{bt=o,fc.transition=u}}function Wd(){return xr().memoizedState}function T0(e,n,o){var u=ii(e);if(o={lane:u,action:o,hasEagerState:!1,eagerState:null,next:null},Yd(e))Xd(n,o);else if(o=Nd(e,n,o,u),o!==null){var p=In();Or(o,e,u,p),Qd(o,n,u)}}function I0(e,n,o){var u=ii(e),p={lane:u,action:o,hasEagerState:!1,eagerState:null,next:null};if(Yd(e))Xd(n,p);else{var g=e.alternate;if(e.lanes===0&&(g===null||g.lanes===0)&&(g=n.lastRenderedReducer,g!==null))try{var E=n.lastRenderedState,D=g(E,o);if(p.hasEagerState=!0,p.eagerState=D,ue(D,E)){var X=n.interleaved;X===null?(p.next=p,ic(n)):(p.next=X.next,X.next=p),n.interleaved=p;return}}catch{}finally{}o=Nd(e,n,p,u),o!==null&&(p=In(),Or(o,e,u,p),Qd(o,n,u))}}function Yd(e){var n=e.alternate;return e===zt||n!==null&&n===zt}function Xd(e,n){sa=vl=!0;var o=e.pending;o===null?n.next=n:(n.next=o.next,o.next=n),e.pending=n}function Qd(e,n,o){if((o&4194240)!==0){var u=n.lanes;u&=e.pendingLanes,o|=u,n.lanes=o,zo(e,o)}}var bl={readContext:vr,useCallback:_n,useContext:_n,useEffect:_n,useImperativeHandle:_n,useInsertionEffect:_n,useLayoutEffect:_n,useMemo:_n,useReducer:_n,useRef:_n,useState:_n,useDebugValue:_n,useDeferredValue:_n,useTransition:_n,useMutableSource:_n,useSyncExternalStore:_n,useId:_n,unstable_isNewReconciler:!1},A0={readContext:vr,useCallback:function(e,n){return Qr().memoizedState=[e,n===void 0?null:n],e},useContext:vr,useEffect:zd,useImperativeHandle:function(e,n,o){return o=o!=null?o.concat([e]):null,xl(4194308,4,Hd.bind(null,n,e),o)},useLayoutEffect:function(e,n){return xl(4194308,4,e,n)},useInsertionEffect:function(e,n){return xl(4,2,e,n)},useMemo:function(e,n){var o=Qr();return n=n===void 0?null:n,e=e(),o.memoizedState=[e,n],e},useReducer:function(e,n,o){var u=Qr();return n=o!==void 0?o(n):n,u.memoizedState=u.baseState=n,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:n},u.queue=e,e=e.dispatch=T0.bind(null,zt,e),[u.memoizedState,e]},useRef:function(e){var n=Qr();return e={current:e},n.memoizedState=e},useState:Ld,useDebugValue:vc,useDeferredValue:function(e){return Qr().memoizedState=e},useTransition:function(){var e=Ld(!1),n=e[0];return e=$0.bind(null,e[1]),Qr().memoizedState=e,[n,e]},useMutableSource:function(){},useSyncExternalStore:function(e,n,o){var u=zt,p=Qr();if(At){if(o===void 0)throw Error(i(407));o=o()}else{if(o=n(),nn===null)throw Error(i(349));(ji&30)!==0||Td(u,n,o)}p.memoizedState=o;var g={value:o,getSnapshot:n};return p.queue=g,zd(Ad.bind(null,u,g,e),[e]),u.flags|=2048,ua(9,Id.bind(null,u,g,o,n),void 0,null),o},useId:function(){var e=Qr(),n=nn.identifierPrefix;if(At){var o=No,u=ko;o=(u&~(1<<32-vn(u)-1)).toString(32)+o,n=":"+n+"R"+o,o=aa++,0<o&&(n+="H"+o.toString(32)),n+=":"}else o=M0++,n=":"+n+"r"+o.toString(32)+":";return e.memoizedState=n},unstable_isNewReconciler:!1},O0={readContext:vr,useCallback:Ud,useContext:vr,useEffect:yc,useImperativeHandle:Vd,useInsertionEffect:Fd,useLayoutEffect:Bd,useMemo:Kd,useReducer:mc,useRef:Dd,useState:function(){return mc(la)},useDebugValue:vc,useDeferredValue:function(e){var n=xr();return qd(n,Xt.memoizedState,e)},useTransition:function(){var e=mc(la)[0],n=xr().memoizedState;return[e,n]},useMutableSource:Md,useSyncExternalStore:$d,useId:Wd,unstable_isNewReconciler:!1},R0={readContext:vr,useCallback:Ud,useContext:vr,useEffect:yc,useImperativeHandle:Vd,useInsertionEffect:Fd,useLayoutEffect:Bd,useMemo:Kd,useReducer:gc,useRef:Dd,useState:function(){return gc(la)},useDebugValue:vc,useDeferredValue:function(e){var n=xr();return Xt===null?n.memoizedState=e:qd(n,Xt.memoizedState,e)},useTransition:function(){var e=gc(la)[0],n=xr().memoizedState;return[e,n]},useMutableSource:Md,useSyncExternalStore:$d,useId:Wd,unstable_isNewReconciler:!1};function Tr(e,n){if(e&&e.defaultProps){n=B({},n),e=e.defaultProps;for(var o in e)n[o]===void 0&&(n[o]=e[o]);return n}return n}function xc(e,n,o,u){n=e.memoizedState,o=o(u,n),o=o==null?n:B({},n,o),e.memoizedState=o,e.lanes===0&&(e.updateQueue.baseState=o)}var _l={isMounted:function(e){return(e=e._reactInternals)?z(e)===e:!1},enqueueSetState:function(e,n,o){e=e._reactInternals;var u=In(),p=ii(e),g=Co(u,p);g.payload=n,o!=null&&(g.callback=o),n=ti(e,g,p),n!==null&&(Or(n,e,p,u),hl(n,e,p))},enqueueReplaceState:function(e,n,o){e=e._reactInternals;var u=In(),p=ii(e),g=Co(u,p);g.tag=1,g.payload=n,o!=null&&(g.callback=o),n=ti(e,g,p),n!==null&&(Or(n,e,p,u),hl(n,e,p))},enqueueForceUpdate:function(e,n){e=e._reactInternals;var o=In(),u=ii(e),p=Co(o,u);p.tag=2,n!=null&&(p.callback=n),n=ti(e,p,u),n!==null&&(Or(n,e,u,o),hl(n,e,u))}};function Gd(e,n,o,u,p,g,E){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(u,g,E):n.prototype&&n.prototype.isPureReactComponent?!te(o,u)||!te(p,g):!0}function Jd(e,n,o){var u=!1,p=Jo,g=n.contextType;return typeof g=="object"&&g!==null?g=vr(g):(p=zn(n)?Si:bn.current,u=n.contextTypes,g=(u=u!=null)?us(e,p):Jo),n=new n(o,g),e.memoizedState=n.state!==null&&n.state!==void 0?n.state:null,n.updater=_l,e.stateNode=n,n._reactInternals=e,u&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=p,e.__reactInternalMemoizedMaskedChildContext=g),n}function Zd(e,n,o,u){e=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(o,u),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(o,u),n.state!==e&&_l.enqueueReplaceState(n,n.state,null)}function wc(e,n,o,u){var p=e.stateNode;p.props=o,p.state=e.memoizedState,p.refs={},sc(e);var g=n.contextType;typeof g=="object"&&g!==null?p.context=vr(g):(g=zn(n)?Si:bn.current,p.context=us(e,g)),p.state=e.memoizedState,g=n.getDerivedStateFromProps,typeof g=="function"&&(xc(e,n,g,o),p.state=e.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof p.getSnapshotBeforeUpdate=="function"||typeof p.UNSAFE_componentWillMount!="function"&&typeof p.componentWillMount!="function"||(n=p.state,typeof p.componentWillMount=="function"&&p.componentWillMount(),typeof p.UNSAFE_componentWillMount=="function"&&p.UNSAFE_componentWillMount(),n!==p.state&&_l.enqueueReplaceState(p,p.state,null),ml(e,o,p,u),p.state=e.memoizedState),typeof p.componentDidMount=="function"&&(e.flags|=4194308)}function ys(e,n){try{var o="",u=n;do o+=Me(u),u=u.return;while(u);var p=o}catch(g){p=`
|
|
39
|
+
Error generating stack: `+g.message+`
|
|
40
|
+
`+g.stack}return{value:e,source:n,stack:p,digest:null}}function bc(e,n,o){return{value:e,source:null,stack:o??null,digest:n??null}}function _c(e,n){try{console.error(n.value)}catch(o){setTimeout(function(){throw o})}}var L0=typeof WeakMap=="function"?WeakMap:Map;function ep(e,n,o){o=Co(-1,o),o.tag=3,o.payload={element:null};var u=n.value;return o.callback=function(){Pl||(Pl=!0,Lc=u),_c(e,n)},o}function tp(e,n,o){o=Co(-1,o),o.tag=3;var u=e.type.getDerivedStateFromError;if(typeof u=="function"){var p=n.value;o.payload=function(){return u(p)},o.callback=function(){_c(e,n)}}var g=e.stateNode;return g!==null&&typeof g.componentDidCatch=="function"&&(o.callback=function(){_c(e,n),typeof u!="function"&&(ri===null?ri=new Set([this]):ri.add(this));var E=n.stack;this.componentDidCatch(n.value,{componentStack:E!==null?E:""})}),o}function np(e,n,o){var u=e.pingCache;if(u===null){u=e.pingCache=new L0;var p=new Set;u.set(n,p)}else p=u.get(n),p===void 0&&(p=new Set,u.set(n,p));p.has(o)||(p.add(o),e=G0.bind(null,e,n,o),n.then(e,e))}function rp(e){do{var n;if((n=e.tag===13)&&(n=e.memoizedState,n=n!==null?n.dehydrated!==null:!0),n)return e;e=e.return}while(e!==null);return null}function op(e,n,o,u,p){return(e.mode&1)===0?(e===n?e.flags|=65536:(e.flags|=128,o.flags|=131072,o.flags&=-52805,o.tag===1&&(o.alternate===null?o.tag=17:(n=Co(-1,1),n.tag=2,ti(o,n,1))),o.lanes|=1),e):(e.flags|=65536,e.lanes=p,e)}var D0=R.ReactCurrentOwner,Fn=!1;function Tn(e,n,o,u){n.child=e===null?kd(n,null,o,u):ps(n,e.child,o,u)}function ip(e,n,o,u,p){o=o.render;var g=n.ref;return ms(n,p),u=pc(e,n,o,u,g,p),o=hc(),e!==null&&!Fn?(n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~p,jo(e,n,p)):(At&&o&&Qu(n),n.flags|=1,Tn(e,n,u,p),n.child)}function sp(e,n,o,u,p){if(e===null){var g=o.type;return typeof g=="function"&&!Uc(g)&&g.defaultProps===void 0&&o.compare===null&&o.defaultProps===void 0?(n.tag=15,n.type=g,ap(e,n,g,u,p)):(e=Ol(o.type,null,u,n,n.mode,p),e.ref=n.ref,e.return=n,n.child=e)}if(g=e.child,(e.lanes&p)===0){var E=g.memoizedProps;if(o=o.compare,o=o!==null?o:te,o(E,u)&&e.ref===n.ref)return jo(e,n,p)}return n.flags|=1,e=ai(g,u),e.ref=n.ref,e.return=n,n.child=e}function ap(e,n,o,u,p){if(e!==null){var g=e.memoizedProps;if(te(g,u)&&e.ref===n.ref)if(Fn=!1,n.pendingProps=u=g,(e.lanes&p)!==0)(e.flags&131072)!==0&&(Fn=!0);else return n.lanes=e.lanes,jo(e,n,p)}return Sc(e,n,o,u,p)}function lp(e,n,o){var u=n.pendingProps,p=u.children,g=e!==null?e.memoizedState:null;if(u.mode==="hidden")if((n.mode&1)===0)n.memoizedState={baseLanes:0,cachePool:null,transitions:null},Et(xs,or),or|=o;else{if((o&1073741824)===0)return e=g!==null?g.baseLanes|o:o,n.lanes=n.childLanes=1073741824,n.memoizedState={baseLanes:e,cachePool:null,transitions:null},n.updateQueue=null,Et(xs,or),or|=e,null;n.memoizedState={baseLanes:0,cachePool:null,transitions:null},u=g!==null?g.baseLanes:o,Et(xs,or),or|=u}else g!==null?(u=g.baseLanes|o,n.memoizedState=null):u=o,Et(xs,or),or|=u;return Tn(e,n,p,o),n.child}function up(e,n){var o=n.ref;(e===null&&o!==null||e!==null&&e.ref!==o)&&(n.flags|=512,n.flags|=2097152)}function Sc(e,n,o,u,p){var g=zn(o)?Si:bn.current;return g=us(n,g),ms(n,p),o=pc(e,n,o,u,g,p),u=hc(),e!==null&&!Fn?(n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~p,jo(e,n,p)):(At&&u&&Qu(n),n.flags|=1,Tn(e,n,o,p),n.child)}function cp(e,n,o,u,p){if(zn(o)){var g=!0;sl(n)}else g=!1;if(ms(n,p),n.stateNode===null)kl(e,n),Jd(n,o,u),wc(n,o,u,p),u=!0;else if(e===null){var E=n.stateNode,D=n.memoizedProps;E.props=D;var X=E.context,ye=o.contextType;typeof ye=="object"&&ye!==null?ye=vr(ye):(ye=zn(o)?Si:bn.current,ye=us(n,ye));var Pe=o.getDerivedStateFromProps,Te=typeof Pe=="function"||typeof E.getSnapshotBeforeUpdate=="function";Te||typeof E.UNSAFE_componentWillReceiveProps!="function"&&typeof E.componentWillReceiveProps!="function"||(D!==u||X!==ye)&&Zd(n,E,u,ye),ei=!1;var je=n.memoizedState;E.state=je,ml(n,u,E,p),X=n.memoizedState,D!==u||je!==X||Dn.current||ei?(typeof Pe=="function"&&(xc(n,o,Pe,u),X=n.memoizedState),(D=ei||Gd(n,o,D,u,je,X,ye))?(Te||typeof E.UNSAFE_componentWillMount!="function"&&typeof E.componentWillMount!="function"||(typeof E.componentWillMount=="function"&&E.componentWillMount(),typeof E.UNSAFE_componentWillMount=="function"&&E.UNSAFE_componentWillMount()),typeof E.componentDidMount=="function"&&(n.flags|=4194308)):(typeof E.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=u,n.memoizedState=X),E.props=u,E.state=X,E.context=ye,u=D):(typeof E.componentDidMount=="function"&&(n.flags|=4194308),u=!1)}else{E=n.stateNode,Ed(e,n),D=n.memoizedProps,ye=n.type===n.elementType?D:Tr(n.type,D),E.props=ye,Te=n.pendingProps,je=E.context,X=o.contextType,typeof X=="object"&&X!==null?X=vr(X):(X=zn(o)?Si:bn.current,X=us(n,X));var Ke=o.getDerivedStateFromProps;(Pe=typeof Ke=="function"||typeof E.getSnapshotBeforeUpdate=="function")||typeof E.UNSAFE_componentWillReceiveProps!="function"&&typeof E.componentWillReceiveProps!="function"||(D!==Te||je!==X)&&Zd(n,E,u,X),ei=!1,je=n.memoizedState,E.state=je,ml(n,u,E,p);var Qe=n.memoizedState;D!==Te||je!==Qe||Dn.current||ei?(typeof Ke=="function"&&(xc(n,o,Ke,u),Qe=n.memoizedState),(ye=ei||Gd(n,o,ye,u,je,Qe,X)||!1)?(Pe||typeof E.UNSAFE_componentWillUpdate!="function"&&typeof E.componentWillUpdate!="function"||(typeof E.componentWillUpdate=="function"&&E.componentWillUpdate(u,Qe,X),typeof E.UNSAFE_componentWillUpdate=="function"&&E.UNSAFE_componentWillUpdate(u,Qe,X)),typeof E.componentDidUpdate=="function"&&(n.flags|=4),typeof E.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof E.componentDidUpdate!="function"||D===e.memoizedProps&&je===e.memoizedState||(n.flags|=4),typeof E.getSnapshotBeforeUpdate!="function"||D===e.memoizedProps&&je===e.memoizedState||(n.flags|=1024),n.memoizedProps=u,n.memoizedState=Qe),E.props=u,E.state=Qe,E.context=X,u=ye):(typeof E.componentDidUpdate!="function"||D===e.memoizedProps&&je===e.memoizedState||(n.flags|=4),typeof E.getSnapshotBeforeUpdate!="function"||D===e.memoizedProps&&je===e.memoizedState||(n.flags|=1024),u=!1)}return kc(e,n,o,u,g,p)}function kc(e,n,o,u,p,g){up(e,n);var E=(n.flags&128)!==0;if(!u&&!E)return p&&md(n,o,!1),jo(e,n,g);u=n.stateNode,D0.current=n;var D=E&&typeof o.getDerivedStateFromError!="function"?null:u.render();return n.flags|=1,e!==null&&E?(n.child=ps(n,e.child,null,g),n.child=ps(n,null,D,g)):Tn(e,n,D,g),n.memoizedState=u.state,p&&md(n,o,!0),n.child}function fp(e){var n=e.stateNode;n.pendingContext?pd(e,n.pendingContext,n.pendingContext!==n.context):n.context&&pd(e,n.context,!1),ac(e,n.containerInfo)}function dp(e,n,o,u,p){return ds(),ec(p),n.flags|=256,Tn(e,n,o,u),n.child}var Nc={dehydrated:null,treeContext:null,retryLane:0};function Ec(e){return{baseLanes:e,cachePool:null,transitions:null}}function pp(e,n,o){var u=n.pendingProps,p=Dt.current,g=!1,E=(n.flags&128)!==0,D;if((D=E)||(D=e!==null&&e.memoizedState===null?!1:(p&2)!==0),D?(g=!0,n.flags&=-129):(e===null||e.memoizedState!==null)&&(p|=1),Et(Dt,p&1),e===null)return Zu(n),e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?((n.mode&1)===0?n.lanes=1:e.data==="$!"?n.lanes=8:n.lanes=1073741824,null):(E=u.children,e=u.fallback,g?(u=n.mode,g=n.child,E={mode:"hidden",children:E},(u&1)===0&&g!==null?(g.childLanes=0,g.pendingProps=E):g=Rl(E,u,0,null),e=Ii(e,u,o,null),g.return=n,e.return=n,g.sibling=e,n.child=g,n.child.memoizedState=Ec(o),n.memoizedState=Nc,e):Cc(n,E));if(p=e.memoizedState,p!==null&&(D=p.dehydrated,D!==null))return z0(e,n,E,u,D,p,o);if(g){g=u.fallback,E=n.mode,p=e.child,D=p.sibling;var X={mode:"hidden",children:u.children};return(E&1)===0&&n.child!==p?(u=n.child,u.childLanes=0,u.pendingProps=X,n.deletions=null):(u=ai(p,X),u.subtreeFlags=p.subtreeFlags&14680064),D!==null?g=ai(D,g):(g=Ii(g,E,o,null),g.flags|=2),g.return=n,u.return=n,u.sibling=g,n.child=u,u=g,g=n.child,E=e.child.memoizedState,E=E===null?Ec(o):{baseLanes:E.baseLanes|o,cachePool:null,transitions:E.transitions},g.memoizedState=E,g.childLanes=e.childLanes&~o,n.memoizedState=Nc,u}return g=e.child,e=g.sibling,u=ai(g,{mode:"visible",children:u.children}),(n.mode&1)===0&&(u.lanes=o),u.return=n,u.sibling=null,e!==null&&(o=n.deletions,o===null?(n.deletions=[e],n.flags|=16):o.push(e)),n.child=u,n.memoizedState=null,u}function Cc(e,n){return n=Rl({mode:"visible",children:n},e.mode,0,null),n.return=e,e.child=n}function Sl(e,n,o,u){return u!==null&&ec(u),ps(n,e.child,null,o),e=Cc(n,n.pendingProps.children),e.flags|=2,n.memoizedState=null,e}function z0(e,n,o,u,p,g,E){if(o)return n.flags&256?(n.flags&=-257,u=bc(Error(i(422))),Sl(e,n,E,u)):n.memoizedState!==null?(n.child=e.child,n.flags|=128,null):(g=u.fallback,p=n.mode,u=Rl({mode:"visible",children:u.children},p,0,null),g=Ii(g,p,E,null),g.flags|=2,u.return=n,g.return=n,u.sibling=g,n.child=u,(n.mode&1)!==0&&ps(n,e.child,null,E),n.child.memoizedState=Ec(E),n.memoizedState=Nc,g);if((n.mode&1)===0)return Sl(e,n,E,null);if(p.data==="$!"){if(u=p.nextSibling&&p.nextSibling.dataset,u)var D=u.dgst;return u=D,g=Error(i(419)),u=bc(g,u,void 0),Sl(e,n,E,u)}if(D=(E&e.childLanes)!==0,Fn||D){if(u=nn,u!==null){switch(E&-E){case 4:p=2;break;case 16:p=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:p=32;break;case 536870912:p=268435456;break;default:p=0}p=(p&(u.suspendedLanes|E))!==0?0:p,p!==0&&p!==g.retryLane&&(g.retryLane=p,Eo(e,p),Or(u,e,p,-1))}return Vc(),u=bc(Error(i(421))),Sl(e,n,E,u)}return p.data==="$?"?(n.flags|=128,n.child=e.child,n=J0.bind(null,e),p._reactRetry=n,null):(e=g.treeContext,rr=Qo(p.nextSibling),nr=n,At=!0,$r=null,e!==null&&(gr[yr++]=ko,gr[yr++]=No,gr[yr++]=ki,ko=e.id,No=e.overflow,ki=n),n=Cc(n,u.children),n.flags|=4096,n)}function hp(e,n,o){e.lanes|=n;var u=e.alternate;u!==null&&(u.lanes|=n),oc(e.return,n,o)}function jc(e,n,o,u,p){var g=e.memoizedState;g===null?e.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:u,tail:o,tailMode:p}:(g.isBackwards=n,g.rendering=null,g.renderingStartTime=0,g.last=u,g.tail=o,g.tailMode=p)}function mp(e,n,o){var u=n.pendingProps,p=u.revealOrder,g=u.tail;if(Tn(e,n,u.children,o),u=Dt.current,(u&2)!==0)u=u&1|2,n.flags|=128;else{if(e!==null&&(e.flags&128)!==0)e:for(e=n.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&hp(e,o,n);else if(e.tag===19)hp(e,o,n);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===n)break e;for(;e.sibling===null;){if(e.return===null||e.return===n)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}u&=1}if(Et(Dt,u),(n.mode&1)===0)n.memoizedState=null;else switch(p){case"forwards":for(o=n.child,p=null;o!==null;)e=o.alternate,e!==null&&gl(e)===null&&(p=o),o=o.sibling;o=p,o===null?(p=n.child,n.child=null):(p=o.sibling,o.sibling=null),jc(n,!1,p,o,g);break;case"backwards":for(o=null,p=n.child,n.child=null;p!==null;){if(e=p.alternate,e!==null&&gl(e)===null){n.child=p;break}e=p.sibling,p.sibling=o,o=p,p=e}jc(n,!0,o,null,g);break;case"together":jc(n,!1,null,null,void 0);break;default:n.memoizedState=null}return n.child}function kl(e,n){(n.mode&1)===0&&e!==null&&(e.alternate=null,n.alternate=null,n.flags|=2)}function jo(e,n,o){if(e!==null&&(n.dependencies=e.dependencies),Pi|=n.lanes,(o&n.childLanes)===0)return null;if(e!==null&&n.child!==e.child)throw Error(i(153));if(n.child!==null){for(e=n.child,o=ai(e,e.pendingProps),n.child=o,o.return=n;e.sibling!==null;)e=e.sibling,o=o.sibling=ai(e,e.pendingProps),o.return=n;o.sibling=null}return n.child}function F0(e,n,o){switch(n.tag){case 3:fp(n),ds();break;case 5:Pd(n);break;case 1:zn(n.type)&&sl(n);break;case 4:ac(n,n.stateNode.containerInfo);break;case 10:var u=n.type._context,p=n.memoizedProps.value;Et(dl,u._currentValue),u._currentValue=p;break;case 13:if(u=n.memoizedState,u!==null)return u.dehydrated!==null?(Et(Dt,Dt.current&1),n.flags|=128,null):(o&n.child.childLanes)!==0?pp(e,n,o):(Et(Dt,Dt.current&1),e=jo(e,n,o),e!==null?e.sibling:null);Et(Dt,Dt.current&1);break;case 19:if(u=(o&n.childLanes)!==0,(e.flags&128)!==0){if(u)return mp(e,n,o);n.flags|=128}if(p=n.memoizedState,p!==null&&(p.rendering=null,p.tail=null,p.lastEffect=null),Et(Dt,Dt.current),u)break;return null;case 22:case 23:return n.lanes=0,lp(e,n,o)}return jo(e,n,o)}var gp,Pc,yp,vp;gp=function(e,n){for(var o=n.child;o!==null;){if(o.tag===5||o.tag===6)e.appendChild(o.stateNode);else if(o.tag!==4&&o.child!==null){o.child.return=o,o=o.child;continue}if(o===n)break;for(;o.sibling===null;){if(o.return===null||o.return===n)return;o=o.return}o.sibling.return=o.return,o=o.sibling}},Pc=function(){},yp=function(e,n,o,u){var p=e.memoizedProps;if(p!==u){e=n.stateNode,Ci(Xr.current);var g=null;switch(o){case"input":p=lt(e,p),u=lt(e,u),g=[];break;case"select":p=B({},p,{value:void 0}),u=B({},u,{value:void 0}),g=[];break;case"textarea":p=pn(e,p),u=pn(e,u),g=[];break;default:typeof p.onClick!="function"&&typeof u.onClick=="function"&&(e.onclick=rl)}qe(o,u);var E;o=null;for(ye in p)if(!u.hasOwnProperty(ye)&&p.hasOwnProperty(ye)&&p[ye]!=null)if(ye==="style"){var D=p[ye];for(E in D)D.hasOwnProperty(E)&&(o||(o={}),o[E]="")}else ye!=="dangerouslySetInnerHTML"&&ye!=="children"&&ye!=="suppressContentEditableWarning"&&ye!=="suppressHydrationWarning"&&ye!=="autoFocus"&&(l.hasOwnProperty(ye)?g||(g=[]):(g=g||[]).push(ye,null));for(ye in u){var X=u[ye];if(D=p!=null?p[ye]:void 0,u.hasOwnProperty(ye)&&X!==D&&(X!=null||D!=null))if(ye==="style")if(D){for(E in D)!D.hasOwnProperty(E)||X&&X.hasOwnProperty(E)||(o||(o={}),o[E]="");for(E in X)X.hasOwnProperty(E)&&D[E]!==X[E]&&(o||(o={}),o[E]=X[E])}else o||(g||(g=[]),g.push(ye,o)),o=X;else ye==="dangerouslySetInnerHTML"?(X=X?X.__html:void 0,D=D?D.__html:void 0,X!=null&&D!==X&&(g=g||[]).push(ye,X)):ye==="children"?typeof X!="string"&&typeof X!="number"||(g=g||[]).push(ye,""+X):ye!=="suppressContentEditableWarning"&&ye!=="suppressHydrationWarning"&&(l.hasOwnProperty(ye)?(X!=null&&ye==="onScroll"&&Pt("scroll",e),g||D===X||(g=[])):(g=g||[]).push(ye,X))}o&&(g=g||[]).push("style",o);var ye=g;(n.updateQueue=ye)&&(n.flags|=4)}},vp=function(e,n,o,u){o!==u&&(n.flags|=4)};function ca(e,n){if(!At)switch(e.tailMode){case"hidden":n=e.tail;for(var o=null;n!==null;)n.alternate!==null&&(o=n),n=n.sibling;o===null?e.tail=null:o.sibling=null;break;case"collapsed":o=e.tail;for(var u=null;o!==null;)o.alternate!==null&&(u=o),o=o.sibling;u===null?n||e.tail===null?e.tail=null:e.tail.sibling=null:u.sibling=null}}function Sn(e){var n=e.alternate!==null&&e.alternate.child===e.child,o=0,u=0;if(n)for(var p=e.child;p!==null;)o|=p.lanes|p.childLanes,u|=p.subtreeFlags&14680064,u|=p.flags&14680064,p.return=e,p=p.sibling;else for(p=e.child;p!==null;)o|=p.lanes|p.childLanes,u|=p.subtreeFlags,u|=p.flags,p.return=e,p=p.sibling;return e.subtreeFlags|=u,e.childLanes=o,n}function B0(e,n,o){var u=n.pendingProps;switch(Gu(n),n.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Sn(n),null;case 1:return zn(n.type)&&il(),Sn(n),null;case 3:return u=n.stateNode,gs(),Mt(Dn),Mt(bn),cc(),u.pendingContext&&(u.context=u.pendingContext,u.pendingContext=null),(e===null||e.child===null)&&(cl(n)?n.flags|=4:e===null||e.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,$r!==null&&(Fc($r),$r=null))),Pc(e,n),Sn(n),null;case 5:lc(n);var p=Ci(ia.current);if(o=n.type,e!==null&&n.stateNode!=null)yp(e,n,o,u,p),e.ref!==n.ref&&(n.flags|=512,n.flags|=2097152);else{if(!u){if(n.stateNode===null)throw Error(i(166));return Sn(n),null}if(e=Ci(Xr.current),cl(n)){u=n.stateNode,o=n.type;var g=n.memoizedProps;switch(u[Yr]=n,u[ea]=g,e=(n.mode&1)!==0,o){case"dialog":Pt("cancel",u),Pt("close",u);break;case"iframe":case"object":case"embed":Pt("load",u);break;case"video":case"audio":for(p=0;p<bo.length;p++)Pt(bo[p],u);break;case"source":Pt("error",u);break;case"img":case"image":case"link":Pt("error",u),Pt("load",u);break;case"details":Pt("toggle",u);break;case"input":ut(u,g),Pt("invalid",u);break;case"select":u._wrapperState={wasMultiple:!!g.multiple},Pt("invalid",u);break;case"textarea":on(u,g),Pt("invalid",u)}qe(o,g),p=null;for(var E in g)if(g.hasOwnProperty(E)){var D=g[E];E==="children"?typeof D=="string"?u.textContent!==D&&(g.suppressHydrationWarning!==!0&&nl(u.textContent,D,e),p=["children",D]):typeof D=="number"&&u.textContent!==""+D&&(g.suppressHydrationWarning!==!0&&nl(u.textContent,D,e),p=["children",""+D]):l.hasOwnProperty(E)&&D!=null&&E==="onScroll"&&Pt("scroll",u)}switch(o){case"input":Be(u),qt(u,g,!0);break;case"textarea":Be(u),Nn(u);break;case"select":case"option":break;default:typeof g.onClick=="function"&&(u.onclick=rl)}u=p,n.updateQueue=u,u!==null&&(n.flags|=4)}else{E=p.nodeType===9?p:p.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=pt(o)),e==="http://www.w3.org/1999/xhtml"?o==="script"?(e=E.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof u.is=="string"?e=E.createElement(o,{is:u.is}):(e=E.createElement(o),o==="select"&&(E=e,u.multiple?E.multiple=!0:u.size&&(E.size=u.size))):e=E.createElementNS(e,o),e[Yr]=n,e[ea]=u,gp(e,n,!1,!1),n.stateNode=e;e:{switch(E=qn(o,u),o){case"dialog":Pt("cancel",e),Pt("close",e),p=u;break;case"iframe":case"object":case"embed":Pt("load",e),p=u;break;case"video":case"audio":for(p=0;p<bo.length;p++)Pt(bo[p],e);p=u;break;case"source":Pt("error",e),p=u;break;case"img":case"image":case"link":Pt("error",e),Pt("load",e),p=u;break;case"details":Pt("toggle",e),p=u;break;case"input":ut(e,u),p=lt(e,u),Pt("invalid",e);break;case"option":p=u;break;case"select":e._wrapperState={wasMultiple:!!u.multiple},p=B({},u,{value:void 0}),Pt("invalid",e);break;case"textarea":on(e,u),p=pn(e,u),Pt("invalid",e);break;default:p=u}qe(o,p),D=p;for(g in D)if(D.hasOwnProperty(g)){var X=D[g];g==="style"?Br(e,X):g==="dangerouslySetInnerHTML"?(X=X?X.__html:void 0,X!=null&&mn(e,X)):g==="children"?typeof X=="string"?(o!=="textarea"||X!=="")&&sn(e,X):typeof X=="number"&&sn(e,""+X):g!=="suppressContentEditableWarning"&&g!=="suppressHydrationWarning"&&g!=="autoFocus"&&(l.hasOwnProperty(g)?X!=null&&g==="onScroll"&&Pt("scroll",e):X!=null&&P(e,g,X,E))}switch(o){case"input":Be(e),qt(e,u,!1);break;case"textarea":Be(e),Nn(e);break;case"option":u.value!=null&&e.setAttribute("value",""+_e(u.value));break;case"select":e.multiple=!!u.multiple,g=u.value,g!=null?Nt(e,!!u.multiple,g,!1):u.defaultValue!=null&&Nt(e,!!u.multiple,u.defaultValue,!0);break;default:typeof p.onClick=="function"&&(e.onclick=rl)}switch(o){case"button":case"input":case"select":case"textarea":u=!!u.autoFocus;break e;case"img":u=!0;break e;default:u=!1}}u&&(n.flags|=4)}n.ref!==null&&(n.flags|=512,n.flags|=2097152)}return Sn(n),null;case 6:if(e&&n.stateNode!=null)vp(e,n,e.memoizedProps,u);else{if(typeof u!="string"&&n.stateNode===null)throw Error(i(166));if(o=Ci(ia.current),Ci(Xr.current),cl(n)){if(u=n.stateNode,o=n.memoizedProps,u[Yr]=n,(g=u.nodeValue!==o)&&(e=nr,e!==null))switch(e.tag){case 3:nl(u.nodeValue,o,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&nl(u.nodeValue,o,(e.mode&1)!==0)}g&&(n.flags|=4)}else u=(o.nodeType===9?o:o.ownerDocument).createTextNode(u),u[Yr]=n,n.stateNode=u}return Sn(n),null;case 13:if(Mt(Dt),u=n.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(At&&rr!==null&&(n.mode&1)!==0&&(n.flags&128)===0)bd(),ds(),n.flags|=98560,g=!1;else if(g=cl(n),u!==null&&u.dehydrated!==null){if(e===null){if(!g)throw Error(i(318));if(g=n.memoizedState,g=g!==null?g.dehydrated:null,!g)throw Error(i(317));g[Yr]=n}else ds(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;Sn(n),g=!1}else $r!==null&&(Fc($r),$r=null),g=!0;if(!g)return n.flags&65536?n:null}return(n.flags&128)!==0?(n.lanes=o,n):(u=u!==null,u!==(e!==null&&e.memoizedState!==null)&&u&&(n.child.flags|=8192,(n.mode&1)!==0&&(e===null||(Dt.current&1)!==0?Qt===0&&(Qt=3):Vc())),n.updateQueue!==null&&(n.flags|=4),Sn(n),null);case 4:return gs(),Pc(e,n),e===null&&Js(n.stateNode.containerInfo),Sn(n),null;case 10:return rc(n.type._context),Sn(n),null;case 17:return zn(n.type)&&il(),Sn(n),null;case 19:if(Mt(Dt),g=n.memoizedState,g===null)return Sn(n),null;if(u=(n.flags&128)!==0,E=g.rendering,E===null)if(u)ca(g,!1);else{if(Qt!==0||e!==null&&(e.flags&128)!==0)for(e=n.child;e!==null;){if(E=gl(e),E!==null){for(n.flags|=128,ca(g,!1),u=E.updateQueue,u!==null&&(n.updateQueue=u,n.flags|=4),n.subtreeFlags=0,u=o,o=n.child;o!==null;)g=o,e=u,g.flags&=14680066,E=g.alternate,E===null?(g.childLanes=0,g.lanes=e,g.child=null,g.subtreeFlags=0,g.memoizedProps=null,g.memoizedState=null,g.updateQueue=null,g.dependencies=null,g.stateNode=null):(g.childLanes=E.childLanes,g.lanes=E.lanes,g.child=E.child,g.subtreeFlags=0,g.deletions=null,g.memoizedProps=E.memoizedProps,g.memoizedState=E.memoizedState,g.updateQueue=E.updateQueue,g.type=E.type,e=E.dependencies,g.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),o=o.sibling;return Et(Dt,Dt.current&1|2),n.child}e=e.sibling}g.tail!==null&&mt()>ws&&(n.flags|=128,u=!0,ca(g,!1),n.lanes=4194304)}else{if(!u)if(e=gl(E),e!==null){if(n.flags|=128,u=!0,o=e.updateQueue,o!==null&&(n.updateQueue=o,n.flags|=4),ca(g,!0),g.tail===null&&g.tailMode==="hidden"&&!E.alternate&&!At)return Sn(n),null}else 2*mt()-g.renderingStartTime>ws&&o!==1073741824&&(n.flags|=128,u=!0,ca(g,!1),n.lanes=4194304);g.isBackwards?(E.sibling=n.child,n.child=E):(o=g.last,o!==null?o.sibling=E:n.child=E,g.last=E)}return g.tail!==null?(n=g.tail,g.rendering=n,g.tail=n.sibling,g.renderingStartTime=mt(),n.sibling=null,o=Dt.current,Et(Dt,u?o&1|2:o&1),n):(Sn(n),null);case 22:case 23:return Hc(),u=n.memoizedState!==null,e!==null&&e.memoizedState!==null!==u&&(n.flags|=8192),u&&(n.mode&1)!==0?(or&1073741824)!==0&&(Sn(n),n.subtreeFlags&6&&(n.flags|=8192)):Sn(n),null;case 24:return null;case 25:return null}throw Error(i(156,n.tag))}function H0(e,n){switch(Gu(n),n.tag){case 1:return zn(n.type)&&il(),e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 3:return gs(),Mt(Dn),Mt(bn),cc(),e=n.flags,(e&65536)!==0&&(e&128)===0?(n.flags=e&-65537|128,n):null;case 5:return lc(n),null;case 13:if(Mt(Dt),e=n.memoizedState,e!==null&&e.dehydrated!==null){if(n.alternate===null)throw Error(i(340));ds()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 19:return Mt(Dt),null;case 4:return gs(),null;case 10:return rc(n.type._context),null;case 22:case 23:return Hc(),null;case 24:return null;default:return null}}var Nl=!1,kn=!1,V0=typeof WeakSet=="function"?WeakSet:Set,Xe=null;function vs(e,n){var o=e.ref;if(o!==null)if(typeof o=="function")try{o(null)}catch(u){Ft(e,n,u)}else o.current=null}function Mc(e,n,o){try{o()}catch(u){Ft(e,n,u)}}var xp=!1;function U0(e,n){if(Hu=Ki,e=oe(),re(e)){if("selectionStart"in e)var o={start:e.selectionStart,end:e.selectionEnd};else e:{o=(o=e.ownerDocument)&&o.defaultView||window;var u=o.getSelection&&o.getSelection();if(u&&u.rangeCount!==0){o=u.anchorNode;var p=u.anchorOffset,g=u.focusNode;u=u.focusOffset;try{o.nodeType,g.nodeType}catch{o=null;break e}var E=0,D=-1,X=-1,ye=0,Pe=0,Te=e,je=null;t:for(;;){for(var Ke;Te!==o||p!==0&&Te.nodeType!==3||(D=E+p),Te!==g||u!==0&&Te.nodeType!==3||(X=E+u),Te.nodeType===3&&(E+=Te.nodeValue.length),(Ke=Te.firstChild)!==null;)je=Te,Te=Ke;for(;;){if(Te===e)break t;if(je===o&&++ye===p&&(D=E),je===g&&++Pe===u&&(X=E),(Ke=Te.nextSibling)!==null)break;Te=je,je=Te.parentNode}Te=Ke}o=D===-1||X===-1?null:{start:D,end:X}}else o=null}o=o||{start:0,end:0}}else o=null;for(Vu={focusedElem:e,selectionRange:o},Ki=!1,Xe=n;Xe!==null;)if(n=Xe,e=n.child,(n.subtreeFlags&1028)!==0&&e!==null)e.return=n,Xe=e;else for(;Xe!==null;){n=Xe;try{var Qe=n.alternate;if((n.flags&1024)!==0)switch(n.tag){case 0:case 11:case 15:break;case 1:if(Qe!==null){var Ge=Qe.memoizedProps,Bt=Qe.memoizedState,he=n.stateNode,ne=he.getSnapshotBeforeUpdate(n.elementType===n.type?Ge:Tr(n.type,Ge),Bt);he.__reactInternalSnapshotBeforeUpdate=ne}break;case 3:var me=n.stateNode.containerInfo;me.nodeType===1?me.textContent="":me.nodeType===9&&me.documentElement&&me.removeChild(me.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(i(163))}}catch(Fe){Ft(n,n.return,Fe)}if(e=n.sibling,e!==null){e.return=n.return,Xe=e;break}Xe=n.return}return Qe=xp,xp=!1,Qe}function fa(e,n,o){var u=n.updateQueue;if(u=u!==null?u.lastEffect:null,u!==null){var p=u=u.next;do{if((p.tag&e)===e){var g=p.destroy;p.destroy=void 0,g!==void 0&&Mc(n,o,g)}p=p.next}while(p!==u)}}function El(e,n){if(n=n.updateQueue,n=n!==null?n.lastEffect:null,n!==null){var o=n=n.next;do{if((o.tag&e)===e){var u=o.create;o.destroy=u()}o=o.next}while(o!==n)}}function $c(e){var n=e.ref;if(n!==null){var o=e.stateNode;switch(e.tag){case 5:e=o;break;default:e=o}typeof n=="function"?n(e):n.current=e}}function wp(e){var n=e.alternate;n!==null&&(e.alternate=null,wp(n)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(n=e.stateNode,n!==null&&(delete n[Yr],delete n[ea],delete n[Wu],delete n[E0],delete n[C0])),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 bp(e){return e.tag===5||e.tag===3||e.tag===4}function _p(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||bp(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 Tc(e,n,o){var u=e.tag;if(u===5||u===6)e=e.stateNode,n?o.nodeType===8?o.parentNode.insertBefore(e,n):o.insertBefore(e,n):(o.nodeType===8?(n=o.parentNode,n.insertBefore(e,o)):(n=o,n.appendChild(e)),o=o._reactRootContainer,o!=null||n.onclick!==null||(n.onclick=rl));else if(u!==4&&(e=e.child,e!==null))for(Tc(e,n,o),e=e.sibling;e!==null;)Tc(e,n,o),e=e.sibling}function Ic(e,n,o){var u=e.tag;if(u===5||u===6)e=e.stateNode,n?o.insertBefore(e,n):o.appendChild(e);else if(u!==4&&(e=e.child,e!==null))for(Ic(e,n,o),e=e.sibling;e!==null;)Ic(e,n,o),e=e.sibling}var fn=null,Ir=!1;function ni(e,n,o){for(o=o.child;o!==null;)Sp(e,n,o),o=o.sibling}function Sp(e,n,o){if($n&&typeof $n.onCommitFiberUnmount=="function")try{$n.onCommitFiberUnmount(pr,o)}catch{}switch(o.tag){case 5:kn||vs(o,n);case 6:var u=fn,p=Ir;fn=null,ni(e,n,o),fn=u,Ir=p,fn!==null&&(Ir?(e=fn,o=o.stateNode,e.nodeType===8?e.parentNode.removeChild(o):e.removeChild(o)):fn.removeChild(o.stateNode));break;case 18:fn!==null&&(Ir?(e=fn,o=o.stateNode,e.nodeType===8?qu(e.parentNode,o):e.nodeType===1&&qu(e,o),fo(e)):qu(fn,o.stateNode));break;case 4:u=fn,p=Ir,fn=o.stateNode.containerInfo,Ir=!0,ni(e,n,o),fn=u,Ir=p;break;case 0:case 11:case 14:case 15:if(!kn&&(u=o.updateQueue,u!==null&&(u=u.lastEffect,u!==null))){p=u=u.next;do{var g=p,E=g.destroy;g=g.tag,E!==void 0&&((g&2)!==0||(g&4)!==0)&&Mc(o,n,E),p=p.next}while(p!==u)}ni(e,n,o);break;case 1:if(!kn&&(vs(o,n),u=o.stateNode,typeof u.componentWillUnmount=="function"))try{u.props=o.memoizedProps,u.state=o.memoizedState,u.componentWillUnmount()}catch(D){Ft(o,n,D)}ni(e,n,o);break;case 21:ni(e,n,o);break;case 22:o.mode&1?(kn=(u=kn)||o.memoizedState!==null,ni(e,n,o),kn=u):ni(e,n,o);break;default:ni(e,n,o)}}function kp(e){var n=e.updateQueue;if(n!==null){e.updateQueue=null;var o=e.stateNode;o===null&&(o=e.stateNode=new V0),n.forEach(function(u){var p=Z0.bind(null,e,u);o.has(u)||(o.add(u),u.then(p,p))})}}function Ar(e,n){var o=n.deletions;if(o!==null)for(var u=0;u<o.length;u++){var p=o[u];try{var g=e,E=n,D=E;e:for(;D!==null;){switch(D.tag){case 5:fn=D.stateNode,Ir=!1;break e;case 3:fn=D.stateNode.containerInfo,Ir=!0;break e;case 4:fn=D.stateNode.containerInfo,Ir=!0;break e}D=D.return}if(fn===null)throw Error(i(160));Sp(g,E,p),fn=null,Ir=!1;var X=p.alternate;X!==null&&(X.return=null),p.return=null}catch(ye){Ft(p,n,ye)}}if(n.subtreeFlags&12854)for(n=n.child;n!==null;)Np(n,e),n=n.sibling}function Np(e,n){var o=e.alternate,u=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Ar(n,e),Gr(e),u&4){try{fa(3,e,e.return),El(3,e)}catch(Ge){Ft(e,e.return,Ge)}try{fa(5,e,e.return)}catch(Ge){Ft(e,e.return,Ge)}}break;case 1:Ar(n,e),Gr(e),u&512&&o!==null&&vs(o,o.return);break;case 5:if(Ar(n,e),Gr(e),u&512&&o!==null&&vs(o,o.return),e.flags&32){var p=e.stateNode;try{sn(p,"")}catch(Ge){Ft(e,e.return,Ge)}}if(u&4&&(p=e.stateNode,p!=null)){var g=e.memoizedProps,E=o!==null?o.memoizedProps:g,D=e.type,X=e.updateQueue;if(e.updateQueue=null,X!==null)try{D==="input"&&g.type==="radio"&&g.name!=null&&it(p,g),qn(D,E);var ye=qn(D,g);for(E=0;E<X.length;E+=2){var Pe=X[E],Te=X[E+1];Pe==="style"?Br(p,Te):Pe==="dangerouslySetInnerHTML"?mn(p,Te):Pe==="children"?sn(p,Te):P(p,Pe,Te,ye)}switch(D){case"input":Ct(p,g);break;case"textarea":Wt(p,g);break;case"select":var je=p._wrapperState.wasMultiple;p._wrapperState.wasMultiple=!!g.multiple;var Ke=g.value;Ke!=null?Nt(p,!!g.multiple,Ke,!1):je!==!!g.multiple&&(g.defaultValue!=null?Nt(p,!!g.multiple,g.defaultValue,!0):Nt(p,!!g.multiple,g.multiple?[]:"",!1))}p[ea]=g}catch(Ge){Ft(e,e.return,Ge)}}break;case 6:if(Ar(n,e),Gr(e),u&4){if(e.stateNode===null)throw Error(i(162));p=e.stateNode,g=e.memoizedProps;try{p.nodeValue=g}catch(Ge){Ft(e,e.return,Ge)}}break;case 3:if(Ar(n,e),Gr(e),u&4&&o!==null&&o.memoizedState.isDehydrated)try{fo(n.containerInfo)}catch(Ge){Ft(e,e.return,Ge)}break;case 4:Ar(n,e),Gr(e);break;case 13:Ar(n,e),Gr(e),p=e.child,p.flags&8192&&(g=p.memoizedState!==null,p.stateNode.isHidden=g,!g||p.alternate!==null&&p.alternate.memoizedState!==null||(Rc=mt())),u&4&&kp(e);break;case 22:if(Pe=o!==null&&o.memoizedState!==null,e.mode&1?(kn=(ye=kn)||Pe,Ar(n,e),kn=ye):Ar(n,e),Gr(e),u&8192){if(ye=e.memoizedState!==null,(e.stateNode.isHidden=ye)&&!Pe&&(e.mode&1)!==0)for(Xe=e,Pe=e.child;Pe!==null;){for(Te=Xe=Pe;Xe!==null;){switch(je=Xe,Ke=je.child,je.tag){case 0:case 11:case 14:case 15:fa(4,je,je.return);break;case 1:vs(je,je.return);var Qe=je.stateNode;if(typeof Qe.componentWillUnmount=="function"){u=je,o=je.return;try{n=u,Qe.props=n.memoizedProps,Qe.state=n.memoizedState,Qe.componentWillUnmount()}catch(Ge){Ft(u,o,Ge)}}break;case 5:vs(je,je.return);break;case 22:if(je.memoizedState!==null){jp(Te);continue}}Ke!==null?(Ke.return=je,Xe=Ke):jp(Te)}Pe=Pe.sibling}e:for(Pe=null,Te=e;;){if(Te.tag===5){if(Pe===null){Pe=Te;try{p=Te.stateNode,ye?(g=p.style,typeof g.setProperty=="function"?g.setProperty("display","none","important"):g.display="none"):(D=Te.stateNode,X=Te.memoizedProps.style,E=X!=null&&X.hasOwnProperty("display")?X.display:null,D.style.display=_r("display",E))}catch(Ge){Ft(e,e.return,Ge)}}}else if(Te.tag===6){if(Pe===null)try{Te.stateNode.nodeValue=ye?"":Te.memoizedProps}catch(Ge){Ft(e,e.return,Ge)}}else if((Te.tag!==22&&Te.tag!==23||Te.memoizedState===null||Te===e)&&Te.child!==null){Te.child.return=Te,Te=Te.child;continue}if(Te===e)break e;for(;Te.sibling===null;){if(Te.return===null||Te.return===e)break e;Pe===Te&&(Pe=null),Te=Te.return}Pe===Te&&(Pe=null),Te.sibling.return=Te.return,Te=Te.sibling}}break;case 19:Ar(n,e),Gr(e),u&4&&kp(e);break;case 21:break;default:Ar(n,e),Gr(e)}}function Gr(e){var n=e.flags;if(n&2){try{e:{for(var o=e.return;o!==null;){if(bp(o)){var u=o;break e}o=o.return}throw Error(i(160))}switch(u.tag){case 5:var p=u.stateNode;u.flags&32&&(sn(p,""),u.flags&=-33);var g=_p(e);Ic(e,g,p);break;case 3:case 4:var E=u.stateNode.containerInfo,D=_p(e);Tc(e,D,E);break;default:throw Error(i(161))}}catch(X){Ft(e,e.return,X)}e.flags&=-3}n&4096&&(e.flags&=-4097)}function K0(e,n,o){Xe=e,Ep(e)}function Ep(e,n,o){for(var u=(e.mode&1)!==0;Xe!==null;){var p=Xe,g=p.child;if(p.tag===22&&u){var E=p.memoizedState!==null||Nl;if(!E){var D=p.alternate,X=D!==null&&D.memoizedState!==null||kn;D=Nl;var ye=kn;if(Nl=E,(kn=X)&&!ye)for(Xe=p;Xe!==null;)E=Xe,X=E.child,E.tag===22&&E.memoizedState!==null?Pp(p):X!==null?(X.return=E,Xe=X):Pp(p);for(;g!==null;)Xe=g,Ep(g),g=g.sibling;Xe=p,Nl=D,kn=ye}Cp(e)}else(p.subtreeFlags&8772)!==0&&g!==null?(g.return=p,Xe=g):Cp(e)}}function Cp(e){for(;Xe!==null;){var n=Xe;if((n.flags&8772)!==0){var o=n.alternate;try{if((n.flags&8772)!==0)switch(n.tag){case 0:case 11:case 15:kn||El(5,n);break;case 1:var u=n.stateNode;if(n.flags&4&&!kn)if(o===null)u.componentDidMount();else{var p=n.elementType===n.type?o.memoizedProps:Tr(n.type,o.memoizedProps);u.componentDidUpdate(p,o.memoizedState,u.__reactInternalSnapshotBeforeUpdate)}var g=n.updateQueue;g!==null&&jd(n,g,u);break;case 3:var E=n.updateQueue;if(E!==null){if(o=null,n.child!==null)switch(n.child.tag){case 5:o=n.child.stateNode;break;case 1:o=n.child.stateNode}jd(n,E,o)}break;case 5:var D=n.stateNode;if(o===null&&n.flags&4){o=D;var X=n.memoizedProps;switch(n.type){case"button":case"input":case"select":case"textarea":X.autoFocus&&o.focus();break;case"img":X.src&&(o.src=X.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(n.memoizedState===null){var ye=n.alternate;if(ye!==null){var Pe=ye.memoizedState;if(Pe!==null){var Te=Pe.dehydrated;Te!==null&&fo(Te)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(i(163))}kn||n.flags&512&&$c(n)}catch(je){Ft(n,n.return,je)}}if(n===e){Xe=null;break}if(o=n.sibling,o!==null){o.return=n.return,Xe=o;break}Xe=n.return}}function jp(e){for(;Xe!==null;){var n=Xe;if(n===e){Xe=null;break}var o=n.sibling;if(o!==null){o.return=n.return,Xe=o;break}Xe=n.return}}function Pp(e){for(;Xe!==null;){var n=Xe;try{switch(n.tag){case 0:case 11:case 15:var o=n.return;try{El(4,n)}catch(X){Ft(n,o,X)}break;case 1:var u=n.stateNode;if(typeof u.componentDidMount=="function"){var p=n.return;try{u.componentDidMount()}catch(X){Ft(n,p,X)}}var g=n.return;try{$c(n)}catch(X){Ft(n,g,X)}break;case 5:var E=n.return;try{$c(n)}catch(X){Ft(n,E,X)}}}catch(X){Ft(n,n.return,X)}if(n===e){Xe=null;break}var D=n.sibling;if(D!==null){D.return=n.return,Xe=D;break}Xe=n.return}}var q0=Math.ceil,Cl=R.ReactCurrentDispatcher,Ac=R.ReactCurrentOwner,wr=R.ReactCurrentBatchConfig,wt=0,nn=null,Ut=null,dn=0,or=0,xs=Go(0),Qt=0,da=null,Pi=0,jl=0,Oc=0,pa=null,Bn=null,Rc=0,ws=1/0,Po=null,Pl=!1,Lc=null,ri=null,Ml=!1,oi=null,$l=0,ha=0,Dc=null,Tl=-1,Il=0;function In(){return(wt&6)!==0?mt():Tl!==-1?Tl:Tl=mt()}function ii(e){return(e.mode&1)===0?1:(wt&2)!==0&&dn!==0?dn&-dn:P0.transition!==null?(Il===0&&(Il=Ur()),Il):(e=bt,e!==0||(e=window.event,e=e===void 0?16:qi(e.type)),e)}function Or(e,n,o,u){if(50<ha)throw ha=0,Dc=null,Error(i(185));mr(e,o,u),((wt&2)===0||e!==nn)&&(e===nn&&((wt&2)===0&&(jl|=o),Qt===4&&si(e,dn)),Hn(e,u),o===1&&wt===0&&(n.mode&1)===0&&(ws=mt()+500,al&&Zo()))}function Hn(e,n){var o=e.callbackNode;lo(e,n);var u=xt(e,e===nn?dn:0);if(u===0)o!==null&&Mn(o),e.callbackNode=null,e.callbackPriority=0;else if(n=u&-u,e.callbackPriority!==n){if(o!=null&&Mn(o),n===1)e.tag===0?j0($p.bind(null,e)):gd($p.bind(null,e)),k0(function(){(wt&6)===0&&Zo()}),o=null;else{switch(Ba(u)){case 1:o=Jn;break;case 4:o=Zn;break;case 16:o=dr;break;case 536870912:o=di;break;default:o=dr}o=zp(o,Mp.bind(null,e))}e.callbackPriority=n,e.callbackNode=o}}function Mp(e,n){if(Tl=-1,Il=0,(wt&6)!==0)throw Error(i(327));var o=e.callbackNode;if(bs()&&e.callbackNode!==o)return null;var u=xt(e,e===nn?dn:0);if(u===0)return null;if((u&30)!==0||(u&e.expiredLanes)!==0||n)n=Al(e,u);else{n=u;var p=wt;wt|=2;var g=Ip();(nn!==e||dn!==n)&&(Po=null,ws=mt()+500,$i(e,n));do try{X0();break}catch(D){Tp(e,D)}while(!0);nc(),Cl.current=g,wt=p,Ut!==null?n=0:(nn=null,dn=0,n=Qt)}if(n!==0){if(n===2&&(p=hr(e),p!==0&&(u=p,n=zc(e,p))),n===1)throw o=da,$i(e,0),si(e,u),Hn(e,mt()),o;if(n===6)si(e,u);else{if(p=e.current.alternate,(u&30)===0&&!W0(p)&&(n=Al(e,u),n===2&&(g=hr(e),g!==0&&(u=g,n=zc(e,g))),n===1))throw o=da,$i(e,0),si(e,u),Hn(e,mt()),o;switch(e.finishedWork=p,e.finishedLanes=u,n){case 0:case 1:throw Error(i(345));case 2:Ti(e,Bn,Po);break;case 3:if(si(e,u),(u&130023424)===u&&(n=Rc+500-mt(),10<n)){if(xt(e,0)!==0)break;if(p=e.suspendedLanes,(p&u)!==u){In(),e.pingedLanes|=e.suspendedLanes&p;break}e.timeoutHandle=Ku(Ti.bind(null,e,Bn,Po),n);break}Ti(e,Bn,Po);break;case 4:if(si(e,u),(u&4194240)===u)break;for(n=e.eventTimes,p=-1;0<u;){var E=31-vn(u);g=1<<E,E=n[E],E>p&&(p=E),u&=~g}if(u=p,u=mt()-u,u=(120>u?120:480>u?480:1080>u?1080:1920>u?1920:3e3>u?3e3:4320>u?4320:1960*q0(u/1960))-u,10<u){e.timeoutHandle=Ku(Ti.bind(null,e,Bn,Po),u);break}Ti(e,Bn,Po);break;case 5:Ti(e,Bn,Po);break;default:throw Error(i(329))}}}return Hn(e,mt()),e.callbackNode===o?Mp.bind(null,e):null}function zc(e,n){var o=pa;return e.current.memoizedState.isDehydrated&&($i(e,n).flags|=256),e=Al(e,n),e!==2&&(n=Bn,Bn=o,n!==null&&Fc(n)),e}function Fc(e){Bn===null?Bn=e:Bn.push.apply(Bn,e)}function W0(e){for(var n=e;;){if(n.flags&16384){var o=n.updateQueue;if(o!==null&&(o=o.stores,o!==null))for(var u=0;u<o.length;u++){var p=o[u],g=p.getSnapshot;p=p.value;try{if(!ue(g(),p))return!1}catch{return!1}}}if(o=n.child,n.subtreeFlags&16384&&o!==null)o.return=n,n=o;else{if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return!0;n=n.return}n.sibling.return=n.return,n=n.sibling}}return!0}function si(e,n){for(n&=~Oc,n&=~jl,e.suspendedLanes|=n,e.pingedLanes&=~n,e=e.expirationTimes;0<n;){var o=31-vn(n),u=1<<o;e[o]=-1,n&=~u}}function $p(e){if((wt&6)!==0)throw Error(i(327));bs();var n=xt(e,0);if((n&1)===0)return Hn(e,mt()),null;var o=Al(e,n);if(e.tag!==0&&o===2){var u=hr(e);u!==0&&(n=u,o=zc(e,u))}if(o===1)throw o=da,$i(e,0),si(e,n),Hn(e,mt()),o;if(o===6)throw Error(i(345));return e.finishedWork=e.current.alternate,e.finishedLanes=n,Ti(e,Bn,Po),Hn(e,mt()),null}function Bc(e,n){var o=wt;wt|=1;try{return e(n)}finally{wt=o,wt===0&&(ws=mt()+500,al&&Zo())}}function Mi(e){oi!==null&&oi.tag===0&&(wt&6)===0&&bs();var n=wt;wt|=1;var o=wr.transition,u=bt;try{if(wr.transition=null,bt=1,e)return e()}finally{bt=u,wr.transition=o,wt=n,(wt&6)===0&&Zo()}}function Hc(){or=xs.current,Mt(xs)}function $i(e,n){e.finishedWork=null,e.finishedLanes=0;var o=e.timeoutHandle;if(o!==-1&&(e.timeoutHandle=-1,S0(o)),Ut!==null)for(o=Ut.return;o!==null;){var u=o;switch(Gu(u),u.tag){case 1:u=u.type.childContextTypes,u!=null&&il();break;case 3:gs(),Mt(Dn),Mt(bn),cc();break;case 5:lc(u);break;case 4:gs();break;case 13:Mt(Dt);break;case 19:Mt(Dt);break;case 10:rc(u.type._context);break;case 22:case 23:Hc()}o=o.return}if(nn=e,Ut=e=ai(e.current,null),dn=or=n,Qt=0,da=null,Oc=jl=Pi=0,Bn=pa=null,Ei!==null){for(n=0;n<Ei.length;n++)if(o=Ei[n],u=o.interleaved,u!==null){o.interleaved=null;var p=u.next,g=o.pending;if(g!==null){var E=g.next;g.next=p,u.next=E}o.pending=u}Ei=null}return e}function Tp(e,n){do{var o=Ut;try{if(nc(),yl.current=bl,vl){for(var u=zt.memoizedState;u!==null;){var p=u.queue;p!==null&&(p.pending=null),u=u.next}vl=!1}if(ji=0,tn=Xt=zt=null,sa=!1,aa=0,Ac.current=null,o===null||o.return===null){Qt=1,da=n,Ut=null;break}e:{var g=e,E=o.return,D=o,X=n;if(n=dn,D.flags|=32768,X!==null&&typeof X=="object"&&typeof X.then=="function"){var ye=X,Pe=D,Te=Pe.tag;if((Pe.mode&1)===0&&(Te===0||Te===11||Te===15)){var je=Pe.alternate;je?(Pe.updateQueue=je.updateQueue,Pe.memoizedState=je.memoizedState,Pe.lanes=je.lanes):(Pe.updateQueue=null,Pe.memoizedState=null)}var Ke=rp(E);if(Ke!==null){Ke.flags&=-257,op(Ke,E,D,g,n),Ke.mode&1&&np(g,ye,n),n=Ke,X=ye;var Qe=n.updateQueue;if(Qe===null){var Ge=new Set;Ge.add(X),n.updateQueue=Ge}else Qe.add(X);break e}else{if((n&1)===0){np(g,ye,n),Vc();break e}X=Error(i(426))}}else if(At&&D.mode&1){var Bt=rp(E);if(Bt!==null){(Bt.flags&65536)===0&&(Bt.flags|=256),op(Bt,E,D,g,n),ec(ys(X,D));break e}}g=X=ys(X,D),Qt!==4&&(Qt=2),pa===null?pa=[g]:pa.push(g),g=E;do{switch(g.tag){case 3:g.flags|=65536,n&=-n,g.lanes|=n;var he=ep(g,X,n);Cd(g,he);break e;case 1:D=X;var ne=g.type,me=g.stateNode;if((g.flags&128)===0&&(typeof ne.getDerivedStateFromError=="function"||me!==null&&typeof me.componentDidCatch=="function"&&(ri===null||!ri.has(me)))){g.flags|=65536,n&=-n,g.lanes|=n;var Fe=tp(g,D,n);Cd(g,Fe);break e}}g=g.return}while(g!==null)}Op(o)}catch(Je){n=Je,Ut===o&&o!==null&&(Ut=o=o.return);continue}break}while(!0)}function Ip(){var e=Cl.current;return Cl.current=bl,e===null?bl:e}function Vc(){(Qt===0||Qt===3||Qt===2)&&(Qt=4),nn===null||(Pi&268435455)===0&&(jl&268435455)===0||si(nn,dn)}function Al(e,n){var o=wt;wt|=2;var u=Ip();(nn!==e||dn!==n)&&(Po=null,$i(e,n));do try{Y0();break}catch(p){Tp(e,p)}while(!0);if(nc(),wt=o,Cl.current=u,Ut!==null)throw Error(i(261));return nn=null,dn=0,Qt}function Y0(){for(;Ut!==null;)Ap(Ut)}function X0(){for(;Ut!==null&&!kt();)Ap(Ut)}function Ap(e){var n=Dp(e.alternate,e,or);e.memoizedProps=e.pendingProps,n===null?Op(e):Ut=n,Ac.current=null}function Op(e){var n=e;do{var o=n.alternate;if(e=n.return,(n.flags&32768)===0){if(o=B0(o,n,or),o!==null){Ut=o;return}}else{if(o=H0(o,n),o!==null){o.flags&=32767,Ut=o;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Qt=6,Ut=null;return}}if(n=n.sibling,n!==null){Ut=n;return}Ut=n=e}while(n!==null);Qt===0&&(Qt=5)}function Ti(e,n,o){var u=bt,p=wr.transition;try{wr.transition=null,bt=1,Q0(e,n,o,u)}finally{wr.transition=p,bt=u}return null}function Q0(e,n,o,u){do bs();while(oi!==null);if((wt&6)!==0)throw Error(i(327));o=e.finishedWork;var p=e.finishedLanes;if(o===null)return null;if(e.finishedWork=null,e.finishedLanes=0,o===e.current)throw Error(i(177));e.callbackNode=null,e.callbackPriority=0;var g=o.lanes|o.childLanes;if(pi(e,g),e===nn&&(Ut=nn=null,dn=0),(o.subtreeFlags&2064)===0&&(o.flags&2064)===0||Ml||(Ml=!0,zp(dr,function(){return bs(),null})),g=(o.flags&15990)!==0,(o.subtreeFlags&15990)!==0||g){g=wr.transition,wr.transition=null;var E=bt;bt=1;var D=wt;wt|=4,Ac.current=null,U0(e,o),Np(o,e),se(Vu),Ki=!!Hu,Vu=Hu=null,e.current=o,K0(o),an(),wt=D,bt=E,wr.transition=g}else e.current=o;if(Ml&&(Ml=!1,oi=e,$l=p),g=e.pendingLanes,g===0&&(ri=null),ft(o.stateNode),Hn(e,mt()),n!==null)for(u=e.onRecoverableError,o=0;o<n.length;o++)p=n[o],u(p.value,{componentStack:p.stack,digest:p.digest});if(Pl)throw Pl=!1,e=Lc,Lc=null,e;return($l&1)!==0&&e.tag!==0&&bs(),g=e.pendingLanes,(g&1)!==0?e===Dc?ha++:(ha=0,Dc=e):ha=0,Zo(),null}function bs(){if(oi!==null){var e=Ba($l),n=wr.transition,o=bt;try{if(wr.transition=null,bt=16>e?16:e,oi===null)var u=!1;else{if(e=oi,oi=null,$l=0,(wt&6)!==0)throw Error(i(331));var p=wt;for(wt|=4,Xe=e.current;Xe!==null;){var g=Xe,E=g.child;if((Xe.flags&16)!==0){var D=g.deletions;if(D!==null){for(var X=0;X<D.length;X++){var ye=D[X];for(Xe=ye;Xe!==null;){var Pe=Xe;switch(Pe.tag){case 0:case 11:case 15:fa(8,Pe,g)}var Te=Pe.child;if(Te!==null)Te.return=Pe,Xe=Te;else for(;Xe!==null;){Pe=Xe;var je=Pe.sibling,Ke=Pe.return;if(wp(Pe),Pe===ye){Xe=null;break}if(je!==null){je.return=Ke,Xe=je;break}Xe=Ke}}}var Qe=g.alternate;if(Qe!==null){var Ge=Qe.child;if(Ge!==null){Qe.child=null;do{var Bt=Ge.sibling;Ge.sibling=null,Ge=Bt}while(Ge!==null)}}Xe=g}}if((g.subtreeFlags&2064)!==0&&E!==null)E.return=g,Xe=E;else e:for(;Xe!==null;){if(g=Xe,(g.flags&2048)!==0)switch(g.tag){case 0:case 11:case 15:fa(9,g,g.return)}var he=g.sibling;if(he!==null){he.return=g.return,Xe=he;break e}Xe=g.return}}var ne=e.current;for(Xe=ne;Xe!==null;){E=Xe;var me=E.child;if((E.subtreeFlags&2064)!==0&&me!==null)me.return=E,Xe=me;else e:for(E=ne;Xe!==null;){if(D=Xe,(D.flags&2048)!==0)try{switch(D.tag){case 0:case 11:case 15:El(9,D)}}catch(Je){Ft(D,D.return,Je)}if(D===E){Xe=null;break e}var Fe=D.sibling;if(Fe!==null){Fe.return=D.return,Xe=Fe;break e}Xe=D.return}}if(wt=p,Zo(),$n&&typeof $n.onPostCommitFiberRoot=="function")try{$n.onPostCommitFiberRoot(pr,e)}catch{}u=!0}return u}finally{bt=o,wr.transition=n}}return!1}function Rp(e,n,o){n=ys(o,n),n=ep(e,n,1),e=ti(e,n,1),n=In(),e!==null&&(mr(e,1,n),Hn(e,n))}function Ft(e,n,o){if(e.tag===3)Rp(e,e,o);else for(;n!==null;){if(n.tag===3){Rp(n,e,o);break}else if(n.tag===1){var u=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof u.componentDidCatch=="function"&&(ri===null||!ri.has(u))){e=ys(o,e),e=tp(n,e,1),n=ti(n,e,1),e=In(),n!==null&&(mr(n,1,e),Hn(n,e));break}}n=n.return}}function G0(e,n,o){var u=e.pingCache;u!==null&&u.delete(n),n=In(),e.pingedLanes|=e.suspendedLanes&o,nn===e&&(dn&o)===o&&(Qt===4||Qt===3&&(dn&130023424)===dn&&500>mt()-Rc?$i(e,0):Oc|=o),Hn(e,n)}function Lp(e,n){n===0&&((e.mode&1)===0?n=1:(n=ao,ao<<=1,(ao&130023424)===0&&(ao=4194304)));var o=In();e=Eo(e,n),e!==null&&(mr(e,n,o),Hn(e,o))}function J0(e){var n=e.memoizedState,o=0;n!==null&&(o=n.retryLane),Lp(e,o)}function Z0(e,n){var o=0;switch(e.tag){case 13:var u=e.stateNode,p=e.memoizedState;p!==null&&(o=p.retryLane);break;case 19:u=e.stateNode;break;default:throw Error(i(314))}u!==null&&u.delete(n),Lp(e,o)}var Dp;Dp=function(e,n,o){if(e!==null)if(e.memoizedProps!==n.pendingProps||Dn.current)Fn=!0;else{if((e.lanes&o)===0&&(n.flags&128)===0)return Fn=!1,F0(e,n,o);Fn=(e.flags&131072)!==0}else Fn=!1,At&&(n.flags&1048576)!==0&&yd(n,ul,n.index);switch(n.lanes=0,n.tag){case 2:var u=n.type;kl(e,n),e=n.pendingProps;var p=us(n,bn.current);ms(n,o),p=pc(null,n,u,e,p,o);var g=hc();return n.flags|=1,typeof p=="object"&&p!==null&&typeof p.render=="function"&&p.$$typeof===void 0?(n.tag=1,n.memoizedState=null,n.updateQueue=null,zn(u)?(g=!0,sl(n)):g=!1,n.memoizedState=p.state!==null&&p.state!==void 0?p.state:null,sc(n),p.updater=_l,n.stateNode=p,p._reactInternals=n,wc(n,u,e,o),n=kc(null,n,u,!0,g,o)):(n.tag=0,At&&g&&Qu(n),Tn(null,n,p,o),n=n.child),n;case 16:u=n.elementType;e:{switch(kl(e,n),e=n.pendingProps,p=u._init,u=p(u._payload),n.type=u,p=n.tag=ty(u),e=Tr(u,e),p){case 0:n=Sc(null,n,u,e,o);break e;case 1:n=cp(null,n,u,e,o);break e;case 11:n=ip(null,n,u,e,o);break e;case 14:n=sp(null,n,u,Tr(u.type,e),o);break e}throw Error(i(306,u,""))}return n;case 0:return u=n.type,p=n.pendingProps,p=n.elementType===u?p:Tr(u,p),Sc(e,n,u,p,o);case 1:return u=n.type,p=n.pendingProps,p=n.elementType===u?p:Tr(u,p),cp(e,n,u,p,o);case 3:e:{if(fp(n),e===null)throw Error(i(387));u=n.pendingProps,g=n.memoizedState,p=g.element,Ed(e,n),ml(n,u,null,o);var E=n.memoizedState;if(u=E.element,g.isDehydrated)if(g={element:u,isDehydrated:!1,cache:E.cache,pendingSuspenseBoundaries:E.pendingSuspenseBoundaries,transitions:E.transitions},n.updateQueue.baseState=g,n.memoizedState=g,n.flags&256){p=ys(Error(i(423)),n),n=dp(e,n,u,o,p);break e}else if(u!==p){p=ys(Error(i(424)),n),n=dp(e,n,u,o,p);break e}else for(rr=Qo(n.stateNode.containerInfo.firstChild),nr=n,At=!0,$r=null,o=kd(n,null,u,o),n.child=o;o;)o.flags=o.flags&-3|4096,o=o.sibling;else{if(ds(),u===p){n=jo(e,n,o);break e}Tn(e,n,u,o)}n=n.child}return n;case 5:return Pd(n),e===null&&Zu(n),u=n.type,p=n.pendingProps,g=e!==null?e.memoizedProps:null,E=p.children,Uu(u,p)?E=null:g!==null&&Uu(u,g)&&(n.flags|=32),up(e,n),Tn(e,n,E,o),n.child;case 6:return e===null&&Zu(n),null;case 13:return pp(e,n,o);case 4:return ac(n,n.stateNode.containerInfo),u=n.pendingProps,e===null?n.child=ps(n,null,u,o):Tn(e,n,u,o),n.child;case 11:return u=n.type,p=n.pendingProps,p=n.elementType===u?p:Tr(u,p),ip(e,n,u,p,o);case 7:return Tn(e,n,n.pendingProps,o),n.child;case 8:return Tn(e,n,n.pendingProps.children,o),n.child;case 12:return Tn(e,n,n.pendingProps.children,o),n.child;case 10:e:{if(u=n.type._context,p=n.pendingProps,g=n.memoizedProps,E=p.value,Et(dl,u._currentValue),u._currentValue=E,g!==null)if(ue(g.value,E)){if(g.children===p.children&&!Dn.current){n=jo(e,n,o);break e}}else for(g=n.child,g!==null&&(g.return=n);g!==null;){var D=g.dependencies;if(D!==null){E=g.child;for(var X=D.firstContext;X!==null;){if(X.context===u){if(g.tag===1){X=Co(-1,o&-o),X.tag=2;var ye=g.updateQueue;if(ye!==null){ye=ye.shared;var Pe=ye.pending;Pe===null?X.next=X:(X.next=Pe.next,Pe.next=X),ye.pending=X}}g.lanes|=o,X=g.alternate,X!==null&&(X.lanes|=o),oc(g.return,o,n),D.lanes|=o;break}X=X.next}}else if(g.tag===10)E=g.type===n.type?null:g.child;else if(g.tag===18){if(E=g.return,E===null)throw Error(i(341));E.lanes|=o,D=E.alternate,D!==null&&(D.lanes|=o),oc(E,o,n),E=g.sibling}else E=g.child;if(E!==null)E.return=g;else for(E=g;E!==null;){if(E===n){E=null;break}if(g=E.sibling,g!==null){g.return=E.return,E=g;break}E=E.return}g=E}Tn(e,n,p.children,o),n=n.child}return n;case 9:return p=n.type,u=n.pendingProps.children,ms(n,o),p=vr(p),u=u(p),n.flags|=1,Tn(e,n,u,o),n.child;case 14:return u=n.type,p=Tr(u,n.pendingProps),p=Tr(u.type,p),sp(e,n,u,p,o);case 15:return ap(e,n,n.type,n.pendingProps,o);case 17:return u=n.type,p=n.pendingProps,p=n.elementType===u?p:Tr(u,p),kl(e,n),n.tag=1,zn(u)?(e=!0,sl(n)):e=!1,ms(n,o),Jd(n,u,p),wc(n,u,p,o),kc(null,n,u,!0,e,o);case 19:return mp(e,n,o);case 22:return lp(e,n,o)}throw Error(i(156,n.tag))};function zp(e,n){return yn(e,n)}function ey(e,n,o,u){this.tag=e,this.key=o,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=u,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function br(e,n,o,u){return new ey(e,n,o,u)}function Uc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ty(e){if(typeof e=="function")return Uc(e)?1:0;if(e!=null){if(e=e.$$typeof,e===fe)return 11;if(e===le)return 14}return 2}function ai(e,n){var o=e.alternate;return o===null?(o=br(e.tag,n,e.key,e.mode),o.elementType=e.elementType,o.type=e.type,o.stateNode=e.stateNode,o.alternate=e,e.alternate=o):(o.pendingProps=n,o.type=e.type,o.flags=0,o.subtreeFlags=0,o.deletions=null),o.flags=e.flags&14680064,o.childLanes=e.childLanes,o.lanes=e.lanes,o.child=e.child,o.memoizedProps=e.memoizedProps,o.memoizedState=e.memoizedState,o.updateQueue=e.updateQueue,n=e.dependencies,o.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},o.sibling=e.sibling,o.index=e.index,o.ref=e.ref,o}function Ol(e,n,o,u,p,g){var E=2;if(u=e,typeof e=="function")Uc(e)&&(E=1);else if(typeof e=="string")E=5;else e:switch(e){case Q:return Ii(o.children,p,g,n);case ce:E=8,p|=8;break;case de:return e=br(12,o,n,p|2),e.elementType=de,e.lanes=g,e;case xe:return e=br(13,o,n,p),e.elementType=xe,e.lanes=g,e;case L:return e=br(19,o,n,p),e.elementType=L,e.lanes=g,e;case ie:return Rl(o,p,g,n);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case we:E=10;break e;case q:E=9;break e;case fe:E=11;break e;case le:E=14;break e;case G:E=16,u=null;break e}throw Error(i(130,e==null?e:typeof e,""))}return n=br(E,o,n,p),n.elementType=e,n.type=u,n.lanes=g,n}function Ii(e,n,o,u){return e=br(7,e,u,n),e.lanes=o,e}function Rl(e,n,o,u){return e=br(22,e,u,n),e.elementType=ie,e.lanes=o,e.stateNode={isHidden:!1},e}function Kc(e,n,o){return e=br(6,e,null,n),e.lanes=o,e}function qc(e,n,o){return n=br(4,e.children!==null?e.children:[],e.key,n),n.lanes=o,n.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},n}function ny(e,n,o,u,p){this.tag=n,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=uo(0),this.expirationTimes=uo(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=uo(0),this.identifierPrefix=u,this.onRecoverableError=p,this.mutableSourceEagerHydrationData=null}function Wc(e,n,o,u,p,g,E,D,X){return e=new ny(e,n,o,D,X),n===1?(n=1,g===!0&&(n|=8)):n=0,g=br(3,null,null,n),e.current=g,g.stateNode=e,g.memoizedState={element:u,isDehydrated:o,cache:null,transitions:null,pendingSuspenseBoundaries:null},sc(g),e}function ry(e,n,o){var u=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:V,key:u==null?null:""+u,children:e,containerInfo:n,implementation:o}}function Fp(e){if(!e)return Jo;e=e._reactInternals;e:{if(z(e)!==e||e.tag!==1)throw Error(i(170));var n=e;do{switch(n.tag){case 3:n=n.stateNode.context;break e;case 1:if(zn(n.type)){n=n.stateNode.__reactInternalMemoizedMergedChildContext;break e}}n=n.return}while(n!==null);throw Error(i(171))}if(e.tag===1){var o=e.type;if(zn(o))return hd(e,o,n)}return n}function Bp(e,n,o,u,p,g,E,D,X){return e=Wc(o,u,!0,e,p,g,E,D,X),e.context=Fp(null),o=e.current,u=In(),p=ii(o),g=Co(u,p),g.callback=n??null,ti(o,g,p),e.current.lanes=p,mr(e,p,u),Hn(e,u),e}function Ll(e,n,o,u){var p=n.current,g=In(),E=ii(p);return o=Fp(o),n.context===null?n.context=o:n.pendingContext=o,n=Co(g,E),n.payload={element:e},u=u===void 0?null:u,u!==null&&(n.callback=u),e=ti(p,n,E),e!==null&&(Or(e,p,E,g),hl(e,p,E)),E}function Dl(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 Hp(e,n){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var o=e.retryLane;e.retryLane=o!==0&&o<n?o:n}}function Yc(e,n){Hp(e,n),(e=e.alternate)&&Hp(e,n)}function oy(){return null}var Vp=typeof reportError=="function"?reportError:function(e){console.error(e)};function Xc(e){this._internalRoot=e}zl.prototype.render=Xc.prototype.render=function(e){var n=this._internalRoot;if(n===null)throw Error(i(409));Ll(e,n,null,null)},zl.prototype.unmount=Xc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var n=e.containerInfo;Mi(function(){Ll(null,e,null,null)}),n[_o]=null}};function zl(e){this._internalRoot=e}zl.prototype.unstable_scheduleHydration=function(e){if(e){var n=Va();e={blockedOn:null,target:e,priority:n};for(var o=0;o<Rn.length&&n!==0&&n<Rn[o].priority;o++);Rn.splice(o,0,e),o===0&&tr(e)}};function Qc(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Fl(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Up(){}function iy(e,n,o,u,p){if(p){if(typeof u=="function"){var g=u;u=function(){var ye=Dl(E);g.call(ye)}}var E=Bp(n,u,e,0,null,!1,!1,"",Up);return e._reactRootContainer=E,e[_o]=E.current,Js(e.nodeType===8?e.parentNode:e),Mi(),E}for(;p=e.lastChild;)e.removeChild(p);if(typeof u=="function"){var D=u;u=function(){var ye=Dl(X);D.call(ye)}}var X=Wc(e,0,!1,null,null,!1,!1,"",Up);return e._reactRootContainer=X,e[_o]=X.current,Js(e.nodeType===8?e.parentNode:e),Mi(function(){Ll(n,X,o,u)}),X}function Bl(e,n,o,u,p){var g=o._reactRootContainer;if(g){var E=g;if(typeof p=="function"){var D=p;p=function(){var X=Dl(E);D.call(X)}}Ll(n,E,e,p)}else E=iy(o,n,e,p,u);return Dl(E)}yt=function(e){switch(e.tag){case 3:var n=e.stateNode;if(n.current.memoizedState.isDehydrated){var o=er(n.pendingLanes);o!==0&&(zo(n,o|1),Hn(n,mt()),(wt&6)===0&&(ws=mt()+500,Zo()))}break;case 13:Mi(function(){var u=Eo(e,1);if(u!==null){var p=In();Or(u,e,1,p)}}),Yc(e,1)}},Vi=function(e){if(e.tag===13){var n=Eo(e,134217728);if(n!==null){var o=In();Or(n,e,134217728,o)}Yc(e,134217728)}},Ha=function(e){if(e.tag===13){var n=ii(e),o=Eo(e,n);if(o!==null){var u=In();Or(o,e,n,u)}Yc(e,n)}},Va=function(){return bt},xn=function(e,n){var o=bt;try{return bt=e,n()}finally{bt=o}},He=function(e,n,o){switch(n){case"input":if(Ct(e,o),n=o.name,o.type==="radio"&&n!=null){for(o=e;o.parentNode;)o=o.parentNode;for(o=o.querySelectorAll("input[name="+JSON.stringify(""+n)+'][type="radio"]'),n=0;n<o.length;n++){var u=o[n];if(u!==e&&u.form===e.form){var p=ol(u);if(!p)throw Error(i(90));Re(u),Ct(u,p)}}}break;case"textarea":Wt(e,o);break;case"select":n=o.value,n!=null&&Nt(e,!!o.multiple,n,!1)}},Oo=Bc,Ro=Mi;var sy={usingClientEntryPoint:!1,Events:[ta,as,ol,ro,Hr,Bc]},ma={findFiberByHostInstance:_i,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},ay={bundleType:ma.bundleType,version:ma.version,rendererPackageName:ma.rendererPackageName,rendererConfig:ma.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:R.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Pn(e),e===null?null:e.stateNode},findFiberByHostInstance:ma.findFiberByHostInstance||oy,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Hl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Hl.isDisabled&&Hl.supportsFiber)try{pr=Hl.inject(ay),$n=Hl}catch{}}return Vn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=sy,Vn.createPortal=function(e,n){var o=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Qc(n))throw Error(i(200));return ry(e,n,null,o)},Vn.createRoot=function(e,n){if(!Qc(e))throw Error(i(299));var o=!1,u="",p=Vp;return n!=null&&(n.unstable_strictMode===!0&&(o=!0),n.identifierPrefix!==void 0&&(u=n.identifierPrefix),n.onRecoverableError!==void 0&&(p=n.onRecoverableError)),n=Wc(e,1,!1,null,null,o,!1,u,p),e[_o]=n.current,Js(e.nodeType===8?e.parentNode:e),new Xc(n)},Vn.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var n=e._reactInternals;if(n===void 0)throw typeof e.render=="function"?Error(i(188)):(e=Object.keys(e).join(","),Error(i(268,e)));return e=Pn(n),e=e===null?null:e.stateNode,e},Vn.flushSync=function(e){return Mi(e)},Vn.hydrate=function(e,n,o){if(!Fl(n))throw Error(i(200));return Bl(null,e,n,!0,o)},Vn.hydrateRoot=function(e,n,o){if(!Qc(e))throw Error(i(405));var u=o!=null&&o.hydratedSources||null,p=!1,g="",E=Vp;if(o!=null&&(o.unstable_strictMode===!0&&(p=!0),o.identifierPrefix!==void 0&&(g=o.identifierPrefix),o.onRecoverableError!==void 0&&(E=o.onRecoverableError)),n=Bp(n,null,e,1,o??null,p,!1,g,E),e[_o]=n.current,Js(e),u)for(e=0;e<u.length;e++)o=u[e],p=o._getVersion,p=p(o._source),n.mutableSourceEagerHydrationData==null?n.mutableSourceEagerHydrationData=[o,p]:n.mutableSourceEagerHydrationData.push(o,p);return new zl(n)},Vn.render=function(e,n,o){if(!Fl(n))throw Error(i(200));return Bl(null,e,n,!1,o)},Vn.unmountComponentAtNode=function(e){if(!Fl(e))throw Error(i(40));return e._reactRootContainer?(Mi(function(){Bl(null,null,e,!1,function(){e._reactRootContainer=null,e[_o]=null})}),!0):!1},Vn.unstable_batchedUpdates=Bc,Vn.unstable_renderSubtreeIntoContainer=function(e,n,o,u){if(!Fl(o))throw Error(i(200));if(e==null||e._reactInternals===void 0)throw Error(i(38));return Bl(e,n,o,!1,u)},Vn.version="18.3.1-next-f1338f8080-20240426",Vn}var Jp;function ym(){if(Jp)return Zc.exports;Jp=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(r){console.error(r)}}return t(),Zc.exports=yy(),Zc.exports}var Zp;function vy(){if(Zp)return Vl;Zp=1;var t=ym();return Vl.createRoot=t.createRoot,Vl.hydrateRoot=t.hydrateRoot,Vl}var xy=vy();const wy=wu(xy),by="x-api-doc-tor-llm-key";function Zl(t){switch(t){case"anthropic":return"claude-sonnet-4-20250514";case"openai":return"gpt-4o-mini";case"openrouter":return"openai/gpt-4o-mini";default:return"gpt-4o-mini"}}const _y=["get","post","put","patch","delete","options","head","trace"];function eh(t){return t.replace(/[^a-zA-Z0-9]+/g,"_").replace(/^_|_$/g,"").replace(/_+/g,"_")}function bu(t,r,i,s){if(i)return eh(i).replace(/^[0-9]/,"_$&")||`op_${s}`;const l=eh(r.replace(/[{}]/g,""));return`${t}_${l}`||`op_${s}`}function _u(t){var s;return`${(((s=t.info)==null?void 0:s.title)??"Api").replace(/[^a-zA-Z0-9]+/g," ").trim().split(/\s+/).filter(Boolean).map(l=>l.charAt(0).toUpperCase()+l.slice(1).toLowerCase()).join("")||"Api"}Client`}function Su(t){return(t.split(/[^a-zA-Z0-9]+/).filter(Boolean).map(i=>i.charAt(0).toUpperCase()+i.slice(1).toLowerCase()).join("")||"Api")+"Service"}function to(t){const r=[];if(!t.paths)return r;for(const[i,s]of Object.entries(t.paths)){if(!s||typeof s!="object"||"$ref"in s)continue;const l=s;for(const c of _y){const d=l[c];d&&typeof d=="object"&&r.push({method:c,path:i,operationId:d.operationId,tags:d.tags})}}return r}function Sy(t,r,i,s="baseUrl"){var c,d;const l=r.toUpperCase();return`const ${s} = "${((d=(c=t.servers)==null?void 0:c[0])==null?void 0:d.url)??"http://localhost:3000"}";
|
|
41
|
+
/** @returns {Promise<unknown>} */
|
|
42
|
+
const res = await fetch(\`${s}${i}\`, {
|
|
43
|
+
method: "${l}",
|
|
44
|
+
headers: { "Content-Type": "application/json", Authorization: \`Bearer \${token}\` },
|
|
45
|
+
${l==="GET"||l==="HEAD"?"":"body: JSON.stringify({}),"}
|
|
46
|
+
});
|
|
47
|
+
const data = await res.json();
|
|
48
|
+
`}function vm(t,r){const i=t.map((s,l)=>` /**
|
|
49
|
+
* @param {{ headers?: Record<string, string> }} [options]
|
|
50
|
+
* @returns {Promise<unknown>}
|
|
51
|
+
*/
|
|
52
|
+
async ${bu(s.method,s.path,s.operationId,l)}(options) {
|
|
53
|
+
const res = await fetch(\`\${this.baseUrl}${s.path}\`, {
|
|
54
|
+
method: "${s.method.toUpperCase()}",
|
|
55
|
+
headers: { ...this.defaultHeaders, ...options?.headers },
|
|
56
|
+
});
|
|
57
|
+
return res.json();
|
|
58
|
+
}`);return`export class ${r} {
|
|
59
|
+
/**
|
|
60
|
+
* @param {string} baseUrl
|
|
61
|
+
* @param {Record<string, string>} [defaultHeaders]
|
|
62
|
+
*/
|
|
63
|
+
constructor(baseUrl, defaultHeaders = {}) {
|
|
64
|
+
this.baseUrl = baseUrl;
|
|
65
|
+
this.defaultHeaders = defaultHeaders;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
${i.join(`
|
|
69
|
+
|
|
70
|
+
`)}
|
|
71
|
+
}
|
|
72
|
+
`}function ky(t){return vm(to(t),_u(t))}function Ny(t,r){const i=Su(r),s=to(t).filter(l=>{var c;return(c=l.tags)==null?void 0:c.includes(r)});return vm(s,i)}function Ey(t,r,i){var c,d;const s=((d=(c=t.servers)==null?void 0:c[0])==null?void 0:d.url)??"http://localhost:3000",l=r.toUpperCase();return`<?php
|
|
73
|
+
$baseUrl = '${s}';
|
|
74
|
+
$url = $baseUrl . '${i}';
|
|
75
|
+
$opts = [
|
|
76
|
+
'http' => [
|
|
77
|
+
'method' => '${l}',
|
|
78
|
+
'header' => "Content-Type: application/json\\r\\nAuthorization: Bearer {$token}\\r\\n",
|
|
79
|
+
${l==="GET"||l==="HEAD"?"":"'content' => json_encode([]),"}
|
|
80
|
+
],
|
|
81
|
+
];
|
|
82
|
+
$context = stream_context_create($opts);
|
|
83
|
+
$response = file_get_contents($url, false, $context);
|
|
84
|
+
$data = json_decode($response, true);
|
|
85
|
+
`}function xm(t,r){const i=t.map((s,l)=>` public function ${bu(s.method,s.path,s.operationId,l)}(array $extraHeaders = []): array
|
|
86
|
+
{
|
|
87
|
+
$url = $this->baseUrl . '${s.path}';
|
|
88
|
+
$headers = array_merge($this->defaultHeaders, $extraHeaders);
|
|
89
|
+
$opts = [
|
|
90
|
+
'http' => [
|
|
91
|
+
'method' => '${s.method.toUpperCase()}',
|
|
92
|
+
'header' => $this->formatHeaders($headers),
|
|
93
|
+
],
|
|
94
|
+
];
|
|
95
|
+
$ctx = stream_context_create($opts);
|
|
96
|
+
$raw = file_get_contents($url, false, $ctx);
|
|
97
|
+
return json_decode($raw ?: '[]', true) ?: [];
|
|
98
|
+
}`);return`<?php
|
|
99
|
+
|
|
100
|
+
declare(strict_types=1);
|
|
101
|
+
|
|
102
|
+
final class ${r}
|
|
103
|
+
{
|
|
104
|
+
public function __construct(
|
|
105
|
+
private string $baseUrl,
|
|
106
|
+
/** @var array<string, string> */
|
|
107
|
+
private array $defaultHeaders = [],
|
|
108
|
+
) {
|
|
109
|
+
$this->baseUrl = rtrim($baseUrl, '/');
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/** @param array<string, string> $headers */
|
|
113
|
+
private function formatHeaders(array $headers): string
|
|
114
|
+
{
|
|
115
|
+
$lines = [];
|
|
116
|
+
foreach ($headers as $k => $v) {
|
|
117
|
+
$lines[] = $k . ': ' . $v;
|
|
118
|
+
}
|
|
119
|
+
return implode("\\r\\n", $lines) . "\\r\\n";
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
${i.join(`
|
|
123
|
+
|
|
124
|
+
`)}
|
|
125
|
+
}
|
|
126
|
+
`}function Cy(t){return xm(to(t),_u(t))}function jy(t,r){const i=Su(r),s=to(t).filter(l=>{var c;return(c=l.tags)==null?void 0:c.includes(r)});return xm(s,i)}function Py(t,r,i){var d,h;const s=((h=(d=t.servers)==null?void 0:d[0])==null?void 0:h.url)??"http://localhost:3000",l=r.toLowerCase();return`import httpx
|
|
127
|
+
|
|
128
|
+
base_url = "${s}"
|
|
129
|
+
url = f"{base_url}${i}"
|
|
130
|
+
headers = {"Authorization": f"Bearer {token}"}
|
|
131
|
+
with httpx.Client() as client:
|
|
132
|
+
response = client.${l}(url, headers=headers${l==="get"||l==="head"?"":", json={}"})
|
|
133
|
+
data = response.json()
|
|
134
|
+
`}function wm(t,r){const i=t.map((s,l)=>{const c=bu(s.method,s.path,s.operationId,l),d=s.method.toLowerCase(),h=d==="get"||d==="head"?"":", json={}";return` def ${c}(self, headers: dict | None = None) -> dict:
|
|
135
|
+
h = {**self.default_headers, **(headers or {})}
|
|
136
|
+
r = self._client.${d}(f"{self.base_url}${s.path}", headers=h${h})
|
|
137
|
+
return r.json()`});return`from __future__ import annotations
|
|
138
|
+
import httpx
|
|
139
|
+
|
|
140
|
+
class ${r}:
|
|
141
|
+
def __init__(self, base_url: str, default_headers: dict | None = None) -> None:
|
|
142
|
+
self.base_url = base_url.rstrip("/")
|
|
143
|
+
self.default_headers = default_headers or {}
|
|
144
|
+
self._client = httpx.Client()
|
|
145
|
+
|
|
146
|
+
def close(self) -> None:
|
|
147
|
+
self._client.close()
|
|
148
|
+
|
|
149
|
+
${i.join(`
|
|
150
|
+
|
|
151
|
+
`)}
|
|
152
|
+
`}function My(t){return wm(to(t),_u(t))}function $y(t,r){const i=Su(r),s=to(t).filter(l=>{var c;return(c=l.tags)==null?void 0:c.includes(r)});return wm(s,i)}function Ty(t){const r=t.split("/");return(r[r.length-1]??"Unknown").replace(/[^a-zA-Z0-9_]/g,"_")}function xf(t){if(!t)return"unknown";if("$ref"in t&&t.$ref)return Ty(t.$ref);const r=t;return r.type==="string"?"string":r.type==="number"||r.type==="integer"?"number":r.type==="boolean"?"boolean":r.type==="array"&&r.items?`${xf(r.items)}[]`:r.type==="object"&&r.properties?`{
|
|
153
|
+
${Object.entries(r.properties).map(([s,l])=>` ${JSON.stringify(s)}?: ${xf(l)};`).join(`
|
|
154
|
+
`)}
|
|
155
|
+
}`:"Record<string, unknown>"}function Iy(t,r,i,s="baseUrl"){var b,k,w,S,C,j;const l=(k=(b=t.paths)==null?void 0:b[i])==null?void 0:k[r],c=l==null?void 0:l.requestBody;let d;if((S=(w=c==null?void 0:c.content)==null?void 0:w["application/json"])!=null&&S.schema){const $=c.content["application/json"].schema;$&&!("$ref"in $)&&(d=$)}const h=d?xf(d):"Record<string, unknown>",y=r.toUpperCase();return`const ${s} = "${((j=(C=t.servers)==null?void 0:C[0])==null?void 0:j.url)??"http://localhost:3000"}";
|
|
156
|
+
const res = await fetch(\`${s}${i}\`, {
|
|
157
|
+
method: "${y}",
|
|
158
|
+
headers: { "Content-Type": "application/json", Authorization: \`Bearer \${token}\` },
|
|
159
|
+
${y==="GET"||y==="HEAD"?"":`body: JSON.stringify({} as ${h}),`}
|
|
160
|
+
});
|
|
161
|
+
const data = await res.json() as unknown;
|
|
162
|
+
`}function bm(t,r){const i=t.map((s,l)=>` async ${bu(s.method,s.path,s.operationId,l)}(options?: { headers?: Record<string, string> }): Promise<unknown> {
|
|
163
|
+
const res = await fetch(\`\${this.baseUrl}${s.path}\`, {
|
|
164
|
+
method: "${s.method.toUpperCase()}",
|
|
165
|
+
headers: { ...this.defaultHeaders, ...options?.headers },
|
|
166
|
+
});
|
|
167
|
+
return res.json();
|
|
168
|
+
}`);return`export class ${r} {
|
|
169
|
+
constructor(
|
|
170
|
+
private baseUrl: string,
|
|
171
|
+
private defaultHeaders: Record<string, string> = {},
|
|
172
|
+
) {}
|
|
173
|
+
|
|
174
|
+
${i.join(`
|
|
175
|
+
|
|
176
|
+
`)}
|
|
177
|
+
}
|
|
178
|
+
`}function Ay(t){const r=to(t),i=_u(t);return bm(r,i)}function Oy(t,r){const i=Su(r),s=to(t).filter(l=>{var c;return(c=l.tags)==null?void 0:c.includes(r)});return bm(s,i)}function Ry(t,r,i,s){switch(r){case"typescript":return Iy(t,i,s);case"javascript":return Sy(t,i,s);case"python":return Py(t,i,s);case"php":return Ey(t,i,s);default:{const l=r;throw new Error(`Unsupported language: ${l}`)}}}function Ly(t,r,i){switch(r){case"typescript":return Oy(t,i);case"javascript":return Ny(t,i);case"python":return $y(t,i);case"php":return jy(t,i);default:{const s=r;throw new Error(`Unsupported language: ${s}`)}}}function Dy(t,r,i){if(i===null)switch(r){case"typescript":return Ay(t);case"javascript":return ky(t);case"python":return My(t);case"php":return Cy(t);default:{const s=r;throw new Error(`Unsupported language: ${s}`)}}return Ly(t,r,i)}function zy(t){const r=new Set;for(const i of to(t))for(const s of i.tags??[])r.add(s);return r.size===0&&r.add("default"),[...r].sort()}function ks(t,r){var i,s,l;return r!=null&&r.trim()?r.replace(/\/$/,""):((l=(s=(i=t.servers)==null?void 0:i[0])==null?void 0:s.url)==null?void 0:l.replace(/\/$/,""))??window.location.origin}function Fy(t){var i;const r=(i=t.components)==null?void 0:i.securitySchemes;return r?Object.keys(r):[]}function Rf(t,r){if(!r.startsWith("$"))return;let i=t;const s=r.slice(1);if(s.startsWith(".")){for(const l of s.slice(1).split("."))if(i&&typeof i=="object"&&l in i)i=i[l];else return;return i}return i}var eu={exports:{}},By=eu.exports,th;function Hy(){return th||(th=1,(function(t,r){((i,s)=>{t.exports=s()})(By,function(){var i=function(a,f){return(i=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(m,v){m.__proto__=v}:function(m,v){for(var _ in v)Object.prototype.hasOwnProperty.call(v,_)&&(m[_]=v[_])}))(a,f)},s=function(){return(s=Object.assign||function(a){for(var f,m=1,v=arguments.length;m<v;m++)for(var _ in f=arguments[m])Object.prototype.hasOwnProperty.call(f,_)&&(a[_]=f[_]);return a}).apply(this,arguments)};function l(a,f,m){for(var v,_=0,N=f.length;_<N;_++)!v&&_ in f||((v=v||Array.prototype.slice.call(f,0,_))[_]=f[_]);return a.concat(v||Array.prototype.slice.call(f))}var c=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:fy,d=Object.keys,h=Array.isArray;function y(a,f){return typeof f=="object"&&d(f).forEach(function(m){a[m]=f[m]}),a}typeof Promise>"u"||c.Promise||(c.Promise=Promise);var b=Object.getPrototypeOf,k={}.hasOwnProperty;function w(a,f){return k.call(a,f)}function S(a,f){typeof f=="function"&&(f=f(b(a))),(typeof Reflect>"u"?d:Reflect.ownKeys)(f).forEach(function(m){j(a,m,f[m])})}var C=Object.defineProperty;function j(a,f,m,v){C(a,f,y(m&&w(m,"get")&&typeof m.get=="function"?{get:m.get,set:m.set,configurable:!0}:{value:m,configurable:!0,writable:!0},v))}function $(a){return{from:function(f){return a.prototype=Object.create(f.prototype),j(a.prototype,"constructor",a),{extend:S.bind(null,a.prototype)}}}}var T=Object.getOwnPropertyDescriptor,I=[].slice;function U(a,f,m){return I.call(a,f,m)}function P(a,f){return f(a)}function R(a){if(!a)throw new Error("Assertion Failed")}function H(a){c.setImmediate?setImmediate(a):setTimeout(a,0)}function V(a,f){if(typeof f=="string"&&w(a,f))return a[f];if(!f)return a;if(typeof f!="string"){for(var m=[],v=0,_=f.length;v<_;++v){var N=V(a,f[v]);m.push(N)}return m}var M,O=f.indexOf(".");return O===-1||(M=a[f.substr(0,O)])==null?void 0:V(M,f.substr(O+1))}function Q(a,f,m){if(a&&f!==void 0&&!("isFrozen"in Object&&Object.isFrozen(a)))if(typeof f!="string"&&"length"in f){R(typeof m!="string"&&"length"in m);for(var v=0,_=f.length;v<_;++v)Q(a,f[v],m[v])}else{var N,M,O=f.indexOf(".");O!==-1?(N=f.substr(0,O),(O=f.substr(O+1))===""?m===void 0?h(a)&&!isNaN(parseInt(N))?a.splice(N,1):delete a[N]:a[N]=m:Q(M=(M=a[N])&&w(a,N)?M:a[N]={},O,m)):m===void 0?h(a)&&!isNaN(parseInt(f))?a.splice(f,1):delete a[f]:a[f]=m}}function ce(a){var f,m={};for(f in a)w(a,f)&&(m[f]=a[f]);return m}var de=[].concat;function we(a){return de.apply([],a)}var K="BigUint64Array,BigInt64Array,Array,Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,FileSystemDirectoryHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(we([8,16,32,64].map(function(a){return["Int","Uint","Float"].map(function(f){return f+a+"Array"})}))).filter(function(a){return c[a]}),q=new Set(K.map(function(a){return c[a]})),fe=null;function xe(a){return fe=new WeakMap,a=(function f(m){if(!m||typeof m!="object")return m;var v=fe.get(m);if(v)return v;if(h(m)){v=[],fe.set(m,v);for(var _=0,N=m.length;_<N;++_)v.push(f(m[_]))}else if(q.has(m.constructor))v=m;else{var M,O=b(m);for(M in v=O===Object.prototype?{}:Object.create(O),fe.set(m,v),m)w(m,M)&&(v[M]=f(m[M]))}return v})(a),fe=null,a}var L={}.toString;function le(a){return L.call(a).slice(8,-1)}var G=typeof Symbol<"u"?Symbol.iterator:"@@iterator",ie=typeof G=="symbol"?function(a){var f;return a!=null&&(f=a[G])&&f.apply(a)}:function(){return null};function F(a,f){f=a.indexOf(f),0<=f&&a.splice(f,1)}var W={};function B(a){var f,m,v,_;if(arguments.length===1){if(h(a))return a.slice();if(this===W&&typeof a=="string")return[a];if(_=ie(a))for(m=[];!(v=_.next()).done;)m.push(v.value);else{if(a==null)return[a];if(typeof(f=a.length)!="number")return[a];for(m=new Array(f);f--;)m[f]=a[f]}}else for(f=arguments.length,m=new Array(f);f--;)m[f]=arguments[f];return m}var A=typeof Symbol<"u"?function(a){return a[Symbol.toStringTag]==="AsyncFunction"}:function(){return!1},K=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],pt=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(K),be={VersionChanged:"Database version changed by other database connection",DatabaseClosed:"Database has been closed",Abort:"Transaction aborted",TransactionInactive:"Transaction has already completed or failed",MissingAPI:"IndexedDB API missing. Please visit https://tinyurl.com/y2uuvskb"};function Se(a,f){this.name=a,this.message=f}function Me(a,f){return a+". Errors: "+Object.keys(f).map(function(m){return f[m].toString()}).filter(function(m,v,_){return _.indexOf(m)===v}).join(`
|
|
179
|
+
`)}function Ie(a,f,m,v){this.failures=f,this.failedKeys=v,this.successCount=m,this.message=Me(a,f)}function Ae(a,f){this.name="BulkError",this.failures=Object.keys(f).map(function(m){return f[m]}),this.failuresByPos=f,this.message=Me(a,this.failures)}$(Se).from(Error).extend({toString:function(){return this.name+": "+this.message}}),$(Ie).from(Se),$(Ae).from(Se);var _e=pt.reduce(function(a,f){return a[f]=f+"Error",a},{}),ze=Se,ke=pt.reduce(function(a,f){var m=f+"Error";function v(_,N){this.name=m,_?typeof _=="string"?(this.message="".concat(_).concat(N?`
|
|
180
|
+
`+N:""),this.inner=N||null):typeof _=="object"&&(this.message="".concat(_.name," ").concat(_.message),this.inner=_):(this.message=be[f]||m,this.inner=null)}return $(v).from(ze),a[f]=v,a},{}),Be=(ke.Syntax=SyntaxError,ke.Type=TypeError,ke.Range=RangeError,K.reduce(function(a,f){return a[f+"Error"]=ke[f],a},{}));K=pt.reduce(function(a,f){return["Syntax","Type","Range"].indexOf(f)===-1&&(a[f+"Error"]=ke[f]),a},{});function Re(){}function Ue(a){return a}function lt(a,f){return a==null||a===Ue?f:function(m){return f(a(m))}}function ut(a,f){return function(){a.apply(this,arguments),f.apply(this,arguments)}}function it(a,f){return a===Re?f:function(){var m=a.apply(this,arguments),v=(m!==void 0&&(arguments[0]=m),this.onsuccess),_=this.onerror,N=(this.onsuccess=null,this.onerror=null,f.apply(this,arguments));return v&&(this.onsuccess=this.onsuccess?ut(v,this.onsuccess):v),_&&(this.onerror=this.onerror?ut(_,this.onerror):_),N!==void 0?N:m}}function Ct(a,f){return a===Re?f:function(){a.apply(this,arguments);var m=this.onsuccess,v=this.onerror;this.onsuccess=this.onerror=null,f.apply(this,arguments),m&&(this.onsuccess=this.onsuccess?ut(m,this.onsuccess):m),v&&(this.onerror=this.onerror?ut(v,this.onerror):v)}}function qt(a,f){return a===Re?f:function(_){var v=a.apply(this,arguments),_=(y(_,v),this.onsuccess),N=this.onerror,M=(this.onsuccess=null,this.onerror=null,f.apply(this,arguments));return _&&(this.onsuccess=this.onsuccess?ut(_,this.onsuccess):_),N&&(this.onerror=this.onerror?ut(N,this.onerror):N),v===void 0?M===void 0?void 0:M:y(v,M)}}function Gt(a,f){return a===Re?f:function(){return f.apply(this,arguments)!==!1&&a.apply(this,arguments)}}function Rt(a,f){return a===Re?f:function(){var m=a.apply(this,arguments);if(m&&typeof m.then=="function"){for(var v=this,_=arguments.length,N=new Array(_);_--;)N[_]=arguments[_];return m.then(function(){return f.apply(v,N)})}return f.apply(this,arguments)}}K.ModifyError=Ie,K.DexieError=Se,K.BulkError=Ae;var Nt=typeof location<"u"&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function pn(a){Nt=a}var on={},Wt=100,Nn=typeof Promise>"u"?[]:(pt=Promise.resolve(),typeof crypto<"u"&&crypto.subtle?[Nn=crypto.subtle.digest("SHA-512",new Uint8Array([0])),b(Nn),pt]:[pt,b(pt),pt]),pt=Nn[0],yo=Nn[1],yo=yo&&yo.then,Yt=pt&&pt.constructor,hn=!!Nn[2],mn=function(a,f){qn.push([a,f]),En&&(queueMicrotask(Ro),En=!1)},sn=!0,En=!0,Kn=[],_r=[],Br=Ue,Cn={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:Re,pgp:!1,env:{},finalize:Re},qe=Cn,qn=[],jn=0,ar=[];function He(a){if(typeof this!="object")throw new TypeError("Promises must be constructed via new");this._listeners=[],this._lib=!1;var f=this._PSD=qe;if(typeof a!="function"){if(a!==on)throw new TypeError("Not a function");this._state=arguments[1],this._value=arguments[2],this._state===!1&&lr(this,this._value)}else this._state=null,this._value=null,++f.ref,(function m(v,_){try{_(function(N){if(v._state===null){if(N===v)throw new TypeError("A promise cannot be resolved with itself.");var M=v._lib&&On();N&&typeof N.then=="function"?m(v,function(O,Z){N instanceof He?N._then(O,Z):N.then(O,Z)}):(v._state=!0,v._value=N,ro(v)),M&&Wn()}},lr.bind(null,v))}catch(N){lr(v,N)}})(this,a)}var An={get:function(){var a=qe,f=fr;function m(v,_){var N=this,M=!a.global&&(a!==qe||f!==fr),O=M&&!z(),Z=new He(function(ue,te){Hr(N,new Jt(yn(v,a,M,O),yn(_,a,M,O),ue,te,a))});return this._consoleTask&&(Z._consoleTask=this._consoleTask),Z}return m.prototype=on,m},set:function(a){j(this,"then",a&&a.prototype===on?An:{get:function(){return a},set:An.set})}};function Jt(a,f,m,v,_){this.onFulfilled=typeof a=="function"?a:null,this.onRejected=typeof f=="function"?f:null,this.resolve=m,this.reject=v,this.psd=_}function lr(a,f){var m,v;_r.push(f),a._state===null&&(m=a._lib&&On(),f=Br(f),a._state=!1,a._value=f,v=a,Kn.some(function(_){return _._value===v._value})||Kn.push(v),ro(a),m)&&Wn()}function ro(a){var f=a._listeners;a._listeners=[];for(var m=0,v=f.length;m<v;++m)Hr(a,f[m]);var _=a._PSD;--_.ref||_.finalize(),jn===0&&(++jn,mn(function(){--jn==0&&Yn()},[]))}function Hr(a,f){if(a._state===null)a._listeners.push(f);else{var m=a._state?f.onFulfilled:f.onRejected;if(m===null)return(a._state?f.resolve:f.reject)(a._value);++f.psd.ref,++jn,mn(Oo,[m,a,f])}}function Oo(a,f,m){try{var v,_=f._value;!f._state&&_r.length&&(_r=[]),v=Nt&&f._consoleTask?f._consoleTask.run(function(){return a(_)}):a(_),f._state||_r.indexOf(_)!==-1||(N=>{for(var M=Kn.length;M;)if(Kn[--M]._value===N._value)return Kn.splice(M,1)})(f),m.resolve(v)}catch(N){m.reject(N)}finally{--jn==0&&Yn(),--m.psd.ref||m.psd.finalize()}}function Ro(){Ht(Cn,function(){On()&&Wn()})}function On(){var a=sn;return En=sn=!1,a}function Wn(){var a,f,m;do for(;0<qn.length;)for(a=qn,qn=[],m=a.length,f=0;f<m;++f){var v=a[f];v[0].apply(null,v[1])}while(0<qn.length);En=sn=!0}function Yn(){for(var a=Kn,f=(Kn=[],a.forEach(function(v){v._PSD.onunhandled.call(null,v._value,v)}),ar.slice(0)),m=f.length;m;)f[--m]()}function ur(a){return new He(on,!1,a)}function gt(a,f){var m=qe;return function(){var v=On(),_=qe;try{return ct(m,!0),a.apply(this,arguments)}catch(N){f&&f(N)}finally{ct(_,!1),v&&Wn()}}}S(He.prototype,{then:An,_then:function(a,f){Hr(this,new Jt(null,null,a,f,qe))},catch:function(a){var f,m;return arguments.length===1?this.then(null,a):(f=a,m=arguments[1],typeof f=="function"?this.then(null,function(v){return(v instanceof f?m:ur)(v)}):this.then(null,function(v){return(v&&v.name===f?m:ur)(v)}))},finally:function(a){return this.then(function(f){return He.resolve(a()).then(function(){return f})},function(f){return He.resolve(a()).then(function(){return ur(f)})})},timeout:function(a,f){var m=this;return a<1/0?new He(function(v,_){var N=setTimeout(function(){return _(new ke.Timeout(f))},a);m.then(v,_).finally(clearTimeout.bind(null,N))}):this}}),typeof Symbol<"u"&&Symbol.toStringTag&&j(He.prototype,Symbol.toStringTag,"Dexie.Promise"),Cn.env=Pn(),S(He,{all:function(){var a=B.apply(null,arguments).map(Oe);return new He(function(f,m){a.length===0&&f([]);var v=a.length;a.forEach(function(_,N){return He.resolve(_).then(function(M){a[N]=M,--v||f(a)},m)})})},resolve:function(a){return a instanceof He?a:a&&typeof a.then=="function"?new He(function(f,m){a.then(f,m)}):new He(on,!0,a)},reject:ur,race:function(){var a=B.apply(null,arguments).map(Oe);return new He(function(f,m){a.map(function(v){return He.resolve(v).then(f,m)})})},PSD:{get:function(){return qe},set:function(a){return qe=a}},totalEchoes:{get:function(){return fr}},newPSD:gn,usePSD:Ht,scheduler:{get:function(){return mn},set:function(a){mn=a}},rejectionMapper:{get:function(){return Br},set:function(a){Br=a}},follow:function(a,f){return new He(function(m,v){return gn(function(_,N){var M=qe;M.unhandleds=[],M.onunhandled=N,M.finalize=ut(function(){var O,Z=this;O=function(){Z.unhandleds.length===0?_():N(Z.unhandleds[0])},ar.push(function ue(){O(),ar.splice(ar.indexOf(ue),1)}),++jn,mn(function(){--jn==0&&Yn()},[])},M.finalize),a()},f,m,v)})}}),Yt&&(Yt.allSettled&&j(He,"allSettled",function(){var a=B.apply(null,arguments).map(Oe);return new He(function(f){a.length===0&&f([]);var m=a.length,v=new Array(m);a.forEach(function(_,N){return He.resolve(_).then(function(M){return v[N]={status:"fulfilled",value:M}},function(M){return v[N]={status:"rejected",reason:M}}).then(function(){return--m||f(v)})})})}),Yt.any&&typeof AggregateError<"u"&&j(He,"any",function(){var a=B.apply(null,arguments).map(Oe);return new He(function(f,m){a.length===0&&m(new AggregateError([]));var v=a.length,_=new Array(v);a.forEach(function(N,M){return He.resolve(N).then(function(O){return f(O)},function(O){_[M]=O,--v||m(new AggregateError(_))})})})}),Yt.withResolvers)&&(He.withResolvers=Yt.withResolvers);var Tt={awaits:0,echoes:0,id:0},cr=0,Xn=[],Qn=0,fr=0,Lo=0;function gn(a,M,m,v){var _=qe,N=Object.create(_),M=(N.parent=_,N.ref=0,N.global=!1,N.id=++Lo,Cn.env,N.env=hn?{Promise:He,PromiseProp:{value:He,configurable:!0,writable:!0},all:He.all,race:He.race,allSettled:He.allSettled,any:He.any,resolve:He.resolve,reject:He.reject}:{},M&&y(N,M),++_.ref,N.finalize=function(){--this.parent.ref||this.parent.finalize()},Ht(N,a,m,v));return N.ref===0&&N.finalize(),M}function Gn(){return Tt.id||(Tt.id=++cr),++Tt.awaits,Tt.echoes+=Wt,Tt.id}function z(){return!!Tt.awaits&&(--Tt.awaits==0&&(Tt.id=0),Tt.echoes=Tt.awaits*Wt,!0)}function Oe(a){return Tt.echoes&&a&&a.constructor===Yt?(Gn(),a.then(function(f){return z(),f},function(f){return z(),kt(f)})):a}function We(){var a=Xn[Xn.length-1];Xn.pop(),ct(a,!1)}function ct(a,f){var m,v,_=qe;(f?!Tt.echoes||Qn++&&a===qe:!Qn||--Qn&&a===qe)||queueMicrotask(f?(function(N){++fr,Tt.echoes&&--Tt.echoes!=0||(Tt.echoes=Tt.awaits=Tt.id=0),Xn.push(qe),ct(N,!0)}).bind(null,a):We),a!==qe&&(qe=a,_===Cn&&(Cn.env=Pn()),hn)&&(m=Cn.env.Promise,v=a.env,_.global||a.global)&&(Object.defineProperty(c,"Promise",v.PromiseProp),m.all=v.all,m.race=v.race,m.resolve=v.resolve,m.reject=v.reject,v.allSettled&&(m.allSettled=v.allSettled),v.any)&&(m.any=v.any)}function Pn(){var a=c.Promise;return hn?{Promise:a,PromiseProp:Object.getOwnPropertyDescriptor(c,"Promise"),all:a.all,race:a.race,allSettled:a.allSettled,any:a.any,resolve:a.resolve,reject:a.reject}:{}}function Ht(a,f,m,v,_){var N=qe;try{return ct(a,!0),f(m,v,_)}finally{ct(N,!1)}}function yn(a,f,m,v){return typeof a!="function"?a:function(){var _=qe;m&&Gn(),ct(f,!0);try{return a.apply(this,arguments)}finally{ct(_,!1),v&&queueMicrotask(z)}}}function Mn(a){Promise===Yt&&Tt.echoes===0?Qn===0?a():enqueueNativeMicroTask(a):setTimeout(a,0)}(""+yo).indexOf("[native code]")===-1&&(Gn=z=Re);var kt=He.reject,an="",mt="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",oo="String expected.",Jn="__dbnames",Zn="readonly",dr="readwrite";function Sr(a,f){return a?f?function(){return a.apply(this,arguments)&&f.apply(this,arguments)}:a:f}var di={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function pr(a){return typeof a!="string"||/\./.test(a)?function(f){return f}:function(f){return f[a]===void 0&&a in f&&delete(f=xe(f))[a],f}}function $n(){throw ke.Type("Entity instances must never be new:ed. Instances are generated by the framework bypassing the constructor.")}function ft(a,f){try{var m=vn(a),v=vn(f);if(m!==v)return m==="Array"?1:v==="Array"?-1:m==="binary"?1:v==="binary"?-1:m==="string"?1:v==="string"?-1:m==="Date"?1:v!=="Date"?NaN:-1;switch(m){case"number":case"Date":case"string":return f<a?1:a<f?-1:0;case"binary":for(var _=Hi(a),N=Hi(f),M=_.length,O=N.length,Z=M<O?M:O,ue=0;ue<Z;++ue)if(_[ue]!==N[ue])return _[ue]<N[ue]?-1:1;return M===O?0:M<O?-1:1;case"Array":for(var te=a,J=f,ee=te.length,ae=J.length,oe=ee<ae?ee:ae,re=0;re<oe;++re){var se=ft(te[re],J[re]);if(se!==0)return se}return ee===ae?0:ee<ae?-1:1}}catch{}return NaN}function vn(a){var f=typeof a;return f=="object"&&(ArrayBuffer.isView(a)||(f=le(a))==="ArrayBuffer")?"binary":f}function Hi(a){return a instanceof Uint8Array?a:ArrayBuffer.isView(a)?new Uint8Array(a.buffer,a.byteOffset,a.byteLength):new Uint8Array(a)}function Do(a,f,m){var v=a.schema.yProps;return v?(f&&0<m.numFailures&&(f=f.filter(function(_,N){return!m.failures[N]})),Promise.all(v.map(function(_){return _=_.updatesTable,f?a.db.table(_).where("k").anyOf(f).delete():a.db.table(_).clear()})).then(function(){return m})):m}so.prototype.execute=function(a){var f=this["@@propmod"];if(f.add!==void 0){var m=f.add;if(h(m))return l(l([],h(a)?a:[],!0),m).sort();if(typeof m=="number")return(Number(a)||0)+m;if(typeof m=="bigint")try{return BigInt(a)+m}catch{return BigInt(0)+m}throw new TypeError("Invalid term ".concat(m))}if(f.remove!==void 0){var v=f.remove;if(h(v))return h(a)?a.filter(function(_){return!v.includes(_)}).sort():[];if(typeof v=="number")return Number(a)-v;if(typeof v=="bigint")try{return BigInt(a)-v}catch{return BigInt(0)-v}throw new TypeError("Invalid subtrahend ".concat(v))}return m=(m=f.replacePrefix)==null?void 0:m[0],m&&typeof a=="string"&&a.startsWith(m)?f.replacePrefix[1]+a.substring(m.length):a};var io=so;function so(a){this["@@propmod"]=a}function ao(a,f){for(var m=d(f),v=m.length,_=!1,N=0;N<v;++N){var M=m[N],O=f[M],Z=V(a,M);O instanceof io?(Q(a,M,O.execute(Z)),_=!0):Z!==O&&(Q(a,M,O),_=!0)}return _}xt.prototype._trans=function(a,f,m){var v=this._tx||qe.trans,_=this.name,N=Nt&&typeof console<"u"&&console.createTask&&console.createTask("Dexie: ".concat(a==="readonly"?"read":"write"," ").concat(this.name));function M(ue,te,J){if(J.schema[_])return f(J.idbtrans,J);throw new ke.NotFound("Table "+_+" not part of transaction")}var O=On();try{var Z=v&&v.db._novip===this.db._novip?v===qe.trans?v._promise(a,M,m):gn(function(){return v._promise(a,M,m)},{trans:v,transless:qe.transless||qe}):(function ue(te,J,ee,ae){if(te.idbdb&&(te._state.openComplete||qe.letThrough||te._vip)){var oe=te._createTransaction(J,ee,te._dbSchema);try{oe.create(),te._state.PR1398_maxLoop=3}catch(re){return re.name===_e.InvalidState&&te.isOpen()&&0<--te._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),te.close({disableAutoOpen:!1}),te.open().then(function(){return ue(te,J,ee,ae)})):kt(re)}return oe._promise(J,function(re,se){return gn(function(){return qe.trans=oe,ae(re,se,oe)})}).then(function(re){if(J==="readwrite")try{oe.idbtrans.commit()}catch{}return J==="readonly"?re:oe._completion.then(function(){return re})})}if(te._state.openComplete)return kt(new ke.DatabaseClosed(te._state.dbOpenError));if(!te._state.isBeingOpened){if(!te._state.autoOpen)return kt(new ke.DatabaseClosed);te.open().catch(Re)}return te._state.dbReadyPromise.then(function(){return ue(te,J,ee,ae)})})(this.db,a,[this.name],M);return N&&(Z._consoleTask=N,Z=Z.catch(function(ue){return console.trace(ue),kt(ue)})),Z}finally{O&&Wn()}},xt.prototype.get=function(a,f){var m=this;return a&&a.constructor===Object?this.where(a).first(f):a==null?kt(new ke.Type("Invalid argument to Table.get()")):this._trans("readonly",function(v){return m.core.get({trans:v,key:a}).then(function(_){return m.hook.reading.fire(_)})}).then(f)},xt.prototype.where=function(a){if(typeof a=="string")return new this.db.WhereClause(this,a);if(h(a))return new this.db.WhereClause(this,"[".concat(a.join("+"),"]"));var f=d(a);if(f.length===1)return this.where(f[0]).equals(a[f[0]]);var m=this.schema.indexes.concat(this.schema.primKey).filter(function(O){if(O.compound&&f.every(function(ue){return 0<=O.keyPath.indexOf(ue)})){for(var Z=0;Z<f.length;++Z)if(f.indexOf(O.keyPath[Z])===-1)return!1;return!0}return!1}).sort(function(O,Z){return O.keyPath.length-Z.keyPath.length})[0];if(m&&this.db._maxKey!==an)return M=m.keyPath.slice(0,f.length),this.where(M).equals(M.map(function(O){return a[O]}));!m&&Nt&&console.warn("The query ".concat(JSON.stringify(a)," on ").concat(this.name," would benefit from a ")+"compound index [".concat(f.join("+"),"]"));var v=this.schema.idxByName;function _(O,Z){return ft(O,Z)===0}var M=f.reduce(function(te,Z){var ue=te[0],te=te[1],J=v[Z],ee=a[Z];return[ue||J,ue||!J?Sr(te,J&&J.multi?function(ae){return ae=V(ae,Z),h(ae)&&ae.some(function(oe){return _(ee,oe)})}:function(ae){return _(ee,V(ae,Z))}):te]},[null,null]),N=M[0],M=M[1];return N?this.where(N.name).equals(a[N.keyPath]).filter(M):m?this.filter(M):this.where(f).equals("")},xt.prototype.filter=function(a){return this.toCollection().and(a)},xt.prototype.count=function(a){return this.toCollection().count(a)},xt.prototype.offset=function(a){return this.toCollection().offset(a)},xt.prototype.limit=function(a){return this.toCollection().limit(a)},xt.prototype.each=function(a){return this.toCollection().each(a)},xt.prototype.toArray=function(a){return this.toCollection().toArray(a)},xt.prototype.toCollection=function(){return new this.db.Collection(new this.db.WhereClause(this))},xt.prototype.orderBy=function(a){return new this.db.Collection(new this.db.WhereClause(this,h(a)?"[".concat(a.join("+"),"]"):a))},xt.prototype.reverse=function(){return this.toCollection().reverse()},xt.prototype.mapToClass=function(a){for(var f=this.db,m=this.name,v=((this.schema.mappedClass=a).prototype instanceof $n&&(a=(M=>{var O=te,Z=M;if(typeof Z!="function"&&Z!==null)throw new TypeError("Class extends value "+String(Z)+" is not a constructor or null");function ue(){this.constructor=O}function te(){return M!==null&&M.apply(this,arguments)||this}return i(O,Z),O.prototype=Z===null?Object.create(Z):(ue.prototype=Z.prototype,new ue),Object.defineProperty(te.prototype,"db",{get:function(){return f},enumerable:!1,configurable:!0}),te.prototype.table=function(){return m},te})(a)),new Set),_=a.prototype;_;_=b(_))Object.getOwnPropertyNames(_).forEach(function(M){return v.add(M)});function N(M){if(!M)return M;var O,Z=Object.create(a.prototype);for(O in M)if(!v.has(O))try{Z[O]=M[O]}catch{}return Z}return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=N,this.hook("reading",N),a},xt.prototype.defineClass=function(){return this.mapToClass(function(a){y(this,a)})},xt.prototype.add=function(a,f){var m=this,v=this.schema.primKey,_=v.auto,N=v.keyPath,M=a;return N&&_&&(M=pr(N)(a)),this._trans("readwrite",function(O){return m.core.mutate({trans:O,type:"add",keys:f!=null?[f]:null,values:[M]})}).then(function(O){return O.numFailures?He.reject(O.failures[0]):O.lastResult}).then(function(O){if(N)try{Q(a,N,O)}catch{}return O})},xt.prototype.upsert=function(a,f){var m=this,v=this.schema.primKey.keyPath;return this._trans("readwrite",function(_){return m.core.get({trans:_,key:a}).then(function(N){var M=N??{};return ao(M,f),v&&Q(M,v,a),m.core.mutate({trans:_,type:"put",values:[M],keys:[a],upsert:!0,updates:{keys:[a],changeSpecs:[f]}}).then(function(O){return O.numFailures?He.reject(O.failures[0]):!!N})})})},xt.prototype.update=function(a,f){return typeof a!="object"||h(a)?this.where(":id").equals(a).modify(f):(a=V(a,this.schema.primKey.keyPath))===void 0?kt(new ke.InvalidArgument("Given object does not contain its primary key")):this.where(":id").equals(a).modify(f)},xt.prototype.put=function(a,f){var m=this,v=this.schema.primKey,_=v.auto,N=v.keyPath,M=a;return N&&_&&(M=pr(N)(a)),this._trans("readwrite",function(O){return m.core.mutate({trans:O,type:"put",values:[M],keys:f!=null?[f]:null})}).then(function(O){return O.numFailures?He.reject(O.failures[0]):O.lastResult}).then(function(O){if(N)try{Q(a,N,O)}catch{}return O})},xt.prototype.delete=function(a){var f=this;return this._trans("readwrite",function(m){return f.core.mutate({trans:m,type:"delete",keys:[a]}).then(function(v){return Do(f,[a],v)}).then(function(v){return v.numFailures?He.reject(v.failures[0]):void 0})})},xt.prototype.clear=function(){var a=this;return this._trans("readwrite",function(f){return a.core.mutate({trans:f,type:"deleteRange",range:di}).then(function(m){return Do(a,null,m)})}).then(function(f){return f.numFailures?He.reject(f.failures[0]):void 0})},xt.prototype.bulkGet=function(a){var f=this;return this._trans("readonly",function(m){return f.core.getMany({keys:a,trans:m}).then(function(v){return v.map(function(_){return f.hook.reading.fire(_)})})})},xt.prototype.bulkAdd=function(a,f,m){var v=this,_=Array.isArray(f)?f:void 0,N=(m=m||(_?void 0:f))?m.allKeys:void 0;return this._trans("readwrite",function(M){var O=v.schema.primKey,ue=O.auto,O=O.keyPath;if(O&&_)throw new ke.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(_&&_.length!==a.length)throw new ke.InvalidArgument("Arguments objects and keys must have the same length");var Z=a.length,ue=O&&ue?a.map(pr(O)):a;return v.core.mutate({trans:M,type:"add",keys:_,values:ue,wantResults:N}).then(function(te){var J=te.numFailures,ee=te.failures;if(J===0)return N?te.results:te.lastResult;throw new Ae("".concat(v.name,".bulkAdd(): ").concat(J," of ").concat(Z," operations failed"),ee)})})},xt.prototype.bulkPut=function(a,f,m){var v=this,_=Array.isArray(f)?f:void 0,N=(m=m||(_?void 0:f))?m.allKeys:void 0;return this._trans("readwrite",function(M){var O=v.schema.primKey,ue=O.auto,O=O.keyPath;if(O&&_)throw new ke.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(_&&_.length!==a.length)throw new ke.InvalidArgument("Arguments objects and keys must have the same length");var Z=a.length,ue=O&&ue?a.map(pr(O)):a;return v.core.mutate({trans:M,type:"put",keys:_,values:ue,wantResults:N}).then(function(te){var J=te.numFailures,ee=te.failures;if(J===0)return N?te.results:te.lastResult;throw new Ae("".concat(v.name,".bulkPut(): ").concat(J," of ").concat(Z," operations failed"),ee)})})},xt.prototype.bulkUpdate=function(a){var f=this,m=this.core,v=a.map(function(M){return M.key}),_=a.map(function(M){return M.changes}),N=[];return this._trans("readwrite",function(M){return m.getMany({trans:M,keys:v,cache:"clone"}).then(function(O){var Z=[],ue=[],te=(a.forEach(function(J,ee){var ae=J.key,oe=J.changes,re=O[ee];if(re){for(var se=0,ge=Object.keys(oe);se<ge.length;se++){var pe=ge[se],ve=oe[pe];if(pe===f.schema.primKey.keyPath){if(ft(ve,ae)!==0)throw new ke.Constraint("Cannot update primary key in bulkUpdate()")}else Q(re,pe,ve)}N.push(ee),Z.push(ae),ue.push(re)}}),Z.length);return m.mutate({trans:M,type:"put",keys:Z,values:ue,updates:{keys:v,changeSpecs:_}}).then(function(J){var ee=J.numFailures,ae=J.failures;if(ee===0)return te;for(var oe=0,re=Object.keys(ae);oe<re.length;oe++){var se,ge=re[oe],pe=N[Number(ge)];pe!=null&&(se=ae[ge],delete ae[ge],ae[pe]=se)}throw new Ae("".concat(f.name,".bulkUpdate(): ").concat(ee," of ").concat(te," operations failed"),ae)})})})},xt.prototype.bulkDelete=function(a){var f=this,m=a.length;return this._trans("readwrite",function(v){return f.core.mutate({trans:v,type:"delete",keys:a}).then(function(_){return Do(f,a,_)})}).then(function(v){var _=v.numFailures,N=v.failures;if(_===0)return v.lastResult;throw new Ae("".concat(f.name,".bulkDelete(): ").concat(_," of ").concat(m," operations failed"),N)})};var er=xt;function xt(){}function Vr(a){function f(M,O){if(O){for(var Z=arguments.length,ue=new Array(Z-1);--Z;)ue[Z-1]=arguments[Z];return m[M].subscribe.apply(null,ue),a}if(typeof M=="string")return m[M]}var m={};f.addEventType=N;for(var v=1,_=arguments.length;v<_;++v)N(arguments[v]);return f;function N(M,O,Z){var ue,te;if(typeof M!="object")return O=O||Gt,te={subscribers:[],fire:Z=Z||Re,subscribe:function(J){te.subscribers.indexOf(J)===-1&&(te.subscribers.push(J),te.fire=O(te.fire,J))},unsubscribe:function(J){te.subscribers=te.subscribers.filter(function(ee){return ee!==J}),te.fire=te.subscribers.reduce(O,Z)}},m[M]=f[M]=te;d(ue=M).forEach(function(J){var ee=ue[J];if(h(ee))N(J,ue[J][0],ue[J][1]);else{if(ee!=="asap")throw new ke.InvalidArgument("Invalid event config");var ae=N(J,Ue,function(){for(var oe=arguments.length,re=new Array(oe);oe--;)re[oe]=arguments[oe];ae.subscribers.forEach(function(se){H(function(){se.apply(null,re)})})})}})}}function lo(a,f){return $(f).from({prototype:a}),f}function hr(a,f){return!(a.filter||a.algorithm||a.or)&&(f?a.justLimit:!a.replayFilter)}function Ur(a,f){a.filter=Sr(a.filter,f)}function uo(a,f,m){var v=a.replayFilter;a.replayFilter=v?function(){return Sr(v(),f())}:f,a.justLimit=m&&!v}function mr(a,f){if(a.isPrimKey)return f.primaryKey;var m=f.getIndexByKeyPath(a.index);if(m)return m;throw new ke.Schema("KeyPath "+a.index+" on object store "+f.name+" is not indexed")}function pi(a,f,m){var v=mr(a,f.schema);return f.openCursor({trans:m,values:!a.keysOnly,reverse:a.dir==="prev",unique:!!a.unique,query:{index:v,range:a.range}})}function zo(a,f,m,v){var _,N,M=a.replayFilter?Sr(a.filter,a.replayFilter()):a.filter;return a.or?(_={},N=function(O,Z,ue){var te,J;M&&!M(Z,ue,function(ee){return Z.stop(ee)},function(ee){return Z.fail(ee)})||((J=""+(te=Z.primaryKey))=="[object ArrayBuffer]"&&(J=""+new Uint8Array(te)),w(_,J))||(_[J]=!0,f(O,Z,ue))},Promise.all([a.or._iterate(N,m),bt(pi(a,v,m),a.algorithm,N,!a.keysOnly&&a.valueMapper)])):bt(pi(a,v,m),Sr(a.algorithm,M),f,!a.keysOnly&&a.valueMapper)}function bt(a,f,m,v){var _=gt(v?function(N,M,O){return m(v(N),M,O)}:m);return a.then(function(N){if(N)return N.start(function(){var M=function(){return N.continue()};f&&!f(N,function(O){return M=O},function(O){N.stop(O),M=Re},function(O){N.fail(O),M=Re})||_(N.value,N,function(O){return M=O}),M()})})}yt.prototype._read=function(a,f){var m=this._ctx;return m.error?m.table._trans(null,kt.bind(null,m.error)):m.table._trans("readonly",a).then(f)},yt.prototype._write=function(a){var f=this._ctx;return f.error?f.table._trans(null,kt.bind(null,f.error)):f.table._trans("readwrite",a,"locked")},yt.prototype._addAlgorithm=function(a){var f=this._ctx;f.algorithm=Sr(f.algorithm,a)},yt.prototype._iterate=function(a,f){return zo(this._ctx,a,f,this._ctx.table.core)},yt.prototype.clone=function(a){var f=Object.create(this.constructor.prototype),m=Object.create(this._ctx);return a&&y(m,a),f._ctx=m,f},yt.prototype.raw=function(){return this._ctx.valueMapper=null,this},yt.prototype.each=function(a){var f=this._ctx;return this._read(function(m){return zo(f,a,m,f.table.core)})},yt.prototype.count=function(a){var f=this;return this._read(function(m){var v,_=f._ctx,N=_.table.core;return hr(_,!0)?N.count({trans:m,query:{index:mr(_,N.schema),range:_.range}}).then(function(M){return Math.min(M,_.limit)}):(v=0,zo(_,function(){return++v,!1},m,N).then(function(){return v}))}).then(a)},yt.prototype.sortBy=function(a,f){var m=a.split(".").reverse(),v=m[0],_=m.length-1;function N(Z,ue){return ue?N(Z[m[ue]],ue-1):Z[v]}var M=this._ctx.dir==="next"?1:-1;function O(Z,ue){return ft(N(Z,_),N(ue,_))*M}return this.toArray(function(Z){return Z.sort(O)}).then(f)},yt.prototype.toArray=function(a){var f=this;return this._read(function(m){var v,_,N,M=f._ctx;return hr(M,!0)&&0<M.limit?(v=M.valueMapper,_=mr(M,M.table.core.schema),M.table.core.query({trans:m,limit:M.limit,values:!0,direction:M.dir==="prev"?"prev":void 0,query:{index:_,range:M.range}}).then(function(O){return O=O.result,v?O.map(v):O})):(N=[],zo(M,function(O){return N.push(O)},m,M.table.core).then(function(){return N}))},a)},yt.prototype.offset=function(a){var f=this._ctx;return a<=0||(f.offset+=a,hr(f)?uo(f,function(){var m=a;return function(v,_){return m===0||(m===1?--m:_(function(){v.advance(m),m=0}),!1)}}):uo(f,function(){var m=a;return function(){return--m<0}})),this},yt.prototype.limit=function(a){return this._ctx.limit=Math.min(this._ctx.limit,a),uo(this._ctx,function(){var f=a;return function(m,v,_){return--f<=0&&v(_),0<=f}},!0),this},yt.prototype.until=function(a,f){return Ur(this._ctx,function(m,v,_){return!a(m.value)||(v(_),f)}),this},yt.prototype.first=function(a){return this.limit(1).toArray(function(f){return f[0]}).then(a)},yt.prototype.last=function(a){return this.reverse().first(a)},yt.prototype.filter=function(a){var f;return Ur(this._ctx,function(m){return a(m.value)}),(f=this._ctx).isMatch=Sr(f.isMatch,a),this},yt.prototype.and=function(a){return this.filter(a)},yt.prototype.or=function(a){return new this.db.WhereClause(this._ctx.table,a,this)},yt.prototype.reverse=function(){return this._ctx.dir=this._ctx.dir==="prev"?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this},yt.prototype.desc=function(){return this.reverse()},yt.prototype.eachKey=function(a){var f=this._ctx;return f.keysOnly=!f.isMatch,this.each(function(m,v){a(v.key,v)})},yt.prototype.eachUniqueKey=function(a){return this._ctx.unique="unique",this.eachKey(a)},yt.prototype.eachPrimaryKey=function(a){var f=this._ctx;return f.keysOnly=!f.isMatch,this.each(function(m,v){a(v.primaryKey,v)})},yt.prototype.keys=function(a){var f=this._ctx,m=(f.keysOnly=!f.isMatch,[]);return this.each(function(v,_){m.push(_.key)}).then(function(){return m}).then(a)},yt.prototype.primaryKeys=function(a){var f=this._ctx;if(hr(f,!0)&&0<f.limit)return this._read(function(v){var _=mr(f,f.table.core.schema);return f.table.core.query({trans:v,values:!1,limit:f.limit,direction:f.dir==="prev"?"prev":void 0,query:{index:_,range:f.range}})}).then(function(v){return v.result}).then(a);f.keysOnly=!f.isMatch;var m=[];return this.each(function(v,_){m.push(_.primaryKey)}).then(function(){return m}).then(a)},yt.prototype.uniqueKeys=function(a){return this._ctx.unique="unique",this.keys(a)},yt.prototype.firstKey=function(a){return this.limit(1).keys(function(f){return f[0]}).then(a)},yt.prototype.lastKey=function(a){return this.reverse().firstKey(a)},yt.prototype.distinct=function(){var a,f=this._ctx,f=f.index&&f.table.schema.idxByName[f.index];return f&&f.multi&&(a={},Ur(this._ctx,function(v){var v=v.primaryKey.toString(),_=w(a,v);return a[v]=!0,!_})),this},yt.prototype.modify=function(a){var f=this,m=this._ctx;return this._write(function(v){function _(re,se){var ge=se.failures;ee+=re-se.numFailures;for(var pe=0,ve=d(ge);pe<ve.length;pe++){var Ne=ve[pe];J.push(ge[Ne])}}var N=typeof a=="function"?a:function(re){return ao(re,a)},M=m.table.core,te=M.schema.primaryKey,O=te.outbound,Z=te.extractKey,ue=200,te=f.db._options.modifyChunkSize,J=(te&&(ue=typeof te=="object"?te[M.name]||te["*"]||200:te),[]),ee=0,ae=[],oe=a===Vi;return f.clone().primaryKeys().then(function(re){function se(pe){var ve=Math.min(ue,re.length-pe),Ne=re.slice(pe,pe+ve);return(oe?Promise.resolve([]):M.getMany({trans:v,keys:Ne,cache:"immutable"})).then(function(Ce){var De=[],$e=[],Ve=O?[]:null,Le=oe?Ne:[];if(!oe)for(var Ye=0;Ye<ve;++Ye){var Ee=Ce[Ye],nt={value:xe(Ee),primKey:re[pe+Ye]};N.call(nt,nt.value,nt)!==!1&&(nt.value==null?Le.push(re[pe+Ye]):O||ft(Z(Ee),Z(nt.value))===0?($e.push(nt.value),O&&Ve.push(re[pe+Ye])):(Le.push(re[pe+Ye]),De.push(nt.value)))}return Promise.resolve(0<De.length&&M.mutate({trans:v,type:"add",values:De}).then(function(rt){for(var at in rt.failures)Le.splice(parseInt(at),1);_(De.length,rt)})).then(function(){return(0<$e.length||ge&&typeof a=="object")&&M.mutate({trans:v,type:"put",keys:Ve,values:$e,criteria:ge,changeSpec:typeof a!="function"&&a,isAdditionalChunk:0<pe}).then(function(rt){return _($e.length,rt)})}).then(function(){return(0<Le.length||ge&&oe)&&M.mutate({trans:v,type:"delete",keys:Le,criteria:ge,isAdditionalChunk:0<pe}).then(function(rt){return Do(m.table,Le,rt)}).then(function(rt){return _(Le.length,rt)})}).then(function(){return re.length>pe+ve&&se(pe+ue)})})}var ge=hr(m)&&m.limit===1/0&&(typeof a!="function"||oe)&&{index:m.index,range:m.range};return se(0).then(function(){if(0<J.length)throw new Ie("Error modifying one or more objects",J,ee,ae);return re.length})})})},yt.prototype.delete=function(){var a=this._ctx,f=a.range;return!hr(a)||a.table.schema.yProps||!a.isPrimKey&&f.type!==3?this.modify(Vi):this._write(function(m){var v=a.table.core.schema.primaryKey,_=f;return a.table.core.count({trans:m,query:{index:v,range:_}}).then(function(N){return a.table.core.mutate({trans:m,type:"deleteRange",range:_}).then(function(Z){var O=Z.failures,Z=Z.numFailures;if(Z)throw new Ie("Could not delete some values",Object.keys(O).map(function(ue){return O[ue]}),N-Z);return N-Z})})})};var Ba=yt;function yt(){}var Vi=function(a,f){return f.value=null};function Ha(a,f){return a<f?-1:a===f?0:1}function Va(a,f){return f<a?-1:a===f?0:1}function xn(a,f,m){return a=a instanceof Nr?new a.Collection(a):a,a._ctx.error=new(m||TypeError)(f),a}function Kr(a){return new a.Collection(a,function(){return kr("")}).limit(0)}function co(ae,f,m,v){var _,N,M,O,Z,ue,te,J=m.length;if(!m.every(function(re){return typeof re=="string"}))return xn(ae,oo);function ee(re){_=re==="next"?function(ge){return ge.toUpperCase()}:function(ge){return ge.toLowerCase()},N=re==="next"?function(ge){return ge.toLowerCase()}:function(ge){return ge.toUpperCase()},M=re==="next"?Ha:Va;var se=m.map(function(ge){return{lower:N(ge),upper:_(ge)}}).sort(function(ge,pe){return M(ge.lower,pe.lower)});O=se.map(function(ge){return ge.upper}),Z=se.map(function(ge){return ge.lower}),te=(ue=re)==="next"?"":v}ee("next");var ae=new ae.Collection(ae,function(){return ln(O[0],Z[J-1]+v)}),oe=(ae._ondirectionchange=function(re){ee(re)},0);return ae._addAlgorithm(function(re,se,ge){var pe=re.key;if(typeof pe=="string"){var ve=N(pe);if(f(ve,Z,oe))return!0;for(var Ne=null,Ce=oe;Ce<J;++Ce){var De=(($e,Ve,Le,Ye,Ee,nt)=>{for(var rt=Math.min($e.length,Ye.length),at=-1,dt=0;dt<rt;++dt){var wn=Ve[dt];if(wn!==Ye[dt])return Ee($e[dt],Le[dt])<0?$e.substr(0,dt)+Le[dt]+Le.substr(dt+1):Ee($e[dt],Ye[dt])<0?$e.substr(0,dt)+Ye[dt]+Le.substr(dt+1):0<=at?$e.substr(0,at)+Ve[at]+Le.substr(at+1):null;Ee($e[dt],wn)<0&&(at=dt)}return rt<Ye.length&&nt==="next"?$e+Le.substr($e.length):rt<$e.length&&nt==="prev"?$e.substr(0,Le.length):at<0?null:$e.substr(0,at)+Ye[at]+Le.substr(at+1)})(pe,ve,O[Ce],Z[Ce],M,ue);De===null&&Ne===null?oe=Ce+1:(Ne===null||0<M(Ne,De))&&(Ne=De)}se(Ne!==null?function(){re.continue(Ne+te)}:ge)}return!1}),ae}function ln(a,f,m,v){return{type:2,lower:a,upper:f,lowerOpen:m,upperOpen:v}}function kr(a){return{type:1,lower:a,upper:a}}Object.defineProperty(It.prototype,"Collection",{get:function(){return this._ctx.table.db.Collection},enumerable:!1,configurable:!0}),It.prototype.between=function(a,f,m,v){m=m!==!1,v=v===!0;try{return 0<this._cmp(a,f)||this._cmp(a,f)===0&&(m||v)&&(!m||!v)?Kr(this):new this.Collection(this,function(){return ln(a,f,!m,!v)})}catch{return xn(this,mt)}},It.prototype.equals=function(a){return a==null?xn(this,mt):new this.Collection(this,function(){return kr(a)})},It.prototype.above=function(a){return a==null?xn(this,mt):new this.Collection(this,function(){return ln(a,void 0,!0)})},It.prototype.aboveOrEqual=function(a){return a==null?xn(this,mt):new this.Collection(this,function(){return ln(a,void 0,!1)})},It.prototype.below=function(a){return a==null?xn(this,mt):new this.Collection(this,function(){return ln(void 0,a,!1,!0)})},It.prototype.belowOrEqual=function(a){return a==null?xn(this,mt):new this.Collection(this,function(){return ln(void 0,a)})},It.prototype.startsWith=function(a){return typeof a!="string"?xn(this,oo):this.between(a,a+an,!0,!0)},It.prototype.startsWithIgnoreCase=function(a){return a===""?this.startsWith(a):co(this,function(f,m){return f.indexOf(m[0])===0},[a],an)},It.prototype.equalsIgnoreCase=function(a){return co(this,function(f,m){return f===m[0]},[a],"")},It.prototype.anyOfIgnoreCase=function(){var a=B.apply(W,arguments);return a.length===0?Kr(this):co(this,function(f,m){return m.indexOf(f)!==-1},a,"")},It.prototype.startsWithAnyOfIgnoreCase=function(){var a=B.apply(W,arguments);return a.length===0?Kr(this):co(this,function(f,m){return m.some(function(v){return f.indexOf(v)===0})},a,an)},It.prototype.anyOf=function(){var a,f,m=this,v=B.apply(W,arguments),_=this._cmp;try{v.sort(_)}catch{return xn(this,mt)}return v.length===0?Kr(this):((a=new this.Collection(this,function(){return ln(v[0],v[v.length-1])}))._ondirectionchange=function(N){_=N==="next"?m._ascending:m._descending,v.sort(_)},f=0,a._addAlgorithm(function(N,M,O){for(var Z=N.key;0<_(Z,v[f]);)if(++f===v.length)return M(O),!1;return _(Z,v[f])===0||(M(function(){N.continue(v[f])}),!1)}),a)},It.prototype.notEqual=function(a){return this.inAnyRange([[-1/0,a],[a,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})},It.prototype.noneOf=function(){var a=B.apply(W,arguments);if(a.length===0)return new this.Collection(this);try{a.sort(this._ascending)}catch{return xn(this,mt)}var f=a.reduce(function(m,v){return m?m.concat([[m[m.length-1][1],v]]):[[-1/0,v]]},null);return f.push([a[a.length-1],this.db._maxKey]),this.inAnyRange(f,{includeLowers:!1,includeUppers:!1})},It.prototype.inAnyRange=function(a,ge){var m=this,v=this._cmp,_=this._ascending,N=this._descending,M=this._min,O=this._max;if(a.length===0)return Kr(this);if(!a.every(function(pe){return pe[0]!==void 0&&pe[1]!==void 0&&_(pe[0],pe[1])<=0}))return xn(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",ke.InvalidArgument);var Z=!ge||ge.includeLowers!==!1,ue=ge&&ge.includeUppers===!0,te,J=_;function ee(pe,ve){return J(pe[0],ve[0])}try{(te=a.reduce(function(pe,ve){for(var Ne=0,Ce=pe.length;Ne<Ce;++Ne){var De=pe[Ne];if(v(ve[0],De[1])<0&&0<v(ve[1],De[0])){De[0]=M(De[0],ve[0]),De[1]=O(De[1],ve[1]);break}}return Ne===Ce&&pe.push(ve),pe},[])).sort(ee)}catch{return xn(this,mt)}var ae=0,oe=ue?function(pe){return 0<_(pe,te[ae][1])}:function(pe){return 0<=_(pe,te[ae][1])},re=Z?function(pe){return 0<N(pe,te[ae][0])}:function(pe){return 0<=N(pe,te[ae][0])},se=oe,ge=new this.Collection(this,function(){return ln(te[0][0],te[te.length-1][1],!Z,!ue)});return ge._ondirectionchange=function(pe){J=pe==="next"?(se=oe,_):(se=re,N),te.sort(ee)},ge._addAlgorithm(function(pe,ve,Ne){for(var Ce,De=pe.key;se(De);)if(++ae===te.length)return ve(Ne),!1;return!oe(Ce=De)&&!re(Ce)||(m._cmp(De,te[ae][1])===0||m._cmp(De,te[ae][0])===0||ve(function(){J===_?pe.continue(te[ae][0]):pe.continue(te[ae][1])}),!1)}),ge},It.prototype.startsWithAnyOf=function(){var a=B.apply(W,arguments);return a.every(function(f){return typeof f=="string"})?a.length===0?Kr(this):this.inAnyRange(a.map(function(f){return[f,f+an]})):xn(this,"startsWithAnyOf() only works with strings")};var Nr=It;function It(){}function un(a){return gt(function(f){return Rn(f),a(f.target.error),!1})}function Rn(a){a.stopPropagation&&a.stopPropagation(),a.preventDefault&&a.preventDefault()}var hi="storagemutated",Ui="x-storagemutated-1",Ln=Vr(null,hi),Ou=(tr.prototype._lock=function(){return R(!qe.global),++this._reculock,this._reculock!==1||qe.global||(qe.lockOwnerFor=this),this},tr.prototype._unlock=function(){if(R(!qe.global),--this._reculock==0)for(qe.global||(qe.lockOwnerFor=null);0<this._blockedFuncs.length&&!this._locked();){var a=this._blockedFuncs.shift();try{Ht(a[1],a[0])}catch{}}return this},tr.prototype._locked=function(){return this._reculock&&qe.lockOwnerFor!==this},tr.prototype.create=function(a){var f=this;if(this.mode){var m=this.db.idbdb,v=this.db._state.dbOpenError;if(R(!this.idbtrans),!a&&!m)switch(v&&v.name){case"DatabaseClosedError":throw new ke.DatabaseClosed(v);case"MissingAPIError":throw new ke.MissingAPI(v.message,v);default:throw new ke.OpenFailed(v)}if(!this.active)throw new ke.TransactionInactive;R(this._completion._state===null),(a=this.idbtrans=a||(this.db.core||m).transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability})).onerror=gt(function(_){Rn(_),f._reject(a.error)}),a.onabort=gt(function(_){Rn(_),f.active&&f._reject(new ke.Abort(a.error)),f.active=!1,f.on("abort").fire(_)}),a.oncomplete=gt(function(){f.active=!1,f._resolve(),"mutatedParts"in a&&Ln.storagemutated.fire(a.mutatedParts)})}return this},tr.prototype._promise=function(a,f,m){var v,_=this;return a==="readwrite"&&this.mode!=="readwrite"?kt(new ke.ReadOnly("Transaction is readonly")):this.active?this._locked()?new He(function(N,M){_._blockedFuncs.push([function(){_._promise(a,f,m).then(N,M)},qe])}):m?gn(function(){var N=new He(function(M,O){_._lock();var Z=f(M,O,_);Z&&Z.then&&Z.then(M,O)});return N.finally(function(){return _._unlock()}),N._lib=!0,N}):((v=new He(function(N,M){var O=f(N,M,_);O&&O.then&&O.then(N,M)}))._lib=!0,v):kt(new ke.TransactionInactive)},tr.prototype._root=function(){return this.parent?this.parent._root():this},tr.prototype.waitFor=function(a){var f,m=this._root(),v=He.resolve(a),_=(m._waitingFor?m._waitingFor=m._waitingFor.then(function(){return v}):(m._waitingFor=v,m._waitingQueue=[],f=m.idbtrans.objectStore(m.storeNames[0]),(function N(){for(++m._spinCount;m._waitingQueue.length;)m._waitingQueue.shift()();m._waitingFor&&(f.get(-1/0).onsuccess=N)})()),m._waitingFor);return new He(function(N,M){v.then(function(O){return m._waitingQueue.push(gt(N.bind(null,O)))},function(O){return m._waitingQueue.push(gt(M.bind(null,O)))}).finally(function(){m._waitingFor===_&&(m._waitingFor=null)})})},tr.prototype.abort=function(){this.active&&(this.active=!1,this.idbtrans&&this.idbtrans.abort(),this._reject(new ke.Abort))},tr.prototype.table=function(a){var f=this._memoizedTables||(this._memoizedTables={});if(w(f,a))return f[a];var m=this.schema[a];if(m)return(m=new this.db.Table(a,m,this)).core=this.db.core.table(a),f[a]=m;throw new ke.NotFound("Table "+a+" not part of transaction")},tr);function tr(){}function Fo(a,f,m,v,_,N,M,O){return{name:a,keyPath:f,unique:m,multi:v,auto:_,compound:N,src:(m&&!M?"&":"")+(v?"*":"")+(_?"++":"")+Ls(f),type:O}}function Ls(a){return typeof a=="string"?a:a?"["+[].join.call(a,"+")+"]":""}function Ds(a,f,m){return{name:a,primKey:f,indexes:m,mappedClass:null,idxByName:(v=function(_){return[_.name,_]},m.reduce(function(_,N,M){return N=v(N,M),N&&(_[N[0]]=N[1]),_},{}))};var v}var Er=function(a){try{return a.only([[]]),Er=function(){return[[]]},[[]]}catch{return Er=function(){return an},an}};function fo(a){return a==null?function(){}:typeof a=="string"?(f=a).split(".").length===1?function(m){return m[f]}:function(m){return V(m,f)}:function(m){return V(m,a)};var f}function po(a){return[].slice.call(a)}var Ki=0;function mi(a){return a==null?":id":typeof a=="string"?a:"[".concat(a.join("+"),"]")}function Ru(a,f,M){function v(se){if(se.type===3)return null;if(se.type===4)throw new Error("Cannot convert never type to IDBKeyRange");var ae=se.lower,oe=se.upper,re=se.lowerOpen,se=se.upperOpen;return ae===void 0?oe===void 0?null:f.upperBound(oe,!!se):oe===void 0?f.lowerBound(ae,!!re):f.bound(ae,oe,!!re,!!se)}function _(ee){var ae,oe,re=ee.name;return{name:re,schema:ee,mutate:function(se){var ge=se.trans,pe=se.type,ve=se.keys,Ne=se.values,Ce=se.range;return new Promise(function(De,$e){De=gt(De);var Ve=ge.objectStore(re),Le=Ve.keyPath==null,Ye=pe==="put"||pe==="add";if(!Ye&&pe!=="delete"&&pe!=="deleteRange")throw new Error("Invalid operation type: "+pe);var Ee,nt=(ve||Ne||{length:1}).length;if(ve&&Ne&&ve.length!==Ne.length)throw new Error("Given keys array must have same length as given values array.");if(nt===0)return De({numFailures:0,failures:{},results:[],lastResult:void 0});function rt(cn){++wn,Rn(cn)}var at=[],dt=[],wn=0;if(pe==="deleteRange"){if(Ce.type===4)return De({numFailures:wn,failures:dt,results:[],lastResult:void 0});Ce.type===3?at.push(Ee=Ve.clear()):at.push(Ee=Ve.delete(v(Ce)))}else{var Le=Ye?Le?[Ne,ve]:[Ne,null]:[ve,null],st=Le[0],jt=Le[1];if(Ye)for(var Vt=0;Vt<nt;++Vt)at.push(Ee=jt&&jt[Vt]!==void 0?Ve[pe](st[Vt],jt[Vt]):Ve[pe](st[Vt])),Ee.onerror=rt;else for(Vt=0;Vt<nt;++Vt)at.push(Ee=Ve[pe](st[Vt])),Ee.onerror=rt}function Xo(cn){cn=cn.target.result,at.forEach(function(wo,bo){return wo.error!=null&&(dt[bo]=wo.error)}),De({numFailures:wn,failures:dt,results:pe==="delete"?ve:at.map(function(wo){return wo.result}),lastResult:cn})}Ee.onerror=function(cn){rt(cn),Xo(cn)},Ee.onsuccess=Xo})},getMany:function(se){var ge=se.trans,pe=se.keys;return new Promise(function(ve,Ne){ve=gt(ve);for(var Ce,De=ge.objectStore(re),$e=pe.length,Ve=new Array($e),Le=0,Ye=0,Ee=function(at){at=at.target,Ve[at._pos]=at.result,++Ye===Le&&ve(Ve)},nt=un(Ne),rt=0;rt<$e;++rt)pe[rt]!=null&&((Ce=De.get(pe[rt]))._pos=rt,Ce.onsuccess=Ee,Ce.onerror=nt,++Le);Le===0&&ve(Ve)})},get:function(se){var ge=se.trans,pe=se.key;return new Promise(function(ve,Ne){ve=gt(ve);var Ce=ge.objectStore(re).get(pe);Ce.onsuccess=function(De){return ve(De.target.result)},Ce.onerror=un(Ne)})},query:(ae=Z,oe=ue,function(se){return new Promise(function(ge,pe){ge=gt(ge);var ve,Ne,Ce,De,nt=se.trans,$e=se.values,Ve=se.limit,Ee=se.query,Le=(Le=se.direction)!=null?Le:"next",Ye=Ve===1/0?void 0:Ve,rt=Ee.index,Ee=Ee.range,nt=nt.objectStore(re),nt=rt.isPrimaryKey?nt:nt.index(rt.name),rt=v(Ee);if(Ve===0)return ge({result:[]});oe?(Ee={query:rt,count:Ye,direction:Le},(ve=$e?nt.getAll(Ee):nt.getAllKeys(Ee)).onsuccess=function(at){return ge({result:at.target.result})},ve.onerror=un(pe)):ae&&Le==="next"?((ve=$e?nt.getAll(rt,Ye):nt.getAllKeys(rt,Ye)).onsuccess=function(at){return ge({result:at.target.result})},ve.onerror=un(pe)):(Ne=0,Ce=!$e&&"openKeyCursor"in nt?nt.openKeyCursor(rt,Le):nt.openCursor(rt,Le),De=[],Ce.onsuccess=function(){var at=Ce.result;return!at||(De.push($e?at.value:at.primaryKey),++Ne===Ve)?ge({result:De}):void at.continue()},Ce.onerror=un(pe))})}),openCursor:function(se){var ge=se.trans,pe=se.values,ve=se.query,Ne=se.reverse,Ce=se.unique;return new Promise(function(De,$e){De=gt(De);var Ye=ve.index,Ve=ve.range,Le=ge.objectStore(re),Le=Ye.isPrimaryKey?Le:Le.index(Ye.name),Ye=Ne?Ce?"prevunique":"prev":Ce?"nextunique":"next",Ee=!pe&&"openKeyCursor"in Le?Le.openKeyCursor(v(Ve),Ye):Le.openCursor(v(Ve),Ye);Ee.onerror=un($e),Ee.onsuccess=gt(function(nt){var rt,at,dt,wn,st=Ee.result;st?(st.___id=++Ki,st.done=!1,rt=st.continue.bind(st),at=(at=st.continuePrimaryKey)&&at.bind(st),dt=st.advance.bind(st),wn=function(){throw new Error("Cursor not stopped")},st.trans=ge,st.stop=st.continue=st.continuePrimaryKey=st.advance=function(){throw new Error("Cursor not started")},st.fail=gt($e),st.next=function(){var jt=this,Vt=1;return this.start(function(){return Vt--?jt.continue():jt.stop()}).then(function(){return jt})},st.start=function(jt){function Vt(){if(Ee.result)try{jt()}catch(cn){st.fail(cn)}else st.done=!0,st.start=function(){throw new Error("Cursor behind last entry")},st.stop()}var Xo=new Promise(function(cn,wo){cn=gt(cn),Ee.onerror=un(wo),st.fail=wo,st.stop=function(bo){st.stop=st.continue=st.continuePrimaryKey=st.advance=wn,cn(bo)}});return Ee.onsuccess=gt(function(cn){Ee.onsuccess=Vt,Vt()}),st.continue=rt,st.continuePrimaryKey=at,st.advance=dt,Vt(),Xo},De(st)):De(null)},$e)})},count:function(se){var ge=se.query,pe=se.trans,ve=ge.index,Ne=ge.range;return new Promise(function(Ce,De){var $e=pe.objectStore(re),$e=ve.isPrimaryKey?$e:$e.index(ve.name),Ve=v(Ne),Ve=Ve?$e.count(Ve):$e.count();Ve.onsuccess=gt(function(Le){return Ce(Le.target.result)}),Ve.onerror=un(De)})}}}N=M,O=po((M=a).objectStoreNames),te=0<O.length?N.objectStore(O[0]):{};var N,M={schema:{name:M.name,tables:O.map(function(ee){return N.objectStore(ee)}).map(function(ee){var ae=ee.keyPath,oe=ee.autoIncrement,se=h(ae),re={},se={name:ee.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:ae==null,compound:se,keyPath:ae,autoIncrement:oe,unique:!0,extractKey:fo(ae)},indexes:po(ee.indexNames).map(function(ge){return ee.index(ge)}).map(function(Ne){var Ce=Ne.name,pe=Ne.unique,ve=Ne.multiEntry,Ne=Ne.keyPath,Ce={name:Ce,compound:h(Ne),keyPath:Ne,unique:pe,multiEntry:ve,extractKey:fo(Ne)};return re[mi(Ne)]=Ce}),getIndexByKeyPath:function(ge){return re[mi(ge)]}};return re[":id"]=se.primaryKey,ae!=null&&(re[mi(ae)]=se.primaryKey),se})},hasGetAll:0<O.length&&"getAll"in te&&!(typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604),hasIdb3Features:"getAllRecords"in te},O=M.schema,Z=M.hasGetAll,ue=M.hasIdb3Features,te=O.tables.map(_),J={};return te.forEach(function(ee){return J[ee.name]=ee}),{stack:"dbcore",transaction:a.transaction.bind(a),table:function(ee){if(J[ee])return J[ee];throw new Error("Table '".concat(ee,"' not found"))},MIN_KEY:-1/0,MAX_KEY:Er(f),schema:O}}function zs(a,f,m,v){return m=m.IDBKeyRange,f=Ru(f,m,v),{dbcore:a.dbcore.reduce(function(_,N){return N=N.create,s(s({},_),N(_))},f)}}function ho(a,f){var m=f.db,m=zs(a._middlewares,m,a._deps,f);a.core=m.dbcore,a.tables.forEach(function(v){var _=v.name;a.core.schema.tables.some(function(N){return N.name===_})&&(v.core=a.core.table(_),a[_]instanceof a.Table)&&(a[_].core=v.core)})}function Bo(a,f,m,v){m.forEach(function(_){var N=v[_];f.forEach(function(M){var O=(function Z(ue,te){return T(ue,te)||(ue=b(ue))&&Z(ue,te)})(M,_);(!O||"value"in O&&O.value===void 0)&&(M===a.Transaction.prototype||M instanceof a.Transaction?j(M,_,{get:function(){return this.table(_)},set:function(Z){C(this,_,{value:Z,writable:!0,configurable:!0,enumerable:!0})}}):M[_]=new a.Table(_,N))})})}function qi(a,f){f.forEach(function(m){for(var v in m)m[v]instanceof a.Table&&delete m[v]})}function qr(a,f){return a._cfg.version-f._cfg.version}function Fs(a,f,m,v){var _=a._dbSchema,N=(m.objectStoreNames.contains("$meta")&&!_.$meta&&(_.$meta=Ds("$meta",Xi("")[0],[]),a._storeNames.push("$meta")),a._createTransaction("readwrite",a._storeNames,_)),M=(N.create(m),N._completion.catch(v),N._reject.bind(N)),O=qe.transless||qe;gn(function(){if(qe.trans=N,qe.transless=O,f!==0)return ho(a,m),ue=f,((Z=N).storeNames.includes("$meta")?Z.table("$meta").get("version").then(function(te){return te??ue}):He.resolve(ue)).then(function(se){var J=a,ee=se,ae=N,oe=m,re=[],se=J._versions,ge=J._dbSchema=Zt(0,J.idbdb,oe);return(se=se.filter(function(pe){return pe._cfg.version>=ee})).length===0?He.resolve():(se.forEach(function(pe){re.push(function(){var ve,Ne,Ce,De=ge,$e=pe._cfg.dbschema,Ve=(Cr(J,De,oe),Cr(J,$e,oe),ge=J._dbSchema=$e,Yi(De,$e)),Le=(Ve.add.forEach(function(Ye){Ho(oe,Ye[0],Ye[1].primKey,Ye[1].indexes)}),Ve.change.forEach(function(Ye){if(Ye.recreate)throw new ke.Upgrade("Not yet support for changing primary key");var Ee=oe.objectStore(Ye.name);Ye.add.forEach(function(nt){return yi(Ee,nt)}),Ye.change.forEach(function(nt){Ee.deleteIndex(nt.name),yi(Ee,nt)}),Ye.del.forEach(function(nt){return Ee.deleteIndex(nt)})}),pe._cfg.contentUpgrade);if(Le&&pe._cfg.version>ee)return ho(J,oe),ae._memoizedTables={},ve=ce($e),Ve.del.forEach(function(Ye){ve[Ye]=De[Ye]}),qi(J,[J.Transaction.prototype]),Bo(J,[J.Transaction.prototype],d(ve),ve),ae.schema=ve,(Ne=A(Le))&&Gn(),$e=He.follow(function(){var Ye;(Ce=Le(ae))&&Ne&&(Ye=z.bind(null,null),Ce.then(Ye,Ye))}),Ce&&typeof Ce.then=="function"?He.resolve(Ce):$e.then(function(){return Ce})}),re.push(function(ve){var Ne,Ce,De=pe._cfg.dbschema;Ne=De,Ce=ve,[].slice.call(Ce.db.objectStoreNames).forEach(function($e){return Ne[$e]==null&&Ce.db.deleteObjectStore($e)}),qi(J,[J.Transaction.prototype]),Bo(J,[J.Transaction.prototype],J._storeNames,J._dbSchema),ae.schema=J._dbSchema}),re.push(function(ve){J.idbdb.objectStoreNames.contains("$meta")&&(Math.ceil(J.idbdb.version/10)===pe._cfg.version?(J.idbdb.deleteObjectStore("$meta"),delete J._dbSchema.$meta,J._storeNames=J._storeNames.filter(function(Ne){return Ne!=="$meta"})):ve.objectStore("$meta").put(pe._cfg.version,"version"))})}),(function pe(){return re.length?He.resolve(re.shift()(ae.idbtrans)).then(pe):He.resolve()})().then(function(){gi(ge,oe)}))}).catch(M);var Z,ue;d(_).forEach(function(te){Ho(m,te,_[te].primKey,_[te].indexes)}),ho(a,m),He.follow(function(){return a.on.populate.fire(N)}).catch(M)})}function Wi(a,f){gi(a._dbSchema,f),f.db.version%10!=0||f.objectStoreNames.contains("$meta")||f.db.createObjectStore("$meta").add(Math.ceil(f.db.version/10-1),"version");var m=Zt(0,a.idbdb,f);Cr(a,a._dbSchema,f);for(var v=0,_=Yi(m,a._dbSchema).change;v<_.length;v++){var N=(M=>{if(M.change.length||M.recreate)return console.warn("Unable to patch indexes of table ".concat(M.name," because it has changes on the type of index or primary key.")),{value:void 0};var O=f.objectStore(M.name);M.add.forEach(function(Z){Nt&&console.debug("Dexie upgrade patch: Creating missing index ".concat(M.name,".").concat(Z.src)),yi(O,Z)})})(_[v]);if(typeof N=="object")return N.value}}function Yi(a,f){var m,v={del:[],add:[],change:[]};for(m in a)f[m]||v.del.push(m);for(m in f){var _=a[m],N=f[m];if(_){var M={name:m,def:N,recreate:!1,del:[],add:[],change:[]};if(""+(_.primKey.keyPath||"")!=""+(N.primKey.keyPath||"")||_.primKey.auto!==N.primKey.auto)M.recreate=!0,v.change.push(M);else{var O=_.idxByName,Z=N.idxByName,ue=void 0;for(ue in O)Z[ue]||M.del.push(ue);for(ue in Z){var te=O[ue],J=Z[ue];te?te.src!==J.src&&M.change.push(J):M.add.push(J)}(0<M.del.length||0<M.add.length||0<M.change.length)&&v.change.push(M)}}else v.add.push([m,N])}return v}function Ho(a,f,m,v){var _=a.db.createObjectStore(f,m.keyPath?{keyPath:m.keyPath,autoIncrement:m.auto}:{autoIncrement:m.auto});v.forEach(function(N){return yi(_,N)})}function gi(a,f){d(a).forEach(function(m){f.db.objectStoreNames.contains(m)||(Nt&&console.debug("Dexie: Creating missing table",m),Ho(f,m,a[m].primKey,a[m].indexes))})}function yi(a,f){a.createIndex(f.name,f.keyPath,{unique:f.unique,multiEntry:f.multi})}function Zt(a,f,m){var v={};return U(f.objectStoreNames,0).forEach(function(_){for(var N=m.objectStore(_),M=Fo(Ls(ue=N.keyPath),ue||"",!0,!1,!!N.autoIncrement,ue&&typeof ue!="string",!0),O=[],Z=0;Z<N.indexNames.length;++Z){var te=N.index(N.indexNames[Z]),ue=te.keyPath,te=Fo(te.name,ue,!!te.unique,!!te.multiEntry,!1,ue&&typeof ue!="string",!1);O.push(te)}v[_]=Ds(_,M,O)}),v}function Cr(a,f,m){for(var v=m.db.objectStoreNames,_=0;_<v.length;++_){var N=v[_],M=m.objectStore(N);a._hasGetAll="getAll"in M;for(var O=0;O<M.indexNames.length;++O){var Z,ue=M.indexNames[O],te=M.index(ue).keyPath,te=typeof te=="string"?te:"["+U(te).join("+")+"]";f[N]&&(Z=f[N].idxByName[te])&&(Z.name=ue,delete f[N].idxByName[te],f[N].idxByName[ue]=Z)}}typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&c.WorkerGlobalScope&&c instanceof c.WorkerGlobalScope&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(a._hasGetAll=!1)}function Xi(a){return a.split(",").map(function(f,m){var _=f.split(":"),v=(v=_[1])==null?void 0:v.trim(),_=(f=_[0].trim()).replace(/([&*]|\+\+)/g,""),N=/^\[/.test(_)?_.match(/^\[(.*)\]$/)[1].split("+"):_;return Fo(_,N||null,/\&/.test(f),/\*/.test(f),/\+\+/.test(f),h(N),m===0,v)})}Vo.prototype._createTableSchema=Ds,Vo.prototype._parseIndexSyntax=Xi,Vo.prototype._parseStoresSpec=function(a,f){var m=this;d(a).forEach(function(v){if(a[v]!==null){var _=m._parseIndexSyntax(a[v]),N=_.shift();if(!N)throw new ke.Schema("Invalid schema for table "+v+": "+a[v]);if(N.unique=!0,N.multi)throw new ke.Schema("Primary key cannot be multiEntry*");_.forEach(function(M){if(M.auto)throw new ke.Schema("Only primary key can be marked as autoIncrement (++)");if(!M.keyPath)throw new ke.Schema("Index must have a name and cannot be an empty string")}),N=m._createTableSchema(v,N,_),f[v]=N}})},Vo.prototype.stores=function(m){var f=this.db,m=(this._cfg.storesSource=this._cfg.storesSource?y(this._cfg.storesSource,m):m,f._versions),v={},_={};return m.forEach(function(N){y(v,N._cfg.storesSource),_=N._cfg.dbschema={},N._parseStoresSpec(v,_)}),f._dbSchema=_,qi(f,[f._allTables,f,f.Transaction.prototype]),Bo(f,[f._allTables,f,f.Transaction.prototype,this._cfg.tables],d(_),_),f._storeNames=d(_),this},Vo.prototype.upgrade=function(a){return this._cfg.contentUpgrade=Rt(this._cfg.contentUpgrade||Re,a),this};var vi=Vo;function Vo(){}var mo=(()=>{var a,f,m;return typeof FinalizationRegistry<"u"&&typeof WeakRef<"u"?(a=new Set,f=new FinalizationRegistry(function(v){a.delete(v)}),{toArray:function(){return Array.from(a).map(function(v){return v.deref()}).filter(function(v){return v!==void 0})},add:function(v){var _=new WeakRef(v._novip);a.add(_),f.register(v._novip,_,_),a.size>v._options.maxConnections&&(_=a.values().next().value,a.delete(_),f.unregister(_))},remove:function(v){if(v)for(var _=a.values(),N=_.next();!N.done;){var M=N.value;if(M.deref()===v._novip)return a.delete(M),void f.unregister(M);N=_.next()}}}):(m=[],{toArray:function(){return m},add:function(v){m.push(v._novip)},remove:function(v){v&&(v=m.indexOf(v._novip))!==-1&&m.splice(v,1)}})})();function xi(a,f){var m=a._dbNamesDB;return m||(m=a._dbNamesDB=new Pr(Jn,{addons:[],indexedDB:a,IDBKeyRange:f})).version(1).stores({dbnames:"name"}),m.table("dbnames")}function go(a){return a&&typeof a.databases=="function"}function Uo(a){return gn(function(){return qe.letThrough=!0,a()})}function Qi(a){return!("from"in a)}var en=function(a,f){var m;if(!this)return m=new en,a&&"d"in a&&y(m,a),m;y(this,arguments.length?{d:1,from:a,to:1<arguments.length?f:a}:{d:0})};function wi(a,f,m){var v=ft(f,m);if(!isNaN(v)){if(0<v)throw RangeError();if(Qi(a))return y(a,{from:f,to:m,d:1});var v=a.l,_=a.r;if(ft(m,a.from)<0)return v?wi(v,f,m):a.l={from:f,to:m,d:1,l:null,r:null},Ua(a);if(0<ft(f,a.to))return _?wi(_,f,m):a.r={from:f,to:m,d:1,l:null,r:null},Ua(a);ft(f,a.from)<0&&(a.from=f,a.l=null,a.d=_?_.d+1:1),0<ft(m,a.to)&&(a.to=m,a.r=null,a.d=a.l?a.l.d+1:1),f=!a.r,v&&!a.l&&bi(a,v),_&&f&&bi(a,_)}}function bi(a,f){Qi(f)||(function m(v,_){var N=_.from,M=_.l,O=_.r;wi(v,N,_.to),M&&m(v,M),O&&m(v,O)})(a,f)}function Gi(a,f){var m=Ji(f),v=m.next();if(!v.done)for(var _=v.value,N=Ji(a),M=N.next(_.from),O=M.value;!v.done&&!M.done;){if(ft(O.from,_.to)<=0&&0<=ft(O.to,_.from))return!0;ft(_.from,O.from)<0?_=(v=m.next(O.from)).value:O=(M=N.next(_.from)).value}return!1}function Ji(a){var f=Qi(a)?null:{s:0,n:a};return{next:function(m){for(var v=0<arguments.length;f;)switch(f.s){case 0:if(f.s=1,v)for(;f.n.l&&ft(m,f.n.from)<0;)f={up:f,n:f.n.l,s:1};else for(;f.n.l;)f={up:f,n:f.n.l,s:1};case 1:if(f.s=2,!v||ft(m,f.n.to)<=0)return{value:f.n,done:!1};case 2:if(f.n.r){f.s=3,f={up:f,n:f.n.r,s:0};continue}case 3:f=f.up}return{done:!0}}}}function Ua(a){var f,m,v,_=(((_=a.r)==null?void 0:_.d)||0)-(((_=a.l)==null?void 0:_.d)||0),_=1<_?"r":_<-1?"l":"";_&&(f=_=="r"?"l":"r",m=s({},a),v=a[_],a.from=v.from,a.to=v.to,a[_]=v[_],m[_]=v[f],(a[f]=m).d=Ka(m)),a.d=Ka(a)}function Ka(m){var f=m.r,m=m.l;return(f?m?Math.max(f.d,m.d):f.d:m?m.d:0)+1}function Zi(a,f){return d(f).forEach(function(m){a[m]?bi(a[m],f[m]):a[m]=(function v(_){var N,M,O={};for(N in _)w(_,N)&&(M=_[N],O[N]=!M||typeof M!="object"||q.has(M.constructor)?M:v(M));return O})(f[m])}),a}function Bs(a,f){return a.all||f.all||Object.keys(a).some(function(m){return f[m]&&Gi(f[m],a[m])})}S(en.prototype,((pt={add:function(a){return bi(this,a),this},addKey:function(a){return wi(this,a,a),this},addKeys:function(a){var f=this;return a.forEach(function(m){return wi(f,m,m)}),this},hasKey:function(a){var f=Ji(this).next(a).value;return f&&ft(f.from,a)<=0&&0<=ft(f.to,a)}})[G]=function(){return Ji(this)},pt));var Wr={},Hs={},Vs=!1;function es(a){Zi(Hs,a),Vs||(Vs=!0,setTimeout(function(){Vs=!1,Us(Hs,!(Hs={}))},0))}function Us(a,f){f===void 0&&(f=!1);var m=new Set;if(a.all)for(var v=0,_=Object.values(Wr);v<_.length;v++)ts(O=_[v],a,m,f);else for(var N in a){var M,O,N=/^idb\:\/\/(.*)\/(.*)\//.exec(N);N&&(M=N[1],N=N[2],O=Wr["idb://".concat(M,"/").concat(N)])&&ts(O,a,m,f)}m.forEach(function(Z){return Z()})}function ts(a,f,m,v){for(var _=[],N=0,M=Object.entries(a.queries.query);N<M.length;N++){for(var O=M[N],Z=O[0],ue=[],te=0,J=O[1];te<J.length;te++){var ee=J[te];Bs(f,ee.obsSet)?ee.subscribers.forEach(function(se){return m.add(se)}):v&&ue.push(ee)}v&&_.push([Z,ue])}if(v)for(var ae=0,oe=_;ae<oe.length;ae++){var re=oe[ae],Z=re[0],ue=re[1];a.queries.query[Z]=ue}}function Lu(a){var f=a._state,m=a._deps.indexedDB;if(f.isBeingOpened||a.idbdb)return f.dbReadyPromise.then(function(){return f.dbOpenError?kt(f.dbOpenError):a});f.isBeingOpened=!0,f.dbOpenError=null,f.openComplete=!1;var v=f.openCanceller,_=Math.round(10*a.verno),N=!1;function M(){if(f.openCanceller!==v)throw new ke.DatabaseClosed("db.open() was cancelled")}function O(){return new He(function(ee,ae){if(M(),!m)throw new ke.MissingAPI;var oe=a.name,re=f.autoSchema||!_?m.open(oe):m.open(oe,_);if(!re)throw new ke.MissingAPI;re.onerror=un(ae),re.onblocked=gt(a._fireOnBlocked),re.onupgradeneeded=gt(function(se){var ge;te=re.transaction,f.autoSchema&&!a._options.allowEmptyDB?(re.onerror=Rn,te.abort(),re.result.close(),(ge=m.deleteDatabase(oe)).onsuccess=ge.onerror=gt(function(){ae(new ke.NoSuchDatabase("Database ".concat(oe," doesnt exist")))})):(te.onerror=un(ae),ge=se.oldVersion>Math.pow(2,62)?0:se.oldVersion,J=ge<1,a.idbdb=re.result,N&&Wi(a,te),Fs(a,ge/10,te,ae))},ae),re.onsuccess=gt(function(){te=null;var se,ge,pe,ve,Ne,Ce,De=a.idbdb=re.result,$e=U(De.objectStoreNames);if(0<$e.length)try{var Ve=De.transaction((Ne=$e).length===1?Ne[0]:Ne,"readonly");if(f.autoSchema)Ce=De,ve=Ve,(pe=a).verno=Ce.version/10,ve=pe._dbSchema=Zt(0,Ce,ve),pe._storeNames=U(Ce.objectStoreNames,0),Bo(pe,[pe._allTables],d(ve),ve);else if(Cr(a,a._dbSchema,Ve),ge=Ve,((ge=Yi(Zt(0,(se=a).idbdb,ge),se._dbSchema)).add.length||ge.change.some(function(Le){return Le.add.length||Le.change.length}))&&!N)return console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Dexie will add missing parts and increment native version number to workaround this."),De.close(),_=De.version+1,N=!0,ee(O());ho(a,Ve)}catch{}mo.add(a),De.onversionchange=gt(function(Le){f.vcFired=!0,a.on("versionchange").fire(Le)}),De.onclose=gt(function(){a.close({disableAutoOpen:!1})}),J&&($e=a._deps,Ne=oe,go(Ce=$e.indexedDB)||Ne===Jn||xi(Ce,$e.IDBKeyRange).put({name:Ne}).catch(Re)),ee()},ae)}).catch(function(ee){switch(ee==null?void 0:ee.name){case"UnknownError":if(0<f.PR1398_maxLoop)return f.PR1398_maxLoop--,console.warn("Dexie: Workaround for Chrome UnknownError on open()"),O();break;case"VersionError":if(0<_)return _=0,O()}return He.reject(ee)})}var Z,ue=f.dbReadyResolve,te=null,J=!1;return He.race([v,(typeof navigator>"u"?He.resolve():!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise(function(ee){function ae(){return indexedDB.databases().finally(ee)}Z=setInterval(ae,100),ae()}).finally(function(){return clearInterval(Z)}):Promise.resolve()).then(O)]).then(function(){return M(),f.onReadyBeingFired=[],He.resolve(Uo(function(){return a.on.ready.fire(a.vip)})).then(function ee(){var ae;if(0<f.onReadyBeingFired.length)return ae=f.onReadyBeingFired.reduce(Rt,Re),f.onReadyBeingFired=[],He.resolve(Uo(function(){return ae(a.vip)})).then(ee)})}).finally(function(){f.openCanceller===v&&(f.onReadyBeingFired=null,f.isBeingOpened=!1)}).catch(function(ee){f.dbOpenError=ee;try{te&&te.abort()}catch{}return v===f.openCanceller&&a._close(),kt(ee)}).finally(function(){f.openComplete=!0,ue()}).then(function(){var ee;return J&&(ee={},a.tables.forEach(function(ae){ae.schema.indexes.forEach(function(oe){oe.name&&(ee["idb://".concat(a.name,"/").concat(ae.name,"/").concat(oe.name)]=new en(-1/0,[[[]]]))}),ee["idb://".concat(a.name,"/").concat(ae.name,"/")]=ee["idb://".concat(a.name,"/").concat(ae.name,"/:dels")]=new en(-1/0,[[[]]])}),Ln(hi).fire(ee),Us(ee,!0)),a})}function Ks(a){function f(N){return a.next(N)}var m=_(f),v=_(function(N){return a.throw(N)});function _(N){return function(O){var O=N(O),Z=O.value;return O.done?Z:Z&&typeof Z.then=="function"?Z.then(m,v):h(Z)?Promise.all(Z).then(m,v):m(Z)}}return _(f)()}function ns(a,f,m){for(var v=h(a)?a.slice():[a],_=0;_<m;++_)v.push(f);return v}var qa={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function(a){return s(s({},a),{table:function(v){var m=a.table(v),v=m.schema,_={},N=[];function M(ee,ae,oe){var pe=mi(ee),re=_[pe]=_[pe]||[],se=ee==null?0:typeof ee=="string"?1:ee.length,ge=0<ae,pe=s(s({},oe),{name:ge?"".concat(pe,"(virtual-from:").concat(oe.name,")"):oe.name,lowLevelIndex:oe,isVirtual:ge,keyTail:ae,keyLength:se,extractKey:fo(ee),unique:!ge&&oe.unique});return re.push(pe),pe.isPrimaryKey||N.push(pe),1<se&&M(se===2?ee[0]:ee.slice(0,se-1),ae+1,oe),re.sort(function(ve,Ne){return ve.keyTail-Ne.keyTail}),pe}var O=M(v.primaryKey.keyPath,0,v.primaryKey);_[":id"]=[O];for(var Z=0,ue=v.indexes;Z<ue.length;Z++){var te=ue[Z];M(te.keyPath,0,te)}function J(ee){var ae,oe=ee.query.index;return oe.isVirtual?s(s({},ee),{query:{index:oe.lowLevelIndex,range:(ae=ee.query.range,oe=oe.keyTail,{type:ae.type===1?2:ae.type,lower:ns(ae.lower,ae.lowerOpen?a.MAX_KEY:a.MIN_KEY,oe),lowerOpen:!0,upper:ns(ae.upper,ae.upperOpen?a.MIN_KEY:a.MAX_KEY,oe),upperOpen:!0})}}):ee}return s(s({},m),{schema:s(s({},v),{primaryKey:O,indexes:N,getIndexByKeyPath:function(ee){return(ee=_[mi(ee)])&&ee[0]}}),count:function(ee){return m.count(J(ee))},query:function(ee){return m.query(J(ee))},openCursor:function(ee){var ae=ee.query.index,oe=ae.keyTail,re=ae.keyLength;return ae.isVirtual?m.openCursor(J(ee)).then(function(ge){return ge&&se(ge)}):m.openCursor(ee);function se(ge){return Object.create(ge,{continue:{value:function(pe){pe!=null?ge.continue(ns(pe,ee.reverse?a.MAX_KEY:a.MIN_KEY,oe)):ee.unique?ge.continue(ge.key.slice(0,re).concat(ee.reverse?a.MIN_KEY:a.MAX_KEY,oe)):ge.continue()}},continuePrimaryKey:{value:function(pe,ve){ge.continuePrimaryKey(ns(pe,a.MAX_KEY,oe),ve)}},primaryKey:{get:function(){return ge.primaryKey}},key:{get:function(){var pe=ge.key;return re===1?pe[0]:pe.slice(0,re)}},value:{get:function(){return ge.value}}})}}})}})}};function qs(a,f,m,v){return m=m||{},v=v||"",d(a).forEach(function(_){var N,M,O;w(f,_)?(N=a[_],M=f[_],typeof N=="object"&&typeof M=="object"&&N&&M?(O=le(N))!==le(M)?m[v+_]=f[_]:O==="Object"?qs(N,M,m,v+_+"."):N!==M&&(m[v+_]=f[_]):N!==M&&(m[v+_]=f[_])):m[v+_]=void 0}),d(f).forEach(function(_){w(a,_)||(m[v+_]=f[_])}),m}function Ws(a,f){return f.type==="delete"?f.keys:f.keys||f.values.map(a.extractKey)}var Du={stack:"dbcore",name:"HooksMiddleware",level:2,create:function(a){return s(s({},a),{table:function(f){var m=a.table(f),v=m.schema.primaryKey;return s(s({},m),{mutate:function(_){var N=qe.trans,M=N.table(f).hook,O=M.deleting,Z=M.creating,ue=M.updating;switch(_.type){case"add":if(Z.fire===Re)break;return N._promise("readwrite",function(){return te(_)},!0);case"put":if(Z.fire===Re&&ue.fire===Re)break;return N._promise("readwrite",function(){return te(_)},!0);case"delete":if(O.fire===Re)break;return N._promise("readwrite",function(){return te(_)},!0);case"deleteRange":if(O.fire===Re)break;return N._promise("readwrite",function(){return(function J(ee,ae,oe){return m.query({trans:ee,values:!1,query:{index:v,range:ae},limit:oe}).then(function(re){var se=re.result;return te({type:"delete",keys:se,trans:ee}).then(function(ge){return 0<ge.numFailures?Promise.reject(ge.failures[0]):se.length<oe?{failures:[],numFailures:0,lastResult:void 0}:J(ee,s(s({},ae),{lower:se[se.length-1],lowerOpen:!0}),oe)})})})(_.trans,_.range,1e4)},!0)}return m.mutate(_);function te(J){var ee,ae,oe,re=qe.trans,se=J.keys||Ws(v,J);if(se)return(J=J.type==="add"||J.type==="put"?s(s({},J),{keys:se}):s({},J)).type!=="delete"&&(J.values=l([],J.values)),J.keys&&(J.keys=l([],J.keys)),ee=m,oe=se,((ae=J).type==="add"?Promise.resolve([]):ee.getMany({trans:ae.trans,keys:oe,cache:"immutable"})).then(function(ge){var pe=se.map(function(ve,Ne){var Ce,De,$e,Ve=ge[Ne],Le={onerror:null,onsuccess:null};return J.type==="delete"?O.fire.call(Le,ve,Ve,re):J.type==="add"||Ve===void 0?(Ce=Z.fire.call(Le,ve,J.values[Ne],re),ve==null&&Ce!=null&&(J.keys[Ne]=ve=Ce,v.outbound||Q(J.values[Ne],v.keyPath,ve))):(Ce=qs(Ve,J.values[Ne]),(De=ue.fire.call(Le,Ce,ve,Ve,re))&&($e=J.values[Ne],Object.keys(De).forEach(function(Ye){w($e,Ye)?$e[Ye]=De[Ye]:Q($e,Ye,De[Ye])}))),Le});return m.mutate(J).then(function(ve){for(var Ne=ve.failures,Ce=ve.results,De=ve.numFailures,ve=ve.lastResult,$e=0;$e<se.length;++$e){var Ve=(Ce||se)[$e],Le=pe[$e];Ve==null?Le.onerror&&Le.onerror(Ne[$e]):Le.onsuccess&&Le.onsuccess(J.type==="put"&&ge[$e]?J.values[$e]:Ve)}return{failures:Ne,results:Ce,numFailures:De,lastResult:ve}}).catch(function(ve){return pe.forEach(function(Ne){return Ne.onerror&&Ne.onerror(ve)}),Promise.reject(ve)})});throw new Error("Keys missing")}}})}})}};function Wa(a,f,m){try{if(!f||f.keys.length<a.length)return null;for(var v=[],_=0,N=0;_<f.keys.length&&N<a.length;++_)ft(f.keys[_],a[N])===0&&(v.push(m?xe(f.values[_]):f.values[_]),++N);return v.length===a.length?v:null}catch{return null}}var zu={stack:"dbcore",level:-1,create:function(a){return{table:function(f){var m=a.table(f);return s(s({},m),{getMany:function(v){var _;return v.cache?(_=Wa(v.keys,v.trans._cache,v.cache==="clone"))?He.resolve(_):m.getMany(v).then(function(N){return v.trans._cache={keys:v.keys,values:v.cache==="clone"?xe(N):N},N}):m.getMany(v)},mutate:function(v){return v.type!=="add"&&(v.trans._cache=null),m.mutate(v)}})}}}};function Ya(a,f){return a.trans.mode==="readonly"&&!!a.subscr&&!a.trans.explicit&&a.trans.db._options.cache!=="disabled"&&!f.schema.primaryKey.outbound}function Xa(a,f){switch(a){case"query":return f.values&&!f.unique;case"get":case"getMany":case"count":case"openCursor":return!1}}var Ys={stack:"dbcore",level:0,name:"Observability",create:function(a){var f=a.schema.name,m=new en(a.MIN_KEY,a.MAX_KEY);return s(s({},a),{transaction:function(v,_,N){if(qe.subscr&&_!=="readonly")throw new ke.ReadOnly("Readwrite transaction in liveQuery context. Querier source: ".concat(qe.querier));return a.transaction(v,_,N)},table:function(v){function _(se){var re,se=se.query;return[re=se.index,new en((re=(se=se.range).lower)!=null?re:a.MIN_KEY,(re=se.upper)!=null?re:a.MAX_KEY)]}var N=a.table(v),M=N.schema,O=M.primaryKey,Z=M.indexes,ue=O.extractKey,te=O.outbound,J=O.autoIncrement&&Z.filter(function(oe){return oe.compound&&oe.keyPath.includes(O.keyPath)}),ee=s(s({},N),{mutate:function(oe){function re(Ee){return Ee="idb://".concat(f,"/").concat(v,"/").concat(Ee),Ne[Ee]||(Ne[Ee]=new en)}var se,ge,pe,ve=oe.trans,Ne=oe.mutatedParts||(oe.mutatedParts={}),Ce=re(""),De=re(":dels"),$e=oe.type,Le=oe.type==="deleteRange"?[oe.range]:oe.type==="delete"?[oe.keys]:oe.values.length<50?[Ws(O,oe).filter(function(Ee){return Ee}),oe.values]:[],Ve=Le[0],Le=Le[1],Ye=oe.trans._cache;return h(Ve)?(Ce.addKeys(Ve),($e=$e==="delete"||Ve.length===Le.length?Wa(Ve,Ye):null)||De.addKeys(Ve),($e||Le)&&(se=re,ge=$e,pe=Le,M.indexes.forEach(function(Ee){var nt=se(Ee.name||"");function rt(dt){return dt!=null?Ee.extractKey(dt):null}function at(dt){Ee.multiEntry&&h(dt)?dt.forEach(function(wn){return nt.addKey(wn)}):nt.addKey(dt)}(ge||pe).forEach(function(dt,jt){var st=ge&&rt(ge[jt]),jt=pe&&rt(pe[jt]);ft(st,jt)!==0&&(st!=null&&at(st),jt!=null)&&at(jt)})}))):Ve?(Le={from:(Ye=Ve.lower)!=null?Ye:a.MIN_KEY,to:($e=Ve.upper)!=null?$e:a.MAX_KEY},De.add(Le),Ce.add(Le)):(Ce.add(m),De.add(m),M.indexes.forEach(function(Ee){return re(Ee.name).add(m)})),N.mutate(oe).then(function(Ee){return!Ve||oe.type!=="add"&&oe.type!=="put"||(Ce.addKeys(Ee.results),J&&J.forEach(function(nt){for(var rt=oe.values.map(function(st){return nt.extractKey(st)}),at=nt.keyPath.findIndex(function(st){return st===O.keyPath}),dt=0,wn=Ee.results.length;dt<wn;++dt)rt[dt][at]=Ee.results[dt];re(nt.name).addKeys(rt)})),ve.mutatedParts=Zi(ve.mutatedParts||{},Ne),Ee})}}),ae={get:function(oe){return[O,new en(oe.key)]},getMany:function(oe){return[O,new en().addKeys(oe.keys)]},count:_,query:_,openCursor:_};return d(ae).forEach(function(oe){ee[oe]=function(re){var se=qe.subscr,ge=!!se,pe=Ya(qe,N)&&Xa(oe,re)?re.obsSet={}:se;if(ge){var ve,se=function(Le){return Le="idb://".concat(f,"/").concat(v,"/").concat(Le),pe[Le]||(pe[Le]=new en)},Ne=se(""),Ce=se(":dels"),ge=ae[oe](re),De=ge[0],ge=ge[1];if((oe==="query"&&De.isPrimaryKey&&!re.values?Ce:se(De.name||"")).add(ge),!De.isPrimaryKey){if(oe!=="count")return ve=oe==="query"&&te&&re.values&&N.query(s(s({},re),{values:!1})),N[oe].apply(this,arguments).then(function(Le){if(oe==="query"){if(te&&re.values)return ve.then(function(rt){return rt=rt.result,Ne.addKeys(rt),Le});var Ye=re.values?Le.result.map(ue):Le.result;(re.values?Ne:Ce).addKeys(Ye)}else{var Ee,nt;if(oe==="openCursor")return nt=re.values,(Ee=Le)&&Object.create(Ee,{key:{get:function(){return Ce.addKey(Ee.primaryKey),Ee.key}},primaryKey:{get:function(){var rt=Ee.primaryKey;return Ce.addKey(rt),rt}},value:{get:function(){return nt&&Ne.addKey(Ee.primaryKey),Ee.value}}})}return Le});Ce.add(m)}}return N[oe].apply(this,arguments)}}),ee}})}};function Ko(a,f,m){var v;return m.numFailures===0?f:f.type==="deleteRange"||(v=f.keys?f.keys.length:"values"in f&&f.values?f.values.length:1,m.numFailures===v)?null:(v=s({},f),h(v.keys)&&(v.keys=v.keys.filter(function(_,N){return!(N in m.failures)})),"values"in v&&h(v.values)&&(v.values=v.values.filter(function(_,N){return!(N in m.failures)})),v)}function Xs(a,f){return m=a,((v=f).lower===void 0||(v.lowerOpen?0<ft(m,v.lower):0<=ft(m,v.lower)))&&(m=a,(v=f).upper===void 0||(v.upperOpen?ft(m,v.upper)<0:ft(m,v.upper)<=0));var m,v}function Qs(a,f,m,v,_,N){var M,O,Z,ue,te,J,ee;return!m||m.length===0||(M=f.query.index,O=M.multiEntry,Z=f.query.range,ue=v.schema.primaryKey.extractKey,te=M.extractKey,J=(M.lowLevelIndex||M).extractKey,(v=m.reduce(function(ae,oe){var re=ae,se=[];if(oe.type==="add"||oe.type==="put")for(var ge=new en,pe=oe.values.length-1;0<=pe;--pe){var ve,Ne=oe.values[pe],Ce=ue(Ne);!ge.hasKey(Ce)&&(ve=te(Ne),O&&h(ve)?ve.some(function(Ye){return Xs(Ye,Z)}):Xs(ve,Z))&&(ge.addKey(Ce),se.push(Ne))}switch(oe.type){case"add":var De=new en().addKeys(f.values?ae.map(function(Ee){return ue(Ee)}):ae),re=ae.concat(f.values?se.filter(function(Ee){return Ee=ue(Ee),!De.hasKey(Ee)&&(De.addKey(Ee),!0)}):se.map(function(Ee){return ue(Ee)}).filter(function(Ee){return!De.hasKey(Ee)&&(De.addKey(Ee),!0)}));break;case"put":var $e=new en().addKeys(oe.values.map(function(Ee){return ue(Ee)}));re=ae.filter(function(Ee){return!$e.hasKey(f.values?ue(Ee):Ee)}).concat(f.values?se:se.map(function(Ee){return ue(Ee)}));break;case"delete":var Ve=new en().addKeys(oe.keys);re=ae.filter(function(Ee){return!Ve.hasKey(f.values?ue(Ee):Ee)});break;case"deleteRange":var Le=oe.range;re=ae.filter(function(Ee){return!Xs(ue(Ee),Le)})}return re},a))===a)?a:(ee=function(ae,oe){return ft(J(ae),J(oe))||ft(ue(ae),ue(oe))},v.sort(f.direction==="prev"||f.direction==="prevunique"?function(ae,oe){return ee(oe,ae)}:ee),f.limit&&f.limit<1/0&&(v.length>f.limit?v.length=f.limit:a.length===f.limit&&v.length<f.limit&&(_.dirty=!0)),N?Object.freeze(v):v)}function Gs(a,f){return ft(a.lower,f.lower)===0&&ft(a.upper,f.upper)===0&&!!a.lowerOpen==!!f.lowerOpen&&!!a.upperOpen==!!f.upperOpen}function Qa(a,f){return((m,v,_,N)=>{if(m===void 0)return v!==void 0?-1:0;if(v===void 0)return 1;if((m=ft(m,v))===0){if(_&&N)return 0;if(_)return 1;if(N)return-1}return m})(a.lower,f.lower,a.lowerOpen,f.lowerOpen)<=0&&0<=((m,v,_,N)=>{if(m===void 0)return v!==void 0?1:0;if(v===void 0)return-1;if((m=ft(m,v))===0){if(_&&N)return 0;if(_)return-1;if(N)return 1}return m})(a.upper,f.upper,a.upperOpen,f.upperOpen)}function Ga(a,f,m,v){a.subscribers.add(m),v.addEventListener("abort",function(){var _,N;a.subscribers.delete(m),a.subscribers.size===0&&(_=a,N=f,setTimeout(function(){_.subscribers.size===0&&F(N,_)},3e3))})}var Ja={stack:"dbcore",level:0,name:"Cache",create:function(a){var f=a.schema.name;return s(s({},a),{transaction:function(m,v,_){var N,M,O=a.transaction(m,v,_);return v==="readwrite"&&(_=(N=new AbortController).signal,O.addEventListener("abort",(M=function(Z){return function(){if(N.abort(),v==="readwrite"){for(var ue=new Set,te=0,J=m;te<J.length;te++){var ee=J[te],ae=Wr["idb://".concat(f,"/").concat(ee)];if(ae){var oe=a.table(ee),re=ae.optimisticOps.filter(function(Ee){return Ee.trans===O});if(O._explicit&&Z&&O.mutatedParts)for(var se=0,ge=Object.values(ae.queries.query);se<ge.length;se++)for(var pe=0,ve=(De=ge[se]).slice();pe<ve.length;pe++)Bs(($e=ve[pe]).obsSet,O.mutatedParts)&&(F(De,$e),$e.subscribers.forEach(function(Ee){return ue.add(Ee)}));else if(0<re.length){ae.optimisticOps=ae.optimisticOps.filter(function(Ee){return Ee.trans!==O});for(var Ne=0,Ce=Object.values(ae.queries.query);Ne<Ce.length;Ne++)for(var De,$e,Ve,Le=0,Ye=(De=Ce[Ne]).slice();Le<Ye.length;Le++)($e=Ye[Le]).res!=null&&O.mutatedParts&&(Z&&!$e.dirty?(Ve=Object.isFrozen($e.res),Ve=Qs($e.res,$e.req,re,oe,$e,Ve),$e.dirty?(F(De,$e),$e.subscribers.forEach(function(Ee){return ue.add(Ee)})):Ve!==$e.res&&($e.res=Ve,$e.promise=He.resolve({result:Ve}))):($e.dirty&&F(De,$e),$e.subscribers.forEach(function(Ee){return ue.add(Ee)})))}}}ue.forEach(function(Ee){return Ee()})}}})(!1),{signal:_}),O.addEventListener("error",M(!1),{signal:_}),O.addEventListener("complete",M(!0),{signal:_})),O},table:function(m){var v=a.table(m),_=v.schema.primaryKey;return s(s({},v),{mutate:function(N){var M,O=qe.trans;return!_.outbound&&O.db._options.cache!=="disabled"&&!O.explicit&&O.idbtrans.mode==="readwrite"&&(M=Wr["idb://".concat(f,"/").concat(m)])?(O=v.mutate(N),N.type!=="add"&&N.type!=="put"||!(50<=N.values.length||Ws(_,N).some(function(Z){return Z==null}))?(M.optimisticOps.push(N),N.mutatedParts&&es(N.mutatedParts),O.then(function(Z){0<Z.numFailures&&(F(M.optimisticOps,N),(Z=Ko(0,N,Z))&&M.optimisticOps.push(Z),N.mutatedParts)&&es(N.mutatedParts)}),O.catch(function(){F(M.optimisticOps,N),N.mutatedParts&&es(N.mutatedParts)})):O.then(function(Z){var ue=Ko(0,s(s({},N),{values:N.values.map(function(te,J){var ee;return Z.failures[J]?te:(Q(ee=(ee=_.keyPath)!=null&&ee.includes(".")?xe(te):s({},te),_.keyPath,Z.results[J]),ee)})}),Z);M.optimisticOps.push(ue),queueMicrotask(function(){return N.mutatedParts&&es(N.mutatedParts)})}),O):v.mutate(N)},query:function(N){var M,O,Z,ue,te,J,ee;return Ya(qe,v)&&Xa("query",N)?(M=((Z=qe.trans)==null?void 0:Z.db._options.cache)==="immutable",O=(Z=qe).requery,Z=Z.signal,J=((ae,oe,re,se)=>{var ge=Wr["idb://".concat(ae,"/").concat(oe)];if(!ge)return[];if(!(ae=ge.queries[re]))return[null,!1,ge,null];var pe=ae[(se.query?se.query.index.name:null)||""];if(!pe)return[null,!1,ge,null];switch(re){case"query":var ve=(Ne=se.direction)!=null?Ne:"next",Ne=pe.find(function(Ce){var De;return Ce.req.limit===se.limit&&Ce.req.values===se.values&&((De=Ce.req.direction)!=null?De:"next")===ve&&Gs(Ce.req.query.range,se.query.range)});return Ne?[Ne,!0,ge,pe]:[pe.find(function(Ce){var De;return("limit"in Ce.req?Ce.req.limit:1/0)>=se.limit&&((De=Ce.req.direction)!=null?De:"next")===ve&&(!se.values||Ce.req.values)&&Qa(Ce.req.query.range,se.query.range)}),!1,ge,pe];case"count":return Ne=pe.find(function(Ce){return Gs(Ce.req.query.range,se.query.range)}),[Ne,!!Ne,ge,pe]}})(f,m,"query",N),ee=J[0],ue=J[2],te=J[3],ee&&J[1]?ee.obsSet=N.obsSet:(J=v.query(N).then(function(ae){var oe=ae.result;if(ee&&(ee.res=oe),M){for(var re=0,se=oe.length;re<se;++re)Object.freeze(oe[re]);Object.freeze(oe)}else ae.result=xe(oe);return ae}).catch(function(ae){return te&&ee&&F(te,ee),Promise.reject(ae)}),ee={obsSet:N.obsSet,promise:J,subscribers:new Set,type:"query",req:N,dirty:!1},te?te.push(ee):(te=[ee],(ue=ue||(Wr["idb://".concat(f,"/").concat(m)]={queries:{query:{},count:{}},objs:new Map,optimisticOps:[],unsignaledParts:{}})).queries.query[N.query.index.name||""]=te)),Ga(ee,te,O,Z),ee.promise.then(function(ae){return{result:Qs(ae.result,N,ue==null?void 0:ue.optimisticOps,v,ee,M)}})):v.query(N)}})}})}};function jr(a,f){return new Proxy(a,{get:function(m,v,_){return v==="db"?f:Reflect.get(m,v,_)}})}Lt.prototype.version=function(a){if(isNaN(a)||a<.1)throw new ke.Type("Given version is not a positive number");if(a=Math.round(10*a)/10,this.idbdb||this._state.isBeingOpened)throw new ke.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,a);var f=this._versions,m=f.filter(function(v){return v._cfg.version===a})[0];return m||(m=new this.Version(a),f.push(m),f.sort(qr),m.stores({}),this._state.autoSchema=!1),m},Lt.prototype._whenReady=function(a){var f=this;return this.idbdb&&(this._state.openComplete||qe.letThrough||this._vip)?a():new He(function(m,v){if(f._state.openComplete)return v(new ke.DatabaseClosed(f._state.dbOpenError));if(!f._state.isBeingOpened){if(!f._state.autoOpen)return void v(new ke.DatabaseClosed);f.open().catch(Re)}f._state.dbReadyPromise.then(m,v)}).then(a)},Lt.prototype.use=function(_){var f=_.stack,m=_.create,v=_.level,_=_.name,N=(_&&this.unuse({stack:f,name:_}),this._middlewares[f]||(this._middlewares[f]=[]));return N.push({stack:f,create:m,level:v??10,name:_}),N.sort(function(M,O){return M.level-O.level}),this},Lt.prototype.unuse=function(a){var f=a.stack,m=a.name,v=a.create;return f&&this._middlewares[f]&&(this._middlewares[f]=this._middlewares[f].filter(function(_){return v?_.create!==v:!!m&&_.name!==m})),this},Lt.prototype.open=function(){var a=this;return Ht(Cn,function(){return Lu(a)})},Lt.prototype._close=function(){this.on.close.fire(new CustomEvent("close"));var a=this._state;if(mo.remove(this),this.idbdb){try{this.idbdb.close()}catch{}this.idbdb=null}a.isBeingOpened||(a.dbReadyPromise=new He(function(f){a.dbReadyResolve=f}),a.openCanceller=new He(function(f,m){a.cancelOpen=m}))},Lt.prototype.close=function(f){var f=(f===void 0?{disableAutoOpen:!0}:f).disableAutoOpen,m=this._state;f?(m.isBeingOpened&&m.cancelOpen(new ke.DatabaseClosed),this._close(),m.autoOpen=!1,m.dbOpenError=new ke.DatabaseClosed):(this._close(),m.autoOpen=this._options.autoOpen||m.isBeingOpened,m.openComplete=!1,m.dbOpenError=null)},Lt.prototype.delete=function(a){var f=this,m=(a===void 0&&(a={disableAutoOpen:!0}),0<arguments.length&&typeof arguments[0]!="object"),v=this._state;return new He(function(_,N){function M(){f.close(a);var O=f._deps.indexedDB.deleteDatabase(f.name);O.onsuccess=gt(function(){var Z,ue,te;Z=f._deps,ue=f.name,go(te=Z.indexedDB)||ue===Jn||xi(te,Z.IDBKeyRange).delete(ue).catch(Re),_()}),O.onerror=un(N),O.onblocked=f._fireOnBlocked}if(m)throw new ke.InvalidArgument("Invalid closeOptions argument to db.delete()");v.isBeingOpened?v.dbReadyPromise.then(M):M()})},Lt.prototype.backendDB=function(){return this.idbdb},Lt.prototype.isOpen=function(){return this.idbdb!==null},Lt.prototype.hasBeenClosed=function(){var a=this._state.dbOpenError;return a&&a.name==="DatabaseClosed"},Lt.prototype.hasFailed=function(){return this._state.dbOpenError!==null},Lt.prototype.dynamicallyOpened=function(){return this._state.autoSchema},Object.defineProperty(Lt.prototype,"tables",{get:function(){var a=this;return d(this._allTables).map(function(f){return a._allTables[f]})},enumerable:!1,configurable:!0}),Lt.prototype.transaction=function(){var a=(function(f,m,v){var _=arguments.length;if(_<2)throw new ke.InvalidArgument("Too few arguments");for(var N=new Array(_-1);--_;)N[_-1]=arguments[_];return v=N.pop(),[f,we(N),v]}).apply(this,arguments);return this._transaction.apply(this,a)},Lt.prototype._transaction=function(a,f,m){var v,_,N=this,M=qe.trans,O=(M&&M.db===this&&a.indexOf("!")===-1||(M=null),a.indexOf("?")!==-1);a=a.replace("!","").replace("?","");try{if(_=f.map(function(ue){if(ue=ue instanceof N.Table?ue.name:ue,typeof ue!="string")throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");return ue}),a=="r"||a===Zn)v=Zn;else{if(a!="rw"&&a!=dr)throw new ke.InvalidArgument("Invalid transaction mode: "+a);v=dr}if(M){if(M.mode===Zn&&v===dr){if(!O)throw new ke.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");M=null}M&&_.forEach(function(ue){if(M&&M.storeNames.indexOf(ue)===-1){if(!O)throw new ke.SubTransaction("Table "+ue+" not included in parent transaction.");M=null}}),O&&M&&!M.active&&(M=null)}}catch(ue){return M?M._promise(null,function(te,J){J(ue)}):kt(ue)}var Z=(function ue(te,J,ee,ae,oe){return He.resolve().then(function(){var pe=qe.transless||qe,re=te._createTransaction(J,ee,te._dbSchema,ae),pe=(re.explicit=!0,{trans:re,transless:pe});if(ae)re.idbtrans=ae.idbtrans;else try{re.create(),re.idbtrans._explicit=!0,te._state.PR1398_maxLoop=3}catch(ve){return ve.name===_e.InvalidState&&te.isOpen()&&0<--te._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),te.close({disableAutoOpen:!1}),te.open().then(function(){return ue(te,J,ee,null,oe)})):kt(ve)}var se,ge=A(oe),pe=(ge&&Gn(),He.follow(function(){var ve;(se=oe.call(re,re))&&(ge?(ve=z.bind(null,null),se.then(ve,ve)):typeof se.next=="function"&&typeof se.throw=="function"&&(se=Ks(se)))},pe));return(se&&typeof se.then=="function"?He.resolve(se).then(function(ve){return re.active?ve:kt(new ke.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))}):pe.then(function(){return se})).then(function(ve){return ae&&re._resolve(),re._completion.then(function(){return ve})}).catch(function(ve){return re._reject(ve),kt(ve)})})}).bind(null,this,v,_,M,m);return M?M._promise(v,Z,"lock"):qe.trans?Ht(qe.transless,function(){return N._whenReady(Z)}):this._whenReady(Z)},Lt.prototype.table=function(a){if(w(this._allTables,a))return this._allTables[a];throw new ke.InvalidTable("Table ".concat(a," does not exist"))};var Pr=Lt;function Lt(a,f){var m,v,_,N,M,O=this,Z=(this._middlewares={},this.verno=0,Lt.dependencies),Z=(this._options=f=s({addons:Lt.addons,autoOpen:!0,indexedDB:Z.indexedDB,IDBKeyRange:Z.IDBKeyRange,cache:"cloned",maxConnections:1e3},f),this._deps={indexedDB:f.indexedDB,IDBKeyRange:f.IDBKeyRange},f.addons),ue=(this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null,this._novip=this,{dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:Re,dbReadyPromise:null,cancelOpen:Re,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3,autoOpen:f.autoOpen}),te=(ue.dbReadyPromise=new He(function(J){ue.dbReadyResolve=J}),ue.openCanceller=new He(function(J,ee){ue.cancelOpen=ee}),this._state=ue,this.name=a,this.on=Vr(this,"populate","blocked","versionchange","close",{ready:[Rt,Re]}),this.once=function(J,ee){var ae=function(){for(var oe=[],re=0;re<arguments.length;re++)oe[re]=arguments[re];O.on(J).unsubscribe(ae),ee.apply(O,oe)};return O.on(J,ae)},this.on.ready.subscribe=P(this.on.ready.subscribe,function(J){return function(ee,ae){Lt.vip(function(){var oe,re=O._state;re.openComplete?(re.dbOpenError||He.resolve().then(ee),ae&&J(ee)):re.onReadyBeingFired?(re.onReadyBeingFired.push(ee),ae&&J(ee)):(J(ee),oe=O,ae||J(function se(){oe.on.ready.unsubscribe(ee),oe.on.ready.unsubscribe(se)}))})}}),this.Collection=(m=this,lo(Ba.prototype,function(se,re){this.db=m;var ae=di,oe=null;if(re)try{ae=re()}catch(pe){oe=pe}var re=se._ctx,se=re.table,ge=se.hook.reading.fire;this._ctx={table:se,index:re.index,isPrimKey:!re.index||se.schema.primKey.keyPath&&re.index===se.schema.primKey.name,range:ae,keysOnly:!1,dir:"next",unique:"",algorithm:null,filter:null,replayFilter:null,justLimit:!0,isMatch:null,offset:0,limit:1/0,error:oe,or:re.or,valueMapper:ge!==Ue?ge:null}})),this.Table=(v=this,lo(er.prototype,function(J,ee,ae){this.db=v,this._tx=ae,this.name=J,this.schema=ee,this.hook=v._allTables[J]?v._allTables[J].hook:Vr(null,{creating:[it,Re],reading:[lt,Ue],updating:[qt,Re],deleting:[Ct,Re]})})),this.Transaction=(_=this,lo(Ou.prototype,function(J,ee,ae,oe,re){var se=this;J!=="readonly"&&ee.forEach(function(ge){ge=(ge=ae[ge])==null?void 0:ge.yProps,ge&&(ee=ee.concat(ge.map(function(pe){return pe.updatesTable})))}),this.db=_,this.mode=J,this.storeNames=ee,this.schema=ae,this.chromeTransactionDurability=oe,this.idbtrans=null,this.on=Vr(this,"complete","error","abort"),this.parent=re||null,this.active=!0,this._reculock=0,this._blockedFuncs=[],this._resolve=null,this._reject=null,this._waitingFor=null,this._waitingQueue=null,this._spinCount=0,this._completion=new He(function(ge,pe){se._resolve=ge,se._reject=pe}),this._completion.then(function(){se.active=!1,se.on.complete.fire()},function(ge){var pe=se.active;return se.active=!1,se.on.error.fire(ge),se.parent?se.parent._reject(ge):pe&&se.idbtrans&&se.idbtrans.abort(),kt(ge)})})),this.Version=(N=this,lo(vi.prototype,function(J){this.db=N,this._cfg={version:J,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}})),this.WhereClause=(M=this,lo(Nr.prototype,function(J,ee,ae){if(this.db=M,this._ctx={table:J,index:ee===":id"?null:ee,or:ae},this._cmp=this._ascending=ft,this._descending=function(oe,re){return ft(re,oe)},this._max=function(oe,re){return 0<ft(oe,re)?oe:re},this._min=function(oe,re){return ft(oe,re)<0?oe:re},this._IDBKeyRange=M._deps.IDBKeyRange,!this._IDBKeyRange)throw new ke.MissingAPI})),this.on("versionchange",function(J){0<J.newVersion?console.warn("Another connection wants to upgrade database '".concat(O.name,"'. Closing db now to resume the upgrade.")):console.warn("Another connection wants to delete database '".concat(O.name,"'. Closing db now to resume the delete request.")),O.close({disableAutoOpen:!1})}),this.on("blocked",function(J){!J.newVersion||J.newVersion<J.oldVersion?console.warn("Dexie.delete('".concat(O.name,"') was blocked")):console.warn("Upgrade '".concat(O.name,"' blocked by other connection holding version ").concat(J.oldVersion/10))}),this._maxKey=Er(f.IDBKeyRange),this._createTransaction=function(J,ee,ae,oe){return new O.Transaction(J,ee,ae,O._options.chromeTransactionDurability,oe)},this._fireOnBlocked=function(J){O.on("blocked").fire(J),mo.toArray().filter(function(ee){return ee.name===O.name&&ee!==O&&!ee._state.vcFired}).map(function(ee){return ee.on("versionchange").fire(J)})},this.use(zu),this.use(Ja),this.use(Ys),this.use(qa),this.use(Du),new Proxy(this,{get:function(J,ee,ae){var oe;return ee==="_vip"||(ee==="table"?function(re){return jr(O.table(re),te)}:(oe=Reflect.get(J,ee,ae))instanceof er?jr(oe,te):ee==="tables"?oe.map(function(re){return jr(re,te)}):ee==="_createTransaction"?function(){return jr(oe.apply(this,arguments),te)}:oe)}}));this.vip=te,Z.forEach(function(J){return J(O)})}var rs,yo=typeof Symbol<"u"&&"observable"in Symbol?Symbol.observable:"@@observable",Za=(vo.prototype.subscribe=function(a,f,m){return this._subscribe(a&&typeof a!="function"?a:{next:a,error:f,complete:m})},vo.prototype[yo]=function(){return this},vo);function vo(a){this._subscribe=a}try{rs={indexedDB:c.indexedDB||c.mozIndexedDB||c.webkitIndexedDB||c.msIndexedDB,IDBKeyRange:c.IDBKeyRange||c.webkitIDBKeyRange}}catch{rs={indexedDB:null,IDBKeyRange:null}}function qo(a){var f,m=!1,v=new Za(function(_){var N=A(a),M,O=!1,Z={},ue={},te={get closed(){return O},unsubscribe:function(){O||(O=!0,M&&M.abort(),J&&Ln.storagemutated.unsubscribe(oe))}},J=(_.start&&_.start(te),!1),ee=function(){return Mn(re)};function ae(){return Bs(ue,Z)}var oe=function(se){Zi(Z,se),ae()&&ee()},re=function(){var se,ge,pe;!O&&rs.indexedDB&&(Z={},se={},M&&M.abort(),M=new AbortController,pe=(ve=>{var Ne=On();try{N&&Gn();var Ce=gn(a,ve);return Ce=N?Ce.finally(z):Ce}finally{Ne&&Wn()}})(ge={subscr:se,signal:M.signal,requery:ee,querier:a,trans:null}),J||(Ln(hi,oe),J=!0),Promise.resolve(pe).then(function(ve){m=!0,f=ve,O||ge.signal.aborted||(ae()||(ue=se,ae())?ee():(Z={},Mn(function(){return!O&&_.next&&_.next(ve)})))},function(ve){m=!1,["DatabaseClosedError","AbortError"].includes(ve==null?void 0:ve.name)||O||Mn(function(){O||_.error&&_.error(ve)})}))};return setTimeout(ee,0),te});return v.hasValue=function(){return m},v.getValue=function(){return f},v}var xo=Pr;function Wo(a){var f=Mr;try{Mr=!0,Ln.storagemutated.fire(a),Us(a,!0)}finally{Mr=f}}S(xo,s(s({},K),{delete:function(a){return new xo(a,{addons:[]}).delete()},exists:function(a){return new xo(a,{addons:[]}).open().then(function(f){return f.close(),!0}).catch("NoSuchDatabaseError",function(){return!1})},getDatabaseNames:function(a){try{return f=xo.dependencies,m=f.indexedDB,f=f.IDBKeyRange,(go(m)?Promise.resolve(m.databases()).then(function(v){return v.map(function(_){return _.name}).filter(function(_){return _!==Jn})}):xi(m,f).toCollection().primaryKeys()).then(a)}catch{return kt(new ke.MissingAPI)}var f,m},defineClass:function(){return function(a){y(this,a)}},ignoreTransaction:function(a){return qe.trans?Ht(qe.transless||Cn,a):a()},vip:Uo,async:function(a){return function(){try{var f=Ks(a.apply(this,arguments));return f&&typeof f.then=="function"?f:He.resolve(f)}catch(m){return kt(m)}}},spawn:function(a,f,m){try{var v=Ks(a.apply(m,f||[]));return v&&typeof v.then=="function"?v:He.resolve(v)}catch(_){return kt(_)}},currentTransaction:{get:function(){return qe.trans||null}},waitFor:function(a,f){return a=He.resolve(typeof a=="function"?xo.ignoreTransaction(a):a).timeout(f||6e4),qe.trans?qe.trans.waitFor(a):a},Promise:He,debug:{get:function(){return Nt},set:function(a){pn(a)}},derive:$,extend:y,props:S,override:P,Events:Vr,on:Ln,liveQuery:qo,extendObservabilitySet:Zi,getByKeyPath:V,setByKeyPath:Q,delByKeyPath:function(a,f){typeof f=="string"?Q(a,f,void 0):"length"in f&&[].map.call(f,function(m){Q(a,m,void 0)})},shallowClone:ce,deepClone:xe,getObjectDiff:qs,cmp:ft,asap:H,minKey:-1/0,addons:[],connections:{get:mo.toArray},errnames:_e,dependencies:rs,cache:Wr,semVer:"4.4.2",version:"4.4.2".split(".").map(function(a){return parseInt(a)}).reduce(function(a,f,m){return a+f/Math.pow(10,2*m)})})),xo.maxKey=Er(xo.dependencies.IDBKeyRange),typeof dispatchEvent<"u"&&typeof addEventListener<"u"&&(Ln(hi,function(a){Mr||(a=new CustomEvent(Ui,{detail:a}),Mr=!0,dispatchEvent(a),Mr=!1)}),addEventListener(Ui,function(a){a=a.detail,Mr||Wo(a)}));var Yo,Mr=!1,os=function(){};return typeof BroadcastChannel<"u"&&((os=function(){(Yo=new BroadcastChannel(Ui)).onmessage=function(a){return a.data&&Wo(a.data)}})(),typeof Yo.unref=="function"&&Yo.unref(),Ln(hi,function(a){Mr||Yo.postMessage(a)})),typeof addEventListener<"u"&&(addEventListener("pagehide",function(a){if(!Pr.disableBfCache&&a.persisted){Nt&&console.debug("Dexie: handling persisted pagehide"),Yo!=null&&Yo.close();for(var f=0,m=mo.toArray();f<m.length;f++)m[f].close({disableAutoOpen:!1})}}),addEventListener("pageshow",function(a){!Pr.disableBfCache&&a.persisted&&(Nt&&console.debug("Dexie: handling persisted pageshow"),os(),Wo({all:new en(-1/0,[[]])}))})),He.rejectionMapper=function(a,f){return!a||a instanceof Se||a instanceof TypeError||a instanceof SyntaxError||!a.name||!Be[a.name]?a:(f=new Be[a.name](f||a.message,a),"stack"in a&&j(f,"stack",{get:function(){return this.inner.stack}}),f)},pn(Nt),s(Pr,Object.freeze({__proto__:null,DEFAULT_MAX_CONNECTIONS:1e3,Dexie:Pr,Entity:$n,PropModification:io,RangeSet:en,add:function(a){return new io({add:a})},cmp:ft,default:Pr,liveQuery:qo,mergeRanges:bi,rangesOverlap:Gi,remove:function(a){return new io({remove:a})},replacePrefix:function(a,f){return new io({replacePrefix:[a,f]})}}),{default:Pr}),Pr})})(eu)),eu.exports}var Vy=Hy();const wf=wu(Vy),nh=Symbol.for("Dexie"),lu=globalThis[nh]||(globalThis[nh]=wf);if(wf.semVer!==lu.semVer)throw new Error(`Two different versions of Dexie loaded in the same app: ${wf.semVer} and ${lu.semVer}`);const{liveQuery:Zk,mergeRanges:e2,rangesOverlap:t2,RangeSet:n2,cmp:r2,Entity:o2,PropModification:i2,replacePrefix:s2,add:a2,remove:l2,DexieYProvider:u2}=lu;class Uy extends lu{constructor(){super("api-doc-tor");ga(this,"flows");ga(this,"testSuites");ga(this,"environments");ga(this,"kv");this.version(1).stores({flows:"++id, name",testSuites:"++id, name",environments:"++id, name",kv:"key"})}}const St=new Uy;async function Ky(){const[t,r,i]=await Promise.all([St.flows.toArray(),St.testSuites.toArray(),St.environments.toArray()]),s=await St.kv.get("authTokens");let l;try{l=s!=null&&s.value?JSON.parse(s.value):void 0}catch{l=void 0}return{formatVersion:1,exportedAt:new Date().toISOString(),flows:t,testSuites:r,environments:i,authTokens:l}}async function _m(t){await St.transaction("rw",St.flows,St.testSuites,St.environments,St.kv,async()=>{await St.flows.clear(),await St.testSuites.clear(),await St.environments.clear();for(const r of t.flows)await St.flows.add({name:r.name,steps:r.steps,graph:r.graph});for(const r of t.testSuites)await St.testSuites.add({name:r.name,cases:r.cases});for(const r of t.environments)await St.environments.add({name:r.name,baseUrl:r.baseUrl,vars:r.vars??{}});t.authTokens&&await St.kv.put({key:"authTokens",value:JSON.stringify(t.authTokens)})})}async function qy(t){if(t.formatVersion!==1)return!1;const[r,i]=await Promise.all([St.flows.count(),St.testSuites.count()]);return r>0||i>0?!1:(await _m(t),!0)}function Wy(t,r,i){var d,h;const s=[],l=r===t.expectStatus;if(s.push(`HTTP ${r} ${l?"✓":`✗ (esperado ${t.expectStatus})`}`),!l)return{pass:!1,lines:s};if((d=t.contains)!=null&&d.trim()){const y=i.includes(t.contains);if(s.push(`Contiene texto "${t.contains}": ${y?"✓":"✗"}`),!y)return{pass:!1,lines:s}}const c=(h=t.jsonPath)==null?void 0:h.trim();if(c){let y;try{y=JSON.parse(i)}catch{return s.push("Body no es JSON válido: ✗"),{pass:!1,lines:s}}const b=Rf(y,c),k=t.expectJsonValue;if(k!==void 0&&k!==""){const w=b==null?String(b):typeof b=="object"?JSON.stringify(b):String(b),S=k.trim(),C=w===S||String(b)===S;if(s.push(`JSON path ${c} → ${w} vs "${S}": ${C?"✓":"✗"}`),!C)return{pass:!1,lines:s}}else{const w=b!=null;if(s.push(`JSON path ${c} existe: ${w?"✓":"✗"}`),!w)return{pass:!1,lines:s}}}return{pass:!0,lines:s}}function Kt(t){if(typeof t=="string"||typeof t=="number")return""+t;let r="";if(Array.isArray(t))for(let i=0,s;i<t.length;i++)(s=Kt(t[i]))!==""&&(r+=(r&&" ")+s);else for(let i in t)t[i]&&(r+=(r&&" ")+i);return r}var Yy={value:()=>{}};function ku(){for(var t=0,r=arguments.length,i={},s;t<r;++t){if(!(s=arguments[t]+"")||s in i||/[\s.]/.test(s))throw new Error("illegal type: "+s);i[s]=[]}return new tu(i)}function tu(t){this._=t}function Xy(t,r){return t.trim().split(/^|\s+/).map(function(i){var s="",l=i.indexOf(".");if(l>=0&&(s=i.slice(l+1),i=i.slice(0,l)),i&&!r.hasOwnProperty(i))throw new Error("unknown type: "+i);return{type:i,name:s}})}tu.prototype=ku.prototype={constructor:tu,on:function(t,r){var i=this._,s=Xy(t+"",i),l,c=-1,d=s.length;if(arguments.length<2){for(;++c<d;)if((l=(t=s[c]).type)&&(l=Qy(i[l],t.name)))return l;return}if(r!=null&&typeof r!="function")throw new Error("invalid callback: "+r);for(;++c<d;)if(l=(t=s[c]).type)i[l]=rh(i[l],t.name,r);else if(r==null)for(l in i)i[l]=rh(i[l],t.name,null);return this},copy:function(){var t={},r=this._;for(var i in r)t[i]=r[i].slice();return new tu(t)},call:function(t,r){if((l=arguments.length-2)>0)for(var i=new Array(l),s=0,l,c;s<l;++s)i[s]=arguments[s+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(c=this._[t],s=0,l=c.length;s<l;++s)c[s].value.apply(r,i)},apply:function(t,r,i){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var s=this._[t],l=0,c=s.length;l<c;++l)s[l].value.apply(r,i)}};function Qy(t,r){for(var i=0,s=t.length,l;i<s;++i)if((l=t[i]).name===r)return l.value}function rh(t,r,i){for(var s=0,l=t.length;s<l;++s)if(t[s].name===r){t[s]=Yy,t=t.slice(0,s).concat(t.slice(s+1));break}return i!=null&&t.push({name:r,value:i}),t}var bf="http://www.w3.org/1999/xhtml";const oh={svg:"http://www.w3.org/2000/svg",xhtml:bf,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Nu(t){var r=t+="",i=r.indexOf(":");return i>=0&&(r=t.slice(0,i))!=="xmlns"&&(t=t.slice(i+1)),oh.hasOwnProperty(r)?{space:oh[r],local:t}:t}function Gy(t){return function(){var r=this.ownerDocument,i=this.namespaceURI;return i===bf&&r.documentElement.namespaceURI===bf?r.createElement(t):r.createElementNS(i,t)}}function Jy(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function Sm(t){var r=Nu(t);return(r.local?Jy:Gy)(r)}function Zy(){}function Lf(t){return t==null?Zy:function(){return this.querySelector(t)}}function ev(t){typeof t!="function"&&(t=Lf(t));for(var r=this._groups,i=r.length,s=new Array(i),l=0;l<i;++l)for(var c=r[l],d=c.length,h=s[l]=new Array(d),y,b,k=0;k<d;++k)(y=c[k])&&(b=t.call(y,y.__data__,k,c))&&("__data__"in y&&(b.__data__=y.__data__),h[k]=b);return new sr(s,this._parents)}function tv(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function nv(){return[]}function km(t){return t==null?nv:function(){return this.querySelectorAll(t)}}function rv(t){return function(){return tv(t.apply(this,arguments))}}function ov(t){typeof t=="function"?t=rv(t):t=km(t);for(var r=this._groups,i=r.length,s=[],l=[],c=0;c<i;++c)for(var d=r[c],h=d.length,y,b=0;b<h;++b)(y=d[b])&&(s.push(t.call(y,y.__data__,b,d)),l.push(y));return new sr(s,l)}function Nm(t){return function(){return this.matches(t)}}function Em(t){return function(r){return r.matches(t)}}var iv=Array.prototype.find;function sv(t){return function(){return iv.call(this.children,t)}}function av(){return this.firstElementChild}function lv(t){return this.select(t==null?av:sv(typeof t=="function"?t:Em(t)))}var uv=Array.prototype.filter;function cv(){return Array.from(this.children)}function fv(t){return function(){return uv.call(this.children,t)}}function dv(t){return this.selectAll(t==null?cv:fv(typeof t=="function"?t:Em(t)))}function pv(t){typeof t!="function"&&(t=Nm(t));for(var r=this._groups,i=r.length,s=new Array(i),l=0;l<i;++l)for(var c=r[l],d=c.length,h=s[l]=[],y,b=0;b<d;++b)(y=c[b])&&t.call(y,y.__data__,b,c)&&h.push(y);return new sr(s,this._parents)}function Cm(t){return new Array(t.length)}function hv(){return new sr(this._enter||this._groups.map(Cm),this._parents)}function uu(t,r){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=r}uu.prototype={constructor:uu,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,r){return this._parent.insertBefore(t,r)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function mv(t){return function(){return t}}function gv(t,r,i,s,l,c){for(var d=0,h,y=r.length,b=c.length;d<b;++d)(h=r[d])?(h.__data__=c[d],s[d]=h):i[d]=new uu(t,c[d]);for(;d<y;++d)(h=r[d])&&(l[d]=h)}function yv(t,r,i,s,l,c,d){var h,y,b=new Map,k=r.length,w=c.length,S=new Array(k),C;for(h=0;h<k;++h)(y=r[h])&&(S[h]=C=d.call(y,y.__data__,h,r)+"",b.has(C)?l[h]=y:b.set(C,y));for(h=0;h<w;++h)C=d.call(t,c[h],h,c)+"",(y=b.get(C))?(s[h]=y,y.__data__=c[h],b.delete(C)):i[h]=new uu(t,c[h]);for(h=0;h<k;++h)(y=r[h])&&b.get(S[h])===y&&(l[h]=y)}function vv(t){return t.__data__}function xv(t,r){if(!arguments.length)return Array.from(this,vv);var i=r?yv:gv,s=this._parents,l=this._groups;typeof t!="function"&&(t=mv(t));for(var c=l.length,d=new Array(c),h=new Array(c),y=new Array(c),b=0;b<c;++b){var k=s[b],w=l[b],S=w.length,C=wv(t.call(k,k&&k.__data__,b,s)),j=C.length,$=h[b]=new Array(j),T=d[b]=new Array(j),I=y[b]=new Array(S);i(k,w,$,T,I,C,r);for(var U=0,P=0,R,H;U<j;++U)if(R=$[U]){for(U>=P&&(P=U+1);!(H=T[P])&&++P<j;);R._next=H||null}}return d=new sr(d,s),d._enter=h,d._exit=y,d}function wv(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function bv(){return new sr(this._exit||this._groups.map(Cm),this._parents)}function _v(t,r,i){var s=this.enter(),l=this,c=this.exit();return typeof t=="function"?(s=t(s),s&&(s=s.selection())):s=s.append(t+""),r!=null&&(l=r(l),l&&(l=l.selection())),i==null?c.remove():i(c),s&&l?s.merge(l).order():l}function Sv(t){for(var r=t.selection?t.selection():t,i=this._groups,s=r._groups,l=i.length,c=s.length,d=Math.min(l,c),h=new Array(l),y=0;y<d;++y)for(var b=i[y],k=s[y],w=b.length,S=h[y]=new Array(w),C,j=0;j<w;++j)(C=b[j]||k[j])&&(S[j]=C);for(;y<l;++y)h[y]=i[y];return new sr(h,this._parents)}function kv(){for(var t=this._groups,r=-1,i=t.length;++r<i;)for(var s=t[r],l=s.length-1,c=s[l],d;--l>=0;)(d=s[l])&&(c&&d.compareDocumentPosition(c)^4&&c.parentNode.insertBefore(d,c),c=d);return this}function Nv(t){t||(t=Ev);function r(w,S){return w&&S?t(w.__data__,S.__data__):!w-!S}for(var i=this._groups,s=i.length,l=new Array(s),c=0;c<s;++c){for(var d=i[c],h=d.length,y=l[c]=new Array(h),b,k=0;k<h;++k)(b=d[k])&&(y[k]=b);y.sort(r)}return new sr(l,this._parents).order()}function Ev(t,r){return t<r?-1:t>r?1:t>=r?0:NaN}function Cv(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function jv(){return Array.from(this)}function Pv(){for(var t=this._groups,r=0,i=t.length;r<i;++r)for(var s=t[r],l=0,c=s.length;l<c;++l){var d=s[l];if(d)return d}return null}function Mv(){let t=0;for(const r of this)++t;return t}function $v(){return!this.node()}function Tv(t){for(var r=this._groups,i=0,s=r.length;i<s;++i)for(var l=r[i],c=0,d=l.length,h;c<d;++c)(h=l[c])&&t.call(h,h.__data__,c,l);return this}function Iv(t){return function(){this.removeAttribute(t)}}function Av(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Ov(t,r){return function(){this.setAttribute(t,r)}}function Rv(t,r){return function(){this.setAttributeNS(t.space,t.local,r)}}function Lv(t,r){return function(){var i=r.apply(this,arguments);i==null?this.removeAttribute(t):this.setAttribute(t,i)}}function Dv(t,r){return function(){var i=r.apply(this,arguments);i==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,i)}}function zv(t,r){var i=Nu(t);if(arguments.length<2){var s=this.node();return i.local?s.getAttributeNS(i.space,i.local):s.getAttribute(i)}return this.each((r==null?i.local?Av:Iv:typeof r=="function"?i.local?Dv:Lv:i.local?Rv:Ov)(i,r))}function jm(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function Fv(t){return function(){this.style.removeProperty(t)}}function Bv(t,r,i){return function(){this.style.setProperty(t,r,i)}}function Hv(t,r,i){return function(){var s=r.apply(this,arguments);s==null?this.style.removeProperty(t):this.style.setProperty(t,s,i)}}function Vv(t,r,i){return arguments.length>1?this.each((r==null?Fv:typeof r=="function"?Hv:Bv)(t,r,i??"")):Ps(this.node(),t)}function Ps(t,r){return t.style.getPropertyValue(r)||jm(t).getComputedStyle(t,null).getPropertyValue(r)}function Uv(t){return function(){delete this[t]}}function Kv(t,r){return function(){this[t]=r}}function qv(t,r){return function(){var i=r.apply(this,arguments);i==null?delete this[t]:this[t]=i}}function Wv(t,r){return arguments.length>1?this.each((r==null?Uv:typeof r=="function"?qv:Kv)(t,r)):this.node()[t]}function Pm(t){return t.trim().split(/^|\s+/)}function Df(t){return t.classList||new Mm(t)}function Mm(t){this._node=t,this._names=Pm(t.getAttribute("class")||"")}Mm.prototype={add:function(t){var r=this._names.indexOf(t);r<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var r=this._names.indexOf(t);r>=0&&(this._names.splice(r,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function $m(t,r){for(var i=Df(t),s=-1,l=r.length;++s<l;)i.add(r[s])}function Tm(t,r){for(var i=Df(t),s=-1,l=r.length;++s<l;)i.remove(r[s])}function Yv(t){return function(){$m(this,t)}}function Xv(t){return function(){Tm(this,t)}}function Qv(t,r){return function(){(r.apply(this,arguments)?$m:Tm)(this,t)}}function Gv(t,r){var i=Pm(t+"");if(arguments.length<2){for(var s=Df(this.node()),l=-1,c=i.length;++l<c;)if(!s.contains(i[l]))return!1;return!0}return this.each((typeof r=="function"?Qv:r?Yv:Xv)(i,r))}function Jv(){this.textContent=""}function Zv(t){return function(){this.textContent=t}}function ex(t){return function(){var r=t.apply(this,arguments);this.textContent=r??""}}function tx(t){return arguments.length?this.each(t==null?Jv:(typeof t=="function"?ex:Zv)(t)):this.node().textContent}function nx(){this.innerHTML=""}function rx(t){return function(){this.innerHTML=t}}function ox(t){return function(){var r=t.apply(this,arguments);this.innerHTML=r??""}}function ix(t){return arguments.length?this.each(t==null?nx:(typeof t=="function"?ox:rx)(t)):this.node().innerHTML}function sx(){this.nextSibling&&this.parentNode.appendChild(this)}function ax(){return this.each(sx)}function lx(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function ux(){return this.each(lx)}function cx(t){var r=typeof t=="function"?t:Sm(t);return this.select(function(){return this.appendChild(r.apply(this,arguments))})}function fx(){return null}function dx(t,r){var i=typeof t=="function"?t:Sm(t),s=r==null?fx:typeof r=="function"?r:Lf(r);return this.select(function(){return this.insertBefore(i.apply(this,arguments),s.apply(this,arguments)||null)})}function px(){var t=this.parentNode;t&&t.removeChild(this)}function hx(){return this.each(px)}function mx(){var t=this.cloneNode(!1),r=this.parentNode;return r?r.insertBefore(t,this.nextSibling):t}function gx(){var t=this.cloneNode(!0),r=this.parentNode;return r?r.insertBefore(t,this.nextSibling):t}function yx(t){return this.select(t?gx:mx)}function vx(t){return arguments.length?this.property("__data__",t):this.node().__data__}function xx(t){return function(r){t.call(this,r,this.__data__)}}function wx(t){return t.trim().split(/^|\s+/).map(function(r){var i="",s=r.indexOf(".");return s>=0&&(i=r.slice(s+1),r=r.slice(0,s)),{type:r,name:i}})}function bx(t){return function(){var r=this.__on;if(r){for(var i=0,s=-1,l=r.length,c;i<l;++i)c=r[i],(!t.type||c.type===t.type)&&c.name===t.name?this.removeEventListener(c.type,c.listener,c.options):r[++s]=c;++s?r.length=s:delete this.__on}}}function _x(t,r,i){return function(){var s=this.__on,l,c=xx(r);if(s){for(var d=0,h=s.length;d<h;++d)if((l=s[d]).type===t.type&&l.name===t.name){this.removeEventListener(l.type,l.listener,l.options),this.addEventListener(l.type,l.listener=c,l.options=i),l.value=r;return}}this.addEventListener(t.type,c,i),l={type:t.type,name:t.name,value:r,listener:c,options:i},s?s.push(l):this.__on=[l]}}function Sx(t,r,i){var s=wx(t+""),l,c=s.length,d;if(arguments.length<2){var h=this.node().__on;if(h){for(var y=0,b=h.length,k;y<b;++y)for(l=0,k=h[y];l<c;++l)if((d=s[l]).type===k.type&&d.name===k.name)return k.value}return}for(h=r?_x:bx,l=0;l<c;++l)this.each(h(s[l],r,i));return this}function Im(t,r,i){var s=jm(t),l=s.CustomEvent;typeof l=="function"?l=new l(r,i):(l=s.document.createEvent("Event"),i?(l.initEvent(r,i.bubbles,i.cancelable),l.detail=i.detail):l.initEvent(r,!1,!1)),t.dispatchEvent(l)}function kx(t,r){return function(){return Im(this,t,r)}}function Nx(t,r){return function(){return Im(this,t,r.apply(this,arguments))}}function Ex(t,r){return this.each((typeof r=="function"?Nx:kx)(t,r))}function*Cx(){for(var t=this._groups,r=0,i=t.length;r<i;++r)for(var s=t[r],l=0,c=s.length,d;l<c;++l)(d=s[l])&&(yield d)}var Am=[null];function sr(t,r){this._groups=t,this._parents=r}function Aa(){return new sr([[document.documentElement]],Am)}function jx(){return this}sr.prototype=Aa.prototype={constructor:sr,select:ev,selectAll:ov,selectChild:lv,selectChildren:dv,filter:pv,data:xv,enter:hv,exit:bv,join:_v,merge:Sv,selection:jx,order:kv,sort:Nv,call:Cv,nodes:jv,node:Pv,size:Mv,empty:$v,each:Tv,attr:zv,style:Vv,property:Wv,classed:Gv,text:tx,html:ix,raise:ax,lower:ux,append:cx,insert:dx,remove:hx,clone:yx,datum:vx,on:Sx,dispatch:Ex,[Symbol.iterator]:Cx};function ir(t){return typeof t=="string"?new sr([[document.querySelector(t)]],[document.documentElement]):new sr([[t]],Am)}function Px(t){let r;for(;r=t.sourceEvent;)t=r;return t}function Rr(t,r){if(t=Px(t),r===void 0&&(r=t.currentTarget),r){var i=r.ownerSVGElement||r;if(i.createSVGPoint){var s=i.createSVGPoint();return s.x=t.clientX,s.y=t.clientY,s=s.matrixTransform(r.getScreenCTM().inverse()),[s.x,s.y]}if(r.getBoundingClientRect){var l=r.getBoundingClientRect();return[t.clientX-l.left-r.clientLeft,t.clientY-l.top-r.clientTop]}}return[t.pageX,t.pageY]}const Mx={passive:!1},ka={capture:!0,passive:!1};function nf(t){t.stopImmediatePropagation()}function Cs(t){t.preventDefault(),t.stopImmediatePropagation()}function Om(t){var r=t.document.documentElement,i=ir(t).on("dragstart.drag",Cs,ka);"onselectstart"in r?i.on("selectstart.drag",Cs,ka):(r.__noselect=r.style.MozUserSelect,r.style.MozUserSelect="none")}function Rm(t,r){var i=t.document.documentElement,s=ir(t).on("dragstart.drag",null);r&&(s.on("click.drag",Cs,ka),setTimeout(function(){s.on("click.drag",null)},0)),"onselectstart"in i?s.on("selectstart.drag",null):(i.style.MozUserSelect=i.__noselect,delete i.__noselect)}const Ul=t=>()=>t;function _f(t,{sourceEvent:r,subject:i,target:s,identifier:l,active:c,x:d,y:h,dx:y,dy:b,dispatch:k}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:r,enumerable:!0,configurable:!0},subject:{value:i,enumerable:!0,configurable:!0},target:{value:s,enumerable:!0,configurable:!0},identifier:{value:l,enumerable:!0,configurable:!0},active:{value:c,enumerable:!0,configurable:!0},x:{value:d,enumerable:!0,configurable:!0},y:{value:h,enumerable:!0,configurable:!0},dx:{value:y,enumerable:!0,configurable:!0},dy:{value:b,enumerable:!0,configurable:!0},_:{value:k}})}_f.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};function $x(t){return!t.ctrlKey&&!t.button}function Tx(){return this.parentNode}function Ix(t,r){return r??{x:t.x,y:t.y}}function Ax(){return navigator.maxTouchPoints||"ontouchstart"in this}function Lm(){var t=$x,r=Tx,i=Ix,s=Ax,l={},c=ku("start","drag","end"),d=0,h,y,b,k,w=0;function S(R){R.on("mousedown.drag",C).filter(s).on("touchstart.drag",T).on("touchmove.drag",I,Mx).on("touchend.drag touchcancel.drag",U).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function C(R,H){if(!(k||!t.call(this,R,H))){var V=P(this,r.call(this,R,H),R,H,"mouse");V&&(ir(R.view).on("mousemove.drag",j,ka).on("mouseup.drag",$,ka),Om(R.view),nf(R),b=!1,h=R.clientX,y=R.clientY,V("start",R))}}function j(R){if(Cs(R),!b){var H=R.clientX-h,V=R.clientY-y;b=H*H+V*V>w}l.mouse("drag",R)}function $(R){ir(R.view).on("mousemove.drag mouseup.drag",null),Rm(R.view,b),Cs(R),l.mouse("end",R)}function T(R,H){if(t.call(this,R,H)){var V=R.changedTouches,Q=r.call(this,R,H),ce=V.length,de,we;for(de=0;de<ce;++de)(we=P(this,Q,R,H,V[de].identifier,V[de]))&&(nf(R),we("start",R,V[de]))}}function I(R){var H=R.changedTouches,V=H.length,Q,ce;for(Q=0;Q<V;++Q)(ce=l[H[Q].identifier])&&(Cs(R),ce("drag",R,H[Q]))}function U(R){var H=R.changedTouches,V=H.length,Q,ce;for(k&&clearTimeout(k),k=setTimeout(function(){k=null},500),Q=0;Q<V;++Q)(ce=l[H[Q].identifier])&&(nf(R),ce("end",R,H[Q]))}function P(R,H,V,Q,ce,de){var we=c.copy(),q=Rr(de||V,H),fe,xe,L;if((L=i.call(R,new _f("beforestart",{sourceEvent:V,target:S,identifier:ce,active:d,x:q[0],y:q[1],dx:0,dy:0,dispatch:we}),Q))!=null)return fe=L.x-q[0]||0,xe=L.y-q[1]||0,function le(G,ie,F){var W=q,B;switch(G){case"start":l[ce]=le,B=d++;break;case"end":delete l[ce],--d;case"drag":q=Rr(F||ie,H),B=d;break}we.call(G,R,new _f(G,{sourceEvent:ie,subject:L,target:S,identifier:ce,active:B,x:q[0]+fe,y:q[1]+xe,dx:q[0]-W[0],dy:q[1]-W[1],dispatch:we}),Q)}}return S.filter=function(R){return arguments.length?(t=typeof R=="function"?R:Ul(!!R),S):t},S.container=function(R){return arguments.length?(r=typeof R=="function"?R:Ul(R),S):r},S.subject=function(R){return arguments.length?(i=typeof R=="function"?R:Ul(R),S):i},S.touchable=function(R){return arguments.length?(s=typeof R=="function"?R:Ul(!!R),S):s},S.on=function(){var R=c.on.apply(c,arguments);return R===c?S:R},S.clickDistance=function(R){return arguments.length?(w=(R=+R)*R,S):Math.sqrt(w)},S}function zf(t,r,i){t.prototype=r.prototype=i,i.constructor=t}function Dm(t,r){var i=Object.create(t.prototype);for(var s in r)i[s]=r[s];return i}function Oa(){}var Na=.7,cu=1/Na,js="\\s*([+-]?\\d+)\\s*",Ea="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Zr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Ox=/^#([0-9a-f]{3,8})$/,Rx=new RegExp(`^rgb\\(${js},${js},${js}\\)$`),Lx=new RegExp(`^rgb\\(${Zr},${Zr},${Zr}\\)$`),Dx=new RegExp(`^rgba\\(${js},${js},${js},${Ea}\\)$`),zx=new RegExp(`^rgba\\(${Zr},${Zr},${Zr},${Ea}\\)$`),Fx=new RegExp(`^hsl\\(${Ea},${Zr},${Zr}\\)$`),Bx=new RegExp(`^hsla\\(${Ea},${Zr},${Zr},${Ea}\\)$`),ih={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};zf(Oa,Di,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:sh,formatHex:sh,formatHex8:Hx,formatHsl:Vx,formatRgb:ah,toString:ah});function sh(){return this.rgb().formatHex()}function Hx(){return this.rgb().formatHex8()}function Vx(){return zm(this).formatHsl()}function ah(){return this.rgb().formatRgb()}function Di(t){var r,i;return t=(t+"").trim().toLowerCase(),(r=Ox.exec(t))?(i=r[1].length,r=parseInt(r[1],16),i===6?lh(r):i===3?new Un(r>>8&15|r>>4&240,r>>4&15|r&240,(r&15)<<4|r&15,1):i===8?Kl(r>>24&255,r>>16&255,r>>8&255,(r&255)/255):i===4?Kl(r>>12&15|r>>8&240,r>>8&15|r>>4&240,r>>4&15|r&240,((r&15)<<4|r&15)/255):null):(r=Rx.exec(t))?new Un(r[1],r[2],r[3],1):(r=Lx.exec(t))?new Un(r[1]*255/100,r[2]*255/100,r[3]*255/100,1):(r=Dx.exec(t))?Kl(r[1],r[2],r[3],r[4]):(r=zx.exec(t))?Kl(r[1]*255/100,r[2]*255/100,r[3]*255/100,r[4]):(r=Fx.exec(t))?fh(r[1],r[2]/100,r[3]/100,1):(r=Bx.exec(t))?fh(r[1],r[2]/100,r[3]/100,r[4]):ih.hasOwnProperty(t)?lh(ih[t]):t==="transparent"?new Un(NaN,NaN,NaN,0):null}function lh(t){return new Un(t>>16&255,t>>8&255,t&255,1)}function Kl(t,r,i,s){return s<=0&&(t=r=i=NaN),new Un(t,r,i,s)}function Ux(t){return t instanceof Oa||(t=Di(t)),t?(t=t.rgb(),new Un(t.r,t.g,t.b,t.opacity)):new Un}function Sf(t,r,i,s){return arguments.length===1?Ux(t):new Un(t,r,i,s??1)}function Un(t,r,i,s){this.r=+t,this.g=+r,this.b=+i,this.opacity=+s}zf(Un,Sf,Dm(Oa,{brighter(t){return t=t==null?cu:Math.pow(cu,t),new Un(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?Na:Math.pow(Na,t),new Un(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Un(Ri(this.r),Ri(this.g),Ri(this.b),fu(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:uh,formatHex:uh,formatHex8:Kx,formatRgb:ch,toString:ch}));function uh(){return`#${Oi(this.r)}${Oi(this.g)}${Oi(this.b)}`}function Kx(){return`#${Oi(this.r)}${Oi(this.g)}${Oi(this.b)}${Oi((isNaN(this.opacity)?1:this.opacity)*255)}`}function ch(){const t=fu(this.opacity);return`${t===1?"rgb(":"rgba("}${Ri(this.r)}, ${Ri(this.g)}, ${Ri(this.b)}${t===1?")":`, ${t})`}`}function fu(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Ri(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Oi(t){return t=Ri(t),(t<16?"0":"")+t.toString(16)}function fh(t,r,i,s){return s<=0?t=r=i=NaN:i<=0||i>=1?t=r=NaN:r<=0&&(t=NaN),new Lr(t,r,i,s)}function zm(t){if(t instanceof Lr)return new Lr(t.h,t.s,t.l,t.opacity);if(t instanceof Oa||(t=Di(t)),!t)return new Lr;if(t instanceof Lr)return t;t=t.rgb();var r=t.r/255,i=t.g/255,s=t.b/255,l=Math.min(r,i,s),c=Math.max(r,i,s),d=NaN,h=c-l,y=(c+l)/2;return h?(r===c?d=(i-s)/h+(i<s)*6:i===c?d=(s-r)/h+2:d=(r-i)/h+4,h/=y<.5?c+l:2-c-l,d*=60):h=y>0&&y<1?0:d,new Lr(d,h,y,t.opacity)}function qx(t,r,i,s){return arguments.length===1?zm(t):new Lr(t,r,i,s??1)}function Lr(t,r,i,s){this.h=+t,this.s=+r,this.l=+i,this.opacity=+s}zf(Lr,qx,Dm(Oa,{brighter(t){return t=t==null?cu:Math.pow(cu,t),new Lr(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?Na:Math.pow(Na,t),new Lr(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,r=isNaN(t)||isNaN(this.s)?0:this.s,i=this.l,s=i+(i<.5?i:1-i)*r,l=2*i-s;return new Un(rf(t>=240?t-240:t+120,l,s),rf(t,l,s),rf(t<120?t+240:t-120,l,s),this.opacity)},clamp(){return new Lr(dh(this.h),ql(this.s),ql(this.l),fu(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 t=fu(this.opacity);return`${t===1?"hsl(":"hsla("}${dh(this.h)}, ${ql(this.s)*100}%, ${ql(this.l)*100}%${t===1?")":`, ${t})`}`}}));function dh(t){return t=(t||0)%360,t<0?t+360:t}function ql(t){return Math.max(0,Math.min(1,t||0))}function rf(t,r,i){return(t<60?r+(i-r)*t/60:t<180?i:t<240?r+(i-r)*(240-t)/60:r)*255}const Ff=t=>()=>t;function Wx(t,r){return function(i){return t+i*r}}function Yx(t,r,i){return t=Math.pow(t,i),r=Math.pow(r,i)-t,i=1/i,function(s){return Math.pow(t+s*r,i)}}function Xx(t){return(t=+t)==1?Fm:function(r,i){return i-r?Yx(r,i,t):Ff(isNaN(r)?i:r)}}function Fm(t,r){var i=r-t;return i?Wx(t,i):Ff(isNaN(t)?r:t)}const du=(function t(r){var i=Xx(r);function s(l,c){var d=i((l=Sf(l)).r,(c=Sf(c)).r),h=i(l.g,c.g),y=i(l.b,c.b),b=Fm(l.opacity,c.opacity);return function(k){return l.r=d(k),l.g=h(k),l.b=y(k),l.opacity=b(k),l+""}}return s.gamma=t,s})(1);function Qx(t,r){r||(r=[]);var i=t?Math.min(r.length,t.length):0,s=r.slice(),l;return function(c){for(l=0;l<i;++l)s[l]=t[l]*(1-c)+r[l]*c;return s}}function Gx(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function Jx(t,r){var i=r?r.length:0,s=t?Math.min(i,t.length):0,l=new Array(s),c=new Array(i),d;for(d=0;d<s;++d)l[d]=_a(t[d],r[d]);for(;d<i;++d)c[d]=r[d];return function(h){for(d=0;d<s;++d)c[d]=l[d](h);return c}}function Zx(t,r){var i=new Date;return t=+t,r=+r,function(s){return i.setTime(t*(1-s)+r*s),i}}function Jr(t,r){return t=+t,r=+r,function(i){return t*(1-i)+r*i}}function ew(t,r){var i={},s={},l;(t===null||typeof t!="object")&&(t={}),(r===null||typeof r!="object")&&(r={});for(l in r)l in t?i[l]=_a(t[l],r[l]):s[l]=r[l];return function(c){for(l in i)s[l]=i[l](c);return s}}var kf=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,of=new RegExp(kf.source,"g");function tw(t){return function(){return t}}function nw(t){return function(r){return t(r)+""}}function Bm(t,r){var i=kf.lastIndex=of.lastIndex=0,s,l,c,d=-1,h=[],y=[];for(t=t+"",r=r+"";(s=kf.exec(t))&&(l=of.exec(r));)(c=l.index)>i&&(c=r.slice(i,c),h[d]?h[d]+=c:h[++d]=c),(s=s[0])===(l=l[0])?h[d]?h[d]+=l:h[++d]=l:(h[++d]=null,y.push({i:d,x:Jr(s,l)})),i=of.lastIndex;return i<r.length&&(c=r.slice(i),h[d]?h[d]+=c:h[++d]=c),h.length<2?y[0]?nw(y[0].x):tw(r):(r=y.length,function(b){for(var k=0,w;k<r;++k)h[(w=y[k]).i]=w.x(b);return h.join("")})}function _a(t,r){var i=typeof r,s;return r==null||i==="boolean"?Ff(r):(i==="number"?Jr:i==="string"?(s=Di(r))?(r=s,du):Bm:r instanceof Di?du:r instanceof Date?Zx:Gx(r)?Qx:Array.isArray(r)?Jx:typeof r.valueOf!="function"&&typeof r.toString!="function"||isNaN(r)?ew:Jr)(t,r)}var ph=180/Math.PI,Nf={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Hm(t,r,i,s,l,c){var d,h,y;return(d=Math.sqrt(t*t+r*r))&&(t/=d,r/=d),(y=t*i+r*s)&&(i-=t*y,s-=r*y),(h=Math.sqrt(i*i+s*s))&&(i/=h,s/=h,y/=h),t*s<r*i&&(t=-t,r=-r,y=-y,d=-d),{translateX:l,translateY:c,rotate:Math.atan2(r,t)*ph,skewX:Math.atan(y)*ph,scaleX:d,scaleY:h}}var Wl;function rw(t){const r=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return r.isIdentity?Nf:Hm(r.a,r.b,r.c,r.d,r.e,r.f)}function ow(t){return t==null||(Wl||(Wl=document.createElementNS("http://www.w3.org/2000/svg","g")),Wl.setAttribute("transform",t),!(t=Wl.transform.baseVal.consolidate()))?Nf:(t=t.matrix,Hm(t.a,t.b,t.c,t.d,t.e,t.f))}function Vm(t,r,i,s){function l(b){return b.length?b.pop()+" ":""}function c(b,k,w,S,C,j){if(b!==w||k!==S){var $=C.push("translate(",null,r,null,i);j.push({i:$-4,x:Jr(b,w)},{i:$-2,x:Jr(k,S)})}else(w||S)&&C.push("translate("+w+r+S+i)}function d(b,k,w,S){b!==k?(b-k>180?k+=360:k-b>180&&(b+=360),S.push({i:w.push(l(w)+"rotate(",null,s)-2,x:Jr(b,k)})):k&&w.push(l(w)+"rotate("+k+s)}function h(b,k,w,S){b!==k?S.push({i:w.push(l(w)+"skewX(",null,s)-2,x:Jr(b,k)}):k&&w.push(l(w)+"skewX("+k+s)}function y(b,k,w,S,C,j){if(b!==w||k!==S){var $=C.push(l(C)+"scale(",null,",",null,")");j.push({i:$-4,x:Jr(b,w)},{i:$-2,x:Jr(k,S)})}else(w!==1||S!==1)&&C.push(l(C)+"scale("+w+","+S+")")}return function(b,k){var w=[],S=[];return b=t(b),k=t(k),c(b.translateX,b.translateY,k.translateX,k.translateY,w,S),d(b.rotate,k.rotate,w,S),h(b.skewX,k.skewX,w,S),y(b.scaleX,b.scaleY,k.scaleX,k.scaleY,w,S),b=k=null,function(C){for(var j=-1,$=S.length,T;++j<$;)w[(T=S[j]).i]=T.x(C);return w.join("")}}}var iw=Vm(rw,"px, ","px)","deg)"),sw=Vm(ow,", ",")",")"),aw=1e-12;function hh(t){return((t=Math.exp(t))+1/t)/2}function lw(t){return((t=Math.exp(t))-1/t)/2}function uw(t){return((t=Math.exp(2*t))-1)/(t+1)}const nu=(function t(r,i,s){function l(c,d){var h=c[0],y=c[1],b=c[2],k=d[0],w=d[1],S=d[2],C=k-h,j=w-y,$=C*C+j*j,T,I;if($<aw)I=Math.log(S/b)/r,T=function(Q){return[h+Q*C,y+Q*j,b*Math.exp(r*Q*I)]};else{var U=Math.sqrt($),P=(S*S-b*b+s*$)/(2*b*i*U),R=(S*S-b*b-s*$)/(2*S*i*U),H=Math.log(Math.sqrt(P*P+1)-P),V=Math.log(Math.sqrt(R*R+1)-R);I=(V-H)/r,T=function(Q){var ce=Q*I,de=hh(H),we=b/(i*U)*(de*uw(r*ce+H)-lw(H));return[h+we*C,y+we*j,b*de/hh(r*ce+H)]}}return T.duration=I*1e3*r/Math.SQRT2,T}return l.rho=function(c){var d=Math.max(.001,+c),h=d*d,y=h*h;return t(d,h,y)},l})(Math.SQRT2,2,4);var Ms=0,wa=0,va=0,Um=1e3,pu,ba,hu=0,zi=0,Eu=0,Ca=typeof performance=="object"&&performance.now?performance:Date,Km=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Bf(){return zi||(Km(cw),zi=Ca.now()+Eu)}function cw(){zi=0}function mu(){this._call=this._time=this._next=null}mu.prototype=qm.prototype={constructor:mu,restart:function(t,r,i){if(typeof t!="function")throw new TypeError("callback is not a function");i=(i==null?Bf():+i)+(r==null?0:+r),!this._next&&ba!==this&&(ba?ba._next=this:pu=this,ba=this),this._call=t,this._time=i,Ef()},stop:function(){this._call&&(this._call=null,this._time=1/0,Ef())}};function qm(t,r,i){var s=new mu;return s.restart(t,r,i),s}function fw(){Bf(),++Ms;for(var t=pu,r;t;)(r=zi-t._time)>=0&&t._call.call(void 0,r),t=t._next;--Ms}function mh(){zi=(hu=Ca.now())+Eu,Ms=wa=0;try{fw()}finally{Ms=0,pw(),zi=0}}function dw(){var t=Ca.now(),r=t-hu;r>Um&&(Eu-=r,hu=t)}function pw(){for(var t,r=pu,i,s=1/0;r;)r._call?(s>r._time&&(s=r._time),t=r,r=r._next):(i=r._next,r._next=null,r=t?t._next=i:pu=i);ba=t,Ef(s)}function Ef(t){if(!Ms){wa&&(wa=clearTimeout(wa));var r=t-zi;r>24?(t<1/0&&(wa=setTimeout(mh,t-Ca.now()-Eu)),va&&(va=clearInterval(va))):(va||(hu=Ca.now(),va=setInterval(dw,Um)),Ms=1,Km(mh))}}function gh(t,r,i){var s=new mu;return r=r==null?0:+r,s.restart(l=>{s.stop(),t(l+r)},r,i),s}var hw=ku("start","end","cancel","interrupt"),mw=[],Wm=0,yh=1,Cf=2,ru=3,vh=4,jf=5,ou=6;function Cu(t,r,i,s,l,c){var d=t.__transition;if(!d)t.__transition={};else if(i in d)return;gw(t,i,{name:r,index:s,group:l,on:hw,tween:mw,time:c.time,delay:c.delay,duration:c.duration,ease:c.ease,timer:null,state:Wm})}function Hf(t,r){var i=Fr(t,r);if(i.state>Wm)throw new Error("too late; already scheduled");return i}function no(t,r){var i=Fr(t,r);if(i.state>ru)throw new Error("too late; already running");return i}function Fr(t,r){var i=t.__transition;if(!i||!(i=i[r]))throw new Error("transition not found");return i}function gw(t,r,i){var s=t.__transition,l;s[r]=i,i.timer=qm(c,0,i.time);function c(b){i.state=yh,i.timer.restart(d,i.delay,i.time),i.delay<=b&&d(b-i.delay)}function d(b){var k,w,S,C;if(i.state!==yh)return y();for(k in s)if(C=s[k],C.name===i.name){if(C.state===ru)return gh(d);C.state===vh?(C.state=ou,C.timer.stop(),C.on.call("interrupt",t,t.__data__,C.index,C.group),delete s[k]):+k<r&&(C.state=ou,C.timer.stop(),C.on.call("cancel",t,t.__data__,C.index,C.group),delete s[k])}if(gh(function(){i.state===ru&&(i.state=vh,i.timer.restart(h,i.delay,i.time),h(b))}),i.state=Cf,i.on.call("start",t,t.__data__,i.index,i.group),i.state===Cf){for(i.state=ru,l=new Array(S=i.tween.length),k=0,w=-1;k<S;++k)(C=i.tween[k].value.call(t,t.__data__,i.index,i.group))&&(l[++w]=C);l.length=w+1}}function h(b){for(var k=b<i.duration?i.ease.call(null,b/i.duration):(i.timer.restart(y),i.state=jf,1),w=-1,S=l.length;++w<S;)l[w].call(t,k);i.state===jf&&(i.on.call("end",t,t.__data__,i.index,i.group),y())}function y(){i.state=ou,i.timer.stop(),delete s[r];for(var b in s)return;delete t.__transition}}function iu(t,r){var i=t.__transition,s,l,c=!0,d;if(i){r=r==null?null:r+"";for(d in i){if((s=i[d]).name!==r){c=!1;continue}l=s.state>Cf&&s.state<jf,s.state=ou,s.timer.stop(),s.on.call(l?"interrupt":"cancel",t,t.__data__,s.index,s.group),delete i[d]}c&&delete t.__transition}}function yw(t){return this.each(function(){iu(this,t)})}function vw(t,r){var i,s;return function(){var l=no(this,t),c=l.tween;if(c!==i){s=i=c;for(var d=0,h=s.length;d<h;++d)if(s[d].name===r){s=s.slice(),s.splice(d,1);break}}l.tween=s}}function xw(t,r,i){var s,l;if(typeof i!="function")throw new Error;return function(){var c=no(this,t),d=c.tween;if(d!==s){l=(s=d).slice();for(var h={name:r,value:i},y=0,b=l.length;y<b;++y)if(l[y].name===r){l[y]=h;break}y===b&&l.push(h)}c.tween=l}}function ww(t,r){var i=this._id;if(t+="",arguments.length<2){for(var s=Fr(this.node(),i).tween,l=0,c=s.length,d;l<c;++l)if((d=s[l]).name===t)return d.value;return null}return this.each((r==null?vw:xw)(i,t,r))}function Vf(t,r,i){var s=t._id;return t.each(function(){var l=no(this,s);(l.value||(l.value={}))[r]=i.apply(this,arguments)}),function(l){return Fr(l,s).value[r]}}function Ym(t,r){var i;return(typeof r=="number"?Jr:r instanceof Di?du:(i=Di(r))?(r=i,du):Bm)(t,r)}function bw(t){return function(){this.removeAttribute(t)}}function _w(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Sw(t,r,i){var s,l=i+"",c;return function(){var d=this.getAttribute(t);return d===l?null:d===s?c:c=r(s=d,i)}}function kw(t,r,i){var s,l=i+"",c;return function(){var d=this.getAttributeNS(t.space,t.local);return d===l?null:d===s?c:c=r(s=d,i)}}function Nw(t,r,i){var s,l,c;return function(){var d,h=i(this),y;return h==null?void this.removeAttribute(t):(d=this.getAttribute(t),y=h+"",d===y?null:d===s&&y===l?c:(l=y,c=r(s=d,h)))}}function Ew(t,r,i){var s,l,c;return function(){var d,h=i(this),y;return h==null?void this.removeAttributeNS(t.space,t.local):(d=this.getAttributeNS(t.space,t.local),y=h+"",d===y?null:d===s&&y===l?c:(l=y,c=r(s=d,h)))}}function Cw(t,r){var i=Nu(t),s=i==="transform"?sw:Ym;return this.attrTween(t,typeof r=="function"?(i.local?Ew:Nw)(i,s,Vf(this,"attr."+t,r)):r==null?(i.local?_w:bw)(i):(i.local?kw:Sw)(i,s,r))}function jw(t,r){return function(i){this.setAttribute(t,r.call(this,i))}}function Pw(t,r){return function(i){this.setAttributeNS(t.space,t.local,r.call(this,i))}}function Mw(t,r){var i,s;function l(){var c=r.apply(this,arguments);return c!==s&&(i=(s=c)&&Pw(t,c)),i}return l._value=r,l}function $w(t,r){var i,s;function l(){var c=r.apply(this,arguments);return c!==s&&(i=(s=c)&&jw(t,c)),i}return l._value=r,l}function Tw(t,r){var i="attr."+t;if(arguments.length<2)return(i=this.tween(i))&&i._value;if(r==null)return this.tween(i,null);if(typeof r!="function")throw new Error;var s=Nu(t);return this.tween(i,(s.local?Mw:$w)(s,r))}function Iw(t,r){return function(){Hf(this,t).delay=+r.apply(this,arguments)}}function Aw(t,r){return r=+r,function(){Hf(this,t).delay=r}}function Ow(t){var r=this._id;return arguments.length?this.each((typeof t=="function"?Iw:Aw)(r,t)):Fr(this.node(),r).delay}function Rw(t,r){return function(){no(this,t).duration=+r.apply(this,arguments)}}function Lw(t,r){return r=+r,function(){no(this,t).duration=r}}function Dw(t){var r=this._id;return arguments.length?this.each((typeof t=="function"?Rw:Lw)(r,t)):Fr(this.node(),r).duration}function zw(t,r){if(typeof r!="function")throw new Error;return function(){no(this,t).ease=r}}function Fw(t){var r=this._id;return arguments.length?this.each(zw(r,t)):Fr(this.node(),r).ease}function Bw(t,r){return function(){var i=r.apply(this,arguments);if(typeof i!="function")throw new Error;no(this,t).ease=i}}function Hw(t){if(typeof t!="function")throw new Error;return this.each(Bw(this._id,t))}function Vw(t){typeof t!="function"&&(t=Nm(t));for(var r=this._groups,i=r.length,s=new Array(i),l=0;l<i;++l)for(var c=r[l],d=c.length,h=s[l]=[],y,b=0;b<d;++b)(y=c[b])&&t.call(y,y.__data__,b,c)&&h.push(y);return new Io(s,this._parents,this._name,this._id)}function Uw(t){if(t._id!==this._id)throw new Error;for(var r=this._groups,i=t._groups,s=r.length,l=i.length,c=Math.min(s,l),d=new Array(s),h=0;h<c;++h)for(var y=r[h],b=i[h],k=y.length,w=d[h]=new Array(k),S,C=0;C<k;++C)(S=y[C]||b[C])&&(w[C]=S);for(;h<s;++h)d[h]=r[h];return new Io(d,this._parents,this._name,this._id)}function Kw(t){return(t+"").trim().split(/^|\s+/).every(function(r){var i=r.indexOf(".");return i>=0&&(r=r.slice(0,i)),!r||r==="start"})}function qw(t,r,i){var s,l,c=Kw(r)?Hf:no;return function(){var d=c(this,t),h=d.on;h!==s&&(l=(s=h).copy()).on(r,i),d.on=l}}function Ww(t,r){var i=this._id;return arguments.length<2?Fr(this.node(),i).on.on(t):this.each(qw(i,t,r))}function Yw(t){return function(){var r=this.parentNode;for(var i in this.__transition)if(+i!==t)return;r&&r.removeChild(this)}}function Xw(){return this.on("end.remove",Yw(this._id))}function Qw(t){var r=this._name,i=this._id;typeof t!="function"&&(t=Lf(t));for(var s=this._groups,l=s.length,c=new Array(l),d=0;d<l;++d)for(var h=s[d],y=h.length,b=c[d]=new Array(y),k,w,S=0;S<y;++S)(k=h[S])&&(w=t.call(k,k.__data__,S,h))&&("__data__"in k&&(w.__data__=k.__data__),b[S]=w,Cu(b[S],r,i,S,b,Fr(k,i)));return new Io(c,this._parents,r,i)}function Gw(t){var r=this._name,i=this._id;typeof t!="function"&&(t=km(t));for(var s=this._groups,l=s.length,c=[],d=[],h=0;h<l;++h)for(var y=s[h],b=y.length,k,w=0;w<b;++w)if(k=y[w]){for(var S=t.call(k,k.__data__,w,y),C,j=Fr(k,i),$=0,T=S.length;$<T;++$)(C=S[$])&&Cu(C,r,i,$,S,j);c.push(S),d.push(k)}return new Io(c,d,r,i)}var Jw=Aa.prototype.constructor;function Zw(){return new Jw(this._groups,this._parents)}function e1(t,r){var i,s,l;return function(){var c=Ps(this,t),d=(this.style.removeProperty(t),Ps(this,t));return c===d?null:c===i&&d===s?l:l=r(i=c,s=d)}}function Xm(t){return function(){this.style.removeProperty(t)}}function t1(t,r,i){var s,l=i+"",c;return function(){var d=Ps(this,t);return d===l?null:d===s?c:c=r(s=d,i)}}function n1(t,r,i){var s,l,c;return function(){var d=Ps(this,t),h=i(this),y=h+"";return h==null&&(y=h=(this.style.removeProperty(t),Ps(this,t))),d===y?null:d===s&&y===l?c:(l=y,c=r(s=d,h))}}function r1(t,r){var i,s,l,c="style."+r,d="end."+c,h;return function(){var y=no(this,t),b=y.on,k=y.value[c]==null?h||(h=Xm(r)):void 0;(b!==i||l!==k)&&(s=(i=b).copy()).on(d,l=k),y.on=s}}function o1(t,r,i){var s=(t+="")=="transform"?iw:Ym;return r==null?this.styleTween(t,e1(t,s)).on("end.style."+t,Xm(t)):typeof r=="function"?this.styleTween(t,n1(t,s,Vf(this,"style."+t,r))).each(r1(this._id,t)):this.styleTween(t,t1(t,s,r),i).on("end.style."+t,null)}function i1(t,r,i){return function(s){this.style.setProperty(t,r.call(this,s),i)}}function s1(t,r,i){var s,l;function c(){var d=r.apply(this,arguments);return d!==l&&(s=(l=d)&&i1(t,d,i)),s}return c._value=r,c}function a1(t,r,i){var s="style."+(t+="");if(arguments.length<2)return(s=this.tween(s))&&s._value;if(r==null)return this.tween(s,null);if(typeof r!="function")throw new Error;return this.tween(s,s1(t,r,i??""))}function l1(t){return function(){this.textContent=t}}function u1(t){return function(){var r=t(this);this.textContent=r??""}}function c1(t){return this.tween("text",typeof t=="function"?u1(Vf(this,"text",t)):l1(t==null?"":t+""))}function f1(t){return function(r){this.textContent=t.call(this,r)}}function d1(t){var r,i;function s(){var l=t.apply(this,arguments);return l!==i&&(r=(i=l)&&f1(l)),r}return s._value=t,s}function p1(t){var r="text";if(arguments.length<1)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,d1(t))}function h1(){for(var t=this._name,r=this._id,i=Qm(),s=this._groups,l=s.length,c=0;c<l;++c)for(var d=s[c],h=d.length,y,b=0;b<h;++b)if(y=d[b]){var k=Fr(y,r);Cu(y,t,i,b,d,{time:k.time+k.delay+k.duration,delay:0,duration:k.duration,ease:k.ease})}return new Io(s,this._parents,t,i)}function m1(){var t,r,i=this,s=i._id,l=i.size();return new Promise(function(c,d){var h={value:d},y={value:function(){--l===0&&c()}};i.each(function(){var b=no(this,s),k=b.on;k!==t&&(r=(t=k).copy(),r._.cancel.push(h),r._.interrupt.push(h),r._.end.push(y)),b.on=r}),l===0&&c()})}var g1=0;function Io(t,r,i,s){this._groups=t,this._parents=r,this._name=i,this._id=s}function Qm(){return++g1}var Mo=Aa.prototype;Io.prototype={constructor:Io,select:Qw,selectAll:Gw,selectChild:Mo.selectChild,selectChildren:Mo.selectChildren,filter:Vw,merge:Uw,selection:Zw,transition:h1,call:Mo.call,nodes:Mo.nodes,node:Mo.node,size:Mo.size,empty:Mo.empty,each:Mo.each,on:Ww,attr:Cw,attrTween:Tw,style:o1,styleTween:a1,text:c1,textTween:p1,remove:Xw,tween:ww,delay:Ow,duration:Dw,ease:Fw,easeVarying:Hw,end:m1,[Symbol.iterator]:Mo[Symbol.iterator]};function y1(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var v1={time:null,delay:0,duration:250,ease:y1};function x1(t,r){for(var i;!(i=t.__transition)||!(i=i[r]);)if(!(t=t.parentNode))throw new Error(`transition ${r} not found`);return i}function w1(t){var r,i;t instanceof Io?(r=t._id,t=t._name):(r=Qm(),(i=v1).time=Bf(),t=t==null?null:t+"");for(var s=this._groups,l=s.length,c=0;c<l;++c)for(var d=s[c],h=d.length,y,b=0;b<h;++b)(y=d[b])&&Cu(y,t,r,b,d,i||x1(y,r));return new Io(s,this._parents,t,r)}Aa.prototype.interrupt=yw;Aa.prototype.transition=w1;const Yl=t=>()=>t;function b1(t,{sourceEvent:r,target:i,transform:s,dispatch:l}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:r,enumerable:!0,configurable:!0},target:{value:i,enumerable:!0,configurable:!0},transform:{value:s,enumerable:!0,configurable:!0},_:{value:l}})}function $o(t,r,i){this.k=t,this.x=r,this.y=i}$o.prototype={constructor:$o,scale:function(t){return t===1?this:new $o(this.k*t,this.x,this.y)},translate:function(t,r){return t===0&r===0?this:new $o(this.k,this.x+this.k*t,this.y+this.k*r)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var ju=new $o(1,0,0);Gm.prototype=$o.prototype;function Gm(t){for(;!t.__zoom;)if(!(t=t.parentNode))return ju;return t.__zoom}function sf(t){t.stopImmediatePropagation()}function xa(t){t.preventDefault(),t.stopImmediatePropagation()}function _1(t){return(!t.ctrlKey||t.type==="wheel")&&!t.button}function S1(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t,t.hasAttribute("viewBox")?(t=t.viewBox.baseVal,[[t.x,t.y],[t.x+t.width,t.y+t.height]]):[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]):[[0,0],[t.clientWidth,t.clientHeight]]}function xh(){return this.__zoom||ju}function k1(t){return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function N1(){return navigator.maxTouchPoints||"ontouchstart"in this}function E1(t,r,i){var s=t.invertX(r[0][0])-i[0][0],l=t.invertX(r[1][0])-i[1][0],c=t.invertY(r[0][1])-i[0][1],d=t.invertY(r[1][1])-i[1][1];return t.translate(l>s?(s+l)/2:Math.min(0,s)||Math.max(0,l),d>c?(c+d)/2:Math.min(0,c)||Math.max(0,d))}function Jm(){var t=_1,r=S1,i=E1,s=k1,l=N1,c=[0,1/0],d=[[-1/0,-1/0],[1/0,1/0]],h=250,y=nu,b=ku("start","zoom","end"),k,w,S,C=500,j=150,$=0,T=10;function I(L){L.property("__zoom",xh).on("wheel.zoom",ce,{passive:!1}).on("mousedown.zoom",de).on("dblclick.zoom",we).filter(l).on("touchstart.zoom",q).on("touchmove.zoom",fe).on("touchend.zoom touchcancel.zoom",xe).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}I.transform=function(L,le,G,ie){var F=L.selection?L.selection():L;F.property("__zoom",xh),L!==F?H(L,le,G,ie):F.interrupt().each(function(){V(this,arguments).event(ie).start().zoom(null,typeof le=="function"?le.apply(this,arguments):le).end()})},I.scaleBy=function(L,le,G,ie){I.scaleTo(L,function(){var F=this.__zoom.k,W=typeof le=="function"?le.apply(this,arguments):le;return F*W},G,ie)},I.scaleTo=function(L,le,G,ie){I.transform(L,function(){var F=r.apply(this,arguments),W=this.__zoom,B=G==null?R(F):typeof G=="function"?G.apply(this,arguments):G,A=W.invert(B),K=typeof le=="function"?le.apply(this,arguments):le;return i(P(U(W,K),B,A),F,d)},G,ie)},I.translateBy=function(L,le,G,ie){I.transform(L,function(){return i(this.__zoom.translate(typeof le=="function"?le.apply(this,arguments):le,typeof G=="function"?G.apply(this,arguments):G),r.apply(this,arguments),d)},null,ie)},I.translateTo=function(L,le,G,ie,F){I.transform(L,function(){var W=r.apply(this,arguments),B=this.__zoom,A=ie==null?R(W):typeof ie=="function"?ie.apply(this,arguments):ie;return i(ju.translate(A[0],A[1]).scale(B.k).translate(typeof le=="function"?-le.apply(this,arguments):-le,typeof G=="function"?-G.apply(this,arguments):-G),W,d)},ie,F)};function U(L,le){return le=Math.max(c[0],Math.min(c[1],le)),le===L.k?L:new $o(le,L.x,L.y)}function P(L,le,G){var ie=le[0]-G[0]*L.k,F=le[1]-G[1]*L.k;return ie===L.x&&F===L.y?L:new $o(L.k,ie,F)}function R(L){return[(+L[0][0]+ +L[1][0])/2,(+L[0][1]+ +L[1][1])/2]}function H(L,le,G,ie){L.on("start.zoom",function(){V(this,arguments).event(ie).start()}).on("interrupt.zoom end.zoom",function(){V(this,arguments).event(ie).end()}).tween("zoom",function(){var F=this,W=arguments,B=V(F,W).event(ie),A=r.apply(F,W),K=G==null?R(A):typeof G=="function"?G.apply(F,W):G,be=Math.max(A[1][0]-A[0][0],A[1][1]-A[0][1]),Se=F.__zoom,Me=typeof le=="function"?le.apply(F,W):le,Ie=y(Se.invert(K).concat(be/Se.k),Me.invert(K).concat(be/Me.k));return function(Ae){if(Ae===1)Ae=Me;else{var _e=Ie(Ae),ze=be/_e[2];Ae=new $o(ze,K[0]-_e[0]*ze,K[1]-_e[1]*ze)}B.zoom(null,Ae)}})}function V(L,le,G){return!G&&L.__zooming||new Q(L,le)}function Q(L,le){this.that=L,this.args=le,this.active=0,this.sourceEvent=null,this.extent=r.apply(L,le),this.taps=0}Q.prototype={event:function(L){return L&&(this.sourceEvent=L),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(L,le){return this.mouse&&L!=="mouse"&&(this.mouse[1]=le.invert(this.mouse[0])),this.touch0&&L!=="touch"&&(this.touch0[1]=le.invert(this.touch0[0])),this.touch1&&L!=="touch"&&(this.touch1[1]=le.invert(this.touch1[0])),this.that.__zoom=le,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(L){var le=ir(this.that).datum();b.call(L,this.that,new b1(L,{sourceEvent:this.sourceEvent,target:I,transform:this.that.__zoom,dispatch:b}),le)}};function ce(L,...le){if(!t.apply(this,arguments))return;var G=V(this,le).event(L),ie=this.__zoom,F=Math.max(c[0],Math.min(c[1],ie.k*Math.pow(2,s.apply(this,arguments)))),W=Rr(L);if(G.wheel)(G.mouse[0][0]!==W[0]||G.mouse[0][1]!==W[1])&&(G.mouse[1]=ie.invert(G.mouse[0]=W)),clearTimeout(G.wheel);else{if(ie.k===F)return;G.mouse=[W,ie.invert(W)],iu(this),G.start()}xa(L),G.wheel=setTimeout(B,j),G.zoom("mouse",i(P(U(ie,F),G.mouse[0],G.mouse[1]),G.extent,d));function B(){G.wheel=null,G.end()}}function de(L,...le){if(S||!t.apply(this,arguments))return;var G=L.currentTarget,ie=V(this,le,!0).event(L),F=ir(L.view).on("mousemove.zoom",K,!0).on("mouseup.zoom",be,!0),W=Rr(L,G),B=L.clientX,A=L.clientY;Om(L.view),sf(L),ie.mouse=[W,this.__zoom.invert(W)],iu(this),ie.start();function K(Se){if(xa(Se),!ie.moved){var Me=Se.clientX-B,Ie=Se.clientY-A;ie.moved=Me*Me+Ie*Ie>$}ie.event(Se).zoom("mouse",i(P(ie.that.__zoom,ie.mouse[0]=Rr(Se,G),ie.mouse[1]),ie.extent,d))}function be(Se){F.on("mousemove.zoom mouseup.zoom",null),Rm(Se.view,ie.moved),xa(Se),ie.event(Se).end()}}function we(L,...le){if(t.apply(this,arguments)){var G=this.__zoom,ie=Rr(L.changedTouches?L.changedTouches[0]:L,this),F=G.invert(ie),W=G.k*(L.shiftKey?.5:2),B=i(P(U(G,W),ie,F),r.apply(this,le),d);xa(L),h>0?ir(this).transition().duration(h).call(H,B,ie,L):ir(this).call(I.transform,B,ie,L)}}function q(L,...le){if(t.apply(this,arguments)){var G=L.touches,ie=G.length,F=V(this,le,L.changedTouches.length===ie).event(L),W,B,A,K;for(sf(L),B=0;B<ie;++B)A=G[B],K=Rr(A,this),K=[K,this.__zoom.invert(K),A.identifier],F.touch0?!F.touch1&&F.touch0[2]!==K[2]&&(F.touch1=K,F.taps=0):(F.touch0=K,W=!0,F.taps=1+!!k);k&&(k=clearTimeout(k)),W&&(F.taps<2&&(w=K[0],k=setTimeout(function(){k=null},C)),iu(this),F.start())}}function fe(L,...le){if(this.__zooming){var G=V(this,le).event(L),ie=L.changedTouches,F=ie.length,W,B,A,K;for(xa(L),W=0;W<F;++W)B=ie[W],A=Rr(B,this),G.touch0&&G.touch0[2]===B.identifier?G.touch0[0]=A:G.touch1&&G.touch1[2]===B.identifier&&(G.touch1[0]=A);if(B=G.that.__zoom,G.touch1){var be=G.touch0[0],Se=G.touch0[1],Me=G.touch1[0],Ie=G.touch1[1],Ae=(Ae=Me[0]-be[0])*Ae+(Ae=Me[1]-be[1])*Ae,_e=(_e=Ie[0]-Se[0])*_e+(_e=Ie[1]-Se[1])*_e;B=U(B,Math.sqrt(Ae/_e)),A=[(be[0]+Me[0])/2,(be[1]+Me[1])/2],K=[(Se[0]+Ie[0])/2,(Se[1]+Ie[1])/2]}else if(G.touch0)A=G.touch0[0],K=G.touch0[1];else return;G.zoom("touch",i(P(B,A,K),G.extent,d))}}function xe(L,...le){if(this.__zooming){var G=V(this,le).event(L),ie=L.changedTouches,F=ie.length,W,B;for(sf(L),S&&clearTimeout(S),S=setTimeout(function(){S=null},C),W=0;W<F;++W)B=ie[W],G.touch0&&G.touch0[2]===B.identifier?delete G.touch0:G.touch1&&G.touch1[2]===B.identifier&&delete G.touch1;if(G.touch1&&!G.touch0&&(G.touch0=G.touch1,delete G.touch1),G.touch0)G.touch0[1]=this.__zoom.invert(G.touch0[0]);else if(G.end(),G.taps===2&&(B=Rr(B,this),Math.hypot(w[0]-B[0],w[1]-B[1])<T)){var A=ir(this).on("dblclick.zoom");A&&A.apply(this,arguments)}}}return I.wheelDelta=function(L){return arguments.length?(s=typeof L=="function"?L:Yl(+L),I):s},I.filter=function(L){return arguments.length?(t=typeof L=="function"?L:Yl(!!L),I):t},I.touchable=function(L){return arguments.length?(l=typeof L=="function"?L:Yl(!!L),I):l},I.extent=function(L){return arguments.length?(r=typeof L=="function"?L:Yl([[+L[0][0],+L[0][1]],[+L[1][0],+L[1][1]]]),I):r},I.scaleExtent=function(L){return arguments.length?(c[0]=+L[0],c[1]=+L[1],I):[c[0],c[1]]},I.translateExtent=function(L){return arguments.length?(d[0][0]=+L[0][0],d[1][0]=+L[1][0],d[0][1]=+L[0][1],d[1][1]=+L[1][1],I):[[d[0][0],d[0][1]],[d[1][0],d[1][1]]]},I.constrain=function(L){return arguments.length?(i=L,I):i},I.duration=function(L){return arguments.length?(h=+L,I):h},I.interpolate=function(L){return arguments.length?(y=L,I):y},I.on=function(){var L=b.on.apply(b,arguments);return L===b?I:L},I.clickDistance=function(L){return arguments.length?($=(L=+L)*L,I):Math.sqrt($)},I.tapDistance=function(L){return arguments.length?(T=+L,I):T},I}const eo={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:t=>`Node type "${t}" 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:t=>`The old edge with id=${t} does not exist.`,error009:t=>`Marker type "${t}" doesn't exist.`,error008:(t,{id:r,sourceHandle:i,targetHandle:s})=>`Couldn't create edge for ${t} handle id: "${t==="source"?i:s}", edge id: ${r}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:t=>`Edge type "${t}" not found. Using fallback type "default".`,error012:t=>`Node with id "${t}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(t="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${t}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."},ja=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Zm=["Enter"," ","Escape"],eg={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:t,x:r,y:i})=>`Moved selected node ${t}. New position, x: ${r}, y: ${i}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var $s;(function(t){t.Strict="strict",t.Loose="loose"})($s||($s={}));var Li;(function(t){t.Free="free",t.Vertical="vertical",t.Horizontal="horizontal"})(Li||(Li={}));var Pa;(function(t){t.Partial="partial",t.Full="full"})(Pa||(Pa={}));const tg={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var fi;(function(t){t.Bezier="default",t.Straight="straight",t.Step="step",t.SmoothStep="smoothstep",t.SimpleBezier="simplebezier"})(fi||(fi={}));var gu;(function(t){t.Arrow="arrow",t.ArrowClosed="arrowclosed"})(gu||(gu={}));var Ze;(function(t){t.Left="left",t.Top="top",t.Right="right",t.Bottom="bottom"})(Ze||(Ze={}));const wh={[Ze.Left]:Ze.Right,[Ze.Right]:Ze.Left,[Ze.Top]:Ze.Bottom,[Ze.Bottom]:Ze.Top};function ng(t){return t===null?null:t?"valid":"invalid"}const rg=t=>"id"in t&&"source"in t&&"target"in t,C1=t=>"id"in t&&"position"in t&&!("source"in t)&&!("target"in t),Uf=t=>"id"in t&&"internals"in t&&!("source"in t)&&!("target"in t),Ra=(t,r=[0,0])=>{const{width:i,height:s}=Ao(t),l=t.origin??r,c=i*l[0],d=s*l[1];return{x:t.position.x-c,y:t.position.y-d}},j1=(t,r={nodeOrigin:[0,0]})=>{if(t.length===0)return{x:0,y:0,width:0,height:0};const i=t.reduce((s,l)=>{const c=typeof l=="string";let d=!r.nodeLookup&&!c?l:void 0;r.nodeLookup&&(d=c?r.nodeLookup.get(l):Uf(l)?l:r.nodeLookup.get(l.id));const h=d?yu(d,r.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Pu(s,h)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Mu(i)},La=(t,r={})=>{let i={x:1/0,y:1/0,x2:-1/0,y2:-1/0},s=!1;return t.forEach(l=>{(r.filter===void 0||r.filter(l))&&(i=Pu(i,yu(l)),s=!0)}),s?Mu(i):{x:0,y:0,width:0,height:0}},Kf=(t,r,[i,s,l]=[0,0,1],c=!1,d=!1)=>{const h={...za(r,[i,s,l]),width:r.width/l,height:r.height/l},y=[];for(const b of t.values()){const{measured:k,selectable:w=!0,hidden:S=!1}=b;if(d&&!w||S)continue;const C=k.width??b.width??b.initialWidth??null,j=k.height??b.height??b.initialHeight??null,$=Ma(h,Is(b)),T=(C??0)*(j??0),I=c&&$>0;(!b.internals.handleBounds||I||$>=T||b.dragging)&&y.push(b)}return y},P1=(t,r)=>{const i=new Set;return t.forEach(s=>{i.add(s.id)}),r.filter(s=>i.has(s.source)||i.has(s.target))};function M1(t,r){const i=new Map,s=r!=null&&r.nodes?new Set(r.nodes.map(l=>l.id)):null;return t.forEach(l=>{l.measured.width&&l.measured.height&&((r==null?void 0:r.includeHiddenNodes)||!l.hidden)&&(!s||s.has(l.id))&&i.set(l.id,l)}),i}async function $1({nodes:t,width:r,height:i,panZoom:s,minZoom:l,maxZoom:c},d){if(t.size===0)return Promise.resolve(!0);const h=M1(t,d),y=La(h),b=qf(y,r,i,(d==null?void 0:d.minZoom)??l,(d==null?void 0:d.maxZoom)??c,(d==null?void 0:d.padding)??.1);return await s.setViewport(b,{duration:d==null?void 0:d.duration,ease:d==null?void 0:d.ease,interpolate:d==null?void 0:d.interpolate}),Promise.resolve(!0)}function og({nodeId:t,nextPosition:r,nodeLookup:i,nodeOrigin:s=[0,0],nodeExtent:l,onError:c}){const d=i.get(t),h=d.parentId?i.get(d.parentId):void 0,{x:y,y:b}=h?h.internals.positionAbsolute:{x:0,y:0},k=d.origin??s;let w=d.extent||l;if(d.extent==="parent"&&!d.expandParent)if(!h)c==null||c("005",eo.error005());else{const C=h.measured.width,j=h.measured.height;C&&j&&(w=[[y,b],[y+C,b+j]])}else h&&As(d.extent)&&(w=[[d.extent[0][0]+y,d.extent[0][1]+b],[d.extent[1][0]+y,d.extent[1][1]+b]]);const S=As(w)?Fi(r,w,d.measured):r;return(d.measured.width===void 0||d.measured.height===void 0)&&(c==null||c("015",eo.error015())),{position:{x:S.x-y+(d.measured.width??0)*k[0],y:S.y-b+(d.measured.height??0)*k[1]},positionAbsolute:S}}async function T1({nodesToRemove:t=[],edgesToRemove:r=[],nodes:i,edges:s,onBeforeDelete:l}){const c=new Set(t.map(S=>S.id)),d=[];for(const S of i){if(S.deletable===!1)continue;const C=c.has(S.id),j=!C&&S.parentId&&d.find($=>$.id===S.parentId);(C||j)&&d.push(S)}const h=new Set(r.map(S=>S.id)),y=s.filter(S=>S.deletable!==!1),k=P1(d,y);for(const S of y)h.has(S.id)&&!k.find(j=>j.id===S.id)&&k.push(S);if(!l)return{edges:k,nodes:d};const w=await l({nodes:d,edges:k});return typeof w=="boolean"?w?{edges:k,nodes:d}:{edges:[],nodes:[]}:w}const Ts=(t,r=0,i=1)=>Math.min(Math.max(t,r),i),Fi=(t={x:0,y:0},r,i)=>({x:Ts(t.x,r[0][0],r[1][0]-((i==null?void 0:i.width)??0)),y:Ts(t.y,r[0][1],r[1][1]-((i==null?void 0:i.height)??0))});function ig(t,r,i){const{width:s,height:l}=Ao(i),{x:c,y:d}=i.internals.positionAbsolute;return Fi(t,[[c,d],[c+s,d+l]],r)}const bh=(t,r,i)=>t<r?Ts(Math.abs(t-r),1,r)/r:t>i?-Ts(Math.abs(t-i),1,r)/r:0,sg=(t,r,i=15,s=40)=>{const l=bh(t.x,s,r.width-s)*i,c=bh(t.y,s,r.height-s)*i;return[l,c]},Pu=(t,r)=>({x:Math.min(t.x,r.x),y:Math.min(t.y,r.y),x2:Math.max(t.x2,r.x2),y2:Math.max(t.y2,r.y2)}),Pf=({x:t,y:r,width:i,height:s})=>({x:t,y:r,x2:t+i,y2:r+s}),Mu=({x:t,y:r,x2:i,y2:s})=>({x:t,y:r,width:i-t,height:s-r}),Is=(t,r=[0,0])=>{var l,c;const{x:i,y:s}=Uf(t)?t.internals.positionAbsolute:Ra(t,r);return{x:i,y:s,width:((l=t.measured)==null?void 0:l.width)??t.width??t.initialWidth??0,height:((c=t.measured)==null?void 0:c.height)??t.height??t.initialHeight??0}},yu=(t,r=[0,0])=>{var l,c;const{x:i,y:s}=Uf(t)?t.internals.positionAbsolute:Ra(t,r);return{x:i,y:s,x2:i+(((l=t.measured)==null?void 0:l.width)??t.width??t.initialWidth??0),y2:s+(((c=t.measured)==null?void 0:c.height)??t.height??t.initialHeight??0)}},ag=(t,r)=>Mu(Pu(Pf(t),Pf(r))),Ma=(t,r)=>{const i=Math.max(0,Math.min(t.x+t.width,r.x+r.width)-Math.max(t.x,r.x)),s=Math.max(0,Math.min(t.y+t.height,r.y+r.height)-Math.max(t.y,r.y));return Math.ceil(i*s)},_h=t=>Dr(t.width)&&Dr(t.height)&&Dr(t.x)&&Dr(t.y),Dr=t=>!isNaN(t)&&isFinite(t),I1=(t,r)=>{},Da=(t,r=[1,1])=>({x:r[0]*Math.round(t.x/r[0]),y:r[1]*Math.round(t.y/r[1])}),za=({x:t,y:r},[i,s,l],c=!1,d=[1,1])=>{const h={x:(t-i)/l,y:(r-s)/l};return c?Da(h,d):h},vu=({x:t,y:r},[i,s,l])=>({x:t*l+i,y:r*l+s});function _s(t,r){if(typeof t=="number")return Math.floor((r-r/(1+t))*.5);if(typeof t=="string"&&t.endsWith("px")){const i=parseFloat(t);if(!Number.isNaN(i))return Math.floor(i)}if(typeof t=="string"&&t.endsWith("%")){const i=parseFloat(t);if(!Number.isNaN(i))return Math.floor(r*i*.01)}return console.error(`[React Flow] The padding value "${t}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function A1(t,r,i){if(typeof t=="string"||typeof t=="number"){const s=_s(t,i),l=_s(t,r);return{top:s,right:l,bottom:s,left:l,x:l*2,y:s*2}}if(typeof t=="object"){const s=_s(t.top??t.y??0,i),l=_s(t.bottom??t.y??0,i),c=_s(t.left??t.x??0,r),d=_s(t.right??t.x??0,r);return{top:s,right:d,bottom:l,left:c,x:c+d,y:s+l}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function O1(t,r,i,s,l,c){const{x:d,y:h}=vu(t,[r,i,s]),{x:y,y:b}=vu({x:t.x+t.width,y:t.y+t.height},[r,i,s]),k=l-y,w=c-b;return{left:Math.floor(d),top:Math.floor(h),right:Math.floor(k),bottom:Math.floor(w)}}const qf=(t,r,i,s,l,c)=>{const d=A1(c,r,i),h=(r-d.x)/t.width,y=(i-d.y)/t.height,b=Math.min(h,y),k=Ts(b,s,l),w=t.x+t.width/2,S=t.y+t.height/2,C=r/2-w*k,j=i/2-S*k,$=O1(t,C,j,k,r,i),T={left:Math.min($.left-d.left,0),top:Math.min($.top-d.top,0),right:Math.min($.right-d.right,0),bottom:Math.min($.bottom-d.bottom,0)};return{x:C-T.left+T.right,y:j-T.top+T.bottom,zoom:k}},$a=()=>{var t;return typeof navigator<"u"&&((t=navigator==null?void 0:navigator.userAgent)==null?void 0:t.indexOf("Mac"))>=0};function As(t){return t!=null&&t!=="parent"}function Ao(t){var r,i;return{width:((r=t.measured)==null?void 0:r.width)??t.width??t.initialWidth??0,height:((i=t.measured)==null?void 0:i.height)??t.height??t.initialHeight??0}}function lg(t){var r,i;return(((r=t.measured)==null?void 0:r.width)??t.width??t.initialWidth)!==void 0&&(((i=t.measured)==null?void 0:i.height)??t.height??t.initialHeight)!==void 0}function ug(t,r={width:0,height:0},i,s,l){const c={...t},d=s.get(i);if(d){const h=d.origin||l;c.x+=d.internals.positionAbsolute.x-(r.width??0)*h[0],c.y+=d.internals.positionAbsolute.y-(r.height??0)*h[1]}return c}function Sh(t,r){if(t.size!==r.size)return!1;for(const i of t)if(!r.has(i))return!1;return!0}function R1(){let t,r;return{promise:new Promise((s,l)=>{t=s,r=l}),resolve:t,reject:r}}function L1(t){return{...eg,...t||{}}}function Sa(t,{snapGrid:r=[0,0],snapToGrid:i=!1,transform:s,containerBounds:l}){const{x:c,y:d}=zr(t),h=za({x:c-((l==null?void 0:l.left)??0),y:d-((l==null?void 0:l.top)??0)},s),{x:y,y:b}=i?Da(h,r):h;return{xSnapped:y,ySnapped:b,...h}}const Wf=t=>({width:t.offsetWidth,height:t.offsetHeight}),cg=t=>{var r;return((r=t==null?void 0:t.getRootNode)==null?void 0:r.call(t))||(window==null?void 0:window.document)},D1=["INPUT","SELECT","TEXTAREA"];function fg(t){var s,l;const r=((l=(s=t.composedPath)==null?void 0:s.call(t))==null?void 0:l[0])||t.target;return(r==null?void 0:r.nodeType)!==1?!1:D1.includes(r.nodeName)||r.hasAttribute("contenteditable")||!!r.closest(".nokey")}const dg=t=>"clientX"in t,zr=(t,r)=>{var c,d;const i=dg(t),s=i?t.clientX:(c=t.touches)==null?void 0:c[0].clientX,l=i?t.clientY:(d=t.touches)==null?void 0:d[0].clientY;return{x:s-((r==null?void 0:r.left)??0),y:l-((r==null?void 0:r.top)??0)}},kh=(t,r,i,s,l)=>{const c=r.querySelectorAll(`.${t}`);return!c||!c.length?null:Array.from(c).map(d=>{const h=d.getBoundingClientRect();return{id:d.getAttribute("data-handleid"),type:t,nodeId:l,position:d.getAttribute("data-handlepos"),x:(h.left-i.left)/s,y:(h.top-i.top)/s,...Wf(d)}})};function pg({sourceX:t,sourceY:r,targetX:i,targetY:s,sourceControlX:l,sourceControlY:c,targetControlX:d,targetControlY:h}){const y=t*.125+l*.375+d*.375+i*.125,b=r*.125+c*.375+h*.375+s*.125,k=Math.abs(y-t),w=Math.abs(b-r);return[y,b,k,w]}function Xl(t,r){return t>=0?.5*t:r*25*Math.sqrt(-t)}function Nh({pos:t,x1:r,y1:i,x2:s,y2:l,c}){switch(t){case Ze.Left:return[r-Xl(r-s,c),i];case Ze.Right:return[r+Xl(s-r,c),i];case Ze.Top:return[r,i-Xl(i-l,c)];case Ze.Bottom:return[r,i+Xl(l-i,c)]}}function hg({sourceX:t,sourceY:r,sourcePosition:i=Ze.Bottom,targetX:s,targetY:l,targetPosition:c=Ze.Top,curvature:d=.25}){const[h,y]=Nh({pos:i,x1:t,y1:r,x2:s,y2:l,c:d}),[b,k]=Nh({pos:c,x1:s,y1:l,x2:t,y2:r,c:d}),[w,S,C,j]=pg({sourceX:t,sourceY:r,targetX:s,targetY:l,sourceControlX:h,sourceControlY:y,targetControlX:b,targetControlY:k});return[`M${t},${r} C${h},${y} ${b},${k} ${s},${l}`,w,S,C,j]}function mg({sourceX:t,sourceY:r,targetX:i,targetY:s}){const l=Math.abs(i-t)/2,c=i<t?i+l:i-l,d=Math.abs(s-r)/2,h=s<r?s+d:s-d;return[c,h,l,d]}function z1({sourceNode:t,targetNode:r,selected:i=!1,zIndex:s=0,elevateOnSelect:l=!1,zIndexMode:c="basic"}){if(c==="manual")return s;const d=l&&i?s+1e3:s,h=Math.max(t.parentId||l&&t.selected?t.internals.z:0,r.parentId||l&&r.selected?r.internals.z:0);return d+h}function F1({sourceNode:t,targetNode:r,width:i,height:s,transform:l}){const c=Pu(yu(t),yu(r));c.x===c.x2&&(c.x2+=1),c.y===c.y2&&(c.y2+=1);const d={x:-l[0]/l[2],y:-l[1]/l[2],width:i/l[2],height:s/l[2]};return Ma(d,Mu(c))>0}const B1=({source:t,sourceHandle:r,target:i,targetHandle:s})=>`xy-edge__${t}${r||""}-${i}${s||""}`,H1=(t,r)=>r.some(i=>i.source===t.source&&i.target===t.target&&(i.sourceHandle===t.sourceHandle||!i.sourceHandle&&!t.sourceHandle)&&(i.targetHandle===t.targetHandle||!i.targetHandle&&!t.targetHandle)),gg=(t,r,i={})=>{if(!t.source||!t.target)return r;const s=i.getEdgeId||B1;let l;return rg(t)?l={...t}:l={...t,id:s(t)},H1(l,r)?r:(l.sourceHandle===null&&delete l.sourceHandle,l.targetHandle===null&&delete l.targetHandle,r.concat(l))};function yg({sourceX:t,sourceY:r,targetX:i,targetY:s}){const[l,c,d,h]=mg({sourceX:t,sourceY:r,targetX:i,targetY:s});return[`M ${t},${r}L ${i},${s}`,l,c,d,h]}const Eh={[Ze.Left]:{x:-1,y:0},[Ze.Right]:{x:1,y:0},[Ze.Top]:{x:0,y:-1},[Ze.Bottom]:{x:0,y:1}},V1=({source:t,sourcePosition:r=Ze.Bottom,target:i})=>r===Ze.Left||r===Ze.Right?t.x<i.x?{x:1,y:0}:{x:-1,y:0}:t.y<i.y?{x:0,y:1}:{x:0,y:-1},Ch=(t,r)=>Math.sqrt(Math.pow(r.x-t.x,2)+Math.pow(r.y-t.y,2));function U1({source:t,sourcePosition:r=Ze.Bottom,target:i,targetPosition:s=Ze.Top,center:l,offset:c,stepPosition:d}){const h=Eh[r],y=Eh[s],b={x:t.x+h.x*c,y:t.y+h.y*c},k={x:i.x+y.x*c,y:i.y+y.y*c},w=V1({source:b,sourcePosition:r,target:k}),S=w.x!==0?"x":"y",C=w[S];let j=[],$,T;const I={x:0,y:0},U={x:0,y:0},[,,P,R]=mg({sourceX:t.x,sourceY:t.y,targetX:i.x,targetY:i.y});if(h[S]*y[S]===-1){S==="x"?($=l.x??b.x+(k.x-b.x)*d,T=l.y??(b.y+k.y)/2):($=l.x??(b.x+k.x)/2,T=l.y??b.y+(k.y-b.y)*d);const ce=[{x:$,y:b.y},{x:$,y:k.y}],de=[{x:b.x,y:T},{x:k.x,y:T}];h[S]===C?j=S==="x"?ce:de:j=S==="x"?de:ce}else{const ce=[{x:b.x,y:k.y}],de=[{x:k.x,y:b.y}];if(S==="x"?j=h.x===C?de:ce:j=h.y===C?ce:de,r===s){const L=Math.abs(t[S]-i[S]);if(L<=c){const le=Math.min(c-1,c-L);h[S]===C?I[S]=(b[S]>t[S]?-1:1)*le:U[S]=(k[S]>i[S]?-1:1)*le}}if(r!==s){const L=S==="x"?"y":"x",le=h[S]===y[L],G=b[L]>k[L],ie=b[L]<k[L];(h[S]===1&&(!le&&G||le&&ie)||h[S]!==1&&(!le&&ie||le&&G))&&(j=S==="x"?ce:de)}const we={x:b.x+I.x,y:b.y+I.y},q={x:k.x+U.x,y:k.y+U.y},fe=Math.max(Math.abs(we.x-j[0].x),Math.abs(q.x-j[0].x)),xe=Math.max(Math.abs(we.y-j[0].y),Math.abs(q.y-j[0].y));fe>=xe?($=(we.x+q.x)/2,T=j[0].y):($=j[0].x,T=(we.y+q.y)/2)}const H={x:b.x+I.x,y:b.y+I.y},V={x:k.x+U.x,y:k.y+U.y};return[[t,...H.x!==j[0].x||H.y!==j[0].y?[H]:[],...j,...V.x!==j[j.length-1].x||V.y!==j[j.length-1].y?[V]:[],i],$,T,P,R]}function K1(t,r,i,s){const l=Math.min(Ch(t,r)/2,Ch(r,i)/2,s),{x:c,y:d}=r;if(t.x===c&&c===i.x||t.y===d&&d===i.y)return`L${c} ${d}`;if(t.y===d){const b=t.x<i.x?-1:1,k=t.y<i.y?1:-1;return`L ${c+l*b},${d}Q ${c},${d} ${c},${d+l*k}`}const h=t.x<i.x?1:-1,y=t.y<i.y?-1:1;return`L ${c},${d+l*y}Q ${c},${d} ${c+l*h},${d}`}function Mf({sourceX:t,sourceY:r,sourcePosition:i=Ze.Bottom,targetX:s,targetY:l,targetPosition:c=Ze.Top,borderRadius:d=5,centerX:h,centerY:y,offset:b=20,stepPosition:k=.5}){const[w,S,C,j,$]=U1({source:{x:t,y:r},sourcePosition:i,target:{x:s,y:l},targetPosition:c,center:{x:h,y},offset:b,stepPosition:k});let T=`M${w[0].x} ${w[0].y}`;for(let I=1;I<w.length-1;I++)T+=K1(w[I-1],w[I],w[I+1],d);return T+=`L${w[w.length-1].x} ${w[w.length-1].y}`,[T,S,C,j,$]}function jh(t){var r;return t&&!!(t.internals.handleBounds||(r=t.handles)!=null&&r.length)&&!!(t.measured.width||t.width||t.initialWidth)}function q1(t){var w;const{sourceNode:r,targetNode:i}=t;if(!jh(r)||!jh(i))return null;const s=r.internals.handleBounds||Ph(r.handles),l=i.internals.handleBounds||Ph(i.handles),c=Mh((s==null?void 0:s.source)??[],t.sourceHandle),d=Mh(t.connectionMode===$s.Strict?(l==null?void 0:l.target)??[]:((l==null?void 0:l.target)??[]).concat((l==null?void 0:l.source)??[]),t.targetHandle);if(!c||!d)return(w=t.onError)==null||w.call(t,"008",eo.error008(c?"target":"source",{id:t.id,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle})),null;const h=(c==null?void 0:c.position)||Ze.Bottom,y=(d==null?void 0:d.position)||Ze.Top,b=Bi(r,c,h),k=Bi(i,d,y);return{sourceX:b.x,sourceY:b.y,targetX:k.x,targetY:k.y,sourcePosition:h,targetPosition:y}}function Ph(t){if(!t)return null;const r=[],i=[];for(const s of t)s.width=s.width??1,s.height=s.height??1,s.type==="source"?r.push(s):s.type==="target"&&i.push(s);return{source:r,target:i}}function Bi(t,r,i=Ze.Left,s=!1){const l=((r==null?void 0:r.x)??0)+t.internals.positionAbsolute.x,c=((r==null?void 0:r.y)??0)+t.internals.positionAbsolute.y,{width:d,height:h}=r??Ao(t);if(s)return{x:l+d/2,y:c+h/2};switch((r==null?void 0:r.position)??i){case Ze.Top:return{x:l+d/2,y:c};case Ze.Right:return{x:l+d,y:c+h/2};case Ze.Bottom:return{x:l+d/2,y:c+h};case Ze.Left:return{x:l,y:c+h/2}}}function Mh(t,r){return t&&(r?t.find(i=>i.id===r):t[0])||null}function $f(t,r){return t?typeof t=="string"?t:`${r?`${r}__`:""}${Object.keys(t).sort().map(s=>`${s}=${t[s]}`).join("&")}`:""}function W1(t,{id:r,defaultColor:i,defaultMarkerStart:s,defaultMarkerEnd:l}){const c=new Set;return t.reduce((d,h)=>([h.markerStart||s,h.markerEnd||l].forEach(y=>{if(y&&typeof y=="object"){const b=$f(y,r);c.has(b)||(d.push({id:b,color:y.color||i,...y}),c.add(b))}}),d),[]).sort((d,h)=>d.id.localeCompare(h.id))}const vg=1e3,Y1=10,Yf={nodeOrigin:[0,0],nodeExtent:ja,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},X1={...Yf,checkEquality:!0};function Xf(t,r){const i={...t};for(const s in r)r[s]!==void 0&&(i[s]=r[s]);return i}function Q1(t,r,i){const s=Xf(Yf,i);for(const l of t.values())if(l.parentId)Gf(l,t,r,s);else{const c=Ra(l,s.nodeOrigin),d=As(l.extent)?l.extent:s.nodeExtent,h=Fi(c,d,Ao(l));l.internals.positionAbsolute=h}}function G1(t,r){if(!t.handles)return t.measured?r==null?void 0:r.internals.handleBounds:void 0;const i=[],s=[];for(const l of t.handles){const c={id:l.id,width:l.width??1,height:l.height??1,nodeId:t.id,x:l.x,y:l.y,position:l.position,type:l.type};l.type==="source"?i.push(c):l.type==="target"&&s.push(c)}return{source:i,target:s}}function Qf(t){return t==="manual"}function Tf(t,r,i,s={}){var k,w;const l=Xf(X1,s),c={i:0},d=new Map(r),h=l!=null&&l.elevateNodesOnSelect&&!Qf(l.zIndexMode)?vg:0;let y=t.length>0,b=!1;r.clear(),i.clear();for(const S of t){let C=d.get(S.id);if(l.checkEquality&&S===(C==null?void 0:C.internals.userNode))r.set(S.id,C);else{const j=Ra(S,l.nodeOrigin),$=As(S.extent)?S.extent:l.nodeExtent,T=Fi(j,$,Ao(S));C={...l.defaults,...S,measured:{width:(k=S.measured)==null?void 0:k.width,height:(w=S.measured)==null?void 0:w.height},internals:{positionAbsolute:T,handleBounds:G1(S,C),z:xg(S,h,l.zIndexMode),userNode:S}},r.set(S.id,C)}(C.measured===void 0||C.measured.width===void 0||C.measured.height===void 0)&&!C.hidden&&(y=!1),S.parentId&&Gf(C,r,i,s,c),b||(b=S.selected??!1)}return{nodesInitialized:y,hasSelectedNodes:b}}function J1(t,r){if(!t.parentId)return;const i=r.get(t.parentId);i?i.set(t.id,t):r.set(t.parentId,new Map([[t.id,t]]))}function Gf(t,r,i,s,l){const{elevateNodesOnSelect:c,nodeOrigin:d,nodeExtent:h,zIndexMode:y}=Xf(Yf,s),b=t.parentId,k=r.get(b);if(!k){console.warn(`Parent node ${b} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}J1(t,i),l&&!k.parentId&&k.internals.rootParentIndex===void 0&&y==="auto"&&(k.internals.rootParentIndex=++l.i,k.internals.z=k.internals.z+l.i*Y1),l&&k.internals.rootParentIndex!==void 0&&(l.i=k.internals.rootParentIndex);const w=c&&!Qf(y)?vg:0,{x:S,y:C,z:j}=Z1(t,k,d,h,w,y),{positionAbsolute:$}=t.internals,T=S!==$.x||C!==$.y;(T||j!==t.internals.z)&&r.set(t.id,{...t,internals:{...t.internals,positionAbsolute:T?{x:S,y:C}:$,z:j}})}function xg(t,r,i){const s=Dr(t.zIndex)?t.zIndex:0;return Qf(i)?s:s+(t.selected?r:0)}function Z1(t,r,i,s,l,c){const{x:d,y:h}=r.internals.positionAbsolute,y=Ao(t),b=Ra(t,i),k=As(t.extent)?Fi(b,t.extent,y):b;let w=Fi({x:d+k.x,y:h+k.y},s,y);t.extent==="parent"&&(w=ig(w,y,r));const S=xg(t,l,c),C=r.internals.z??0;return{x:w.x,y:w.y,z:C>=S?C+1:S}}function Jf(t,r,i,s=[0,0]){var d;const l=[],c=new Map;for(const h of t){const y=r.get(h.parentId);if(!y)continue;const b=((d=c.get(h.parentId))==null?void 0:d.expandedRect)??Is(y),k=ag(b,h.rect);c.set(h.parentId,{expandedRect:k,parent:y})}return c.size>0&&c.forEach(({expandedRect:h,parent:y},b)=>{var P;const k=y.internals.positionAbsolute,w=Ao(y),S=y.origin??s,C=h.x<k.x?Math.round(Math.abs(k.x-h.x)):0,j=h.y<k.y?Math.round(Math.abs(k.y-h.y)):0,$=Math.max(w.width,Math.round(h.width)),T=Math.max(w.height,Math.round(h.height)),I=($-w.width)*S[0],U=(T-w.height)*S[1];(C>0||j>0||I||U)&&(l.push({id:b,type:"position",position:{x:y.position.x-C+I,y:y.position.y-j+U}}),(P=i.get(b))==null||P.forEach(R=>{t.some(H=>H.id===R.id)||l.push({id:R.id,type:"position",position:{x:R.position.x+C,y:R.position.y+j}})})),(w.width<h.width||w.height<h.height||C||j)&&l.push({id:b,type:"dimensions",setAttributes:!0,dimensions:{width:$+(C?S[0]*C-I:0),height:T+(j?S[1]*j-U:0)}})}),l}function eb(t,r,i,s,l,c,d){const h=s==null?void 0:s.querySelector(".xyflow__viewport");let y=!1;if(!h)return{changes:[],updatedInternals:y};const b=[],k=window.getComputedStyle(h),{m22:w}=new window.DOMMatrixReadOnly(k.transform),S=[];for(const C of t.values()){const j=r.get(C.id);if(!j)continue;if(j.hidden){r.set(j.id,{...j,internals:{...j.internals,handleBounds:void 0}}),y=!0;continue}const $=Wf(C.nodeElement),T=j.measured.width!==$.width||j.measured.height!==$.height;if(!!($.width&&$.height&&(T||!j.internals.handleBounds||C.force))){const U=C.nodeElement.getBoundingClientRect(),P=As(j.extent)?j.extent:c;let{positionAbsolute:R}=j.internals;j.parentId&&j.extent==="parent"?R=ig(R,$,r.get(j.parentId)):P&&(R=Fi(R,P,$));const H={...j,measured:$,internals:{...j.internals,positionAbsolute:R,handleBounds:{source:kh("source",C.nodeElement,U,w,j.id),target:kh("target",C.nodeElement,U,w,j.id)}}};r.set(j.id,H),j.parentId&&Gf(H,r,i,{nodeOrigin:l,zIndexMode:d}),y=!0,T&&(b.push({id:j.id,type:"dimensions",dimensions:$}),j.expandParent&&j.parentId&&S.push({id:j.id,parentId:j.parentId,rect:Is(H,l)}))}}if(S.length>0){const C=Jf(S,r,i,l);b.push(...C)}return{changes:b,updatedInternals:y}}async function tb({delta:t,panZoom:r,transform:i,translateExtent:s,width:l,height:c}){if(!r||!t.x&&!t.y)return Promise.resolve(!1);const d=await r.setViewportConstrained({x:i[0]+t.x,y:i[1]+t.y,zoom:i[2]},[[0,0],[l,c]],s),h=!!d&&(d.x!==i[0]||d.y!==i[1]||d.k!==i[2]);return Promise.resolve(h)}function $h(t,r,i,s,l,c){let d=l;const h=s.get(d)||new Map;s.set(d,h.set(i,r)),d=`${l}-${t}`;const y=s.get(d)||new Map;if(s.set(d,y.set(i,r)),c){d=`${l}-${t}-${c}`;const b=s.get(d)||new Map;s.set(d,b.set(i,r))}}function wg(t,r,i){t.clear(),r.clear();for(const s of i){const{source:l,target:c,sourceHandle:d=null,targetHandle:h=null}=s,y={edgeId:s.id,source:l,target:c,sourceHandle:d,targetHandle:h},b=`${l}-${d}--${c}-${h}`,k=`${c}-${h}--${l}-${d}`;$h("source",y,k,t,l,d),$h("target",y,b,t,c,h),r.set(s.id,s)}}function bg(t,r){if(!t.parentId)return!1;const i=r.get(t.parentId);return i?i.selected?!0:bg(i,r):!1}function Th(t,r,i){var l;let s=t;do{if((l=s==null?void 0:s.matches)!=null&&l.call(s,r))return!0;if(s===i)return!1;s=s==null?void 0:s.parentElement}while(s);return!1}function nb(t,r,i,s){const l=new Map;for(const[c,d]of t)if((d.selected||d.id===s)&&(!d.parentId||!bg(d,t))&&(d.draggable||r&&typeof d.draggable>"u")){const h=t.get(c);h&&l.set(c,{id:c,position:h.position||{x:0,y:0},distance:{x:i.x-h.internals.positionAbsolute.x,y:i.y-h.internals.positionAbsolute.y},extent:h.extent,parentId:h.parentId,origin:h.origin,expandParent:h.expandParent,internals:{positionAbsolute:h.internals.positionAbsolute||{x:0,y:0}},measured:{width:h.measured.width??0,height:h.measured.height??0}})}return l}function af({nodeId:t,dragItems:r,nodeLookup:i,dragging:s=!0}){var d,h,y;const l=[];for(const[b,k]of r){const w=(d=i.get(b))==null?void 0:d.internals.userNode;w&&l.push({...w,position:k.position,dragging:s})}if(!t)return[l[0],l];const c=(h=i.get(t))==null?void 0:h.internals.userNode;return[c?{...c,position:((y=r.get(t))==null?void 0:y.position)||c.position,dragging:s}:l[0],l]}function rb({dragItems:t,snapGrid:r,x:i,y:s}){const l=t.values().next().value;if(!l)return null;const c={x:i-l.distance.x,y:s-l.distance.y},d=Da(c,r);return{x:d.x-c.x,y:d.y-c.y}}function ob({onNodeMouseDown:t,getStoreItems:r,onDragStart:i,onDrag:s,onDragStop:l}){let c={x:null,y:null},d=0,h=new Map,y=!1,b={x:0,y:0},k=null,w=!1,S=null,C=!1,j=!1,$=null;function T({noDragClassName:U,handleSelector:P,domNode:R,isSelectable:H,nodeId:V,nodeClickDistance:Q=0}){S=ir(R);function ce({x:fe,y:xe}){const{nodeLookup:L,nodeExtent:le,snapGrid:G,snapToGrid:ie,nodeOrigin:F,onNodeDrag:W,onSelectionDrag:B,onError:A,updateNodePositions:K}=r();c={x:fe,y:xe};let be=!1;const Se=h.size>1,Me=Se&&le?Pf(La(h)):null,Ie=Se&&ie?rb({dragItems:h,snapGrid:G,x:fe,y:xe}):null;for(const[Ae,_e]of h){if(!L.has(Ae))continue;let ze={x:fe-_e.distance.x,y:xe-_e.distance.y};ie&&(ze=Ie?{x:Math.round(ze.x+Ie.x),y:Math.round(ze.y+Ie.y)}:Da(ze,G));let ke=null;if(Se&&le&&!_e.extent&&Me){const{positionAbsolute:Ue}=_e.internals,lt=Ue.x-Me.x+le[0][0],ut=Ue.x+_e.measured.width-Me.x2+le[1][0],it=Ue.y-Me.y+le[0][1],Ct=Ue.y+_e.measured.height-Me.y2+le[1][1];ke=[[lt,it],[ut,Ct]]}const{position:Be,positionAbsolute:Re}=og({nodeId:Ae,nextPosition:ze,nodeLookup:L,nodeExtent:ke||le,nodeOrigin:F,onError:A});be=be||_e.position.x!==Be.x||_e.position.y!==Be.y,_e.position=Be,_e.internals.positionAbsolute=Re}if(j=j||be,!!be&&(K(h,!0),$&&(s||W||!V&&B))){const[Ae,_e]=af({nodeId:V,dragItems:h,nodeLookup:L});s==null||s($,h,Ae,_e),W==null||W($,Ae,_e),V||B==null||B($,_e)}}async function de(){if(!k)return;const{transform:fe,panBy:xe,autoPanSpeed:L,autoPanOnNodeDrag:le}=r();if(!le){y=!1,cancelAnimationFrame(d);return}const[G,ie]=sg(b,k,L);(G!==0||ie!==0)&&(c.x=(c.x??0)-G/fe[2],c.y=(c.y??0)-ie/fe[2],await xe({x:G,y:ie})&&ce(c)),d=requestAnimationFrame(de)}function we(fe){var Se;const{nodeLookup:xe,multiSelectionActive:L,nodesDraggable:le,transform:G,snapGrid:ie,snapToGrid:F,selectNodesOnDrag:W,onNodeDragStart:B,onSelectionDragStart:A,unselectNodesAndEdges:K}=r();w=!0,(!W||!H)&&!L&&V&&((Se=xe.get(V))!=null&&Se.selected||K()),H&&W&&V&&(t==null||t(V));const be=Sa(fe.sourceEvent,{transform:G,snapGrid:ie,snapToGrid:F,containerBounds:k});if(c=be,h=nb(xe,le,be,V),h.size>0&&(i||B||!V&&A)){const[Me,Ie]=af({nodeId:V,dragItems:h,nodeLookup:xe});i==null||i(fe.sourceEvent,h,Me,Ie),B==null||B(fe.sourceEvent,Me,Ie),V||A==null||A(fe.sourceEvent,Ie)}}const q=Lm().clickDistance(Q).on("start",fe=>{const{domNode:xe,nodeDragThreshold:L,transform:le,snapGrid:G,snapToGrid:ie}=r();k=(xe==null?void 0:xe.getBoundingClientRect())||null,C=!1,j=!1,$=fe.sourceEvent,L===0&&we(fe),c=Sa(fe.sourceEvent,{transform:le,snapGrid:G,snapToGrid:ie,containerBounds:k}),b=zr(fe.sourceEvent,k)}).on("drag",fe=>{const{autoPanOnNodeDrag:xe,transform:L,snapGrid:le,snapToGrid:G,nodeDragThreshold:ie,nodeLookup:F}=r(),W=Sa(fe.sourceEvent,{transform:L,snapGrid:le,snapToGrid:G,containerBounds:k});if($=fe.sourceEvent,(fe.sourceEvent.type==="touchmove"&&fe.sourceEvent.touches.length>1||V&&!F.has(V))&&(C=!0),!C){if(!y&&xe&&w&&(y=!0,de()),!w){const B=zr(fe.sourceEvent,k),A=B.x-b.x,K=B.y-b.y;Math.sqrt(A*A+K*K)>ie&&we(fe)}(c.x!==W.xSnapped||c.y!==W.ySnapped)&&h&&w&&(b=zr(fe.sourceEvent,k),ce(W))}}).on("end",fe=>{if(!(!w||C)&&(y=!1,w=!1,cancelAnimationFrame(d),h.size>0)){const{nodeLookup:xe,updateNodePositions:L,onNodeDragStop:le,onSelectionDragStop:G}=r();if(j&&(L(h,!1),j=!1),l||le||!V&&G){const[ie,F]=af({nodeId:V,dragItems:h,nodeLookup:xe,dragging:!1});l==null||l(fe.sourceEvent,h,ie,F),le==null||le(fe.sourceEvent,ie,F),V||G==null||G(fe.sourceEvent,F)}}}).filter(fe=>{const xe=fe.target;return!fe.button&&(!U||!Th(xe,`.${U}`,R))&&(!P||Th(xe,P,R))});S.call(q)}function I(){S==null||S.on(".drag",null)}return{update:T,destroy:I}}function ib(t,r,i){const s=[],l={x:t.x-i,y:t.y-i,width:i*2,height:i*2};for(const c of r.values())Ma(l,Is(c))>0&&s.push(c);return s}const sb=250;function ab(t,r,i,s){var h,y;let l=[],c=1/0;const d=ib(t,i,r+sb);for(const b of d){const k=[...((h=b.internals.handleBounds)==null?void 0:h.source)??[],...((y=b.internals.handleBounds)==null?void 0:y.target)??[]];for(const w of k){if(s.nodeId===w.nodeId&&s.type===w.type&&s.id===w.id)continue;const{x:S,y:C}=Bi(b,w,w.position,!0),j=Math.sqrt(Math.pow(S-t.x,2)+Math.pow(C-t.y,2));j>r||(j<c?(l=[{...w,x:S,y:C}],c=j):j===c&&l.push({...w,x:S,y:C}))}}if(!l.length)return null;if(l.length>1){const b=s.type==="source"?"target":"source";return l.find(k=>k.type===b)??l[0]}return l[0]}function _g(t,r,i,s,l,c=!1){var b,k,w;const d=s.get(t);if(!d)return null;const h=l==="strict"?(b=d.internals.handleBounds)==null?void 0:b[r]:[...((k=d.internals.handleBounds)==null?void 0:k.source)??[],...((w=d.internals.handleBounds)==null?void 0:w.target)??[]],y=(i?h==null?void 0:h.find(S=>S.id===i):h==null?void 0:h[0])??null;return y&&c?{...y,...Bi(d,y,y.position,!0)}:y}function Sg(t,r){return t||(r!=null&&r.classList.contains("target")?"target":r!=null&&r.classList.contains("source")?"source":null)}function lb(t,r){let i=null;return r?i=!0:t&&!r&&(i=!1),i}const kg=()=>!0;function ub(t,{connectionMode:r,connectionRadius:i,handleId:s,nodeId:l,edgeUpdaterType:c,isTarget:d,domNode:h,nodeLookup:y,lib:b,autoPanOnConnect:k,flowId:w,panBy:S,cancelConnection:C,onConnectStart:j,onConnect:$,onConnectEnd:T,isValidConnection:I=kg,onReconnectEnd:U,updateConnection:P,getTransform:R,getFromHandle:H,autoPanSpeed:V,dragThreshold:Q=1,handleDomNode:ce}){const de=cg(t.target);let we=0,q;const{x:fe,y:xe}=zr(t),L=Sg(c,ce),le=h==null?void 0:h.getBoundingClientRect();let G=!1;if(!le||!L)return;const ie=_g(l,L,s,y,r);if(!ie)return;let F=zr(t,le),W=!1,B=null,A=!1,K=null;function be(){if(!k||!le)return;const[Be,Re]=sg(F,le,V);S({x:Be,y:Re}),we=requestAnimationFrame(be)}const Se={...ie,nodeId:l,type:L,position:ie.position},Me=y.get(l);let Ae={inProgress:!0,isValid:null,from:Bi(Me,Se,Ze.Left,!0),fromHandle:Se,fromPosition:Se.position,fromNode:Me,to:F,toHandle:null,toPosition:wh[Se.position],toNode:null,pointer:F};function _e(){G=!0,P(Ae),j==null||j(t,{nodeId:l,handleId:s,handleType:L})}Q===0&&_e();function ze(Be){if(!G){const{x:Ct,y:qt}=zr(Be),Gt=Ct-fe,Rt=qt-xe;if(!(Gt*Gt+Rt*Rt>Q*Q))return;_e()}if(!H()||!Se){ke(Be);return}const Re=R();F=zr(Be,le),q=ab(za(F,Re,!1,[1,1]),i,y,Se),W||(be(),W=!0);const Ue=Ng(Be,{handle:q,connectionMode:r,fromNodeId:l,fromHandleId:s,fromType:d?"target":"source",isValidConnection:I,doc:de,lib:b,flowId:w,nodeLookup:y});K=Ue.handleDomNode,B=Ue.connection,A=lb(!!q,Ue.isValid);const lt=y.get(l),ut=lt?Bi(lt,Se,Ze.Left,!0):Ae.from,it={...Ae,from:ut,isValid:A,to:Ue.toHandle&&A?vu({x:Ue.toHandle.x,y:Ue.toHandle.y},Re):F,toHandle:Ue.toHandle,toPosition:A&&Ue.toHandle?Ue.toHandle.position:wh[Se.position],toNode:Ue.toHandle?y.get(Ue.toHandle.nodeId):null,pointer:F};P(it),Ae=it}function ke(Be){if(!("touches"in Be&&Be.touches.length>0)){if(G){(q||K)&&B&&A&&($==null||$(B));const{inProgress:Re,...Ue}=Ae,lt={...Ue,toPosition:Ae.toHandle?Ae.toPosition:null};T==null||T(Be,lt),c&&(U==null||U(Be,lt))}C(),cancelAnimationFrame(we),W=!1,A=!1,B=null,K=null,de.removeEventListener("mousemove",ze),de.removeEventListener("mouseup",ke),de.removeEventListener("touchmove",ze),de.removeEventListener("touchend",ke)}}de.addEventListener("mousemove",ze),de.addEventListener("mouseup",ke),de.addEventListener("touchmove",ze),de.addEventListener("touchend",ke)}function Ng(t,{handle:r,connectionMode:i,fromNodeId:s,fromHandleId:l,fromType:c,doc:d,lib:h,flowId:y,isValidConnection:b=kg,nodeLookup:k}){const w=c==="target",S=r?d.querySelector(`.${h}-flow__handle[data-id="${y}-${r==null?void 0:r.nodeId}-${r==null?void 0:r.id}-${r==null?void 0:r.type}"]`):null,{x:C,y:j}=zr(t),$=d.elementFromPoint(C,j),T=$!=null&&$.classList.contains(`${h}-flow__handle`)?$:S,I={handleDomNode:T,isValid:!1,connection:null,toHandle:null};if(T){const U=Sg(void 0,T),P=T.getAttribute("data-nodeid"),R=T.getAttribute("data-handleid"),H=T.classList.contains("connectable"),V=T.classList.contains("connectableend");if(!P||!U)return I;const Q={source:w?P:s,sourceHandle:w?R:l,target:w?s:P,targetHandle:w?l:R};I.connection=Q;const de=H&&V&&(i===$s.Strict?w&&U==="source"||!w&&U==="target":P!==s||R!==l);I.isValid=de&&b(Q),I.toHandle=_g(P,U,R,k,i,!0)}return I}const If={onPointerDown:ub,isValid:Ng};function cb({domNode:t,panZoom:r,getTransform:i,getViewScale:s}){const l=ir(t);function c({translateExtent:h,width:y,height:b,zoomStep:k=1,pannable:w=!0,zoomable:S=!0,inversePan:C=!1}){const j=P=>{if(P.sourceEvent.type!=="wheel"||!r)return;const R=i(),H=P.sourceEvent.ctrlKey&&$a()?10:1,V=-P.sourceEvent.deltaY*(P.sourceEvent.deltaMode===1?.05:P.sourceEvent.deltaMode?1:.002)*k,Q=R[2]*Math.pow(2,V*H);r.scaleTo(Q)};let $=[0,0];const T=P=>{(P.sourceEvent.type==="mousedown"||P.sourceEvent.type==="touchstart")&&($=[P.sourceEvent.clientX??P.sourceEvent.touches[0].clientX,P.sourceEvent.clientY??P.sourceEvent.touches[0].clientY])},I=P=>{const R=i();if(P.sourceEvent.type!=="mousemove"&&P.sourceEvent.type!=="touchmove"||!r)return;const H=[P.sourceEvent.clientX??P.sourceEvent.touches[0].clientX,P.sourceEvent.clientY??P.sourceEvent.touches[0].clientY],V=[H[0]-$[0],H[1]-$[1]];$=H;const Q=s()*Math.max(R[2],Math.log(R[2]))*(C?-1:1),ce={x:R[0]-V[0]*Q,y:R[1]-V[1]*Q},de=[[0,0],[y,b]];r.setViewportConstrained({x:ce.x,y:ce.y,zoom:R[2]},de,h)},U=Jm().on("start",T).on("zoom",w?I:null).on("zoom.wheel",S?j:null);l.call(U,{})}function d(){l.on("zoom",null)}return{update:c,destroy:d,pointer:Rr}}const $u=t=>({x:t.x,y:t.y,zoom:t.k}),lf=({x:t,y:r,zoom:i})=>ju.translate(t,r).scale(i),Ns=(t,r)=>t.target.closest(`.${r}`),Eg=(t,r)=>r===2&&Array.isArray(t)&&t.includes(2),fb=t=>((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2,uf=(t,r=0,i=fb,s=()=>{})=>{const l=typeof r=="number"&&r>0;return l||s(),l?t.transition().duration(r).ease(i).on("end",s):t},Cg=t=>{const r=t.ctrlKey&&$a()?10:1;return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*r};function db({zoomPanValues:t,noWheelClassName:r,d3Selection:i,d3Zoom:s,panOnScrollMode:l,panOnScrollSpeed:c,zoomOnPinch:d,onPanZoomStart:h,onPanZoom:y,onPanZoomEnd:b}){return k=>{if(Ns(k,r))return k.ctrlKey&&k.preventDefault(),!1;k.preventDefault(),k.stopImmediatePropagation();const w=i.property("__zoom").k||1;if(k.ctrlKey&&d){const T=Rr(k),I=Cg(k),U=w*Math.pow(2,I);s.scaleTo(i,U,T,k);return}const S=k.deltaMode===1?20:1;let C=l===Li.Vertical?0:k.deltaX*S,j=l===Li.Horizontal?0:k.deltaY*S;!$a()&&k.shiftKey&&l!==Li.Vertical&&(C=k.deltaY*S,j=0),s.translateBy(i,-(C/w)*c,-(j/w)*c,{internal:!0});const $=$u(i.property("__zoom"));clearTimeout(t.panScrollTimeout),t.isPanScrolling?(y==null||y(k,$),t.panScrollTimeout=setTimeout(()=>{b==null||b(k,$),t.isPanScrolling=!1},150)):(t.isPanScrolling=!0,h==null||h(k,$))}}function pb({noWheelClassName:t,preventScrolling:r,d3ZoomHandler:i}){return function(s,l){const c=s.type==="wheel",d=!r&&c&&!s.ctrlKey,h=Ns(s,t);if(s.ctrlKey&&c&&h&&s.preventDefault(),d||h)return null;s.preventDefault(),i.call(this,s,l)}}function hb({zoomPanValues:t,onDraggingChange:r,onPanZoomStart:i}){return s=>{var c,d,h;if((c=s.sourceEvent)!=null&&c.internal)return;const l=$u(s.transform);t.mouseButton=((d=s.sourceEvent)==null?void 0:d.button)||0,t.isZoomingOrPanning=!0,t.prevViewport=l,((h=s.sourceEvent)==null?void 0:h.type)==="mousedown"&&r(!0),i&&(i==null||i(s.sourceEvent,l))}}function mb({zoomPanValues:t,panOnDrag:r,onPaneContextMenu:i,onTransformChange:s,onPanZoom:l}){return c=>{var d,h;t.usedRightMouseButton=!!(i&&Eg(r,t.mouseButton??0)),(d=c.sourceEvent)!=null&&d.sync||s([c.transform.x,c.transform.y,c.transform.k]),l&&!((h=c.sourceEvent)!=null&&h.internal)&&(l==null||l(c.sourceEvent,$u(c.transform)))}}function gb({zoomPanValues:t,panOnDrag:r,panOnScroll:i,onDraggingChange:s,onPanZoomEnd:l,onPaneContextMenu:c}){return d=>{var h;if(!((h=d.sourceEvent)!=null&&h.internal)&&(t.isZoomingOrPanning=!1,c&&Eg(r,t.mouseButton??0)&&!t.usedRightMouseButton&&d.sourceEvent&&c(d.sourceEvent),t.usedRightMouseButton=!1,s(!1),l)){const y=$u(d.transform);t.prevViewport=y,clearTimeout(t.timerId),t.timerId=setTimeout(()=>{l==null||l(d.sourceEvent,y)},i?150:0)}}}function yb({zoomActivationKeyPressed:t,zoomOnScroll:r,zoomOnPinch:i,panOnDrag:s,panOnScroll:l,zoomOnDoubleClick:c,userSelectionActive:d,noWheelClassName:h,noPanClassName:y,lib:b,connectionInProgress:k}){return w=>{var T;const S=t||r,C=i&&w.ctrlKey,j=w.type==="wheel";if(w.button===1&&w.type==="mousedown"&&(Ns(w,`${b}-flow__node`)||Ns(w,`${b}-flow__edge`)))return!0;if(!s&&!S&&!l&&!c&&!i||d||k&&!j||Ns(w,h)&&j||Ns(w,y)&&(!j||l&&j&&!t)||!i&&w.ctrlKey&&j)return!1;if(!i&&w.type==="touchstart"&&((T=w.touches)==null?void 0:T.length)>1)return w.preventDefault(),!1;if(!S&&!l&&!C&&j||!s&&(w.type==="mousedown"||w.type==="touchstart")||Array.isArray(s)&&!s.includes(w.button)&&w.type==="mousedown")return!1;const $=Array.isArray(s)&&s.includes(w.button)||!w.button||w.button<=1;return(!w.ctrlKey||j)&&$}}function vb({domNode:t,minZoom:r,maxZoom:i,translateExtent:s,viewport:l,onPanZoom:c,onPanZoomStart:d,onPanZoomEnd:h,onDraggingChange:y}){const b={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},k=t.getBoundingClientRect(),w=Jm().scaleExtent([r,i]).translateExtent(s),S=ir(t).call(w);U({x:l.x,y:l.y,zoom:Ts(l.zoom,r,i)},[[0,0],[k.width,k.height]],s);const C=S.on("wheel.zoom"),j=S.on("dblclick.zoom");w.wheelDelta(Cg);function $(q,fe){return S?new Promise(xe=>{w==null||w.interpolate((fe==null?void 0:fe.interpolate)==="linear"?_a:nu).transform(uf(S,fe==null?void 0:fe.duration,fe==null?void 0:fe.ease,()=>xe(!0)),q)}):Promise.resolve(!1)}function T({noWheelClassName:q,noPanClassName:fe,onPaneContextMenu:xe,userSelectionActive:L,panOnScroll:le,panOnDrag:G,panOnScrollMode:ie,panOnScrollSpeed:F,preventScrolling:W,zoomOnPinch:B,zoomOnScroll:A,zoomOnDoubleClick:K,zoomActivationKeyPressed:be,lib:Se,onTransformChange:Me,connectionInProgress:Ie,paneClickDistance:Ae,selectionOnDrag:_e}){L&&!b.isZoomingOrPanning&&I();const ze=le&&!be&&!L;w.clickDistance(_e?1/0:!Dr(Ae)||Ae<0?0:Ae);const ke=ze?db({zoomPanValues:b,noWheelClassName:q,d3Selection:S,d3Zoom:w,panOnScrollMode:ie,panOnScrollSpeed:F,zoomOnPinch:B,onPanZoomStart:d,onPanZoom:c,onPanZoomEnd:h}):pb({noWheelClassName:q,preventScrolling:W,d3ZoomHandler:C});if(S.on("wheel.zoom",ke,{passive:!1}),!L){const Re=hb({zoomPanValues:b,onDraggingChange:y,onPanZoomStart:d});w.on("start",Re);const Ue=mb({zoomPanValues:b,panOnDrag:G,onPaneContextMenu:!!xe,onPanZoom:c,onTransformChange:Me});w.on("zoom",Ue);const lt=gb({zoomPanValues:b,panOnDrag:G,panOnScroll:le,onPaneContextMenu:xe,onPanZoomEnd:h,onDraggingChange:y});w.on("end",lt)}const Be=yb({zoomActivationKeyPressed:be,panOnDrag:G,zoomOnScroll:A,panOnScroll:le,zoomOnDoubleClick:K,zoomOnPinch:B,userSelectionActive:L,noPanClassName:fe,noWheelClassName:q,lib:Se,connectionInProgress:Ie});w.filter(Be),K?S.on("dblclick.zoom",j):S.on("dblclick.zoom",null)}function I(){w.on("zoom",null)}async function U(q,fe,xe){const L=lf(q),le=w==null?void 0:w.constrain()(L,fe,xe);return le&&await $(le),new Promise(G=>G(le))}async function P(q,fe){const xe=lf(q);return await $(xe,fe),new Promise(L=>L(xe))}function R(q){if(S){const fe=lf(q),xe=S.property("__zoom");(xe.k!==q.zoom||xe.x!==q.x||xe.y!==q.y)&&(w==null||w.transform(S,fe,null,{sync:!0}))}}function H(){const q=S?Gm(S.node()):{x:0,y:0,k:1};return{x:q.x,y:q.y,zoom:q.k}}function V(q,fe){return S?new Promise(xe=>{w==null||w.interpolate((fe==null?void 0:fe.interpolate)==="linear"?_a:nu).scaleTo(uf(S,fe==null?void 0:fe.duration,fe==null?void 0:fe.ease,()=>xe(!0)),q)}):Promise.resolve(!1)}function Q(q,fe){return S?new Promise(xe=>{w==null||w.interpolate((fe==null?void 0:fe.interpolate)==="linear"?_a:nu).scaleBy(uf(S,fe==null?void 0:fe.duration,fe==null?void 0:fe.ease,()=>xe(!0)),q)}):Promise.resolve(!1)}function ce(q){w==null||w.scaleExtent(q)}function de(q){w==null||w.translateExtent(q)}function we(q){const fe=!Dr(q)||q<0?0:q;w==null||w.clickDistance(fe)}return{update:T,destroy:I,setViewport:P,setViewportConstrained:U,getViewport:H,scaleTo:V,scaleBy:Q,setScaleExtent:ce,setTranslateExtent:de,syncViewport:R,setClickDistance:we}}var Os;(function(t){t.Line="line",t.Handle="handle"})(Os||(Os={}));function xb({width:t,prevWidth:r,height:i,prevHeight:s,affectsX:l,affectsY:c}){const d=t-r,h=i-s,y=[d>0?1:d<0?-1:0,h>0?1:h<0?-1:0];return d&&l&&(y[0]=y[0]*-1),h&&c&&(y[1]=y[1]*-1),y}function Ih(t){const r=t.includes("right")||t.includes("left"),i=t.includes("bottom")||t.includes("top"),s=t.includes("left"),l=t.includes("top");return{isHorizontal:r,isVertical:i,affectsX:s,affectsY:l}}function ui(t,r){return Math.max(0,r-t)}function ci(t,r){return Math.max(0,t-r)}function Ql(t,r,i){return Math.max(0,r-t,t-i)}function Ah(t,r){return t?!r:r}function wb(t,r,i,s,l,c,d,h){let{affectsX:y,affectsY:b}=r;const{isHorizontal:k,isVertical:w}=r,S=k&&w,{xSnapped:C,ySnapped:j}=i,{minWidth:$,maxWidth:T,minHeight:I,maxHeight:U}=s,{x:P,y:R,width:H,height:V,aspectRatio:Q}=t;let ce=Math.floor(k?C-t.pointerX:0),de=Math.floor(w?j-t.pointerY:0);const we=H+(y?-ce:ce),q=V+(b?-de:de),fe=-c[0]*H,xe=-c[1]*V;let L=Ql(we,$,T),le=Ql(q,I,U);if(d){let F=0,W=0;y&&ce<0?F=ui(P+ce+fe,d[0][0]):!y&&ce>0&&(F=ci(P+we+fe,d[1][0])),b&&de<0?W=ui(R+de+xe,d[0][1]):!b&&de>0&&(W=ci(R+q+xe,d[1][1])),L=Math.max(L,F),le=Math.max(le,W)}if(h){let F=0,W=0;y&&ce>0?F=ci(P+ce,h[0][0]):!y&&ce<0&&(F=ui(P+we,h[1][0])),b&&de>0?W=ci(R+de,h[0][1]):!b&&de<0&&(W=ui(R+q,h[1][1])),L=Math.max(L,F),le=Math.max(le,W)}if(l){if(k){const F=Ql(we/Q,I,U)*Q;if(L=Math.max(L,F),d){let W=0;!y&&!b||y&&!b&&S?W=ci(R+xe+we/Q,d[1][1])*Q:W=ui(R+xe+(y?ce:-ce)/Q,d[0][1])*Q,L=Math.max(L,W)}if(h){let W=0;!y&&!b||y&&!b&&S?W=ui(R+we/Q,h[1][1])*Q:W=ci(R+(y?ce:-ce)/Q,h[0][1])*Q,L=Math.max(L,W)}}if(w){const F=Ql(q*Q,$,T)/Q;if(le=Math.max(le,F),d){let W=0;!y&&!b||b&&!y&&S?W=ci(P+q*Q+fe,d[1][0])/Q:W=ui(P+(b?de:-de)*Q+fe,d[0][0])/Q,le=Math.max(le,W)}if(h){let W=0;!y&&!b||b&&!y&&S?W=ui(P+q*Q,h[1][0])/Q:W=ci(P+(b?de:-de)*Q,h[0][0])/Q,le=Math.max(le,W)}}}de=de+(de<0?le:-le),ce=ce+(ce<0?L:-L),l&&(S?we>q*Q?de=(Ah(y,b)?-ce:ce)/Q:ce=(Ah(y,b)?-de:de)*Q:k?(de=ce/Q,b=y):(ce=de*Q,y=b));const G=y?P+ce:P,ie=b?R+de:R;return{width:H+(y?-ce:ce),height:V+(b?-de:de),x:c[0]*ce*(y?-1:1)+G,y:c[1]*de*(b?-1:1)+ie}}const jg={width:0,height:0,x:0,y:0},bb={...jg,pointerX:0,pointerY:0,aspectRatio:1};function _b(t){return[[0,0],[t.measured.width,t.measured.height]]}function Sb(t,r,i){const s=r.position.x+t.position.x,l=r.position.y+t.position.y,c=t.measured.width??0,d=t.measured.height??0,h=i[0]*c,y=i[1]*d;return[[s-h,l-y],[s+c-h,l+d-y]]}function kb({domNode:t,nodeId:r,getStoreItems:i,onChange:s,onEnd:l}){const c=ir(t);let d={controlDirection:Ih("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function h({controlPosition:b,boundaries:k,keepAspectRatio:w,resizeDirection:S,onResizeStart:C,onResize:j,onResizeEnd:$,shouldResize:T}){let I={...jg},U={...bb};d={boundaries:k,resizeDirection:S,keepAspectRatio:w,controlDirection:Ih(b)};let P,R=null,H=[],V,Q,ce,de=!1;const we=Lm().on("start",q=>{const{nodeLookup:fe,transform:xe,snapGrid:L,snapToGrid:le,nodeOrigin:G,paneDomNode:ie}=i();if(P=fe.get(r),!P)return;R=(ie==null?void 0:ie.getBoundingClientRect())??null;const{xSnapped:F,ySnapped:W}=Sa(q.sourceEvent,{transform:xe,snapGrid:L,snapToGrid:le,containerBounds:R});I={width:P.measured.width??0,height:P.measured.height??0,x:P.position.x??0,y:P.position.y??0},U={...I,pointerX:F,pointerY:W,aspectRatio:I.width/I.height},V=void 0,P.parentId&&(P.extent==="parent"||P.expandParent)&&(V=fe.get(P.parentId),Q=V&&P.extent==="parent"?_b(V):void 0),H=[],ce=void 0;for(const[B,A]of fe)if(A.parentId===r&&(H.push({id:B,position:{...A.position},extent:A.extent}),A.extent==="parent"||A.expandParent)){const K=Sb(A,P,A.origin??G);ce?ce=[[Math.min(K[0][0],ce[0][0]),Math.min(K[0][1],ce[0][1])],[Math.max(K[1][0],ce[1][0]),Math.max(K[1][1],ce[1][1])]]:ce=K}C==null||C(q,{...I})}).on("drag",q=>{const{transform:fe,snapGrid:xe,snapToGrid:L,nodeOrigin:le}=i(),G=Sa(q.sourceEvent,{transform:fe,snapGrid:xe,snapToGrid:L,containerBounds:R}),ie=[];if(!P)return;const{x:F,y:W,width:B,height:A}=I,K={},be=P.origin??le,{width:Se,height:Me,x:Ie,y:Ae}=wb(U,d.controlDirection,G,d.boundaries,d.keepAspectRatio,be,Q,ce),_e=Se!==B,ze=Me!==A,ke=Ie!==F&&_e,Be=Ae!==W&&ze;if(!ke&&!Be&&!_e&&!ze)return;if((ke||Be||be[0]===1||be[1]===1)&&(K.x=ke?Ie:I.x,K.y=Be?Ae:I.y,I.x=K.x,I.y=K.y,H.length>0)){const ut=Ie-F,it=Ae-W;for(const Ct of H)Ct.position={x:Ct.position.x-ut+be[0]*(Se-B),y:Ct.position.y-it+be[1]*(Me-A)},ie.push(Ct)}if((_e||ze)&&(K.width=_e&&(!d.resizeDirection||d.resizeDirection==="horizontal")?Se:I.width,K.height=ze&&(!d.resizeDirection||d.resizeDirection==="vertical")?Me:I.height,I.width=K.width,I.height=K.height),V&&P.expandParent){const ut=be[0]*(K.width??0);K.x&&K.x<ut&&(I.x=ut,U.x=U.x-(K.x-ut));const it=be[1]*(K.height??0);K.y&&K.y<it&&(I.y=it,U.y=U.y-(K.y-it))}const Re=xb({width:I.width,prevWidth:B,height:I.height,prevHeight:A,affectsX:d.controlDirection.affectsX,affectsY:d.controlDirection.affectsY}),Ue={...I,direction:Re};(T==null?void 0:T(q,Ue))!==!1&&(de=!0,j==null||j(q,Ue),s(K,ie))}).on("end",q=>{de&&($==null||$(q,{...I}),l==null||l({...I}),de=!1)});c.call(we)}function y(){c.on(".drag",null)}return{update:h,destroy:y}}var cf={exports:{}},ff={},df={exports:{}},pf={};/**
|
|
181
|
+
* @license React
|
|
182
|
+
* use-sync-external-store-shim.production.js
|
|
183
|
+
*
|
|
184
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
185
|
+
*
|
|
186
|
+
* This source code is licensed under the MIT license found in the
|
|
187
|
+
* LICENSE file in the root directory of this source tree.
|
|
188
|
+
*/var Oh;function Nb(){if(Oh)return pf;Oh=1;var t=Ia();function r(w,S){return w===S&&(w!==0||1/w===1/S)||w!==w&&S!==S}var i=typeof Object.is=="function"?Object.is:r,s=t.useState,l=t.useEffect,c=t.useLayoutEffect,d=t.useDebugValue;function h(w,S){var C=S(),j=s({inst:{value:C,getSnapshot:S}}),$=j[0].inst,T=j[1];return c(function(){$.value=C,$.getSnapshot=S,y($)&&T({inst:$})},[w,C,S]),l(function(){return y($)&&T({inst:$}),w(function(){y($)&&T({inst:$})})},[w]),d(C),C}function y(w){var S=w.getSnapshot;w=w.value;try{var C=S();return!i(w,C)}catch{return!0}}function b(w,S){return S()}var k=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?b:h;return pf.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:k,pf}var Rh;function Eb(){return Rh||(Rh=1,df.exports=Nb()),df.exports}/**
|
|
189
|
+
* @license React
|
|
190
|
+
* use-sync-external-store-shim/with-selector.production.js
|
|
191
|
+
*
|
|
192
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
193
|
+
*
|
|
194
|
+
* This source code is licensed under the MIT license found in the
|
|
195
|
+
* LICENSE file in the root directory of this source tree.
|
|
196
|
+
*/var Lh;function Cb(){if(Lh)return ff;Lh=1;var t=Ia(),r=Eb();function i(b,k){return b===k&&(b!==0||1/b===1/k)||b!==b&&k!==k}var s=typeof Object.is=="function"?Object.is:i,l=r.useSyncExternalStore,c=t.useRef,d=t.useEffect,h=t.useMemo,y=t.useDebugValue;return ff.useSyncExternalStoreWithSelector=function(b,k,w,S,C){var j=c(null);if(j.current===null){var $={hasValue:!1,value:null};j.current=$}else $=j.current;j=h(function(){function I(V){if(!U){if(U=!0,P=V,V=S(V),C!==void 0&&$.hasValue){var Q=$.value;if(C(Q,V))return R=Q}return R=V}if(Q=R,s(P,V))return Q;var ce=S(V);return C!==void 0&&C(Q,ce)?(P=V,Q):(P=V,R=ce)}var U=!1,P,R,H=w===void 0?null:w;return[function(){return I(k())},H===null?void 0:function(){return I(H())}]},[k,w,S,C]);var T=l(b,j[0],j[1]);return d(function(){$.hasValue=!0,$.value=T},[T]),y(T),T},ff}var Dh;function jb(){return Dh||(Dh=1,cf.exports=Cb()),cf.exports}var Pb=jb();const Mb=wu(Pb),$b={},zh=t=>{let r;const i=new Set,s=(k,w)=>{const S=typeof k=="function"?k(r):k;if(!Object.is(S,r)){const C=r;r=w??(typeof S!="object"||S===null)?S:Object.assign({},r,S),i.forEach(j=>j(r,C))}},l=()=>r,y={setState:s,getState:l,getInitialState:()=>b,subscribe:k=>(i.add(k),()=>i.delete(k)),destroy:()=>{($b?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),i.clear()}},b=r=t(s,l,y);return y},Tb=t=>t?zh(t):zh,{useDebugValue:Ib}=gm,{useSyncExternalStoreWithSelector:Ab}=Mb,Ob=t=>t;function Pg(t,r=Ob,i){const s=Ab(t.subscribe,t.getState,t.getServerState||t.getInitialState,r,i);return Ib(s),s}const Fh=(t,r)=>{const i=Tb(t),s=(l,c=r)=>Pg(i,l,c);return Object.assign(s,i),s},Rb=(t,r)=>t?Fh(t,r):Fh;function Ot(t,r){if(Object.is(t,r))return!0;if(typeof t!="object"||t===null||typeof r!="object"||r===null)return!1;if(t instanceof Map&&r instanceof Map){if(t.size!==r.size)return!1;for(const[s,l]of t)if(!Object.is(l,r.get(s)))return!1;return!0}if(t instanceof Set&&r instanceof Set){if(t.size!==r.size)return!1;for(const s of t)if(!r.has(s))return!1;return!0}const i=Object.keys(t);if(i.length!==Object.keys(r).length)return!1;for(const s of i)if(!Object.prototype.hasOwnProperty.call(r,s)||!Object.is(t[s],r[s]))return!1;return!0}ym();const Tu=Y.createContext(null),Lb=Tu.Provider,Mg=eo.error001();function vt(t,r){const i=Y.useContext(Tu);if(i===null)throw new Error(Mg);return Pg(i,t,r)}function $t(){const t=Y.useContext(Tu);if(t===null)throw new Error(Mg);return Y.useMemo(()=>({getState:t.getState,setState:t.setState,subscribe:t.subscribe}),[t])}const Bh={display:"none"},Db={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},$g="react-flow__node-desc",Tg="react-flow__edge-desc",zb="react-flow__aria-live",Fb=t=>t.ariaLiveMessage,Bb=t=>t.ariaLabelConfig;function Hb({rfId:t}){const r=vt(Fb);return x.jsx("div",{id:`${zb}-${t}`,"aria-live":"assertive","aria-atomic":"true",style:Db,children:r})}function Vb({rfId:t,disableKeyboardA11y:r}){const i=vt(Bb);return x.jsxs(x.Fragment,{children:[x.jsx("div",{id:`${$g}-${t}`,style:Bh,children:r?i["node.a11yDescription.default"]:i["node.a11yDescription.keyboardDisabled"]}),x.jsx("div",{id:`${Tg}-${t}`,style:Bh,children:i["edge.a11yDescription.default"]}),!r&&x.jsx(Hb,{rfId:t})]})}const Fa=Y.forwardRef(({position:t="top-left",children:r,className:i,style:s,...l},c)=>{const d=`${t}`.split("-");return x.jsx("div",{className:Kt(["react-flow__panel",i,...d]),style:s,ref:c,...l,children:r})});Fa.displayName="Panel";function Ub({proOptions:t,position:r="bottom-right"}){return t!=null&&t.hideAttribution?null:x.jsx(Fa,{position:r,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:x.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const Kb=t=>{const r=[],i=[];for(const[,s]of t.nodeLookup)s.selected&&r.push(s.internals.userNode);for(const[,s]of t.edgeLookup)s.selected&&i.push(s);return{selectedNodes:r,selectedEdges:i}},Gl=t=>t.id;function qb(t,r){return Ot(t.selectedNodes.map(Gl),r.selectedNodes.map(Gl))&&Ot(t.selectedEdges.map(Gl),r.selectedEdges.map(Gl))}function Wb({onSelectionChange:t}){const r=$t(),{selectedNodes:i,selectedEdges:s}=vt(Kb,qb);return Y.useEffect(()=>{const l={nodes:i,edges:s};t==null||t(l),r.getState().onSelectionChangeHandlers.forEach(c=>c(l))},[i,s,t]),null}const Yb=t=>!!t.onSelectionChangeHandlers;function Xb({onSelectionChange:t}){const r=vt(Yb);return t||r?x.jsx(Wb,{onSelectionChange:t}):null}const Af=typeof window<"u"?Y.useLayoutEffect:Y.useEffect,Ig=[0,0],Qb={x:0,y:0,zoom:1},Gb=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode"],Hh=[...Gb,"rfId"],Jb=t=>({setNodes:t.setNodes,setEdges:t.setEdges,setMinZoom:t.setMinZoom,setMaxZoom:t.setMaxZoom,setTranslateExtent:t.setTranslateExtent,setNodeExtent:t.setNodeExtent,reset:t.reset,setDefaultNodesAndEdges:t.setDefaultNodesAndEdges}),Vh={translateExtent:ja,nodeOrigin:Ig,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function Zb(t){const{setNodes:r,setEdges:i,setMinZoom:s,setMaxZoom:l,setTranslateExtent:c,setNodeExtent:d,reset:h,setDefaultNodesAndEdges:y}=vt(Jb,Ot),b=$t();Af(()=>(y(t.defaultNodes,t.defaultEdges),()=>{k.current=Vh,h()}),[]);const k=Y.useRef(Vh);return Af(()=>{for(const w of Hh){const S=t[w],C=k.current[w];S!==C&&(typeof t[w]>"u"||(w==="nodes"?r(S):w==="edges"?i(S):w==="minZoom"?s(S):w==="maxZoom"?l(S):w==="translateExtent"?c(S):w==="nodeExtent"?d(S):w==="ariaLabelConfig"?b.setState({ariaLabelConfig:L1(S)}):w==="fitView"?b.setState({fitViewQueued:S}):w==="fitViewOptions"?b.setState({fitViewOptions:S}):b.setState({[w]:S})))}k.current=t},Hh.map(w=>t[w])),null}function Uh(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function e_(t){var s;const[r,i]=Y.useState(t==="system"?null:t);return Y.useEffect(()=>{if(t!=="system"){i(t);return}const l=Uh(),c=()=>i(l!=null&&l.matches?"dark":"light");return c(),l==null||l.addEventListener("change",c),()=>{l==null||l.removeEventListener("change",c)}},[t]),r!==null?r:(s=Uh())!=null&&s.matches?"dark":"light"}const Kh=typeof document<"u"?document:null;function Ta(t=null,r={target:Kh,actInsideInputWithModifier:!0}){const[i,s]=Y.useState(!1),l=Y.useRef(!1),c=Y.useRef(new Set([])),[d,h]=Y.useMemo(()=>{if(t!==null){const b=(Array.isArray(t)?t:[t]).filter(w=>typeof w=="string").map(w=>w.replace("+",`
|
|
197
|
+
`).replace(`
|
|
198
|
+
|
|
199
|
+
`,`
|
|
200
|
+
+`).split(`
|
|
201
|
+
`)),k=b.reduce((w,S)=>w.concat(...S),[]);return[b,k]}return[[],[]]},[t]);return Y.useEffect(()=>{const y=(r==null?void 0:r.target)??Kh,b=(r==null?void 0:r.actInsideInputWithModifier)??!0;if(t!==null){const k=C=>{var T,I;if(l.current=C.ctrlKey||C.metaKey||C.shiftKey||C.altKey,(!l.current||l.current&&!b)&&fg(C))return!1;const $=Wh(C.code,h);if(c.current.add(C[$]),qh(d,c.current,!1)){const U=((I=(T=C.composedPath)==null?void 0:T.call(C))==null?void 0:I[0])||C.target,P=(U==null?void 0:U.nodeName)==="BUTTON"||(U==null?void 0:U.nodeName)==="A";r.preventDefault!==!1&&(l.current||!P)&&C.preventDefault(),s(!0)}},w=C=>{const j=Wh(C.code,h);qh(d,c.current,!0)?(s(!1),c.current.clear()):c.current.delete(C[j]),C.key==="Meta"&&c.current.clear(),l.current=!1},S=()=>{c.current.clear(),s(!1)};return y==null||y.addEventListener("keydown",k),y==null||y.addEventListener("keyup",w),window.addEventListener("blur",S),window.addEventListener("contextmenu",S),()=>{y==null||y.removeEventListener("keydown",k),y==null||y.removeEventListener("keyup",w),window.removeEventListener("blur",S),window.removeEventListener("contextmenu",S)}}},[t,s]),i}function qh(t,r,i){return t.filter(s=>i||s.length===r.size).some(s=>s.every(l=>r.has(l)))}function Wh(t,r){return r.includes(t)?"code":"key"}const t_=()=>{const t=$t();return Y.useMemo(()=>({zoomIn:r=>{const{panZoom:i}=t.getState();return i?i.scaleBy(1.2,r):Promise.resolve(!1)},zoomOut:r=>{const{panZoom:i}=t.getState();return i?i.scaleBy(1/1.2,r):Promise.resolve(!1)},zoomTo:(r,i)=>{const{panZoom:s}=t.getState();return s?s.scaleTo(r,i):Promise.resolve(!1)},getZoom:()=>t.getState().transform[2],setViewport:async(r,i)=>{const{transform:[s,l,c],panZoom:d}=t.getState();return d?(await d.setViewport({x:r.x??s,y:r.y??l,zoom:r.zoom??c},i),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[r,i,s]=t.getState().transform;return{x:r,y:i,zoom:s}},setCenter:async(r,i,s)=>t.getState().setCenter(r,i,s),fitBounds:async(r,i)=>{const{width:s,height:l,minZoom:c,maxZoom:d,panZoom:h}=t.getState(),y=qf(r,s,l,c,d,(i==null?void 0:i.padding)??.1);return h?(await h.setViewport(y,{duration:i==null?void 0:i.duration,ease:i==null?void 0:i.ease,interpolate:i==null?void 0:i.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(r,i={})=>{const{transform:s,snapGrid:l,snapToGrid:c,domNode:d}=t.getState();if(!d)return r;const{x:h,y}=d.getBoundingClientRect(),b={x:r.x-h,y:r.y-y},k=i.snapGrid??l,w=i.snapToGrid??c;return za(b,s,w,k)},flowToScreenPosition:r=>{const{transform:i,domNode:s}=t.getState();if(!s)return r;const{x:l,y:c}=s.getBoundingClientRect(),d=vu(r,i);return{x:d.x+l,y:d.y+c}}}),[])};function Ag(t,r){const i=[],s=new Map,l=[];for(const c of t)if(c.type==="add"){l.push(c);continue}else if(c.type==="remove"||c.type==="replace")s.set(c.id,[c]);else{const d=s.get(c.id);d?d.push(c):s.set(c.id,[c])}for(const c of r){const d=s.get(c.id);if(!d){i.push(c);continue}if(d[0].type==="remove")continue;if(d[0].type==="replace"){i.push({...d[0].item});continue}const h={...c};for(const y of d)n_(y,h);i.push(h)}return l.length&&l.forEach(c=>{c.index!==void 0?i.splice(c.index,0,{...c.item}):i.push({...c.item})}),i}function n_(t,r){switch(t.type){case"select":{r.selected=t.selected;break}case"position":{typeof t.position<"u"&&(r.position=t.position),typeof t.dragging<"u"&&(r.dragging=t.dragging);break}case"dimensions":{typeof t.dimensions<"u"&&(r.measured={...t.dimensions},t.setAttributes&&((t.setAttributes===!0||t.setAttributes==="width")&&(r.width=t.dimensions.width),(t.setAttributes===!0||t.setAttributes==="height")&&(r.height=t.dimensions.height))),typeof t.resizing=="boolean"&&(r.resizing=t.resizing);break}}}function Og(t,r){return Ag(t,r)}function Rg(t,r){return Ag(t,r)}function Ai(t,r){return{id:t,type:"select",selected:r}}function Es(t,r=new Set,i=!1){const s=[];for(const[l,c]of t){const d=r.has(l);!(c.selected===void 0&&!d)&&c.selected!==d&&(i&&(c.selected=d),s.push(Ai(c.id,d)))}return s}function Yh({items:t=[],lookup:r}){var l;const i=[],s=new Map(t.map(c=>[c.id,c]));for(const[c,d]of t.entries()){const h=r.get(d.id),y=((l=h==null?void 0:h.internals)==null?void 0:l.userNode)??h;y!==void 0&&y!==d&&i.push({id:d.id,item:d,type:"replace"}),y===void 0&&i.push({item:d,type:"add",index:c})}for(const[c]of r)s.get(c)===void 0&&i.push({id:c,type:"remove"});return i}function Xh(t){return{id:t.id,type:"remove"}}const Qh=t=>C1(t),r_=t=>rg(t);function Lg(t){return Y.forwardRef(t)}function Gh(t){const[r,i]=Y.useState(BigInt(0)),[s]=Y.useState(()=>o_(()=>i(l=>l+BigInt(1))));return Af(()=>{const l=s.get();l.length&&(t(l),s.reset())},[r]),s}function o_(t){let r=[];return{get:()=>r,reset:()=>{r=[]},push:i=>{r.push(i),t()}}}const Dg=Y.createContext(null);function i_({children:t}){const r=$t(),i=Y.useCallback(h=>{const{nodes:y=[],setNodes:b,hasDefaultNodes:k,onNodesChange:w,nodeLookup:S,fitViewQueued:C,onNodesChangeMiddlewareMap:j}=r.getState();let $=y;for(const I of h)$=typeof I=="function"?I($):I;let T=Yh({items:$,lookup:S});for(const I of j.values())T=I(T);k&&b($),T.length>0?w==null||w(T):C&&window.requestAnimationFrame(()=>{const{fitViewQueued:I,nodes:U,setNodes:P}=r.getState();I&&P(U)})},[]),s=Gh(i),l=Y.useCallback(h=>{const{edges:y=[],setEdges:b,hasDefaultEdges:k,onEdgesChange:w,edgeLookup:S}=r.getState();let C=y;for(const j of h)C=typeof j=="function"?j(C):j;k?b(C):w&&w(Yh({items:C,lookup:S}))},[]),c=Gh(l),d=Y.useMemo(()=>({nodeQueue:s,edgeQueue:c}),[]);return x.jsx(Dg.Provider,{value:d,children:t})}function s_(){const t=Y.useContext(Dg);if(!t)throw new Error("useBatchContext must be used within a BatchProvider");return t}const a_=t=>!!t.panZoom;function Zf(){const t=t_(),r=$t(),i=s_(),s=vt(a_),l=Y.useMemo(()=>{const c=w=>r.getState().nodeLookup.get(w),d=w=>{i.nodeQueue.push(w)},h=w=>{i.edgeQueue.push(w)},y=w=>{var I,U;const{nodeLookup:S,nodeOrigin:C}=r.getState(),j=Qh(w)?w:S.get(w.id),$=j.parentId?ug(j.position,j.measured,j.parentId,S,C):j.position,T={...j,position:$,width:((I=j.measured)==null?void 0:I.width)??j.width,height:((U=j.measured)==null?void 0:U.height)??j.height};return Is(T)},b=(w,S,C={replace:!1})=>{d(j=>j.map($=>{if($.id===w){const T=typeof S=="function"?S($):S;return C.replace&&Qh(T)?T:{...$,...T}}return $}))},k=(w,S,C={replace:!1})=>{h(j=>j.map($=>{if($.id===w){const T=typeof S=="function"?S($):S;return C.replace&&r_(T)?T:{...$,...T}}return $}))};return{getNodes:()=>r.getState().nodes.map(w=>({...w})),getNode:w=>{var S;return(S=c(w))==null?void 0:S.internals.userNode},getInternalNode:c,getEdges:()=>{const{edges:w=[]}=r.getState();return w.map(S=>({...S}))},getEdge:w=>r.getState().edgeLookup.get(w),setNodes:d,setEdges:h,addNodes:w=>{const S=Array.isArray(w)?w:[w];i.nodeQueue.push(C=>[...C,...S])},addEdges:w=>{const S=Array.isArray(w)?w:[w];i.edgeQueue.push(C=>[...C,...S])},toObject:()=>{const{nodes:w=[],edges:S=[],transform:C}=r.getState(),[j,$,T]=C;return{nodes:w.map(I=>({...I})),edges:S.map(I=>({...I})),viewport:{x:j,y:$,zoom:T}}},deleteElements:async({nodes:w=[],edges:S=[]})=>{const{nodes:C,edges:j,onNodesDelete:$,onEdgesDelete:T,triggerNodeChanges:I,triggerEdgeChanges:U,onDelete:P,onBeforeDelete:R}=r.getState(),{nodes:H,edges:V}=await T1({nodesToRemove:w,edgesToRemove:S,nodes:C,edges:j,onBeforeDelete:R}),Q=V.length>0,ce=H.length>0;if(Q){const de=V.map(Xh);T==null||T(V),U(de)}if(ce){const de=H.map(Xh);$==null||$(H),I(de)}return(ce||Q)&&(P==null||P({nodes:H,edges:V})),{deletedNodes:H,deletedEdges:V}},getIntersectingNodes:(w,S=!0,C)=>{const j=_h(w),$=j?w:y(w),T=C!==void 0;return $?(C||r.getState().nodes).filter(I=>{const U=r.getState().nodeLookup.get(I.id);if(U&&!j&&(I.id===w.id||!U.internals.positionAbsolute))return!1;const P=Is(T?I:U),R=Ma(P,$);return S&&R>0||R>=P.width*P.height||R>=$.width*$.height}):[]},isNodeIntersecting:(w,S,C=!0)=>{const $=_h(w)?w:y(w);if(!$)return!1;const T=Ma($,S);return C&&T>0||T>=S.width*S.height||T>=$.width*$.height},updateNode:b,updateNodeData:(w,S,C={replace:!1})=>{b(w,j=>{const $=typeof S=="function"?S(j):S;return C.replace?{...j,data:$}:{...j,data:{...j.data,...$}}},C)},updateEdge:k,updateEdgeData:(w,S,C={replace:!1})=>{k(w,j=>{const $=typeof S=="function"?S(j):S;return C.replace?{...j,data:$}:{...j,data:{...j.data,...$}}},C)},getNodesBounds:w=>{const{nodeLookup:S,nodeOrigin:C}=r.getState();return j1(w,{nodeLookup:S,nodeOrigin:C})},getHandleConnections:({type:w,id:S,nodeId:C})=>{var j;return Array.from(((j=r.getState().connectionLookup.get(`${C}-${w}${S?`-${S}`:""}`))==null?void 0:j.values())??[])},getNodeConnections:({type:w,handleId:S,nodeId:C})=>{var j;return Array.from(((j=r.getState().connectionLookup.get(`${C}${w?S?`-${w}-${S}`:`-${w}`:""}`))==null?void 0:j.values())??[])},fitView:async w=>{const S=r.getState().fitViewResolver??R1();return r.setState({fitViewQueued:!0,fitViewOptions:w,fitViewResolver:S}),i.nodeQueue.push(C=>[...C]),S.promise}}},[]);return Y.useMemo(()=>({...l,...t,viewportInitialized:s}),[s])}const Jh=t=>t.selected,l_=typeof window<"u"?window:void 0;function u_({deleteKeyCode:t,multiSelectionKeyCode:r}){const i=$t(),{deleteElements:s}=Zf(),l=Ta(t,{actInsideInputWithModifier:!1}),c=Ta(r,{target:l_});Y.useEffect(()=>{if(l){const{edges:d,nodes:h}=i.getState();s({nodes:h.filter(Jh),edges:d.filter(Jh)}),i.setState({nodesSelectionActive:!1})}},[l]),Y.useEffect(()=>{i.setState({multiSelectionActive:c})},[c])}function c_(t){const r=$t();Y.useEffect(()=>{const i=()=>{var l,c,d,h;if(!t.current||!(((c=(l=t.current).checkVisibility)==null?void 0:c.call(l))??!0))return!1;const s=Wf(t.current);(s.height===0||s.width===0)&&((h=(d=r.getState()).onError)==null||h.call(d,"004",eo.error004())),r.setState({width:s.width||500,height:s.height||500})};if(t.current){i(),window.addEventListener("resize",i);const s=new ResizeObserver(()=>i());return s.observe(t.current),()=>{window.removeEventListener("resize",i),s&&t.current&&s.unobserve(t.current)}}},[])}const Iu={position:"absolute",width:"100%",height:"100%",top:0,left:0},f_=t=>({userSelectionActive:t.userSelectionActive,lib:t.lib,connectionInProgress:t.connection.inProgress});function d_({onPaneContextMenu:t,zoomOnScroll:r=!0,zoomOnPinch:i=!0,panOnScroll:s=!1,panOnScrollSpeed:l=.5,panOnScrollMode:c=Li.Free,zoomOnDoubleClick:d=!0,panOnDrag:h=!0,defaultViewport:y,translateExtent:b,minZoom:k,maxZoom:w,zoomActivationKeyCode:S,preventScrolling:C=!0,children:j,noWheelClassName:$,noPanClassName:T,onViewportChange:I,isControlledViewport:U,paneClickDistance:P,selectionOnDrag:R}){const H=$t(),V=Y.useRef(null),{userSelectionActive:Q,lib:ce,connectionInProgress:de}=vt(f_,Ot),we=Ta(S),q=Y.useRef();c_(V);const fe=Y.useCallback(xe=>{I==null||I({x:xe[0],y:xe[1],zoom:xe[2]}),U||H.setState({transform:xe})},[I,U]);return Y.useEffect(()=>{if(V.current){q.current=vb({domNode:V.current,minZoom:k,maxZoom:w,translateExtent:b,viewport:y,onDraggingChange:G=>H.setState(ie=>ie.paneDragging===G?ie:{paneDragging:G}),onPanZoomStart:(G,ie)=>{const{onViewportChangeStart:F,onMoveStart:W}=H.getState();W==null||W(G,ie),F==null||F(ie)},onPanZoom:(G,ie)=>{const{onViewportChange:F,onMove:W}=H.getState();W==null||W(G,ie),F==null||F(ie)},onPanZoomEnd:(G,ie)=>{const{onViewportChangeEnd:F,onMoveEnd:W}=H.getState();W==null||W(G,ie),F==null||F(ie)}});const{x:xe,y:L,zoom:le}=q.current.getViewport();return H.setState({panZoom:q.current,transform:[xe,L,le],domNode:V.current.closest(".react-flow")}),()=>{var G;(G=q.current)==null||G.destroy()}}},[]),Y.useEffect(()=>{var xe;(xe=q.current)==null||xe.update({onPaneContextMenu:t,zoomOnScroll:r,zoomOnPinch:i,panOnScroll:s,panOnScrollSpeed:l,panOnScrollMode:c,zoomOnDoubleClick:d,panOnDrag:h,zoomActivationKeyPressed:we,preventScrolling:C,noPanClassName:T,userSelectionActive:Q,noWheelClassName:$,lib:ce,onTransformChange:fe,connectionInProgress:de,selectionOnDrag:R,paneClickDistance:P})},[t,r,i,s,l,c,d,h,we,C,T,Q,$,ce,fe,de,R,P]),x.jsx("div",{className:"react-flow__renderer",ref:V,style:Iu,children:j})}const p_=t=>({userSelectionActive:t.userSelectionActive,userSelectionRect:t.userSelectionRect});function h_(){const{userSelectionActive:t,userSelectionRect:r}=vt(p_,Ot);return t&&r?x.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:r.width,height:r.height,transform:`translate(${r.x}px, ${r.y}px)`}}):null}const hf=(t,r)=>i=>{i.target===r.current&&(t==null||t(i))},m_=t=>({userSelectionActive:t.userSelectionActive,elementsSelectable:t.elementsSelectable,connectionInProgress:t.connection.inProgress,dragging:t.paneDragging});function g_({isSelecting:t,selectionKeyPressed:r,selectionMode:i=Pa.Full,panOnDrag:s,paneClickDistance:l,selectionOnDrag:c,onSelectionStart:d,onSelectionEnd:h,onPaneClick:y,onPaneContextMenu:b,onPaneScroll:k,onPaneMouseEnter:w,onPaneMouseMove:S,onPaneMouseLeave:C,children:j}){const $=$t(),{userSelectionActive:T,elementsSelectable:I,dragging:U,connectionInProgress:P}=vt(m_,Ot),R=I&&(t||T),H=Y.useRef(null),V=Y.useRef(),Q=Y.useRef(new Set),ce=Y.useRef(new Set),de=Y.useRef(!1),we=F=>{if(de.current||P){de.current=!1;return}y==null||y(F),$.getState().resetSelectedElements(),$.setState({nodesSelectionActive:!1})},q=F=>{if(Array.isArray(s)&&(s!=null&&s.includes(2))){F.preventDefault();return}b==null||b(F)},fe=k?F=>k(F):void 0,xe=F=>{de.current&&(F.stopPropagation(),de.current=!1)},L=F=>{var Me,Ie;const{domNode:W}=$.getState();if(V.current=W==null?void 0:W.getBoundingClientRect(),!V.current)return;const B=F.target===H.current;if(!B&&!!F.target.closest(".nokey")||!t||!(c&&B||r)||F.button!==0||!F.isPrimary)return;(Ie=(Me=F.target)==null?void 0:Me.setPointerCapture)==null||Ie.call(Me,F.pointerId),de.current=!1;const{x:be,y:Se}=zr(F.nativeEvent,V.current);$.setState({userSelectionRect:{width:0,height:0,startX:be,startY:Se,x:be,y:Se}}),B||(F.stopPropagation(),F.preventDefault())},le=F=>{const{userSelectionRect:W,transform:B,nodeLookup:A,edgeLookup:K,connectionLookup:be,triggerNodeChanges:Se,triggerEdgeChanges:Me,defaultEdgeOptions:Ie,resetSelectedElements:Ae}=$.getState();if(!V.current||!W)return;const{x:_e,y:ze}=zr(F.nativeEvent,V.current),{startX:ke,startY:Be}=W;if(!de.current){const it=r?0:l;if(Math.hypot(_e-ke,ze-Be)<=it)return;Ae(),d==null||d(F)}de.current=!0;const Re={startX:ke,startY:Be,x:_e<ke?_e:ke,y:ze<Be?ze:Be,width:Math.abs(_e-ke),height:Math.abs(ze-Be)},Ue=Q.current,lt=ce.current;Q.current=new Set(Kf(A,Re,B,i===Pa.Partial,!0).map(it=>it.id)),ce.current=new Set;const ut=(Ie==null?void 0:Ie.selectable)??!0;for(const it of Q.current){const Ct=be.get(it);if(Ct)for(const{edgeId:qt}of Ct.values()){const Gt=K.get(qt);Gt&&(Gt.selectable??ut)&&ce.current.add(qt)}}if(!Sh(Ue,Q.current)){const it=Es(A,Q.current,!0);Se(it)}if(!Sh(lt,ce.current)){const it=Es(K,ce.current);Me(it)}$.setState({userSelectionRect:Re,userSelectionActive:!0,nodesSelectionActive:!1})},G=F=>{var W,B;F.button===0&&((B=(W=F.target)==null?void 0:W.releasePointerCapture)==null||B.call(W,F.pointerId),!T&&F.target===H.current&&$.getState().userSelectionRect&&(we==null||we(F)),$.setState({userSelectionActive:!1,userSelectionRect:null}),de.current&&(h==null||h(F),$.setState({nodesSelectionActive:Q.current.size>0})))},ie=s===!0||Array.isArray(s)&&s.includes(0);return x.jsxs("div",{className:Kt(["react-flow__pane",{draggable:ie,dragging:U,selection:t}]),onClick:R?void 0:hf(we,H),onContextMenu:hf(q,H),onWheel:hf(fe,H),onPointerEnter:R?void 0:w,onPointerMove:R?le:S,onPointerUp:R?G:void 0,onPointerDownCapture:R?L:void 0,onClickCapture:R?xe:void 0,onPointerLeave:C,ref:H,style:Iu,children:[j,x.jsx(h_,{})]})}function Of({id:t,store:r,unselect:i=!1,nodeRef:s}){const{addSelectedNodes:l,unselectNodesAndEdges:c,multiSelectionActive:d,nodeLookup:h,onError:y}=r.getState(),b=h.get(t);if(!b){y==null||y("012",eo.error012(t));return}r.setState({nodesSelectionActive:!1}),b.selected?(i||b.selected&&d)&&(c({nodes:[b],edges:[]}),requestAnimationFrame(()=>{var k;return(k=s==null?void 0:s.current)==null?void 0:k.blur()})):l([t])}function zg({nodeRef:t,disabled:r=!1,noDragClassName:i,handleSelector:s,nodeId:l,isSelectable:c,nodeClickDistance:d}){const h=$t(),[y,b]=Y.useState(!1),k=Y.useRef();return Y.useEffect(()=>{k.current=ob({getStoreItems:()=>h.getState(),onNodeMouseDown:w=>{Of({id:w,store:h,nodeRef:t})},onDragStart:()=>{b(!0)},onDragStop:()=>{b(!1)}})},[]),Y.useEffect(()=>{if(!(r||!t.current||!k.current))return k.current.update({noDragClassName:i,handleSelector:s,domNode:t.current,isSelectable:c,nodeId:l,nodeClickDistance:d}),()=>{var w;(w=k.current)==null||w.destroy()}},[i,s,r,c,t,l,d]),y}const y_=t=>r=>r.selected&&(r.draggable||t&&typeof r.draggable>"u");function Fg(){const t=$t();return Y.useCallback(i=>{const{nodeExtent:s,snapToGrid:l,snapGrid:c,nodesDraggable:d,onError:h,updateNodePositions:y,nodeLookup:b,nodeOrigin:k}=t.getState(),w=new Map,S=y_(d),C=l?c[0]:5,j=l?c[1]:5,$=i.direction.x*C*i.factor,T=i.direction.y*j*i.factor;for(const[,I]of b){if(!S(I))continue;let U={x:I.internals.positionAbsolute.x+$,y:I.internals.positionAbsolute.y+T};l&&(U=Da(U,c));const{position:P,positionAbsolute:R}=og({nodeId:I.id,nextPosition:U,nodeLookup:b,nodeExtent:s,nodeOrigin:k,onError:h});I.position=P,I.internals.positionAbsolute=R,w.set(I.id,I)}y(w)},[])}const ed=Y.createContext(null),v_=ed.Provider;ed.Consumer;const Bg=()=>Y.useContext(ed),x_=t=>({connectOnClick:t.connectOnClick,noPanClassName:t.noPanClassName,rfId:t.rfId}),w_=(t,r,i)=>s=>{const{connectionClickStartHandle:l,connectionMode:c,connection:d}=s,{fromHandle:h,toHandle:y,isValid:b}=d,k=(y==null?void 0:y.nodeId)===t&&(y==null?void 0:y.id)===r&&(y==null?void 0:y.type)===i;return{connectingFrom:(h==null?void 0:h.nodeId)===t&&(h==null?void 0:h.id)===r&&(h==null?void 0:h.type)===i,connectingTo:k,clickConnecting:(l==null?void 0:l.nodeId)===t&&(l==null?void 0:l.id)===r&&(l==null?void 0:l.type)===i,isPossibleEndHandle:c===$s.Strict?(h==null?void 0:h.type)!==i:t!==(h==null?void 0:h.nodeId)||r!==(h==null?void 0:h.id),connectionInProcess:!!h,clickConnectionInProcess:!!l,valid:k&&b}};function b_({type:t="source",position:r=Ze.Top,isValidConnection:i,isConnectable:s=!0,isConnectableStart:l=!0,isConnectableEnd:c=!0,id:d,onConnect:h,children:y,className:b,onMouseDown:k,onTouchStart:w,...S},C){var le,G;const j=d||null,$=t==="target",T=$t(),I=Bg(),{connectOnClick:U,noPanClassName:P,rfId:R}=vt(x_,Ot),{connectingFrom:H,connectingTo:V,clickConnecting:Q,isPossibleEndHandle:ce,connectionInProcess:de,clickConnectionInProcess:we,valid:q}=vt(w_(I,j,t),Ot);I||(G=(le=T.getState()).onError)==null||G.call(le,"010",eo.error010());const fe=ie=>{const{defaultEdgeOptions:F,onConnect:W,hasDefaultEdges:B}=T.getState(),A={...F,...ie};if(B){const{edges:K,setEdges:be}=T.getState();be(gg(A,K))}W==null||W(A),h==null||h(A)},xe=ie=>{if(!I)return;const F=dg(ie.nativeEvent);if(l&&(F&&ie.button===0||!F)){const W=T.getState();If.onPointerDown(ie.nativeEvent,{handleDomNode:ie.currentTarget,autoPanOnConnect:W.autoPanOnConnect,connectionMode:W.connectionMode,connectionRadius:W.connectionRadius,domNode:W.domNode,nodeLookup:W.nodeLookup,lib:W.lib,isTarget:$,handleId:j,nodeId:I,flowId:W.rfId,panBy:W.panBy,cancelConnection:W.cancelConnection,onConnectStart:W.onConnectStart,onConnectEnd:(...B)=>{var A,K;return(K=(A=T.getState()).onConnectEnd)==null?void 0:K.call(A,...B)},updateConnection:W.updateConnection,onConnect:fe,isValidConnection:i||((...B)=>{var A,K;return((K=(A=T.getState()).isValidConnection)==null?void 0:K.call(A,...B))??!0}),getTransform:()=>T.getState().transform,getFromHandle:()=>T.getState().connection.fromHandle,autoPanSpeed:W.autoPanSpeed,dragThreshold:W.connectionDragThreshold})}F?k==null||k(ie):w==null||w(ie)},L=ie=>{const{onClickConnectStart:F,onClickConnectEnd:W,connectionClickStartHandle:B,connectionMode:A,isValidConnection:K,lib:be,rfId:Se,nodeLookup:Me,connection:Ie}=T.getState();if(!I||!B&&!l)return;if(!B){F==null||F(ie.nativeEvent,{nodeId:I,handleId:j,handleType:t}),T.setState({connectionClickStartHandle:{nodeId:I,type:t,id:j}});return}const Ae=cg(ie.target),_e=i||K,{connection:ze,isValid:ke}=If.isValid(ie.nativeEvent,{handle:{nodeId:I,id:j,type:t},connectionMode:A,fromNodeId:B.nodeId,fromHandleId:B.id||null,fromType:B.type,isValidConnection:_e,flowId:Se,doc:Ae,lib:be,nodeLookup:Me});ke&&ze&&fe(ze);const Be=structuredClone(Ie);delete Be.inProgress,Be.toPosition=Be.toHandle?Be.toHandle.position:null,W==null||W(ie,Be),T.setState({connectionClickStartHandle:null})};return x.jsx("div",{"data-handleid":j,"data-nodeid":I,"data-handlepos":r,"data-id":`${R}-${I}-${j}-${t}`,className:Kt(["react-flow__handle",`react-flow__handle-${r}`,"nodrag",P,b,{source:!$,target:$,connectable:s,connectablestart:l,connectableend:c,clickconnecting:Q,connectingfrom:H,connectingto:V,valid:q,connectionindicator:s&&(!de||ce)&&(de||we?c:l)}]),onMouseDown:xe,onTouchStart:xe,onClick:U?L:void 0,ref:C,...S,children:y})}const Rs=Y.memo(Lg(b_));function __({data:t,isConnectable:r,sourcePosition:i=Ze.Bottom}){return x.jsxs(x.Fragment,{children:[t==null?void 0:t.label,x.jsx(Rs,{type:"source",position:i,isConnectable:r})]})}function S_({data:t,isConnectable:r,targetPosition:i=Ze.Top,sourcePosition:s=Ze.Bottom}){return x.jsxs(x.Fragment,{children:[x.jsx(Rs,{type:"target",position:i,isConnectable:r}),t==null?void 0:t.label,x.jsx(Rs,{type:"source",position:s,isConnectable:r})]})}function k_(){return null}function N_({data:t,isConnectable:r,targetPosition:i=Ze.Top}){return x.jsxs(x.Fragment,{children:[x.jsx(Rs,{type:"target",position:i,isConnectable:r}),t==null?void 0:t.label]})}const xu={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},Zh={input:__,default:S_,output:N_,group:k_};function E_(t){var r,i,s,l;return t.internals.handleBounds===void 0?{width:t.width??t.initialWidth??((r=t.style)==null?void 0:r.width),height:t.height??t.initialHeight??((i=t.style)==null?void 0:i.height)}:{width:t.width??((s=t.style)==null?void 0:s.width),height:t.height??((l=t.style)==null?void 0:l.height)}}const C_=t=>{const{width:r,height:i,x:s,y:l}=La(t.nodeLookup,{filter:c=>!!c.selected});return{width:Dr(r)?r:null,height:Dr(i)?i:null,userSelectionActive:t.userSelectionActive,transformString:`translate(${t.transform[0]}px,${t.transform[1]}px) scale(${t.transform[2]}) translate(${s}px,${l}px)`}};function j_({onSelectionContextMenu:t,noPanClassName:r,disableKeyboardA11y:i}){const s=$t(),{width:l,height:c,transformString:d,userSelectionActive:h}=vt(C_,Ot),y=Fg(),b=Y.useRef(null);Y.useEffect(()=>{var C;i||(C=b.current)==null||C.focus({preventScroll:!0})},[i]);const k=!h&&l!==null&&c!==null;if(zg({nodeRef:b,disabled:!k}),!k)return null;const w=t?C=>{const j=s.getState().nodes.filter($=>$.selected);t(C,j)}:void 0,S=C=>{Object.prototype.hasOwnProperty.call(xu,C.key)&&(C.preventDefault(),y({direction:xu[C.key],factor:C.shiftKey?4:1}))};return x.jsx("div",{className:Kt(["react-flow__nodesselection","react-flow__container",r]),style:{transform:d},children:x.jsx("div",{ref:b,className:"react-flow__nodesselection-rect",onContextMenu:w,tabIndex:i?void 0:-1,onKeyDown:i?void 0:S,style:{width:l,height:c}})})}const em=typeof window<"u"?window:void 0,P_=t=>({nodesSelectionActive:t.nodesSelectionActive,userSelectionActive:t.userSelectionActive});function Hg({children:t,onPaneClick:r,onPaneMouseEnter:i,onPaneMouseMove:s,onPaneMouseLeave:l,onPaneContextMenu:c,onPaneScroll:d,paneClickDistance:h,deleteKeyCode:y,selectionKeyCode:b,selectionOnDrag:k,selectionMode:w,onSelectionStart:S,onSelectionEnd:C,multiSelectionKeyCode:j,panActivationKeyCode:$,zoomActivationKeyCode:T,elementsSelectable:I,zoomOnScroll:U,zoomOnPinch:P,panOnScroll:R,panOnScrollSpeed:H,panOnScrollMode:V,zoomOnDoubleClick:Q,panOnDrag:ce,defaultViewport:de,translateExtent:we,minZoom:q,maxZoom:fe,preventScrolling:xe,onSelectionContextMenu:L,noWheelClassName:le,noPanClassName:G,disableKeyboardA11y:ie,onViewportChange:F,isControlledViewport:W}){const{nodesSelectionActive:B,userSelectionActive:A}=vt(P_,Ot),K=Ta(b,{target:em}),be=Ta($,{target:em}),Se=be||ce,Me=be||R,Ie=k&&Se!==!0,Ae=K||A||Ie;return u_({deleteKeyCode:y,multiSelectionKeyCode:j}),x.jsx(d_,{onPaneContextMenu:c,elementsSelectable:I,zoomOnScroll:U,zoomOnPinch:P,panOnScroll:Me,panOnScrollSpeed:H,panOnScrollMode:V,zoomOnDoubleClick:Q,panOnDrag:!K&&Se,defaultViewport:de,translateExtent:we,minZoom:q,maxZoom:fe,zoomActivationKeyCode:T,preventScrolling:xe,noWheelClassName:le,noPanClassName:G,onViewportChange:F,isControlledViewport:W,paneClickDistance:h,selectionOnDrag:Ie,children:x.jsxs(g_,{onSelectionStart:S,onSelectionEnd:C,onPaneClick:r,onPaneMouseEnter:i,onPaneMouseMove:s,onPaneMouseLeave:l,onPaneContextMenu:c,onPaneScroll:d,panOnDrag:Se,isSelecting:!!Ae,selectionMode:w,selectionKeyPressed:K,paneClickDistance:h,selectionOnDrag:Ie,children:[t,B&&x.jsx(j_,{onSelectionContextMenu:L,noPanClassName:G,disableKeyboardA11y:ie})]})})}Hg.displayName="FlowRenderer";const M_=Y.memo(Hg),$_=t=>r=>t?Kf(r.nodeLookup,{x:0,y:0,width:r.width,height:r.height},r.transform,!0).map(i=>i.id):Array.from(r.nodeLookup.keys());function T_(t){return vt(Y.useCallback($_(t),[t]),Ot)}const I_=t=>t.updateNodeInternals;function A_(){const t=vt(I_),[r]=Y.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(i=>{const s=new Map;i.forEach(l=>{const c=l.target.getAttribute("data-id");s.set(c,{id:c,nodeElement:l.target,force:!0})}),t(s)}));return Y.useEffect(()=>()=>{r==null||r.disconnect()},[r]),r}function O_({node:t,nodeType:r,hasDimensions:i,resizeObserver:s}){const l=$t(),c=Y.useRef(null),d=Y.useRef(null),h=Y.useRef(t.sourcePosition),y=Y.useRef(t.targetPosition),b=Y.useRef(r),k=i&&!!t.internals.handleBounds;return Y.useEffect(()=>{c.current&&!t.hidden&&(!k||d.current!==c.current)&&(d.current&&(s==null||s.unobserve(d.current)),s==null||s.observe(c.current),d.current=c.current)},[k,t.hidden]),Y.useEffect(()=>()=>{d.current&&(s==null||s.unobserve(d.current),d.current=null)},[]),Y.useEffect(()=>{if(c.current){const w=b.current!==r,S=h.current!==t.sourcePosition,C=y.current!==t.targetPosition;(w||S||C)&&(b.current=r,h.current=t.sourcePosition,y.current=t.targetPosition,l.getState().updateNodeInternals(new Map([[t.id,{id:t.id,nodeElement:c.current,force:!0}]])))}},[t.id,r,t.sourcePosition,t.targetPosition]),c}function R_({id:t,onClick:r,onMouseEnter:i,onMouseMove:s,onMouseLeave:l,onContextMenu:c,onDoubleClick:d,nodesDraggable:h,elementsSelectable:y,nodesConnectable:b,nodesFocusable:k,resizeObserver:w,noDragClassName:S,noPanClassName:C,disableKeyboardA11y:j,rfId:$,nodeTypes:T,nodeClickDistance:I,onError:U}){const{node:P,internals:R,isParent:H}=vt(_e=>{const ze=_e.nodeLookup.get(t),ke=_e.parentLookup.has(t);return{node:ze,internals:ze.internals,isParent:ke}},Ot);let V=P.type||"default",Q=(T==null?void 0:T[V])||Zh[V];Q===void 0&&(U==null||U("003",eo.error003(V)),V="default",Q=(T==null?void 0:T.default)||Zh.default);const ce=!!(P.draggable||h&&typeof P.draggable>"u"),de=!!(P.selectable||y&&typeof P.selectable>"u"),we=!!(P.connectable||b&&typeof P.connectable>"u"),q=!!(P.focusable||k&&typeof P.focusable>"u"),fe=$t(),xe=lg(P),L=O_({node:P,nodeType:V,hasDimensions:xe,resizeObserver:w}),le=zg({nodeRef:L,disabled:P.hidden||!ce,noDragClassName:S,handleSelector:P.dragHandle,nodeId:t,isSelectable:de,nodeClickDistance:I}),G=Fg();if(P.hidden)return null;const ie=Ao(P),F=E_(P),W=de||ce||r||i||s||l,B=i?_e=>i(_e,{...R.userNode}):void 0,A=s?_e=>s(_e,{...R.userNode}):void 0,K=l?_e=>l(_e,{...R.userNode}):void 0,be=c?_e=>c(_e,{...R.userNode}):void 0,Se=d?_e=>d(_e,{...R.userNode}):void 0,Me=_e=>{const{selectNodesOnDrag:ze,nodeDragThreshold:ke}=fe.getState();de&&(!ze||!ce||ke>0)&&Of({id:t,store:fe,nodeRef:L}),r&&r(_e,{...R.userNode})},Ie=_e=>{if(!(fg(_e.nativeEvent)||j)){if(Zm.includes(_e.key)&&de){const ze=_e.key==="Escape";Of({id:t,store:fe,unselect:ze,nodeRef:L})}else if(ce&&P.selected&&Object.prototype.hasOwnProperty.call(xu,_e.key)){_e.preventDefault();const{ariaLabelConfig:ze}=fe.getState();fe.setState({ariaLiveMessage:ze["node.a11yDescription.ariaLiveMessage"]({direction:_e.key.replace("Arrow","").toLowerCase(),x:~~R.positionAbsolute.x,y:~~R.positionAbsolute.y})}),G({direction:xu[_e.key],factor:_e.shiftKey?4:1})}}},Ae=()=>{var lt;if(j||!((lt=L.current)!=null&<.matches(":focus-visible")))return;const{transform:_e,width:ze,height:ke,autoPanOnNodeFocus:Be,setCenter:Re}=fe.getState();if(!Be)return;Kf(new Map([[t,P]]),{x:0,y:0,width:ze,height:ke},_e,!0).length>0||Re(P.position.x+ie.width/2,P.position.y+ie.height/2,{zoom:_e[2]})};return x.jsx("div",{className:Kt(["react-flow__node",`react-flow__node-${V}`,{[C]:ce},P.className,{selected:P.selected,selectable:de,parent:H,draggable:ce,dragging:le}]),ref:L,style:{zIndex:R.z,transform:`translate(${R.positionAbsolute.x}px,${R.positionAbsolute.y}px)`,pointerEvents:W?"all":"none",visibility:xe?"visible":"hidden",...P.style,...F},"data-id":t,"data-testid":`rf__node-${t}`,onMouseEnter:B,onMouseMove:A,onMouseLeave:K,onContextMenu:be,onClick:Me,onDoubleClick:Se,onKeyDown:q?Ie:void 0,tabIndex:q?0:void 0,onFocus:q?Ae:void 0,role:P.ariaRole??(q?"group":void 0),"aria-roledescription":"node","aria-describedby":j?void 0:`${$g}-${$}`,"aria-label":P.ariaLabel,...P.domAttributes,children:x.jsx(v_,{value:t,children:x.jsx(Q,{id:t,data:P.data,type:V,positionAbsoluteX:R.positionAbsolute.x,positionAbsoluteY:R.positionAbsolute.y,selected:P.selected??!1,selectable:de,draggable:ce,deletable:P.deletable??!0,isConnectable:we,sourcePosition:P.sourcePosition,targetPosition:P.targetPosition,dragging:le,dragHandle:P.dragHandle,zIndex:R.z,parentId:P.parentId,...ie})})})}var L_=Y.memo(R_);const D_=t=>({nodesDraggable:t.nodesDraggable,nodesConnectable:t.nodesConnectable,nodesFocusable:t.nodesFocusable,elementsSelectable:t.elementsSelectable,onError:t.onError});function Vg(t){const{nodesDraggable:r,nodesConnectable:i,nodesFocusable:s,elementsSelectable:l,onError:c}=vt(D_,Ot),d=T_(t.onlyRenderVisibleElements),h=A_();return x.jsx("div",{className:"react-flow__nodes",style:Iu,children:d.map(y=>x.jsx(L_,{id:y,nodeTypes:t.nodeTypes,nodeExtent:t.nodeExtent,onClick:t.onNodeClick,onMouseEnter:t.onNodeMouseEnter,onMouseMove:t.onNodeMouseMove,onMouseLeave:t.onNodeMouseLeave,onContextMenu:t.onNodeContextMenu,onDoubleClick:t.onNodeDoubleClick,noDragClassName:t.noDragClassName,noPanClassName:t.noPanClassName,rfId:t.rfId,disableKeyboardA11y:t.disableKeyboardA11y,resizeObserver:h,nodesDraggable:r,nodesConnectable:i,nodesFocusable:s,elementsSelectable:l,nodeClickDistance:t.nodeClickDistance,onError:c},y))})}Vg.displayName="NodeRenderer";const z_=Y.memo(Vg);function F_(t){return vt(Y.useCallback(i=>{if(!t)return i.edges.map(l=>l.id);const s=[];if(i.width&&i.height)for(const l of i.edges){const c=i.nodeLookup.get(l.source),d=i.nodeLookup.get(l.target);c&&d&&F1({sourceNode:c,targetNode:d,width:i.width,height:i.height,transform:i.transform})&&s.push(l.id)}return s},[t]),Ot)}const B_=({color:t="none",strokeWidth:r=1})=>{const i={strokeWidth:r,...t&&{stroke:t}};return x.jsx("polyline",{className:"arrow",style:i,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},H_=({color:t="none",strokeWidth:r=1})=>{const i={strokeWidth:r,...t&&{stroke:t,fill:t}};return x.jsx("polyline",{className:"arrowclosed",style:i,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},tm={[gu.Arrow]:B_,[gu.ArrowClosed]:H_};function V_(t){const r=$t();return Y.useMemo(()=>{var l,c;return Object.prototype.hasOwnProperty.call(tm,t)?tm[t]:((c=(l=r.getState()).onError)==null||c.call(l,"009",eo.error009(t)),null)},[t])}const U_=({id:t,type:r,color:i,width:s=12.5,height:l=12.5,markerUnits:c="strokeWidth",strokeWidth:d,orient:h="auto-start-reverse"})=>{const y=V_(r);return y?x.jsx("marker",{className:"react-flow__arrowhead",id:t,markerWidth:`${s}`,markerHeight:`${l}`,viewBox:"-10 -10 20 20",markerUnits:c,orient:h,refX:"0",refY:"0",children:x.jsx(y,{color:i,strokeWidth:d})}):null},Ug=({defaultColor:t,rfId:r})=>{const i=vt(c=>c.edges),s=vt(c=>c.defaultEdgeOptions),l=Y.useMemo(()=>W1(i,{id:r,defaultColor:t,defaultMarkerStart:s==null?void 0:s.markerStart,defaultMarkerEnd:s==null?void 0:s.markerEnd}),[i,s,r,t]);return l.length?x.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:x.jsx("defs",{children:l.map(c=>x.jsx(U_,{id:c.id,type:c.type,color:c.color,width:c.width,height:c.height,markerUnits:c.markerUnits,strokeWidth:c.strokeWidth,orient:c.orient},c.id))})}):null};Ug.displayName="MarkerDefinitions";var K_=Y.memo(Ug);function Kg({x:t,y:r,label:i,labelStyle:s,labelShowBg:l=!0,labelBgStyle:c,labelBgPadding:d=[2,4],labelBgBorderRadius:h=2,children:y,className:b,...k}){const[w,S]=Y.useState({x:1,y:0,width:0,height:0}),C=Kt(["react-flow__edge-textwrapper",b]),j=Y.useRef(null);return Y.useEffect(()=>{if(j.current){const $=j.current.getBBox();S({x:$.x,y:$.y,width:$.width,height:$.height})}},[i]),i?x.jsxs("g",{transform:`translate(${t-w.width/2} ${r-w.height/2})`,className:C,visibility:w.width?"visible":"hidden",...k,children:[l&&x.jsx("rect",{width:w.width+2*d[0],x:-d[0],y:-d[1],height:w.height+2*d[1],className:"react-flow__edge-textbg",style:c,rx:h,ry:h}),x.jsx("text",{className:"react-flow__edge-text",y:w.height/2,dy:"0.3em",ref:j,style:s,children:i}),y]}):null}Kg.displayName="EdgeText";const q_=Y.memo(Kg);function Au({path:t,labelX:r,labelY:i,label:s,labelStyle:l,labelShowBg:c,labelBgStyle:d,labelBgPadding:h,labelBgBorderRadius:y,interactionWidth:b=20,...k}){return x.jsxs(x.Fragment,{children:[x.jsx("path",{...k,d:t,fill:"none",className:Kt(["react-flow__edge-path",k.className])}),b?x.jsx("path",{d:t,fill:"none",strokeOpacity:0,strokeWidth:b,className:"react-flow__edge-interaction"}):null,s&&Dr(r)&&Dr(i)?x.jsx(q_,{x:r,y:i,label:s,labelStyle:l,labelShowBg:c,labelBgStyle:d,labelBgPadding:h,labelBgBorderRadius:y}):null]})}function nm({pos:t,x1:r,y1:i,x2:s,y2:l}){return t===Ze.Left||t===Ze.Right?[.5*(r+s),i]:[r,.5*(i+l)]}function qg({sourceX:t,sourceY:r,sourcePosition:i=Ze.Bottom,targetX:s,targetY:l,targetPosition:c=Ze.Top}){const[d,h]=nm({pos:i,x1:t,y1:r,x2:s,y2:l}),[y,b]=nm({pos:c,x1:s,y1:l,x2:t,y2:r}),[k,w,S,C]=pg({sourceX:t,sourceY:r,targetX:s,targetY:l,sourceControlX:d,sourceControlY:h,targetControlX:y,targetControlY:b});return[`M${t},${r} C${d},${h} ${y},${b} ${s},${l}`,k,w,S,C]}function Wg(t){return Y.memo(({id:r,sourceX:i,sourceY:s,targetX:l,targetY:c,sourcePosition:d,targetPosition:h,label:y,labelStyle:b,labelShowBg:k,labelBgStyle:w,labelBgPadding:S,labelBgBorderRadius:C,style:j,markerEnd:$,markerStart:T,interactionWidth:I})=>{const[U,P,R]=qg({sourceX:i,sourceY:s,sourcePosition:d,targetX:l,targetY:c,targetPosition:h}),H=t.isInternal?void 0:r;return x.jsx(Au,{id:H,path:U,labelX:P,labelY:R,label:y,labelStyle:b,labelShowBg:k,labelBgStyle:w,labelBgPadding:S,labelBgBorderRadius:C,style:j,markerEnd:$,markerStart:T,interactionWidth:I})})}const W_=Wg({isInternal:!1}),Yg=Wg({isInternal:!0});W_.displayName="SimpleBezierEdge";Yg.displayName="SimpleBezierEdgeInternal";function Xg(t){return Y.memo(({id:r,sourceX:i,sourceY:s,targetX:l,targetY:c,label:d,labelStyle:h,labelShowBg:y,labelBgStyle:b,labelBgPadding:k,labelBgBorderRadius:w,style:S,sourcePosition:C=Ze.Bottom,targetPosition:j=Ze.Top,markerEnd:$,markerStart:T,pathOptions:I,interactionWidth:U})=>{const[P,R,H]=Mf({sourceX:i,sourceY:s,sourcePosition:C,targetX:l,targetY:c,targetPosition:j,borderRadius:I==null?void 0:I.borderRadius,offset:I==null?void 0:I.offset,stepPosition:I==null?void 0:I.stepPosition}),V=t.isInternal?void 0:r;return x.jsx(Au,{id:V,path:P,labelX:R,labelY:H,label:d,labelStyle:h,labelShowBg:y,labelBgStyle:b,labelBgPadding:k,labelBgBorderRadius:w,style:S,markerEnd:$,markerStart:T,interactionWidth:U})})}const Qg=Xg({isInternal:!1}),Gg=Xg({isInternal:!0});Qg.displayName="SmoothStepEdge";Gg.displayName="SmoothStepEdgeInternal";function Jg(t){return Y.memo(({id:r,...i})=>{var l;const s=t.isInternal?void 0:r;return x.jsx(Qg,{...i,id:s,pathOptions:Y.useMemo(()=>{var c;return{borderRadius:0,offset:(c=i.pathOptions)==null?void 0:c.offset}},[(l=i.pathOptions)==null?void 0:l.offset])})})}const Y_=Jg({isInternal:!1}),Zg=Jg({isInternal:!0});Y_.displayName="StepEdge";Zg.displayName="StepEdgeInternal";function e0(t){return Y.memo(({id:r,sourceX:i,sourceY:s,targetX:l,targetY:c,label:d,labelStyle:h,labelShowBg:y,labelBgStyle:b,labelBgPadding:k,labelBgBorderRadius:w,style:S,markerEnd:C,markerStart:j,interactionWidth:$})=>{const[T,I,U]=yg({sourceX:i,sourceY:s,targetX:l,targetY:c}),P=t.isInternal?void 0:r;return x.jsx(Au,{id:P,path:T,labelX:I,labelY:U,label:d,labelStyle:h,labelShowBg:y,labelBgStyle:b,labelBgPadding:k,labelBgBorderRadius:w,style:S,markerEnd:C,markerStart:j,interactionWidth:$})})}const X_=e0({isInternal:!1}),t0=e0({isInternal:!0});X_.displayName="StraightEdge";t0.displayName="StraightEdgeInternal";function n0(t){return Y.memo(({id:r,sourceX:i,sourceY:s,targetX:l,targetY:c,sourcePosition:d=Ze.Bottom,targetPosition:h=Ze.Top,label:y,labelStyle:b,labelShowBg:k,labelBgStyle:w,labelBgPadding:S,labelBgBorderRadius:C,style:j,markerEnd:$,markerStart:T,pathOptions:I,interactionWidth:U})=>{const[P,R,H]=hg({sourceX:i,sourceY:s,sourcePosition:d,targetX:l,targetY:c,targetPosition:h,curvature:I==null?void 0:I.curvature}),V=t.isInternal?void 0:r;return x.jsx(Au,{id:V,path:P,labelX:R,labelY:H,label:y,labelStyle:b,labelShowBg:k,labelBgStyle:w,labelBgPadding:S,labelBgBorderRadius:C,style:j,markerEnd:$,markerStart:T,interactionWidth:U})})}const Q_=n0({isInternal:!1}),r0=n0({isInternal:!0});Q_.displayName="BezierEdge";r0.displayName="BezierEdgeInternal";const rm={default:r0,straight:t0,step:Zg,smoothstep:Gg,simplebezier:Yg},om={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},G_=(t,r,i)=>i===Ze.Left?t-r:i===Ze.Right?t+r:t,J_=(t,r,i)=>i===Ze.Top?t-r:i===Ze.Bottom?t+r:t,im="react-flow__edgeupdater";function sm({position:t,centerX:r,centerY:i,radius:s=10,onMouseDown:l,onMouseEnter:c,onMouseOut:d,type:h}){return x.jsx("circle",{onMouseDown:l,onMouseEnter:c,onMouseOut:d,className:Kt([im,`${im}-${h}`]),cx:G_(r,s,t),cy:J_(i,s,t),r:s,stroke:"transparent",fill:"transparent"})}function Z_({isReconnectable:t,reconnectRadius:r,edge:i,sourceX:s,sourceY:l,targetX:c,targetY:d,sourcePosition:h,targetPosition:y,onReconnect:b,onReconnectStart:k,onReconnectEnd:w,setReconnecting:S,setUpdateHover:C}){const j=$t(),$=(R,H)=>{if(R.button!==0)return;const{autoPanOnConnect:V,domNode:Q,connectionMode:ce,connectionRadius:de,lib:we,onConnectStart:q,cancelConnection:fe,nodeLookup:xe,rfId:L,panBy:le,updateConnection:G}=j.getState(),ie=H.type==="target",F=(A,K)=>{S(!1),w==null||w(A,i,H.type,K)},W=A=>b==null?void 0:b(i,A),B=(A,K)=>{S(!0),k==null||k(R,i,H.type),q==null||q(A,K)};If.onPointerDown(R.nativeEvent,{autoPanOnConnect:V,connectionMode:ce,connectionRadius:de,domNode:Q,handleId:H.id,nodeId:H.nodeId,nodeLookup:xe,isTarget:ie,edgeUpdaterType:H.type,lib:we,flowId:L,cancelConnection:fe,panBy:le,isValidConnection:(...A)=>{var K,be;return((be=(K=j.getState()).isValidConnection)==null?void 0:be.call(K,...A))??!0},onConnect:W,onConnectStart:B,onConnectEnd:(...A)=>{var K,be;return(be=(K=j.getState()).onConnectEnd)==null?void 0:be.call(K,...A)},onReconnectEnd:F,updateConnection:G,getTransform:()=>j.getState().transform,getFromHandle:()=>j.getState().connection.fromHandle,dragThreshold:j.getState().connectionDragThreshold,handleDomNode:R.currentTarget})},T=R=>$(R,{nodeId:i.target,id:i.targetHandle??null,type:"target"}),I=R=>$(R,{nodeId:i.source,id:i.sourceHandle??null,type:"source"}),U=()=>C(!0),P=()=>C(!1);return x.jsxs(x.Fragment,{children:[(t===!0||t==="source")&&x.jsx(sm,{position:h,centerX:s,centerY:l,radius:r,onMouseDown:T,onMouseEnter:U,onMouseOut:P,type:"source"}),(t===!0||t==="target")&&x.jsx(sm,{position:y,centerX:c,centerY:d,radius:r,onMouseDown:I,onMouseEnter:U,onMouseOut:P,type:"target"})]})}function eS({id:t,edgesFocusable:r,edgesReconnectable:i,elementsSelectable:s,onClick:l,onDoubleClick:c,onContextMenu:d,onMouseEnter:h,onMouseMove:y,onMouseLeave:b,reconnectRadius:k,onReconnect:w,onReconnectStart:S,onReconnectEnd:C,rfId:j,edgeTypes:$,noPanClassName:T,onError:I,disableKeyboardA11y:U}){let P=vt(Re=>Re.edgeLookup.get(t));const R=vt(Re=>Re.defaultEdgeOptions);P=R?{...R,...P}:P;let H=P.type||"default",V=($==null?void 0:$[H])||rm[H];V===void 0&&(I==null||I("011",eo.error011(H)),H="default",V=($==null?void 0:$.default)||rm.default);const Q=!!(P.focusable||r&&typeof P.focusable>"u"),ce=typeof w<"u"&&(P.reconnectable||i&&typeof P.reconnectable>"u"),de=!!(P.selectable||s&&typeof P.selectable>"u"),we=Y.useRef(null),[q,fe]=Y.useState(!1),[xe,L]=Y.useState(!1),le=$t(),{zIndex:G,sourceX:ie,sourceY:F,targetX:W,targetY:B,sourcePosition:A,targetPosition:K}=vt(Y.useCallback(Re=>{const Ue=Re.nodeLookup.get(P.source),lt=Re.nodeLookup.get(P.target);if(!Ue||!lt)return{zIndex:P.zIndex,...om};const ut=q1({id:t,sourceNode:Ue,targetNode:lt,sourceHandle:P.sourceHandle||null,targetHandle:P.targetHandle||null,connectionMode:Re.connectionMode,onError:I});return{zIndex:z1({selected:P.selected,zIndex:P.zIndex,sourceNode:Ue,targetNode:lt,elevateOnSelect:Re.elevateEdgesOnSelect,zIndexMode:Re.zIndexMode}),...ut||om}},[P.source,P.target,P.sourceHandle,P.targetHandle,P.selected,P.zIndex]),Ot),be=Y.useMemo(()=>P.markerStart?`url('#${$f(P.markerStart,j)}')`:void 0,[P.markerStart,j]),Se=Y.useMemo(()=>P.markerEnd?`url('#${$f(P.markerEnd,j)}')`:void 0,[P.markerEnd,j]);if(P.hidden||ie===null||F===null||W===null||B===null)return null;const Me=Re=>{var it;const{addSelectedEdges:Ue,unselectNodesAndEdges:lt,multiSelectionActive:ut}=le.getState();de&&(le.setState({nodesSelectionActive:!1}),P.selected&&ut?(lt({nodes:[],edges:[P]}),(it=we.current)==null||it.blur()):Ue([t])),l&&l(Re,P)},Ie=c?Re=>{c(Re,{...P})}:void 0,Ae=d?Re=>{d(Re,{...P})}:void 0,_e=h?Re=>{h(Re,{...P})}:void 0,ze=y?Re=>{y(Re,{...P})}:void 0,ke=b?Re=>{b(Re,{...P})}:void 0,Be=Re=>{var Ue;if(!U&&Zm.includes(Re.key)&&de){const{unselectNodesAndEdges:lt,addSelectedEdges:ut}=le.getState();Re.key==="Escape"?((Ue=we.current)==null||Ue.blur(),lt({edges:[P]})):ut([t])}};return x.jsx("svg",{style:{zIndex:G},children:x.jsxs("g",{className:Kt(["react-flow__edge",`react-flow__edge-${H}`,P.className,T,{selected:P.selected,animated:P.animated,inactive:!de&&!l,updating:q,selectable:de}]),onClick:Me,onDoubleClick:Ie,onContextMenu:Ae,onMouseEnter:_e,onMouseMove:ze,onMouseLeave:ke,onKeyDown:Q?Be:void 0,tabIndex:Q?0:void 0,role:P.ariaRole??(Q?"group":"img"),"aria-roledescription":"edge","data-id":t,"data-testid":`rf__edge-${t}`,"aria-label":P.ariaLabel===null?void 0:P.ariaLabel||`Edge from ${P.source} to ${P.target}`,"aria-describedby":Q?`${Tg}-${j}`:void 0,ref:we,...P.domAttributes,children:[!xe&&x.jsx(V,{id:t,source:P.source,target:P.target,type:P.type,selected:P.selected,animated:P.animated,selectable:de,deletable:P.deletable??!0,label:P.label,labelStyle:P.labelStyle,labelShowBg:P.labelShowBg,labelBgStyle:P.labelBgStyle,labelBgPadding:P.labelBgPadding,labelBgBorderRadius:P.labelBgBorderRadius,sourceX:ie,sourceY:F,targetX:W,targetY:B,sourcePosition:A,targetPosition:K,data:P.data,style:P.style,sourceHandleId:P.sourceHandle,targetHandleId:P.targetHandle,markerStart:be,markerEnd:Se,pathOptions:"pathOptions"in P?P.pathOptions:void 0,interactionWidth:P.interactionWidth}),ce&&x.jsx(Z_,{edge:P,isReconnectable:ce,reconnectRadius:k,onReconnect:w,onReconnectStart:S,onReconnectEnd:C,sourceX:ie,sourceY:F,targetX:W,targetY:B,sourcePosition:A,targetPosition:K,setUpdateHover:fe,setReconnecting:L})]})})}var tS=Y.memo(eS);const nS=t=>({edgesFocusable:t.edgesFocusable,edgesReconnectable:t.edgesReconnectable,elementsSelectable:t.elementsSelectable,connectionMode:t.connectionMode,onError:t.onError});function o0({defaultMarkerColor:t,onlyRenderVisibleElements:r,rfId:i,edgeTypes:s,noPanClassName:l,onReconnect:c,onEdgeContextMenu:d,onEdgeMouseEnter:h,onEdgeMouseMove:y,onEdgeMouseLeave:b,onEdgeClick:k,reconnectRadius:w,onEdgeDoubleClick:S,onReconnectStart:C,onReconnectEnd:j,disableKeyboardA11y:$}){const{edgesFocusable:T,edgesReconnectable:I,elementsSelectable:U,onError:P}=vt(nS,Ot),R=F_(r);return x.jsxs("div",{className:"react-flow__edges",children:[x.jsx(K_,{defaultColor:t,rfId:i}),R.map(H=>x.jsx(tS,{id:H,edgesFocusable:T,edgesReconnectable:I,elementsSelectable:U,noPanClassName:l,onReconnect:c,onContextMenu:d,onMouseEnter:h,onMouseMove:y,onMouseLeave:b,onClick:k,reconnectRadius:w,onDoubleClick:S,onReconnectStart:C,onReconnectEnd:j,rfId:i,onError:P,edgeTypes:s,disableKeyboardA11y:$},H))]})}o0.displayName="EdgeRenderer";const rS=Y.memo(o0),oS=t=>`translate(${t.transform[0]}px,${t.transform[1]}px) scale(${t.transform[2]})`;function iS({children:t}){const r=vt(oS);return x.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:r},children:t})}function sS(t){const r=Zf(),i=Y.useRef(!1);Y.useEffect(()=>{!i.current&&r.viewportInitialized&&t&&(setTimeout(()=>t(r),1),i.current=!0)},[t,r.viewportInitialized])}const aS=t=>{var r;return(r=t.panZoom)==null?void 0:r.syncViewport};function lS(t){const r=vt(aS),i=$t();return Y.useEffect(()=>{t&&(r==null||r(t),i.setState({transform:[t.x,t.y,t.zoom]}))},[t,r]),null}function uS(t){return t.connection.inProgress?{...t.connection,to:za(t.connection.to,t.transform)}:{...t.connection}}function cS(t){return uS}function fS(t){const r=cS();return vt(r,Ot)}const dS=t=>({nodesConnectable:t.nodesConnectable,isValid:t.connection.isValid,inProgress:t.connection.inProgress,width:t.width,height:t.height});function pS({containerStyle:t,style:r,type:i,component:s}){const{nodesConnectable:l,width:c,height:d,isValid:h,inProgress:y}=vt(dS,Ot);return!(c&&l&&y)?null:x.jsx("svg",{style:t,width:c,height:d,className:"react-flow__connectionline react-flow__container",children:x.jsx("g",{className:Kt(["react-flow__connection",ng(h)]),children:x.jsx(i0,{style:r,type:i,CustomComponent:s,isValid:h})})})}const i0=({style:t,type:r=fi.Bezier,CustomComponent:i,isValid:s})=>{const{inProgress:l,from:c,fromNode:d,fromHandle:h,fromPosition:y,to:b,toNode:k,toHandle:w,toPosition:S,pointer:C}=fS();if(!l)return;if(i)return x.jsx(i,{connectionLineType:r,connectionLineStyle:t,fromNode:d,fromHandle:h,fromX:c.x,fromY:c.y,toX:b.x,toY:b.y,fromPosition:y,toPosition:S,connectionStatus:ng(s),toNode:k,toHandle:w,pointer:C});let j="";const $={sourceX:c.x,sourceY:c.y,sourcePosition:y,targetX:b.x,targetY:b.y,targetPosition:S};switch(r){case fi.Bezier:[j]=hg($);break;case fi.SimpleBezier:[j]=qg($);break;case fi.Step:[j]=Mf({...$,borderRadius:0});break;case fi.SmoothStep:[j]=Mf($);break;default:[j]=yg($)}return x.jsx("path",{d:j,fill:"none",className:"react-flow__connection-path",style:t})};i0.displayName="ConnectionLine";const hS={};function am(t=hS){Y.useRef(t),$t(),Y.useEffect(()=>{},[t])}function mS(){$t(),Y.useRef(!1),Y.useEffect(()=>{},[])}function s0({nodeTypes:t,edgeTypes:r,onInit:i,onNodeClick:s,onEdgeClick:l,onNodeDoubleClick:c,onEdgeDoubleClick:d,onNodeMouseEnter:h,onNodeMouseMove:y,onNodeMouseLeave:b,onNodeContextMenu:k,onSelectionContextMenu:w,onSelectionStart:S,onSelectionEnd:C,connectionLineType:j,connectionLineStyle:$,connectionLineComponent:T,connectionLineContainerStyle:I,selectionKeyCode:U,selectionOnDrag:P,selectionMode:R,multiSelectionKeyCode:H,panActivationKeyCode:V,zoomActivationKeyCode:Q,deleteKeyCode:ce,onlyRenderVisibleElements:de,elementsSelectable:we,defaultViewport:q,translateExtent:fe,minZoom:xe,maxZoom:L,preventScrolling:le,defaultMarkerColor:G,zoomOnScroll:ie,zoomOnPinch:F,panOnScroll:W,panOnScrollSpeed:B,panOnScrollMode:A,zoomOnDoubleClick:K,panOnDrag:be,onPaneClick:Se,onPaneMouseEnter:Me,onPaneMouseMove:Ie,onPaneMouseLeave:Ae,onPaneScroll:_e,onPaneContextMenu:ze,paneClickDistance:ke,nodeClickDistance:Be,onEdgeContextMenu:Re,onEdgeMouseEnter:Ue,onEdgeMouseMove:lt,onEdgeMouseLeave:ut,reconnectRadius:it,onReconnect:Ct,onReconnectStart:qt,onReconnectEnd:Gt,noDragClassName:Rt,noWheelClassName:Nt,noPanClassName:pn,disableKeyboardA11y:on,nodeExtent:Wt,rfId:Nn,viewport:pt,onViewportChange:Yt}){return am(t),am(r),mS(),sS(i),lS(pt),x.jsx(M_,{onPaneClick:Se,onPaneMouseEnter:Me,onPaneMouseMove:Ie,onPaneMouseLeave:Ae,onPaneContextMenu:ze,onPaneScroll:_e,paneClickDistance:ke,deleteKeyCode:ce,selectionKeyCode:U,selectionOnDrag:P,selectionMode:R,onSelectionStart:S,onSelectionEnd:C,multiSelectionKeyCode:H,panActivationKeyCode:V,zoomActivationKeyCode:Q,elementsSelectable:we,zoomOnScroll:ie,zoomOnPinch:F,zoomOnDoubleClick:K,panOnScroll:W,panOnScrollSpeed:B,panOnScrollMode:A,panOnDrag:be,defaultViewport:q,translateExtent:fe,minZoom:xe,maxZoom:L,onSelectionContextMenu:w,preventScrolling:le,noDragClassName:Rt,noWheelClassName:Nt,noPanClassName:pn,disableKeyboardA11y:on,onViewportChange:Yt,isControlledViewport:!!pt,children:x.jsxs(iS,{children:[x.jsx(rS,{edgeTypes:r,onEdgeClick:l,onEdgeDoubleClick:d,onReconnect:Ct,onReconnectStart:qt,onReconnectEnd:Gt,onlyRenderVisibleElements:de,onEdgeContextMenu:Re,onEdgeMouseEnter:Ue,onEdgeMouseMove:lt,onEdgeMouseLeave:ut,reconnectRadius:it,defaultMarkerColor:G,noPanClassName:pn,disableKeyboardA11y:on,rfId:Nn}),x.jsx(pS,{style:$,type:j,component:T,containerStyle:I}),x.jsx("div",{className:"react-flow__edgelabel-renderer"}),x.jsx(z_,{nodeTypes:t,onNodeClick:s,onNodeDoubleClick:c,onNodeMouseEnter:h,onNodeMouseMove:y,onNodeMouseLeave:b,onNodeContextMenu:k,nodeClickDistance:Be,onlyRenderVisibleElements:de,noPanClassName:pn,noDragClassName:Rt,disableKeyboardA11y:on,nodeExtent:Wt,rfId:Nn}),x.jsx("div",{className:"react-flow__viewport-portal"})]})})}s0.displayName="GraphView";const gS=Y.memo(s0),lm=({nodes:t,edges:r,defaultNodes:i,defaultEdges:s,width:l,height:c,fitView:d,fitViewOptions:h,minZoom:y=.5,maxZoom:b=2,nodeOrigin:k,nodeExtent:w,zIndexMode:S="basic"}={})=>{const C=new Map,j=new Map,$=new Map,T=new Map,I=s??r??[],U=i??t??[],P=k??[0,0],R=w??ja;wg($,T,I);const{nodesInitialized:H}=Tf(U,C,j,{nodeOrigin:P,nodeExtent:R,zIndexMode:S});let V=[0,0,1];if(d&&l&&c){const Q=La(C,{filter:q=>!!((q.width||q.initialWidth)&&(q.height||q.initialHeight))}),{x:ce,y:de,zoom:we}=qf(Q,l,c,y,b,(h==null?void 0:h.padding)??.1);V=[ce,de,we]}return{rfId:"1",width:l??0,height:c??0,transform:V,nodes:U,nodesInitialized:H,nodeLookup:C,parentLookup:j,edges:I,edgeLookup:T,connectionLookup:$,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:i!==void 0,hasDefaultEdges:s!==void 0,panZoom:null,minZoom:y,maxZoom:b,translateExtent:ja,nodeExtent:R,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:$s.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:P,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:d??!1,fitViewOptions:h,fitViewResolver:null,connection:{...tg},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:I1,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:eg,zIndexMode:S,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},yS=({nodes:t,edges:r,defaultNodes:i,defaultEdges:s,width:l,height:c,fitView:d,fitViewOptions:h,minZoom:y,maxZoom:b,nodeOrigin:k,nodeExtent:w,zIndexMode:S})=>Rb((C,j)=>{async function $(){const{nodeLookup:T,panZoom:I,fitViewOptions:U,fitViewResolver:P,width:R,height:H,minZoom:V,maxZoom:Q}=j();I&&(await $1({nodes:T,width:R,height:H,panZoom:I,minZoom:V,maxZoom:Q},U),P==null||P.resolve(!0),C({fitViewResolver:null}))}return{...lm({nodes:t,edges:r,width:l,height:c,fitView:d,fitViewOptions:h,minZoom:y,maxZoom:b,nodeOrigin:k,nodeExtent:w,defaultNodes:i,defaultEdges:s,zIndexMode:S}),setNodes:T=>{const{nodeLookup:I,parentLookup:U,nodeOrigin:P,elevateNodesOnSelect:R,fitViewQueued:H,zIndexMode:V,nodesSelectionActive:Q}=j(),{nodesInitialized:ce,hasSelectedNodes:de}=Tf(T,I,U,{nodeOrigin:P,nodeExtent:w,elevateNodesOnSelect:R,checkEquality:!0,zIndexMode:V}),we=Q&&de;H&&ce?($(),C({nodes:T,nodesInitialized:ce,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:we})):C({nodes:T,nodesInitialized:ce,nodesSelectionActive:we})},setEdges:T=>{const{connectionLookup:I,edgeLookup:U}=j();wg(I,U,T),C({edges:T})},setDefaultNodesAndEdges:(T,I)=>{if(T){const{setNodes:U}=j();U(T),C({hasDefaultNodes:!0})}if(I){const{setEdges:U}=j();U(I),C({hasDefaultEdges:!0})}},updateNodeInternals:T=>{const{triggerNodeChanges:I,nodeLookup:U,parentLookup:P,domNode:R,nodeOrigin:H,nodeExtent:V,debug:Q,fitViewQueued:ce,zIndexMode:de}=j(),{changes:we,updatedInternals:q}=eb(T,U,P,R,H,V,de);q&&(Q1(U,P,{nodeOrigin:H,nodeExtent:V,zIndexMode:de}),ce?($(),C({fitViewQueued:!1,fitViewOptions:void 0})):C({}),(we==null?void 0:we.length)>0&&(Q&&console.log("React Flow: trigger node changes",we),I==null||I(we)))},updateNodePositions:(T,I=!1)=>{const U=[];let P=[];const{nodeLookup:R,triggerNodeChanges:H,connection:V,updateConnection:Q,onNodesChangeMiddlewareMap:ce}=j();for(const[de,we]of T){const q=R.get(de),fe=!!(q!=null&&q.expandParent&&(q!=null&&q.parentId)&&(we!=null&&we.position)),xe={id:de,type:"position",position:fe?{x:Math.max(0,we.position.x),y:Math.max(0,we.position.y)}:we.position,dragging:I};if(q&&V.inProgress&&V.fromNode.id===q.id){const L=Bi(q,V.fromHandle,Ze.Left,!0);Q({...V,from:L})}fe&&q.parentId&&U.push({id:de,parentId:q.parentId,rect:{...we.internals.positionAbsolute,width:we.measured.width??0,height:we.measured.height??0}}),P.push(xe)}if(U.length>0){const{parentLookup:de,nodeOrigin:we}=j(),q=Jf(U,R,de,we);P.push(...q)}for(const de of ce.values())P=de(P);H(P)},triggerNodeChanges:T=>{const{onNodesChange:I,setNodes:U,nodes:P,hasDefaultNodes:R,debug:H}=j();if(T!=null&&T.length){if(R){const V=Og(T,P);U(V)}H&&console.log("React Flow: trigger node changes",T),I==null||I(T)}},triggerEdgeChanges:T=>{const{onEdgesChange:I,setEdges:U,edges:P,hasDefaultEdges:R,debug:H}=j();if(T!=null&&T.length){if(R){const V=Rg(T,P);U(V)}H&&console.log("React Flow: trigger edge changes",T),I==null||I(T)}},addSelectedNodes:T=>{const{multiSelectionActive:I,edgeLookup:U,nodeLookup:P,triggerNodeChanges:R,triggerEdgeChanges:H}=j();if(I){const V=T.map(Q=>Ai(Q,!0));R(V);return}R(Es(P,new Set([...T]),!0)),H(Es(U))},addSelectedEdges:T=>{const{multiSelectionActive:I,edgeLookup:U,nodeLookup:P,triggerNodeChanges:R,triggerEdgeChanges:H}=j();if(I){const V=T.map(Q=>Ai(Q,!0));H(V);return}H(Es(U,new Set([...T]))),R(Es(P,new Set,!0))},unselectNodesAndEdges:({nodes:T,edges:I}={})=>{const{edges:U,nodes:P,nodeLookup:R,triggerNodeChanges:H,triggerEdgeChanges:V}=j(),Q=T||P,ce=I||U,de=[];for(const q of Q){if(!q.selected)continue;const fe=R.get(q.id);fe&&(fe.selected=!1),de.push(Ai(q.id,!1))}const we=[];for(const q of ce)q.selected&&we.push(Ai(q.id,!1));H(de),V(we)},setMinZoom:T=>{const{panZoom:I,maxZoom:U}=j();I==null||I.setScaleExtent([T,U]),C({minZoom:T})},setMaxZoom:T=>{const{panZoom:I,minZoom:U}=j();I==null||I.setScaleExtent([U,T]),C({maxZoom:T})},setTranslateExtent:T=>{var I;(I=j().panZoom)==null||I.setTranslateExtent(T),C({translateExtent:T})},resetSelectedElements:()=>{const{edges:T,nodes:I,triggerNodeChanges:U,triggerEdgeChanges:P,elementsSelectable:R}=j();if(!R)return;const H=I.reduce((Q,ce)=>ce.selected?[...Q,Ai(ce.id,!1)]:Q,[]),V=T.reduce((Q,ce)=>ce.selected?[...Q,Ai(ce.id,!1)]:Q,[]);U(H),P(V)},setNodeExtent:T=>{const{nodes:I,nodeLookup:U,parentLookup:P,nodeOrigin:R,elevateNodesOnSelect:H,nodeExtent:V,zIndexMode:Q}=j();T[0][0]===V[0][0]&&T[0][1]===V[0][1]&&T[1][0]===V[1][0]&&T[1][1]===V[1][1]||(Tf(I,U,P,{nodeOrigin:R,nodeExtent:T,elevateNodesOnSelect:H,checkEquality:!1,zIndexMode:Q}),C({nodeExtent:T}))},panBy:T=>{const{transform:I,width:U,height:P,panZoom:R,translateExtent:H}=j();return tb({delta:T,panZoom:R,transform:I,translateExtent:H,width:U,height:P})},setCenter:async(T,I,U)=>{const{width:P,height:R,maxZoom:H,panZoom:V}=j();if(!V)return Promise.resolve(!1);const Q=typeof(U==null?void 0:U.zoom)<"u"?U.zoom:H;return await V.setViewport({x:P/2-T*Q,y:R/2-I*Q,zoom:Q},{duration:U==null?void 0:U.duration,ease:U==null?void 0:U.ease,interpolate:U==null?void 0:U.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{C({connection:{...tg}})},updateConnection:T=>{C({connection:T})},reset:()=>C({...lm()})}},Object.is);function vS({initialNodes:t,initialEdges:r,defaultNodes:i,defaultEdges:s,initialWidth:l,initialHeight:c,initialMinZoom:d,initialMaxZoom:h,initialFitViewOptions:y,fitView:b,nodeOrigin:k,nodeExtent:w,zIndexMode:S,children:C}){const[j]=Y.useState(()=>yS({nodes:t,edges:r,defaultNodes:i,defaultEdges:s,width:l,height:c,fitView:b,minZoom:d,maxZoom:h,fitViewOptions:y,nodeOrigin:k,nodeExtent:w,zIndexMode:S}));return x.jsx(Lb,{value:j,children:x.jsx(i_,{children:C})})}function xS({children:t,nodes:r,edges:i,defaultNodes:s,defaultEdges:l,width:c,height:d,fitView:h,fitViewOptions:y,minZoom:b,maxZoom:k,nodeOrigin:w,nodeExtent:S,zIndexMode:C}){return Y.useContext(Tu)?x.jsx(x.Fragment,{children:t}):x.jsx(vS,{initialNodes:r,initialEdges:i,defaultNodes:s,defaultEdges:l,initialWidth:c,initialHeight:d,fitView:h,initialFitViewOptions:y,initialMinZoom:b,initialMaxZoom:k,nodeOrigin:w,nodeExtent:S,zIndexMode:C,children:t})}const wS={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function bS({nodes:t,edges:r,defaultNodes:i,defaultEdges:s,className:l,nodeTypes:c,edgeTypes:d,onNodeClick:h,onEdgeClick:y,onInit:b,onMove:k,onMoveStart:w,onMoveEnd:S,onConnect:C,onConnectStart:j,onConnectEnd:$,onClickConnectStart:T,onClickConnectEnd:I,onNodeMouseEnter:U,onNodeMouseMove:P,onNodeMouseLeave:R,onNodeContextMenu:H,onNodeDoubleClick:V,onNodeDragStart:Q,onNodeDrag:ce,onNodeDragStop:de,onNodesDelete:we,onEdgesDelete:q,onDelete:fe,onSelectionChange:xe,onSelectionDragStart:L,onSelectionDrag:le,onSelectionDragStop:G,onSelectionContextMenu:ie,onSelectionStart:F,onSelectionEnd:W,onBeforeDelete:B,connectionMode:A,connectionLineType:K=fi.Bezier,connectionLineStyle:be,connectionLineComponent:Se,connectionLineContainerStyle:Me,deleteKeyCode:Ie="Backspace",selectionKeyCode:Ae="Shift",selectionOnDrag:_e=!1,selectionMode:ze=Pa.Full,panActivationKeyCode:ke="Space",multiSelectionKeyCode:Be=$a()?"Meta":"Control",zoomActivationKeyCode:Re=$a()?"Meta":"Control",snapToGrid:Ue,snapGrid:lt,onlyRenderVisibleElements:ut=!1,selectNodesOnDrag:it,nodesDraggable:Ct,autoPanOnNodeFocus:qt,nodesConnectable:Gt,nodesFocusable:Rt,nodeOrigin:Nt=Ig,edgesFocusable:pn,edgesReconnectable:on,elementsSelectable:Wt=!0,defaultViewport:Nn=Qb,minZoom:pt=.5,maxZoom:Yt=2,translateExtent:hn=ja,preventScrolling:mn=!0,nodeExtent:sn,defaultMarkerColor:En="#b1b1b7",zoomOnScroll:Kn=!0,zoomOnPinch:_r=!0,panOnScroll:Br=!1,panOnScrollSpeed:Cn=.5,panOnScrollMode:qe=Li.Free,zoomOnDoubleClick:qn=!0,panOnDrag:jn=!0,onPaneClick:ar,onPaneMouseEnter:He,onPaneMouseMove:An,onPaneMouseLeave:Jt,onPaneScroll:lr,onPaneContextMenu:ro,paneClickDistance:Hr=1,nodeClickDistance:Oo=0,children:Ro,onReconnect:On,onReconnectStart:Wn,onReconnectEnd:Yn,onEdgeContextMenu:ur,onEdgeDoubleClick:gt,onEdgeMouseEnter:Tt,onEdgeMouseMove:cr,onEdgeMouseLeave:Xn,reconnectRadius:Qn=10,onNodesChange:fr,onEdgesChange:Lo,noDragClassName:gn="nodrag",noWheelClassName:Gn="nowheel",noPanClassName:z="nopan",fitView:Oe,fitViewOptions:We,connectOnClick:ct,attributionPosition:Pn,proOptions:Ht,defaultEdgeOptions:yn,elevateNodesOnSelect:Mn=!0,elevateEdgesOnSelect:kt=!1,disableKeyboardA11y:an=!1,autoPanOnConnect:mt,autoPanOnNodeDrag:oo,autoPanSpeed:Jn,connectionRadius:Zn,isValidConnection:dr,onError:Sr,style:di,id:pr,nodeDragThreshold:$n,connectionDragThreshold:ft,viewport:vn,onViewportChange:Hi,width:Do,height:io,colorMode:so="light",debug:ao,onScroll:er,ariaLabelConfig:xt,zIndexMode:Vr="basic",...lo},hr){const Ur=pr||"1",uo=e_(so),mr=Y.useCallback(pi=>{pi.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),er==null||er(pi)},[er]);return x.jsx("div",{"data-testid":"rf__wrapper",...lo,onScroll:mr,style:{...di,...wS},ref:hr,className:Kt(["react-flow",l,uo]),id:pr,role:"application",children:x.jsxs(xS,{nodes:t,edges:r,width:Do,height:io,fitView:Oe,fitViewOptions:We,minZoom:pt,maxZoom:Yt,nodeOrigin:Nt,nodeExtent:sn,zIndexMode:Vr,children:[x.jsx(Zb,{nodes:t,edges:r,defaultNodes:i,defaultEdges:s,onConnect:C,onConnectStart:j,onConnectEnd:$,onClickConnectStart:T,onClickConnectEnd:I,nodesDraggable:Ct,autoPanOnNodeFocus:qt,nodesConnectable:Gt,nodesFocusable:Rt,edgesFocusable:pn,edgesReconnectable:on,elementsSelectable:Wt,elevateNodesOnSelect:Mn,elevateEdgesOnSelect:kt,minZoom:pt,maxZoom:Yt,nodeExtent:sn,onNodesChange:fr,onEdgesChange:Lo,snapToGrid:Ue,snapGrid:lt,connectionMode:A,translateExtent:hn,connectOnClick:ct,defaultEdgeOptions:yn,fitView:Oe,fitViewOptions:We,onNodesDelete:we,onEdgesDelete:q,onDelete:fe,onNodeDragStart:Q,onNodeDrag:ce,onNodeDragStop:de,onSelectionDrag:le,onSelectionDragStart:L,onSelectionDragStop:G,onMove:k,onMoveStart:w,onMoveEnd:S,noPanClassName:z,nodeOrigin:Nt,rfId:Ur,autoPanOnConnect:mt,autoPanOnNodeDrag:oo,autoPanSpeed:Jn,onError:Sr,connectionRadius:Zn,isValidConnection:dr,selectNodesOnDrag:it,nodeDragThreshold:$n,connectionDragThreshold:ft,onBeforeDelete:B,debug:ao,ariaLabelConfig:xt,zIndexMode:Vr}),x.jsx(gS,{onInit:b,onNodeClick:h,onEdgeClick:y,onNodeMouseEnter:U,onNodeMouseMove:P,onNodeMouseLeave:R,onNodeContextMenu:H,onNodeDoubleClick:V,nodeTypes:c,edgeTypes:d,connectionLineType:K,connectionLineStyle:be,connectionLineComponent:Se,connectionLineContainerStyle:Me,selectionKeyCode:Ae,selectionOnDrag:_e,selectionMode:ze,deleteKeyCode:Ie,multiSelectionKeyCode:Be,panActivationKeyCode:ke,zoomActivationKeyCode:Re,onlyRenderVisibleElements:ut,defaultViewport:Nn,translateExtent:hn,minZoom:pt,maxZoom:Yt,preventScrolling:mn,zoomOnScroll:Kn,zoomOnPinch:_r,zoomOnDoubleClick:qn,panOnScroll:Br,panOnScrollSpeed:Cn,panOnScrollMode:qe,panOnDrag:jn,onPaneClick:ar,onPaneMouseEnter:He,onPaneMouseMove:An,onPaneMouseLeave:Jt,onPaneScroll:lr,onPaneContextMenu:ro,paneClickDistance:Hr,nodeClickDistance:Oo,onSelectionContextMenu:ie,onSelectionStart:F,onSelectionEnd:W,onReconnect:On,onReconnectStart:Wn,onReconnectEnd:Yn,onEdgeContextMenu:ur,onEdgeDoubleClick:gt,onEdgeMouseEnter:Tt,onEdgeMouseMove:cr,onEdgeMouseLeave:Xn,reconnectRadius:Qn,defaultMarkerColor:En,noDragClassName:gn,noWheelClassName:Gn,noPanClassName:z,rfId:Ur,disableKeyboardA11y:an,nodeExtent:sn,viewport:vn,onViewportChange:Hi}),x.jsx(Xb,{onSelectionChange:xe}),Ro,x.jsx(Ub,{proOptions:Ht,position:Pn}),x.jsx(Vb,{rfId:Ur,disableKeyboardA11y:an})]})})}var _S=Lg(bS);function SS(){const t=$t();return Y.useCallback(r=>{const{domNode:i,updateNodeInternals:s}=t.getState(),l=Array.isArray(r)?r:[r],c=new Map;l.forEach(d=>{const h=i==null?void 0:i.querySelector(`.react-flow__node[data-id="${d}"]`);h&&c.set(d,{id:d,nodeElement:h,force:!0})}),requestAnimationFrame(()=>s(c,{triggerFitView:!1}))},[])}function kS(t){const[r,i]=Y.useState(t),s=Y.useCallback(l=>i(c=>Og(l,c)),[]);return[r,i,s]}function NS(t){const[r,i]=Y.useState(t),s=Y.useCallback(l=>i(c=>Rg(l,c)),[]);return[r,i,s]}function ES({dimensions:t,lineWidth:r,variant:i,className:s}){return x.jsx("path",{strokeWidth:r,d:`M${t[0]/2} 0 V${t[1]} M0 ${t[1]/2} H${t[0]}`,className:Kt(["react-flow__background-pattern",i,s])})}function CS({radius:t,className:r}){return x.jsx("circle",{cx:t,cy:t,r:t,className:Kt(["react-flow__background-pattern","dots",r])})}var To;(function(t){t.Lines="lines",t.Dots="dots",t.Cross="cross"})(To||(To={}));const jS={[To.Dots]:1,[To.Lines]:1,[To.Cross]:6},PS=t=>({transform:t.transform,patternId:`pattern-${t.rfId}`});function a0({id:t,variant:r=To.Dots,gap:i=20,size:s,lineWidth:l=1,offset:c=0,color:d,bgColor:h,style:y,className:b,patternClassName:k}){const w=Y.useRef(null),{transform:S,patternId:C}=vt(PS,Ot),j=s||jS[r],$=r===To.Dots,T=r===To.Cross,I=Array.isArray(i)?i:[i,i],U=[I[0]*S[2]||1,I[1]*S[2]||1],P=j*S[2],R=Array.isArray(c)?c:[c,c],H=T?[P,P]:U,V=[R[0]*S[2]||1+H[0]/2,R[1]*S[2]||1+H[1]/2],Q=`${C}${t||""}`;return x.jsxs("svg",{className:Kt(["react-flow__background",b]),style:{...y,...Iu,"--xy-background-color-props":h,"--xy-background-pattern-color-props":d},ref:w,"data-testid":"rf__background",children:[x.jsx("pattern",{id:Q,x:S[0]%U[0],y:S[1]%U[1],width:U[0],height:U[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${V[0]},-${V[1]})`,children:$?x.jsx(CS,{radius:P/2,className:k}):x.jsx(ES,{dimensions:H,lineWidth:l,variant:r,className:k})}),x.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${Q})`})]})}a0.displayName="Background";const MS=Y.memo(a0);function $S(){return x.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:x.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function TS(){return x.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:x.jsx("path",{d:"M0 0h32v4.2H0z"})})}function IS(){return x.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:x.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 AS(){return x.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:x.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 OS(){return x.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:x.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"})})}function Jl({children:t,className:r,...i}){return x.jsx("button",{type:"button",className:Kt(["react-flow__controls-button",r]),...i,children:t})}const RS=t=>({isInteractive:t.nodesDraggable||t.nodesConnectable||t.elementsSelectable,minZoomReached:t.transform[2]<=t.minZoom,maxZoomReached:t.transform[2]>=t.maxZoom,ariaLabelConfig:t.ariaLabelConfig});function l0({style:t,showZoom:r=!0,showFitView:i=!0,showInteractive:s=!0,fitViewOptions:l,onZoomIn:c,onZoomOut:d,onFitView:h,onInteractiveChange:y,className:b,children:k,position:w="bottom-left",orientation:S="vertical","aria-label":C}){const j=$t(),{isInteractive:$,minZoomReached:T,maxZoomReached:I,ariaLabelConfig:U}=vt(RS,Ot),{zoomIn:P,zoomOut:R,fitView:H}=Zf(),V=()=>{P(),c==null||c()},Q=()=>{R(),d==null||d()},ce=()=>{H(l),h==null||h()},de=()=>{j.setState({nodesDraggable:!$,nodesConnectable:!$,elementsSelectable:!$}),y==null||y(!$)},we=S==="horizontal"?"horizontal":"vertical";return x.jsxs(Fa,{className:Kt(["react-flow__controls",we,b]),position:w,style:t,"data-testid":"rf__controls","aria-label":C??U["controls.ariaLabel"],children:[r&&x.jsxs(x.Fragment,{children:[x.jsx(Jl,{onClick:V,className:"react-flow__controls-zoomin",title:U["controls.zoomIn.ariaLabel"],"aria-label":U["controls.zoomIn.ariaLabel"],disabled:I,children:x.jsx($S,{})}),x.jsx(Jl,{onClick:Q,className:"react-flow__controls-zoomout",title:U["controls.zoomOut.ariaLabel"],"aria-label":U["controls.zoomOut.ariaLabel"],disabled:T,children:x.jsx(TS,{})})]}),i&&x.jsx(Jl,{className:"react-flow__controls-fitview",onClick:ce,title:U["controls.fitView.ariaLabel"],"aria-label":U["controls.fitView.ariaLabel"],children:x.jsx(IS,{})}),s&&x.jsx(Jl,{className:"react-flow__controls-interactive",onClick:de,title:U["controls.interactive.ariaLabel"],"aria-label":U["controls.interactive.ariaLabel"],children:$?x.jsx(OS,{}):x.jsx(AS,{})}),k]})}l0.displayName="Controls";const LS=Y.memo(l0);function DS({id:t,x:r,y:i,width:s,height:l,style:c,color:d,strokeColor:h,strokeWidth:y,className:b,borderRadius:k,shapeRendering:w,selected:S,onClick:C}){const{background:j,backgroundColor:$}=c||{},T=d||j||$;return x.jsx("rect",{className:Kt(["react-flow__minimap-node",{selected:S},b]),x:r,y:i,rx:k,ry:k,width:s,height:l,style:{fill:T,stroke:h,strokeWidth:y},shapeRendering:w,onClick:C?I=>C(I,t):void 0})}const zS=Y.memo(DS),FS=t=>t.nodes.map(r=>r.id),mf=t=>t instanceof Function?t:()=>t;function BS({nodeStrokeColor:t,nodeColor:r,nodeClassName:i="",nodeBorderRadius:s=5,nodeStrokeWidth:l,nodeComponent:c=zS,onClick:d}){const h=vt(FS,Ot),y=mf(r),b=mf(t),k=mf(i),w=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return x.jsx(x.Fragment,{children:h.map(S=>x.jsx(VS,{id:S,nodeColorFunc:y,nodeStrokeColorFunc:b,nodeClassNameFunc:k,nodeBorderRadius:s,nodeStrokeWidth:l,NodeComponent:c,onClick:d,shapeRendering:w},S))})}function HS({id:t,nodeColorFunc:r,nodeStrokeColorFunc:i,nodeClassNameFunc:s,nodeBorderRadius:l,nodeStrokeWidth:c,shapeRendering:d,NodeComponent:h,onClick:y}){const{node:b,x:k,y:w,width:S,height:C}=vt(j=>{const $=j.nodeLookup.get(t);if(!$)return{node:void 0,x:0,y:0,width:0,height:0};const T=$.internals.userNode,{x:I,y:U}=$.internals.positionAbsolute,{width:P,height:R}=Ao(T);return{node:T,x:I,y:U,width:P,height:R}},Ot);return!b||b.hidden||!lg(b)?null:x.jsx(h,{x:k,y:w,width:S,height:C,style:b.style,selected:!!b.selected,className:s(b),color:r(b),borderRadius:l,strokeColor:i(b),strokeWidth:c,shapeRendering:d,onClick:y,id:b.id})}const VS=Y.memo(HS);var US=Y.memo(BS);const KS=200,qS=150,WS=t=>!t.hidden,YS=t=>{const r={x:-t.transform[0]/t.transform[2],y:-t.transform[1]/t.transform[2],width:t.width/t.transform[2],height:t.height/t.transform[2]};return{viewBB:r,boundingRect:t.nodeLookup.size>0?ag(La(t.nodeLookup,{filter:WS}),r):r,rfId:t.rfId,panZoom:t.panZoom,translateExtent:t.translateExtent,flowWidth:t.width,flowHeight:t.height,ariaLabelConfig:t.ariaLabelConfig}},XS="react-flow__minimap-desc";function u0({style:t,className:r,nodeStrokeColor:i,nodeColor:s,nodeClassName:l="",nodeBorderRadius:c=5,nodeStrokeWidth:d,nodeComponent:h,bgColor:y,maskColor:b,maskStrokeColor:k,maskStrokeWidth:w,position:S="bottom-right",onClick:C,onNodeClick:j,pannable:$=!1,zoomable:T=!1,ariaLabel:I,inversePan:U,zoomStep:P=1,offsetScale:R=5}){const H=$t(),V=Y.useRef(null),{boundingRect:Q,viewBB:ce,rfId:de,panZoom:we,translateExtent:q,flowWidth:fe,flowHeight:xe,ariaLabelConfig:L}=vt(YS,Ot),le=(t==null?void 0:t.width)??KS,G=(t==null?void 0:t.height)??qS,ie=Q.width/le,F=Q.height/G,W=Math.max(ie,F),B=W*le,A=W*G,K=R*W,be=Q.x-(B-Q.width)/2-K,Se=Q.y-(A-Q.height)/2-K,Me=B+K*2,Ie=A+K*2,Ae=`${XS}-${de}`,_e=Y.useRef(0),ze=Y.useRef();_e.current=W,Y.useEffect(()=>{if(V.current&&we)return ze.current=cb({domNode:V.current,panZoom:we,getTransform:()=>H.getState().transform,getViewScale:()=>_e.current}),()=>{var Ue;(Ue=ze.current)==null||Ue.destroy()}},[we]),Y.useEffect(()=>{var Ue;(Ue=ze.current)==null||Ue.update({translateExtent:q,width:fe,height:xe,inversePan:U,pannable:$,zoomStep:P,zoomable:T})},[$,T,U,P,q,fe,xe]);const ke=C?Ue=>{var it;const[lt,ut]=((it=ze.current)==null?void 0:it.pointer(Ue))||[0,0];C(Ue,{x:lt,y:ut})}:void 0,Be=j?Y.useCallback((Ue,lt)=>{const ut=H.getState().nodeLookup.get(lt).internals.userNode;j(Ue,ut)},[]):void 0,Re=I??L["minimap.ariaLabel"];return x.jsx(Fa,{position:S,style:{...t,"--xy-minimap-background-color-props":typeof y=="string"?y:void 0,"--xy-minimap-mask-background-color-props":typeof b=="string"?b:void 0,"--xy-minimap-mask-stroke-color-props":typeof k=="string"?k:void 0,"--xy-minimap-mask-stroke-width-props":typeof w=="number"?w*W:void 0,"--xy-minimap-node-background-color-props":typeof s=="string"?s:void 0,"--xy-minimap-node-stroke-color-props":typeof i=="string"?i:void 0,"--xy-minimap-node-stroke-width-props":typeof d=="number"?d:void 0},className:Kt(["react-flow__minimap",r]),"data-testid":"rf__minimap",children:x.jsxs("svg",{width:le,height:G,viewBox:`${be} ${Se} ${Me} ${Ie}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":Ae,ref:V,onClick:ke,children:[Re&&x.jsx("title",{id:Ae,children:Re}),x.jsx(US,{onClick:Be,nodeColor:s,nodeStrokeColor:i,nodeBorderRadius:c,nodeClassName:l,nodeStrokeWidth:d,nodeComponent:h}),x.jsx("path",{className:"react-flow__minimap-mask",d:`M${be-K},${Se-K}h${Me+K*2}v${Ie+K*2}h${-Me-K*2}z
|
|
202
|
+
M${ce.x},${ce.y}h${ce.width}v${ce.height}h${-ce.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}u0.displayName="MiniMap";const QS=Y.memo(u0),GS=t=>r=>t?`${Math.max(1/r.transform[2],1)}`:void 0,JS={[Os.Line]:"right",[Os.Handle]:"bottom-right"};function ZS({nodeId:t,position:r,variant:i=Os.Handle,className:s,style:l=void 0,children:c,color:d,minWidth:h=10,minHeight:y=10,maxWidth:b=Number.MAX_VALUE,maxHeight:k=Number.MAX_VALUE,keepAspectRatio:w=!1,resizeDirection:S,autoScale:C=!0,shouldResize:j,onResizeStart:$,onResize:T,onResizeEnd:I}){const U=Bg(),P=typeof t=="string"?t:U,R=$t(),H=Y.useRef(null),V=i===Os.Handle,Q=vt(Y.useCallback(GS(V&&C),[V,C]),Ot),ce=Y.useRef(null),de=r??JS[i];Y.useEffect(()=>{if(!(!H.current||!P))return ce.current||(ce.current=kb({domNode:H.current,nodeId:P,getStoreItems:()=>{const{nodeLookup:q,transform:fe,snapGrid:xe,snapToGrid:L,nodeOrigin:le,domNode:G}=R.getState();return{nodeLookup:q,transform:fe,snapGrid:xe,snapToGrid:L,nodeOrigin:le,paneDomNode:G}},onChange:(q,fe)=>{const{triggerNodeChanges:xe,nodeLookup:L,parentLookup:le,nodeOrigin:G}=R.getState(),ie=[],F={x:q.x,y:q.y},W=L.get(P);if(W&&W.expandParent&&W.parentId){const B=W.origin??G,A=q.width??W.measured.width??0,K=q.height??W.measured.height??0,be={id:W.id,parentId:W.parentId,rect:{width:A,height:K,...ug({x:q.x??W.position.x,y:q.y??W.position.y},{width:A,height:K},W.parentId,L,B)}},Se=Jf([be],L,le,G);ie.push(...Se),F.x=q.x?Math.max(B[0]*A,q.x):void 0,F.y=q.y?Math.max(B[1]*K,q.y):void 0}if(F.x!==void 0&&F.y!==void 0){const B={id:P,type:"position",position:{...F}};ie.push(B)}if(q.width!==void 0&&q.height!==void 0){const A={id:P,type:"dimensions",resizing:!0,setAttributes:S?S==="horizontal"?"width":"height":!0,dimensions:{width:q.width,height:q.height}};ie.push(A)}for(const B of fe){const A={...B,type:"position"};ie.push(A)}xe(ie)},onEnd:({width:q,height:fe})=>{const xe={id:P,type:"dimensions",resizing:!1,dimensions:{width:q,height:fe}};R.getState().triggerNodeChanges([xe])}})),ce.current.update({controlPosition:de,boundaries:{minWidth:h,minHeight:y,maxWidth:b,maxHeight:k},keepAspectRatio:w,resizeDirection:S,onResizeStart:$,onResize:T,onResizeEnd:I,shouldResize:j}),()=>{var q;(q=ce.current)==null||q.destroy()}},[de,h,y,b,k,w,$,T,I,j]);const we=de.split("-");return x.jsx("div",{className:Kt(["react-flow__resize-control","nodrag",...we,i,s]),ref:H,style:{...l,scale:Q,...d&&{[V?"backgroundColor":"borderColor"]:d}},children:c})}Y.memo(ZS);const ek={get:"bg-emerald-500/20 text-emerald-200 border-emerald-500/45",post:"bg-sky-500/20 text-sky-200 border-sky-500/45",put:"bg-amber-500/20 text-amber-200 border-amber-500/45",patch:"bg-violet-500/20 text-violet-200 border-violet-500/45",delete:"bg-rose-500/20 text-rose-200 border-rose-500/45",head:"bg-slate-500/25 text-slate-300 border-slate-500/45",options:"bg-slate-500/25 text-slate-300 border-slate-500/45",trace:"bg-slate-500/25 text-slate-300 border-slate-500/45"};function su({method:t,className:r="",size:i="sm"}){const s=t.toLowerCase().trim(),l=ek[s]??"bg-accent/15 text-accent border-accent/40",c=i==="md"?"text-xs px-2.5 py-1 min-w-[3.25rem] justify-center":"text-[10px] px-1.5 py-0.5 min-w-[2.75rem] justify-center";return x.jsx("span",{className:`inline-flex items-center rounded-md font-semibold uppercase tracking-wide border shrink-0 transition-colors duration-200 ${l} ${c} ${r}`,children:t.toUpperCase()})}function td(t,r,i){var c,d;const s=r.toLowerCase(),l=(d=(c=t.paths)==null?void 0:c[i])==null?void 0:d[s];return(l==null?void 0:l.summary)??(l==null?void 0:l.operationId)??`${r.toUpperCase()} ${i}`}function nd(t,r,i){var h,y,b,k;const s=r.toLowerCase(),l=(y=(h=t.paths)==null?void 0:h[i])==null?void 0:y[s];if(!(l!=null&&l.requestBody))return"— sin body";const d=(k=(b=l.requestBody.content)==null?void 0:b["application/json"])==null?void 0:k.schema;return d&&"$ref"in d?`body: ${d.$ref}`:"body: JSON"}function rd(t,r,i){var h,y,b,k,w,S;const s=r.toLowerCase(),l=(y=(h=t.paths)==null?void 0:h[i])==null?void 0:y[s],c=((b=l==null?void 0:l.responses)==null?void 0:b["200"])??((k=l==null?void 0:l.responses)==null?void 0:k["201"]);if(!c)return"—";const d=typeof c=="object"&&c&&"content"in c?(S=(w=c.content)==null?void 0:w["application/json"])==null?void 0:S.schema:void 0;return d&&"$ref"in d?String(d.$ref):"JSON"}const au=()=>({sourceJsonPath:"$",variableName:"v",useInTarget:"vars_only",targetKey:""});function gf(t,r){return`${t.toLowerCase()} ${r}`}function tk(t){const r=t.indexOf(" ");return r===-1?{method:"get",path:"/"}:{method:t.slice(0,r),path:t.slice(r+1)}}const c0=Y.createContext(null);function nk(t){const{id:r,selected:i}=t,s=t.data,l=Y.useContext(c0),c=SS();return Y.useEffect(()=>{c(r)},[s.path,s.method,r,c]),x.jsxs("div",{className:`rounded-xl border bg-surface-950/90 px-3 py-2 min-w-[200px] max-w-[280px] shadow-lg ${i?"border-accent ring-2 ring-accent/40":"border-surface-600"}`,children:[x.jsx(Rs,{type:"target",position:Ze.Left,id:"in",className:"!h-3 !w-3 !border-2 !border-surface-900 !bg-teal-500"}),x.jsxs("div",{className:"flex items-center gap-2 mb-1 min-w-0",children:[x.jsx(su,{method:s.method}),x.jsx("span",{className:"text-[10px] text-slate-500 truncate",title:s.summary,children:s.summary})]}),l?x.jsxs("label",{className:"block text-[10px] text-slate-500 mb-1",children:["Endpoint",x.jsx("select",{className:"mt-0.5 w-full bg-surface-900 border border-surface-600 rounded px-1.5 py-1 text-[11px] font-mono",value:gf(s.method,s.path),onChange:d=>{const{method:h,path:y}=tk(d.target.value);l.updateNodeData(r,{method:h,path:y,summary:td(l.doc,h,y),reqHint:nd(l.doc,h,y),resHint:rd(l.doc,h,y)})},children:l.ops.map(d=>x.jsxs("option",{value:gf(d.method,d.path),children:[d.method.toUpperCase()," ",d.path]},gf(d.method,d.path)))})]}):x.jsx("p",{className:"font-mono text-[11px] text-slate-300 truncate",children:s.path}),x.jsxs("div",{className:"mt-2 grid grid-cols-2 gap-1 text-[9px] text-slate-500 leading-tight",children:[x.jsxs("div",{children:[x.jsx("span",{className:"text-slate-600",children:"req"})," ",s.reqHint]}),x.jsxs("div",{children:[x.jsx("span",{className:"text-slate-600",children:"res"})," ",s.resHint]})]}),x.jsx(Rs,{type:"source",position:Ze.Right,id:"out",className:"!h-3 !w-3 !border-2 !border-surface-900 !bg-amber-500"})]})}const rk={apiOp:nk};function ok(t,r){const i=r.nodes.map(l=>({id:l.id,type:"apiOp",position:{x:l.x,y:l.y},data:{method:l.method.toLowerCase(),path:l.path,summary:td(t,l.method,l.path),reqHint:nd(t,l.method,l.path),resHint:rd(t,l.method,l.path)}})),s=r.edges.map(l=>({id:l.id,source:l.source,target:l.target,sourceHandle:"out",targetHandle:"in",data:{mapping:{...l.mapping}},label:l.mapping.variableName,style:{stroke:"rgb(148 163 184 / 0.9)",strokeWidth:2}}));return{nodes:i,edges:s}}function ik(t,r){return{nodes:t.map(i=>({id:i.id,method:i.data.method,path:i.data.path,x:i.position.x,y:i.position.y})),edges:r.map(i=>{var s;return{id:i.id,source:i.source,target:i.target,mapping:((s=i.data)==null?void 0:s.mapping)??au()}})}}const sk=[{value:"vars_only",label:"Solo variable ({nombre} en la ruta)"},{value:"path_param",label:"Path param {clave}"},{value:"header",label:"Header"},{value:"query",label:"Query string"}];function ak({doc:t,ops:r,graph:i,onGraphChange:s}){var P,R,H,V,Q,ce,de,we;const l=Y.useMemo(()=>ok(t,i),[t,i]),[c,d,h]=kS(l.nodes),[y,b,k]=NS(l.edges),[w,S]=Y.useState(null);Y.useEffect(()=>{s(ik(c,y))},[c,y,s]);const C=Y.useCallback((q,fe)=>{d(xe=>xe.map(L=>L.id===q?{...L,data:{...L.data,...fe}}:L))},[d]),j=Y.useMemo(()=>({doc:t,ops:r,updateNodeData:C}),[t,r,C]),$=Y.useCallback(q=>{q.sourceHandle!=="out"||q.targetHandle!=="in"||b(fe=>gg({...q,id:`e-${q.source}-${q.target}-${crypto.randomUUID().slice(0,8)}`,sourceHandle:"out",targetHandle:"in",data:{mapping:au()},label:au().variableName,style:{stroke:"rgb(148 163 184 / 0.9)",strokeWidth:2}},fe))},[b]),T=y.find(q=>q.id===w),I=q=>{w&&b(fe=>fe.map(xe=>{var le;if(xe.id!==w)return xe;const L={...((le=xe.data)==null?void 0:le.mapping)??au(),...q};return{...xe,data:{mapping:L},label:L.variableName}}))},U=()=>{const q=c.reduce((ie,F)=>F.position.x>ie?F.position.x:ie,0),fe=r[0];if(!fe)return;const xe=crypto.randomUUID(),L=q>0?q+40:80,G={id:xe,type:"apiOp",position:{x:L,y:120},data:{method:fe.method.toLowerCase(),path:fe.path,summary:td(t,fe.method,fe.path),reqHint:nd(t,fe.method,fe.path),resHint:rd(t,fe.method,fe.path)}};d(ie=>[...ie,G])};return x.jsx(c0.Provider,{value:j,children:x.jsxs("div",{className:"space-y-3",children:[x.jsx("div",{className:"h-[min(520px,70vh)] w-full rounded-xl border border-surface-700 bg-surface-950",children:x.jsxs(_S,{nodes:c,edges:y,onNodesChange:h,onEdgesChange:k,onConnect:$,nodeTypes:rk,onEdgeClick:(q,fe)=>S(fe.id),onPaneClick:()=>S(null),fitView:!0,minZoom:.4,maxZoom:1.5,proOptions:{hideAttribution:!0},isValidConnection:q=>q.sourceHandle==="out"&&q.targetHandle==="in",children:[x.jsx(MS,{variant:To.Dots,gap:16,size:1,color:"rgb(51 65 85 / 0.5)"}),x.jsx(LS,{className:"!bg-surface-900 !border-surface-600 !shadow-lg"}),x.jsx(QS,{className:"!bg-surface-900/95 !border-surface-600",nodeColor:()=>"rgb(45 212 191 / 0.5)"}),x.jsx(Fa,{position:"top-left",children:x.jsx("button",{type:"button",onClick:U,className:"text-xs px-3 py-2 rounded-lg bg-accent/90 text-surface-950 font-medium shadow",children:"+ Nodo (endpoint)"})})]})}),x.jsxs("div",{className:"rounded-xl border border-surface-700 bg-surface-900/50 p-4 space-y-3",children:[x.jsx("h4",{className:"text-xs font-semibold text-slate-300",children:"Cable seleccionado (respuesta → request)"}),T?x.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3 text-xs",children:[x.jsxs("label",{className:"text-slate-500",children:["JSON path en la respuesta",x.jsx("input",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-2 py-1.5 font-mono",value:((P=T.data)==null?void 0:P.mapping.sourceJsonPath)??"$",onChange:q=>I({sourceJsonPath:q.target.value}),placeholder:"$.access_token"})]}),x.jsxs("label",{className:"text-slate-500",children:["Nombre de variable",x.jsx("input",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-2 py-1.5",value:((R=T.data)==null?void 0:R.mapping.variableName)??"",onChange:q=>I({variableName:q.target.value}),placeholder:"token"})]}),x.jsxs("label",{className:"text-slate-500 sm:col-span-2",children:["Cómo se usa en el request del nodo destino",x.jsx("select",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-2 py-1.5",value:((H=T.data)==null?void 0:H.mapping.useInTarget)??"vars_only",onChange:q=>I({useInTarget:q.target.value}),children:sk.map(q=>x.jsx("option",{value:q.value,children:q.label},q.value))})]}),(((V=T.data)==null?void 0:V.mapping.useInTarget)==="path_param"||((Q=T.data)==null?void 0:Q.mapping.useInTarget)==="header"||((ce=T.data)==null?void 0:ce.mapping.useInTarget)==="query")&&x.jsxs("label",{className:"text-slate-500 sm:col-span-2",children:["Clave (nombre del param / header / query)",x.jsx("input",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-2 py-1.5 font-mono",value:((de=T.data)==null?void 0:de.mapping.targetKey)??"",onChange:q=>I({targetKey:q.target.value}),placeholder:"id / Authorization / q"})]}),x.jsxs("p",{className:"sm:col-span-2 text-[11px] text-slate-500 leading-relaxed",children:["El valor extraído se guarda en la variable y, según la opción, se inyecta en la ruta"," ",x.jsx("code",{className:"text-accent",children:"{clave}"}),", en un header, o en query. Con «solo variable», usa"," ",x.jsx("code",{className:"text-accent",children:"{"+(((we=T.data)==null?void 0:we.mapping.variableName)||"var")+"}"})," ","en la ruta del endpoint destino."]})]}):x.jsx("p",{className:"text-xs text-slate-500",children:"Conecta la salida derecha (res) de un nodo con la entrada izquierda (req) de otro. Haz clic en un cable para definir el mapeo."})]})]})})}function f0(t,r){const i=new Map(t.map(y=>[y.id,y])),s=new Set(t.map(y=>y.id)),l=new Map,c=new Map;for(const y of s)l.set(y,0),c.set(y,[]);for(const y of r)!s.has(y.source)||!s.has(y.target)||(l.set(y.target,(l.get(y.target)??0)+1),c.get(y.source).push(y.target));const d=[];for(const[y,b]of l)b===0&&d.push(y);d.sort((y,b)=>i.get(y).x-i.get(b).x||i.get(y).y-i.get(b).y);const h=[];for(;d.length;){const y=d.shift();h.push(y);for(const b of c.get(y)??[]){const k=(l.get(b)??0)-1;l.set(b,k),k===0&&(d.push(b),d.sort((w,S)=>i.get(w).x-i.get(S).x||i.get(w).y-i.get(S).y))}}if(h.length<t.length){const y=t.filter(b=>!h.includes(b.id)).sort((b,k)=>b.x-k.x||b.y-k.y);return[...h.map(b=>i.get(b)),...y]}return h.map(y=>i.get(y))}async function um(t,r,i){var y;const{nodes:s,edges:l}=t;if(s.length===0)return"Sin nodos en el flujo.";const c=f0(s,l),d={};let h="";for(let b=0;b<c.length;b++){const k=c[b];let w=k.path;const S={...i()},C=l.filter(H=>H.target===k.id);for(const H of C){const{mapping:V}=H,Q=d[V.variableName];if(Q!==void 0)switch(V.useInTarget){case"path_param":V.targetKey&&(w=w.split(`{${V.targetKey}}`).join(Q));break;case"header":if(V.targetKey){const ce=V.targetKey;S[ce]=ce.toLowerCase()==="authorization"&&!Q.startsWith("Bearer ")?`Bearer ${Q}`:Q}break;case"query":{const ce=w.includes("?")?"&":"?";w=`${w}${ce}${encodeURIComponent(V.targetKey)}=${encodeURIComponent(Q)}`;break}case"vars_only":default:w=w.split(`{${V.variableName}}`).join(Q);break}}for(const[H,V]of Object.entries(d))w=w.split(`{${H}}`).join(V);const j=`${r.replace(/\/$/,"")}${w}`,$={method:k.method.toUpperCase(),headers:S},T=k.method.toLowerCase();T!=="get"&&T!=="head"&&($.body="{}");const I=await fetch(j,{...$,credentials:"include"});let U={};const P=await I.text();try{U=P?JSON.parse(P):{}}catch{U={_raw:P}}h+=`▸ ${k.method.toUpperCase()} ${k.path} → ${I.status}
|
|
203
|
+
${JSON.stringify(U,null,2)}
|
|
204
|
+
|
|
205
|
+
`;const R=l.filter(H=>H.source===k.id);for(const H of R){const V=((y=H.mapping.sourceJsonPath)==null?void 0:y.trim())||"$",Q=Rf(U,V);Q!=null&&(d[H.mapping.variableName]=typeof Q=="object"?JSON.stringify(Q):String(Q))}}return h+=`
|
|
206
|
+
Variables finales: ${JSON.stringify(d,null,2)}`,h}function lk(t){const r=f0(t.nodes,t.edges);return r.map((i,s)=>{const l=r[s+1];if(!l)return{method:i.method,path:i.path};const c=t.edges.find(d=>d.source===i.id&&d.target===l.id);return c?{method:i.method,path:i.path,extract:{varName:c.mapping.variableName,jsonPath:c.mapping.sourceJsonPath||"$"}}:{method:i.method,path:i.path}})}function uk(t){var s;const r=t.map((l,c)=>({id:`n-${c}`,method:l.method,path:l.path,x:40+c*300,y:120})),i=[];for(let l=0;l<t.length-1;l++){const c=(s=t[l])==null?void 0:s.extract;c!=null&&c.jsonPath&&i.push({id:`e-${l}`,source:`n-${l}`,target:`n-${l+1}`,mapping:{sourceJsonPath:c.jsonPath,variableName:c.varName,useInTarget:"vars_only",targetKey:""}})}return{nodes:r,edges:i}}const d0=Y.createContext({productName:null,logoDataUrl:null});function ck({value:t,children:r}){return x.jsx(d0.Provider,{value:t,children:r})}function fk(){return Y.useContext(d0)}function dk({data:t,defaultOpenDepth:r=3}){return x.jsx("div",{className:"json-tree text-[11px] font-mono leading-relaxed text-left overflow-auto max-h-80 rounded-lg border border-surface-700 bg-surface-950/80 p-2",children:x.jsx(od,{value:t,depth:0,defaultOpenDepth:r})})}function od({value:t,depth:r,defaultOpenDepth:i,name:s}){return t===null||typeof t!="object"?x.jsx(pk,{name:s,value:t}):Array.isArray(t)?x.jsx(hk,{name:s,value:t,depth:r,defaultOpenDepth:i}):x.jsx(mk,{name:s,value:t,depth:r,defaultOpenDepth:i})}function pk({name:t,value:r}){return x.jsxs("div",{className:"pl-1 break-all",children:[t!=null&&x.jsxs(x.Fragment,{children:[x.jsx("span",{className:"text-sky-300/95",children:JSON.stringify(t)}),x.jsx("span",{className:"text-slate-500",children:": "})]}),x.jsx("span",{className:"text-emerald-200/95",children:JSON.stringify(r)})]})}function hk({name:t,value:r,depth:i,defaultOpenDepth:s}){const l=i<s,[c,d]=Y.useState(l);return r.length===0?x.jsxs("div",{className:"pl-1",children:[t!=null&&x.jsxs(x.Fragment,{children:[x.jsx("span",{className:"text-sky-300/95",children:JSON.stringify(t)}),x.jsx("span",{className:"text-slate-500",children:": "})]}),x.jsx("span",{className:"text-slate-500",children:"[]"})]}):x.jsxs("div",{className:"pl-1",children:[t!=null&&x.jsxs(x.Fragment,{children:[x.jsx("span",{className:"text-sky-300/95",children:JSON.stringify(t)}),x.jsx("span",{className:"text-slate-500",children:": "})]}),x.jsx("button",{type:"button","aria-expanded":c,onClick:()=>d(!c),className:"inline align-middle text-slate-400 hover:text-slate-200 mr-1 select-none w-4",children:c?"▼":"▶"}),x.jsx("span",{className:"text-slate-500",children:"["}),x.jsx("span",{className:"text-slate-600 text-[10px] ml-1",children:r.length}),c&&x.jsx("ul",{className:"list-none my-0.5 ml-4 border-l border-surface-600 pl-2 space-y-0.5",children:r.map((h,y)=>x.jsxs("li",{children:[x.jsx("span",{className:"text-violet-400/90 mr-1",children:y}),x.jsx(od,{value:h,depth:i+1,defaultOpenDepth:s})]},y))}),!c&&x.jsx("span",{className:"text-slate-600",children:" … "}),x.jsx("span",{className:"text-slate-500",children:"]"})]})}function mk({name:t,value:r,depth:i,defaultOpenDepth:s}){const l=Object.keys(r),c=i<s,[d,h]=Y.useState(c);return l.length===0?x.jsxs("div",{className:"pl-1",children:[t!=null&&x.jsxs(x.Fragment,{children:[x.jsx("span",{className:"text-sky-300/95",children:JSON.stringify(t)}),x.jsx("span",{className:"text-slate-500",children:": "})]}),x.jsx("span",{className:"text-slate-500",children:"{}"})]}):x.jsxs("div",{className:"pl-1",children:[t!=null&&x.jsxs(x.Fragment,{children:[x.jsx("span",{className:"text-sky-300/95",children:JSON.stringify(t)}),x.jsx("span",{className:"text-slate-500",children:": "})]}),x.jsx("button",{type:"button","aria-expanded":d,onClick:()=>h(!d),className:"inline align-middle text-slate-400 hover:text-slate-200 mr-1 select-none w-4",children:d?"▼":"▶"}),x.jsx("span",{className:"text-slate-500",children:"{"}),x.jsx("span",{className:"text-slate-600 text-[10px] ml-1",children:l.length}),d&&x.jsx("ul",{className:"list-none my-0.5 ml-4 border-l border-surface-600 pl-2 space-y-0.5",children:l.map(y=>x.jsx("li",{children:x.jsx(od,{name:y,value:r[y],depth:i+1,defaultOpenDepth:s})},y))}),!d&&x.jsx("span",{className:"text-slate-600",children:" … "}),x.jsx("span",{className:"text-slate-500",children:"}"})]})}function id(t,r){if(!r.startsWith("#/"))return;const i=r.slice(2).split("/");let s=t;for(const l of i)if(s&&typeof s=="object"&&l in s)s=s[l];else return;return s}function gk(t,r){return"$ref"in r?id(t,r.$ref):r}function cm(t,r){return"$ref"in r?id(t,r.$ref):r}function yk(t,r,i){var b;const s=(b=t.paths)==null?void 0:b[i],l=s==null?void 0:s[r.toLowerCase()];if(!l)return[];const c=(s==null?void 0:s.parameters)??[],d=l.parameters??[],h=new Set,y=[];for(const k of[...c,...d]){const w=gk(t,k);if(!w||!["query","path","header","cookie"].includes(w.in))continue;const S=`${w.in}:${w.name}`;h.has(S)||(h.add(S),y.push({name:w.name,in:w.in,required:!!w.required,description:typeof w.description=="string"?w.description:void 0}))}return y}function fm(t,r,i){var y,b,k,w;const s=(b=(y=t.paths)==null?void 0:y[i])==null?void 0:b[r.toLowerCase()];if(!(s!=null&&s.requestBody))return null;const l=s.requestBody,c="$ref"in l?id(t,l.$ref):l;if(!((w=(k=c==null?void 0:c.content)==null?void 0:k["application/json"])!=null&&w.schema))return null;const d=c.content["application/json"].schema,h=cm(t,d);if(!h)return null;if(h.type==="object"&&h.properties&&Object.keys(h.properties).length>0){const S=new Set(h.required??[]);return Object.keys(h.properties).map(C=>{const j=h.properties[C],$=j&&"$ref"in j?cm(t,j):j;return{key:C,required:S.has(C),description:$==null?void 0:$.description,format:$==null?void 0:$.format,type:$==null?void 0:$.type}})}return null}function vk(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function xk(t,r){let i=t;for(const[s,l]of Object.entries(r))i=i.replace(new RegExp(`\\{${vk(s)}\\}`,"g"),encodeURIComponent(l));return i}function wk(t,r){const i=new URLSearchParams;for(const l of r){if(l.in!=="query")continue;const c=t[l.name];c!==void 0&&c!==""&&i.set(l.name,c)}const s=i.toString();return s?`?${s}`:""}function p0(t,r){var s;if(!(t!=null&&t.length))return{};const i={};for(const l of t){const c=((s=r[l.key])==null?void 0:s.trim())??"";if(c==="")continue;const d=l.type;if(d==="integer"||d==="number"){const h=Number(c);i[l.key]=Number.isFinite(h)?h:c}else if(d==="boolean")i[l.key]=c==="true"||c==="1";else try{i[l.key]=JSON.parse(c)}catch{i[l.key]=c}}return i}function dm(t,r){const i=p0(t,r);return JSON.stringify(i,null,2)}function bk(t,r){if(!(t!=null&&t.length))return{};try{const i=JSON.parse(r||"{}"),s={};for(const l of t)if(l.key in i&&i[l.key]!==void 0){const c=i[l.key];s[l.key]=typeof c=="string"?c:JSON.stringify(c)}else s[l.key]="";return s}catch{return Object.fromEntries(t.map(i=>[i.key,""]))}}function _k(t){return/\{[^/}]+\}/.test(t)}function Sk(t,r,i,s,l){var h,y;const c={...t};for(const b of r){const k=(h=i[b.name])==null?void 0:h.trim();k&&(c[b.name]=k)}const d=[];for(const b of s){const k=(y=l[b.name])==null?void 0:y.trim();k&&d.push(`${b.name}=${k}`)}return d.length&&(c.Cookie=c.Cookie?`${c.Cookie}; ${d.join("; ")}`:d.join("; ")),c}function kk({doc:t,selectedOp:r,baseUrl:i,buildHeaders:s}){const[l,c]=Y.useState({}),[d,h]=Y.useState({}),[y,b]=Y.useState({}),[k,w]=Y.useState({}),[S,C]=Y.useState({}),[j,$]=Y.useState("{}"),[T,I]=Y.useState("raw"),[U,P]=Y.useState(null),[R,H]=Y.useState(null),V=Y.useMemo(()=>yk(t,r.method,r.path),[t,r.method,r.path]),Q=Y.useMemo(()=>V.filter(B=>B.in==="path"),[V]),ce=Y.useMemo(()=>V.filter(B=>B.in==="query"),[V]),de=Y.useMemo(()=>V.filter(B=>B.in==="header"),[V]),we=Y.useMemo(()=>V.filter(B=>B.in==="cookie"),[V]),q=Y.useMemo(()=>fm(t,r.method,r.path),[t,r.method,r.path]),fe=r.method.toLowerCase(),xe=fe!=="get"&&fe!=="head";Y.useEffect(()=>{c({}),h({}),b({}),w({}),H(null),P(null);const B=fm(t,r.method,r.path);B!=null&&B.length?(C(Object.fromEntries(B.map(A=>[A.key,""]))),I("fields"),$(dm(B,{}))):(C({}),I("raw"),$("{}"))},[t,r.method,r.path]);const L=Y.useCallback((B,A)=>{C(K=>({...K,[B]:A}))},[]),le=Y.useCallback(()=>{q!=null&&q.length&&$(dm(q,S)),I("raw")},[q,S]),G=Y.useCallback(()=>{q!=null&&q.length&&C(bk(q,j)),I("fields")},[q,j]),ie=async()=>{var Ie,Ae,_e,ze,ke;H(null);const B=ks(t,i);for(const Be of Q)if(Be.required&&!((Ie=l[Be.name])!=null&&Ie.trim())){H(`Parámetro de ruta obligatorio: ${Be.name}`);return}for(const Be of ce)if(Be.required&&!((Ae=d[Be.name])!=null&&Ae.trim())){H(`Query obligatorio: ${Be.name}`);return}for(const Be of de)if(Be.required&&!((_e=y[Be.name])!=null&&_e.trim())){H(`Header obligatorio: ${Be.name}`);return}for(const Be of we)if(Be.required&&!((ze=k[Be.name])!=null&&ze.trim())){H(`Cookie obligatorio: ${Be.name}`);return}let A=xk(r.path,l);if(_k(A)){H("Quedan placeholders `{…}` en la ruta sin valor.");return}const K=wk(d,V),be=`${B}${A}${K}`,Se=Sk(s(),de,y,we,k),Me={method:r.method.toUpperCase(),headers:Se,credentials:"include"};if(xe)if(T==="fields"&&(q!=null&&q.length)){for(const Re of q)if(Re.required&&!((ke=S[Re.key])!=null&&ke.trim())){H(`Campo de body obligatorio: ${Re.key}`);return}const Be=p0(q,S);Me.body=JSON.stringify(Be)}else{const Be=j.trim()||"{}";Me.body=Be}try{const Be=await fetch(be,Me),Re=await Be.text();let Ue=null;try{Ue=Re?JSON.parse(Re):null}catch{Ue=null}P({status:Be.status,statusText:Be.statusText,bodyText:Re,json:Ue})}catch(Be){P(null),H(Be instanceof Error?Be.message:String(Be))}},F=(B,A,K)=>x.jsxs("label",{className:"block text-xs",children:[x.jsxs("span",{className:"text-slate-400",children:[B.name,B.required?x.jsx("span",{className:"text-rose-400/90",children:" *"}):null,B.in!=="path"?x.jsxs("span",{className:"text-slate-600 ml-1",children:["(",B.in,")"]}):null]}),x.jsx("input",{type:"text",className:"glass-input mt-0.5 w-full min-h-[44px] sm:min-h-0 border rounded-xl px-3 py-2 font-mono text-[11px] text-slate-200 transition-colors duration-150 hover:border-accent/25",value:A[B.name]??"",onChange:be=>K(Se=>({...Se,[B.name]:be.target.value})),placeholder:B.description||(B.in==="path"?`{${B.name}}`:""),autoComplete:"off"})]},`${B.in}:${B.name}`),W=B=>x.jsxs("label",{className:"block text-xs",children:[x.jsxs("span",{className:"text-slate-400",children:[B.key,B.required?x.jsx("span",{className:"text-rose-400/90",children:" *"}):null,B.type?x.jsxs("span",{className:"text-slate-600 ml-1",children:["(",B.type,")"]}):null]}),x.jsx("input",{type:"text",className:"glass-input mt-0.5 w-full min-h-[44px] sm:min-h-0 border rounded-xl px-3 py-2 font-mono text-[11px] text-slate-200 transition-colors duration-150 hover:border-accent/25",value:S[B.key]??"",onChange:A=>L(B.key,A.target.value),placeholder:B.description||"valor o JSON para objetos anidados",autoComplete:"off"})]},B.key);return x.jsxs("section",{className:"space-y-4 glass-card p-4",children:[x.jsx("h3",{className:"text-sm font-semibold tracking-tight text-slate-200",children:"Probar"}),(Q.length>0||ce.length>0||de.length>0||we.length>0)&&x.jsxs("div",{className:"space-y-2 rounded-xl border border-white/[0.07] bg-surface-950/35 backdrop-blur-sm p-3",children:[x.jsx("p",{className:"text-[10px] uppercase tracking-wide text-slate-500",children:"Parámetros"}),x.jsxs("div",{className:"grid gap-2 sm:grid-cols-2",children:[Q.map(B=>F(B,l,c)),ce.map(B=>F(B,d,h)),de.map(B=>F(B,y,b)),we.map(B=>F(B,k,w))]})]}),xe&&x.jsxs("div",{className:"space-y-2",children:[x.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[x.jsx("span",{className:"text-xs text-slate-400",children:"Body"}),q!=null&&q.length?x.jsxs("div",{className:"flex rounded-lg border border-surface-600 overflow-hidden text-xs shadow-inner shadow-black/20",role:"group","aria-label":"Modo de body",children:[x.jsx("button",{type:"button",className:`min-h-[40px] px-3 py-2 transition-colors duration-200 sm:min-h-0 sm:py-1.5 ${T==="fields"?"bg-accent/25 text-accent font-medium":"bg-surface-800 text-slate-400 hover:text-slate-200"}`,onClick:G,children:"Campos"}),x.jsx("button",{type:"button",className:`min-h-[40px] px-3 py-2 transition-colors duration-200 sm:min-h-0 sm:py-1.5 border-l border-surface-600/80 ${T==="raw"?"bg-accent/25 text-accent font-medium":"bg-surface-800 text-slate-400 hover:text-slate-200"}`,onClick:le,children:"JSON raw"})]}):x.jsx("span",{className:"text-[10px] text-slate-500",children:"(solo JSON — sin propiedades `object` en el spec)"})]}),T==="fields"&&(q!=null&&q.length)?x.jsx("div",{className:"grid gap-2 sm:grid-cols-2 rounded-xl border border-white/[0.07] bg-surface-950/35 backdrop-blur-sm p-3",children:q.map(B=>W(B))}):x.jsx("textarea",{className:"glass-input w-full h-28 min-h-[7rem] border rounded-xl p-3 font-mono text-xs text-slate-200 leading-relaxed transition-colors duration-150 hover:border-accent/25",value:j,onChange:B=>$(B.target.value),placeholder:'{"key": "value"}',spellCheck:!1})]}),R&&x.jsx("p",{role:"alert",className:"text-xs text-rose-200 bg-rose-950/40 border border-rose-700/50 rounded-lg px-3 py-2 leading-relaxed",children:R}),x.jsx("button",{type:"button",onClick:()=>void ie(),className:"min-h-[48px] sm:min-h-0 px-6 py-3 sm:px-5 sm:py-2.5 rounded-xl bg-accent text-surface-950 font-semibold text-sm shadow-lg shadow-accent/15 transition-[transform,filter] duration-200 hover:brightness-110 active:scale-[0.98] motion-reduce:active:scale-100 cursor-pointer",children:"Ejecutar"}),x.jsxs("div",{className:"space-y-2",children:[x.jsx("p",{className:"text-[10px] uppercase tracking-wide text-slate-500",children:"Respuesta"}),U?x.jsxs(x.Fragment,{children:[x.jsxs("div",{className:"text-xs font-mono text-slate-300 bg-surface-900/80 border border-surface-700 rounded-lg px-3 py-2",children:[x.jsx("span",{className:U.status>=200&&U.status<300?"text-emerald-400":U.status>=400?"text-rose-400":"text-amber-300",children:U.status})," ",U.statusText]}),U.json!==null?x.jsx(dk,{data:U.json,defaultOpenDepth:3}):x.jsx("pre",{className:"text-xs glass-input border rounded-xl p-3 overflow-auto max-h-64 text-emerald-300/90 whitespace-pre-wrap font-mono",children:U.bodyText||"—"})]}):x.jsx("p",{className:"text-xs text-slate-500",children:"—"})]})]})}function Nk(t){const r=t.toLowerCase().trim();return`border-l-[3px] ${r==="get"?"border-l-emerald-400":r==="post"?"border-l-sky-400":r==="put"?"border-l-amber-400":r==="patch"?"border-l-violet-400":r==="delete"?"border-l-rose-400":r==="head"||r==="options"||r==="trace"?"border-l-slate-400":"border-l-cyan-400/80"}`}function Ek(t){return x.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t.className,"aria-hidden":!0,children:[x.jsx("circle",{cx:"11",cy:"11",r:"8"}),x.jsx("path",{d:"m21 21-4.3-4.3"})]})}function Ck(t){return x.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t.className,"aria-hidden":!0,children:[x.jsx("circle",{cx:"18",cy:"5",r:"3"}),x.jsx("circle",{cx:"6",cy:"12",r:"3"}),x.jsx("circle",{cx:"18",cy:"19",r:"3"}),x.jsx("path",{d:"m8.59 13.51 6.83 3.98"}),x.jsx("path",{d:"m15.41 6.51-6.82 3.98"})]})}function jk(t){return x.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t.className,"aria-hidden":!0,children:[x.jsx("path",{d:"M9 11l3 3L22 4"}),x.jsx("path",{d:"M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11"})]})}function h0(t){return x.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t.className,"aria-hidden":!0,children:[x.jsx("path",{d:"M12 8V4H8"}),x.jsx("rect",{width:"16",height:"12",x:"4",y:"8",rx:"2"}),x.jsx("path",{d:"M2 14h2"}),x.jsx("path",{d:"M20 14h2"}),x.jsx("path",{d:"M15 13v2"}),x.jsx("path",{d:"M9 13v2"})]})}function Pk(t){return x.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t.className,"aria-hidden":!0,children:[x.jsx("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),x.jsx("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]})}function Mk(t){return x.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t.className,"aria-hidden":!0,children:[x.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),x.jsx("polyline",{points:"7 10 12 15 17 10"}),x.jsx("line",{x1:"12",y1:"15",x2:"12",y2:"3"})]})}function $k(t){return x.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t.className,"aria-hidden":!0,children:[x.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),x.jsx("polyline",{points:"17 8 12 3 7 8"}),x.jsx("line",{x1:"12",y1:"3",x2:"12",y2:"15"})]})}function Tk(t){return x.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t.className,"aria-hidden":!0,children:[x.jsx("path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"}),x.jsx("polyline",{points:"16 17 21 12 16 7"}),x.jsx("line",{x1:"21",y1:"12",x2:"9",y2:"12"})]})}function pm(t){return x.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t.className,"aria-hidden":!0,children:[x.jsx("path",{d:"M15 3h6v6"}),x.jsx("path",{d:"M9 21H3v-6"}),x.jsx("path",{d:"M21 3l-7 7"}),x.jsx("path",{d:"M3 21l7-7"})]})}const Ik=["get","post","put","patch","delete","options","head","trace"];function m0(t,r){const i=t.trim().replace(/\s+/g," ");return i.length<=r?i:`${i.slice(0,r-1)}…`}function Ak(t,r,i,s,l){const c=[`${t.toUpperCase()} ${r}`];return i&&c.push(`— ${m0(i,140)}`),s!=null&&s.length&&c.push(`[tags: ${s.join(", ")}]`),l&&c.push(`(operationId: ${l})`),c.join(" ")}function Ok(t,r){const i=[];let s=0;const l=t.paths;if(!l)return{lines:i,total:0};for(const[c,d]of Object.entries(l)){if(!d||typeof d!="object"||"$ref"in d)continue;const h=d;for(const y of Ik){const b=h[y];if(!(!b||typeof b!="object")&&(s+=1,i.length<r)){const k=b.summary||(b.description?m0(b.description,200):void 0);i.push(Ak(y,c,k,b.tags,b.operationId))}}}return{lines:i,total:s}}function Rk(t){var i,s,l,c,d,h,y;const r=[`Flujo «${t.name}»`];if((i=t.steps)!=null&&i.length){const b=t.steps.map(w=>`${w.method.toUpperCase()} ${w.path}`).join(" → ");r.push(`secuencia (pasos): ${b}`);const k=t.steps.filter(w=>w.extract).map(w=>`${w.extract.varName} ← ${w.extract.jsonPath}`);k.length&&r.push(`extracciones: ${k.join("; ")}`)}if((l=(s=t.graph)==null?void 0:s.nodes)!=null&&l.length){const b=t.graph.nodes.map(k=>`${k.method.toUpperCase()} ${k.path}`).join(" → ");r.push(`grafo (nodos en orden guardado): ${b}`),(c=t.graph.edges)!=null&&c.length&&r.push(`cables: ${t.graph.edges.length} (mapeo respuesta → siguiente request; detalle en la UI Flujos)`)}return!((d=t.steps)!=null&&d.length)&&!((y=(h=t.graph)==null?void 0:h.nodes)!=null&&y.length)&&r.push("(sin pasos ni nodos)"),r.join(". ")}function Lk(t){var i;if(!((i=t.cases)!=null&&i.length))return`Suite «${t.name}»: sin casos`;const r=t.cases.map(s=>`${s.method.toUpperCase()} ${s.path} → esperado HTTP ${s.expectStatus}`).join("; ");return`Suite «${t.name}» (${t.cases.length} caso(s)): ${r}`}function Dk(t,r){var T,I,U,P;const i=t.info.title??"API",s=t.info.version??"",l=`Documentación OpenAPI «${i}»${s?` v${s}`:""}.`,c=((T=t.servers)==null?void 0:T.map(R=>`${R.url}${R.description?` (${R.description})`:""}`).join(`
|
|
207
|
+
`))||"(sin servers en el spec; usa la Base URL de la barra superior en la UI)",d=(I=t.components)!=null&&I.securitySchemes?Object.entries(t.components.securitySchemes).map(([R,H])=>{if(!H||typeof H!="object"||"$ref"in H)return`${R}: ref`;const V=H.type??"?";return`${R} (${V})`}).join("; "):"",{lines:h,total:y}=Ok(t,400),b=y>h.length?`
|
|
208
|
+
… y ${y-h.length} operación(es) más en el spec.`:"";let k="";const w=((U=r==null?void 0:r.savedFlows)==null?void 0:U.filter(R=>R.name))??[];w.length&&(k=`
|
|
209
|
+
|
|
210
|
+
--- Flujos guardados por el usuario en esta app (${w.length}) ---
|
|
211
|
+
${w.map(Rk).join(`
|
|
212
|
+
`)}`);let S="";const C=((P=r==null?void 0:r.testSuites)==null?void 0:P.filter(R=>R.name))??[];C.length&&(S=`
|
|
213
|
+
|
|
214
|
+
--- Suites de tests guardadas (${C.length}) ---
|
|
215
|
+
${C.map(Lk).join(`
|
|
216
|
+
`)}`);let j="";const $=r==null?void 0:r.selectedOperation;return $!=null&&$.path&&(j=`
|
|
217
|
+
|
|
218
|
+
--- Operación enfocada en la UI (Explorar) ---
|
|
219
|
+
${$.method.toUpperCase()} ${$.path}
|
|
220
|
+
(Prioriza explicar esta ruta si el usuario pregunta en genérico «este endpoint».)`),`${l}
|
|
221
|
+
|
|
222
|
+
--- Servidores (servers) ---
|
|
223
|
+
${c}
|
|
224
|
+
|
|
225
|
+
--- Seguridad (components.securitySchemes) ---
|
|
226
|
+
${d||"(ninguno declarado o solo referencias)"}
|
|
227
|
+
|
|
228
|
+
--- Catálogo de endpoints (método, ruta, resumen/tags) ---
|
|
229
|
+
Total de operaciones en el spec: ${y}.
|
|
230
|
+
${h.join(`
|
|
231
|
+
`)}${b}
|
|
232
|
+
${k}
|
|
233
|
+
${S}${j}
|
|
234
|
+
|
|
235
|
+
Instrucciones:
|
|
236
|
+
- Responde en el idioma del usuario. Sé preciso: cita método y ruta cuando hables de un endpoint.
|
|
237
|
+
- Puedes explicar cómo encadenar llamadas (flujos), qué variables extraer entre pasos, y cómo se relacionan con los tests guardados.
|
|
238
|
+
- Para probar requests reales, el usuario debe usar la pestaña Explorar (o Flujos/Tests); tú no ejecutas HTTP.
|
|
239
|
+
- Si falta detalle en este resumen, indica que puede ver el cuerpo completo de la operación en la UI (Explorar) o en el JSON OpenAPI.`}async function zk(t,r,i,s,l){const c=`${t.replace(/\/?$/,"/")}__chat`,d=await fetch(c,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json",[by]:r},body:JSON.stringify({provider:i,model:s,messages:l})}),h=await d.text();if(!d.ok){let y=h;try{const b=JSON.parse(h);y=b.message??b.error??h}catch{}throw new Error(y||`HTTP ${d.status}`)}return JSON.parse(h)}function Fk({doc:t,contextExtras:r,provider:i,model:s,apiKey:l,onOpenLlmSettings:c}){const d="/docs/",[h,y]=Y.useState(!1),[b,k]=Y.useState([]),[w,S]=Y.useState(""),[C,j]=Y.useState(!1),[$,T]=Y.useState(null),I=Y.useRef(null),U=Y.useMemo(()=>Dk(t,r),[t,r]);Y.useEffect(()=>{var H;(H=I.current)==null||H.scrollIntoView({behavior:"smooth"})},[b]);const P=Y.useCallback(async()=>{const H=w.trim();if(!H||C)return;if(!l.trim()){T("Configura tu API key: botón «Asistente: API de IA…» al pie del menú, o el icono del asistente."),c==null||c();return}T(null);const V=s.trim()||Zl(i),Q={role:"user",content:H},ce=[{role:"system",content:U},...b.filter(de=>de.role!=="system"),Q];S(""),k(de=>[...de,Q]),j(!0);try{const de=await zk(d,l.trim(),i,V,ce);k(we=>[...we,{role:"assistant",content:de.content??""}])}catch(de){T(de instanceof Error?de.message:String(de))}finally{j(!1)}},[l,d,w,C,b,s,c,i,U]),R=Y.useCallback(()=>{k([]),T(null)},[]);return x.jsxs("div",{className:"fixed bottom-4 right-4 z-[100] flex flex-col items-end gap-2 pointer-events-none [&>*]:pointer-events-auto",style:{paddingBottom:"max(0.5rem, env(safe-area-inset-bottom))"},children:[h?x.jsxs("div",{className:"glass-modal-panel w-[min(100vw-1.5rem,24rem)] h-[min(72vh,28rem)] flex flex-col rounded-2xl overflow-hidden",role:"dialog","aria-label":"Asistente de la API",children:[x.jsxs("div",{className:"flex items-center justify-between gap-2 px-3 py-2.5 border-b border-white/[0.08] bg-surface-950/30",children:[x.jsx("span",{className:"text-sm font-medium text-slate-200",children:"Asistente"}),x.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[x.jsx("button",{type:"button",onClick:R,className:"text-[11px] text-slate-500 hover:text-slate-300 px-2 py-1 rounded-lg glass-pill",children:"Vaciar"}),x.jsx("button",{type:"button",onClick:()=>y(!1),className:"touch-target min-w-[2.25rem] min-h-[2.25rem] rounded-xl text-slate-400 hover:text-white glass-pill text-lg leading-none","aria-label":"Cerrar panel del asistente",children:"×"})]})]}),$?x.jsxs("div",{className:"px-3 py-2 text-xs text-rose-200 bg-rose-950/35 backdrop-blur-sm border-b border-rose-500/20 flex flex-wrap items-center gap-2",children:[x.jsx("span",{className:"flex-1 min-w-0",children:$}),c?x.jsx("button",{type:"button",className:"shrink-0 underline text-accent",onClick:c,children:"Abrir configuración"}):null]}):null,x.jsxs("div",{className:"flex-1 overflow-y-auto p-3 space-y-3 min-h-0",children:[b.length===0?x.jsx("p",{className:"text-xs text-slate-500 text-center py-6 leading-relaxed px-1",children:"Pregunta por endpoints, flujos o tests. Configura el proveedor con «Asistente: API de IA…» en el menú."}):b.map((H,V)=>x.jsxs("div",{className:`text-xs leading-relaxed rounded-xl px-2.5 py-2 backdrop-blur-sm ${H.role==="user"?"bg-accent/15 text-slate-100 ml-3 border border-accent/30 shadow-[0_4px_20px_-8px_rgb(var(--accent)/0.35)]":"bg-surface-800/50 text-slate-200 mr-3 border border-white/[0.08]"}`,children:[x.jsx("span",{className:"text-[10px] uppercase tracking-wider text-slate-500 block mb-0.5",children:H.role==="user"?"Tú":"Asistente"}),x.jsx("div",{className:"whitespace-pre-wrap break-words",children:H.content})]},`${V}-${H.role}`)),x.jsx("div",{ref:I})]}),x.jsxs("div",{className:"p-2.5 border-t border-white/[0.08] flex gap-2 bg-surface-950/25",children:[x.jsx("textarea",{className:"glass-input flex-1 min-h-[44px] max-h-32 border rounded-xl px-2.5 py-2 text-xs text-slate-200 resize-y",rows:2,value:w,onChange:H=>S(H.target.value),onKeyDown:H=>{H.key==="Enter"&&!H.shiftKey&&(H.preventDefault(),P())},placeholder:"Pregunta sobre el spec…",disabled:C}),x.jsx("button",{type:"button",onClick:()=>void P(),disabled:C||!w.trim(),className:"self-end shrink-0 min-h-[44px] px-3 rounded-xl bg-accent text-surface-950 font-semibold text-xs shadow-[0_6px_20px_-6px_rgb(var(--accent)/0.5)] disabled:opacity-40",children:C?"…":"Enviar"})]})]}):null,x.jsx("button",{type:"button",onClick:()=>y(H=>!H),className:`touch-target min-w-[3.25rem] min-h-[3.25rem] rounded-full flex items-center justify-center transition-[transform,box-shadow,filter] duration-200 ${h?"glass-fab-muted scale-95":"glass-fab hover:scale-[1.03] hover:brightness-110"}`,"aria-expanded":h,"aria-label":h?"Ocultar asistente":"Abrir asistente",title:"Asistente",children:x.jsx(h0,{className:h?"opacity-80":void 0})})]})}const g0="adt-llm-provider",y0="adt-llm-model",v0="adt-llm-key";function Bk(){try{const t=localStorage.getItem(g0),r=t==="anthropic"||t==="openai"||t==="openrouter"?t:"openrouter",i=localStorage.getItem(y0)??"",s=localStorage.getItem(v0)??"";return{provider:r,model:i,apiKey:s}}catch{return{provider:"openrouter",model:"",apiKey:""}}}function Hk(t,r,i){try{localStorage.setItem(g0,t),localStorage.setItem(y0,r),localStorage.setItem(v0,i)}catch{}}const x0=[{value:200,label:"200 OK"},{value:201,label:"201 Created"},{value:202,label:"202 Accepted"},{value:204,label:"204 No Content"},{value:400,label:"400 Bad Request"},{value:401,label:"401 Unauthorized"},{value:403,label:"403 Forbidden"},{value:404,label:"404 Not Found"},{value:409,label:"409 Conflict"},{value:422,label:"422 Unprocessable"},{value:429,label:"429 Too Many Requests"},{value:500,label:"500 Server Error"},{value:502,label:"502 Bad Gateway"},{value:503,label:"503 Unavailable"}];function hm(t){return x0.some(r=>r.value===t)}const yf=[{id:"typescript",label:"TypeScript"},{id:"javascript",label:"JavaScript"},{id:"python",label:"Python"},{id:"php",label:"PHP"}];function vf(t,r){return`${t.toLowerCase()} ${r}`}function Vk(t){const r=t.indexOf(" ");return r===-1?{method:"get",path:"/"}:{method:t.slice(0,r),path:t.slice(r+1)}}async function mm(t){await navigator.clipboard.writeText(t)}function Uk(){var Gn;const t=fk(),[r,i]=Y.useState(null),[s,l]=Y.useState(null),[c,d]=Y.useState("explore"),[h,y]=Y.useState(""),[b,k]=Y.useState(null),[w,S]=Y.useState(null),[C,j]=Y.useState("typescript"),[$,T]=Y.useState(""),[I,U]=Y.useState(""),[P,R]=Y.useState("X-Api-Key"),[H,V]=Y.useState({nodes:[],edges:[]}),[Q,ce]=Y.useState(0),[de,we]=Y.useState("Mi flujo"),[q,fe]=Y.useState([]),[xe,L]=Y.useState(""),[le,G]=Y.useState({name:"Suite 1",cases:[]}),[ie,F]=Y.useState([]),[W,B]=Y.useState(""),[A,K]=Y.useState(""),[be,Se]=Y.useState(null),[Me,Ie]=Y.useState(null),[Ae,_e]=Y.useState(null),[ze,ke]=Y.useState("openrouter"),[Be,Re]=Y.useState(""),[Ue,lt]=Y.useState(""),[ut,it]=Y.useState(!1),Ct=(z,Oe)=>{try{const We=sessionStorage.getItem(z);if(We==="1")return!0;if(We==="0")return!1}catch{}return Oe},[qt,Gt]=Y.useState(()=>Ct("adt-collapse-main",!1)),[Rt,Nt]=Y.useState(()=>Ct("adt-collapse-explore",!1)),pn="/docs/openapi.json",on="/docs/preset.json",Wt=Y.useCallback(async()=>{const[z,Oe]=await Promise.all([St.flows.toArray(),St.testSuites.toArray()]);fe(z.sort((We,ct)=>(We.name??"").localeCompare(ct.name??""))),F(Oe.sort((We,ct)=>(We.name??"").localeCompare(ct.name??"")))},[]);Y.useEffect(()=>{var Oe,We;if(!r)return;const z=((Oe=t.productName)==null?void 0:Oe.trim())||((We=r.info.title)==null?void 0:We.trim())||"API";document.title=z},[r,t.productName]),Y.useEffect(()=>{fetch(pn,{credentials:"include"}).then(async z=>{if(z.status===401){let Oe="/docs/__auth/login";try{const We=await z.json();We.loginPath&&(Oe=We.loginPath)}catch{}return window.location.href=Oe,null}if(!z.ok)throw new Error(`${z.status} ${z.statusText}`);return z.json()}).then(z=>{z&&(i(z),y(ks(z)),l(null))}).catch(z=>l(z.message))},[pn]),Y.useEffect(()=>{try{sessionStorage.setItem("adt-collapse-main",qt?"1":"0")}catch{}},[qt]),Y.useEffect(()=>{try{sessionStorage.setItem("adt-collapse-explore",Rt?"1":"0")}catch{}},[Rt]),Y.useEffect(()=>{(async()=>{try{const z=await fetch("/docs/__auth/session",{credentials:"include"});if(z.ok){const Oe=await z.json();_e({username:Oe.username})}else _e(null)}catch{_e(null)}})()},[]),Y.useEffect(()=>{if(!r)return;let z=!1;return(async()=>{try{const Oe=await fetch(on,{credentials:"include"});if(!Oe.ok||z)return;const We=await Oe.json(),ct=await qy(We);!z&&ct&&await Wt()}catch{}})(),()=>{z=!0}},[r,on,Wt]),Y.useEffect(()=>{Wt(),St.kv.get("bearer").then(z=>z&&T(z.value)),St.kv.get("apiKey").then(z=>z&&U(z.value))},[Wt]),Y.useEffect(()=>{const z=Bk();ke(z.provider),Re(z.model||Zl(z.provider)),lt(z.apiKey)},[]);const Nn=Y.useMemo(()=>r?zy(r):[],[r]),pt=Y.useMemo(()=>r?to(r):[],[r]),Yt=Y.useMemo(()=>({savedFlows:q,testSuites:ie,selectedOperation:w}),[q,ie,w]),hn=Y.useMemo(()=>b?pt.filter(z=>(z.tags??["default"]).includes(b)):pt,[pt,b]);Y.useEffect(()=>{if(pt.length&&!A){const z=pt[0];K(vf(z.method,z.path))}},[pt,A]),Y.useEffect(()=>{if(pt.length===0||H.nodes.length>0||c!=="flows"||be!=null)return;const z=pt[0];V({nodes:[{id:crypto.randomUUID(),method:z.method.toLowerCase(),path:z.path,x:80,y:120}],edges:[]}),ce(Oe=>Oe+1)},[pt,H.nodes.length,c,be]);const mn=Y.useCallback(()=>{const z={"Content-Type":"application/json"};return $.trim()&&(z.Authorization=`Bearer ${$.trim()}`),I.trim()&&(z[P]=I.trim()),z},[$,I,P]),sn=Y.useMemo(()=>{if(!r||!w)return null;const z={};for(const{id:Oe}of yf)z[Oe]=Ry(r,Oe,w.method,w.path);return z},[r,w]),En=Y.useMemo(()=>r?Dy(r,C,b):"",[r,C,b]),Kn=async z=>{var Pn;if(!r)return"";const Oe={};let We="";const ct=ks(r,h);for(let Ht=0;Ht<z.length;Ht++){const yn=z[Ht];let Mn=yn.path;for(const[Zn,dr]of Object.entries(Oe))Mn=Mn.replace(`{${Zn}}`,dr);const kt=`${ct}${Mn}`,an={method:yn.method.toUpperCase(),headers:mn()},mt=yn.method.toLowerCase();mt!=="get"&&mt!=="head"&&(an.body="{}");const oo=await fetch(kt,{...an,credentials:"include"}),Jn=await oo.json().catch(()=>({}));if(We+=`Paso ${Ht+1}: ${oo.status}
|
|
240
|
+
${JSON.stringify(Jn,null,2)}
|
|
241
|
+
|
|
242
|
+
`,(Pn=yn.extract)!=null&&Pn.jsonPath){const Zn=Rf(Jn,yn.extract.jsonPath);Zn!==void 0&&(Oe[yn.extract.varName]=String(Zn))}}return We},_r=async()=>{if(!r)return;const z=ks(r,h);if(H.nodes.length===0){L("Añade al menos un nodo al flujo.");return}const Oe=await um(H,z,mn);L(Oe)},Br=async z=>{if(!r)return;const Oe=ks(r,h),We=z.graph&&z.graph.nodes.length>0?await um(z.graph,Oe,mn):await Kn(z.steps);L(We),d("flows")},Cn=z=>{we(z.name),V(z.graph&&z.graph.nodes.length>0?z.graph:uk(z.steps.length?z.steps:[{method:"get",path:"/"}])),ce(Oe=>Oe+1),Se(z.id??null),d("flows")},qe=()=>{Se(null),we("Nuevo flujo"),pt[0]?V({nodes:[{id:crypto.randomUUID(),method:pt[0].method.toLowerCase(),path:pt[0].path,x:80,y:120}],edges:[]}):V({nodes:[],edges:[]}),ce(z=>z+1)},qn=Y.useCallback(z=>{V(z)},[]),jn=async()=>{const z=lk(H);if(be!=null)await St.flows.update(be,{name:de,steps:z,graph:H});else{const Oe=await St.flows.add({name:de,steps:z,graph:H});Se(Oe)}await Wt()},ar=async z=>{z!==void 0&&(z===be&&(Se(null),qe()),await St.flows.delete(z),await Wt())},He=()=>{if(!A)return;const{method:z,path:Oe}=Vk(A),We={id:crypto.randomUUID(),method:z,path:Oe,expectStatus:200,contains:void 0,jsonPath:void 0,expectJsonValue:void 0};G(ct=>({...ct,cases:[...ct.cases,We]}))},An=z=>{G(Oe=>({...Oe,cases:Oe.cases.filter(We=>We.id!==z)}))},Jt=(z,Oe)=>{G(We=>({...We,cases:We.cases.map(ct=>ct.id===z?{...ct,...Oe}:ct)}))},lr=async z=>{if(!r)return"";const Oe=ks(r,h);let We="";for(const ct of z){const Pn=`${Oe}${ct.path}`,Ht=await fetch(Pn,{method:ct.method.toUpperCase(),headers:mn(),credentials:"include"}),yn=await Ht.text(),Mn=Wy(ct,Ht.status,yn),kt=`${Mn.pass?"PASS":"FAIL"} ${ct.method.toUpperCase()} ${ct.path}`;We+=`${kt}
|
|
243
|
+
${Mn.lines.map(an=>` ${an}`).join(`
|
|
244
|
+
`)}
|
|
245
|
+
|
|
246
|
+
`}return We},ro=async()=>{const z=await lr(le.cases);B(z)},Hr=async()=>{if(!r||ie.length===0)return;let z="";for(const Oe of ie)z+=`━━━ ${Oe.name} (${Oe.cases.length} casos) ━━━
|
|
247
|
+
`,z+=await lr(Oe.cases);B(z),d("tests")},Oo=async z=>{const Oe=await lr(z.cases);B(Oe),d("tests")},Ro=z=>{G({name:z.name,cases:z.cases.map(Oe=>({...Oe,id:Oe.id&&Oe.id.length>0?Oe.id:crypto.randomUUID()}))}),Ie(z.id??null),d("tests")},On=()=>{Ie(null),G({name:"Nueva suite",cases:[]})},Wn=async()=>{if(Me!=null)await St.testSuites.update(Me,{name:le.name,cases:le.cases});else{const z=await St.testSuites.add({name:le.name,cases:le.cases});Ie(z)}await Wt()},Yn=async z=>{z!==void 0&&(z===Me&&(Ie(null),G({name:"Nueva suite",cases:[]})),await St.testSuites.delete(z),await Wt())},ur=async()=>{await St.kv.put({key:"bearer",value:$}),await St.kv.put({key:"apiKey",value:I})},gt=async()=>{const z=await Ky(),Oe=new Blob([JSON.stringify(z,null,2)],{type:"application/json"}),We=document.createElement("a");We.href=URL.createObjectURL(Oe),We.download="api-doc-tor-export.json",We.click()},Tt=async z=>{var Pn;const Oe=(Pn=z.target.files)==null?void 0:Pn[0];if(!Oe)return;const We=await Oe.text(),ct=JSON.parse(We);await _m(ct),await Wt()},cr=async()=>{await fetch("/docs/__auth/logout",{method:"POST",credentials:"include"}),window.location.href="/docs/__auth/login"},Xn=Y.useCallback(()=>{it(!0)},[]),Qn=Y.useCallback(()=>{Hk(ze,Be.trim(),Ue),it(!1)},[Ue,Be,ze]);Y.useEffect(()=>{if(!ut)return;const z=Oe=>{Oe.key==="Escape"&&it(!1)};return window.addEventListener("keydown",z),()=>window.removeEventListener("keydown",z)},[ut]);const fr=()=>{w&&(V(z=>{const Oe=z.nodes[z.nodes.length-1],We=Oe?Oe.x+280:80,ct=(Oe==null?void 0:Oe.y)??120;return{nodes:[...z.nodes,{id:crypto.randomUUID(),method:w.method.toLowerCase(),path:w.path,x:We,y:ct}],edges:z.edges}}),ce(z=>z+1),d("flows"))};if(s)return x.jsx("div",{className:"app-glass-bg min-h-screen flex items-center justify-center p-8",children:x.jsxs("div",{role:"alert",className:"glass-card max-w-lg border-red-500/40 bg-red-950/25 p-6 text-red-100",children:[x.jsx("h1",{className:"font-display text-xl font-bold mb-2",children:"No se pudo cargar OpenAPI"}),x.jsx("p",{className:"text-sm opacity-90 leading-relaxed",children:s}),x.jsxs("p",{className:"text-xs mt-4 text-slate-500",children:["URL intentada: ",pn]})]})});if(!r)return x.jsx("div",{className:"app-glass-bg min-h-screen flex items-center justify-center p-6",children:x.jsx("div",{className:"glass-card px-8 py-6 border-white/[0.08]",children:x.jsx("p",{className:"text-slate-300 motion-safe:animate-pulse text-sm font-medium",children:"Cargando especificación…"})})});const Lo=b===null?"Todos los endpoints (cliente único con todas las operaciones)":`Tag «${b}» (solo operaciones de este grupo)`,gn=((Gn=t.productName)==null?void 0:Gn.trim())||r.info.title;return x.jsxs("div",{className:"app-glass-bg min-h-screen flex flex-col selection:bg-accent/25 selection:text-slate-50",children:[x.jsx("a",{href:"#main-content",className:"skip-link",children:"Saltar al contenido"}),x.jsxs("div",{className:"flex flex-1 flex-col md:flex-row min-h-0",children:[x.jsxs("aside",{className:`glass-sidebar w-full border-b md:border-b-0 md:border-r border-surface-600/40 shrink-0 transition-[width] duration-200 ease-out flex flex-col overflow-hidden md:rounded-r-3xl ${qt?"md:w-14 md:min-w-[3.5rem]":"md:w-64"}`,children:[x.jsx("input",{id:"adt-state-import",type:"file",accept:"application/json",className:"hidden",onChange:Tt}),x.jsxs("div",{className:qt?"max-md:block md:hidden":"block",children:[x.jsxs("div",{className:"p-4 border-b border-surface-700 flex justify-between items-start gap-2",children:[x.jsxs("div",{className:"min-w-0",children:[t.logoDataUrl?x.jsx("img",{src:t.logoDataUrl,alt:gn,className:"h-9 max-w-[200px] object-contain object-left mb-2"}):null,x.jsx("h1",{className:"font-display text-lg font-bold text-white tracking-tight",children:gn}),x.jsx("p",{className:"text-xs text-slate-500 mt-1",children:gn===r.info.title?`v${r.info.version}`:`${r.info.title} · v${r.info.version}`})]}),x.jsx("button",{type:"button",className:"hidden md:flex shrink-0 touch-target rounded-lg border border-surface-600 bg-surface-800 text-slate-300 hover:bg-surface-700 items-center justify-center text-lg leading-none transition-colors duration-200",onClick:()=>Gt(!0),"aria-label":"Ocultar menú lateral",title:"Ocultar menú",children:"‹"})]}),x.jsx("nav",{className:"p-2 flex flex-row md:flex-col gap-1 overflow-x-auto","aria-label":"Navegación principal",children:[["explore","Explorar"],["flows",`Flujos (${q.length})`],["tests",`Tests (${ie.length})`],["auth","Auth"]].map(([z,Oe])=>x.jsx("button",{type:"button",onClick:()=>d(z),className:`text-left px-3 py-2.5 md:py-2 rounded-xl text-sm transition-all duration-200 ease-out min-h-[44px] md:min-h-0 flex items-center ${c===z?"glass-pill-active text-accent":"text-slate-400 glass-pill hover:text-slate-200"}`,children:Oe},z))}),Ae?x.jsxs("div",{className:"px-3 py-2 border-t border-surface-700 flex items-center justify-between gap-2 text-xs",children:[x.jsx("span",{className:"text-slate-400 truncate",title:Ae.username,children:Ae.username}),x.jsx("button",{type:"button",className:"shrink-0 text-accent hover:underline",onClick:()=>void cr(),children:"Salir"})]}):null,x.jsxs("div",{className:"p-3 border-t border-surface-700 space-y-2",children:[x.jsx("button",{type:"button",onClick:()=>it(!0),className:"w-full text-xs py-2.5 rounded-xl glass-pill text-slate-200 hover:text-accent min-h-[44px] md:min-h-0 transition-all duration-200",children:"Asistente: API de IA…"}),x.jsx("button",{type:"button",onClick:gt,className:"w-full text-xs py-2.5 rounded-xl glass-pill text-slate-300 min-h-[44px] md:min-h-0",children:"Exportar estado"}),x.jsx("label",{htmlFor:"adt-state-import",className:"block w-full text-xs py-2.5 rounded-xl glass-pill text-center text-slate-300 cursor-pointer transition-all duration-200 min-h-[44px] md:min-h-0 flex items-center justify-center",children:"Importar JSON"})]})]}),qt?x.jsxs("div",{className:"max-md:hidden md:flex flex-1 flex-col items-stretch py-2 px-1 gap-1 min-h-0 overflow-y-auto overflow-x-hidden",children:[x.jsx("button",{type:"button",className:"touch-target w-11 h-11 mx-auto rounded-lg border border-surface-600 bg-surface-800 text-slate-200 hover:bg-surface-700 flex items-center justify-center shrink-0 transition-colors duration-200",onClick:()=>Gt(!1),"aria-label":"Mostrar menú lateral completo",title:"Expandir panel completo",children:x.jsx(pm,{className:"text-slate-300"})}),x.jsxs("nav",{className:"flex flex-col gap-0.5 items-center w-full py-1 border-b border-surface-700/80","aria-label":"Secciones",children:[x.jsx("button",{type:"button",onClick:()=>d("explore"),title:"Explorar","aria-current":c==="explore"?"page":void 0,className:`relative touch-target w-11 h-11 rounded-lg border flex items-center justify-center shrink-0 transition-colors duration-200 ${c==="explore"?"border-accent/60 bg-accent/15 text-accent":"border-transparent bg-surface-800/80 text-slate-400 hover:bg-surface-800 hover:text-slate-200"}`,children:x.jsx(Ek,{})}),x.jsxs("button",{type:"button",onClick:()=>d("flows"),title:`Flujos (${q.length})`,"aria-current":c==="flows"?"page":void 0,className:`relative touch-target w-11 h-11 rounded-lg border flex items-center justify-center shrink-0 transition-colors duration-200 ${c==="flows"?"border-accent/60 bg-accent/15 text-accent":"border-transparent bg-surface-800/80 text-slate-400 hover:bg-surface-800 hover:text-slate-200"}`,children:[x.jsx(Ck,{}),q.length>0?x.jsx("span",{className:"absolute -bottom-0.5 -right-0.5 min-w-[14px] h-3.5 px-0.5 rounded-full bg-accent text-[8px] font-bold text-surface-950 flex items-center justify-center leading-none",children:q.length>99?"99+":q.length}):null]}),x.jsxs("button",{type:"button",onClick:()=>d("tests"),title:`Tests (${ie.length})`,"aria-current":c==="tests"?"page":void 0,className:`relative touch-target w-11 h-11 rounded-lg border flex items-center justify-center shrink-0 transition-colors duration-200 ${c==="tests"?"border-accent/60 bg-accent/15 text-accent":"border-transparent bg-surface-800/80 text-slate-400 hover:bg-surface-800 hover:text-slate-200"}`,children:[x.jsx(jk,{}),ie.length>0?x.jsx("span",{className:"absolute -bottom-0.5 -right-0.5 min-w-[14px] h-3.5 px-0.5 rounded-full bg-emerald-500 text-[8px] font-bold text-surface-950 flex items-center justify-center leading-none",children:ie.length>99?"99+":ie.length}):null]}),x.jsx("button",{type:"button",onClick:()=>it(!0),title:"Asistente: configurar API de IA",className:"touch-target w-11 h-11 rounded-lg border border-transparent bg-surface-800/80 text-slate-400 hover:bg-surface-800 hover:text-accent flex items-center justify-center shrink-0 transition-colors duration-200",children:x.jsx(h0,{})}),x.jsxs("button",{type:"button",onClick:()=>d("auth"),title:"Auth","aria-current":c==="auth"?"page":void 0,className:`relative touch-target w-11 h-11 rounded-lg border flex items-center justify-center shrink-0 transition-colors duration-200 ${c==="auth"?"border-accent/60 bg-accent/15 text-accent":"border-transparent bg-surface-800/80 text-slate-400 hover:bg-surface-800 hover:text-slate-200"}`,children:[x.jsx(Pk,{}),Ae?x.jsx("span",{className:"absolute -top-0.5 -right-0.5 w-2 h-2 rounded-full bg-emerald-400 border border-surface-900","aria-hidden":!0}):null]})]}),x.jsxs("div",{className:"flex flex-col gap-0.5 items-center w-full py-1 mt-auto border-t border-surface-700/80",children:[x.jsx("button",{type:"button",onClick:gt,title:"Exportar estado",className:"touch-target w-11 h-11 rounded-lg border border-transparent bg-surface-800/80 text-slate-400 hover:bg-surface-800 hover:text-slate-200 flex items-center justify-center transition-colors duration-200",children:x.jsx(Mk,{})}),x.jsx("button",{type:"button",onClick:()=>{var z;return(z=document.getElementById("adt-state-import"))==null?void 0:z.click()},title:"Importar JSON",className:"touch-target w-11 h-11 rounded-lg border border-transparent bg-surface-800/80 text-slate-400 hover:bg-surface-800 hover:text-slate-200 flex items-center justify-center transition-colors duration-200",children:x.jsx($k,{})}),Ae?x.jsx("button",{type:"button",onClick:()=>void cr(),title:`Salir (${Ae.username})`,className:"touch-target w-11 h-11 rounded-lg border border-transparent bg-surface-800/80 text-rose-400/90 hover:bg-rose-950/50 flex items-center justify-center transition-colors duration-200",children:x.jsx(Tk,{})}):null]})]}):null]}),x.jsxs("main",{id:"main-content",tabIndex:-1,className:"flex-1 flex flex-col min-h-0 outline-none",children:[x.jsx("header",{className:"glass-sticky-header sticky top-0 z-20 px-4 py-3 flex flex-wrap gap-3 items-center",children:x.jsxs("label",{className:"text-xs text-slate-500 flex flex-col gap-1 sm:flex-row sm:items-center",children:[x.jsx("span",{className:"shrink-0 font-medium text-slate-400",children:"Base URL"}),x.jsx("input",{className:"glass-input sm:ml-2 min-h-[44px] sm:min-h-0 border rounded-xl px-3 py-2 text-sm w-full max-w-md text-slate-200 transition-colors duration-200 hover:border-accent/30",value:h,onChange:z=>y(z.target.value),placeholder:"https://api.ejemplo.com",autoComplete:"url",spellCheck:!1})]})}),c==="explore"&&x.jsxs("div",{className:"flex-1 flex flex-col lg:flex-row min-h-0",children:[x.jsxs("div",{className:`glass-explore-rail shrink-0 border-b lg:border-b-0 lg:border-r border-surface-600/35 overflow-auto transition-[width] duration-200 ease-out lg:rounded-r-2xl ${Rt?"lg:w-14 lg:min-w-[3.5rem] max-h-16 lg:max-h-none":"lg:w-72 max-h-64 lg:max-h-none"}`,children:[x.jsxs("div",{className:Rt?"max-lg:block lg:hidden":"block",children:[x.jsxs("div",{className:"p-2 flex items-start justify-between gap-2 border-b border-surface-700 lg:border-b-0",children:[x.jsx("p",{className:"text-xs uppercase tracking-wider text-slate-500 shrink-0",children:"Tags"}),x.jsx("button",{type:"button",className:"hidden lg:flex shrink-0 touch-target rounded-lg border border-surface-600 bg-surface-800 text-slate-300 hover:bg-surface-700 items-center justify-center text-sm leading-none transition-colors duration-200",onClick:()=>Nt(!0),"aria-label":"Ocultar lista de endpoints",title:"Ocultar endpoints",children:"‹"})]}),x.jsx("div",{className:"p-2 pt-1",children:x.jsxs("div",{className:"flex flex-wrap gap-1",children:[x.jsx("button",{type:"button",onClick:()=>k(null),className:`text-xs px-3 py-2 sm:py-1 rounded-xl min-h-[40px] sm:min-h-0 transition-all duration-200 ${b===null?"glass-pill-active text-slate-100":"glass-pill text-slate-300"}`,children:"Todos"}),Nn.map(z=>x.jsx("button",{type:"button",onClick:()=>k(z),className:`text-xs px-3 py-2 sm:py-1 rounded-xl min-h-[40px] sm:min-h-0 transition-all duration-200 ${b===z?"glass-pill-active text-slate-100":"glass-pill text-slate-300"}`,children:z},z))]})}),x.jsx("ul",{className:"text-sm",children:hn.map(z=>x.jsx("li",{children:x.jsxs("button",{type:"button",onClick:()=>S({method:z.method,path:z.path}),className:`w-full text-left px-3 py-2.5 sm:py-2 min-h-[44px] sm:min-h-0 flex gap-2 items-center transition-all duration-150 rounded-r-xl ${(w==null?void 0:w.method)===z.method&&w.path===z.path?"glass-pill-active border-l-2 border-accent ml-0.5":"hover:bg-white/[0.04]"}`,children:[x.jsx(su,{method:z.method}),x.jsx("span",{className:"truncate text-slate-300",children:z.path})]})},`${z.method}:${z.path}`))})]}),Rt?x.jsxs("div",{className:"max-lg:hidden lg:flex flex-1 flex-col items-stretch py-2 px-1 gap-1 min-h-0 min-w-0",children:[x.jsx("button",{type:"button",className:"touch-target w-11 h-11 mx-auto rounded-lg border border-surface-600 bg-surface-800 text-slate-200 hover:bg-surface-700 flex items-center justify-center shrink-0 transition-colors duration-200",onClick:()=>Nt(!1),"aria-label":"Mostrar lista de endpoints completa",title:"Expandir lista de endpoints",children:x.jsx(pm,{className:"text-slate-300"})}),x.jsxs("div",{className:"text-center text-[9px] font-mono text-slate-500 leading-none px-0.5",title:`${hn.length} operación(es) (filtro actual)`,children:[x.jsx("span",{className:"block text-slate-400 font-semibold text-[11px]",children:hn.length}),x.jsx("span",{className:"text-[8px] uppercase tracking-tighter",children:"ops"})]}),x.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden flex flex-col gap-0.5 min-h-0 max-h-[min(70vh,32rem)] items-center w-full",role:"list","aria-label":"Endpoints numerados",children:hn.map((z,Oe)=>{const We=(w==null?void 0:w.method)===z.method&&w.path===z.path;return x.jsx("button",{type:"button",role:"listitem",title:`${z.method.toUpperCase()} ${z.path}`,onClick:()=>S({method:z.method,path:z.path}),className:`touch-target min-h-[40px] min-w-[40px] w-10 h-10 shrink-0 rounded-md border border-surface-700 bg-surface-900 text-[11px] font-mono font-semibold text-slate-200 hover:bg-surface-800 transition-colors duration-150 ${Nk(z.method)} ${We?"ring-2 ring-accent/80 shadow-[inset_0_0_0_1px_rgba(56,189,248,0.2)]":""}`,children:Oe+1},`${z.method}:${z.path}`)})})]}):null]}),x.jsx("div",{className:"flex-1 p-4 overflow-auto space-y-6",children:w?x.jsxs(x.Fragment,{children:[x.jsxs("div",{children:[x.jsxs("h2",{className:"font-display font-semibold text-white text-lg flex flex-wrap items-center gap-2",children:[x.jsx(su,{method:w.method,size:"md"}),x.jsx("span",{className:"font-mono text-slate-200 break-all",children:w.path})]}),x.jsxs("p",{className:"text-xs text-slate-500 mt-1",children:["Filtro de exportación de servicio: ",Lo]})]}),r?x.jsx(kk,{doc:r,selectedOp:w,baseUrl:h,buildHeaders:mn}):null,x.jsxs("section",{className:"space-y-3",children:[x.jsx("h3",{className:"text-sm font-medium text-slate-300",children:"Snippets por lenguaje"}),x.jsx("div",{className:"grid gap-3 md:grid-cols-2",children:sn&&yf.map(({id:z,label:Oe})=>x.jsxs("div",{className:"rounded-xl border border-surface-700 bg-surface-900/60 overflow-hidden",children:[x.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b border-surface-700 bg-surface-800/50",children:[x.jsx("span",{className:"text-xs font-medium text-accent",children:Oe}),x.jsx("button",{type:"button",className:"text-xs px-2 py-1 rounded bg-surface-700 hover:bg-surface-600",onClick:()=>void mm(sn[z]),children:"Copiar"})]}),x.jsx("pre",{className:"text-[11px] p-3 overflow-auto max-h-56 text-slate-300 font-mono whitespace-pre-wrap",children:sn[z]})]},z))})]}),x.jsxs("section",{className:"space-y-3 rounded-xl border border-surface-700 bg-surface-900/40 p-4",children:[x.jsx("h3",{className:"text-sm font-medium text-slate-300",children:"Cliente / servicio generado"}),x.jsx("p",{className:"text-xs text-slate-500",children:Lo}),x.jsxs("div",{className:"flex flex-wrap gap-2 items-center",children:[x.jsxs("label",{className:"text-xs text-slate-400",children:["Lenguaje del archivo",x.jsx("select",{className:"ml-2 bg-surface-800 border border-surface-600 rounded px-2 py-1.5 text-sm",value:C,onChange:z=>j(z.target.value),children:yf.map(({id:z,label:Oe})=>x.jsx("option",{value:z,children:Oe},z))})]}),x.jsx("button",{type:"button",className:"text-xs px-3 py-1.5 rounded-lg bg-surface-700 hover:bg-surface-600",onClick:()=>void mm(En),children:"Copiar servicio"})]}),x.jsx("pre",{className:"text-[11px] bg-surface-950 border border-surface-700 rounded-lg p-3 overflow-auto max-h-96 text-slate-200 font-mono whitespace-pre-wrap",children:En})]}),x.jsx("div",{className:"flex flex-wrap gap-2 pt-2 border-t border-surface-800",children:x.jsx("button",{type:"button",className:"text-xs px-3 py-2 rounded-lg bg-surface-800 hover:bg-surface-700",onClick:fr,children:"Añadir operación actual a un flujo (ve a Flujos)"})})]}):x.jsx("p",{className:"text-slate-500",children:"Selecciona una operación en la lista."})})]}),c==="flows"&&x.jsxs("div",{className:"p-4 space-y-6 overflow-auto max-w-5xl",children:[x.jsxs("section",{className:"rounded-xl border border-surface-700 bg-surface-900/50 p-4",children:[x.jsx("h3",{className:"text-sm font-semibold text-white mb-3",children:"Flujos guardados"}),q.length===0?x.jsx("p",{className:"text-sm text-slate-500",children:"Aún no hay flujos. Crea uno en el editor y guarda."}):x.jsx("ul",{className:"space-y-2",children:q.map(z=>{var Oe,We;return x.jsxs("li",{className:"flex flex-wrap items-center gap-2 justify-between rounded-lg border border-surface-700 bg-surface-950/50 px-3 py-2",children:[x.jsxs("div",{children:[x.jsx("span",{className:"text-sm text-slate-200 font-medium",children:z.name}),x.jsxs("span",{className:"text-xs text-slate-500 ml-2",children:[(((We=(Oe=z.graph)==null?void 0:Oe.nodes)==null?void 0:We.length)??z.steps.length)||0," nodo(s)"]})]}),x.jsxs("div",{className:"flex flex-wrap gap-2",children:[x.jsx("button",{type:"button",className:"text-xs px-2 py-1.5 rounded-lg bg-emerald-600/30 text-emerald-300 hover:bg-emerald-600/50",title:"Ejecutar sin cargar el editor",onClick:()=>void Br(z),children:"Play"}),x.jsx("button",{type:"button",className:"text-xs px-2 py-1.5 rounded bg-accent/20 text-accent hover:bg-accent/30",onClick:()=>Cn(z),children:"Editar"}),x.jsx("button",{type:"button",className:"text-xs px-2 py-1 rounded bg-surface-700 hover:bg-red-900/40 text-slate-300",onClick:()=>void ar(z.id),children:"Eliminar"})]})]},z.id!=null?`flow-${z.id}`:`flow-${z.name}`)})})]}),x.jsxs("section",{className:"space-y-4 max-w-6xl",children:[x.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[x.jsx("h3",{className:"text-sm font-semibold text-white",children:"Editor de flujo (nodos y cables)"}),x.jsx("button",{type:"button",className:"text-xs px-3 py-1.5 rounded-lg border border-surface-600 text-slate-300 hover:bg-surface-800",onClick:qe,children:"Nuevo flujo"})]}),be!=null&&x.jsxs("p",{className:"text-xs text-accent",children:["Editando flujo guardado (#",be,")"]}),x.jsxs("p",{className:"text-sm text-slate-400",children:["Cada nodo es un endpoint del spec. Conecta ",x.jsx("strong",{className:"text-slate-300",children:"res → req"})," ","y define qué campo de la respuesta pasa al siguiente request (JSON path, variable, header, query o ",x.jsx("code",{className:"text-accent",children:"{variable}"})," en la ruta)."]}),x.jsx("input",{className:"bg-surface-800 border border-surface-600 rounded px-3 py-2 text-sm w-full max-w-md",value:de,onChange:z=>we(z.target.value),placeholder:"Nombre del flujo"}),x.jsx(ak,{doc:r,ops:pt,graph:H,onGraphChange:qn},Q),x.jsxs("div",{className:"flex flex-wrap gap-2",children:[x.jsx("button",{type:"button",className:"px-3 py-2 rounded-lg bg-emerald-600 text-white text-sm font-medium hover:bg-emerald-500",onClick:()=>void _r(),children:"Play (grafo)"}),x.jsx("button",{type:"button",className:"px-3 py-2 rounded-lg bg-surface-700 text-sm",onClick:()=>void jn(),children:be!=null?"Guardar cambios":"Guardar flujo"})]}),x.jsx("pre",{className:"text-xs bg-surface-950 border border-surface-700 rounded-lg p-3 max-h-64 overflow-auto whitespace-pre-wrap",children:xe||"Resultado de la ejecución aquí."})]})]}),c==="tests"&&x.jsxs("div",{className:"p-4 space-y-6 overflow-auto max-w-5xl",children:[x.jsxs("section",{className:"rounded-xl border border-surface-700 bg-surface-900/50 p-4 space-y-3",children:[x.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[x.jsx("h3",{className:"text-sm font-semibold text-white",children:"Suites guardadas"}),ie.length>0&&x.jsx("button",{type:"button",className:"text-xs px-3 py-1.5 rounded-lg bg-emerald-600/80 text-white hover:bg-emerald-500",onClick:()=>void Hr(),children:"Ejecutar todas las suites"})]}),ie.length===0?x.jsx("p",{className:"text-sm text-slate-500",children:"Ninguna suite guardada."}):x.jsx("ul",{className:"space-y-2",children:ie.map(z=>x.jsxs("li",{className:"flex flex-wrap items-center justify-between gap-2 rounded-lg border border-surface-700 bg-surface-950/50 px-3 py-2",children:[x.jsxs("div",{children:[x.jsx("span",{className:"text-sm text-slate-200 font-medium",children:z.name}),x.jsxs("span",{className:"text-xs text-slate-500 ml-2",children:[z.cases.length," caso(s)"]})]}),x.jsxs("div",{className:"flex flex-wrap gap-2",children:[x.jsx("button",{type:"button",className:"text-xs px-2 py-1.5 rounded-lg bg-emerald-600/30 text-emerald-300 hover:bg-emerald-600/50",onClick:()=>void Oo(z),children:"Play"}),x.jsx("button",{type:"button",className:"text-xs px-2 py-1.5 rounded bg-accent/20 text-accent",onClick:()=>Ro(z),children:"Editar"}),x.jsx("button",{type:"button",className:"text-xs px-2 py-1 rounded bg-surface-700 hover:bg-red-900/40",onClick:()=>void Yn(z.id),children:"Eliminar"})]})]},z.id!=null?`suite-${z.id}`:`suite-${z.name}`))})]}),x.jsxs("section",{className:"space-y-4",children:[x.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[x.jsx("h3",{className:"text-sm font-semibold text-white",children:"Suite en edición"}),x.jsx("button",{type:"button",className:"text-xs px-3 py-1.5 rounded-lg border border-surface-600 text-slate-300 hover:bg-surface-800",onClick:On,children:"Nueva suite"})]}),Me!=null&&x.jsxs("p",{className:"text-xs text-accent",children:["Editando suite guardada (#",Me,")"]}),x.jsx("input",{className:"bg-surface-800 border border-surface-600 rounded px-3 py-2 text-sm max-w-md",value:le.name,onChange:z=>G(Oe=>({...Oe,name:z.target.value})),placeholder:"Nombre de la suite"}),x.jsxs("div",{className:"flex flex-wrap gap-2 items-end rounded-xl border border-surface-700 bg-surface-900/40 p-4",children:[x.jsxs("label",{className:"text-xs text-slate-400 flex-1 min-w-[200px]",children:["Añadir endpoint del spec",x.jsx("select",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-3 py-2 text-sm font-mono",value:A,onChange:z=>K(z.target.value),children:pt.map(z=>x.jsxs("option",{value:vf(z.method,z.path),children:[z.method.toUpperCase()," ",z.path]},vf(z.method,z.path)))})]}),x.jsx("button",{type:"button",className:"px-4 py-2 rounded-lg bg-surface-800 text-sm hover:bg-surface-700",onClick:He,children:"Añadir a la suite"})]}),x.jsx("ul",{className:"space-y-4",children:le.cases.map(z=>{const Oe=hm(z.expectStatus)?String(z.expectStatus):"custom";return x.jsxs("li",{className:"rounded-xl border border-surface-700 bg-surface-950/40 p-4 space-y-3 text-sm",children:[x.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-2",children:[x.jsxs("span",{className:"flex flex-wrap items-center gap-2 min-w-0",children:[x.jsx(su,{method:z.method}),x.jsx("span",{className:"font-mono text-xs text-slate-300 break-all",children:z.path})]}),x.jsx("button",{type:"button",className:"text-xs text-red-400 hover:underline shrink-0",onClick:()=>An(z.id),children:"Quitar"})]}),x.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-3",children:[x.jsxs("label",{className:"text-xs text-slate-400 block",children:["Código HTTP esperado",x.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-2",children:[x.jsxs("select",{className:"bg-surface-800 border border-surface-600 rounded px-2 py-1.5 text-sm max-w-[200px]",value:Oe,onChange:We=>{const ct=We.target.value;if(ct==="custom"){Jt(z.id,{expectStatus:hm(z.expectStatus)?1e3:z.expectStatus});return}Jt(z.id,{expectStatus:Number(ct)})},children:[x0.map(We=>x.jsx("option",{value:String(We.value),children:We.label},We.value)),x.jsx("option",{value:"custom",children:"Otro…"})]}),Oe==="custom"&&x.jsx("input",{type:"number",className:"w-20 bg-surface-800 border border-surface-600 rounded px-2 py-1.5 text-sm",value:z.expectStatus,onChange:We=>Jt(z.id,{expectStatus:Number(We.target.value)||0})})]})]}),x.jsxs("label",{className:"text-xs text-slate-400 block sm:col-span-2",children:["El body contiene (opcional)",x.jsx("input",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-2 py-1.5 font-mono text-xs",placeholder:'ej. "ok"',value:z.contains??"",onChange:We=>Jt(z.id,{contains:We.target.value||void 0})})]}),x.jsxs("label",{className:"text-xs text-slate-400 block",children:["JSON path (opcional)",x.jsx("input",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-2 py-1.5 font-mono text-xs",placeholder:"$.data.id",value:z.jsonPath??"",onChange:We=>Jt(z.id,{jsonPath:We.target.value||void 0})})]}),x.jsxs("label",{className:"text-xs text-slate-400 block sm:col-span-2",children:["Valor esperado en JSON path (opcional)",x.jsx("input",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-2 py-1.5 font-mono text-xs",placeholder:"Vacío = solo comprobar que existe",value:z.expectJsonValue??"",onChange:We=>Jt(z.id,{expectJsonValue:We.target.value||void 0})})]})]})]},z.id)})}),x.jsxs("div",{className:"flex flex-wrap gap-2 items-center",children:[x.jsx("button",{type:"button",className:"px-5 py-2.5 rounded-lg bg-emerald-600 text-white text-sm font-semibold hover:bg-emerald-500 shadow-lg shadow-emerald-900/30",onClick:()=>void ro(),children:"Correr todos los casos (suite actual)"}),x.jsx("button",{type:"button",className:"px-4 py-2 rounded-lg bg-surface-700 text-sm",onClick:()=>void Wn(),children:Me!=null?"Guardar cambios":"Guardar suite"})]}),x.jsx("pre",{className:"text-xs bg-surface-950 border border-surface-700 rounded-lg p-3 whitespace-pre-wrap min-h-[4rem]",children:W||"—"})]})]}),c==="auth"&&x.jsxs("div",{className:"p-4 space-y-4 max-w-lg",children:[x.jsxs("p",{className:"text-sm text-slate-400",children:["Esquemas en el spec: ",Fy(r).join(", ")||"ninguno"]}),x.jsxs("label",{className:"block text-sm",children:["Bearer token",x.jsx("input",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-3 py-2",value:$,onChange:z=>T(z.target.value),placeholder:"eyJ..."})]}),x.jsxs("label",{className:"block text-sm",children:["API key header",x.jsx("input",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-3 py-2",value:P,onChange:z=>R(z.target.value)})]}),x.jsxs("label",{className:"block text-sm",children:["API key",x.jsx("input",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-3 py-2",value:I,onChange:z=>U(z.target.value),type:"password",autoComplete:"off"})]}),x.jsx("button",{type:"button",className:"px-4 py-2 rounded-lg bg-surface-700 text-sm",onClick:()=>void ur(),children:"Recordar en este navegador"})]})]})]}),ut?x.jsx("div",{className:"glass-modal-backdrop fixed inset-0 z-[110] flex items-end sm:items-center justify-center p-4 sm:p-6",role:"presentation",onClick:()=>it(!1),children:x.jsxs("div",{role:"dialog","aria-modal":"true","aria-labelledby":"adt-llm-modal-title",className:"glass-modal-panel w-full max-w-md rounded-2xl max-h-[90vh] overflow-y-auto",onClick:z=>z.stopPropagation(),children:[x.jsxs("div",{className:"flex items-start justify-between gap-2 px-4 py-3 border-b border-white/[0.08]",children:[x.jsx("h2",{id:"adt-llm-modal-title",className:"text-sm font-semibold text-slate-100 pr-2",children:"Asistente: proveedor de IA"}),x.jsx("button",{type:"button",className:"shrink-0 touch-target min-w-[2.25rem] min-h-[2.25rem] rounded-xl text-slate-400 hover:text-white glass-pill text-lg leading-none",onClick:()=>it(!1),"aria-label":"Cerrar",children:"×"})]}),x.jsxs("div",{className:"px-4 py-4 space-y-3",children:[x.jsx("p",{className:"text-xs text-slate-400 leading-relaxed",children:"Tu clave se guarda solo en este navegador. El servidor la reenvía al proveedor; no se almacena en el servidor."}),x.jsxs("label",{className:"block text-xs text-slate-400",children:["Proveedor",x.jsxs("select",{className:"glass-input mt-1 w-full border rounded-xl px-3 py-2 text-sm text-slate-200",value:ze,onChange:z=>{const Oe=z.target.value;ke(Oe),Re(We=>We.trim()?We:Zl(Oe))},children:[x.jsx("option",{value:"anthropic",children:"Anthropic (Claude)"}),x.jsx("option",{value:"openai",children:"OpenAI"}),x.jsx("option",{value:"openrouter",children:"OpenRouter"})]})]}),x.jsxs("label",{className:"block text-xs text-slate-400",children:["Modelo (opcional)",x.jsx("input",{className:"glass-input mt-1 w-full border rounded-xl px-3 py-2 text-sm font-mono text-slate-200",value:Be,onChange:z=>Re(z.target.value),placeholder:Zl(ze),spellCheck:!1})]}),x.jsxs("label",{className:"block text-xs text-slate-400",children:["API key",x.jsx("input",{type:"password",className:"glass-input mt-1 w-full border rounded-xl px-3 py-2 text-sm font-mono text-slate-200",value:Ue,onChange:z=>lt(z.target.value),placeholder:ze==="anthropic"?"sk-ant-…":ze==="openai"?"sk-…":"sk-or-v1-…",autoComplete:"off"})]}),x.jsxs("div",{className:"flex flex-wrap gap-2 pt-1",children:[x.jsx("button",{type:"button",onClick:Qn,className:"px-4 py-2.5 rounded-xl bg-accent text-surface-950 text-sm font-medium shadow-[0_8px_24px_-8px_rgb(var(--accent)/0.55)] hover:brightness-110 transition-[filter]",children:"Guardar"}),x.jsx("button",{type:"button",onClick:()=>it(!1),className:"px-4 py-2.5 rounded-xl glass-pill text-slate-300 text-sm",children:"Cancelar"})]})]})]})}):null,x.jsx(Fk,{doc:r,contextExtras:Yt,provider:ze,model:Be,apiKey:Ue,onOpenLlmSettings:Xn}),x.jsx("footer",{className:"glass-footer px-3 py-2.5 text-center text-[11px] text-slate-500 shrink-0",children:"made with ♥ by andres arcila"})]})}const Kk={surface950:"#0c0f14",surface900:"#12171f",surface800:"#1a2230",surface700:"#243044",accent:"#38bdf8",accentDim:"#0ea5e9"};function Ss(t){const r=t.trim(),i=/^#?([0-9a-f]{6})$/i.exec(r);if(!i)return"12 15 20";const s=parseInt(i[1],16);return`${s>>16&255} ${s>>8&255} ${s&255}`}function qk(t){return{...Kk,...t}}function Wk(t){var s,l;const r=(s=t.logoBase64)==null?void 0:s.trim();return r?r.startsWith("data:")?r:`data:${((l=t.logoMimeType)==null?void 0:l.trim())||"image/png"};base64,${r}`:null}function Yk(t){var i;const r=qk(t==null?void 0:t.colors);return{productName:((i=t==null?void 0:t.productName)==null?void 0:i.trim())||null,logoDataUrl:t?Wk(t):null,colors:r,colorsRgb:{surface950:Ss(r.surface950),surface900:Ss(r.surface900),surface800:Ss(r.surface800),surface700:Ss(r.surface700),accent:Ss(r.accent),accentDim:Ss(r.accentDim)}}}const Xk={credentials:"include"};function Qk(t){const r=document.documentElement;r.style.setProperty("--surface-950",t.surface950),r.style.setProperty("--surface-900",t.surface900),r.style.setProperty("--surface-800",t.surface800),r.style.setProperty("--surface-700",t.surface700),r.style.setProperty("--accent",t.accent),r.style.setProperty("--accent-dim",t.accentDim)}async function Gk(){const t=Yk(void 0);try{const r=await fetch("/docs/ui-config.json",Xk);return r.status===401?{...t,docsAuthRequired:!0}:r.ok?await r.json():t}catch{return t}}(async()=>{const t=await Gk();Qk(t.colorsRgb),wy.createRoot(document.getElementById("root")).render(x.jsx(gm.StrictMode,{children:x.jsx(ck,{value:{productName:t.productName,logoDataUrl:t.logoDataUrl},children:x.jsx(Uk,{})})}))})();
|