@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,216 @@
1
+ var qy=Object.defineProperty;var Wy=(t,r,i)=>r in t?qy(t,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[r]=i;var ma=(t,r,i)=>Wy(t,typeof r!="symbol"?r+"":r,i);(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const u of document.querySelectorAll('link[rel="modulepreload"]'))a(u);new MutationObserver(u=>{for(const f of u)if(f.type==="childList")for(const d of f.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&a(d)}).observe(document,{childList:!0,subtree:!0});function i(u){const f={};return u.integrity&&(f.integrity=u.integrity),u.referrerPolicy&&(f.referrerPolicy=u.referrerPolicy),u.crossOrigin==="use-credentials"?f.credentials="include":u.crossOrigin==="anonymous"?f.credentials="omit":f.credentials="same-origin",f}function a(u){if(u.ep)return;u.ep=!0;const f=i(u);fetch(u.href,f)}})();var Yy=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function yu(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Yc={exports:{}},ga={},Xc={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 Fp;function Xy(){if(Fp)return dt;Fp=1;var t=Symbol.for("react.element"),r=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),u=Symbol.for("react.profiler"),f=Symbol.for("react.provider"),d=Symbol.for("react.context"),g=Symbol.for("react.forward_ref"),v=Symbol.for("react.suspense"),w=Symbol.for("react.memo"),S=Symbol.for("react.lazy"),x=Symbol.iterator;function b(O){return O===null||typeof O!="object"?null:(O=x&&O[x]||O["@@iterator"],typeof O=="function"?O:null)}var N={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,A={};function T(O,B,be){this.props=O,this.context=B,this.refs=A,this.updater=be||N}T.prototype.isReactComponent={},T.prototype.setState=function(O,B){if(typeof O!="object"&&typeof O!="function"&&O!=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,O,B,"setState")},T.prototype.forceUpdate=function(O){this.updater.enqueueForceUpdate(this,O,"forceUpdate")};function $(){}$.prototype=T.prototype;function H(O,B,be){this.props=O,this.context=B,this.refs=A,this.updater=be||N}var M=H.prototype=new $;M.constructor=H,C(M,T.prototype),M.isPureReactComponent=!0;var R=Array.isArray,Y=Object.prototype.hasOwnProperty,V={current:null},U={key:!0,ref:!0,__self:!0,__source:!0};function le(O,B,be){var _e,$e={},Ie=null,Re=null;if(B!=null)for(_e in B.ref!==void 0&&(Re=B.ref),B.key!==void 0&&(Ie=""+B.key),B)Y.call(B,_e)&&!U.hasOwnProperty(_e)&&($e[_e]=B[_e]);var we=arguments.length-2;if(we===1)$e.children=be;else if(1<we){for(var De=Array(we),ke=0;ke<we;ke++)De[ke]=arguments[ke+2];$e.children=De}if(O&&O.defaultProps)for(_e in we=O.defaultProps,we)$e[_e]===void 0&&($e[_e]=we[_e]);return{$$typeof:t,type:O,key:Ie,ref:Re,props:$e,_owner:V.current}}function he(O,B){return{$$typeof:t,type:O.type,key:B,ref:O.ref,props:O.props,_owner:O._owner}}function Se(O){return typeof O=="object"&&O!==null&&O.$$typeof===t}function q(O){var B={"=":"=0",":":"=2"};return"$"+O.replace(/[=:]/g,function(be){return B[be]})}var ue=/\/+/g;function xe(O,B){return typeof O=="object"&&O!==null&&O.key!=null?q(""+O.key):B.toString(36)}function D(O,B,be,_e,$e){var Ie=typeof O;(Ie==="undefined"||Ie==="boolean")&&(O=null);var Re=!1;if(O===null)Re=!0;else switch(Ie){case"string":case"number":Re=!0;break;case"object":switch(O.$$typeof){case t:case r:Re=!0}}if(Re)return Re=O,$e=$e(Re),O=_e===""?"."+xe(Re,0):_e,R($e)?(be="",O!=null&&(be=O.replace(ue,"$&/")+"/"),D($e,B,be,"",function(ke){return ke})):$e!=null&&(Se($e)&&($e=he($e,be+(!$e.key||Re&&Re.key===$e.key?"":(""+$e.key).replace(ue,"$&/")+"/")+O)),B.push($e)),1;if(Re=0,_e=_e===""?".":_e+":",R(O))for(var we=0;we<O.length;we++){Ie=O[we];var De=_e+xe(Ie,we);Re+=D(Ie,B,be,De,$e)}else if(De=b(O),typeof De=="function")for(O=De.call(O),we=0;!(Ie=O.next()).done;)Ie=Ie.value,De=_e+xe(Ie,we++),Re+=D(Ie,B,be,De,$e);else if(Ie==="object")throw B=String(O),Error("Objects are not valid as a React child (found: "+(B==="[object Object]"?"object with keys {"+Object.keys(O).join(", ")+"}":B)+"). If you meant to render a collection of children, use an array instead.");return Re}function ce(O,B,be){if(O==null)return O;var _e=[],$e=0;return D(O,_e,"","",function(Ie){return B.call(be,Ie,$e++)}),_e}function te(O){if(O._status===-1){var B=O._result;B=B(),B.then(function(be){(O._status===0||O._status===-1)&&(O._status=1,O._result=be)},function(be){(O._status===0||O._status===-1)&&(O._status=2,O._result=be)}),O._status===-1&&(O._status=0,O._result=B)}if(O._status===1)return O._result.default;throw O._result}var ae={current:null},L={transition:null},F={ReactCurrentDispatcher:ae,ReactCurrentBatchConfig:L,ReactCurrentOwner:V};function Q(){throw Error("act(...) is not supported in production builds of React.")}return dt.Children={map:ce,forEach:function(O,B,be){ce(O,function(){B.apply(this,arguments)},be)},count:function(O){var B=0;return ce(O,function(){B++}),B},toArray:function(O){return ce(O,function(B){return B})||[]},only:function(O){if(!Se(O))throw Error("React.Children.only expected to receive a single React element child.");return O}},dt.Component=T,dt.Fragment=i,dt.Profiler=u,dt.PureComponent=H,dt.StrictMode=a,dt.Suspense=v,dt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=F,dt.act=Q,dt.cloneElement=function(O,B,be){if(O==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+O+".");var _e=C({},O.props),$e=O.key,Ie=O.ref,Re=O._owner;if(B!=null){if(B.ref!==void 0&&(Ie=B.ref,Re=V.current),B.key!==void 0&&($e=""+B.key),O.type&&O.type.defaultProps)var we=O.type.defaultProps;for(De in B)Y.call(B,De)&&!U.hasOwnProperty(De)&&(_e[De]=B[De]===void 0&&we!==void 0?we[De]:B[De])}var De=arguments.length-2;if(De===1)_e.children=be;else if(1<De){we=Array(De);for(var ke=0;ke<De;ke++)we[ke]=arguments[ke+2];_e.children=we}return{$$typeof:t,type:O.type,key:$e,ref:Ie,props:_e,_owner:Re}},dt.createContext=function(O){return O={$$typeof:d,_currentValue:O,_currentValue2:O,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},O.Provider={$$typeof:f,_context:O},O.Consumer=O},dt.createElement=le,dt.createFactory=function(O){var B=le.bind(null,O);return B.type=O,B},dt.createRef=function(){return{current:null}},dt.forwardRef=function(O){return{$$typeof:g,render:O}},dt.isValidElement=Se,dt.lazy=function(O){return{$$typeof:S,_payload:{_status:-1,_result:O},_init:te}},dt.memo=function(O,B){return{$$typeof:w,type:O,compare:B===void 0?null:B}},dt.startTransition=function(O){var B=L.transition;L.transition={};try{O()}finally{L.transition=B}},dt.unstable_act=Q,dt.useCallback=function(O,B){return ae.current.useCallback(O,B)},dt.useContext=function(O){return ae.current.useContext(O)},dt.useDebugValue=function(){},dt.useDeferredValue=function(O){return ae.current.useDeferredValue(O)},dt.useEffect=function(O,B){return ae.current.useEffect(O,B)},dt.useId=function(){return ae.current.useId()},dt.useImperativeHandle=function(O,B,be){return ae.current.useImperativeHandle(O,B,be)},dt.useInsertionEffect=function(O,B){return ae.current.useInsertionEffect(O,B)},dt.useLayoutEffect=function(O,B){return ae.current.useLayoutEffect(O,B)},dt.useMemo=function(O,B){return ae.current.useMemo(O,B)},dt.useReducer=function(O,B,be){return ae.current.useReducer(O,B,be)},dt.useRef=function(O){return ae.current.useRef(O)},dt.useState=function(O){return ae.current.useState(O)},dt.useSyncExternalStore=function(O,B,be){return ae.current.useSyncExternalStore(O,B,be)},dt.useTransition=function(){return ae.current.useTransition()},dt.version="18.3.1",dt}var Bp;function Ia(){return Bp||(Bp=1,Xc.exports=Xy()),Xc.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 Hp;function Qy(){if(Hp)return ga;Hp=1;var t=Ia(),r=Symbol.for("react.element"),i=Symbol.for("react.fragment"),a=Object.prototype.hasOwnProperty,u=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,f={key:!0,ref:!0,__self:!0,__source:!0};function d(g,v,w){var S,x={},b=null,N=null;w!==void 0&&(b=""+w),v.key!==void 0&&(b=""+v.key),v.ref!==void 0&&(N=v.ref);for(S in v)a.call(v,S)&&!f.hasOwnProperty(S)&&(x[S]=v[S]);if(g&&g.defaultProps)for(S in v=g.defaultProps,v)x[S]===void 0&&(x[S]=v[S]);return{$$typeof:r,type:g,key:b,ref:N,props:x,_owner:u.current}}return ga.Fragment=i,ga.jsx=d,ga.jsxs=d,ga}var Vp;function Gy(){return Vp||(Vp=1,Yc.exports=Qy()),Yc.exports}var P=Gy(),de=Ia();const am=yu(de);var Hl={},Qc={exports:{}},Hn={},Gc={exports:{}},Zc={};/**
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 Kp;function Zy(){return Kp||(Kp=1,(function(t){function r(L,F){var Q=L.length;L.push(F);e:for(;0<Q;){var O=Q-1>>>1,B=L[O];if(0<u(B,F))L[O]=F,L[Q]=B,Q=O;else break e}}function i(L){return L.length===0?null:L[0]}function a(L){if(L.length===0)return null;var F=L[0],Q=L.pop();if(Q!==F){L[0]=Q;e:for(var O=0,B=L.length,be=B>>>1;O<be;){var _e=2*(O+1)-1,$e=L[_e],Ie=_e+1,Re=L[Ie];if(0>u($e,Q))Ie<B&&0>u(Re,$e)?(L[O]=Re,L[Ie]=Q,O=Ie):(L[O]=$e,L[_e]=Q,O=_e);else if(Ie<B&&0>u(Re,Q))L[O]=Re,L[Ie]=Q,O=Ie;else break e}}return F}function u(L,F){var Q=L.sortIndex-F.sortIndex;return Q!==0?Q:L.id-F.id}if(typeof performance=="object"&&typeof performance.now=="function"){var f=performance;t.unstable_now=function(){return f.now()}}else{var d=Date,g=d.now();t.unstable_now=function(){return d.now()-g}}var v=[],w=[],S=1,x=null,b=3,N=!1,C=!1,A=!1,T=typeof setTimeout=="function"?setTimeout:null,$=typeof clearTimeout=="function"?clearTimeout:null,H=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function M(L){for(var F=i(w);F!==null;){if(F.callback===null)a(w);else if(F.startTime<=L)a(w),F.sortIndex=F.expirationTime,r(v,F);else break;F=i(w)}}function R(L){if(A=!1,M(L),!C)if(i(v)!==null)C=!0,te(Y);else{var F=i(w);F!==null&&ae(R,F.startTime-L)}}function Y(L,F){C=!1,A&&(A=!1,$(le),le=-1),N=!0;var Q=b;try{for(M(F),x=i(v);x!==null&&(!(x.expirationTime>F)||L&&!q());){var O=x.callback;if(typeof O=="function"){x.callback=null,b=x.priorityLevel;var B=O(x.expirationTime<=F);F=t.unstable_now(),typeof B=="function"?x.callback=B:x===i(v)&&a(v),M(F)}else a(v);x=i(v)}if(x!==null)var be=!0;else{var _e=i(w);_e!==null&&ae(R,_e.startTime-F),be=!1}return be}finally{x=null,b=Q,N=!1}}var V=!1,U=null,le=-1,he=5,Se=-1;function q(){return!(t.unstable_now()-Se<he)}function ue(){if(U!==null){var L=t.unstable_now();Se=L;var F=!0;try{F=U(!0,L)}finally{F?xe():(V=!1,U=null)}}else V=!1}var xe;if(typeof H=="function")xe=function(){H(ue)};else if(typeof MessageChannel<"u"){var D=new MessageChannel,ce=D.port2;D.port1.onmessage=ue,xe=function(){ce.postMessage(null)}}else xe=function(){T(ue,0)};function te(L){U=L,V||(V=!0,xe())}function ae(L,F){le=T(function(){L(t.unstable_now())},F)}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(L){L.callback=null},t.unstable_continueExecution=function(){C||N||(C=!0,te(Y))},t.unstable_forceFrameRate=function(L){0>L||125<L?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):he=0<L?Math.floor(1e3/L):5},t.unstable_getCurrentPriorityLevel=function(){return b},t.unstable_getFirstCallbackNode=function(){return i(v)},t.unstable_next=function(L){switch(b){case 1:case 2:case 3:var F=3;break;default:F=b}var Q=b;b=F;try{return L()}finally{b=Q}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(L,F){switch(L){case 1:case 2:case 3:case 4:case 5:break;default:L=3}var Q=b;b=L;try{return F()}finally{b=Q}},t.unstable_scheduleCallback=function(L,F,Q){var O=t.unstable_now();switch(typeof Q=="object"&&Q!==null?(Q=Q.delay,Q=typeof Q=="number"&&0<Q?O+Q:O):Q=O,L){case 1:var B=-1;break;case 2:B=250;break;case 5:B=1073741823;break;case 4:B=1e4;break;default:B=5e3}return B=Q+B,L={id:S++,callback:F,priorityLevel:L,startTime:Q,expirationTime:B,sortIndex:-1},Q>O?(L.sortIndex=Q,r(w,L),i(v)===null&&L===i(w)&&(A?($(le),le=-1):A=!0,ae(R,Q-O))):(L.sortIndex=B,r(v,L),C||N||(C=!0,te(Y))),L},t.unstable_shouldYield=q,t.unstable_wrapCallback=function(L){var F=b;return function(){var Q=b;b=F;try{return L.apply(this,arguments)}finally{b=Q}}}})(Zc)),Zc}var Up;function Jy(){return Up||(Up=1,Gc.exports=Zy()),Gc.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 qp;function e0(){if(qp)return Hn;qp=1;var t=Ia(),r=Jy();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 a=new Set,u={};function f(e,n){d(e,n),d(e+"Capture",n)}function d(e,n){for(u[e]=n,e=0;e<n.length;e++)a.add(n[e])}var g=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),v=Object.prototype.hasOwnProperty,w=/^[: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]*$/,S={},x={};function b(e){return v.call(x,e)?!0:v.call(S,e)?!1:w.test(e)?x[e]=!0:(S[e]=!0,!1)}function N(e,n,o,l){if(o!==null&&o.type===0)return!1;switch(typeof n){case"function":case"symbol":return!0;case"boolean":return l?!1:o!==null?!o.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function C(e,n,o,l){if(n===null||typeof n>"u"||N(e,n,o,l))return!0;if(l)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 A(e,n,o,l,p,m,E){this.acceptsBooleans=n===2||n===3||n===4,this.attributeName=l,this.attributeNamespace=p,this.mustUseProperty=o,this.propertyName=e,this.type=n,this.sanitizeURL=m,this.removeEmptyString=E}var T={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){T[e]=new A(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 A(n,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){T[e]=new A(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){T[e]=new A(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 A(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){T[e]=new A(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){T[e]=new A(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){T[e]=new A(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){T[e]=new A(e,5,!1,e.toLowerCase(),null,!1,!1)});var $=/[\-:]([a-z])/g;function H(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($,H);T[n]=new A(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($,H);T[n]=new A(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($,H);T[n]=new A(n,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){T[e]=new A(e,1,!1,e.toLowerCase(),null,!1,!1)}),T.xlinkHref=new A("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){T[e]=new A(e,1,!1,e.toLowerCase(),null,!0,!0)});function M(e,n,o,l){var p=T.hasOwnProperty(n)?T[n]:null;(p!==null?p.type!==0:l||!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(C(n,o,p,l)&&(o=null),l||p===null?b(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,l=p.attributeNamespace,o===null?e.removeAttribute(n):(p=p.type,o=p===3||p===4&&o===!0?"":""+o,l?e.setAttributeNS(l,n,o):e.setAttribute(n,o))))}var R=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Y=Symbol.for("react.element"),V=Symbol.for("react.portal"),U=Symbol.for("react.fragment"),le=Symbol.for("react.strict_mode"),he=Symbol.for("react.profiler"),Se=Symbol.for("react.provider"),q=Symbol.for("react.context"),ue=Symbol.for("react.forward_ref"),xe=Symbol.for("react.suspense"),D=Symbol.for("react.suspense_list"),ce=Symbol.for("react.memo"),te=Symbol.for("react.lazy"),ae=Symbol.for("react.offscreen"),L=Symbol.iterator;function F(e){return e===null||typeof e!="object"?null:(e=L&&e[L]||e["@@iterator"],typeof e=="function"?e:null)}var Q=Object.assign,O;function B(e){if(O===void 0)try{throw Error()}catch(o){var n=o.stack.trim().match(/\n( *(at )?)/);O=n&&n[1]||""}return`
34
+ `+O+e}var be=!1;function _e(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 l=ye}Reflect.construct(e,[],n)}else{try{n.call()}catch(ye){l=ye}e.call(n.prototype)}else{try{throw Error()}catch(ye){l=ye}e()}}catch(ye){if(ye&&l&&typeof ye.stack=="string"){for(var p=ye.stack.split(`
35
+ `),m=l.stack.split(`
36
+ `),E=p.length-1,z=m.length-1;1<=E&&0<=z&&p[E]!==m[z];)z--;for(;1<=E&&0<=z;E--,z--)if(p[E]!==m[z]){if(E!==1||z!==1)do if(E--,z--,0>z||p[E]!==m[z]){var K=`
37
+ `+p[E].replace(" at new "," at ");return e.displayName&&K.includes("<anonymous>")&&(K=K.replace("<anonymous>",e.displayName)),K}while(1<=E&&0<=z);break}}}finally{be=!1,Error.prepareStackTrace=o}return(e=e?e.displayName||e.name:"")?B(e):""}function $e(e){switch(e.tag){case 5:return B(e.type);case 16:return B("Lazy");case 13:return B("Suspense");case 19:return B("SuspenseList");case 0:case 2:case 15:return e=_e(e.type,!1),e;case 11:return e=_e(e.type.render,!1),e;case 1:return e=_e(e.type,!0),e;default:return""}}function Ie(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case U:return"Fragment";case V:return"Portal";case he:return"Profiler";case le:return"StrictMode";case xe:return"Suspense";case D:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case q:return(e.displayName||"Context")+".Consumer";case Se:return(e._context.displayName||"Context")+".Provider";case ue: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:Ie(e.type)||"Memo";case te:n=e._payload,e=e._init;try{return Ie(e(n))}catch{}}return null}function Re(e){var n=e.type;switch(e.tag){case 24:return"Cache";case 9:return(n.displayName||"Context")+".Consumer";case 10:return(n._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=n.render,e=e.displayName||e.name||"",n.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return n;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Ie(n);case 8:return n===le?"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 we(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function De(e){var n=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function ke(e){var n=De(e)?"checked":"value",o=Object.getOwnPropertyDescriptor(e.constructor.prototype,n),l=""+e[n];if(!e.hasOwnProperty(n)&&typeof o<"u"&&typeof o.get=="function"&&typeof o.set=="function"){var p=o.get,m=o.set;return Object.defineProperty(e,n,{configurable:!0,get:function(){return p.call(this)},set:function(E){l=""+E,m.call(this,E)}}),Object.defineProperty(e,n,{enumerable:o.enumerable}),{getValue:function(){return l},setValue:function(E){l=""+E},stopTracking:function(){e._valueTracker=null,delete e[n]}}}}function Ge(e){e._valueTracker||(e._valueTracker=ke(e))}function Le(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var o=n.getValue(),l="";return e&&(l=De(e)?e.checked?"true":"false":e.value),e=l,e!==o?(n.setValue(e),!0):!1}function Be(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function ut(e,n){var o=n.checked;return Q({},n,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:o??e._wrapperState.initialChecked})}function at(e,n){var o=n.defaultValue==null?"":n.defaultValue,l=n.checked!=null?n.checked:n.defaultChecked;o=we(n.value!=null?n.value:o),e._wrapperState={initialChecked:l,initialValue:o,controlled:n.type==="checkbox"||n.type==="radio"?n.checked!=null:n.value!=null}}function lt(e,n){n=n.checked,n!=null&&M(e,"checked",n,!1)}function kt(e,n){lt(e,n);var o=we(n.value),l=n.type;if(o!=null)l==="number"?(o===0&&e.value===""||e.value!=o)&&(e.value=""+o):e.value!==""+o&&(e.value=""+o);else if(l==="submit"||l==="reset"){e.removeAttribute("value");return}n.hasOwnProperty("value")?rn(e,n.type,o):n.hasOwnProperty("defaultValue")&&rn(e,n.type,we(n.defaultValue)),n.checked==null&&n.defaultChecked!=null&&(e.defaultChecked=!!n.defaultChecked)}function Sn(e,n,o){if(n.hasOwnProperty("value")||n.hasOwnProperty("defaultValue")){var l=n.type;if(!(l!=="submit"&&l!=="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 rn(e,n,o){(n!=="number"||Be(e.ownerDocument)!==e)&&(o==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+o&&(e.defaultValue=""+o))}var qt=Array.isArray;function Et(e,n,o,l){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&&l&&(e[o].defaultSelected=!0)}else{for(o=""+we(o),n=null,p=0;p<e.length;p++){if(e[p].value===o){e[p].selected=!0,l&&(e[p].defaultSelected=!0);return}n!==null||e[p].disabled||(n=e[p])}n!==null&&(n.selected=!0)}}function jn(e,n){if(n.dangerouslySetInnerHTML!=null)throw Error(i(91));return Q({},n,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function on(e,n){var o=n.value;if(o==null){if(o=n.children,n=n.defaultValue,o!=null){if(n!=null)throw Error(i(92));if(qt(o)){if(1<o.length)throw Error(i(93));o=o[0]}n=o}n==null&&(n=""),o=n}e._wrapperState={initialValue:we(o)}}function gr(e,n){var o=we(n.value),l=we(n.defaultValue);o!=null&&(o=""+o,o!==e.value&&(e.value=o),n.defaultValue==null&&e.defaultValue!==o&&(e.defaultValue=o)),l!=null&&(e.defaultValue=""+l)}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 Wt(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 Kn,sn=(function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(n,o,l,p){MSApp.execUnsafeLocalFunction(function(){return e(n,o,l,p)})}:e})(function(e,n){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=n;else{for(Kn=Kn||document.createElement("div"),Kn.innerHTML="<svg>"+n.valueOf().toString()+"</svg>",n=Kn.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;n.firstChild;)e.appendChild(n.firstChild)}});function an(e,n){if(n){var o=e.firstChild;if(o&&o===e.lastChild&&o.nodeType===3){o.nodeValue=n;return}}e.textContent=n}var Mn={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(Mn).forEach(function(e){Un.forEach(function(n){n=n+e.charAt(0).toUpperCase()+e.substring(1),Mn[n]=Mn[e]})});function yr(e,n,o){return n==null||typeof n=="boolean"||n===""?"":o||typeof n!="number"||n===0||Mn.hasOwnProperty(e)&&Mn[e]?(""+n).trim():n+"px"}function Rr(e,n){e=e.style;for(var o in n)if(n.hasOwnProperty(o)){var l=o.indexOf("--")===0,p=yr(o,n[o],l);o==="float"&&(o="cssFloat"),l?e.setProperty(o,p):e[o]=p}}var kn=Q({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function qe(e,n){if(n){if(kn[e]&&(n.children!=null||n.dangerouslySetInnerHTML!=null))throw Error(i(137,e));if(n.dangerouslySetInnerHTML!=null){if(n.children!=null)throw Error(i(60));if(typeof n.dangerouslySetInnerHTML!="object"||!("__html"in n.dangerouslySetInnerHTML))throw Error(i(61))}if(n.style!=null&&typeof n.style!="object")throw Error(i(62))}}function qn(e,n){if(e.indexOf("-")===-1)return typeof n.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var En=null;function er(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Fe=null,Tn=null,In=null;function X(e){if(e=ea(e)){if(typeof Fe!="function")throw Error(i(280));var n=e.stateNode;n&&(n=rl(n),Fe(e.stateNode,e.type,n))}}function He(e){Tn?In?In.push(e):In=[e]:Tn=e}function Je(){if(Tn){var e=Tn,n=In;if(In=Tn=null,X(e),n)for(e=0;e<n.length;e++)X(n[e])}}function ht(e,n){return e(n)}function pn(){}var Bt=!1;function Ht(e,n,o){if(Bt)return e(n,o);Bt=!0;try{return ht(e,n,o)}finally{Bt=!1,(Tn!==null||In!==null)&&(pn(),Je())}}function Gt(e,n){var o=e.stateNode;if(o===null)return null;var l=rl(o);if(l===null)return null;o=l[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":(l=!l.disabled)||(e=e.type,l=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!l;break e;default:e=!1}if(e)return null;if(o&&typeof o!="function")throw Error(i(231,n,typeof o));return o}var An=!1;if(g)try{var pt={};Object.defineProperty(pt,"passive",{get:function(){An=!0}}),window.addEventListener("test",pt,pt),window.removeEventListener("test",pt,pt)}catch{An=!1}function Ct(e,n,o,l,p,m,E,z,K){var ye=Array.prototype.slice.call(arguments,3);try{n.apply(o,ye)}catch(je){this.onError(je)}}var tr=!1,$n=null,hn=!1,nr=null,Os={onError:function(e){tr=!0,$n=e}};function rr(e,n,o,l,p,m,E,z,K){tr=!1,$n=null,Ct.apply(Os,arguments)}function zr(e,n,o,l,p,m,E,z,K){if(rr.apply(this,arguments),tr){if(tr){var ye=$n;tr=!1,$n=null}else throw Error(i(198));hn||(hn=!0,nr=ye)}}function Yt(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 Dr(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 ai(e){if(Yt(e)!==e)throw Error(i(188))}function or(e){var n=e.alternate;if(!n){if(n=Yt(e),n===null)throw Error(i(188));return n!==e?null:e}for(var o=e,l=n;;){var p=o.return;if(p===null)break;var m=p.alternate;if(m===null){if(l=p.return,l!==null){o=l;continue}break}if(p.child===m.child){for(m=p.child;m;){if(m===o)return ai(p),e;if(m===l)return ai(p),n;m=m.sibling}throw Error(i(188))}if(o.return!==l.return)o=p,l=m;else{for(var E=!1,z=p.child;z;){if(z===o){E=!0,o=p,l=m;break}if(z===l){E=!0,l=p,o=m;break}z=z.sibling}if(!E){for(z=m.child;z;){if(z===o){E=!0,o=m,l=p;break}if(z===l){E=!0,l=m,o=p;break}z=z.sibling}if(!E)throw Error(i(189))}}if(o.alternate!==l)throw Error(i(190))}if(o.tag!==3)throw Error(i(188));return o.stateNode.current===o?e:n}function li(e){return e=or(e),e!==null?ir(e):null}function ir(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var n=ir(e);if(n!==null)return n;e=e.sibling}return null}var ui=r.unstable_scheduleCallback,To=r.unstable_cancelCallback,Pt=r.unstable_shouldYield,sr=r.unstable_requestPaint,yt=r.unstable_now,Fi=r.unstable_getCurrentPriorityLevel,Lr=r.unstable_ImmediatePriority,Io=r.unstable_UserBlockingPriority,Fr=r.unstable_NormalPriority,vr=r.unstable_LowPriority,ci=r.unstable_IdlePriority,ar=null,Nn=null;function ct(e){if(Nn&&typeof Nn.onCommitFiberRoot=="function")try{Nn.onCommitFiberRoot(ar,e,void 0,(e.current.flags&128)===128)}catch{}}var mn=Math.clz32?Math.clz32:to,Bi=Math.log,Ao=Math.LN2;function to(e){return e>>>=0,e===0?32:31-(Bi(e)/Ao|0)|0}var no=64,ro=4194304;function Wn(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 vt(e,n){var o=e.pendingLanes;if(o===0)return 0;var l=0,p=e.suspendedLanes,m=e.pingedLanes,E=o&268435455;if(E!==0){var z=E&~p;z!==0?l=Wn(z):(m&=E,m!==0&&(l=Wn(m)))}else E=o&~p,E!==0?l=Wn(E):m!==0&&(l=Wn(m));if(l===0)return 0;if(n!==0&&n!==l&&(n&p)===0&&(p=l&-l,m=n&-n,p>=m||p===16&&(m&4194240)!==0))return n;if((l&4)!==0&&(l|=o&16),n=e.entangledLanes,n!==0)for(e=e.entanglements,n&=l;0<n;)o=31-mn(n),p=1<<o,l|=e[o],n&=~p;return l}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 oo(e,n){for(var o=e.suspendedLanes,l=e.pingedLanes,p=e.expirationTimes,m=e.pendingLanes;0<m;){var E=31-mn(m),z=1<<E,K=p[E];K===-1?((z&o)===0||(z&l)!==0)&&(p[E]=Br(z,n)):K<=n&&(e.expiredLanes|=z),m&=~z}}function lr(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Hr(){var e=no;return no<<=1,(no&4194240)===0&&(no=64),e}function io(e){for(var n=[],o=0;31>o;o++)n.push(e);return n}function ur(e,n,o){e.pendingLanes|=n,n!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,n=31-mn(n),e[n]=o}function fi(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 l=e.eventTimes;for(e=e.expirationTimes;0<o;){var p=31-mn(o),m=1<<p;n[p]=0,l[p]=-1,e[p]=-1,o&=~m}}function $o(e,n){var o=e.entangledLanes|=n;for(e=e.entanglements;o;){var l=31-mn(o),p=1<<l;p&n|e[l]&n&&(e[l]|=n),o&=~p}}var wt=0;function Fa(e){return e&=-e,1<e?4<e?(e&268435455)!==0?16:536870912:4:1}var mt,Hi,Ba,Ha,gn,Vr=!1,so=[],ln=null,xr=null,wr=null,At=new Map,un=new Map,On=[],di="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 Vi(e,n){switch(e){case"focusin":case"focusout":ln=null;break;case"dragenter":case"dragleave":xr=null;break;case"mouseover":case"mouseout":wr=null;break;case"pointerover":case"pointerout":At.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":un.delete(n.pointerId)}}function Rn(e,n,o,l,p,m){return e===null||e.nativeEvent!==m?(e={blockedOn:n,domEventName:o,eventSystemFlags:l,nativeEvent:m,targetContainers:[p]},n!==null&&(n=ea(n),n!==null&&Hi(n)),e):(e.eventSystemFlags|=l,n=e.targetContainers,p!==null&&n.indexOf(p)===-1&&n.push(p),e)}function Iu(e,n,o,l,p){switch(n){case"focusin":return ln=Rn(ln,e,n,o,l,p),!0;case"dragenter":return xr=Rn(xr,e,n,o,l,p),!0;case"mouseover":return wr=Rn(wr,e,n,o,l,p),!0;case"pointerover":var m=p.pointerId;return At.set(m,Rn(At.get(m)||null,e,n,o,l,p)),!0;case"gotpointercapture":return m=p.pointerId,un.set(m,Rn(un.get(m)||null,e,n,o,l,p)),!0}return!1}function Yn(e){var n=wi(e.target);if(n!==null){var o=Yt(n);if(o!==null){if(n=o.tag,n===13){if(n=Dr(o),n!==null){e.blockedOn=n,gn(e.priority,function(){Ba(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 Oo(e){if(e.blockedOn!==null)return!1;for(var n=e.targetContainers;0<n.length;){var o=Ro(e.domEventName,e.eventSystemFlags,n[0],e.nativeEvent);if(o===null){o=e.nativeEvent;var l=new o.constructor(o.type,o);En=l,o.target.dispatchEvent(l),En=null}else return n=ea(o),n!==null&&Hi(n),e.blockedOn=o,!1;n.shift()}return!0}function Rs(e,n,o){Oo(e)&&o.delete(n)}function zs(){Vr=!1,ln!==null&&Oo(ln)&&(ln=null),xr!==null&&Oo(xr)&&(xr=null),wr!==null&&Oo(wr)&&(wr=null),At.forEach(Rs),un.forEach(Rs)}function _r(e,n){e.blockedOn===n&&(e.blockedOn=null,Vr||(Vr=!0,r.unstable_scheduleCallback(r.unstable_NormalPriority,zs)))}function ao(e){function n(p){return _r(p,e)}if(0<so.length){_r(so[0],e);for(var o=1;o<so.length;o++){var l=so[o];l.blockedOn===e&&(l.blockedOn=null)}}for(ln!==null&&_r(ln,e),xr!==null&&_r(xr,e),wr!==null&&_r(wr,e),At.forEach(n),un.forEach(n),o=0;o<On.length;o++)l=On[o],l.blockedOn===e&&(l.blockedOn=null);for(;0<On.length&&(o=On[0],o.blockedOn===null);)Yn(o),o.blockedOn===null&&On.shift()}var lo=R.ReactCurrentBatchConfig,Ki=!0;function pi(e,n,o,l){var p=wt,m=lo.transition;lo.transition=null;try{wt=1,Ds(e,n,o,l)}finally{wt=p,lo.transition=m}}function Au(e,n,o,l){var p=wt,m=lo.transition;lo.transition=null;try{wt=4,Ds(e,n,o,l)}finally{wt=p,lo.transition=m}}function Ds(e,n,o,l){if(Ki){var p=Ro(e,n,o,l);if(p===null)Du(e,n,l,uo,o),Vi(e,l);else if(Iu(p,e,n,o,l))l.stopPropagation();else if(Vi(e,l),n&4&&-1<di.indexOf(e)){for(;p!==null;){var m=ea(p);if(m!==null&&mt(m),m=Ro(e,n,o,l),m===null&&Du(e,n,l,uo,o),m===p)break;p=m}p!==null&&l.stopPropagation()}else Du(e,n,l,null,o)}}var uo=null;function Ro(e,n,o,l){if(uo=null,e=er(l),e=wi(e),e!==null)if(n=Yt(e),n===null)e=null;else if(o=n.tag,o===13){if(e=Dr(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 uo=e,null}function Ui(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(Fi()){case Lr:return 1;case Io:return 4;case Fr:case vr:return 16;case ci:return 536870912;default:return 16}default:return 16}}var Kr=null,Ls=null,qi=null;function Wi(){if(qi)return qi;var e,n=Ls,o=n.length,l,p="value"in Kr?Kr.value:Kr.textContent,m=p.length;for(e=0;e<o&&n[e]===p[e];e++);var E=o-e;for(l=1;l<=E&&n[o-l]===p[m-l];l++);return qi=p.slice(e,1<l?1-l:void 0)}function zo(e){var n=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&n===13&&(e=13)):e=n,e===10&&(e=13),32<=e||e===13?e:0}function hi(){return!0}function mi(){return!1}function Zt(e){function n(o,l,p,m,E){this._reactName=o,this._targetInst=p,this.type=l,this.nativeEvent=m,this.target=E,this.currentTarget=null;for(var z in e)e.hasOwnProperty(z)&&(o=e[z],this[z]=o?o(m):m[z]);return this.isDefaultPrevented=(m.defaultPrevented!=null?m.defaultPrevented:m.returnValue===!1)?hi:mi,this.isPropagationStopped=mi,this}return Q(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=hi)},stopPropagation:function(){var o=this.nativeEvent;o&&(o.stopPropagation?o.stopPropagation():typeof o.cancelBubble!="unknown"&&(o.cancelBubble=!0),this.isPropagationStopped=hi)},persist:function(){},isPersistent:hi}),n}var Sr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Yi=Zt(Sr),gi=Q({},Sr,{view:0,detail:0}),Do=Zt(gi),co,yi,fo,Lo=Q({},gi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:es,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!==fo&&(fo&&e.type==="mousemove"?(co=e.screenX-fo.screenX,yi=e.screenY-fo.screenY):yi=co=0,fo=e),co)},movementY:function(e){return"movementY"in e?e.movementY:yi}}),Xi=Zt(Lo),Jt=Q({},Lo,{dataTransfer:0}),vi=Zt(Jt),xi=Q({},gi,{relatedTarget:0}),Qi=Zt(xi),Gi=Q({},Sr,{animationName:0,elapsedTime:0,pseudoElement:0}),Va=Zt(Gi),Ka=Q({},Sr,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Zi=Zt(Ka),Fs=Q({},Sr,{data:0}),Ur=Zt(Fs),Bs={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Hs={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"},Ji={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Vs(e){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(e):(e=Ji[e])?!!n[e]:!1}function es(){return Vs}var $u=Q({},gi,{key:function(e){if(e.key){var n=Bs[e.key]||e.key;if(n!=="Unidentified")return n}return e.type==="keypress"?(e=zo(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Hs[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:es,charCode:function(e){return e.type==="keypress"?zo(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?zo(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Ks=Zt($u),ts=Q({},Lo,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Ua=Zt(ts),Us=Q({},gi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:es}),qs=Zt(Us),Ou=Q({},Sr,{propertyName:0,elapsedTime:0,pseudoElement:0}),qa=Zt(Ou),Ru=Q({},Lo,{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}),Wa=Zt(Ru),Ya=[9,13,27,32],Ws=g&&"CompositionEvent"in window,Fo=null;g&&"documentMode"in document&&(Fo=document.documentMode);var Ys=g&&"TextEvent"in window&&!Fo,Xs=g&&(!Ws||Fo&&8<Fo&&11>=Fo),Qs=" ",Xa=!1;function Qa(e,n){switch(e){case"keyup":return Ya.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ga(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var br=!1;function kr(e,n){switch(e){case"compositionend":return Ga(n);case"keypress":return n.which!==32?null:(Xa=!0,Qs);case"textInput":return e=n.data,e===Qs&&Xa?null:e;default:return null}}function Rt(e,n){if(br)return e==="compositionend"||!Ws&&Qa(e,n)?(e=Wi(),qi=Ls=Kr=null,br=!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 Xs&&n.locale!=="ko"?null:n.data;default:return null}}var ns={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function po(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n==="input"?!!ns[e.type]:n==="textarea"}function Za(e,n,o,l){He(l),n=el(n,"onChange"),0<n.length&&(o=new Yi("onChange","change",null,o,l),e.push({event:o,listeners:n}))}var ho=null,Bo=null;function mo(e){nd(e,0)}function Ho(e){var n=ss(e);if(Le(n))return e}function Vo(e,n){if(e==="change")return n}var Er=!1;if(g){var rs;if(g){var s="oninput"in document;if(!s){var c=document.createElement("div");c.setAttribute("oninput","return;"),s=typeof c.oninput=="function"}rs=s}else rs=!1;Er=rs&&(!document.documentMode||9<document.documentMode)}function h(){ho&&(ho.detachEvent("onpropertychange",y),Bo=ho=null)}function y(e){if(e.propertyName==="value"&&Ho(Bo)){var n=[];Za(n,Bo,e,er(e)),Ht(mo,n)}}function _(e,n,o){e==="focusin"?(h(),ho=n,Bo=o,ho.attachEvent("onpropertychange",y)):e==="focusout"&&h()}function k(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ho(Bo)}function j(e,n){if(e==="click")return Ho(n)}function I(e,n){if(e==="input"||e==="change")return Ho(n)}function G(e,n){return e===n&&(e!==0||1/e===1/n)||e!==e&&n!==n}var se=typeof Object.is=="function"?Object.is:G;function J(e,n){if(se(e,n))return!0;if(typeof e!="object"||e===null||typeof n!="object"||n===null)return!1;var o=Object.keys(e),l=Object.keys(n);if(o.length!==l.length)return!1;for(l=0;l<o.length;l++){var p=o[l];if(!v.call(n,p)||!se(e[p],n[p]))return!1}return!0}function W(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Z(e,n){var o=W(e);e=0;for(var l;o;){if(o.nodeType===3){if(l=e+o.textContent.length,e<=n&&l>=n)return{node:o,offset:n-e};e=l}e:{for(;o;){if(o.nextSibling){o=o.nextSibling;break e}o=o.parentNode}o=void 0}o=W(o)}}function ie(e,n){return e&&n?e===n?!0:e&&e.nodeType===3?!1:n&&n.nodeType===3?ie(e,n.parentNode):"contains"in e?e.contains(n):e.compareDocumentPosition?!!(e.compareDocumentPosition(n)&16):!1:!1}function re(){for(var e=window,n=Be();n instanceof e.HTMLIFrameElement;){try{var o=typeof n.contentWindow.location.href=="string"}catch{o=!1}if(o)e=n.contentWindow;else break;n=Be(e.document)}return n}function ne(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 oe(e){var n=re(),o=e.focusedElem,l=e.selectionRange;if(n!==o&&o&&o.ownerDocument&&ie(o.ownerDocument.documentElement,o)){if(l!==null&&ne(o)){if(n=l.start,e=l.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,m=Math.min(l.start,p);l=l.end===void 0?m:Math.min(l.end,p),!e.extend&&m>l&&(p=l,l=m,m=p),p=Z(o,m);var E=Z(o,l);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(),m>l?(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=g&&"documentMode"in document&&11>=document.documentMode,fe=null,ve=null,Ee=null,Ce=!1;function Oe(e,n,o){var l=o.window===o?o.document:o.nodeType===9?o:o.ownerDocument;Ce||fe==null||fe!==Be(l)||(l=fe,"selectionStart"in l&&ne(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),Ee&&J(Ee,l)||(Ee=l,l=el(ve,"onSelect"),0<l.length&&(n=new Yi("onSelect","select",null,n,o),e.push({event:n,listeners:l}),n.target=fe)))}function Me(e,n){var o={};return o[e.toLowerCase()]=n.toLowerCase(),o["Webkit"+e]="webkit"+n,o["Moz"+e]="moz"+n,o}var Ve={animationend:Me("Animation","AnimationEnd"),animationiteration:Me("Animation","AnimationIteration"),animationstart:Me("Animation","AnimationStart"),transitionend:Me("Transition","TransitionEnd")},Ae={},Ue={};g&&(Ue=document.createElement("div").style,"AnimationEvent"in window||(delete Ve.animationend.animation,delete Ve.animationiteration.animation,delete Ve.animationstart.animation),"TransitionEvent"in window||delete Ve.transitionend.transition);function Ne(e){if(Ae[e])return Ae[e];if(!Ve[e])return e;var n=Ve[e],o;for(o in n)if(n.hasOwnProperty(o)&&o in Ue)return Ae[e]=n[o];return e}var nt=Ne("animationend"),rt=Ne("animationiteration"),st=Ne("animationstart"),ft=Ne("transitionend"),yn=new Map,it="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function jt(e,n){yn.set(e,n),f(n,[e])}for(var Vt=0;Vt<it.length;Vt++){var Ko=it[Vt],cn=Ko.toLowerCase(),go=Ko[0].toUpperCase()+Ko.slice(1);jt(cn,"on"+go)}jt(nt,"onAnimationEnd"),jt(rt,"onAnimationIteration"),jt(st,"onAnimationStart"),jt("dblclick","onDoubleClick"),jt("focusin","onFocus"),jt("focusout","onBlur"),jt(ft,"onTransitionEnd"),d("onMouseEnter",["mouseout","mouseover"]),d("onMouseLeave",["mouseout","mouseover"]),d("onPointerEnter",["pointerout","pointerover"]),d("onPointerLeave",["pointerout","pointerover"]),f("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),f("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),f("onBeforeInput",["compositionend","keypress","textInput","paste"]),f("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),f("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),f("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var yo="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(" "),ry=new Set("cancel close invalid load scroll toggle".split(" ").concat(yo));function td(e,n,o){var l=e.type||"unknown-event";e.currentTarget=o,zr(l,n,void 0,e),e.currentTarget=null}function nd(e,n){n=(n&4)!==0;for(var o=0;o<e.length;o++){var l=e[o],p=l.event;l=l.listeners;e:{var m=void 0;if(n)for(var E=l.length-1;0<=E;E--){var z=l[E],K=z.instance,ye=z.currentTarget;if(z=z.listener,K!==m&&p.isPropagationStopped())break e;td(p,z,ye),m=K}else for(E=0;E<l.length;E++){if(z=l[E],K=z.instance,ye=z.currentTarget,z=z.listener,K!==m&&p.isPropagationStopped())break e;td(p,z,ye),m=K}}}if(hn)throw e=nr,hn=!1,nr=null,e}function Mt(e,n){var o=n[Ku];o===void 0&&(o=n[Ku]=new Set);var l=e+"__bubble";o.has(l)||(rd(n,e,2,!1),o.add(l))}function zu(e,n,o){var l=0;n&&(l|=4),rd(o,e,l,n)}var Ja="_reactListening"+Math.random().toString(36).slice(2);function Gs(e){if(!e[Ja]){e[Ja]=!0,a.forEach(function(o){o!=="selectionchange"&&(ry.has(o)||zu(o,!1,e),zu(o,!0,e))});var n=e.nodeType===9?e:e.ownerDocument;n===null||n[Ja]||(n[Ja]=!0,zu("selectionchange",!1,n))}}function rd(e,n,o,l){switch(Ui(n)){case 1:var p=pi;break;case 4:p=Au;break;default:p=Ds}o=p.bind(null,n,o,e),p=void 0,!An||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(p=!0),l?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 Du(e,n,o,l,p){var m=l;if((n&1)===0&&(n&2)===0&&l!==null)e:for(;;){if(l===null)return;var E=l.tag;if(E===3||E===4){var z=l.stateNode.containerInfo;if(z===p||z.nodeType===8&&z.parentNode===p)break;if(E===4)for(E=l.return;E!==null;){var K=E.tag;if((K===3||K===4)&&(K=E.stateNode.containerInfo,K===p||K.nodeType===8&&K.parentNode===p))return;E=E.return}for(;z!==null;){if(E=wi(z),E===null)return;if(K=E.tag,K===5||K===6){l=m=E;continue e}z=z.parentNode}}l=l.return}Ht(function(){var ye=m,je=er(o),Te=[];e:{var Pe=yn.get(e);if(Pe!==void 0){var Ke=Yi,Ye=e;switch(e){case"keypress":if(zo(o)===0)break e;case"keydown":case"keyup":Ke=Ks;break;case"focusin":Ye="focus",Ke=Qi;break;case"focusout":Ye="blur",Ke=Qi;break;case"beforeblur":case"afterblur":Ke=Qi;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=Xi;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Ke=vi;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Ke=qs;break;case nt:case rt:case st:Ke=Va;break;case ft:Ke=qa;break;case"scroll":Ke=Do;break;case"wheel":Ke=Wa;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=Ua}var Xe=(n&4)!==0,Ft=!Xe&&e==="scroll",pe=Xe?Pe!==null?Pe+"Capture":null:Pe;Xe=[];for(var ee=ye,me;ee!==null;){me=ee;var ze=me.stateNode;if(me.tag===5&&ze!==null&&(me=ze,pe!==null&&(ze=Gt(ee,pe),ze!=null&&Xe.push(Zs(ee,ze,me)))),Ft)break;ee=ee.return}0<Xe.length&&(Pe=new Ke(Pe,Ye,null,o,je),Te.push({event:Pe,listeners:Xe}))}}if((n&7)===0){e:{if(Pe=e==="mouseover"||e==="pointerover",Ke=e==="mouseout"||e==="pointerout",Pe&&o!==En&&(Ye=o.relatedTarget||o.fromElement)&&(wi(Ye)||Ye[vo]))break e;if((Ke||Pe)&&(Pe=je.window===je?je:(Pe=je.ownerDocument)?Pe.defaultView||Pe.parentWindow:window,Ke?(Ye=o.relatedTarget||o.toElement,Ke=ye,Ye=Ye?wi(Ye):null,Ye!==null&&(Ft=Yt(Ye),Ye!==Ft||Ye.tag!==5&&Ye.tag!==6)&&(Ye=null)):(Ke=null,Ye=ye),Ke!==Ye)){if(Xe=Xi,ze="onMouseLeave",pe="onMouseEnter",ee="mouse",(e==="pointerout"||e==="pointerover")&&(Xe=Ua,ze="onPointerLeave",pe="onPointerEnter",ee="pointer"),Ft=Ke==null?Pe:ss(Ke),me=Ye==null?Pe:ss(Ye),Pe=new Xe(ze,ee+"leave",Ke,o,je),Pe.target=Ft,Pe.relatedTarget=me,ze=null,wi(je)===ye&&(Xe=new Xe(pe,ee+"enter",Ye,o,je),Xe.target=me,Xe.relatedTarget=Ft,ze=Xe),Ft=ze,Ke&&Ye)t:{for(Xe=Ke,pe=Ye,ee=0,me=Xe;me;me=os(me))ee++;for(me=0,ze=pe;ze;ze=os(ze))me++;for(;0<ee-me;)Xe=os(Xe),ee--;for(;0<me-ee;)pe=os(pe),me--;for(;ee--;){if(Xe===pe||pe!==null&&Xe===pe.alternate)break t;Xe=os(Xe),pe=os(pe)}Xe=null}else Xe=null;Ke!==null&&od(Te,Pe,Ke,Xe,!1),Ye!==null&&Ft!==null&&od(Te,Ft,Ye,Xe,!0)}}e:{if(Pe=ye?ss(ye):window,Ke=Pe.nodeName&&Pe.nodeName.toLowerCase(),Ke==="select"||Ke==="input"&&Pe.type==="file")var Qe=Vo;else if(po(Pe))if(Er)Qe=I;else{Qe=k;var et=_}else(Ke=Pe.nodeName)&&Ke.toLowerCase()==="input"&&(Pe.type==="checkbox"||Pe.type==="radio")&&(Qe=j);if(Qe&&(Qe=Qe(e,ye))){Za(Te,Qe,o,je);break e}et&&et(e,Pe,ye),e==="focusout"&&(et=Pe._wrapperState)&&et.controlled&&Pe.type==="number"&&rn(Pe,"number",Pe.value)}switch(et=ye?ss(ye):window,e){case"focusin":(po(et)||et.contentEditable==="true")&&(fe=et,ve=ye,Ee=null);break;case"focusout":Ee=ve=fe=null;break;case"mousedown":Ce=!0;break;case"contextmenu":case"mouseup":case"dragend":Ce=!1,Oe(Te,o,je);break;case"selectionchange":if(ge)break;case"keydown":case"keyup":Oe(Te,o,je)}var tt;if(Ws)e:{switch(e){case"compositionstart":var ot="onCompositionStart";break e;case"compositionend":ot="onCompositionEnd";break e;case"compositionupdate":ot="onCompositionUpdate";break e}ot=void 0}else br?Qa(e,o)&&(ot="onCompositionEnd"):e==="keydown"&&o.keyCode===229&&(ot="onCompositionStart");ot&&(Xs&&o.locale!=="ko"&&(br||ot!=="onCompositionStart"?ot==="onCompositionEnd"&&br&&(tt=Wi()):(Kr=je,Ls="value"in Kr?Kr.value:Kr.textContent,br=!0)),et=el(ye,ot),0<et.length&&(ot=new Ur(ot,e,null,o,je),Te.push({event:ot,listeners:et}),tt?ot.data=tt:(tt=Ga(o),tt!==null&&(ot.data=tt)))),(tt=Ys?kr(e,o):Rt(e,o))&&(ye=el(ye,"onBeforeInput"),0<ye.length&&(je=new Ur("onBeforeInput","beforeinput",null,o,je),Te.push({event:je,listeners:ye}),je.data=tt))}nd(Te,n)})}function Zs(e,n,o){return{instance:e,listener:n,currentTarget:o}}function el(e,n){for(var o=n+"Capture",l=[];e!==null;){var p=e,m=p.stateNode;p.tag===5&&m!==null&&(p=m,m=Gt(e,o),m!=null&&l.unshift(Zs(e,m,p)),m=Gt(e,n),m!=null&&l.push(Zs(e,m,p))),e=e.return}return l}function os(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function od(e,n,o,l,p){for(var m=n._reactName,E=[];o!==null&&o!==l;){var z=o,K=z.alternate,ye=z.stateNode;if(K!==null&&K===l)break;z.tag===5&&ye!==null&&(z=ye,p?(K=Gt(o,m),K!=null&&E.unshift(Zs(o,K,z))):p||(K=Gt(o,m),K!=null&&E.push(Zs(o,K,z)))),o=o.return}E.length!==0&&e.push({event:n,listeners:E})}var oy=/\r\n?/g,iy=/\u0000|\uFFFD/g;function id(e){return(typeof e=="string"?e:""+e).replace(oy,`
38
+ `).replace(iy,"")}function tl(e,n,o){if(n=id(n),id(e)!==n&&o)throw Error(i(425))}function nl(){}var Lu=null,Fu=null;function Bu(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 Hu=typeof setTimeout=="function"?setTimeout:void 0,sy=typeof clearTimeout=="function"?clearTimeout:void 0,sd=typeof Promise=="function"?Promise:void 0,ay=typeof queueMicrotask=="function"?queueMicrotask:typeof sd<"u"?function(e){return sd.resolve(null).then(e).catch(ly)}:Hu;function ly(e){setTimeout(function(){throw e})}function Vu(e,n){var o=n,l=0;do{var p=o.nextSibling;if(e.removeChild(o),p&&p.nodeType===8)if(o=p.data,o==="/$"){if(l===0){e.removeChild(p),ao(n);return}l--}else o!=="$"&&o!=="$?"&&o!=="$!"||l++;o=p}while(o);ao(n)}function Uo(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 ad(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 is=Math.random().toString(36).slice(2),qr="__reactFiber$"+is,Js="__reactProps$"+is,vo="__reactContainer$"+is,Ku="__reactEvents$"+is,uy="__reactListeners$"+is,cy="__reactHandles$"+is;function wi(e){var n=e[qr];if(n)return n;for(var o=e.parentNode;o;){if(n=o[vo]||o[qr]){if(o=n.alternate,n.child!==null||o!==null&&o.child!==null)for(e=ad(e);e!==null;){if(o=e[qr])return o;e=ad(e)}return n}e=o,o=e.parentNode}return null}function ea(e){return e=e[qr]||e[vo],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function ss(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(i(33))}function rl(e){return e[Js]||null}var Uu=[],as=-1;function qo(e){return{current:e}}function Tt(e){0>as||(e.current=Uu[as],Uu[as]=null,as--)}function bt(e,n){as++,Uu[as]=e.current,e.current=n}var Wo={},vn=qo(Wo),zn=qo(!1),_i=Wo;function ls(e,n){var o=e.type.contextTypes;if(!o)return Wo;var l=e.stateNode;if(l&&l.__reactInternalMemoizedUnmaskedChildContext===n)return l.__reactInternalMemoizedMaskedChildContext;var p={},m;for(m in o)p[m]=n[m];return l&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=n,e.__reactInternalMemoizedMaskedChildContext=p),p}function Dn(e){return e=e.childContextTypes,e!=null}function ol(){Tt(zn),Tt(vn)}function ld(e,n,o){if(vn.current!==Wo)throw Error(i(168));bt(vn,n),bt(zn,o)}function ud(e,n,o){var l=e.stateNode;if(n=n.childContextTypes,typeof l.getChildContext!="function")return o;l=l.getChildContext();for(var p in l)if(!(p in n))throw Error(i(108,Re(e)||"Unknown",p));return Q({},o,l)}function il(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Wo,_i=vn.current,bt(vn,e),bt(zn,zn.current),!0}function cd(e,n,o){var l=e.stateNode;if(!l)throw Error(i(169));o?(e=ud(e,n,_i),l.__reactInternalMemoizedMergedChildContext=e,Tt(zn),Tt(vn),bt(vn,e)):Tt(zn),bt(zn,o)}var xo=null,sl=!1,qu=!1;function fd(e){xo===null?xo=[e]:xo.push(e)}function fy(e){sl=!0,fd(e)}function Yo(){if(!qu&&xo!==null){qu=!0;var e=0,n=wt;try{var o=xo;for(wt=1;e<o.length;e++){var l=o[e];do l=l(!0);while(l!==null)}xo=null,sl=!1}catch(p){throw xo!==null&&(xo=xo.slice(e+1)),ui(Lr,Yo),p}finally{wt=n,qu=!1}}return null}var us=[],cs=0,al=null,ll=0,cr=[],fr=0,Si=null,wo=1,_o="";function bi(e,n){us[cs++]=ll,us[cs++]=al,al=e,ll=n}function dd(e,n,o){cr[fr++]=wo,cr[fr++]=_o,cr[fr++]=Si,Si=e;var l=wo;e=_o;var p=32-mn(l)-1;l&=~(1<<p),o+=1;var m=32-mn(n)+p;if(30<m){var E=p-p%5;m=(l&(1<<E)-1).toString(32),l>>=E,p-=E,wo=1<<32-mn(n)+p|o<<p|l,_o=m+e}else wo=1<<m|o<<p|l,_o=e}function Wu(e){e.return!==null&&(bi(e,1),dd(e,1,0))}function Yu(e){for(;e===al;)al=us[--cs],us[cs]=null,ll=us[--cs],us[cs]=null;for(;e===Si;)Si=cr[--fr],cr[fr]=null,_o=cr[--fr],cr[fr]=null,wo=cr[--fr],cr[fr]=null}var Xn=null,Qn=null,$t=!1,Nr=null;function pd(e,n){var o=mr(5,null,null,0);o.elementType="DELETED",o.stateNode=n,o.return=e,n=e.deletions,n===null?(e.deletions=[o],e.flags|=16):n.push(o)}function hd(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,Xn=e,Qn=Uo(n.firstChild),!0):!1;case 6:return n=e.pendingProps===""||n.nodeType!==3?null:n,n!==null?(e.stateNode=n,Xn=e,Qn=null,!0):!1;case 13:return n=n.nodeType!==8?null:n,n!==null?(o=Si!==null?{id:wo,overflow:_o}:null,e.memoizedState={dehydrated:n,treeContext:o,retryLane:1073741824},o=mr(18,null,null,0),o.stateNode=n,o.return=e,e.child=o,Xn=e,Qn=null,!0):!1;default:return!1}}function Xu(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Qu(e){if($t){var n=Qn;if(n){var o=n;if(!hd(e,n)){if(Xu(e))throw Error(i(418));n=Uo(o.nextSibling);var l=Xn;n&&hd(e,n)?pd(l,o):(e.flags=e.flags&-4097|2,$t=!1,Xn=e)}}else{if(Xu(e))throw Error(i(418));e.flags=e.flags&-4097|2,$t=!1,Xn=e}}}function md(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Xn=e}function ul(e){if(e!==Xn)return!1;if(!$t)return md(e),$t=!0,!1;var n;if((n=e.tag!==3)&&!(n=e.tag!==5)&&(n=e.type,n=n!=="head"&&n!=="body"&&!Bu(e.type,e.memoizedProps)),n&&(n=Qn)){if(Xu(e))throw gd(),Error(i(418));for(;n;)pd(e,n),n=Uo(n.nextSibling)}if(md(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){Qn=Uo(e.nextSibling);break e}n--}else o!=="$"&&o!=="$!"&&o!=="$?"||n++}e=e.nextSibling}Qn=null}}else Qn=Xn?Uo(e.stateNode.nextSibling):null;return!0}function gd(){for(var e=Qn;e;)e=Uo(e.nextSibling)}function fs(){Qn=Xn=null,$t=!1}function Gu(e){Nr===null?Nr=[e]:Nr.push(e)}var dy=R.ReactCurrentBatchConfig;function ta(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 l=o.stateNode}if(!l)throw Error(i(147,e));var p=l,m=""+e;return n!==null&&n.ref!==null&&typeof n.ref=="function"&&n.ref._stringRef===m?n.ref:(n=function(E){var z=p.refs;E===null?delete z[m]:z[m]=E},n._stringRef=m,n)}if(typeof e!="string")throw Error(i(284));if(!o._owner)throw Error(i(290,e))}return e}function cl(e,n){throw e=Object.prototype.toString.call(n),Error(i(31,e==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":e))}function yd(e){var n=e._init;return n(e._payload)}function vd(e){function n(pe,ee){if(e){var me=pe.deletions;me===null?(pe.deletions=[ee],pe.flags|=16):me.push(ee)}}function o(pe,ee){if(!e)return null;for(;ee!==null;)n(pe,ee),ee=ee.sibling;return null}function l(pe,ee){for(pe=new Map;ee!==null;)ee.key!==null?pe.set(ee.key,ee):pe.set(ee.index,ee),ee=ee.sibling;return pe}function p(pe,ee){return pe=ni(pe,ee),pe.index=0,pe.sibling=null,pe}function m(pe,ee,me){return pe.index=me,e?(me=pe.alternate,me!==null?(me=me.index,me<ee?(pe.flags|=2,ee):me):(pe.flags|=2,ee)):(pe.flags|=1048576,ee)}function E(pe){return e&&pe.alternate===null&&(pe.flags|=2),pe}function z(pe,ee,me,ze){return ee===null||ee.tag!==6?(ee=Hc(me,pe.mode,ze),ee.return=pe,ee):(ee=p(ee,me),ee.return=pe,ee)}function K(pe,ee,me,ze){var Qe=me.type;return Qe===U?je(pe,ee,me.props.children,ze,me.key):ee!==null&&(ee.elementType===Qe||typeof Qe=="object"&&Qe!==null&&Qe.$$typeof===te&&yd(Qe)===ee.type)?(ze=p(ee,me.props),ze.ref=ta(pe,ee,me),ze.return=pe,ze):(ze=$l(me.type,me.key,me.props,null,pe.mode,ze),ze.ref=ta(pe,ee,me),ze.return=pe,ze)}function ye(pe,ee,me,ze){return ee===null||ee.tag!==4||ee.stateNode.containerInfo!==me.containerInfo||ee.stateNode.implementation!==me.implementation?(ee=Vc(me,pe.mode,ze),ee.return=pe,ee):(ee=p(ee,me.children||[]),ee.return=pe,ee)}function je(pe,ee,me,ze,Qe){return ee===null||ee.tag!==7?(ee=Ti(me,pe.mode,ze,Qe),ee.return=pe,ee):(ee=p(ee,me),ee.return=pe,ee)}function Te(pe,ee,me){if(typeof ee=="string"&&ee!==""||typeof ee=="number")return ee=Hc(""+ee,pe.mode,me),ee.return=pe,ee;if(typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case Y:return me=$l(ee.type,ee.key,ee.props,null,pe.mode,me),me.ref=ta(pe,null,ee),me.return=pe,me;case V:return ee=Vc(ee,pe.mode,me),ee.return=pe,ee;case te:var ze=ee._init;return Te(pe,ze(ee._payload),me)}if(qt(ee)||F(ee))return ee=Ti(ee,pe.mode,me,null),ee.return=pe,ee;cl(pe,ee)}return null}function Pe(pe,ee,me,ze){var Qe=ee!==null?ee.key:null;if(typeof me=="string"&&me!==""||typeof me=="number")return Qe!==null?null:z(pe,ee,""+me,ze);if(typeof me=="object"&&me!==null){switch(me.$$typeof){case Y:return me.key===Qe?K(pe,ee,me,ze):null;case V:return me.key===Qe?ye(pe,ee,me,ze):null;case te:return Qe=me._init,Pe(pe,ee,Qe(me._payload),ze)}if(qt(me)||F(me))return Qe!==null?null:je(pe,ee,me,ze,null);cl(pe,me)}return null}function Ke(pe,ee,me,ze,Qe){if(typeof ze=="string"&&ze!==""||typeof ze=="number")return pe=pe.get(me)||null,z(ee,pe,""+ze,Qe);if(typeof ze=="object"&&ze!==null){switch(ze.$$typeof){case Y:return pe=pe.get(ze.key===null?me:ze.key)||null,K(ee,pe,ze,Qe);case V:return pe=pe.get(ze.key===null?me:ze.key)||null,ye(ee,pe,ze,Qe);case te:var et=ze._init;return Ke(pe,ee,me,et(ze._payload),Qe)}if(qt(ze)||F(ze))return pe=pe.get(me)||null,je(ee,pe,ze,Qe,null);cl(ee,ze)}return null}function Ye(pe,ee,me,ze){for(var Qe=null,et=null,tt=ee,ot=ee=0,nn=null;tt!==null&&ot<me.length;ot++){tt.index>ot?(nn=tt,tt=null):nn=tt.sibling;var _t=Pe(pe,tt,me[ot],ze);if(_t===null){tt===null&&(tt=nn);break}e&&tt&&_t.alternate===null&&n(pe,tt),ee=m(_t,ee,ot),et===null?Qe=_t:et.sibling=_t,et=_t,tt=nn}if(ot===me.length)return o(pe,tt),$t&&bi(pe,ot),Qe;if(tt===null){for(;ot<me.length;ot++)tt=Te(pe,me[ot],ze),tt!==null&&(ee=m(tt,ee,ot),et===null?Qe=tt:et.sibling=tt,et=tt);return $t&&bi(pe,ot),Qe}for(tt=l(pe,tt);ot<me.length;ot++)nn=Ke(tt,pe,ot,me[ot],ze),nn!==null&&(e&&nn.alternate!==null&&tt.delete(nn.key===null?ot:nn.key),ee=m(nn,ee,ot),et===null?Qe=nn:et.sibling=nn,et=nn);return e&&tt.forEach(function(ri){return n(pe,ri)}),$t&&bi(pe,ot),Qe}function Xe(pe,ee,me,ze){var Qe=F(me);if(typeof Qe!="function")throw Error(i(150));if(me=Qe.call(me),me==null)throw Error(i(151));for(var et=Qe=null,tt=ee,ot=ee=0,nn=null,_t=me.next();tt!==null&&!_t.done;ot++,_t=me.next()){tt.index>ot?(nn=tt,tt=null):nn=tt.sibling;var ri=Pe(pe,tt,_t.value,ze);if(ri===null){tt===null&&(tt=nn);break}e&&tt&&ri.alternate===null&&n(pe,tt),ee=m(ri,ee,ot),et===null?Qe=ri:et.sibling=ri,et=ri,tt=nn}if(_t.done)return o(pe,tt),$t&&bi(pe,ot),Qe;if(tt===null){for(;!_t.done;ot++,_t=me.next())_t=Te(pe,_t.value,ze),_t!==null&&(ee=m(_t,ee,ot),et===null?Qe=_t:et.sibling=_t,et=_t);return $t&&bi(pe,ot),Qe}for(tt=l(pe,tt);!_t.done;ot++,_t=me.next())_t=Ke(tt,pe,ot,_t.value,ze),_t!==null&&(e&&_t.alternate!==null&&tt.delete(_t.key===null?ot:_t.key),ee=m(_t,ee,ot),et===null?Qe=_t:et.sibling=_t,et=_t);return e&&tt.forEach(function(Uy){return n(pe,Uy)}),$t&&bi(pe,ot),Qe}function Ft(pe,ee,me,ze){if(typeof me=="object"&&me!==null&&me.type===U&&me.key===null&&(me=me.props.children),typeof me=="object"&&me!==null){switch(me.$$typeof){case Y:e:{for(var Qe=me.key,et=ee;et!==null;){if(et.key===Qe){if(Qe=me.type,Qe===U){if(et.tag===7){o(pe,et.sibling),ee=p(et,me.props.children),ee.return=pe,pe=ee;break e}}else if(et.elementType===Qe||typeof Qe=="object"&&Qe!==null&&Qe.$$typeof===te&&yd(Qe)===et.type){o(pe,et.sibling),ee=p(et,me.props),ee.ref=ta(pe,et,me),ee.return=pe,pe=ee;break e}o(pe,et);break}else n(pe,et);et=et.sibling}me.type===U?(ee=Ti(me.props.children,pe.mode,ze,me.key),ee.return=pe,pe=ee):(ze=$l(me.type,me.key,me.props,null,pe.mode,ze),ze.ref=ta(pe,ee,me),ze.return=pe,pe=ze)}return E(pe);case V:e:{for(et=me.key;ee!==null;){if(ee.key===et)if(ee.tag===4&&ee.stateNode.containerInfo===me.containerInfo&&ee.stateNode.implementation===me.implementation){o(pe,ee.sibling),ee=p(ee,me.children||[]),ee.return=pe,pe=ee;break e}else{o(pe,ee);break}else n(pe,ee);ee=ee.sibling}ee=Vc(me,pe.mode,ze),ee.return=pe,pe=ee}return E(pe);case te:return et=me._init,Ft(pe,ee,et(me._payload),ze)}if(qt(me))return Ye(pe,ee,me,ze);if(F(me))return Xe(pe,ee,me,ze);cl(pe,me)}return typeof me=="string"&&me!==""||typeof me=="number"?(me=""+me,ee!==null&&ee.tag===6?(o(pe,ee.sibling),ee=p(ee,me),ee.return=pe,pe=ee):(o(pe,ee),ee=Hc(me,pe.mode,ze),ee.return=pe,pe=ee),E(pe)):o(pe,ee)}return Ft}var ds=vd(!0),xd=vd(!1),fl=qo(null),dl=null,ps=null,Zu=null;function Ju(){Zu=ps=dl=null}function ec(e){var n=fl.current;Tt(fl),e._currentValue=n}function tc(e,n,o){for(;e!==null;){var l=e.alternate;if((e.childLanes&n)!==n?(e.childLanes|=n,l!==null&&(l.childLanes|=n)):l!==null&&(l.childLanes&n)!==n&&(l.childLanes|=n),e===o)break;e=e.return}}function hs(e,n){dl=e,Zu=ps=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&n)!==0&&(Ln=!0),e.firstContext=null)}function dr(e){var n=e._currentValue;if(Zu!==e)if(e={context:e,memoizedValue:n,next:null},ps===null){if(dl===null)throw Error(i(308));ps=e,dl.dependencies={lanes:0,firstContext:e}}else ps=ps.next=e;return n}var ki=null;function nc(e){ki===null?ki=[e]:ki.push(e)}function wd(e,n,o,l){var p=n.interleaved;return p===null?(o.next=o,nc(n)):(o.next=p.next,p.next=o),n.interleaved=o,So(e,l)}function So(e,n){e.lanes|=n;var o=e.alternate;for(o!==null&&(o.lanes|=n),o=e,e=e.return;e!==null;)e.childLanes|=n,o=e.alternate,o!==null&&(o.childLanes|=n),o=e,e=e.return;return o.tag===3?o.stateNode:null}var Xo=!1;function rc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function _d(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 bo(e,n){return{eventTime:e,lane:n,tag:0,payload:null,callback:null,next:null}}function Qo(e,n,o){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(xt&2)!==0){var p=l.pending;return p===null?n.next=n:(n.next=p.next,p.next=n),l.pending=n,So(e,o)}return p=l.interleaved,p===null?(n.next=n,nc(l)):(n.next=p.next,p.next=n),l.interleaved=n,So(e,o)}function pl(e,n,o){if(n=n.updateQueue,n!==null&&(n=n.shared,(o&4194240)!==0)){var l=n.lanes;l&=e.pendingLanes,o|=l,n.lanes=o,$o(e,o)}}function Sd(e,n){var o=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,o===l)){var p=null,m=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};m===null?p=m=E:m=m.next=E,o=o.next}while(o!==null);m===null?p=m=n:m=m.next=n}else p=m=n;o={baseState:l.baseState,firstBaseUpdate:p,lastBaseUpdate:m,shared:l.shared,effects:l.effects},e.updateQueue=o;return}e=o.lastBaseUpdate,e===null?o.firstBaseUpdate=n:e.next=n,o.lastBaseUpdate=n}function hl(e,n,o,l){var p=e.updateQueue;Xo=!1;var m=p.firstBaseUpdate,E=p.lastBaseUpdate,z=p.shared.pending;if(z!==null){p.shared.pending=null;var K=z,ye=K.next;K.next=null,E===null?m=ye:E.next=ye,E=K;var je=e.alternate;je!==null&&(je=je.updateQueue,z=je.lastBaseUpdate,z!==E&&(z===null?je.firstBaseUpdate=ye:z.next=ye,je.lastBaseUpdate=K))}if(m!==null){var Te=p.baseState;E=0,je=ye=K=null,z=m;do{var Pe=z.lane,Ke=z.eventTime;if((l&Pe)===Pe){je!==null&&(je=je.next={eventTime:Ke,lane:0,tag:z.tag,payload:z.payload,callback:z.callback,next:null});e:{var Ye=e,Xe=z;switch(Pe=n,Ke=o,Xe.tag){case 1:if(Ye=Xe.payload,typeof Ye=="function"){Te=Ye.call(Ke,Te,Pe);break e}Te=Ye;break e;case 3:Ye.flags=Ye.flags&-65537|128;case 0:if(Ye=Xe.payload,Pe=typeof Ye=="function"?Ye.call(Ke,Te,Pe):Ye,Pe==null)break e;Te=Q({},Te,Pe);break e;case 2:Xo=!0}}z.callback!==null&&z.lane!==0&&(e.flags|=64,Pe=p.effects,Pe===null?p.effects=[z]:Pe.push(z))}else Ke={eventTime:Ke,lane:Pe,tag:z.tag,payload:z.payload,callback:z.callback,next:null},je===null?(ye=je=Ke,K=Te):je=je.next=Ke,E|=Pe;if(z=z.next,z===null){if(z=p.shared.pending,z===null)break;Pe=z,z=Pe.next,Pe.next=null,p.lastBaseUpdate=Pe,p.shared.pending=null}}while(!0);if(je===null&&(K=Te),p.baseState=K,p.firstBaseUpdate=ye,p.lastBaseUpdate=je,n=p.shared.interleaved,n!==null){p=n;do E|=p.lane,p=p.next;while(p!==n)}else m===null&&(p.shared.lanes=0);Ci|=E,e.lanes=E,e.memoizedState=Te}}function bd(e,n,o){if(e=n.effects,n.effects=null,e!==null)for(n=0;n<e.length;n++){var l=e[n],p=l.callback;if(p!==null){if(l.callback=null,l=o,typeof p!="function")throw Error(i(191,p));p.call(l)}}}var na={},Wr=qo(na),ra=qo(na),oa=qo(na);function Ei(e){if(e===na)throw Error(i(174));return e}function oc(e,n){switch(bt(oa,n),bt(ra,e),bt(Wr,na),e=n.nodeType,e){case 9:case 11:n=(n=n.documentElement)?n.namespaceURI:Wt(null,"");break;default:e=e===8?n.parentNode:n,n=e.namespaceURI||null,e=e.tagName,n=Wt(n,e)}Tt(Wr),bt(Wr,n)}function ms(){Tt(Wr),Tt(ra),Tt(oa)}function kd(e){Ei(oa.current);var n=Ei(Wr.current),o=Wt(n,e.type);n!==o&&(bt(ra,e),bt(Wr,o))}function ic(e){ra.current===e&&(Tt(Wr),Tt(ra))}var zt=qo(0);function ml(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 sc=[];function ac(){for(var e=0;e<sc.length;e++)sc[e]._workInProgressVersionPrimary=null;sc.length=0}var gl=R.ReactCurrentDispatcher,lc=R.ReactCurrentBatchConfig,Ni=0,Dt=null,Xt=null,en=null,yl=!1,ia=!1,sa=0,py=0;function xn(){throw Error(i(321))}function uc(e,n){if(n===null)return!1;for(var o=0;o<n.length&&o<e.length;o++)if(!se(e[o],n[o]))return!1;return!0}function cc(e,n,o,l,p,m){if(Ni=m,Dt=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,gl.current=e===null||e.memoizedState===null?yy:vy,e=o(l,p),ia){m=0;do{if(ia=!1,sa=0,25<=m)throw Error(i(301));m+=1,en=Xt=null,n.updateQueue=null,gl.current=xy,e=o(l,p)}while(ia)}if(gl.current=wl,n=Xt!==null&&Xt.next!==null,Ni=0,en=Xt=Dt=null,yl=!1,n)throw Error(i(300));return e}function fc(){var e=sa!==0;return sa=0,e}function Yr(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return en===null?Dt.memoizedState=en=e:en=en.next=e,en}function pr(){if(Xt===null){var e=Dt.alternate;e=e!==null?e.memoizedState:null}else e=Xt.next;var n=en===null?Dt.memoizedState:en.next;if(n!==null)en=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},en===null?Dt.memoizedState=en=e:en=en.next=e}return en}function aa(e,n){return typeof n=="function"?n(e):n}function dc(e){var n=pr(),o=n.queue;if(o===null)throw Error(i(311));o.lastRenderedReducer=e;var l=Xt,p=l.baseQueue,m=o.pending;if(m!==null){if(p!==null){var E=p.next;p.next=m.next,m.next=E}l.baseQueue=p=m,o.pending=null}if(p!==null){m=p.next,l=l.baseState;var z=E=null,K=null,ye=m;do{var je=ye.lane;if((Ni&je)===je)K!==null&&(K=K.next={lane:0,action:ye.action,hasEagerState:ye.hasEagerState,eagerState:ye.eagerState,next:null}),l=ye.hasEagerState?ye.eagerState:e(l,ye.action);else{var Te={lane:je,action:ye.action,hasEagerState:ye.hasEagerState,eagerState:ye.eagerState,next:null};K===null?(z=K=Te,E=l):K=K.next=Te,Dt.lanes|=je,Ci|=je}ye=ye.next}while(ye!==null&&ye!==m);K===null?E=l:K.next=z,se(l,n.memoizedState)||(Ln=!0),n.memoizedState=l,n.baseState=E,n.baseQueue=K,o.lastRenderedState=l}if(e=o.interleaved,e!==null){p=e;do m=p.lane,Dt.lanes|=m,Ci|=m,p=p.next;while(p!==e)}else p===null&&(o.lanes=0);return[n.memoizedState,o.dispatch]}function pc(e){var n=pr(),o=n.queue;if(o===null)throw Error(i(311));o.lastRenderedReducer=e;var l=o.dispatch,p=o.pending,m=n.memoizedState;if(p!==null){o.pending=null;var E=p=p.next;do m=e(m,E.action),E=E.next;while(E!==p);se(m,n.memoizedState)||(Ln=!0),n.memoizedState=m,n.baseQueue===null&&(n.baseState=m),o.lastRenderedState=m}return[m,l]}function Ed(){}function Nd(e,n){var o=Dt,l=pr(),p=n(),m=!se(l.memoizedState,p);if(m&&(l.memoizedState=p,Ln=!0),l=l.queue,hc(jd.bind(null,o,l,e),[e]),l.getSnapshot!==n||m||en!==null&&en.memoizedState.tag&1){if(o.flags|=2048,la(9,Pd.bind(null,o,l,p,n),void 0,null),tn===null)throw Error(i(349));(Ni&30)!==0||Cd(o,n,p)}return p}function Cd(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 Pd(e,n,o,l){n.value=o,n.getSnapshot=l,Md(n)&&Td(e)}function jd(e,n,o){return o(function(){Md(n)&&Td(e)})}function Md(e){var n=e.getSnapshot;e=e.value;try{var o=n();return!se(e,o)}catch{return!0}}function Td(e){var n=So(e,1);n!==null&&Mr(n,e,1,-1)}function Id(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:aa,lastRenderedState:e},n.queue=e,e=e.dispatch=gy.bind(null,Dt,e),[n.memoizedState,e]}function la(e,n,o,l){return e={tag:e,create:n,destroy:o,deps:l,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:(l=o.next,o.next=e,e.next=l,n.lastEffect=e)),e}function Ad(){return pr().memoizedState}function vl(e,n,o,l){var p=Yr();Dt.flags|=e,p.memoizedState=la(1|n,o,void 0,l===void 0?null:l)}function xl(e,n,o,l){var p=pr();l=l===void 0?null:l;var m=void 0;if(Xt!==null){var E=Xt.memoizedState;if(m=E.destroy,l!==null&&uc(l,E.deps)){p.memoizedState=la(n,o,m,l);return}}Dt.flags|=e,p.memoizedState=la(1|n,o,m,l)}function $d(e,n){return vl(8390656,8,e,n)}function hc(e,n){return xl(2048,8,e,n)}function Od(e,n){return xl(4,2,e,n)}function Rd(e,n){return xl(4,4,e,n)}function zd(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 Dd(e,n,o){return o=o!=null?o.concat([e]):null,xl(4,4,zd.bind(null,n,e),o)}function mc(){}function Ld(e,n){var o=pr();n=n===void 0?null:n;var l=o.memoizedState;return l!==null&&n!==null&&uc(n,l[1])?l[0]:(o.memoizedState=[e,n],e)}function Fd(e,n){var o=pr();n=n===void 0?null:n;var l=o.memoizedState;return l!==null&&n!==null&&uc(n,l[1])?l[0]:(e=e(),o.memoizedState=[e,n],e)}function Bd(e,n,o){return(Ni&21)===0?(e.baseState&&(e.baseState=!1,Ln=!0),e.memoizedState=o):(se(o,n)||(o=Hr(),Dt.lanes|=o,Ci|=o,e.baseState=!0),n)}function hy(e,n){var o=wt;wt=o!==0&&4>o?o:4,e(!0);var l=lc.transition;lc.transition={};try{e(!1),n()}finally{wt=o,lc.transition=l}}function Hd(){return pr().memoizedState}function my(e,n,o){var l=ei(e);if(o={lane:l,action:o,hasEagerState:!1,eagerState:null,next:null},Vd(e))Kd(n,o);else if(o=wd(e,n,o,l),o!==null){var p=Pn();Mr(o,e,l,p),Ud(o,n,l)}}function gy(e,n,o){var l=ei(e),p={lane:l,action:o,hasEagerState:!1,eagerState:null,next:null};if(Vd(e))Kd(n,p);else{var m=e.alternate;if(e.lanes===0&&(m===null||m.lanes===0)&&(m=n.lastRenderedReducer,m!==null))try{var E=n.lastRenderedState,z=m(E,o);if(p.hasEagerState=!0,p.eagerState=z,se(z,E)){var K=n.interleaved;K===null?(p.next=p,nc(n)):(p.next=K.next,K.next=p),n.interleaved=p;return}}catch{}finally{}o=wd(e,n,p,l),o!==null&&(p=Pn(),Mr(o,e,l,p),Ud(o,n,l))}}function Vd(e){var n=e.alternate;return e===Dt||n!==null&&n===Dt}function Kd(e,n){ia=yl=!0;var o=e.pending;o===null?n.next=n:(n.next=o.next,o.next=n),e.pending=n}function Ud(e,n,o){if((o&4194240)!==0){var l=n.lanes;l&=e.pendingLanes,o|=l,n.lanes=o,$o(e,o)}}var wl={readContext:dr,useCallback:xn,useContext:xn,useEffect:xn,useImperativeHandle:xn,useInsertionEffect:xn,useLayoutEffect:xn,useMemo:xn,useReducer:xn,useRef:xn,useState:xn,useDebugValue:xn,useDeferredValue:xn,useTransition:xn,useMutableSource:xn,useSyncExternalStore:xn,useId:xn,unstable_isNewReconciler:!1},yy={readContext:dr,useCallback:function(e,n){return Yr().memoizedState=[e,n===void 0?null:n],e},useContext:dr,useEffect:$d,useImperativeHandle:function(e,n,o){return o=o!=null?o.concat([e]):null,vl(4194308,4,zd.bind(null,n,e),o)},useLayoutEffect:function(e,n){return vl(4194308,4,e,n)},useInsertionEffect:function(e,n){return vl(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 l=Yr();return n=o!==void 0?o(n):n,l.memoizedState=l.baseState=n,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:n},l.queue=e,e=e.dispatch=my.bind(null,Dt,e),[l.memoizedState,e]},useRef:function(e){var n=Yr();return e={current:e},n.memoizedState=e},useState:Id,useDebugValue:mc,useDeferredValue:function(e){return Yr().memoizedState=e},useTransition:function(){var e=Id(!1),n=e[0];return e=hy.bind(null,e[1]),Yr().memoizedState=e,[n,e]},useMutableSource:function(){},useSyncExternalStore:function(e,n,o){var l=Dt,p=Yr();if($t){if(o===void 0)throw Error(i(407));o=o()}else{if(o=n(),tn===null)throw Error(i(349));(Ni&30)!==0||Cd(l,n,o)}p.memoizedState=o;var m={value:o,getSnapshot:n};return p.queue=m,$d(jd.bind(null,l,m,e),[e]),l.flags|=2048,la(9,Pd.bind(null,l,m,o,n),void 0,null),o},useId:function(){var e=Yr(),n=tn.identifierPrefix;if($t){var o=_o,l=wo;o=(l&~(1<<32-mn(l)-1)).toString(32)+o,n=":"+n+"R"+o,o=sa++,0<o&&(n+="H"+o.toString(32)),n+=":"}else o=py++,n=":"+n+"r"+o.toString(32)+":";return e.memoizedState=n},unstable_isNewReconciler:!1},vy={readContext:dr,useCallback:Ld,useContext:dr,useEffect:hc,useImperativeHandle:Dd,useInsertionEffect:Od,useLayoutEffect:Rd,useMemo:Fd,useReducer:dc,useRef:Ad,useState:function(){return dc(aa)},useDebugValue:mc,useDeferredValue:function(e){var n=pr();return Bd(n,Xt.memoizedState,e)},useTransition:function(){var e=dc(aa)[0],n=pr().memoizedState;return[e,n]},useMutableSource:Ed,useSyncExternalStore:Nd,useId:Hd,unstable_isNewReconciler:!1},xy={readContext:dr,useCallback:Ld,useContext:dr,useEffect:hc,useImperativeHandle:Dd,useInsertionEffect:Od,useLayoutEffect:Rd,useMemo:Fd,useReducer:pc,useRef:Ad,useState:function(){return pc(aa)},useDebugValue:mc,useDeferredValue:function(e){var n=pr();return Xt===null?n.memoizedState=e:Bd(n,Xt.memoizedState,e)},useTransition:function(){var e=pc(aa)[0],n=pr().memoizedState;return[e,n]},useMutableSource:Ed,useSyncExternalStore:Nd,useId:Hd,unstable_isNewReconciler:!1};function Cr(e,n){if(e&&e.defaultProps){n=Q({},n),e=e.defaultProps;for(var o in e)n[o]===void 0&&(n[o]=e[o]);return n}return n}function gc(e,n,o,l){n=e.memoizedState,o=o(l,n),o=o==null?n:Q({},n,o),e.memoizedState=o,e.lanes===0&&(e.updateQueue.baseState=o)}var _l={isMounted:function(e){return(e=e._reactInternals)?Yt(e)===e:!1},enqueueSetState:function(e,n,o){e=e._reactInternals;var l=Pn(),p=ei(e),m=bo(l,p);m.payload=n,o!=null&&(m.callback=o),n=Qo(e,m,p),n!==null&&(Mr(n,e,p,l),pl(n,e,p))},enqueueReplaceState:function(e,n,o){e=e._reactInternals;var l=Pn(),p=ei(e),m=bo(l,p);m.tag=1,m.payload=n,o!=null&&(m.callback=o),n=Qo(e,m,p),n!==null&&(Mr(n,e,p,l),pl(n,e,p))},enqueueForceUpdate:function(e,n){e=e._reactInternals;var o=Pn(),l=ei(e),p=bo(o,l);p.tag=2,n!=null&&(p.callback=n),n=Qo(e,p,l),n!==null&&(Mr(n,e,l,o),pl(n,e,l))}};function qd(e,n,o,l,p,m,E){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,m,E):n.prototype&&n.prototype.isPureReactComponent?!J(o,l)||!J(p,m):!0}function Wd(e,n,o){var l=!1,p=Wo,m=n.contextType;return typeof m=="object"&&m!==null?m=dr(m):(p=Dn(n)?_i:vn.current,l=n.contextTypes,m=(l=l!=null)?ls(e,p):Wo),n=new n(o,m),e.memoizedState=n.state!==null&&n.state!==void 0?n.state:null,n.updater=_l,e.stateNode=n,n._reactInternals=e,l&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=p,e.__reactInternalMemoizedMaskedChildContext=m),n}function Yd(e,n,o,l){e=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(o,l),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(o,l),n.state!==e&&_l.enqueueReplaceState(n,n.state,null)}function yc(e,n,o,l){var p=e.stateNode;p.props=o,p.state=e.memoizedState,p.refs={},rc(e);var m=n.contextType;typeof m=="object"&&m!==null?p.context=dr(m):(m=Dn(n)?_i:vn.current,p.context=ls(e,m)),p.state=e.memoizedState,m=n.getDerivedStateFromProps,typeof m=="function"&&(gc(e,n,m,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),hl(e,o,p,l),p.state=e.memoizedState),typeof p.componentDidMount=="function"&&(e.flags|=4194308)}function gs(e,n){try{var o="",l=n;do o+=$e(l),l=l.return;while(l);var p=o}catch(m){p=`
39
+ Error generating stack: `+m.message+`
40
+ `+m.stack}return{value:e,source:n,stack:p,digest:null}}function vc(e,n,o){return{value:e,source:null,stack:o??null,digest:n??null}}function xc(e,n){try{console.error(n.value)}catch(o){setTimeout(function(){throw o})}}var wy=typeof WeakMap=="function"?WeakMap:Map;function Xd(e,n,o){o=bo(-1,o),o.tag=3,o.payload={element:null};var l=n.value;return o.callback=function(){Pl||(Pl=!0,$c=l),xc(e,n)},o}function Qd(e,n,o){o=bo(-1,o),o.tag=3;var l=e.type.getDerivedStateFromError;if(typeof l=="function"){var p=n.value;o.payload=function(){return l(p)},o.callback=function(){xc(e,n)}}var m=e.stateNode;return m!==null&&typeof m.componentDidCatch=="function"&&(o.callback=function(){xc(e,n),typeof l!="function"&&(Zo===null?Zo=new Set([this]):Zo.add(this));var E=n.stack;this.componentDidCatch(n.value,{componentStack:E!==null?E:""})}),o}function Gd(e,n,o){var l=e.pingCache;if(l===null){l=e.pingCache=new wy;var p=new Set;l.set(n,p)}else p=l.get(n),p===void 0&&(p=new Set,l.set(n,p));p.has(o)||(p.add(o),e=$y.bind(null,e,n,o),n.then(e,e))}function Zd(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 Jd(e,n,o,l,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=bo(-1,1),n.tag=2,Qo(o,n,1))),o.lanes|=1),e):(e.flags|=65536,e.lanes=p,e)}var _y=R.ReactCurrentOwner,Ln=!1;function Cn(e,n,o,l){n.child=e===null?xd(n,null,o,l):ds(n,e.child,o,l)}function ep(e,n,o,l,p){o=o.render;var m=n.ref;return hs(n,p),l=cc(e,n,o,l,m,p),o=fc(),e!==null&&!Ln?(n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~p,ko(e,n,p)):($t&&o&&Wu(n),n.flags|=1,Cn(e,n,l,p),n.child)}function tp(e,n,o,l,p){if(e===null){var m=o.type;return typeof m=="function"&&!Bc(m)&&m.defaultProps===void 0&&o.compare===null&&o.defaultProps===void 0?(n.tag=15,n.type=m,np(e,n,m,l,p)):(e=$l(o.type,null,l,n,n.mode,p),e.ref=n.ref,e.return=n,n.child=e)}if(m=e.child,(e.lanes&p)===0){var E=m.memoizedProps;if(o=o.compare,o=o!==null?o:J,o(E,l)&&e.ref===n.ref)return ko(e,n,p)}return n.flags|=1,e=ni(m,l),e.ref=n.ref,e.return=n,n.child=e}function np(e,n,o,l,p){if(e!==null){var m=e.memoizedProps;if(J(m,l)&&e.ref===n.ref)if(Ln=!1,n.pendingProps=l=m,(e.lanes&p)!==0)(e.flags&131072)!==0&&(Ln=!0);else return n.lanes=e.lanes,ko(e,n,p)}return wc(e,n,o,l,p)}function rp(e,n,o){var l=n.pendingProps,p=l.children,m=e!==null?e.memoizedState:null;if(l.mode==="hidden")if((n.mode&1)===0)n.memoizedState={baseLanes:0,cachePool:null,transitions:null},bt(vs,Gn),Gn|=o;else{if((o&1073741824)===0)return e=m!==null?m.baseLanes|o:o,n.lanes=n.childLanes=1073741824,n.memoizedState={baseLanes:e,cachePool:null,transitions:null},n.updateQueue=null,bt(vs,Gn),Gn|=e,null;n.memoizedState={baseLanes:0,cachePool:null,transitions:null},l=m!==null?m.baseLanes:o,bt(vs,Gn),Gn|=l}else m!==null?(l=m.baseLanes|o,n.memoizedState=null):l=o,bt(vs,Gn),Gn|=l;return Cn(e,n,p,o),n.child}function op(e,n){var o=n.ref;(e===null&&o!==null||e!==null&&e.ref!==o)&&(n.flags|=512,n.flags|=2097152)}function wc(e,n,o,l,p){var m=Dn(o)?_i:vn.current;return m=ls(n,m),hs(n,p),o=cc(e,n,o,l,m,p),l=fc(),e!==null&&!Ln?(n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~p,ko(e,n,p)):($t&&l&&Wu(n),n.flags|=1,Cn(e,n,o,p),n.child)}function ip(e,n,o,l,p){if(Dn(o)){var m=!0;il(n)}else m=!1;if(hs(n,p),n.stateNode===null)bl(e,n),Wd(n,o,l),yc(n,o,l,p),l=!0;else if(e===null){var E=n.stateNode,z=n.memoizedProps;E.props=z;var K=E.context,ye=o.contextType;typeof ye=="object"&&ye!==null?ye=dr(ye):(ye=Dn(o)?_i:vn.current,ye=ls(n,ye));var je=o.getDerivedStateFromProps,Te=typeof je=="function"||typeof E.getSnapshotBeforeUpdate=="function";Te||typeof E.UNSAFE_componentWillReceiveProps!="function"&&typeof E.componentWillReceiveProps!="function"||(z!==l||K!==ye)&&Yd(n,E,l,ye),Xo=!1;var Pe=n.memoizedState;E.state=Pe,hl(n,l,E,p),K=n.memoizedState,z!==l||Pe!==K||zn.current||Xo?(typeof je=="function"&&(gc(n,o,je,l),K=n.memoizedState),(z=Xo||qd(n,o,z,l,Pe,K,ye))?(Te||typeof E.UNSAFE_componentWillMount!="function"&&typeof E.componentWillMount!="function"||(typeof E.componentWillMount=="function"&&E.componentWillMount(),typeof E.UNSAFE_componentWillMount=="function"&&E.UNSAFE_componentWillMount()),typeof E.componentDidMount=="function"&&(n.flags|=4194308)):(typeof E.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=l,n.memoizedState=K),E.props=l,E.state=K,E.context=ye,l=z):(typeof E.componentDidMount=="function"&&(n.flags|=4194308),l=!1)}else{E=n.stateNode,_d(e,n),z=n.memoizedProps,ye=n.type===n.elementType?z:Cr(n.type,z),E.props=ye,Te=n.pendingProps,Pe=E.context,K=o.contextType,typeof K=="object"&&K!==null?K=dr(K):(K=Dn(o)?_i:vn.current,K=ls(n,K));var Ke=o.getDerivedStateFromProps;(je=typeof Ke=="function"||typeof E.getSnapshotBeforeUpdate=="function")||typeof E.UNSAFE_componentWillReceiveProps!="function"&&typeof E.componentWillReceiveProps!="function"||(z!==Te||Pe!==K)&&Yd(n,E,l,K),Xo=!1,Pe=n.memoizedState,E.state=Pe,hl(n,l,E,p);var Ye=n.memoizedState;z!==Te||Pe!==Ye||zn.current||Xo?(typeof Ke=="function"&&(gc(n,o,Ke,l),Ye=n.memoizedState),(ye=Xo||qd(n,o,ye,l,Pe,Ye,K)||!1)?(je||typeof E.UNSAFE_componentWillUpdate!="function"&&typeof E.componentWillUpdate!="function"||(typeof E.componentWillUpdate=="function"&&E.componentWillUpdate(l,Ye,K),typeof E.UNSAFE_componentWillUpdate=="function"&&E.UNSAFE_componentWillUpdate(l,Ye,K)),typeof E.componentDidUpdate=="function"&&(n.flags|=4),typeof E.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof E.componentDidUpdate!="function"||z===e.memoizedProps&&Pe===e.memoizedState||(n.flags|=4),typeof E.getSnapshotBeforeUpdate!="function"||z===e.memoizedProps&&Pe===e.memoizedState||(n.flags|=1024),n.memoizedProps=l,n.memoizedState=Ye),E.props=l,E.state=Ye,E.context=K,l=ye):(typeof E.componentDidUpdate!="function"||z===e.memoizedProps&&Pe===e.memoizedState||(n.flags|=4),typeof E.getSnapshotBeforeUpdate!="function"||z===e.memoizedProps&&Pe===e.memoizedState||(n.flags|=1024),l=!1)}return _c(e,n,o,l,m,p)}function _c(e,n,o,l,p,m){op(e,n);var E=(n.flags&128)!==0;if(!l&&!E)return p&&cd(n,o,!1),ko(e,n,m);l=n.stateNode,_y.current=n;var z=E&&typeof o.getDerivedStateFromError!="function"?null:l.render();return n.flags|=1,e!==null&&E?(n.child=ds(n,e.child,null,m),n.child=ds(n,null,z,m)):Cn(e,n,z,m),n.memoizedState=l.state,p&&cd(n,o,!0),n.child}function sp(e){var n=e.stateNode;n.pendingContext?ld(e,n.pendingContext,n.pendingContext!==n.context):n.context&&ld(e,n.context,!1),oc(e,n.containerInfo)}function ap(e,n,o,l,p){return fs(),Gu(p),n.flags|=256,Cn(e,n,o,l),n.child}var Sc={dehydrated:null,treeContext:null,retryLane:0};function bc(e){return{baseLanes:e,cachePool:null,transitions:null}}function lp(e,n,o){var l=n.pendingProps,p=zt.current,m=!1,E=(n.flags&128)!==0,z;if((z=E)||(z=e!==null&&e.memoizedState===null?!1:(p&2)!==0),z?(m=!0,n.flags&=-129):(e===null||e.memoizedState!==null)&&(p|=1),bt(zt,p&1),e===null)return Qu(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=l.children,e=l.fallback,m?(l=n.mode,m=n.child,E={mode:"hidden",children:E},(l&1)===0&&m!==null?(m.childLanes=0,m.pendingProps=E):m=Ol(E,l,0,null),e=Ti(e,l,o,null),m.return=n,e.return=n,m.sibling=e,n.child=m,n.child.memoizedState=bc(o),n.memoizedState=Sc,e):kc(n,E));if(p=e.memoizedState,p!==null&&(z=p.dehydrated,z!==null))return Sy(e,n,E,l,z,p,o);if(m){m=l.fallback,E=n.mode,p=e.child,z=p.sibling;var K={mode:"hidden",children:l.children};return(E&1)===0&&n.child!==p?(l=n.child,l.childLanes=0,l.pendingProps=K,n.deletions=null):(l=ni(p,K),l.subtreeFlags=p.subtreeFlags&14680064),z!==null?m=ni(z,m):(m=Ti(m,E,o,null),m.flags|=2),m.return=n,l.return=n,l.sibling=m,n.child=l,l=m,m=n.child,E=e.child.memoizedState,E=E===null?bc(o):{baseLanes:E.baseLanes|o,cachePool:null,transitions:E.transitions},m.memoizedState=E,m.childLanes=e.childLanes&~o,n.memoizedState=Sc,l}return m=e.child,e=m.sibling,l=ni(m,{mode:"visible",children:l.children}),(n.mode&1)===0&&(l.lanes=o),l.return=n,l.sibling=null,e!==null&&(o=n.deletions,o===null?(n.deletions=[e],n.flags|=16):o.push(e)),n.child=l,n.memoizedState=null,l}function kc(e,n){return n=Ol({mode:"visible",children:n},e.mode,0,null),n.return=e,e.child=n}function Sl(e,n,o,l){return l!==null&&Gu(l),ds(n,e.child,null,o),e=kc(n,n.pendingProps.children),e.flags|=2,n.memoizedState=null,e}function Sy(e,n,o,l,p,m,E){if(o)return n.flags&256?(n.flags&=-257,l=vc(Error(i(422))),Sl(e,n,E,l)):n.memoizedState!==null?(n.child=e.child,n.flags|=128,null):(m=l.fallback,p=n.mode,l=Ol({mode:"visible",children:l.children},p,0,null),m=Ti(m,p,E,null),m.flags|=2,l.return=n,m.return=n,l.sibling=m,n.child=l,(n.mode&1)!==0&&ds(n,e.child,null,E),n.child.memoizedState=bc(E),n.memoizedState=Sc,m);if((n.mode&1)===0)return Sl(e,n,E,null);if(p.data==="$!"){if(l=p.nextSibling&&p.nextSibling.dataset,l)var z=l.dgst;return l=z,m=Error(i(419)),l=vc(m,l,void 0),Sl(e,n,E,l)}if(z=(E&e.childLanes)!==0,Ln||z){if(l=tn,l!==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&(l.suspendedLanes|E))!==0?0:p,p!==0&&p!==m.retryLane&&(m.retryLane=p,So(e,p),Mr(l,e,p,-1))}return Fc(),l=vc(Error(i(421))),Sl(e,n,E,l)}return p.data==="$?"?(n.flags|=128,n.child=e.child,n=Oy.bind(null,e),p._reactRetry=n,null):(e=m.treeContext,Qn=Uo(p.nextSibling),Xn=n,$t=!0,Nr=null,e!==null&&(cr[fr++]=wo,cr[fr++]=_o,cr[fr++]=Si,wo=e.id,_o=e.overflow,Si=n),n=kc(n,l.children),n.flags|=4096,n)}function up(e,n,o){e.lanes|=n;var l=e.alternate;l!==null&&(l.lanes|=n),tc(e.return,n,o)}function Ec(e,n,o,l,p){var m=e.memoizedState;m===null?e.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:l,tail:o,tailMode:p}:(m.isBackwards=n,m.rendering=null,m.renderingStartTime=0,m.last=l,m.tail=o,m.tailMode=p)}function cp(e,n,o){var l=n.pendingProps,p=l.revealOrder,m=l.tail;if(Cn(e,n,l.children,o),l=zt.current,(l&2)!==0)l=l&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&&up(e,o,n);else if(e.tag===19)up(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}l&=1}if(bt(zt,l),(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&&ml(e)===null&&(p=o),o=o.sibling;o=p,o===null?(p=n.child,n.child=null):(p=o.sibling,o.sibling=null),Ec(n,!1,p,o,m);break;case"backwards":for(o=null,p=n.child,n.child=null;p!==null;){if(e=p.alternate,e!==null&&ml(e)===null){n.child=p;break}e=p.sibling,p.sibling=o,o=p,p=e}Ec(n,!0,o,null,m);break;case"together":Ec(n,!1,null,null,void 0);break;default:n.memoizedState=null}return n.child}function bl(e,n){(n.mode&1)===0&&e!==null&&(e.alternate=null,n.alternate=null,n.flags|=2)}function ko(e,n,o){if(e!==null&&(n.dependencies=e.dependencies),Ci|=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=ni(e,e.pendingProps),n.child=o,o.return=n;e.sibling!==null;)e=e.sibling,o=o.sibling=ni(e,e.pendingProps),o.return=n;o.sibling=null}return n.child}function by(e,n,o){switch(n.tag){case 3:sp(n),fs();break;case 5:kd(n);break;case 1:Dn(n.type)&&il(n);break;case 4:oc(n,n.stateNode.containerInfo);break;case 10:var l=n.type._context,p=n.memoizedProps.value;bt(fl,l._currentValue),l._currentValue=p;break;case 13:if(l=n.memoizedState,l!==null)return l.dehydrated!==null?(bt(zt,zt.current&1),n.flags|=128,null):(o&n.child.childLanes)!==0?lp(e,n,o):(bt(zt,zt.current&1),e=ko(e,n,o),e!==null?e.sibling:null);bt(zt,zt.current&1);break;case 19:if(l=(o&n.childLanes)!==0,(e.flags&128)!==0){if(l)return cp(e,n,o);n.flags|=128}if(p=n.memoizedState,p!==null&&(p.rendering=null,p.tail=null,p.lastEffect=null),bt(zt,zt.current),l)break;return null;case 22:case 23:return n.lanes=0,rp(e,n,o)}return ko(e,n,o)}var fp,Nc,dp,pp;fp=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}},Nc=function(){},dp=function(e,n,o,l){var p=e.memoizedProps;if(p!==l){e=n.stateNode,Ei(Wr.current);var m=null;switch(o){case"input":p=ut(e,p),l=ut(e,l),m=[];break;case"select":p=Q({},p,{value:void 0}),l=Q({},l,{value:void 0}),m=[];break;case"textarea":p=jn(e,p),l=jn(e,l),m=[];break;default:typeof p.onClick!="function"&&typeof l.onClick=="function"&&(e.onclick=nl)}qe(o,l);var E;o=null;for(ye in p)if(!l.hasOwnProperty(ye)&&p.hasOwnProperty(ye)&&p[ye]!=null)if(ye==="style"){var z=p[ye];for(E in z)z.hasOwnProperty(E)&&(o||(o={}),o[E]="")}else ye!=="dangerouslySetInnerHTML"&&ye!=="children"&&ye!=="suppressContentEditableWarning"&&ye!=="suppressHydrationWarning"&&ye!=="autoFocus"&&(u.hasOwnProperty(ye)?m||(m=[]):(m=m||[]).push(ye,null));for(ye in l){var K=l[ye];if(z=p!=null?p[ye]:void 0,l.hasOwnProperty(ye)&&K!==z&&(K!=null||z!=null))if(ye==="style")if(z){for(E in z)!z.hasOwnProperty(E)||K&&K.hasOwnProperty(E)||(o||(o={}),o[E]="");for(E in K)K.hasOwnProperty(E)&&z[E]!==K[E]&&(o||(o={}),o[E]=K[E])}else o||(m||(m=[]),m.push(ye,o)),o=K;else ye==="dangerouslySetInnerHTML"?(K=K?K.__html:void 0,z=z?z.__html:void 0,K!=null&&z!==K&&(m=m||[]).push(ye,K)):ye==="children"?typeof K!="string"&&typeof K!="number"||(m=m||[]).push(ye,""+K):ye!=="suppressContentEditableWarning"&&ye!=="suppressHydrationWarning"&&(u.hasOwnProperty(ye)?(K!=null&&ye==="onScroll"&&Mt("scroll",e),m||z===K||(m=[])):(m=m||[]).push(ye,K))}o&&(m=m||[]).push("style",o);var ye=m;(n.updateQueue=ye)&&(n.flags|=4)}},pp=function(e,n,o,l){o!==l&&(n.flags|=4)};function ua(e,n){if(!$t)switch(e.tailMode){case"hidden":n=e.tail;for(var o=null;n!==null;)n.alternate!==null&&(o=n),n=n.sibling;o===null?e.tail=null:o.sibling=null;break;case"collapsed":o=e.tail;for(var l=null;o!==null;)o.alternate!==null&&(l=o),o=o.sibling;l===null?n||e.tail===null?e.tail=null:e.tail.sibling=null:l.sibling=null}}function wn(e){var n=e.alternate!==null&&e.alternate.child===e.child,o=0,l=0;if(n)for(var p=e.child;p!==null;)o|=p.lanes|p.childLanes,l|=p.subtreeFlags&14680064,l|=p.flags&14680064,p.return=e,p=p.sibling;else for(p=e.child;p!==null;)o|=p.lanes|p.childLanes,l|=p.subtreeFlags,l|=p.flags,p.return=e,p=p.sibling;return e.subtreeFlags|=l,e.childLanes=o,n}function ky(e,n,o){var l=n.pendingProps;switch(Yu(n),n.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return wn(n),null;case 1:return Dn(n.type)&&ol(),wn(n),null;case 3:return l=n.stateNode,ms(),Tt(zn),Tt(vn),ac(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(e===null||e.child===null)&&(ul(n)?n.flags|=4:e===null||e.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,Nr!==null&&(zc(Nr),Nr=null))),Nc(e,n),wn(n),null;case 5:ic(n);var p=Ei(oa.current);if(o=n.type,e!==null&&n.stateNode!=null)dp(e,n,o,l,p),e.ref!==n.ref&&(n.flags|=512,n.flags|=2097152);else{if(!l){if(n.stateNode===null)throw Error(i(166));return wn(n),null}if(e=Ei(Wr.current),ul(n)){l=n.stateNode,o=n.type;var m=n.memoizedProps;switch(l[qr]=n,l[Js]=m,e=(n.mode&1)!==0,o){case"dialog":Mt("cancel",l),Mt("close",l);break;case"iframe":case"object":case"embed":Mt("load",l);break;case"video":case"audio":for(p=0;p<yo.length;p++)Mt(yo[p],l);break;case"source":Mt("error",l);break;case"img":case"image":case"link":Mt("error",l),Mt("load",l);break;case"details":Mt("toggle",l);break;case"input":at(l,m),Mt("invalid",l);break;case"select":l._wrapperState={wasMultiple:!!m.multiple},Mt("invalid",l);break;case"textarea":on(l,m),Mt("invalid",l)}qe(o,m),p=null;for(var E in m)if(m.hasOwnProperty(E)){var z=m[E];E==="children"?typeof z=="string"?l.textContent!==z&&(m.suppressHydrationWarning!==!0&&tl(l.textContent,z,e),p=["children",z]):typeof z=="number"&&l.textContent!==""+z&&(m.suppressHydrationWarning!==!0&&tl(l.textContent,z,e),p=["children",""+z]):u.hasOwnProperty(E)&&z!=null&&E==="onScroll"&&Mt("scroll",l)}switch(o){case"input":Ge(l),Sn(l,m,!0);break;case"textarea":Ge(l),bn(l);break;case"select":case"option":break;default:typeof m.onClick=="function"&&(l.onclick=nl)}l=p,n.updateQueue=l,l!==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 l.is=="string"?e=E.createElement(o,{is:l.is}):(e=E.createElement(o),o==="select"&&(E=e,l.multiple?E.multiple=!0:l.size&&(E.size=l.size))):e=E.createElementNS(e,o),e[qr]=n,e[Js]=l,fp(e,n,!1,!1),n.stateNode=e;e:{switch(E=qn(o,l),o){case"dialog":Mt("cancel",e),Mt("close",e),p=l;break;case"iframe":case"object":case"embed":Mt("load",e),p=l;break;case"video":case"audio":for(p=0;p<yo.length;p++)Mt(yo[p],e);p=l;break;case"source":Mt("error",e),p=l;break;case"img":case"image":case"link":Mt("error",e),Mt("load",e),p=l;break;case"details":Mt("toggle",e),p=l;break;case"input":at(e,l),p=ut(e,l),Mt("invalid",e);break;case"option":p=l;break;case"select":e._wrapperState={wasMultiple:!!l.multiple},p=Q({},l,{value:void 0}),Mt("invalid",e);break;case"textarea":on(e,l),p=jn(e,l),Mt("invalid",e);break;default:p=l}qe(o,p),z=p;for(m in z)if(z.hasOwnProperty(m)){var K=z[m];m==="style"?Rr(e,K):m==="dangerouslySetInnerHTML"?(K=K?K.__html:void 0,K!=null&&sn(e,K)):m==="children"?typeof K=="string"?(o!=="textarea"||K!=="")&&an(e,K):typeof K=="number"&&an(e,""+K):m!=="suppressContentEditableWarning"&&m!=="suppressHydrationWarning"&&m!=="autoFocus"&&(u.hasOwnProperty(m)?K!=null&&m==="onScroll"&&Mt("scroll",e):K!=null&&M(e,m,K,E))}switch(o){case"input":Ge(e),Sn(e,l,!1);break;case"textarea":Ge(e),bn(e);break;case"option":l.value!=null&&e.setAttribute("value",""+we(l.value));break;case"select":e.multiple=!!l.multiple,m=l.value,m!=null?Et(e,!!l.multiple,m,!1):l.defaultValue!=null&&Et(e,!!l.multiple,l.defaultValue,!0);break;default:typeof p.onClick=="function"&&(e.onclick=nl)}switch(o){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}}l&&(n.flags|=4)}n.ref!==null&&(n.flags|=512,n.flags|=2097152)}return wn(n),null;case 6:if(e&&n.stateNode!=null)pp(e,n,e.memoizedProps,l);else{if(typeof l!="string"&&n.stateNode===null)throw Error(i(166));if(o=Ei(oa.current),Ei(Wr.current),ul(n)){if(l=n.stateNode,o=n.memoizedProps,l[qr]=n,(m=l.nodeValue!==o)&&(e=Xn,e!==null))switch(e.tag){case 3:tl(l.nodeValue,o,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&tl(l.nodeValue,o,(e.mode&1)!==0)}m&&(n.flags|=4)}else l=(o.nodeType===9?o:o.ownerDocument).createTextNode(l),l[qr]=n,n.stateNode=l}return wn(n),null;case 13:if(Tt(zt),l=n.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if($t&&Qn!==null&&(n.mode&1)!==0&&(n.flags&128)===0)gd(),fs(),n.flags|=98560,m=!1;else if(m=ul(n),l!==null&&l.dehydrated!==null){if(e===null){if(!m)throw Error(i(318));if(m=n.memoizedState,m=m!==null?m.dehydrated:null,!m)throw Error(i(317));m[qr]=n}else fs(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;wn(n),m=!1}else Nr!==null&&(zc(Nr),Nr=null),m=!0;if(!m)return n.flags&65536?n:null}return(n.flags&128)!==0?(n.lanes=o,n):(l=l!==null,l!==(e!==null&&e.memoizedState!==null)&&l&&(n.child.flags|=8192,(n.mode&1)!==0&&(e===null||(zt.current&1)!==0?Qt===0&&(Qt=3):Fc())),n.updateQueue!==null&&(n.flags|=4),wn(n),null);case 4:return ms(),Nc(e,n),e===null&&Gs(n.stateNode.containerInfo),wn(n),null;case 10:return ec(n.type._context),wn(n),null;case 17:return Dn(n.type)&&ol(),wn(n),null;case 19:if(Tt(zt),m=n.memoizedState,m===null)return wn(n),null;if(l=(n.flags&128)!==0,E=m.rendering,E===null)if(l)ua(m,!1);else{if(Qt!==0||e!==null&&(e.flags&128)!==0)for(e=n.child;e!==null;){if(E=ml(e),E!==null){for(n.flags|=128,ua(m,!1),l=E.updateQueue,l!==null&&(n.updateQueue=l,n.flags|=4),n.subtreeFlags=0,l=o,o=n.child;o!==null;)m=o,e=l,m.flags&=14680066,E=m.alternate,E===null?(m.childLanes=0,m.lanes=e,m.child=null,m.subtreeFlags=0,m.memoizedProps=null,m.memoizedState=null,m.updateQueue=null,m.dependencies=null,m.stateNode=null):(m.childLanes=E.childLanes,m.lanes=E.lanes,m.child=E.child,m.subtreeFlags=0,m.deletions=null,m.memoizedProps=E.memoizedProps,m.memoizedState=E.memoizedState,m.updateQueue=E.updateQueue,m.type=E.type,e=E.dependencies,m.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),o=o.sibling;return bt(zt,zt.current&1|2),n.child}e=e.sibling}m.tail!==null&&yt()>xs&&(n.flags|=128,l=!0,ua(m,!1),n.lanes=4194304)}else{if(!l)if(e=ml(E),e!==null){if(n.flags|=128,l=!0,o=e.updateQueue,o!==null&&(n.updateQueue=o,n.flags|=4),ua(m,!0),m.tail===null&&m.tailMode==="hidden"&&!E.alternate&&!$t)return wn(n),null}else 2*yt()-m.renderingStartTime>xs&&o!==1073741824&&(n.flags|=128,l=!0,ua(m,!1),n.lanes=4194304);m.isBackwards?(E.sibling=n.child,n.child=E):(o=m.last,o!==null?o.sibling=E:n.child=E,m.last=E)}return m.tail!==null?(n=m.tail,m.rendering=n,m.tail=n.sibling,m.renderingStartTime=yt(),n.sibling=null,o=zt.current,bt(zt,l?o&1|2:o&1),n):(wn(n),null);case 22:case 23:return Lc(),l=n.memoizedState!==null,e!==null&&e.memoizedState!==null!==l&&(n.flags|=8192),l&&(n.mode&1)!==0?(Gn&1073741824)!==0&&(wn(n),n.subtreeFlags&6&&(n.flags|=8192)):wn(n),null;case 24:return null;case 25:return null}throw Error(i(156,n.tag))}function Ey(e,n){switch(Yu(n),n.tag){case 1:return Dn(n.type)&&ol(),e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 3:return ms(),Tt(zn),Tt(vn),ac(),e=n.flags,(e&65536)!==0&&(e&128)===0?(n.flags=e&-65537|128,n):null;case 5:return ic(n),null;case 13:if(Tt(zt),e=n.memoizedState,e!==null&&e.dehydrated!==null){if(n.alternate===null)throw Error(i(340));fs()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 19:return Tt(zt),null;case 4:return ms(),null;case 10:return ec(n.type._context),null;case 22:case 23:return Lc(),null;case 24:return null;default:return null}}var kl=!1,_n=!1,Ny=typeof WeakSet=="function"?WeakSet:Set,We=null;function ys(e,n){var o=e.ref;if(o!==null)if(typeof o=="function")try{o(null)}catch(l){Lt(e,n,l)}else o.current=null}function Cc(e,n,o){try{o()}catch(l){Lt(e,n,l)}}var hp=!1;function Cy(e,n){if(Lu=Ki,e=re(),ne(e)){if("selectionStart"in e)var o={start:e.selectionStart,end:e.selectionEnd};else e:{o=(o=e.ownerDocument)&&o.defaultView||window;var l=o.getSelection&&o.getSelection();if(l&&l.rangeCount!==0){o=l.anchorNode;var p=l.anchorOffset,m=l.focusNode;l=l.focusOffset;try{o.nodeType,m.nodeType}catch{o=null;break e}var E=0,z=-1,K=-1,ye=0,je=0,Te=e,Pe=null;t:for(;;){for(var Ke;Te!==o||p!==0&&Te.nodeType!==3||(z=E+p),Te!==m||l!==0&&Te.nodeType!==3||(K=E+l),Te.nodeType===3&&(E+=Te.nodeValue.length),(Ke=Te.firstChild)!==null;)Pe=Te,Te=Ke;for(;;){if(Te===e)break t;if(Pe===o&&++ye===p&&(z=E),Pe===m&&++je===l&&(K=E),(Ke=Te.nextSibling)!==null)break;Te=Pe,Pe=Te.parentNode}Te=Ke}o=z===-1||K===-1?null:{start:z,end:K}}else o=null}o=o||{start:0,end:0}}else o=null;for(Fu={focusedElem:e,selectionRange:o},Ki=!1,We=n;We!==null;)if(n=We,e=n.child,(n.subtreeFlags&1028)!==0&&e!==null)e.return=n,We=e;else for(;We!==null;){n=We;try{var Ye=n.alternate;if((n.flags&1024)!==0)switch(n.tag){case 0:case 11:case 15:break;case 1:if(Ye!==null){var Xe=Ye.memoizedProps,Ft=Ye.memoizedState,pe=n.stateNode,ee=pe.getSnapshotBeforeUpdate(n.elementType===n.type?Xe:Cr(n.type,Xe),Ft);pe.__reactInternalSnapshotBeforeUpdate=ee}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){Lt(n,n.return,ze)}if(e=n.sibling,e!==null){e.return=n.return,We=e;break}We=n.return}return Ye=hp,hp=!1,Ye}function ca(e,n,o){var l=n.updateQueue;if(l=l!==null?l.lastEffect:null,l!==null){var p=l=l.next;do{if((p.tag&e)===e){var m=p.destroy;p.destroy=void 0,m!==void 0&&Cc(n,o,m)}p=p.next}while(p!==l)}}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 l=o.create;o.destroy=l()}o=o.next}while(o!==n)}}function Pc(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 mp(e){var n=e.alternate;n!==null&&(e.alternate=null,mp(n)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(n=e.stateNode,n!==null&&(delete n[qr],delete n[Js],delete n[Ku],delete n[uy],delete n[cy])),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 gp(e){return e.tag===5||e.tag===3||e.tag===4}function yp(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||gp(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 jc(e,n,o){var l=e.tag;if(l===5||l===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=nl));else if(l!==4&&(e=e.child,e!==null))for(jc(e,n,o),e=e.sibling;e!==null;)jc(e,n,o),e=e.sibling}function Mc(e,n,o){var l=e.tag;if(l===5||l===6)e=e.stateNode,n?o.insertBefore(e,n):o.appendChild(e);else if(l!==4&&(e=e.child,e!==null))for(Mc(e,n,o),e=e.sibling;e!==null;)Mc(e,n,o),e=e.sibling}var fn=null,Pr=!1;function Go(e,n,o){for(o=o.child;o!==null;)vp(e,n,o),o=o.sibling}function vp(e,n,o){if(Nn&&typeof Nn.onCommitFiberUnmount=="function")try{Nn.onCommitFiberUnmount(ar,o)}catch{}switch(o.tag){case 5:_n||ys(o,n);case 6:var l=fn,p=Pr;fn=null,Go(e,n,o),fn=l,Pr=p,fn!==null&&(Pr?(e=fn,o=o.stateNode,e.nodeType===8?e.parentNode.removeChild(o):e.removeChild(o)):fn.removeChild(o.stateNode));break;case 18:fn!==null&&(Pr?(e=fn,o=o.stateNode,e.nodeType===8?Vu(e.parentNode,o):e.nodeType===1&&Vu(e,o),ao(e)):Vu(fn,o.stateNode));break;case 4:l=fn,p=Pr,fn=o.stateNode.containerInfo,Pr=!0,Go(e,n,o),fn=l,Pr=p;break;case 0:case 11:case 14:case 15:if(!_n&&(l=o.updateQueue,l!==null&&(l=l.lastEffect,l!==null))){p=l=l.next;do{var m=p,E=m.destroy;m=m.tag,E!==void 0&&((m&2)!==0||(m&4)!==0)&&Cc(o,n,E),p=p.next}while(p!==l)}Go(e,n,o);break;case 1:if(!_n&&(ys(o,n),l=o.stateNode,typeof l.componentWillUnmount=="function"))try{l.props=o.memoizedProps,l.state=o.memoizedState,l.componentWillUnmount()}catch(z){Lt(o,n,z)}Go(e,n,o);break;case 21:Go(e,n,o);break;case 22:o.mode&1?(_n=(l=_n)||o.memoizedState!==null,Go(e,n,o),_n=l):Go(e,n,o);break;default:Go(e,n,o)}}function xp(e){var n=e.updateQueue;if(n!==null){e.updateQueue=null;var o=e.stateNode;o===null&&(o=e.stateNode=new Ny),n.forEach(function(l){var p=Ry.bind(null,e,l);o.has(l)||(o.add(l),l.then(p,p))})}}function jr(e,n){var o=n.deletions;if(o!==null)for(var l=0;l<o.length;l++){var p=o[l];try{var m=e,E=n,z=E;e:for(;z!==null;){switch(z.tag){case 5:fn=z.stateNode,Pr=!1;break e;case 3:fn=z.stateNode.containerInfo,Pr=!0;break e;case 4:fn=z.stateNode.containerInfo,Pr=!0;break e}z=z.return}if(fn===null)throw Error(i(160));vp(m,E,p),fn=null,Pr=!1;var K=p.alternate;K!==null&&(K.return=null),p.return=null}catch(ye){Lt(p,n,ye)}}if(n.subtreeFlags&12854)for(n=n.child;n!==null;)wp(n,e),n=n.sibling}function wp(e,n){var o=e.alternate,l=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(jr(n,e),Xr(e),l&4){try{ca(3,e,e.return),El(3,e)}catch(Xe){Lt(e,e.return,Xe)}try{ca(5,e,e.return)}catch(Xe){Lt(e,e.return,Xe)}}break;case 1:jr(n,e),Xr(e),l&512&&o!==null&&ys(o,o.return);break;case 5:if(jr(n,e),Xr(e),l&512&&o!==null&&ys(o,o.return),e.flags&32){var p=e.stateNode;try{an(p,"")}catch(Xe){Lt(e,e.return,Xe)}}if(l&4&&(p=e.stateNode,p!=null)){var m=e.memoizedProps,E=o!==null?o.memoizedProps:m,z=e.type,K=e.updateQueue;if(e.updateQueue=null,K!==null)try{z==="input"&&m.type==="radio"&&m.name!=null&&lt(p,m),qn(z,E);var ye=qn(z,m);for(E=0;E<K.length;E+=2){var je=K[E],Te=K[E+1];je==="style"?Rr(p,Te):je==="dangerouslySetInnerHTML"?sn(p,Te):je==="children"?an(p,Te):M(p,je,Te,ye)}switch(z){case"input":kt(p,m);break;case"textarea":gr(p,m);break;case"select":var Pe=p._wrapperState.wasMultiple;p._wrapperState.wasMultiple=!!m.multiple;var Ke=m.value;Ke!=null?Et(p,!!m.multiple,Ke,!1):Pe!==!!m.multiple&&(m.defaultValue!=null?Et(p,!!m.multiple,m.defaultValue,!0):Et(p,!!m.multiple,m.multiple?[]:"",!1))}p[Js]=m}catch(Xe){Lt(e,e.return,Xe)}}break;case 6:if(jr(n,e),Xr(e),l&4){if(e.stateNode===null)throw Error(i(162));p=e.stateNode,m=e.memoizedProps;try{p.nodeValue=m}catch(Xe){Lt(e,e.return,Xe)}}break;case 3:if(jr(n,e),Xr(e),l&4&&o!==null&&o.memoizedState.isDehydrated)try{ao(n.containerInfo)}catch(Xe){Lt(e,e.return,Xe)}break;case 4:jr(n,e),Xr(e);break;case 13:jr(n,e),Xr(e),p=e.child,p.flags&8192&&(m=p.memoizedState!==null,p.stateNode.isHidden=m,!m||p.alternate!==null&&p.alternate.memoizedState!==null||(Ac=yt())),l&4&&xp(e);break;case 22:if(je=o!==null&&o.memoizedState!==null,e.mode&1?(_n=(ye=_n)||je,jr(n,e),_n=ye):jr(n,e),Xr(e),l&8192){if(ye=e.memoizedState!==null,(e.stateNode.isHidden=ye)&&!je&&(e.mode&1)!==0)for(We=e,je=e.child;je!==null;){for(Te=We=je;We!==null;){switch(Pe=We,Ke=Pe.child,Pe.tag){case 0:case 11:case 14:case 15:ca(4,Pe,Pe.return);break;case 1:ys(Pe,Pe.return);var Ye=Pe.stateNode;if(typeof Ye.componentWillUnmount=="function"){l=Pe,o=Pe.return;try{n=l,Ye.props=n.memoizedProps,Ye.state=n.memoizedState,Ye.componentWillUnmount()}catch(Xe){Lt(l,o,Xe)}}break;case 5:ys(Pe,Pe.return);break;case 22:if(Pe.memoizedState!==null){bp(Te);continue}}Ke!==null?(Ke.return=Pe,We=Ke):bp(Te)}je=je.sibling}e:for(je=null,Te=e;;){if(Te.tag===5){if(je===null){je=Te;try{p=Te.stateNode,ye?(m=p.style,typeof m.setProperty=="function"?m.setProperty("display","none","important"):m.display="none"):(z=Te.stateNode,K=Te.memoizedProps.style,E=K!=null&&K.hasOwnProperty("display")?K.display:null,z.style.display=yr("display",E))}catch(Xe){Lt(e,e.return,Xe)}}}else if(Te.tag===6){if(je===null)try{Te.stateNode.nodeValue=ye?"":Te.memoizedProps}catch(Xe){Lt(e,e.return,Xe)}}else if((Te.tag!==22&&Te.tag!==23||Te.memoizedState===null||Te===e)&&Te.child!==null){Te.child.return=Te,Te=Te.child;continue}if(Te===e)break e;for(;Te.sibling===null;){if(Te.return===null||Te.return===e)break e;je===Te&&(je=null),Te=Te.return}je===Te&&(je=null),Te.sibling.return=Te.return,Te=Te.sibling}}break;case 19:jr(n,e),Xr(e),l&4&&xp(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(gp(o)){var l=o;break e}o=o.return}throw Error(i(160))}switch(l.tag){case 5:var p=l.stateNode;l.flags&32&&(an(p,""),l.flags&=-33);var m=yp(e);Mc(e,m,p);break;case 3:case 4:var E=l.stateNode.containerInfo,z=yp(e);jc(e,z,E);break;default:throw Error(i(161))}}catch(K){Lt(e,e.return,K)}e.flags&=-3}n&4096&&(e.flags&=-4097)}function Py(e,n,o){We=e,_p(e)}function _p(e,n,o){for(var l=(e.mode&1)!==0;We!==null;){var p=We,m=p.child;if(p.tag===22&&l){var E=p.memoizedState!==null||kl;if(!E){var z=p.alternate,K=z!==null&&z.memoizedState!==null||_n;z=kl;var ye=_n;if(kl=E,(_n=K)&&!ye)for(We=p;We!==null;)E=We,K=E.child,E.tag===22&&E.memoizedState!==null?kp(p):K!==null?(K.return=E,We=K):kp(p);for(;m!==null;)We=m,_p(m),m=m.sibling;We=p,kl=z,_n=ye}Sp(e)}else(p.subtreeFlags&8772)!==0&&m!==null?(m.return=p,We=m):Sp(e)}}function Sp(e){for(;We!==null;){var n=We;if((n.flags&8772)!==0){var o=n.alternate;try{if((n.flags&8772)!==0)switch(n.tag){case 0:case 11:case 15:_n||El(5,n);break;case 1:var l=n.stateNode;if(n.flags&4&&!_n)if(o===null)l.componentDidMount();else{var p=n.elementType===n.type?o.memoizedProps:Cr(n.type,o.memoizedProps);l.componentDidUpdate(p,o.memoizedState,l.__reactInternalSnapshotBeforeUpdate)}var m=n.updateQueue;m!==null&&bd(n,m,l);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}bd(n,E,o)}break;case 5:var z=n.stateNode;if(o===null&&n.flags&4){o=z;var K=n.memoizedProps;switch(n.type){case"button":case"input":case"select":case"textarea":K.autoFocus&&o.focus();break;case"img":K.src&&(o.src=K.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 je=ye.memoizedState;if(je!==null){var Te=je.dehydrated;Te!==null&&ao(Te)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(i(163))}_n||n.flags&512&&Pc(n)}catch(Pe){Lt(n,n.return,Pe)}}if(n===e){We=null;break}if(o=n.sibling,o!==null){o.return=n.return,We=o;break}We=n.return}}function bp(e){for(;We!==null;){var n=We;if(n===e){We=null;break}var o=n.sibling;if(o!==null){o.return=n.return,We=o;break}We=n.return}}function kp(e){for(;We!==null;){var n=We;try{switch(n.tag){case 0:case 11:case 15:var o=n.return;try{El(4,n)}catch(K){Lt(n,o,K)}break;case 1:var l=n.stateNode;if(typeof l.componentDidMount=="function"){var p=n.return;try{l.componentDidMount()}catch(K){Lt(n,p,K)}}var m=n.return;try{Pc(n)}catch(K){Lt(n,m,K)}break;case 5:var E=n.return;try{Pc(n)}catch(K){Lt(n,E,K)}}}catch(K){Lt(n,n.return,K)}if(n===e){We=null;break}var z=n.sibling;if(z!==null){z.return=n.return,We=z;break}We=n.return}}var jy=Math.ceil,Nl=R.ReactCurrentDispatcher,Tc=R.ReactCurrentOwner,hr=R.ReactCurrentBatchConfig,xt=0,tn=null,Kt=null,dn=0,Gn=0,vs=qo(0),Qt=0,fa=null,Ci=0,Cl=0,Ic=0,da=null,Fn=null,Ac=0,xs=1/0,Eo=null,Pl=!1,$c=null,Zo=null,jl=!1,Jo=null,Ml=0,pa=0,Oc=null,Tl=-1,Il=0;function Pn(){return(xt&6)!==0?yt():Tl!==-1?Tl:Tl=yt()}function ei(e){return(e.mode&1)===0?1:(xt&2)!==0&&dn!==0?dn&-dn:dy.transition!==null?(Il===0&&(Il=Hr()),Il):(e=wt,e!==0||(e=window.event,e=e===void 0?16:Ui(e.type)),e)}function Mr(e,n,o,l){if(50<pa)throw pa=0,Oc=null,Error(i(185));ur(e,o,l),((xt&2)===0||e!==tn)&&(e===tn&&((xt&2)===0&&(Cl|=o),Qt===4&&ti(e,dn)),Bn(e,l),o===1&&xt===0&&(n.mode&1)===0&&(xs=yt()+500,sl&&Yo()))}function Bn(e,n){var o=e.callbackNode;oo(e,n);var l=vt(e,e===tn?dn:0);if(l===0)o!==null&&To(o),e.callbackNode=null,e.callbackPriority=0;else if(n=l&-l,e.callbackPriority!==n){if(o!=null&&To(o),n===1)e.tag===0?fy(Np.bind(null,e)):fd(Np.bind(null,e)),ay(function(){(xt&6)===0&&Yo()}),o=null;else{switch(Fa(l)){case 1:o=Lr;break;case 4:o=Io;break;case 16:o=Fr;break;case 536870912:o=ci;break;default:o=Fr}o=$p(o,Ep.bind(null,e))}e.callbackPriority=n,e.callbackNode=o}}function Ep(e,n){if(Tl=-1,Il=0,(xt&6)!==0)throw Error(i(327));var o=e.callbackNode;if(ws()&&e.callbackNode!==o)return null;var l=vt(e,e===tn?dn:0);if(l===0)return null;if((l&30)!==0||(l&e.expiredLanes)!==0||n)n=Al(e,l);else{n=l;var p=xt;xt|=2;var m=Pp();(tn!==e||dn!==n)&&(Eo=null,xs=yt()+500,ji(e,n));do try{Iy();break}catch(z){Cp(e,z)}while(!0);Ju(),Nl.current=m,xt=p,Kt!==null?n=0:(tn=null,dn=0,n=Qt)}if(n!==0){if(n===2&&(p=lr(e),p!==0&&(l=p,n=Rc(e,p))),n===1)throw o=fa,ji(e,0),ti(e,l),Bn(e,yt()),o;if(n===6)ti(e,l);else{if(p=e.current.alternate,(l&30)===0&&!My(p)&&(n=Al(e,l),n===2&&(m=lr(e),m!==0&&(l=m,n=Rc(e,m))),n===1))throw o=fa,ji(e,0),ti(e,l),Bn(e,yt()),o;switch(e.finishedWork=p,e.finishedLanes=l,n){case 0:case 1:throw Error(i(345));case 2:Mi(e,Fn,Eo);break;case 3:if(ti(e,l),(l&130023424)===l&&(n=Ac+500-yt(),10<n)){if(vt(e,0)!==0)break;if(p=e.suspendedLanes,(p&l)!==l){Pn(),e.pingedLanes|=e.suspendedLanes&p;break}e.timeoutHandle=Hu(Mi.bind(null,e,Fn,Eo),n);break}Mi(e,Fn,Eo);break;case 4:if(ti(e,l),(l&4194240)===l)break;for(n=e.eventTimes,p=-1;0<l;){var E=31-mn(l);m=1<<E,E=n[E],E>p&&(p=E),l&=~m}if(l=p,l=yt()-l,l=(120>l?120:480>l?480:1080>l?1080:1920>l?1920:3e3>l?3e3:4320>l?4320:1960*jy(l/1960))-l,10<l){e.timeoutHandle=Hu(Mi.bind(null,e,Fn,Eo),l);break}Mi(e,Fn,Eo);break;case 5:Mi(e,Fn,Eo);break;default:throw Error(i(329))}}}return Bn(e,yt()),e.callbackNode===o?Ep.bind(null,e):null}function Rc(e,n){var o=da;return e.current.memoizedState.isDehydrated&&(ji(e,n).flags|=256),e=Al(e,n),e!==2&&(n=Fn,Fn=o,n!==null&&zc(n)),e}function zc(e){Fn===null?Fn=e:Fn.push.apply(Fn,e)}function My(e){for(var n=e;;){if(n.flags&16384){var o=n.updateQueue;if(o!==null&&(o=o.stores,o!==null))for(var l=0;l<o.length;l++){var p=o[l],m=p.getSnapshot;p=p.value;try{if(!se(m(),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 ti(e,n){for(n&=~Ic,n&=~Cl,e.suspendedLanes|=n,e.pingedLanes&=~n,e=e.expirationTimes;0<n;){var o=31-mn(n),l=1<<o;e[o]=-1,n&=~l}}function Np(e){if((xt&6)!==0)throw Error(i(327));ws();var n=vt(e,0);if((n&1)===0)return Bn(e,yt()),null;var o=Al(e,n);if(e.tag!==0&&o===2){var l=lr(e);l!==0&&(n=l,o=Rc(e,l))}if(o===1)throw o=fa,ji(e,0),ti(e,n),Bn(e,yt()),o;if(o===6)throw Error(i(345));return e.finishedWork=e.current.alternate,e.finishedLanes=n,Mi(e,Fn,Eo),Bn(e,yt()),null}function Dc(e,n){var o=xt;xt|=1;try{return e(n)}finally{xt=o,xt===0&&(xs=yt()+500,sl&&Yo())}}function Pi(e){Jo!==null&&Jo.tag===0&&(xt&6)===0&&ws();var n=xt;xt|=1;var o=hr.transition,l=wt;try{if(hr.transition=null,wt=1,e)return e()}finally{wt=l,hr.transition=o,xt=n,(xt&6)===0&&Yo()}}function Lc(){Gn=vs.current,Tt(vs)}function ji(e,n){e.finishedWork=null,e.finishedLanes=0;var o=e.timeoutHandle;if(o!==-1&&(e.timeoutHandle=-1,sy(o)),Kt!==null)for(o=Kt.return;o!==null;){var l=o;switch(Yu(l),l.tag){case 1:l=l.type.childContextTypes,l!=null&&ol();break;case 3:ms(),Tt(zn),Tt(vn),ac();break;case 5:ic(l);break;case 4:ms();break;case 13:Tt(zt);break;case 19:Tt(zt);break;case 10:ec(l.type._context);break;case 22:case 23:Lc()}o=o.return}if(tn=e,Kt=e=ni(e.current,null),dn=Gn=n,Qt=0,fa=null,Ic=Cl=Ci=0,Fn=da=null,ki!==null){for(n=0;n<ki.length;n++)if(o=ki[n],l=o.interleaved,l!==null){o.interleaved=null;var p=l.next,m=o.pending;if(m!==null){var E=m.next;m.next=p,l.next=E}o.pending=l}ki=null}return e}function Cp(e,n){do{var o=Kt;try{if(Ju(),gl.current=wl,yl){for(var l=Dt.memoizedState;l!==null;){var p=l.queue;p!==null&&(p.pending=null),l=l.next}yl=!1}if(Ni=0,en=Xt=Dt=null,ia=!1,sa=0,Tc.current=null,o===null||o.return===null){Qt=1,fa=n,Kt=null;break}e:{var m=e,E=o.return,z=o,K=n;if(n=dn,z.flags|=32768,K!==null&&typeof K=="object"&&typeof K.then=="function"){var ye=K,je=z,Te=je.tag;if((je.mode&1)===0&&(Te===0||Te===11||Te===15)){var Pe=je.alternate;Pe?(je.updateQueue=Pe.updateQueue,je.memoizedState=Pe.memoizedState,je.lanes=Pe.lanes):(je.updateQueue=null,je.memoizedState=null)}var Ke=Zd(E);if(Ke!==null){Ke.flags&=-257,Jd(Ke,E,z,m,n),Ke.mode&1&&Gd(m,ye,n),n=Ke,K=ye;var Ye=n.updateQueue;if(Ye===null){var Xe=new Set;Xe.add(K),n.updateQueue=Xe}else Ye.add(K);break e}else{if((n&1)===0){Gd(m,ye,n),Fc();break e}K=Error(i(426))}}else if($t&&z.mode&1){var Ft=Zd(E);if(Ft!==null){(Ft.flags&65536)===0&&(Ft.flags|=256),Jd(Ft,E,z,m,n),Gu(gs(K,z));break e}}m=K=gs(K,z),Qt!==4&&(Qt=2),da===null?da=[m]:da.push(m),m=E;do{switch(m.tag){case 3:m.flags|=65536,n&=-n,m.lanes|=n;var pe=Xd(m,K,n);Sd(m,pe);break e;case 1:z=K;var ee=m.type,me=m.stateNode;if((m.flags&128)===0&&(typeof ee.getDerivedStateFromError=="function"||me!==null&&typeof me.componentDidCatch=="function"&&(Zo===null||!Zo.has(me)))){m.flags|=65536,n&=-n,m.lanes|=n;var ze=Qd(m,z,n);Sd(m,ze);break e}}m=m.return}while(m!==null)}Mp(o)}catch(Qe){n=Qe,Kt===o&&o!==null&&(Kt=o=o.return);continue}break}while(!0)}function Pp(){var e=Nl.current;return Nl.current=wl,e===null?wl:e}function Fc(){(Qt===0||Qt===3||Qt===2)&&(Qt=4),tn===null||(Ci&268435455)===0&&(Cl&268435455)===0||ti(tn,dn)}function Al(e,n){var o=xt;xt|=2;var l=Pp();(tn!==e||dn!==n)&&(Eo=null,ji(e,n));do try{Ty();break}catch(p){Cp(e,p)}while(!0);if(Ju(),xt=o,Nl.current=l,Kt!==null)throw Error(i(261));return tn=null,dn=0,Qt}function Ty(){for(;Kt!==null;)jp(Kt)}function Iy(){for(;Kt!==null&&!Pt();)jp(Kt)}function jp(e){var n=Ap(e.alternate,e,Gn);e.memoizedProps=e.pendingProps,n===null?Mp(e):Kt=n,Tc.current=null}function Mp(e){var n=e;do{var o=n.alternate;if(e=n.return,(n.flags&32768)===0){if(o=ky(o,n,Gn),o!==null){Kt=o;return}}else{if(o=Ey(o,n),o!==null){o.flags&=32767,Kt=o;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Qt=6,Kt=null;return}}if(n=n.sibling,n!==null){Kt=n;return}Kt=n=e}while(n!==null);Qt===0&&(Qt=5)}function Mi(e,n,o){var l=wt,p=hr.transition;try{hr.transition=null,wt=1,Ay(e,n,o,l)}finally{hr.transition=p,wt=l}return null}function Ay(e,n,o,l){do ws();while(Jo!==null);if((xt&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 m=o.lanes|o.childLanes;if(fi(e,m),e===tn&&(Kt=tn=null,dn=0),(o.subtreeFlags&2064)===0&&(o.flags&2064)===0||jl||(jl=!0,$p(Fr,function(){return ws(),null})),m=(o.flags&15990)!==0,(o.subtreeFlags&15990)!==0||m){m=hr.transition,hr.transition=null;var E=wt;wt=1;var z=xt;xt|=4,Tc.current=null,Cy(e,o),wp(o,e),oe(Fu),Ki=!!Lu,Fu=Lu=null,e.current=o,Py(o),sr(),xt=z,wt=E,hr.transition=m}else e.current=o;if(jl&&(jl=!1,Jo=e,Ml=p),m=e.pendingLanes,m===0&&(Zo=null),ct(o.stateNode),Bn(e,yt()),n!==null)for(l=e.onRecoverableError,o=0;o<n.length;o++)p=n[o],l(p.value,{componentStack:p.stack,digest:p.digest});if(Pl)throw Pl=!1,e=$c,$c=null,e;return(Ml&1)!==0&&e.tag!==0&&ws(),m=e.pendingLanes,(m&1)!==0?e===Oc?pa++:(pa=0,Oc=e):pa=0,Yo(),null}function ws(){if(Jo!==null){var e=Fa(Ml),n=hr.transition,o=wt;try{if(hr.transition=null,wt=16>e?16:e,Jo===null)var l=!1;else{if(e=Jo,Jo=null,Ml=0,(xt&6)!==0)throw Error(i(331));var p=xt;for(xt|=4,We=e.current;We!==null;){var m=We,E=m.child;if((We.flags&16)!==0){var z=m.deletions;if(z!==null){for(var K=0;K<z.length;K++){var ye=z[K];for(We=ye;We!==null;){var je=We;switch(je.tag){case 0:case 11:case 15:ca(8,je,m)}var Te=je.child;if(Te!==null)Te.return=je,We=Te;else for(;We!==null;){je=We;var Pe=je.sibling,Ke=je.return;if(mp(je),je===ye){We=null;break}if(Pe!==null){Pe.return=Ke,We=Pe;break}We=Ke}}}var Ye=m.alternate;if(Ye!==null){var Xe=Ye.child;if(Xe!==null){Ye.child=null;do{var Ft=Xe.sibling;Xe.sibling=null,Xe=Ft}while(Xe!==null)}}We=m}}if((m.subtreeFlags&2064)!==0&&E!==null)E.return=m,We=E;else e:for(;We!==null;){if(m=We,(m.flags&2048)!==0)switch(m.tag){case 0:case 11:case 15:ca(9,m,m.return)}var pe=m.sibling;if(pe!==null){pe.return=m.return,We=pe;break e}We=m.return}}var ee=e.current;for(We=ee;We!==null;){E=We;var me=E.child;if((E.subtreeFlags&2064)!==0&&me!==null)me.return=E,We=me;else e:for(E=ee;We!==null;){if(z=We,(z.flags&2048)!==0)try{switch(z.tag){case 0:case 11:case 15:El(9,z)}}catch(Qe){Lt(z,z.return,Qe)}if(z===E){We=null;break e}var ze=z.sibling;if(ze!==null){ze.return=z.return,We=ze;break e}We=z.return}}if(xt=p,Yo(),Nn&&typeof Nn.onPostCommitFiberRoot=="function")try{Nn.onPostCommitFiberRoot(ar,e)}catch{}l=!0}return l}finally{wt=o,hr.transition=n}}return!1}function Tp(e,n,o){n=gs(o,n),n=Xd(e,n,1),e=Qo(e,n,1),n=Pn(),e!==null&&(ur(e,1,n),Bn(e,n))}function Lt(e,n,o){if(e.tag===3)Tp(e,e,o);else for(;n!==null;){if(n.tag===3){Tp(n,e,o);break}else if(n.tag===1){var l=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(Zo===null||!Zo.has(l))){e=gs(o,e),e=Qd(n,e,1),n=Qo(n,e,1),e=Pn(),n!==null&&(ur(n,1,e),Bn(n,e));break}}n=n.return}}function $y(e,n,o){var l=e.pingCache;l!==null&&l.delete(n),n=Pn(),e.pingedLanes|=e.suspendedLanes&o,tn===e&&(dn&o)===o&&(Qt===4||Qt===3&&(dn&130023424)===dn&&500>yt()-Ac?ji(e,0):Ic|=o),Bn(e,n)}function Ip(e,n){n===0&&((e.mode&1)===0?n=1:(n=ro,ro<<=1,(ro&130023424)===0&&(ro=4194304)));var o=Pn();e=So(e,n),e!==null&&(ur(e,n,o),Bn(e,o))}function Oy(e){var n=e.memoizedState,o=0;n!==null&&(o=n.retryLane),Ip(e,o)}function Ry(e,n){var o=0;switch(e.tag){case 13:var l=e.stateNode,p=e.memoizedState;p!==null&&(o=p.retryLane);break;case 19:l=e.stateNode;break;default:throw Error(i(314))}l!==null&&l.delete(n),Ip(e,o)}var Ap;Ap=function(e,n,o){if(e!==null)if(e.memoizedProps!==n.pendingProps||zn.current)Ln=!0;else{if((e.lanes&o)===0&&(n.flags&128)===0)return Ln=!1,by(e,n,o);Ln=(e.flags&131072)!==0}else Ln=!1,$t&&(n.flags&1048576)!==0&&dd(n,ll,n.index);switch(n.lanes=0,n.tag){case 2:var l=n.type;bl(e,n),e=n.pendingProps;var p=ls(n,vn.current);hs(n,o),p=cc(null,n,l,e,p,o);var m=fc();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,Dn(l)?(m=!0,il(n)):m=!1,n.memoizedState=p.state!==null&&p.state!==void 0?p.state:null,rc(n),p.updater=_l,n.stateNode=p,p._reactInternals=n,yc(n,l,e,o),n=_c(null,n,l,!0,m,o)):(n.tag=0,$t&&m&&Wu(n),Cn(null,n,p,o),n=n.child),n;case 16:l=n.elementType;e:{switch(bl(e,n),e=n.pendingProps,p=l._init,l=p(l._payload),n.type=l,p=n.tag=Dy(l),e=Cr(l,e),p){case 0:n=wc(null,n,l,e,o);break e;case 1:n=ip(null,n,l,e,o);break e;case 11:n=ep(null,n,l,e,o);break e;case 14:n=tp(null,n,l,Cr(l.type,e),o);break e}throw Error(i(306,l,""))}return n;case 0:return l=n.type,p=n.pendingProps,p=n.elementType===l?p:Cr(l,p),wc(e,n,l,p,o);case 1:return l=n.type,p=n.pendingProps,p=n.elementType===l?p:Cr(l,p),ip(e,n,l,p,o);case 3:e:{if(sp(n),e===null)throw Error(i(387));l=n.pendingProps,m=n.memoizedState,p=m.element,_d(e,n),hl(n,l,null,o);var E=n.memoizedState;if(l=E.element,m.isDehydrated)if(m={element:l,isDehydrated:!1,cache:E.cache,pendingSuspenseBoundaries:E.pendingSuspenseBoundaries,transitions:E.transitions},n.updateQueue.baseState=m,n.memoizedState=m,n.flags&256){p=gs(Error(i(423)),n),n=ap(e,n,l,o,p);break e}else if(l!==p){p=gs(Error(i(424)),n),n=ap(e,n,l,o,p);break e}else for(Qn=Uo(n.stateNode.containerInfo.firstChild),Xn=n,$t=!0,Nr=null,o=xd(n,null,l,o),n.child=o;o;)o.flags=o.flags&-3|4096,o=o.sibling;else{if(fs(),l===p){n=ko(e,n,o);break e}Cn(e,n,l,o)}n=n.child}return n;case 5:return kd(n),e===null&&Qu(n),l=n.type,p=n.pendingProps,m=e!==null?e.memoizedProps:null,E=p.children,Bu(l,p)?E=null:m!==null&&Bu(l,m)&&(n.flags|=32),op(e,n),Cn(e,n,E,o),n.child;case 6:return e===null&&Qu(n),null;case 13:return lp(e,n,o);case 4:return oc(n,n.stateNode.containerInfo),l=n.pendingProps,e===null?n.child=ds(n,null,l,o):Cn(e,n,l,o),n.child;case 11:return l=n.type,p=n.pendingProps,p=n.elementType===l?p:Cr(l,p),ep(e,n,l,p,o);case 7:return Cn(e,n,n.pendingProps,o),n.child;case 8:return Cn(e,n,n.pendingProps.children,o),n.child;case 12:return Cn(e,n,n.pendingProps.children,o),n.child;case 10:e:{if(l=n.type._context,p=n.pendingProps,m=n.memoizedProps,E=p.value,bt(fl,l._currentValue),l._currentValue=E,m!==null)if(se(m.value,E)){if(m.children===p.children&&!zn.current){n=ko(e,n,o);break e}}else for(m=n.child,m!==null&&(m.return=n);m!==null;){var z=m.dependencies;if(z!==null){E=m.child;for(var K=z.firstContext;K!==null;){if(K.context===l){if(m.tag===1){K=bo(-1,o&-o),K.tag=2;var ye=m.updateQueue;if(ye!==null){ye=ye.shared;var je=ye.pending;je===null?K.next=K:(K.next=je.next,je.next=K),ye.pending=K}}m.lanes|=o,K=m.alternate,K!==null&&(K.lanes|=o),tc(m.return,o,n),z.lanes|=o;break}K=K.next}}else if(m.tag===10)E=m.type===n.type?null:m.child;else if(m.tag===18){if(E=m.return,E===null)throw Error(i(341));E.lanes|=o,z=E.alternate,z!==null&&(z.lanes|=o),tc(E,o,n),E=m.sibling}else E=m.child;if(E!==null)E.return=m;else for(E=m;E!==null;){if(E===n){E=null;break}if(m=E.sibling,m!==null){m.return=E.return,E=m;break}E=E.return}m=E}Cn(e,n,p.children,o),n=n.child}return n;case 9:return p=n.type,l=n.pendingProps.children,hs(n,o),p=dr(p),l=l(p),n.flags|=1,Cn(e,n,l,o),n.child;case 14:return l=n.type,p=Cr(l,n.pendingProps),p=Cr(l.type,p),tp(e,n,l,p,o);case 15:return np(e,n,n.type,n.pendingProps,o);case 17:return l=n.type,p=n.pendingProps,p=n.elementType===l?p:Cr(l,p),bl(e,n),n.tag=1,Dn(l)?(e=!0,il(n)):e=!1,hs(n,o),Wd(n,l,p),yc(n,l,p,o),_c(null,n,l,!0,e,o);case 19:return cp(e,n,o);case 22:return rp(e,n,o)}throw Error(i(156,n.tag))};function $p(e,n){return ui(e,n)}function zy(e,n,o,l){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=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function mr(e,n,o,l){return new zy(e,n,o,l)}function Bc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Dy(e){if(typeof e=="function")return Bc(e)?1:0;if(e!=null){if(e=e.$$typeof,e===ue)return 11;if(e===ce)return 14}return 2}function ni(e,n){var o=e.alternate;return o===null?(o=mr(e.tag,n,e.key,e.mode),o.elementType=e.elementType,o.type=e.type,o.stateNode=e.stateNode,o.alternate=e,e.alternate=o):(o.pendingProps=n,o.type=e.type,o.flags=0,o.subtreeFlags=0,o.deletions=null),o.flags=e.flags&14680064,o.childLanes=e.childLanes,o.lanes=e.lanes,o.child=e.child,o.memoizedProps=e.memoizedProps,o.memoizedState=e.memoizedState,o.updateQueue=e.updateQueue,n=e.dependencies,o.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},o.sibling=e.sibling,o.index=e.index,o.ref=e.ref,o}function $l(e,n,o,l,p,m){var E=2;if(l=e,typeof e=="function")Bc(e)&&(E=1);else if(typeof e=="string")E=5;else e:switch(e){case U:return Ti(o.children,p,m,n);case le:E=8,p|=8;break;case he:return e=mr(12,o,n,p|2),e.elementType=he,e.lanes=m,e;case xe:return e=mr(13,o,n,p),e.elementType=xe,e.lanes=m,e;case D:return e=mr(19,o,n,p),e.elementType=D,e.lanes=m,e;case ae:return Ol(o,p,m,n);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Se:E=10;break e;case q:E=9;break e;case ue:E=11;break e;case ce:E=14;break e;case te:E=16,l=null;break e}throw Error(i(130,e==null?e:typeof e,""))}return n=mr(E,o,n,p),n.elementType=e,n.type=l,n.lanes=m,n}function Ti(e,n,o,l){return e=mr(7,e,l,n),e.lanes=o,e}function Ol(e,n,o,l){return e=mr(22,e,l,n),e.elementType=ae,e.lanes=o,e.stateNode={isHidden:!1},e}function Hc(e,n,o){return e=mr(6,e,null,n),e.lanes=o,e}function Vc(e,n,o){return n=mr(4,e.children!==null?e.children:[],e.key,n),n.lanes=o,n.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},n}function Ly(e,n,o,l,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=io(0),this.expirationTimes=io(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=io(0),this.identifierPrefix=l,this.onRecoverableError=p,this.mutableSourceEagerHydrationData=null}function Kc(e,n,o,l,p,m,E,z,K){return e=new Ly(e,n,o,z,K),n===1?(n=1,m===!0&&(n|=8)):n=0,m=mr(3,null,null,n),e.current=m,m.stateNode=e,m.memoizedState={element:l,isDehydrated:o,cache:null,transitions:null,pendingSuspenseBoundaries:null},rc(m),e}function Fy(e,n,o){var l=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:V,key:l==null?null:""+l,children:e,containerInfo:n,implementation:o}}function Op(e){if(!e)return Wo;e=e._reactInternals;e:{if(Yt(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(Dn(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(Dn(o))return ud(e,o,n)}return n}function Rp(e,n,o,l,p,m,E,z,K){return e=Kc(o,l,!0,e,p,m,E,z,K),e.context=Op(null),o=e.current,l=Pn(),p=ei(o),m=bo(l,p),m.callback=n??null,Qo(o,m,p),e.current.lanes=p,ur(e,p,l),Bn(e,l),e}function Rl(e,n,o,l){var p=n.current,m=Pn(),E=ei(p);return o=Op(o),n.context===null?n.context=o:n.pendingContext=o,n=bo(m,E),n.payload={element:e},l=l===void 0?null:l,l!==null&&(n.callback=l),e=Qo(p,n,E),e!==null&&(Mr(e,p,E,m),pl(e,p,E)),E}function zl(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 zp(e,n){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var o=e.retryLane;e.retryLane=o!==0&&o<n?o:n}}function Uc(e,n){zp(e,n),(e=e.alternate)&&zp(e,n)}function By(){return null}var Dp=typeof reportError=="function"?reportError:function(e){console.error(e)};function qc(e){this._internalRoot=e}Dl.prototype.render=qc.prototype.render=function(e){var n=this._internalRoot;if(n===null)throw Error(i(409));Rl(e,n,null,null)},Dl.prototype.unmount=qc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var n=e.containerInfo;Pi(function(){Rl(null,e,null,null)}),n[vo]=null}};function Dl(e){this._internalRoot=e}Dl.prototype.unstable_scheduleHydration=function(e){if(e){var n=Ha();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&&Yn(e)}};function Wc(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Ll(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Lp(){}function Hy(e,n,o,l,p){if(p){if(typeof l=="function"){var m=l;l=function(){var ye=zl(E);m.call(ye)}}var E=Rp(n,l,e,0,null,!1,!1,"",Lp);return e._reactRootContainer=E,e[vo]=E.current,Gs(e.nodeType===8?e.parentNode:e),Pi(),E}for(;p=e.lastChild;)e.removeChild(p);if(typeof l=="function"){var z=l;l=function(){var ye=zl(K);z.call(ye)}}var K=Kc(e,0,!1,null,null,!1,!1,"",Lp);return e._reactRootContainer=K,e[vo]=K.current,Gs(e.nodeType===8?e.parentNode:e),Pi(function(){Rl(n,K,o,l)}),K}function Fl(e,n,o,l,p){var m=o._reactRootContainer;if(m){var E=m;if(typeof p=="function"){var z=p;p=function(){var K=zl(E);z.call(K)}}Rl(n,E,e,p)}else E=Hy(o,n,e,p,l);return zl(E)}mt=function(e){switch(e.tag){case 3:var n=e.stateNode;if(n.current.memoizedState.isDehydrated){var o=Wn(n.pendingLanes);o!==0&&($o(n,o|1),Bn(n,yt()),(xt&6)===0&&(xs=yt()+500,Yo()))}break;case 13:Pi(function(){var l=So(e,1);if(l!==null){var p=Pn();Mr(l,e,1,p)}}),Uc(e,1)}},Hi=function(e){if(e.tag===13){var n=So(e,134217728);if(n!==null){var o=Pn();Mr(n,e,134217728,o)}Uc(e,134217728)}},Ba=function(e){if(e.tag===13){var n=ei(e),o=So(e,n);if(o!==null){var l=Pn();Mr(o,e,n,l)}Uc(e,n)}},Ha=function(){return wt},gn=function(e,n){var o=wt;try{return wt=e,n()}finally{wt=o}},Fe=function(e,n,o){switch(n){case"input":if(kt(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 l=o[n];if(l!==e&&l.form===e.form){var p=rl(l);if(!p)throw Error(i(90));Le(l),kt(l,p)}}}break;case"textarea":gr(e,o);break;case"select":n=o.value,n!=null&&Et(e,!!o.multiple,n,!1)}},ht=Dc,pn=Pi;var Vy={usingClientEntryPoint:!1,Events:[ea,ss,rl,He,Je,Dc]},ha={findFiberByHostInstance:wi,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Ky={bundleType:ha.bundleType,version:ha.version,rendererPackageName:ha.rendererPackageName,rendererConfig:ha.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=li(e),e===null?null:e.stateNode},findFiberByHostInstance:ha.findFiberByHostInstance||By,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 Bl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Bl.isDisabled&&Bl.supportsFiber)try{ar=Bl.inject(Ky),Nn=Bl}catch{}}return Hn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Vy,Hn.createPortal=function(e,n){var o=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Wc(n))throw Error(i(200));return Fy(e,n,null,o)},Hn.createRoot=function(e,n){if(!Wc(e))throw Error(i(299));var o=!1,l="",p=Dp;return n!=null&&(n.unstable_strictMode===!0&&(o=!0),n.identifierPrefix!==void 0&&(l=n.identifierPrefix),n.onRecoverableError!==void 0&&(p=n.onRecoverableError)),n=Kc(e,1,!1,null,null,o,!1,l,p),e[vo]=n.current,Gs(e.nodeType===8?e.parentNode:e),new qc(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=li(n),e=e===null?null:e.stateNode,e},Hn.flushSync=function(e){return Pi(e)},Hn.hydrate=function(e,n,o){if(!Ll(n))throw Error(i(200));return Fl(null,e,n,!0,o)},Hn.hydrateRoot=function(e,n,o){if(!Wc(e))throw Error(i(405));var l=o!=null&&o.hydratedSources||null,p=!1,m="",E=Dp;if(o!=null&&(o.unstable_strictMode===!0&&(p=!0),o.identifierPrefix!==void 0&&(m=o.identifierPrefix),o.onRecoverableError!==void 0&&(E=o.onRecoverableError)),n=Rp(n,null,e,1,o??null,p,!1,m,E),e[vo]=n.current,Gs(e),l)for(e=0;e<l.length;e++)o=l[e],p=o._getVersion,p=p(o._source),n.mutableSourceEagerHydrationData==null?n.mutableSourceEagerHydrationData=[o,p]:n.mutableSourceEagerHydrationData.push(o,p);return new Dl(n)},Hn.render=function(e,n,o){if(!Ll(n))throw Error(i(200));return Fl(null,e,n,!1,o)},Hn.unmountComponentAtNode=function(e){if(!Ll(e))throw Error(i(40));return e._reactRootContainer?(Pi(function(){Fl(null,null,e,!1,function(){e._reactRootContainer=null,e[vo]=null})}),!0):!1},Hn.unstable_batchedUpdates=Dc,Hn.unstable_renderSubtreeIntoContainer=function(e,n,o,l){if(!Ll(o))throw Error(i(200));if(e==null||e._reactInternals===void 0)throw Error(i(38));return Fl(e,n,o,!1,l)},Hn.version="18.3.1-next-f1338f8080-20240426",Hn}var Wp;function lm(){if(Wp)return Qc.exports;Wp=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(),Qc.exports=e0(),Qc.exports}var Yp;function t0(){if(Yp)return Hl;Yp=1;var t=lm();return Hl.createRoot=t.createRoot,Hl.hydrateRoot=t.hydrateRoot,Hl}var n0=t0();const r0=yu(n0),o0=["get","post","put","patch","delete","options","head","trace"];function Xp(t){return t.replace(/[^a-zA-Z0-9]+/g,"_").replace(/^_|_$/g,"").replace(/_+/g,"_")}function vu(t,r,i,a){if(i)return Xp(i).replace(/^[0-9]/,"_$&")||`op_${a}`;const u=Xp(r.replace(/[{}]/g,""));return`${t}_${u}`||`op_${a}`}function xu(t){var a;return`${(((a=t.info)==null?void 0:a.title)??"Api").replace(/[^a-zA-Z0-9]+/g," ").trim().split(/\s+/).filter(Boolean).map(u=>u.charAt(0).toUpperCase()+u.slice(1).toLowerCase()).join("")||"Api"}Client`}function wu(t){return(t.split(/[^a-zA-Z0-9]+/).filter(Boolean).map(i=>i.charAt(0).toUpperCase()+i.slice(1).toLowerCase()).join("")||"Api")+"Service"}function Jr(t){const r=[];if(!t.paths)return r;for(const[i,a]of Object.entries(t.paths)){if(!a||typeof a!="object"||"$ref"in a)continue;const u=a;for(const f of o0){const d=u[f];d&&typeof d=="object"&&r.push({method:f,path:i,operationId:d.operationId,tags:d.tags})}}return r}function i0(t,r,i,a="baseUrl"){var f,d;const u=r.toUpperCase();return`const ${a} = "${((d=(f=t.servers)==null?void 0:f[0])==null?void 0:d.url)??"http://localhost:3000"}";
41
+ /** @returns {Promise<unknown>} */
42
+ const res = await fetch(\`${a}${i}\`, {
43
+ method: "${u}",
44
+ headers: { "Content-Type": "application/json", Authorization: \`Bearer \${token}\` },
45
+ ${u==="GET"||u==="HEAD"?"":"body: JSON.stringify({}),"}
46
+ });
47
+ const data = await res.json();
48
+ `}function um(t,r){const i=t.map((a,u)=>` /**
49
+ * @param {{ headers?: Record<string, string> }} [options]
50
+ * @returns {Promise<unknown>}
51
+ */
52
+ async ${vu(a.method,a.path,a.operationId,u)}(options) {
53
+ const res = await fetch(\`\${this.baseUrl}${a.path}\`, {
54
+ method: "${a.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 s0(t){return um(Jr(t),xu(t))}function a0(t,r){const i=wu(r),a=Jr(t).filter(u=>{var f;return(f=u.tags)==null?void 0:f.includes(r)});return um(a,i)}function l0(t,r,i){var f,d;const a=((d=(f=t.servers)==null?void 0:f[0])==null?void 0:d.url)??"http://localhost:3000",u=r.toUpperCase();return`<?php
73
+ $baseUrl = '${a}';
74
+ $url = $baseUrl . '${i}';
75
+ $opts = [
76
+ 'http' => [
77
+ 'method' => '${u}',
78
+ 'header' => "Content-Type: application/json\\r\\nAuthorization: Bearer {$token}\\r\\n",
79
+ ${u==="GET"||u==="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 cm(t,r){const i=t.map((a,u)=>` public function ${vu(a.method,a.path,a.operationId,u)}(array $extraHeaders = []): array
86
+ {
87
+ $url = $this->baseUrl . '${a.path}';
88
+ $headers = array_merge($this->defaultHeaders, $extraHeaders);
89
+ $opts = [
90
+ 'http' => [
91
+ 'method' => '${a.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 u0(t){return cm(Jr(t),xu(t))}function c0(t,r){const i=wu(r),a=Jr(t).filter(u=>{var f;return(f=u.tags)==null?void 0:f.includes(r)});return cm(a,i)}function f0(t,r,i){var d,g;const a=((g=(d=t.servers)==null?void 0:d[0])==null?void 0:g.url)??"http://localhost:3000",u=r.toLowerCase();return`import httpx
127
+
128
+ base_url = "${a}"
129
+ url = f"{base_url}${i}"
130
+ headers = {"Authorization": f"Bearer {token}"}
131
+ with httpx.Client() as client:
132
+ response = client.${u}(url, headers=headers${u==="get"||u==="head"?"":", json={}"})
133
+ data = response.json()
134
+ `}function fm(t,r){const i=t.map((a,u)=>{const f=vu(a.method,a.path,a.operationId,u),d=a.method.toLowerCase(),g=d==="get"||d==="head"?"":", json={}";return` def ${f}(self, headers: dict | None = None) -> dict:
135
+ h = {**self.default_headers, **(headers or {})}
136
+ r = self._client.${d}(f"{self.base_url}${a.path}", headers=h${g})
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 d0(t){return fm(Jr(t),xu(t))}function p0(t,r){const i=wu(r),a=Jr(t).filter(u=>{var f;return(f=u.tags)==null?void 0:f.includes(r)});return fm(a,i)}function h0(t){const r=t.split("/");return(r[r.length-1]??"Unknown").replace(/[^a-zA-Z0-9_]/g,"_")}function gf(t){if(!t)return"unknown";if("$ref"in t&&t.$ref)return h0(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?`${gf(r.items)}[]`:r.type==="object"&&r.properties?`{
153
+ ${Object.entries(r.properties).map(([a,u])=>` ${JSON.stringify(a)}?: ${gf(u)};`).join(`
154
+ `)}
155
+ }`:"Record<string, unknown>"}function m0(t,r,i,a="baseUrl"){var w,S,x,b,N,C;const u=(S=(w=t.paths)==null?void 0:w[i])==null?void 0:S[r],f=u==null?void 0:u.requestBody;let d;if((b=(x=f==null?void 0:f.content)==null?void 0:x["application/json"])!=null&&b.schema){const A=f.content["application/json"].schema;A&&!("$ref"in A)&&(d=A)}const g=d?gf(d):"Record<string, unknown>",v=r.toUpperCase();return`const ${a} = "${((C=(N=t.servers)==null?void 0:N[0])==null?void 0:C.url)??"http://localhost:3000"}";
156
+ const res = await fetch(\`${a}${i}\`, {
157
+ method: "${v}",
158
+ headers: { "Content-Type": "application/json", Authorization: \`Bearer \${token}\` },
159
+ ${v==="GET"||v==="HEAD"?"":`body: JSON.stringify({} as ${g}),`}
160
+ });
161
+ const data = await res.json() as unknown;
162
+ `}function dm(t,r){const i=t.map((a,u)=>` async ${vu(a.method,a.path,a.operationId,u)}(options?: { headers?: Record<string, string> }): Promise<unknown> {
163
+ const res = await fetch(\`\${this.baseUrl}${a.path}\`, {
164
+ method: "${a.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 g0(t){const r=Jr(t),i=xu(t);return dm(r,i)}function y0(t,r){const i=wu(r),a=Jr(t).filter(u=>{var f;return(f=u.tags)==null?void 0:f.includes(r)});return dm(a,i)}function v0(t,r,i,a){switch(r){case"typescript":return m0(t,i,a);case"javascript":return i0(t,i,a);case"python":return f0(t,i,a);case"php":return l0(t,i,a);default:{const u=r;throw new Error(`Unsupported language: ${u}`)}}}function x0(t,r,i){switch(r){case"typescript":return y0(t,i);case"javascript":return a0(t,i);case"python":return p0(t,i);case"php":return c0(t,i);default:{const a=r;throw new Error(`Unsupported language: ${a}`)}}}function w0(t,r,i){if(i===null)switch(r){case"typescript":return g0(t);case"javascript":return s0(t);case"python":return d0(t);case"php":return u0(t);default:{const a=r;throw new Error(`Unsupported language: ${a}`)}}return x0(t,r,i)}function _0(t){const r=new Set;for(const i of Jr(t))for(const a of i.tags??[])r.add(a);return r.size===0&&r.add("default"),[...r].sort()}function _s(t,r){var i,a,u;return r!=null&&r.trim()?r.replace(/\/$/,""):((u=(a=(i=t.servers)==null?void 0:i[0])==null?void 0:a.url)==null?void 0:u.replace(/\/$/,""))??window.location.origin}function S0(t){var i;const r=(i=t.components)==null?void 0:i.securitySchemes;return r?Object.keys(r):[]}function Af(t,r){if(!r.startsWith("$"))return;let i=t;const a=r.slice(1);if(a.startsWith(".")){for(const u of a.slice(1).split("."))if(i&&typeof i=="object"&&u in i)i=i[u];else return;return i}return i}var Zl={exports:{}},b0=Zl.exports,Qp;function k0(){return Qp||(Qp=1,(function(t,r){((i,a)=>{t.exports=a()})(b0,function(){var i=function(s,c){return(i=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(h,y){h.__proto__=y}:function(h,y){for(var _ in y)Object.prototype.hasOwnProperty.call(y,_)&&(h[_]=y[_])}))(s,c)},a=function(){return(a=Object.assign||function(s){for(var c,h=1,y=arguments.length;h<y;h++)for(var _ in c=arguments[h])Object.prototype.hasOwnProperty.call(c,_)&&(s[_]=c[_]);return s}).apply(this,arguments)};function u(s,c,h){for(var y,_=0,k=c.length;_<k;_++)!y&&_ in c||((y=y||Array.prototype.slice.call(c,0,_))[_]=c[_]);return s.concat(y||Array.prototype.slice.call(c))}var f=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:Yy,d=Object.keys,g=Array.isArray;function v(s,c){return typeof c=="object"&&d(c).forEach(function(h){s[h]=c[h]}),s}typeof Promise>"u"||f.Promise||(f.Promise=Promise);var w=Object.getPrototypeOf,S={}.hasOwnProperty;function x(s,c){return S.call(s,c)}function b(s,c){typeof c=="function"&&(c=c(w(s))),(typeof Reflect>"u"?d:Reflect.ownKeys)(c).forEach(function(h){C(s,h,c[h])})}var N=Object.defineProperty;function C(s,c,h,y){N(s,c,v(h&&x(h,"get")&&typeof h.get=="function"?{get:h.get,set:h.set,configurable:!0}:{value:h,configurable:!0,writable:!0},y))}function A(s){return{from:function(c){return s.prototype=Object.create(c.prototype),C(s.prototype,"constructor",s),{extend:b.bind(null,s.prototype)}}}}var T=Object.getOwnPropertyDescriptor,$=[].slice;function H(s,c,h){return $.call(s,c,h)}function M(s,c){return c(s)}function R(s){if(!s)throw new Error("Assertion Failed")}function Y(s){f.setImmediate?setImmediate(s):setTimeout(s,0)}function V(s,c){if(typeof c=="string"&&x(s,c))return s[c];if(!c)return s;if(typeof c!="string"){for(var h=[],y=0,_=c.length;y<_;++y){var k=V(s,c[y]);h.push(k)}return h}var j,I=c.indexOf(".");return I===-1||(j=s[c.substr(0,I)])==null?void 0:V(j,c.substr(I+1))}function U(s,c,h){if(s&&c!==void 0&&!("isFrozen"in Object&&Object.isFrozen(s)))if(typeof c!="string"&&"length"in c){R(typeof h!="string"&&"length"in h);for(var y=0,_=c.length;y<_;++y)U(s,c[y],h[y])}else{var k,j,I=c.indexOf(".");I!==-1?(k=c.substr(0,I),(I=c.substr(I+1))===""?h===void 0?g(s)&&!isNaN(parseInt(k))?s.splice(k,1):delete s[k]:s[k]=h:U(j=(j=s[k])&&x(s,k)?j:s[k]={},I,h)):h===void 0?g(s)&&!isNaN(parseInt(c))?s.splice(c,1):delete s[c]:s[c]=h}}function le(s){var c,h={};for(c in s)x(s,c)&&(h[c]=s[c]);return h}var he=[].concat;function Se(s){return he.apply([],s)}var B="BigUint64Array,BigInt64Array,Array,Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,FileSystemDirectoryHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(Se([8,16,32,64].map(function(s){return["Int","Uint","Float"].map(function(c){return c+s+"Array"})}))).filter(function(s){return f[s]}),q=new Set(B.map(function(s){return f[s]})),ue=null;function xe(s){return ue=new WeakMap,s=(function c(h){if(!h||typeof h!="object")return h;var y=ue.get(h);if(y)return y;if(g(h)){y=[],ue.set(h,y);for(var _=0,k=h.length;_<k;++_)y.push(c(h[_]))}else if(q.has(h.constructor))y=h;else{var j,I=w(h);for(j in y=I===Object.prototype?{}:Object.create(I),ue.set(h,y),h)x(h,j)&&(y[j]=c(h[j]))}return y})(s),ue=null,s}var D={}.toString;function ce(s){return D.call(s).slice(8,-1)}var te=typeof Symbol<"u"?Symbol.iterator:"@@iterator",ae=typeof te=="symbol"?function(s){var c;return s!=null&&(c=s[te])&&c.apply(s)}:function(){return null};function L(s,c){c=s.indexOf(c),0<=c&&s.splice(c,1)}var F={};function Q(s){var c,h,y,_;if(arguments.length===1){if(g(s))return s.slice();if(this===F&&typeof s=="string")return[s];if(_=ae(s))for(h=[];!(y=_.next()).done;)h.push(y.value);else{if(s==null)return[s];if(typeof(c=s.length)!="number")return[s];for(h=new Array(c);c--;)h[c]=s[c]}}else for(c=arguments.length,h=new Array(c);c--;)h[c]=arguments[c];return h}var O=typeof Symbol<"u"?function(s){return s[Symbol.toStringTag]==="AsyncFunction"}:function(){return!1},B=["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(B),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 _e(s,c){this.name=s,this.message=c}function $e(s,c){return s+". Errors: "+Object.keys(c).map(function(h){return c[h].toString()}).filter(function(h,y,_){return _.indexOf(h)===y}).join(`
179
+ `)}function Ie(s,c,h,y){this.failures=c,this.failedKeys=y,this.successCount=h,this.message=$e(s,c)}function Re(s,c){this.name="BulkError",this.failures=Object.keys(c).map(function(h){return c[h]}),this.failuresByPos=c,this.message=$e(s,this.failures)}A(_e).from(Error).extend({toString:function(){return this.name+": "+this.message}}),A(Ie).from(_e),A(Re).from(_e);var we=Nt.reduce(function(s,c){return s[c]=c+"Error",s},{}),De=_e,ke=Nt.reduce(function(s,c){var h=c+"Error";function y(_,k){this.name=h,_?typeof _=="string"?(this.message="".concat(_).concat(k?`
180
+ `+k:""),this.inner=k||null):typeof _=="object"&&(this.message="".concat(_.name," ").concat(_.message),this.inner=_):(this.message=be[c]||h,this.inner=null)}return A(y).from(De),s[c]=y,s},{}),Ge=(ke.Syntax=SyntaxError,ke.Type=TypeError,ke.Range=RangeError,B.reduce(function(s,c){return s[c+"Error"]=ke[c],s},{}));B=Nt.reduce(function(s,c){return["Syntax","Type","Range"].indexOf(c)===-1&&(s[c+"Error"]=ke[c]),s},{});function Le(){}function Be(s){return s}function ut(s,c){return s==null||s===Be?c:function(h){return c(s(h))}}function at(s,c){return function(){s.apply(this,arguments),c.apply(this,arguments)}}function lt(s,c){return s===Le?c:function(){var h=s.apply(this,arguments),y=(h!==void 0&&(arguments[0]=h),this.onsuccess),_=this.onerror,k=(this.onsuccess=null,this.onerror=null,c.apply(this,arguments));return y&&(this.onsuccess=this.onsuccess?at(y,this.onsuccess):y),_&&(this.onerror=this.onerror?at(_,this.onerror):_),k!==void 0?k:h}}function kt(s,c){return s===Le?c:function(){s.apply(this,arguments);var h=this.onsuccess,y=this.onerror;this.onsuccess=this.onerror=null,c.apply(this,arguments),h&&(this.onsuccess=this.onsuccess?at(h,this.onsuccess):h),y&&(this.onerror=this.onerror?at(y,this.onerror):y)}}function Sn(s,c){return s===Le?c:function(_){var y=s.apply(this,arguments),_=(v(_,y),this.onsuccess),k=this.onerror,j=(this.onsuccess=null,this.onerror=null,c.apply(this,arguments));return _&&(this.onsuccess=this.onsuccess?at(_,this.onsuccess):_),k&&(this.onerror=this.onerror?at(k,this.onerror):k),y===void 0?j===void 0?void 0:j:v(y,j)}}function rn(s,c){return s===Le?c:function(){return c.apply(this,arguments)!==!1&&s.apply(this,arguments)}}function qt(s,c){return s===Le?c:function(){var h=s.apply(this,arguments);if(h&&typeof h.then=="function"){for(var y=this,_=arguments.length,k=new Array(_);_--;)k[_]=arguments[_];return h.then(function(){return c.apply(y,k)})}return c.apply(this,arguments)}}B.ModifyError=Ie,B.DexieError=_e,B.BulkError=Re;var Et=typeof location<"u"&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function jn(s){Et=s}var on={},gr=100,bn=typeof Promise>"u"?[]:(Nt=Promise.resolve(),typeof crypto<"u"&&crypto.subtle?[bn=crypto.subtle.digest("SHA-512",new Uint8Array([0])),w(bn),Nt]:[Nt,w(Nt),Nt]),Nt=bn[0],po=bn[1],po=po&&po.then,Wt=Nt&&Nt.constructor,Kn=!!bn[2],sn=function(s,c){qn.push([s,c]),Mn&&(queueMicrotask(pn),Mn=!1)},an=!0,Mn=!0,Un=[],yr=[],Rr=Be,kn={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:Le,pgp:!1,env:{},finalize:Le},qe=kn,qn=[],En=0,er=[];function Fe(s){if(typeof this!="object")throw new TypeError("Promises must be constructed via new");this._listeners=[],this._lib=!1;var c=this._PSD=qe;if(typeof s!="function"){if(s!==on)throw new TypeError("Not a function");this._state=arguments[1],this._value=arguments[2],this._state===!1&&X(this,this._value)}else this._state=null,this._value=null,++c.ref,(function h(y,_){try{_(function(k){if(y._state===null){if(k===y)throw new TypeError("A promise cannot be resolved with itself.");var j=y._lib&&Bt();k&&typeof k.then=="function"?h(y,function(I,G){k instanceof Fe?k._then(I,G):k.then(I,G)}):(y._state=!0,y._value=k,He(y)),j&&Ht()}},X.bind(null,y))}catch(k){X(y,k)}})(this,s)}var Tn={get:function(){var s=qe,c=nr;function h(y,_){var k=this,j=!s.global&&(s!==qe||c!==nr),I=j&&!Yt(),G=new Fe(function(se,J){Je(k,new In(ui(y,s,j,I),ui(_,s,j,I),se,J,s))});return this._consoleTask&&(G._consoleTask=this._consoleTask),G}return h.prototype=on,h},set:function(s){C(this,"then",s&&s.prototype===on?Tn:{get:function(){return s},set:Tn.set})}};function In(s,c,h,y,_){this.onFulfilled=typeof s=="function"?s:null,this.onRejected=typeof c=="function"?c:null,this.resolve=h,this.reject=y,this.psd=_}function X(s,c){var h,y;yr.push(c),s._state===null&&(h=s._lib&&Bt(),c=Rr(c),s._state=!1,s._value=c,y=s,Un.some(function(_){return _._value===y._value})||Un.push(y),He(s),h)&&Ht()}function He(s){var c=s._listeners;s._listeners=[];for(var h=0,y=c.length;h<y;++h)Je(s,c[h]);var _=s._PSD;--_.ref||_.finalize(),En===0&&(++En,sn(function(){--En==0&&Gt()},[]))}function Je(s,c){if(s._state===null)s._listeners.push(c);else{var h=s._state?c.onFulfilled:c.onRejected;if(h===null)return(s._state?c.resolve:c.reject)(s._value);++c.psd.ref,++En,sn(ht,[h,s,c])}}function ht(s,c,h){try{var y,_=c._value;!c._state&&yr.length&&(yr=[]),y=Et&&c._consoleTask?c._consoleTask.run(function(){return s(_)}):s(_),c._state||yr.indexOf(_)!==-1||(k=>{for(var j=Un.length;j;)if(Un[--j]._value===k._value)return Un.splice(j,1)})(c),h.resolve(y)}catch(k){h.reject(k)}finally{--En==0&&Gt(),--h.psd.ref||h.psd.finalize()}}function pn(){ir(kn,function(){Bt()&&Ht()})}function Bt(){var s=an;return Mn=an=!1,s}function Ht(){var s,c,h;do for(;0<qn.length;)for(s=qn,qn=[],h=s.length,c=0;c<h;++c){var y=s[c];y[0].apply(null,y[1])}while(0<qn.length);Mn=an=!0}function Gt(){for(var s=Un,c=(Un=[],s.forEach(function(y){y._PSD.onunhandled.call(null,y._value,y)}),er.slice(0)),h=c.length;h;)c[--h]()}function An(s){return new Fe(on,!1,s)}function pt(s,c){var h=qe;return function(){var y=Bt(),_=qe;try{return or(h,!0),s.apply(this,arguments)}catch(k){c&&c(k)}finally{or(_,!1),y&&Ht()}}}b(Fe.prototype,{then:Tn,_then:function(s,c){Je(this,new In(null,null,s,c,qe))},catch:function(s){var c,h;return arguments.length===1?this.then(null,s):(c=s,h=arguments[1],typeof c=="function"?this.then(null,function(y){return(y instanceof c?h:An)(y)}):this.then(null,function(y){return(y&&y.name===c?h:An)(y)}))},finally:function(s){return this.then(function(c){return Fe.resolve(s()).then(function(){return c})},function(c){return Fe.resolve(s()).then(function(){return An(c)})})},timeout:function(s,c){var h=this;return s<1/0?new Fe(function(y,_){var k=setTimeout(function(){return _(new ke.Timeout(c))},s);h.then(y,_).finally(clearTimeout.bind(null,k))}):this}}),typeof Symbol<"u"&&Symbol.toStringTag&&C(Fe.prototype,Symbol.toStringTag,"Dexie.Promise"),kn.env=li(),b(Fe,{all:function(){var s=Q.apply(null,arguments).map(Dr);return new Fe(function(c,h){s.length===0&&c([]);var y=s.length;s.forEach(function(_,k){return Fe.resolve(_).then(function(j){s[k]=j,--y||c(s)},h)})})},resolve:function(s){return s instanceof Fe?s:s&&typeof s.then=="function"?new Fe(function(c,h){s.then(c,h)}):new Fe(on,!0,s)},reject:An,race:function(){var s=Q.apply(null,arguments).map(Dr);return new Fe(function(c,h){s.map(function(y){return Fe.resolve(y).then(c,h)})})},PSD:{get:function(){return qe},set:function(s){return qe=s}},totalEchoes:{get:function(){return nr}},newPSD:rr,usePSD:ir,scheduler:{get:function(){return sn},set:function(s){sn=s}},rejectionMapper:{get:function(){return Rr},set:function(s){Rr=s}},follow:function(s,c){return new Fe(function(h,y){return rr(function(_,k){var j=qe;j.unhandleds=[],j.onunhandled=k,j.finalize=at(function(){var I,G=this;I=function(){G.unhandleds.length===0?_():k(G.unhandleds[0])},er.push(function se(){I(),er.splice(er.indexOf(se),1)}),++En,sn(function(){--En==0&&Gt()},[])},j.finalize),s()},c,h,y)})}}),Wt&&(Wt.allSettled&&C(Fe,"allSettled",function(){var s=Q.apply(null,arguments).map(Dr);return new Fe(function(c){s.length===0&&c([]);var h=s.length,y=new Array(h);s.forEach(function(_,k){return Fe.resolve(_).then(function(j){return y[k]={status:"fulfilled",value:j}},function(j){return y[k]={status:"rejected",reason:j}}).then(function(){return--h||c(y)})})})}),Wt.any&&typeof AggregateError<"u"&&C(Fe,"any",function(){var s=Q.apply(null,arguments).map(Dr);return new Fe(function(c,h){s.length===0&&h(new AggregateError([]));var y=s.length,_=new Array(y);s.forEach(function(k,j){return Fe.resolve(k).then(function(I){return c(I)},function(I){_[j]=I,--y||h(new AggregateError(_))})})})}),Wt.withResolvers)&&(Fe.withResolvers=Wt.withResolvers);var Ct={awaits:0,echoes:0,id:0},tr=0,$n=[],hn=0,nr=0,Os=0;function rr(s,j,h,y){var _=qe,k=Object.create(_),j=(k.parent=_,k.ref=0,k.global=!1,k.id=++Os,kn.env,k.env=Kn?{Promise:Fe,PromiseProp:{value:Fe,configurable:!0,writable:!0},all:Fe.all,race:Fe.race,allSettled:Fe.allSettled,any:Fe.any,resolve:Fe.resolve,reject:Fe.reject}:{},j&&v(k,j),++_.ref,k.finalize=function(){--this.parent.ref||this.parent.finalize()},ir(k,s,h,y));return k.ref===0&&k.finalize(),j}function zr(){return Ct.id||(Ct.id=++tr),++Ct.awaits,Ct.echoes+=gr,Ct.id}function Yt(){return!!Ct.awaits&&(--Ct.awaits==0&&(Ct.id=0),Ct.echoes=Ct.awaits*gr,!0)}function Dr(s){return Ct.echoes&&s&&s.constructor===Wt?(zr(),s.then(function(c){return Yt(),c},function(c){return Yt(),Pt(c)})):s}function ai(){var s=$n[$n.length-1];$n.pop(),or(s,!1)}function or(s,c){var h,y,_=qe;(c?!Ct.echoes||hn++&&s===qe:!hn||--hn&&s===qe)||queueMicrotask(c?(function(k){++nr,Ct.echoes&&--Ct.echoes!=0||(Ct.echoes=Ct.awaits=Ct.id=0),$n.push(qe),or(k,!0)}).bind(null,s):ai),s!==qe&&(qe=s,_===kn&&(kn.env=li()),Kn)&&(h=kn.env.Promise,y=s.env,_.global||s.global)&&(Object.defineProperty(f,"Promise",y.PromiseProp),h.all=y.all,h.race=y.race,h.resolve=y.resolve,h.reject=y.reject,y.allSettled&&(h.allSettled=y.allSettled),y.any)&&(h.any=y.any)}function li(){var s=f.Promise;return Kn?{Promise:s,PromiseProp:Object.getOwnPropertyDescriptor(f,"Promise"),all:s.all,race:s.race,allSettled:s.allSettled,any:s.any,resolve:s.resolve,reject:s.reject}:{}}function ir(s,c,h,y,_){var k=qe;try{return or(s,!0),c(h,y,_)}finally{or(k,!1)}}function ui(s,c,h,y){return typeof s!="function"?s:function(){var _=qe;h&&zr(),or(c,!0);try{return s.apply(this,arguments)}finally{or(_,!1),y&&queueMicrotask(Yt)}}}function To(s){Promise===Wt&&Ct.echoes===0?hn===0?s():enqueueNativeMicroTask(s):setTimeout(s,0)}(""+po).indexOf("[native code]")===-1&&(zr=Yt=Le);var Pt=Fe.reject,sr="￿",yt="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",Fi="String expected.",Lr="__dbnames",Io="readonly",Fr="readwrite";function vr(s,c){return s?c?function(){return s.apply(this,arguments)&&c.apply(this,arguments)}:s:c}var ci={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function ar(s){return typeof s!="string"||/\./.test(s)?function(c){return c}:function(c){return c[s]===void 0&&s in c&&delete(c=xe(c))[s],c}}function Nn(){throw ke.Type("Entity instances must never be new:ed. Instances are generated by the framework bypassing the constructor.")}function ct(s,c){try{var h=mn(s),y=mn(c);if(h!==y)return h==="Array"?1:y==="Array"?-1:h==="binary"?1:y==="binary"?-1:h==="string"?1:y==="string"?-1:h==="Date"?1:y!=="Date"?NaN:-1;switch(h){case"number":case"Date":case"string":return c<s?1:s<c?-1:0;case"binary":for(var _=Bi(s),k=Bi(c),j=_.length,I=k.length,G=j<I?j:I,se=0;se<G;++se)if(_[se]!==k[se])return _[se]<k[se]?-1:1;return j===I?0:j<I?-1:1;case"Array":for(var J=s,W=c,Z=J.length,ie=W.length,re=Z<ie?Z:ie,ne=0;ne<re;++ne){var oe=ct(J[ne],W[ne]);if(oe!==0)return oe}return Z===ie?0:Z<ie?-1:1}}catch{}return NaN}function mn(s){var c=typeof s;return c=="object"&&(ArrayBuffer.isView(s)||(c=ce(s))==="ArrayBuffer")?"binary":c}function Bi(s){return s instanceof Uint8Array?s:ArrayBuffer.isView(s)?new Uint8Array(s.buffer,s.byteOffset,s.byteLength):new Uint8Array(s)}function Ao(s,c,h){var y=s.schema.yProps;return y?(c&&0<h.numFailures&&(c=c.filter(function(_,k){return!h.failures[k]})),Promise.all(y.map(function(_){return _=_.updatesTable,c?s.db.table(_).where("k").anyOf(c).delete():s.db.table(_).clear()})).then(function(){return h})):h}no.prototype.execute=function(s){var c=this["@@propmod"];if(c.add!==void 0){var h=c.add;if(g(h))return u(u([],g(s)?s:[],!0),h).sort();if(typeof h=="number")return(Number(s)||0)+h;if(typeof h=="bigint")try{return BigInt(s)+h}catch{return BigInt(0)+h}throw new TypeError("Invalid term ".concat(h))}if(c.remove!==void 0){var y=c.remove;if(g(y))return g(s)?s.filter(function(_){return!y.includes(_)}).sort():[];if(typeof y=="number")return Number(s)-y;if(typeof y=="bigint")try{return BigInt(s)-y}catch{return BigInt(0)-y}throw new TypeError("Invalid subtrahend ".concat(y))}return h=(h=c.replacePrefix)==null?void 0:h[0],h&&typeof s=="string"&&s.startsWith(h)?c.replacePrefix[1]+s.substring(h.length):s};var to=no;function no(s){this["@@propmod"]=s}function ro(s,c){for(var h=d(c),y=h.length,_=!1,k=0;k<y;++k){var j=h[k],I=c[j],G=V(s,j);I instanceof to?(U(s,j,I.execute(G)),_=!0):G!==I&&(U(s,j,I),_=!0)}return _}vt.prototype._trans=function(s,c,h){var y=this._tx||qe.trans,_=this.name,k=Et&&typeof console<"u"&&console.createTask&&console.createTask("Dexie: ".concat(s==="readonly"?"read":"write"," ").concat(this.name));function j(se,J,W){if(W.schema[_])return c(W.idbtrans,W);throw new ke.NotFound("Table "+_+" not part of transaction")}var I=Bt();try{var G=y&&y.db._novip===this.db._novip?y===qe.trans?y._promise(s,j,h):rr(function(){return y._promise(s,j,h)},{trans:y,transless:qe.transless||qe}):(function se(J,W,Z,ie){if(J.idbdb&&(J._state.openComplete||qe.letThrough||J._vip)){var re=J._createTransaction(W,Z,J._dbSchema);try{re.create(),J._state.PR1398_maxLoop=3}catch(ne){return ne.name===we.InvalidState&&J.isOpen()&&0<--J._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),J.close({disableAutoOpen:!1}),J.open().then(function(){return se(J,W,Z,ie)})):Pt(ne)}return re._promise(W,function(ne,oe){return rr(function(){return qe.trans=re,ie(ne,oe,re)})}).then(function(ne){if(W==="readwrite")try{re.idbtrans.commit()}catch{}return W==="readonly"?ne:re._completion.then(function(){return ne})})}if(J._state.openComplete)return Pt(new ke.DatabaseClosed(J._state.dbOpenError));if(!J._state.isBeingOpened){if(!J._state.autoOpen)return Pt(new ke.DatabaseClosed);J.open().catch(Le)}return J._state.dbReadyPromise.then(function(){return se(J,W,Z,ie)})})(this.db,s,[this.name],j);return k&&(G._consoleTask=k,G=G.catch(function(se){return console.trace(se),Pt(se)})),G}finally{I&&Ht()}},vt.prototype.get=function(s,c){var h=this;return s&&s.constructor===Object?this.where(s).first(c):s==null?Pt(new ke.Type("Invalid argument to Table.get()")):this._trans("readonly",function(y){return h.core.get({trans:y,key:s}).then(function(_){return h.hook.reading.fire(_)})}).then(c)},vt.prototype.where=function(s){if(typeof s=="string")return new this.db.WhereClause(this,s);if(g(s))return new this.db.WhereClause(this,"[".concat(s.join("+"),"]"));var c=d(s);if(c.length===1)return this.where(c[0]).equals(s[c[0]]);var h=this.schema.indexes.concat(this.schema.primKey).filter(function(I){if(I.compound&&c.every(function(se){return 0<=I.keyPath.indexOf(se)})){for(var G=0;G<c.length;++G)if(c.indexOf(I.keyPath[G])===-1)return!1;return!0}return!1}).sort(function(I,G){return I.keyPath.length-G.keyPath.length})[0];if(h&&this.db._maxKey!==sr)return j=h.keyPath.slice(0,c.length),this.where(j).equals(j.map(function(I){return s[I]}));!h&&Et&&console.warn("The query ".concat(JSON.stringify(s)," on ").concat(this.name," would benefit from a ")+"compound index [".concat(c.join("+"),"]"));var y=this.schema.idxByName;function _(I,G){return ct(I,G)===0}var j=c.reduce(function(J,G){var se=J[0],J=J[1],W=y[G],Z=s[G];return[se||W,se||!W?vr(J,W&&W.multi?function(ie){return ie=V(ie,G),g(ie)&&ie.some(function(re){return _(Z,re)})}:function(ie){return _(Z,V(ie,G))}):J]},[null,null]),k=j[0],j=j[1];return k?this.where(k.name).equals(s[k.keyPath]).filter(j):h?this.filter(j):this.where(c).equals("")},vt.prototype.filter=function(s){return this.toCollection().and(s)},vt.prototype.count=function(s){return this.toCollection().count(s)},vt.prototype.offset=function(s){return this.toCollection().offset(s)},vt.prototype.limit=function(s){return this.toCollection().limit(s)},vt.prototype.each=function(s){return this.toCollection().each(s)},vt.prototype.toArray=function(s){return this.toCollection().toArray(s)},vt.prototype.toCollection=function(){return new this.db.Collection(new this.db.WhereClause(this))},vt.prototype.orderBy=function(s){return new this.db.Collection(new this.db.WhereClause(this,g(s)?"[".concat(s.join("+"),"]"):s))},vt.prototype.reverse=function(){return this.toCollection().reverse()},vt.prototype.mapToClass=function(s){for(var c=this.db,h=this.name,y=((this.schema.mappedClass=s).prototype instanceof Nn&&(s=(j=>{var I=J,G=j;if(typeof G!="function"&&G!==null)throw new TypeError("Class extends value "+String(G)+" is not a constructor or null");function se(){this.constructor=I}function J(){return j!==null&&j.apply(this,arguments)||this}return i(I,G),I.prototype=G===null?Object.create(G):(se.prototype=G.prototype,new se),Object.defineProperty(J.prototype,"db",{get:function(){return c},enumerable:!1,configurable:!0}),J.prototype.table=function(){return h},J})(s)),new Set),_=s.prototype;_;_=w(_))Object.getOwnPropertyNames(_).forEach(function(j){return y.add(j)});function k(j){if(!j)return j;var I,G=Object.create(s.prototype);for(I in j)if(!y.has(I))try{G[I]=j[I]}catch{}return G}return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=k,this.hook("reading",k),s},vt.prototype.defineClass=function(){return this.mapToClass(function(s){v(this,s)})},vt.prototype.add=function(s,c){var h=this,y=this.schema.primKey,_=y.auto,k=y.keyPath,j=s;return k&&_&&(j=ar(k)(s)),this._trans("readwrite",function(I){return h.core.mutate({trans:I,type:"add",keys:c!=null?[c]:null,values:[j]})}).then(function(I){return I.numFailures?Fe.reject(I.failures[0]):I.lastResult}).then(function(I){if(k)try{U(s,k,I)}catch{}return I})},vt.prototype.upsert=function(s,c){var h=this,y=this.schema.primKey.keyPath;return this._trans("readwrite",function(_){return h.core.get({trans:_,key:s}).then(function(k){var j=k??{};return ro(j,c),y&&U(j,y,s),h.core.mutate({trans:_,type:"put",values:[j],keys:[s],upsert:!0,updates:{keys:[s],changeSpecs:[c]}}).then(function(I){return I.numFailures?Fe.reject(I.failures[0]):!!k})})})},vt.prototype.update=function(s,c){return typeof s!="object"||g(s)?this.where(":id").equals(s).modify(c):(s=V(s,this.schema.primKey.keyPath))===void 0?Pt(new ke.InvalidArgument("Given object does not contain its primary key")):this.where(":id").equals(s).modify(c)},vt.prototype.put=function(s,c){var h=this,y=this.schema.primKey,_=y.auto,k=y.keyPath,j=s;return k&&_&&(j=ar(k)(s)),this._trans("readwrite",function(I){return h.core.mutate({trans:I,type:"put",values:[j],keys:c!=null?[c]:null})}).then(function(I){return I.numFailures?Fe.reject(I.failures[0]):I.lastResult}).then(function(I){if(k)try{U(s,k,I)}catch{}return I})},vt.prototype.delete=function(s){var c=this;return this._trans("readwrite",function(h){return c.core.mutate({trans:h,type:"delete",keys:[s]}).then(function(y){return Ao(c,[s],y)}).then(function(y){return y.numFailures?Fe.reject(y.failures[0]):void 0})})},vt.prototype.clear=function(){var s=this;return this._trans("readwrite",function(c){return s.core.mutate({trans:c,type:"deleteRange",range:ci}).then(function(h){return Ao(s,null,h)})}).then(function(c){return c.numFailures?Fe.reject(c.failures[0]):void 0})},vt.prototype.bulkGet=function(s){var c=this;return this._trans("readonly",function(h){return c.core.getMany({keys:s,trans:h}).then(function(y){return y.map(function(_){return c.hook.reading.fire(_)})})})},vt.prototype.bulkAdd=function(s,c,h){var y=this,_=Array.isArray(c)?c:void 0,k=(h=h||(_?void 0:c))?h.allKeys:void 0;return this._trans("readwrite",function(j){var I=y.schema.primKey,se=I.auto,I=I.keyPath;if(I&&_)throw new ke.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(_&&_.length!==s.length)throw new ke.InvalidArgument("Arguments objects and keys must have the same length");var G=s.length,se=I&&se?s.map(ar(I)):s;return y.core.mutate({trans:j,type:"add",keys:_,values:se,wantResults:k}).then(function(J){var W=J.numFailures,Z=J.failures;if(W===0)return k?J.results:J.lastResult;throw new Re("".concat(y.name,".bulkAdd(): ").concat(W," of ").concat(G," operations failed"),Z)})})},vt.prototype.bulkPut=function(s,c,h){var y=this,_=Array.isArray(c)?c:void 0,k=(h=h||(_?void 0:c))?h.allKeys:void 0;return this._trans("readwrite",function(j){var I=y.schema.primKey,se=I.auto,I=I.keyPath;if(I&&_)throw new ke.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(_&&_.length!==s.length)throw new ke.InvalidArgument("Arguments objects and keys must have the same length");var G=s.length,se=I&&se?s.map(ar(I)):s;return y.core.mutate({trans:j,type:"put",keys:_,values:se,wantResults:k}).then(function(J){var W=J.numFailures,Z=J.failures;if(W===0)return k?J.results:J.lastResult;throw new Re("".concat(y.name,".bulkPut(): ").concat(W," of ").concat(G," operations failed"),Z)})})},vt.prototype.bulkUpdate=function(s){var c=this,h=this.core,y=s.map(function(j){return j.key}),_=s.map(function(j){return j.changes}),k=[];return this._trans("readwrite",function(j){return h.getMany({trans:j,keys:y,cache:"clone"}).then(function(I){var G=[],se=[],J=(s.forEach(function(W,Z){var ie=W.key,re=W.changes,ne=I[Z];if(ne){for(var oe=0,ge=Object.keys(re);oe<ge.length;oe++){var fe=ge[oe],ve=re[fe];if(fe===c.schema.primKey.keyPath){if(ct(ve,ie)!==0)throw new ke.Constraint("Cannot update primary key in bulkUpdate()")}else U(ne,fe,ve)}k.push(Z),G.push(ie),se.push(ne)}}),G.length);return h.mutate({trans:j,type:"put",keys:G,values:se,updates:{keys:y,changeSpecs:_}}).then(function(W){var Z=W.numFailures,ie=W.failures;if(Z===0)return J;for(var re=0,ne=Object.keys(ie);re<ne.length;re++){var oe,ge=ne[re],fe=k[Number(ge)];fe!=null&&(oe=ie[ge],delete ie[ge],ie[fe]=oe)}throw new Re("".concat(c.name,".bulkUpdate(): ").concat(Z," of ").concat(J," operations failed"),ie)})})})},vt.prototype.bulkDelete=function(s){var c=this,h=s.length;return this._trans("readwrite",function(y){return c.core.mutate({trans:y,type:"delete",keys:s}).then(function(_){return Ao(c,s,_)})}).then(function(y){var _=y.numFailures,k=y.failures;if(_===0)return y.lastResult;throw new Re("".concat(c.name,".bulkDelete(): ").concat(_," of ").concat(h," operations failed"),k)})};var Wn=vt;function vt(){}function Br(s){function c(j,I){if(I){for(var G=arguments.length,se=new Array(G-1);--G;)se[G-1]=arguments[G];return h[j].subscribe.apply(null,se),s}if(typeof j=="string")return h[j]}var h={};c.addEventType=k;for(var y=1,_=arguments.length;y<_;++y)k(arguments[y]);return c;function k(j,I,G){var se,J;if(typeof j!="object")return I=I||rn,J={subscribers:[],fire:G=G||Le,subscribe:function(W){J.subscribers.indexOf(W)===-1&&(J.subscribers.push(W),J.fire=I(J.fire,W))},unsubscribe:function(W){J.subscribers=J.subscribers.filter(function(Z){return Z!==W}),J.fire=J.subscribers.reduce(I,G)}},h[j]=c[j]=J;d(se=j).forEach(function(W){var Z=se[W];if(g(Z))k(W,se[W][0],se[W][1]);else{if(Z!=="asap")throw new ke.InvalidArgument("Invalid event config");var ie=k(W,Be,function(){for(var re=arguments.length,ne=new Array(re);re--;)ne[re]=arguments[re];ie.subscribers.forEach(function(oe){Y(function(){oe.apply(null,ne)})})})}})}}function oo(s,c){return A(c).from({prototype:s}),c}function lr(s,c){return!(s.filter||s.algorithm||s.or)&&(c?s.justLimit:!s.replayFilter)}function Hr(s,c){s.filter=vr(s.filter,c)}function io(s,c,h){var y=s.replayFilter;s.replayFilter=y?function(){return vr(y(),c())}:c,s.justLimit=h&&!y}function ur(s,c){if(s.isPrimKey)return c.primaryKey;var h=c.getIndexByKeyPath(s.index);if(h)return h;throw new ke.Schema("KeyPath "+s.index+" on object store "+c.name+" is not indexed")}function fi(s,c,h){var y=ur(s,c.schema);return c.openCursor({trans:h,values:!s.keysOnly,reverse:s.dir==="prev",unique:!!s.unique,query:{index:y,range:s.range}})}function $o(s,c,h,y){var _,k,j=s.replayFilter?vr(s.filter,s.replayFilter()):s.filter;return s.or?(_={},k=function(I,G,se){var J,W;j&&!j(G,se,function(Z){return G.stop(Z)},function(Z){return G.fail(Z)})||((W=""+(J=G.primaryKey))=="[object ArrayBuffer]"&&(W=""+new Uint8Array(J)),x(_,W))||(_[W]=!0,c(I,G,se))},Promise.all([s.or._iterate(k,h),wt(fi(s,y,h),s.algorithm,k,!s.keysOnly&&s.valueMapper)])):wt(fi(s,y,h),vr(s.algorithm,j),c,!s.keysOnly&&s.valueMapper)}function wt(s,c,h,y){var _=pt(y?function(k,j,I){return h(y(k),j,I)}:h);return s.then(function(k){if(k)return k.start(function(){var j=function(){return k.continue()};c&&!c(k,function(I){return j=I},function(I){k.stop(I),j=Le},function(I){k.fail(I),j=Le})||_(k.value,k,function(I){return j=I}),j()})})}mt.prototype._read=function(s,c){var h=this._ctx;return h.error?h.table._trans(null,Pt.bind(null,h.error)):h.table._trans("readonly",s).then(c)},mt.prototype._write=function(s){var c=this._ctx;return c.error?c.table._trans(null,Pt.bind(null,c.error)):c.table._trans("readwrite",s,"locked")},mt.prototype._addAlgorithm=function(s){var c=this._ctx;c.algorithm=vr(c.algorithm,s)},mt.prototype._iterate=function(s,c){return $o(this._ctx,s,c,this._ctx.table.core)},mt.prototype.clone=function(s){var c=Object.create(this.constructor.prototype),h=Object.create(this._ctx);return s&&v(h,s),c._ctx=h,c},mt.prototype.raw=function(){return this._ctx.valueMapper=null,this},mt.prototype.each=function(s){var c=this._ctx;return this._read(function(h){return $o(c,s,h,c.table.core)})},mt.prototype.count=function(s){var c=this;return this._read(function(h){var y,_=c._ctx,k=_.table.core;return lr(_,!0)?k.count({trans:h,query:{index:ur(_,k.schema),range:_.range}}).then(function(j){return Math.min(j,_.limit)}):(y=0,$o(_,function(){return++y,!1},h,k).then(function(){return y}))}).then(s)},mt.prototype.sortBy=function(s,c){var h=s.split(".").reverse(),y=h[0],_=h.length-1;function k(G,se){return se?k(G[h[se]],se-1):G[y]}var j=this._ctx.dir==="next"?1:-1;function I(G,se){return ct(k(G,_),k(se,_))*j}return this.toArray(function(G){return G.sort(I)}).then(c)},mt.prototype.toArray=function(s){var c=this;return this._read(function(h){var y,_,k,j=c._ctx;return lr(j,!0)&&0<j.limit?(y=j.valueMapper,_=ur(j,j.table.core.schema),j.table.core.query({trans:h,limit:j.limit,values:!0,direction:j.dir==="prev"?"prev":void 0,query:{index:_,range:j.range}}).then(function(I){return I=I.result,y?I.map(y):I})):(k=[],$o(j,function(I){return k.push(I)},h,j.table.core).then(function(){return k}))},s)},mt.prototype.offset=function(s){var c=this._ctx;return s<=0||(c.offset+=s,lr(c)?io(c,function(){var h=s;return function(y,_){return h===0||(h===1?--h:_(function(){y.advance(h),h=0}),!1)}}):io(c,function(){var h=s;return function(){return--h<0}})),this},mt.prototype.limit=function(s){return this._ctx.limit=Math.min(this._ctx.limit,s),io(this._ctx,function(){var c=s;return function(h,y,_){return--c<=0&&y(_),0<=c}},!0),this},mt.prototype.until=function(s,c){return Hr(this._ctx,function(h,y,_){return!s(h.value)||(y(_),c)}),this},mt.prototype.first=function(s){return this.limit(1).toArray(function(c){return c[0]}).then(s)},mt.prototype.last=function(s){return this.reverse().first(s)},mt.prototype.filter=function(s){var c;return Hr(this._ctx,function(h){return s(h.value)}),(c=this._ctx).isMatch=vr(c.isMatch,s),this},mt.prototype.and=function(s){return this.filter(s)},mt.prototype.or=function(s){return new this.db.WhereClause(this._ctx.table,s,this)},mt.prototype.reverse=function(){return this._ctx.dir=this._ctx.dir==="prev"?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this},mt.prototype.desc=function(){return this.reverse()},mt.prototype.eachKey=function(s){var c=this._ctx;return c.keysOnly=!c.isMatch,this.each(function(h,y){s(y.key,y)})},mt.prototype.eachUniqueKey=function(s){return this._ctx.unique="unique",this.eachKey(s)},mt.prototype.eachPrimaryKey=function(s){var c=this._ctx;return c.keysOnly=!c.isMatch,this.each(function(h,y){s(y.primaryKey,y)})},mt.prototype.keys=function(s){var c=this._ctx,h=(c.keysOnly=!c.isMatch,[]);return this.each(function(y,_){h.push(_.key)}).then(function(){return h}).then(s)},mt.prototype.primaryKeys=function(s){var c=this._ctx;if(lr(c,!0)&&0<c.limit)return this._read(function(y){var _=ur(c,c.table.core.schema);return c.table.core.query({trans:y,values:!1,limit:c.limit,direction:c.dir==="prev"?"prev":void 0,query:{index:_,range:c.range}})}).then(function(y){return y.result}).then(s);c.keysOnly=!c.isMatch;var h=[];return this.each(function(y,_){h.push(_.primaryKey)}).then(function(){return h}).then(s)},mt.prototype.uniqueKeys=function(s){return this._ctx.unique="unique",this.keys(s)},mt.prototype.firstKey=function(s){return this.limit(1).keys(function(c){return c[0]}).then(s)},mt.prototype.lastKey=function(s){return this.reverse().firstKey(s)},mt.prototype.distinct=function(){var s,c=this._ctx,c=c.index&&c.table.schema.idxByName[c.index];return c&&c.multi&&(s={},Hr(this._ctx,function(y){var y=y.primaryKey.toString(),_=x(s,y);return s[y]=!0,!_})),this},mt.prototype.modify=function(s){var c=this,h=this._ctx;return this._write(function(y){function _(ne,oe){var ge=oe.failures;Z+=ne-oe.numFailures;for(var fe=0,ve=d(ge);fe<ve.length;fe++){var Ee=ve[fe];W.push(ge[Ee])}}var k=typeof s=="function"?s:function(ne){return ro(ne,s)},j=h.table.core,J=j.schema.primaryKey,I=J.outbound,G=J.extractKey,se=200,J=c.db._options.modifyChunkSize,W=(J&&(se=typeof J=="object"?J[j.name]||J["*"]||200:J),[]),Z=0,ie=[],re=s===Hi;return c.clone().primaryKeys().then(function(ne){function oe(fe){var ve=Math.min(se,ne.length-fe),Ee=ne.slice(fe,fe+ve);return(re?Promise.resolve([]):j.getMany({trans:y,keys:Ee,cache:"immutable"})).then(function(Ce){var Oe=[],Me=[],Ve=I?[]:null,Ae=re?Ee:[];if(!re)for(var Ue=0;Ue<ve;++Ue){var Ne=Ce[Ue],nt={value:xe(Ne),primKey:ne[fe+Ue]};k.call(nt,nt.value,nt)!==!1&&(nt.value==null?Ae.push(ne[fe+Ue]):I||ct(G(Ne),G(nt.value))===0?(Me.push(nt.value),I&&Ve.push(ne[fe+Ue])):(Ae.push(ne[fe+Ue]),Oe.push(nt.value)))}return Promise.resolve(0<Oe.length&&j.mutate({trans:y,type:"add",values:Oe}).then(function(rt){for(var st in rt.failures)Ae.splice(parseInt(st),1);_(Oe.length,rt)})).then(function(){return(0<Me.length||ge&&typeof s=="object")&&j.mutate({trans:y,type:"put",keys:Ve,values:Me,criteria:ge,changeSpec:typeof s!="function"&&s,isAdditionalChunk:0<fe}).then(function(rt){return _(Me.length,rt)})}).then(function(){return(0<Ae.length||ge&&re)&&j.mutate({trans:y,type:"delete",keys:Ae,criteria:ge,isAdditionalChunk:0<fe}).then(function(rt){return Ao(h.table,Ae,rt)}).then(function(rt){return _(Ae.length,rt)})}).then(function(){return ne.length>fe+ve&&oe(fe+se)})})}var ge=lr(h)&&h.limit===1/0&&(typeof s!="function"||re)&&{index:h.index,range:h.range};return oe(0).then(function(){if(0<W.length)throw new Ie("Error modifying one or more objects",W,Z,ie);return ne.length})})})},mt.prototype.delete=function(){var s=this._ctx,c=s.range;return!lr(s)||s.table.schema.yProps||!s.isPrimKey&&c.type!==3?this.modify(Hi):this._write(function(h){var y=s.table.core.schema.primaryKey,_=c;return s.table.core.count({trans:h,query:{index:y,range:_}}).then(function(k){return s.table.core.mutate({trans:h,type:"deleteRange",range:_}).then(function(G){var I=G.failures,G=G.numFailures;if(G)throw new Ie("Could not delete some values",Object.keys(I).map(function(se){return I[se]}),k-G);return k-G})})})};var Fa=mt;function mt(){}var Hi=function(s,c){return c.value=null};function Ba(s,c){return s<c?-1:s===c?0:1}function Ha(s,c){return c<s?-1:s===c?0:1}function gn(s,c,h){return s=s instanceof wr?new s.Collection(s):s,s._ctx.error=new(h||TypeError)(c),s}function Vr(s){return new s.Collection(s,function(){return xr("")}).limit(0)}function so(ie,c,h,y){var _,k,j,I,G,se,J,W=h.length;if(!h.every(function(ne){return typeof ne=="string"}))return gn(ie,Fi);function Z(ne){_=ne==="next"?function(ge){return ge.toUpperCase()}:function(ge){return ge.toLowerCase()},k=ne==="next"?function(ge){return ge.toLowerCase()}:function(ge){return ge.toUpperCase()},j=ne==="next"?Ba:Ha;var oe=h.map(function(ge){return{lower:k(ge),upper:_(ge)}}).sort(function(ge,fe){return j(ge.lower,fe.lower)});I=oe.map(function(ge){return ge.upper}),G=oe.map(function(ge){return ge.lower}),J=(se=ne)==="next"?"":y}Z("next");var ie=new ie.Collection(ie,function(){return ln(I[0],G[W-1]+y)}),re=(ie._ondirectionchange=function(ne){Z(ne)},0);return ie._addAlgorithm(function(ne,oe,ge){var fe=ne.key;if(typeof fe=="string"){var ve=k(fe);if(c(ve,G,re))return!0;for(var Ee=null,Ce=re;Ce<W;++Ce){var Oe=((Me,Ve,Ae,Ue,Ne,nt)=>{for(var rt=Math.min(Me.length,Ue.length),st=-1,ft=0;ft<rt;++ft){var yn=Ve[ft];if(yn!==Ue[ft])return Ne(Me[ft],Ae[ft])<0?Me.substr(0,ft)+Ae[ft]+Ae.substr(ft+1):Ne(Me[ft],Ue[ft])<0?Me.substr(0,ft)+Ue[ft]+Ae.substr(ft+1):0<=st?Me.substr(0,st)+Ve[st]+Ae.substr(st+1):null;Ne(Me[ft],yn)<0&&(st=ft)}return rt<Ue.length&&nt==="next"?Me+Ae.substr(Me.length):rt<Me.length&&nt==="prev"?Me.substr(0,Ae.length):st<0?null:Me.substr(0,st)+Ue[st]+Ae.substr(st+1)})(fe,ve,I[Ce],G[Ce],j,se);Oe===null&&Ee===null?re=Ce+1:(Ee===null||0<j(Ee,Oe))&&(Ee=Oe)}oe(Ee!==null?function(){ne.continue(Ee+J)}:ge)}return!1}),ie}function ln(s,c,h,y){return{type:2,lower:s,upper:c,lowerOpen:h,upperOpen:y}}function xr(s){return{type:1,lower:s,upper:s}}Object.defineProperty(At.prototype,"Collection",{get:function(){return this._ctx.table.db.Collection},enumerable:!1,configurable:!0}),At.prototype.between=function(s,c,h,y){h=h!==!1,y=y===!0;try{return 0<this._cmp(s,c)||this._cmp(s,c)===0&&(h||y)&&(!h||!y)?Vr(this):new this.Collection(this,function(){return ln(s,c,!h,!y)})}catch{return gn(this,yt)}},At.prototype.equals=function(s){return s==null?gn(this,yt):new this.Collection(this,function(){return xr(s)})},At.prototype.above=function(s){return s==null?gn(this,yt):new this.Collection(this,function(){return ln(s,void 0,!0)})},At.prototype.aboveOrEqual=function(s){return s==null?gn(this,yt):new this.Collection(this,function(){return ln(s,void 0,!1)})},At.prototype.below=function(s){return s==null?gn(this,yt):new this.Collection(this,function(){return ln(void 0,s,!1,!0)})},At.prototype.belowOrEqual=function(s){return s==null?gn(this,yt):new this.Collection(this,function(){return ln(void 0,s)})},At.prototype.startsWith=function(s){return typeof s!="string"?gn(this,Fi):this.between(s,s+sr,!0,!0)},At.prototype.startsWithIgnoreCase=function(s){return s===""?this.startsWith(s):so(this,function(c,h){return c.indexOf(h[0])===0},[s],sr)},At.prototype.equalsIgnoreCase=function(s){return so(this,function(c,h){return c===h[0]},[s],"")},At.prototype.anyOfIgnoreCase=function(){var s=Q.apply(F,arguments);return s.length===0?Vr(this):so(this,function(c,h){return h.indexOf(c)!==-1},s,"")},At.prototype.startsWithAnyOfIgnoreCase=function(){var s=Q.apply(F,arguments);return s.length===0?Vr(this):so(this,function(c,h){return h.some(function(y){return c.indexOf(y)===0})},s,sr)},At.prototype.anyOf=function(){var s,c,h=this,y=Q.apply(F,arguments),_=this._cmp;try{y.sort(_)}catch{return gn(this,yt)}return y.length===0?Vr(this):((s=new this.Collection(this,function(){return ln(y[0],y[y.length-1])}))._ondirectionchange=function(k){_=k==="next"?h._ascending:h._descending,y.sort(_)},c=0,s._addAlgorithm(function(k,j,I){for(var G=k.key;0<_(G,y[c]);)if(++c===y.length)return j(I),!1;return _(G,y[c])===0||(j(function(){k.continue(y[c])}),!1)}),s)},At.prototype.notEqual=function(s){return this.inAnyRange([[-1/0,s],[s,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})},At.prototype.noneOf=function(){var s=Q.apply(F,arguments);if(s.length===0)return new this.Collection(this);try{s.sort(this._ascending)}catch{return gn(this,yt)}var c=s.reduce(function(h,y){return h?h.concat([[h[h.length-1][1],y]]):[[-1/0,y]]},null);return c.push([s[s.length-1],this.db._maxKey]),this.inAnyRange(c,{includeLowers:!1,includeUppers:!1})},At.prototype.inAnyRange=function(s,ge){var h=this,y=this._cmp,_=this._ascending,k=this._descending,j=this._min,I=this._max;if(s.length===0)return Vr(this);if(!s.every(function(fe){return fe[0]!==void 0&&fe[1]!==void 0&&_(fe[0],fe[1])<=0}))return gn(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 G=!ge||ge.includeLowers!==!1,se=ge&&ge.includeUppers===!0,J,W=_;function Z(fe,ve){return W(fe[0],ve[0])}try{(J=s.reduce(function(fe,ve){for(var Ee=0,Ce=fe.length;Ee<Ce;++Ee){var Oe=fe[Ee];if(y(ve[0],Oe[1])<0&&0<y(ve[1],Oe[0])){Oe[0]=j(Oe[0],ve[0]),Oe[1]=I(Oe[1],ve[1]);break}}return Ee===Ce&&fe.push(ve),fe},[])).sort(Z)}catch{return gn(this,yt)}var ie=0,re=se?function(fe){return 0<_(fe,J[ie][1])}:function(fe){return 0<=_(fe,J[ie][1])},ne=G?function(fe){return 0<k(fe,J[ie][0])}:function(fe){return 0<=k(fe,J[ie][0])},oe=re,ge=new this.Collection(this,function(){return ln(J[0][0],J[J.length-1][1],!G,!se)});return ge._ondirectionchange=function(fe){W=fe==="next"?(oe=re,_):(oe=ne,k),J.sort(Z)},ge._addAlgorithm(function(fe,ve,Ee){for(var Ce,Oe=fe.key;oe(Oe);)if(++ie===J.length)return ve(Ee),!1;return!re(Ce=Oe)&&!ne(Ce)||(h._cmp(Oe,J[ie][1])===0||h._cmp(Oe,J[ie][0])===0||ve(function(){W===_?fe.continue(J[ie][0]):fe.continue(J[ie][1])}),!1)}),ge},At.prototype.startsWithAnyOf=function(){var s=Q.apply(F,arguments);return s.every(function(c){return typeof c=="string"})?s.length===0?Vr(this):this.inAnyRange(s.map(function(c){return[c,c+sr]})):gn(this,"startsWithAnyOf() only works with strings")};var wr=At;function At(){}function un(s){return pt(function(c){return On(c),s(c.target.error),!1})}function On(s){s.stopPropagation&&s.stopPropagation(),s.preventDefault&&s.preventDefault()}var di="storagemutated",Vi="x-storagemutated-1",Rn=Br(null,di),Iu=(Yn.prototype._lock=function(){return R(!qe.global),++this._reculock,this._reculock!==1||qe.global||(qe.lockOwnerFor=this),this},Yn.prototype._unlock=function(){if(R(!qe.global),--this._reculock==0)for(qe.global||(qe.lockOwnerFor=null);0<this._blockedFuncs.length&&!this._locked();){var s=this._blockedFuncs.shift();try{ir(s[1],s[0])}catch{}}return this},Yn.prototype._locked=function(){return this._reculock&&qe.lockOwnerFor!==this},Yn.prototype.create=function(s){var c=this;if(this.mode){var h=this.db.idbdb,y=this.db._state.dbOpenError;if(R(!this.idbtrans),!s&&!h)switch(y&&y.name){case"DatabaseClosedError":throw new ke.DatabaseClosed(y);case"MissingAPIError":throw new ke.MissingAPI(y.message,y);default:throw new ke.OpenFailed(y)}if(!this.active)throw new ke.TransactionInactive;R(this._completion._state===null),(s=this.idbtrans=s||(this.db.core||h).transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability})).onerror=pt(function(_){On(_),c._reject(s.error)}),s.onabort=pt(function(_){On(_),c.active&&c._reject(new ke.Abort(s.error)),c.active=!1,c.on("abort").fire(_)}),s.oncomplete=pt(function(){c.active=!1,c._resolve(),"mutatedParts"in s&&Rn.storagemutated.fire(s.mutatedParts)})}return this},Yn.prototype._promise=function(s,c,h){var y,_=this;return s==="readwrite"&&this.mode!=="readwrite"?Pt(new ke.ReadOnly("Transaction is readonly")):this.active?this._locked()?new Fe(function(k,j){_._blockedFuncs.push([function(){_._promise(s,c,h).then(k,j)},qe])}):h?rr(function(){var k=new Fe(function(j,I){_._lock();var G=c(j,I,_);G&&G.then&&G.then(j,I)});return k.finally(function(){return _._unlock()}),k._lib=!0,k}):((y=new Fe(function(k,j){var I=c(k,j,_);I&&I.then&&I.then(k,j)}))._lib=!0,y):Pt(new ke.TransactionInactive)},Yn.prototype._root=function(){return this.parent?this.parent._root():this},Yn.prototype.waitFor=function(s){var c,h=this._root(),y=Fe.resolve(s),_=(h._waitingFor?h._waitingFor=h._waitingFor.then(function(){return y}):(h._waitingFor=y,h._waitingQueue=[],c=h.idbtrans.objectStore(h.storeNames[0]),(function k(){for(++h._spinCount;h._waitingQueue.length;)h._waitingQueue.shift()();h._waitingFor&&(c.get(-1/0).onsuccess=k)})()),h._waitingFor);return new Fe(function(k,j){y.then(function(I){return h._waitingQueue.push(pt(k.bind(null,I)))},function(I){return h._waitingQueue.push(pt(j.bind(null,I)))}).finally(function(){h._waitingFor===_&&(h._waitingFor=null)})})},Yn.prototype.abort=function(){this.active&&(this.active=!1,this.idbtrans&&this.idbtrans.abort(),this._reject(new ke.Abort))},Yn.prototype.table=function(s){var c=this._memoizedTables||(this._memoizedTables={});if(x(c,s))return c[s];var h=this.schema[s];if(h)return(h=new this.db.Table(s,h,this)).core=this.db.core.table(s),c[s]=h;throw new ke.NotFound("Table "+s+" not part of transaction")},Yn);function Yn(){}function Oo(s,c,h,y,_,k,j,I){return{name:s,keyPath:c,unique:h,multi:y,auto:_,compound:k,src:(h&&!j?"&":"")+(y?"*":"")+(_?"++":"")+Rs(c),type:I}}function Rs(s){return typeof s=="string"?s:s?"["+[].join.call(s,"+")+"]":""}function zs(s,c,h){return{name:s,primKey:c,indexes:h,mappedClass:null,idxByName:(y=function(_){return[_.name,_]},h.reduce(function(_,k,j){return k=y(k,j),k&&(_[k[0]]=k[1]),_},{}))};var y}var _r=function(s){try{return s.only([[]]),_r=function(){return[[]]},[[]]}catch{return _r=function(){return sr},sr}};function ao(s){return s==null?function(){}:typeof s=="string"?(c=s).split(".").length===1?function(h){return h[c]}:function(h){return V(h,c)}:function(h){return V(h,s)};var c}function lo(s){return[].slice.call(s)}var Ki=0;function pi(s){return s==null?":id":typeof s=="string"?s:"[".concat(s.join("+"),"]")}function Au(s,c,j){function y(oe){if(oe.type===3)return null;if(oe.type===4)throw new Error("Cannot convert never type to IDBKeyRange");var ie=oe.lower,re=oe.upper,ne=oe.lowerOpen,oe=oe.upperOpen;return ie===void 0?re===void 0?null:c.upperBound(re,!!oe):re===void 0?c.lowerBound(ie,!!ne):c.bound(ie,re,!!ne,!!oe)}function _(Z){var ie,re,ne=Z.name;return{name:ne,schema:Z,mutate:function(oe){var ge=oe.trans,fe=oe.type,ve=oe.keys,Ee=oe.values,Ce=oe.range;return new Promise(function(Oe,Me){Oe=pt(Oe);var Ve=ge.objectStore(ne),Ae=Ve.keyPath==null,Ue=fe==="put"||fe==="add";if(!Ue&&fe!=="delete"&&fe!=="deleteRange")throw new Error("Invalid operation type: "+fe);var Ne,nt=(ve||Ee||{length:1}).length;if(ve&&Ee&&ve.length!==Ee.length)throw new Error("Given keys array must have same length as given values array.");if(nt===0)return Oe({numFailures:0,failures:{},results:[],lastResult:void 0});function rt(cn){++yn,On(cn)}var st=[],ft=[],yn=0;if(fe==="deleteRange"){if(Ce.type===4)return Oe({numFailures:yn,failures:ft,results:[],lastResult:void 0});Ce.type===3?st.push(Ne=Ve.clear()):st.push(Ne=Ve.delete(y(Ce)))}else{var Ae=Ue?Ae?[Ee,ve]:[Ee,null]:[ve,null],it=Ae[0],jt=Ae[1];if(Ue)for(var Vt=0;Vt<nt;++Vt)st.push(Ne=jt&&jt[Vt]!==void 0?Ve[fe](it[Vt],jt[Vt]):Ve[fe](it[Vt])),Ne.onerror=rt;else for(Vt=0;Vt<nt;++Vt)st.push(Ne=Ve[fe](it[Vt])),Ne.onerror=rt}function Ko(cn){cn=cn.target.result,st.forEach(function(go,yo){return go.error!=null&&(ft[yo]=go.error)}),Oe({numFailures:yn,failures:ft,results:fe==="delete"?ve:st.map(function(go){return go.result}),lastResult:cn})}Ne.onerror=function(cn){rt(cn),Ko(cn)},Ne.onsuccess=Ko})},getMany:function(oe){var ge=oe.trans,fe=oe.keys;return new Promise(function(ve,Ee){ve=pt(ve);for(var Ce,Oe=ge.objectStore(ne),Me=fe.length,Ve=new Array(Me),Ae=0,Ue=0,Ne=function(st){st=st.target,Ve[st._pos]=st.result,++Ue===Ae&&ve(Ve)},nt=un(Ee),rt=0;rt<Me;++rt)fe[rt]!=null&&((Ce=Oe.get(fe[rt]))._pos=rt,Ce.onsuccess=Ne,Ce.onerror=nt,++Ae);Ae===0&&ve(Ve)})},get:function(oe){var ge=oe.trans,fe=oe.key;return new Promise(function(ve,Ee){ve=pt(ve);var Ce=ge.objectStore(ne).get(fe);Ce.onsuccess=function(Oe){return ve(Oe.target.result)},Ce.onerror=un(Ee)})},query:(ie=G,re=se,function(oe){return new Promise(function(ge,fe){ge=pt(ge);var ve,Ee,Ce,Oe,nt=oe.trans,Me=oe.values,Ve=oe.limit,Ne=oe.query,Ae=(Ae=oe.direction)!=null?Ae:"next",Ue=Ve===1/0?void 0:Ve,rt=Ne.index,Ne=Ne.range,nt=nt.objectStore(ne),nt=rt.isPrimaryKey?nt:nt.index(rt.name),rt=y(Ne);if(Ve===0)return ge({result:[]});re?(Ne={query:rt,count:Ue,direction:Ae},(ve=Me?nt.getAll(Ne):nt.getAllKeys(Ne)).onsuccess=function(st){return ge({result:st.target.result})},ve.onerror=un(fe)):ie&&Ae==="next"?((ve=Me?nt.getAll(rt,Ue):nt.getAllKeys(rt,Ue)).onsuccess=function(st){return ge({result:st.target.result})},ve.onerror=un(fe)):(Ee=0,Ce=!Me&&"openKeyCursor"in nt?nt.openKeyCursor(rt,Ae):nt.openCursor(rt,Ae),Oe=[],Ce.onsuccess=function(){var st=Ce.result;return!st||(Oe.push(Me?st.value:st.primaryKey),++Ee===Ve)?ge({result:Oe}):void st.continue()},Ce.onerror=un(fe))})}),openCursor:function(oe){var ge=oe.trans,fe=oe.values,ve=oe.query,Ee=oe.reverse,Ce=oe.unique;return new Promise(function(Oe,Me){Oe=pt(Oe);var Ue=ve.index,Ve=ve.range,Ae=ge.objectStore(ne),Ae=Ue.isPrimaryKey?Ae:Ae.index(Ue.name),Ue=Ee?Ce?"prevunique":"prev":Ce?"nextunique":"next",Ne=!fe&&"openKeyCursor"in Ae?Ae.openKeyCursor(y(Ve),Ue):Ae.openCursor(y(Ve),Ue);Ne.onerror=un(Me),Ne.onsuccess=pt(function(nt){var rt,st,ft,yn,it=Ne.result;it?(it.___id=++Ki,it.done=!1,rt=it.continue.bind(it),st=(st=it.continuePrimaryKey)&&st.bind(it),ft=it.advance.bind(it),yn=function(){throw new Error("Cursor not stopped")},it.trans=ge,it.stop=it.continue=it.continuePrimaryKey=it.advance=function(){throw new Error("Cursor not started")},it.fail=pt(Me),it.next=function(){var jt=this,Vt=1;return this.start(function(){return Vt--?jt.continue():jt.stop()}).then(function(){return jt})},it.start=function(jt){function Vt(){if(Ne.result)try{jt()}catch(cn){it.fail(cn)}else it.done=!0,it.start=function(){throw new Error("Cursor behind last entry")},it.stop()}var Ko=new Promise(function(cn,go){cn=pt(cn),Ne.onerror=un(go),it.fail=go,it.stop=function(yo){it.stop=it.continue=it.continuePrimaryKey=it.advance=yn,cn(yo)}});return Ne.onsuccess=pt(function(cn){Ne.onsuccess=Vt,Vt()}),it.continue=rt,it.continuePrimaryKey=st,it.advance=ft,Vt(),Ko},Oe(it)):Oe(null)},Me)})},count:function(oe){var ge=oe.query,fe=oe.trans,ve=ge.index,Ee=ge.range;return new Promise(function(Ce,Oe){var Me=fe.objectStore(ne),Me=ve.isPrimaryKey?Me:Me.index(ve.name),Ve=y(Ee),Ve=Ve?Me.count(Ve):Me.count();Ve.onsuccess=pt(function(Ae){return Ce(Ae.target.result)}),Ve.onerror=un(Oe)})}}}k=j,I=lo((j=s).objectStoreNames),J=0<I.length?k.objectStore(I[0]):{};var k,j={schema:{name:j.name,tables:I.map(function(Z){return k.objectStore(Z)}).map(function(Z){var ie=Z.keyPath,re=Z.autoIncrement,oe=g(ie),ne={},oe={name:Z.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:ie==null,compound:oe,keyPath:ie,autoIncrement:re,unique:!0,extractKey:ao(ie)},indexes:lo(Z.indexNames).map(function(ge){return Z.index(ge)}).map(function(Ee){var Ce=Ee.name,fe=Ee.unique,ve=Ee.multiEntry,Ee=Ee.keyPath,Ce={name:Ce,compound:g(Ee),keyPath:Ee,unique:fe,multiEntry:ve,extractKey:ao(Ee)};return ne[pi(Ee)]=Ce}),getIndexByKeyPath:function(ge){return ne[pi(ge)]}};return ne[":id"]=oe.primaryKey,ie!=null&&(ne[pi(ie)]=oe.primaryKey),oe})},hasGetAll:0<I.length&&"getAll"in J&&!(typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604),hasIdb3Features:"getAllRecords"in J},I=j.schema,G=j.hasGetAll,se=j.hasIdb3Features,J=I.tables.map(_),W={};return J.forEach(function(Z){return W[Z.name]=Z}),{stack:"dbcore",transaction:s.transaction.bind(s),table:function(Z){if(W[Z])return W[Z];throw new Error("Table '".concat(Z,"' not found"))},MIN_KEY:-1/0,MAX_KEY:_r(c),schema:I}}function Ds(s,c,h,y){return h=h.IDBKeyRange,c=Au(c,h,y),{dbcore:s.dbcore.reduce(function(_,k){return k=k.create,a(a({},_),k(_))},c)}}function uo(s,c){var h=c.db,h=Ds(s._middlewares,h,s._deps,c);s.core=h.dbcore,s.tables.forEach(function(y){var _=y.name;s.core.schema.tables.some(function(k){return k.name===_})&&(y.core=s.core.table(_),s[_]instanceof s.Table)&&(s[_].core=y.core)})}function Ro(s,c,h,y){h.forEach(function(_){var k=y[_];c.forEach(function(j){var I=(function G(se,J){return T(se,J)||(se=w(se))&&G(se,J)})(j,_);(!I||"value"in I&&I.value===void 0)&&(j===s.Transaction.prototype||j instanceof s.Transaction?C(j,_,{get:function(){return this.table(_)},set:function(G){N(this,_,{value:G,writable:!0,configurable:!0,enumerable:!0})}}):j[_]=new s.Table(_,k))})})}function Ui(s,c){c.forEach(function(h){for(var y in h)h[y]instanceof s.Table&&delete h[y]})}function Kr(s,c){return s._cfg.version-c._cfg.version}function Ls(s,c,h,y){var _=s._dbSchema,k=(h.objectStoreNames.contains("$meta")&&!_.$meta&&(_.$meta=zs("$meta",Yi("")[0],[]),s._storeNames.push("$meta")),s._createTransaction("readwrite",s._storeNames,_)),j=(k.create(h),k._completion.catch(y),k._reject.bind(k)),I=qe.transless||qe;rr(function(){if(qe.trans=k,qe.transless=I,c!==0)return uo(s,h),se=c,((G=k).storeNames.includes("$meta")?G.table("$meta").get("version").then(function(J){return J??se}):Fe.resolve(se)).then(function(oe){var W=s,Z=oe,ie=k,re=h,ne=[],oe=W._versions,ge=W._dbSchema=Zt(0,W.idbdb,re);return(oe=oe.filter(function(fe){return fe._cfg.version>=Z})).length===0?Fe.resolve():(oe.forEach(function(fe){ne.push(function(){var ve,Ee,Ce,Oe=ge,Me=fe._cfg.dbschema,Ve=(Sr(W,Oe,re),Sr(W,Me,re),ge=W._dbSchema=Me,Wi(Oe,Me)),Ae=(Ve.add.forEach(function(Ue){zo(re,Ue[0],Ue[1].primKey,Ue[1].indexes)}),Ve.change.forEach(function(Ue){if(Ue.recreate)throw new ke.Upgrade("Not yet support for changing primary key");var Ne=re.objectStore(Ue.name);Ue.add.forEach(function(nt){return mi(Ne,nt)}),Ue.change.forEach(function(nt){Ne.deleteIndex(nt.name),mi(Ne,nt)}),Ue.del.forEach(function(nt){return Ne.deleteIndex(nt)})}),fe._cfg.contentUpgrade);if(Ae&&fe._cfg.version>Z)return uo(W,re),ie._memoizedTables={},ve=le(Me),Ve.del.forEach(function(Ue){ve[Ue]=Oe[Ue]}),Ui(W,[W.Transaction.prototype]),Ro(W,[W.Transaction.prototype],d(ve),ve),ie.schema=ve,(Ee=O(Ae))&&zr(),Me=Fe.follow(function(){var Ue;(Ce=Ae(ie))&&Ee&&(Ue=Yt.bind(null,null),Ce.then(Ue,Ue))}),Ce&&typeof Ce.then=="function"?Fe.resolve(Ce):Me.then(function(){return Ce})}),ne.push(function(ve){var Ee,Ce,Oe=fe._cfg.dbschema;Ee=Oe,Ce=ve,[].slice.call(Ce.db.objectStoreNames).forEach(function(Me){return Ee[Me]==null&&Ce.db.deleteObjectStore(Me)}),Ui(W,[W.Transaction.prototype]),Ro(W,[W.Transaction.prototype],W._storeNames,W._dbSchema),ie.schema=W._dbSchema}),ne.push(function(ve){W.idbdb.objectStoreNames.contains("$meta")&&(Math.ceil(W.idbdb.version/10)===fe._cfg.version?(W.idbdb.deleteObjectStore("$meta"),delete W._dbSchema.$meta,W._storeNames=W._storeNames.filter(function(Ee){return Ee!=="$meta"})):ve.objectStore("$meta").put(fe._cfg.version,"version"))})}),(function fe(){return ne.length?Fe.resolve(ne.shift()(ie.idbtrans)).then(fe):Fe.resolve()})().then(function(){hi(ge,re)}))}).catch(j);var G,se;d(_).forEach(function(J){zo(h,J,_[J].primKey,_[J].indexes)}),uo(s,h),Fe.follow(function(){return s.on.populate.fire(k)}).catch(j)})}function qi(s,c){hi(s._dbSchema,c),c.db.version%10!=0||c.objectStoreNames.contains("$meta")||c.db.createObjectStore("$meta").add(Math.ceil(c.db.version/10-1),"version");var h=Zt(0,s.idbdb,c);Sr(s,s._dbSchema,c);for(var y=0,_=Wi(h,s._dbSchema).change;y<_.length;y++){var k=(j=>{if(j.change.length||j.recreate)return console.warn("Unable to patch indexes of table ".concat(j.name," because it has changes on the type of index or primary key.")),{value:void 0};var I=c.objectStore(j.name);j.add.forEach(function(G){Et&&console.debug("Dexie upgrade patch: Creating missing index ".concat(j.name,".").concat(G.src)),mi(I,G)})})(_[y]);if(typeof k=="object")return k.value}}function Wi(s,c){var h,y={del:[],add:[],change:[]};for(h in s)c[h]||y.del.push(h);for(h in c){var _=s[h],k=c[h];if(_){var j={name:h,def:k,recreate:!1,del:[],add:[],change:[]};if(""+(_.primKey.keyPath||"")!=""+(k.primKey.keyPath||"")||_.primKey.auto!==k.primKey.auto)j.recreate=!0,y.change.push(j);else{var I=_.idxByName,G=k.idxByName,se=void 0;for(se in I)G[se]||j.del.push(se);for(se in G){var J=I[se],W=G[se];J?J.src!==W.src&&j.change.push(W):j.add.push(W)}(0<j.del.length||0<j.add.length||0<j.change.length)&&y.change.push(j)}}else y.add.push([h,k])}return y}function zo(s,c,h,y){var _=s.db.createObjectStore(c,h.keyPath?{keyPath:h.keyPath,autoIncrement:h.auto}:{autoIncrement:h.auto});y.forEach(function(k){return mi(_,k)})}function hi(s,c){d(s).forEach(function(h){c.db.objectStoreNames.contains(h)||(Et&&console.debug("Dexie: Creating missing table",h),zo(c,h,s[h].primKey,s[h].indexes))})}function mi(s,c){s.createIndex(c.name,c.keyPath,{unique:c.unique,multiEntry:c.multi})}function Zt(s,c,h){var y={};return H(c.objectStoreNames,0).forEach(function(_){for(var k=h.objectStore(_),j=Oo(Rs(se=k.keyPath),se||"",!0,!1,!!k.autoIncrement,se&&typeof se!="string",!0),I=[],G=0;G<k.indexNames.length;++G){var J=k.index(k.indexNames[G]),se=J.keyPath,J=Oo(J.name,se,!!J.unique,!!J.multiEntry,!1,se&&typeof se!="string",!1);I.push(J)}y[_]=zs(_,j,I)}),y}function Sr(s,c,h){for(var y=h.db.objectStoreNames,_=0;_<y.length;++_){var k=y[_],j=h.objectStore(k);s._hasGetAll="getAll"in j;for(var I=0;I<j.indexNames.length;++I){var G,se=j.indexNames[I],J=j.index(se).keyPath,J=typeof J=="string"?J:"["+H(J).join("+")+"]";c[k]&&(G=c[k].idxByName[J])&&(G.name=se,delete c[k].idxByName[J],c[k].idxByName[se]=G)}}typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&f.WorkerGlobalScope&&f instanceof f.WorkerGlobalScope&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(s._hasGetAll=!1)}function Yi(s){return s.split(",").map(function(c,h){var _=c.split(":"),y=(y=_[1])==null?void 0:y.trim(),_=(c=_[0].trim()).replace(/([&*]|\+\+)/g,""),k=/^\[/.test(_)?_.match(/^\[(.*)\]$/)[1].split("+"):_;return Oo(_,k||null,/\&/.test(c),/\*/.test(c),/\+\+/.test(c),g(k),h===0,y)})}Do.prototype._createTableSchema=zs,Do.prototype._parseIndexSyntax=Yi,Do.prototype._parseStoresSpec=function(s,c){var h=this;d(s).forEach(function(y){if(s[y]!==null){var _=h._parseIndexSyntax(s[y]),k=_.shift();if(!k)throw new ke.Schema("Invalid schema for table "+y+": "+s[y]);if(k.unique=!0,k.multi)throw new ke.Schema("Primary key cannot be multiEntry*");_.forEach(function(j){if(j.auto)throw new ke.Schema("Only primary key can be marked as autoIncrement (++)");if(!j.keyPath)throw new ke.Schema("Index must have a name and cannot be an empty string")}),k=h._createTableSchema(y,k,_),c[y]=k}})},Do.prototype.stores=function(h){var c=this.db,h=(this._cfg.storesSource=this._cfg.storesSource?v(this._cfg.storesSource,h):h,c._versions),y={},_={};return h.forEach(function(k){v(y,k._cfg.storesSource),_=k._cfg.dbschema={},k._parseStoresSpec(y,_)}),c._dbSchema=_,Ui(c,[c._allTables,c,c.Transaction.prototype]),Ro(c,[c._allTables,c,c.Transaction.prototype,this._cfg.tables],d(_),_),c._storeNames=d(_),this},Do.prototype.upgrade=function(s){return this._cfg.contentUpgrade=qt(this._cfg.contentUpgrade||Le,s),this};var gi=Do;function Do(){}var co=(()=>{var s,c,h;return typeof FinalizationRegistry<"u"&&typeof WeakRef<"u"?(s=new Set,c=new FinalizationRegistry(function(y){s.delete(y)}),{toArray:function(){return Array.from(s).map(function(y){return y.deref()}).filter(function(y){return y!==void 0})},add:function(y){var _=new WeakRef(y._novip);s.add(_),c.register(y._novip,_,_),s.size>y._options.maxConnections&&(_=s.values().next().value,s.delete(_),c.unregister(_))},remove:function(y){if(y)for(var _=s.values(),k=_.next();!k.done;){var j=k.value;if(j.deref()===y._novip)return s.delete(j),void c.unregister(j);k=_.next()}}}):(h=[],{toArray:function(){return h},add:function(y){h.push(y._novip)},remove:function(y){y&&(y=h.indexOf(y._novip))!==-1&&h.splice(y,1)}})})();function yi(s,c){var h=s._dbNamesDB;return h||(h=s._dbNamesDB=new kr(Lr,{addons:[],indexedDB:s,IDBKeyRange:c})).version(1).stores({dbnames:"name"}),h.table("dbnames")}function fo(s){return s&&typeof s.databases=="function"}function Lo(s){return rr(function(){return qe.letThrough=!0,s()})}function Xi(s){return!("from"in s)}var Jt=function(s,c){var h;if(!this)return h=new Jt,s&&"d"in s&&v(h,s),h;v(this,arguments.length?{d:1,from:s,to:1<arguments.length?c:s}:{d:0})};function vi(s,c,h){var y=ct(c,h);if(!isNaN(y)){if(0<y)throw RangeError();if(Xi(s))return v(s,{from:c,to:h,d:1});var y=s.l,_=s.r;if(ct(h,s.from)<0)return y?vi(y,c,h):s.l={from:c,to:h,d:1,l:null,r:null},Va(s);if(0<ct(c,s.to))return _?vi(_,c,h):s.r={from:c,to:h,d:1,l:null,r:null},Va(s);ct(c,s.from)<0&&(s.from=c,s.l=null,s.d=_?_.d+1:1),0<ct(h,s.to)&&(s.to=h,s.r=null,s.d=s.l?s.l.d+1:1),c=!s.r,y&&!s.l&&xi(s,y),_&&c&&xi(s,_)}}function xi(s,c){Xi(c)||(function h(y,_){var k=_.from,j=_.l,I=_.r;vi(y,k,_.to),j&&h(y,j),I&&h(y,I)})(s,c)}function Qi(s,c){var h=Gi(c),y=h.next();if(!y.done)for(var _=y.value,k=Gi(s),j=k.next(_.from),I=j.value;!y.done&&!j.done;){if(ct(I.from,_.to)<=0&&0<=ct(I.to,_.from))return!0;ct(_.from,I.from)<0?_=(y=h.next(I.from)).value:I=(j=k.next(_.from)).value}return!1}function Gi(s){var c=Xi(s)?null:{s:0,n:s};return{next:function(h){for(var y=0<arguments.length;c;)switch(c.s){case 0:if(c.s=1,y)for(;c.n.l&&ct(h,c.n.from)<0;)c={up:c,n:c.n.l,s:1};else for(;c.n.l;)c={up:c,n:c.n.l,s:1};case 1:if(c.s=2,!y||ct(h,c.n.to)<=0)return{value:c.n,done:!1};case 2:if(c.n.r){c.s=3,c={up:c,n:c.n.r,s:0};continue}case 3:c=c.up}return{done:!0}}}}function Va(s){var c,h,y,_=(((_=s.r)==null?void 0:_.d)||0)-(((_=s.l)==null?void 0:_.d)||0),_=1<_?"r":_<-1?"l":"";_&&(c=_=="r"?"l":"r",h=a({},s),y=s[_],s.from=y.from,s.to=y.to,s[_]=y[_],h[_]=y[c],(s[c]=h).d=Ka(h)),s.d=Ka(s)}function Ka(h){var c=h.r,h=h.l;return(c?h?Math.max(c.d,h.d):c.d:h?h.d:0)+1}function Zi(s,c){return d(c).forEach(function(h){s[h]?xi(s[h],c[h]):s[h]=(function y(_){var k,j,I={};for(k in _)x(_,k)&&(j=_[k],I[k]=!j||typeof j!="object"||q.has(j.constructor)?j:y(j));return I})(c[h])}),s}function Fs(s,c){return s.all||c.all||Object.keys(s).some(function(h){return c[h]&&Qi(c[h],s[h])})}b(Jt.prototype,((Nt={add:function(s){return xi(this,s),this},addKey:function(s){return vi(this,s,s),this},addKeys:function(s){var c=this;return s.forEach(function(h){return vi(c,h,h)}),this},hasKey:function(s){var c=Gi(this).next(s).value;return c&&ct(c.from,s)<=0&&0<=ct(c.to,s)}})[te]=function(){return Gi(this)},Nt));var Ur={},Bs={},Hs=!1;function Ji(s){Zi(Bs,s),Hs||(Hs=!0,setTimeout(function(){Hs=!1,Vs(Bs,!(Bs={}))},0))}function Vs(s,c){c===void 0&&(c=!1);var h=new Set;if(s.all)for(var y=0,_=Object.values(Ur);y<_.length;y++)es(I=_[y],s,h,c);else for(var k in s){var j,I,k=/^idb\:\/\/(.*)\/(.*)\//.exec(k);k&&(j=k[1],k=k[2],I=Ur["idb://".concat(j,"/").concat(k)])&&es(I,s,h,c)}h.forEach(function(G){return G()})}function es(s,c,h,y){for(var _=[],k=0,j=Object.entries(s.queries.query);k<j.length;k++){for(var I=j[k],G=I[0],se=[],J=0,W=I[1];J<W.length;J++){var Z=W[J];Fs(c,Z.obsSet)?Z.subscribers.forEach(function(oe){return h.add(oe)}):y&&se.push(Z)}y&&_.push([G,se])}if(y)for(var ie=0,re=_;ie<re.length;ie++){var ne=re[ie],G=ne[0],se=ne[1];s.queries.query[G]=se}}function $u(s){var c=s._state,h=s._deps.indexedDB;if(c.isBeingOpened||s.idbdb)return c.dbReadyPromise.then(function(){return c.dbOpenError?Pt(c.dbOpenError):s});c.isBeingOpened=!0,c.dbOpenError=null,c.openComplete=!1;var y=c.openCanceller,_=Math.round(10*s.verno),k=!1;function j(){if(c.openCanceller!==y)throw new ke.DatabaseClosed("db.open() was cancelled")}function I(){return new Fe(function(Z,ie){if(j(),!h)throw new ke.MissingAPI;var re=s.name,ne=c.autoSchema||!_?h.open(re):h.open(re,_);if(!ne)throw new ke.MissingAPI;ne.onerror=un(ie),ne.onblocked=pt(s._fireOnBlocked),ne.onupgradeneeded=pt(function(oe){var ge;J=ne.transaction,c.autoSchema&&!s._options.allowEmptyDB?(ne.onerror=On,J.abort(),ne.result.close(),(ge=h.deleteDatabase(re)).onsuccess=ge.onerror=pt(function(){ie(new ke.NoSuchDatabase("Database ".concat(re," doesnt exist")))})):(J.onerror=un(ie),ge=oe.oldVersion>Math.pow(2,62)?0:oe.oldVersion,W=ge<1,s.idbdb=ne.result,k&&qi(s,J),Ls(s,ge/10,J,ie))},ie),ne.onsuccess=pt(function(){J=null;var oe,ge,fe,ve,Ee,Ce,Oe=s.idbdb=ne.result,Me=H(Oe.objectStoreNames);if(0<Me.length)try{var Ve=Oe.transaction((Ee=Me).length===1?Ee[0]:Ee,"readonly");if(c.autoSchema)Ce=Oe,ve=Ve,(fe=s).verno=Ce.version/10,ve=fe._dbSchema=Zt(0,Ce,ve),fe._storeNames=H(Ce.objectStoreNames,0),Ro(fe,[fe._allTables],d(ve),ve);else if(Sr(s,s._dbSchema,Ve),ge=Ve,((ge=Wi(Zt(0,(oe=s).idbdb,ge),oe._dbSchema)).add.length||ge.change.some(function(Ae){return Ae.add.length||Ae.change.length}))&&!k)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."),Oe.close(),_=Oe.version+1,k=!0,Z(I());uo(s,Ve)}catch{}co.add(s),Oe.onversionchange=pt(function(Ae){c.vcFired=!0,s.on("versionchange").fire(Ae)}),Oe.onclose=pt(function(){s.close({disableAutoOpen:!1})}),W&&(Me=s._deps,Ee=re,fo(Ce=Me.indexedDB)||Ee===Lr||yi(Ce,Me.IDBKeyRange).put({name:Ee}).catch(Le)),Z()},ie)}).catch(function(Z){switch(Z==null?void 0:Z.name){case"UnknownError":if(0<c.PR1398_maxLoop)return c.PR1398_maxLoop--,console.warn("Dexie: Workaround for Chrome UnknownError on open()"),I();break;case"VersionError":if(0<_)return _=0,I()}return Fe.reject(Z)})}var G,se=c.dbReadyResolve,J=null,W=!1;return Fe.race([y,(typeof navigator>"u"?Fe.resolve():!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise(function(Z){function ie(){return indexedDB.databases().finally(Z)}G=setInterval(ie,100),ie()}).finally(function(){return clearInterval(G)}):Promise.resolve()).then(I)]).then(function(){return j(),c.onReadyBeingFired=[],Fe.resolve(Lo(function(){return s.on.ready.fire(s.vip)})).then(function Z(){var ie;if(0<c.onReadyBeingFired.length)return ie=c.onReadyBeingFired.reduce(qt,Le),c.onReadyBeingFired=[],Fe.resolve(Lo(function(){return ie(s.vip)})).then(Z)})}).finally(function(){c.openCanceller===y&&(c.onReadyBeingFired=null,c.isBeingOpened=!1)}).catch(function(Z){c.dbOpenError=Z;try{J&&J.abort()}catch{}return y===c.openCanceller&&s._close(),Pt(Z)}).finally(function(){c.openComplete=!0,se()}).then(function(){var Z;return W&&(Z={},s.tables.forEach(function(ie){ie.schema.indexes.forEach(function(re){re.name&&(Z["idb://".concat(s.name,"/").concat(ie.name,"/").concat(re.name)]=new Jt(-1/0,[[[]]]))}),Z["idb://".concat(s.name,"/").concat(ie.name,"/")]=Z["idb://".concat(s.name,"/").concat(ie.name,"/:dels")]=new Jt(-1/0,[[[]]])}),Rn(di).fire(Z),Vs(Z,!0)),s})}function Ks(s){function c(k){return s.next(k)}var h=_(c),y=_(function(k){return s.throw(k)});function _(k){return function(I){var I=k(I),G=I.value;return I.done?G:G&&typeof G.then=="function"?G.then(h,y):g(G)?Promise.all(G).then(h,y):h(G)}}return _(c)()}function ts(s,c,h){for(var y=g(s)?s.slice():[s],_=0;_<h;++_)y.push(c);return y}var Ua={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function(s){return a(a({},s),{table:function(y){var h=s.table(y),y=h.schema,_={},k=[];function j(Z,ie,re){var fe=pi(Z),ne=_[fe]=_[fe]||[],oe=Z==null?0:typeof Z=="string"?1:Z.length,ge=0<ie,fe=a(a({},re),{name:ge?"".concat(fe,"(virtual-from:").concat(re.name,")"):re.name,lowLevelIndex:re,isVirtual:ge,keyTail:ie,keyLength:oe,extractKey:ao(Z),unique:!ge&&re.unique});return ne.push(fe),fe.isPrimaryKey||k.push(fe),1<oe&&j(oe===2?Z[0]:Z.slice(0,oe-1),ie+1,re),ne.sort(function(ve,Ee){return ve.keyTail-Ee.keyTail}),fe}var I=j(y.primaryKey.keyPath,0,y.primaryKey);_[":id"]=[I];for(var G=0,se=y.indexes;G<se.length;G++){var J=se[G];j(J.keyPath,0,J)}function W(Z){var ie,re=Z.query.index;return re.isVirtual?a(a({},Z),{query:{index:re.lowLevelIndex,range:(ie=Z.query.range,re=re.keyTail,{type:ie.type===1?2:ie.type,lower:ts(ie.lower,ie.lowerOpen?s.MAX_KEY:s.MIN_KEY,re),lowerOpen:!0,upper:ts(ie.upper,ie.upperOpen?s.MIN_KEY:s.MAX_KEY,re),upperOpen:!0})}}):Z}return a(a({},h),{schema:a(a({},y),{primaryKey:I,indexes:k,getIndexByKeyPath:function(Z){return(Z=_[pi(Z)])&&Z[0]}}),count:function(Z){return h.count(W(Z))},query:function(Z){return h.query(W(Z))},openCursor:function(Z){var ie=Z.query.index,re=ie.keyTail,ne=ie.keyLength;return ie.isVirtual?h.openCursor(W(Z)).then(function(ge){return ge&&oe(ge)}):h.openCursor(Z);function oe(ge){return Object.create(ge,{continue:{value:function(fe){fe!=null?ge.continue(ts(fe,Z.reverse?s.MAX_KEY:s.MIN_KEY,re)):Z.unique?ge.continue(ge.key.slice(0,ne).concat(Z.reverse?s.MIN_KEY:s.MAX_KEY,re)):ge.continue()}},continuePrimaryKey:{value:function(fe,ve){ge.continuePrimaryKey(ts(fe,s.MAX_KEY,re),ve)}},primaryKey:{get:function(){return ge.primaryKey}},key:{get:function(){var fe=ge.key;return ne===1?fe[0]:fe.slice(0,ne)}},value:{get:function(){return ge.value}}})}}})}})}};function Us(s,c,h,y){return h=h||{},y=y||"",d(s).forEach(function(_){var k,j,I;x(c,_)?(k=s[_],j=c[_],typeof k=="object"&&typeof j=="object"&&k&&j?(I=ce(k))!==ce(j)?h[y+_]=c[_]:I==="Object"?Us(k,j,h,y+_+"."):k!==j&&(h[y+_]=c[_]):k!==j&&(h[y+_]=c[_])):h[y+_]=void 0}),d(c).forEach(function(_){x(s,_)||(h[y+_]=c[_])}),h}function qs(s,c){return c.type==="delete"?c.keys:c.keys||c.values.map(s.extractKey)}var Ou={stack:"dbcore",name:"HooksMiddleware",level:2,create:function(s){return a(a({},s),{table:function(c){var h=s.table(c),y=h.schema.primaryKey;return a(a({},h),{mutate:function(_){var k=qe.trans,j=k.table(c).hook,I=j.deleting,G=j.creating,se=j.updating;switch(_.type){case"add":if(G.fire===Le)break;return k._promise("readwrite",function(){return J(_)},!0);case"put":if(G.fire===Le&&se.fire===Le)break;return k._promise("readwrite",function(){return J(_)},!0);case"delete":if(I.fire===Le)break;return k._promise("readwrite",function(){return J(_)},!0);case"deleteRange":if(I.fire===Le)break;return k._promise("readwrite",function(){return(function W(Z,ie,re){return h.query({trans:Z,values:!1,query:{index:y,range:ie},limit:re}).then(function(ne){var oe=ne.result;return J({type:"delete",keys:oe,trans:Z}).then(function(ge){return 0<ge.numFailures?Promise.reject(ge.failures[0]):oe.length<re?{failures:[],numFailures:0,lastResult:void 0}:W(Z,a(a({},ie),{lower:oe[oe.length-1],lowerOpen:!0}),re)})})})(_.trans,_.range,1e4)},!0)}return h.mutate(_);function J(W){var Z,ie,re,ne=qe.trans,oe=W.keys||qs(y,W);if(oe)return(W=W.type==="add"||W.type==="put"?a(a({},W),{keys:oe}):a({},W)).type!=="delete"&&(W.values=u([],W.values)),W.keys&&(W.keys=u([],W.keys)),Z=h,re=oe,((ie=W).type==="add"?Promise.resolve([]):Z.getMany({trans:ie.trans,keys:re,cache:"immutable"})).then(function(ge){var fe=oe.map(function(ve,Ee){var Ce,Oe,Me,Ve=ge[Ee],Ae={onerror:null,onsuccess:null};return W.type==="delete"?I.fire.call(Ae,ve,Ve,ne):W.type==="add"||Ve===void 0?(Ce=G.fire.call(Ae,ve,W.values[Ee],ne),ve==null&&Ce!=null&&(W.keys[Ee]=ve=Ce,y.outbound||U(W.values[Ee],y.keyPath,ve))):(Ce=Us(Ve,W.values[Ee]),(Oe=se.fire.call(Ae,Ce,ve,Ve,ne))&&(Me=W.values[Ee],Object.keys(Oe).forEach(function(Ue){x(Me,Ue)?Me[Ue]=Oe[Ue]:U(Me,Ue,Oe[Ue])}))),Ae});return h.mutate(W).then(function(ve){for(var Ee=ve.failures,Ce=ve.results,Oe=ve.numFailures,ve=ve.lastResult,Me=0;Me<oe.length;++Me){var Ve=(Ce||oe)[Me],Ae=fe[Me];Ve==null?Ae.onerror&&Ae.onerror(Ee[Me]):Ae.onsuccess&&Ae.onsuccess(W.type==="put"&&ge[Me]?W.values[Me]:Ve)}return{failures:Ee,results:Ce,numFailures:Oe,lastResult:ve}}).catch(function(ve){return fe.forEach(function(Ee){return Ee.onerror&&Ee.onerror(ve)}),Promise.reject(ve)})});throw new Error("Keys missing")}}})}})}};function qa(s,c,h){try{if(!c||c.keys.length<s.length)return null;for(var y=[],_=0,k=0;_<c.keys.length&&k<s.length;++_)ct(c.keys[_],s[k])===0&&(y.push(h?xe(c.values[_]):c.values[_]),++k);return y.length===s.length?y:null}catch{return null}}var Ru={stack:"dbcore",level:-1,create:function(s){return{table:function(c){var h=s.table(c);return a(a({},h),{getMany:function(y){var _;return y.cache?(_=qa(y.keys,y.trans._cache,y.cache==="clone"))?Fe.resolve(_):h.getMany(y).then(function(k){return y.trans._cache={keys:y.keys,values:y.cache==="clone"?xe(k):k},k}):h.getMany(y)},mutate:function(y){return y.type!=="add"&&(y.trans._cache=null),h.mutate(y)}})}}}};function Wa(s,c){return s.trans.mode==="readonly"&&!!s.subscr&&!s.trans.explicit&&s.trans.db._options.cache!=="disabled"&&!c.schema.primaryKey.outbound}function Ya(s,c){switch(s){case"query":return c.values&&!c.unique;case"get":case"getMany":case"count":case"openCursor":return!1}}var Ws={stack:"dbcore",level:0,name:"Observability",create:function(s){var c=s.schema.name,h=new Jt(s.MIN_KEY,s.MAX_KEY);return a(a({},s),{transaction:function(y,_,k){if(qe.subscr&&_!=="readonly")throw new ke.ReadOnly("Readwrite transaction in liveQuery context. Querier source: ".concat(qe.querier));return s.transaction(y,_,k)},table:function(y){function _(oe){var ne,oe=oe.query;return[ne=oe.index,new Jt((ne=(oe=oe.range).lower)!=null?ne:s.MIN_KEY,(ne=oe.upper)!=null?ne:s.MAX_KEY)]}var k=s.table(y),j=k.schema,I=j.primaryKey,G=j.indexes,se=I.extractKey,J=I.outbound,W=I.autoIncrement&&G.filter(function(re){return re.compound&&re.keyPath.includes(I.keyPath)}),Z=a(a({},k),{mutate:function(re){function ne(Ne){return Ne="idb://".concat(c,"/").concat(y,"/").concat(Ne),Ee[Ne]||(Ee[Ne]=new Jt)}var oe,ge,fe,ve=re.trans,Ee=re.mutatedParts||(re.mutatedParts={}),Ce=ne(""),Oe=ne(":dels"),Me=re.type,Ae=re.type==="deleteRange"?[re.range]:re.type==="delete"?[re.keys]:re.values.length<50?[qs(I,re).filter(function(Ne){return Ne}),re.values]:[],Ve=Ae[0],Ae=Ae[1],Ue=re.trans._cache;return g(Ve)?(Ce.addKeys(Ve),(Me=Me==="delete"||Ve.length===Ae.length?qa(Ve,Ue):null)||Oe.addKeys(Ve),(Me||Ae)&&(oe=ne,ge=Me,fe=Ae,j.indexes.forEach(function(Ne){var nt=oe(Ne.name||"");function rt(ft){return ft!=null?Ne.extractKey(ft):null}function st(ft){Ne.multiEntry&&g(ft)?ft.forEach(function(yn){return nt.addKey(yn)}):nt.addKey(ft)}(ge||fe).forEach(function(ft,jt){var it=ge&&rt(ge[jt]),jt=fe&&rt(fe[jt]);ct(it,jt)!==0&&(it!=null&&st(it),jt!=null)&&st(jt)})}))):Ve?(Ae={from:(Ue=Ve.lower)!=null?Ue:s.MIN_KEY,to:(Me=Ve.upper)!=null?Me:s.MAX_KEY},Oe.add(Ae),Ce.add(Ae)):(Ce.add(h),Oe.add(h),j.indexes.forEach(function(Ne){return ne(Ne.name).add(h)})),k.mutate(re).then(function(Ne){return!Ve||re.type!=="add"&&re.type!=="put"||(Ce.addKeys(Ne.results),W&&W.forEach(function(nt){for(var rt=re.values.map(function(it){return nt.extractKey(it)}),st=nt.keyPath.findIndex(function(it){return it===I.keyPath}),ft=0,yn=Ne.results.length;ft<yn;++ft)rt[ft][st]=Ne.results[ft];ne(nt.name).addKeys(rt)})),ve.mutatedParts=Zi(ve.mutatedParts||{},Ee),Ne})}}),ie={get:function(re){return[I,new Jt(re.key)]},getMany:function(re){return[I,new Jt().addKeys(re.keys)]},count:_,query:_,openCursor:_};return d(ie).forEach(function(re){Z[re]=function(ne){var oe=qe.subscr,ge=!!oe,fe=Wa(qe,k)&&Ya(re,ne)?ne.obsSet={}:oe;if(ge){var ve,oe=function(Ae){return Ae="idb://".concat(c,"/").concat(y,"/").concat(Ae),fe[Ae]||(fe[Ae]=new Jt)},Ee=oe(""),Ce=oe(":dels"),ge=ie[re](ne),Oe=ge[0],ge=ge[1];if((re==="query"&&Oe.isPrimaryKey&&!ne.values?Ce:oe(Oe.name||"")).add(ge),!Oe.isPrimaryKey){if(re!=="count")return ve=re==="query"&&J&&ne.values&&k.query(a(a({},ne),{values:!1})),k[re].apply(this,arguments).then(function(Ae){if(re==="query"){if(J&&ne.values)return ve.then(function(rt){return rt=rt.result,Ee.addKeys(rt),Ae});var Ue=ne.values?Ae.result.map(se):Ae.result;(ne.values?Ee:Ce).addKeys(Ue)}else{var Ne,nt;if(re==="openCursor")return nt=ne.values,(Ne=Ae)&&Object.create(Ne,{key:{get:function(){return Ce.addKey(Ne.primaryKey),Ne.key}},primaryKey:{get:function(){var rt=Ne.primaryKey;return Ce.addKey(rt),rt}},value:{get:function(){return nt&&Ee.addKey(Ne.primaryKey),Ne.value}}})}return Ae});Ce.add(h)}}return k[re].apply(this,arguments)}}),Z}})}};function Fo(s,c,h){var y;return h.numFailures===0?c:c.type==="deleteRange"||(y=c.keys?c.keys.length:"values"in c&&c.values?c.values.length:1,h.numFailures===y)?null:(y=a({},c),g(y.keys)&&(y.keys=y.keys.filter(function(_,k){return!(k in h.failures)})),"values"in y&&g(y.values)&&(y.values=y.values.filter(function(_,k){return!(k in h.failures)})),y)}function Ys(s,c){return h=s,((y=c).lower===void 0||(y.lowerOpen?0<ct(h,y.lower):0<=ct(h,y.lower)))&&(h=s,(y=c).upper===void 0||(y.upperOpen?ct(h,y.upper)<0:ct(h,y.upper)<=0));var h,y}function Xs(s,c,h,y,_,k){var j,I,G,se,J,W,Z;return!h||h.length===0||(j=c.query.index,I=j.multiEntry,G=c.query.range,se=y.schema.primaryKey.extractKey,J=j.extractKey,W=(j.lowLevelIndex||j).extractKey,(y=h.reduce(function(ie,re){var ne=ie,oe=[];if(re.type==="add"||re.type==="put")for(var ge=new Jt,fe=re.values.length-1;0<=fe;--fe){var ve,Ee=re.values[fe],Ce=se(Ee);!ge.hasKey(Ce)&&(ve=J(Ee),I&&g(ve)?ve.some(function(Ue){return Ys(Ue,G)}):Ys(ve,G))&&(ge.addKey(Ce),oe.push(Ee))}switch(re.type){case"add":var Oe=new Jt().addKeys(c.values?ie.map(function(Ne){return se(Ne)}):ie),ne=ie.concat(c.values?oe.filter(function(Ne){return Ne=se(Ne),!Oe.hasKey(Ne)&&(Oe.addKey(Ne),!0)}):oe.map(function(Ne){return se(Ne)}).filter(function(Ne){return!Oe.hasKey(Ne)&&(Oe.addKey(Ne),!0)}));break;case"put":var Me=new Jt().addKeys(re.values.map(function(Ne){return se(Ne)}));ne=ie.filter(function(Ne){return!Me.hasKey(c.values?se(Ne):Ne)}).concat(c.values?oe:oe.map(function(Ne){return se(Ne)}));break;case"delete":var Ve=new Jt().addKeys(re.keys);ne=ie.filter(function(Ne){return!Ve.hasKey(c.values?se(Ne):Ne)});break;case"deleteRange":var Ae=re.range;ne=ie.filter(function(Ne){return!Ys(se(Ne),Ae)})}return ne},s))===s)?s:(Z=function(ie,re){return ct(W(ie),W(re))||ct(se(ie),se(re))},y.sort(c.direction==="prev"||c.direction==="prevunique"?function(ie,re){return Z(re,ie)}:Z),c.limit&&c.limit<1/0&&(y.length>c.limit?y.length=c.limit:s.length===c.limit&&y.length<c.limit&&(_.dirty=!0)),k?Object.freeze(y):y)}function Qs(s,c){return ct(s.lower,c.lower)===0&&ct(s.upper,c.upper)===0&&!!s.lowerOpen==!!c.lowerOpen&&!!s.upperOpen==!!c.upperOpen}function Xa(s,c){return((h,y,_,k)=>{if(h===void 0)return y!==void 0?-1:0;if(y===void 0)return 1;if((h=ct(h,y))===0){if(_&&k)return 0;if(_)return 1;if(k)return-1}return h})(s.lower,c.lower,s.lowerOpen,c.lowerOpen)<=0&&0<=((h,y,_,k)=>{if(h===void 0)return y!==void 0?1:0;if(y===void 0)return-1;if((h=ct(h,y))===0){if(_&&k)return 0;if(_)return-1;if(k)return 1}return h})(s.upper,c.upper,s.upperOpen,c.upperOpen)}function Qa(s,c,h,y){s.subscribers.add(h),y.addEventListener("abort",function(){var _,k;s.subscribers.delete(h),s.subscribers.size===0&&(_=s,k=c,setTimeout(function(){_.subscribers.size===0&&L(k,_)},3e3))})}var Ga={stack:"dbcore",level:0,name:"Cache",create:function(s){var c=s.schema.name;return a(a({},s),{transaction:function(h,y,_){var k,j,I=s.transaction(h,y,_);return y==="readwrite"&&(_=(k=new AbortController).signal,I.addEventListener("abort",(j=function(G){return function(){if(k.abort(),y==="readwrite"){for(var se=new Set,J=0,W=h;J<W.length;J++){var Z=W[J],ie=Ur["idb://".concat(c,"/").concat(Z)];if(ie){var re=s.table(Z),ne=ie.optimisticOps.filter(function(Ne){return Ne.trans===I});if(I._explicit&&G&&I.mutatedParts)for(var oe=0,ge=Object.values(ie.queries.query);oe<ge.length;oe++)for(var fe=0,ve=(Oe=ge[oe]).slice();fe<ve.length;fe++)Fs((Me=ve[fe]).obsSet,I.mutatedParts)&&(L(Oe,Me),Me.subscribers.forEach(function(Ne){return se.add(Ne)}));else if(0<ne.length){ie.optimisticOps=ie.optimisticOps.filter(function(Ne){return Ne.trans!==I});for(var Ee=0,Ce=Object.values(ie.queries.query);Ee<Ce.length;Ee++)for(var Oe,Me,Ve,Ae=0,Ue=(Oe=Ce[Ee]).slice();Ae<Ue.length;Ae++)(Me=Ue[Ae]).res!=null&&I.mutatedParts&&(G&&!Me.dirty?(Ve=Object.isFrozen(Me.res),Ve=Xs(Me.res,Me.req,ne,re,Me,Ve),Me.dirty?(L(Oe,Me),Me.subscribers.forEach(function(Ne){return se.add(Ne)})):Ve!==Me.res&&(Me.res=Ve,Me.promise=Fe.resolve({result:Ve}))):(Me.dirty&&L(Oe,Me),Me.subscribers.forEach(function(Ne){return se.add(Ne)})))}}}se.forEach(function(Ne){return Ne()})}}})(!1),{signal:_}),I.addEventListener("error",j(!1),{signal:_}),I.addEventListener("complete",j(!0),{signal:_})),I},table:function(h){var y=s.table(h),_=y.schema.primaryKey;return a(a({},y),{mutate:function(k){var j,I=qe.trans;return!_.outbound&&I.db._options.cache!=="disabled"&&!I.explicit&&I.idbtrans.mode==="readwrite"&&(j=Ur["idb://".concat(c,"/").concat(h)])?(I=y.mutate(k),k.type!=="add"&&k.type!=="put"||!(50<=k.values.length||qs(_,k).some(function(G){return G==null}))?(j.optimisticOps.push(k),k.mutatedParts&&Ji(k.mutatedParts),I.then(function(G){0<G.numFailures&&(L(j.optimisticOps,k),(G=Fo(0,k,G))&&j.optimisticOps.push(G),k.mutatedParts)&&Ji(k.mutatedParts)}),I.catch(function(){L(j.optimisticOps,k),k.mutatedParts&&Ji(k.mutatedParts)})):I.then(function(G){var se=Fo(0,a(a({},k),{values:k.values.map(function(J,W){var Z;return G.failures[W]?J:(U(Z=(Z=_.keyPath)!=null&&Z.includes(".")?xe(J):a({},J),_.keyPath,G.results[W]),Z)})}),G);j.optimisticOps.push(se),queueMicrotask(function(){return k.mutatedParts&&Ji(k.mutatedParts)})}),I):y.mutate(k)},query:function(k){var j,I,G,se,J,W,Z;return Wa(qe,y)&&Ya("query",k)?(j=((G=qe.trans)==null?void 0:G.db._options.cache)==="immutable",I=(G=qe).requery,G=G.signal,W=((ie,re,ne,oe)=>{var ge=Ur["idb://".concat(ie,"/").concat(re)];if(!ge)return[];if(!(ie=ge.queries[ne]))return[null,!1,ge,null];var fe=ie[(oe.query?oe.query.index.name:null)||""];if(!fe)return[null,!1,ge,null];switch(ne){case"query":var ve=(Ee=oe.direction)!=null?Ee:"next",Ee=fe.find(function(Ce){var Oe;return Ce.req.limit===oe.limit&&Ce.req.values===oe.values&&((Oe=Ce.req.direction)!=null?Oe:"next")===ve&&Qs(Ce.req.query.range,oe.query.range)});return Ee?[Ee,!0,ge,fe]:[fe.find(function(Ce){var Oe;return("limit"in Ce.req?Ce.req.limit:1/0)>=oe.limit&&((Oe=Ce.req.direction)!=null?Oe:"next")===ve&&(!oe.values||Ce.req.values)&&Xa(Ce.req.query.range,oe.query.range)}),!1,ge,fe];case"count":return Ee=fe.find(function(Ce){return Qs(Ce.req.query.range,oe.query.range)}),[Ee,!!Ee,ge,fe]}})(c,h,"query",k),Z=W[0],se=W[2],J=W[3],Z&&W[1]?Z.obsSet=k.obsSet:(W=y.query(k).then(function(ie){var re=ie.result;if(Z&&(Z.res=re),j){for(var ne=0,oe=re.length;ne<oe;++ne)Object.freeze(re[ne]);Object.freeze(re)}else ie.result=xe(re);return ie}).catch(function(ie){return J&&Z&&L(J,Z),Promise.reject(ie)}),Z={obsSet:k.obsSet,promise:W,subscribers:new Set,type:"query",req:k,dirty:!1},J?J.push(Z):(J=[Z],(se=se||(Ur["idb://".concat(c,"/").concat(h)]={queries:{query:{},count:{}},objs:new Map,optimisticOps:[],unsignaledParts:{}})).queries.query[k.query.index.name||""]=J)),Qa(Z,J,I,G),Z.promise.then(function(ie){return{result:Xs(ie.result,k,se==null?void 0:se.optimisticOps,y,Z,j)}})):y.query(k)}})}})}};function br(s,c){return new Proxy(s,{get:function(h,y,_){return y==="db"?c:Reflect.get(h,y,_)}})}Rt.prototype.version=function(s){if(isNaN(s)||s<.1)throw new ke.Type("Given version is not a positive number");if(s=Math.round(10*s)/10,this.idbdb||this._state.isBeingOpened)throw new ke.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,s);var c=this._versions,h=c.filter(function(y){return y._cfg.version===s})[0];return h||(h=new this.Version(s),c.push(h),c.sort(Kr),h.stores({}),this._state.autoSchema=!1),h},Rt.prototype._whenReady=function(s){var c=this;return this.idbdb&&(this._state.openComplete||qe.letThrough||this._vip)?s():new Fe(function(h,y){if(c._state.openComplete)return y(new ke.DatabaseClosed(c._state.dbOpenError));if(!c._state.isBeingOpened){if(!c._state.autoOpen)return void y(new ke.DatabaseClosed);c.open().catch(Le)}c._state.dbReadyPromise.then(h,y)}).then(s)},Rt.prototype.use=function(_){var c=_.stack,h=_.create,y=_.level,_=_.name,k=(_&&this.unuse({stack:c,name:_}),this._middlewares[c]||(this._middlewares[c]=[]));return k.push({stack:c,create:h,level:y??10,name:_}),k.sort(function(j,I){return j.level-I.level}),this},Rt.prototype.unuse=function(s){var c=s.stack,h=s.name,y=s.create;return c&&this._middlewares[c]&&(this._middlewares[c]=this._middlewares[c].filter(function(_){return y?_.create!==y:!!h&&_.name!==h})),this},Rt.prototype.open=function(){var s=this;return ir(kn,function(){return $u(s)})},Rt.prototype._close=function(){this.on.close.fire(new CustomEvent("close"));var s=this._state;if(co.remove(this),this.idbdb){try{this.idbdb.close()}catch{}this.idbdb=null}s.isBeingOpened||(s.dbReadyPromise=new Fe(function(c){s.dbReadyResolve=c}),s.openCanceller=new Fe(function(c,h){s.cancelOpen=h}))},Rt.prototype.close=function(c){var c=(c===void 0?{disableAutoOpen:!0}:c).disableAutoOpen,h=this._state;c?(h.isBeingOpened&&h.cancelOpen(new ke.DatabaseClosed),this._close(),h.autoOpen=!1,h.dbOpenError=new ke.DatabaseClosed):(this._close(),h.autoOpen=this._options.autoOpen||h.isBeingOpened,h.openComplete=!1,h.dbOpenError=null)},Rt.prototype.delete=function(s){var c=this,h=(s===void 0&&(s={disableAutoOpen:!0}),0<arguments.length&&typeof arguments[0]!="object"),y=this._state;return new Fe(function(_,k){function j(){c.close(s);var I=c._deps.indexedDB.deleteDatabase(c.name);I.onsuccess=pt(function(){var G,se,J;G=c._deps,se=c.name,fo(J=G.indexedDB)||se===Lr||yi(J,G.IDBKeyRange).delete(se).catch(Le),_()}),I.onerror=un(k),I.onblocked=c._fireOnBlocked}if(h)throw new ke.InvalidArgument("Invalid closeOptions argument to db.delete()");y.isBeingOpened?y.dbReadyPromise.then(j):j()})},Rt.prototype.backendDB=function(){return this.idbdb},Rt.prototype.isOpen=function(){return this.idbdb!==null},Rt.prototype.hasBeenClosed=function(){var s=this._state.dbOpenError;return s&&s.name==="DatabaseClosed"},Rt.prototype.hasFailed=function(){return this._state.dbOpenError!==null},Rt.prototype.dynamicallyOpened=function(){return this._state.autoSchema},Object.defineProperty(Rt.prototype,"tables",{get:function(){var s=this;return d(this._allTables).map(function(c){return s._allTables[c]})},enumerable:!1,configurable:!0}),Rt.prototype.transaction=function(){var s=(function(c,h,y){var _=arguments.length;if(_<2)throw new ke.InvalidArgument("Too few arguments");for(var k=new Array(_-1);--_;)k[_-1]=arguments[_];return y=k.pop(),[c,Se(k),y]}).apply(this,arguments);return this._transaction.apply(this,s)},Rt.prototype._transaction=function(s,c,h){var y,_,k=this,j=qe.trans,I=(j&&j.db===this&&s.indexOf("!")===-1||(j=null),s.indexOf("?")!==-1);s=s.replace("!","").replace("?","");try{if(_=c.map(function(se){if(se=se instanceof k.Table?se.name:se,typeof se!="string")throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");return se}),s=="r"||s===Io)y=Io;else{if(s!="rw"&&s!=Fr)throw new ke.InvalidArgument("Invalid transaction mode: "+s);y=Fr}if(j){if(j.mode===Io&&y===Fr){if(!I)throw new ke.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");j=null}j&&_.forEach(function(se){if(j&&j.storeNames.indexOf(se)===-1){if(!I)throw new ke.SubTransaction("Table "+se+" not included in parent transaction.");j=null}}),I&&j&&!j.active&&(j=null)}}catch(se){return j?j._promise(null,function(J,W){W(se)}):Pt(se)}var G=(function se(J,W,Z,ie,re){return Fe.resolve().then(function(){var fe=qe.transless||qe,ne=J._createTransaction(W,Z,J._dbSchema,ie),fe=(ne.explicit=!0,{trans:ne,transless:fe});if(ie)ne.idbtrans=ie.idbtrans;else try{ne.create(),ne.idbtrans._explicit=!0,J._state.PR1398_maxLoop=3}catch(ve){return ve.name===we.InvalidState&&J.isOpen()&&0<--J._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),J.close({disableAutoOpen:!1}),J.open().then(function(){return se(J,W,Z,null,re)})):Pt(ve)}var oe,ge=O(re),fe=(ge&&zr(),Fe.follow(function(){var ve;(oe=re.call(ne,ne))&&(ge?(ve=Yt.bind(null,null),oe.then(ve,ve)):typeof oe.next=="function"&&typeof oe.throw=="function"&&(oe=Ks(oe)))},fe));return(oe&&typeof oe.then=="function"?Fe.resolve(oe).then(function(ve){return ne.active?ve:Pt(new ke.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))}):fe.then(function(){return oe})).then(function(ve){return ie&&ne._resolve(),ne._completion.then(function(){return ve})}).catch(function(ve){return ne._reject(ve),Pt(ve)})})}).bind(null,this,y,_,j,h);return j?j._promise(y,G,"lock"):qe.trans?ir(qe.transless,function(){return k._whenReady(G)}):this._whenReady(G)},Rt.prototype.table=function(s){if(x(this._allTables,s))return this._allTables[s];throw new ke.InvalidTable("Table ".concat(s," does not exist"))};var kr=Rt;function Rt(s,c){var h,y,_,k,j,I=this,G=(this._middlewares={},this.verno=0,Rt.dependencies),G=(this._options=c=a({addons:Rt.addons,autoOpen:!0,indexedDB:G.indexedDB,IDBKeyRange:G.IDBKeyRange,cache:"cloned",maxConnections:1e3},c),this._deps={indexedDB:c.indexedDB,IDBKeyRange:c.IDBKeyRange},c.addons),se=(this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null,this._novip=this,{dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:Le,dbReadyPromise:null,cancelOpen:Le,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3,autoOpen:c.autoOpen}),J=(se.dbReadyPromise=new Fe(function(W){se.dbReadyResolve=W}),se.openCanceller=new Fe(function(W,Z){se.cancelOpen=Z}),this._state=se,this.name=s,this.on=Br(this,"populate","blocked","versionchange","close",{ready:[qt,Le]}),this.once=function(W,Z){var ie=function(){for(var re=[],ne=0;ne<arguments.length;ne++)re[ne]=arguments[ne];I.on(W).unsubscribe(ie),Z.apply(I,re)};return I.on(W,ie)},this.on.ready.subscribe=M(this.on.ready.subscribe,function(W){return function(Z,ie){Rt.vip(function(){var re,ne=I._state;ne.openComplete?(ne.dbOpenError||Fe.resolve().then(Z),ie&&W(Z)):ne.onReadyBeingFired?(ne.onReadyBeingFired.push(Z),ie&&W(Z)):(W(Z),re=I,ie||W(function oe(){re.on.ready.unsubscribe(Z),re.on.ready.unsubscribe(oe)}))})}}),this.Collection=(h=this,oo(Fa.prototype,function(oe,ne){this.db=h;var ie=ci,re=null;if(ne)try{ie=ne()}catch(fe){re=fe}var ne=oe._ctx,oe=ne.table,ge=oe.hook.reading.fire;this._ctx={table:oe,index:ne.index,isPrimKey:!ne.index||oe.schema.primKey.keyPath&&ne.index===oe.schema.primKey.name,range:ie,keysOnly:!1,dir:"next",unique:"",algorithm:null,filter:null,replayFilter:null,justLimit:!0,isMatch:null,offset:0,limit:1/0,error:re,or:ne.or,valueMapper:ge!==Be?ge:null}})),this.Table=(y=this,oo(Wn.prototype,function(W,Z,ie){this.db=y,this._tx=ie,this.name=W,this.schema=Z,this.hook=y._allTables[W]?y._allTables[W].hook:Br(null,{creating:[lt,Le],reading:[ut,Be],updating:[Sn,Le],deleting:[kt,Le]})})),this.Transaction=(_=this,oo(Iu.prototype,function(W,Z,ie,re,ne){var oe=this;W!=="readonly"&&Z.forEach(function(ge){ge=(ge=ie[ge])==null?void 0:ge.yProps,ge&&(Z=Z.concat(ge.map(function(fe){return fe.updatesTable})))}),this.db=_,this.mode=W,this.storeNames=Z,this.schema=ie,this.chromeTransactionDurability=re,this.idbtrans=null,this.on=Br(this,"complete","error","abort"),this.parent=ne||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 Fe(function(ge,fe){oe._resolve=ge,oe._reject=fe}),this._completion.then(function(){oe.active=!1,oe.on.complete.fire()},function(ge){var fe=oe.active;return oe.active=!1,oe.on.error.fire(ge),oe.parent?oe.parent._reject(ge):fe&&oe.idbtrans&&oe.idbtrans.abort(),Pt(ge)})})),this.Version=(k=this,oo(gi.prototype,function(W){this.db=k,this._cfg={version:W,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}})),this.WhereClause=(j=this,oo(wr.prototype,function(W,Z,ie){if(this.db=j,this._ctx={table:W,index:Z===":id"?null:Z,or:ie},this._cmp=this._ascending=ct,this._descending=function(re,ne){return ct(ne,re)},this._max=function(re,ne){return 0<ct(re,ne)?re:ne},this._min=function(re,ne){return ct(re,ne)<0?re:ne},this._IDBKeyRange=j._deps.IDBKeyRange,!this._IDBKeyRange)throw new ke.MissingAPI})),this.on("versionchange",function(W){0<W.newVersion?console.warn("Another connection wants to upgrade database '".concat(I.name,"'. Closing db now to resume the upgrade.")):console.warn("Another connection wants to delete database '".concat(I.name,"'. Closing db now to resume the delete request.")),I.close({disableAutoOpen:!1})}),this.on("blocked",function(W){!W.newVersion||W.newVersion<W.oldVersion?console.warn("Dexie.delete('".concat(I.name,"') was blocked")):console.warn("Upgrade '".concat(I.name,"' blocked by other connection holding version ").concat(W.oldVersion/10))}),this._maxKey=_r(c.IDBKeyRange),this._createTransaction=function(W,Z,ie,re){return new I.Transaction(W,Z,ie,I._options.chromeTransactionDurability,re)},this._fireOnBlocked=function(W){I.on("blocked").fire(W),co.toArray().filter(function(Z){return Z.name===I.name&&Z!==I&&!Z._state.vcFired}).map(function(Z){return Z.on("versionchange").fire(W)})},this.use(Ru),this.use(Ga),this.use(Ws),this.use(Ua),this.use(Ou),new Proxy(this,{get:function(W,Z,ie){var re;return Z==="_vip"||(Z==="table"?function(ne){return br(I.table(ne),J)}:(re=Reflect.get(W,Z,ie))instanceof Wn?br(re,J):Z==="tables"?re.map(function(ne){return br(ne,J)}):Z==="_createTransaction"?function(){return br(re.apply(this,arguments),J)}:re)}}));this.vip=J,G.forEach(function(W){return W(I)})}var ns,po=typeof Symbol<"u"&&"observable"in Symbol?Symbol.observable:"@@observable",Za=(ho.prototype.subscribe=function(s,c,h){return this._subscribe(s&&typeof s!="function"?s:{next:s,error:c,complete:h})},ho.prototype[po]=function(){return this},ho);function ho(s){this._subscribe=s}try{ns={indexedDB:f.indexedDB||f.mozIndexedDB||f.webkitIndexedDB||f.msIndexedDB,IDBKeyRange:f.IDBKeyRange||f.webkitIDBKeyRange}}catch{ns={indexedDB:null,IDBKeyRange:null}}function Bo(s){var c,h=!1,y=new Za(function(_){var k=O(s),j,I=!1,G={},se={},J={get closed(){return I},unsubscribe:function(){I||(I=!0,j&&j.abort(),W&&Rn.storagemutated.unsubscribe(re))}},W=(_.start&&_.start(J),!1),Z=function(){return To(ne)};function ie(){return Fs(se,G)}var re=function(oe){Zi(G,oe),ie()&&Z()},ne=function(){var oe,ge,fe;!I&&ns.indexedDB&&(G={},oe={},j&&j.abort(),j=new AbortController,fe=(ve=>{var Ee=Bt();try{k&&zr();var Ce=rr(s,ve);return Ce=k?Ce.finally(Yt):Ce}finally{Ee&&Ht()}})(ge={subscr:oe,signal:j.signal,requery:Z,querier:s,trans:null}),W||(Rn(di,re),W=!0),Promise.resolve(fe).then(function(ve){h=!0,c=ve,I||ge.signal.aborted||(ie()||(se=oe,ie())?Z():(G={},To(function(){return!I&&_.next&&_.next(ve)})))},function(ve){h=!1,["DatabaseClosedError","AbortError"].includes(ve==null?void 0:ve.name)||I||To(function(){I||_.error&&_.error(ve)})}))};return setTimeout(Z,0),J});return y.hasValue=function(){return h},y.getValue=function(){return c},y}var mo=kr;function Ho(s){var c=Er;try{Er=!0,Rn.storagemutated.fire(s),Vs(s,!0)}finally{Er=c}}b(mo,a(a({},B),{delete:function(s){return new mo(s,{addons:[]}).delete()},exists:function(s){return new mo(s,{addons:[]}).open().then(function(c){return c.close(),!0}).catch("NoSuchDatabaseError",function(){return!1})},getDatabaseNames:function(s){try{return c=mo.dependencies,h=c.indexedDB,c=c.IDBKeyRange,(fo(h)?Promise.resolve(h.databases()).then(function(y){return y.map(function(_){return _.name}).filter(function(_){return _!==Lr})}):yi(h,c).toCollection().primaryKeys()).then(s)}catch{return Pt(new ke.MissingAPI)}var c,h},defineClass:function(){return function(s){v(this,s)}},ignoreTransaction:function(s){return qe.trans?ir(qe.transless||kn,s):s()},vip:Lo,async:function(s){return function(){try{var c=Ks(s.apply(this,arguments));return c&&typeof c.then=="function"?c:Fe.resolve(c)}catch(h){return Pt(h)}}},spawn:function(s,c,h){try{var y=Ks(s.apply(h,c||[]));return y&&typeof y.then=="function"?y:Fe.resolve(y)}catch(_){return Pt(_)}},currentTransaction:{get:function(){return qe.trans||null}},waitFor:function(s,c){return s=Fe.resolve(typeof s=="function"?mo.ignoreTransaction(s):s).timeout(c||6e4),qe.trans?qe.trans.waitFor(s):s},Promise:Fe,debug:{get:function(){return Et},set:function(s){jn(s)}},derive:A,extend:v,props:b,override:M,Events:Br,on:Rn,liveQuery:Bo,extendObservabilitySet:Zi,getByKeyPath:V,setByKeyPath:U,delByKeyPath:function(s,c){typeof c=="string"?U(s,c,void 0):"length"in c&&[].map.call(c,function(h){U(s,h,void 0)})},shallowClone:le,deepClone:xe,getObjectDiff:Us,cmp:ct,asap:Y,minKey:-1/0,addons:[],connections:{get:co.toArray},errnames:we,dependencies:ns,cache:Ur,semVer:"4.4.2",version:"4.4.2".split(".").map(function(s){return parseInt(s)}).reduce(function(s,c,h){return s+c/Math.pow(10,2*h)})})),mo.maxKey=_r(mo.dependencies.IDBKeyRange),typeof dispatchEvent<"u"&&typeof addEventListener<"u"&&(Rn(di,function(s){Er||(s=new CustomEvent(Vi,{detail:s}),Er=!0,dispatchEvent(s),Er=!1)}),addEventListener(Vi,function(s){s=s.detail,Er||Ho(s)}));var Vo,Er=!1,rs=function(){};return typeof BroadcastChannel<"u"&&((rs=function(){(Vo=new BroadcastChannel(Vi)).onmessage=function(s){return s.data&&Ho(s.data)}})(),typeof Vo.unref=="function"&&Vo.unref(),Rn(di,function(s){Er||Vo.postMessage(s)})),typeof addEventListener<"u"&&(addEventListener("pagehide",function(s){if(!kr.disableBfCache&&s.persisted){Et&&console.debug("Dexie: handling persisted pagehide"),Vo!=null&&Vo.close();for(var c=0,h=co.toArray();c<h.length;c++)h[c].close({disableAutoOpen:!1})}}),addEventListener("pageshow",function(s){!kr.disableBfCache&&s.persisted&&(Et&&console.debug("Dexie: handling persisted pageshow"),rs(),Ho({all:new Jt(-1/0,[[]])}))})),Fe.rejectionMapper=function(s,c){return!s||s instanceof _e||s instanceof TypeError||s instanceof SyntaxError||!s.name||!Ge[s.name]?s:(c=new Ge[s.name](c||s.message,s),"stack"in s&&C(c,"stack",{get:function(){return this.inner.stack}}),c)},jn(Et),a(kr,Object.freeze({__proto__:null,DEFAULT_MAX_CONNECTIONS:1e3,Dexie:kr,Entity:Nn,PropModification:to,RangeSet:Jt,add:function(s){return new to({add:s})},cmp:ct,default:kr,liveQuery:Bo,mergeRanges:xi,rangesOverlap:Qi,remove:function(s){return new to({remove:s})},replacePrefix:function(s,c){return new to({replacePrefix:[s,c]})}}),{default:kr}),kr})})(Zl)),Zl.exports}var E0=k0();const yf=yu(E0),Gp=Symbol.for("Dexie"),iu=globalThis[Gp]||(globalThis[Gp]=yf);if(yf.semVer!==iu.semVer)throw new Error(`Two different versions of Dexie loaded in the same app: ${yf.semVer} and ${iu.semVer}`);const{liveQuery:Yb,mergeRanges:Xb,rangesOverlap:Qb,RangeSet:Gb,cmp:Zb,Entity:Jb,PropModification:ek,replacePrefix:tk,add:nk,remove:rk,DexieYProvider:ok}=iu;class N0 extends iu{constructor(){super("api-doc-tor");ma(this,"flows");ma(this,"testSuites");ma(this,"environments");ma(this,"kv");this.version(1).stores({flows:"++id, name",testSuites:"++id, name",environments:"++id, name",kv:"key"})}}const St=new N0;async function C0(){const[t,r,i]=await Promise.all([St.flows.toArray(),St.testSuites.toArray(),St.environments.toArray()]),a=await St.kv.get("authTokens");let u;try{u=a!=null&&a.value?JSON.parse(a.value):void 0}catch{u=void 0}return{formatVersion:1,exportedAt:new Date().toISOString(),flows:t,testSuites:r,environments:i,authTokens:u}}async function P0(t){await St.transaction("rw",St.flows,St.testSuites,St.environments,St.kv,async()=>{await St.flows.clear(),await St.testSuites.clear(),await St.environments.clear();for(const r of t.flows)await St.flows.add({name:r.name,steps:r.steps,graph:r.graph});for(const r of t.testSuites)await St.testSuites.add({name:r.name,cases:r.cases});for(const r of t.environments)await St.environments.add({name:r.name,baseUrl:r.baseUrl,vars:r.vars??{}});t.authTokens&&await St.kv.put({key:"authTokens",value:JSON.stringify(t.authTokens)})})}function j0(t,r,i){var d,g;const a=[],u=r===t.expectStatus;if(a.push(`HTTP ${r} ${u?"✓":`✗ (esperado ${t.expectStatus})`}`),!u)return{pass:!1,lines:a};if((d=t.contains)!=null&&d.trim()){const v=i.includes(t.contains);if(a.push(`Contiene texto "${t.contains}": ${v?"✓":"✗"}`),!v)return{pass:!1,lines:a}}const f=(g=t.jsonPath)==null?void 0:g.trim();if(f){let v;try{v=JSON.parse(i)}catch{return a.push("Body no es JSON válido: ✗"),{pass:!1,lines:a}}const w=Af(v,f),S=t.expectJsonValue;if(S!==void 0&&S!==""){const x=w==null?String(w):typeof w=="object"?JSON.stringify(w):String(w),b=S.trim(),N=x===b||String(w)===b;if(a.push(`JSON path ${f} → ${x} vs "${b}": ${N?"✓":"✗"}`),!N)return{pass:!1,lines:a}}else{const x=w!=null;if(a.push(`JSON path ${f} existe: ${x?"✓":"✗"}`),!x)return{pass:!1,lines:a}}}return{pass:!0,lines:a}}function Ut(t){if(typeof t=="string"||typeof t=="number")return""+t;let r="";if(Array.isArray(t))for(let i=0,a;i<t.length;i++)(a=Ut(t[i]))!==""&&(r+=(r&&" ")+a);else for(let i in t)t[i]&&(r+=(r&&" ")+i);return r}var M0={value:()=>{}};function _u(){for(var t=0,r=arguments.length,i={},a;t<r;++t){if(!(a=arguments[t]+"")||a in i||/[\s.]/.test(a))throw new Error("illegal type: "+a);i[a]=[]}return new Jl(i)}function Jl(t){this._=t}function T0(t,r){return t.trim().split(/^|\s+/).map(function(i){var a="",u=i.indexOf(".");if(u>=0&&(a=i.slice(u+1),i=i.slice(0,u)),i&&!r.hasOwnProperty(i))throw new Error("unknown type: "+i);return{type:i,name:a}})}Jl.prototype=_u.prototype={constructor:Jl,on:function(t,r){var i=this._,a=T0(t+"",i),u,f=-1,d=a.length;if(arguments.length<2){for(;++f<d;)if((u=(t=a[f]).type)&&(u=I0(i[u],t.name)))return u;return}if(r!=null&&typeof r!="function")throw new Error("invalid callback: "+r);for(;++f<d;)if(u=(t=a[f]).type)i[u]=Zp(i[u],t.name,r);else if(r==null)for(u in i)i[u]=Zp(i[u],t.name,null);return this},copy:function(){var t={},r=this._;for(var i in r)t[i]=r[i].slice();return new Jl(t)},call:function(t,r){if((u=arguments.length-2)>0)for(var i=new Array(u),a=0,u,f;a<u;++a)i[a]=arguments[a+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(f=this._[t],a=0,u=f.length;a<u;++a)f[a].value.apply(r,i)},apply:function(t,r,i){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var a=this._[t],u=0,f=a.length;u<f;++u)a[u].value.apply(r,i)}};function I0(t,r){for(var i=0,a=t.length,u;i<a;++i)if((u=t[i]).name===r)return u.value}function Zp(t,r,i){for(var a=0,u=t.length;a<u;++a)if(t[a].name===r){t[a]=M0,t=t.slice(0,a).concat(t.slice(a+1));break}return i!=null&&t.push({name:r,value:i}),t}var vf="http://www.w3.org/1999/xhtml";const Jp={svg:"http://www.w3.org/2000/svg",xhtml:vf,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Su(t){var r=t+="",i=r.indexOf(":");return i>=0&&(r=t.slice(0,i))!=="xmlns"&&(t=t.slice(i+1)),Jp.hasOwnProperty(r)?{space:Jp[r],local:t}:t}function A0(t){return function(){var r=this.ownerDocument,i=this.namespaceURI;return i===vf&&r.documentElement.namespaceURI===vf?r.createElement(t):r.createElementNS(i,t)}}function $0(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function pm(t){var r=Su(t);return(r.local?$0:A0)(r)}function O0(){}function $f(t){return t==null?O0:function(){return this.querySelector(t)}}function R0(t){typeof t!="function"&&(t=$f(t));for(var r=this._groups,i=r.length,a=new Array(i),u=0;u<i;++u)for(var f=r[u],d=f.length,g=a[u]=new Array(d),v,w,S=0;S<d;++S)(v=f[S])&&(w=t.call(v,v.__data__,S,f))&&("__data__"in v&&(w.__data__=v.__data__),g[S]=w);return new Jn(a,this._parents)}function z0(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function D0(){return[]}function hm(t){return t==null?D0:function(){return this.querySelectorAll(t)}}function L0(t){return function(){return z0(t.apply(this,arguments))}}function F0(t){typeof t=="function"?t=L0(t):t=hm(t);for(var r=this._groups,i=r.length,a=[],u=[],f=0;f<i;++f)for(var d=r[f],g=d.length,v,w=0;w<g;++w)(v=d[w])&&(a.push(t.call(v,v.__data__,w,d)),u.push(v));return new Jn(a,u)}function mm(t){return function(){return this.matches(t)}}function gm(t){return function(r){return r.matches(t)}}var B0=Array.prototype.find;function H0(t){return function(){return B0.call(this.children,t)}}function V0(){return this.firstElementChild}function K0(t){return this.select(t==null?V0:H0(typeof t=="function"?t:gm(t)))}var U0=Array.prototype.filter;function q0(){return Array.from(this.children)}function W0(t){return function(){return U0.call(this.children,t)}}function Y0(t){return this.selectAll(t==null?q0:W0(typeof t=="function"?t:gm(t)))}function X0(t){typeof t!="function"&&(t=mm(t));for(var r=this._groups,i=r.length,a=new Array(i),u=0;u<i;++u)for(var f=r[u],d=f.length,g=a[u]=[],v,w=0;w<d;++w)(v=f[w])&&t.call(v,v.__data__,w,f)&&g.push(v);return new Jn(a,this._parents)}function ym(t){return new Array(t.length)}function Q0(){return new Jn(this._enter||this._groups.map(ym),this._parents)}function su(t,r){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=r}su.prototype={constructor:su,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 G0(t){return function(){return t}}function Z0(t,r,i,a,u,f){for(var d=0,g,v=r.length,w=f.length;d<w;++d)(g=r[d])?(g.__data__=f[d],a[d]=g):i[d]=new su(t,f[d]);for(;d<v;++d)(g=r[d])&&(u[d]=g)}function J0(t,r,i,a,u,f,d){var g,v,w=new Map,S=r.length,x=f.length,b=new Array(S),N;for(g=0;g<S;++g)(v=r[g])&&(b[g]=N=d.call(v,v.__data__,g,r)+"",w.has(N)?u[g]=v:w.set(N,v));for(g=0;g<x;++g)N=d.call(t,f[g],g,f)+"",(v=w.get(N))?(a[g]=v,v.__data__=f[g],w.delete(N)):i[g]=new su(t,f[g]);for(g=0;g<S;++g)(v=r[g])&&w.get(b[g])===v&&(u[g]=v)}function ev(t){return t.__data__}function tv(t,r){if(!arguments.length)return Array.from(this,ev);var i=r?J0:Z0,a=this._parents,u=this._groups;typeof t!="function"&&(t=G0(t));for(var f=u.length,d=new Array(f),g=new Array(f),v=new Array(f),w=0;w<f;++w){var S=a[w],x=u[w],b=x.length,N=nv(t.call(S,S&&S.__data__,w,a)),C=N.length,A=g[w]=new Array(C),T=d[w]=new Array(C),$=v[w]=new Array(b);i(S,x,A,T,$,N,r);for(var H=0,M=0,R,Y;H<C;++H)if(R=A[H]){for(H>=M&&(M=H+1);!(Y=T[M])&&++M<C;);R._next=Y||null}}return d=new Jn(d,a),d._enter=g,d._exit=v,d}function nv(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function rv(){return new Jn(this._exit||this._groups.map(ym),this._parents)}function ov(t,r,i){var a=this.enter(),u=this,f=this.exit();return typeof t=="function"?(a=t(a),a&&(a=a.selection())):a=a.append(t+""),r!=null&&(u=r(u),u&&(u=u.selection())),i==null?f.remove():i(f),a&&u?a.merge(u).order():u}function iv(t){for(var r=t.selection?t.selection():t,i=this._groups,a=r._groups,u=i.length,f=a.length,d=Math.min(u,f),g=new Array(u),v=0;v<d;++v)for(var w=i[v],S=a[v],x=w.length,b=g[v]=new Array(x),N,C=0;C<x;++C)(N=w[C]||S[C])&&(b[C]=N);for(;v<u;++v)g[v]=i[v];return new Jn(g,this._parents)}function sv(){for(var t=this._groups,r=-1,i=t.length;++r<i;)for(var a=t[r],u=a.length-1,f=a[u],d;--u>=0;)(d=a[u])&&(f&&d.compareDocumentPosition(f)^4&&f.parentNode.insertBefore(d,f),f=d);return this}function av(t){t||(t=lv);function r(x,b){return x&&b?t(x.__data__,b.__data__):!x-!b}for(var i=this._groups,a=i.length,u=new Array(a),f=0;f<a;++f){for(var d=i[f],g=d.length,v=u[f]=new Array(g),w,S=0;S<g;++S)(w=d[S])&&(v[S]=w);v.sort(r)}return new Jn(u,this._parents).order()}function lv(t,r){return t<r?-1:t>r?1:t>=r?0:NaN}function uv(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function cv(){return Array.from(this)}function fv(){for(var t=this._groups,r=0,i=t.length;r<i;++r)for(var a=t[r],u=0,f=a.length;u<f;++u){var d=a[u];if(d)return d}return null}function dv(){let t=0;for(const r of this)++t;return t}function pv(){return!this.node()}function hv(t){for(var r=this._groups,i=0,a=r.length;i<a;++i)for(var u=r[i],f=0,d=u.length,g;f<d;++f)(g=u[f])&&t.call(g,g.__data__,f,u);return this}function mv(t){return function(){this.removeAttribute(t)}}function gv(t){return function(){this.removeAttributeNS(t.space,t.local)}}function yv(t,r){return function(){this.setAttribute(t,r)}}function vv(t,r){return function(){this.setAttributeNS(t.space,t.local,r)}}function xv(t,r){return function(){var i=r.apply(this,arguments);i==null?this.removeAttribute(t):this.setAttribute(t,i)}}function wv(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 _v(t,r){var i=Su(t);if(arguments.length<2){var a=this.node();return i.local?a.getAttributeNS(i.space,i.local):a.getAttribute(i)}return this.each((r==null?i.local?gv:mv:typeof r=="function"?i.local?wv:xv:i.local?vv:yv)(i,r))}function vm(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function Sv(t){return function(){this.style.removeProperty(t)}}function bv(t,r,i){return function(){this.style.setProperty(t,r,i)}}function kv(t,r,i){return function(){var a=r.apply(this,arguments);a==null?this.style.removeProperty(t):this.style.setProperty(t,a,i)}}function Ev(t,r,i){return arguments.length>1?this.each((r==null?Sv:typeof r=="function"?kv:bv)(t,r,i??"")):Cs(this.node(),t)}function Cs(t,r){return t.style.getPropertyValue(r)||vm(t).getComputedStyle(t,null).getPropertyValue(r)}function Nv(t){return function(){delete this[t]}}function Cv(t,r){return function(){this[t]=r}}function Pv(t,r){return function(){var i=r.apply(this,arguments);i==null?delete this[t]:this[t]=i}}function jv(t,r){return arguments.length>1?this.each((r==null?Nv:typeof r=="function"?Pv:Cv)(t,r)):this.node()[t]}function xm(t){return t.trim().split(/^|\s+/)}function Of(t){return t.classList||new wm(t)}function wm(t){this._node=t,this._names=xm(t.getAttribute("class")||"")}wm.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=Of(t),a=-1,u=r.length;++a<u;)i.add(r[a])}function Sm(t,r){for(var i=Of(t),a=-1,u=r.length;++a<u;)i.remove(r[a])}function Mv(t){return function(){_m(this,t)}}function Tv(t){return function(){Sm(this,t)}}function Iv(t,r){return function(){(r.apply(this,arguments)?_m:Sm)(this,t)}}function Av(t,r){var i=xm(t+"");if(arguments.length<2){for(var a=Of(this.node()),u=-1,f=i.length;++u<f;)if(!a.contains(i[u]))return!1;return!0}return this.each((typeof r=="function"?Iv:r?Mv:Tv)(i,r))}function $v(){this.textContent=""}function Ov(t){return function(){this.textContent=t}}function Rv(t){return function(){var r=t.apply(this,arguments);this.textContent=r??""}}function zv(t){return arguments.length?this.each(t==null?$v:(typeof t=="function"?Rv:Ov)(t)):this.node().textContent}function Dv(){this.innerHTML=""}function Lv(t){return function(){this.innerHTML=t}}function Fv(t){return function(){var r=t.apply(this,arguments);this.innerHTML=r??""}}function Bv(t){return arguments.length?this.each(t==null?Dv:(typeof t=="function"?Fv:Lv)(t)):this.node().innerHTML}function Hv(){this.nextSibling&&this.parentNode.appendChild(this)}function Vv(){return this.each(Hv)}function Kv(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Uv(){return this.each(Kv)}function qv(t){var r=typeof t=="function"?t:pm(t);return this.select(function(){return this.appendChild(r.apply(this,arguments))})}function Wv(){return null}function Yv(t,r){var i=typeof t=="function"?t:pm(t),a=r==null?Wv:typeof r=="function"?r:$f(r);return this.select(function(){return this.insertBefore(i.apply(this,arguments),a.apply(this,arguments)||null)})}function Xv(){var t=this.parentNode;t&&t.removeChild(this)}function Qv(){return this.each(Xv)}function Gv(){var t=this.cloneNode(!1),r=this.parentNode;return r?r.insertBefore(t,this.nextSibling):t}function Zv(){var t=this.cloneNode(!0),r=this.parentNode;return r?r.insertBefore(t,this.nextSibling):t}function Jv(t){return this.select(t?Zv:Gv)}function ex(t){return arguments.length?this.property("__data__",t):this.node().__data__}function tx(t){return function(r){t.call(this,r,this.__data__)}}function nx(t){return t.trim().split(/^|\s+/).map(function(r){var i="",a=r.indexOf(".");return a>=0&&(i=r.slice(a+1),r=r.slice(0,a)),{type:r,name:i}})}function rx(t){return function(){var r=this.__on;if(r){for(var i=0,a=-1,u=r.length,f;i<u;++i)f=r[i],(!t.type||f.type===t.type)&&f.name===t.name?this.removeEventListener(f.type,f.listener,f.options):r[++a]=f;++a?r.length=a:delete this.__on}}}function ox(t,r,i){return function(){var a=this.__on,u,f=tx(r);if(a){for(var d=0,g=a.length;d<g;++d)if((u=a[d]).type===t.type&&u.name===t.name){this.removeEventListener(u.type,u.listener,u.options),this.addEventListener(u.type,u.listener=f,u.options=i),u.value=r;return}}this.addEventListener(t.type,f,i),u={type:t.type,name:t.name,value:r,listener:f,options:i},a?a.push(u):this.__on=[u]}}function ix(t,r,i){var a=nx(t+""),u,f=a.length,d;if(arguments.length<2){var g=this.node().__on;if(g){for(var v=0,w=g.length,S;v<w;++v)for(u=0,S=g[v];u<f;++u)if((d=a[u]).type===S.type&&d.name===S.name)return S.value}return}for(g=r?ox:rx,u=0;u<f;++u)this.each(g(a[u],r,i));return this}function bm(t,r,i){var a=vm(t),u=a.CustomEvent;typeof u=="function"?u=new u(r,i):(u=a.document.createEvent("Event"),i?(u.initEvent(r,i.bubbles,i.cancelable),u.detail=i.detail):u.initEvent(r,!1,!1)),t.dispatchEvent(u)}function sx(t,r){return function(){return bm(this,t,r)}}function ax(t,r){return function(){return bm(this,t,r.apply(this,arguments))}}function lx(t,r){return this.each((typeof r=="function"?ax:sx)(t,r))}function*ux(){for(var t=this._groups,r=0,i=t.length;r<i;++r)for(var a=t[r],u=0,f=a.length,d;u<f;++u)(d=a[u])&&(yield d)}var km=[null];function Jn(t,r){this._groups=t,this._parents=r}function Aa(){return new Jn([[document.documentElement]],km)}function cx(){return this}Jn.prototype=Aa.prototype={constructor:Jn,select:R0,selectAll:F0,selectChild:K0,selectChildren:Y0,filter:X0,data:tv,enter:Q0,exit:rv,join:ov,merge:iv,selection:cx,order:sv,sort:av,call:uv,nodes:cv,node:fv,size:dv,empty:pv,each:hv,attr:_v,style:Ev,property:jv,classed:Av,text:zv,html:Bv,raise:Vv,lower:Uv,append:qv,insert:Yv,remove:Qv,clone:Jv,datum:ex,on:ix,dispatch:lx,[Symbol.iterator]:ux};function Zn(t){return typeof t=="string"?new Jn([[document.querySelector(t)]],[document.documentElement]):new Jn([[t]],km)}function fx(t){let r;for(;r=t.sourceEvent;)t=r;return t}function Tr(t,r){if(t=fx(t),r===void 0&&(r=t.currentTarget),r){var i=r.ownerSVGElement||r;if(i.createSVGPoint){var a=i.createSVGPoint();return a.x=t.clientX,a.y=t.clientY,a=a.matrixTransform(r.getScreenCTM().inverse()),[a.x,a.y]}if(r.getBoundingClientRect){var u=r.getBoundingClientRect();return[t.clientX-u.left-r.clientLeft,t.clientY-u.top-r.clientTop]}}return[t.pageX,t.pageY]}const dx={passive:!1},ba={capture:!0,passive:!1};function Jc(t){t.stopImmediatePropagation()}function Es(t){t.preventDefault(),t.stopImmediatePropagation()}function Em(t){var r=t.document.documentElement,i=Zn(t).on("dragstart.drag",Es,ba);"onselectstart"in r?i.on("selectstart.drag",Es,ba):(r.__noselect=r.style.MozUserSelect,r.style.MozUserSelect="none")}function Nm(t,r){var i=t.document.documentElement,a=Zn(t).on("dragstart.drag",null);r&&(a.on("click.drag",Es,ba),setTimeout(function(){a.on("click.drag",null)},0)),"onselectstart"in i?a.on("selectstart.drag",null):(i.style.MozUserSelect=i.__noselect,delete i.__noselect)}const Vl=t=>()=>t;function xf(t,{sourceEvent:r,subject:i,target:a,identifier:u,active:f,x:d,y:g,dx:v,dy:w,dispatch:S}){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:a,enumerable:!0,configurable:!0},identifier:{value:u,enumerable:!0,configurable:!0},active:{value:f,enumerable:!0,configurable:!0},x:{value:d,enumerable:!0,configurable:!0},y:{value:g,enumerable:!0,configurable:!0},dx:{value:v,enumerable:!0,configurable:!0},dy:{value:w,enumerable:!0,configurable:!0},_:{value:S}})}xf.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};function px(t){return!t.ctrlKey&&!t.button}function hx(){return this.parentNode}function mx(t,r){return r??{x:t.x,y:t.y}}function gx(){return navigator.maxTouchPoints||"ontouchstart"in this}function Cm(){var t=px,r=hx,i=mx,a=gx,u={},f=_u("start","drag","end"),d=0,g,v,w,S,x=0;function b(R){R.on("mousedown.drag",N).filter(a).on("touchstart.drag",T).on("touchmove.drag",$,dx).on("touchend.drag touchcancel.drag",H).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function N(R,Y){if(!(S||!t.call(this,R,Y))){var V=M(this,r.call(this,R,Y),R,Y,"mouse");V&&(Zn(R.view).on("mousemove.drag",C,ba).on("mouseup.drag",A,ba),Em(R.view),Jc(R),w=!1,g=R.clientX,v=R.clientY,V("start",R))}}function C(R){if(Es(R),!w){var Y=R.clientX-g,V=R.clientY-v;w=Y*Y+V*V>x}u.mouse("drag",R)}function A(R){Zn(R.view).on("mousemove.drag mouseup.drag",null),Nm(R.view,w),Es(R),u.mouse("end",R)}function T(R,Y){if(t.call(this,R,Y)){var V=R.changedTouches,U=r.call(this,R,Y),le=V.length,he,Se;for(he=0;he<le;++he)(Se=M(this,U,R,Y,V[he].identifier,V[he]))&&(Jc(R),Se("start",R,V[he]))}}function $(R){var Y=R.changedTouches,V=Y.length,U,le;for(U=0;U<V;++U)(le=u[Y[U].identifier])&&(Es(R),le("drag",R,Y[U]))}function H(R){var Y=R.changedTouches,V=Y.length,U,le;for(S&&clearTimeout(S),S=setTimeout(function(){S=null},500),U=0;U<V;++U)(le=u[Y[U].identifier])&&(Jc(R),le("end",R,Y[U]))}function M(R,Y,V,U,le,he){var Se=f.copy(),q=Tr(he||V,Y),ue,xe,D;if((D=i.call(R,new xf("beforestart",{sourceEvent:V,target:b,identifier:le,active:d,x:q[0],y:q[1],dx:0,dy:0,dispatch:Se}),U))!=null)return ue=D.x-q[0]||0,xe=D.y-q[1]||0,function ce(te,ae,L){var F=q,Q;switch(te){case"start":u[le]=ce,Q=d++;break;case"end":delete u[le],--d;case"drag":q=Tr(L||ae,Y),Q=d;break}Se.call(te,R,new xf(te,{sourceEvent:ae,subject:D,target:b,identifier:le,active:Q,x:q[0]+ue,y:q[1]+xe,dx:q[0]-F[0],dy:q[1]-F[1],dispatch:Se}),U)}}return b.filter=function(R){return arguments.length?(t=typeof R=="function"?R:Vl(!!R),b):t},b.container=function(R){return arguments.length?(r=typeof R=="function"?R:Vl(R),b):r},b.subject=function(R){return arguments.length?(i=typeof R=="function"?R:Vl(R),b):i},b.touchable=function(R){return arguments.length?(a=typeof R=="function"?R:Vl(!!R),b):a},b.on=function(){var R=f.on.apply(f,arguments);return R===f?b:R},b.clickDistance=function(R){return arguments.length?(x=(R=+R)*R,b):Math.sqrt(x)},b}function Rf(t,r,i){t.prototype=r.prototype=i,i.constructor=t}function Pm(t,r){var i=Object.create(t.prototype);for(var a in r)i[a]=r[a];return i}function $a(){}var ka=.7,au=1/ka,Ns="\\s*([+-]?\\d+)\\s*",Ea="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Gr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",yx=/^#([0-9a-f]{3,8})$/,vx=new RegExp(`^rgb\\(${Ns},${Ns},${Ns}\\)$`),xx=new RegExp(`^rgb\\(${Gr},${Gr},${Gr}\\)$`),wx=new RegExp(`^rgba\\(${Ns},${Ns},${Ns},${Ea}\\)$`),_x=new RegExp(`^rgba\\(${Gr},${Gr},${Gr},${Ea}\\)$`),Sx=new RegExp(`^hsl\\(${Ea},${Gr},${Gr}\\)$`),bx=new RegExp(`^hsla\\(${Ea},${Gr},${Gr},${Ea}\\)$`),eh={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};Rf($a,Ri,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:th,formatHex:th,formatHex8:kx,formatHsl:Ex,formatRgb:nh,toString:nh});function th(){return this.rgb().formatHex()}function kx(){return this.rgb().formatHex8()}function Ex(){return jm(this).formatHsl()}function nh(){return this.rgb().formatRgb()}function Ri(t){var r,i;return t=(t+"").trim().toLowerCase(),(r=yx.exec(t))?(i=r[1].length,r=parseInt(r[1],16),i===6?rh(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=vx.exec(t))?new Vn(r[1],r[2],r[3],1):(r=xx.exec(t))?new Vn(r[1]*255/100,r[2]*255/100,r[3]*255/100,1):(r=wx.exec(t))?Kl(r[1],r[2],r[3],r[4]):(r=_x.exec(t))?Kl(r[1]*255/100,r[2]*255/100,r[3]*255/100,r[4]):(r=Sx.exec(t))?sh(r[1],r[2]/100,r[3]/100,1):(r=bx.exec(t))?sh(r[1],r[2]/100,r[3]/100,r[4]):eh.hasOwnProperty(t)?rh(eh[t]):t==="transparent"?new Vn(NaN,NaN,NaN,0):null}function rh(t){return new Vn(t>>16&255,t>>8&255,t&255,1)}function Kl(t,r,i,a){return a<=0&&(t=r=i=NaN),new Vn(t,r,i,a)}function Nx(t){return t instanceof $a||(t=Ri(t)),t?(t=t.rgb(),new Vn(t.r,t.g,t.b,t.opacity)):new Vn}function wf(t,r,i,a){return arguments.length===1?Nx(t):new Vn(t,r,i,a??1)}function Vn(t,r,i,a){this.r=+t,this.g=+r,this.b=+i,this.opacity=+a}Rf(Vn,wf,Pm($a,{brighter(t){return t=t==null?au:Math.pow(au,t),new Vn(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?ka:Math.pow(ka,t),new Vn(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Vn($i(this.r),$i(this.g),$i(this.b),lu(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:oh,formatHex:oh,formatHex8:Cx,formatRgb:ih,toString:ih}));function oh(){return`#${Ai(this.r)}${Ai(this.g)}${Ai(this.b)}`}function Cx(){return`#${Ai(this.r)}${Ai(this.g)}${Ai(this.b)}${Ai((isNaN(this.opacity)?1:this.opacity)*255)}`}function ih(){const t=lu(this.opacity);return`${t===1?"rgb(":"rgba("}${$i(this.r)}, ${$i(this.g)}, ${$i(this.b)}${t===1?")":`, ${t})`}`}function lu(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function $i(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Ai(t){return t=$i(t),(t<16?"0":"")+t.toString(16)}function sh(t,r,i,a){return a<=0?t=r=i=NaN:i<=0||i>=1?t=r=NaN:r<=0&&(t=NaN),new Ir(t,r,i,a)}function jm(t){if(t instanceof Ir)return new Ir(t.h,t.s,t.l,t.opacity);if(t instanceof $a||(t=Ri(t)),!t)return new Ir;if(t instanceof Ir)return t;t=t.rgb();var r=t.r/255,i=t.g/255,a=t.b/255,u=Math.min(r,i,a),f=Math.max(r,i,a),d=NaN,g=f-u,v=(f+u)/2;return g?(r===f?d=(i-a)/g+(i<a)*6:i===f?d=(a-r)/g+2:d=(r-i)/g+4,g/=v<.5?f+u:2-f-u,d*=60):g=v>0&&v<1?0:d,new Ir(d,g,v,t.opacity)}function Px(t,r,i,a){return arguments.length===1?jm(t):new Ir(t,r,i,a??1)}function Ir(t,r,i,a){this.h=+t,this.s=+r,this.l=+i,this.opacity=+a}Rf(Ir,Px,Pm($a,{brighter(t){return t=t==null?au:Math.pow(au,t),new Ir(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?ka:Math.pow(ka,t),new Ir(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,a=i+(i<.5?i:1-i)*r,u=2*i-a;return new Vn(ef(t>=240?t-240:t+120,u,a),ef(t,u,a),ef(t<120?t+240:t-120,u,a),this.opacity)},clamp(){return new Ir(ah(this.h),Ul(this.s),Ul(this.l),lu(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=lu(this.opacity);return`${t===1?"hsl(":"hsla("}${ah(this.h)}, ${Ul(this.s)*100}%, ${Ul(this.l)*100}%${t===1?")":`, ${t})`}`}}));function ah(t){return t=(t||0)%360,t<0?t+360:t}function Ul(t){return Math.max(0,Math.min(1,t||0))}function ef(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 zf=t=>()=>t;function jx(t,r){return function(i){return t+i*r}}function Mx(t,r,i){return t=Math.pow(t,i),r=Math.pow(r,i)-t,i=1/i,function(a){return Math.pow(t+a*r,i)}}function Tx(t){return(t=+t)==1?Mm:function(r,i){return i-r?Mx(r,i,t):zf(isNaN(r)?i:r)}}function Mm(t,r){var i=r-t;return i?jx(t,i):zf(isNaN(t)?r:t)}const uu=(function t(r){var i=Tx(r);function a(u,f){var d=i((u=wf(u)).r,(f=wf(f)).r),g=i(u.g,f.g),v=i(u.b,f.b),w=Mm(u.opacity,f.opacity);return function(S){return u.r=d(S),u.g=g(S),u.b=v(S),u.opacity=w(S),u+""}}return a.gamma=t,a})(1);function Ix(t,r){r||(r=[]);var i=t?Math.min(r.length,t.length):0,a=r.slice(),u;return function(f){for(u=0;u<i;++u)a[u]=t[u]*(1-f)+r[u]*f;return a}}function Ax(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function $x(t,r){var i=r?r.length:0,a=t?Math.min(i,t.length):0,u=new Array(a),f=new Array(i),d;for(d=0;d<a;++d)u[d]=_a(t[d],r[d]);for(;d<i;++d)f[d]=r[d];return function(g){for(d=0;d<a;++d)f[d]=u[d](g);return f}}function Ox(t,r){var i=new Date;return t=+t,r=+r,function(a){return i.setTime(t*(1-a)+r*a),i}}function Qr(t,r){return t=+t,r=+r,function(i){return t*(1-i)+r*i}}function Rx(t,r){var i={},a={},u;(t===null||typeof t!="object")&&(t={}),(r===null||typeof r!="object")&&(r={});for(u in r)u in t?i[u]=_a(t[u],r[u]):a[u]=r[u];return function(f){for(u in i)a[u]=i[u](f);return a}}var _f=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,tf=new RegExp(_f.source,"g");function zx(t){return function(){return t}}function Dx(t){return function(r){return t(r)+""}}function Tm(t,r){var i=_f.lastIndex=tf.lastIndex=0,a,u,f,d=-1,g=[],v=[];for(t=t+"",r=r+"";(a=_f.exec(t))&&(u=tf.exec(r));)(f=u.index)>i&&(f=r.slice(i,f),g[d]?g[d]+=f:g[++d]=f),(a=a[0])===(u=u[0])?g[d]?g[d]+=u:g[++d]=u:(g[++d]=null,v.push({i:d,x:Qr(a,u)})),i=tf.lastIndex;return i<r.length&&(f=r.slice(i),g[d]?g[d]+=f:g[++d]=f),g.length<2?v[0]?Dx(v[0].x):zx(r):(r=v.length,function(w){for(var S=0,x;S<r;++S)g[(x=v[S]).i]=x.x(w);return g.join("")})}function _a(t,r){var i=typeof r,a;return r==null||i==="boolean"?zf(r):(i==="number"?Qr:i==="string"?(a=Ri(r))?(r=a,uu):Tm:r instanceof Ri?uu:r instanceof Date?Ox:Ax(r)?Ix:Array.isArray(r)?$x:typeof r.valueOf!="function"&&typeof r.toString!="function"||isNaN(r)?Rx:Qr)(t,r)}var lh=180/Math.PI,Sf={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Im(t,r,i,a,u,f){var d,g,v;return(d=Math.sqrt(t*t+r*r))&&(t/=d,r/=d),(v=t*i+r*a)&&(i-=t*v,a-=r*v),(g=Math.sqrt(i*i+a*a))&&(i/=g,a/=g,v/=g),t*a<r*i&&(t=-t,r=-r,v=-v,d=-d),{translateX:u,translateY:f,rotate:Math.atan2(r,t)*lh,skewX:Math.atan(v)*lh,scaleX:d,scaleY:g}}var ql;function Lx(t){const r=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return r.isIdentity?Sf:Im(r.a,r.b,r.c,r.d,r.e,r.f)}function Fx(t){return t==null||(ql||(ql=document.createElementNS("http://www.w3.org/2000/svg","g")),ql.setAttribute("transform",t),!(t=ql.transform.baseVal.consolidate()))?Sf:(t=t.matrix,Im(t.a,t.b,t.c,t.d,t.e,t.f))}function Am(t,r,i,a){function u(w){return w.length?w.pop()+" ":""}function f(w,S,x,b,N,C){if(w!==x||S!==b){var A=N.push("translate(",null,r,null,i);C.push({i:A-4,x:Qr(w,x)},{i:A-2,x:Qr(S,b)})}else(x||b)&&N.push("translate("+x+r+b+i)}function d(w,S,x,b){w!==S?(w-S>180?S+=360:S-w>180&&(w+=360),b.push({i:x.push(u(x)+"rotate(",null,a)-2,x:Qr(w,S)})):S&&x.push(u(x)+"rotate("+S+a)}function g(w,S,x,b){w!==S?b.push({i:x.push(u(x)+"skewX(",null,a)-2,x:Qr(w,S)}):S&&x.push(u(x)+"skewX("+S+a)}function v(w,S,x,b,N,C){if(w!==x||S!==b){var A=N.push(u(N)+"scale(",null,",",null,")");C.push({i:A-4,x:Qr(w,x)},{i:A-2,x:Qr(S,b)})}else(x!==1||b!==1)&&N.push(u(N)+"scale("+x+","+b+")")}return function(w,S){var x=[],b=[];return w=t(w),S=t(S),f(w.translateX,w.translateY,S.translateX,S.translateY,x,b),d(w.rotate,S.rotate,x,b),g(w.skewX,S.skewX,x,b),v(w.scaleX,w.scaleY,S.scaleX,S.scaleY,x,b),w=S=null,function(N){for(var C=-1,A=b.length,T;++C<A;)x[(T=b[C]).i]=T.x(N);return x.join("")}}}var Bx=Am(Lx,"px, ","px)","deg)"),Hx=Am(Fx,", ",")",")"),Vx=1e-12;function uh(t){return((t=Math.exp(t))+1/t)/2}function Kx(t){return((t=Math.exp(t))-1/t)/2}function Ux(t){return((t=Math.exp(2*t))-1)/(t+1)}const eu=(function t(r,i,a){function u(f,d){var g=f[0],v=f[1],w=f[2],S=d[0],x=d[1],b=d[2],N=S-g,C=x-v,A=N*N+C*C,T,$;if(A<Vx)$=Math.log(b/w)/r,T=function(U){return[g+U*N,v+U*C,w*Math.exp(r*U*$)]};else{var H=Math.sqrt(A),M=(b*b-w*w+a*A)/(2*w*i*H),R=(b*b-w*w-a*A)/(2*b*i*H),Y=Math.log(Math.sqrt(M*M+1)-M),V=Math.log(Math.sqrt(R*R+1)-R);$=(V-Y)/r,T=function(U){var le=U*$,he=uh(Y),Se=w/(i*H)*(he*Ux(r*le+Y)-Kx(Y));return[g+Se*N,v+Se*C,w*he/uh(r*le+Y)]}}return T.duration=$*1e3*r/Math.SQRT2,T}return u.rho=function(f){var d=Math.max(.001,+f),g=d*d,v=g*g;return t(d,g,v)},u})(Math.SQRT2,2,4);var Ps=0,xa=0,ya=0,$m=1e3,cu,wa,fu=0,zi=0,bu=0,Na=typeof performance=="object"&&performance.now?performance:Date,Om=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Df(){return zi||(Om(qx),zi=Na.now()+bu)}function qx(){zi=0}function du(){this._call=this._time=this._next=null}du.prototype=Rm.prototype={constructor:du,restart:function(t,r,i){if(typeof t!="function")throw new TypeError("callback is not a function");i=(i==null?Df():+i)+(r==null?0:+r),!this._next&&wa!==this&&(wa?wa._next=this:cu=this,wa=this),this._call=t,this._time=i,bf()},stop:function(){this._call&&(this._call=null,this._time=1/0,bf())}};function Rm(t,r,i){var a=new du;return a.restart(t,r,i),a}function Wx(){Df(),++Ps;for(var t=cu,r;t;)(r=zi-t._time)>=0&&t._call.call(void 0,r),t=t._next;--Ps}function ch(){zi=(fu=Na.now())+bu,Ps=xa=0;try{Wx()}finally{Ps=0,Xx(),zi=0}}function Yx(){var t=Na.now(),r=t-fu;r>$m&&(bu-=r,fu=t)}function Xx(){for(var t,r=cu,i,a=1/0;r;)r._call?(a>r._time&&(a=r._time),t=r,r=r._next):(i=r._next,r._next=null,r=t?t._next=i:cu=i);wa=t,bf(a)}function bf(t){if(!Ps){xa&&(xa=clearTimeout(xa));var r=t-zi;r>24?(t<1/0&&(xa=setTimeout(ch,t-Na.now()-bu)),ya&&(ya=clearInterval(ya))):(ya||(fu=Na.now(),ya=setInterval(Yx,$m)),Ps=1,Om(ch))}}function fh(t,r,i){var a=new du;return r=r==null?0:+r,a.restart(u=>{a.stop(),t(u+r)},r,i),a}var Qx=_u("start","end","cancel","interrupt"),Gx=[],zm=0,dh=1,kf=2,tu=3,ph=4,Ef=5,nu=6;function ku(t,r,i,a,u,f){var d=t.__transition;if(!d)t.__transition={};else if(i in d)return;Zx(t,i,{name:r,index:a,group:u,on:Qx,tween:Gx,time:f.time,delay:f.delay,duration:f.duration,ease:f.ease,timer:null,state:zm})}function Lf(t,r){var i=Or(t,r);if(i.state>zm)throw new Error("too late; already scheduled");return i}function eo(t,r){var i=Or(t,r);if(i.state>tu)throw new Error("too late; already running");return i}function Or(t,r){var i=t.__transition;if(!i||!(i=i[r]))throw new Error("transition not found");return i}function Zx(t,r,i){var a=t.__transition,u;a[r]=i,i.timer=Rm(f,0,i.time);function f(w){i.state=dh,i.timer.restart(d,i.delay,i.time),i.delay<=w&&d(w-i.delay)}function d(w){var S,x,b,N;if(i.state!==dh)return v();for(S in a)if(N=a[S],N.name===i.name){if(N.state===tu)return fh(d);N.state===ph?(N.state=nu,N.timer.stop(),N.on.call("interrupt",t,t.__data__,N.index,N.group),delete a[S]):+S<r&&(N.state=nu,N.timer.stop(),N.on.call("cancel",t,t.__data__,N.index,N.group),delete a[S])}if(fh(function(){i.state===tu&&(i.state=ph,i.timer.restart(g,i.delay,i.time),g(w))}),i.state=kf,i.on.call("start",t,t.__data__,i.index,i.group),i.state===kf){for(i.state=tu,u=new Array(b=i.tween.length),S=0,x=-1;S<b;++S)(N=i.tween[S].value.call(t,t.__data__,i.index,i.group))&&(u[++x]=N);u.length=x+1}}function g(w){for(var S=w<i.duration?i.ease.call(null,w/i.duration):(i.timer.restart(v),i.state=Ef,1),x=-1,b=u.length;++x<b;)u[x].call(t,S);i.state===Ef&&(i.on.call("end",t,t.__data__,i.index,i.group),v())}function v(){i.state=nu,i.timer.stop(),delete a[r];for(var w in a)return;delete t.__transition}}function ru(t,r){var i=t.__transition,a,u,f=!0,d;if(i){r=r==null?null:r+"";for(d in i){if((a=i[d]).name!==r){f=!1;continue}u=a.state>kf&&a.state<Ef,a.state=nu,a.timer.stop(),a.on.call(u?"interrupt":"cancel",t,t.__data__,a.index,a.group),delete i[d]}f&&delete t.__transition}}function Jx(t){return this.each(function(){ru(this,t)})}function ew(t,r){var i,a;return function(){var u=eo(this,t),f=u.tween;if(f!==i){a=i=f;for(var d=0,g=a.length;d<g;++d)if(a[d].name===r){a=a.slice(),a.splice(d,1);break}}u.tween=a}}function tw(t,r,i){var a,u;if(typeof i!="function")throw new Error;return function(){var f=eo(this,t),d=f.tween;if(d!==a){u=(a=d).slice();for(var g={name:r,value:i},v=0,w=u.length;v<w;++v)if(u[v].name===r){u[v]=g;break}v===w&&u.push(g)}f.tween=u}}function nw(t,r){var i=this._id;if(t+="",arguments.length<2){for(var a=Or(this.node(),i).tween,u=0,f=a.length,d;u<f;++u)if((d=a[u]).name===t)return d.value;return null}return this.each((r==null?ew:tw)(i,t,r))}function Ff(t,r,i){var a=t._id;return t.each(function(){var u=eo(this,a);(u.value||(u.value={}))[r]=i.apply(this,arguments)}),function(u){return Or(u,a).value[r]}}function Dm(t,r){var i;return(typeof r=="number"?Qr:r instanceof Ri?uu:(i=Ri(r))?(r=i,uu):Tm)(t,r)}function rw(t){return function(){this.removeAttribute(t)}}function ow(t){return function(){this.removeAttributeNS(t.space,t.local)}}function iw(t,r,i){var a,u=i+"",f;return function(){var d=this.getAttribute(t);return d===u?null:d===a?f:f=r(a=d,i)}}function sw(t,r,i){var a,u=i+"",f;return function(){var d=this.getAttributeNS(t.space,t.local);return d===u?null:d===a?f:f=r(a=d,i)}}function aw(t,r,i){var a,u,f;return function(){var d,g=i(this),v;return g==null?void this.removeAttribute(t):(d=this.getAttribute(t),v=g+"",d===v?null:d===a&&v===u?f:(u=v,f=r(a=d,g)))}}function lw(t,r,i){var a,u,f;return function(){var d,g=i(this),v;return g==null?void this.removeAttributeNS(t.space,t.local):(d=this.getAttributeNS(t.space,t.local),v=g+"",d===v?null:d===a&&v===u?f:(u=v,f=r(a=d,g)))}}function uw(t,r){var i=Su(t),a=i==="transform"?Hx:Dm;return this.attrTween(t,typeof r=="function"?(i.local?lw:aw)(i,a,Ff(this,"attr."+t,r)):r==null?(i.local?ow:rw)(i):(i.local?sw:iw)(i,a,r))}function cw(t,r){return function(i){this.setAttribute(t,r.call(this,i))}}function fw(t,r){return function(i){this.setAttributeNS(t.space,t.local,r.call(this,i))}}function dw(t,r){var i,a;function u(){var f=r.apply(this,arguments);return f!==a&&(i=(a=f)&&fw(t,f)),i}return u._value=r,u}function pw(t,r){var i,a;function u(){var f=r.apply(this,arguments);return f!==a&&(i=(a=f)&&cw(t,f)),i}return u._value=r,u}function hw(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 a=Su(t);return this.tween(i,(a.local?dw:pw)(a,r))}function mw(t,r){return function(){Lf(this,t).delay=+r.apply(this,arguments)}}function gw(t,r){return r=+r,function(){Lf(this,t).delay=r}}function yw(t){var r=this._id;return arguments.length?this.each((typeof t=="function"?mw:gw)(r,t)):Or(this.node(),r).delay}function vw(t,r){return function(){eo(this,t).duration=+r.apply(this,arguments)}}function xw(t,r){return r=+r,function(){eo(this,t).duration=r}}function ww(t){var r=this._id;return arguments.length?this.each((typeof t=="function"?vw:xw)(r,t)):Or(this.node(),r).duration}function _w(t,r){if(typeof r!="function")throw new Error;return function(){eo(this,t).ease=r}}function Sw(t){var r=this._id;return arguments.length?this.each(_w(r,t)):Or(this.node(),r).ease}function bw(t,r){return function(){var i=r.apply(this,arguments);if(typeof i!="function")throw new Error;eo(this,t).ease=i}}function kw(t){if(typeof t!="function")throw new Error;return this.each(bw(this._id,t))}function Ew(t){typeof t!="function"&&(t=mm(t));for(var r=this._groups,i=r.length,a=new Array(i),u=0;u<i;++u)for(var f=r[u],d=f.length,g=a[u]=[],v,w=0;w<d;++w)(v=f[w])&&t.call(v,v.__data__,w,f)&&g.push(v);return new jo(a,this._parents,this._name,this._id)}function Nw(t){if(t._id!==this._id)throw new Error;for(var r=this._groups,i=t._groups,a=r.length,u=i.length,f=Math.min(a,u),d=new Array(a),g=0;g<f;++g)for(var v=r[g],w=i[g],S=v.length,x=d[g]=new Array(S),b,N=0;N<S;++N)(b=v[N]||w[N])&&(x[N]=b);for(;g<a;++g)d[g]=r[g];return new jo(d,this._parents,this._name,this._id)}function Cw(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 Pw(t,r,i){var a,u,f=Cw(r)?Lf:eo;return function(){var d=f(this,t),g=d.on;g!==a&&(u=(a=g).copy()).on(r,i),d.on=u}}function jw(t,r){var i=this._id;return arguments.length<2?Or(this.node(),i).on.on(t):this.each(Pw(i,t,r))}function Mw(t){return function(){var r=this.parentNode;for(var i in this.__transition)if(+i!==t)return;r&&r.removeChild(this)}}function Tw(){return this.on("end.remove",Mw(this._id))}function Iw(t){var r=this._name,i=this._id;typeof t!="function"&&(t=$f(t));for(var a=this._groups,u=a.length,f=new Array(u),d=0;d<u;++d)for(var g=a[d],v=g.length,w=f[d]=new Array(v),S,x,b=0;b<v;++b)(S=g[b])&&(x=t.call(S,S.__data__,b,g))&&("__data__"in S&&(x.__data__=S.__data__),w[b]=x,ku(w[b],r,i,b,w,Or(S,i)));return new jo(f,this._parents,r,i)}function Aw(t){var r=this._name,i=this._id;typeof t!="function"&&(t=hm(t));for(var a=this._groups,u=a.length,f=[],d=[],g=0;g<u;++g)for(var v=a[g],w=v.length,S,x=0;x<w;++x)if(S=v[x]){for(var b=t.call(S,S.__data__,x,v),N,C=Or(S,i),A=0,T=b.length;A<T;++A)(N=b[A])&&ku(N,r,i,A,b,C);f.push(b),d.push(S)}return new jo(f,d,r,i)}var $w=Aa.prototype.constructor;function Ow(){return new $w(this._groups,this._parents)}function Rw(t,r){var i,a,u;return function(){var f=Cs(this,t),d=(this.style.removeProperty(t),Cs(this,t));return f===d?null:f===i&&d===a?u:u=r(i=f,a=d)}}function Lm(t){return function(){this.style.removeProperty(t)}}function zw(t,r,i){var a,u=i+"",f;return function(){var d=Cs(this,t);return d===u?null:d===a?f:f=r(a=d,i)}}function Dw(t,r,i){var a,u,f;return function(){var d=Cs(this,t),g=i(this),v=g+"";return g==null&&(v=g=(this.style.removeProperty(t),Cs(this,t))),d===v?null:d===a&&v===u?f:(u=v,f=r(a=d,g))}}function Lw(t,r){var i,a,u,f="style."+r,d="end."+f,g;return function(){var v=eo(this,t),w=v.on,S=v.value[f]==null?g||(g=Lm(r)):void 0;(w!==i||u!==S)&&(a=(i=w).copy()).on(d,u=S),v.on=a}}function Fw(t,r,i){var a=(t+="")=="transform"?Bx:Dm;return r==null?this.styleTween(t,Rw(t,a)).on("end.style."+t,Lm(t)):typeof r=="function"?this.styleTween(t,Dw(t,a,Ff(this,"style."+t,r))).each(Lw(this._id,t)):this.styleTween(t,zw(t,a,r),i).on("end.style."+t,null)}function Bw(t,r,i){return function(a){this.style.setProperty(t,r.call(this,a),i)}}function Hw(t,r,i){var a,u;function f(){var d=r.apply(this,arguments);return d!==u&&(a=(u=d)&&Bw(t,d,i)),a}return f._value=r,f}function Vw(t,r,i){var a="style."+(t+="");if(arguments.length<2)return(a=this.tween(a))&&a._value;if(r==null)return this.tween(a,null);if(typeof r!="function")throw new Error;return this.tween(a,Hw(t,r,i??""))}function Kw(t){return function(){this.textContent=t}}function Uw(t){return function(){var r=t(this);this.textContent=r??""}}function qw(t){return this.tween("text",typeof t=="function"?Uw(Ff(this,"text",t)):Kw(t==null?"":t+""))}function Ww(t){return function(r){this.textContent=t.call(this,r)}}function Yw(t){var r,i;function a(){var u=t.apply(this,arguments);return u!==i&&(r=(i=u)&&Ww(u)),r}return a._value=t,a}function Xw(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,Yw(t))}function Qw(){for(var t=this._name,r=this._id,i=Fm(),a=this._groups,u=a.length,f=0;f<u;++f)for(var d=a[f],g=d.length,v,w=0;w<g;++w)if(v=d[w]){var S=Or(v,r);ku(v,t,i,w,d,{time:S.time+S.delay+S.duration,delay:0,duration:S.duration,ease:S.ease})}return new jo(a,this._parents,t,i)}function Gw(){var t,r,i=this,a=i._id,u=i.size();return new Promise(function(f,d){var g={value:d},v={value:function(){--u===0&&f()}};i.each(function(){var w=eo(this,a),S=w.on;S!==t&&(r=(t=S).copy(),r._.cancel.push(g),r._.interrupt.push(g),r._.end.push(v)),w.on=r}),u===0&&f()})}var Zw=0;function jo(t,r,i,a){this._groups=t,this._parents=r,this._name=i,this._id=a}function Fm(){return++Zw}var No=Aa.prototype;jo.prototype={constructor:jo,select:Iw,selectAll:Aw,selectChild:No.selectChild,selectChildren:No.selectChildren,filter:Ew,merge:Nw,selection:Ow,transition:Qw,call:No.call,nodes:No.nodes,node:No.node,size:No.size,empty:No.empty,each:No.each,on:jw,attr:uw,attrTween:hw,style:Fw,styleTween:Vw,text:qw,textTween:Xw,remove:Tw,tween:nw,delay:yw,duration:ww,ease:Sw,easeVarying:kw,end:Gw,[Symbol.iterator]:No[Symbol.iterator]};function Jw(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var e1={time:null,delay:0,duration:250,ease:Jw};function t1(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 n1(t){var r,i;t instanceof jo?(r=t._id,t=t._name):(r=Fm(),(i=e1).time=Df(),t=t==null?null:t+"");for(var a=this._groups,u=a.length,f=0;f<u;++f)for(var d=a[f],g=d.length,v,w=0;w<g;++w)(v=d[w])&&ku(v,t,r,w,d,i||t1(v,r));return new jo(a,this._parents,t,r)}Aa.prototype.interrupt=Jx;Aa.prototype.transition=n1;const Wl=t=>()=>t;function r1(t,{sourceEvent:r,target:i,transform:a,dispatch:u}){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:a,enumerable:!0,configurable:!0},_:{value:u}})}function Co(t,r,i){this.k=t,this.x=r,this.y=i}Co.prototype={constructor:Co,scale:function(t){return t===1?this:new Co(this.k*t,this.x,this.y)},translate:function(t,r){return t===0&r===0?this:new Co(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 Eu=new Co(1,0,0);Bm.prototype=Co.prototype;function Bm(t){for(;!t.__zoom;)if(!(t=t.parentNode))return Eu;return t.__zoom}function nf(t){t.stopImmediatePropagation()}function va(t){t.preventDefault(),t.stopImmediatePropagation()}function o1(t){return(!t.ctrlKey||t.type==="wheel")&&!t.button}function i1(){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 hh(){return this.__zoom||Eu}function s1(t){return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function a1(){return navigator.maxTouchPoints||"ontouchstart"in this}function l1(t,r,i){var a=t.invertX(r[0][0])-i[0][0],u=t.invertX(r[1][0])-i[1][0],f=t.invertY(r[0][1])-i[0][1],d=t.invertY(r[1][1])-i[1][1];return t.translate(u>a?(a+u)/2:Math.min(0,a)||Math.max(0,u),d>f?(f+d)/2:Math.min(0,f)||Math.max(0,d))}function Hm(){var t=o1,r=i1,i=l1,a=s1,u=a1,f=[0,1/0],d=[[-1/0,-1/0],[1/0,1/0]],g=250,v=eu,w=_u("start","zoom","end"),S,x,b,N=500,C=150,A=0,T=10;function $(D){D.property("__zoom",hh).on("wheel.zoom",le,{passive:!1}).on("mousedown.zoom",he).on("dblclick.zoom",Se).filter(u).on("touchstart.zoom",q).on("touchmove.zoom",ue).on("touchend.zoom touchcancel.zoom",xe).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}$.transform=function(D,ce,te,ae){var L=D.selection?D.selection():D;L.property("__zoom",hh),D!==L?Y(D,ce,te,ae):L.interrupt().each(function(){V(this,arguments).event(ae).start().zoom(null,typeof ce=="function"?ce.apply(this,arguments):ce).end()})},$.scaleBy=function(D,ce,te,ae){$.scaleTo(D,function(){var L=this.__zoom.k,F=typeof ce=="function"?ce.apply(this,arguments):ce;return L*F},te,ae)},$.scaleTo=function(D,ce,te,ae){$.transform(D,function(){var L=r.apply(this,arguments),F=this.__zoom,Q=te==null?R(L):typeof te=="function"?te.apply(this,arguments):te,O=F.invert(Q),B=typeof ce=="function"?ce.apply(this,arguments):ce;return i(M(H(F,B),Q,O),L,d)},te,ae)},$.translateBy=function(D,ce,te,ae){$.transform(D,function(){return i(this.__zoom.translate(typeof ce=="function"?ce.apply(this,arguments):ce,typeof te=="function"?te.apply(this,arguments):te),r.apply(this,arguments),d)},null,ae)},$.translateTo=function(D,ce,te,ae,L){$.transform(D,function(){var F=r.apply(this,arguments),Q=this.__zoom,O=ae==null?R(F):typeof ae=="function"?ae.apply(this,arguments):ae;return i(Eu.translate(O[0],O[1]).scale(Q.k).translate(typeof ce=="function"?-ce.apply(this,arguments):-ce,typeof te=="function"?-te.apply(this,arguments):-te),F,d)},ae,L)};function H(D,ce){return ce=Math.max(f[0],Math.min(f[1],ce)),ce===D.k?D:new Co(ce,D.x,D.y)}function M(D,ce,te){var ae=ce[0]-te[0]*D.k,L=ce[1]-te[1]*D.k;return ae===D.x&&L===D.y?D:new Co(D.k,ae,L)}function R(D){return[(+D[0][0]+ +D[1][0])/2,(+D[0][1]+ +D[1][1])/2]}function Y(D,ce,te,ae){D.on("start.zoom",function(){V(this,arguments).event(ae).start()}).on("interrupt.zoom end.zoom",function(){V(this,arguments).event(ae).end()}).tween("zoom",function(){var L=this,F=arguments,Q=V(L,F).event(ae),O=r.apply(L,F),B=te==null?R(O):typeof te=="function"?te.apply(L,F):te,be=Math.max(O[1][0]-O[0][0],O[1][1]-O[0][1]),_e=L.__zoom,$e=typeof ce=="function"?ce.apply(L,F):ce,Ie=v(_e.invert(B).concat(be/_e.k),$e.invert(B).concat(be/$e.k));return function(Re){if(Re===1)Re=$e;else{var we=Ie(Re),De=be/we[2];Re=new Co(De,B[0]-we[0]*De,B[1]-we[1]*De)}Q.zoom(null,Re)}})}function V(D,ce,te){return!te&&D.__zooming||new U(D,ce)}function U(D,ce){this.that=D,this.args=ce,this.active=0,this.sourceEvent=null,this.extent=r.apply(D,ce),this.taps=0}U.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();w.call(D,this.that,new r1(D,{sourceEvent:this.sourceEvent,target:$,transform:this.that.__zoom,dispatch:w}),ce)}};function le(D,...ce){if(!t.apply(this,arguments))return;var te=V(this,ce).event(D),ae=this.__zoom,L=Math.max(f[0],Math.min(f[1],ae.k*Math.pow(2,a.apply(this,arguments)))),F=Tr(D);if(te.wheel)(te.mouse[0][0]!==F[0]||te.mouse[0][1]!==F[1])&&(te.mouse[1]=ae.invert(te.mouse[0]=F)),clearTimeout(te.wheel);else{if(ae.k===L)return;te.mouse=[F,ae.invert(F)],ru(this),te.start()}va(D),te.wheel=setTimeout(Q,C),te.zoom("mouse",i(M(H(ae,L),te.mouse[0],te.mouse[1]),te.extent,d));function Q(){te.wheel=null,te.end()}}function he(D,...ce){if(b||!t.apply(this,arguments))return;var te=D.currentTarget,ae=V(this,ce,!0).event(D),L=Zn(D.view).on("mousemove.zoom",B,!0).on("mouseup.zoom",be,!0),F=Tr(D,te),Q=D.clientX,O=D.clientY;Em(D.view),nf(D),ae.mouse=[F,this.__zoom.invert(F)],ru(this),ae.start();function B(_e){if(va(_e),!ae.moved){var $e=_e.clientX-Q,Ie=_e.clientY-O;ae.moved=$e*$e+Ie*Ie>A}ae.event(_e).zoom("mouse",i(M(ae.that.__zoom,ae.mouse[0]=Tr(_e,te),ae.mouse[1]),ae.extent,d))}function be(_e){L.on("mousemove.zoom mouseup.zoom",null),Nm(_e.view,ae.moved),va(_e),ae.event(_e).end()}}function Se(D,...ce){if(t.apply(this,arguments)){var te=this.__zoom,ae=Tr(D.changedTouches?D.changedTouches[0]:D,this),L=te.invert(ae),F=te.k*(D.shiftKey?.5:2),Q=i(M(H(te,F),ae,L),r.apply(this,ce),d);va(D),g>0?Zn(this).transition().duration(g).call(Y,Q,ae,D):Zn(this).call($.transform,Q,ae,D)}}function q(D,...ce){if(t.apply(this,arguments)){var te=D.touches,ae=te.length,L=V(this,ce,D.changedTouches.length===ae).event(D),F,Q,O,B;for(nf(D),Q=0;Q<ae;++Q)O=te[Q],B=Tr(O,this),B=[B,this.__zoom.invert(B),O.identifier],L.touch0?!L.touch1&&L.touch0[2]!==B[2]&&(L.touch1=B,L.taps=0):(L.touch0=B,F=!0,L.taps=1+!!S);S&&(S=clearTimeout(S)),F&&(L.taps<2&&(x=B[0],S=setTimeout(function(){S=null},N)),ru(this),L.start())}}function ue(D,...ce){if(this.__zooming){var te=V(this,ce).event(D),ae=D.changedTouches,L=ae.length,F,Q,O,B;for(va(D),F=0;F<L;++F)Q=ae[F],O=Tr(Q,this),te.touch0&&te.touch0[2]===Q.identifier?te.touch0[0]=O:te.touch1&&te.touch1[2]===Q.identifier&&(te.touch1[0]=O);if(Q=te.that.__zoom,te.touch1){var be=te.touch0[0],_e=te.touch0[1],$e=te.touch1[0],Ie=te.touch1[1],Re=(Re=$e[0]-be[0])*Re+(Re=$e[1]-be[1])*Re,we=(we=Ie[0]-_e[0])*we+(we=Ie[1]-_e[1])*we;Q=H(Q,Math.sqrt(Re/we)),O=[(be[0]+$e[0])/2,(be[1]+$e[1])/2],B=[(_e[0]+Ie[0])/2,(_e[1]+Ie[1])/2]}else if(te.touch0)O=te.touch0[0],B=te.touch0[1];else return;te.zoom("touch",i(M(Q,O,B),te.extent,d))}}function xe(D,...ce){if(this.__zooming){var te=V(this,ce).event(D),ae=D.changedTouches,L=ae.length,F,Q;for(nf(D),b&&clearTimeout(b),b=setTimeout(function(){b=null},N),F=0;F<L;++F)Q=ae[F],te.touch0&&te.touch0[2]===Q.identifier?delete te.touch0:te.touch1&&te.touch1[2]===Q.identifier&&delete te.touch1;if(te.touch1&&!te.touch0&&(te.touch0=te.touch1,delete te.touch1),te.touch0)te.touch0[1]=this.__zoom.invert(te.touch0[0]);else if(te.end(),te.taps===2&&(Q=Tr(Q,this),Math.hypot(x[0]-Q[0],x[1]-Q[1])<T)){var O=Zn(this).on("dblclick.zoom");O&&O.apply(this,arguments)}}}return $.wheelDelta=function(D){return arguments.length?(a=typeof D=="function"?D:Wl(+D),$):a},$.filter=function(D){return arguments.length?(t=typeof D=="function"?D:Wl(!!D),$):t},$.touchable=function(D){return arguments.length?(u=typeof D=="function"?D:Wl(!!D),$):u},$.extent=function(D){return arguments.length?(r=typeof D=="function"?D:Wl([[+D[0][0],+D[0][1]],[+D[1][0],+D[1][1]]]),$):r},$.scaleExtent=function(D){return arguments.length?(f[0]=+D[0],f[1]=+D[1],$):[f[0],f[1]]},$.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],$):[[d[0][0],d[0][1]],[d[1][0],d[1][1]]]},$.constrain=function(D){return arguments.length?(i=D,$):i},$.duration=function(D){return arguments.length?(g=+D,$):g},$.interpolate=function(D){return arguments.length?(v=D,$):v},$.on=function(){var D=w.on.apply(w,arguments);return D===w?$:D},$.clickDistance=function(D){return arguments.length?(A=(D=+D)*D,$):Math.sqrt(A)},$.tapDistance=function(D){return arguments.length?(T=+D,$):T},$}const Zr={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:a})=>`Couldn't create edge for ${t} handle id: "${t==="source"?i:a}", 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."},Ca=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Vm=["Enter"," ","Escape"],Km={"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 js;(function(t){t.Strict="strict",t.Loose="loose"})(js||(js={}));var Oi;(function(t){t.Free="free",t.Vertical="vertical",t.Horizontal="horizontal"})(Oi||(Oi={}));var Pa;(function(t){t.Partial="partial",t.Full="full"})(Pa||(Pa={}));const Um={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var si;(function(t){t.Bezier="default",t.Straight="straight",t.Step="step",t.SmoothStep="smoothstep",t.SimpleBezier="simplebezier"})(si||(si={}));var pu;(function(t){t.Arrow="arrow",t.ArrowClosed="arrowclosed"})(pu||(pu={}));var Ze;(function(t){t.Left="left",t.Top="top",t.Right="right",t.Bottom="bottom"})(Ze||(Ze={}));const mh={[Ze.Left]:Ze.Right,[Ze.Right]:Ze.Left,[Ze.Top]:Ze.Bottom,[Ze.Bottom]:Ze.Top};function qm(t){return t===null?null:t?"valid":"invalid"}const Wm=t=>"id"in t&&"source"in t&&"target"in t,u1=t=>"id"in t&&"position"in t&&!("source"in t)&&!("target"in t),Bf=t=>"id"in t&&"internals"in t&&!("source"in t)&&!("target"in t),Oa=(t,r=[0,0])=>{const{width:i,height:a}=Mo(t),u=t.origin??r,f=i*u[0],d=a*u[1];return{x:t.position.x-f,y:t.position.y-d}},c1=(t,r={nodeOrigin:[0,0]})=>{if(t.length===0)return{x:0,y:0,width:0,height:0};const i=t.reduce((a,u)=>{const f=typeof u=="string";let d=!r.nodeLookup&&!f?u:void 0;r.nodeLookup&&(d=f?r.nodeLookup.get(u):Bf(u)?u:r.nodeLookup.get(u.id));const g=d?hu(d,r.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Nu(a,g)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Cu(i)},Ra=(t,r={})=>{let i={x:1/0,y:1/0,x2:-1/0,y2:-1/0},a=!1;return t.forEach(u=>{(r.filter===void 0||r.filter(u))&&(i=Nu(i,hu(u)),a=!0)}),a?Cu(i):{x:0,y:0,width:0,height:0}},Hf=(t,r,[i,a,u]=[0,0,1],f=!1,d=!1)=>{const g={...Da(r,[i,a,u]),width:r.width/u,height:r.height/u},v=[];for(const w of t.values()){const{measured:S,selectable:x=!0,hidden:b=!1}=w;if(d&&!x||b)continue;const N=S.width??w.width??w.initialWidth??null,C=S.height??w.height??w.initialHeight??null,A=ja(g,Ts(w)),T=(N??0)*(C??0),$=f&&A>0;(!w.internals.handleBounds||$||A>=T||w.dragging)&&v.push(w)}return v},f1=(t,r)=>{const i=new Set;return t.forEach(a=>{i.add(a.id)}),r.filter(a=>i.has(a.source)||i.has(a.target))};function d1(t,r){const i=new Map,a=r!=null&&r.nodes?new Set(r.nodes.map(u=>u.id)):null;return t.forEach(u=>{u.measured.width&&u.measured.height&&((r==null?void 0:r.includeHiddenNodes)||!u.hidden)&&(!a||a.has(u.id))&&i.set(u.id,u)}),i}async function p1({nodes:t,width:r,height:i,panZoom:a,minZoom:u,maxZoom:f},d){if(t.size===0)return Promise.resolve(!0);const g=d1(t,d),v=Ra(g),w=Vf(v,r,i,(d==null?void 0:d.minZoom)??u,(d==null?void 0:d.maxZoom)??f,(d==null?void 0:d.padding)??.1);return await a.setViewport(w,{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 Ym({nodeId:t,nextPosition:r,nodeLookup:i,nodeOrigin:a=[0,0],nodeExtent:u,onError:f}){const d=i.get(t),g=d.parentId?i.get(d.parentId):void 0,{x:v,y:w}=g?g.internals.positionAbsolute:{x:0,y:0},S=d.origin??a;let x=d.extent||u;if(d.extent==="parent"&&!d.expandParent)if(!g)f==null||f("005",Zr.error005());else{const N=g.measured.width,C=g.measured.height;N&&C&&(x=[[v,w],[v+N,w+C]])}else g&&Is(d.extent)&&(x=[[d.extent[0][0]+v,d.extent[0][1]+w],[d.extent[1][0]+v,d.extent[1][1]+w]]);const b=Is(x)?Di(r,x,d.measured):r;return(d.measured.width===void 0||d.measured.height===void 0)&&(f==null||f("015",Zr.error015())),{position:{x:b.x-v+(d.measured.width??0)*S[0],y:b.y-w+(d.measured.height??0)*S[1]},positionAbsolute:b}}async function h1({nodesToRemove:t=[],edgesToRemove:r=[],nodes:i,edges:a,onBeforeDelete:u}){const f=new Set(t.map(b=>b.id)),d=[];for(const b of i){if(b.deletable===!1)continue;const N=f.has(b.id),C=!N&&b.parentId&&d.find(A=>A.id===b.parentId);(N||C)&&d.push(b)}const g=new Set(r.map(b=>b.id)),v=a.filter(b=>b.deletable!==!1),S=f1(d,v);for(const b of v)g.has(b.id)&&!S.find(C=>C.id===b.id)&&S.push(b);if(!u)return{edges:S,nodes:d};const x=await u({nodes:d,edges:S});return typeof x=="boolean"?x?{edges:S,nodes:d}:{edges:[],nodes:[]}:x}const Ms=(t,r=0,i=1)=>Math.min(Math.max(t,r),i),Di=(t={x:0,y:0},r,i)=>({x:Ms(t.x,r[0][0],r[1][0]-((i==null?void 0:i.width)??0)),y:Ms(t.y,r[0][1],r[1][1]-((i==null?void 0:i.height)??0))});function Xm(t,r,i){const{width:a,height:u}=Mo(i),{x:f,y:d}=i.internals.positionAbsolute;return Di(t,[[f,d],[f+a,d+u]],r)}const gh=(t,r,i)=>t<r?Ms(Math.abs(t-r),1,r)/r:t>i?-Ms(Math.abs(t-i),1,r)/r:0,Qm=(t,r,i=15,a=40)=>{const u=gh(t.x,a,r.width-a)*i,f=gh(t.y,a,r.height-a)*i;return[u,f]},Nu=(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)}),Nf=({x:t,y:r,width:i,height:a})=>({x:t,y:r,x2:t+i,y2:r+a}),Cu=({x:t,y:r,x2:i,y2:a})=>({x:t,y:r,width:i-t,height:a-r}),Ts=(t,r=[0,0])=>{var u,f;const{x:i,y:a}=Bf(t)?t.internals.positionAbsolute:Oa(t,r);return{x:i,y:a,width:((u=t.measured)==null?void 0:u.width)??t.width??t.initialWidth??0,height:((f=t.measured)==null?void 0:f.height)??t.height??t.initialHeight??0}},hu=(t,r=[0,0])=>{var u,f;const{x:i,y:a}=Bf(t)?t.internals.positionAbsolute:Oa(t,r);return{x:i,y:a,x2:i+(((u=t.measured)==null?void 0:u.width)??t.width??t.initialWidth??0),y2:a+(((f=t.measured)==null?void 0:f.height)??t.height??t.initialHeight??0)}},Gm=(t,r)=>Cu(Nu(Nf(t),Nf(r))),ja=(t,r)=>{const i=Math.max(0,Math.min(t.x+t.width,r.x+r.width)-Math.max(t.x,r.x)),a=Math.max(0,Math.min(t.y+t.height,r.y+r.height)-Math.max(t.y,r.y));return Math.ceil(i*a)},yh=t=>Ar(t.width)&&Ar(t.height)&&Ar(t.x)&&Ar(t.y),Ar=t=>!isNaN(t)&&isFinite(t),m1=(t,r)=>{},za=(t,r=[1,1])=>({x:r[0]*Math.round(t.x/r[0]),y:r[1]*Math.round(t.y/r[1])}),Da=({x:t,y:r},[i,a,u],f=!1,d=[1,1])=>{const g={x:(t-i)/u,y:(r-a)/u};return f?za(g,d):g},mu=({x:t,y:r},[i,a,u])=>({x:t*u+i,y:r*u+a});function Ss(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 g1(t,r,i){if(typeof t=="string"||typeof t=="number"){const a=Ss(t,i),u=Ss(t,r);return{top:a,right:u,bottom:a,left:u,x:u*2,y:a*2}}if(typeof t=="object"){const a=Ss(t.top??t.y??0,i),u=Ss(t.bottom??t.y??0,i),f=Ss(t.left??t.x??0,r),d=Ss(t.right??t.x??0,r);return{top:a,right:d,bottom:u,left:f,x:f+d,y:a+u}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function y1(t,r,i,a,u,f){const{x:d,y:g}=mu(t,[r,i,a]),{x:v,y:w}=mu({x:t.x+t.width,y:t.y+t.height},[r,i,a]),S=u-v,x=f-w;return{left:Math.floor(d),top:Math.floor(g),right:Math.floor(S),bottom:Math.floor(x)}}const Vf=(t,r,i,a,u,f)=>{const d=g1(f,r,i),g=(r-d.x)/t.width,v=(i-d.y)/t.height,w=Math.min(g,v),S=Ms(w,a,u),x=t.x+t.width/2,b=t.y+t.height/2,N=r/2-x*S,C=i/2-b*S,A=y1(t,N,C,S,r,i),T={left:Math.min(A.left-d.left,0),top:Math.min(A.top-d.top,0),right:Math.min(A.right-d.right,0),bottom:Math.min(A.bottom-d.bottom,0)};return{x:N-T.left+T.right,y:C-T.top+T.bottom,zoom:S}},Ma=()=>{var t;return typeof navigator<"u"&&((t=navigator==null?void 0:navigator.userAgent)==null?void 0:t.indexOf("Mac"))>=0};function Is(t){return t!=null&&t!=="parent"}function Mo(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 Zm(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 Jm(t,r={width:0,height:0},i,a,u){const f={...t},d=a.get(i);if(d){const g=d.origin||u;f.x+=d.internals.positionAbsolute.x-(r.width??0)*g[0],f.y+=d.internals.positionAbsolute.y-(r.height??0)*g[1]}return f}function vh(t,r){if(t.size!==r.size)return!1;for(const i of t)if(!r.has(i))return!1;return!0}function v1(){let t,r;return{promise:new Promise((a,u)=>{t=a,r=u}),resolve:t,reject:r}}function x1(t){return{...Km,...t||{}}}function Sa(t,{snapGrid:r=[0,0],snapToGrid:i=!1,transform:a,containerBounds:u}){const{x:f,y:d}=$r(t),g=Da({x:f-((u==null?void 0:u.left)??0),y:d-((u==null?void 0:u.top)??0)},a),{x:v,y:w}=i?za(g,r):g;return{xSnapped:v,ySnapped:w,...g}}const Kf=t=>({width:t.offsetWidth,height:t.offsetHeight}),eg=t=>{var r;return((r=t==null?void 0:t.getRootNode)==null?void 0:r.call(t))||(window==null?void 0:window.document)},w1=["INPUT","SELECT","TEXTAREA"];function tg(t){var a,u;const r=((u=(a=t.composedPath)==null?void 0:a.call(t))==null?void 0:u[0])||t.target;return(r==null?void 0:r.nodeType)!==1?!1:w1.includes(r.nodeName)||r.hasAttribute("contenteditable")||!!r.closest(".nokey")}const ng=t=>"clientX"in t,$r=(t,r)=>{var f,d;const i=ng(t),a=i?t.clientX:(f=t.touches)==null?void 0:f[0].clientX,u=i?t.clientY:(d=t.touches)==null?void 0:d[0].clientY;return{x:a-((r==null?void 0:r.left)??0),y:u-((r==null?void 0:r.top)??0)}},xh=(t,r,i,a,u)=>{const f=r.querySelectorAll(`.${t}`);return!f||!f.length?null:Array.from(f).map(d=>{const g=d.getBoundingClientRect();return{id:d.getAttribute("data-handleid"),type:t,nodeId:u,position:d.getAttribute("data-handlepos"),x:(g.left-i.left)/a,y:(g.top-i.top)/a,...Kf(d)}})};function rg({sourceX:t,sourceY:r,targetX:i,targetY:a,sourceControlX:u,sourceControlY:f,targetControlX:d,targetControlY:g}){const v=t*.125+u*.375+d*.375+i*.125,w=r*.125+f*.375+g*.375+a*.125,S=Math.abs(v-t),x=Math.abs(w-r);return[v,w,S,x]}function Yl(t,r){return t>=0?.5*t:r*25*Math.sqrt(-t)}function wh({pos:t,x1:r,y1:i,x2:a,y2:u,c:f}){switch(t){case Ze.Left:return[r-Yl(r-a,f),i];case Ze.Right:return[r+Yl(a-r,f),i];case Ze.Top:return[r,i-Yl(i-u,f)];case Ze.Bottom:return[r,i+Yl(u-i,f)]}}function og({sourceX:t,sourceY:r,sourcePosition:i=Ze.Bottom,targetX:a,targetY:u,targetPosition:f=Ze.Top,curvature:d=.25}){const[g,v]=wh({pos:i,x1:t,y1:r,x2:a,y2:u,c:d}),[w,S]=wh({pos:f,x1:a,y1:u,x2:t,y2:r,c:d}),[x,b,N,C]=rg({sourceX:t,sourceY:r,targetX:a,targetY:u,sourceControlX:g,sourceControlY:v,targetControlX:w,targetControlY:S});return[`M${t},${r} C${g},${v} ${w},${S} ${a},${u}`,x,b,N,C]}function ig({sourceX:t,sourceY:r,targetX:i,targetY:a}){const u=Math.abs(i-t)/2,f=i<t?i+u:i-u,d=Math.abs(a-r)/2,g=a<r?a+d:a-d;return[f,g,u,d]}function _1({sourceNode:t,targetNode:r,selected:i=!1,zIndex:a=0,elevateOnSelect:u=!1,zIndexMode:f="basic"}){if(f==="manual")return a;const d=u&&i?a+1e3:a,g=Math.max(t.parentId||u&&t.selected?t.internals.z:0,r.parentId||u&&r.selected?r.internals.z:0);return d+g}function S1({sourceNode:t,targetNode:r,width:i,height:a,transform:u}){const f=Nu(hu(t),hu(r));f.x===f.x2&&(f.x2+=1),f.y===f.y2&&(f.y2+=1);const d={x:-u[0]/u[2],y:-u[1]/u[2],width:i/u[2],height:a/u[2]};return ja(d,Cu(f))>0}const b1=({source:t,sourceHandle:r,target:i,targetHandle:a})=>`xy-edge__${t}${r||""}-${i}${a||""}`,k1=(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)),sg=(t,r,i={})=>{if(!t.source||!t.target)return r;const a=i.getEdgeId||b1;let u;return Wm(t)?u={...t}:u={...t,id:a(t)},k1(u,r)?r:(u.sourceHandle===null&&delete u.sourceHandle,u.targetHandle===null&&delete u.targetHandle,r.concat(u))};function ag({sourceX:t,sourceY:r,targetX:i,targetY:a}){const[u,f,d,g]=ig({sourceX:t,sourceY:r,targetX:i,targetY:a});return[`M ${t},${r}L ${i},${a}`,u,f,d,g]}const _h={[Ze.Left]:{x:-1,y:0},[Ze.Right]:{x:1,y:0},[Ze.Top]:{x:0,y:-1},[Ze.Bottom]:{x:0,y:1}},E1=({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},Sh=(t,r)=>Math.sqrt(Math.pow(r.x-t.x,2)+Math.pow(r.y-t.y,2));function N1({source:t,sourcePosition:r=Ze.Bottom,target:i,targetPosition:a=Ze.Top,center:u,offset:f,stepPosition:d}){const g=_h[r],v=_h[a],w={x:t.x+g.x*f,y:t.y+g.y*f},S={x:i.x+v.x*f,y:i.y+v.y*f},x=E1({source:w,sourcePosition:r,target:S}),b=x.x!==0?"x":"y",N=x[b];let C=[],A,T;const $={x:0,y:0},H={x:0,y:0},[,,M,R]=ig({sourceX:t.x,sourceY:t.y,targetX:i.x,targetY:i.y});if(g[b]*v[b]===-1){b==="x"?(A=u.x??w.x+(S.x-w.x)*d,T=u.y??(w.y+S.y)/2):(A=u.x??(w.x+S.x)/2,T=u.y??w.y+(S.y-w.y)*d);const le=[{x:A,y:w.y},{x:A,y:S.y}],he=[{x:w.x,y:T},{x:S.x,y:T}];g[b]===N?C=b==="x"?le:he:C=b==="x"?he:le}else{const le=[{x:w.x,y:S.y}],he=[{x:S.x,y:w.y}];if(b==="x"?C=g.x===N?he:le:C=g.y===N?le:he,r===a){const D=Math.abs(t[b]-i[b]);if(D<=f){const ce=Math.min(f-1,f-D);g[b]===N?$[b]=(w[b]>t[b]?-1:1)*ce:H[b]=(S[b]>i[b]?-1:1)*ce}}if(r!==a){const D=b==="x"?"y":"x",ce=g[b]===v[D],te=w[D]>S[D],ae=w[D]<S[D];(g[b]===1&&(!ce&&te||ce&&ae)||g[b]!==1&&(!ce&&ae||ce&&te))&&(C=b==="x"?le:he)}const Se={x:w.x+$.x,y:w.y+$.y},q={x:S.x+H.x,y:S.y+H.y},ue=Math.max(Math.abs(Se.x-C[0].x),Math.abs(q.x-C[0].x)),xe=Math.max(Math.abs(Se.y-C[0].y),Math.abs(q.y-C[0].y));ue>=xe?(A=(Se.x+q.x)/2,T=C[0].y):(A=C[0].x,T=(Se.y+q.y)/2)}const Y={x:w.x+$.x,y:w.y+$.y},V={x:S.x+H.x,y:S.y+H.y};return[[t,...Y.x!==C[0].x||Y.y!==C[0].y?[Y]:[],...C,...V.x!==C[C.length-1].x||V.y!==C[C.length-1].y?[V]:[],i],A,T,M,R]}function C1(t,r,i,a){const u=Math.min(Sh(t,r)/2,Sh(r,i)/2,a),{x:f,y:d}=r;if(t.x===f&&f===i.x||t.y===d&&d===i.y)return`L${f} ${d}`;if(t.y===d){const w=t.x<i.x?-1:1,S=t.y<i.y?1:-1;return`L ${f+u*w},${d}Q ${f},${d} ${f},${d+u*S}`}const g=t.x<i.x?1:-1,v=t.y<i.y?-1:1;return`L ${f},${d+u*v}Q ${f},${d} ${f+u*g},${d}`}function Cf({sourceX:t,sourceY:r,sourcePosition:i=Ze.Bottom,targetX:a,targetY:u,targetPosition:f=Ze.Top,borderRadius:d=5,centerX:g,centerY:v,offset:w=20,stepPosition:S=.5}){const[x,b,N,C,A]=N1({source:{x:t,y:r},sourcePosition:i,target:{x:a,y:u},targetPosition:f,center:{x:g,y:v},offset:w,stepPosition:S});let T=`M${x[0].x} ${x[0].y}`;for(let $=1;$<x.length-1;$++)T+=C1(x[$-1],x[$],x[$+1],d);return T+=`L${x[x.length-1].x} ${x[x.length-1].y}`,[T,b,N,C,A]}function bh(t){var r;return t&&!!(t.internals.handleBounds||(r=t.handles)!=null&&r.length)&&!!(t.measured.width||t.width||t.initialWidth)}function P1(t){var x;const{sourceNode:r,targetNode:i}=t;if(!bh(r)||!bh(i))return null;const a=r.internals.handleBounds||kh(r.handles),u=i.internals.handleBounds||kh(i.handles),f=Eh((a==null?void 0:a.source)??[],t.sourceHandle),d=Eh(t.connectionMode===js.Strict?(u==null?void 0:u.target)??[]:((u==null?void 0:u.target)??[]).concat((u==null?void 0:u.source)??[]),t.targetHandle);if(!f||!d)return(x=t.onError)==null||x.call(t,"008",Zr.error008(f?"target":"source",{id:t.id,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle})),null;const g=(f==null?void 0:f.position)||Ze.Bottom,v=(d==null?void 0:d.position)||Ze.Top,w=Li(r,f,g),S=Li(i,d,v);return{sourceX:w.x,sourceY:w.y,targetX:S.x,targetY:S.y,sourcePosition:g,targetPosition:v}}function kh(t){if(!t)return null;const r=[],i=[];for(const a of t)a.width=a.width??1,a.height=a.height??1,a.type==="source"?r.push(a):a.type==="target"&&i.push(a);return{source:r,target:i}}function Li(t,r,i=Ze.Left,a=!1){const u=((r==null?void 0:r.x)??0)+t.internals.positionAbsolute.x,f=((r==null?void 0:r.y)??0)+t.internals.positionAbsolute.y,{width:d,height:g}=r??Mo(t);if(a)return{x:u+d/2,y:f+g/2};switch((r==null?void 0:r.position)??i){case Ze.Top:return{x:u+d/2,y:f};case Ze.Right:return{x:u+d,y:f+g/2};case Ze.Bottom:return{x:u+d/2,y:f+g};case Ze.Left:return{x:u,y:f+g/2}}}function Eh(t,r){return t&&(r?t.find(i=>i.id===r):t[0])||null}function Pf(t,r){return t?typeof t=="string"?t:`${r?`${r}__`:""}${Object.keys(t).sort().map(a=>`${a}=${t[a]}`).join("&")}`:""}function j1(t,{id:r,defaultColor:i,defaultMarkerStart:a,defaultMarkerEnd:u}){const f=new Set;return t.reduce((d,g)=>([g.markerStart||a,g.markerEnd||u].forEach(v=>{if(v&&typeof v=="object"){const w=Pf(v,r);f.has(w)||(d.push({id:w,color:v.color||i,...v}),f.add(w))}}),d),[]).sort((d,g)=>d.id.localeCompare(g.id))}const lg=1e3,M1=10,Uf={nodeOrigin:[0,0],nodeExtent:Ca,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},T1={...Uf,checkEquality:!0};function qf(t,r){const i={...t};for(const a in r)r[a]!==void 0&&(i[a]=r[a]);return i}function I1(t,r,i){const a=qf(Uf,i);for(const u of t.values())if(u.parentId)Yf(u,t,r,a);else{const f=Oa(u,a.nodeOrigin),d=Is(u.extent)?u.extent:a.nodeExtent,g=Di(f,d,Mo(u));u.internals.positionAbsolute=g}}function A1(t,r){if(!t.handles)return t.measured?r==null?void 0:r.internals.handleBounds:void 0;const i=[],a=[];for(const u of t.handles){const f={id:u.id,width:u.width??1,height:u.height??1,nodeId:t.id,x:u.x,y:u.y,position:u.position,type:u.type};u.type==="source"?i.push(f):u.type==="target"&&a.push(f)}return{source:i,target:a}}function Wf(t){return t==="manual"}function jf(t,r,i,a={}){var S,x;const u=qf(T1,a),f={i:0},d=new Map(r),g=u!=null&&u.elevateNodesOnSelect&&!Wf(u.zIndexMode)?lg:0;let v=t.length>0,w=!1;r.clear(),i.clear();for(const b of t){let N=d.get(b.id);if(u.checkEquality&&b===(N==null?void 0:N.internals.userNode))r.set(b.id,N);else{const C=Oa(b,u.nodeOrigin),A=Is(b.extent)?b.extent:u.nodeExtent,T=Di(C,A,Mo(b));N={...u.defaults,...b,measured:{width:(S=b.measured)==null?void 0:S.width,height:(x=b.measured)==null?void 0:x.height},internals:{positionAbsolute:T,handleBounds:A1(b,N),z:ug(b,g,u.zIndexMode),userNode:b}},r.set(b.id,N)}(N.measured===void 0||N.measured.width===void 0||N.measured.height===void 0)&&!N.hidden&&(v=!1),b.parentId&&Yf(N,r,i,a,f),w||(w=b.selected??!1)}return{nodesInitialized:v,hasSelectedNodes:w}}function $1(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 Yf(t,r,i,a,u){const{elevateNodesOnSelect:f,nodeOrigin:d,nodeExtent:g,zIndexMode:v}=qf(Uf,a),w=t.parentId,S=r.get(w);if(!S){console.warn(`Parent node ${w} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}$1(t,i),u&&!S.parentId&&S.internals.rootParentIndex===void 0&&v==="auto"&&(S.internals.rootParentIndex=++u.i,S.internals.z=S.internals.z+u.i*M1),u&&S.internals.rootParentIndex!==void 0&&(u.i=S.internals.rootParentIndex);const x=f&&!Wf(v)?lg:0,{x:b,y:N,z:C}=O1(t,S,d,g,x,v),{positionAbsolute:A}=t.internals,T=b!==A.x||N!==A.y;(T||C!==t.internals.z)&&r.set(t.id,{...t,internals:{...t.internals,positionAbsolute:T?{x:b,y:N}:A,z:C}})}function ug(t,r,i){const a=Ar(t.zIndex)?t.zIndex:0;return Wf(i)?a:a+(t.selected?r:0)}function O1(t,r,i,a,u,f){const{x:d,y:g}=r.internals.positionAbsolute,v=Mo(t),w=Oa(t,i),S=Is(t.extent)?Di(w,t.extent,v):w;let x=Di({x:d+S.x,y:g+S.y},a,v);t.extent==="parent"&&(x=Xm(x,v,r));const b=ug(t,u,f),N=r.internals.z??0;return{x:x.x,y:x.y,z:N>=b?N+1:b}}function Xf(t,r,i,a=[0,0]){var d;const u=[],f=new Map;for(const g of t){const v=r.get(g.parentId);if(!v)continue;const w=((d=f.get(g.parentId))==null?void 0:d.expandedRect)??Ts(v),S=Gm(w,g.rect);f.set(g.parentId,{expandedRect:S,parent:v})}return f.size>0&&f.forEach(({expandedRect:g,parent:v},w)=>{var M;const S=v.internals.positionAbsolute,x=Mo(v),b=v.origin??a,N=g.x<S.x?Math.round(Math.abs(S.x-g.x)):0,C=g.y<S.y?Math.round(Math.abs(S.y-g.y)):0,A=Math.max(x.width,Math.round(g.width)),T=Math.max(x.height,Math.round(g.height)),$=(A-x.width)*b[0],H=(T-x.height)*b[1];(N>0||C>0||$||H)&&(u.push({id:w,type:"position",position:{x:v.position.x-N+$,y:v.position.y-C+H}}),(M=i.get(w))==null||M.forEach(R=>{t.some(Y=>Y.id===R.id)||u.push({id:R.id,type:"position",position:{x:R.position.x+N,y:R.position.y+C}})})),(x.width<g.width||x.height<g.height||N||C)&&u.push({id:w,type:"dimensions",setAttributes:!0,dimensions:{width:A+(N?b[0]*N-$:0),height:T+(C?b[1]*C-H:0)}})}),u}function R1(t,r,i,a,u,f,d){const g=a==null?void 0:a.querySelector(".xyflow__viewport");let v=!1;if(!g)return{changes:[],updatedInternals:v};const w=[],S=window.getComputedStyle(g),{m22:x}=new window.DOMMatrixReadOnly(S.transform),b=[];for(const N of t.values()){const C=r.get(N.id);if(!C)continue;if(C.hidden){r.set(C.id,{...C,internals:{...C.internals,handleBounds:void 0}}),v=!0;continue}const A=Kf(N.nodeElement),T=C.measured.width!==A.width||C.measured.height!==A.height;if(!!(A.width&&A.height&&(T||!C.internals.handleBounds||N.force))){const H=N.nodeElement.getBoundingClientRect(),M=Is(C.extent)?C.extent:f;let{positionAbsolute:R}=C.internals;C.parentId&&C.extent==="parent"?R=Xm(R,A,r.get(C.parentId)):M&&(R=Di(R,M,A));const Y={...C,measured:A,internals:{...C.internals,positionAbsolute:R,handleBounds:{source:xh("source",N.nodeElement,H,x,C.id),target:xh("target",N.nodeElement,H,x,C.id)}}};r.set(C.id,Y),C.parentId&&Yf(Y,r,i,{nodeOrigin:u,zIndexMode:d}),v=!0,T&&(w.push({id:C.id,type:"dimensions",dimensions:A}),C.expandParent&&C.parentId&&b.push({id:C.id,parentId:C.parentId,rect:Ts(Y,u)}))}}if(b.length>0){const N=Xf(b,r,i,u);w.push(...N)}return{changes:w,updatedInternals:v}}async function z1({delta:t,panZoom:r,transform:i,translateExtent:a,width:u,height:f}){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],[u,f]],a),g=!!d&&(d.x!==i[0]||d.y!==i[1]||d.k!==i[2]);return Promise.resolve(g)}function Nh(t,r,i,a,u,f){let d=u;const g=a.get(d)||new Map;a.set(d,g.set(i,r)),d=`${u}-${t}`;const v=a.get(d)||new Map;if(a.set(d,v.set(i,r)),f){d=`${u}-${t}-${f}`;const w=a.get(d)||new Map;a.set(d,w.set(i,r))}}function cg(t,r,i){t.clear(),r.clear();for(const a of i){const{source:u,target:f,sourceHandle:d=null,targetHandle:g=null}=a,v={edgeId:a.id,source:u,target:f,sourceHandle:d,targetHandle:g},w=`${u}-${d}--${f}-${g}`,S=`${f}-${g}--${u}-${d}`;Nh("source",v,S,t,u,d),Nh("target",v,w,t,f,g),r.set(a.id,a)}}function fg(t,r){if(!t.parentId)return!1;const i=r.get(t.parentId);return i?i.selected?!0:fg(i,r):!1}function Ch(t,r,i){var u;let a=t;do{if((u=a==null?void 0:a.matches)!=null&&u.call(a,r))return!0;if(a===i)return!1;a=a==null?void 0:a.parentElement}while(a);return!1}function D1(t,r,i,a){const u=new Map;for(const[f,d]of t)if((d.selected||d.id===a)&&(!d.parentId||!fg(d,t))&&(d.draggable||r&&typeof d.draggable>"u")){const g=t.get(f);g&&u.set(f,{id:f,position:g.position||{x:0,y:0},distance:{x:i.x-g.internals.positionAbsolute.x,y:i.y-g.internals.positionAbsolute.y},extent:g.extent,parentId:g.parentId,origin:g.origin,expandParent:g.expandParent,internals:{positionAbsolute:g.internals.positionAbsolute||{x:0,y:0}},measured:{width:g.measured.width??0,height:g.measured.height??0}})}return u}function rf({nodeId:t,dragItems:r,nodeLookup:i,dragging:a=!0}){var d,g,v;const u=[];for(const[w,S]of r){const x=(d=i.get(w))==null?void 0:d.internals.userNode;x&&u.push({...x,position:S.position,dragging:a})}if(!t)return[u[0],u];const f=(g=i.get(t))==null?void 0:g.internals.userNode;return[f?{...f,position:((v=r.get(t))==null?void 0:v.position)||f.position,dragging:a}:u[0],u]}function L1({dragItems:t,snapGrid:r,x:i,y:a}){const u=t.values().next().value;if(!u)return null;const f={x:i-u.distance.x,y:a-u.distance.y},d=za(f,r);return{x:d.x-f.x,y:d.y-f.y}}function F1({onNodeMouseDown:t,getStoreItems:r,onDragStart:i,onDrag:a,onDragStop:u}){let f={x:null,y:null},d=0,g=new Map,v=!1,w={x:0,y:0},S=null,x=!1,b=null,N=!1,C=!1,A=null;function T({noDragClassName:H,handleSelector:M,domNode:R,isSelectable:Y,nodeId:V,nodeClickDistance:U=0}){b=Zn(R);function le({x:ue,y:xe}){const{nodeLookup:D,nodeExtent:ce,snapGrid:te,snapToGrid:ae,nodeOrigin:L,onNodeDrag:F,onSelectionDrag:Q,onError:O,updateNodePositions:B}=r();f={x:ue,y:xe};let be=!1;const _e=g.size>1,$e=_e&&ce?Nf(Ra(g)):null,Ie=_e&&ae?L1({dragItems:g,snapGrid:te,x:ue,y:xe}):null;for(const[Re,we]of g){if(!D.has(Re))continue;let De={x:ue-we.distance.x,y:xe-we.distance.y};ae&&(De=Ie?{x:Math.round(De.x+Ie.x),y:Math.round(De.y+Ie.y)}:za(De,te));let ke=null;if(_e&&ce&&!we.extent&&$e){const{positionAbsolute:Be}=we.internals,ut=Be.x-$e.x+ce[0][0],at=Be.x+we.measured.width-$e.x2+ce[1][0],lt=Be.y-$e.y+ce[0][1],kt=Be.y+we.measured.height-$e.y2+ce[1][1];ke=[[ut,lt],[at,kt]]}const{position:Ge,positionAbsolute:Le}=Ym({nodeId:Re,nextPosition:De,nodeLookup:D,nodeExtent:ke||ce,nodeOrigin:L,onError:O});be=be||we.position.x!==Ge.x||we.position.y!==Ge.y,we.position=Ge,we.internals.positionAbsolute=Le}if(C=C||be,!!be&&(B(g,!0),A&&(a||F||!V&&Q))){const[Re,we]=rf({nodeId:V,dragItems:g,nodeLookup:D});a==null||a(A,g,Re,we),F==null||F(A,Re,we),V||Q==null||Q(A,we)}}async function he(){if(!S)return;const{transform:ue,panBy:xe,autoPanSpeed:D,autoPanOnNodeDrag:ce}=r();if(!ce){v=!1,cancelAnimationFrame(d);return}const[te,ae]=Qm(w,S,D);(te!==0||ae!==0)&&(f.x=(f.x??0)-te/ue[2],f.y=(f.y??0)-ae/ue[2],await xe({x:te,y:ae})&&le(f)),d=requestAnimationFrame(he)}function Se(ue){var _e;const{nodeLookup:xe,multiSelectionActive:D,nodesDraggable:ce,transform:te,snapGrid:ae,snapToGrid:L,selectNodesOnDrag:F,onNodeDragStart:Q,onSelectionDragStart:O,unselectNodesAndEdges:B}=r();x=!0,(!F||!Y)&&!D&&V&&((_e=xe.get(V))!=null&&_e.selected||B()),Y&&F&&V&&(t==null||t(V));const be=Sa(ue.sourceEvent,{transform:te,snapGrid:ae,snapToGrid:L,containerBounds:S});if(f=be,g=D1(xe,ce,be,V),g.size>0&&(i||Q||!V&&O)){const[$e,Ie]=rf({nodeId:V,dragItems:g,nodeLookup:xe});i==null||i(ue.sourceEvent,g,$e,Ie),Q==null||Q(ue.sourceEvent,$e,Ie),V||O==null||O(ue.sourceEvent,Ie)}}const q=Cm().clickDistance(U).on("start",ue=>{const{domNode:xe,nodeDragThreshold:D,transform:ce,snapGrid:te,snapToGrid:ae}=r();S=(xe==null?void 0:xe.getBoundingClientRect())||null,N=!1,C=!1,A=ue.sourceEvent,D===0&&Se(ue),f=Sa(ue.sourceEvent,{transform:ce,snapGrid:te,snapToGrid:ae,containerBounds:S}),w=$r(ue.sourceEvent,S)}).on("drag",ue=>{const{autoPanOnNodeDrag:xe,transform:D,snapGrid:ce,snapToGrid:te,nodeDragThreshold:ae,nodeLookup:L}=r(),F=Sa(ue.sourceEvent,{transform:D,snapGrid:ce,snapToGrid:te,containerBounds:S});if(A=ue.sourceEvent,(ue.sourceEvent.type==="touchmove"&&ue.sourceEvent.touches.length>1||V&&!L.has(V))&&(N=!0),!N){if(!v&&xe&&x&&(v=!0,he()),!x){const Q=$r(ue.sourceEvent,S),O=Q.x-w.x,B=Q.y-w.y;Math.sqrt(O*O+B*B)>ae&&Se(ue)}(f.x!==F.xSnapped||f.y!==F.ySnapped)&&g&&x&&(w=$r(ue.sourceEvent,S),le(F))}}).on("end",ue=>{if(!(!x||N)&&(v=!1,x=!1,cancelAnimationFrame(d),g.size>0)){const{nodeLookup:xe,updateNodePositions:D,onNodeDragStop:ce,onSelectionDragStop:te}=r();if(C&&(D(g,!1),C=!1),u||ce||!V&&te){const[ae,L]=rf({nodeId:V,dragItems:g,nodeLookup:xe,dragging:!1});u==null||u(ue.sourceEvent,g,ae,L),ce==null||ce(ue.sourceEvent,ae,L),V||te==null||te(ue.sourceEvent,L)}}}).filter(ue=>{const xe=ue.target;return!ue.button&&(!H||!Ch(xe,`.${H}`,R))&&(!M||Ch(xe,M,R))});b.call(q)}function $(){b==null||b.on(".drag",null)}return{update:T,destroy:$}}function B1(t,r,i){const a=[],u={x:t.x-i,y:t.y-i,width:i*2,height:i*2};for(const f of r.values())ja(u,Ts(f))>0&&a.push(f);return a}const H1=250;function V1(t,r,i,a){var g,v;let u=[],f=1/0;const d=B1(t,i,r+H1);for(const w of d){const S=[...((g=w.internals.handleBounds)==null?void 0:g.source)??[],...((v=w.internals.handleBounds)==null?void 0:v.target)??[]];for(const x of S){if(a.nodeId===x.nodeId&&a.type===x.type&&a.id===x.id)continue;const{x:b,y:N}=Li(w,x,x.position,!0),C=Math.sqrt(Math.pow(b-t.x,2)+Math.pow(N-t.y,2));C>r||(C<f?(u=[{...x,x:b,y:N}],f=C):C===f&&u.push({...x,x:b,y:N}))}}if(!u.length)return null;if(u.length>1){const w=a.type==="source"?"target":"source";return u.find(S=>S.type===w)??u[0]}return u[0]}function dg(t,r,i,a,u,f=!1){var w,S,x;const d=a.get(t);if(!d)return null;const g=u==="strict"?(w=d.internals.handleBounds)==null?void 0:w[r]:[...((S=d.internals.handleBounds)==null?void 0:S.source)??[],...((x=d.internals.handleBounds)==null?void 0:x.target)??[]],v=(i?g==null?void 0:g.find(b=>b.id===i):g==null?void 0:g[0])??null;return v&&f?{...v,...Li(d,v,v.position,!0)}:v}function pg(t,r){return t||(r!=null&&r.classList.contains("target")?"target":r!=null&&r.classList.contains("source")?"source":null)}function K1(t,r){let i=null;return r?i=!0:t&&!r&&(i=!1),i}const hg=()=>!0;function U1(t,{connectionMode:r,connectionRadius:i,handleId:a,nodeId:u,edgeUpdaterType:f,isTarget:d,domNode:g,nodeLookup:v,lib:w,autoPanOnConnect:S,flowId:x,panBy:b,cancelConnection:N,onConnectStart:C,onConnect:A,onConnectEnd:T,isValidConnection:$=hg,onReconnectEnd:H,updateConnection:M,getTransform:R,getFromHandle:Y,autoPanSpeed:V,dragThreshold:U=1,handleDomNode:le}){const he=eg(t.target);let Se=0,q;const{x:ue,y:xe}=$r(t),D=pg(f,le),ce=g==null?void 0:g.getBoundingClientRect();let te=!1;if(!ce||!D)return;const ae=dg(u,D,a,v,r);if(!ae)return;let L=$r(t,ce),F=!1,Q=null,O=!1,B=null;function be(){if(!S||!ce)return;const[Ge,Le]=Qm(L,ce,V);b({x:Ge,y:Le}),Se=requestAnimationFrame(be)}const _e={...ae,nodeId:u,type:D,position:ae.position},$e=v.get(u);let Re={inProgress:!0,isValid:null,from:Li($e,_e,Ze.Left,!0),fromHandle:_e,fromPosition:_e.position,fromNode:$e,to:L,toHandle:null,toPosition:mh[_e.position],toNode:null,pointer:L};function we(){te=!0,M(Re),C==null||C(t,{nodeId:u,handleId:a,handleType:D})}U===0&&we();function De(Ge){if(!te){const{x:kt,y:Sn}=$r(Ge),rn=kt-ue,qt=Sn-xe;if(!(rn*rn+qt*qt>U*U))return;we()}if(!Y()||!_e){ke(Ge);return}const Le=R();L=$r(Ge,ce),q=V1(Da(L,Le,!1,[1,1]),i,v,_e),F||(be(),F=!0);const Be=mg(Ge,{handle:q,connectionMode:r,fromNodeId:u,fromHandleId:a,fromType:d?"target":"source",isValidConnection:$,doc:he,lib:w,flowId:x,nodeLookup:v});B=Be.handleDomNode,Q=Be.connection,O=K1(!!q,Be.isValid);const ut=v.get(u),at=ut?Li(ut,_e,Ze.Left,!0):Re.from,lt={...Re,from:at,isValid:O,to:Be.toHandle&&O?mu({x:Be.toHandle.x,y:Be.toHandle.y},Le):L,toHandle:Be.toHandle,toPosition:O&&Be.toHandle?Be.toHandle.position:mh[_e.position],toNode:Be.toHandle?v.get(Be.toHandle.nodeId):null,pointer:L};M(lt),Re=lt}function ke(Ge){if(!("touches"in Ge&&Ge.touches.length>0)){if(te){(q||B)&&Q&&O&&(A==null||A(Q));const{inProgress:Le,...Be}=Re,ut={...Be,toPosition:Re.toHandle?Re.toPosition:null};T==null||T(Ge,ut),f&&(H==null||H(Ge,ut))}N(),cancelAnimationFrame(Se),F=!1,O=!1,Q=null,B=null,he.removeEventListener("mousemove",De),he.removeEventListener("mouseup",ke),he.removeEventListener("touchmove",De),he.removeEventListener("touchend",ke)}}he.addEventListener("mousemove",De),he.addEventListener("mouseup",ke),he.addEventListener("touchmove",De),he.addEventListener("touchend",ke)}function mg(t,{handle:r,connectionMode:i,fromNodeId:a,fromHandleId:u,fromType:f,doc:d,lib:g,flowId:v,isValidConnection:w=hg,nodeLookup:S}){const x=f==="target",b=r?d.querySelector(`.${g}-flow__handle[data-id="${v}-${r==null?void 0:r.nodeId}-${r==null?void 0:r.id}-${r==null?void 0:r.type}"]`):null,{x:N,y:C}=$r(t),A=d.elementFromPoint(N,C),T=A!=null&&A.classList.contains(`${g}-flow__handle`)?A:b,$={handleDomNode:T,isValid:!1,connection:null,toHandle:null};if(T){const H=pg(void 0,T),M=T.getAttribute("data-nodeid"),R=T.getAttribute("data-handleid"),Y=T.classList.contains("connectable"),V=T.classList.contains("connectableend");if(!M||!H)return $;const U={source:x?M:a,sourceHandle:x?R:u,target:x?a:M,targetHandle:x?u:R};$.connection=U;const he=Y&&V&&(i===js.Strict?x&&H==="source"||!x&&H==="target":M!==a||R!==u);$.isValid=he&&w(U),$.toHandle=dg(M,H,R,S,i,!0)}return $}const Mf={onPointerDown:U1,isValid:mg};function q1({domNode:t,panZoom:r,getTransform:i,getViewScale:a}){const u=Zn(t);function f({translateExtent:g,width:v,height:w,zoomStep:S=1,pannable:x=!0,zoomable:b=!0,inversePan:N=!1}){const C=M=>{if(M.sourceEvent.type!=="wheel"||!r)return;const R=i(),Y=M.sourceEvent.ctrlKey&&Ma()?10:1,V=-M.sourceEvent.deltaY*(M.sourceEvent.deltaMode===1?.05:M.sourceEvent.deltaMode?1:.002)*S,U=R[2]*Math.pow(2,V*Y);r.scaleTo(U)};let A=[0,0];const T=M=>{(M.sourceEvent.type==="mousedown"||M.sourceEvent.type==="touchstart")&&(A=[M.sourceEvent.clientX??M.sourceEvent.touches[0].clientX,M.sourceEvent.clientY??M.sourceEvent.touches[0].clientY])},$=M=>{const R=i();if(M.sourceEvent.type!=="mousemove"&&M.sourceEvent.type!=="touchmove"||!r)return;const Y=[M.sourceEvent.clientX??M.sourceEvent.touches[0].clientX,M.sourceEvent.clientY??M.sourceEvent.touches[0].clientY],V=[Y[0]-A[0],Y[1]-A[1]];A=Y;const U=a()*Math.max(R[2],Math.log(R[2]))*(N?-1:1),le={x:R[0]-V[0]*U,y:R[1]-V[1]*U},he=[[0,0],[v,w]];r.setViewportConstrained({x:le.x,y:le.y,zoom:R[2]},he,g)},H=Hm().on("start",T).on("zoom",x?$:null).on("zoom.wheel",b?C:null);u.call(H,{})}function d(){u.on("zoom",null)}return{update:f,destroy:d,pointer:Tr}}const Pu=t=>({x:t.x,y:t.y,zoom:t.k}),of=({x:t,y:r,zoom:i})=>Eu.translate(t,r).scale(i),bs=(t,r)=>t.target.closest(`.${r}`),gg=(t,r)=>r===2&&Array.isArray(t)&&t.includes(2),W1=t=>((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2,sf=(t,r=0,i=W1,a=()=>{})=>{const u=typeof r=="number"&&r>0;return u||a(),u?t.transition().duration(r).ease(i).on("end",a):t},yg=t=>{const r=t.ctrlKey&&Ma()?10:1;return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*r};function Y1({zoomPanValues:t,noWheelClassName:r,d3Selection:i,d3Zoom:a,panOnScrollMode:u,panOnScrollSpeed:f,zoomOnPinch:d,onPanZoomStart:g,onPanZoom:v,onPanZoomEnd:w}){return S=>{if(bs(S,r))return S.ctrlKey&&S.preventDefault(),!1;S.preventDefault(),S.stopImmediatePropagation();const x=i.property("__zoom").k||1;if(S.ctrlKey&&d){const T=Tr(S),$=yg(S),H=x*Math.pow(2,$);a.scaleTo(i,H,T,S);return}const b=S.deltaMode===1?20:1;let N=u===Oi.Vertical?0:S.deltaX*b,C=u===Oi.Horizontal?0:S.deltaY*b;!Ma()&&S.shiftKey&&u!==Oi.Vertical&&(N=S.deltaY*b,C=0),a.translateBy(i,-(N/x)*f,-(C/x)*f,{internal:!0});const A=Pu(i.property("__zoom"));clearTimeout(t.panScrollTimeout),t.isPanScrolling?(v==null||v(S,A),t.panScrollTimeout=setTimeout(()=>{w==null||w(S,A),t.isPanScrolling=!1},150)):(t.isPanScrolling=!0,g==null||g(S,A))}}function X1({noWheelClassName:t,preventScrolling:r,d3ZoomHandler:i}){return function(a,u){const f=a.type==="wheel",d=!r&&f&&!a.ctrlKey,g=bs(a,t);if(a.ctrlKey&&f&&g&&a.preventDefault(),d||g)return null;a.preventDefault(),i.call(this,a,u)}}function Q1({zoomPanValues:t,onDraggingChange:r,onPanZoomStart:i}){return a=>{var f,d,g;if((f=a.sourceEvent)!=null&&f.internal)return;const u=Pu(a.transform);t.mouseButton=((d=a.sourceEvent)==null?void 0:d.button)||0,t.isZoomingOrPanning=!0,t.prevViewport=u,((g=a.sourceEvent)==null?void 0:g.type)==="mousedown"&&r(!0),i&&(i==null||i(a.sourceEvent,u))}}function G1({zoomPanValues:t,panOnDrag:r,onPaneContextMenu:i,onTransformChange:a,onPanZoom:u}){return f=>{var d,g;t.usedRightMouseButton=!!(i&&gg(r,t.mouseButton??0)),(d=f.sourceEvent)!=null&&d.sync||a([f.transform.x,f.transform.y,f.transform.k]),u&&!((g=f.sourceEvent)!=null&&g.internal)&&(u==null||u(f.sourceEvent,Pu(f.transform)))}}function Z1({zoomPanValues:t,panOnDrag:r,panOnScroll:i,onDraggingChange:a,onPanZoomEnd:u,onPaneContextMenu:f}){return d=>{var g;if(!((g=d.sourceEvent)!=null&&g.internal)&&(t.isZoomingOrPanning=!1,f&&gg(r,t.mouseButton??0)&&!t.usedRightMouseButton&&d.sourceEvent&&f(d.sourceEvent),t.usedRightMouseButton=!1,a(!1),u)){const v=Pu(d.transform);t.prevViewport=v,clearTimeout(t.timerId),t.timerId=setTimeout(()=>{u==null||u(d.sourceEvent,v)},i?150:0)}}}function J1({zoomActivationKeyPressed:t,zoomOnScroll:r,zoomOnPinch:i,panOnDrag:a,panOnScroll:u,zoomOnDoubleClick:f,userSelectionActive:d,noWheelClassName:g,noPanClassName:v,lib:w,connectionInProgress:S}){return x=>{var T;const b=t||r,N=i&&x.ctrlKey,C=x.type==="wheel";if(x.button===1&&x.type==="mousedown"&&(bs(x,`${w}-flow__node`)||bs(x,`${w}-flow__edge`)))return!0;if(!a&&!b&&!u&&!f&&!i||d||S&&!C||bs(x,g)&&C||bs(x,v)&&(!C||u&&C&&!t)||!i&&x.ctrlKey&&C)return!1;if(!i&&x.type==="touchstart"&&((T=x.touches)==null?void 0:T.length)>1)return x.preventDefault(),!1;if(!b&&!u&&!N&&C||!a&&(x.type==="mousedown"||x.type==="touchstart")||Array.isArray(a)&&!a.includes(x.button)&&x.type==="mousedown")return!1;const A=Array.isArray(a)&&a.includes(x.button)||!x.button||x.button<=1;return(!x.ctrlKey||C)&&A}}function e_({domNode:t,minZoom:r,maxZoom:i,translateExtent:a,viewport:u,onPanZoom:f,onPanZoomStart:d,onPanZoomEnd:g,onDraggingChange:v}){const w={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},S=t.getBoundingClientRect(),x=Hm().scaleExtent([r,i]).translateExtent(a),b=Zn(t).call(x);H({x:u.x,y:u.y,zoom:Ms(u.zoom,r,i)},[[0,0],[S.width,S.height]],a);const N=b.on("wheel.zoom"),C=b.on("dblclick.zoom");x.wheelDelta(yg);function A(q,ue){return b?new Promise(xe=>{x==null||x.interpolate((ue==null?void 0:ue.interpolate)==="linear"?_a:eu).transform(sf(b,ue==null?void 0:ue.duration,ue==null?void 0:ue.ease,()=>xe(!0)),q)}):Promise.resolve(!1)}function T({noWheelClassName:q,noPanClassName:ue,onPaneContextMenu:xe,userSelectionActive:D,panOnScroll:ce,panOnDrag:te,panOnScrollMode:ae,panOnScrollSpeed:L,preventScrolling:F,zoomOnPinch:Q,zoomOnScroll:O,zoomOnDoubleClick:B,zoomActivationKeyPressed:be,lib:_e,onTransformChange:$e,connectionInProgress:Ie,paneClickDistance:Re,selectionOnDrag:we}){D&&!w.isZoomingOrPanning&&$();const De=ce&&!be&&!D;x.clickDistance(we?1/0:!Ar(Re)||Re<0?0:Re);const ke=De?Y1({zoomPanValues:w,noWheelClassName:q,d3Selection:b,d3Zoom:x,panOnScrollMode:ae,panOnScrollSpeed:L,zoomOnPinch:Q,onPanZoomStart:d,onPanZoom:f,onPanZoomEnd:g}):X1({noWheelClassName:q,preventScrolling:F,d3ZoomHandler:N});if(b.on("wheel.zoom",ke,{passive:!1}),!D){const Le=Q1({zoomPanValues:w,onDraggingChange:v,onPanZoomStart:d});x.on("start",Le);const Be=G1({zoomPanValues:w,panOnDrag:te,onPaneContextMenu:!!xe,onPanZoom:f,onTransformChange:$e});x.on("zoom",Be);const ut=Z1({zoomPanValues:w,panOnDrag:te,panOnScroll:ce,onPaneContextMenu:xe,onPanZoomEnd:g,onDraggingChange:v});x.on("end",ut)}const Ge=J1({zoomActivationKeyPressed:be,panOnDrag:te,zoomOnScroll:O,panOnScroll:ce,zoomOnDoubleClick:B,zoomOnPinch:Q,userSelectionActive:D,noPanClassName:ue,noWheelClassName:q,lib:_e,connectionInProgress:Ie});x.filter(Ge),B?b.on("dblclick.zoom",C):b.on("dblclick.zoom",null)}function $(){x.on("zoom",null)}async function H(q,ue,xe){const D=of(q),ce=x==null?void 0:x.constrain()(D,ue,xe);return ce&&await A(ce),new Promise(te=>te(ce))}async function M(q,ue){const xe=of(q);return await A(xe,ue),new Promise(D=>D(xe))}function R(q){if(b){const ue=of(q),xe=b.property("__zoom");(xe.k!==q.zoom||xe.x!==q.x||xe.y!==q.y)&&(x==null||x.transform(b,ue,null,{sync:!0}))}}function Y(){const q=b?Bm(b.node()):{x:0,y:0,k:1};return{x:q.x,y:q.y,zoom:q.k}}function V(q,ue){return b?new Promise(xe=>{x==null||x.interpolate((ue==null?void 0:ue.interpolate)==="linear"?_a:eu).scaleTo(sf(b,ue==null?void 0:ue.duration,ue==null?void 0:ue.ease,()=>xe(!0)),q)}):Promise.resolve(!1)}function U(q,ue){return b?new Promise(xe=>{x==null||x.interpolate((ue==null?void 0:ue.interpolate)==="linear"?_a:eu).scaleBy(sf(b,ue==null?void 0:ue.duration,ue==null?void 0:ue.ease,()=>xe(!0)),q)}):Promise.resolve(!1)}function le(q){x==null||x.scaleExtent(q)}function he(q){x==null||x.translateExtent(q)}function Se(q){const ue=!Ar(q)||q<0?0:q;x==null||x.clickDistance(ue)}return{update:T,destroy:$,setViewport:M,setViewportConstrained:H,getViewport:Y,scaleTo:V,scaleBy:U,setScaleExtent:le,setTranslateExtent:he,syncViewport:R,setClickDistance:Se}}var As;(function(t){t.Line="line",t.Handle="handle"})(As||(As={}));function t_({width:t,prevWidth:r,height:i,prevHeight:a,affectsX:u,affectsY:f}){const d=t-r,g=i-a,v=[d>0?1:d<0?-1:0,g>0?1:g<0?-1:0];return d&&u&&(v[0]=v[0]*-1),g&&f&&(v[1]=v[1]*-1),v}function Ph(t){const r=t.includes("right")||t.includes("left"),i=t.includes("bottom")||t.includes("top"),a=t.includes("left"),u=t.includes("top");return{isHorizontal:r,isVertical:i,affectsX:a,affectsY:u}}function oi(t,r){return Math.max(0,r-t)}function ii(t,r){return Math.max(0,t-r)}function Xl(t,r,i){return Math.max(0,r-t,t-i)}function jh(t,r){return t?!r:r}function n_(t,r,i,a,u,f,d,g){let{affectsX:v,affectsY:w}=r;const{isHorizontal:S,isVertical:x}=r,b=S&&x,{xSnapped:N,ySnapped:C}=i,{minWidth:A,maxWidth:T,minHeight:$,maxHeight:H}=a,{x:M,y:R,width:Y,height:V,aspectRatio:U}=t;let le=Math.floor(S?N-t.pointerX:0),he=Math.floor(x?C-t.pointerY:0);const Se=Y+(v?-le:le),q=V+(w?-he:he),ue=-f[0]*Y,xe=-f[1]*V;let D=Xl(Se,A,T),ce=Xl(q,$,H);if(d){let L=0,F=0;v&&le<0?L=oi(M+le+ue,d[0][0]):!v&&le>0&&(L=ii(M+Se+ue,d[1][0])),w&&he<0?F=oi(R+he+xe,d[0][1]):!w&&he>0&&(F=ii(R+q+xe,d[1][1])),D=Math.max(D,L),ce=Math.max(ce,F)}if(g){let L=0,F=0;v&&le>0?L=ii(M+le,g[0][0]):!v&&le<0&&(L=oi(M+Se,g[1][0])),w&&he>0?F=ii(R+he,g[0][1]):!w&&he<0&&(F=oi(R+q,g[1][1])),D=Math.max(D,L),ce=Math.max(ce,F)}if(u){if(S){const L=Xl(Se/U,$,H)*U;if(D=Math.max(D,L),d){let F=0;!v&&!w||v&&!w&&b?F=ii(R+xe+Se/U,d[1][1])*U:F=oi(R+xe+(v?le:-le)/U,d[0][1])*U,D=Math.max(D,F)}if(g){let F=0;!v&&!w||v&&!w&&b?F=oi(R+Se/U,g[1][1])*U:F=ii(R+(v?le:-le)/U,g[0][1])*U,D=Math.max(D,F)}}if(x){const L=Xl(q*U,A,T)/U;if(ce=Math.max(ce,L),d){let F=0;!v&&!w||w&&!v&&b?F=ii(M+q*U+ue,d[1][0])/U:F=oi(M+(w?he:-he)*U+ue,d[0][0])/U,ce=Math.max(ce,F)}if(g){let F=0;!v&&!w||w&&!v&&b?F=oi(M+q*U,g[1][0])/U:F=ii(M+(w?he:-he)*U,g[0][0])/U,ce=Math.max(ce,F)}}}he=he+(he<0?ce:-ce),le=le+(le<0?D:-D),u&&(b?Se>q*U?he=(jh(v,w)?-le:le)/U:le=(jh(v,w)?-he:he)*U:S?(he=le/U,w=v):(le=he*U,v=w));const te=v?M+le:M,ae=w?R+he:R;return{width:Y+(v?-le:le),height:V+(w?-he:he),x:f[0]*le*(v?-1:1)+te,y:f[1]*he*(w?-1:1)+ae}}const vg={width:0,height:0,x:0,y:0},r_={...vg,pointerX:0,pointerY:0,aspectRatio:1};function o_(t){return[[0,0],[t.measured.width,t.measured.height]]}function i_(t,r,i){const a=r.position.x+t.position.x,u=r.position.y+t.position.y,f=t.measured.width??0,d=t.measured.height??0,g=i[0]*f,v=i[1]*d;return[[a-g,u-v],[a+f-g,u+d-v]]}function s_({domNode:t,nodeId:r,getStoreItems:i,onChange:a,onEnd:u}){const f=Zn(t);let d={controlDirection:Ph("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function g({controlPosition:w,boundaries:S,keepAspectRatio:x,resizeDirection:b,onResizeStart:N,onResize:C,onResizeEnd:A,shouldResize:T}){let $={...vg},H={...r_};d={boundaries:S,resizeDirection:b,keepAspectRatio:x,controlDirection:Ph(w)};let M,R=null,Y=[],V,U,le,he=!1;const Se=Cm().on("start",q=>{const{nodeLookup:ue,transform:xe,snapGrid:D,snapToGrid:ce,nodeOrigin:te,paneDomNode:ae}=i();if(M=ue.get(r),!M)return;R=(ae==null?void 0:ae.getBoundingClientRect())??null;const{xSnapped:L,ySnapped:F}=Sa(q.sourceEvent,{transform:xe,snapGrid:D,snapToGrid:ce,containerBounds:R});$={width:M.measured.width??0,height:M.measured.height??0,x:M.position.x??0,y:M.position.y??0},H={...$,pointerX:L,pointerY:F,aspectRatio:$.width/$.height},V=void 0,M.parentId&&(M.extent==="parent"||M.expandParent)&&(V=ue.get(M.parentId),U=V&&M.extent==="parent"?o_(V):void 0),Y=[],le=void 0;for(const[Q,O]of ue)if(O.parentId===r&&(Y.push({id:Q,position:{...O.position},extent:O.extent}),O.extent==="parent"||O.expandParent)){const B=i_(O,M,O.origin??te);le?le=[[Math.min(B[0][0],le[0][0]),Math.min(B[0][1],le[0][1])],[Math.max(B[1][0],le[1][0]),Math.max(B[1][1],le[1][1])]]:le=B}N==null||N(q,{...$})}).on("drag",q=>{const{transform:ue,snapGrid:xe,snapToGrid:D,nodeOrigin:ce}=i(),te=Sa(q.sourceEvent,{transform:ue,snapGrid:xe,snapToGrid:D,containerBounds:R}),ae=[];if(!M)return;const{x:L,y:F,width:Q,height:O}=$,B={},be=M.origin??ce,{width:_e,height:$e,x:Ie,y:Re}=n_(H,d.controlDirection,te,d.boundaries,d.keepAspectRatio,be,U,le),we=_e!==Q,De=$e!==O,ke=Ie!==L&&we,Ge=Re!==F&&De;if(!ke&&!Ge&&!we&&!De)return;if((ke||Ge||be[0]===1||be[1]===1)&&(B.x=ke?Ie:$.x,B.y=Ge?Re:$.y,$.x=B.x,$.y=B.y,Y.length>0)){const at=Ie-L,lt=Re-F;for(const kt of Y)kt.position={x:kt.position.x-at+be[0]*(_e-Q),y:kt.position.y-lt+be[1]*($e-O)},ae.push(kt)}if((we||De)&&(B.width=we&&(!d.resizeDirection||d.resizeDirection==="horizontal")?_e:$.width,B.height=De&&(!d.resizeDirection||d.resizeDirection==="vertical")?$e:$.height,$.width=B.width,$.height=B.height),V&&M.expandParent){const at=be[0]*(B.width??0);B.x&&B.x<at&&($.x=at,H.x=H.x-(B.x-at));const lt=be[1]*(B.height??0);B.y&&B.y<lt&&($.y=lt,H.y=H.y-(B.y-lt))}const Le=t_({width:$.width,prevWidth:Q,height:$.height,prevHeight:O,affectsX:d.controlDirection.affectsX,affectsY:d.controlDirection.affectsY}),Be={...$,direction:Le};(T==null?void 0:T(q,Be))!==!1&&(he=!0,C==null||C(q,Be),a(B,ae))}).on("end",q=>{he&&(A==null||A(q,{...$}),u==null||u({...$}),he=!1)});f.call(Se)}function v(){f.on(".drag",null)}return{update:g,destroy:v}}var af={exports:{}},lf={},uf={exports:{}},cf={};/**
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 Mh;function a_(){if(Mh)return cf;Mh=1;var t=Ia();function r(x,b){return x===b&&(x!==0||1/x===1/b)||x!==x&&b!==b}var i=typeof Object.is=="function"?Object.is:r,a=t.useState,u=t.useEffect,f=t.useLayoutEffect,d=t.useDebugValue;function g(x,b){var N=b(),C=a({inst:{value:N,getSnapshot:b}}),A=C[0].inst,T=C[1];return f(function(){A.value=N,A.getSnapshot=b,v(A)&&T({inst:A})},[x,N,b]),u(function(){return v(A)&&T({inst:A}),x(function(){v(A)&&T({inst:A})})},[x]),d(N),N}function v(x){var b=x.getSnapshot;x=x.value;try{var N=b();return!i(x,N)}catch{return!0}}function w(x,b){return b()}var S=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?w:g;return cf.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:S,cf}var Th;function l_(){return Th||(Th=1,uf.exports=a_()),uf.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 Ih;function u_(){if(Ih)return lf;Ih=1;var t=Ia(),r=l_();function i(w,S){return w===S&&(w!==0||1/w===1/S)||w!==w&&S!==S}var a=typeof Object.is=="function"?Object.is:i,u=r.useSyncExternalStore,f=t.useRef,d=t.useEffect,g=t.useMemo,v=t.useDebugValue;return lf.useSyncExternalStoreWithSelector=function(w,S,x,b,N){var C=f(null);if(C.current===null){var A={hasValue:!1,value:null};C.current=A}else A=C.current;C=g(function(){function $(V){if(!H){if(H=!0,M=V,V=b(V),N!==void 0&&A.hasValue){var U=A.value;if(N(U,V))return R=U}return R=V}if(U=R,a(M,V))return U;var le=b(V);return N!==void 0&&N(U,le)?(M=V,U):(M=V,R=le)}var H=!1,M,R,Y=x===void 0?null:x;return[function(){return $(S())},Y===null?void 0:function(){return $(Y())}]},[S,x,b,N]);var T=u(w,C[0],C[1]);return d(function(){A.hasValue=!0,A.value=T},[T]),v(T),T},lf}var Ah;function c_(){return Ah||(Ah=1,af.exports=u_()),af.exports}var f_=c_();const d_=yu(f_),p_={},$h=t=>{let r;const i=new Set,a=(S,x)=>{const b=typeof S=="function"?S(r):S;if(!Object.is(b,r)){const N=r;r=x??(typeof b!="object"||b===null)?b:Object.assign({},r,b),i.forEach(C=>C(r,N))}},u=()=>r,v={setState:a,getState:u,getInitialState:()=>w,subscribe:S=>(i.add(S),()=>i.delete(S)),destroy:()=>{(p_?"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()}},w=r=t(a,u,v);return v},h_=t=>t?$h(t):$h,{useDebugValue:m_}=am,{useSyncExternalStoreWithSelector:g_}=d_,y_=t=>t;function xg(t,r=y_,i){const a=g_(t.subscribe,t.getState,t.getServerState||t.getInitialState,r,i);return m_(a),a}const Oh=(t,r)=>{const i=h_(t),a=(u,f=r)=>xg(i,u,f);return Object.assign(a,i),a},v_=(t,r)=>t?Oh(t,r):Oh;function Ot(t,r){if(Object.is(t,r))return!0;if(typeof t!="object"||t===null||typeof r!="object"||r===null)return!1;if(t instanceof Map&&r instanceof Map){if(t.size!==r.size)return!1;for(const[a,u]of t)if(!Object.is(u,r.get(a)))return!1;return!0}if(t instanceof Set&&r instanceof Set){if(t.size!==r.size)return!1;for(const a of t)if(!r.has(a))return!1;return!0}const i=Object.keys(t);if(i.length!==Object.keys(r).length)return!1;for(const a of i)if(!Object.prototype.hasOwnProperty.call(r,a)||!Object.is(t[a],r[a]))return!1;return!0}lm();const ju=de.createContext(null),x_=ju.Provider,wg=Zr.error001();function gt(t,r){const i=de.useContext(ju);if(i===null)throw new Error(wg);return xg(i,t,r)}function It(){const t=de.useContext(ju);if(t===null)throw new Error(wg);return de.useMemo(()=>({getState:t.getState,setState:t.setState,subscribe:t.subscribe}),[t])}const Rh={display:"none"},w_={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},_g="react-flow__node-desc",Sg="react-flow__edge-desc",__="react-flow__aria-live",S_=t=>t.ariaLiveMessage,b_=t=>t.ariaLabelConfig;function k_({rfId:t}){const r=gt(S_);return P.jsx("div",{id:`${__}-${t}`,"aria-live":"assertive","aria-atomic":"true",style:w_,children:r})}function E_({rfId:t,disableKeyboardA11y:r}){const i=gt(b_);return P.jsxs(P.Fragment,{children:[P.jsx("div",{id:`${_g}-${t}`,style:Rh,children:r?i["node.a11yDescription.default"]:i["node.a11yDescription.keyboardDisabled"]}),P.jsx("div",{id:`${Sg}-${t}`,style:Rh,children:i["edge.a11yDescription.default"]}),!r&&P.jsx(k_,{rfId:t})]})}const La=de.forwardRef(({position:t="top-left",children:r,className:i,style:a,...u},f)=>{const d=`${t}`.split("-");return P.jsx("div",{className:Ut(["react-flow__panel",i,...d]),style:a,ref:f,...u,children:r})});La.displayName="Panel";function N_({proOptions:t,position:r="bottom-right"}){return t!=null&&t.hideAttribution?null:P.jsx(La,{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:P.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const C_=t=>{const r=[],i=[];for(const[,a]of t.nodeLookup)a.selected&&r.push(a.internals.userNode);for(const[,a]of t.edgeLookup)a.selected&&i.push(a);return{selectedNodes:r,selectedEdges:i}},Ql=t=>t.id;function P_(t,r){return Ot(t.selectedNodes.map(Ql),r.selectedNodes.map(Ql))&&Ot(t.selectedEdges.map(Ql),r.selectedEdges.map(Ql))}function j_({onSelectionChange:t}){const r=It(),{selectedNodes:i,selectedEdges:a}=gt(C_,P_);return de.useEffect(()=>{const u={nodes:i,edges:a};t==null||t(u),r.getState().onSelectionChangeHandlers.forEach(f=>f(u))},[i,a,t]),null}const M_=t=>!!t.onSelectionChangeHandlers;function T_({onSelectionChange:t}){const r=gt(M_);return t||r?P.jsx(j_,{onSelectionChange:t}):null}const Tf=typeof window<"u"?de.useLayoutEffect:de.useEffect,bg=[0,0],I_={x:0,y:0,zoom:1},A_=["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"],zh=[...A_,"rfId"],$_=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}),Dh={translateExtent:Ca,nodeOrigin:bg,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function O_(t){const{setNodes:r,setEdges:i,setMinZoom:a,setMaxZoom:u,setTranslateExtent:f,setNodeExtent:d,reset:g,setDefaultNodesAndEdges:v}=gt($_,Ot),w=It();Tf(()=>(v(t.defaultNodes,t.defaultEdges),()=>{S.current=Dh,g()}),[]);const S=de.useRef(Dh);return Tf(()=>{for(const x of zh){const b=t[x],N=S.current[x];b!==N&&(typeof t[x]>"u"||(x==="nodes"?r(b):x==="edges"?i(b):x==="minZoom"?a(b):x==="maxZoom"?u(b):x==="translateExtent"?f(b):x==="nodeExtent"?d(b):x==="ariaLabelConfig"?w.setState({ariaLabelConfig:x1(b)}):x==="fitView"?w.setState({fitViewQueued:b}):x==="fitViewOptions"?w.setState({fitViewOptions:b}):w.setState({[x]:b})))}S.current=t},zh.map(x=>t[x])),null}function Lh(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function R_(t){var a;const[r,i]=de.useState(t==="system"?null:t);return de.useEffect(()=>{if(t!=="system"){i(t);return}const u=Lh(),f=()=>i(u!=null&&u.matches?"dark":"light");return f(),u==null||u.addEventListener("change",f),()=>{u==null||u.removeEventListener("change",f)}},[t]),r!==null?r:(a=Lh())!=null&&a.matches?"dark":"light"}const Fh=typeof document<"u"?document:null;function Ta(t=null,r={target:Fh,actInsideInputWithModifier:!0}){const[i,a]=de.useState(!1),u=de.useRef(!1),f=de.useRef(new Set([])),[d,g]=de.useMemo(()=>{if(t!==null){const w=(Array.isArray(t)?t:[t]).filter(x=>typeof x=="string").map(x=>x.replace("+",`
197
+ `).replace(`
198
+
199
+ `,`
200
+ +`).split(`
201
+ `)),S=w.reduce((x,b)=>x.concat(...b),[]);return[w,S]}return[[],[]]},[t]);return de.useEffect(()=>{const v=(r==null?void 0:r.target)??Fh,w=(r==null?void 0:r.actInsideInputWithModifier)??!0;if(t!==null){const S=N=>{var T,$;if(u.current=N.ctrlKey||N.metaKey||N.shiftKey||N.altKey,(!u.current||u.current&&!w)&&tg(N))return!1;const A=Hh(N.code,g);if(f.current.add(N[A]),Bh(d,f.current,!1)){const H=(($=(T=N.composedPath)==null?void 0:T.call(N))==null?void 0:$[0])||N.target,M=(H==null?void 0:H.nodeName)==="BUTTON"||(H==null?void 0:H.nodeName)==="A";r.preventDefault!==!1&&(u.current||!M)&&N.preventDefault(),a(!0)}},x=N=>{const C=Hh(N.code,g);Bh(d,f.current,!0)?(a(!1),f.current.clear()):f.current.delete(N[C]),N.key==="Meta"&&f.current.clear(),u.current=!1},b=()=>{f.current.clear(),a(!1)};return v==null||v.addEventListener("keydown",S),v==null||v.addEventListener("keyup",x),window.addEventListener("blur",b),window.addEventListener("contextmenu",b),()=>{v==null||v.removeEventListener("keydown",S),v==null||v.removeEventListener("keyup",x),window.removeEventListener("blur",b),window.removeEventListener("contextmenu",b)}}},[t,a]),i}function Bh(t,r,i){return t.filter(a=>i||a.length===r.size).some(a=>a.every(u=>r.has(u)))}function Hh(t,r){return r.includes(t)?"code":"key"}const z_=()=>{const t=It();return de.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:a}=t.getState();return a?a.scaleTo(r,i):Promise.resolve(!1)},getZoom:()=>t.getState().transform[2],setViewport:async(r,i)=>{const{transform:[a,u,f],panZoom:d}=t.getState();return d?(await d.setViewport({x:r.x??a,y:r.y??u,zoom:r.zoom??f},i),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[r,i,a]=t.getState().transform;return{x:r,y:i,zoom:a}},setCenter:async(r,i,a)=>t.getState().setCenter(r,i,a),fitBounds:async(r,i)=>{const{width:a,height:u,minZoom:f,maxZoom:d,panZoom:g}=t.getState(),v=Vf(r,a,u,f,d,(i==null?void 0:i.padding)??.1);return g?(await g.setViewport(v,{duration:i==null?void 0:i.duration,ease:i==null?void 0:i.ease,interpolate:i==null?void 0:i.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(r,i={})=>{const{transform:a,snapGrid:u,snapToGrid:f,domNode:d}=t.getState();if(!d)return r;const{x:g,y:v}=d.getBoundingClientRect(),w={x:r.x-g,y:r.y-v},S=i.snapGrid??u,x=i.snapToGrid??f;return Da(w,a,x,S)},flowToScreenPosition:r=>{const{transform:i,domNode:a}=t.getState();if(!a)return r;const{x:u,y:f}=a.getBoundingClientRect(),d=mu(r,i);return{x:d.x+u,y:d.y+f}}}),[])};function kg(t,r){const i=[],a=new Map,u=[];for(const f of t)if(f.type==="add"){u.push(f);continue}else if(f.type==="remove"||f.type==="replace")a.set(f.id,[f]);else{const d=a.get(f.id);d?d.push(f):a.set(f.id,[f])}for(const f of r){const d=a.get(f.id);if(!d){i.push(f);continue}if(d[0].type==="remove")continue;if(d[0].type==="replace"){i.push({...d[0].item});continue}const g={...f};for(const v of d)D_(v,g);i.push(g)}return u.length&&u.forEach(f=>{f.index!==void 0?i.splice(f.index,0,{...f.item}):i.push({...f.item})}),i}function D_(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 Eg(t,r){return kg(t,r)}function Ng(t,r){return kg(t,r)}function Ii(t,r){return{id:t,type:"select",selected:r}}function ks(t,r=new Set,i=!1){const a=[];for(const[u,f]of t){const d=r.has(u);!(f.selected===void 0&&!d)&&f.selected!==d&&(i&&(f.selected=d),a.push(Ii(f.id,d)))}return a}function Vh({items:t=[],lookup:r}){var u;const i=[],a=new Map(t.map(f=>[f.id,f]));for(const[f,d]of t.entries()){const g=r.get(d.id),v=((u=g==null?void 0:g.internals)==null?void 0:u.userNode)??g;v!==void 0&&v!==d&&i.push({id:d.id,item:d,type:"replace"}),v===void 0&&i.push({item:d,type:"add",index:f})}for(const[f]of r)a.get(f)===void 0&&i.push({id:f,type:"remove"});return i}function Kh(t){return{id:t.id,type:"remove"}}const Uh=t=>u1(t),L_=t=>Wm(t);function Cg(t){return de.forwardRef(t)}function qh(t){const[r,i]=de.useState(BigInt(0)),[a]=de.useState(()=>F_(()=>i(u=>u+BigInt(1))));return Tf(()=>{const u=a.get();u.length&&(t(u),a.reset())},[r]),a}function F_(t){let r=[];return{get:()=>r,reset:()=>{r=[]},push:i=>{r.push(i),t()}}}const Pg=de.createContext(null);function B_({children:t}){const r=It(),i=de.useCallback(g=>{const{nodes:v=[],setNodes:w,hasDefaultNodes:S,onNodesChange:x,nodeLookup:b,fitViewQueued:N,onNodesChangeMiddlewareMap:C}=r.getState();let A=v;for(const $ of g)A=typeof $=="function"?$(A):$;let T=Vh({items:A,lookup:b});for(const $ of C.values())T=$(T);S&&w(A),T.length>0?x==null||x(T):N&&window.requestAnimationFrame(()=>{const{fitViewQueued:$,nodes:H,setNodes:M}=r.getState();$&&M(H)})},[]),a=qh(i),u=de.useCallback(g=>{const{edges:v=[],setEdges:w,hasDefaultEdges:S,onEdgesChange:x,edgeLookup:b}=r.getState();let N=v;for(const C of g)N=typeof C=="function"?C(N):C;S?w(N):x&&x(Vh({items:N,lookup:b}))},[]),f=qh(u),d=de.useMemo(()=>({nodeQueue:a,edgeQueue:f}),[]);return P.jsx(Pg.Provider,{value:d,children:t})}function H_(){const t=de.useContext(Pg);if(!t)throw new Error("useBatchContext must be used within a BatchProvider");return t}const V_=t=>!!t.panZoom;function Qf(){const t=z_(),r=It(),i=H_(),a=gt(V_),u=de.useMemo(()=>{const f=x=>r.getState().nodeLookup.get(x),d=x=>{i.nodeQueue.push(x)},g=x=>{i.edgeQueue.push(x)},v=x=>{var $,H;const{nodeLookup:b,nodeOrigin:N}=r.getState(),C=Uh(x)?x:b.get(x.id),A=C.parentId?Jm(C.position,C.measured,C.parentId,b,N):C.position,T={...C,position:A,width:(($=C.measured)==null?void 0:$.width)??C.width,height:((H=C.measured)==null?void 0:H.height)??C.height};return Ts(T)},w=(x,b,N={replace:!1})=>{d(C=>C.map(A=>{if(A.id===x){const T=typeof b=="function"?b(A):b;return N.replace&&Uh(T)?T:{...A,...T}}return A}))},S=(x,b,N={replace:!1})=>{g(C=>C.map(A=>{if(A.id===x){const T=typeof b=="function"?b(A):b;return N.replace&&L_(T)?T:{...A,...T}}return A}))};return{getNodes:()=>r.getState().nodes.map(x=>({...x})),getNode:x=>{var b;return(b=f(x))==null?void 0:b.internals.userNode},getInternalNode:f,getEdges:()=>{const{edges:x=[]}=r.getState();return x.map(b=>({...b}))},getEdge:x=>r.getState().edgeLookup.get(x),setNodes:d,setEdges:g,addNodes:x=>{const b=Array.isArray(x)?x:[x];i.nodeQueue.push(N=>[...N,...b])},addEdges:x=>{const b=Array.isArray(x)?x:[x];i.edgeQueue.push(N=>[...N,...b])},toObject:()=>{const{nodes:x=[],edges:b=[],transform:N}=r.getState(),[C,A,T]=N;return{nodes:x.map($=>({...$})),edges:b.map($=>({...$})),viewport:{x:C,y:A,zoom:T}}},deleteElements:async({nodes:x=[],edges:b=[]})=>{const{nodes:N,edges:C,onNodesDelete:A,onEdgesDelete:T,triggerNodeChanges:$,triggerEdgeChanges:H,onDelete:M,onBeforeDelete:R}=r.getState(),{nodes:Y,edges:V}=await h1({nodesToRemove:x,edgesToRemove:b,nodes:N,edges:C,onBeforeDelete:R}),U=V.length>0,le=Y.length>0;if(U){const he=V.map(Kh);T==null||T(V),H(he)}if(le){const he=Y.map(Kh);A==null||A(Y),$(he)}return(le||U)&&(M==null||M({nodes:Y,edges:V})),{deletedNodes:Y,deletedEdges:V}},getIntersectingNodes:(x,b=!0,N)=>{const C=yh(x),A=C?x:v(x),T=N!==void 0;return A?(N||r.getState().nodes).filter($=>{const H=r.getState().nodeLookup.get($.id);if(H&&!C&&($.id===x.id||!H.internals.positionAbsolute))return!1;const M=Ts(T?$:H),R=ja(M,A);return b&&R>0||R>=M.width*M.height||R>=A.width*A.height}):[]},isNodeIntersecting:(x,b,N=!0)=>{const A=yh(x)?x:v(x);if(!A)return!1;const T=ja(A,b);return N&&T>0||T>=b.width*b.height||T>=A.width*A.height},updateNode:w,updateNodeData:(x,b,N={replace:!1})=>{w(x,C=>{const A=typeof b=="function"?b(C):b;return N.replace?{...C,data:A}:{...C,data:{...C.data,...A}}},N)},updateEdge:S,updateEdgeData:(x,b,N={replace:!1})=>{S(x,C=>{const A=typeof b=="function"?b(C):b;return N.replace?{...C,data:A}:{...C,data:{...C.data,...A}}},N)},getNodesBounds:x=>{const{nodeLookup:b,nodeOrigin:N}=r.getState();return c1(x,{nodeLookup:b,nodeOrigin:N})},getHandleConnections:({type:x,id:b,nodeId:N})=>{var C;return Array.from(((C=r.getState().connectionLookup.get(`${N}-${x}${b?`-${b}`:""}`))==null?void 0:C.values())??[])},getNodeConnections:({type:x,handleId:b,nodeId:N})=>{var C;return Array.from(((C=r.getState().connectionLookup.get(`${N}${x?b?`-${x}-${b}`:`-${x}`:""}`))==null?void 0:C.values())??[])},fitView:async x=>{const b=r.getState().fitViewResolver??v1();return r.setState({fitViewQueued:!0,fitViewOptions:x,fitViewResolver:b}),i.nodeQueue.push(N=>[...N]),b.promise}}},[]);return de.useMemo(()=>({...u,...t,viewportInitialized:a}),[a])}const Wh=t=>t.selected,K_=typeof window<"u"?window:void 0;function U_({deleteKeyCode:t,multiSelectionKeyCode:r}){const i=It(),{deleteElements:a}=Qf(),u=Ta(t,{actInsideInputWithModifier:!1}),f=Ta(r,{target:K_});de.useEffect(()=>{if(u){const{edges:d,nodes:g}=i.getState();a({nodes:g.filter(Wh),edges:d.filter(Wh)}),i.setState({nodesSelectionActive:!1})}},[u]),de.useEffect(()=>{i.setState({multiSelectionActive:f})},[f])}function q_(t){const r=It();de.useEffect(()=>{const i=()=>{var u,f,d,g;if(!t.current||!(((f=(u=t.current).checkVisibility)==null?void 0:f.call(u))??!0))return!1;const a=Kf(t.current);(a.height===0||a.width===0)&&((g=(d=r.getState()).onError)==null||g.call(d,"004",Zr.error004())),r.setState({width:a.width||500,height:a.height||500})};if(t.current){i(),window.addEventListener("resize",i);const a=new ResizeObserver(()=>i());return a.observe(t.current),()=>{window.removeEventListener("resize",i),a&&t.current&&a.unobserve(t.current)}}},[])}const Mu={position:"absolute",width:"100%",height:"100%",top:0,left:0},W_=t=>({userSelectionActive:t.userSelectionActive,lib:t.lib,connectionInProgress:t.connection.inProgress});function Y_({onPaneContextMenu:t,zoomOnScroll:r=!0,zoomOnPinch:i=!0,panOnScroll:a=!1,panOnScrollSpeed:u=.5,panOnScrollMode:f=Oi.Free,zoomOnDoubleClick:d=!0,panOnDrag:g=!0,defaultViewport:v,translateExtent:w,minZoom:S,maxZoom:x,zoomActivationKeyCode:b,preventScrolling:N=!0,children:C,noWheelClassName:A,noPanClassName:T,onViewportChange:$,isControlledViewport:H,paneClickDistance:M,selectionOnDrag:R}){const Y=It(),V=de.useRef(null),{userSelectionActive:U,lib:le,connectionInProgress:he}=gt(W_,Ot),Se=Ta(b),q=de.useRef();q_(V);const ue=de.useCallback(xe=>{$==null||$({x:xe[0],y:xe[1],zoom:xe[2]}),H||Y.setState({transform:xe})},[$,H]);return de.useEffect(()=>{if(V.current){q.current=e_({domNode:V.current,minZoom:S,maxZoom:x,translateExtent:w,viewport:v,onDraggingChange:te=>Y.setState(ae=>ae.paneDragging===te?ae:{paneDragging:te}),onPanZoomStart:(te,ae)=>{const{onViewportChangeStart:L,onMoveStart:F}=Y.getState();F==null||F(te,ae),L==null||L(ae)},onPanZoom:(te,ae)=>{const{onViewportChange:L,onMove:F}=Y.getState();F==null||F(te,ae),L==null||L(ae)},onPanZoomEnd:(te,ae)=>{const{onViewportChangeEnd:L,onMoveEnd:F}=Y.getState();F==null||F(te,ae),L==null||L(ae)}});const{x:xe,y:D,zoom:ce}=q.current.getViewport();return Y.setState({panZoom:q.current,transform:[xe,D,ce],domNode:V.current.closest(".react-flow")}),()=>{var te;(te=q.current)==null||te.destroy()}}},[]),de.useEffect(()=>{var xe;(xe=q.current)==null||xe.update({onPaneContextMenu:t,zoomOnScroll:r,zoomOnPinch:i,panOnScroll:a,panOnScrollSpeed:u,panOnScrollMode:f,zoomOnDoubleClick:d,panOnDrag:g,zoomActivationKeyPressed:Se,preventScrolling:N,noPanClassName:T,userSelectionActive:U,noWheelClassName:A,lib:le,onTransformChange:ue,connectionInProgress:he,selectionOnDrag:R,paneClickDistance:M})},[t,r,i,a,u,f,d,g,Se,N,T,U,A,le,ue,he,R,M]),P.jsx("div",{className:"react-flow__renderer",ref:V,style:Mu,children:C})}const X_=t=>({userSelectionActive:t.userSelectionActive,userSelectionRect:t.userSelectionRect});function Q_(){const{userSelectionActive:t,userSelectionRect:r}=gt(X_,Ot);return t&&r?P.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 ff=(t,r)=>i=>{i.target===r.current&&(t==null||t(i))},G_=t=>({userSelectionActive:t.userSelectionActive,elementsSelectable:t.elementsSelectable,connectionInProgress:t.connection.inProgress,dragging:t.paneDragging});function Z_({isSelecting:t,selectionKeyPressed:r,selectionMode:i=Pa.Full,panOnDrag:a,paneClickDistance:u,selectionOnDrag:f,onSelectionStart:d,onSelectionEnd:g,onPaneClick:v,onPaneContextMenu:w,onPaneScroll:S,onPaneMouseEnter:x,onPaneMouseMove:b,onPaneMouseLeave:N,children:C}){const A=It(),{userSelectionActive:T,elementsSelectable:$,dragging:H,connectionInProgress:M}=gt(G_,Ot),R=$&&(t||T),Y=de.useRef(null),V=de.useRef(),U=de.useRef(new Set),le=de.useRef(new Set),he=de.useRef(!1),Se=L=>{if(he.current||M){he.current=!1;return}v==null||v(L),A.getState().resetSelectedElements(),A.setState({nodesSelectionActive:!1})},q=L=>{if(Array.isArray(a)&&(a!=null&&a.includes(2))){L.preventDefault();return}w==null||w(L)},ue=S?L=>S(L):void 0,xe=L=>{he.current&&(L.stopPropagation(),he.current=!1)},D=L=>{var $e,Ie;const{domNode:F}=A.getState();if(V.current=F==null?void 0:F.getBoundingClientRect(),!V.current)return;const Q=L.target===Y.current;if(!Q&&!!L.target.closest(".nokey")||!t||!(f&&Q||r)||L.button!==0||!L.isPrimary)return;(Ie=($e=L.target)==null?void 0:$e.setPointerCapture)==null||Ie.call($e,L.pointerId),he.current=!1;const{x:be,y:_e}=$r(L.nativeEvent,V.current);A.setState({userSelectionRect:{width:0,height:0,startX:be,startY:_e,x:be,y:_e}}),Q||(L.stopPropagation(),L.preventDefault())},ce=L=>{const{userSelectionRect:F,transform:Q,nodeLookup:O,edgeLookup:B,connectionLookup:be,triggerNodeChanges:_e,triggerEdgeChanges:$e,defaultEdgeOptions:Ie,resetSelectedElements:Re}=A.getState();if(!V.current||!F)return;const{x:we,y:De}=$r(L.nativeEvent,V.current),{startX:ke,startY:Ge}=F;if(!he.current){const lt=r?0:u;if(Math.hypot(we-ke,De-Ge)<=lt)return;Re(),d==null||d(L)}he.current=!0;const Le={startX:ke,startY:Ge,x:we<ke?we:ke,y:De<Ge?De:Ge,width:Math.abs(we-ke),height:Math.abs(De-Ge)},Be=U.current,ut=le.current;U.current=new Set(Hf(O,Le,Q,i===Pa.Partial,!0).map(lt=>lt.id)),le.current=new Set;const at=(Ie==null?void 0:Ie.selectable)??!0;for(const lt of U.current){const kt=be.get(lt);if(kt)for(const{edgeId:Sn}of kt.values()){const rn=B.get(Sn);rn&&(rn.selectable??at)&&le.current.add(Sn)}}if(!vh(Be,U.current)){const lt=ks(O,U.current,!0);_e(lt)}if(!vh(ut,le.current)){const lt=ks(B,le.current);$e(lt)}A.setState({userSelectionRect:Le,userSelectionActive:!0,nodesSelectionActive:!1})},te=L=>{var F,Q;L.button===0&&((Q=(F=L.target)==null?void 0:F.releasePointerCapture)==null||Q.call(F,L.pointerId),!T&&L.target===Y.current&&A.getState().userSelectionRect&&(Se==null||Se(L)),A.setState({userSelectionActive:!1,userSelectionRect:null}),he.current&&(g==null||g(L),A.setState({nodesSelectionActive:U.current.size>0})))},ae=a===!0||Array.isArray(a)&&a.includes(0);return P.jsxs("div",{className:Ut(["react-flow__pane",{draggable:ae,dragging:H,selection:t}]),onClick:R?void 0:ff(Se,Y),onContextMenu:ff(q,Y),onWheel:ff(ue,Y),onPointerEnter:R?void 0:x,onPointerMove:R?ce:b,onPointerUp:R?te:void 0,onPointerDownCapture:R?D:void 0,onClickCapture:R?xe:void 0,onPointerLeave:N,ref:Y,style:Mu,children:[C,P.jsx(Q_,{})]})}function If({id:t,store:r,unselect:i=!1,nodeRef:a}){const{addSelectedNodes:u,unselectNodesAndEdges:f,multiSelectionActive:d,nodeLookup:g,onError:v}=r.getState(),w=g.get(t);if(!w){v==null||v("012",Zr.error012(t));return}r.setState({nodesSelectionActive:!1}),w.selected?(i||w.selected&&d)&&(f({nodes:[w],edges:[]}),requestAnimationFrame(()=>{var S;return(S=a==null?void 0:a.current)==null?void 0:S.blur()})):u([t])}function jg({nodeRef:t,disabled:r=!1,noDragClassName:i,handleSelector:a,nodeId:u,isSelectable:f,nodeClickDistance:d}){const g=It(),[v,w]=de.useState(!1),S=de.useRef();return de.useEffect(()=>{S.current=F1({getStoreItems:()=>g.getState(),onNodeMouseDown:x=>{If({id:x,store:g,nodeRef:t})},onDragStart:()=>{w(!0)},onDragStop:()=>{w(!1)}})},[]),de.useEffect(()=>{if(!(r||!t.current||!S.current))return S.current.update({noDragClassName:i,handleSelector:a,domNode:t.current,isSelectable:f,nodeId:u,nodeClickDistance:d}),()=>{var x;(x=S.current)==null||x.destroy()}},[i,a,r,f,t,u,d]),v}const J_=t=>r=>r.selected&&(r.draggable||t&&typeof r.draggable>"u");function Mg(){const t=It();return de.useCallback(i=>{const{nodeExtent:a,snapToGrid:u,snapGrid:f,nodesDraggable:d,onError:g,updateNodePositions:v,nodeLookup:w,nodeOrigin:S}=t.getState(),x=new Map,b=J_(d),N=u?f[0]:5,C=u?f[1]:5,A=i.direction.x*N*i.factor,T=i.direction.y*C*i.factor;for(const[,$]of w){if(!b($))continue;let H={x:$.internals.positionAbsolute.x+A,y:$.internals.positionAbsolute.y+T};u&&(H=za(H,f));const{position:M,positionAbsolute:R}=Ym({nodeId:$.id,nextPosition:H,nodeLookup:w,nodeExtent:a,nodeOrigin:S,onError:g});$.position=M,$.internals.positionAbsolute=R,x.set($.id,$)}v(x)},[])}const Gf=de.createContext(null),eS=Gf.Provider;Gf.Consumer;const Tg=()=>de.useContext(Gf),tS=t=>({connectOnClick:t.connectOnClick,noPanClassName:t.noPanClassName,rfId:t.rfId}),nS=(t,r,i)=>a=>{const{connectionClickStartHandle:u,connectionMode:f,connection:d}=a,{fromHandle:g,toHandle:v,isValid:w}=d,S=(v==null?void 0:v.nodeId)===t&&(v==null?void 0:v.id)===r&&(v==null?void 0:v.type)===i;return{connectingFrom:(g==null?void 0:g.nodeId)===t&&(g==null?void 0:g.id)===r&&(g==null?void 0:g.type)===i,connectingTo:S,clickConnecting:(u==null?void 0:u.nodeId)===t&&(u==null?void 0:u.id)===r&&(u==null?void 0:u.type)===i,isPossibleEndHandle:f===js.Strict?(g==null?void 0:g.type)!==i:t!==(g==null?void 0:g.nodeId)||r!==(g==null?void 0:g.id),connectionInProcess:!!g,clickConnectionInProcess:!!u,valid:S&&w}};function rS({type:t="source",position:r=Ze.Top,isValidConnection:i,isConnectable:a=!0,isConnectableStart:u=!0,isConnectableEnd:f=!0,id:d,onConnect:g,children:v,className:w,onMouseDown:S,onTouchStart:x,...b},N){var ce,te;const C=d||null,A=t==="target",T=It(),$=Tg(),{connectOnClick:H,noPanClassName:M,rfId:R}=gt(tS,Ot),{connectingFrom:Y,connectingTo:V,clickConnecting:U,isPossibleEndHandle:le,connectionInProcess:he,clickConnectionInProcess:Se,valid:q}=gt(nS($,C,t),Ot);$||(te=(ce=T.getState()).onError)==null||te.call(ce,"010",Zr.error010());const ue=ae=>{const{defaultEdgeOptions:L,onConnect:F,hasDefaultEdges:Q}=T.getState(),O={...L,...ae};if(Q){const{edges:B,setEdges:be}=T.getState();be(sg(O,B))}F==null||F(O),g==null||g(O)},xe=ae=>{if(!$)return;const L=ng(ae.nativeEvent);if(u&&(L&&ae.button===0||!L)){const F=T.getState();Mf.onPointerDown(ae.nativeEvent,{handleDomNode:ae.currentTarget,autoPanOnConnect:F.autoPanOnConnect,connectionMode:F.connectionMode,connectionRadius:F.connectionRadius,domNode:F.domNode,nodeLookup:F.nodeLookup,lib:F.lib,isTarget:A,handleId:C,nodeId:$,flowId:F.rfId,panBy:F.panBy,cancelConnection:F.cancelConnection,onConnectStart:F.onConnectStart,onConnectEnd:(...Q)=>{var O,B;return(B=(O=T.getState()).onConnectEnd)==null?void 0:B.call(O,...Q)},updateConnection:F.updateConnection,onConnect:ue,isValidConnection:i||((...Q)=>{var O,B;return((B=(O=T.getState()).isValidConnection)==null?void 0:B.call(O,...Q))??!0}),getTransform:()=>T.getState().transform,getFromHandle:()=>T.getState().connection.fromHandle,autoPanSpeed:F.autoPanSpeed,dragThreshold:F.connectionDragThreshold})}L?S==null||S(ae):x==null||x(ae)},D=ae=>{const{onClickConnectStart:L,onClickConnectEnd:F,connectionClickStartHandle:Q,connectionMode:O,isValidConnection:B,lib:be,rfId:_e,nodeLookup:$e,connection:Ie}=T.getState();if(!$||!Q&&!u)return;if(!Q){L==null||L(ae.nativeEvent,{nodeId:$,handleId:C,handleType:t}),T.setState({connectionClickStartHandle:{nodeId:$,type:t,id:C}});return}const Re=eg(ae.target),we=i||B,{connection:De,isValid:ke}=Mf.isValid(ae.nativeEvent,{handle:{nodeId:$,id:C,type:t},connectionMode:O,fromNodeId:Q.nodeId,fromHandleId:Q.id||null,fromType:Q.type,isValidConnection:we,flowId:_e,doc:Re,lib:be,nodeLookup:$e});ke&&De&&ue(De);const Ge=structuredClone(Ie);delete Ge.inProgress,Ge.toPosition=Ge.toHandle?Ge.toHandle.position:null,F==null||F(ae,Ge),T.setState({connectionClickStartHandle:null})};return P.jsx("div",{"data-handleid":C,"data-nodeid":$,"data-handlepos":r,"data-id":`${R}-${$}-${C}-${t}`,className:Ut(["react-flow__handle",`react-flow__handle-${r}`,"nodrag",M,w,{source:!A,target:A,connectable:a,connectablestart:u,connectableend:f,clickconnecting:U,connectingfrom:Y,connectingto:V,valid:q,connectionindicator:a&&(!he||le)&&(he||Se?f:u)}]),onMouseDown:xe,onTouchStart:xe,onClick:H?D:void 0,ref:N,...b,children:v})}const $s=de.memo(Cg(rS));function oS({data:t,isConnectable:r,sourcePosition:i=Ze.Bottom}){return P.jsxs(P.Fragment,{children:[t==null?void 0:t.label,P.jsx($s,{type:"source",position:i,isConnectable:r})]})}function iS({data:t,isConnectable:r,targetPosition:i=Ze.Top,sourcePosition:a=Ze.Bottom}){return P.jsxs(P.Fragment,{children:[P.jsx($s,{type:"target",position:i,isConnectable:r}),t==null?void 0:t.label,P.jsx($s,{type:"source",position:a,isConnectable:r})]})}function sS(){return null}function aS({data:t,isConnectable:r,targetPosition:i=Ze.Top}){return P.jsxs(P.Fragment,{children:[P.jsx($s,{type:"target",position:i,isConnectable:r}),t==null?void 0:t.label]})}const gu={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},Yh={input:oS,default:iS,output:aS,group:sS};function lS(t){var r,i,a,u;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??((a=t.style)==null?void 0:a.width),height:t.height??((u=t.style)==null?void 0:u.height)}}const uS=t=>{const{width:r,height:i,x:a,y:u}=Ra(t.nodeLookup,{filter:f=>!!f.selected});return{width:Ar(r)?r:null,height:Ar(i)?i:null,userSelectionActive:t.userSelectionActive,transformString:`translate(${t.transform[0]}px,${t.transform[1]}px) scale(${t.transform[2]}) translate(${a}px,${u}px)`}};function cS({onSelectionContextMenu:t,noPanClassName:r,disableKeyboardA11y:i}){const a=It(),{width:u,height:f,transformString:d,userSelectionActive:g}=gt(uS,Ot),v=Mg(),w=de.useRef(null);de.useEffect(()=>{var N;i||(N=w.current)==null||N.focus({preventScroll:!0})},[i]);const S=!g&&u!==null&&f!==null;if(jg({nodeRef:w,disabled:!S}),!S)return null;const x=t?N=>{const C=a.getState().nodes.filter(A=>A.selected);t(N,C)}:void 0,b=N=>{Object.prototype.hasOwnProperty.call(gu,N.key)&&(N.preventDefault(),v({direction:gu[N.key],factor:N.shiftKey?4:1}))};return P.jsx("div",{className:Ut(["react-flow__nodesselection","react-flow__container",r]),style:{transform:d},children:P.jsx("div",{ref:w,className:"react-flow__nodesselection-rect",onContextMenu:x,tabIndex:i?void 0:-1,onKeyDown:i?void 0:b,style:{width:u,height:f}})})}const Xh=typeof window<"u"?window:void 0,fS=t=>({nodesSelectionActive:t.nodesSelectionActive,userSelectionActive:t.userSelectionActive});function Ig({children:t,onPaneClick:r,onPaneMouseEnter:i,onPaneMouseMove:a,onPaneMouseLeave:u,onPaneContextMenu:f,onPaneScroll:d,paneClickDistance:g,deleteKeyCode:v,selectionKeyCode:w,selectionOnDrag:S,selectionMode:x,onSelectionStart:b,onSelectionEnd:N,multiSelectionKeyCode:C,panActivationKeyCode:A,zoomActivationKeyCode:T,elementsSelectable:$,zoomOnScroll:H,zoomOnPinch:M,panOnScroll:R,panOnScrollSpeed:Y,panOnScrollMode:V,zoomOnDoubleClick:U,panOnDrag:le,defaultViewport:he,translateExtent:Se,minZoom:q,maxZoom:ue,preventScrolling:xe,onSelectionContextMenu:D,noWheelClassName:ce,noPanClassName:te,disableKeyboardA11y:ae,onViewportChange:L,isControlledViewport:F}){const{nodesSelectionActive:Q,userSelectionActive:O}=gt(fS,Ot),B=Ta(w,{target:Xh}),be=Ta(A,{target:Xh}),_e=be||le,$e=be||R,Ie=S&&_e!==!0,Re=B||O||Ie;return U_({deleteKeyCode:v,multiSelectionKeyCode:C}),P.jsx(Y_,{onPaneContextMenu:f,elementsSelectable:$,zoomOnScroll:H,zoomOnPinch:M,panOnScroll:$e,panOnScrollSpeed:Y,panOnScrollMode:V,zoomOnDoubleClick:U,panOnDrag:!B&&_e,defaultViewport:he,translateExtent:Se,minZoom:q,maxZoom:ue,zoomActivationKeyCode:T,preventScrolling:xe,noWheelClassName:ce,noPanClassName:te,onViewportChange:L,isControlledViewport:F,paneClickDistance:g,selectionOnDrag:Ie,children:P.jsxs(Z_,{onSelectionStart:b,onSelectionEnd:N,onPaneClick:r,onPaneMouseEnter:i,onPaneMouseMove:a,onPaneMouseLeave:u,onPaneContextMenu:f,onPaneScroll:d,panOnDrag:_e,isSelecting:!!Re,selectionMode:x,selectionKeyPressed:B,paneClickDistance:g,selectionOnDrag:Ie,children:[t,Q&&P.jsx(cS,{onSelectionContextMenu:D,noPanClassName:te,disableKeyboardA11y:ae})]})})}Ig.displayName="FlowRenderer";const dS=de.memo(Ig),pS=t=>r=>t?Hf(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 hS(t){return gt(de.useCallback(pS(t),[t]),Ot)}const mS=t=>t.updateNodeInternals;function gS(){const t=gt(mS),[r]=de.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(i=>{const a=new Map;i.forEach(u=>{const f=u.target.getAttribute("data-id");a.set(f,{id:f,nodeElement:u.target,force:!0})}),t(a)}));return de.useEffect(()=>()=>{r==null||r.disconnect()},[r]),r}function yS({node:t,nodeType:r,hasDimensions:i,resizeObserver:a}){const u=It(),f=de.useRef(null),d=de.useRef(null),g=de.useRef(t.sourcePosition),v=de.useRef(t.targetPosition),w=de.useRef(r),S=i&&!!t.internals.handleBounds;return de.useEffect(()=>{f.current&&!t.hidden&&(!S||d.current!==f.current)&&(d.current&&(a==null||a.unobserve(d.current)),a==null||a.observe(f.current),d.current=f.current)},[S,t.hidden]),de.useEffect(()=>()=>{d.current&&(a==null||a.unobserve(d.current),d.current=null)},[]),de.useEffect(()=>{if(f.current){const x=w.current!==r,b=g.current!==t.sourcePosition,N=v.current!==t.targetPosition;(x||b||N)&&(w.current=r,g.current=t.sourcePosition,v.current=t.targetPosition,u.getState().updateNodeInternals(new Map([[t.id,{id:t.id,nodeElement:f.current,force:!0}]])))}},[t.id,r,t.sourcePosition,t.targetPosition]),f}function vS({id:t,onClick:r,onMouseEnter:i,onMouseMove:a,onMouseLeave:u,onContextMenu:f,onDoubleClick:d,nodesDraggable:g,elementsSelectable:v,nodesConnectable:w,nodesFocusable:S,resizeObserver:x,noDragClassName:b,noPanClassName:N,disableKeyboardA11y:C,rfId:A,nodeTypes:T,nodeClickDistance:$,onError:H}){const{node:M,internals:R,isParent:Y}=gt(we=>{const De=we.nodeLookup.get(t),ke=we.parentLookup.has(t);return{node:De,internals:De.internals,isParent:ke}},Ot);let V=M.type||"default",U=(T==null?void 0:T[V])||Yh[V];U===void 0&&(H==null||H("003",Zr.error003(V)),V="default",U=(T==null?void 0:T.default)||Yh.default);const le=!!(M.draggable||g&&typeof M.draggable>"u"),he=!!(M.selectable||v&&typeof M.selectable>"u"),Se=!!(M.connectable||w&&typeof M.connectable>"u"),q=!!(M.focusable||S&&typeof M.focusable>"u"),ue=It(),xe=Zm(M),D=yS({node:M,nodeType:V,hasDimensions:xe,resizeObserver:x}),ce=jg({nodeRef:D,disabled:M.hidden||!le,noDragClassName:b,handleSelector:M.dragHandle,nodeId:t,isSelectable:he,nodeClickDistance:$}),te=Mg();if(M.hidden)return null;const ae=Mo(M),L=lS(M),F=he||le||r||i||a||u,Q=i?we=>i(we,{...R.userNode}):void 0,O=a?we=>a(we,{...R.userNode}):void 0,B=u?we=>u(we,{...R.userNode}):void 0,be=f?we=>f(we,{...R.userNode}):void 0,_e=d?we=>d(we,{...R.userNode}):void 0,$e=we=>{const{selectNodesOnDrag:De,nodeDragThreshold:ke}=ue.getState();he&&(!De||!le||ke>0)&&If({id:t,store:ue,nodeRef:D}),r&&r(we,{...R.userNode})},Ie=we=>{if(!(tg(we.nativeEvent)||C)){if(Vm.includes(we.key)&&he){const De=we.key==="Escape";If({id:t,store:ue,unselect:De,nodeRef:D})}else if(le&&M.selected&&Object.prototype.hasOwnProperty.call(gu,we.key)){we.preventDefault();const{ariaLabelConfig:De}=ue.getState();ue.setState({ariaLiveMessage:De["node.a11yDescription.ariaLiveMessage"]({direction:we.key.replace("Arrow","").toLowerCase(),x:~~R.positionAbsolute.x,y:~~R.positionAbsolute.y})}),te({direction:gu[we.key],factor:we.shiftKey?4:1})}}},Re=()=>{var ut;if(C||!((ut=D.current)!=null&&ut.matches(":focus-visible")))return;const{transform:we,width:De,height:ke,autoPanOnNodeFocus:Ge,setCenter:Le}=ue.getState();if(!Ge)return;Hf(new Map([[t,M]]),{x:0,y:0,width:De,height:ke},we,!0).length>0||Le(M.position.x+ae.width/2,M.position.y+ae.height/2,{zoom:we[2]})};return P.jsx("div",{className:Ut(["react-flow__node",`react-flow__node-${V}`,{[N]:le},M.className,{selected:M.selected,selectable:he,parent:Y,draggable:le,dragging:ce}]),ref:D,style:{zIndex:R.z,transform:`translate(${R.positionAbsolute.x}px,${R.positionAbsolute.y}px)`,pointerEvents:F?"all":"none",visibility:xe?"visible":"hidden",...M.style,...L},"data-id":t,"data-testid":`rf__node-${t}`,onMouseEnter:Q,onMouseMove:O,onMouseLeave:B,onContextMenu:be,onClick:$e,onDoubleClick:_e,onKeyDown:q?Ie:void 0,tabIndex:q?0:void 0,onFocus:q?Re:void 0,role:M.ariaRole??(q?"group":void 0),"aria-roledescription":"node","aria-describedby":C?void 0:`${_g}-${A}`,"aria-label":M.ariaLabel,...M.domAttributes,children:P.jsx(eS,{value:t,children:P.jsx(U,{id:t,data:M.data,type:V,positionAbsoluteX:R.positionAbsolute.x,positionAbsoluteY:R.positionAbsolute.y,selected:M.selected??!1,selectable:he,draggable:le,deletable:M.deletable??!0,isConnectable:Se,sourcePosition:M.sourcePosition,targetPosition:M.targetPosition,dragging:ce,dragHandle:M.dragHandle,zIndex:R.z,parentId:M.parentId,...ae})})})}var xS=de.memo(vS);const wS=t=>({nodesDraggable:t.nodesDraggable,nodesConnectable:t.nodesConnectable,nodesFocusable:t.nodesFocusable,elementsSelectable:t.elementsSelectable,onError:t.onError});function Ag(t){const{nodesDraggable:r,nodesConnectable:i,nodesFocusable:a,elementsSelectable:u,onError:f}=gt(wS,Ot),d=hS(t.onlyRenderVisibleElements),g=gS();return P.jsx("div",{className:"react-flow__nodes",style:Mu,children:d.map(v=>P.jsx(xS,{id:v,nodeTypes:t.nodeTypes,nodeExtent:t.nodeExtent,onClick:t.onNodeClick,onMouseEnter:t.onNodeMouseEnter,onMouseMove:t.onNodeMouseMove,onMouseLeave:t.onNodeMouseLeave,onContextMenu:t.onNodeContextMenu,onDoubleClick:t.onNodeDoubleClick,noDragClassName:t.noDragClassName,noPanClassName:t.noPanClassName,rfId:t.rfId,disableKeyboardA11y:t.disableKeyboardA11y,resizeObserver:g,nodesDraggable:r,nodesConnectable:i,nodesFocusable:a,elementsSelectable:u,nodeClickDistance:t.nodeClickDistance,onError:f},v))})}Ag.displayName="NodeRenderer";const _S=de.memo(Ag);function SS(t){return gt(de.useCallback(i=>{if(!t)return i.edges.map(u=>u.id);const a=[];if(i.width&&i.height)for(const u of i.edges){const f=i.nodeLookup.get(u.source),d=i.nodeLookup.get(u.target);f&&d&&S1({sourceNode:f,targetNode:d,width:i.width,height:i.height,transform:i.transform})&&a.push(u.id)}return a},[t]),Ot)}const bS=({color:t="none",strokeWidth:r=1})=>{const i={strokeWidth:r,...t&&{stroke:t}};return P.jsx("polyline",{className:"arrow",style:i,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},kS=({color:t="none",strokeWidth:r=1})=>{const i={strokeWidth:r,...t&&{stroke:t,fill:t}};return P.jsx("polyline",{className:"arrowclosed",style:i,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},Qh={[pu.Arrow]:bS,[pu.ArrowClosed]:kS};function ES(t){const r=It();return de.useMemo(()=>{var u,f;return Object.prototype.hasOwnProperty.call(Qh,t)?Qh[t]:((f=(u=r.getState()).onError)==null||f.call(u,"009",Zr.error009(t)),null)},[t])}const NS=({id:t,type:r,color:i,width:a=12.5,height:u=12.5,markerUnits:f="strokeWidth",strokeWidth:d,orient:g="auto-start-reverse"})=>{const v=ES(r);return v?P.jsx("marker",{className:"react-flow__arrowhead",id:t,markerWidth:`${a}`,markerHeight:`${u}`,viewBox:"-10 -10 20 20",markerUnits:f,orient:g,refX:"0",refY:"0",children:P.jsx(v,{color:i,strokeWidth:d})}):null},$g=({defaultColor:t,rfId:r})=>{const i=gt(f=>f.edges),a=gt(f=>f.defaultEdgeOptions),u=de.useMemo(()=>j1(i,{id:r,defaultColor:t,defaultMarkerStart:a==null?void 0:a.markerStart,defaultMarkerEnd:a==null?void 0:a.markerEnd}),[i,a,r,t]);return u.length?P.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:P.jsx("defs",{children:u.map(f=>P.jsx(NS,{id:f.id,type:f.type,color:f.color,width:f.width,height:f.height,markerUnits:f.markerUnits,strokeWidth:f.strokeWidth,orient:f.orient},f.id))})}):null};$g.displayName="MarkerDefinitions";var CS=de.memo($g);function Og({x:t,y:r,label:i,labelStyle:a,labelShowBg:u=!0,labelBgStyle:f,labelBgPadding:d=[2,4],labelBgBorderRadius:g=2,children:v,className:w,...S}){const[x,b]=de.useState({x:1,y:0,width:0,height:0}),N=Ut(["react-flow__edge-textwrapper",w]),C=de.useRef(null);return de.useEffect(()=>{if(C.current){const A=C.current.getBBox();b({x:A.x,y:A.y,width:A.width,height:A.height})}},[i]),i?P.jsxs("g",{transform:`translate(${t-x.width/2} ${r-x.height/2})`,className:N,visibility:x.width?"visible":"hidden",...S,children:[u&&P.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:f,rx:g,ry:g}),P.jsx("text",{className:"react-flow__edge-text",y:x.height/2,dy:"0.3em",ref:C,style:a,children:i}),v]}):null}Og.displayName="EdgeText";const PS=de.memo(Og);function Tu({path:t,labelX:r,labelY:i,label:a,labelStyle:u,labelShowBg:f,labelBgStyle:d,labelBgPadding:g,labelBgBorderRadius:v,interactionWidth:w=20,...S}){return P.jsxs(P.Fragment,{children:[P.jsx("path",{...S,d:t,fill:"none",className:Ut(["react-flow__edge-path",S.className])}),w?P.jsx("path",{d:t,fill:"none",strokeOpacity:0,strokeWidth:w,className:"react-flow__edge-interaction"}):null,a&&Ar(r)&&Ar(i)?P.jsx(PS,{x:r,y:i,label:a,labelStyle:u,labelShowBg:f,labelBgStyle:d,labelBgPadding:g,labelBgBorderRadius:v}):null]})}function Gh({pos:t,x1:r,y1:i,x2:a,y2:u}){return t===Ze.Left||t===Ze.Right?[.5*(r+a),i]:[r,.5*(i+u)]}function Rg({sourceX:t,sourceY:r,sourcePosition:i=Ze.Bottom,targetX:a,targetY:u,targetPosition:f=Ze.Top}){const[d,g]=Gh({pos:i,x1:t,y1:r,x2:a,y2:u}),[v,w]=Gh({pos:f,x1:a,y1:u,x2:t,y2:r}),[S,x,b,N]=rg({sourceX:t,sourceY:r,targetX:a,targetY:u,sourceControlX:d,sourceControlY:g,targetControlX:v,targetControlY:w});return[`M${t},${r} C${d},${g} ${v},${w} ${a},${u}`,S,x,b,N]}function zg(t){return de.memo(({id:r,sourceX:i,sourceY:a,targetX:u,targetY:f,sourcePosition:d,targetPosition:g,label:v,labelStyle:w,labelShowBg:S,labelBgStyle:x,labelBgPadding:b,labelBgBorderRadius:N,style:C,markerEnd:A,markerStart:T,interactionWidth:$})=>{const[H,M,R]=Rg({sourceX:i,sourceY:a,sourcePosition:d,targetX:u,targetY:f,targetPosition:g}),Y=t.isInternal?void 0:r;return P.jsx(Tu,{id:Y,path:H,labelX:M,labelY:R,label:v,labelStyle:w,labelShowBg:S,labelBgStyle:x,labelBgPadding:b,labelBgBorderRadius:N,style:C,markerEnd:A,markerStart:T,interactionWidth:$})})}const jS=zg({isInternal:!1}),Dg=zg({isInternal:!0});jS.displayName="SimpleBezierEdge";Dg.displayName="SimpleBezierEdgeInternal";function Lg(t){return de.memo(({id:r,sourceX:i,sourceY:a,targetX:u,targetY:f,label:d,labelStyle:g,labelShowBg:v,labelBgStyle:w,labelBgPadding:S,labelBgBorderRadius:x,style:b,sourcePosition:N=Ze.Bottom,targetPosition:C=Ze.Top,markerEnd:A,markerStart:T,pathOptions:$,interactionWidth:H})=>{const[M,R,Y]=Cf({sourceX:i,sourceY:a,sourcePosition:N,targetX:u,targetY:f,targetPosition:C,borderRadius:$==null?void 0:$.borderRadius,offset:$==null?void 0:$.offset,stepPosition:$==null?void 0:$.stepPosition}),V=t.isInternal?void 0:r;return P.jsx(Tu,{id:V,path:M,labelX:R,labelY:Y,label:d,labelStyle:g,labelShowBg:v,labelBgStyle:w,labelBgPadding:S,labelBgBorderRadius:x,style:b,markerEnd:A,markerStart:T,interactionWidth:H})})}const Fg=Lg({isInternal:!1}),Bg=Lg({isInternal:!0});Fg.displayName="SmoothStepEdge";Bg.displayName="SmoothStepEdgeInternal";function Hg(t){return de.memo(({id:r,...i})=>{var u;const a=t.isInternal?void 0:r;return P.jsx(Fg,{...i,id:a,pathOptions:de.useMemo(()=>{var f;return{borderRadius:0,offset:(f=i.pathOptions)==null?void 0:f.offset}},[(u=i.pathOptions)==null?void 0:u.offset])})})}const MS=Hg({isInternal:!1}),Vg=Hg({isInternal:!0});MS.displayName="StepEdge";Vg.displayName="StepEdgeInternal";function Kg(t){return de.memo(({id:r,sourceX:i,sourceY:a,targetX:u,targetY:f,label:d,labelStyle:g,labelShowBg:v,labelBgStyle:w,labelBgPadding:S,labelBgBorderRadius:x,style:b,markerEnd:N,markerStart:C,interactionWidth:A})=>{const[T,$,H]=ag({sourceX:i,sourceY:a,targetX:u,targetY:f}),M=t.isInternal?void 0:r;return P.jsx(Tu,{id:M,path:T,labelX:$,labelY:H,label:d,labelStyle:g,labelShowBg:v,labelBgStyle:w,labelBgPadding:S,labelBgBorderRadius:x,style:b,markerEnd:N,markerStart:C,interactionWidth:A})})}const TS=Kg({isInternal:!1}),Ug=Kg({isInternal:!0});TS.displayName="StraightEdge";Ug.displayName="StraightEdgeInternal";function qg(t){return de.memo(({id:r,sourceX:i,sourceY:a,targetX:u,targetY:f,sourcePosition:d=Ze.Bottom,targetPosition:g=Ze.Top,label:v,labelStyle:w,labelShowBg:S,labelBgStyle:x,labelBgPadding:b,labelBgBorderRadius:N,style:C,markerEnd:A,markerStart:T,pathOptions:$,interactionWidth:H})=>{const[M,R,Y]=og({sourceX:i,sourceY:a,sourcePosition:d,targetX:u,targetY:f,targetPosition:g,curvature:$==null?void 0:$.curvature}),V=t.isInternal?void 0:r;return P.jsx(Tu,{id:V,path:M,labelX:R,labelY:Y,label:v,labelStyle:w,labelShowBg:S,labelBgStyle:x,labelBgPadding:b,labelBgBorderRadius:N,style:C,markerEnd:A,markerStart:T,interactionWidth:H})})}const IS=qg({isInternal:!1}),Wg=qg({isInternal:!0});IS.displayName="BezierEdge";Wg.displayName="BezierEdgeInternal";const Zh={default:Wg,straight:Ug,step:Vg,smoothstep:Bg,simplebezier:Dg},Jh={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},AS=(t,r,i)=>i===Ze.Left?t-r:i===Ze.Right?t+r:t,$S=(t,r,i)=>i===Ze.Top?t-r:i===Ze.Bottom?t+r:t,em="react-flow__edgeupdater";function tm({position:t,centerX:r,centerY:i,radius:a=10,onMouseDown:u,onMouseEnter:f,onMouseOut:d,type:g}){return P.jsx("circle",{onMouseDown:u,onMouseEnter:f,onMouseOut:d,className:Ut([em,`${em}-${g}`]),cx:AS(r,a,t),cy:$S(i,a,t),r:a,stroke:"transparent",fill:"transparent"})}function OS({isReconnectable:t,reconnectRadius:r,edge:i,sourceX:a,sourceY:u,targetX:f,targetY:d,sourcePosition:g,targetPosition:v,onReconnect:w,onReconnectStart:S,onReconnectEnd:x,setReconnecting:b,setUpdateHover:N}){const C=It(),A=(R,Y)=>{if(R.button!==0)return;const{autoPanOnConnect:V,domNode:U,connectionMode:le,connectionRadius:he,lib:Se,onConnectStart:q,cancelConnection:ue,nodeLookup:xe,rfId:D,panBy:ce,updateConnection:te}=C.getState(),ae=Y.type==="target",L=(O,B)=>{b(!1),x==null||x(O,i,Y.type,B)},F=O=>w==null?void 0:w(i,O),Q=(O,B)=>{b(!0),S==null||S(R,i,Y.type),q==null||q(O,B)};Mf.onPointerDown(R.nativeEvent,{autoPanOnConnect:V,connectionMode:le,connectionRadius:he,domNode:U,handleId:Y.id,nodeId:Y.nodeId,nodeLookup:xe,isTarget:ae,edgeUpdaterType:Y.type,lib:Se,flowId:D,cancelConnection:ue,panBy:ce,isValidConnection:(...O)=>{var B,be;return((be=(B=C.getState()).isValidConnection)==null?void 0:be.call(B,...O))??!0},onConnect:F,onConnectStart:Q,onConnectEnd:(...O)=>{var B,be;return(be=(B=C.getState()).onConnectEnd)==null?void 0:be.call(B,...O)},onReconnectEnd:L,updateConnection:te,getTransform:()=>C.getState().transform,getFromHandle:()=>C.getState().connection.fromHandle,dragThreshold:C.getState().connectionDragThreshold,handleDomNode:R.currentTarget})},T=R=>A(R,{nodeId:i.target,id:i.targetHandle??null,type:"target"}),$=R=>A(R,{nodeId:i.source,id:i.sourceHandle??null,type:"source"}),H=()=>N(!0),M=()=>N(!1);return P.jsxs(P.Fragment,{children:[(t===!0||t==="source")&&P.jsx(tm,{position:g,centerX:a,centerY:u,radius:r,onMouseDown:T,onMouseEnter:H,onMouseOut:M,type:"source"}),(t===!0||t==="target")&&P.jsx(tm,{position:v,centerX:f,centerY:d,radius:r,onMouseDown:$,onMouseEnter:H,onMouseOut:M,type:"target"})]})}function RS({id:t,edgesFocusable:r,edgesReconnectable:i,elementsSelectable:a,onClick:u,onDoubleClick:f,onContextMenu:d,onMouseEnter:g,onMouseMove:v,onMouseLeave:w,reconnectRadius:S,onReconnect:x,onReconnectStart:b,onReconnectEnd:N,rfId:C,edgeTypes:A,noPanClassName:T,onError:$,disableKeyboardA11y:H}){let M=gt(Le=>Le.edgeLookup.get(t));const R=gt(Le=>Le.defaultEdgeOptions);M=R?{...R,...M}:M;let Y=M.type||"default",V=(A==null?void 0:A[Y])||Zh[Y];V===void 0&&($==null||$("011",Zr.error011(Y)),Y="default",V=(A==null?void 0:A.default)||Zh.default);const U=!!(M.focusable||r&&typeof M.focusable>"u"),le=typeof x<"u"&&(M.reconnectable||i&&typeof M.reconnectable>"u"),he=!!(M.selectable||a&&typeof M.selectable>"u"),Se=de.useRef(null),[q,ue]=de.useState(!1),[xe,D]=de.useState(!1),ce=It(),{zIndex:te,sourceX:ae,sourceY:L,targetX:F,targetY:Q,sourcePosition:O,targetPosition:B}=gt(de.useCallback(Le=>{const Be=Le.nodeLookup.get(M.source),ut=Le.nodeLookup.get(M.target);if(!Be||!ut)return{zIndex:M.zIndex,...Jh};const at=P1({id:t,sourceNode:Be,targetNode:ut,sourceHandle:M.sourceHandle||null,targetHandle:M.targetHandle||null,connectionMode:Le.connectionMode,onError:$});return{zIndex:_1({selected:M.selected,zIndex:M.zIndex,sourceNode:Be,targetNode:ut,elevateOnSelect:Le.elevateEdgesOnSelect,zIndexMode:Le.zIndexMode}),...at||Jh}},[M.source,M.target,M.sourceHandle,M.targetHandle,M.selected,M.zIndex]),Ot),be=de.useMemo(()=>M.markerStart?`url('#${Pf(M.markerStart,C)}')`:void 0,[M.markerStart,C]),_e=de.useMemo(()=>M.markerEnd?`url('#${Pf(M.markerEnd,C)}')`:void 0,[M.markerEnd,C]);if(M.hidden||ae===null||L===null||F===null||Q===null)return null;const $e=Le=>{var lt;const{addSelectedEdges:Be,unselectNodesAndEdges:ut,multiSelectionActive:at}=ce.getState();he&&(ce.setState({nodesSelectionActive:!1}),M.selected&&at?(ut({nodes:[],edges:[M]}),(lt=Se.current)==null||lt.blur()):Be([t])),u&&u(Le,M)},Ie=f?Le=>{f(Le,{...M})}:void 0,Re=d?Le=>{d(Le,{...M})}:void 0,we=g?Le=>{g(Le,{...M})}:void 0,De=v?Le=>{v(Le,{...M})}:void 0,ke=w?Le=>{w(Le,{...M})}:void 0,Ge=Le=>{var Be;if(!H&&Vm.includes(Le.key)&&he){const{unselectNodesAndEdges:ut,addSelectedEdges:at}=ce.getState();Le.key==="Escape"?((Be=Se.current)==null||Be.blur(),ut({edges:[M]})):at([t])}};return P.jsx("svg",{style:{zIndex:te},children:P.jsxs("g",{className:Ut(["react-flow__edge",`react-flow__edge-${Y}`,M.className,T,{selected:M.selected,animated:M.animated,inactive:!he&&!u,updating:q,selectable:he}]),onClick:$e,onDoubleClick:Ie,onContextMenu:Re,onMouseEnter:we,onMouseMove:De,onMouseLeave:ke,onKeyDown:U?Ge:void 0,tabIndex:U?0:void 0,role:M.ariaRole??(U?"group":"img"),"aria-roledescription":"edge","data-id":t,"data-testid":`rf__edge-${t}`,"aria-label":M.ariaLabel===null?void 0:M.ariaLabel||`Edge from ${M.source} to ${M.target}`,"aria-describedby":U?`${Sg}-${C}`:void 0,ref:Se,...M.domAttributes,children:[!xe&&P.jsx(V,{id:t,source:M.source,target:M.target,type:M.type,selected:M.selected,animated:M.animated,selectable:he,deletable:M.deletable??!0,label:M.label,labelStyle:M.labelStyle,labelShowBg:M.labelShowBg,labelBgStyle:M.labelBgStyle,labelBgPadding:M.labelBgPadding,labelBgBorderRadius:M.labelBgBorderRadius,sourceX:ae,sourceY:L,targetX:F,targetY:Q,sourcePosition:O,targetPosition:B,data:M.data,style:M.style,sourceHandleId:M.sourceHandle,targetHandleId:M.targetHandle,markerStart:be,markerEnd:_e,pathOptions:"pathOptions"in M?M.pathOptions:void 0,interactionWidth:M.interactionWidth}),le&&P.jsx(OS,{edge:M,isReconnectable:le,reconnectRadius:S,onReconnect:x,onReconnectStart:b,onReconnectEnd:N,sourceX:ae,sourceY:L,targetX:F,targetY:Q,sourcePosition:O,targetPosition:B,setUpdateHover:ue,setReconnecting:D})]})})}var zS=de.memo(RS);const DS=t=>({edgesFocusable:t.edgesFocusable,edgesReconnectable:t.edgesReconnectable,elementsSelectable:t.elementsSelectable,connectionMode:t.connectionMode,onError:t.onError});function Yg({defaultMarkerColor:t,onlyRenderVisibleElements:r,rfId:i,edgeTypes:a,noPanClassName:u,onReconnect:f,onEdgeContextMenu:d,onEdgeMouseEnter:g,onEdgeMouseMove:v,onEdgeMouseLeave:w,onEdgeClick:S,reconnectRadius:x,onEdgeDoubleClick:b,onReconnectStart:N,onReconnectEnd:C,disableKeyboardA11y:A}){const{edgesFocusable:T,edgesReconnectable:$,elementsSelectable:H,onError:M}=gt(DS,Ot),R=SS(r);return P.jsxs("div",{className:"react-flow__edges",children:[P.jsx(CS,{defaultColor:t,rfId:i}),R.map(Y=>P.jsx(zS,{id:Y,edgesFocusable:T,edgesReconnectable:$,elementsSelectable:H,noPanClassName:u,onReconnect:f,onContextMenu:d,onMouseEnter:g,onMouseMove:v,onMouseLeave:w,onClick:S,reconnectRadius:x,onDoubleClick:b,onReconnectStart:N,onReconnectEnd:C,rfId:i,onError:M,edgeTypes:a,disableKeyboardA11y:A},Y))]})}Yg.displayName="EdgeRenderer";const LS=de.memo(Yg),FS=t=>`translate(${t.transform[0]}px,${t.transform[1]}px) scale(${t.transform[2]})`;function BS({children:t}){const r=gt(FS);return P.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:r},children:t})}function HS(t){const r=Qf(),i=de.useRef(!1);de.useEffect(()=>{!i.current&&r.viewportInitialized&&t&&(setTimeout(()=>t(r),1),i.current=!0)},[t,r.viewportInitialized])}const VS=t=>{var r;return(r=t.panZoom)==null?void 0:r.syncViewport};function KS(t){const r=gt(VS),i=It();return de.useEffect(()=>{t&&(r==null||r(t),i.setState({transform:[t.x,t.y,t.zoom]}))},[t,r]),null}function US(t){return t.connection.inProgress?{...t.connection,to:Da(t.connection.to,t.transform)}:{...t.connection}}function qS(t){return US}function WS(t){const r=qS();return gt(r,Ot)}const YS=t=>({nodesConnectable:t.nodesConnectable,isValid:t.connection.isValid,inProgress:t.connection.inProgress,width:t.width,height:t.height});function XS({containerStyle:t,style:r,type:i,component:a}){const{nodesConnectable:u,width:f,height:d,isValid:g,inProgress:v}=gt(YS,Ot);return!(f&&u&&v)?null:P.jsx("svg",{style:t,width:f,height:d,className:"react-flow__connectionline react-flow__container",children:P.jsx("g",{className:Ut(["react-flow__connection",qm(g)]),children:P.jsx(Xg,{style:r,type:i,CustomComponent:a,isValid:g})})})}const Xg=({style:t,type:r=si.Bezier,CustomComponent:i,isValid:a})=>{const{inProgress:u,from:f,fromNode:d,fromHandle:g,fromPosition:v,to:w,toNode:S,toHandle:x,toPosition:b,pointer:N}=WS();if(!u)return;if(i)return P.jsx(i,{connectionLineType:r,connectionLineStyle:t,fromNode:d,fromHandle:g,fromX:f.x,fromY:f.y,toX:w.x,toY:w.y,fromPosition:v,toPosition:b,connectionStatus:qm(a),toNode:S,toHandle:x,pointer:N});let C="";const A={sourceX:f.x,sourceY:f.y,sourcePosition:v,targetX:w.x,targetY:w.y,targetPosition:b};switch(r){case si.Bezier:[C]=og(A);break;case si.SimpleBezier:[C]=Rg(A);break;case si.Step:[C]=Cf({...A,borderRadius:0});break;case si.SmoothStep:[C]=Cf(A);break;default:[C]=ag(A)}return P.jsx("path",{d:C,fill:"none",className:"react-flow__connection-path",style:t})};Xg.displayName="ConnectionLine";const QS={};function nm(t=QS){de.useRef(t),It(),de.useEffect(()=>{},[t])}function GS(){It(),de.useRef(!1),de.useEffect(()=>{},[])}function Qg({nodeTypes:t,edgeTypes:r,onInit:i,onNodeClick:a,onEdgeClick:u,onNodeDoubleClick:f,onEdgeDoubleClick:d,onNodeMouseEnter:g,onNodeMouseMove:v,onNodeMouseLeave:w,onNodeContextMenu:S,onSelectionContextMenu:x,onSelectionStart:b,onSelectionEnd:N,connectionLineType:C,connectionLineStyle:A,connectionLineComponent:T,connectionLineContainerStyle:$,selectionKeyCode:H,selectionOnDrag:M,selectionMode:R,multiSelectionKeyCode:Y,panActivationKeyCode:V,zoomActivationKeyCode:U,deleteKeyCode:le,onlyRenderVisibleElements:he,elementsSelectable:Se,defaultViewport:q,translateExtent:ue,minZoom:xe,maxZoom:D,preventScrolling:ce,defaultMarkerColor:te,zoomOnScroll:ae,zoomOnPinch:L,panOnScroll:F,panOnScrollSpeed:Q,panOnScrollMode:O,zoomOnDoubleClick:B,panOnDrag:be,onPaneClick:_e,onPaneMouseEnter:$e,onPaneMouseMove:Ie,onPaneMouseLeave:Re,onPaneScroll:we,onPaneContextMenu:De,paneClickDistance:ke,nodeClickDistance:Ge,onEdgeContextMenu:Le,onEdgeMouseEnter:Be,onEdgeMouseMove:ut,onEdgeMouseLeave:at,reconnectRadius:lt,onReconnect:kt,onReconnectStart:Sn,onReconnectEnd:rn,noDragClassName:qt,noWheelClassName:Et,noPanClassName:jn,disableKeyboardA11y:on,nodeExtent:gr,rfId:bn,viewport:Nt,onViewportChange:Wt}){return nm(t),nm(r),GS(),HS(i),KS(Nt),P.jsx(dS,{onPaneClick:_e,onPaneMouseEnter:$e,onPaneMouseMove:Ie,onPaneMouseLeave:Re,onPaneContextMenu:De,onPaneScroll:we,paneClickDistance:ke,deleteKeyCode:le,selectionKeyCode:H,selectionOnDrag:M,selectionMode:R,onSelectionStart:b,onSelectionEnd:N,multiSelectionKeyCode:Y,panActivationKeyCode:V,zoomActivationKeyCode:U,elementsSelectable:Se,zoomOnScroll:ae,zoomOnPinch:L,zoomOnDoubleClick:B,panOnScroll:F,panOnScrollSpeed:Q,panOnScrollMode:O,panOnDrag:be,defaultViewport:q,translateExtent:ue,minZoom:xe,maxZoom:D,onSelectionContextMenu:x,preventScrolling:ce,noDragClassName:qt,noWheelClassName:Et,noPanClassName:jn,disableKeyboardA11y:on,onViewportChange:Wt,isControlledViewport:!!Nt,children:P.jsxs(BS,{children:[P.jsx(LS,{edgeTypes:r,onEdgeClick:u,onEdgeDoubleClick:d,onReconnect:kt,onReconnectStart:Sn,onReconnectEnd:rn,onlyRenderVisibleElements:he,onEdgeContextMenu:Le,onEdgeMouseEnter:Be,onEdgeMouseMove:ut,onEdgeMouseLeave:at,reconnectRadius:lt,defaultMarkerColor:te,noPanClassName:jn,disableKeyboardA11y:on,rfId:bn}),P.jsx(XS,{style:A,type:C,component:T,containerStyle:$}),P.jsx("div",{className:"react-flow__edgelabel-renderer"}),P.jsx(_S,{nodeTypes:t,onNodeClick:a,onNodeDoubleClick:f,onNodeMouseEnter:g,onNodeMouseMove:v,onNodeMouseLeave:w,onNodeContextMenu:S,nodeClickDistance:Ge,onlyRenderVisibleElements:he,noPanClassName:jn,noDragClassName:qt,disableKeyboardA11y:on,nodeExtent:gr,rfId:bn}),P.jsx("div",{className:"react-flow__viewport-portal"})]})})}Qg.displayName="GraphView";const ZS=de.memo(Qg),rm=({nodes:t,edges:r,defaultNodes:i,defaultEdges:a,width:u,height:f,fitView:d,fitViewOptions:g,minZoom:v=.5,maxZoom:w=2,nodeOrigin:S,nodeExtent:x,zIndexMode:b="basic"}={})=>{const N=new Map,C=new Map,A=new Map,T=new Map,$=a??r??[],H=i??t??[],M=S??[0,0],R=x??Ca;cg(A,T,$);const{nodesInitialized:Y}=jf(H,N,C,{nodeOrigin:M,nodeExtent:R,zIndexMode:b});let V=[0,0,1];if(d&&u&&f){const U=Ra(N,{filter:q=>!!((q.width||q.initialWidth)&&(q.height||q.initialHeight))}),{x:le,y:he,zoom:Se}=Vf(U,u,f,v,w,(g==null?void 0:g.padding)??.1);V=[le,he,Se]}return{rfId:"1",width:u??0,height:f??0,transform:V,nodes:H,nodesInitialized:Y,nodeLookup:N,parentLookup:C,edges:$,edgeLookup:T,connectionLookup:A,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:i!==void 0,hasDefaultEdges:a!==void 0,panZoom:null,minZoom:v,maxZoom:w,translateExtent:Ca,nodeExtent:R,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:js.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:M,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:g,fitViewResolver:null,connection:{...Um},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:m1,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:Km,zIndexMode:b,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},JS=({nodes:t,edges:r,defaultNodes:i,defaultEdges:a,width:u,height:f,fitView:d,fitViewOptions:g,minZoom:v,maxZoom:w,nodeOrigin:S,nodeExtent:x,zIndexMode:b})=>v_((N,C)=>{async function A(){const{nodeLookup:T,panZoom:$,fitViewOptions:H,fitViewResolver:M,width:R,height:Y,minZoom:V,maxZoom:U}=C();$&&(await p1({nodes:T,width:R,height:Y,panZoom:$,minZoom:V,maxZoom:U},H),M==null||M.resolve(!0),N({fitViewResolver:null}))}return{...rm({nodes:t,edges:r,width:u,height:f,fitView:d,fitViewOptions:g,minZoom:v,maxZoom:w,nodeOrigin:S,nodeExtent:x,defaultNodes:i,defaultEdges:a,zIndexMode:b}),setNodes:T=>{const{nodeLookup:$,parentLookup:H,nodeOrigin:M,elevateNodesOnSelect:R,fitViewQueued:Y,zIndexMode:V,nodesSelectionActive:U}=C(),{nodesInitialized:le,hasSelectedNodes:he}=jf(T,$,H,{nodeOrigin:M,nodeExtent:x,elevateNodesOnSelect:R,checkEquality:!0,zIndexMode:V}),Se=U&&he;Y&&le?(A(),N({nodes:T,nodesInitialized:le,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:Se})):N({nodes:T,nodesInitialized:le,nodesSelectionActive:Se})},setEdges:T=>{const{connectionLookup:$,edgeLookup:H}=C();cg($,H,T),N({edges:T})},setDefaultNodesAndEdges:(T,$)=>{if(T){const{setNodes:H}=C();H(T),N({hasDefaultNodes:!0})}if($){const{setEdges:H}=C();H($),N({hasDefaultEdges:!0})}},updateNodeInternals:T=>{const{triggerNodeChanges:$,nodeLookup:H,parentLookup:M,domNode:R,nodeOrigin:Y,nodeExtent:V,debug:U,fitViewQueued:le,zIndexMode:he}=C(),{changes:Se,updatedInternals:q}=R1(T,H,M,R,Y,V,he);q&&(I1(H,M,{nodeOrigin:Y,nodeExtent:V,zIndexMode:he}),le?(A(),N({fitViewQueued:!1,fitViewOptions:void 0})):N({}),(Se==null?void 0:Se.length)>0&&(U&&console.log("React Flow: trigger node changes",Se),$==null||$(Se)))},updateNodePositions:(T,$=!1)=>{const H=[];let M=[];const{nodeLookup:R,triggerNodeChanges:Y,connection:V,updateConnection:U,onNodesChangeMiddlewareMap:le}=C();for(const[he,Se]of T){const q=R.get(he),ue=!!(q!=null&&q.expandParent&&(q!=null&&q.parentId)&&(Se!=null&&Se.position)),xe={id:he,type:"position",position:ue?{x:Math.max(0,Se.position.x),y:Math.max(0,Se.position.y)}:Se.position,dragging:$};if(q&&V.inProgress&&V.fromNode.id===q.id){const D=Li(q,V.fromHandle,Ze.Left,!0);U({...V,from:D})}ue&&q.parentId&&H.push({id:he,parentId:q.parentId,rect:{...Se.internals.positionAbsolute,width:Se.measured.width??0,height:Se.measured.height??0}}),M.push(xe)}if(H.length>0){const{parentLookup:he,nodeOrigin:Se}=C(),q=Xf(H,R,he,Se);M.push(...q)}for(const he of le.values())M=he(M);Y(M)},triggerNodeChanges:T=>{const{onNodesChange:$,setNodes:H,nodes:M,hasDefaultNodes:R,debug:Y}=C();if(T!=null&&T.length){if(R){const V=Eg(T,M);H(V)}Y&&console.log("React Flow: trigger node changes",T),$==null||$(T)}},triggerEdgeChanges:T=>{const{onEdgesChange:$,setEdges:H,edges:M,hasDefaultEdges:R,debug:Y}=C();if(T!=null&&T.length){if(R){const V=Ng(T,M);H(V)}Y&&console.log("React Flow: trigger edge changes",T),$==null||$(T)}},addSelectedNodes:T=>{const{multiSelectionActive:$,edgeLookup:H,nodeLookup:M,triggerNodeChanges:R,triggerEdgeChanges:Y}=C();if($){const V=T.map(U=>Ii(U,!0));R(V);return}R(ks(M,new Set([...T]),!0)),Y(ks(H))},addSelectedEdges:T=>{const{multiSelectionActive:$,edgeLookup:H,nodeLookup:M,triggerNodeChanges:R,triggerEdgeChanges:Y}=C();if($){const V=T.map(U=>Ii(U,!0));Y(V);return}Y(ks(H,new Set([...T]))),R(ks(M,new Set,!0))},unselectNodesAndEdges:({nodes:T,edges:$}={})=>{const{edges:H,nodes:M,nodeLookup:R,triggerNodeChanges:Y,triggerEdgeChanges:V}=C(),U=T||M,le=$||H,he=[];for(const q of U){if(!q.selected)continue;const ue=R.get(q.id);ue&&(ue.selected=!1),he.push(Ii(q.id,!1))}const Se=[];for(const q of le)q.selected&&Se.push(Ii(q.id,!1));Y(he),V(Se)},setMinZoom:T=>{const{panZoom:$,maxZoom:H}=C();$==null||$.setScaleExtent([T,H]),N({minZoom:T})},setMaxZoom:T=>{const{panZoom:$,minZoom:H}=C();$==null||$.setScaleExtent([H,T]),N({maxZoom:T})},setTranslateExtent:T=>{var $;($=C().panZoom)==null||$.setTranslateExtent(T),N({translateExtent:T})},resetSelectedElements:()=>{const{edges:T,nodes:$,triggerNodeChanges:H,triggerEdgeChanges:M,elementsSelectable:R}=C();if(!R)return;const Y=$.reduce((U,le)=>le.selected?[...U,Ii(le.id,!1)]:U,[]),V=T.reduce((U,le)=>le.selected?[...U,Ii(le.id,!1)]:U,[]);H(Y),M(V)},setNodeExtent:T=>{const{nodes:$,nodeLookup:H,parentLookup:M,nodeOrigin:R,elevateNodesOnSelect:Y,nodeExtent:V,zIndexMode:U}=C();T[0][0]===V[0][0]&&T[0][1]===V[0][1]&&T[1][0]===V[1][0]&&T[1][1]===V[1][1]||(jf($,H,M,{nodeOrigin:R,nodeExtent:T,elevateNodesOnSelect:Y,checkEquality:!1,zIndexMode:U}),N({nodeExtent:T}))},panBy:T=>{const{transform:$,width:H,height:M,panZoom:R,translateExtent:Y}=C();return z1({delta:T,panZoom:R,transform:$,translateExtent:Y,width:H,height:M})},setCenter:async(T,$,H)=>{const{width:M,height:R,maxZoom:Y,panZoom:V}=C();if(!V)return Promise.resolve(!1);const U=typeof(H==null?void 0:H.zoom)<"u"?H.zoom:Y;return await V.setViewport({x:M/2-T*U,y:R/2-$*U,zoom:U},{duration:H==null?void 0:H.duration,ease:H==null?void 0:H.ease,interpolate:H==null?void 0:H.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{N({connection:{...Um}})},updateConnection:T=>{N({connection:T})},reset:()=>N({...rm()})}},Object.is);function eb({initialNodes:t,initialEdges:r,defaultNodes:i,defaultEdges:a,initialWidth:u,initialHeight:f,initialMinZoom:d,initialMaxZoom:g,initialFitViewOptions:v,fitView:w,nodeOrigin:S,nodeExtent:x,zIndexMode:b,children:N}){const[C]=de.useState(()=>JS({nodes:t,edges:r,defaultNodes:i,defaultEdges:a,width:u,height:f,fitView:w,minZoom:d,maxZoom:g,fitViewOptions:v,nodeOrigin:S,nodeExtent:x,zIndexMode:b}));return P.jsx(x_,{value:C,children:P.jsx(B_,{children:N})})}function tb({children:t,nodes:r,edges:i,defaultNodes:a,defaultEdges:u,width:f,height:d,fitView:g,fitViewOptions:v,minZoom:w,maxZoom:S,nodeOrigin:x,nodeExtent:b,zIndexMode:N}){return de.useContext(ju)?P.jsx(P.Fragment,{children:t}):P.jsx(eb,{initialNodes:r,initialEdges:i,defaultNodes:a,defaultEdges:u,initialWidth:f,initialHeight:d,fitView:g,initialFitViewOptions:v,initialMinZoom:w,initialMaxZoom:S,nodeOrigin:x,nodeExtent:b,zIndexMode:N,children:t})}const nb={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function rb({nodes:t,edges:r,defaultNodes:i,defaultEdges:a,className:u,nodeTypes:f,edgeTypes:d,onNodeClick:g,onEdgeClick:v,onInit:w,onMove:S,onMoveStart:x,onMoveEnd:b,onConnect:N,onConnectStart:C,onConnectEnd:A,onClickConnectStart:T,onClickConnectEnd:$,onNodeMouseEnter:H,onNodeMouseMove:M,onNodeMouseLeave:R,onNodeContextMenu:Y,onNodeDoubleClick:V,onNodeDragStart:U,onNodeDrag:le,onNodeDragStop:he,onNodesDelete:Se,onEdgesDelete:q,onDelete:ue,onSelectionChange:xe,onSelectionDragStart:D,onSelectionDrag:ce,onSelectionDragStop:te,onSelectionContextMenu:ae,onSelectionStart:L,onSelectionEnd:F,onBeforeDelete:Q,connectionMode:O,connectionLineType:B=si.Bezier,connectionLineStyle:be,connectionLineComponent:_e,connectionLineContainerStyle:$e,deleteKeyCode:Ie="Backspace",selectionKeyCode:Re="Shift",selectionOnDrag:we=!1,selectionMode:De=Pa.Full,panActivationKeyCode:ke="Space",multiSelectionKeyCode:Ge=Ma()?"Meta":"Control",zoomActivationKeyCode:Le=Ma()?"Meta":"Control",snapToGrid:Be,snapGrid:ut,onlyRenderVisibleElements:at=!1,selectNodesOnDrag:lt,nodesDraggable:kt,autoPanOnNodeFocus:Sn,nodesConnectable:rn,nodesFocusable:qt,nodeOrigin:Et=bg,edgesFocusable:jn,edgesReconnectable:on,elementsSelectable:gr=!0,defaultViewport:bn=I_,minZoom:Nt=.5,maxZoom:Wt=2,translateExtent:Kn=Ca,preventScrolling:sn=!0,nodeExtent:an,defaultMarkerColor:Mn="#b1b1b7",zoomOnScroll:Un=!0,zoomOnPinch:yr=!0,panOnScroll:Rr=!1,panOnScrollSpeed:kn=.5,panOnScrollMode:qe=Oi.Free,zoomOnDoubleClick:qn=!0,panOnDrag:En=!0,onPaneClick:er,onPaneMouseEnter:Fe,onPaneMouseMove:Tn,onPaneMouseLeave:In,onPaneScroll:X,onPaneContextMenu:He,paneClickDistance:Je=1,nodeClickDistance:ht=0,children:pn,onReconnect:Bt,onReconnectStart:Ht,onReconnectEnd:Gt,onEdgeContextMenu:An,onEdgeDoubleClick:pt,onEdgeMouseEnter:Ct,onEdgeMouseMove:tr,onEdgeMouseLeave:$n,reconnectRadius:hn=10,onNodesChange:nr,onEdgesChange:Os,noDragClassName:rr="nodrag",noWheelClassName:zr="nowheel",noPanClassName:Yt="nopan",fitView:Dr,fitViewOptions:ai,connectOnClick:or,attributionPosition:li,proOptions:ir,defaultEdgeOptions:ui,elevateNodesOnSelect:To=!0,elevateEdgesOnSelect:Pt=!1,disableKeyboardA11y:sr=!1,autoPanOnConnect:yt,autoPanOnNodeDrag:Fi,autoPanSpeed:Lr,connectionRadius:Io,isValidConnection:Fr,onError:vr,style:ci,id:ar,nodeDragThreshold:Nn,connectionDragThreshold:ct,viewport:mn,onViewportChange:Bi,width:Ao,height:to,colorMode:no="light",debug:ro,onScroll:Wn,ariaLabelConfig:vt,zIndexMode:Br="basic",...oo},lr){const Hr=ar||"1",io=R_(no),ur=de.useCallback(fi=>{fi.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Wn==null||Wn(fi)},[Wn]);return P.jsx("div",{"data-testid":"rf__wrapper",...oo,onScroll:ur,style:{...ci,...nb},ref:lr,className:Ut(["react-flow",u,io]),id:ar,role:"application",children:P.jsxs(tb,{nodes:t,edges:r,width:Ao,height:to,fitView:Dr,fitViewOptions:ai,minZoom:Nt,maxZoom:Wt,nodeOrigin:Et,nodeExtent:an,zIndexMode:Br,children:[P.jsx(O_,{nodes:t,edges:r,defaultNodes:i,defaultEdges:a,onConnect:N,onConnectStart:C,onConnectEnd:A,onClickConnectStart:T,onClickConnectEnd:$,nodesDraggable:kt,autoPanOnNodeFocus:Sn,nodesConnectable:rn,nodesFocusable:qt,edgesFocusable:jn,edgesReconnectable:on,elementsSelectable:gr,elevateNodesOnSelect:To,elevateEdgesOnSelect:Pt,minZoom:Nt,maxZoom:Wt,nodeExtent:an,onNodesChange:nr,onEdgesChange:Os,snapToGrid:Be,snapGrid:ut,connectionMode:O,translateExtent:Kn,connectOnClick:or,defaultEdgeOptions:ui,fitView:Dr,fitViewOptions:ai,onNodesDelete:Se,onEdgesDelete:q,onDelete:ue,onNodeDragStart:U,onNodeDrag:le,onNodeDragStop:he,onSelectionDrag:ce,onSelectionDragStart:D,onSelectionDragStop:te,onMove:S,onMoveStart:x,onMoveEnd:b,noPanClassName:Yt,nodeOrigin:Et,rfId:Hr,autoPanOnConnect:yt,autoPanOnNodeDrag:Fi,autoPanSpeed:Lr,onError:vr,connectionRadius:Io,isValidConnection:Fr,selectNodesOnDrag:lt,nodeDragThreshold:Nn,connectionDragThreshold:ct,onBeforeDelete:Q,debug:ro,ariaLabelConfig:vt,zIndexMode:Br}),P.jsx(ZS,{onInit:w,onNodeClick:g,onEdgeClick:v,onNodeMouseEnter:H,onNodeMouseMove:M,onNodeMouseLeave:R,onNodeContextMenu:Y,onNodeDoubleClick:V,nodeTypes:f,edgeTypes:d,connectionLineType:B,connectionLineStyle:be,connectionLineComponent:_e,connectionLineContainerStyle:$e,selectionKeyCode:Re,selectionOnDrag:we,selectionMode:De,deleteKeyCode:Ie,multiSelectionKeyCode:Ge,panActivationKeyCode:ke,zoomActivationKeyCode:Le,onlyRenderVisibleElements:at,defaultViewport:bn,translateExtent:Kn,minZoom:Nt,maxZoom:Wt,preventScrolling:sn,zoomOnScroll:Un,zoomOnPinch:yr,zoomOnDoubleClick:qn,panOnScroll:Rr,panOnScrollSpeed:kn,panOnScrollMode:qe,panOnDrag:En,onPaneClick:er,onPaneMouseEnter:Fe,onPaneMouseMove:Tn,onPaneMouseLeave:In,onPaneScroll:X,onPaneContextMenu:He,paneClickDistance:Je,nodeClickDistance:ht,onSelectionContextMenu:ae,onSelectionStart:L,onSelectionEnd:F,onReconnect:Bt,onReconnectStart:Ht,onReconnectEnd:Gt,onEdgeContextMenu:An,onEdgeDoubleClick:pt,onEdgeMouseEnter:Ct,onEdgeMouseMove:tr,onEdgeMouseLeave:$n,reconnectRadius:hn,defaultMarkerColor:Mn,noDragClassName:rr,noWheelClassName:zr,noPanClassName:Yt,rfId:Hr,disableKeyboardA11y:sr,nodeExtent:an,viewport:mn,onViewportChange:Bi}),P.jsx(T_,{onSelectionChange:xe}),pn,P.jsx(N_,{proOptions:ir,position:li}),P.jsx(E_,{rfId:Hr,disableKeyboardA11y:sr})]})})}var ob=Cg(rb);function ib(){const t=It();return de.useCallback(r=>{const{domNode:i,updateNodeInternals:a}=t.getState(),u=Array.isArray(r)?r:[r],f=new Map;u.forEach(d=>{const g=i==null?void 0:i.querySelector(`.react-flow__node[data-id="${d}"]`);g&&f.set(d,{id:d,nodeElement:g,force:!0})}),requestAnimationFrame(()=>a(f,{triggerFitView:!1}))},[])}function sb(t){const[r,i]=de.useState(t),a=de.useCallback(u=>i(f=>Eg(u,f)),[]);return[r,i,a]}function ab(t){const[r,i]=de.useState(t),a=de.useCallback(u=>i(f=>Ng(u,f)),[]);return[r,i,a]}function lb({dimensions:t,lineWidth:r,variant:i,className:a}){return P.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,a])})}function ub({radius:t,className:r}){return P.jsx("circle",{cx:t,cy:t,r:t,className:Ut(["react-flow__background-pattern","dots",r])})}var Po;(function(t){t.Lines="lines",t.Dots="dots",t.Cross="cross"})(Po||(Po={}));const cb={[Po.Dots]:1,[Po.Lines]:1,[Po.Cross]:6},fb=t=>({transform:t.transform,patternId:`pattern-${t.rfId}`});function Gg({id:t,variant:r=Po.Dots,gap:i=20,size:a,lineWidth:u=1,offset:f=0,color:d,bgColor:g,style:v,className:w,patternClassName:S}){const x=de.useRef(null),{transform:b,patternId:N}=gt(fb,Ot),C=a||cb[r],A=r===Po.Dots,T=r===Po.Cross,$=Array.isArray(i)?i:[i,i],H=[$[0]*b[2]||1,$[1]*b[2]||1],M=C*b[2],R=Array.isArray(f)?f:[f,f],Y=T?[M,M]:H,V=[R[0]*b[2]||1+Y[0]/2,R[1]*b[2]||1+Y[1]/2],U=`${N}${t||""}`;return P.jsxs("svg",{className:Ut(["react-flow__background",w]),style:{...v,...Mu,"--xy-background-color-props":g,"--xy-background-pattern-color-props":d},ref:x,"data-testid":"rf__background",children:[P.jsx("pattern",{id:U,x:b[0]%H[0],y:b[1]%H[1],width:H[0],height:H[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${V[0]},-${V[1]})`,children:A?P.jsx(ub,{radius:M/2,className:S}):P.jsx(lb,{dimensions:Y,lineWidth:u,variant:r,className:S})}),P.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${U})`})]})}Gg.displayName="Background";const db=de.memo(Gg);function pb(){return P.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:P.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function hb(){return P.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:P.jsx("path",{d:"M0 0h32v4.2H0z"})})}function mb(){return P.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:P.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 gb(){return P.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:P.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 yb(){return P.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:P.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 Gl({children:t,className:r,...i}){return P.jsx("button",{type:"button",className:Ut(["react-flow__controls-button",r]),...i,children:t})}const vb=t=>({isInteractive:t.nodesDraggable||t.nodesConnectable||t.elementsSelectable,minZoomReached:t.transform[2]<=t.minZoom,maxZoomReached:t.transform[2]>=t.maxZoom,ariaLabelConfig:t.ariaLabelConfig});function Zg({style:t,showZoom:r=!0,showFitView:i=!0,showInteractive:a=!0,fitViewOptions:u,onZoomIn:f,onZoomOut:d,onFitView:g,onInteractiveChange:v,className:w,children:S,position:x="bottom-left",orientation:b="vertical","aria-label":N}){const C=It(),{isInteractive:A,minZoomReached:T,maxZoomReached:$,ariaLabelConfig:H}=gt(vb,Ot),{zoomIn:M,zoomOut:R,fitView:Y}=Qf(),V=()=>{M(),f==null||f()},U=()=>{R(),d==null||d()},le=()=>{Y(u),g==null||g()},he=()=>{C.setState({nodesDraggable:!A,nodesConnectable:!A,elementsSelectable:!A}),v==null||v(!A)},Se=b==="horizontal"?"horizontal":"vertical";return P.jsxs(La,{className:Ut(["react-flow__controls",Se,w]),position:x,style:t,"data-testid":"rf__controls","aria-label":N??H["controls.ariaLabel"],children:[r&&P.jsxs(P.Fragment,{children:[P.jsx(Gl,{onClick:V,className:"react-flow__controls-zoomin",title:H["controls.zoomIn.ariaLabel"],"aria-label":H["controls.zoomIn.ariaLabel"],disabled:$,children:P.jsx(pb,{})}),P.jsx(Gl,{onClick:U,className:"react-flow__controls-zoomout",title:H["controls.zoomOut.ariaLabel"],"aria-label":H["controls.zoomOut.ariaLabel"],disabled:T,children:P.jsx(hb,{})})]}),i&&P.jsx(Gl,{className:"react-flow__controls-fitview",onClick:le,title:H["controls.fitView.ariaLabel"],"aria-label":H["controls.fitView.ariaLabel"],children:P.jsx(mb,{})}),a&&P.jsx(Gl,{className:"react-flow__controls-interactive",onClick:he,title:H["controls.interactive.ariaLabel"],"aria-label":H["controls.interactive.ariaLabel"],children:A?P.jsx(yb,{}):P.jsx(gb,{})}),S]})}Zg.displayName="Controls";const xb=de.memo(Zg);function wb({id:t,x:r,y:i,width:a,height:u,style:f,color:d,strokeColor:g,strokeWidth:v,className:w,borderRadius:S,shapeRendering:x,selected:b,onClick:N}){const{background:C,backgroundColor:A}=f||{},T=d||C||A;return P.jsx("rect",{className:Ut(["react-flow__minimap-node",{selected:b},w]),x:r,y:i,rx:S,ry:S,width:a,height:u,style:{fill:T,stroke:g,strokeWidth:v},shapeRendering:x,onClick:N?$=>N($,t):void 0})}const _b=de.memo(wb),Sb=t=>t.nodes.map(r=>r.id),df=t=>t instanceof Function?t:()=>t;function bb({nodeStrokeColor:t,nodeColor:r,nodeClassName:i="",nodeBorderRadius:a=5,nodeStrokeWidth:u,nodeComponent:f=_b,onClick:d}){const g=gt(Sb,Ot),v=df(r),w=df(t),S=df(i),x=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return P.jsx(P.Fragment,{children:g.map(b=>P.jsx(Eb,{id:b,nodeColorFunc:v,nodeStrokeColorFunc:w,nodeClassNameFunc:S,nodeBorderRadius:a,nodeStrokeWidth:u,NodeComponent:f,onClick:d,shapeRendering:x},b))})}function kb({id:t,nodeColorFunc:r,nodeStrokeColorFunc:i,nodeClassNameFunc:a,nodeBorderRadius:u,nodeStrokeWidth:f,shapeRendering:d,NodeComponent:g,onClick:v}){const{node:w,x:S,y:x,width:b,height:N}=gt(C=>{const A=C.nodeLookup.get(t);if(!A)return{node:void 0,x:0,y:0,width:0,height:0};const T=A.internals.userNode,{x:$,y:H}=A.internals.positionAbsolute,{width:M,height:R}=Mo(T);return{node:T,x:$,y:H,width:M,height:R}},Ot);return!w||w.hidden||!Zm(w)?null:P.jsx(g,{x:S,y:x,width:b,height:N,style:w.style,selected:!!w.selected,className:a(w),color:r(w),borderRadius:u,strokeColor:i(w),strokeWidth:f,shapeRendering:d,onClick:v,id:w.id})}const Eb=de.memo(kb);var Nb=de.memo(bb);const Cb=200,Pb=150,jb=t=>!t.hidden,Mb=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?Gm(Ra(t.nodeLookup,{filter:jb}),r):r,rfId:t.rfId,panZoom:t.panZoom,translateExtent:t.translateExtent,flowWidth:t.width,flowHeight:t.height,ariaLabelConfig:t.ariaLabelConfig}},Tb="react-flow__minimap-desc";function Jg({style:t,className:r,nodeStrokeColor:i,nodeColor:a,nodeClassName:u="",nodeBorderRadius:f=5,nodeStrokeWidth:d,nodeComponent:g,bgColor:v,maskColor:w,maskStrokeColor:S,maskStrokeWidth:x,position:b="bottom-right",onClick:N,onNodeClick:C,pannable:A=!1,zoomable:T=!1,ariaLabel:$,inversePan:H,zoomStep:M=1,offsetScale:R=5}){const Y=It(),V=de.useRef(null),{boundingRect:U,viewBB:le,rfId:he,panZoom:Se,translateExtent:q,flowWidth:ue,flowHeight:xe,ariaLabelConfig:D}=gt(Mb,Ot),ce=(t==null?void 0:t.width)??Cb,te=(t==null?void 0:t.height)??Pb,ae=U.width/ce,L=U.height/te,F=Math.max(ae,L),Q=F*ce,O=F*te,B=R*F,be=U.x-(Q-U.width)/2-B,_e=U.y-(O-U.height)/2-B,$e=Q+B*2,Ie=O+B*2,Re=`${Tb}-${he}`,we=de.useRef(0),De=de.useRef();we.current=F,de.useEffect(()=>{if(V.current&&Se)return De.current=q1({domNode:V.current,panZoom:Se,getTransform:()=>Y.getState().transform,getViewScale:()=>we.current}),()=>{var Be;(Be=De.current)==null||Be.destroy()}},[Se]),de.useEffect(()=>{var Be;(Be=De.current)==null||Be.update({translateExtent:q,width:ue,height:xe,inversePan:H,pannable:A,zoomStep:M,zoomable:T})},[A,T,H,M,q,ue,xe]);const ke=N?Be=>{var lt;const[ut,at]=((lt=De.current)==null?void 0:lt.pointer(Be))||[0,0];N(Be,{x:ut,y:at})}:void 0,Ge=C?de.useCallback((Be,ut)=>{const at=Y.getState().nodeLookup.get(ut).internals.userNode;C(Be,at)},[]):void 0,Le=$??D["minimap.ariaLabel"];return P.jsx(La,{position:b,style:{...t,"--xy-minimap-background-color-props":typeof v=="string"?v:void 0,"--xy-minimap-mask-background-color-props":typeof w=="string"?w:void 0,"--xy-minimap-mask-stroke-color-props":typeof S=="string"?S:void 0,"--xy-minimap-mask-stroke-width-props":typeof x=="number"?x*F:void 0,"--xy-minimap-node-background-color-props":typeof a=="string"?a: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:P.jsxs("svg",{width:ce,height:te,viewBox:`${be} ${_e} ${$e} ${Ie}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":Re,ref:V,onClick:ke,children:[Le&&P.jsx("title",{id:Re,children:Le}),P.jsx(Nb,{onClick:Ge,nodeColor:a,nodeStrokeColor:i,nodeBorderRadius:f,nodeClassName:u,nodeStrokeWidth:d,nodeComponent:g}),P.jsx("path",{className:"react-flow__minimap-mask",d:`M${be-B},${_e-B}h${$e+B*2}v${Ie+B*2}h${-$e-B*2}z
202
+ M${le.x},${le.y}h${le.width}v${le.height}h${-le.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}Jg.displayName="MiniMap";const Ib=de.memo(Jg),Ab=t=>r=>t?`${Math.max(1/r.transform[2],1)}`:void 0,$b={[As.Line]:"right",[As.Handle]:"bottom-right"};function Ob({nodeId:t,position:r,variant:i=As.Handle,className:a,style:u=void 0,children:f,color:d,minWidth:g=10,minHeight:v=10,maxWidth:w=Number.MAX_VALUE,maxHeight:S=Number.MAX_VALUE,keepAspectRatio:x=!1,resizeDirection:b,autoScale:N=!0,shouldResize:C,onResizeStart:A,onResize:T,onResizeEnd:$}){const H=Tg(),M=typeof t=="string"?t:H,R=It(),Y=de.useRef(null),V=i===As.Handle,U=gt(de.useCallback(Ab(V&&N),[V,N]),Ot),le=de.useRef(null),he=r??$b[i];de.useEffect(()=>{if(!(!Y.current||!M))return le.current||(le.current=s_({domNode:Y.current,nodeId:M,getStoreItems:()=>{const{nodeLookup:q,transform:ue,snapGrid:xe,snapToGrid:D,nodeOrigin:ce,domNode:te}=R.getState();return{nodeLookup:q,transform:ue,snapGrid:xe,snapToGrid:D,nodeOrigin:ce,paneDomNode:te}},onChange:(q,ue)=>{const{triggerNodeChanges:xe,nodeLookup:D,parentLookup:ce,nodeOrigin:te}=R.getState(),ae=[],L={x:q.x,y:q.y},F=D.get(M);if(F&&F.expandParent&&F.parentId){const Q=F.origin??te,O=q.width??F.measured.width??0,B=q.height??F.measured.height??0,be={id:F.id,parentId:F.parentId,rect:{width:O,height:B,...Jm({x:q.x??F.position.x,y:q.y??F.position.y},{width:O,height:B},F.parentId,D,Q)}},_e=Xf([be],D,ce,te);ae.push(..._e),L.x=q.x?Math.max(Q[0]*O,q.x):void 0,L.y=q.y?Math.max(Q[1]*B,q.y):void 0}if(L.x!==void 0&&L.y!==void 0){const Q={id:M,type:"position",position:{...L}};ae.push(Q)}if(q.width!==void 0&&q.height!==void 0){const O={id:M,type:"dimensions",resizing:!0,setAttributes:b?b==="horizontal"?"width":"height":!0,dimensions:{width:q.width,height:q.height}};ae.push(O)}for(const Q of ue){const O={...Q,type:"position"};ae.push(O)}xe(ae)},onEnd:({width:q,height:ue})=>{const xe={id:M,type:"dimensions",resizing:!1,dimensions:{width:q,height:ue}};R.getState().triggerNodeChanges([xe])}})),le.current.update({controlPosition:he,boundaries:{minWidth:g,minHeight:v,maxWidth:w,maxHeight:S},keepAspectRatio:x,resizeDirection:b,onResizeStart:A,onResize:T,onResizeEnd:$,shouldResize:C}),()=>{var q;(q=le.current)==null||q.destroy()}},[he,g,v,w,S,x,A,T,$,C]);const Se=he.split("-");return P.jsx("div",{className:Ut(["react-flow__resize-control","nodrag",...Se,i,a]),ref:Y,style:{...u,scale:U,...d&&{[V?"backgroundColor":"borderColor"]:d}},children:f})}de.memo(Ob);function Zf(t,r,i){var f,d;const a=r.toLowerCase(),u=(d=(f=t.paths)==null?void 0:f[i])==null?void 0:d[a];return(u==null?void 0:u.summary)??(u==null?void 0:u.operationId)??`${r.toUpperCase()} ${i}`}function Jf(t,r,i){var g,v,w,S;const a=r.toLowerCase(),u=(v=(g=t.paths)==null?void 0:g[i])==null?void 0:v[a];if(!(u!=null&&u.requestBody))return"— sin body";const d=(S=(w=u.requestBody.content)==null?void 0:w["application/json"])==null?void 0:S.schema;return d&&"$ref"in d?`body: ${d.$ref}`:"body: JSON"}function ed(t,r,i){var g,v,w,S,x,b;const a=r.toLowerCase(),u=(v=(g=t.paths)==null?void 0:g[i])==null?void 0:v[a],f=((w=u==null?void 0:u.responses)==null?void 0:w["200"])??((S=u==null?void 0:u.responses)==null?void 0:S["201"]);if(!f)return"—";const d=typeof f=="object"&&f&&"content"in f?(b=(x=f.content)==null?void 0:x["application/json"])==null?void 0:b.schema:void 0;return d&&"$ref"in d?String(d.$ref):"JSON"}const ou=()=>({sourceJsonPath:"$",variableName:"v",useInTarget:"vars_only",targetKey:""});function pf(t,r){return`${t.toLowerCase()} ${r}`}function Rb(t){const r=t.indexOf(" ");return r===-1?{method:"get",path:"/"}:{method:t.slice(0,r),path:t.slice(r+1)}}const ey=de.createContext(null);function zb(t){const{id:r,selected:i}=t,a=t.data,u=de.useContext(ey),f=ib();return de.useEffect(()=>{f(r)},[a.path,a.method,r,f]),P.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:[P.jsx($s,{type:"target",position:Ze.Left,id:"in",className:"!h-3 !w-3 !border-2 !border-surface-900 !bg-teal-500"}),P.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[P.jsx("span",{className:"text-[10px] uppercase font-bold text-accent tracking-wide",children:a.method}),P.jsx("span",{className:"text-[10px] text-slate-500 truncate",title:a.summary,children:a.summary})]}),u?P.jsxs("label",{className:"block text-[10px] text-slate-500 mb-1",children:["Endpoint",P.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:pf(a.method,a.path),onChange:d=>{const{method:g,path:v}=Rb(d.target.value);u.updateNodeData(r,{method:g,path:v,summary:Zf(u.doc,g,v),reqHint:Jf(u.doc,g,v),resHint:ed(u.doc,g,v)})},children:u.ops.map(d=>P.jsxs("option",{value:pf(d.method,d.path),children:[d.method.toUpperCase()," ",d.path]},pf(d.method,d.path)))})]}):P.jsx("p",{className:"font-mono text-[11px] text-slate-300 truncate",children:a.path}),P.jsxs("div",{className:"mt-2 grid grid-cols-2 gap-1 text-[9px] text-slate-500 leading-tight",children:[P.jsxs("div",{children:[P.jsx("span",{className:"text-slate-600",children:"req"})," ",a.reqHint]}),P.jsxs("div",{children:[P.jsx("span",{className:"text-slate-600",children:"res"})," ",a.resHint]})]}),P.jsx($s,{type:"source",position:Ze.Right,id:"out",className:"!h-3 !w-3 !border-2 !border-surface-900 !bg-amber-500"})]})}const Db={apiOp:zb};function Lb(t,r){const i=r.nodes.map(u=>({id:u.id,type:"apiOp",position:{x:u.x,y:u.y},data:{method:u.method.toLowerCase(),path:u.path,summary:Zf(t,u.method,u.path),reqHint:Jf(t,u.method,u.path),resHint:ed(t,u.method,u.path)}})),a=r.edges.map(u=>({id:u.id,source:u.source,target:u.target,sourceHandle:"out",targetHandle:"in",data:{mapping:{...u.mapping}},label:u.mapping.variableName,style:{stroke:"rgb(148 163 184 / 0.9)",strokeWidth:2}}));return{nodes:i,edges:a}}function Fb(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 a;return{id:i.id,source:i.source,target:i.target,mapping:((a=i.data)==null?void 0:a.mapping)??ou()}})}}const Bb=[{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 Hb({doc:t,ops:r,graph:i,onGraphChange:a}){var M,R,Y,V,U,le,he,Se;const u=de.useMemo(()=>Lb(t,i),[t,i]),[f,d,g]=sb(u.nodes),[v,w,S]=ab(u.edges),[x,b]=de.useState(null);de.useEffect(()=>{a(Fb(f,v))},[f,v,a]);const N=de.useCallback((q,ue)=>{d(xe=>xe.map(D=>D.id===q?{...D,data:{...D.data,...ue}}:D))},[d]),C=de.useMemo(()=>({doc:t,ops:r,updateNodeData:N}),[t,r,N]),A=de.useCallback(q=>{q.sourceHandle!=="out"||q.targetHandle!=="in"||w(ue=>sg({...q,id:`e-${q.source}-${q.target}-${crypto.randomUUID().slice(0,8)}`,sourceHandle:"out",targetHandle:"in",data:{mapping:ou()},label:ou().variableName,style:{stroke:"rgb(148 163 184 / 0.9)",strokeWidth:2}},ue))},[w]),T=v.find(q=>q.id===x),$=q=>{x&&w(ue=>ue.map(xe=>{var ce;if(xe.id!==x)return xe;const D={...((ce=xe.data)==null?void 0:ce.mapping)??ou(),...q};return{...xe,data:{mapping:D},label:D.variableName}}))},H=()=>{const q=f.reduce((ae,L)=>L.position.x>ae?L.position.x:ae,0),ue=r[0];if(!ue)return;const xe=crypto.randomUUID(),D=q>0?q+40:80,te={id:xe,type:"apiOp",position:{x:D,y:120},data:{method:ue.method.toLowerCase(),path:ue.path,summary:Zf(t,ue.method,ue.path),reqHint:Jf(t,ue.method,ue.path),resHint:ed(t,ue.method,ue.path)}};d(ae=>[...ae,te])};return P.jsx(ey.Provider,{value:C,children:P.jsxs("div",{className:"space-y-3",children:[P.jsx("div",{className:"h-[min(520px,70vh)] w-full rounded-xl border border-surface-700 bg-surface-950",children:P.jsxs(ob,{nodes:f,edges:v,onNodesChange:g,onEdgesChange:S,onConnect:A,nodeTypes:Db,onEdgeClick:(q,ue)=>b(ue.id),onPaneClick:()=>b(null),fitView:!0,minZoom:.4,maxZoom:1.5,proOptions:{hideAttribution:!0},isValidConnection:q=>q.sourceHandle==="out"&&q.targetHandle==="in",children:[P.jsx(db,{variant:Po.Dots,gap:16,size:1,color:"rgb(51 65 85 / 0.5)"}),P.jsx(xb,{className:"!bg-surface-900 !border-surface-600 !shadow-lg"}),P.jsx(Ib,{className:"!bg-surface-900/95 !border-surface-600",nodeColor:()=>"rgb(45 212 191 / 0.5)"}),P.jsx(La,{position:"top-left",children:P.jsx("button",{type:"button",onClick:H,className:"text-xs px-3 py-2 rounded-lg bg-accent/90 text-surface-950 font-medium shadow",children:"+ Nodo (endpoint)"})})]})}),P.jsxs("div",{className:"rounded-xl border border-surface-700 bg-surface-900/50 p-4 space-y-3",children:[P.jsx("h4",{className:"text-xs font-semibold text-slate-300",children:"Cable seleccionado (respuesta → request)"}),T?P.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3 text-xs",children:[P.jsxs("label",{className:"text-slate-500",children:["JSON path en la respuesta",P.jsx("input",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-2 py-1.5 font-mono",value:((M=T.data)==null?void 0:M.mapping.sourceJsonPath)??"$",onChange:q=>$({sourceJsonPath:q.target.value}),placeholder:"$.access_token"})]}),P.jsxs("label",{className:"text-slate-500",children:["Nombre de variable",P.jsx("input",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-2 py-1.5",value:((R=T.data)==null?void 0:R.mapping.variableName)??"",onChange:q=>$({variableName:q.target.value}),placeholder:"token"})]}),P.jsxs("label",{className:"text-slate-500 sm:col-span-2",children:["Cómo se usa en el request del nodo destino",P.jsx("select",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-2 py-1.5",value:((Y=T.data)==null?void 0:Y.mapping.useInTarget)??"vars_only",onChange:q=>$({useInTarget:q.target.value}),children:Bb.map(q=>P.jsx("option",{value:q.value,children:q.label},q.value))})]}),(((V=T.data)==null?void 0:V.mapping.useInTarget)==="path_param"||((U=T.data)==null?void 0:U.mapping.useInTarget)==="header"||((le=T.data)==null?void 0:le.mapping.useInTarget)==="query")&&P.jsxs("label",{className:"text-slate-500 sm:col-span-2",children:["Clave (nombre del param / header / query)",P.jsx("input",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-2 py-1.5 font-mono",value:((he=T.data)==null?void 0:he.mapping.targetKey)??"",onChange:q=>$({targetKey:q.target.value}),placeholder:"id / Authorization / q"})]}),P.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"," ",P.jsx("code",{className:"text-accent",children:"{clave}"}),", en un header, o en query. Con «solo variable», usa"," ",P.jsx("code",{className:"text-accent",children:"{"+(((Se=T.data)==null?void 0:Se.mapping.variableName)||"var")+"}"})," ","en la ruta del endpoint destino."]})]}):P.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 ty(t,r){const i=new Map(t.map(v=>[v.id,v])),a=new Set(t.map(v=>v.id)),u=new Map,f=new Map;for(const v of a)u.set(v,0),f.set(v,[]);for(const v of r)!a.has(v.source)||!a.has(v.target)||(u.set(v.target,(u.get(v.target)??0)+1),f.get(v.source).push(v.target));const d=[];for(const[v,w]of u)w===0&&d.push(v);d.sort((v,w)=>i.get(v).x-i.get(w).x||i.get(v).y-i.get(w).y);const g=[];for(;d.length;){const v=d.shift();g.push(v);for(const w of f.get(v)??[]){const S=(u.get(w)??0)-1;u.set(w,S),S===0&&(d.push(w),d.sort((x,b)=>i.get(x).x-i.get(b).x||i.get(x).y-i.get(b).y))}}if(g.length<t.length){const v=t.filter(w=>!g.includes(w.id)).sort((w,S)=>w.x-S.x||w.y-S.y);return[...g.map(w=>i.get(w)),...v]}return g.map(v=>i.get(v))}async function om(t,r,i){var v;const{nodes:a,edges:u}=t;if(a.length===0)return"Sin nodos en el flujo.";const f=ty(a,u),d={};let g="";for(let w=0;w<f.length;w++){const S=f[w];let x=S.path;const b={...i()},N=u.filter(Y=>Y.target===S.id);for(const Y of N){const{mapping:V}=Y,U=d[V.variableName];if(U!==void 0)switch(V.useInTarget){case"path_param":V.targetKey&&(x=x.split(`{${V.targetKey}}`).join(U));break;case"header":if(V.targetKey){const le=V.targetKey;b[le]=le.toLowerCase()==="authorization"&&!U.startsWith("Bearer ")?`Bearer ${U}`:U}break;case"query":{const le=x.includes("?")?"&":"?";x=`${x}${le}${encodeURIComponent(V.targetKey)}=${encodeURIComponent(U)}`;break}case"vars_only":default:x=x.split(`{${V.variableName}}`).join(U);break}}for(const[Y,V]of Object.entries(d))x=x.split(`{${Y}}`).join(V);const C=`${r.replace(/\/$/,"")}${x}`,A={method:S.method.toUpperCase(),headers:b},T=S.method.toLowerCase();T!=="get"&&T!=="head"&&(A.body="{}");const $=await fetch(C,A);let H={};const M=await $.text();try{H=M?JSON.parse(M):{}}catch{H={_raw:M}}g+=`▸ ${S.method.toUpperCase()} ${S.path} → ${$.status}
203
+ ${JSON.stringify(H,null,2)}
204
+
205
+ `;const R=u.filter(Y=>Y.source===S.id);for(const Y of R){const V=((v=Y.mapping.sourceJsonPath)==null?void 0:v.trim())||"$",U=Af(H,V);U!=null&&(d[Y.mapping.variableName]=typeof U=="object"?JSON.stringify(U):String(U))}}return g+=`
206
+ Variables finales: ${JSON.stringify(d,null,2)}`,g}function Vb(t){const r=ty(t.nodes,t.edges);return r.map((i,a)=>{const u=r[a+1];if(!u)return{method:i.method,path:i.path};const f=t.edges.find(d=>d.source===i.id&&d.target===u.id);return f?{method:i.method,path:i.path,extract:{varName:f.mapping.variableName,jsonPath:f.mapping.sourceJsonPath||"$"}}:{method:i.method,path:i.path}})}function Kb(t){var a;const r=t.map((u,f)=>({id:`n-${f}`,method:u.method,path:u.path,x:40+f*300,y:120})),i=[];for(let u=0;u<t.length-1;u++){const f=(a=t[u])==null?void 0:a.extract;f!=null&&f.jsonPath&&i.push({id:`e-${u}`,source:`n-${u}`,target:`n-${u+1}`,mapping:{sourceJsonPath:f.jsonPath,variableName:f.varName,useInTarget:"vars_only",targetKey:""}})}return{nodes:r,edges:i}}const ny=[{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 im(t){return ny.some(r=>r.value===t)}const hf=[{id:"typescript",label:"TypeScript"},{id:"javascript",label:"JavaScript"},{id:"python",label:"Python"},{id:"php",label:"PHP"}];function mf(t,r){return`${t.toLowerCase()} ${r}`}function Ub(t){const r=t.indexOf(" ");return r===-1?{method:"get",path:"/"}:{method:t.slice(0,r),path:t.slice(r+1)}}async function sm(t){await navigator.clipboard.writeText(t)}function qb(){const[t,r]=de.useState(null),[i,a]=de.useState(null),[u,f]=de.useState("explore"),[d,g]=de.useState(""),[v,w]=de.useState(null),[S,x]=de.useState(null),[b,N]=de.useState("{}"),[C,A]=de.useState(""),[T,$]=de.useState("typescript"),[H,M]=de.useState(""),[R,Y]=de.useState(""),[V,U]=de.useState("X-Api-Key"),[le,he]=de.useState({nodes:[],edges:[]}),[Se,q]=de.useState(0),[ue,xe]=de.useState("Mi flujo"),[D,ce]=de.useState([]),[te,ae]=de.useState(""),[L,F]=de.useState({name:"Suite 1",cases:[]}),[Q,O]=de.useState([]),[B,be]=de.useState(""),[_e,$e]=de.useState(""),[Ie,Re]=de.useState(null),[we,De]=de.useState(null),ke="/docs/openapi.json",Ge=de.useCallback(async()=>{const[X,He]=await Promise.all([St.flows.toArray(),St.testSuites.toArray()]);ce(X.sort((Je,ht)=>(Je.name??"").localeCompare(ht.name??""))),O(He.sort((Je,ht)=>(Je.name??"").localeCompare(ht.name??"")))},[]);de.useEffect(()=>{fetch(ke).then(X=>{if(!X.ok)throw new Error(`${X.status} ${X.statusText}`);return X.json()}).then(X=>{r(X),g(_s(X)),a(null)}).catch(X=>a(X.message))},[ke]),de.useEffect(()=>{Ge(),St.kv.get("bearer").then(X=>X&&M(X.value)),St.kv.get("apiKey").then(X=>X&&Y(X.value))},[Ge]);const Le=de.useMemo(()=>t?_0(t):[],[t]),Be=de.useMemo(()=>t?Jr(t):[],[t]),ut=de.useMemo(()=>v?Be.filter(X=>(X.tags??["default"]).includes(v)):Be,[Be,v]);de.useEffect(()=>{if(Be.length&&!_e){const X=Be[0];$e(mf(X.method,X.path))}},[Be,_e]),de.useEffect(()=>{if(Be.length===0||le.nodes.length>0||u!=="flows"||Ie!=null)return;const X=Be[0];he({nodes:[{id:crypto.randomUUID(),method:X.method.toLowerCase(),path:X.path,x:80,y:120}],edges:[]}),q(He=>He+1)},[Be,le.nodes.length,u,Ie]);const at=de.useCallback(()=>{const X={"Content-Type":"application/json"};return H.trim()&&(X.Authorization=`Bearer ${H.trim()}`),R.trim()&&(X[V]=R.trim()),X},[H,R,V]),lt=de.useMemo(()=>{if(!t||!S)return null;const X={};for(const{id:He}of hf)X[He]=v0(t,He,S.method,S.path);return X},[t,S]),kt=de.useMemo(()=>t?w0(t,T,v):"",[t,T,v]),Sn=async()=>{if(!t||!S)return;const X=`${_s(t,d)}${S.path}`,He={method:S.method.toUpperCase(),headers:at()},Je=S.method.toLowerCase();Je!=="get"&&Je!=="head"&&(He.body=b.trim()?b:"{}");const ht=await fetch(X,He),pn=await ht.text();A(`${ht.status} ${ht.statusText}
207
+
208
+ ${pn}`)},rn=async X=>{var pn;if(!t)return"";const He={};let Je="";const ht=_s(t,d);for(let Bt=0;Bt<X.length;Bt++){const Ht=X[Bt];let Gt=Ht.path;for(const[hn,nr]of Object.entries(He))Gt=Gt.replace(`{${hn}}`,nr);const An=`${ht}${Gt}`,pt={method:Ht.method.toUpperCase(),headers:at()},Ct=Ht.method.toLowerCase();Ct!=="get"&&Ct!=="head"&&(pt.body="{}");const tr=await fetch(An,pt),$n=await tr.json().catch(()=>({}));if(Je+=`Paso ${Bt+1}: ${tr.status}
209
+ ${JSON.stringify($n,null,2)}
210
+
211
+ `,(pn=Ht.extract)!=null&&pn.jsonPath){const hn=Af($n,Ht.extract.jsonPath);hn!==void 0&&(He[Ht.extract.varName]=String(hn))}}return Je},qt=async()=>{if(!t)return;const X=_s(t,d);if(le.nodes.length===0){ae("Añade al menos un nodo al flujo.");return}const He=await om(le,X,at);ae(He)},Et=async X=>{if(!t)return;const He=_s(t,d),Je=X.graph&&X.graph.nodes.length>0?await om(X.graph,He,at):await rn(X.steps);ae(Je),f("flows")},jn=X=>{xe(X.name),he(X.graph&&X.graph.nodes.length>0?X.graph:Kb(X.steps.length?X.steps:[{method:"get",path:"/"}])),q(He=>He+1),Re(X.id??null),f("flows")},on=()=>{Re(null),xe("Nuevo flujo"),Be[0]?he({nodes:[{id:crypto.randomUUID(),method:Be[0].method.toLowerCase(),path:Be[0].path,x:80,y:120}],edges:[]}):he({nodes:[],edges:[]}),q(X=>X+1)},gr=de.useCallback(X=>{he(X)},[]),bn=async()=>{const X=Vb(le);if(Ie!=null)await St.flows.update(Ie,{name:ue,steps:X,graph:le});else{const He=await St.flows.add({name:ue,steps:X,graph:le});Re(He)}await Ge()},Nt=async X=>{X!==void 0&&(X===Ie&&(Re(null),on()),await St.flows.delete(X),await Ge())},Wt=()=>{if(!_e)return;const{method:X,path:He}=Ub(_e),Je={id:crypto.randomUUID(),method:X,path:He,expectStatus:200,contains:void 0,jsonPath:void 0,expectJsonValue:void 0};F(ht=>({...ht,cases:[...ht.cases,Je]}))},Kn=X=>{F(He=>({...He,cases:He.cases.filter(Je=>Je.id!==X)}))},sn=(X,He)=>{F(Je=>({...Je,cases:Je.cases.map(ht=>ht.id===X?{...ht,...He}:ht)}))},an=async X=>{if(!t)return"";const He=_s(t,d);let Je="";for(const ht of X){const pn=`${He}${ht.path}`,Bt=await fetch(pn,{method:ht.method.toUpperCase(),headers:at()}),Ht=await Bt.text(),Gt=j0(ht,Bt.status,Ht),An=`${Gt.pass?"PASS":"FAIL"} ${ht.method.toUpperCase()} ${ht.path}`;Je+=`${An}
212
+ ${Gt.lines.map(pt=>` ${pt}`).join(`
213
+ `)}
214
+
215
+ `}return Je},Mn=async()=>{const X=await an(L.cases);be(X)},Un=async()=>{if(!t||Q.length===0)return;let X="";for(const He of Q)X+=`━━━ ${He.name} (${He.cases.length} casos) ━━━
216
+ `,X+=await an(He.cases);be(X),f("tests")},yr=async X=>{const He=await an(X.cases);be(He),f("tests")},Rr=X=>{F({name:X.name,cases:X.cases.map(He=>({...He,id:He.id&&He.id.length>0?He.id:crypto.randomUUID()}))}),De(X.id??null),f("tests")},kn=()=>{De(null),F({name:"Nueva suite",cases:[]})},qe=async()=>{if(we!=null)await St.testSuites.update(we,{name:L.name,cases:L.cases});else{const X=await St.testSuites.add({name:L.name,cases:L.cases});De(X)}await Ge()},qn=async X=>{X!==void 0&&(X===we&&(De(null),F({name:"Nueva suite",cases:[]})),await St.testSuites.delete(X),await Ge())},En=async()=>{await St.kv.put({key:"bearer",value:H}),await St.kv.put({key:"apiKey",value:R})},er=async()=>{const X=await C0(),He=new Blob([JSON.stringify(X,null,2)],{type:"application/json"}),Je=document.createElement("a");Je.href=URL.createObjectURL(He),Je.download="api-doc-tor-export.json",Je.click()},Fe=async X=>{var pn;const He=(pn=X.target.files)==null?void 0:pn[0];if(!He)return;const Je=await He.text(),ht=JSON.parse(Je);await P0(ht),await Ge()},Tn=()=>{S&&(he(X=>{const He=X.nodes[X.nodes.length-1],Je=He?He.x+280:80,ht=(He==null?void 0:He.y)??120;return{nodes:[...X.nodes,{id:crypto.randomUUID(),method:S.method.toLowerCase(),path:S.path,x:Je,y:ht}],edges:X.edges}}),q(X=>X+1),f("flows"))};if(i)return P.jsx("div",{className:"min-h-screen flex items-center justify-center p-8",children:P.jsxs("div",{className:"max-w-lg rounded-2xl border border-red-500/30 bg-surface-900 p-6 text-red-200",children:[P.jsx("h1",{className:"font-display text-xl font-bold mb-2",children:"No se pudo cargar OpenAPI"}),P.jsx("p",{className:"text-sm opacity-90",children:i}),P.jsxs("p",{className:"text-xs mt-4 text-slate-500",children:["URL intentada: ",ke]})]})});if(!t)return P.jsx("div",{className:"min-h-screen flex items-center justify-center",children:P.jsx("p",{className:"text-slate-400 animate-pulse",children:"Cargando especificación…"})});const In=v===null?"Todos los endpoints (cliente único con todas las operaciones)":`Tag «${v}» (solo operaciones de este grupo)`;return P.jsxs("div",{className:"min-h-screen flex flex-col md:flex-row",children:[P.jsxs("aside",{className:"w-full md:w-64 border-b md:border-b-0 md:border-r border-surface-700 bg-surface-900/80 shrink-0",children:[P.jsxs("div",{className:"p-4 border-b border-surface-700",children:[P.jsx("h1",{className:"font-display text-lg font-bold text-white tracking-tight",children:"api-doc-tor"}),P.jsxs("p",{className:"text-xs text-slate-500 mt-1",children:[t.info.title," · v",t.info.version]})]}),P.jsx("nav",{className:"p-2 flex flex-row md:flex-col gap-1 overflow-x-auto",children:[["explore","Explorar"],["flows",`Flujos (${D.length})`],["tests",`Tests (${Q.length})`],["auth","Auth"]].map(([X,He])=>P.jsx("button",{type:"button",onClick:()=>f(X),className:`text-left px-3 py-2 rounded-lg text-sm transition ${u===X?"bg-accent/20 text-accent":"text-slate-400 hover:bg-surface-800"}`,children:He},X))}),P.jsxs("div",{className:"p-3 border-t border-surface-700 space-y-2",children:[P.jsx("button",{type:"button",onClick:er,className:"w-full text-xs py-2 rounded-lg bg-surface-800 hover:bg-surface-700",children:"Exportar estado"}),P.jsxs("label",{className:"block w-full text-xs py-2 rounded-lg bg-surface-800 hover:bg-surface-700 text-center cursor-pointer",children:["Importar JSON",P.jsx("input",{type:"file",accept:"application/json",className:"hidden",onChange:Fe})]})]})]}),P.jsxs("main",{className:"flex-1 flex flex-col min-h-0",children:[P.jsx("header",{className:"border-b border-surface-700 px-4 py-3 flex flex-wrap gap-3 items-center bg-surface-900/50",children:P.jsxs("label",{className:"text-xs text-slate-500",children:["Base URL",P.jsx("input",{className:"ml-2 bg-surface-800 border border-surface-600 rounded px-2 py-1 text-sm w-64",value:d,onChange:X=>g(X.target.value)})]})}),u==="explore"&&P.jsxs("div",{className:"flex-1 flex flex-col lg:flex-row min-h-0",children:[P.jsxs("div",{className:"lg:w-72 border-b lg:border-b-0 lg:border-r border-surface-700 overflow-auto max-h-64 lg:max-h-none",children:[P.jsxs("div",{className:"p-2",children:[P.jsx("p",{className:"text-xs uppercase tracking-wider text-slate-500 mb-2",children:"Tags"}),P.jsxs("div",{className:"flex flex-wrap gap-1",children:[P.jsx("button",{type:"button",onClick:()=>w(null),className:`text-xs px-2 py-1 rounded ${v===null?"bg-accent/30":"bg-surface-800"}`,children:"Todos"}),Le.map(X=>P.jsx("button",{type:"button",onClick:()=>w(X),className:`text-xs px-2 py-1 rounded ${v===X?"bg-accent/30":"bg-surface-800"}`,children:X},X))]})]}),P.jsx("ul",{className:"text-sm",children:ut.map(X=>P.jsx("li",{children:P.jsxs("button",{type:"button",onClick:()=>x({method:X.method,path:X.path}),className:`w-full text-left px-3 py-2 hover:bg-surface-800 flex gap-2 ${(S==null?void 0:S.method)===X.method&&S.path===X.path?"bg-surface-800 border-l-2 border-accent":""}`,children:[P.jsx("span",{className:"uppercase text-accent text-xs w-12 shrink-0",children:X.method}),P.jsx("span",{className:"truncate text-slate-300",children:X.path})]})},`${X.method}:${X.path}`))})]}),P.jsx("div",{className:"flex-1 p-4 overflow-auto space-y-6",children:S?P.jsxs(P.Fragment,{children:[P.jsxs("div",{children:[P.jsxs("h2",{className:"font-display font-semibold text-white text-lg",children:[S.method.toUpperCase()," ",S.path]}),P.jsxs("p",{className:"text-xs text-slate-500 mt-1",children:["Filtro de exportación de servicio: ",In]})]}),P.jsxs("section",{className:"space-y-2",children:[P.jsx("h3",{className:"text-sm font-medium text-slate-300",children:"Probar"}),P.jsx("textarea",{className:"w-full h-28 bg-surface-900 border border-surface-600 rounded-lg p-3 font-mono text-xs",value:b,onChange:X=>N(X.target.value),placeholder:"Body JSON"}),P.jsx("button",{type:"button",onClick:()=>void Sn(),className:"px-4 py-2 rounded-lg bg-accent text-surface-950 font-medium text-sm",children:"Ejecutar"}),P.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",children:C||"—"})]}),P.jsxs("section",{className:"space-y-3",children:[P.jsx("h3",{className:"text-sm font-medium text-slate-300",children:"Snippets por lenguaje"}),P.jsx("div",{className:"grid gap-3 md:grid-cols-2",children:lt&&hf.map(({id:X,label:He})=>P.jsxs("div",{className:"rounded-xl border border-surface-700 bg-surface-900/60 overflow-hidden",children:[P.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b border-surface-700 bg-surface-800/50",children:[P.jsx("span",{className:"text-xs font-medium text-accent",children:He}),P.jsx("button",{type:"button",className:"text-xs px-2 py-1 rounded bg-surface-700 hover:bg-surface-600",onClick:()=>void sm(lt[X]),children:"Copiar"})]}),P.jsx("pre",{className:"text-[11px] p-3 overflow-auto max-h-56 text-slate-300 font-mono whitespace-pre-wrap",children:lt[X]})]},X))})]}),P.jsxs("section",{className:"space-y-3 rounded-xl border border-surface-700 bg-surface-900/40 p-4",children:[P.jsx("h3",{className:"text-sm font-medium text-slate-300",children:"Cliente / servicio generado"}),P.jsx("p",{className:"text-xs text-slate-500",children:In}),P.jsxs("div",{className:"flex flex-wrap gap-2 items-center",children:[P.jsxs("label",{className:"text-xs text-slate-400",children:["Lenguaje del archivo",P.jsx("select",{className:"ml-2 bg-surface-800 border border-surface-600 rounded px-2 py-1.5 text-sm",value:T,onChange:X=>$(X.target.value),children:hf.map(({id:X,label:He})=>P.jsx("option",{value:X,children:He},X))})]}),P.jsx("button",{type:"button",className:"text-xs px-3 py-1.5 rounded-lg bg-surface-700 hover:bg-surface-600",onClick:()=>void sm(kt),children:"Copiar servicio"})]}),P.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:kt})]}),P.jsx("div",{className:"flex flex-wrap gap-2 pt-2 border-t border-surface-800",children:P.jsx("button",{type:"button",className:"text-xs px-3 py-2 rounded-lg bg-surface-800 hover:bg-surface-700",onClick:Tn,children:"Añadir operación actual a un flujo (ve a Flujos)"})})]}):P.jsx("p",{className:"text-slate-500",children:"Selecciona una operación en la lista."})})]}),u==="flows"&&P.jsxs("div",{className:"p-4 space-y-6 overflow-auto max-w-5xl",children:[P.jsxs("section",{className:"rounded-xl border border-surface-700 bg-surface-900/50 p-4",children:[P.jsx("h3",{className:"text-sm font-semibold text-white mb-3",children:"Flujos guardados"}),D.length===0?P.jsx("p",{className:"text-sm text-slate-500",children:"Aún no hay flujos. Crea uno en el editor y guarda."}):P.jsx("ul",{className:"space-y-2",children:D.map(X=>{var He,Je;return P.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:[P.jsxs("div",{children:[P.jsx("span",{className:"text-sm text-slate-200 font-medium",children:X.name}),P.jsxs("span",{className:"text-xs text-slate-500 ml-2",children:[(((Je=(He=X.graph)==null?void 0:He.nodes)==null?void 0:Je.length)??X.steps.length)||0," nodo(s)"]})]}),P.jsxs("div",{className:"flex flex-wrap gap-2",children:[P.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 Et(X),children:"Play"}),P.jsx("button",{type:"button",className:"text-xs px-2 py-1.5 rounded bg-accent/20 text-accent hover:bg-accent/30",onClick:()=>jn(X),children:"Editar"}),P.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 Nt(X.id),children:"Eliminar"})]})]},X.id!=null?`flow-${X.id}`:`flow-${X.name}`)})})]}),P.jsxs("section",{className:"space-y-4 max-w-6xl",children:[P.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[P.jsx("h3",{className:"text-sm font-semibold text-white",children:"Editor de flujo (nodos y cables)"}),P.jsx("button",{type:"button",className:"text-xs px-3 py-1.5 rounded-lg border border-surface-600 text-slate-300 hover:bg-surface-800",onClick:on,children:"Nuevo flujo"})]}),Ie!=null&&P.jsxs("p",{className:"text-xs text-accent",children:["Editando flujo guardado (#",Ie,")"]}),P.jsxs("p",{className:"text-sm text-slate-400",children:["Cada nodo es un endpoint del spec. Conecta ",P.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 ",P.jsx("code",{className:"text-accent",children:"{variable}"})," en la ruta)."]}),P.jsx("input",{className:"bg-surface-800 border border-surface-600 rounded px-3 py-2 text-sm w-full max-w-md",value:ue,onChange:X=>xe(X.target.value),placeholder:"Nombre del flujo"}),P.jsx(Hb,{doc:t,ops:Be,graph:le,onGraphChange:gr},Se),P.jsxs("div",{className:"flex flex-wrap gap-2",children:[P.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 qt(),children:"Play (grafo)"}),P.jsx("button",{type:"button",className:"px-3 py-2 rounded-lg bg-surface-700 text-sm",onClick:()=>void bn(),children:Ie!=null?"Guardar cambios":"Guardar flujo"})]}),P.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:te||"Resultado de la ejecución aquí."})]})]}),u==="tests"&&P.jsxs("div",{className:"p-4 space-y-6 overflow-auto max-w-5xl",children:[P.jsxs("section",{className:"rounded-xl border border-surface-700 bg-surface-900/50 p-4 space-y-3",children:[P.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[P.jsx("h3",{className:"text-sm font-semibold text-white",children:"Suites guardadas"}),Q.length>0&&P.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 Un(),children:"Ejecutar todas las suites"})]}),Q.length===0?P.jsx("p",{className:"text-sm text-slate-500",children:"Ninguna suite guardada."}):P.jsx("ul",{className:"space-y-2",children:Q.map(X=>P.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:[P.jsxs("div",{children:[P.jsx("span",{className:"text-sm text-slate-200 font-medium",children:X.name}),P.jsxs("span",{className:"text-xs text-slate-500 ml-2",children:[X.cases.length," caso(s)"]})]}),P.jsxs("div",{className:"flex flex-wrap gap-2",children:[P.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 yr(X),children:"Play"}),P.jsx("button",{type:"button",className:"text-xs px-2 py-1.5 rounded bg-accent/20 text-accent",onClick:()=>Rr(X),children:"Editar"}),P.jsx("button",{type:"button",className:"text-xs px-2 py-1 rounded bg-surface-700 hover:bg-red-900/40",onClick:()=>void qn(X.id),children:"Eliminar"})]})]},X.id!=null?`suite-${X.id}`:`suite-${X.name}`))})]}),P.jsxs("section",{className:"space-y-4",children:[P.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[P.jsx("h3",{className:"text-sm font-semibold text-white",children:"Suite en edición"}),P.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:kn,children:"Nueva suite"})]}),we!=null&&P.jsxs("p",{className:"text-xs text-accent",children:["Editando suite guardada (#",we,")"]}),P.jsx("input",{className:"bg-surface-800 border border-surface-600 rounded px-3 py-2 text-sm max-w-md",value:L.name,onChange:X=>F(He=>({...He,name:X.target.value})),placeholder:"Nombre de la suite"}),P.jsxs("div",{className:"flex flex-wrap gap-2 items-end rounded-xl border border-surface-700 bg-surface-900/40 p-4",children:[P.jsxs("label",{className:"text-xs text-slate-400 flex-1 min-w-[200px]",children:["Añadir endpoint del spec",P.jsx("select",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-3 py-2 text-sm font-mono",value:_e,onChange:X=>$e(X.target.value),children:Be.map(X=>P.jsxs("option",{value:mf(X.method,X.path),children:[X.method.toUpperCase()," ",X.path]},mf(X.method,X.path)))})]}),P.jsx("button",{type:"button",className:"px-4 py-2 rounded-lg bg-surface-800 text-sm hover:bg-surface-700",onClick:Wt,children:"Añadir a la suite"})]}),P.jsx("ul",{className:"space-y-4",children:L.cases.map(X=>{const He=im(X.expectStatus)?String(X.expectStatus):"custom";return P.jsxs("li",{className:"rounded-xl border border-surface-700 bg-surface-950/40 p-4 space-y-3 text-sm",children:[P.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-2",children:[P.jsxs("span",{className:"font-mono text-xs text-accent",children:[X.method.toUpperCase()," ",X.path]}),P.jsx("button",{type:"button",className:"text-xs text-red-400 hover:underline shrink-0",onClick:()=>Kn(X.id),children:"Quitar"})]}),P.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-3",children:[P.jsxs("label",{className:"text-xs text-slate-400 block",children:["Código HTTP esperado",P.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-2",children:[P.jsxs("select",{className:"bg-surface-800 border border-surface-600 rounded px-2 py-1.5 text-sm max-w-[200px]",value:He,onChange:Je=>{const ht=Je.target.value;if(ht==="custom"){sn(X.id,{expectStatus:im(X.expectStatus)?1e3:X.expectStatus});return}sn(X.id,{expectStatus:Number(ht)})},children:[ny.map(Je=>P.jsx("option",{value:String(Je.value),children:Je.label},Je.value)),P.jsx("option",{value:"custom",children:"Otro…"})]}),He==="custom"&&P.jsx("input",{type:"number",className:"w-20 bg-surface-800 border border-surface-600 rounded px-2 py-1.5 text-sm",value:X.expectStatus,onChange:Je=>sn(X.id,{expectStatus:Number(Je.target.value)||0})})]})]}),P.jsxs("label",{className:"text-xs text-slate-400 block sm:col-span-2",children:["El body contiene (opcional)",P.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:X.contains??"",onChange:Je=>sn(X.id,{contains:Je.target.value||void 0})})]}),P.jsxs("label",{className:"text-xs text-slate-400 block",children:["JSON path (opcional)",P.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:X.jsonPath??"",onChange:Je=>sn(X.id,{jsonPath:Je.target.value||void 0})})]}),P.jsxs("label",{className:"text-xs text-slate-400 block sm:col-span-2",children:["Valor esperado en JSON path (opcional)",P.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:X.expectJsonValue??"",onChange:Je=>sn(X.id,{expectJsonValue:Je.target.value||void 0})})]})]})]},X.id)})}),P.jsxs("div",{className:"flex flex-wrap gap-2 items-center",children:[P.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 Mn(),children:"Correr todos los casos (suite actual)"}),P.jsx("button",{type:"button",className:"px-4 py-2 rounded-lg bg-surface-700 text-sm",onClick:()=>void qe(),children:we!=null?"Guardar cambios":"Guardar suite"})]}),P.jsx("pre",{className:"text-xs bg-surface-950 border border-surface-700 rounded-lg p-3 whitespace-pre-wrap min-h-[4rem]",children:B||"—"})]})]}),u==="auth"&&P.jsxs("div",{className:"p-4 space-y-4 max-w-lg",children:[P.jsxs("p",{className:"text-sm text-slate-400",children:["Esquemas en el spec: ",S0(t).join(", ")||"ninguno"]}),P.jsxs("label",{className:"block text-sm",children:["Bearer token",P.jsx("input",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-3 py-2",value:H,onChange:X=>M(X.target.value),placeholder:"eyJ..."})]}),P.jsxs("label",{className:"block text-sm",children:["API key header",P.jsx("input",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-3 py-2",value:V,onChange:X=>U(X.target.value)})]}),P.jsxs("label",{className:"block text-sm",children:["API key",P.jsx("input",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-3 py-2",value:R,onChange:X=>Y(X.target.value),type:"password",autoComplete:"off"})]}),P.jsx("button",{type:"button",className:"px-4 py-2 rounded-lg bg-surface-700 text-sm",onClick:()=>void En(),children:"Recordar en este navegador"})]})]})]})}r0.createRoot(document.getElementById("root")).render(P.jsx(am.StrictMode,{children:P.jsx(qb,{})}));