@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.
Files changed (48) hide show
  1. package/dist/chat-proxy.d.ts +12 -0
  2. package/dist/chat-proxy.d.ts.map +1 -0
  3. package/dist/chat-proxy.js +44 -0
  4. package/dist/chat-proxy.js.map +1 -0
  5. package/dist/docs-access-express.d.ts +16 -0
  6. package/dist/docs-access-express.d.ts.map +1 -0
  7. package/dist/docs-access-express.js +187 -0
  8. package/dist/docs-access-express.js.map +1 -0
  9. package/dist/index.d.ts +64 -0
  10. package/dist/index.d.ts.map +1 -0
  11. package/dist/index.js +134 -0
  12. package/dist/index.js.map +1 -0
  13. package/package.json +36 -0
  14. package/static/assets/index-2Nv3pxOm.css +1 -0
  15. package/static/assets/index-6tehJlKh.js +214 -0
  16. package/static/assets/index-B148KlKZ.js +247 -0
  17. package/static/assets/index-B7AxOqhh.js +247 -0
  18. package/static/assets/index-BAVM9zLs.css +1 -0
  19. package/static/assets/index-BD4qyClR.js +216 -0
  20. package/static/assets/index-BZaQe_xi.css +1 -0
  21. package/static/assets/index-BjWlpH_h.js +216 -0
  22. package/static/assets/index-BmiFV0rx.css +1 -0
  23. package/static/assets/index-BqIvYIJT.js +247 -0
  24. package/static/assets/index-BwOiuEB4.js +216 -0
  25. package/static/assets/index-C372jkHK.js +214 -0
  26. package/static/assets/index-C9S9wEor.js +217 -0
  27. package/static/assets/index-Cd9PPQz6.css +1 -0
  28. package/static/assets/index-Cf2mt1FM.css +1 -0
  29. package/static/assets/index-Cfn42GaL.css +1 -0
  30. package/static/assets/index-Ckm4kbAk.css +1 -0
  31. package/static/assets/index-CzGmm9SR.css +1 -0
  32. package/static/assets/index-D0jOSazL.js +187 -0
  33. package/static/assets/index-D3-lCeHu.js +214 -0
  34. package/static/assets/index-DDRNEd4n.js +247 -0
  35. package/static/assets/index-DOyViYzn.js +247 -0
  36. package/static/assets/index-DZsbTHIg.js +214 -0
  37. package/static/assets/index-DaYbWEw0.js +190 -0
  38. package/static/assets/index-Djqsib7P.css +1 -0
  39. package/static/assets/index-Ds4IYSZ4.css +1 -0
  40. package/static/assets/index-Dzo0Xwn5.css +1 -0
  41. package/static/assets/index-L47Yb4hH.js +187 -0
  42. package/static/assets/index-NKfaEJl0.css +1 -0
  43. package/static/assets/index-U9Pdo8dD.js +214 -0
  44. package/static/assets/index-UVEGH1D3.css +1 -0
  45. package/static/assets/index-mZYiGRwU.css +1 -0
  46. package/static/assets/index-pOjZ5m-I.js +247 -0
  47. package/static/assets/index-rCcLuTWw.js +216 -0
  48. package/static/index.html +21 -0
@@ -0,0 +1,217 @@
1
+ var ay=Object.defineProperty;var ly=(t,r,i)=>r in t?ay(t,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[r]=i;var ga=(t,r,i)=>ly(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 uy=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 Uh;function cy(){if(Uh)return ht;Uh=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"),m=Symbol.for("react.forward_ref"),v=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,T={};function $(A,U,be){this.props=A,this.context=U,this.refs=T,this.updater=be||C}$.prototype.isReactComponent={},$.prototype.setState=function(A,U){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,U,"setState")},$.prototype.forceUpdate=function(A){this.updater.enqueueForceUpdate(this,A,"forceUpdate")};function I(){}I.prototype=$.prototype;function K(A,U,be){this.props=A,this.context=U,this.refs=T,this.updater=be||C}var P=K.prototype=new I;P.constructor=K,j(P,$.prototype),P.isPureReactComponent=!0;var R=Array.isArray,Y=Object.prototype.hasOwnProperty,V={current:null},B={key:!0,ref:!0,__self:!0,__source:!0};function ae(A,U,be){var Se,Me={},$e=null,Ae=null;if(U!=null)for(Se in U.ref!==void 0&&(Ae=U.ref),U.key!==void 0&&($e=""+U.key),U)Y.call(U,Se)&&!B.hasOwnProperty(Se)&&(Me[Se]=U[Se]);var _e=arguments.length-2;if(_e===1)Me.children=be;else if(1<_e){for(var Be=Array(_e),ke=0;ke<_e;ke++)Be[ke]=arguments[ke+2];Me.children=Be}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:$e,ref:Ae,props:Me,_owner:V.current}}function de(A,U){return{$$typeof:t,type:A.type,key:U,ref:A.ref,props:A.props,_owner:A._owner}}function we(A){return typeof A=="object"&&A!==null&&A.$$typeof===t}function H(A){var U={"=":"=0",":":"=2"};return"$"+A.replace(/[=:]/g,function(be){return U[be]})}var fe=/\/+/g;function xe(A,U){return typeof A=="object"&&A!==null&&A.key!=null?H(""+A.key):U.toString(36)}function D(A,U,be,Se,Me){var $e=typeof A;($e==="undefined"||$e==="boolean")&&(A=null);var Ae=!1;if(A===null)Ae=!0;else switch($e){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,"$&/")+"/"),D(Me,U,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)),U.push(Me)),1;if(Ae=0,Se=Se===""?".":Se+":",R(A))for(var _e=0;_e<A.length;_e++){$e=A[_e];var Be=Se+xe($e,_e);Ae+=D($e,U,be,Be,Me)}else if(Be=S(A),typeof Be=="function")for(A=Be.call(A),_e=0;!($e=A.next()).done;)$e=$e.value,Be=Se+xe($e,_e++),Ae+=D($e,U,be,Be,Me);else if($e==="object")throw U=String(A),Error("Objects are not valid as a React child (found: "+(U==="[object Object]"?"object with keys {"+Object.keys(A).join(", ")+"}":U)+"). If you meant to render a collection of children, use an array instead.");return Ae}function ue(A,U,be){if(A==null)return A;var Se=[],Me=0;return D(A,Se,"","",function($e){return U.call(be,$e,Me++)}),Se}function G(A){if(A._status===-1){var U=A._result;U=U(),U.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=U)}if(A._status===1)return A._result.default;throw A._result}var ie={current:null},z={transition:null},q={ReactCurrentDispatcher:ie,ReactCurrentBatchConfig:z,ReactCurrentOwner:V};function F(){throw Error("act(...) is not supported in production builds of React.")}return ht.Children={map:ue,forEach:function(A,U,be){ue(A,function(){U.apply(this,arguments)},be)},count:function(A){var U=0;return ue(A,function(){U++}),U},toArray:function(A){return ue(A,function(U){return U})||[]},only:function(A){if(!we(A))throw Error("React.Children.only expected to receive a single React element child.");return A}},ht.Component=$,ht.Fragment=i,ht.Profiler=l,ht.PureComponent=K,ht.StrictMode=s,ht.Suspense=v,ht.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=q,ht.act=F,ht.cloneElement=function(A,U,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,$e=A.ref,Ae=A._owner;if(U!=null){if(U.ref!==void 0&&($e=U.ref,Ae=V.current),U.key!==void 0&&(Me=""+U.key),A.type&&A.type.defaultProps)var _e=A.type.defaultProps;for(Be in U)Y.call(U,Be)&&!B.hasOwnProperty(Be)&&(Se[Be]=U[Be]===void 0&&_e!==void 0?_e[Be]:U[Be])}var Be=arguments.length-2;if(Be===1)Se.children=be;else if(1<Be){_e=Array(Be);for(var ke=0;ke<Be;ke++)_e[ke]=arguments[ke+2];Se.children=_e}return{$$typeof:t,type:A.type,key:Me,ref:$e,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=ae,ht.createFactory=function(A){var U=ae.bind(null,A);return U.type=A,U},ht.createRef=function(){return{current:null}},ht.forwardRef=function(A){return{$$typeof:m,render:A}},ht.isValidElement=we,ht.lazy=function(A){return{$$typeof:k,_payload:{_status:-1,_result:A},_init:G}},ht.memo=function(A,U){return{$$typeof:b,type:A,compare:U===void 0?null:U}},ht.startTransition=function(A){var U=z.transition;z.transition={};try{A()}finally{z.transition=U}},ht.unstable_act=F,ht.useCallback=function(A,U){return ie.current.useCallback(A,U)},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,U){return ie.current.useEffect(A,U)},ht.useId=function(){return ie.current.useId()},ht.useImperativeHandle=function(A,U,be){return ie.current.useImperativeHandle(A,U,be)},ht.useInsertionEffect=function(A,U){return ie.current.useInsertionEffect(A,U)},ht.useLayoutEffect=function(A,U){return ie.current.useLayoutEffect(A,U)},ht.useMemo=function(A,U){return ie.current.useMemo(A,U)},ht.useReducer=function(A,U,be){return ie.current.useReducer(A,U,be)},ht.useRef=function(A){return ie.current.useRef(A)},ht.useState=function(A){return ie.current.useState(A)},ht.useSyncExternalStore=function(A,U,be){return ie.current.useSyncExternalStore(A,U,be)},ht.useTransition=function(){return ie.current.useTransition()},ht.version="18.3.1",ht}var qh;function $a(){return qh||(qh=1,Jc.exports=cy()),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 Wh;function fy(){if(Wh)return ya;Wh=1;var t=$a(),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(m,v,b){var k,w={},S=null,C=null;b!==void 0&&(S=""+b),v.key!==void 0&&(S=""+v.key),v.ref!==void 0&&(C=v.ref);for(k in v)s.call(v,k)&&!c.hasOwnProperty(k)&&(w[k]=v[k]);if(m&&m.defaultProps)for(k in v=m.defaultProps,v)w[k]===void 0&&(w[k]=v[k]);return{$$typeof:r,type:m,key:S,ref:C,props:w,_owner:l.current}}return ya.Fragment=i,ya.jsx=d,ya.jsxs=d,ya}var Yh;function dy(){return Yh||(Yh=1,Gc.exports=fy()),Gc.exports}var x=dy(),Q=$a();const gm=wu(Q);var Vl={},Zc={exports:{}},Fn={},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 Xh;function hy(){return Xh||(Xh=1,(function(t){function r(z,q){var F=z.length;z.push(q);e:for(;0<F;){var A=F-1>>>1,U=z[A];if(0<l(U,q))z[A]=q,z[F]=U,F=A;else break e}}function i(z){return z.length===0?null:z[0]}function s(z){if(z.length===0)return null;var q=z[0],F=z.pop();if(F!==q){z[0]=F;e:for(var A=0,U=z.length,be=U>>>1;A<be;){var Se=2*(A+1)-1,Me=z[Se],$e=Se+1,Ae=z[$e];if(0>l(Me,F))$e<U&&0>l(Ae,Me)?(z[A]=Ae,z[$e]=F,A=$e):(z[A]=Me,z[Se]=F,A=Se);else if($e<U&&0>l(Ae,F))z[A]=Ae,z[$e]=F,A=$e;else break e}}return q}function l(z,q){var F=z.sortIndex-q.sortIndex;return F!==0?F:z.id-q.id}if(typeof performance=="object"&&typeof performance.now=="function"){var c=performance;t.unstable_now=function(){return c.now()}}else{var d=Date,m=d.now();t.unstable_now=function(){return d.now()-m}}var v=[],b=[],k=1,w=null,S=3,C=!1,j=!1,T=!1,$=typeof setTimeout=="function"?setTimeout:null,I=typeof clearTimeout=="function"?clearTimeout:null,K=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(z){for(var q=i(b);q!==null;){if(q.callback===null)s(b);else if(q.startTime<=z)s(b),q.sortIndex=q.expirationTime,r(v,q);else break;q=i(b)}}function R(z){if(T=!1,P(z),!j)if(i(v)!==null)j=!0,G(Y);else{var q=i(b);q!==null&&ie(R,q.startTime-z)}}function Y(z,q){j=!1,T&&(T=!1,I(ae),ae=-1),C=!0;var F=S;try{for(P(q),w=i(v);w!==null&&(!(w.expirationTime>q)||z&&!H());){var A=w.callback;if(typeof A=="function"){w.callback=null,S=w.priorityLevel;var U=A(w.expirationTime<=q);q=t.unstable_now(),typeof U=="function"?w.callback=U:w===i(v)&&s(v),P(q)}else s(v);w=i(v)}if(w!==null)var be=!0;else{var Se=i(b);Se!==null&&ie(R,Se.startTime-q),be=!1}return be}finally{w=null,S=F,C=!1}}var V=!1,B=null,ae=-1,de=5,we=-1;function H(){return!(t.unstable_now()-we<de)}function fe(){if(B!==null){var z=t.unstable_now();we=z;var q=!0;try{q=B(!0,z)}finally{q?xe():(V=!1,B=null)}}else V=!1}var xe;if(typeof K=="function")xe=function(){K(fe)};else if(typeof MessageChannel<"u"){var D=new MessageChannel,ue=D.port2;D.port1.onmessage=fe,xe=function(){ue.postMessage(null)}}else xe=function(){$(fe,0)};function G(z){B=z,V||(V=!0,xe())}function ie(z,q){ae=$(function(){z(t.unstable_now())},q)}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(z){z.callback=null},t.unstable_continueExecution=function(){j||C||(j=!0,G(Y))},t.unstable_forceFrameRate=function(z){0>z||125<z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):de=0<z?Math.floor(1e3/z):5},t.unstable_getCurrentPriorityLevel=function(){return S},t.unstable_getFirstCallbackNode=function(){return i(v)},t.unstable_next=function(z){switch(S){case 1:case 2:case 3:var q=3;break;default:q=S}var F=S;S=q;try{return z()}finally{S=F}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(z,q){switch(z){case 1:case 2:case 3:case 4:case 5:break;default:z=3}var F=S;S=z;try{return q()}finally{S=F}},t.unstable_scheduleCallback=function(z,q,F){var A=t.unstable_now();switch(typeof F=="object"&&F!==null?(F=F.delay,F=typeof F=="number"&&0<F?A+F:A):F=A,z){case 1:var U=-1;break;case 2:U=250;break;case 5:U=1073741823;break;case 4:U=1e4;break;default:U=5e3}return U=F+U,z={id:k++,callback:q,priorityLevel:z,startTime:F,expirationTime:U,sortIndex:-1},F>A?(z.sortIndex=F,r(b,z),i(v)===null&&z===i(b)&&(T?(I(ae),ae=-1):T=!0,ie(R,F-A))):(z.sortIndex=U,r(v,z),j||C||(j=!0,G(Y))),z},t.unstable_shouldYield=H,t.unstable_wrapCallback=function(z){var q=S;return function(){var F=S;S=q;try{return z.apply(this,arguments)}finally{S=F}}}})(tf)),tf}var Qh;function py(){return Qh||(Qh=1,ef.exports=hy()),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 Gh;function my(){if(Gh)return Fn;Gh=1;var t=$a(),r=py();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 m=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),v=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 v.call(w,e)?!0:v.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 T(e,n,o,u,h,g,E){this.acceptsBooleans=n===2||n===3||n===4,this.attributeName=u,this.attributeNamespace=h,this.mustUseProperty=o,this.propertyName=e,this.type=n,this.sanitizeURL=g,this.removeEmptyString=E}var $={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){$[e]=new T(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var n=e[0];$[n]=new T(n,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){$[e]=new T(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){$[e]=new T(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){$[e]=new T(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){$[e]=new T(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){$[e]=new T(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){$[e]=new T(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){$[e]=new T(e,5,!1,e.toLowerCase(),null,!1,!1)});var I=/[\-:]([a-z])/g;function K(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,K);$[n]=new T(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,K);$[n]=new T(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,K);$[n]=new T(n,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){$[e]=new T(e,1,!1,e.toLowerCase(),null,!1,!1)}),$.xlinkHref=new T("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){$[e]=new T(e,1,!1,e.toLowerCase(),null,!0,!0)});function P(e,n,o,u){var h=$.hasOwnProperty(n)?$[n]:null;(h!==null?h.type!==0:u||!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(j(n,o,h,u)&&(o=null),u||h===null?S(n)&&(o===null?e.removeAttribute(n):e.setAttribute(n,""+o)):h.mustUseProperty?e[h.propertyName]=o===null?h.type===3?!1:"":o:(n=h.attributeName,u=h.attributeNamespace,o===null?e.removeAttribute(n):(h=h.type,o=h===3||h===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,Y=Symbol.for("react.element"),V=Symbol.for("react.portal"),B=Symbol.for("react.fragment"),ae=Symbol.for("react.strict_mode"),de=Symbol.for("react.profiler"),we=Symbol.for("react.provider"),H=Symbol.for("react.context"),fe=Symbol.for("react.forward_ref"),xe=Symbol.for("react.suspense"),D=Symbol.for("react.suspense_list"),ue=Symbol.for("react.memo"),G=Symbol.for("react.lazy"),ie=Symbol.for("react.offscreen"),z=Symbol.iterator;function q(e){return e===null||typeof e!="object"?null:(e=z&&e[z]||e["@@iterator"],typeof e=="function"?e:null)}var F=Object.assign,A;function U(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 h=ye.stack.split(`
35
+ `),g=u.stack.split(`
36
+ `),E=h.length-1,L=g.length-1;1<=E&&0<=L&&h[E]!==g[L];)L--;for(;1<=E&&0<=L;E--,L--)if(h[E]!==g[L]){if(E!==1||L!==1)do if(E--,L--,0>L||h[E]!==g[L]){var X=`
37
+ `+h[E].replace(" at new "," at ");return e.displayName&&X.includes("<anonymous>")&&(X=X.replace("<anonymous>",e.displayName)),X}while(1<=E&&0<=L);break}}}finally{be=!1,Error.prepareStackTrace=o}return(e=e?e.displayName||e.name:"")?U(e):""}function Me(e){switch(e.tag){case 5:return U(e.type);case 16:return U("Lazy");case 13:return U("Suspense");case 19:return U("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 $e(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 B:return"Fragment";case V:return"Portal";case de:return"Profiler";case ae:return"StrictMode";case xe:return"Suspense";case D:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case H: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 ue:return n=e.displayName||null,n!==null?n:$e(e.type)||"Memo";case G:n=e._payload,e=e._init;try{return $e(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 $e(n);case 8:return n===ae?"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 Be(e){var n=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function ke(e){var n=Be(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 h=o.get,g=o.set;return Object.defineProperty(e,n,{configurable:!0,get:function(){return h.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 He(e){e._valueTracker||(e._valueTracker=ke(e))}function Oe(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var o=n.getValue(),u="";return e&&(u=Be(e)?e.checked?"true":"false":e.value),e=u,e!==o?(n.setValue(e),!0):!1}function qe(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 ut(e,n){var o=n.checked;return F({},n,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:o??e._wrapperState.initialChecked})}function ct(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 Tt(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")?Ht(e,n.type,o):n.hasOwnProperty("defaultValue")&&Ht(e,n.type,_e(n.defaultValue)),n.checked==null&&n.defaultChecked!=null&&(e.defaultChecked=!!n.defaultChecked)}function _t(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 Ht(e,n,o){(n!=="number"||qe(e.ownerDocument)!==e)&&(o==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+o&&(e.defaultValue=""+o))}var Ot=Array.isArray;function St(e,n,o,u){if(e=e.options,n){n={};for(var h=0;h<o.length;h++)n["$"+o[h]]=!0;for(o=0;o<e.length;o++)h=n.hasOwnProperty("$"+e[o].value),e[o].selected!==h&&(e[o].selected=h),h&&u&&(e[o].defaultSelected=!0)}else{for(o=""+_e(o),n=null,h=0;h<e.length;h++){if(e[h].value===o){e[h].selected=!0,u&&(e[h].defaultSelected=!0);return}n!==null||e[h].disabled||(n=e[h])}n!==null&&(n.selected=!0)}}function bn(e,n){if(n.dangerouslySetInnerHTML!=null)throw Error(i(91));return F({},n,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function fn(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(Ot(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 gr(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 _n(e){var n=e.textContent;n===e._wrapperState.initialValue&&n!==""&&n!==null&&(e.value=n)}function Nt(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 Vt(e,n){return e==null||e==="http://www.w3.org/1999/xhtml"?Nt(n):e==="http://www.w3.org/2000/svg"&&n==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Hn,tr=(function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(n,o,u,h){MSApp.execUnsafeLocalFunction(function(){return e(n,o,u,h)})}: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 Pn={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},Vn=["Webkit","ms","Moz","O"];Object.keys(Pn).forEach(function(e){Vn.forEach(function(n){n=n+e.charAt(0).toUpperCase()+e.substring(1),Pn[n]=Pn[e]})});function dn(e,n,o){return n==null||typeof n=="boolean"||n===""?"":o||typeof n!="number"||n===0||Pn.hasOwnProperty(e)&&Pn[e]?(""+n).trim():n+"px"}function nr(e,n){e=e.style;for(var o in n)if(n.hasOwnProperty(o)){var u=o.indexOf("--")===0,h=dn(o,n[o],u);o==="float"&&(o="cssFloat"),u?e.setProperty(o,h):e[o]=h}}var kn=F({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 Ye(e,n){if(n){if(kn[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 Kn(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 Nn=null;function rr(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ve=null,Mn=null,Un=null;function yr(e){if(e=ta(e)){if(typeof Ve!="function")throw Error(i(280));var n=e.stateNode;n&&(n=ol(n),Ve(e.stateNode,e.type,n))}}function Zr(e){Mn?Un?Un.push(e):Un=[e]:Mn=e}function vr(){if(Mn){var e=Mn,n=Un;if(Un=Mn=null,yr(e),n)for(e=0;e<n.length;e++)yr(n[e])}}function Io(e,n){return e(n)}function eo(){}var hn=!1;function Tn(e,n,o){if(hn)return e(n,o);hn=!0;try{return Io(e,n,o)}finally{hn=!1,(Mn!==null||Un!==null)&&(eo(),vr())}}function W(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 Fe=!1;if(m)try{var Le={};Object.defineProperty(Le,"passive",{get:function(){Fe=!0}}),window.addEventListener("test",Le,Le),window.removeEventListener("test",Le,Le)}catch{Fe=!1}function nt(e,n,o,u,h,g,E,L,X){var ye=Array.prototype.slice.call(arguments,3);try{n.apply(o,ye)}catch(Pe){this.onError(Pe)}}var nn=!1,Yt=null,Kt=!1,rn=null,to={onError:function(e){nn=!0,Yt=e}};function on(e,n,o,u,h,g,E,L,X){nn=!1,Yt=null,nt.apply(to,arguments)}function qn(e,n,o,u,h,g,E,L,X){if(on.apply(this,arguments),nn){if(nn){var ye=Yt;nn=!1,Yt=null}else throw Error(i(198));Kt||(Kt=!0,rn=ye)}}function zt(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 Wn(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 or(e){if(zt(e)!==e)throw Error(i(188))}function In(e){var n=e.alternate;if(!n){if(n=zt(e),n===null)throw Error(i(188));return n!==e?null:e}for(var o=e,u=n;;){var h=o.return;if(h===null)break;var g=h.alternate;if(g===null){if(u=h.return,u!==null){o=u;continue}break}if(h.child===g.child){for(g=h.child;g;){if(g===o)return or(h),e;if(g===u)return or(h),n;g=g.sibling}throw Error(i(188))}if(o.return!==u.return)o=h,u=g;else{for(var E=!1,L=h.child;L;){if(L===o){E=!0,o=h,u=g;break}if(L===u){E=!0,u=h,o=g;break}L=L.sibling}if(!E){for(L=g.child;L;){if(L===o){E=!0,o=g,u=h;break}if(L===u){E=!0,u=g,o=h;break}L=L.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 ui(e){return e=In(e),e!==null?ir(e):null}function ir(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var n=ir(e);if(n!==null)return n;e=e.sibling}return null}var ci=r.unstable_scheduleCallback,$o=r.unstable_cancelCallback,Et=r.unstable_shouldYield,sr=r.unstable_requestPaint,gt=r.unstable_now,Bi=r.unstable_getCurrentPriorityLevel,Dr=r.unstable_ImmediatePriority,Ao=r.unstable_UserBlockingPriority,Lr=r.unstable_NormalPriority,xr=r.unstable_LowPriority,fi=r.unstable_IdlePriority,ar=null,En=null;function ft(e){if(En&&typeof En.onCommitFiberRoot=="function")try{En.onCommitFiberRoot(ar,e,void 0,(e.current.flags&128)===128)}catch{}}var pn=Math.clz32?Math.clz32:no,Hi=Math.log,Oo=Math.LN2;function no(e){return e>>>=0,e===0?32:31-(Hi(e)/Oo|0)|0}var ro=64,oo=4194304;function Yn(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 yt(e,n){var o=e.pendingLanes;if(o===0)return 0;var u=0,h=e.suspendedLanes,g=e.pingedLanes,E=o&268435455;if(E!==0){var L=E&~h;L!==0?u=Yn(L):(g&=E,g!==0&&(u=Yn(g)))}else E=o&~h,E!==0?u=Yn(E):g!==0&&(u=Yn(g));if(u===0)return 0;if(n!==0&&n!==u&&(n&h)===0&&(h=u&-u,g=n&-n,h>=g||h===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-pn(n),h=1<<o,u|=e[o],n&=~h;return u}function zr(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 io(e,n){for(var o=e.suspendedLanes,u=e.pingedLanes,h=e.expirationTimes,g=e.pendingLanes;0<g;){var E=31-pn(g),L=1<<E,X=h[E];X===-1?((L&o)===0||(L&u)!==0)&&(h[E]=zr(L,n)):X<=n&&(e.expiredLanes|=L),g&=~L}}function lr(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Fr(){var e=ro;return ro<<=1,(ro&4194240)===0&&(ro=64),e}function so(e){for(var n=[],o=0;31>o;o++)n.push(e);return n}function ur(e,n,o){e.pendingLanes|=n,n!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,n=31-pn(n),e[n]=o}function di(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 h=31-pn(o),g=1<<h;n[h]=0,u[h]=-1,e[h]=-1,o&=~g}}function Ro(e,n){var o=e.entangledLanes|=n;for(e=e.entanglements;o;){var u=31-pn(o),h=1<<u;h&n|e[u]&n&&(e[u]|=n),o&=~h}}var xt=0;function Ba(e){return e&=-e,1<e?4<e?(e&268435455)!==0?16:536870912:4:1}var pt,Vi,Ha,Va,mn,Br=!1,ao=[],sn=null,wr=null,br=null,It=new Map,an=new Map,$n=[],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 Ki(e,n){switch(e){case"focusin":case"focusout":sn=null;break;case"dragenter":case"dragleave":wr=null;break;case"mouseover":case"mouseout":br=null;break;case"pointerover":case"pointerout":It.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":an.delete(n.pointerId)}}function An(e,n,o,u,h,g){return e===null||e.nativeEvent!==g?(e={blockedOn:n,domEventName:o,eventSystemFlags:u,nativeEvent:g,targetContainers:[h]},n!==null&&(n=ta(n),n!==null&&Vi(n)),e):(e.eventSystemFlags|=u,n=e.targetContainers,h!==null&&n.indexOf(h)===-1&&n.push(h),e)}function Ou(e,n,o,u,h){switch(n){case"focusin":return sn=An(sn,e,n,o,u,h),!0;case"dragenter":return wr=An(wr,e,n,o,u,h),!0;case"mouseover":return br=An(br,e,n,o,u,h),!0;case"pointerover":var g=h.pointerId;return It.set(g,An(It.get(g)||null,e,n,o,u,h)),!0;case"gotpointercapture":return g=h.pointerId,an.set(g,An(an.get(g)||null,e,n,o,u,h)),!0}return!1}function Xn(e){var n=bi(e.target);if(n!==null){var o=zt(n);if(o!==null){if(n=o.tag,n===13){if(n=Wn(o),n!==null){e.blockedOn=n,mn(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 Do(e){if(e.blockedOn!==null)return!1;for(var n=e.targetContainers;0<n.length;){var o=Lo(e.domEventName,e.eventSystemFlags,n[0],e.nativeEvent);if(o===null){o=e.nativeEvent;var u=new o.constructor(o.type,o);Nn=u,o.target.dispatchEvent(u),Nn=null}else return n=ta(o),n!==null&&Vi(n),e.blockedOn=o,!1;n.shift()}return!0}function Ds(e,n,o){Do(e)&&o.delete(n)}function Ls(){Br=!1,sn!==null&&Do(sn)&&(sn=null),wr!==null&&Do(wr)&&(wr=null),br!==null&&Do(br)&&(br=null),It.forEach(Ds),an.forEach(Ds)}function _r(e,n){e.blockedOn===n&&(e.blockedOn=null,Br||(Br=!0,r.unstable_scheduleCallback(r.unstable_NormalPriority,Ls)))}function lo(e){function n(h){return _r(h,e)}if(0<ao.length){_r(ao[0],e);for(var o=1;o<ao.length;o++){var u=ao[o];u.blockedOn===e&&(u.blockedOn=null)}}for(sn!==null&&_r(sn,e),wr!==null&&_r(wr,e),br!==null&&_r(br,e),It.forEach(n),an.forEach(n),o=0;o<$n.length;o++)u=$n[o],u.blockedOn===e&&(u.blockedOn=null);for(;0<$n.length&&(o=$n[0],o.blockedOn===null);)Xn(o),o.blockedOn===null&&$n.shift()}var uo=R.ReactCurrentBatchConfig,Ui=!0;function pi(e,n,o,u){var h=xt,g=uo.transition;uo.transition=null;try{xt=1,zs(e,n,o,u)}finally{xt=h,uo.transition=g}}function Ru(e,n,o,u){var h=xt,g=uo.transition;uo.transition=null;try{xt=4,zs(e,n,o,u)}finally{xt=h,uo.transition=g}}function zs(e,n,o,u){if(Ui){var h=Lo(e,n,o,u);if(h===null)Bu(e,n,u,co,o),Ki(e,u);else if(Ou(h,e,n,o,u))u.stopPropagation();else if(Ki(e,u),n&4&&-1<hi.indexOf(e)){for(;h!==null;){var g=ta(h);if(g!==null&&pt(g),g=Lo(e,n,o,u),g===null&&Bu(e,n,u,co,o),g===h)break;h=g}h!==null&&u.stopPropagation()}else Bu(e,n,u,null,o)}}var co=null;function Lo(e,n,o,u){if(co=null,e=rr(u),e=bi(e),e!==null)if(n=zt(e),n===null)e=null;else if(o=n.tag,o===13){if(e=Wn(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 co=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(Bi()){case Dr:return 1;case Ao:return 4;case Lr:case xr:return 16;case fi:return 536870912;default:return 16}default:return 16}}var Hr=null,Fs=null,Wi=null;function Yi(){if(Wi)return Wi;var e,n=Fs,o=n.length,u,h="value"in Hr?Hr.value:Hr.textContent,g=h.length;for(e=0;e<o&&n[e]===h[e];e++);var E=o-e;for(u=1;u<=E&&n[o-u]===h[g-u];u++);return Wi=h.slice(e,1<u?1-u:void 0)}function zo(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 mi(){return!0}function gi(){return!1}function Gt(e){function n(o,u,h,g,E){this._reactName=o,this._targetInst=h,this.type=u,this.nativeEvent=g,this.target=E,this.currentTarget=null;for(var L in e)e.hasOwnProperty(L)&&(o=e[L],this[L]=o?o(g):g[L]);return this.isDefaultPrevented=(g.defaultPrevented!=null?g.defaultPrevented:g.returnValue===!1)?mi:gi,this.isPropagationStopped=gi,this}return F(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=mi)},stopPropagation:function(){var o=this.nativeEvent;o&&(o.stopPropagation?o.stopPropagation():typeof o.cancelBubble!="unknown"&&(o.cancelBubble=!0),this.isPropagationStopped=mi)},persist:function(){},isPersistent:mi}),n}var Sr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Xi=Gt(Sr),yi=F({},Sr,{view:0,detail:0}),Fo=Gt(yi),fo,vi,ho,Bo=F({},yi,{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!==ho&&(ho&&e.type==="mousemove"?(fo=e.screenX-ho.screenX,vi=e.screenY-ho.screenY):vi=fo=0,ho=e),fo)},movementY:function(e){return"movementY"in e?e.movementY:vi}}),Qi=Gt(Bo),Jt=F({},Bo,{dataTransfer:0}),xi=Gt(Jt),wi=F({},yi,{relatedTarget:0}),Gi=Gt(wi),Ji=F({},Sr,{animationName:0,elapsedTime:0,pseudoElement:0}),Ka=Gt(Ji),Ua=F({},Sr,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Zi=Gt(Ua),Bs=F({},Sr,{data:0}),Vr=Gt(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 Ks(e){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(e):(e=es[e])?!!n[e]:!1}function ts(){return Ks}var Du=F({},yi,{key:function(e){if(e.key){var n=Hs[e.key]||e.key;if(n!=="Unidentified")return n}return e.type==="keypress"?(e=zo(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"?zo(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?zo(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Us=Gt(Du),ns=F({},Bo,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),qa=Gt(ns),qs=F({},yi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ts}),Ws=Gt(qs),Lu=F({},Sr,{propertyName:0,elapsedTime:0,pseudoElement:0}),Wa=Gt(Lu),zu=F({},Bo,{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=Gt(zu),Xa=[9,13,27,32],Ys=m&&"CompositionEvent"in window,Ho=null;m&&"documentMode"in document&&(Ho=document.documentMode);var Xs=m&&"TextEvent"in window&&!Ho,Qs=m&&(!Ys||Ho&&8<Ho&&11>=Ho),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 kr=!1;function Nr(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 Rt(e,n){if(kr)return e==="compositionend"||!Ys&&Ga(e,n)?(e=Yi(),Wi=Fs=Hr=null,kr=!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 po(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n==="input"?!!rs[e.type]:n==="textarea"}function Za(e,n,o,u){Zr(u),n=tl(n,"onChange"),0<n.length&&(o=new Xi("onChange","change",null,o,u),e.push({event:o,listeners:n}))}var mo=null,Vo=null;function go(e){ad(e,0)}function Ko(e){var n=as(e);if(Oe(n))return e}function Uo(e,n){if(e==="change")return n}var Er=!1;if(m){var os;if(m){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;Er=os&&(!document.documentMode||9<document.documentMode)}function p(){mo&&(mo.detachEvent("onpropertychange",y),Vo=mo=null)}function y(e){if(e.propertyName==="value"&&Ko(Vo)){var n=[];Za(n,Vo,e,rr(e)),Tn(go,n)}}function _(e,n,o){e==="focusin"?(p(),mo=n,Vo=o,mo.attachEvent("onpropertychange",y)):e==="focusout"&&p()}function N(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ko(Vo)}function M(e,n){if(e==="click")return Ko(n)}function O(e,n){if(e==="input"||e==="change")return Ko(n)}function Z(e,n){return e===n&&(e!==0||1/e===1/n)||e!==e&&n!==n}var ce=typeof Object.is=="function"?Object.is:Z;function te(e,n){if(ce(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 h=o[u];if(!v.call(n,h)||!ce(e[h],n[h]))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 le(e,n){return e&&n?e===n?!0:e&&e.nodeType===3?!1:n&&n.nodeType===3?le(e,n.parentNode):"contains"in e?e.contains(n):e.compareDocumentPosition?!!(e.compareDocumentPosition(n)&16):!1:!1}function oe(){for(var e=window,n=qe();n instanceof e.HTMLIFrameElement;){try{var o=typeof n.contentWindow.location.href=="string"}catch{o=!1}if(o)e=n.contentWindow;else break;n=qe(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&&le(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 h=o.textContent.length,g=Math.min(u.start,h);u=u.end===void 0?g:Math.min(u.end,h),!e.extend&&g>u&&(h=u,u=g,g=h),h=ee(o,g);var E=ee(o,u);h&&E&&(e.rangeCount!==1||e.anchorNode!==h.node||e.anchorOffset!==h.offset||e.focusNode!==E.node||e.focusOffset!==E.offset)&&(n=n.createRange(),n.setStart(h.node,h.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=m&&"documentMode"in document&&11>=document.documentMode,he=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||he==null||he!==qe(u)||(u=he,"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=he)))}function Te(e,n){var o={};return o[e.toLowerCase()]=n.toLowerCase(),o["Webkit"+e]="webkit"+n,o["Moz"+e]="moz"+n,o}var Ke={animationend:Te("Animation","AnimationEnd"),animationiteration:Te("Animation","AnimationIteration"),animationstart:Te("Animation","AnimationStart"),transitionend:Te("Transition","TransitionEnd")},Re={},We={};m&&(We=document.createElement("div").style,"AnimationEvent"in window||(delete Ke.animationend.animation,delete Ke.animationiteration.animation,delete Ke.animationstart.animation),"TransitionEvent"in window||delete Ke.transitionend.transition);function Ee(e){if(Re[e])return Re[e];if(!Ke[e])return e;var n=Ke[e],o;for(o in n)if(n.hasOwnProperty(o)&&o in We)return Re[e]=n[o];return e}var rt=Ee("animationend"),ot=Ee("animationiteration"),lt=Ee("animationstart"),dt=Ee("transitionend"),gn=new Map,at="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 Ct(e,n){gn.set(e,n),c(n,[e])}for(var Ut=0;Ut<at.length;Ut++){var qo=at[Ut],ln=qo.toLowerCase(),yo=qo[0].toUpperCase()+qo.slice(1);Ct(ln,"on"+yo)}Ct(rt,"onAnimationEnd"),Ct(ot,"onAnimationIteration"),Ct(lt,"onAnimationStart"),Ct("dblclick","onDoubleClick"),Ct("focusin","onFocus"),Ct("focusout","onBlur"),Ct(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 vo="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(" "),vg=new Set("cancel close invalid load scroll toggle".split(" ").concat(vo));function sd(e,n,o){var u=e.type||"unknown-event";e.currentTarget=o,qn(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],h=u.event;u=u.listeners;e:{var g=void 0;if(n)for(var E=u.length-1;0<=E;E--){var L=u[E],X=L.instance,ye=L.currentTarget;if(L=L.listener,X!==g&&h.isPropagationStopped())break e;sd(h,L,ye),g=X}else for(E=0;E<u.length;E++){if(L=u[E],X=L.instance,ye=L.currentTarget,L=L.listener,X!==g&&h.isPropagationStopped())break e;sd(h,L,ye),g=X}}}if(Kt)throw e=rn,Kt=!1,rn=null,e}function jt(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"&&(vg.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 h=pi;break;case 4:h=Ru;break;default:h=zs}o=h.bind(null,n,o,e),h=void 0,!Fe||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(h=!0),u?h!==void 0?e.addEventListener(n,o,{capture:!0,passive:h}):e.addEventListener(n,o,!0):h!==void 0?e.addEventListener(n,o,{passive:h}):e.addEventListener(n,o,!1)}function Bu(e,n,o,u,h){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 L=u.stateNode.containerInfo;if(L===h||L.nodeType===8&&L.parentNode===h)break;if(E===4)for(E=u.return;E!==null;){var X=E.tag;if((X===3||X===4)&&(X=E.stateNode.containerInfo,X===h||X.nodeType===8&&X.parentNode===h))return;E=E.return}for(;L!==null;){if(E=bi(L),E===null)return;if(X=E.tag,X===5||X===6){u=g=E;continue e}L=L.parentNode}}u=u.return}Tn(function(){var ye=g,Pe=rr(o),Ie=[];e:{var je=gn.get(e);if(je!==void 0){var Ue=Xi,Qe=e;switch(e){case"keypress":if(zo(o)===0)break e;case"keydown":case"keyup":Ue=Us;break;case"focusin":Qe="focus",Ue=Gi;break;case"focusout":Qe="blur",Ue=Gi;break;case"beforeblur":case"afterblur":Ue=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":Ue=Qi;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Ue=xi;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Ue=Ws;break;case rt:case ot:case lt:Ue=Ka;break;case dt:Ue=Wa;break;case"scroll":Ue=Fo;break;case"wheel":Ue=Ya;break;case"copy":case"cut":case"paste":Ue=Zi;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Ue=qa}var Ge=(n&4)!==0,Bt=!Ge&&e==="scroll",pe=Ge?je!==null?je+"Capture":null:je;Ge=[];for(var ne=ye,me;ne!==null;){me=ne;var ze=me.stateNode;if(me.tag===5&&ze!==null&&(me=ze,pe!==null&&(ze=W(ne,pe),ze!=null&&Ge.push(Zs(ne,ze,me)))),Bt)break;ne=ne.return}0<Ge.length&&(je=new Ue(je,Qe,null,o,Pe),Ie.push({event:je,listeners:Ge}))}}if((n&7)===0){e:{if(je=e==="mouseover"||e==="pointerover",Ue=e==="mouseout"||e==="pointerout",je&&o!==Nn&&(Qe=o.relatedTarget||o.fromElement)&&(bi(Qe)||Qe[xo]))break e;if((Ue||je)&&(je=Pe.window===Pe?Pe:(je=Pe.ownerDocument)?je.defaultView||je.parentWindow:window,Ue?(Qe=o.relatedTarget||o.toElement,Ue=ye,Qe=Qe?bi(Qe):null,Qe!==null&&(Bt=zt(Qe),Qe!==Bt||Qe.tag!==5&&Qe.tag!==6)&&(Qe=null)):(Ue=null,Qe=ye),Ue!==Qe)){if(Ge=Qi,ze="onMouseLeave",pe="onMouseEnter",ne="mouse",(e==="pointerout"||e==="pointerover")&&(Ge=qa,ze="onPointerLeave",pe="onPointerEnter",ne="pointer"),Bt=Ue==null?je:as(Ue),me=Qe==null?je:as(Qe),je=new Ge(ze,ne+"leave",Ue,o,Pe),je.target=Bt,je.relatedTarget=me,ze=null,bi(Pe)===ye&&(Ge=new Ge(pe,ne+"enter",Qe,o,Pe),Ge.target=me,Ge.relatedTarget=Bt,ze=Ge),Bt=ze,Ue&&Qe)t:{for(Ge=Ue,pe=Qe,ne=0,me=Ge;me;me=is(me))ne++;for(me=0,ze=pe;ze;ze=is(ze))me++;for(;0<ne-me;)Ge=is(Ge),ne--;for(;0<me-ne;)pe=is(pe),me--;for(;ne--;){if(Ge===pe||pe!==null&&Ge===pe.alternate)break t;Ge=is(Ge),pe=is(pe)}Ge=null}else Ge=null;Ue!==null&&ud(Ie,je,Ue,Ge,!1),Qe!==null&&Bt!==null&&ud(Ie,Bt,Qe,Ge,!0)}}e:{if(je=ye?as(ye):window,Ue=je.nodeName&&je.nodeName.toLowerCase(),Ue==="select"||Ue==="input"&&je.type==="file")var Je=Uo;else if(po(je))if(Er)Je=O;else{Je=N;var et=_}else(Ue=je.nodeName)&&Ue.toLowerCase()==="input"&&(je.type==="checkbox"||je.type==="radio")&&(Je=M);if(Je&&(Je=Je(e,ye))){Za(Ie,Je,o,Pe);break e}et&&et(e,je,ye),e==="focusout"&&(et=je._wrapperState)&&et.controlled&&je.type==="number"&&Ht(je,"number",je.value)}switch(et=ye?as(ye):window,e){case"focusin":(po(et)||et.contentEditable==="true")&&(he=et,ve=ye,Ne=null);break;case"focusout":Ne=ve=he=null;break;case"mousedown":Ce=!0;break;case"contextmenu":case"mouseup":case"dragend":Ce=!1,De(Ie,o,Pe);break;case"selectionchange":if(ge)break;case"keydown":case"keyup":De(Ie,o,Pe)}var tt;if(Ys)e:{switch(e){case"compositionstart":var st="onCompositionStart";break e;case"compositionend":st="onCompositionEnd";break e;case"compositionupdate":st="onCompositionUpdate";break e}st=void 0}else kr?Ga(e,o)&&(st="onCompositionEnd"):e==="keydown"&&o.keyCode===229&&(st="onCompositionStart");st&&(Qs&&o.locale!=="ko"&&(kr||st!=="onCompositionStart"?st==="onCompositionEnd"&&kr&&(tt=Yi()):(Hr=Pe,Fs="value"in Hr?Hr.value:Hr.textContent,kr=!0)),et=tl(ye,st),0<et.length&&(st=new Vr(st,e,null,o,Pe),Ie.push({event:st,listeners:et}),tt?st.data=tt:(tt=Ja(o),tt!==null&&(st.data=tt)))),(tt=Xs?Nr(e,o):Rt(e,o))&&(ye=tl(ye,"onBeforeInput"),0<ye.length&&(Pe=new Vr("onBeforeInput","beforeinput",null,o,Pe),Ie.push({event:Pe,listeners:ye}),Pe.data=tt))}ad(Ie,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 h=e,g=h.stateNode;h.tag===5&&g!==null&&(h=g,g=W(e,o),g!=null&&u.unshift(Zs(e,g,h)),g=W(e,n),g!=null&&u.push(Zs(e,g,h))),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,h){for(var g=n._reactName,E=[];o!==null&&o!==u;){var L=o,X=L.alternate,ye=L.stateNode;if(X!==null&&X===u)break;L.tag===5&&ye!==null&&(L=ye,h?(X=W(o,g),X!=null&&E.unshift(Zs(o,X,L))):h||(X=W(o,g),X!=null&&E.push(Zs(o,X,L)))),o=o.return}E.length!==0&&e.push({event:n,listeners:E})}var xg=/\r\n?/g,wg=/\u0000|\uFFFD/g;function cd(e){return(typeof e=="string"?e:""+e).replace(xg,`
38
+ `).replace(wg,"")}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 Ku(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 Uu=typeof setTimeout=="function"?setTimeout:void 0,bg=typeof clearTimeout=="function"?clearTimeout:void 0,fd=typeof Promise=="function"?Promise:void 0,_g=typeof queueMicrotask=="function"?queueMicrotask:typeof fd<"u"?function(e){return fd.resolve(null).then(e).catch(Sg)}:Uu;function Sg(e){setTimeout(function(){throw e})}function qu(e,n){var o=n,u=0;do{var h=o.nextSibling;if(e.removeChild(o),h&&h.nodeType===8)if(o=h.data,o==="/$"){if(u===0){e.removeChild(h),lo(n);return}u--}else o!=="$"&&o!=="$?"&&o!=="$!"||u++;o=h}while(o);lo(n)}function Wo(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),Kr="__reactFiber$"+ss,ea="__reactProps$"+ss,xo="__reactContainer$"+ss,Wu="__reactEvents$"+ss,kg="__reactListeners$"+ss,Ng="__reactHandles$"+ss;function bi(e){var n=e[Kr];if(n)return n;for(var o=e.parentNode;o;){if(n=o[xo]||o[Kr]){if(o=n.alternate,n.child!==null||o!==null&&o.child!==null)for(e=dd(e);e!==null;){if(o=e[Kr])return o;e=dd(e)}return n}e=o,o=e.parentNode}return null}function ta(e){return e=e[Kr]||e[xo],!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 Yo(e){return{current:e}}function Pt(e){0>ls||(e.current=Yu[ls],Yu[ls]=null,ls--)}function kt(e,n){ls++,Yu[ls]=e.current,e.current=n}var Xo={},yn=Yo(Xo),On=Yo(!1),_i=Xo;function us(e,n){var o=e.type.contextTypes;if(!o)return Xo;var u=e.stateNode;if(u&&u.__reactInternalMemoizedUnmaskedChildContext===n)return u.__reactInternalMemoizedMaskedChildContext;var h={},g;for(g in o)h[g]=n[g];return u&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=n,e.__reactInternalMemoizedMaskedChildContext=h),h}function Rn(e){return e=e.childContextTypes,e!=null}function il(){Pt(On),Pt(yn)}function hd(e,n,o){if(yn.current!==Xo)throw Error(i(168));kt(yn,n),kt(On,o)}function pd(e,n,o){var u=e.stateNode;if(n=n.childContextTypes,typeof u.getChildContext!="function")return o;u=u.getChildContext();for(var h in u)if(!(h in n))throw Error(i(108,Ae(e)||"Unknown",h));return F({},o,u)}function sl(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Xo,_i=yn.current,kt(yn,e),kt(On,On.current),!0}function md(e,n,o){var u=e.stateNode;if(!u)throw Error(i(169));o?(e=pd(e,n,_i),u.__reactInternalMemoizedMergedChildContext=e,Pt(On),Pt(yn),kt(yn,e)):Pt(On),kt(On,o)}var wo=null,al=!1,Xu=!1;function gd(e){wo===null?wo=[e]:wo.push(e)}function Eg(e){al=!0,gd(e)}function Qo(){if(!Xu&&wo!==null){Xu=!0;var e=0,n=xt;try{var o=wo;for(xt=1;e<o.length;e++){var u=o[e];do u=u(!0);while(u!==null)}wo=null,al=!1}catch(h){throw wo!==null&&(wo=wo.slice(e+1)),ci(Dr,Qo),h}finally{xt=n,Xu=!1}}return null}var cs=[],fs=0,ll=null,ul=0,cr=[],fr=0,Si=null,bo=1,_o="";function ki(e,n){cs[fs++]=ul,cs[fs++]=ll,ll=e,ul=n}function yd(e,n,o){cr[fr++]=bo,cr[fr++]=_o,cr[fr++]=Si,Si=e;var u=bo;e=_o;var h=32-pn(u)-1;u&=~(1<<h),o+=1;var g=32-pn(n)+h;if(30<g){var E=h-h%5;g=(u&(1<<E)-1).toString(32),u>>=E,h-=E,bo=1<<32-pn(n)+h|o<<h|u,_o=g+e}else bo=1<<g|o<<h|u,_o=e}function Qu(e){e.return!==null&&(ki(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===Si;)Si=cr[--fr],cr[fr]=null,_o=cr[--fr],cr[fr]=null,bo=cr[--fr],cr[fr]=null}var Qn=null,Gn=null,$t=!1,Cr=null;function vd(e,n){var o=mr(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,Qn=e,Gn=Wo(n.firstChild),!0):!1;case 6:return n=e.pendingProps===""||n.nodeType!==3?null:n,n!==null?(e.stateNode=n,Qn=e,Gn=null,!0):!1;case 13:return n=n.nodeType!==8?null:n,n!==null?(o=Si!==null?{id:bo,overflow:_o}:null,e.memoizedState={dehydrated:n,treeContext:o,retryLane:1073741824},o=mr(18,null,null,0),o.stateNode=n,o.return=e,e.child=o,Qn=e,Gn=null,!0):!1;default:return!1}}function Ju(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Zu(e){if($t){var n=Gn;if(n){var o=n;if(!xd(e,n)){if(Ju(e))throw Error(i(418));n=Wo(o.nextSibling);var u=Qn;n&&xd(e,n)?vd(u,o):(e.flags=e.flags&-4097|2,$t=!1,Qn=e)}}else{if(Ju(e))throw Error(i(418));e.flags=e.flags&-4097|2,$t=!1,Qn=e}}}function wd(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Qn=e}function cl(e){if(e!==Qn)return!1;if(!$t)return wd(e),$t=!0,!1;var n;if((n=e.tag!==3)&&!(n=e.tag!==5)&&(n=e.type,n=n!=="head"&&n!=="body"&&!Ku(e.type,e.memoizedProps)),n&&(n=Gn)){if(Ju(e))throw bd(),Error(i(418));for(;n;)vd(e,n),n=Wo(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){Gn=Wo(e.nextSibling);break e}n--}else o!=="$"&&o!=="$!"&&o!=="$?"||n++}e=e.nextSibling}Gn=null}}else Gn=Qn?Wo(e.stateNode.nextSibling):null;return!0}function bd(){for(var e=Gn;e;)e=Wo(e.nextSibling)}function ds(){Gn=Qn=null,$t=!1}function ec(e){Cr===null?Cr=[e]:Cr.push(e)}var Cg=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 h=u,g=""+e;return n!==null&&n.ref!==null&&typeof n.ref=="function"&&n.ref._stringRef===g?n.ref:(n=function(E){var L=h.refs;E===null?delete L[g]:L[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(pe,ne){if(e){var me=pe.deletions;me===null?(pe.deletions=[ne],pe.flags|=16):me.push(ne)}}function o(pe,ne){if(!e)return null;for(;ne!==null;)n(pe,ne),ne=ne.sibling;return null}function u(pe,ne){for(pe=new Map;ne!==null;)ne.key!==null?pe.set(ne.key,ne):pe.set(ne.index,ne),ne=ne.sibling;return pe}function h(pe,ne){return pe=oi(pe,ne),pe.index=0,pe.sibling=null,pe}function g(pe,ne,me){return pe.index=me,e?(me=pe.alternate,me!==null?(me=me.index,me<ne?(pe.flags|=2,ne):me):(pe.flags|=2,ne)):(pe.flags|=1048576,ne)}function E(pe){return e&&pe.alternate===null&&(pe.flags|=2),pe}function L(pe,ne,me,ze){return ne===null||ne.tag!==6?(ne=Uc(me,pe.mode,ze),ne.return=pe,ne):(ne=h(ne,me),ne.return=pe,ne)}function X(pe,ne,me,ze){var Je=me.type;return Je===B?Pe(pe,ne,me.props.children,ze,me.key):ne!==null&&(ne.elementType===Je||typeof Je=="object"&&Je!==null&&Je.$$typeof===G&&_d(Je)===ne.type)?(ze=h(ne,me.props),ze.ref=na(pe,ne,me),ze.return=pe,ze):(ze=Ol(me.type,me.key,me.props,null,pe.mode,ze),ze.ref=na(pe,ne,me),ze.return=pe,ze)}function ye(pe,ne,me,ze){return ne===null||ne.tag!==4||ne.stateNode.containerInfo!==me.containerInfo||ne.stateNode.implementation!==me.implementation?(ne=qc(me,pe.mode,ze),ne.return=pe,ne):(ne=h(ne,me.children||[]),ne.return=pe,ne)}function Pe(pe,ne,me,ze,Je){return ne===null||ne.tag!==7?(ne=Ii(me,pe.mode,ze,Je),ne.return=pe,ne):(ne=h(ne,me),ne.return=pe,ne)}function Ie(pe,ne,me){if(typeof ne=="string"&&ne!==""||typeof ne=="number")return ne=Uc(""+ne,pe.mode,me),ne.return=pe,ne;if(typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case Y:return me=Ol(ne.type,ne.key,ne.props,null,pe.mode,me),me.ref=na(pe,null,ne),me.return=pe,me;case V:return ne=qc(ne,pe.mode,me),ne.return=pe,ne;case G:var ze=ne._init;return Ie(pe,ze(ne._payload),me)}if(Ot(ne)||q(ne))return ne=Ii(ne,pe.mode,me,null),ne.return=pe,ne;fl(pe,ne)}return null}function je(pe,ne,me,ze){var Je=ne!==null?ne.key:null;if(typeof me=="string"&&me!==""||typeof me=="number")return Je!==null?null:L(pe,ne,""+me,ze);if(typeof me=="object"&&me!==null){switch(me.$$typeof){case Y:return me.key===Je?X(pe,ne,me,ze):null;case V:return me.key===Je?ye(pe,ne,me,ze):null;case G:return Je=me._init,je(pe,ne,Je(me._payload),ze)}if(Ot(me)||q(me))return Je!==null?null:Pe(pe,ne,me,ze,null);fl(pe,me)}return null}function Ue(pe,ne,me,ze,Je){if(typeof ze=="string"&&ze!==""||typeof ze=="number")return pe=pe.get(me)||null,L(ne,pe,""+ze,Je);if(typeof ze=="object"&&ze!==null){switch(ze.$$typeof){case Y:return pe=pe.get(ze.key===null?me:ze.key)||null,X(ne,pe,ze,Je);case V:return pe=pe.get(ze.key===null?me:ze.key)||null,ye(ne,pe,ze,Je);case G:var et=ze._init;return Ue(pe,ne,me,et(ze._payload),Je)}if(Ot(ze)||q(ze))return pe=pe.get(me)||null,Pe(ne,pe,ze,Je,null);fl(ne,ze)}return null}function Qe(pe,ne,me,ze){for(var Je=null,et=null,tt=ne,st=ne=0,tn=null;tt!==null&&st<me.length;st++){tt.index>st?(tn=tt,tt=null):tn=tt.sibling;var wt=je(pe,tt,me[st],ze);if(wt===null){tt===null&&(tt=tn);break}e&&tt&&wt.alternate===null&&n(pe,tt),ne=g(wt,ne,st),et===null?Je=wt:et.sibling=wt,et=wt,tt=tn}if(st===me.length)return o(pe,tt),$t&&ki(pe,st),Je;if(tt===null){for(;st<me.length;st++)tt=Ie(pe,me[st],ze),tt!==null&&(ne=g(tt,ne,st),et===null?Je=tt:et.sibling=tt,et=tt);return $t&&ki(pe,st),Je}for(tt=u(pe,tt);st<me.length;st++)tn=Ue(tt,pe,st,me[st],ze),tn!==null&&(e&&tn.alternate!==null&&tt.delete(tn.key===null?st:tn.key),ne=g(tn,ne,st),et===null?Je=tn:et.sibling=tn,et=tn);return e&&tt.forEach(function(ii){return n(pe,ii)}),$t&&ki(pe,st),Je}function Ge(pe,ne,me,ze){var Je=q(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,st=ne=0,tn=null,wt=me.next();tt!==null&&!wt.done;st++,wt=me.next()){tt.index>st?(tn=tt,tt=null):tn=tt.sibling;var ii=je(pe,tt,wt.value,ze);if(ii===null){tt===null&&(tt=tn);break}e&&tt&&ii.alternate===null&&n(pe,tt),ne=g(ii,ne,st),et===null?Je=ii:et.sibling=ii,et=ii,tt=tn}if(wt.done)return o(pe,tt),$t&&ki(pe,st),Je;if(tt===null){for(;!wt.done;st++,wt=me.next())wt=Ie(pe,wt.value,ze),wt!==null&&(ne=g(wt,ne,st),et===null?Je=wt:et.sibling=wt,et=wt);return $t&&ki(pe,st),Je}for(tt=u(pe,tt);!wt.done;st++,wt=me.next())wt=Ue(tt,pe,st,wt.value,ze),wt!==null&&(e&&wt.alternate!==null&&tt.delete(wt.key===null?st:wt.key),ne=g(wt,ne,st),et===null?Je=wt:et.sibling=wt,et=wt);return e&&tt.forEach(function(sy){return n(pe,sy)}),$t&&ki(pe,st),Je}function Bt(pe,ne,me,ze){if(typeof me=="object"&&me!==null&&me.type===B&&me.key===null&&(me=me.props.children),typeof me=="object"&&me!==null){switch(me.$$typeof){case Y:e:{for(var Je=me.key,et=ne;et!==null;){if(et.key===Je){if(Je=me.type,Je===B){if(et.tag===7){o(pe,et.sibling),ne=h(et,me.props.children),ne.return=pe,pe=ne;break e}}else if(et.elementType===Je||typeof Je=="object"&&Je!==null&&Je.$$typeof===G&&_d(Je)===et.type){o(pe,et.sibling),ne=h(et,me.props),ne.ref=na(pe,et,me),ne.return=pe,pe=ne;break e}o(pe,et);break}else n(pe,et);et=et.sibling}me.type===B?(ne=Ii(me.props.children,pe.mode,ze,me.key),ne.return=pe,pe=ne):(ze=Ol(me.type,me.key,me.props,null,pe.mode,ze),ze.ref=na(pe,ne,me),ze.return=pe,pe=ze)}return E(pe);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(pe,ne.sibling),ne=h(ne,me.children||[]),ne.return=pe,pe=ne;break e}else{o(pe,ne);break}else n(pe,ne);ne=ne.sibling}ne=qc(me,pe.mode,ze),ne.return=pe,pe=ne}return E(pe);case G:return et=me._init,Bt(pe,ne,et(me._payload),ze)}if(Ot(me))return Qe(pe,ne,me,ze);if(q(me))return Ge(pe,ne,me,ze);fl(pe,me)}return typeof me=="string"&&me!==""||typeof me=="number"?(me=""+me,ne!==null&&ne.tag===6?(o(pe,ne.sibling),ne=h(ne,me),ne.return=pe,pe=ne):(o(pe,ne),ne=Uc(me,pe.mode,ze),ne.return=pe,pe=ne),E(pe)):o(pe,ne)}return Bt}var hs=Sd(!0),kd=Sd(!1),dl=Yo(null),hl=null,ps=null,tc=null;function nc(){tc=ps=hl=null}function rc(e){var n=dl.current;Pt(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){hl=e,tc=ps=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&n)!==0&&(Dn=!0),e.firstContext=null)}function dr(e){var n=e._currentValue;if(tc!==e)if(e={context:e,memoizedValue:n,next:null},ps===null){if(hl===null)throw Error(i(308));ps=e,hl.dependencies={lanes:0,firstContext:e}}else ps=ps.next=e;return n}var Ni=null;function ic(e){Ni===null?Ni=[e]:Ni.push(e)}function Nd(e,n,o,u){var h=n.interleaved;return h===null?(o.next=o,ic(n)):(o.next=h.next,h.next=o),n.interleaved=o,So(e,u)}function So(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 Go=!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 ko(e,n){return{eventTime:e,lane:n,tag:0,payload:null,callback:null,next:null}}function Jo(e,n,o){var u=e.updateQueue;if(u===null)return null;if(u=u.shared,(vt&2)!==0){var h=u.pending;return h===null?n.next=n:(n.next=h.next,h.next=n),u.pending=n,So(e,o)}return h=u.interleaved,h===null?(n.next=n,ic(u)):(n.next=h.next,h.next=n),u.interleaved=n,So(e,o)}function pl(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,Ro(e,o)}}function Cd(e,n){var o=e.updateQueue,u=e.alternate;if(u!==null&&(u=u.updateQueue,o===u)){var h=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?h=g=E:g=g.next=E,o=o.next}while(o!==null);g===null?h=g=n:g=g.next=n}else h=g=n;o={baseState:u.baseState,firstBaseUpdate:h,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 h=e.updateQueue;Go=!1;var g=h.firstBaseUpdate,E=h.lastBaseUpdate,L=h.shared.pending;if(L!==null){h.shared.pending=null;var X=L,ye=X.next;X.next=null,E===null?g=ye:E.next=ye,E=X;var Pe=e.alternate;Pe!==null&&(Pe=Pe.updateQueue,L=Pe.lastBaseUpdate,L!==E&&(L===null?Pe.firstBaseUpdate=ye:L.next=ye,Pe.lastBaseUpdate=X))}if(g!==null){var Ie=h.baseState;E=0,Pe=ye=X=null,L=g;do{var je=L.lane,Ue=L.eventTime;if((u&je)===je){Pe!==null&&(Pe=Pe.next={eventTime:Ue,lane:0,tag:L.tag,payload:L.payload,callback:L.callback,next:null});e:{var Qe=e,Ge=L;switch(je=n,Ue=o,Ge.tag){case 1:if(Qe=Ge.payload,typeof Qe=="function"){Ie=Qe.call(Ue,Ie,je);break e}Ie=Qe;break e;case 3:Qe.flags=Qe.flags&-65537|128;case 0:if(Qe=Ge.payload,je=typeof Qe=="function"?Qe.call(Ue,Ie,je):Qe,je==null)break e;Ie=F({},Ie,je);break e;case 2:Go=!0}}L.callback!==null&&L.lane!==0&&(e.flags|=64,je=h.effects,je===null?h.effects=[L]:je.push(L))}else Ue={eventTime:Ue,lane:je,tag:L.tag,payload:L.payload,callback:L.callback,next:null},Pe===null?(ye=Pe=Ue,X=Ie):Pe=Pe.next=Ue,E|=je;if(L=L.next,L===null){if(L=h.shared.pending,L===null)break;je=L,L=je.next,je.next=null,h.lastBaseUpdate=je,h.shared.pending=null}}while(!0);if(Pe===null&&(X=Ie),h.baseState=X,h.firstBaseUpdate=ye,h.lastBaseUpdate=Pe,n=h.shared.interleaved,n!==null){h=n;do E|=h.lane,h=h.next;while(h!==n)}else g===null&&(h.shared.lanes=0);ji|=E,e.lanes=E,e.memoizedState=Ie}}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],h=u.callback;if(h!==null){if(u.callback=null,u=o,typeof h!="function")throw Error(i(191,h));h.call(u)}}}var ra={},Ur=Yo(ra),oa=Yo(ra),ia=Yo(ra);function Ei(e){if(e===ra)throw Error(i(174));return e}function ac(e,n){switch(kt(ia,n),kt(oa,e),kt(Ur,ra),e=n.nodeType,e){case 9:case 11:n=(n=n.documentElement)?n.namespaceURI:Vt(null,"");break;default:e=e===8?n.parentNode:n,n=e.namespaceURI||null,e=e.tagName,n=Vt(n,e)}Pt(Ur),kt(Ur,n)}function gs(){Pt(Ur),Pt(oa),Pt(ia)}function Pd(e){Ei(ia.current);var n=Ei(Ur.current),o=Vt(n,e.type);n!==o&&(kt(oa,e),kt(Ur,o))}function lc(e){oa.current===e&&(Pt(Ur),Pt(oa))}var Dt=Yo(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,Ci=0,Lt=null,Xt=null,Zt=null,vl=!1,sa=!1,aa=0,jg=0;function vn(){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(!ce(e[o],n[o]))return!1;return!0}function hc(e,n,o,u,h,g){if(Ci=g,Lt=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,yl.current=e===null||e.memoizedState===null?Ig:$g,e=o(u,h),sa){g=0;do{if(sa=!1,aa=0,25<=g)throw Error(i(301));g+=1,Zt=Xt=null,n.updateQueue=null,yl.current=Ag,e=o(u,h)}while(sa)}if(yl.current=bl,n=Xt!==null&&Xt.next!==null,Ci=0,Zt=Xt=Lt=null,vl=!1,n)throw Error(i(300));return e}function pc(){var e=aa!==0;return aa=0,e}function qr(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Zt===null?Lt.memoizedState=Zt=e:Zt=Zt.next=e,Zt}function hr(){if(Xt===null){var e=Lt.alternate;e=e!==null?e.memoizedState:null}else e=Xt.next;var n=Zt===null?Lt.memoizedState:Zt.next;if(n!==null)Zt=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},Zt===null?Lt.memoizedState=Zt=e:Zt=Zt.next=e}return Zt}function la(e,n){return typeof n=="function"?n(e):n}function mc(e){var n=hr(),o=n.queue;if(o===null)throw Error(i(311));o.lastRenderedReducer=e;var u=Xt,h=u.baseQueue,g=o.pending;if(g!==null){if(h!==null){var E=h.next;h.next=g.next,g.next=E}u.baseQueue=h=g,o.pending=null}if(h!==null){g=h.next,u=u.baseState;var L=E=null,X=null,ye=g;do{var Pe=ye.lane;if((Ci&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 Ie={lane:Pe,action:ye.action,hasEagerState:ye.hasEagerState,eagerState:ye.eagerState,next:null};X===null?(L=X=Ie,E=u):X=X.next=Ie,Lt.lanes|=Pe,ji|=Pe}ye=ye.next}while(ye!==null&&ye!==g);X===null?E=u:X.next=L,ce(u,n.memoizedState)||(Dn=!0),n.memoizedState=u,n.baseState=E,n.baseQueue=X,o.lastRenderedState=u}if(e=o.interleaved,e!==null){h=e;do g=h.lane,Lt.lanes|=g,ji|=g,h=h.next;while(h!==e)}else h===null&&(o.lanes=0);return[n.memoizedState,o.dispatch]}function gc(e){var n=hr(),o=n.queue;if(o===null)throw Error(i(311));o.lastRenderedReducer=e;var u=o.dispatch,h=o.pending,g=n.memoizedState;if(h!==null){o.pending=null;var E=h=h.next;do g=e(g,E.action),E=E.next;while(E!==h);ce(g,n.memoizedState)||(Dn=!0),n.memoizedState=g,n.baseQueue===null&&(n.baseState=g),o.lastRenderedState=g}return[g,u]}function Md(){}function Td(e,n){var o=Lt,u=hr(),h=n(),g=!ce(u.memoizedState,h);if(g&&(u.memoizedState=h,Dn=!0),u=u.queue,yc(Ad.bind(null,o,u,e),[e]),u.getSnapshot!==n||g||Zt!==null&&Zt.memoizedState.tag&1){if(o.flags|=2048,ua(9,$d.bind(null,o,u,h,n),void 0,null),en===null)throw Error(i(349));(Ci&30)!==0||Id(o,n,h)}return h}function Id(e,n,o){e.flags|=16384,e={getSnapshot:n,value:o},n=Lt.updateQueue,n===null?(n={lastEffect:null,stores:null},Lt.updateQueue=n,n.stores=[e]):(o=n.stores,o===null?n.stores=[e]:o.push(e))}function $d(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!ce(e,o)}catch{return!0}}function Rd(e){var n=So(e,1);n!==null&&Tr(n,e,1,-1)}function Dd(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=Tg.bind(null,Lt,e),[n.memoizedState,e]}function ua(e,n,o,u){return e={tag:e,create:n,destroy:o,deps:u,next:null},n=Lt.updateQueue,n===null?(n={lastEffect:null,stores:null},Lt.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 Ld(){return hr().memoizedState}function xl(e,n,o,u){var h=qr();Lt.flags|=e,h.memoizedState=ua(1|n,o,void 0,u===void 0?null:u)}function wl(e,n,o,u){var h=hr();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)){h.memoizedState=ua(n,o,g,u);return}}Lt.flags|=e,h.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 Kd(e,n){var o=hr();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 Ud(e,n){var o=hr();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(Ci&21)===0?(e.baseState&&(e.baseState=!1,Dn=!0),e.memoizedState=o):(ce(o,n)||(o=Fr(),Lt.lanes|=o,ji|=o,e.baseState=!0),n)}function Pg(e,n){var o=xt;xt=o!==0&&4>o?o:4,e(!0);var u=fc.transition;fc.transition={};try{e(!1),n()}finally{xt=o,fc.transition=u}}function Wd(){return hr().memoizedState}function Mg(e,n,o){var u=ni(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 h=jn();Tr(o,e,u,h),Qd(o,n,u)}}function Tg(e,n,o){var u=ni(e),h={lane:u,action:o,hasEagerState:!1,eagerState:null,next:null};if(Yd(e))Xd(n,h);else{var g=e.alternate;if(e.lanes===0&&(g===null||g.lanes===0)&&(g=n.lastRenderedReducer,g!==null))try{var E=n.lastRenderedState,L=g(E,o);if(h.hasEagerState=!0,h.eagerState=L,ce(L,E)){var X=n.interleaved;X===null?(h.next=h,ic(n)):(h.next=X.next,X.next=h),n.interleaved=h;return}}catch{}finally{}o=Nd(e,n,h,u),o!==null&&(h=jn(),Tr(o,e,u,h),Qd(o,n,u))}}function Yd(e){var n=e.alternate;return e===Lt||n!==null&&n===Lt}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,Ro(e,o)}}var bl={readContext:dr,useCallback:vn,useContext:vn,useEffect:vn,useImperativeHandle:vn,useInsertionEffect:vn,useLayoutEffect:vn,useMemo:vn,useReducer:vn,useRef:vn,useState:vn,useDebugValue:vn,useDeferredValue:vn,useTransition:vn,useMutableSource:vn,useSyncExternalStore:vn,useId:vn,unstable_isNewReconciler:!1},Ig={readContext:dr,useCallback:function(e,n){return qr().memoizedState=[e,n===void 0?null:n],e},useContext:dr,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=Mg.bind(null,Lt,e),[u.memoizedState,e]},useRef:function(e){var n=qr();return e={current:e},n.memoizedState=e},useState:Dd,useDebugValue:vc,useDeferredValue:function(e){return qr().memoizedState=e},useTransition:function(){var e=Dd(!1),n=e[0];return e=Pg.bind(null,e[1]),qr().memoizedState=e,[n,e]},useMutableSource:function(){},useSyncExternalStore:function(e,n,o){var u=Lt,h=qr();if($t){if(o===void 0)throw Error(i(407));o=o()}else{if(o=n(),en===null)throw Error(i(349));(Ci&30)!==0||Id(u,n,o)}h.memoizedState=o;var g={value:o,getSnapshot:n};return h.queue=g,zd(Ad.bind(null,u,g,e),[e]),u.flags|=2048,ua(9,$d.bind(null,u,g,o,n),void 0,null),o},useId:function(){var e=qr(),n=en.identifierPrefix;if($t){var o=_o,u=bo;o=(u&~(1<<32-pn(u)-1)).toString(32)+o,n=":"+n+"R"+o,o=aa++,0<o&&(n+="H"+o.toString(32)),n+=":"}else o=jg++,n=":"+n+"r"+o.toString(32)+":";return e.memoizedState=n},unstable_isNewReconciler:!1},$g={readContext:dr,useCallback:Kd,useContext:dr,useEffect:yc,useImperativeHandle:Vd,useInsertionEffect:Fd,useLayoutEffect:Bd,useMemo:Ud,useReducer:mc,useRef:Ld,useState:function(){return mc(la)},useDebugValue:vc,useDeferredValue:function(e){var n=hr();return qd(n,Xt.memoizedState,e)},useTransition:function(){var e=mc(la)[0],n=hr().memoizedState;return[e,n]},useMutableSource:Md,useSyncExternalStore:Td,useId:Wd,unstable_isNewReconciler:!1},Ag={readContext:dr,useCallback:Kd,useContext:dr,useEffect:yc,useImperativeHandle:Vd,useInsertionEffect:Fd,useLayoutEffect:Bd,useMemo:Ud,useReducer:gc,useRef:Ld,useState:function(){return gc(la)},useDebugValue:vc,useDeferredValue:function(e){var n=hr();return Xt===null?n.memoizedState=e:qd(n,Xt.memoizedState,e)},useTransition:function(){var e=gc(la)[0],n=hr().memoizedState;return[e,n]},useMutableSource:Md,useSyncExternalStore:Td,useId:Wd,unstable_isNewReconciler:!1};function jr(e,n){if(e&&e.defaultProps){n=F({},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:F({},n,o),e.memoizedState=o,e.lanes===0&&(e.updateQueue.baseState=o)}var _l={isMounted:function(e){return(e=e._reactInternals)?zt(e)===e:!1},enqueueSetState:function(e,n,o){e=e._reactInternals;var u=jn(),h=ni(e),g=ko(u,h);g.payload=n,o!=null&&(g.callback=o),n=Jo(e,g,h),n!==null&&(Tr(n,e,h,u),pl(n,e,h))},enqueueReplaceState:function(e,n,o){e=e._reactInternals;var u=jn(),h=ni(e),g=ko(u,h);g.tag=1,g.payload=n,o!=null&&(g.callback=o),n=Jo(e,g,h),n!==null&&(Tr(n,e,h,u),pl(n,e,h))},enqueueForceUpdate:function(e,n){e=e._reactInternals;var o=jn(),u=ni(e),h=ko(o,u);h.tag=2,n!=null&&(h.callback=n),n=Jo(e,h,u),n!==null&&(Tr(n,e,u,o),pl(n,e,u))}};function Gd(e,n,o,u,h,g,E){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(u,g,E):n.prototype&&n.prototype.isPureReactComponent?!te(o,u)||!te(h,g):!0}function Jd(e,n,o){var u=!1,h=Xo,g=n.contextType;return typeof g=="object"&&g!==null?g=dr(g):(h=Rn(n)?_i:yn.current,u=n.contextTypes,g=(u=u!=null)?us(e,h):Xo),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=h,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 h=e.stateNode;h.props=o,h.state=e.memoizedState,h.refs={},sc(e);var g=n.contextType;typeof g=="object"&&g!==null?h.context=dr(g):(g=Rn(n)?_i:yn.current,h.context=us(e,g)),h.state=e.memoizedState,g=n.getDerivedStateFromProps,typeof g=="function"&&(xc(e,n,g,o),h.state=e.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof h.getSnapshotBeforeUpdate=="function"||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(n=h.state,typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount(),n!==h.state&&_l.enqueueReplaceState(h,h.state,null),ml(e,o,h,u),h.state=e.memoizedState),typeof h.componentDidMount=="function"&&(e.flags|=4194308)}function ys(e,n){try{var o="",u=n;do o+=Me(u),u=u.return;while(u);var h=o}catch(g){h=`
39
+ Error generating stack: `+g.message+`
40
+ `+g.stack}return{value:e,source:n,stack:h,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 Og=typeof WeakMap=="function"?WeakMap:Map;function eh(e,n,o){o=ko(-1,o),o.tag=3,o.payload={element:null};var u=n.value;return o.callback=function(){Pl||(Pl=!0,Dc=u),_c(e,n)},o}function th(e,n,o){o=ko(-1,o),o.tag=3;var u=e.type.getDerivedStateFromError;if(typeof u=="function"){var h=n.value;o.payload=function(){return u(h)},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"&&(ei===null?ei=new Set([this]):ei.add(this));var E=n.stack;this.componentDidCatch(n.value,{componentStack:E!==null?E:""})}),o}function nh(e,n,o){var u=e.pingCache;if(u===null){u=e.pingCache=new Og;var h=new Set;u.set(n,h)}else h=u.get(n),h===void 0&&(h=new Set,u.set(n,h));h.has(o)||(h.add(o),e=Xg.bind(null,e,n,o),n.then(e,e))}function rh(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 oh(e,n,o,u,h){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=ko(-1,1),n.tag=2,Jo(o,n,1))),o.lanes|=1),e):(e.flags|=65536,e.lanes=h,e)}var Rg=R.ReactCurrentOwner,Dn=!1;function Cn(e,n,o,u){n.child=e===null?kd(n,null,o,u):hs(n,e.child,o,u)}function ih(e,n,o,u,h){o=o.render;var g=n.ref;return ms(n,h),u=hc(e,n,o,u,g,h),o=pc(),e!==null&&!Dn?(n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~h,No(e,n,h)):($t&&o&&Qu(n),n.flags|=1,Cn(e,n,u,h),n.child)}function sh(e,n,o,u,h){if(e===null){var g=o.type;return typeof g=="function"&&!Kc(g)&&g.defaultProps===void 0&&o.compare===null&&o.defaultProps===void 0?(n.tag=15,n.type=g,ah(e,n,g,u,h)):(e=Ol(o.type,null,u,n,n.mode,h),e.ref=n.ref,e.return=n,n.child=e)}if(g=e.child,(e.lanes&h)===0){var E=g.memoizedProps;if(o=o.compare,o=o!==null?o:te,o(E,u)&&e.ref===n.ref)return No(e,n,h)}return n.flags|=1,e=oi(g,u),e.ref=n.ref,e.return=n,n.child=e}function ah(e,n,o,u,h){if(e!==null){var g=e.memoizedProps;if(te(g,u)&&e.ref===n.ref)if(Dn=!1,n.pendingProps=u=g,(e.lanes&h)!==0)(e.flags&131072)!==0&&(Dn=!0);else return n.lanes=e.lanes,No(e,n,h)}return Sc(e,n,o,u,h)}function lh(e,n,o){var u=n.pendingProps,h=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},kt(xs,Jn),Jn|=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,kt(xs,Jn),Jn|=e,null;n.memoizedState={baseLanes:0,cachePool:null,transitions:null},u=g!==null?g.baseLanes:o,kt(xs,Jn),Jn|=u}else g!==null?(u=g.baseLanes|o,n.memoizedState=null):u=o,kt(xs,Jn),Jn|=u;return Cn(e,n,h,o),n.child}function uh(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,h){var g=Rn(o)?_i:yn.current;return g=us(n,g),ms(n,h),o=hc(e,n,o,u,g,h),u=pc(),e!==null&&!Dn?(n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~h,No(e,n,h)):($t&&u&&Qu(n),n.flags|=1,Cn(e,n,o,h),n.child)}function ch(e,n,o,u,h){if(Rn(o)){var g=!0;sl(n)}else g=!1;if(ms(n,h),n.stateNode===null)kl(e,n),Jd(n,o,u),wc(n,o,u,h),u=!0;else if(e===null){var E=n.stateNode,L=n.memoizedProps;E.props=L;var X=E.context,ye=o.contextType;typeof ye=="object"&&ye!==null?ye=dr(ye):(ye=Rn(o)?_i:yn.current,ye=us(n,ye));var Pe=o.getDerivedStateFromProps,Ie=typeof Pe=="function"||typeof E.getSnapshotBeforeUpdate=="function";Ie||typeof E.UNSAFE_componentWillReceiveProps!="function"&&typeof E.componentWillReceiveProps!="function"||(L!==u||X!==ye)&&Zd(n,E,u,ye),Go=!1;var je=n.memoizedState;E.state=je,ml(n,u,E,h),X=n.memoizedState,L!==u||je!==X||On.current||Go?(typeof Pe=="function"&&(xc(n,o,Pe,u),X=n.memoizedState),(L=Go||Gd(n,o,L,u,je,X,ye))?(Ie||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=L):(typeof E.componentDidMount=="function"&&(n.flags|=4194308),u=!1)}else{E=n.stateNode,Ed(e,n),L=n.memoizedProps,ye=n.type===n.elementType?L:jr(n.type,L),E.props=ye,Ie=n.pendingProps,je=E.context,X=o.contextType,typeof X=="object"&&X!==null?X=dr(X):(X=Rn(o)?_i:yn.current,X=us(n,X));var Ue=o.getDerivedStateFromProps;(Pe=typeof Ue=="function"||typeof E.getSnapshotBeforeUpdate=="function")||typeof E.UNSAFE_componentWillReceiveProps!="function"&&typeof E.componentWillReceiveProps!="function"||(L!==Ie||je!==X)&&Zd(n,E,u,X),Go=!1,je=n.memoizedState,E.state=je,ml(n,u,E,h);var Qe=n.memoizedState;L!==Ie||je!==Qe||On.current||Go?(typeof Ue=="function"&&(xc(n,o,Ue,u),Qe=n.memoizedState),(ye=Go||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"||L===e.memoizedProps&&je===e.memoizedState||(n.flags|=4),typeof E.getSnapshotBeforeUpdate!="function"||L===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"||L===e.memoizedProps&&je===e.memoizedState||(n.flags|=4),typeof E.getSnapshotBeforeUpdate!="function"||L===e.memoizedProps&&je===e.memoizedState||(n.flags|=1024),u=!1)}return kc(e,n,o,u,g,h)}function kc(e,n,o,u,h,g){uh(e,n);var E=(n.flags&128)!==0;if(!u&&!E)return h&&md(n,o,!1),No(e,n,g);u=n.stateNode,Rg.current=n;var L=E&&typeof o.getDerivedStateFromError!="function"?null:u.render();return n.flags|=1,e!==null&&E?(n.child=hs(n,e.child,null,g),n.child=hs(n,null,L,g)):Cn(e,n,L,g),n.memoizedState=u.state,h&&md(n,o,!0),n.child}function fh(e){var n=e.stateNode;n.pendingContext?hd(e,n.pendingContext,n.pendingContext!==n.context):n.context&&hd(e,n.context,!1),ac(e,n.containerInfo)}function dh(e,n,o,u,h){return ds(),ec(h),n.flags|=256,Cn(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 hh(e,n,o){var u=n.pendingProps,h=Dt.current,g=!1,E=(n.flags&128)!==0,L;if((L=E)||(L=e!==null&&e.memoizedState===null?!1:(h&2)!==0),L?(g=!0,n.flags&=-129):(e===null||e.memoizedState!==null)&&(h|=1),kt(Dt,h&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(h=e.memoizedState,h!==null&&(L=h.dehydrated,L!==null))return Dg(e,n,E,u,L,h,o);if(g){g=u.fallback,E=n.mode,h=e.child,L=h.sibling;var X={mode:"hidden",children:u.children};return(E&1)===0&&n.child!==h?(u=n.child,u.childLanes=0,u.pendingProps=X,n.deletions=null):(u=oi(h,X),u.subtreeFlags=h.subtreeFlags&14680064),L!==null?g=oi(L,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=oi(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),hs(n,e.child,null,o),e=Cc(n,n.pendingProps.children),e.flags|=2,n.memoizedState=null,e}function Dg(e,n,o,u,h,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,h=n.mode,u=Rl({mode:"visible",children:u.children},h,0,null),g=Ii(g,h,E,null),g.flags|=2,u.return=n,g.return=n,u.sibling=g,n.child=u,(n.mode&1)!==0&&hs(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(h.data==="$!"){if(u=h.nextSibling&&h.nextSibling.dataset,u)var L=u.dgst;return u=L,g=Error(i(419)),u=bc(g,u,void 0),Sl(e,n,E,u)}if(L=(E&e.childLanes)!==0,Dn||L){if(u=en,u!==null){switch(E&-E){case 4:h=2;break;case 16:h=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:h=32;break;case 536870912:h=268435456;break;default:h=0}h=(h&(u.suspendedLanes|E))!==0?0:h,h!==0&&h!==g.retryLane&&(g.retryLane=h,So(e,h),Tr(u,e,h,-1))}return Vc(),u=bc(Error(i(421))),Sl(e,n,E,u)}return h.data==="$?"?(n.flags|=128,n.child=e.child,n=Qg.bind(null,e),h._reactRetry=n,null):(e=g.treeContext,Gn=Wo(h.nextSibling),Qn=n,$t=!0,Cr=null,e!==null&&(cr[fr++]=bo,cr[fr++]=_o,cr[fr++]=Si,bo=e.id,_o=e.overflow,Si=n),n=Cc(n,u.children),n.flags|=4096,n)}function ph(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,h){var g=e.memoizedState;g===null?e.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:u,tail:o,tailMode:h}:(g.isBackwards=n,g.rendering=null,g.renderingStartTime=0,g.last=u,g.tail=o,g.tailMode=h)}function mh(e,n,o){var u=n.pendingProps,h=u.revealOrder,g=u.tail;if(Cn(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&&ph(e,o,n);else if(e.tag===19)ph(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(kt(Dt,u),(n.mode&1)===0)n.memoizedState=null;else switch(h){case"forwards":for(o=n.child,h=null;o!==null;)e=o.alternate,e!==null&&gl(e)===null&&(h=o),o=o.sibling;o=h,o===null?(h=n.child,n.child=null):(h=o.sibling,o.sibling=null),jc(n,!1,h,o,g);break;case"backwards":for(o=null,h=n.child,n.child=null;h!==null;){if(e=h.alternate,e!==null&&gl(e)===null){n.child=h;break}e=h.sibling,h.sibling=o,o=h,h=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 No(e,n,o){if(e!==null&&(n.dependencies=e.dependencies),ji|=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=oi(e,e.pendingProps),n.child=o,o.return=n;e.sibling!==null;)e=e.sibling,o=o.sibling=oi(e,e.pendingProps),o.return=n;o.sibling=null}return n.child}function Lg(e,n,o){switch(n.tag){case 3:fh(n),ds();break;case 5:Pd(n);break;case 1:Rn(n.type)&&sl(n);break;case 4:ac(n,n.stateNode.containerInfo);break;case 10:var u=n.type._context,h=n.memoizedProps.value;kt(dl,u._currentValue),u._currentValue=h;break;case 13:if(u=n.memoizedState,u!==null)return u.dehydrated!==null?(kt(Dt,Dt.current&1),n.flags|=128,null):(o&n.child.childLanes)!==0?hh(e,n,o):(kt(Dt,Dt.current&1),e=No(e,n,o),e!==null?e.sibling:null);kt(Dt,Dt.current&1);break;case 19:if(u=(o&n.childLanes)!==0,(e.flags&128)!==0){if(u)return mh(e,n,o);n.flags|=128}if(h=n.memoizedState,h!==null&&(h.rendering=null,h.tail=null,h.lastEffect=null),kt(Dt,Dt.current),u)break;return null;case 22:case 23:return n.lanes=0,lh(e,n,o)}return No(e,n,o)}var gh,Pc,yh,vh;gh=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(){},yh=function(e,n,o,u){var h=e.memoizedProps;if(h!==u){e=n.stateNode,Ei(Ur.current);var g=null;switch(o){case"input":h=ut(e,h),u=ut(e,u),g=[];break;case"select":h=F({},h,{value:void 0}),u=F({},u,{value:void 0}),g=[];break;case"textarea":h=bn(e,h),u=bn(e,u),g=[];break;default:typeof h.onClick!="function"&&typeof u.onClick=="function"&&(e.onclick=rl)}Ye(o,u);var E;o=null;for(ye in h)if(!u.hasOwnProperty(ye)&&h.hasOwnProperty(ye)&&h[ye]!=null)if(ye==="style"){var L=h[ye];for(E in L)L.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(L=h!=null?h[ye]:void 0,u.hasOwnProperty(ye)&&X!==L&&(X!=null||L!=null))if(ye==="style")if(L){for(E in L)!L.hasOwnProperty(E)||X&&X.hasOwnProperty(E)||(o||(o={}),o[E]="");for(E in X)X.hasOwnProperty(E)&&L[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,L=L?L.__html:void 0,X!=null&&L!==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"&&jt("scroll",e),g||L===X||(g=[])):(g=g||[]).push(ye,X))}o&&(g=g||[]).push("style",o);var ye=g;(n.updateQueue=ye)&&(n.flags|=4)}},vh=function(e,n,o,u){o!==u&&(n.flags|=4)};function ca(e,n){if(!$t)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 xn(e){var n=e.alternate!==null&&e.alternate.child===e.child,o=0,u=0;if(n)for(var h=e.child;h!==null;)o|=h.lanes|h.childLanes,u|=h.subtreeFlags&14680064,u|=h.flags&14680064,h.return=e,h=h.sibling;else for(h=e.child;h!==null;)o|=h.lanes|h.childLanes,u|=h.subtreeFlags,u|=h.flags,h.return=e,h=h.sibling;return e.subtreeFlags|=u,e.childLanes=o,n}function zg(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 xn(n),null;case 1:return Rn(n.type)&&il(),xn(n),null;case 3:return u=n.stateNode,gs(),Pt(On),Pt(yn),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,Cr!==null&&(Fc(Cr),Cr=null))),Pc(e,n),xn(n),null;case 5:lc(n);var h=Ei(ia.current);if(o=n.type,e!==null&&n.stateNode!=null)yh(e,n,o,u,h),e.ref!==n.ref&&(n.flags|=512,n.flags|=2097152);else{if(!u){if(n.stateNode===null)throw Error(i(166));return xn(n),null}if(e=Ei(Ur.current),cl(n)){u=n.stateNode,o=n.type;var g=n.memoizedProps;switch(u[Kr]=n,u[ea]=g,e=(n.mode&1)!==0,o){case"dialog":jt("cancel",u),jt("close",u);break;case"iframe":case"object":case"embed":jt("load",u);break;case"video":case"audio":for(h=0;h<vo.length;h++)jt(vo[h],u);break;case"source":jt("error",u);break;case"img":case"image":case"link":jt("error",u),jt("load",u);break;case"details":jt("toggle",u);break;case"input":ct(u,g),jt("invalid",u);break;case"select":u._wrapperState={wasMultiple:!!g.multiple},jt("invalid",u);break;case"textarea":fn(u,g),jt("invalid",u)}Ye(o,g),h=null;for(var E in g)if(g.hasOwnProperty(E)){var L=g[E];E==="children"?typeof L=="string"?u.textContent!==L&&(g.suppressHydrationWarning!==!0&&nl(u.textContent,L,e),h=["children",L]):typeof L=="number"&&u.textContent!==""+L&&(g.suppressHydrationWarning!==!0&&nl(u.textContent,L,e),h=["children",""+L]):l.hasOwnProperty(E)&&L!=null&&E==="onScroll"&&jt("scroll",u)}switch(o){case"input":He(u),_t(u,g,!0);break;case"textarea":He(u),_n(u);break;case"select":case"option":break;default:typeof g.onClick=="function"&&(u.onclick=rl)}u=h,n.updateQueue=u,u!==null&&(n.flags|=4)}else{E=h.nodeType===9?h:h.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Nt(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[Kr]=n,e[ea]=u,gh(e,n,!1,!1),n.stateNode=e;e:{switch(E=Kn(o,u),o){case"dialog":jt("cancel",e),jt("close",e),h=u;break;case"iframe":case"object":case"embed":jt("load",e),h=u;break;case"video":case"audio":for(h=0;h<vo.length;h++)jt(vo[h],e);h=u;break;case"source":jt("error",e),h=u;break;case"img":case"image":case"link":jt("error",e),jt("load",e),h=u;break;case"details":jt("toggle",e),h=u;break;case"input":ct(e,u),h=ut(e,u),jt("invalid",e);break;case"option":h=u;break;case"select":e._wrapperState={wasMultiple:!!u.multiple},h=F({},u,{value:void 0}),jt("invalid",e);break;case"textarea":fn(e,u),h=bn(e,u),jt("invalid",e);break;default:h=u}Ye(o,h),L=h;for(g in L)if(L.hasOwnProperty(g)){var X=L[g];g==="style"?nr(e,X):g==="dangerouslySetInnerHTML"?(X=X?X.__html:void 0,X!=null&&tr(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"&&jt("scroll",e):X!=null&&P(e,g,X,E))}switch(o){case"input":He(e),_t(e,u,!1);break;case"textarea":He(e),_n(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?St(e,!!u.multiple,g,!1):u.defaultValue!=null&&St(e,!!u.multiple,u.defaultValue,!0);break;default:typeof h.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 xn(n),null;case 6:if(e&&n.stateNode!=null)vh(e,n,e.memoizedProps,u);else{if(typeof u!="string"&&n.stateNode===null)throw Error(i(166));if(o=Ei(ia.current),Ei(Ur.current),cl(n)){if(u=n.stateNode,o=n.memoizedProps,u[Kr]=n,(g=u.nodeValue!==o)&&(e=Qn,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[Kr]=n,n.stateNode=u}return xn(n),null;case 13:if(Pt(Dt),u=n.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if($t&&Gn!==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[Kr]=n}else ds(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;xn(n),g=!1}else Cr!==null&&(Fc(Cr),Cr=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),xn(n),null);case 4:return gs(),Pc(e,n),e===null&&Js(n.stateNode.containerInfo),xn(n),null;case 10:return rc(n.type._context),xn(n),null;case 17:return Rn(n.type)&&il(),xn(n),null;case 19:if(Pt(Dt),g=n.memoizedState,g===null)return xn(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 kt(Dt,Dt.current&1|2),n.child}e=e.sibling}g.tail!==null&&gt()>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&&!$t)return xn(n),null}else 2*gt()-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=gt(),n.sibling=null,o=Dt.current,kt(Dt,u?o&1|2:o&1),n):(xn(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?(Jn&1073741824)!==0&&(xn(n),n.subtreeFlags&6&&(n.flags|=8192)):xn(n),null;case 24:return null;case 25:return null}throw Error(i(156,n.tag))}function Fg(e,n){switch(Gu(n),n.tag){case 1:return Rn(n.type)&&il(),e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 3:return gs(),Pt(On),Pt(yn),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(Pt(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 Pt(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,wn=!1,Bg=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 xh=!1;function Hg(e,n){if(Hu=Ui,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 h=u.anchorOffset,g=u.focusNode;u=u.focusOffset;try{o.nodeType,g.nodeType}catch{o=null;break e}var E=0,L=-1,X=-1,ye=0,Pe=0,Ie=e,je=null;t:for(;;){for(var Ue;Ie!==o||h!==0&&Ie.nodeType!==3||(L=E+h),Ie!==g||u!==0&&Ie.nodeType!==3||(X=E+u),Ie.nodeType===3&&(E+=Ie.nodeValue.length),(Ue=Ie.firstChild)!==null;)je=Ie,Ie=Ue;for(;;){if(Ie===e)break t;if(je===o&&++ye===h&&(L=E),je===g&&++Pe===u&&(X=E),(Ue=Ie.nextSibling)!==null)break;Ie=je,je=Ie.parentNode}Ie=Ue}o=L===-1||X===-1?null:{start:L,end:X}}else o=null}o=o||{start:0,end:0}}else o=null;for(Vu={focusedElem:e,selectionRange:o},Ui=!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,pe=n.stateNode,ne=pe.getSnapshotBeforeUpdate(n.elementType===n.type?Ge:jr(n.type,Ge),Bt);pe.__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(ze){Ft(n,n.return,ze)}if(e=n.sibling,e!==null){e.return=n.return,Xe=e;break}Xe=n.return}return Qe=xh,xh=!1,Qe}function fa(e,n,o){var u=n.updateQueue;if(u=u!==null?u.lastEffect:null,u!==null){var h=u=u.next;do{if((h.tag&e)===e){var g=h.destroy;h.destroy=void 0,g!==void 0&&Mc(n,o,g)}h=h.next}while(h!==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 Tc(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 wh(e){var n=e.alternate;n!==null&&(e.alternate=null,wh(n)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(n=e.stateNode,n!==null&&(delete n[Kr],delete n[ea],delete n[Wu],delete n[kg],delete n[Ng])),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 bh(e){return e.tag===5||e.tag===3||e.tag===4}function _h(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||bh(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 Ic(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(Ic(e,n,o),e=e.sibling;e!==null;)Ic(e,n,o),e=e.sibling}function $c(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($c(e,n,o),e=e.sibling;e!==null;)$c(e,n,o),e=e.sibling}var un=null,Pr=!1;function Zo(e,n,o){for(o=o.child;o!==null;)Sh(e,n,o),o=o.sibling}function Sh(e,n,o){if(En&&typeof En.onCommitFiberUnmount=="function")try{En.onCommitFiberUnmount(ar,o)}catch{}switch(o.tag){case 5:wn||vs(o,n);case 6:var u=un,h=Pr;un=null,Zo(e,n,o),un=u,Pr=h,un!==null&&(Pr?(e=un,o=o.stateNode,e.nodeType===8?e.parentNode.removeChild(o):e.removeChild(o)):un.removeChild(o.stateNode));break;case 18:un!==null&&(Pr?(e=un,o=o.stateNode,e.nodeType===8?qu(e.parentNode,o):e.nodeType===1&&qu(e,o),lo(e)):qu(un,o.stateNode));break;case 4:u=un,h=Pr,un=o.stateNode.containerInfo,Pr=!0,Zo(e,n,o),un=u,Pr=h;break;case 0:case 11:case 14:case 15:if(!wn&&(u=o.updateQueue,u!==null&&(u=u.lastEffect,u!==null))){h=u=u.next;do{var g=h,E=g.destroy;g=g.tag,E!==void 0&&((g&2)!==0||(g&4)!==0)&&Mc(o,n,E),h=h.next}while(h!==u)}Zo(e,n,o);break;case 1:if(!wn&&(vs(o,n),u=o.stateNode,typeof u.componentWillUnmount=="function"))try{u.props=o.memoizedProps,u.state=o.memoizedState,u.componentWillUnmount()}catch(L){Ft(o,n,L)}Zo(e,n,o);break;case 21:Zo(e,n,o);break;case 22:o.mode&1?(wn=(u=wn)||o.memoizedState!==null,Zo(e,n,o),wn=u):Zo(e,n,o);break;default:Zo(e,n,o)}}function kh(e){var n=e.updateQueue;if(n!==null){e.updateQueue=null;var o=e.stateNode;o===null&&(o=e.stateNode=new Bg),n.forEach(function(u){var h=Gg.bind(null,e,u);o.has(u)||(o.add(u),u.then(h,h))})}}function Mr(e,n){var o=n.deletions;if(o!==null)for(var u=0;u<o.length;u++){var h=o[u];try{var g=e,E=n,L=E;e:for(;L!==null;){switch(L.tag){case 5:un=L.stateNode,Pr=!1;break e;case 3:un=L.stateNode.containerInfo,Pr=!0;break e;case 4:un=L.stateNode.containerInfo,Pr=!0;break e}L=L.return}if(un===null)throw Error(i(160));Sh(g,E,h),un=null,Pr=!1;var X=h.alternate;X!==null&&(X.return=null),h.return=null}catch(ye){Ft(h,n,ye)}}if(n.subtreeFlags&12854)for(n=n.child;n!==null;)Nh(n,e),n=n.sibling}function Nh(e,n){var o=e.alternate,u=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Mr(n,e),Wr(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:Mr(n,e),Wr(e),u&512&&o!==null&&vs(o,o.return);break;case 5:if(Mr(n,e),Wr(e),u&512&&o!==null&&vs(o,o.return),e.flags&32){var h=e.stateNode;try{Sn(h,"")}catch(Ge){Ft(e,e.return,Ge)}}if(u&4&&(h=e.stateNode,h!=null)){var g=e.memoizedProps,E=o!==null?o.memoizedProps:g,L=e.type,X=e.updateQueue;if(e.updateQueue=null,X!==null)try{L==="input"&&g.type==="radio"&&g.name!=null&&it(h,g),Kn(L,E);var ye=Kn(L,g);for(E=0;E<X.length;E+=2){var Pe=X[E],Ie=X[E+1];Pe==="style"?nr(h,Ie):Pe==="dangerouslySetInnerHTML"?tr(h,Ie):Pe==="children"?Sn(h,Ie):P(h,Pe,Ie,ye)}switch(L){case"input":Tt(h,g);break;case"textarea":gr(h,g);break;case"select":var je=h._wrapperState.wasMultiple;h._wrapperState.wasMultiple=!!g.multiple;var Ue=g.value;Ue!=null?St(h,!!g.multiple,Ue,!1):je!==!!g.multiple&&(g.defaultValue!=null?St(h,!!g.multiple,g.defaultValue,!0):St(h,!!g.multiple,g.multiple?[]:"",!1))}h[ea]=g}catch(Ge){Ft(e,e.return,Ge)}}break;case 6:if(Mr(n,e),Wr(e),u&4){if(e.stateNode===null)throw Error(i(162));h=e.stateNode,g=e.memoizedProps;try{h.nodeValue=g}catch(Ge){Ft(e,e.return,Ge)}}break;case 3:if(Mr(n,e),Wr(e),u&4&&o!==null&&o.memoizedState.isDehydrated)try{lo(n.containerInfo)}catch(Ge){Ft(e,e.return,Ge)}break;case 4:Mr(n,e),Wr(e);break;case 13:Mr(n,e),Wr(e),h=e.child,h.flags&8192&&(g=h.memoizedState!==null,h.stateNode.isHidden=g,!g||h.alternate!==null&&h.alternate.memoizedState!==null||(Rc=gt())),u&4&&kh(e);break;case 22:if(Pe=o!==null&&o.memoizedState!==null,e.mode&1?(wn=(ye=wn)||Pe,Mr(n,e),wn=ye):Mr(n,e),Wr(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(Ie=Xe=Pe;Xe!==null;){switch(je=Xe,Ue=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){jh(Ie);continue}}Ue!==null?(Ue.return=je,Xe=Ue):jh(Ie)}Pe=Pe.sibling}e:for(Pe=null,Ie=e;;){if(Ie.tag===5){if(Pe===null){Pe=Ie;try{h=Ie.stateNode,ye?(g=h.style,typeof g.setProperty=="function"?g.setProperty("display","none","important"):g.display="none"):(L=Ie.stateNode,X=Ie.memoizedProps.style,E=X!=null&&X.hasOwnProperty("display")?X.display:null,L.style.display=dn("display",E))}catch(Ge){Ft(e,e.return,Ge)}}}else if(Ie.tag===6){if(Pe===null)try{Ie.stateNode.nodeValue=ye?"":Ie.memoizedProps}catch(Ge){Ft(e,e.return,Ge)}}else if((Ie.tag!==22&&Ie.tag!==23||Ie.memoizedState===null||Ie===e)&&Ie.child!==null){Ie.child.return=Ie,Ie=Ie.child;continue}if(Ie===e)break e;for(;Ie.sibling===null;){if(Ie.return===null||Ie.return===e)break e;Pe===Ie&&(Pe=null),Ie=Ie.return}Pe===Ie&&(Pe=null),Ie.sibling.return=Ie.return,Ie=Ie.sibling}}break;case 19:Mr(n,e),Wr(e),u&4&&kh(e);break;case 21:break;default:Mr(n,e),Wr(e)}}function Wr(e){var n=e.flags;if(n&2){try{e:{for(var o=e.return;o!==null;){if(bh(o)){var u=o;break e}o=o.return}throw Error(i(160))}switch(u.tag){case 5:var h=u.stateNode;u.flags&32&&(Sn(h,""),u.flags&=-33);var g=_h(e);$c(e,g,h);break;case 3:case 4:var E=u.stateNode.containerInfo,L=_h(e);Ic(e,L,E);break;default:throw Error(i(161))}}catch(X){Ft(e,e.return,X)}e.flags&=-3}n&4096&&(e.flags&=-4097)}function Vg(e,n,o){Xe=e,Eh(e)}function Eh(e,n,o){for(var u=(e.mode&1)!==0;Xe!==null;){var h=Xe,g=h.child;if(h.tag===22&&u){var E=h.memoizedState!==null||Nl;if(!E){var L=h.alternate,X=L!==null&&L.memoizedState!==null||wn;L=Nl;var ye=wn;if(Nl=E,(wn=X)&&!ye)for(Xe=h;Xe!==null;)E=Xe,X=E.child,E.tag===22&&E.memoizedState!==null?Ph(h):X!==null?(X.return=E,Xe=X):Ph(h);for(;g!==null;)Xe=g,Eh(g),g=g.sibling;Xe=h,Nl=L,wn=ye}Ch(e)}else(h.subtreeFlags&8772)!==0&&g!==null?(g.return=h,Xe=g):Ch(e)}}function Ch(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:wn||El(5,n);break;case 1:var u=n.stateNode;if(n.flags&4&&!wn)if(o===null)u.componentDidMount();else{var h=n.elementType===n.type?o.memoizedProps:jr(n.type,o.memoizedProps);u.componentDidUpdate(h,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 L=n.stateNode;if(o===null&&n.flags&4){o=L;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 Ie=Pe.dehydrated;Ie!==null&&lo(Ie)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(i(163))}wn||n.flags&512&&Tc(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 jh(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 Ph(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 h=n.return;try{u.componentDidMount()}catch(X){Ft(n,h,X)}}var g=n.return;try{Tc(n)}catch(X){Ft(n,g,X)}break;case 5:var E=n.return;try{Tc(n)}catch(X){Ft(n,E,X)}}}catch(X){Ft(n,n.return,X)}if(n===e){Xe=null;break}var L=n.sibling;if(L!==null){L.return=n.return,Xe=L;break}Xe=n.return}}var Kg=Math.ceil,Cl=R.ReactCurrentDispatcher,Ac=R.ReactCurrentOwner,pr=R.ReactCurrentBatchConfig,vt=0,en=null,qt=null,cn=0,Jn=0,xs=Yo(0),Qt=0,da=null,ji=0,jl=0,Oc=0,ha=null,Ln=null,Rc=0,ws=1/0,Eo=null,Pl=!1,Dc=null,ei=null,Ml=!1,ti=null,Tl=0,pa=0,Lc=null,Il=-1,$l=0;function jn(){return(vt&6)!==0?gt():Il!==-1?Il:Il=gt()}function ni(e){return(e.mode&1)===0?1:(vt&2)!==0&&cn!==0?cn&-cn:Cg.transition!==null?($l===0&&($l=Fr()),$l):(e=xt,e!==0||(e=window.event,e=e===void 0?16:qi(e.type)),e)}function Tr(e,n,o,u){if(50<pa)throw pa=0,Lc=null,Error(i(185));ur(e,o,u),((vt&2)===0||e!==en)&&(e===en&&((vt&2)===0&&(jl|=o),Qt===4&&ri(e,cn)),zn(e,u),o===1&&vt===0&&(n.mode&1)===0&&(ws=gt()+500,al&&Qo()))}function zn(e,n){var o=e.callbackNode;io(e,n);var u=yt(e,e===en?cn:0);if(u===0)o!==null&&$o(o),e.callbackNode=null,e.callbackPriority=0;else if(n=u&-u,e.callbackPriority!==n){if(o!=null&&$o(o),n===1)e.tag===0?Eg(Th.bind(null,e)):gd(Th.bind(null,e)),_g(function(){(vt&6)===0&&Qo()}),o=null;else{switch(Ba(u)){case 1:o=Dr;break;case 4:o=Ao;break;case 16:o=Lr;break;case 536870912:o=fi;break;default:o=Lr}o=zh(o,Mh.bind(null,e))}e.callbackPriority=n,e.callbackNode=o}}function Mh(e,n){if(Il=-1,$l=0,(vt&6)!==0)throw Error(i(327));var o=e.callbackNode;if(bs()&&e.callbackNode!==o)return null;var u=yt(e,e===en?cn:0);if(u===0)return null;if((u&30)!==0||(u&e.expiredLanes)!==0||n)n=Al(e,u);else{n=u;var h=vt;vt|=2;var g=$h();(en!==e||cn!==n)&&(Eo=null,ws=gt()+500,Mi(e,n));do try{Wg();break}catch(L){Ih(e,L)}while(!0);nc(),Cl.current=g,vt=h,qt!==null?n=0:(en=null,cn=0,n=Qt)}if(n!==0){if(n===2&&(h=lr(e),h!==0&&(u=h,n=zc(e,h))),n===1)throw o=da,Mi(e,0),ri(e,u),zn(e,gt()),o;if(n===6)ri(e,u);else{if(h=e.current.alternate,(u&30)===0&&!Ug(h)&&(n=Al(e,u),n===2&&(g=lr(e),g!==0&&(u=g,n=zc(e,g))),n===1))throw o=da,Mi(e,0),ri(e,u),zn(e,gt()),o;switch(e.finishedWork=h,e.finishedLanes=u,n){case 0:case 1:throw Error(i(345));case 2:Ti(e,Ln,Eo);break;case 3:if(ri(e,u),(u&130023424)===u&&(n=Rc+500-gt(),10<n)){if(yt(e,0)!==0)break;if(h=e.suspendedLanes,(h&u)!==u){jn(),e.pingedLanes|=e.suspendedLanes&h;break}e.timeoutHandle=Uu(Ti.bind(null,e,Ln,Eo),n);break}Ti(e,Ln,Eo);break;case 4:if(ri(e,u),(u&4194240)===u)break;for(n=e.eventTimes,h=-1;0<u;){var E=31-pn(u);g=1<<E,E=n[E],E>h&&(h=E),u&=~g}if(u=h,u=gt()-u,u=(120>u?120:480>u?480:1080>u?1080:1920>u?1920:3e3>u?3e3:4320>u?4320:1960*Kg(u/1960))-u,10<u){e.timeoutHandle=Uu(Ti.bind(null,e,Ln,Eo),u);break}Ti(e,Ln,Eo);break;case 5:Ti(e,Ln,Eo);break;default:throw Error(i(329))}}}return zn(e,gt()),e.callbackNode===o?Mh.bind(null,e):null}function zc(e,n){var o=ha;return e.current.memoizedState.isDehydrated&&(Mi(e,n).flags|=256),e=Al(e,n),e!==2&&(n=Ln,Ln=o,n!==null&&Fc(n)),e}function Fc(e){Ln===null?Ln=e:Ln.push.apply(Ln,e)}function Ug(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 h=o[u],g=h.getSnapshot;h=h.value;try{if(!ce(g(),h))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 ri(e,n){for(n&=~Oc,n&=~jl,e.suspendedLanes|=n,e.pingedLanes&=~n,e=e.expirationTimes;0<n;){var o=31-pn(n),u=1<<o;e[o]=-1,n&=~u}}function Th(e){if((vt&6)!==0)throw Error(i(327));bs();var n=yt(e,0);if((n&1)===0)return zn(e,gt()),null;var o=Al(e,n);if(e.tag!==0&&o===2){var u=lr(e);u!==0&&(n=u,o=zc(e,u))}if(o===1)throw o=da,Mi(e,0),ri(e,n),zn(e,gt()),o;if(o===6)throw Error(i(345));return e.finishedWork=e.current.alternate,e.finishedLanes=n,Ti(e,Ln,Eo),zn(e,gt()),null}function Bc(e,n){var o=vt;vt|=1;try{return e(n)}finally{vt=o,vt===0&&(ws=gt()+500,al&&Qo())}}function Pi(e){ti!==null&&ti.tag===0&&(vt&6)===0&&bs();var n=vt;vt|=1;var o=pr.transition,u=xt;try{if(pr.transition=null,xt=1,e)return e()}finally{xt=u,pr.transition=o,vt=n,(vt&6)===0&&Qo()}}function Hc(){Jn=xs.current,Pt(xs)}function Mi(e,n){e.finishedWork=null,e.finishedLanes=0;var o=e.timeoutHandle;if(o!==-1&&(e.timeoutHandle=-1,bg(o)),qt!==null)for(o=qt.return;o!==null;){var u=o;switch(Gu(u),u.tag){case 1:u=u.type.childContextTypes,u!=null&&il();break;case 3:gs(),Pt(On),Pt(yn),cc();break;case 5:lc(u);break;case 4:gs();break;case 13:Pt(Dt);break;case 19:Pt(Dt);break;case 10:rc(u.type._context);break;case 22:case 23:Hc()}o=o.return}if(en=e,qt=e=oi(e.current,null),cn=Jn=n,Qt=0,da=null,Oc=jl=ji=0,Ln=ha=null,Ni!==null){for(n=0;n<Ni.length;n++)if(o=Ni[n],u=o.interleaved,u!==null){o.interleaved=null;var h=u.next,g=o.pending;if(g!==null){var E=g.next;g.next=h,u.next=E}o.pending=u}Ni=null}return e}function Ih(e,n){do{var o=qt;try{if(nc(),yl.current=bl,vl){for(var u=Lt.memoizedState;u!==null;){var h=u.queue;h!==null&&(h.pending=null),u=u.next}vl=!1}if(Ci=0,Zt=Xt=Lt=null,sa=!1,aa=0,Ac.current=null,o===null||o.return===null){Qt=1,da=n,qt=null;break}e:{var g=e,E=o.return,L=o,X=n;if(n=cn,L.flags|=32768,X!==null&&typeof X=="object"&&typeof X.then=="function"){var ye=X,Pe=L,Ie=Pe.tag;if((Pe.mode&1)===0&&(Ie===0||Ie===11||Ie===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 Ue=rh(E);if(Ue!==null){Ue.flags&=-257,oh(Ue,E,L,g,n),Ue.mode&1&&nh(g,ye,n),n=Ue,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){nh(g,ye,n),Vc();break e}X=Error(i(426))}}else if($t&&L.mode&1){var Bt=rh(E);if(Bt!==null){(Bt.flags&65536)===0&&(Bt.flags|=256),oh(Bt,E,L,g,n),ec(ys(X,L));break e}}g=X=ys(X,L),Qt!==4&&(Qt=2),ha===null?ha=[g]:ha.push(g),g=E;do{switch(g.tag){case 3:g.flags|=65536,n&=-n,g.lanes|=n;var pe=eh(g,X,n);Cd(g,pe);break e;case 1:L=X;var ne=g.type,me=g.stateNode;if((g.flags&128)===0&&(typeof ne.getDerivedStateFromError=="function"||me!==null&&typeof me.componentDidCatch=="function"&&(ei===null||!ei.has(me)))){g.flags|=65536,n&=-n,g.lanes|=n;var ze=th(g,L,n);Cd(g,ze);break e}}g=g.return}while(g!==null)}Oh(o)}catch(Je){n=Je,qt===o&&o!==null&&(qt=o=o.return);continue}break}while(!0)}function $h(){var e=Cl.current;return Cl.current=bl,e===null?bl:e}function Vc(){(Qt===0||Qt===3||Qt===2)&&(Qt=4),en===null||(ji&268435455)===0&&(jl&268435455)===0||ri(en,cn)}function Al(e,n){var o=vt;vt|=2;var u=$h();(en!==e||cn!==n)&&(Eo=null,Mi(e,n));do try{qg();break}catch(h){Ih(e,h)}while(!0);if(nc(),vt=o,Cl.current=u,qt!==null)throw Error(i(261));return en=null,cn=0,Qt}function qg(){for(;qt!==null;)Ah(qt)}function Wg(){for(;qt!==null&&!Et();)Ah(qt)}function Ah(e){var n=Lh(e.alternate,e,Jn);e.memoizedProps=e.pendingProps,n===null?Oh(e):qt=n,Ac.current=null}function Oh(e){var n=e;do{var o=n.alternate;if(e=n.return,(n.flags&32768)===0){if(o=zg(o,n,Jn),o!==null){qt=o;return}}else{if(o=Fg(o,n),o!==null){o.flags&=32767,qt=o;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Qt=6,qt=null;return}}if(n=n.sibling,n!==null){qt=n;return}qt=n=e}while(n!==null);Qt===0&&(Qt=5)}function Ti(e,n,o){var u=xt,h=pr.transition;try{pr.transition=null,xt=1,Yg(e,n,o,u)}finally{pr.transition=h,xt=u}return null}function Yg(e,n,o,u){do bs();while(ti!==null);if((vt&6)!==0)throw Error(i(327));o=e.finishedWork;var h=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(di(e,g),e===en&&(qt=en=null,cn=0),(o.subtreeFlags&2064)===0&&(o.flags&2064)===0||Ml||(Ml=!0,zh(Lr,function(){return bs(),null})),g=(o.flags&15990)!==0,(o.subtreeFlags&15990)!==0||g){g=pr.transition,pr.transition=null;var E=xt;xt=1;var L=vt;vt|=4,Ac.current=null,Hg(e,o),Nh(o,e),se(Vu),Ui=!!Hu,Vu=Hu=null,e.current=o,Vg(o),sr(),vt=L,xt=E,pr.transition=g}else e.current=o;if(Ml&&(Ml=!1,ti=e,Tl=h),g=e.pendingLanes,g===0&&(ei=null),ft(o.stateNode),zn(e,gt()),n!==null)for(u=e.onRecoverableError,o=0;o<n.length;o++)h=n[o],u(h.value,{componentStack:h.stack,digest:h.digest});if(Pl)throw Pl=!1,e=Dc,Dc=null,e;return(Tl&1)!==0&&e.tag!==0&&bs(),g=e.pendingLanes,(g&1)!==0?e===Lc?pa++:(pa=0,Lc=e):pa=0,Qo(),null}function bs(){if(ti!==null){var e=Ba(Tl),n=pr.transition,o=xt;try{if(pr.transition=null,xt=16>e?16:e,ti===null)var u=!1;else{if(e=ti,ti=null,Tl=0,(vt&6)!==0)throw Error(i(331));var h=vt;for(vt|=4,Xe=e.current;Xe!==null;){var g=Xe,E=g.child;if((Xe.flags&16)!==0){var L=g.deletions;if(L!==null){for(var X=0;X<L.length;X++){var ye=L[X];for(Xe=ye;Xe!==null;){var Pe=Xe;switch(Pe.tag){case 0:case 11:case 15:fa(8,Pe,g)}var Ie=Pe.child;if(Ie!==null)Ie.return=Pe,Xe=Ie;else for(;Xe!==null;){Pe=Xe;var je=Pe.sibling,Ue=Pe.return;if(wh(Pe),Pe===ye){Xe=null;break}if(je!==null){je.return=Ue,Xe=je;break}Xe=Ue}}}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 pe=g.sibling;if(pe!==null){pe.return=g.return,Xe=pe;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(L=Xe,(L.flags&2048)!==0)try{switch(L.tag){case 0:case 11:case 15:El(9,L)}}catch(Je){Ft(L,L.return,Je)}if(L===E){Xe=null;break e}var ze=L.sibling;if(ze!==null){ze.return=L.return,Xe=ze;break e}Xe=L.return}}if(vt=h,Qo(),En&&typeof En.onPostCommitFiberRoot=="function")try{En.onPostCommitFiberRoot(ar,e)}catch{}u=!0}return u}finally{xt=o,pr.transition=n}}return!1}function Rh(e,n,o){n=ys(o,n),n=eh(e,n,1),e=Jo(e,n,1),n=jn(),e!==null&&(ur(e,1,n),zn(e,n))}function Ft(e,n,o){if(e.tag===3)Rh(e,e,o);else for(;n!==null;){if(n.tag===3){Rh(n,e,o);break}else if(n.tag===1){var u=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof u.componentDidCatch=="function"&&(ei===null||!ei.has(u))){e=ys(o,e),e=th(n,e,1),n=Jo(n,e,1),e=jn(),n!==null&&(ur(n,1,e),zn(n,e));break}}n=n.return}}function Xg(e,n,o){var u=e.pingCache;u!==null&&u.delete(n),n=jn(),e.pingedLanes|=e.suspendedLanes&o,en===e&&(cn&o)===o&&(Qt===4||Qt===3&&(cn&130023424)===cn&&500>gt()-Rc?Mi(e,0):Oc|=o),zn(e,n)}function Dh(e,n){n===0&&((e.mode&1)===0?n=1:(n=oo,oo<<=1,(oo&130023424)===0&&(oo=4194304)));var o=jn();e=So(e,n),e!==null&&(ur(e,n,o),zn(e,o))}function Qg(e){var n=e.memoizedState,o=0;n!==null&&(o=n.retryLane),Dh(e,o)}function Gg(e,n){var o=0;switch(e.tag){case 13:var u=e.stateNode,h=e.memoizedState;h!==null&&(o=h.retryLane);break;case 19:u=e.stateNode;break;default:throw Error(i(314))}u!==null&&u.delete(n),Dh(e,o)}var Lh;Lh=function(e,n,o){if(e!==null)if(e.memoizedProps!==n.pendingProps||On.current)Dn=!0;else{if((e.lanes&o)===0&&(n.flags&128)===0)return Dn=!1,Lg(e,n,o);Dn=(e.flags&131072)!==0}else Dn=!1,$t&&(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 h=us(n,yn.current);ms(n,o),h=hc(null,n,u,e,h,o);var g=pc();return n.flags|=1,typeof h=="object"&&h!==null&&typeof h.render=="function"&&h.$$typeof===void 0?(n.tag=1,n.memoizedState=null,n.updateQueue=null,Rn(u)?(g=!0,sl(n)):g=!1,n.memoizedState=h.state!==null&&h.state!==void 0?h.state:null,sc(n),h.updater=_l,n.stateNode=h,h._reactInternals=n,wc(n,u,e,o),n=kc(null,n,u,!0,g,o)):(n.tag=0,$t&&g&&Qu(n),Cn(null,n,h,o),n=n.child),n;case 16:u=n.elementType;e:{switch(kl(e,n),e=n.pendingProps,h=u._init,u=h(u._payload),n.type=u,h=n.tag=Zg(u),e=jr(u,e),h){case 0:n=Sc(null,n,u,e,o);break e;case 1:n=ch(null,n,u,e,o);break e;case 11:n=ih(null,n,u,e,o);break e;case 14:n=sh(null,n,u,jr(u.type,e),o);break e}throw Error(i(306,u,""))}return n;case 0:return u=n.type,h=n.pendingProps,h=n.elementType===u?h:jr(u,h),Sc(e,n,u,h,o);case 1:return u=n.type,h=n.pendingProps,h=n.elementType===u?h:jr(u,h),ch(e,n,u,h,o);case 3:e:{if(fh(n),e===null)throw Error(i(387));u=n.pendingProps,g=n.memoizedState,h=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){h=ys(Error(i(423)),n),n=dh(e,n,u,o,h);break e}else if(u!==h){h=ys(Error(i(424)),n),n=dh(e,n,u,o,h);break e}else for(Gn=Wo(n.stateNode.containerInfo.firstChild),Qn=n,$t=!0,Cr=null,o=kd(n,null,u,o),n.child=o;o;)o.flags=o.flags&-3|4096,o=o.sibling;else{if(ds(),u===h){n=No(e,n,o);break e}Cn(e,n,u,o)}n=n.child}return n;case 5:return Pd(n),e===null&&Zu(n),u=n.type,h=n.pendingProps,g=e!==null?e.memoizedProps:null,E=h.children,Ku(u,h)?E=null:g!==null&&Ku(u,g)&&(n.flags|=32),uh(e,n),Cn(e,n,E,o),n.child;case 6:return e===null&&Zu(n),null;case 13:return hh(e,n,o);case 4:return ac(n,n.stateNode.containerInfo),u=n.pendingProps,e===null?n.child=hs(n,null,u,o):Cn(e,n,u,o),n.child;case 11:return u=n.type,h=n.pendingProps,h=n.elementType===u?h:jr(u,h),ih(e,n,u,h,o);case 7:return Cn(e,n,n.pendingProps,o),n.child;case 8:return Cn(e,n,n.pendingProps.children,o),n.child;case 12:return Cn(e,n,n.pendingProps.children,o),n.child;case 10:e:{if(u=n.type._context,h=n.pendingProps,g=n.memoizedProps,E=h.value,kt(dl,u._currentValue),u._currentValue=E,g!==null)if(ce(g.value,E)){if(g.children===h.children&&!On.current){n=No(e,n,o);break e}}else for(g=n.child,g!==null&&(g.return=n);g!==null;){var L=g.dependencies;if(L!==null){E=g.child;for(var X=L.firstContext;X!==null;){if(X.context===u){if(g.tag===1){X=ko(-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),L.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,L=E.alternate,L!==null&&(L.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}Cn(e,n,h.children,o),n=n.child}return n;case 9:return h=n.type,u=n.pendingProps.children,ms(n,o),h=dr(h),u=u(h),n.flags|=1,Cn(e,n,u,o),n.child;case 14:return u=n.type,h=jr(u,n.pendingProps),h=jr(u.type,h),sh(e,n,u,h,o);case 15:return ah(e,n,n.type,n.pendingProps,o);case 17:return u=n.type,h=n.pendingProps,h=n.elementType===u?h:jr(u,h),kl(e,n),n.tag=1,Rn(u)?(e=!0,sl(n)):e=!1,ms(n,o),Jd(n,u,h),wc(n,u,h,o),kc(null,n,u,!0,e,o);case 19:return mh(e,n,o);case 22:return lh(e,n,o)}throw Error(i(156,n.tag))};function zh(e,n){return ci(e,n)}function Jg(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 mr(e,n,o,u){return new Jg(e,n,o,u)}function Kc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Zg(e){if(typeof e=="function")return Kc(e)?1:0;if(e!=null){if(e=e.$$typeof,e===fe)return 11;if(e===ue)return 14}return 2}function oi(e,n){var o=e.alternate;return o===null?(o=mr(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,h,g){var E=2;if(u=e,typeof e=="function")Kc(e)&&(E=1);else if(typeof e=="string")E=5;else e:switch(e){case B:return Ii(o.children,h,g,n);case ae:E=8,h|=8;break;case de:return e=mr(12,o,n,h|2),e.elementType=de,e.lanes=g,e;case xe:return e=mr(13,o,n,h),e.elementType=xe,e.lanes=g,e;case D:return e=mr(19,o,n,h),e.elementType=D,e.lanes=g,e;case ie:return Rl(o,h,g,n);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case we:E=10;break e;case H:E=9;break e;case fe:E=11;break e;case ue:E=14;break e;case G:E=16,u=null;break e}throw Error(i(130,e==null?e:typeof e,""))}return n=mr(E,o,n,h),n.elementType=e,n.type=u,n.lanes=g,n}function Ii(e,n,o,u){return e=mr(7,e,u,n),e.lanes=o,e}function Rl(e,n,o,u){return e=mr(22,e,u,n),e.elementType=ie,e.lanes=o,e.stateNode={isHidden:!1},e}function Uc(e,n,o){return e=mr(6,e,null,n),e.lanes=o,e}function qc(e,n,o){return n=mr(4,e.children!==null?e.children:[],e.key,n),n.lanes=o,n.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},n}function ey(e,n,o,u,h){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=so(0),this.expirationTimes=so(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=so(0),this.identifierPrefix=u,this.onRecoverableError=h,this.mutableSourceEagerHydrationData=null}function Wc(e,n,o,u,h,g,E,L,X){return e=new ey(e,n,o,L,X),n===1?(n=1,g===!0&&(n|=8)):n=0,g=mr(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 ty(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 Fh(e){if(!e)return Xo;e=e._reactInternals;e:{if(zt(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(Rn(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(Rn(o))return pd(e,o,n)}return n}function Bh(e,n,o,u,h,g,E,L,X){return e=Wc(o,u,!0,e,h,g,E,L,X),e.context=Fh(null),o=e.current,u=jn(),h=ni(o),g=ko(u,h),g.callback=n??null,Jo(o,g,h),e.current.lanes=h,ur(e,h,u),zn(e,u),e}function Dl(e,n,o,u){var h=n.current,g=jn(),E=ni(h);return o=Fh(o),n.context===null?n.context=o:n.pendingContext=o,n=ko(g,E),n.payload={element:e},u=u===void 0?null:u,u!==null&&(n.callback=u),e=Jo(h,n,E),e!==null&&(Tr(e,h,E,g),pl(e,h,E)),E}function Ll(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 Hh(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){Hh(e,n),(e=e.alternate)&&Hh(e,n)}function ny(){return null}var Vh=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));Dl(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;Pi(function(){Dl(null,e,null,null)}),n[xo]=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<$n.length&&n!==0&&n<$n[o].priority;o++);$n.splice(o,0,e),o===0&&Xn(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 Kh(){}function ry(e,n,o,u,h){if(h){if(typeof u=="function"){var g=u;u=function(){var ye=Ll(E);g.call(ye)}}var E=Bh(n,u,e,0,null,!1,!1,"",Kh);return e._reactRootContainer=E,e[xo]=E.current,Js(e.nodeType===8?e.parentNode:e),Pi(),E}for(;h=e.lastChild;)e.removeChild(h);if(typeof u=="function"){var L=u;u=function(){var ye=Ll(X);L.call(ye)}}var X=Wc(e,0,!1,null,null,!1,!1,"",Kh);return e._reactRootContainer=X,e[xo]=X.current,Js(e.nodeType===8?e.parentNode:e),Pi(function(){Dl(n,X,o,u)}),X}function Bl(e,n,o,u,h){var g=o._reactRootContainer;if(g){var E=g;if(typeof h=="function"){var L=h;h=function(){var X=Ll(E);L.call(X)}}Dl(n,E,e,h)}else E=ry(o,n,e,h,u);return Ll(E)}pt=function(e){switch(e.tag){case 3:var n=e.stateNode;if(n.current.memoizedState.isDehydrated){var o=Yn(n.pendingLanes);o!==0&&(Ro(n,o|1),zn(n,gt()),(vt&6)===0&&(ws=gt()+500,Qo()))}break;case 13:Pi(function(){var u=So(e,1);if(u!==null){var h=jn();Tr(u,e,1,h)}}),Yc(e,1)}},Vi=function(e){if(e.tag===13){var n=So(e,134217728);if(n!==null){var o=jn();Tr(n,e,134217728,o)}Yc(e,134217728)}},Ha=function(e){if(e.tag===13){var n=ni(e),o=So(e,n);if(o!==null){var u=jn();Tr(o,e,n,u)}Yc(e,n)}},Va=function(){return xt},mn=function(e,n){var o=xt;try{return xt=e,n()}finally{xt=o}},Ve=function(e,n,o){switch(n){case"input":if(Tt(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 h=ol(u);if(!h)throw Error(i(90));Oe(u),Tt(u,h)}}}break;case"textarea":gr(e,o);break;case"select":n=o.value,n!=null&&St(e,!!o.multiple,n,!1)}},Io=Bc,eo=Pi;var oy={usingClientEntryPoint:!1,Events:[ta,as,ol,Zr,vr,Bc]},ma={findFiberByHostInstance:bi,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},iy={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=ui(e),e===null?null:e.stateNode},findFiberByHostInstance:ma.findFiberByHostInstance||ny,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{ar=Hl.inject(iy),En=Hl}catch{}}return Fn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=oy,Fn.createPortal=function(e,n){var o=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Qc(n))throw Error(i(200));return ty(e,n,null,o)},Fn.createRoot=function(e,n){if(!Qc(e))throw Error(i(299));var o=!1,u="",h=Vh;return n!=null&&(n.unstable_strictMode===!0&&(o=!0),n.identifierPrefix!==void 0&&(u=n.identifierPrefix),n.onRecoverableError!==void 0&&(h=n.onRecoverableError)),n=Wc(e,1,!1,null,null,o,!1,u,h),e[xo]=n.current,Js(e.nodeType===8?e.parentNode:e),new Xc(n)},Fn.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=ui(n),e=e===null?null:e.stateNode,e},Fn.flushSync=function(e){return Pi(e)},Fn.hydrate=function(e,n,o){if(!Fl(n))throw Error(i(200));return Bl(null,e,n,!0,o)},Fn.hydrateRoot=function(e,n,o){if(!Qc(e))throw Error(i(405));var u=o!=null&&o.hydratedSources||null,h=!1,g="",E=Vh;if(o!=null&&(o.unstable_strictMode===!0&&(h=!0),o.identifierPrefix!==void 0&&(g=o.identifierPrefix),o.onRecoverableError!==void 0&&(E=o.onRecoverableError)),n=Bh(n,null,e,1,o??null,h,!1,g,E),e[xo]=n.current,Js(e),u)for(e=0;e<u.length;e++)o=u[e],h=o._getVersion,h=h(o._source),n.mutableSourceEagerHydrationData==null?n.mutableSourceEagerHydrationData=[o,h]:n.mutableSourceEagerHydrationData.push(o,h);return new zl(n)},Fn.render=function(e,n,o){if(!Fl(n))throw Error(i(200));return Bl(null,e,n,!1,o)},Fn.unmountComponentAtNode=function(e){if(!Fl(e))throw Error(i(40));return e._reactRootContainer?(Pi(function(){Bl(null,null,e,!1,function(){e._reactRootContainer=null,e[xo]=null})}),!0):!1},Fn.unstable_batchedUpdates=Bc,Fn.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)},Fn.version="18.3.1-next-f1338f8080-20240426",Fn}var Jh;function ym(){if(Jh)return Zc.exports;Jh=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=my(),Zc.exports}var Zh;function gy(){if(Zh)return Vl;Zh=1;var t=ym();return Vl.createRoot=t.createRoot,Vl.hydrateRoot=t.hydrateRoot,Vl}var yy=gy();const vy=wu(yy),xy=["get","post","put","patch","delete","options","head","trace"];function ep(t){return t.replace(/[^a-zA-Z0-9]+/g,"_").replace(/^_|_$/g,"").replace(/_+/g,"_")}function bu(t,r,i,s){if(i)return ep(i).replace(/^[0-9]/,"_$&")||`op_${s}`;const l=ep(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 Gr(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 xy){const d=l[c];d&&typeof d=="object"&&r.push({method:c,path:i,operationId:d.operationId,tags:d.tags})}}return r}function wy(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 by(t){return vm(Gr(t),_u(t))}function _y(t,r){const i=Su(r),s=Gr(t).filter(l=>{var c;return(c=l.tags)==null?void 0:c.includes(r)});return vm(s,i)}function Sy(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 ky(t){return xm(Gr(t),_u(t))}function Ny(t,r){const i=Su(r),s=Gr(t).filter(l=>{var c;return(c=l.tags)==null?void 0:c.includes(r)});return xm(s,i)}function Ey(t,r,i){var d,m;const s=((m=(d=t.servers)==null?void 0:d[0])==null?void 0:m.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(),m=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${m})
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 Cy(t){return wm(Gr(t),_u(t))}function jy(t,r){const i=Su(r),s=Gr(t).filter(l=>{var c;return(c=l.tags)==null?void 0:c.includes(r)});return wm(s,i)}function Py(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 Py(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 My(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 T=c.content["application/json"].schema;T&&!("$ref"in T)&&(d=T)}const m=d?xf(d):"Record<string, unknown>",v=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: "${v}",
158
+ headers: { "Content-Type": "application/json", Authorization: \`Bearer \${token}\` },
159
+ ${v==="GET"||v==="HEAD"?"":`body: JSON.stringify({} as ${m}),`}
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 Ty(t){const r=Gr(t),i=_u(t);return bm(r,i)}function Iy(t,r){const i=Su(r),s=Gr(t).filter(l=>{var c;return(c=l.tags)==null?void 0:c.includes(r)});return bm(s,i)}function $y(t,r,i,s){switch(r){case"typescript":return My(t,i,s);case"javascript":return wy(t,i,s);case"python":return Ey(t,i,s);case"php":return Sy(t,i,s);default:{const l=r;throw new Error(`Unsupported language: ${l}`)}}}function Ay(t,r,i){switch(r){case"typescript":return Iy(t,i);case"javascript":return _y(t,i);case"python":return jy(t,i);case"php":return Ny(t,i);default:{const s=r;throw new Error(`Unsupported language: ${s}`)}}}function Oy(t,r,i){if(i===null)switch(r){case"typescript":return Ty(t);case"javascript":return by(t);case"python":return Cy(t);case"php":return ky(t);default:{const s=r;throw new Error(`Unsupported language: ${s}`)}}return Ay(t,r,i)}function Ry(t){const r=new Set;for(const i of Gr(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 Dy(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:{}},Ly=eu.exports,tp;function zy(){return tp||(tp=1,(function(t,r){((i,s)=>{t.exports=s()})(Ly,function(){var i=function(a,f){return(i=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(p,y){p.__proto__=y}:function(p,y){for(var _ in y)Object.prototype.hasOwnProperty.call(y,_)&&(p[_]=y[_])}))(a,f)},s=function(){return(s=Object.assign||function(a){for(var f,p=1,y=arguments.length;p<y;p++)for(var _ in f=arguments[p])Object.prototype.hasOwnProperty.call(f,_)&&(a[_]=f[_]);return a}).apply(this,arguments)};function l(a,f,p){for(var y,_=0,N=f.length;_<N;_++)!y&&_ in f||((y=y||Array.prototype.slice.call(f,0,_))[_]=f[_]);return a.concat(y||Array.prototype.slice.call(f))}var c=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:uy,d=Object.keys,m=Array.isArray;function v(a,f){return typeof f=="object"&&d(f).forEach(function(p){a[p]=f[p]}),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(p){j(a,p,f[p])})}var C=Object.defineProperty;function j(a,f,p,y){C(a,f,v(p&&w(p,"get")&&typeof p.get=="function"?{get:p.get,set:p.set,configurable:!0}:{value:p,configurable:!0,writable:!0},y))}function T(a){return{from:function(f){return a.prototype=Object.create(f.prototype),j(a.prototype,"constructor",a),{extend:S.bind(null,a.prototype)}}}}var $=Object.getOwnPropertyDescriptor,I=[].slice;function K(a,f,p){return I.call(a,f,p)}function P(a,f){return f(a)}function R(a){if(!a)throw new Error("Assertion Failed")}function Y(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 p=[],y=0,_=f.length;y<_;++y){var N=V(a,f[y]);p.push(N)}return p}var M,O=f.indexOf(".");return O===-1||(M=a[f.substr(0,O)])==null?void 0:V(M,f.substr(O+1))}function B(a,f,p){if(a&&f!==void 0&&!("isFrozen"in Object&&Object.isFrozen(a)))if(typeof f!="string"&&"length"in f){R(typeof p!="string"&&"length"in p);for(var y=0,_=f.length;y<_;++y)B(a,f[y],p[y])}else{var N,M,O=f.indexOf(".");O!==-1?(N=f.substr(0,O),(O=f.substr(O+1))===""?p===void 0?m(a)&&!isNaN(parseInt(N))?a.splice(N,1):delete a[N]:a[N]=p:B(M=(M=a[N])&&w(a,N)?M:a[N]={},O,p)):p===void 0?m(a)&&!isNaN(parseInt(f))?a.splice(f,1):delete a[f]:a[f]=p}}function ae(a){var f,p={};for(f in a)w(a,f)&&(p[f]=a[f]);return p}var de=[].concat;function we(a){return de.apply([],a)}var U="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]}),H=new Set(U.map(function(a){return c[a]})),fe=null;function xe(a){return fe=new WeakMap,a=(function f(p){if(!p||typeof p!="object")return p;var y=fe.get(p);if(y)return y;if(m(p)){y=[],fe.set(p,y);for(var _=0,N=p.length;_<N;++_)y.push(f(p[_]))}else if(H.has(p.constructor))y=p;else{var M,O=b(p);for(M in y=O===Object.prototype?{}:Object.create(O),fe.set(p,y),p)w(p,M)&&(y[M]=f(p[M]))}return y})(a),fe=null,a}var D={}.toString;function ue(a){return D.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 z(a,f){f=a.indexOf(f),0<=f&&a.splice(f,1)}var q={};function F(a){var f,p,y,_;if(arguments.length===1){if(m(a))return a.slice();if(this===q&&typeof a=="string")return[a];if(_=ie(a))for(p=[];!(y=_.next()).done;)p.push(y.value);else{if(a==null)return[a];if(typeof(f=a.length)!="number")return[a];for(p=new Array(f);f--;)p[f]=a[f]}}else for(f=arguments.length,p=new Array(f);f--;)p[f]=arguments[f];return p}var A=typeof Symbol<"u"?function(a){return a[Symbol.toStringTag]==="AsyncFunction"}:function(){return!1},U=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],Nt=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(U),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(p){return f[p].toString()}).filter(function(p,y,_){return _.indexOf(p)===y}).join(`
179
+ `)}function $e(a,f,p,y){this.failures=f,this.failedKeys=y,this.successCount=p,this.message=Me(a,f)}function Ae(a,f){this.name="BulkError",this.failures=Object.keys(f).map(function(p){return f[p]}),this.failuresByPos=f,this.message=Me(a,this.failures)}T(Se).from(Error).extend({toString:function(){return this.name+": "+this.message}}),T($e).from(Se),T(Ae).from(Se);var _e=Nt.reduce(function(a,f){return a[f]=f+"Error",a},{}),Be=Se,ke=Nt.reduce(function(a,f){var p=f+"Error";function y(_,N){this.name=p,_?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]||p,this.inner=null)}return T(y).from(Be),a[f]=y,a},{}),He=(ke.Syntax=SyntaxError,ke.Type=TypeError,ke.Range=RangeError,U.reduce(function(a,f){return a[f+"Error"]=ke[f],a},{}));U=Nt.reduce(function(a,f){return["Syntax","Type","Range"].indexOf(f)===-1&&(a[f+"Error"]=ke[f]),a},{});function Oe(){}function qe(a){return a}function ut(a,f){return a==null||a===qe?f:function(p){return f(a(p))}}function ct(a,f){return function(){a.apply(this,arguments),f.apply(this,arguments)}}function it(a,f){return a===Oe?f:function(){var p=a.apply(this,arguments),y=(p!==void 0&&(arguments[0]=p),this.onsuccess),_=this.onerror,N=(this.onsuccess=null,this.onerror=null,f.apply(this,arguments));return y&&(this.onsuccess=this.onsuccess?ct(y,this.onsuccess):y),_&&(this.onerror=this.onerror?ct(_,this.onerror):_),N!==void 0?N:p}}function Tt(a,f){return a===Oe?f:function(){a.apply(this,arguments);var p=this.onsuccess,y=this.onerror;this.onsuccess=this.onerror=null,f.apply(this,arguments),p&&(this.onsuccess=this.onsuccess?ct(p,this.onsuccess):p),y&&(this.onerror=this.onerror?ct(y,this.onerror):y)}}function _t(a,f){return a===Oe?f:function(_){var y=a.apply(this,arguments),_=(v(_,y),this.onsuccess),N=this.onerror,M=(this.onsuccess=null,this.onerror=null,f.apply(this,arguments));return _&&(this.onsuccess=this.onsuccess?ct(_,this.onsuccess):_),N&&(this.onerror=this.onerror?ct(N,this.onerror):N),y===void 0?M===void 0?void 0:M:v(y,M)}}function Ht(a,f){return a===Oe?f:function(){return f.apply(this,arguments)!==!1&&a.apply(this,arguments)}}function Ot(a,f){return a===Oe?f:function(){var p=a.apply(this,arguments);if(p&&typeof p.then=="function"){for(var y=this,_=arguments.length,N=new Array(_);_--;)N[_]=arguments[_];return p.then(function(){return f.apply(y,N)})}return f.apply(this,arguments)}}U.ModifyError=$e,U.DexieError=Se,U.BulkError=Ae;var St=typeof location<"u"&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function bn(a){St=a}var fn={},gr=100,_n=typeof Promise>"u"?[]:(Nt=Promise.resolve(),typeof crypto<"u"&&crypto.subtle?[_n=crypto.subtle.digest("SHA-512",new Uint8Array([0])),b(_n),Nt]:[Nt,b(Nt),Nt]),Nt=_n[0],po=_n[1],po=po&&po.then,Vt=Nt&&Nt.constructor,Hn=!!_n[2],tr=function(a,f){Kn.push([a,f]),Pn&&(queueMicrotask(eo),Pn=!1)},Sn=!0,Pn=!0,Vn=[],dn=[],nr=qe,kn={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:Oe,pgp:!1,env:{},finalize:Oe},Ye=kn,Kn=[],Nn=0,rr=[];function Ve(a){if(typeof this!="object")throw new TypeError("Promises must be constructed via new");this._listeners=[],this._lib=!1;var f=this._PSD=Ye;if(typeof a!="function"){if(a!==fn)throw new TypeError("Not a function");this._state=arguments[1],this._value=arguments[2],this._state===!1&&yr(this,this._value)}else this._state=null,this._value=null,++f.ref,(function p(y,_){try{_(function(N){if(y._state===null){if(N===y)throw new TypeError("A promise cannot be resolved with itself.");var M=y._lib&&hn();N&&typeof N.then=="function"?p(y,function(O,Z){N instanceof Ve?N._then(O,Z):N.then(O,Z)}):(y._state=!0,y._value=N,Zr(y)),M&&Tn()}},yr.bind(null,y))}catch(N){yr(y,N)}})(this,a)}var Mn={get:function(){var a=Ye,f=rn;function p(y,_){var N=this,M=!a.global&&(a!==Ye||f!==rn),O=M&&!zt(),Z=new Ve(function(ce,te){vr(N,new Un(ci(y,a,M,O),ci(_,a,M,O),ce,te,a))});return this._consoleTask&&(Z._consoleTask=this._consoleTask),Z}return p.prototype=fn,p},set:function(a){j(this,"then",a&&a.prototype===fn?Mn:{get:function(){return a},set:Mn.set})}};function Un(a,f,p,y,_){this.onFulfilled=typeof a=="function"?a:null,this.onRejected=typeof f=="function"?f:null,this.resolve=p,this.reject=y,this.psd=_}function yr(a,f){var p,y;dn.push(f),a._state===null&&(p=a._lib&&hn(),f=nr(f),a._state=!1,a._value=f,y=a,Vn.some(function(_){return _._value===y._value})||Vn.push(y),Zr(a),p)&&Tn()}function Zr(a){var f=a._listeners;a._listeners=[];for(var p=0,y=f.length;p<y;++p)vr(a,f[p]);var _=a._PSD;--_.ref||_.finalize(),Nn===0&&(++Nn,tr(function(){--Nn==0&&W()},[]))}function vr(a,f){if(a._state===null)a._listeners.push(f);else{var p=a._state?f.onFulfilled:f.onRejected;if(p===null)return(a._state?f.resolve:f.reject)(a._value);++f.psd.ref,++Nn,tr(Io,[p,a,f])}}function Io(a,f,p){try{var y,_=f._value;!f._state&&dn.length&&(dn=[]),y=St&&f._consoleTask?f._consoleTask.run(function(){return a(_)}):a(_),f._state||dn.indexOf(_)!==-1||(N=>{for(var M=Vn.length;M;)if(Vn[--M]._value===N._value)return Vn.splice(M,1)})(f),p.resolve(y)}catch(N){p.reject(N)}finally{--Nn==0&&W(),--p.psd.ref||p.psd.finalize()}}function eo(){ir(kn,function(){hn()&&Tn()})}function hn(){var a=Sn;return Pn=Sn=!1,a}function Tn(){var a,f,p;do for(;0<Kn.length;)for(a=Kn,Kn=[],p=a.length,f=0;f<p;++f){var y=a[f];y[0].apply(null,y[1])}while(0<Kn.length);Pn=Sn=!0}function W(){for(var a=Vn,f=(Vn=[],a.forEach(function(y){y._PSD.onunhandled.call(null,y._value,y)}),rr.slice(0)),p=f.length;p;)f[--p]()}function Fe(a){return new Ve(fn,!1,a)}function Le(a,f){var p=Ye;return function(){var y=hn(),_=Ye;try{return In(p,!0),a.apply(this,arguments)}catch(N){f&&f(N)}finally{In(_,!1),y&&Tn()}}}S(Ve.prototype,{then:Mn,_then:function(a,f){vr(this,new Un(null,null,a,f,Ye))},catch:function(a){var f,p;return arguments.length===1?this.then(null,a):(f=a,p=arguments[1],typeof f=="function"?this.then(null,function(y){return(y instanceof f?p:Fe)(y)}):this.then(null,function(y){return(y&&y.name===f?p:Fe)(y)}))},finally:function(a){return this.then(function(f){return Ve.resolve(a()).then(function(){return f})},function(f){return Ve.resolve(a()).then(function(){return Fe(f)})})},timeout:function(a,f){var p=this;return a<1/0?new Ve(function(y,_){var N=setTimeout(function(){return _(new ke.Timeout(f))},a);p.then(y,_).finally(clearTimeout.bind(null,N))}):this}}),typeof Symbol<"u"&&Symbol.toStringTag&&j(Ve.prototype,Symbol.toStringTag,"Dexie.Promise"),kn.env=ui(),S(Ve,{all:function(){var a=F.apply(null,arguments).map(Wn);return new Ve(function(f,p){a.length===0&&f([]);var y=a.length;a.forEach(function(_,N){return Ve.resolve(_).then(function(M){a[N]=M,--y||f(a)},p)})})},resolve:function(a){return a instanceof Ve?a:a&&typeof a.then=="function"?new Ve(function(f,p){a.then(f,p)}):new Ve(fn,!0,a)},reject:Fe,race:function(){var a=F.apply(null,arguments).map(Wn);return new Ve(function(f,p){a.map(function(y){return Ve.resolve(y).then(f,p)})})},PSD:{get:function(){return Ye},set:function(a){return Ye=a}},totalEchoes:{get:function(){return rn}},newPSD:on,usePSD:ir,scheduler:{get:function(){return tr},set:function(a){tr=a}},rejectionMapper:{get:function(){return nr},set:function(a){nr=a}},follow:function(a,f){return new Ve(function(p,y){return on(function(_,N){var M=Ye;M.unhandleds=[],M.onunhandled=N,M.finalize=ct(function(){var O,Z=this;O=function(){Z.unhandleds.length===0?_():N(Z.unhandleds[0])},rr.push(function ce(){O(),rr.splice(rr.indexOf(ce),1)}),++Nn,tr(function(){--Nn==0&&W()},[])},M.finalize),a()},f,p,y)})}}),Vt&&(Vt.allSettled&&j(Ve,"allSettled",function(){var a=F.apply(null,arguments).map(Wn);return new Ve(function(f){a.length===0&&f([]);var p=a.length,y=new Array(p);a.forEach(function(_,N){return Ve.resolve(_).then(function(M){return y[N]={status:"fulfilled",value:M}},function(M){return y[N]={status:"rejected",reason:M}}).then(function(){return--p||f(y)})})})}),Vt.any&&typeof AggregateError<"u"&&j(Ve,"any",function(){var a=F.apply(null,arguments).map(Wn);return new Ve(function(f,p){a.length===0&&p(new AggregateError([]));var y=a.length,_=new Array(y);a.forEach(function(N,M){return Ve.resolve(N).then(function(O){return f(O)},function(O){_[M]=O,--y||p(new AggregateError(_))})})})}),Vt.withResolvers)&&(Ve.withResolvers=Vt.withResolvers);var nt={awaits:0,echoes:0,id:0},nn=0,Yt=[],Kt=0,rn=0,to=0;function on(a,M,p,y){var _=Ye,N=Object.create(_),M=(N.parent=_,N.ref=0,N.global=!1,N.id=++to,kn.env,N.env=Hn?{Promise:Ve,PromiseProp:{value:Ve,configurable:!0,writable:!0},all:Ve.all,race:Ve.race,allSettled:Ve.allSettled,any:Ve.any,resolve:Ve.resolve,reject:Ve.reject}:{},M&&v(N,M),++_.ref,N.finalize=function(){--this.parent.ref||this.parent.finalize()},ir(N,a,p,y));return N.ref===0&&N.finalize(),M}function qn(){return nt.id||(nt.id=++nn),++nt.awaits,nt.echoes+=gr,nt.id}function zt(){return!!nt.awaits&&(--nt.awaits==0&&(nt.id=0),nt.echoes=nt.awaits*gr,!0)}function Wn(a){return nt.echoes&&a&&a.constructor===Vt?(qn(),a.then(function(f){return zt(),f},function(f){return zt(),Et(f)})):a}function or(){var a=Yt[Yt.length-1];Yt.pop(),In(a,!1)}function In(a,f){var p,y,_=Ye;(f?!nt.echoes||Kt++&&a===Ye:!Kt||--Kt&&a===Ye)||queueMicrotask(f?(function(N){++rn,nt.echoes&&--nt.echoes!=0||(nt.echoes=nt.awaits=nt.id=0),Yt.push(Ye),In(N,!0)}).bind(null,a):or),a!==Ye&&(Ye=a,_===kn&&(kn.env=ui()),Hn)&&(p=kn.env.Promise,y=a.env,_.global||a.global)&&(Object.defineProperty(c,"Promise",y.PromiseProp),p.all=y.all,p.race=y.race,p.resolve=y.resolve,p.reject=y.reject,y.allSettled&&(p.allSettled=y.allSettled),y.any)&&(p.any=y.any)}function ui(){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 ir(a,f,p,y,_){var N=Ye;try{return In(a,!0),f(p,y,_)}finally{In(N,!1)}}function ci(a,f,p,y){return typeof a!="function"?a:function(){var _=Ye;p&&qn(),In(f,!0);try{return a.apply(this,arguments)}finally{In(_,!1),y&&queueMicrotask(zt)}}}function $o(a){Promise===Vt&&nt.echoes===0?Kt===0?a():enqueueNativeMicroTask(a):setTimeout(a,0)}(""+po).indexOf("[native code]")===-1&&(qn=zt=Oe);var Et=Ve.reject,sr="￿",gt="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",Bi="String expected.",Dr="__dbnames",Ao="readonly",Lr="readwrite";function xr(a,f){return a?f?function(){return a.apply(this,arguments)&&f.apply(this,arguments)}:a:f}var fi={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function ar(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 En(){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 p=pn(a),y=pn(f);if(p!==y)return p==="Array"?1:y==="Array"?-1:p==="binary"?1:y==="binary"?-1:p==="string"?1:y==="string"?-1:p==="Date"?1:y!=="Date"?NaN:-1;switch(p){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,ce=0;ce<Z;++ce)if(_[ce]!==N[ce])return _[ce]<N[ce]?-1:1;return M===O?0:M<O?-1:1;case"Array":for(var te=a,J=f,ee=te.length,le=J.length,oe=ee<le?ee:le,re=0;re<oe;++re){var se=ft(te[re],J[re]);if(se!==0)return se}return ee===le?0:ee<le?-1:1}}catch{}return NaN}function pn(a){var f=typeof a;return f=="object"&&(ArrayBuffer.isView(a)||(f=ue(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 Oo(a,f,p){var y=a.schema.yProps;return y?(f&&0<p.numFailures&&(f=f.filter(function(_,N){return!p.failures[N]})),Promise.all(y.map(function(_){return _=_.updatesTable,f?a.db.table(_).where("k").anyOf(f).delete():a.db.table(_).clear()})).then(function(){return p})):p}ro.prototype.execute=function(a){var f=this["@@propmod"];if(f.add!==void 0){var p=f.add;if(m(p))return l(l([],m(a)?a:[],!0),p).sort();if(typeof p=="number")return(Number(a)||0)+p;if(typeof p=="bigint")try{return BigInt(a)+p}catch{return BigInt(0)+p}throw new TypeError("Invalid term ".concat(p))}if(f.remove!==void 0){var y=f.remove;if(m(y))return m(a)?a.filter(function(_){return!y.includes(_)}).sort():[];if(typeof y=="number")return Number(a)-y;if(typeof y=="bigint")try{return BigInt(a)-y}catch{return BigInt(0)-y}throw new TypeError("Invalid subtrahend ".concat(y))}return p=(p=f.replacePrefix)==null?void 0:p[0],p&&typeof a=="string"&&a.startsWith(p)?f.replacePrefix[1]+a.substring(p.length):a};var no=ro;function ro(a){this["@@propmod"]=a}function oo(a,f){for(var p=d(f),y=p.length,_=!1,N=0;N<y;++N){var M=p[N],O=f[M],Z=V(a,M);O instanceof no?(B(a,M,O.execute(Z)),_=!0):Z!==O&&(B(a,M,O),_=!0)}return _}yt.prototype._trans=function(a,f,p){var y=this._tx||Ye.trans,_=this.name,N=St&&typeof console<"u"&&console.createTask&&console.createTask("Dexie: ".concat(a==="readonly"?"read":"write"," ").concat(this.name));function M(ce,te,J){if(J.schema[_])return f(J.idbtrans,J);throw new ke.NotFound("Table "+_+" not part of transaction")}var O=hn();try{var Z=y&&y.db._novip===this.db._novip?y===Ye.trans?y._promise(a,M,p):on(function(){return y._promise(a,M,p)},{trans:y,transless:Ye.transless||Ye}):(function ce(te,J,ee,le){if(te.idbdb&&(te._state.openComplete||Ye.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 ce(te,J,ee,le)})):Et(re)}return oe._promise(J,function(re,se){return on(function(){return Ye.trans=oe,le(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 Et(new ke.DatabaseClosed(te._state.dbOpenError));if(!te._state.isBeingOpened){if(!te._state.autoOpen)return Et(new ke.DatabaseClosed);te.open().catch(Oe)}return te._state.dbReadyPromise.then(function(){return ce(te,J,ee,le)})})(this.db,a,[this.name],M);return N&&(Z._consoleTask=N,Z=Z.catch(function(ce){return console.trace(ce),Et(ce)})),Z}finally{O&&Tn()}},yt.prototype.get=function(a,f){var p=this;return a&&a.constructor===Object?this.where(a).first(f):a==null?Et(new ke.Type("Invalid argument to Table.get()")):this._trans("readonly",function(y){return p.core.get({trans:y,key:a}).then(function(_){return p.hook.reading.fire(_)})}).then(f)},yt.prototype.where=function(a){if(typeof a=="string")return new this.db.WhereClause(this,a);if(m(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 p=this.schema.indexes.concat(this.schema.primKey).filter(function(O){if(O.compound&&f.every(function(ce){return 0<=O.keyPath.indexOf(ce)})){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(p&&this.db._maxKey!==sr)return M=p.keyPath.slice(0,f.length),this.where(M).equals(M.map(function(O){return a[O]}));!p&&St&&console.warn("The query ".concat(JSON.stringify(a)," on ").concat(this.name," would benefit from a ")+"compound index [".concat(f.join("+"),"]"));var y=this.schema.idxByName;function _(O,Z){return ft(O,Z)===0}var M=f.reduce(function(te,Z){var ce=te[0],te=te[1],J=y[Z],ee=a[Z];return[ce||J,ce||!J?xr(te,J&&J.multi?function(le){return le=V(le,Z),m(le)&&le.some(function(oe){return _(ee,oe)})}:function(le){return _(ee,V(le,Z))}):te]},[null,null]),N=M[0],M=M[1];return N?this.where(N.name).equals(a[N.keyPath]).filter(M):p?this.filter(M):this.where(f).equals("")},yt.prototype.filter=function(a){return this.toCollection().and(a)},yt.prototype.count=function(a){return this.toCollection().count(a)},yt.prototype.offset=function(a){return this.toCollection().offset(a)},yt.prototype.limit=function(a){return this.toCollection().limit(a)},yt.prototype.each=function(a){return this.toCollection().each(a)},yt.prototype.toArray=function(a){return this.toCollection().toArray(a)},yt.prototype.toCollection=function(){return new this.db.Collection(new this.db.WhereClause(this))},yt.prototype.orderBy=function(a){return new this.db.Collection(new this.db.WhereClause(this,m(a)?"[".concat(a.join("+"),"]"):a))},yt.prototype.reverse=function(){return this.toCollection().reverse()},yt.prototype.mapToClass=function(a){for(var f=this.db,p=this.name,y=((this.schema.mappedClass=a).prototype instanceof En&&(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 ce(){this.constructor=O}function te(){return M!==null&&M.apply(this,arguments)||this}return i(O,Z),O.prototype=Z===null?Object.create(Z):(ce.prototype=Z.prototype,new ce),Object.defineProperty(te.prototype,"db",{get:function(){return f},enumerable:!1,configurable:!0}),te.prototype.table=function(){return p},te})(a)),new Set),_=a.prototype;_;_=b(_))Object.getOwnPropertyNames(_).forEach(function(M){return y.add(M)});function N(M){if(!M)return M;var O,Z=Object.create(a.prototype);for(O in M)if(!y.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},yt.prototype.defineClass=function(){return this.mapToClass(function(a){v(this,a)})},yt.prototype.add=function(a,f){var p=this,y=this.schema.primKey,_=y.auto,N=y.keyPath,M=a;return N&&_&&(M=ar(N)(a)),this._trans("readwrite",function(O){return p.core.mutate({trans:O,type:"add",keys:f!=null?[f]:null,values:[M]})}).then(function(O){return O.numFailures?Ve.reject(O.failures[0]):O.lastResult}).then(function(O){if(N)try{B(a,N,O)}catch{}return O})},yt.prototype.upsert=function(a,f){var p=this,y=this.schema.primKey.keyPath;return this._trans("readwrite",function(_){return p.core.get({trans:_,key:a}).then(function(N){var M=N??{};return oo(M,f),y&&B(M,y,a),p.core.mutate({trans:_,type:"put",values:[M],keys:[a],upsert:!0,updates:{keys:[a],changeSpecs:[f]}}).then(function(O){return O.numFailures?Ve.reject(O.failures[0]):!!N})})})},yt.prototype.update=function(a,f){return typeof a!="object"||m(a)?this.where(":id").equals(a).modify(f):(a=V(a,this.schema.primKey.keyPath))===void 0?Et(new ke.InvalidArgument("Given object does not contain its primary key")):this.where(":id").equals(a).modify(f)},yt.prototype.put=function(a,f){var p=this,y=this.schema.primKey,_=y.auto,N=y.keyPath,M=a;return N&&_&&(M=ar(N)(a)),this._trans("readwrite",function(O){return p.core.mutate({trans:O,type:"put",values:[M],keys:f!=null?[f]:null})}).then(function(O){return O.numFailures?Ve.reject(O.failures[0]):O.lastResult}).then(function(O){if(N)try{B(a,N,O)}catch{}return O})},yt.prototype.delete=function(a){var f=this;return this._trans("readwrite",function(p){return f.core.mutate({trans:p,type:"delete",keys:[a]}).then(function(y){return Oo(f,[a],y)}).then(function(y){return y.numFailures?Ve.reject(y.failures[0]):void 0})})},yt.prototype.clear=function(){var a=this;return this._trans("readwrite",function(f){return a.core.mutate({trans:f,type:"deleteRange",range:fi}).then(function(p){return Oo(a,null,p)})}).then(function(f){return f.numFailures?Ve.reject(f.failures[0]):void 0})},yt.prototype.bulkGet=function(a){var f=this;return this._trans("readonly",function(p){return f.core.getMany({keys:a,trans:p}).then(function(y){return y.map(function(_){return f.hook.reading.fire(_)})})})},yt.prototype.bulkAdd=function(a,f,p){var y=this,_=Array.isArray(f)?f:void 0,N=(p=p||(_?void 0:f))?p.allKeys:void 0;return this._trans("readwrite",function(M){var O=y.schema.primKey,ce=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,ce=O&&ce?a.map(ar(O)):a;return y.core.mutate({trans:M,type:"add",keys:_,values:ce,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(y.name,".bulkAdd(): ").concat(J," of ").concat(Z," operations failed"),ee)})})},yt.prototype.bulkPut=function(a,f,p){var y=this,_=Array.isArray(f)?f:void 0,N=(p=p||(_?void 0:f))?p.allKeys:void 0;return this._trans("readwrite",function(M){var O=y.schema.primKey,ce=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,ce=O&&ce?a.map(ar(O)):a;return y.core.mutate({trans:M,type:"put",keys:_,values:ce,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(y.name,".bulkPut(): ").concat(J," of ").concat(Z," operations failed"),ee)})})},yt.prototype.bulkUpdate=function(a){var f=this,p=this.core,y=a.map(function(M){return M.key}),_=a.map(function(M){return M.changes}),N=[];return this._trans("readwrite",function(M){return p.getMany({trans:M,keys:y,cache:"clone"}).then(function(O){var Z=[],ce=[],te=(a.forEach(function(J,ee){var le=J.key,oe=J.changes,re=O[ee];if(re){for(var se=0,ge=Object.keys(oe);se<ge.length;se++){var he=ge[se],ve=oe[he];if(he===f.schema.primKey.keyPath){if(ft(ve,le)!==0)throw new ke.Constraint("Cannot update primary key in bulkUpdate()")}else B(re,he,ve)}N.push(ee),Z.push(le),ce.push(re)}}),Z.length);return p.mutate({trans:M,type:"put",keys:Z,values:ce,updates:{keys:y,changeSpecs:_}}).then(function(J){var ee=J.numFailures,le=J.failures;if(ee===0)return te;for(var oe=0,re=Object.keys(le);oe<re.length;oe++){var se,ge=re[oe],he=N[Number(ge)];he!=null&&(se=le[ge],delete le[ge],le[he]=se)}throw new Ae("".concat(f.name,".bulkUpdate(): ").concat(ee," of ").concat(te," operations failed"),le)})})})},yt.prototype.bulkDelete=function(a){var f=this,p=a.length;return this._trans("readwrite",function(y){return f.core.mutate({trans:y,type:"delete",keys:a}).then(function(_){return Oo(f,a,_)})}).then(function(y){var _=y.numFailures,N=y.failures;if(_===0)return y.lastResult;throw new Ae("".concat(f.name,".bulkDelete(): ").concat(_," of ").concat(p," operations failed"),N)})};var Yn=yt;function yt(){}function zr(a){function f(M,O){if(O){for(var Z=arguments.length,ce=new Array(Z-1);--Z;)ce[Z-1]=arguments[Z];return p[M].subscribe.apply(null,ce),a}if(typeof M=="string")return p[M]}var p={};f.addEventType=N;for(var y=1,_=arguments.length;y<_;++y)N(arguments[y]);return f;function N(M,O,Z){var ce,te;if(typeof M!="object")return O=O||Ht,te={subscribers:[],fire:Z=Z||Oe,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)}},p[M]=f[M]=te;d(ce=M).forEach(function(J){var ee=ce[J];if(m(ee))N(J,ce[J][0],ce[J][1]);else{if(ee!=="asap")throw new ke.InvalidArgument("Invalid event config");var le=N(J,qe,function(){for(var oe=arguments.length,re=new Array(oe);oe--;)re[oe]=arguments[oe];le.subscribers.forEach(function(se){Y(function(){se.apply(null,re)})})})}})}}function io(a,f){return T(f).from({prototype:a}),f}function lr(a,f){return!(a.filter||a.algorithm||a.or)&&(f?a.justLimit:!a.replayFilter)}function Fr(a,f){a.filter=xr(a.filter,f)}function so(a,f,p){var y=a.replayFilter;a.replayFilter=y?function(){return xr(y(),f())}:f,a.justLimit=p&&!y}function ur(a,f){if(a.isPrimKey)return f.primaryKey;var p=f.getIndexByKeyPath(a.index);if(p)return p;throw new ke.Schema("KeyPath "+a.index+" on object store "+f.name+" is not indexed")}function di(a,f,p){var y=ur(a,f.schema);return f.openCursor({trans:p,values:!a.keysOnly,reverse:a.dir==="prev",unique:!!a.unique,query:{index:y,range:a.range}})}function Ro(a,f,p,y){var _,N,M=a.replayFilter?xr(a.filter,a.replayFilter()):a.filter;return a.or?(_={},N=function(O,Z,ce){var te,J;M&&!M(Z,ce,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,ce))},Promise.all([a.or._iterate(N,p),xt(di(a,y,p),a.algorithm,N,!a.keysOnly&&a.valueMapper)])):xt(di(a,y,p),xr(a.algorithm,M),f,!a.keysOnly&&a.valueMapper)}function xt(a,f,p,y){var _=Le(y?function(N,M,O){return p(y(N),M,O)}:p);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=Oe},function(O){N.fail(O),M=Oe})||_(N.value,N,function(O){return M=O}),M()})})}pt.prototype._read=function(a,f){var p=this._ctx;return p.error?p.table._trans(null,Et.bind(null,p.error)):p.table._trans("readonly",a).then(f)},pt.prototype._write=function(a){var f=this._ctx;return f.error?f.table._trans(null,Et.bind(null,f.error)):f.table._trans("readwrite",a,"locked")},pt.prototype._addAlgorithm=function(a){var f=this._ctx;f.algorithm=xr(f.algorithm,a)},pt.prototype._iterate=function(a,f){return Ro(this._ctx,a,f,this._ctx.table.core)},pt.prototype.clone=function(a){var f=Object.create(this.constructor.prototype),p=Object.create(this._ctx);return a&&v(p,a),f._ctx=p,f},pt.prototype.raw=function(){return this._ctx.valueMapper=null,this},pt.prototype.each=function(a){var f=this._ctx;return this._read(function(p){return Ro(f,a,p,f.table.core)})},pt.prototype.count=function(a){var f=this;return this._read(function(p){var y,_=f._ctx,N=_.table.core;return lr(_,!0)?N.count({trans:p,query:{index:ur(_,N.schema),range:_.range}}).then(function(M){return Math.min(M,_.limit)}):(y=0,Ro(_,function(){return++y,!1},p,N).then(function(){return y}))}).then(a)},pt.prototype.sortBy=function(a,f){var p=a.split(".").reverse(),y=p[0],_=p.length-1;function N(Z,ce){return ce?N(Z[p[ce]],ce-1):Z[y]}var M=this._ctx.dir==="next"?1:-1;function O(Z,ce){return ft(N(Z,_),N(ce,_))*M}return this.toArray(function(Z){return Z.sort(O)}).then(f)},pt.prototype.toArray=function(a){var f=this;return this._read(function(p){var y,_,N,M=f._ctx;return lr(M,!0)&&0<M.limit?(y=M.valueMapper,_=ur(M,M.table.core.schema),M.table.core.query({trans:p,limit:M.limit,values:!0,direction:M.dir==="prev"?"prev":void 0,query:{index:_,range:M.range}}).then(function(O){return O=O.result,y?O.map(y):O})):(N=[],Ro(M,function(O){return N.push(O)},p,M.table.core).then(function(){return N}))},a)},pt.prototype.offset=function(a){var f=this._ctx;return a<=0||(f.offset+=a,lr(f)?so(f,function(){var p=a;return function(y,_){return p===0||(p===1?--p:_(function(){y.advance(p),p=0}),!1)}}):so(f,function(){var p=a;return function(){return--p<0}})),this},pt.prototype.limit=function(a){return this._ctx.limit=Math.min(this._ctx.limit,a),so(this._ctx,function(){var f=a;return function(p,y,_){return--f<=0&&y(_),0<=f}},!0),this},pt.prototype.until=function(a,f){return Fr(this._ctx,function(p,y,_){return!a(p.value)||(y(_),f)}),this},pt.prototype.first=function(a){return this.limit(1).toArray(function(f){return f[0]}).then(a)},pt.prototype.last=function(a){return this.reverse().first(a)},pt.prototype.filter=function(a){var f;return Fr(this._ctx,function(p){return a(p.value)}),(f=this._ctx).isMatch=xr(f.isMatch,a),this},pt.prototype.and=function(a){return this.filter(a)},pt.prototype.or=function(a){return new this.db.WhereClause(this._ctx.table,a,this)},pt.prototype.reverse=function(){return this._ctx.dir=this._ctx.dir==="prev"?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this},pt.prototype.desc=function(){return this.reverse()},pt.prototype.eachKey=function(a){var f=this._ctx;return f.keysOnly=!f.isMatch,this.each(function(p,y){a(y.key,y)})},pt.prototype.eachUniqueKey=function(a){return this._ctx.unique="unique",this.eachKey(a)},pt.prototype.eachPrimaryKey=function(a){var f=this._ctx;return f.keysOnly=!f.isMatch,this.each(function(p,y){a(y.primaryKey,y)})},pt.prototype.keys=function(a){var f=this._ctx,p=(f.keysOnly=!f.isMatch,[]);return this.each(function(y,_){p.push(_.key)}).then(function(){return p}).then(a)},pt.prototype.primaryKeys=function(a){var f=this._ctx;if(lr(f,!0)&&0<f.limit)return this._read(function(y){var _=ur(f,f.table.core.schema);return f.table.core.query({trans:y,values:!1,limit:f.limit,direction:f.dir==="prev"?"prev":void 0,query:{index:_,range:f.range}})}).then(function(y){return y.result}).then(a);f.keysOnly=!f.isMatch;var p=[];return this.each(function(y,_){p.push(_.primaryKey)}).then(function(){return p}).then(a)},pt.prototype.uniqueKeys=function(a){return this._ctx.unique="unique",this.keys(a)},pt.prototype.firstKey=function(a){return this.limit(1).keys(function(f){return f[0]}).then(a)},pt.prototype.lastKey=function(a){return this.reverse().firstKey(a)},pt.prototype.distinct=function(){var a,f=this._ctx,f=f.index&&f.table.schema.idxByName[f.index];return f&&f.multi&&(a={},Fr(this._ctx,function(y){var y=y.primaryKey.toString(),_=w(a,y);return a[y]=!0,!_})),this},pt.prototype.modify=function(a){var f=this,p=this._ctx;return this._write(function(y){function _(re,se){var ge=se.failures;ee+=re-se.numFailures;for(var he=0,ve=d(ge);he<ve.length;he++){var Ne=ve[he];J.push(ge[Ne])}}var N=typeof a=="function"?a:function(re){return oo(re,a)},M=p.table.core,te=M.schema.primaryKey,O=te.outbound,Z=te.extractKey,ce=200,te=f.db._options.modifyChunkSize,J=(te&&(ce=typeof te=="object"?te[M.name]||te["*"]||200:te),[]),ee=0,le=[],oe=a===Vi;return f.clone().primaryKeys().then(function(re){function se(he){var ve=Math.min(ce,re.length-he),Ne=re.slice(he,he+ve);return(oe?Promise.resolve([]):M.getMany({trans:y,keys:Ne,cache:"immutable"})).then(function(Ce){var De=[],Te=[],Ke=O?[]:null,Re=oe?Ne:[];if(!oe)for(var We=0;We<ve;++We){var Ee=Ce[We],rt={value:xe(Ee),primKey:re[he+We]};N.call(rt,rt.value,rt)!==!1&&(rt.value==null?Re.push(re[he+We]):O||ft(Z(Ee),Z(rt.value))===0?(Te.push(rt.value),O&&Ke.push(re[he+We])):(Re.push(re[he+We]),De.push(rt.value)))}return Promise.resolve(0<De.length&&M.mutate({trans:y,type:"add",values:De}).then(function(ot){for(var lt in ot.failures)Re.splice(parseInt(lt),1);_(De.length,ot)})).then(function(){return(0<Te.length||ge&&typeof a=="object")&&M.mutate({trans:y,type:"put",keys:Ke,values:Te,criteria:ge,changeSpec:typeof a!="function"&&a,isAdditionalChunk:0<he}).then(function(ot){return _(Te.length,ot)})}).then(function(){return(0<Re.length||ge&&oe)&&M.mutate({trans:y,type:"delete",keys:Re,criteria:ge,isAdditionalChunk:0<he}).then(function(ot){return Oo(p.table,Re,ot)}).then(function(ot){return _(Re.length,ot)})}).then(function(){return re.length>he+ve&&se(he+ce)})})}var ge=lr(p)&&p.limit===1/0&&(typeof a!="function"||oe)&&{index:p.index,range:p.range};return se(0).then(function(){if(0<J.length)throw new $e("Error modifying one or more objects",J,ee,le);return re.length})})})},pt.prototype.delete=function(){var a=this._ctx,f=a.range;return!lr(a)||a.table.schema.yProps||!a.isPrimKey&&f.type!==3?this.modify(Vi):this._write(function(p){var y=a.table.core.schema.primaryKey,_=f;return a.table.core.count({trans:p,query:{index:y,range:_}}).then(function(N){return a.table.core.mutate({trans:p,type:"deleteRange",range:_}).then(function(Z){var O=Z.failures,Z=Z.numFailures;if(Z)throw new $e("Could not delete some values",Object.keys(O).map(function(ce){return O[ce]}),N-Z);return N-Z})})})};var Ba=pt;function pt(){}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 mn(a,f,p){return a=a instanceof br?new a.Collection(a):a,a._ctx.error=new(p||TypeError)(f),a}function Br(a){return new a.Collection(a,function(){return wr("")}).limit(0)}function ao(le,f,p,y){var _,N,M,O,Z,ce,te,J=p.length;if(!p.every(function(re){return typeof re=="string"}))return mn(le,Bi);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=p.map(function(ge){return{lower:N(ge),upper:_(ge)}}).sort(function(ge,he){return M(ge.lower,he.lower)});O=se.map(function(ge){return ge.upper}),Z=se.map(function(ge){return ge.lower}),te=(ce=re)==="next"?"":y}ee("next");var le=new le.Collection(le,function(){return sn(O[0],Z[J-1]+y)}),oe=(le._ondirectionchange=function(re){ee(re)},0);return le._addAlgorithm(function(re,se,ge){var he=re.key;if(typeof he=="string"){var ve=N(he);if(f(ve,Z,oe))return!0;for(var Ne=null,Ce=oe;Ce<J;++Ce){var De=((Te,Ke,Re,We,Ee,rt)=>{for(var ot=Math.min(Te.length,We.length),lt=-1,dt=0;dt<ot;++dt){var gn=Ke[dt];if(gn!==We[dt])return Ee(Te[dt],Re[dt])<0?Te.substr(0,dt)+Re[dt]+Re.substr(dt+1):Ee(Te[dt],We[dt])<0?Te.substr(0,dt)+We[dt]+Re.substr(dt+1):0<=lt?Te.substr(0,lt)+Ke[lt]+Re.substr(lt+1):null;Ee(Te[dt],gn)<0&&(lt=dt)}return ot<We.length&&rt==="next"?Te+Re.substr(Te.length):ot<Te.length&&rt==="prev"?Te.substr(0,Re.length):lt<0?null:Te.substr(0,lt)+We[lt]+Re.substr(lt+1)})(he,ve,O[Ce],Z[Ce],M,ce);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}),le}function sn(a,f,p,y){return{type:2,lower:a,upper:f,lowerOpen:p,upperOpen:y}}function wr(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,p,y){p=p!==!1,y=y===!0;try{return 0<this._cmp(a,f)||this._cmp(a,f)===0&&(p||y)&&(!p||!y)?Br(this):new this.Collection(this,function(){return sn(a,f,!p,!y)})}catch{return mn(this,gt)}},It.prototype.equals=function(a){return a==null?mn(this,gt):new this.Collection(this,function(){return wr(a)})},It.prototype.above=function(a){return a==null?mn(this,gt):new this.Collection(this,function(){return sn(a,void 0,!0)})},It.prototype.aboveOrEqual=function(a){return a==null?mn(this,gt):new this.Collection(this,function(){return sn(a,void 0,!1)})},It.prototype.below=function(a){return a==null?mn(this,gt):new this.Collection(this,function(){return sn(void 0,a,!1,!0)})},It.prototype.belowOrEqual=function(a){return a==null?mn(this,gt):new this.Collection(this,function(){return sn(void 0,a)})},It.prototype.startsWith=function(a){return typeof a!="string"?mn(this,Bi):this.between(a,a+sr,!0,!0)},It.prototype.startsWithIgnoreCase=function(a){return a===""?this.startsWith(a):ao(this,function(f,p){return f.indexOf(p[0])===0},[a],sr)},It.prototype.equalsIgnoreCase=function(a){return ao(this,function(f,p){return f===p[0]},[a],"")},It.prototype.anyOfIgnoreCase=function(){var a=F.apply(q,arguments);return a.length===0?Br(this):ao(this,function(f,p){return p.indexOf(f)!==-1},a,"")},It.prototype.startsWithAnyOfIgnoreCase=function(){var a=F.apply(q,arguments);return a.length===0?Br(this):ao(this,function(f,p){return p.some(function(y){return f.indexOf(y)===0})},a,sr)},It.prototype.anyOf=function(){var a,f,p=this,y=F.apply(q,arguments),_=this._cmp;try{y.sort(_)}catch{return mn(this,gt)}return y.length===0?Br(this):((a=new this.Collection(this,function(){return sn(y[0],y[y.length-1])}))._ondirectionchange=function(N){_=N==="next"?p._ascending:p._descending,y.sort(_)},f=0,a._addAlgorithm(function(N,M,O){for(var Z=N.key;0<_(Z,y[f]);)if(++f===y.length)return M(O),!1;return _(Z,y[f])===0||(M(function(){N.continue(y[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=F.apply(q,arguments);if(a.length===0)return new this.Collection(this);try{a.sort(this._ascending)}catch{return mn(this,gt)}var f=a.reduce(function(p,y){return p?p.concat([[p[p.length-1][1],y]]):[[-1/0,y]]},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 p=this,y=this._cmp,_=this._ascending,N=this._descending,M=this._min,O=this._max;if(a.length===0)return Br(this);if(!a.every(function(he){return he[0]!==void 0&&he[1]!==void 0&&_(he[0],he[1])<=0}))return mn(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,ce=ge&&ge.includeUppers===!0,te,J=_;function ee(he,ve){return J(he[0],ve[0])}try{(te=a.reduce(function(he,ve){for(var Ne=0,Ce=he.length;Ne<Ce;++Ne){var De=he[Ne];if(y(ve[0],De[1])<0&&0<y(ve[1],De[0])){De[0]=M(De[0],ve[0]),De[1]=O(De[1],ve[1]);break}}return Ne===Ce&&he.push(ve),he},[])).sort(ee)}catch{return mn(this,gt)}var le=0,oe=ce?function(he){return 0<_(he,te[le][1])}:function(he){return 0<=_(he,te[le][1])},re=Z?function(he){return 0<N(he,te[le][0])}:function(he){return 0<=N(he,te[le][0])},se=oe,ge=new this.Collection(this,function(){return sn(te[0][0],te[te.length-1][1],!Z,!ce)});return ge._ondirectionchange=function(he){J=he==="next"?(se=oe,_):(se=re,N),te.sort(ee)},ge._addAlgorithm(function(he,ve,Ne){for(var Ce,De=he.key;se(De);)if(++le===te.length)return ve(Ne),!1;return!oe(Ce=De)&&!re(Ce)||(p._cmp(De,te[le][1])===0||p._cmp(De,te[le][0])===0||ve(function(){J===_?he.continue(te[le][0]):he.continue(te[le][1])}),!1)}),ge},It.prototype.startsWithAnyOf=function(){var a=F.apply(q,arguments);return a.every(function(f){return typeof f=="string"})?a.length===0?Br(this):this.inAnyRange(a.map(function(f){return[f,f+sr]})):mn(this,"startsWithAnyOf() only works with strings")};var br=It;function It(){}function an(a){return Le(function(f){return $n(f),a(f.target.error),!1})}function $n(a){a.stopPropagation&&a.stopPropagation(),a.preventDefault&&a.preventDefault()}var hi="storagemutated",Ki="x-storagemutated-1",An=zr(null,hi),Ou=(Xn.prototype._lock=function(){return R(!Ye.global),++this._reculock,this._reculock!==1||Ye.global||(Ye.lockOwnerFor=this),this},Xn.prototype._unlock=function(){if(R(!Ye.global),--this._reculock==0)for(Ye.global||(Ye.lockOwnerFor=null);0<this._blockedFuncs.length&&!this._locked();){var a=this._blockedFuncs.shift();try{ir(a[1],a[0])}catch{}}return this},Xn.prototype._locked=function(){return this._reculock&&Ye.lockOwnerFor!==this},Xn.prototype.create=function(a){var f=this;if(this.mode){var p=this.db.idbdb,y=this.db._state.dbOpenError;if(R(!this.idbtrans),!a&&!p)switch(y&&y.name){case"DatabaseClosedError":throw new ke.DatabaseClosed(y);case"MissingAPIError":throw new ke.MissingAPI(y.message,y);default:throw new ke.OpenFailed(y)}if(!this.active)throw new ke.TransactionInactive;R(this._completion._state===null),(a=this.idbtrans=a||(this.db.core||p).transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability})).onerror=Le(function(_){$n(_),f._reject(a.error)}),a.onabort=Le(function(_){$n(_),f.active&&f._reject(new ke.Abort(a.error)),f.active=!1,f.on("abort").fire(_)}),a.oncomplete=Le(function(){f.active=!1,f._resolve(),"mutatedParts"in a&&An.storagemutated.fire(a.mutatedParts)})}return this},Xn.prototype._promise=function(a,f,p){var y,_=this;return a==="readwrite"&&this.mode!=="readwrite"?Et(new ke.ReadOnly("Transaction is readonly")):this.active?this._locked()?new Ve(function(N,M){_._blockedFuncs.push([function(){_._promise(a,f,p).then(N,M)},Ye])}):p?on(function(){var N=new Ve(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}):((y=new Ve(function(N,M){var O=f(N,M,_);O&&O.then&&O.then(N,M)}))._lib=!0,y):Et(new ke.TransactionInactive)},Xn.prototype._root=function(){return this.parent?this.parent._root():this},Xn.prototype.waitFor=function(a){var f,p=this._root(),y=Ve.resolve(a),_=(p._waitingFor?p._waitingFor=p._waitingFor.then(function(){return y}):(p._waitingFor=y,p._waitingQueue=[],f=p.idbtrans.objectStore(p.storeNames[0]),(function N(){for(++p._spinCount;p._waitingQueue.length;)p._waitingQueue.shift()();p._waitingFor&&(f.get(-1/0).onsuccess=N)})()),p._waitingFor);return new Ve(function(N,M){y.then(function(O){return p._waitingQueue.push(Le(N.bind(null,O)))},function(O){return p._waitingQueue.push(Le(M.bind(null,O)))}).finally(function(){p._waitingFor===_&&(p._waitingFor=null)})})},Xn.prototype.abort=function(){this.active&&(this.active=!1,this.idbtrans&&this.idbtrans.abort(),this._reject(new ke.Abort))},Xn.prototype.table=function(a){var f=this._memoizedTables||(this._memoizedTables={});if(w(f,a))return f[a];var p=this.schema[a];if(p)return(p=new this.db.Table(a,p,this)).core=this.db.core.table(a),f[a]=p;throw new ke.NotFound("Table "+a+" not part of transaction")},Xn);function Xn(){}function Do(a,f,p,y,_,N,M,O){return{name:a,keyPath:f,unique:p,multi:y,auto:_,compound:N,src:(p&&!M?"&":"")+(y?"*":"")+(_?"++":"")+Ds(f),type:O}}function Ds(a){return typeof a=="string"?a:a?"["+[].join.call(a,"+")+"]":""}function Ls(a,f,p){return{name:a,primKey:f,indexes:p,mappedClass:null,idxByName:(y=function(_){return[_.name,_]},p.reduce(function(_,N,M){return N=y(N,M),N&&(_[N[0]]=N[1]),_},{}))};var y}var _r=function(a){try{return a.only([[]]),_r=function(){return[[]]},[[]]}catch{return _r=function(){return sr},sr}};function lo(a){return a==null?function(){}:typeof a=="string"?(f=a).split(".").length===1?function(p){return p[f]}:function(p){return V(p,f)}:function(p){return V(p,a)};var f}function uo(a){return[].slice.call(a)}var Ui=0;function pi(a){return a==null?":id":typeof a=="string"?a:"[".concat(a.join("+"),"]")}function Ru(a,f,M){function y(se){if(se.type===3)return null;if(se.type===4)throw new Error("Cannot convert never type to IDBKeyRange");var le=se.lower,oe=se.upper,re=se.lowerOpen,se=se.upperOpen;return le===void 0?oe===void 0?null:f.upperBound(oe,!!se):oe===void 0?f.lowerBound(le,!!re):f.bound(le,oe,!!re,!!se)}function _(ee){var le,oe,re=ee.name;return{name:re,schema:ee,mutate:function(se){var ge=se.trans,he=se.type,ve=se.keys,Ne=se.values,Ce=se.range;return new Promise(function(De,Te){De=Le(De);var Ke=ge.objectStore(re),Re=Ke.keyPath==null,We=he==="put"||he==="add";if(!We&&he!=="delete"&&he!=="deleteRange")throw new Error("Invalid operation type: "+he);var Ee,rt=(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(rt===0)return De({numFailures:0,failures:{},results:[],lastResult:void 0});function ot(ln){++gn,$n(ln)}var lt=[],dt=[],gn=0;if(he==="deleteRange"){if(Ce.type===4)return De({numFailures:gn,failures:dt,results:[],lastResult:void 0});Ce.type===3?lt.push(Ee=Ke.clear()):lt.push(Ee=Ke.delete(y(Ce)))}else{var Re=We?Re?[Ne,ve]:[Ne,null]:[ve,null],at=Re[0],Ct=Re[1];if(We)for(var Ut=0;Ut<rt;++Ut)lt.push(Ee=Ct&&Ct[Ut]!==void 0?Ke[he](at[Ut],Ct[Ut]):Ke[he](at[Ut])),Ee.onerror=ot;else for(Ut=0;Ut<rt;++Ut)lt.push(Ee=Ke[he](at[Ut])),Ee.onerror=ot}function qo(ln){ln=ln.target.result,lt.forEach(function(yo,vo){return yo.error!=null&&(dt[vo]=yo.error)}),De({numFailures:gn,failures:dt,results:he==="delete"?ve:lt.map(function(yo){return yo.result}),lastResult:ln})}Ee.onerror=function(ln){ot(ln),qo(ln)},Ee.onsuccess=qo})},getMany:function(se){var ge=se.trans,he=se.keys;return new Promise(function(ve,Ne){ve=Le(ve);for(var Ce,De=ge.objectStore(re),Te=he.length,Ke=new Array(Te),Re=0,We=0,Ee=function(lt){lt=lt.target,Ke[lt._pos]=lt.result,++We===Re&&ve(Ke)},rt=an(Ne),ot=0;ot<Te;++ot)he[ot]!=null&&((Ce=De.get(he[ot]))._pos=ot,Ce.onsuccess=Ee,Ce.onerror=rt,++Re);Re===0&&ve(Ke)})},get:function(se){var ge=se.trans,he=se.key;return new Promise(function(ve,Ne){ve=Le(ve);var Ce=ge.objectStore(re).get(he);Ce.onsuccess=function(De){return ve(De.target.result)},Ce.onerror=an(Ne)})},query:(le=Z,oe=ce,function(se){return new Promise(function(ge,he){ge=Le(ge);var ve,Ne,Ce,De,rt=se.trans,Te=se.values,Ke=se.limit,Ee=se.query,Re=(Re=se.direction)!=null?Re:"next",We=Ke===1/0?void 0:Ke,ot=Ee.index,Ee=Ee.range,rt=rt.objectStore(re),rt=ot.isPrimaryKey?rt:rt.index(ot.name),ot=y(Ee);if(Ke===0)return ge({result:[]});oe?(Ee={query:ot,count:We,direction:Re},(ve=Te?rt.getAll(Ee):rt.getAllKeys(Ee)).onsuccess=function(lt){return ge({result:lt.target.result})},ve.onerror=an(he)):le&&Re==="next"?((ve=Te?rt.getAll(ot,We):rt.getAllKeys(ot,We)).onsuccess=function(lt){return ge({result:lt.target.result})},ve.onerror=an(he)):(Ne=0,Ce=!Te&&"openKeyCursor"in rt?rt.openKeyCursor(ot,Re):rt.openCursor(ot,Re),De=[],Ce.onsuccess=function(){var lt=Ce.result;return!lt||(De.push(Te?lt.value:lt.primaryKey),++Ne===Ke)?ge({result:De}):void lt.continue()},Ce.onerror=an(he))})}),openCursor:function(se){var ge=se.trans,he=se.values,ve=se.query,Ne=se.reverse,Ce=se.unique;return new Promise(function(De,Te){De=Le(De);var We=ve.index,Ke=ve.range,Re=ge.objectStore(re),Re=We.isPrimaryKey?Re:Re.index(We.name),We=Ne?Ce?"prevunique":"prev":Ce?"nextunique":"next",Ee=!he&&"openKeyCursor"in Re?Re.openKeyCursor(y(Ke),We):Re.openCursor(y(Ke),We);Ee.onerror=an(Te),Ee.onsuccess=Le(function(rt){var ot,lt,dt,gn,at=Ee.result;at?(at.___id=++Ui,at.done=!1,ot=at.continue.bind(at),lt=(lt=at.continuePrimaryKey)&&lt.bind(at),dt=at.advance.bind(at),gn=function(){throw new Error("Cursor not stopped")},at.trans=ge,at.stop=at.continue=at.continuePrimaryKey=at.advance=function(){throw new Error("Cursor not started")},at.fail=Le(Te),at.next=function(){var Ct=this,Ut=1;return this.start(function(){return Ut--?Ct.continue():Ct.stop()}).then(function(){return Ct})},at.start=function(Ct){function Ut(){if(Ee.result)try{Ct()}catch(ln){at.fail(ln)}else at.done=!0,at.start=function(){throw new Error("Cursor behind last entry")},at.stop()}var qo=new Promise(function(ln,yo){ln=Le(ln),Ee.onerror=an(yo),at.fail=yo,at.stop=function(vo){at.stop=at.continue=at.continuePrimaryKey=at.advance=gn,ln(vo)}});return Ee.onsuccess=Le(function(ln){Ee.onsuccess=Ut,Ut()}),at.continue=ot,at.continuePrimaryKey=lt,at.advance=dt,Ut(),qo},De(at)):De(null)},Te)})},count:function(se){var ge=se.query,he=se.trans,ve=ge.index,Ne=ge.range;return new Promise(function(Ce,De){var Te=he.objectStore(re),Te=ve.isPrimaryKey?Te:Te.index(ve.name),Ke=y(Ne),Ke=Ke?Te.count(Ke):Te.count();Ke.onsuccess=Le(function(Re){return Ce(Re.target.result)}),Ke.onerror=an(De)})}}}N=M,O=uo((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 le=ee.keyPath,oe=ee.autoIncrement,se=m(le),re={},se={name:ee.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:le==null,compound:se,keyPath:le,autoIncrement:oe,unique:!0,extractKey:lo(le)},indexes:uo(ee.indexNames).map(function(ge){return ee.index(ge)}).map(function(Ne){var Ce=Ne.name,he=Ne.unique,ve=Ne.multiEntry,Ne=Ne.keyPath,Ce={name:Ce,compound:m(Ne),keyPath:Ne,unique:he,multiEntry:ve,extractKey:lo(Ne)};return re[pi(Ne)]=Ce}),getIndexByKeyPath:function(ge){return re[pi(ge)]}};return re[":id"]=se.primaryKey,le!=null&&(re[pi(le)]=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,ce=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:_r(f),schema:O}}function zs(a,f,p,y){return p=p.IDBKeyRange,f=Ru(f,p,y),{dbcore:a.dbcore.reduce(function(_,N){return N=N.create,s(s({},_),N(_))},f)}}function co(a,f){var p=f.db,p=zs(a._middlewares,p,a._deps,f);a.core=p.dbcore,a.tables.forEach(function(y){var _=y.name;a.core.schema.tables.some(function(N){return N.name===_})&&(y.core=a.core.table(_),a[_]instanceof a.Table)&&(a[_].core=y.core)})}function Lo(a,f,p,y){p.forEach(function(_){var N=y[_];f.forEach(function(M){var O=(function Z(ce,te){return $(ce,te)||(ce=b(ce))&&Z(ce,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(p){for(var y in p)p[y]instanceof a.Table&&delete p[y]})}function Hr(a,f){return a._cfg.version-f._cfg.version}function Fs(a,f,p,y){var _=a._dbSchema,N=(p.objectStoreNames.contains("$meta")&&!_.$meta&&(_.$meta=Ls("$meta",Xi("")[0],[]),a._storeNames.push("$meta")),a._createTransaction("readwrite",a._storeNames,_)),M=(N.create(p),N._completion.catch(y),N._reject.bind(N)),O=Ye.transless||Ye;on(function(){if(Ye.trans=N,Ye.transless=O,f!==0)return co(a,p),ce=f,((Z=N).storeNames.includes("$meta")?Z.table("$meta").get("version").then(function(te){return te??ce}):Ve.resolve(ce)).then(function(se){var J=a,ee=se,le=N,oe=p,re=[],se=J._versions,ge=J._dbSchema=Gt(0,J.idbdb,oe);return(se=se.filter(function(he){return he._cfg.version>=ee})).length===0?Ve.resolve():(se.forEach(function(he){re.push(function(){var ve,Ne,Ce,De=ge,Te=he._cfg.dbschema,Ke=(Sr(J,De,oe),Sr(J,Te,oe),ge=J._dbSchema=Te,Yi(De,Te)),Re=(Ke.add.forEach(function(We){zo(oe,We[0],We[1].primKey,We[1].indexes)}),Ke.change.forEach(function(We){if(We.recreate)throw new ke.Upgrade("Not yet support for changing primary key");var Ee=oe.objectStore(We.name);We.add.forEach(function(rt){return gi(Ee,rt)}),We.change.forEach(function(rt){Ee.deleteIndex(rt.name),gi(Ee,rt)}),We.del.forEach(function(rt){return Ee.deleteIndex(rt)})}),he._cfg.contentUpgrade);if(Re&&he._cfg.version>ee)return co(J,oe),le._memoizedTables={},ve=ae(Te),Ke.del.forEach(function(We){ve[We]=De[We]}),qi(J,[J.Transaction.prototype]),Lo(J,[J.Transaction.prototype],d(ve),ve),le.schema=ve,(Ne=A(Re))&&qn(),Te=Ve.follow(function(){var We;(Ce=Re(le))&&Ne&&(We=zt.bind(null,null),Ce.then(We,We))}),Ce&&typeof Ce.then=="function"?Ve.resolve(Ce):Te.then(function(){return Ce})}),re.push(function(ve){var Ne,Ce,De=he._cfg.dbschema;Ne=De,Ce=ve,[].slice.call(Ce.db.objectStoreNames).forEach(function(Te){return Ne[Te]==null&&Ce.db.deleteObjectStore(Te)}),qi(J,[J.Transaction.prototype]),Lo(J,[J.Transaction.prototype],J._storeNames,J._dbSchema),le.schema=J._dbSchema}),re.push(function(ve){J.idbdb.objectStoreNames.contains("$meta")&&(Math.ceil(J.idbdb.version/10)===he._cfg.version?(J.idbdb.deleteObjectStore("$meta"),delete J._dbSchema.$meta,J._storeNames=J._storeNames.filter(function(Ne){return Ne!=="$meta"})):ve.objectStore("$meta").put(he._cfg.version,"version"))})}),(function he(){return re.length?Ve.resolve(re.shift()(le.idbtrans)).then(he):Ve.resolve()})().then(function(){mi(ge,oe)}))}).catch(M);var Z,ce;d(_).forEach(function(te){zo(p,te,_[te].primKey,_[te].indexes)}),co(a,p),Ve.follow(function(){return a.on.populate.fire(N)}).catch(M)})}function Wi(a,f){mi(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 p=Gt(0,a.idbdb,f);Sr(a,a._dbSchema,f);for(var y=0,_=Yi(p,a._dbSchema).change;y<_.length;y++){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){St&&console.debug("Dexie upgrade patch: Creating missing index ".concat(M.name,".").concat(Z.src)),gi(O,Z)})})(_[y]);if(typeof N=="object")return N.value}}function Yi(a,f){var p,y={del:[],add:[],change:[]};for(p in a)f[p]||y.del.push(p);for(p in f){var _=a[p],N=f[p];if(_){var M={name:p,def:N,recreate:!1,del:[],add:[],change:[]};if(""+(_.primKey.keyPath||"")!=""+(N.primKey.keyPath||"")||_.primKey.auto!==N.primKey.auto)M.recreate=!0,y.change.push(M);else{var O=_.idxByName,Z=N.idxByName,ce=void 0;for(ce in O)Z[ce]||M.del.push(ce);for(ce in Z){var te=O[ce],J=Z[ce];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)&&y.change.push(M)}}else y.add.push([p,N])}return y}function zo(a,f,p,y){var _=a.db.createObjectStore(f,p.keyPath?{keyPath:p.keyPath,autoIncrement:p.auto}:{autoIncrement:p.auto});y.forEach(function(N){return gi(_,N)})}function mi(a,f){d(a).forEach(function(p){f.db.objectStoreNames.contains(p)||(St&&console.debug("Dexie: Creating missing table",p),zo(f,p,a[p].primKey,a[p].indexes))})}function gi(a,f){a.createIndex(f.name,f.keyPath,{unique:f.unique,multiEntry:f.multi})}function Gt(a,f,p){var y={};return K(f.objectStoreNames,0).forEach(function(_){for(var N=p.objectStore(_),M=Do(Ds(ce=N.keyPath),ce||"",!0,!1,!!N.autoIncrement,ce&&typeof ce!="string",!0),O=[],Z=0;Z<N.indexNames.length;++Z){var te=N.index(N.indexNames[Z]),ce=te.keyPath,te=Do(te.name,ce,!!te.unique,!!te.multiEntry,!1,ce&&typeof ce!="string",!1);O.push(te)}y[_]=Ls(_,M,O)}),y}function Sr(a,f,p){for(var y=p.db.objectStoreNames,_=0;_<y.length;++_){var N=y[_],M=p.objectStore(N);a._hasGetAll="getAll"in M;for(var O=0;O<M.indexNames.length;++O){var Z,ce=M.indexNames[O],te=M.index(ce).keyPath,te=typeof te=="string"?te:"["+K(te).join("+")+"]";f[N]&&(Z=f[N].idxByName[te])&&(Z.name=ce,delete f[N].idxByName[te],f[N].idxByName[ce]=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,p){var _=f.split(":"),y=(y=_[1])==null?void 0:y.trim(),_=(f=_[0].trim()).replace(/([&*]|\+\+)/g,""),N=/^\[/.test(_)?_.match(/^\[(.*)\]$/)[1].split("+"):_;return Do(_,N||null,/\&/.test(f),/\*/.test(f),/\+\+/.test(f),m(N),p===0,y)})}Fo.prototype._createTableSchema=Ls,Fo.prototype._parseIndexSyntax=Xi,Fo.prototype._parseStoresSpec=function(a,f){var p=this;d(a).forEach(function(y){if(a[y]!==null){var _=p._parseIndexSyntax(a[y]),N=_.shift();if(!N)throw new ke.Schema("Invalid schema for table "+y+": "+a[y]);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=p._createTableSchema(y,N,_),f[y]=N}})},Fo.prototype.stores=function(p){var f=this.db,p=(this._cfg.storesSource=this._cfg.storesSource?v(this._cfg.storesSource,p):p,f._versions),y={},_={};return p.forEach(function(N){v(y,N._cfg.storesSource),_=N._cfg.dbschema={},N._parseStoresSpec(y,_)}),f._dbSchema=_,qi(f,[f._allTables,f,f.Transaction.prototype]),Lo(f,[f._allTables,f,f.Transaction.prototype,this._cfg.tables],d(_),_),f._storeNames=d(_),this},Fo.prototype.upgrade=function(a){return this._cfg.contentUpgrade=Ot(this._cfg.contentUpgrade||Oe,a),this};var yi=Fo;function Fo(){}var fo=(()=>{var a,f,p;return typeof FinalizationRegistry<"u"&&typeof WeakRef<"u"?(a=new Set,f=new FinalizationRegistry(function(y){a.delete(y)}),{toArray:function(){return Array.from(a).map(function(y){return y.deref()}).filter(function(y){return y!==void 0})},add:function(y){var _=new WeakRef(y._novip);a.add(_),f.register(y._novip,_,_),a.size>y._options.maxConnections&&(_=a.values().next().value,a.delete(_),f.unregister(_))},remove:function(y){if(y)for(var _=a.values(),N=_.next();!N.done;){var M=N.value;if(M.deref()===y._novip)return a.delete(M),void f.unregister(M);N=_.next()}}}):(p=[],{toArray:function(){return p},add:function(y){p.push(y._novip)},remove:function(y){y&&(y=p.indexOf(y._novip))!==-1&&p.splice(y,1)}})})();function vi(a,f){var p=a._dbNamesDB;return p||(p=a._dbNamesDB=new Nr(Dr,{addons:[],indexedDB:a,IDBKeyRange:f})).version(1).stores({dbnames:"name"}),p.table("dbnames")}function ho(a){return a&&typeof a.databases=="function"}function Bo(a){return on(function(){return Ye.letThrough=!0,a()})}function Qi(a){return!("from"in a)}var Jt=function(a,f){var p;if(!this)return p=new Jt,a&&"d"in a&&v(p,a),p;v(this,arguments.length?{d:1,from:a,to:1<arguments.length?f:a}:{d:0})};function xi(a,f,p){var y=ft(f,p);if(!isNaN(y)){if(0<y)throw RangeError();if(Qi(a))return v(a,{from:f,to:p,d:1});var y=a.l,_=a.r;if(ft(p,a.from)<0)return y?xi(y,f,p):a.l={from:f,to:p,d:1,l:null,r:null},Ka(a);if(0<ft(f,a.to))return _?xi(_,f,p):a.r={from:f,to:p,d:1,l:null,r:null},Ka(a);ft(f,a.from)<0&&(a.from=f,a.l=null,a.d=_?_.d+1:1),0<ft(p,a.to)&&(a.to=p,a.r=null,a.d=a.l?a.l.d+1:1),f=!a.r,y&&!a.l&&wi(a,y),_&&f&&wi(a,_)}}function wi(a,f){Qi(f)||(function p(y,_){var N=_.from,M=_.l,O=_.r;xi(y,N,_.to),M&&p(y,M),O&&p(y,O)})(a,f)}function Gi(a,f){var p=Ji(f),y=p.next();if(!y.done)for(var _=y.value,N=Ji(a),M=N.next(_.from),O=M.value;!y.done&&!M.done;){if(ft(O.from,_.to)<=0&&0<=ft(O.to,_.from))return!0;ft(_.from,O.from)<0?_=(y=p.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(p){for(var y=0<arguments.length;f;)switch(f.s){case 0:if(f.s=1,y)for(;f.n.l&&ft(p,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,!y||ft(p,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 Ka(a){var f,p,y,_=(((_=a.r)==null?void 0:_.d)||0)-(((_=a.l)==null?void 0:_.d)||0),_=1<_?"r":_<-1?"l":"";_&&(f=_=="r"?"l":"r",p=s({},a),y=a[_],a.from=y.from,a.to=y.to,a[_]=y[_],p[_]=y[f],(a[f]=p).d=Ua(p)),a.d=Ua(a)}function Ua(p){var f=p.r,p=p.l;return(f?p?Math.max(f.d,p.d):f.d:p?p.d:0)+1}function Zi(a,f){return d(f).forEach(function(p){a[p]?wi(a[p],f[p]):a[p]=(function y(_){var N,M,O={};for(N in _)w(_,N)&&(M=_[N],O[N]=!M||typeof M!="object"||H.has(M.constructor)?M:y(M));return O})(f[p])}),a}function Bs(a,f){return a.all||f.all||Object.keys(a).some(function(p){return f[p]&&Gi(f[p],a[p])})}S(Jt.prototype,((Nt={add:function(a){return wi(this,a),this},addKey:function(a){return xi(this,a,a),this},addKeys:function(a){var f=this;return a.forEach(function(p){return xi(f,p,p)}),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)},Nt));var Vr={},Hs={},Vs=!1;function es(a){Zi(Hs,a),Vs||(Vs=!0,setTimeout(function(){Vs=!1,Ks(Hs,!(Hs={}))},0))}function Ks(a,f){f===void 0&&(f=!1);var p=new Set;if(a.all)for(var y=0,_=Object.values(Vr);y<_.length;y++)ts(O=_[y],a,p,f);else for(var N in a){var M,O,N=/^idb\:\/\/(.*)\/(.*)\//.exec(N);N&&(M=N[1],N=N[2],O=Vr["idb://".concat(M,"/").concat(N)])&&ts(O,a,p,f)}p.forEach(function(Z){return Z()})}function ts(a,f,p,y){for(var _=[],N=0,M=Object.entries(a.queries.query);N<M.length;N++){for(var O=M[N],Z=O[0],ce=[],te=0,J=O[1];te<J.length;te++){var ee=J[te];Bs(f,ee.obsSet)?ee.subscribers.forEach(function(se){return p.add(se)}):y&&ce.push(ee)}y&&_.push([Z,ce])}if(y)for(var le=0,oe=_;le<oe.length;le++){var re=oe[le],Z=re[0],ce=re[1];a.queries.query[Z]=ce}}function Du(a){var f=a._state,p=a._deps.indexedDB;if(f.isBeingOpened||a.idbdb)return f.dbReadyPromise.then(function(){return f.dbOpenError?Et(f.dbOpenError):a});f.isBeingOpened=!0,f.dbOpenError=null,f.openComplete=!1;var y=f.openCanceller,_=Math.round(10*a.verno),N=!1;function M(){if(f.openCanceller!==y)throw new ke.DatabaseClosed("db.open() was cancelled")}function O(){return new Ve(function(ee,le){if(M(),!p)throw new ke.MissingAPI;var oe=a.name,re=f.autoSchema||!_?p.open(oe):p.open(oe,_);if(!re)throw new ke.MissingAPI;re.onerror=an(le),re.onblocked=Le(a._fireOnBlocked),re.onupgradeneeded=Le(function(se){var ge;te=re.transaction,f.autoSchema&&!a._options.allowEmptyDB?(re.onerror=$n,te.abort(),re.result.close(),(ge=p.deleteDatabase(oe)).onsuccess=ge.onerror=Le(function(){le(new ke.NoSuchDatabase("Database ".concat(oe," doesnt exist")))})):(te.onerror=an(le),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,le))},le),re.onsuccess=Le(function(){te=null;var se,ge,he,ve,Ne,Ce,De=a.idbdb=re.result,Te=K(De.objectStoreNames);if(0<Te.length)try{var Ke=De.transaction((Ne=Te).length===1?Ne[0]:Ne,"readonly");if(f.autoSchema)Ce=De,ve=Ke,(he=a).verno=Ce.version/10,ve=he._dbSchema=Gt(0,Ce,ve),he._storeNames=K(Ce.objectStoreNames,0),Lo(he,[he._allTables],d(ve),ve);else if(Sr(a,a._dbSchema,Ke),ge=Ke,((ge=Yi(Gt(0,(se=a).idbdb,ge),se._dbSchema)).add.length||ge.change.some(function(Re){return Re.add.length||Re.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());co(a,Ke)}catch{}fo.add(a),De.onversionchange=Le(function(Re){f.vcFired=!0,a.on("versionchange").fire(Re)}),De.onclose=Le(function(){a.close({disableAutoOpen:!1})}),J&&(Te=a._deps,Ne=oe,ho(Ce=Te.indexedDB)||Ne===Dr||vi(Ce,Te.IDBKeyRange).put({name:Ne}).catch(Oe)),ee()},le)}).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 Ve.reject(ee)})}var Z,ce=f.dbReadyResolve,te=null,J=!1;return Ve.race([y,(typeof navigator>"u"?Ve.resolve():!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise(function(ee){function le(){return indexedDB.databases().finally(ee)}Z=setInterval(le,100),le()}).finally(function(){return clearInterval(Z)}):Promise.resolve()).then(O)]).then(function(){return M(),f.onReadyBeingFired=[],Ve.resolve(Bo(function(){return a.on.ready.fire(a.vip)})).then(function ee(){var le;if(0<f.onReadyBeingFired.length)return le=f.onReadyBeingFired.reduce(Ot,Oe),f.onReadyBeingFired=[],Ve.resolve(Bo(function(){return le(a.vip)})).then(ee)})}).finally(function(){f.openCanceller===y&&(f.onReadyBeingFired=null,f.isBeingOpened=!1)}).catch(function(ee){f.dbOpenError=ee;try{te&&te.abort()}catch{}return y===f.openCanceller&&a._close(),Et(ee)}).finally(function(){f.openComplete=!0,ce()}).then(function(){var ee;return J&&(ee={},a.tables.forEach(function(le){le.schema.indexes.forEach(function(oe){oe.name&&(ee["idb://".concat(a.name,"/").concat(le.name,"/").concat(oe.name)]=new Jt(-1/0,[[[]]]))}),ee["idb://".concat(a.name,"/").concat(le.name,"/")]=ee["idb://".concat(a.name,"/").concat(le.name,"/:dels")]=new Jt(-1/0,[[[]]])}),An(hi).fire(ee),Ks(ee,!0)),a})}function Us(a){function f(N){return a.next(N)}var p=_(f),y=_(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(p,y):m(Z)?Promise.all(Z).then(p,y):p(Z)}}return _(f)()}function ns(a,f,p){for(var y=m(a)?a.slice():[a],_=0;_<p;++_)y.push(f);return y}var qa={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function(a){return s(s({},a),{table:function(y){var p=a.table(y),y=p.schema,_={},N=[];function M(ee,le,oe){var he=pi(ee),re=_[he]=_[he]||[],se=ee==null?0:typeof ee=="string"?1:ee.length,ge=0<le,he=s(s({},oe),{name:ge?"".concat(he,"(virtual-from:").concat(oe.name,")"):oe.name,lowLevelIndex:oe,isVirtual:ge,keyTail:le,keyLength:se,extractKey:lo(ee),unique:!ge&&oe.unique});return re.push(he),he.isPrimaryKey||N.push(he),1<se&&M(se===2?ee[0]:ee.slice(0,se-1),le+1,oe),re.sort(function(ve,Ne){return ve.keyTail-Ne.keyTail}),he}var O=M(y.primaryKey.keyPath,0,y.primaryKey);_[":id"]=[O];for(var Z=0,ce=y.indexes;Z<ce.length;Z++){var te=ce[Z];M(te.keyPath,0,te)}function J(ee){var le,oe=ee.query.index;return oe.isVirtual?s(s({},ee),{query:{index:oe.lowLevelIndex,range:(le=ee.query.range,oe=oe.keyTail,{type:le.type===1?2:le.type,lower:ns(le.lower,le.lowerOpen?a.MAX_KEY:a.MIN_KEY,oe),lowerOpen:!0,upper:ns(le.upper,le.upperOpen?a.MIN_KEY:a.MAX_KEY,oe),upperOpen:!0})}}):ee}return s(s({},p),{schema:s(s({},y),{primaryKey:O,indexes:N,getIndexByKeyPath:function(ee){return(ee=_[pi(ee)])&&ee[0]}}),count:function(ee){return p.count(J(ee))},query:function(ee){return p.query(J(ee))},openCursor:function(ee){var le=ee.query.index,oe=le.keyTail,re=le.keyLength;return le.isVirtual?p.openCursor(J(ee)).then(function(ge){return ge&&se(ge)}):p.openCursor(ee);function se(ge){return Object.create(ge,{continue:{value:function(he){he!=null?ge.continue(ns(he,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(he,ve){ge.continuePrimaryKey(ns(he,a.MAX_KEY,oe),ve)}},primaryKey:{get:function(){return ge.primaryKey}},key:{get:function(){var he=ge.key;return re===1?he[0]:he.slice(0,re)}},value:{get:function(){return ge.value}}})}}})}})}};function qs(a,f,p,y){return p=p||{},y=y||"",d(a).forEach(function(_){var N,M,O;w(f,_)?(N=a[_],M=f[_],typeof N=="object"&&typeof M=="object"&&N&&M?(O=ue(N))!==ue(M)?p[y+_]=f[_]:O==="Object"?qs(N,M,p,y+_+"."):N!==M&&(p[y+_]=f[_]):N!==M&&(p[y+_]=f[_])):p[y+_]=void 0}),d(f).forEach(function(_){w(a,_)||(p[y+_]=f[_])}),p}function Ws(a,f){return f.type==="delete"?f.keys:f.keys||f.values.map(a.extractKey)}var Lu={stack:"dbcore",name:"HooksMiddleware",level:2,create:function(a){return s(s({},a),{table:function(f){var p=a.table(f),y=p.schema.primaryKey;return s(s({},p),{mutate:function(_){var N=Ye.trans,M=N.table(f).hook,O=M.deleting,Z=M.creating,ce=M.updating;switch(_.type){case"add":if(Z.fire===Oe)break;return N._promise("readwrite",function(){return te(_)},!0);case"put":if(Z.fire===Oe&&ce.fire===Oe)break;return N._promise("readwrite",function(){return te(_)},!0);case"delete":if(O.fire===Oe)break;return N._promise("readwrite",function(){return te(_)},!0);case"deleteRange":if(O.fire===Oe)break;return N._promise("readwrite",function(){return(function J(ee,le,oe){return p.query({trans:ee,values:!1,query:{index:y,range:le},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({},le),{lower:se[se.length-1],lowerOpen:!0}),oe)})})})(_.trans,_.range,1e4)},!0)}return p.mutate(_);function te(J){var ee,le,oe,re=Ye.trans,se=J.keys||Ws(y,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=p,oe=se,((le=J).type==="add"?Promise.resolve([]):ee.getMany({trans:le.trans,keys:oe,cache:"immutable"})).then(function(ge){var he=se.map(function(ve,Ne){var Ce,De,Te,Ke=ge[Ne],Re={onerror:null,onsuccess:null};return J.type==="delete"?O.fire.call(Re,ve,Ke,re):J.type==="add"||Ke===void 0?(Ce=Z.fire.call(Re,ve,J.values[Ne],re),ve==null&&Ce!=null&&(J.keys[Ne]=ve=Ce,y.outbound||B(J.values[Ne],y.keyPath,ve))):(Ce=qs(Ke,J.values[Ne]),(De=ce.fire.call(Re,Ce,ve,Ke,re))&&(Te=J.values[Ne],Object.keys(De).forEach(function(We){w(Te,We)?Te[We]=De[We]:B(Te,We,De[We])}))),Re});return p.mutate(J).then(function(ve){for(var Ne=ve.failures,Ce=ve.results,De=ve.numFailures,ve=ve.lastResult,Te=0;Te<se.length;++Te){var Ke=(Ce||se)[Te],Re=he[Te];Ke==null?Re.onerror&&Re.onerror(Ne[Te]):Re.onsuccess&&Re.onsuccess(J.type==="put"&&ge[Te]?J.values[Te]:Ke)}return{failures:Ne,results:Ce,numFailures:De,lastResult:ve}}).catch(function(ve){return he.forEach(function(Ne){return Ne.onerror&&Ne.onerror(ve)}),Promise.reject(ve)})});throw new Error("Keys missing")}}})}})}};function Wa(a,f,p){try{if(!f||f.keys.length<a.length)return null;for(var y=[],_=0,N=0;_<f.keys.length&&N<a.length;++_)ft(f.keys[_],a[N])===0&&(y.push(p?xe(f.values[_]):f.values[_]),++N);return y.length===a.length?y:null}catch{return null}}var zu={stack:"dbcore",level:-1,create:function(a){return{table:function(f){var p=a.table(f);return s(s({},p),{getMany:function(y){var _;return y.cache?(_=Wa(y.keys,y.trans._cache,y.cache==="clone"))?Ve.resolve(_):p.getMany(y).then(function(N){return y.trans._cache={keys:y.keys,values:y.cache==="clone"?xe(N):N},N}):p.getMany(y)},mutate:function(y){return y.type!=="add"&&(y.trans._cache=null),p.mutate(y)}})}}}};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,p=new Jt(a.MIN_KEY,a.MAX_KEY);return s(s({},a),{transaction:function(y,_,N){if(Ye.subscr&&_!=="readonly")throw new ke.ReadOnly("Readwrite transaction in liveQuery context. Querier source: ".concat(Ye.querier));return a.transaction(y,_,N)},table:function(y){function _(se){var re,se=se.query;return[re=se.index,new Jt((re=(se=se.range).lower)!=null?re:a.MIN_KEY,(re=se.upper)!=null?re:a.MAX_KEY)]}var N=a.table(y),M=N.schema,O=M.primaryKey,Z=M.indexes,ce=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(y,"/").concat(Ee),Ne[Ee]||(Ne[Ee]=new Jt)}var se,ge,he,ve=oe.trans,Ne=oe.mutatedParts||(oe.mutatedParts={}),Ce=re(""),De=re(":dels"),Te=oe.type,Re=oe.type==="deleteRange"?[oe.range]:oe.type==="delete"?[oe.keys]:oe.values.length<50?[Ws(O,oe).filter(function(Ee){return Ee}),oe.values]:[],Ke=Re[0],Re=Re[1],We=oe.trans._cache;return m(Ke)?(Ce.addKeys(Ke),(Te=Te==="delete"||Ke.length===Re.length?Wa(Ke,We):null)||De.addKeys(Ke),(Te||Re)&&(se=re,ge=Te,he=Re,M.indexes.forEach(function(Ee){var rt=se(Ee.name||"");function ot(dt){return dt!=null?Ee.extractKey(dt):null}function lt(dt){Ee.multiEntry&&m(dt)?dt.forEach(function(gn){return rt.addKey(gn)}):rt.addKey(dt)}(ge||he).forEach(function(dt,Ct){var at=ge&&ot(ge[Ct]),Ct=he&&ot(he[Ct]);ft(at,Ct)!==0&&(at!=null&&lt(at),Ct!=null)&&lt(Ct)})}))):Ke?(Re={from:(We=Ke.lower)!=null?We:a.MIN_KEY,to:(Te=Ke.upper)!=null?Te:a.MAX_KEY},De.add(Re),Ce.add(Re)):(Ce.add(p),De.add(p),M.indexes.forEach(function(Ee){return re(Ee.name).add(p)})),N.mutate(oe).then(function(Ee){return!Ke||oe.type!=="add"&&oe.type!=="put"||(Ce.addKeys(Ee.results),J&&J.forEach(function(rt){for(var ot=oe.values.map(function(at){return rt.extractKey(at)}),lt=rt.keyPath.findIndex(function(at){return at===O.keyPath}),dt=0,gn=Ee.results.length;dt<gn;++dt)ot[dt][lt]=Ee.results[dt];re(rt.name).addKeys(ot)})),ve.mutatedParts=Zi(ve.mutatedParts||{},Ne),Ee})}}),le={get:function(oe){return[O,new Jt(oe.key)]},getMany:function(oe){return[O,new Jt().addKeys(oe.keys)]},count:_,query:_,openCursor:_};return d(le).forEach(function(oe){ee[oe]=function(re){var se=Ye.subscr,ge=!!se,he=Ya(Ye,N)&&Xa(oe,re)?re.obsSet={}:se;if(ge){var ve,se=function(Re){return Re="idb://".concat(f,"/").concat(y,"/").concat(Re),he[Re]||(he[Re]=new Jt)},Ne=se(""),Ce=se(":dels"),ge=le[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(Re){if(oe==="query"){if(te&&re.values)return ve.then(function(ot){return ot=ot.result,Ne.addKeys(ot),Re});var We=re.values?Re.result.map(ce):Re.result;(re.values?Ne:Ce).addKeys(We)}else{var Ee,rt;if(oe==="openCursor")return rt=re.values,(Ee=Re)&&Object.create(Ee,{key:{get:function(){return Ce.addKey(Ee.primaryKey),Ee.key}},primaryKey:{get:function(){var ot=Ee.primaryKey;return Ce.addKey(ot),ot}},value:{get:function(){return rt&&Ne.addKey(Ee.primaryKey),Ee.value}}})}return Re});Ce.add(p)}}return N[oe].apply(this,arguments)}}),ee}})}};function Ho(a,f,p){var y;return p.numFailures===0?f:f.type==="deleteRange"||(y=f.keys?f.keys.length:"values"in f&&f.values?f.values.length:1,p.numFailures===y)?null:(y=s({},f),m(y.keys)&&(y.keys=y.keys.filter(function(_,N){return!(N in p.failures)})),"values"in y&&m(y.values)&&(y.values=y.values.filter(function(_,N){return!(N in p.failures)})),y)}function Xs(a,f){return p=a,((y=f).lower===void 0||(y.lowerOpen?0<ft(p,y.lower):0<=ft(p,y.lower)))&&(p=a,(y=f).upper===void 0||(y.upperOpen?ft(p,y.upper)<0:ft(p,y.upper)<=0));var p,y}function Qs(a,f,p,y,_,N){var M,O,Z,ce,te,J,ee;return!p||p.length===0||(M=f.query.index,O=M.multiEntry,Z=f.query.range,ce=y.schema.primaryKey.extractKey,te=M.extractKey,J=(M.lowLevelIndex||M).extractKey,(y=p.reduce(function(le,oe){var re=le,se=[];if(oe.type==="add"||oe.type==="put")for(var ge=new Jt,he=oe.values.length-1;0<=he;--he){var ve,Ne=oe.values[he],Ce=ce(Ne);!ge.hasKey(Ce)&&(ve=te(Ne),O&&m(ve)?ve.some(function(We){return Xs(We,Z)}):Xs(ve,Z))&&(ge.addKey(Ce),se.push(Ne))}switch(oe.type){case"add":var De=new Jt().addKeys(f.values?le.map(function(Ee){return ce(Ee)}):le),re=le.concat(f.values?se.filter(function(Ee){return Ee=ce(Ee),!De.hasKey(Ee)&&(De.addKey(Ee),!0)}):se.map(function(Ee){return ce(Ee)}).filter(function(Ee){return!De.hasKey(Ee)&&(De.addKey(Ee),!0)}));break;case"put":var Te=new Jt().addKeys(oe.values.map(function(Ee){return ce(Ee)}));re=le.filter(function(Ee){return!Te.hasKey(f.values?ce(Ee):Ee)}).concat(f.values?se:se.map(function(Ee){return ce(Ee)}));break;case"delete":var Ke=new Jt().addKeys(oe.keys);re=le.filter(function(Ee){return!Ke.hasKey(f.values?ce(Ee):Ee)});break;case"deleteRange":var Re=oe.range;re=le.filter(function(Ee){return!Xs(ce(Ee),Re)})}return re},a))===a)?a:(ee=function(le,oe){return ft(J(le),J(oe))||ft(ce(le),ce(oe))},y.sort(f.direction==="prev"||f.direction==="prevunique"?function(le,oe){return ee(oe,le)}:ee),f.limit&&f.limit<1/0&&(y.length>f.limit?y.length=f.limit:a.length===f.limit&&y.length<f.limit&&(_.dirty=!0)),N?Object.freeze(y):y)}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((p,y,_,N)=>{if(p===void 0)return y!==void 0?-1:0;if(y===void 0)return 1;if((p=ft(p,y))===0){if(_&&N)return 0;if(_)return 1;if(N)return-1}return p})(a.lower,f.lower,a.lowerOpen,f.lowerOpen)<=0&&0<=((p,y,_,N)=>{if(p===void 0)return y!==void 0?1:0;if(y===void 0)return-1;if((p=ft(p,y))===0){if(_&&N)return 0;if(_)return-1;if(N)return 1}return p})(a.upper,f.upper,a.upperOpen,f.upperOpen)}function Ga(a,f,p,y){a.subscribers.add(p),y.addEventListener("abort",function(){var _,N;a.subscribers.delete(p),a.subscribers.size===0&&(_=a,N=f,setTimeout(function(){_.subscribers.size===0&&z(N,_)},3e3))})}var Ja={stack:"dbcore",level:0,name:"Cache",create:function(a){var f=a.schema.name;return s(s({},a),{transaction:function(p,y,_){var N,M,O=a.transaction(p,y,_);return y==="readwrite"&&(_=(N=new AbortController).signal,O.addEventListener("abort",(M=function(Z){return function(){if(N.abort(),y==="readwrite"){for(var ce=new Set,te=0,J=p;te<J.length;te++){var ee=J[te],le=Vr["idb://".concat(f,"/").concat(ee)];if(le){var oe=a.table(ee),re=le.optimisticOps.filter(function(Ee){return Ee.trans===O});if(O._explicit&&Z&&O.mutatedParts)for(var se=0,ge=Object.values(le.queries.query);se<ge.length;se++)for(var he=0,ve=(De=ge[se]).slice();he<ve.length;he++)Bs((Te=ve[he]).obsSet,O.mutatedParts)&&(z(De,Te),Te.subscribers.forEach(function(Ee){return ce.add(Ee)}));else if(0<re.length){le.optimisticOps=le.optimisticOps.filter(function(Ee){return Ee.trans!==O});for(var Ne=0,Ce=Object.values(le.queries.query);Ne<Ce.length;Ne++)for(var De,Te,Ke,Re=0,We=(De=Ce[Ne]).slice();Re<We.length;Re++)(Te=We[Re]).res!=null&&O.mutatedParts&&(Z&&!Te.dirty?(Ke=Object.isFrozen(Te.res),Ke=Qs(Te.res,Te.req,re,oe,Te,Ke),Te.dirty?(z(De,Te),Te.subscribers.forEach(function(Ee){return ce.add(Ee)})):Ke!==Te.res&&(Te.res=Ke,Te.promise=Ve.resolve({result:Ke}))):(Te.dirty&&z(De,Te),Te.subscribers.forEach(function(Ee){return ce.add(Ee)})))}}}ce.forEach(function(Ee){return Ee()})}}})(!1),{signal:_}),O.addEventListener("error",M(!1),{signal:_}),O.addEventListener("complete",M(!0),{signal:_})),O},table:function(p){var y=a.table(p),_=y.schema.primaryKey;return s(s({},y),{mutate:function(N){var M,O=Ye.trans;return!_.outbound&&O.db._options.cache!=="disabled"&&!O.explicit&&O.idbtrans.mode==="readwrite"&&(M=Vr["idb://".concat(f,"/").concat(p)])?(O=y.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&&(z(M.optimisticOps,N),(Z=Ho(0,N,Z))&&M.optimisticOps.push(Z),N.mutatedParts)&&es(N.mutatedParts)}),O.catch(function(){z(M.optimisticOps,N),N.mutatedParts&&es(N.mutatedParts)})):O.then(function(Z){var ce=Ho(0,s(s({},N),{values:N.values.map(function(te,J){var ee;return Z.failures[J]?te:(B(ee=(ee=_.keyPath)!=null&&ee.includes(".")?xe(te):s({},te),_.keyPath,Z.results[J]),ee)})}),Z);M.optimisticOps.push(ce),queueMicrotask(function(){return N.mutatedParts&&es(N.mutatedParts)})}),O):y.mutate(N)},query:function(N){var M,O,Z,ce,te,J,ee;return Ya(Ye,y)&&Xa("query",N)?(M=((Z=Ye.trans)==null?void 0:Z.db._options.cache)==="immutable",O=(Z=Ye).requery,Z=Z.signal,J=((le,oe,re,se)=>{var ge=Vr["idb://".concat(le,"/").concat(oe)];if(!ge)return[];if(!(le=ge.queries[re]))return[null,!1,ge,null];var he=le[(se.query?se.query.index.name:null)||""];if(!he)return[null,!1,ge,null];switch(re){case"query":var ve=(Ne=se.direction)!=null?Ne:"next",Ne=he.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,he]:[he.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,he];case"count":return Ne=he.find(function(Ce){return Gs(Ce.req.query.range,se.query.range)}),[Ne,!!Ne,ge,he]}})(f,p,"query",N),ee=J[0],ce=J[2],te=J[3],ee&&J[1]?ee.obsSet=N.obsSet:(J=y.query(N).then(function(le){var oe=le.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 le.result=xe(oe);return le}).catch(function(le){return te&&ee&&z(te,ee),Promise.reject(le)}),ee={obsSet:N.obsSet,promise:J,subscribers:new Set,type:"query",req:N,dirty:!1},te?te.push(ee):(te=[ee],(ce=ce||(Vr["idb://".concat(f,"/").concat(p)]={queries:{query:{},count:{}},objs:new Map,optimisticOps:[],unsignaledParts:{}})).queries.query[N.query.index.name||""]=te)),Ga(ee,te,O,Z),ee.promise.then(function(le){return{result:Qs(le.result,N,ce==null?void 0:ce.optimisticOps,y,ee,M)}})):y.query(N)}})}})}};function kr(a,f){return new Proxy(a,{get:function(p,y,_){return y==="db"?f:Reflect.get(p,y,_)}})}Rt.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,p=f.filter(function(y){return y._cfg.version===a})[0];return p||(p=new this.Version(a),f.push(p),f.sort(Hr),p.stores({}),this._state.autoSchema=!1),p},Rt.prototype._whenReady=function(a){var f=this;return this.idbdb&&(this._state.openComplete||Ye.letThrough||this._vip)?a():new Ve(function(p,y){if(f._state.openComplete)return y(new ke.DatabaseClosed(f._state.dbOpenError));if(!f._state.isBeingOpened){if(!f._state.autoOpen)return void y(new ke.DatabaseClosed);f.open().catch(Oe)}f._state.dbReadyPromise.then(p,y)}).then(a)},Rt.prototype.use=function(_){var f=_.stack,p=_.create,y=_.level,_=_.name,N=(_&&this.unuse({stack:f,name:_}),this._middlewares[f]||(this._middlewares[f]=[]));return N.push({stack:f,create:p,level:y??10,name:_}),N.sort(function(M,O){return M.level-O.level}),this},Rt.prototype.unuse=function(a){var f=a.stack,p=a.name,y=a.create;return f&&this._middlewares[f]&&(this._middlewares[f]=this._middlewares[f].filter(function(_){return y?_.create!==y:!!p&&_.name!==p})),this},Rt.prototype.open=function(){var a=this;return ir(kn,function(){return Du(a)})},Rt.prototype._close=function(){this.on.close.fire(new CustomEvent("close"));var a=this._state;if(fo.remove(this),this.idbdb){try{this.idbdb.close()}catch{}this.idbdb=null}a.isBeingOpened||(a.dbReadyPromise=new Ve(function(f){a.dbReadyResolve=f}),a.openCanceller=new Ve(function(f,p){a.cancelOpen=p}))},Rt.prototype.close=function(f){var f=(f===void 0?{disableAutoOpen:!0}:f).disableAutoOpen,p=this._state;f?(p.isBeingOpened&&p.cancelOpen(new ke.DatabaseClosed),this._close(),p.autoOpen=!1,p.dbOpenError=new ke.DatabaseClosed):(this._close(),p.autoOpen=this._options.autoOpen||p.isBeingOpened,p.openComplete=!1,p.dbOpenError=null)},Rt.prototype.delete=function(a){var f=this,p=(a===void 0&&(a={disableAutoOpen:!0}),0<arguments.length&&typeof arguments[0]!="object"),y=this._state;return new Ve(function(_,N){function M(){f.close(a);var O=f._deps.indexedDB.deleteDatabase(f.name);O.onsuccess=Le(function(){var Z,ce,te;Z=f._deps,ce=f.name,ho(te=Z.indexedDB)||ce===Dr||vi(te,Z.IDBKeyRange).delete(ce).catch(Oe),_()}),O.onerror=an(N),O.onblocked=f._fireOnBlocked}if(p)throw new ke.InvalidArgument("Invalid closeOptions argument to db.delete()");y.isBeingOpened?y.dbReadyPromise.then(M):M()})},Rt.prototype.backendDB=function(){return this.idbdb},Rt.prototype.isOpen=function(){return this.idbdb!==null},Rt.prototype.hasBeenClosed=function(){var a=this._state.dbOpenError;return a&&a.name==="DatabaseClosed"},Rt.prototype.hasFailed=function(){return this._state.dbOpenError!==null},Rt.prototype.dynamicallyOpened=function(){return this._state.autoSchema},Object.defineProperty(Rt.prototype,"tables",{get:function(){var a=this;return d(this._allTables).map(function(f){return a._allTables[f]})},enumerable:!1,configurable:!0}),Rt.prototype.transaction=function(){var a=(function(f,p,y){var _=arguments.length;if(_<2)throw new ke.InvalidArgument("Too few arguments");for(var N=new Array(_-1);--_;)N[_-1]=arguments[_];return y=N.pop(),[f,we(N),y]}).apply(this,arguments);return this._transaction.apply(this,a)},Rt.prototype._transaction=function(a,f,p){var y,_,N=this,M=Ye.trans,O=(M&&M.db===this&&a.indexOf("!")===-1||(M=null),a.indexOf("?")!==-1);a=a.replace("!","").replace("?","");try{if(_=f.map(function(ce){if(ce=ce instanceof N.Table?ce.name:ce,typeof ce!="string")throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");return ce}),a=="r"||a===Ao)y=Ao;else{if(a!="rw"&&a!=Lr)throw new ke.InvalidArgument("Invalid transaction mode: "+a);y=Lr}if(M){if(M.mode===Ao&&y===Lr){if(!O)throw new ke.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");M=null}M&&_.forEach(function(ce){if(M&&M.storeNames.indexOf(ce)===-1){if(!O)throw new ke.SubTransaction("Table "+ce+" not included in parent transaction.");M=null}}),O&&M&&!M.active&&(M=null)}}catch(ce){return M?M._promise(null,function(te,J){J(ce)}):Et(ce)}var Z=(function ce(te,J,ee,le,oe){return Ve.resolve().then(function(){var he=Ye.transless||Ye,re=te._createTransaction(J,ee,te._dbSchema,le),he=(re.explicit=!0,{trans:re,transless:he});if(le)re.idbtrans=le.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 ce(te,J,ee,null,oe)})):Et(ve)}var se,ge=A(oe),he=(ge&&qn(),Ve.follow(function(){var ve;(se=oe.call(re,re))&&(ge?(ve=zt.bind(null,null),se.then(ve,ve)):typeof se.next=="function"&&typeof se.throw=="function"&&(se=Us(se)))},he));return(se&&typeof se.then=="function"?Ve.resolve(se).then(function(ve){return re.active?ve:Et(new ke.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))}):he.then(function(){return se})).then(function(ve){return le&&re._resolve(),re._completion.then(function(){return ve})}).catch(function(ve){return re._reject(ve),Et(ve)})})}).bind(null,this,y,_,M,p);return M?M._promise(y,Z,"lock"):Ye.trans?ir(Ye.transless,function(){return N._whenReady(Z)}):this._whenReady(Z)},Rt.prototype.table=function(a){if(w(this._allTables,a))return this._allTables[a];throw new ke.InvalidTable("Table ".concat(a," does not exist"))};var Nr=Rt;function Rt(a,f){var p,y,_,N,M,O=this,Z=(this._middlewares={},this.verno=0,Rt.dependencies),Z=(this._options=f=s({addons:Rt.addons,autoOpen:!0,indexedDB:Z.indexedDB,IDBKeyRange:Z.IDBKeyRange,cache:"cloned",maxConnections:1e3},f),this._deps={indexedDB:f.indexedDB,IDBKeyRange:f.IDBKeyRange},f.addons),ce=(this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null,this._novip=this,{dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:Oe,dbReadyPromise:null,cancelOpen:Oe,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3,autoOpen:f.autoOpen}),te=(ce.dbReadyPromise=new Ve(function(J){ce.dbReadyResolve=J}),ce.openCanceller=new Ve(function(J,ee){ce.cancelOpen=ee}),this._state=ce,this.name=a,this.on=zr(this,"populate","blocked","versionchange","close",{ready:[Ot,Oe]}),this.once=function(J,ee){var le=function(){for(var oe=[],re=0;re<arguments.length;re++)oe[re]=arguments[re];O.on(J).unsubscribe(le),ee.apply(O,oe)};return O.on(J,le)},this.on.ready.subscribe=P(this.on.ready.subscribe,function(J){return function(ee,le){Rt.vip(function(){var oe,re=O._state;re.openComplete?(re.dbOpenError||Ve.resolve().then(ee),le&&J(ee)):re.onReadyBeingFired?(re.onReadyBeingFired.push(ee),le&&J(ee)):(J(ee),oe=O,le||J(function se(){oe.on.ready.unsubscribe(ee),oe.on.ready.unsubscribe(se)}))})}}),this.Collection=(p=this,io(Ba.prototype,function(se,re){this.db=p;var le=fi,oe=null;if(re)try{le=re()}catch(he){oe=he}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:le,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!==qe?ge:null}})),this.Table=(y=this,io(Yn.prototype,function(J,ee,le){this.db=y,this._tx=le,this.name=J,this.schema=ee,this.hook=y._allTables[J]?y._allTables[J].hook:zr(null,{creating:[it,Oe],reading:[ut,qe],updating:[_t,Oe],deleting:[Tt,Oe]})})),this.Transaction=(_=this,io(Ou.prototype,function(J,ee,le,oe,re){var se=this;J!=="readonly"&&ee.forEach(function(ge){ge=(ge=le[ge])==null?void 0:ge.yProps,ge&&(ee=ee.concat(ge.map(function(he){return he.updatesTable})))}),this.db=_,this.mode=J,this.storeNames=ee,this.schema=le,this.chromeTransactionDurability=oe,this.idbtrans=null,this.on=zr(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 Ve(function(ge,he){se._resolve=ge,se._reject=he}),this._completion.then(function(){se.active=!1,se.on.complete.fire()},function(ge){var he=se.active;return se.active=!1,se.on.error.fire(ge),se.parent?se.parent._reject(ge):he&&se.idbtrans&&se.idbtrans.abort(),Et(ge)})})),this.Version=(N=this,io(yi.prototype,function(J){this.db=N,this._cfg={version:J,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}})),this.WhereClause=(M=this,io(br.prototype,function(J,ee,le){if(this.db=M,this._ctx={table:J,index:ee===":id"?null:ee,or:le},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=_r(f.IDBKeyRange),this._createTransaction=function(J,ee,le,oe){return new O.Transaction(J,ee,le,O._options.chromeTransactionDurability,oe)},this._fireOnBlocked=function(J){O.on("blocked").fire(J),fo.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(Lu),new Proxy(this,{get:function(J,ee,le){var oe;return ee==="_vip"||(ee==="table"?function(re){return kr(O.table(re),te)}:(oe=Reflect.get(J,ee,le))instanceof Yn?kr(oe,te):ee==="tables"?oe.map(function(re){return kr(re,te)}):ee==="_createTransaction"?function(){return kr(oe.apply(this,arguments),te)}:oe)}}));this.vip=te,Z.forEach(function(J){return J(O)})}var rs,po=typeof Symbol<"u"&&"observable"in Symbol?Symbol.observable:"@@observable",Za=(mo.prototype.subscribe=function(a,f,p){return this._subscribe(a&&typeof a!="function"?a:{next:a,error:f,complete:p})},mo.prototype[po]=function(){return this},mo);function mo(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 Vo(a){var f,p=!1,y=new Za(function(_){var N=A(a),M,O=!1,Z={},ce={},te={get closed(){return O},unsubscribe:function(){O||(O=!0,M&&M.abort(),J&&An.storagemutated.unsubscribe(oe))}},J=(_.start&&_.start(te),!1),ee=function(){return $o(re)};function le(){return Bs(ce,Z)}var oe=function(se){Zi(Z,se),le()&&ee()},re=function(){var se,ge,he;!O&&rs.indexedDB&&(Z={},se={},M&&M.abort(),M=new AbortController,he=(ve=>{var Ne=hn();try{N&&qn();var Ce=on(a,ve);return Ce=N?Ce.finally(zt):Ce}finally{Ne&&Tn()}})(ge={subscr:se,signal:M.signal,requery:ee,querier:a,trans:null}),J||(An(hi,oe),J=!0),Promise.resolve(he).then(function(ve){p=!0,f=ve,O||ge.signal.aborted||(le()||(ce=se,le())?ee():(Z={},$o(function(){return!O&&_.next&&_.next(ve)})))},function(ve){p=!1,["DatabaseClosedError","AbortError"].includes(ve==null?void 0:ve.name)||O||$o(function(){O||_.error&&_.error(ve)})}))};return setTimeout(ee,0),te});return y.hasValue=function(){return p},y.getValue=function(){return f},y}var go=Nr;function Ko(a){var f=Er;try{Er=!0,An.storagemutated.fire(a),Ks(a,!0)}finally{Er=f}}S(go,s(s({},U),{delete:function(a){return new go(a,{addons:[]}).delete()},exists:function(a){return new go(a,{addons:[]}).open().then(function(f){return f.close(),!0}).catch("NoSuchDatabaseError",function(){return!1})},getDatabaseNames:function(a){try{return f=go.dependencies,p=f.indexedDB,f=f.IDBKeyRange,(ho(p)?Promise.resolve(p.databases()).then(function(y){return y.map(function(_){return _.name}).filter(function(_){return _!==Dr})}):vi(p,f).toCollection().primaryKeys()).then(a)}catch{return Et(new ke.MissingAPI)}var f,p},defineClass:function(){return function(a){v(this,a)}},ignoreTransaction:function(a){return Ye.trans?ir(Ye.transless||kn,a):a()},vip:Bo,async:function(a){return function(){try{var f=Us(a.apply(this,arguments));return f&&typeof f.then=="function"?f:Ve.resolve(f)}catch(p){return Et(p)}}},spawn:function(a,f,p){try{var y=Us(a.apply(p,f||[]));return y&&typeof y.then=="function"?y:Ve.resolve(y)}catch(_){return Et(_)}},currentTransaction:{get:function(){return Ye.trans||null}},waitFor:function(a,f){return a=Ve.resolve(typeof a=="function"?go.ignoreTransaction(a):a).timeout(f||6e4),Ye.trans?Ye.trans.waitFor(a):a},Promise:Ve,debug:{get:function(){return St},set:function(a){bn(a)}},derive:T,extend:v,props:S,override:P,Events:zr,on:An,liveQuery:Vo,extendObservabilitySet:Zi,getByKeyPath:V,setByKeyPath:B,delByKeyPath:function(a,f){typeof f=="string"?B(a,f,void 0):"length"in f&&[].map.call(f,function(p){B(a,p,void 0)})},shallowClone:ae,deepClone:xe,getObjectDiff:qs,cmp:ft,asap:Y,minKey:-1/0,addons:[],connections:{get:fo.toArray},errnames:_e,dependencies:rs,cache:Vr,semVer:"4.4.2",version:"4.4.2".split(".").map(function(a){return parseInt(a)}).reduce(function(a,f,p){return a+f/Math.pow(10,2*p)})})),go.maxKey=_r(go.dependencies.IDBKeyRange),typeof dispatchEvent<"u"&&typeof addEventListener<"u"&&(An(hi,function(a){Er||(a=new CustomEvent(Ki,{detail:a}),Er=!0,dispatchEvent(a),Er=!1)}),addEventListener(Ki,function(a){a=a.detail,Er||Ko(a)}));var Uo,Er=!1,os=function(){};return typeof BroadcastChannel<"u"&&((os=function(){(Uo=new BroadcastChannel(Ki)).onmessage=function(a){return a.data&&Ko(a.data)}})(),typeof Uo.unref=="function"&&Uo.unref(),An(hi,function(a){Er||Uo.postMessage(a)})),typeof addEventListener<"u"&&(addEventListener("pagehide",function(a){if(!Nr.disableBfCache&&a.persisted){St&&console.debug("Dexie: handling persisted pagehide"),Uo!=null&&Uo.close();for(var f=0,p=fo.toArray();f<p.length;f++)p[f].close({disableAutoOpen:!1})}}),addEventListener("pageshow",function(a){!Nr.disableBfCache&&a.persisted&&(St&&console.debug("Dexie: handling persisted pageshow"),os(),Ko({all:new Jt(-1/0,[[]])}))})),Ve.rejectionMapper=function(a,f){return!a||a instanceof Se||a instanceof TypeError||a instanceof SyntaxError||!a.name||!He[a.name]?a:(f=new He[a.name](f||a.message,a),"stack"in a&&j(f,"stack",{get:function(){return this.inner.stack}}),f)},bn(St),s(Nr,Object.freeze({__proto__:null,DEFAULT_MAX_CONNECTIONS:1e3,Dexie:Nr,Entity:En,PropModification:no,RangeSet:Jt,add:function(a){return new no({add:a})},cmp:ft,default:Nr,liveQuery:Vo,mergeRanges:wi,rangesOverlap:Gi,remove:function(a){return new no({remove:a})},replacePrefix:function(a,f){return new no({replacePrefix:[a,f]})}}),{default:Nr}),Nr})})(eu)),eu.exports}var Fy=zy();const wf=wu(Fy),np=Symbol.for("Dexie"),lu=globalThis[np]||(globalThis[np]=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:qk,mergeRanges:Wk,rangesOverlap:Yk,RangeSet:Xk,cmp:Qk,Entity:Gk,PropModification:Jk,replacePrefix:Zk,add:e2,remove:t2,DexieYProvider:n2}=lu;class By 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 bt=new By;async function Hy(){const[t,r,i]=await Promise.all([bt.flows.toArray(),bt.testSuites.toArray(),bt.environments.toArray()]),s=await bt.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 bt.transaction("rw",bt.flows,bt.testSuites,bt.environments,bt.kv,async()=>{await bt.flows.clear(),await bt.testSuites.clear(),await bt.environments.clear();for(const r of t.flows)await bt.flows.add({name:r.name,steps:r.steps,graph:r.graph});for(const r of t.testSuites)await bt.testSuites.add({name:r.name,cases:r.cases});for(const r of t.environments)await bt.environments.add({name:r.name,baseUrl:r.baseUrl,vars:r.vars??{}});t.authTokens&&await bt.kv.put({key:"authTokens",value:JSON.stringify(t.authTokens)})})}async function Vy(t){if(t.formatVersion!==1)return!1;const[r,i]=await Promise.all([bt.flows.count(),bt.testSuites.count()]);return r>0||i>0?!1:(await _m(t),!0)}function Ky(t,r,i){var d,m;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 v=i.includes(t.contains);if(s.push(`Contiene texto "${t.contains}": ${v?"✓":"✗"}`),!v)return{pass:!1,lines:s}}const c=(m=t.jsonPath)==null?void 0:m.trim();if(c){let v;try{v=JSON.parse(i)}catch{return s.push("Body no es JSON válido: ✗"),{pass:!1,lines:s}}const b=Rf(v,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 Wt(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=Wt(t[i]))!==""&&(r+=(r&&" ")+s);else for(let i in t)t[i]&&(r+=(r&&" ")+i);return r}var Uy={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 qy(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=qy(t+"",i),l,c=-1,d=s.length;if(arguments.length<2){for(;++c<d;)if((l=(t=s[c]).type)&&(l=Wy(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]=rp(i[l],t.name,r);else if(r==null)for(l in i)i[l]=rp(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 Wy(t,r){for(var i=0,s=t.length,l;i<s;++i)if((l=t[i]).name===r)return l.value}function rp(t,r,i){for(var s=0,l=t.length;s<l;++s)if(t[s].name===r){t[s]=Uy,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 op={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)),op.hasOwnProperty(r)?{space:op[r],local:t}:t}function Yy(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 Xy(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function Sm(t){var r=Nu(t);return(r.local?Xy:Yy)(r)}function Qy(){}function Df(t){return t==null?Qy:function(){return this.querySelector(t)}}function Gy(t){typeof t!="function"&&(t=Df(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,m=s[l]=new Array(d),v,b,k=0;k<d;++k)(v=c[k])&&(b=t.call(v,v.__data__,k,c))&&("__data__"in v&&(b.__data__=v.__data__),m[k]=b);return new er(s,this._parents)}function Jy(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function Zy(){return[]}function km(t){return t==null?Zy:function(){return this.querySelectorAll(t)}}function ev(t){return function(){return Jy(t.apply(this,arguments))}}function tv(t){typeof t=="function"?t=ev(t):t=km(t);for(var r=this._groups,i=r.length,s=[],l=[],c=0;c<i;++c)for(var d=r[c],m=d.length,v,b=0;b<m;++b)(v=d[b])&&(s.push(t.call(v,v.__data__,b,d)),l.push(v));return new er(s,l)}function Nm(t){return function(){return this.matches(t)}}function Em(t){return function(r){return r.matches(t)}}var nv=Array.prototype.find;function rv(t){return function(){return nv.call(this.children,t)}}function ov(){return this.firstElementChild}function iv(t){return this.select(t==null?ov:rv(typeof t=="function"?t:Em(t)))}var sv=Array.prototype.filter;function av(){return Array.from(this.children)}function lv(t){return function(){return sv.call(this.children,t)}}function uv(t){return this.selectAll(t==null?av:lv(typeof t=="function"?t:Em(t)))}function cv(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,m=s[l]=[],v,b=0;b<d;++b)(v=c[b])&&t.call(v,v.__data__,b,c)&&m.push(v);return new er(s,this._parents)}function Cm(t){return new Array(t.length)}function fv(){return new er(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 dv(t){return function(){return t}}function hv(t,r,i,s,l,c){for(var d=0,m,v=r.length,b=c.length;d<b;++d)(m=r[d])?(m.__data__=c[d],s[d]=m):i[d]=new uu(t,c[d]);for(;d<v;++d)(m=r[d])&&(l[d]=m)}function pv(t,r,i,s,l,c,d){var m,v,b=new Map,k=r.length,w=c.length,S=new Array(k),C;for(m=0;m<k;++m)(v=r[m])&&(S[m]=C=d.call(v,v.__data__,m,r)+"",b.has(C)?l[m]=v:b.set(C,v));for(m=0;m<w;++m)C=d.call(t,c[m],m,c)+"",(v=b.get(C))?(s[m]=v,v.__data__=c[m],b.delete(C)):i[m]=new uu(t,c[m]);for(m=0;m<k;++m)(v=r[m])&&b.get(S[m])===v&&(l[m]=v)}function mv(t){return t.__data__}function gv(t,r){if(!arguments.length)return Array.from(this,mv);var i=r?pv:hv,s=this._parents,l=this._groups;typeof t!="function"&&(t=dv(t));for(var c=l.length,d=new Array(c),m=new Array(c),v=new Array(c),b=0;b<c;++b){var k=s[b],w=l[b],S=w.length,C=yv(t.call(k,k&&k.__data__,b,s)),j=C.length,T=m[b]=new Array(j),$=d[b]=new Array(j),I=v[b]=new Array(S);i(k,w,T,$,I,C,r);for(var K=0,P=0,R,Y;K<j;++K)if(R=T[K]){for(K>=P&&(P=K+1);!(Y=$[P])&&++P<j;);R._next=Y||null}}return d=new er(d,s),d._enter=m,d._exit=v,d}function yv(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function vv(){return new er(this._exit||this._groups.map(Cm),this._parents)}function xv(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 wv(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),m=new Array(l),v=0;v<d;++v)for(var b=i[v],k=s[v],w=b.length,S=m[v]=new Array(w),C,j=0;j<w;++j)(C=b[j]||k[j])&&(S[j]=C);for(;v<l;++v)m[v]=i[v];return new er(m,this._parents)}function bv(){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 _v(t){t||(t=Sv);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],m=d.length,v=l[c]=new Array(m),b,k=0;k<m;++k)(b=d[k])&&(v[k]=b);v.sort(r)}return new er(l,this._parents).order()}function Sv(t,r){return t<r?-1:t>r?1:t>=r?0:NaN}function kv(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function Nv(){return Array.from(this)}function Ev(){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 Cv(){let t=0;for(const r of this)++t;return t}function jv(){return!this.node()}function Pv(t){for(var r=this._groups,i=0,s=r.length;i<s;++i)for(var l=r[i],c=0,d=l.length,m;c<d;++c)(m=l[c])&&t.call(m,m.__data__,c,l);return this}function Mv(t){return function(){this.removeAttribute(t)}}function Tv(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Iv(t,r){return function(){this.setAttribute(t,r)}}function $v(t,r){return function(){this.setAttributeNS(t.space,t.local,r)}}function Av(t,r){return function(){var i=r.apply(this,arguments);i==null?this.removeAttribute(t):this.setAttribute(t,i)}}function Ov(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 Rv(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?Tv:Mv:typeof r=="function"?i.local?Ov:Av:i.local?$v:Iv)(i,r))}function jm(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function Dv(t){return function(){this.style.removeProperty(t)}}function Lv(t,r,i){return function(){this.style.setProperty(t,r,i)}}function zv(t,r,i){return function(){var s=r.apply(this,arguments);s==null?this.style.removeProperty(t):this.style.setProperty(t,s,i)}}function Fv(t,r,i){return arguments.length>1?this.each((r==null?Dv:typeof r=="function"?zv:Lv)(t,r,i??"")):Ps(this.node(),t)}function Ps(t,r){return t.style.getPropertyValue(r)||jm(t).getComputedStyle(t,null).getPropertyValue(r)}function Bv(t){return function(){delete this[t]}}function Hv(t,r){return function(){this[t]=r}}function Vv(t,r){return function(){var i=r.apply(this,arguments);i==null?delete this[t]:this[t]=i}}function Kv(t,r){return arguments.length>1?this.each((r==null?Bv:typeof r=="function"?Vv:Hv)(t,r)):this.node()[t]}function Pm(t){return t.trim().split(/^|\s+/)}function Lf(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 Tm(t,r){for(var i=Lf(t),s=-1,l=r.length;++s<l;)i.add(r[s])}function Im(t,r){for(var i=Lf(t),s=-1,l=r.length;++s<l;)i.remove(r[s])}function Uv(t){return function(){Tm(this,t)}}function qv(t){return function(){Im(this,t)}}function Wv(t,r){return function(){(r.apply(this,arguments)?Tm:Im)(this,t)}}function Yv(t,r){var i=Pm(t+"");if(arguments.length<2){for(var s=Lf(this.node()),l=-1,c=i.length;++l<c;)if(!s.contains(i[l]))return!1;return!0}return this.each((typeof r=="function"?Wv:r?Uv:qv)(i,r))}function Xv(){this.textContent=""}function Qv(t){return function(){this.textContent=t}}function Gv(t){return function(){var r=t.apply(this,arguments);this.textContent=r??""}}function Jv(t){return arguments.length?this.each(t==null?Xv:(typeof t=="function"?Gv:Qv)(t)):this.node().textContent}function Zv(){this.innerHTML=""}function ex(t){return function(){this.innerHTML=t}}function tx(t){return function(){var r=t.apply(this,arguments);this.innerHTML=r??""}}function nx(t){return arguments.length?this.each(t==null?Zv:(typeof t=="function"?tx:ex)(t)):this.node().innerHTML}function rx(){this.nextSibling&&this.parentNode.appendChild(this)}function ox(){return this.each(rx)}function ix(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function sx(){return this.each(ix)}function ax(t){var r=typeof t=="function"?t:Sm(t);return this.select(function(){return this.appendChild(r.apply(this,arguments))})}function lx(){return null}function ux(t,r){var i=typeof t=="function"?t:Sm(t),s=r==null?lx:typeof r=="function"?r:Df(r);return this.select(function(){return this.insertBefore(i.apply(this,arguments),s.apply(this,arguments)||null)})}function cx(){var t=this.parentNode;t&&t.removeChild(this)}function fx(){return this.each(cx)}function dx(){var t=this.cloneNode(!1),r=this.parentNode;return r?r.insertBefore(t,this.nextSibling):t}function hx(){var t=this.cloneNode(!0),r=this.parentNode;return r?r.insertBefore(t,this.nextSibling):t}function px(t){return this.select(t?hx:dx)}function mx(t){return arguments.length?this.property("__data__",t):this.node().__data__}function gx(t){return function(r){t.call(this,r,this.__data__)}}function yx(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 vx(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 xx(t,r,i){return function(){var s=this.__on,l,c=gx(r);if(s){for(var d=0,m=s.length;d<m;++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 wx(t,r,i){var s=yx(t+""),l,c=s.length,d;if(arguments.length<2){var m=this.node().__on;if(m){for(var v=0,b=m.length,k;v<b;++v)for(l=0,k=m[v];l<c;++l)if((d=s[l]).type===k.type&&d.name===k.name)return k.value}return}for(m=r?xx:vx,l=0;l<c;++l)this.each(m(s[l],r,i));return this}function $m(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 bx(t,r){return function(){return $m(this,t,r)}}function _x(t,r){return function(){return $m(this,t,r.apply(this,arguments))}}function Sx(t,r){return this.each((typeof r=="function"?_x:bx)(t,r))}function*kx(){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 er(t,r){this._groups=t,this._parents=r}function Aa(){return new er([[document.documentElement]],Am)}function Nx(){return this}er.prototype=Aa.prototype={constructor:er,select:Gy,selectAll:tv,selectChild:iv,selectChildren:uv,filter:cv,data:gv,enter:fv,exit:vv,join:xv,merge:wv,selection:Nx,order:bv,sort:_v,call:kv,nodes:Nv,node:Ev,size:Cv,empty:jv,each:Pv,attr:Rv,style:Fv,property:Kv,classed:Yv,text:Jv,html:nx,raise:ox,lower:sx,append:ax,insert:ux,remove:fx,clone:px,datum:mx,on:wx,dispatch:Sx,[Symbol.iterator]:kx};function Zn(t){return typeof t=="string"?new er([[document.querySelector(t)]],[document.documentElement]):new er([[t]],Am)}function Ex(t){let r;for(;r=t.sourceEvent;)t=r;return t}function Ir(t,r){if(t=Ex(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 Cx={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=Zn(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=Zn(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 Kl=t=>()=>t;function _f(t,{sourceEvent:r,subject:i,target:s,identifier:l,active:c,x:d,y:m,dx:v,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:m,enumerable:!0,configurable:!0},dx:{value:v,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 jx(t){return!t.ctrlKey&&!t.button}function Px(){return this.parentNode}function Mx(t,r){return r??{x:t.x,y:t.y}}function Tx(){return navigator.maxTouchPoints||"ontouchstart"in this}function Dm(){var t=jx,r=Px,i=Mx,s=Tx,l={},c=ku("start","drag","end"),d=0,m,v,b,k,w=0;function S(R){R.on("mousedown.drag",C).filter(s).on("touchstart.drag",$).on("touchmove.drag",I,Cx).on("touchend.drag touchcancel.drag",K).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function C(R,Y){if(!(k||!t.call(this,R,Y))){var V=P(this,r.call(this,R,Y),R,Y,"mouse");V&&(Zn(R.view).on("mousemove.drag",j,ka).on("mouseup.drag",T,ka),Om(R.view),nf(R),b=!1,m=R.clientX,v=R.clientY,V("start",R))}}function j(R){if(Cs(R),!b){var Y=R.clientX-m,V=R.clientY-v;b=Y*Y+V*V>w}l.mouse("drag",R)}function T(R){Zn(R.view).on("mousemove.drag mouseup.drag",null),Rm(R.view,b),Cs(R),l.mouse("end",R)}function $(R,Y){if(t.call(this,R,Y)){var V=R.changedTouches,B=r.call(this,R,Y),ae=V.length,de,we;for(de=0;de<ae;++de)(we=P(this,B,R,Y,V[de].identifier,V[de]))&&(nf(R),we("start",R,V[de]))}}function I(R){var Y=R.changedTouches,V=Y.length,B,ae;for(B=0;B<V;++B)(ae=l[Y[B].identifier])&&(Cs(R),ae("drag",R,Y[B]))}function K(R){var Y=R.changedTouches,V=Y.length,B,ae;for(k&&clearTimeout(k),k=setTimeout(function(){k=null},500),B=0;B<V;++B)(ae=l[Y[B].identifier])&&(nf(R),ae("end",R,Y[B]))}function P(R,Y,V,B,ae,de){var we=c.copy(),H=Ir(de||V,Y),fe,xe,D;if((D=i.call(R,new _f("beforestart",{sourceEvent:V,target:S,identifier:ae,active:d,x:H[0],y:H[1],dx:0,dy:0,dispatch:we}),B))!=null)return fe=D.x-H[0]||0,xe=D.y-H[1]||0,function ue(G,ie,z){var q=H,F;switch(G){case"start":l[ae]=ue,F=d++;break;case"end":delete l[ae],--d;case"drag":H=Ir(z||ie,Y),F=d;break}we.call(G,R,new _f(G,{sourceEvent:ie,subject:D,target:S,identifier:ae,active:F,x:H[0]+fe,y:H[1]+xe,dx:H[0]-q[0],dy:H[1]-q[1],dispatch:we}),B)}}return S.filter=function(R){return arguments.length?(t=typeof R=="function"?R:Kl(!!R),S):t},S.container=function(R){return arguments.length?(r=typeof R=="function"?R:Kl(R),S):r},S.subject=function(R){return arguments.length?(i=typeof R=="function"?R:Kl(R),S):i},S.touchable=function(R){return arguments.length?(s=typeof R=="function"?R:Kl(!!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 Lm(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*",Xr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Ix=/^#([0-9a-f]{3,8})$/,$x=new RegExp(`^rgb\\(${js},${js},${js}\\)$`),Ax=new RegExp(`^rgb\\(${Xr},${Xr},${Xr}\\)$`),Ox=new RegExp(`^rgba\\(${js},${js},${js},${Ea}\\)$`),Rx=new RegExp(`^rgba\\(${Xr},${Xr},${Xr},${Ea}\\)$`),Dx=new RegExp(`^hsl\\(${Ea},${Xr},${Xr}\\)$`),Lx=new RegExp(`^hsla\\(${Ea},${Xr},${Xr},${Ea}\\)$`),ip={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:sp,formatHex:sp,formatHex8:zx,formatHsl:Fx,formatRgb:ap,toString:ap});function sp(){return this.rgb().formatHex()}function zx(){return this.rgb().formatHex8()}function Fx(){return zm(this).formatHsl()}function ap(){return this.rgb().formatRgb()}function Di(t){var r,i;return t=(t+"").trim().toLowerCase(),(r=Ix.exec(t))?(i=r[1].length,r=parseInt(r[1],16),i===6?lp(r):i===3?new Bn(r>>8&15|r>>4&240,r>>4&15|r&240,(r&15)<<4|r&15,1):i===8?Ul(r>>24&255,r>>16&255,r>>8&255,(r&255)/255):i===4?Ul(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=$x.exec(t))?new Bn(r[1],r[2],r[3],1):(r=Ax.exec(t))?new Bn(r[1]*255/100,r[2]*255/100,r[3]*255/100,1):(r=Ox.exec(t))?Ul(r[1],r[2],r[3],r[4]):(r=Rx.exec(t))?Ul(r[1]*255/100,r[2]*255/100,r[3]*255/100,r[4]):(r=Dx.exec(t))?fp(r[1],r[2]/100,r[3]/100,1):(r=Lx.exec(t))?fp(r[1],r[2]/100,r[3]/100,r[4]):ip.hasOwnProperty(t)?lp(ip[t]):t==="transparent"?new Bn(NaN,NaN,NaN,0):null}function lp(t){return new Bn(t>>16&255,t>>8&255,t&255,1)}function Ul(t,r,i,s){return s<=0&&(t=r=i=NaN),new Bn(t,r,i,s)}function Bx(t){return t instanceof Oa||(t=Di(t)),t?(t=t.rgb(),new Bn(t.r,t.g,t.b,t.opacity)):new Bn}function Sf(t,r,i,s){return arguments.length===1?Bx(t):new Bn(t,r,i,s??1)}function Bn(t,r,i,s){this.r=+t,this.g=+r,this.b=+i,this.opacity=+s}zf(Bn,Sf,Lm(Oa,{brighter(t){return t=t==null?cu:Math.pow(cu,t),new Bn(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?Na:Math.pow(Na,t),new Bn(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Bn(Oi(this.r),Oi(this.g),Oi(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:up,formatHex:up,formatHex8:Hx,formatRgb:cp,toString:cp}));function up(){return`#${Ai(this.r)}${Ai(this.g)}${Ai(this.b)}`}function Hx(){return`#${Ai(this.r)}${Ai(this.g)}${Ai(this.b)}${Ai((isNaN(this.opacity)?1:this.opacity)*255)}`}function cp(){const t=fu(this.opacity);return`${t===1?"rgb(":"rgba("}${Oi(this.r)}, ${Oi(this.g)}, ${Oi(this.b)}${t===1?")":`, ${t})`}`}function fu(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Oi(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Ai(t){return t=Oi(t),(t<16?"0":"")+t.toString(16)}function fp(t,r,i,s){return s<=0?t=r=i=NaN:i<=0||i>=1?t=r=NaN:r<=0&&(t=NaN),new $r(t,r,i,s)}function zm(t){if(t instanceof $r)return new $r(t.h,t.s,t.l,t.opacity);if(t instanceof Oa||(t=Di(t)),!t)return new $r;if(t instanceof $r)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,m=c-l,v=(c+l)/2;return m?(r===c?d=(i-s)/m+(i<s)*6:i===c?d=(s-r)/m+2:d=(r-i)/m+4,m/=v<.5?c+l:2-c-l,d*=60):m=v>0&&v<1?0:d,new $r(d,m,v,t.opacity)}function Vx(t,r,i,s){return arguments.length===1?zm(t):new $r(t,r,i,s??1)}function $r(t,r,i,s){this.h=+t,this.s=+r,this.l=+i,this.opacity=+s}zf($r,Vx,Lm(Oa,{brighter(t){return t=t==null?cu:Math.pow(cu,t),new $r(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?Na:Math.pow(Na,t),new $r(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 Bn(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 $r(dp(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("}${dp(this.h)}, ${ql(this.s)*100}%, ${ql(this.l)*100}%${t===1?")":`, ${t})`}`}}));function dp(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 Kx(t,r){return function(i){return t+i*r}}function Ux(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 qx(t){return(t=+t)==1?Fm:function(r,i){return i-r?Ux(r,i,t):Ff(isNaN(r)?i:r)}}function Fm(t,r){var i=r-t;return i?Kx(t,i):Ff(isNaN(t)?r:t)}const du=(function t(r){var i=qx(r);function s(l,c){var d=i((l=Sf(l)).r,(c=Sf(c)).r),m=i(l.g,c.g),v=i(l.b,c.b),b=Fm(l.opacity,c.opacity);return function(k){return l.r=d(k),l.g=m(k),l.b=v(k),l.opacity=b(k),l+""}}return s.gamma=t,s})(1);function Wx(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 Yx(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function Xx(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(m){for(d=0;d<s;++d)c[d]=l[d](m);return c}}function Qx(t,r){var i=new Date;return t=+t,r=+r,function(s){return i.setTime(t*(1-s)+r*s),i}}function Yr(t,r){return t=+t,r=+r,function(i){return t*(1-i)+r*i}}function Gx(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 Jx(t){return function(){return t}}function Zx(t){return function(r){return t(r)+""}}function Bm(t,r){var i=kf.lastIndex=of.lastIndex=0,s,l,c,d=-1,m=[],v=[];for(t=t+"",r=r+"";(s=kf.exec(t))&&(l=of.exec(r));)(c=l.index)>i&&(c=r.slice(i,c),m[d]?m[d]+=c:m[++d]=c),(s=s[0])===(l=l[0])?m[d]?m[d]+=l:m[++d]=l:(m[++d]=null,v.push({i:d,x:Yr(s,l)})),i=of.lastIndex;return i<r.length&&(c=r.slice(i),m[d]?m[d]+=c:m[++d]=c),m.length<2?v[0]?Zx(v[0].x):Jx(r):(r=v.length,function(b){for(var k=0,w;k<r;++k)m[(w=v[k]).i]=w.x(b);return m.join("")})}function _a(t,r){var i=typeof r,s;return r==null||i==="boolean"?Ff(r):(i==="number"?Yr:i==="string"?(s=Di(r))?(r=s,du):Bm:r instanceof Di?du:r instanceof Date?Qx:Yx(r)?Wx:Array.isArray(r)?Xx:typeof r.valueOf!="function"&&typeof r.toString!="function"||isNaN(r)?Gx:Yr)(t,r)}var hp=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,m,v;return(d=Math.sqrt(t*t+r*r))&&(t/=d,r/=d),(v=t*i+r*s)&&(i-=t*v,s-=r*v),(m=Math.sqrt(i*i+s*s))&&(i/=m,s/=m,v/=m),t*s<r*i&&(t=-t,r=-r,v=-v,d=-d),{translateX:l,translateY:c,rotate:Math.atan2(r,t)*hp,skewX:Math.atan(v)*hp,scaleX:d,scaleY:m}}var Wl;function ew(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 tw(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 T=C.push("translate(",null,r,null,i);j.push({i:T-4,x:Yr(b,w)},{i:T-2,x:Yr(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:Yr(b,k)})):k&&w.push(l(w)+"rotate("+k+s)}function m(b,k,w,S){b!==k?S.push({i:w.push(l(w)+"skewX(",null,s)-2,x:Yr(b,k)}):k&&w.push(l(w)+"skewX("+k+s)}function v(b,k,w,S,C,j){if(b!==w||k!==S){var T=C.push(l(C)+"scale(",null,",",null,")");j.push({i:T-4,x:Yr(b,w)},{i:T-2,x:Yr(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),m(b.skewX,k.skewX,w,S),v(b.scaleX,b.scaleY,k.scaleX,k.scaleY,w,S),b=k=null,function(C){for(var j=-1,T=S.length,$;++j<T;)w[($=S[j]).i]=$.x(C);return w.join("")}}}var nw=Vm(ew,"px, ","px)","deg)"),rw=Vm(tw,", ",")",")"),ow=1e-12;function pp(t){return((t=Math.exp(t))+1/t)/2}function iw(t){return((t=Math.exp(t))-1/t)/2}function sw(t){return((t=Math.exp(2*t))-1)/(t+1)}const nu=(function t(r,i,s){function l(c,d){var m=c[0],v=c[1],b=c[2],k=d[0],w=d[1],S=d[2],C=k-m,j=w-v,T=C*C+j*j,$,I;if(T<ow)I=Math.log(S/b)/r,$=function(B){return[m+B*C,v+B*j,b*Math.exp(r*B*I)]};else{var K=Math.sqrt(T),P=(S*S-b*b+s*T)/(2*b*i*K),R=(S*S-b*b-s*T)/(2*S*i*K),Y=Math.log(Math.sqrt(P*P+1)-P),V=Math.log(Math.sqrt(R*R+1)-R);I=(V-Y)/r,$=function(B){var ae=B*I,de=pp(Y),we=b/(i*K)*(de*sw(r*ae+Y)-iw(Y));return[m+we*C,v+we*j,b*de/pp(r*ae+Y)]}}return $.duration=I*1e3*r/Math.SQRT2,$}return l.rho=function(c){var d=Math.max(.001,+c),m=d*d,v=m*m;return t(d,m,v)},l})(Math.SQRT2,2,4);var Ms=0,wa=0,va=0,Km=1e3,hu,ba,pu=0,Li=0,Eu=0,Ca=typeof performance=="object"&&performance.now?performance:Date,Um=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Bf(){return Li||(Um(aw),Li=Ca.now()+Eu)}function aw(){Li=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:hu=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 lw(){Bf(),++Ms;for(var t=hu,r;t;)(r=Li-t._time)>=0&&t._call.call(void 0,r),t=t._next;--Ms}function mp(){Li=(pu=Ca.now())+Eu,Ms=wa=0;try{lw()}finally{Ms=0,cw(),Li=0}}function uw(){var t=Ca.now(),r=t-pu;r>Km&&(Eu-=r,pu=t)}function cw(){for(var t,r=hu,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:hu=i);ba=t,Ef(s)}function Ef(t){if(!Ms){wa&&(wa=clearTimeout(wa));var r=t-Li;r>24?(t<1/0&&(wa=setTimeout(mp,t-Ca.now()-Eu)),va&&(va=clearInterval(va))):(va||(pu=Ca.now(),va=setInterval(uw,Km)),Ms=1,Um(mp))}}function gp(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 fw=ku("start","end","cancel","interrupt"),dw=[],Wm=0,yp=1,Cf=2,ru=3,vp=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;hw(t,i,{name:r,index:s,group:l,on:fw,tween:dw,time:c.time,delay:c.delay,duration:c.duration,ease:c.ease,timer:null,state:Wm})}function Hf(t,r){var i=Rr(t,r);if(i.state>Wm)throw new Error("too late; already scheduled");return i}function Jr(t,r){var i=Rr(t,r);if(i.state>ru)throw new Error("too late; already running");return i}function Rr(t,r){var i=t.__transition;if(!i||!(i=i[r]))throw new Error("transition not found");return i}function hw(t,r,i){var s=t.__transition,l;s[r]=i,i.timer=qm(c,0,i.time);function c(b){i.state=yp,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!==yp)return v();for(k in s)if(C=s[k],C.name===i.name){if(C.state===ru)return gp(d);C.state===vp?(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(gp(function(){i.state===ru&&(i.state=vp,i.timer.restart(m,i.delay,i.time),m(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 m(b){for(var k=b<i.duration?i.ease.call(null,b/i.duration):(i.timer.restart(v),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),v())}function v(){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 pw(t){return this.each(function(){iu(this,t)})}function mw(t,r){var i,s;return function(){var l=Jr(this,t),c=l.tween;if(c!==i){s=i=c;for(var d=0,m=s.length;d<m;++d)if(s[d].name===r){s=s.slice(),s.splice(d,1);break}}l.tween=s}}function gw(t,r,i){var s,l;if(typeof i!="function")throw new Error;return function(){var c=Jr(this,t),d=c.tween;if(d!==s){l=(s=d).slice();for(var m={name:r,value:i},v=0,b=l.length;v<b;++v)if(l[v].name===r){l[v]=m;break}v===b&&l.push(m)}c.tween=l}}function yw(t,r){var i=this._id;if(t+="",arguments.length<2){for(var s=Rr(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?mw:gw)(i,t,r))}function Vf(t,r,i){var s=t._id;return t.each(function(){var l=Jr(this,s);(l.value||(l.value={}))[r]=i.apply(this,arguments)}),function(l){return Rr(l,s).value[r]}}function Ym(t,r){var i;return(typeof r=="number"?Yr:r instanceof Di?du:(i=Di(r))?(r=i,du):Bm)(t,r)}function vw(t){return function(){this.removeAttribute(t)}}function xw(t){return function(){this.removeAttributeNS(t.space,t.local)}}function ww(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 bw(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 _w(t,r,i){var s,l,c;return function(){var d,m=i(this),v;return m==null?void this.removeAttribute(t):(d=this.getAttribute(t),v=m+"",d===v?null:d===s&&v===l?c:(l=v,c=r(s=d,m)))}}function Sw(t,r,i){var s,l,c;return function(){var d,m=i(this),v;return m==null?void this.removeAttributeNS(t.space,t.local):(d=this.getAttributeNS(t.space,t.local),v=m+"",d===v?null:d===s&&v===l?c:(l=v,c=r(s=d,m)))}}function kw(t,r){var i=Nu(t),s=i==="transform"?rw:Ym;return this.attrTween(t,typeof r=="function"?(i.local?Sw:_w)(i,s,Vf(this,"attr."+t,r)):r==null?(i.local?xw:vw)(i):(i.local?bw:ww)(i,s,r))}function Nw(t,r){return function(i){this.setAttribute(t,r.call(this,i))}}function Ew(t,r){return function(i){this.setAttributeNS(t.space,t.local,r.call(this,i))}}function Cw(t,r){var i,s;function l(){var c=r.apply(this,arguments);return c!==s&&(i=(s=c)&&Ew(t,c)),i}return l._value=r,l}function jw(t,r){var i,s;function l(){var c=r.apply(this,arguments);return c!==s&&(i=(s=c)&&Nw(t,c)),i}return l._value=r,l}function Pw(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?Cw:jw)(s,r))}function Mw(t,r){return function(){Hf(this,t).delay=+r.apply(this,arguments)}}function Tw(t,r){return r=+r,function(){Hf(this,t).delay=r}}function Iw(t){var r=this._id;return arguments.length?this.each((typeof t=="function"?Mw:Tw)(r,t)):Rr(this.node(),r).delay}function $w(t,r){return function(){Jr(this,t).duration=+r.apply(this,arguments)}}function Aw(t,r){return r=+r,function(){Jr(this,t).duration=r}}function Ow(t){var r=this._id;return arguments.length?this.each((typeof t=="function"?$w:Aw)(r,t)):Rr(this.node(),r).duration}function Rw(t,r){if(typeof r!="function")throw new Error;return function(){Jr(this,t).ease=r}}function Dw(t){var r=this._id;return arguments.length?this.each(Rw(r,t)):Rr(this.node(),r).ease}function Lw(t,r){return function(){var i=r.apply(this,arguments);if(typeof i!="function")throw new Error;Jr(this,t).ease=i}}function zw(t){if(typeof t!="function")throw new Error;return this.each(Lw(this._id,t))}function Fw(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,m=s[l]=[],v,b=0;b<d;++b)(v=c[b])&&t.call(v,v.__data__,b,c)&&m.push(v);return new Mo(s,this._parents,this._name,this._id)}function Bw(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),m=0;m<c;++m)for(var v=r[m],b=i[m],k=v.length,w=d[m]=new Array(k),S,C=0;C<k;++C)(S=v[C]||b[C])&&(w[C]=S);for(;m<s;++m)d[m]=r[m];return new Mo(d,this._parents,this._name,this._id)}function Hw(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 Vw(t,r,i){var s,l,c=Hw(r)?Hf:Jr;return function(){var d=c(this,t),m=d.on;m!==s&&(l=(s=m).copy()).on(r,i),d.on=l}}function Kw(t,r){var i=this._id;return arguments.length<2?Rr(this.node(),i).on.on(t):this.each(Vw(i,t,r))}function Uw(t){return function(){var r=this.parentNode;for(var i in this.__transition)if(+i!==t)return;r&&r.removeChild(this)}}function qw(){return this.on("end.remove",Uw(this._id))}function Ww(t){var r=this._name,i=this._id;typeof t!="function"&&(t=Df(t));for(var s=this._groups,l=s.length,c=new Array(l),d=0;d<l;++d)for(var m=s[d],v=m.length,b=c[d]=new Array(v),k,w,S=0;S<v;++S)(k=m[S])&&(w=t.call(k,k.__data__,S,m))&&("__data__"in k&&(w.__data__=k.__data__),b[S]=w,Cu(b[S],r,i,S,b,Rr(k,i)));return new Mo(c,this._parents,r,i)}function Yw(t){var r=this._name,i=this._id;typeof t!="function"&&(t=km(t));for(var s=this._groups,l=s.length,c=[],d=[],m=0;m<l;++m)for(var v=s[m],b=v.length,k,w=0;w<b;++w)if(k=v[w]){for(var S=t.call(k,k.__data__,w,v),C,j=Rr(k,i),T=0,$=S.length;T<$;++T)(C=S[T])&&Cu(C,r,i,T,S,j);c.push(S),d.push(k)}return new Mo(c,d,r,i)}var Xw=Aa.prototype.constructor;function Qw(){return new Xw(this._groups,this._parents)}function Gw(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 Jw(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 Zw(t,r,i){var s,l,c;return function(){var d=Ps(this,t),m=i(this),v=m+"";return m==null&&(v=m=(this.style.removeProperty(t),Ps(this,t))),d===v?null:d===s&&v===l?c:(l=v,c=r(s=d,m))}}function e1(t,r){var i,s,l,c="style."+r,d="end."+c,m;return function(){var v=Jr(this,t),b=v.on,k=v.value[c]==null?m||(m=Xm(r)):void 0;(b!==i||l!==k)&&(s=(i=b).copy()).on(d,l=k),v.on=s}}function t1(t,r,i){var s=(t+="")=="transform"?nw:Ym;return r==null?this.styleTween(t,Gw(t,s)).on("end.style."+t,Xm(t)):typeof r=="function"?this.styleTween(t,Zw(t,s,Vf(this,"style."+t,r))).each(e1(this._id,t)):this.styleTween(t,Jw(t,s,r),i).on("end.style."+t,null)}function n1(t,r,i){return function(s){this.style.setProperty(t,r.call(this,s),i)}}function r1(t,r,i){var s,l;function c(){var d=r.apply(this,arguments);return d!==l&&(s=(l=d)&&n1(t,d,i)),s}return c._value=r,c}function o1(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,r1(t,r,i??""))}function i1(t){return function(){this.textContent=t}}function s1(t){return function(){var r=t(this);this.textContent=r??""}}function a1(t){return this.tween("text",typeof t=="function"?s1(Vf(this,"text",t)):i1(t==null?"":t+""))}function l1(t){return function(r){this.textContent=t.call(this,r)}}function u1(t){var r,i;function s(){var l=t.apply(this,arguments);return l!==i&&(r=(i=l)&&l1(l)),r}return s._value=t,s}function c1(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,u1(t))}function f1(){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],m=d.length,v,b=0;b<m;++b)if(v=d[b]){var k=Rr(v,r);Cu(v,t,i,b,d,{time:k.time+k.delay+k.duration,delay:0,duration:k.duration,ease:k.ease})}return new Mo(s,this._parents,t,i)}function d1(){var t,r,i=this,s=i._id,l=i.size();return new Promise(function(c,d){var m={value:d},v={value:function(){--l===0&&c()}};i.each(function(){var b=Jr(this,s),k=b.on;k!==t&&(r=(t=k).copy(),r._.cancel.push(m),r._.interrupt.push(m),r._.end.push(v)),b.on=r}),l===0&&c()})}var h1=0;function Mo(t,r,i,s){this._groups=t,this._parents=r,this._name=i,this._id=s}function Qm(){return++h1}var Co=Aa.prototype;Mo.prototype={constructor:Mo,select:Ww,selectAll:Yw,selectChild:Co.selectChild,selectChildren:Co.selectChildren,filter:Fw,merge:Bw,selection:Qw,transition:f1,call:Co.call,nodes:Co.nodes,node:Co.node,size:Co.size,empty:Co.empty,each:Co.each,on:Kw,attr:kw,attrTween:Pw,style:t1,styleTween:o1,text:a1,textTween:c1,remove:qw,tween:yw,delay:Iw,duration:Ow,ease:Dw,easeVarying:zw,end:d1,[Symbol.iterator]:Co[Symbol.iterator]};function p1(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var m1={time:null,delay:0,duration:250,ease:p1};function g1(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 y1(t){var r,i;t instanceof Mo?(r=t._id,t=t._name):(r=Qm(),(i=m1).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],m=d.length,v,b=0;b<m;++b)(v=d[b])&&Cu(v,t,r,b,d,i||g1(v,r));return new Mo(s,this._parents,t,r)}Aa.prototype.interrupt=pw;Aa.prototype.transition=y1;const Yl=t=>()=>t;function v1(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 jo(t,r,i){this.k=t,this.x=r,this.y=i}jo.prototype={constructor:jo,scale:function(t){return t===1?this:new jo(this.k*t,this.x,this.y)},translate:function(t,r){return t===0&r===0?this:new jo(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 jo(1,0,0);Gm.prototype=jo.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 x1(t){return(!t.ctrlKey||t.type==="wheel")&&!t.button}function w1(){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 xp(){return this.__zoom||ju}function b1(t){return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function _1(){return navigator.maxTouchPoints||"ontouchstart"in this}function S1(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=x1,r=w1,i=S1,s=b1,l=_1,c=[0,1/0],d=[[-1/0,-1/0],[1/0,1/0]],m=250,v=nu,b=ku("start","zoom","end"),k,w,S,C=500,j=150,T=0,$=10;function I(D){D.property("__zoom",xp).on("wheel.zoom",ae,{passive:!1}).on("mousedown.zoom",de).on("dblclick.zoom",we).filter(l).on("touchstart.zoom",H).on("touchmove.zoom",fe).on("touchend.zoom touchcancel.zoom",xe).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}I.transform=function(D,ue,G,ie){var z=D.selection?D.selection():D;z.property("__zoom",xp),D!==z?Y(D,ue,G,ie):z.interrupt().each(function(){V(this,arguments).event(ie).start().zoom(null,typeof ue=="function"?ue.apply(this,arguments):ue).end()})},I.scaleBy=function(D,ue,G,ie){I.scaleTo(D,function(){var z=this.__zoom.k,q=typeof ue=="function"?ue.apply(this,arguments):ue;return z*q},G,ie)},I.scaleTo=function(D,ue,G,ie){I.transform(D,function(){var z=r.apply(this,arguments),q=this.__zoom,F=G==null?R(z):typeof G=="function"?G.apply(this,arguments):G,A=q.invert(F),U=typeof ue=="function"?ue.apply(this,arguments):ue;return i(P(K(q,U),F,A),z,d)},G,ie)},I.translateBy=function(D,ue,G,ie){I.transform(D,function(){return i(this.__zoom.translate(typeof ue=="function"?ue.apply(this,arguments):ue,typeof G=="function"?G.apply(this,arguments):G),r.apply(this,arguments),d)},null,ie)},I.translateTo=function(D,ue,G,ie,z){I.transform(D,function(){var q=r.apply(this,arguments),F=this.__zoom,A=ie==null?R(q):typeof ie=="function"?ie.apply(this,arguments):ie;return i(ju.translate(A[0],A[1]).scale(F.k).translate(typeof ue=="function"?-ue.apply(this,arguments):-ue,typeof G=="function"?-G.apply(this,arguments):-G),q,d)},ie,z)};function K(D,ue){return ue=Math.max(c[0],Math.min(c[1],ue)),ue===D.k?D:new jo(ue,D.x,D.y)}function P(D,ue,G){var ie=ue[0]-G[0]*D.k,z=ue[1]-G[1]*D.k;return ie===D.x&&z===D.y?D:new jo(D.k,ie,z)}function R(D){return[(+D[0][0]+ +D[1][0])/2,(+D[0][1]+ +D[1][1])/2]}function Y(D,ue,G,ie){D.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 z=this,q=arguments,F=V(z,q).event(ie),A=r.apply(z,q),U=G==null?R(A):typeof G=="function"?G.apply(z,q):G,be=Math.max(A[1][0]-A[0][0],A[1][1]-A[0][1]),Se=z.__zoom,Me=typeof ue=="function"?ue.apply(z,q):ue,$e=v(Se.invert(U).concat(be/Se.k),Me.invert(U).concat(be/Me.k));return function(Ae){if(Ae===1)Ae=Me;else{var _e=$e(Ae),Be=be/_e[2];Ae=new jo(Be,U[0]-_e[0]*Be,U[1]-_e[1]*Be)}F.zoom(null,Ae)}})}function V(D,ue,G){return!G&&D.__zooming||new B(D,ue)}function B(D,ue){this.that=D,this.args=ue,this.active=0,this.sourceEvent=null,this.extent=r.apply(D,ue),this.taps=0}B.prototype={event:function(D){return D&&(this.sourceEvent=D),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(D,ue){return this.mouse&&D!=="mouse"&&(this.mouse[1]=ue.invert(this.mouse[0])),this.touch0&&D!=="touch"&&(this.touch0[1]=ue.invert(this.touch0[0])),this.touch1&&D!=="touch"&&(this.touch1[1]=ue.invert(this.touch1[0])),this.that.__zoom=ue,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(D){var ue=Zn(this.that).datum();b.call(D,this.that,new v1(D,{sourceEvent:this.sourceEvent,target:I,transform:this.that.__zoom,dispatch:b}),ue)}};function ae(D,...ue){if(!t.apply(this,arguments))return;var G=V(this,ue).event(D),ie=this.__zoom,z=Math.max(c[0],Math.min(c[1],ie.k*Math.pow(2,s.apply(this,arguments)))),q=Ir(D);if(G.wheel)(G.mouse[0][0]!==q[0]||G.mouse[0][1]!==q[1])&&(G.mouse[1]=ie.invert(G.mouse[0]=q)),clearTimeout(G.wheel);else{if(ie.k===z)return;G.mouse=[q,ie.invert(q)],iu(this),G.start()}xa(D),G.wheel=setTimeout(F,j),G.zoom("mouse",i(P(K(ie,z),G.mouse[0],G.mouse[1]),G.extent,d));function F(){G.wheel=null,G.end()}}function de(D,...ue){if(S||!t.apply(this,arguments))return;var G=D.currentTarget,ie=V(this,ue,!0).event(D),z=Zn(D.view).on("mousemove.zoom",U,!0).on("mouseup.zoom",be,!0),q=Ir(D,G),F=D.clientX,A=D.clientY;Om(D.view),sf(D),ie.mouse=[q,this.__zoom.invert(q)],iu(this),ie.start();function U(Se){if(xa(Se),!ie.moved){var Me=Se.clientX-F,$e=Se.clientY-A;ie.moved=Me*Me+$e*$e>T}ie.event(Se).zoom("mouse",i(P(ie.that.__zoom,ie.mouse[0]=Ir(Se,G),ie.mouse[1]),ie.extent,d))}function be(Se){z.on("mousemove.zoom mouseup.zoom",null),Rm(Se.view,ie.moved),xa(Se),ie.event(Se).end()}}function we(D,...ue){if(t.apply(this,arguments)){var G=this.__zoom,ie=Ir(D.changedTouches?D.changedTouches[0]:D,this),z=G.invert(ie),q=G.k*(D.shiftKey?.5:2),F=i(P(K(G,q),ie,z),r.apply(this,ue),d);xa(D),m>0?Zn(this).transition().duration(m).call(Y,F,ie,D):Zn(this).call(I.transform,F,ie,D)}}function H(D,...ue){if(t.apply(this,arguments)){var G=D.touches,ie=G.length,z=V(this,ue,D.changedTouches.length===ie).event(D),q,F,A,U;for(sf(D),F=0;F<ie;++F)A=G[F],U=Ir(A,this),U=[U,this.__zoom.invert(U),A.identifier],z.touch0?!z.touch1&&z.touch0[2]!==U[2]&&(z.touch1=U,z.taps=0):(z.touch0=U,q=!0,z.taps=1+!!k);k&&(k=clearTimeout(k)),q&&(z.taps<2&&(w=U[0],k=setTimeout(function(){k=null},C)),iu(this),z.start())}}function fe(D,...ue){if(this.__zooming){var G=V(this,ue).event(D),ie=D.changedTouches,z=ie.length,q,F,A,U;for(xa(D),q=0;q<z;++q)F=ie[q],A=Ir(F,this),G.touch0&&G.touch0[2]===F.identifier?G.touch0[0]=A:G.touch1&&G.touch1[2]===F.identifier&&(G.touch1[0]=A);if(F=G.that.__zoom,G.touch1){var be=G.touch0[0],Se=G.touch0[1],Me=G.touch1[0],$e=G.touch1[1],Ae=(Ae=Me[0]-be[0])*Ae+(Ae=Me[1]-be[1])*Ae,_e=(_e=$e[0]-Se[0])*_e+(_e=$e[1]-Se[1])*_e;F=K(F,Math.sqrt(Ae/_e)),A=[(be[0]+Me[0])/2,(be[1]+Me[1])/2],U=[(Se[0]+$e[0])/2,(Se[1]+$e[1])/2]}else if(G.touch0)A=G.touch0[0],U=G.touch0[1];else return;G.zoom("touch",i(P(F,A,U),G.extent,d))}}function xe(D,...ue){if(this.__zooming){var G=V(this,ue).event(D),ie=D.changedTouches,z=ie.length,q,F;for(sf(D),S&&clearTimeout(S),S=setTimeout(function(){S=null},C),q=0;q<z;++q)F=ie[q],G.touch0&&G.touch0[2]===F.identifier?delete G.touch0:G.touch1&&G.touch1[2]===F.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&&(F=Ir(F,this),Math.hypot(w[0]-F[0],w[1]-F[1])<$)){var A=Zn(this).on("dblclick.zoom");A&&A.apply(this,arguments)}}}return I.wheelDelta=function(D){return arguments.length?(s=typeof D=="function"?D:Yl(+D),I):s},I.filter=function(D){return arguments.length?(t=typeof D=="function"?D:Yl(!!D),I):t},I.touchable=function(D){return arguments.length?(l=typeof D=="function"?D:Yl(!!D),I):l},I.extent=function(D){return arguments.length?(r=typeof D=="function"?D:Yl([[+D[0][0],+D[0][1]],[+D[1][0],+D[1][1]]]),I):r},I.scaleExtent=function(D){return arguments.length?(c[0]=+D[0],c[1]=+D[1],I):[c[0],c[1]]},I.translateExtent=function(D){return arguments.length?(d[0][0]=+D[0][0],d[1][0]=+D[1][0],d[0][1]=+D[0][1],d[1][1]=+D[1][1],I):[[d[0][0],d[0][1]],[d[1][0],d[1][1]]]},I.constrain=function(D){return arguments.length?(i=D,I):i},I.duration=function(D){return arguments.length?(m=+D,I):m},I.interpolate=function(D){return arguments.length?(v=D,I):v},I.on=function(){var D=b.on.apply(b,arguments);return D===b?I:D},I.clickDistance=function(D){return arguments.length?(T=(D=+D)*D,I):Math.sqrt(T)},I.tapDistance=function(D){return arguments.length?($=+D,I):$},I}const Qr={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"],e0={"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 Ts;(function(t){t.Strict="strict",t.Loose="loose"})(Ts||(Ts={}));var Ri;(function(t){t.Free="free",t.Vertical="vertical",t.Horizontal="horizontal"})(Ri||(Ri={}));var Pa;(function(t){t.Partial="partial",t.Full="full"})(Pa||(Pa={}));const t0={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var li;(function(t){t.Bezier="default",t.Straight="straight",t.Step="step",t.SmoothStep="smoothstep",t.SimpleBezier="simplebezier"})(li||(li={}));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 wp={[Ze.Left]:Ze.Right,[Ze.Right]:Ze.Left,[Ze.Top]:Ze.Bottom,[Ze.Bottom]:Ze.Top};function n0(t){return t===null?null:t?"valid":"invalid"}const r0=t=>"id"in t&&"source"in t&&"target"in t,k1=t=>"id"in t&&"position"in t&&!("source"in t)&&!("target"in t),Kf=t=>"id"in t&&"internals"in t&&!("source"in t)&&!("target"in t),Ra=(t,r=[0,0])=>{const{width:i,height:s}=To(t),l=t.origin??r,c=i*l[0],d=s*l[1];return{x:t.position.x-c,y:t.position.y-d}},N1=(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):Kf(l)?l:r.nodeLookup.get(l.id));const m=d?yu(d,r.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Pu(s,m)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Mu(i)},Da=(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}},Uf=(t,r,[i,s,l]=[0,0,1],c=!1,d=!1)=>{const m={...za(r,[i,s,l]),width:r.width/l,height:r.height/l},v=[];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,T=Ma(m,$s(b)),$=(C??0)*(j??0),I=c&&T>0;(!b.internals.handleBounds||I||T>=$||b.dragging)&&v.push(b)}return v},E1=(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 C1(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 j1({nodes:t,width:r,height:i,panZoom:s,minZoom:l,maxZoom:c},d){if(t.size===0)return Promise.resolve(!0);const m=C1(t,d),v=Da(m),b=qf(v,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 o0({nodeId:t,nextPosition:r,nodeLookup:i,nodeOrigin:s=[0,0],nodeExtent:l,onError:c}){const d=i.get(t),m=d.parentId?i.get(d.parentId):void 0,{x:v,y:b}=m?m.internals.positionAbsolute:{x:0,y:0},k=d.origin??s;let w=d.extent||l;if(d.extent==="parent"&&!d.expandParent)if(!m)c==null||c("005",Qr.error005());else{const C=m.measured.width,j=m.measured.height;C&&j&&(w=[[v,b],[v+C,b+j]])}else m&&As(d.extent)&&(w=[[d.extent[0][0]+v,d.extent[0][1]+b],[d.extent[1][0]+v,d.extent[1][1]+b]]);const S=As(w)?zi(r,w,d.measured):r;return(d.measured.width===void 0||d.measured.height===void 0)&&(c==null||c("015",Qr.error015())),{position:{x:S.x-v+(d.measured.width??0)*k[0],y:S.y-b+(d.measured.height??0)*k[1]},positionAbsolute:S}}async function P1({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(T=>T.id===S.parentId);(C||j)&&d.push(S)}const m=new Set(r.map(S=>S.id)),v=s.filter(S=>S.deletable!==!1),k=E1(d,v);for(const S of v)m.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 Is=(t,r=0,i=1)=>Math.min(Math.max(t,r),i),zi=(t={x:0,y:0},r,i)=>({x:Is(t.x,r[0][0],r[1][0]-((i==null?void 0:i.width)??0)),y:Is(t.y,r[0][1],r[1][1]-((i==null?void 0:i.height)??0))});function i0(t,r,i){const{width:s,height:l}=To(i),{x:c,y:d}=i.internals.positionAbsolute;return zi(t,[[c,d],[c+s,d+l]],r)}const bp=(t,r,i)=>t<r?Is(Math.abs(t-r),1,r)/r:t>i?-Is(Math.abs(t-i),1,r)/r:0,s0=(t,r,i=15,s=40)=>{const l=bp(t.x,s,r.width-s)*i,c=bp(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}),$s=(t,r=[0,0])=>{var l,c;const{x:i,y:s}=Kf(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}=Kf(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)}},a0=(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)},_p=t=>Ar(t.width)&&Ar(t.height)&&Ar(t.x)&&Ar(t.y),Ar=t=>!isNaN(t)&&isFinite(t),M1=(t,r)=>{},La=(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 m={x:(t-i)/l,y:(r-s)/l};return c?La(m,d):m},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 T1(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 I1(t,r,i,s,l,c){const{x:d,y:m}=vu(t,[r,i,s]),{x:v,y:b}=vu({x:t.x+t.width,y:t.y+t.height},[r,i,s]),k=l-v,w=c-b;return{left:Math.floor(d),top:Math.floor(m),right:Math.floor(k),bottom:Math.floor(w)}}const qf=(t,r,i,s,l,c)=>{const d=T1(c,r,i),m=(r-d.x)/t.width,v=(i-d.y)/t.height,b=Math.min(m,v),k=Is(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,T=I1(t,C,j,k,r,i),$={left:Math.min(T.left-d.left,0),top:Math.min(T.top-d.top,0),right:Math.min(T.right-d.right,0),bottom:Math.min(T.bottom-d.bottom,0)};return{x:C-$.left+$.right,y:j-$.top+$.bottom,zoom:k}},Ta=()=>{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 To(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 l0(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 u0(t,r={width:0,height:0},i,s,l){const c={...t},d=s.get(i);if(d){const m=d.origin||l;c.x+=d.internals.positionAbsolute.x-(r.width??0)*m[0],c.y+=d.internals.positionAbsolute.y-(r.height??0)*m[1]}return c}function Sp(t,r){if(t.size!==r.size)return!1;for(const i of t)if(!r.has(i))return!1;return!0}function $1(){let t,r;return{promise:new Promise((s,l)=>{t=s,r=l}),resolve:t,reject:r}}function A1(t){return{...e0,...t||{}}}function Sa(t,{snapGrid:r=[0,0],snapToGrid:i=!1,transform:s,containerBounds:l}){const{x:c,y:d}=Or(t),m=za({x:c-((l==null?void 0:l.left)??0),y:d-((l==null?void 0:l.top)??0)},s),{x:v,y:b}=i?La(m,r):m;return{xSnapped:v,ySnapped:b,...m}}const Wf=t=>({width:t.offsetWidth,height:t.offsetHeight}),c0=t=>{var r;return((r=t==null?void 0:t.getRootNode)==null?void 0:r.call(t))||(window==null?void 0:window.document)},O1=["INPUT","SELECT","TEXTAREA"];function f0(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:O1.includes(r.nodeName)||r.hasAttribute("contenteditable")||!!r.closest(".nokey")}const d0=t=>"clientX"in t,Or=(t,r)=>{var c,d;const i=d0(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)}},kp=(t,r,i,s,l)=>{const c=r.querySelectorAll(`.${t}`);return!c||!c.length?null:Array.from(c).map(d=>{const m=d.getBoundingClientRect();return{id:d.getAttribute("data-handleid"),type:t,nodeId:l,position:d.getAttribute("data-handlepos"),x:(m.left-i.left)/s,y:(m.top-i.top)/s,...Wf(d)}})};function h0({sourceX:t,sourceY:r,targetX:i,targetY:s,sourceControlX:l,sourceControlY:c,targetControlX:d,targetControlY:m}){const v=t*.125+l*.375+d*.375+i*.125,b=r*.125+c*.375+m*.375+s*.125,k=Math.abs(v-t),w=Math.abs(b-r);return[v,b,k,w]}function Xl(t,r){return t>=0?.5*t:r*25*Math.sqrt(-t)}function Np({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 p0({sourceX:t,sourceY:r,sourcePosition:i=Ze.Bottom,targetX:s,targetY:l,targetPosition:c=Ze.Top,curvature:d=.25}){const[m,v]=Np({pos:i,x1:t,y1:r,x2:s,y2:l,c:d}),[b,k]=Np({pos:c,x1:s,y1:l,x2:t,y2:r,c:d}),[w,S,C,j]=h0({sourceX:t,sourceY:r,targetX:s,targetY:l,sourceControlX:m,sourceControlY:v,targetControlX:b,targetControlY:k});return[`M${t},${r} C${m},${v} ${b},${k} ${s},${l}`,w,S,C,j]}function m0({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,m=s<r?s+d:s-d;return[c,m,l,d]}function R1({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,m=Math.max(t.parentId||l&&t.selected?t.internals.z:0,r.parentId||l&&r.selected?r.internals.z:0);return d+m}function D1({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 L1=({source:t,sourceHandle:r,target:i,targetHandle:s})=>`xy-edge__${t}${r||""}-${i}${s||""}`,z1=(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)),g0=(t,r,i={})=>{if(!t.source||!t.target)return r;const s=i.getEdgeId||L1;let l;return r0(t)?l={...t}:l={...t,id:s(t)},z1(l,r)?r:(l.sourceHandle===null&&delete l.sourceHandle,l.targetHandle===null&&delete l.targetHandle,r.concat(l))};function y0({sourceX:t,sourceY:r,targetX:i,targetY:s}){const[l,c,d,m]=m0({sourceX:t,sourceY:r,targetX:i,targetY:s});return[`M ${t},${r}L ${i},${s}`,l,c,d,m]}const Ep={[Ze.Left]:{x:-1,y:0},[Ze.Right]:{x:1,y:0},[Ze.Top]:{x:0,y:-1},[Ze.Bottom]:{x:0,y:1}},F1=({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},Cp=(t,r)=>Math.sqrt(Math.pow(r.x-t.x,2)+Math.pow(r.y-t.y,2));function B1({source:t,sourcePosition:r=Ze.Bottom,target:i,targetPosition:s=Ze.Top,center:l,offset:c,stepPosition:d}){const m=Ep[r],v=Ep[s],b={x:t.x+m.x*c,y:t.y+m.y*c},k={x:i.x+v.x*c,y:i.y+v.y*c},w=F1({source:b,sourcePosition:r,target:k}),S=w.x!==0?"x":"y",C=w[S];let j=[],T,$;const I={x:0,y:0},K={x:0,y:0},[,,P,R]=m0({sourceX:t.x,sourceY:t.y,targetX:i.x,targetY:i.y});if(m[S]*v[S]===-1){S==="x"?(T=l.x??b.x+(k.x-b.x)*d,$=l.y??(b.y+k.y)/2):(T=l.x??(b.x+k.x)/2,$=l.y??b.y+(k.y-b.y)*d);const ae=[{x:T,y:b.y},{x:T,y:k.y}],de=[{x:b.x,y:$},{x:k.x,y:$}];m[S]===C?j=S==="x"?ae:de:j=S==="x"?de:ae}else{const ae=[{x:b.x,y:k.y}],de=[{x:k.x,y:b.y}];if(S==="x"?j=m.x===C?de:ae:j=m.y===C?ae:de,r===s){const D=Math.abs(t[S]-i[S]);if(D<=c){const ue=Math.min(c-1,c-D);m[S]===C?I[S]=(b[S]>t[S]?-1:1)*ue:K[S]=(k[S]>i[S]?-1:1)*ue}}if(r!==s){const D=S==="x"?"y":"x",ue=m[S]===v[D],G=b[D]>k[D],ie=b[D]<k[D];(m[S]===1&&(!ue&&G||ue&&ie)||m[S]!==1&&(!ue&&ie||ue&&G))&&(j=S==="x"?ae:de)}const we={x:b.x+I.x,y:b.y+I.y},H={x:k.x+K.x,y:k.y+K.y},fe=Math.max(Math.abs(we.x-j[0].x),Math.abs(H.x-j[0].x)),xe=Math.max(Math.abs(we.y-j[0].y),Math.abs(H.y-j[0].y));fe>=xe?(T=(we.x+H.x)/2,$=j[0].y):(T=j[0].x,$=(we.y+H.y)/2)}const Y={x:b.x+I.x,y:b.y+I.y},V={x:k.x+K.x,y:k.y+K.y};return[[t,...Y.x!==j[0].x||Y.y!==j[0].y?[Y]:[],...j,...V.x!==j[j.length-1].x||V.y!==j[j.length-1].y?[V]:[],i],T,$,P,R]}function H1(t,r,i,s){const l=Math.min(Cp(t,r)/2,Cp(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 m=t.x<i.x?1:-1,v=t.y<i.y?-1:1;return`L ${c},${d+l*v}Q ${c},${d} ${c+l*m},${d}`}function Mf({sourceX:t,sourceY:r,sourcePosition:i=Ze.Bottom,targetX:s,targetY:l,targetPosition:c=Ze.Top,borderRadius:d=5,centerX:m,centerY:v,offset:b=20,stepPosition:k=.5}){const[w,S,C,j,T]=B1({source:{x:t,y:r},sourcePosition:i,target:{x:s,y:l},targetPosition:c,center:{x:m,y:v},offset:b,stepPosition:k});let $=`M${w[0].x} ${w[0].y}`;for(let I=1;I<w.length-1;I++)$+=H1(w[I-1],w[I],w[I+1],d);return $+=`L${w[w.length-1].x} ${w[w.length-1].y}`,[$,S,C,j,T]}function jp(t){var r;return t&&!!(t.internals.handleBounds||(r=t.handles)!=null&&r.length)&&!!(t.measured.width||t.width||t.initialWidth)}function V1(t){var w;const{sourceNode:r,targetNode:i}=t;if(!jp(r)||!jp(i))return null;const s=r.internals.handleBounds||Pp(r.handles),l=i.internals.handleBounds||Pp(i.handles),c=Mp((s==null?void 0:s.source)??[],t.sourceHandle),d=Mp(t.connectionMode===Ts.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",Qr.error008(c?"target":"source",{id:t.id,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle})),null;const m=(c==null?void 0:c.position)||Ze.Bottom,v=(d==null?void 0:d.position)||Ze.Top,b=Fi(r,c,m),k=Fi(i,d,v);return{sourceX:b.x,sourceY:b.y,targetX:k.x,targetY:k.y,sourcePosition:m,targetPosition:v}}function Pp(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 Fi(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:m}=r??To(t);if(s)return{x:l+d/2,y:c+m/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+m/2};case Ze.Bottom:return{x:l+d/2,y:c+m};case Ze.Left:return{x:l,y:c+m/2}}}function Mp(t,r){return t&&(r?t.find(i=>i.id===r):t[0])||null}function Tf(t,r){return t?typeof t=="string"?t:`${r?`${r}__`:""}${Object.keys(t).sort().map(s=>`${s}=${t[s]}`).join("&")}`:""}function K1(t,{id:r,defaultColor:i,defaultMarkerStart:s,defaultMarkerEnd:l}){const c=new Set;return t.reduce((d,m)=>([m.markerStart||s,m.markerEnd||l].forEach(v=>{if(v&&typeof v=="object"){const b=Tf(v,r);c.has(b)||(d.push({id:b,color:v.color||i,...v}),c.add(b))}}),d),[]).sort((d,m)=>d.id.localeCompare(m.id))}const v0=1e3,U1=10,Yf={nodeOrigin:[0,0],nodeExtent:ja,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},q1={...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 W1(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,m=zi(c,d,To(l));l.internals.positionAbsolute=m}}function Y1(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 If(t,r,i,s={}){var k,w;const l=Xf(q1,s),c={i:0},d=new Map(r),m=l!=null&&l.elevateNodesOnSelect&&!Qf(l.zIndexMode)?v0:0;let v=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),T=As(S.extent)?S.extent:l.nodeExtent,$=zi(j,T,To(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:$,handleBounds:Y1(S,C),z:x0(S,m,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&&(v=!1),S.parentId&&Gf(C,r,i,s,c),b||(b=S.selected??!1)}return{nodesInitialized:v,hasSelectedNodes:b}}function X1(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:m,zIndexMode:v}=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}X1(t,i),l&&!k.parentId&&k.internals.rootParentIndex===void 0&&v==="auto"&&(k.internals.rootParentIndex=++l.i,k.internals.z=k.internals.z+l.i*U1),l&&k.internals.rootParentIndex!==void 0&&(l.i=k.internals.rootParentIndex);const w=c&&!Qf(v)?v0:0,{x:S,y:C,z:j}=Q1(t,k,d,m,w,v),{positionAbsolute:T}=t.internals,$=S!==T.x||C!==T.y;($||j!==t.internals.z)&&r.set(t.id,{...t,internals:{...t.internals,positionAbsolute:$?{x:S,y:C}:T,z:j}})}function x0(t,r,i){const s=Ar(t.zIndex)?t.zIndex:0;return Qf(i)?s:s+(t.selected?r:0)}function Q1(t,r,i,s,l,c){const{x:d,y:m}=r.internals.positionAbsolute,v=To(t),b=Ra(t,i),k=As(t.extent)?zi(b,t.extent,v):b;let w=zi({x:d+k.x,y:m+k.y},s,v);t.extent==="parent"&&(w=i0(w,v,r));const S=x0(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 m of t){const v=r.get(m.parentId);if(!v)continue;const b=((d=c.get(m.parentId))==null?void 0:d.expandedRect)??$s(v),k=a0(b,m.rect);c.set(m.parentId,{expandedRect:k,parent:v})}return c.size>0&&c.forEach(({expandedRect:m,parent:v},b)=>{var P;const k=v.internals.positionAbsolute,w=To(v),S=v.origin??s,C=m.x<k.x?Math.round(Math.abs(k.x-m.x)):0,j=m.y<k.y?Math.round(Math.abs(k.y-m.y)):0,T=Math.max(w.width,Math.round(m.width)),$=Math.max(w.height,Math.round(m.height)),I=(T-w.width)*S[0],K=($-w.height)*S[1];(C>0||j>0||I||K)&&(l.push({id:b,type:"position",position:{x:v.position.x-C+I,y:v.position.y-j+K}}),(P=i.get(b))==null||P.forEach(R=>{t.some(Y=>Y.id===R.id)||l.push({id:R.id,type:"position",position:{x:R.position.x+C,y:R.position.y+j}})})),(w.width<m.width||w.height<m.height||C||j)&&l.push({id:b,type:"dimensions",setAttributes:!0,dimensions:{width:T+(C?S[0]*C-I:0),height:$+(j?S[1]*j-K:0)}})}),l}function G1(t,r,i,s,l,c,d){const m=s==null?void 0:s.querySelector(".xyflow__viewport");let v=!1;if(!m)return{changes:[],updatedInternals:v};const b=[],k=window.getComputedStyle(m),{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}}),v=!0;continue}const T=Wf(C.nodeElement),$=j.measured.width!==T.width||j.measured.height!==T.height;if(!!(T.width&&T.height&&($||!j.internals.handleBounds||C.force))){const K=C.nodeElement.getBoundingClientRect(),P=As(j.extent)?j.extent:c;let{positionAbsolute:R}=j.internals;j.parentId&&j.extent==="parent"?R=i0(R,T,r.get(j.parentId)):P&&(R=zi(R,P,T));const Y={...j,measured:T,internals:{...j.internals,positionAbsolute:R,handleBounds:{source:kp("source",C.nodeElement,K,w,j.id),target:kp("target",C.nodeElement,K,w,j.id)}}};r.set(j.id,Y),j.parentId&&Gf(Y,r,i,{nodeOrigin:l,zIndexMode:d}),v=!0,$&&(b.push({id:j.id,type:"dimensions",dimensions:T}),j.expandParent&&j.parentId&&S.push({id:j.id,parentId:j.parentId,rect:$s(Y,l)}))}}if(S.length>0){const C=Jf(S,r,i,l);b.push(...C)}return{changes:b,updatedInternals:v}}async function J1({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),m=!!d&&(d.x!==i[0]||d.y!==i[1]||d.k!==i[2]);return Promise.resolve(m)}function Tp(t,r,i,s,l,c){let d=l;const m=s.get(d)||new Map;s.set(d,m.set(i,r)),d=`${l}-${t}`;const v=s.get(d)||new Map;if(s.set(d,v.set(i,r)),c){d=`${l}-${t}-${c}`;const b=s.get(d)||new Map;s.set(d,b.set(i,r))}}function w0(t,r,i){t.clear(),r.clear();for(const s of i){const{source:l,target:c,sourceHandle:d=null,targetHandle:m=null}=s,v={edgeId:s.id,source:l,target:c,sourceHandle:d,targetHandle:m},b=`${l}-${d}--${c}-${m}`,k=`${c}-${m}--${l}-${d}`;Tp("source",v,k,t,l,d),Tp("target",v,b,t,c,m),r.set(s.id,s)}}function b0(t,r){if(!t.parentId)return!1;const i=r.get(t.parentId);return i?i.selected?!0:b0(i,r):!1}function Ip(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 Z1(t,r,i,s){const l=new Map;for(const[c,d]of t)if((d.selected||d.id===s)&&(!d.parentId||!b0(d,t))&&(d.draggable||r&&typeof d.draggable>"u")){const m=t.get(c);m&&l.set(c,{id:c,position:m.position||{x:0,y:0},distance:{x:i.x-m.internals.positionAbsolute.x,y:i.y-m.internals.positionAbsolute.y},extent:m.extent,parentId:m.parentId,origin:m.origin,expandParent:m.expandParent,internals:{positionAbsolute:m.internals.positionAbsolute||{x:0,y:0}},measured:{width:m.measured.width??0,height:m.measured.height??0}})}return l}function af({nodeId:t,dragItems:r,nodeLookup:i,dragging:s=!0}){var d,m,v;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=(m=i.get(t))==null?void 0:m.internals.userNode;return[c?{...c,position:((v=r.get(t))==null?void 0:v.position)||c.position,dragging:s}:l[0],l]}function eb({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=La(c,r);return{x:d.x-c.x,y:d.y-c.y}}function tb({onNodeMouseDown:t,getStoreItems:r,onDragStart:i,onDrag:s,onDragStop:l}){let c={x:null,y:null},d=0,m=new Map,v=!1,b={x:0,y:0},k=null,w=!1,S=null,C=!1,j=!1,T=null;function $({noDragClassName:K,handleSelector:P,domNode:R,isSelectable:Y,nodeId:V,nodeClickDistance:B=0}){S=Zn(R);function ae({x:fe,y:xe}){const{nodeLookup:D,nodeExtent:ue,snapGrid:G,snapToGrid:ie,nodeOrigin:z,onNodeDrag:q,onSelectionDrag:F,onError:A,updateNodePositions:U}=r();c={x:fe,y:xe};let be=!1;const Se=m.size>1,Me=Se&&ue?Pf(Da(m)):null,$e=Se&&ie?eb({dragItems:m,snapGrid:G,x:fe,y:xe}):null;for(const[Ae,_e]of m){if(!D.has(Ae))continue;let Be={x:fe-_e.distance.x,y:xe-_e.distance.y};ie&&(Be=$e?{x:Math.round(Be.x+$e.x),y:Math.round(Be.y+$e.y)}:La(Be,G));let ke=null;if(Se&&ue&&!_e.extent&&Me){const{positionAbsolute:qe}=_e.internals,ut=qe.x-Me.x+ue[0][0],ct=qe.x+_e.measured.width-Me.x2+ue[1][0],it=qe.y-Me.y+ue[0][1],Tt=qe.y+_e.measured.height-Me.y2+ue[1][1];ke=[[ut,it],[ct,Tt]]}const{position:He,positionAbsolute:Oe}=o0({nodeId:Ae,nextPosition:Be,nodeLookup:D,nodeExtent:ke||ue,nodeOrigin:z,onError:A});be=be||_e.position.x!==He.x||_e.position.y!==He.y,_e.position=He,_e.internals.positionAbsolute=Oe}if(j=j||be,!!be&&(U(m,!0),T&&(s||q||!V&&F))){const[Ae,_e]=af({nodeId:V,dragItems:m,nodeLookup:D});s==null||s(T,m,Ae,_e),q==null||q(T,Ae,_e),V||F==null||F(T,_e)}}async function de(){if(!k)return;const{transform:fe,panBy:xe,autoPanSpeed:D,autoPanOnNodeDrag:ue}=r();if(!ue){v=!1,cancelAnimationFrame(d);return}const[G,ie]=s0(b,k,D);(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})&&ae(c)),d=requestAnimationFrame(de)}function we(fe){var Se;const{nodeLookup:xe,multiSelectionActive:D,nodesDraggable:ue,transform:G,snapGrid:ie,snapToGrid:z,selectNodesOnDrag:q,onNodeDragStart:F,onSelectionDragStart:A,unselectNodesAndEdges:U}=r();w=!0,(!q||!Y)&&!D&&V&&((Se=xe.get(V))!=null&&Se.selected||U()),Y&&q&&V&&(t==null||t(V));const be=Sa(fe.sourceEvent,{transform:G,snapGrid:ie,snapToGrid:z,containerBounds:k});if(c=be,m=Z1(xe,ue,be,V),m.size>0&&(i||F||!V&&A)){const[Me,$e]=af({nodeId:V,dragItems:m,nodeLookup:xe});i==null||i(fe.sourceEvent,m,Me,$e),F==null||F(fe.sourceEvent,Me,$e),V||A==null||A(fe.sourceEvent,$e)}}const H=Dm().clickDistance(B).on("start",fe=>{const{domNode:xe,nodeDragThreshold:D,transform:ue,snapGrid:G,snapToGrid:ie}=r();k=(xe==null?void 0:xe.getBoundingClientRect())||null,C=!1,j=!1,T=fe.sourceEvent,D===0&&we(fe),c=Sa(fe.sourceEvent,{transform:ue,snapGrid:G,snapToGrid:ie,containerBounds:k}),b=Or(fe.sourceEvent,k)}).on("drag",fe=>{const{autoPanOnNodeDrag:xe,transform:D,snapGrid:ue,snapToGrid:G,nodeDragThreshold:ie,nodeLookup:z}=r(),q=Sa(fe.sourceEvent,{transform:D,snapGrid:ue,snapToGrid:G,containerBounds:k});if(T=fe.sourceEvent,(fe.sourceEvent.type==="touchmove"&&fe.sourceEvent.touches.length>1||V&&!z.has(V))&&(C=!0),!C){if(!v&&xe&&w&&(v=!0,de()),!w){const F=Or(fe.sourceEvent,k),A=F.x-b.x,U=F.y-b.y;Math.sqrt(A*A+U*U)>ie&&we(fe)}(c.x!==q.xSnapped||c.y!==q.ySnapped)&&m&&w&&(b=Or(fe.sourceEvent,k),ae(q))}}).on("end",fe=>{if(!(!w||C)&&(v=!1,w=!1,cancelAnimationFrame(d),m.size>0)){const{nodeLookup:xe,updateNodePositions:D,onNodeDragStop:ue,onSelectionDragStop:G}=r();if(j&&(D(m,!1),j=!1),l||ue||!V&&G){const[ie,z]=af({nodeId:V,dragItems:m,nodeLookup:xe,dragging:!1});l==null||l(fe.sourceEvent,m,ie,z),ue==null||ue(fe.sourceEvent,ie,z),V||G==null||G(fe.sourceEvent,z)}}}).filter(fe=>{const xe=fe.target;return!fe.button&&(!K||!Ip(xe,`.${K}`,R))&&(!P||Ip(xe,P,R))});S.call(H)}function I(){S==null||S.on(".drag",null)}return{update:$,destroy:I}}function nb(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,$s(c))>0&&s.push(c);return s}const rb=250;function ob(t,r,i,s){var m,v;let l=[],c=1/0;const d=nb(t,i,r+rb);for(const b of d){const k=[...((m=b.internals.handleBounds)==null?void 0:m.source)??[],...((v=b.internals.handleBounds)==null?void 0:v.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}=Fi(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 _0(t,r,i,s,l,c=!1){var b,k,w;const d=s.get(t);if(!d)return null;const m=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)??[]],v=(i?m==null?void 0:m.find(S=>S.id===i):m==null?void 0:m[0])??null;return v&&c?{...v,...Fi(d,v,v.position,!0)}:v}function S0(t,r){return t||(r!=null&&r.classList.contains("target")?"target":r!=null&&r.classList.contains("source")?"source":null)}function ib(t,r){let i=null;return r?i=!0:t&&!r&&(i=!1),i}const k0=()=>!0;function sb(t,{connectionMode:r,connectionRadius:i,handleId:s,nodeId:l,edgeUpdaterType:c,isTarget:d,domNode:m,nodeLookup:v,lib:b,autoPanOnConnect:k,flowId:w,panBy:S,cancelConnection:C,onConnectStart:j,onConnect:T,onConnectEnd:$,isValidConnection:I=k0,onReconnectEnd:K,updateConnection:P,getTransform:R,getFromHandle:Y,autoPanSpeed:V,dragThreshold:B=1,handleDomNode:ae}){const de=c0(t.target);let we=0,H;const{x:fe,y:xe}=Or(t),D=S0(c,ae),ue=m==null?void 0:m.getBoundingClientRect();let G=!1;if(!ue||!D)return;const ie=_0(l,D,s,v,r);if(!ie)return;let z=Or(t,ue),q=!1,F=null,A=!1,U=null;function be(){if(!k||!ue)return;const[He,Oe]=s0(z,ue,V);S({x:He,y:Oe}),we=requestAnimationFrame(be)}const Se={...ie,nodeId:l,type:D,position:ie.position},Me=v.get(l);let Ae={inProgress:!0,isValid:null,from:Fi(Me,Se,Ze.Left,!0),fromHandle:Se,fromPosition:Se.position,fromNode:Me,to:z,toHandle:null,toPosition:wp[Se.position],toNode:null,pointer:z};function _e(){G=!0,P(Ae),j==null||j(t,{nodeId:l,handleId:s,handleType:D})}B===0&&_e();function Be(He){if(!G){const{x:Tt,y:_t}=Or(He),Ht=Tt-fe,Ot=_t-xe;if(!(Ht*Ht+Ot*Ot>B*B))return;_e()}if(!Y()||!Se){ke(He);return}const Oe=R();z=Or(He,ue),H=ob(za(z,Oe,!1,[1,1]),i,v,Se),q||(be(),q=!0);const qe=N0(He,{handle:H,connectionMode:r,fromNodeId:l,fromHandleId:s,fromType:d?"target":"source",isValidConnection:I,doc:de,lib:b,flowId:w,nodeLookup:v});U=qe.handleDomNode,F=qe.connection,A=ib(!!H,qe.isValid);const ut=v.get(l),ct=ut?Fi(ut,Se,Ze.Left,!0):Ae.from,it={...Ae,from:ct,isValid:A,to:qe.toHandle&&A?vu({x:qe.toHandle.x,y:qe.toHandle.y},Oe):z,toHandle:qe.toHandle,toPosition:A&&qe.toHandle?qe.toHandle.position:wp[Se.position],toNode:qe.toHandle?v.get(qe.toHandle.nodeId):null,pointer:z};P(it),Ae=it}function ke(He){if(!("touches"in He&&He.touches.length>0)){if(G){(H||U)&&F&&A&&(T==null||T(F));const{inProgress:Oe,...qe}=Ae,ut={...qe,toPosition:Ae.toHandle?Ae.toPosition:null};$==null||$(He,ut),c&&(K==null||K(He,ut))}C(),cancelAnimationFrame(we),q=!1,A=!1,F=null,U=null,de.removeEventListener("mousemove",Be),de.removeEventListener("mouseup",ke),de.removeEventListener("touchmove",Be),de.removeEventListener("touchend",ke)}}de.addEventListener("mousemove",Be),de.addEventListener("mouseup",ke),de.addEventListener("touchmove",Be),de.addEventListener("touchend",ke)}function N0(t,{handle:r,connectionMode:i,fromNodeId:s,fromHandleId:l,fromType:c,doc:d,lib:m,flowId:v,isValidConnection:b=k0,nodeLookup:k}){const w=c==="target",S=r?d.querySelector(`.${m}-flow__handle[data-id="${v}-${r==null?void 0:r.nodeId}-${r==null?void 0:r.id}-${r==null?void 0:r.type}"]`):null,{x:C,y:j}=Or(t),T=d.elementFromPoint(C,j),$=T!=null&&T.classList.contains(`${m}-flow__handle`)?T:S,I={handleDomNode:$,isValid:!1,connection:null,toHandle:null};if($){const K=S0(void 0,$),P=$.getAttribute("data-nodeid"),R=$.getAttribute("data-handleid"),Y=$.classList.contains("connectable"),V=$.classList.contains("connectableend");if(!P||!K)return I;const B={source:w?P:s,sourceHandle:w?R:l,target:w?s:P,targetHandle:w?l:R};I.connection=B;const de=Y&&V&&(i===Ts.Strict?w&&K==="source"||!w&&K==="target":P!==s||R!==l);I.isValid=de&&b(B),I.toHandle=_0(P,K,R,k,i,!0)}return I}const $f={onPointerDown:sb,isValid:N0};function ab({domNode:t,panZoom:r,getTransform:i,getViewScale:s}){const l=Zn(t);function c({translateExtent:m,width:v,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(),Y=P.sourceEvent.ctrlKey&&Ta()?10:1,V=-P.sourceEvent.deltaY*(P.sourceEvent.deltaMode===1?.05:P.sourceEvent.deltaMode?1:.002)*k,B=R[2]*Math.pow(2,V*Y);r.scaleTo(B)};let T=[0,0];const $=P=>{(P.sourceEvent.type==="mousedown"||P.sourceEvent.type==="touchstart")&&(T=[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 Y=[P.sourceEvent.clientX??P.sourceEvent.touches[0].clientX,P.sourceEvent.clientY??P.sourceEvent.touches[0].clientY],V=[Y[0]-T[0],Y[1]-T[1]];T=Y;const B=s()*Math.max(R[2],Math.log(R[2]))*(C?-1:1),ae={x:R[0]-V[0]*B,y:R[1]-V[1]*B},de=[[0,0],[v,b]];r.setViewportConstrained({x:ae.x,y:ae.y,zoom:R[2]},de,m)},K=Jm().on("start",$).on("zoom",w?I:null).on("zoom.wheel",S?j:null);l.call(K,{})}function d(){l.on("zoom",null)}return{update:c,destroy:d,pointer:Ir}}const Tu=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}`),E0=(t,r)=>r===2&&Array.isArray(t)&&t.includes(2),lb=t=>((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2,uf=(t,r=0,i=lb,s=()=>{})=>{const l=typeof r=="number"&&r>0;return l||s(),l?t.transition().duration(r).ease(i).on("end",s):t},C0=t=>{const r=t.ctrlKey&&Ta()?10:1;return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*r};function ub({zoomPanValues:t,noWheelClassName:r,d3Selection:i,d3Zoom:s,panOnScrollMode:l,panOnScrollSpeed:c,zoomOnPinch:d,onPanZoomStart:m,onPanZoom:v,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 $=Ir(k),I=C0(k),K=w*Math.pow(2,I);s.scaleTo(i,K,$,k);return}const S=k.deltaMode===1?20:1;let C=l===Ri.Vertical?0:k.deltaX*S,j=l===Ri.Horizontal?0:k.deltaY*S;!Ta()&&k.shiftKey&&l!==Ri.Vertical&&(C=k.deltaY*S,j=0),s.translateBy(i,-(C/w)*c,-(j/w)*c,{internal:!0});const T=Tu(i.property("__zoom"));clearTimeout(t.panScrollTimeout),t.isPanScrolling?(v==null||v(k,T),t.panScrollTimeout=setTimeout(()=>{b==null||b(k,T),t.isPanScrolling=!1},150)):(t.isPanScrolling=!0,m==null||m(k,T))}}function cb({noWheelClassName:t,preventScrolling:r,d3ZoomHandler:i}){return function(s,l){const c=s.type==="wheel",d=!r&&c&&!s.ctrlKey,m=Ns(s,t);if(s.ctrlKey&&c&&m&&s.preventDefault(),d||m)return null;s.preventDefault(),i.call(this,s,l)}}function fb({zoomPanValues:t,onDraggingChange:r,onPanZoomStart:i}){return s=>{var c,d,m;if((c=s.sourceEvent)!=null&&c.internal)return;const l=Tu(s.transform);t.mouseButton=((d=s.sourceEvent)==null?void 0:d.button)||0,t.isZoomingOrPanning=!0,t.prevViewport=l,((m=s.sourceEvent)==null?void 0:m.type)==="mousedown"&&r(!0),i&&(i==null||i(s.sourceEvent,l))}}function db({zoomPanValues:t,panOnDrag:r,onPaneContextMenu:i,onTransformChange:s,onPanZoom:l}){return c=>{var d,m;t.usedRightMouseButton=!!(i&&E0(r,t.mouseButton??0)),(d=c.sourceEvent)!=null&&d.sync||s([c.transform.x,c.transform.y,c.transform.k]),l&&!((m=c.sourceEvent)!=null&&m.internal)&&(l==null||l(c.sourceEvent,Tu(c.transform)))}}function hb({zoomPanValues:t,panOnDrag:r,panOnScroll:i,onDraggingChange:s,onPanZoomEnd:l,onPaneContextMenu:c}){return d=>{var m;if(!((m=d.sourceEvent)!=null&&m.internal)&&(t.isZoomingOrPanning=!1,c&&E0(r,t.mouseButton??0)&&!t.usedRightMouseButton&&d.sourceEvent&&c(d.sourceEvent),t.usedRightMouseButton=!1,s(!1),l)){const v=Tu(d.transform);t.prevViewport=v,clearTimeout(t.timerId),t.timerId=setTimeout(()=>{l==null||l(d.sourceEvent,v)},i?150:0)}}}function pb({zoomActivationKeyPressed:t,zoomOnScroll:r,zoomOnPinch:i,panOnDrag:s,panOnScroll:l,zoomOnDoubleClick:c,userSelectionActive:d,noWheelClassName:m,noPanClassName:v,lib:b,connectionInProgress:k}){return w=>{var $;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,m)&&j||Ns(w,v)&&(!j||l&&j&&!t)||!i&&w.ctrlKey&&j)return!1;if(!i&&w.type==="touchstart"&&(($=w.touches)==null?void 0:$.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 T=Array.isArray(s)&&s.includes(w.button)||!w.button||w.button<=1;return(!w.ctrlKey||j)&&T}}function mb({domNode:t,minZoom:r,maxZoom:i,translateExtent:s,viewport:l,onPanZoom:c,onPanZoomStart:d,onPanZoomEnd:m,onDraggingChange:v}){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=Zn(t).call(w);K({x:l.x,y:l.y,zoom:Is(l.zoom,r,i)},[[0,0],[k.width,k.height]],s);const C=S.on("wheel.zoom"),j=S.on("dblclick.zoom");w.wheelDelta(C0);function T(H,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)),H)}):Promise.resolve(!1)}function $({noWheelClassName:H,noPanClassName:fe,onPaneContextMenu:xe,userSelectionActive:D,panOnScroll:ue,panOnDrag:G,panOnScrollMode:ie,panOnScrollSpeed:z,preventScrolling:q,zoomOnPinch:F,zoomOnScroll:A,zoomOnDoubleClick:U,zoomActivationKeyPressed:be,lib:Se,onTransformChange:Me,connectionInProgress:$e,paneClickDistance:Ae,selectionOnDrag:_e}){D&&!b.isZoomingOrPanning&&I();const Be=ue&&!be&&!D;w.clickDistance(_e?1/0:!Ar(Ae)||Ae<0?0:Ae);const ke=Be?ub({zoomPanValues:b,noWheelClassName:H,d3Selection:S,d3Zoom:w,panOnScrollMode:ie,panOnScrollSpeed:z,zoomOnPinch:F,onPanZoomStart:d,onPanZoom:c,onPanZoomEnd:m}):cb({noWheelClassName:H,preventScrolling:q,d3ZoomHandler:C});if(S.on("wheel.zoom",ke,{passive:!1}),!D){const Oe=fb({zoomPanValues:b,onDraggingChange:v,onPanZoomStart:d});w.on("start",Oe);const qe=db({zoomPanValues:b,panOnDrag:G,onPaneContextMenu:!!xe,onPanZoom:c,onTransformChange:Me});w.on("zoom",qe);const ut=hb({zoomPanValues:b,panOnDrag:G,panOnScroll:ue,onPaneContextMenu:xe,onPanZoomEnd:m,onDraggingChange:v});w.on("end",ut)}const He=pb({zoomActivationKeyPressed:be,panOnDrag:G,zoomOnScroll:A,panOnScroll:ue,zoomOnDoubleClick:U,zoomOnPinch:F,userSelectionActive:D,noPanClassName:fe,noWheelClassName:H,lib:Se,connectionInProgress:$e});w.filter(He),U?S.on("dblclick.zoom",j):S.on("dblclick.zoom",null)}function I(){w.on("zoom",null)}async function K(H,fe,xe){const D=lf(H),ue=w==null?void 0:w.constrain()(D,fe,xe);return ue&&await T(ue),new Promise(G=>G(ue))}async function P(H,fe){const xe=lf(H);return await T(xe,fe),new Promise(D=>D(xe))}function R(H){if(S){const fe=lf(H),xe=S.property("__zoom");(xe.k!==H.zoom||xe.x!==H.x||xe.y!==H.y)&&(w==null||w.transform(S,fe,null,{sync:!0}))}}function Y(){const H=S?Gm(S.node()):{x:0,y:0,k:1};return{x:H.x,y:H.y,zoom:H.k}}function V(H,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)),H)}):Promise.resolve(!1)}function B(H,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)),H)}):Promise.resolve(!1)}function ae(H){w==null||w.scaleExtent(H)}function de(H){w==null||w.translateExtent(H)}function we(H){const fe=!Ar(H)||H<0?0:H;w==null||w.clickDistance(fe)}return{update:$,destroy:I,setViewport:P,setViewportConstrained:K,getViewport:Y,scaleTo:V,scaleBy:B,setScaleExtent:ae,setTranslateExtent:de,syncViewport:R,setClickDistance:we}}var Os;(function(t){t.Line="line",t.Handle="handle"})(Os||(Os={}));function gb({width:t,prevWidth:r,height:i,prevHeight:s,affectsX:l,affectsY:c}){const d=t-r,m=i-s,v=[d>0?1:d<0?-1:0,m>0?1:m<0?-1:0];return d&&l&&(v[0]=v[0]*-1),m&&c&&(v[1]=v[1]*-1),v}function $p(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 si(t,r){return Math.max(0,r-t)}function ai(t,r){return Math.max(0,t-r)}function Ql(t,r,i){return Math.max(0,r-t,t-i)}function Ap(t,r){return t?!r:r}function yb(t,r,i,s,l,c,d,m){let{affectsX:v,affectsY:b}=r;const{isHorizontal:k,isVertical:w}=r,S=k&&w,{xSnapped:C,ySnapped:j}=i,{minWidth:T,maxWidth:$,minHeight:I,maxHeight:K}=s,{x:P,y:R,width:Y,height:V,aspectRatio:B}=t;let ae=Math.floor(k?C-t.pointerX:0),de=Math.floor(w?j-t.pointerY:0);const we=Y+(v?-ae:ae),H=V+(b?-de:de),fe=-c[0]*Y,xe=-c[1]*V;let D=Ql(we,T,$),ue=Ql(H,I,K);if(d){let z=0,q=0;v&&ae<0?z=si(P+ae+fe,d[0][0]):!v&&ae>0&&(z=ai(P+we+fe,d[1][0])),b&&de<0?q=si(R+de+xe,d[0][1]):!b&&de>0&&(q=ai(R+H+xe,d[1][1])),D=Math.max(D,z),ue=Math.max(ue,q)}if(m){let z=0,q=0;v&&ae>0?z=ai(P+ae,m[0][0]):!v&&ae<0&&(z=si(P+we,m[1][0])),b&&de>0?q=ai(R+de,m[0][1]):!b&&de<0&&(q=si(R+H,m[1][1])),D=Math.max(D,z),ue=Math.max(ue,q)}if(l){if(k){const z=Ql(we/B,I,K)*B;if(D=Math.max(D,z),d){let q=0;!v&&!b||v&&!b&&S?q=ai(R+xe+we/B,d[1][1])*B:q=si(R+xe+(v?ae:-ae)/B,d[0][1])*B,D=Math.max(D,q)}if(m){let q=0;!v&&!b||v&&!b&&S?q=si(R+we/B,m[1][1])*B:q=ai(R+(v?ae:-ae)/B,m[0][1])*B,D=Math.max(D,q)}}if(w){const z=Ql(H*B,T,$)/B;if(ue=Math.max(ue,z),d){let q=0;!v&&!b||b&&!v&&S?q=ai(P+H*B+fe,d[1][0])/B:q=si(P+(b?de:-de)*B+fe,d[0][0])/B,ue=Math.max(ue,q)}if(m){let q=0;!v&&!b||b&&!v&&S?q=si(P+H*B,m[1][0])/B:q=ai(P+(b?de:-de)*B,m[0][0])/B,ue=Math.max(ue,q)}}}de=de+(de<0?ue:-ue),ae=ae+(ae<0?D:-D),l&&(S?we>H*B?de=(Ap(v,b)?-ae:ae)/B:ae=(Ap(v,b)?-de:de)*B:k?(de=ae/B,b=v):(ae=de*B,v=b));const G=v?P+ae:P,ie=b?R+de:R;return{width:Y+(v?-ae:ae),height:V+(b?-de:de),x:c[0]*ae*(v?-1:1)+G,y:c[1]*de*(b?-1:1)+ie}}const j0={width:0,height:0,x:0,y:0},vb={...j0,pointerX:0,pointerY:0,aspectRatio:1};function xb(t){return[[0,0],[t.measured.width,t.measured.height]]}function wb(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,m=i[0]*c,v=i[1]*d;return[[s-m,l-v],[s+c-m,l+d-v]]}function bb({domNode:t,nodeId:r,getStoreItems:i,onChange:s,onEnd:l}){const c=Zn(t);let d={controlDirection:$p("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function m({controlPosition:b,boundaries:k,keepAspectRatio:w,resizeDirection:S,onResizeStart:C,onResize:j,onResizeEnd:T,shouldResize:$}){let I={...j0},K={...vb};d={boundaries:k,resizeDirection:S,keepAspectRatio:w,controlDirection:$p(b)};let P,R=null,Y=[],V,B,ae,de=!1;const we=Dm().on("start",H=>{const{nodeLookup:fe,transform:xe,snapGrid:D,snapToGrid:ue,nodeOrigin:G,paneDomNode:ie}=i();if(P=fe.get(r),!P)return;R=(ie==null?void 0:ie.getBoundingClientRect())??null;const{xSnapped:z,ySnapped:q}=Sa(H.sourceEvent,{transform:xe,snapGrid:D,snapToGrid:ue,containerBounds:R});I={width:P.measured.width??0,height:P.measured.height??0,x:P.position.x??0,y:P.position.y??0},K={...I,pointerX:z,pointerY:q,aspectRatio:I.width/I.height},V=void 0,P.parentId&&(P.extent==="parent"||P.expandParent)&&(V=fe.get(P.parentId),B=V&&P.extent==="parent"?xb(V):void 0),Y=[],ae=void 0;for(const[F,A]of fe)if(A.parentId===r&&(Y.push({id:F,position:{...A.position},extent:A.extent}),A.extent==="parent"||A.expandParent)){const U=wb(A,P,A.origin??G);ae?ae=[[Math.min(U[0][0],ae[0][0]),Math.min(U[0][1],ae[0][1])],[Math.max(U[1][0],ae[1][0]),Math.max(U[1][1],ae[1][1])]]:ae=U}C==null||C(H,{...I})}).on("drag",H=>{const{transform:fe,snapGrid:xe,snapToGrid:D,nodeOrigin:ue}=i(),G=Sa(H.sourceEvent,{transform:fe,snapGrid:xe,snapToGrid:D,containerBounds:R}),ie=[];if(!P)return;const{x:z,y:q,width:F,height:A}=I,U={},be=P.origin??ue,{width:Se,height:Me,x:$e,y:Ae}=yb(K,d.controlDirection,G,d.boundaries,d.keepAspectRatio,be,B,ae),_e=Se!==F,Be=Me!==A,ke=$e!==z&&_e,He=Ae!==q&&Be;if(!ke&&!He&&!_e&&!Be)return;if((ke||He||be[0]===1||be[1]===1)&&(U.x=ke?$e:I.x,U.y=He?Ae:I.y,I.x=U.x,I.y=U.y,Y.length>0)){const ct=$e-z,it=Ae-q;for(const Tt of Y)Tt.position={x:Tt.position.x-ct+be[0]*(Se-F),y:Tt.position.y-it+be[1]*(Me-A)},ie.push(Tt)}if((_e||Be)&&(U.width=_e&&(!d.resizeDirection||d.resizeDirection==="horizontal")?Se:I.width,U.height=Be&&(!d.resizeDirection||d.resizeDirection==="vertical")?Me:I.height,I.width=U.width,I.height=U.height),V&&P.expandParent){const ct=be[0]*(U.width??0);U.x&&U.x<ct&&(I.x=ct,K.x=K.x-(U.x-ct));const it=be[1]*(U.height??0);U.y&&U.y<it&&(I.y=it,K.y=K.y-(U.y-it))}const Oe=gb({width:I.width,prevWidth:F,height:I.height,prevHeight:A,affectsX:d.controlDirection.affectsX,affectsY:d.controlDirection.affectsY}),qe={...I,direction:Oe};($==null?void 0:$(H,qe))!==!1&&(de=!0,j==null||j(H,qe),s(U,ie))}).on("end",H=>{de&&(T==null||T(H,{...I}),l==null||l({...I}),de=!1)});c.call(we)}function v(){c.on(".drag",null)}return{update:m,destroy:v}}var cf={exports:{}},ff={},df={exports:{}},hf={};/**
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 Op;function _b(){if(Op)return hf;Op=1;var t=$a();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 m(w,S){var C=S(),j=s({inst:{value:C,getSnapshot:S}}),T=j[0].inst,$=j[1];return c(function(){T.value=C,T.getSnapshot=S,v(T)&&$({inst:T})},[w,C,S]),l(function(){return v(T)&&$({inst:T}),w(function(){v(T)&&$({inst:T})})},[w]),d(C),C}function v(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:m;return hf.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:k,hf}var Rp;function Sb(){return Rp||(Rp=1,df.exports=_b()),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 Dp;function kb(){if(Dp)return ff;Dp=1;var t=$a(),r=Sb();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,m=t.useMemo,v=t.useDebugValue;return ff.useSyncExternalStoreWithSelector=function(b,k,w,S,C){var j=c(null);if(j.current===null){var T={hasValue:!1,value:null};j.current=T}else T=j.current;j=m(function(){function I(V){if(!K){if(K=!0,P=V,V=S(V),C!==void 0&&T.hasValue){var B=T.value;if(C(B,V))return R=B}return R=V}if(B=R,s(P,V))return B;var ae=S(V);return C!==void 0&&C(B,ae)?(P=V,B):(P=V,R=ae)}var K=!1,P,R,Y=w===void 0?null:w;return[function(){return I(k())},Y===null?void 0:function(){return I(Y())}]},[k,w,S,C]);var $=l(b,j[0],j[1]);return d(function(){T.hasValue=!0,T.value=$},[$]),v($),$},ff}var Lp;function Nb(){return Lp||(Lp=1,cf.exports=kb()),cf.exports}var Eb=Nb();const Cb=wu(Eb),jb={},zp=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,v={setState:s,getState:l,getInitialState:()=>b,subscribe:k=>(i.add(k),()=>i.delete(k)),destroy:()=>{(jb?"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,v);return v},Pb=t=>t?zp(t):zp,{useDebugValue:Mb}=gm,{useSyncExternalStoreWithSelector:Tb}=Cb,Ib=t=>t;function P0(t,r=Ib,i){const s=Tb(t.subscribe,t.getState,t.getServerState||t.getInitialState,r,i);return Mb(s),s}const Fp=(t,r)=>{const i=Pb(t),s=(l,c=r)=>P0(i,l,c);return Object.assign(s,i),s},$b=(t,r)=>t?Fp(t,r):Fp;function At(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 Iu=Q.createContext(null),Ab=Iu.Provider,M0=Qr.error001();function mt(t,r){const i=Q.useContext(Iu);if(i===null)throw new Error(M0);return P0(i,t,r)}function Mt(){const t=Q.useContext(Iu);if(t===null)throw new Error(M0);return Q.useMemo(()=>({getState:t.getState,setState:t.setState,subscribe:t.subscribe}),[t])}const Bp={display:"none"},Ob={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},T0="react-flow__node-desc",I0="react-flow__edge-desc",Rb="react-flow__aria-live",Db=t=>t.ariaLiveMessage,Lb=t=>t.ariaLabelConfig;function zb({rfId:t}){const r=mt(Db);return x.jsx("div",{id:`${Rb}-${t}`,"aria-live":"assertive","aria-atomic":"true",style:Ob,children:r})}function Fb({rfId:t,disableKeyboardA11y:r}){const i=mt(Lb);return x.jsxs(x.Fragment,{children:[x.jsx("div",{id:`${T0}-${t}`,style:Bp,children:r?i["node.a11yDescription.default"]:i["node.a11yDescription.keyboardDisabled"]}),x.jsx("div",{id:`${I0}-${t}`,style:Bp,children:i["edge.a11yDescription.default"]}),!r&&x.jsx(zb,{rfId:t})]})}const Fa=Q.forwardRef(({position:t="top-left",children:r,className:i,style:s,...l},c)=>{const d=`${t}`.split("-");return x.jsx("div",{className:Wt(["react-flow__panel",i,...d]),style:s,ref:c,...l,children:r})});Fa.displayName="Panel";function Bb({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 Hb=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 Vb(t,r){return At(t.selectedNodes.map(Gl),r.selectedNodes.map(Gl))&&At(t.selectedEdges.map(Gl),r.selectedEdges.map(Gl))}function Kb({onSelectionChange:t}){const r=Mt(),{selectedNodes:i,selectedEdges:s}=mt(Hb,Vb);return Q.useEffect(()=>{const l={nodes:i,edges:s};t==null||t(l),r.getState().onSelectionChangeHandlers.forEach(c=>c(l))},[i,s,t]),null}const Ub=t=>!!t.onSelectionChangeHandlers;function qb({onSelectionChange:t}){const r=mt(Ub);return t||r?x.jsx(Kb,{onSelectionChange:t}):null}const Af=typeof window<"u"?Q.useLayoutEffect:Q.useEffect,$0=[0,0],Wb={x:0,y:0,zoom:1},Yb=["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"],Hp=[...Yb,"rfId"],Xb=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}),Vp={translateExtent:ja,nodeOrigin:$0,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function Qb(t){const{setNodes:r,setEdges:i,setMinZoom:s,setMaxZoom:l,setTranslateExtent:c,setNodeExtent:d,reset:m,setDefaultNodesAndEdges:v}=mt(Xb,At),b=Mt();Af(()=>(v(t.defaultNodes,t.defaultEdges),()=>{k.current=Vp,m()}),[]);const k=Q.useRef(Vp);return Af(()=>{for(const w of Hp){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:A1(S)}):w==="fitView"?b.setState({fitViewQueued:S}):w==="fitViewOptions"?b.setState({fitViewOptions:S}):b.setState({[w]:S})))}k.current=t},Hp.map(w=>t[w])),null}function Kp(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function Gb(t){var s;const[r,i]=Q.useState(t==="system"?null:t);return Q.useEffect(()=>{if(t!=="system"){i(t);return}const l=Kp(),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=Kp())!=null&&s.matches?"dark":"light"}const Up=typeof document<"u"?document:null;function Ia(t=null,r={target:Up,actInsideInputWithModifier:!0}){const[i,s]=Q.useState(!1),l=Q.useRef(!1),c=Q.useRef(new Set([])),[d,m]=Q.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 Q.useEffect(()=>{const v=(r==null?void 0:r.target)??Up,b=(r==null?void 0:r.actInsideInputWithModifier)??!0;if(t!==null){const k=C=>{var $,I;if(l.current=C.ctrlKey||C.metaKey||C.shiftKey||C.altKey,(!l.current||l.current&&!b)&&f0(C))return!1;const T=Wp(C.code,m);if(c.current.add(C[T]),qp(d,c.current,!1)){const K=((I=($=C.composedPath)==null?void 0:$.call(C))==null?void 0:I[0])||C.target,P=(K==null?void 0:K.nodeName)==="BUTTON"||(K==null?void 0:K.nodeName)==="A";r.preventDefault!==!1&&(l.current||!P)&&C.preventDefault(),s(!0)}},w=C=>{const j=Wp(C.code,m);qp(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 v==null||v.addEventListener("keydown",k),v==null||v.addEventListener("keyup",w),window.addEventListener("blur",S),window.addEventListener("contextmenu",S),()=>{v==null||v.removeEventListener("keydown",k),v==null||v.removeEventListener("keyup",w),window.removeEventListener("blur",S),window.removeEventListener("contextmenu",S)}}},[t,s]),i}function qp(t,r,i){return t.filter(s=>i||s.length===r.size).some(s=>s.every(l=>r.has(l)))}function Wp(t,r){return r.includes(t)?"code":"key"}const Jb=()=>{const t=Mt();return Q.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:m}=t.getState(),v=qf(r,s,l,c,d,(i==null?void 0:i.padding)??.1);return m?(await m.setViewport(v,{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:m,y:v}=d.getBoundingClientRect(),b={x:r.x-m,y:r.y-v},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 A0(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 m={...c};for(const v of d)Zb(v,m);i.push(m)}return l.length&&l.forEach(c=>{c.index!==void 0?i.splice(c.index,0,{...c.item}):i.push({...c.item})}),i}function Zb(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 O0(t,r){return A0(t,r)}function R0(t,r){return A0(t,r)}function $i(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($i(c.id,d)))}return s}function Yp({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 m=r.get(d.id),v=((l=m==null?void 0:m.internals)==null?void 0:l.userNode)??m;v!==void 0&&v!==d&&i.push({id:d.id,item:d,type:"replace"}),v===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 Xp(t){return{id:t.id,type:"remove"}}const Qp=t=>k1(t),e_=t=>r0(t);function D0(t){return Q.forwardRef(t)}function Gp(t){const[r,i]=Q.useState(BigInt(0)),[s]=Q.useState(()=>t_(()=>i(l=>l+BigInt(1))));return Af(()=>{const l=s.get();l.length&&(t(l),s.reset())},[r]),s}function t_(t){let r=[];return{get:()=>r,reset:()=>{r=[]},push:i=>{r.push(i),t()}}}const L0=Q.createContext(null);function n_({children:t}){const r=Mt(),i=Q.useCallback(m=>{const{nodes:v=[],setNodes:b,hasDefaultNodes:k,onNodesChange:w,nodeLookup:S,fitViewQueued:C,onNodesChangeMiddlewareMap:j}=r.getState();let T=v;for(const I of m)T=typeof I=="function"?I(T):I;let $=Yp({items:T,lookup:S});for(const I of j.values())$=I($);k&&b(T),$.length>0?w==null||w($):C&&window.requestAnimationFrame(()=>{const{fitViewQueued:I,nodes:K,setNodes:P}=r.getState();I&&P(K)})},[]),s=Gp(i),l=Q.useCallback(m=>{const{edges:v=[],setEdges:b,hasDefaultEdges:k,onEdgesChange:w,edgeLookup:S}=r.getState();let C=v;for(const j of m)C=typeof j=="function"?j(C):j;k?b(C):w&&w(Yp({items:C,lookup:S}))},[]),c=Gp(l),d=Q.useMemo(()=>({nodeQueue:s,edgeQueue:c}),[]);return x.jsx(L0.Provider,{value:d,children:t})}function r_(){const t=Q.useContext(L0);if(!t)throw new Error("useBatchContext must be used within a BatchProvider");return t}const o_=t=>!!t.panZoom;function Zf(){const t=Jb(),r=Mt(),i=r_(),s=mt(o_),l=Q.useMemo(()=>{const c=w=>r.getState().nodeLookup.get(w),d=w=>{i.nodeQueue.push(w)},m=w=>{i.edgeQueue.push(w)},v=w=>{var I,K;const{nodeLookup:S,nodeOrigin:C}=r.getState(),j=Qp(w)?w:S.get(w.id),T=j.parentId?u0(j.position,j.measured,j.parentId,S,C):j.position,$={...j,position:T,width:((I=j.measured)==null?void 0:I.width)??j.width,height:((K=j.measured)==null?void 0:K.height)??j.height};return $s($)},b=(w,S,C={replace:!1})=>{d(j=>j.map(T=>{if(T.id===w){const $=typeof S=="function"?S(T):S;return C.replace&&Qp($)?$:{...T,...$}}return T}))},k=(w,S,C={replace:!1})=>{m(j=>j.map(T=>{if(T.id===w){const $=typeof S=="function"?S(T):S;return C.replace&&e_($)?$:{...T,...$}}return T}))};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:m,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:T,zoom:$}}},deleteElements:async({nodes:w=[],edges:S=[]})=>{const{nodes:C,edges:j,onNodesDelete:T,onEdgesDelete:$,triggerNodeChanges:I,triggerEdgeChanges:K,onDelete:P,onBeforeDelete:R}=r.getState(),{nodes:Y,edges:V}=await P1({nodesToRemove:w,edgesToRemove:S,nodes:C,edges:j,onBeforeDelete:R}),B=V.length>0,ae=Y.length>0;if(B){const de=V.map(Xp);$==null||$(V),K(de)}if(ae){const de=Y.map(Xp);T==null||T(Y),I(de)}return(ae||B)&&(P==null||P({nodes:Y,edges:V})),{deletedNodes:Y,deletedEdges:V}},getIntersectingNodes:(w,S=!0,C)=>{const j=_p(w),T=j?w:v(w),$=C!==void 0;return T?(C||r.getState().nodes).filter(I=>{const K=r.getState().nodeLookup.get(I.id);if(K&&!j&&(I.id===w.id||!K.internals.positionAbsolute))return!1;const P=$s($?I:K),R=Ma(P,T);return S&&R>0||R>=P.width*P.height||R>=T.width*T.height}):[]},isNodeIntersecting:(w,S,C=!0)=>{const T=_p(w)?w:v(w);if(!T)return!1;const $=Ma(T,S);return C&&$>0||$>=S.width*S.height||$>=T.width*T.height},updateNode:b,updateNodeData:(w,S,C={replace:!1})=>{b(w,j=>{const T=typeof S=="function"?S(j):S;return C.replace?{...j,data:T}:{...j,data:{...j.data,...T}}},C)},updateEdge:k,updateEdgeData:(w,S,C={replace:!1})=>{k(w,j=>{const T=typeof S=="function"?S(j):S;return C.replace?{...j,data:T}:{...j,data:{...j.data,...T}}},C)},getNodesBounds:w=>{const{nodeLookup:S,nodeOrigin:C}=r.getState();return N1(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??$1();return r.setState({fitViewQueued:!0,fitViewOptions:w,fitViewResolver:S}),i.nodeQueue.push(C=>[...C]),S.promise}}},[]);return Q.useMemo(()=>({...l,...t,viewportInitialized:s}),[s])}const Jp=t=>t.selected,i_=typeof window<"u"?window:void 0;function s_({deleteKeyCode:t,multiSelectionKeyCode:r}){const i=Mt(),{deleteElements:s}=Zf(),l=Ia(t,{actInsideInputWithModifier:!1}),c=Ia(r,{target:i_});Q.useEffect(()=>{if(l){const{edges:d,nodes:m}=i.getState();s({nodes:m.filter(Jp),edges:d.filter(Jp)}),i.setState({nodesSelectionActive:!1})}},[l]),Q.useEffect(()=>{i.setState({multiSelectionActive:c})},[c])}function a_(t){const r=Mt();Q.useEffect(()=>{const i=()=>{var l,c,d,m;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)&&((m=(d=r.getState()).onError)==null||m.call(d,"004",Qr.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 $u={position:"absolute",width:"100%",height:"100%",top:0,left:0},l_=t=>({userSelectionActive:t.userSelectionActive,lib:t.lib,connectionInProgress:t.connection.inProgress});function u_({onPaneContextMenu:t,zoomOnScroll:r=!0,zoomOnPinch:i=!0,panOnScroll:s=!1,panOnScrollSpeed:l=.5,panOnScrollMode:c=Ri.Free,zoomOnDoubleClick:d=!0,panOnDrag:m=!0,defaultViewport:v,translateExtent:b,minZoom:k,maxZoom:w,zoomActivationKeyCode:S,preventScrolling:C=!0,children:j,noWheelClassName:T,noPanClassName:$,onViewportChange:I,isControlledViewport:K,paneClickDistance:P,selectionOnDrag:R}){const Y=Mt(),V=Q.useRef(null),{userSelectionActive:B,lib:ae,connectionInProgress:de}=mt(l_,At),we=Ia(S),H=Q.useRef();a_(V);const fe=Q.useCallback(xe=>{I==null||I({x:xe[0],y:xe[1],zoom:xe[2]}),K||Y.setState({transform:xe})},[I,K]);return Q.useEffect(()=>{if(V.current){H.current=mb({domNode:V.current,minZoom:k,maxZoom:w,translateExtent:b,viewport:v,onDraggingChange:G=>Y.setState(ie=>ie.paneDragging===G?ie:{paneDragging:G}),onPanZoomStart:(G,ie)=>{const{onViewportChangeStart:z,onMoveStart:q}=Y.getState();q==null||q(G,ie),z==null||z(ie)},onPanZoom:(G,ie)=>{const{onViewportChange:z,onMove:q}=Y.getState();q==null||q(G,ie),z==null||z(ie)},onPanZoomEnd:(G,ie)=>{const{onViewportChangeEnd:z,onMoveEnd:q}=Y.getState();q==null||q(G,ie),z==null||z(ie)}});const{x:xe,y:D,zoom:ue}=H.current.getViewport();return Y.setState({panZoom:H.current,transform:[xe,D,ue],domNode:V.current.closest(".react-flow")}),()=>{var G;(G=H.current)==null||G.destroy()}}},[]),Q.useEffect(()=>{var xe;(xe=H.current)==null||xe.update({onPaneContextMenu:t,zoomOnScroll:r,zoomOnPinch:i,panOnScroll:s,panOnScrollSpeed:l,panOnScrollMode:c,zoomOnDoubleClick:d,panOnDrag:m,zoomActivationKeyPressed:we,preventScrolling:C,noPanClassName:$,userSelectionActive:B,noWheelClassName:T,lib:ae,onTransformChange:fe,connectionInProgress:de,selectionOnDrag:R,paneClickDistance:P})},[t,r,i,s,l,c,d,m,we,C,$,B,T,ae,fe,de,R,P]),x.jsx("div",{className:"react-flow__renderer",ref:V,style:$u,children:j})}const c_=t=>({userSelectionActive:t.userSelectionActive,userSelectionRect:t.userSelectionRect});function f_(){const{userSelectionActive:t,userSelectionRect:r}=mt(c_,At);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 pf=(t,r)=>i=>{i.target===r.current&&(t==null||t(i))},d_=t=>({userSelectionActive:t.userSelectionActive,elementsSelectable:t.elementsSelectable,connectionInProgress:t.connection.inProgress,dragging:t.paneDragging});function h_({isSelecting:t,selectionKeyPressed:r,selectionMode:i=Pa.Full,panOnDrag:s,paneClickDistance:l,selectionOnDrag:c,onSelectionStart:d,onSelectionEnd:m,onPaneClick:v,onPaneContextMenu:b,onPaneScroll:k,onPaneMouseEnter:w,onPaneMouseMove:S,onPaneMouseLeave:C,children:j}){const T=Mt(),{userSelectionActive:$,elementsSelectable:I,dragging:K,connectionInProgress:P}=mt(d_,At),R=I&&(t||$),Y=Q.useRef(null),V=Q.useRef(),B=Q.useRef(new Set),ae=Q.useRef(new Set),de=Q.useRef(!1),we=z=>{if(de.current||P){de.current=!1;return}v==null||v(z),T.getState().resetSelectedElements(),T.setState({nodesSelectionActive:!1})},H=z=>{if(Array.isArray(s)&&(s!=null&&s.includes(2))){z.preventDefault();return}b==null||b(z)},fe=k?z=>k(z):void 0,xe=z=>{de.current&&(z.stopPropagation(),de.current=!1)},D=z=>{var Me,$e;const{domNode:q}=T.getState();if(V.current=q==null?void 0:q.getBoundingClientRect(),!V.current)return;const F=z.target===Y.current;if(!F&&!!z.target.closest(".nokey")||!t||!(c&&F||r)||z.button!==0||!z.isPrimary)return;($e=(Me=z.target)==null?void 0:Me.setPointerCapture)==null||$e.call(Me,z.pointerId),de.current=!1;const{x:be,y:Se}=Or(z.nativeEvent,V.current);T.setState({userSelectionRect:{width:0,height:0,startX:be,startY:Se,x:be,y:Se}}),F||(z.stopPropagation(),z.preventDefault())},ue=z=>{const{userSelectionRect:q,transform:F,nodeLookup:A,edgeLookup:U,connectionLookup:be,triggerNodeChanges:Se,triggerEdgeChanges:Me,defaultEdgeOptions:$e,resetSelectedElements:Ae}=T.getState();if(!V.current||!q)return;const{x:_e,y:Be}=Or(z.nativeEvent,V.current),{startX:ke,startY:He}=q;if(!de.current){const it=r?0:l;if(Math.hypot(_e-ke,Be-He)<=it)return;Ae(),d==null||d(z)}de.current=!0;const Oe={startX:ke,startY:He,x:_e<ke?_e:ke,y:Be<He?Be:He,width:Math.abs(_e-ke),height:Math.abs(Be-He)},qe=B.current,ut=ae.current;B.current=new Set(Uf(A,Oe,F,i===Pa.Partial,!0).map(it=>it.id)),ae.current=new Set;const ct=($e==null?void 0:$e.selectable)??!0;for(const it of B.current){const Tt=be.get(it);if(Tt)for(const{edgeId:_t}of Tt.values()){const Ht=U.get(_t);Ht&&(Ht.selectable??ct)&&ae.current.add(_t)}}if(!Sp(qe,B.current)){const it=Es(A,B.current,!0);Se(it)}if(!Sp(ut,ae.current)){const it=Es(U,ae.current);Me(it)}T.setState({userSelectionRect:Oe,userSelectionActive:!0,nodesSelectionActive:!1})},G=z=>{var q,F;z.button===0&&((F=(q=z.target)==null?void 0:q.releasePointerCapture)==null||F.call(q,z.pointerId),!$&&z.target===Y.current&&T.getState().userSelectionRect&&(we==null||we(z)),T.setState({userSelectionActive:!1,userSelectionRect:null}),de.current&&(m==null||m(z),T.setState({nodesSelectionActive:B.current.size>0})))},ie=s===!0||Array.isArray(s)&&s.includes(0);return x.jsxs("div",{className:Wt(["react-flow__pane",{draggable:ie,dragging:K,selection:t}]),onClick:R?void 0:pf(we,Y),onContextMenu:pf(H,Y),onWheel:pf(fe,Y),onPointerEnter:R?void 0:w,onPointerMove:R?ue:S,onPointerUp:R?G:void 0,onPointerDownCapture:R?D:void 0,onClickCapture:R?xe:void 0,onPointerLeave:C,ref:Y,style:$u,children:[j,x.jsx(f_,{})]})}function Of({id:t,store:r,unselect:i=!1,nodeRef:s}){const{addSelectedNodes:l,unselectNodesAndEdges:c,multiSelectionActive:d,nodeLookup:m,onError:v}=r.getState(),b=m.get(t);if(!b){v==null||v("012",Qr.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 z0({nodeRef:t,disabled:r=!1,noDragClassName:i,handleSelector:s,nodeId:l,isSelectable:c,nodeClickDistance:d}){const m=Mt(),[v,b]=Q.useState(!1),k=Q.useRef();return Q.useEffect(()=>{k.current=tb({getStoreItems:()=>m.getState(),onNodeMouseDown:w=>{Of({id:w,store:m,nodeRef:t})},onDragStart:()=>{b(!0)},onDragStop:()=>{b(!1)}})},[]),Q.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]),v}const p_=t=>r=>r.selected&&(r.draggable||t&&typeof r.draggable>"u");function F0(){const t=Mt();return Q.useCallback(i=>{const{nodeExtent:s,snapToGrid:l,snapGrid:c,nodesDraggable:d,onError:m,updateNodePositions:v,nodeLookup:b,nodeOrigin:k}=t.getState(),w=new Map,S=p_(d),C=l?c[0]:5,j=l?c[1]:5,T=i.direction.x*C*i.factor,$=i.direction.y*j*i.factor;for(const[,I]of b){if(!S(I))continue;let K={x:I.internals.positionAbsolute.x+T,y:I.internals.positionAbsolute.y+$};l&&(K=La(K,c));const{position:P,positionAbsolute:R}=o0({nodeId:I.id,nextPosition:K,nodeLookup:b,nodeExtent:s,nodeOrigin:k,onError:m});I.position=P,I.internals.positionAbsolute=R,w.set(I.id,I)}v(w)},[])}const ed=Q.createContext(null),m_=ed.Provider;ed.Consumer;const B0=()=>Q.useContext(ed),g_=t=>({connectOnClick:t.connectOnClick,noPanClassName:t.noPanClassName,rfId:t.rfId}),y_=(t,r,i)=>s=>{const{connectionClickStartHandle:l,connectionMode:c,connection:d}=s,{fromHandle:m,toHandle:v,isValid:b}=d,k=(v==null?void 0:v.nodeId)===t&&(v==null?void 0:v.id)===r&&(v==null?void 0:v.type)===i;return{connectingFrom:(m==null?void 0:m.nodeId)===t&&(m==null?void 0:m.id)===r&&(m==null?void 0:m.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===Ts.Strict?(m==null?void 0:m.type)!==i:t!==(m==null?void 0:m.nodeId)||r!==(m==null?void 0:m.id),connectionInProcess:!!m,clickConnectionInProcess:!!l,valid:k&&b}};function v_({type:t="source",position:r=Ze.Top,isValidConnection:i,isConnectable:s=!0,isConnectableStart:l=!0,isConnectableEnd:c=!0,id:d,onConnect:m,children:v,className:b,onMouseDown:k,onTouchStart:w,...S},C){var ue,G;const j=d||null,T=t==="target",$=Mt(),I=B0(),{connectOnClick:K,noPanClassName:P,rfId:R}=mt(g_,At),{connectingFrom:Y,connectingTo:V,clickConnecting:B,isPossibleEndHandle:ae,connectionInProcess:de,clickConnectionInProcess:we,valid:H}=mt(y_(I,j,t),At);I||(G=(ue=$.getState()).onError)==null||G.call(ue,"010",Qr.error010());const fe=ie=>{const{defaultEdgeOptions:z,onConnect:q,hasDefaultEdges:F}=$.getState(),A={...z,...ie};if(F){const{edges:U,setEdges:be}=$.getState();be(g0(A,U))}q==null||q(A),m==null||m(A)},xe=ie=>{if(!I)return;const z=d0(ie.nativeEvent);if(l&&(z&&ie.button===0||!z)){const q=$.getState();$f.onPointerDown(ie.nativeEvent,{handleDomNode:ie.currentTarget,autoPanOnConnect:q.autoPanOnConnect,connectionMode:q.connectionMode,connectionRadius:q.connectionRadius,domNode:q.domNode,nodeLookup:q.nodeLookup,lib:q.lib,isTarget:T,handleId:j,nodeId:I,flowId:q.rfId,panBy:q.panBy,cancelConnection:q.cancelConnection,onConnectStart:q.onConnectStart,onConnectEnd:(...F)=>{var A,U;return(U=(A=$.getState()).onConnectEnd)==null?void 0:U.call(A,...F)},updateConnection:q.updateConnection,onConnect:fe,isValidConnection:i||((...F)=>{var A,U;return((U=(A=$.getState()).isValidConnection)==null?void 0:U.call(A,...F))??!0}),getTransform:()=>$.getState().transform,getFromHandle:()=>$.getState().connection.fromHandle,autoPanSpeed:q.autoPanSpeed,dragThreshold:q.connectionDragThreshold})}z?k==null||k(ie):w==null||w(ie)},D=ie=>{const{onClickConnectStart:z,onClickConnectEnd:q,connectionClickStartHandle:F,connectionMode:A,isValidConnection:U,lib:be,rfId:Se,nodeLookup:Me,connection:$e}=$.getState();if(!I||!F&&!l)return;if(!F){z==null||z(ie.nativeEvent,{nodeId:I,handleId:j,handleType:t}),$.setState({connectionClickStartHandle:{nodeId:I,type:t,id:j}});return}const Ae=c0(ie.target),_e=i||U,{connection:Be,isValid:ke}=$f.isValid(ie.nativeEvent,{handle:{nodeId:I,id:j,type:t},connectionMode:A,fromNodeId:F.nodeId,fromHandleId:F.id||null,fromType:F.type,isValidConnection:_e,flowId:Se,doc:Ae,lib:be,nodeLookup:Me});ke&&Be&&fe(Be);const He=structuredClone($e);delete He.inProgress,He.toPosition=He.toHandle?He.toHandle.position:null,q==null||q(ie,He),$.setState({connectionClickStartHandle:null})};return x.jsx("div",{"data-handleid":j,"data-nodeid":I,"data-handlepos":r,"data-id":`${R}-${I}-${j}-${t}`,className:Wt(["react-flow__handle",`react-flow__handle-${r}`,"nodrag",P,b,{source:!T,target:T,connectable:s,connectablestart:l,connectableend:c,clickconnecting:B,connectingfrom:Y,connectingto:V,valid:H,connectionindicator:s&&(!de||ae)&&(de||we?c:l)}]),onMouseDown:xe,onTouchStart:xe,onClick:K?D:void 0,ref:C,...S,children:v})}const Rs=Q.memo(D0(v_));function x_({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 w_({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 b_(){return null}function __({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}},Zp={input:x_,default:w_,output:__,group:b_};function S_(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 k_=t=>{const{width:r,height:i,x:s,y:l}=Da(t.nodeLookup,{filter:c=>!!c.selected});return{width:Ar(r)?r:null,height:Ar(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 N_({onSelectionContextMenu:t,noPanClassName:r,disableKeyboardA11y:i}){const s=Mt(),{width:l,height:c,transformString:d,userSelectionActive:m}=mt(k_,At),v=F0(),b=Q.useRef(null);Q.useEffect(()=>{var C;i||(C=b.current)==null||C.focus({preventScroll:!0})},[i]);const k=!m&&l!==null&&c!==null;if(z0({nodeRef:b,disabled:!k}),!k)return null;const w=t?C=>{const j=s.getState().nodes.filter(T=>T.selected);t(C,j)}:void 0,S=C=>{Object.prototype.hasOwnProperty.call(xu,C.key)&&(C.preventDefault(),v({direction:xu[C.key],factor:C.shiftKey?4:1}))};return x.jsx("div",{className:Wt(["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,E_=t=>({nodesSelectionActive:t.nodesSelectionActive,userSelectionActive:t.userSelectionActive});function H0({children:t,onPaneClick:r,onPaneMouseEnter:i,onPaneMouseMove:s,onPaneMouseLeave:l,onPaneContextMenu:c,onPaneScroll:d,paneClickDistance:m,deleteKeyCode:v,selectionKeyCode:b,selectionOnDrag:k,selectionMode:w,onSelectionStart:S,onSelectionEnd:C,multiSelectionKeyCode:j,panActivationKeyCode:T,zoomActivationKeyCode:$,elementsSelectable:I,zoomOnScroll:K,zoomOnPinch:P,panOnScroll:R,panOnScrollSpeed:Y,panOnScrollMode:V,zoomOnDoubleClick:B,panOnDrag:ae,defaultViewport:de,translateExtent:we,minZoom:H,maxZoom:fe,preventScrolling:xe,onSelectionContextMenu:D,noWheelClassName:ue,noPanClassName:G,disableKeyboardA11y:ie,onViewportChange:z,isControlledViewport:q}){const{nodesSelectionActive:F,userSelectionActive:A}=mt(E_,At),U=Ia(b,{target:em}),be=Ia(T,{target:em}),Se=be||ae,Me=be||R,$e=k&&Se!==!0,Ae=U||A||$e;return s_({deleteKeyCode:v,multiSelectionKeyCode:j}),x.jsx(u_,{onPaneContextMenu:c,elementsSelectable:I,zoomOnScroll:K,zoomOnPinch:P,panOnScroll:Me,panOnScrollSpeed:Y,panOnScrollMode:V,zoomOnDoubleClick:B,panOnDrag:!U&&Se,defaultViewport:de,translateExtent:we,minZoom:H,maxZoom:fe,zoomActivationKeyCode:$,preventScrolling:xe,noWheelClassName:ue,noPanClassName:G,onViewportChange:z,isControlledViewport:q,paneClickDistance:m,selectionOnDrag:$e,children:x.jsxs(h_,{onSelectionStart:S,onSelectionEnd:C,onPaneClick:r,onPaneMouseEnter:i,onPaneMouseMove:s,onPaneMouseLeave:l,onPaneContextMenu:c,onPaneScroll:d,panOnDrag:Se,isSelecting:!!Ae,selectionMode:w,selectionKeyPressed:U,paneClickDistance:m,selectionOnDrag:$e,children:[t,F&&x.jsx(N_,{onSelectionContextMenu:D,noPanClassName:G,disableKeyboardA11y:ie})]})})}H0.displayName="FlowRenderer";const C_=Q.memo(H0),j_=t=>r=>t?Uf(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 P_(t){return mt(Q.useCallback(j_(t),[t]),At)}const M_=t=>t.updateNodeInternals;function T_(){const t=mt(M_),[r]=Q.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 Q.useEffect(()=>()=>{r==null||r.disconnect()},[r]),r}function I_({node:t,nodeType:r,hasDimensions:i,resizeObserver:s}){const l=Mt(),c=Q.useRef(null),d=Q.useRef(null),m=Q.useRef(t.sourcePosition),v=Q.useRef(t.targetPosition),b=Q.useRef(r),k=i&&!!t.internals.handleBounds;return Q.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]),Q.useEffect(()=>()=>{d.current&&(s==null||s.unobserve(d.current),d.current=null)},[]),Q.useEffect(()=>{if(c.current){const w=b.current!==r,S=m.current!==t.sourcePosition,C=v.current!==t.targetPosition;(w||S||C)&&(b.current=r,m.current=t.sourcePosition,v.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 $_({id:t,onClick:r,onMouseEnter:i,onMouseMove:s,onMouseLeave:l,onContextMenu:c,onDoubleClick:d,nodesDraggable:m,elementsSelectable:v,nodesConnectable:b,nodesFocusable:k,resizeObserver:w,noDragClassName:S,noPanClassName:C,disableKeyboardA11y:j,rfId:T,nodeTypes:$,nodeClickDistance:I,onError:K}){const{node:P,internals:R,isParent:Y}=mt(_e=>{const Be=_e.nodeLookup.get(t),ke=_e.parentLookup.has(t);return{node:Be,internals:Be.internals,isParent:ke}},At);let V=P.type||"default",B=($==null?void 0:$[V])||Zp[V];B===void 0&&(K==null||K("003",Qr.error003(V)),V="default",B=($==null?void 0:$.default)||Zp.default);const ae=!!(P.draggable||m&&typeof P.draggable>"u"),de=!!(P.selectable||v&&typeof P.selectable>"u"),we=!!(P.connectable||b&&typeof P.connectable>"u"),H=!!(P.focusable||k&&typeof P.focusable>"u"),fe=Mt(),xe=l0(P),D=I_({node:P,nodeType:V,hasDimensions:xe,resizeObserver:w}),ue=z0({nodeRef:D,disabled:P.hidden||!ae,noDragClassName:S,handleSelector:P.dragHandle,nodeId:t,isSelectable:de,nodeClickDistance:I}),G=F0();if(P.hidden)return null;const ie=To(P),z=S_(P),q=de||ae||r||i||s||l,F=i?_e=>i(_e,{...R.userNode}):void 0,A=s?_e=>s(_e,{...R.userNode}):void 0,U=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:Be,nodeDragThreshold:ke}=fe.getState();de&&(!Be||!ae||ke>0)&&Of({id:t,store:fe,nodeRef:D}),r&&r(_e,{...R.userNode})},$e=_e=>{if(!(f0(_e.nativeEvent)||j)){if(Zm.includes(_e.key)&&de){const Be=_e.key==="Escape";Of({id:t,store:fe,unselect:Be,nodeRef:D})}else if(ae&&P.selected&&Object.prototype.hasOwnProperty.call(xu,_e.key)){_e.preventDefault();const{ariaLabelConfig:Be}=fe.getState();fe.setState({ariaLiveMessage:Be["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 ut;if(j||!((ut=D.current)!=null&&ut.matches(":focus-visible")))return;const{transform:_e,width:Be,height:ke,autoPanOnNodeFocus:He,setCenter:Oe}=fe.getState();if(!He)return;Uf(new Map([[t,P]]),{x:0,y:0,width:Be,height:ke},_e,!0).length>0||Oe(P.position.x+ie.width/2,P.position.y+ie.height/2,{zoom:_e[2]})};return x.jsx("div",{className:Wt(["react-flow__node",`react-flow__node-${V}`,{[C]:ae},P.className,{selected:P.selected,selectable:de,parent:Y,draggable:ae,dragging:ue}]),ref:D,style:{zIndex:R.z,transform:`translate(${R.positionAbsolute.x}px,${R.positionAbsolute.y}px)`,pointerEvents:q?"all":"none",visibility:xe?"visible":"hidden",...P.style,...z},"data-id":t,"data-testid":`rf__node-${t}`,onMouseEnter:F,onMouseMove:A,onMouseLeave:U,onContextMenu:be,onClick:Me,onDoubleClick:Se,onKeyDown:H?$e:void 0,tabIndex:H?0:void 0,onFocus:H?Ae:void 0,role:P.ariaRole??(H?"group":void 0),"aria-roledescription":"node","aria-describedby":j?void 0:`${T0}-${T}`,"aria-label":P.ariaLabel,...P.domAttributes,children:x.jsx(m_,{value:t,children:x.jsx(B,{id:t,data:P.data,type:V,positionAbsoluteX:R.positionAbsolute.x,positionAbsoluteY:R.positionAbsolute.y,selected:P.selected??!1,selectable:de,draggable:ae,deletable:P.deletable??!0,isConnectable:we,sourcePosition:P.sourcePosition,targetPosition:P.targetPosition,dragging:ue,dragHandle:P.dragHandle,zIndex:R.z,parentId:P.parentId,...ie})})})}var A_=Q.memo($_);const O_=t=>({nodesDraggable:t.nodesDraggable,nodesConnectable:t.nodesConnectable,nodesFocusable:t.nodesFocusable,elementsSelectable:t.elementsSelectable,onError:t.onError});function V0(t){const{nodesDraggable:r,nodesConnectable:i,nodesFocusable:s,elementsSelectable:l,onError:c}=mt(O_,At),d=P_(t.onlyRenderVisibleElements),m=T_();return x.jsx("div",{className:"react-flow__nodes",style:$u,children:d.map(v=>x.jsx(A_,{id:v,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:m,nodesDraggable:r,nodesConnectable:i,nodesFocusable:s,elementsSelectable:l,nodeClickDistance:t.nodeClickDistance,onError:c},v))})}V0.displayName="NodeRenderer";const R_=Q.memo(V0);function D_(t){return mt(Q.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&&D1({sourceNode:c,targetNode:d,width:i.width,height:i.height,transform:i.transform})&&s.push(l.id)}return s},[t]),At)}const L_=({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"})},z_=({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]:L_,[gu.ArrowClosed]:z_};function F_(t){const r=Mt();return Q.useMemo(()=>{var l,c;return Object.prototype.hasOwnProperty.call(tm,t)?tm[t]:((c=(l=r.getState()).onError)==null||c.call(l,"009",Qr.error009(t)),null)},[t])}const B_=({id:t,type:r,color:i,width:s=12.5,height:l=12.5,markerUnits:c="strokeWidth",strokeWidth:d,orient:m="auto-start-reverse"})=>{const v=F_(r);return v?x.jsx("marker",{className:"react-flow__arrowhead",id:t,markerWidth:`${s}`,markerHeight:`${l}`,viewBox:"-10 -10 20 20",markerUnits:c,orient:m,refX:"0",refY:"0",children:x.jsx(v,{color:i,strokeWidth:d})}):null},K0=({defaultColor:t,rfId:r})=>{const i=mt(c=>c.edges),s=mt(c=>c.defaultEdgeOptions),l=Q.useMemo(()=>K1(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(B_,{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};K0.displayName="MarkerDefinitions";var H_=Q.memo(K0);function U0({x:t,y:r,label:i,labelStyle:s,labelShowBg:l=!0,labelBgStyle:c,labelBgPadding:d=[2,4],labelBgBorderRadius:m=2,children:v,className:b,...k}){const[w,S]=Q.useState({x:1,y:0,width:0,height:0}),C=Wt(["react-flow__edge-textwrapper",b]),j=Q.useRef(null);return Q.useEffect(()=>{if(j.current){const T=j.current.getBBox();S({x:T.x,y:T.y,width:T.width,height:T.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:m,ry:m}),x.jsx("text",{className:"react-flow__edge-text",y:w.height/2,dy:"0.3em",ref:j,style:s,children:i}),v]}):null}U0.displayName="EdgeText";const V_=Q.memo(U0);function Au({path:t,labelX:r,labelY:i,label:s,labelStyle:l,labelShowBg:c,labelBgStyle:d,labelBgPadding:m,labelBgBorderRadius:v,interactionWidth:b=20,...k}){return x.jsxs(x.Fragment,{children:[x.jsx("path",{...k,d:t,fill:"none",className:Wt(["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&&Ar(r)&&Ar(i)?x.jsx(V_,{x:r,y:i,label:s,labelStyle:l,labelShowBg:c,labelBgStyle:d,labelBgPadding:m,labelBgBorderRadius:v}):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 q0({sourceX:t,sourceY:r,sourcePosition:i=Ze.Bottom,targetX:s,targetY:l,targetPosition:c=Ze.Top}){const[d,m]=nm({pos:i,x1:t,y1:r,x2:s,y2:l}),[v,b]=nm({pos:c,x1:s,y1:l,x2:t,y2:r}),[k,w,S,C]=h0({sourceX:t,sourceY:r,targetX:s,targetY:l,sourceControlX:d,sourceControlY:m,targetControlX:v,targetControlY:b});return[`M${t},${r} C${d},${m} ${v},${b} ${s},${l}`,k,w,S,C]}function W0(t){return Q.memo(({id:r,sourceX:i,sourceY:s,targetX:l,targetY:c,sourcePosition:d,targetPosition:m,label:v,labelStyle:b,labelShowBg:k,labelBgStyle:w,labelBgPadding:S,labelBgBorderRadius:C,style:j,markerEnd:T,markerStart:$,interactionWidth:I})=>{const[K,P,R]=q0({sourceX:i,sourceY:s,sourcePosition:d,targetX:l,targetY:c,targetPosition:m}),Y=t.isInternal?void 0:r;return x.jsx(Au,{id:Y,path:K,labelX:P,labelY:R,label:v,labelStyle:b,labelShowBg:k,labelBgStyle:w,labelBgPadding:S,labelBgBorderRadius:C,style:j,markerEnd:T,markerStart:$,interactionWidth:I})})}const K_=W0({isInternal:!1}),Y0=W0({isInternal:!0});K_.displayName="SimpleBezierEdge";Y0.displayName="SimpleBezierEdgeInternal";function X0(t){return Q.memo(({id:r,sourceX:i,sourceY:s,targetX:l,targetY:c,label:d,labelStyle:m,labelShowBg:v,labelBgStyle:b,labelBgPadding:k,labelBgBorderRadius:w,style:S,sourcePosition:C=Ze.Bottom,targetPosition:j=Ze.Top,markerEnd:T,markerStart:$,pathOptions:I,interactionWidth:K})=>{const[P,R,Y]=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:Y,label:d,labelStyle:m,labelShowBg:v,labelBgStyle:b,labelBgPadding:k,labelBgBorderRadius:w,style:S,markerEnd:T,markerStart:$,interactionWidth:K})})}const Q0=X0({isInternal:!1}),G0=X0({isInternal:!0});Q0.displayName="SmoothStepEdge";G0.displayName="SmoothStepEdgeInternal";function J0(t){return Q.memo(({id:r,...i})=>{var l;const s=t.isInternal?void 0:r;return x.jsx(Q0,{...i,id:s,pathOptions:Q.useMemo(()=>{var c;return{borderRadius:0,offset:(c=i.pathOptions)==null?void 0:c.offset}},[(l=i.pathOptions)==null?void 0:l.offset])})})}const U_=J0({isInternal:!1}),Z0=J0({isInternal:!0});U_.displayName="StepEdge";Z0.displayName="StepEdgeInternal";function eg(t){return Q.memo(({id:r,sourceX:i,sourceY:s,targetX:l,targetY:c,label:d,labelStyle:m,labelShowBg:v,labelBgStyle:b,labelBgPadding:k,labelBgBorderRadius:w,style:S,markerEnd:C,markerStart:j,interactionWidth:T})=>{const[$,I,K]=y0({sourceX:i,sourceY:s,targetX:l,targetY:c}),P=t.isInternal?void 0:r;return x.jsx(Au,{id:P,path:$,labelX:I,labelY:K,label:d,labelStyle:m,labelShowBg:v,labelBgStyle:b,labelBgPadding:k,labelBgBorderRadius:w,style:S,markerEnd:C,markerStart:j,interactionWidth:T})})}const q_=eg({isInternal:!1}),tg=eg({isInternal:!0});q_.displayName="StraightEdge";tg.displayName="StraightEdgeInternal";function ng(t){return Q.memo(({id:r,sourceX:i,sourceY:s,targetX:l,targetY:c,sourcePosition:d=Ze.Bottom,targetPosition:m=Ze.Top,label:v,labelStyle:b,labelShowBg:k,labelBgStyle:w,labelBgPadding:S,labelBgBorderRadius:C,style:j,markerEnd:T,markerStart:$,pathOptions:I,interactionWidth:K})=>{const[P,R,Y]=p0({sourceX:i,sourceY:s,sourcePosition:d,targetX:l,targetY:c,targetPosition:m,curvature:I==null?void 0:I.curvature}),V=t.isInternal?void 0:r;return x.jsx(Au,{id:V,path:P,labelX:R,labelY:Y,label:v,labelStyle:b,labelShowBg:k,labelBgStyle:w,labelBgPadding:S,labelBgBorderRadius:C,style:j,markerEnd:T,markerStart:$,interactionWidth:K})})}const W_=ng({isInternal:!1}),rg=ng({isInternal:!0});W_.displayName="BezierEdge";rg.displayName="BezierEdgeInternal";const rm={default:rg,straight:tg,step:Z0,smoothstep:G0,simplebezier:Y0},om={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},Y_=(t,r,i)=>i===Ze.Left?t-r:i===Ze.Right?t+r:t,X_=(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:m}){return x.jsx("circle",{onMouseDown:l,onMouseEnter:c,onMouseOut:d,className:Wt([im,`${im}-${m}`]),cx:Y_(r,s,t),cy:X_(i,s,t),r:s,stroke:"transparent",fill:"transparent"})}function Q_({isReconnectable:t,reconnectRadius:r,edge:i,sourceX:s,sourceY:l,targetX:c,targetY:d,sourcePosition:m,targetPosition:v,onReconnect:b,onReconnectStart:k,onReconnectEnd:w,setReconnecting:S,setUpdateHover:C}){const j=Mt(),T=(R,Y)=>{if(R.button!==0)return;const{autoPanOnConnect:V,domNode:B,connectionMode:ae,connectionRadius:de,lib:we,onConnectStart:H,cancelConnection:fe,nodeLookup:xe,rfId:D,panBy:ue,updateConnection:G}=j.getState(),ie=Y.type==="target",z=(A,U)=>{S(!1),w==null||w(A,i,Y.type,U)},q=A=>b==null?void 0:b(i,A),F=(A,U)=>{S(!0),k==null||k(R,i,Y.type),H==null||H(A,U)};$f.onPointerDown(R.nativeEvent,{autoPanOnConnect:V,connectionMode:ae,connectionRadius:de,domNode:B,handleId:Y.id,nodeId:Y.nodeId,nodeLookup:xe,isTarget:ie,edgeUpdaterType:Y.type,lib:we,flowId:D,cancelConnection:fe,panBy:ue,isValidConnection:(...A)=>{var U,be;return((be=(U=j.getState()).isValidConnection)==null?void 0:be.call(U,...A))??!0},onConnect:q,onConnectStart:F,onConnectEnd:(...A)=>{var U,be;return(be=(U=j.getState()).onConnectEnd)==null?void 0:be.call(U,...A)},onReconnectEnd:z,updateConnection:G,getTransform:()=>j.getState().transform,getFromHandle:()=>j.getState().connection.fromHandle,dragThreshold:j.getState().connectionDragThreshold,handleDomNode:R.currentTarget})},$=R=>T(R,{nodeId:i.target,id:i.targetHandle??null,type:"target"}),I=R=>T(R,{nodeId:i.source,id:i.sourceHandle??null,type:"source"}),K=()=>C(!0),P=()=>C(!1);return x.jsxs(x.Fragment,{children:[(t===!0||t==="source")&&x.jsx(sm,{position:m,centerX:s,centerY:l,radius:r,onMouseDown:$,onMouseEnter:K,onMouseOut:P,type:"source"}),(t===!0||t==="target")&&x.jsx(sm,{position:v,centerX:c,centerY:d,radius:r,onMouseDown:I,onMouseEnter:K,onMouseOut:P,type:"target"})]})}function G_({id:t,edgesFocusable:r,edgesReconnectable:i,elementsSelectable:s,onClick:l,onDoubleClick:c,onContextMenu:d,onMouseEnter:m,onMouseMove:v,onMouseLeave:b,reconnectRadius:k,onReconnect:w,onReconnectStart:S,onReconnectEnd:C,rfId:j,edgeTypes:T,noPanClassName:$,onError:I,disableKeyboardA11y:K}){let P=mt(Oe=>Oe.edgeLookup.get(t));const R=mt(Oe=>Oe.defaultEdgeOptions);P=R?{...R,...P}:P;let Y=P.type||"default",V=(T==null?void 0:T[Y])||rm[Y];V===void 0&&(I==null||I("011",Qr.error011(Y)),Y="default",V=(T==null?void 0:T.default)||rm.default);const B=!!(P.focusable||r&&typeof P.focusable>"u"),ae=typeof w<"u"&&(P.reconnectable||i&&typeof P.reconnectable>"u"),de=!!(P.selectable||s&&typeof P.selectable>"u"),we=Q.useRef(null),[H,fe]=Q.useState(!1),[xe,D]=Q.useState(!1),ue=Mt(),{zIndex:G,sourceX:ie,sourceY:z,targetX:q,targetY:F,sourcePosition:A,targetPosition:U}=mt(Q.useCallback(Oe=>{const qe=Oe.nodeLookup.get(P.source),ut=Oe.nodeLookup.get(P.target);if(!qe||!ut)return{zIndex:P.zIndex,...om};const ct=V1({id:t,sourceNode:qe,targetNode:ut,sourceHandle:P.sourceHandle||null,targetHandle:P.targetHandle||null,connectionMode:Oe.connectionMode,onError:I});return{zIndex:R1({selected:P.selected,zIndex:P.zIndex,sourceNode:qe,targetNode:ut,elevateOnSelect:Oe.elevateEdgesOnSelect,zIndexMode:Oe.zIndexMode}),...ct||om}},[P.source,P.target,P.sourceHandle,P.targetHandle,P.selected,P.zIndex]),At),be=Q.useMemo(()=>P.markerStart?`url('#${Tf(P.markerStart,j)}')`:void 0,[P.markerStart,j]),Se=Q.useMemo(()=>P.markerEnd?`url('#${Tf(P.markerEnd,j)}')`:void 0,[P.markerEnd,j]);if(P.hidden||ie===null||z===null||q===null||F===null)return null;const Me=Oe=>{var it;const{addSelectedEdges:qe,unselectNodesAndEdges:ut,multiSelectionActive:ct}=ue.getState();de&&(ue.setState({nodesSelectionActive:!1}),P.selected&&ct?(ut({nodes:[],edges:[P]}),(it=we.current)==null||it.blur()):qe([t])),l&&l(Oe,P)},$e=c?Oe=>{c(Oe,{...P})}:void 0,Ae=d?Oe=>{d(Oe,{...P})}:void 0,_e=m?Oe=>{m(Oe,{...P})}:void 0,Be=v?Oe=>{v(Oe,{...P})}:void 0,ke=b?Oe=>{b(Oe,{...P})}:void 0,He=Oe=>{var qe;if(!K&&Zm.includes(Oe.key)&&de){const{unselectNodesAndEdges:ut,addSelectedEdges:ct}=ue.getState();Oe.key==="Escape"?((qe=we.current)==null||qe.blur(),ut({edges:[P]})):ct([t])}};return x.jsx("svg",{style:{zIndex:G},children:x.jsxs("g",{className:Wt(["react-flow__edge",`react-flow__edge-${Y}`,P.className,$,{selected:P.selected,animated:P.animated,inactive:!de&&!l,updating:H,selectable:de}]),onClick:Me,onDoubleClick:$e,onContextMenu:Ae,onMouseEnter:_e,onMouseMove:Be,onMouseLeave:ke,onKeyDown:B?He:void 0,tabIndex:B?0:void 0,role:P.ariaRole??(B?"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":B?`${I0}-${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:z,targetX:q,targetY:F,sourcePosition:A,targetPosition:U,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}),ae&&x.jsx(Q_,{edge:P,isReconnectable:ae,reconnectRadius:k,onReconnect:w,onReconnectStart:S,onReconnectEnd:C,sourceX:ie,sourceY:z,targetX:q,targetY:F,sourcePosition:A,targetPosition:U,setUpdateHover:fe,setReconnecting:D})]})})}var J_=Q.memo(G_);const Z_=t=>({edgesFocusable:t.edgesFocusable,edgesReconnectable:t.edgesReconnectable,elementsSelectable:t.elementsSelectable,connectionMode:t.connectionMode,onError:t.onError});function og({defaultMarkerColor:t,onlyRenderVisibleElements:r,rfId:i,edgeTypes:s,noPanClassName:l,onReconnect:c,onEdgeContextMenu:d,onEdgeMouseEnter:m,onEdgeMouseMove:v,onEdgeMouseLeave:b,onEdgeClick:k,reconnectRadius:w,onEdgeDoubleClick:S,onReconnectStart:C,onReconnectEnd:j,disableKeyboardA11y:T}){const{edgesFocusable:$,edgesReconnectable:I,elementsSelectable:K,onError:P}=mt(Z_,At),R=D_(r);return x.jsxs("div",{className:"react-flow__edges",children:[x.jsx(H_,{defaultColor:t,rfId:i}),R.map(Y=>x.jsx(J_,{id:Y,edgesFocusable:$,edgesReconnectable:I,elementsSelectable:K,noPanClassName:l,onReconnect:c,onContextMenu:d,onMouseEnter:m,onMouseMove:v,onMouseLeave:b,onClick:k,reconnectRadius:w,onDoubleClick:S,onReconnectStart:C,onReconnectEnd:j,rfId:i,onError:P,edgeTypes:s,disableKeyboardA11y:T},Y))]})}og.displayName="EdgeRenderer";const eS=Q.memo(og),tS=t=>`translate(${t.transform[0]}px,${t.transform[1]}px) scale(${t.transform[2]})`;function nS({children:t}){const r=mt(tS);return x.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:r},children:t})}function rS(t){const r=Zf(),i=Q.useRef(!1);Q.useEffect(()=>{!i.current&&r.viewportInitialized&&t&&(setTimeout(()=>t(r),1),i.current=!0)},[t,r.viewportInitialized])}const oS=t=>{var r;return(r=t.panZoom)==null?void 0:r.syncViewport};function iS(t){const r=mt(oS),i=Mt();return Q.useEffect(()=>{t&&(r==null||r(t),i.setState({transform:[t.x,t.y,t.zoom]}))},[t,r]),null}function sS(t){return t.connection.inProgress?{...t.connection,to:za(t.connection.to,t.transform)}:{...t.connection}}function aS(t){return sS}function lS(t){const r=aS();return mt(r,At)}const uS=t=>({nodesConnectable:t.nodesConnectable,isValid:t.connection.isValid,inProgress:t.connection.inProgress,width:t.width,height:t.height});function cS({containerStyle:t,style:r,type:i,component:s}){const{nodesConnectable:l,width:c,height:d,isValid:m,inProgress:v}=mt(uS,At);return!(c&&l&&v)?null:x.jsx("svg",{style:t,width:c,height:d,className:"react-flow__connectionline react-flow__container",children:x.jsx("g",{className:Wt(["react-flow__connection",n0(m)]),children:x.jsx(ig,{style:r,type:i,CustomComponent:s,isValid:m})})})}const ig=({style:t,type:r=li.Bezier,CustomComponent:i,isValid:s})=>{const{inProgress:l,from:c,fromNode:d,fromHandle:m,fromPosition:v,to:b,toNode:k,toHandle:w,toPosition:S,pointer:C}=lS();if(!l)return;if(i)return x.jsx(i,{connectionLineType:r,connectionLineStyle:t,fromNode:d,fromHandle:m,fromX:c.x,fromY:c.y,toX:b.x,toY:b.y,fromPosition:v,toPosition:S,connectionStatus:n0(s),toNode:k,toHandle:w,pointer:C});let j="";const T={sourceX:c.x,sourceY:c.y,sourcePosition:v,targetX:b.x,targetY:b.y,targetPosition:S};switch(r){case li.Bezier:[j]=p0(T);break;case li.SimpleBezier:[j]=q0(T);break;case li.Step:[j]=Mf({...T,borderRadius:0});break;case li.SmoothStep:[j]=Mf(T);break;default:[j]=y0(T)}return x.jsx("path",{d:j,fill:"none",className:"react-flow__connection-path",style:t})};ig.displayName="ConnectionLine";const fS={};function am(t=fS){Q.useRef(t),Mt(),Q.useEffect(()=>{},[t])}function dS(){Mt(),Q.useRef(!1),Q.useEffect(()=>{},[])}function sg({nodeTypes:t,edgeTypes:r,onInit:i,onNodeClick:s,onEdgeClick:l,onNodeDoubleClick:c,onEdgeDoubleClick:d,onNodeMouseEnter:m,onNodeMouseMove:v,onNodeMouseLeave:b,onNodeContextMenu:k,onSelectionContextMenu:w,onSelectionStart:S,onSelectionEnd:C,connectionLineType:j,connectionLineStyle:T,connectionLineComponent:$,connectionLineContainerStyle:I,selectionKeyCode:K,selectionOnDrag:P,selectionMode:R,multiSelectionKeyCode:Y,panActivationKeyCode:V,zoomActivationKeyCode:B,deleteKeyCode:ae,onlyRenderVisibleElements:de,elementsSelectable:we,defaultViewport:H,translateExtent:fe,minZoom:xe,maxZoom:D,preventScrolling:ue,defaultMarkerColor:G,zoomOnScroll:ie,zoomOnPinch:z,panOnScroll:q,panOnScrollSpeed:F,panOnScrollMode:A,zoomOnDoubleClick:U,panOnDrag:be,onPaneClick:Se,onPaneMouseEnter:Me,onPaneMouseMove:$e,onPaneMouseLeave:Ae,onPaneScroll:_e,onPaneContextMenu:Be,paneClickDistance:ke,nodeClickDistance:He,onEdgeContextMenu:Oe,onEdgeMouseEnter:qe,onEdgeMouseMove:ut,onEdgeMouseLeave:ct,reconnectRadius:it,onReconnect:Tt,onReconnectStart:_t,onReconnectEnd:Ht,noDragClassName:Ot,noWheelClassName:St,noPanClassName:bn,disableKeyboardA11y:fn,nodeExtent:gr,rfId:_n,viewport:Nt,onViewportChange:Vt}){return am(t),am(r),dS(),rS(i),iS(Nt),x.jsx(C_,{onPaneClick:Se,onPaneMouseEnter:Me,onPaneMouseMove:$e,onPaneMouseLeave:Ae,onPaneContextMenu:Be,onPaneScroll:_e,paneClickDistance:ke,deleteKeyCode:ae,selectionKeyCode:K,selectionOnDrag:P,selectionMode:R,onSelectionStart:S,onSelectionEnd:C,multiSelectionKeyCode:Y,panActivationKeyCode:V,zoomActivationKeyCode:B,elementsSelectable:we,zoomOnScroll:ie,zoomOnPinch:z,zoomOnDoubleClick:U,panOnScroll:q,panOnScrollSpeed:F,panOnScrollMode:A,panOnDrag:be,defaultViewport:H,translateExtent:fe,minZoom:xe,maxZoom:D,onSelectionContextMenu:w,preventScrolling:ue,noDragClassName:Ot,noWheelClassName:St,noPanClassName:bn,disableKeyboardA11y:fn,onViewportChange:Vt,isControlledViewport:!!Nt,children:x.jsxs(nS,{children:[x.jsx(eS,{edgeTypes:r,onEdgeClick:l,onEdgeDoubleClick:d,onReconnect:Tt,onReconnectStart:_t,onReconnectEnd:Ht,onlyRenderVisibleElements:de,onEdgeContextMenu:Oe,onEdgeMouseEnter:qe,onEdgeMouseMove:ut,onEdgeMouseLeave:ct,reconnectRadius:it,defaultMarkerColor:G,noPanClassName:bn,disableKeyboardA11y:fn,rfId:_n}),x.jsx(cS,{style:T,type:j,component:$,containerStyle:I}),x.jsx("div",{className:"react-flow__edgelabel-renderer"}),x.jsx(R_,{nodeTypes:t,onNodeClick:s,onNodeDoubleClick:c,onNodeMouseEnter:m,onNodeMouseMove:v,onNodeMouseLeave:b,onNodeContextMenu:k,nodeClickDistance:He,onlyRenderVisibleElements:de,noPanClassName:bn,noDragClassName:Ot,disableKeyboardA11y:fn,nodeExtent:gr,rfId:_n}),x.jsx("div",{className:"react-flow__viewport-portal"})]})})}sg.displayName="GraphView";const hS=Q.memo(sg),lm=({nodes:t,edges:r,defaultNodes:i,defaultEdges:s,width:l,height:c,fitView:d,fitViewOptions:m,minZoom:v=.5,maxZoom:b=2,nodeOrigin:k,nodeExtent:w,zIndexMode:S="basic"}={})=>{const C=new Map,j=new Map,T=new Map,$=new Map,I=s??r??[],K=i??t??[],P=k??[0,0],R=w??ja;w0(T,$,I);const{nodesInitialized:Y}=If(K,C,j,{nodeOrigin:P,nodeExtent:R,zIndexMode:S});let V=[0,0,1];if(d&&l&&c){const B=Da(C,{filter:H=>!!((H.width||H.initialWidth)&&(H.height||H.initialHeight))}),{x:ae,y:de,zoom:we}=qf(B,l,c,v,b,(m==null?void 0:m.padding)??.1);V=[ae,de,we]}return{rfId:"1",width:l??0,height:c??0,transform:V,nodes:K,nodesInitialized:Y,nodeLookup:C,parentLookup:j,edges:I,edgeLookup:$,connectionLookup:T,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:i!==void 0,hasDefaultEdges:s!==void 0,panZoom:null,minZoom:v,maxZoom:b,translateExtent:ja,nodeExtent:R,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Ts.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:m,fitViewResolver:null,connection:{...t0},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:M1,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:e0,zIndexMode:S,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},pS=({nodes:t,edges:r,defaultNodes:i,defaultEdges:s,width:l,height:c,fitView:d,fitViewOptions:m,minZoom:v,maxZoom:b,nodeOrigin:k,nodeExtent:w,zIndexMode:S})=>$b((C,j)=>{async function T(){const{nodeLookup:$,panZoom:I,fitViewOptions:K,fitViewResolver:P,width:R,height:Y,minZoom:V,maxZoom:B}=j();I&&(await j1({nodes:$,width:R,height:Y,panZoom:I,minZoom:V,maxZoom:B},K),P==null||P.resolve(!0),C({fitViewResolver:null}))}return{...lm({nodes:t,edges:r,width:l,height:c,fitView:d,fitViewOptions:m,minZoom:v,maxZoom:b,nodeOrigin:k,nodeExtent:w,defaultNodes:i,defaultEdges:s,zIndexMode:S}),setNodes:$=>{const{nodeLookup:I,parentLookup:K,nodeOrigin:P,elevateNodesOnSelect:R,fitViewQueued:Y,zIndexMode:V,nodesSelectionActive:B}=j(),{nodesInitialized:ae,hasSelectedNodes:de}=If($,I,K,{nodeOrigin:P,nodeExtent:w,elevateNodesOnSelect:R,checkEquality:!0,zIndexMode:V}),we=B&&de;Y&&ae?(T(),C({nodes:$,nodesInitialized:ae,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:we})):C({nodes:$,nodesInitialized:ae,nodesSelectionActive:we})},setEdges:$=>{const{connectionLookup:I,edgeLookup:K}=j();w0(I,K,$),C({edges:$})},setDefaultNodesAndEdges:($,I)=>{if($){const{setNodes:K}=j();K($),C({hasDefaultNodes:!0})}if(I){const{setEdges:K}=j();K(I),C({hasDefaultEdges:!0})}},updateNodeInternals:$=>{const{triggerNodeChanges:I,nodeLookup:K,parentLookup:P,domNode:R,nodeOrigin:Y,nodeExtent:V,debug:B,fitViewQueued:ae,zIndexMode:de}=j(),{changes:we,updatedInternals:H}=G1($,K,P,R,Y,V,de);H&&(W1(K,P,{nodeOrigin:Y,nodeExtent:V,zIndexMode:de}),ae?(T(),C({fitViewQueued:!1,fitViewOptions:void 0})):C({}),(we==null?void 0:we.length)>0&&(B&&console.log("React Flow: trigger node changes",we),I==null||I(we)))},updateNodePositions:($,I=!1)=>{const K=[];let P=[];const{nodeLookup:R,triggerNodeChanges:Y,connection:V,updateConnection:B,onNodesChangeMiddlewareMap:ae}=j();for(const[de,we]of $){const H=R.get(de),fe=!!(H!=null&&H.expandParent&&(H!=null&&H.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(H&&V.inProgress&&V.fromNode.id===H.id){const D=Fi(H,V.fromHandle,Ze.Left,!0);B({...V,from:D})}fe&&H.parentId&&K.push({id:de,parentId:H.parentId,rect:{...we.internals.positionAbsolute,width:we.measured.width??0,height:we.measured.height??0}}),P.push(xe)}if(K.length>0){const{parentLookup:de,nodeOrigin:we}=j(),H=Jf(K,R,de,we);P.push(...H)}for(const de of ae.values())P=de(P);Y(P)},triggerNodeChanges:$=>{const{onNodesChange:I,setNodes:K,nodes:P,hasDefaultNodes:R,debug:Y}=j();if($!=null&&$.length){if(R){const V=O0($,P);K(V)}Y&&console.log("React Flow: trigger node changes",$),I==null||I($)}},triggerEdgeChanges:$=>{const{onEdgesChange:I,setEdges:K,edges:P,hasDefaultEdges:R,debug:Y}=j();if($!=null&&$.length){if(R){const V=R0($,P);K(V)}Y&&console.log("React Flow: trigger edge changes",$),I==null||I($)}},addSelectedNodes:$=>{const{multiSelectionActive:I,edgeLookup:K,nodeLookup:P,triggerNodeChanges:R,triggerEdgeChanges:Y}=j();if(I){const V=$.map(B=>$i(B,!0));R(V);return}R(Es(P,new Set([...$]),!0)),Y(Es(K))},addSelectedEdges:$=>{const{multiSelectionActive:I,edgeLookup:K,nodeLookup:P,triggerNodeChanges:R,triggerEdgeChanges:Y}=j();if(I){const V=$.map(B=>$i(B,!0));Y(V);return}Y(Es(K,new Set([...$]))),R(Es(P,new Set,!0))},unselectNodesAndEdges:({nodes:$,edges:I}={})=>{const{edges:K,nodes:P,nodeLookup:R,triggerNodeChanges:Y,triggerEdgeChanges:V}=j(),B=$||P,ae=I||K,de=[];for(const H of B){if(!H.selected)continue;const fe=R.get(H.id);fe&&(fe.selected=!1),de.push($i(H.id,!1))}const we=[];for(const H of ae)H.selected&&we.push($i(H.id,!1));Y(de),V(we)},setMinZoom:$=>{const{panZoom:I,maxZoom:K}=j();I==null||I.setScaleExtent([$,K]),C({minZoom:$})},setMaxZoom:$=>{const{panZoom:I,minZoom:K}=j();I==null||I.setScaleExtent([K,$]),C({maxZoom:$})},setTranslateExtent:$=>{var I;(I=j().panZoom)==null||I.setTranslateExtent($),C({translateExtent:$})},resetSelectedElements:()=>{const{edges:$,nodes:I,triggerNodeChanges:K,triggerEdgeChanges:P,elementsSelectable:R}=j();if(!R)return;const Y=I.reduce((B,ae)=>ae.selected?[...B,$i(ae.id,!1)]:B,[]),V=$.reduce((B,ae)=>ae.selected?[...B,$i(ae.id,!1)]:B,[]);K(Y),P(V)},setNodeExtent:$=>{const{nodes:I,nodeLookup:K,parentLookup:P,nodeOrigin:R,elevateNodesOnSelect:Y,nodeExtent:V,zIndexMode:B}=j();$[0][0]===V[0][0]&&$[0][1]===V[0][1]&&$[1][0]===V[1][0]&&$[1][1]===V[1][1]||(If(I,K,P,{nodeOrigin:R,nodeExtent:$,elevateNodesOnSelect:Y,checkEquality:!1,zIndexMode:B}),C({nodeExtent:$}))},panBy:$=>{const{transform:I,width:K,height:P,panZoom:R,translateExtent:Y}=j();return J1({delta:$,panZoom:R,transform:I,translateExtent:Y,width:K,height:P})},setCenter:async($,I,K)=>{const{width:P,height:R,maxZoom:Y,panZoom:V}=j();if(!V)return Promise.resolve(!1);const B=typeof(K==null?void 0:K.zoom)<"u"?K.zoom:Y;return await V.setViewport({x:P/2-$*B,y:R/2-I*B,zoom:B},{duration:K==null?void 0:K.duration,ease:K==null?void 0:K.ease,interpolate:K==null?void 0:K.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{C({connection:{...t0}})},updateConnection:$=>{C({connection:$})},reset:()=>C({...lm()})}},Object.is);function mS({initialNodes:t,initialEdges:r,defaultNodes:i,defaultEdges:s,initialWidth:l,initialHeight:c,initialMinZoom:d,initialMaxZoom:m,initialFitViewOptions:v,fitView:b,nodeOrigin:k,nodeExtent:w,zIndexMode:S,children:C}){const[j]=Q.useState(()=>pS({nodes:t,edges:r,defaultNodes:i,defaultEdges:s,width:l,height:c,fitView:b,minZoom:d,maxZoom:m,fitViewOptions:v,nodeOrigin:k,nodeExtent:w,zIndexMode:S}));return x.jsx(Ab,{value:j,children:x.jsx(n_,{children:C})})}function gS({children:t,nodes:r,edges:i,defaultNodes:s,defaultEdges:l,width:c,height:d,fitView:m,fitViewOptions:v,minZoom:b,maxZoom:k,nodeOrigin:w,nodeExtent:S,zIndexMode:C}){return Q.useContext(Iu)?x.jsx(x.Fragment,{children:t}):x.jsx(mS,{initialNodes:r,initialEdges:i,defaultNodes:s,defaultEdges:l,initialWidth:c,initialHeight:d,fitView:m,initialFitViewOptions:v,initialMinZoom:b,initialMaxZoom:k,nodeOrigin:w,nodeExtent:S,zIndexMode:C,children:t})}const yS={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function vS({nodes:t,edges:r,defaultNodes:i,defaultEdges:s,className:l,nodeTypes:c,edgeTypes:d,onNodeClick:m,onEdgeClick:v,onInit:b,onMove:k,onMoveStart:w,onMoveEnd:S,onConnect:C,onConnectStart:j,onConnectEnd:T,onClickConnectStart:$,onClickConnectEnd:I,onNodeMouseEnter:K,onNodeMouseMove:P,onNodeMouseLeave:R,onNodeContextMenu:Y,onNodeDoubleClick:V,onNodeDragStart:B,onNodeDrag:ae,onNodeDragStop:de,onNodesDelete:we,onEdgesDelete:H,onDelete:fe,onSelectionChange:xe,onSelectionDragStart:D,onSelectionDrag:ue,onSelectionDragStop:G,onSelectionContextMenu:ie,onSelectionStart:z,onSelectionEnd:q,onBeforeDelete:F,connectionMode:A,connectionLineType:U=li.Bezier,connectionLineStyle:be,connectionLineComponent:Se,connectionLineContainerStyle:Me,deleteKeyCode:$e="Backspace",selectionKeyCode:Ae="Shift",selectionOnDrag:_e=!1,selectionMode:Be=Pa.Full,panActivationKeyCode:ke="Space",multiSelectionKeyCode:He=Ta()?"Meta":"Control",zoomActivationKeyCode:Oe=Ta()?"Meta":"Control",snapToGrid:qe,snapGrid:ut,onlyRenderVisibleElements:ct=!1,selectNodesOnDrag:it,nodesDraggable:Tt,autoPanOnNodeFocus:_t,nodesConnectable:Ht,nodesFocusable:Ot,nodeOrigin:St=$0,edgesFocusable:bn,edgesReconnectable:fn,elementsSelectable:gr=!0,defaultViewport:_n=Wb,minZoom:Nt=.5,maxZoom:Vt=2,translateExtent:Hn=ja,preventScrolling:tr=!0,nodeExtent:Sn,defaultMarkerColor:Pn="#b1b1b7",zoomOnScroll:Vn=!0,zoomOnPinch:dn=!0,panOnScroll:nr=!1,panOnScrollSpeed:kn=.5,panOnScrollMode:Ye=Ri.Free,zoomOnDoubleClick:Kn=!0,panOnDrag:Nn=!0,onPaneClick:rr,onPaneMouseEnter:Ve,onPaneMouseMove:Mn,onPaneMouseLeave:Un,onPaneScroll:yr,onPaneContextMenu:Zr,paneClickDistance:vr=1,nodeClickDistance:Io=0,children:eo,onReconnect:hn,onReconnectStart:Tn,onReconnectEnd:W,onEdgeContextMenu:Fe,onEdgeDoubleClick:Le,onEdgeMouseEnter:nt,onEdgeMouseMove:nn,onEdgeMouseLeave:Yt,reconnectRadius:Kt=10,onNodesChange:rn,onEdgesChange:to,noDragClassName:on="nodrag",noWheelClassName:qn="nowheel",noPanClassName:zt="nopan",fitView:Wn,fitViewOptions:or,connectOnClick:In,attributionPosition:ui,proOptions:ir,defaultEdgeOptions:ci,elevateNodesOnSelect:$o=!0,elevateEdgesOnSelect:Et=!1,disableKeyboardA11y:sr=!1,autoPanOnConnect:gt,autoPanOnNodeDrag:Bi,autoPanSpeed:Dr,connectionRadius:Ao,isValidConnection:Lr,onError:xr,style:fi,id:ar,nodeDragThreshold:En,connectionDragThreshold:ft,viewport:pn,onViewportChange:Hi,width:Oo,height:no,colorMode:ro="light",debug:oo,onScroll:Yn,ariaLabelConfig:yt,zIndexMode:zr="basic",...io},lr){const Fr=ar||"1",so=Gb(ro),ur=Q.useCallback(di=>{di.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Yn==null||Yn(di)},[Yn]);return x.jsx("div",{"data-testid":"rf__wrapper",...io,onScroll:ur,style:{...fi,...yS},ref:lr,className:Wt(["react-flow",l,so]),id:ar,role:"application",children:x.jsxs(gS,{nodes:t,edges:r,width:Oo,height:no,fitView:Wn,fitViewOptions:or,minZoom:Nt,maxZoom:Vt,nodeOrigin:St,nodeExtent:Sn,zIndexMode:zr,children:[x.jsx(Qb,{nodes:t,edges:r,defaultNodes:i,defaultEdges:s,onConnect:C,onConnectStart:j,onConnectEnd:T,onClickConnectStart:$,onClickConnectEnd:I,nodesDraggable:Tt,autoPanOnNodeFocus:_t,nodesConnectable:Ht,nodesFocusable:Ot,edgesFocusable:bn,edgesReconnectable:fn,elementsSelectable:gr,elevateNodesOnSelect:$o,elevateEdgesOnSelect:Et,minZoom:Nt,maxZoom:Vt,nodeExtent:Sn,onNodesChange:rn,onEdgesChange:to,snapToGrid:qe,snapGrid:ut,connectionMode:A,translateExtent:Hn,connectOnClick:In,defaultEdgeOptions:ci,fitView:Wn,fitViewOptions:or,onNodesDelete:we,onEdgesDelete:H,onDelete:fe,onNodeDragStart:B,onNodeDrag:ae,onNodeDragStop:de,onSelectionDrag:ue,onSelectionDragStart:D,onSelectionDragStop:G,onMove:k,onMoveStart:w,onMoveEnd:S,noPanClassName:zt,nodeOrigin:St,rfId:Fr,autoPanOnConnect:gt,autoPanOnNodeDrag:Bi,autoPanSpeed:Dr,onError:xr,connectionRadius:Ao,isValidConnection:Lr,selectNodesOnDrag:it,nodeDragThreshold:En,connectionDragThreshold:ft,onBeforeDelete:F,debug:oo,ariaLabelConfig:yt,zIndexMode:zr}),x.jsx(hS,{onInit:b,onNodeClick:m,onEdgeClick:v,onNodeMouseEnter:K,onNodeMouseMove:P,onNodeMouseLeave:R,onNodeContextMenu:Y,onNodeDoubleClick:V,nodeTypes:c,edgeTypes:d,connectionLineType:U,connectionLineStyle:be,connectionLineComponent:Se,connectionLineContainerStyle:Me,selectionKeyCode:Ae,selectionOnDrag:_e,selectionMode:Be,deleteKeyCode:$e,multiSelectionKeyCode:He,panActivationKeyCode:ke,zoomActivationKeyCode:Oe,onlyRenderVisibleElements:ct,defaultViewport:_n,translateExtent:Hn,minZoom:Nt,maxZoom:Vt,preventScrolling:tr,zoomOnScroll:Vn,zoomOnPinch:dn,zoomOnDoubleClick:Kn,panOnScroll:nr,panOnScrollSpeed:kn,panOnScrollMode:Ye,panOnDrag:Nn,onPaneClick:rr,onPaneMouseEnter:Ve,onPaneMouseMove:Mn,onPaneMouseLeave:Un,onPaneScroll:yr,onPaneContextMenu:Zr,paneClickDistance:vr,nodeClickDistance:Io,onSelectionContextMenu:ie,onSelectionStart:z,onSelectionEnd:q,onReconnect:hn,onReconnectStart:Tn,onReconnectEnd:W,onEdgeContextMenu:Fe,onEdgeDoubleClick:Le,onEdgeMouseEnter:nt,onEdgeMouseMove:nn,onEdgeMouseLeave:Yt,reconnectRadius:Kt,defaultMarkerColor:Pn,noDragClassName:on,noWheelClassName:qn,noPanClassName:zt,rfId:Fr,disableKeyboardA11y:sr,nodeExtent:Sn,viewport:pn,onViewportChange:Hi}),x.jsx(qb,{onSelectionChange:xe}),eo,x.jsx(Bb,{proOptions:ir,position:ui}),x.jsx(Fb,{rfId:Fr,disableKeyboardA11y:sr})]})})}var xS=D0(vS);function wS(){const t=Mt();return Q.useCallback(r=>{const{domNode:i,updateNodeInternals:s}=t.getState(),l=Array.isArray(r)?r:[r],c=new Map;l.forEach(d=>{const m=i==null?void 0:i.querySelector(`.react-flow__node[data-id="${d}"]`);m&&c.set(d,{id:d,nodeElement:m,force:!0})}),requestAnimationFrame(()=>s(c,{triggerFitView:!1}))},[])}function bS(t){const[r,i]=Q.useState(t),s=Q.useCallback(l=>i(c=>O0(l,c)),[]);return[r,i,s]}function _S(t){const[r,i]=Q.useState(t),s=Q.useCallback(l=>i(c=>R0(l,c)),[]);return[r,i,s]}function SS({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:Wt(["react-flow__background-pattern",i,s])})}function kS({radius:t,className:r}){return x.jsx("circle",{cx:t,cy:t,r:t,className:Wt(["react-flow__background-pattern","dots",r])})}var Po;(function(t){t.Lines="lines",t.Dots="dots",t.Cross="cross"})(Po||(Po={}));const NS={[Po.Dots]:1,[Po.Lines]:1,[Po.Cross]:6},ES=t=>({transform:t.transform,patternId:`pattern-${t.rfId}`});function ag({id:t,variant:r=Po.Dots,gap:i=20,size:s,lineWidth:l=1,offset:c=0,color:d,bgColor:m,style:v,className:b,patternClassName:k}){const w=Q.useRef(null),{transform:S,patternId:C}=mt(ES,At),j=s||NS[r],T=r===Po.Dots,$=r===Po.Cross,I=Array.isArray(i)?i:[i,i],K=[I[0]*S[2]||1,I[1]*S[2]||1],P=j*S[2],R=Array.isArray(c)?c:[c,c],Y=$?[P,P]:K,V=[R[0]*S[2]||1+Y[0]/2,R[1]*S[2]||1+Y[1]/2],B=`${C}${t||""}`;return x.jsxs("svg",{className:Wt(["react-flow__background",b]),style:{...v,...$u,"--xy-background-color-props":m,"--xy-background-pattern-color-props":d},ref:w,"data-testid":"rf__background",children:[x.jsx("pattern",{id:B,x:S[0]%K[0],y:S[1]%K[1],width:K[0],height:K[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${V[0]},-${V[1]})`,children:T?x.jsx(kS,{radius:P/2,className:k}):x.jsx(SS,{dimensions:Y,lineWidth:l,variant:r,className:k})}),x.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${B})`})]})}ag.displayName="Background";const CS=Q.memo(ag);function jS(){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 PS(){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 MS(){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 TS(){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 IS(){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:Wt(["react-flow__controls-button",r]),...i,children:t})}const $S=t=>({isInteractive:t.nodesDraggable||t.nodesConnectable||t.elementsSelectable,minZoomReached:t.transform[2]<=t.minZoom,maxZoomReached:t.transform[2]>=t.maxZoom,ariaLabelConfig:t.ariaLabelConfig});function lg({style:t,showZoom:r=!0,showFitView:i=!0,showInteractive:s=!0,fitViewOptions:l,onZoomIn:c,onZoomOut:d,onFitView:m,onInteractiveChange:v,className:b,children:k,position:w="bottom-left",orientation:S="vertical","aria-label":C}){const j=Mt(),{isInteractive:T,minZoomReached:$,maxZoomReached:I,ariaLabelConfig:K}=mt($S,At),{zoomIn:P,zoomOut:R,fitView:Y}=Zf(),V=()=>{P(),c==null||c()},B=()=>{R(),d==null||d()},ae=()=>{Y(l),m==null||m()},de=()=>{j.setState({nodesDraggable:!T,nodesConnectable:!T,elementsSelectable:!T}),v==null||v(!T)},we=S==="horizontal"?"horizontal":"vertical";return x.jsxs(Fa,{className:Wt(["react-flow__controls",we,b]),position:w,style:t,"data-testid":"rf__controls","aria-label":C??K["controls.ariaLabel"],children:[r&&x.jsxs(x.Fragment,{children:[x.jsx(Jl,{onClick:V,className:"react-flow__controls-zoomin",title:K["controls.zoomIn.ariaLabel"],"aria-label":K["controls.zoomIn.ariaLabel"],disabled:I,children:x.jsx(jS,{})}),x.jsx(Jl,{onClick:B,className:"react-flow__controls-zoomout",title:K["controls.zoomOut.ariaLabel"],"aria-label":K["controls.zoomOut.ariaLabel"],disabled:$,children:x.jsx(PS,{})})]}),i&&x.jsx(Jl,{className:"react-flow__controls-fitview",onClick:ae,title:K["controls.fitView.ariaLabel"],"aria-label":K["controls.fitView.ariaLabel"],children:x.jsx(MS,{})}),s&&x.jsx(Jl,{className:"react-flow__controls-interactive",onClick:de,title:K["controls.interactive.ariaLabel"],"aria-label":K["controls.interactive.ariaLabel"],children:T?x.jsx(IS,{}):x.jsx(TS,{})}),k]})}lg.displayName="Controls";const AS=Q.memo(lg);function OS({id:t,x:r,y:i,width:s,height:l,style:c,color:d,strokeColor:m,strokeWidth:v,className:b,borderRadius:k,shapeRendering:w,selected:S,onClick:C}){const{background:j,backgroundColor:T}=c||{},$=d||j||T;return x.jsx("rect",{className:Wt(["react-flow__minimap-node",{selected:S},b]),x:r,y:i,rx:k,ry:k,width:s,height:l,style:{fill:$,stroke:m,strokeWidth:v},shapeRendering:w,onClick:C?I=>C(I,t):void 0})}const RS=Q.memo(OS),DS=t=>t.nodes.map(r=>r.id),mf=t=>t instanceof Function?t:()=>t;function LS({nodeStrokeColor:t,nodeColor:r,nodeClassName:i="",nodeBorderRadius:s=5,nodeStrokeWidth:l,nodeComponent:c=RS,onClick:d}){const m=mt(DS,At),v=mf(r),b=mf(t),k=mf(i),w=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return x.jsx(x.Fragment,{children:m.map(S=>x.jsx(FS,{id:S,nodeColorFunc:v,nodeStrokeColorFunc:b,nodeClassNameFunc:k,nodeBorderRadius:s,nodeStrokeWidth:l,NodeComponent:c,onClick:d,shapeRendering:w},S))})}function zS({id:t,nodeColorFunc:r,nodeStrokeColorFunc:i,nodeClassNameFunc:s,nodeBorderRadius:l,nodeStrokeWidth:c,shapeRendering:d,NodeComponent:m,onClick:v}){const{node:b,x:k,y:w,width:S,height:C}=mt(j=>{const T=j.nodeLookup.get(t);if(!T)return{node:void 0,x:0,y:0,width:0,height:0};const $=T.internals.userNode,{x:I,y:K}=T.internals.positionAbsolute,{width:P,height:R}=To($);return{node:$,x:I,y:K,width:P,height:R}},At);return!b||b.hidden||!l0(b)?null:x.jsx(m,{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:v,id:b.id})}const FS=Q.memo(zS);var BS=Q.memo(LS);const HS=200,VS=150,KS=t=>!t.hidden,US=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?a0(Da(t.nodeLookup,{filter:KS}),r):r,rfId:t.rfId,panZoom:t.panZoom,translateExtent:t.translateExtent,flowWidth:t.width,flowHeight:t.height,ariaLabelConfig:t.ariaLabelConfig}},qS="react-flow__minimap-desc";function ug({style:t,className:r,nodeStrokeColor:i,nodeColor:s,nodeClassName:l="",nodeBorderRadius:c=5,nodeStrokeWidth:d,nodeComponent:m,bgColor:v,maskColor:b,maskStrokeColor:k,maskStrokeWidth:w,position:S="bottom-right",onClick:C,onNodeClick:j,pannable:T=!1,zoomable:$=!1,ariaLabel:I,inversePan:K,zoomStep:P=1,offsetScale:R=5}){const Y=Mt(),V=Q.useRef(null),{boundingRect:B,viewBB:ae,rfId:de,panZoom:we,translateExtent:H,flowWidth:fe,flowHeight:xe,ariaLabelConfig:D}=mt(US,At),ue=(t==null?void 0:t.width)??HS,G=(t==null?void 0:t.height)??VS,ie=B.width/ue,z=B.height/G,q=Math.max(ie,z),F=q*ue,A=q*G,U=R*q,be=B.x-(F-B.width)/2-U,Se=B.y-(A-B.height)/2-U,Me=F+U*2,$e=A+U*2,Ae=`${qS}-${de}`,_e=Q.useRef(0),Be=Q.useRef();_e.current=q,Q.useEffect(()=>{if(V.current&&we)return Be.current=ab({domNode:V.current,panZoom:we,getTransform:()=>Y.getState().transform,getViewScale:()=>_e.current}),()=>{var qe;(qe=Be.current)==null||qe.destroy()}},[we]),Q.useEffect(()=>{var qe;(qe=Be.current)==null||qe.update({translateExtent:H,width:fe,height:xe,inversePan:K,pannable:T,zoomStep:P,zoomable:$})},[T,$,K,P,H,fe,xe]);const ke=C?qe=>{var it;const[ut,ct]=((it=Be.current)==null?void 0:it.pointer(qe))||[0,0];C(qe,{x:ut,y:ct})}:void 0,He=j?Q.useCallback((qe,ut)=>{const ct=Y.getState().nodeLookup.get(ut).internals.userNode;j(qe,ct)},[]):void 0,Oe=I??D["minimap.ariaLabel"];return x.jsx(Fa,{position:S,style:{...t,"--xy-minimap-background-color-props":typeof v=="string"?v: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*q: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:Wt(["react-flow__minimap",r]),"data-testid":"rf__minimap",children:x.jsxs("svg",{width:ue,height:G,viewBox:`${be} ${Se} ${Me} ${$e}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":Ae,ref:V,onClick:ke,children:[Oe&&x.jsx("title",{id:Ae,children:Oe}),x.jsx(BS,{onClick:He,nodeColor:s,nodeStrokeColor:i,nodeBorderRadius:c,nodeClassName:l,nodeStrokeWidth:d,nodeComponent:m}),x.jsx("path",{className:"react-flow__minimap-mask",d:`M${be-U},${Se-U}h${Me+U*2}v${$e+U*2}h${-Me-U*2}z
202
+ M${ae.x},${ae.y}h${ae.width}v${ae.height}h${-ae.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}ug.displayName="MiniMap";const WS=Q.memo(ug),YS=t=>r=>t?`${Math.max(1/r.transform[2],1)}`:void 0,XS={[Os.Line]:"right",[Os.Handle]:"bottom-right"};function QS({nodeId:t,position:r,variant:i=Os.Handle,className:s,style:l=void 0,children:c,color:d,minWidth:m=10,minHeight:v=10,maxWidth:b=Number.MAX_VALUE,maxHeight:k=Number.MAX_VALUE,keepAspectRatio:w=!1,resizeDirection:S,autoScale:C=!0,shouldResize:j,onResizeStart:T,onResize:$,onResizeEnd:I}){const K=B0(),P=typeof t=="string"?t:K,R=Mt(),Y=Q.useRef(null),V=i===Os.Handle,B=mt(Q.useCallback(YS(V&&C),[V,C]),At),ae=Q.useRef(null),de=r??XS[i];Q.useEffect(()=>{if(!(!Y.current||!P))return ae.current||(ae.current=bb({domNode:Y.current,nodeId:P,getStoreItems:()=>{const{nodeLookup:H,transform:fe,snapGrid:xe,snapToGrid:D,nodeOrigin:ue,domNode:G}=R.getState();return{nodeLookup:H,transform:fe,snapGrid:xe,snapToGrid:D,nodeOrigin:ue,paneDomNode:G}},onChange:(H,fe)=>{const{triggerNodeChanges:xe,nodeLookup:D,parentLookup:ue,nodeOrigin:G}=R.getState(),ie=[],z={x:H.x,y:H.y},q=D.get(P);if(q&&q.expandParent&&q.parentId){const F=q.origin??G,A=H.width??q.measured.width??0,U=H.height??q.measured.height??0,be={id:q.id,parentId:q.parentId,rect:{width:A,height:U,...u0({x:H.x??q.position.x,y:H.y??q.position.y},{width:A,height:U},q.parentId,D,F)}},Se=Jf([be],D,ue,G);ie.push(...Se),z.x=H.x?Math.max(F[0]*A,H.x):void 0,z.y=H.y?Math.max(F[1]*U,H.y):void 0}if(z.x!==void 0&&z.y!==void 0){const F={id:P,type:"position",position:{...z}};ie.push(F)}if(H.width!==void 0&&H.height!==void 0){const A={id:P,type:"dimensions",resizing:!0,setAttributes:S?S==="horizontal"?"width":"height":!0,dimensions:{width:H.width,height:H.height}};ie.push(A)}for(const F of fe){const A={...F,type:"position"};ie.push(A)}xe(ie)},onEnd:({width:H,height:fe})=>{const xe={id:P,type:"dimensions",resizing:!1,dimensions:{width:H,height:fe}};R.getState().triggerNodeChanges([xe])}})),ae.current.update({controlPosition:de,boundaries:{minWidth:m,minHeight:v,maxWidth:b,maxHeight:k},keepAspectRatio:w,resizeDirection:S,onResizeStart:T,onResize:$,onResizeEnd:I,shouldResize:j}),()=>{var H;(H=ae.current)==null||H.destroy()}},[de,m,v,b,k,w,T,$,I,j]);const we=de.split("-");return x.jsx("div",{className:Wt(["react-flow__resize-control","nodrag",...we,i,s]),ref:Y,style:{...l,scale:B,...d&&{[V?"backgroundColor":"borderColor"]:d}},children:c})}Q.memo(QS);const GS={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=GS[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 m,v,b,k;const s=r.toLowerCase(),l=(v=(m=t.paths)==null?void 0:m[i])==null?void 0:v[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 m,v,b,k,w,S;const s=r.toLowerCase(),l=(v=(m=t.paths)==null?void 0:m[i])==null?void 0:v[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 JS(t){const r=t.indexOf(" ");return r===-1?{method:"get",path:"/"}:{method:t.slice(0,r),path:t.slice(r+1)}}const cg=Q.createContext(null);function ZS(t){const{id:r,selected:i}=t,s=t.data,l=Q.useContext(cg),c=wS();return Q.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:m,path:v}=JS(d.target.value);l.updateNodeData(r,{method:m,path:v,summary:td(l.doc,m,v),reqHint:nd(l.doc,m,v),resHint:rd(l.doc,m,v)})},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 ek={apiOp:ZS};function tk(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 nk(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 rk=[{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 ok({doc:t,ops:r,graph:i,onGraphChange:s}){var P,R,Y,V,B,ae,de,we;const l=Q.useMemo(()=>tk(t,i),[t,i]),[c,d,m]=bS(l.nodes),[v,b,k]=_S(l.edges),[w,S]=Q.useState(null);Q.useEffect(()=>{s(nk(c,v))},[c,v,s]);const C=Q.useCallback((H,fe)=>{d(xe=>xe.map(D=>D.id===H?{...D,data:{...D.data,...fe}}:D))},[d]),j=Q.useMemo(()=>({doc:t,ops:r,updateNodeData:C}),[t,r,C]),T=Q.useCallback(H=>{H.sourceHandle!=="out"||H.targetHandle!=="in"||b(fe=>g0({...H,id:`e-${H.source}-${H.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]),$=v.find(H=>H.id===w),I=H=>{w&&b(fe=>fe.map(xe=>{var ue;if(xe.id!==w)return xe;const D={...((ue=xe.data)==null?void 0:ue.mapping)??au(),...H};return{...xe,data:{mapping:D},label:D.variableName}}))},K=()=>{const H=c.reduce((ie,z)=>z.position.x>ie?z.position.x:ie,0),fe=r[0];if(!fe)return;const xe=crypto.randomUUID(),D=H>0?H+40:80,G={id:xe,type:"apiOp",position:{x:D,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(cg.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(xS,{nodes:c,edges:v,onNodesChange:m,onEdgesChange:k,onConnect:T,nodeTypes:ek,onEdgeClick:(H,fe)=>S(fe.id),onPaneClick:()=>S(null),fitView:!0,minZoom:.4,maxZoom:1.5,proOptions:{hideAttribution:!0},isValidConnection:H=>H.sourceHandle==="out"&&H.targetHandle==="in",children:[x.jsx(CS,{variant:Po.Dots,gap:16,size:1,color:"rgb(51 65 85 / 0.5)"}),x.jsx(AS,{className:"!bg-surface-900 !border-surface-600 !shadow-lg"}),x.jsx(WS,{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:K,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)"}),$?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=$.data)==null?void 0:P.mapping.sourceJsonPath)??"$",onChange:H=>I({sourceJsonPath:H.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=$.data)==null?void 0:R.mapping.variableName)??"",onChange:H=>I({variableName:H.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:((Y=$.data)==null?void 0:Y.mapping.useInTarget)??"vars_only",onChange:H=>I({useInTarget:H.target.value}),children:rk.map(H=>x.jsx("option",{value:H.value,children:H.label},H.value))})]}),(((V=$.data)==null?void 0:V.mapping.useInTarget)==="path_param"||((B=$.data)==null?void 0:B.mapping.useInTarget)==="header"||((ae=$.data)==null?void 0:ae.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=$.data)==null?void 0:de.mapping.targetKey)??"",onChange:H=>I({targetKey:H.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=$.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 fg(t,r){const i=new Map(t.map(v=>[v.id,v])),s=new Set(t.map(v=>v.id)),l=new Map,c=new Map;for(const v of s)l.set(v,0),c.set(v,[]);for(const v of r)!s.has(v.source)||!s.has(v.target)||(l.set(v.target,(l.get(v.target)??0)+1),c.get(v.source).push(v.target));const d=[];for(const[v,b]of l)b===0&&d.push(v);d.sort((v,b)=>i.get(v).x-i.get(b).x||i.get(v).y-i.get(b).y);const m=[];for(;d.length;){const v=d.shift();m.push(v);for(const b of c.get(v)??[]){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(m.length<t.length){const v=t.filter(b=>!m.includes(b.id)).sort((b,k)=>b.x-k.x||b.y-k.y);return[...m.map(b=>i.get(b)),...v]}return m.map(v=>i.get(v))}async function um(t,r,i){var v;const{nodes:s,edges:l}=t;if(s.length===0)return"Sin nodos en el flujo.";const c=fg(s,l),d={};let m="";for(let b=0;b<c.length;b++){const k=c[b];let w=k.path;const S={...i()},C=l.filter(Y=>Y.target===k.id);for(const Y of C){const{mapping:V}=Y,B=d[V.variableName];if(B!==void 0)switch(V.useInTarget){case"path_param":V.targetKey&&(w=w.split(`{${V.targetKey}}`).join(B));break;case"header":if(V.targetKey){const ae=V.targetKey;S[ae]=ae.toLowerCase()==="authorization"&&!B.startsWith("Bearer ")?`Bearer ${B}`:B}break;case"query":{const ae=w.includes("?")?"&":"?";w=`${w}${ae}${encodeURIComponent(V.targetKey)}=${encodeURIComponent(B)}`;break}case"vars_only":default:w=w.split(`{${V.variableName}}`).join(B);break}}for(const[Y,V]of Object.entries(d))w=w.split(`{${Y}}`).join(V);const j=`${r.replace(/\/$/,"")}${w}`,T={method:k.method.toUpperCase(),headers:S},$=k.method.toLowerCase();$!=="get"&&$!=="head"&&(T.body="{}");const I=await fetch(j,{...T,credentials:"include"});let K={};const P=await I.text();try{K=P?JSON.parse(P):{}}catch{K={_raw:P}}m+=`▸ ${k.method.toUpperCase()} ${k.path} → ${I.status}
203
+ ${JSON.stringify(K,null,2)}
204
+
205
+ `;const R=l.filter(Y=>Y.source===k.id);for(const Y of R){const V=((v=Y.mapping.sourceJsonPath)==null?void 0:v.trim())||"$",B=Rf(K,V);B!=null&&(d[Y.mapping.variableName]=typeof B=="object"?JSON.stringify(B):String(B))}}return m+=`
206
+ Variables finales: ${JSON.stringify(d,null,2)}`,m}function ik(t){const r=fg(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 sk(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 dg=Q.createContext({productName:null,logoDataUrl:null});function ak({value:t,children:r}){return x.jsx(dg.Provider,{value:t,children:r})}function lk(){return Q.useContext(dg)}function uk({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(ck,{name:s,value:t}):Array.isArray(t)?x.jsx(fk,{name:s,value:t,depth:r,defaultOpenDepth:i}):x.jsx(dk,{name:s,value:t,depth:r,defaultOpenDepth:i})}function ck({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 fk({name:t,value:r,depth:i,defaultOpenDepth:s}){const l=i<s,[c,d]=Q.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((m,v)=>x.jsxs("li",{children:[x.jsx("span",{className:"text-violet-400/90 mr-1",children:v}),x.jsx(od,{value:m,depth:i+1,defaultOpenDepth:s})]},v))}),!c&&x.jsx("span",{className:"text-slate-600",children:" … "}),x.jsx("span",{className:"text-slate-500",children:"]"})]})}function dk({name:t,value:r,depth:i,defaultOpenDepth:s}){const l=Object.keys(r),c=i<s,[d,m]=Q.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:()=>m(!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(v=>x.jsx("li",{children:x.jsx(od,{name:v,value:r[v],depth:i+1,defaultOpenDepth:s})},v))}),!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 hk(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 pk(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??[],m=new Set,v=[];for(const k of[...c,...d]){const w=hk(t,k);if(!w||!["query","path","header","cookie"].includes(w.in))continue;const S=`${w.in}:${w.name}`;m.has(S)||(m.add(S),v.push({name:w.name,in:w.in,required:!!w.required,description:typeof w.description=="string"?w.description:void 0}))}return v}function fm(t,r,i){var v,b,k,w;const s=(b=(v=t.paths)==null?void 0:v[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,m=cm(t,d);if(!m)return null;if(m.type==="object"&&m.properties&&Object.keys(m.properties).length>0){const S=new Set(m.required??[]);return Object.keys(m.properties).map(C=>{const j=m.properties[C],T=j&&"$ref"in j?cm(t,j):j;return{key:C,required:S.has(C),description:T==null?void 0:T.description,format:T==null?void 0:T.format,type:T==null?void 0:T.type}})}return null}function mk(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function gk(t,r){let i=t;for(const[s,l]of Object.entries(r))i=i.replace(new RegExp(`\\{${mk(s)}\\}`,"g"),encodeURIComponent(l));return i}function yk(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 hg(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 m=Number(c);i[l.key]=Number.isFinite(m)?m: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=hg(t,r);return JSON.stringify(i,null,2)}function vk(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 xk(t){return/\{[^/}]+\}/.test(t)}function wk(t,r,i,s,l){var m,v;const c={...t};for(const b of r){const k=(m=i[b.name])==null?void 0:m.trim();k&&(c[b.name]=k)}const d=[];for(const b of s){const k=(v=l[b.name])==null?void 0:v.trim();k&&d.push(`${b.name}=${k}`)}return d.length&&(c.Cookie=c.Cookie?`${c.Cookie}; ${d.join("; ")}`:d.join("; ")),c}function bk({doc:t,selectedOp:r,baseUrl:i,buildHeaders:s}){const[l,c]=Q.useState({}),[d,m]=Q.useState({}),[v,b]=Q.useState({}),[k,w]=Q.useState({}),[S,C]=Q.useState({}),[j,T]=Q.useState("{}"),[$,I]=Q.useState("raw"),[K,P]=Q.useState(null),[R,Y]=Q.useState(null),V=Q.useMemo(()=>pk(t,r.method,r.path),[t,r.method,r.path]),B=Q.useMemo(()=>V.filter(F=>F.in==="path"),[V]),ae=Q.useMemo(()=>V.filter(F=>F.in==="query"),[V]),de=Q.useMemo(()=>V.filter(F=>F.in==="header"),[V]),we=Q.useMemo(()=>V.filter(F=>F.in==="cookie"),[V]),H=Q.useMemo(()=>fm(t,r.method,r.path),[t,r.method,r.path]),fe=r.method.toLowerCase(),xe=fe!=="get"&&fe!=="head";Q.useEffect(()=>{c({}),m({}),b({}),w({}),Y(null),P(null);const F=fm(t,r.method,r.path);F!=null&&F.length?(C(Object.fromEntries(F.map(A=>[A.key,""]))),I("fields"),T(dm(F,{}))):(C({}),I("raw"),T("{}"))},[t,r.method,r.path]);const D=Q.useCallback((F,A)=>{C(U=>({...U,[F]:A}))},[]),ue=Q.useCallback(()=>{H!=null&&H.length&&T(dm(H,S)),I("raw")},[H,S]),G=Q.useCallback(()=>{H!=null&&H.length&&C(vk(H,j)),I("fields")},[H,j]),ie=async()=>{var $e,Ae,_e,Be,ke;Y(null);const F=ks(t,i);for(const He of B)if(He.required&&!(($e=l[He.name])!=null&&$e.trim())){Y(`Parámetro de ruta obligatorio: ${He.name}`);return}for(const He of ae)if(He.required&&!((Ae=d[He.name])!=null&&Ae.trim())){Y(`Query obligatorio: ${He.name}`);return}for(const He of de)if(He.required&&!((_e=v[He.name])!=null&&_e.trim())){Y(`Header obligatorio: ${He.name}`);return}for(const He of we)if(He.required&&!((Be=k[He.name])!=null&&Be.trim())){Y(`Cookie obligatorio: ${He.name}`);return}let A=gk(r.path,l);if(xk(A)){Y("Quedan placeholders `{…}` en la ruta sin valor.");return}const U=yk(d,V),be=`${F}${A}${U}`,Se=wk(s(),de,v,we,k),Me={method:r.method.toUpperCase(),headers:Se,credentials:"include"};if(xe)if($==="fields"&&(H!=null&&H.length)){for(const Oe of H)if(Oe.required&&!((ke=S[Oe.key])!=null&&ke.trim())){Y(`Campo de body obligatorio: ${Oe.key}`);return}const He=hg(H,S);Me.body=JSON.stringify(He)}else{const He=j.trim()||"{}";Me.body=He}try{const He=await fetch(be,Me),Oe=await He.text();let qe=null;try{qe=Oe?JSON.parse(Oe):null}catch{qe=null}P({status:He.status,statusText:He.statusText,bodyText:Oe,json:qe})}catch(He){P(null),Y(He instanceof Error?He.message:String(He))}},z=(F,A,U)=>x.jsxs("label",{className:"block text-xs",children:[x.jsxs("span",{className:"text-slate-400",children:[F.name,F.required?x.jsx("span",{className:"text-rose-400/90",children:" *"}):null,F.in!=="path"?x.jsxs("span",{className:"text-slate-600 ml-1",children:["(",F.in,")"]}):null]}),x.jsx("input",{type:"text",className:"mt-0.5 w-full min-h-[44px] sm:min-h-0 bg-surface-900 border border-surface-600 rounded-lg px-3 py-2 font-mono text-[11px] text-slate-200 transition-colors duration-150 hover:border-surface-500",value:A[F.name]??"",onChange:be=>U(Se=>({...Se,[F.name]:be.target.value})),placeholder:F.description||(F.in==="path"?`{${F.name}}`:""),autoComplete:"off"})]},`${F.in}:${F.name}`),q=F=>x.jsxs("label",{className:"block text-xs",children:[x.jsxs("span",{className:"text-slate-400",children:[F.key,F.required?x.jsx("span",{className:"text-rose-400/90",children:" *"}):null,F.type?x.jsxs("span",{className:"text-slate-600 ml-1",children:["(",F.type,")"]}):null]}),x.jsx("input",{type:"text",className:"mt-0.5 w-full min-h-[44px] sm:min-h-0 bg-surface-900 border border-surface-600 rounded-lg px-3 py-2 font-mono text-[11px] text-slate-200 transition-colors duration-150 hover:border-surface-500",value:S[F.key]??"",onChange:A=>D(F.key,A.target.value),placeholder:F.description||"valor o JSON para objetos anidados",autoComplete:"off"})]},F.key);return x.jsxs("section",{className:"space-y-4 rounded-2xl border border-surface-700/80 bg-surface-900/30 p-4 shadow-lg shadow-black/10",children:[x.jsx("h3",{className:"text-sm font-semibold tracking-tight text-slate-200",children:"Probar"}),(B.length>0||ae.length>0||de.length>0||we.length>0)&&x.jsxs("div",{className:"space-y-2 rounded-lg border border-surface-700 bg-surface-900/40 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:[B.map(F=>z(F,l,c)),ae.map(F=>z(F,d,m)),de.map(F=>z(F,v,b)),we.map(F=>z(F,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"}),H!=null&&H.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 ${$==="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 ${$==="raw"?"bg-accent/25 text-accent font-medium":"bg-surface-800 text-slate-400 hover:text-slate-200"}`,onClick:ue,children:"JSON raw"})]}):x.jsx("span",{className:"text-[10px] text-slate-500",children:"(solo JSON — sin propiedades `object` en el spec)"})]}),$==="fields"&&(H!=null&&H.length)?x.jsx("div",{className:"grid gap-2 sm:grid-cols-2 rounded-lg border border-surface-700 bg-surface-900/40 p-3",children:H.map(F=>q(F))}):x.jsx("textarea",{className:"w-full h-28 min-h-[7rem] bg-surface-900 border border-surface-600 rounded-lg p-3 font-mono text-xs text-slate-200 leading-relaxed transition-colors duration-150 hover:border-surface-500",value:j,onChange:F=>T(F.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"}),K?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:K.status>=200&&K.status<300?"text-emerald-400":K.status>=400?"text-rose-400":"text-amber-300",children:K.status})," ",K.statusText]}),K.json!==null?x.jsx(uk,{data:K.json,defaultOpenDepth:3}):x.jsx("pre",{className:"text-xs bg-surface-900 border border-surface-700 rounded-lg p-3 overflow-auto max-h-64 text-emerald-300/90 whitespace-pre-wrap font-mono",children:K.bodyText||"—"})]}):x.jsx("p",{className:"text-xs text-slate-500",children:"—"})]})]})}function _k(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 Sk(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 kk(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 Nk(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 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("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 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("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 jk(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 Pk(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 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:"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 hm(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 Tk="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"}}async function Ik(t,r,i,s,l){const c=`${t.replace(/\/?$/,"/")}__chat`,d=await fetch(c,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json",[Tk]:r},body:JSON.stringify({provider:i,model:s,messages:l})}),m=await d.text();if(!d.ok){let v=m;try{const b=JSON.parse(m);v=b.message??b.error??m}catch{}throw new Error(v||`HTTP ${d.status}`)}return JSON.parse(m)}const pg="adt-llm-provider",mg="adt-llm-model",gg="adt-llm-key";function $k(){try{const t=localStorage.getItem(pg),r=t==="anthropic"||t==="openai"||t==="openrouter"?t:"openrouter",i=localStorage.getItem(mg)??"",s=localStorage.getItem(gg)??"";return{provider:r,model:i,apiKey:s}}catch{return{provider:"openrouter",model:"",apiKey:""}}}function Ak(t,r,i){try{localStorage.setItem(pg,t),localStorage.setItem(mg,r),localStorage.setItem(gg,i)}catch{}}function Ok({doc:t}){const r="/docs/",[i,s]=Q.useState("openrouter"),[l,c]=Q.useState(""),[d,m]=Q.useState(""),[v,b]=Q.useState(!0),[k,w]=Q.useState([]),[S,C]=Q.useState(""),[j,T]=Q.useState(!1),[$,I]=Q.useState(null),K=Q.useRef(null);Q.useEffect(()=>{const B=$k();s(B.provider),c(B.model||Zl(B.provider)),m(B.apiKey)},[]);const P=Q.useMemo(()=>{const B=t.info.title??"API",ae=t.info.version??"",de=t.paths?Object.keys(t.paths).slice(0,80):[],we=de.length>0?`
207
+ Algunas rutas del spec: ${de.slice(0,40).join(", ")}${de.length>40?"…":""}`:"";return`Eres un asistente técnico para la documentación OpenAPI «${B}»${ae?` v${ae}`:""}.
208
+ Ayuda a entender endpoints, parámetros, seguridad y ejemplos de uso. Sé claro y conciso.
209
+ Si el usuario pide ejecutar algo destructivo, advierte que solo pueden probarse requests desde la pestaña Explorar.${we}`},[t]);Q.useEffect(()=>{var B;(B=K.current)==null||B.scrollIntoView({behavior:"smooth"})},[k]);const R=Q.useCallback(()=>{Ak(i,l.trim(),d),I(null),b(!1)},[i,l,d]),Y=Q.useCallback(async()=>{const B=S.trim();if(!B||j)return;if(!d.trim()){I("Configura tu clave API en Ajustes del asistente."),b(!0);return}I(null);const ae=l.trim()||Zl(i),de={role:"user",content:B},we=[{role:"system",content:P},...k.filter(H=>H.role!=="system"),de];C(""),w(H=>[...H,de]),T(!0);try{const H=await Ik(r,d.trim(),i,ae,we);w(fe=>[...fe,{role:"assistant",content:H.content??""}])}catch(H){I(H instanceof Error?H.message:String(H))}finally{T(!1)}},[d,r,S,j,k,l,i,P]),V=Q.useCallback(()=>{w([]),I(null)},[]);return x.jsxs("div",{className:"max-w-3xl mx-auto space-y-4 pb-8",children:[x.jsxs("div",{className:"rounded-2xl border border-surface-700/90 bg-surface-900/50 overflow-hidden",children:[x.jsxs("button",{type:"button",onClick:()=>b(B=>!B),className:"w-full flex items-center justify-between px-4 py-3 text-left text-sm font-medium text-slate-200 hover:bg-surface-800/60 transition-colors","aria-expanded":v,children:[x.jsx("span",{children:"Ajustes del asistente (clave propia)"}),x.jsx("span",{className:"text-slate-500",children:v?"▼":"▶"})]}),v?x.jsxs("div",{className:"px-4 pb-4 space-y-3 border-t border-surface-700/80",children:[x.jsx("p",{className:"text-xs text-slate-500 leading-relaxed mt-3",children:"Tu clave se guarda solo en este navegador (localStorage). El servidor solo la reenvía al proveedor que elijas; no se almacena en disco del servidor."}),x.jsxs("label",{className:"block text-xs text-slate-400",children:["Proveedor",x.jsxs("select",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded-lg px-3 py-2 text-sm text-slate-200",value:i,onChange:B=>{const ae=B.target.value;s(ae),c(de=>de.trim()?de:Zl(ae))},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, se usa uno por defecto si vacío)",x.jsx("input",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded-lg px-3 py-2 text-sm font-mono text-slate-200",value:l,onChange:B=>c(B.target.value),placeholder:Zl(i),spellCheck:!1})]}),x.jsxs("label",{className:"block text-xs text-slate-400",children:["API key",x.jsx("input",{type:"password",className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded-lg px-3 py-2 text-sm font-mono text-slate-200",value:d,onChange:B=>m(B.target.value),placeholder:i==="anthropic"?"sk-ant-…":i==="openai"?"sk-…":"sk-or-v1-…",autoComplete:"off"})]}),x.jsx("div",{className:"flex flex-wrap gap-2",children:x.jsx("button",{type:"button",onClick:R,className:"px-4 py-2 rounded-lg bg-accent text-surface-950 text-sm font-medium hover:brightness-110 transition-[filter]",children:"Guardar ajustes"})})]}):null]}),$?x.jsx("p",{className:"text-sm text-rose-300 bg-rose-950/40 border border-rose-800/50 rounded-lg px-3 py-2",role:"alert",children:$}):null,x.jsxs("div",{className:"rounded-2xl border border-surface-700 bg-surface-950/40 min-h-[320px] flex flex-col",children:[x.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b border-surface-700/80",children:[x.jsx("span",{className:"text-xs font-medium text-slate-400",children:"Conversación"}),x.jsx("button",{type:"button",onClick:V,className:"text-xs text-slate-500 hover:text-slate-300 underline",children:"Vaciar chat"})]}),x.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-4 max-h-[min(60vh,28rem)]",children:[k.length===0?x.jsx("p",{className:"text-sm text-slate-500 text-center py-8",children:"Escribe una pregunta sobre esta API (rutas, esquemas, autenticación…)."}):k.map((B,ae)=>x.jsxs("div",{className:`text-sm leading-relaxed rounded-xl px-3 py-2 ${B.role==="user"?"bg-accent/10 text-slate-100 ml-4 border border-accent/20":"bg-surface-800/80 text-slate-200 mr-4 border border-surface-600/50"}`,children:[x.jsx("span",{className:"text-[10px] uppercase tracking-wider text-slate-500 block mb-1",children:B.role==="user"?"Tú":"Asistente"}),x.jsx("div",{className:"whitespace-pre-wrap break-words",children:B.content})]},`${ae}-${B.role}`)),x.jsx("div",{ref:K})]}),x.jsxs("div",{className:"p-3 border-t border-surface-700/80 flex gap-2",children:[x.jsx("textarea",{className:"flex-1 min-h-[48px] max-h-40 bg-surface-900 border border-surface-600 rounded-lg px-3 py-2 text-sm text-slate-200 resize-y",rows:2,value:S,onChange:B=>C(B.target.value),onKeyDown:B=>{B.key==="Enter"&&!B.shiftKey&&(B.preventDefault(),Y())},placeholder:"Pregunta sobre el spec… (Enter envía, Shift+Enter salto)",disabled:j}),x.jsx("button",{type:"button",onClick:()=>void Y(),disabled:j||!S.trim(),className:"self-end shrink-0 min-h-[48px] px-4 rounded-xl bg-accent text-surface-950 font-semibold text-sm disabled:opacity-40 disabled:cursor-not-allowed",children:j?"…":"Enviar"})]})]})]})}const yg=[{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 pm(t){return yg.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 Rk(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 Dk(){var Tn;const t=lk(),[r,i]=Q.useState(null),[s,l]=Q.useState(null),[c,d]=Q.useState("explore"),[m,v]=Q.useState(""),[b,k]=Q.useState(null),[w,S]=Q.useState(null),[C,j]=Q.useState("typescript"),[T,$]=Q.useState(""),[I,K]=Q.useState(""),[P,R]=Q.useState("X-Api-Key"),[Y,V]=Q.useState({nodes:[],edges:[]}),[B,ae]=Q.useState(0),[de,we]=Q.useState("Mi flujo"),[H,fe]=Q.useState([]),[xe,D]=Q.useState(""),[ue,G]=Q.useState({name:"Suite 1",cases:[]}),[ie,z]=Q.useState([]),[q,F]=Q.useState(""),[A,U]=Q.useState(""),[be,Se]=Q.useState(null),[Me,$e]=Q.useState(null),[Ae,_e]=Q.useState(null),Be=(W,Fe)=>{try{const Le=sessionStorage.getItem(W);if(Le==="1")return!0;if(Le==="0")return!1}catch{}return Fe},[ke,He]=Q.useState(()=>Be("adt-collapse-main",!1)),[Oe,qe]=Q.useState(()=>Be("adt-collapse-explore",!1)),ut="/docs/openapi.json",ct="/docs/preset.json",it=Q.useCallback(async()=>{const[W,Fe]=await Promise.all([bt.flows.toArray(),bt.testSuites.toArray()]);fe(W.sort((Le,nt)=>(Le.name??"").localeCompare(nt.name??""))),z(Fe.sort((Le,nt)=>(Le.name??"").localeCompare(nt.name??"")))},[]);Q.useEffect(()=>{var Fe,Le;if(!r)return;const W=((Fe=t.productName)==null?void 0:Fe.trim())||((Le=r.info.title)==null?void 0:Le.trim())||"API";document.title=W},[r,t.productName]),Q.useEffect(()=>{fetch(ut,{credentials:"include"}).then(async W=>{if(W.status===401){let Fe="/docs/__auth/login";try{const Le=await W.json();Le.loginPath&&(Fe=Le.loginPath)}catch{}return window.location.href=Fe,null}if(!W.ok)throw new Error(`${W.status} ${W.statusText}`);return W.json()}).then(W=>{W&&(i(W),v(ks(W)),l(null))}).catch(W=>l(W.message))},[ut]),Q.useEffect(()=>{try{sessionStorage.setItem("adt-collapse-main",ke?"1":"0")}catch{}},[ke]),Q.useEffect(()=>{try{sessionStorage.setItem("adt-collapse-explore",Oe?"1":"0")}catch{}},[Oe]),Q.useEffect(()=>{(async()=>{try{const W=await fetch("/docs/__auth/session",{credentials:"include"});if(W.ok){const Fe=await W.json();_e({username:Fe.username})}else _e(null)}catch{_e(null)}})()},[]),Q.useEffect(()=>{if(!r)return;let W=!1;return(async()=>{try{const Fe=await fetch(ct,{credentials:"include"});if(!Fe.ok||W)return;const Le=await Fe.json(),nt=await Vy(Le);!W&&nt&&await it()}catch{}})(),()=>{W=!0}},[r,ct,it]),Q.useEffect(()=>{it(),bt.kv.get("bearer").then(W=>W&&$(W.value)),bt.kv.get("apiKey").then(W=>W&&K(W.value))},[it]);const Tt=Q.useMemo(()=>r?Ry(r):[],[r]),_t=Q.useMemo(()=>r?Gr(r):[],[r]),Ht=Q.useMemo(()=>b?_t.filter(W=>(W.tags??["default"]).includes(b)):_t,[_t,b]);Q.useEffect(()=>{if(_t.length&&!A){const W=_t[0];U(vf(W.method,W.path))}},[_t,A]),Q.useEffect(()=>{if(_t.length===0||Y.nodes.length>0||c!=="flows"||be!=null)return;const W=_t[0];V({nodes:[{id:crypto.randomUUID(),method:W.method.toLowerCase(),path:W.path,x:80,y:120}],edges:[]}),ae(Fe=>Fe+1)},[_t,Y.nodes.length,c,be]);const Ot=Q.useCallback(()=>{const W={"Content-Type":"application/json"};return T.trim()&&(W.Authorization=`Bearer ${T.trim()}`),I.trim()&&(W[P]=I.trim()),W},[T,I,P]),St=Q.useMemo(()=>{if(!r||!w)return null;const W={};for(const{id:Fe}of yf)W[Fe]=$y(r,Fe,w.method,w.path);return W},[r,w]),bn=Q.useMemo(()=>r?Oy(r,C,b):"",[r,C,b]),fn=async W=>{var nn;if(!r)return"";const Fe={};let Le="";const nt=ks(r,m);for(let Yt=0;Yt<W.length;Yt++){const Kt=W[Yt];let rn=Kt.path;for(const[or,In]of Object.entries(Fe))rn=rn.replace(`{${or}}`,In);const to=`${nt}${rn}`,on={method:Kt.method.toUpperCase(),headers:Ot()},qn=Kt.method.toLowerCase();qn!=="get"&&qn!=="head"&&(on.body="{}");const zt=await fetch(to,{...on,credentials:"include"}),Wn=await zt.json().catch(()=>({}));if(Le+=`Paso ${Yt+1}: ${zt.status}
210
+ ${JSON.stringify(Wn,null,2)}
211
+
212
+ `,(nn=Kt.extract)!=null&&nn.jsonPath){const or=Rf(Wn,Kt.extract.jsonPath);or!==void 0&&(Fe[Kt.extract.varName]=String(or))}}return Le},gr=async()=>{if(!r)return;const W=ks(r,m);if(Y.nodes.length===0){D("Añade al menos un nodo al flujo.");return}const Fe=await um(Y,W,Ot);D(Fe)},_n=async W=>{if(!r)return;const Fe=ks(r,m),Le=W.graph&&W.graph.nodes.length>0?await um(W.graph,Fe,Ot):await fn(W.steps);D(Le),d("flows")},Nt=W=>{we(W.name),V(W.graph&&W.graph.nodes.length>0?W.graph:sk(W.steps.length?W.steps:[{method:"get",path:"/"}])),ae(Fe=>Fe+1),Se(W.id??null),d("flows")},Vt=()=>{Se(null),we("Nuevo flujo"),_t[0]?V({nodes:[{id:crypto.randomUUID(),method:_t[0].method.toLowerCase(),path:_t[0].path,x:80,y:120}],edges:[]}):V({nodes:[],edges:[]}),ae(W=>W+1)},Hn=Q.useCallback(W=>{V(W)},[]),tr=async()=>{const W=ik(Y);if(be!=null)await bt.flows.update(be,{name:de,steps:W,graph:Y});else{const Fe=await bt.flows.add({name:de,steps:W,graph:Y});Se(Fe)}await it()},Sn=async W=>{W!==void 0&&(W===be&&(Se(null),Vt()),await bt.flows.delete(W),await it())},Pn=()=>{if(!A)return;const{method:W,path:Fe}=Rk(A),Le={id:crypto.randomUUID(),method:W,path:Fe,expectStatus:200,contains:void 0,jsonPath:void 0,expectJsonValue:void 0};G(nt=>({...nt,cases:[...nt.cases,Le]}))},Vn=W=>{G(Fe=>({...Fe,cases:Fe.cases.filter(Le=>Le.id!==W)}))},dn=(W,Fe)=>{G(Le=>({...Le,cases:Le.cases.map(nt=>nt.id===W?{...nt,...Fe}:nt)}))},nr=async W=>{if(!r)return"";const Fe=ks(r,m);let Le="";for(const nt of W){const nn=`${Fe}${nt.path}`,Yt=await fetch(nn,{method:nt.method.toUpperCase(),headers:Ot(),credentials:"include"}),Kt=await Yt.text(),rn=Ky(nt,Yt.status,Kt),to=`${rn.pass?"PASS":"FAIL"} ${nt.method.toUpperCase()} ${nt.path}`;Le+=`${to}
213
+ ${rn.lines.map(on=>` ${on}`).join(`
214
+ `)}
215
+
216
+ `}return Le},kn=async()=>{const W=await nr(ue.cases);F(W)},Ye=async()=>{if(!r||ie.length===0)return;let W="";for(const Fe of ie)W+=`━━━ ${Fe.name} (${Fe.cases.length} casos) ━━━
217
+ `,W+=await nr(Fe.cases);F(W),d("tests")},Kn=async W=>{const Fe=await nr(W.cases);F(Fe),d("tests")},Nn=W=>{G({name:W.name,cases:W.cases.map(Fe=>({...Fe,id:Fe.id&&Fe.id.length>0?Fe.id:crypto.randomUUID()}))}),$e(W.id??null),d("tests")},rr=()=>{$e(null),G({name:"Nueva suite",cases:[]})},Ve=async()=>{if(Me!=null)await bt.testSuites.update(Me,{name:ue.name,cases:ue.cases});else{const W=await bt.testSuites.add({name:ue.name,cases:ue.cases});$e(W)}await it()},Mn=async W=>{W!==void 0&&(W===Me&&($e(null),G({name:"Nueva suite",cases:[]})),await bt.testSuites.delete(W),await it())},Un=async()=>{await bt.kv.put({key:"bearer",value:T}),await bt.kv.put({key:"apiKey",value:I})},yr=async()=>{const W=await Hy(),Fe=new Blob([JSON.stringify(W,null,2)],{type:"application/json"}),Le=document.createElement("a");Le.href=URL.createObjectURL(Fe),Le.download="api-doc-tor-export.json",Le.click()},Zr=async W=>{var nn;const Fe=(nn=W.target.files)==null?void 0:nn[0];if(!Fe)return;const Le=await Fe.text(),nt=JSON.parse(Le);await _m(nt),await it()},vr=async()=>{await fetch("/docs/__auth/logout",{method:"POST",credentials:"include"}),window.location.href="/docs/__auth/login"},Io=()=>{w&&(V(W=>{const Fe=W.nodes[W.nodes.length-1],Le=Fe?Fe.x+280:80,nt=(Fe==null?void 0:Fe.y)??120;return{nodes:[...W.nodes,{id:crypto.randomUUID(),method:w.method.toLowerCase(),path:w.path,x:Le,y:nt}],edges:W.edges}}),ae(W=>W+1),d("flows"))};if(s)return x.jsx("div",{className:"min-h-screen flex items-center justify-center p-8",children:x.jsxs("div",{role:"alert",className:"max-w-lg rounded-2xl border border-red-500/35 bg-surface-900/95 p-6 text-red-200 shadow-xl shadow-black/20",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: ",ut]})]})});if(!r)return x.jsx("div",{className:"min-h-screen flex items-center justify-center p-6",children:x.jsx("p",{className:"text-slate-400 motion-safe:animate-pulse",children:"Cargando especificación…"})});const eo=b===null?"Todos los endpoints (cliente único con todas las operaciones)":`Tag «${b}» (solo operaciones de este grupo)`,hn=((Tn=t.productName)==null?void 0:Tn.trim())||r.info.title;return x.jsxs("div",{className:"min-h-screen flex flex-col bg-surface-950 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:`w-full border-b md:border-b-0 md:border-r border-surface-700 bg-surface-900/90 shrink-0 transition-[width] duration-200 ease-out flex flex-col backdrop-blur-sm ${ke?"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:Zr}),x.jsxs("div",{className:ke?"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:hn,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:hn}),x.jsx("p",{className:"text-xs text-slate-500 mt-1",children:hn===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:()=>He(!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 (${H.length})`],["tests",`Tests (${ie.length})`],["assistant","Asistente"],["auth","Auth"]].map(([W,Fe])=>x.jsx("button",{type:"button",onClick:()=>d(W),className:`text-left px-3 py-2.5 md:py-2 rounded-lg text-sm transition-colors duration-200 ease-out min-h-[44px] md:min-h-0 flex items-center ${c===W?"bg-accent/20 text-accent shadow-inner shadow-accent/5":"text-slate-400 hover:bg-surface-800 hover:text-slate-200"}`,children:Fe},W))}),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 vr(),children:"Salir"})]}):null,x.jsxs("div",{className:"p-3 border-t border-surface-700 space-y-2",children:[x.jsx("button",{type:"button",onClick:yr,className:"w-full text-xs py-2.5 rounded-lg bg-surface-800 hover:bg-surface-700 transition-colors duration-200 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-lg bg-surface-800 hover:bg-surface-700 text-center cursor-pointer transition-colors duration-200 min-h-[44px] md:min-h-0 flex items-center justify-center",children:"Importar JSON"})]})]}),ke?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:()=>He(!1),"aria-label":"Mostrar menú lateral completo",title:"Expandir panel completo",children:x.jsx(hm,{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(Sk,{})}),x.jsxs("button",{type:"button",onClick:()=>d("flows"),title:`Flujos (${H.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(kk,{}),H.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:H.length>99?"99+":H.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(Nk,{}),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:()=>d("assistant"),title:"Asistente","aria-current":c==="assistant"?"page":void 0,className:`touch-target w-11 h-11 rounded-lg border flex items-center justify-center shrink-0 transition-colors duration-200 ${c==="assistant"?"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("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(Ck,{}),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:yr,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(jk,{})}),x.jsx("button",{type:"button",onClick:()=>{var W;return(W=document.getElementById("adt-state-import"))==null?void 0:W.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(Pk,{})}),Ae?x.jsx("button",{type:"button",onClick:()=>void vr(),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(Mk,{})}):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:"sticky top-0 z-20 border-b border-surface-700/90 px-4 py-3 flex flex-wrap gap-3 items-center bg-surface-900/75 backdrop-blur-md supports-[backdrop-filter]:bg-surface-900/60",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:"sm:ml-2 min-h-[44px] sm:min-h-0 bg-surface-800 border border-surface-600 rounded-lg px-3 py-2 text-sm w-full max-w-md text-slate-200 placeholder:text-slate-500 transition-colors duration-200 hover:border-surface-500",value:m,onChange:W=>v(W.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:`shrink-0 border-b lg:border-b-0 lg:border-r border-surface-700 overflow-auto transition-[width] duration-200 ease-out ${Oe?"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:Oe?"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:()=>qe(!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-lg min-h-[40px] sm:min-h-0 transition-colors duration-200 ${b===null?"bg-accent/30 text-slate-100":"bg-surface-800 text-slate-300 hover:bg-surface-700"}`,children:"Todos"}),Tt.map(W=>x.jsx("button",{type:"button",onClick:()=>k(W),className:`text-xs px-3 py-2 sm:py-1 rounded-lg min-h-[40px] sm:min-h-0 transition-colors duration-200 ${b===W?"bg-accent/30 text-slate-100":"bg-surface-800 text-slate-300 hover:bg-surface-700"}`,children:W},W))]})}),x.jsx("ul",{className:"text-sm",children:Ht.map(W=>x.jsx("li",{children:x.jsxs("button",{type:"button",onClick:()=>S({method:W.method,path:W.path}),className:`w-full text-left px-3 py-2.5 sm:py-2 min-h-[44px] sm:min-h-0 hover:bg-surface-800 flex gap-2 items-center transition-colors duration-150 rounded-r-md ${(w==null?void 0:w.method)===W.method&&w.path===W.path?"bg-surface-800/90 border-l-2 border-accent":""}`,children:[x.jsx(su,{method:W.method}),x.jsx("span",{className:"truncate text-slate-300",children:W.path})]})},`${W.method}:${W.path}`))})]}),Oe?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:()=>qe(!1),"aria-label":"Mostrar lista de endpoints completa",title:"Expandir lista de endpoints",children:x.jsx(hm,{className:"text-slate-300"})}),x.jsxs("div",{className:"text-center text-[9px] font-mono text-slate-500 leading-none px-0.5",title:`${Ht.length} operación(es) (filtro actual)`,children:[x.jsx("span",{className:"block text-slate-400 font-semibold text-[11px]",children:Ht.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:Ht.map((W,Fe)=>{const Le=(w==null?void 0:w.method)===W.method&&w.path===W.path;return x.jsx("button",{type:"button",role:"listitem",title:`${W.method.toUpperCase()} ${W.path}`,onClick:()=>S({method:W.method,path:W.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 ${_k(W.method)} ${Le?"ring-2 ring-accent/80 shadow-[inset_0_0_0_1px_rgba(56,189,248,0.2)]":""}`,children:Fe+1},`${W.method}:${W.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: ",eo]})]}),r?x.jsx(bk,{doc:r,selectedOp:w,baseUrl:m,buildHeaders:Ot}):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:St&&yf.map(({id:W,label:Fe})=>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:Fe}),x.jsx("button",{type:"button",className:"text-xs px-2 py-1 rounded bg-surface-700 hover:bg-surface-600",onClick:()=>void mm(St[W]),children:"Copiar"})]}),x.jsx("pre",{className:"text-[11px] p-3 overflow-auto max-h-56 text-slate-300 font-mono whitespace-pre-wrap",children:St[W]})]},W))})]}),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:eo}),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:W=>j(W.target.value),children:yf.map(({id:W,label:Fe})=>x.jsx("option",{value:W,children:Fe},W))})]}),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(bn),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:bn})]}),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:Io,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"}),H.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:H.map(W=>{var Fe,Le;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:W.name}),x.jsxs("span",{className:"text-xs text-slate-500 ml-2",children:[(((Le=(Fe=W.graph)==null?void 0:Fe.nodes)==null?void 0:Le.length)??W.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 _n(W),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:()=>Nt(W),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 Sn(W.id),children:"Eliminar"})]})]},W.id!=null?`flow-${W.id}`:`flow-${W.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:Vt,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:W=>we(W.target.value),placeholder:"Nombre del flujo"}),x.jsx(ok,{doc:r,ops:_t,graph:Y,onGraphChange:Hn},B),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 gr(),children:"Play (grafo)"}),x.jsx("button",{type:"button",className:"px-3 py-2 rounded-lg bg-surface-700 text-sm",onClick:()=>void tr(),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 Ye(),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(W=>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:W.name}),x.jsxs("span",{className:"text-xs text-slate-500 ml-2",children:[W.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 Kn(W),children:"Play"}),x.jsx("button",{type:"button",className:"text-xs px-2 py-1.5 rounded bg-accent/20 text-accent",onClick:()=>Nn(W),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 Mn(W.id),children:"Eliminar"})]})]},W.id!=null?`suite-${W.id}`:`suite-${W.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:rr,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:ue.name,onChange:W=>G(Fe=>({...Fe,name:W.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:W=>U(W.target.value),children:_t.map(W=>x.jsxs("option",{value:vf(W.method,W.path),children:[W.method.toUpperCase()," ",W.path]},vf(W.method,W.path)))})]}),x.jsx("button",{type:"button",className:"px-4 py-2 rounded-lg bg-surface-800 text-sm hover:bg-surface-700",onClick:Pn,children:"Añadir a la suite"})]}),x.jsx("ul",{className:"space-y-4",children:ue.cases.map(W=>{const Fe=pm(W.expectStatus)?String(W.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:W.method}),x.jsx("span",{className:"font-mono text-xs text-slate-300 break-all",children:W.path})]}),x.jsx("button",{type:"button",className:"text-xs text-red-400 hover:underline shrink-0",onClick:()=>Vn(W.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:Fe,onChange:Le=>{const nt=Le.target.value;if(nt==="custom"){dn(W.id,{expectStatus:pm(W.expectStatus)?1e3:W.expectStatus});return}dn(W.id,{expectStatus:Number(nt)})},children:[yg.map(Le=>x.jsx("option",{value:String(Le.value),children:Le.label},Le.value)),x.jsx("option",{value:"custom",children:"Otro…"})]}),Fe==="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:W.expectStatus,onChange:Le=>dn(W.id,{expectStatus:Number(Le.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:W.contains??"",onChange:Le=>dn(W.id,{contains:Le.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:W.jsonPath??"",onChange:Le=>dn(W.id,{jsonPath:Le.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:W.expectJsonValue??"",onChange:Le=>dn(W.id,{expectJsonValue:Le.target.value||void 0})})]})]})]},W.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 kn(),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 Ve(),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:q||"—"})]})]}),c==="assistant"&&x.jsx("div",{className:"flex-1 overflow-auto p-4 min-h-0",children:x.jsx(Ok,{doc:r})}),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: ",Dy(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:T,onChange:W=>$(W.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:W=>R(W.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:W=>K(W.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 Un(),children:"Recordar en este navegador"})]})]})]}),x.jsx("footer",{className:"border-t border-surface-700 px-3 py-2.5 text-center text-[11px] text-slate-600 bg-surface-950 shrink-0",children:"made with ♥ by andres arcila"})]})}const Lk={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 zk(t){return{...Lk,...t}}function Fk(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 Bk(t){var i;const r=zk(t==null?void 0:t.colors);return{productName:((i=t==null?void 0:t.productName)==null?void 0:i.trim())||null,logoDataUrl:t?Fk(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 Hk={credentials:"include"};function Vk(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 Kk(){const t=Bk(void 0);try{const r=await fetch("/docs/ui-config.json",Hk);return r.status===401?{...t,docsAuthRequired:!0}:r.ok?await r.json():t}catch{return t}}(async()=>{const t=await Kk();Vk(t.colorsRgb),vy.createRoot(document.getElementById("root")).render(x.jsx(gm.StrictMode,{children:x.jsx(ak,{value:{productName:t.productName,logoDataUrl:t.logoDataUrl},children:x.jsx(Dk,{})})}))})();