@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,247 @@
1
+ var ly=Object.defineProperty;var uy=(t,r,i)=>r in t?ly(t,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[r]=i;var ga=(t,r,i)=>uy(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 cy=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:{}},dt={};/**
2
+ * @license React
3
+ * react.production.min.js
4
+ *
5
+ * Copyright (c) Facebook, Inc. and its affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var Kp;function fy(){if(Kp)return dt;Kp=1;var t=Symbol.for("react.element"),r=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),c=Symbol.for("react.provider"),d=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),y=Symbol.for("react.suspense"),b=Symbol.for("react.memo"),k=Symbol.for("react.lazy"),x=Symbol.iterator;function S(A){return A===null||typeof A!="object"?null:(A=x&&A[x]||A["@@iterator"],typeof A=="function"?A:null)}var C={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},j=Object.assign,M={};function T(A,V,be){this.props=A,this.context=V,this.refs=M,this.updater=be||C}T.prototype.isReactComponent={},T.prototype.setState=function(A,V){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,V,"setState")},T.prototype.forceUpdate=function(A){this.updater.enqueueForceUpdate(this,A,"forceUpdate")};function I(){}I.prototype=T.prototype;function B(A,V,be){this.props=A,this.context=V,this.refs=M,this.updater=be||C}var P=B.prototype=new I;P.constructor=B,j(P,T.prototype),P.isPureReactComponent=!0;var R=Array.isArray,W=Object.prototype.hasOwnProperty,H={current:null},Q={key:!0,ref:!0,__self:!0,__source:!0};function G(A,V,be){var Se,$e={},Ae=null,Oe=null;if(V!=null)for(Se in V.ref!==void 0&&(Oe=V.ref),V.key!==void 0&&(Ae=""+V.key),V)W.call(V,Se)&&!Q.hasOwnProperty(Se)&&($e[Se]=V[Se]);var _e=arguments.length-2;if(_e===1)$e.children=be;else if(1<_e){for(var Fe=Array(_e),ke=0;ke<_e;ke++)Fe[ke]=arguments[ke+2];$e.children=Fe}if(A&&A.defaultProps)for(Se in _e=A.defaultProps,_e)$e[Se]===void 0&&($e[Se]=_e[Se]);return{$$typeof:t,type:A,key:Ae,ref:Oe,props:$e,_owner:H.current}}function pe(A,V){return{$$typeof:t,type:A.type,key:V,ref:A.ref,props:A.props,_owner:A._owner}}function we(A){return typeof A=="object"&&A!==null&&A.$$typeof===t}function U(A){var V={"=":"=0",":":"=2"};return"$"+A.replace(/[=:]/g,function(be){return V[be]})}var le=/\/+/g;function ve(A,V){return typeof A=="object"&&A!==null&&A.key!=null?U(""+A.key):V.toString(36)}function D(A,V,be,Se,$e){var Ae=typeof A;(Ae==="undefined"||Ae==="boolean")&&(A=null);var Oe=!1;if(A===null)Oe=!0;else switch(Ae){case"string":case"number":Oe=!0;break;case"object":switch(A.$$typeof){case t:case r:Oe=!0}}if(Oe)return Oe=A,$e=$e(Oe),A=Se===""?"."+ve(Oe,0):Se,R($e)?(be="",A!=null&&(be=A.replace(le,"$&/")+"/"),D($e,V,be,"",function(ke){return ke})):$e!=null&&(we($e)&&($e=pe($e,be+(!$e.key||Oe&&Oe.key===$e.key?"":(""+$e.key).replace(le,"$&/")+"/")+A)),V.push($e)),1;if(Oe=0,Se=Se===""?".":Se+":",R(A))for(var _e=0;_e<A.length;_e++){Ae=A[_e];var Fe=Se+ve(Ae,_e);Oe+=D(Ae,V,be,Fe,$e)}else if(Fe=S(A),typeof Fe=="function")for(A=Fe.call(A),_e=0;!(Ae=A.next()).done;)Ae=Ae.value,Fe=Se+ve(Ae,_e++),Oe+=D(Ae,V,be,Fe,$e);else if(Ae==="object")throw V=String(A),Error("Objects are not valid as a React child (found: "+(V==="[object Object]"?"object with keys {"+Object.keys(A).join(", ")+"}":V)+"). If you meant to render a collection of children, use an array instead.");return Oe}function ce(A,V,be){if(A==null)return A;var Se=[],$e=0;return D(A,Se,"","",function(Ae){return V.call(be,Ae,$e++)}),Se}function J(A){if(A._status===-1){var V=A._result;V=V(),V.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=V)}if(A._status===1)return A._result.default;throw A._result}var se={current:null},z={transition:null},K={ReactCurrentDispatcher:se,ReactCurrentBatchConfig:z,ReactCurrentOwner:H};function F(){throw Error("act(...) is not supported in production builds of React.")}return dt.Children={map:ce,forEach:function(A,V,be){ce(A,function(){V.apply(this,arguments)},be)},count:function(A){var V=0;return ce(A,function(){V++}),V},toArray:function(A){return ce(A,function(V){return V})||[]},only:function(A){if(!we(A))throw Error("React.Children.only expected to receive a single React element child.");return A}},dt.Component=T,dt.Fragment=i,dt.Profiler=l,dt.PureComponent=B,dt.StrictMode=s,dt.Suspense=y,dt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=K,dt.act=F,dt.cloneElement=function(A,V,be){if(A==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+A+".");var Se=j({},A.props),$e=A.key,Ae=A.ref,Oe=A._owner;if(V!=null){if(V.ref!==void 0&&(Ae=V.ref,Oe=H.current),V.key!==void 0&&($e=""+V.key),A.type&&A.type.defaultProps)var _e=A.type.defaultProps;for(Fe in V)W.call(V,Fe)&&!Q.hasOwnProperty(Fe)&&(Se[Fe]=V[Fe]===void 0&&_e!==void 0?_e[Fe]:V[Fe])}var Fe=arguments.length-2;if(Fe===1)Se.children=be;else if(1<Fe){_e=Array(Fe);for(var ke=0;ke<Fe;ke++)_e[ke]=arguments[ke+2];Se.children=_e}return{$$typeof:t,type:A.type,key:$e,ref:Ae,props:Se,_owner:Oe}},dt.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},dt.createElement=G,dt.createFactory=function(A){var V=G.bind(null,A);return V.type=A,V},dt.createRef=function(){return{current:null}},dt.forwardRef=function(A){return{$$typeof:h,render:A}},dt.isValidElement=we,dt.lazy=function(A){return{$$typeof:k,_payload:{_status:-1,_result:A},_init:J}},dt.memo=function(A,V){return{$$typeof:b,type:A,compare:V===void 0?null:V}},dt.startTransition=function(A){var V=z.transition;z.transition={};try{A()}finally{z.transition=V}},dt.unstable_act=F,dt.useCallback=function(A,V){return se.current.useCallback(A,V)},dt.useContext=function(A){return se.current.useContext(A)},dt.useDebugValue=function(){},dt.useDeferredValue=function(A){return se.current.useDeferredValue(A)},dt.useEffect=function(A,V){return se.current.useEffect(A,V)},dt.useId=function(){return se.current.useId()},dt.useImperativeHandle=function(A,V,be){return se.current.useImperativeHandle(A,V,be)},dt.useInsertionEffect=function(A,V){return se.current.useInsertionEffect(A,V)},dt.useLayoutEffect=function(A,V){return se.current.useLayoutEffect(A,V)},dt.useMemo=function(A,V){return se.current.useMemo(A,V)},dt.useReducer=function(A,V,be){return se.current.useReducer(A,V,be)},dt.useRef=function(A){return se.current.useRef(A)},dt.useState=function(A){return se.current.useState(A)},dt.useSyncExternalStore=function(A,V,be){return se.current.useSyncExternalStore(A,V,be)},dt.useTransition=function(){return se.current.useTransition()},dt.version="18.3.1",dt}var qp;function Ia(){return qp||(qp=1,Jc.exports=fy()),Jc.exports}/**
10
+ * @license React
11
+ * react-jsx-runtime.production.min.js
12
+ *
13
+ * Copyright (c) Facebook, Inc. and its affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var Wp;function dy(){if(Wp)return ya;Wp=1;var t=Ia(),r=Symbol.for("react.element"),i=Symbol.for("react.fragment"),s=Object.prototype.hasOwnProperty,l=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,c={key:!0,ref:!0,__self:!0,__source:!0};function d(h,y,b){var k,x={},S=null,C=null;b!==void 0&&(S=""+b),y.key!==void 0&&(S=""+y.key),y.ref!==void 0&&(C=y.ref);for(k in y)s.call(y,k)&&!c.hasOwnProperty(k)&&(x[k]=y[k]);if(h&&h.defaultProps)for(k in y=h.defaultProps,y)x[k]===void 0&&(x[k]=y[k]);return{$$typeof:r,type:h,key:S,ref:C,props:x,_owner:l.current}}return ya.Fragment=i,ya.jsx=d,ya.jsxs=d,ya}var Yp;function py(){return Yp||(Yp=1,Gc.exports=dy()),Gc.exports}var w=py(),Y=Ia();const gm=wu(Y);var Vl={},Zc={exports:{}},Hn={},ef={exports:{}},tf={};/**
18
+ * @license React
19
+ * scheduler.production.min.js
20
+ *
21
+ * Copyright (c) Facebook, Inc. and its affiliates.
22
+ *
23
+ * This source code is licensed under the MIT license found in the
24
+ * LICENSE file in the root directory of this source tree.
25
+ */var Xp;function hy(){return Xp||(Xp=1,(function(t){function r(z,K){var F=z.length;z.push(K);e:for(;0<F;){var A=F-1>>>1,V=z[A];if(0<l(V,K))z[A]=K,z[F]=V,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 K=z[0],F=z.pop();if(F!==K){z[0]=F;e:for(var A=0,V=z.length,be=V>>>1;A<be;){var Se=2*(A+1)-1,$e=z[Se],Ae=Se+1,Oe=z[Ae];if(0>l($e,F))Ae<V&&0>l(Oe,$e)?(z[A]=Oe,z[Ae]=F,A=Ae):(z[A]=$e,z[Se]=F,A=Se);else if(Ae<V&&0>l(Oe,F))z[A]=Oe,z[Ae]=F,A=Ae;else break e}}return K}function l(z,K){var F=z.sortIndex-K.sortIndex;return F!==0?F:z.id-K.id}if(typeof performance=="object"&&typeof performance.now=="function"){var c=performance;t.unstable_now=function(){return c.now()}}else{var d=Date,h=d.now();t.unstable_now=function(){return d.now()-h}}var y=[],b=[],k=1,x=null,S=3,C=!1,j=!1,M=!1,T=typeof setTimeout=="function"?setTimeout:null,I=typeof clearTimeout=="function"?clearTimeout:null,B=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 K=i(b);K!==null;){if(K.callback===null)s(b);else if(K.startTime<=z)s(b),K.sortIndex=K.expirationTime,r(y,K);else break;K=i(b)}}function R(z){if(M=!1,P(z),!j)if(i(y)!==null)j=!0,J(W);else{var K=i(b);K!==null&&se(R,K.startTime-z)}}function W(z,K){j=!1,M&&(M=!1,I(G),G=-1),C=!0;var F=S;try{for(P(K),x=i(y);x!==null&&(!(x.expirationTime>K)||z&&!U());){var A=x.callback;if(typeof A=="function"){x.callback=null,S=x.priorityLevel;var V=A(x.expirationTime<=K);K=t.unstable_now(),typeof V=="function"?x.callback=V:x===i(y)&&s(y),P(K)}else s(y);x=i(y)}if(x!==null)var be=!0;else{var Se=i(b);Se!==null&&se(R,Se.startTime-K),be=!1}return be}finally{x=null,S=F,C=!1}}var H=!1,Q=null,G=-1,pe=5,we=-1;function U(){return!(t.unstable_now()-we<pe)}function le(){if(Q!==null){var z=t.unstable_now();we=z;var K=!0;try{K=Q(!0,z)}finally{K?ve():(H=!1,Q=null)}}else H=!1}var ve;if(typeof B=="function")ve=function(){B(le)};else if(typeof MessageChannel<"u"){var D=new MessageChannel,ce=D.port2;D.port1.onmessage=le,ve=function(){ce.postMessage(null)}}else ve=function(){T(le,0)};function J(z){Q=z,H||(H=!0,ve())}function se(z,K){G=T(function(){z(t.unstable_now())},K)}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,J(W))},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"):pe=0<z?Math.floor(1e3/z):5},t.unstable_getCurrentPriorityLevel=function(){return S},t.unstable_getFirstCallbackNode=function(){return i(y)},t.unstable_next=function(z){switch(S){case 1:case 2:case 3:var K=3;break;default:K=S}var F=S;S=K;try{return z()}finally{S=F}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(z,K){switch(z){case 1:case 2:case 3:case 4:case 5:break;default:z=3}var F=S;S=z;try{return K()}finally{S=F}},t.unstable_scheduleCallback=function(z,K,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 V=-1;break;case 2:V=250;break;case 5:V=1073741823;break;case 4:V=1e4;break;default:V=5e3}return V=F+V,z={id:k++,callback:K,priorityLevel:z,startTime:F,expirationTime:V,sortIndex:-1},F>A?(z.sortIndex=F,r(b,z),i(y)===null&&z===i(b)&&(M?(I(G),G=-1):M=!0,se(R,F-A))):(z.sortIndex=V,r(y,z),j||C||(j=!0,J(W))),z},t.unstable_shouldYield=U,t.unstable_wrapCallback=function(z){var K=S;return function(){var F=S;S=K;try{return z.apply(this,arguments)}finally{S=F}}}})(tf)),tf}var Qp;function my(){return Qp||(Qp=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 Gp;function gy(){if(Gp)return Hn;Gp=1;var t=Ia(),r=my();function i(e){for(var n="https://reactjs.org/docs/error-decoder.html?invariant="+e,o=1;o<arguments.length;o++)n+="&args[]="+encodeURIComponent(arguments[o]);return"Minified React error #"+e+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var s=new Set,l={};function c(e,n){d(e,n),d(e+"Capture",n)}function d(e,n){for(l[e]=n,e=0;e<n.length;e++)s.add(n[e])}var h=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),y=Object.prototype.hasOwnProperty,b=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,k={},x={};function S(e){return y.call(x,e)?!0:y.call(k,e)?!1:b.test(e)?x[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 M(e,n,o,u,p,g,E){this.acceptsBooleans=n===2||n===3||n===4,this.attributeName=u,this.attributeNamespace=p,this.mustUseProperty=o,this.propertyName=e,this.type=n,this.sanitizeURL=g,this.removeEmptyString=E}var T={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){T[e]=new M(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var n=e[0];T[n]=new M(n,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){T[e]=new M(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){T[e]=new M(e,2,!1,e,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){T[e]=new M(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){T[e]=new M(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){T[e]=new M(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){T[e]=new M(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){T[e]=new M(e,5,!1,e.toLowerCase(),null,!1,!1)});var I=/[\-:]([a-z])/g;function B(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,B);T[n]=new M(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,B);T[n]=new M(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,B);T[n]=new M(n,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){T[e]=new M(e,1,!1,e.toLowerCase(),null,!1,!1)}),T.xlinkHref=new M("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){T[e]=new M(e,1,!1,e.toLowerCase(),null,!0,!0)});function P(e,n,o,u){var p=T.hasOwnProperty(n)?T[n]:null;(p!==null?p.type!==0:u||!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(j(n,o,p,u)&&(o=null),u||p===null?S(n)&&(o===null?e.removeAttribute(n):e.setAttribute(n,""+o)):p.mustUseProperty?e[p.propertyName]=o===null?p.type===3?!1:"":o:(n=p.attributeName,u=p.attributeNamespace,o===null?e.removeAttribute(n):(p=p.type,o=p===3||p===4&&o===!0?"":""+o,u?e.setAttributeNS(u,n,o):e.setAttribute(n,o))))}var R=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,W=Symbol.for("react.element"),H=Symbol.for("react.portal"),Q=Symbol.for("react.fragment"),G=Symbol.for("react.strict_mode"),pe=Symbol.for("react.profiler"),we=Symbol.for("react.provider"),U=Symbol.for("react.context"),le=Symbol.for("react.forward_ref"),ve=Symbol.for("react.suspense"),D=Symbol.for("react.suspense_list"),ce=Symbol.for("react.memo"),J=Symbol.for("react.lazy"),se=Symbol.for("react.offscreen"),z=Symbol.iterator;function K(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 V(e){if(A===void 0)try{throw Error()}catch(o){var n=o.stack.trim().match(/\n( *(at )?)/);A=n&&n[1]||""}return`
34
+ `+A+e}var be=!1;function Se(e,n){if(!e||be)return"";be=!0;var o=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(n)if(n=function(){throw Error()},Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(n,[])}catch(ye){var u=ye}Reflect.construct(e,[],n)}else{try{n.call()}catch(ye){u=ye}e.call(n.prototype)}else{try{throw Error()}catch(ye){u=ye}e()}}catch(ye){if(ye&&u&&typeof ye.stack=="string"){for(var p=ye.stack.split(`
35
+ `),g=u.stack.split(`
36
+ `),E=p.length-1,L=g.length-1;1<=E&&0<=L&&p[E]!==g[L];)L--;for(;1<=E&&0<=L;E--,L--)if(p[E]!==g[L]){if(E!==1||L!==1)do if(E--,L--,0>L||p[E]!==g[L]){var X=`
37
+ `+p[E].replace(" at new "," at ");return e.displayName&&X.includes("<anonymous>")&&(X=X.replace("<anonymous>",e.displayName)),X}while(1<=E&&0<=L);break}}}finally{be=!1,Error.prepareStackTrace=o}return(e=e?e.displayName||e.name:"")?V(e):""}function $e(e){switch(e.tag){case 5:return V(e.type);case 16:return V("Lazy");case 13:return V("Suspense");case 19:return V("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 Ae(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Q:return"Fragment";case H:return"Portal";case pe:return"Profiler";case G:return"StrictMode";case ve:return"Suspense";case D:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case U:return(e.displayName||"Context")+".Consumer";case we:return(e._context.displayName||"Context")+".Provider";case le:var n=e.render;return e=e.displayName,e||(e=n.displayName||n.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ce:return n=e.displayName||null,n!==null?n:Ae(e.type)||"Memo";case J:n=e._payload,e=e._init;try{return Ae(e(n))}catch{}}return null}function Oe(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 Ae(n);case 8:return n===G?"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 Fe(e){var n=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function ke(e){var n=Fe(e)?"checked":"value",o=Object.getOwnPropertyDescriptor(e.constructor.prototype,n),u=""+e[n];if(!e.hasOwnProperty(n)&&typeof o<"u"&&typeof o.get=="function"&&typeof o.set=="function"){var p=o.get,g=o.set;return Object.defineProperty(e,n,{configurable:!0,get:function(){return p.call(this)},set:function(E){u=""+E,g.call(this,E)}}),Object.defineProperty(e,n,{enumerable:o.enumerable}),{getValue:function(){return u},setValue:function(E){u=""+E},stopTracking:function(){e._valueTracker=null,delete e[n]}}}}function Be(e){e._valueTracker||(e._valueTracker=ke(e))}function Re(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var o=n.getValue(),u="";return e&&(u=Fe(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 lt(e,n){var o=n.checked;return F({},n,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:o??e._wrapperState.initialChecked})}function ut(e,n){var o=n.defaultValue==null?"":n.defaultValue,u=n.checked!=null?n.checked:n.defaultChecked;o=_e(n.value!=null?n.value:o),e._wrapperState={initialChecked:u,initialValue:o,controlled:n.type==="checkbox"||n.type==="radio"?n.checked!=null:n.value!=null}}function ot(e,n){n=n.checked,n!=null&&P(e,"checked",n,!1)}function $t(e,n){ot(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")?nn(e,n.type,o):n.hasOwnProperty("defaultValue")&&nn(e,n.type,_e(n.defaultValue)),n.checked==null&&n.defaultChecked!=null&&(e.defaultChecked=!!n.defaultChecked)}function St(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 nn(e,n,o){(n!=="number"||qe(e.ownerDocument)!==e)&&(o==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+o&&(e.defaultValue=""+o))}var Lt=Array.isArray;function _t(e,n,o,u){if(e=e.options,n){n={};for(var p=0;p<o.length;p++)n["$"+o[p]]=!0;for(o=0;o<e.length;o++)p=n.hasOwnProperty("$"+e[o].value),e[o].selected!==p&&(e[o].selected=p),p&&u&&(e[o].defaultSelected=!0)}else{for(o=""+_e(o),n=null,p=0;p<e.length;p++){if(e[p].value===o){e[p].selected=!0,u&&(e[p].defaultSelected=!0);return}n!==null||e[p].disabled||(n=e[p])}n!==null&&(n.selected=!0)}}function dn(e,n){if(n.dangerouslySetInnerHTML!=null)throw Error(i(91));return F({},n,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function rn(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(Lt(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 mr(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 bn(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 Kt(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 $n,tr=(function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(n,o,u,p){MSApp.execUnsafeLocalFunction(function(){return e(n,o,u,p)})}:e})(function(e,n){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=n;else{for($n=$n||document.createElement("div"),$n.innerHTML="<svg>"+n.valueOf().toString()+"</svg>",n=$n.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;n.firstChild;)e.appendChild(n.firstChild)}});function _n(e,n){if(n){var o=e.firstChild;if(o&&o===e.lastChild&&o.nodeType===3){o.nodeValue=n;return}}e.textContent=n}var Tn={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},Un=["Webkit","ms","Moz","O"];Object.keys(Tn).forEach(function(e){Un.forEach(function(n){n=n+e.charAt(0).toUpperCase()+e.substring(1),Tn[n]=Tn[e]})});function gr(e,n,o){return n==null||typeof n=="boolean"||n===""?"":o||typeof n!="number"||n===0||Tn.hasOwnProperty(e)&&Tn[e]?(""+n).trim():n+"px"}function Sn(e,n){e=e.style;for(var o in n)if(n.hasOwnProperty(o)){var u=o.indexOf("--")===0,p=gr(o,n[o],u);o==="float"&&(o="cssFloat"),u?e.setProperty(o,p):e[o]=p}}var on=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(on[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 kn=null;function nr(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var He=null,In=null,qn=null;function Or(e){if(e=ta(e)){if(typeof He!="function")throw Error(i(280));var n=e.stateNode;n&&(n=ol(n),He(e.stateNode,e.type,n))}}function Rr(e){In?qn?qn.push(e):qn=[e]:In=e}function Dr(){if(In){var e=In,n=qn;if(qn=In=null,Or(e),n)for(e=0;e<n.length;e++)Or(n[e])}}function to(e,n){return e(n)}function Io(){}var Nn=!1;function En(e,n,o){if(Nn)return e(n,o);Nn=!0;try{return to(e,n,o)}finally{Nn=!1,(In!==null||qn!==null)&&(Io(),Dr())}}function An(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 q=!1;if(h)try{var Ne={};Object.defineProperty(Ne,"passive",{get:function(){q=!0}}),window.addEventListener("test",Ne,Ne),window.removeEventListener("test",Ne,Ne)}catch{q=!1}function Ve(e,n,o,u,p,g,E,L,X){var ye=Array.prototype.slice.call(arguments,3);try{n.apply(o,ye)}catch(Me){this.onError(Me)}}var pt=!1,qt=null,Wt=!1,Yt=null,rr={onError:function(e){pt=!0,qt=e}};function pn(e,n,o,u,p,g,E,L,X){pt=!1,qt=null,Ve.apply(rr,arguments)}function Cn(e,n,o,u,p,g,E,L,X){if(pn.apply(this,arguments),pt){if(pt){var ye=qt;pt=!1,qt=null}else throw Error(i(198));Wt||(Wt=!0,Yt=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 Lr(e){if(zt(e)!==e)throw Error(i(188))}function sn(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 p=o.return;if(p===null)break;var g=p.alternate;if(g===null){if(u=p.return,u!==null){o=u;continue}break}if(p.child===g.child){for(g=p.child;g;){if(g===o)return Lr(p),e;if(g===u)return Lr(p),n;g=g.sibling}throw Error(i(188))}if(o.return!==u.return)o=p,u=g;else{for(var E=!1,L=p.child;L;){if(L===o){E=!0,o=p,u=g;break}if(L===u){E=!0,u=p,o=g;break}L=L.sibling}if(!E){for(L=g.child;L;){if(L===o){E=!0,o=g,u=p;break}if(L===u){E=!0,u=g,o=p;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 no(e){return e=sn(e),e!==null?or(e):null}function or(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var n=or(e);if(n!==null)return n;e=e.sibling}return null}var ci=r.unstable_scheduleCallback,Ao=r.unstable_cancelCallback,Et=r.unstable_shouldYield,ir=r.unstable_requestPaint,gt=r.unstable_now,Bi=r.unstable_getCurrentPriorityLevel,zr=r.unstable_ImmediatePriority,Oo=r.unstable_UserBlockingPriority,Fr=r.unstable_NormalPriority,yr=r.unstable_LowPriority,fi=r.unstable_IdlePriority,sr=null,jn=null;function ct(e){if(jn&&typeof jn.onCommitFiberRoot=="function")try{jn.onCommitFiberRoot(sr,e,void 0,(e.current.flags&128)===128)}catch{}}var hn=Math.clz32?Math.clz32:ro,Hi=Math.log,Ro=Math.LN2;function ro(e){return e>>>=0,e===0?32:31-(Hi(e)/Ro|0)|0}var oo=64,io=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,p=e.suspendedLanes,g=e.pingedLanes,E=o&268435455;if(E!==0){var L=E&~p;L!==0?u=Yn(L):(g&=E,g!==0&&(u=Yn(g)))}else E=o&~p,E!==0?u=Yn(E):g!==0&&(u=Yn(g));if(u===0)return 0;if(n!==0&&n!==u&&(n&p)===0&&(p=u&-u,g=n&-n,p>=g||p===16&&(g&4194240)!==0))return n;if((u&4)!==0&&(u|=o&16),n=e.entangledLanes,n!==0)for(e=e.entanglements,n&=u;0<n;)o=31-hn(n),p=1<<o,u|=e[o],n&=~p;return u}function Br(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 so(e,n){for(var o=e.suspendedLanes,u=e.pingedLanes,p=e.expirationTimes,g=e.pendingLanes;0<g;){var E=31-hn(g),L=1<<E,X=p[E];X===-1?((L&o)===0||(L&u)!==0)&&(p[E]=Br(L,n)):X<=n&&(e.expiredLanes|=L),g&=~L}}function ar(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Hr(){var e=oo;return oo<<=1,(oo&4194240)===0&&(oo=64),e}function ao(e){for(var n=[],o=0;31>o;o++)n.push(e);return n}function lr(e,n,o){e.pendingLanes|=n,n!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,n=31-hn(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 p=31-hn(o),g=1<<p;n[p]=0,u[p]=-1,e[p]=-1,o&=~g}}function Do(e,n){var o=e.entangledLanes|=n;for(e=e.entanglements;o;){var u=31-hn(o),p=1<<u;p&n|e[u]&n&&(e[u]|=n),o&=~p}}var xt=0;function Ba(e){return e&=-e,1<e?4<e?(e&268435455)!==0?16:536870912:4:1}var ht,Vi,Ha,Va,mn,Vr=!1,lo=[],an=null,vr=null,xr=null,Tt=new Map,ln=new Map,On=[],pi="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Ui(e,n){switch(e){case"focusin":case"focusout":an=null;break;case"dragenter":case"dragleave":vr=null;break;case"mouseover":case"mouseout":xr=null;break;case"pointerover":case"pointerout":Tt.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":ln.delete(n.pointerId)}}function Rn(e,n,o,u,p,g){return e===null||e.nativeEvent!==g?(e={blockedOn:n,domEventName:o,eventSystemFlags:u,nativeEvent:g,targetContainers:[p]},n!==null&&(n=ta(n),n!==null&&Vi(n)),e):(e.eventSystemFlags|=u,n=e.targetContainers,p!==null&&n.indexOf(p)===-1&&n.push(p),e)}function Ou(e,n,o,u,p){switch(n){case"focusin":return an=Rn(an,e,n,o,u,p),!0;case"dragenter":return vr=Rn(vr,e,n,o,u,p),!0;case"mouseover":return xr=Rn(xr,e,n,o,u,p),!0;case"pointerover":var g=p.pointerId;return Tt.set(g,Rn(Tt.get(g)||null,e,n,o,u,p)),!0;case"gotpointercapture":return g=p.pointerId,ln.set(g,Rn(ln.get(g)||null,e,n,o,u,p)),!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 Lo(e){if(e.blockedOn!==null)return!1;for(var n=e.targetContainers;0<n.length;){var o=zo(e.domEventName,e.eventSystemFlags,n[0],e.nativeEvent);if(o===null){o=e.nativeEvent;var u=new o.constructor(o.type,o);kn=u,o.target.dispatchEvent(u),kn=null}else return n=ta(o),n!==null&&Vi(n),e.blockedOn=o,!1;n.shift()}return!0}function Ds(e,n,o){Lo(e)&&o.delete(n)}function Ls(){Vr=!1,an!==null&&Lo(an)&&(an=null),vr!==null&&Lo(vr)&&(vr=null),xr!==null&&Lo(xr)&&(xr=null),Tt.forEach(Ds),ln.forEach(Ds)}function wr(e,n){e.blockedOn===n&&(e.blockedOn=null,Vr||(Vr=!0,r.unstable_scheduleCallback(r.unstable_NormalPriority,Ls)))}function uo(e){function n(p){return wr(p,e)}if(0<lo.length){wr(lo[0],e);for(var o=1;o<lo.length;o++){var u=lo[o];u.blockedOn===e&&(u.blockedOn=null)}}for(an!==null&&wr(an,e),vr!==null&&wr(vr,e),xr!==null&&wr(xr,e),Tt.forEach(n),ln.forEach(n),o=0;o<On.length;o++)u=On[o],u.blockedOn===e&&(u.blockedOn=null);for(;0<On.length&&(o=On[0],o.blockedOn===null);)Xn(o),o.blockedOn===null&&On.shift()}var co=R.ReactCurrentBatchConfig,Ki=!0;function hi(e,n,o,u){var p=xt,g=co.transition;co.transition=null;try{xt=1,zs(e,n,o,u)}finally{xt=p,co.transition=g}}function Ru(e,n,o,u){var p=xt,g=co.transition;co.transition=null;try{xt=4,zs(e,n,o,u)}finally{xt=p,co.transition=g}}function zs(e,n,o,u){if(Ki){var p=zo(e,n,o,u);if(p===null)Bu(e,n,u,fo,o),Ui(e,u);else if(Ou(p,e,n,o,u))u.stopPropagation();else if(Ui(e,u),n&4&&-1<pi.indexOf(e)){for(;p!==null;){var g=ta(p);if(g!==null&&ht(g),g=zo(e,n,o,u),g===null&&Bu(e,n,u,fo,o),g===p)break;p=g}p!==null&&u.stopPropagation()}else Bu(e,n,u,null,o)}}var fo=null;function zo(e,n,o,u){if(fo=null,e=nr(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 fo=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 zr:return 1;case Oo:return 4;case Fr:case yr:return 16;case fi:return 536870912;default:return 16}default:return 16}}var Ur=null,Fs=null,Wi=null;function Yi(){if(Wi)return Wi;var e,n=Fs,o=n.length,u,p="value"in Ur?Ur.value:Ur.textContent,g=p.length;for(e=0;e<o&&n[e]===p[e];e++);var E=o-e;for(u=1;u<=E&&n[o-u]===p[g-u];u++);return Wi=p.slice(e,1<u?1-u:void 0)}function Fo(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,p,g,E){this._reactName=o,this._targetInst=p,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 br={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Xi=Gt(br),yi=F({},br,{view:0,detail:0}),Bo=Gt(yi),po,vi,ho,Ho=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"?(po=e.screenX-ho.screenX,vi=e.screenY-ho.screenY):vi=po=0,ho=e),po)},movementY:function(e){return"movementY"in e?e.movementY:vi}}),Qi=Gt(Ho),Jt=F({},Ho,{dataTransfer:0}),xi=Gt(Jt),wi=F({},yi,{relatedTarget:0}),Gi=Gt(wi),Ji=F({},br,{animationName:0,elapsedTime:0,pseudoElement:0}),Ua=Gt(Ji),Ka=F({},br,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Zi=Gt(Ka),Bs=F({},br,{data:0}),Kr=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 Us(e){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(e):(e=es[e])?!!n[e]:!1}function ts(){return Us}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=Fo(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"?Fo(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Fo(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Ks=Gt(Du),ns=F({},Ho,{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({},br,{propertyName:0,elapsedTime:0,pseudoElement:0}),Wa=Gt(Lu),zu=F({},Ho,{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=h&&"CompositionEvent"in window,Vo=null;h&&"documentMode"in document&&(Vo=document.documentMode);var Xs=h&&"TextEvent"in window&&!Vo,Qs=h&&(!Ys||Vo&&8<Vo&&11>=Vo),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 _r=!1;function Sr(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 Ot(e,n){if(_r)return e==="compositionend"||!Ys&&Ga(e,n)?(e=Yi(),Wi=Fs=Ur=null,_r=!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 mo(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n==="input"?!!rs[e.type]:n==="textarea"}function Za(e,n,o,u){Rr(u),n=tl(n,"onChange"),0<n.length&&(o=new Xi("onChange","change",null,o,u),e.push({event:o,listeners:n}))}var go=null,Uo=null;function yo(e){ad(e,0)}function Ko(e){var n=as(e);if(Re(n))return e}function qo(e,n){if(e==="change")return n}var kr=!1;if(h){var os;if(h){var a="oninput"in document;if(!a){var f=document.createElement("div");f.setAttribute("oninput","return;"),a=typeof f.oninput=="function"}os=a}else os=!1;kr=os&&(!document.documentMode||9<document.documentMode)}function m(){go&&(go.detachEvent("onpropertychange",v),Uo=go=null)}function v(e){if(e.propertyName==="value"&&Ko(Uo)){var n=[];Za(n,Uo,e,nr(e)),En(yo,n)}}function _(e,n,o){e==="focusin"?(m(),go=n,Uo=o,go.attachEvent("onpropertychange",v)):e==="focusout"&&m()}function N(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ko(Uo)}function $(e,n){if(e==="click")return Ko(n)}function O(e,n){if(e==="input"||e==="change")return Ko(n)}function ee(e,n){return e===n&&(e!==0||1/e===1/n)||e!==e&&n!==n}var fe=typeof Object.is=="function"?Object.is:ee;function ne(e,n){if(fe(e,n))return!0;if(typeof e!="object"||e===null||typeof n!="object"||n===null)return!1;var o=Object.keys(e),u=Object.keys(n);if(o.length!==u.length)return!1;for(u=0;u<o.length;u++){var p=o[u];if(!y.call(n,p)||!fe(e[p],n[p]))return!1}return!0}function Z(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function te(e,n){var o=Z(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=Z(o)}}function ue(e,n){return e&&n?e===n?!0:e&&e.nodeType===3?!1:n&&n.nodeType===3?ue(e,n.parentNode):"contains"in e?e.contains(n):e.compareDocumentPosition?!!(e.compareDocumentPosition(n)&16):!1:!1}function ie(){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 oe(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 ae(e){var n=ie(),o=e.focusedElem,u=e.selectionRange;if(n!==o&&o&&o.ownerDocument&&ue(o.ownerDocument.documentElement,o)){if(u!==null&&oe(o)){if(n=u.start,e=u.end,e===void 0&&(e=n),"selectionStart"in o)o.selectionStart=n,o.selectionEnd=Math.min(e,o.value.length);else if(e=(n=o.ownerDocument||document)&&n.defaultView||window,e.getSelection){e=e.getSelection();var p=o.textContent.length,g=Math.min(u.start,p);u=u.end===void 0?g:Math.min(u.end,p),!e.extend&&g>u&&(p=u,u=g,g=p),p=te(o,g);var E=te(o,u);p&&E&&(e.rangeCount!==1||e.anchorNode!==p.node||e.anchorOffset!==p.offset||e.focusNode!==E.node||e.focusOffset!==E.offset)&&(n=n.createRange(),n.setStart(p.node,p.offset),e.removeAllRanges(),g>u?(e.addRange(n),e.extend(E.node,E.offset)):(n.setEnd(E.node,E.offset),e.addRange(n)))}}for(n=[],e=o;e=e.parentNode;)e.nodeType===1&&n.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof o.focus=="function"&&o.focus(),o=0;o<n.length;o++)e=n[o],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var ge=h&&"documentMode"in document&&11>=document.documentMode,de=null,xe=null,Ee=null,je=!1;function Le(e,n,o){var u=o.window===o?o.document:o.nodeType===9?o:o.ownerDocument;je||de==null||de!==qe(u)||(u=de,"selectionStart"in u&&oe(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}),Ee&&ne(Ee,u)||(Ee=u,u=tl(xe,"onSelect"),0<u.length&&(n=new Xi("onSelect","select",null,n,o),e.push({event:n,listeners:u}),n.target=de)))}function Te(e,n){var o={};return o[e.toLowerCase()]=n.toLowerCase(),o["Webkit"+e]="webkit"+n,o["Moz"+e]="moz"+n,o}var Ue={animationend:Te("Animation","AnimationEnd"),animationiteration:Te("Animation","AnimationIteration"),animationstart:Te("Animation","AnimationStart"),transitionend:Te("Transition","TransitionEnd")},De={},We={};h&&(We=document.createElement("div").style,"AnimationEvent"in window||(delete Ue.animationend.animation,delete Ue.animationiteration.animation,delete Ue.animationstart.animation),"TransitionEvent"in window||delete Ue.transitionend.transition);function Ce(e){if(De[e])return De[e];if(!Ue[e])return e;var n=Ue[e],o;for(o in n)if(n.hasOwnProperty(o)&&o in We)return De[e]=n[o];return e}var nt=Ce("animationend"),rt=Ce("animationiteration"),at=Ce("animationstart"),ft=Ce("transitionend"),gn=new Map,st="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Ct(e,n){gn.set(e,n),c(n,[e])}for(var Ht=0;Ht<st.length;Ht++){var Wo=st[Ht],un=Wo.toLowerCase(),vo=Wo[0].toUpperCase()+Wo.slice(1);Ct(un,"on"+vo)}Ct(nt,"onAnimationEnd"),Ct(rt,"onAnimationIteration"),Ct(at,"onAnimationStart"),Ct("dblclick","onDoubleClick"),Ct("focusin","onFocus"),Ct("focusout","onBlur"),Ct(ft,"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 xo="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(" "),xg=new Set("cancel close invalid load scroll toggle".split(" ").concat(xo));function sd(e,n,o){var u=e.type||"unknown-event";e.currentTarget=o,Cn(u,n,void 0,e),e.currentTarget=null}function ad(e,n){n=(n&4)!==0;for(var o=0;o<e.length;o++){var u=e[o],p=u.event;u=u.listeners;e:{var g=void 0;if(n)for(var E=u.length-1;0<=E;E--){var L=u[E],X=L.instance,ye=L.currentTarget;if(L=L.listener,X!==g&&p.isPropagationStopped())break e;sd(p,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&&p.isPropagationStopped())break e;sd(p,L,ye),g=X}}}if(Wt)throw e=Yt,Wt=!1,Yt=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"&&(xg.has(o)||Fu(o,!1,e),Fu(o,!0,e))});var n=e.nodeType===9?e:e.ownerDocument;n===null||n[el]||(n[el]=!0,Fu("selectionchange",!1,n))}}function ld(e,n,o,u){switch(qi(n)){case 1:var p=hi;break;case 4:p=Ru;break;default:p=zs}o=p.bind(null,n,o,e),p=void 0,!q||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(p=!0),u?p!==void 0?e.addEventListener(n,o,{capture:!0,passive:p}):e.addEventListener(n,o,!0):p!==void 0?e.addEventListener(n,o,{passive:p}):e.addEventListener(n,o,!1)}function Bu(e,n,o,u,p){var g=u;if((n&1)===0&&(n&2)===0&&u!==null)e:for(;;){if(u===null)return;var E=u.tag;if(E===3||E===4){var L=u.stateNode.containerInfo;if(L===p||L.nodeType===8&&L.parentNode===p)break;if(E===4)for(E=u.return;E!==null;){var X=E.tag;if((X===3||X===4)&&(X=E.stateNode.containerInfo,X===p||X.nodeType===8&&X.parentNode===p))return;E=E.return}for(;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}En(function(){var ye=g,Me=nr(o),Ie=[];e:{var Pe=gn.get(e);if(Pe!==void 0){var Ke=Xi,Qe=e;switch(e){case"keypress":if(Fo(o)===0)break e;case"keydown":case"keyup":Ke=Ks;break;case"focusin":Qe="focus",Ke=Gi;break;case"focusout":Qe="blur",Ke=Gi;break;case"beforeblur":case"afterblur":Ke=Gi;break;case"click":if(o.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Ke=Qi;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Ke=xi;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Ke=Ws;break;case nt:case rt:case at:Ke=Ua;break;case ft:Ke=Wa;break;case"scroll":Ke=Bo;break;case"wheel":Ke=Ya;break;case"copy":case"cut":case"paste":Ke=Zi;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Ke=qa}var Ge=(n&4)!==0,Bt=!Ge&&e==="scroll",he=Ge?Pe!==null?Pe+"Capture":null:Pe;Ge=[];for(var re=ye,me;re!==null;){me=re;var ze=me.stateNode;if(me.tag===5&&ze!==null&&(me=ze,he!==null&&(ze=An(re,he),ze!=null&&Ge.push(Zs(re,ze,me)))),Bt)break;re=re.return}0<Ge.length&&(Pe=new Ke(Pe,Qe,null,o,Me),Ie.push({event:Pe,listeners:Ge}))}}if((n&7)===0){e:{if(Pe=e==="mouseover"||e==="pointerover",Ke=e==="mouseout"||e==="pointerout",Pe&&o!==kn&&(Qe=o.relatedTarget||o.fromElement)&&(bi(Qe)||Qe[wo]))break e;if((Ke||Pe)&&(Pe=Me.window===Me?Me:(Pe=Me.ownerDocument)?Pe.defaultView||Pe.parentWindow:window,Ke?(Qe=o.relatedTarget||o.toElement,Ke=ye,Qe=Qe?bi(Qe):null,Qe!==null&&(Bt=zt(Qe),Qe!==Bt||Qe.tag!==5&&Qe.tag!==6)&&(Qe=null)):(Ke=null,Qe=ye),Ke!==Qe)){if(Ge=Qi,ze="onMouseLeave",he="onMouseEnter",re="mouse",(e==="pointerout"||e==="pointerover")&&(Ge=qa,ze="onPointerLeave",he="onPointerEnter",re="pointer"),Bt=Ke==null?Pe:as(Ke),me=Qe==null?Pe:as(Qe),Pe=new Ge(ze,re+"leave",Ke,o,Me),Pe.target=Bt,Pe.relatedTarget=me,ze=null,bi(Me)===ye&&(Ge=new Ge(he,re+"enter",Qe,o,Me),Ge.target=me,Ge.relatedTarget=Bt,ze=Ge),Bt=ze,Ke&&Qe)t:{for(Ge=Ke,he=Qe,re=0,me=Ge;me;me=is(me))re++;for(me=0,ze=he;ze;ze=is(ze))me++;for(;0<re-me;)Ge=is(Ge),re--;for(;0<me-re;)he=is(he),me--;for(;re--;){if(Ge===he||he!==null&&Ge===he.alternate)break t;Ge=is(Ge),he=is(he)}Ge=null}else Ge=null;Ke!==null&&ud(Ie,Pe,Ke,Ge,!1),Qe!==null&&Bt!==null&&ud(Ie,Bt,Qe,Ge,!0)}}e:{if(Pe=ye?as(ye):window,Ke=Pe.nodeName&&Pe.nodeName.toLowerCase(),Ke==="select"||Ke==="input"&&Pe.type==="file")var Je=qo;else if(mo(Pe))if(kr)Je=O;else{Je=N;var et=_}else(Ke=Pe.nodeName)&&Ke.toLowerCase()==="input"&&(Pe.type==="checkbox"||Pe.type==="radio")&&(Je=$);if(Je&&(Je=Je(e,ye))){Za(Ie,Je,o,Me);break e}et&&et(e,Pe,ye),e==="focusout"&&(et=Pe._wrapperState)&&et.controlled&&Pe.type==="number"&&nn(Pe,"number",Pe.value)}switch(et=ye?as(ye):window,e){case"focusin":(mo(et)||et.contentEditable==="true")&&(de=et,xe=ye,Ee=null);break;case"focusout":Ee=xe=de=null;break;case"mousedown":je=!0;break;case"contextmenu":case"mouseup":case"dragend":je=!1,Le(Ie,o,Me);break;case"selectionchange":if(ge)break;case"keydown":case"keyup":Le(Ie,o,Me)}var tt;if(Ys)e:{switch(e){case"compositionstart":var it="onCompositionStart";break e;case"compositionend":it="onCompositionEnd";break e;case"compositionupdate":it="onCompositionUpdate";break e}it=void 0}else _r?Ga(e,o)&&(it="onCompositionEnd"):e==="keydown"&&o.keyCode===229&&(it="onCompositionStart");it&&(Qs&&o.locale!=="ko"&&(_r||it!=="onCompositionStart"?it==="onCompositionEnd"&&_r&&(tt=Yi()):(Ur=Me,Fs="value"in Ur?Ur.value:Ur.textContent,_r=!0)),et=tl(ye,it),0<et.length&&(it=new Kr(it,e,null,o,Me),Ie.push({event:it,listeners:et}),tt?it.data=tt:(tt=Ja(o),tt!==null&&(it.data=tt)))),(tt=Xs?Sr(e,o):Ot(e,o))&&(ye=tl(ye,"onBeforeInput"),0<ye.length&&(Me=new Kr("onBeforeInput","beforeinput",null,o,Me),Ie.push({event:Me,listeners:ye}),Me.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 p=e,g=p.stateNode;p.tag===5&&g!==null&&(p=g,g=An(e,o),g!=null&&u.unshift(Zs(e,g,p)),g=An(e,n),g!=null&&u.push(Zs(e,g,p))),e=e.return}return u}function is(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function ud(e,n,o,u,p){for(var g=n._reactName,E=[];o!==null&&o!==u;){var L=o,X=L.alternate,ye=L.stateNode;if(X!==null&&X===u)break;L.tag===5&&ye!==null&&(L=ye,p?(X=An(o,g),X!=null&&E.unshift(Zs(o,X,L))):p||(X=An(o,g),X!=null&&E.push(Zs(o,X,L)))),o=o.return}E.length!==0&&e.push({event:n,listeners:E})}var wg=/\r\n?/g,bg=/\u0000|\uFFFD/g;function cd(e){return(typeof e=="string"?e:""+e).replace(wg,`
38
+ `).replace(bg,"")}function nl(e,n,o){if(n=cd(n),cd(e)!==n&&o)throw Error(i(425))}function rl(){}var Hu=null,Vu=null;function Uu(e,n){return e==="textarea"||e==="noscript"||typeof n.children=="string"||typeof n.children=="number"||typeof n.dangerouslySetInnerHTML=="object"&&n.dangerouslySetInnerHTML!==null&&n.dangerouslySetInnerHTML.__html!=null}var Ku=typeof setTimeout=="function"?setTimeout:void 0,_g=typeof clearTimeout=="function"?clearTimeout:void 0,fd=typeof Promise=="function"?Promise:void 0,Sg=typeof queueMicrotask=="function"?queueMicrotask:typeof fd<"u"?function(e){return fd.resolve(null).then(e).catch(kg)}:Ku;function kg(e){setTimeout(function(){throw e})}function qu(e,n){var o=n,u=0;do{var p=o.nextSibling;if(e.removeChild(o),p&&p.nodeType===8)if(o=p.data,o==="/$"){if(u===0){e.removeChild(p),uo(n);return}u--}else o!=="$"&&o!=="$?"&&o!=="$!"||u++;o=p}while(o);uo(n)}function Yo(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),qr="__reactFiber$"+ss,ea="__reactProps$"+ss,wo="__reactContainer$"+ss,Wu="__reactEvents$"+ss,Ng="__reactListeners$"+ss,Eg="__reactHandles$"+ss;function bi(e){var n=e[qr];if(n)return n;for(var o=e.parentNode;o;){if(n=o[wo]||o[qr]){if(o=n.alternate,n.child!==null||o!==null&&o.child!==null)for(e=dd(e);e!==null;){if(o=e[qr])return o;e=dd(e)}return n}e=o,o=e.parentNode}return null}function ta(e){return e=e[qr]||e[wo],!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 Xo(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 Qo={},yn=Xo(Qo),Dn=Xo(!1),_i=Qo;function us(e,n){var o=e.type.contextTypes;if(!o)return Qo;var u=e.stateNode;if(u&&u.__reactInternalMemoizedUnmaskedChildContext===n)return u.__reactInternalMemoizedMaskedChildContext;var p={},g;for(g in o)p[g]=n[g];return u&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=n,e.__reactInternalMemoizedMaskedChildContext=p),p}function Ln(e){return e=e.childContextTypes,e!=null}function il(){Pt(Dn),Pt(yn)}function pd(e,n,o){if(yn.current!==Qo)throw Error(i(168));kt(yn,n),kt(Dn,o)}function hd(e,n,o){var u=e.stateNode;if(n=n.childContextTypes,typeof u.getChildContext!="function")return o;u=u.getChildContext();for(var p in u)if(!(p in n))throw Error(i(108,Oe(e)||"Unknown",p));return F({},o,u)}function sl(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Qo,_i=yn.current,kt(yn,e),kt(Dn,Dn.current),!0}function md(e,n,o){var u=e.stateNode;if(!u)throw Error(i(169));o?(e=hd(e,n,_i),u.__reactInternalMemoizedMergedChildContext=e,Pt(Dn),Pt(yn),kt(yn,e)):Pt(Dn),kt(Dn,o)}var bo=null,al=!1,Xu=!1;function gd(e){bo===null?bo=[e]:bo.push(e)}function Cg(e){al=!0,gd(e)}function Go(){if(!Xu&&bo!==null){Xu=!0;var e=0,n=xt;try{var o=bo;for(xt=1;e<o.length;e++){var u=o[e];do u=u(!0);while(u!==null)}bo=null,al=!1}catch(p){throw bo!==null&&(bo=bo.slice(e+1)),ci(zr,Go),p}finally{xt=n,Xu=!1}}return null}var cs=[],fs=0,ll=null,ul=0,ur=[],cr=0,Si=null,_o=1,So="";function ki(e,n){cs[fs++]=ul,cs[fs++]=ll,ll=e,ul=n}function yd(e,n,o){ur[cr++]=_o,ur[cr++]=So,ur[cr++]=Si,Si=e;var u=_o;e=So;var p=32-hn(u)-1;u&=~(1<<p),o+=1;var g=32-hn(n)+p;if(30<g){var E=p-p%5;g=(u&(1<<E)-1).toString(32),u>>=E,p-=E,_o=1<<32-hn(n)+p|o<<p|u,So=g+e}else _o=1<<g|o<<p|u,So=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=ur[--cr],ur[cr]=null,So=ur[--cr],ur[cr]=null,_o=ur[--cr],ur[cr]=null}var Qn=null,Gn=null,It=!1,Nr=null;function vd(e,n){var o=hr(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=Yo(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:_o,overflow:So}:null,e.memoizedState={dehydrated:n,treeContext:o,retryLane:1073741824},o=hr(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(It){var n=Gn;if(n){var o=n;if(!xd(e,n)){if(Ju(e))throw Error(i(418));n=Yo(o.nextSibling);var u=Qn;n&&xd(e,n)?vd(u,o):(e.flags=e.flags&-4097|2,It=!1,Qn=e)}}else{if(Ju(e))throw Error(i(418));e.flags=e.flags&-4097|2,It=!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(!It)return wd(e),It=!0,!1;var n;if((n=e.tag!==3)&&!(n=e.tag!==5)&&(n=e.type,n=n!=="head"&&n!=="body"&&!Uu(e.type,e.memoizedProps)),n&&(n=Gn)){if(Ju(e))throw bd(),Error(i(418));for(;n;)vd(e,n),n=Yo(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=Yo(e.nextSibling);break e}n--}else o!=="$"&&o!=="$!"&&o!=="$?"||n++}e=e.nextSibling}Gn=null}}else Gn=Qn?Yo(e.stateNode.nextSibling):null;return!0}function bd(){for(var e=Gn;e;)e=Yo(e.nextSibling)}function ds(){Gn=Qn=null,It=!1}function ec(e){Nr===null?Nr=[e]:Nr.push(e)}var jg=R.ReactCurrentBatchConfig;function na(e,n,o){if(e=o.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(o._owner){if(o=o._owner,o){if(o.tag!==1)throw Error(i(309));var u=o.stateNode}if(!u)throw Error(i(147,e));var p=u,g=""+e;return n!==null&&n.ref!==null&&typeof n.ref=="function"&&n.ref._stringRef===g?n.ref:(n=function(E){var L=p.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(he,re){if(e){var me=he.deletions;me===null?(he.deletions=[re],he.flags|=16):me.push(re)}}function o(he,re){if(!e)return null;for(;re!==null;)n(he,re),re=re.sibling;return null}function u(he,re){for(he=new Map;re!==null;)re.key!==null?he.set(re.key,re):he.set(re.index,re),re=re.sibling;return he}function p(he,re){return he=ii(he,re),he.index=0,he.sibling=null,he}function g(he,re,me){return he.index=me,e?(me=he.alternate,me!==null?(me=me.index,me<re?(he.flags|=2,re):me):(he.flags|=2,re)):(he.flags|=1048576,re)}function E(he){return e&&he.alternate===null&&(he.flags|=2),he}function L(he,re,me,ze){return re===null||re.tag!==6?(re=Kc(me,he.mode,ze),re.return=he,re):(re=p(re,me),re.return=he,re)}function X(he,re,me,ze){var Je=me.type;return Je===Q?Me(he,re,me.props.children,ze,me.key):re!==null&&(re.elementType===Je||typeof Je=="object"&&Je!==null&&Je.$$typeof===J&&_d(Je)===re.type)?(ze=p(re,me.props),ze.ref=na(he,re,me),ze.return=he,ze):(ze=Ol(me.type,me.key,me.props,null,he.mode,ze),ze.ref=na(he,re,me),ze.return=he,ze)}function ye(he,re,me,ze){return re===null||re.tag!==4||re.stateNode.containerInfo!==me.containerInfo||re.stateNode.implementation!==me.implementation?(re=qc(me,he.mode,ze),re.return=he,re):(re=p(re,me.children||[]),re.return=he,re)}function Me(he,re,me,ze,Je){return re===null||re.tag!==7?(re=Ti(me,he.mode,ze,Je),re.return=he,re):(re=p(re,me),re.return=he,re)}function Ie(he,re,me){if(typeof re=="string"&&re!==""||typeof re=="number")return re=Kc(""+re,he.mode,me),re.return=he,re;if(typeof re=="object"&&re!==null){switch(re.$$typeof){case W:return me=Ol(re.type,re.key,re.props,null,he.mode,me),me.ref=na(he,null,re),me.return=he,me;case H:return re=qc(re,he.mode,me),re.return=he,re;case J:var ze=re._init;return Ie(he,ze(re._payload),me)}if(Lt(re)||K(re))return re=Ti(re,he.mode,me,null),re.return=he,re;fl(he,re)}return null}function Pe(he,re,me,ze){var Je=re!==null?re.key:null;if(typeof me=="string"&&me!==""||typeof me=="number")return Je!==null?null:L(he,re,""+me,ze);if(typeof me=="object"&&me!==null){switch(me.$$typeof){case W:return me.key===Je?X(he,re,me,ze):null;case H:return me.key===Je?ye(he,re,me,ze):null;case J:return Je=me._init,Pe(he,re,Je(me._payload),ze)}if(Lt(me)||K(me))return Je!==null?null:Me(he,re,me,ze,null);fl(he,me)}return null}function Ke(he,re,me,ze,Je){if(typeof ze=="string"&&ze!==""||typeof ze=="number")return he=he.get(me)||null,L(re,he,""+ze,Je);if(typeof ze=="object"&&ze!==null){switch(ze.$$typeof){case W:return he=he.get(ze.key===null?me:ze.key)||null,X(re,he,ze,Je);case H:return he=he.get(ze.key===null?me:ze.key)||null,ye(re,he,ze,Je);case J:var et=ze._init;return Ke(he,re,me,et(ze._payload),Je)}if(Lt(ze)||K(ze))return he=he.get(me)||null,Me(re,he,ze,Je,null);fl(re,ze)}return null}function Qe(he,re,me,ze){for(var Je=null,et=null,tt=re,it=re=0,tn=null;tt!==null&&it<me.length;it++){tt.index>it?(tn=tt,tt=null):tn=tt.sibling;var wt=Pe(he,tt,me[it],ze);if(wt===null){tt===null&&(tt=tn);break}e&&tt&&wt.alternate===null&&n(he,tt),re=g(wt,re,it),et===null?Je=wt:et.sibling=wt,et=wt,tt=tn}if(it===me.length)return o(he,tt),It&&ki(he,it),Je;if(tt===null){for(;it<me.length;it++)tt=Ie(he,me[it],ze),tt!==null&&(re=g(tt,re,it),et===null?Je=tt:et.sibling=tt,et=tt);return It&&ki(he,it),Je}for(tt=u(he,tt);it<me.length;it++)tn=Ke(tt,he,it,me[it],ze),tn!==null&&(e&&tn.alternate!==null&&tt.delete(tn.key===null?it:tn.key),re=g(tn,re,it),et===null?Je=tn:et.sibling=tn,et=tn);return e&&tt.forEach(function(si){return n(he,si)}),It&&ki(he,it),Je}function Ge(he,re,me,ze){var Je=K(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=re,it=re=0,tn=null,wt=me.next();tt!==null&&!wt.done;it++,wt=me.next()){tt.index>it?(tn=tt,tt=null):tn=tt.sibling;var si=Pe(he,tt,wt.value,ze);if(si===null){tt===null&&(tt=tn);break}e&&tt&&si.alternate===null&&n(he,tt),re=g(si,re,it),et===null?Je=si:et.sibling=si,et=si,tt=tn}if(wt.done)return o(he,tt),It&&ki(he,it),Je;if(tt===null){for(;!wt.done;it++,wt=me.next())wt=Ie(he,wt.value,ze),wt!==null&&(re=g(wt,re,it),et===null?Je=wt:et.sibling=wt,et=wt);return It&&ki(he,it),Je}for(tt=u(he,tt);!wt.done;it++,wt=me.next())wt=Ke(tt,he,it,wt.value,ze),wt!==null&&(e&&wt.alternate!==null&&tt.delete(wt.key===null?it:wt.key),re=g(wt,re,it),et===null?Je=wt:et.sibling=wt,et=wt);return e&&tt.forEach(function(ay){return n(he,ay)}),It&&ki(he,it),Je}function Bt(he,re,me,ze){if(typeof me=="object"&&me!==null&&me.type===Q&&me.key===null&&(me=me.props.children),typeof me=="object"&&me!==null){switch(me.$$typeof){case W:e:{for(var Je=me.key,et=re;et!==null;){if(et.key===Je){if(Je=me.type,Je===Q){if(et.tag===7){o(he,et.sibling),re=p(et,me.props.children),re.return=he,he=re;break e}}else if(et.elementType===Je||typeof Je=="object"&&Je!==null&&Je.$$typeof===J&&_d(Je)===et.type){o(he,et.sibling),re=p(et,me.props),re.ref=na(he,et,me),re.return=he,he=re;break e}o(he,et);break}else n(he,et);et=et.sibling}me.type===Q?(re=Ti(me.props.children,he.mode,ze,me.key),re.return=he,he=re):(ze=Ol(me.type,me.key,me.props,null,he.mode,ze),ze.ref=na(he,re,me),ze.return=he,he=ze)}return E(he);case H:e:{for(et=me.key;re!==null;){if(re.key===et)if(re.tag===4&&re.stateNode.containerInfo===me.containerInfo&&re.stateNode.implementation===me.implementation){o(he,re.sibling),re=p(re,me.children||[]),re.return=he,he=re;break e}else{o(he,re);break}else n(he,re);re=re.sibling}re=qc(me,he.mode,ze),re.return=he,he=re}return E(he);case J:return et=me._init,Bt(he,re,et(me._payload),ze)}if(Lt(me))return Qe(he,re,me,ze);if(K(me))return Ge(he,re,me,ze);fl(he,me)}return typeof me=="string"&&me!==""||typeof me=="number"?(me=""+me,re!==null&&re.tag===6?(o(he,re.sibling),re=p(re,me),re.return=he,he=re):(o(he,re),re=Kc(me,he.mode,ze),re.return=he,he=re),E(he)):o(he,re)}return Bt}var ps=Sd(!0),kd=Sd(!1),dl=Xo(null),pl=null,hs=null,tc=null;function nc(){tc=hs=pl=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){pl=e,tc=hs=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&n)!==0&&(zn=!0),e.firstContext=null)}function fr(e){var n=e._currentValue;if(tc!==e)if(e={context:e,memoizedValue:n,next:null},hs===null){if(pl===null)throw Error(i(308));hs=e,pl.dependencies={lanes:0,firstContext:e}}else hs=hs.next=e;return n}var Ni=null;function ic(e){Ni===null?Ni=[e]:Ni.push(e)}function Nd(e,n,o,u){var p=n.interleaved;return p===null?(o.next=o,ic(n)):(o.next=p.next,p.next=o),n.interleaved=o,ko(e,u)}function ko(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 Jo=!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 No(e,n){return{eventTime:e,lane:n,tag:0,payload:null,callback:null,next:null}}function Zo(e,n,o){var u=e.updateQueue;if(u===null)return null;if(u=u.shared,(vt&2)!==0){var p=u.pending;return p===null?n.next=n:(n.next=p.next,p.next=n),u.pending=n,ko(e,o)}return p=u.interleaved,p===null?(n.next=n,ic(u)):(n.next=p.next,p.next=n),u.interleaved=n,ko(e,o)}function hl(e,n,o){if(n=n.updateQueue,n!==null&&(n=n.shared,(o&4194240)!==0)){var u=n.lanes;u&=e.pendingLanes,o|=u,n.lanes=o,Do(e,o)}}function Cd(e,n){var o=e.updateQueue,u=e.alternate;if(u!==null&&(u=u.updateQueue,o===u)){var p=null,g=null;if(o=o.firstBaseUpdate,o!==null){do{var E={eventTime:o.eventTime,lane:o.lane,tag:o.tag,payload:o.payload,callback:o.callback,next:null};g===null?p=g=E:g=g.next=E,o=o.next}while(o!==null);g===null?p=g=n:g=g.next=n}else p=g=n;o={baseState:u.baseState,firstBaseUpdate:p,lastBaseUpdate:g,shared:u.shared,effects:u.effects},e.updateQueue=o;return}e=o.lastBaseUpdate,e===null?o.firstBaseUpdate=n:e.next=n,o.lastBaseUpdate=n}function ml(e,n,o,u){var p=e.updateQueue;Jo=!1;var g=p.firstBaseUpdate,E=p.lastBaseUpdate,L=p.shared.pending;if(L!==null){p.shared.pending=null;var X=L,ye=X.next;X.next=null,E===null?g=ye:E.next=ye,E=X;var Me=e.alternate;Me!==null&&(Me=Me.updateQueue,L=Me.lastBaseUpdate,L!==E&&(L===null?Me.firstBaseUpdate=ye:L.next=ye,Me.lastBaseUpdate=X))}if(g!==null){var Ie=p.baseState;E=0,Me=ye=X=null,L=g;do{var Pe=L.lane,Ke=L.eventTime;if((u&Pe)===Pe){Me!==null&&(Me=Me.next={eventTime:Ke,lane:0,tag:L.tag,payload:L.payload,callback:L.callback,next:null});e:{var Qe=e,Ge=L;switch(Pe=n,Ke=o,Ge.tag){case 1:if(Qe=Ge.payload,typeof Qe=="function"){Ie=Qe.call(Ke,Ie,Pe);break e}Ie=Qe;break e;case 3:Qe.flags=Qe.flags&-65537|128;case 0:if(Qe=Ge.payload,Pe=typeof Qe=="function"?Qe.call(Ke,Ie,Pe):Qe,Pe==null)break e;Ie=F({},Ie,Pe);break e;case 2:Jo=!0}}L.callback!==null&&L.lane!==0&&(e.flags|=64,Pe=p.effects,Pe===null?p.effects=[L]:Pe.push(L))}else Ke={eventTime:Ke,lane:Pe,tag:L.tag,payload:L.payload,callback:L.callback,next:null},Me===null?(ye=Me=Ke,X=Ie):Me=Me.next=Ke,E|=Pe;if(L=L.next,L===null){if(L=p.shared.pending,L===null)break;Pe=L,L=Pe.next,Pe.next=null,p.lastBaseUpdate=Pe,p.shared.pending=null}}while(!0);if(Me===null&&(X=Ie),p.baseState=X,p.firstBaseUpdate=ye,p.lastBaseUpdate=Me,n=p.shared.interleaved,n!==null){p=n;do E|=p.lane,p=p.next;while(p!==n)}else g===null&&(p.shared.lanes=0);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],p=u.callback;if(p!==null){if(u.callback=null,u=o,typeof p!="function")throw Error(i(191,p));p.call(u)}}}var ra={},Wr=Xo(ra),oa=Xo(ra),ia=Xo(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(Wr,ra),e=n.nodeType,e){case 9:case 11:n=(n=n.documentElement)?n.namespaceURI:Kt(null,"");break;default:e=e===8?n.parentNode:n,n=e.namespaceURI||null,e=e.tagName,n=Kt(n,e)}Pt(Wr),kt(Wr,n)}function gs(){Pt(Wr),Pt(oa),Pt(ia)}function Pd(e){Ei(ia.current);var n=Ei(Wr.current),o=Kt(n,e.type);n!==o&&(kt(oa,e),kt(Wr,o))}function lc(e){oa.current===e&&(Pt(Wr),Pt(oa))}var Rt=Xo(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,Dt=null,Xt=null,Zt=null,vl=!1,sa=!1,aa=0,Pg=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(!fe(e[o],n[o]))return!1;return!0}function pc(e,n,o,u,p,g){if(Ci=g,Dt=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,yl.current=e===null||e.memoizedState===null?Ig:Ag,e=o(u,p),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=Og,e=o(u,p)}while(sa)}if(yl.current=bl,n=Xt!==null&&Xt.next!==null,Ci=0,Zt=Xt=Dt=null,vl=!1,n)throw Error(i(300));return e}function hc(){var e=aa!==0;return aa=0,e}function Yr(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Zt===null?Dt.memoizedState=Zt=e:Zt=Zt.next=e,Zt}function dr(){if(Xt===null){var e=Dt.alternate;e=e!==null?e.memoizedState:null}else e=Xt.next;var n=Zt===null?Dt.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?Dt.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=dr(),o=n.queue;if(o===null)throw Error(i(311));o.lastRenderedReducer=e;var u=Xt,p=u.baseQueue,g=o.pending;if(g!==null){if(p!==null){var E=p.next;p.next=g.next,g.next=E}u.baseQueue=p=g,o.pending=null}if(p!==null){g=p.next,u=u.baseState;var L=E=null,X=null,ye=g;do{var Me=ye.lane;if((Ci&Me)===Me)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:Me,action:ye.action,hasEagerState:ye.hasEagerState,eagerState:ye.eagerState,next:null};X===null?(L=X=Ie,E=u):X=X.next=Ie,Dt.lanes|=Me,ji|=Me}ye=ye.next}while(ye!==null&&ye!==g);X===null?E=u:X.next=L,fe(u,n.memoizedState)||(zn=!0),n.memoizedState=u,n.baseState=E,n.baseQueue=X,o.lastRenderedState=u}if(e=o.interleaved,e!==null){p=e;do g=p.lane,Dt.lanes|=g,ji|=g,p=p.next;while(p!==e)}else p===null&&(o.lanes=0);return[n.memoizedState,o.dispatch]}function gc(e){var n=dr(),o=n.queue;if(o===null)throw Error(i(311));o.lastRenderedReducer=e;var u=o.dispatch,p=o.pending,g=n.memoizedState;if(p!==null){o.pending=null;var E=p=p.next;do g=e(g,E.action),E=E.next;while(E!==p);fe(g,n.memoizedState)||(zn=!0),n.memoizedState=g,n.baseQueue===null&&(n.baseState=g),o.lastRenderedState=g}return[g,u]}function Md(){}function $d(e,n){var o=Dt,u=dr(),p=n(),g=!fe(u.memoizedState,p);if(g&&(u.memoizedState=p,zn=!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,Id.bind(null,o,u,p,n),void 0,null),en===null)throw Error(i(349));(Ci&30)!==0||Td(o,n,p)}return p}function Td(e,n,o){e.flags|=16384,e={getSnapshot:n,value:o},n=Dt.updateQueue,n===null?(n={lastEffect:null,stores:null},Dt.updateQueue=n,n.stores=[e]):(o=n.stores,o===null?n.stores=[e]:o.push(e))}function Id(e,n,o,u){n.value=o,n.getSnapshot=u,Od(n)&&Rd(e)}function Ad(e,n,o){return o(function(){Od(n)&&Rd(e)})}function Od(e){var n=e.getSnapshot;e=e.value;try{var o=n();return!fe(e,o)}catch{return!0}}function Rd(e){var n=ko(e,1);n!==null&&Pr(n,e,1,-1)}function Dd(e){var n=Yr();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,Dt,e),[n.memoizedState,e]}function ua(e,n,o,u){return e={tag:e,create:n,destroy:o,deps:u,next:null},n=Dt.updateQueue,n===null?(n={lastEffect:null,stores:null},Dt.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 dr().memoizedState}function xl(e,n,o,u){var p=Yr();Dt.flags|=e,p.memoizedState=ua(1|n,o,void 0,u===void 0?null:u)}function wl(e,n,o,u){var p=dr();u=u===void 0?null:u;var g=void 0;if(Xt!==null){var E=Xt.memoizedState;if(g=E.destroy,u!==null&&dc(u,E.deps)){p.memoizedState=ua(n,o,g,u);return}}Dt.flags|=e,p.memoizedState=ua(1|n,o,g,u)}function zd(e,n){return xl(8390656,8,e,n)}function yc(e,n){return wl(2048,8,e,n)}function Fd(e,n){return wl(4,2,e,n)}function Bd(e,n){return wl(4,4,e,n)}function Hd(e,n){if(typeof n=="function")return e=e(),n(e),function(){n(null)};if(n!=null)return e=e(),n.current=e,function(){n.current=null}}function Vd(e,n,o){return o=o!=null?o.concat([e]):null,wl(4,4,Hd.bind(null,n,e),o)}function vc(){}function Ud(e,n){var o=dr();n=n===void 0?null:n;var u=o.memoizedState;return u!==null&&n!==null&&dc(n,u[1])?u[0]:(o.memoizedState=[e,n],e)}function Kd(e,n){var o=dr();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,zn=!0),e.memoizedState=o):(fe(o,n)||(o=Hr(),Dt.lanes|=o,ji|=o,e.baseState=!0),n)}function Mg(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 dr().memoizedState}function $g(e,n,o){var u=ri(e);if(o={lane:u,action:o,hasEagerState:!1,eagerState:null,next:null},Yd(e))Xd(n,o);else if(o=Nd(e,n,o,u),o!==null){var p=Mn();Pr(o,e,u,p),Qd(o,n,u)}}function Tg(e,n,o){var u=ri(e),p={lane:u,action:o,hasEagerState:!1,eagerState:null,next:null};if(Yd(e))Xd(n,p);else{var g=e.alternate;if(e.lanes===0&&(g===null||g.lanes===0)&&(g=n.lastRenderedReducer,g!==null))try{var E=n.lastRenderedState,L=g(E,o);if(p.hasEagerState=!0,p.eagerState=L,fe(L,E)){var X=n.interleaved;X===null?(p.next=p,ic(n)):(p.next=X.next,X.next=p),n.interleaved=p;return}}catch{}finally{}o=Nd(e,n,p,u),o!==null&&(p=Mn(),Pr(o,e,u,p),Qd(o,n,u))}}function Yd(e){var n=e.alternate;return e===Dt||n!==null&&n===Dt}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,Do(e,o)}}var bl={readContext:fr,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:fr,useCallback:function(e,n){return Yr().memoizedState=[e,n===void 0?null:n],e},useContext:fr,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=Yr();return n=n===void 0?null:n,e=e(),o.memoizedState=[e,n],e},useReducer:function(e,n,o){var u=Yr();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=$g.bind(null,Dt,e),[u.memoizedState,e]},useRef:function(e){var n=Yr();return e={current:e},n.memoizedState=e},useState:Dd,useDebugValue:vc,useDeferredValue:function(e){return Yr().memoizedState=e},useTransition:function(){var e=Dd(!1),n=e[0];return e=Mg.bind(null,e[1]),Yr().memoizedState=e,[n,e]},useMutableSource:function(){},useSyncExternalStore:function(e,n,o){var u=Dt,p=Yr();if(It){if(o===void 0)throw Error(i(407));o=o()}else{if(o=n(),en===null)throw Error(i(349));(Ci&30)!==0||Td(u,n,o)}p.memoizedState=o;var g={value:o,getSnapshot:n};return p.queue=g,zd(Ad.bind(null,u,g,e),[e]),u.flags|=2048,ua(9,Id.bind(null,u,g,o,n),void 0,null),o},useId:function(){var e=Yr(),n=en.identifierPrefix;if(It){var o=So,u=_o;o=(u&~(1<<32-hn(u)-1)).toString(32)+o,n=":"+n+"R"+o,o=aa++,0<o&&(n+="H"+o.toString(32)),n+=":"}else o=Pg++,n=":"+n+"r"+o.toString(32)+":";return e.memoizedState=n},unstable_isNewReconciler:!1},Ag={readContext:fr,useCallback:Ud,useContext:fr,useEffect:yc,useImperativeHandle:Vd,useInsertionEffect:Fd,useLayoutEffect:Bd,useMemo:Kd,useReducer:mc,useRef:Ld,useState:function(){return mc(la)},useDebugValue:vc,useDeferredValue:function(e){var n=dr();return qd(n,Xt.memoizedState,e)},useTransition:function(){var e=mc(la)[0],n=dr().memoizedState;return[e,n]},useMutableSource:Md,useSyncExternalStore:$d,useId:Wd,unstable_isNewReconciler:!1},Og={readContext:fr,useCallback:Ud,useContext:fr,useEffect:yc,useImperativeHandle:Vd,useInsertionEffect:Fd,useLayoutEffect:Bd,useMemo:Kd,useReducer:gc,useRef:Ld,useState:function(){return gc(la)},useDebugValue:vc,useDeferredValue:function(e){var n=dr();return Xt===null?n.memoizedState=e:qd(n,Xt.memoizedState,e)},useTransition:function(){var e=gc(la)[0],n=dr().memoizedState;return[e,n]},useMutableSource:Md,useSyncExternalStore:$d,useId:Wd,unstable_isNewReconciler:!1};function Er(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=Mn(),p=ri(e),g=No(u,p);g.payload=n,o!=null&&(g.callback=o),n=Zo(e,g,p),n!==null&&(Pr(n,e,p,u),hl(n,e,p))},enqueueReplaceState:function(e,n,o){e=e._reactInternals;var u=Mn(),p=ri(e),g=No(u,p);g.tag=1,g.payload=n,o!=null&&(g.callback=o),n=Zo(e,g,p),n!==null&&(Pr(n,e,p,u),hl(n,e,p))},enqueueForceUpdate:function(e,n){e=e._reactInternals;var o=Mn(),u=ri(e),p=No(o,u);p.tag=2,n!=null&&(p.callback=n),n=Zo(e,p,u),n!==null&&(Pr(n,e,u,o),hl(n,e,u))}};function Gd(e,n,o,u,p,g,E){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(u,g,E):n.prototype&&n.prototype.isPureReactComponent?!ne(o,u)||!ne(p,g):!0}function Jd(e,n,o){var u=!1,p=Qo,g=n.contextType;return typeof g=="object"&&g!==null?g=fr(g):(p=Ln(n)?_i:yn.current,u=n.contextTypes,g=(u=u!=null)?us(e,p):Qo),n=new n(o,g),e.memoizedState=n.state!==null&&n.state!==void 0?n.state:null,n.updater=_l,e.stateNode=n,n._reactInternals=e,u&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=p,e.__reactInternalMemoizedMaskedChildContext=g),n}function Zd(e,n,o,u){e=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(o,u),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(o,u),n.state!==e&&_l.enqueueReplaceState(n,n.state,null)}function wc(e,n,o,u){var p=e.stateNode;p.props=o,p.state=e.memoizedState,p.refs={},sc(e);var g=n.contextType;typeof g=="object"&&g!==null?p.context=fr(g):(g=Ln(n)?_i:yn.current,p.context=us(e,g)),p.state=e.memoizedState,g=n.getDerivedStateFromProps,typeof g=="function"&&(xc(e,n,g,o),p.state=e.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof p.getSnapshotBeforeUpdate=="function"||typeof p.UNSAFE_componentWillMount!="function"&&typeof p.componentWillMount!="function"||(n=p.state,typeof p.componentWillMount=="function"&&p.componentWillMount(),typeof p.UNSAFE_componentWillMount=="function"&&p.UNSAFE_componentWillMount(),n!==p.state&&_l.enqueueReplaceState(p,p.state,null),ml(e,o,p,u),p.state=e.memoizedState),typeof p.componentDidMount=="function"&&(e.flags|=4194308)}function ys(e,n){try{var o="",u=n;do o+=$e(u),u=u.return;while(u);var p=o}catch(g){p=`
39
+ Error generating stack: `+g.message+`
40
+ `+g.stack}return{value:e,source:n,stack:p,digest:null}}function bc(e,n,o){return{value:e,source:null,stack:o??null,digest:n??null}}function _c(e,n){try{console.error(n.value)}catch(o){setTimeout(function(){throw o})}}var Rg=typeof WeakMap=="function"?WeakMap:Map;function ep(e,n,o){o=No(-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 tp(e,n,o){o=No(-1,o),o.tag=3;var u=e.type.getDerivedStateFromError;if(typeof u=="function"){var p=n.value;o.payload=function(){return u(p)},o.callback=function(){_c(e,n)}}var g=e.stateNode;return g!==null&&typeof g.componentDidCatch=="function"&&(o.callback=function(){_c(e,n),typeof u!="function"&&(ti===null?ti=new Set([this]):ti.add(this));var E=n.stack;this.componentDidCatch(n.value,{componentStack:E!==null?E:""})}),o}function np(e,n,o){var u=e.pingCache;if(u===null){u=e.pingCache=new Rg;var p=new Set;u.set(n,p)}else p=u.get(n),p===void 0&&(p=new Set,u.set(n,p));p.has(o)||(p.add(o),e=Qg.bind(null,e,n,o),n.then(e,e))}function rp(e){do{var n;if((n=e.tag===13)&&(n=e.memoizedState,n=n!==null?n.dehydrated!==null:!0),n)return e;e=e.return}while(e!==null);return null}function op(e,n,o,u,p){return(e.mode&1)===0?(e===n?e.flags|=65536:(e.flags|=128,o.flags|=131072,o.flags&=-52805,o.tag===1&&(o.alternate===null?o.tag=17:(n=No(-1,1),n.tag=2,Zo(o,n,1))),o.lanes|=1),e):(e.flags|=65536,e.lanes=p,e)}var Dg=R.ReactCurrentOwner,zn=!1;function Pn(e,n,o,u){n.child=e===null?kd(n,null,o,u):ps(n,e.child,o,u)}function ip(e,n,o,u,p){o=o.render;var g=n.ref;return ms(n,p),u=pc(e,n,o,u,g,p),o=hc(),e!==null&&!zn?(n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~p,Eo(e,n,p)):(It&&o&&Qu(n),n.flags|=1,Pn(e,n,u,p),n.child)}function sp(e,n,o,u,p){if(e===null){var g=o.type;return typeof g=="function"&&!Uc(g)&&g.defaultProps===void 0&&o.compare===null&&o.defaultProps===void 0?(n.tag=15,n.type=g,ap(e,n,g,u,p)):(e=Ol(o.type,null,u,n,n.mode,p),e.ref=n.ref,e.return=n,n.child=e)}if(g=e.child,(e.lanes&p)===0){var E=g.memoizedProps;if(o=o.compare,o=o!==null?o:ne,o(E,u)&&e.ref===n.ref)return Eo(e,n,p)}return n.flags|=1,e=ii(g,u),e.ref=n.ref,e.return=n,n.child=e}function ap(e,n,o,u,p){if(e!==null){var g=e.memoizedProps;if(ne(g,u)&&e.ref===n.ref)if(zn=!1,n.pendingProps=u=g,(e.lanes&p)!==0)(e.flags&131072)!==0&&(zn=!0);else return n.lanes=e.lanes,Eo(e,n,p)}return Sc(e,n,o,u,p)}function lp(e,n,o){var u=n.pendingProps,p=u.children,g=e!==null?e.memoizedState:null;if(u.mode==="hidden")if((n.mode&1)===0)n.memoizedState={baseLanes:0,cachePool:null,transitions:null},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 Pn(e,n,p,o),n.child}function up(e,n){var o=n.ref;(e===null&&o!==null||e!==null&&e.ref!==o)&&(n.flags|=512,n.flags|=2097152)}function Sc(e,n,o,u,p){var g=Ln(o)?_i:yn.current;return g=us(n,g),ms(n,p),o=pc(e,n,o,u,g,p),u=hc(),e!==null&&!zn?(n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~p,Eo(e,n,p)):(It&&u&&Qu(n),n.flags|=1,Pn(e,n,o,p),n.child)}function cp(e,n,o,u,p){if(Ln(o)){var g=!0;sl(n)}else g=!1;if(ms(n,p),n.stateNode===null)kl(e,n),Jd(n,o,u),wc(n,o,u,p),u=!0;else if(e===null){var E=n.stateNode,L=n.memoizedProps;E.props=L;var X=E.context,ye=o.contextType;typeof ye=="object"&&ye!==null?ye=fr(ye):(ye=Ln(o)?_i:yn.current,ye=us(n,ye));var Me=o.getDerivedStateFromProps,Ie=typeof Me=="function"||typeof E.getSnapshotBeforeUpdate=="function";Ie||typeof E.UNSAFE_componentWillReceiveProps!="function"&&typeof E.componentWillReceiveProps!="function"||(L!==u||X!==ye)&&Zd(n,E,u,ye),Jo=!1;var Pe=n.memoizedState;E.state=Pe,ml(n,u,E,p),X=n.memoizedState,L!==u||Pe!==X||Dn.current||Jo?(typeof Me=="function"&&(xc(n,o,Me,u),X=n.memoizedState),(L=Jo||Gd(n,o,L,u,Pe,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:Er(n.type,L),E.props=ye,Ie=n.pendingProps,Pe=E.context,X=o.contextType,typeof X=="object"&&X!==null?X=fr(X):(X=Ln(o)?_i:yn.current,X=us(n,X));var Ke=o.getDerivedStateFromProps;(Me=typeof Ke=="function"||typeof E.getSnapshotBeforeUpdate=="function")||typeof E.UNSAFE_componentWillReceiveProps!="function"&&typeof E.componentWillReceiveProps!="function"||(L!==Ie||Pe!==X)&&Zd(n,E,u,X),Jo=!1,Pe=n.memoizedState,E.state=Pe,ml(n,u,E,p);var Qe=n.memoizedState;L!==Ie||Pe!==Qe||Dn.current||Jo?(typeof Ke=="function"&&(xc(n,o,Ke,u),Qe=n.memoizedState),(ye=Jo||Gd(n,o,ye,u,Pe,Qe,X)||!1)?(Me||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&&Pe===e.memoizedState||(n.flags|=4),typeof E.getSnapshotBeforeUpdate!="function"||L===e.memoizedProps&&Pe===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&&Pe===e.memoizedState||(n.flags|=4),typeof E.getSnapshotBeforeUpdate!="function"||L===e.memoizedProps&&Pe===e.memoizedState||(n.flags|=1024),u=!1)}return kc(e,n,o,u,g,p)}function kc(e,n,o,u,p,g){up(e,n);var E=(n.flags&128)!==0;if(!u&&!E)return p&&md(n,o,!1),Eo(e,n,g);u=n.stateNode,Dg.current=n;var L=E&&typeof o.getDerivedStateFromError!="function"?null:u.render();return n.flags|=1,e!==null&&E?(n.child=ps(n,e.child,null,g),n.child=ps(n,null,L,g)):Pn(e,n,L,g),n.memoizedState=u.state,p&&md(n,o,!0),n.child}function fp(e){var n=e.stateNode;n.pendingContext?pd(e,n.pendingContext,n.pendingContext!==n.context):n.context&&pd(e,n.context,!1),ac(e,n.containerInfo)}function dp(e,n,o,u,p){return ds(),ec(p),n.flags|=256,Pn(e,n,o,u),n.child}var Nc={dehydrated:null,treeContext:null,retryLane:0};function Ec(e){return{baseLanes:e,cachePool:null,transitions:null}}function pp(e,n,o){var u=n.pendingProps,p=Rt.current,g=!1,E=(n.flags&128)!==0,L;if((L=E)||(L=e!==null&&e.memoizedState===null?!1:(p&2)!==0),L?(g=!0,n.flags&=-129):(e===null||e.memoizedState!==null)&&(p|=1),kt(Rt,p&1),e===null)return Zu(n),e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?((n.mode&1)===0?n.lanes=1:e.data==="$!"?n.lanes=8:n.lanes=1073741824,null):(E=u.children,e=u.fallback,g?(u=n.mode,g=n.child,E={mode:"hidden",children:E},(u&1)===0&&g!==null?(g.childLanes=0,g.pendingProps=E):g=Rl(E,u,0,null),e=Ti(e,u,o,null),g.return=n,e.return=n,g.sibling=e,n.child=g,n.child.memoizedState=Ec(o),n.memoizedState=Nc,e):Cc(n,E));if(p=e.memoizedState,p!==null&&(L=p.dehydrated,L!==null))return Lg(e,n,E,u,L,p,o);if(g){g=u.fallback,E=n.mode,p=e.child,L=p.sibling;var X={mode:"hidden",children:u.children};return(E&1)===0&&n.child!==p?(u=n.child,u.childLanes=0,u.pendingProps=X,n.deletions=null):(u=ii(p,X),u.subtreeFlags=p.subtreeFlags&14680064),L!==null?g=ii(L,g):(g=Ti(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=ii(g,{mode:"visible",children:u.children}),(n.mode&1)===0&&(u.lanes=o),u.return=n,u.sibling=null,e!==null&&(o=n.deletions,o===null?(n.deletions=[e],n.flags|=16):o.push(e)),n.child=u,n.memoizedState=null,u}function Cc(e,n){return n=Rl({mode:"visible",children:n},e.mode,0,null),n.return=e,e.child=n}function Sl(e,n,o,u){return u!==null&&ec(u),ps(n,e.child,null,o),e=Cc(n,n.pendingProps.children),e.flags|=2,n.memoizedState=null,e}function Lg(e,n,o,u,p,g,E){if(o)return n.flags&256?(n.flags&=-257,u=bc(Error(i(422))),Sl(e,n,E,u)):n.memoizedState!==null?(n.child=e.child,n.flags|=128,null):(g=u.fallback,p=n.mode,u=Rl({mode:"visible",children:u.children},p,0,null),g=Ti(g,p,E,null),g.flags|=2,u.return=n,g.return=n,u.sibling=g,n.child=u,(n.mode&1)!==0&&ps(n,e.child,null,E),n.child.memoizedState=Ec(E),n.memoizedState=Nc,g);if((n.mode&1)===0)return Sl(e,n,E,null);if(p.data==="$!"){if(u=p.nextSibling&&p.nextSibling.dataset,u)var 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,zn||L){if(u=en,u!==null){switch(E&-E){case 4:p=2;break;case 16:p=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:p=32;break;case 536870912:p=268435456;break;default:p=0}p=(p&(u.suspendedLanes|E))!==0?0:p,p!==0&&p!==g.retryLane&&(g.retryLane=p,ko(e,p),Pr(u,e,p,-1))}return Vc(),u=bc(Error(i(421))),Sl(e,n,E,u)}return p.data==="$?"?(n.flags|=128,n.child=e.child,n=Gg.bind(null,e),p._reactRetry=n,null):(e=g.treeContext,Gn=Yo(p.nextSibling),Qn=n,It=!0,Nr=null,e!==null&&(ur[cr++]=_o,ur[cr++]=So,ur[cr++]=Si,_o=e.id,So=e.overflow,Si=n),n=Cc(n,u.children),n.flags|=4096,n)}function hp(e,n,o){e.lanes|=n;var u=e.alternate;u!==null&&(u.lanes|=n),oc(e.return,n,o)}function jc(e,n,o,u,p){var g=e.memoizedState;g===null?e.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:u,tail:o,tailMode:p}:(g.isBackwards=n,g.rendering=null,g.renderingStartTime=0,g.last=u,g.tail=o,g.tailMode=p)}function mp(e,n,o){var u=n.pendingProps,p=u.revealOrder,g=u.tail;if(Pn(e,n,u.children,o),u=Rt.current,(u&2)!==0)u=u&1|2,n.flags|=128;else{if(e!==null&&(e.flags&128)!==0)e:for(e=n.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&hp(e,o,n);else if(e.tag===19)hp(e,o,n);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===n)break e;for(;e.sibling===null;){if(e.return===null||e.return===n)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}u&=1}if(kt(Rt,u),(n.mode&1)===0)n.memoizedState=null;else switch(p){case"forwards":for(o=n.child,p=null;o!==null;)e=o.alternate,e!==null&&gl(e)===null&&(p=o),o=o.sibling;o=p,o===null?(p=n.child,n.child=null):(p=o.sibling,o.sibling=null),jc(n,!1,p,o,g);break;case"backwards":for(o=null,p=n.child,n.child=null;p!==null;){if(e=p.alternate,e!==null&&gl(e)===null){n.child=p;break}e=p.sibling,p.sibling=o,o=p,p=e}jc(n,!0,o,null,g);break;case"together":jc(n,!1,null,null,void 0);break;default:n.memoizedState=null}return n.child}function kl(e,n){(n.mode&1)===0&&e!==null&&(e.alternate=null,n.alternate=null,n.flags|=2)}function Eo(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=ii(e,e.pendingProps),n.child=o,o.return=n;e.sibling!==null;)e=e.sibling,o=o.sibling=ii(e,e.pendingProps),o.return=n;o.sibling=null}return n.child}function zg(e,n,o){switch(n.tag){case 3:fp(n),ds();break;case 5:Pd(n);break;case 1:Ln(n.type)&&sl(n);break;case 4:ac(n,n.stateNode.containerInfo);break;case 10:var u=n.type._context,p=n.memoizedProps.value;kt(dl,u._currentValue),u._currentValue=p;break;case 13:if(u=n.memoizedState,u!==null)return u.dehydrated!==null?(kt(Rt,Rt.current&1),n.flags|=128,null):(o&n.child.childLanes)!==0?pp(e,n,o):(kt(Rt,Rt.current&1),e=Eo(e,n,o),e!==null?e.sibling:null);kt(Rt,Rt.current&1);break;case 19:if(u=(o&n.childLanes)!==0,(e.flags&128)!==0){if(u)return mp(e,n,o);n.flags|=128}if(p=n.memoizedState,p!==null&&(p.rendering=null,p.tail=null,p.lastEffect=null),kt(Rt,Rt.current),u)break;return null;case 22:case 23:return n.lanes=0,lp(e,n,o)}return Eo(e,n,o)}var gp,Pc,yp,vp;gp=function(e,n){for(var o=n.child;o!==null;){if(o.tag===5||o.tag===6)e.appendChild(o.stateNode);else if(o.tag!==4&&o.child!==null){o.child.return=o,o=o.child;continue}if(o===n)break;for(;o.sibling===null;){if(o.return===null||o.return===n)return;o=o.return}o.sibling.return=o.return,o=o.sibling}},Pc=function(){},yp=function(e,n,o,u){var p=e.memoizedProps;if(p!==u){e=n.stateNode,Ei(Wr.current);var g=null;switch(o){case"input":p=lt(e,p),u=lt(e,u),g=[];break;case"select":p=F({},p,{value:void 0}),u=F({},u,{value:void 0}),g=[];break;case"textarea":p=dn(e,p),u=dn(e,u),g=[];break;default:typeof p.onClick!="function"&&typeof u.onClick=="function"&&(e.onclick=rl)}Ye(o,u);var E;o=null;for(ye in p)if(!u.hasOwnProperty(ye)&&p.hasOwnProperty(ye)&&p[ye]!=null)if(ye==="style"){var L=p[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=p!=null?p[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)}},vp=function(e,n,o,u){o!==u&&(n.flags|=4)};function ca(e,n){if(!It)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 p=e.child;p!==null;)o|=p.lanes|p.childLanes,u|=p.subtreeFlags&14680064,u|=p.flags&14680064,p.return=e,p=p.sibling;else for(p=e.child;p!==null;)o|=p.lanes|p.childLanes,u|=p.subtreeFlags,u|=p.flags,p.return=e,p=p.sibling;return e.subtreeFlags|=u,e.childLanes=o,n}function Fg(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 Ln(n.type)&&il(),xn(n),null;case 3:return u=n.stateNode,gs(),Pt(Dn),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,Nr!==null&&(Fc(Nr),Nr=null))),Pc(e,n),xn(n),null;case 5:lc(n);var p=Ei(ia.current);if(o=n.type,e!==null&&n.stateNode!=null)yp(e,n,o,u,p),e.ref!==n.ref&&(n.flags|=512,n.flags|=2097152);else{if(!u){if(n.stateNode===null)throw Error(i(166));return xn(n),null}if(e=Ei(Wr.current),cl(n)){u=n.stateNode,o=n.type;var g=n.memoizedProps;switch(u[qr]=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(p=0;p<xo.length;p++)jt(xo[p],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":ut(u,g),jt("invalid",u);break;case"select":u._wrapperState={wasMultiple:!!g.multiple},jt("invalid",u);break;case"textarea":rn(u,g),jt("invalid",u)}Ye(o,g),p=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),p=["children",L]):typeof L=="number"&&u.textContent!==""+L&&(g.suppressHydrationWarning!==!0&&nl(u.textContent,L,e),p=["children",""+L]):l.hasOwnProperty(E)&&L!=null&&E==="onScroll"&&jt("scroll",u)}switch(o){case"input":Be(u),St(u,g,!0);break;case"textarea":Be(u),bn(u);break;case"select":case"option":break;default:typeof g.onClick=="function"&&(u.onclick=rl)}u=p,n.updateQueue=u,u!==null&&(n.flags|=4)}else{E=p.nodeType===9?p:p.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=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[qr]=n,e[ea]=u,gp(e,n,!1,!1),n.stateNode=e;e:{switch(E=Kn(o,u),o){case"dialog":jt("cancel",e),jt("close",e),p=u;break;case"iframe":case"object":case"embed":jt("load",e),p=u;break;case"video":case"audio":for(p=0;p<xo.length;p++)jt(xo[p],e);p=u;break;case"source":jt("error",e),p=u;break;case"img":case"image":case"link":jt("error",e),jt("load",e),p=u;break;case"details":jt("toggle",e),p=u;break;case"input":ut(e,u),p=lt(e,u),jt("invalid",e);break;case"option":p=u;break;case"select":e._wrapperState={wasMultiple:!!u.multiple},p=F({},u,{value:void 0}),jt("invalid",e);break;case"textarea":rn(e,u),p=dn(e,u),jt("invalid",e);break;default:p=u}Ye(o,p),L=p;for(g in L)if(L.hasOwnProperty(g)){var X=L[g];g==="style"?Sn(e,X):g==="dangerouslySetInnerHTML"?(X=X?X.__html:void 0,X!=null&&tr(e,X)):g==="children"?typeof X=="string"?(o!=="textarea"||X!=="")&&_n(e,X):typeof X=="number"&&_n(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":Be(e),St(e,u,!1);break;case"textarea":Be(e),bn(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?_t(e,!!u.multiple,g,!1):u.defaultValue!=null&&_t(e,!!u.multiple,u.defaultValue,!0);break;default:typeof p.onClick=="function"&&(e.onclick=rl)}switch(o){case"button":case"input":case"select":case"textarea":u=!!u.autoFocus;break e;case"img":u=!0;break e;default:u=!1}}u&&(n.flags|=4)}n.ref!==null&&(n.flags|=512,n.flags|=2097152)}return xn(n),null;case 6:if(e&&n.stateNode!=null)vp(e,n,e.memoizedProps,u);else{if(typeof u!="string"&&n.stateNode===null)throw Error(i(166));if(o=Ei(ia.current),Ei(Wr.current),cl(n)){if(u=n.stateNode,o=n.memoizedProps,u[qr]=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[qr]=n,n.stateNode=u}return xn(n),null;case 13:if(Pt(Rt),u=n.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(It&&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[qr]=n}else ds(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;xn(n),g=!1}else Nr!==null&&(Fc(Nr),Nr=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||(Rt.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 Ln(n.type)&&il(),xn(n),null;case 19:if(Pt(Rt),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(Rt,Rt.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&&!It)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=Rt.current,kt(Rt,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 Bg(e,n){switch(Gu(n),n.tag){case 1:return Ln(n.type)&&il(),e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 3:return gs(),Pt(Dn),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(Rt),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(Rt),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,Hg=typeof WeakSet=="function"?WeakSet:Set,Xe=null;function vs(e,n){var o=e.ref;if(o!==null)if(typeof o=="function")try{o(null)}catch(u){Ft(e,n,u)}else o.current=null}function Mc(e,n,o){try{o()}catch(u){Ft(e,n,u)}}var xp=!1;function Vg(e,n){if(Hu=Ki,e=ie(),oe(e)){if("selectionStart"in e)var o={start:e.selectionStart,end:e.selectionEnd};else e:{o=(o=e.ownerDocument)&&o.defaultView||window;var u=o.getSelection&&o.getSelection();if(u&&u.rangeCount!==0){o=u.anchorNode;var p=u.anchorOffset,g=u.focusNode;u=u.focusOffset;try{o.nodeType,g.nodeType}catch{o=null;break e}var E=0,L=-1,X=-1,ye=0,Me=0,Ie=e,Pe=null;t:for(;;){for(var Ke;Ie!==o||p!==0&&Ie.nodeType!==3||(L=E+p),Ie!==g||u!==0&&Ie.nodeType!==3||(X=E+u),Ie.nodeType===3&&(E+=Ie.nodeValue.length),(Ke=Ie.firstChild)!==null;)Pe=Ie,Ie=Ke;for(;;){if(Ie===e)break t;if(Pe===o&&++ye===p&&(L=E),Pe===g&&++Me===u&&(X=E),(Ke=Ie.nextSibling)!==null)break;Ie=Pe,Pe=Ie.parentNode}Ie=Ke}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},Ki=!1,Xe=n;Xe!==null;)if(n=Xe,e=n.child,(n.subtreeFlags&1028)!==0&&e!==null)e.return=n,Xe=e;else for(;Xe!==null;){n=Xe;try{var Qe=n.alternate;if((n.flags&1024)!==0)switch(n.tag){case 0:case 11:case 15:break;case 1:if(Qe!==null){var Ge=Qe.memoizedProps,Bt=Qe.memoizedState,he=n.stateNode,re=he.getSnapshotBeforeUpdate(n.elementType===n.type?Ge:Er(n.type,Ge),Bt);he.__reactInternalSnapshotBeforeUpdate=re}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=xp,xp=!1,Qe}function fa(e,n,o){var u=n.updateQueue;if(u=u!==null?u.lastEffect:null,u!==null){var p=u=u.next;do{if((p.tag&e)===e){var g=p.destroy;p.destroy=void 0,g!==void 0&&Mc(n,o,g)}p=p.next}while(p!==u)}}function El(e,n){if(n=n.updateQueue,n=n!==null?n.lastEffect:null,n!==null){var o=n=n.next;do{if((o.tag&e)===e){var u=o.create;o.destroy=u()}o=o.next}while(o!==n)}}function $c(e){var n=e.ref;if(n!==null){var o=e.stateNode;switch(e.tag){case 5:e=o;break;default:e=o}typeof n=="function"?n(e):n.current=e}}function wp(e){var n=e.alternate;n!==null&&(e.alternate=null,wp(n)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(n=e.stateNode,n!==null&&(delete n[qr],delete n[ea],delete n[Wu],delete n[Ng],delete n[Eg])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function bp(e){return e.tag===5||e.tag===3||e.tag===4}function _p(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||bp(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Tc(e,n,o){var u=e.tag;if(u===5||u===6)e=e.stateNode,n?o.nodeType===8?o.parentNode.insertBefore(e,n):o.insertBefore(e,n):(o.nodeType===8?(n=o.parentNode,n.insertBefore(e,o)):(n=o,n.appendChild(e)),o=o._reactRootContainer,o!=null||n.onclick!==null||(n.onclick=rl));else if(u!==4&&(e=e.child,e!==null))for(Tc(e,n,o),e=e.sibling;e!==null;)Tc(e,n,o),e=e.sibling}function Ic(e,n,o){var u=e.tag;if(u===5||u===6)e=e.stateNode,n?o.insertBefore(e,n):o.appendChild(e);else if(u!==4&&(e=e.child,e!==null))for(Ic(e,n,o),e=e.sibling;e!==null;)Ic(e,n,o),e=e.sibling}var cn=null,Cr=!1;function ei(e,n,o){for(o=o.child;o!==null;)Sp(e,n,o),o=o.sibling}function Sp(e,n,o){if(jn&&typeof jn.onCommitFiberUnmount=="function")try{jn.onCommitFiberUnmount(sr,o)}catch{}switch(o.tag){case 5:wn||vs(o,n);case 6:var u=cn,p=Cr;cn=null,ei(e,n,o),cn=u,Cr=p,cn!==null&&(Cr?(e=cn,o=o.stateNode,e.nodeType===8?e.parentNode.removeChild(o):e.removeChild(o)):cn.removeChild(o.stateNode));break;case 18:cn!==null&&(Cr?(e=cn,o=o.stateNode,e.nodeType===8?qu(e.parentNode,o):e.nodeType===1&&qu(e,o),uo(e)):qu(cn,o.stateNode));break;case 4:u=cn,p=Cr,cn=o.stateNode.containerInfo,Cr=!0,ei(e,n,o),cn=u,Cr=p;break;case 0:case 11:case 14:case 15:if(!wn&&(u=o.updateQueue,u!==null&&(u=u.lastEffect,u!==null))){p=u=u.next;do{var g=p,E=g.destroy;g=g.tag,E!==void 0&&((g&2)!==0||(g&4)!==0)&&Mc(o,n,E),p=p.next}while(p!==u)}ei(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)}ei(e,n,o);break;case 21:ei(e,n,o);break;case 22:o.mode&1?(wn=(u=wn)||o.memoizedState!==null,ei(e,n,o),wn=u):ei(e,n,o);break;default:ei(e,n,o)}}function kp(e){var n=e.updateQueue;if(n!==null){e.updateQueue=null;var o=e.stateNode;o===null&&(o=e.stateNode=new Hg),n.forEach(function(u){var p=Jg.bind(null,e,u);o.has(u)||(o.add(u),u.then(p,p))})}}function jr(e,n){var o=n.deletions;if(o!==null)for(var u=0;u<o.length;u++){var p=o[u];try{var g=e,E=n,L=E;e:for(;L!==null;){switch(L.tag){case 5:cn=L.stateNode,Cr=!1;break e;case 3:cn=L.stateNode.containerInfo,Cr=!0;break e;case 4:cn=L.stateNode.containerInfo,Cr=!0;break e}L=L.return}if(cn===null)throw Error(i(160));Sp(g,E,p),cn=null,Cr=!1;var X=p.alternate;X!==null&&(X.return=null),p.return=null}catch(ye){Ft(p,n,ye)}}if(n.subtreeFlags&12854)for(n=n.child;n!==null;)Np(n,e),n=n.sibling}function Np(e,n){var o=e.alternate,u=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(jr(n,e),Xr(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:jr(n,e),Xr(e),u&512&&o!==null&&vs(o,o.return);break;case 5:if(jr(n,e),Xr(e),u&512&&o!==null&&vs(o,o.return),e.flags&32){var p=e.stateNode;try{_n(p,"")}catch(Ge){Ft(e,e.return,Ge)}}if(u&4&&(p=e.stateNode,p!=null)){var g=e.memoizedProps,E=o!==null?o.memoizedProps:g,L=e.type,X=e.updateQueue;if(e.updateQueue=null,X!==null)try{L==="input"&&g.type==="radio"&&g.name!=null&&ot(p,g),Kn(L,E);var ye=Kn(L,g);for(E=0;E<X.length;E+=2){var Me=X[E],Ie=X[E+1];Me==="style"?Sn(p,Ie):Me==="dangerouslySetInnerHTML"?tr(p,Ie):Me==="children"?_n(p,Ie):P(p,Me,Ie,ye)}switch(L){case"input":$t(p,g);break;case"textarea":mr(p,g);break;case"select":var Pe=p._wrapperState.wasMultiple;p._wrapperState.wasMultiple=!!g.multiple;var Ke=g.value;Ke!=null?_t(p,!!g.multiple,Ke,!1):Pe!==!!g.multiple&&(g.defaultValue!=null?_t(p,!!g.multiple,g.defaultValue,!0):_t(p,!!g.multiple,g.multiple?[]:"",!1))}p[ea]=g}catch(Ge){Ft(e,e.return,Ge)}}break;case 6:if(jr(n,e),Xr(e),u&4){if(e.stateNode===null)throw Error(i(162));p=e.stateNode,g=e.memoizedProps;try{p.nodeValue=g}catch(Ge){Ft(e,e.return,Ge)}}break;case 3:if(jr(n,e),Xr(e),u&4&&o!==null&&o.memoizedState.isDehydrated)try{uo(n.containerInfo)}catch(Ge){Ft(e,e.return,Ge)}break;case 4:jr(n,e),Xr(e);break;case 13:jr(n,e),Xr(e),p=e.child,p.flags&8192&&(g=p.memoizedState!==null,p.stateNode.isHidden=g,!g||p.alternate!==null&&p.alternate.memoizedState!==null||(Rc=gt())),u&4&&kp(e);break;case 22:if(Me=o!==null&&o.memoizedState!==null,e.mode&1?(wn=(ye=wn)||Me,jr(n,e),wn=ye):jr(n,e),Xr(e),u&8192){if(ye=e.memoizedState!==null,(e.stateNode.isHidden=ye)&&!Me&&(e.mode&1)!==0)for(Xe=e,Me=e.child;Me!==null;){for(Ie=Xe=Me;Xe!==null;){switch(Pe=Xe,Ke=Pe.child,Pe.tag){case 0:case 11:case 14:case 15:fa(4,Pe,Pe.return);break;case 1:vs(Pe,Pe.return);var Qe=Pe.stateNode;if(typeof Qe.componentWillUnmount=="function"){u=Pe,o=Pe.return;try{n=u,Qe.props=n.memoizedProps,Qe.state=n.memoizedState,Qe.componentWillUnmount()}catch(Ge){Ft(u,o,Ge)}}break;case 5:vs(Pe,Pe.return);break;case 22:if(Pe.memoizedState!==null){jp(Ie);continue}}Ke!==null?(Ke.return=Pe,Xe=Ke):jp(Ie)}Me=Me.sibling}e:for(Me=null,Ie=e;;){if(Ie.tag===5){if(Me===null){Me=Ie;try{p=Ie.stateNode,ye?(g=p.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=gr("display",E))}catch(Ge){Ft(e,e.return,Ge)}}}else if(Ie.tag===6){if(Me===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;Me===Ie&&(Me=null),Ie=Ie.return}Me===Ie&&(Me=null),Ie.sibling.return=Ie.return,Ie=Ie.sibling}}break;case 19:jr(n,e),Xr(e),u&4&&kp(e);break;case 21:break;default:jr(n,e),Xr(e)}}function Xr(e){var n=e.flags;if(n&2){try{e:{for(var o=e.return;o!==null;){if(bp(o)){var u=o;break e}o=o.return}throw Error(i(160))}switch(u.tag){case 5:var p=u.stateNode;u.flags&32&&(_n(p,""),u.flags&=-33);var g=_p(e);Ic(e,g,p);break;case 3:case 4:var E=u.stateNode.containerInfo,L=_p(e);Tc(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 Ug(e,n,o){Xe=e,Ep(e)}function Ep(e,n,o){for(var u=(e.mode&1)!==0;Xe!==null;){var p=Xe,g=p.child;if(p.tag===22&&u){var E=p.memoizedState!==null||Nl;if(!E){var L=p.alternate,X=L!==null&&L.memoizedState!==null||wn;L=Nl;var ye=wn;if(Nl=E,(wn=X)&&!ye)for(Xe=p;Xe!==null;)E=Xe,X=E.child,E.tag===22&&E.memoizedState!==null?Pp(p):X!==null?(X.return=E,Xe=X):Pp(p);for(;g!==null;)Xe=g,Ep(g),g=g.sibling;Xe=p,Nl=L,wn=ye}Cp(e)}else(p.subtreeFlags&8772)!==0&&g!==null?(g.return=p,Xe=g):Cp(e)}}function Cp(e){for(;Xe!==null;){var n=Xe;if((n.flags&8772)!==0){var o=n.alternate;try{if((n.flags&8772)!==0)switch(n.tag){case 0:case 11:case 15:wn||El(5,n);break;case 1:var u=n.stateNode;if(n.flags&4&&!wn)if(o===null)u.componentDidMount();else{var p=n.elementType===n.type?o.memoizedProps:Er(n.type,o.memoizedProps);u.componentDidUpdate(p,o.memoizedState,u.__reactInternalSnapshotBeforeUpdate)}var g=n.updateQueue;g!==null&&jd(n,g,u);break;case 3:var E=n.updateQueue;if(E!==null){if(o=null,n.child!==null)switch(n.child.tag){case 5:o=n.child.stateNode;break;case 1:o=n.child.stateNode}jd(n,E,o)}break;case 5:var 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 Me=ye.memoizedState;if(Me!==null){var Ie=Me.dehydrated;Ie!==null&&uo(Ie)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(i(163))}wn||n.flags&512&&$c(n)}catch(Pe){Ft(n,n.return,Pe)}}if(n===e){Xe=null;break}if(o=n.sibling,o!==null){o.return=n.return,Xe=o;break}Xe=n.return}}function jp(e){for(;Xe!==null;){var n=Xe;if(n===e){Xe=null;break}var o=n.sibling;if(o!==null){o.return=n.return,Xe=o;break}Xe=n.return}}function Pp(e){for(;Xe!==null;){var n=Xe;try{switch(n.tag){case 0:case 11:case 15:var o=n.return;try{El(4,n)}catch(X){Ft(n,o,X)}break;case 1:var u=n.stateNode;if(typeof u.componentDidMount=="function"){var p=n.return;try{u.componentDidMount()}catch(X){Ft(n,p,X)}}var g=n.return;try{$c(n)}catch(X){Ft(n,g,X)}break;case 5:var E=n.return;try{$c(n)}catch(X){Ft(n,E,X)}}}catch(X){Ft(n,n.return,X)}if(n===e){Xe=null;break}var 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,Vt=null,fn=0,Jn=0,xs=Xo(0),Qt=0,da=null,ji=0,jl=0,Oc=0,pa=null,Fn=null,Rc=0,ws=1/0,Co=null,Pl=!1,Dc=null,ti=null,Ml=!1,ni=null,$l=0,ha=0,Lc=null,Tl=-1,Il=0;function Mn(){return(vt&6)!==0?gt():Tl!==-1?Tl:Tl=gt()}function ri(e){return(e.mode&1)===0?1:(vt&2)!==0&&fn!==0?fn&-fn:jg.transition!==null?(Il===0&&(Il=Hr()),Il):(e=xt,e!==0||(e=window.event,e=e===void 0?16:qi(e.type)),e)}function Pr(e,n,o,u){if(50<ha)throw ha=0,Lc=null,Error(i(185));lr(e,o,u),((vt&2)===0||e!==en)&&(e===en&&((vt&2)===0&&(jl|=o),Qt===4&&oi(e,fn)),Bn(e,u),o===1&&vt===0&&(n.mode&1)===0&&(ws=gt()+500,al&&Go()))}function Bn(e,n){var o=e.callbackNode;so(e,n);var u=yt(e,e===en?fn:0);if(u===0)o!==null&&Ao(o),e.callbackNode=null,e.callbackPriority=0;else if(n=u&-u,e.callbackPriority!==n){if(o!=null&&Ao(o),n===1)e.tag===0?Cg($p.bind(null,e)):gd($p.bind(null,e)),Sg(function(){(vt&6)===0&&Go()}),o=null;else{switch(Ba(u)){case 1:o=zr;break;case 4:o=Oo;break;case 16:o=Fr;break;case 536870912:o=fi;break;default:o=Fr}o=zp(o,Mp.bind(null,e))}e.callbackPriority=n,e.callbackNode=o}}function Mp(e,n){if(Tl=-1,Il=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?fn:0);if(u===0)return null;if((u&30)!==0||(u&e.expiredLanes)!==0||n)n=Al(e,u);else{n=u;var p=vt;vt|=2;var g=Ip();(en!==e||fn!==n)&&(Co=null,ws=gt()+500,Mi(e,n));do try{Yg();break}catch(L){Tp(e,L)}while(!0);nc(),Cl.current=g,vt=p,Vt!==null?n=0:(en=null,fn=0,n=Qt)}if(n!==0){if(n===2&&(p=ar(e),p!==0&&(u=p,n=zc(e,p))),n===1)throw o=da,Mi(e,0),oi(e,u),Bn(e,gt()),o;if(n===6)oi(e,u);else{if(p=e.current.alternate,(u&30)===0&&!qg(p)&&(n=Al(e,u),n===2&&(g=ar(e),g!==0&&(u=g,n=zc(e,g))),n===1))throw o=da,Mi(e,0),oi(e,u),Bn(e,gt()),o;switch(e.finishedWork=p,e.finishedLanes=u,n){case 0:case 1:throw Error(i(345));case 2:$i(e,Fn,Co);break;case 3:if(oi(e,u),(u&130023424)===u&&(n=Rc+500-gt(),10<n)){if(yt(e,0)!==0)break;if(p=e.suspendedLanes,(p&u)!==u){Mn(),e.pingedLanes|=e.suspendedLanes&p;break}e.timeoutHandle=Ku($i.bind(null,e,Fn,Co),n);break}$i(e,Fn,Co);break;case 4:if(oi(e,u),(u&4194240)===u)break;for(n=e.eventTimes,p=-1;0<u;){var E=31-hn(u);g=1<<E,E=n[E],E>p&&(p=E),u&=~g}if(u=p,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=Ku($i.bind(null,e,Fn,Co),u);break}$i(e,Fn,Co);break;case 5:$i(e,Fn,Co);break;default:throw Error(i(329))}}}return Bn(e,gt()),e.callbackNode===o?Mp.bind(null,e):null}function zc(e,n){var o=pa;return e.current.memoizedState.isDehydrated&&(Mi(e,n).flags|=256),e=Al(e,n),e!==2&&(n=Fn,Fn=o,n!==null&&Fc(n)),e}function Fc(e){Fn===null?Fn=e:Fn.push.apply(Fn,e)}function qg(e){for(var n=e;;){if(n.flags&16384){var o=n.updateQueue;if(o!==null&&(o=o.stores,o!==null))for(var u=0;u<o.length;u++){var p=o[u],g=p.getSnapshot;p=p.value;try{if(!fe(g(),p))return!1}catch{return!1}}}if(o=n.child,n.subtreeFlags&16384&&o!==null)o.return=n,n=o;else{if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return!0;n=n.return}n.sibling.return=n.return,n=n.sibling}}return!0}function oi(e,n){for(n&=~Oc,n&=~jl,e.suspendedLanes|=n,e.pingedLanes&=~n,e=e.expirationTimes;0<n;){var o=31-hn(n),u=1<<o;e[o]=-1,n&=~u}}function $p(e){if((vt&6)!==0)throw Error(i(327));bs();var n=yt(e,0);if((n&1)===0)return Bn(e,gt()),null;var o=Al(e,n);if(e.tag!==0&&o===2){var u=ar(e);u!==0&&(n=u,o=zc(e,u))}if(o===1)throw o=da,Mi(e,0),oi(e,n),Bn(e,gt()),o;if(o===6)throw Error(i(345));return e.finishedWork=e.current.alternate,e.finishedLanes=n,$i(e,Fn,Co),Bn(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&&Go())}}function Pi(e){ni!==null&&ni.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&&Go()}}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,_g(o)),Vt!==null)for(o=Vt.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(Dn),Pt(yn),cc();break;case 5:lc(u);break;case 4:gs();break;case 13:Pt(Rt);break;case 19:Pt(Rt);break;case 10:rc(u.type._context);break;case 22:case 23:Hc()}o=o.return}if(en=e,Vt=e=ii(e.current,null),fn=Jn=n,Qt=0,da=null,Oc=jl=ji=0,Fn=pa=null,Ni!==null){for(n=0;n<Ni.length;n++)if(o=Ni[n],u=o.interleaved,u!==null){o.interleaved=null;var p=u.next,g=o.pending;if(g!==null){var E=g.next;g.next=p,u.next=E}o.pending=u}Ni=null}return e}function Tp(e,n){do{var o=Vt;try{if(nc(),yl.current=bl,vl){for(var u=Dt.memoizedState;u!==null;){var p=u.queue;p!==null&&(p.pending=null),u=u.next}vl=!1}if(Ci=0,Zt=Xt=Dt=null,sa=!1,aa=0,Ac.current=null,o===null||o.return===null){Qt=1,da=n,Vt=null;break}e:{var g=e,E=o.return,L=o,X=n;if(n=fn,L.flags|=32768,X!==null&&typeof X=="object"&&typeof X.then=="function"){var ye=X,Me=L,Ie=Me.tag;if((Me.mode&1)===0&&(Ie===0||Ie===11||Ie===15)){var Pe=Me.alternate;Pe?(Me.updateQueue=Pe.updateQueue,Me.memoizedState=Pe.memoizedState,Me.lanes=Pe.lanes):(Me.updateQueue=null,Me.memoizedState=null)}var Ke=rp(E);if(Ke!==null){Ke.flags&=-257,op(Ke,E,L,g,n),Ke.mode&1&&np(g,ye,n),n=Ke,X=ye;var Qe=n.updateQueue;if(Qe===null){var Ge=new Set;Ge.add(X),n.updateQueue=Ge}else Qe.add(X);break e}else{if((n&1)===0){np(g,ye,n),Vc();break e}X=Error(i(426))}}else if(It&&L.mode&1){var Bt=rp(E);if(Bt!==null){(Bt.flags&65536)===0&&(Bt.flags|=256),op(Bt,E,L,g,n),ec(ys(X,L));break e}}g=X=ys(X,L),Qt!==4&&(Qt=2),pa===null?pa=[g]:pa.push(g),g=E;do{switch(g.tag){case 3:g.flags|=65536,n&=-n,g.lanes|=n;var he=ep(g,X,n);Cd(g,he);break e;case 1:L=X;var re=g.type,me=g.stateNode;if((g.flags&128)===0&&(typeof re.getDerivedStateFromError=="function"||me!==null&&typeof me.componentDidCatch=="function"&&(ti===null||!ti.has(me)))){g.flags|=65536,n&=-n,g.lanes|=n;var ze=tp(g,L,n);Cd(g,ze);break e}}g=g.return}while(g!==null)}Op(o)}catch(Je){n=Je,Vt===o&&o!==null&&(Vt=o=o.return);continue}break}while(!0)}function Ip(){var e=Cl.current;return Cl.current=bl,e===null?bl:e}function Vc(){(Qt===0||Qt===3||Qt===2)&&(Qt=4),en===null||(ji&268435455)===0&&(jl&268435455)===0||oi(en,fn)}function Al(e,n){var o=vt;vt|=2;var u=Ip();(en!==e||fn!==n)&&(Co=null,Mi(e,n));do try{Wg();break}catch(p){Tp(e,p)}while(!0);if(nc(),vt=o,Cl.current=u,Vt!==null)throw Error(i(261));return en=null,fn=0,Qt}function Wg(){for(;Vt!==null;)Ap(Vt)}function Yg(){for(;Vt!==null&&!Et();)Ap(Vt)}function Ap(e){var n=Lp(e.alternate,e,Jn);e.memoizedProps=e.pendingProps,n===null?Op(e):Vt=n,Ac.current=null}function Op(e){var n=e;do{var o=n.alternate;if(e=n.return,(n.flags&32768)===0){if(o=Fg(o,n,Jn),o!==null){Vt=o;return}}else{if(o=Bg(o,n),o!==null){o.flags&=32767,Vt=o;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Qt=6,Vt=null;return}}if(n=n.sibling,n!==null){Vt=n;return}Vt=n=e}while(n!==null);Qt===0&&(Qt=5)}function $i(e,n,o){var u=xt,p=pr.transition;try{pr.transition=null,xt=1,Xg(e,n,o,u)}finally{pr.transition=p,xt=u}return null}function Xg(e,n,o,u){do bs();while(ni!==null);if((vt&6)!==0)throw Error(i(327));o=e.finishedWork;var p=e.finishedLanes;if(o===null)return null;if(e.finishedWork=null,e.finishedLanes=0,o===e.current)throw Error(i(177));e.callbackNode=null,e.callbackPriority=0;var g=o.lanes|o.childLanes;if(di(e,g),e===en&&(Vt=en=null,fn=0),(o.subtreeFlags&2064)===0&&(o.flags&2064)===0||Ml||(Ml=!0,zp(Fr,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,Vg(e,o),Np(o,e),ae(Vu),Ki=!!Hu,Vu=Hu=null,e.current=o,Ug(o),ir(),vt=L,xt=E,pr.transition=g}else e.current=o;if(Ml&&(Ml=!1,ni=e,$l=p),g=e.pendingLanes,g===0&&(ti=null),ct(o.stateNode),Bn(e,gt()),n!==null)for(u=e.onRecoverableError,o=0;o<n.length;o++)p=n[o],u(p.value,{componentStack:p.stack,digest:p.digest});if(Pl)throw Pl=!1,e=Dc,Dc=null,e;return($l&1)!==0&&e.tag!==0&&bs(),g=e.pendingLanes,(g&1)!==0?e===Lc?ha++:(ha=0,Lc=e):ha=0,Go(),null}function bs(){if(ni!==null){var e=Ba($l),n=pr.transition,o=xt;try{if(pr.transition=null,xt=16>e?16:e,ni===null)var u=!1;else{if(e=ni,ni=null,$l=0,(vt&6)!==0)throw Error(i(331));var p=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 Me=Xe;switch(Me.tag){case 0:case 11:case 15:fa(8,Me,g)}var Ie=Me.child;if(Ie!==null)Ie.return=Me,Xe=Ie;else for(;Xe!==null;){Me=Xe;var Pe=Me.sibling,Ke=Me.return;if(wp(Me),Me===ye){Xe=null;break}if(Pe!==null){Pe.return=Ke,Xe=Pe;break}Xe=Ke}}}var Qe=g.alternate;if(Qe!==null){var Ge=Qe.child;if(Ge!==null){Qe.child=null;do{var Bt=Ge.sibling;Ge.sibling=null,Ge=Bt}while(Ge!==null)}}Xe=g}}if((g.subtreeFlags&2064)!==0&&E!==null)E.return=g,Xe=E;else e:for(;Xe!==null;){if(g=Xe,(g.flags&2048)!==0)switch(g.tag){case 0:case 11:case 15:fa(9,g,g.return)}var he=g.sibling;if(he!==null){he.return=g.return,Xe=he;break e}Xe=g.return}}var re=e.current;for(Xe=re;Xe!==null;){E=Xe;var me=E.child;if((E.subtreeFlags&2064)!==0&&me!==null)me.return=E,Xe=me;else e:for(E=re;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=p,Go(),jn&&typeof jn.onPostCommitFiberRoot=="function")try{jn.onPostCommitFiberRoot(sr,e)}catch{}u=!0}return u}finally{xt=o,pr.transition=n}}return!1}function Rp(e,n,o){n=ys(o,n),n=ep(e,n,1),e=Zo(e,n,1),n=Mn(),e!==null&&(lr(e,1,n),Bn(e,n))}function Ft(e,n,o){if(e.tag===3)Rp(e,e,o);else for(;n!==null;){if(n.tag===3){Rp(n,e,o);break}else if(n.tag===1){var u=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof u.componentDidCatch=="function"&&(ti===null||!ti.has(u))){e=ys(o,e),e=tp(n,e,1),n=Zo(n,e,1),e=Mn(),n!==null&&(lr(n,1,e),Bn(n,e));break}}n=n.return}}function Qg(e,n,o){var u=e.pingCache;u!==null&&u.delete(n),n=Mn(),e.pingedLanes|=e.suspendedLanes&o,en===e&&(fn&o)===o&&(Qt===4||Qt===3&&(fn&130023424)===fn&&500>gt()-Rc?Mi(e,0):Oc|=o),Bn(e,n)}function Dp(e,n){n===0&&((e.mode&1)===0?n=1:(n=io,io<<=1,(io&130023424)===0&&(io=4194304)));var o=Mn();e=ko(e,n),e!==null&&(lr(e,n,o),Bn(e,o))}function Gg(e){var n=e.memoizedState,o=0;n!==null&&(o=n.retryLane),Dp(e,o)}function Jg(e,n){var o=0;switch(e.tag){case 13:var u=e.stateNode,p=e.memoizedState;p!==null&&(o=p.retryLane);break;case 19:u=e.stateNode;break;default:throw Error(i(314))}u!==null&&u.delete(n),Dp(e,o)}var Lp;Lp=function(e,n,o){if(e!==null)if(e.memoizedProps!==n.pendingProps||Dn.current)zn=!0;else{if((e.lanes&o)===0&&(n.flags&128)===0)return zn=!1,zg(e,n,o);zn=(e.flags&131072)!==0}else zn=!1,It&&(n.flags&1048576)!==0&&yd(n,ul,n.index);switch(n.lanes=0,n.tag){case 2:var u=n.type;kl(e,n),e=n.pendingProps;var p=us(n,yn.current);ms(n,o),p=pc(null,n,u,e,p,o);var g=hc();return n.flags|=1,typeof p=="object"&&p!==null&&typeof p.render=="function"&&p.$$typeof===void 0?(n.tag=1,n.memoizedState=null,n.updateQueue=null,Ln(u)?(g=!0,sl(n)):g=!1,n.memoizedState=p.state!==null&&p.state!==void 0?p.state:null,sc(n),p.updater=_l,n.stateNode=p,p._reactInternals=n,wc(n,u,e,o),n=kc(null,n,u,!0,g,o)):(n.tag=0,It&&g&&Qu(n),Pn(null,n,p,o),n=n.child),n;case 16:u=n.elementType;e:{switch(kl(e,n),e=n.pendingProps,p=u._init,u=p(u._payload),n.type=u,p=n.tag=ey(u),e=Er(u,e),p){case 0:n=Sc(null,n,u,e,o);break e;case 1:n=cp(null,n,u,e,o);break e;case 11:n=ip(null,n,u,e,o);break e;case 14:n=sp(null,n,u,Er(u.type,e),o);break e}throw Error(i(306,u,""))}return n;case 0:return u=n.type,p=n.pendingProps,p=n.elementType===u?p:Er(u,p),Sc(e,n,u,p,o);case 1:return u=n.type,p=n.pendingProps,p=n.elementType===u?p:Er(u,p),cp(e,n,u,p,o);case 3:e:{if(fp(n),e===null)throw Error(i(387));u=n.pendingProps,g=n.memoizedState,p=g.element,Ed(e,n),ml(n,u,null,o);var E=n.memoizedState;if(u=E.element,g.isDehydrated)if(g={element:u,isDehydrated:!1,cache:E.cache,pendingSuspenseBoundaries:E.pendingSuspenseBoundaries,transitions:E.transitions},n.updateQueue.baseState=g,n.memoizedState=g,n.flags&256){p=ys(Error(i(423)),n),n=dp(e,n,u,o,p);break e}else if(u!==p){p=ys(Error(i(424)),n),n=dp(e,n,u,o,p);break e}else for(Gn=Yo(n.stateNode.containerInfo.firstChild),Qn=n,It=!0,Nr=null,o=kd(n,null,u,o),n.child=o;o;)o.flags=o.flags&-3|4096,o=o.sibling;else{if(ds(),u===p){n=Eo(e,n,o);break e}Pn(e,n,u,o)}n=n.child}return n;case 5:return Pd(n),e===null&&Zu(n),u=n.type,p=n.pendingProps,g=e!==null?e.memoizedProps:null,E=p.children,Uu(u,p)?E=null:g!==null&&Uu(u,g)&&(n.flags|=32),up(e,n),Pn(e,n,E,o),n.child;case 6:return e===null&&Zu(n),null;case 13:return pp(e,n,o);case 4:return ac(n,n.stateNode.containerInfo),u=n.pendingProps,e===null?n.child=ps(n,null,u,o):Pn(e,n,u,o),n.child;case 11:return u=n.type,p=n.pendingProps,p=n.elementType===u?p:Er(u,p),ip(e,n,u,p,o);case 7:return Pn(e,n,n.pendingProps,o),n.child;case 8:return Pn(e,n,n.pendingProps.children,o),n.child;case 12:return Pn(e,n,n.pendingProps.children,o),n.child;case 10:e:{if(u=n.type._context,p=n.pendingProps,g=n.memoizedProps,E=p.value,kt(dl,u._currentValue),u._currentValue=E,g!==null)if(fe(g.value,E)){if(g.children===p.children&&!Dn.current){n=Eo(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=No(-1,o&-o),X.tag=2;var ye=g.updateQueue;if(ye!==null){ye=ye.shared;var Me=ye.pending;Me===null?X.next=X:(X.next=Me.next,Me.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}Pn(e,n,p.children,o),n=n.child}return n;case 9:return p=n.type,u=n.pendingProps.children,ms(n,o),p=fr(p),u=u(p),n.flags|=1,Pn(e,n,u,o),n.child;case 14:return u=n.type,p=Er(u,n.pendingProps),p=Er(u.type,p),sp(e,n,u,p,o);case 15:return ap(e,n,n.type,n.pendingProps,o);case 17:return u=n.type,p=n.pendingProps,p=n.elementType===u?p:Er(u,p),kl(e,n),n.tag=1,Ln(u)?(e=!0,sl(n)):e=!1,ms(n,o),Jd(n,u,p),wc(n,u,p,o),kc(null,n,u,!0,e,o);case 19:return mp(e,n,o);case 22:return lp(e,n,o)}throw Error(i(156,n.tag))};function zp(e,n){return ci(e,n)}function Zg(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 hr(e,n,o,u){return new Zg(e,n,o,u)}function Uc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ey(e){if(typeof e=="function")return Uc(e)?1:0;if(e!=null){if(e=e.$$typeof,e===le)return 11;if(e===ce)return 14}return 2}function ii(e,n){var o=e.alternate;return o===null?(o=hr(e.tag,n,e.key,e.mode),o.elementType=e.elementType,o.type=e.type,o.stateNode=e.stateNode,o.alternate=e,e.alternate=o):(o.pendingProps=n,o.type=e.type,o.flags=0,o.subtreeFlags=0,o.deletions=null),o.flags=e.flags&14680064,o.childLanes=e.childLanes,o.lanes=e.lanes,o.child=e.child,o.memoizedProps=e.memoizedProps,o.memoizedState=e.memoizedState,o.updateQueue=e.updateQueue,n=e.dependencies,o.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},o.sibling=e.sibling,o.index=e.index,o.ref=e.ref,o}function Ol(e,n,o,u,p,g){var E=2;if(u=e,typeof e=="function")Uc(e)&&(E=1);else if(typeof e=="string")E=5;else e:switch(e){case Q:return Ti(o.children,p,g,n);case G:E=8,p|=8;break;case pe:return e=hr(12,o,n,p|2),e.elementType=pe,e.lanes=g,e;case ve:return e=hr(13,o,n,p),e.elementType=ve,e.lanes=g,e;case D:return e=hr(19,o,n,p),e.elementType=D,e.lanes=g,e;case se:return Rl(o,p,g,n);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case we:E=10;break e;case U:E=9;break e;case le:E=11;break e;case ce:E=14;break e;case J:E=16,u=null;break e}throw Error(i(130,e==null?e:typeof e,""))}return n=hr(E,o,n,p),n.elementType=e,n.type=u,n.lanes=g,n}function Ti(e,n,o,u){return e=hr(7,e,u,n),e.lanes=o,e}function Rl(e,n,o,u){return e=hr(22,e,u,n),e.elementType=se,e.lanes=o,e.stateNode={isHidden:!1},e}function Kc(e,n,o){return e=hr(6,e,null,n),e.lanes=o,e}function qc(e,n,o){return n=hr(4,e.children!==null?e.children:[],e.key,n),n.lanes=o,n.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},n}function ty(e,n,o,u,p){this.tag=n,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=ao(0),this.expirationTimes=ao(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ao(0),this.identifierPrefix=u,this.onRecoverableError=p,this.mutableSourceEagerHydrationData=null}function Wc(e,n,o,u,p,g,E,L,X){return e=new ty(e,n,o,L,X),n===1?(n=1,g===!0&&(n|=8)):n=0,g=hr(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 ny(e,n,o){var u=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:H,key:u==null?null:""+u,children:e,containerInfo:n,implementation:o}}function Fp(e){if(!e)return Qo;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(Ln(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(Ln(o))return hd(e,o,n)}return n}function Bp(e,n,o,u,p,g,E,L,X){return e=Wc(o,u,!0,e,p,g,E,L,X),e.context=Fp(null),o=e.current,u=Mn(),p=ri(o),g=No(u,p),g.callback=n??null,Zo(o,g,p),e.current.lanes=p,lr(e,p,u),Bn(e,u),e}function Dl(e,n,o,u){var p=n.current,g=Mn(),E=ri(p);return o=Fp(o),n.context===null?n.context=o:n.pendingContext=o,n=No(g,E),n.payload={element:e},u=u===void 0?null:u,u!==null&&(n.callback=u),e=Zo(p,n,E),e!==null&&(Pr(e,p,E,g),hl(e,p,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 Hp(e,n){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var o=e.retryLane;e.retryLane=o!==0&&o<n?o:n}}function Yc(e,n){Hp(e,n),(e=e.alternate)&&Hp(e,n)}function ry(){return null}var Vp=typeof reportError=="function"?reportError:function(e){console.error(e)};function Xc(e){this._internalRoot=e}zl.prototype.render=Xc.prototype.render=function(e){var n=this._internalRoot;if(n===null)throw Error(i(409));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[wo]=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<On.length&&n!==0&&n<On[o].priority;o++);On.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 Up(){}function oy(e,n,o,u,p){if(p){if(typeof u=="function"){var g=u;u=function(){var ye=Ll(E);g.call(ye)}}var E=Bp(n,u,e,0,null,!1,!1,"",Up);return e._reactRootContainer=E,e[wo]=E.current,Js(e.nodeType===8?e.parentNode:e),Pi(),E}for(;p=e.lastChild;)e.removeChild(p);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,"",Up);return e._reactRootContainer=X,e[wo]=X.current,Js(e.nodeType===8?e.parentNode:e),Pi(function(){Dl(n,X,o,u)}),X}function Bl(e,n,o,u,p){var g=o._reactRootContainer;if(g){var E=g;if(typeof p=="function"){var L=p;p=function(){var X=Ll(E);L.call(X)}}Dl(n,E,e,p)}else E=oy(o,n,e,p,u);return Ll(E)}ht=function(e){switch(e.tag){case 3:var n=e.stateNode;if(n.current.memoizedState.isDehydrated){var o=Yn(n.pendingLanes);o!==0&&(Do(n,o|1),Bn(n,gt()),(vt&6)===0&&(ws=gt()+500,Go()))}break;case 13:Pi(function(){var u=ko(e,1);if(u!==null){var p=Mn();Pr(u,e,1,p)}}),Yc(e,1)}},Vi=function(e){if(e.tag===13){var n=ko(e,134217728);if(n!==null){var o=Mn();Pr(n,e,134217728,o)}Yc(e,134217728)}},Ha=function(e){if(e.tag===13){var n=ri(e),o=ko(e,n);if(o!==null){var u=Mn();Pr(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}},He=function(e,n,o){switch(n){case"input":if($t(e,o),n=o.name,o.type==="radio"&&n!=null){for(o=e;o.parentNode;)o=o.parentNode;for(o=o.querySelectorAll("input[name="+JSON.stringify(""+n)+'][type="radio"]'),n=0;n<o.length;n++){var u=o[n];if(u!==e&&u.form===e.form){var p=ol(u);if(!p)throw Error(i(90));Re(u),$t(u,p)}}}break;case"textarea":mr(e,o);break;case"select":n=o.value,n!=null&&_t(e,!!o.multiple,n,!1)}},to=Bc,Io=Pi;var iy={usingClientEntryPoint:!1,Events:[ta,as,ol,Rr,Dr,Bc]},ma={findFiberByHostInstance:bi,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},sy={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=no(e),e===null?null:e.stateNode},findFiberByHostInstance:ma.findFiberByHostInstance||ry,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{sr=Hl.inject(sy),jn=Hl}catch{}}return Hn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=iy,Hn.createPortal=function(e,n){var o=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Qc(n))throw Error(i(200));return ny(e,n,null,o)},Hn.createRoot=function(e,n){if(!Qc(e))throw Error(i(299));var o=!1,u="",p=Vp;return n!=null&&(n.unstable_strictMode===!0&&(o=!0),n.identifierPrefix!==void 0&&(u=n.identifierPrefix),n.onRecoverableError!==void 0&&(p=n.onRecoverableError)),n=Wc(e,1,!1,null,null,o,!1,u,p),e[wo]=n.current,Js(e.nodeType===8?e.parentNode:e),new Xc(n)},Hn.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=no(n),e=e===null?null:e.stateNode,e},Hn.flushSync=function(e){return Pi(e)},Hn.hydrate=function(e,n,o){if(!Fl(n))throw Error(i(200));return Bl(null,e,n,!0,o)},Hn.hydrateRoot=function(e,n,o){if(!Qc(e))throw Error(i(405));var u=o!=null&&o.hydratedSources||null,p=!1,g="",E=Vp;if(o!=null&&(o.unstable_strictMode===!0&&(p=!0),o.identifierPrefix!==void 0&&(g=o.identifierPrefix),o.onRecoverableError!==void 0&&(E=o.onRecoverableError)),n=Bp(n,null,e,1,o??null,p,!1,g,E),e[wo]=n.current,Js(e),u)for(e=0;e<u.length;e++)o=u[e],p=o._getVersion,p=p(o._source),n.mutableSourceEagerHydrationData==null?n.mutableSourceEagerHydrationData=[o,p]:n.mutableSourceEagerHydrationData.push(o,p);return new zl(n)},Hn.render=function(e,n,o){if(!Fl(n))throw Error(i(200));return Bl(null,e,n,!1,o)},Hn.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[wo]=null})}),!0):!1},Hn.unstable_batchedUpdates=Bc,Hn.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)},Hn.version="18.3.1-next-f1338f8080-20240426",Hn}var Jp;function ym(){if(Jp)return Zc.exports;Jp=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(r){console.error(r)}}return t(),Zc.exports=gy(),Zc.exports}var Zp;function yy(){if(Zp)return Vl;Zp=1;var t=ym();return Vl.createRoot=t.createRoot,Vl.hydrateRoot=t.hydrateRoot,Vl}var vy=yy();const xy=wu(vy),wy=["get","post","put","patch","delete","options","head","trace"];function eh(t){return t.replace(/[^a-zA-Z0-9]+/g,"_").replace(/^_|_$/g,"").replace(/_+/g,"_")}function bu(t,r,i,s){if(i)return eh(i).replace(/^[0-9]/,"_$&")||`op_${s}`;const l=eh(r.replace(/[{}]/g,""));return`${t}_${l}`||`op_${s}`}function _u(t){var s;return`${(((s=t.info)==null?void 0:s.title)??"Api").replace(/[^a-zA-Z0-9]+/g," ").trim().split(/\s+/).filter(Boolean).map(l=>l.charAt(0).toUpperCase()+l.slice(1).toLowerCase()).join("")||"Api"}Client`}function Su(t){return(t.split(/[^a-zA-Z0-9]+/).filter(Boolean).map(i=>i.charAt(0).toUpperCase()+i.slice(1).toLowerCase()).join("")||"Api")+"Service"}function Zr(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 wy){const d=l[c];d&&typeof d=="object"&&r.push({method:c,path:i,operationId:d.operationId,tags:d.tags})}}return r}function by(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 _y(t){return vm(Zr(t),_u(t))}function Sy(t,r){const i=Su(r),s=Zr(t).filter(l=>{var c;return(c=l.tags)==null?void 0:c.includes(r)});return vm(s,i)}function ky(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 Ny(t){return xm(Zr(t),_u(t))}function Ey(t,r){const i=Su(r),s=Zr(t).filter(l=>{var c;return(c=l.tags)==null?void 0:c.includes(r)});return xm(s,i)}function Cy(t,r,i){var d,h;const s=((h=(d=t.servers)==null?void 0:d[0])==null?void 0:h.url)??"http://localhost:3000",l=r.toLowerCase();return`import httpx
127
+
128
+ base_url = "${s}"
129
+ url = f"{base_url}${i}"
130
+ headers = {"Authorization": f"Bearer {token}"}
131
+ with httpx.Client() as client:
132
+ response = client.${l}(url, headers=headers${l==="get"||l==="head"?"":", json={}"})
133
+ data = response.json()
134
+ `}function wm(t,r){const i=t.map((s,l)=>{const c=bu(s.method,s.path,s.operationId,l),d=s.method.toLowerCase(),h=d==="get"||d==="head"?"":", json={}";return` def ${c}(self, headers: dict | None = None) -> dict:
135
+ h = {**self.default_headers, **(headers or {})}
136
+ r = self._client.${d}(f"{self.base_url}${s.path}", headers=h${h})
137
+ return r.json()`});return`from __future__ import annotations
138
+ import httpx
139
+
140
+ class ${r}:
141
+ def __init__(self, base_url: str, default_headers: dict | None = None) -> None:
142
+ self.base_url = base_url.rstrip("/")
143
+ self.default_headers = default_headers or {}
144
+ self._client = httpx.Client()
145
+
146
+ def close(self) -> None:
147
+ self._client.close()
148
+
149
+ ${i.join(`
150
+
151
+ `)}
152
+ `}function jy(t){return wm(Zr(t),_u(t))}function Py(t,r){const i=Su(r),s=Zr(t).filter(l=>{var c;return(c=l.tags)==null?void 0:c.includes(r)});return wm(s,i)}function My(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 My(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 $y(t,r,i,s="baseUrl"){var b,k,x,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=(x=c==null?void 0:c.content)==null?void 0:x["application/json"])!=null&&S.schema){const M=c.content["application/json"].schema;M&&!("$ref"in M)&&(d=M)}const h=d?xf(d):"Record<string, unknown>",y=r.toUpperCase();return`const ${s} = "${((j=(C=t.servers)==null?void 0:C[0])==null?void 0:j.url)??"http://localhost:3000"}";
156
+ const res = await fetch(\`${s}${i}\`, {
157
+ method: "${y}",
158
+ headers: { "Content-Type": "application/json", Authorization: \`Bearer \${token}\` },
159
+ ${y==="GET"||y==="HEAD"?"":`body: JSON.stringify({} as ${h}),`}
160
+ });
161
+ const data = await res.json() as unknown;
162
+ `}function bm(t,r){const i=t.map((s,l)=>` async ${bu(s.method,s.path,s.operationId,l)}(options?: { headers?: Record<string, string> }): Promise<unknown> {
163
+ const res = await fetch(\`\${this.baseUrl}${s.path}\`, {
164
+ method: "${s.method.toUpperCase()}",
165
+ headers: { ...this.defaultHeaders, ...options?.headers },
166
+ });
167
+ return res.json();
168
+ }`);return`export class ${r} {
169
+ constructor(
170
+ private baseUrl: string,
171
+ private defaultHeaders: Record<string, string> = {},
172
+ ) {}
173
+
174
+ ${i.join(`
175
+
176
+ `)}
177
+ }
178
+ `}function Ty(t){const r=Zr(t),i=_u(t);return bm(r,i)}function Iy(t,r){const i=Su(r),s=Zr(t).filter(l=>{var c;return(c=l.tags)==null?void 0:c.includes(r)});return bm(s,i)}function Ay(t,r,i,s){switch(r){case"typescript":return $y(t,i,s);case"javascript":return by(t,i,s);case"python":return Cy(t,i,s);case"php":return ky(t,i,s);default:{const l=r;throw new Error(`Unsupported language: ${l}`)}}}function Oy(t,r,i){switch(r){case"typescript":return Iy(t,i);case"javascript":return Sy(t,i);case"python":return Py(t,i);case"php":return Ey(t,i);default:{const s=r;throw new Error(`Unsupported language: ${s}`)}}}function Ry(t,r,i){if(i===null)switch(r){case"typescript":return Ty(t);case"javascript":return _y(t);case"python":return jy(t);case"php":return Ny(t);default:{const s=r;throw new Error(`Unsupported language: ${s}`)}}return Oy(t,r,i)}function Dy(t){const r=new Set;for(const i of Zr(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 Ly(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:{}},zy=eu.exports,th;function Fy(){return th||(th=1,(function(t,r){((i,s)=>{t.exports=s()})(zy,function(){var i=function(a,f){return(i=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(m,v){m.__proto__=v}:function(m,v){for(var _ in v)Object.prototype.hasOwnProperty.call(v,_)&&(m[_]=v[_])}))(a,f)},s=function(){return(s=Object.assign||function(a){for(var f,m=1,v=arguments.length;m<v;m++)for(var _ in f=arguments[m])Object.prototype.hasOwnProperty.call(f,_)&&(a[_]=f[_]);return a}).apply(this,arguments)};function l(a,f,m){for(var v,_=0,N=f.length;_<N;_++)!v&&_ in f||((v=v||Array.prototype.slice.call(f,0,_))[_]=f[_]);return a.concat(v||Array.prototype.slice.call(f))}var c=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:cy,d=Object.keys,h=Array.isArray;function y(a,f){return typeof f=="object"&&d(f).forEach(function(m){a[m]=f[m]}),a}typeof Promise>"u"||c.Promise||(c.Promise=Promise);var b=Object.getPrototypeOf,k={}.hasOwnProperty;function x(a,f){return k.call(a,f)}function S(a,f){typeof f=="function"&&(f=f(b(a))),(typeof Reflect>"u"?d:Reflect.ownKeys)(f).forEach(function(m){j(a,m,f[m])})}var C=Object.defineProperty;function j(a,f,m,v){C(a,f,y(m&&x(m,"get")&&typeof m.get=="function"?{get:m.get,set:m.set,configurable:!0}:{value:m,configurable:!0,writable:!0},v))}function M(a){return{from:function(f){return a.prototype=Object.create(f.prototype),j(a.prototype,"constructor",a),{extend:S.bind(null,a.prototype)}}}}var T=Object.getOwnPropertyDescriptor,I=[].slice;function B(a,f,m){return I.call(a,f,m)}function P(a,f){return f(a)}function R(a){if(!a)throw new Error("Assertion Failed")}function W(a){c.setImmediate?setImmediate(a):setTimeout(a,0)}function H(a,f){if(typeof f=="string"&&x(a,f))return a[f];if(!f)return a;if(typeof f!="string"){for(var m=[],v=0,_=f.length;v<_;++v){var N=H(a,f[v]);m.push(N)}return m}var $,O=f.indexOf(".");return O===-1||($=a[f.substr(0,O)])==null?void 0:H($,f.substr(O+1))}function Q(a,f,m){if(a&&f!==void 0&&!("isFrozen"in Object&&Object.isFrozen(a)))if(typeof f!="string"&&"length"in f){R(typeof m!="string"&&"length"in m);for(var v=0,_=f.length;v<_;++v)Q(a,f[v],m[v])}else{var N,$,O=f.indexOf(".");O!==-1?(N=f.substr(0,O),(O=f.substr(O+1))===""?m===void 0?h(a)&&!isNaN(parseInt(N))?a.splice(N,1):delete a[N]:a[N]=m:Q($=($=a[N])&&x(a,N)?$:a[N]={},O,m)):m===void 0?h(a)&&!isNaN(parseInt(f))?a.splice(f,1):delete a[f]:a[f]=m}}function G(a){var f,m={};for(f in a)x(a,f)&&(m[f]=a[f]);return m}var pe=[].concat;function we(a){return pe.apply([],a)}var V="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]}),U=new Set(V.map(function(a){return c[a]})),le=null;function ve(a){return le=new WeakMap,a=(function f(m){if(!m||typeof m!="object")return m;var v=le.get(m);if(v)return v;if(h(m)){v=[],le.set(m,v);for(var _=0,N=m.length;_<N;++_)v.push(f(m[_]))}else if(U.has(m.constructor))v=m;else{var $,O=b(m);for($ in v=O===Object.prototype?{}:Object.create(O),le.set(m,v),m)x(m,$)&&(v[$]=f(m[$]))}return v})(a),le=null,a}var D={}.toString;function ce(a){return D.call(a).slice(8,-1)}var J=typeof Symbol<"u"?Symbol.iterator:"@@iterator",se=typeof J=="symbol"?function(a){var f;return a!=null&&(f=a[J])&&f.apply(a)}:function(){return null};function z(a,f){f=a.indexOf(f),0<=f&&a.splice(f,1)}var K={};function F(a){var f,m,v,_;if(arguments.length===1){if(h(a))return a.slice();if(this===K&&typeof a=="string")return[a];if(_=se(a))for(m=[];!(v=_.next()).done;)m.push(v.value);else{if(a==null)return[a];if(typeof(f=a.length)!="number")return[a];for(m=new Array(f);f--;)m[f]=a[f]}}else for(f=arguments.length,m=new Array(f);f--;)m[f]=arguments[f];return m}var A=typeof Symbol<"u"?function(a){return a[Symbol.toStringTag]==="AsyncFunction"}:function(){return!1},V=["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(V),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 $e(a,f){return a+". Errors: "+Object.keys(f).map(function(m){return f[m].toString()}).filter(function(m,v,_){return _.indexOf(m)===v}).join(`
179
+ `)}function Ae(a,f,m,v){this.failures=f,this.failedKeys=v,this.successCount=m,this.message=$e(a,f)}function Oe(a,f){this.name="BulkError",this.failures=Object.keys(f).map(function(m){return f[m]}),this.failuresByPos=f,this.message=$e(a,this.failures)}M(Se).from(Error).extend({toString:function(){return this.name+": "+this.message}}),M(Ae).from(Se),M(Oe).from(Se);var _e=Nt.reduce(function(a,f){return a[f]=f+"Error",a},{}),Fe=Se,ke=Nt.reduce(function(a,f){var m=f+"Error";function v(_,N){this.name=m,_?typeof _=="string"?(this.message="".concat(_).concat(N?`
180
+ `+N:""),this.inner=N||null):typeof _=="object"&&(this.message="".concat(_.name," ").concat(_.message),this.inner=_):(this.message=be[f]||m,this.inner=null)}return M(v).from(Fe),a[f]=v,a},{}),Be=(ke.Syntax=SyntaxError,ke.Type=TypeError,ke.Range=RangeError,V.reduce(function(a,f){return a[f+"Error"]=ke[f],a},{}));V=Nt.reduce(function(a,f){return["Syntax","Type","Range"].indexOf(f)===-1&&(a[f+"Error"]=ke[f]),a},{});function Re(){}function qe(a){return a}function lt(a,f){return a==null||a===qe?f:function(m){return f(a(m))}}function ut(a,f){return function(){a.apply(this,arguments),f.apply(this,arguments)}}function ot(a,f){return a===Re?f:function(){var m=a.apply(this,arguments),v=(m!==void 0&&(arguments[0]=m),this.onsuccess),_=this.onerror,N=(this.onsuccess=null,this.onerror=null,f.apply(this,arguments));return v&&(this.onsuccess=this.onsuccess?ut(v,this.onsuccess):v),_&&(this.onerror=this.onerror?ut(_,this.onerror):_),N!==void 0?N:m}}function $t(a,f){return a===Re?f:function(){a.apply(this,arguments);var m=this.onsuccess,v=this.onerror;this.onsuccess=this.onerror=null,f.apply(this,arguments),m&&(this.onsuccess=this.onsuccess?ut(m,this.onsuccess):m),v&&(this.onerror=this.onerror?ut(v,this.onerror):v)}}function St(a,f){return a===Re?f:function(_){var v=a.apply(this,arguments),_=(y(_,v),this.onsuccess),N=this.onerror,$=(this.onsuccess=null,this.onerror=null,f.apply(this,arguments));return _&&(this.onsuccess=this.onsuccess?ut(_,this.onsuccess):_),N&&(this.onerror=this.onerror?ut(N,this.onerror):N),v===void 0?$===void 0?void 0:$:y(v,$)}}function nn(a,f){return a===Re?f:function(){return f.apply(this,arguments)!==!1&&a.apply(this,arguments)}}function Lt(a,f){return a===Re?f:function(){var m=a.apply(this,arguments);if(m&&typeof m.then=="function"){for(var v=this,_=arguments.length,N=new Array(_);_--;)N[_]=arguments[_];return m.then(function(){return f.apply(v,N)})}return f.apply(this,arguments)}}V.ModifyError=Ae,V.DexieError=Se,V.BulkError=Oe;var _t=typeof location<"u"&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function dn(a){_t=a}var rn={},mr=100,bn=typeof Promise>"u"?[]:(Nt=Promise.resolve(),typeof crypto<"u"&&crypto.subtle?[bn=crypto.subtle.digest("SHA-512",new Uint8Array([0])),b(bn),Nt]:[Nt,b(Nt),Nt]),Nt=bn[0],mo=bn[1],mo=mo&&mo.then,Kt=Nt&&Nt.constructor,$n=!!bn[2],tr=function(a,f){Kn.push([a,f]),Tn&&(queueMicrotask(Io),Tn=!1)},_n=!0,Tn=!0,Un=[],gr=[],Sn=qe,on={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:Re,pgp:!1,env:{},finalize:Re},Ye=on,Kn=[],kn=0,nr=[];function He(a){if(typeof this!="object")throw new TypeError("Promises must be constructed via new");this._listeners=[],this._lib=!1;var f=this._PSD=Ye;if(typeof a!="function"){if(a!==rn)throw new TypeError("Not a function");this._state=arguments[1],this._value=arguments[2],this._state===!1&&Or(this,this._value)}else this._state=null,this._value=null,++f.ref,(function m(v,_){try{_(function(N){if(v._state===null){if(N===v)throw new TypeError("A promise cannot be resolved with itself.");var $=v._lib&&Nn();N&&typeof N.then=="function"?m(v,function(O,ee){N instanceof He?N._then(O,ee):N.then(O,ee)}):(v._state=!0,v._value=N,Rr(v)),$&&En()}},Or.bind(null,v))}catch(N){Or(v,N)}})(this,a)}var In={get:function(){var a=Ye,f=Yt;function m(v,_){var N=this,$=!a.global&&(a!==Ye||f!==Yt),O=$&&!zt(),ee=new He(function(fe,ne){Dr(N,new qn(ci(v,a,$,O),ci(_,a,$,O),fe,ne,a))});return this._consoleTask&&(ee._consoleTask=this._consoleTask),ee}return m.prototype=rn,m},set:function(a){j(this,"then",a&&a.prototype===rn?In:{get:function(){return a},set:In.set})}};function qn(a,f,m,v,_){this.onFulfilled=typeof a=="function"?a:null,this.onRejected=typeof f=="function"?f:null,this.resolve=m,this.reject=v,this.psd=_}function Or(a,f){var m,v;gr.push(f),a._state===null&&(m=a._lib&&Nn(),f=Sn(f),a._state=!1,a._value=f,v=a,Un.some(function(_){return _._value===v._value})||Un.push(v),Rr(a),m)&&En()}function Rr(a){var f=a._listeners;a._listeners=[];for(var m=0,v=f.length;m<v;++m)Dr(a,f[m]);var _=a._PSD;--_.ref||_.finalize(),kn===0&&(++kn,tr(function(){--kn==0&&An()},[]))}function Dr(a,f){if(a._state===null)a._listeners.push(f);else{var m=a._state?f.onFulfilled:f.onRejected;if(m===null)return(a._state?f.resolve:f.reject)(a._value);++f.psd.ref,++kn,tr(to,[m,a,f])}}function to(a,f,m){try{var v,_=f._value;!f._state&&gr.length&&(gr=[]),v=_t&&f._consoleTask?f._consoleTask.run(function(){return a(_)}):a(_),f._state||gr.indexOf(_)!==-1||(N=>{for(var $=Un.length;$;)if(Un[--$]._value===N._value)return Un.splice($,1)})(f),m.resolve(v)}catch(N){m.reject(N)}finally{--kn==0&&An(),--m.psd.ref||m.psd.finalize()}}function Io(){or(on,function(){Nn()&&En()})}function Nn(){var a=_n;return Tn=_n=!1,a}function En(){var a,f,m;do for(;0<Kn.length;)for(a=Kn,Kn=[],m=a.length,f=0;f<m;++f){var v=a[f];v[0].apply(null,v[1])}while(0<Kn.length);Tn=_n=!0}function An(){for(var a=Un,f=(Un=[],a.forEach(function(v){v._PSD.onunhandled.call(null,v._value,v)}),nr.slice(0)),m=f.length;m;)f[--m]()}function q(a){return new He(rn,!1,a)}function Ne(a,f){var m=Ye;return function(){var v=Nn(),_=Ye;try{return sn(m,!0),a.apply(this,arguments)}catch(N){f&&f(N)}finally{sn(_,!1),v&&En()}}}S(He.prototype,{then:In,_then:function(a,f){Dr(this,new qn(null,null,a,f,Ye))},catch:function(a){var f,m;return arguments.length===1?this.then(null,a):(f=a,m=arguments[1],typeof f=="function"?this.then(null,function(v){return(v instanceof f?m:q)(v)}):this.then(null,function(v){return(v&&v.name===f?m:q)(v)}))},finally:function(a){return this.then(function(f){return He.resolve(a()).then(function(){return f})},function(f){return He.resolve(a()).then(function(){return q(f)})})},timeout:function(a,f){var m=this;return a<1/0?new He(function(v,_){var N=setTimeout(function(){return _(new ke.Timeout(f))},a);m.then(v,_).finally(clearTimeout.bind(null,N))}):this}}),typeof Symbol<"u"&&Symbol.toStringTag&&j(He.prototype,Symbol.toStringTag,"Dexie.Promise"),on.env=no(),S(He,{all:function(){var a=F.apply(null,arguments).map(Wn);return new He(function(f,m){a.length===0&&f([]);var v=a.length;a.forEach(function(_,N){return He.resolve(_).then(function($){a[N]=$,--v||f(a)},m)})})},resolve:function(a){return a instanceof He?a:a&&typeof a.then=="function"?new He(function(f,m){a.then(f,m)}):new He(rn,!0,a)},reject:q,race:function(){var a=F.apply(null,arguments).map(Wn);return new He(function(f,m){a.map(function(v){return He.resolve(v).then(f,m)})})},PSD:{get:function(){return Ye},set:function(a){return Ye=a}},totalEchoes:{get:function(){return Yt}},newPSD:pn,usePSD:or,scheduler:{get:function(){return tr},set:function(a){tr=a}},rejectionMapper:{get:function(){return Sn},set:function(a){Sn=a}},follow:function(a,f){return new He(function(m,v){return pn(function(_,N){var $=Ye;$.unhandleds=[],$.onunhandled=N,$.finalize=ut(function(){var O,ee=this;O=function(){ee.unhandleds.length===0?_():N(ee.unhandleds[0])},nr.push(function fe(){O(),nr.splice(nr.indexOf(fe),1)}),++kn,tr(function(){--kn==0&&An()},[])},$.finalize),a()},f,m,v)})}}),Kt&&(Kt.allSettled&&j(He,"allSettled",function(){var a=F.apply(null,arguments).map(Wn);return new He(function(f){a.length===0&&f([]);var m=a.length,v=new Array(m);a.forEach(function(_,N){return He.resolve(_).then(function($){return v[N]={status:"fulfilled",value:$}},function($){return v[N]={status:"rejected",reason:$}}).then(function(){return--m||f(v)})})})}),Kt.any&&typeof AggregateError<"u"&&j(He,"any",function(){var a=F.apply(null,arguments).map(Wn);return new He(function(f,m){a.length===0&&m(new AggregateError([]));var v=a.length,_=new Array(v);a.forEach(function(N,$){return He.resolve(N).then(function(O){return f(O)},function(O){_[$]=O,--v||m(new AggregateError(_))})})})}),Kt.withResolvers)&&(He.withResolvers=Kt.withResolvers);var Ve={awaits:0,echoes:0,id:0},pt=0,qt=[],Wt=0,Yt=0,rr=0;function pn(a,$,m,v){var _=Ye,N=Object.create(_),$=(N.parent=_,N.ref=0,N.global=!1,N.id=++rr,on.env,N.env=$n?{Promise:He,PromiseProp:{value:He,configurable:!0,writable:!0},all:He.all,race:He.race,allSettled:He.allSettled,any:He.any,resolve:He.resolve,reject:He.reject}:{},$&&y(N,$),++_.ref,N.finalize=function(){--this.parent.ref||this.parent.finalize()},or(N,a,m,v));return N.ref===0&&N.finalize(),$}function Cn(){return Ve.id||(Ve.id=++pt),++Ve.awaits,Ve.echoes+=mr,Ve.id}function zt(){return!!Ve.awaits&&(--Ve.awaits==0&&(Ve.id=0),Ve.echoes=Ve.awaits*mr,!0)}function Wn(a){return Ve.echoes&&a&&a.constructor===Kt?(Cn(),a.then(function(f){return zt(),f},function(f){return zt(),Et(f)})):a}function Lr(){var a=qt[qt.length-1];qt.pop(),sn(a,!1)}function sn(a,f){var m,v,_=Ye;(f?!Ve.echoes||Wt++&&a===Ye:!Wt||--Wt&&a===Ye)||queueMicrotask(f?(function(N){++Yt,Ve.echoes&&--Ve.echoes!=0||(Ve.echoes=Ve.awaits=Ve.id=0),qt.push(Ye),sn(N,!0)}).bind(null,a):Lr),a!==Ye&&(Ye=a,_===on&&(on.env=no()),$n)&&(m=on.env.Promise,v=a.env,_.global||a.global)&&(Object.defineProperty(c,"Promise",v.PromiseProp),m.all=v.all,m.race=v.race,m.resolve=v.resolve,m.reject=v.reject,v.allSettled&&(m.allSettled=v.allSettled),v.any)&&(m.any=v.any)}function no(){var a=c.Promise;return $n?{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 or(a,f,m,v,_){var N=Ye;try{return sn(a,!0),f(m,v,_)}finally{sn(N,!1)}}function ci(a,f,m,v){return typeof a!="function"?a:function(){var _=Ye;m&&Cn(),sn(f,!0);try{return a.apply(this,arguments)}finally{sn(_,!1),v&&queueMicrotask(zt)}}}function Ao(a){Promise===Kt&&Ve.echoes===0?Wt===0?a():enqueueNativeMicroTask(a):setTimeout(a,0)}(""+mo).indexOf("[native code]")===-1&&(Cn=zt=Re);var Et=He.reject,ir="￿",gt="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",Bi="String expected.",zr="__dbnames",Oo="readonly",Fr="readwrite";function yr(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 sr(a){return typeof a!="string"||/\./.test(a)?function(f){return f}:function(f){return f[a]===void 0&&a in f&&delete(f=ve(f))[a],f}}function jn(){throw ke.Type("Entity instances must never be new:ed. Instances are generated by the framework bypassing the constructor.")}function ct(a,f){try{var m=hn(a),v=hn(f);if(m!==v)return m==="Array"?1:v==="Array"?-1:m==="binary"?1:v==="binary"?-1:m==="string"?1:v==="string"?-1:m==="Date"?1:v!=="Date"?NaN:-1;switch(m){case"number":case"Date":case"string":return f<a?1:a<f?-1:0;case"binary":for(var _=Hi(a),N=Hi(f),$=_.length,O=N.length,ee=$<O?$:O,fe=0;fe<ee;++fe)if(_[fe]!==N[fe])return _[fe]<N[fe]?-1:1;return $===O?0:$<O?-1:1;case"Array":for(var ne=a,Z=f,te=ne.length,ue=Z.length,ie=te<ue?te:ue,oe=0;oe<ie;++oe){var ae=ct(ne[oe],Z[oe]);if(ae!==0)return ae}return te===ue?0:te<ue?-1:1}}catch{}return NaN}function hn(a){var f=typeof a;return f=="object"&&(ArrayBuffer.isView(a)||(f=ce(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 Ro(a,f,m){var v=a.schema.yProps;return v?(f&&0<m.numFailures&&(f=f.filter(function(_,N){return!m.failures[N]})),Promise.all(v.map(function(_){return _=_.updatesTable,f?a.db.table(_).where("k").anyOf(f).delete():a.db.table(_).clear()})).then(function(){return m})):m}oo.prototype.execute=function(a){var f=this["@@propmod"];if(f.add!==void 0){var m=f.add;if(h(m))return l(l([],h(a)?a:[],!0),m).sort();if(typeof m=="number")return(Number(a)||0)+m;if(typeof m=="bigint")try{return BigInt(a)+m}catch{return BigInt(0)+m}throw new TypeError("Invalid term ".concat(m))}if(f.remove!==void 0){var v=f.remove;if(h(v))return h(a)?a.filter(function(_){return!v.includes(_)}).sort():[];if(typeof v=="number")return Number(a)-v;if(typeof v=="bigint")try{return BigInt(a)-v}catch{return BigInt(0)-v}throw new TypeError("Invalid subtrahend ".concat(v))}return m=(m=f.replacePrefix)==null?void 0:m[0],m&&typeof a=="string"&&a.startsWith(m)?f.replacePrefix[1]+a.substring(m.length):a};var ro=oo;function oo(a){this["@@propmod"]=a}function io(a,f){for(var m=d(f),v=m.length,_=!1,N=0;N<v;++N){var $=m[N],O=f[$],ee=H(a,$);O instanceof ro?(Q(a,$,O.execute(ee)),_=!0):ee!==O&&(Q(a,$,O),_=!0)}return _}yt.prototype._trans=function(a,f,m){var v=this._tx||Ye.trans,_=this.name,N=_t&&typeof console<"u"&&console.createTask&&console.createTask("Dexie: ".concat(a==="readonly"?"read":"write"," ").concat(this.name));function $(fe,ne,Z){if(Z.schema[_])return f(Z.idbtrans,Z);throw new ke.NotFound("Table "+_+" not part of transaction")}var O=Nn();try{var ee=v&&v.db._novip===this.db._novip?v===Ye.trans?v._promise(a,$,m):pn(function(){return v._promise(a,$,m)},{trans:v,transless:Ye.transless||Ye}):(function fe(ne,Z,te,ue){if(ne.idbdb&&(ne._state.openComplete||Ye.letThrough||ne._vip)){var ie=ne._createTransaction(Z,te,ne._dbSchema);try{ie.create(),ne._state.PR1398_maxLoop=3}catch(oe){return oe.name===_e.InvalidState&&ne.isOpen()&&0<--ne._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),ne.close({disableAutoOpen:!1}),ne.open().then(function(){return fe(ne,Z,te,ue)})):Et(oe)}return ie._promise(Z,function(oe,ae){return pn(function(){return Ye.trans=ie,ue(oe,ae,ie)})}).then(function(oe){if(Z==="readwrite")try{ie.idbtrans.commit()}catch{}return Z==="readonly"?oe:ie._completion.then(function(){return oe})})}if(ne._state.openComplete)return Et(new ke.DatabaseClosed(ne._state.dbOpenError));if(!ne._state.isBeingOpened){if(!ne._state.autoOpen)return Et(new ke.DatabaseClosed);ne.open().catch(Re)}return ne._state.dbReadyPromise.then(function(){return fe(ne,Z,te,ue)})})(this.db,a,[this.name],$);return N&&(ee._consoleTask=N,ee=ee.catch(function(fe){return console.trace(fe),Et(fe)})),ee}finally{O&&En()}},yt.prototype.get=function(a,f){var m=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(v){return m.core.get({trans:v,key:a}).then(function(_){return m.hook.reading.fire(_)})}).then(f)},yt.prototype.where=function(a){if(typeof a=="string")return new this.db.WhereClause(this,a);if(h(a))return new this.db.WhereClause(this,"[".concat(a.join("+"),"]"));var f=d(a);if(f.length===1)return this.where(f[0]).equals(a[f[0]]);var m=this.schema.indexes.concat(this.schema.primKey).filter(function(O){if(O.compound&&f.every(function(fe){return 0<=O.keyPath.indexOf(fe)})){for(var ee=0;ee<f.length;++ee)if(f.indexOf(O.keyPath[ee])===-1)return!1;return!0}return!1}).sort(function(O,ee){return O.keyPath.length-ee.keyPath.length})[0];if(m&&this.db._maxKey!==ir)return $=m.keyPath.slice(0,f.length),this.where($).equals($.map(function(O){return a[O]}));!m&&_t&&console.warn("The query ".concat(JSON.stringify(a)," on ").concat(this.name," would benefit from a ")+"compound index [".concat(f.join("+"),"]"));var v=this.schema.idxByName;function _(O,ee){return ct(O,ee)===0}var $=f.reduce(function(ne,ee){var fe=ne[0],ne=ne[1],Z=v[ee],te=a[ee];return[fe||Z,fe||!Z?yr(ne,Z&&Z.multi?function(ue){return ue=H(ue,ee),h(ue)&&ue.some(function(ie){return _(te,ie)})}:function(ue){return _(te,H(ue,ee))}):ne]},[null,null]),N=$[0],$=$[1];return N?this.where(N.name).equals(a[N.keyPath]).filter($):m?this.filter($):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,h(a)?"[".concat(a.join("+"),"]"):a))},yt.prototype.reverse=function(){return this.toCollection().reverse()},yt.prototype.mapToClass=function(a){for(var f=this.db,m=this.name,v=((this.schema.mappedClass=a).prototype instanceof jn&&(a=($=>{var O=ne,ee=$;if(typeof ee!="function"&&ee!==null)throw new TypeError("Class extends value "+String(ee)+" is not a constructor or null");function fe(){this.constructor=O}function ne(){return $!==null&&$.apply(this,arguments)||this}return i(O,ee),O.prototype=ee===null?Object.create(ee):(fe.prototype=ee.prototype,new fe),Object.defineProperty(ne.prototype,"db",{get:function(){return f},enumerable:!1,configurable:!0}),ne.prototype.table=function(){return m},ne})(a)),new Set),_=a.prototype;_;_=b(_))Object.getOwnPropertyNames(_).forEach(function($){return v.add($)});function N($){if(!$)return $;var O,ee=Object.create(a.prototype);for(O in $)if(!v.has(O))try{ee[O]=$[O]}catch{}return ee}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){y(this,a)})},yt.prototype.add=function(a,f){var m=this,v=this.schema.primKey,_=v.auto,N=v.keyPath,$=a;return N&&_&&($=sr(N)(a)),this._trans("readwrite",function(O){return m.core.mutate({trans:O,type:"add",keys:f!=null?[f]:null,values:[$]})}).then(function(O){return O.numFailures?He.reject(O.failures[0]):O.lastResult}).then(function(O){if(N)try{Q(a,N,O)}catch{}return O})},yt.prototype.upsert=function(a,f){var m=this,v=this.schema.primKey.keyPath;return this._trans("readwrite",function(_){return m.core.get({trans:_,key:a}).then(function(N){var $=N??{};return io($,f),v&&Q($,v,a),m.core.mutate({trans:_,type:"put",values:[$],keys:[a],upsert:!0,updates:{keys:[a],changeSpecs:[f]}}).then(function(O){return O.numFailures?He.reject(O.failures[0]):!!N})})})},yt.prototype.update=function(a,f){return typeof a!="object"||h(a)?this.where(":id").equals(a).modify(f):(a=H(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 m=this,v=this.schema.primKey,_=v.auto,N=v.keyPath,$=a;return N&&_&&($=sr(N)(a)),this._trans("readwrite",function(O){return m.core.mutate({trans:O,type:"put",values:[$],keys:f!=null?[f]:null})}).then(function(O){return O.numFailures?He.reject(O.failures[0]):O.lastResult}).then(function(O){if(N)try{Q(a,N,O)}catch{}return O})},yt.prototype.delete=function(a){var f=this;return this._trans("readwrite",function(m){return f.core.mutate({trans:m,type:"delete",keys:[a]}).then(function(v){return Ro(f,[a],v)}).then(function(v){return v.numFailures?He.reject(v.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(m){return Ro(a,null,m)})}).then(function(f){return f.numFailures?He.reject(f.failures[0]):void 0})},yt.prototype.bulkGet=function(a){var f=this;return this._trans("readonly",function(m){return f.core.getMany({keys:a,trans:m}).then(function(v){return v.map(function(_){return f.hook.reading.fire(_)})})})},yt.prototype.bulkAdd=function(a,f,m){var v=this,_=Array.isArray(f)?f:void 0,N=(m=m||(_?void 0:f))?m.allKeys:void 0;return this._trans("readwrite",function($){var O=v.schema.primKey,fe=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 ee=a.length,fe=O&&fe?a.map(sr(O)):a;return v.core.mutate({trans:$,type:"add",keys:_,values:fe,wantResults:N}).then(function(ne){var Z=ne.numFailures,te=ne.failures;if(Z===0)return N?ne.results:ne.lastResult;throw new Oe("".concat(v.name,".bulkAdd(): ").concat(Z," of ").concat(ee," operations failed"),te)})})},yt.prototype.bulkPut=function(a,f,m){var v=this,_=Array.isArray(f)?f:void 0,N=(m=m||(_?void 0:f))?m.allKeys:void 0;return this._trans("readwrite",function($){var O=v.schema.primKey,fe=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 ee=a.length,fe=O&&fe?a.map(sr(O)):a;return v.core.mutate({trans:$,type:"put",keys:_,values:fe,wantResults:N}).then(function(ne){var Z=ne.numFailures,te=ne.failures;if(Z===0)return N?ne.results:ne.lastResult;throw new Oe("".concat(v.name,".bulkPut(): ").concat(Z," of ").concat(ee," operations failed"),te)})})},yt.prototype.bulkUpdate=function(a){var f=this,m=this.core,v=a.map(function($){return $.key}),_=a.map(function($){return $.changes}),N=[];return this._trans("readwrite",function($){return m.getMany({trans:$,keys:v,cache:"clone"}).then(function(O){var ee=[],fe=[],ne=(a.forEach(function(Z,te){var ue=Z.key,ie=Z.changes,oe=O[te];if(oe){for(var ae=0,ge=Object.keys(ie);ae<ge.length;ae++){var de=ge[ae],xe=ie[de];if(de===f.schema.primKey.keyPath){if(ct(xe,ue)!==0)throw new ke.Constraint("Cannot update primary key in bulkUpdate()")}else Q(oe,de,xe)}N.push(te),ee.push(ue),fe.push(oe)}}),ee.length);return m.mutate({trans:$,type:"put",keys:ee,values:fe,updates:{keys:v,changeSpecs:_}}).then(function(Z){var te=Z.numFailures,ue=Z.failures;if(te===0)return ne;for(var ie=0,oe=Object.keys(ue);ie<oe.length;ie++){var ae,ge=oe[ie],de=N[Number(ge)];de!=null&&(ae=ue[ge],delete ue[ge],ue[de]=ae)}throw new Oe("".concat(f.name,".bulkUpdate(): ").concat(te," of ").concat(ne," operations failed"),ue)})})})},yt.prototype.bulkDelete=function(a){var f=this,m=a.length;return this._trans("readwrite",function(v){return f.core.mutate({trans:v,type:"delete",keys:a}).then(function(_){return Ro(f,a,_)})}).then(function(v){var _=v.numFailures,N=v.failures;if(_===0)return v.lastResult;throw new Oe("".concat(f.name,".bulkDelete(): ").concat(_," of ").concat(m," operations failed"),N)})};var Yn=yt;function yt(){}function Br(a){function f($,O){if(O){for(var ee=arguments.length,fe=new Array(ee-1);--ee;)fe[ee-1]=arguments[ee];return m[$].subscribe.apply(null,fe),a}if(typeof $=="string")return m[$]}var m={};f.addEventType=N;for(var v=1,_=arguments.length;v<_;++v)N(arguments[v]);return f;function N($,O,ee){var fe,ne;if(typeof $!="object")return O=O||nn,ne={subscribers:[],fire:ee=ee||Re,subscribe:function(Z){ne.subscribers.indexOf(Z)===-1&&(ne.subscribers.push(Z),ne.fire=O(ne.fire,Z))},unsubscribe:function(Z){ne.subscribers=ne.subscribers.filter(function(te){return te!==Z}),ne.fire=ne.subscribers.reduce(O,ee)}},m[$]=f[$]=ne;d(fe=$).forEach(function(Z){var te=fe[Z];if(h(te))N(Z,fe[Z][0],fe[Z][1]);else{if(te!=="asap")throw new ke.InvalidArgument("Invalid event config");var ue=N(Z,qe,function(){for(var ie=arguments.length,oe=new Array(ie);ie--;)oe[ie]=arguments[ie];ue.subscribers.forEach(function(ae){W(function(){ae.apply(null,oe)})})})}})}}function so(a,f){return M(f).from({prototype:a}),f}function ar(a,f){return!(a.filter||a.algorithm||a.or)&&(f?a.justLimit:!a.replayFilter)}function Hr(a,f){a.filter=yr(a.filter,f)}function ao(a,f,m){var v=a.replayFilter;a.replayFilter=v?function(){return yr(v(),f())}:f,a.justLimit=m&&!v}function lr(a,f){if(a.isPrimKey)return f.primaryKey;var m=f.getIndexByKeyPath(a.index);if(m)return m;throw new ke.Schema("KeyPath "+a.index+" on object store "+f.name+" is not indexed")}function di(a,f,m){var v=lr(a,f.schema);return f.openCursor({trans:m,values:!a.keysOnly,reverse:a.dir==="prev",unique:!!a.unique,query:{index:v,range:a.range}})}function Do(a,f,m,v){var _,N,$=a.replayFilter?yr(a.filter,a.replayFilter()):a.filter;return a.or?(_={},N=function(O,ee,fe){var ne,Z;$&&!$(ee,fe,function(te){return ee.stop(te)},function(te){return ee.fail(te)})||((Z=""+(ne=ee.primaryKey))=="[object ArrayBuffer]"&&(Z=""+new Uint8Array(ne)),x(_,Z))||(_[Z]=!0,f(O,ee,fe))},Promise.all([a.or._iterate(N,m),xt(di(a,v,m),a.algorithm,N,!a.keysOnly&&a.valueMapper)])):xt(di(a,v,m),yr(a.algorithm,$),f,!a.keysOnly&&a.valueMapper)}function xt(a,f,m,v){var _=Ne(v?function(N,$,O){return m(v(N),$,O)}:m);return a.then(function(N){if(N)return N.start(function(){var $=function(){return N.continue()};f&&!f(N,function(O){return $=O},function(O){N.stop(O),$=Re},function(O){N.fail(O),$=Re})||_(N.value,N,function(O){return $=O}),$()})})}ht.prototype._read=function(a,f){var m=this._ctx;return m.error?m.table._trans(null,Et.bind(null,m.error)):m.table._trans("readonly",a).then(f)},ht.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")},ht.prototype._addAlgorithm=function(a){var f=this._ctx;f.algorithm=yr(f.algorithm,a)},ht.prototype._iterate=function(a,f){return Do(this._ctx,a,f,this._ctx.table.core)},ht.prototype.clone=function(a){var f=Object.create(this.constructor.prototype),m=Object.create(this._ctx);return a&&y(m,a),f._ctx=m,f},ht.prototype.raw=function(){return this._ctx.valueMapper=null,this},ht.prototype.each=function(a){var f=this._ctx;return this._read(function(m){return Do(f,a,m,f.table.core)})},ht.prototype.count=function(a){var f=this;return this._read(function(m){var v,_=f._ctx,N=_.table.core;return ar(_,!0)?N.count({trans:m,query:{index:lr(_,N.schema),range:_.range}}).then(function($){return Math.min($,_.limit)}):(v=0,Do(_,function(){return++v,!1},m,N).then(function(){return v}))}).then(a)},ht.prototype.sortBy=function(a,f){var m=a.split(".").reverse(),v=m[0],_=m.length-1;function N(ee,fe){return fe?N(ee[m[fe]],fe-1):ee[v]}var $=this._ctx.dir==="next"?1:-1;function O(ee,fe){return ct(N(ee,_),N(fe,_))*$}return this.toArray(function(ee){return ee.sort(O)}).then(f)},ht.prototype.toArray=function(a){var f=this;return this._read(function(m){var v,_,N,$=f._ctx;return ar($,!0)&&0<$.limit?(v=$.valueMapper,_=lr($,$.table.core.schema),$.table.core.query({trans:m,limit:$.limit,values:!0,direction:$.dir==="prev"?"prev":void 0,query:{index:_,range:$.range}}).then(function(O){return O=O.result,v?O.map(v):O})):(N=[],Do($,function(O){return N.push(O)},m,$.table.core).then(function(){return N}))},a)},ht.prototype.offset=function(a){var f=this._ctx;return a<=0||(f.offset+=a,ar(f)?ao(f,function(){var m=a;return function(v,_){return m===0||(m===1?--m:_(function(){v.advance(m),m=0}),!1)}}):ao(f,function(){var m=a;return function(){return--m<0}})),this},ht.prototype.limit=function(a){return this._ctx.limit=Math.min(this._ctx.limit,a),ao(this._ctx,function(){var f=a;return function(m,v,_){return--f<=0&&v(_),0<=f}},!0),this},ht.prototype.until=function(a,f){return Hr(this._ctx,function(m,v,_){return!a(m.value)||(v(_),f)}),this},ht.prototype.first=function(a){return this.limit(1).toArray(function(f){return f[0]}).then(a)},ht.prototype.last=function(a){return this.reverse().first(a)},ht.prototype.filter=function(a){var f;return Hr(this._ctx,function(m){return a(m.value)}),(f=this._ctx).isMatch=yr(f.isMatch,a),this},ht.prototype.and=function(a){return this.filter(a)},ht.prototype.or=function(a){return new this.db.WhereClause(this._ctx.table,a,this)},ht.prototype.reverse=function(){return this._ctx.dir=this._ctx.dir==="prev"?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this},ht.prototype.desc=function(){return this.reverse()},ht.prototype.eachKey=function(a){var f=this._ctx;return f.keysOnly=!f.isMatch,this.each(function(m,v){a(v.key,v)})},ht.prototype.eachUniqueKey=function(a){return this._ctx.unique="unique",this.eachKey(a)},ht.prototype.eachPrimaryKey=function(a){var f=this._ctx;return f.keysOnly=!f.isMatch,this.each(function(m,v){a(v.primaryKey,v)})},ht.prototype.keys=function(a){var f=this._ctx,m=(f.keysOnly=!f.isMatch,[]);return this.each(function(v,_){m.push(_.key)}).then(function(){return m}).then(a)},ht.prototype.primaryKeys=function(a){var f=this._ctx;if(ar(f,!0)&&0<f.limit)return this._read(function(v){var _=lr(f,f.table.core.schema);return f.table.core.query({trans:v,values:!1,limit:f.limit,direction:f.dir==="prev"?"prev":void 0,query:{index:_,range:f.range}})}).then(function(v){return v.result}).then(a);f.keysOnly=!f.isMatch;var m=[];return this.each(function(v,_){m.push(_.primaryKey)}).then(function(){return m}).then(a)},ht.prototype.uniqueKeys=function(a){return this._ctx.unique="unique",this.keys(a)},ht.prototype.firstKey=function(a){return this.limit(1).keys(function(f){return f[0]}).then(a)},ht.prototype.lastKey=function(a){return this.reverse().firstKey(a)},ht.prototype.distinct=function(){var a,f=this._ctx,f=f.index&&f.table.schema.idxByName[f.index];return f&&f.multi&&(a={},Hr(this._ctx,function(v){var v=v.primaryKey.toString(),_=x(a,v);return a[v]=!0,!_})),this},ht.prototype.modify=function(a){var f=this,m=this._ctx;return this._write(function(v){function _(oe,ae){var ge=ae.failures;te+=oe-ae.numFailures;for(var de=0,xe=d(ge);de<xe.length;de++){var Ee=xe[de];Z.push(ge[Ee])}}var N=typeof a=="function"?a:function(oe){return io(oe,a)},$=m.table.core,ne=$.schema.primaryKey,O=ne.outbound,ee=ne.extractKey,fe=200,ne=f.db._options.modifyChunkSize,Z=(ne&&(fe=typeof ne=="object"?ne[$.name]||ne["*"]||200:ne),[]),te=0,ue=[],ie=a===Vi;return f.clone().primaryKeys().then(function(oe){function ae(de){var xe=Math.min(fe,oe.length-de),Ee=oe.slice(de,de+xe);return(ie?Promise.resolve([]):$.getMany({trans:v,keys:Ee,cache:"immutable"})).then(function(je){var Le=[],Te=[],Ue=O?[]:null,De=ie?Ee:[];if(!ie)for(var We=0;We<xe;++We){var Ce=je[We],nt={value:ve(Ce),primKey:oe[de+We]};N.call(nt,nt.value,nt)!==!1&&(nt.value==null?De.push(oe[de+We]):O||ct(ee(Ce),ee(nt.value))===0?(Te.push(nt.value),O&&Ue.push(oe[de+We])):(De.push(oe[de+We]),Le.push(nt.value)))}return Promise.resolve(0<Le.length&&$.mutate({trans:v,type:"add",values:Le}).then(function(rt){for(var at in rt.failures)De.splice(parseInt(at),1);_(Le.length,rt)})).then(function(){return(0<Te.length||ge&&typeof a=="object")&&$.mutate({trans:v,type:"put",keys:Ue,values:Te,criteria:ge,changeSpec:typeof a!="function"&&a,isAdditionalChunk:0<de}).then(function(rt){return _(Te.length,rt)})}).then(function(){return(0<De.length||ge&&ie)&&$.mutate({trans:v,type:"delete",keys:De,criteria:ge,isAdditionalChunk:0<de}).then(function(rt){return Ro(m.table,De,rt)}).then(function(rt){return _(De.length,rt)})}).then(function(){return oe.length>de+xe&&ae(de+fe)})})}var ge=ar(m)&&m.limit===1/0&&(typeof a!="function"||ie)&&{index:m.index,range:m.range};return ae(0).then(function(){if(0<Z.length)throw new Ae("Error modifying one or more objects",Z,te,ue);return oe.length})})})},ht.prototype.delete=function(){var a=this._ctx,f=a.range;return!ar(a)||a.table.schema.yProps||!a.isPrimKey&&f.type!==3?this.modify(Vi):this._write(function(m){var v=a.table.core.schema.primaryKey,_=f;return a.table.core.count({trans:m,query:{index:v,range:_}}).then(function(N){return a.table.core.mutate({trans:m,type:"deleteRange",range:_}).then(function(ee){var O=ee.failures,ee=ee.numFailures;if(ee)throw new Ae("Could not delete some values",Object.keys(O).map(function(fe){return O[fe]}),N-ee);return N-ee})})})};var Ba=ht;function ht(){}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,m){return a=a instanceof xr?new a.Collection(a):a,a._ctx.error=new(m||TypeError)(f),a}function Vr(a){return new a.Collection(a,function(){return vr("")}).limit(0)}function lo(ue,f,m,v){var _,N,$,O,ee,fe,ne,Z=m.length;if(!m.every(function(oe){return typeof oe=="string"}))return mn(ue,Bi);function te(oe){_=oe==="next"?function(ge){return ge.toUpperCase()}:function(ge){return ge.toLowerCase()},N=oe==="next"?function(ge){return ge.toLowerCase()}:function(ge){return ge.toUpperCase()},$=oe==="next"?Ha:Va;var ae=m.map(function(ge){return{lower:N(ge),upper:_(ge)}}).sort(function(ge,de){return $(ge.lower,de.lower)});O=ae.map(function(ge){return ge.upper}),ee=ae.map(function(ge){return ge.lower}),ne=(fe=oe)==="next"?"":v}te("next");var ue=new ue.Collection(ue,function(){return an(O[0],ee[Z-1]+v)}),ie=(ue._ondirectionchange=function(oe){te(oe)},0);return ue._addAlgorithm(function(oe,ae,ge){var de=oe.key;if(typeof de=="string"){var xe=N(de);if(f(xe,ee,ie))return!0;for(var Ee=null,je=ie;je<Z;++je){var Le=((Te,Ue,De,We,Ce,nt)=>{for(var rt=Math.min(Te.length,We.length),at=-1,ft=0;ft<rt;++ft){var gn=Ue[ft];if(gn!==We[ft])return Ce(Te[ft],De[ft])<0?Te.substr(0,ft)+De[ft]+De.substr(ft+1):Ce(Te[ft],We[ft])<0?Te.substr(0,ft)+We[ft]+De.substr(ft+1):0<=at?Te.substr(0,at)+Ue[at]+De.substr(at+1):null;Ce(Te[ft],gn)<0&&(at=ft)}return rt<We.length&&nt==="next"?Te+De.substr(Te.length):rt<Te.length&&nt==="prev"?Te.substr(0,De.length):at<0?null:Te.substr(0,at)+We[at]+De.substr(at+1)})(de,xe,O[je],ee[je],$,fe);Le===null&&Ee===null?ie=je+1:(Ee===null||0<$(Ee,Le))&&(Ee=Le)}ae(Ee!==null?function(){oe.continue(Ee+ne)}:ge)}return!1}),ue}function an(a,f,m,v){return{type:2,lower:a,upper:f,lowerOpen:m,upperOpen:v}}function vr(a){return{type:1,lower:a,upper:a}}Object.defineProperty(Tt.prototype,"Collection",{get:function(){return this._ctx.table.db.Collection},enumerable:!1,configurable:!0}),Tt.prototype.between=function(a,f,m,v){m=m!==!1,v=v===!0;try{return 0<this._cmp(a,f)||this._cmp(a,f)===0&&(m||v)&&(!m||!v)?Vr(this):new this.Collection(this,function(){return an(a,f,!m,!v)})}catch{return mn(this,gt)}},Tt.prototype.equals=function(a){return a==null?mn(this,gt):new this.Collection(this,function(){return vr(a)})},Tt.prototype.above=function(a){return a==null?mn(this,gt):new this.Collection(this,function(){return an(a,void 0,!0)})},Tt.prototype.aboveOrEqual=function(a){return a==null?mn(this,gt):new this.Collection(this,function(){return an(a,void 0,!1)})},Tt.prototype.below=function(a){return a==null?mn(this,gt):new this.Collection(this,function(){return an(void 0,a,!1,!0)})},Tt.prototype.belowOrEqual=function(a){return a==null?mn(this,gt):new this.Collection(this,function(){return an(void 0,a)})},Tt.prototype.startsWith=function(a){return typeof a!="string"?mn(this,Bi):this.between(a,a+ir,!0,!0)},Tt.prototype.startsWithIgnoreCase=function(a){return a===""?this.startsWith(a):lo(this,function(f,m){return f.indexOf(m[0])===0},[a],ir)},Tt.prototype.equalsIgnoreCase=function(a){return lo(this,function(f,m){return f===m[0]},[a],"")},Tt.prototype.anyOfIgnoreCase=function(){var a=F.apply(K,arguments);return a.length===0?Vr(this):lo(this,function(f,m){return m.indexOf(f)!==-1},a,"")},Tt.prototype.startsWithAnyOfIgnoreCase=function(){var a=F.apply(K,arguments);return a.length===0?Vr(this):lo(this,function(f,m){return m.some(function(v){return f.indexOf(v)===0})},a,ir)},Tt.prototype.anyOf=function(){var a,f,m=this,v=F.apply(K,arguments),_=this._cmp;try{v.sort(_)}catch{return mn(this,gt)}return v.length===0?Vr(this):((a=new this.Collection(this,function(){return an(v[0],v[v.length-1])}))._ondirectionchange=function(N){_=N==="next"?m._ascending:m._descending,v.sort(_)},f=0,a._addAlgorithm(function(N,$,O){for(var ee=N.key;0<_(ee,v[f]);)if(++f===v.length)return $(O),!1;return _(ee,v[f])===0||($(function(){N.continue(v[f])}),!1)}),a)},Tt.prototype.notEqual=function(a){return this.inAnyRange([[-1/0,a],[a,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})},Tt.prototype.noneOf=function(){var a=F.apply(K,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(m,v){return m?m.concat([[m[m.length-1][1],v]]):[[-1/0,v]]},null);return f.push([a[a.length-1],this.db._maxKey]),this.inAnyRange(f,{includeLowers:!1,includeUppers:!1})},Tt.prototype.inAnyRange=function(a,ge){var m=this,v=this._cmp,_=this._ascending,N=this._descending,$=this._min,O=this._max;if(a.length===0)return Vr(this);if(!a.every(function(de){return de[0]!==void 0&&de[1]!==void 0&&_(de[0],de[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 ee=!ge||ge.includeLowers!==!1,fe=ge&&ge.includeUppers===!0,ne,Z=_;function te(de,xe){return Z(de[0],xe[0])}try{(ne=a.reduce(function(de,xe){for(var Ee=0,je=de.length;Ee<je;++Ee){var Le=de[Ee];if(v(xe[0],Le[1])<0&&0<v(xe[1],Le[0])){Le[0]=$(Le[0],xe[0]),Le[1]=O(Le[1],xe[1]);break}}return Ee===je&&de.push(xe),de},[])).sort(te)}catch{return mn(this,gt)}var ue=0,ie=fe?function(de){return 0<_(de,ne[ue][1])}:function(de){return 0<=_(de,ne[ue][1])},oe=ee?function(de){return 0<N(de,ne[ue][0])}:function(de){return 0<=N(de,ne[ue][0])},ae=ie,ge=new this.Collection(this,function(){return an(ne[0][0],ne[ne.length-1][1],!ee,!fe)});return ge._ondirectionchange=function(de){Z=de==="next"?(ae=ie,_):(ae=oe,N),ne.sort(te)},ge._addAlgorithm(function(de,xe,Ee){for(var je,Le=de.key;ae(Le);)if(++ue===ne.length)return xe(Ee),!1;return!ie(je=Le)&&!oe(je)||(m._cmp(Le,ne[ue][1])===0||m._cmp(Le,ne[ue][0])===0||xe(function(){Z===_?de.continue(ne[ue][0]):de.continue(ne[ue][1])}),!1)}),ge},Tt.prototype.startsWithAnyOf=function(){var a=F.apply(K,arguments);return a.every(function(f){return typeof f=="string"})?a.length===0?Vr(this):this.inAnyRange(a.map(function(f){return[f,f+ir]})):mn(this,"startsWithAnyOf() only works with strings")};var xr=Tt;function Tt(){}function ln(a){return Ne(function(f){return On(f),a(f.target.error),!1})}function On(a){a.stopPropagation&&a.stopPropagation(),a.preventDefault&&a.preventDefault()}var pi="storagemutated",Ui="x-storagemutated-1",Rn=Br(null,pi),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{or(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 m=this.db.idbdb,v=this.db._state.dbOpenError;if(R(!this.idbtrans),!a&&!m)switch(v&&v.name){case"DatabaseClosedError":throw new ke.DatabaseClosed(v);case"MissingAPIError":throw new ke.MissingAPI(v.message,v);default:throw new ke.OpenFailed(v)}if(!this.active)throw new ke.TransactionInactive;R(this._completion._state===null),(a=this.idbtrans=a||(this.db.core||m).transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability})).onerror=Ne(function(_){On(_),f._reject(a.error)}),a.onabort=Ne(function(_){On(_),f.active&&f._reject(new ke.Abort(a.error)),f.active=!1,f.on("abort").fire(_)}),a.oncomplete=Ne(function(){f.active=!1,f._resolve(),"mutatedParts"in a&&Rn.storagemutated.fire(a.mutatedParts)})}return this},Xn.prototype._promise=function(a,f,m){var v,_=this;return a==="readwrite"&&this.mode!=="readwrite"?Et(new ke.ReadOnly("Transaction is readonly")):this.active?this._locked()?new He(function(N,$){_._blockedFuncs.push([function(){_._promise(a,f,m).then(N,$)},Ye])}):m?pn(function(){var N=new He(function($,O){_._lock();var ee=f($,O,_);ee&&ee.then&&ee.then($,O)});return N.finally(function(){return _._unlock()}),N._lib=!0,N}):((v=new He(function(N,$){var O=f(N,$,_);O&&O.then&&O.then(N,$)}))._lib=!0,v):Et(new ke.TransactionInactive)},Xn.prototype._root=function(){return this.parent?this.parent._root():this},Xn.prototype.waitFor=function(a){var f,m=this._root(),v=He.resolve(a),_=(m._waitingFor?m._waitingFor=m._waitingFor.then(function(){return v}):(m._waitingFor=v,m._waitingQueue=[],f=m.idbtrans.objectStore(m.storeNames[0]),(function N(){for(++m._spinCount;m._waitingQueue.length;)m._waitingQueue.shift()();m._waitingFor&&(f.get(-1/0).onsuccess=N)})()),m._waitingFor);return new He(function(N,$){v.then(function(O){return m._waitingQueue.push(Ne(N.bind(null,O)))},function(O){return m._waitingQueue.push(Ne($.bind(null,O)))}).finally(function(){m._waitingFor===_&&(m._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(x(f,a))return f[a];var m=this.schema[a];if(m)return(m=new this.db.Table(a,m,this)).core=this.db.core.table(a),f[a]=m;throw new ke.NotFound("Table "+a+" not part of transaction")},Xn);function Xn(){}function Lo(a,f,m,v,_,N,$,O){return{name:a,keyPath:f,unique:m,multi:v,auto:_,compound:N,src:(m&&!$?"&":"")+(v?"*":"")+(_?"++":"")+Ds(f),type:O}}function Ds(a){return typeof a=="string"?a:a?"["+[].join.call(a,"+")+"]":""}function Ls(a,f,m){return{name:a,primKey:f,indexes:m,mappedClass:null,idxByName:(v=function(_){return[_.name,_]},m.reduce(function(_,N,$){return N=v(N,$),N&&(_[N[0]]=N[1]),_},{}))};var v}var wr=function(a){try{return a.only([[]]),wr=function(){return[[]]},[[]]}catch{return wr=function(){return ir},ir}};function uo(a){return a==null?function(){}:typeof a=="string"?(f=a).split(".").length===1?function(m){return m[f]}:function(m){return H(m,f)}:function(m){return H(m,a)};var f}function co(a){return[].slice.call(a)}var Ki=0;function hi(a){return a==null?":id":typeof a=="string"?a:"[".concat(a.join("+"),"]")}function Ru(a,f,$){function v(ae){if(ae.type===3)return null;if(ae.type===4)throw new Error("Cannot convert never type to IDBKeyRange");var ue=ae.lower,ie=ae.upper,oe=ae.lowerOpen,ae=ae.upperOpen;return ue===void 0?ie===void 0?null:f.upperBound(ie,!!ae):ie===void 0?f.lowerBound(ue,!!oe):f.bound(ue,ie,!!oe,!!ae)}function _(te){var ue,ie,oe=te.name;return{name:oe,schema:te,mutate:function(ae){var ge=ae.trans,de=ae.type,xe=ae.keys,Ee=ae.values,je=ae.range;return new Promise(function(Le,Te){Le=Ne(Le);var Ue=ge.objectStore(oe),De=Ue.keyPath==null,We=de==="put"||de==="add";if(!We&&de!=="delete"&&de!=="deleteRange")throw new Error("Invalid operation type: "+de);var Ce,nt=(xe||Ee||{length:1}).length;if(xe&&Ee&&xe.length!==Ee.length)throw new Error("Given keys array must have same length as given values array.");if(nt===0)return Le({numFailures:0,failures:{},results:[],lastResult:void 0});function rt(un){++gn,On(un)}var at=[],ft=[],gn=0;if(de==="deleteRange"){if(je.type===4)return Le({numFailures:gn,failures:ft,results:[],lastResult:void 0});je.type===3?at.push(Ce=Ue.clear()):at.push(Ce=Ue.delete(v(je)))}else{var De=We?De?[Ee,xe]:[Ee,null]:[xe,null],st=De[0],Ct=De[1];if(We)for(var Ht=0;Ht<nt;++Ht)at.push(Ce=Ct&&Ct[Ht]!==void 0?Ue[de](st[Ht],Ct[Ht]):Ue[de](st[Ht])),Ce.onerror=rt;else for(Ht=0;Ht<nt;++Ht)at.push(Ce=Ue[de](st[Ht])),Ce.onerror=rt}function Wo(un){un=un.target.result,at.forEach(function(vo,xo){return vo.error!=null&&(ft[xo]=vo.error)}),Le({numFailures:gn,failures:ft,results:de==="delete"?xe:at.map(function(vo){return vo.result}),lastResult:un})}Ce.onerror=function(un){rt(un),Wo(un)},Ce.onsuccess=Wo})},getMany:function(ae){var ge=ae.trans,de=ae.keys;return new Promise(function(xe,Ee){xe=Ne(xe);for(var je,Le=ge.objectStore(oe),Te=de.length,Ue=new Array(Te),De=0,We=0,Ce=function(at){at=at.target,Ue[at._pos]=at.result,++We===De&&xe(Ue)},nt=ln(Ee),rt=0;rt<Te;++rt)de[rt]!=null&&((je=Le.get(de[rt]))._pos=rt,je.onsuccess=Ce,je.onerror=nt,++De);De===0&&xe(Ue)})},get:function(ae){var ge=ae.trans,de=ae.key;return new Promise(function(xe,Ee){xe=Ne(xe);var je=ge.objectStore(oe).get(de);je.onsuccess=function(Le){return xe(Le.target.result)},je.onerror=ln(Ee)})},query:(ue=ee,ie=fe,function(ae){return new Promise(function(ge,de){ge=Ne(ge);var xe,Ee,je,Le,nt=ae.trans,Te=ae.values,Ue=ae.limit,Ce=ae.query,De=(De=ae.direction)!=null?De:"next",We=Ue===1/0?void 0:Ue,rt=Ce.index,Ce=Ce.range,nt=nt.objectStore(oe),nt=rt.isPrimaryKey?nt:nt.index(rt.name),rt=v(Ce);if(Ue===0)return ge({result:[]});ie?(Ce={query:rt,count:We,direction:De},(xe=Te?nt.getAll(Ce):nt.getAllKeys(Ce)).onsuccess=function(at){return ge({result:at.target.result})},xe.onerror=ln(de)):ue&&De==="next"?((xe=Te?nt.getAll(rt,We):nt.getAllKeys(rt,We)).onsuccess=function(at){return ge({result:at.target.result})},xe.onerror=ln(de)):(Ee=0,je=!Te&&"openKeyCursor"in nt?nt.openKeyCursor(rt,De):nt.openCursor(rt,De),Le=[],je.onsuccess=function(){var at=je.result;return!at||(Le.push(Te?at.value:at.primaryKey),++Ee===Ue)?ge({result:Le}):void at.continue()},je.onerror=ln(de))})}),openCursor:function(ae){var ge=ae.trans,de=ae.values,xe=ae.query,Ee=ae.reverse,je=ae.unique;return new Promise(function(Le,Te){Le=Ne(Le);var We=xe.index,Ue=xe.range,De=ge.objectStore(oe),De=We.isPrimaryKey?De:De.index(We.name),We=Ee?je?"prevunique":"prev":je?"nextunique":"next",Ce=!de&&"openKeyCursor"in De?De.openKeyCursor(v(Ue),We):De.openCursor(v(Ue),We);Ce.onerror=ln(Te),Ce.onsuccess=Ne(function(nt){var rt,at,ft,gn,st=Ce.result;st?(st.___id=++Ki,st.done=!1,rt=st.continue.bind(st),at=(at=st.continuePrimaryKey)&&at.bind(st),ft=st.advance.bind(st),gn=function(){throw new Error("Cursor not stopped")},st.trans=ge,st.stop=st.continue=st.continuePrimaryKey=st.advance=function(){throw new Error("Cursor not started")},st.fail=Ne(Te),st.next=function(){var Ct=this,Ht=1;return this.start(function(){return Ht--?Ct.continue():Ct.stop()}).then(function(){return Ct})},st.start=function(Ct){function Ht(){if(Ce.result)try{Ct()}catch(un){st.fail(un)}else st.done=!0,st.start=function(){throw new Error("Cursor behind last entry")},st.stop()}var Wo=new Promise(function(un,vo){un=Ne(un),Ce.onerror=ln(vo),st.fail=vo,st.stop=function(xo){st.stop=st.continue=st.continuePrimaryKey=st.advance=gn,un(xo)}});return Ce.onsuccess=Ne(function(un){Ce.onsuccess=Ht,Ht()}),st.continue=rt,st.continuePrimaryKey=at,st.advance=ft,Ht(),Wo},Le(st)):Le(null)},Te)})},count:function(ae){var ge=ae.query,de=ae.trans,xe=ge.index,Ee=ge.range;return new Promise(function(je,Le){var Te=de.objectStore(oe),Te=xe.isPrimaryKey?Te:Te.index(xe.name),Ue=v(Ee),Ue=Ue?Te.count(Ue):Te.count();Ue.onsuccess=Ne(function(De){return je(De.target.result)}),Ue.onerror=ln(Le)})}}}N=$,O=co(($=a).objectStoreNames),ne=0<O.length?N.objectStore(O[0]):{};var N,$={schema:{name:$.name,tables:O.map(function(te){return N.objectStore(te)}).map(function(te){var ue=te.keyPath,ie=te.autoIncrement,ae=h(ue),oe={},ae={name:te.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:ue==null,compound:ae,keyPath:ue,autoIncrement:ie,unique:!0,extractKey:uo(ue)},indexes:co(te.indexNames).map(function(ge){return te.index(ge)}).map(function(Ee){var je=Ee.name,de=Ee.unique,xe=Ee.multiEntry,Ee=Ee.keyPath,je={name:je,compound:h(Ee),keyPath:Ee,unique:de,multiEntry:xe,extractKey:uo(Ee)};return oe[hi(Ee)]=je}),getIndexByKeyPath:function(ge){return oe[hi(ge)]}};return oe[":id"]=ae.primaryKey,ue!=null&&(oe[hi(ue)]=ae.primaryKey),ae})},hasGetAll:0<O.length&&"getAll"in ne&&!(typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604),hasIdb3Features:"getAllRecords"in ne},O=$.schema,ee=$.hasGetAll,fe=$.hasIdb3Features,ne=O.tables.map(_),Z={};return ne.forEach(function(te){return Z[te.name]=te}),{stack:"dbcore",transaction:a.transaction.bind(a),table:function(te){if(Z[te])return Z[te];throw new Error("Table '".concat(te,"' not found"))},MIN_KEY:-1/0,MAX_KEY:wr(f),schema:O}}function zs(a,f,m,v){return m=m.IDBKeyRange,f=Ru(f,m,v),{dbcore:a.dbcore.reduce(function(_,N){return N=N.create,s(s({},_),N(_))},f)}}function fo(a,f){var m=f.db,m=zs(a._middlewares,m,a._deps,f);a.core=m.dbcore,a.tables.forEach(function(v){var _=v.name;a.core.schema.tables.some(function(N){return N.name===_})&&(v.core=a.core.table(_),a[_]instanceof a.Table)&&(a[_].core=v.core)})}function zo(a,f,m,v){m.forEach(function(_){var N=v[_];f.forEach(function($){var O=(function ee(fe,ne){return T(fe,ne)||(fe=b(fe))&&ee(fe,ne)})($,_);(!O||"value"in O&&O.value===void 0)&&($===a.Transaction.prototype||$ instanceof a.Transaction?j($,_,{get:function(){return this.table(_)},set:function(ee){C(this,_,{value:ee,writable:!0,configurable:!0,enumerable:!0})}}):$[_]=new a.Table(_,N))})})}function qi(a,f){f.forEach(function(m){for(var v in m)m[v]instanceof a.Table&&delete m[v]})}function Ur(a,f){return a._cfg.version-f._cfg.version}function Fs(a,f,m,v){var _=a._dbSchema,N=(m.objectStoreNames.contains("$meta")&&!_.$meta&&(_.$meta=Ls("$meta",Xi("")[0],[]),a._storeNames.push("$meta")),a._createTransaction("readwrite",a._storeNames,_)),$=(N.create(m),N._completion.catch(v),N._reject.bind(N)),O=Ye.transless||Ye;pn(function(){if(Ye.trans=N,Ye.transless=O,f!==0)return fo(a,m),fe=f,((ee=N).storeNames.includes("$meta")?ee.table("$meta").get("version").then(function(ne){return ne??fe}):He.resolve(fe)).then(function(ae){var Z=a,te=ae,ue=N,ie=m,oe=[],ae=Z._versions,ge=Z._dbSchema=Gt(0,Z.idbdb,ie);return(ae=ae.filter(function(de){return de._cfg.version>=te})).length===0?He.resolve():(ae.forEach(function(de){oe.push(function(){var xe,Ee,je,Le=ge,Te=de._cfg.dbschema,Ue=(br(Z,Le,ie),br(Z,Te,ie),ge=Z._dbSchema=Te,Yi(Le,Te)),De=(Ue.add.forEach(function(We){Fo(ie,We[0],We[1].primKey,We[1].indexes)}),Ue.change.forEach(function(We){if(We.recreate)throw new ke.Upgrade("Not yet support for changing primary key");var Ce=ie.objectStore(We.name);We.add.forEach(function(nt){return gi(Ce,nt)}),We.change.forEach(function(nt){Ce.deleteIndex(nt.name),gi(Ce,nt)}),We.del.forEach(function(nt){return Ce.deleteIndex(nt)})}),de._cfg.contentUpgrade);if(De&&de._cfg.version>te)return fo(Z,ie),ue._memoizedTables={},xe=G(Te),Ue.del.forEach(function(We){xe[We]=Le[We]}),qi(Z,[Z.Transaction.prototype]),zo(Z,[Z.Transaction.prototype],d(xe),xe),ue.schema=xe,(Ee=A(De))&&Cn(),Te=He.follow(function(){var We;(je=De(ue))&&Ee&&(We=zt.bind(null,null),je.then(We,We))}),je&&typeof je.then=="function"?He.resolve(je):Te.then(function(){return je})}),oe.push(function(xe){var Ee,je,Le=de._cfg.dbschema;Ee=Le,je=xe,[].slice.call(je.db.objectStoreNames).forEach(function(Te){return Ee[Te]==null&&je.db.deleteObjectStore(Te)}),qi(Z,[Z.Transaction.prototype]),zo(Z,[Z.Transaction.prototype],Z._storeNames,Z._dbSchema),ue.schema=Z._dbSchema}),oe.push(function(xe){Z.idbdb.objectStoreNames.contains("$meta")&&(Math.ceil(Z.idbdb.version/10)===de._cfg.version?(Z.idbdb.deleteObjectStore("$meta"),delete Z._dbSchema.$meta,Z._storeNames=Z._storeNames.filter(function(Ee){return Ee!=="$meta"})):xe.objectStore("$meta").put(de._cfg.version,"version"))})}),(function de(){return oe.length?He.resolve(oe.shift()(ue.idbtrans)).then(de):He.resolve()})().then(function(){mi(ge,ie)}))}).catch($);var ee,fe;d(_).forEach(function(ne){Fo(m,ne,_[ne].primKey,_[ne].indexes)}),fo(a,m),He.follow(function(){return a.on.populate.fire(N)}).catch($)})}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 m=Gt(0,a.idbdb,f);br(a,a._dbSchema,f);for(var v=0,_=Yi(m,a._dbSchema).change;v<_.length;v++){var N=($=>{if($.change.length||$.recreate)return console.warn("Unable to patch indexes of table ".concat($.name," because it has changes on the type of index or primary key.")),{value:void 0};var O=f.objectStore($.name);$.add.forEach(function(ee){_t&&console.debug("Dexie upgrade patch: Creating missing index ".concat($.name,".").concat(ee.src)),gi(O,ee)})})(_[v]);if(typeof N=="object")return N.value}}function Yi(a,f){var m,v={del:[],add:[],change:[]};for(m in a)f[m]||v.del.push(m);for(m in f){var _=a[m],N=f[m];if(_){var $={name:m,def:N,recreate:!1,del:[],add:[],change:[]};if(""+(_.primKey.keyPath||"")!=""+(N.primKey.keyPath||"")||_.primKey.auto!==N.primKey.auto)$.recreate=!0,v.change.push($);else{var O=_.idxByName,ee=N.idxByName,fe=void 0;for(fe in O)ee[fe]||$.del.push(fe);for(fe in ee){var ne=O[fe],Z=ee[fe];ne?ne.src!==Z.src&&$.change.push(Z):$.add.push(Z)}(0<$.del.length||0<$.add.length||0<$.change.length)&&v.change.push($)}}else v.add.push([m,N])}return v}function Fo(a,f,m,v){var _=a.db.createObjectStore(f,m.keyPath?{keyPath:m.keyPath,autoIncrement:m.auto}:{autoIncrement:m.auto});v.forEach(function(N){return gi(_,N)})}function mi(a,f){d(a).forEach(function(m){f.db.objectStoreNames.contains(m)||(_t&&console.debug("Dexie: Creating missing table",m),Fo(f,m,a[m].primKey,a[m].indexes))})}function gi(a,f){a.createIndex(f.name,f.keyPath,{unique:f.unique,multiEntry:f.multi})}function Gt(a,f,m){var v={};return B(f.objectStoreNames,0).forEach(function(_){for(var N=m.objectStore(_),$=Lo(Ds(fe=N.keyPath),fe||"",!0,!1,!!N.autoIncrement,fe&&typeof fe!="string",!0),O=[],ee=0;ee<N.indexNames.length;++ee){var ne=N.index(N.indexNames[ee]),fe=ne.keyPath,ne=Lo(ne.name,fe,!!ne.unique,!!ne.multiEntry,!1,fe&&typeof fe!="string",!1);O.push(ne)}v[_]=Ls(_,$,O)}),v}function br(a,f,m){for(var v=m.db.objectStoreNames,_=0;_<v.length;++_){var N=v[_],$=m.objectStore(N);a._hasGetAll="getAll"in $;for(var O=0;O<$.indexNames.length;++O){var ee,fe=$.indexNames[O],ne=$.index(fe).keyPath,ne=typeof ne=="string"?ne:"["+B(ne).join("+")+"]";f[N]&&(ee=f[N].idxByName[ne])&&(ee.name=fe,delete f[N].idxByName[ne],f[N].idxByName[fe]=ee)}}typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&c.WorkerGlobalScope&&c instanceof c.WorkerGlobalScope&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(a._hasGetAll=!1)}function Xi(a){return a.split(",").map(function(f,m){var _=f.split(":"),v=(v=_[1])==null?void 0:v.trim(),_=(f=_[0].trim()).replace(/([&*]|\+\+)/g,""),N=/^\[/.test(_)?_.match(/^\[(.*)\]$/)[1].split("+"):_;return Lo(_,N||null,/\&/.test(f),/\*/.test(f),/\+\+/.test(f),h(N),m===0,v)})}Bo.prototype._createTableSchema=Ls,Bo.prototype._parseIndexSyntax=Xi,Bo.prototype._parseStoresSpec=function(a,f){var m=this;d(a).forEach(function(v){if(a[v]!==null){var _=m._parseIndexSyntax(a[v]),N=_.shift();if(!N)throw new ke.Schema("Invalid schema for table "+v+": "+a[v]);if(N.unique=!0,N.multi)throw new ke.Schema("Primary key cannot be multiEntry*");_.forEach(function($){if($.auto)throw new ke.Schema("Only primary key can be marked as autoIncrement (++)");if(!$.keyPath)throw new ke.Schema("Index must have a name and cannot be an empty string")}),N=m._createTableSchema(v,N,_),f[v]=N}})},Bo.prototype.stores=function(m){var f=this.db,m=(this._cfg.storesSource=this._cfg.storesSource?y(this._cfg.storesSource,m):m,f._versions),v={},_={};return m.forEach(function(N){y(v,N._cfg.storesSource),_=N._cfg.dbschema={},N._parseStoresSpec(v,_)}),f._dbSchema=_,qi(f,[f._allTables,f,f.Transaction.prototype]),zo(f,[f._allTables,f,f.Transaction.prototype,this._cfg.tables],d(_),_),f._storeNames=d(_),this},Bo.prototype.upgrade=function(a){return this._cfg.contentUpgrade=Lt(this._cfg.contentUpgrade||Re,a),this};var yi=Bo;function Bo(){}var po=(()=>{var a,f,m;return typeof FinalizationRegistry<"u"&&typeof WeakRef<"u"?(a=new Set,f=new FinalizationRegistry(function(v){a.delete(v)}),{toArray:function(){return Array.from(a).map(function(v){return v.deref()}).filter(function(v){return v!==void 0})},add:function(v){var _=new WeakRef(v._novip);a.add(_),f.register(v._novip,_,_),a.size>v._options.maxConnections&&(_=a.values().next().value,a.delete(_),f.unregister(_))},remove:function(v){if(v)for(var _=a.values(),N=_.next();!N.done;){var $=N.value;if($.deref()===v._novip)return a.delete($),void f.unregister($);N=_.next()}}}):(m=[],{toArray:function(){return m},add:function(v){m.push(v._novip)},remove:function(v){v&&(v=m.indexOf(v._novip))!==-1&&m.splice(v,1)}})})();function vi(a,f){var m=a._dbNamesDB;return m||(m=a._dbNamesDB=new Sr(zr,{addons:[],indexedDB:a,IDBKeyRange:f})).version(1).stores({dbnames:"name"}),m.table("dbnames")}function ho(a){return a&&typeof a.databases=="function"}function Ho(a){return pn(function(){return Ye.letThrough=!0,a()})}function Qi(a){return!("from"in a)}var Jt=function(a,f){var m;if(!this)return m=new Jt,a&&"d"in a&&y(m,a),m;y(this,arguments.length?{d:1,from:a,to:1<arguments.length?f:a}:{d:0})};function xi(a,f,m){var v=ct(f,m);if(!isNaN(v)){if(0<v)throw RangeError();if(Qi(a))return y(a,{from:f,to:m,d:1});var v=a.l,_=a.r;if(ct(m,a.from)<0)return v?xi(v,f,m):a.l={from:f,to:m,d:1,l:null,r:null},Ua(a);if(0<ct(f,a.to))return _?xi(_,f,m):a.r={from:f,to:m,d:1,l:null,r:null},Ua(a);ct(f,a.from)<0&&(a.from=f,a.l=null,a.d=_?_.d+1:1),0<ct(m,a.to)&&(a.to=m,a.r=null,a.d=a.l?a.l.d+1:1),f=!a.r,v&&!a.l&&wi(a,v),_&&f&&wi(a,_)}}function wi(a,f){Qi(f)||(function m(v,_){var N=_.from,$=_.l,O=_.r;xi(v,N,_.to),$&&m(v,$),O&&m(v,O)})(a,f)}function Gi(a,f){var m=Ji(f),v=m.next();if(!v.done)for(var _=v.value,N=Ji(a),$=N.next(_.from),O=$.value;!v.done&&!$.done;){if(ct(O.from,_.to)<=0&&0<=ct(O.to,_.from))return!0;ct(_.from,O.from)<0?_=(v=m.next(O.from)).value:O=($=N.next(_.from)).value}return!1}function Ji(a){var f=Qi(a)?null:{s:0,n:a};return{next:function(m){for(var v=0<arguments.length;f;)switch(f.s){case 0:if(f.s=1,v)for(;f.n.l&&ct(m,f.n.from)<0;)f={up:f,n:f.n.l,s:1};else for(;f.n.l;)f={up:f,n:f.n.l,s:1};case 1:if(f.s=2,!v||ct(m,f.n.to)<=0)return{value:f.n,done:!1};case 2:if(f.n.r){f.s=3,f={up:f,n:f.n.r,s:0};continue}case 3:f=f.up}return{done:!0}}}}function Ua(a){var f,m,v,_=(((_=a.r)==null?void 0:_.d)||0)-(((_=a.l)==null?void 0:_.d)||0),_=1<_?"r":_<-1?"l":"";_&&(f=_=="r"?"l":"r",m=s({},a),v=a[_],a.from=v.from,a.to=v.to,a[_]=v[_],m[_]=v[f],(a[f]=m).d=Ka(m)),a.d=Ka(a)}function Ka(m){var f=m.r,m=m.l;return(f?m?Math.max(f.d,m.d):f.d:m?m.d:0)+1}function Zi(a,f){return d(f).forEach(function(m){a[m]?wi(a[m],f[m]):a[m]=(function v(_){var N,$,O={};for(N in _)x(_,N)&&($=_[N],O[N]=!$||typeof $!="object"||U.has($.constructor)?$:v($));return O})(f[m])}),a}function Bs(a,f){return a.all||f.all||Object.keys(a).some(function(m){return f[m]&&Gi(f[m],a[m])})}S(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(m){return xi(f,m,m)}),this},hasKey:function(a){var f=Ji(this).next(a).value;return f&&ct(f.from,a)<=0&&0<=ct(f.to,a)}})[J]=function(){return Ji(this)},Nt));var Kr={},Hs={},Vs=!1;function es(a){Zi(Hs,a),Vs||(Vs=!0,setTimeout(function(){Vs=!1,Us(Hs,!(Hs={}))},0))}function Us(a,f){f===void 0&&(f=!1);var m=new Set;if(a.all)for(var v=0,_=Object.values(Kr);v<_.length;v++)ts(O=_[v],a,m,f);else for(var N in a){var $,O,N=/^idb\:\/\/(.*)\/(.*)\//.exec(N);N&&($=N[1],N=N[2],O=Kr["idb://".concat($,"/").concat(N)])&&ts(O,a,m,f)}m.forEach(function(ee){return ee()})}function ts(a,f,m,v){for(var _=[],N=0,$=Object.entries(a.queries.query);N<$.length;N++){for(var O=$[N],ee=O[0],fe=[],ne=0,Z=O[1];ne<Z.length;ne++){var te=Z[ne];Bs(f,te.obsSet)?te.subscribers.forEach(function(ae){return m.add(ae)}):v&&fe.push(te)}v&&_.push([ee,fe])}if(v)for(var ue=0,ie=_;ue<ie.length;ue++){var oe=ie[ue],ee=oe[0],fe=oe[1];a.queries.query[ee]=fe}}function Du(a){var f=a._state,m=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 v=f.openCanceller,_=Math.round(10*a.verno),N=!1;function $(){if(f.openCanceller!==v)throw new ke.DatabaseClosed("db.open() was cancelled")}function O(){return new He(function(te,ue){if($(),!m)throw new ke.MissingAPI;var ie=a.name,oe=f.autoSchema||!_?m.open(ie):m.open(ie,_);if(!oe)throw new ke.MissingAPI;oe.onerror=ln(ue),oe.onblocked=Ne(a._fireOnBlocked),oe.onupgradeneeded=Ne(function(ae){var ge;ne=oe.transaction,f.autoSchema&&!a._options.allowEmptyDB?(oe.onerror=On,ne.abort(),oe.result.close(),(ge=m.deleteDatabase(ie)).onsuccess=ge.onerror=Ne(function(){ue(new ke.NoSuchDatabase("Database ".concat(ie," doesnt exist")))})):(ne.onerror=ln(ue),ge=ae.oldVersion>Math.pow(2,62)?0:ae.oldVersion,Z=ge<1,a.idbdb=oe.result,N&&Wi(a,ne),Fs(a,ge/10,ne,ue))},ue),oe.onsuccess=Ne(function(){ne=null;var ae,ge,de,xe,Ee,je,Le=a.idbdb=oe.result,Te=B(Le.objectStoreNames);if(0<Te.length)try{var Ue=Le.transaction((Ee=Te).length===1?Ee[0]:Ee,"readonly");if(f.autoSchema)je=Le,xe=Ue,(de=a).verno=je.version/10,xe=de._dbSchema=Gt(0,je,xe),de._storeNames=B(je.objectStoreNames,0),zo(de,[de._allTables],d(xe),xe);else if(br(a,a._dbSchema,Ue),ge=Ue,((ge=Yi(Gt(0,(ae=a).idbdb,ge),ae._dbSchema)).add.length||ge.change.some(function(De){return De.add.length||De.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."),Le.close(),_=Le.version+1,N=!0,te(O());fo(a,Ue)}catch{}po.add(a),Le.onversionchange=Ne(function(De){f.vcFired=!0,a.on("versionchange").fire(De)}),Le.onclose=Ne(function(){a.close({disableAutoOpen:!1})}),Z&&(Te=a._deps,Ee=ie,ho(je=Te.indexedDB)||Ee===zr||vi(je,Te.IDBKeyRange).put({name:Ee}).catch(Re)),te()},ue)}).catch(function(te){switch(te==null?void 0:te.name){case"UnknownError":if(0<f.PR1398_maxLoop)return f.PR1398_maxLoop--,console.warn("Dexie: Workaround for Chrome UnknownError on open()"),O();break;case"VersionError":if(0<_)return _=0,O()}return He.reject(te)})}var ee,fe=f.dbReadyResolve,ne=null,Z=!1;return He.race([v,(typeof navigator>"u"?He.resolve():!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise(function(te){function ue(){return indexedDB.databases().finally(te)}ee=setInterval(ue,100),ue()}).finally(function(){return clearInterval(ee)}):Promise.resolve()).then(O)]).then(function(){return $(),f.onReadyBeingFired=[],He.resolve(Ho(function(){return a.on.ready.fire(a.vip)})).then(function te(){var ue;if(0<f.onReadyBeingFired.length)return ue=f.onReadyBeingFired.reduce(Lt,Re),f.onReadyBeingFired=[],He.resolve(Ho(function(){return ue(a.vip)})).then(te)})}).finally(function(){f.openCanceller===v&&(f.onReadyBeingFired=null,f.isBeingOpened=!1)}).catch(function(te){f.dbOpenError=te;try{ne&&ne.abort()}catch{}return v===f.openCanceller&&a._close(),Et(te)}).finally(function(){f.openComplete=!0,fe()}).then(function(){var te;return Z&&(te={},a.tables.forEach(function(ue){ue.schema.indexes.forEach(function(ie){ie.name&&(te["idb://".concat(a.name,"/").concat(ue.name,"/").concat(ie.name)]=new Jt(-1/0,[[[]]]))}),te["idb://".concat(a.name,"/").concat(ue.name,"/")]=te["idb://".concat(a.name,"/").concat(ue.name,"/:dels")]=new Jt(-1/0,[[[]]])}),Rn(pi).fire(te),Us(te,!0)),a})}function Ks(a){function f(N){return a.next(N)}var m=_(f),v=_(function(N){return a.throw(N)});function _(N){return function(O){var O=N(O),ee=O.value;return O.done?ee:ee&&typeof ee.then=="function"?ee.then(m,v):h(ee)?Promise.all(ee).then(m,v):m(ee)}}return _(f)()}function ns(a,f,m){for(var v=h(a)?a.slice():[a],_=0;_<m;++_)v.push(f);return v}var qa={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function(a){return s(s({},a),{table:function(v){var m=a.table(v),v=m.schema,_={},N=[];function $(te,ue,ie){var de=hi(te),oe=_[de]=_[de]||[],ae=te==null?0:typeof te=="string"?1:te.length,ge=0<ue,de=s(s({},ie),{name:ge?"".concat(de,"(virtual-from:").concat(ie.name,")"):ie.name,lowLevelIndex:ie,isVirtual:ge,keyTail:ue,keyLength:ae,extractKey:uo(te),unique:!ge&&ie.unique});return oe.push(de),de.isPrimaryKey||N.push(de),1<ae&&$(ae===2?te[0]:te.slice(0,ae-1),ue+1,ie),oe.sort(function(xe,Ee){return xe.keyTail-Ee.keyTail}),de}var O=$(v.primaryKey.keyPath,0,v.primaryKey);_[":id"]=[O];for(var ee=0,fe=v.indexes;ee<fe.length;ee++){var ne=fe[ee];$(ne.keyPath,0,ne)}function Z(te){var ue,ie=te.query.index;return ie.isVirtual?s(s({},te),{query:{index:ie.lowLevelIndex,range:(ue=te.query.range,ie=ie.keyTail,{type:ue.type===1?2:ue.type,lower:ns(ue.lower,ue.lowerOpen?a.MAX_KEY:a.MIN_KEY,ie),lowerOpen:!0,upper:ns(ue.upper,ue.upperOpen?a.MIN_KEY:a.MAX_KEY,ie),upperOpen:!0})}}):te}return s(s({},m),{schema:s(s({},v),{primaryKey:O,indexes:N,getIndexByKeyPath:function(te){return(te=_[hi(te)])&&te[0]}}),count:function(te){return m.count(Z(te))},query:function(te){return m.query(Z(te))},openCursor:function(te){var ue=te.query.index,ie=ue.keyTail,oe=ue.keyLength;return ue.isVirtual?m.openCursor(Z(te)).then(function(ge){return ge&&ae(ge)}):m.openCursor(te);function ae(ge){return Object.create(ge,{continue:{value:function(de){de!=null?ge.continue(ns(de,te.reverse?a.MAX_KEY:a.MIN_KEY,ie)):te.unique?ge.continue(ge.key.slice(0,oe).concat(te.reverse?a.MIN_KEY:a.MAX_KEY,ie)):ge.continue()}},continuePrimaryKey:{value:function(de,xe){ge.continuePrimaryKey(ns(de,a.MAX_KEY,ie),xe)}},primaryKey:{get:function(){return ge.primaryKey}},key:{get:function(){var de=ge.key;return oe===1?de[0]:de.slice(0,oe)}},value:{get:function(){return ge.value}}})}}})}})}};function qs(a,f,m,v){return m=m||{},v=v||"",d(a).forEach(function(_){var N,$,O;x(f,_)?(N=a[_],$=f[_],typeof N=="object"&&typeof $=="object"&&N&&$?(O=ce(N))!==ce($)?m[v+_]=f[_]:O==="Object"?qs(N,$,m,v+_+"."):N!==$&&(m[v+_]=f[_]):N!==$&&(m[v+_]=f[_])):m[v+_]=void 0}),d(f).forEach(function(_){x(a,_)||(m[v+_]=f[_])}),m}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 m=a.table(f),v=m.schema.primaryKey;return s(s({},m),{mutate:function(_){var N=Ye.trans,$=N.table(f).hook,O=$.deleting,ee=$.creating,fe=$.updating;switch(_.type){case"add":if(ee.fire===Re)break;return N._promise("readwrite",function(){return ne(_)},!0);case"put":if(ee.fire===Re&&fe.fire===Re)break;return N._promise("readwrite",function(){return ne(_)},!0);case"delete":if(O.fire===Re)break;return N._promise("readwrite",function(){return ne(_)},!0);case"deleteRange":if(O.fire===Re)break;return N._promise("readwrite",function(){return(function Z(te,ue,ie){return m.query({trans:te,values:!1,query:{index:v,range:ue},limit:ie}).then(function(oe){var ae=oe.result;return ne({type:"delete",keys:ae,trans:te}).then(function(ge){return 0<ge.numFailures?Promise.reject(ge.failures[0]):ae.length<ie?{failures:[],numFailures:0,lastResult:void 0}:Z(te,s(s({},ue),{lower:ae[ae.length-1],lowerOpen:!0}),ie)})})})(_.trans,_.range,1e4)},!0)}return m.mutate(_);function ne(Z){var te,ue,ie,oe=Ye.trans,ae=Z.keys||Ws(v,Z);if(ae)return(Z=Z.type==="add"||Z.type==="put"?s(s({},Z),{keys:ae}):s({},Z)).type!=="delete"&&(Z.values=l([],Z.values)),Z.keys&&(Z.keys=l([],Z.keys)),te=m,ie=ae,((ue=Z).type==="add"?Promise.resolve([]):te.getMany({trans:ue.trans,keys:ie,cache:"immutable"})).then(function(ge){var de=ae.map(function(xe,Ee){var je,Le,Te,Ue=ge[Ee],De={onerror:null,onsuccess:null};return Z.type==="delete"?O.fire.call(De,xe,Ue,oe):Z.type==="add"||Ue===void 0?(je=ee.fire.call(De,xe,Z.values[Ee],oe),xe==null&&je!=null&&(Z.keys[Ee]=xe=je,v.outbound||Q(Z.values[Ee],v.keyPath,xe))):(je=qs(Ue,Z.values[Ee]),(Le=fe.fire.call(De,je,xe,Ue,oe))&&(Te=Z.values[Ee],Object.keys(Le).forEach(function(We){x(Te,We)?Te[We]=Le[We]:Q(Te,We,Le[We])}))),De});return m.mutate(Z).then(function(xe){for(var Ee=xe.failures,je=xe.results,Le=xe.numFailures,xe=xe.lastResult,Te=0;Te<ae.length;++Te){var Ue=(je||ae)[Te],De=de[Te];Ue==null?De.onerror&&De.onerror(Ee[Te]):De.onsuccess&&De.onsuccess(Z.type==="put"&&ge[Te]?Z.values[Te]:Ue)}return{failures:Ee,results:je,numFailures:Le,lastResult:xe}}).catch(function(xe){return de.forEach(function(Ee){return Ee.onerror&&Ee.onerror(xe)}),Promise.reject(xe)})});throw new Error("Keys missing")}}})}})}};function Wa(a,f,m){try{if(!f||f.keys.length<a.length)return null;for(var v=[],_=0,N=0;_<f.keys.length&&N<a.length;++_)ct(f.keys[_],a[N])===0&&(v.push(m?ve(f.values[_]):f.values[_]),++N);return v.length===a.length?v:null}catch{return null}}var zu={stack:"dbcore",level:-1,create:function(a){return{table:function(f){var m=a.table(f);return s(s({},m),{getMany:function(v){var _;return v.cache?(_=Wa(v.keys,v.trans._cache,v.cache==="clone"))?He.resolve(_):m.getMany(v).then(function(N){return v.trans._cache={keys:v.keys,values:v.cache==="clone"?ve(N):N},N}):m.getMany(v)},mutate:function(v){return v.type!=="add"&&(v.trans._cache=null),m.mutate(v)}})}}}};function Ya(a,f){return a.trans.mode==="readonly"&&!!a.subscr&&!a.trans.explicit&&a.trans.db._options.cache!=="disabled"&&!f.schema.primaryKey.outbound}function Xa(a,f){switch(a){case"query":return f.values&&!f.unique;case"get":case"getMany":case"count":case"openCursor":return!1}}var Ys={stack:"dbcore",level:0,name:"Observability",create:function(a){var f=a.schema.name,m=new Jt(a.MIN_KEY,a.MAX_KEY);return s(s({},a),{transaction:function(v,_,N){if(Ye.subscr&&_!=="readonly")throw new ke.ReadOnly("Readwrite transaction in liveQuery context. Querier source: ".concat(Ye.querier));return a.transaction(v,_,N)},table:function(v){function _(ae){var oe,ae=ae.query;return[oe=ae.index,new Jt((oe=(ae=ae.range).lower)!=null?oe:a.MIN_KEY,(oe=ae.upper)!=null?oe:a.MAX_KEY)]}var N=a.table(v),$=N.schema,O=$.primaryKey,ee=$.indexes,fe=O.extractKey,ne=O.outbound,Z=O.autoIncrement&&ee.filter(function(ie){return ie.compound&&ie.keyPath.includes(O.keyPath)}),te=s(s({},N),{mutate:function(ie){function oe(Ce){return Ce="idb://".concat(f,"/").concat(v,"/").concat(Ce),Ee[Ce]||(Ee[Ce]=new Jt)}var ae,ge,de,xe=ie.trans,Ee=ie.mutatedParts||(ie.mutatedParts={}),je=oe(""),Le=oe(":dels"),Te=ie.type,De=ie.type==="deleteRange"?[ie.range]:ie.type==="delete"?[ie.keys]:ie.values.length<50?[Ws(O,ie).filter(function(Ce){return Ce}),ie.values]:[],Ue=De[0],De=De[1],We=ie.trans._cache;return h(Ue)?(je.addKeys(Ue),(Te=Te==="delete"||Ue.length===De.length?Wa(Ue,We):null)||Le.addKeys(Ue),(Te||De)&&(ae=oe,ge=Te,de=De,$.indexes.forEach(function(Ce){var nt=ae(Ce.name||"");function rt(ft){return ft!=null?Ce.extractKey(ft):null}function at(ft){Ce.multiEntry&&h(ft)?ft.forEach(function(gn){return nt.addKey(gn)}):nt.addKey(ft)}(ge||de).forEach(function(ft,Ct){var st=ge&&rt(ge[Ct]),Ct=de&&rt(de[Ct]);ct(st,Ct)!==0&&(st!=null&&at(st),Ct!=null)&&at(Ct)})}))):Ue?(De={from:(We=Ue.lower)!=null?We:a.MIN_KEY,to:(Te=Ue.upper)!=null?Te:a.MAX_KEY},Le.add(De),je.add(De)):(je.add(m),Le.add(m),$.indexes.forEach(function(Ce){return oe(Ce.name).add(m)})),N.mutate(ie).then(function(Ce){return!Ue||ie.type!=="add"&&ie.type!=="put"||(je.addKeys(Ce.results),Z&&Z.forEach(function(nt){for(var rt=ie.values.map(function(st){return nt.extractKey(st)}),at=nt.keyPath.findIndex(function(st){return st===O.keyPath}),ft=0,gn=Ce.results.length;ft<gn;++ft)rt[ft][at]=Ce.results[ft];oe(nt.name).addKeys(rt)})),xe.mutatedParts=Zi(xe.mutatedParts||{},Ee),Ce})}}),ue={get:function(ie){return[O,new Jt(ie.key)]},getMany:function(ie){return[O,new Jt().addKeys(ie.keys)]},count:_,query:_,openCursor:_};return d(ue).forEach(function(ie){te[ie]=function(oe){var ae=Ye.subscr,ge=!!ae,de=Ya(Ye,N)&&Xa(ie,oe)?oe.obsSet={}:ae;if(ge){var xe,ae=function(De){return De="idb://".concat(f,"/").concat(v,"/").concat(De),de[De]||(de[De]=new Jt)},Ee=ae(""),je=ae(":dels"),ge=ue[ie](oe),Le=ge[0],ge=ge[1];if((ie==="query"&&Le.isPrimaryKey&&!oe.values?je:ae(Le.name||"")).add(ge),!Le.isPrimaryKey){if(ie!=="count")return xe=ie==="query"&&ne&&oe.values&&N.query(s(s({},oe),{values:!1})),N[ie].apply(this,arguments).then(function(De){if(ie==="query"){if(ne&&oe.values)return xe.then(function(rt){return rt=rt.result,Ee.addKeys(rt),De});var We=oe.values?De.result.map(fe):De.result;(oe.values?Ee:je).addKeys(We)}else{var Ce,nt;if(ie==="openCursor")return nt=oe.values,(Ce=De)&&Object.create(Ce,{key:{get:function(){return je.addKey(Ce.primaryKey),Ce.key}},primaryKey:{get:function(){var rt=Ce.primaryKey;return je.addKey(rt),rt}},value:{get:function(){return nt&&Ee.addKey(Ce.primaryKey),Ce.value}}})}return De});je.add(m)}}return N[ie].apply(this,arguments)}}),te}})}};function Vo(a,f,m){var v;return m.numFailures===0?f:f.type==="deleteRange"||(v=f.keys?f.keys.length:"values"in f&&f.values?f.values.length:1,m.numFailures===v)?null:(v=s({},f),h(v.keys)&&(v.keys=v.keys.filter(function(_,N){return!(N in m.failures)})),"values"in v&&h(v.values)&&(v.values=v.values.filter(function(_,N){return!(N in m.failures)})),v)}function Xs(a,f){return m=a,((v=f).lower===void 0||(v.lowerOpen?0<ct(m,v.lower):0<=ct(m,v.lower)))&&(m=a,(v=f).upper===void 0||(v.upperOpen?ct(m,v.upper)<0:ct(m,v.upper)<=0));var m,v}function Qs(a,f,m,v,_,N){var $,O,ee,fe,ne,Z,te;return!m||m.length===0||($=f.query.index,O=$.multiEntry,ee=f.query.range,fe=v.schema.primaryKey.extractKey,ne=$.extractKey,Z=($.lowLevelIndex||$).extractKey,(v=m.reduce(function(ue,ie){var oe=ue,ae=[];if(ie.type==="add"||ie.type==="put")for(var ge=new Jt,de=ie.values.length-1;0<=de;--de){var xe,Ee=ie.values[de],je=fe(Ee);!ge.hasKey(je)&&(xe=ne(Ee),O&&h(xe)?xe.some(function(We){return Xs(We,ee)}):Xs(xe,ee))&&(ge.addKey(je),ae.push(Ee))}switch(ie.type){case"add":var Le=new Jt().addKeys(f.values?ue.map(function(Ce){return fe(Ce)}):ue),oe=ue.concat(f.values?ae.filter(function(Ce){return Ce=fe(Ce),!Le.hasKey(Ce)&&(Le.addKey(Ce),!0)}):ae.map(function(Ce){return fe(Ce)}).filter(function(Ce){return!Le.hasKey(Ce)&&(Le.addKey(Ce),!0)}));break;case"put":var Te=new Jt().addKeys(ie.values.map(function(Ce){return fe(Ce)}));oe=ue.filter(function(Ce){return!Te.hasKey(f.values?fe(Ce):Ce)}).concat(f.values?ae:ae.map(function(Ce){return fe(Ce)}));break;case"delete":var Ue=new Jt().addKeys(ie.keys);oe=ue.filter(function(Ce){return!Ue.hasKey(f.values?fe(Ce):Ce)});break;case"deleteRange":var De=ie.range;oe=ue.filter(function(Ce){return!Xs(fe(Ce),De)})}return oe},a))===a)?a:(te=function(ue,ie){return ct(Z(ue),Z(ie))||ct(fe(ue),fe(ie))},v.sort(f.direction==="prev"||f.direction==="prevunique"?function(ue,ie){return te(ie,ue)}:te),f.limit&&f.limit<1/0&&(v.length>f.limit?v.length=f.limit:a.length===f.limit&&v.length<f.limit&&(_.dirty=!0)),N?Object.freeze(v):v)}function Gs(a,f){return ct(a.lower,f.lower)===0&&ct(a.upper,f.upper)===0&&!!a.lowerOpen==!!f.lowerOpen&&!!a.upperOpen==!!f.upperOpen}function Qa(a,f){return((m,v,_,N)=>{if(m===void 0)return v!==void 0?-1:0;if(v===void 0)return 1;if((m=ct(m,v))===0){if(_&&N)return 0;if(_)return 1;if(N)return-1}return m})(a.lower,f.lower,a.lowerOpen,f.lowerOpen)<=0&&0<=((m,v,_,N)=>{if(m===void 0)return v!==void 0?1:0;if(v===void 0)return-1;if((m=ct(m,v))===0){if(_&&N)return 0;if(_)return-1;if(N)return 1}return m})(a.upper,f.upper,a.upperOpen,f.upperOpen)}function Ga(a,f,m,v){a.subscribers.add(m),v.addEventListener("abort",function(){var _,N;a.subscribers.delete(m),a.subscribers.size===0&&(_=a,N=f,setTimeout(function(){_.subscribers.size===0&&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(m,v,_){var N,$,O=a.transaction(m,v,_);return v==="readwrite"&&(_=(N=new AbortController).signal,O.addEventListener("abort",($=function(ee){return function(){if(N.abort(),v==="readwrite"){for(var fe=new Set,ne=0,Z=m;ne<Z.length;ne++){var te=Z[ne],ue=Kr["idb://".concat(f,"/").concat(te)];if(ue){var ie=a.table(te),oe=ue.optimisticOps.filter(function(Ce){return Ce.trans===O});if(O._explicit&&ee&&O.mutatedParts)for(var ae=0,ge=Object.values(ue.queries.query);ae<ge.length;ae++)for(var de=0,xe=(Le=ge[ae]).slice();de<xe.length;de++)Bs((Te=xe[de]).obsSet,O.mutatedParts)&&(z(Le,Te),Te.subscribers.forEach(function(Ce){return fe.add(Ce)}));else if(0<oe.length){ue.optimisticOps=ue.optimisticOps.filter(function(Ce){return Ce.trans!==O});for(var Ee=0,je=Object.values(ue.queries.query);Ee<je.length;Ee++)for(var Le,Te,Ue,De=0,We=(Le=je[Ee]).slice();De<We.length;De++)(Te=We[De]).res!=null&&O.mutatedParts&&(ee&&!Te.dirty?(Ue=Object.isFrozen(Te.res),Ue=Qs(Te.res,Te.req,oe,ie,Te,Ue),Te.dirty?(z(Le,Te),Te.subscribers.forEach(function(Ce){return fe.add(Ce)})):Ue!==Te.res&&(Te.res=Ue,Te.promise=He.resolve({result:Ue}))):(Te.dirty&&z(Le,Te),Te.subscribers.forEach(function(Ce){return fe.add(Ce)})))}}}fe.forEach(function(Ce){return Ce()})}}})(!1),{signal:_}),O.addEventListener("error",$(!1),{signal:_}),O.addEventListener("complete",$(!0),{signal:_})),O},table:function(m){var v=a.table(m),_=v.schema.primaryKey;return s(s({},v),{mutate:function(N){var $,O=Ye.trans;return!_.outbound&&O.db._options.cache!=="disabled"&&!O.explicit&&O.idbtrans.mode==="readwrite"&&($=Kr["idb://".concat(f,"/").concat(m)])?(O=v.mutate(N),N.type!=="add"&&N.type!=="put"||!(50<=N.values.length||Ws(_,N).some(function(ee){return ee==null}))?($.optimisticOps.push(N),N.mutatedParts&&es(N.mutatedParts),O.then(function(ee){0<ee.numFailures&&(z($.optimisticOps,N),(ee=Vo(0,N,ee))&&$.optimisticOps.push(ee),N.mutatedParts)&&es(N.mutatedParts)}),O.catch(function(){z($.optimisticOps,N),N.mutatedParts&&es(N.mutatedParts)})):O.then(function(ee){var fe=Vo(0,s(s({},N),{values:N.values.map(function(ne,Z){var te;return ee.failures[Z]?ne:(Q(te=(te=_.keyPath)!=null&&te.includes(".")?ve(ne):s({},ne),_.keyPath,ee.results[Z]),te)})}),ee);$.optimisticOps.push(fe),queueMicrotask(function(){return N.mutatedParts&&es(N.mutatedParts)})}),O):v.mutate(N)},query:function(N){var $,O,ee,fe,ne,Z,te;return Ya(Ye,v)&&Xa("query",N)?($=((ee=Ye.trans)==null?void 0:ee.db._options.cache)==="immutable",O=(ee=Ye).requery,ee=ee.signal,Z=((ue,ie,oe,ae)=>{var ge=Kr["idb://".concat(ue,"/").concat(ie)];if(!ge)return[];if(!(ue=ge.queries[oe]))return[null,!1,ge,null];var de=ue[(ae.query?ae.query.index.name:null)||""];if(!de)return[null,!1,ge,null];switch(oe){case"query":var xe=(Ee=ae.direction)!=null?Ee:"next",Ee=de.find(function(je){var Le;return je.req.limit===ae.limit&&je.req.values===ae.values&&((Le=je.req.direction)!=null?Le:"next")===xe&&Gs(je.req.query.range,ae.query.range)});return Ee?[Ee,!0,ge,de]:[de.find(function(je){var Le;return("limit"in je.req?je.req.limit:1/0)>=ae.limit&&((Le=je.req.direction)!=null?Le:"next")===xe&&(!ae.values||je.req.values)&&Qa(je.req.query.range,ae.query.range)}),!1,ge,de];case"count":return Ee=de.find(function(je){return Gs(je.req.query.range,ae.query.range)}),[Ee,!!Ee,ge,de]}})(f,m,"query",N),te=Z[0],fe=Z[2],ne=Z[3],te&&Z[1]?te.obsSet=N.obsSet:(Z=v.query(N).then(function(ue){var ie=ue.result;if(te&&(te.res=ie),$){for(var oe=0,ae=ie.length;oe<ae;++oe)Object.freeze(ie[oe]);Object.freeze(ie)}else ue.result=ve(ie);return ue}).catch(function(ue){return ne&&te&&z(ne,te),Promise.reject(ue)}),te={obsSet:N.obsSet,promise:Z,subscribers:new Set,type:"query",req:N,dirty:!1},ne?ne.push(te):(ne=[te],(fe=fe||(Kr["idb://".concat(f,"/").concat(m)]={queries:{query:{},count:{}},objs:new Map,optimisticOps:[],unsignaledParts:{}})).queries.query[N.query.index.name||""]=ne)),Ga(te,ne,O,ee),te.promise.then(function(ue){return{result:Qs(ue.result,N,fe==null?void 0:fe.optimisticOps,v,te,$)}})):v.query(N)}})}})}};function _r(a,f){return new Proxy(a,{get:function(m,v,_){return v==="db"?f:Reflect.get(m,v,_)}})}Ot.prototype.version=function(a){if(isNaN(a)||a<.1)throw new ke.Type("Given version is not a positive number");if(a=Math.round(10*a)/10,this.idbdb||this._state.isBeingOpened)throw new ke.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,a);var f=this._versions,m=f.filter(function(v){return v._cfg.version===a})[0];return m||(m=new this.Version(a),f.push(m),f.sort(Ur),m.stores({}),this._state.autoSchema=!1),m},Ot.prototype._whenReady=function(a){var f=this;return this.idbdb&&(this._state.openComplete||Ye.letThrough||this._vip)?a():new He(function(m,v){if(f._state.openComplete)return v(new ke.DatabaseClosed(f._state.dbOpenError));if(!f._state.isBeingOpened){if(!f._state.autoOpen)return void v(new ke.DatabaseClosed);f.open().catch(Re)}f._state.dbReadyPromise.then(m,v)}).then(a)},Ot.prototype.use=function(_){var f=_.stack,m=_.create,v=_.level,_=_.name,N=(_&&this.unuse({stack:f,name:_}),this._middlewares[f]||(this._middlewares[f]=[]));return N.push({stack:f,create:m,level:v??10,name:_}),N.sort(function($,O){return $.level-O.level}),this},Ot.prototype.unuse=function(a){var f=a.stack,m=a.name,v=a.create;return f&&this._middlewares[f]&&(this._middlewares[f]=this._middlewares[f].filter(function(_){return v?_.create!==v:!!m&&_.name!==m})),this},Ot.prototype.open=function(){var a=this;return or(on,function(){return Du(a)})},Ot.prototype._close=function(){this.on.close.fire(new CustomEvent("close"));var a=this._state;if(po.remove(this),this.idbdb){try{this.idbdb.close()}catch{}this.idbdb=null}a.isBeingOpened||(a.dbReadyPromise=new He(function(f){a.dbReadyResolve=f}),a.openCanceller=new He(function(f,m){a.cancelOpen=m}))},Ot.prototype.close=function(f){var f=(f===void 0?{disableAutoOpen:!0}:f).disableAutoOpen,m=this._state;f?(m.isBeingOpened&&m.cancelOpen(new ke.DatabaseClosed),this._close(),m.autoOpen=!1,m.dbOpenError=new ke.DatabaseClosed):(this._close(),m.autoOpen=this._options.autoOpen||m.isBeingOpened,m.openComplete=!1,m.dbOpenError=null)},Ot.prototype.delete=function(a){var f=this,m=(a===void 0&&(a={disableAutoOpen:!0}),0<arguments.length&&typeof arguments[0]!="object"),v=this._state;return new He(function(_,N){function $(){f.close(a);var O=f._deps.indexedDB.deleteDatabase(f.name);O.onsuccess=Ne(function(){var ee,fe,ne;ee=f._deps,fe=f.name,ho(ne=ee.indexedDB)||fe===zr||vi(ne,ee.IDBKeyRange).delete(fe).catch(Re),_()}),O.onerror=ln(N),O.onblocked=f._fireOnBlocked}if(m)throw new ke.InvalidArgument("Invalid closeOptions argument to db.delete()");v.isBeingOpened?v.dbReadyPromise.then($):$()})},Ot.prototype.backendDB=function(){return this.idbdb},Ot.prototype.isOpen=function(){return this.idbdb!==null},Ot.prototype.hasBeenClosed=function(){var a=this._state.dbOpenError;return a&&a.name==="DatabaseClosed"},Ot.prototype.hasFailed=function(){return this._state.dbOpenError!==null},Ot.prototype.dynamicallyOpened=function(){return this._state.autoSchema},Object.defineProperty(Ot.prototype,"tables",{get:function(){var a=this;return d(this._allTables).map(function(f){return a._allTables[f]})},enumerable:!1,configurable:!0}),Ot.prototype.transaction=function(){var a=(function(f,m,v){var _=arguments.length;if(_<2)throw new ke.InvalidArgument("Too few arguments");for(var N=new Array(_-1);--_;)N[_-1]=arguments[_];return v=N.pop(),[f,we(N),v]}).apply(this,arguments);return this._transaction.apply(this,a)},Ot.prototype._transaction=function(a,f,m){var v,_,N=this,$=Ye.trans,O=($&&$.db===this&&a.indexOf("!")===-1||($=null),a.indexOf("?")!==-1);a=a.replace("!","").replace("?","");try{if(_=f.map(function(fe){if(fe=fe instanceof N.Table?fe.name:fe,typeof fe!="string")throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");return fe}),a=="r"||a===Oo)v=Oo;else{if(a!="rw"&&a!=Fr)throw new ke.InvalidArgument("Invalid transaction mode: "+a);v=Fr}if($){if($.mode===Oo&&v===Fr){if(!O)throw new ke.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");$=null}$&&_.forEach(function(fe){if($&&$.storeNames.indexOf(fe)===-1){if(!O)throw new ke.SubTransaction("Table "+fe+" not included in parent transaction.");$=null}}),O&&$&&!$.active&&($=null)}}catch(fe){return $?$._promise(null,function(ne,Z){Z(fe)}):Et(fe)}var ee=(function fe(ne,Z,te,ue,ie){return He.resolve().then(function(){var de=Ye.transless||Ye,oe=ne._createTransaction(Z,te,ne._dbSchema,ue),de=(oe.explicit=!0,{trans:oe,transless:de});if(ue)oe.idbtrans=ue.idbtrans;else try{oe.create(),oe.idbtrans._explicit=!0,ne._state.PR1398_maxLoop=3}catch(xe){return xe.name===_e.InvalidState&&ne.isOpen()&&0<--ne._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),ne.close({disableAutoOpen:!1}),ne.open().then(function(){return fe(ne,Z,te,null,ie)})):Et(xe)}var ae,ge=A(ie),de=(ge&&Cn(),He.follow(function(){var xe;(ae=ie.call(oe,oe))&&(ge?(xe=zt.bind(null,null),ae.then(xe,xe)):typeof ae.next=="function"&&typeof ae.throw=="function"&&(ae=Ks(ae)))},de));return(ae&&typeof ae.then=="function"?He.resolve(ae).then(function(xe){return oe.active?xe:Et(new ke.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))}):de.then(function(){return ae})).then(function(xe){return ue&&oe._resolve(),oe._completion.then(function(){return xe})}).catch(function(xe){return oe._reject(xe),Et(xe)})})}).bind(null,this,v,_,$,m);return $?$._promise(v,ee,"lock"):Ye.trans?or(Ye.transless,function(){return N._whenReady(ee)}):this._whenReady(ee)},Ot.prototype.table=function(a){if(x(this._allTables,a))return this._allTables[a];throw new ke.InvalidTable("Table ".concat(a," does not exist"))};var Sr=Ot;function Ot(a,f){var m,v,_,N,$,O=this,ee=(this._middlewares={},this.verno=0,Ot.dependencies),ee=(this._options=f=s({addons:Ot.addons,autoOpen:!0,indexedDB:ee.indexedDB,IDBKeyRange:ee.IDBKeyRange,cache:"cloned",maxConnections:1e3},f),this._deps={indexedDB:f.indexedDB,IDBKeyRange:f.IDBKeyRange},f.addons),fe=(this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null,this._novip=this,{dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:Re,dbReadyPromise:null,cancelOpen:Re,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3,autoOpen:f.autoOpen}),ne=(fe.dbReadyPromise=new He(function(Z){fe.dbReadyResolve=Z}),fe.openCanceller=new He(function(Z,te){fe.cancelOpen=te}),this._state=fe,this.name=a,this.on=Br(this,"populate","blocked","versionchange","close",{ready:[Lt,Re]}),this.once=function(Z,te){var ue=function(){for(var ie=[],oe=0;oe<arguments.length;oe++)ie[oe]=arguments[oe];O.on(Z).unsubscribe(ue),te.apply(O,ie)};return O.on(Z,ue)},this.on.ready.subscribe=P(this.on.ready.subscribe,function(Z){return function(te,ue){Ot.vip(function(){var ie,oe=O._state;oe.openComplete?(oe.dbOpenError||He.resolve().then(te),ue&&Z(te)):oe.onReadyBeingFired?(oe.onReadyBeingFired.push(te),ue&&Z(te)):(Z(te),ie=O,ue||Z(function ae(){ie.on.ready.unsubscribe(te),ie.on.ready.unsubscribe(ae)}))})}}),this.Collection=(m=this,so(Ba.prototype,function(ae,oe){this.db=m;var ue=fi,ie=null;if(oe)try{ue=oe()}catch(de){ie=de}var oe=ae._ctx,ae=oe.table,ge=ae.hook.reading.fire;this._ctx={table:ae,index:oe.index,isPrimKey:!oe.index||ae.schema.primKey.keyPath&&oe.index===ae.schema.primKey.name,range:ue,keysOnly:!1,dir:"next",unique:"",algorithm:null,filter:null,replayFilter:null,justLimit:!0,isMatch:null,offset:0,limit:1/0,error:ie,or:oe.or,valueMapper:ge!==qe?ge:null}})),this.Table=(v=this,so(Yn.prototype,function(Z,te,ue){this.db=v,this._tx=ue,this.name=Z,this.schema=te,this.hook=v._allTables[Z]?v._allTables[Z].hook:Br(null,{creating:[ot,Re],reading:[lt,qe],updating:[St,Re],deleting:[$t,Re]})})),this.Transaction=(_=this,so(Ou.prototype,function(Z,te,ue,ie,oe){var ae=this;Z!=="readonly"&&te.forEach(function(ge){ge=(ge=ue[ge])==null?void 0:ge.yProps,ge&&(te=te.concat(ge.map(function(de){return de.updatesTable})))}),this.db=_,this.mode=Z,this.storeNames=te,this.schema=ue,this.chromeTransactionDurability=ie,this.idbtrans=null,this.on=Br(this,"complete","error","abort"),this.parent=oe||null,this.active=!0,this._reculock=0,this._blockedFuncs=[],this._resolve=null,this._reject=null,this._waitingFor=null,this._waitingQueue=null,this._spinCount=0,this._completion=new He(function(ge,de){ae._resolve=ge,ae._reject=de}),this._completion.then(function(){ae.active=!1,ae.on.complete.fire()},function(ge){var de=ae.active;return ae.active=!1,ae.on.error.fire(ge),ae.parent?ae.parent._reject(ge):de&&ae.idbtrans&&ae.idbtrans.abort(),Et(ge)})})),this.Version=(N=this,so(yi.prototype,function(Z){this.db=N,this._cfg={version:Z,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}})),this.WhereClause=($=this,so(xr.prototype,function(Z,te,ue){if(this.db=$,this._ctx={table:Z,index:te===":id"?null:te,or:ue},this._cmp=this._ascending=ct,this._descending=function(ie,oe){return ct(oe,ie)},this._max=function(ie,oe){return 0<ct(ie,oe)?ie:oe},this._min=function(ie,oe){return ct(ie,oe)<0?ie:oe},this._IDBKeyRange=$._deps.IDBKeyRange,!this._IDBKeyRange)throw new ke.MissingAPI})),this.on("versionchange",function(Z){0<Z.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(Z){!Z.newVersion||Z.newVersion<Z.oldVersion?console.warn("Dexie.delete('".concat(O.name,"') was blocked")):console.warn("Upgrade '".concat(O.name,"' blocked by other connection holding version ").concat(Z.oldVersion/10))}),this._maxKey=wr(f.IDBKeyRange),this._createTransaction=function(Z,te,ue,ie){return new O.Transaction(Z,te,ue,O._options.chromeTransactionDurability,ie)},this._fireOnBlocked=function(Z){O.on("blocked").fire(Z),po.toArray().filter(function(te){return te.name===O.name&&te!==O&&!te._state.vcFired}).map(function(te){return te.on("versionchange").fire(Z)})},this.use(zu),this.use(Ja),this.use(Ys),this.use(qa),this.use(Lu),new Proxy(this,{get:function(Z,te,ue){var ie;return te==="_vip"||(te==="table"?function(oe){return _r(O.table(oe),ne)}:(ie=Reflect.get(Z,te,ue))instanceof Yn?_r(ie,ne):te==="tables"?ie.map(function(oe){return _r(oe,ne)}):te==="_createTransaction"?function(){return _r(ie.apply(this,arguments),ne)}:ie)}}));this.vip=ne,ee.forEach(function(Z){return Z(O)})}var rs,mo=typeof Symbol<"u"&&"observable"in Symbol?Symbol.observable:"@@observable",Za=(go.prototype.subscribe=function(a,f,m){return this._subscribe(a&&typeof a!="function"?a:{next:a,error:f,complete:m})},go.prototype[mo]=function(){return this},go);function go(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 Uo(a){var f,m=!1,v=new Za(function(_){var N=A(a),$,O=!1,ee={},fe={},ne={get closed(){return O},unsubscribe:function(){O||(O=!0,$&&$.abort(),Z&&Rn.storagemutated.unsubscribe(ie))}},Z=(_.start&&_.start(ne),!1),te=function(){return Ao(oe)};function ue(){return Bs(fe,ee)}var ie=function(ae){Zi(ee,ae),ue()&&te()},oe=function(){var ae,ge,de;!O&&rs.indexedDB&&(ee={},ae={},$&&$.abort(),$=new AbortController,de=(xe=>{var Ee=Nn();try{N&&Cn();var je=pn(a,xe);return je=N?je.finally(zt):je}finally{Ee&&En()}})(ge={subscr:ae,signal:$.signal,requery:te,querier:a,trans:null}),Z||(Rn(pi,ie),Z=!0),Promise.resolve(de).then(function(xe){m=!0,f=xe,O||ge.signal.aborted||(ue()||(fe=ae,ue())?te():(ee={},Ao(function(){return!O&&_.next&&_.next(xe)})))},function(xe){m=!1,["DatabaseClosedError","AbortError"].includes(xe==null?void 0:xe.name)||O||Ao(function(){O||_.error&&_.error(xe)})}))};return setTimeout(te,0),ne});return v.hasValue=function(){return m},v.getValue=function(){return f},v}var yo=Sr;function Ko(a){var f=kr;try{kr=!0,Rn.storagemutated.fire(a),Us(a,!0)}finally{kr=f}}S(yo,s(s({},V),{delete:function(a){return new yo(a,{addons:[]}).delete()},exists:function(a){return new yo(a,{addons:[]}).open().then(function(f){return f.close(),!0}).catch("NoSuchDatabaseError",function(){return!1})},getDatabaseNames:function(a){try{return f=yo.dependencies,m=f.indexedDB,f=f.IDBKeyRange,(ho(m)?Promise.resolve(m.databases()).then(function(v){return v.map(function(_){return _.name}).filter(function(_){return _!==zr})}):vi(m,f).toCollection().primaryKeys()).then(a)}catch{return Et(new ke.MissingAPI)}var f,m},defineClass:function(){return function(a){y(this,a)}},ignoreTransaction:function(a){return Ye.trans?or(Ye.transless||on,a):a()},vip:Ho,async:function(a){return function(){try{var f=Ks(a.apply(this,arguments));return f&&typeof f.then=="function"?f:He.resolve(f)}catch(m){return Et(m)}}},spawn:function(a,f,m){try{var v=Ks(a.apply(m,f||[]));return v&&typeof v.then=="function"?v:He.resolve(v)}catch(_){return Et(_)}},currentTransaction:{get:function(){return Ye.trans||null}},waitFor:function(a,f){return a=He.resolve(typeof a=="function"?yo.ignoreTransaction(a):a).timeout(f||6e4),Ye.trans?Ye.trans.waitFor(a):a},Promise:He,debug:{get:function(){return _t},set:function(a){dn(a)}},derive:M,extend:y,props:S,override:P,Events:Br,on:Rn,liveQuery:Uo,extendObservabilitySet:Zi,getByKeyPath:H,setByKeyPath:Q,delByKeyPath:function(a,f){typeof f=="string"?Q(a,f,void 0):"length"in f&&[].map.call(f,function(m){Q(a,m,void 0)})},shallowClone:G,deepClone:ve,getObjectDiff:qs,cmp:ct,asap:W,minKey:-1/0,addons:[],connections:{get:po.toArray},errnames:_e,dependencies:rs,cache:Kr,semVer:"4.4.2",version:"4.4.2".split(".").map(function(a){return parseInt(a)}).reduce(function(a,f,m){return a+f/Math.pow(10,2*m)})})),yo.maxKey=wr(yo.dependencies.IDBKeyRange),typeof dispatchEvent<"u"&&typeof addEventListener<"u"&&(Rn(pi,function(a){kr||(a=new CustomEvent(Ui,{detail:a}),kr=!0,dispatchEvent(a),kr=!1)}),addEventListener(Ui,function(a){a=a.detail,kr||Ko(a)}));var qo,kr=!1,os=function(){};return typeof BroadcastChannel<"u"&&((os=function(){(qo=new BroadcastChannel(Ui)).onmessage=function(a){return a.data&&Ko(a.data)}})(),typeof qo.unref=="function"&&qo.unref(),Rn(pi,function(a){kr||qo.postMessage(a)})),typeof addEventListener<"u"&&(addEventListener("pagehide",function(a){if(!Sr.disableBfCache&&a.persisted){_t&&console.debug("Dexie: handling persisted pagehide"),qo!=null&&qo.close();for(var f=0,m=po.toArray();f<m.length;f++)m[f].close({disableAutoOpen:!1})}}),addEventListener("pageshow",function(a){!Sr.disableBfCache&&a.persisted&&(_t&&console.debug("Dexie: handling persisted pageshow"),os(),Ko({all:new Jt(-1/0,[[]])}))})),He.rejectionMapper=function(a,f){return!a||a instanceof Se||a instanceof TypeError||a instanceof SyntaxError||!a.name||!Be[a.name]?a:(f=new Be[a.name](f||a.message,a),"stack"in a&&j(f,"stack",{get:function(){return this.inner.stack}}),f)},dn(_t),s(Sr,Object.freeze({__proto__:null,DEFAULT_MAX_CONNECTIONS:1e3,Dexie:Sr,Entity:jn,PropModification:ro,RangeSet:Jt,add:function(a){return new ro({add:a})},cmp:ct,default:Sr,liveQuery:Uo,mergeRanges:wi,rangesOverlap:Gi,remove:function(a){return new ro({remove:a})},replacePrefix:function(a,f){return new ro({replacePrefix:[a,f]})}}),{default:Sr}),Sr})})(eu)),eu.exports}var By=Fy();const wf=wu(By),nh=Symbol.for("Dexie"),lu=globalThis[nh]||(globalThis[nh]=wf);if(wf.semVer!==lu.semVer)throw new Error(`Two different versions of Dexie loaded in the same app: ${wf.semVer} and ${lu.semVer}`);const{liveQuery:Zk,mergeRanges:e2,rangesOverlap:t2,RangeSet:n2,cmp:r2,Entity:o2,PropModification:i2,replacePrefix:s2,add:a2,remove:l2,DexieYProvider:u2}=lu;class Hy 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 Hy;async function Vy(){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 Uy(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,h;const s=[],l=r===t.expectStatus;if(s.push(`HTTP ${r} ${l?"✓":`✗ (esperado ${t.expectStatus})`}`),!l)return{pass:!1,lines:s};if((d=t.contains)!=null&&d.trim()){const y=i.includes(t.contains);if(s.push(`Contiene texto "${t.contains}": ${y?"✓":"✗"}`),!y)return{pass:!1,lines:s}}const c=(h=t.jsonPath)==null?void 0:h.trim();if(c){let y;try{y=JSON.parse(i)}catch{return s.push("Body no es JSON válido: ✗"),{pass:!1,lines:s}}const b=Rf(y,c),k=t.expectJsonValue;if(k!==void 0&&k!==""){const x=b==null?String(b):typeof b=="object"?JSON.stringify(b):String(b),S=k.trim(),C=x===S||String(b)===S;if(s.push(`JSON path ${c} → ${x} vs "${S}": ${C?"✓":"✗"}`),!C)return{pass:!1,lines:s}}else{const x=b!=null;if(s.push(`JSON path ${c} existe: ${x?"✓":"✗"}`),!x)return{pass:!1,lines:s}}}return{pass:!0,lines:s}}function Ut(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=Ut(t[i]))!==""&&(r+=(r&&" ")+s);else for(let i in t)t[i]&&(r+=(r&&" ")+i);return r}var qy={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 Wy(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=Wy(t+"",i),l,c=-1,d=s.length;if(arguments.length<2){for(;++c<d;)if((l=(t=s[c]).type)&&(l=Yy(i[l],t.name)))return l;return}if(r!=null&&typeof r!="function")throw new Error("invalid callback: "+r);for(;++c<d;)if(l=(t=s[c]).type)i[l]=rh(i[l],t.name,r);else if(r==null)for(l in i)i[l]=rh(i[l],t.name,null);return this},copy:function(){var t={},r=this._;for(var i in r)t[i]=r[i].slice();return new tu(t)},call:function(t,r){if((l=arguments.length-2)>0)for(var i=new Array(l),s=0,l,c;s<l;++s)i[s]=arguments[s+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(c=this._[t],s=0,l=c.length;s<l;++s)c[s].value.apply(r,i)},apply:function(t,r,i){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var s=this._[t],l=0,c=s.length;l<c;++l)s[l].value.apply(r,i)}};function Yy(t,r){for(var i=0,s=t.length,l;i<s;++i)if((l=t[i]).name===r)return l.value}function rh(t,r,i){for(var s=0,l=t.length;s<l;++s)if(t[s].name===r){t[s]=qy,t=t.slice(0,s).concat(t.slice(s+1));break}return i!=null&&t.push({name:r,value:i}),t}var bf="http://www.w3.org/1999/xhtml";const oh={svg:"http://www.w3.org/2000/svg",xhtml:bf,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Nu(t){var r=t+="",i=r.indexOf(":");return i>=0&&(r=t.slice(0,i))!=="xmlns"&&(t=t.slice(i+1)),oh.hasOwnProperty(r)?{space:oh[r],local:t}:t}function Xy(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 Qy(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function Sm(t){var r=Nu(t);return(r.local?Qy:Xy)(r)}function Gy(){}function Df(t){return t==null?Gy:function(){return this.querySelector(t)}}function Jy(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,h=s[l]=new Array(d),y,b,k=0;k<d;++k)(y=c[k])&&(b=t.call(y,y.__data__,k,c))&&("__data__"in y&&(b.__data__=y.__data__),h[k]=b);return new er(s,this._parents)}function Zy(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function ev(){return[]}function km(t){return t==null?ev:function(){return this.querySelectorAll(t)}}function tv(t){return function(){return Zy(t.apply(this,arguments))}}function nv(t){typeof t=="function"?t=tv(t):t=km(t);for(var r=this._groups,i=r.length,s=[],l=[],c=0;c<i;++c)for(var d=r[c],h=d.length,y,b=0;b<h;++b)(y=d[b])&&(s.push(t.call(y,y.__data__,b,d)),l.push(y));return new er(s,l)}function Nm(t){return function(){return this.matches(t)}}function Em(t){return function(r){return r.matches(t)}}var rv=Array.prototype.find;function ov(t){return function(){return rv.call(this.children,t)}}function iv(){return this.firstElementChild}function sv(t){return this.select(t==null?iv:ov(typeof t=="function"?t:Em(t)))}var av=Array.prototype.filter;function lv(){return Array.from(this.children)}function uv(t){return function(){return av.call(this.children,t)}}function cv(t){return this.selectAll(t==null?lv:uv(typeof t=="function"?t:Em(t)))}function fv(t){typeof t!="function"&&(t=Nm(t));for(var r=this._groups,i=r.length,s=new Array(i),l=0;l<i;++l)for(var c=r[l],d=c.length,h=s[l]=[],y,b=0;b<d;++b)(y=c[b])&&t.call(y,y.__data__,b,c)&&h.push(y);return new er(s,this._parents)}function Cm(t){return new Array(t.length)}function dv(){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 pv(t){return function(){return t}}function hv(t,r,i,s,l,c){for(var d=0,h,y=r.length,b=c.length;d<b;++d)(h=r[d])?(h.__data__=c[d],s[d]=h):i[d]=new uu(t,c[d]);for(;d<y;++d)(h=r[d])&&(l[d]=h)}function mv(t,r,i,s,l,c,d){var h,y,b=new Map,k=r.length,x=c.length,S=new Array(k),C;for(h=0;h<k;++h)(y=r[h])&&(S[h]=C=d.call(y,y.__data__,h,r)+"",b.has(C)?l[h]=y:b.set(C,y));for(h=0;h<x;++h)C=d.call(t,c[h],h,c)+"",(y=b.get(C))?(s[h]=y,y.__data__=c[h],b.delete(C)):i[h]=new uu(t,c[h]);for(h=0;h<k;++h)(y=r[h])&&b.get(S[h])===y&&(l[h]=y)}function gv(t){return t.__data__}function yv(t,r){if(!arguments.length)return Array.from(this,gv);var i=r?mv:hv,s=this._parents,l=this._groups;typeof t!="function"&&(t=pv(t));for(var c=l.length,d=new Array(c),h=new Array(c),y=new Array(c),b=0;b<c;++b){var k=s[b],x=l[b],S=x.length,C=vv(t.call(k,k&&k.__data__,b,s)),j=C.length,M=h[b]=new Array(j),T=d[b]=new Array(j),I=y[b]=new Array(S);i(k,x,M,T,I,C,r);for(var B=0,P=0,R,W;B<j;++B)if(R=M[B]){for(B>=P&&(P=B+1);!(W=T[P])&&++P<j;);R._next=W||null}}return d=new er(d,s),d._enter=h,d._exit=y,d}function vv(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function xv(){return new er(this._exit||this._groups.map(Cm),this._parents)}function wv(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 bv(t){for(var r=t.selection?t.selection():t,i=this._groups,s=r._groups,l=i.length,c=s.length,d=Math.min(l,c),h=new Array(l),y=0;y<d;++y)for(var b=i[y],k=s[y],x=b.length,S=h[y]=new Array(x),C,j=0;j<x;++j)(C=b[j]||k[j])&&(S[j]=C);for(;y<l;++y)h[y]=i[y];return new er(h,this._parents)}function _v(){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 Sv(t){t||(t=kv);function r(x,S){return x&&S?t(x.__data__,S.__data__):!x-!S}for(var i=this._groups,s=i.length,l=new Array(s),c=0;c<s;++c){for(var d=i[c],h=d.length,y=l[c]=new Array(h),b,k=0;k<h;++k)(b=d[k])&&(y[k]=b);y.sort(r)}return new er(l,this._parents).order()}function kv(t,r){return t<r?-1:t>r?1:t>=r?0:NaN}function Nv(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function Ev(){return Array.from(this)}function Cv(){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 jv(){let t=0;for(const r of this)++t;return t}function Pv(){return!this.node()}function Mv(t){for(var r=this._groups,i=0,s=r.length;i<s;++i)for(var l=r[i],c=0,d=l.length,h;c<d;++c)(h=l[c])&&t.call(h,h.__data__,c,l);return this}function $v(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 Av(t,r){return function(){this.setAttributeNS(t.space,t.local,r)}}function Ov(t,r){return function(){var i=r.apply(this,arguments);i==null?this.removeAttribute(t):this.setAttribute(t,i)}}function Rv(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 Dv(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:$v:typeof r=="function"?i.local?Rv:Ov:i.local?Av:Iv)(i,r))}function jm(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function Lv(t){return function(){this.style.removeProperty(t)}}function zv(t,r,i){return function(){this.style.setProperty(t,r,i)}}function Fv(t,r,i){return function(){var s=r.apply(this,arguments);s==null?this.style.removeProperty(t):this.style.setProperty(t,s,i)}}function Bv(t,r,i){return arguments.length>1?this.each((r==null?Lv:typeof r=="function"?Fv:zv)(t,r,i??"")):Ps(this.node(),t)}function Ps(t,r){return t.style.getPropertyValue(r)||jm(t).getComputedStyle(t,null).getPropertyValue(r)}function Hv(t){return function(){delete this[t]}}function Vv(t,r){return function(){this[t]=r}}function Uv(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?Hv:typeof r=="function"?Uv:Vv)(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 $m(t,r){for(var i=Lf(t),s=-1,l=r.length;++s<l;)i.add(r[s])}function Tm(t,r){for(var i=Lf(t),s=-1,l=r.length;++s<l;)i.remove(r[s])}function qv(t){return function(){$m(this,t)}}function Wv(t){return function(){Tm(this,t)}}function Yv(t,r){return function(){(r.apply(this,arguments)?$m:Tm)(this,t)}}function Xv(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"?Yv:r?qv:Wv)(i,r))}function Qv(){this.textContent=""}function Gv(t){return function(){this.textContent=t}}function Jv(t){return function(){var r=t.apply(this,arguments);this.textContent=r??""}}function Zv(t){return arguments.length?this.each(t==null?Qv:(typeof t=="function"?Jv:Gv)(t)):this.node().textContent}function ex(){this.innerHTML=""}function tx(t){return function(){this.innerHTML=t}}function nx(t){return function(){var r=t.apply(this,arguments);this.innerHTML=r??""}}function rx(t){return arguments.length?this.each(t==null?ex:(typeof t=="function"?nx:tx)(t)):this.node().innerHTML}function ox(){this.nextSibling&&this.parentNode.appendChild(this)}function ix(){return this.each(ox)}function sx(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function ax(){return this.each(sx)}function lx(t){var r=typeof t=="function"?t:Sm(t);return this.select(function(){return this.appendChild(r.apply(this,arguments))})}function ux(){return null}function cx(t,r){var i=typeof t=="function"?t:Sm(t),s=r==null?ux:typeof r=="function"?r:Df(r);return this.select(function(){return this.insertBefore(i.apply(this,arguments),s.apply(this,arguments)||null)})}function fx(){var t=this.parentNode;t&&t.removeChild(this)}function dx(){return this.each(fx)}function px(){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 mx(t){return this.select(t?hx:px)}function gx(t){return arguments.length?this.property("__data__",t):this.node().__data__}function yx(t){return function(r){t.call(this,r,this.__data__)}}function vx(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 xx(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 wx(t,r,i){return function(){var s=this.__on,l,c=yx(r);if(s){for(var d=0,h=s.length;d<h;++d)if((l=s[d]).type===t.type&&l.name===t.name){this.removeEventListener(l.type,l.listener,l.options),this.addEventListener(l.type,l.listener=c,l.options=i),l.value=r;return}}this.addEventListener(t.type,c,i),l={type:t.type,name:t.name,value:r,listener:c,options:i},s?s.push(l):this.__on=[l]}}function bx(t,r,i){var s=vx(t+""),l,c=s.length,d;if(arguments.length<2){var h=this.node().__on;if(h){for(var y=0,b=h.length,k;y<b;++y)for(l=0,k=h[y];l<c;++l)if((d=s[l]).type===k.type&&d.name===k.name)return k.value}return}for(h=r?wx:xx,l=0;l<c;++l)this.each(h(s[l],r,i));return this}function Im(t,r,i){var s=jm(t),l=s.CustomEvent;typeof l=="function"?l=new l(r,i):(l=s.document.createEvent("Event"),i?(l.initEvent(r,i.bubbles,i.cancelable),l.detail=i.detail):l.initEvent(r,!1,!1)),t.dispatchEvent(l)}function _x(t,r){return function(){return Im(this,t,r)}}function Sx(t,r){return function(){return Im(this,t,r.apply(this,arguments))}}function kx(t,r){return this.each((typeof r=="function"?Sx:_x)(t,r))}function*Nx(){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 Ex(){return this}er.prototype=Aa.prototype={constructor:er,select:Jy,selectAll:nv,selectChild:sv,selectChildren:cv,filter:fv,data:yv,enter:dv,exit:xv,join:wv,merge:bv,selection:Ex,order:_v,sort:Sv,call:Nv,nodes:Ev,node:Cv,size:jv,empty:Pv,each:Mv,attr:Dv,style:Bv,property:Kv,classed:Xv,text:Zv,html:rx,raise:ix,lower:ax,append:lx,insert:cx,remove:dx,clone:mx,datum:gx,on:bx,dispatch:kx,[Symbol.iterator]:Nx};function Zn(t){return typeof t=="string"?new er([[document.querySelector(t)]],[document.documentElement]):new er([[t]],Am)}function Cx(t){let r;for(;r=t.sourceEvent;)t=r;return t}function Mr(t,r){if(t=Cx(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 jx={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 Ul=t=>()=>t;function _f(t,{sourceEvent:r,subject:i,target:s,identifier:l,active:c,x:d,y:h,dx:y,dy:b,dispatch:k}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:r,enumerable:!0,configurable:!0},subject:{value:i,enumerable:!0,configurable:!0},target:{value:s,enumerable:!0,configurable:!0},identifier:{value:l,enumerable:!0,configurable:!0},active:{value:c,enumerable:!0,configurable:!0},x:{value:d,enumerable:!0,configurable:!0},y:{value:h,enumerable:!0,configurable:!0},dx:{value:y,enumerable:!0,configurable:!0},dy:{value:b,enumerable:!0,configurable:!0},_:{value:k}})}_f.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};function Px(t){return!t.ctrlKey&&!t.button}function Mx(){return this.parentNode}function $x(t,r){return r??{x:t.x,y:t.y}}function Tx(){return navigator.maxTouchPoints||"ontouchstart"in this}function Dm(){var t=Px,r=Mx,i=$x,s=Tx,l={},c=ku("start","drag","end"),d=0,h,y,b,k,x=0;function S(R){R.on("mousedown.drag",C).filter(s).on("touchstart.drag",T).on("touchmove.drag",I,jx).on("touchend.drag touchcancel.drag",B).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function C(R,W){if(!(k||!t.call(this,R,W))){var H=P(this,r.call(this,R,W),R,W,"mouse");H&&(Zn(R.view).on("mousemove.drag",j,ka).on("mouseup.drag",M,ka),Om(R.view),nf(R),b=!1,h=R.clientX,y=R.clientY,H("start",R))}}function j(R){if(Cs(R),!b){var W=R.clientX-h,H=R.clientY-y;b=W*W+H*H>x}l.mouse("drag",R)}function M(R){Zn(R.view).on("mousemove.drag mouseup.drag",null),Rm(R.view,b),Cs(R),l.mouse("end",R)}function T(R,W){if(t.call(this,R,W)){var H=R.changedTouches,Q=r.call(this,R,W),G=H.length,pe,we;for(pe=0;pe<G;++pe)(we=P(this,Q,R,W,H[pe].identifier,H[pe]))&&(nf(R),we("start",R,H[pe]))}}function I(R){var W=R.changedTouches,H=W.length,Q,G;for(Q=0;Q<H;++Q)(G=l[W[Q].identifier])&&(Cs(R),G("drag",R,W[Q]))}function B(R){var W=R.changedTouches,H=W.length,Q,G;for(k&&clearTimeout(k),k=setTimeout(function(){k=null},500),Q=0;Q<H;++Q)(G=l[W[Q].identifier])&&(nf(R),G("end",R,W[Q]))}function P(R,W,H,Q,G,pe){var we=c.copy(),U=Mr(pe||H,W),le,ve,D;if((D=i.call(R,new _f("beforestart",{sourceEvent:H,target:S,identifier:G,active:d,x:U[0],y:U[1],dx:0,dy:0,dispatch:we}),Q))!=null)return le=D.x-U[0]||0,ve=D.y-U[1]||0,function ce(J,se,z){var K=U,F;switch(J){case"start":l[G]=ce,F=d++;break;case"end":delete l[G],--d;case"drag":U=Mr(z||se,W),F=d;break}we.call(J,R,new _f(J,{sourceEvent:se,subject:D,target:S,identifier:G,active:F,x:U[0]+le,y:U[1]+ve,dx:U[0]-K[0],dy:U[1]-K[1],dispatch:we}),Q)}}return S.filter=function(R){return arguments.length?(t=typeof R=="function"?R:Ul(!!R),S):t},S.container=function(R){return arguments.length?(r=typeof R=="function"?R:Ul(R),S):r},S.subject=function(R){return arguments.length?(i=typeof R=="function"?R:Ul(R),S):i},S.touchable=function(R){return arguments.length?(s=typeof R=="function"?R:Ul(!!R),S):s},S.on=function(){var R=c.on.apply(c,arguments);return R===c?S:R},S.clickDistance=function(R){return arguments.length?(x=(R=+R)*R,S):Math.sqrt(x)},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*",Gr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Ix=/^#([0-9a-f]{3,8})$/,Ax=new RegExp(`^rgb\\(${js},${js},${js}\\)$`),Ox=new RegExp(`^rgb\\(${Gr},${Gr},${Gr}\\)$`),Rx=new RegExp(`^rgba\\(${js},${js},${js},${Ea}\\)$`),Dx=new RegExp(`^rgba\\(${Gr},${Gr},${Gr},${Ea}\\)$`),Lx=new RegExp(`^hsl\\(${Ea},${Gr},${Gr}\\)$`),zx=new RegExp(`^hsla\\(${Ea},${Gr},${Gr},${Ea}\\)$`),ih={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};zf(Oa,Di,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:sh,formatHex:sh,formatHex8:Fx,formatHsl:Bx,formatRgb:ah,toString:ah});function sh(){return this.rgb().formatHex()}function Fx(){return this.rgb().formatHex8()}function Bx(){return zm(this).formatHsl()}function ah(){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?lh(r):i===3?new Vn(r>>8&15|r>>4&240,r>>4&15|r&240,(r&15)<<4|r&15,1):i===8?Kl(r>>24&255,r>>16&255,r>>8&255,(r&255)/255):i===4?Kl(r>>12&15|r>>8&240,r>>8&15|r>>4&240,r>>4&15|r&240,((r&15)<<4|r&15)/255):null):(r=Ax.exec(t))?new Vn(r[1],r[2],r[3],1):(r=Ox.exec(t))?new Vn(r[1]*255/100,r[2]*255/100,r[3]*255/100,1):(r=Rx.exec(t))?Kl(r[1],r[2],r[3],r[4]):(r=Dx.exec(t))?Kl(r[1]*255/100,r[2]*255/100,r[3]*255/100,r[4]):(r=Lx.exec(t))?fh(r[1],r[2]/100,r[3]/100,1):(r=zx.exec(t))?fh(r[1],r[2]/100,r[3]/100,r[4]):ih.hasOwnProperty(t)?lh(ih[t]):t==="transparent"?new Vn(NaN,NaN,NaN,0):null}function lh(t){return new Vn(t>>16&255,t>>8&255,t&255,1)}function Kl(t,r,i,s){return s<=0&&(t=r=i=NaN),new Vn(t,r,i,s)}function Hx(t){return t instanceof Oa||(t=Di(t)),t?(t=t.rgb(),new Vn(t.r,t.g,t.b,t.opacity)):new Vn}function Sf(t,r,i,s){return arguments.length===1?Hx(t):new Vn(t,r,i,s??1)}function Vn(t,r,i,s){this.r=+t,this.g=+r,this.b=+i,this.opacity=+s}zf(Vn,Sf,Lm(Oa,{brighter(t){return t=t==null?cu:Math.pow(cu,t),new Vn(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?Na:Math.pow(Na,t),new Vn(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Vn(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:uh,formatHex:uh,formatHex8:Vx,formatRgb:ch,toString:ch}));function uh(){return`#${Ai(this.r)}${Ai(this.g)}${Ai(this.b)}`}function Vx(){return`#${Ai(this.r)}${Ai(this.g)}${Ai(this.b)}${Ai((isNaN(this.opacity)?1:this.opacity)*255)}`}function ch(){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 fh(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,h=c-l,y=(c+l)/2;return h?(r===c?d=(i-s)/h+(i<s)*6:i===c?d=(s-r)/h+2:d=(r-i)/h+4,h/=y<.5?c+l:2-c-l,d*=60):h=y>0&&y<1?0:d,new $r(d,h,y,t.opacity)}function Ux(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,Ux,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 Vn(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(dh(this.h),ql(this.s),ql(this.l),fu(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=fu(this.opacity);return`${t===1?"hsl(":"hsla("}${dh(this.h)}, ${ql(this.s)*100}%, ${ql(this.l)*100}%${t===1?")":`, ${t})`}`}}));function dh(t){return t=(t||0)%360,t<0?t+360:t}function ql(t){return Math.max(0,Math.min(1,t||0))}function rf(t,r,i){return(t<60?r+(i-r)*t/60:t<180?i:t<240?r+(i-r)*(240-t)/60:r)*255}const Ff=t=>()=>t;function Kx(t,r){return function(i){return t+i*r}}function qx(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 Wx(t){return(t=+t)==1?Fm:function(r,i){return i-r?qx(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=Wx(r);function s(l,c){var d=i((l=Sf(l)).r,(c=Sf(c)).r),h=i(l.g,c.g),y=i(l.b,c.b),b=Fm(l.opacity,c.opacity);return function(k){return l.r=d(k),l.g=h(k),l.b=y(k),l.opacity=b(k),l+""}}return s.gamma=t,s})(1);function Yx(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 Xx(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function Qx(t,r){var i=r?r.length:0,s=t?Math.min(i,t.length):0,l=new Array(s),c=new Array(i),d;for(d=0;d<s;++d)l[d]=_a(t[d],r[d]);for(;d<i;++d)c[d]=r[d];return function(h){for(d=0;d<s;++d)c[d]=l[d](h);return c}}function Gx(t,r){var i=new Date;return t=+t,r=+r,function(s){return i.setTime(t*(1-s)+r*s),i}}function Qr(t,r){return t=+t,r=+r,function(i){return t*(1-i)+r*i}}function Jx(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 Zx(t){return function(){return t}}function ew(t){return function(r){return t(r)+""}}function Bm(t,r){var i=kf.lastIndex=of.lastIndex=0,s,l,c,d=-1,h=[],y=[];for(t=t+"",r=r+"";(s=kf.exec(t))&&(l=of.exec(r));)(c=l.index)>i&&(c=r.slice(i,c),h[d]?h[d]+=c:h[++d]=c),(s=s[0])===(l=l[0])?h[d]?h[d]+=l:h[++d]=l:(h[++d]=null,y.push({i:d,x:Qr(s,l)})),i=of.lastIndex;return i<r.length&&(c=r.slice(i),h[d]?h[d]+=c:h[++d]=c),h.length<2?y[0]?ew(y[0].x):Zx(r):(r=y.length,function(b){for(var k=0,x;k<r;++k)h[(x=y[k]).i]=x.x(b);return h.join("")})}function _a(t,r){var i=typeof r,s;return r==null||i==="boolean"?Ff(r):(i==="number"?Qr:i==="string"?(s=Di(r))?(r=s,du):Bm:r instanceof Di?du:r instanceof Date?Gx:Xx(r)?Yx:Array.isArray(r)?Qx:typeof r.valueOf!="function"&&typeof r.toString!="function"||isNaN(r)?Jx:Qr)(t,r)}var ph=180/Math.PI,Nf={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Hm(t,r,i,s,l,c){var d,h,y;return(d=Math.sqrt(t*t+r*r))&&(t/=d,r/=d),(y=t*i+r*s)&&(i-=t*y,s-=r*y),(h=Math.sqrt(i*i+s*s))&&(i/=h,s/=h,y/=h),t*s<r*i&&(t=-t,r=-r,y=-y,d=-d),{translateX:l,translateY:c,rotate:Math.atan2(r,t)*ph,skewX:Math.atan(y)*ph,scaleX:d,scaleY:h}}var Wl;function tw(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 nw(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,x,S,C,j){if(b!==x||k!==S){var M=C.push("translate(",null,r,null,i);j.push({i:M-4,x:Qr(b,x)},{i:M-2,x:Qr(k,S)})}else(x||S)&&C.push("translate("+x+r+S+i)}function d(b,k,x,S){b!==k?(b-k>180?k+=360:k-b>180&&(b+=360),S.push({i:x.push(l(x)+"rotate(",null,s)-2,x:Qr(b,k)})):k&&x.push(l(x)+"rotate("+k+s)}function h(b,k,x,S){b!==k?S.push({i:x.push(l(x)+"skewX(",null,s)-2,x:Qr(b,k)}):k&&x.push(l(x)+"skewX("+k+s)}function y(b,k,x,S,C,j){if(b!==x||k!==S){var M=C.push(l(C)+"scale(",null,",",null,")");j.push({i:M-4,x:Qr(b,x)},{i:M-2,x:Qr(k,S)})}else(x!==1||S!==1)&&C.push(l(C)+"scale("+x+","+S+")")}return function(b,k){var x=[],S=[];return b=t(b),k=t(k),c(b.translateX,b.translateY,k.translateX,k.translateY,x,S),d(b.rotate,k.rotate,x,S),h(b.skewX,k.skewX,x,S),y(b.scaleX,b.scaleY,k.scaleX,k.scaleY,x,S),b=k=null,function(C){for(var j=-1,M=S.length,T;++j<M;)x[(T=S[j]).i]=T.x(C);return x.join("")}}}var rw=Vm(tw,"px, ","px)","deg)"),ow=Vm(nw,", ",")",")"),iw=1e-12;function hh(t){return((t=Math.exp(t))+1/t)/2}function sw(t){return((t=Math.exp(t))-1/t)/2}function aw(t){return((t=Math.exp(2*t))-1)/(t+1)}const nu=(function t(r,i,s){function l(c,d){var h=c[0],y=c[1],b=c[2],k=d[0],x=d[1],S=d[2],C=k-h,j=x-y,M=C*C+j*j,T,I;if(M<iw)I=Math.log(S/b)/r,T=function(Q){return[h+Q*C,y+Q*j,b*Math.exp(r*Q*I)]};else{var B=Math.sqrt(M),P=(S*S-b*b+s*M)/(2*b*i*B),R=(S*S-b*b-s*M)/(2*S*i*B),W=Math.log(Math.sqrt(P*P+1)-P),H=Math.log(Math.sqrt(R*R+1)-R);I=(H-W)/r,T=function(Q){var G=Q*I,pe=hh(W),we=b/(i*B)*(pe*aw(r*G+W)-sw(W));return[h+we*C,y+we*j,b*pe/hh(r*G+W)]}}return T.duration=I*1e3*r/Math.SQRT2,T}return l.rho=function(c){var d=Math.max(.001,+c),h=d*d,y=h*h;return t(d,h,y)},l})(Math.SQRT2,2,4);var Ms=0,wa=0,va=0,Um=1e3,pu,ba,hu=0,Li=0,Eu=0,Ca=typeof performance=="object"&&performance.now?performance:Date,Km=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Bf(){return Li||(Km(lw),Li=Ca.now()+Eu)}function lw(){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:pu=this,ba=this),this._call=t,this._time=i,Ef()},stop:function(){this._call&&(this._call=null,this._time=1/0,Ef())}};function qm(t,r,i){var s=new mu;return s.restart(t,r,i),s}function uw(){Bf(),++Ms;for(var t=pu,r;t;)(r=Li-t._time)>=0&&t._call.call(void 0,r),t=t._next;--Ms}function mh(){Li=(hu=Ca.now())+Eu,Ms=wa=0;try{uw()}finally{Ms=0,fw(),Li=0}}function cw(){var t=Ca.now(),r=t-hu;r>Um&&(Eu-=r,hu=t)}function fw(){for(var t,r=pu,i,s=1/0;r;)r._call?(s>r._time&&(s=r._time),t=r,r=r._next):(i=r._next,r._next=null,r=t?t._next=i:pu=i);ba=t,Ef(s)}function Ef(t){if(!Ms){wa&&(wa=clearTimeout(wa));var r=t-Li;r>24?(t<1/0&&(wa=setTimeout(mh,t-Ca.now()-Eu)),va&&(va=clearInterval(va))):(va||(hu=Ca.now(),va=setInterval(cw,Um)),Ms=1,Km(mh))}}function gh(t,r,i){var s=new mu;return r=r==null?0:+r,s.restart(l=>{s.stop(),t(l+r)},r,i),s}var dw=ku("start","end","cancel","interrupt"),pw=[],Wm=0,yh=1,Cf=2,ru=3,vh=4,jf=5,ou=6;function Cu(t,r,i,s,l,c){var d=t.__transition;if(!d)t.__transition={};else if(i in d)return;hw(t,i,{name:r,index:s,group:l,on:dw,tween:pw,time:c.time,delay:c.delay,duration:c.duration,ease:c.ease,timer:null,state:Wm})}function Hf(t,r){var i=Ar(t,r);if(i.state>Wm)throw new Error("too late; already scheduled");return i}function eo(t,r){var i=Ar(t,r);if(i.state>ru)throw new Error("too late; already running");return i}function Ar(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=yh,i.timer.restart(d,i.delay,i.time),i.delay<=b&&d(b-i.delay)}function d(b){var k,x,S,C;if(i.state!==yh)return y();for(k in s)if(C=s[k],C.name===i.name){if(C.state===ru)return gh(d);C.state===vh?(C.state=ou,C.timer.stop(),C.on.call("interrupt",t,t.__data__,C.index,C.group),delete s[k]):+k<r&&(C.state=ou,C.timer.stop(),C.on.call("cancel",t,t.__data__,C.index,C.group),delete s[k])}if(gh(function(){i.state===ru&&(i.state=vh,i.timer.restart(h,i.delay,i.time),h(b))}),i.state=Cf,i.on.call("start",t,t.__data__,i.index,i.group),i.state===Cf){for(i.state=ru,l=new Array(S=i.tween.length),k=0,x=-1;k<S;++k)(C=i.tween[k].value.call(t,t.__data__,i.index,i.group))&&(l[++x]=C);l.length=x+1}}function h(b){for(var k=b<i.duration?i.ease.call(null,b/i.duration):(i.timer.restart(y),i.state=jf,1),x=-1,S=l.length;++x<S;)l[x].call(t,k);i.state===jf&&(i.on.call("end",t,t.__data__,i.index,i.group),y())}function y(){i.state=ou,i.timer.stop(),delete s[r];for(var b in s)return;delete t.__transition}}function iu(t,r){var i=t.__transition,s,l,c=!0,d;if(i){r=r==null?null:r+"";for(d in i){if((s=i[d]).name!==r){c=!1;continue}l=s.state>Cf&&s.state<jf,s.state=ou,s.timer.stop(),s.on.call(l?"interrupt":"cancel",t,t.__data__,s.index,s.group),delete i[d]}c&&delete t.__transition}}function mw(t){return this.each(function(){iu(this,t)})}function gw(t,r){var i,s;return function(){var l=eo(this,t),c=l.tween;if(c!==i){s=i=c;for(var d=0,h=s.length;d<h;++d)if(s[d].name===r){s=s.slice(),s.splice(d,1);break}}l.tween=s}}function yw(t,r,i){var s,l;if(typeof i!="function")throw new Error;return function(){var c=eo(this,t),d=c.tween;if(d!==s){l=(s=d).slice();for(var h={name:r,value:i},y=0,b=l.length;y<b;++y)if(l[y].name===r){l[y]=h;break}y===b&&l.push(h)}c.tween=l}}function vw(t,r){var i=this._id;if(t+="",arguments.length<2){for(var s=Ar(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?gw:yw)(i,t,r))}function Vf(t,r,i){var s=t._id;return t.each(function(){var l=eo(this,s);(l.value||(l.value={}))[r]=i.apply(this,arguments)}),function(l){return Ar(l,s).value[r]}}function Ym(t,r){var i;return(typeof r=="number"?Qr:r instanceof Di?du:(i=Di(r))?(r=i,du):Bm)(t,r)}function xw(t){return function(){this.removeAttribute(t)}}function ww(t){return function(){this.removeAttributeNS(t.space,t.local)}}function bw(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 _w(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 Sw(t,r,i){var s,l,c;return function(){var d,h=i(this),y;return h==null?void this.removeAttribute(t):(d=this.getAttribute(t),y=h+"",d===y?null:d===s&&y===l?c:(l=y,c=r(s=d,h)))}}function kw(t,r,i){var s,l,c;return function(){var d,h=i(this),y;return h==null?void this.removeAttributeNS(t.space,t.local):(d=this.getAttributeNS(t.space,t.local),y=h+"",d===y?null:d===s&&y===l?c:(l=y,c=r(s=d,h)))}}function Nw(t,r){var i=Nu(t),s=i==="transform"?ow:Ym;return this.attrTween(t,typeof r=="function"?(i.local?kw:Sw)(i,s,Vf(this,"attr."+t,r)):r==null?(i.local?ww:xw)(i):(i.local?_w:bw)(i,s,r))}function Ew(t,r){return function(i){this.setAttribute(t,r.call(this,i))}}function Cw(t,r){return function(i){this.setAttributeNS(t.space,t.local,r.call(this,i))}}function jw(t,r){var i,s;function l(){var c=r.apply(this,arguments);return c!==s&&(i=(s=c)&&Cw(t,c)),i}return l._value=r,l}function Pw(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 Mw(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?jw:Pw)(s,r))}function $w(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"?$w:Tw)(r,t)):Ar(this.node(),r).delay}function Aw(t,r){return function(){eo(this,t).duration=+r.apply(this,arguments)}}function Ow(t,r){return r=+r,function(){eo(this,t).duration=r}}function Rw(t){var r=this._id;return arguments.length?this.each((typeof t=="function"?Aw:Ow)(r,t)):Ar(this.node(),r).duration}function Dw(t,r){if(typeof r!="function")throw new Error;return function(){eo(this,t).ease=r}}function Lw(t){var r=this._id;return arguments.length?this.each(Dw(r,t)):Ar(this.node(),r).ease}function zw(t,r){return function(){var i=r.apply(this,arguments);if(typeof i!="function")throw new Error;eo(this,t).ease=i}}function Fw(t){if(typeof t!="function")throw new Error;return this.each(zw(this._id,t))}function Bw(t){typeof t!="function"&&(t=Nm(t));for(var r=this._groups,i=r.length,s=new Array(i),l=0;l<i;++l)for(var c=r[l],d=c.length,h=s[l]=[],y,b=0;b<d;++b)(y=c[b])&&t.call(y,y.__data__,b,c)&&h.push(y);return new $o(s,this._parents,this._name,this._id)}function Hw(t){if(t._id!==this._id)throw new Error;for(var r=this._groups,i=t._groups,s=r.length,l=i.length,c=Math.min(s,l),d=new Array(s),h=0;h<c;++h)for(var y=r[h],b=i[h],k=y.length,x=d[h]=new Array(k),S,C=0;C<k;++C)(S=y[C]||b[C])&&(x[C]=S);for(;h<s;++h)d[h]=r[h];return new $o(d,this._parents,this._name,this._id)}function Vw(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 Uw(t,r,i){var s,l,c=Vw(r)?Hf:eo;return function(){var d=c(this,t),h=d.on;h!==s&&(l=(s=h).copy()).on(r,i),d.on=l}}function Kw(t,r){var i=this._id;return arguments.length<2?Ar(this.node(),i).on.on(t):this.each(Uw(i,t,r))}function qw(t){return function(){var r=this.parentNode;for(var i in this.__transition)if(+i!==t)return;r&&r.removeChild(this)}}function Ww(){return this.on("end.remove",qw(this._id))}function Yw(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 h=s[d],y=h.length,b=c[d]=new Array(y),k,x,S=0;S<y;++S)(k=h[S])&&(x=t.call(k,k.__data__,S,h))&&("__data__"in k&&(x.__data__=k.__data__),b[S]=x,Cu(b[S],r,i,S,b,Ar(k,i)));return new $o(c,this._parents,r,i)}function Xw(t){var r=this._name,i=this._id;typeof t!="function"&&(t=km(t));for(var s=this._groups,l=s.length,c=[],d=[],h=0;h<l;++h)for(var y=s[h],b=y.length,k,x=0;x<b;++x)if(k=y[x]){for(var S=t.call(k,k.__data__,x,y),C,j=Ar(k,i),M=0,T=S.length;M<T;++M)(C=S[M])&&Cu(C,r,i,M,S,j);c.push(S),d.push(k)}return new $o(c,d,r,i)}var Qw=Aa.prototype.constructor;function Gw(){return new Qw(this._groups,this._parents)}function Jw(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 Zw(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 e1(t,r,i){var s,l,c;return function(){var d=Ps(this,t),h=i(this),y=h+"";return h==null&&(y=h=(this.style.removeProperty(t),Ps(this,t))),d===y?null:d===s&&y===l?c:(l=y,c=r(s=d,h))}}function t1(t,r){var i,s,l,c="style."+r,d="end."+c,h;return function(){var y=eo(this,t),b=y.on,k=y.value[c]==null?h||(h=Xm(r)):void 0;(b!==i||l!==k)&&(s=(i=b).copy()).on(d,l=k),y.on=s}}function n1(t,r,i){var s=(t+="")=="transform"?rw:Ym;return r==null?this.styleTween(t,Jw(t,s)).on("end.style."+t,Xm(t)):typeof r=="function"?this.styleTween(t,e1(t,s,Vf(this,"style."+t,r))).each(t1(this._id,t)):this.styleTween(t,Zw(t,s,r),i).on("end.style."+t,null)}function r1(t,r,i){return function(s){this.style.setProperty(t,r.call(this,s),i)}}function o1(t,r,i){var s,l;function c(){var d=r.apply(this,arguments);return d!==l&&(s=(l=d)&&r1(t,d,i)),s}return c._value=r,c}function i1(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,o1(t,r,i??""))}function s1(t){return function(){this.textContent=t}}function a1(t){return function(){var r=t(this);this.textContent=r??""}}function l1(t){return this.tween("text",typeof t=="function"?a1(Vf(this,"text",t)):s1(t==null?"":t+""))}function u1(t){return function(r){this.textContent=t.call(this,r)}}function c1(t){var r,i;function s(){var l=t.apply(this,arguments);return l!==i&&(r=(i=l)&&u1(l)),r}return s._value=t,s}function f1(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,c1(t))}function d1(){for(var t=this._name,r=this._id,i=Qm(),s=this._groups,l=s.length,c=0;c<l;++c)for(var d=s[c],h=d.length,y,b=0;b<h;++b)if(y=d[b]){var k=Ar(y,r);Cu(y,t,i,b,d,{time:k.time+k.delay+k.duration,delay:0,duration:k.duration,ease:k.ease})}return new $o(s,this._parents,t,i)}function p1(){var t,r,i=this,s=i._id,l=i.size();return new Promise(function(c,d){var h={value:d},y={value:function(){--l===0&&c()}};i.each(function(){var b=eo(this,s),k=b.on;k!==t&&(r=(t=k).copy(),r._.cancel.push(h),r._.interrupt.push(h),r._.end.push(y)),b.on=r}),l===0&&c()})}var h1=0;function $o(t,r,i,s){this._groups=t,this._parents=r,this._name=i,this._id=s}function Qm(){return++h1}var jo=Aa.prototype;$o.prototype={constructor:$o,select:Yw,selectAll:Xw,selectChild:jo.selectChild,selectChildren:jo.selectChildren,filter:Bw,merge:Hw,selection:Gw,transition:d1,call:jo.call,nodes:jo.nodes,node:jo.node,size:jo.size,empty:jo.empty,each:jo.each,on:Kw,attr:Nw,attrTween:Mw,style:n1,styleTween:i1,text:l1,textTween:f1,remove:Ww,tween:vw,delay:Iw,duration:Rw,ease:Lw,easeVarying:Fw,end:p1,[Symbol.iterator]:jo[Symbol.iterator]};function m1(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var g1={time:null,delay:0,duration:250,ease:m1};function y1(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 v1(t){var r,i;t instanceof $o?(r=t._id,t=t._name):(r=Qm(),(i=g1).time=Bf(),t=t==null?null:t+"");for(var s=this._groups,l=s.length,c=0;c<l;++c)for(var d=s[c],h=d.length,y,b=0;b<h;++b)(y=d[b])&&Cu(y,t,r,b,d,i||y1(y,r));return new $o(s,this._parents,t,r)}Aa.prototype.interrupt=mw;Aa.prototype.transition=v1;const Yl=t=>()=>t;function x1(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 Po(t,r,i){this.k=t,this.x=r,this.y=i}Po.prototype={constructor:Po,scale:function(t){return t===1?this:new Po(this.k*t,this.x,this.y)},translate:function(t,r){return t===0&r===0?this:new Po(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 Po(1,0,0);Gm.prototype=Po.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 w1(t){return(!t.ctrlKey||t.type==="wheel")&&!t.button}function b1(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t,t.hasAttribute("viewBox")?(t=t.viewBox.baseVal,[[t.x,t.y],[t.x+t.width,t.y+t.height]]):[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]):[[0,0],[t.clientWidth,t.clientHeight]]}function xh(){return this.__zoom||ju}function _1(t){return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function S1(){return navigator.maxTouchPoints||"ontouchstart"in this}function k1(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=w1,r=b1,i=k1,s=_1,l=S1,c=[0,1/0],d=[[-1/0,-1/0],[1/0,1/0]],h=250,y=nu,b=ku("start","zoom","end"),k,x,S,C=500,j=150,M=0,T=10;function I(D){D.property("__zoom",xh).on("wheel.zoom",G,{passive:!1}).on("mousedown.zoom",pe).on("dblclick.zoom",we).filter(l).on("touchstart.zoom",U).on("touchmove.zoom",le).on("touchend.zoom touchcancel.zoom",ve).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}I.transform=function(D,ce,J,se){var z=D.selection?D.selection():D;z.property("__zoom",xh),D!==z?W(D,ce,J,se):z.interrupt().each(function(){H(this,arguments).event(se).start().zoom(null,typeof ce=="function"?ce.apply(this,arguments):ce).end()})},I.scaleBy=function(D,ce,J,se){I.scaleTo(D,function(){var z=this.__zoom.k,K=typeof ce=="function"?ce.apply(this,arguments):ce;return z*K},J,se)},I.scaleTo=function(D,ce,J,se){I.transform(D,function(){var z=r.apply(this,arguments),K=this.__zoom,F=J==null?R(z):typeof J=="function"?J.apply(this,arguments):J,A=K.invert(F),V=typeof ce=="function"?ce.apply(this,arguments):ce;return i(P(B(K,V),F,A),z,d)},J,se)},I.translateBy=function(D,ce,J,se){I.transform(D,function(){return i(this.__zoom.translate(typeof ce=="function"?ce.apply(this,arguments):ce,typeof J=="function"?J.apply(this,arguments):J),r.apply(this,arguments),d)},null,se)},I.translateTo=function(D,ce,J,se,z){I.transform(D,function(){var K=r.apply(this,arguments),F=this.__zoom,A=se==null?R(K):typeof se=="function"?se.apply(this,arguments):se;return i(ju.translate(A[0],A[1]).scale(F.k).translate(typeof ce=="function"?-ce.apply(this,arguments):-ce,typeof J=="function"?-J.apply(this,arguments):-J),K,d)},se,z)};function B(D,ce){return ce=Math.max(c[0],Math.min(c[1],ce)),ce===D.k?D:new Po(ce,D.x,D.y)}function P(D,ce,J){var se=ce[0]-J[0]*D.k,z=ce[1]-J[1]*D.k;return se===D.x&&z===D.y?D:new Po(D.k,se,z)}function R(D){return[(+D[0][0]+ +D[1][0])/2,(+D[0][1]+ +D[1][1])/2]}function W(D,ce,J,se){D.on("start.zoom",function(){H(this,arguments).event(se).start()}).on("interrupt.zoom end.zoom",function(){H(this,arguments).event(se).end()}).tween("zoom",function(){var z=this,K=arguments,F=H(z,K).event(se),A=r.apply(z,K),V=J==null?R(A):typeof J=="function"?J.apply(z,K):J,be=Math.max(A[1][0]-A[0][0],A[1][1]-A[0][1]),Se=z.__zoom,$e=typeof ce=="function"?ce.apply(z,K):ce,Ae=y(Se.invert(V).concat(be/Se.k),$e.invert(V).concat(be/$e.k));return function(Oe){if(Oe===1)Oe=$e;else{var _e=Ae(Oe),Fe=be/_e[2];Oe=new Po(Fe,V[0]-_e[0]*Fe,V[1]-_e[1]*Fe)}F.zoom(null,Oe)}})}function H(D,ce,J){return!J&&D.__zooming||new Q(D,ce)}function Q(D,ce){this.that=D,this.args=ce,this.active=0,this.sourceEvent=null,this.extent=r.apply(D,ce),this.taps=0}Q.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,ce){return this.mouse&&D!=="mouse"&&(this.mouse[1]=ce.invert(this.mouse[0])),this.touch0&&D!=="touch"&&(this.touch0[1]=ce.invert(this.touch0[0])),this.touch1&&D!=="touch"&&(this.touch1[1]=ce.invert(this.touch1[0])),this.that.__zoom=ce,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(D){var ce=Zn(this.that).datum();b.call(D,this.that,new x1(D,{sourceEvent:this.sourceEvent,target:I,transform:this.that.__zoom,dispatch:b}),ce)}};function G(D,...ce){if(!t.apply(this,arguments))return;var J=H(this,ce).event(D),se=this.__zoom,z=Math.max(c[0],Math.min(c[1],se.k*Math.pow(2,s.apply(this,arguments)))),K=Mr(D);if(J.wheel)(J.mouse[0][0]!==K[0]||J.mouse[0][1]!==K[1])&&(J.mouse[1]=se.invert(J.mouse[0]=K)),clearTimeout(J.wheel);else{if(se.k===z)return;J.mouse=[K,se.invert(K)],iu(this),J.start()}xa(D),J.wheel=setTimeout(F,j),J.zoom("mouse",i(P(B(se,z),J.mouse[0],J.mouse[1]),J.extent,d));function F(){J.wheel=null,J.end()}}function pe(D,...ce){if(S||!t.apply(this,arguments))return;var J=D.currentTarget,se=H(this,ce,!0).event(D),z=Zn(D.view).on("mousemove.zoom",V,!0).on("mouseup.zoom",be,!0),K=Mr(D,J),F=D.clientX,A=D.clientY;Om(D.view),sf(D),se.mouse=[K,this.__zoom.invert(K)],iu(this),se.start();function V(Se){if(xa(Se),!se.moved){var $e=Se.clientX-F,Ae=Se.clientY-A;se.moved=$e*$e+Ae*Ae>M}se.event(Se).zoom("mouse",i(P(se.that.__zoom,se.mouse[0]=Mr(Se,J),se.mouse[1]),se.extent,d))}function be(Se){z.on("mousemove.zoom mouseup.zoom",null),Rm(Se.view,se.moved),xa(Se),se.event(Se).end()}}function we(D,...ce){if(t.apply(this,arguments)){var J=this.__zoom,se=Mr(D.changedTouches?D.changedTouches[0]:D,this),z=J.invert(se),K=J.k*(D.shiftKey?.5:2),F=i(P(B(J,K),se,z),r.apply(this,ce),d);xa(D),h>0?Zn(this).transition().duration(h).call(W,F,se,D):Zn(this).call(I.transform,F,se,D)}}function U(D,...ce){if(t.apply(this,arguments)){var J=D.touches,se=J.length,z=H(this,ce,D.changedTouches.length===se).event(D),K,F,A,V;for(sf(D),F=0;F<se;++F)A=J[F],V=Mr(A,this),V=[V,this.__zoom.invert(V),A.identifier],z.touch0?!z.touch1&&z.touch0[2]!==V[2]&&(z.touch1=V,z.taps=0):(z.touch0=V,K=!0,z.taps=1+!!k);k&&(k=clearTimeout(k)),K&&(z.taps<2&&(x=V[0],k=setTimeout(function(){k=null},C)),iu(this),z.start())}}function le(D,...ce){if(this.__zooming){var J=H(this,ce).event(D),se=D.changedTouches,z=se.length,K,F,A,V;for(xa(D),K=0;K<z;++K)F=se[K],A=Mr(F,this),J.touch0&&J.touch0[2]===F.identifier?J.touch0[0]=A:J.touch1&&J.touch1[2]===F.identifier&&(J.touch1[0]=A);if(F=J.that.__zoom,J.touch1){var be=J.touch0[0],Se=J.touch0[1],$e=J.touch1[0],Ae=J.touch1[1],Oe=(Oe=$e[0]-be[0])*Oe+(Oe=$e[1]-be[1])*Oe,_e=(_e=Ae[0]-Se[0])*_e+(_e=Ae[1]-Se[1])*_e;F=B(F,Math.sqrt(Oe/_e)),A=[(be[0]+$e[0])/2,(be[1]+$e[1])/2],V=[(Se[0]+Ae[0])/2,(Se[1]+Ae[1])/2]}else if(J.touch0)A=J.touch0[0],V=J.touch0[1];else return;J.zoom("touch",i(P(F,A,V),J.extent,d))}}function ve(D,...ce){if(this.__zooming){var J=H(this,ce).event(D),se=D.changedTouches,z=se.length,K,F;for(sf(D),S&&clearTimeout(S),S=setTimeout(function(){S=null},C),K=0;K<z;++K)F=se[K],J.touch0&&J.touch0[2]===F.identifier?delete J.touch0:J.touch1&&J.touch1[2]===F.identifier&&delete J.touch1;if(J.touch1&&!J.touch0&&(J.touch0=J.touch1,delete J.touch1),J.touch0)J.touch0[1]=this.__zoom.invert(J.touch0[0]);else if(J.end(),J.taps===2&&(F=Mr(F,this),Math.hypot(x[0]-F[0],x[1]-F[1])<T)){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?(h=+D,I):h},I.interpolate=function(D){return arguments.length?(y=D,I):y},I.on=function(){var D=b.on.apply(b,arguments);return D===b?I:D},I.clickDistance=function(D){return arguments.length?(M=(D=+D)*D,I):Math.sqrt(M)},I.tapDistance=function(D){return arguments.length?(T=+D,I):T},I}const Jr={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 $s;(function(t){t.Strict="strict",t.Loose="loose"})($s||($s={}));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 ui;(function(t){t.Bezier="default",t.Straight="straight",t.Step="step",t.SmoothStep="smoothstep",t.SimpleBezier="simplebezier"})(ui||(ui={}));var gu;(function(t){t.Arrow="arrow",t.ArrowClosed="arrowclosed"})(gu||(gu={}));var Ze;(function(t){t.Left="left",t.Top="top",t.Right="right",t.Bottom="bottom"})(Ze||(Ze={}));const wh={[Ze.Left]:Ze.Right,[Ze.Right]:Ze.Left,[Ze.Top]:Ze.Bottom,[Ze.Bottom]:Ze.Top};function n0(t){return t===null?null:t?"valid":"invalid"}const r0=t=>"id"in t&&"source"in t&&"target"in t,N1=t=>"id"in t&&"position"in t&&!("source"in t)&&!("target"in t),Uf=t=>"id"in t&&"internals"in t&&!("source"in t)&&!("target"in t),Ra=(t,r=[0,0])=>{const{width:i,height:s}=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}},E1=(t,r={nodeOrigin:[0,0]})=>{if(t.length===0)return{x:0,y:0,width:0,height:0};const i=t.reduce((s,l)=>{const c=typeof l=="string";let d=!r.nodeLookup&&!c?l:void 0;r.nodeLookup&&(d=c?r.nodeLookup.get(l):Uf(l)?l:r.nodeLookup.get(l.id));const h=d?yu(d,r.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Pu(s,h)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Mu(i)},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}},Kf=(t,r,[i,s,l]=[0,0,1],c=!1,d=!1)=>{const h={...za(r,[i,s,l]),width:r.width/l,height:r.height/l},y=[];for(const b of t.values()){const{measured:k,selectable:x=!0,hidden:S=!1}=b;if(d&&!x||S)continue;const C=k.width??b.width??b.initialWidth??null,j=k.height??b.height??b.initialHeight??null,M=Ma(h,Is(b)),T=(C??0)*(j??0),I=c&&M>0;(!b.internals.handleBounds||I||M>=T||b.dragging)&&y.push(b)}return y},C1=(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 j1(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 P1({nodes:t,width:r,height:i,panZoom:s,minZoom:l,maxZoom:c},d){if(t.size===0)return Promise.resolve(!0);const h=j1(t,d),y=Da(h),b=qf(y,r,i,(d==null?void 0:d.minZoom)??l,(d==null?void 0:d.maxZoom)??c,(d==null?void 0:d.padding)??.1);return await s.setViewport(b,{duration:d==null?void 0:d.duration,ease:d==null?void 0:d.ease,interpolate:d==null?void 0:d.interpolate}),Promise.resolve(!0)}function o0({nodeId:t,nextPosition:r,nodeLookup:i,nodeOrigin:s=[0,0],nodeExtent:l,onError:c}){const d=i.get(t),h=d.parentId?i.get(d.parentId):void 0,{x:y,y:b}=h?h.internals.positionAbsolute:{x:0,y:0},k=d.origin??s;let x=d.extent||l;if(d.extent==="parent"&&!d.expandParent)if(!h)c==null||c("005",Jr.error005());else{const C=h.measured.width,j=h.measured.height;C&&j&&(x=[[y,b],[y+C,b+j]])}else h&&As(d.extent)&&(x=[[d.extent[0][0]+y,d.extent[0][1]+b],[d.extent[1][0]+y,d.extent[1][1]+b]]);const S=As(x)?zi(r,x,d.measured):r;return(d.measured.width===void 0||d.measured.height===void 0)&&(c==null||c("015",Jr.error015())),{position:{x:S.x-y+(d.measured.width??0)*k[0],y:S.y-b+(d.measured.height??0)*k[1]},positionAbsolute:S}}async function M1({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(M=>M.id===S.parentId);(C||j)&&d.push(S)}const h=new Set(r.map(S=>S.id)),y=s.filter(S=>S.deletable!==!1),k=C1(d,y);for(const S of y)h.has(S.id)&&!k.find(j=>j.id===S.id)&&k.push(S);if(!l)return{edges:k,nodes:d};const x=await l({nodes:d,edges:k});return typeof x=="boolean"?x?{edges:k,nodes:d}:{edges:[],nodes:[]}:x}const Ts=(t,r=0,i=1)=>Math.min(Math.max(t,r),i),zi=(t={x:0,y:0},r,i)=>({x:Ts(t.x,r[0][0],r[1][0]-((i==null?void 0:i.width)??0)),y:Ts(t.y,r[0][1],r[1][1]-((i==null?void 0:i.height)??0))});function 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 bh=(t,r,i)=>t<r?Ts(Math.abs(t-r),1,r)/r:t>i?-Ts(Math.abs(t-i),1,r)/r:0,s0=(t,r,i=15,s=40)=>{const l=bh(t.x,s,r.width-s)*i,c=bh(t.y,s,r.height-s)*i;return[l,c]},Pu=(t,r)=>({x:Math.min(t.x,r.x),y:Math.min(t.y,r.y),x2:Math.max(t.x2,r.x2),y2:Math.max(t.y2,r.y2)}),Pf=({x:t,y:r,width:i,height:s})=>({x:t,y:r,x2:t+i,y2:r+s}),Mu=({x:t,y:r,x2:i,y2:s})=>({x:t,y:r,width:i-t,height:s-r}),Is=(t,r=[0,0])=>{var l,c;const{x:i,y:s}=Uf(t)?t.internals.positionAbsolute:Ra(t,r);return{x:i,y:s,width:((l=t.measured)==null?void 0:l.width)??t.width??t.initialWidth??0,height:((c=t.measured)==null?void 0:c.height)??t.height??t.initialHeight??0}},yu=(t,r=[0,0])=>{var l,c;const{x:i,y:s}=Uf(t)?t.internals.positionAbsolute:Ra(t,r);return{x:i,y:s,x2:i+(((l=t.measured)==null?void 0:l.width)??t.width??t.initialWidth??0),y2:s+(((c=t.measured)==null?void 0:c.height)??t.height??t.initialHeight??0)}},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)},_h=t=>Tr(t.width)&&Tr(t.height)&&Tr(t.x)&&Tr(t.y),Tr=t=>!isNaN(t)&&isFinite(t),$1=(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 h={x:(t-i)/l,y:(r-s)/l};return c?La(h,d):h},vu=({x:t,y:r},[i,s,l])=>({x:t*l+i,y:r*l+s});function _s(t,r){if(typeof t=="number")return Math.floor((r-r/(1+t))*.5);if(typeof t=="string"&&t.endsWith("px")){const i=parseFloat(t);if(!Number.isNaN(i))return Math.floor(i)}if(typeof t=="string"&&t.endsWith("%")){const i=parseFloat(t);if(!Number.isNaN(i))return Math.floor(r*i*.01)}return console.error(`[React Flow] The padding value "${t}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function 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:h}=vu(t,[r,i,s]),{x:y,y:b}=vu({x:t.x+t.width,y:t.y+t.height},[r,i,s]),k=l-y,x=c-b;return{left:Math.floor(d),top:Math.floor(h),right:Math.floor(k),bottom:Math.floor(x)}}const qf=(t,r,i,s,l,c)=>{const d=T1(c,r,i),h=(r-d.x)/t.width,y=(i-d.y)/t.height,b=Math.min(h,y),k=Ts(b,s,l),x=t.x+t.width/2,S=t.y+t.height/2,C=r/2-x*k,j=i/2-S*k,M=I1(t,C,j,k,r,i),T={left:Math.min(M.left-d.left,0),top:Math.min(M.top-d.top,0),right:Math.min(M.right-d.right,0),bottom:Math.min(M.bottom-d.bottom,0)};return{x:C-T.left+T.right,y:j-T.top+T.bottom,zoom:k}},$a=()=>{var t;return typeof navigator<"u"&&((t=navigator==null?void 0:navigator.userAgent)==null?void 0:t.indexOf("Mac"))>=0};function As(t){return t!=null&&t!=="parent"}function 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 h=d.origin||l;c.x+=d.internals.positionAbsolute.x-(r.width??0)*h[0],c.y+=d.internals.positionAbsolute.y-(r.height??0)*h[1]}return c}function Sh(t,r){if(t.size!==r.size)return!1;for(const i of t)if(!r.has(i))return!1;return!0}function A1(){let t,r;return{promise:new Promise((s,l)=>{t=s,r=l}),resolve:t,reject:r}}function O1(t){return{...e0,...t||{}}}function Sa(t,{snapGrid:r=[0,0],snapToGrid:i=!1,transform:s,containerBounds:l}){const{x:c,y:d}=Ir(t),h=za({x:c-((l==null?void 0:l.left)??0),y:d-((l==null?void 0:l.top)??0)},s),{x:y,y:b}=i?La(h,r):h;return{xSnapped:y,ySnapped:b,...h}}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)},R1=["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:R1.includes(r.nodeName)||r.hasAttribute("contenteditable")||!!r.closest(".nokey")}const d0=t=>"clientX"in t,Ir=(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)}},kh=(t,r,i,s,l)=>{const c=r.querySelectorAll(`.${t}`);return!c||!c.length?null:Array.from(c).map(d=>{const h=d.getBoundingClientRect();return{id:d.getAttribute("data-handleid"),type:t,nodeId:l,position:d.getAttribute("data-handlepos"),x:(h.left-i.left)/s,y:(h.top-i.top)/s,...Wf(d)}})};function p0({sourceX:t,sourceY:r,targetX:i,targetY:s,sourceControlX:l,sourceControlY:c,targetControlX:d,targetControlY:h}){const y=t*.125+l*.375+d*.375+i*.125,b=r*.125+c*.375+h*.375+s*.125,k=Math.abs(y-t),x=Math.abs(b-r);return[y,b,k,x]}function Xl(t,r){return t>=0?.5*t:r*25*Math.sqrt(-t)}function Nh({pos:t,x1:r,y1:i,x2:s,y2:l,c}){switch(t){case Ze.Left:return[r-Xl(r-s,c),i];case Ze.Right:return[r+Xl(s-r,c),i];case Ze.Top:return[r,i-Xl(i-l,c)];case Ze.Bottom:return[r,i+Xl(l-i,c)]}}function h0({sourceX:t,sourceY:r,sourcePosition:i=Ze.Bottom,targetX:s,targetY:l,targetPosition:c=Ze.Top,curvature:d=.25}){const[h,y]=Nh({pos:i,x1:t,y1:r,x2:s,y2:l,c:d}),[b,k]=Nh({pos:c,x1:s,y1:l,x2:t,y2:r,c:d}),[x,S,C,j]=p0({sourceX:t,sourceY:r,targetX:s,targetY:l,sourceControlX:h,sourceControlY:y,targetControlX:b,targetControlY:k});return[`M${t},${r} C${h},${y} ${b},${k} ${s},${l}`,x,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,h=s<r?s+d:s-d;return[c,h,l,d]}function D1({sourceNode:t,targetNode:r,selected:i=!1,zIndex:s=0,elevateOnSelect:l=!1,zIndexMode:c="basic"}){if(c==="manual")return s;const d=l&&i?s+1e3:s,h=Math.max(t.parentId||l&&t.selected?t.internals.z:0,r.parentId||l&&r.selected?r.internals.z:0);return d+h}function L1({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 z1=({source:t,sourceHandle:r,target:i,targetHandle:s})=>`xy-edge__${t}${r||""}-${i}${s||""}`,F1=(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||z1;let l;return r0(t)?l={...t}:l={...t,id:s(t)},F1(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,h]=m0({sourceX:t,sourceY:r,targetX:i,targetY:s});return[`M ${t},${r}L ${i},${s}`,l,c,d,h]}const Eh={[Ze.Left]:{x:-1,y:0},[Ze.Right]:{x:1,y:0},[Ze.Top]:{x:0,y:-1},[Ze.Bottom]:{x:0,y:1}},B1=({source:t,sourcePosition:r=Ze.Bottom,target:i})=>r===Ze.Left||r===Ze.Right?t.x<i.x?{x:1,y:0}:{x:-1,y:0}:t.y<i.y?{x:0,y:1}:{x:0,y:-1},Ch=(t,r)=>Math.sqrt(Math.pow(r.x-t.x,2)+Math.pow(r.y-t.y,2));function H1({source:t,sourcePosition:r=Ze.Bottom,target:i,targetPosition:s=Ze.Top,center:l,offset:c,stepPosition:d}){const h=Eh[r],y=Eh[s],b={x:t.x+h.x*c,y:t.y+h.y*c},k={x:i.x+y.x*c,y:i.y+y.y*c},x=B1({source:b,sourcePosition:r,target:k}),S=x.x!==0?"x":"y",C=x[S];let j=[],M,T;const I={x:0,y:0},B={x:0,y:0},[,,P,R]=m0({sourceX:t.x,sourceY:t.y,targetX:i.x,targetY:i.y});if(h[S]*y[S]===-1){S==="x"?(M=l.x??b.x+(k.x-b.x)*d,T=l.y??(b.y+k.y)/2):(M=l.x??(b.x+k.x)/2,T=l.y??b.y+(k.y-b.y)*d);const G=[{x:M,y:b.y},{x:M,y:k.y}],pe=[{x:b.x,y:T},{x:k.x,y:T}];h[S]===C?j=S==="x"?G:pe:j=S==="x"?pe:G}else{const G=[{x:b.x,y:k.y}],pe=[{x:k.x,y:b.y}];if(S==="x"?j=h.x===C?pe:G:j=h.y===C?G:pe,r===s){const D=Math.abs(t[S]-i[S]);if(D<=c){const ce=Math.min(c-1,c-D);h[S]===C?I[S]=(b[S]>t[S]?-1:1)*ce:B[S]=(k[S]>i[S]?-1:1)*ce}}if(r!==s){const D=S==="x"?"y":"x",ce=h[S]===y[D],J=b[D]>k[D],se=b[D]<k[D];(h[S]===1&&(!ce&&J||ce&&se)||h[S]!==1&&(!ce&&se||ce&&J))&&(j=S==="x"?G:pe)}const we={x:b.x+I.x,y:b.y+I.y},U={x:k.x+B.x,y:k.y+B.y},le=Math.max(Math.abs(we.x-j[0].x),Math.abs(U.x-j[0].x)),ve=Math.max(Math.abs(we.y-j[0].y),Math.abs(U.y-j[0].y));le>=ve?(M=(we.x+U.x)/2,T=j[0].y):(M=j[0].x,T=(we.y+U.y)/2)}const W={x:b.x+I.x,y:b.y+I.y},H={x:k.x+B.x,y:k.y+B.y};return[[t,...W.x!==j[0].x||W.y!==j[0].y?[W]:[],...j,...H.x!==j[j.length-1].x||H.y!==j[j.length-1].y?[H]:[],i],M,T,P,R]}function V1(t,r,i,s){const l=Math.min(Ch(t,r)/2,Ch(r,i)/2,s),{x:c,y:d}=r;if(t.x===c&&c===i.x||t.y===d&&d===i.y)return`L${c} ${d}`;if(t.y===d){const b=t.x<i.x?-1:1,k=t.y<i.y?1:-1;return`L ${c+l*b},${d}Q ${c},${d} ${c},${d+l*k}`}const h=t.x<i.x?1:-1,y=t.y<i.y?-1:1;return`L ${c},${d+l*y}Q ${c},${d} ${c+l*h},${d}`}function Mf({sourceX:t,sourceY:r,sourcePosition:i=Ze.Bottom,targetX:s,targetY:l,targetPosition:c=Ze.Top,borderRadius:d=5,centerX:h,centerY:y,offset:b=20,stepPosition:k=.5}){const[x,S,C,j,M]=H1({source:{x:t,y:r},sourcePosition:i,target:{x:s,y:l},targetPosition:c,center:{x:h,y},offset:b,stepPosition:k});let T=`M${x[0].x} ${x[0].y}`;for(let I=1;I<x.length-1;I++)T+=V1(x[I-1],x[I],x[I+1],d);return T+=`L${x[x.length-1].x} ${x[x.length-1].y}`,[T,S,C,j,M]}function jh(t){var r;return t&&!!(t.internals.handleBounds||(r=t.handles)!=null&&r.length)&&!!(t.measured.width||t.width||t.initialWidth)}function U1(t){var x;const{sourceNode:r,targetNode:i}=t;if(!jh(r)||!jh(i))return null;const s=r.internals.handleBounds||Ph(r.handles),l=i.internals.handleBounds||Ph(i.handles),c=Mh((s==null?void 0:s.source)??[],t.sourceHandle),d=Mh(t.connectionMode===$s.Strict?(l==null?void 0:l.target)??[]:((l==null?void 0:l.target)??[]).concat((l==null?void 0:l.source)??[]),t.targetHandle);if(!c||!d)return(x=t.onError)==null||x.call(t,"008",Jr.error008(c?"target":"source",{id:t.id,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle})),null;const h=(c==null?void 0:c.position)||Ze.Bottom,y=(d==null?void 0:d.position)||Ze.Top,b=Fi(r,c,h),k=Fi(i,d,y);return{sourceX:b.x,sourceY:b.y,targetX:k.x,targetY:k.y,sourcePosition:h,targetPosition:y}}function Ph(t){if(!t)return null;const r=[],i=[];for(const s of t)s.width=s.width??1,s.height=s.height??1,s.type==="source"?r.push(s):s.type==="target"&&i.push(s);return{source:r,target:i}}function 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:h}=r??To(t);if(s)return{x:l+d/2,y:c+h/2};switch((r==null?void 0:r.position)??i){case Ze.Top:return{x:l+d/2,y:c};case Ze.Right:return{x:l+d,y:c+h/2};case Ze.Bottom:return{x:l+d/2,y:c+h};case Ze.Left:return{x:l,y:c+h/2}}}function Mh(t,r){return t&&(r?t.find(i=>i.id===r):t[0])||null}function $f(t,r){return t?typeof t=="string"?t:`${r?`${r}__`:""}${Object.keys(t).sort().map(s=>`${s}=${t[s]}`).join("&")}`:""}function K1(t,{id:r,defaultColor:i,defaultMarkerStart:s,defaultMarkerEnd:l}){const c=new Set;return t.reduce((d,h)=>([h.markerStart||s,h.markerEnd||l].forEach(y=>{if(y&&typeof y=="object"){const b=$f(y,r);c.has(b)||(d.push({id:b,color:y.color||i,...y}),c.add(b))}}),d),[]).sort((d,h)=>d.id.localeCompare(h.id))}const v0=1e3,q1=10,Yf={nodeOrigin:[0,0],nodeExtent:ja,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},W1={...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 Y1(t,r,i){const s=Xf(Yf,i);for(const l of t.values())if(l.parentId)Gf(l,t,r,s);else{const c=Ra(l,s.nodeOrigin),d=As(l.extent)?l.extent:s.nodeExtent,h=zi(c,d,To(l));l.internals.positionAbsolute=h}}function X1(t,r){if(!t.handles)return t.measured?r==null?void 0:r.internals.handleBounds:void 0;const i=[],s=[];for(const l of t.handles){const c={id:l.id,width:l.width??1,height:l.height??1,nodeId:t.id,x:l.x,y:l.y,position:l.position,type:l.type};l.type==="source"?i.push(c):l.type==="target"&&s.push(c)}return{source:i,target:s}}function Qf(t){return t==="manual"}function Tf(t,r,i,s={}){var k,x;const l=Xf(W1,s),c={i:0},d=new Map(r),h=l!=null&&l.elevateNodesOnSelect&&!Qf(l.zIndexMode)?v0:0;let y=t.length>0,b=!1;r.clear(),i.clear();for(const S of t){let C=d.get(S.id);if(l.checkEquality&&S===(C==null?void 0:C.internals.userNode))r.set(S.id,C);else{const j=Ra(S,l.nodeOrigin),M=As(S.extent)?S.extent:l.nodeExtent,T=zi(j,M,To(S));C={...l.defaults,...S,measured:{width:(k=S.measured)==null?void 0:k.width,height:(x=S.measured)==null?void 0:x.height},internals:{positionAbsolute:T,handleBounds:X1(S,C),z:x0(S,h,l.zIndexMode),userNode:S}},r.set(S.id,C)}(C.measured===void 0||C.measured.width===void 0||C.measured.height===void 0)&&!C.hidden&&(y=!1),S.parentId&&Gf(C,r,i,s,c),b||(b=S.selected??!1)}return{nodesInitialized:y,hasSelectedNodes:b}}function Q1(t,r){if(!t.parentId)return;const i=r.get(t.parentId);i?i.set(t.id,t):r.set(t.parentId,new Map([[t.id,t]]))}function Gf(t,r,i,s,l){const{elevateNodesOnSelect:c,nodeOrigin:d,nodeExtent:h,zIndexMode:y}=Xf(Yf,s),b=t.parentId,k=r.get(b);if(!k){console.warn(`Parent node ${b} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}Q1(t,i),l&&!k.parentId&&k.internals.rootParentIndex===void 0&&y==="auto"&&(k.internals.rootParentIndex=++l.i,k.internals.z=k.internals.z+l.i*q1),l&&k.internals.rootParentIndex!==void 0&&(l.i=k.internals.rootParentIndex);const x=c&&!Qf(y)?v0:0,{x:S,y:C,z:j}=G1(t,k,d,h,x,y),{positionAbsolute:M}=t.internals,T=S!==M.x||C!==M.y;(T||j!==t.internals.z)&&r.set(t.id,{...t,internals:{...t.internals,positionAbsolute:T?{x:S,y:C}:M,z:j}})}function x0(t,r,i){const s=Tr(t.zIndex)?t.zIndex:0;return Qf(i)?s:s+(t.selected?r:0)}function G1(t,r,i,s,l,c){const{x:d,y:h}=r.internals.positionAbsolute,y=To(t),b=Ra(t,i),k=As(t.extent)?zi(b,t.extent,y):b;let x=zi({x:d+k.x,y:h+k.y},s,y);t.extent==="parent"&&(x=i0(x,y,r));const S=x0(t,l,c),C=r.internals.z??0;return{x:x.x,y:x.y,z:C>=S?C+1:S}}function Jf(t,r,i,s=[0,0]){var d;const l=[],c=new Map;for(const h of t){const y=r.get(h.parentId);if(!y)continue;const b=((d=c.get(h.parentId))==null?void 0:d.expandedRect)??Is(y),k=a0(b,h.rect);c.set(h.parentId,{expandedRect:k,parent:y})}return c.size>0&&c.forEach(({expandedRect:h,parent:y},b)=>{var P;const k=y.internals.positionAbsolute,x=To(y),S=y.origin??s,C=h.x<k.x?Math.round(Math.abs(k.x-h.x)):0,j=h.y<k.y?Math.round(Math.abs(k.y-h.y)):0,M=Math.max(x.width,Math.round(h.width)),T=Math.max(x.height,Math.round(h.height)),I=(M-x.width)*S[0],B=(T-x.height)*S[1];(C>0||j>0||I||B)&&(l.push({id:b,type:"position",position:{x:y.position.x-C+I,y:y.position.y-j+B}}),(P=i.get(b))==null||P.forEach(R=>{t.some(W=>W.id===R.id)||l.push({id:R.id,type:"position",position:{x:R.position.x+C,y:R.position.y+j}})})),(x.width<h.width||x.height<h.height||C||j)&&l.push({id:b,type:"dimensions",setAttributes:!0,dimensions:{width:M+(C?S[0]*C-I:0),height:T+(j?S[1]*j-B:0)}})}),l}function J1(t,r,i,s,l,c,d){const h=s==null?void 0:s.querySelector(".xyflow__viewport");let y=!1;if(!h)return{changes:[],updatedInternals:y};const b=[],k=window.getComputedStyle(h),{m22:x}=new window.DOMMatrixReadOnly(k.transform),S=[];for(const C of t.values()){const j=r.get(C.id);if(!j)continue;if(j.hidden){r.set(j.id,{...j,internals:{...j.internals,handleBounds:void 0}}),y=!0;continue}const M=Wf(C.nodeElement),T=j.measured.width!==M.width||j.measured.height!==M.height;if(!!(M.width&&M.height&&(T||!j.internals.handleBounds||C.force))){const B=C.nodeElement.getBoundingClientRect(),P=As(j.extent)?j.extent:c;let{positionAbsolute:R}=j.internals;j.parentId&&j.extent==="parent"?R=i0(R,M,r.get(j.parentId)):P&&(R=zi(R,P,M));const W={...j,measured:M,internals:{...j.internals,positionAbsolute:R,handleBounds:{source:kh("source",C.nodeElement,B,x,j.id),target:kh("target",C.nodeElement,B,x,j.id)}}};r.set(j.id,W),j.parentId&&Gf(W,r,i,{nodeOrigin:l,zIndexMode:d}),y=!0,T&&(b.push({id:j.id,type:"dimensions",dimensions:M}),j.expandParent&&j.parentId&&S.push({id:j.id,parentId:j.parentId,rect:Is(W,l)}))}}if(S.length>0){const C=Jf(S,r,i,l);b.push(...C)}return{changes:b,updatedInternals:y}}async function Z1({delta:t,panZoom:r,transform:i,translateExtent:s,width:l,height:c}){if(!r||!t.x&&!t.y)return Promise.resolve(!1);const d=await r.setViewportConstrained({x:i[0]+t.x,y:i[1]+t.y,zoom:i[2]},[[0,0],[l,c]],s),h=!!d&&(d.x!==i[0]||d.y!==i[1]||d.k!==i[2]);return Promise.resolve(h)}function $h(t,r,i,s,l,c){let d=l;const h=s.get(d)||new Map;s.set(d,h.set(i,r)),d=`${l}-${t}`;const y=s.get(d)||new Map;if(s.set(d,y.set(i,r)),c){d=`${l}-${t}-${c}`;const b=s.get(d)||new Map;s.set(d,b.set(i,r))}}function w0(t,r,i){t.clear(),r.clear();for(const s of i){const{source:l,target:c,sourceHandle:d=null,targetHandle:h=null}=s,y={edgeId:s.id,source:l,target:c,sourceHandle:d,targetHandle:h},b=`${l}-${d}--${c}-${h}`,k=`${c}-${h}--${l}-${d}`;$h("source",y,k,t,l,d),$h("target",y,b,t,c,h),r.set(s.id,s)}}function b0(t,r){if(!t.parentId)return!1;const i=r.get(t.parentId);return i?i.selected?!0:b0(i,r):!1}function Th(t,r,i){var l;let s=t;do{if((l=s==null?void 0:s.matches)!=null&&l.call(s,r))return!0;if(s===i)return!1;s=s==null?void 0:s.parentElement}while(s);return!1}function eb(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 h=t.get(c);h&&l.set(c,{id:c,position:h.position||{x:0,y:0},distance:{x:i.x-h.internals.positionAbsolute.x,y:i.y-h.internals.positionAbsolute.y},extent:h.extent,parentId:h.parentId,origin:h.origin,expandParent:h.expandParent,internals:{positionAbsolute:h.internals.positionAbsolute||{x:0,y:0}},measured:{width:h.measured.width??0,height:h.measured.height??0}})}return l}function af({nodeId:t,dragItems:r,nodeLookup:i,dragging:s=!0}){var d,h,y;const l=[];for(const[b,k]of r){const x=(d=i.get(b))==null?void 0:d.internals.userNode;x&&l.push({...x,position:k.position,dragging:s})}if(!t)return[l[0],l];const c=(h=i.get(t))==null?void 0:h.internals.userNode;return[c?{...c,position:((y=r.get(t))==null?void 0:y.position)||c.position,dragging:s}:l[0],l]}function tb({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 nb({onNodeMouseDown:t,getStoreItems:r,onDragStart:i,onDrag:s,onDragStop:l}){let c={x:null,y:null},d=0,h=new Map,y=!1,b={x:0,y:0},k=null,x=!1,S=null,C=!1,j=!1,M=null;function T({noDragClassName:B,handleSelector:P,domNode:R,isSelectable:W,nodeId:H,nodeClickDistance:Q=0}){S=Zn(R);function G({x:le,y:ve}){const{nodeLookup:D,nodeExtent:ce,snapGrid:J,snapToGrid:se,nodeOrigin:z,onNodeDrag:K,onSelectionDrag:F,onError:A,updateNodePositions:V}=r();c={x:le,y:ve};let be=!1;const Se=h.size>1,$e=Se&&ce?Pf(Da(h)):null,Ae=Se&&se?tb({dragItems:h,snapGrid:J,x:le,y:ve}):null;for(const[Oe,_e]of h){if(!D.has(Oe))continue;let Fe={x:le-_e.distance.x,y:ve-_e.distance.y};se&&(Fe=Ae?{x:Math.round(Fe.x+Ae.x),y:Math.round(Fe.y+Ae.y)}:La(Fe,J));let ke=null;if(Se&&ce&&!_e.extent&&$e){const{positionAbsolute:qe}=_e.internals,lt=qe.x-$e.x+ce[0][0],ut=qe.x+_e.measured.width-$e.x2+ce[1][0],ot=qe.y-$e.y+ce[0][1],$t=qe.y+_e.measured.height-$e.y2+ce[1][1];ke=[[lt,ot],[ut,$t]]}const{position:Be,positionAbsolute:Re}=o0({nodeId:Oe,nextPosition:Fe,nodeLookup:D,nodeExtent:ke||ce,nodeOrigin:z,onError:A});be=be||_e.position.x!==Be.x||_e.position.y!==Be.y,_e.position=Be,_e.internals.positionAbsolute=Re}if(j=j||be,!!be&&(V(h,!0),M&&(s||K||!H&&F))){const[Oe,_e]=af({nodeId:H,dragItems:h,nodeLookup:D});s==null||s(M,h,Oe,_e),K==null||K(M,Oe,_e),H||F==null||F(M,_e)}}async function pe(){if(!k)return;const{transform:le,panBy:ve,autoPanSpeed:D,autoPanOnNodeDrag:ce}=r();if(!ce){y=!1,cancelAnimationFrame(d);return}const[J,se]=s0(b,k,D);(J!==0||se!==0)&&(c.x=(c.x??0)-J/le[2],c.y=(c.y??0)-se/le[2],await ve({x:J,y:se})&&G(c)),d=requestAnimationFrame(pe)}function we(le){var Se;const{nodeLookup:ve,multiSelectionActive:D,nodesDraggable:ce,transform:J,snapGrid:se,snapToGrid:z,selectNodesOnDrag:K,onNodeDragStart:F,onSelectionDragStart:A,unselectNodesAndEdges:V}=r();x=!0,(!K||!W)&&!D&&H&&((Se=ve.get(H))!=null&&Se.selected||V()),W&&K&&H&&(t==null||t(H));const be=Sa(le.sourceEvent,{transform:J,snapGrid:se,snapToGrid:z,containerBounds:k});if(c=be,h=eb(ve,ce,be,H),h.size>0&&(i||F||!H&&A)){const[$e,Ae]=af({nodeId:H,dragItems:h,nodeLookup:ve});i==null||i(le.sourceEvent,h,$e,Ae),F==null||F(le.sourceEvent,$e,Ae),H||A==null||A(le.sourceEvent,Ae)}}const U=Dm().clickDistance(Q).on("start",le=>{const{domNode:ve,nodeDragThreshold:D,transform:ce,snapGrid:J,snapToGrid:se}=r();k=(ve==null?void 0:ve.getBoundingClientRect())||null,C=!1,j=!1,M=le.sourceEvent,D===0&&we(le),c=Sa(le.sourceEvent,{transform:ce,snapGrid:J,snapToGrid:se,containerBounds:k}),b=Ir(le.sourceEvent,k)}).on("drag",le=>{const{autoPanOnNodeDrag:ve,transform:D,snapGrid:ce,snapToGrid:J,nodeDragThreshold:se,nodeLookup:z}=r(),K=Sa(le.sourceEvent,{transform:D,snapGrid:ce,snapToGrid:J,containerBounds:k});if(M=le.sourceEvent,(le.sourceEvent.type==="touchmove"&&le.sourceEvent.touches.length>1||H&&!z.has(H))&&(C=!0),!C){if(!y&&ve&&x&&(y=!0,pe()),!x){const F=Ir(le.sourceEvent,k),A=F.x-b.x,V=F.y-b.y;Math.sqrt(A*A+V*V)>se&&we(le)}(c.x!==K.xSnapped||c.y!==K.ySnapped)&&h&&x&&(b=Ir(le.sourceEvent,k),G(K))}}).on("end",le=>{if(!(!x||C)&&(y=!1,x=!1,cancelAnimationFrame(d),h.size>0)){const{nodeLookup:ve,updateNodePositions:D,onNodeDragStop:ce,onSelectionDragStop:J}=r();if(j&&(D(h,!1),j=!1),l||ce||!H&&J){const[se,z]=af({nodeId:H,dragItems:h,nodeLookup:ve,dragging:!1});l==null||l(le.sourceEvent,h,se,z),ce==null||ce(le.sourceEvent,se,z),H||J==null||J(le.sourceEvent,z)}}}).filter(le=>{const ve=le.target;return!le.button&&(!B||!Th(ve,`.${B}`,R))&&(!P||Th(ve,P,R))});S.call(U)}function I(){S==null||S.on(".drag",null)}return{update:T,destroy:I}}function rb(t,r,i){const s=[],l={x:t.x-i,y:t.y-i,width:i*2,height:i*2};for(const c of r.values())Ma(l,Is(c))>0&&s.push(c);return s}const ob=250;function ib(t,r,i,s){var h,y;let l=[],c=1/0;const d=rb(t,i,r+ob);for(const b of d){const k=[...((h=b.internals.handleBounds)==null?void 0:h.source)??[],...((y=b.internals.handleBounds)==null?void 0:y.target)??[]];for(const x of k){if(s.nodeId===x.nodeId&&s.type===x.type&&s.id===x.id)continue;const{x:S,y:C}=Fi(b,x,x.position,!0),j=Math.sqrt(Math.pow(S-t.x,2)+Math.pow(C-t.y,2));j>r||(j<c?(l=[{...x,x:S,y:C}],c=j):j===c&&l.push({...x,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,x;const d=s.get(t);if(!d)return null;const h=l==="strict"?(b=d.internals.handleBounds)==null?void 0:b[r]:[...((k=d.internals.handleBounds)==null?void 0:k.source)??[],...((x=d.internals.handleBounds)==null?void 0:x.target)??[]],y=(i?h==null?void 0:h.find(S=>S.id===i):h==null?void 0:h[0])??null;return y&&c?{...y,...Fi(d,y,y.position,!0)}:y}function S0(t,r){return t||(r!=null&&r.classList.contains("target")?"target":r!=null&&r.classList.contains("source")?"source":null)}function sb(t,r){let i=null;return r?i=!0:t&&!r&&(i=!1),i}const k0=()=>!0;function ab(t,{connectionMode:r,connectionRadius:i,handleId:s,nodeId:l,edgeUpdaterType:c,isTarget:d,domNode:h,nodeLookup:y,lib:b,autoPanOnConnect:k,flowId:x,panBy:S,cancelConnection:C,onConnectStart:j,onConnect:M,onConnectEnd:T,isValidConnection:I=k0,onReconnectEnd:B,updateConnection:P,getTransform:R,getFromHandle:W,autoPanSpeed:H,dragThreshold:Q=1,handleDomNode:G}){const pe=c0(t.target);let we=0,U;const{x:le,y:ve}=Ir(t),D=S0(c,G),ce=h==null?void 0:h.getBoundingClientRect();let J=!1;if(!ce||!D)return;const se=_0(l,D,s,y,r);if(!se)return;let z=Ir(t,ce),K=!1,F=null,A=!1,V=null;function be(){if(!k||!ce)return;const[Be,Re]=s0(z,ce,H);S({x:Be,y:Re}),we=requestAnimationFrame(be)}const Se={...se,nodeId:l,type:D,position:se.position},$e=y.get(l);let Oe={inProgress:!0,isValid:null,from:Fi($e,Se,Ze.Left,!0),fromHandle:Se,fromPosition:Se.position,fromNode:$e,to:z,toHandle:null,toPosition:wh[Se.position],toNode:null,pointer:z};function _e(){J=!0,P(Oe),j==null||j(t,{nodeId:l,handleId:s,handleType:D})}Q===0&&_e();function Fe(Be){if(!J){const{x:$t,y:St}=Ir(Be),nn=$t-le,Lt=St-ve;if(!(nn*nn+Lt*Lt>Q*Q))return;_e()}if(!W()||!Se){ke(Be);return}const Re=R();z=Ir(Be,ce),U=ib(za(z,Re,!1,[1,1]),i,y,Se),K||(be(),K=!0);const qe=N0(Be,{handle:U,connectionMode:r,fromNodeId:l,fromHandleId:s,fromType:d?"target":"source",isValidConnection:I,doc:pe,lib:b,flowId:x,nodeLookup:y});V=qe.handleDomNode,F=qe.connection,A=sb(!!U,qe.isValid);const lt=y.get(l),ut=lt?Fi(lt,Se,Ze.Left,!0):Oe.from,ot={...Oe,from:ut,isValid:A,to:qe.toHandle&&A?vu({x:qe.toHandle.x,y:qe.toHandle.y},Re):z,toHandle:qe.toHandle,toPosition:A&&qe.toHandle?qe.toHandle.position:wh[Se.position],toNode:qe.toHandle?y.get(qe.toHandle.nodeId):null,pointer:z};P(ot),Oe=ot}function ke(Be){if(!("touches"in Be&&Be.touches.length>0)){if(J){(U||V)&&F&&A&&(M==null||M(F));const{inProgress:Re,...qe}=Oe,lt={...qe,toPosition:Oe.toHandle?Oe.toPosition:null};T==null||T(Be,lt),c&&(B==null||B(Be,lt))}C(),cancelAnimationFrame(we),K=!1,A=!1,F=null,V=null,pe.removeEventListener("mousemove",Fe),pe.removeEventListener("mouseup",ke),pe.removeEventListener("touchmove",Fe),pe.removeEventListener("touchend",ke)}}pe.addEventListener("mousemove",Fe),pe.addEventListener("mouseup",ke),pe.addEventListener("touchmove",Fe),pe.addEventListener("touchend",ke)}function N0(t,{handle:r,connectionMode:i,fromNodeId:s,fromHandleId:l,fromType:c,doc:d,lib:h,flowId:y,isValidConnection:b=k0,nodeLookup:k}){const x=c==="target",S=r?d.querySelector(`.${h}-flow__handle[data-id="${y}-${r==null?void 0:r.nodeId}-${r==null?void 0:r.id}-${r==null?void 0:r.type}"]`):null,{x:C,y:j}=Ir(t),M=d.elementFromPoint(C,j),T=M!=null&&M.classList.contains(`${h}-flow__handle`)?M:S,I={handleDomNode:T,isValid:!1,connection:null,toHandle:null};if(T){const B=S0(void 0,T),P=T.getAttribute("data-nodeid"),R=T.getAttribute("data-handleid"),W=T.classList.contains("connectable"),H=T.classList.contains("connectableend");if(!P||!B)return I;const Q={source:x?P:s,sourceHandle:x?R:l,target:x?s:P,targetHandle:x?l:R};I.connection=Q;const pe=W&&H&&(i===$s.Strict?x&&B==="source"||!x&&B==="target":P!==s||R!==l);I.isValid=pe&&b(Q),I.toHandle=_0(P,B,R,k,i,!0)}return I}const If={onPointerDown:ab,isValid:N0};function lb({domNode:t,panZoom:r,getTransform:i,getViewScale:s}){const l=Zn(t);function c({translateExtent:h,width:y,height:b,zoomStep:k=1,pannable:x=!0,zoomable:S=!0,inversePan:C=!1}){const j=P=>{if(P.sourceEvent.type!=="wheel"||!r)return;const R=i(),W=P.sourceEvent.ctrlKey&&$a()?10:1,H=-P.sourceEvent.deltaY*(P.sourceEvent.deltaMode===1?.05:P.sourceEvent.deltaMode?1:.002)*k,Q=R[2]*Math.pow(2,H*W);r.scaleTo(Q)};let M=[0,0];const T=P=>{(P.sourceEvent.type==="mousedown"||P.sourceEvent.type==="touchstart")&&(M=[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 W=[P.sourceEvent.clientX??P.sourceEvent.touches[0].clientX,P.sourceEvent.clientY??P.sourceEvent.touches[0].clientY],H=[W[0]-M[0],W[1]-M[1]];M=W;const Q=s()*Math.max(R[2],Math.log(R[2]))*(C?-1:1),G={x:R[0]-H[0]*Q,y:R[1]-H[1]*Q},pe=[[0,0],[y,b]];r.setViewportConstrained({x:G.x,y:G.y,zoom:R[2]},pe,h)},B=Jm().on("start",T).on("zoom",x?I:null).on("zoom.wheel",S?j:null);l.call(B,{})}function d(){l.on("zoom",null)}return{update:c,destroy:d,pointer:Mr}}const $u=t=>({x:t.x,y:t.y,zoom:t.k}),lf=({x:t,y:r,zoom:i})=>ju.translate(t,r).scale(i),Ns=(t,r)=>t.target.closest(`.${r}`),E0=(t,r)=>r===2&&Array.isArray(t)&&t.includes(2),ub=t=>((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2,uf=(t,r=0,i=ub,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&&$a()?10:1;return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*r};function cb({zoomPanValues:t,noWheelClassName:r,d3Selection:i,d3Zoom:s,panOnScrollMode:l,panOnScrollSpeed:c,zoomOnPinch:d,onPanZoomStart:h,onPanZoom:y,onPanZoomEnd:b}){return k=>{if(Ns(k,r))return k.ctrlKey&&k.preventDefault(),!1;k.preventDefault(),k.stopImmediatePropagation();const x=i.property("__zoom").k||1;if(k.ctrlKey&&d){const T=Mr(k),I=C0(k),B=x*Math.pow(2,I);s.scaleTo(i,B,T,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;!$a()&&k.shiftKey&&l!==Ri.Vertical&&(C=k.deltaY*S,j=0),s.translateBy(i,-(C/x)*c,-(j/x)*c,{internal:!0});const M=$u(i.property("__zoom"));clearTimeout(t.panScrollTimeout),t.isPanScrolling?(y==null||y(k,M),t.panScrollTimeout=setTimeout(()=>{b==null||b(k,M),t.isPanScrolling=!1},150)):(t.isPanScrolling=!0,h==null||h(k,M))}}function fb({noWheelClassName:t,preventScrolling:r,d3ZoomHandler:i}){return function(s,l){const c=s.type==="wheel",d=!r&&c&&!s.ctrlKey,h=Ns(s,t);if(s.ctrlKey&&c&&h&&s.preventDefault(),d||h)return null;s.preventDefault(),i.call(this,s,l)}}function db({zoomPanValues:t,onDraggingChange:r,onPanZoomStart:i}){return s=>{var c,d,h;if((c=s.sourceEvent)!=null&&c.internal)return;const l=$u(s.transform);t.mouseButton=((d=s.sourceEvent)==null?void 0:d.button)||0,t.isZoomingOrPanning=!0,t.prevViewport=l,((h=s.sourceEvent)==null?void 0:h.type)==="mousedown"&&r(!0),i&&(i==null||i(s.sourceEvent,l))}}function pb({zoomPanValues:t,panOnDrag:r,onPaneContextMenu:i,onTransformChange:s,onPanZoom:l}){return c=>{var d,h;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&&!((h=c.sourceEvent)!=null&&h.internal)&&(l==null||l(c.sourceEvent,$u(c.transform)))}}function hb({zoomPanValues:t,panOnDrag:r,panOnScroll:i,onDraggingChange:s,onPanZoomEnd:l,onPaneContextMenu:c}){return d=>{var h;if(!((h=d.sourceEvent)!=null&&h.internal)&&(t.isZoomingOrPanning=!1,c&&E0(r,t.mouseButton??0)&&!t.usedRightMouseButton&&d.sourceEvent&&c(d.sourceEvent),t.usedRightMouseButton=!1,s(!1),l)){const y=$u(d.transform);t.prevViewport=y,clearTimeout(t.timerId),t.timerId=setTimeout(()=>{l==null||l(d.sourceEvent,y)},i?150:0)}}}function mb({zoomActivationKeyPressed:t,zoomOnScroll:r,zoomOnPinch:i,panOnDrag:s,panOnScroll:l,zoomOnDoubleClick:c,userSelectionActive:d,noWheelClassName:h,noPanClassName:y,lib:b,connectionInProgress:k}){return x=>{var T;const S=t||r,C=i&&x.ctrlKey,j=x.type==="wheel";if(x.button===1&&x.type==="mousedown"&&(Ns(x,`${b}-flow__node`)||Ns(x,`${b}-flow__edge`)))return!0;if(!s&&!S&&!l&&!c&&!i||d||k&&!j||Ns(x,h)&&j||Ns(x,y)&&(!j||l&&j&&!t)||!i&&x.ctrlKey&&j)return!1;if(!i&&x.type==="touchstart"&&((T=x.touches)==null?void 0:T.length)>1)return x.preventDefault(),!1;if(!S&&!l&&!C&&j||!s&&(x.type==="mousedown"||x.type==="touchstart")||Array.isArray(s)&&!s.includes(x.button)&&x.type==="mousedown")return!1;const M=Array.isArray(s)&&s.includes(x.button)||!x.button||x.button<=1;return(!x.ctrlKey||j)&&M}}function gb({domNode:t,minZoom:r,maxZoom:i,translateExtent:s,viewport:l,onPanZoom:c,onPanZoomStart:d,onPanZoomEnd:h,onDraggingChange:y}){const b={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},k=t.getBoundingClientRect(),x=Jm().scaleExtent([r,i]).translateExtent(s),S=Zn(t).call(x);B({x:l.x,y:l.y,zoom:Ts(l.zoom,r,i)},[[0,0],[k.width,k.height]],s);const C=S.on("wheel.zoom"),j=S.on("dblclick.zoom");x.wheelDelta(C0);function M(U,le){return S?new Promise(ve=>{x==null||x.interpolate((le==null?void 0:le.interpolate)==="linear"?_a:nu).transform(uf(S,le==null?void 0:le.duration,le==null?void 0:le.ease,()=>ve(!0)),U)}):Promise.resolve(!1)}function T({noWheelClassName:U,noPanClassName:le,onPaneContextMenu:ve,userSelectionActive:D,panOnScroll:ce,panOnDrag:J,panOnScrollMode:se,panOnScrollSpeed:z,preventScrolling:K,zoomOnPinch:F,zoomOnScroll:A,zoomOnDoubleClick:V,zoomActivationKeyPressed:be,lib:Se,onTransformChange:$e,connectionInProgress:Ae,paneClickDistance:Oe,selectionOnDrag:_e}){D&&!b.isZoomingOrPanning&&I();const Fe=ce&&!be&&!D;x.clickDistance(_e?1/0:!Tr(Oe)||Oe<0?0:Oe);const ke=Fe?cb({zoomPanValues:b,noWheelClassName:U,d3Selection:S,d3Zoom:x,panOnScrollMode:se,panOnScrollSpeed:z,zoomOnPinch:F,onPanZoomStart:d,onPanZoom:c,onPanZoomEnd:h}):fb({noWheelClassName:U,preventScrolling:K,d3ZoomHandler:C});if(S.on("wheel.zoom",ke,{passive:!1}),!D){const Re=db({zoomPanValues:b,onDraggingChange:y,onPanZoomStart:d});x.on("start",Re);const qe=pb({zoomPanValues:b,panOnDrag:J,onPaneContextMenu:!!ve,onPanZoom:c,onTransformChange:$e});x.on("zoom",qe);const lt=hb({zoomPanValues:b,panOnDrag:J,panOnScroll:ce,onPaneContextMenu:ve,onPanZoomEnd:h,onDraggingChange:y});x.on("end",lt)}const Be=mb({zoomActivationKeyPressed:be,panOnDrag:J,zoomOnScroll:A,panOnScroll:ce,zoomOnDoubleClick:V,zoomOnPinch:F,userSelectionActive:D,noPanClassName:le,noWheelClassName:U,lib:Se,connectionInProgress:Ae});x.filter(Be),V?S.on("dblclick.zoom",j):S.on("dblclick.zoom",null)}function I(){x.on("zoom",null)}async function B(U,le,ve){const D=lf(U),ce=x==null?void 0:x.constrain()(D,le,ve);return ce&&await M(ce),new Promise(J=>J(ce))}async function P(U,le){const ve=lf(U);return await M(ve,le),new Promise(D=>D(ve))}function R(U){if(S){const le=lf(U),ve=S.property("__zoom");(ve.k!==U.zoom||ve.x!==U.x||ve.y!==U.y)&&(x==null||x.transform(S,le,null,{sync:!0}))}}function W(){const U=S?Gm(S.node()):{x:0,y:0,k:1};return{x:U.x,y:U.y,zoom:U.k}}function H(U,le){return S?new Promise(ve=>{x==null||x.interpolate((le==null?void 0:le.interpolate)==="linear"?_a:nu).scaleTo(uf(S,le==null?void 0:le.duration,le==null?void 0:le.ease,()=>ve(!0)),U)}):Promise.resolve(!1)}function Q(U,le){return S?new Promise(ve=>{x==null||x.interpolate((le==null?void 0:le.interpolate)==="linear"?_a:nu).scaleBy(uf(S,le==null?void 0:le.duration,le==null?void 0:le.ease,()=>ve(!0)),U)}):Promise.resolve(!1)}function G(U){x==null||x.scaleExtent(U)}function pe(U){x==null||x.translateExtent(U)}function we(U){const le=!Tr(U)||U<0?0:U;x==null||x.clickDistance(le)}return{update:T,destroy:I,setViewport:P,setViewportConstrained:B,getViewport:W,scaleTo:H,scaleBy:Q,setScaleExtent:G,setTranslateExtent:pe,syncViewport:R,setClickDistance:we}}var Os;(function(t){t.Line="line",t.Handle="handle"})(Os||(Os={}));function yb({width:t,prevWidth:r,height:i,prevHeight:s,affectsX:l,affectsY:c}){const d=t-r,h=i-s,y=[d>0?1:d<0?-1:0,h>0?1:h<0?-1:0];return d&&l&&(y[0]=y[0]*-1),h&&c&&(y[1]=y[1]*-1),y}function Ih(t){const r=t.includes("right")||t.includes("left"),i=t.includes("bottom")||t.includes("top"),s=t.includes("left"),l=t.includes("top");return{isHorizontal:r,isVertical:i,affectsX:s,affectsY:l}}function ai(t,r){return Math.max(0,r-t)}function li(t,r){return Math.max(0,t-r)}function Ql(t,r,i){return Math.max(0,r-t,t-i)}function Ah(t,r){return t?!r:r}function vb(t,r,i,s,l,c,d,h){let{affectsX:y,affectsY:b}=r;const{isHorizontal:k,isVertical:x}=r,S=k&&x,{xSnapped:C,ySnapped:j}=i,{minWidth:M,maxWidth:T,minHeight:I,maxHeight:B}=s,{x:P,y:R,width:W,height:H,aspectRatio:Q}=t;let G=Math.floor(k?C-t.pointerX:0),pe=Math.floor(x?j-t.pointerY:0);const we=W+(y?-G:G),U=H+(b?-pe:pe),le=-c[0]*W,ve=-c[1]*H;let D=Ql(we,M,T),ce=Ql(U,I,B);if(d){let z=0,K=0;y&&G<0?z=ai(P+G+le,d[0][0]):!y&&G>0&&(z=li(P+we+le,d[1][0])),b&&pe<0?K=ai(R+pe+ve,d[0][1]):!b&&pe>0&&(K=li(R+U+ve,d[1][1])),D=Math.max(D,z),ce=Math.max(ce,K)}if(h){let z=0,K=0;y&&G>0?z=li(P+G,h[0][0]):!y&&G<0&&(z=ai(P+we,h[1][0])),b&&pe>0?K=li(R+pe,h[0][1]):!b&&pe<0&&(K=ai(R+U,h[1][1])),D=Math.max(D,z),ce=Math.max(ce,K)}if(l){if(k){const z=Ql(we/Q,I,B)*Q;if(D=Math.max(D,z),d){let K=0;!y&&!b||y&&!b&&S?K=li(R+ve+we/Q,d[1][1])*Q:K=ai(R+ve+(y?G:-G)/Q,d[0][1])*Q,D=Math.max(D,K)}if(h){let K=0;!y&&!b||y&&!b&&S?K=ai(R+we/Q,h[1][1])*Q:K=li(R+(y?G:-G)/Q,h[0][1])*Q,D=Math.max(D,K)}}if(x){const z=Ql(U*Q,M,T)/Q;if(ce=Math.max(ce,z),d){let K=0;!y&&!b||b&&!y&&S?K=li(P+U*Q+le,d[1][0])/Q:K=ai(P+(b?pe:-pe)*Q+le,d[0][0])/Q,ce=Math.max(ce,K)}if(h){let K=0;!y&&!b||b&&!y&&S?K=ai(P+U*Q,h[1][0])/Q:K=li(P+(b?pe:-pe)*Q,h[0][0])/Q,ce=Math.max(ce,K)}}}pe=pe+(pe<0?ce:-ce),G=G+(G<0?D:-D),l&&(S?we>U*Q?pe=(Ah(y,b)?-G:G)/Q:G=(Ah(y,b)?-pe:pe)*Q:k?(pe=G/Q,b=y):(G=pe*Q,y=b));const J=y?P+G:P,se=b?R+pe:R;return{width:W+(y?-G:G),height:H+(b?-pe:pe),x:c[0]*G*(y?-1:1)+J,y:c[1]*pe*(b?-1:1)+se}}const j0={width:0,height:0,x:0,y:0},xb={...j0,pointerX:0,pointerY:0,aspectRatio:1};function wb(t){return[[0,0],[t.measured.width,t.measured.height]]}function bb(t,r,i){const s=r.position.x+t.position.x,l=r.position.y+t.position.y,c=t.measured.width??0,d=t.measured.height??0,h=i[0]*c,y=i[1]*d;return[[s-h,l-y],[s+c-h,l+d-y]]}function _b({domNode:t,nodeId:r,getStoreItems:i,onChange:s,onEnd:l}){const c=Zn(t);let d={controlDirection:Ih("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function h({controlPosition:b,boundaries:k,keepAspectRatio:x,resizeDirection:S,onResizeStart:C,onResize:j,onResizeEnd:M,shouldResize:T}){let I={...j0},B={...xb};d={boundaries:k,resizeDirection:S,keepAspectRatio:x,controlDirection:Ih(b)};let P,R=null,W=[],H,Q,G,pe=!1;const we=Dm().on("start",U=>{const{nodeLookup:le,transform:ve,snapGrid:D,snapToGrid:ce,nodeOrigin:J,paneDomNode:se}=i();if(P=le.get(r),!P)return;R=(se==null?void 0:se.getBoundingClientRect())??null;const{xSnapped:z,ySnapped:K}=Sa(U.sourceEvent,{transform:ve,snapGrid:D,snapToGrid:ce,containerBounds:R});I={width:P.measured.width??0,height:P.measured.height??0,x:P.position.x??0,y:P.position.y??0},B={...I,pointerX:z,pointerY:K,aspectRatio:I.width/I.height},H=void 0,P.parentId&&(P.extent==="parent"||P.expandParent)&&(H=le.get(P.parentId),Q=H&&P.extent==="parent"?wb(H):void 0),W=[],G=void 0;for(const[F,A]of le)if(A.parentId===r&&(W.push({id:F,position:{...A.position},extent:A.extent}),A.extent==="parent"||A.expandParent)){const V=bb(A,P,A.origin??J);G?G=[[Math.min(V[0][0],G[0][0]),Math.min(V[0][1],G[0][1])],[Math.max(V[1][0],G[1][0]),Math.max(V[1][1],G[1][1])]]:G=V}C==null||C(U,{...I})}).on("drag",U=>{const{transform:le,snapGrid:ve,snapToGrid:D,nodeOrigin:ce}=i(),J=Sa(U.sourceEvent,{transform:le,snapGrid:ve,snapToGrid:D,containerBounds:R}),se=[];if(!P)return;const{x:z,y:K,width:F,height:A}=I,V={},be=P.origin??ce,{width:Se,height:$e,x:Ae,y:Oe}=vb(B,d.controlDirection,J,d.boundaries,d.keepAspectRatio,be,Q,G),_e=Se!==F,Fe=$e!==A,ke=Ae!==z&&_e,Be=Oe!==K&&Fe;if(!ke&&!Be&&!_e&&!Fe)return;if((ke||Be||be[0]===1||be[1]===1)&&(V.x=ke?Ae:I.x,V.y=Be?Oe:I.y,I.x=V.x,I.y=V.y,W.length>0)){const ut=Ae-z,ot=Oe-K;for(const $t of W)$t.position={x:$t.position.x-ut+be[0]*(Se-F),y:$t.position.y-ot+be[1]*($e-A)},se.push($t)}if((_e||Fe)&&(V.width=_e&&(!d.resizeDirection||d.resizeDirection==="horizontal")?Se:I.width,V.height=Fe&&(!d.resizeDirection||d.resizeDirection==="vertical")?$e:I.height,I.width=V.width,I.height=V.height),H&&P.expandParent){const ut=be[0]*(V.width??0);V.x&&V.x<ut&&(I.x=ut,B.x=B.x-(V.x-ut));const ot=be[1]*(V.height??0);V.y&&V.y<ot&&(I.y=ot,B.y=B.y-(V.y-ot))}const Re=yb({width:I.width,prevWidth:F,height:I.height,prevHeight:A,affectsX:d.controlDirection.affectsX,affectsY:d.controlDirection.affectsY}),qe={...I,direction:Re};(T==null?void 0:T(U,qe))!==!1&&(pe=!0,j==null||j(U,qe),s(V,se))}).on("end",U=>{pe&&(M==null||M(U,{...I}),l==null||l({...I}),pe=!1)});c.call(we)}function y(){c.on(".drag",null)}return{update:h,destroy:y}}var cf={exports:{}},ff={},df={exports:{}},pf={};/**
181
+ * @license React
182
+ * use-sync-external-store-shim.production.js
183
+ *
184
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
185
+ *
186
+ * This source code is licensed under the MIT license found in the
187
+ * LICENSE file in the root directory of this source tree.
188
+ */var Oh;function Sb(){if(Oh)return pf;Oh=1;var t=Ia();function r(x,S){return x===S&&(x!==0||1/x===1/S)||x!==x&&S!==S}var i=typeof Object.is=="function"?Object.is:r,s=t.useState,l=t.useEffect,c=t.useLayoutEffect,d=t.useDebugValue;function h(x,S){var C=S(),j=s({inst:{value:C,getSnapshot:S}}),M=j[0].inst,T=j[1];return c(function(){M.value=C,M.getSnapshot=S,y(M)&&T({inst:M})},[x,C,S]),l(function(){return y(M)&&T({inst:M}),x(function(){y(M)&&T({inst:M})})},[x]),d(C),C}function y(x){var S=x.getSnapshot;x=x.value;try{var C=S();return!i(x,C)}catch{return!0}}function b(x,S){return S()}var k=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?b:h;return pf.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:k,pf}var Rh;function kb(){return Rh||(Rh=1,df.exports=Sb()),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 Dh;function Nb(){if(Dh)return ff;Dh=1;var t=Ia(),r=kb();function i(b,k){return b===k&&(b!==0||1/b===1/k)||b!==b&&k!==k}var s=typeof Object.is=="function"?Object.is:i,l=r.useSyncExternalStore,c=t.useRef,d=t.useEffect,h=t.useMemo,y=t.useDebugValue;return ff.useSyncExternalStoreWithSelector=function(b,k,x,S,C){var j=c(null);if(j.current===null){var M={hasValue:!1,value:null};j.current=M}else M=j.current;j=h(function(){function I(H){if(!B){if(B=!0,P=H,H=S(H),C!==void 0&&M.hasValue){var Q=M.value;if(C(Q,H))return R=Q}return R=H}if(Q=R,s(P,H))return Q;var G=S(H);return C!==void 0&&C(Q,G)?(P=H,Q):(P=H,R=G)}var B=!1,P,R,W=x===void 0?null:x;return[function(){return I(k())},W===null?void 0:function(){return I(W())}]},[k,x,S,C]);var T=l(b,j[0],j[1]);return d(function(){M.hasValue=!0,M.value=T},[T]),y(T),T},ff}var Lh;function Eb(){return Lh||(Lh=1,cf.exports=Nb()),cf.exports}var Cb=Eb();const jb=wu(Cb),Pb={},zh=t=>{let r;const i=new Set,s=(k,x)=>{const S=typeof k=="function"?k(r):k;if(!Object.is(S,r)){const C=r;r=x??(typeof S!="object"||S===null)?S:Object.assign({},r,S),i.forEach(j=>j(r,C))}},l=()=>r,y={setState:s,getState:l,getInitialState:()=>b,subscribe:k=>(i.add(k),()=>i.delete(k)),destroy:()=>{(Pb?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),i.clear()}},b=r=t(s,l,y);return y},Mb=t=>t?zh(t):zh,{useDebugValue:$b}=gm,{useSyncExternalStoreWithSelector:Tb}=jb,Ib=t=>t;function P0(t,r=Ib,i){const s=Tb(t.subscribe,t.getState,t.getServerState||t.getInitialState,r,i);return $b(s),s}const Fh=(t,r)=>{const i=Mb(t),s=(l,c=r)=>P0(i,l,c);return Object.assign(s,i),s},Ab=(t,r)=>t?Fh(t,r):Fh;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 Tu=Y.createContext(null),Ob=Tu.Provider,M0=Jr.error001();function mt(t,r){const i=Y.useContext(Tu);if(i===null)throw new Error(M0);return P0(i,t,r)}function Mt(){const t=Y.useContext(Tu);if(t===null)throw new Error(M0);return Y.useMemo(()=>({getState:t.getState,setState:t.setState,subscribe:t.subscribe}),[t])}const Bh={display:"none"},Rb={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},$0="react-flow__node-desc",T0="react-flow__edge-desc",Db="react-flow__aria-live",Lb=t=>t.ariaLiveMessage,zb=t=>t.ariaLabelConfig;function Fb({rfId:t}){const r=mt(Lb);return w.jsx("div",{id:`${Db}-${t}`,"aria-live":"assertive","aria-atomic":"true",style:Rb,children:r})}function Bb({rfId:t,disableKeyboardA11y:r}){const i=mt(zb);return w.jsxs(w.Fragment,{children:[w.jsx("div",{id:`${$0}-${t}`,style:Bh,children:r?i["node.a11yDescription.default"]:i["node.a11yDescription.keyboardDisabled"]}),w.jsx("div",{id:`${T0}-${t}`,style:Bh,children:i["edge.a11yDescription.default"]}),!r&&w.jsx(Fb,{rfId:t})]})}const Fa=Y.forwardRef(({position:t="top-left",children:r,className:i,style:s,...l},c)=>{const d=`${t}`.split("-");return w.jsx("div",{className:Ut(["react-flow__panel",i,...d]),style:s,ref:c,...l,children:r})});Fa.displayName="Panel";function Hb({proOptions:t,position:r="bottom-right"}){return t!=null&&t.hideAttribution?null:w.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:w.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const Vb=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 Ub(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(Vb,Ub);return Y.useEffect(()=>{const l={nodes:i,edges:s};t==null||t(l),r.getState().onSelectionChangeHandlers.forEach(c=>c(l))},[i,s,t]),null}const qb=t=>!!t.onSelectionChangeHandlers;function Wb({onSelectionChange:t}){const r=mt(qb);return t||r?w.jsx(Kb,{onSelectionChange:t}):null}const Af=typeof window<"u"?Y.useLayoutEffect:Y.useEffect,I0=[0,0],Yb={x:0,y:0,zoom:1},Xb=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode"],Hh=[...Xb,"rfId"],Qb=t=>({setNodes:t.setNodes,setEdges:t.setEdges,setMinZoom:t.setMinZoom,setMaxZoom:t.setMaxZoom,setTranslateExtent:t.setTranslateExtent,setNodeExtent:t.setNodeExtent,reset:t.reset,setDefaultNodesAndEdges:t.setDefaultNodesAndEdges}),Vh={translateExtent:ja,nodeOrigin:I0,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function Gb(t){const{setNodes:r,setEdges:i,setMinZoom:s,setMaxZoom:l,setTranslateExtent:c,setNodeExtent:d,reset:h,setDefaultNodesAndEdges:y}=mt(Qb,At),b=Mt();Af(()=>(y(t.defaultNodes,t.defaultEdges),()=>{k.current=Vh,h()}),[]);const k=Y.useRef(Vh);return Af(()=>{for(const x of Hh){const S=t[x],C=k.current[x];S!==C&&(typeof t[x]>"u"||(x==="nodes"?r(S):x==="edges"?i(S):x==="minZoom"?s(S):x==="maxZoom"?l(S):x==="translateExtent"?c(S):x==="nodeExtent"?d(S):x==="ariaLabelConfig"?b.setState({ariaLabelConfig:O1(S)}):x==="fitView"?b.setState({fitViewQueued:S}):x==="fitViewOptions"?b.setState({fitViewOptions:S}):b.setState({[x]:S})))}k.current=t},Hh.map(x=>t[x])),null}function Uh(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function Jb(t){var s;const[r,i]=Y.useState(t==="system"?null:t);return Y.useEffect(()=>{if(t!=="system"){i(t);return}const l=Uh(),c=()=>i(l!=null&&l.matches?"dark":"light");return c(),l==null||l.addEventListener("change",c),()=>{l==null||l.removeEventListener("change",c)}},[t]),r!==null?r:(s=Uh())!=null&&s.matches?"dark":"light"}const Kh=typeof document<"u"?document:null;function Ta(t=null,r={target:Kh,actInsideInputWithModifier:!0}){const[i,s]=Y.useState(!1),l=Y.useRef(!1),c=Y.useRef(new Set([])),[d,h]=Y.useMemo(()=>{if(t!==null){const b=(Array.isArray(t)?t:[t]).filter(x=>typeof x=="string").map(x=>x.replace("+",`
197
+ `).replace(`
198
+
199
+ `,`
200
+ +`).split(`
201
+ `)),k=b.reduce((x,S)=>x.concat(...S),[]);return[b,k]}return[[],[]]},[t]);return Y.useEffect(()=>{const y=(r==null?void 0:r.target)??Kh,b=(r==null?void 0:r.actInsideInputWithModifier)??!0;if(t!==null){const k=C=>{var T,I;if(l.current=C.ctrlKey||C.metaKey||C.shiftKey||C.altKey,(!l.current||l.current&&!b)&&f0(C))return!1;const M=Wh(C.code,h);if(c.current.add(C[M]),qh(d,c.current,!1)){const B=((I=(T=C.composedPath)==null?void 0:T.call(C))==null?void 0:I[0])||C.target,P=(B==null?void 0:B.nodeName)==="BUTTON"||(B==null?void 0:B.nodeName)==="A";r.preventDefault!==!1&&(l.current||!P)&&C.preventDefault(),s(!0)}},x=C=>{const j=Wh(C.code,h);qh(d,c.current,!0)?(s(!1),c.current.clear()):c.current.delete(C[j]),C.key==="Meta"&&c.current.clear(),l.current=!1},S=()=>{c.current.clear(),s(!1)};return y==null||y.addEventListener("keydown",k),y==null||y.addEventListener("keyup",x),window.addEventListener("blur",S),window.addEventListener("contextmenu",S),()=>{y==null||y.removeEventListener("keydown",k),y==null||y.removeEventListener("keyup",x),window.removeEventListener("blur",S),window.removeEventListener("contextmenu",S)}}},[t,s]),i}function qh(t,r,i){return t.filter(s=>i||s.length===r.size).some(s=>s.every(l=>r.has(l)))}function Wh(t,r){return r.includes(t)?"code":"key"}const Zb=()=>{const t=Mt();return Y.useMemo(()=>({zoomIn:r=>{const{panZoom:i}=t.getState();return i?i.scaleBy(1.2,r):Promise.resolve(!1)},zoomOut:r=>{const{panZoom:i}=t.getState();return i?i.scaleBy(1/1.2,r):Promise.resolve(!1)},zoomTo:(r,i)=>{const{panZoom:s}=t.getState();return s?s.scaleTo(r,i):Promise.resolve(!1)},getZoom:()=>t.getState().transform[2],setViewport:async(r,i)=>{const{transform:[s,l,c],panZoom:d}=t.getState();return d?(await d.setViewport({x:r.x??s,y:r.y??l,zoom:r.zoom??c},i),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[r,i,s]=t.getState().transform;return{x:r,y:i,zoom:s}},setCenter:async(r,i,s)=>t.getState().setCenter(r,i,s),fitBounds:async(r,i)=>{const{width:s,height:l,minZoom:c,maxZoom:d,panZoom:h}=t.getState(),y=qf(r,s,l,c,d,(i==null?void 0:i.padding)??.1);return h?(await h.setViewport(y,{duration:i==null?void 0:i.duration,ease:i==null?void 0:i.ease,interpolate:i==null?void 0:i.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(r,i={})=>{const{transform:s,snapGrid:l,snapToGrid:c,domNode:d}=t.getState();if(!d)return r;const{x:h,y}=d.getBoundingClientRect(),b={x:r.x-h,y:r.y-y},k=i.snapGrid??l,x=i.snapToGrid??c;return za(b,s,x,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 h={...c};for(const y of d)e_(y,h);i.push(h)}return l.length&&l.forEach(c=>{c.index!==void 0?i.splice(c.index,0,{...c.item}):i.push({...c.item})}),i}function e_(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 Ii(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(Ii(c.id,d)))}return s}function Yh({items:t=[],lookup:r}){var l;const i=[],s=new Map(t.map(c=>[c.id,c]));for(const[c,d]of t.entries()){const h=r.get(d.id),y=((l=h==null?void 0:h.internals)==null?void 0:l.userNode)??h;y!==void 0&&y!==d&&i.push({id:d.id,item:d,type:"replace"}),y===void 0&&i.push({item:d,type:"add",index:c})}for(const[c]of r)s.get(c)===void 0&&i.push({id:c,type:"remove"});return i}function Xh(t){return{id:t.id,type:"remove"}}const Qh=t=>N1(t),t_=t=>r0(t);function D0(t){return Y.forwardRef(t)}function Gh(t){const[r,i]=Y.useState(BigInt(0)),[s]=Y.useState(()=>n_(()=>i(l=>l+BigInt(1))));return Af(()=>{const l=s.get();l.length&&(t(l),s.reset())},[r]),s}function n_(t){let r=[];return{get:()=>r,reset:()=>{r=[]},push:i=>{r.push(i),t()}}}const L0=Y.createContext(null);function r_({children:t}){const r=Mt(),i=Y.useCallback(h=>{const{nodes:y=[],setNodes:b,hasDefaultNodes:k,onNodesChange:x,nodeLookup:S,fitViewQueued:C,onNodesChangeMiddlewareMap:j}=r.getState();let M=y;for(const I of h)M=typeof I=="function"?I(M):I;let T=Yh({items:M,lookup:S});for(const I of j.values())T=I(T);k&&b(M),T.length>0?x==null||x(T):C&&window.requestAnimationFrame(()=>{const{fitViewQueued:I,nodes:B,setNodes:P}=r.getState();I&&P(B)})},[]),s=Gh(i),l=Y.useCallback(h=>{const{edges:y=[],setEdges:b,hasDefaultEdges:k,onEdgesChange:x,edgeLookup:S}=r.getState();let C=y;for(const j of h)C=typeof j=="function"?j(C):j;k?b(C):x&&x(Yh({items:C,lookup:S}))},[]),c=Gh(l),d=Y.useMemo(()=>({nodeQueue:s,edgeQueue:c}),[]);return w.jsx(L0.Provider,{value:d,children:t})}function o_(){const t=Y.useContext(L0);if(!t)throw new Error("useBatchContext must be used within a BatchProvider");return t}const i_=t=>!!t.panZoom;function Zf(){const t=Zb(),r=Mt(),i=o_(),s=mt(i_),l=Y.useMemo(()=>{const c=x=>r.getState().nodeLookup.get(x),d=x=>{i.nodeQueue.push(x)},h=x=>{i.edgeQueue.push(x)},y=x=>{var I,B;const{nodeLookup:S,nodeOrigin:C}=r.getState(),j=Qh(x)?x:S.get(x.id),M=j.parentId?u0(j.position,j.measured,j.parentId,S,C):j.position,T={...j,position:M,width:((I=j.measured)==null?void 0:I.width)??j.width,height:((B=j.measured)==null?void 0:B.height)??j.height};return Is(T)},b=(x,S,C={replace:!1})=>{d(j=>j.map(M=>{if(M.id===x){const T=typeof S=="function"?S(M):S;return C.replace&&Qh(T)?T:{...M,...T}}return M}))},k=(x,S,C={replace:!1})=>{h(j=>j.map(M=>{if(M.id===x){const T=typeof S=="function"?S(M):S;return C.replace&&t_(T)?T:{...M,...T}}return M}))};return{getNodes:()=>r.getState().nodes.map(x=>({...x})),getNode:x=>{var S;return(S=c(x))==null?void 0:S.internals.userNode},getInternalNode:c,getEdges:()=>{const{edges:x=[]}=r.getState();return x.map(S=>({...S}))},getEdge:x=>r.getState().edgeLookup.get(x),setNodes:d,setEdges:h,addNodes:x=>{const S=Array.isArray(x)?x:[x];i.nodeQueue.push(C=>[...C,...S])},addEdges:x=>{const S=Array.isArray(x)?x:[x];i.edgeQueue.push(C=>[...C,...S])},toObject:()=>{const{nodes:x=[],edges:S=[],transform:C}=r.getState(),[j,M,T]=C;return{nodes:x.map(I=>({...I})),edges:S.map(I=>({...I})),viewport:{x:j,y:M,zoom:T}}},deleteElements:async({nodes:x=[],edges:S=[]})=>{const{nodes:C,edges:j,onNodesDelete:M,onEdgesDelete:T,triggerNodeChanges:I,triggerEdgeChanges:B,onDelete:P,onBeforeDelete:R}=r.getState(),{nodes:W,edges:H}=await M1({nodesToRemove:x,edgesToRemove:S,nodes:C,edges:j,onBeforeDelete:R}),Q=H.length>0,G=W.length>0;if(Q){const pe=H.map(Xh);T==null||T(H),B(pe)}if(G){const pe=W.map(Xh);M==null||M(W),I(pe)}return(G||Q)&&(P==null||P({nodes:W,edges:H})),{deletedNodes:W,deletedEdges:H}},getIntersectingNodes:(x,S=!0,C)=>{const j=_h(x),M=j?x:y(x),T=C!==void 0;return M?(C||r.getState().nodes).filter(I=>{const B=r.getState().nodeLookup.get(I.id);if(B&&!j&&(I.id===x.id||!B.internals.positionAbsolute))return!1;const P=Is(T?I:B),R=Ma(P,M);return S&&R>0||R>=P.width*P.height||R>=M.width*M.height}):[]},isNodeIntersecting:(x,S,C=!0)=>{const M=_h(x)?x:y(x);if(!M)return!1;const T=Ma(M,S);return C&&T>0||T>=S.width*S.height||T>=M.width*M.height},updateNode:b,updateNodeData:(x,S,C={replace:!1})=>{b(x,j=>{const M=typeof S=="function"?S(j):S;return C.replace?{...j,data:M}:{...j,data:{...j.data,...M}}},C)},updateEdge:k,updateEdgeData:(x,S,C={replace:!1})=>{k(x,j=>{const M=typeof S=="function"?S(j):S;return C.replace?{...j,data:M}:{...j,data:{...j.data,...M}}},C)},getNodesBounds:x=>{const{nodeLookup:S,nodeOrigin:C}=r.getState();return E1(x,{nodeLookup:S,nodeOrigin:C})},getHandleConnections:({type:x,id:S,nodeId:C})=>{var j;return Array.from(((j=r.getState().connectionLookup.get(`${C}-${x}${S?`-${S}`:""}`))==null?void 0:j.values())??[])},getNodeConnections:({type:x,handleId:S,nodeId:C})=>{var j;return Array.from(((j=r.getState().connectionLookup.get(`${C}${x?S?`-${x}-${S}`:`-${x}`:""}`))==null?void 0:j.values())??[])},fitView:async x=>{const S=r.getState().fitViewResolver??A1();return r.setState({fitViewQueued:!0,fitViewOptions:x,fitViewResolver:S}),i.nodeQueue.push(C=>[...C]),S.promise}}},[]);return Y.useMemo(()=>({...l,...t,viewportInitialized:s}),[s])}const Jh=t=>t.selected,s_=typeof window<"u"?window:void 0;function a_({deleteKeyCode:t,multiSelectionKeyCode:r}){const i=Mt(),{deleteElements:s}=Zf(),l=Ta(t,{actInsideInputWithModifier:!1}),c=Ta(r,{target:s_});Y.useEffect(()=>{if(l){const{edges:d,nodes:h}=i.getState();s({nodes:h.filter(Jh),edges:d.filter(Jh)}),i.setState({nodesSelectionActive:!1})}},[l]),Y.useEffect(()=>{i.setState({multiSelectionActive:c})},[c])}function l_(t){const r=Mt();Y.useEffect(()=>{const i=()=>{var l,c,d,h;if(!t.current||!(((c=(l=t.current).checkVisibility)==null?void 0:c.call(l))??!0))return!1;const s=Wf(t.current);(s.height===0||s.width===0)&&((h=(d=r.getState()).onError)==null||h.call(d,"004",Jr.error004())),r.setState({width:s.width||500,height:s.height||500})};if(t.current){i(),window.addEventListener("resize",i);const s=new ResizeObserver(()=>i());return s.observe(t.current),()=>{window.removeEventListener("resize",i),s&&t.current&&s.unobserve(t.current)}}},[])}const Iu={position:"absolute",width:"100%",height:"100%",top:0,left:0},u_=t=>({userSelectionActive:t.userSelectionActive,lib:t.lib,connectionInProgress:t.connection.inProgress});function c_({onPaneContextMenu:t,zoomOnScroll:r=!0,zoomOnPinch:i=!0,panOnScroll:s=!1,panOnScrollSpeed:l=.5,panOnScrollMode:c=Ri.Free,zoomOnDoubleClick:d=!0,panOnDrag:h=!0,defaultViewport:y,translateExtent:b,minZoom:k,maxZoom:x,zoomActivationKeyCode:S,preventScrolling:C=!0,children:j,noWheelClassName:M,noPanClassName:T,onViewportChange:I,isControlledViewport:B,paneClickDistance:P,selectionOnDrag:R}){const W=Mt(),H=Y.useRef(null),{userSelectionActive:Q,lib:G,connectionInProgress:pe}=mt(u_,At),we=Ta(S),U=Y.useRef();l_(H);const le=Y.useCallback(ve=>{I==null||I({x:ve[0],y:ve[1],zoom:ve[2]}),B||W.setState({transform:ve})},[I,B]);return Y.useEffect(()=>{if(H.current){U.current=gb({domNode:H.current,minZoom:k,maxZoom:x,translateExtent:b,viewport:y,onDraggingChange:J=>W.setState(se=>se.paneDragging===J?se:{paneDragging:J}),onPanZoomStart:(J,se)=>{const{onViewportChangeStart:z,onMoveStart:K}=W.getState();K==null||K(J,se),z==null||z(se)},onPanZoom:(J,se)=>{const{onViewportChange:z,onMove:K}=W.getState();K==null||K(J,se),z==null||z(se)},onPanZoomEnd:(J,se)=>{const{onViewportChangeEnd:z,onMoveEnd:K}=W.getState();K==null||K(J,se),z==null||z(se)}});const{x:ve,y:D,zoom:ce}=U.current.getViewport();return W.setState({panZoom:U.current,transform:[ve,D,ce],domNode:H.current.closest(".react-flow")}),()=>{var J;(J=U.current)==null||J.destroy()}}},[]),Y.useEffect(()=>{var ve;(ve=U.current)==null||ve.update({onPaneContextMenu:t,zoomOnScroll:r,zoomOnPinch:i,panOnScroll:s,panOnScrollSpeed:l,panOnScrollMode:c,zoomOnDoubleClick:d,panOnDrag:h,zoomActivationKeyPressed:we,preventScrolling:C,noPanClassName:T,userSelectionActive:Q,noWheelClassName:M,lib:G,onTransformChange:le,connectionInProgress:pe,selectionOnDrag:R,paneClickDistance:P})},[t,r,i,s,l,c,d,h,we,C,T,Q,M,G,le,pe,R,P]),w.jsx("div",{className:"react-flow__renderer",ref:H,style:Iu,children:j})}const f_=t=>({userSelectionActive:t.userSelectionActive,userSelectionRect:t.userSelectionRect});function d_(){const{userSelectionActive:t,userSelectionRect:r}=mt(f_,At);return t&&r?w.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:r.width,height:r.height,transform:`translate(${r.x}px, ${r.y}px)`}}):null}const hf=(t,r)=>i=>{i.target===r.current&&(t==null||t(i))},p_=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:h,onPaneClick:y,onPaneContextMenu:b,onPaneScroll:k,onPaneMouseEnter:x,onPaneMouseMove:S,onPaneMouseLeave:C,children:j}){const M=Mt(),{userSelectionActive:T,elementsSelectable:I,dragging:B,connectionInProgress:P}=mt(p_,At),R=I&&(t||T),W=Y.useRef(null),H=Y.useRef(),Q=Y.useRef(new Set),G=Y.useRef(new Set),pe=Y.useRef(!1),we=z=>{if(pe.current||P){pe.current=!1;return}y==null||y(z),M.getState().resetSelectedElements(),M.setState({nodesSelectionActive:!1})},U=z=>{if(Array.isArray(s)&&(s!=null&&s.includes(2))){z.preventDefault();return}b==null||b(z)},le=k?z=>k(z):void 0,ve=z=>{pe.current&&(z.stopPropagation(),pe.current=!1)},D=z=>{var $e,Ae;const{domNode:K}=M.getState();if(H.current=K==null?void 0:K.getBoundingClientRect(),!H.current)return;const F=z.target===W.current;if(!F&&!!z.target.closest(".nokey")||!t||!(c&&F||r)||z.button!==0||!z.isPrimary)return;(Ae=($e=z.target)==null?void 0:$e.setPointerCapture)==null||Ae.call($e,z.pointerId),pe.current=!1;const{x:be,y:Se}=Ir(z.nativeEvent,H.current);M.setState({userSelectionRect:{width:0,height:0,startX:be,startY:Se,x:be,y:Se}}),F||(z.stopPropagation(),z.preventDefault())},ce=z=>{const{userSelectionRect:K,transform:F,nodeLookup:A,edgeLookup:V,connectionLookup:be,triggerNodeChanges:Se,triggerEdgeChanges:$e,defaultEdgeOptions:Ae,resetSelectedElements:Oe}=M.getState();if(!H.current||!K)return;const{x:_e,y:Fe}=Ir(z.nativeEvent,H.current),{startX:ke,startY:Be}=K;if(!pe.current){const ot=r?0:l;if(Math.hypot(_e-ke,Fe-Be)<=ot)return;Oe(),d==null||d(z)}pe.current=!0;const Re={startX:ke,startY:Be,x:_e<ke?_e:ke,y:Fe<Be?Fe:Be,width:Math.abs(_e-ke),height:Math.abs(Fe-Be)},qe=Q.current,lt=G.current;Q.current=new Set(Kf(A,Re,F,i===Pa.Partial,!0).map(ot=>ot.id)),G.current=new Set;const ut=(Ae==null?void 0:Ae.selectable)??!0;for(const ot of Q.current){const $t=be.get(ot);if($t)for(const{edgeId:St}of $t.values()){const nn=V.get(St);nn&&(nn.selectable??ut)&&G.current.add(St)}}if(!Sh(qe,Q.current)){const ot=Es(A,Q.current,!0);Se(ot)}if(!Sh(lt,G.current)){const ot=Es(V,G.current);$e(ot)}M.setState({userSelectionRect:Re,userSelectionActive:!0,nodesSelectionActive:!1})},J=z=>{var K,F;z.button===0&&((F=(K=z.target)==null?void 0:K.releasePointerCapture)==null||F.call(K,z.pointerId),!T&&z.target===W.current&&M.getState().userSelectionRect&&(we==null||we(z)),M.setState({userSelectionActive:!1,userSelectionRect:null}),pe.current&&(h==null||h(z),M.setState({nodesSelectionActive:Q.current.size>0})))},se=s===!0||Array.isArray(s)&&s.includes(0);return w.jsxs("div",{className:Ut(["react-flow__pane",{draggable:se,dragging:B,selection:t}]),onClick:R?void 0:hf(we,W),onContextMenu:hf(U,W),onWheel:hf(le,W),onPointerEnter:R?void 0:x,onPointerMove:R?ce:S,onPointerUp:R?J:void 0,onPointerDownCapture:R?D:void 0,onClickCapture:R?ve:void 0,onPointerLeave:C,ref:W,style:Iu,children:[j,w.jsx(d_,{})]})}function Of({id:t,store:r,unselect:i=!1,nodeRef:s}){const{addSelectedNodes:l,unselectNodesAndEdges:c,multiSelectionActive:d,nodeLookup:h,onError:y}=r.getState(),b=h.get(t);if(!b){y==null||y("012",Jr.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 h=Mt(),[y,b]=Y.useState(!1),k=Y.useRef();return Y.useEffect(()=>{k.current=nb({getStoreItems:()=>h.getState(),onNodeMouseDown:x=>{Of({id:x,store:h,nodeRef:t})},onDragStart:()=>{b(!0)},onDragStop:()=>{b(!1)}})},[]),Y.useEffect(()=>{if(!(r||!t.current||!k.current))return k.current.update({noDragClassName:i,handleSelector:s,domNode:t.current,isSelectable:c,nodeId:l,nodeClickDistance:d}),()=>{var x;(x=k.current)==null||x.destroy()}},[i,s,r,c,t,l,d]),y}const m_=t=>r=>r.selected&&(r.draggable||t&&typeof r.draggable>"u");function F0(){const t=Mt();return Y.useCallback(i=>{const{nodeExtent:s,snapToGrid:l,snapGrid:c,nodesDraggable:d,onError:h,updateNodePositions:y,nodeLookup:b,nodeOrigin:k}=t.getState(),x=new Map,S=m_(d),C=l?c[0]:5,j=l?c[1]:5,M=i.direction.x*C*i.factor,T=i.direction.y*j*i.factor;for(const[,I]of b){if(!S(I))continue;let B={x:I.internals.positionAbsolute.x+M,y:I.internals.positionAbsolute.y+T};l&&(B=La(B,c));const{position:P,positionAbsolute:R}=o0({nodeId:I.id,nextPosition:B,nodeLookup:b,nodeExtent:s,nodeOrigin:k,onError:h});I.position=P,I.internals.positionAbsolute=R,x.set(I.id,I)}y(x)},[])}const ed=Y.createContext(null),g_=ed.Provider;ed.Consumer;const B0=()=>Y.useContext(ed),y_=t=>({connectOnClick:t.connectOnClick,noPanClassName:t.noPanClassName,rfId:t.rfId}),v_=(t,r,i)=>s=>{const{connectionClickStartHandle:l,connectionMode:c,connection:d}=s,{fromHandle:h,toHandle:y,isValid:b}=d,k=(y==null?void 0:y.nodeId)===t&&(y==null?void 0:y.id)===r&&(y==null?void 0:y.type)===i;return{connectingFrom:(h==null?void 0:h.nodeId)===t&&(h==null?void 0:h.id)===r&&(h==null?void 0:h.type)===i,connectingTo:k,clickConnecting:(l==null?void 0:l.nodeId)===t&&(l==null?void 0:l.id)===r&&(l==null?void 0:l.type)===i,isPossibleEndHandle:c===$s.Strict?(h==null?void 0:h.type)!==i:t!==(h==null?void 0:h.nodeId)||r!==(h==null?void 0:h.id),connectionInProcess:!!h,clickConnectionInProcess:!!l,valid:k&&b}};function x_({type:t="source",position:r=Ze.Top,isValidConnection:i,isConnectable:s=!0,isConnectableStart:l=!0,isConnectableEnd:c=!0,id:d,onConnect:h,children:y,className:b,onMouseDown:k,onTouchStart:x,...S},C){var ce,J;const j=d||null,M=t==="target",T=Mt(),I=B0(),{connectOnClick:B,noPanClassName:P,rfId:R}=mt(y_,At),{connectingFrom:W,connectingTo:H,clickConnecting:Q,isPossibleEndHandle:G,connectionInProcess:pe,clickConnectionInProcess:we,valid:U}=mt(v_(I,j,t),At);I||(J=(ce=T.getState()).onError)==null||J.call(ce,"010",Jr.error010());const le=se=>{const{defaultEdgeOptions:z,onConnect:K,hasDefaultEdges:F}=T.getState(),A={...z,...se};if(F){const{edges:V,setEdges:be}=T.getState();be(g0(A,V))}K==null||K(A),h==null||h(A)},ve=se=>{if(!I)return;const z=d0(se.nativeEvent);if(l&&(z&&se.button===0||!z)){const K=T.getState();If.onPointerDown(se.nativeEvent,{handleDomNode:se.currentTarget,autoPanOnConnect:K.autoPanOnConnect,connectionMode:K.connectionMode,connectionRadius:K.connectionRadius,domNode:K.domNode,nodeLookup:K.nodeLookup,lib:K.lib,isTarget:M,handleId:j,nodeId:I,flowId:K.rfId,panBy:K.panBy,cancelConnection:K.cancelConnection,onConnectStart:K.onConnectStart,onConnectEnd:(...F)=>{var A,V;return(V=(A=T.getState()).onConnectEnd)==null?void 0:V.call(A,...F)},updateConnection:K.updateConnection,onConnect:le,isValidConnection:i||((...F)=>{var A,V;return((V=(A=T.getState()).isValidConnection)==null?void 0:V.call(A,...F))??!0}),getTransform:()=>T.getState().transform,getFromHandle:()=>T.getState().connection.fromHandle,autoPanSpeed:K.autoPanSpeed,dragThreshold:K.connectionDragThreshold})}z?k==null||k(se):x==null||x(se)},D=se=>{const{onClickConnectStart:z,onClickConnectEnd:K,connectionClickStartHandle:F,connectionMode:A,isValidConnection:V,lib:be,rfId:Se,nodeLookup:$e,connection:Ae}=T.getState();if(!I||!F&&!l)return;if(!F){z==null||z(se.nativeEvent,{nodeId:I,handleId:j,handleType:t}),T.setState({connectionClickStartHandle:{nodeId:I,type:t,id:j}});return}const Oe=c0(se.target),_e=i||V,{connection:Fe,isValid:ke}=If.isValid(se.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:Oe,lib:be,nodeLookup:$e});ke&&Fe&&le(Fe);const Be=structuredClone(Ae);delete Be.inProgress,Be.toPosition=Be.toHandle?Be.toHandle.position:null,K==null||K(se,Be),T.setState({connectionClickStartHandle:null})};return w.jsx("div",{"data-handleid":j,"data-nodeid":I,"data-handlepos":r,"data-id":`${R}-${I}-${j}-${t}`,className:Ut(["react-flow__handle",`react-flow__handle-${r}`,"nodrag",P,b,{source:!M,target:M,connectable:s,connectablestart:l,connectableend:c,clickconnecting:Q,connectingfrom:W,connectingto:H,valid:U,connectionindicator:s&&(!pe||G)&&(pe||we?c:l)}]),onMouseDown:ve,onTouchStart:ve,onClick:B?D:void 0,ref:C,...S,children:y})}const Rs=Y.memo(D0(x_));function w_({data:t,isConnectable:r,sourcePosition:i=Ze.Bottom}){return w.jsxs(w.Fragment,{children:[t==null?void 0:t.label,w.jsx(Rs,{type:"source",position:i,isConnectable:r})]})}function b_({data:t,isConnectable:r,targetPosition:i=Ze.Top,sourcePosition:s=Ze.Bottom}){return w.jsxs(w.Fragment,{children:[w.jsx(Rs,{type:"target",position:i,isConnectable:r}),t==null?void 0:t.label,w.jsx(Rs,{type:"source",position:s,isConnectable:r})]})}function __(){return null}function S_({data:t,isConnectable:r,targetPosition:i=Ze.Top}){return w.jsxs(w.Fragment,{children:[w.jsx(Rs,{type:"target",position:i,isConnectable:r}),t==null?void 0:t.label]})}const xu={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},Zh={input:w_,default:b_,output:S_,group:__};function k_(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 N_=t=>{const{width:r,height:i,x:s,y:l}=Da(t.nodeLookup,{filter:c=>!!c.selected});return{width:Tr(r)?r:null,height:Tr(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 E_({onSelectionContextMenu:t,noPanClassName:r,disableKeyboardA11y:i}){const s=Mt(),{width:l,height:c,transformString:d,userSelectionActive:h}=mt(N_,At),y=F0(),b=Y.useRef(null);Y.useEffect(()=>{var C;i||(C=b.current)==null||C.focus({preventScroll:!0})},[i]);const k=!h&&l!==null&&c!==null;if(z0({nodeRef:b,disabled:!k}),!k)return null;const x=t?C=>{const j=s.getState().nodes.filter(M=>M.selected);t(C,j)}:void 0,S=C=>{Object.prototype.hasOwnProperty.call(xu,C.key)&&(C.preventDefault(),y({direction:xu[C.key],factor:C.shiftKey?4:1}))};return w.jsx("div",{className:Ut(["react-flow__nodesselection","react-flow__container",r]),style:{transform:d},children:w.jsx("div",{ref:b,className:"react-flow__nodesselection-rect",onContextMenu:x,tabIndex:i?void 0:-1,onKeyDown:i?void 0:S,style:{width:l,height:c}})})}const em=typeof window<"u"?window:void 0,C_=t=>({nodesSelectionActive:t.nodesSelectionActive,userSelectionActive:t.userSelectionActive});function H0({children:t,onPaneClick:r,onPaneMouseEnter:i,onPaneMouseMove:s,onPaneMouseLeave:l,onPaneContextMenu:c,onPaneScroll:d,paneClickDistance:h,deleteKeyCode:y,selectionKeyCode:b,selectionOnDrag:k,selectionMode:x,onSelectionStart:S,onSelectionEnd:C,multiSelectionKeyCode:j,panActivationKeyCode:M,zoomActivationKeyCode:T,elementsSelectable:I,zoomOnScroll:B,zoomOnPinch:P,panOnScroll:R,panOnScrollSpeed:W,panOnScrollMode:H,zoomOnDoubleClick:Q,panOnDrag:G,defaultViewport:pe,translateExtent:we,minZoom:U,maxZoom:le,preventScrolling:ve,onSelectionContextMenu:D,noWheelClassName:ce,noPanClassName:J,disableKeyboardA11y:se,onViewportChange:z,isControlledViewport:K}){const{nodesSelectionActive:F,userSelectionActive:A}=mt(C_,At),V=Ta(b,{target:em}),be=Ta(M,{target:em}),Se=be||G,$e=be||R,Ae=k&&Se!==!0,Oe=V||A||Ae;return a_({deleteKeyCode:y,multiSelectionKeyCode:j}),w.jsx(c_,{onPaneContextMenu:c,elementsSelectable:I,zoomOnScroll:B,zoomOnPinch:P,panOnScroll:$e,panOnScrollSpeed:W,panOnScrollMode:H,zoomOnDoubleClick:Q,panOnDrag:!V&&Se,defaultViewport:pe,translateExtent:we,minZoom:U,maxZoom:le,zoomActivationKeyCode:T,preventScrolling:ve,noWheelClassName:ce,noPanClassName:J,onViewportChange:z,isControlledViewport:K,paneClickDistance:h,selectionOnDrag:Ae,children:w.jsxs(h_,{onSelectionStart:S,onSelectionEnd:C,onPaneClick:r,onPaneMouseEnter:i,onPaneMouseMove:s,onPaneMouseLeave:l,onPaneContextMenu:c,onPaneScroll:d,panOnDrag:Se,isSelecting:!!Oe,selectionMode:x,selectionKeyPressed:V,paneClickDistance:h,selectionOnDrag:Ae,children:[t,F&&w.jsx(E_,{onSelectionContextMenu:D,noPanClassName:J,disableKeyboardA11y:se})]})})}H0.displayName="FlowRenderer";const j_=Y.memo(H0),P_=t=>r=>t?Kf(r.nodeLookup,{x:0,y:0,width:r.width,height:r.height},r.transform,!0).map(i=>i.id):Array.from(r.nodeLookup.keys());function M_(t){return mt(Y.useCallback(P_(t),[t]),At)}const $_=t=>t.updateNodeInternals;function T_(){const t=mt($_),[r]=Y.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(i=>{const s=new Map;i.forEach(l=>{const c=l.target.getAttribute("data-id");s.set(c,{id:c,nodeElement:l.target,force:!0})}),t(s)}));return Y.useEffect(()=>()=>{r==null||r.disconnect()},[r]),r}function I_({node:t,nodeType:r,hasDimensions:i,resizeObserver:s}){const l=Mt(),c=Y.useRef(null),d=Y.useRef(null),h=Y.useRef(t.sourcePosition),y=Y.useRef(t.targetPosition),b=Y.useRef(r),k=i&&!!t.internals.handleBounds;return Y.useEffect(()=>{c.current&&!t.hidden&&(!k||d.current!==c.current)&&(d.current&&(s==null||s.unobserve(d.current)),s==null||s.observe(c.current),d.current=c.current)},[k,t.hidden]),Y.useEffect(()=>()=>{d.current&&(s==null||s.unobserve(d.current),d.current=null)},[]),Y.useEffect(()=>{if(c.current){const x=b.current!==r,S=h.current!==t.sourcePosition,C=y.current!==t.targetPosition;(x||S||C)&&(b.current=r,h.current=t.sourcePosition,y.current=t.targetPosition,l.getState().updateNodeInternals(new Map([[t.id,{id:t.id,nodeElement:c.current,force:!0}]])))}},[t.id,r,t.sourcePosition,t.targetPosition]),c}function A_({id:t,onClick:r,onMouseEnter:i,onMouseMove:s,onMouseLeave:l,onContextMenu:c,onDoubleClick:d,nodesDraggable:h,elementsSelectable:y,nodesConnectable:b,nodesFocusable:k,resizeObserver:x,noDragClassName:S,noPanClassName:C,disableKeyboardA11y:j,rfId:M,nodeTypes:T,nodeClickDistance:I,onError:B}){const{node:P,internals:R,isParent:W}=mt(_e=>{const Fe=_e.nodeLookup.get(t),ke=_e.parentLookup.has(t);return{node:Fe,internals:Fe.internals,isParent:ke}},At);let H=P.type||"default",Q=(T==null?void 0:T[H])||Zh[H];Q===void 0&&(B==null||B("003",Jr.error003(H)),H="default",Q=(T==null?void 0:T.default)||Zh.default);const G=!!(P.draggable||h&&typeof P.draggable>"u"),pe=!!(P.selectable||y&&typeof P.selectable>"u"),we=!!(P.connectable||b&&typeof P.connectable>"u"),U=!!(P.focusable||k&&typeof P.focusable>"u"),le=Mt(),ve=l0(P),D=I_({node:P,nodeType:H,hasDimensions:ve,resizeObserver:x}),ce=z0({nodeRef:D,disabled:P.hidden||!G,noDragClassName:S,handleSelector:P.dragHandle,nodeId:t,isSelectable:pe,nodeClickDistance:I}),J=F0();if(P.hidden)return null;const se=To(P),z=k_(P),K=pe||G||r||i||s||l,F=i?_e=>i(_e,{...R.userNode}):void 0,A=s?_e=>s(_e,{...R.userNode}):void 0,V=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,$e=_e=>{const{selectNodesOnDrag:Fe,nodeDragThreshold:ke}=le.getState();pe&&(!Fe||!G||ke>0)&&Of({id:t,store:le,nodeRef:D}),r&&r(_e,{...R.userNode})},Ae=_e=>{if(!(f0(_e.nativeEvent)||j)){if(Zm.includes(_e.key)&&pe){const Fe=_e.key==="Escape";Of({id:t,store:le,unselect:Fe,nodeRef:D})}else if(G&&P.selected&&Object.prototype.hasOwnProperty.call(xu,_e.key)){_e.preventDefault();const{ariaLabelConfig:Fe}=le.getState();le.setState({ariaLiveMessage:Fe["node.a11yDescription.ariaLiveMessage"]({direction:_e.key.replace("Arrow","").toLowerCase(),x:~~R.positionAbsolute.x,y:~~R.positionAbsolute.y})}),J({direction:xu[_e.key],factor:_e.shiftKey?4:1})}}},Oe=()=>{var lt;if(j||!((lt=D.current)!=null&&lt.matches(":focus-visible")))return;const{transform:_e,width:Fe,height:ke,autoPanOnNodeFocus:Be,setCenter:Re}=le.getState();if(!Be)return;Kf(new Map([[t,P]]),{x:0,y:0,width:Fe,height:ke},_e,!0).length>0||Re(P.position.x+se.width/2,P.position.y+se.height/2,{zoom:_e[2]})};return w.jsx("div",{className:Ut(["react-flow__node",`react-flow__node-${H}`,{[C]:G},P.className,{selected:P.selected,selectable:pe,parent:W,draggable:G,dragging:ce}]),ref:D,style:{zIndex:R.z,transform:`translate(${R.positionAbsolute.x}px,${R.positionAbsolute.y}px)`,pointerEvents:K?"all":"none",visibility:ve?"visible":"hidden",...P.style,...z},"data-id":t,"data-testid":`rf__node-${t}`,onMouseEnter:F,onMouseMove:A,onMouseLeave:V,onContextMenu:be,onClick:$e,onDoubleClick:Se,onKeyDown:U?Ae:void 0,tabIndex:U?0:void 0,onFocus:U?Oe:void 0,role:P.ariaRole??(U?"group":void 0),"aria-roledescription":"node","aria-describedby":j?void 0:`${$0}-${M}`,"aria-label":P.ariaLabel,...P.domAttributes,children:w.jsx(g_,{value:t,children:w.jsx(Q,{id:t,data:P.data,type:H,positionAbsoluteX:R.positionAbsolute.x,positionAbsoluteY:R.positionAbsolute.y,selected:P.selected??!1,selectable:pe,draggable:G,deletable:P.deletable??!0,isConnectable:we,sourcePosition:P.sourcePosition,targetPosition:P.targetPosition,dragging:ce,dragHandle:P.dragHandle,zIndex:R.z,parentId:P.parentId,...se})})})}var O_=Y.memo(A_);const R_=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(R_,At),d=M_(t.onlyRenderVisibleElements),h=T_();return w.jsx("div",{className:"react-flow__nodes",style:Iu,children:d.map(y=>w.jsx(O_,{id:y,nodeTypes:t.nodeTypes,nodeExtent:t.nodeExtent,onClick:t.onNodeClick,onMouseEnter:t.onNodeMouseEnter,onMouseMove:t.onNodeMouseMove,onMouseLeave:t.onNodeMouseLeave,onContextMenu:t.onNodeContextMenu,onDoubleClick:t.onNodeDoubleClick,noDragClassName:t.noDragClassName,noPanClassName:t.noPanClassName,rfId:t.rfId,disableKeyboardA11y:t.disableKeyboardA11y,resizeObserver:h,nodesDraggable:r,nodesConnectable:i,nodesFocusable:s,elementsSelectable:l,nodeClickDistance:t.nodeClickDistance,onError:c},y))})}V0.displayName="NodeRenderer";const D_=Y.memo(V0);function L_(t){return mt(Y.useCallback(i=>{if(!t)return i.edges.map(l=>l.id);const s=[];if(i.width&&i.height)for(const l of i.edges){const c=i.nodeLookup.get(l.source),d=i.nodeLookup.get(l.target);c&&d&&L1({sourceNode:c,targetNode:d,width:i.width,height:i.height,transform:i.transform})&&s.push(l.id)}return s},[t]),At)}const z_=({color:t="none",strokeWidth:r=1})=>{const i={strokeWidth:r,...t&&{stroke:t}};return w.jsx("polyline",{className:"arrow",style:i,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},F_=({color:t="none",strokeWidth:r=1})=>{const i={strokeWidth:r,...t&&{stroke:t,fill:t}};return w.jsx("polyline",{className:"arrowclosed",style:i,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},tm={[gu.Arrow]:z_,[gu.ArrowClosed]:F_};function B_(t){const r=Mt();return Y.useMemo(()=>{var l,c;return Object.prototype.hasOwnProperty.call(tm,t)?tm[t]:((c=(l=r.getState()).onError)==null||c.call(l,"009",Jr.error009(t)),null)},[t])}const H_=({id:t,type:r,color:i,width:s=12.5,height:l=12.5,markerUnits:c="strokeWidth",strokeWidth:d,orient:h="auto-start-reverse"})=>{const y=B_(r);return y?w.jsx("marker",{className:"react-flow__arrowhead",id:t,markerWidth:`${s}`,markerHeight:`${l}`,viewBox:"-10 -10 20 20",markerUnits:c,orient:h,refX:"0",refY:"0",children:w.jsx(y,{color:i,strokeWidth:d})}):null},U0=({defaultColor:t,rfId:r})=>{const i=mt(c=>c.edges),s=mt(c=>c.defaultEdgeOptions),l=Y.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?w.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:w.jsx("defs",{children:l.map(c=>w.jsx(H_,{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};U0.displayName="MarkerDefinitions";var V_=Y.memo(U0);function K0({x:t,y:r,label:i,labelStyle:s,labelShowBg:l=!0,labelBgStyle:c,labelBgPadding:d=[2,4],labelBgBorderRadius:h=2,children:y,className:b,...k}){const[x,S]=Y.useState({x:1,y:0,width:0,height:0}),C=Ut(["react-flow__edge-textwrapper",b]),j=Y.useRef(null);return Y.useEffect(()=>{if(j.current){const M=j.current.getBBox();S({x:M.x,y:M.y,width:M.width,height:M.height})}},[i]),i?w.jsxs("g",{transform:`translate(${t-x.width/2} ${r-x.height/2})`,className:C,visibility:x.width?"visible":"hidden",...k,children:[l&&w.jsx("rect",{width:x.width+2*d[0],x:-d[0],y:-d[1],height:x.height+2*d[1],className:"react-flow__edge-textbg",style:c,rx:h,ry:h}),w.jsx("text",{className:"react-flow__edge-text",y:x.height/2,dy:"0.3em",ref:j,style:s,children:i}),y]}):null}K0.displayName="EdgeText";const U_=Y.memo(K0);function Au({path:t,labelX:r,labelY:i,label:s,labelStyle:l,labelShowBg:c,labelBgStyle:d,labelBgPadding:h,labelBgBorderRadius:y,interactionWidth:b=20,...k}){return w.jsxs(w.Fragment,{children:[w.jsx("path",{...k,d:t,fill:"none",className:Ut(["react-flow__edge-path",k.className])}),b?w.jsx("path",{d:t,fill:"none",strokeOpacity:0,strokeWidth:b,className:"react-flow__edge-interaction"}):null,s&&Tr(r)&&Tr(i)?w.jsx(U_,{x:r,y:i,label:s,labelStyle:l,labelShowBg:c,labelBgStyle:d,labelBgPadding:h,labelBgBorderRadius:y}):null]})}function nm({pos:t,x1:r,y1:i,x2:s,y2:l}){return t===Ze.Left||t===Ze.Right?[.5*(r+s),i]:[r,.5*(i+l)]}function q0({sourceX:t,sourceY:r,sourcePosition:i=Ze.Bottom,targetX:s,targetY:l,targetPosition:c=Ze.Top}){const[d,h]=nm({pos:i,x1:t,y1:r,x2:s,y2:l}),[y,b]=nm({pos:c,x1:s,y1:l,x2:t,y2:r}),[k,x,S,C]=p0({sourceX:t,sourceY:r,targetX:s,targetY:l,sourceControlX:d,sourceControlY:h,targetControlX:y,targetControlY:b});return[`M${t},${r} C${d},${h} ${y},${b} ${s},${l}`,k,x,S,C]}function W0(t){return Y.memo(({id:r,sourceX:i,sourceY:s,targetX:l,targetY:c,sourcePosition:d,targetPosition:h,label:y,labelStyle:b,labelShowBg:k,labelBgStyle:x,labelBgPadding:S,labelBgBorderRadius:C,style:j,markerEnd:M,markerStart:T,interactionWidth:I})=>{const[B,P,R]=q0({sourceX:i,sourceY:s,sourcePosition:d,targetX:l,targetY:c,targetPosition:h}),W=t.isInternal?void 0:r;return w.jsx(Au,{id:W,path:B,labelX:P,labelY:R,label:y,labelStyle:b,labelShowBg:k,labelBgStyle:x,labelBgPadding:S,labelBgBorderRadius:C,style:j,markerEnd:M,markerStart:T,interactionWidth:I})})}const K_=W0({isInternal:!1}),Y0=W0({isInternal:!0});K_.displayName="SimpleBezierEdge";Y0.displayName="SimpleBezierEdgeInternal";function X0(t){return Y.memo(({id:r,sourceX:i,sourceY:s,targetX:l,targetY:c,label:d,labelStyle:h,labelShowBg:y,labelBgStyle:b,labelBgPadding:k,labelBgBorderRadius:x,style:S,sourcePosition:C=Ze.Bottom,targetPosition:j=Ze.Top,markerEnd:M,markerStart:T,pathOptions:I,interactionWidth:B})=>{const[P,R,W]=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}),H=t.isInternal?void 0:r;return w.jsx(Au,{id:H,path:P,labelX:R,labelY:W,label:d,labelStyle:h,labelShowBg:y,labelBgStyle:b,labelBgPadding:k,labelBgBorderRadius:x,style:S,markerEnd:M,markerStart:T,interactionWidth:B})})}const Q0=X0({isInternal:!1}),G0=X0({isInternal:!0});Q0.displayName="SmoothStepEdge";G0.displayName="SmoothStepEdgeInternal";function J0(t){return Y.memo(({id:r,...i})=>{var l;const s=t.isInternal?void 0:r;return w.jsx(Q0,{...i,id:s,pathOptions:Y.useMemo(()=>{var c;return{borderRadius:0,offset:(c=i.pathOptions)==null?void 0:c.offset}},[(l=i.pathOptions)==null?void 0:l.offset])})})}const q_=J0({isInternal:!1}),Z0=J0({isInternal:!0});q_.displayName="StepEdge";Z0.displayName="StepEdgeInternal";function eg(t){return Y.memo(({id:r,sourceX:i,sourceY:s,targetX:l,targetY:c,label:d,labelStyle:h,labelShowBg:y,labelBgStyle:b,labelBgPadding:k,labelBgBorderRadius:x,style:S,markerEnd:C,markerStart:j,interactionWidth:M})=>{const[T,I,B]=y0({sourceX:i,sourceY:s,targetX:l,targetY:c}),P=t.isInternal?void 0:r;return w.jsx(Au,{id:P,path:T,labelX:I,labelY:B,label:d,labelStyle:h,labelShowBg:y,labelBgStyle:b,labelBgPadding:k,labelBgBorderRadius:x,style:S,markerEnd:C,markerStart:j,interactionWidth:M})})}const W_=eg({isInternal:!1}),tg=eg({isInternal:!0});W_.displayName="StraightEdge";tg.displayName="StraightEdgeInternal";function ng(t){return Y.memo(({id:r,sourceX:i,sourceY:s,targetX:l,targetY:c,sourcePosition:d=Ze.Bottom,targetPosition:h=Ze.Top,label:y,labelStyle:b,labelShowBg:k,labelBgStyle:x,labelBgPadding:S,labelBgBorderRadius:C,style:j,markerEnd:M,markerStart:T,pathOptions:I,interactionWidth:B})=>{const[P,R,W]=h0({sourceX:i,sourceY:s,sourcePosition:d,targetX:l,targetY:c,targetPosition:h,curvature:I==null?void 0:I.curvature}),H=t.isInternal?void 0:r;return w.jsx(Au,{id:H,path:P,labelX:R,labelY:W,label:y,labelStyle:b,labelShowBg:k,labelBgStyle:x,labelBgPadding:S,labelBgBorderRadius:C,style:j,markerEnd:M,markerStart:T,interactionWidth:B})})}const Y_=ng({isInternal:!1}),rg=ng({isInternal:!0});Y_.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},X_=(t,r,i)=>i===Ze.Left?t-r:i===Ze.Right?t+r:t,Q_=(t,r,i)=>i===Ze.Top?t-r:i===Ze.Bottom?t+r:t,im="react-flow__edgeupdater";function sm({position:t,centerX:r,centerY:i,radius:s=10,onMouseDown:l,onMouseEnter:c,onMouseOut:d,type:h}){return w.jsx("circle",{onMouseDown:l,onMouseEnter:c,onMouseOut:d,className:Ut([im,`${im}-${h}`]),cx:X_(r,s,t),cy:Q_(i,s,t),r:s,stroke:"transparent",fill:"transparent"})}function G_({isReconnectable:t,reconnectRadius:r,edge:i,sourceX:s,sourceY:l,targetX:c,targetY:d,sourcePosition:h,targetPosition:y,onReconnect:b,onReconnectStart:k,onReconnectEnd:x,setReconnecting:S,setUpdateHover:C}){const j=Mt(),M=(R,W)=>{if(R.button!==0)return;const{autoPanOnConnect:H,domNode:Q,connectionMode:G,connectionRadius:pe,lib:we,onConnectStart:U,cancelConnection:le,nodeLookup:ve,rfId:D,panBy:ce,updateConnection:J}=j.getState(),se=W.type==="target",z=(A,V)=>{S(!1),x==null||x(A,i,W.type,V)},K=A=>b==null?void 0:b(i,A),F=(A,V)=>{S(!0),k==null||k(R,i,W.type),U==null||U(A,V)};If.onPointerDown(R.nativeEvent,{autoPanOnConnect:H,connectionMode:G,connectionRadius:pe,domNode:Q,handleId:W.id,nodeId:W.nodeId,nodeLookup:ve,isTarget:se,edgeUpdaterType:W.type,lib:we,flowId:D,cancelConnection:le,panBy:ce,isValidConnection:(...A)=>{var V,be;return((be=(V=j.getState()).isValidConnection)==null?void 0:be.call(V,...A))??!0},onConnect:K,onConnectStart:F,onConnectEnd:(...A)=>{var V,be;return(be=(V=j.getState()).onConnectEnd)==null?void 0:be.call(V,...A)},onReconnectEnd:z,updateConnection:J,getTransform:()=>j.getState().transform,getFromHandle:()=>j.getState().connection.fromHandle,dragThreshold:j.getState().connectionDragThreshold,handleDomNode:R.currentTarget})},T=R=>M(R,{nodeId:i.target,id:i.targetHandle??null,type:"target"}),I=R=>M(R,{nodeId:i.source,id:i.sourceHandle??null,type:"source"}),B=()=>C(!0),P=()=>C(!1);return w.jsxs(w.Fragment,{children:[(t===!0||t==="source")&&w.jsx(sm,{position:h,centerX:s,centerY:l,radius:r,onMouseDown:T,onMouseEnter:B,onMouseOut:P,type:"source"}),(t===!0||t==="target")&&w.jsx(sm,{position:y,centerX:c,centerY:d,radius:r,onMouseDown:I,onMouseEnter:B,onMouseOut:P,type:"target"})]})}function J_({id:t,edgesFocusable:r,edgesReconnectable:i,elementsSelectable:s,onClick:l,onDoubleClick:c,onContextMenu:d,onMouseEnter:h,onMouseMove:y,onMouseLeave:b,reconnectRadius:k,onReconnect:x,onReconnectStart:S,onReconnectEnd:C,rfId:j,edgeTypes:M,noPanClassName:T,onError:I,disableKeyboardA11y:B}){let P=mt(Re=>Re.edgeLookup.get(t));const R=mt(Re=>Re.defaultEdgeOptions);P=R?{...R,...P}:P;let W=P.type||"default",H=(M==null?void 0:M[W])||rm[W];H===void 0&&(I==null||I("011",Jr.error011(W)),W="default",H=(M==null?void 0:M.default)||rm.default);const Q=!!(P.focusable||r&&typeof P.focusable>"u"),G=typeof x<"u"&&(P.reconnectable||i&&typeof P.reconnectable>"u"),pe=!!(P.selectable||s&&typeof P.selectable>"u"),we=Y.useRef(null),[U,le]=Y.useState(!1),[ve,D]=Y.useState(!1),ce=Mt(),{zIndex:J,sourceX:se,sourceY:z,targetX:K,targetY:F,sourcePosition:A,targetPosition:V}=mt(Y.useCallback(Re=>{const qe=Re.nodeLookup.get(P.source),lt=Re.nodeLookup.get(P.target);if(!qe||!lt)return{zIndex:P.zIndex,...om};const ut=U1({id:t,sourceNode:qe,targetNode:lt,sourceHandle:P.sourceHandle||null,targetHandle:P.targetHandle||null,connectionMode:Re.connectionMode,onError:I});return{zIndex:D1({selected:P.selected,zIndex:P.zIndex,sourceNode:qe,targetNode:lt,elevateOnSelect:Re.elevateEdgesOnSelect,zIndexMode:Re.zIndexMode}),...ut||om}},[P.source,P.target,P.sourceHandle,P.targetHandle,P.selected,P.zIndex]),At),be=Y.useMemo(()=>P.markerStart?`url('#${$f(P.markerStart,j)}')`:void 0,[P.markerStart,j]),Se=Y.useMemo(()=>P.markerEnd?`url('#${$f(P.markerEnd,j)}')`:void 0,[P.markerEnd,j]);if(P.hidden||se===null||z===null||K===null||F===null)return null;const $e=Re=>{var ot;const{addSelectedEdges:qe,unselectNodesAndEdges:lt,multiSelectionActive:ut}=ce.getState();pe&&(ce.setState({nodesSelectionActive:!1}),P.selected&&ut?(lt({nodes:[],edges:[P]}),(ot=we.current)==null||ot.blur()):qe([t])),l&&l(Re,P)},Ae=c?Re=>{c(Re,{...P})}:void 0,Oe=d?Re=>{d(Re,{...P})}:void 0,_e=h?Re=>{h(Re,{...P})}:void 0,Fe=y?Re=>{y(Re,{...P})}:void 0,ke=b?Re=>{b(Re,{...P})}:void 0,Be=Re=>{var qe;if(!B&&Zm.includes(Re.key)&&pe){const{unselectNodesAndEdges:lt,addSelectedEdges:ut}=ce.getState();Re.key==="Escape"?((qe=we.current)==null||qe.blur(),lt({edges:[P]})):ut([t])}};return w.jsx("svg",{style:{zIndex:J},children:w.jsxs("g",{className:Ut(["react-flow__edge",`react-flow__edge-${W}`,P.className,T,{selected:P.selected,animated:P.animated,inactive:!pe&&!l,updating:U,selectable:pe}]),onClick:$e,onDoubleClick:Ae,onContextMenu:Oe,onMouseEnter:_e,onMouseMove:Fe,onMouseLeave:ke,onKeyDown:Q?Be:void 0,tabIndex:Q?0:void 0,role:P.ariaRole??(Q?"group":"img"),"aria-roledescription":"edge","data-id":t,"data-testid":`rf__edge-${t}`,"aria-label":P.ariaLabel===null?void 0:P.ariaLabel||`Edge from ${P.source} to ${P.target}`,"aria-describedby":Q?`${T0}-${j}`:void 0,ref:we,...P.domAttributes,children:[!ve&&w.jsx(H,{id:t,source:P.source,target:P.target,type:P.type,selected:P.selected,animated:P.animated,selectable:pe,deletable:P.deletable??!0,label:P.label,labelStyle:P.labelStyle,labelShowBg:P.labelShowBg,labelBgStyle:P.labelBgStyle,labelBgPadding:P.labelBgPadding,labelBgBorderRadius:P.labelBgBorderRadius,sourceX:se,sourceY:z,targetX:K,targetY:F,sourcePosition:A,targetPosition:V,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}),G&&w.jsx(G_,{edge:P,isReconnectable:G,reconnectRadius:k,onReconnect:x,onReconnectStart:S,onReconnectEnd:C,sourceX:se,sourceY:z,targetX:K,targetY:F,sourcePosition:A,targetPosition:V,setUpdateHover:le,setReconnecting:D})]})})}var Z_=Y.memo(J_);const eS=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:h,onEdgeMouseMove:y,onEdgeMouseLeave:b,onEdgeClick:k,reconnectRadius:x,onEdgeDoubleClick:S,onReconnectStart:C,onReconnectEnd:j,disableKeyboardA11y:M}){const{edgesFocusable:T,edgesReconnectable:I,elementsSelectable:B,onError:P}=mt(eS,At),R=L_(r);return w.jsxs("div",{className:"react-flow__edges",children:[w.jsx(V_,{defaultColor:t,rfId:i}),R.map(W=>w.jsx(Z_,{id:W,edgesFocusable:T,edgesReconnectable:I,elementsSelectable:B,noPanClassName:l,onReconnect:c,onContextMenu:d,onMouseEnter:h,onMouseMove:y,onMouseLeave:b,onClick:k,reconnectRadius:x,onDoubleClick:S,onReconnectStart:C,onReconnectEnd:j,rfId:i,onError:P,edgeTypes:s,disableKeyboardA11y:M},W))]})}og.displayName="EdgeRenderer";const tS=Y.memo(og),nS=t=>`translate(${t.transform[0]}px,${t.transform[1]}px) scale(${t.transform[2]})`;function rS({children:t}){const r=mt(nS);return w.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:r},children:t})}function oS(t){const r=Zf(),i=Y.useRef(!1);Y.useEffect(()=>{!i.current&&r.viewportInitialized&&t&&(setTimeout(()=>t(r),1),i.current=!0)},[t,r.viewportInitialized])}const iS=t=>{var r;return(r=t.panZoom)==null?void 0:r.syncViewport};function sS(t){const r=mt(iS),i=Mt();return Y.useEffect(()=>{t&&(r==null||r(t),i.setState({transform:[t.x,t.y,t.zoom]}))},[t,r]),null}function aS(t){return t.connection.inProgress?{...t.connection,to:za(t.connection.to,t.transform)}:{...t.connection}}function lS(t){return aS}function uS(t){const r=lS();return mt(r,At)}const cS=t=>({nodesConnectable:t.nodesConnectable,isValid:t.connection.isValid,inProgress:t.connection.inProgress,width:t.width,height:t.height});function fS({containerStyle:t,style:r,type:i,component:s}){const{nodesConnectable:l,width:c,height:d,isValid:h,inProgress:y}=mt(cS,At);return!(c&&l&&y)?null:w.jsx("svg",{style:t,width:c,height:d,className:"react-flow__connectionline react-flow__container",children:w.jsx("g",{className:Ut(["react-flow__connection",n0(h)]),children:w.jsx(ig,{style:r,type:i,CustomComponent:s,isValid:h})})})}const ig=({style:t,type:r=ui.Bezier,CustomComponent:i,isValid:s})=>{const{inProgress:l,from:c,fromNode:d,fromHandle:h,fromPosition:y,to:b,toNode:k,toHandle:x,toPosition:S,pointer:C}=uS();if(!l)return;if(i)return w.jsx(i,{connectionLineType:r,connectionLineStyle:t,fromNode:d,fromHandle:h,fromX:c.x,fromY:c.y,toX:b.x,toY:b.y,fromPosition:y,toPosition:S,connectionStatus:n0(s),toNode:k,toHandle:x,pointer:C});let j="";const M={sourceX:c.x,sourceY:c.y,sourcePosition:y,targetX:b.x,targetY:b.y,targetPosition:S};switch(r){case ui.Bezier:[j]=h0(M);break;case ui.SimpleBezier:[j]=q0(M);break;case ui.Step:[j]=Mf({...M,borderRadius:0});break;case ui.SmoothStep:[j]=Mf(M);break;default:[j]=y0(M)}return w.jsx("path",{d:j,fill:"none",className:"react-flow__connection-path",style:t})};ig.displayName="ConnectionLine";const dS={};function am(t=dS){Y.useRef(t),Mt(),Y.useEffect(()=>{},[t])}function pS(){Mt(),Y.useRef(!1),Y.useEffect(()=>{},[])}function sg({nodeTypes:t,edgeTypes:r,onInit:i,onNodeClick:s,onEdgeClick:l,onNodeDoubleClick:c,onEdgeDoubleClick:d,onNodeMouseEnter:h,onNodeMouseMove:y,onNodeMouseLeave:b,onNodeContextMenu:k,onSelectionContextMenu:x,onSelectionStart:S,onSelectionEnd:C,connectionLineType:j,connectionLineStyle:M,connectionLineComponent:T,connectionLineContainerStyle:I,selectionKeyCode:B,selectionOnDrag:P,selectionMode:R,multiSelectionKeyCode:W,panActivationKeyCode:H,zoomActivationKeyCode:Q,deleteKeyCode:G,onlyRenderVisibleElements:pe,elementsSelectable:we,defaultViewport:U,translateExtent:le,minZoom:ve,maxZoom:D,preventScrolling:ce,defaultMarkerColor:J,zoomOnScroll:se,zoomOnPinch:z,panOnScroll:K,panOnScrollSpeed:F,panOnScrollMode:A,zoomOnDoubleClick:V,panOnDrag:be,onPaneClick:Se,onPaneMouseEnter:$e,onPaneMouseMove:Ae,onPaneMouseLeave:Oe,onPaneScroll:_e,onPaneContextMenu:Fe,paneClickDistance:ke,nodeClickDistance:Be,onEdgeContextMenu:Re,onEdgeMouseEnter:qe,onEdgeMouseMove:lt,onEdgeMouseLeave:ut,reconnectRadius:ot,onReconnect:$t,onReconnectStart:St,onReconnectEnd:nn,noDragClassName:Lt,noWheelClassName:_t,noPanClassName:dn,disableKeyboardA11y:rn,nodeExtent:mr,rfId:bn,viewport:Nt,onViewportChange:Kt}){return am(t),am(r),pS(),oS(i),sS(Nt),w.jsx(j_,{onPaneClick:Se,onPaneMouseEnter:$e,onPaneMouseMove:Ae,onPaneMouseLeave:Oe,onPaneContextMenu:Fe,onPaneScroll:_e,paneClickDistance:ke,deleteKeyCode:G,selectionKeyCode:B,selectionOnDrag:P,selectionMode:R,onSelectionStart:S,onSelectionEnd:C,multiSelectionKeyCode:W,panActivationKeyCode:H,zoomActivationKeyCode:Q,elementsSelectable:we,zoomOnScroll:se,zoomOnPinch:z,zoomOnDoubleClick:V,panOnScroll:K,panOnScrollSpeed:F,panOnScrollMode:A,panOnDrag:be,defaultViewport:U,translateExtent:le,minZoom:ve,maxZoom:D,onSelectionContextMenu:x,preventScrolling:ce,noDragClassName:Lt,noWheelClassName:_t,noPanClassName:dn,disableKeyboardA11y:rn,onViewportChange:Kt,isControlledViewport:!!Nt,children:w.jsxs(rS,{children:[w.jsx(tS,{edgeTypes:r,onEdgeClick:l,onEdgeDoubleClick:d,onReconnect:$t,onReconnectStart:St,onReconnectEnd:nn,onlyRenderVisibleElements:pe,onEdgeContextMenu:Re,onEdgeMouseEnter:qe,onEdgeMouseMove:lt,onEdgeMouseLeave:ut,reconnectRadius:ot,defaultMarkerColor:J,noPanClassName:dn,disableKeyboardA11y:rn,rfId:bn}),w.jsx(fS,{style:M,type:j,component:T,containerStyle:I}),w.jsx("div",{className:"react-flow__edgelabel-renderer"}),w.jsx(D_,{nodeTypes:t,onNodeClick:s,onNodeDoubleClick:c,onNodeMouseEnter:h,onNodeMouseMove:y,onNodeMouseLeave:b,onNodeContextMenu:k,nodeClickDistance:Be,onlyRenderVisibleElements:pe,noPanClassName:dn,noDragClassName:Lt,disableKeyboardA11y:rn,nodeExtent:mr,rfId:bn}),w.jsx("div",{className:"react-flow__viewport-portal"})]})})}sg.displayName="GraphView";const hS=Y.memo(sg),lm=({nodes:t,edges:r,defaultNodes:i,defaultEdges:s,width:l,height:c,fitView:d,fitViewOptions:h,minZoom:y=.5,maxZoom:b=2,nodeOrigin:k,nodeExtent:x,zIndexMode:S="basic"}={})=>{const C=new Map,j=new Map,M=new Map,T=new Map,I=s??r??[],B=i??t??[],P=k??[0,0],R=x??ja;w0(M,T,I);const{nodesInitialized:W}=Tf(B,C,j,{nodeOrigin:P,nodeExtent:R,zIndexMode:S});let H=[0,0,1];if(d&&l&&c){const Q=Da(C,{filter:U=>!!((U.width||U.initialWidth)&&(U.height||U.initialHeight))}),{x:G,y:pe,zoom:we}=qf(Q,l,c,y,b,(h==null?void 0:h.padding)??.1);H=[G,pe,we]}return{rfId:"1",width:l??0,height:c??0,transform:H,nodes:B,nodesInitialized:W,nodeLookup:C,parentLookup:j,edges:I,edgeLookup:T,connectionLookup:M,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:i!==void 0,hasDefaultEdges:s!==void 0,panZoom:null,minZoom:y,maxZoom:b,translateExtent:ja,nodeExtent:R,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:$s.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:P,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:d??!1,fitViewOptions:h,fitViewResolver:null,connection:{...t0},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:$1,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:e0,zIndexMode:S,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},mS=({nodes:t,edges:r,defaultNodes:i,defaultEdges:s,width:l,height:c,fitView:d,fitViewOptions:h,minZoom:y,maxZoom:b,nodeOrigin:k,nodeExtent:x,zIndexMode:S})=>Ab((C,j)=>{async function M(){const{nodeLookup:T,panZoom:I,fitViewOptions:B,fitViewResolver:P,width:R,height:W,minZoom:H,maxZoom:Q}=j();I&&(await P1({nodes:T,width:R,height:W,panZoom:I,minZoom:H,maxZoom:Q},B),P==null||P.resolve(!0),C({fitViewResolver:null}))}return{...lm({nodes:t,edges:r,width:l,height:c,fitView:d,fitViewOptions:h,minZoom:y,maxZoom:b,nodeOrigin:k,nodeExtent:x,defaultNodes:i,defaultEdges:s,zIndexMode:S}),setNodes:T=>{const{nodeLookup:I,parentLookup:B,nodeOrigin:P,elevateNodesOnSelect:R,fitViewQueued:W,zIndexMode:H,nodesSelectionActive:Q}=j(),{nodesInitialized:G,hasSelectedNodes:pe}=Tf(T,I,B,{nodeOrigin:P,nodeExtent:x,elevateNodesOnSelect:R,checkEquality:!0,zIndexMode:H}),we=Q&&pe;W&&G?(M(),C({nodes:T,nodesInitialized:G,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:we})):C({nodes:T,nodesInitialized:G,nodesSelectionActive:we})},setEdges:T=>{const{connectionLookup:I,edgeLookup:B}=j();w0(I,B,T),C({edges:T})},setDefaultNodesAndEdges:(T,I)=>{if(T){const{setNodes:B}=j();B(T),C({hasDefaultNodes:!0})}if(I){const{setEdges:B}=j();B(I),C({hasDefaultEdges:!0})}},updateNodeInternals:T=>{const{triggerNodeChanges:I,nodeLookup:B,parentLookup:P,domNode:R,nodeOrigin:W,nodeExtent:H,debug:Q,fitViewQueued:G,zIndexMode:pe}=j(),{changes:we,updatedInternals:U}=J1(T,B,P,R,W,H,pe);U&&(Y1(B,P,{nodeOrigin:W,nodeExtent:H,zIndexMode:pe}),G?(M(),C({fitViewQueued:!1,fitViewOptions:void 0})):C({}),(we==null?void 0:we.length)>0&&(Q&&console.log("React Flow: trigger node changes",we),I==null||I(we)))},updateNodePositions:(T,I=!1)=>{const B=[];let P=[];const{nodeLookup:R,triggerNodeChanges:W,connection:H,updateConnection:Q,onNodesChangeMiddlewareMap:G}=j();for(const[pe,we]of T){const U=R.get(pe),le=!!(U!=null&&U.expandParent&&(U!=null&&U.parentId)&&(we!=null&&we.position)),ve={id:pe,type:"position",position:le?{x:Math.max(0,we.position.x),y:Math.max(0,we.position.y)}:we.position,dragging:I};if(U&&H.inProgress&&H.fromNode.id===U.id){const D=Fi(U,H.fromHandle,Ze.Left,!0);Q({...H,from:D})}le&&U.parentId&&B.push({id:pe,parentId:U.parentId,rect:{...we.internals.positionAbsolute,width:we.measured.width??0,height:we.measured.height??0}}),P.push(ve)}if(B.length>0){const{parentLookup:pe,nodeOrigin:we}=j(),U=Jf(B,R,pe,we);P.push(...U)}for(const pe of G.values())P=pe(P);W(P)},triggerNodeChanges:T=>{const{onNodesChange:I,setNodes:B,nodes:P,hasDefaultNodes:R,debug:W}=j();if(T!=null&&T.length){if(R){const H=O0(T,P);B(H)}W&&console.log("React Flow: trigger node changes",T),I==null||I(T)}},triggerEdgeChanges:T=>{const{onEdgesChange:I,setEdges:B,edges:P,hasDefaultEdges:R,debug:W}=j();if(T!=null&&T.length){if(R){const H=R0(T,P);B(H)}W&&console.log("React Flow: trigger edge changes",T),I==null||I(T)}},addSelectedNodes:T=>{const{multiSelectionActive:I,edgeLookup:B,nodeLookup:P,triggerNodeChanges:R,triggerEdgeChanges:W}=j();if(I){const H=T.map(Q=>Ii(Q,!0));R(H);return}R(Es(P,new Set([...T]),!0)),W(Es(B))},addSelectedEdges:T=>{const{multiSelectionActive:I,edgeLookup:B,nodeLookup:P,triggerNodeChanges:R,triggerEdgeChanges:W}=j();if(I){const H=T.map(Q=>Ii(Q,!0));W(H);return}W(Es(B,new Set([...T]))),R(Es(P,new Set,!0))},unselectNodesAndEdges:({nodes:T,edges:I}={})=>{const{edges:B,nodes:P,nodeLookup:R,triggerNodeChanges:W,triggerEdgeChanges:H}=j(),Q=T||P,G=I||B,pe=[];for(const U of Q){if(!U.selected)continue;const le=R.get(U.id);le&&(le.selected=!1),pe.push(Ii(U.id,!1))}const we=[];for(const U of G)U.selected&&we.push(Ii(U.id,!1));W(pe),H(we)},setMinZoom:T=>{const{panZoom:I,maxZoom:B}=j();I==null||I.setScaleExtent([T,B]),C({minZoom:T})},setMaxZoom:T=>{const{panZoom:I,minZoom:B}=j();I==null||I.setScaleExtent([B,T]),C({maxZoom:T})},setTranslateExtent:T=>{var I;(I=j().panZoom)==null||I.setTranslateExtent(T),C({translateExtent:T})},resetSelectedElements:()=>{const{edges:T,nodes:I,triggerNodeChanges:B,triggerEdgeChanges:P,elementsSelectable:R}=j();if(!R)return;const W=I.reduce((Q,G)=>G.selected?[...Q,Ii(G.id,!1)]:Q,[]),H=T.reduce((Q,G)=>G.selected?[...Q,Ii(G.id,!1)]:Q,[]);B(W),P(H)},setNodeExtent:T=>{const{nodes:I,nodeLookup:B,parentLookup:P,nodeOrigin:R,elevateNodesOnSelect:W,nodeExtent:H,zIndexMode:Q}=j();T[0][0]===H[0][0]&&T[0][1]===H[0][1]&&T[1][0]===H[1][0]&&T[1][1]===H[1][1]||(Tf(I,B,P,{nodeOrigin:R,nodeExtent:T,elevateNodesOnSelect:W,checkEquality:!1,zIndexMode:Q}),C({nodeExtent:T}))},panBy:T=>{const{transform:I,width:B,height:P,panZoom:R,translateExtent:W}=j();return Z1({delta:T,panZoom:R,transform:I,translateExtent:W,width:B,height:P})},setCenter:async(T,I,B)=>{const{width:P,height:R,maxZoom:W,panZoom:H}=j();if(!H)return Promise.resolve(!1);const Q=typeof(B==null?void 0:B.zoom)<"u"?B.zoom:W;return await H.setViewport({x:P/2-T*Q,y:R/2-I*Q,zoom:Q},{duration:B==null?void 0:B.duration,ease:B==null?void 0:B.ease,interpolate:B==null?void 0:B.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{C({connection:{...t0}})},updateConnection:T=>{C({connection:T})},reset:()=>C({...lm()})}},Object.is);function gS({initialNodes:t,initialEdges:r,defaultNodes:i,defaultEdges:s,initialWidth:l,initialHeight:c,initialMinZoom:d,initialMaxZoom:h,initialFitViewOptions:y,fitView:b,nodeOrigin:k,nodeExtent:x,zIndexMode:S,children:C}){const[j]=Y.useState(()=>mS({nodes:t,edges:r,defaultNodes:i,defaultEdges:s,width:l,height:c,fitView:b,minZoom:d,maxZoom:h,fitViewOptions:y,nodeOrigin:k,nodeExtent:x,zIndexMode:S}));return w.jsx(Ob,{value:j,children:w.jsx(r_,{children:C})})}function yS({children:t,nodes:r,edges:i,defaultNodes:s,defaultEdges:l,width:c,height:d,fitView:h,fitViewOptions:y,minZoom:b,maxZoom:k,nodeOrigin:x,nodeExtent:S,zIndexMode:C}){return Y.useContext(Tu)?w.jsx(w.Fragment,{children:t}):w.jsx(gS,{initialNodes:r,initialEdges:i,defaultNodes:s,defaultEdges:l,initialWidth:c,initialHeight:d,fitView:h,initialFitViewOptions:y,initialMinZoom:b,initialMaxZoom:k,nodeOrigin:x,nodeExtent:S,zIndexMode:C,children:t})}const vS={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function xS({nodes:t,edges:r,defaultNodes:i,defaultEdges:s,className:l,nodeTypes:c,edgeTypes:d,onNodeClick:h,onEdgeClick:y,onInit:b,onMove:k,onMoveStart:x,onMoveEnd:S,onConnect:C,onConnectStart:j,onConnectEnd:M,onClickConnectStart:T,onClickConnectEnd:I,onNodeMouseEnter:B,onNodeMouseMove:P,onNodeMouseLeave:R,onNodeContextMenu:W,onNodeDoubleClick:H,onNodeDragStart:Q,onNodeDrag:G,onNodeDragStop:pe,onNodesDelete:we,onEdgesDelete:U,onDelete:le,onSelectionChange:ve,onSelectionDragStart:D,onSelectionDrag:ce,onSelectionDragStop:J,onSelectionContextMenu:se,onSelectionStart:z,onSelectionEnd:K,onBeforeDelete:F,connectionMode:A,connectionLineType:V=ui.Bezier,connectionLineStyle:be,connectionLineComponent:Se,connectionLineContainerStyle:$e,deleteKeyCode:Ae="Backspace",selectionKeyCode:Oe="Shift",selectionOnDrag:_e=!1,selectionMode:Fe=Pa.Full,panActivationKeyCode:ke="Space",multiSelectionKeyCode:Be=$a()?"Meta":"Control",zoomActivationKeyCode:Re=$a()?"Meta":"Control",snapToGrid:qe,snapGrid:lt,onlyRenderVisibleElements:ut=!1,selectNodesOnDrag:ot,nodesDraggable:$t,autoPanOnNodeFocus:St,nodesConnectable:nn,nodesFocusable:Lt,nodeOrigin:_t=I0,edgesFocusable:dn,edgesReconnectable:rn,elementsSelectable:mr=!0,defaultViewport:bn=Yb,minZoom:Nt=.5,maxZoom:Kt=2,translateExtent:$n=ja,preventScrolling:tr=!0,nodeExtent:_n,defaultMarkerColor:Tn="#b1b1b7",zoomOnScroll:Un=!0,zoomOnPinch:gr=!0,panOnScroll:Sn=!1,panOnScrollSpeed:on=.5,panOnScrollMode:Ye=Ri.Free,zoomOnDoubleClick:Kn=!0,panOnDrag:kn=!0,onPaneClick:nr,onPaneMouseEnter:He,onPaneMouseMove:In,onPaneMouseLeave:qn,onPaneScroll:Or,onPaneContextMenu:Rr,paneClickDistance:Dr=1,nodeClickDistance:to=0,children:Io,onReconnect:Nn,onReconnectStart:En,onReconnectEnd:An,onEdgeContextMenu:q,onEdgeDoubleClick:Ne,onEdgeMouseEnter:Ve,onEdgeMouseMove:pt,onEdgeMouseLeave:qt,reconnectRadius:Wt=10,onNodesChange:Yt,onEdgesChange:rr,noDragClassName:pn="nodrag",noWheelClassName:Cn="nowheel",noPanClassName:zt="nopan",fitView:Wn,fitViewOptions:Lr,connectOnClick:sn,attributionPosition:no,proOptions:or,defaultEdgeOptions:ci,elevateNodesOnSelect:Ao=!0,elevateEdgesOnSelect:Et=!1,disableKeyboardA11y:ir=!1,autoPanOnConnect:gt,autoPanOnNodeDrag:Bi,autoPanSpeed:zr,connectionRadius:Oo,isValidConnection:Fr,onError:yr,style:fi,id:sr,nodeDragThreshold:jn,connectionDragThreshold:ct,viewport:hn,onViewportChange:Hi,width:Ro,height:ro,colorMode:oo="light",debug:io,onScroll:Yn,ariaLabelConfig:yt,zIndexMode:Br="basic",...so},ar){const Hr=sr||"1",ao=Jb(oo),lr=Y.useCallback(di=>{di.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Yn==null||Yn(di)},[Yn]);return w.jsx("div",{"data-testid":"rf__wrapper",...so,onScroll:lr,style:{...fi,...vS},ref:ar,className:Ut(["react-flow",l,ao]),id:sr,role:"application",children:w.jsxs(yS,{nodes:t,edges:r,width:Ro,height:ro,fitView:Wn,fitViewOptions:Lr,minZoom:Nt,maxZoom:Kt,nodeOrigin:_t,nodeExtent:_n,zIndexMode:Br,children:[w.jsx(Gb,{nodes:t,edges:r,defaultNodes:i,defaultEdges:s,onConnect:C,onConnectStart:j,onConnectEnd:M,onClickConnectStart:T,onClickConnectEnd:I,nodesDraggable:$t,autoPanOnNodeFocus:St,nodesConnectable:nn,nodesFocusable:Lt,edgesFocusable:dn,edgesReconnectable:rn,elementsSelectable:mr,elevateNodesOnSelect:Ao,elevateEdgesOnSelect:Et,minZoom:Nt,maxZoom:Kt,nodeExtent:_n,onNodesChange:Yt,onEdgesChange:rr,snapToGrid:qe,snapGrid:lt,connectionMode:A,translateExtent:$n,connectOnClick:sn,defaultEdgeOptions:ci,fitView:Wn,fitViewOptions:Lr,onNodesDelete:we,onEdgesDelete:U,onDelete:le,onNodeDragStart:Q,onNodeDrag:G,onNodeDragStop:pe,onSelectionDrag:ce,onSelectionDragStart:D,onSelectionDragStop:J,onMove:k,onMoveStart:x,onMoveEnd:S,noPanClassName:zt,nodeOrigin:_t,rfId:Hr,autoPanOnConnect:gt,autoPanOnNodeDrag:Bi,autoPanSpeed:zr,onError:yr,connectionRadius:Oo,isValidConnection:Fr,selectNodesOnDrag:ot,nodeDragThreshold:jn,connectionDragThreshold:ct,onBeforeDelete:F,debug:io,ariaLabelConfig:yt,zIndexMode:Br}),w.jsx(hS,{onInit:b,onNodeClick:h,onEdgeClick:y,onNodeMouseEnter:B,onNodeMouseMove:P,onNodeMouseLeave:R,onNodeContextMenu:W,onNodeDoubleClick:H,nodeTypes:c,edgeTypes:d,connectionLineType:V,connectionLineStyle:be,connectionLineComponent:Se,connectionLineContainerStyle:$e,selectionKeyCode:Oe,selectionOnDrag:_e,selectionMode:Fe,deleteKeyCode:Ae,multiSelectionKeyCode:Be,panActivationKeyCode:ke,zoomActivationKeyCode:Re,onlyRenderVisibleElements:ut,defaultViewport:bn,translateExtent:$n,minZoom:Nt,maxZoom:Kt,preventScrolling:tr,zoomOnScroll:Un,zoomOnPinch:gr,zoomOnDoubleClick:Kn,panOnScroll:Sn,panOnScrollSpeed:on,panOnScrollMode:Ye,panOnDrag:kn,onPaneClick:nr,onPaneMouseEnter:He,onPaneMouseMove:In,onPaneMouseLeave:qn,onPaneScroll:Or,onPaneContextMenu:Rr,paneClickDistance:Dr,nodeClickDistance:to,onSelectionContextMenu:se,onSelectionStart:z,onSelectionEnd:K,onReconnect:Nn,onReconnectStart:En,onReconnectEnd:An,onEdgeContextMenu:q,onEdgeDoubleClick:Ne,onEdgeMouseEnter:Ve,onEdgeMouseMove:pt,onEdgeMouseLeave:qt,reconnectRadius:Wt,defaultMarkerColor:Tn,noDragClassName:pn,noWheelClassName:Cn,noPanClassName:zt,rfId:Hr,disableKeyboardA11y:ir,nodeExtent:_n,viewport:hn,onViewportChange:Hi}),w.jsx(Wb,{onSelectionChange:ve}),Io,w.jsx(Hb,{proOptions:or,position:no}),w.jsx(Bb,{rfId:Hr,disableKeyboardA11y:ir})]})})}var wS=D0(xS);function bS(){const t=Mt();return Y.useCallback(r=>{const{domNode:i,updateNodeInternals:s}=t.getState(),l=Array.isArray(r)?r:[r],c=new Map;l.forEach(d=>{const h=i==null?void 0:i.querySelector(`.react-flow__node[data-id="${d}"]`);h&&c.set(d,{id:d,nodeElement:h,force:!0})}),requestAnimationFrame(()=>s(c,{triggerFitView:!1}))},[])}function _S(t){const[r,i]=Y.useState(t),s=Y.useCallback(l=>i(c=>O0(l,c)),[]);return[r,i,s]}function SS(t){const[r,i]=Y.useState(t),s=Y.useCallback(l=>i(c=>R0(l,c)),[]);return[r,i,s]}function kS({dimensions:t,lineWidth:r,variant:i,className:s}){return w.jsx("path",{strokeWidth:r,d:`M${t[0]/2} 0 V${t[1]} M0 ${t[1]/2} H${t[0]}`,className:Ut(["react-flow__background-pattern",i,s])})}function NS({radius:t,className:r}){return w.jsx("circle",{cx:t,cy:t,r:t,className:Ut(["react-flow__background-pattern","dots",r])})}var Mo;(function(t){t.Lines="lines",t.Dots="dots",t.Cross="cross"})(Mo||(Mo={}));const ES={[Mo.Dots]:1,[Mo.Lines]:1,[Mo.Cross]:6},CS=t=>({transform:t.transform,patternId:`pattern-${t.rfId}`});function ag({id:t,variant:r=Mo.Dots,gap:i=20,size:s,lineWidth:l=1,offset:c=0,color:d,bgColor:h,style:y,className:b,patternClassName:k}){const x=Y.useRef(null),{transform:S,patternId:C}=mt(CS,At),j=s||ES[r],M=r===Mo.Dots,T=r===Mo.Cross,I=Array.isArray(i)?i:[i,i],B=[I[0]*S[2]||1,I[1]*S[2]||1],P=j*S[2],R=Array.isArray(c)?c:[c,c],W=T?[P,P]:B,H=[R[0]*S[2]||1+W[0]/2,R[1]*S[2]||1+W[1]/2],Q=`${C}${t||""}`;return w.jsxs("svg",{className:Ut(["react-flow__background",b]),style:{...y,...Iu,"--xy-background-color-props":h,"--xy-background-pattern-color-props":d},ref:x,"data-testid":"rf__background",children:[w.jsx("pattern",{id:Q,x:S[0]%B[0],y:S[1]%B[1],width:B[0],height:B[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${H[0]},-${H[1]})`,children:M?w.jsx(NS,{radius:P/2,className:k}):w.jsx(kS,{dimensions:W,lineWidth:l,variant:r,className:k})}),w.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${Q})`})]})}ag.displayName="Background";const jS=Y.memo(ag);function PS(){return w.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:w.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function MS(){return w.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:w.jsx("path",{d:"M0 0h32v4.2H0z"})})}function $S(){return w.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:w.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 w.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:w.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 w.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:w.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 w.jsx("button",{type:"button",className:Ut(["react-flow__controls-button",r]),...i,children:t})}const AS=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:h,onInteractiveChange:y,className:b,children:k,position:x="bottom-left",orientation:S="vertical","aria-label":C}){const j=Mt(),{isInteractive:M,minZoomReached:T,maxZoomReached:I,ariaLabelConfig:B}=mt(AS,At),{zoomIn:P,zoomOut:R,fitView:W}=Zf(),H=()=>{P(),c==null||c()},Q=()=>{R(),d==null||d()},G=()=>{W(l),h==null||h()},pe=()=>{j.setState({nodesDraggable:!M,nodesConnectable:!M,elementsSelectable:!M}),y==null||y(!M)},we=S==="horizontal"?"horizontal":"vertical";return w.jsxs(Fa,{className:Ut(["react-flow__controls",we,b]),position:x,style:t,"data-testid":"rf__controls","aria-label":C??B["controls.ariaLabel"],children:[r&&w.jsxs(w.Fragment,{children:[w.jsx(Jl,{onClick:H,className:"react-flow__controls-zoomin",title:B["controls.zoomIn.ariaLabel"],"aria-label":B["controls.zoomIn.ariaLabel"],disabled:I,children:w.jsx(PS,{})}),w.jsx(Jl,{onClick:Q,className:"react-flow__controls-zoomout",title:B["controls.zoomOut.ariaLabel"],"aria-label":B["controls.zoomOut.ariaLabel"],disabled:T,children:w.jsx(MS,{})})]}),i&&w.jsx(Jl,{className:"react-flow__controls-fitview",onClick:G,title:B["controls.fitView.ariaLabel"],"aria-label":B["controls.fitView.ariaLabel"],children:w.jsx($S,{})}),s&&w.jsx(Jl,{className:"react-flow__controls-interactive",onClick:pe,title:B["controls.interactive.ariaLabel"],"aria-label":B["controls.interactive.ariaLabel"],children:M?w.jsx(IS,{}):w.jsx(TS,{})}),k]})}lg.displayName="Controls";const OS=Y.memo(lg);function RS({id:t,x:r,y:i,width:s,height:l,style:c,color:d,strokeColor:h,strokeWidth:y,className:b,borderRadius:k,shapeRendering:x,selected:S,onClick:C}){const{background:j,backgroundColor:M}=c||{},T=d||j||M;return w.jsx("rect",{className:Ut(["react-flow__minimap-node",{selected:S},b]),x:r,y:i,rx:k,ry:k,width:s,height:l,style:{fill:T,stroke:h,strokeWidth:y},shapeRendering:x,onClick:C?I=>C(I,t):void 0})}const DS=Y.memo(RS),LS=t=>t.nodes.map(r=>r.id),mf=t=>t instanceof Function?t:()=>t;function zS({nodeStrokeColor:t,nodeColor:r,nodeClassName:i="",nodeBorderRadius:s=5,nodeStrokeWidth:l,nodeComponent:c=DS,onClick:d}){const h=mt(LS,At),y=mf(r),b=mf(t),k=mf(i),x=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return w.jsx(w.Fragment,{children:h.map(S=>w.jsx(BS,{id:S,nodeColorFunc:y,nodeStrokeColorFunc:b,nodeClassNameFunc:k,nodeBorderRadius:s,nodeStrokeWidth:l,NodeComponent:c,onClick:d,shapeRendering:x},S))})}function FS({id:t,nodeColorFunc:r,nodeStrokeColorFunc:i,nodeClassNameFunc:s,nodeBorderRadius:l,nodeStrokeWidth:c,shapeRendering:d,NodeComponent:h,onClick:y}){const{node:b,x:k,y:x,width:S,height:C}=mt(j=>{const M=j.nodeLookup.get(t);if(!M)return{node:void 0,x:0,y:0,width:0,height:0};const T=M.internals.userNode,{x:I,y:B}=M.internals.positionAbsolute,{width:P,height:R}=To(T);return{node:T,x:I,y:B,width:P,height:R}},At);return!b||b.hidden||!l0(b)?null:w.jsx(h,{x:k,y:x,width:S,height:C,style:b.style,selected:!!b.selected,className:s(b),color:r(b),borderRadius:l,strokeColor:i(b),strokeWidth:c,shapeRendering:d,onClick:y,id:b.id})}const BS=Y.memo(FS);var HS=Y.memo(zS);const VS=200,US=150,KS=t=>!t.hidden,qS=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}},WS="react-flow__minimap-desc";function ug({style:t,className:r,nodeStrokeColor:i,nodeColor:s,nodeClassName:l="",nodeBorderRadius:c=5,nodeStrokeWidth:d,nodeComponent:h,bgColor:y,maskColor:b,maskStrokeColor:k,maskStrokeWidth:x,position:S="bottom-right",onClick:C,onNodeClick:j,pannable:M=!1,zoomable:T=!1,ariaLabel:I,inversePan:B,zoomStep:P=1,offsetScale:R=5}){const W=Mt(),H=Y.useRef(null),{boundingRect:Q,viewBB:G,rfId:pe,panZoom:we,translateExtent:U,flowWidth:le,flowHeight:ve,ariaLabelConfig:D}=mt(qS,At),ce=(t==null?void 0:t.width)??VS,J=(t==null?void 0:t.height)??US,se=Q.width/ce,z=Q.height/J,K=Math.max(se,z),F=K*ce,A=K*J,V=R*K,be=Q.x-(F-Q.width)/2-V,Se=Q.y-(A-Q.height)/2-V,$e=F+V*2,Ae=A+V*2,Oe=`${WS}-${pe}`,_e=Y.useRef(0),Fe=Y.useRef();_e.current=K,Y.useEffect(()=>{if(H.current&&we)return Fe.current=lb({domNode:H.current,panZoom:we,getTransform:()=>W.getState().transform,getViewScale:()=>_e.current}),()=>{var qe;(qe=Fe.current)==null||qe.destroy()}},[we]),Y.useEffect(()=>{var qe;(qe=Fe.current)==null||qe.update({translateExtent:U,width:le,height:ve,inversePan:B,pannable:M,zoomStep:P,zoomable:T})},[M,T,B,P,U,le,ve]);const ke=C?qe=>{var ot;const[lt,ut]=((ot=Fe.current)==null?void 0:ot.pointer(qe))||[0,0];C(qe,{x:lt,y:ut})}:void 0,Be=j?Y.useCallback((qe,lt)=>{const ut=W.getState().nodeLookup.get(lt).internals.userNode;j(qe,ut)},[]):void 0,Re=I??D["minimap.ariaLabel"];return w.jsx(Fa,{position:S,style:{...t,"--xy-minimap-background-color-props":typeof y=="string"?y:void 0,"--xy-minimap-mask-background-color-props":typeof b=="string"?b:void 0,"--xy-minimap-mask-stroke-color-props":typeof k=="string"?k:void 0,"--xy-minimap-mask-stroke-width-props":typeof x=="number"?x*K: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:Ut(["react-flow__minimap",r]),"data-testid":"rf__minimap",children:w.jsxs("svg",{width:ce,height:J,viewBox:`${be} ${Se} ${$e} ${Ae}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":Oe,ref:H,onClick:ke,children:[Re&&w.jsx("title",{id:Oe,children:Re}),w.jsx(HS,{onClick:Be,nodeColor:s,nodeStrokeColor:i,nodeBorderRadius:c,nodeClassName:l,nodeStrokeWidth:d,nodeComponent:h}),w.jsx("path",{className:"react-flow__minimap-mask",d:`M${be-V},${Se-V}h${$e+V*2}v${Ae+V*2}h${-$e-V*2}z
202
+ M${G.x},${G.y}h${G.width}v${G.height}h${-G.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}ug.displayName="MiniMap";const YS=Y.memo(ug),XS=t=>r=>t?`${Math.max(1/r.transform[2],1)}`:void 0,QS={[Os.Line]:"right",[Os.Handle]:"bottom-right"};function GS({nodeId:t,position:r,variant:i=Os.Handle,className:s,style:l=void 0,children:c,color:d,minWidth:h=10,minHeight:y=10,maxWidth:b=Number.MAX_VALUE,maxHeight:k=Number.MAX_VALUE,keepAspectRatio:x=!1,resizeDirection:S,autoScale:C=!0,shouldResize:j,onResizeStart:M,onResize:T,onResizeEnd:I}){const B=B0(),P=typeof t=="string"?t:B,R=Mt(),W=Y.useRef(null),H=i===Os.Handle,Q=mt(Y.useCallback(XS(H&&C),[H,C]),At),G=Y.useRef(null),pe=r??QS[i];Y.useEffect(()=>{if(!(!W.current||!P))return G.current||(G.current=_b({domNode:W.current,nodeId:P,getStoreItems:()=>{const{nodeLookup:U,transform:le,snapGrid:ve,snapToGrid:D,nodeOrigin:ce,domNode:J}=R.getState();return{nodeLookup:U,transform:le,snapGrid:ve,snapToGrid:D,nodeOrigin:ce,paneDomNode:J}},onChange:(U,le)=>{const{triggerNodeChanges:ve,nodeLookup:D,parentLookup:ce,nodeOrigin:J}=R.getState(),se=[],z={x:U.x,y:U.y},K=D.get(P);if(K&&K.expandParent&&K.parentId){const F=K.origin??J,A=U.width??K.measured.width??0,V=U.height??K.measured.height??0,be={id:K.id,parentId:K.parentId,rect:{width:A,height:V,...u0({x:U.x??K.position.x,y:U.y??K.position.y},{width:A,height:V},K.parentId,D,F)}},Se=Jf([be],D,ce,J);se.push(...Se),z.x=U.x?Math.max(F[0]*A,U.x):void 0,z.y=U.y?Math.max(F[1]*V,U.y):void 0}if(z.x!==void 0&&z.y!==void 0){const F={id:P,type:"position",position:{...z}};se.push(F)}if(U.width!==void 0&&U.height!==void 0){const A={id:P,type:"dimensions",resizing:!0,setAttributes:S?S==="horizontal"?"width":"height":!0,dimensions:{width:U.width,height:U.height}};se.push(A)}for(const F of le){const A={...F,type:"position"};se.push(A)}ve(se)},onEnd:({width:U,height:le})=>{const ve={id:P,type:"dimensions",resizing:!1,dimensions:{width:U,height:le}};R.getState().triggerNodeChanges([ve])}})),G.current.update({controlPosition:pe,boundaries:{minWidth:h,minHeight:y,maxWidth:b,maxHeight:k},keepAspectRatio:x,resizeDirection:S,onResizeStart:M,onResize:T,onResizeEnd:I,shouldResize:j}),()=>{var U;(U=G.current)==null||U.destroy()}},[pe,h,y,b,k,x,M,T,I,j]);const we=pe.split("-");return w.jsx("div",{className:Ut(["react-flow__resize-control","nodrag",...we,i,s]),ref:W,style:{...l,scale:Q,...d&&{[H?"backgroundColor":"borderColor"]:d}},children:c})}Y.memo(GS);const JS={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=JS[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 w.jsx("span",{className:`inline-flex items-center rounded-md font-semibold uppercase tracking-wide border shrink-0 transition-colors duration-200 ${l} ${c} ${r}`,children:t.toUpperCase()})}function td(t,r,i){var c,d;const s=r.toLowerCase(),l=(d=(c=t.paths)==null?void 0:c[i])==null?void 0:d[s];return(l==null?void 0:l.summary)??(l==null?void 0:l.operationId)??`${r.toUpperCase()} ${i}`}function nd(t,r,i){var h,y,b,k;const s=r.toLowerCase(),l=(y=(h=t.paths)==null?void 0:h[i])==null?void 0:y[s];if(!(l!=null&&l.requestBody))return"— sin body";const d=(k=(b=l.requestBody.content)==null?void 0:b["application/json"])==null?void 0:k.schema;return d&&"$ref"in d?`body: ${d.$ref}`:"body: JSON"}function rd(t,r,i){var h,y,b,k,x,S;const s=r.toLowerCase(),l=(y=(h=t.paths)==null?void 0:h[i])==null?void 0:y[s],c=((b=l==null?void 0:l.responses)==null?void 0:b["200"])??((k=l==null?void 0:l.responses)==null?void 0:k["201"]);if(!c)return"—";const d=typeof c=="object"&&c&&"content"in c?(S=(x=c.content)==null?void 0:x["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 ZS(t){const r=t.indexOf(" ");return r===-1?{method:"get",path:"/"}:{method:t.slice(0,r),path:t.slice(r+1)}}const cg=Y.createContext(null);function ek(t){const{id:r,selected:i}=t,s=t.data,l=Y.useContext(cg),c=bS();return Y.useEffect(()=>{c(r)},[s.path,s.method,r,c]),w.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:[w.jsx(Rs,{type:"target",position:Ze.Left,id:"in",className:"!h-3 !w-3 !border-2 !border-surface-900 !bg-teal-500"}),w.jsxs("div",{className:"flex items-center gap-2 mb-1 min-w-0",children:[w.jsx(su,{method:s.method}),w.jsx("span",{className:"text-[10px] text-slate-500 truncate",title:s.summary,children:s.summary})]}),l?w.jsxs("label",{className:"block text-[10px] text-slate-500 mb-1",children:["Endpoint",w.jsx("select",{className:"mt-0.5 w-full bg-surface-900 border border-surface-600 rounded px-1.5 py-1 text-[11px] font-mono",value:gf(s.method,s.path),onChange:d=>{const{method:h,path:y}=ZS(d.target.value);l.updateNodeData(r,{method:h,path:y,summary:td(l.doc,h,y),reqHint:nd(l.doc,h,y),resHint:rd(l.doc,h,y)})},children:l.ops.map(d=>w.jsxs("option",{value:gf(d.method,d.path),children:[d.method.toUpperCase()," ",d.path]},gf(d.method,d.path)))})]}):w.jsx("p",{className:"font-mono text-[11px] text-slate-300 truncate",children:s.path}),w.jsxs("div",{className:"mt-2 grid grid-cols-2 gap-1 text-[9px] text-slate-500 leading-tight",children:[w.jsxs("div",{children:[w.jsx("span",{className:"text-slate-600",children:"req"})," ",s.reqHint]}),w.jsxs("div",{children:[w.jsx("span",{className:"text-slate-600",children:"res"})," ",s.resHint]})]}),w.jsx(Rs,{type:"source",position:Ze.Right,id:"out",className:"!h-3 !w-3 !border-2 !border-surface-900 !bg-amber-500"})]})}const tk={apiOp:ek};function nk(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 rk(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 ok=[{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 ik({doc:t,ops:r,graph:i,onGraphChange:s}){var P,R,W,H,Q,G,pe,we;const l=Y.useMemo(()=>nk(t,i),[t,i]),[c,d,h]=_S(l.nodes),[y,b,k]=SS(l.edges),[x,S]=Y.useState(null);Y.useEffect(()=>{s(rk(c,y))},[c,y,s]);const C=Y.useCallback((U,le)=>{d(ve=>ve.map(D=>D.id===U?{...D,data:{...D.data,...le}}:D))},[d]),j=Y.useMemo(()=>({doc:t,ops:r,updateNodeData:C}),[t,r,C]),M=Y.useCallback(U=>{U.sourceHandle!=="out"||U.targetHandle!=="in"||b(le=>g0({...U,id:`e-${U.source}-${U.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}},le))},[b]),T=y.find(U=>U.id===x),I=U=>{x&&b(le=>le.map(ve=>{var ce;if(ve.id!==x)return ve;const D={...((ce=ve.data)==null?void 0:ce.mapping)??au(),...U};return{...ve,data:{mapping:D},label:D.variableName}}))},B=()=>{const U=c.reduce((se,z)=>z.position.x>se?z.position.x:se,0),le=r[0];if(!le)return;const ve=crypto.randomUUID(),D=U>0?U+40:80,J={id:ve,type:"apiOp",position:{x:D,y:120},data:{method:le.method.toLowerCase(),path:le.path,summary:td(t,le.method,le.path),reqHint:nd(t,le.method,le.path),resHint:rd(t,le.method,le.path)}};d(se=>[...se,J])};return w.jsx(cg.Provider,{value:j,children:w.jsxs("div",{className:"space-y-3",children:[w.jsx("div",{className:"h-[min(520px,70vh)] w-full rounded-xl border border-surface-700 bg-surface-950",children:w.jsxs(wS,{nodes:c,edges:y,onNodesChange:h,onEdgesChange:k,onConnect:M,nodeTypes:tk,onEdgeClick:(U,le)=>S(le.id),onPaneClick:()=>S(null),fitView:!0,minZoom:.4,maxZoom:1.5,proOptions:{hideAttribution:!0},isValidConnection:U=>U.sourceHandle==="out"&&U.targetHandle==="in",children:[w.jsx(jS,{variant:Mo.Dots,gap:16,size:1,color:"rgb(51 65 85 / 0.5)"}),w.jsx(OS,{className:"!bg-surface-900 !border-surface-600 !shadow-lg"}),w.jsx(YS,{className:"!bg-surface-900/95 !border-surface-600",nodeColor:()=>"rgb(45 212 191 / 0.5)"}),w.jsx(Fa,{position:"top-left",children:w.jsx("button",{type:"button",onClick:B,className:"text-xs px-3 py-2 rounded-lg bg-accent/90 text-surface-950 font-medium shadow",children:"+ Nodo (endpoint)"})})]})}),w.jsxs("div",{className:"rounded-xl border border-surface-700 bg-surface-900/50 p-4 space-y-3",children:[w.jsx("h4",{className:"text-xs font-semibold text-slate-300",children:"Cable seleccionado (respuesta → request)"}),T?w.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3 text-xs",children:[w.jsxs("label",{className:"text-slate-500",children:["JSON path en la respuesta",w.jsx("input",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-2 py-1.5 font-mono",value:((P=T.data)==null?void 0:P.mapping.sourceJsonPath)??"$",onChange:U=>I({sourceJsonPath:U.target.value}),placeholder:"$.access_token"})]}),w.jsxs("label",{className:"text-slate-500",children:["Nombre de variable",w.jsx("input",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-2 py-1.5",value:((R=T.data)==null?void 0:R.mapping.variableName)??"",onChange:U=>I({variableName:U.target.value}),placeholder:"token"})]}),w.jsxs("label",{className:"text-slate-500 sm:col-span-2",children:["Cómo se usa en el request del nodo destino",w.jsx("select",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-2 py-1.5",value:((W=T.data)==null?void 0:W.mapping.useInTarget)??"vars_only",onChange:U=>I({useInTarget:U.target.value}),children:ok.map(U=>w.jsx("option",{value:U.value,children:U.label},U.value))})]}),(((H=T.data)==null?void 0:H.mapping.useInTarget)==="path_param"||((Q=T.data)==null?void 0:Q.mapping.useInTarget)==="header"||((G=T.data)==null?void 0:G.mapping.useInTarget)==="query")&&w.jsxs("label",{className:"text-slate-500 sm:col-span-2",children:["Clave (nombre del param / header / query)",w.jsx("input",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-2 py-1.5 font-mono",value:((pe=T.data)==null?void 0:pe.mapping.targetKey)??"",onChange:U=>I({targetKey:U.target.value}),placeholder:"id / Authorization / q"})]}),w.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"," ",w.jsx("code",{className:"text-accent",children:"{clave}"}),", en un header, o en query. Con «solo variable», usa"," ",w.jsx("code",{className:"text-accent",children:"{"+(((we=T.data)==null?void 0:we.mapping.variableName)||"var")+"}"})," ","en la ruta del endpoint destino."]})]}):w.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(y=>[y.id,y])),s=new Set(t.map(y=>y.id)),l=new Map,c=new Map;for(const y of s)l.set(y,0),c.set(y,[]);for(const y of r)!s.has(y.source)||!s.has(y.target)||(l.set(y.target,(l.get(y.target)??0)+1),c.get(y.source).push(y.target));const d=[];for(const[y,b]of l)b===0&&d.push(y);d.sort((y,b)=>i.get(y).x-i.get(b).x||i.get(y).y-i.get(b).y);const h=[];for(;d.length;){const y=d.shift();h.push(y);for(const b of c.get(y)??[]){const k=(l.get(b)??0)-1;l.set(b,k),k===0&&(d.push(b),d.sort((x,S)=>i.get(x).x-i.get(S).x||i.get(x).y-i.get(S).y))}}if(h.length<t.length){const y=t.filter(b=>!h.includes(b.id)).sort((b,k)=>b.x-k.x||b.y-k.y);return[...h.map(b=>i.get(b)),...y]}return h.map(y=>i.get(y))}async function um(t,r,i){var y;const{nodes:s,edges:l}=t;if(s.length===0)return"Sin nodos en el flujo.";const c=fg(s,l),d={};let h="";for(let b=0;b<c.length;b++){const k=c[b];let x=k.path;const S={...i()},C=l.filter(W=>W.target===k.id);for(const W of C){const{mapping:H}=W,Q=d[H.variableName];if(Q!==void 0)switch(H.useInTarget){case"path_param":H.targetKey&&(x=x.split(`{${H.targetKey}}`).join(Q));break;case"header":if(H.targetKey){const G=H.targetKey;S[G]=G.toLowerCase()==="authorization"&&!Q.startsWith("Bearer ")?`Bearer ${Q}`:Q}break;case"query":{const G=x.includes("?")?"&":"?";x=`${x}${G}${encodeURIComponent(H.targetKey)}=${encodeURIComponent(Q)}`;break}case"vars_only":default:x=x.split(`{${H.variableName}}`).join(Q);break}}for(const[W,H]of Object.entries(d))x=x.split(`{${W}}`).join(H);const j=`${r.replace(/\/$/,"")}${x}`,M={method:k.method.toUpperCase(),headers:S},T=k.method.toLowerCase();T!=="get"&&T!=="head"&&(M.body="{}");const I=await fetch(j,{...M,credentials:"include"});let B={};const P=await I.text();try{B=P?JSON.parse(P):{}}catch{B={_raw:P}}h+=`▸ ${k.method.toUpperCase()} ${k.path} → ${I.status}
203
+ ${JSON.stringify(B,null,2)}
204
+
205
+ `;const R=l.filter(W=>W.source===k.id);for(const W of R){const H=((y=W.mapping.sourceJsonPath)==null?void 0:y.trim())||"$",Q=Rf(B,H);Q!=null&&(d[W.mapping.variableName]=typeof Q=="object"?JSON.stringify(Q):String(Q))}}return h+=`
206
+ Variables finales: ${JSON.stringify(d,null,2)}`,h}function sk(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 ak(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=Y.createContext({productName:null,logoDataUrl:null});function lk({value:t,children:r}){return w.jsx(dg.Provider,{value:t,children:r})}function uk(){return Y.useContext(dg)}function ck({data:t,defaultOpenDepth:r=3}){return w.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:w.jsx(od,{value:t,depth:0,defaultOpenDepth:r})})}function od({value:t,depth:r,defaultOpenDepth:i,name:s}){return t===null||typeof t!="object"?w.jsx(fk,{name:s,value:t}):Array.isArray(t)?w.jsx(dk,{name:s,value:t,depth:r,defaultOpenDepth:i}):w.jsx(pk,{name:s,value:t,depth:r,defaultOpenDepth:i})}function fk({name:t,value:r}){return w.jsxs("div",{className:"pl-1 break-all",children:[t!=null&&w.jsxs(w.Fragment,{children:[w.jsx("span",{className:"text-sky-300/95",children:JSON.stringify(t)}),w.jsx("span",{className:"text-slate-500",children:": "})]}),w.jsx("span",{className:"text-emerald-200/95",children:JSON.stringify(r)})]})}function dk({name:t,value:r,depth:i,defaultOpenDepth:s}){const l=i<s,[c,d]=Y.useState(l);return r.length===0?w.jsxs("div",{className:"pl-1",children:[t!=null&&w.jsxs(w.Fragment,{children:[w.jsx("span",{className:"text-sky-300/95",children:JSON.stringify(t)}),w.jsx("span",{className:"text-slate-500",children:": "})]}),w.jsx("span",{className:"text-slate-500",children:"[]"})]}):w.jsxs("div",{className:"pl-1",children:[t!=null&&w.jsxs(w.Fragment,{children:[w.jsx("span",{className:"text-sky-300/95",children:JSON.stringify(t)}),w.jsx("span",{className:"text-slate-500",children:": "})]}),w.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?"▼":"▶"}),w.jsx("span",{className:"text-slate-500",children:"["}),w.jsx("span",{className:"text-slate-600 text-[10px] ml-1",children:r.length}),c&&w.jsx("ul",{className:"list-none my-0.5 ml-4 border-l border-surface-600 pl-2 space-y-0.5",children:r.map((h,y)=>w.jsxs("li",{children:[w.jsx("span",{className:"text-violet-400/90 mr-1",children:y}),w.jsx(od,{value:h,depth:i+1,defaultOpenDepth:s})]},y))}),!c&&w.jsx("span",{className:"text-slate-600",children:" … "}),w.jsx("span",{className:"text-slate-500",children:"]"})]})}function pk({name:t,value:r,depth:i,defaultOpenDepth:s}){const l=Object.keys(r),c=i<s,[d,h]=Y.useState(c);return l.length===0?w.jsxs("div",{className:"pl-1",children:[t!=null&&w.jsxs(w.Fragment,{children:[w.jsx("span",{className:"text-sky-300/95",children:JSON.stringify(t)}),w.jsx("span",{className:"text-slate-500",children:": "})]}),w.jsx("span",{className:"text-slate-500",children:"{}"})]}):w.jsxs("div",{className:"pl-1",children:[t!=null&&w.jsxs(w.Fragment,{children:[w.jsx("span",{className:"text-sky-300/95",children:JSON.stringify(t)}),w.jsx("span",{className:"text-slate-500",children:": "})]}),w.jsx("button",{type:"button","aria-expanded":d,onClick:()=>h(!d),className:"inline align-middle text-slate-400 hover:text-slate-200 mr-1 select-none w-4",children:d?"▼":"▶"}),w.jsx("span",{className:"text-slate-500",children:"{"}),w.jsx("span",{className:"text-slate-600 text-[10px] ml-1",children:l.length}),d&&w.jsx("ul",{className:"list-none my-0.5 ml-4 border-l border-surface-600 pl-2 space-y-0.5",children:l.map(y=>w.jsx("li",{children:w.jsx(od,{name:y,value:r[y],depth:i+1,defaultOpenDepth:s})},y))}),!d&&w.jsx("span",{className:"text-slate-600",children:" … "}),w.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 mk(t,r,i){var b;const s=(b=t.paths)==null?void 0:b[i],l=s==null?void 0:s[r.toLowerCase()];if(!l)return[];const c=(s==null?void 0:s.parameters)??[],d=l.parameters??[],h=new Set,y=[];for(const k of[...c,...d]){const x=hk(t,k);if(!x||!["query","path","header","cookie"].includes(x.in))continue;const S=`${x.in}:${x.name}`;h.has(S)||(h.add(S),y.push({name:x.name,in:x.in,required:!!x.required,description:typeof x.description=="string"?x.description:void 0}))}return y}function fm(t,r,i){var y,b,k,x;const s=(b=(y=t.paths)==null?void 0:y[i])==null?void 0:b[r.toLowerCase()];if(!(s!=null&&s.requestBody))return null;const l=s.requestBody,c="$ref"in l?id(t,l.$ref):l;if(!((x=(k=c==null?void 0:c.content)==null?void 0:k["application/json"])!=null&&x.schema))return null;const d=c.content["application/json"].schema,h=cm(t,d);if(!h)return null;if(h.type==="object"&&h.properties&&Object.keys(h.properties).length>0){const S=new Set(h.required??[]);return Object.keys(h.properties).map(C=>{const j=h.properties[C],M=j&&"$ref"in j?cm(t,j):j;return{key:C,required:S.has(C),description:M==null?void 0:M.description,format:M==null?void 0:M.format,type:M==null?void 0:M.type}})}return null}function gk(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function yk(t,r){let i=t;for(const[s,l]of Object.entries(r))i=i.replace(new RegExp(`\\{${gk(s)}\\}`,"g"),encodeURIComponent(l));return i}function vk(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 pg(t,r){var s;if(!(t!=null&&t.length))return{};const i={};for(const l of t){const c=((s=r[l.key])==null?void 0:s.trim())??"";if(c==="")continue;const d=l.type;if(d==="integer"||d==="number"){const h=Number(c);i[l.key]=Number.isFinite(h)?h:c}else if(d==="boolean")i[l.key]=c==="true"||c==="1";else try{i[l.key]=JSON.parse(c)}catch{i[l.key]=c}}return i}function dm(t,r){const i=pg(t,r);return JSON.stringify(i,null,2)}function xk(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 wk(t){return/\{[^/}]+\}/.test(t)}function bk(t,r,i,s,l){var h,y;const c={...t};for(const b of r){const k=(h=i[b.name])==null?void 0:h.trim();k&&(c[b.name]=k)}const d=[];for(const b of s){const k=(y=l[b.name])==null?void 0:y.trim();k&&d.push(`${b.name}=${k}`)}return d.length&&(c.Cookie=c.Cookie?`${c.Cookie}; ${d.join("; ")}`:d.join("; ")),c}function _k({doc:t,selectedOp:r,baseUrl:i,buildHeaders:s}){const[l,c]=Y.useState({}),[d,h]=Y.useState({}),[y,b]=Y.useState({}),[k,x]=Y.useState({}),[S,C]=Y.useState({}),[j,M]=Y.useState("{}"),[T,I]=Y.useState("raw"),[B,P]=Y.useState(null),[R,W]=Y.useState(null),H=Y.useMemo(()=>mk(t,r.method,r.path),[t,r.method,r.path]),Q=Y.useMemo(()=>H.filter(F=>F.in==="path"),[H]),G=Y.useMemo(()=>H.filter(F=>F.in==="query"),[H]),pe=Y.useMemo(()=>H.filter(F=>F.in==="header"),[H]),we=Y.useMemo(()=>H.filter(F=>F.in==="cookie"),[H]),U=Y.useMemo(()=>fm(t,r.method,r.path),[t,r.method,r.path]),le=r.method.toLowerCase(),ve=le!=="get"&&le!=="head";Y.useEffect(()=>{c({}),h({}),b({}),x({}),W(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"),M(dm(F,{}))):(C({}),I("raw"),M("{}"))},[t,r.method,r.path]);const D=Y.useCallback((F,A)=>{C(V=>({...V,[F]:A}))},[]),ce=Y.useCallback(()=>{U!=null&&U.length&&M(dm(U,S)),I("raw")},[U,S]),J=Y.useCallback(()=>{U!=null&&U.length&&C(xk(U,j)),I("fields")},[U,j]),se=async()=>{var Ae,Oe,_e,Fe,ke;W(null);const F=ks(t,i);for(const Be of Q)if(Be.required&&!((Ae=l[Be.name])!=null&&Ae.trim())){W(`Parámetro de ruta obligatorio: ${Be.name}`);return}for(const Be of G)if(Be.required&&!((Oe=d[Be.name])!=null&&Oe.trim())){W(`Query obligatorio: ${Be.name}`);return}for(const Be of pe)if(Be.required&&!((_e=y[Be.name])!=null&&_e.trim())){W(`Header obligatorio: ${Be.name}`);return}for(const Be of we)if(Be.required&&!((Fe=k[Be.name])!=null&&Fe.trim())){W(`Cookie obligatorio: ${Be.name}`);return}let A=yk(r.path,l);if(wk(A)){W("Quedan placeholders `{…}` en la ruta sin valor.");return}const V=vk(d,H),be=`${F}${A}${V}`,Se=bk(s(),pe,y,we,k),$e={method:r.method.toUpperCase(),headers:Se,credentials:"include"};if(ve)if(T==="fields"&&(U!=null&&U.length)){for(const Re of U)if(Re.required&&!((ke=S[Re.key])!=null&&ke.trim())){W(`Campo de body obligatorio: ${Re.key}`);return}const Be=pg(U,S);$e.body=JSON.stringify(Be)}else{const Be=j.trim()||"{}";$e.body=Be}try{const Be=await fetch(be,$e),Re=await Be.text();let qe=null;try{qe=Re?JSON.parse(Re):null}catch{qe=null}P({status:Be.status,statusText:Be.statusText,bodyText:Re,json:qe})}catch(Be){P(null),W(Be instanceof Error?Be.message:String(Be))}},z=(F,A,V)=>w.jsxs("label",{className:"block text-xs",children:[w.jsxs("span",{className:"text-slate-400",children:[F.name,F.required?w.jsx("span",{className:"text-rose-400/90",children:" *"}):null,F.in!=="path"?w.jsxs("span",{className:"text-slate-600 ml-1",children:["(",F.in,")"]}):null]}),w.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=>V(Se=>({...Se,[F.name]:be.target.value})),placeholder:F.description||(F.in==="path"?`{${F.name}}`:""),autoComplete:"off"})]},`${F.in}:${F.name}`),K=F=>w.jsxs("label",{className:"block text-xs",children:[w.jsxs("span",{className:"text-slate-400",children:[F.key,F.required?w.jsx("span",{className:"text-rose-400/90",children:" *"}):null,F.type?w.jsxs("span",{className:"text-slate-600 ml-1",children:["(",F.type,")"]}):null]}),w.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 w.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:[w.jsx("h3",{className:"text-sm font-semibold tracking-tight text-slate-200",children:"Probar"}),(Q.length>0||G.length>0||pe.length>0||we.length>0)&&w.jsxs("div",{className:"space-y-2 rounded-lg border border-surface-700 bg-surface-900/40 p-3",children:[w.jsx("p",{className:"text-[10px] uppercase tracking-wide text-slate-500",children:"Parámetros"}),w.jsxs("div",{className:"grid gap-2 sm:grid-cols-2",children:[Q.map(F=>z(F,l,c)),G.map(F=>z(F,d,h)),pe.map(F=>z(F,y,b)),we.map(F=>z(F,k,x))]})]}),ve&&w.jsxs("div",{className:"space-y-2",children:[w.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[w.jsx("span",{className:"text-xs text-slate-400",children:"Body"}),U!=null&&U.length?w.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:[w.jsx("button",{type:"button",className:`min-h-[40px] px-3 py-2 transition-colors duration-200 sm:min-h-0 sm:py-1.5 ${T==="fields"?"bg-accent/25 text-accent font-medium":"bg-surface-800 text-slate-400 hover:text-slate-200"}`,onClick:J,children:"Campos"}),w.jsx("button",{type:"button",className:`min-h-[40px] px-3 py-2 transition-colors duration-200 sm:min-h-0 sm:py-1.5 border-l border-surface-600/80 ${T==="raw"?"bg-accent/25 text-accent font-medium":"bg-surface-800 text-slate-400 hover:text-slate-200"}`,onClick:ce,children:"JSON raw"})]}):w.jsx("span",{className:"text-[10px] text-slate-500",children:"(solo JSON — sin propiedades `object` en el spec)"})]}),T==="fields"&&(U!=null&&U.length)?w.jsx("div",{className:"grid gap-2 sm:grid-cols-2 rounded-lg border border-surface-700 bg-surface-900/40 p-3",children:U.map(F=>K(F))}):w.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=>M(F.target.value),placeholder:'{"key": "value"}',spellCheck:!1})]}),R&&w.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}),w.jsx("button",{type:"button",onClick:()=>void se(),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"}),w.jsxs("div",{className:"space-y-2",children:[w.jsx("p",{className:"text-[10px] uppercase tracking-wide text-slate-500",children:"Respuesta"}),B?w.jsxs(w.Fragment,{children:[w.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:[w.jsx("span",{className:B.status>=200&&B.status<300?"text-emerald-400":B.status>=400?"text-rose-400":"text-amber-300",children:B.status})," ",B.statusText]}),B.json!==null?w.jsx(ck,{data:B.json,defaultOpenDepth:3}):w.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:B.bodyText||"—"})]}):w.jsx("p",{className:"text-xs text-slate-500",children:"—"})]})]})}function Sk(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 kk(t){return w.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:[w.jsx("circle",{cx:"11",cy:"11",r:"8"}),w.jsx("path",{d:"m21 21-4.3-4.3"})]})}function Nk(t){return w.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:[w.jsx("circle",{cx:"18",cy:"5",r:"3"}),w.jsx("circle",{cx:"6",cy:"12",r:"3"}),w.jsx("circle",{cx:"18",cy:"19",r:"3"}),w.jsx("path",{d:"m8.59 13.51 6.83 3.98"}),w.jsx("path",{d:"m15.41 6.51-6.82 3.98"})]})}function Ek(t){return w.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:[w.jsx("path",{d:"M9 11l3 3L22 4"}),w.jsx("path",{d:"M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11"})]})}function Ck(t){return w.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:[w.jsx("path",{d:"M12 8V4H8"}),w.jsx("rect",{width:"16",height:"12",x:"4",y:"8",rx:"2"}),w.jsx("path",{d:"M2 14h2"}),w.jsx("path",{d:"M20 14h2"}),w.jsx("path",{d:"M15 13v2"}),w.jsx("path",{d:"M9 13v2"})]})}function jk(t){return w.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:[w.jsx("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),w.jsx("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]})}function Pk(t){return w.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:[w.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),w.jsx("polyline",{points:"7 10 12 15 17 10"}),w.jsx("line",{x1:"12",y1:"15",x2:"12",y2:"3"})]})}function Mk(t){return w.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:[w.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),w.jsx("polyline",{points:"17 8 12 3 7 8"}),w.jsx("line",{x1:"12",y1:"3",x2:"12",y2:"15"})]})}function $k(t){return w.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:[w.jsx("path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"}),w.jsx("polyline",{points:"16 17 21 12 16 7"}),w.jsx("line",{x1:"21",y1:"12",x2:"9",y2:"12"})]})}function pm(t){return w.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:[w.jsx("path",{d:"M15 3h6v6"}),w.jsx("path",{d:"M9 21H3v-6"}),w.jsx("path",{d:"M21 3l-7 7"}),w.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"}}const Ik=["get","post","put","patch","delete","options","head","trace"];function hg(t,r){const i=t.trim().replace(/\s+/g," ");return i.length<=r?i:`${i.slice(0,r-1)}…`}function Ak(t,r,i,s,l){const c=[`${t.toUpperCase()} ${r}`];return i&&c.push(`— ${hg(i,140)}`),s!=null&&s.length&&c.push(`[tags: ${s.join(", ")}]`),l&&c.push(`(operationId: ${l})`),c.join(" ")}function Ok(t,r){const i=[];let s=0;const l=t.paths;if(!l)return{lines:i,total:0};for(const[c,d]of Object.entries(l)){if(!d||typeof d!="object"||"$ref"in d)continue;const h=d;for(const y of Ik){const b=h[y];if(!(!b||typeof b!="object")&&(s+=1,i.length<r)){const k=b.summary||(b.description?hg(b.description,200):void 0);i.push(Ak(y,c,k,b.tags,b.operationId))}}}return{lines:i,total:s}}function Rk(t){var i,s,l,c,d,h,y;const r=[`Flujo «${t.name}»`];if((i=t.steps)!=null&&i.length){const b=t.steps.map(x=>`${x.method.toUpperCase()} ${x.path}`).join(" → ");r.push(`secuencia (pasos): ${b}`);const k=t.steps.filter(x=>x.extract).map(x=>`${x.extract.varName} ← ${x.extract.jsonPath}`);k.length&&r.push(`extracciones: ${k.join("; ")}`)}if((l=(s=t.graph)==null?void 0:s.nodes)!=null&&l.length){const b=t.graph.nodes.map(k=>`${k.method.toUpperCase()} ${k.path}`).join(" → ");r.push(`grafo (nodos en orden guardado): ${b}`),(c=t.graph.edges)!=null&&c.length&&r.push(`cables: ${t.graph.edges.length} (mapeo respuesta → siguiente request; detalle en la UI Flujos)`)}return!((d=t.steps)!=null&&d.length)&&!((y=(h=t.graph)==null?void 0:h.nodes)!=null&&y.length)&&r.push("(sin pasos ni nodos)"),r.join(". ")}function Dk(t){var i;if(!((i=t.cases)!=null&&i.length))return`Suite «${t.name}»: sin casos`;const r=t.cases.map(s=>`${s.method.toUpperCase()} ${s.path} → esperado HTTP ${s.expectStatus}`).join("; ");return`Suite «${t.name}» (${t.cases.length} caso(s)): ${r}`}function Lk(t,r){var T,I,B,P;const i=t.info.title??"API",s=t.info.version??"",l=`Documentación OpenAPI «${i}»${s?` v${s}`:""}.`,c=((T=t.servers)==null?void 0:T.map(R=>`${R.url}${R.description?` (${R.description})`:""}`).join(`
207
+ `))||"(sin servers en el spec; usa la Base URL de la barra superior en la UI)",d=(I=t.components)!=null&&I.securitySchemes?Object.entries(t.components.securitySchemes).map(([R,W])=>{if(!W||typeof W!="object"||"$ref"in W)return`${R}: ref`;const H=W.type??"?";return`${R} (${H})`}).join("; "):"",{lines:h,total:y}=Ok(t,400),b=y>h.length?`
208
+ … y ${y-h.length} operación(es) más en el spec.`:"";let k="";const x=((B=r==null?void 0:r.savedFlows)==null?void 0:B.filter(R=>R.name))??[];x.length&&(k=`
209
+
210
+ --- Flujos guardados por el usuario en esta app (${x.length}) ---
211
+ ${x.map(Rk).join(`
212
+ `)}`);let S="";const C=((P=r==null?void 0:r.testSuites)==null?void 0:P.filter(R=>R.name))??[];C.length&&(S=`
213
+
214
+ --- Suites de tests guardadas (${C.length}) ---
215
+ ${C.map(Dk).join(`
216
+ `)}`);let j="";const M=r==null?void 0:r.selectedOperation;return M!=null&&M.path&&(j=`
217
+
218
+ --- Operación enfocada en la UI (Explorar) ---
219
+ ${M.method.toUpperCase()} ${M.path}
220
+ (Prioriza explicar esta ruta si el usuario pregunta en genérico «este endpoint».)`),`${l}
221
+
222
+ --- Servidores (servers) ---
223
+ ${c}
224
+
225
+ --- Seguridad (components.securitySchemes) ---
226
+ ${d||"(ninguno declarado o solo referencias)"}
227
+
228
+ --- Catálogo de endpoints (método, ruta, resumen/tags) ---
229
+ Total de operaciones en el spec: ${y}.
230
+ ${h.join(`
231
+ `)}${b}
232
+ ${k}
233
+ ${S}${j}
234
+
235
+ Instrucciones:
236
+ - Responde en el idioma del usuario. Sé preciso: cita método y ruta cuando hables de un endpoint.
237
+ - Puedes explicar cómo encadenar llamadas (flujos), qué variables extraer entre pasos, y cómo se relacionan con los tests guardados.
238
+ - Para probar requests reales, el usuario debe usar la pestaña Explorar (o Flujos/Tests); tú no ejecutas HTTP.
239
+ - Si falta detalle en este resumen, indica que puede ver el cuerpo completo de la operación en la UI (Explorar) o en el JSON OpenAPI.`}async function zk(t,r,i,s,l){const c=`${t.replace(/\/?$/,"/")}__chat`,d=await fetch(c,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json",[Tk]:r},body:JSON.stringify({provider:i,model:s,messages:l})}),h=await d.text();if(!d.ok){let y=h;try{const b=JSON.parse(h);y=b.message??b.error??h}catch{}throw new Error(y||`HTTP ${d.status}`)}return JSON.parse(h)}const mg="adt-llm-provider",gg="adt-llm-model",yg="adt-llm-key";function Fk(){try{const t=localStorage.getItem(mg),r=t==="anthropic"||t==="openai"||t==="openrouter"?t:"openrouter",i=localStorage.getItem(gg)??"",s=localStorage.getItem(yg)??"";return{provider:r,model:i,apiKey:s}}catch{return{provider:"openrouter",model:"",apiKey:""}}}function Bk(t,r,i){try{localStorage.setItem(mg,t),localStorage.setItem(gg,r),localStorage.setItem(yg,i)}catch{}}function Hk({doc:t,contextExtras:r}){const i="/docs/",[s,l]=Y.useState("openrouter"),[c,d]=Y.useState(""),[h,y]=Y.useState(""),[b,k]=Y.useState(!0),[x,S]=Y.useState([]),[C,j]=Y.useState(""),[M,T]=Y.useState(!1),[I,B]=Y.useState(null),P=Y.useRef(null);Y.useEffect(()=>{const G=Fk();l(G.provider),d(G.model||Zl(G.provider)),y(G.apiKey)},[]);const R=Y.useMemo(()=>Lk(t,r),[t,r]);Y.useEffect(()=>{var G;(G=P.current)==null||G.scrollIntoView({behavior:"smooth"})},[x]);const W=Y.useCallback(()=>{Bk(s,c.trim(),h),B(null),k(!1)},[s,c,h]),H=Y.useCallback(async()=>{const G=C.trim();if(!G||M)return;if(!h.trim()){B("Configura tu clave API en Ajustes del asistente."),k(!0);return}B(null);const pe=c.trim()||Zl(s),we={role:"user",content:G},U=[{role:"system",content:R},...x.filter(le=>le.role!=="system"),we];j(""),S(le=>[...le,we]),T(!0);try{const le=await zk(i,h.trim(),s,pe,U);S(ve=>[...ve,{role:"assistant",content:le.content??""}])}catch(le){B(le instanceof Error?le.message:String(le))}finally{T(!1)}},[h,i,C,M,x,c,s,R]),Q=Y.useCallback(()=>{S([]),B(null)},[]);return w.jsxs("div",{className:"max-w-3xl mx-auto space-y-4 pb-8",children:[w.jsxs("div",{className:"rounded-2xl border border-surface-700/90 bg-surface-900/50 overflow-hidden",children:[w.jsxs("button",{type:"button",onClick:()=>k(G=>!G),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":b,children:[w.jsx("span",{children:"Ajustes del asistente (clave propia)"}),w.jsx("span",{className:"text-slate-500",children:b?"▼":"▶"})]}),b?w.jsxs("div",{className:"px-4 pb-4 space-y-3 border-t border-surface-700/80",children:[w.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."}),w.jsxs("label",{className:"block text-xs text-slate-400",children:["Proveedor",w.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:s,onChange:G=>{const pe=G.target.value;l(pe),d(we=>we.trim()?we:Zl(pe))},children:[w.jsx("option",{value:"anthropic",children:"Anthropic (Claude)"}),w.jsx("option",{value:"openai",children:"OpenAI"}),w.jsx("option",{value:"openrouter",children:"OpenRouter"})]})]}),w.jsxs("label",{className:"block text-xs text-slate-400",children:["Modelo (opcional, se usa uno por defecto si vacío)",w.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:c,onChange:G=>d(G.target.value),placeholder:Zl(s),spellCheck:!1})]}),w.jsxs("label",{className:"block text-xs text-slate-400",children:["API key",w.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:h,onChange:G=>y(G.target.value),placeholder:s==="anthropic"?"sk-ant-…":s==="openai"?"sk-…":"sk-or-v1-…",autoComplete:"off"})]}),w.jsx("div",{className:"flex flex-wrap gap-2",children:w.jsx("button",{type:"button",onClick:W,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]}),I?w.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:I}):null,w.jsxs("div",{className:"rounded-2xl border border-surface-700 bg-surface-950/40 min-h-[320px] flex flex-col",children:[w.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b border-surface-700/80",children:[w.jsx("span",{className:"text-xs font-medium text-slate-400",children:"Conversación"}),w.jsx("button",{type:"button",onClick:Q,className:"text-xs text-slate-500 hover:text-slate-300 underline",children:"Vaciar chat"})]}),w.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-4 max-h-[min(60vh,28rem)]",children:[x.length===0?w.jsx("p",{className:"text-sm text-slate-500 text-center py-8 leading-relaxed",children:"Pregunta por endpoints del spec, flujos guardados, tests, seguridad o cómo encadenar llamadas. El contexto incluye el catálogo de operaciones y tus flujos/suites en este navegador."}):x.map((G,pe)=>w.jsxs("div",{className:`text-sm leading-relaxed rounded-xl px-3 py-2 ${G.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:[w.jsx("span",{className:"text-[10px] uppercase tracking-wider text-slate-500 block mb-1",children:G.role==="user"?"Tú":"Asistente"}),w.jsx("div",{className:"whitespace-pre-wrap break-words",children:G.content})]},`${pe}-${G.role}`)),w.jsx("div",{ref:P})]}),w.jsxs("div",{className:"p-3 border-t border-surface-700/80 flex gap-2",children:[w.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:C,onChange:G=>j(G.target.value),onKeyDown:G=>{G.key==="Enter"&&!G.shiftKey&&(G.preventDefault(),H())},placeholder:"Ej.: ¿Qué hace POST /orders? ¿Cómo encajo el flujo X con el test Y?…",disabled:M}),w.jsx("button",{type:"button",onClick:()=>void H(),disabled:M||!C.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:M?"…":"Enviar"})]})]})]})}const vg=[{value:200,label:"200 OK"},{value:201,label:"201 Created"},{value:202,label:"202 Accepted"},{value:204,label:"204 No Content"},{value:400,label:"400 Bad Request"},{value:401,label:"401 Unauthorized"},{value:403,label:"403 Forbidden"},{value:404,label:"404 Not Found"},{value:409,label:"409 Conflict"},{value:422,label:"422 Unprocessable"},{value:429,label:"429 Too Many Requests"},{value:500,label:"500 Server Error"},{value:502,label:"502 Bad Gateway"},{value:503,label:"503 Unavailable"}];function hm(t){return vg.some(r=>r.value===t)}const yf=[{id:"typescript",label:"TypeScript"},{id:"javascript",label:"JavaScript"},{id:"python",label:"Python"},{id:"php",label:"PHP"}];function vf(t,r){return`${t.toLowerCase()} ${r}`}function Vk(t){const r=t.indexOf(" ");return r===-1?{method:"get",path:"/"}:{method:t.slice(0,r),path:t.slice(r+1)}}async function mm(t){await navigator.clipboard.writeText(t)}function Uk(){var An;const t=uk(),[r,i]=Y.useState(null),[s,l]=Y.useState(null),[c,d]=Y.useState("explore"),[h,y]=Y.useState(""),[b,k]=Y.useState(null),[x,S]=Y.useState(null),[C,j]=Y.useState("typescript"),[M,T]=Y.useState(""),[I,B]=Y.useState(""),[P,R]=Y.useState("X-Api-Key"),[W,H]=Y.useState({nodes:[],edges:[]}),[Q,G]=Y.useState(0),[pe,we]=Y.useState("Mi flujo"),[U,le]=Y.useState([]),[ve,D]=Y.useState(""),[ce,J]=Y.useState({name:"Suite 1",cases:[]}),[se,z]=Y.useState([]),[K,F]=Y.useState(""),[A,V]=Y.useState(""),[be,Se]=Y.useState(null),[$e,Ae]=Y.useState(null),[Oe,_e]=Y.useState(null),Fe=(q,Ne)=>{try{const Ve=sessionStorage.getItem(q);if(Ve==="1")return!0;if(Ve==="0")return!1}catch{}return Ne},[ke,Be]=Y.useState(()=>Fe("adt-collapse-main",!1)),[Re,qe]=Y.useState(()=>Fe("adt-collapse-explore",!1)),lt="/docs/openapi.json",ut="/docs/preset.json",ot=Y.useCallback(async()=>{const[q,Ne]=await Promise.all([bt.flows.toArray(),bt.testSuites.toArray()]);le(q.sort((Ve,pt)=>(Ve.name??"").localeCompare(pt.name??""))),z(Ne.sort((Ve,pt)=>(Ve.name??"").localeCompare(pt.name??"")))},[]);Y.useEffect(()=>{var Ne,Ve;if(!r)return;const q=((Ne=t.productName)==null?void 0:Ne.trim())||((Ve=r.info.title)==null?void 0:Ve.trim())||"API";document.title=q},[r,t.productName]),Y.useEffect(()=>{fetch(lt,{credentials:"include"}).then(async q=>{if(q.status===401){let Ne="/docs/__auth/login";try{const Ve=await q.json();Ve.loginPath&&(Ne=Ve.loginPath)}catch{}return window.location.href=Ne,null}if(!q.ok)throw new Error(`${q.status} ${q.statusText}`);return q.json()}).then(q=>{q&&(i(q),y(ks(q)),l(null))}).catch(q=>l(q.message))},[lt]),Y.useEffect(()=>{try{sessionStorage.setItem("adt-collapse-main",ke?"1":"0")}catch{}},[ke]),Y.useEffect(()=>{try{sessionStorage.setItem("adt-collapse-explore",Re?"1":"0")}catch{}},[Re]),Y.useEffect(()=>{(async()=>{try{const q=await fetch("/docs/__auth/session",{credentials:"include"});if(q.ok){const Ne=await q.json();_e({username:Ne.username})}else _e(null)}catch{_e(null)}})()},[]),Y.useEffect(()=>{if(!r)return;let q=!1;return(async()=>{try{const Ne=await fetch(ut,{credentials:"include"});if(!Ne.ok||q)return;const Ve=await Ne.json(),pt=await Uy(Ve);!q&&pt&&await ot()}catch{}})(),()=>{q=!0}},[r,ut,ot]),Y.useEffect(()=>{ot(),bt.kv.get("bearer").then(q=>q&&T(q.value)),bt.kv.get("apiKey").then(q=>q&&B(q.value))},[ot]);const $t=Y.useMemo(()=>r?Dy(r):[],[r]),St=Y.useMemo(()=>r?Zr(r):[],[r]),nn=Y.useMemo(()=>({savedFlows:U,testSuites:se,selectedOperation:x}),[U,se,x]),Lt=Y.useMemo(()=>b?St.filter(q=>(q.tags??["default"]).includes(b)):St,[St,b]);Y.useEffect(()=>{if(St.length&&!A){const q=St[0];V(vf(q.method,q.path))}},[St,A]),Y.useEffect(()=>{if(St.length===0||W.nodes.length>0||c!=="flows"||be!=null)return;const q=St[0];H({nodes:[{id:crypto.randomUUID(),method:q.method.toLowerCase(),path:q.path,x:80,y:120}],edges:[]}),G(Ne=>Ne+1)},[St,W.nodes.length,c,be]);const _t=Y.useCallback(()=>{const q={"Content-Type":"application/json"};return M.trim()&&(q.Authorization=`Bearer ${M.trim()}`),I.trim()&&(q[P]=I.trim()),q},[M,I,P]),dn=Y.useMemo(()=>{if(!r||!x)return null;const q={};for(const{id:Ne}of yf)q[Ne]=Ay(r,Ne,x.method,x.path);return q},[r,x]),rn=Y.useMemo(()=>r?Ry(r,C,b):"",[r,C,b]),mr=async q=>{var qt;if(!r)return"";const Ne={};let Ve="";const pt=ks(r,h);for(let Wt=0;Wt<q.length;Wt++){const Yt=q[Wt];let rr=Yt.path;for(const[sn,no]of Object.entries(Ne))rr=rr.replace(`{${sn}}`,no);const pn=`${pt}${rr}`,Cn={method:Yt.method.toUpperCase(),headers:_t()},zt=Yt.method.toLowerCase();zt!=="get"&&zt!=="head"&&(Cn.body="{}");const Wn=await fetch(pn,{...Cn,credentials:"include"}),Lr=await Wn.json().catch(()=>({}));if(Ve+=`Paso ${Wt+1}: ${Wn.status}
240
+ ${JSON.stringify(Lr,null,2)}
241
+
242
+ `,(qt=Yt.extract)!=null&&qt.jsonPath){const sn=Rf(Lr,Yt.extract.jsonPath);sn!==void 0&&(Ne[Yt.extract.varName]=String(sn))}}return Ve},bn=async()=>{if(!r)return;const q=ks(r,h);if(W.nodes.length===0){D("Añade al menos un nodo al flujo.");return}const Ne=await um(W,q,_t);D(Ne)},Nt=async q=>{if(!r)return;const Ne=ks(r,h),Ve=q.graph&&q.graph.nodes.length>0?await um(q.graph,Ne,_t):await mr(q.steps);D(Ve),d("flows")},Kt=q=>{we(q.name),H(q.graph&&q.graph.nodes.length>0?q.graph:ak(q.steps.length?q.steps:[{method:"get",path:"/"}])),G(Ne=>Ne+1),Se(q.id??null),d("flows")},$n=()=>{Se(null),we("Nuevo flujo"),St[0]?H({nodes:[{id:crypto.randomUUID(),method:St[0].method.toLowerCase(),path:St[0].path,x:80,y:120}],edges:[]}):H({nodes:[],edges:[]}),G(q=>q+1)},tr=Y.useCallback(q=>{H(q)},[]),_n=async()=>{const q=sk(W);if(be!=null)await bt.flows.update(be,{name:pe,steps:q,graph:W});else{const Ne=await bt.flows.add({name:pe,steps:q,graph:W});Se(Ne)}await ot()},Tn=async q=>{q!==void 0&&(q===be&&(Se(null),$n()),await bt.flows.delete(q),await ot())},Un=()=>{if(!A)return;const{method:q,path:Ne}=Vk(A),Ve={id:crypto.randomUUID(),method:q,path:Ne,expectStatus:200,contains:void 0,jsonPath:void 0,expectJsonValue:void 0};J(pt=>({...pt,cases:[...pt.cases,Ve]}))},gr=q=>{J(Ne=>({...Ne,cases:Ne.cases.filter(Ve=>Ve.id!==q)}))},Sn=(q,Ne)=>{J(Ve=>({...Ve,cases:Ve.cases.map(pt=>pt.id===q?{...pt,...Ne}:pt)}))},on=async q=>{if(!r)return"";const Ne=ks(r,h);let Ve="";for(const pt of q){const qt=`${Ne}${pt.path}`,Wt=await fetch(qt,{method:pt.method.toUpperCase(),headers:_t(),credentials:"include"}),Yt=await Wt.text(),rr=Ky(pt,Wt.status,Yt),pn=`${rr.pass?"PASS":"FAIL"} ${pt.method.toUpperCase()} ${pt.path}`;Ve+=`${pn}
243
+ ${rr.lines.map(Cn=>` ${Cn}`).join(`
244
+ `)}
245
+
246
+ `}return Ve},Ye=async()=>{const q=await on(ce.cases);F(q)},Kn=async()=>{if(!r||se.length===0)return;let q="";for(const Ne of se)q+=`━━━ ${Ne.name} (${Ne.cases.length} casos) ━━━
247
+ `,q+=await on(Ne.cases);F(q),d("tests")},kn=async q=>{const Ne=await on(q.cases);F(Ne),d("tests")},nr=q=>{J({name:q.name,cases:q.cases.map(Ne=>({...Ne,id:Ne.id&&Ne.id.length>0?Ne.id:crypto.randomUUID()}))}),Ae(q.id??null),d("tests")},He=()=>{Ae(null),J({name:"Nueva suite",cases:[]})},In=async()=>{if($e!=null)await bt.testSuites.update($e,{name:ce.name,cases:ce.cases});else{const q=await bt.testSuites.add({name:ce.name,cases:ce.cases});Ae(q)}await ot()},qn=async q=>{q!==void 0&&(q===$e&&(Ae(null),J({name:"Nueva suite",cases:[]})),await bt.testSuites.delete(q),await ot())},Or=async()=>{await bt.kv.put({key:"bearer",value:M}),await bt.kv.put({key:"apiKey",value:I})},Rr=async()=>{const q=await Vy(),Ne=new Blob([JSON.stringify(q,null,2)],{type:"application/json"}),Ve=document.createElement("a");Ve.href=URL.createObjectURL(Ne),Ve.download="api-doc-tor-export.json",Ve.click()},Dr=async q=>{var qt;const Ne=(qt=q.target.files)==null?void 0:qt[0];if(!Ne)return;const Ve=await Ne.text(),pt=JSON.parse(Ve);await _m(pt),await ot()},to=async()=>{await fetch("/docs/__auth/logout",{method:"POST",credentials:"include"}),window.location.href="/docs/__auth/login"},Io=()=>{x&&(H(q=>{const Ne=q.nodes[q.nodes.length-1],Ve=Ne?Ne.x+280:80,pt=(Ne==null?void 0:Ne.y)??120;return{nodes:[...q.nodes,{id:crypto.randomUUID(),method:x.method.toLowerCase(),path:x.path,x:Ve,y:pt}],edges:q.edges}}),G(q=>q+1),d("flows"))};if(s)return w.jsx("div",{className:"min-h-screen flex items-center justify-center p-8",children:w.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:[w.jsx("h1",{className:"font-display text-xl font-bold mb-2",children:"No se pudo cargar OpenAPI"}),w.jsx("p",{className:"text-sm opacity-90 leading-relaxed",children:s}),w.jsxs("p",{className:"text-xs mt-4 text-slate-500",children:["URL intentada: ",lt]})]})});if(!r)return w.jsx("div",{className:"min-h-screen flex items-center justify-center p-6",children:w.jsx("p",{className:"text-slate-400 motion-safe:animate-pulse",children:"Cargando especificación…"})});const Nn=b===null?"Todos los endpoints (cliente único con todas las operaciones)":`Tag «${b}» (solo operaciones de este grupo)`,En=((An=t.productName)==null?void 0:An.trim())||r.info.title;return w.jsxs("div",{className:"min-h-screen flex flex-col bg-surface-950 selection:bg-accent/25 selection:text-slate-50",children:[w.jsx("a",{href:"#main-content",className:"skip-link",children:"Saltar al contenido"}),w.jsxs("div",{className:"flex flex-1 flex-col md:flex-row min-h-0",children:[w.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:[w.jsx("input",{id:"adt-state-import",type:"file",accept:"application/json",className:"hidden",onChange:Dr}),w.jsxs("div",{className:ke?"max-md:block md:hidden":"block",children:[w.jsxs("div",{className:"p-4 border-b border-surface-700 flex justify-between items-start gap-2",children:[w.jsxs("div",{className:"min-w-0",children:[t.logoDataUrl?w.jsx("img",{src:t.logoDataUrl,alt:En,className:"h-9 max-w-[200px] object-contain object-left mb-2"}):null,w.jsx("h1",{className:"font-display text-lg font-bold text-white tracking-tight",children:En}),w.jsx("p",{className:"text-xs text-slate-500 mt-1",children:En===r.info.title?`v${r.info.version}`:`${r.info.title} · v${r.info.version}`})]}),w.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:()=>Be(!0),"aria-label":"Ocultar menú lateral",title:"Ocultar menú",children:"‹"})]}),w.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 (${U.length})`],["tests",`Tests (${se.length})`],["assistant","Asistente"],["auth","Auth"]].map(([q,Ne])=>w.jsx("button",{type:"button",onClick:()=>d(q),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===q?"bg-accent/20 text-accent shadow-inner shadow-accent/5":"text-slate-400 hover:bg-surface-800 hover:text-slate-200"}`,children:Ne},q))}),Oe?w.jsxs("div",{className:"px-3 py-2 border-t border-surface-700 flex items-center justify-between gap-2 text-xs",children:[w.jsx("span",{className:"text-slate-400 truncate",title:Oe.username,children:Oe.username}),w.jsx("button",{type:"button",className:"shrink-0 text-accent hover:underline",onClick:()=>void to(),children:"Salir"})]}):null,w.jsxs("div",{className:"p-3 border-t border-surface-700 space-y-2",children:[w.jsx("button",{type:"button",onClick:Rr,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"}),w.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?w.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:[w.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:()=>Be(!1),"aria-label":"Mostrar menú lateral completo",title:"Expandir panel completo",children:w.jsx(pm,{className:"text-slate-300"})}),w.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:[w.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:w.jsx(kk,{})}),w.jsxs("button",{type:"button",onClick:()=>d("flows"),title:`Flujos (${U.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:[w.jsx(Nk,{}),U.length>0?w.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:U.length>99?"99+":U.length}):null]}),w.jsxs("button",{type:"button",onClick:()=>d("tests"),title:`Tests (${se.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:[w.jsx(Ek,{}),se.length>0?w.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:se.length>99?"99+":se.length}):null]}),w.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:w.jsx(Ck,{})}),w.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:[w.jsx(jk,{}),Oe?w.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]})]}),w.jsxs("div",{className:"flex flex-col gap-0.5 items-center w-full py-1 mt-auto border-t border-surface-700/80",children:[w.jsx("button",{type:"button",onClick:Rr,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:w.jsx(Pk,{})}),w.jsx("button",{type:"button",onClick:()=>{var q;return(q=document.getElementById("adt-state-import"))==null?void 0:q.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:w.jsx(Mk,{})}),Oe?w.jsx("button",{type:"button",onClick:()=>void to(),title:`Salir (${Oe.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:w.jsx($k,{})}):null]})]}):null]}),w.jsxs("main",{id:"main-content",tabIndex:-1,className:"flex-1 flex flex-col min-h-0 outline-none",children:[w.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:w.jsxs("label",{className:"text-xs text-slate-500 flex flex-col gap-1 sm:flex-row sm:items-center",children:[w.jsx("span",{className:"shrink-0 font-medium text-slate-400",children:"Base URL"}),w.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:h,onChange:q=>y(q.target.value),placeholder:"https://api.ejemplo.com",autoComplete:"url",spellCheck:!1})]})}),c==="explore"&&w.jsxs("div",{className:"flex-1 flex flex-col lg:flex-row min-h-0",children:[w.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 ${Re?"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:[w.jsxs("div",{className:Re?"max-lg:block lg:hidden":"block",children:[w.jsxs("div",{className:"p-2 flex items-start justify-between gap-2 border-b border-surface-700 lg:border-b-0",children:[w.jsx("p",{className:"text-xs uppercase tracking-wider text-slate-500 shrink-0",children:"Tags"}),w.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:"‹"})]}),w.jsx("div",{className:"p-2 pt-1",children:w.jsxs("div",{className:"flex flex-wrap gap-1",children:[w.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"}),$t.map(q=>w.jsx("button",{type:"button",onClick:()=>k(q),className:`text-xs px-3 py-2 sm:py-1 rounded-lg min-h-[40px] sm:min-h-0 transition-colors duration-200 ${b===q?"bg-accent/30 text-slate-100":"bg-surface-800 text-slate-300 hover:bg-surface-700"}`,children:q},q))]})}),w.jsx("ul",{className:"text-sm",children:Lt.map(q=>w.jsx("li",{children:w.jsxs("button",{type:"button",onClick:()=>S({method:q.method,path:q.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 ${(x==null?void 0:x.method)===q.method&&x.path===q.path?"bg-surface-800/90 border-l-2 border-accent":""}`,children:[w.jsx(su,{method:q.method}),w.jsx("span",{className:"truncate text-slate-300",children:q.path})]})},`${q.method}:${q.path}`))})]}),Re?w.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:[w.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:w.jsx(pm,{className:"text-slate-300"})}),w.jsxs("div",{className:"text-center text-[9px] font-mono text-slate-500 leading-none px-0.5",title:`${Lt.length} operación(es) (filtro actual)`,children:[w.jsx("span",{className:"block text-slate-400 font-semibold text-[11px]",children:Lt.length}),w.jsx("span",{className:"text-[8px] uppercase tracking-tighter",children:"ops"})]}),w.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:Lt.map((q,Ne)=>{const Ve=(x==null?void 0:x.method)===q.method&&x.path===q.path;return w.jsx("button",{type:"button",role:"listitem",title:`${q.method.toUpperCase()} ${q.path}`,onClick:()=>S({method:q.method,path:q.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 ${Sk(q.method)} ${Ve?"ring-2 ring-accent/80 shadow-[inset_0_0_0_1px_rgba(56,189,248,0.2)]":""}`,children:Ne+1},`${q.method}:${q.path}`)})})]}):null]}),w.jsx("div",{className:"flex-1 p-4 overflow-auto space-y-6",children:x?w.jsxs(w.Fragment,{children:[w.jsxs("div",{children:[w.jsxs("h2",{className:"font-display font-semibold text-white text-lg flex flex-wrap items-center gap-2",children:[w.jsx(su,{method:x.method,size:"md"}),w.jsx("span",{className:"font-mono text-slate-200 break-all",children:x.path})]}),w.jsxs("p",{className:"text-xs text-slate-500 mt-1",children:["Filtro de exportación de servicio: ",Nn]})]}),r?w.jsx(_k,{doc:r,selectedOp:x,baseUrl:h,buildHeaders:_t}):null,w.jsxs("section",{className:"space-y-3",children:[w.jsx("h3",{className:"text-sm font-medium text-slate-300",children:"Snippets por lenguaje"}),w.jsx("div",{className:"grid gap-3 md:grid-cols-2",children:dn&&yf.map(({id:q,label:Ne})=>w.jsxs("div",{className:"rounded-xl border border-surface-700 bg-surface-900/60 overflow-hidden",children:[w.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b border-surface-700 bg-surface-800/50",children:[w.jsx("span",{className:"text-xs font-medium text-accent",children:Ne}),w.jsx("button",{type:"button",className:"text-xs px-2 py-1 rounded bg-surface-700 hover:bg-surface-600",onClick:()=>void mm(dn[q]),children:"Copiar"})]}),w.jsx("pre",{className:"text-[11px] p-3 overflow-auto max-h-56 text-slate-300 font-mono whitespace-pre-wrap",children:dn[q]})]},q))})]}),w.jsxs("section",{className:"space-y-3 rounded-xl border border-surface-700 bg-surface-900/40 p-4",children:[w.jsx("h3",{className:"text-sm font-medium text-slate-300",children:"Cliente / servicio generado"}),w.jsx("p",{className:"text-xs text-slate-500",children:Nn}),w.jsxs("div",{className:"flex flex-wrap gap-2 items-center",children:[w.jsxs("label",{className:"text-xs text-slate-400",children:["Lenguaje del archivo",w.jsx("select",{className:"ml-2 bg-surface-800 border border-surface-600 rounded px-2 py-1.5 text-sm",value:C,onChange:q=>j(q.target.value),children:yf.map(({id:q,label:Ne})=>w.jsx("option",{value:q,children:Ne},q))})]}),w.jsx("button",{type:"button",className:"text-xs px-3 py-1.5 rounded-lg bg-surface-700 hover:bg-surface-600",onClick:()=>void mm(rn),children:"Copiar servicio"})]}),w.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:rn})]}),w.jsx("div",{className:"flex flex-wrap gap-2 pt-2 border-t border-surface-800",children:w.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)"})})]}):w.jsx("p",{className:"text-slate-500",children:"Selecciona una operación en la lista."})})]}),c==="flows"&&w.jsxs("div",{className:"p-4 space-y-6 overflow-auto max-w-5xl",children:[w.jsxs("section",{className:"rounded-xl border border-surface-700 bg-surface-900/50 p-4",children:[w.jsx("h3",{className:"text-sm font-semibold text-white mb-3",children:"Flujos guardados"}),U.length===0?w.jsx("p",{className:"text-sm text-slate-500",children:"Aún no hay flujos. Crea uno en el editor y guarda."}):w.jsx("ul",{className:"space-y-2",children:U.map(q=>{var Ne,Ve;return w.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:[w.jsxs("div",{children:[w.jsx("span",{className:"text-sm text-slate-200 font-medium",children:q.name}),w.jsxs("span",{className:"text-xs text-slate-500 ml-2",children:[(((Ve=(Ne=q.graph)==null?void 0:Ne.nodes)==null?void 0:Ve.length)??q.steps.length)||0," nodo(s)"]})]}),w.jsxs("div",{className:"flex flex-wrap gap-2",children:[w.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 Nt(q),children:"Play"}),w.jsx("button",{type:"button",className:"text-xs px-2 py-1.5 rounded bg-accent/20 text-accent hover:bg-accent/30",onClick:()=>Kt(q),children:"Editar"}),w.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 Tn(q.id),children:"Eliminar"})]})]},q.id!=null?`flow-${q.id}`:`flow-${q.name}`)})})]}),w.jsxs("section",{className:"space-y-4 max-w-6xl",children:[w.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[w.jsx("h3",{className:"text-sm font-semibold text-white",children:"Editor de flujo (nodos y cables)"}),w.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:$n,children:"Nuevo flujo"})]}),be!=null&&w.jsxs("p",{className:"text-xs text-accent",children:["Editando flujo guardado (#",be,")"]}),w.jsxs("p",{className:"text-sm text-slate-400",children:["Cada nodo es un endpoint del spec. Conecta ",w.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 ",w.jsx("code",{className:"text-accent",children:"{variable}"})," en la ruta)."]}),w.jsx("input",{className:"bg-surface-800 border border-surface-600 rounded px-3 py-2 text-sm w-full max-w-md",value:pe,onChange:q=>we(q.target.value),placeholder:"Nombre del flujo"}),w.jsx(ik,{doc:r,ops:St,graph:W,onGraphChange:tr},Q),w.jsxs("div",{className:"flex flex-wrap gap-2",children:[w.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 bn(),children:"Play (grafo)"}),w.jsx("button",{type:"button",className:"px-3 py-2 rounded-lg bg-surface-700 text-sm",onClick:()=>void _n(),children:be!=null?"Guardar cambios":"Guardar flujo"})]}),w.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:ve||"Resultado de la ejecución aquí."})]})]}),c==="tests"&&w.jsxs("div",{className:"p-4 space-y-6 overflow-auto max-w-5xl",children:[w.jsxs("section",{className:"rounded-xl border border-surface-700 bg-surface-900/50 p-4 space-y-3",children:[w.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[w.jsx("h3",{className:"text-sm font-semibold text-white",children:"Suites guardadas"}),se.length>0&&w.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 Kn(),children:"Ejecutar todas las suites"})]}),se.length===0?w.jsx("p",{className:"text-sm text-slate-500",children:"Ninguna suite guardada."}):w.jsx("ul",{className:"space-y-2",children:se.map(q=>w.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:[w.jsxs("div",{children:[w.jsx("span",{className:"text-sm text-slate-200 font-medium",children:q.name}),w.jsxs("span",{className:"text-xs text-slate-500 ml-2",children:[q.cases.length," caso(s)"]})]}),w.jsxs("div",{className:"flex flex-wrap gap-2",children:[w.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(q),children:"Play"}),w.jsx("button",{type:"button",className:"text-xs px-2 py-1.5 rounded bg-accent/20 text-accent",onClick:()=>nr(q),children:"Editar"}),w.jsx("button",{type:"button",className:"text-xs px-2 py-1 rounded bg-surface-700 hover:bg-red-900/40",onClick:()=>void qn(q.id),children:"Eliminar"})]})]},q.id!=null?`suite-${q.id}`:`suite-${q.name}`))})]}),w.jsxs("section",{className:"space-y-4",children:[w.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[w.jsx("h3",{className:"text-sm font-semibold text-white",children:"Suite en edición"}),w.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:He,children:"Nueva suite"})]}),$e!=null&&w.jsxs("p",{className:"text-xs text-accent",children:["Editando suite guardada (#",$e,")"]}),w.jsx("input",{className:"bg-surface-800 border border-surface-600 rounded px-3 py-2 text-sm max-w-md",value:ce.name,onChange:q=>J(Ne=>({...Ne,name:q.target.value})),placeholder:"Nombre de la suite"}),w.jsxs("div",{className:"flex flex-wrap gap-2 items-end rounded-xl border border-surface-700 bg-surface-900/40 p-4",children:[w.jsxs("label",{className:"text-xs text-slate-400 flex-1 min-w-[200px]",children:["Añadir endpoint del spec",w.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:q=>V(q.target.value),children:St.map(q=>w.jsxs("option",{value:vf(q.method,q.path),children:[q.method.toUpperCase()," ",q.path]},vf(q.method,q.path)))})]}),w.jsx("button",{type:"button",className:"px-4 py-2 rounded-lg bg-surface-800 text-sm hover:bg-surface-700",onClick:Un,children:"Añadir a la suite"})]}),w.jsx("ul",{className:"space-y-4",children:ce.cases.map(q=>{const Ne=hm(q.expectStatus)?String(q.expectStatus):"custom";return w.jsxs("li",{className:"rounded-xl border border-surface-700 bg-surface-950/40 p-4 space-y-3 text-sm",children:[w.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-2",children:[w.jsxs("span",{className:"flex flex-wrap items-center gap-2 min-w-0",children:[w.jsx(su,{method:q.method}),w.jsx("span",{className:"font-mono text-xs text-slate-300 break-all",children:q.path})]}),w.jsx("button",{type:"button",className:"text-xs text-red-400 hover:underline shrink-0",onClick:()=>gr(q.id),children:"Quitar"})]}),w.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-3",children:[w.jsxs("label",{className:"text-xs text-slate-400 block",children:["Código HTTP esperado",w.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-2",children:[w.jsxs("select",{className:"bg-surface-800 border border-surface-600 rounded px-2 py-1.5 text-sm max-w-[200px]",value:Ne,onChange:Ve=>{const pt=Ve.target.value;if(pt==="custom"){Sn(q.id,{expectStatus:hm(q.expectStatus)?1e3:q.expectStatus});return}Sn(q.id,{expectStatus:Number(pt)})},children:[vg.map(Ve=>w.jsx("option",{value:String(Ve.value),children:Ve.label},Ve.value)),w.jsx("option",{value:"custom",children:"Otro…"})]}),Ne==="custom"&&w.jsx("input",{type:"number",className:"w-20 bg-surface-800 border border-surface-600 rounded px-2 py-1.5 text-sm",value:q.expectStatus,onChange:Ve=>Sn(q.id,{expectStatus:Number(Ve.target.value)||0})})]})]}),w.jsxs("label",{className:"text-xs text-slate-400 block sm:col-span-2",children:["El body contiene (opcional)",w.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:q.contains??"",onChange:Ve=>Sn(q.id,{contains:Ve.target.value||void 0})})]}),w.jsxs("label",{className:"text-xs text-slate-400 block",children:["JSON path (opcional)",w.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:q.jsonPath??"",onChange:Ve=>Sn(q.id,{jsonPath:Ve.target.value||void 0})})]}),w.jsxs("label",{className:"text-xs text-slate-400 block sm:col-span-2",children:["Valor esperado en JSON path (opcional)",w.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:q.expectJsonValue??"",onChange:Ve=>Sn(q.id,{expectJsonValue:Ve.target.value||void 0})})]})]})]},q.id)})}),w.jsxs("div",{className:"flex flex-wrap gap-2 items-center",children:[w.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 Ye(),children:"Correr todos los casos (suite actual)"}),w.jsx("button",{type:"button",className:"px-4 py-2 rounded-lg bg-surface-700 text-sm",onClick:()=>void In(),children:$e!=null?"Guardar cambios":"Guardar suite"})]}),w.jsx("pre",{className:"text-xs bg-surface-950 border border-surface-700 rounded-lg p-3 whitespace-pre-wrap min-h-[4rem]",children:K||"—"})]})]}),c==="assistant"&&w.jsx("div",{className:"flex-1 overflow-auto p-4 min-h-0",children:w.jsx(Hk,{doc:r,contextExtras:nn})}),c==="auth"&&w.jsxs("div",{className:"p-4 space-y-4 max-w-lg",children:[w.jsxs("p",{className:"text-sm text-slate-400",children:["Esquemas en el spec: ",Ly(r).join(", ")||"ninguno"]}),w.jsxs("label",{className:"block text-sm",children:["Bearer token",w.jsx("input",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-3 py-2",value:M,onChange:q=>T(q.target.value),placeholder:"eyJ..."})]}),w.jsxs("label",{className:"block text-sm",children:["API key header",w.jsx("input",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-3 py-2",value:P,onChange:q=>R(q.target.value)})]}),w.jsxs("label",{className:"block text-sm",children:["API key",w.jsx("input",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-3 py-2",value:I,onChange:q=>B(q.target.value),type:"password",autoComplete:"off"})]}),w.jsx("button",{type:"button",className:"px-4 py-2 rounded-lg bg-surface-700 text-sm",onClick:()=>void Or(),children:"Recordar en este navegador"})]})]})]}),w.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 Kk={surface950:"#0c0f14",surface900:"#12171f",surface800:"#1a2230",surface700:"#243044",accent:"#38bdf8",accentDim:"#0ea5e9"};function Ss(t){const r=t.trim(),i=/^#?([0-9a-f]{6})$/i.exec(r);if(!i)return"12 15 20";const s=parseInt(i[1],16);return`${s>>16&255} ${s>>8&255} ${s&255}`}function qk(t){return{...Kk,...t}}function Wk(t){var s,l;const r=(s=t.logoBase64)==null?void 0:s.trim();return r?r.startsWith("data:")?r:`data:${((l=t.logoMimeType)==null?void 0:l.trim())||"image/png"};base64,${r}`:null}function Yk(t){var i;const r=qk(t==null?void 0:t.colors);return{productName:((i=t==null?void 0:t.productName)==null?void 0:i.trim())||null,logoDataUrl:t?Wk(t):null,colors:r,colorsRgb:{surface950:Ss(r.surface950),surface900:Ss(r.surface900),surface800:Ss(r.surface800),surface700:Ss(r.surface700),accent:Ss(r.accent),accentDim:Ss(r.accentDim)}}}const Xk={credentials:"include"};function Qk(t){const r=document.documentElement;r.style.setProperty("--surface-950",t.surface950),r.style.setProperty("--surface-900",t.surface900),r.style.setProperty("--surface-800",t.surface800),r.style.setProperty("--surface-700",t.surface700),r.style.setProperty("--accent",t.accent),r.style.setProperty("--accent-dim",t.accentDim)}async function Gk(){const t=Yk(void 0);try{const r=await fetch("/docs/ui-config.json",Xk);return r.status===401?{...t,docsAuthRequired:!0}:r.ok?await r.json():t}catch{return t}}(async()=>{const t=await Gk();Qk(t.colorsRgb),xy.createRoot(document.getElementById("root")).render(w.jsx(gm.StrictMode,{children:w.jsx(lk,{value:{productName:t.productName,logoDataUrl:t.logoDataUrl},children:w.jsx(Uk,{})})}))})();