@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 Xy=Object.defineProperty;var Qy=(t,r,i)=>r in t?Xy(t,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[r]=i;var ga=(t,r,i)=>Qy(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 Gy=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function vu(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Xc={exports:{}},ya={},Qc={exports:{}},pt={};/**
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 Bp;function Zy(){if(Bp)return pt;Bp=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"),m=Symbol.for("react.forward_ref"),v=Symbol.for("react.suspense"),w=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),x=Symbol.iterator;function S(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(){}},P=Object.assign,$={};function M(O,B,ke){this.props=O,this.context=B,this.refs=$,this.updater=ke||N}M.prototype.isReactComponent={},M.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")},M.prototype.forceUpdate=function(O){this.updater.enqueueForceUpdate(this,O,"forceUpdate")};function I(){}I.prototype=M.prototype;function H(O,B,ke){this.props=O,this.context=B,this.refs=$,this.updater=ke||N}var j=H.prototype=new I;j.constructor=H,P(j,M.prototype),j.isPureReactComponent=!0;var R=Array.isArray,W=Object.prototype.hasOwnProperty,V={current:null},q={key:!0,ref:!0,__self:!0,__source:!0};function pe(O,B,ke){var Se,Ie={},Re=null,Ae=null;if(B!=null)for(Se in B.ref!==void 0&&(Ae=B.ref),B.key!==void 0&&(Re=""+B.key),B)W.call(B,Se)&&!q.hasOwnProperty(Se)&&(Ie[Se]=B[Se]);var we=arguments.length-2;if(we===1)Ie.children=ke;else if(1<we){for(var Fe=Array(we),be=0;be<we;be++)Fe[be]=arguments[be+2];Ie.children=Fe}if(O&&O.defaultProps)for(Se in we=O.defaultProps,we)Ie[Se]===void 0&&(Ie[Se]=we[Se]);return{$$typeof:t,type:O,key:Re,ref:Ae,props:Ie,_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 _e(O){return typeof O=="object"&&O!==null&&O.$$typeof===t}function Q(O){var B={"=":"=0",":":"=2"};return"$"+O.replace(/[=:]/g,function(ke){return B[ke]})}var le=/\/+/g;function xe(O,B){return typeof O=="object"&&O!==null&&O.key!=null?Q(""+O.key):B.toString(36)}function z(O,B,ke,Se,Ie){var Re=typeof O;(Re==="undefined"||Re==="boolean")&&(O=null);var Ae=!1;if(O===null)Ae=!0;else switch(Re){case"string":case"number":Ae=!0;break;case"object":switch(O.$$typeof){case t:case r:Ae=!0}}if(Ae)return Ae=O,Ie=Ie(Ae),O=Se===""?"."+xe(Ae,0):Se,R(Ie)?(ke="",O!=null&&(ke=O.replace(le,"$&/")+"/"),z(Ie,B,ke,"",function(be){return be})):Ie!=null&&(_e(Ie)&&(Ie=he(Ie,ke+(!Ie.key||Ae&&Ae.key===Ie.key?"":(""+Ie.key).replace(le,"$&/")+"/")+O)),B.push(Ie)),1;if(Ae=0,Se=Se===""?".":Se+":",R(O))for(var we=0;we<O.length;we++){Re=O[we];var Fe=Se+xe(Re,we);Ae+=z(Re,B,ke,Fe,Ie)}else if(Fe=S(O),typeof Fe=="function")for(O=Fe.call(O),we=0;!(Re=O.next()).done;)Re=Re.value,Fe=Se+xe(Re,we++),Ae+=z(Re,B,ke,Fe,Ie);else if(Re==="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 Ae}function ue(O,B,ke){if(O==null)return O;var Se=[],Ie=0;return z(O,Se,"","",function(Re){return B.call(ke,Re,Ie++)}),Se}function te(O){if(O._status===-1){var B=O._result;B=B(),B.then(function(ke){(O._status===0||O._status===-1)&&(O._status=1,O._result=ke)},function(ke){(O._status===0||O._status===-1)&&(O._status=2,O._result=ke)}),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 X(){throw Error("act(...) is not supported in production builds of React.")}return pt.Children={map:ue,forEach:function(O,B,ke){ue(O,function(){B.apply(this,arguments)},ke)},count:function(O){var B=0;return ue(O,function(){B++}),B},toArray:function(O){return ue(O,function(B){return B})||[]},only:function(O){if(!_e(O))throw Error("React.Children.only expected to receive a single React element child.");return O}},pt.Component=M,pt.Fragment=i,pt.Profiler=u,pt.PureComponent=H,pt.StrictMode=a,pt.Suspense=v,pt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=F,pt.act=X,pt.cloneElement=function(O,B,ke){if(O==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+O+".");var Se=P({},O.props),Ie=O.key,Re=O.ref,Ae=O._owner;if(B!=null){if(B.ref!==void 0&&(Re=B.ref,Ae=V.current),B.key!==void 0&&(Ie=""+B.key),O.type&&O.type.defaultProps)var we=O.type.defaultProps;for(Fe in B)W.call(B,Fe)&&!q.hasOwnProperty(Fe)&&(Se[Fe]=B[Fe]===void 0&&we!==void 0?we[Fe]:B[Fe])}var Fe=arguments.length-2;if(Fe===1)Se.children=ke;else if(1<Fe){we=Array(Fe);for(var be=0;be<Fe;be++)we[be]=arguments[be+2];Se.children=we}return{$$typeof:t,type:O.type,key:Ie,ref:Re,props:Se,_owner:Ae}},pt.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},pt.createElement=pe,pt.createFactory=function(O){var B=pe.bind(null,O);return B.type=O,B},pt.createRef=function(){return{current:null}},pt.forwardRef=function(O){return{$$typeof:m,render:O}},pt.isValidElement=_e,pt.lazy=function(O){return{$$typeof:b,_payload:{_status:-1,_result:O},_init:te}},pt.memo=function(O,B){return{$$typeof:w,type:O,compare:B===void 0?null:B}},pt.startTransition=function(O){var B=L.transition;L.transition={};try{O()}finally{L.transition=B}},pt.unstable_act=X,pt.useCallback=function(O,B){return ae.current.useCallback(O,B)},pt.useContext=function(O){return ae.current.useContext(O)},pt.useDebugValue=function(){},pt.useDeferredValue=function(O){return ae.current.useDeferredValue(O)},pt.useEffect=function(O,B){return ae.current.useEffect(O,B)},pt.useId=function(){return ae.current.useId()},pt.useImperativeHandle=function(O,B,ke){return ae.current.useImperativeHandle(O,B,ke)},pt.useInsertionEffect=function(O,B){return ae.current.useInsertionEffect(O,B)},pt.useLayoutEffect=function(O,B){return ae.current.useLayoutEffect(O,B)},pt.useMemo=function(O,B){return ae.current.useMemo(O,B)},pt.useReducer=function(O,B,ke){return ae.current.useReducer(O,B,ke)},pt.useRef=function(O){return ae.current.useRef(O)},pt.useState=function(O){return ae.current.useState(O)},pt.useSyncExternalStore=function(O,B,ke){return ae.current.useSyncExternalStore(O,B,ke)},pt.useTransition=function(){return ae.current.useTransition()},pt.version="18.3.1",pt}var Hp;function Aa(){return Hp||(Hp=1,Qc.exports=Zy()),Qc.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 Vp;function Jy(){if(Vp)return ya;Vp=1;var t=Aa(),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(m,v,w){var b,x={},S=null,N=null;w!==void 0&&(S=""+w),v.key!==void 0&&(S=""+v.key),v.ref!==void 0&&(N=v.ref);for(b in v)a.call(v,b)&&!f.hasOwnProperty(b)&&(x[b]=v[b]);if(m&&m.defaultProps)for(b in v=m.defaultProps,v)x[b]===void 0&&(x[b]=v[b]);return{$$typeof:r,type:m,key:S,ref:N,props:x,_owner:u.current}}return ya.Fragment=i,ya.jsx=d,ya.jsxs=d,ya}var Kp;function e0(){return Kp||(Kp=1,Xc.exports=Jy()),Xc.exports}var C=e0(),ce=Aa();const lm=vu(ce);var Vl={},Gc={exports:{}},Fn={},Zc={exports:{}},Jc={};/**
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 Up;function t0(){return Up||(Up=1,(function(t){function r(L,F){var X=L.length;L.push(F);e:for(;0<X;){var O=X-1>>>1,B=L[O];if(0<u(B,F))L[O]=F,L[X]=B,X=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],X=L.pop();if(X!==F){L[0]=X;e:for(var O=0,B=L.length,ke=B>>>1;O<ke;){var Se=2*(O+1)-1,Ie=L[Se],Re=Se+1,Ae=L[Re];if(0>u(Ie,X))Re<B&&0>u(Ae,Ie)?(L[O]=Ae,L[Re]=X,O=Re):(L[O]=Ie,L[Se]=X,O=Se);else if(Re<B&&0>u(Ae,X))L[O]=Ae,L[Re]=X,O=Re;else break e}}return F}function u(L,F){var X=L.sortIndex-F.sortIndex;return X!==0?X: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,m=d.now();t.unstable_now=function(){return d.now()-m}}var v=[],w=[],b=1,x=null,S=3,N=!1,P=!1,$=!1,M=typeof setTimeout=="function"?setTimeout:null,I=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 j(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($=!1,j(L),!P)if(i(v)!==null)P=!0,te(W);else{var F=i(w);F!==null&&ae(R,F.startTime-L)}}function W(L,F){P=!1,$&&($=!1,I(pe),pe=-1),N=!0;var X=S;try{for(j(F),x=i(v);x!==null&&(!(x.expirationTime>F)||L&&!Q());){var O=x.callback;if(typeof O=="function"){x.callback=null,S=x.priorityLevel;var B=O(x.expirationTime<=F);F=t.unstable_now(),typeof B=="function"?x.callback=B:x===i(v)&&a(v),j(F)}else a(v);x=i(v)}if(x!==null)var ke=!0;else{var Se=i(w);Se!==null&&ae(R,Se.startTime-F),ke=!1}return ke}finally{x=null,S=X,N=!1}}var V=!1,q=null,pe=-1,he=5,_e=-1;function Q(){return!(t.unstable_now()-_e<he)}function le(){if(q!==null){var L=t.unstable_now();_e=L;var F=!0;try{F=q(!0,L)}finally{F?xe():(V=!1,q=null)}}else V=!1}var xe;if(typeof H=="function")xe=function(){H(le)};else if(typeof MessageChannel<"u"){var z=new MessageChannel,ue=z.port2;z.port1.onmessage=le,xe=function(){ue.postMessage(null)}}else xe=function(){M(le,0)};function te(L){q=L,V||(V=!0,xe())}function ae(L,F){pe=M(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(){P||N||(P=!0,te(W))},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 S},t.unstable_getFirstCallbackNode=function(){return i(v)},t.unstable_next=function(L){switch(S){case 1:case 2:case 3:var F=3;break;default:F=S}var X=S;S=F;try{return L()}finally{S=X}},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 X=S;S=L;try{return F()}finally{S=X}},t.unstable_scheduleCallback=function(L,F,X){var O=t.unstable_now();switch(typeof X=="object"&&X!==null?(X=X.delay,X=typeof X=="number"&&0<X?O+X:O):X=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=X+B,L={id:b++,callback:F,priorityLevel:L,startTime:X,expirationTime:B,sortIndex:-1},X>O?(L.sortIndex=X,r(w,L),i(v)===null&&L===i(w)&&($?(I(pe),pe=-1):$=!0,ae(R,X-O))):(L.sortIndex=B,r(v,L),P||N||(P=!0,te(W))),L},t.unstable_shouldYield=Q,t.unstable_wrapCallback=function(L){var F=S;return function(){var X=S;S=F;try{return L.apply(this,arguments)}finally{S=X}}}})(Jc)),Jc}var qp;function n0(){return qp||(qp=1,Zc.exports=t0()),Zc.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 Wp;function r0(){if(Wp)return Fn;Wp=1;var t=Aa(),r=n0();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 m=!(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]*$/,b={},x={};function S(e){return v.call(x,e)?!0:v.call(b,e)?!1:w.test(e)?x[e]=!0:(b[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 P(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 $(e,n,o,l,p,g,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=g,this.removeEmptyString=E}var M={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){M[e]=new $(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var n=e[0];M[n]=new $(n,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){M[e]=new $(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){M[e]=new $(e,2,!1,e,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){M[e]=new $(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){M[e]=new $(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){M[e]=new $(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){M[e]=new $(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){M[e]=new $(e,5,!1,e.toLowerCase(),null,!1,!1)});var I=/[\-:]([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(I,H);M[n]=new $(n,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var n=e.replace(I,H);M[n]=new $(n,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var n=e.replace(I,H);M[n]=new $(n,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){M[e]=new $(e,1,!1,e.toLowerCase(),null,!1,!1)}),M.xlinkHref=new $("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){M[e]=new $(e,1,!1,e.toLowerCase(),null,!0,!0)});function j(e,n,o,l){var p=M.hasOwnProperty(n)?M[n]:null;(p!==null?p.type!==0:l||!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(P(n,o,p,l)&&(o=null),l||p===null?S(n)&&(o===null?e.removeAttribute(n):e.setAttribute(n,""+o)):p.mustUseProperty?e[p.propertyName]=o===null?p.type===3?!1:"":o:(n=p.attributeName,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,W=Symbol.for("react.element"),V=Symbol.for("react.portal"),q=Symbol.for("react.fragment"),pe=Symbol.for("react.strict_mode"),he=Symbol.for("react.profiler"),_e=Symbol.for("react.provider"),Q=Symbol.for("react.context"),le=Symbol.for("react.forward_ref"),xe=Symbol.for("react.suspense"),z=Symbol.for("react.suspense_list"),ue=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 X=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 ke=!1;function Se(e,n){if(!e||ke)return"";ke=!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
+ `),g=l.stack.split(`
36
+ `),E=p.length-1,D=g.length-1;1<=E&&0<=D&&p[E]!==g[D];)D--;for(;1<=E&&0<=D;E--,D--)if(p[E]!==g[D]){if(E!==1||D!==1)do if(E--,D--,0>D||p[E]!==g[D]){var U=`
37
+ `+p[E].replace(" at new "," at ");return e.displayName&&U.includes("<anonymous>")&&(U=U.replace("<anonymous>",e.displayName)),U}while(1<=E&&0<=D);break}}}finally{ke=!1,Error.prepareStackTrace=o}return(e=e?e.displayName||e.name:"")?B(e):""}function Ie(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=Se(e.type,!1),e;case 11:return e=Se(e.type.render,!1),e;case 1:return e=Se(e.type,!0),e;default:return""}}function Re(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case q:return"Fragment";case V:return"Portal";case he:return"Profiler";case pe:return"StrictMode";case xe:return"Suspense";case z:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Q:return(e.displayName||"Context")+".Consumer";case _e:return(e._context.displayName||"Context")+".Provider";case le:var n=e.render;return e=e.displayName,e||(e=n.displayName||n.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ue:return n=e.displayName||null,n!==null?n:Re(e.type)||"Memo";case te:n=e._payload,e=e._init;try{return Re(e(n))}catch{}}return null}function Ae(e){var n=e.type;switch(e.tag){case 24:return"Cache";case 9:return(n.displayName||"Context")+".Consumer";case 10:return(n._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=n.render,e=e.displayName||e.name||"",n.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return n;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Re(n);case 8:return n===pe?"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 Fe(e){var n=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function be(e){var n=Fe(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,g=o.set;return Object.defineProperty(e,n,{configurable:!0,get:function(){return p.call(this)},set:function(E){l=""+E,g.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 Je(e){e._valueTracker||(e._valueTracker=be(e))}function Be(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var o=n.getValue(),l="";return e&&(l=Fe(e)?e.checked?"true":"false":e.value),e=l,e!==o?(n.setValue(e),!0):!1}function Ye(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 X({},n,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:o??e._wrapperState.initialChecked})}function st(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 ct(e,n){n=n.checked,n!=null&&j(e,"checked",n,!1)}function ht(e,n){ct(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")?Lt(e,n.type,o):n.hasOwnProperty("defaultValue")&&Lt(e,n.type,we(n.defaultValue)),n.checked==null&&n.defaultChecked!=null&&(e.defaultChecked=!!n.defaultChecked)}function xn(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 Lt(e,n,o){(n!=="number"||Ye(e.ownerDocument)!==e)&&(o==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+o&&(e.defaultValue=""+o))}var Ft=Array.isArray;function bt(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 Pn(e,n){if(n.dangerouslySetInnerHTML!=null)throw Error(i(91));return X({},n,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function cn(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(Ft(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 wn(e){var n=e.textContent;n===e._wrapperState.initialValue&&n!==""&&n!==null&&(e.value=n)}function Et(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 Ht(e,n){return e==null||e==="http://www.w3.org/1999/xhtml"?Et(n):e==="http://www.w3.org/2000/svg"&&n==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Hn,tr=(function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(n,o,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(Hn=Hn||document.createElement("div"),Hn.innerHTML="<svg>"+n.valueOf().toString()+"</svg>",n=Hn.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;n.firstChild;)e.appendChild(n.firstChild)}});function _n(e,n){if(n){var o=e.firstChild;if(o&&o===e.lastChild&&o.nodeType===3){o.nodeValue=n;return}}e.textContent=n}var jn={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Vn=["Webkit","ms","Moz","O"];Object.keys(jn).forEach(function(e){Vn.forEach(function(n){n=n+e.charAt(0).toUpperCase()+e.substring(1),jn[n]=jn[e]})});function fn(e,n,o){return n==null||typeof n=="boolean"||n===""?"":o||typeof n!="number"||n===0||jn.hasOwnProperty(e)&&jn[e]?(""+n).trim():n+"px"}function nr(e,n){e=e.style;for(var o in n)if(n.hasOwnProperty(o)){var l=o.indexOf("--")===0,p=fn(o,n[o],l);o==="float"&&(o="cssFloat"),l?e.setProperty(o,p):e[o]=p}}var Sn=X({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(Sn[e]&&(n.children!=null||n.dangerouslySetInnerHTML!=null))throw Error(i(137,e));if(n.dangerouslySetInnerHTML!=null){if(n.children!=null)throw Error(i(60));if(typeof n.dangerouslySetInnerHTML!="object"||!("__html"in n.dangerouslySetInnerHTML))throw Error(i(61))}if(n.style!=null&&typeof n.style!="object")throw Error(i(62))}}function Kn(e,n){if(e.indexOf("-")===-1)return typeof n.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var bn=null;function rr(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var He=null,Tn=null,Un=null;function Or(e){if(e=ta(e)){if(typeof He!="function")throw Error(i(280));var n=e.stateNode;n&&(n=ol(n),He(e.stateNode,e.type,n))}}function Jr(e){Tn?Un?Un.push(e):Un=[e]:Tn=e}function Rr(){if(Tn){var e=Tn,n=Un;if(Un=Tn=null,Or(e),n)for(e=0;e<n.length;e++)Or(n[e])}}function Io(e,n){return e(n)}function eo(){}var kn=!1;function Mn(e,n,o){if(kn)return e(n,o);kn=!0;try{return Io(e,n,o)}finally{kn=!1,(Tn!==null||Un!==null)&&(eo(),Rr())}}function K(e,n){var o=e.stateNode;if(o===null)return null;var l=ol(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 ze=!1;if(m)try{var Le={};Object.defineProperty(Le,"passive",{get:function(){ze=!0}}),window.addEventListener("test",Le,Le),window.removeEventListener("test",Le,Le)}catch{ze=!1}function et(e,n,o,l,p,g,E,D,U){var ye=Array.prototype.slice.call(arguments,3);try{n.apply(o,ye)}catch(je){this.onError(je)}}var Wt=!1,Yt=null,Vt=!1,nn=null,to={onError:function(e){Wt=!0,Yt=e}};function rn(e,n,o,l,p,g,E,D,U){Wt=!1,Yt=null,et.apply(to,arguments)}function qn(e,n,o,l,p,g,E,D,U){if(rn.apply(this,arguments),Wt){if(Wt){var ye=Yt;Wt=!1,Yt=null}else throw Error(i(198));Vt||(Vt=!0,nn=ye)}}function Dt(e){var n=e,o=e;if(e.alternate)for(;n.return;)n=n.return;else{e=n;do n=e,(n.flags&4098)!==0&&(o=n.return),e=n.return;while(e)}return n.tag===3?o:null}function Wn(e){if(e.tag===13){var n=e.memoizedState;if(n===null&&(e=e.alternate,e!==null&&(n=e.memoizedState)),n!==null)return n.dehydrated}return null}function or(e){if(Dt(e)!==e)throw Error(i(188))}function In(e){var n=e.alternate;if(!n){if(n=Dt(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 g=p.alternate;if(g===null){if(l=p.return,l!==null){o=l;continue}break}if(p.child===g.child){for(g=p.child;g;){if(g===o)return or(p),e;if(g===l)return or(p),n;g=g.sibling}throw Error(i(188))}if(o.return!==l.return)o=p,l=g;else{for(var E=!1,D=p.child;D;){if(D===o){E=!0,o=p,l=g;break}if(D===l){E=!0,l=p,o=g;break}D=D.sibling}if(!E){for(D=g.child;D;){if(D===o){E=!0,o=g,l=p;break}if(D===l){E=!0,l=g,o=p;break}D=D.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 ui(e){return e=In(e),e!==null?ir(e):null}function ir(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var n=ir(e);if(n!==null)return n;e=e.sibling}return null}var ci=r.unstable_scheduleCallback,Ao=r.unstable_cancelCallback,Nt=r.unstable_shouldYield,sr=r.unstable_requestPaint,yt=r.unstable_now,Bi=r.unstable_getCurrentPriorityLevel,Dr=r.unstable_ImmediatePriority,$o=r.unstable_UserBlockingPriority,zr=r.unstable_NormalPriority,yr=r.unstable_LowPriority,fi=r.unstable_IdlePriority,ar=null,En=null;function ft(e){if(En&&typeof En.onCommitFiberRoot=="function")try{En.onCommitFiberRoot(ar,e,void 0,(e.current.flags&128)===128)}catch{}}var dn=Math.clz32?Math.clz32:no,Hi=Math.log,Oo=Math.LN2;function no(e){return e>>>=0,e===0?32:31-(Hi(e)/Oo|0)|0}var ro=64,oo=4194304;function Yn(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function vt(e,n){var o=e.pendingLanes;if(o===0)return 0;var l=0,p=e.suspendedLanes,g=e.pingedLanes,E=o&268435455;if(E!==0){var D=E&~p;D!==0?l=Yn(D):(g&=E,g!==0&&(l=Yn(g)))}else E=o&~p,E!==0?l=Yn(E):g!==0&&(l=Yn(g));if(l===0)return 0;if(n!==0&&n!==l&&(n&p)===0&&(p=l&-l,g=n&-n,p>=g||p===16&&(g&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-dn(n),p=1<<o,l|=e[o],n&=~p;return l}function Lr(e,n){switch(e){case 1:case 2:case 4:return n+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return n+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function io(e,n){for(var o=e.suspendedLanes,l=e.pingedLanes,p=e.expirationTimes,g=e.pendingLanes;0<g;){var E=31-dn(g),D=1<<E,U=p[E];U===-1?((D&o)===0||(D&l)!==0)&&(p[E]=Lr(D,n)):U<=n&&(e.expiredLanes|=D),g&=~D}}function lr(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Fr(){var e=ro;return ro<<=1,(ro&4194240)===0&&(ro=64),e}function so(e){for(var n=[],o=0;31>o;o++)n.push(e);return n}function ur(e,n,o){e.pendingLanes|=n,n!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,n=31-dn(n),e[n]=o}function di(e,n){var o=e.pendingLanes&~n;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=n,e.mutableReadLanes&=n,e.entangledLanes&=n,n=e.entanglements;var l=e.eventTimes;for(e=e.expirationTimes;0<o;){var p=31-dn(o),g=1<<p;n[p]=0,l[p]=-1,e[p]=-1,o&=~g}}function Ro(e,n){var o=e.entangledLanes|=n;for(e=e.entanglements;o;){var l=31-dn(o),p=1<<l;p&n|e[l]&n&&(e[l]|=n),o&=~p}}var wt=0;function Ba(e){return e&=-e,1<e?4<e?(e&268435455)!==0?16:536870912:4:1}var mt,Vi,Ha,Va,pn,Br=!1,ao=[],on=null,vr=null,xr=null,Mt=new Map,sn=new Map,An=[],pi="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Ki(e,n){switch(e){case"focusin":case"focusout":on=null;break;case"dragenter":case"dragleave":vr=null;break;case"mouseover":case"mouseout":xr=null;break;case"pointerover":case"pointerout":Mt.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":sn.delete(n.pointerId)}}function $n(e,n,o,l,p,g){return e===null||e.nativeEvent!==g?(e={blockedOn:n,domEventName:o,eventSystemFlags:l,nativeEvent:g,targetContainers:[p]},n!==null&&(n=ta(n),n!==null&&Vi(n)),e):(e.eventSystemFlags|=l,n=e.targetContainers,p!==null&&n.indexOf(p)===-1&&n.push(p),e)}function Au(e,n,o,l,p){switch(n){case"focusin":return on=$n(on,e,n,o,l,p),!0;case"dragenter":return vr=$n(vr,e,n,o,l,p),!0;case"mouseover":return xr=$n(xr,e,n,o,l,p),!0;case"pointerover":var g=p.pointerId;return Mt.set(g,$n(Mt.get(g)||null,e,n,o,l,p)),!0;case"gotpointercapture":return g=p.pointerId,sn.set(g,$n(sn.get(g)||null,e,n,o,l,p)),!0}return!1}function Xn(e){var n=_i(e.target);if(n!==null){var o=Dt(n);if(o!==null){if(n=o.tag,n===13){if(n=Wn(o),n!==null){e.blockedOn=n,pn(e.priority,function(){Ha(o)});return}}else if(n===3&&o.stateNode.current.memoizedState.isDehydrated){e.blockedOn=o.tag===3?o.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Do(e){if(e.blockedOn!==null)return!1;for(var n=e.targetContainers;0<n.length;){var o=zo(e.domEventName,e.eventSystemFlags,n[0],e.nativeEvent);if(o===null){o=e.nativeEvent;var l=new o.constructor(o.type,o);bn=l,o.target.dispatchEvent(l),bn=null}else return n=ta(o),n!==null&&Vi(n),e.blockedOn=o,!1;n.shift()}return!0}function Ds(e,n,o){Do(e)&&o.delete(n)}function zs(){Br=!1,on!==null&&Do(on)&&(on=null),vr!==null&&Do(vr)&&(vr=null),xr!==null&&Do(xr)&&(xr=null),Mt.forEach(Ds),sn.forEach(Ds)}function wr(e,n){e.blockedOn===n&&(e.blockedOn=null,Br||(Br=!0,r.unstable_scheduleCallback(r.unstable_NormalPriority,zs)))}function lo(e){function n(p){return wr(p,e)}if(0<ao.length){wr(ao[0],e);for(var o=1;o<ao.length;o++){var l=ao[o];l.blockedOn===e&&(l.blockedOn=null)}}for(on!==null&&wr(on,e),vr!==null&&wr(vr,e),xr!==null&&wr(xr,e),Mt.forEach(n),sn.forEach(n),o=0;o<An.length;o++)l=An[o],l.blockedOn===e&&(l.blockedOn=null);for(;0<An.length&&(o=An[0],o.blockedOn===null);)Xn(o),o.blockedOn===null&&An.shift()}var uo=R.ReactCurrentBatchConfig,Ui=!0;function hi(e,n,o,l){var p=wt,g=uo.transition;uo.transition=null;try{wt=1,Ls(e,n,o,l)}finally{wt=p,uo.transition=g}}function $u(e,n,o,l){var p=wt,g=uo.transition;uo.transition=null;try{wt=4,Ls(e,n,o,l)}finally{wt=p,uo.transition=g}}function Ls(e,n,o,l){if(Ui){var p=zo(e,n,o,l);if(p===null)Lu(e,n,l,co,o),Ki(e,l);else if(Au(p,e,n,o,l))l.stopPropagation();else if(Ki(e,l),n&4&&-1<pi.indexOf(e)){for(;p!==null;){var g=ta(p);if(g!==null&&mt(g),g=zo(e,n,o,l),g===null&&Lu(e,n,l,co,o),g===p)break;p=g}p!==null&&l.stopPropagation()}else Lu(e,n,l,null,o)}}var co=null;function zo(e,n,o,l){if(co=null,e=rr(l),e=_i(e),e!==null)if(n=Dt(e),n===null)e=null;else if(o=n.tag,o===13){if(e=Wn(n),e!==null)return e;e=null}else if(o===3){if(n.stateNode.current.memoizedState.isDehydrated)return n.tag===3?n.stateNode.containerInfo:null;e=null}else n!==e&&(e=null);return co=e,null}function qi(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Bi()){case Dr:return 1;case $o:return 4;case zr:case yr:return 16;case fi:return 536870912;default:return 16}default:return 16}}var Hr=null,Fs=null,Wi=null;function Yi(){if(Wi)return Wi;var e,n=Fs,o=n.length,l,p="value"in Hr?Hr.value:Hr.textContent,g=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[g-l];l++);return Wi=p.slice(e,1<l?1-l:void 0)}function Lo(e){var n=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&n===13&&(e=13)):e=n,e===10&&(e=13),32<=e||e===13?e:0}function mi(){return!0}function gi(){return!1}function Gt(e){function n(o,l,p,g,E){this._reactName=o,this._targetInst=p,this.type=l,this.nativeEvent=g,this.target=E,this.currentTarget=null;for(var D in e)e.hasOwnProperty(D)&&(o=e[D],this[D]=o?o(g):g[D]);return this.isDefaultPrevented=(g.defaultPrevented!=null?g.defaultPrevented:g.returnValue===!1)?mi:gi,this.isPropagationStopped=gi,this}return X(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var o=this.nativeEvent;o&&(o.preventDefault?o.preventDefault():typeof o.returnValue!="unknown"&&(o.returnValue=!1),this.isDefaultPrevented=mi)},stopPropagation:function(){var o=this.nativeEvent;o&&(o.stopPropagation?o.stopPropagation():typeof o.cancelBubble!="unknown"&&(o.cancelBubble=!0),this.isPropagationStopped=mi)},persist:function(){},isPersistent:mi}),n}var _r={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Xi=Gt(_r),yi=X({},_r,{view:0,detail:0}),Fo=Gt(yi),fo,vi,po,Bo=X({},yi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ts,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==po&&(po&&e.type==="mousemove"?(fo=e.screenX-po.screenX,vi=e.screenY-po.screenY):vi=fo=0,po=e),fo)},movementY:function(e){return"movementY"in e?e.movementY:vi}}),Qi=Gt(Bo),Zt=X({},Bo,{dataTransfer:0}),xi=Gt(Zt),wi=X({},yi,{relatedTarget:0}),Gi=Gt(wi),Zi=X({},_r,{animationName:0,elapsedTime:0,pseudoElement:0}),Ka=Gt(Zi),Ua=X({},_r,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Ji=Gt(Ua),Bs=X({},_r,{data:0}),Vr=Gt(Bs),Hs={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Vs={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},es={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Ks(e){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(e):(e=es[e])?!!n[e]:!1}function ts(){return Ks}var Ou=X({},yi,{key:function(e){if(e.key){var n=Hs[e.key]||e.key;if(n!=="Unidentified")return n}return e.type==="keypress"?(e=Lo(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Vs[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ts,charCode:function(e){return e.type==="keypress"?Lo(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Lo(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Us=Gt(Ou),ns=X({},Bo,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),qa=Gt(ns),qs=X({},yi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ts}),Ws=Gt(qs),Ru=X({},_r,{propertyName:0,elapsedTime:0,pseudoElement:0}),Wa=Gt(Ru),Du=X({},Bo,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),Ya=Gt(Du),Xa=[9,13,27,32],Ys=m&&"CompositionEvent"in window,Ho=null;m&&"documentMode"in document&&(Ho=document.documentMode);var Xs=m&&"TextEvent"in window&&!Ho,Qs=m&&(!Ys||Ho&&8<Ho&&11>=Ho),Gs=" ",Qa=!1;function Ga(e,n){switch(e){case"keyup":return Xa.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Za(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Sr=!1;function br(e,n){switch(e){case"compositionend":return Za(n);case"keypress":return n.which!==32?null:(Qa=!0,Gs);case"textInput":return e=n.data,e===Gs&&Qa?null:e;default:return null}}function $t(e,n){if(Sr)return e==="compositionend"||!Ys&&Ga(e,n)?(e=Yi(),Wi=Fs=Hr=null,Sr=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1<n.char.length)return n.char;if(n.which)return String.fromCharCode(n.which)}return null;case"compositionend":return Qs&&n.locale!=="ko"?null:n.data;default:return null}}var rs={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function ho(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n==="input"?!!rs[e.type]:n==="textarea"}function Ja(e,n,o,l){Jr(l),n=tl(n,"onChange"),0<n.length&&(o=new Xi("onChange","change",null,o,l),e.push({event:o,listeners:n}))}var mo=null,Vo=null;function go(e){rd(e,0)}function Ko(e){var n=as(e);if(Be(n))return e}function Uo(e,n){if(e==="change")return n}var kr=!1;if(m){var os;if(m){var s="oninput"in document;if(!s){var c=document.createElement("div");c.setAttribute("oninput","return;"),s=typeof c.oninput=="function"}os=s}else os=!1;kr=os&&(!document.documentMode||9<document.documentMode)}function h(){mo&&(mo.detachEvent("onpropertychange",y),Vo=mo=null)}function y(e){if(e.propertyName==="value"&&Ko(Vo)){var n=[];Ja(n,Vo,e,rr(e)),Mn(go,n)}}function _(e,n,o){e==="focusin"?(h(),mo=n,Vo=o,mo.attachEvent("onpropertychange",y)):e==="focusout"&&h()}function k(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ko(Vo)}function T(e,n){if(e==="click")return Ko(n)}function A(e,n){if(e==="input"||e==="change")return Ko(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 Y(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Z(e,n){var o=Y(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=Y(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=Ye();n instanceof e.HTMLIFrameElement;){try{var o=typeof n.contentWindow.location.href=="string"}catch{o=!1}if(o)e=n.contentWindow;else break;n=Ye(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,g=Math.min(l.start,p);l=l.end===void 0?g:Math.min(l.end,p),!e.extend&&g>l&&(p=l,l=g,g=p),p=Z(o,g);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(),g>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=m&&"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!==Ye(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=tl(ve,"onSelect"),0<l.length&&(n=new Xi("onSelect","select",null,n,o),e.push({event:n,listeners:l}),n.target=fe)))}function Te(e,n){var o={};return o[e.toLowerCase()]=n.toLowerCase(),o["Webkit"+e]="webkit"+n,o["Moz"+e]="moz"+n,o}var Ve={animationend:Te("Animation","AnimationEnd"),animationiteration:Te("Animation","AnimationIteration"),animationstart:Te("Animation","AnimationStart"),transitionend:Te("Transition","TransitionEnd")},$e={},Ue={};m&&(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($e[e])return $e[e];if(!Ve[e])return e;var n=Ve[e],o;for(o in n)if(n.hasOwnProperty(o)&&o in Ue)return $e[e]=n[o];return e}var rt=Ne("animationend"),ot=Ne("animationiteration"),lt=Ne("animationstart"),dt=Ne("transitionend"),hn=new Map,at="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Ct(e,n){hn.set(e,n),f(n,[e])}for(var Kt=0;Kt<at.length;Kt++){var qo=at[Kt],an=qo.toLowerCase(),yo=qo[0].toUpperCase()+qo.slice(1);Ct(an,"on"+yo)}Ct(rt,"onAnimationEnd"),Ct(ot,"onAnimationIteration"),Ct(lt,"onAnimationStart"),Ct("dblclick","onDoubleClick"),Ct("focusin","onFocus"),Ct("focusout","onBlur"),Ct(dt,"onTransitionEnd"),d("onMouseEnter",["mouseout","mouseover"]),d("onMouseLeave",["mouseout","mouseover"]),d("onPointerEnter",["pointerout","pointerover"]),d("onPointerLeave",["pointerout","pointerover"]),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 vo="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),sy=new Set("cancel close invalid load scroll toggle".split(" ").concat(vo));function nd(e,n,o){var l=e.type||"unknown-event";e.currentTarget=o,qn(l,n,void 0,e),e.currentTarget=null}function rd(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 g=void 0;if(n)for(var E=l.length-1;0<=E;E--){var D=l[E],U=D.instance,ye=D.currentTarget;if(D=D.listener,U!==g&&p.isPropagationStopped())break e;nd(p,D,ye),g=U}else for(E=0;E<l.length;E++){if(D=l[E],U=D.instance,ye=D.currentTarget,D=D.listener,U!==g&&p.isPropagationStopped())break e;nd(p,D,ye),g=U}}}if(Vt)throw e=nn,Vt=!1,nn=null,e}function Pt(e,n){var o=n[Uu];o===void 0&&(o=n[Uu]=new Set);var l=e+"__bubble";o.has(l)||(od(n,e,2,!1),o.add(l))}function zu(e,n,o){var l=0;n&&(l|=4),od(o,e,l,n)}var el="_reactListening"+Math.random().toString(36).slice(2);function Zs(e){if(!e[el]){e[el]=!0,a.forEach(function(o){o!=="selectionchange"&&(sy.has(o)||zu(o,!1,e),zu(o,!0,e))});var n=e.nodeType===9?e:e.ownerDocument;n===null||n[el]||(n[el]=!0,zu("selectionchange",!1,n))}}function od(e,n,o,l){switch(qi(n)){case 1:var p=hi;break;case 4:p=$u;break;default:p=Ls}o=p.bind(null,n,o,e),p=void 0,!ze||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 Lu(e,n,o,l,p){var g=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 D=l.stateNode.containerInfo;if(D===p||D.nodeType===8&&D.parentNode===p)break;if(E===4)for(E=l.return;E!==null;){var U=E.tag;if((U===3||U===4)&&(U=E.stateNode.containerInfo,U===p||U.nodeType===8&&U.parentNode===p))return;E=E.return}for(;D!==null;){if(E=_i(D),E===null)return;if(U=E.tag,U===5||U===6){l=g=E;continue e}D=D.parentNode}}l=l.return}Mn(function(){var ye=g,je=rr(o),Me=[];e:{var Pe=hn.get(e);if(Pe!==void 0){var Ke=Xi,Xe=e;switch(e){case"keypress":if(Lo(o)===0)break e;case"keydown":case"keyup":Ke=Us;break;case"focusin":Xe="focus",Ke=Gi;break;case"focusout":Xe="blur",Ke=Gi;break;case"beforeblur":case"afterblur":Ke=Gi;break;case"click":if(o.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Ke=Qi;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Ke=xi;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Ke=Ws;break;case rt:case ot:case lt:Ke=Ka;break;case dt:Ke=Wa;break;case"scroll":Ke=Fo;break;case"wheel":Ke=Ya;break;case"copy":case"cut":case"paste":Ke=Ji;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Ke=qa}var Qe=(n&4)!==0,Bt=!Qe&&e==="scroll",de=Qe?Pe!==null?Pe+"Capture":null:Pe;Qe=[];for(var ee=ye,me;ee!==null;){me=ee;var De=me.stateNode;if(me.tag===5&&De!==null&&(me=De,de!==null&&(De=K(ee,de),De!=null&&Qe.push(Js(ee,De,me)))),Bt)break;ee=ee.return}0<Qe.length&&(Pe=new Ke(Pe,Xe,null,o,je),Me.push({event:Pe,listeners:Qe}))}}if((n&7)===0){e:{if(Pe=e==="mouseover"||e==="pointerover",Ke=e==="mouseout"||e==="pointerout",Pe&&o!==bn&&(Xe=o.relatedTarget||o.fromElement)&&(_i(Xe)||Xe[xo]))break e;if((Ke||Pe)&&(Pe=je.window===je?je:(Pe=je.ownerDocument)?Pe.defaultView||Pe.parentWindow:window,Ke?(Xe=o.relatedTarget||o.toElement,Ke=ye,Xe=Xe?_i(Xe):null,Xe!==null&&(Bt=Dt(Xe),Xe!==Bt||Xe.tag!==5&&Xe.tag!==6)&&(Xe=null)):(Ke=null,Xe=ye),Ke!==Xe)){if(Qe=Qi,De="onMouseLeave",de="onMouseEnter",ee="mouse",(e==="pointerout"||e==="pointerover")&&(Qe=qa,De="onPointerLeave",de="onPointerEnter",ee="pointer"),Bt=Ke==null?Pe:as(Ke),me=Xe==null?Pe:as(Xe),Pe=new Qe(De,ee+"leave",Ke,o,je),Pe.target=Bt,Pe.relatedTarget=me,De=null,_i(je)===ye&&(Qe=new Qe(de,ee+"enter",Xe,o,je),Qe.target=me,Qe.relatedTarget=Bt,De=Qe),Bt=De,Ke&&Xe)t:{for(Qe=Ke,de=Xe,ee=0,me=Qe;me;me=is(me))ee++;for(me=0,De=de;De;De=is(De))me++;for(;0<ee-me;)Qe=is(Qe),ee--;for(;0<me-ee;)de=is(de),me--;for(;ee--;){if(Qe===de||de!==null&&Qe===de.alternate)break t;Qe=is(Qe),de=is(de)}Qe=null}else Qe=null;Ke!==null&&id(Me,Pe,Ke,Qe,!1),Xe!==null&&Bt!==null&&id(Me,Bt,Xe,Qe,!0)}}e:{if(Pe=ye?as(ye):window,Ke=Pe.nodeName&&Pe.nodeName.toLowerCase(),Ke==="select"||Ke==="input"&&Pe.type==="file")var Ge=Uo;else if(ho(Pe))if(kr)Ge=A;else{Ge=k;var tt=_}else(Ke=Pe.nodeName)&&Ke.toLowerCase()==="input"&&(Pe.type==="checkbox"||Pe.type==="radio")&&(Ge=T);if(Ge&&(Ge=Ge(e,ye))){Ja(Me,Ge,o,je);break e}tt&&tt(e,Pe,ye),e==="focusout"&&(tt=Pe._wrapperState)&&tt.controlled&&Pe.type==="number"&&Lt(Pe,"number",Pe.value)}switch(tt=ye?as(ye):window,e){case"focusin":(ho(tt)||tt.contentEditable==="true")&&(fe=tt,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(Me,o,je);break;case"selectionchange":if(ge)break;case"keydown":case"keyup":Oe(Me,o,je)}var nt;if(Ys)e:{switch(e){case"compositionstart":var it="onCompositionStart";break e;case"compositionend":it="onCompositionEnd";break e;case"compositionupdate":it="onCompositionUpdate";break e}it=void 0}else Sr?Ga(e,o)&&(it="onCompositionEnd"):e==="keydown"&&o.keyCode===229&&(it="onCompositionStart");it&&(Qs&&o.locale!=="ko"&&(Sr||it!=="onCompositionStart"?it==="onCompositionEnd"&&Sr&&(nt=Yi()):(Hr=je,Fs="value"in Hr?Hr.value:Hr.textContent,Sr=!0)),tt=tl(ye,it),0<tt.length&&(it=new Vr(it,e,null,o,je),Me.push({event:it,listeners:tt}),nt?it.data=nt:(nt=Za(o),nt!==null&&(it.data=nt)))),(nt=Xs?br(e,o):$t(e,o))&&(ye=tl(ye,"onBeforeInput"),0<ye.length&&(je=new Vr("onBeforeInput","beforeinput",null,o,je),Me.push({event:je,listeners:ye}),je.data=nt))}rd(Me,n)})}function Js(e,n,o){return{instance:e,listener:n,currentTarget:o}}function tl(e,n){for(var o=n+"Capture",l=[];e!==null;){var p=e,g=p.stateNode;p.tag===5&&g!==null&&(p=g,g=K(e,o),g!=null&&l.unshift(Js(e,g,p)),g=K(e,n),g!=null&&l.push(Js(e,g,p))),e=e.return}return l}function is(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function id(e,n,o,l,p){for(var g=n._reactName,E=[];o!==null&&o!==l;){var D=o,U=D.alternate,ye=D.stateNode;if(U!==null&&U===l)break;D.tag===5&&ye!==null&&(D=ye,p?(U=K(o,g),U!=null&&E.unshift(Js(o,U,D))):p||(U=K(o,g),U!=null&&E.push(Js(o,U,D)))),o=o.return}E.length!==0&&e.push({event:n,listeners:E})}var ay=/\r\n?/g,ly=/\u0000|\uFFFD/g;function sd(e){return(typeof e=="string"?e:""+e).replace(ay,`
38
+ `).replace(ly,"")}function nl(e,n,o){if(n=sd(n),sd(e)!==n&&o)throw Error(i(425))}function rl(){}var Fu=null,Bu=null;function Hu(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 Vu=typeof setTimeout=="function"?setTimeout:void 0,uy=typeof clearTimeout=="function"?clearTimeout:void 0,ad=typeof Promise=="function"?Promise:void 0,cy=typeof queueMicrotask=="function"?queueMicrotask:typeof ad<"u"?function(e){return ad.resolve(null).then(e).catch(fy)}:Vu;function fy(e){setTimeout(function(){throw e})}function Ku(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),lo(n);return}l--}else o!=="$"&&o!=="$?"&&o!=="$!"||l++;o=p}while(o);lo(n)}function Wo(e){for(;e!=null;e=e.nextSibling){var n=e.nodeType;if(n===1||n===3)break;if(n===8){if(n=e.data,n==="$"||n==="$!"||n==="$?")break;if(n==="/$")return null}}return e}function ld(e){e=e.previousSibling;for(var n=0;e;){if(e.nodeType===8){var o=e.data;if(o==="$"||o==="$!"||o==="$?"){if(n===0)return e;n--}else o==="/$"&&n++}e=e.previousSibling}return null}var ss=Math.random().toString(36).slice(2),Kr="__reactFiber$"+ss,ea="__reactProps$"+ss,xo="__reactContainer$"+ss,Uu="__reactEvents$"+ss,dy="__reactListeners$"+ss,py="__reactHandles$"+ss;function _i(e){var n=e[Kr];if(n)return n;for(var o=e.parentNode;o;){if(n=o[xo]||o[Kr]){if(o=n.alternate,n.child!==null||o!==null&&o.child!==null)for(e=ld(e);e!==null;){if(o=e[Kr])return o;e=ld(e)}return n}e=o,o=e.parentNode}return null}function ta(e){return e=e[Kr]||e[xo],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function as(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(i(33))}function ol(e){return e[ea]||null}var qu=[],ls=-1;function Yo(e){return{current:e}}function jt(e){0>ls||(e.current=qu[ls],qu[ls]=null,ls--)}function kt(e,n){ls++,qu[ls]=e.current,e.current=n}var Xo={},mn=Yo(Xo),On=Yo(!1),Si=Xo;function us(e,n){var o=e.type.contextTypes;if(!o)return Xo;var l=e.stateNode;if(l&&l.__reactInternalMemoizedUnmaskedChildContext===n)return l.__reactInternalMemoizedMaskedChildContext;var p={},g;for(g in o)p[g]=n[g];return l&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=n,e.__reactInternalMemoizedMaskedChildContext=p),p}function Rn(e){return e=e.childContextTypes,e!=null}function il(){jt(On),jt(mn)}function ud(e,n,o){if(mn.current!==Xo)throw Error(i(168));kt(mn,n),kt(On,o)}function cd(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,Ae(e)||"Unknown",p));return X({},o,l)}function sl(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Xo,Si=mn.current,kt(mn,e),kt(On,On.current),!0}function fd(e,n,o){var l=e.stateNode;if(!l)throw Error(i(169));o?(e=cd(e,n,Si),l.__reactInternalMemoizedMergedChildContext=e,jt(On),jt(mn),kt(mn,e)):jt(On),kt(On,o)}var wo=null,al=!1,Wu=!1;function dd(e){wo===null?wo=[e]:wo.push(e)}function hy(e){al=!0,dd(e)}function Qo(){if(!Wu&&wo!==null){Wu=!0;var e=0,n=wt;try{var o=wo;for(wt=1;e<o.length;e++){var l=o[e];do l=l(!0);while(l!==null)}wo=null,al=!1}catch(p){throw wo!==null&&(wo=wo.slice(e+1)),ci(Dr,Qo),p}finally{wt=n,Wu=!1}}return null}var cs=[],fs=0,ll=null,ul=0,cr=[],fr=0,bi=null,_o=1,So="";function ki(e,n){cs[fs++]=ul,cs[fs++]=ll,ll=e,ul=n}function pd(e,n,o){cr[fr++]=_o,cr[fr++]=So,cr[fr++]=bi,bi=e;var l=_o;e=So;var p=32-dn(l)-1;l&=~(1<<p),o+=1;var g=32-dn(n)+p;if(30<g){var E=p-p%5;g=(l&(1<<E)-1).toString(32),l>>=E,p-=E,_o=1<<32-dn(n)+p|o<<p|l,So=g+e}else _o=1<<g|o<<p|l,So=e}function Yu(e){e.return!==null&&(ki(e,1),pd(e,1,0))}function Xu(e){for(;e===ll;)ll=cs[--fs],cs[fs]=null,ul=cs[--fs],cs[fs]=null;for(;e===bi;)bi=cr[--fr],cr[fr]=null,So=cr[--fr],cr[fr]=null,_o=cr[--fr],cr[fr]=null}var Qn=null,Gn=null,It=!1,Er=null;function hd(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 md(e,n){switch(e.tag){case 5:var o=e.type;return n=n.nodeType!==1||o.toLowerCase()!==n.nodeName.toLowerCase()?null:n,n!==null?(e.stateNode=n,Qn=e,Gn=Wo(n.firstChild),!0):!1;case 6:return n=e.pendingProps===""||n.nodeType!==3?null:n,n!==null?(e.stateNode=n,Qn=e,Gn=null,!0):!1;case 13:return n=n.nodeType!==8?null:n,n!==null?(o=bi!==null?{id:_o,overflow:So}:null,e.memoizedState={dehydrated:n,treeContext:o,retryLane:1073741824},o=mr(18,null,null,0),o.stateNode=n,o.return=e,e.child=o,Qn=e,Gn=null,!0):!1;default:return!1}}function Qu(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Gu(e){if(It){var n=Gn;if(n){var o=n;if(!md(e,n)){if(Qu(e))throw Error(i(418));n=Wo(o.nextSibling);var l=Qn;n&&md(e,n)?hd(l,o):(e.flags=e.flags&-4097|2,It=!1,Qn=e)}}else{if(Qu(e))throw Error(i(418));e.flags=e.flags&-4097|2,It=!1,Qn=e}}}function gd(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Qn=e}function cl(e){if(e!==Qn)return!1;if(!It)return gd(e),It=!0,!1;var n;if((n=e.tag!==3)&&!(n=e.tag!==5)&&(n=e.type,n=n!=="head"&&n!=="body"&&!Hu(e.type,e.memoizedProps)),n&&(n=Gn)){if(Qu(e))throw yd(),Error(i(418));for(;n;)hd(e,n),n=Wo(n.nextSibling)}if(gd(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(317));e:{for(e=e.nextSibling,n=0;e;){if(e.nodeType===8){var o=e.data;if(o==="/$"){if(n===0){Gn=Wo(e.nextSibling);break e}n--}else o!=="$"&&o!=="$!"&&o!=="$?"||n++}e=e.nextSibling}Gn=null}}else Gn=Qn?Wo(e.stateNode.nextSibling):null;return!0}function yd(){for(var e=Gn;e;)e=Wo(e.nextSibling)}function ds(){Gn=Qn=null,It=!1}function Zu(e){Er===null?Er=[e]:Er.push(e)}var my=R.ReactCurrentBatchConfig;function na(e,n,o){if(e=o.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(o._owner){if(o=o._owner,o){if(o.tag!==1)throw Error(i(309));var l=o.stateNode}if(!l)throw Error(i(147,e));var p=l,g=""+e;return n!==null&&n.ref!==null&&typeof n.ref=="function"&&n.ref._stringRef===g?n.ref:(n=function(E){var D=p.refs;E===null?delete D[g]:D[g]=E},n._stringRef=g,n)}if(typeof e!="string")throw Error(i(284));if(!o._owner)throw Error(i(290,e))}return e}function fl(e,n){throw e=Object.prototype.toString.call(n),Error(i(31,e==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":e))}function vd(e){var n=e._init;return n(e._payload)}function xd(e){function n(de,ee){if(e){var me=de.deletions;me===null?(de.deletions=[ee],de.flags|=16):me.push(ee)}}function o(de,ee){if(!e)return null;for(;ee!==null;)n(de,ee),ee=ee.sibling;return null}function l(de,ee){for(de=new Map;ee!==null;)ee.key!==null?de.set(ee.key,ee):de.set(ee.index,ee),ee=ee.sibling;return de}function p(de,ee){return de=oi(de,ee),de.index=0,de.sibling=null,de}function g(de,ee,me){return de.index=me,e?(me=de.alternate,me!==null?(me=me.index,me<ee?(de.flags|=2,ee):me):(de.flags|=2,ee)):(de.flags|=1048576,ee)}function E(de){return e&&de.alternate===null&&(de.flags|=2),de}function D(de,ee,me,De){return ee===null||ee.tag!==6?(ee=Vc(me,de.mode,De),ee.return=de,ee):(ee=p(ee,me),ee.return=de,ee)}function U(de,ee,me,De){var Ge=me.type;return Ge===q?je(de,ee,me.props.children,De,me.key):ee!==null&&(ee.elementType===Ge||typeof Ge=="object"&&Ge!==null&&Ge.$$typeof===te&&vd(Ge)===ee.type)?(De=p(ee,me.props),De.ref=na(de,ee,me),De.return=de,De):(De=Ol(me.type,me.key,me.props,null,de.mode,De),De.ref=na(de,ee,me),De.return=de,De)}function ye(de,ee,me,De){return ee===null||ee.tag!==4||ee.stateNode.containerInfo!==me.containerInfo||ee.stateNode.implementation!==me.implementation?(ee=Kc(me,de.mode,De),ee.return=de,ee):(ee=p(ee,me.children||[]),ee.return=de,ee)}function je(de,ee,me,De,Ge){return ee===null||ee.tag!==7?(ee=Ii(me,de.mode,De,Ge),ee.return=de,ee):(ee=p(ee,me),ee.return=de,ee)}function Me(de,ee,me){if(typeof ee=="string"&&ee!==""||typeof ee=="number")return ee=Vc(""+ee,de.mode,me),ee.return=de,ee;if(typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case W:return me=Ol(ee.type,ee.key,ee.props,null,de.mode,me),me.ref=na(de,null,ee),me.return=de,me;case V:return ee=Kc(ee,de.mode,me),ee.return=de,ee;case te:var De=ee._init;return Me(de,De(ee._payload),me)}if(Ft(ee)||F(ee))return ee=Ii(ee,de.mode,me,null),ee.return=de,ee;fl(de,ee)}return null}function Pe(de,ee,me,De){var Ge=ee!==null?ee.key:null;if(typeof me=="string"&&me!==""||typeof me=="number")return Ge!==null?null:D(de,ee,""+me,De);if(typeof me=="object"&&me!==null){switch(me.$$typeof){case W:return me.key===Ge?U(de,ee,me,De):null;case V:return me.key===Ge?ye(de,ee,me,De):null;case te:return Ge=me._init,Pe(de,ee,Ge(me._payload),De)}if(Ft(me)||F(me))return Ge!==null?null:je(de,ee,me,De,null);fl(de,me)}return null}function Ke(de,ee,me,De,Ge){if(typeof De=="string"&&De!==""||typeof De=="number")return de=de.get(me)||null,D(ee,de,""+De,Ge);if(typeof De=="object"&&De!==null){switch(De.$$typeof){case W:return de=de.get(De.key===null?me:De.key)||null,U(ee,de,De,Ge);case V:return de=de.get(De.key===null?me:De.key)||null,ye(ee,de,De,Ge);case te:var tt=De._init;return Ke(de,ee,me,tt(De._payload),Ge)}if(Ft(De)||F(De))return de=de.get(me)||null,je(ee,de,De,Ge,null);fl(ee,De)}return null}function Xe(de,ee,me,De){for(var Ge=null,tt=null,nt=ee,it=ee=0,tn=null;nt!==null&&it<me.length;it++){nt.index>it?(tn=nt,nt=null):tn=nt.sibling;var _t=Pe(de,nt,me[it],De);if(_t===null){nt===null&&(nt=tn);break}e&&nt&&_t.alternate===null&&n(de,nt),ee=g(_t,ee,it),tt===null?Ge=_t:tt.sibling=_t,tt=_t,nt=tn}if(it===me.length)return o(de,nt),It&&ki(de,it),Ge;if(nt===null){for(;it<me.length;it++)nt=Me(de,me[it],De),nt!==null&&(ee=g(nt,ee,it),tt===null?Ge=nt:tt.sibling=nt,tt=nt);return It&&ki(de,it),Ge}for(nt=l(de,nt);it<me.length;it++)tn=Ke(nt,de,it,me[it],De),tn!==null&&(e&&tn.alternate!==null&&nt.delete(tn.key===null?it:tn.key),ee=g(tn,ee,it),tt===null?Ge=tn:tt.sibling=tn,tt=tn);return e&&nt.forEach(function(ii){return n(de,ii)}),It&&ki(de,it),Ge}function Qe(de,ee,me,De){var Ge=F(me);if(typeof Ge!="function")throw Error(i(150));if(me=Ge.call(me),me==null)throw Error(i(151));for(var tt=Ge=null,nt=ee,it=ee=0,tn=null,_t=me.next();nt!==null&&!_t.done;it++,_t=me.next()){nt.index>it?(tn=nt,nt=null):tn=nt.sibling;var ii=Pe(de,nt,_t.value,De);if(ii===null){nt===null&&(nt=tn);break}e&&nt&&ii.alternate===null&&n(de,nt),ee=g(ii,ee,it),tt===null?Ge=ii:tt.sibling=ii,tt=ii,nt=tn}if(_t.done)return o(de,nt),It&&ki(de,it),Ge;if(nt===null){for(;!_t.done;it++,_t=me.next())_t=Me(de,_t.value,De),_t!==null&&(ee=g(_t,ee,it),tt===null?Ge=_t:tt.sibling=_t,tt=_t);return It&&ki(de,it),Ge}for(nt=l(de,nt);!_t.done;it++,_t=me.next())_t=Ke(nt,de,it,_t.value,De),_t!==null&&(e&&_t.alternate!==null&&nt.delete(_t.key===null?it:_t.key),ee=g(_t,ee,it),tt===null?Ge=_t:tt.sibling=_t,tt=_t);return e&&nt.forEach(function(Yy){return n(de,Yy)}),It&&ki(de,it),Ge}function Bt(de,ee,me,De){if(typeof me=="object"&&me!==null&&me.type===q&&me.key===null&&(me=me.props.children),typeof me=="object"&&me!==null){switch(me.$$typeof){case W:e:{for(var Ge=me.key,tt=ee;tt!==null;){if(tt.key===Ge){if(Ge=me.type,Ge===q){if(tt.tag===7){o(de,tt.sibling),ee=p(tt,me.props.children),ee.return=de,de=ee;break e}}else if(tt.elementType===Ge||typeof Ge=="object"&&Ge!==null&&Ge.$$typeof===te&&vd(Ge)===tt.type){o(de,tt.sibling),ee=p(tt,me.props),ee.ref=na(de,tt,me),ee.return=de,de=ee;break e}o(de,tt);break}else n(de,tt);tt=tt.sibling}me.type===q?(ee=Ii(me.props.children,de.mode,De,me.key),ee.return=de,de=ee):(De=Ol(me.type,me.key,me.props,null,de.mode,De),De.ref=na(de,ee,me),De.return=de,de=De)}return E(de);case V:e:{for(tt=me.key;ee!==null;){if(ee.key===tt)if(ee.tag===4&&ee.stateNode.containerInfo===me.containerInfo&&ee.stateNode.implementation===me.implementation){o(de,ee.sibling),ee=p(ee,me.children||[]),ee.return=de,de=ee;break e}else{o(de,ee);break}else n(de,ee);ee=ee.sibling}ee=Kc(me,de.mode,De),ee.return=de,de=ee}return E(de);case te:return tt=me._init,Bt(de,ee,tt(me._payload),De)}if(Ft(me))return Xe(de,ee,me,De);if(F(me))return Qe(de,ee,me,De);fl(de,me)}return typeof me=="string"&&me!==""||typeof me=="number"?(me=""+me,ee!==null&&ee.tag===6?(o(de,ee.sibling),ee=p(ee,me),ee.return=de,de=ee):(o(de,ee),ee=Vc(me,de.mode,De),ee.return=de,de=ee),E(de)):o(de,ee)}return Bt}var ps=xd(!0),wd=xd(!1),dl=Yo(null),pl=null,hs=null,Ju=null;function ec(){Ju=hs=pl=null}function tc(e){var n=dl.current;jt(dl),e._currentValue=n}function nc(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 ms(e,n){pl=e,Ju=hs=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&n)!==0&&(Dn=!0),e.firstContext=null)}function dr(e){var n=e._currentValue;if(Ju!==e)if(e={context:e,memoizedValue:n,next:null},hs===null){if(pl===null)throw Error(i(308));hs=e,pl.dependencies={lanes:0,firstContext:e}}else hs=hs.next=e;return n}var Ei=null;function rc(e){Ei===null?Ei=[e]:Ei.push(e)}function _d(e,n,o,l){var p=n.interleaved;return p===null?(o.next=o,rc(n)):(o.next=p.next,p.next=o),n.interleaved=o,bo(e,l)}function bo(e,n){e.lanes|=n;var o=e.alternate;for(o!==null&&(o.lanes|=n),o=e,e=e.return;e!==null;)e.childLanes|=n,o=e.alternate,o!==null&&(o.childLanes|=n),o=e,e=e.return;return o.tag===3?o.stateNode:null}var Go=!1;function oc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Sd(e,n){e=e.updateQueue,n.updateQueue===e&&(n.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function ko(e,n){return{eventTime:e,lane:n,tag:0,payload:null,callback:null,next:null}}function Zo(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,bo(e,o)}return p=l.interleaved,p===null?(n.next=n,rc(l)):(n.next=p.next,p.next=n),l.interleaved=n,bo(e,o)}function hl(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,Ro(e,o)}}function bd(e,n){var o=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,o===l)){var p=null,g=null;if(o=o.firstBaseUpdate,o!==null){do{var E={eventTime:o.eventTime,lane:o.lane,tag:o.tag,payload:o.payload,callback:o.callback,next:null};g===null?p=g=E:g=g.next=E,o=o.next}while(o!==null);g===null?p=g=n:g=g.next=n}else p=g=n;o={baseState:l.baseState,firstBaseUpdate:p,lastBaseUpdate:g,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 ml(e,n,o,l){var p=e.updateQueue;Go=!1;var g=p.firstBaseUpdate,E=p.lastBaseUpdate,D=p.shared.pending;if(D!==null){p.shared.pending=null;var U=D,ye=U.next;U.next=null,E===null?g=ye:E.next=ye,E=U;var je=e.alternate;je!==null&&(je=je.updateQueue,D=je.lastBaseUpdate,D!==E&&(D===null?je.firstBaseUpdate=ye:D.next=ye,je.lastBaseUpdate=U))}if(g!==null){var Me=p.baseState;E=0,je=ye=U=null,D=g;do{var Pe=D.lane,Ke=D.eventTime;if((l&Pe)===Pe){je!==null&&(je=je.next={eventTime:Ke,lane:0,tag:D.tag,payload:D.payload,callback:D.callback,next:null});e:{var Xe=e,Qe=D;switch(Pe=n,Ke=o,Qe.tag){case 1:if(Xe=Qe.payload,typeof Xe=="function"){Me=Xe.call(Ke,Me,Pe);break e}Me=Xe;break e;case 3:Xe.flags=Xe.flags&-65537|128;case 0:if(Xe=Qe.payload,Pe=typeof Xe=="function"?Xe.call(Ke,Me,Pe):Xe,Pe==null)break e;Me=X({},Me,Pe);break e;case 2:Go=!0}}D.callback!==null&&D.lane!==0&&(e.flags|=64,Pe=p.effects,Pe===null?p.effects=[D]:Pe.push(D))}else Ke={eventTime:Ke,lane:Pe,tag:D.tag,payload:D.payload,callback:D.callback,next:null},je===null?(ye=je=Ke,U=Me):je=je.next=Ke,E|=Pe;if(D=D.next,D===null){if(D=p.shared.pending,D===null)break;Pe=D,D=Pe.next,Pe.next=null,p.lastBaseUpdate=Pe,p.shared.pending=null}}while(!0);if(je===null&&(U=Me),p.baseState=U,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 g===null&&(p.shared.lanes=0);Pi|=E,e.lanes=E,e.memoizedState=Me}}function kd(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 ra={},Ur=Yo(ra),oa=Yo(ra),ia=Yo(ra);function Ni(e){if(e===ra)throw Error(i(174));return e}function ic(e,n){switch(kt(ia,n),kt(oa,e),kt(Ur,ra),e=n.nodeType,e){case 9:case 11:n=(n=n.documentElement)?n.namespaceURI:Ht(null,"");break;default:e=e===8?n.parentNode:n,n=e.namespaceURI||null,e=e.tagName,n=Ht(n,e)}jt(Ur),kt(Ur,n)}function gs(){jt(Ur),jt(oa),jt(ia)}function Ed(e){Ni(ia.current);var n=Ni(Ur.current),o=Ht(n,e.type);n!==o&&(kt(oa,e),kt(Ur,o))}function sc(e){oa.current===e&&(jt(Ur),jt(oa))}var Ot=Yo(0);function gl(e){for(var n=e;n!==null;){if(n.tag===13){var o=n.memoizedState;if(o!==null&&(o=o.dehydrated,o===null||o.data==="$?"||o.data==="$!"))return n}else if(n.tag===19&&n.memoizedProps.revealOrder!==void 0){if((n.flags&128)!==0)return n}else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}var ac=[];function lc(){for(var e=0;e<ac.length;e++)ac[e]._workInProgressVersionPrimary=null;ac.length=0}var yl=R.ReactCurrentDispatcher,uc=R.ReactCurrentBatchConfig,Ci=0,Rt=null,Xt=null,Jt=null,vl=!1,sa=!1,aa=0,gy=0;function gn(){throw Error(i(321))}function cc(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 fc(e,n,o,l,p,g){if(Ci=g,Rt=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,yl.current=e===null||e.memoizedState===null?wy:_y,e=o(l,p),sa){g=0;do{if(sa=!1,aa=0,25<=g)throw Error(i(301));g+=1,Jt=Xt=null,n.updateQueue=null,yl.current=Sy,e=o(l,p)}while(sa)}if(yl.current=_l,n=Xt!==null&&Xt.next!==null,Ci=0,Jt=Xt=Rt=null,vl=!1,n)throw Error(i(300));return e}function dc(){var e=aa!==0;return aa=0,e}function qr(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Jt===null?Rt.memoizedState=Jt=e:Jt=Jt.next=e,Jt}function pr(){if(Xt===null){var e=Rt.alternate;e=e!==null?e.memoizedState:null}else e=Xt.next;var n=Jt===null?Rt.memoizedState:Jt.next;if(n!==null)Jt=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},Jt===null?Rt.memoizedState=Jt=e:Jt=Jt.next=e}return Jt}function la(e,n){return typeof n=="function"?n(e):n}function pc(e){var n=pr(),o=n.queue;if(o===null)throw Error(i(311));o.lastRenderedReducer=e;var l=Xt,p=l.baseQueue,g=o.pending;if(g!==null){if(p!==null){var E=p.next;p.next=g.next,g.next=E}l.baseQueue=p=g,o.pending=null}if(p!==null){g=p.next,l=l.baseState;var D=E=null,U=null,ye=g;do{var je=ye.lane;if((Ci&je)===je)U!==null&&(U=U.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 Me={lane:je,action:ye.action,hasEagerState:ye.hasEagerState,eagerState:ye.eagerState,next:null};U===null?(D=U=Me,E=l):U=U.next=Me,Rt.lanes|=je,Pi|=je}ye=ye.next}while(ye!==null&&ye!==g);U===null?E=l:U.next=D,se(l,n.memoizedState)||(Dn=!0),n.memoizedState=l,n.baseState=E,n.baseQueue=U,o.lastRenderedState=l}if(e=o.interleaved,e!==null){p=e;do g=p.lane,Rt.lanes|=g,Pi|=g,p=p.next;while(p!==e)}else p===null&&(o.lanes=0);return[n.memoizedState,o.dispatch]}function hc(e){var n=pr(),o=n.queue;if(o===null)throw Error(i(311));o.lastRenderedReducer=e;var l=o.dispatch,p=o.pending,g=n.memoizedState;if(p!==null){o.pending=null;var E=p=p.next;do g=e(g,E.action),E=E.next;while(E!==p);se(g,n.memoizedState)||(Dn=!0),n.memoizedState=g,n.baseQueue===null&&(n.baseState=g),o.lastRenderedState=g}return[g,l]}function Nd(){}function Cd(e,n){var o=Rt,l=pr(),p=n(),g=!se(l.memoizedState,p);if(g&&(l.memoizedState=p,Dn=!0),l=l.queue,mc(Td.bind(null,o,l,e),[e]),l.getSnapshot!==n||g||Jt!==null&&Jt.memoizedState.tag&1){if(o.flags|=2048,ua(9,jd.bind(null,o,l,p,n),void 0,null),en===null)throw Error(i(349));(Ci&30)!==0||Pd(o,n,p)}return p}function Pd(e,n,o){e.flags|=16384,e={getSnapshot:n,value:o},n=Rt.updateQueue,n===null?(n={lastEffect:null,stores:null},Rt.updateQueue=n,n.stores=[e]):(o=n.stores,o===null?n.stores=[e]:o.push(e))}function jd(e,n,o,l){n.value=o,n.getSnapshot=l,Md(n)&&Id(e)}function Td(e,n,o){return o(function(){Md(n)&&Id(e)})}function Md(e){var n=e.getSnapshot;e=e.value;try{var o=n();return!se(e,o)}catch{return!0}}function Id(e){var n=bo(e,1);n!==null&&jr(n,e,1,-1)}function Ad(e){var n=qr();return typeof e=="function"&&(e=e()),n.memoizedState=n.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:la,lastRenderedState:e},n.queue=e,e=e.dispatch=xy.bind(null,Rt,e),[n.memoizedState,e]}function ua(e,n,o,l){return e={tag:e,create:n,destroy:o,deps:l,next:null},n=Rt.updateQueue,n===null?(n={lastEffect:null,stores:null},Rt.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 $d(){return pr().memoizedState}function xl(e,n,o,l){var p=qr();Rt.flags|=e,p.memoizedState=ua(1|n,o,void 0,l===void 0?null:l)}function wl(e,n,o,l){var p=pr();l=l===void 0?null:l;var g=void 0;if(Xt!==null){var E=Xt.memoizedState;if(g=E.destroy,l!==null&&cc(l,E.deps)){p.memoizedState=ua(n,o,g,l);return}}Rt.flags|=e,p.memoizedState=ua(1|n,o,g,l)}function Od(e,n){return xl(8390656,8,e,n)}function mc(e,n){return wl(2048,8,e,n)}function Rd(e,n){return wl(4,2,e,n)}function Dd(e,n){return wl(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 Ld(e,n,o){return o=o!=null?o.concat([e]):null,wl(4,4,zd.bind(null,n,e),o)}function gc(){}function Fd(e,n){var o=pr();n=n===void 0?null:n;var l=o.memoizedState;return l!==null&&n!==null&&cc(n,l[1])?l[0]:(o.memoizedState=[e,n],e)}function Bd(e,n){var o=pr();n=n===void 0?null:n;var l=o.memoizedState;return l!==null&&n!==null&&cc(n,l[1])?l[0]:(e=e(),o.memoizedState=[e,n],e)}function Hd(e,n,o){return(Ci&21)===0?(e.baseState&&(e.baseState=!1,Dn=!0),e.memoizedState=o):(se(o,n)||(o=Fr(),Rt.lanes|=o,Pi|=o,e.baseState=!0),n)}function yy(e,n){var o=wt;wt=o!==0&&4>o?o:4,e(!0);var l=uc.transition;uc.transition={};try{e(!1),n()}finally{wt=o,uc.transition=l}}function Vd(){return pr().memoizedState}function vy(e,n,o){var l=ni(e);if(o={lane:l,action:o,hasEagerState:!1,eagerState:null,next:null},Kd(e))Ud(n,o);else if(o=_d(e,n,o,l),o!==null){var p=Cn();jr(o,e,l,p),qd(o,n,l)}}function xy(e,n,o){var l=ni(e),p={lane:l,action:o,hasEagerState:!1,eagerState:null,next:null};if(Kd(e))Ud(n,p);else{var g=e.alternate;if(e.lanes===0&&(g===null||g.lanes===0)&&(g=n.lastRenderedReducer,g!==null))try{var E=n.lastRenderedState,D=g(E,o);if(p.hasEagerState=!0,p.eagerState=D,se(D,E)){var U=n.interleaved;U===null?(p.next=p,rc(n)):(p.next=U.next,U.next=p),n.interleaved=p;return}}catch{}finally{}o=_d(e,n,p,l),o!==null&&(p=Cn(),jr(o,e,l,p),qd(o,n,l))}}function Kd(e){var n=e.alternate;return e===Rt||n!==null&&n===Rt}function Ud(e,n){sa=vl=!0;var o=e.pending;o===null?n.next=n:(n.next=o.next,o.next=n),e.pending=n}function qd(e,n,o){if((o&4194240)!==0){var l=n.lanes;l&=e.pendingLanes,o|=l,n.lanes=o,Ro(e,o)}}var _l={readContext:dr,useCallback:gn,useContext:gn,useEffect:gn,useImperativeHandle:gn,useInsertionEffect:gn,useLayoutEffect:gn,useMemo:gn,useReducer:gn,useRef:gn,useState:gn,useDebugValue:gn,useDeferredValue:gn,useTransition:gn,useMutableSource:gn,useSyncExternalStore:gn,useId:gn,unstable_isNewReconciler:!1},wy={readContext:dr,useCallback:function(e,n){return qr().memoizedState=[e,n===void 0?null:n],e},useContext:dr,useEffect:Od,useImperativeHandle:function(e,n,o){return o=o!=null?o.concat([e]):null,xl(4194308,4,zd.bind(null,n,e),o)},useLayoutEffect:function(e,n){return xl(4194308,4,e,n)},useInsertionEffect:function(e,n){return xl(4,2,e,n)},useMemo:function(e,n){var o=qr();return n=n===void 0?null:n,e=e(),o.memoizedState=[e,n],e},useReducer:function(e,n,o){var l=qr();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=vy.bind(null,Rt,e),[l.memoizedState,e]},useRef:function(e){var n=qr();return e={current:e},n.memoizedState=e},useState:Ad,useDebugValue:gc,useDeferredValue:function(e){return qr().memoizedState=e},useTransition:function(){var e=Ad(!1),n=e[0];return e=yy.bind(null,e[1]),qr().memoizedState=e,[n,e]},useMutableSource:function(){},useSyncExternalStore:function(e,n,o){var l=Rt,p=qr();if(It){if(o===void 0)throw Error(i(407));o=o()}else{if(o=n(),en===null)throw Error(i(349));(Ci&30)!==0||Pd(l,n,o)}p.memoizedState=o;var g={value:o,getSnapshot:n};return p.queue=g,Od(Td.bind(null,l,g,e),[e]),l.flags|=2048,ua(9,jd.bind(null,l,g,o,n),void 0,null),o},useId:function(){var e=qr(),n=en.identifierPrefix;if(It){var o=So,l=_o;o=(l&~(1<<32-dn(l)-1)).toString(32)+o,n=":"+n+"R"+o,o=aa++,0<o&&(n+="H"+o.toString(32)),n+=":"}else o=gy++,n=":"+n+"r"+o.toString(32)+":";return e.memoizedState=n},unstable_isNewReconciler:!1},_y={readContext:dr,useCallback:Fd,useContext:dr,useEffect:mc,useImperativeHandle:Ld,useInsertionEffect:Rd,useLayoutEffect:Dd,useMemo:Bd,useReducer:pc,useRef:$d,useState:function(){return pc(la)},useDebugValue:gc,useDeferredValue:function(e){var n=pr();return Hd(n,Xt.memoizedState,e)},useTransition:function(){var e=pc(la)[0],n=pr().memoizedState;return[e,n]},useMutableSource:Nd,useSyncExternalStore:Cd,useId:Vd,unstable_isNewReconciler:!1},Sy={readContext:dr,useCallback:Fd,useContext:dr,useEffect:mc,useImperativeHandle:Ld,useInsertionEffect:Rd,useLayoutEffect:Dd,useMemo:Bd,useReducer:hc,useRef:$d,useState:function(){return hc(la)},useDebugValue:gc,useDeferredValue:function(e){var n=pr();return Xt===null?n.memoizedState=e:Hd(n,Xt.memoizedState,e)},useTransition:function(){var e=hc(la)[0],n=pr().memoizedState;return[e,n]},useMutableSource:Nd,useSyncExternalStore:Cd,useId:Vd,unstable_isNewReconciler:!1};function Nr(e,n){if(e&&e.defaultProps){n=X({},n),e=e.defaultProps;for(var o in e)n[o]===void 0&&(n[o]=e[o]);return n}return n}function yc(e,n,o,l){n=e.memoizedState,o=o(l,n),o=o==null?n:X({},n,o),e.memoizedState=o,e.lanes===0&&(e.updateQueue.baseState=o)}var Sl={isMounted:function(e){return(e=e._reactInternals)?Dt(e)===e:!1},enqueueSetState:function(e,n,o){e=e._reactInternals;var l=Cn(),p=ni(e),g=ko(l,p);g.payload=n,o!=null&&(g.callback=o),n=Zo(e,g,p),n!==null&&(jr(n,e,p,l),hl(n,e,p))},enqueueReplaceState:function(e,n,o){e=e._reactInternals;var l=Cn(),p=ni(e),g=ko(l,p);g.tag=1,g.payload=n,o!=null&&(g.callback=o),n=Zo(e,g,p),n!==null&&(jr(n,e,p,l),hl(n,e,p))},enqueueForceUpdate:function(e,n){e=e._reactInternals;var o=Cn(),l=ni(e),p=ko(o,l);p.tag=2,n!=null&&(p.callback=n),n=Zo(e,p,l),n!==null&&(jr(n,e,l,o),hl(n,e,l))}};function Wd(e,n,o,l,p,g,E){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,g,E):n.prototype&&n.prototype.isPureReactComponent?!J(o,l)||!J(p,g):!0}function Yd(e,n,o){var l=!1,p=Xo,g=n.contextType;return typeof g=="object"&&g!==null?g=dr(g):(p=Rn(n)?Si:mn.current,l=n.contextTypes,g=(l=l!=null)?us(e,p):Xo),n=new n(o,g),e.memoizedState=n.state!==null&&n.state!==void 0?n.state:null,n.updater=Sl,e.stateNode=n,n._reactInternals=e,l&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=p,e.__reactInternalMemoizedMaskedChildContext=g),n}function Xd(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&&Sl.enqueueReplaceState(n,n.state,null)}function vc(e,n,o,l){var p=e.stateNode;p.props=o,p.state=e.memoizedState,p.refs={},oc(e);var g=n.contextType;typeof g=="object"&&g!==null?p.context=dr(g):(g=Rn(n)?Si:mn.current,p.context=us(e,g)),p.state=e.memoizedState,g=n.getDerivedStateFromProps,typeof g=="function"&&(yc(e,n,g,o),p.state=e.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof p.getSnapshotBeforeUpdate=="function"||typeof p.UNSAFE_componentWillMount!="function"&&typeof p.componentWillMount!="function"||(n=p.state,typeof p.componentWillMount=="function"&&p.componentWillMount(),typeof p.UNSAFE_componentWillMount=="function"&&p.UNSAFE_componentWillMount(),n!==p.state&&Sl.enqueueReplaceState(p,p.state,null),ml(e,o,p,l),p.state=e.memoizedState),typeof p.componentDidMount=="function"&&(e.flags|=4194308)}function ys(e,n){try{var o="",l=n;do o+=Ie(l),l=l.return;while(l);var p=o}catch(g){p=`
39
+ Error generating stack: `+g.message+`
40
+ `+g.stack}return{value:e,source:n,stack:p,digest:null}}function xc(e,n,o){return{value:e,source:null,stack:o??null,digest:n??null}}function wc(e,n){try{console.error(n.value)}catch(o){setTimeout(function(){throw o})}}var by=typeof WeakMap=="function"?WeakMap:Map;function Qd(e,n,o){o=ko(-1,o),o.tag=3,o.payload={element:null};var l=n.value;return o.callback=function(){jl||(jl=!0,Oc=l),wc(e,n)},o}function Gd(e,n,o){o=ko(-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(){wc(e,n)}}var g=e.stateNode;return g!==null&&typeof g.componentDidCatch=="function"&&(o.callback=function(){wc(e,n),typeof l!="function"&&(ei===null?ei=new Set([this]):ei.add(this));var E=n.stack;this.componentDidCatch(n.value,{componentStack:E!==null?E:""})}),o}function Zd(e,n,o){var l=e.pingCache;if(l===null){l=e.pingCache=new by;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=Dy.bind(null,e,n,o),n.then(e,e))}function Jd(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 ep(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=ko(-1,1),n.tag=2,Zo(o,n,1))),o.lanes|=1),e):(e.flags|=65536,e.lanes=p,e)}var ky=R.ReactCurrentOwner,Dn=!1;function Nn(e,n,o,l){n.child=e===null?wd(n,null,o,l):ps(n,e.child,o,l)}function tp(e,n,o,l,p){o=o.render;var g=n.ref;return ms(n,p),l=fc(e,n,o,l,g,p),o=dc(),e!==null&&!Dn?(n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~p,Eo(e,n,p)):(It&&o&&Yu(n),n.flags|=1,Nn(e,n,l,p),n.child)}function np(e,n,o,l,p){if(e===null){var g=o.type;return typeof g=="function"&&!Hc(g)&&g.defaultProps===void 0&&o.compare===null&&o.defaultProps===void 0?(n.tag=15,n.type=g,rp(e,n,g,l,p)):(e=Ol(o.type,null,l,n,n.mode,p),e.ref=n.ref,e.return=n,n.child=e)}if(g=e.child,(e.lanes&p)===0){var E=g.memoizedProps;if(o=o.compare,o=o!==null?o:J,o(E,l)&&e.ref===n.ref)return Eo(e,n,p)}return n.flags|=1,e=oi(g,l),e.ref=n.ref,e.return=n,n.child=e}function rp(e,n,o,l,p){if(e!==null){var g=e.memoizedProps;if(J(g,l)&&e.ref===n.ref)if(Dn=!1,n.pendingProps=l=g,(e.lanes&p)!==0)(e.flags&131072)!==0&&(Dn=!0);else return n.lanes=e.lanes,Eo(e,n,p)}return _c(e,n,o,l,p)}function op(e,n,o){var l=n.pendingProps,p=l.children,g=e!==null?e.memoizedState:null;if(l.mode==="hidden")if((n.mode&1)===0)n.memoizedState={baseLanes:0,cachePool:null,transitions:null},kt(xs,Zn),Zn|=o;else{if((o&1073741824)===0)return e=g!==null?g.baseLanes|o:o,n.lanes=n.childLanes=1073741824,n.memoizedState={baseLanes:e,cachePool:null,transitions:null},n.updateQueue=null,kt(xs,Zn),Zn|=e,null;n.memoizedState={baseLanes:0,cachePool:null,transitions:null},l=g!==null?g.baseLanes:o,kt(xs,Zn),Zn|=l}else g!==null?(l=g.baseLanes|o,n.memoizedState=null):l=o,kt(xs,Zn),Zn|=l;return Nn(e,n,p,o),n.child}function ip(e,n){var o=n.ref;(e===null&&o!==null||e!==null&&e.ref!==o)&&(n.flags|=512,n.flags|=2097152)}function _c(e,n,o,l,p){var g=Rn(o)?Si:mn.current;return g=us(n,g),ms(n,p),o=fc(e,n,o,l,g,p),l=dc(),e!==null&&!Dn?(n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~p,Eo(e,n,p)):(It&&l&&Yu(n),n.flags|=1,Nn(e,n,o,p),n.child)}function sp(e,n,o,l,p){if(Rn(o)){var g=!0;sl(n)}else g=!1;if(ms(n,p),n.stateNode===null)kl(e,n),Yd(n,o,l),vc(n,o,l,p),l=!0;else if(e===null){var E=n.stateNode,D=n.memoizedProps;E.props=D;var U=E.context,ye=o.contextType;typeof ye=="object"&&ye!==null?ye=dr(ye):(ye=Rn(o)?Si:mn.current,ye=us(n,ye));var je=o.getDerivedStateFromProps,Me=typeof je=="function"||typeof E.getSnapshotBeforeUpdate=="function";Me||typeof E.UNSAFE_componentWillReceiveProps!="function"&&typeof E.componentWillReceiveProps!="function"||(D!==l||U!==ye)&&Xd(n,E,l,ye),Go=!1;var Pe=n.memoizedState;E.state=Pe,ml(n,l,E,p),U=n.memoizedState,D!==l||Pe!==U||On.current||Go?(typeof je=="function"&&(yc(n,o,je,l),U=n.memoizedState),(D=Go||Wd(n,o,D,l,Pe,U,ye))?(Me||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=U),E.props=l,E.state=U,E.context=ye,l=D):(typeof E.componentDidMount=="function"&&(n.flags|=4194308),l=!1)}else{E=n.stateNode,Sd(e,n),D=n.memoizedProps,ye=n.type===n.elementType?D:Nr(n.type,D),E.props=ye,Me=n.pendingProps,Pe=E.context,U=o.contextType,typeof U=="object"&&U!==null?U=dr(U):(U=Rn(o)?Si:mn.current,U=us(n,U));var Ke=o.getDerivedStateFromProps;(je=typeof Ke=="function"||typeof E.getSnapshotBeforeUpdate=="function")||typeof E.UNSAFE_componentWillReceiveProps!="function"&&typeof E.componentWillReceiveProps!="function"||(D!==Me||Pe!==U)&&Xd(n,E,l,U),Go=!1,Pe=n.memoizedState,E.state=Pe,ml(n,l,E,p);var Xe=n.memoizedState;D!==Me||Pe!==Xe||On.current||Go?(typeof Ke=="function"&&(yc(n,o,Ke,l),Xe=n.memoizedState),(ye=Go||Wd(n,o,ye,l,Pe,Xe,U)||!1)?(je||typeof E.UNSAFE_componentWillUpdate!="function"&&typeof E.componentWillUpdate!="function"||(typeof E.componentWillUpdate=="function"&&E.componentWillUpdate(l,Xe,U),typeof E.UNSAFE_componentWillUpdate=="function"&&E.UNSAFE_componentWillUpdate(l,Xe,U)),typeof E.componentDidUpdate=="function"&&(n.flags|=4),typeof E.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof E.componentDidUpdate!="function"||D===e.memoizedProps&&Pe===e.memoizedState||(n.flags|=4),typeof E.getSnapshotBeforeUpdate!="function"||D===e.memoizedProps&&Pe===e.memoizedState||(n.flags|=1024),n.memoizedProps=l,n.memoizedState=Xe),E.props=l,E.state=Xe,E.context=U,l=ye):(typeof E.componentDidUpdate!="function"||D===e.memoizedProps&&Pe===e.memoizedState||(n.flags|=4),typeof E.getSnapshotBeforeUpdate!="function"||D===e.memoizedProps&&Pe===e.memoizedState||(n.flags|=1024),l=!1)}return Sc(e,n,o,l,g,p)}function Sc(e,n,o,l,p,g){ip(e,n);var E=(n.flags&128)!==0;if(!l&&!E)return p&&fd(n,o,!1),Eo(e,n,g);l=n.stateNode,ky.current=n;var D=E&&typeof o.getDerivedStateFromError!="function"?null:l.render();return n.flags|=1,e!==null&&E?(n.child=ps(n,e.child,null,g),n.child=ps(n,null,D,g)):Nn(e,n,D,g),n.memoizedState=l.state,p&&fd(n,o,!0),n.child}function ap(e){var n=e.stateNode;n.pendingContext?ud(e,n.pendingContext,n.pendingContext!==n.context):n.context&&ud(e,n.context,!1),ic(e,n.containerInfo)}function lp(e,n,o,l,p){return ds(),Zu(p),n.flags|=256,Nn(e,n,o,l),n.child}var bc={dehydrated:null,treeContext:null,retryLane:0};function kc(e){return{baseLanes:e,cachePool:null,transitions:null}}function up(e,n,o){var l=n.pendingProps,p=Ot.current,g=!1,E=(n.flags&128)!==0,D;if((D=E)||(D=e!==null&&e.memoizedState===null?!1:(p&2)!==0),D?(g=!0,n.flags&=-129):(e===null||e.memoizedState!==null)&&(p|=1),kt(Ot,p&1),e===null)return Gu(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,g?(l=n.mode,g=n.child,E={mode:"hidden",children:E},(l&1)===0&&g!==null?(g.childLanes=0,g.pendingProps=E):g=Rl(E,l,0,null),e=Ii(e,l,o,null),g.return=n,e.return=n,g.sibling=e,n.child=g,n.child.memoizedState=kc(o),n.memoizedState=bc,e):Ec(n,E));if(p=e.memoizedState,p!==null&&(D=p.dehydrated,D!==null))return Ey(e,n,E,l,D,p,o);if(g){g=l.fallback,E=n.mode,p=e.child,D=p.sibling;var U={mode:"hidden",children:l.children};return(E&1)===0&&n.child!==p?(l=n.child,l.childLanes=0,l.pendingProps=U,n.deletions=null):(l=oi(p,U),l.subtreeFlags=p.subtreeFlags&14680064),D!==null?g=oi(D,g):(g=Ii(g,E,o,null),g.flags|=2),g.return=n,l.return=n,l.sibling=g,n.child=l,l=g,g=n.child,E=e.child.memoizedState,E=E===null?kc(o):{baseLanes:E.baseLanes|o,cachePool:null,transitions:E.transitions},g.memoizedState=E,g.childLanes=e.childLanes&~o,n.memoizedState=bc,l}return g=e.child,e=g.sibling,l=oi(g,{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 Ec(e,n){return n=Rl({mode:"visible",children:n},e.mode,0,null),n.return=e,e.child=n}function bl(e,n,o,l){return l!==null&&Zu(l),ps(n,e.child,null,o),e=Ec(n,n.pendingProps.children),e.flags|=2,n.memoizedState=null,e}function Ey(e,n,o,l,p,g,E){if(o)return n.flags&256?(n.flags&=-257,l=xc(Error(i(422))),bl(e,n,E,l)):n.memoizedState!==null?(n.child=e.child,n.flags|=128,null):(g=l.fallback,p=n.mode,l=Rl({mode:"visible",children:l.children},p,0,null),g=Ii(g,p,E,null),g.flags|=2,l.return=n,g.return=n,l.sibling=g,n.child=l,(n.mode&1)!==0&&ps(n,e.child,null,E),n.child.memoizedState=kc(E),n.memoizedState=bc,g);if((n.mode&1)===0)return bl(e,n,E,null);if(p.data==="$!"){if(l=p.nextSibling&&p.nextSibling.dataset,l)var D=l.dgst;return l=D,g=Error(i(419)),l=xc(g,l,void 0),bl(e,n,E,l)}if(D=(E&e.childLanes)!==0,Dn||D){if(l=en,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!==g.retryLane&&(g.retryLane=p,bo(e,p),jr(l,e,p,-1))}return Bc(),l=xc(Error(i(421))),bl(e,n,E,l)}return p.data==="$?"?(n.flags|=128,n.child=e.child,n=zy.bind(null,e),p._reactRetry=n,null):(e=g.treeContext,Gn=Wo(p.nextSibling),Qn=n,It=!0,Er=null,e!==null&&(cr[fr++]=_o,cr[fr++]=So,cr[fr++]=bi,_o=e.id,So=e.overflow,bi=n),n=Ec(n,l.children),n.flags|=4096,n)}function cp(e,n,o){e.lanes|=n;var l=e.alternate;l!==null&&(l.lanes|=n),nc(e.return,n,o)}function Nc(e,n,o,l,p){var g=e.memoizedState;g===null?e.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:l,tail:o,tailMode:p}:(g.isBackwards=n,g.rendering=null,g.renderingStartTime=0,g.last=l,g.tail=o,g.tailMode=p)}function fp(e,n,o){var l=n.pendingProps,p=l.revealOrder,g=l.tail;if(Nn(e,n,l.children,o),l=Ot.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&&cp(e,o,n);else if(e.tag===19)cp(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(kt(Ot,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&&gl(e)===null&&(p=o),o=o.sibling;o=p,o===null?(p=n.child,n.child=null):(p=o.sibling,o.sibling=null),Nc(n,!1,p,o,g);break;case"backwards":for(o=null,p=n.child,n.child=null;p!==null;){if(e=p.alternate,e!==null&&gl(e)===null){n.child=p;break}e=p.sibling,p.sibling=o,o=p,p=e}Nc(n,!0,o,null,g);break;case"together":Nc(n,!1,null,null,void 0);break;default:n.memoizedState=null}return n.child}function kl(e,n){(n.mode&1)===0&&e!==null&&(e.alternate=null,n.alternate=null,n.flags|=2)}function Eo(e,n,o){if(e!==null&&(n.dependencies=e.dependencies),Pi|=n.lanes,(o&n.childLanes)===0)return null;if(e!==null&&n.child!==e.child)throw Error(i(153));if(n.child!==null){for(e=n.child,o=oi(e,e.pendingProps),n.child=o,o.return=n;e.sibling!==null;)e=e.sibling,o=o.sibling=oi(e,e.pendingProps),o.return=n;o.sibling=null}return n.child}function Ny(e,n,o){switch(n.tag){case 3:ap(n),ds();break;case 5:Ed(n);break;case 1:Rn(n.type)&&sl(n);break;case 4:ic(n,n.stateNode.containerInfo);break;case 10:var l=n.type._context,p=n.memoizedProps.value;kt(dl,l._currentValue),l._currentValue=p;break;case 13:if(l=n.memoizedState,l!==null)return l.dehydrated!==null?(kt(Ot,Ot.current&1),n.flags|=128,null):(o&n.child.childLanes)!==0?up(e,n,o):(kt(Ot,Ot.current&1),e=Eo(e,n,o),e!==null?e.sibling:null);kt(Ot,Ot.current&1);break;case 19:if(l=(o&n.childLanes)!==0,(e.flags&128)!==0){if(l)return fp(e,n,o);n.flags|=128}if(p=n.memoizedState,p!==null&&(p.rendering=null,p.tail=null,p.lastEffect=null),kt(Ot,Ot.current),l)break;return null;case 22:case 23:return n.lanes=0,op(e,n,o)}return Eo(e,n,o)}var dp,Cc,pp,hp;dp=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}},Cc=function(){},pp=function(e,n,o,l){var p=e.memoizedProps;if(p!==l){e=n.stateNode,Ni(Ur.current);var g=null;switch(o){case"input":p=ut(e,p),l=ut(e,l),g=[];break;case"select":p=X({},p,{value:void 0}),l=X({},l,{value:void 0}),g=[];break;case"textarea":p=Pn(e,p),l=Pn(e,l),g=[];break;default:typeof p.onClick!="function"&&typeof l.onClick=="function"&&(e.onclick=rl)}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 D=p[ye];for(E in D)D.hasOwnProperty(E)&&(o||(o={}),o[E]="")}else ye!=="dangerouslySetInnerHTML"&&ye!=="children"&&ye!=="suppressContentEditableWarning"&&ye!=="suppressHydrationWarning"&&ye!=="autoFocus"&&(u.hasOwnProperty(ye)?g||(g=[]):(g=g||[]).push(ye,null));for(ye in l){var U=l[ye];if(D=p!=null?p[ye]:void 0,l.hasOwnProperty(ye)&&U!==D&&(U!=null||D!=null))if(ye==="style")if(D){for(E in D)!D.hasOwnProperty(E)||U&&U.hasOwnProperty(E)||(o||(o={}),o[E]="");for(E in U)U.hasOwnProperty(E)&&D[E]!==U[E]&&(o||(o={}),o[E]=U[E])}else o||(g||(g=[]),g.push(ye,o)),o=U;else ye==="dangerouslySetInnerHTML"?(U=U?U.__html:void 0,D=D?D.__html:void 0,U!=null&&D!==U&&(g=g||[]).push(ye,U)):ye==="children"?typeof U!="string"&&typeof U!="number"||(g=g||[]).push(ye,""+U):ye!=="suppressContentEditableWarning"&&ye!=="suppressHydrationWarning"&&(u.hasOwnProperty(ye)?(U!=null&&ye==="onScroll"&&Pt("scroll",e),g||D===U||(g=[])):(g=g||[]).push(ye,U))}o&&(g=g||[]).push("style",o);var ye=g;(n.updateQueue=ye)&&(n.flags|=4)}},hp=function(e,n,o,l){o!==l&&(n.flags|=4)};function ca(e,n){if(!It)switch(e.tailMode){case"hidden":n=e.tail;for(var o=null;n!==null;)n.alternate!==null&&(o=n),n=n.sibling;o===null?e.tail=null:o.sibling=null;break;case"collapsed":o=e.tail;for(var 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 yn(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 Cy(e,n,o){var l=n.pendingProps;switch(Xu(n),n.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return yn(n),null;case 1:return Rn(n.type)&&il(),yn(n),null;case 3:return l=n.stateNode,gs(),jt(On),jt(mn),lc(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(e===null||e.child===null)&&(cl(n)?n.flags|=4:e===null||e.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,Er!==null&&(zc(Er),Er=null))),Cc(e,n),yn(n),null;case 5:sc(n);var p=Ni(ia.current);if(o=n.type,e!==null&&n.stateNode!=null)pp(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 yn(n),null}if(e=Ni(Ur.current),cl(n)){l=n.stateNode,o=n.type;var g=n.memoizedProps;switch(l[Kr]=n,l[ea]=g,e=(n.mode&1)!==0,o){case"dialog":Pt("cancel",l),Pt("close",l);break;case"iframe":case"object":case"embed":Pt("load",l);break;case"video":case"audio":for(p=0;p<vo.length;p++)Pt(vo[p],l);break;case"source":Pt("error",l);break;case"img":case"image":case"link":Pt("error",l),Pt("load",l);break;case"details":Pt("toggle",l);break;case"input":st(l,g),Pt("invalid",l);break;case"select":l._wrapperState={wasMultiple:!!g.multiple},Pt("invalid",l);break;case"textarea":cn(l,g),Pt("invalid",l)}qe(o,g),p=null;for(var E in g)if(g.hasOwnProperty(E)){var D=g[E];E==="children"?typeof D=="string"?l.textContent!==D&&(g.suppressHydrationWarning!==!0&&nl(l.textContent,D,e),p=["children",D]):typeof D=="number"&&l.textContent!==""+D&&(g.suppressHydrationWarning!==!0&&nl(l.textContent,D,e),p=["children",""+D]):u.hasOwnProperty(E)&&D!=null&&E==="onScroll"&&Pt("scroll",l)}switch(o){case"input":Je(l),xn(l,g,!0);break;case"textarea":Je(l),wn(l);break;case"select":case"option":break;default:typeof g.onClick=="function"&&(l.onclick=rl)}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=Et(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[Kr]=n,e[ea]=l,dp(e,n,!1,!1),n.stateNode=e;e:{switch(E=Kn(o,l),o){case"dialog":Pt("cancel",e),Pt("close",e),p=l;break;case"iframe":case"object":case"embed":Pt("load",e),p=l;break;case"video":case"audio":for(p=0;p<vo.length;p++)Pt(vo[p],e);p=l;break;case"source":Pt("error",e),p=l;break;case"img":case"image":case"link":Pt("error",e),Pt("load",e),p=l;break;case"details":Pt("toggle",e),p=l;break;case"input":st(e,l),p=ut(e,l),Pt("invalid",e);break;case"option":p=l;break;case"select":e._wrapperState={wasMultiple:!!l.multiple},p=X({},l,{value:void 0}),Pt("invalid",e);break;case"textarea":cn(e,l),p=Pn(e,l),Pt("invalid",e);break;default:p=l}qe(o,p),D=p;for(g in D)if(D.hasOwnProperty(g)){var U=D[g];g==="style"?nr(e,U):g==="dangerouslySetInnerHTML"?(U=U?U.__html:void 0,U!=null&&tr(e,U)):g==="children"?typeof U=="string"?(o!=="textarea"||U!=="")&&_n(e,U):typeof U=="number"&&_n(e,""+U):g!=="suppressContentEditableWarning"&&g!=="suppressHydrationWarning"&&g!=="autoFocus"&&(u.hasOwnProperty(g)?U!=null&&g==="onScroll"&&Pt("scroll",e):U!=null&&j(e,g,U,E))}switch(o){case"input":Je(e),xn(e,l,!1);break;case"textarea":Je(e),wn(e);break;case"option":l.value!=null&&e.setAttribute("value",""+we(l.value));break;case"select":e.multiple=!!l.multiple,g=l.value,g!=null?bt(e,!!l.multiple,g,!1):l.defaultValue!=null&&bt(e,!!l.multiple,l.defaultValue,!0);break;default:typeof p.onClick=="function"&&(e.onclick=rl)}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 yn(n),null;case 6:if(e&&n.stateNode!=null)hp(e,n,e.memoizedProps,l);else{if(typeof l!="string"&&n.stateNode===null)throw Error(i(166));if(o=Ni(ia.current),Ni(Ur.current),cl(n)){if(l=n.stateNode,o=n.memoizedProps,l[Kr]=n,(g=l.nodeValue!==o)&&(e=Qn,e!==null))switch(e.tag){case 3:nl(l.nodeValue,o,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&nl(l.nodeValue,o,(e.mode&1)!==0)}g&&(n.flags|=4)}else l=(o.nodeType===9?o:o.ownerDocument).createTextNode(l),l[Kr]=n,n.stateNode=l}return yn(n),null;case 13:if(jt(Ot),l=n.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(It&&Gn!==null&&(n.mode&1)!==0&&(n.flags&128)===0)yd(),ds(),n.flags|=98560,g=!1;else if(g=cl(n),l!==null&&l.dehydrated!==null){if(e===null){if(!g)throw Error(i(318));if(g=n.memoizedState,g=g!==null?g.dehydrated:null,!g)throw Error(i(317));g[Kr]=n}else ds(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;yn(n),g=!1}else Er!==null&&(zc(Er),Er=null),g=!0;if(!g)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||(Ot.current&1)!==0?Qt===0&&(Qt=3):Bc())),n.updateQueue!==null&&(n.flags|=4),yn(n),null);case 4:return gs(),Cc(e,n),e===null&&Zs(n.stateNode.containerInfo),yn(n),null;case 10:return tc(n.type._context),yn(n),null;case 17:return Rn(n.type)&&il(),yn(n),null;case 19:if(jt(Ot),g=n.memoizedState,g===null)return yn(n),null;if(l=(n.flags&128)!==0,E=g.rendering,E===null)if(l)ca(g,!1);else{if(Qt!==0||e!==null&&(e.flags&128)!==0)for(e=n.child;e!==null;){if(E=gl(e),E!==null){for(n.flags|=128,ca(g,!1),l=E.updateQueue,l!==null&&(n.updateQueue=l,n.flags|=4),n.subtreeFlags=0,l=o,o=n.child;o!==null;)g=o,e=l,g.flags&=14680066,E=g.alternate,E===null?(g.childLanes=0,g.lanes=e,g.child=null,g.subtreeFlags=0,g.memoizedProps=null,g.memoizedState=null,g.updateQueue=null,g.dependencies=null,g.stateNode=null):(g.childLanes=E.childLanes,g.lanes=E.lanes,g.child=E.child,g.subtreeFlags=0,g.deletions=null,g.memoizedProps=E.memoizedProps,g.memoizedState=E.memoizedState,g.updateQueue=E.updateQueue,g.type=E.type,e=E.dependencies,g.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),o=o.sibling;return kt(Ot,Ot.current&1|2),n.child}e=e.sibling}g.tail!==null&&yt()>ws&&(n.flags|=128,l=!0,ca(g,!1),n.lanes=4194304)}else{if(!l)if(e=gl(E),e!==null){if(n.flags|=128,l=!0,o=e.updateQueue,o!==null&&(n.updateQueue=o,n.flags|=4),ca(g,!0),g.tail===null&&g.tailMode==="hidden"&&!E.alternate&&!It)return yn(n),null}else 2*yt()-g.renderingStartTime>ws&&o!==1073741824&&(n.flags|=128,l=!0,ca(g,!1),n.lanes=4194304);g.isBackwards?(E.sibling=n.child,n.child=E):(o=g.last,o!==null?o.sibling=E:n.child=E,g.last=E)}return g.tail!==null?(n=g.tail,g.rendering=n,g.tail=n.sibling,g.renderingStartTime=yt(),n.sibling=null,o=Ot.current,kt(Ot,l?o&1|2:o&1),n):(yn(n),null);case 22:case 23:return Fc(),l=n.memoizedState!==null,e!==null&&e.memoizedState!==null!==l&&(n.flags|=8192),l&&(n.mode&1)!==0?(Zn&1073741824)!==0&&(yn(n),n.subtreeFlags&6&&(n.flags|=8192)):yn(n),null;case 24:return null;case 25:return null}throw Error(i(156,n.tag))}function Py(e,n){switch(Xu(n),n.tag){case 1:return Rn(n.type)&&il(),e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 3:return gs(),jt(On),jt(mn),lc(),e=n.flags,(e&65536)!==0&&(e&128)===0?(n.flags=e&-65537|128,n):null;case 5:return sc(n),null;case 13:if(jt(Ot),e=n.memoizedState,e!==null&&e.dehydrated!==null){if(n.alternate===null)throw Error(i(340));ds()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 19:return jt(Ot),null;case 4:return gs(),null;case 10:return tc(n.type._context),null;case 22:case 23:return Fc(),null;case 24:return null;default:return null}}var El=!1,vn=!1,jy=typeof WeakSet=="function"?WeakSet:Set,We=null;function vs(e,n){var o=e.ref;if(o!==null)if(typeof o=="function")try{o(null)}catch(l){zt(e,n,l)}else o.current=null}function Pc(e,n,o){try{o()}catch(l){zt(e,n,l)}}var mp=!1;function Ty(e,n){if(Fu=Ui,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,g=l.focusNode;l=l.focusOffset;try{o.nodeType,g.nodeType}catch{o=null;break e}var E=0,D=-1,U=-1,ye=0,je=0,Me=e,Pe=null;t:for(;;){for(var Ke;Me!==o||p!==0&&Me.nodeType!==3||(D=E+p),Me!==g||l!==0&&Me.nodeType!==3||(U=E+l),Me.nodeType===3&&(E+=Me.nodeValue.length),(Ke=Me.firstChild)!==null;)Pe=Me,Me=Ke;for(;;){if(Me===e)break t;if(Pe===o&&++ye===p&&(D=E),Pe===g&&++je===l&&(U=E),(Ke=Me.nextSibling)!==null)break;Me=Pe,Pe=Me.parentNode}Me=Ke}o=D===-1||U===-1?null:{start:D,end:U}}else o=null}o=o||{start:0,end:0}}else o=null;for(Bu={focusedElem:e,selectionRange:o},Ui=!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 Xe=n.alternate;if((n.flags&1024)!==0)switch(n.tag){case 0:case 11:case 15:break;case 1:if(Xe!==null){var Qe=Xe.memoizedProps,Bt=Xe.memoizedState,de=n.stateNode,ee=de.getSnapshotBeforeUpdate(n.elementType===n.type?Qe:Nr(n.type,Qe),Bt);de.__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(De){zt(n,n.return,De)}if(e=n.sibling,e!==null){e.return=n.return,We=e;break}We=n.return}return Xe=mp,mp=!1,Xe}function fa(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 g=p.destroy;p.destroy=void 0,g!==void 0&&Pc(n,o,g)}p=p.next}while(p!==l)}}function Nl(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 jc(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 gp(e){var n=e.alternate;n!==null&&(e.alternate=null,gp(n)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(n=e.stateNode,n!==null&&(delete n[Kr],delete n[ea],delete n[Uu],delete n[dy],delete n[py])),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 yp(e){return e.tag===5||e.tag===3||e.tag===4}function vp(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||yp(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Tc(e,n,o){var 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=rl));else if(l!==4&&(e=e.child,e!==null))for(Tc(e,n,o),e=e.sibling;e!==null;)Tc(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 ln=null,Cr=!1;function Jo(e,n,o){for(o=o.child;o!==null;)xp(e,n,o),o=o.sibling}function xp(e,n,o){if(En&&typeof En.onCommitFiberUnmount=="function")try{En.onCommitFiberUnmount(ar,o)}catch{}switch(o.tag){case 5:vn||vs(o,n);case 6:var l=ln,p=Cr;ln=null,Jo(e,n,o),ln=l,Cr=p,ln!==null&&(Cr?(e=ln,o=o.stateNode,e.nodeType===8?e.parentNode.removeChild(o):e.removeChild(o)):ln.removeChild(o.stateNode));break;case 18:ln!==null&&(Cr?(e=ln,o=o.stateNode,e.nodeType===8?Ku(e.parentNode,o):e.nodeType===1&&Ku(e,o),lo(e)):Ku(ln,o.stateNode));break;case 4:l=ln,p=Cr,ln=o.stateNode.containerInfo,Cr=!0,Jo(e,n,o),ln=l,Cr=p;break;case 0:case 11:case 14:case 15:if(!vn&&(l=o.updateQueue,l!==null&&(l=l.lastEffect,l!==null))){p=l=l.next;do{var g=p,E=g.destroy;g=g.tag,E!==void 0&&((g&2)!==0||(g&4)!==0)&&Pc(o,n,E),p=p.next}while(p!==l)}Jo(e,n,o);break;case 1:if(!vn&&(vs(o,n),l=o.stateNode,typeof l.componentWillUnmount=="function"))try{l.props=o.memoizedProps,l.state=o.memoizedState,l.componentWillUnmount()}catch(D){zt(o,n,D)}Jo(e,n,o);break;case 21:Jo(e,n,o);break;case 22:o.mode&1?(vn=(l=vn)||o.memoizedState!==null,Jo(e,n,o),vn=l):Jo(e,n,o);break;default:Jo(e,n,o)}}function wp(e){var n=e.updateQueue;if(n!==null){e.updateQueue=null;var o=e.stateNode;o===null&&(o=e.stateNode=new jy),n.forEach(function(l){var p=Ly.bind(null,e,l);o.has(l)||(o.add(l),l.then(p,p))})}}function Pr(e,n){var o=n.deletions;if(o!==null)for(var l=0;l<o.length;l++){var p=o[l];try{var g=e,E=n,D=E;e:for(;D!==null;){switch(D.tag){case 5:ln=D.stateNode,Cr=!1;break e;case 3:ln=D.stateNode.containerInfo,Cr=!0;break e;case 4:ln=D.stateNode.containerInfo,Cr=!0;break e}D=D.return}if(ln===null)throw Error(i(160));xp(g,E,p),ln=null,Cr=!1;var U=p.alternate;U!==null&&(U.return=null),p.return=null}catch(ye){zt(p,n,ye)}}if(n.subtreeFlags&12854)for(n=n.child;n!==null;)_p(n,e),n=n.sibling}function _p(e,n){var o=e.alternate,l=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Pr(n,e),Wr(e),l&4){try{fa(3,e,e.return),Nl(3,e)}catch(Qe){zt(e,e.return,Qe)}try{fa(5,e,e.return)}catch(Qe){zt(e,e.return,Qe)}}break;case 1:Pr(n,e),Wr(e),l&512&&o!==null&&vs(o,o.return);break;case 5:if(Pr(n,e),Wr(e),l&512&&o!==null&&vs(o,o.return),e.flags&32){var p=e.stateNode;try{_n(p,"")}catch(Qe){zt(e,e.return,Qe)}}if(l&4&&(p=e.stateNode,p!=null)){var g=e.memoizedProps,E=o!==null?o.memoizedProps:g,D=e.type,U=e.updateQueue;if(e.updateQueue=null,U!==null)try{D==="input"&&g.type==="radio"&&g.name!=null&&ct(p,g),Kn(D,E);var ye=Kn(D,g);for(E=0;E<U.length;E+=2){var je=U[E],Me=U[E+1];je==="style"?nr(p,Me):je==="dangerouslySetInnerHTML"?tr(p,Me):je==="children"?_n(p,Me):j(p,je,Me,ye)}switch(D){case"input":ht(p,g);break;case"textarea":gr(p,g);break;case"select":var Pe=p._wrapperState.wasMultiple;p._wrapperState.wasMultiple=!!g.multiple;var Ke=g.value;Ke!=null?bt(p,!!g.multiple,Ke,!1):Pe!==!!g.multiple&&(g.defaultValue!=null?bt(p,!!g.multiple,g.defaultValue,!0):bt(p,!!g.multiple,g.multiple?[]:"",!1))}p[ea]=g}catch(Qe){zt(e,e.return,Qe)}}break;case 6:if(Pr(n,e),Wr(e),l&4){if(e.stateNode===null)throw Error(i(162));p=e.stateNode,g=e.memoizedProps;try{p.nodeValue=g}catch(Qe){zt(e,e.return,Qe)}}break;case 3:if(Pr(n,e),Wr(e),l&4&&o!==null&&o.memoizedState.isDehydrated)try{lo(n.containerInfo)}catch(Qe){zt(e,e.return,Qe)}break;case 4:Pr(n,e),Wr(e);break;case 13:Pr(n,e),Wr(e),p=e.child,p.flags&8192&&(g=p.memoizedState!==null,p.stateNode.isHidden=g,!g||p.alternate!==null&&p.alternate.memoizedState!==null||($c=yt())),l&4&&wp(e);break;case 22:if(je=o!==null&&o.memoizedState!==null,e.mode&1?(vn=(ye=vn)||je,Pr(n,e),vn=ye):Pr(n,e),Wr(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(Me=We=je;We!==null;){switch(Pe=We,Ke=Pe.child,Pe.tag){case 0:case 11:case 14:case 15:fa(4,Pe,Pe.return);break;case 1:vs(Pe,Pe.return);var Xe=Pe.stateNode;if(typeof Xe.componentWillUnmount=="function"){l=Pe,o=Pe.return;try{n=l,Xe.props=n.memoizedProps,Xe.state=n.memoizedState,Xe.componentWillUnmount()}catch(Qe){zt(l,o,Qe)}}break;case 5:vs(Pe,Pe.return);break;case 22:if(Pe.memoizedState!==null){kp(Me);continue}}Ke!==null?(Ke.return=Pe,We=Ke):kp(Me)}je=je.sibling}e:for(je=null,Me=e;;){if(Me.tag===5){if(je===null){je=Me;try{p=Me.stateNode,ye?(g=p.style,typeof g.setProperty=="function"?g.setProperty("display","none","important"):g.display="none"):(D=Me.stateNode,U=Me.memoizedProps.style,E=U!=null&&U.hasOwnProperty("display")?U.display:null,D.style.display=fn("display",E))}catch(Qe){zt(e,e.return,Qe)}}}else if(Me.tag===6){if(je===null)try{Me.stateNode.nodeValue=ye?"":Me.memoizedProps}catch(Qe){zt(e,e.return,Qe)}}else if((Me.tag!==22&&Me.tag!==23||Me.memoizedState===null||Me===e)&&Me.child!==null){Me.child.return=Me,Me=Me.child;continue}if(Me===e)break e;for(;Me.sibling===null;){if(Me.return===null||Me.return===e)break e;je===Me&&(je=null),Me=Me.return}je===Me&&(je=null),Me.sibling.return=Me.return,Me=Me.sibling}}break;case 19:Pr(n,e),Wr(e),l&4&&wp(e);break;case 21:break;default:Pr(n,e),Wr(e)}}function Wr(e){var n=e.flags;if(n&2){try{e:{for(var o=e.return;o!==null;){if(yp(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&&(_n(p,""),l.flags&=-33);var g=vp(e);Mc(e,g,p);break;case 3:case 4:var E=l.stateNode.containerInfo,D=vp(e);Tc(e,D,E);break;default:throw Error(i(161))}}catch(U){zt(e,e.return,U)}e.flags&=-3}n&4096&&(e.flags&=-4097)}function My(e,n,o){We=e,Sp(e)}function Sp(e,n,o){for(var l=(e.mode&1)!==0;We!==null;){var p=We,g=p.child;if(p.tag===22&&l){var E=p.memoizedState!==null||El;if(!E){var D=p.alternate,U=D!==null&&D.memoizedState!==null||vn;D=El;var ye=vn;if(El=E,(vn=U)&&!ye)for(We=p;We!==null;)E=We,U=E.child,E.tag===22&&E.memoizedState!==null?Ep(p):U!==null?(U.return=E,We=U):Ep(p);for(;g!==null;)We=g,Sp(g),g=g.sibling;We=p,El=D,vn=ye}bp(e)}else(p.subtreeFlags&8772)!==0&&g!==null?(g.return=p,We=g):bp(e)}}function bp(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:vn||Nl(5,n);break;case 1:var l=n.stateNode;if(n.flags&4&&!vn)if(o===null)l.componentDidMount();else{var p=n.elementType===n.type?o.memoizedProps:Nr(n.type,o.memoizedProps);l.componentDidUpdate(p,o.memoizedState,l.__reactInternalSnapshotBeforeUpdate)}var g=n.updateQueue;g!==null&&kd(n,g,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}kd(n,E,o)}break;case 5:var D=n.stateNode;if(o===null&&n.flags&4){o=D;var U=n.memoizedProps;switch(n.type){case"button":case"input":case"select":case"textarea":U.autoFocus&&o.focus();break;case"img":U.src&&(o.src=U.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 Me=je.dehydrated;Me!==null&&lo(Me)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(i(163))}vn||n.flags&512&&jc(n)}catch(Pe){zt(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 kp(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 Ep(e){for(;We!==null;){var n=We;try{switch(n.tag){case 0:case 11:case 15:var o=n.return;try{Nl(4,n)}catch(U){zt(n,o,U)}break;case 1:var l=n.stateNode;if(typeof l.componentDidMount=="function"){var p=n.return;try{l.componentDidMount()}catch(U){zt(n,p,U)}}var g=n.return;try{jc(n)}catch(U){zt(n,g,U)}break;case 5:var E=n.return;try{jc(n)}catch(U){zt(n,E,U)}}}catch(U){zt(n,n.return,U)}if(n===e){We=null;break}var D=n.sibling;if(D!==null){D.return=n.return,We=D;break}We=n.return}}var Iy=Math.ceil,Cl=R.ReactCurrentDispatcher,Ic=R.ReactCurrentOwner,hr=R.ReactCurrentBatchConfig,xt=0,en=null,Ut=null,un=0,Zn=0,xs=Yo(0),Qt=0,da=null,Pi=0,Pl=0,Ac=0,pa=null,zn=null,$c=0,ws=1/0,No=null,jl=!1,Oc=null,ei=null,Tl=!1,ti=null,Ml=0,ha=0,Rc=null,Il=-1,Al=0;function Cn(){return(xt&6)!==0?yt():Il!==-1?Il:Il=yt()}function ni(e){return(e.mode&1)===0?1:(xt&2)!==0&&un!==0?un&-un:my.transition!==null?(Al===0&&(Al=Fr()),Al):(e=wt,e!==0||(e=window.event,e=e===void 0?16:qi(e.type)),e)}function jr(e,n,o,l){if(50<ha)throw ha=0,Rc=null,Error(i(185));ur(e,o,l),((xt&2)===0||e!==en)&&(e===en&&((xt&2)===0&&(Pl|=o),Qt===4&&ri(e,un)),Ln(e,l),o===1&&xt===0&&(n.mode&1)===0&&(ws=yt()+500,al&&Qo()))}function Ln(e,n){var o=e.callbackNode;io(e,n);var l=vt(e,e===en?un:0);if(l===0)o!==null&&Ao(o),e.callbackNode=null,e.callbackPriority=0;else if(n=l&-l,e.callbackPriority!==n){if(o!=null&&Ao(o),n===1)e.tag===0?hy(Cp.bind(null,e)):dd(Cp.bind(null,e)),cy(function(){(xt&6)===0&&Qo()}),o=null;else{switch(Ba(l)){case 1:o=Dr;break;case 4:o=$o;break;case 16:o=zr;break;case 536870912:o=fi;break;default:o=zr}o=Op(o,Np.bind(null,e))}e.callbackPriority=n,e.callbackNode=o}}function Np(e,n){if(Il=-1,Al=0,(xt&6)!==0)throw Error(i(327));var o=e.callbackNode;if(_s()&&e.callbackNode!==o)return null;var l=vt(e,e===en?un:0);if(l===0)return null;if((l&30)!==0||(l&e.expiredLanes)!==0||n)n=$l(e,l);else{n=l;var p=xt;xt|=2;var g=jp();(en!==e||un!==n)&&(No=null,ws=yt()+500,Ti(e,n));do try{Oy();break}catch(D){Pp(e,D)}while(!0);ec(),Cl.current=g,xt=p,Ut!==null?n=0:(en=null,un=0,n=Qt)}if(n!==0){if(n===2&&(p=lr(e),p!==0&&(l=p,n=Dc(e,p))),n===1)throw o=da,Ti(e,0),ri(e,l),Ln(e,yt()),o;if(n===6)ri(e,l);else{if(p=e.current.alternate,(l&30)===0&&!Ay(p)&&(n=$l(e,l),n===2&&(g=lr(e),g!==0&&(l=g,n=Dc(e,g))),n===1))throw o=da,Ti(e,0),ri(e,l),Ln(e,yt()),o;switch(e.finishedWork=p,e.finishedLanes=l,n){case 0:case 1:throw Error(i(345));case 2:Mi(e,zn,No);break;case 3:if(ri(e,l),(l&130023424)===l&&(n=$c+500-yt(),10<n)){if(vt(e,0)!==0)break;if(p=e.suspendedLanes,(p&l)!==l){Cn(),e.pingedLanes|=e.suspendedLanes&p;break}e.timeoutHandle=Vu(Mi.bind(null,e,zn,No),n);break}Mi(e,zn,No);break;case 4:if(ri(e,l),(l&4194240)===l)break;for(n=e.eventTimes,p=-1;0<l;){var E=31-dn(l);g=1<<E,E=n[E],E>p&&(p=E),l&=~g}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*Iy(l/1960))-l,10<l){e.timeoutHandle=Vu(Mi.bind(null,e,zn,No),l);break}Mi(e,zn,No);break;case 5:Mi(e,zn,No);break;default:throw Error(i(329))}}}return Ln(e,yt()),e.callbackNode===o?Np.bind(null,e):null}function Dc(e,n){var o=pa;return e.current.memoizedState.isDehydrated&&(Ti(e,n).flags|=256),e=$l(e,n),e!==2&&(n=zn,zn=o,n!==null&&zc(n)),e}function zc(e){zn===null?zn=e:zn.push.apply(zn,e)}function Ay(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],g=p.getSnapshot;p=p.value;try{if(!se(g(),p))return!1}catch{return!1}}}if(o=n.child,n.subtreeFlags&16384&&o!==null)o.return=n,n=o;else{if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return!0;n=n.return}n.sibling.return=n.return,n=n.sibling}}return!0}function ri(e,n){for(n&=~Ac,n&=~Pl,e.suspendedLanes|=n,e.pingedLanes&=~n,e=e.expirationTimes;0<n;){var o=31-dn(n),l=1<<o;e[o]=-1,n&=~l}}function Cp(e){if((xt&6)!==0)throw Error(i(327));_s();var n=vt(e,0);if((n&1)===0)return Ln(e,yt()),null;var o=$l(e,n);if(e.tag!==0&&o===2){var l=lr(e);l!==0&&(n=l,o=Dc(e,l))}if(o===1)throw o=da,Ti(e,0),ri(e,n),Ln(e,yt()),o;if(o===6)throw Error(i(345));return e.finishedWork=e.current.alternate,e.finishedLanes=n,Mi(e,zn,No),Ln(e,yt()),null}function Lc(e,n){var o=xt;xt|=1;try{return e(n)}finally{xt=o,xt===0&&(ws=yt()+500,al&&Qo())}}function ji(e){ti!==null&&ti.tag===0&&(xt&6)===0&&_s();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&&Qo()}}function Fc(){Zn=xs.current,jt(xs)}function Ti(e,n){e.finishedWork=null,e.finishedLanes=0;var o=e.timeoutHandle;if(o!==-1&&(e.timeoutHandle=-1,uy(o)),Ut!==null)for(o=Ut.return;o!==null;){var l=o;switch(Xu(l),l.tag){case 1:l=l.type.childContextTypes,l!=null&&il();break;case 3:gs(),jt(On),jt(mn),lc();break;case 5:sc(l);break;case 4:gs();break;case 13:jt(Ot);break;case 19:jt(Ot);break;case 10:tc(l.type._context);break;case 22:case 23:Fc()}o=o.return}if(en=e,Ut=e=oi(e.current,null),un=Zn=n,Qt=0,da=null,Ac=Pl=Pi=0,zn=pa=null,Ei!==null){for(n=0;n<Ei.length;n++)if(o=Ei[n],l=o.interleaved,l!==null){o.interleaved=null;var p=l.next,g=o.pending;if(g!==null){var E=g.next;g.next=p,l.next=E}o.pending=l}Ei=null}return e}function Pp(e,n){do{var o=Ut;try{if(ec(),yl.current=_l,vl){for(var l=Rt.memoizedState;l!==null;){var p=l.queue;p!==null&&(p.pending=null),l=l.next}vl=!1}if(Ci=0,Jt=Xt=Rt=null,sa=!1,aa=0,Ic.current=null,o===null||o.return===null){Qt=1,da=n,Ut=null;break}e:{var g=e,E=o.return,D=o,U=n;if(n=un,D.flags|=32768,U!==null&&typeof U=="object"&&typeof U.then=="function"){var ye=U,je=D,Me=je.tag;if((je.mode&1)===0&&(Me===0||Me===11||Me===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=Jd(E);if(Ke!==null){Ke.flags&=-257,ep(Ke,E,D,g,n),Ke.mode&1&&Zd(g,ye,n),n=Ke,U=ye;var Xe=n.updateQueue;if(Xe===null){var Qe=new Set;Qe.add(U),n.updateQueue=Qe}else Xe.add(U);break e}else{if((n&1)===0){Zd(g,ye,n),Bc();break e}U=Error(i(426))}}else if(It&&D.mode&1){var Bt=Jd(E);if(Bt!==null){(Bt.flags&65536)===0&&(Bt.flags|=256),ep(Bt,E,D,g,n),Zu(ys(U,D));break e}}g=U=ys(U,D),Qt!==4&&(Qt=2),pa===null?pa=[g]:pa.push(g),g=E;do{switch(g.tag){case 3:g.flags|=65536,n&=-n,g.lanes|=n;var de=Qd(g,U,n);bd(g,de);break e;case 1:D=U;var ee=g.type,me=g.stateNode;if((g.flags&128)===0&&(typeof ee.getDerivedStateFromError=="function"||me!==null&&typeof me.componentDidCatch=="function"&&(ei===null||!ei.has(me)))){g.flags|=65536,n&=-n,g.lanes|=n;var De=Gd(g,D,n);bd(g,De);break e}}g=g.return}while(g!==null)}Mp(o)}catch(Ge){n=Ge,Ut===o&&o!==null&&(Ut=o=o.return);continue}break}while(!0)}function jp(){var e=Cl.current;return Cl.current=_l,e===null?_l:e}function Bc(){(Qt===0||Qt===3||Qt===2)&&(Qt=4),en===null||(Pi&268435455)===0&&(Pl&268435455)===0||ri(en,un)}function $l(e,n){var o=xt;xt|=2;var l=jp();(en!==e||un!==n)&&(No=null,Ti(e,n));do try{$y();break}catch(p){Pp(e,p)}while(!0);if(ec(),xt=o,Cl.current=l,Ut!==null)throw Error(i(261));return en=null,un=0,Qt}function $y(){for(;Ut!==null;)Tp(Ut)}function Oy(){for(;Ut!==null&&!Nt();)Tp(Ut)}function Tp(e){var n=$p(e.alternate,e,Zn);e.memoizedProps=e.pendingProps,n===null?Mp(e):Ut=n,Ic.current=null}function Mp(e){var n=e;do{var o=n.alternate;if(e=n.return,(n.flags&32768)===0){if(o=Cy(o,n,Zn),o!==null){Ut=o;return}}else{if(o=Py(o,n),o!==null){o.flags&=32767,Ut=o;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Qt=6,Ut=null;return}}if(n=n.sibling,n!==null){Ut=n;return}Ut=n=e}while(n!==null);Qt===0&&(Qt=5)}function Mi(e,n,o){var l=wt,p=hr.transition;try{hr.transition=null,wt=1,Ry(e,n,o,l)}finally{hr.transition=p,wt=l}return null}function Ry(e,n,o,l){do _s();while(ti!==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 g=o.lanes|o.childLanes;if(di(e,g),e===en&&(Ut=en=null,un=0),(o.subtreeFlags&2064)===0&&(o.flags&2064)===0||Tl||(Tl=!0,Op(zr,function(){return _s(),null})),g=(o.flags&15990)!==0,(o.subtreeFlags&15990)!==0||g){g=hr.transition,hr.transition=null;var E=wt;wt=1;var D=xt;xt|=4,Ic.current=null,Ty(e,o),_p(o,e),oe(Bu),Ui=!!Fu,Bu=Fu=null,e.current=o,My(o),sr(),xt=D,wt=E,hr.transition=g}else e.current=o;if(Tl&&(Tl=!1,ti=e,Ml=p),g=e.pendingLanes,g===0&&(ei=null),ft(o.stateNode),Ln(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(jl)throw jl=!1,e=Oc,Oc=null,e;return(Ml&1)!==0&&e.tag!==0&&_s(),g=e.pendingLanes,(g&1)!==0?e===Rc?ha++:(ha=0,Rc=e):ha=0,Qo(),null}function _s(){if(ti!==null){var e=Ba(Ml),n=hr.transition,o=wt;try{if(hr.transition=null,wt=16>e?16:e,ti===null)var l=!1;else{if(e=ti,ti=null,Ml=0,(xt&6)!==0)throw Error(i(331));var p=xt;for(xt|=4,We=e.current;We!==null;){var g=We,E=g.child;if((We.flags&16)!==0){var D=g.deletions;if(D!==null){for(var U=0;U<D.length;U++){var ye=D[U];for(We=ye;We!==null;){var je=We;switch(je.tag){case 0:case 11:case 15:fa(8,je,g)}var Me=je.child;if(Me!==null)Me.return=je,We=Me;else for(;We!==null;){je=We;var Pe=je.sibling,Ke=je.return;if(gp(je),je===ye){We=null;break}if(Pe!==null){Pe.return=Ke,We=Pe;break}We=Ke}}}var Xe=g.alternate;if(Xe!==null){var Qe=Xe.child;if(Qe!==null){Xe.child=null;do{var Bt=Qe.sibling;Qe.sibling=null,Qe=Bt}while(Qe!==null)}}We=g}}if((g.subtreeFlags&2064)!==0&&E!==null)E.return=g,We=E;else e:for(;We!==null;){if(g=We,(g.flags&2048)!==0)switch(g.tag){case 0:case 11:case 15:fa(9,g,g.return)}var de=g.sibling;if(de!==null){de.return=g.return,We=de;break e}We=g.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(D=We,(D.flags&2048)!==0)try{switch(D.tag){case 0:case 11:case 15:Nl(9,D)}}catch(Ge){zt(D,D.return,Ge)}if(D===E){We=null;break e}var De=D.sibling;if(De!==null){De.return=D.return,We=De;break e}We=D.return}}if(xt=p,Qo(),En&&typeof En.onPostCommitFiberRoot=="function")try{En.onPostCommitFiberRoot(ar,e)}catch{}l=!0}return l}finally{wt=o,hr.transition=n}}return!1}function Ip(e,n,o){n=ys(o,n),n=Qd(e,n,1),e=Zo(e,n,1),n=Cn(),e!==null&&(ur(e,1,n),Ln(e,n))}function zt(e,n,o){if(e.tag===3)Ip(e,e,o);else for(;n!==null;){if(n.tag===3){Ip(n,e,o);break}else if(n.tag===1){var l=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(ei===null||!ei.has(l))){e=ys(o,e),e=Gd(n,e,1),n=Zo(n,e,1),e=Cn(),n!==null&&(ur(n,1,e),Ln(n,e));break}}n=n.return}}function Dy(e,n,o){var l=e.pingCache;l!==null&&l.delete(n),n=Cn(),e.pingedLanes|=e.suspendedLanes&o,en===e&&(un&o)===o&&(Qt===4||Qt===3&&(un&130023424)===un&&500>yt()-$c?Ti(e,0):Ac|=o),Ln(e,n)}function Ap(e,n){n===0&&((e.mode&1)===0?n=1:(n=oo,oo<<=1,(oo&130023424)===0&&(oo=4194304)));var o=Cn();e=bo(e,n),e!==null&&(ur(e,n,o),Ln(e,o))}function zy(e){var n=e.memoizedState,o=0;n!==null&&(o=n.retryLane),Ap(e,o)}function Ly(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),Ap(e,o)}var $p;$p=function(e,n,o){if(e!==null)if(e.memoizedProps!==n.pendingProps||On.current)Dn=!0;else{if((e.lanes&o)===0&&(n.flags&128)===0)return Dn=!1,Ny(e,n,o);Dn=(e.flags&131072)!==0}else Dn=!1,It&&(n.flags&1048576)!==0&&pd(n,ul,n.index);switch(n.lanes=0,n.tag){case 2:var l=n.type;kl(e,n),e=n.pendingProps;var p=us(n,mn.current);ms(n,o),p=fc(null,n,l,e,p,o);var g=dc();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,Rn(l)?(g=!0,sl(n)):g=!1,n.memoizedState=p.state!==null&&p.state!==void 0?p.state:null,oc(n),p.updater=Sl,n.stateNode=p,p._reactInternals=n,vc(n,l,e,o),n=Sc(null,n,l,!0,g,o)):(n.tag=0,It&&g&&Yu(n),Nn(null,n,p,o),n=n.child),n;case 16:l=n.elementType;e:{switch(kl(e,n),e=n.pendingProps,p=l._init,l=p(l._payload),n.type=l,p=n.tag=By(l),e=Nr(l,e),p){case 0:n=_c(null,n,l,e,o);break e;case 1:n=sp(null,n,l,e,o);break e;case 11:n=tp(null,n,l,e,o);break e;case 14:n=np(null,n,l,Nr(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:Nr(l,p),_c(e,n,l,p,o);case 1:return l=n.type,p=n.pendingProps,p=n.elementType===l?p:Nr(l,p),sp(e,n,l,p,o);case 3:e:{if(ap(n),e===null)throw Error(i(387));l=n.pendingProps,g=n.memoizedState,p=g.element,Sd(e,n),ml(n,l,null,o);var E=n.memoizedState;if(l=E.element,g.isDehydrated)if(g={element:l,isDehydrated:!1,cache:E.cache,pendingSuspenseBoundaries:E.pendingSuspenseBoundaries,transitions:E.transitions},n.updateQueue.baseState=g,n.memoizedState=g,n.flags&256){p=ys(Error(i(423)),n),n=lp(e,n,l,o,p);break e}else if(l!==p){p=ys(Error(i(424)),n),n=lp(e,n,l,o,p);break e}else for(Gn=Wo(n.stateNode.containerInfo.firstChild),Qn=n,It=!0,Er=null,o=wd(n,null,l,o),n.child=o;o;)o.flags=o.flags&-3|4096,o=o.sibling;else{if(ds(),l===p){n=Eo(e,n,o);break e}Nn(e,n,l,o)}n=n.child}return n;case 5:return Ed(n),e===null&&Gu(n),l=n.type,p=n.pendingProps,g=e!==null?e.memoizedProps:null,E=p.children,Hu(l,p)?E=null:g!==null&&Hu(l,g)&&(n.flags|=32),ip(e,n),Nn(e,n,E,o),n.child;case 6:return e===null&&Gu(n),null;case 13:return up(e,n,o);case 4:return ic(n,n.stateNode.containerInfo),l=n.pendingProps,e===null?n.child=ps(n,null,l,o):Nn(e,n,l,o),n.child;case 11:return l=n.type,p=n.pendingProps,p=n.elementType===l?p:Nr(l,p),tp(e,n,l,p,o);case 7:return Nn(e,n,n.pendingProps,o),n.child;case 8:return Nn(e,n,n.pendingProps.children,o),n.child;case 12:return Nn(e,n,n.pendingProps.children,o),n.child;case 10:e:{if(l=n.type._context,p=n.pendingProps,g=n.memoizedProps,E=p.value,kt(dl,l._currentValue),l._currentValue=E,g!==null)if(se(g.value,E)){if(g.children===p.children&&!On.current){n=Eo(e,n,o);break e}}else for(g=n.child,g!==null&&(g.return=n);g!==null;){var D=g.dependencies;if(D!==null){E=g.child;for(var U=D.firstContext;U!==null;){if(U.context===l){if(g.tag===1){U=ko(-1,o&-o),U.tag=2;var ye=g.updateQueue;if(ye!==null){ye=ye.shared;var je=ye.pending;je===null?U.next=U:(U.next=je.next,je.next=U),ye.pending=U}}g.lanes|=o,U=g.alternate,U!==null&&(U.lanes|=o),nc(g.return,o,n),D.lanes|=o;break}U=U.next}}else if(g.tag===10)E=g.type===n.type?null:g.child;else if(g.tag===18){if(E=g.return,E===null)throw Error(i(341));E.lanes|=o,D=E.alternate,D!==null&&(D.lanes|=o),nc(E,o,n),E=g.sibling}else E=g.child;if(E!==null)E.return=g;else for(E=g;E!==null;){if(E===n){E=null;break}if(g=E.sibling,g!==null){g.return=E.return,E=g;break}E=E.return}g=E}Nn(e,n,p.children,o),n=n.child}return n;case 9:return p=n.type,l=n.pendingProps.children,ms(n,o),p=dr(p),l=l(p),n.flags|=1,Nn(e,n,l,o),n.child;case 14:return l=n.type,p=Nr(l,n.pendingProps),p=Nr(l.type,p),np(e,n,l,p,o);case 15:return rp(e,n,n.type,n.pendingProps,o);case 17:return l=n.type,p=n.pendingProps,p=n.elementType===l?p:Nr(l,p),kl(e,n),n.tag=1,Rn(l)?(e=!0,sl(n)):e=!1,ms(n,o),Yd(n,l,p),vc(n,l,p,o),Sc(null,n,l,!0,e,o);case 19:return fp(e,n,o);case 22:return op(e,n,o)}throw Error(i(156,n.tag))};function Op(e,n){return ci(e,n)}function Fy(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 Fy(e,n,o,l)}function Hc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function By(e){if(typeof e=="function")return Hc(e)?1:0;if(e!=null){if(e=e.$$typeof,e===le)return 11;if(e===ue)return 14}return 2}function oi(e,n){var o=e.alternate;return o===null?(o=mr(e.tag,n,e.key,e.mode),o.elementType=e.elementType,o.type=e.type,o.stateNode=e.stateNode,o.alternate=e,e.alternate=o):(o.pendingProps=n,o.type=e.type,o.flags=0,o.subtreeFlags=0,o.deletions=null),o.flags=e.flags&14680064,o.childLanes=e.childLanes,o.lanes=e.lanes,o.child=e.child,o.memoizedProps=e.memoizedProps,o.memoizedState=e.memoizedState,o.updateQueue=e.updateQueue,n=e.dependencies,o.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},o.sibling=e.sibling,o.index=e.index,o.ref=e.ref,o}function Ol(e,n,o,l,p,g){var E=2;if(l=e,typeof e=="function")Hc(e)&&(E=1);else if(typeof e=="string")E=5;else e:switch(e){case q:return Ii(o.children,p,g,n);case pe:E=8,p|=8;break;case he:return e=mr(12,o,n,p|2),e.elementType=he,e.lanes=g,e;case xe:return e=mr(13,o,n,p),e.elementType=xe,e.lanes=g,e;case z:return e=mr(19,o,n,p),e.elementType=z,e.lanes=g,e;case ae:return Rl(o,p,g,n);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case _e:E=10;break e;case Q:E=9;break e;case le:E=11;break e;case ue: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=g,n}function Ii(e,n,o,l){return e=mr(7,e,l,n),e.lanes=o,e}function Rl(e,n,o,l){return e=mr(22,e,l,n),e.elementType=ae,e.lanes=o,e.stateNode={isHidden:!1},e}function Vc(e,n,o){return e=mr(6,e,null,n),e.lanes=o,e}function Kc(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 Hy(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=so(0),this.expirationTimes=so(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=so(0),this.identifierPrefix=l,this.onRecoverableError=p,this.mutableSourceEagerHydrationData=null}function Uc(e,n,o,l,p,g,E,D,U){return e=new Hy(e,n,o,D,U),n===1?(n=1,g===!0&&(n|=8)):n=0,g=mr(3,null,null,n),e.current=g,g.stateNode=e,g.memoizedState={element:l,isDehydrated:o,cache:null,transitions:null,pendingSuspenseBoundaries:null},oc(g),e}function Vy(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 Rp(e){if(!e)return Xo;e=e._reactInternals;e:{if(Dt(e)!==e||e.tag!==1)throw Error(i(170));var n=e;do{switch(n.tag){case 3:n=n.stateNode.context;break e;case 1:if(Rn(n.type)){n=n.stateNode.__reactInternalMemoizedMergedChildContext;break e}}n=n.return}while(n!==null);throw Error(i(171))}if(e.tag===1){var o=e.type;if(Rn(o))return cd(e,o,n)}return n}function Dp(e,n,o,l,p,g,E,D,U){return e=Uc(o,l,!0,e,p,g,E,D,U),e.context=Rp(null),o=e.current,l=Cn(),p=ni(o),g=ko(l,p),g.callback=n??null,Zo(o,g,p),e.current.lanes=p,ur(e,p,l),Ln(e,l),e}function Dl(e,n,o,l){var p=n.current,g=Cn(),E=ni(p);return o=Rp(o),n.context===null?n.context=o:n.pendingContext=o,n=ko(g,E),n.payload={element:e},l=l===void 0?null:l,l!==null&&(n.callback=l),e=Zo(p,n,E),e!==null&&(jr(e,p,E,g),hl(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 qc(e,n){zp(e,n),(e=e.alternate)&&zp(e,n)}function Ky(){return null}var Lp=typeof reportError=="function"?reportError:function(e){console.error(e)};function Wc(e){this._internalRoot=e}Ll.prototype.render=Wc.prototype.render=function(e){var n=this._internalRoot;if(n===null)throw Error(i(409));Dl(e,n,null,null)},Ll.prototype.unmount=Wc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var n=e.containerInfo;ji(function(){Dl(null,e,null,null)}),n[xo]=null}};function Ll(e){this._internalRoot=e}Ll.prototype.unstable_scheduleHydration=function(e){if(e){var n=Va();e={blockedOn:null,target:e,priority:n};for(var o=0;o<An.length&&n!==0&&n<An[o].priority;o++);An.splice(o,0,e),o===0&&Xn(e)}};function Yc(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Fl(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Fp(){}function Uy(e,n,o,l,p){if(p){if(typeof l=="function"){var g=l;l=function(){var ye=zl(E);g.call(ye)}}var E=Dp(n,l,e,0,null,!1,!1,"",Fp);return e._reactRootContainer=E,e[xo]=E.current,Zs(e.nodeType===8?e.parentNode:e),ji(),E}for(;p=e.lastChild;)e.removeChild(p);if(typeof l=="function"){var D=l;l=function(){var ye=zl(U);D.call(ye)}}var U=Uc(e,0,!1,null,null,!1,!1,"",Fp);return e._reactRootContainer=U,e[xo]=U.current,Zs(e.nodeType===8?e.parentNode:e),ji(function(){Dl(n,U,o,l)}),U}function Bl(e,n,o,l,p){var g=o._reactRootContainer;if(g){var E=g;if(typeof p=="function"){var D=p;p=function(){var U=zl(E);D.call(U)}}Dl(n,E,e,p)}else E=Uy(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=Yn(n.pendingLanes);o!==0&&(Ro(n,o|1),Ln(n,yt()),(xt&6)===0&&(ws=yt()+500,Qo()))}break;case 13:ji(function(){var l=bo(e,1);if(l!==null){var p=Cn();jr(l,e,1,p)}}),qc(e,1)}},Vi=function(e){if(e.tag===13){var n=bo(e,134217728);if(n!==null){var o=Cn();jr(n,e,134217728,o)}qc(e,134217728)}},Ha=function(e){if(e.tag===13){var n=ni(e),o=bo(e,n);if(o!==null){var l=Cn();jr(o,e,n,l)}qc(e,n)}},Va=function(){return wt},pn=function(e,n){var o=wt;try{return wt=e,n()}finally{wt=o}},He=function(e,n,o){switch(n){case"input":if(ht(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=ol(l);if(!p)throw Error(i(90));Be(l),ht(l,p)}}}break;case"textarea":gr(e,o);break;case"select":n=o.value,n!=null&&bt(e,!!o.multiple,n,!1)}},Io=Lc,eo=ji;var qy={usingClientEntryPoint:!1,Events:[ta,as,ol,Jr,Rr,Lc]},ma={findFiberByHostInstance:_i,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Wy={bundleType:ma.bundleType,version:ma.version,rendererPackageName:ma.rendererPackageName,rendererConfig:ma.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:R.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=ui(e),e===null?null:e.stateNode},findFiberByHostInstance:ma.findFiberByHostInstance||Ky,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Hl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Hl.isDisabled&&Hl.supportsFiber)try{ar=Hl.inject(Wy),En=Hl}catch{}}return Fn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=qy,Fn.createPortal=function(e,n){var o=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Yc(n))throw Error(i(200));return Vy(e,n,null,o)},Fn.createRoot=function(e,n){if(!Yc(e))throw Error(i(299));var o=!1,l="",p=Lp;return n!=null&&(n.unstable_strictMode===!0&&(o=!0),n.identifierPrefix!==void 0&&(l=n.identifierPrefix),n.onRecoverableError!==void 0&&(p=n.onRecoverableError)),n=Uc(e,1,!1,null,null,o,!1,l,p),e[xo]=n.current,Zs(e.nodeType===8?e.parentNode:e),new Wc(n)},Fn.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var n=e._reactInternals;if(n===void 0)throw typeof e.render=="function"?Error(i(188)):(e=Object.keys(e).join(","),Error(i(268,e)));return e=ui(n),e=e===null?null:e.stateNode,e},Fn.flushSync=function(e){return ji(e)},Fn.hydrate=function(e,n,o){if(!Fl(n))throw Error(i(200));return Bl(null,e,n,!0,o)},Fn.hydrateRoot=function(e,n,o){if(!Yc(e))throw Error(i(405));var l=o!=null&&o.hydratedSources||null,p=!1,g="",E=Lp;if(o!=null&&(o.unstable_strictMode===!0&&(p=!0),o.identifierPrefix!==void 0&&(g=o.identifierPrefix),o.onRecoverableError!==void 0&&(E=o.onRecoverableError)),n=Dp(n,null,e,1,o??null,p,!1,g,E),e[xo]=n.current,Zs(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 Ll(n)},Fn.render=function(e,n,o){if(!Fl(n))throw Error(i(200));return Bl(null,e,n,!1,o)},Fn.unmountComponentAtNode=function(e){if(!Fl(e))throw Error(i(40));return e._reactRootContainer?(ji(function(){Bl(null,null,e,!1,function(){e._reactRootContainer=null,e[xo]=null})}),!0):!1},Fn.unstable_batchedUpdates=Lc,Fn.unstable_renderSubtreeIntoContainer=function(e,n,o,l){if(!Fl(o))throw Error(i(200));if(e==null||e._reactInternals===void 0)throw Error(i(38));return Bl(e,n,o,!1,l)},Fn.version="18.3.1-next-f1338f8080-20240426",Fn}var Yp;function um(){if(Yp)return Gc.exports;Yp=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(),Gc.exports=r0(),Gc.exports}var Xp;function o0(){if(Xp)return Vl;Xp=1;var t=um();return Vl.createRoot=t.createRoot,Vl.hydrateRoot=t.hydrateRoot,Vl}var i0=o0();const s0=vu(i0),a0=["get","post","put","patch","delete","options","head","trace"];function Qp(t){return t.replace(/[^a-zA-Z0-9]+/g,"_").replace(/^_|_$/g,"").replace(/_+/g,"_")}function xu(t,r,i,a){if(i)return Qp(i).replace(/^[0-9]/,"_$&")||`op_${a}`;const u=Qp(r.replace(/[{}]/g,""));return`${t}_${u}`||`op_${a}`}function wu(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 _u(t){return(t.split(/[^a-zA-Z0-9]+/).filter(Boolean).map(i=>i.charAt(0).toUpperCase()+i.slice(1).toLowerCase()).join("")||"Api")+"Service"}function Gr(t){const r=[];if(!t.paths)return r;for(const[i,a]of Object.entries(t.paths)){if(!a||typeof a!="object"||"$ref"in a)continue;const u=a;for(const f of a0){const d=u[f];d&&typeof d=="object"&&r.push({method:f,path:i,operationId:d.operationId,tags:d.tags})}}return r}function l0(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 cm(t,r){const i=t.map((a,u)=>` /**
49
+ * @param {{ headers?: Record<string, string> }} [options]
50
+ * @returns {Promise<unknown>}
51
+ */
52
+ async ${xu(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 u0(t){return cm(Gr(t),wu(t))}function c0(t,r){const i=_u(r),a=Gr(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 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 fm(t,r){const i=t.map((a,u)=>` public function ${xu(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 d0(t){return fm(Gr(t),wu(t))}function p0(t,r){const i=_u(r),a=Gr(t).filter(u=>{var f;return(f=u.tags)==null?void 0:f.includes(r)});return fm(a,i)}function h0(t,r,i){var d,m;const a=((m=(d=t.servers)==null?void 0:d[0])==null?void 0:m.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 dm(t,r){const i=t.map((a,u)=>{const f=xu(a.method,a.path,a.operationId,u),d=a.method.toLowerCase(),m=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${m})
137
+ return r.json()`});return`from __future__ import annotations
138
+ import httpx
139
+
140
+ class ${r}:
141
+ def __init__(self, base_url: str, default_headers: dict | None = None) -> None:
142
+ self.base_url = base_url.rstrip("/")
143
+ self.default_headers = default_headers or {}
144
+ self._client = httpx.Client()
145
+
146
+ def close(self) -> None:
147
+ self._client.close()
148
+
149
+ ${i.join(`
150
+
151
+ `)}
152
+ `}function m0(t){return dm(Gr(t),wu(t))}function g0(t,r){const i=_u(r),a=Gr(t).filter(u=>{var f;return(f=u.tags)==null?void 0:f.includes(r)});return dm(a,i)}function y0(t){const r=t.split("/");return(r[r.length-1]??"Unknown").replace(/[^a-zA-Z0-9_]/g,"_")}function yf(t){if(!t)return"unknown";if("$ref"in t&&t.$ref)return y0(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?`${yf(r.items)}[]`:r.type==="object"&&r.properties?`{
153
+ ${Object.entries(r.properties).map(([a,u])=>` ${JSON.stringify(a)}?: ${yf(u)};`).join(`
154
+ `)}
155
+ }`:"Record<string, unknown>"}function v0(t,r,i,a="baseUrl"){var w,b,x,S,N,P;const u=(b=(w=t.paths)==null?void 0:w[i])==null?void 0:b[r],f=u==null?void 0:u.requestBody;let d;if((S=(x=f==null?void 0:f.content)==null?void 0:x["application/json"])!=null&&S.schema){const $=f.content["application/json"].schema;$&&!("$ref"in $)&&(d=$)}const m=d?yf(d):"Record<string, unknown>",v=r.toUpperCase();return`const ${a} = "${((P=(N=t.servers)==null?void 0:N[0])==null?void 0:P.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 ${m}),`}
160
+ });
161
+ const data = await res.json() as unknown;
162
+ `}function pm(t,r){const i=t.map((a,u)=>` async ${xu(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 x0(t){const r=Gr(t),i=wu(t);return pm(r,i)}function w0(t,r){const i=_u(r),a=Gr(t).filter(u=>{var f;return(f=u.tags)==null?void 0:f.includes(r)});return pm(a,i)}function _0(t,r,i,a){switch(r){case"typescript":return v0(t,i,a);case"javascript":return l0(t,i,a);case"python":return h0(t,i,a);case"php":return f0(t,i,a);default:{const u=r;throw new Error(`Unsupported language: ${u}`)}}}function S0(t,r,i){switch(r){case"typescript":return w0(t,i);case"javascript":return c0(t,i);case"python":return g0(t,i);case"php":return p0(t,i);default:{const a=r;throw new Error(`Unsupported language: ${a}`)}}}function b0(t,r,i){if(i===null)switch(r){case"typescript":return x0(t);case"javascript":return u0(t);case"python":return m0(t);case"php":return d0(t);default:{const a=r;throw new Error(`Unsupported language: ${a}`)}}return S0(t,r,i)}function k0(t){const r=new Set;for(const i of Gr(t))for(const a of i.tags??[])r.add(a);return r.size===0&&r.add("default"),[...r].sort()}function Ss(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 E0(t){var i;const r=(i=t.components)==null?void 0:i.securitySchemes;return r?Object.keys(r):[]}function $f(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 Jl={exports:{}},N0=Jl.exports,Gp;function C0(){return Gp||(Gp=1,(function(t,r){((i,a)=>{t.exports=a()})(N0,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:Gy,d=Object.keys,m=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,b={}.hasOwnProperty;function x(s,c){return b.call(s,c)}function S(s,c){typeof c=="function"&&(c=c(w(s))),(typeof Reflect>"u"?d:Reflect.ownKeys)(c).forEach(function(h){P(s,h,c[h])})}var N=Object.defineProperty;function P(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 $(s){return{from:function(c){return s.prototype=Object.create(c.prototype),P(s.prototype,"constructor",s),{extend:S.bind(null,s.prototype)}}}}var M=Object.getOwnPropertyDescriptor,I=[].slice;function H(s,c,h){return I.call(s,c,h)}function j(s,c){return c(s)}function R(s){if(!s)throw new Error("Assertion Failed")}function W(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 T,A=c.indexOf(".");return A===-1||(T=s[c.substr(0,A)])==null?void 0:V(T,c.substr(A+1))}function q(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)q(s,c[y],h[y])}else{var k,T,A=c.indexOf(".");A!==-1?(k=c.substr(0,A),(A=c.substr(A+1))===""?h===void 0?m(s)&&!isNaN(parseInt(k))?s.splice(k,1):delete s[k]:s[k]=h:q(T=(T=s[k])&&x(s,k)?T:s[k]={},A,h)):h===void 0?m(s)&&!isNaN(parseInt(c))?s.splice(c,1):delete s[c]:s[c]=h}}function pe(s){var c,h={};for(c in s)x(s,c)&&(h[c]=s[c]);return h}var he=[].concat;function _e(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(_e([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]})),le=null;function xe(s){return le=new WeakMap,s=(function c(h){if(!h||typeof h!="object")return h;var y=le.get(h);if(y)return y;if(m(h)){y=[],le.set(h,y);for(var _=0,k=h.length;_<k;++_)y.push(c(h[_]))}else if(Q.has(h.constructor))y=h;else{var T,A=w(h);for(T in y=A===Object.prototype?{}:Object.create(A),le.set(h,y),h)x(h,T)&&(y[T]=c(h[T]))}return y})(s),le=null,s}var z={}.toString;function ue(s){return z.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 X(s){var c,h,y,_;if(arguments.length===1){if(m(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"],Et=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(B),ke={VersionChanged:"Database version changed by other database connection",DatabaseClosed:"Database has been closed",Abort:"Transaction aborted",TransactionInactive:"Transaction has already completed or failed",MissingAPI:"IndexedDB API missing. Please visit https://tinyurl.com/y2uuvskb"};function Se(s,c){this.name=s,this.message=c}function Ie(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 Re(s,c,h,y){this.failures=c,this.failedKeys=y,this.successCount=h,this.message=Ie(s,c)}function Ae(s,c){this.name="BulkError",this.failures=Object.keys(c).map(function(h){return c[h]}),this.failuresByPos=c,this.message=Ie(s,this.failures)}$(Se).from(Error).extend({toString:function(){return this.name+": "+this.message}}),$(Re).from(Se),$(Ae).from(Se);var we=Et.reduce(function(s,c){return s[c]=c+"Error",s},{}),Fe=Se,be=Et.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=ke[c]||h,this.inner=null)}return $(y).from(Fe),s[c]=y,s},{}),Je=(be.Syntax=SyntaxError,be.Type=TypeError,be.Range=RangeError,B.reduce(function(s,c){return s[c+"Error"]=be[c],s},{}));B=Et.reduce(function(s,c){return["Syntax","Type","Range"].indexOf(c)===-1&&(s[c+"Error"]=be[c]),s},{});function Be(){}function Ye(s){return s}function ut(s,c){return s==null||s===Ye?c:function(h){return c(s(h))}}function st(s,c){return function(){s.apply(this,arguments),c.apply(this,arguments)}}function ct(s,c){return s===Be?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?st(y,this.onsuccess):y),_&&(this.onerror=this.onerror?st(_,this.onerror):_),k!==void 0?k:h}}function ht(s,c){return s===Be?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?st(h,this.onsuccess):h),y&&(this.onerror=this.onerror?st(y,this.onerror):y)}}function xn(s,c){return s===Be?c:function(_){var y=s.apply(this,arguments),_=(v(_,y),this.onsuccess),k=this.onerror,T=(this.onsuccess=null,this.onerror=null,c.apply(this,arguments));return _&&(this.onsuccess=this.onsuccess?st(_,this.onsuccess):_),k&&(this.onerror=this.onerror?st(k,this.onerror):k),y===void 0?T===void 0?void 0:T:v(y,T)}}function Lt(s,c){return s===Be?c:function(){return c.apply(this,arguments)!==!1&&s.apply(this,arguments)}}function Ft(s,c){return s===Be?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=Re,B.DexieError=Se,B.BulkError=Ae;var bt=typeof location<"u"&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function Pn(s){bt=s}var cn={},gr=100,wn=typeof Promise>"u"?[]:(Et=Promise.resolve(),typeof crypto<"u"&&crypto.subtle?[wn=crypto.subtle.digest("SHA-512",new Uint8Array([0])),w(wn),Et]:[Et,w(Et),Et]),Et=wn[0],ho=wn[1],ho=ho&&ho.then,Ht=Et&&Et.constructor,Hn=!!wn[2],tr=function(s,c){Kn.push([s,c]),jn&&(queueMicrotask(eo),jn=!1)},_n=!0,jn=!0,Vn=[],fn=[],nr=Ye,Sn={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:Be,pgp:!1,env:{},finalize:Be},qe=Sn,Kn=[],bn=0,rr=[];function He(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!==cn)throw new TypeError("Not a function");this._state=arguments[1],this._value=arguments[2],this._state===!1&&Or(this,this._value)}else this._state=null,this._value=null,++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 T=y._lib&&kn();k&&typeof k.then=="function"?h(y,function(A,G){k instanceof He?k._then(A,G):k.then(A,G)}):(y._state=!0,y._value=k,Jr(y)),T&&Mn()}},Or.bind(null,y))}catch(k){Or(y,k)}})(this,s)}var Tn={get:function(){var s=qe,c=nn;function h(y,_){var k=this,T=!s.global&&(s!==qe||c!==nn),A=T&&!Dt(),G=new He(function(se,J){Rr(k,new Un(ci(y,s,T,A),ci(_,s,T,A),se,J,s))});return this._consoleTask&&(G._consoleTask=this._consoleTask),G}return h.prototype=cn,h},set:function(s){P(this,"then",s&&s.prototype===cn?Tn:{get:function(){return s},set:Tn.set})}};function Un(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 Or(s,c){var h,y;fn.push(c),s._state===null&&(h=s._lib&&kn(),c=nr(c),s._state=!1,s._value=c,y=s,Vn.some(function(_){return _._value===y._value})||Vn.push(y),Jr(s),h)&&Mn()}function Jr(s){var c=s._listeners;s._listeners=[];for(var h=0,y=c.length;h<y;++h)Rr(s,c[h]);var _=s._PSD;--_.ref||_.finalize(),bn===0&&(++bn,tr(function(){--bn==0&&K()},[]))}function Rr(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,++bn,tr(Io,[h,s,c])}}function Io(s,c,h){try{var y,_=c._value;!c._state&&fn.length&&(fn=[]),y=bt&&c._consoleTask?c._consoleTask.run(function(){return s(_)}):s(_),c._state||fn.indexOf(_)!==-1||(k=>{for(var T=Vn.length;T;)if(Vn[--T]._value===k._value)return Vn.splice(T,1)})(c),h.resolve(y)}catch(k){h.reject(k)}finally{--bn==0&&K(),--h.psd.ref||h.psd.finalize()}}function eo(){ir(Sn,function(){kn()&&Mn()})}function kn(){var s=_n;return jn=_n=!1,s}function Mn(){var s,c,h;do for(;0<Kn.length;)for(s=Kn,Kn=[],h=s.length,c=0;c<h;++c){var y=s[c];y[0].apply(null,y[1])}while(0<Kn.length);jn=_n=!0}function K(){for(var s=Vn,c=(Vn=[],s.forEach(function(y){y._PSD.onunhandled.call(null,y._value,y)}),rr.slice(0)),h=c.length;h;)c[--h]()}function ze(s){return new He(cn,!1,s)}function Le(s,c){var h=qe;return function(){var y=kn(),_=qe;try{return In(h,!0),s.apply(this,arguments)}catch(k){c&&c(k)}finally{In(_,!1),y&&Mn()}}}S(He.prototype,{then:Tn,_then:function(s,c){Rr(this,new Un(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:ze)(y)}):this.then(null,function(y){return(y&&y.name===c?h:ze)(y)}))},finally:function(s){return this.then(function(c){return He.resolve(s()).then(function(){return c})},function(c){return He.resolve(s()).then(function(){return ze(c)})})},timeout:function(s,c){var h=this;return s<1/0?new He(function(y,_){var k=setTimeout(function(){return _(new be.Timeout(c))},s);h.then(y,_).finally(clearTimeout.bind(null,k))}):this}}),typeof Symbol<"u"&&Symbol.toStringTag&&P(He.prototype,Symbol.toStringTag,"Dexie.Promise"),Sn.env=ui(),S(He,{all:function(){var s=X.apply(null,arguments).map(Wn);return new He(function(c,h){s.length===0&&c([]);var y=s.length;s.forEach(function(_,k){return He.resolve(_).then(function(T){s[k]=T,--y||c(s)},h)})})},resolve:function(s){return s instanceof He?s:s&&typeof s.then=="function"?new He(function(c,h){s.then(c,h)}):new He(cn,!0,s)},reject:ze,race:function(){var s=X.apply(null,arguments).map(Wn);return new He(function(c,h){s.map(function(y){return He.resolve(y).then(c,h)})})},PSD:{get:function(){return qe},set:function(s){return qe=s}},totalEchoes:{get:function(){return nn}},newPSD:rn,usePSD:ir,scheduler:{get:function(){return tr},set:function(s){tr=s}},rejectionMapper:{get:function(){return nr},set:function(s){nr=s}},follow:function(s,c){return new He(function(h,y){return rn(function(_,k){var T=qe;T.unhandleds=[],T.onunhandled=k,T.finalize=st(function(){var A,G=this;A=function(){G.unhandleds.length===0?_():k(G.unhandleds[0])},rr.push(function se(){A(),rr.splice(rr.indexOf(se),1)}),++bn,tr(function(){--bn==0&&K()},[])},T.finalize),s()},c,h,y)})}}),Ht&&(Ht.allSettled&&P(He,"allSettled",function(){var s=X.apply(null,arguments).map(Wn);return new He(function(c){s.length===0&&c([]);var h=s.length,y=new Array(h);s.forEach(function(_,k){return He.resolve(_).then(function(T){return y[k]={status:"fulfilled",value:T}},function(T){return y[k]={status:"rejected",reason:T}}).then(function(){return--h||c(y)})})})}),Ht.any&&typeof AggregateError<"u"&&P(He,"any",function(){var s=X.apply(null,arguments).map(Wn);return new He(function(c,h){s.length===0&&h(new AggregateError([]));var y=s.length,_=new Array(y);s.forEach(function(k,T){return He.resolve(k).then(function(A){return c(A)},function(A){_[T]=A,--y||h(new AggregateError(_))})})})}),Ht.withResolvers)&&(He.withResolvers=Ht.withResolvers);var et={awaits:0,echoes:0,id:0},Wt=0,Yt=[],Vt=0,nn=0,to=0;function rn(s,T,h,y){var _=qe,k=Object.create(_),T=(k.parent=_,k.ref=0,k.global=!1,k.id=++to,Sn.env,k.env=Hn?{Promise:He,PromiseProp:{value:He,configurable:!0,writable:!0},all:He.all,race:He.race,allSettled:He.allSettled,any:He.any,resolve:He.resolve,reject:He.reject}:{},T&&v(k,T),++_.ref,k.finalize=function(){--this.parent.ref||this.parent.finalize()},ir(k,s,h,y));return k.ref===0&&k.finalize(),T}function qn(){return et.id||(et.id=++Wt),++et.awaits,et.echoes+=gr,et.id}function Dt(){return!!et.awaits&&(--et.awaits==0&&(et.id=0),et.echoes=et.awaits*gr,!0)}function Wn(s){return et.echoes&&s&&s.constructor===Ht?(qn(),s.then(function(c){return Dt(),c},function(c){return Dt(),Nt(c)})):s}function or(){var s=Yt[Yt.length-1];Yt.pop(),In(s,!1)}function In(s,c){var h,y,_=qe;(c?!et.echoes||Vt++&&s===qe:!Vt||--Vt&&s===qe)||queueMicrotask(c?(function(k){++nn,et.echoes&&--et.echoes!=0||(et.echoes=et.awaits=et.id=0),Yt.push(qe),In(k,!0)}).bind(null,s):or),s!==qe&&(qe=s,_===Sn&&(Sn.env=ui()),Hn)&&(h=Sn.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 ui(){var s=f.Promise;return Hn?{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 In(s,!0),c(h,y,_)}finally{In(k,!1)}}function ci(s,c,h,y){return typeof s!="function"?s:function(){var _=qe;h&&qn(),In(c,!0);try{return s.apply(this,arguments)}finally{In(_,!1),y&&queueMicrotask(Dt)}}}function Ao(s){Promise===Ht&&et.echoes===0?Vt===0?s():enqueueNativeMicroTask(s):setTimeout(s,0)}(""+ho).indexOf("[native code]")===-1&&(qn=Dt=Be);var Nt=He.reject,sr="￿",yt="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",Bi="String expected.",Dr="__dbnames",$o="readonly",zr="readwrite";function yr(s,c){return s?c?function(){return s.apply(this,arguments)&&c.apply(this,arguments)}:s:c}var fi={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 En(){throw be.Type("Entity instances must never be new:ed. Instances are generated by the framework bypassing the constructor.")}function ft(s,c){try{var h=dn(s),y=dn(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 _=Hi(s),k=Hi(c),T=_.length,A=k.length,G=T<A?T:A,se=0;se<G;++se)if(_[se]!==k[se])return _[se]<k[se]?-1:1;return T===A?0:T<A?-1:1;case"Array":for(var J=s,Y=c,Z=J.length,ie=Y.length,re=Z<ie?Z:ie,ne=0;ne<re;++ne){var oe=ft(J[ne],Y[ne]);if(oe!==0)return oe}return Z===ie?0:Z<ie?-1:1}}catch{}return NaN}function dn(s){var c=typeof s;return c=="object"&&(ArrayBuffer.isView(s)||(c=ue(s))==="ArrayBuffer")?"binary":c}function Hi(s){return s instanceof Uint8Array?s:ArrayBuffer.isView(s)?new Uint8Array(s.buffer,s.byteOffset,s.byteLength):new Uint8Array(s)}function Oo(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}ro.prototype.execute=function(s){var c=this["@@propmod"];if(c.add!==void 0){var h=c.add;if(m(h))return u(u([],m(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(m(y))return m(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 no=ro;function ro(s){this["@@propmod"]=s}function oo(s,c){for(var h=d(c),y=h.length,_=!1,k=0;k<y;++k){var T=h[k],A=c[T],G=V(s,T);A instanceof no?(q(s,T,A.execute(G)),_=!0):G!==A&&(q(s,T,A),_=!0)}return _}vt.prototype._trans=function(s,c,h){var y=this._tx||qe.trans,_=this.name,k=bt&&typeof console<"u"&&console.createTask&&console.createTask("Dexie: ".concat(s==="readonly"?"read":"write"," ").concat(this.name));function T(se,J,Y){if(Y.schema[_])return c(Y.idbtrans,Y);throw new be.NotFound("Table "+_+" not part of transaction")}var A=kn();try{var G=y&&y.db._novip===this.db._novip?y===qe.trans?y._promise(s,T,h):rn(function(){return y._promise(s,T,h)},{trans:y,transless:qe.transless||qe}):(function se(J,Y,Z,ie){if(J.idbdb&&(J._state.openComplete||qe.letThrough||J._vip)){var re=J._createTransaction(Y,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,Y,Z,ie)})):Nt(ne)}return re._promise(Y,function(ne,oe){return rn(function(){return qe.trans=re,ie(ne,oe,re)})}).then(function(ne){if(Y==="readwrite")try{re.idbtrans.commit()}catch{}return Y==="readonly"?ne:re._completion.then(function(){return ne})})}if(J._state.openComplete)return Nt(new be.DatabaseClosed(J._state.dbOpenError));if(!J._state.isBeingOpened){if(!J._state.autoOpen)return Nt(new be.DatabaseClosed);J.open().catch(Be)}return J._state.dbReadyPromise.then(function(){return se(J,Y,Z,ie)})})(this.db,s,[this.name],T);return k&&(G._consoleTask=k,G=G.catch(function(se){return console.trace(se),Nt(se)})),G}finally{A&&Mn()}},vt.prototype.get=function(s,c){var h=this;return s&&s.constructor===Object?this.where(s).first(c):s==null?Nt(new be.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(m(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(A){if(A.compound&&c.every(function(se){return 0<=A.keyPath.indexOf(se)})){for(var G=0;G<c.length;++G)if(c.indexOf(A.keyPath[G])===-1)return!1;return!0}return!1}).sort(function(A,G){return A.keyPath.length-G.keyPath.length})[0];if(h&&this.db._maxKey!==sr)return T=h.keyPath.slice(0,c.length),this.where(T).equals(T.map(function(A){return s[A]}));!h&&bt&&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 _(A,G){return ft(A,G)===0}var T=c.reduce(function(J,G){var se=J[0],J=J[1],Y=y[G],Z=s[G];return[se||Y,se||!Y?yr(J,Y&&Y.multi?function(ie){return ie=V(ie,G),m(ie)&&ie.some(function(re){return _(Z,re)})}:function(ie){return _(Z,V(ie,G))}):J]},[null,null]),k=T[0],T=T[1];return k?this.where(k.name).equals(s[k.keyPath]).filter(T):h?this.filter(T):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,m(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 En&&(s=(T=>{var A=J,G=T;if(typeof G!="function"&&G!==null)throw new TypeError("Class extends value "+String(G)+" is not a constructor or null");function se(){this.constructor=A}function J(){return T!==null&&T.apply(this,arguments)||this}return i(A,G),A.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(T){return y.add(T)});function k(T){if(!T)return T;var A,G=Object.create(s.prototype);for(A in T)if(!y.has(A))try{G[A]=T[A]}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,T=s;return k&&_&&(T=ar(k)(s)),this._trans("readwrite",function(A){return h.core.mutate({trans:A,type:"add",keys:c!=null?[c]:null,values:[T]})}).then(function(A){return A.numFailures?He.reject(A.failures[0]):A.lastResult}).then(function(A){if(k)try{q(s,k,A)}catch{}return A})},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 T=k??{};return oo(T,c),y&&q(T,y,s),h.core.mutate({trans:_,type:"put",values:[T],keys:[s],upsert:!0,updates:{keys:[s],changeSpecs:[c]}}).then(function(A){return A.numFailures?He.reject(A.failures[0]):!!k})})})},vt.prototype.update=function(s,c){return typeof s!="object"||m(s)?this.where(":id").equals(s).modify(c):(s=V(s,this.schema.primKey.keyPath))===void 0?Nt(new be.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,T=s;return k&&_&&(T=ar(k)(s)),this._trans("readwrite",function(A){return h.core.mutate({trans:A,type:"put",values:[T],keys:c!=null?[c]:null})}).then(function(A){return A.numFailures?He.reject(A.failures[0]):A.lastResult}).then(function(A){if(k)try{q(s,k,A)}catch{}return A})},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 Oo(c,[s],y)}).then(function(y){return y.numFailures?He.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:fi}).then(function(h){return Oo(s,null,h)})}).then(function(c){return c.numFailures?He.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(T){var A=y.schema.primKey,se=A.auto,A=A.keyPath;if(A&&_)throw new be.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(_&&_.length!==s.length)throw new be.InvalidArgument("Arguments objects and keys must have the same length");var G=s.length,se=A&&se?s.map(ar(A)):s;return y.core.mutate({trans:T,type:"add",keys:_,values:se,wantResults:k}).then(function(J){var Y=J.numFailures,Z=J.failures;if(Y===0)return k?J.results:J.lastResult;throw new Ae("".concat(y.name,".bulkAdd(): ").concat(Y," 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(T){var A=y.schema.primKey,se=A.auto,A=A.keyPath;if(A&&_)throw new be.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(_&&_.length!==s.length)throw new be.InvalidArgument("Arguments objects and keys must have the same length");var G=s.length,se=A&&se?s.map(ar(A)):s;return y.core.mutate({trans:T,type:"put",keys:_,values:se,wantResults:k}).then(function(J){var Y=J.numFailures,Z=J.failures;if(Y===0)return k?J.results:J.lastResult;throw new Ae("".concat(y.name,".bulkPut(): ").concat(Y," of ").concat(G," operations failed"),Z)})})},vt.prototype.bulkUpdate=function(s){var c=this,h=this.core,y=s.map(function(T){return T.key}),_=s.map(function(T){return T.changes}),k=[];return this._trans("readwrite",function(T){return h.getMany({trans:T,keys:y,cache:"clone"}).then(function(A){var G=[],se=[],J=(s.forEach(function(Y,Z){var ie=Y.key,re=Y.changes,ne=A[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(ft(ve,ie)!==0)throw new be.Constraint("Cannot update primary key in bulkUpdate()")}else q(ne,fe,ve)}k.push(Z),G.push(ie),se.push(ne)}}),G.length);return h.mutate({trans:T,type:"put",keys:G,values:se,updates:{keys:y,changeSpecs:_}}).then(function(Y){var Z=Y.numFailures,ie=Y.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 Ae("".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 Oo(c,s,_)})}).then(function(y){var _=y.numFailures,k=y.failures;if(_===0)return y.lastResult;throw new Ae("".concat(c.name,".bulkDelete(): ").concat(_," of ").concat(h," operations failed"),k)})};var Yn=vt;function vt(){}function Lr(s){function c(T,A){if(A){for(var G=arguments.length,se=new Array(G-1);--G;)se[G-1]=arguments[G];return h[T].subscribe.apply(null,se),s}if(typeof T=="string")return h[T]}var h={};c.addEventType=k;for(var y=1,_=arguments.length;y<_;++y)k(arguments[y]);return c;function k(T,A,G){var se,J;if(typeof T!="object")return A=A||Lt,J={subscribers:[],fire:G=G||Be,subscribe:function(Y){J.subscribers.indexOf(Y)===-1&&(J.subscribers.push(Y),J.fire=A(J.fire,Y))},unsubscribe:function(Y){J.subscribers=J.subscribers.filter(function(Z){return Z!==Y}),J.fire=J.subscribers.reduce(A,G)}},h[T]=c[T]=J;d(se=T).forEach(function(Y){var Z=se[Y];if(m(Z))k(Y,se[Y][0],se[Y][1]);else{if(Z!=="asap")throw new be.InvalidArgument("Invalid event config");var ie=k(Y,Ye,function(){for(var re=arguments.length,ne=new Array(re);re--;)ne[re]=arguments[re];ie.subscribers.forEach(function(oe){W(function(){oe.apply(null,ne)})})})}})}}function io(s,c){return $(c).from({prototype:s}),c}function lr(s,c){return!(s.filter||s.algorithm||s.or)&&(c?s.justLimit:!s.replayFilter)}function Fr(s,c){s.filter=yr(s.filter,c)}function so(s,c,h){var y=s.replayFilter;s.replayFilter=y?function(){return yr(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 be.Schema("KeyPath "+s.index+" on object store "+c.name+" is not indexed")}function di(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 Ro(s,c,h,y){var _,k,T=s.replayFilter?yr(s.filter,s.replayFilter()):s.filter;return s.or?(_={},k=function(A,G,se){var J,Y;T&&!T(G,se,function(Z){return G.stop(Z)},function(Z){return G.fail(Z)})||((Y=""+(J=G.primaryKey))=="[object ArrayBuffer]"&&(Y=""+new Uint8Array(J)),x(_,Y))||(_[Y]=!0,c(A,G,se))},Promise.all([s.or._iterate(k,h),wt(di(s,y,h),s.algorithm,k,!s.keysOnly&&s.valueMapper)])):wt(di(s,y,h),yr(s.algorithm,T),c,!s.keysOnly&&s.valueMapper)}function wt(s,c,h,y){var _=Le(y?function(k,T,A){return h(y(k),T,A)}:h);return s.then(function(k){if(k)return k.start(function(){var T=function(){return k.continue()};c&&!c(k,function(A){return T=A},function(A){k.stop(A),T=Be},function(A){k.fail(A),T=Be})||_(k.value,k,function(A){return T=A}),T()})})}mt.prototype._read=function(s,c){var h=this._ctx;return h.error?h.table._trans(null,Nt.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,Nt.bind(null,c.error)):c.table._trans("readwrite",s,"locked")},mt.prototype._addAlgorithm=function(s){var c=this._ctx;c.algorithm=yr(c.algorithm,s)},mt.prototype._iterate=function(s,c){return Ro(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 Ro(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(T){return Math.min(T,_.limit)}):(y=0,Ro(_,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 T=this._ctx.dir==="next"?1:-1;function A(G,se){return ft(k(G,_),k(se,_))*T}return this.toArray(function(G){return G.sort(A)}).then(c)},mt.prototype.toArray=function(s){var c=this;return this._read(function(h){var y,_,k,T=c._ctx;return lr(T,!0)&&0<T.limit?(y=T.valueMapper,_=ur(T,T.table.core.schema),T.table.core.query({trans:h,limit:T.limit,values:!0,direction:T.dir==="prev"?"prev":void 0,query:{index:_,range:T.range}}).then(function(A){return A=A.result,y?A.map(y):A})):(k=[],Ro(T,function(A){return k.push(A)},h,T.table.core).then(function(){return k}))},s)},mt.prototype.offset=function(s){var c=this._ctx;return s<=0||(c.offset+=s,lr(c)?so(c,function(){var h=s;return function(y,_){return h===0||(h===1?--h:_(function(){y.advance(h),h=0}),!1)}}):so(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),so(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 Fr(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 Fr(this._ctx,function(h){return s(h.value)}),(c=this._ctx).isMatch=yr(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={},Fr(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];Y.push(ge[Ee])}}var k=typeof s=="function"?s:function(ne){return oo(ne,s)},T=h.table.core,J=T.schema.primaryKey,A=J.outbound,G=J.extractKey,se=200,J=c.db._options.modifyChunkSize,Y=(J&&(se=typeof J=="object"?J[T.name]||J["*"]||200:J),[]),Z=0,ie=[],re=s===Vi;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([]):T.getMany({trans:y,keys:Ee,cache:"immutable"})).then(function(Ce){var Oe=[],Te=[],Ve=A?[]:null,$e=re?Ee:[];if(!re)for(var Ue=0;Ue<ve;++Ue){var Ne=Ce[Ue],rt={value:xe(Ne),primKey:ne[fe+Ue]};k.call(rt,rt.value,rt)!==!1&&(rt.value==null?$e.push(ne[fe+Ue]):A||ft(G(Ne),G(rt.value))===0?(Te.push(rt.value),A&&Ve.push(ne[fe+Ue])):($e.push(ne[fe+Ue]),Oe.push(rt.value)))}return Promise.resolve(0<Oe.length&&T.mutate({trans:y,type:"add",values:Oe}).then(function(ot){for(var lt in ot.failures)$e.splice(parseInt(lt),1);_(Oe.length,ot)})).then(function(){return(0<Te.length||ge&&typeof s=="object")&&T.mutate({trans:y,type:"put",keys:Ve,values:Te,criteria:ge,changeSpec:typeof s!="function"&&s,isAdditionalChunk:0<fe}).then(function(ot){return _(Te.length,ot)})}).then(function(){return(0<$e.length||ge&&re)&&T.mutate({trans:y,type:"delete",keys:$e,criteria:ge,isAdditionalChunk:0<fe}).then(function(ot){return Oo(h.table,$e,ot)}).then(function(ot){return _($e.length,ot)})}).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<Y.length)throw new Re("Error modifying one or more objects",Y,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(Vi):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 A=G.failures,G=G.numFailures;if(G)throw new Re("Could not delete some values",Object.keys(A).map(function(se){return A[se]}),k-G);return k-G})})})};var Ba=mt;function mt(){}var Vi=function(s,c){return c.value=null};function Ha(s,c){return s<c?-1:s===c?0:1}function Va(s,c){return c<s?-1:s===c?0:1}function pn(s,c,h){return s=s instanceof xr?new s.Collection(s):s,s._ctx.error=new(h||TypeError)(c),s}function Br(s){return new s.Collection(s,function(){return vr("")}).limit(0)}function ao(ie,c,h,y){var _,k,T,A,G,se,J,Y=h.length;if(!h.every(function(ne){return typeof ne=="string"}))return pn(ie,Bi);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()},T=ne==="next"?Ha:Va;var oe=h.map(function(ge){return{lower:k(ge),upper:_(ge)}}).sort(function(ge,fe){return T(ge.lower,fe.lower)});A=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 on(A[0],G[Y-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<Y;++Ce){var Oe=((Te,Ve,$e,Ue,Ne,rt)=>{for(var ot=Math.min(Te.length,Ue.length),lt=-1,dt=0;dt<ot;++dt){var hn=Ve[dt];if(hn!==Ue[dt])return Ne(Te[dt],$e[dt])<0?Te.substr(0,dt)+$e[dt]+$e.substr(dt+1):Ne(Te[dt],Ue[dt])<0?Te.substr(0,dt)+Ue[dt]+$e.substr(dt+1):0<=lt?Te.substr(0,lt)+Ve[lt]+$e.substr(lt+1):null;Ne(Te[dt],hn)<0&&(lt=dt)}return ot<Ue.length&&rt==="next"?Te+$e.substr(Te.length):ot<Te.length&&rt==="prev"?Te.substr(0,$e.length):lt<0?null:Te.substr(0,lt)+Ue[lt]+$e.substr(lt+1)})(fe,ve,A[Ce],G[Ce],T,se);Oe===null&&Ee===null?re=Ce+1:(Ee===null||0<T(Ee,Oe))&&(Ee=Oe)}oe(Ee!==null?function(){ne.continue(Ee+J)}:ge)}return!1}),ie}function on(s,c,h,y){return{type:2,lower:s,upper:c,lowerOpen:h,upperOpen:y}}function vr(s){return{type:1,lower:s,upper:s}}Object.defineProperty(Mt.prototype,"Collection",{get:function(){return this._ctx.table.db.Collection},enumerable:!1,configurable:!0}),Mt.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)?Br(this):new this.Collection(this,function(){return on(s,c,!h,!y)})}catch{return pn(this,yt)}},Mt.prototype.equals=function(s){return s==null?pn(this,yt):new this.Collection(this,function(){return vr(s)})},Mt.prototype.above=function(s){return s==null?pn(this,yt):new this.Collection(this,function(){return on(s,void 0,!0)})},Mt.prototype.aboveOrEqual=function(s){return s==null?pn(this,yt):new this.Collection(this,function(){return on(s,void 0,!1)})},Mt.prototype.below=function(s){return s==null?pn(this,yt):new this.Collection(this,function(){return on(void 0,s,!1,!0)})},Mt.prototype.belowOrEqual=function(s){return s==null?pn(this,yt):new this.Collection(this,function(){return on(void 0,s)})},Mt.prototype.startsWith=function(s){return typeof s!="string"?pn(this,Bi):this.between(s,s+sr,!0,!0)},Mt.prototype.startsWithIgnoreCase=function(s){return s===""?this.startsWith(s):ao(this,function(c,h){return c.indexOf(h[0])===0},[s],sr)},Mt.prototype.equalsIgnoreCase=function(s){return ao(this,function(c,h){return c===h[0]},[s],"")},Mt.prototype.anyOfIgnoreCase=function(){var s=X.apply(F,arguments);return s.length===0?Br(this):ao(this,function(c,h){return h.indexOf(c)!==-1},s,"")},Mt.prototype.startsWithAnyOfIgnoreCase=function(){var s=X.apply(F,arguments);return s.length===0?Br(this):ao(this,function(c,h){return h.some(function(y){return c.indexOf(y)===0})},s,sr)},Mt.prototype.anyOf=function(){var s,c,h=this,y=X.apply(F,arguments),_=this._cmp;try{y.sort(_)}catch{return pn(this,yt)}return y.length===0?Br(this):((s=new this.Collection(this,function(){return on(y[0],y[y.length-1])}))._ondirectionchange=function(k){_=k==="next"?h._ascending:h._descending,y.sort(_)},c=0,s._addAlgorithm(function(k,T,A){for(var G=k.key;0<_(G,y[c]);)if(++c===y.length)return T(A),!1;return _(G,y[c])===0||(T(function(){k.continue(y[c])}),!1)}),s)},Mt.prototype.notEqual=function(s){return this.inAnyRange([[-1/0,s],[s,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})},Mt.prototype.noneOf=function(){var s=X.apply(F,arguments);if(s.length===0)return new this.Collection(this);try{s.sort(this._ascending)}catch{return pn(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})},Mt.prototype.inAnyRange=function(s,ge){var h=this,y=this._cmp,_=this._ascending,k=this._descending,T=this._min,A=this._max;if(s.length===0)return Br(this);if(!s.every(function(fe){return fe[0]!==void 0&&fe[1]!==void 0&&_(fe[0],fe[1])<=0}))return pn(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",be.InvalidArgument);var G=!ge||ge.includeLowers!==!1,se=ge&&ge.includeUppers===!0,J,Y=_;function Z(fe,ve){return Y(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]=T(Oe[0],ve[0]),Oe[1]=A(Oe[1],ve[1]);break}}return Ee===Ce&&fe.push(ve),fe},[])).sort(Z)}catch{return pn(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 on(J[0][0],J[J.length-1][1],!G,!se)});return ge._ondirectionchange=function(fe){Y=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(){Y===_?fe.continue(J[ie][0]):fe.continue(J[ie][1])}),!1)}),ge},Mt.prototype.startsWithAnyOf=function(){var s=X.apply(F,arguments);return s.every(function(c){return typeof c=="string"})?s.length===0?Br(this):this.inAnyRange(s.map(function(c){return[c,c+sr]})):pn(this,"startsWithAnyOf() only works with strings")};var xr=Mt;function Mt(){}function sn(s){return Le(function(c){return An(c),s(c.target.error),!1})}function An(s){s.stopPropagation&&s.stopPropagation(),s.preventDefault&&s.preventDefault()}var pi="storagemutated",Ki="x-storagemutated-1",$n=Lr(null,pi),Au=(Xn.prototype._lock=function(){return R(!qe.global),++this._reculock,this._reculock!==1||qe.global||(qe.lockOwnerFor=this),this},Xn.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},Xn.prototype._locked=function(){return this._reculock&&qe.lockOwnerFor!==this},Xn.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 be.DatabaseClosed(y);case"MissingAPIError":throw new be.MissingAPI(y.message,y);default:throw new be.OpenFailed(y)}if(!this.active)throw new be.TransactionInactive;R(this._completion._state===null),(s=this.idbtrans=s||(this.db.core||h).transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability})).onerror=Le(function(_){An(_),c._reject(s.error)}),s.onabort=Le(function(_){An(_),c.active&&c._reject(new be.Abort(s.error)),c.active=!1,c.on("abort").fire(_)}),s.oncomplete=Le(function(){c.active=!1,c._resolve(),"mutatedParts"in s&&$n.storagemutated.fire(s.mutatedParts)})}return this},Xn.prototype._promise=function(s,c,h){var y,_=this;return s==="readwrite"&&this.mode!=="readwrite"?Nt(new be.ReadOnly("Transaction is readonly")):this.active?this._locked()?new He(function(k,T){_._blockedFuncs.push([function(){_._promise(s,c,h).then(k,T)},qe])}):h?rn(function(){var k=new He(function(T,A){_._lock();var G=c(T,A,_);G&&G.then&&G.then(T,A)});return k.finally(function(){return _._unlock()}),k._lib=!0,k}):((y=new He(function(k,T){var A=c(k,T,_);A&&A.then&&A.then(k,T)}))._lib=!0,y):Nt(new be.TransactionInactive)},Xn.prototype._root=function(){return this.parent?this.parent._root():this},Xn.prototype.waitFor=function(s){var c,h=this._root(),y=He.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 He(function(k,T){y.then(function(A){return h._waitingQueue.push(Le(k.bind(null,A)))},function(A){return h._waitingQueue.push(Le(T.bind(null,A)))}).finally(function(){h._waitingFor===_&&(h._waitingFor=null)})})},Xn.prototype.abort=function(){this.active&&(this.active=!1,this.idbtrans&&this.idbtrans.abort(),this._reject(new be.Abort))},Xn.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 be.NotFound("Table "+s+" not part of transaction")},Xn);function Xn(){}function Do(s,c,h,y,_,k,T,A){return{name:s,keyPath:c,unique:h,multi:y,auto:_,compound:k,src:(h&&!T?"&":"")+(y?"*":"")+(_?"++":"")+Ds(c),type:A}}function Ds(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,T){return k=y(k,T),k&&(_[k[0]]=k[1]),_},{}))};var y}var wr=function(s){try{return s.only([[]]),wr=function(){return[[]]},[[]]}catch{return wr=function(){return sr},sr}};function lo(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 uo(s){return[].slice.call(s)}var Ui=0;function hi(s){return s==null?":id":typeof s=="string"?s:"[".concat(s.join("+"),"]")}function $u(s,c,T){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,Te){Oe=Le(Oe);var Ve=ge.objectStore(ne),$e=Ve.keyPath==null,Ue=fe==="put"||fe==="add";if(!Ue&&fe!=="delete"&&fe!=="deleteRange")throw new Error("Invalid operation type: "+fe);var Ne,rt=(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(rt===0)return Oe({numFailures:0,failures:{},results:[],lastResult:void 0});function ot(an){++hn,An(an)}var lt=[],dt=[],hn=0;if(fe==="deleteRange"){if(Ce.type===4)return Oe({numFailures:hn,failures:dt,results:[],lastResult:void 0});Ce.type===3?lt.push(Ne=Ve.clear()):lt.push(Ne=Ve.delete(y(Ce)))}else{var $e=Ue?$e?[Ee,ve]:[Ee,null]:[ve,null],at=$e[0],Ct=$e[1];if(Ue)for(var Kt=0;Kt<rt;++Kt)lt.push(Ne=Ct&&Ct[Kt]!==void 0?Ve[fe](at[Kt],Ct[Kt]):Ve[fe](at[Kt])),Ne.onerror=ot;else for(Kt=0;Kt<rt;++Kt)lt.push(Ne=Ve[fe](at[Kt])),Ne.onerror=ot}function qo(an){an=an.target.result,lt.forEach(function(yo,vo){return yo.error!=null&&(dt[vo]=yo.error)}),Oe({numFailures:hn,failures:dt,results:fe==="delete"?ve:lt.map(function(yo){return yo.result}),lastResult:an})}Ne.onerror=function(an){ot(an),qo(an)},Ne.onsuccess=qo})},getMany:function(oe){var ge=oe.trans,fe=oe.keys;return new Promise(function(ve,Ee){ve=Le(ve);for(var Ce,Oe=ge.objectStore(ne),Te=fe.length,Ve=new Array(Te),$e=0,Ue=0,Ne=function(lt){lt=lt.target,Ve[lt._pos]=lt.result,++Ue===$e&&ve(Ve)},rt=sn(Ee),ot=0;ot<Te;++ot)fe[ot]!=null&&((Ce=Oe.get(fe[ot]))._pos=ot,Ce.onsuccess=Ne,Ce.onerror=rt,++$e);$e===0&&ve(Ve)})},get:function(oe){var ge=oe.trans,fe=oe.key;return new Promise(function(ve,Ee){ve=Le(ve);var Ce=ge.objectStore(ne).get(fe);Ce.onsuccess=function(Oe){return ve(Oe.target.result)},Ce.onerror=sn(Ee)})},query:(ie=G,re=se,function(oe){return new Promise(function(ge,fe){ge=Le(ge);var ve,Ee,Ce,Oe,rt=oe.trans,Te=oe.values,Ve=oe.limit,Ne=oe.query,$e=($e=oe.direction)!=null?$e:"next",Ue=Ve===1/0?void 0:Ve,ot=Ne.index,Ne=Ne.range,rt=rt.objectStore(ne),rt=ot.isPrimaryKey?rt:rt.index(ot.name),ot=y(Ne);if(Ve===0)return ge({result:[]});re?(Ne={query:ot,count:Ue,direction:$e},(ve=Te?rt.getAll(Ne):rt.getAllKeys(Ne)).onsuccess=function(lt){return ge({result:lt.target.result})},ve.onerror=sn(fe)):ie&&$e==="next"?((ve=Te?rt.getAll(ot,Ue):rt.getAllKeys(ot,Ue)).onsuccess=function(lt){return ge({result:lt.target.result})},ve.onerror=sn(fe)):(Ee=0,Ce=!Te&&"openKeyCursor"in rt?rt.openKeyCursor(ot,$e):rt.openCursor(ot,$e),Oe=[],Ce.onsuccess=function(){var lt=Ce.result;return!lt||(Oe.push(Te?lt.value:lt.primaryKey),++Ee===Ve)?ge({result:Oe}):void lt.continue()},Ce.onerror=sn(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,Te){Oe=Le(Oe);var Ue=ve.index,Ve=ve.range,$e=ge.objectStore(ne),$e=Ue.isPrimaryKey?$e:$e.index(Ue.name),Ue=Ee?Ce?"prevunique":"prev":Ce?"nextunique":"next",Ne=!fe&&"openKeyCursor"in $e?$e.openKeyCursor(y(Ve),Ue):$e.openCursor(y(Ve),Ue);Ne.onerror=sn(Te),Ne.onsuccess=Le(function(rt){var ot,lt,dt,hn,at=Ne.result;at?(at.___id=++Ui,at.done=!1,ot=at.continue.bind(at),lt=(lt=at.continuePrimaryKey)&&lt.bind(at),dt=at.advance.bind(at),hn=function(){throw new Error("Cursor not stopped")},at.trans=ge,at.stop=at.continue=at.continuePrimaryKey=at.advance=function(){throw new Error("Cursor not started")},at.fail=Le(Te),at.next=function(){var Ct=this,Kt=1;return this.start(function(){return Kt--?Ct.continue():Ct.stop()}).then(function(){return Ct})},at.start=function(Ct){function Kt(){if(Ne.result)try{Ct()}catch(an){at.fail(an)}else at.done=!0,at.start=function(){throw new Error("Cursor behind last entry")},at.stop()}var qo=new Promise(function(an,yo){an=Le(an),Ne.onerror=sn(yo),at.fail=yo,at.stop=function(vo){at.stop=at.continue=at.continuePrimaryKey=at.advance=hn,an(vo)}});return Ne.onsuccess=Le(function(an){Ne.onsuccess=Kt,Kt()}),at.continue=ot,at.continuePrimaryKey=lt,at.advance=dt,Kt(),qo},Oe(at)):Oe(null)},Te)})},count:function(oe){var ge=oe.query,fe=oe.trans,ve=ge.index,Ee=ge.range;return new Promise(function(Ce,Oe){var Te=fe.objectStore(ne),Te=ve.isPrimaryKey?Te:Te.index(ve.name),Ve=y(Ee),Ve=Ve?Te.count(Ve):Te.count();Ve.onsuccess=Le(function($e){return Ce($e.target.result)}),Ve.onerror=sn(Oe)})}}}k=T,A=uo((T=s).objectStoreNames),J=0<A.length?k.objectStore(A[0]):{};var k,T={schema:{name:T.name,tables:A.map(function(Z){return k.objectStore(Z)}).map(function(Z){var ie=Z.keyPath,re=Z.autoIncrement,oe=m(ie),ne={},oe={name:Z.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:ie==null,compound:oe,keyPath:ie,autoIncrement:re,unique:!0,extractKey:lo(ie)},indexes:uo(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:m(Ee),keyPath:Ee,unique:fe,multiEntry:ve,extractKey:lo(Ee)};return ne[hi(Ee)]=Ce}),getIndexByKeyPath:function(ge){return ne[hi(ge)]}};return ne[":id"]=oe.primaryKey,ie!=null&&(ne[hi(ie)]=oe.primaryKey),oe})},hasGetAll:0<A.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},A=T.schema,G=T.hasGetAll,se=T.hasIdb3Features,J=A.tables.map(_),Y={};return J.forEach(function(Z){return Y[Z.name]=Z}),{stack:"dbcore",transaction:s.transaction.bind(s),table:function(Z){if(Y[Z])return Y[Z];throw new Error("Table '".concat(Z,"' not found"))},MIN_KEY:-1/0,MAX_KEY:wr(c),schema:A}}function Ls(s,c,h,y){return h=h.IDBKeyRange,c=$u(c,h,y),{dbcore:s.dbcore.reduce(function(_,k){return k=k.create,a(a({},_),k(_))},c)}}function co(s,c){var h=c.db,h=Ls(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 zo(s,c,h,y){h.forEach(function(_){var k=y[_];c.forEach(function(T){var A=(function G(se,J){return M(se,J)||(se=w(se))&&G(se,J)})(T,_);(!A||"value"in A&&A.value===void 0)&&(T===s.Transaction.prototype||T instanceof s.Transaction?P(T,_,{get:function(){return this.table(_)},set:function(G){N(this,_,{value:G,writable:!0,configurable:!0,enumerable:!0})}}):T[_]=new s.Table(_,k))})})}function qi(s,c){c.forEach(function(h){for(var y in h)h[y]instanceof s.Table&&delete h[y]})}function Hr(s,c){return s._cfg.version-c._cfg.version}function Fs(s,c,h,y){var _=s._dbSchema,k=(h.objectStoreNames.contains("$meta")&&!_.$meta&&(_.$meta=zs("$meta",Xi("")[0],[]),s._storeNames.push("$meta")),s._createTransaction("readwrite",s._storeNames,_)),T=(k.create(h),k._completion.catch(y),k._reject.bind(k)),A=qe.transless||qe;rn(function(){if(qe.trans=k,qe.transless=A,c!==0)return co(s,h),se=c,((G=k).storeNames.includes("$meta")?G.table("$meta").get("version").then(function(J){return J??se}):He.resolve(se)).then(function(oe){var Y=s,Z=oe,ie=k,re=h,ne=[],oe=Y._versions,ge=Y._dbSchema=Gt(0,Y.idbdb,re);return(oe=oe.filter(function(fe){return fe._cfg.version>=Z})).length===0?He.resolve():(oe.forEach(function(fe){ne.push(function(){var ve,Ee,Ce,Oe=ge,Te=fe._cfg.dbschema,Ve=(_r(Y,Oe,re),_r(Y,Te,re),ge=Y._dbSchema=Te,Yi(Oe,Te)),$e=(Ve.add.forEach(function(Ue){Lo(re,Ue[0],Ue[1].primKey,Ue[1].indexes)}),Ve.change.forEach(function(Ue){if(Ue.recreate)throw new be.Upgrade("Not yet support for changing primary key");var Ne=re.objectStore(Ue.name);Ue.add.forEach(function(rt){return gi(Ne,rt)}),Ue.change.forEach(function(rt){Ne.deleteIndex(rt.name),gi(Ne,rt)}),Ue.del.forEach(function(rt){return Ne.deleteIndex(rt)})}),fe._cfg.contentUpgrade);if($e&&fe._cfg.version>Z)return co(Y,re),ie._memoizedTables={},ve=pe(Te),Ve.del.forEach(function(Ue){ve[Ue]=Oe[Ue]}),qi(Y,[Y.Transaction.prototype]),zo(Y,[Y.Transaction.prototype],d(ve),ve),ie.schema=ve,(Ee=O($e))&&qn(),Te=He.follow(function(){var Ue;(Ce=$e(ie))&&Ee&&(Ue=Dt.bind(null,null),Ce.then(Ue,Ue))}),Ce&&typeof Ce.then=="function"?He.resolve(Ce):Te.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(Te){return Ee[Te]==null&&Ce.db.deleteObjectStore(Te)}),qi(Y,[Y.Transaction.prototype]),zo(Y,[Y.Transaction.prototype],Y._storeNames,Y._dbSchema),ie.schema=Y._dbSchema}),ne.push(function(ve){Y.idbdb.objectStoreNames.contains("$meta")&&(Math.ceil(Y.idbdb.version/10)===fe._cfg.version?(Y.idbdb.deleteObjectStore("$meta"),delete Y._dbSchema.$meta,Y._storeNames=Y._storeNames.filter(function(Ee){return Ee!=="$meta"})):ve.objectStore("$meta").put(fe._cfg.version,"version"))})}),(function fe(){return ne.length?He.resolve(ne.shift()(ie.idbtrans)).then(fe):He.resolve()})().then(function(){mi(ge,re)}))}).catch(T);var G,se;d(_).forEach(function(J){Lo(h,J,_[J].primKey,_[J].indexes)}),co(s,h),He.follow(function(){return s.on.populate.fire(k)}).catch(T)})}function Wi(s,c){mi(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=Gt(0,s.idbdb,c);_r(s,s._dbSchema,c);for(var y=0,_=Yi(h,s._dbSchema).change;y<_.length;y++){var k=(T=>{if(T.change.length||T.recreate)return console.warn("Unable to patch indexes of table ".concat(T.name," because it has changes on the type of index or primary key.")),{value:void 0};var A=c.objectStore(T.name);T.add.forEach(function(G){bt&&console.debug("Dexie upgrade patch: Creating missing index ".concat(T.name,".").concat(G.src)),gi(A,G)})})(_[y]);if(typeof k=="object")return k.value}}function Yi(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 T={name:h,def:k,recreate:!1,del:[],add:[],change:[]};if(""+(_.primKey.keyPath||"")!=""+(k.primKey.keyPath||"")||_.primKey.auto!==k.primKey.auto)T.recreate=!0,y.change.push(T);else{var A=_.idxByName,G=k.idxByName,se=void 0;for(se in A)G[se]||T.del.push(se);for(se in G){var J=A[se],Y=G[se];J?J.src!==Y.src&&T.change.push(Y):T.add.push(Y)}(0<T.del.length||0<T.add.length||0<T.change.length)&&y.change.push(T)}}else y.add.push([h,k])}return y}function Lo(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 gi(_,k)})}function mi(s,c){d(s).forEach(function(h){c.db.objectStoreNames.contains(h)||(bt&&console.debug("Dexie: Creating missing table",h),Lo(c,h,s[h].primKey,s[h].indexes))})}function gi(s,c){s.createIndex(c.name,c.keyPath,{unique:c.unique,multiEntry:c.multi})}function Gt(s,c,h){var y={};return H(c.objectStoreNames,0).forEach(function(_){for(var k=h.objectStore(_),T=Do(Ds(se=k.keyPath),se||"",!0,!1,!!k.autoIncrement,se&&typeof se!="string",!0),A=[],G=0;G<k.indexNames.length;++G){var J=k.index(k.indexNames[G]),se=J.keyPath,J=Do(J.name,se,!!J.unique,!!J.multiEntry,!1,se&&typeof se!="string",!1);A.push(J)}y[_]=zs(_,T,A)}),y}function _r(s,c,h){for(var y=h.db.objectStoreNames,_=0;_<y.length;++_){var k=y[_],T=h.objectStore(k);s._hasGetAll="getAll"in T;for(var A=0;A<T.indexNames.length;++A){var G,se=T.indexNames[A],J=T.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 Xi(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 Do(_,k||null,/\&/.test(c),/\*/.test(c),/\+\+/.test(c),m(k),h===0,y)})}Fo.prototype._createTableSchema=zs,Fo.prototype._parseIndexSyntax=Xi,Fo.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 be.Schema("Invalid schema for table "+y+": "+s[y]);if(k.unique=!0,k.multi)throw new be.Schema("Primary key cannot be multiEntry*");_.forEach(function(T){if(T.auto)throw new be.Schema("Only primary key can be marked as autoIncrement (++)");if(!T.keyPath)throw new be.Schema("Index must have a name and cannot be an empty string")}),k=h._createTableSchema(y,k,_),c[y]=k}})},Fo.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=_,qi(c,[c._allTables,c,c.Transaction.prototype]),zo(c,[c._allTables,c,c.Transaction.prototype,this._cfg.tables],d(_),_),c._storeNames=d(_),this},Fo.prototype.upgrade=function(s){return this._cfg.contentUpgrade=Ft(this._cfg.contentUpgrade||Be,s),this};var yi=Fo;function Fo(){}var fo=(()=>{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 T=k.value;if(T.deref()===y._novip)return s.delete(T),void c.unregister(T);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 vi(s,c){var h=s._dbNamesDB;return h||(h=s._dbNamesDB=new br(Dr,{addons:[],indexedDB:s,IDBKeyRange:c})).version(1).stores({dbnames:"name"}),h.table("dbnames")}function po(s){return s&&typeof s.databases=="function"}function Bo(s){return rn(function(){return qe.letThrough=!0,s()})}function Qi(s){return!("from"in s)}var Zt=function(s,c){var h;if(!this)return h=new Zt,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 xi(s,c,h){var y=ft(c,h);if(!isNaN(y)){if(0<y)throw RangeError();if(Qi(s))return v(s,{from:c,to:h,d:1});var y=s.l,_=s.r;if(ft(h,s.from)<0)return y?xi(y,c,h):s.l={from:c,to:h,d:1,l:null,r:null},Ka(s);if(0<ft(c,s.to))return _?xi(_,c,h):s.r={from:c,to:h,d:1,l:null,r:null},Ka(s);ft(c,s.from)<0&&(s.from=c,s.l=null,s.d=_?_.d+1:1),0<ft(h,s.to)&&(s.to=h,s.r=null,s.d=s.l?s.l.d+1:1),c=!s.r,y&&!s.l&&wi(s,y),_&&c&&wi(s,_)}}function wi(s,c){Qi(c)||(function h(y,_){var k=_.from,T=_.l,A=_.r;xi(y,k,_.to),T&&h(y,T),A&&h(y,A)})(s,c)}function Gi(s,c){var h=Zi(c),y=h.next();if(!y.done)for(var _=y.value,k=Zi(s),T=k.next(_.from),A=T.value;!y.done&&!T.done;){if(ft(A.from,_.to)<=0&&0<=ft(A.to,_.from))return!0;ft(_.from,A.from)<0?_=(y=h.next(A.from)).value:A=(T=k.next(_.from)).value}return!1}function Zi(s){var c=Qi(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&&ft(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||ft(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 Ka(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=Ua(h)),s.d=Ua(s)}function Ua(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 Ji(s,c){return d(c).forEach(function(h){s[h]?wi(s[h],c[h]):s[h]=(function y(_){var k,T,A={};for(k in _)x(_,k)&&(T=_[k],A[k]=!T||typeof T!="object"||Q.has(T.constructor)?T:y(T));return A})(c[h])}),s}function Bs(s,c){return s.all||c.all||Object.keys(s).some(function(h){return c[h]&&Gi(c[h],s[h])})}S(Zt.prototype,((Et={add:function(s){return wi(this,s),this},addKey:function(s){return xi(this,s,s),this},addKeys:function(s){var c=this;return s.forEach(function(h){return xi(c,h,h)}),this},hasKey:function(s){var c=Zi(this).next(s).value;return c&&ft(c.from,s)<=0&&0<=ft(c.to,s)}})[te]=function(){return Zi(this)},Et));var Vr={},Hs={},Vs=!1;function es(s){Ji(Hs,s),Vs||(Vs=!0,setTimeout(function(){Vs=!1,Ks(Hs,!(Hs={}))},0))}function Ks(s,c){c===void 0&&(c=!1);var h=new Set;if(s.all)for(var y=0,_=Object.values(Vr);y<_.length;y++)ts(A=_[y],s,h,c);else for(var k in s){var T,A,k=/^idb\:\/\/(.*)\/(.*)\//.exec(k);k&&(T=k[1],k=k[2],A=Vr["idb://".concat(T,"/").concat(k)])&&ts(A,s,h,c)}h.forEach(function(G){return G()})}function ts(s,c,h,y){for(var _=[],k=0,T=Object.entries(s.queries.query);k<T.length;k++){for(var A=T[k],G=A[0],se=[],J=0,Y=A[1];J<Y.length;J++){var Z=Y[J];Bs(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 Ou(s){var c=s._state,h=s._deps.indexedDB;if(c.isBeingOpened||s.idbdb)return c.dbReadyPromise.then(function(){return c.dbOpenError?Nt(c.dbOpenError):s});c.isBeingOpened=!0,c.dbOpenError=null,c.openComplete=!1;var y=c.openCanceller,_=Math.round(10*s.verno),k=!1;function T(){if(c.openCanceller!==y)throw new be.DatabaseClosed("db.open() was cancelled")}function A(){return new He(function(Z,ie){if(T(),!h)throw new be.MissingAPI;var re=s.name,ne=c.autoSchema||!_?h.open(re):h.open(re,_);if(!ne)throw new be.MissingAPI;ne.onerror=sn(ie),ne.onblocked=Le(s._fireOnBlocked),ne.onupgradeneeded=Le(function(oe){var ge;J=ne.transaction,c.autoSchema&&!s._options.allowEmptyDB?(ne.onerror=An,J.abort(),ne.result.close(),(ge=h.deleteDatabase(re)).onsuccess=ge.onerror=Le(function(){ie(new be.NoSuchDatabase("Database ".concat(re," doesnt exist")))})):(J.onerror=sn(ie),ge=oe.oldVersion>Math.pow(2,62)?0:oe.oldVersion,Y=ge<1,s.idbdb=ne.result,k&&Wi(s,J),Fs(s,ge/10,J,ie))},ie),ne.onsuccess=Le(function(){J=null;var oe,ge,fe,ve,Ee,Ce,Oe=s.idbdb=ne.result,Te=H(Oe.objectStoreNames);if(0<Te.length)try{var Ve=Oe.transaction((Ee=Te).length===1?Ee[0]:Ee,"readonly");if(c.autoSchema)Ce=Oe,ve=Ve,(fe=s).verno=Ce.version/10,ve=fe._dbSchema=Gt(0,Ce,ve),fe._storeNames=H(Ce.objectStoreNames,0),zo(fe,[fe._allTables],d(ve),ve);else if(_r(s,s._dbSchema,Ve),ge=Ve,((ge=Yi(Gt(0,(oe=s).idbdb,ge),oe._dbSchema)).add.length||ge.change.some(function($e){return $e.add.length||$e.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(A());co(s,Ve)}catch{}fo.add(s),Oe.onversionchange=Le(function($e){c.vcFired=!0,s.on("versionchange").fire($e)}),Oe.onclose=Le(function(){s.close({disableAutoOpen:!1})}),Y&&(Te=s._deps,Ee=re,po(Ce=Te.indexedDB)||Ee===Dr||vi(Ce,Te.IDBKeyRange).put({name:Ee}).catch(Be)),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()"),A();break;case"VersionError":if(0<_)return _=0,A()}return He.reject(Z)})}var G,se=c.dbReadyResolve,J=null,Y=!1;return He.race([y,(typeof navigator>"u"?He.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(A)]).then(function(){return T(),c.onReadyBeingFired=[],He.resolve(Bo(function(){return s.on.ready.fire(s.vip)})).then(function Z(){var ie;if(0<c.onReadyBeingFired.length)return ie=c.onReadyBeingFired.reduce(Ft,Be),c.onReadyBeingFired=[],He.resolve(Bo(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(),Nt(Z)}).finally(function(){c.openComplete=!0,se()}).then(function(){var Z;return Y&&(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 Zt(-1/0,[[[]]]))}),Z["idb://".concat(s.name,"/").concat(ie.name,"/")]=Z["idb://".concat(s.name,"/").concat(ie.name,"/:dels")]=new Zt(-1/0,[[[]]])}),$n(pi).fire(Z),Ks(Z,!0)),s})}function Us(s){function c(k){return s.next(k)}var h=_(c),y=_(function(k){return s.throw(k)});function _(k){return function(A){var A=k(A),G=A.value;return A.done?G:G&&typeof G.then=="function"?G.then(h,y):m(G)?Promise.all(G).then(h,y):h(G)}}return _(c)()}function ns(s,c,h){for(var y=m(s)?s.slice():[s],_=0;_<h;++_)y.push(c);return y}var qa={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 T(Z,ie,re){var fe=hi(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:lo(Z),unique:!ge&&re.unique});return ne.push(fe),fe.isPrimaryKey||k.push(fe),1<oe&&T(oe===2?Z[0]:Z.slice(0,oe-1),ie+1,re),ne.sort(function(ve,Ee){return ve.keyTail-Ee.keyTail}),fe}var A=T(y.primaryKey.keyPath,0,y.primaryKey);_[":id"]=[A];for(var G=0,se=y.indexes;G<se.length;G++){var J=se[G];T(J.keyPath,0,J)}function Y(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:ns(ie.lower,ie.lowerOpen?s.MAX_KEY:s.MIN_KEY,re),lowerOpen:!0,upper:ns(ie.upper,ie.upperOpen?s.MIN_KEY:s.MAX_KEY,re),upperOpen:!0})}}):Z}return a(a({},h),{schema:a(a({},y),{primaryKey:A,indexes:k,getIndexByKeyPath:function(Z){return(Z=_[hi(Z)])&&Z[0]}}),count:function(Z){return h.count(Y(Z))},query:function(Z){return h.query(Y(Z))},openCursor:function(Z){var ie=Z.query.index,re=ie.keyTail,ne=ie.keyLength;return ie.isVirtual?h.openCursor(Y(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(ns(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(ns(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 qs(s,c,h,y){return h=h||{},y=y||"",d(s).forEach(function(_){var k,T,A;x(c,_)?(k=s[_],T=c[_],typeof k=="object"&&typeof T=="object"&&k&&T?(A=ue(k))!==ue(T)?h[y+_]=c[_]:A==="Object"?qs(k,T,h,y+_+"."):k!==T&&(h[y+_]=c[_]):k!==T&&(h[y+_]=c[_])):h[y+_]=void 0}),d(c).forEach(function(_){x(s,_)||(h[y+_]=c[_])}),h}function Ws(s,c){return c.type==="delete"?c.keys:c.keys||c.values.map(s.extractKey)}var Ru={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,T=k.table(c).hook,A=T.deleting,G=T.creating,se=T.updating;switch(_.type){case"add":if(G.fire===Be)break;return k._promise("readwrite",function(){return J(_)},!0);case"put":if(G.fire===Be&&se.fire===Be)break;return k._promise("readwrite",function(){return J(_)},!0);case"delete":if(A.fire===Be)break;return k._promise("readwrite",function(){return J(_)},!0);case"deleteRange":if(A.fire===Be)break;return k._promise("readwrite",function(){return(function Y(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}:Y(Z,a(a({},ie),{lower:oe[oe.length-1],lowerOpen:!0}),re)})})})(_.trans,_.range,1e4)},!0)}return h.mutate(_);function J(Y){var Z,ie,re,ne=qe.trans,oe=Y.keys||Ws(y,Y);if(oe)return(Y=Y.type==="add"||Y.type==="put"?a(a({},Y),{keys:oe}):a({},Y)).type!=="delete"&&(Y.values=u([],Y.values)),Y.keys&&(Y.keys=u([],Y.keys)),Z=h,re=oe,((ie=Y).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,Te,Ve=ge[Ee],$e={onerror:null,onsuccess:null};return Y.type==="delete"?A.fire.call($e,ve,Ve,ne):Y.type==="add"||Ve===void 0?(Ce=G.fire.call($e,ve,Y.values[Ee],ne),ve==null&&Ce!=null&&(Y.keys[Ee]=ve=Ce,y.outbound||q(Y.values[Ee],y.keyPath,ve))):(Ce=qs(Ve,Y.values[Ee]),(Oe=se.fire.call($e,Ce,ve,Ve,ne))&&(Te=Y.values[Ee],Object.keys(Oe).forEach(function(Ue){x(Te,Ue)?Te[Ue]=Oe[Ue]:q(Te,Ue,Oe[Ue])}))),$e});return h.mutate(Y).then(function(ve){for(var Ee=ve.failures,Ce=ve.results,Oe=ve.numFailures,ve=ve.lastResult,Te=0;Te<oe.length;++Te){var Ve=(Ce||oe)[Te],$e=fe[Te];Ve==null?$e.onerror&&$e.onerror(Ee[Te]):$e.onsuccess&&$e.onsuccess(Y.type==="put"&&ge[Te]?Y.values[Te]: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 Wa(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;++_)ft(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 Du={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?(_=Wa(y.keys,y.trans._cache,y.cache==="clone"))?He.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 Ya(s,c){return s.trans.mode==="readonly"&&!!s.subscr&&!s.trans.explicit&&s.trans.db._options.cache!=="disabled"&&!c.schema.primaryKey.outbound}function Xa(s,c){switch(s){case"query":return c.values&&!c.unique;case"get":case"getMany":case"count":case"openCursor":return!1}}var Ys={stack:"dbcore",level:0,name:"Observability",create:function(s){var c=s.schema.name,h=new Zt(s.MIN_KEY,s.MAX_KEY);return a(a({},s),{transaction:function(y,_,k){if(qe.subscr&&_!=="readonly")throw new be.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 Zt((ne=(oe=oe.range).lower)!=null?ne:s.MIN_KEY,(ne=oe.upper)!=null?ne:s.MAX_KEY)]}var k=s.table(y),T=k.schema,A=T.primaryKey,G=T.indexes,se=A.extractKey,J=A.outbound,Y=A.autoIncrement&&G.filter(function(re){return re.compound&&re.keyPath.includes(A.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 Zt)}var oe,ge,fe,ve=re.trans,Ee=re.mutatedParts||(re.mutatedParts={}),Ce=ne(""),Oe=ne(":dels"),Te=re.type,$e=re.type==="deleteRange"?[re.range]:re.type==="delete"?[re.keys]:re.values.length<50?[Ws(A,re).filter(function(Ne){return Ne}),re.values]:[],Ve=$e[0],$e=$e[1],Ue=re.trans._cache;return m(Ve)?(Ce.addKeys(Ve),(Te=Te==="delete"||Ve.length===$e.length?Wa(Ve,Ue):null)||Oe.addKeys(Ve),(Te||$e)&&(oe=ne,ge=Te,fe=$e,T.indexes.forEach(function(Ne){var rt=oe(Ne.name||"");function ot(dt){return dt!=null?Ne.extractKey(dt):null}function lt(dt){Ne.multiEntry&&m(dt)?dt.forEach(function(hn){return rt.addKey(hn)}):rt.addKey(dt)}(ge||fe).forEach(function(dt,Ct){var at=ge&&ot(ge[Ct]),Ct=fe&&ot(fe[Ct]);ft(at,Ct)!==0&&(at!=null&&lt(at),Ct!=null)&&lt(Ct)})}))):Ve?($e={from:(Ue=Ve.lower)!=null?Ue:s.MIN_KEY,to:(Te=Ve.upper)!=null?Te:s.MAX_KEY},Oe.add($e),Ce.add($e)):(Ce.add(h),Oe.add(h),T.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),Y&&Y.forEach(function(rt){for(var ot=re.values.map(function(at){return rt.extractKey(at)}),lt=rt.keyPath.findIndex(function(at){return at===A.keyPath}),dt=0,hn=Ne.results.length;dt<hn;++dt)ot[dt][lt]=Ne.results[dt];ne(rt.name).addKeys(ot)})),ve.mutatedParts=Ji(ve.mutatedParts||{},Ee),Ne})}}),ie={get:function(re){return[A,new Zt(re.key)]},getMany:function(re){return[A,new Zt().addKeys(re.keys)]},count:_,query:_,openCursor:_};return d(ie).forEach(function(re){Z[re]=function(ne){var oe=qe.subscr,ge=!!oe,fe=Ya(qe,k)&&Xa(re,ne)?ne.obsSet={}:oe;if(ge){var ve,oe=function($e){return $e="idb://".concat(c,"/").concat(y,"/").concat($e),fe[$e]||(fe[$e]=new Zt)},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($e){if(re==="query"){if(J&&ne.values)return ve.then(function(ot){return ot=ot.result,Ee.addKeys(ot),$e});var Ue=ne.values?$e.result.map(se):$e.result;(ne.values?Ee:Ce).addKeys(Ue)}else{var Ne,rt;if(re==="openCursor")return rt=ne.values,(Ne=$e)&&Object.create(Ne,{key:{get:function(){return Ce.addKey(Ne.primaryKey),Ne.key}},primaryKey:{get:function(){var ot=Ne.primaryKey;return Ce.addKey(ot),ot}},value:{get:function(){return rt&&Ee.addKey(Ne.primaryKey),Ne.value}}})}return $e});Ce.add(h)}}return k[re].apply(this,arguments)}}),Z}})}};function Ho(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),m(y.keys)&&(y.keys=y.keys.filter(function(_,k){return!(k in h.failures)})),"values"in y&&m(y.values)&&(y.values=y.values.filter(function(_,k){return!(k in h.failures)})),y)}function Xs(s,c){return h=s,((y=c).lower===void 0||(y.lowerOpen?0<ft(h,y.lower):0<=ft(h,y.lower)))&&(h=s,(y=c).upper===void 0||(y.upperOpen?ft(h,y.upper)<0:ft(h,y.upper)<=0));var h,y}function Qs(s,c,h,y,_,k){var T,A,G,se,J,Y,Z;return!h||h.length===0||(T=c.query.index,A=T.multiEntry,G=c.query.range,se=y.schema.primaryKey.extractKey,J=T.extractKey,Y=(T.lowLevelIndex||T).extractKey,(y=h.reduce(function(ie,re){var ne=ie,oe=[];if(re.type==="add"||re.type==="put")for(var ge=new Zt,fe=re.values.length-1;0<=fe;--fe){var ve,Ee=re.values[fe],Ce=se(Ee);!ge.hasKey(Ce)&&(ve=J(Ee),A&&m(ve)?ve.some(function(Ue){return Xs(Ue,G)}):Xs(ve,G))&&(ge.addKey(Ce),oe.push(Ee))}switch(re.type){case"add":var Oe=new Zt().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 Te=new Zt().addKeys(re.values.map(function(Ne){return se(Ne)}));ne=ie.filter(function(Ne){return!Te.hasKey(c.values?se(Ne):Ne)}).concat(c.values?oe:oe.map(function(Ne){return se(Ne)}));break;case"delete":var Ve=new Zt().addKeys(re.keys);ne=ie.filter(function(Ne){return!Ve.hasKey(c.values?se(Ne):Ne)});break;case"deleteRange":var $e=re.range;ne=ie.filter(function(Ne){return!Xs(se(Ne),$e)})}return ne},s))===s)?s:(Z=function(ie,re){return ft(Y(ie),Y(re))||ft(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 Gs(s,c){return ft(s.lower,c.lower)===0&&ft(s.upper,c.upper)===0&&!!s.lowerOpen==!!c.lowerOpen&&!!s.upperOpen==!!c.upperOpen}function Qa(s,c){return((h,y,_,k)=>{if(h===void 0)return y!==void 0?-1:0;if(y===void 0)return 1;if((h=ft(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=ft(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 Ga(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 Za={stack:"dbcore",level:0,name:"Cache",create:function(s){var c=s.schema.name;return a(a({},s),{transaction:function(h,y,_){var k,T,A=s.transaction(h,y,_);return y==="readwrite"&&(_=(k=new AbortController).signal,A.addEventListener("abort",(T=function(G){return function(){if(k.abort(),y==="readwrite"){for(var se=new Set,J=0,Y=h;J<Y.length;J++){var Z=Y[J],ie=Vr["idb://".concat(c,"/").concat(Z)];if(ie){var re=s.table(Z),ne=ie.optimisticOps.filter(function(Ne){return Ne.trans===A});if(A._explicit&&G&&A.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++)Bs((Te=ve[fe]).obsSet,A.mutatedParts)&&(L(Oe,Te),Te.subscribers.forEach(function(Ne){return se.add(Ne)}));else if(0<ne.length){ie.optimisticOps=ie.optimisticOps.filter(function(Ne){return Ne.trans!==A});for(var Ee=0,Ce=Object.values(ie.queries.query);Ee<Ce.length;Ee++)for(var Oe,Te,Ve,$e=0,Ue=(Oe=Ce[Ee]).slice();$e<Ue.length;$e++)(Te=Ue[$e]).res!=null&&A.mutatedParts&&(G&&!Te.dirty?(Ve=Object.isFrozen(Te.res),Ve=Qs(Te.res,Te.req,ne,re,Te,Ve),Te.dirty?(L(Oe,Te),Te.subscribers.forEach(function(Ne){return se.add(Ne)})):Ve!==Te.res&&(Te.res=Ve,Te.promise=He.resolve({result:Ve}))):(Te.dirty&&L(Oe,Te),Te.subscribers.forEach(function(Ne){return se.add(Ne)})))}}}se.forEach(function(Ne){return Ne()})}}})(!1),{signal:_}),A.addEventListener("error",T(!1),{signal:_}),A.addEventListener("complete",T(!0),{signal:_})),A},table:function(h){var y=s.table(h),_=y.schema.primaryKey;return a(a({},y),{mutate:function(k){var T,A=qe.trans;return!_.outbound&&A.db._options.cache!=="disabled"&&!A.explicit&&A.idbtrans.mode==="readwrite"&&(T=Vr["idb://".concat(c,"/").concat(h)])?(A=y.mutate(k),k.type!=="add"&&k.type!=="put"||!(50<=k.values.length||Ws(_,k).some(function(G){return G==null}))?(T.optimisticOps.push(k),k.mutatedParts&&es(k.mutatedParts),A.then(function(G){0<G.numFailures&&(L(T.optimisticOps,k),(G=Ho(0,k,G))&&T.optimisticOps.push(G),k.mutatedParts)&&es(k.mutatedParts)}),A.catch(function(){L(T.optimisticOps,k),k.mutatedParts&&es(k.mutatedParts)})):A.then(function(G){var se=Ho(0,a(a({},k),{values:k.values.map(function(J,Y){var Z;return G.failures[Y]?J:(q(Z=(Z=_.keyPath)!=null&&Z.includes(".")?xe(J):a({},J),_.keyPath,G.results[Y]),Z)})}),G);T.optimisticOps.push(se),queueMicrotask(function(){return k.mutatedParts&&es(k.mutatedParts)})}),A):y.mutate(k)},query:function(k){var T,A,G,se,J,Y,Z;return Ya(qe,y)&&Xa("query",k)?(T=((G=qe.trans)==null?void 0:G.db._options.cache)==="immutable",A=(G=qe).requery,G=G.signal,Y=((ie,re,ne,oe)=>{var ge=Vr["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&&Gs(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)&&Qa(Ce.req.query.range,oe.query.range)}),!1,ge,fe];case"count":return Ee=fe.find(function(Ce){return Gs(Ce.req.query.range,oe.query.range)}),[Ee,!!Ee,ge,fe]}})(c,h,"query",k),Z=Y[0],se=Y[2],J=Y[3],Z&&Y[1]?Z.obsSet=k.obsSet:(Y=y.query(k).then(function(ie){var re=ie.result;if(Z&&(Z.res=re),T){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:Y,subscribers:new Set,type:"query",req:k,dirty:!1},J?J.push(Z):(J=[Z],(se=se||(Vr["idb://".concat(c,"/").concat(h)]={queries:{query:{},count:{}},objs:new Map,optimisticOps:[],unsignaledParts:{}})).queries.query[k.query.index.name||""]=J)),Ga(Z,J,A,G),Z.promise.then(function(ie){return{result:Qs(ie.result,k,se==null?void 0:se.optimisticOps,y,Z,T)}})):y.query(k)}})}})}};function Sr(s,c){return new Proxy(s,{get:function(h,y,_){return y==="db"?c:Reflect.get(h,y,_)}})}$t.prototype.version=function(s){if(isNaN(s)||s<.1)throw new be.Type("Given version is not a positive number");if(s=Math.round(10*s)/10,this.idbdb||this._state.isBeingOpened)throw new be.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(Hr),h.stores({}),this._state.autoSchema=!1),h},$t.prototype._whenReady=function(s){var c=this;return this.idbdb&&(this._state.openComplete||qe.letThrough||this._vip)?s():new He(function(h,y){if(c._state.openComplete)return y(new be.DatabaseClosed(c._state.dbOpenError));if(!c._state.isBeingOpened){if(!c._state.autoOpen)return void y(new be.DatabaseClosed);c.open().catch(Be)}c._state.dbReadyPromise.then(h,y)}).then(s)},$t.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(T,A){return T.level-A.level}),this},$t.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},$t.prototype.open=function(){var s=this;return ir(Sn,function(){return Ou(s)})},$t.prototype._close=function(){this.on.close.fire(new CustomEvent("close"));var s=this._state;if(fo.remove(this),this.idbdb){try{this.idbdb.close()}catch{}this.idbdb=null}s.isBeingOpened||(s.dbReadyPromise=new He(function(c){s.dbReadyResolve=c}),s.openCanceller=new He(function(c,h){s.cancelOpen=h}))},$t.prototype.close=function(c){var c=(c===void 0?{disableAutoOpen:!0}:c).disableAutoOpen,h=this._state;c?(h.isBeingOpened&&h.cancelOpen(new be.DatabaseClosed),this._close(),h.autoOpen=!1,h.dbOpenError=new be.DatabaseClosed):(this._close(),h.autoOpen=this._options.autoOpen||h.isBeingOpened,h.openComplete=!1,h.dbOpenError=null)},$t.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 He(function(_,k){function T(){c.close(s);var A=c._deps.indexedDB.deleteDatabase(c.name);A.onsuccess=Le(function(){var G,se,J;G=c._deps,se=c.name,po(J=G.indexedDB)||se===Dr||vi(J,G.IDBKeyRange).delete(se).catch(Be),_()}),A.onerror=sn(k),A.onblocked=c._fireOnBlocked}if(h)throw new be.InvalidArgument("Invalid closeOptions argument to db.delete()");y.isBeingOpened?y.dbReadyPromise.then(T):T()})},$t.prototype.backendDB=function(){return this.idbdb},$t.prototype.isOpen=function(){return this.idbdb!==null},$t.prototype.hasBeenClosed=function(){var s=this._state.dbOpenError;return s&&s.name==="DatabaseClosed"},$t.prototype.hasFailed=function(){return this._state.dbOpenError!==null},$t.prototype.dynamicallyOpened=function(){return this._state.autoSchema},Object.defineProperty($t.prototype,"tables",{get:function(){var s=this;return d(this._allTables).map(function(c){return s._allTables[c]})},enumerable:!1,configurable:!0}),$t.prototype.transaction=function(){var s=(function(c,h,y){var _=arguments.length;if(_<2)throw new be.InvalidArgument("Too few arguments");for(var k=new Array(_-1);--_;)k[_-1]=arguments[_];return y=k.pop(),[c,_e(k),y]}).apply(this,arguments);return this._transaction.apply(this,s)},$t.prototype._transaction=function(s,c,h){var y,_,k=this,T=qe.trans,A=(T&&T.db===this&&s.indexOf("!")===-1||(T=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===$o)y=$o;else{if(s!="rw"&&s!=zr)throw new be.InvalidArgument("Invalid transaction mode: "+s);y=zr}if(T){if(T.mode===$o&&y===zr){if(!A)throw new be.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");T=null}T&&_.forEach(function(se){if(T&&T.storeNames.indexOf(se)===-1){if(!A)throw new be.SubTransaction("Table "+se+" not included in parent transaction.");T=null}}),A&&T&&!T.active&&(T=null)}}catch(se){return T?T._promise(null,function(J,Y){Y(se)}):Nt(se)}var G=(function se(J,Y,Z,ie,re){return He.resolve().then(function(){var fe=qe.transless||qe,ne=J._createTransaction(Y,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,Y,Z,null,re)})):Nt(ve)}var oe,ge=O(re),fe=(ge&&qn(),He.follow(function(){var ve;(oe=re.call(ne,ne))&&(ge?(ve=Dt.bind(null,null),oe.then(ve,ve)):typeof oe.next=="function"&&typeof oe.throw=="function"&&(oe=Us(oe)))},fe));return(oe&&typeof oe.then=="function"?He.resolve(oe).then(function(ve){return ne.active?ve:Nt(new be.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),Nt(ve)})})}).bind(null,this,y,_,T,h);return T?T._promise(y,G,"lock"):qe.trans?ir(qe.transless,function(){return k._whenReady(G)}):this._whenReady(G)},$t.prototype.table=function(s){if(x(this._allTables,s))return this._allTables[s];throw new be.InvalidTable("Table ".concat(s," does not exist"))};var br=$t;function $t(s,c){var h,y,_,k,T,A=this,G=(this._middlewares={},this.verno=0,$t.dependencies),G=(this._options=c=a({addons:$t.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:Be,dbReadyPromise:null,cancelOpen:Be,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3,autoOpen:c.autoOpen}),J=(se.dbReadyPromise=new He(function(Y){se.dbReadyResolve=Y}),se.openCanceller=new He(function(Y,Z){se.cancelOpen=Z}),this._state=se,this.name=s,this.on=Lr(this,"populate","blocked","versionchange","close",{ready:[Ft,Be]}),this.once=function(Y,Z){var ie=function(){for(var re=[],ne=0;ne<arguments.length;ne++)re[ne]=arguments[ne];A.on(Y).unsubscribe(ie),Z.apply(A,re)};return A.on(Y,ie)},this.on.ready.subscribe=j(this.on.ready.subscribe,function(Y){return function(Z,ie){$t.vip(function(){var re,ne=A._state;ne.openComplete?(ne.dbOpenError||He.resolve().then(Z),ie&&Y(Z)):ne.onReadyBeingFired?(ne.onReadyBeingFired.push(Z),ie&&Y(Z)):(Y(Z),re=A,ie||Y(function oe(){re.on.ready.unsubscribe(Z),re.on.ready.unsubscribe(oe)}))})}}),this.Collection=(h=this,io(Ba.prototype,function(oe,ne){this.db=h;var ie=fi,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!==Ye?ge:null}})),this.Table=(y=this,io(Yn.prototype,function(Y,Z,ie){this.db=y,this._tx=ie,this.name=Y,this.schema=Z,this.hook=y._allTables[Y]?y._allTables[Y].hook:Lr(null,{creating:[ct,Be],reading:[ut,Ye],updating:[xn,Be],deleting:[ht,Be]})})),this.Transaction=(_=this,io(Au.prototype,function(Y,Z,ie,re,ne){var oe=this;Y!=="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=Y,this.storeNames=Z,this.schema=ie,this.chromeTransactionDurability=re,this.idbtrans=null,this.on=Lr(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 He(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(),Nt(ge)})})),this.Version=(k=this,io(yi.prototype,function(Y){this.db=k,this._cfg={version:Y,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}})),this.WhereClause=(T=this,io(xr.prototype,function(Y,Z,ie){if(this.db=T,this._ctx={table:Y,index:Z===":id"?null:Z,or:ie},this._cmp=this._ascending=ft,this._descending=function(re,ne){return ft(ne,re)},this._max=function(re,ne){return 0<ft(re,ne)?re:ne},this._min=function(re,ne){return ft(re,ne)<0?re:ne},this._IDBKeyRange=T._deps.IDBKeyRange,!this._IDBKeyRange)throw new be.MissingAPI})),this.on("versionchange",function(Y){0<Y.newVersion?console.warn("Another connection wants to upgrade database '".concat(A.name,"'. Closing db now to resume the upgrade.")):console.warn("Another connection wants to delete database '".concat(A.name,"'. Closing db now to resume the delete request.")),A.close({disableAutoOpen:!1})}),this.on("blocked",function(Y){!Y.newVersion||Y.newVersion<Y.oldVersion?console.warn("Dexie.delete('".concat(A.name,"') was blocked")):console.warn("Upgrade '".concat(A.name,"' blocked by other connection holding version ").concat(Y.oldVersion/10))}),this._maxKey=wr(c.IDBKeyRange),this._createTransaction=function(Y,Z,ie,re){return new A.Transaction(Y,Z,ie,A._options.chromeTransactionDurability,re)},this._fireOnBlocked=function(Y){A.on("blocked").fire(Y),fo.toArray().filter(function(Z){return Z.name===A.name&&Z!==A&&!Z._state.vcFired}).map(function(Z){return Z.on("versionchange").fire(Y)})},this.use(Du),this.use(Za),this.use(Ys),this.use(qa),this.use(Ru),new Proxy(this,{get:function(Y,Z,ie){var re;return Z==="_vip"||(Z==="table"?function(ne){return Sr(A.table(ne),J)}:(re=Reflect.get(Y,Z,ie))instanceof Yn?Sr(re,J):Z==="tables"?re.map(function(ne){return Sr(ne,J)}):Z==="_createTransaction"?function(){return Sr(re.apply(this,arguments),J)}:re)}}));this.vip=J,G.forEach(function(Y){return Y(A)})}var rs,ho=typeof Symbol<"u"&&"observable"in Symbol?Symbol.observable:"@@observable",Ja=(mo.prototype.subscribe=function(s,c,h){return this._subscribe(s&&typeof s!="function"?s:{next:s,error:c,complete:h})},mo.prototype[ho]=function(){return this},mo);function mo(s){this._subscribe=s}try{rs={indexedDB:f.indexedDB||f.mozIndexedDB||f.webkitIndexedDB||f.msIndexedDB,IDBKeyRange:f.IDBKeyRange||f.webkitIDBKeyRange}}catch{rs={indexedDB:null,IDBKeyRange:null}}function Vo(s){var c,h=!1,y=new Ja(function(_){var k=O(s),T,A=!1,G={},se={},J={get closed(){return A},unsubscribe:function(){A||(A=!0,T&&T.abort(),Y&&$n.storagemutated.unsubscribe(re))}},Y=(_.start&&_.start(J),!1),Z=function(){return Ao(ne)};function ie(){return Bs(se,G)}var re=function(oe){Ji(G,oe),ie()&&Z()},ne=function(){var oe,ge,fe;!A&&rs.indexedDB&&(G={},oe={},T&&T.abort(),T=new AbortController,fe=(ve=>{var Ee=kn();try{k&&qn();var Ce=rn(s,ve);return Ce=k?Ce.finally(Dt):Ce}finally{Ee&&Mn()}})(ge={subscr:oe,signal:T.signal,requery:Z,querier:s,trans:null}),Y||($n(pi,re),Y=!0),Promise.resolve(fe).then(function(ve){h=!0,c=ve,A||ge.signal.aborted||(ie()||(se=oe,ie())?Z():(G={},Ao(function(){return!A&&_.next&&_.next(ve)})))},function(ve){h=!1,["DatabaseClosedError","AbortError"].includes(ve==null?void 0:ve.name)||A||Ao(function(){A||_.error&&_.error(ve)})}))};return setTimeout(Z,0),J});return y.hasValue=function(){return h},y.getValue=function(){return c},y}var go=br;function Ko(s){var c=kr;try{kr=!0,$n.storagemutated.fire(s),Ks(s,!0)}finally{kr=c}}S(go,a(a({},B),{delete:function(s){return new go(s,{addons:[]}).delete()},exists:function(s){return new go(s,{addons:[]}).open().then(function(c){return c.close(),!0}).catch("NoSuchDatabaseError",function(){return!1})},getDatabaseNames:function(s){try{return c=go.dependencies,h=c.indexedDB,c=c.IDBKeyRange,(po(h)?Promise.resolve(h.databases()).then(function(y){return y.map(function(_){return _.name}).filter(function(_){return _!==Dr})}):vi(h,c).toCollection().primaryKeys()).then(s)}catch{return Nt(new be.MissingAPI)}var c,h},defineClass:function(){return function(s){v(this,s)}},ignoreTransaction:function(s){return qe.trans?ir(qe.transless||Sn,s):s()},vip:Bo,async:function(s){return function(){try{var c=Us(s.apply(this,arguments));return c&&typeof c.then=="function"?c:He.resolve(c)}catch(h){return Nt(h)}}},spawn:function(s,c,h){try{var y=Us(s.apply(h,c||[]));return y&&typeof y.then=="function"?y:He.resolve(y)}catch(_){return Nt(_)}},currentTransaction:{get:function(){return qe.trans||null}},waitFor:function(s,c){return s=He.resolve(typeof s=="function"?go.ignoreTransaction(s):s).timeout(c||6e4),qe.trans?qe.trans.waitFor(s):s},Promise:He,debug:{get:function(){return bt},set:function(s){Pn(s)}},derive:$,extend:v,props:S,override:j,Events:Lr,on:$n,liveQuery:Vo,extendObservabilitySet:Ji,getByKeyPath:V,setByKeyPath:q,delByKeyPath:function(s,c){typeof c=="string"?q(s,c,void 0):"length"in c&&[].map.call(c,function(h){q(s,h,void 0)})},shallowClone:pe,deepClone:xe,getObjectDiff:qs,cmp:ft,asap:W,minKey:-1/0,addons:[],connections:{get:fo.toArray},errnames:we,dependencies:rs,cache:Vr,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)})})),go.maxKey=wr(go.dependencies.IDBKeyRange),typeof dispatchEvent<"u"&&typeof addEventListener<"u"&&($n(pi,function(s){kr||(s=new CustomEvent(Ki,{detail:s}),kr=!0,dispatchEvent(s),kr=!1)}),addEventListener(Ki,function(s){s=s.detail,kr||Ko(s)}));var Uo,kr=!1,os=function(){};return typeof BroadcastChannel<"u"&&((os=function(){(Uo=new BroadcastChannel(Ki)).onmessage=function(s){return s.data&&Ko(s.data)}})(),typeof Uo.unref=="function"&&Uo.unref(),$n(pi,function(s){kr||Uo.postMessage(s)})),typeof addEventListener<"u"&&(addEventListener("pagehide",function(s){if(!br.disableBfCache&&s.persisted){bt&&console.debug("Dexie: handling persisted pagehide"),Uo!=null&&Uo.close();for(var c=0,h=fo.toArray();c<h.length;c++)h[c].close({disableAutoOpen:!1})}}),addEventListener("pageshow",function(s){!br.disableBfCache&&s.persisted&&(bt&&console.debug("Dexie: handling persisted pageshow"),os(),Ko({all:new Zt(-1/0,[[]])}))})),He.rejectionMapper=function(s,c){return!s||s instanceof Se||s instanceof TypeError||s instanceof SyntaxError||!s.name||!Je[s.name]?s:(c=new Je[s.name](c||s.message,s),"stack"in s&&P(c,"stack",{get:function(){return this.inner.stack}}),c)},Pn(bt),a(br,Object.freeze({__proto__:null,DEFAULT_MAX_CONNECTIONS:1e3,Dexie:br,Entity:En,PropModification:no,RangeSet:Zt,add:function(s){return new no({add:s})},cmp:ft,default:br,liveQuery:Vo,mergeRanges:wi,rangesOverlap:Gi,remove:function(s){return new no({remove:s})},replacePrefix:function(s,c){return new no({replacePrefix:[s,c]})}}),{default:br}),br})})(Jl)),Jl.exports}var P0=C0();const vf=vu(P0),Zp=Symbol.for("Dexie"),su=globalThis[Zp]||(globalThis[Zp]=vf);if(vf.semVer!==su.semVer)throw new Error(`Two different versions of Dexie loaded in the same app: ${vf.semVer} and ${su.semVer}`);const{liveQuery:sk,mergeRanges:ak,rangesOverlap:lk,RangeSet:uk,cmp:ck,Entity:fk,PropModification:dk,replacePrefix:pk,add:hk,remove:mk,DexieYProvider:gk}=su;class j0 extends su{constructor(){super("api-doc-tor");ga(this,"flows");ga(this,"testSuites");ga(this,"environments");ga(this,"kv");this.version(1).stores({flows:"++id, name",testSuites:"++id, name",environments:"++id, name",kv:"key"})}}const St=new j0;async function T0(){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 hm(t){await St.transaction("rw",St.flows,St.testSuites,St.environments,St.kv,async()=>{await St.flows.clear(),await St.testSuites.clear(),await St.environments.clear();for(const r of t.flows)await St.flows.add({name:r.name,steps:r.steps,graph:r.graph});for(const r of t.testSuites)await St.testSuites.add({name:r.name,cases:r.cases});for(const r of t.environments)await St.environments.add({name:r.name,baseUrl:r.baseUrl,vars:r.vars??{}});t.authTokens&&await St.kv.put({key:"authTokens",value:JSON.stringify(t.authTokens)})})}async function M0(t){if(t.formatVersion!==1)return!1;const[r,i]=await Promise.all([St.flows.count(),St.testSuites.count()]);return r>0||i>0?!1:(await hm(t),!0)}function I0(t,r,i){var d,m;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=(m=t.jsonPath)==null?void 0:m.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=$f(v,f),b=t.expectJsonValue;if(b!==void 0&&b!==""){const x=w==null?String(w):typeof w=="object"?JSON.stringify(w):String(w),S=b.trim(),N=x===S||String(w)===S;if(a.push(`JSON path ${f} → ${x} vs "${S}": ${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 qt(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=qt(t[i]))!==""&&(r+=(r&&" ")+a);else for(let i in t)t[i]&&(r+=(r&&" ")+i);return r}var A0={value:()=>{}};function Su(){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 eu(i)}function eu(t){this._=t}function $0(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}})}eu.prototype=Su.prototype={constructor:eu,on:function(t,r){var i=this._,a=$0(t+"",i),u,f=-1,d=a.length;if(arguments.length<2){for(;++f<d;)if((u=(t=a[f]).type)&&(u=O0(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]=Jp(i[u],t.name,r);else if(r==null)for(u in i)i[u]=Jp(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 eu(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 O0(t,r){for(var i=0,a=t.length,u;i<a;++i)if((u=t[i]).name===r)return u.value}function Jp(t,r,i){for(var a=0,u=t.length;a<u;++a)if(t[a].name===r){t[a]=A0,t=t.slice(0,a).concat(t.slice(a+1));break}return i!=null&&t.push({name:r,value:i}),t}var xf="http://www.w3.org/1999/xhtml";const eh={svg:"http://www.w3.org/2000/svg",xhtml:xf,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function bu(t){var r=t+="",i=r.indexOf(":");return i>=0&&(r=t.slice(0,i))!=="xmlns"&&(t=t.slice(i+1)),eh.hasOwnProperty(r)?{space:eh[r],local:t}:t}function R0(t){return function(){var r=this.ownerDocument,i=this.namespaceURI;return i===xf&&r.documentElement.namespaceURI===xf?r.createElement(t):r.createElementNS(i,t)}}function D0(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function mm(t){var r=bu(t);return(r.local?D0:R0)(r)}function z0(){}function Of(t){return t==null?z0:function(){return this.querySelector(t)}}function L0(t){typeof t!="function"&&(t=Of(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,m=a[u]=new Array(d),v,w,b=0;b<d;++b)(v=f[b])&&(w=t.call(v,v.__data__,b,f))&&("__data__"in v&&(w.__data__=v.__data__),m[b]=w);return new er(a,this._parents)}function F0(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function B0(){return[]}function gm(t){return t==null?B0:function(){return this.querySelectorAll(t)}}function H0(t){return function(){return F0(t.apply(this,arguments))}}function V0(t){typeof t=="function"?t=H0(t):t=gm(t);for(var r=this._groups,i=r.length,a=[],u=[],f=0;f<i;++f)for(var d=r[f],m=d.length,v,w=0;w<m;++w)(v=d[w])&&(a.push(t.call(v,v.__data__,w,d)),u.push(v));return new er(a,u)}function ym(t){return function(){return this.matches(t)}}function vm(t){return function(r){return r.matches(t)}}var K0=Array.prototype.find;function U0(t){return function(){return K0.call(this.children,t)}}function q0(){return this.firstElementChild}function W0(t){return this.select(t==null?q0:U0(typeof t=="function"?t:vm(t)))}var Y0=Array.prototype.filter;function X0(){return Array.from(this.children)}function Q0(t){return function(){return Y0.call(this.children,t)}}function G0(t){return this.selectAll(t==null?X0:Q0(typeof t=="function"?t:vm(t)))}function Z0(t){typeof t!="function"&&(t=ym(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,m=a[u]=[],v,w=0;w<d;++w)(v=f[w])&&t.call(v,v.__data__,w,f)&&m.push(v);return new er(a,this._parents)}function xm(t){return new Array(t.length)}function J0(){return new er(this._enter||this._groups.map(xm),this._parents)}function au(t,r){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=r}au.prototype={constructor:au,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 ev(t){return function(){return t}}function tv(t,r,i,a,u,f){for(var d=0,m,v=r.length,w=f.length;d<w;++d)(m=r[d])?(m.__data__=f[d],a[d]=m):i[d]=new au(t,f[d]);for(;d<v;++d)(m=r[d])&&(u[d]=m)}function nv(t,r,i,a,u,f,d){var m,v,w=new Map,b=r.length,x=f.length,S=new Array(b),N;for(m=0;m<b;++m)(v=r[m])&&(S[m]=N=d.call(v,v.__data__,m,r)+"",w.has(N)?u[m]=v:w.set(N,v));for(m=0;m<x;++m)N=d.call(t,f[m],m,f)+"",(v=w.get(N))?(a[m]=v,v.__data__=f[m],w.delete(N)):i[m]=new au(t,f[m]);for(m=0;m<b;++m)(v=r[m])&&w.get(S[m])===v&&(u[m]=v)}function rv(t){return t.__data__}function ov(t,r){if(!arguments.length)return Array.from(this,rv);var i=r?nv:tv,a=this._parents,u=this._groups;typeof t!="function"&&(t=ev(t));for(var f=u.length,d=new Array(f),m=new Array(f),v=new Array(f),w=0;w<f;++w){var b=a[w],x=u[w],S=x.length,N=iv(t.call(b,b&&b.__data__,w,a)),P=N.length,$=m[w]=new Array(P),M=d[w]=new Array(P),I=v[w]=new Array(S);i(b,x,$,M,I,N,r);for(var H=0,j=0,R,W;H<P;++H)if(R=$[H]){for(H>=j&&(j=H+1);!(W=M[j])&&++j<P;);R._next=W||null}}return d=new er(d,a),d._enter=m,d._exit=v,d}function iv(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function sv(){return new er(this._exit||this._groups.map(xm),this._parents)}function av(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 lv(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),m=new Array(u),v=0;v<d;++v)for(var w=i[v],b=a[v],x=w.length,S=m[v]=new Array(x),N,P=0;P<x;++P)(N=w[P]||b[P])&&(S[P]=N);for(;v<u;++v)m[v]=i[v];return new er(m,this._parents)}function uv(){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 cv(t){t||(t=fv);function r(x,S){return x&&S?t(x.__data__,S.__data__):!x-!S}for(var i=this._groups,a=i.length,u=new Array(a),f=0;f<a;++f){for(var d=i[f],m=d.length,v=u[f]=new Array(m),w,b=0;b<m;++b)(w=d[b])&&(v[b]=w);v.sort(r)}return new er(u,this._parents).order()}function fv(t,r){return t<r?-1:t>r?1:t>=r?0:NaN}function dv(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function pv(){return Array.from(this)}function hv(){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 mv(){let t=0;for(const r of this)++t;return t}function gv(){return!this.node()}function yv(t){for(var r=this._groups,i=0,a=r.length;i<a;++i)for(var u=r[i],f=0,d=u.length,m;f<d;++f)(m=u[f])&&t.call(m,m.__data__,f,u);return this}function vv(t){return function(){this.removeAttribute(t)}}function xv(t){return function(){this.removeAttributeNS(t.space,t.local)}}function wv(t,r){return function(){this.setAttribute(t,r)}}function _v(t,r){return function(){this.setAttributeNS(t.space,t.local,r)}}function Sv(t,r){return function(){var i=r.apply(this,arguments);i==null?this.removeAttribute(t):this.setAttribute(t,i)}}function bv(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 kv(t,r){var i=bu(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?xv:vv:typeof r=="function"?i.local?bv:Sv:i.local?_v:wv)(i,r))}function wm(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function Ev(t){return function(){this.style.removeProperty(t)}}function Nv(t,r,i){return function(){this.style.setProperty(t,r,i)}}function Cv(t,r,i){return function(){var a=r.apply(this,arguments);a==null?this.style.removeProperty(t):this.style.setProperty(t,a,i)}}function Pv(t,r,i){return arguments.length>1?this.each((r==null?Ev:typeof r=="function"?Cv:Nv)(t,r,i??"")):js(this.node(),t)}function js(t,r){return t.style.getPropertyValue(r)||wm(t).getComputedStyle(t,null).getPropertyValue(r)}function jv(t){return function(){delete this[t]}}function Tv(t,r){return function(){this[t]=r}}function Mv(t,r){return function(){var i=r.apply(this,arguments);i==null?delete this[t]:this[t]=i}}function Iv(t,r){return arguments.length>1?this.each((r==null?jv:typeof r=="function"?Mv:Tv)(t,r)):this.node()[t]}function _m(t){return t.trim().split(/^|\s+/)}function Rf(t){return t.classList||new Sm(t)}function Sm(t){this._node=t,this._names=_m(t.getAttribute("class")||"")}Sm.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 bm(t,r){for(var i=Rf(t),a=-1,u=r.length;++a<u;)i.add(r[a])}function km(t,r){for(var i=Rf(t),a=-1,u=r.length;++a<u;)i.remove(r[a])}function Av(t){return function(){bm(this,t)}}function $v(t){return function(){km(this,t)}}function Ov(t,r){return function(){(r.apply(this,arguments)?bm:km)(this,t)}}function Rv(t,r){var i=_m(t+"");if(arguments.length<2){for(var a=Rf(this.node()),u=-1,f=i.length;++u<f;)if(!a.contains(i[u]))return!1;return!0}return this.each((typeof r=="function"?Ov:r?Av:$v)(i,r))}function Dv(){this.textContent=""}function zv(t){return function(){this.textContent=t}}function Lv(t){return function(){var r=t.apply(this,arguments);this.textContent=r??""}}function Fv(t){return arguments.length?this.each(t==null?Dv:(typeof t=="function"?Lv:zv)(t)):this.node().textContent}function Bv(){this.innerHTML=""}function Hv(t){return function(){this.innerHTML=t}}function Vv(t){return function(){var r=t.apply(this,arguments);this.innerHTML=r??""}}function Kv(t){return arguments.length?this.each(t==null?Bv:(typeof t=="function"?Vv:Hv)(t)):this.node().innerHTML}function Uv(){this.nextSibling&&this.parentNode.appendChild(this)}function qv(){return this.each(Uv)}function Wv(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Yv(){return this.each(Wv)}function Xv(t){var r=typeof t=="function"?t:mm(t);return this.select(function(){return this.appendChild(r.apply(this,arguments))})}function Qv(){return null}function Gv(t,r){var i=typeof t=="function"?t:mm(t),a=r==null?Qv:typeof r=="function"?r:Of(r);return this.select(function(){return this.insertBefore(i.apply(this,arguments),a.apply(this,arguments)||null)})}function Zv(){var t=this.parentNode;t&&t.removeChild(this)}function Jv(){return this.each(Zv)}function ex(){var t=this.cloneNode(!1),r=this.parentNode;return r?r.insertBefore(t,this.nextSibling):t}function tx(){var t=this.cloneNode(!0),r=this.parentNode;return r?r.insertBefore(t,this.nextSibling):t}function nx(t){return this.select(t?tx:ex)}function rx(t){return arguments.length?this.property("__data__",t):this.node().__data__}function ox(t){return function(r){t.call(this,r,this.__data__)}}function ix(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 sx(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 ax(t,r,i){return function(){var a=this.__on,u,f=ox(r);if(a){for(var d=0,m=a.length;d<m;++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 lx(t,r,i){var a=ix(t+""),u,f=a.length,d;if(arguments.length<2){var m=this.node().__on;if(m){for(var v=0,w=m.length,b;v<w;++v)for(u=0,b=m[v];u<f;++u)if((d=a[u]).type===b.type&&d.name===b.name)return b.value}return}for(m=r?ax:sx,u=0;u<f;++u)this.each(m(a[u],r,i));return this}function Em(t,r,i){var a=wm(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 ux(t,r){return function(){return Em(this,t,r)}}function cx(t,r){return function(){return Em(this,t,r.apply(this,arguments))}}function fx(t,r){return this.each((typeof r=="function"?cx:ux)(t,r))}function*dx(){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 Nm=[null];function er(t,r){this._groups=t,this._parents=r}function $a(){return new er([[document.documentElement]],Nm)}function px(){return this}er.prototype=$a.prototype={constructor:er,select:L0,selectAll:V0,selectChild:W0,selectChildren:G0,filter:Z0,data:ov,enter:J0,exit:sv,join:av,merge:lv,selection:px,order:uv,sort:cv,call:dv,nodes:pv,node:hv,size:mv,empty:gv,each:yv,attr:kv,style:Pv,property:Iv,classed:Rv,text:Fv,html:Kv,raise:qv,lower:Yv,append:Xv,insert:Gv,remove:Jv,clone:nx,datum:rx,on:lx,dispatch:fx,[Symbol.iterator]:dx};function Jn(t){return typeof t=="string"?new er([[document.querySelector(t)]],[document.documentElement]):new er([[t]],Nm)}function hx(t){let r;for(;r=t.sourceEvent;)t=r;return t}function Tr(t,r){if(t=hx(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 mx={passive:!1},ka={capture:!0,passive:!1};function ef(t){t.stopImmediatePropagation()}function Cs(t){t.preventDefault(),t.stopImmediatePropagation()}function Cm(t){var r=t.document.documentElement,i=Jn(t).on("dragstart.drag",Cs,ka);"onselectstart"in r?i.on("selectstart.drag",Cs,ka):(r.__noselect=r.style.MozUserSelect,r.style.MozUserSelect="none")}function Pm(t,r){var i=t.document.documentElement,a=Jn(t).on("dragstart.drag",null);r&&(a.on("click.drag",Cs,ka),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 Kl=t=>()=>t;function wf(t,{sourceEvent:r,subject:i,target:a,identifier:u,active:f,x:d,y:m,dx:v,dy:w,dispatch:b}){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:m,enumerable:!0,configurable:!0},dx:{value:v,enumerable:!0,configurable:!0},dy:{value:w,enumerable:!0,configurable:!0},_:{value:b}})}wf.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};function gx(t){return!t.ctrlKey&&!t.button}function yx(){return this.parentNode}function vx(t,r){return r??{x:t.x,y:t.y}}function xx(){return navigator.maxTouchPoints||"ontouchstart"in this}function jm(){var t=gx,r=yx,i=vx,a=xx,u={},f=Su("start","drag","end"),d=0,m,v,w,b,x=0;function S(R){R.on("mousedown.drag",N).filter(a).on("touchstart.drag",M).on("touchmove.drag",I,mx).on("touchend.drag touchcancel.drag",H).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function N(R,W){if(!(b||!t.call(this,R,W))){var V=j(this,r.call(this,R,W),R,W,"mouse");V&&(Jn(R.view).on("mousemove.drag",P,ka).on("mouseup.drag",$,ka),Cm(R.view),ef(R),w=!1,m=R.clientX,v=R.clientY,V("start",R))}}function P(R){if(Cs(R),!w){var W=R.clientX-m,V=R.clientY-v;w=W*W+V*V>x}u.mouse("drag",R)}function $(R){Jn(R.view).on("mousemove.drag mouseup.drag",null),Pm(R.view,w),Cs(R),u.mouse("end",R)}function M(R,W){if(t.call(this,R,W)){var V=R.changedTouches,q=r.call(this,R,W),pe=V.length,he,_e;for(he=0;he<pe;++he)(_e=j(this,q,R,W,V[he].identifier,V[he]))&&(ef(R),_e("start",R,V[he]))}}function I(R){var W=R.changedTouches,V=W.length,q,pe;for(q=0;q<V;++q)(pe=u[W[q].identifier])&&(Cs(R),pe("drag",R,W[q]))}function H(R){var W=R.changedTouches,V=W.length,q,pe;for(b&&clearTimeout(b),b=setTimeout(function(){b=null},500),q=0;q<V;++q)(pe=u[W[q].identifier])&&(ef(R),pe("end",R,W[q]))}function j(R,W,V,q,pe,he){var _e=f.copy(),Q=Tr(he||V,W),le,xe,z;if((z=i.call(R,new wf("beforestart",{sourceEvent:V,target:S,identifier:pe,active:d,x:Q[0],y:Q[1],dx:0,dy:0,dispatch:_e}),q))!=null)return le=z.x-Q[0]||0,xe=z.y-Q[1]||0,function ue(te,ae,L){var F=Q,X;switch(te){case"start":u[pe]=ue,X=d++;break;case"end":delete u[pe],--d;case"drag":Q=Tr(L||ae,W),X=d;break}_e.call(te,R,new wf(te,{sourceEvent:ae,subject:z,target:S,identifier:pe,active:X,x:Q[0]+le,y:Q[1]+xe,dx:Q[0]-F[0],dy:Q[1]-F[1],dispatch:_e}),q)}}return S.filter=function(R){return arguments.length?(t=typeof R=="function"?R:Kl(!!R),S):t},S.container=function(R){return arguments.length?(r=typeof R=="function"?R:Kl(R),S):r},S.subject=function(R){return arguments.length?(i=typeof R=="function"?R:Kl(R),S):i},S.touchable=function(R){return arguments.length?(a=typeof R=="function"?R:Kl(!!R),S):a},S.on=function(){var R=f.on.apply(f,arguments);return R===f?S:R},S.clickDistance=function(R){return arguments.length?(x=(R=+R)*R,S):Math.sqrt(x)},S}function Df(t,r,i){t.prototype=r.prototype=i,i.constructor=t}function Tm(t,r){var i=Object.create(t.prototype);for(var a in r)i[a]=r[a];return i}function Oa(){}var Ea=.7,lu=1/Ea,Ps="\\s*([+-]?\\d+)\\s*",Na="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Xr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",wx=/^#([0-9a-f]{3,8})$/,_x=new RegExp(`^rgb\\(${Ps},${Ps},${Ps}\\)$`),Sx=new RegExp(`^rgb\\(${Xr},${Xr},${Xr}\\)$`),bx=new RegExp(`^rgba\\(${Ps},${Ps},${Ps},${Na}\\)$`),kx=new RegExp(`^rgba\\(${Xr},${Xr},${Xr},${Na}\\)$`),Ex=new RegExp(`^hsl\\(${Na},${Xr},${Xr}\\)$`),Nx=new RegExp(`^hsla\\(${Na},${Xr},${Xr},${Na}\\)$`),th={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};Df(Oa,Di,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:nh,formatHex:nh,formatHex8:Cx,formatHsl:Px,formatRgb:rh,toString:rh});function nh(){return this.rgb().formatHex()}function Cx(){return this.rgb().formatHex8()}function Px(){return Mm(this).formatHsl()}function rh(){return this.rgb().formatRgb()}function Di(t){var r,i;return t=(t+"").trim().toLowerCase(),(r=wx.exec(t))?(i=r[1].length,r=parseInt(r[1],16),i===6?oh(r):i===3?new Bn(r>>8&15|r>>4&240,r>>4&15|r&240,(r&15)<<4|r&15,1):i===8?Ul(r>>24&255,r>>16&255,r>>8&255,(r&255)/255):i===4?Ul(r>>12&15|r>>8&240,r>>8&15|r>>4&240,r>>4&15|r&240,((r&15)<<4|r&15)/255):null):(r=_x.exec(t))?new Bn(r[1],r[2],r[3],1):(r=Sx.exec(t))?new Bn(r[1]*255/100,r[2]*255/100,r[3]*255/100,1):(r=bx.exec(t))?Ul(r[1],r[2],r[3],r[4]):(r=kx.exec(t))?Ul(r[1]*255/100,r[2]*255/100,r[3]*255/100,r[4]):(r=Ex.exec(t))?ah(r[1],r[2]/100,r[3]/100,1):(r=Nx.exec(t))?ah(r[1],r[2]/100,r[3]/100,r[4]):th.hasOwnProperty(t)?oh(th[t]):t==="transparent"?new Bn(NaN,NaN,NaN,0):null}function oh(t){return new Bn(t>>16&255,t>>8&255,t&255,1)}function Ul(t,r,i,a){return a<=0&&(t=r=i=NaN),new Bn(t,r,i,a)}function jx(t){return t instanceof Oa||(t=Di(t)),t?(t=t.rgb(),new Bn(t.r,t.g,t.b,t.opacity)):new Bn}function _f(t,r,i,a){return arguments.length===1?jx(t):new Bn(t,r,i,a??1)}function Bn(t,r,i,a){this.r=+t,this.g=+r,this.b=+i,this.opacity=+a}Df(Bn,_f,Tm(Oa,{brighter(t){return t=t==null?lu:Math.pow(lu,t),new Bn(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?Ea:Math.pow(Ea,t),new Bn(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Bn(Oi(this.r),Oi(this.g),Oi(this.b),uu(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:ih,formatHex:ih,formatHex8:Tx,formatRgb:sh,toString:sh}));function ih(){return`#${$i(this.r)}${$i(this.g)}${$i(this.b)}`}function Tx(){return`#${$i(this.r)}${$i(this.g)}${$i(this.b)}${$i((isNaN(this.opacity)?1:this.opacity)*255)}`}function sh(){const t=uu(this.opacity);return`${t===1?"rgb(":"rgba("}${Oi(this.r)}, ${Oi(this.g)}, ${Oi(this.b)}${t===1?")":`, ${t})`}`}function uu(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Oi(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function $i(t){return t=Oi(t),(t<16?"0":"")+t.toString(16)}function ah(t,r,i,a){return a<=0?t=r=i=NaN:i<=0||i>=1?t=r=NaN:r<=0&&(t=NaN),new Mr(t,r,i,a)}function Mm(t){if(t instanceof Mr)return new Mr(t.h,t.s,t.l,t.opacity);if(t instanceof Oa||(t=Di(t)),!t)return new Mr;if(t instanceof Mr)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,m=f-u,v=(f+u)/2;return m?(r===f?d=(i-a)/m+(i<a)*6:i===f?d=(a-r)/m+2:d=(r-i)/m+4,m/=v<.5?f+u:2-f-u,d*=60):m=v>0&&v<1?0:d,new Mr(d,m,v,t.opacity)}function Mx(t,r,i,a){return arguments.length===1?Mm(t):new Mr(t,r,i,a??1)}function Mr(t,r,i,a){this.h=+t,this.s=+r,this.l=+i,this.opacity=+a}Df(Mr,Mx,Tm(Oa,{brighter(t){return t=t==null?lu:Math.pow(lu,t),new Mr(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?Ea:Math.pow(Ea,t),new Mr(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 Bn(tf(t>=240?t-240:t+120,u,a),tf(t,u,a),tf(t<120?t+240:t-120,u,a),this.opacity)},clamp(){return new Mr(lh(this.h),ql(this.s),ql(this.l),uu(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=uu(this.opacity);return`${t===1?"hsl(":"hsla("}${lh(this.h)}, ${ql(this.s)*100}%, ${ql(this.l)*100}%${t===1?")":`, ${t})`}`}}));function lh(t){return t=(t||0)%360,t<0?t+360:t}function ql(t){return Math.max(0,Math.min(1,t||0))}function tf(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 Ix(t,r){return function(i){return t+i*r}}function Ax(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 $x(t){return(t=+t)==1?Im:function(r,i){return i-r?Ax(r,i,t):zf(isNaN(r)?i:r)}}function Im(t,r){var i=r-t;return i?Ix(t,i):zf(isNaN(t)?r:t)}const cu=(function t(r){var i=$x(r);function a(u,f){var d=i((u=_f(u)).r,(f=_f(f)).r),m=i(u.g,f.g),v=i(u.b,f.b),w=Im(u.opacity,f.opacity);return function(b){return u.r=d(b),u.g=m(b),u.b=v(b),u.opacity=w(b),u+""}}return a.gamma=t,a})(1);function Ox(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 Rx(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function Dx(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]=Sa(t[d],r[d]);for(;d<i;++d)f[d]=r[d];return function(m){for(d=0;d<a;++d)f[d]=u[d](m);return f}}function zx(t,r){var i=new Date;return t=+t,r=+r,function(a){return i.setTime(t*(1-a)+r*a),i}}function Yr(t,r){return t=+t,r=+r,function(i){return t*(1-i)+r*i}}function Lx(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]=Sa(t[u],r[u]):a[u]=r[u];return function(f){for(u in i)a[u]=i[u](f);return a}}var Sf=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,nf=new RegExp(Sf.source,"g");function Fx(t){return function(){return t}}function Bx(t){return function(r){return t(r)+""}}function Am(t,r){var i=Sf.lastIndex=nf.lastIndex=0,a,u,f,d=-1,m=[],v=[];for(t=t+"",r=r+"";(a=Sf.exec(t))&&(u=nf.exec(r));)(f=u.index)>i&&(f=r.slice(i,f),m[d]?m[d]+=f:m[++d]=f),(a=a[0])===(u=u[0])?m[d]?m[d]+=u:m[++d]=u:(m[++d]=null,v.push({i:d,x:Yr(a,u)})),i=nf.lastIndex;return i<r.length&&(f=r.slice(i),m[d]?m[d]+=f:m[++d]=f),m.length<2?v[0]?Bx(v[0].x):Fx(r):(r=v.length,function(w){for(var b=0,x;b<r;++b)m[(x=v[b]).i]=x.x(w);return m.join("")})}function Sa(t,r){var i=typeof r,a;return r==null||i==="boolean"?zf(r):(i==="number"?Yr:i==="string"?(a=Di(r))?(r=a,cu):Am:r instanceof Di?cu:r instanceof Date?zx:Rx(r)?Ox:Array.isArray(r)?Dx:typeof r.valueOf!="function"&&typeof r.toString!="function"||isNaN(r)?Lx:Yr)(t,r)}var uh=180/Math.PI,bf={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function $m(t,r,i,a,u,f){var d,m,v;return(d=Math.sqrt(t*t+r*r))&&(t/=d,r/=d),(v=t*i+r*a)&&(i-=t*v,a-=r*v),(m=Math.sqrt(i*i+a*a))&&(i/=m,a/=m,v/=m),t*a<r*i&&(t=-t,r=-r,v=-v,d=-d),{translateX:u,translateY:f,rotate:Math.atan2(r,t)*uh,skewX:Math.atan(v)*uh,scaleX:d,scaleY:m}}var Wl;function Hx(t){const r=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return r.isIdentity?bf:$m(r.a,r.b,r.c,r.d,r.e,r.f)}function Vx(t){return t==null||(Wl||(Wl=document.createElementNS("http://www.w3.org/2000/svg","g")),Wl.setAttribute("transform",t),!(t=Wl.transform.baseVal.consolidate()))?bf:(t=t.matrix,$m(t.a,t.b,t.c,t.d,t.e,t.f))}function Om(t,r,i,a){function u(w){return w.length?w.pop()+" ":""}function f(w,b,x,S,N,P){if(w!==x||b!==S){var $=N.push("translate(",null,r,null,i);P.push({i:$-4,x:Yr(w,x)},{i:$-2,x:Yr(b,S)})}else(x||S)&&N.push("translate("+x+r+S+i)}function d(w,b,x,S){w!==b?(w-b>180?b+=360:b-w>180&&(w+=360),S.push({i:x.push(u(x)+"rotate(",null,a)-2,x:Yr(w,b)})):b&&x.push(u(x)+"rotate("+b+a)}function m(w,b,x,S){w!==b?S.push({i:x.push(u(x)+"skewX(",null,a)-2,x:Yr(w,b)}):b&&x.push(u(x)+"skewX("+b+a)}function v(w,b,x,S,N,P){if(w!==x||b!==S){var $=N.push(u(N)+"scale(",null,",",null,")");P.push({i:$-4,x:Yr(w,x)},{i:$-2,x:Yr(b,S)})}else(x!==1||S!==1)&&N.push(u(N)+"scale("+x+","+S+")")}return function(w,b){var x=[],S=[];return w=t(w),b=t(b),f(w.translateX,w.translateY,b.translateX,b.translateY,x,S),d(w.rotate,b.rotate,x,S),m(w.skewX,b.skewX,x,S),v(w.scaleX,w.scaleY,b.scaleX,b.scaleY,x,S),w=b=null,function(N){for(var P=-1,$=S.length,M;++P<$;)x[(M=S[P]).i]=M.x(N);return x.join("")}}}var Kx=Om(Hx,"px, ","px)","deg)"),Ux=Om(Vx,", ",")",")"),qx=1e-12;function ch(t){return((t=Math.exp(t))+1/t)/2}function Wx(t){return((t=Math.exp(t))-1/t)/2}function Yx(t){return((t=Math.exp(2*t))-1)/(t+1)}const tu=(function t(r,i,a){function u(f,d){var m=f[0],v=f[1],w=f[2],b=d[0],x=d[1],S=d[2],N=b-m,P=x-v,$=N*N+P*P,M,I;if($<qx)I=Math.log(S/w)/r,M=function(q){return[m+q*N,v+q*P,w*Math.exp(r*q*I)]};else{var H=Math.sqrt($),j=(S*S-w*w+a*$)/(2*w*i*H),R=(S*S-w*w-a*$)/(2*S*i*H),W=Math.log(Math.sqrt(j*j+1)-j),V=Math.log(Math.sqrt(R*R+1)-R);I=(V-W)/r,M=function(q){var pe=q*I,he=ch(W),_e=w/(i*H)*(he*Yx(r*pe+W)-Wx(W));return[m+_e*N,v+_e*P,w*he/ch(r*pe+W)]}}return M.duration=I*1e3*r/Math.SQRT2,M}return u.rho=function(f){var d=Math.max(.001,+f),m=d*d,v=m*m;return t(d,m,v)},u})(Math.SQRT2,2,4);var Ts=0,wa=0,va=0,Rm=1e3,fu,_a,du=0,zi=0,ku=0,Ca=typeof performance=="object"&&performance.now?performance:Date,Dm=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Lf(){return zi||(Dm(Xx),zi=Ca.now()+ku)}function Xx(){zi=0}function pu(){this._call=this._time=this._next=null}pu.prototype=zm.prototype={constructor:pu,restart:function(t,r,i){if(typeof t!="function")throw new TypeError("callback is not a function");i=(i==null?Lf():+i)+(r==null?0:+r),!this._next&&_a!==this&&(_a?_a._next=this:fu=this,_a=this),this._call=t,this._time=i,kf()},stop:function(){this._call&&(this._call=null,this._time=1/0,kf())}};function zm(t,r,i){var a=new pu;return a.restart(t,r,i),a}function Qx(){Lf(),++Ts;for(var t=fu,r;t;)(r=zi-t._time)>=0&&t._call.call(void 0,r),t=t._next;--Ts}function fh(){zi=(du=Ca.now())+ku,Ts=wa=0;try{Qx()}finally{Ts=0,Zx(),zi=0}}function Gx(){var t=Ca.now(),r=t-du;r>Rm&&(ku-=r,du=t)}function Zx(){for(var t,r=fu,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:fu=i);_a=t,kf(a)}function kf(t){if(!Ts){wa&&(wa=clearTimeout(wa));var r=t-zi;r>24?(t<1/0&&(wa=setTimeout(fh,t-Ca.now()-ku)),va&&(va=clearInterval(va))):(va||(du=Ca.now(),va=setInterval(Gx,Rm)),Ts=1,Dm(fh))}}function dh(t,r,i){var a=new pu;return r=r==null?0:+r,a.restart(u=>{a.stop(),t(u+r)},r,i),a}var Jx=Su("start","end","cancel","interrupt"),ew=[],Lm=0,ph=1,Ef=2,nu=3,hh=4,Nf=5,ru=6;function Eu(t,r,i,a,u,f){var d=t.__transition;if(!d)t.__transition={};else if(i in d)return;tw(t,i,{name:r,index:a,group:u,on:Jx,tween:ew,time:f.time,delay:f.delay,duration:f.duration,ease:f.ease,timer:null,state:Lm})}function Ff(t,r){var i=$r(t,r);if(i.state>Lm)throw new Error("too late; already scheduled");return i}function Zr(t,r){var i=$r(t,r);if(i.state>nu)throw new Error("too late; already running");return i}function $r(t,r){var i=t.__transition;if(!i||!(i=i[r]))throw new Error("transition not found");return i}function tw(t,r,i){var a=t.__transition,u;a[r]=i,i.timer=zm(f,0,i.time);function f(w){i.state=ph,i.timer.restart(d,i.delay,i.time),i.delay<=w&&d(w-i.delay)}function d(w){var b,x,S,N;if(i.state!==ph)return v();for(b in a)if(N=a[b],N.name===i.name){if(N.state===nu)return dh(d);N.state===hh?(N.state=ru,N.timer.stop(),N.on.call("interrupt",t,t.__data__,N.index,N.group),delete a[b]):+b<r&&(N.state=ru,N.timer.stop(),N.on.call("cancel",t,t.__data__,N.index,N.group),delete a[b])}if(dh(function(){i.state===nu&&(i.state=hh,i.timer.restart(m,i.delay,i.time),m(w))}),i.state=Ef,i.on.call("start",t,t.__data__,i.index,i.group),i.state===Ef){for(i.state=nu,u=new Array(S=i.tween.length),b=0,x=-1;b<S;++b)(N=i.tween[b].value.call(t,t.__data__,i.index,i.group))&&(u[++x]=N);u.length=x+1}}function m(w){for(var b=w<i.duration?i.ease.call(null,w/i.duration):(i.timer.restart(v),i.state=Nf,1),x=-1,S=u.length;++x<S;)u[x].call(t,b);i.state===Nf&&(i.on.call("end",t,t.__data__,i.index,i.group),v())}function v(){i.state=ru,i.timer.stop(),delete a[r];for(var w in a)return;delete t.__transition}}function ou(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>Ef&&a.state<Nf,a.state=ru,a.timer.stop(),a.on.call(u?"interrupt":"cancel",t,t.__data__,a.index,a.group),delete i[d]}f&&delete t.__transition}}function nw(t){return this.each(function(){ou(this,t)})}function rw(t,r){var i,a;return function(){var u=Zr(this,t),f=u.tween;if(f!==i){a=i=f;for(var d=0,m=a.length;d<m;++d)if(a[d].name===r){a=a.slice(),a.splice(d,1);break}}u.tween=a}}function ow(t,r,i){var a,u;if(typeof i!="function")throw new Error;return function(){var f=Zr(this,t),d=f.tween;if(d!==a){u=(a=d).slice();for(var m={name:r,value:i},v=0,w=u.length;v<w;++v)if(u[v].name===r){u[v]=m;break}v===w&&u.push(m)}f.tween=u}}function iw(t,r){var i=this._id;if(t+="",arguments.length<2){for(var a=$r(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?rw:ow)(i,t,r))}function Bf(t,r,i){var a=t._id;return t.each(function(){var u=Zr(this,a);(u.value||(u.value={}))[r]=i.apply(this,arguments)}),function(u){return $r(u,a).value[r]}}function Fm(t,r){var i;return(typeof r=="number"?Yr:r instanceof Di?cu:(i=Di(r))?(r=i,cu):Am)(t,r)}function sw(t){return function(){this.removeAttribute(t)}}function aw(t){return function(){this.removeAttributeNS(t.space,t.local)}}function lw(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 uw(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 cw(t,r,i){var a,u,f;return function(){var d,m=i(this),v;return m==null?void this.removeAttribute(t):(d=this.getAttribute(t),v=m+"",d===v?null:d===a&&v===u?f:(u=v,f=r(a=d,m)))}}function fw(t,r,i){var a,u,f;return function(){var d,m=i(this),v;return m==null?void this.removeAttributeNS(t.space,t.local):(d=this.getAttributeNS(t.space,t.local),v=m+"",d===v?null:d===a&&v===u?f:(u=v,f=r(a=d,m)))}}function dw(t,r){var i=bu(t),a=i==="transform"?Ux:Fm;return this.attrTween(t,typeof r=="function"?(i.local?fw:cw)(i,a,Bf(this,"attr."+t,r)):r==null?(i.local?aw:sw)(i):(i.local?uw:lw)(i,a,r))}function pw(t,r){return function(i){this.setAttribute(t,r.call(this,i))}}function hw(t,r){return function(i){this.setAttributeNS(t.space,t.local,r.call(this,i))}}function mw(t,r){var i,a;function u(){var f=r.apply(this,arguments);return f!==a&&(i=(a=f)&&hw(t,f)),i}return u._value=r,u}function gw(t,r){var i,a;function u(){var f=r.apply(this,arguments);return f!==a&&(i=(a=f)&&pw(t,f)),i}return u._value=r,u}function yw(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=bu(t);return this.tween(i,(a.local?mw:gw)(a,r))}function vw(t,r){return function(){Ff(this,t).delay=+r.apply(this,arguments)}}function xw(t,r){return r=+r,function(){Ff(this,t).delay=r}}function ww(t){var r=this._id;return arguments.length?this.each((typeof t=="function"?vw:xw)(r,t)):$r(this.node(),r).delay}function _w(t,r){return function(){Zr(this,t).duration=+r.apply(this,arguments)}}function Sw(t,r){return r=+r,function(){Zr(this,t).duration=r}}function bw(t){var r=this._id;return arguments.length?this.each((typeof t=="function"?_w:Sw)(r,t)):$r(this.node(),r).duration}function kw(t,r){if(typeof r!="function")throw new Error;return function(){Zr(this,t).ease=r}}function Ew(t){var r=this._id;return arguments.length?this.each(kw(r,t)):$r(this.node(),r).ease}function Nw(t,r){return function(){var i=r.apply(this,arguments);if(typeof i!="function")throw new Error;Zr(this,t).ease=i}}function Cw(t){if(typeof t!="function")throw new Error;return this.each(Nw(this._id,t))}function Pw(t){typeof t!="function"&&(t=ym(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,m=a[u]=[],v,w=0;w<d;++w)(v=f[w])&&t.call(v,v.__data__,w,f)&&m.push(v);return new To(a,this._parents,this._name,this._id)}function jw(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),m=0;m<f;++m)for(var v=r[m],w=i[m],b=v.length,x=d[m]=new Array(b),S,N=0;N<b;++N)(S=v[N]||w[N])&&(x[N]=S);for(;m<a;++m)d[m]=r[m];return new To(d,this._parents,this._name,this._id)}function Tw(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 Mw(t,r,i){var a,u,f=Tw(r)?Ff:Zr;return function(){var d=f(this,t),m=d.on;m!==a&&(u=(a=m).copy()).on(r,i),d.on=u}}function Iw(t,r){var i=this._id;return arguments.length<2?$r(this.node(),i).on.on(t):this.each(Mw(i,t,r))}function Aw(t){return function(){var r=this.parentNode;for(var i in this.__transition)if(+i!==t)return;r&&r.removeChild(this)}}function $w(){return this.on("end.remove",Aw(this._id))}function Ow(t){var r=this._name,i=this._id;typeof t!="function"&&(t=Of(t));for(var a=this._groups,u=a.length,f=new Array(u),d=0;d<u;++d)for(var m=a[d],v=m.length,w=f[d]=new Array(v),b,x,S=0;S<v;++S)(b=m[S])&&(x=t.call(b,b.__data__,S,m))&&("__data__"in b&&(x.__data__=b.__data__),w[S]=x,Eu(w[S],r,i,S,w,$r(b,i)));return new To(f,this._parents,r,i)}function Rw(t){var r=this._name,i=this._id;typeof t!="function"&&(t=gm(t));for(var a=this._groups,u=a.length,f=[],d=[],m=0;m<u;++m)for(var v=a[m],w=v.length,b,x=0;x<w;++x)if(b=v[x]){for(var S=t.call(b,b.__data__,x,v),N,P=$r(b,i),$=0,M=S.length;$<M;++$)(N=S[$])&&Eu(N,r,i,$,S,P);f.push(S),d.push(b)}return new To(f,d,r,i)}var Dw=$a.prototype.constructor;function zw(){return new Dw(this._groups,this._parents)}function Lw(t,r){var i,a,u;return function(){var f=js(this,t),d=(this.style.removeProperty(t),js(this,t));return f===d?null:f===i&&d===a?u:u=r(i=f,a=d)}}function Bm(t){return function(){this.style.removeProperty(t)}}function Fw(t,r,i){var a,u=i+"",f;return function(){var d=js(this,t);return d===u?null:d===a?f:f=r(a=d,i)}}function Bw(t,r,i){var a,u,f;return function(){var d=js(this,t),m=i(this),v=m+"";return m==null&&(v=m=(this.style.removeProperty(t),js(this,t))),d===v?null:d===a&&v===u?f:(u=v,f=r(a=d,m))}}function Hw(t,r){var i,a,u,f="style."+r,d="end."+f,m;return function(){var v=Zr(this,t),w=v.on,b=v.value[f]==null?m||(m=Bm(r)):void 0;(w!==i||u!==b)&&(a=(i=w).copy()).on(d,u=b),v.on=a}}function Vw(t,r,i){var a=(t+="")=="transform"?Kx:Fm;return r==null?this.styleTween(t,Lw(t,a)).on("end.style."+t,Bm(t)):typeof r=="function"?this.styleTween(t,Bw(t,a,Bf(this,"style."+t,r))).each(Hw(this._id,t)):this.styleTween(t,Fw(t,a,r),i).on("end.style."+t,null)}function Kw(t,r,i){return function(a){this.style.setProperty(t,r.call(this,a),i)}}function Uw(t,r,i){var a,u;function f(){var d=r.apply(this,arguments);return d!==u&&(a=(u=d)&&Kw(t,d,i)),a}return f._value=r,f}function qw(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,Uw(t,r,i??""))}function Ww(t){return function(){this.textContent=t}}function Yw(t){return function(){var r=t(this);this.textContent=r??""}}function Xw(t){return this.tween("text",typeof t=="function"?Yw(Bf(this,"text",t)):Ww(t==null?"":t+""))}function Qw(t){return function(r){this.textContent=t.call(this,r)}}function Gw(t){var r,i;function a(){var u=t.apply(this,arguments);return u!==i&&(r=(i=u)&&Qw(u)),r}return a._value=t,a}function Zw(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,Gw(t))}function Jw(){for(var t=this._name,r=this._id,i=Hm(),a=this._groups,u=a.length,f=0;f<u;++f)for(var d=a[f],m=d.length,v,w=0;w<m;++w)if(v=d[w]){var b=$r(v,r);Eu(v,t,i,w,d,{time:b.time+b.delay+b.duration,delay:0,duration:b.duration,ease:b.ease})}return new To(a,this._parents,t,i)}function e1(){var t,r,i=this,a=i._id,u=i.size();return new Promise(function(f,d){var m={value:d},v={value:function(){--u===0&&f()}};i.each(function(){var w=Zr(this,a),b=w.on;b!==t&&(r=(t=b).copy(),r._.cancel.push(m),r._.interrupt.push(m),r._.end.push(v)),w.on=r}),u===0&&f()})}var t1=0;function To(t,r,i,a){this._groups=t,this._parents=r,this._name=i,this._id=a}function Hm(){return++t1}var Co=$a.prototype;To.prototype={constructor:To,select:Ow,selectAll:Rw,selectChild:Co.selectChild,selectChildren:Co.selectChildren,filter:Pw,merge:jw,selection:zw,transition:Jw,call:Co.call,nodes:Co.nodes,node:Co.node,size:Co.size,empty:Co.empty,each:Co.each,on:Iw,attr:dw,attrTween:yw,style:Vw,styleTween:qw,text:Xw,textTween:Zw,remove:$w,tween:iw,delay:ww,duration:bw,ease:Ew,easeVarying:Cw,end:e1,[Symbol.iterator]:Co[Symbol.iterator]};function n1(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var r1={time:null,delay:0,duration:250,ease:n1};function o1(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 i1(t){var r,i;t instanceof To?(r=t._id,t=t._name):(r=Hm(),(i=r1).time=Lf(),t=t==null?null:t+"");for(var a=this._groups,u=a.length,f=0;f<u;++f)for(var d=a[f],m=d.length,v,w=0;w<m;++w)(v=d[w])&&Eu(v,t,r,w,d,i||o1(v,r));return new To(a,this._parents,t,r)}$a.prototype.interrupt=nw;$a.prototype.transition=i1;const Yl=t=>()=>t;function s1(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 Po(t,r,i){this.k=t,this.x=r,this.y=i}Po.prototype={constructor:Po,scale:function(t){return t===1?this:new Po(this.k*t,this.x,this.y)},translate:function(t,r){return t===0&r===0?this:new Po(this.k,this.x+this.k*t,this.y+this.k*r)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Nu=new Po(1,0,0);Vm.prototype=Po.prototype;function Vm(t){for(;!t.__zoom;)if(!(t=t.parentNode))return Nu;return t.__zoom}function rf(t){t.stopImmediatePropagation()}function xa(t){t.preventDefault(),t.stopImmediatePropagation()}function a1(t){return(!t.ctrlKey||t.type==="wheel")&&!t.button}function l1(){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 mh(){return this.__zoom||Nu}function u1(t){return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function c1(){return navigator.maxTouchPoints||"ontouchstart"in this}function f1(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 Km(){var t=a1,r=l1,i=f1,a=u1,u=c1,f=[0,1/0],d=[[-1/0,-1/0],[1/0,1/0]],m=250,v=tu,w=Su("start","zoom","end"),b,x,S,N=500,P=150,$=0,M=10;function I(z){z.property("__zoom",mh).on("wheel.zoom",pe,{passive:!1}).on("mousedown.zoom",he).on("dblclick.zoom",_e).filter(u).on("touchstart.zoom",Q).on("touchmove.zoom",le).on("touchend.zoom touchcancel.zoom",xe).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}I.transform=function(z,ue,te,ae){var L=z.selection?z.selection():z;L.property("__zoom",mh),z!==L?W(z,ue,te,ae):L.interrupt().each(function(){V(this,arguments).event(ae).start().zoom(null,typeof ue=="function"?ue.apply(this,arguments):ue).end()})},I.scaleBy=function(z,ue,te,ae){I.scaleTo(z,function(){var L=this.__zoom.k,F=typeof ue=="function"?ue.apply(this,arguments):ue;return L*F},te,ae)},I.scaleTo=function(z,ue,te,ae){I.transform(z,function(){var L=r.apply(this,arguments),F=this.__zoom,X=te==null?R(L):typeof te=="function"?te.apply(this,arguments):te,O=F.invert(X),B=typeof ue=="function"?ue.apply(this,arguments):ue;return i(j(H(F,B),X,O),L,d)},te,ae)},I.translateBy=function(z,ue,te,ae){I.transform(z,function(){return i(this.__zoom.translate(typeof ue=="function"?ue.apply(this,arguments):ue,typeof te=="function"?te.apply(this,arguments):te),r.apply(this,arguments),d)},null,ae)},I.translateTo=function(z,ue,te,ae,L){I.transform(z,function(){var F=r.apply(this,arguments),X=this.__zoom,O=ae==null?R(F):typeof ae=="function"?ae.apply(this,arguments):ae;return i(Nu.translate(O[0],O[1]).scale(X.k).translate(typeof ue=="function"?-ue.apply(this,arguments):-ue,typeof te=="function"?-te.apply(this,arguments):-te),F,d)},ae,L)};function H(z,ue){return ue=Math.max(f[0],Math.min(f[1],ue)),ue===z.k?z:new Po(ue,z.x,z.y)}function j(z,ue,te){var ae=ue[0]-te[0]*z.k,L=ue[1]-te[1]*z.k;return ae===z.x&&L===z.y?z:new Po(z.k,ae,L)}function R(z){return[(+z[0][0]+ +z[1][0])/2,(+z[0][1]+ +z[1][1])/2]}function W(z,ue,te,ae){z.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,X=V(L,F).event(ae),O=r.apply(L,F),B=te==null?R(O):typeof te=="function"?te.apply(L,F):te,ke=Math.max(O[1][0]-O[0][0],O[1][1]-O[0][1]),Se=L.__zoom,Ie=typeof ue=="function"?ue.apply(L,F):ue,Re=v(Se.invert(B).concat(ke/Se.k),Ie.invert(B).concat(ke/Ie.k));return function(Ae){if(Ae===1)Ae=Ie;else{var we=Re(Ae),Fe=ke/we[2];Ae=new Po(Fe,B[0]-we[0]*Fe,B[1]-we[1]*Fe)}X.zoom(null,Ae)}})}function V(z,ue,te){return!te&&z.__zooming||new q(z,ue)}function q(z,ue){this.that=z,this.args=ue,this.active=0,this.sourceEvent=null,this.extent=r.apply(z,ue),this.taps=0}q.prototype={event:function(z){return z&&(this.sourceEvent=z),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(z,ue){return this.mouse&&z!=="mouse"&&(this.mouse[1]=ue.invert(this.mouse[0])),this.touch0&&z!=="touch"&&(this.touch0[1]=ue.invert(this.touch0[0])),this.touch1&&z!=="touch"&&(this.touch1[1]=ue.invert(this.touch1[0])),this.that.__zoom=ue,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(z){var ue=Jn(this.that).datum();w.call(z,this.that,new s1(z,{sourceEvent:this.sourceEvent,target:I,transform:this.that.__zoom,dispatch:w}),ue)}};function pe(z,...ue){if(!t.apply(this,arguments))return;var te=V(this,ue).event(z),ae=this.__zoom,L=Math.max(f[0],Math.min(f[1],ae.k*Math.pow(2,a.apply(this,arguments)))),F=Tr(z);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)],ou(this),te.start()}xa(z),te.wheel=setTimeout(X,P),te.zoom("mouse",i(j(H(ae,L),te.mouse[0],te.mouse[1]),te.extent,d));function X(){te.wheel=null,te.end()}}function he(z,...ue){if(S||!t.apply(this,arguments))return;var te=z.currentTarget,ae=V(this,ue,!0).event(z),L=Jn(z.view).on("mousemove.zoom",B,!0).on("mouseup.zoom",ke,!0),F=Tr(z,te),X=z.clientX,O=z.clientY;Cm(z.view),rf(z),ae.mouse=[F,this.__zoom.invert(F)],ou(this),ae.start();function B(Se){if(xa(Se),!ae.moved){var Ie=Se.clientX-X,Re=Se.clientY-O;ae.moved=Ie*Ie+Re*Re>$}ae.event(Se).zoom("mouse",i(j(ae.that.__zoom,ae.mouse[0]=Tr(Se,te),ae.mouse[1]),ae.extent,d))}function ke(Se){L.on("mousemove.zoom mouseup.zoom",null),Pm(Se.view,ae.moved),xa(Se),ae.event(Se).end()}}function _e(z,...ue){if(t.apply(this,arguments)){var te=this.__zoom,ae=Tr(z.changedTouches?z.changedTouches[0]:z,this),L=te.invert(ae),F=te.k*(z.shiftKey?.5:2),X=i(j(H(te,F),ae,L),r.apply(this,ue),d);xa(z),m>0?Jn(this).transition().duration(m).call(W,X,ae,z):Jn(this).call(I.transform,X,ae,z)}}function Q(z,...ue){if(t.apply(this,arguments)){var te=z.touches,ae=te.length,L=V(this,ue,z.changedTouches.length===ae).event(z),F,X,O,B;for(rf(z),X=0;X<ae;++X)O=te[X],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+!!b);b&&(b=clearTimeout(b)),F&&(L.taps<2&&(x=B[0],b=setTimeout(function(){b=null},N)),ou(this),L.start())}}function le(z,...ue){if(this.__zooming){var te=V(this,ue).event(z),ae=z.changedTouches,L=ae.length,F,X,O,B;for(xa(z),F=0;F<L;++F)X=ae[F],O=Tr(X,this),te.touch0&&te.touch0[2]===X.identifier?te.touch0[0]=O:te.touch1&&te.touch1[2]===X.identifier&&(te.touch1[0]=O);if(X=te.that.__zoom,te.touch1){var ke=te.touch0[0],Se=te.touch0[1],Ie=te.touch1[0],Re=te.touch1[1],Ae=(Ae=Ie[0]-ke[0])*Ae+(Ae=Ie[1]-ke[1])*Ae,we=(we=Re[0]-Se[0])*we+(we=Re[1]-Se[1])*we;X=H(X,Math.sqrt(Ae/we)),O=[(ke[0]+Ie[0])/2,(ke[1]+Ie[1])/2],B=[(Se[0]+Re[0])/2,(Se[1]+Re[1])/2]}else if(te.touch0)O=te.touch0[0],B=te.touch0[1];else return;te.zoom("touch",i(j(X,O,B),te.extent,d))}}function xe(z,...ue){if(this.__zooming){var te=V(this,ue).event(z),ae=z.changedTouches,L=ae.length,F,X;for(rf(z),S&&clearTimeout(S),S=setTimeout(function(){S=null},N),F=0;F<L;++F)X=ae[F],te.touch0&&te.touch0[2]===X.identifier?delete te.touch0:te.touch1&&te.touch1[2]===X.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&&(X=Tr(X,this),Math.hypot(x[0]-X[0],x[1]-X[1])<M)){var O=Jn(this).on("dblclick.zoom");O&&O.apply(this,arguments)}}}return I.wheelDelta=function(z){return arguments.length?(a=typeof z=="function"?z:Yl(+z),I):a},I.filter=function(z){return arguments.length?(t=typeof z=="function"?z:Yl(!!z),I):t},I.touchable=function(z){return arguments.length?(u=typeof z=="function"?z:Yl(!!z),I):u},I.extent=function(z){return arguments.length?(r=typeof z=="function"?z:Yl([[+z[0][0],+z[0][1]],[+z[1][0],+z[1][1]]]),I):r},I.scaleExtent=function(z){return arguments.length?(f[0]=+z[0],f[1]=+z[1],I):[f[0],f[1]]},I.translateExtent=function(z){return arguments.length?(d[0][0]=+z[0][0],d[1][0]=+z[1][0],d[0][1]=+z[0][1],d[1][1]=+z[1][1],I):[[d[0][0],d[0][1]],[d[1][0],d[1][1]]]},I.constrain=function(z){return arguments.length?(i=z,I):i},I.duration=function(z){return arguments.length?(m=+z,I):m},I.interpolate=function(z){return arguments.length?(v=z,I):v},I.on=function(){var z=w.on.apply(w,arguments);return z===w?I:z},I.clickDistance=function(z){return arguments.length?($=(z=+z)*z,I):Math.sqrt($)},I.tapDistance=function(z){return arguments.length?(M=+z,I):M},I}const Qr={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:t=>`Node type "${t}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:t=>`The old edge with id=${t} does not exist.`,error009:t=>`Marker type "${t}" doesn't exist.`,error008:(t,{id:r,sourceHandle:i,targetHandle: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."},Pa=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Um=["Enter"," ","Escape"],qm={"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 Ms;(function(t){t.Strict="strict",t.Loose="loose"})(Ms||(Ms={}));var Ri;(function(t){t.Free="free",t.Vertical="vertical",t.Horizontal="horizontal"})(Ri||(Ri={}));var ja;(function(t){t.Partial="partial",t.Full="full"})(ja||(ja={}));const Wm={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var li;(function(t){t.Bezier="default",t.Straight="straight",t.Step="step",t.SmoothStep="smoothstep",t.SimpleBezier="simplebezier"})(li||(li={}));var hu;(function(t){t.Arrow="arrow",t.ArrowClosed="arrowclosed"})(hu||(hu={}));var Ze;(function(t){t.Left="left",t.Top="top",t.Right="right",t.Bottom="bottom"})(Ze||(Ze={}));const gh={[Ze.Left]:Ze.Right,[Ze.Right]:Ze.Left,[Ze.Top]:Ze.Bottom,[Ze.Bottom]:Ze.Top};function Ym(t){return t===null?null:t?"valid":"invalid"}const Xm=t=>"id"in t&&"source"in t&&"target"in t,d1=t=>"id"in t&&"position"in t&&!("source"in t)&&!("target"in t),Hf=t=>"id"in t&&"internals"in t&&!("source"in t)&&!("target"in t),Ra=(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}},p1=(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):Hf(u)?u:r.nodeLookup.get(u.id));const m=d?mu(d,r.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Cu(a,m)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Pu(i)},Da=(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=Cu(i,mu(u)),a=!0)}),a?Pu(i):{x:0,y:0,width:0,height:0}},Vf=(t,r,[i,a,u]=[0,0,1],f=!1,d=!1)=>{const m={...La(r,[i,a,u]),width:r.width/u,height:r.height/u},v=[];for(const w of t.values()){const{measured:b,selectable:x=!0,hidden:S=!1}=w;if(d&&!x||S)continue;const N=b.width??w.width??w.initialWidth??null,P=b.height??w.height??w.initialHeight??null,$=Ta(m,As(w)),M=(N??0)*(P??0),I=f&&$>0;(!w.internals.handleBounds||I||$>=M||w.dragging)&&v.push(w)}return v},h1=(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 m1(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 g1({nodes:t,width:r,height:i,panZoom:a,minZoom:u,maxZoom:f},d){if(t.size===0)return Promise.resolve(!0);const m=m1(t,d),v=Da(m),w=Kf(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 Qm({nodeId:t,nextPosition:r,nodeLookup:i,nodeOrigin:a=[0,0],nodeExtent:u,onError:f}){const d=i.get(t),m=d.parentId?i.get(d.parentId):void 0,{x:v,y:w}=m?m.internals.positionAbsolute:{x:0,y:0},b=d.origin??a;let x=d.extent||u;if(d.extent==="parent"&&!d.expandParent)if(!m)f==null||f("005",Qr.error005());else{const N=m.measured.width,P=m.measured.height;N&&P&&(x=[[v,w],[v+N,w+P]])}else m&&$s(d.extent)&&(x=[[d.extent[0][0]+v,d.extent[0][1]+w],[d.extent[1][0]+v,d.extent[1][1]+w]]);const S=$s(x)?Li(r,x,d.measured):r;return(d.measured.width===void 0||d.measured.height===void 0)&&(f==null||f("015",Qr.error015())),{position:{x:S.x-v+(d.measured.width??0)*b[0],y:S.y-w+(d.measured.height??0)*b[1]},positionAbsolute:S}}async function y1({nodesToRemove:t=[],edgesToRemove:r=[],nodes:i,edges:a,onBeforeDelete:u}){const f=new Set(t.map(S=>S.id)),d=[];for(const S of i){if(S.deletable===!1)continue;const N=f.has(S.id),P=!N&&S.parentId&&d.find($=>$.id===S.parentId);(N||P)&&d.push(S)}const m=new Set(r.map(S=>S.id)),v=a.filter(S=>S.deletable!==!1),b=h1(d,v);for(const S of v)m.has(S.id)&&!b.find(P=>P.id===S.id)&&b.push(S);if(!u)return{edges:b,nodes:d};const x=await u({nodes:d,edges:b});return typeof x=="boolean"?x?{edges:b,nodes:d}:{edges:[],nodes:[]}:x}const Is=(t,r=0,i=1)=>Math.min(Math.max(t,r),i),Li=(t={x:0,y:0},r,i)=>({x:Is(t.x,r[0][0],r[1][0]-((i==null?void 0:i.width)??0)),y:Is(t.y,r[0][1],r[1][1]-((i==null?void 0:i.height)??0))});function Gm(t,r,i){const{width:a,height:u}=Mo(i),{x:f,y:d}=i.internals.positionAbsolute;return Li(t,[[f,d],[f+a,d+u]],r)}const yh=(t,r,i)=>t<r?Is(Math.abs(t-r),1,r)/r:t>i?-Is(Math.abs(t-i),1,r)/r:0,Zm=(t,r,i=15,a=40)=>{const u=yh(t.x,a,r.width-a)*i,f=yh(t.y,a,r.height-a)*i;return[u,f]},Cu=(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)}),Cf=({x:t,y:r,width:i,height:a})=>({x:t,y:r,x2:t+i,y2:r+a}),Pu=({x:t,y:r,x2:i,y2:a})=>({x:t,y:r,width:i-t,height:a-r}),As=(t,r=[0,0])=>{var u,f;const{x:i,y:a}=Hf(t)?t.internals.positionAbsolute:Ra(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}},mu=(t,r=[0,0])=>{var u,f;const{x:i,y:a}=Hf(t)?t.internals.positionAbsolute:Ra(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)}},Jm=(t,r)=>Pu(Cu(Cf(t),Cf(r))),Ta=(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)},vh=t=>Ir(t.width)&&Ir(t.height)&&Ir(t.x)&&Ir(t.y),Ir=t=>!isNaN(t)&&isFinite(t),v1=(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])}),La=({x:t,y:r},[i,a,u],f=!1,d=[1,1])=>{const m={x:(t-i)/u,y:(r-a)/u};return f?za(m,d):m},gu=({x:t,y:r},[i,a,u])=>({x:t*u+i,y:r*u+a});function bs(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 x1(t,r,i){if(typeof t=="string"||typeof t=="number"){const a=bs(t,i),u=bs(t,r);return{top:a,right:u,bottom:a,left:u,x:u*2,y:a*2}}if(typeof t=="object"){const a=bs(t.top??t.y??0,i),u=bs(t.bottom??t.y??0,i),f=bs(t.left??t.x??0,r),d=bs(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 w1(t,r,i,a,u,f){const{x:d,y:m}=gu(t,[r,i,a]),{x:v,y:w}=gu({x:t.x+t.width,y:t.y+t.height},[r,i,a]),b=u-v,x=f-w;return{left:Math.floor(d),top:Math.floor(m),right:Math.floor(b),bottom:Math.floor(x)}}const Kf=(t,r,i,a,u,f)=>{const d=x1(f,r,i),m=(r-d.x)/t.width,v=(i-d.y)/t.height,w=Math.min(m,v),b=Is(w,a,u),x=t.x+t.width/2,S=t.y+t.height/2,N=r/2-x*b,P=i/2-S*b,$=w1(t,N,P,b,r,i),M={left:Math.min($.left-d.left,0),top:Math.min($.top-d.top,0),right:Math.min($.right-d.right,0),bottom:Math.min($.bottom-d.bottom,0)};return{x:N-M.left+M.right,y:P-M.top+M.bottom,zoom:b}},Ma=()=>{var t;return typeof navigator<"u"&&((t=navigator==null?void 0:navigator.userAgent)==null?void 0:t.indexOf("Mac"))>=0};function $s(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 eg(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 tg(t,r={width:0,height:0},i,a,u){const f={...t},d=a.get(i);if(d){const m=d.origin||u;f.x+=d.internals.positionAbsolute.x-(r.width??0)*m[0],f.y+=d.internals.positionAbsolute.y-(r.height??0)*m[1]}return f}function xh(t,r){if(t.size!==r.size)return!1;for(const i of t)if(!r.has(i))return!1;return!0}function _1(){let t,r;return{promise:new Promise((a,u)=>{t=a,r=u}),resolve:t,reject:r}}function S1(t){return{...qm,...t||{}}}function ba(t,{snapGrid:r=[0,0],snapToGrid:i=!1,transform:a,containerBounds:u}){const{x:f,y:d}=Ar(t),m=La({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(m,r):m;return{xSnapped:v,ySnapped:w,...m}}const Uf=t=>({width:t.offsetWidth,height:t.offsetHeight}),ng=t=>{var r;return((r=t==null?void 0:t.getRootNode)==null?void 0:r.call(t))||(window==null?void 0:window.document)},b1=["INPUT","SELECT","TEXTAREA"];function rg(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:b1.includes(r.nodeName)||r.hasAttribute("contenteditable")||!!r.closest(".nokey")}const og=t=>"clientX"in t,Ar=(t,r)=>{var f,d;const i=og(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)}},wh=(t,r,i,a,u)=>{const f=r.querySelectorAll(`.${t}`);return!f||!f.length?null:Array.from(f).map(d=>{const m=d.getBoundingClientRect();return{id:d.getAttribute("data-handleid"),type:t,nodeId:u,position:d.getAttribute("data-handlepos"),x:(m.left-i.left)/a,y:(m.top-i.top)/a,...Uf(d)}})};function ig({sourceX:t,sourceY:r,targetX:i,targetY:a,sourceControlX:u,sourceControlY:f,targetControlX:d,targetControlY:m}){const v=t*.125+u*.375+d*.375+i*.125,w=r*.125+f*.375+m*.375+a*.125,b=Math.abs(v-t),x=Math.abs(w-r);return[v,w,b,x]}function Xl(t,r){return t>=0?.5*t:r*25*Math.sqrt(-t)}function _h({pos:t,x1:r,y1:i,x2:a,y2:u,c:f}){switch(t){case Ze.Left:return[r-Xl(r-a,f),i];case Ze.Right:return[r+Xl(a-r,f),i];case Ze.Top:return[r,i-Xl(i-u,f)];case Ze.Bottom:return[r,i+Xl(u-i,f)]}}function sg({sourceX:t,sourceY:r,sourcePosition:i=Ze.Bottom,targetX:a,targetY:u,targetPosition:f=Ze.Top,curvature:d=.25}){const[m,v]=_h({pos:i,x1:t,y1:r,x2:a,y2:u,c:d}),[w,b]=_h({pos:f,x1:a,y1:u,x2:t,y2:r,c:d}),[x,S,N,P]=ig({sourceX:t,sourceY:r,targetX:a,targetY:u,sourceControlX:m,sourceControlY:v,targetControlX:w,targetControlY:b});return[`M${t},${r} C${m},${v} ${w},${b} ${a},${u}`,x,S,N,P]}function ag({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,m=a<r?a+d:a-d;return[f,m,u,d]}function k1({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,m=Math.max(t.parentId||u&&t.selected?t.internals.z:0,r.parentId||u&&r.selected?r.internals.z:0);return d+m}function E1({sourceNode:t,targetNode:r,width:i,height:a,transform:u}){const f=Cu(mu(t),mu(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 Ta(d,Pu(f))>0}const N1=({source:t,sourceHandle:r,target:i,targetHandle:a})=>`xy-edge__${t}${r||""}-${i}${a||""}`,C1=(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)),lg=(t,r,i={})=>{if(!t.source||!t.target)return r;const a=i.getEdgeId||N1;let u;return Xm(t)?u={...t}:u={...t,id:a(t)},C1(u,r)?r:(u.sourceHandle===null&&delete u.sourceHandle,u.targetHandle===null&&delete u.targetHandle,r.concat(u))};function ug({sourceX:t,sourceY:r,targetX:i,targetY:a}){const[u,f,d,m]=ag({sourceX:t,sourceY:r,targetX:i,targetY:a});return[`M ${t},${r}L ${i},${a}`,u,f,d,m]}const Sh={[Ze.Left]:{x:-1,y:0},[Ze.Right]:{x:1,y:0},[Ze.Top]:{x:0,y:-1},[Ze.Bottom]:{x:0,y:1}},P1=({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},bh=(t,r)=>Math.sqrt(Math.pow(r.x-t.x,2)+Math.pow(r.y-t.y,2));function j1({source:t,sourcePosition:r=Ze.Bottom,target:i,targetPosition:a=Ze.Top,center:u,offset:f,stepPosition:d}){const m=Sh[r],v=Sh[a],w={x:t.x+m.x*f,y:t.y+m.y*f},b={x:i.x+v.x*f,y:i.y+v.y*f},x=P1({source:w,sourcePosition:r,target:b}),S=x.x!==0?"x":"y",N=x[S];let P=[],$,M;const I={x:0,y:0},H={x:0,y:0},[,,j,R]=ag({sourceX:t.x,sourceY:t.y,targetX:i.x,targetY:i.y});if(m[S]*v[S]===-1){S==="x"?($=u.x??w.x+(b.x-w.x)*d,M=u.y??(w.y+b.y)/2):($=u.x??(w.x+b.x)/2,M=u.y??w.y+(b.y-w.y)*d);const pe=[{x:$,y:w.y},{x:$,y:b.y}],he=[{x:w.x,y:M},{x:b.x,y:M}];m[S]===N?P=S==="x"?pe:he:P=S==="x"?he:pe}else{const pe=[{x:w.x,y:b.y}],he=[{x:b.x,y:w.y}];if(S==="x"?P=m.x===N?he:pe:P=m.y===N?pe:he,r===a){const z=Math.abs(t[S]-i[S]);if(z<=f){const ue=Math.min(f-1,f-z);m[S]===N?I[S]=(w[S]>t[S]?-1:1)*ue:H[S]=(b[S]>i[S]?-1:1)*ue}}if(r!==a){const z=S==="x"?"y":"x",ue=m[S]===v[z],te=w[z]>b[z],ae=w[z]<b[z];(m[S]===1&&(!ue&&te||ue&&ae)||m[S]!==1&&(!ue&&ae||ue&&te))&&(P=S==="x"?pe:he)}const _e={x:w.x+I.x,y:w.y+I.y},Q={x:b.x+H.x,y:b.y+H.y},le=Math.max(Math.abs(_e.x-P[0].x),Math.abs(Q.x-P[0].x)),xe=Math.max(Math.abs(_e.y-P[0].y),Math.abs(Q.y-P[0].y));le>=xe?($=(_e.x+Q.x)/2,M=P[0].y):($=P[0].x,M=(_e.y+Q.y)/2)}const W={x:w.x+I.x,y:w.y+I.y},V={x:b.x+H.x,y:b.y+H.y};return[[t,...W.x!==P[0].x||W.y!==P[0].y?[W]:[],...P,...V.x!==P[P.length-1].x||V.y!==P[P.length-1].y?[V]:[],i],$,M,j,R]}function T1(t,r,i,a){const u=Math.min(bh(t,r)/2,bh(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,b=t.y<i.y?1:-1;return`L ${f+u*w},${d}Q ${f},${d} ${f},${d+u*b}`}const m=t.x<i.x?1:-1,v=t.y<i.y?-1:1;return`L ${f},${d+u*v}Q ${f},${d} ${f+u*m},${d}`}function Pf({sourceX:t,sourceY:r,sourcePosition:i=Ze.Bottom,targetX:a,targetY:u,targetPosition:f=Ze.Top,borderRadius:d=5,centerX:m,centerY:v,offset:w=20,stepPosition:b=.5}){const[x,S,N,P,$]=j1({source:{x:t,y:r},sourcePosition:i,target:{x:a,y:u},targetPosition:f,center:{x:m,y:v},offset:w,stepPosition:b});let M=`M${x[0].x} ${x[0].y}`;for(let I=1;I<x.length-1;I++)M+=T1(x[I-1],x[I],x[I+1],d);return M+=`L${x[x.length-1].x} ${x[x.length-1].y}`,[M,S,N,P,$]}function kh(t){var r;return t&&!!(t.internals.handleBounds||(r=t.handles)!=null&&r.length)&&!!(t.measured.width||t.width||t.initialWidth)}function M1(t){var x;const{sourceNode:r,targetNode:i}=t;if(!kh(r)||!kh(i))return null;const a=r.internals.handleBounds||Eh(r.handles),u=i.internals.handleBounds||Eh(i.handles),f=Nh((a==null?void 0:a.source)??[],t.sourceHandle),d=Nh(t.connectionMode===Ms.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",Qr.error008(f?"target":"source",{id:t.id,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle})),null;const m=(f==null?void 0:f.position)||Ze.Bottom,v=(d==null?void 0:d.position)||Ze.Top,w=Fi(r,f,m),b=Fi(i,d,v);return{sourceX:w.x,sourceY:w.y,targetX:b.x,targetY:b.y,sourcePosition:m,targetPosition:v}}function Eh(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 Fi(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:m}=r??Mo(t);if(a)return{x:u+d/2,y:f+m/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+m/2};case Ze.Bottom:return{x:u+d/2,y:f+m};case Ze.Left:return{x:u,y:f+m/2}}}function Nh(t,r){return t&&(r?t.find(i=>i.id===r):t[0])||null}function jf(t,r){return t?typeof t=="string"?t:`${r?`${r}__`:""}${Object.keys(t).sort().map(a=>`${a}=${t[a]}`).join("&")}`:""}function I1(t,{id:r,defaultColor:i,defaultMarkerStart:a,defaultMarkerEnd:u}){const f=new Set;return t.reduce((d,m)=>([m.markerStart||a,m.markerEnd||u].forEach(v=>{if(v&&typeof v=="object"){const w=jf(v,r);f.has(w)||(d.push({id:w,color:v.color||i,...v}),f.add(w))}}),d),[]).sort((d,m)=>d.id.localeCompare(m.id))}const cg=1e3,A1=10,qf={nodeOrigin:[0,0],nodeExtent:Pa,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},$1={...qf,checkEquality:!0};function Wf(t,r){const i={...t};for(const a in r)r[a]!==void 0&&(i[a]=r[a]);return i}function O1(t,r,i){const a=Wf(qf,i);for(const u of t.values())if(u.parentId)Xf(u,t,r,a);else{const f=Ra(u,a.nodeOrigin),d=$s(u.extent)?u.extent:a.nodeExtent,m=Li(f,d,Mo(u));u.internals.positionAbsolute=m}}function R1(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 Yf(t){return t==="manual"}function Tf(t,r,i,a={}){var b,x;const u=Wf($1,a),f={i:0},d=new Map(r),m=u!=null&&u.elevateNodesOnSelect&&!Yf(u.zIndexMode)?cg:0;let v=t.length>0,w=!1;r.clear(),i.clear();for(const S of t){let N=d.get(S.id);if(u.checkEquality&&S===(N==null?void 0:N.internals.userNode))r.set(S.id,N);else{const P=Ra(S,u.nodeOrigin),$=$s(S.extent)?S.extent:u.nodeExtent,M=Li(P,$,Mo(S));N={...u.defaults,...S,measured:{width:(b=S.measured)==null?void 0:b.width,height:(x=S.measured)==null?void 0:x.height},internals:{positionAbsolute:M,handleBounds:R1(S,N),z:fg(S,m,u.zIndexMode),userNode:S}},r.set(S.id,N)}(N.measured===void 0||N.measured.width===void 0||N.measured.height===void 0)&&!N.hidden&&(v=!1),S.parentId&&Xf(N,r,i,a,f),w||(w=S.selected??!1)}return{nodesInitialized:v,hasSelectedNodes:w}}function D1(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 Xf(t,r,i,a,u){const{elevateNodesOnSelect:f,nodeOrigin:d,nodeExtent:m,zIndexMode:v}=Wf(qf,a),w=t.parentId,b=r.get(w);if(!b){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}D1(t,i),u&&!b.parentId&&b.internals.rootParentIndex===void 0&&v==="auto"&&(b.internals.rootParentIndex=++u.i,b.internals.z=b.internals.z+u.i*A1),u&&b.internals.rootParentIndex!==void 0&&(u.i=b.internals.rootParentIndex);const x=f&&!Yf(v)?cg:0,{x:S,y:N,z:P}=z1(t,b,d,m,x,v),{positionAbsolute:$}=t.internals,M=S!==$.x||N!==$.y;(M||P!==t.internals.z)&&r.set(t.id,{...t,internals:{...t.internals,positionAbsolute:M?{x:S,y:N}:$,z:P}})}function fg(t,r,i){const a=Ir(t.zIndex)?t.zIndex:0;return Yf(i)?a:a+(t.selected?r:0)}function z1(t,r,i,a,u,f){const{x:d,y:m}=r.internals.positionAbsolute,v=Mo(t),w=Ra(t,i),b=$s(t.extent)?Li(w,t.extent,v):w;let x=Li({x:d+b.x,y:m+b.y},a,v);t.extent==="parent"&&(x=Gm(x,v,r));const S=fg(t,u,f),N=r.internals.z??0;return{x:x.x,y:x.y,z:N>=S?N+1:S}}function Qf(t,r,i,a=[0,0]){var d;const u=[],f=new Map;for(const m of t){const v=r.get(m.parentId);if(!v)continue;const w=((d=f.get(m.parentId))==null?void 0:d.expandedRect)??As(v),b=Jm(w,m.rect);f.set(m.parentId,{expandedRect:b,parent:v})}return f.size>0&&f.forEach(({expandedRect:m,parent:v},w)=>{var j;const b=v.internals.positionAbsolute,x=Mo(v),S=v.origin??a,N=m.x<b.x?Math.round(Math.abs(b.x-m.x)):0,P=m.y<b.y?Math.round(Math.abs(b.y-m.y)):0,$=Math.max(x.width,Math.round(m.width)),M=Math.max(x.height,Math.round(m.height)),I=($-x.width)*S[0],H=(M-x.height)*S[1];(N>0||P>0||I||H)&&(u.push({id:w,type:"position",position:{x:v.position.x-N+I,y:v.position.y-P+H}}),(j=i.get(w))==null||j.forEach(R=>{t.some(W=>W.id===R.id)||u.push({id:R.id,type:"position",position:{x:R.position.x+N,y:R.position.y+P}})})),(x.width<m.width||x.height<m.height||N||P)&&u.push({id:w,type:"dimensions",setAttributes:!0,dimensions:{width:$+(N?S[0]*N-I:0),height:M+(P?S[1]*P-H:0)}})}),u}function L1(t,r,i,a,u,f,d){const m=a==null?void 0:a.querySelector(".xyflow__viewport");let v=!1;if(!m)return{changes:[],updatedInternals:v};const w=[],b=window.getComputedStyle(m),{m22:x}=new window.DOMMatrixReadOnly(b.transform),S=[];for(const N of t.values()){const P=r.get(N.id);if(!P)continue;if(P.hidden){r.set(P.id,{...P,internals:{...P.internals,handleBounds:void 0}}),v=!0;continue}const $=Uf(N.nodeElement),M=P.measured.width!==$.width||P.measured.height!==$.height;if(!!($.width&&$.height&&(M||!P.internals.handleBounds||N.force))){const H=N.nodeElement.getBoundingClientRect(),j=$s(P.extent)?P.extent:f;let{positionAbsolute:R}=P.internals;P.parentId&&P.extent==="parent"?R=Gm(R,$,r.get(P.parentId)):j&&(R=Li(R,j,$));const W={...P,measured:$,internals:{...P.internals,positionAbsolute:R,handleBounds:{source:wh("source",N.nodeElement,H,x,P.id),target:wh("target",N.nodeElement,H,x,P.id)}}};r.set(P.id,W),P.parentId&&Xf(W,r,i,{nodeOrigin:u,zIndexMode:d}),v=!0,M&&(w.push({id:P.id,type:"dimensions",dimensions:$}),P.expandParent&&P.parentId&&S.push({id:P.id,parentId:P.parentId,rect:As(W,u)}))}}if(S.length>0){const N=Qf(S,r,i,u);w.push(...N)}return{changes:w,updatedInternals:v}}async function F1({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),m=!!d&&(d.x!==i[0]||d.y!==i[1]||d.k!==i[2]);return Promise.resolve(m)}function Ch(t,r,i,a,u,f){let d=u;const m=a.get(d)||new Map;a.set(d,m.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 dg(t,r,i){t.clear(),r.clear();for(const a of i){const{source:u,target:f,sourceHandle:d=null,targetHandle:m=null}=a,v={edgeId:a.id,source:u,target:f,sourceHandle:d,targetHandle:m},w=`${u}-${d}--${f}-${m}`,b=`${f}-${m}--${u}-${d}`;Ch("source",v,b,t,u,d),Ch("target",v,w,t,f,m),r.set(a.id,a)}}function pg(t,r){if(!t.parentId)return!1;const i=r.get(t.parentId);return i?i.selected?!0:pg(i,r):!1}function Ph(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 B1(t,r,i,a){const u=new Map;for(const[f,d]of t)if((d.selected||d.id===a)&&(!d.parentId||!pg(d,t))&&(d.draggable||r&&typeof d.draggable>"u")){const m=t.get(f);m&&u.set(f,{id:f,position:m.position||{x:0,y:0},distance:{x:i.x-m.internals.positionAbsolute.x,y:i.y-m.internals.positionAbsolute.y},extent:m.extent,parentId:m.parentId,origin:m.origin,expandParent:m.expandParent,internals:{positionAbsolute:m.internals.positionAbsolute||{x:0,y:0}},measured:{width:m.measured.width??0,height:m.measured.height??0}})}return u}function of({nodeId:t,dragItems:r,nodeLookup:i,dragging:a=!0}){var d,m,v;const u=[];for(const[w,b]of r){const x=(d=i.get(w))==null?void 0:d.internals.userNode;x&&u.push({...x,position:b.position,dragging:a})}if(!t)return[u[0],u];const f=(m=i.get(t))==null?void 0:m.internals.userNode;return[f?{...f,position:((v=r.get(t))==null?void 0:v.position)||f.position,dragging:a}:u[0],u]}function H1({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 V1({onNodeMouseDown:t,getStoreItems:r,onDragStart:i,onDrag:a,onDragStop:u}){let f={x:null,y:null},d=0,m=new Map,v=!1,w={x:0,y:0},b=null,x=!1,S=null,N=!1,P=!1,$=null;function M({noDragClassName:H,handleSelector:j,domNode:R,isSelectable:W,nodeId:V,nodeClickDistance:q=0}){S=Jn(R);function pe({x:le,y:xe}){const{nodeLookup:z,nodeExtent:ue,snapGrid:te,snapToGrid:ae,nodeOrigin:L,onNodeDrag:F,onSelectionDrag:X,onError:O,updateNodePositions:B}=r();f={x:le,y:xe};let ke=!1;const Se=m.size>1,Ie=Se&&ue?Cf(Da(m)):null,Re=Se&&ae?H1({dragItems:m,snapGrid:te,x:le,y:xe}):null;for(const[Ae,we]of m){if(!z.has(Ae))continue;let Fe={x:le-we.distance.x,y:xe-we.distance.y};ae&&(Fe=Re?{x:Math.round(Fe.x+Re.x),y:Math.round(Fe.y+Re.y)}:za(Fe,te));let be=null;if(Se&&ue&&!we.extent&&Ie){const{positionAbsolute:Ye}=we.internals,ut=Ye.x-Ie.x+ue[0][0],st=Ye.x+we.measured.width-Ie.x2+ue[1][0],ct=Ye.y-Ie.y+ue[0][1],ht=Ye.y+we.measured.height-Ie.y2+ue[1][1];be=[[ut,ct],[st,ht]]}const{position:Je,positionAbsolute:Be}=Qm({nodeId:Ae,nextPosition:Fe,nodeLookup:z,nodeExtent:be||ue,nodeOrigin:L,onError:O});ke=ke||we.position.x!==Je.x||we.position.y!==Je.y,we.position=Je,we.internals.positionAbsolute=Be}if(P=P||ke,!!ke&&(B(m,!0),$&&(a||F||!V&&X))){const[Ae,we]=of({nodeId:V,dragItems:m,nodeLookup:z});a==null||a($,m,Ae,we),F==null||F($,Ae,we),V||X==null||X($,we)}}async function he(){if(!b)return;const{transform:le,panBy:xe,autoPanSpeed:z,autoPanOnNodeDrag:ue}=r();if(!ue){v=!1,cancelAnimationFrame(d);return}const[te,ae]=Zm(w,b,z);(te!==0||ae!==0)&&(f.x=(f.x??0)-te/le[2],f.y=(f.y??0)-ae/le[2],await xe({x:te,y:ae})&&pe(f)),d=requestAnimationFrame(he)}function _e(le){var Se;const{nodeLookup:xe,multiSelectionActive:z,nodesDraggable:ue,transform:te,snapGrid:ae,snapToGrid:L,selectNodesOnDrag:F,onNodeDragStart:X,onSelectionDragStart:O,unselectNodesAndEdges:B}=r();x=!0,(!F||!W)&&!z&&V&&((Se=xe.get(V))!=null&&Se.selected||B()),W&&F&&V&&(t==null||t(V));const ke=ba(le.sourceEvent,{transform:te,snapGrid:ae,snapToGrid:L,containerBounds:b});if(f=ke,m=B1(xe,ue,ke,V),m.size>0&&(i||X||!V&&O)){const[Ie,Re]=of({nodeId:V,dragItems:m,nodeLookup:xe});i==null||i(le.sourceEvent,m,Ie,Re),X==null||X(le.sourceEvent,Ie,Re),V||O==null||O(le.sourceEvent,Re)}}const Q=jm().clickDistance(q).on("start",le=>{const{domNode:xe,nodeDragThreshold:z,transform:ue,snapGrid:te,snapToGrid:ae}=r();b=(xe==null?void 0:xe.getBoundingClientRect())||null,N=!1,P=!1,$=le.sourceEvent,z===0&&_e(le),f=ba(le.sourceEvent,{transform:ue,snapGrid:te,snapToGrid:ae,containerBounds:b}),w=Ar(le.sourceEvent,b)}).on("drag",le=>{const{autoPanOnNodeDrag:xe,transform:z,snapGrid:ue,snapToGrid:te,nodeDragThreshold:ae,nodeLookup:L}=r(),F=ba(le.sourceEvent,{transform:z,snapGrid:ue,snapToGrid:te,containerBounds:b});if($=le.sourceEvent,(le.sourceEvent.type==="touchmove"&&le.sourceEvent.touches.length>1||V&&!L.has(V))&&(N=!0),!N){if(!v&&xe&&x&&(v=!0,he()),!x){const X=Ar(le.sourceEvent,b),O=X.x-w.x,B=X.y-w.y;Math.sqrt(O*O+B*B)>ae&&_e(le)}(f.x!==F.xSnapped||f.y!==F.ySnapped)&&m&&x&&(w=Ar(le.sourceEvent,b),pe(F))}}).on("end",le=>{if(!(!x||N)&&(v=!1,x=!1,cancelAnimationFrame(d),m.size>0)){const{nodeLookup:xe,updateNodePositions:z,onNodeDragStop:ue,onSelectionDragStop:te}=r();if(P&&(z(m,!1),P=!1),u||ue||!V&&te){const[ae,L]=of({nodeId:V,dragItems:m,nodeLookup:xe,dragging:!1});u==null||u(le.sourceEvent,m,ae,L),ue==null||ue(le.sourceEvent,ae,L),V||te==null||te(le.sourceEvent,L)}}}).filter(le=>{const xe=le.target;return!le.button&&(!H||!Ph(xe,`.${H}`,R))&&(!j||Ph(xe,j,R))});S.call(Q)}function I(){S==null||S.on(".drag",null)}return{update:M,destroy:I}}function K1(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())Ta(u,As(f))>0&&a.push(f);return a}const U1=250;function q1(t,r,i,a){var m,v;let u=[],f=1/0;const d=K1(t,i,r+U1);for(const w of d){const b=[...((m=w.internals.handleBounds)==null?void 0:m.source)??[],...((v=w.internals.handleBounds)==null?void 0:v.target)??[]];for(const x of b){if(a.nodeId===x.nodeId&&a.type===x.type&&a.id===x.id)continue;const{x:S,y:N}=Fi(w,x,x.position,!0),P=Math.sqrt(Math.pow(S-t.x,2)+Math.pow(N-t.y,2));P>r||(P<f?(u=[{...x,x:S,y:N}],f=P):P===f&&u.push({...x,x:S,y:N}))}}if(!u.length)return null;if(u.length>1){const w=a.type==="source"?"target":"source";return u.find(b=>b.type===w)??u[0]}return u[0]}function hg(t,r,i,a,u,f=!1){var w,b,x;const d=a.get(t);if(!d)return null;const m=u==="strict"?(w=d.internals.handleBounds)==null?void 0:w[r]:[...((b=d.internals.handleBounds)==null?void 0:b.source)??[],...((x=d.internals.handleBounds)==null?void 0:x.target)??[]],v=(i?m==null?void 0:m.find(S=>S.id===i):m==null?void 0:m[0])??null;return v&&f?{...v,...Fi(d,v,v.position,!0)}:v}function mg(t,r){return t||(r!=null&&r.classList.contains("target")?"target":r!=null&&r.classList.contains("source")?"source":null)}function W1(t,r){let i=null;return r?i=!0:t&&!r&&(i=!1),i}const gg=()=>!0;function Y1(t,{connectionMode:r,connectionRadius:i,handleId:a,nodeId:u,edgeUpdaterType:f,isTarget:d,domNode:m,nodeLookup:v,lib:w,autoPanOnConnect:b,flowId:x,panBy:S,cancelConnection:N,onConnectStart:P,onConnect:$,onConnectEnd:M,isValidConnection:I=gg,onReconnectEnd:H,updateConnection:j,getTransform:R,getFromHandle:W,autoPanSpeed:V,dragThreshold:q=1,handleDomNode:pe}){const he=ng(t.target);let _e=0,Q;const{x:le,y:xe}=Ar(t),z=mg(f,pe),ue=m==null?void 0:m.getBoundingClientRect();let te=!1;if(!ue||!z)return;const ae=hg(u,z,a,v,r);if(!ae)return;let L=Ar(t,ue),F=!1,X=null,O=!1,B=null;function ke(){if(!b||!ue)return;const[Je,Be]=Zm(L,ue,V);S({x:Je,y:Be}),_e=requestAnimationFrame(ke)}const Se={...ae,nodeId:u,type:z,position:ae.position},Ie=v.get(u);let Ae={inProgress:!0,isValid:null,from:Fi(Ie,Se,Ze.Left,!0),fromHandle:Se,fromPosition:Se.position,fromNode:Ie,to:L,toHandle:null,toPosition:gh[Se.position],toNode:null,pointer:L};function we(){te=!0,j(Ae),P==null||P(t,{nodeId:u,handleId:a,handleType:z})}q===0&&we();function Fe(Je){if(!te){const{x:ht,y:xn}=Ar(Je),Lt=ht-le,Ft=xn-xe;if(!(Lt*Lt+Ft*Ft>q*q))return;we()}if(!W()||!Se){be(Je);return}const Be=R();L=Ar(Je,ue),Q=q1(La(L,Be,!1,[1,1]),i,v,Se),F||(ke(),F=!0);const Ye=yg(Je,{handle:Q,connectionMode:r,fromNodeId:u,fromHandleId:a,fromType:d?"target":"source",isValidConnection:I,doc:he,lib:w,flowId:x,nodeLookup:v});B=Ye.handleDomNode,X=Ye.connection,O=W1(!!Q,Ye.isValid);const ut=v.get(u),st=ut?Fi(ut,Se,Ze.Left,!0):Ae.from,ct={...Ae,from:st,isValid:O,to:Ye.toHandle&&O?gu({x:Ye.toHandle.x,y:Ye.toHandle.y},Be):L,toHandle:Ye.toHandle,toPosition:O&&Ye.toHandle?Ye.toHandle.position:gh[Se.position],toNode:Ye.toHandle?v.get(Ye.toHandle.nodeId):null,pointer:L};j(ct),Ae=ct}function be(Je){if(!("touches"in Je&&Je.touches.length>0)){if(te){(Q||B)&&X&&O&&($==null||$(X));const{inProgress:Be,...Ye}=Ae,ut={...Ye,toPosition:Ae.toHandle?Ae.toPosition:null};M==null||M(Je,ut),f&&(H==null||H(Je,ut))}N(),cancelAnimationFrame(_e),F=!1,O=!1,X=null,B=null,he.removeEventListener("mousemove",Fe),he.removeEventListener("mouseup",be),he.removeEventListener("touchmove",Fe),he.removeEventListener("touchend",be)}}he.addEventListener("mousemove",Fe),he.addEventListener("mouseup",be),he.addEventListener("touchmove",Fe),he.addEventListener("touchend",be)}function yg(t,{handle:r,connectionMode:i,fromNodeId:a,fromHandleId:u,fromType:f,doc:d,lib:m,flowId:v,isValidConnection:w=gg,nodeLookup:b}){const x=f==="target",S=r?d.querySelector(`.${m}-flow__handle[data-id="${v}-${r==null?void 0:r.nodeId}-${r==null?void 0:r.id}-${r==null?void 0:r.type}"]`):null,{x:N,y:P}=Ar(t),$=d.elementFromPoint(N,P),M=$!=null&&$.classList.contains(`${m}-flow__handle`)?$:S,I={handleDomNode:M,isValid:!1,connection:null,toHandle:null};if(M){const H=mg(void 0,M),j=M.getAttribute("data-nodeid"),R=M.getAttribute("data-handleid"),W=M.classList.contains("connectable"),V=M.classList.contains("connectableend");if(!j||!H)return I;const q={source:x?j:a,sourceHandle:x?R:u,target:x?a:j,targetHandle:x?u:R};I.connection=q;const he=W&&V&&(i===Ms.Strict?x&&H==="source"||!x&&H==="target":j!==a||R!==u);I.isValid=he&&w(q),I.toHandle=hg(j,H,R,b,i,!0)}return I}const Mf={onPointerDown:Y1,isValid:yg};function X1({domNode:t,panZoom:r,getTransform:i,getViewScale:a}){const u=Jn(t);function f({translateExtent:m,width:v,height:w,zoomStep:b=1,pannable:x=!0,zoomable:S=!0,inversePan:N=!1}){const P=j=>{if(j.sourceEvent.type!=="wheel"||!r)return;const R=i(),W=j.sourceEvent.ctrlKey&&Ma()?10:1,V=-j.sourceEvent.deltaY*(j.sourceEvent.deltaMode===1?.05:j.sourceEvent.deltaMode?1:.002)*b,q=R[2]*Math.pow(2,V*W);r.scaleTo(q)};let $=[0,0];const M=j=>{(j.sourceEvent.type==="mousedown"||j.sourceEvent.type==="touchstart")&&($=[j.sourceEvent.clientX??j.sourceEvent.touches[0].clientX,j.sourceEvent.clientY??j.sourceEvent.touches[0].clientY])},I=j=>{const R=i();if(j.sourceEvent.type!=="mousemove"&&j.sourceEvent.type!=="touchmove"||!r)return;const W=[j.sourceEvent.clientX??j.sourceEvent.touches[0].clientX,j.sourceEvent.clientY??j.sourceEvent.touches[0].clientY],V=[W[0]-$[0],W[1]-$[1]];$=W;const q=a()*Math.max(R[2],Math.log(R[2]))*(N?-1:1),pe={x:R[0]-V[0]*q,y:R[1]-V[1]*q},he=[[0,0],[v,w]];r.setViewportConstrained({x:pe.x,y:pe.y,zoom:R[2]},he,m)},H=Km().on("start",M).on("zoom",x?I:null).on("zoom.wheel",S?P:null);u.call(H,{})}function d(){u.on("zoom",null)}return{update:f,destroy:d,pointer:Tr}}const ju=t=>({x:t.x,y:t.y,zoom:t.k}),sf=({x:t,y:r,zoom:i})=>Nu.translate(t,r).scale(i),Es=(t,r)=>t.target.closest(`.${r}`),vg=(t,r)=>r===2&&Array.isArray(t)&&t.includes(2),Q1=t=>((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2,af=(t,r=0,i=Q1,a=()=>{})=>{const u=typeof r=="number"&&r>0;return u||a(),u?t.transition().duration(r).ease(i).on("end",a):t},xg=t=>{const r=t.ctrlKey&&Ma()?10:1;return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*r};function G1({zoomPanValues:t,noWheelClassName:r,d3Selection:i,d3Zoom:a,panOnScrollMode:u,panOnScrollSpeed:f,zoomOnPinch:d,onPanZoomStart:m,onPanZoom:v,onPanZoomEnd:w}){return b=>{if(Es(b,r))return b.ctrlKey&&b.preventDefault(),!1;b.preventDefault(),b.stopImmediatePropagation();const x=i.property("__zoom").k||1;if(b.ctrlKey&&d){const M=Tr(b),I=xg(b),H=x*Math.pow(2,I);a.scaleTo(i,H,M,b);return}const S=b.deltaMode===1?20:1;let N=u===Ri.Vertical?0:b.deltaX*S,P=u===Ri.Horizontal?0:b.deltaY*S;!Ma()&&b.shiftKey&&u!==Ri.Vertical&&(N=b.deltaY*S,P=0),a.translateBy(i,-(N/x)*f,-(P/x)*f,{internal:!0});const $=ju(i.property("__zoom"));clearTimeout(t.panScrollTimeout),t.isPanScrolling?(v==null||v(b,$),t.panScrollTimeout=setTimeout(()=>{w==null||w(b,$),t.isPanScrolling=!1},150)):(t.isPanScrolling=!0,m==null||m(b,$))}}function Z1({noWheelClassName:t,preventScrolling:r,d3ZoomHandler:i}){return function(a,u){const f=a.type==="wheel",d=!r&&f&&!a.ctrlKey,m=Es(a,t);if(a.ctrlKey&&f&&m&&a.preventDefault(),d||m)return null;a.preventDefault(),i.call(this,a,u)}}function J1({zoomPanValues:t,onDraggingChange:r,onPanZoomStart:i}){return a=>{var f,d,m;if((f=a.sourceEvent)!=null&&f.internal)return;const u=ju(a.transform);t.mouseButton=((d=a.sourceEvent)==null?void 0:d.button)||0,t.isZoomingOrPanning=!0,t.prevViewport=u,((m=a.sourceEvent)==null?void 0:m.type)==="mousedown"&&r(!0),i&&(i==null||i(a.sourceEvent,u))}}function e_({zoomPanValues:t,panOnDrag:r,onPaneContextMenu:i,onTransformChange:a,onPanZoom:u}){return f=>{var d,m;t.usedRightMouseButton=!!(i&&vg(r,t.mouseButton??0)),(d=f.sourceEvent)!=null&&d.sync||a([f.transform.x,f.transform.y,f.transform.k]),u&&!((m=f.sourceEvent)!=null&&m.internal)&&(u==null||u(f.sourceEvent,ju(f.transform)))}}function t_({zoomPanValues:t,panOnDrag:r,panOnScroll:i,onDraggingChange:a,onPanZoomEnd:u,onPaneContextMenu:f}){return d=>{var m;if(!((m=d.sourceEvent)!=null&&m.internal)&&(t.isZoomingOrPanning=!1,f&&vg(r,t.mouseButton??0)&&!t.usedRightMouseButton&&d.sourceEvent&&f(d.sourceEvent),t.usedRightMouseButton=!1,a(!1),u)){const v=ju(d.transform);t.prevViewport=v,clearTimeout(t.timerId),t.timerId=setTimeout(()=>{u==null||u(d.sourceEvent,v)},i?150:0)}}}function n_({zoomActivationKeyPressed:t,zoomOnScroll:r,zoomOnPinch:i,panOnDrag:a,panOnScroll:u,zoomOnDoubleClick:f,userSelectionActive:d,noWheelClassName:m,noPanClassName:v,lib:w,connectionInProgress:b}){return x=>{var M;const S=t||r,N=i&&x.ctrlKey,P=x.type==="wheel";if(x.button===1&&x.type==="mousedown"&&(Es(x,`${w}-flow__node`)||Es(x,`${w}-flow__edge`)))return!0;if(!a&&!S&&!u&&!f&&!i||d||b&&!P||Es(x,m)&&P||Es(x,v)&&(!P||u&&P&&!t)||!i&&x.ctrlKey&&P)return!1;if(!i&&x.type==="touchstart"&&((M=x.touches)==null?void 0:M.length)>1)return x.preventDefault(),!1;if(!S&&!u&&!N&&P||!a&&(x.type==="mousedown"||x.type==="touchstart")||Array.isArray(a)&&!a.includes(x.button)&&x.type==="mousedown")return!1;const $=Array.isArray(a)&&a.includes(x.button)||!x.button||x.button<=1;return(!x.ctrlKey||P)&&$}}function r_({domNode:t,minZoom:r,maxZoom:i,translateExtent:a,viewport:u,onPanZoom:f,onPanZoomStart:d,onPanZoomEnd:m,onDraggingChange:v}){const w={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},b=t.getBoundingClientRect(),x=Km().scaleExtent([r,i]).translateExtent(a),S=Jn(t).call(x);H({x:u.x,y:u.y,zoom:Is(u.zoom,r,i)},[[0,0],[b.width,b.height]],a);const N=S.on("wheel.zoom"),P=S.on("dblclick.zoom");x.wheelDelta(xg);function $(Q,le){return S?new Promise(xe=>{x==null||x.interpolate((le==null?void 0:le.interpolate)==="linear"?Sa:tu).transform(af(S,le==null?void 0:le.duration,le==null?void 0:le.ease,()=>xe(!0)),Q)}):Promise.resolve(!1)}function M({noWheelClassName:Q,noPanClassName:le,onPaneContextMenu:xe,userSelectionActive:z,panOnScroll:ue,panOnDrag:te,panOnScrollMode:ae,panOnScrollSpeed:L,preventScrolling:F,zoomOnPinch:X,zoomOnScroll:O,zoomOnDoubleClick:B,zoomActivationKeyPressed:ke,lib:Se,onTransformChange:Ie,connectionInProgress:Re,paneClickDistance:Ae,selectionOnDrag:we}){z&&!w.isZoomingOrPanning&&I();const Fe=ue&&!ke&&!z;x.clickDistance(we?1/0:!Ir(Ae)||Ae<0?0:Ae);const be=Fe?G1({zoomPanValues:w,noWheelClassName:Q,d3Selection:S,d3Zoom:x,panOnScrollMode:ae,panOnScrollSpeed:L,zoomOnPinch:X,onPanZoomStart:d,onPanZoom:f,onPanZoomEnd:m}):Z1({noWheelClassName:Q,preventScrolling:F,d3ZoomHandler:N});if(S.on("wheel.zoom",be,{passive:!1}),!z){const Be=J1({zoomPanValues:w,onDraggingChange:v,onPanZoomStart:d});x.on("start",Be);const Ye=e_({zoomPanValues:w,panOnDrag:te,onPaneContextMenu:!!xe,onPanZoom:f,onTransformChange:Ie});x.on("zoom",Ye);const ut=t_({zoomPanValues:w,panOnDrag:te,panOnScroll:ue,onPaneContextMenu:xe,onPanZoomEnd:m,onDraggingChange:v});x.on("end",ut)}const Je=n_({zoomActivationKeyPressed:ke,panOnDrag:te,zoomOnScroll:O,panOnScroll:ue,zoomOnDoubleClick:B,zoomOnPinch:X,userSelectionActive:z,noPanClassName:le,noWheelClassName:Q,lib:Se,connectionInProgress:Re});x.filter(Je),B?S.on("dblclick.zoom",P):S.on("dblclick.zoom",null)}function I(){x.on("zoom",null)}async function H(Q,le,xe){const z=sf(Q),ue=x==null?void 0:x.constrain()(z,le,xe);return ue&&await $(ue),new Promise(te=>te(ue))}async function j(Q,le){const xe=sf(Q);return await $(xe,le),new Promise(z=>z(xe))}function R(Q){if(S){const le=sf(Q),xe=S.property("__zoom");(xe.k!==Q.zoom||xe.x!==Q.x||xe.y!==Q.y)&&(x==null||x.transform(S,le,null,{sync:!0}))}}function W(){const Q=S?Vm(S.node()):{x:0,y:0,k:1};return{x:Q.x,y:Q.y,zoom:Q.k}}function V(Q,le){return S?new Promise(xe=>{x==null||x.interpolate((le==null?void 0:le.interpolate)==="linear"?Sa:tu).scaleTo(af(S,le==null?void 0:le.duration,le==null?void 0:le.ease,()=>xe(!0)),Q)}):Promise.resolve(!1)}function q(Q,le){return S?new Promise(xe=>{x==null||x.interpolate((le==null?void 0:le.interpolate)==="linear"?Sa:tu).scaleBy(af(S,le==null?void 0:le.duration,le==null?void 0:le.ease,()=>xe(!0)),Q)}):Promise.resolve(!1)}function pe(Q){x==null||x.scaleExtent(Q)}function he(Q){x==null||x.translateExtent(Q)}function _e(Q){const le=!Ir(Q)||Q<0?0:Q;x==null||x.clickDistance(le)}return{update:M,destroy:I,setViewport:j,setViewportConstrained:H,getViewport:W,scaleTo:V,scaleBy:q,setScaleExtent:pe,setTranslateExtent:he,syncViewport:R,setClickDistance:_e}}var Os;(function(t){t.Line="line",t.Handle="handle"})(Os||(Os={}));function o_({width:t,prevWidth:r,height:i,prevHeight:a,affectsX:u,affectsY:f}){const d=t-r,m=i-a,v=[d>0?1:d<0?-1:0,m>0?1:m<0?-1:0];return d&&u&&(v[0]=v[0]*-1),m&&f&&(v[1]=v[1]*-1),v}function jh(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 si(t,r){return Math.max(0,r-t)}function ai(t,r){return Math.max(0,t-r)}function Ql(t,r,i){return Math.max(0,r-t,t-i)}function Th(t,r){return t?!r:r}function i_(t,r,i,a,u,f,d,m){let{affectsX:v,affectsY:w}=r;const{isHorizontal:b,isVertical:x}=r,S=b&&x,{xSnapped:N,ySnapped:P}=i,{minWidth:$,maxWidth:M,minHeight:I,maxHeight:H}=a,{x:j,y:R,width:W,height:V,aspectRatio:q}=t;let pe=Math.floor(b?N-t.pointerX:0),he=Math.floor(x?P-t.pointerY:0);const _e=W+(v?-pe:pe),Q=V+(w?-he:he),le=-f[0]*W,xe=-f[1]*V;let z=Ql(_e,$,M),ue=Ql(Q,I,H);if(d){let L=0,F=0;v&&pe<0?L=si(j+pe+le,d[0][0]):!v&&pe>0&&(L=ai(j+_e+le,d[1][0])),w&&he<0?F=si(R+he+xe,d[0][1]):!w&&he>0&&(F=ai(R+Q+xe,d[1][1])),z=Math.max(z,L),ue=Math.max(ue,F)}if(m){let L=0,F=0;v&&pe>0?L=ai(j+pe,m[0][0]):!v&&pe<0&&(L=si(j+_e,m[1][0])),w&&he>0?F=ai(R+he,m[0][1]):!w&&he<0&&(F=si(R+Q,m[1][1])),z=Math.max(z,L),ue=Math.max(ue,F)}if(u){if(b){const L=Ql(_e/q,I,H)*q;if(z=Math.max(z,L),d){let F=0;!v&&!w||v&&!w&&S?F=ai(R+xe+_e/q,d[1][1])*q:F=si(R+xe+(v?pe:-pe)/q,d[0][1])*q,z=Math.max(z,F)}if(m){let F=0;!v&&!w||v&&!w&&S?F=si(R+_e/q,m[1][1])*q:F=ai(R+(v?pe:-pe)/q,m[0][1])*q,z=Math.max(z,F)}}if(x){const L=Ql(Q*q,$,M)/q;if(ue=Math.max(ue,L),d){let F=0;!v&&!w||w&&!v&&S?F=ai(j+Q*q+le,d[1][0])/q:F=si(j+(w?he:-he)*q+le,d[0][0])/q,ue=Math.max(ue,F)}if(m){let F=0;!v&&!w||w&&!v&&S?F=si(j+Q*q,m[1][0])/q:F=ai(j+(w?he:-he)*q,m[0][0])/q,ue=Math.max(ue,F)}}}he=he+(he<0?ue:-ue),pe=pe+(pe<0?z:-z),u&&(S?_e>Q*q?he=(Th(v,w)?-pe:pe)/q:pe=(Th(v,w)?-he:he)*q:b?(he=pe/q,w=v):(pe=he*q,v=w));const te=v?j+pe:j,ae=w?R+he:R;return{width:W+(v?-pe:pe),height:V+(w?-he:he),x:f[0]*pe*(v?-1:1)+te,y:f[1]*he*(w?-1:1)+ae}}const wg={width:0,height:0,x:0,y:0},s_={...wg,pointerX:0,pointerY:0,aspectRatio:1};function a_(t){return[[0,0],[t.measured.width,t.measured.height]]}function l_(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,m=i[0]*f,v=i[1]*d;return[[a-m,u-v],[a+f-m,u+d-v]]}function u_({domNode:t,nodeId:r,getStoreItems:i,onChange:a,onEnd:u}){const f=Jn(t);let d={controlDirection:jh("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function m({controlPosition:w,boundaries:b,keepAspectRatio:x,resizeDirection:S,onResizeStart:N,onResize:P,onResizeEnd:$,shouldResize:M}){let I={...wg},H={...s_};d={boundaries:b,resizeDirection:S,keepAspectRatio:x,controlDirection:jh(w)};let j,R=null,W=[],V,q,pe,he=!1;const _e=jm().on("start",Q=>{const{nodeLookup:le,transform:xe,snapGrid:z,snapToGrid:ue,nodeOrigin:te,paneDomNode:ae}=i();if(j=le.get(r),!j)return;R=(ae==null?void 0:ae.getBoundingClientRect())??null;const{xSnapped:L,ySnapped:F}=ba(Q.sourceEvent,{transform:xe,snapGrid:z,snapToGrid:ue,containerBounds:R});I={width:j.measured.width??0,height:j.measured.height??0,x:j.position.x??0,y:j.position.y??0},H={...I,pointerX:L,pointerY:F,aspectRatio:I.width/I.height},V=void 0,j.parentId&&(j.extent==="parent"||j.expandParent)&&(V=le.get(j.parentId),q=V&&j.extent==="parent"?a_(V):void 0),W=[],pe=void 0;for(const[X,O]of le)if(O.parentId===r&&(W.push({id:X,position:{...O.position},extent:O.extent}),O.extent==="parent"||O.expandParent)){const B=l_(O,j,O.origin??te);pe?pe=[[Math.min(B[0][0],pe[0][0]),Math.min(B[0][1],pe[0][1])],[Math.max(B[1][0],pe[1][0]),Math.max(B[1][1],pe[1][1])]]:pe=B}N==null||N(Q,{...I})}).on("drag",Q=>{const{transform:le,snapGrid:xe,snapToGrid:z,nodeOrigin:ue}=i(),te=ba(Q.sourceEvent,{transform:le,snapGrid:xe,snapToGrid:z,containerBounds:R}),ae=[];if(!j)return;const{x:L,y:F,width:X,height:O}=I,B={},ke=j.origin??ue,{width:Se,height:Ie,x:Re,y:Ae}=i_(H,d.controlDirection,te,d.boundaries,d.keepAspectRatio,ke,q,pe),we=Se!==X,Fe=Ie!==O,be=Re!==L&&we,Je=Ae!==F&&Fe;if(!be&&!Je&&!we&&!Fe)return;if((be||Je||ke[0]===1||ke[1]===1)&&(B.x=be?Re:I.x,B.y=Je?Ae:I.y,I.x=B.x,I.y=B.y,W.length>0)){const st=Re-L,ct=Ae-F;for(const ht of W)ht.position={x:ht.position.x-st+ke[0]*(Se-X),y:ht.position.y-ct+ke[1]*(Ie-O)},ae.push(ht)}if((we||Fe)&&(B.width=we&&(!d.resizeDirection||d.resizeDirection==="horizontal")?Se:I.width,B.height=Fe&&(!d.resizeDirection||d.resizeDirection==="vertical")?Ie:I.height,I.width=B.width,I.height=B.height),V&&j.expandParent){const st=ke[0]*(B.width??0);B.x&&B.x<st&&(I.x=st,H.x=H.x-(B.x-st));const ct=ke[1]*(B.height??0);B.y&&B.y<ct&&(I.y=ct,H.y=H.y-(B.y-ct))}const Be=o_({width:I.width,prevWidth:X,height:I.height,prevHeight:O,affectsX:d.controlDirection.affectsX,affectsY:d.controlDirection.affectsY}),Ye={...I,direction:Be};(M==null?void 0:M(Q,Ye))!==!1&&(he=!0,P==null||P(Q,Ye),a(B,ae))}).on("end",Q=>{he&&($==null||$(Q,{...I}),u==null||u({...I}),he=!1)});f.call(_e)}function v(){f.on(".drag",null)}return{update:m,destroy:v}}var lf={exports:{}},uf={},cf={exports:{}},ff={};/**
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 c_(){if(Mh)return ff;Mh=1;var t=Aa();function r(x,S){return x===S&&(x!==0||1/x===1/S)||x!==x&&S!==S}var i=typeof Object.is=="function"?Object.is:r,a=t.useState,u=t.useEffect,f=t.useLayoutEffect,d=t.useDebugValue;function m(x,S){var N=S(),P=a({inst:{value:N,getSnapshot:S}}),$=P[0].inst,M=P[1];return f(function(){$.value=N,$.getSnapshot=S,v($)&&M({inst:$})},[x,N,S]),u(function(){return v($)&&M({inst:$}),x(function(){v($)&&M({inst:$})})},[x]),d(N),N}function v(x){var S=x.getSnapshot;x=x.value;try{var N=S();return!i(x,N)}catch{return!0}}function w(x,S){return S()}var b=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?w:m;return ff.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:b,ff}var Ih;function f_(){return Ih||(Ih=1,cf.exports=c_()),cf.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 Ah;function d_(){if(Ah)return uf;Ah=1;var t=Aa(),r=f_();function i(w,b){return w===b&&(w!==0||1/w===1/b)||w!==w&&b!==b}var a=typeof Object.is=="function"?Object.is:i,u=r.useSyncExternalStore,f=t.useRef,d=t.useEffect,m=t.useMemo,v=t.useDebugValue;return uf.useSyncExternalStoreWithSelector=function(w,b,x,S,N){var P=f(null);if(P.current===null){var $={hasValue:!1,value:null};P.current=$}else $=P.current;P=m(function(){function I(V){if(!H){if(H=!0,j=V,V=S(V),N!==void 0&&$.hasValue){var q=$.value;if(N(q,V))return R=q}return R=V}if(q=R,a(j,V))return q;var pe=S(V);return N!==void 0&&N(q,pe)?(j=V,q):(j=V,R=pe)}var H=!1,j,R,W=x===void 0?null:x;return[function(){return I(b())},W===null?void 0:function(){return I(W())}]},[b,x,S,N]);var M=u(w,P[0],P[1]);return d(function(){$.hasValue=!0,$.value=M},[M]),v(M),M},uf}var $h;function p_(){return $h||($h=1,lf.exports=d_()),lf.exports}var h_=p_();const m_=vu(h_),g_={},Oh=t=>{let r;const i=new Set,a=(b,x)=>{const S=typeof b=="function"?b(r):b;if(!Object.is(S,r)){const N=r;r=x??(typeof S!="object"||S===null)?S:Object.assign({},r,S),i.forEach(P=>P(r,N))}},u=()=>r,v={setState:a,getState:u,getInitialState:()=>w,subscribe:b=>(i.add(b),()=>i.delete(b)),destroy:()=>{(g_?"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},y_=t=>t?Oh(t):Oh,{useDebugValue:v_}=lm,{useSyncExternalStoreWithSelector:x_}=m_,w_=t=>t;function _g(t,r=w_,i){const a=x_(t.subscribe,t.getState,t.getServerState||t.getInitialState,r,i);return v_(a),a}const Rh=(t,r)=>{const i=y_(t),a=(u,f=r)=>_g(i,u,f);return Object.assign(a,i),a},__=(t,r)=>t?Rh(t,r):Rh;function At(t,r){if(Object.is(t,r))return!0;if(typeof t!="object"||t===null||typeof r!="object"||r===null)return!1;if(t instanceof Map&&r instanceof Map){if(t.size!==r.size)return!1;for(const[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}um();const Tu=ce.createContext(null),S_=Tu.Provider,Sg=Qr.error001();function gt(t,r){const i=ce.useContext(Tu);if(i===null)throw new Error(Sg);return _g(i,t,r)}function Tt(){const t=ce.useContext(Tu);if(t===null)throw new Error(Sg);return ce.useMemo(()=>({getState:t.getState,setState:t.setState,subscribe:t.subscribe}),[t])}const Dh={display:"none"},b_={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},bg="react-flow__node-desc",kg="react-flow__edge-desc",k_="react-flow__aria-live",E_=t=>t.ariaLiveMessage,N_=t=>t.ariaLabelConfig;function C_({rfId:t}){const r=gt(E_);return C.jsx("div",{id:`${k_}-${t}`,"aria-live":"assertive","aria-atomic":"true",style:b_,children:r})}function P_({rfId:t,disableKeyboardA11y:r}){const i=gt(N_);return C.jsxs(C.Fragment,{children:[C.jsx("div",{id:`${bg}-${t}`,style:Dh,children:r?i["node.a11yDescription.default"]:i["node.a11yDescription.keyboardDisabled"]}),C.jsx("div",{id:`${kg}-${t}`,style:Dh,children:i["edge.a11yDescription.default"]}),!r&&C.jsx(C_,{rfId:t})]})}const Fa=ce.forwardRef(({position:t="top-left",children:r,className:i,style:a,...u},f)=>{const d=`${t}`.split("-");return C.jsx("div",{className:qt(["react-flow__panel",i,...d]),style:a,ref:f,...u,children:r})});Fa.displayName="Panel";function j_({proOptions:t,position:r="bottom-right"}){return t!=null&&t.hideAttribution?null:C.jsx(Fa,{position:r,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:C.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const T_=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}},Gl=t=>t.id;function M_(t,r){return At(t.selectedNodes.map(Gl),r.selectedNodes.map(Gl))&&At(t.selectedEdges.map(Gl),r.selectedEdges.map(Gl))}function I_({onSelectionChange:t}){const r=Tt(),{selectedNodes:i,selectedEdges:a}=gt(T_,M_);return ce.useEffect(()=>{const u={nodes:i,edges:a};t==null||t(u),r.getState().onSelectionChangeHandlers.forEach(f=>f(u))},[i,a,t]),null}const A_=t=>!!t.onSelectionChangeHandlers;function $_({onSelectionChange:t}){const r=gt(A_);return t||r?C.jsx(I_,{onSelectionChange:t}):null}const If=typeof window<"u"?ce.useLayoutEffect:ce.useEffect,Eg=[0,0],O_={x:0,y:0,zoom:1},R_=["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=[...R_,"rfId"],D_=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}),Lh={translateExtent:Pa,nodeOrigin:Eg,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function z_(t){const{setNodes:r,setEdges:i,setMinZoom:a,setMaxZoom:u,setTranslateExtent:f,setNodeExtent:d,reset:m,setDefaultNodesAndEdges:v}=gt(D_,At),w=Tt();If(()=>(v(t.defaultNodes,t.defaultEdges),()=>{b.current=Lh,m()}),[]);const b=ce.useRef(Lh);return If(()=>{for(const x of zh){const S=t[x],N=b.current[x];S!==N&&(typeof t[x]>"u"||(x==="nodes"?r(S):x==="edges"?i(S):x==="minZoom"?a(S):x==="maxZoom"?u(S):x==="translateExtent"?f(S):x==="nodeExtent"?d(S):x==="ariaLabelConfig"?w.setState({ariaLabelConfig:S1(S)}):x==="fitView"?w.setState({fitViewQueued:S}):x==="fitViewOptions"?w.setState({fitViewOptions:S}):w.setState({[x]:S})))}b.current=t},zh.map(x=>t[x])),null}function Fh(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function L_(t){var a;const[r,i]=ce.useState(t==="system"?null:t);return ce.useEffect(()=>{if(t!=="system"){i(t);return}const u=Fh(),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=Fh())!=null&&a.matches?"dark":"light"}const Bh=typeof document<"u"?document:null;function Ia(t=null,r={target:Bh,actInsideInputWithModifier:!0}){const[i,a]=ce.useState(!1),u=ce.useRef(!1),f=ce.useRef(new Set([])),[d,m]=ce.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
+ `)),b=w.reduce((x,S)=>x.concat(...S),[]);return[w,b]}return[[],[]]},[t]);return ce.useEffect(()=>{const v=(r==null?void 0:r.target)??Bh,w=(r==null?void 0:r.actInsideInputWithModifier)??!0;if(t!==null){const b=N=>{var M,I;if(u.current=N.ctrlKey||N.metaKey||N.shiftKey||N.altKey,(!u.current||u.current&&!w)&&rg(N))return!1;const $=Vh(N.code,m);if(f.current.add(N[$]),Hh(d,f.current,!1)){const H=((I=(M=N.composedPath)==null?void 0:M.call(N))==null?void 0:I[0])||N.target,j=(H==null?void 0:H.nodeName)==="BUTTON"||(H==null?void 0:H.nodeName)==="A";r.preventDefault!==!1&&(u.current||!j)&&N.preventDefault(),a(!0)}},x=N=>{const P=Vh(N.code,m);Hh(d,f.current,!0)?(a(!1),f.current.clear()):f.current.delete(N[P]),N.key==="Meta"&&f.current.clear(),u.current=!1},S=()=>{f.current.clear(),a(!1)};return v==null||v.addEventListener("keydown",b),v==null||v.addEventListener("keyup",x),window.addEventListener("blur",S),window.addEventListener("contextmenu",S),()=>{v==null||v.removeEventListener("keydown",b),v==null||v.removeEventListener("keyup",x),window.removeEventListener("blur",S),window.removeEventListener("contextmenu",S)}}},[t,a]),i}function Hh(t,r,i){return t.filter(a=>i||a.length===r.size).some(a=>a.every(u=>r.has(u)))}function Vh(t,r){return r.includes(t)?"code":"key"}const F_=()=>{const t=Tt();return ce.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:m}=t.getState(),v=Kf(r,a,u,f,d,(i==null?void 0:i.padding)??.1);return m?(await m.setViewport(v,{duration:i==null?void 0:i.duration,ease:i==null?void 0:i.ease,interpolate:i==null?void 0:i.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(r,i={})=>{const{transform:a,snapGrid:u,snapToGrid:f,domNode:d}=t.getState();if(!d)return r;const{x:m,y:v}=d.getBoundingClientRect(),w={x:r.x-m,y:r.y-v},b=i.snapGrid??u,x=i.snapToGrid??f;return La(w,a,x,b)},flowToScreenPosition:r=>{const{transform:i,domNode:a}=t.getState();if(!a)return r;const{x:u,y:f}=a.getBoundingClientRect(),d=gu(r,i);return{x:d.x+u,y:d.y+f}}}),[])};function Ng(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 m={...f};for(const v of d)B_(v,m);i.push(m)}return u.length&&u.forEach(f=>{f.index!==void 0?i.splice(f.index,0,{...f.item}):i.push({...f.item})}),i}function B_(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 Cg(t,r){return Ng(t,r)}function Pg(t,r){return Ng(t,r)}function Ai(t,r){return{id:t,type:"select",selected:r}}function Ns(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(Ai(f.id,d)))}return a}function Kh({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 m=r.get(d.id),v=((u=m==null?void 0:m.internals)==null?void 0:u.userNode)??m;v!==void 0&&v!==d&&i.push({id:d.id,item:d,type:"replace"}),v===void 0&&i.push({item:d,type:"add",index:f})}for(const[f]of r)a.get(f)===void 0&&i.push({id:f,type:"remove"});return i}function Uh(t){return{id:t.id,type:"remove"}}const qh=t=>d1(t),H_=t=>Xm(t);function jg(t){return ce.forwardRef(t)}function Wh(t){const[r,i]=ce.useState(BigInt(0)),[a]=ce.useState(()=>V_(()=>i(u=>u+BigInt(1))));return If(()=>{const u=a.get();u.length&&(t(u),a.reset())},[r]),a}function V_(t){let r=[];return{get:()=>r,reset:()=>{r=[]},push:i=>{r.push(i),t()}}}const Tg=ce.createContext(null);function K_({children:t}){const r=Tt(),i=ce.useCallback(m=>{const{nodes:v=[],setNodes:w,hasDefaultNodes:b,onNodesChange:x,nodeLookup:S,fitViewQueued:N,onNodesChangeMiddlewareMap:P}=r.getState();let $=v;for(const I of m)$=typeof I=="function"?I($):I;let M=Kh({items:$,lookup:S});for(const I of P.values())M=I(M);b&&w($),M.length>0?x==null||x(M):N&&window.requestAnimationFrame(()=>{const{fitViewQueued:I,nodes:H,setNodes:j}=r.getState();I&&j(H)})},[]),a=Wh(i),u=ce.useCallback(m=>{const{edges:v=[],setEdges:w,hasDefaultEdges:b,onEdgesChange:x,edgeLookup:S}=r.getState();let N=v;for(const P of m)N=typeof P=="function"?P(N):P;b?w(N):x&&x(Kh({items:N,lookup:S}))},[]),f=Wh(u),d=ce.useMemo(()=>({nodeQueue:a,edgeQueue:f}),[]);return C.jsx(Tg.Provider,{value:d,children:t})}function U_(){const t=ce.useContext(Tg);if(!t)throw new Error("useBatchContext must be used within a BatchProvider");return t}const q_=t=>!!t.panZoom;function Gf(){const t=F_(),r=Tt(),i=U_(),a=gt(q_),u=ce.useMemo(()=>{const f=x=>r.getState().nodeLookup.get(x),d=x=>{i.nodeQueue.push(x)},m=x=>{i.edgeQueue.push(x)},v=x=>{var I,H;const{nodeLookup:S,nodeOrigin:N}=r.getState(),P=qh(x)?x:S.get(x.id),$=P.parentId?tg(P.position,P.measured,P.parentId,S,N):P.position,M={...P,position:$,width:((I=P.measured)==null?void 0:I.width)??P.width,height:((H=P.measured)==null?void 0:H.height)??P.height};return As(M)},w=(x,S,N={replace:!1})=>{d(P=>P.map($=>{if($.id===x){const M=typeof S=="function"?S($):S;return N.replace&&qh(M)?M:{...$,...M}}return $}))},b=(x,S,N={replace:!1})=>{m(P=>P.map($=>{if($.id===x){const M=typeof S=="function"?S($):S;return N.replace&&H_(M)?M:{...$,...M}}return $}))};return{getNodes:()=>r.getState().nodes.map(x=>({...x})),getNode:x=>{var S;return(S=f(x))==null?void 0:S.internals.userNode},getInternalNode:f,getEdges:()=>{const{edges:x=[]}=r.getState();return x.map(S=>({...S}))},getEdge:x=>r.getState().edgeLookup.get(x),setNodes:d,setEdges:m,addNodes:x=>{const S=Array.isArray(x)?x:[x];i.nodeQueue.push(N=>[...N,...S])},addEdges:x=>{const S=Array.isArray(x)?x:[x];i.edgeQueue.push(N=>[...N,...S])},toObject:()=>{const{nodes:x=[],edges:S=[],transform:N}=r.getState(),[P,$,M]=N;return{nodes:x.map(I=>({...I})),edges:S.map(I=>({...I})),viewport:{x:P,y:$,zoom:M}}},deleteElements:async({nodes:x=[],edges:S=[]})=>{const{nodes:N,edges:P,onNodesDelete:$,onEdgesDelete:M,triggerNodeChanges:I,triggerEdgeChanges:H,onDelete:j,onBeforeDelete:R}=r.getState(),{nodes:W,edges:V}=await y1({nodesToRemove:x,edgesToRemove:S,nodes:N,edges:P,onBeforeDelete:R}),q=V.length>0,pe=W.length>0;if(q){const he=V.map(Uh);M==null||M(V),H(he)}if(pe){const he=W.map(Uh);$==null||$(W),I(he)}return(pe||q)&&(j==null||j({nodes:W,edges:V})),{deletedNodes:W,deletedEdges:V}},getIntersectingNodes:(x,S=!0,N)=>{const P=vh(x),$=P?x:v(x),M=N!==void 0;return $?(N||r.getState().nodes).filter(I=>{const H=r.getState().nodeLookup.get(I.id);if(H&&!P&&(I.id===x.id||!H.internals.positionAbsolute))return!1;const j=As(M?I:H),R=Ta(j,$);return S&&R>0||R>=j.width*j.height||R>=$.width*$.height}):[]},isNodeIntersecting:(x,S,N=!0)=>{const $=vh(x)?x:v(x);if(!$)return!1;const M=Ta($,S);return N&&M>0||M>=S.width*S.height||M>=$.width*$.height},updateNode:w,updateNodeData:(x,S,N={replace:!1})=>{w(x,P=>{const $=typeof S=="function"?S(P):S;return N.replace?{...P,data:$}:{...P,data:{...P.data,...$}}},N)},updateEdge:b,updateEdgeData:(x,S,N={replace:!1})=>{b(x,P=>{const $=typeof S=="function"?S(P):S;return N.replace?{...P,data:$}:{...P,data:{...P.data,...$}}},N)},getNodesBounds:x=>{const{nodeLookup:S,nodeOrigin:N}=r.getState();return p1(x,{nodeLookup:S,nodeOrigin:N})},getHandleConnections:({type:x,id:S,nodeId:N})=>{var P;return Array.from(((P=r.getState().connectionLookup.get(`${N}-${x}${S?`-${S}`:""}`))==null?void 0:P.values())??[])},getNodeConnections:({type:x,handleId:S,nodeId:N})=>{var P;return Array.from(((P=r.getState().connectionLookup.get(`${N}${x?S?`-${x}-${S}`:`-${x}`:""}`))==null?void 0:P.values())??[])},fitView:async x=>{const S=r.getState().fitViewResolver??_1();return r.setState({fitViewQueued:!0,fitViewOptions:x,fitViewResolver:S}),i.nodeQueue.push(N=>[...N]),S.promise}}},[]);return ce.useMemo(()=>({...u,...t,viewportInitialized:a}),[a])}const Yh=t=>t.selected,W_=typeof window<"u"?window:void 0;function Y_({deleteKeyCode:t,multiSelectionKeyCode:r}){const i=Tt(),{deleteElements:a}=Gf(),u=Ia(t,{actInsideInputWithModifier:!1}),f=Ia(r,{target:W_});ce.useEffect(()=>{if(u){const{edges:d,nodes:m}=i.getState();a({nodes:m.filter(Yh),edges:d.filter(Yh)}),i.setState({nodesSelectionActive:!1})}},[u]),ce.useEffect(()=>{i.setState({multiSelectionActive:f})},[f])}function X_(t){const r=Tt();ce.useEffect(()=>{const i=()=>{var u,f,d,m;if(!t.current||!(((f=(u=t.current).checkVisibility)==null?void 0:f.call(u))??!0))return!1;const a=Uf(t.current);(a.height===0||a.width===0)&&((m=(d=r.getState()).onError)==null||m.call(d,"004",Qr.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},Q_=t=>({userSelectionActive:t.userSelectionActive,lib:t.lib,connectionInProgress:t.connection.inProgress});function G_({onPaneContextMenu:t,zoomOnScroll:r=!0,zoomOnPinch:i=!0,panOnScroll:a=!1,panOnScrollSpeed:u=.5,panOnScrollMode:f=Ri.Free,zoomOnDoubleClick:d=!0,panOnDrag:m=!0,defaultViewport:v,translateExtent:w,minZoom:b,maxZoom:x,zoomActivationKeyCode:S,preventScrolling:N=!0,children:P,noWheelClassName:$,noPanClassName:M,onViewportChange:I,isControlledViewport:H,paneClickDistance:j,selectionOnDrag:R}){const W=Tt(),V=ce.useRef(null),{userSelectionActive:q,lib:pe,connectionInProgress:he}=gt(Q_,At),_e=Ia(S),Q=ce.useRef();X_(V);const le=ce.useCallback(xe=>{I==null||I({x:xe[0],y:xe[1],zoom:xe[2]}),H||W.setState({transform:xe})},[I,H]);return ce.useEffect(()=>{if(V.current){Q.current=r_({domNode:V.current,minZoom:b,maxZoom:x,translateExtent:w,viewport:v,onDraggingChange:te=>W.setState(ae=>ae.paneDragging===te?ae:{paneDragging:te}),onPanZoomStart:(te,ae)=>{const{onViewportChangeStart:L,onMoveStart:F}=W.getState();F==null||F(te,ae),L==null||L(ae)},onPanZoom:(te,ae)=>{const{onViewportChange:L,onMove:F}=W.getState();F==null||F(te,ae),L==null||L(ae)},onPanZoomEnd:(te,ae)=>{const{onViewportChangeEnd:L,onMoveEnd:F}=W.getState();F==null||F(te,ae),L==null||L(ae)}});const{x:xe,y:z,zoom:ue}=Q.current.getViewport();return W.setState({panZoom:Q.current,transform:[xe,z,ue],domNode:V.current.closest(".react-flow")}),()=>{var te;(te=Q.current)==null||te.destroy()}}},[]),ce.useEffect(()=>{var xe;(xe=Q.current)==null||xe.update({onPaneContextMenu:t,zoomOnScroll:r,zoomOnPinch:i,panOnScroll:a,panOnScrollSpeed:u,panOnScrollMode:f,zoomOnDoubleClick:d,panOnDrag:m,zoomActivationKeyPressed:_e,preventScrolling:N,noPanClassName:M,userSelectionActive:q,noWheelClassName:$,lib:pe,onTransformChange:le,connectionInProgress:he,selectionOnDrag:R,paneClickDistance:j})},[t,r,i,a,u,f,d,m,_e,N,M,q,$,pe,le,he,R,j]),C.jsx("div",{className:"react-flow__renderer",ref:V,style:Mu,children:P})}const Z_=t=>({userSelectionActive:t.userSelectionActive,userSelectionRect:t.userSelectionRect});function J_(){const{userSelectionActive:t,userSelectionRect:r}=gt(Z_,At);return t&&r?C.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 df=(t,r)=>i=>{i.target===r.current&&(t==null||t(i))},eS=t=>({userSelectionActive:t.userSelectionActive,elementsSelectable:t.elementsSelectable,connectionInProgress:t.connection.inProgress,dragging:t.paneDragging});function tS({isSelecting:t,selectionKeyPressed:r,selectionMode:i=ja.Full,panOnDrag:a,paneClickDistance:u,selectionOnDrag:f,onSelectionStart:d,onSelectionEnd:m,onPaneClick:v,onPaneContextMenu:w,onPaneScroll:b,onPaneMouseEnter:x,onPaneMouseMove:S,onPaneMouseLeave:N,children:P}){const $=Tt(),{userSelectionActive:M,elementsSelectable:I,dragging:H,connectionInProgress:j}=gt(eS,At),R=I&&(t||M),W=ce.useRef(null),V=ce.useRef(),q=ce.useRef(new Set),pe=ce.useRef(new Set),he=ce.useRef(!1),_e=L=>{if(he.current||j){he.current=!1;return}v==null||v(L),$.getState().resetSelectedElements(),$.setState({nodesSelectionActive:!1})},Q=L=>{if(Array.isArray(a)&&(a!=null&&a.includes(2))){L.preventDefault();return}w==null||w(L)},le=b?L=>b(L):void 0,xe=L=>{he.current&&(L.stopPropagation(),he.current=!1)},z=L=>{var Ie,Re;const{domNode:F}=$.getState();if(V.current=F==null?void 0:F.getBoundingClientRect(),!V.current)return;const X=L.target===W.current;if(!X&&!!L.target.closest(".nokey")||!t||!(f&&X||r)||L.button!==0||!L.isPrimary)return;(Re=(Ie=L.target)==null?void 0:Ie.setPointerCapture)==null||Re.call(Ie,L.pointerId),he.current=!1;const{x:ke,y:Se}=Ar(L.nativeEvent,V.current);$.setState({userSelectionRect:{width:0,height:0,startX:ke,startY:Se,x:ke,y:Se}}),X||(L.stopPropagation(),L.preventDefault())},ue=L=>{const{userSelectionRect:F,transform:X,nodeLookup:O,edgeLookup:B,connectionLookup:ke,triggerNodeChanges:Se,triggerEdgeChanges:Ie,defaultEdgeOptions:Re,resetSelectedElements:Ae}=$.getState();if(!V.current||!F)return;const{x:we,y:Fe}=Ar(L.nativeEvent,V.current),{startX:be,startY:Je}=F;if(!he.current){const ct=r?0:u;if(Math.hypot(we-be,Fe-Je)<=ct)return;Ae(),d==null||d(L)}he.current=!0;const Be={startX:be,startY:Je,x:we<be?we:be,y:Fe<Je?Fe:Je,width:Math.abs(we-be),height:Math.abs(Fe-Je)},Ye=q.current,ut=pe.current;q.current=new Set(Vf(O,Be,X,i===ja.Partial,!0).map(ct=>ct.id)),pe.current=new Set;const st=(Re==null?void 0:Re.selectable)??!0;for(const ct of q.current){const ht=ke.get(ct);if(ht)for(const{edgeId:xn}of ht.values()){const Lt=B.get(xn);Lt&&(Lt.selectable??st)&&pe.current.add(xn)}}if(!xh(Ye,q.current)){const ct=Ns(O,q.current,!0);Se(ct)}if(!xh(ut,pe.current)){const ct=Ns(B,pe.current);Ie(ct)}$.setState({userSelectionRect:Be,userSelectionActive:!0,nodesSelectionActive:!1})},te=L=>{var F,X;L.button===0&&((X=(F=L.target)==null?void 0:F.releasePointerCapture)==null||X.call(F,L.pointerId),!M&&L.target===W.current&&$.getState().userSelectionRect&&(_e==null||_e(L)),$.setState({userSelectionActive:!1,userSelectionRect:null}),he.current&&(m==null||m(L),$.setState({nodesSelectionActive:q.current.size>0})))},ae=a===!0||Array.isArray(a)&&a.includes(0);return C.jsxs("div",{className:qt(["react-flow__pane",{draggable:ae,dragging:H,selection:t}]),onClick:R?void 0:df(_e,W),onContextMenu:df(Q,W),onWheel:df(le,W),onPointerEnter:R?void 0:x,onPointerMove:R?ue:S,onPointerUp:R?te:void 0,onPointerDownCapture:R?z:void 0,onClickCapture:R?xe:void 0,onPointerLeave:N,ref:W,style:Mu,children:[P,C.jsx(J_,{})]})}function Af({id:t,store:r,unselect:i=!1,nodeRef:a}){const{addSelectedNodes:u,unselectNodesAndEdges:f,multiSelectionActive:d,nodeLookup:m,onError:v}=r.getState(),w=m.get(t);if(!w){v==null||v("012",Qr.error012(t));return}r.setState({nodesSelectionActive:!1}),w.selected?(i||w.selected&&d)&&(f({nodes:[w],edges:[]}),requestAnimationFrame(()=>{var b;return(b=a==null?void 0:a.current)==null?void 0:b.blur()})):u([t])}function Mg({nodeRef:t,disabled:r=!1,noDragClassName:i,handleSelector:a,nodeId:u,isSelectable:f,nodeClickDistance:d}){const m=Tt(),[v,w]=ce.useState(!1),b=ce.useRef();return ce.useEffect(()=>{b.current=V1({getStoreItems:()=>m.getState(),onNodeMouseDown:x=>{Af({id:x,store:m,nodeRef:t})},onDragStart:()=>{w(!0)},onDragStop:()=>{w(!1)}})},[]),ce.useEffect(()=>{if(!(r||!t.current||!b.current))return b.current.update({noDragClassName:i,handleSelector:a,domNode:t.current,isSelectable:f,nodeId:u,nodeClickDistance:d}),()=>{var x;(x=b.current)==null||x.destroy()}},[i,a,r,f,t,u,d]),v}const nS=t=>r=>r.selected&&(r.draggable||t&&typeof r.draggable>"u");function Ig(){const t=Tt();return ce.useCallback(i=>{const{nodeExtent:a,snapToGrid:u,snapGrid:f,nodesDraggable:d,onError:m,updateNodePositions:v,nodeLookup:w,nodeOrigin:b}=t.getState(),x=new Map,S=nS(d),N=u?f[0]:5,P=u?f[1]:5,$=i.direction.x*N*i.factor,M=i.direction.y*P*i.factor;for(const[,I]of w){if(!S(I))continue;let H={x:I.internals.positionAbsolute.x+$,y:I.internals.positionAbsolute.y+M};u&&(H=za(H,f));const{position:j,positionAbsolute:R}=Qm({nodeId:I.id,nextPosition:H,nodeLookup:w,nodeExtent:a,nodeOrigin:b,onError:m});I.position=j,I.internals.positionAbsolute=R,x.set(I.id,I)}v(x)},[])}const Zf=ce.createContext(null),rS=Zf.Provider;Zf.Consumer;const Ag=()=>ce.useContext(Zf),oS=t=>({connectOnClick:t.connectOnClick,noPanClassName:t.noPanClassName,rfId:t.rfId}),iS=(t,r,i)=>a=>{const{connectionClickStartHandle:u,connectionMode:f,connection:d}=a,{fromHandle:m,toHandle:v,isValid:w}=d,b=(v==null?void 0:v.nodeId)===t&&(v==null?void 0:v.id)===r&&(v==null?void 0:v.type)===i;return{connectingFrom:(m==null?void 0:m.nodeId)===t&&(m==null?void 0:m.id)===r&&(m==null?void 0:m.type)===i,connectingTo:b,clickConnecting:(u==null?void 0:u.nodeId)===t&&(u==null?void 0:u.id)===r&&(u==null?void 0:u.type)===i,isPossibleEndHandle:f===Ms.Strict?(m==null?void 0:m.type)!==i:t!==(m==null?void 0:m.nodeId)||r!==(m==null?void 0:m.id),connectionInProcess:!!m,clickConnectionInProcess:!!u,valid:b&&w}};function sS({type:t="source",position:r=Ze.Top,isValidConnection:i,isConnectable:a=!0,isConnectableStart:u=!0,isConnectableEnd:f=!0,id:d,onConnect:m,children:v,className:w,onMouseDown:b,onTouchStart:x,...S},N){var ue,te;const P=d||null,$=t==="target",M=Tt(),I=Ag(),{connectOnClick:H,noPanClassName:j,rfId:R}=gt(oS,At),{connectingFrom:W,connectingTo:V,clickConnecting:q,isPossibleEndHandle:pe,connectionInProcess:he,clickConnectionInProcess:_e,valid:Q}=gt(iS(I,P,t),At);I||(te=(ue=M.getState()).onError)==null||te.call(ue,"010",Qr.error010());const le=ae=>{const{defaultEdgeOptions:L,onConnect:F,hasDefaultEdges:X}=M.getState(),O={...L,...ae};if(X){const{edges:B,setEdges:ke}=M.getState();ke(lg(O,B))}F==null||F(O),m==null||m(O)},xe=ae=>{if(!I)return;const L=og(ae.nativeEvent);if(u&&(L&&ae.button===0||!L)){const F=M.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:$,handleId:P,nodeId:I,flowId:F.rfId,panBy:F.panBy,cancelConnection:F.cancelConnection,onConnectStart:F.onConnectStart,onConnectEnd:(...X)=>{var O,B;return(B=(O=M.getState()).onConnectEnd)==null?void 0:B.call(O,...X)},updateConnection:F.updateConnection,onConnect:le,isValidConnection:i||((...X)=>{var O,B;return((B=(O=M.getState()).isValidConnection)==null?void 0:B.call(O,...X))??!0}),getTransform:()=>M.getState().transform,getFromHandle:()=>M.getState().connection.fromHandle,autoPanSpeed:F.autoPanSpeed,dragThreshold:F.connectionDragThreshold})}L?b==null||b(ae):x==null||x(ae)},z=ae=>{const{onClickConnectStart:L,onClickConnectEnd:F,connectionClickStartHandle:X,connectionMode:O,isValidConnection:B,lib:ke,rfId:Se,nodeLookup:Ie,connection:Re}=M.getState();if(!I||!X&&!u)return;if(!X){L==null||L(ae.nativeEvent,{nodeId:I,handleId:P,handleType:t}),M.setState({connectionClickStartHandle:{nodeId:I,type:t,id:P}});return}const Ae=ng(ae.target),we=i||B,{connection:Fe,isValid:be}=Mf.isValid(ae.nativeEvent,{handle:{nodeId:I,id:P,type:t},connectionMode:O,fromNodeId:X.nodeId,fromHandleId:X.id||null,fromType:X.type,isValidConnection:we,flowId:Se,doc:Ae,lib:ke,nodeLookup:Ie});be&&Fe&&le(Fe);const Je=structuredClone(Re);delete Je.inProgress,Je.toPosition=Je.toHandle?Je.toHandle.position:null,F==null||F(ae,Je),M.setState({connectionClickStartHandle:null})};return C.jsx("div",{"data-handleid":P,"data-nodeid":I,"data-handlepos":r,"data-id":`${R}-${I}-${P}-${t}`,className:qt(["react-flow__handle",`react-flow__handle-${r}`,"nodrag",j,w,{source:!$,target:$,connectable:a,connectablestart:u,connectableend:f,clickconnecting:q,connectingfrom:W,connectingto:V,valid:Q,connectionindicator:a&&(!he||pe)&&(he||_e?f:u)}]),onMouseDown:xe,onTouchStart:xe,onClick:H?z:void 0,ref:N,...S,children:v})}const Rs=ce.memo(jg(sS));function aS({data:t,isConnectable:r,sourcePosition:i=Ze.Bottom}){return C.jsxs(C.Fragment,{children:[t==null?void 0:t.label,C.jsx(Rs,{type:"source",position:i,isConnectable:r})]})}function lS({data:t,isConnectable:r,targetPosition:i=Ze.Top,sourcePosition:a=Ze.Bottom}){return C.jsxs(C.Fragment,{children:[C.jsx(Rs,{type:"target",position:i,isConnectable:r}),t==null?void 0:t.label,C.jsx(Rs,{type:"source",position:a,isConnectable:r})]})}function uS(){return null}function cS({data:t,isConnectable:r,targetPosition:i=Ze.Top}){return C.jsxs(C.Fragment,{children:[C.jsx(Rs,{type:"target",position:i,isConnectable:r}),t==null?void 0:t.label]})}const yu={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},Xh={input:aS,default:lS,output:cS,group:uS};function fS(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 dS=t=>{const{width:r,height:i,x:a,y:u}=Da(t.nodeLookup,{filter:f=>!!f.selected});return{width:Ir(r)?r:null,height:Ir(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 pS({onSelectionContextMenu:t,noPanClassName:r,disableKeyboardA11y:i}){const a=Tt(),{width:u,height:f,transformString:d,userSelectionActive:m}=gt(dS,At),v=Ig(),w=ce.useRef(null);ce.useEffect(()=>{var N;i||(N=w.current)==null||N.focus({preventScroll:!0})},[i]);const b=!m&&u!==null&&f!==null;if(Mg({nodeRef:w,disabled:!b}),!b)return null;const x=t?N=>{const P=a.getState().nodes.filter($=>$.selected);t(N,P)}:void 0,S=N=>{Object.prototype.hasOwnProperty.call(yu,N.key)&&(N.preventDefault(),v({direction:yu[N.key],factor:N.shiftKey?4:1}))};return C.jsx("div",{className:qt(["react-flow__nodesselection","react-flow__container",r]),style:{transform:d},children:C.jsx("div",{ref:w,className:"react-flow__nodesselection-rect",onContextMenu:x,tabIndex:i?void 0:-1,onKeyDown:i?void 0:S,style:{width:u,height:f}})})}const Qh=typeof window<"u"?window:void 0,hS=t=>({nodesSelectionActive:t.nodesSelectionActive,userSelectionActive:t.userSelectionActive});function $g({children:t,onPaneClick:r,onPaneMouseEnter:i,onPaneMouseMove:a,onPaneMouseLeave:u,onPaneContextMenu:f,onPaneScroll:d,paneClickDistance:m,deleteKeyCode:v,selectionKeyCode:w,selectionOnDrag:b,selectionMode:x,onSelectionStart:S,onSelectionEnd:N,multiSelectionKeyCode:P,panActivationKeyCode:$,zoomActivationKeyCode:M,elementsSelectable:I,zoomOnScroll:H,zoomOnPinch:j,panOnScroll:R,panOnScrollSpeed:W,panOnScrollMode:V,zoomOnDoubleClick:q,panOnDrag:pe,defaultViewport:he,translateExtent:_e,minZoom:Q,maxZoom:le,preventScrolling:xe,onSelectionContextMenu:z,noWheelClassName:ue,noPanClassName:te,disableKeyboardA11y:ae,onViewportChange:L,isControlledViewport:F}){const{nodesSelectionActive:X,userSelectionActive:O}=gt(hS,At),B=Ia(w,{target:Qh}),ke=Ia($,{target:Qh}),Se=ke||pe,Ie=ke||R,Re=b&&Se!==!0,Ae=B||O||Re;return Y_({deleteKeyCode:v,multiSelectionKeyCode:P}),C.jsx(G_,{onPaneContextMenu:f,elementsSelectable:I,zoomOnScroll:H,zoomOnPinch:j,panOnScroll:Ie,panOnScrollSpeed:W,panOnScrollMode:V,zoomOnDoubleClick:q,panOnDrag:!B&&Se,defaultViewport:he,translateExtent:_e,minZoom:Q,maxZoom:le,zoomActivationKeyCode:M,preventScrolling:xe,noWheelClassName:ue,noPanClassName:te,onViewportChange:L,isControlledViewport:F,paneClickDistance:m,selectionOnDrag:Re,children:C.jsxs(tS,{onSelectionStart:S,onSelectionEnd:N,onPaneClick:r,onPaneMouseEnter:i,onPaneMouseMove:a,onPaneMouseLeave:u,onPaneContextMenu:f,onPaneScroll:d,panOnDrag:Se,isSelecting:!!Ae,selectionMode:x,selectionKeyPressed:B,paneClickDistance:m,selectionOnDrag:Re,children:[t,X&&C.jsx(pS,{onSelectionContextMenu:z,noPanClassName:te,disableKeyboardA11y:ae})]})})}$g.displayName="FlowRenderer";const mS=ce.memo($g),gS=t=>r=>t?Vf(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 yS(t){return gt(ce.useCallback(gS(t),[t]),At)}const vS=t=>t.updateNodeInternals;function xS(){const t=gt(vS),[r]=ce.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 ce.useEffect(()=>()=>{r==null||r.disconnect()},[r]),r}function wS({node:t,nodeType:r,hasDimensions:i,resizeObserver:a}){const u=Tt(),f=ce.useRef(null),d=ce.useRef(null),m=ce.useRef(t.sourcePosition),v=ce.useRef(t.targetPosition),w=ce.useRef(r),b=i&&!!t.internals.handleBounds;return ce.useEffect(()=>{f.current&&!t.hidden&&(!b||d.current!==f.current)&&(d.current&&(a==null||a.unobserve(d.current)),a==null||a.observe(f.current),d.current=f.current)},[b,t.hidden]),ce.useEffect(()=>()=>{d.current&&(a==null||a.unobserve(d.current),d.current=null)},[]),ce.useEffect(()=>{if(f.current){const x=w.current!==r,S=m.current!==t.sourcePosition,N=v.current!==t.targetPosition;(x||S||N)&&(w.current=r,m.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 _S({id:t,onClick:r,onMouseEnter:i,onMouseMove:a,onMouseLeave:u,onContextMenu:f,onDoubleClick:d,nodesDraggable:m,elementsSelectable:v,nodesConnectable:w,nodesFocusable:b,resizeObserver:x,noDragClassName:S,noPanClassName:N,disableKeyboardA11y:P,rfId:$,nodeTypes:M,nodeClickDistance:I,onError:H}){const{node:j,internals:R,isParent:W}=gt(we=>{const Fe=we.nodeLookup.get(t),be=we.parentLookup.has(t);return{node:Fe,internals:Fe.internals,isParent:be}},At);let V=j.type||"default",q=(M==null?void 0:M[V])||Xh[V];q===void 0&&(H==null||H("003",Qr.error003(V)),V="default",q=(M==null?void 0:M.default)||Xh.default);const pe=!!(j.draggable||m&&typeof j.draggable>"u"),he=!!(j.selectable||v&&typeof j.selectable>"u"),_e=!!(j.connectable||w&&typeof j.connectable>"u"),Q=!!(j.focusable||b&&typeof j.focusable>"u"),le=Tt(),xe=eg(j),z=wS({node:j,nodeType:V,hasDimensions:xe,resizeObserver:x}),ue=Mg({nodeRef:z,disabled:j.hidden||!pe,noDragClassName:S,handleSelector:j.dragHandle,nodeId:t,isSelectable:he,nodeClickDistance:I}),te=Ig();if(j.hidden)return null;const ae=Mo(j),L=fS(j),F=he||pe||r||i||a||u,X=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,ke=f?we=>f(we,{...R.userNode}):void 0,Se=d?we=>d(we,{...R.userNode}):void 0,Ie=we=>{const{selectNodesOnDrag:Fe,nodeDragThreshold:be}=le.getState();he&&(!Fe||!pe||be>0)&&Af({id:t,store:le,nodeRef:z}),r&&r(we,{...R.userNode})},Re=we=>{if(!(rg(we.nativeEvent)||P)){if(Um.includes(we.key)&&he){const Fe=we.key==="Escape";Af({id:t,store:le,unselect:Fe,nodeRef:z})}else if(pe&&j.selected&&Object.prototype.hasOwnProperty.call(yu,we.key)){we.preventDefault();const{ariaLabelConfig:Fe}=le.getState();le.setState({ariaLiveMessage:Fe["node.a11yDescription.ariaLiveMessage"]({direction:we.key.replace("Arrow","").toLowerCase(),x:~~R.positionAbsolute.x,y:~~R.positionAbsolute.y})}),te({direction:yu[we.key],factor:we.shiftKey?4:1})}}},Ae=()=>{var ut;if(P||!((ut=z.current)!=null&&ut.matches(":focus-visible")))return;const{transform:we,width:Fe,height:be,autoPanOnNodeFocus:Je,setCenter:Be}=le.getState();if(!Je)return;Vf(new Map([[t,j]]),{x:0,y:0,width:Fe,height:be},we,!0).length>0||Be(j.position.x+ae.width/2,j.position.y+ae.height/2,{zoom:we[2]})};return C.jsx("div",{className:qt(["react-flow__node",`react-flow__node-${V}`,{[N]:pe},j.className,{selected:j.selected,selectable:he,parent:W,draggable:pe,dragging:ue}]),ref:z,style:{zIndex:R.z,transform:`translate(${R.positionAbsolute.x}px,${R.positionAbsolute.y}px)`,pointerEvents:F?"all":"none",visibility:xe?"visible":"hidden",...j.style,...L},"data-id":t,"data-testid":`rf__node-${t}`,onMouseEnter:X,onMouseMove:O,onMouseLeave:B,onContextMenu:ke,onClick:Ie,onDoubleClick:Se,onKeyDown:Q?Re:void 0,tabIndex:Q?0:void 0,onFocus:Q?Ae:void 0,role:j.ariaRole??(Q?"group":void 0),"aria-roledescription":"node","aria-describedby":P?void 0:`${bg}-${$}`,"aria-label":j.ariaLabel,...j.domAttributes,children:C.jsx(rS,{value:t,children:C.jsx(q,{id:t,data:j.data,type:V,positionAbsoluteX:R.positionAbsolute.x,positionAbsoluteY:R.positionAbsolute.y,selected:j.selected??!1,selectable:he,draggable:pe,deletable:j.deletable??!0,isConnectable:_e,sourcePosition:j.sourcePosition,targetPosition:j.targetPosition,dragging:ue,dragHandle:j.dragHandle,zIndex:R.z,parentId:j.parentId,...ae})})})}var SS=ce.memo(_S);const bS=t=>({nodesDraggable:t.nodesDraggable,nodesConnectable:t.nodesConnectable,nodesFocusable:t.nodesFocusable,elementsSelectable:t.elementsSelectable,onError:t.onError});function Og(t){const{nodesDraggable:r,nodesConnectable:i,nodesFocusable:a,elementsSelectable:u,onError:f}=gt(bS,At),d=yS(t.onlyRenderVisibleElements),m=xS();return C.jsx("div",{className:"react-flow__nodes",style:Mu,children:d.map(v=>C.jsx(SS,{id:v,nodeTypes:t.nodeTypes,nodeExtent:t.nodeExtent,onClick:t.onNodeClick,onMouseEnter:t.onNodeMouseEnter,onMouseMove:t.onNodeMouseMove,onMouseLeave:t.onNodeMouseLeave,onContextMenu:t.onNodeContextMenu,onDoubleClick:t.onNodeDoubleClick,noDragClassName:t.noDragClassName,noPanClassName:t.noPanClassName,rfId:t.rfId,disableKeyboardA11y:t.disableKeyboardA11y,resizeObserver:m,nodesDraggable:r,nodesConnectable:i,nodesFocusable:a,elementsSelectable:u,nodeClickDistance:t.nodeClickDistance,onError:f},v))})}Og.displayName="NodeRenderer";const kS=ce.memo(Og);function ES(t){return gt(ce.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&&E1({sourceNode:f,targetNode:d,width:i.width,height:i.height,transform:i.transform})&&a.push(u.id)}return a},[t]),At)}const NS=({color:t="none",strokeWidth:r=1})=>{const i={strokeWidth:r,...t&&{stroke:t}};return C.jsx("polyline",{className:"arrow",style:i,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},CS=({color:t="none",strokeWidth:r=1})=>{const i={strokeWidth:r,...t&&{stroke:t,fill:t}};return C.jsx("polyline",{className:"arrowclosed",style:i,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},Gh={[hu.Arrow]:NS,[hu.ArrowClosed]:CS};function PS(t){const r=Tt();return ce.useMemo(()=>{var u,f;return Object.prototype.hasOwnProperty.call(Gh,t)?Gh[t]:((f=(u=r.getState()).onError)==null||f.call(u,"009",Qr.error009(t)),null)},[t])}const jS=({id:t,type:r,color:i,width:a=12.5,height:u=12.5,markerUnits:f="strokeWidth",strokeWidth:d,orient:m="auto-start-reverse"})=>{const v=PS(r);return v?C.jsx("marker",{className:"react-flow__arrowhead",id:t,markerWidth:`${a}`,markerHeight:`${u}`,viewBox:"-10 -10 20 20",markerUnits:f,orient:m,refX:"0",refY:"0",children:C.jsx(v,{color:i,strokeWidth:d})}):null},Rg=({defaultColor:t,rfId:r})=>{const i=gt(f=>f.edges),a=gt(f=>f.defaultEdgeOptions),u=ce.useMemo(()=>I1(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?C.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:C.jsx("defs",{children:u.map(f=>C.jsx(jS,{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};Rg.displayName="MarkerDefinitions";var TS=ce.memo(Rg);function Dg({x:t,y:r,label:i,labelStyle:a,labelShowBg:u=!0,labelBgStyle:f,labelBgPadding:d=[2,4],labelBgBorderRadius:m=2,children:v,className:w,...b}){const[x,S]=ce.useState({x:1,y:0,width:0,height:0}),N=qt(["react-flow__edge-textwrapper",w]),P=ce.useRef(null);return ce.useEffect(()=>{if(P.current){const $=P.current.getBBox();S({x:$.x,y:$.y,width:$.width,height:$.height})}},[i]),i?C.jsxs("g",{transform:`translate(${t-x.width/2} ${r-x.height/2})`,className:N,visibility:x.width?"visible":"hidden",...b,children:[u&&C.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:m,ry:m}),C.jsx("text",{className:"react-flow__edge-text",y:x.height/2,dy:"0.3em",ref:P,style:a,children:i}),v]}):null}Dg.displayName="EdgeText";const MS=ce.memo(Dg);function Iu({path:t,labelX:r,labelY:i,label:a,labelStyle:u,labelShowBg:f,labelBgStyle:d,labelBgPadding:m,labelBgBorderRadius:v,interactionWidth:w=20,...b}){return C.jsxs(C.Fragment,{children:[C.jsx("path",{...b,d:t,fill:"none",className:qt(["react-flow__edge-path",b.className])}),w?C.jsx("path",{d:t,fill:"none",strokeOpacity:0,strokeWidth:w,className:"react-flow__edge-interaction"}):null,a&&Ir(r)&&Ir(i)?C.jsx(MS,{x:r,y:i,label:a,labelStyle:u,labelShowBg:f,labelBgStyle:d,labelBgPadding:m,labelBgBorderRadius:v}):null]})}function Zh({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 zg({sourceX:t,sourceY:r,sourcePosition:i=Ze.Bottom,targetX:a,targetY:u,targetPosition:f=Ze.Top}){const[d,m]=Zh({pos:i,x1:t,y1:r,x2:a,y2:u}),[v,w]=Zh({pos:f,x1:a,y1:u,x2:t,y2:r}),[b,x,S,N]=ig({sourceX:t,sourceY:r,targetX:a,targetY:u,sourceControlX:d,sourceControlY:m,targetControlX:v,targetControlY:w});return[`M${t},${r} C${d},${m} ${v},${w} ${a},${u}`,b,x,S,N]}function Lg(t){return ce.memo(({id:r,sourceX:i,sourceY:a,targetX:u,targetY:f,sourcePosition:d,targetPosition:m,label:v,labelStyle:w,labelShowBg:b,labelBgStyle:x,labelBgPadding:S,labelBgBorderRadius:N,style:P,markerEnd:$,markerStart:M,interactionWidth:I})=>{const[H,j,R]=zg({sourceX:i,sourceY:a,sourcePosition:d,targetX:u,targetY:f,targetPosition:m}),W=t.isInternal?void 0:r;return C.jsx(Iu,{id:W,path:H,labelX:j,labelY:R,label:v,labelStyle:w,labelShowBg:b,labelBgStyle:x,labelBgPadding:S,labelBgBorderRadius:N,style:P,markerEnd:$,markerStart:M,interactionWidth:I})})}const IS=Lg({isInternal:!1}),Fg=Lg({isInternal:!0});IS.displayName="SimpleBezierEdge";Fg.displayName="SimpleBezierEdgeInternal";function Bg(t){return ce.memo(({id:r,sourceX:i,sourceY:a,targetX:u,targetY:f,label:d,labelStyle:m,labelShowBg:v,labelBgStyle:w,labelBgPadding:b,labelBgBorderRadius:x,style:S,sourcePosition:N=Ze.Bottom,targetPosition:P=Ze.Top,markerEnd:$,markerStart:M,pathOptions:I,interactionWidth:H})=>{const[j,R,W]=Pf({sourceX:i,sourceY:a,sourcePosition:N,targetX:u,targetY:f,targetPosition:P,borderRadius:I==null?void 0:I.borderRadius,offset:I==null?void 0:I.offset,stepPosition:I==null?void 0:I.stepPosition}),V=t.isInternal?void 0:r;return C.jsx(Iu,{id:V,path:j,labelX:R,labelY:W,label:d,labelStyle:m,labelShowBg:v,labelBgStyle:w,labelBgPadding:b,labelBgBorderRadius:x,style:S,markerEnd:$,markerStart:M,interactionWidth:H})})}const Hg=Bg({isInternal:!1}),Vg=Bg({isInternal:!0});Hg.displayName="SmoothStepEdge";Vg.displayName="SmoothStepEdgeInternal";function Kg(t){return ce.memo(({id:r,...i})=>{var u;const a=t.isInternal?void 0:r;return C.jsx(Hg,{...i,id:a,pathOptions:ce.useMemo(()=>{var f;return{borderRadius:0,offset:(f=i.pathOptions)==null?void 0:f.offset}},[(u=i.pathOptions)==null?void 0:u.offset])})})}const AS=Kg({isInternal:!1}),Ug=Kg({isInternal:!0});AS.displayName="StepEdge";Ug.displayName="StepEdgeInternal";function qg(t){return ce.memo(({id:r,sourceX:i,sourceY:a,targetX:u,targetY:f,label:d,labelStyle:m,labelShowBg:v,labelBgStyle:w,labelBgPadding:b,labelBgBorderRadius:x,style:S,markerEnd:N,markerStart:P,interactionWidth:$})=>{const[M,I,H]=ug({sourceX:i,sourceY:a,targetX:u,targetY:f}),j=t.isInternal?void 0:r;return C.jsx(Iu,{id:j,path:M,labelX:I,labelY:H,label:d,labelStyle:m,labelShowBg:v,labelBgStyle:w,labelBgPadding:b,labelBgBorderRadius:x,style:S,markerEnd:N,markerStart:P,interactionWidth:$})})}const $S=qg({isInternal:!1}),Wg=qg({isInternal:!0});$S.displayName="StraightEdge";Wg.displayName="StraightEdgeInternal";function Yg(t){return ce.memo(({id:r,sourceX:i,sourceY:a,targetX:u,targetY:f,sourcePosition:d=Ze.Bottom,targetPosition:m=Ze.Top,label:v,labelStyle:w,labelShowBg:b,labelBgStyle:x,labelBgPadding:S,labelBgBorderRadius:N,style:P,markerEnd:$,markerStart:M,pathOptions:I,interactionWidth:H})=>{const[j,R,W]=sg({sourceX:i,sourceY:a,sourcePosition:d,targetX:u,targetY:f,targetPosition:m,curvature:I==null?void 0:I.curvature}),V=t.isInternal?void 0:r;return C.jsx(Iu,{id:V,path:j,labelX:R,labelY:W,label:v,labelStyle:w,labelShowBg:b,labelBgStyle:x,labelBgPadding:S,labelBgBorderRadius:N,style:P,markerEnd:$,markerStart:M,interactionWidth:H})})}const OS=Yg({isInternal:!1}),Xg=Yg({isInternal:!0});OS.displayName="BezierEdge";Xg.displayName="BezierEdgeInternal";const Jh={default:Xg,straight:Wg,step:Ug,smoothstep:Vg,simplebezier:Fg},em={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},RS=(t,r,i)=>i===Ze.Left?t-r:i===Ze.Right?t+r:t,DS=(t,r,i)=>i===Ze.Top?t-r:i===Ze.Bottom?t+r:t,tm="react-flow__edgeupdater";function nm({position:t,centerX:r,centerY:i,radius:a=10,onMouseDown:u,onMouseEnter:f,onMouseOut:d,type:m}){return C.jsx("circle",{onMouseDown:u,onMouseEnter:f,onMouseOut:d,className:qt([tm,`${tm}-${m}`]),cx:RS(r,a,t),cy:DS(i,a,t),r:a,stroke:"transparent",fill:"transparent"})}function zS({isReconnectable:t,reconnectRadius:r,edge:i,sourceX:a,sourceY:u,targetX:f,targetY:d,sourcePosition:m,targetPosition:v,onReconnect:w,onReconnectStart:b,onReconnectEnd:x,setReconnecting:S,setUpdateHover:N}){const P=Tt(),$=(R,W)=>{if(R.button!==0)return;const{autoPanOnConnect:V,domNode:q,connectionMode:pe,connectionRadius:he,lib:_e,onConnectStart:Q,cancelConnection:le,nodeLookup:xe,rfId:z,panBy:ue,updateConnection:te}=P.getState(),ae=W.type==="target",L=(O,B)=>{S(!1),x==null||x(O,i,W.type,B)},F=O=>w==null?void 0:w(i,O),X=(O,B)=>{S(!0),b==null||b(R,i,W.type),Q==null||Q(O,B)};Mf.onPointerDown(R.nativeEvent,{autoPanOnConnect:V,connectionMode:pe,connectionRadius:he,domNode:q,handleId:W.id,nodeId:W.nodeId,nodeLookup:xe,isTarget:ae,edgeUpdaterType:W.type,lib:_e,flowId:z,cancelConnection:le,panBy:ue,isValidConnection:(...O)=>{var B,ke;return((ke=(B=P.getState()).isValidConnection)==null?void 0:ke.call(B,...O))??!0},onConnect:F,onConnectStart:X,onConnectEnd:(...O)=>{var B,ke;return(ke=(B=P.getState()).onConnectEnd)==null?void 0:ke.call(B,...O)},onReconnectEnd:L,updateConnection:te,getTransform:()=>P.getState().transform,getFromHandle:()=>P.getState().connection.fromHandle,dragThreshold:P.getState().connectionDragThreshold,handleDomNode:R.currentTarget})},M=R=>$(R,{nodeId:i.target,id:i.targetHandle??null,type:"target"}),I=R=>$(R,{nodeId:i.source,id:i.sourceHandle??null,type:"source"}),H=()=>N(!0),j=()=>N(!1);return C.jsxs(C.Fragment,{children:[(t===!0||t==="source")&&C.jsx(nm,{position:m,centerX:a,centerY:u,radius:r,onMouseDown:M,onMouseEnter:H,onMouseOut:j,type:"source"}),(t===!0||t==="target")&&C.jsx(nm,{position:v,centerX:f,centerY:d,radius:r,onMouseDown:I,onMouseEnter:H,onMouseOut:j,type:"target"})]})}function LS({id:t,edgesFocusable:r,edgesReconnectable:i,elementsSelectable:a,onClick:u,onDoubleClick:f,onContextMenu:d,onMouseEnter:m,onMouseMove:v,onMouseLeave:w,reconnectRadius:b,onReconnect:x,onReconnectStart:S,onReconnectEnd:N,rfId:P,edgeTypes:$,noPanClassName:M,onError:I,disableKeyboardA11y:H}){let j=gt(Be=>Be.edgeLookup.get(t));const R=gt(Be=>Be.defaultEdgeOptions);j=R?{...R,...j}:j;let W=j.type||"default",V=($==null?void 0:$[W])||Jh[W];V===void 0&&(I==null||I("011",Qr.error011(W)),W="default",V=($==null?void 0:$.default)||Jh.default);const q=!!(j.focusable||r&&typeof j.focusable>"u"),pe=typeof x<"u"&&(j.reconnectable||i&&typeof j.reconnectable>"u"),he=!!(j.selectable||a&&typeof j.selectable>"u"),_e=ce.useRef(null),[Q,le]=ce.useState(!1),[xe,z]=ce.useState(!1),ue=Tt(),{zIndex:te,sourceX:ae,sourceY:L,targetX:F,targetY:X,sourcePosition:O,targetPosition:B}=gt(ce.useCallback(Be=>{const Ye=Be.nodeLookup.get(j.source),ut=Be.nodeLookup.get(j.target);if(!Ye||!ut)return{zIndex:j.zIndex,...em};const st=M1({id:t,sourceNode:Ye,targetNode:ut,sourceHandle:j.sourceHandle||null,targetHandle:j.targetHandle||null,connectionMode:Be.connectionMode,onError:I});return{zIndex:k1({selected:j.selected,zIndex:j.zIndex,sourceNode:Ye,targetNode:ut,elevateOnSelect:Be.elevateEdgesOnSelect,zIndexMode:Be.zIndexMode}),...st||em}},[j.source,j.target,j.sourceHandle,j.targetHandle,j.selected,j.zIndex]),At),ke=ce.useMemo(()=>j.markerStart?`url('#${jf(j.markerStart,P)}')`:void 0,[j.markerStart,P]),Se=ce.useMemo(()=>j.markerEnd?`url('#${jf(j.markerEnd,P)}')`:void 0,[j.markerEnd,P]);if(j.hidden||ae===null||L===null||F===null||X===null)return null;const Ie=Be=>{var ct;const{addSelectedEdges:Ye,unselectNodesAndEdges:ut,multiSelectionActive:st}=ue.getState();he&&(ue.setState({nodesSelectionActive:!1}),j.selected&&st?(ut({nodes:[],edges:[j]}),(ct=_e.current)==null||ct.blur()):Ye([t])),u&&u(Be,j)},Re=f?Be=>{f(Be,{...j})}:void 0,Ae=d?Be=>{d(Be,{...j})}:void 0,we=m?Be=>{m(Be,{...j})}:void 0,Fe=v?Be=>{v(Be,{...j})}:void 0,be=w?Be=>{w(Be,{...j})}:void 0,Je=Be=>{var Ye;if(!H&&Um.includes(Be.key)&&he){const{unselectNodesAndEdges:ut,addSelectedEdges:st}=ue.getState();Be.key==="Escape"?((Ye=_e.current)==null||Ye.blur(),ut({edges:[j]})):st([t])}};return C.jsx("svg",{style:{zIndex:te},children:C.jsxs("g",{className:qt(["react-flow__edge",`react-flow__edge-${W}`,j.className,M,{selected:j.selected,animated:j.animated,inactive:!he&&!u,updating:Q,selectable:he}]),onClick:Ie,onDoubleClick:Re,onContextMenu:Ae,onMouseEnter:we,onMouseMove:Fe,onMouseLeave:be,onKeyDown:q?Je:void 0,tabIndex:q?0:void 0,role:j.ariaRole??(q?"group":"img"),"aria-roledescription":"edge","data-id":t,"data-testid":`rf__edge-${t}`,"aria-label":j.ariaLabel===null?void 0:j.ariaLabel||`Edge from ${j.source} to ${j.target}`,"aria-describedby":q?`${kg}-${P}`:void 0,ref:_e,...j.domAttributes,children:[!xe&&C.jsx(V,{id:t,source:j.source,target:j.target,type:j.type,selected:j.selected,animated:j.animated,selectable:he,deletable:j.deletable??!0,label:j.label,labelStyle:j.labelStyle,labelShowBg:j.labelShowBg,labelBgStyle:j.labelBgStyle,labelBgPadding:j.labelBgPadding,labelBgBorderRadius:j.labelBgBorderRadius,sourceX:ae,sourceY:L,targetX:F,targetY:X,sourcePosition:O,targetPosition:B,data:j.data,style:j.style,sourceHandleId:j.sourceHandle,targetHandleId:j.targetHandle,markerStart:ke,markerEnd:Se,pathOptions:"pathOptions"in j?j.pathOptions:void 0,interactionWidth:j.interactionWidth}),pe&&C.jsx(zS,{edge:j,isReconnectable:pe,reconnectRadius:b,onReconnect:x,onReconnectStart:S,onReconnectEnd:N,sourceX:ae,sourceY:L,targetX:F,targetY:X,sourcePosition:O,targetPosition:B,setUpdateHover:le,setReconnecting:z})]})})}var FS=ce.memo(LS);const BS=t=>({edgesFocusable:t.edgesFocusable,edgesReconnectable:t.edgesReconnectable,elementsSelectable:t.elementsSelectable,connectionMode:t.connectionMode,onError:t.onError});function Qg({defaultMarkerColor:t,onlyRenderVisibleElements:r,rfId:i,edgeTypes:a,noPanClassName:u,onReconnect:f,onEdgeContextMenu:d,onEdgeMouseEnter:m,onEdgeMouseMove:v,onEdgeMouseLeave:w,onEdgeClick:b,reconnectRadius:x,onEdgeDoubleClick:S,onReconnectStart:N,onReconnectEnd:P,disableKeyboardA11y:$}){const{edgesFocusable:M,edgesReconnectable:I,elementsSelectable:H,onError:j}=gt(BS,At),R=ES(r);return C.jsxs("div",{className:"react-flow__edges",children:[C.jsx(TS,{defaultColor:t,rfId:i}),R.map(W=>C.jsx(FS,{id:W,edgesFocusable:M,edgesReconnectable:I,elementsSelectable:H,noPanClassName:u,onReconnect:f,onContextMenu:d,onMouseEnter:m,onMouseMove:v,onMouseLeave:w,onClick:b,reconnectRadius:x,onDoubleClick:S,onReconnectStart:N,onReconnectEnd:P,rfId:i,onError:j,edgeTypes:a,disableKeyboardA11y:$},W))]})}Qg.displayName="EdgeRenderer";const HS=ce.memo(Qg),VS=t=>`translate(${t.transform[0]}px,${t.transform[1]}px) scale(${t.transform[2]})`;function KS({children:t}){const r=gt(VS);return C.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:r},children:t})}function US(t){const r=Gf(),i=ce.useRef(!1);ce.useEffect(()=>{!i.current&&r.viewportInitialized&&t&&(setTimeout(()=>t(r),1),i.current=!0)},[t,r.viewportInitialized])}const qS=t=>{var r;return(r=t.panZoom)==null?void 0:r.syncViewport};function WS(t){const r=gt(qS),i=Tt();return ce.useEffect(()=>{t&&(r==null||r(t),i.setState({transform:[t.x,t.y,t.zoom]}))},[t,r]),null}function YS(t){return t.connection.inProgress?{...t.connection,to:La(t.connection.to,t.transform)}:{...t.connection}}function XS(t){return YS}function QS(t){const r=XS();return gt(r,At)}const GS=t=>({nodesConnectable:t.nodesConnectable,isValid:t.connection.isValid,inProgress:t.connection.inProgress,width:t.width,height:t.height});function ZS({containerStyle:t,style:r,type:i,component:a}){const{nodesConnectable:u,width:f,height:d,isValid:m,inProgress:v}=gt(GS,At);return!(f&&u&&v)?null:C.jsx("svg",{style:t,width:f,height:d,className:"react-flow__connectionline react-flow__container",children:C.jsx("g",{className:qt(["react-flow__connection",Ym(m)]),children:C.jsx(Gg,{style:r,type:i,CustomComponent:a,isValid:m})})})}const Gg=({style:t,type:r=li.Bezier,CustomComponent:i,isValid:a})=>{const{inProgress:u,from:f,fromNode:d,fromHandle:m,fromPosition:v,to:w,toNode:b,toHandle:x,toPosition:S,pointer:N}=QS();if(!u)return;if(i)return C.jsx(i,{connectionLineType:r,connectionLineStyle:t,fromNode:d,fromHandle:m,fromX:f.x,fromY:f.y,toX:w.x,toY:w.y,fromPosition:v,toPosition:S,connectionStatus:Ym(a),toNode:b,toHandle:x,pointer:N});let P="";const $={sourceX:f.x,sourceY:f.y,sourcePosition:v,targetX:w.x,targetY:w.y,targetPosition:S};switch(r){case li.Bezier:[P]=sg($);break;case li.SimpleBezier:[P]=zg($);break;case li.Step:[P]=Pf({...$,borderRadius:0});break;case li.SmoothStep:[P]=Pf($);break;default:[P]=ug($)}return C.jsx("path",{d:P,fill:"none",className:"react-flow__connection-path",style:t})};Gg.displayName="ConnectionLine";const JS={};function rm(t=JS){ce.useRef(t),Tt(),ce.useEffect(()=>{},[t])}function eb(){Tt(),ce.useRef(!1),ce.useEffect(()=>{},[])}function Zg({nodeTypes:t,edgeTypes:r,onInit:i,onNodeClick:a,onEdgeClick:u,onNodeDoubleClick:f,onEdgeDoubleClick:d,onNodeMouseEnter:m,onNodeMouseMove:v,onNodeMouseLeave:w,onNodeContextMenu:b,onSelectionContextMenu:x,onSelectionStart:S,onSelectionEnd:N,connectionLineType:P,connectionLineStyle:$,connectionLineComponent:M,connectionLineContainerStyle:I,selectionKeyCode:H,selectionOnDrag:j,selectionMode:R,multiSelectionKeyCode:W,panActivationKeyCode:V,zoomActivationKeyCode:q,deleteKeyCode:pe,onlyRenderVisibleElements:he,elementsSelectable:_e,defaultViewport:Q,translateExtent:le,minZoom:xe,maxZoom:z,preventScrolling:ue,defaultMarkerColor:te,zoomOnScroll:ae,zoomOnPinch:L,panOnScroll:F,panOnScrollSpeed:X,panOnScrollMode:O,zoomOnDoubleClick:B,panOnDrag:ke,onPaneClick:Se,onPaneMouseEnter:Ie,onPaneMouseMove:Re,onPaneMouseLeave:Ae,onPaneScroll:we,onPaneContextMenu:Fe,paneClickDistance:be,nodeClickDistance:Je,onEdgeContextMenu:Be,onEdgeMouseEnter:Ye,onEdgeMouseMove:ut,onEdgeMouseLeave:st,reconnectRadius:ct,onReconnect:ht,onReconnectStart:xn,onReconnectEnd:Lt,noDragClassName:Ft,noWheelClassName:bt,noPanClassName:Pn,disableKeyboardA11y:cn,nodeExtent:gr,rfId:wn,viewport:Et,onViewportChange:Ht}){return rm(t),rm(r),eb(),US(i),WS(Et),C.jsx(mS,{onPaneClick:Se,onPaneMouseEnter:Ie,onPaneMouseMove:Re,onPaneMouseLeave:Ae,onPaneContextMenu:Fe,onPaneScroll:we,paneClickDistance:be,deleteKeyCode:pe,selectionKeyCode:H,selectionOnDrag:j,selectionMode:R,onSelectionStart:S,onSelectionEnd:N,multiSelectionKeyCode:W,panActivationKeyCode:V,zoomActivationKeyCode:q,elementsSelectable:_e,zoomOnScroll:ae,zoomOnPinch:L,zoomOnDoubleClick:B,panOnScroll:F,panOnScrollSpeed:X,panOnScrollMode:O,panOnDrag:ke,defaultViewport:Q,translateExtent:le,minZoom:xe,maxZoom:z,onSelectionContextMenu:x,preventScrolling:ue,noDragClassName:Ft,noWheelClassName:bt,noPanClassName:Pn,disableKeyboardA11y:cn,onViewportChange:Ht,isControlledViewport:!!Et,children:C.jsxs(KS,{children:[C.jsx(HS,{edgeTypes:r,onEdgeClick:u,onEdgeDoubleClick:d,onReconnect:ht,onReconnectStart:xn,onReconnectEnd:Lt,onlyRenderVisibleElements:he,onEdgeContextMenu:Be,onEdgeMouseEnter:Ye,onEdgeMouseMove:ut,onEdgeMouseLeave:st,reconnectRadius:ct,defaultMarkerColor:te,noPanClassName:Pn,disableKeyboardA11y:cn,rfId:wn}),C.jsx(ZS,{style:$,type:P,component:M,containerStyle:I}),C.jsx("div",{className:"react-flow__edgelabel-renderer"}),C.jsx(kS,{nodeTypes:t,onNodeClick:a,onNodeDoubleClick:f,onNodeMouseEnter:m,onNodeMouseMove:v,onNodeMouseLeave:w,onNodeContextMenu:b,nodeClickDistance:Je,onlyRenderVisibleElements:he,noPanClassName:Pn,noDragClassName:Ft,disableKeyboardA11y:cn,nodeExtent:gr,rfId:wn}),C.jsx("div",{className:"react-flow__viewport-portal"})]})})}Zg.displayName="GraphView";const tb=ce.memo(Zg),om=({nodes:t,edges:r,defaultNodes:i,defaultEdges:a,width:u,height:f,fitView:d,fitViewOptions:m,minZoom:v=.5,maxZoom:w=2,nodeOrigin:b,nodeExtent:x,zIndexMode:S="basic"}={})=>{const N=new Map,P=new Map,$=new Map,M=new Map,I=a??r??[],H=i??t??[],j=b??[0,0],R=x??Pa;dg($,M,I);const{nodesInitialized:W}=Tf(H,N,P,{nodeOrigin:j,nodeExtent:R,zIndexMode:S});let V=[0,0,1];if(d&&u&&f){const q=Da(N,{filter:Q=>!!((Q.width||Q.initialWidth)&&(Q.height||Q.initialHeight))}),{x:pe,y:he,zoom:_e}=Kf(q,u,f,v,w,(m==null?void 0:m.padding)??.1);V=[pe,he,_e]}return{rfId:"1",width:u??0,height:f??0,transform:V,nodes:H,nodesInitialized:W,nodeLookup:N,parentLookup:P,edges:I,edgeLookup:M,connectionLookup:$,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:i!==void 0,hasDefaultEdges:a!==void 0,panZoom:null,minZoom:v,maxZoom:w,translateExtent:Pa,nodeExtent:R,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Ms.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:j,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:d??!1,fitViewOptions:m,fitViewResolver:null,connection:{...Wm},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:v1,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:qm,zIndexMode:S,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},nb=({nodes:t,edges:r,defaultNodes:i,defaultEdges:a,width:u,height:f,fitView:d,fitViewOptions:m,minZoom:v,maxZoom:w,nodeOrigin:b,nodeExtent:x,zIndexMode:S})=>__((N,P)=>{async function $(){const{nodeLookup:M,panZoom:I,fitViewOptions:H,fitViewResolver:j,width:R,height:W,minZoom:V,maxZoom:q}=P();I&&(await g1({nodes:M,width:R,height:W,panZoom:I,minZoom:V,maxZoom:q},H),j==null||j.resolve(!0),N({fitViewResolver:null}))}return{...om({nodes:t,edges:r,width:u,height:f,fitView:d,fitViewOptions:m,minZoom:v,maxZoom:w,nodeOrigin:b,nodeExtent:x,defaultNodes:i,defaultEdges:a,zIndexMode:S}),setNodes:M=>{const{nodeLookup:I,parentLookup:H,nodeOrigin:j,elevateNodesOnSelect:R,fitViewQueued:W,zIndexMode:V,nodesSelectionActive:q}=P(),{nodesInitialized:pe,hasSelectedNodes:he}=Tf(M,I,H,{nodeOrigin:j,nodeExtent:x,elevateNodesOnSelect:R,checkEquality:!0,zIndexMode:V}),_e=q&&he;W&&pe?($(),N({nodes:M,nodesInitialized:pe,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:_e})):N({nodes:M,nodesInitialized:pe,nodesSelectionActive:_e})},setEdges:M=>{const{connectionLookup:I,edgeLookup:H}=P();dg(I,H,M),N({edges:M})},setDefaultNodesAndEdges:(M,I)=>{if(M){const{setNodes:H}=P();H(M),N({hasDefaultNodes:!0})}if(I){const{setEdges:H}=P();H(I),N({hasDefaultEdges:!0})}},updateNodeInternals:M=>{const{triggerNodeChanges:I,nodeLookup:H,parentLookup:j,domNode:R,nodeOrigin:W,nodeExtent:V,debug:q,fitViewQueued:pe,zIndexMode:he}=P(),{changes:_e,updatedInternals:Q}=L1(M,H,j,R,W,V,he);Q&&(O1(H,j,{nodeOrigin:W,nodeExtent:V,zIndexMode:he}),pe?($(),N({fitViewQueued:!1,fitViewOptions:void 0})):N({}),(_e==null?void 0:_e.length)>0&&(q&&console.log("React Flow: trigger node changes",_e),I==null||I(_e)))},updateNodePositions:(M,I=!1)=>{const H=[];let j=[];const{nodeLookup:R,triggerNodeChanges:W,connection:V,updateConnection:q,onNodesChangeMiddlewareMap:pe}=P();for(const[he,_e]of M){const Q=R.get(he),le=!!(Q!=null&&Q.expandParent&&(Q!=null&&Q.parentId)&&(_e!=null&&_e.position)),xe={id:he,type:"position",position:le?{x:Math.max(0,_e.position.x),y:Math.max(0,_e.position.y)}:_e.position,dragging:I};if(Q&&V.inProgress&&V.fromNode.id===Q.id){const z=Fi(Q,V.fromHandle,Ze.Left,!0);q({...V,from:z})}le&&Q.parentId&&H.push({id:he,parentId:Q.parentId,rect:{..._e.internals.positionAbsolute,width:_e.measured.width??0,height:_e.measured.height??0}}),j.push(xe)}if(H.length>0){const{parentLookup:he,nodeOrigin:_e}=P(),Q=Qf(H,R,he,_e);j.push(...Q)}for(const he of pe.values())j=he(j);W(j)},triggerNodeChanges:M=>{const{onNodesChange:I,setNodes:H,nodes:j,hasDefaultNodes:R,debug:W}=P();if(M!=null&&M.length){if(R){const V=Cg(M,j);H(V)}W&&console.log("React Flow: trigger node changes",M),I==null||I(M)}},triggerEdgeChanges:M=>{const{onEdgesChange:I,setEdges:H,edges:j,hasDefaultEdges:R,debug:W}=P();if(M!=null&&M.length){if(R){const V=Pg(M,j);H(V)}W&&console.log("React Flow: trigger edge changes",M),I==null||I(M)}},addSelectedNodes:M=>{const{multiSelectionActive:I,edgeLookup:H,nodeLookup:j,triggerNodeChanges:R,triggerEdgeChanges:W}=P();if(I){const V=M.map(q=>Ai(q,!0));R(V);return}R(Ns(j,new Set([...M]),!0)),W(Ns(H))},addSelectedEdges:M=>{const{multiSelectionActive:I,edgeLookup:H,nodeLookup:j,triggerNodeChanges:R,triggerEdgeChanges:W}=P();if(I){const V=M.map(q=>Ai(q,!0));W(V);return}W(Ns(H,new Set([...M]))),R(Ns(j,new Set,!0))},unselectNodesAndEdges:({nodes:M,edges:I}={})=>{const{edges:H,nodes:j,nodeLookup:R,triggerNodeChanges:W,triggerEdgeChanges:V}=P(),q=M||j,pe=I||H,he=[];for(const Q of q){if(!Q.selected)continue;const le=R.get(Q.id);le&&(le.selected=!1),he.push(Ai(Q.id,!1))}const _e=[];for(const Q of pe)Q.selected&&_e.push(Ai(Q.id,!1));W(he),V(_e)},setMinZoom:M=>{const{panZoom:I,maxZoom:H}=P();I==null||I.setScaleExtent([M,H]),N({minZoom:M})},setMaxZoom:M=>{const{panZoom:I,minZoom:H}=P();I==null||I.setScaleExtent([H,M]),N({maxZoom:M})},setTranslateExtent:M=>{var I;(I=P().panZoom)==null||I.setTranslateExtent(M),N({translateExtent:M})},resetSelectedElements:()=>{const{edges:M,nodes:I,triggerNodeChanges:H,triggerEdgeChanges:j,elementsSelectable:R}=P();if(!R)return;const W=I.reduce((q,pe)=>pe.selected?[...q,Ai(pe.id,!1)]:q,[]),V=M.reduce((q,pe)=>pe.selected?[...q,Ai(pe.id,!1)]:q,[]);H(W),j(V)},setNodeExtent:M=>{const{nodes:I,nodeLookup:H,parentLookup:j,nodeOrigin:R,elevateNodesOnSelect:W,nodeExtent:V,zIndexMode:q}=P();M[0][0]===V[0][0]&&M[0][1]===V[0][1]&&M[1][0]===V[1][0]&&M[1][1]===V[1][1]||(Tf(I,H,j,{nodeOrigin:R,nodeExtent:M,elevateNodesOnSelect:W,checkEquality:!1,zIndexMode:q}),N({nodeExtent:M}))},panBy:M=>{const{transform:I,width:H,height:j,panZoom:R,translateExtent:W}=P();return F1({delta:M,panZoom:R,transform:I,translateExtent:W,width:H,height:j})},setCenter:async(M,I,H)=>{const{width:j,height:R,maxZoom:W,panZoom:V}=P();if(!V)return Promise.resolve(!1);const q=typeof(H==null?void 0:H.zoom)<"u"?H.zoom:W;return await V.setViewport({x:j/2-M*q,y:R/2-I*q,zoom:q},{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:{...Wm}})},updateConnection:M=>{N({connection:M})},reset:()=>N({...om()})}},Object.is);function rb({initialNodes:t,initialEdges:r,defaultNodes:i,defaultEdges:a,initialWidth:u,initialHeight:f,initialMinZoom:d,initialMaxZoom:m,initialFitViewOptions:v,fitView:w,nodeOrigin:b,nodeExtent:x,zIndexMode:S,children:N}){const[P]=ce.useState(()=>nb({nodes:t,edges:r,defaultNodes:i,defaultEdges:a,width:u,height:f,fitView:w,minZoom:d,maxZoom:m,fitViewOptions:v,nodeOrigin:b,nodeExtent:x,zIndexMode:S}));return C.jsx(S_,{value:P,children:C.jsx(K_,{children:N})})}function ob({children:t,nodes:r,edges:i,defaultNodes:a,defaultEdges:u,width:f,height:d,fitView:m,fitViewOptions:v,minZoom:w,maxZoom:b,nodeOrigin:x,nodeExtent:S,zIndexMode:N}){return ce.useContext(Tu)?C.jsx(C.Fragment,{children:t}):C.jsx(rb,{initialNodes:r,initialEdges:i,defaultNodes:a,defaultEdges:u,initialWidth:f,initialHeight:d,fitView:m,initialFitViewOptions:v,initialMinZoom:w,initialMaxZoom:b,nodeOrigin:x,nodeExtent:S,zIndexMode:N,children:t})}const ib={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function sb({nodes:t,edges:r,defaultNodes:i,defaultEdges:a,className:u,nodeTypes:f,edgeTypes:d,onNodeClick:m,onEdgeClick:v,onInit:w,onMove:b,onMoveStart:x,onMoveEnd:S,onConnect:N,onConnectStart:P,onConnectEnd:$,onClickConnectStart:M,onClickConnectEnd:I,onNodeMouseEnter:H,onNodeMouseMove:j,onNodeMouseLeave:R,onNodeContextMenu:W,onNodeDoubleClick:V,onNodeDragStart:q,onNodeDrag:pe,onNodeDragStop:he,onNodesDelete:_e,onEdgesDelete:Q,onDelete:le,onSelectionChange:xe,onSelectionDragStart:z,onSelectionDrag:ue,onSelectionDragStop:te,onSelectionContextMenu:ae,onSelectionStart:L,onSelectionEnd:F,onBeforeDelete:X,connectionMode:O,connectionLineType:B=li.Bezier,connectionLineStyle:ke,connectionLineComponent:Se,connectionLineContainerStyle:Ie,deleteKeyCode:Re="Backspace",selectionKeyCode:Ae="Shift",selectionOnDrag:we=!1,selectionMode:Fe=ja.Full,panActivationKeyCode:be="Space",multiSelectionKeyCode:Je=Ma()?"Meta":"Control",zoomActivationKeyCode:Be=Ma()?"Meta":"Control",snapToGrid:Ye,snapGrid:ut,onlyRenderVisibleElements:st=!1,selectNodesOnDrag:ct,nodesDraggable:ht,autoPanOnNodeFocus:xn,nodesConnectable:Lt,nodesFocusable:Ft,nodeOrigin:bt=Eg,edgesFocusable:Pn,edgesReconnectable:cn,elementsSelectable:gr=!0,defaultViewport:wn=O_,minZoom:Et=.5,maxZoom:Ht=2,translateExtent:Hn=Pa,preventScrolling:tr=!0,nodeExtent:_n,defaultMarkerColor:jn="#b1b1b7",zoomOnScroll:Vn=!0,zoomOnPinch:fn=!0,panOnScroll:nr=!1,panOnScrollSpeed:Sn=.5,panOnScrollMode:qe=Ri.Free,zoomOnDoubleClick:Kn=!0,panOnDrag:bn=!0,onPaneClick:rr,onPaneMouseEnter:He,onPaneMouseMove:Tn,onPaneMouseLeave:Un,onPaneScroll:Or,onPaneContextMenu:Jr,paneClickDistance:Rr=1,nodeClickDistance:Io=0,children:eo,onReconnect:kn,onReconnectStart:Mn,onReconnectEnd:K,onEdgeContextMenu:ze,onEdgeDoubleClick:Le,onEdgeMouseEnter:et,onEdgeMouseMove:Wt,onEdgeMouseLeave:Yt,reconnectRadius:Vt=10,onNodesChange:nn,onEdgesChange:to,noDragClassName:rn="nodrag",noWheelClassName:qn="nowheel",noPanClassName:Dt="nopan",fitView:Wn,fitViewOptions:or,connectOnClick:In,attributionPosition:ui,proOptions:ir,defaultEdgeOptions:ci,elevateNodesOnSelect:Ao=!0,elevateEdgesOnSelect:Nt=!1,disableKeyboardA11y:sr=!1,autoPanOnConnect:yt,autoPanOnNodeDrag:Bi,autoPanSpeed:Dr,connectionRadius:$o,isValidConnection:zr,onError:yr,style:fi,id:ar,nodeDragThreshold:En,connectionDragThreshold:ft,viewport:dn,onViewportChange:Hi,width:Oo,height:no,colorMode:ro="light",debug:oo,onScroll:Yn,ariaLabelConfig:vt,zIndexMode:Lr="basic",...io},lr){const Fr=ar||"1",so=L_(ro),ur=ce.useCallback(di=>{di.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Yn==null||Yn(di)},[Yn]);return C.jsx("div",{"data-testid":"rf__wrapper",...io,onScroll:ur,style:{...fi,...ib},ref:lr,className:qt(["react-flow",u,so]),id:ar,role:"application",children:C.jsxs(ob,{nodes:t,edges:r,width:Oo,height:no,fitView:Wn,fitViewOptions:or,minZoom:Et,maxZoom:Ht,nodeOrigin:bt,nodeExtent:_n,zIndexMode:Lr,children:[C.jsx(z_,{nodes:t,edges:r,defaultNodes:i,defaultEdges:a,onConnect:N,onConnectStart:P,onConnectEnd:$,onClickConnectStart:M,onClickConnectEnd:I,nodesDraggable:ht,autoPanOnNodeFocus:xn,nodesConnectable:Lt,nodesFocusable:Ft,edgesFocusable:Pn,edgesReconnectable:cn,elementsSelectable:gr,elevateNodesOnSelect:Ao,elevateEdgesOnSelect:Nt,minZoom:Et,maxZoom:Ht,nodeExtent:_n,onNodesChange:nn,onEdgesChange:to,snapToGrid:Ye,snapGrid:ut,connectionMode:O,translateExtent:Hn,connectOnClick:In,defaultEdgeOptions:ci,fitView:Wn,fitViewOptions:or,onNodesDelete:_e,onEdgesDelete:Q,onDelete:le,onNodeDragStart:q,onNodeDrag:pe,onNodeDragStop:he,onSelectionDrag:ue,onSelectionDragStart:z,onSelectionDragStop:te,onMove:b,onMoveStart:x,onMoveEnd:S,noPanClassName:Dt,nodeOrigin:bt,rfId:Fr,autoPanOnConnect:yt,autoPanOnNodeDrag:Bi,autoPanSpeed:Dr,onError:yr,connectionRadius:$o,isValidConnection:zr,selectNodesOnDrag:ct,nodeDragThreshold:En,connectionDragThreshold:ft,onBeforeDelete:X,debug:oo,ariaLabelConfig:vt,zIndexMode:Lr}),C.jsx(tb,{onInit:w,onNodeClick:m,onEdgeClick:v,onNodeMouseEnter:H,onNodeMouseMove:j,onNodeMouseLeave:R,onNodeContextMenu:W,onNodeDoubleClick:V,nodeTypes:f,edgeTypes:d,connectionLineType:B,connectionLineStyle:ke,connectionLineComponent:Se,connectionLineContainerStyle:Ie,selectionKeyCode:Ae,selectionOnDrag:we,selectionMode:Fe,deleteKeyCode:Re,multiSelectionKeyCode:Je,panActivationKeyCode:be,zoomActivationKeyCode:Be,onlyRenderVisibleElements:st,defaultViewport:wn,translateExtent:Hn,minZoom:Et,maxZoom:Ht,preventScrolling:tr,zoomOnScroll:Vn,zoomOnPinch:fn,zoomOnDoubleClick:Kn,panOnScroll:nr,panOnScrollSpeed:Sn,panOnScrollMode:qe,panOnDrag:bn,onPaneClick:rr,onPaneMouseEnter:He,onPaneMouseMove:Tn,onPaneMouseLeave:Un,onPaneScroll:Or,onPaneContextMenu:Jr,paneClickDistance:Rr,nodeClickDistance:Io,onSelectionContextMenu:ae,onSelectionStart:L,onSelectionEnd:F,onReconnect:kn,onReconnectStart:Mn,onReconnectEnd:K,onEdgeContextMenu:ze,onEdgeDoubleClick:Le,onEdgeMouseEnter:et,onEdgeMouseMove:Wt,onEdgeMouseLeave:Yt,reconnectRadius:Vt,defaultMarkerColor:jn,noDragClassName:rn,noWheelClassName:qn,noPanClassName:Dt,rfId:Fr,disableKeyboardA11y:sr,nodeExtent:_n,viewport:dn,onViewportChange:Hi}),C.jsx($_,{onSelectionChange:xe}),eo,C.jsx(j_,{proOptions:ir,position:ui}),C.jsx(P_,{rfId:Fr,disableKeyboardA11y:sr})]})})}var ab=jg(sb);function lb(){const t=Tt();return ce.useCallback(r=>{const{domNode:i,updateNodeInternals:a}=t.getState(),u=Array.isArray(r)?r:[r],f=new Map;u.forEach(d=>{const m=i==null?void 0:i.querySelector(`.react-flow__node[data-id="${d}"]`);m&&f.set(d,{id:d,nodeElement:m,force:!0})}),requestAnimationFrame(()=>a(f,{triggerFitView:!1}))},[])}function ub(t){const[r,i]=ce.useState(t),a=ce.useCallback(u=>i(f=>Cg(u,f)),[]);return[r,i,a]}function cb(t){const[r,i]=ce.useState(t),a=ce.useCallback(u=>i(f=>Pg(u,f)),[]);return[r,i,a]}function fb({dimensions:t,lineWidth:r,variant:i,className:a}){return C.jsx("path",{strokeWidth:r,d:`M${t[0]/2} 0 V${t[1]} M0 ${t[1]/2} H${t[0]}`,className:qt(["react-flow__background-pattern",i,a])})}function db({radius:t,className:r}){return C.jsx("circle",{cx:t,cy:t,r:t,className:qt(["react-flow__background-pattern","dots",r])})}var jo;(function(t){t.Lines="lines",t.Dots="dots",t.Cross="cross"})(jo||(jo={}));const pb={[jo.Dots]:1,[jo.Lines]:1,[jo.Cross]:6},hb=t=>({transform:t.transform,patternId:`pattern-${t.rfId}`});function Jg({id:t,variant:r=jo.Dots,gap:i=20,size:a,lineWidth:u=1,offset:f=0,color:d,bgColor:m,style:v,className:w,patternClassName:b}){const x=ce.useRef(null),{transform:S,patternId:N}=gt(hb,At),P=a||pb[r],$=r===jo.Dots,M=r===jo.Cross,I=Array.isArray(i)?i:[i,i],H=[I[0]*S[2]||1,I[1]*S[2]||1],j=P*S[2],R=Array.isArray(f)?f:[f,f],W=M?[j,j]:H,V=[R[0]*S[2]||1+W[0]/2,R[1]*S[2]||1+W[1]/2],q=`${N}${t||""}`;return C.jsxs("svg",{className:qt(["react-flow__background",w]),style:{...v,...Mu,"--xy-background-color-props":m,"--xy-background-pattern-color-props":d},ref:x,"data-testid":"rf__background",children:[C.jsx("pattern",{id:q,x:S[0]%H[0],y:S[1]%H[1],width:H[0],height:H[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${V[0]},-${V[1]})`,children:$?C.jsx(db,{radius:j/2,className:b}):C.jsx(fb,{dimensions:W,lineWidth:u,variant:r,className:b})}),C.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${q})`})]})}Jg.displayName="Background";const mb=ce.memo(Jg);function gb(){return C.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:C.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function yb(){return C.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:C.jsx("path",{d:"M0 0h32v4.2H0z"})})}function vb(){return C.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:C.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 xb(){return C.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:C.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 wb(){return C.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:C.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 Zl({children:t,className:r,...i}){return C.jsx("button",{type:"button",className:qt(["react-flow__controls-button",r]),...i,children:t})}const _b=t=>({isInteractive:t.nodesDraggable||t.nodesConnectable||t.elementsSelectable,minZoomReached:t.transform[2]<=t.minZoom,maxZoomReached:t.transform[2]>=t.maxZoom,ariaLabelConfig:t.ariaLabelConfig});function ey({style:t,showZoom:r=!0,showFitView:i=!0,showInteractive:a=!0,fitViewOptions:u,onZoomIn:f,onZoomOut:d,onFitView:m,onInteractiveChange:v,className:w,children:b,position:x="bottom-left",orientation:S="vertical","aria-label":N}){const P=Tt(),{isInteractive:$,minZoomReached:M,maxZoomReached:I,ariaLabelConfig:H}=gt(_b,At),{zoomIn:j,zoomOut:R,fitView:W}=Gf(),V=()=>{j(),f==null||f()},q=()=>{R(),d==null||d()},pe=()=>{W(u),m==null||m()},he=()=>{P.setState({nodesDraggable:!$,nodesConnectable:!$,elementsSelectable:!$}),v==null||v(!$)},_e=S==="horizontal"?"horizontal":"vertical";return C.jsxs(Fa,{className:qt(["react-flow__controls",_e,w]),position:x,style:t,"data-testid":"rf__controls","aria-label":N??H["controls.ariaLabel"],children:[r&&C.jsxs(C.Fragment,{children:[C.jsx(Zl,{onClick:V,className:"react-flow__controls-zoomin",title:H["controls.zoomIn.ariaLabel"],"aria-label":H["controls.zoomIn.ariaLabel"],disabled:I,children:C.jsx(gb,{})}),C.jsx(Zl,{onClick:q,className:"react-flow__controls-zoomout",title:H["controls.zoomOut.ariaLabel"],"aria-label":H["controls.zoomOut.ariaLabel"],disabled:M,children:C.jsx(yb,{})})]}),i&&C.jsx(Zl,{className:"react-flow__controls-fitview",onClick:pe,title:H["controls.fitView.ariaLabel"],"aria-label":H["controls.fitView.ariaLabel"],children:C.jsx(vb,{})}),a&&C.jsx(Zl,{className:"react-flow__controls-interactive",onClick:he,title:H["controls.interactive.ariaLabel"],"aria-label":H["controls.interactive.ariaLabel"],children:$?C.jsx(wb,{}):C.jsx(xb,{})}),b]})}ey.displayName="Controls";const Sb=ce.memo(ey);function bb({id:t,x:r,y:i,width:a,height:u,style:f,color:d,strokeColor:m,strokeWidth:v,className:w,borderRadius:b,shapeRendering:x,selected:S,onClick:N}){const{background:P,backgroundColor:$}=f||{},M=d||P||$;return C.jsx("rect",{className:qt(["react-flow__minimap-node",{selected:S},w]),x:r,y:i,rx:b,ry:b,width:a,height:u,style:{fill:M,stroke:m,strokeWidth:v},shapeRendering:x,onClick:N?I=>N(I,t):void 0})}const kb=ce.memo(bb),Eb=t=>t.nodes.map(r=>r.id),pf=t=>t instanceof Function?t:()=>t;function Nb({nodeStrokeColor:t,nodeColor:r,nodeClassName:i="",nodeBorderRadius:a=5,nodeStrokeWidth:u,nodeComponent:f=kb,onClick:d}){const m=gt(Eb,At),v=pf(r),w=pf(t),b=pf(i),x=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return C.jsx(C.Fragment,{children:m.map(S=>C.jsx(Pb,{id:S,nodeColorFunc:v,nodeStrokeColorFunc:w,nodeClassNameFunc:b,nodeBorderRadius:a,nodeStrokeWidth:u,NodeComponent:f,onClick:d,shapeRendering:x},S))})}function Cb({id:t,nodeColorFunc:r,nodeStrokeColorFunc:i,nodeClassNameFunc:a,nodeBorderRadius:u,nodeStrokeWidth:f,shapeRendering:d,NodeComponent:m,onClick:v}){const{node:w,x:b,y:x,width:S,height:N}=gt(P=>{const $=P.nodeLookup.get(t);if(!$)return{node:void 0,x:0,y:0,width:0,height:0};const M=$.internals.userNode,{x:I,y:H}=$.internals.positionAbsolute,{width:j,height:R}=Mo(M);return{node:M,x:I,y:H,width:j,height:R}},At);return!w||w.hidden||!eg(w)?null:C.jsx(m,{x:b,y:x,width:S,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 Pb=ce.memo(Cb);var jb=ce.memo(Nb);const Tb=200,Mb=150,Ib=t=>!t.hidden,Ab=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?Jm(Da(t.nodeLookup,{filter:Ib}),r):r,rfId:t.rfId,panZoom:t.panZoom,translateExtent:t.translateExtent,flowWidth:t.width,flowHeight:t.height,ariaLabelConfig:t.ariaLabelConfig}},$b="react-flow__minimap-desc";function ty({style:t,className:r,nodeStrokeColor:i,nodeColor:a,nodeClassName:u="",nodeBorderRadius:f=5,nodeStrokeWidth:d,nodeComponent:m,bgColor:v,maskColor:w,maskStrokeColor:b,maskStrokeWidth:x,position:S="bottom-right",onClick:N,onNodeClick:P,pannable:$=!1,zoomable:M=!1,ariaLabel:I,inversePan:H,zoomStep:j=1,offsetScale:R=5}){const W=Tt(),V=ce.useRef(null),{boundingRect:q,viewBB:pe,rfId:he,panZoom:_e,translateExtent:Q,flowWidth:le,flowHeight:xe,ariaLabelConfig:z}=gt(Ab,At),ue=(t==null?void 0:t.width)??Tb,te=(t==null?void 0:t.height)??Mb,ae=q.width/ue,L=q.height/te,F=Math.max(ae,L),X=F*ue,O=F*te,B=R*F,ke=q.x-(X-q.width)/2-B,Se=q.y-(O-q.height)/2-B,Ie=X+B*2,Re=O+B*2,Ae=`${$b}-${he}`,we=ce.useRef(0),Fe=ce.useRef();we.current=F,ce.useEffect(()=>{if(V.current&&_e)return Fe.current=X1({domNode:V.current,panZoom:_e,getTransform:()=>W.getState().transform,getViewScale:()=>we.current}),()=>{var Ye;(Ye=Fe.current)==null||Ye.destroy()}},[_e]),ce.useEffect(()=>{var Ye;(Ye=Fe.current)==null||Ye.update({translateExtent:Q,width:le,height:xe,inversePan:H,pannable:$,zoomStep:j,zoomable:M})},[$,M,H,j,Q,le,xe]);const be=N?Ye=>{var ct;const[ut,st]=((ct=Fe.current)==null?void 0:ct.pointer(Ye))||[0,0];N(Ye,{x:ut,y:st})}:void 0,Je=P?ce.useCallback((Ye,ut)=>{const st=W.getState().nodeLookup.get(ut).internals.userNode;P(Ye,st)},[]):void 0,Be=I??z["minimap.ariaLabel"];return C.jsx(Fa,{position:S,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 b=="string"?b: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:qt(["react-flow__minimap",r]),"data-testid":"rf__minimap",children:C.jsxs("svg",{width:ue,height:te,viewBox:`${ke} ${Se} ${Ie} ${Re}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":Ae,ref:V,onClick:be,children:[Be&&C.jsx("title",{id:Ae,children:Be}),C.jsx(jb,{onClick:Je,nodeColor:a,nodeStrokeColor:i,nodeBorderRadius:f,nodeClassName:u,nodeStrokeWidth:d,nodeComponent:m}),C.jsx("path",{className:"react-flow__minimap-mask",d:`M${ke-B},${Se-B}h${Ie+B*2}v${Re+B*2}h${-Ie-B*2}z
202
+ M${pe.x},${pe.y}h${pe.width}v${pe.height}h${-pe.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}ty.displayName="MiniMap";const Ob=ce.memo(ty),Rb=t=>r=>t?`${Math.max(1/r.transform[2],1)}`:void 0,Db={[Os.Line]:"right",[Os.Handle]:"bottom-right"};function zb({nodeId:t,position:r,variant:i=Os.Handle,className:a,style:u=void 0,children:f,color:d,minWidth:m=10,minHeight:v=10,maxWidth:w=Number.MAX_VALUE,maxHeight:b=Number.MAX_VALUE,keepAspectRatio:x=!1,resizeDirection:S,autoScale:N=!0,shouldResize:P,onResizeStart:$,onResize:M,onResizeEnd:I}){const H=Ag(),j=typeof t=="string"?t:H,R=Tt(),W=ce.useRef(null),V=i===Os.Handle,q=gt(ce.useCallback(Rb(V&&N),[V,N]),At),pe=ce.useRef(null),he=r??Db[i];ce.useEffect(()=>{if(!(!W.current||!j))return pe.current||(pe.current=u_({domNode:W.current,nodeId:j,getStoreItems:()=>{const{nodeLookup:Q,transform:le,snapGrid:xe,snapToGrid:z,nodeOrigin:ue,domNode:te}=R.getState();return{nodeLookup:Q,transform:le,snapGrid:xe,snapToGrid:z,nodeOrigin:ue,paneDomNode:te}},onChange:(Q,le)=>{const{triggerNodeChanges:xe,nodeLookup:z,parentLookup:ue,nodeOrigin:te}=R.getState(),ae=[],L={x:Q.x,y:Q.y},F=z.get(j);if(F&&F.expandParent&&F.parentId){const X=F.origin??te,O=Q.width??F.measured.width??0,B=Q.height??F.measured.height??0,ke={id:F.id,parentId:F.parentId,rect:{width:O,height:B,...tg({x:Q.x??F.position.x,y:Q.y??F.position.y},{width:O,height:B},F.parentId,z,X)}},Se=Qf([ke],z,ue,te);ae.push(...Se),L.x=Q.x?Math.max(X[0]*O,Q.x):void 0,L.y=Q.y?Math.max(X[1]*B,Q.y):void 0}if(L.x!==void 0&&L.y!==void 0){const X={id:j,type:"position",position:{...L}};ae.push(X)}if(Q.width!==void 0&&Q.height!==void 0){const O={id:j,type:"dimensions",resizing:!0,setAttributes:S?S==="horizontal"?"width":"height":!0,dimensions:{width:Q.width,height:Q.height}};ae.push(O)}for(const X of le){const O={...X,type:"position"};ae.push(O)}xe(ae)},onEnd:({width:Q,height:le})=>{const xe={id:j,type:"dimensions",resizing:!1,dimensions:{width:Q,height:le}};R.getState().triggerNodeChanges([xe])}})),pe.current.update({controlPosition:he,boundaries:{minWidth:m,minHeight:v,maxWidth:w,maxHeight:b},keepAspectRatio:x,resizeDirection:S,onResizeStart:$,onResize:M,onResizeEnd:I,shouldResize:P}),()=>{var Q;(Q=pe.current)==null||Q.destroy()}},[he,m,v,w,b,x,$,M,I,P]);const _e=he.split("-");return C.jsx("div",{className:qt(["react-flow__resize-control","nodrag",..._e,i,a]),ref:W,style:{...u,scale:q,...d&&{[V?"backgroundColor":"borderColor"]:d}},children:f})}ce.memo(zb);function Jf(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 ed(t,r,i){var m,v,w,b;const a=r.toLowerCase(),u=(v=(m=t.paths)==null?void 0:m[i])==null?void 0:v[a];if(!(u!=null&&u.requestBody))return"— sin body";const d=(b=(w=u.requestBody.content)==null?void 0:w["application/json"])==null?void 0:b.schema;return d&&"$ref"in d?`body: ${d.$ref}`:"body: JSON"}function td(t,r,i){var m,v,w,b,x,S;const a=r.toLowerCase(),u=(v=(m=t.paths)==null?void 0:m[i])==null?void 0:v[a],f=((w=u==null?void 0:u.responses)==null?void 0:w["200"])??((b=u==null?void 0:u.responses)==null?void 0:b["201"]);if(!f)return"—";const d=typeof f=="object"&&f&&"content"in f?(S=(x=f.content)==null?void 0:x["application/json"])==null?void 0:S.schema:void 0;return d&&"$ref"in d?String(d.$ref):"JSON"}const iu=()=>({sourceJsonPath:"$",variableName:"v",useInTarget:"vars_only",targetKey:""});function hf(t,r){return`${t.toLowerCase()} ${r}`}function Lb(t){const r=t.indexOf(" ");return r===-1?{method:"get",path:"/"}:{method:t.slice(0,r),path:t.slice(r+1)}}const ny=ce.createContext(null);function Fb(t){const{id:r,selected:i}=t,a=t.data,u=ce.useContext(ny),f=lb();return ce.useEffect(()=>{f(r)},[a.path,a.method,r,f]),C.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:[C.jsx(Rs,{type:"target",position:Ze.Left,id:"in",className:"!h-3 !w-3 !border-2 !border-surface-900 !bg-teal-500"}),C.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[C.jsx("span",{className:"text-[10px] uppercase font-bold text-accent tracking-wide",children:a.method}),C.jsx("span",{className:"text-[10px] text-slate-500 truncate",title:a.summary,children:a.summary})]}),u?C.jsxs("label",{className:"block text-[10px] text-slate-500 mb-1",children:["Endpoint",C.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:hf(a.method,a.path),onChange:d=>{const{method:m,path:v}=Lb(d.target.value);u.updateNodeData(r,{method:m,path:v,summary:Jf(u.doc,m,v),reqHint:ed(u.doc,m,v),resHint:td(u.doc,m,v)})},children:u.ops.map(d=>C.jsxs("option",{value:hf(d.method,d.path),children:[d.method.toUpperCase()," ",d.path]},hf(d.method,d.path)))})]}):C.jsx("p",{className:"font-mono text-[11px] text-slate-300 truncate",children:a.path}),C.jsxs("div",{className:"mt-2 grid grid-cols-2 gap-1 text-[9px] text-slate-500 leading-tight",children:[C.jsxs("div",{children:[C.jsx("span",{className:"text-slate-600",children:"req"})," ",a.reqHint]}),C.jsxs("div",{children:[C.jsx("span",{className:"text-slate-600",children:"res"})," ",a.resHint]})]}),C.jsx(Rs,{type:"source",position:Ze.Right,id:"out",className:"!h-3 !w-3 !border-2 !border-surface-900 !bg-amber-500"})]})}const Bb={apiOp:Fb};function Hb(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:Jf(t,u.method,u.path),reqHint:ed(t,u.method,u.path),resHint:td(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 Vb(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)??iu()}})}}const Kb=[{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 Ub({doc:t,ops:r,graph:i,onGraphChange:a}){var j,R,W,V,q,pe,he,_e;const u=ce.useMemo(()=>Hb(t,i),[t,i]),[f,d,m]=ub(u.nodes),[v,w,b]=cb(u.edges),[x,S]=ce.useState(null);ce.useEffect(()=>{a(Vb(f,v))},[f,v,a]);const N=ce.useCallback((Q,le)=>{d(xe=>xe.map(z=>z.id===Q?{...z,data:{...z.data,...le}}:z))},[d]),P=ce.useMemo(()=>({doc:t,ops:r,updateNodeData:N}),[t,r,N]),$=ce.useCallback(Q=>{Q.sourceHandle!=="out"||Q.targetHandle!=="in"||w(le=>lg({...Q,id:`e-${Q.source}-${Q.target}-${crypto.randomUUID().slice(0,8)}`,sourceHandle:"out",targetHandle:"in",data:{mapping:iu()},label:iu().variableName,style:{stroke:"rgb(148 163 184 / 0.9)",strokeWidth:2}},le))},[w]),M=v.find(Q=>Q.id===x),I=Q=>{x&&w(le=>le.map(xe=>{var ue;if(xe.id!==x)return xe;const z={...((ue=xe.data)==null?void 0:ue.mapping)??iu(),...Q};return{...xe,data:{mapping:z},label:z.variableName}}))},H=()=>{const Q=f.reduce((ae,L)=>L.position.x>ae?L.position.x:ae,0),le=r[0];if(!le)return;const xe=crypto.randomUUID(),z=Q>0?Q+40:80,te={id:xe,type:"apiOp",position:{x:z,y:120},data:{method:le.method.toLowerCase(),path:le.path,summary:Jf(t,le.method,le.path),reqHint:ed(t,le.method,le.path),resHint:td(t,le.method,le.path)}};d(ae=>[...ae,te])};return C.jsx(ny.Provider,{value:P,children:C.jsxs("div",{className:"space-y-3",children:[C.jsx("div",{className:"h-[min(520px,70vh)] w-full rounded-xl border border-surface-700 bg-surface-950",children:C.jsxs(ab,{nodes:f,edges:v,onNodesChange:m,onEdgesChange:b,onConnect:$,nodeTypes:Bb,onEdgeClick:(Q,le)=>S(le.id),onPaneClick:()=>S(null),fitView:!0,minZoom:.4,maxZoom:1.5,proOptions:{hideAttribution:!0},isValidConnection:Q=>Q.sourceHandle==="out"&&Q.targetHandle==="in",children:[C.jsx(mb,{variant:jo.Dots,gap:16,size:1,color:"rgb(51 65 85 / 0.5)"}),C.jsx(Sb,{className:"!bg-surface-900 !border-surface-600 !shadow-lg"}),C.jsx(Ob,{className:"!bg-surface-900/95 !border-surface-600",nodeColor:()=>"rgb(45 212 191 / 0.5)"}),C.jsx(Fa,{position:"top-left",children:C.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)"})})]})}),C.jsxs("div",{className:"rounded-xl border border-surface-700 bg-surface-900/50 p-4 space-y-3",children:[C.jsx("h4",{className:"text-xs font-semibold text-slate-300",children:"Cable seleccionado (respuesta → request)"}),M?C.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3 text-xs",children:[C.jsxs("label",{className:"text-slate-500",children:["JSON path en la respuesta",C.jsx("input",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-2 py-1.5 font-mono",value:((j=M.data)==null?void 0:j.mapping.sourceJsonPath)??"$",onChange:Q=>I({sourceJsonPath:Q.target.value}),placeholder:"$.access_token"})]}),C.jsxs("label",{className:"text-slate-500",children:["Nombre de variable",C.jsx("input",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-2 py-1.5",value:((R=M.data)==null?void 0:R.mapping.variableName)??"",onChange:Q=>I({variableName:Q.target.value}),placeholder:"token"})]}),C.jsxs("label",{className:"text-slate-500 sm:col-span-2",children:["Cómo se usa en el request del nodo destino",C.jsx("select",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-2 py-1.5",value:((W=M.data)==null?void 0:W.mapping.useInTarget)??"vars_only",onChange:Q=>I({useInTarget:Q.target.value}),children:Kb.map(Q=>C.jsx("option",{value:Q.value,children:Q.label},Q.value))})]}),(((V=M.data)==null?void 0:V.mapping.useInTarget)==="path_param"||((q=M.data)==null?void 0:q.mapping.useInTarget)==="header"||((pe=M.data)==null?void 0:pe.mapping.useInTarget)==="query")&&C.jsxs("label",{className:"text-slate-500 sm:col-span-2",children:["Clave (nombre del param / header / query)",C.jsx("input",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-2 py-1.5 font-mono",value:((he=M.data)==null?void 0:he.mapping.targetKey)??"",onChange:Q=>I({targetKey:Q.target.value}),placeholder:"id / Authorization / q"})]}),C.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"," ",C.jsx("code",{className:"text-accent",children:"{clave}"}),", en un header, o en query. Con «solo variable», usa"," ",C.jsx("code",{className:"text-accent",children:"{"+(((_e=M.data)==null?void 0:_e.mapping.variableName)||"var")+"}"})," ","en la ruta del endpoint destino."]})]}):C.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 ry(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 m=[];for(;d.length;){const v=d.shift();m.push(v);for(const w of f.get(v)??[]){const b=(u.get(w)??0)-1;u.set(w,b),b===0&&(d.push(w),d.sort((x,S)=>i.get(x).x-i.get(S).x||i.get(x).y-i.get(S).y))}}if(m.length<t.length){const v=t.filter(w=>!m.includes(w.id)).sort((w,b)=>w.x-b.x||w.y-b.y);return[...m.map(w=>i.get(w)),...v]}return m.map(v=>i.get(v))}async function im(t,r,i){var v;const{nodes:a,edges:u}=t;if(a.length===0)return"Sin nodos en el flujo.";const f=ry(a,u),d={};let m="";for(let w=0;w<f.length;w++){const b=f[w];let x=b.path;const S={...i()},N=u.filter(W=>W.target===b.id);for(const W of N){const{mapping:V}=W,q=d[V.variableName];if(q!==void 0)switch(V.useInTarget){case"path_param":V.targetKey&&(x=x.split(`{${V.targetKey}}`).join(q));break;case"header":if(V.targetKey){const pe=V.targetKey;S[pe]=pe.toLowerCase()==="authorization"&&!q.startsWith("Bearer ")?`Bearer ${q}`:q}break;case"query":{const pe=x.includes("?")?"&":"?";x=`${x}${pe}${encodeURIComponent(V.targetKey)}=${encodeURIComponent(q)}`;break}case"vars_only":default:x=x.split(`{${V.variableName}}`).join(q);break}}for(const[W,V]of Object.entries(d))x=x.split(`{${W}}`).join(V);const P=`${r.replace(/\/$/,"")}${x}`,$={method:b.method.toUpperCase(),headers:S},M=b.method.toLowerCase();M!=="get"&&M!=="head"&&($.body="{}");const I=await fetch(P,{...$,credentials:"include"});let H={};const j=await I.text();try{H=j?JSON.parse(j):{}}catch{H={_raw:j}}m+=`▸ ${b.method.toUpperCase()} ${b.path} → ${I.status}
203
+ ${JSON.stringify(H,null,2)}
204
+
205
+ `;const R=u.filter(W=>W.source===b.id);for(const W of R){const V=((v=W.mapping.sourceJsonPath)==null?void 0:v.trim())||"$",q=$f(H,V);q!=null&&(d[W.mapping.variableName]=typeof q=="object"?JSON.stringify(q):String(q))}}return m+=`
206
+ Variables finales: ${JSON.stringify(d,null,2)}`,m}function qb(t){const r=ry(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 Wb(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 oy=ce.createContext({productName:null,logoDataUrl:null});function Yb({value:t,children:r}){return C.jsx(oy.Provider,{value:t,children:r})}function Xb(){return ce.useContext(oy)}const iy=[{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 sm(t){return iy.some(r=>r.value===t)}const mf=[{id:"typescript",label:"TypeScript"},{id:"javascript",label:"JavaScript"},{id:"python",label:"Python"},{id:"php",label:"PHP"}];function gf(t,r){return`${t.toLowerCase()} ${r}`}function Qb(t){const r=t.indexOf(" ");return r===-1?{method:"get",path:"/"}:{method:t.slice(0,r),path:t.slice(r+1)}}async function am(t){await navigator.clipboard.writeText(t)}function Gb(){var Mn;const t=Xb(),[r,i]=ce.useState(null),[a,u]=ce.useState(null),[f,d]=ce.useState("explore"),[m,v]=ce.useState(""),[w,b]=ce.useState(null),[x,S]=ce.useState(null),[N,P]=ce.useState("{}"),[$,M]=ce.useState(""),[I,H]=ce.useState("typescript"),[j,R]=ce.useState(""),[W,V]=ce.useState(""),[q,pe]=ce.useState("X-Api-Key"),[he,_e]=ce.useState({nodes:[],edges:[]}),[Q,le]=ce.useState(0),[xe,z]=ce.useState("Mi flujo"),[ue,te]=ce.useState([]),[ae,L]=ce.useState(""),[F,X]=ce.useState({name:"Suite 1",cases:[]}),[O,B]=ce.useState([]),[ke,Se]=ce.useState(""),[Ie,Re]=ce.useState(""),[Ae,we]=ce.useState(null),[Fe,be]=ce.useState(null),[Je,Be]=ce.useState(null),Ye="/docs/openapi.json",ut="/docs/preset.json",st=ce.useCallback(async()=>{const[K,ze]=await Promise.all([St.flows.toArray(),St.testSuites.toArray()]);te(K.sort((Le,et)=>(Le.name??"").localeCompare(et.name??""))),B(ze.sort((Le,et)=>(Le.name??"").localeCompare(et.name??"")))},[]);ce.useEffect(()=>{var ze,Le;if(!r)return;const K=((ze=t.productName)==null?void 0:ze.trim())||((Le=r.info.title)==null?void 0:Le.trim())||"API";document.title=K},[r,t.productName]),ce.useEffect(()=>{fetch(Ye,{credentials:"include"}).then(async K=>{if(K.status===401){let ze="/docs/__auth/login";try{const Le=await K.json();Le.loginPath&&(ze=Le.loginPath)}catch{}return window.location.href=ze,null}if(!K.ok)throw new Error(`${K.status} ${K.statusText}`);return K.json()}).then(K=>{K&&(i(K),v(Ss(K)),u(null))}).catch(K=>u(K.message))},[Ye]),ce.useEffect(()=>{(async()=>{try{const K=await fetch("/docs/__auth/session",{credentials:"include"});if(K.ok){const ze=await K.json();Be({username:ze.username})}else Be(null)}catch{Be(null)}})()},[]),ce.useEffect(()=>{if(!r)return;let K=!1;return(async()=>{try{const ze=await fetch(ut,{credentials:"include"});if(!ze.ok||K)return;const Le=await ze.json(),et=await M0(Le);!K&&et&&await st()}catch{}})(),()=>{K=!0}},[r,ut,st]),ce.useEffect(()=>{st(),St.kv.get("bearer").then(K=>K&&R(K.value)),St.kv.get("apiKey").then(K=>K&&V(K.value))},[st]);const ct=ce.useMemo(()=>r?k0(r):[],[r]),ht=ce.useMemo(()=>r?Gr(r):[],[r]),xn=ce.useMemo(()=>w?ht.filter(K=>(K.tags??["default"]).includes(w)):ht,[ht,w]);ce.useEffect(()=>{if(ht.length&&!Ie){const K=ht[0];Re(gf(K.method,K.path))}},[ht,Ie]),ce.useEffect(()=>{if(ht.length===0||he.nodes.length>0||f!=="flows"||Ae!=null)return;const K=ht[0];_e({nodes:[{id:crypto.randomUUID(),method:K.method.toLowerCase(),path:K.path,x:80,y:120}],edges:[]}),le(ze=>ze+1)},[ht,he.nodes.length,f,Ae]);const Lt=ce.useCallback(()=>{const K={"Content-Type":"application/json"};return j.trim()&&(K.Authorization=`Bearer ${j.trim()}`),W.trim()&&(K[q]=W.trim()),K},[j,W,q]),Ft=ce.useMemo(()=>{if(!r||!x)return null;const K={};for(const{id:ze}of mf)K[ze]=_0(r,ze,x.method,x.path);return K},[r,x]),bt=ce.useMemo(()=>r?b0(r,I,w):"",[r,I,w]),Pn=async()=>{if(!r||!x)return;const K=`${Ss(r,m)}${x.path}`,ze={method:x.method.toUpperCase(),headers:Lt()},Le=x.method.toLowerCase();Le!=="get"&&Le!=="head"&&(ze.body=N.trim()?N:"{}");const et=await fetch(K,{...ze,credentials:"include"}),Wt=await et.text();M(`${et.status} ${et.statusText}
207
+
208
+ ${Wt}`)},cn=async K=>{var Wt;if(!r)return"";const ze={};let Le="";const et=Ss(r,m);for(let Yt=0;Yt<K.length;Yt++){const Vt=K[Yt];let nn=Vt.path;for(const[or,In]of Object.entries(ze))nn=nn.replace(`{${or}}`,In);const to=`${et}${nn}`,rn={method:Vt.method.toUpperCase(),headers:Lt()},qn=Vt.method.toLowerCase();qn!=="get"&&qn!=="head"&&(rn.body="{}");const Dt=await fetch(to,{...rn,credentials:"include"}),Wn=await Dt.json().catch(()=>({}));if(Le+=`Paso ${Yt+1}: ${Dt.status}
209
+ ${JSON.stringify(Wn,null,2)}
210
+
211
+ `,(Wt=Vt.extract)!=null&&Wt.jsonPath){const or=$f(Wn,Vt.extract.jsonPath);or!==void 0&&(ze[Vt.extract.varName]=String(or))}}return Le},gr=async()=>{if(!r)return;const K=Ss(r,m);if(he.nodes.length===0){L("Añade al menos un nodo al flujo.");return}const ze=await im(he,K,Lt);L(ze)},wn=async K=>{if(!r)return;const ze=Ss(r,m),Le=K.graph&&K.graph.nodes.length>0?await im(K.graph,ze,Lt):await cn(K.steps);L(Le),d("flows")},Et=K=>{z(K.name),_e(K.graph&&K.graph.nodes.length>0?K.graph:Wb(K.steps.length?K.steps:[{method:"get",path:"/"}])),le(ze=>ze+1),we(K.id??null),d("flows")},Ht=()=>{we(null),z("Nuevo flujo"),ht[0]?_e({nodes:[{id:crypto.randomUUID(),method:ht[0].method.toLowerCase(),path:ht[0].path,x:80,y:120}],edges:[]}):_e({nodes:[],edges:[]}),le(K=>K+1)},Hn=ce.useCallback(K=>{_e(K)},[]),tr=async()=>{const K=qb(he);if(Ae!=null)await St.flows.update(Ae,{name:xe,steps:K,graph:he});else{const ze=await St.flows.add({name:xe,steps:K,graph:he});we(ze)}await st()},_n=async K=>{K!==void 0&&(K===Ae&&(we(null),Ht()),await St.flows.delete(K),await st())},jn=()=>{if(!Ie)return;const{method:K,path:ze}=Qb(Ie),Le={id:crypto.randomUUID(),method:K,path:ze,expectStatus:200,contains:void 0,jsonPath:void 0,expectJsonValue:void 0};X(et=>({...et,cases:[...et.cases,Le]}))},Vn=K=>{X(ze=>({...ze,cases:ze.cases.filter(Le=>Le.id!==K)}))},fn=(K,ze)=>{X(Le=>({...Le,cases:Le.cases.map(et=>et.id===K?{...et,...ze}:et)}))},nr=async K=>{if(!r)return"";const ze=Ss(r,m);let Le="";for(const et of K){const Wt=`${ze}${et.path}`,Yt=await fetch(Wt,{method:et.method.toUpperCase(),headers:Lt(),credentials:"include"}),Vt=await Yt.text(),nn=I0(et,Yt.status,Vt),to=`${nn.pass?"PASS":"FAIL"} ${et.method.toUpperCase()} ${et.path}`;Le+=`${to}
212
+ ${nn.lines.map(rn=>` ${rn}`).join(`
213
+ `)}
214
+
215
+ `}return Le},Sn=async()=>{const K=await nr(F.cases);Se(K)},qe=async()=>{if(!r||O.length===0)return;let K="";for(const ze of O)K+=`━━━ ${ze.name} (${ze.cases.length} casos) ━━━
216
+ `,K+=await nr(ze.cases);Se(K),d("tests")},Kn=async K=>{const ze=await nr(K.cases);Se(ze),d("tests")},bn=K=>{X({name:K.name,cases:K.cases.map(ze=>({...ze,id:ze.id&&ze.id.length>0?ze.id:crypto.randomUUID()}))}),be(K.id??null),d("tests")},rr=()=>{be(null),X({name:"Nueva suite",cases:[]})},He=async()=>{if(Fe!=null)await St.testSuites.update(Fe,{name:F.name,cases:F.cases});else{const K=await St.testSuites.add({name:F.name,cases:F.cases});be(K)}await st()},Tn=async K=>{K!==void 0&&(K===Fe&&(be(null),X({name:"Nueva suite",cases:[]})),await St.testSuites.delete(K),await st())},Un=async()=>{await St.kv.put({key:"bearer",value:j}),await St.kv.put({key:"apiKey",value:W})},Or=async()=>{const K=await T0(),ze=new Blob([JSON.stringify(K,null,2)],{type:"application/json"}),Le=document.createElement("a");Le.href=URL.createObjectURL(ze),Le.download="api-doc-tor-export.json",Le.click()},Jr=async K=>{var Wt;const ze=(Wt=K.target.files)==null?void 0:Wt[0];if(!ze)return;const Le=await ze.text(),et=JSON.parse(Le);await hm(et),await st()},Rr=async()=>{await fetch("/docs/__auth/logout",{method:"POST",credentials:"include"}),window.location.href="/docs/__auth/login"},Io=()=>{x&&(_e(K=>{const ze=K.nodes[K.nodes.length-1],Le=ze?ze.x+280:80,et=(ze==null?void 0:ze.y)??120;return{nodes:[...K.nodes,{id:crypto.randomUUID(),method:x.method.toLowerCase(),path:x.path,x:Le,y:et}],edges:K.edges}}),le(K=>K+1),d("flows"))};if(a)return C.jsx("div",{className:"min-h-screen flex items-center justify-center p-8",children:C.jsxs("div",{className:"max-w-lg rounded-2xl border border-red-500/30 bg-surface-900 p-6 text-red-200",children:[C.jsx("h1",{className:"font-display text-xl font-bold mb-2",children:"No se pudo cargar OpenAPI"}),C.jsx("p",{className:"text-sm opacity-90",children:a}),C.jsxs("p",{className:"text-xs mt-4 text-slate-500",children:["URL intentada: ",Ye]})]})});if(!r)return C.jsx("div",{className:"min-h-screen flex items-center justify-center",children:C.jsx("p",{className:"text-slate-400 animate-pulse",children:"Cargando especificación…"})});const eo=w===null?"Todos los endpoints (cliente único con todas las operaciones)":`Tag «${w}» (solo operaciones de este grupo)`,kn=((Mn=t.productName)==null?void 0:Mn.trim())||r.info.title;return C.jsxs("div",{className:"min-h-screen flex flex-col bg-surface-950",children:[C.jsxs("div",{className:"flex flex-1 flex-col md:flex-row min-h-0",children:[C.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:[C.jsxs("div",{className:"p-4 border-b border-surface-700",children:[t.logoDataUrl?C.jsx("img",{src:t.logoDataUrl,alt:"",className:"h-9 max-w-[200px] object-contain object-left mb-2"}):null,C.jsx("h1",{className:"font-display text-lg font-bold text-white tracking-tight",children:kn}),C.jsx("p",{className:"text-xs text-slate-500 mt-1",children:kn===r.info.title?`v${r.info.version}`:`${r.info.title} · v${r.info.version}`})]}),C.jsx("nav",{className:"p-2 flex flex-row md:flex-col gap-1 overflow-x-auto",children:[["explore","Explorar"],["flows",`Flujos (${ue.length})`],["tests",`Tests (${O.length})`],["auth","Auth"]].map(([K,ze])=>C.jsx("button",{type:"button",onClick:()=>d(K),className:`text-left px-3 py-2 rounded-lg text-sm transition ${f===K?"bg-accent/20 text-accent":"text-slate-400 hover:bg-surface-800"}`,children:ze},K))}),Je?C.jsxs("div",{className:"px-3 py-2 border-t border-surface-700 flex items-center justify-between gap-2 text-xs",children:[C.jsx("span",{className:"text-slate-400 truncate",title:Je.username,children:Je.username}),C.jsx("button",{type:"button",className:"shrink-0 text-accent hover:underline",onClick:()=>void Rr(),children:"Salir"})]}):null,C.jsxs("div",{className:"p-3 border-t border-surface-700 space-y-2",children:[C.jsx("button",{type:"button",onClick:Or,className:"w-full text-xs py-2 rounded-lg bg-surface-800 hover:bg-surface-700",children:"Exportar estado"}),C.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",C.jsx("input",{type:"file",accept:"application/json",className:"hidden",onChange:Jr})]})]})]}),C.jsxs("main",{className:"flex-1 flex flex-col min-h-0",children:[C.jsx("header",{className:"border-b border-surface-700 px-4 py-3 flex flex-wrap gap-3 items-center bg-surface-900/50",children:C.jsxs("label",{className:"text-xs text-slate-500",children:["Base URL",C.jsx("input",{className:"ml-2 bg-surface-800 border border-surface-600 rounded px-2 py-1 text-sm w-64",value:m,onChange:K=>v(K.target.value)})]})}),f==="explore"&&C.jsxs("div",{className:"flex-1 flex flex-col lg:flex-row min-h-0",children:[C.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:[C.jsxs("div",{className:"p-2",children:[C.jsx("p",{className:"text-xs uppercase tracking-wider text-slate-500 mb-2",children:"Tags"}),C.jsxs("div",{className:"flex flex-wrap gap-1",children:[C.jsx("button",{type:"button",onClick:()=>b(null),className:`text-xs px-2 py-1 rounded ${w===null?"bg-accent/30":"bg-surface-800"}`,children:"Todos"}),ct.map(K=>C.jsx("button",{type:"button",onClick:()=>b(K),className:`text-xs px-2 py-1 rounded ${w===K?"bg-accent/30":"bg-surface-800"}`,children:K},K))]})]}),C.jsx("ul",{className:"text-sm",children:xn.map(K=>C.jsx("li",{children:C.jsxs("button",{type:"button",onClick:()=>S({method:K.method,path:K.path}),className:`w-full text-left px-3 py-2 hover:bg-surface-800 flex gap-2 ${(x==null?void 0:x.method)===K.method&&x.path===K.path?"bg-surface-800 border-l-2 border-accent":""}`,children:[C.jsx("span",{className:"uppercase text-accent text-xs w-12 shrink-0",children:K.method}),C.jsx("span",{className:"truncate text-slate-300",children:K.path})]})},`${K.method}:${K.path}`))})]}),C.jsx("div",{className:"flex-1 p-4 overflow-auto space-y-6",children:x?C.jsxs(C.Fragment,{children:[C.jsxs("div",{children:[C.jsxs("h2",{className:"font-display font-semibold text-white text-lg",children:[x.method.toUpperCase()," ",x.path]}),C.jsxs("p",{className:"text-xs text-slate-500 mt-1",children:["Filtro de exportación de servicio: ",eo]})]}),C.jsxs("section",{className:"space-y-2",children:[C.jsx("h3",{className:"text-sm font-medium text-slate-300",children:"Probar"}),C.jsx("textarea",{className:"w-full h-28 bg-surface-900 border border-surface-600 rounded-lg p-3 font-mono text-xs",value:N,onChange:K=>P(K.target.value),placeholder:"Body JSON"}),C.jsx("button",{type:"button",onClick:()=>void Pn(),className:"px-4 py-2 rounded-lg bg-accent text-surface-950 font-medium text-sm",children:"Ejecutar"}),C.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.jsxs("section",{className:"space-y-3",children:[C.jsx("h3",{className:"text-sm font-medium text-slate-300",children:"Snippets por lenguaje"}),C.jsx("div",{className:"grid gap-3 md:grid-cols-2",children:Ft&&mf.map(({id:K,label:ze})=>C.jsxs("div",{className:"rounded-xl border border-surface-700 bg-surface-900/60 overflow-hidden",children:[C.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b border-surface-700 bg-surface-800/50",children:[C.jsx("span",{className:"text-xs font-medium text-accent",children:ze}),C.jsx("button",{type:"button",className:"text-xs px-2 py-1 rounded bg-surface-700 hover:bg-surface-600",onClick:()=>void am(Ft[K]),children:"Copiar"})]}),C.jsx("pre",{className:"text-[11px] p-3 overflow-auto max-h-56 text-slate-300 font-mono whitespace-pre-wrap",children:Ft[K]})]},K))})]}),C.jsxs("section",{className:"space-y-3 rounded-xl border border-surface-700 bg-surface-900/40 p-4",children:[C.jsx("h3",{className:"text-sm font-medium text-slate-300",children:"Cliente / servicio generado"}),C.jsx("p",{className:"text-xs text-slate-500",children:eo}),C.jsxs("div",{className:"flex flex-wrap gap-2 items-center",children:[C.jsxs("label",{className:"text-xs text-slate-400",children:["Lenguaje del archivo",C.jsx("select",{className:"ml-2 bg-surface-800 border border-surface-600 rounded px-2 py-1.5 text-sm",value:I,onChange:K=>H(K.target.value),children:mf.map(({id:K,label:ze})=>C.jsx("option",{value:K,children:ze},K))})]}),C.jsx("button",{type:"button",className:"text-xs px-3 py-1.5 rounded-lg bg-surface-700 hover:bg-surface-600",onClick:()=>void am(bt),children:"Copiar servicio"})]}),C.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:bt})]}),C.jsx("div",{className:"flex flex-wrap gap-2 pt-2 border-t border-surface-800",children:C.jsx("button",{type:"button",className:"text-xs px-3 py-2 rounded-lg bg-surface-800 hover:bg-surface-700",onClick:Io,children:"Añadir operación actual a un flujo (ve a Flujos)"})})]}):C.jsx("p",{className:"text-slate-500",children:"Selecciona una operación en la lista."})})]}),f==="flows"&&C.jsxs("div",{className:"p-4 space-y-6 overflow-auto max-w-5xl",children:[C.jsxs("section",{className:"rounded-xl border border-surface-700 bg-surface-900/50 p-4",children:[C.jsx("h3",{className:"text-sm font-semibold text-white mb-3",children:"Flujos guardados"}),ue.length===0?C.jsx("p",{className:"text-sm text-slate-500",children:"Aún no hay flujos. Crea uno en el editor y guarda."}):C.jsx("ul",{className:"space-y-2",children:ue.map(K=>{var ze,Le;return C.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:[C.jsxs("div",{children:[C.jsx("span",{className:"text-sm text-slate-200 font-medium",children:K.name}),C.jsxs("span",{className:"text-xs text-slate-500 ml-2",children:[(((Le=(ze=K.graph)==null?void 0:ze.nodes)==null?void 0:Le.length)??K.steps.length)||0," nodo(s)"]})]}),C.jsxs("div",{className:"flex flex-wrap gap-2",children:[C.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 wn(K),children:"Play"}),C.jsx("button",{type:"button",className:"text-xs px-2 py-1.5 rounded bg-accent/20 text-accent hover:bg-accent/30",onClick:()=>Et(K),children:"Editar"}),C.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 _n(K.id),children:"Eliminar"})]})]},K.id!=null?`flow-${K.id}`:`flow-${K.name}`)})})]}),C.jsxs("section",{className:"space-y-4 max-w-6xl",children:[C.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[C.jsx("h3",{className:"text-sm font-semibold text-white",children:"Editor de flujo (nodos y cables)"}),C.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:Ht,children:"Nuevo flujo"})]}),Ae!=null&&C.jsxs("p",{className:"text-xs text-accent",children:["Editando flujo guardado (#",Ae,")"]}),C.jsxs("p",{className:"text-sm text-slate-400",children:["Cada nodo es un endpoint del spec. Conecta ",C.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 ",C.jsx("code",{className:"text-accent",children:"{variable}"})," en la ruta)."]}),C.jsx("input",{className:"bg-surface-800 border border-surface-600 rounded px-3 py-2 text-sm w-full max-w-md",value:xe,onChange:K=>z(K.target.value),placeholder:"Nombre del flujo"}),C.jsx(Ub,{doc:r,ops:ht,graph:he,onGraphChange:Hn},Q),C.jsxs("div",{className:"flex flex-wrap gap-2",children:[C.jsx("button",{type:"button",className:"px-3 py-2 rounded-lg bg-emerald-600 text-white text-sm font-medium hover:bg-emerald-500",onClick:()=>void gr(),children:"Play (grafo)"}),C.jsx("button",{type:"button",className:"px-3 py-2 rounded-lg bg-surface-700 text-sm",onClick:()=>void tr(),children:Ae!=null?"Guardar cambios":"Guardar flujo"})]}),C.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:ae||"Resultado de la ejecución aquí."})]})]}),f==="tests"&&C.jsxs("div",{className:"p-4 space-y-6 overflow-auto max-w-5xl",children:[C.jsxs("section",{className:"rounded-xl border border-surface-700 bg-surface-900/50 p-4 space-y-3",children:[C.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[C.jsx("h3",{className:"text-sm font-semibold text-white",children:"Suites guardadas"}),O.length>0&&C.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 qe(),children:"Ejecutar todas las suites"})]}),O.length===0?C.jsx("p",{className:"text-sm text-slate-500",children:"Ninguna suite guardada."}):C.jsx("ul",{className:"space-y-2",children:O.map(K=>C.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:[C.jsxs("div",{children:[C.jsx("span",{className:"text-sm text-slate-200 font-medium",children:K.name}),C.jsxs("span",{className:"text-xs text-slate-500 ml-2",children:[K.cases.length," caso(s)"]})]}),C.jsxs("div",{className:"flex flex-wrap gap-2",children:[C.jsx("button",{type:"button",className:"text-xs px-2 py-1.5 rounded-lg bg-emerald-600/30 text-emerald-300 hover:bg-emerald-600/50",onClick:()=>void Kn(K),children:"Play"}),C.jsx("button",{type:"button",className:"text-xs px-2 py-1.5 rounded bg-accent/20 text-accent",onClick:()=>bn(K),children:"Editar"}),C.jsx("button",{type:"button",className:"text-xs px-2 py-1 rounded bg-surface-700 hover:bg-red-900/40",onClick:()=>void Tn(K.id),children:"Eliminar"})]})]},K.id!=null?`suite-${K.id}`:`suite-${K.name}`))})]}),C.jsxs("section",{className:"space-y-4",children:[C.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[C.jsx("h3",{className:"text-sm font-semibold text-white",children:"Suite en edición"}),C.jsx("button",{type:"button",className:"text-xs px-3 py-1.5 rounded-lg border border-surface-600 text-slate-300 hover:bg-surface-800",onClick:rr,children:"Nueva suite"})]}),Fe!=null&&C.jsxs("p",{className:"text-xs text-accent",children:["Editando suite guardada (#",Fe,")"]}),C.jsx("input",{className:"bg-surface-800 border border-surface-600 rounded px-3 py-2 text-sm max-w-md",value:F.name,onChange:K=>X(ze=>({...ze,name:K.target.value})),placeholder:"Nombre de la suite"}),C.jsxs("div",{className:"flex flex-wrap gap-2 items-end rounded-xl border border-surface-700 bg-surface-900/40 p-4",children:[C.jsxs("label",{className:"text-xs text-slate-400 flex-1 min-w-[200px]",children:["Añadir endpoint del spec",C.jsx("select",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-3 py-2 text-sm font-mono",value:Ie,onChange:K=>Re(K.target.value),children:ht.map(K=>C.jsxs("option",{value:gf(K.method,K.path),children:[K.method.toUpperCase()," ",K.path]},gf(K.method,K.path)))})]}),C.jsx("button",{type:"button",className:"px-4 py-2 rounded-lg bg-surface-800 text-sm hover:bg-surface-700",onClick:jn,children:"Añadir a la suite"})]}),C.jsx("ul",{className:"space-y-4",children:F.cases.map(K=>{const ze=sm(K.expectStatus)?String(K.expectStatus):"custom";return C.jsxs("li",{className:"rounded-xl border border-surface-700 bg-surface-950/40 p-4 space-y-3 text-sm",children:[C.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-2",children:[C.jsxs("span",{className:"font-mono text-xs text-accent",children:[K.method.toUpperCase()," ",K.path]}),C.jsx("button",{type:"button",className:"text-xs text-red-400 hover:underline shrink-0",onClick:()=>Vn(K.id),children:"Quitar"})]}),C.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-3",children:[C.jsxs("label",{className:"text-xs text-slate-400 block",children:["Código HTTP esperado",C.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-2",children:[C.jsxs("select",{className:"bg-surface-800 border border-surface-600 rounded px-2 py-1.5 text-sm max-w-[200px]",value:ze,onChange:Le=>{const et=Le.target.value;if(et==="custom"){fn(K.id,{expectStatus:sm(K.expectStatus)?1e3:K.expectStatus});return}fn(K.id,{expectStatus:Number(et)})},children:[iy.map(Le=>C.jsx("option",{value:String(Le.value),children:Le.label},Le.value)),C.jsx("option",{value:"custom",children:"Otro…"})]}),ze==="custom"&&C.jsx("input",{type:"number",className:"w-20 bg-surface-800 border border-surface-600 rounded px-2 py-1.5 text-sm",value:K.expectStatus,onChange:Le=>fn(K.id,{expectStatus:Number(Le.target.value)||0})})]})]}),C.jsxs("label",{className:"text-xs text-slate-400 block sm:col-span-2",children:["El body contiene (opcional)",C.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:K.contains??"",onChange:Le=>fn(K.id,{contains:Le.target.value||void 0})})]}),C.jsxs("label",{className:"text-xs text-slate-400 block",children:["JSON path (opcional)",C.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:K.jsonPath??"",onChange:Le=>fn(K.id,{jsonPath:Le.target.value||void 0})})]}),C.jsxs("label",{className:"text-xs text-slate-400 block sm:col-span-2",children:["Valor esperado en JSON path (opcional)",C.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:K.expectJsonValue??"",onChange:Le=>fn(K.id,{expectJsonValue:Le.target.value||void 0})})]})]})]},K.id)})}),C.jsxs("div",{className:"flex flex-wrap gap-2 items-center",children:[C.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 Sn(),children:"Correr todos los casos (suite actual)"}),C.jsx("button",{type:"button",className:"px-4 py-2 rounded-lg bg-surface-700 text-sm",onClick:()=>void He(),children:Fe!=null?"Guardar cambios":"Guardar suite"})]}),C.jsx("pre",{className:"text-xs bg-surface-950 border border-surface-700 rounded-lg p-3 whitespace-pre-wrap min-h-[4rem]",children:ke||"—"})]})]}),f==="auth"&&C.jsxs("div",{className:"p-4 space-y-4 max-w-lg",children:[C.jsxs("p",{className:"text-sm text-slate-400",children:["Esquemas en el spec: ",E0(r).join(", ")||"ninguno"]}),C.jsxs("label",{className:"block text-sm",children:["Bearer token",C.jsx("input",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-3 py-2",value:j,onChange:K=>R(K.target.value),placeholder:"eyJ..."})]}),C.jsxs("label",{className:"block text-sm",children:["API key header",C.jsx("input",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-3 py-2",value:q,onChange:K=>pe(K.target.value)})]}),C.jsxs("label",{className:"block text-sm",children:["API key",C.jsx("input",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-3 py-2",value:W,onChange:K=>V(K.target.value),type:"password",autoComplete:"off"})]}),C.jsx("button",{type:"button",className:"px-4 py-2 rounded-lg bg-surface-700 text-sm",onClick:()=>void Un(),children:"Recordar en este navegador"})]})]})]}),C.jsx("footer",{className:"border-t border-surface-700 px-3 py-2.5 text-center text-[11px] text-slate-600 bg-surface-950 shrink-0",children:"made with ♥ by andres arcila"})]})}const Zb={surface950:"#0c0f14",surface900:"#12171f",surface800:"#1a2230",surface700:"#243044",accent:"#38bdf8",accentDim:"#0ea5e9"};function ks(t){const r=t.trim(),i=/^#?([0-9a-f]{6})$/i.exec(r);if(!i)return"12 15 20";const a=parseInt(i[1],16);return`${a>>16&255} ${a>>8&255} ${a&255}`}function Jb(t){return{...Zb,...t}}function ek(t){var a,u;const r=(a=t.logoBase64)==null?void 0:a.trim();return r?r.startsWith("data:")?r:`data:${((u=t.logoMimeType)==null?void 0:u.trim())||"image/png"};base64,${r}`:null}function tk(t){var i;const r=Jb(t==null?void 0:t.colors);return{productName:((i=t==null?void 0:t.productName)==null?void 0:i.trim())||null,logoDataUrl:t?ek(t):null,colors:r,colorsRgb:{surface950:ks(r.surface950),surface900:ks(r.surface900),surface800:ks(r.surface800),surface700:ks(r.surface700),accent:ks(r.accent),accentDim:ks(r.accentDim)}}}const nk={credentials:"include"};function rk(t){const r=document.documentElement;r.style.setProperty("--surface-950",t.surface950),r.style.setProperty("--surface-900",t.surface900),r.style.setProperty("--surface-800",t.surface800),r.style.setProperty("--surface-700",t.surface700),r.style.setProperty("--accent",t.accent),r.style.setProperty("--accent-dim",t.accentDim)}async function ok(){const t=tk(void 0);try{const r=await fetch("/docs/ui-config.json",nk);return r.status===401?{...t,docsAuthRequired:!0}:r.ok?await r.json():t}catch{return t}}(async()=>{const t=await ok();rk(t.colorsRgb),s0.createRoot(document.getElementById("root")).render(C.jsx(lm.StrictMode,{children:C.jsx(Yb,{value:{productName:t.productName,logoDataUrl:t.logoDataUrl},children:C.jsx(Gb,{})})}))})();