loom-spec 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/exportHtml.d.ts +25 -0
- package/dist/cli/exportHtml.js +201 -0
- package/dist/cli/exportHtml.js.map +1 -0
- package/dist/cli/index.js +46 -4
- package/dist/cli/index.js.map +1 -1
- package/dist/server/exportConfig.d.ts +42 -0
- package/dist/server/exportConfig.js +88 -0
- package/dist/server/exportConfig.js.map +1 -0
- package/dist/server/exportFilter.d.ts +59 -0
- package/dist/server/exportFilter.js +172 -0
- package/dist/server/exportFilter.js.map +1 -0
- package/dist/view/assets/TimelineView-CsYV15RD.js +16 -0
- package/dist/view/assets/index-CqF2JC9l.js +210 -0
- package/dist/view/index.html +1 -1
- package/dist/view-export/assets/bundle.css +1 -0
- package/dist/view-export/assets/bundle.js +225 -0
- package/dist/view-export/index.html +24 -0
- package/package.json +3 -2
- package/templates/.claude/skills/loom-spec/SKILL.md +111 -0
- package/dist/view/assets/TimelineView-DEfpV9mL.js +0 -16
- package/dist/view/assets/index-Du05xzao.js +0 -210
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const s of i.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(o){if(o.ep)return;o.ep=!0;const i=n(o);fetch(o.href,i)}})();function Wa(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var sg={exports:{}},qa={},ag={exports:{}},ae={};/**
|
|
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 Hi=Symbol.for("react.element"),u_=Symbol.for("react.portal"),c_=Symbol.for("react.fragment"),d_=Symbol.for("react.strict_mode"),f_=Symbol.for("react.profiler"),h_=Symbol.for("react.provider"),p_=Symbol.for("react.context"),m_=Symbol.for("react.forward_ref"),g_=Symbol.for("react.suspense"),y_=Symbol.for("react.memo"),v_=Symbol.for("react.lazy"),rh=Symbol.iterator;function w_(e){return e===null||typeof e!="object"?null:(e=rh&&e[rh]||e["@@iterator"],typeof e=="function"?e:null)}var lg={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},ug=Object.assign,cg={};function $o(e,t,n){this.props=e,this.context=t,this.refs=cg,this.updater=n||lg}$o.prototype.isReactComponent={};$o.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=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,e,t,"setState")};$o.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function dg(){}dg.prototype=$o.prototype;function Hc(e,t,n){this.props=e,this.context=t,this.refs=cg,this.updater=n||lg}var Bc=Hc.prototype=new dg;Bc.constructor=Hc;ug(Bc,$o.prototype);Bc.isPureReactComponent=!0;var oh=Array.isArray,fg=Object.prototype.hasOwnProperty,Uc={current:null},hg={key:!0,ref:!0,__self:!0,__source:!0};function pg(e,t,n){var r,o={},i=null,s=null;if(t!=null)for(r in t.ref!==void 0&&(s=t.ref),t.key!==void 0&&(i=""+t.key),t)fg.call(t,r)&&!hg.hasOwnProperty(r)&&(o[r]=t[r]);var a=arguments.length-2;if(a===1)o.children=n;else if(1<a){for(var l=Array(a),u=0;u<a;u++)l[u]=arguments[u+2];o.children=l}if(e&&e.defaultProps)for(r in a=e.defaultProps,a)o[r]===void 0&&(o[r]=a[r]);return{$$typeof:Hi,type:e,key:i,ref:s,props:o,_owner:Uc.current}}function __(e,t){return{$$typeof:Hi,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Wc(e){return typeof e=="object"&&e!==null&&e.$$typeof===Hi}function $_(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var ih=/\/+/g;function Rl(e,t){return typeof e=="object"&&e!==null&&e.key!=null?$_(""+e.key):t.toString(36)}function Os(e,t,n,r,o){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var s=!1;if(e===null)s=!0;else switch(i){case"string":case"number":s=!0;break;case"object":switch(e.$$typeof){case Hi:case u_:s=!0}}if(s)return s=e,o=o(s),e=r===""?"."+Rl(s,0):r,oh(o)?(n="",e!=null&&(n=e.replace(ih,"$&/")+"/"),Os(o,t,n,"",function(u){return u})):o!=null&&(Wc(o)&&(o=__(o,n+(!o.key||s&&s.key===o.key?"":(""+o.key).replace(ih,"$&/")+"/")+e)),t.push(o)),1;if(s=0,r=r===""?".":r+":",oh(e))for(var a=0;a<e.length;a++){i=e[a];var l=r+Rl(i,a);s+=Os(i,t,n,l,o)}else if(l=w_(e),typeof l=="function")for(e=l.call(e),a=0;!(i=e.next()).done;)i=i.value,l=r+Rl(i,a++),s+=Os(i,t,n,l,o);else if(i==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return s}function os(e,t,n){if(e==null)return e;var r=[],o=0;return Os(e,r,"","",function(i){return t.call(n,i,o++)}),r}function x_(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Ze={current:null},Ds={transition:null},S_={ReactCurrentDispatcher:Ze,ReactCurrentBatchConfig:Ds,ReactCurrentOwner:Uc};function mg(){throw Error("act(...) is not supported in production builds of React.")}ae.Children={map:os,forEach:function(e,t,n){os(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return os(e,function(){t++}),t},toArray:function(e){return os(e,function(t){return t})||[]},only:function(e){if(!Wc(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};ae.Component=$o;ae.Fragment=c_;ae.Profiler=f_;ae.PureComponent=Hc;ae.StrictMode=d_;ae.Suspense=g_;ae.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=S_;ae.act=mg;ae.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=ug({},e.props),o=e.key,i=e.ref,s=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,s=Uc.current),t.key!==void 0&&(o=""+t.key),e.type&&e.type.defaultProps)var a=e.type.defaultProps;for(l in t)fg.call(t,l)&&!hg.hasOwnProperty(l)&&(r[l]=t[l]===void 0&&a!==void 0?a[l]:t[l])}var l=arguments.length-2;if(l===1)r.children=n;else if(1<l){a=Array(l);for(var u=0;u<l;u++)a[u]=arguments[u+2];r.children=a}return{$$typeof:Hi,type:e.type,key:o,ref:i,props:r,_owner:s}};ae.createContext=function(e){return e={$$typeof:p_,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:h_,_context:e},e.Consumer=e};ae.createElement=pg;ae.createFactory=function(e){var t=pg.bind(null,e);return t.type=e,t};ae.createRef=function(){return{current:null}};ae.forwardRef=function(e){return{$$typeof:m_,render:e}};ae.isValidElement=Wc;ae.lazy=function(e){return{$$typeof:v_,_payload:{_status:-1,_result:e},_init:x_}};ae.memo=function(e,t){return{$$typeof:y_,type:e,compare:t===void 0?null:t}};ae.startTransition=function(e){var t=Ds.transition;Ds.transition={};try{e()}finally{Ds.transition=t}};ae.unstable_act=mg;ae.useCallback=function(e,t){return Ze.current.useCallback(e,t)};ae.useContext=function(e){return Ze.current.useContext(e)};ae.useDebugValue=function(){};ae.useDeferredValue=function(e){return Ze.current.useDeferredValue(e)};ae.useEffect=function(e,t){return Ze.current.useEffect(e,t)};ae.useId=function(){return Ze.current.useId()};ae.useImperativeHandle=function(e,t,n){return Ze.current.useImperativeHandle(e,t,n)};ae.useInsertionEffect=function(e,t){return Ze.current.useInsertionEffect(e,t)};ae.useLayoutEffect=function(e,t){return Ze.current.useLayoutEffect(e,t)};ae.useMemo=function(e,t){return Ze.current.useMemo(e,t)};ae.useReducer=function(e,t,n){return Ze.current.useReducer(e,t,n)};ae.useRef=function(e){return Ze.current.useRef(e)};ae.useState=function(e){return Ze.current.useState(e)};ae.useSyncExternalStore=function(e,t,n){return Ze.current.useSyncExternalStore(e,t,n)};ae.useTransition=function(){return Ze.current.useTransition()};ae.version="18.3.1";ag.exports=ae;var A=ag.exports;const E_=Wa(A);/**
|
|
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 k_=A,N_=Symbol.for("react.element"),P_=Symbol.for("react.fragment"),C_=Object.prototype.hasOwnProperty,b_=k_.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,j_={key:!0,ref:!0,__self:!0,__source:!0};function gg(e,t,n){var r,o={},i=null,s=null;n!==void 0&&(i=""+n),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(s=t.ref);for(r in t)C_.call(t,r)&&!j_.hasOwnProperty(r)&&(o[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)o[r]===void 0&&(o[r]=t[r]);return{$$typeof:N_,type:e,key:i,ref:s,props:o,_owner:b_.current}}qa.Fragment=P_;qa.jsx=gg;qa.jsxs=gg;sg.exports=qa;var $=sg.exports,yg={exports:{}},ht={},vg={exports:{}},wg={};/**
|
|
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
|
+
*/(function(e){function t(j,z){var T=j.length;j.push(z);e:for(;0<T;){var N=T-1>>>1,R=j[N];if(0<o(R,z))j[N]=z,j[T]=R,T=N;else break e}}function n(j){return j.length===0?null:j[0]}function r(j){if(j.length===0)return null;var z=j[0],T=j.pop();if(T!==z){j[0]=T;e:for(var N=0,R=j.length,D=R>>>1;N<D;){var S=2*(N+1)-1,C=j[S],U=S+1,Y=j[U];if(0>o(C,T))U<R&&0>o(Y,C)?(j[N]=Y,j[U]=T,N=U):(j[N]=C,j[S]=T,N=S);else if(U<R&&0>o(Y,T))j[N]=Y,j[U]=T,N=U;else break e}}return z}function o(j,z){var T=j.sortIndex-z.sortIndex;return T!==0?T:j.id-z.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var s=Date,a=s.now();e.unstable_now=function(){return s.now()-a}}var l=[],u=[],d=1,c=null,f=3,m=!1,y=!1,v=!1,w=typeof setTimeout=="function"?setTimeout:null,h=typeof clearTimeout=="function"?clearTimeout:null,g=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function p(j){for(var z=n(u);z!==null;){if(z.callback===null)r(u);else if(z.startTime<=j)r(u),z.sortIndex=z.expirationTime,t(l,z);else break;z=n(u)}}function _(j){if(v=!1,p(j),!y)if(n(l)!==null)y=!0,M(x);else{var z=n(u);z!==null&&V(_,z.startTime-j)}}function x(j,z){y=!1,v&&(v=!1,h(b),b=-1),m=!0;var T=f;try{for(p(z),c=n(l);c!==null&&(!(c.expirationTime>z)||j&&!I());){var N=c.callback;if(typeof N=="function"){c.callback=null,f=c.priorityLevel;var R=N(c.expirationTime<=z);z=e.unstable_now(),typeof R=="function"?c.callback=R:c===n(l)&&r(l),p(z)}else r(l);c=n(l)}if(c!==null)var D=!0;else{var S=n(u);S!==null&&V(_,S.startTime-z),D=!1}return D}finally{c=null,f=T,m=!1}}var k=!1,P=null,b=-1,F=5,W=-1;function I(){return!(e.unstable_now()-W<F)}function H(){if(P!==null){var j=e.unstable_now();W=j;var z=!0;try{z=P(!0,j)}finally{z?q():(k=!1,P=null)}}else k=!1}var q;if(typeof g=="function")q=function(){g(H)};else if(typeof MessageChannel<"u"){var E=new MessageChannel,O=E.port2;E.port1.onmessage=H,q=function(){O.postMessage(null)}}else q=function(){w(H,0)};function M(j){P=j,k||(k=!0,q())}function V(j,z){b=w(function(){j(e.unstable_now())},z)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(j){j.callback=null},e.unstable_continueExecution=function(){y||m||(y=!0,M(x))},e.unstable_forceFrameRate=function(j){0>j||125<j?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):F=0<j?Math.floor(1e3/j):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(l)},e.unstable_next=function(j){switch(f){case 1:case 2:case 3:var z=3;break;default:z=f}var T=f;f=z;try{return j()}finally{f=T}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(j,z){switch(j){case 1:case 2:case 3:case 4:case 5:break;default:j=3}var T=f;f=j;try{return z()}finally{f=T}},e.unstable_scheduleCallback=function(j,z,T){var N=e.unstable_now();switch(typeof T=="object"&&T!==null?(T=T.delay,T=typeof T=="number"&&0<T?N+T:N):T=N,j){case 1:var R=-1;break;case 2:R=250;break;case 5:R=1073741823;break;case 4:R=1e4;break;default:R=5e3}return R=T+R,j={id:d++,callback:z,priorityLevel:j,startTime:T,expirationTime:R,sortIndex:-1},T>N?(j.sortIndex=T,t(u,j),n(l)===null&&j===n(u)&&(v?(h(b),b=-1):v=!0,V(_,T-N))):(j.sortIndex=R,t(l,j),y||m||(y=!0,M(x))),j},e.unstable_shouldYield=I,e.unstable_wrapCallback=function(j){var z=f;return function(){var T=f;f=z;try{return j.apply(this,arguments)}finally{f=T}}}})(wg);vg.exports=wg;var M_=vg.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 T_=A,dt=M_;function Q(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var _g=new Set,pi={};function Nr(e,t){oo(e,t),oo(e+"Capture",t)}function oo(e,t){for(pi[e]=t,e=0;e<t.length;e++)_g.add(t[e])}var fn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Eu=Object.prototype.hasOwnProperty,I_=/^[: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]*$/,sh={},ah={};function R_(e){return Eu.call(ah,e)?!0:Eu.call(sh,e)?!1:I_.test(e)?ah[e]=!0:(sh[e]=!0,!1)}function z_(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function A_(e,t,n,r){if(t===null||typeof t>"u"||z_(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Je(e,t,n,r,o,i,s){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=s}var Be={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Be[e]=new Je(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Be[t]=new Je(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Be[e]=new Je(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Be[e]=new Je(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){Be[e]=new Je(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Be[e]=new Je(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Be[e]=new Je(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Be[e]=new Je(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Be[e]=new Je(e,5,!1,e.toLowerCase(),null,!1,!1)});var qc=/[\-:]([a-z])/g;function Kc(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 t=e.replace(qc,Kc);Be[t]=new Je(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(qc,Kc);Be[t]=new Je(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(qc,Kc);Be[t]=new Je(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Be[e]=new Je(e,1,!1,e.toLowerCase(),null,!1,!1)});Be.xlinkHref=new Je("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Be[e]=new Je(e,1,!1,e.toLowerCase(),null,!0,!0)});function Xc(e,t,n,r){var o=Be.hasOwnProperty(t)?Be[t]:null;(o!==null?o.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(A_(t,n,o,r)&&(n=null),r||o===null?R_(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):o.mustUseProperty?e[o.propertyName]=n===null?o.type===3?!1:"":n:(t=o.attributeName,r=o.attributeNamespace,n===null?e.removeAttribute(t):(o=o.type,n=o===3||o===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var vn=T_.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,is=Symbol.for("react.element"),Ir=Symbol.for("react.portal"),Rr=Symbol.for("react.fragment"),Yc=Symbol.for("react.strict_mode"),ku=Symbol.for("react.profiler"),$g=Symbol.for("react.provider"),xg=Symbol.for("react.context"),Gc=Symbol.for("react.forward_ref"),Nu=Symbol.for("react.suspense"),Pu=Symbol.for("react.suspense_list"),Qc=Symbol.for("react.memo"),Nn=Symbol.for("react.lazy"),Sg=Symbol.for("react.offscreen"),lh=Symbol.iterator;function To(e){return e===null||typeof e!="object"?null:(e=lh&&e[lh]||e["@@iterator"],typeof e=="function"?e:null)}var ke=Object.assign,zl;function Wo(e){if(zl===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);zl=t&&t[1]||""}return`
|
|
34
|
+
`+zl+e}var Al=!1;function Ol(e,t){if(!e||Al)return"";Al=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(u){var r=u}Reflect.construct(e,[],t)}else{try{t.call()}catch(u){r=u}e.call(t.prototype)}else{try{throw Error()}catch(u){r=u}e()}}catch(u){if(u&&r&&typeof u.stack=="string"){for(var o=u.stack.split(`
|
|
35
|
+
`),i=r.stack.split(`
|
|
36
|
+
`),s=o.length-1,a=i.length-1;1<=s&&0<=a&&o[s]!==i[a];)a--;for(;1<=s&&0<=a;s--,a--)if(o[s]!==i[a]){if(s!==1||a!==1)do if(s--,a--,0>a||o[s]!==i[a]){var l=`
|
|
37
|
+
`+o[s].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),l}while(1<=s&&0<=a);break}}}finally{Al=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Wo(e):""}function O_(e){switch(e.tag){case 5:return Wo(e.type);case 16:return Wo("Lazy");case 13:return Wo("Suspense");case 19:return Wo("SuspenseList");case 0:case 2:case 15:return e=Ol(e.type,!1),e;case 11:return e=Ol(e.type.render,!1),e;case 1:return e=Ol(e.type,!0),e;default:return""}}function Cu(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 Rr:return"Fragment";case Ir:return"Portal";case ku:return"Profiler";case Yc:return"StrictMode";case Nu:return"Suspense";case Pu:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case xg:return(e.displayName||"Context")+".Consumer";case $g:return(e._context.displayName||"Context")+".Provider";case Gc:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Qc:return t=e.displayName||null,t!==null?t:Cu(e.type)||"Memo";case Nn:t=e._payload,e=e._init;try{return Cu(e(t))}catch{}}return null}function D_(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Cu(t);case 8:return t===Yc?"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 t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Un(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Eg(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function L_(e){var t=Eg(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var o=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(s){r=""+s,i.call(this,s)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function ss(e){e._valueTracker||(e._valueTracker=L_(e))}function kg(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Eg(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function ia(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 bu(e,t){var n=t.checked;return ke({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function uh(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Un(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Ng(e,t){t=t.checked,t!=null&&Xc(e,"checked",t,!1)}function ju(e,t){Ng(e,t);var n=Un(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Mu(e,t.type,n):t.hasOwnProperty("defaultValue")&&Mu(e,t.type,Un(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function ch(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Mu(e,t,n){(t!=="number"||ia(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var qo=Array.isArray;function Xr(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o<n.length;o++)t["$"+n[o]]=!0;for(n=0;n<e.length;n++)o=t.hasOwnProperty("$"+e[n].value),e[n].selected!==o&&(e[n].selected=o),o&&r&&(e[n].defaultSelected=!0)}else{for(n=""+Un(n),t=null,o=0;o<e.length;o++){if(e[o].value===n){e[o].selected=!0,r&&(e[o].defaultSelected=!0);return}t!==null||e[o].disabled||(t=e[o])}t!==null&&(t.selected=!0)}}function Tu(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(Q(91));return ke({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function dh(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(Q(92));if(qo(n)){if(1<n.length)throw Error(Q(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:Un(n)}}function Pg(e,t){var n=Un(t.value),r=Un(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function fh(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Cg(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 Iu(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Cg(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var as,bg=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,o){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,o)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(as=as||document.createElement("div"),as.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=as.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function mi(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Jo={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},V_=["Webkit","ms","Moz","O"];Object.keys(Jo).forEach(function(e){V_.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Jo[t]=Jo[e]})});function jg(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Jo.hasOwnProperty(e)&&Jo[e]?(""+t).trim():t+"px"}function Mg(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=jg(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var F_=ke({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 Ru(e,t){if(t){if(F_[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(Q(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(Q(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(Q(61))}if(t.style!=null&&typeof t.style!="object")throw Error(Q(62))}}function zu(e,t){if(e.indexOf("-")===-1)return typeof t.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 Au=null;function Zc(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ou=null,Yr=null,Gr=null;function hh(e){if(e=Wi(e)){if(typeof Ou!="function")throw Error(Q(280));var t=e.stateNode;t&&(t=Qa(t),Ou(e.stateNode,e.type,t))}}function Tg(e){Yr?Gr?Gr.push(e):Gr=[e]:Yr=e}function Ig(){if(Yr){var e=Yr,t=Gr;if(Gr=Yr=null,hh(e),t)for(e=0;e<t.length;e++)hh(t[e])}}function Rg(e,t){return e(t)}function zg(){}var Dl=!1;function Ag(e,t,n){if(Dl)return e(t,n);Dl=!0;try{return Rg(e,t,n)}finally{Dl=!1,(Yr!==null||Gr!==null)&&(zg(),Ig())}}function gi(e,t){var n=e.stateNode;if(n===null)return null;var r=Qa(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(Q(231,t,typeof n));return n}var Du=!1;if(fn)try{var Io={};Object.defineProperty(Io,"passive",{get:function(){Du=!0}}),window.addEventListener("test",Io,Io),window.removeEventListener("test",Io,Io)}catch{Du=!1}function H_(e,t,n,r,o,i,s,a,l){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(d){this.onError(d)}}var ei=!1,sa=null,aa=!1,Lu=null,B_={onError:function(e){ei=!0,sa=e}};function U_(e,t,n,r,o,i,s,a,l){ei=!1,sa=null,H_.apply(B_,arguments)}function W_(e,t,n,r,o,i,s,a,l){if(U_.apply(this,arguments),ei){if(ei){var u=sa;ei=!1,sa=null}else throw Error(Q(198));aa||(aa=!0,Lu=u)}}function Pr(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function Og(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function ph(e){if(Pr(e)!==e)throw Error(Q(188))}function q_(e){var t=e.alternate;if(!t){if(t=Pr(e),t===null)throw Error(Q(188));return t!==e?null:e}for(var n=e,r=t;;){var o=n.return;if(o===null)break;var i=o.alternate;if(i===null){if(r=o.return,r!==null){n=r;continue}break}if(o.child===i.child){for(i=o.child;i;){if(i===n)return ph(o),e;if(i===r)return ph(o),t;i=i.sibling}throw Error(Q(188))}if(n.return!==r.return)n=o,r=i;else{for(var s=!1,a=o.child;a;){if(a===n){s=!0,n=o,r=i;break}if(a===r){s=!0,r=o,n=i;break}a=a.sibling}if(!s){for(a=i.child;a;){if(a===n){s=!0,n=i,r=o;break}if(a===r){s=!0,r=i,n=o;break}a=a.sibling}if(!s)throw Error(Q(189))}}if(n.alternate!==r)throw Error(Q(190))}if(n.tag!==3)throw Error(Q(188));return n.stateNode.current===n?e:t}function Dg(e){return e=q_(e),e!==null?Lg(e):null}function Lg(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Lg(e);if(t!==null)return t;e=e.sibling}return null}var Vg=dt.unstable_scheduleCallback,mh=dt.unstable_cancelCallback,K_=dt.unstable_shouldYield,X_=dt.unstable_requestPaint,be=dt.unstable_now,Y_=dt.unstable_getCurrentPriorityLevel,Jc=dt.unstable_ImmediatePriority,Fg=dt.unstable_UserBlockingPriority,la=dt.unstable_NormalPriority,G_=dt.unstable_LowPriority,Hg=dt.unstable_IdlePriority,Ka=null,Xt=null;function Q_(e){if(Xt&&typeof Xt.onCommitFiberRoot=="function")try{Xt.onCommitFiberRoot(Ka,e,void 0,(e.current.flags&128)===128)}catch{}}var Lt=Math.clz32?Math.clz32:e$,Z_=Math.log,J_=Math.LN2;function e$(e){return e>>>=0,e===0?32:31-(Z_(e)/J_|0)|0}var ls=64,us=4194304;function Ko(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 ua(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,o=e.suspendedLanes,i=e.pingedLanes,s=n&268435455;if(s!==0){var a=s&~o;a!==0?r=Ko(a):(i&=s,i!==0&&(r=Ko(i)))}else s=n&~o,s!==0?r=Ko(s):i!==0&&(r=Ko(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&o)&&(o=r&-r,i=t&-t,o>=i||o===16&&(i&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-Lt(t),o=1<<n,r|=e[n],t&=~o;return r}function t$(e,t){switch(e){case 1:case 2:case 4:return t+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 t+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 n$(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,o=e.expirationTimes,i=e.pendingLanes;0<i;){var s=31-Lt(i),a=1<<s,l=o[s];l===-1?(!(a&n)||a&r)&&(o[s]=t$(a,t)):l<=t&&(e.expiredLanes|=a),i&=~a}}function Vu(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Bg(){var e=ls;return ls<<=1,!(ls&4194240)&&(ls=64),e}function Ll(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Bi(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Lt(t),e[t]=n}function r$(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var o=31-Lt(n),i=1<<o;t[o]=0,r[o]=-1,e[o]=-1,n&=~i}}function ed(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Lt(n),o=1<<r;o&t|e[r]&t&&(e[r]|=t),n&=~o}}var fe=0;function Ug(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Wg,td,qg,Kg,Xg,Fu=!1,cs=[],zn=null,An=null,On=null,yi=new Map,vi=new Map,Cn=[],o$="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 gh(e,t){switch(e){case"focusin":case"focusout":zn=null;break;case"dragenter":case"dragleave":An=null;break;case"mouseover":case"mouseout":On=null;break;case"pointerover":case"pointerout":yi.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":vi.delete(t.pointerId)}}function Ro(e,t,n,r,o,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:i,targetContainers:[o]},t!==null&&(t=Wi(t),t!==null&&td(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function i$(e,t,n,r,o){switch(t){case"focusin":return zn=Ro(zn,e,t,n,r,o),!0;case"dragenter":return An=Ro(An,e,t,n,r,o),!0;case"mouseover":return On=Ro(On,e,t,n,r,o),!0;case"pointerover":var i=o.pointerId;return yi.set(i,Ro(yi.get(i)||null,e,t,n,r,o)),!0;case"gotpointercapture":return i=o.pointerId,vi.set(i,Ro(vi.get(i)||null,e,t,n,r,o)),!0}return!1}function Yg(e){var t=ir(e.target);if(t!==null){var n=Pr(t);if(n!==null){if(t=n.tag,t===13){if(t=Og(n),t!==null){e.blockedOn=t,Xg(e.priority,function(){qg(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Ls(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Hu(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Au=r,n.target.dispatchEvent(r),Au=null}else return t=Wi(n),t!==null&&td(t),e.blockedOn=n,!1;t.shift()}return!0}function yh(e,t,n){Ls(e)&&n.delete(t)}function s$(){Fu=!1,zn!==null&&Ls(zn)&&(zn=null),An!==null&&Ls(An)&&(An=null),On!==null&&Ls(On)&&(On=null),yi.forEach(yh),vi.forEach(yh)}function zo(e,t){e.blockedOn===t&&(e.blockedOn=null,Fu||(Fu=!0,dt.unstable_scheduleCallback(dt.unstable_NormalPriority,s$)))}function wi(e){function t(o){return zo(o,e)}if(0<cs.length){zo(cs[0],e);for(var n=1;n<cs.length;n++){var r=cs[n];r.blockedOn===e&&(r.blockedOn=null)}}for(zn!==null&&zo(zn,e),An!==null&&zo(An,e),On!==null&&zo(On,e),yi.forEach(t),vi.forEach(t),n=0;n<Cn.length;n++)r=Cn[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<Cn.length&&(n=Cn[0],n.blockedOn===null);)Yg(n),n.blockedOn===null&&Cn.shift()}var Qr=vn.ReactCurrentBatchConfig,ca=!0;function a$(e,t,n,r){var o=fe,i=Qr.transition;Qr.transition=null;try{fe=1,nd(e,t,n,r)}finally{fe=o,Qr.transition=i}}function l$(e,t,n,r){var o=fe,i=Qr.transition;Qr.transition=null;try{fe=4,nd(e,t,n,r)}finally{fe=o,Qr.transition=i}}function nd(e,t,n,r){if(ca){var o=Hu(e,t,n,r);if(o===null)Yl(e,t,r,da,n),gh(e,r);else if(i$(o,e,t,n,r))r.stopPropagation();else if(gh(e,r),t&4&&-1<o$.indexOf(e)){for(;o!==null;){var i=Wi(o);if(i!==null&&Wg(i),i=Hu(e,t,n,r),i===null&&Yl(e,t,r,da,n),i===o)break;o=i}o!==null&&r.stopPropagation()}else Yl(e,t,r,null,n)}}var da=null;function Hu(e,t,n,r){if(da=null,e=Zc(r),e=ir(e),e!==null)if(t=Pr(e),t===null)e=null;else if(n=t.tag,n===13){if(e=Og(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return da=e,null}function Gg(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(Y_()){case Jc:return 1;case Fg:return 4;case la:case G_:return 16;case Hg:return 536870912;default:return 16}default:return 16}}var Mn=null,rd=null,Vs=null;function Qg(){if(Vs)return Vs;var e,t=rd,n=t.length,r,o="value"in Mn?Mn.value:Mn.textContent,i=o.length;for(e=0;e<n&&t[e]===o[e];e++);var s=n-e;for(r=1;r<=s&&t[n-r]===o[i-r];r++);return Vs=o.slice(e,1<r?1-r:void 0)}function Fs(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function ds(){return!0}function vh(){return!1}function pt(e){function t(n,r,o,i,s){this._reactName=n,this._targetInst=o,this.type=r,this.nativeEvent=i,this.target=s,this.currentTarget=null;for(var a in e)e.hasOwnProperty(a)&&(n=e[a],this[a]=n?n(i):i[a]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?ds:vh,this.isPropagationStopped=vh,this}return ke(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=ds)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=ds)},persist:function(){},isPersistent:ds}),t}var xo={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},od=pt(xo),Ui=ke({},xo,{view:0,detail:0}),u$=pt(Ui),Vl,Fl,Ao,Xa=ke({},Ui,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:id,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!==Ao&&(Ao&&e.type==="mousemove"?(Vl=e.screenX-Ao.screenX,Fl=e.screenY-Ao.screenY):Fl=Vl=0,Ao=e),Vl)},movementY:function(e){return"movementY"in e?e.movementY:Fl}}),wh=pt(Xa),c$=ke({},Xa,{dataTransfer:0}),d$=pt(c$),f$=ke({},Ui,{relatedTarget:0}),Hl=pt(f$),h$=ke({},xo,{animationName:0,elapsedTime:0,pseudoElement:0}),p$=pt(h$),m$=ke({},xo,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),g$=pt(m$),y$=ke({},xo,{data:0}),_h=pt(y$),v$={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},w$={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"},_$={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function $$(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=_$[e])?!!t[e]:!1}function id(){return $$}var x$=ke({},Ui,{key:function(e){if(e.key){var t=v$[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Fs(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?w$[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:id,charCode:function(e){return e.type==="keypress"?Fs(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Fs(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),S$=pt(x$),E$=ke({},Xa,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),$h=pt(E$),k$=ke({},Ui,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:id}),N$=pt(k$),P$=ke({},xo,{propertyName:0,elapsedTime:0,pseudoElement:0}),C$=pt(P$),b$=ke({},Xa,{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}),j$=pt(b$),M$=[9,13,27,32],sd=fn&&"CompositionEvent"in window,ti=null;fn&&"documentMode"in document&&(ti=document.documentMode);var T$=fn&&"TextEvent"in window&&!ti,Zg=fn&&(!sd||ti&&8<ti&&11>=ti),xh=" ",Sh=!1;function Jg(e,t){switch(e){case"keyup":return M$.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function e0(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var zr=!1;function I$(e,t){switch(e){case"compositionend":return e0(t);case"keypress":return t.which!==32?null:(Sh=!0,xh);case"textInput":return e=t.data,e===xh&&Sh?null:e;default:return null}}function R$(e,t){if(zr)return e==="compositionend"||!sd&&Jg(e,t)?(e=Qg(),Vs=rd=Mn=null,zr=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Zg&&t.locale!=="ko"?null:t.data;default:return null}}var z$={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 Eh(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!z$[e.type]:t==="textarea"}function t0(e,t,n,r){Tg(r),t=fa(t,"onChange"),0<t.length&&(n=new od("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var ni=null,_i=null;function A$(e){f0(e,0)}function Ya(e){var t=Dr(e);if(kg(t))return e}function O$(e,t){if(e==="change")return t}var n0=!1;if(fn){var Bl;if(fn){var Ul="oninput"in document;if(!Ul){var kh=document.createElement("div");kh.setAttribute("oninput","return;"),Ul=typeof kh.oninput=="function"}Bl=Ul}else Bl=!1;n0=Bl&&(!document.documentMode||9<document.documentMode)}function Nh(){ni&&(ni.detachEvent("onpropertychange",r0),_i=ni=null)}function r0(e){if(e.propertyName==="value"&&Ya(_i)){var t=[];t0(t,_i,e,Zc(e)),Ag(A$,t)}}function D$(e,t,n){e==="focusin"?(Nh(),ni=t,_i=n,ni.attachEvent("onpropertychange",r0)):e==="focusout"&&Nh()}function L$(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ya(_i)}function V$(e,t){if(e==="click")return Ya(t)}function F$(e,t){if(e==="input"||e==="change")return Ya(t)}function H$(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Ft=typeof Object.is=="function"?Object.is:H$;function $i(e,t){if(Ft(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var o=n[r];if(!Eu.call(t,o)||!Ft(e[o],t[o]))return!1}return!0}function Ph(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Ch(e,t){var n=Ph(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Ph(n)}}function o0(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?o0(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function i0(){for(var e=window,t=ia();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=ia(e.document)}return t}function ad(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function B$(e){var t=i0(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&o0(n.ownerDocument.documentElement,n)){if(r!==null&&ad(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var o=n.textContent.length,i=Math.min(r.start,o);r=r.end===void 0?i:Math.min(r.end,o),!e.extend&&i>r&&(o=r,r=i,i=o),o=Ch(n,i);var s=Ch(n,r);o&&s&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var U$=fn&&"documentMode"in document&&11>=document.documentMode,Ar=null,Bu=null,ri=null,Uu=!1;function bh(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Uu||Ar==null||Ar!==ia(r)||(r=Ar,"selectionStart"in r&&ad(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),ri&&$i(ri,r)||(ri=r,r=fa(Bu,"onSelect"),0<r.length&&(t=new od("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Ar)))}function fs(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Or={animationend:fs("Animation","AnimationEnd"),animationiteration:fs("Animation","AnimationIteration"),animationstart:fs("Animation","AnimationStart"),transitionend:fs("Transition","TransitionEnd")},Wl={},s0={};fn&&(s0=document.createElement("div").style,"AnimationEvent"in window||(delete Or.animationend.animation,delete Or.animationiteration.animation,delete Or.animationstart.animation),"TransitionEvent"in window||delete Or.transitionend.transition);function Ga(e){if(Wl[e])return Wl[e];if(!Or[e])return e;var t=Or[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in s0)return Wl[e]=t[n];return e}var a0=Ga("animationend"),l0=Ga("animationiteration"),u0=Ga("animationstart"),c0=Ga("transitionend"),d0=new Map,jh="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 Kn(e,t){d0.set(e,t),Nr(t,[e])}for(var ql=0;ql<jh.length;ql++){var Kl=jh[ql],W$=Kl.toLowerCase(),q$=Kl[0].toUpperCase()+Kl.slice(1);Kn(W$,"on"+q$)}Kn(a0,"onAnimationEnd");Kn(l0,"onAnimationIteration");Kn(u0,"onAnimationStart");Kn("dblclick","onDoubleClick");Kn("focusin","onFocus");Kn("focusout","onBlur");Kn(c0,"onTransitionEnd");oo("onMouseEnter",["mouseout","mouseover"]);oo("onMouseLeave",["mouseout","mouseover"]);oo("onPointerEnter",["pointerout","pointerover"]);oo("onPointerLeave",["pointerout","pointerover"]);Nr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Nr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Nr("onBeforeInput",["compositionend","keypress","textInput","paste"]);Nr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Nr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Nr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Xo="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),K$=new Set("cancel close invalid load scroll toggle".split(" ").concat(Xo));function Mh(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,W_(r,t,void 0,e),e.currentTarget=null}function f0(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],o=r.event;r=r.listeners;e:{var i=void 0;if(t)for(var s=r.length-1;0<=s;s--){var a=r[s],l=a.instance,u=a.currentTarget;if(a=a.listener,l!==i&&o.isPropagationStopped())break e;Mh(o,a,u),i=l}else for(s=0;s<r.length;s++){if(a=r[s],l=a.instance,u=a.currentTarget,a=a.listener,l!==i&&o.isPropagationStopped())break e;Mh(o,a,u),i=l}}}if(aa)throw e=Lu,aa=!1,Lu=null,e}function ge(e,t){var n=t[Yu];n===void 0&&(n=t[Yu]=new Set);var r=e+"__bubble";n.has(r)||(h0(t,e,2,!1),n.add(r))}function Xl(e,t,n){var r=0;t&&(r|=4),h0(n,e,r,t)}var hs="_reactListening"+Math.random().toString(36).slice(2);function xi(e){if(!e[hs]){e[hs]=!0,_g.forEach(function(n){n!=="selectionchange"&&(K$.has(n)||Xl(n,!1,e),Xl(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[hs]||(t[hs]=!0,Xl("selectionchange",!1,t))}}function h0(e,t,n,r){switch(Gg(t)){case 1:var o=a$;break;case 4:o=l$;break;default:o=nd}n=o.bind(null,t,n,e),o=void 0,!Du||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(o=!0),r?o!==void 0?e.addEventListener(t,n,{capture:!0,passive:o}):e.addEventListener(t,n,!0):o!==void 0?e.addEventListener(t,n,{passive:o}):e.addEventListener(t,n,!1)}function Yl(e,t,n,r,o){var i=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var a=r.stateNode.containerInfo;if(a===o||a.nodeType===8&&a.parentNode===o)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&(l=s.stateNode.containerInfo,l===o||l.nodeType===8&&l.parentNode===o))return;s=s.return}for(;a!==null;){if(s=ir(a),s===null)return;if(l=s.tag,l===5||l===6){r=i=s;continue e}a=a.parentNode}}r=r.return}Ag(function(){var u=i,d=Zc(n),c=[];e:{var f=d0.get(e);if(f!==void 0){var m=od,y=e;switch(e){case"keypress":if(Fs(n)===0)break e;case"keydown":case"keyup":m=S$;break;case"focusin":y="focus",m=Hl;break;case"focusout":y="blur",m=Hl;break;case"beforeblur":case"afterblur":m=Hl;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":m=wh;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":m=d$;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":m=N$;break;case a0:case l0:case u0:m=p$;break;case c0:m=C$;break;case"scroll":m=u$;break;case"wheel":m=j$;break;case"copy":case"cut":case"paste":m=g$;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":m=$h}var v=(t&4)!==0,w=!v&&e==="scroll",h=v?f!==null?f+"Capture":null:f;v=[];for(var g=u,p;g!==null;){p=g;var _=p.stateNode;if(p.tag===5&&_!==null&&(p=_,h!==null&&(_=gi(g,h),_!=null&&v.push(Si(g,_,p)))),w)break;g=g.return}0<v.length&&(f=new m(f,y,null,n,d),c.push({event:f,listeners:v}))}}if(!(t&7)){e:{if(f=e==="mouseover"||e==="pointerover",m=e==="mouseout"||e==="pointerout",f&&n!==Au&&(y=n.relatedTarget||n.fromElement)&&(ir(y)||y[hn]))break e;if((m||f)&&(f=d.window===d?d:(f=d.ownerDocument)?f.defaultView||f.parentWindow:window,m?(y=n.relatedTarget||n.toElement,m=u,y=y?ir(y):null,y!==null&&(w=Pr(y),y!==w||y.tag!==5&&y.tag!==6)&&(y=null)):(m=null,y=u),m!==y)){if(v=wh,_="onMouseLeave",h="onMouseEnter",g="mouse",(e==="pointerout"||e==="pointerover")&&(v=$h,_="onPointerLeave",h="onPointerEnter",g="pointer"),w=m==null?f:Dr(m),p=y==null?f:Dr(y),f=new v(_,g+"leave",m,n,d),f.target=w,f.relatedTarget=p,_=null,ir(d)===u&&(v=new v(h,g+"enter",y,n,d),v.target=p,v.relatedTarget=w,_=v),w=_,m&&y)t:{for(v=m,h=y,g=0,p=v;p;p=br(p))g++;for(p=0,_=h;_;_=br(_))p++;for(;0<g-p;)v=br(v),g--;for(;0<p-g;)h=br(h),p--;for(;g--;){if(v===h||h!==null&&v===h.alternate)break t;v=br(v),h=br(h)}v=null}else v=null;m!==null&&Th(c,f,m,v,!1),y!==null&&w!==null&&Th(c,w,y,v,!0)}}e:{if(f=u?Dr(u):window,m=f.nodeName&&f.nodeName.toLowerCase(),m==="select"||m==="input"&&f.type==="file")var x=O$;else if(Eh(f))if(n0)x=F$;else{x=L$;var k=D$}else(m=f.nodeName)&&m.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(x=V$);if(x&&(x=x(e,u))){t0(c,x,n,d);break e}k&&k(e,f,u),e==="focusout"&&(k=f._wrapperState)&&k.controlled&&f.type==="number"&&Mu(f,"number",f.value)}switch(k=u?Dr(u):window,e){case"focusin":(Eh(k)||k.contentEditable==="true")&&(Ar=k,Bu=u,ri=null);break;case"focusout":ri=Bu=Ar=null;break;case"mousedown":Uu=!0;break;case"contextmenu":case"mouseup":case"dragend":Uu=!1,bh(c,n,d);break;case"selectionchange":if(U$)break;case"keydown":case"keyup":bh(c,n,d)}var P;if(sd)e:{switch(e){case"compositionstart":var b="onCompositionStart";break e;case"compositionend":b="onCompositionEnd";break e;case"compositionupdate":b="onCompositionUpdate";break e}b=void 0}else zr?Jg(e,n)&&(b="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(b="onCompositionStart");b&&(Zg&&n.locale!=="ko"&&(zr||b!=="onCompositionStart"?b==="onCompositionEnd"&&zr&&(P=Qg()):(Mn=d,rd="value"in Mn?Mn.value:Mn.textContent,zr=!0)),k=fa(u,b),0<k.length&&(b=new _h(b,e,null,n,d),c.push({event:b,listeners:k}),P?b.data=P:(P=e0(n),P!==null&&(b.data=P)))),(P=T$?I$(e,n):R$(e,n))&&(u=fa(u,"onBeforeInput"),0<u.length&&(d=new _h("onBeforeInput","beforeinput",null,n,d),c.push({event:d,listeners:u}),d.data=P))}f0(c,t)})}function Si(e,t,n){return{instance:e,listener:t,currentTarget:n}}function fa(e,t){for(var n=t+"Capture",r=[];e!==null;){var o=e,i=o.stateNode;o.tag===5&&i!==null&&(o=i,i=gi(e,n),i!=null&&r.unshift(Si(e,i,o)),i=gi(e,t),i!=null&&r.push(Si(e,i,o))),e=e.return}return r}function br(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Th(e,t,n,r,o){for(var i=t._reactName,s=[];n!==null&&n!==r;){var a=n,l=a.alternate,u=a.stateNode;if(l!==null&&l===r)break;a.tag===5&&u!==null&&(a=u,o?(l=gi(n,i),l!=null&&s.unshift(Si(n,l,a))):o||(l=gi(n,i),l!=null&&s.push(Si(n,l,a)))),n=n.return}s.length!==0&&e.push({event:t,listeners:s})}var X$=/\r\n?/g,Y$=/\u0000|\uFFFD/g;function Ih(e){return(typeof e=="string"?e:""+e).replace(X$,`
|
|
38
|
+
`).replace(Y$,"")}function ps(e,t,n){if(t=Ih(t),Ih(e)!==t&&n)throw Error(Q(425))}function ha(){}var Wu=null,qu=null;function Ku(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Xu=typeof setTimeout=="function"?setTimeout:void 0,G$=typeof clearTimeout=="function"?clearTimeout:void 0,Rh=typeof Promise=="function"?Promise:void 0,Q$=typeof queueMicrotask=="function"?queueMicrotask:typeof Rh<"u"?function(e){return Rh.resolve(null).then(e).catch(Z$)}:Xu;function Z$(e){setTimeout(function(){throw e})}function Gl(e,t){var n=t,r=0;do{var o=n.nextSibling;if(e.removeChild(n),o&&o.nodeType===8)if(n=o.data,n==="/$"){if(r===0){e.removeChild(o),wi(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=o}while(n);wi(t)}function Dn(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function zh(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var So=Math.random().toString(36).slice(2),Kt="__reactFiber$"+So,Ei="__reactProps$"+So,hn="__reactContainer$"+So,Yu="__reactEvents$"+So,J$="__reactListeners$"+So,ex="__reactHandles$"+So;function ir(e){var t=e[Kt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[hn]||n[Kt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=zh(e);e!==null;){if(n=e[Kt])return n;e=zh(e)}return t}e=n,n=e.parentNode}return null}function Wi(e){return e=e[Kt]||e[hn],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Dr(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(Q(33))}function Qa(e){return e[Ei]||null}var Gu=[],Lr=-1;function Xn(e){return{current:e}}function ye(e){0>Lr||(e.current=Gu[Lr],Gu[Lr]=null,Lr--)}function me(e,t){Lr++,Gu[Lr]=e.current,e.current=t}var Wn={},Xe=Xn(Wn),ot=Xn(!1),pr=Wn;function io(e,t){var n=e.type.contextTypes;if(!n)return Wn;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={},i;for(i in n)o[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function it(e){return e=e.childContextTypes,e!=null}function pa(){ye(ot),ye(Xe)}function Ah(e,t,n){if(Xe.current!==Wn)throw Error(Q(168));me(Xe,t),me(ot,n)}function p0(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var o in r)if(!(o in t))throw Error(Q(108,D_(e)||"Unknown",o));return ke({},n,r)}function ma(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Wn,pr=Xe.current,me(Xe,e),me(ot,ot.current),!0}function Oh(e,t,n){var r=e.stateNode;if(!r)throw Error(Q(169));n?(e=p0(e,t,pr),r.__reactInternalMemoizedMergedChildContext=e,ye(ot),ye(Xe),me(Xe,e)):ye(ot),me(ot,n)}var sn=null,Za=!1,Ql=!1;function m0(e){sn===null?sn=[e]:sn.push(e)}function tx(e){Za=!0,m0(e)}function Yn(){if(!Ql&&sn!==null){Ql=!0;var e=0,t=fe;try{var n=sn;for(fe=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}sn=null,Za=!1}catch(o){throw sn!==null&&(sn=sn.slice(e+1)),Vg(Jc,Yn),o}finally{fe=t,Ql=!1}}return null}var Vr=[],Fr=0,ga=null,ya=0,$t=[],xt=0,mr=null,an=1,ln="";function Jn(e,t){Vr[Fr++]=ya,Vr[Fr++]=ga,ga=e,ya=t}function g0(e,t,n){$t[xt++]=an,$t[xt++]=ln,$t[xt++]=mr,mr=e;var r=an;e=ln;var o=32-Lt(r)-1;r&=~(1<<o),n+=1;var i=32-Lt(t)+o;if(30<i){var s=o-o%5;i=(r&(1<<s)-1).toString(32),r>>=s,o-=s,an=1<<32-Lt(t)+o|n<<o|r,ln=i+e}else an=1<<i|n<<o|r,ln=e}function ld(e){e.return!==null&&(Jn(e,1),g0(e,1,0))}function ud(e){for(;e===ga;)ga=Vr[--Fr],Vr[Fr]=null,ya=Vr[--Fr],Vr[Fr]=null;for(;e===mr;)mr=$t[--xt],$t[xt]=null,ln=$t[--xt],$t[xt]=null,an=$t[--xt],$t[xt]=null}var ct=null,ut=null,we=!1,Rt=null;function y0(e,t){var n=St(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function Dh(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,ct=e,ut=Dn(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,ct=e,ut=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=mr!==null?{id:an,overflow:ln}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=St(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,ct=e,ut=null,!0):!1;default:return!1}}function Qu(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Zu(e){if(we){var t=ut;if(t){var n=t;if(!Dh(e,t)){if(Qu(e))throw Error(Q(418));t=Dn(n.nextSibling);var r=ct;t&&Dh(e,t)?y0(r,n):(e.flags=e.flags&-4097|2,we=!1,ct=e)}}else{if(Qu(e))throw Error(Q(418));e.flags=e.flags&-4097|2,we=!1,ct=e}}}function Lh(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;ct=e}function ms(e){if(e!==ct)return!1;if(!we)return Lh(e),we=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Ku(e.type,e.memoizedProps)),t&&(t=ut)){if(Qu(e))throw v0(),Error(Q(418));for(;t;)y0(e,t),t=Dn(t.nextSibling)}if(Lh(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(Q(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){ut=Dn(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}ut=null}}else ut=ct?Dn(e.stateNode.nextSibling):null;return!0}function v0(){for(var e=ut;e;)e=Dn(e.nextSibling)}function so(){ut=ct=null,we=!1}function cd(e){Rt===null?Rt=[e]:Rt.push(e)}var nx=vn.ReactCurrentBatchConfig;function Oo(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(Q(309));var r=n.stateNode}if(!r)throw Error(Q(147,e));var o=r,i=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===i?t.ref:(t=function(s){var a=o.refs;s===null?delete a[i]:a[i]=s},t._stringRef=i,t)}if(typeof e!="string")throw Error(Q(284));if(!n._owner)throw Error(Q(290,e))}return e}function gs(e,t){throw e=Object.prototype.toString.call(t),Error(Q(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Vh(e){var t=e._init;return t(e._payload)}function w0(e){function t(h,g){if(e){var p=h.deletions;p===null?(h.deletions=[g],h.flags|=16):p.push(g)}}function n(h,g){if(!e)return null;for(;g!==null;)t(h,g),g=g.sibling;return null}function r(h,g){for(h=new Map;g!==null;)g.key!==null?h.set(g.key,g):h.set(g.index,g),g=g.sibling;return h}function o(h,g){return h=Hn(h,g),h.index=0,h.sibling=null,h}function i(h,g,p){return h.index=p,e?(p=h.alternate,p!==null?(p=p.index,p<g?(h.flags|=2,g):p):(h.flags|=2,g)):(h.flags|=1048576,g)}function s(h){return e&&h.alternate===null&&(h.flags|=2),h}function a(h,g,p,_){return g===null||g.tag!==6?(g=ou(p,h.mode,_),g.return=h,g):(g=o(g,p),g.return=h,g)}function l(h,g,p,_){var x=p.type;return x===Rr?d(h,g,p.props.children,_,p.key):g!==null&&(g.elementType===x||typeof x=="object"&&x!==null&&x.$$typeof===Nn&&Vh(x)===g.type)?(_=o(g,p.props),_.ref=Oo(h,g,p),_.return=h,_):(_=Xs(p.type,p.key,p.props,null,h.mode,_),_.ref=Oo(h,g,p),_.return=h,_)}function u(h,g,p,_){return g===null||g.tag!==4||g.stateNode.containerInfo!==p.containerInfo||g.stateNode.implementation!==p.implementation?(g=iu(p,h.mode,_),g.return=h,g):(g=o(g,p.children||[]),g.return=h,g)}function d(h,g,p,_,x){return g===null||g.tag!==7?(g=dr(p,h.mode,_,x),g.return=h,g):(g=o(g,p),g.return=h,g)}function c(h,g,p){if(typeof g=="string"&&g!==""||typeof g=="number")return g=ou(""+g,h.mode,p),g.return=h,g;if(typeof g=="object"&&g!==null){switch(g.$$typeof){case is:return p=Xs(g.type,g.key,g.props,null,h.mode,p),p.ref=Oo(h,null,g),p.return=h,p;case Ir:return g=iu(g,h.mode,p),g.return=h,g;case Nn:var _=g._init;return c(h,_(g._payload),p)}if(qo(g)||To(g))return g=dr(g,h.mode,p,null),g.return=h,g;gs(h,g)}return null}function f(h,g,p,_){var x=g!==null?g.key:null;if(typeof p=="string"&&p!==""||typeof p=="number")return x!==null?null:a(h,g,""+p,_);if(typeof p=="object"&&p!==null){switch(p.$$typeof){case is:return p.key===x?l(h,g,p,_):null;case Ir:return p.key===x?u(h,g,p,_):null;case Nn:return x=p._init,f(h,g,x(p._payload),_)}if(qo(p)||To(p))return x!==null?null:d(h,g,p,_,null);gs(h,p)}return null}function m(h,g,p,_,x){if(typeof _=="string"&&_!==""||typeof _=="number")return h=h.get(p)||null,a(g,h,""+_,x);if(typeof _=="object"&&_!==null){switch(_.$$typeof){case is:return h=h.get(_.key===null?p:_.key)||null,l(g,h,_,x);case Ir:return h=h.get(_.key===null?p:_.key)||null,u(g,h,_,x);case Nn:var k=_._init;return m(h,g,p,k(_._payload),x)}if(qo(_)||To(_))return h=h.get(p)||null,d(g,h,_,x,null);gs(g,_)}return null}function y(h,g,p,_){for(var x=null,k=null,P=g,b=g=0,F=null;P!==null&&b<p.length;b++){P.index>b?(F=P,P=null):F=P.sibling;var W=f(h,P,p[b],_);if(W===null){P===null&&(P=F);break}e&&P&&W.alternate===null&&t(h,P),g=i(W,g,b),k===null?x=W:k.sibling=W,k=W,P=F}if(b===p.length)return n(h,P),we&&Jn(h,b),x;if(P===null){for(;b<p.length;b++)P=c(h,p[b],_),P!==null&&(g=i(P,g,b),k===null?x=P:k.sibling=P,k=P);return we&&Jn(h,b),x}for(P=r(h,P);b<p.length;b++)F=m(P,h,b,p[b],_),F!==null&&(e&&F.alternate!==null&&P.delete(F.key===null?b:F.key),g=i(F,g,b),k===null?x=F:k.sibling=F,k=F);return e&&P.forEach(function(I){return t(h,I)}),we&&Jn(h,b),x}function v(h,g,p,_){var x=To(p);if(typeof x!="function")throw Error(Q(150));if(p=x.call(p),p==null)throw Error(Q(151));for(var k=x=null,P=g,b=g=0,F=null,W=p.next();P!==null&&!W.done;b++,W=p.next()){P.index>b?(F=P,P=null):F=P.sibling;var I=f(h,P,W.value,_);if(I===null){P===null&&(P=F);break}e&&P&&I.alternate===null&&t(h,P),g=i(I,g,b),k===null?x=I:k.sibling=I,k=I,P=F}if(W.done)return n(h,P),we&&Jn(h,b),x;if(P===null){for(;!W.done;b++,W=p.next())W=c(h,W.value,_),W!==null&&(g=i(W,g,b),k===null?x=W:k.sibling=W,k=W);return we&&Jn(h,b),x}for(P=r(h,P);!W.done;b++,W=p.next())W=m(P,h,b,W.value,_),W!==null&&(e&&W.alternate!==null&&P.delete(W.key===null?b:W.key),g=i(W,g,b),k===null?x=W:k.sibling=W,k=W);return e&&P.forEach(function(H){return t(h,H)}),we&&Jn(h,b),x}function w(h,g,p,_){if(typeof p=="object"&&p!==null&&p.type===Rr&&p.key===null&&(p=p.props.children),typeof p=="object"&&p!==null){switch(p.$$typeof){case is:e:{for(var x=p.key,k=g;k!==null;){if(k.key===x){if(x=p.type,x===Rr){if(k.tag===7){n(h,k.sibling),g=o(k,p.props.children),g.return=h,h=g;break e}}else if(k.elementType===x||typeof x=="object"&&x!==null&&x.$$typeof===Nn&&Vh(x)===k.type){n(h,k.sibling),g=o(k,p.props),g.ref=Oo(h,k,p),g.return=h,h=g;break e}n(h,k);break}else t(h,k);k=k.sibling}p.type===Rr?(g=dr(p.props.children,h.mode,_,p.key),g.return=h,h=g):(_=Xs(p.type,p.key,p.props,null,h.mode,_),_.ref=Oo(h,g,p),_.return=h,h=_)}return s(h);case Ir:e:{for(k=p.key;g!==null;){if(g.key===k)if(g.tag===4&&g.stateNode.containerInfo===p.containerInfo&&g.stateNode.implementation===p.implementation){n(h,g.sibling),g=o(g,p.children||[]),g.return=h,h=g;break e}else{n(h,g);break}else t(h,g);g=g.sibling}g=iu(p,h.mode,_),g.return=h,h=g}return s(h);case Nn:return k=p._init,w(h,g,k(p._payload),_)}if(qo(p))return y(h,g,p,_);if(To(p))return v(h,g,p,_);gs(h,p)}return typeof p=="string"&&p!==""||typeof p=="number"?(p=""+p,g!==null&&g.tag===6?(n(h,g.sibling),g=o(g,p),g.return=h,h=g):(n(h,g),g=ou(p,h.mode,_),g.return=h,h=g),s(h)):n(h,g)}return w}var ao=w0(!0),_0=w0(!1),va=Xn(null),wa=null,Hr=null,dd=null;function fd(){dd=Hr=wa=null}function hd(e){var t=va.current;ye(va),e._currentValue=t}function Ju(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Zr(e,t){wa=e,dd=Hr=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(nt=!0),e.firstContext=null)}function kt(e){var t=e._currentValue;if(dd!==e)if(e={context:e,memoizedValue:t,next:null},Hr===null){if(wa===null)throw Error(Q(308));Hr=e,wa.dependencies={lanes:0,firstContext:e}}else Hr=Hr.next=e;return t}var sr=null;function pd(e){sr===null?sr=[e]:sr.push(e)}function $0(e,t,n,r){var o=t.interleaved;return o===null?(n.next=n,pd(t)):(n.next=o.next,o.next=n),t.interleaved=n,pn(e,r)}function pn(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Pn=!1;function md(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function x0(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function cn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Ln(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,ce&2){var o=r.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),r.pending=t,pn(e,n)}return o=r.interleaved,o===null?(t.next=t,pd(r)):(t.next=o.next,o.next=t),r.interleaved=t,pn(e,n)}function Hs(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ed(e,n)}}function Fh(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var o=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var s={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?o=i=s:i=i.next=s,n=n.next}while(n!==null);i===null?o=i=t:i=i.next=t}else o=i=t;n={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:i,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function _a(e,t,n,r){var o=e.updateQueue;Pn=!1;var i=o.firstBaseUpdate,s=o.lastBaseUpdate,a=o.shared.pending;if(a!==null){o.shared.pending=null;var l=a,u=l.next;l.next=null,s===null?i=u:s.next=u,s=l;var d=e.alternate;d!==null&&(d=d.updateQueue,a=d.lastBaseUpdate,a!==s&&(a===null?d.firstBaseUpdate=u:a.next=u,d.lastBaseUpdate=l))}if(i!==null){var c=o.baseState;s=0,d=u=l=null,a=i;do{var f=a.lane,m=a.eventTime;if((r&f)===f){d!==null&&(d=d.next={eventTime:m,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var y=e,v=a;switch(f=t,m=n,v.tag){case 1:if(y=v.payload,typeof y=="function"){c=y.call(m,c,f);break e}c=y;break e;case 3:y.flags=y.flags&-65537|128;case 0:if(y=v.payload,f=typeof y=="function"?y.call(m,c,f):y,f==null)break e;c=ke({},c,f);break e;case 2:Pn=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,f=o.effects,f===null?o.effects=[a]:f.push(a))}else m={eventTime:m,lane:f,tag:a.tag,payload:a.payload,callback:a.callback,next:null},d===null?(u=d=m,l=c):d=d.next=m,s|=f;if(a=a.next,a===null){if(a=o.shared.pending,a===null)break;f=a,a=f.next,f.next=null,o.lastBaseUpdate=f,o.shared.pending=null}}while(!0);if(d===null&&(l=c),o.baseState=l,o.firstBaseUpdate=u,o.lastBaseUpdate=d,t=o.shared.interleaved,t!==null){o=t;do s|=o.lane,o=o.next;while(o!==t)}else i===null&&(o.shared.lanes=0);yr|=s,e.lanes=s,e.memoizedState=c}}function Hh(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],o=r.callback;if(o!==null){if(r.callback=null,r=n,typeof o!="function")throw Error(Q(191,o));o.call(r)}}}var qi={},Yt=Xn(qi),ki=Xn(qi),Ni=Xn(qi);function ar(e){if(e===qi)throw Error(Q(174));return e}function gd(e,t){switch(me(Ni,t),me(ki,e),me(Yt,qi),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Iu(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Iu(t,e)}ye(Yt),me(Yt,t)}function lo(){ye(Yt),ye(ki),ye(Ni)}function S0(e){ar(Ni.current);var t=ar(Yt.current),n=Iu(t,e.type);t!==n&&(me(ki,e),me(Yt,n))}function yd(e){ki.current===e&&(ye(Yt),ye(ki))}var Se=Xn(0);function $a(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Zl=[];function vd(){for(var e=0;e<Zl.length;e++)Zl[e]._workInProgressVersionPrimary=null;Zl.length=0}var Bs=vn.ReactCurrentDispatcher,Jl=vn.ReactCurrentBatchConfig,gr=0,Ee=null,Ie=null,Oe=null,xa=!1,oi=!1,Pi=0,rx=0;function Ue(){throw Error(Q(321))}function wd(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Ft(e[n],t[n]))return!1;return!0}function _d(e,t,n,r,o,i){if(gr=i,Ee=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Bs.current=e===null||e.memoizedState===null?ax:lx,e=n(r,o),oi){i=0;do{if(oi=!1,Pi=0,25<=i)throw Error(Q(301));i+=1,Oe=Ie=null,t.updateQueue=null,Bs.current=ux,e=n(r,o)}while(oi)}if(Bs.current=Sa,t=Ie!==null&&Ie.next!==null,gr=0,Oe=Ie=Ee=null,xa=!1,t)throw Error(Q(300));return e}function $d(){var e=Pi!==0;return Pi=0,e}function Wt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Oe===null?Ee.memoizedState=Oe=e:Oe=Oe.next=e,Oe}function Nt(){if(Ie===null){var e=Ee.alternate;e=e!==null?e.memoizedState:null}else e=Ie.next;var t=Oe===null?Ee.memoizedState:Oe.next;if(t!==null)Oe=t,Ie=e;else{if(e===null)throw Error(Q(310));Ie=e,e={memoizedState:Ie.memoizedState,baseState:Ie.baseState,baseQueue:Ie.baseQueue,queue:Ie.queue,next:null},Oe===null?Ee.memoizedState=Oe=e:Oe=Oe.next=e}return Oe}function Ci(e,t){return typeof t=="function"?t(e):t}function eu(e){var t=Nt(),n=t.queue;if(n===null)throw Error(Q(311));n.lastRenderedReducer=e;var r=Ie,o=r.baseQueue,i=n.pending;if(i!==null){if(o!==null){var s=o.next;o.next=i.next,i.next=s}r.baseQueue=o=i,n.pending=null}if(o!==null){i=o.next,r=r.baseState;var a=s=null,l=null,u=i;do{var d=u.lane;if((gr&d)===d)l!==null&&(l=l.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),r=u.hasEagerState?u.eagerState:e(r,u.action);else{var c={lane:d,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};l===null?(a=l=c,s=r):l=l.next=c,Ee.lanes|=d,yr|=d}u=u.next}while(u!==null&&u!==i);l===null?s=r:l.next=a,Ft(r,t.memoizedState)||(nt=!0),t.memoizedState=r,t.baseState=s,t.baseQueue=l,n.lastRenderedState=r}if(e=n.interleaved,e!==null){o=e;do i=o.lane,Ee.lanes|=i,yr|=i,o=o.next;while(o!==e)}else o===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function tu(e){var t=Nt(),n=t.queue;if(n===null)throw Error(Q(311));n.lastRenderedReducer=e;var r=n.dispatch,o=n.pending,i=t.memoizedState;if(o!==null){n.pending=null;var s=o=o.next;do i=e(i,s.action),s=s.next;while(s!==o);Ft(i,t.memoizedState)||(nt=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function E0(){}function k0(e,t){var n=Ee,r=Nt(),o=t(),i=!Ft(r.memoizedState,o);if(i&&(r.memoizedState=o,nt=!0),r=r.queue,xd(C0.bind(null,n,r,e),[e]),r.getSnapshot!==t||i||Oe!==null&&Oe.memoizedState.tag&1){if(n.flags|=2048,bi(9,P0.bind(null,n,r,o,t),void 0,null),De===null)throw Error(Q(349));gr&30||N0(n,t,o)}return o}function N0(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Ee.updateQueue,t===null?(t={lastEffect:null,stores:null},Ee.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function P0(e,t,n,r){t.value=n,t.getSnapshot=r,b0(t)&&j0(e)}function C0(e,t,n){return n(function(){b0(t)&&j0(e)})}function b0(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Ft(e,n)}catch{return!0}}function j0(e){var t=pn(e,1);t!==null&&Vt(t,e,1,-1)}function Bh(e){var t=Wt();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Ci,lastRenderedState:e},t.queue=e,e=e.dispatch=sx.bind(null,Ee,e),[t.memoizedState,e]}function bi(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=Ee.updateQueue,t===null?(t={lastEffect:null,stores:null},Ee.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function M0(){return Nt().memoizedState}function Us(e,t,n,r){var o=Wt();Ee.flags|=e,o.memoizedState=bi(1|t,n,void 0,r===void 0?null:r)}function Ja(e,t,n,r){var o=Nt();r=r===void 0?null:r;var i=void 0;if(Ie!==null){var s=Ie.memoizedState;if(i=s.destroy,r!==null&&wd(r,s.deps)){o.memoizedState=bi(t,n,i,r);return}}Ee.flags|=e,o.memoizedState=bi(1|t,n,i,r)}function Uh(e,t){return Us(8390656,8,e,t)}function xd(e,t){return Ja(2048,8,e,t)}function T0(e,t){return Ja(4,2,e,t)}function I0(e,t){return Ja(4,4,e,t)}function R0(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function z0(e,t,n){return n=n!=null?n.concat([e]):null,Ja(4,4,R0.bind(null,t,e),n)}function Sd(){}function A0(e,t){var n=Nt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&wd(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function O0(e,t){var n=Nt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&wd(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function D0(e,t,n){return gr&21?(Ft(n,t)||(n=Bg(),Ee.lanes|=n,yr|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,nt=!0),e.memoizedState=n)}function ox(e,t){var n=fe;fe=n!==0&&4>n?n:4,e(!0);var r=Jl.transition;Jl.transition={};try{e(!1),t()}finally{fe=n,Jl.transition=r}}function L0(){return Nt().memoizedState}function ix(e,t,n){var r=Fn(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},V0(e))F0(t,n);else if(n=$0(e,t,n,r),n!==null){var o=Qe();Vt(n,e,r,o),H0(n,t,r)}}function sx(e,t,n){var r=Fn(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(V0(e))F0(t,o);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var s=t.lastRenderedState,a=i(s,n);if(o.hasEagerState=!0,o.eagerState=a,Ft(a,s)){var l=t.interleaved;l===null?(o.next=o,pd(t)):(o.next=l.next,l.next=o),t.interleaved=o;return}}catch{}finally{}n=$0(e,t,o,r),n!==null&&(o=Qe(),Vt(n,e,r,o),H0(n,t,r))}}function V0(e){var t=e.alternate;return e===Ee||t!==null&&t===Ee}function F0(e,t){oi=xa=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function H0(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ed(e,n)}}var Sa={readContext:kt,useCallback:Ue,useContext:Ue,useEffect:Ue,useImperativeHandle:Ue,useInsertionEffect:Ue,useLayoutEffect:Ue,useMemo:Ue,useReducer:Ue,useRef:Ue,useState:Ue,useDebugValue:Ue,useDeferredValue:Ue,useTransition:Ue,useMutableSource:Ue,useSyncExternalStore:Ue,useId:Ue,unstable_isNewReconciler:!1},ax={readContext:kt,useCallback:function(e,t){return Wt().memoizedState=[e,t===void 0?null:t],e},useContext:kt,useEffect:Uh,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Us(4194308,4,R0.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Us(4194308,4,e,t)},useInsertionEffect:function(e,t){return Us(4,2,e,t)},useMemo:function(e,t){var n=Wt();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Wt();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=ix.bind(null,Ee,e),[r.memoizedState,e]},useRef:function(e){var t=Wt();return e={current:e},t.memoizedState=e},useState:Bh,useDebugValue:Sd,useDeferredValue:function(e){return Wt().memoizedState=e},useTransition:function(){var e=Bh(!1),t=e[0];return e=ox.bind(null,e[1]),Wt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Ee,o=Wt();if(we){if(n===void 0)throw Error(Q(407));n=n()}else{if(n=t(),De===null)throw Error(Q(349));gr&30||N0(r,t,n)}o.memoizedState=n;var i={value:n,getSnapshot:t};return o.queue=i,Uh(C0.bind(null,r,i,e),[e]),r.flags|=2048,bi(9,P0.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=Wt(),t=De.identifierPrefix;if(we){var n=ln,r=an;n=(r&~(1<<32-Lt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Pi++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=rx++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},lx={readContext:kt,useCallback:A0,useContext:kt,useEffect:xd,useImperativeHandle:z0,useInsertionEffect:T0,useLayoutEffect:I0,useMemo:O0,useReducer:eu,useRef:M0,useState:function(){return eu(Ci)},useDebugValue:Sd,useDeferredValue:function(e){var t=Nt();return D0(t,Ie.memoizedState,e)},useTransition:function(){var e=eu(Ci)[0],t=Nt().memoizedState;return[e,t]},useMutableSource:E0,useSyncExternalStore:k0,useId:L0,unstable_isNewReconciler:!1},ux={readContext:kt,useCallback:A0,useContext:kt,useEffect:xd,useImperativeHandle:z0,useInsertionEffect:T0,useLayoutEffect:I0,useMemo:O0,useReducer:tu,useRef:M0,useState:function(){return tu(Ci)},useDebugValue:Sd,useDeferredValue:function(e){var t=Nt();return Ie===null?t.memoizedState=e:D0(t,Ie.memoizedState,e)},useTransition:function(){var e=tu(Ci)[0],t=Nt().memoizedState;return[e,t]},useMutableSource:E0,useSyncExternalStore:k0,useId:L0,unstable_isNewReconciler:!1};function Mt(e,t){if(e&&e.defaultProps){t=ke({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function ec(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:ke({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var el={isMounted:function(e){return(e=e._reactInternals)?Pr(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Qe(),o=Fn(e),i=cn(r,o);i.payload=t,n!=null&&(i.callback=n),t=Ln(e,i,o),t!==null&&(Vt(t,e,o,r),Hs(t,e,o))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Qe(),o=Fn(e),i=cn(r,o);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Ln(e,i,o),t!==null&&(Vt(t,e,o,r),Hs(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Qe(),r=Fn(e),o=cn(n,r);o.tag=2,t!=null&&(o.callback=t),t=Ln(e,o,r),t!==null&&(Vt(t,e,r,n),Hs(t,e,r))}};function Wh(e,t,n,r,o,i,s){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,i,s):t.prototype&&t.prototype.isPureReactComponent?!$i(n,r)||!$i(o,i):!0}function B0(e,t,n){var r=!1,o=Wn,i=t.contextType;return typeof i=="object"&&i!==null?i=kt(i):(o=it(t)?pr:Xe.current,r=t.contextTypes,i=(r=r!=null)?io(e,o):Wn),t=new t(n,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=el,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=i),t}function qh(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&el.enqueueReplaceState(t,t.state,null)}function tc(e,t,n,r){var o=e.stateNode;o.props=n,o.state=e.memoizedState,o.refs={},md(e);var i=t.contextType;typeof i=="object"&&i!==null?o.context=kt(i):(i=it(t)?pr:Xe.current,o.context=io(e,i)),o.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(ec(e,t,i,n),o.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof o.getSnapshotBeforeUpdate=="function"||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(t=o.state,typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount(),t!==o.state&&el.enqueueReplaceState(o,o.state,null),_a(e,n,o,r),o.state=e.memoizedState),typeof o.componentDidMount=="function"&&(e.flags|=4194308)}function uo(e,t){try{var n="",r=t;do n+=O_(r),r=r.return;while(r);var o=n}catch(i){o=`
|
|
39
|
+
Error generating stack: `+i.message+`
|
|
40
|
+
`+i.stack}return{value:e,source:t,stack:o,digest:null}}function nu(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function nc(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var cx=typeof WeakMap=="function"?WeakMap:Map;function U0(e,t,n){n=cn(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){ka||(ka=!0,fc=r),nc(e,t)},n}function W0(e,t,n){n=cn(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var o=t.value;n.payload=function(){return r(o)},n.callback=function(){nc(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){nc(e,t),typeof r!="function"&&(Vn===null?Vn=new Set([this]):Vn.add(this));var s=t.stack;this.componentDidCatch(t.value,{componentStack:s!==null?s:""})}),n}function Kh(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new cx;var o=new Set;r.set(t,o)}else o=r.get(t),o===void 0&&(o=new Set,r.set(t,o));o.has(n)||(o.add(n),e=Ex.bind(null,e,t,n),t.then(e,e))}function Xh(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Yh(e,t,n,r,o){return e.mode&1?(e.flags|=65536,e.lanes=o,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=cn(-1,1),t.tag=2,Ln(n,t,1))),n.lanes|=1),e)}var dx=vn.ReactCurrentOwner,nt=!1;function Ye(e,t,n,r){t.child=e===null?_0(t,null,n,r):ao(t,e.child,n,r)}function Gh(e,t,n,r,o){n=n.render;var i=t.ref;return Zr(t,o),r=_d(e,t,n,r,i,o),n=$d(),e!==null&&!nt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,mn(e,t,o)):(we&&n&&ld(t),t.flags|=1,Ye(e,t,r,o),t.child)}function Qh(e,t,n,r,o){if(e===null){var i=n.type;return typeof i=="function"&&!Md(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,q0(e,t,i,r,o)):(e=Xs(n.type,null,r,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!(e.lanes&o)){var s=i.memoizedProps;if(n=n.compare,n=n!==null?n:$i,n(s,r)&&e.ref===t.ref)return mn(e,t,o)}return t.flags|=1,e=Hn(i,r),e.ref=t.ref,e.return=t,t.child=e}function q0(e,t,n,r,o){if(e!==null){var i=e.memoizedProps;if($i(i,r)&&e.ref===t.ref)if(nt=!1,t.pendingProps=r=i,(e.lanes&o)!==0)e.flags&131072&&(nt=!0);else return t.lanes=e.lanes,mn(e,t,o)}return rc(e,t,n,r,o)}function K0(e,t,n){var r=t.pendingProps,o=r.children,i=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},me(Ur,at),at|=n;else{if(!(n&1073741824))return e=i!==null?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,me(Ur,at),at|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,me(Ur,at),at|=r}else i!==null?(r=i.baseLanes|n,t.memoizedState=null):r=n,me(Ur,at),at|=r;return Ye(e,t,o,n),t.child}function X0(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function rc(e,t,n,r,o){var i=it(n)?pr:Xe.current;return i=io(t,i),Zr(t,o),n=_d(e,t,n,r,i,o),r=$d(),e!==null&&!nt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,mn(e,t,o)):(we&&r&&ld(t),t.flags|=1,Ye(e,t,n,o),t.child)}function Zh(e,t,n,r,o){if(it(n)){var i=!0;ma(t)}else i=!1;if(Zr(t,o),t.stateNode===null)Ws(e,t),B0(t,n,r),tc(t,n,r,o),r=!0;else if(e===null){var s=t.stateNode,a=t.memoizedProps;s.props=a;var l=s.context,u=n.contextType;typeof u=="object"&&u!==null?u=kt(u):(u=it(n)?pr:Xe.current,u=io(t,u));var d=n.getDerivedStateFromProps,c=typeof d=="function"||typeof s.getSnapshotBeforeUpdate=="function";c||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==r||l!==u)&&qh(t,s,r,u),Pn=!1;var f=t.memoizedState;s.state=f,_a(t,r,s,o),l=t.memoizedState,a!==r||f!==l||ot.current||Pn?(typeof d=="function"&&(ec(t,n,d,r),l=t.memoizedState),(a=Pn||Wh(t,n,a,r,f,l,u))?(c||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(t.flags|=4194308)):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),s.props=r,s.state=l,s.context=u,r=a):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{s=t.stateNode,x0(e,t),a=t.memoizedProps,u=t.type===t.elementType?a:Mt(t.type,a),s.props=u,c=t.pendingProps,f=s.context,l=n.contextType,typeof l=="object"&&l!==null?l=kt(l):(l=it(n)?pr:Xe.current,l=io(t,l));var m=n.getDerivedStateFromProps;(d=typeof m=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==c||f!==l)&&qh(t,s,r,l),Pn=!1,f=t.memoizedState,s.state=f,_a(t,r,s,o);var y=t.memoizedState;a!==c||f!==y||ot.current||Pn?(typeof m=="function"&&(ec(t,n,m,r),y=t.memoizedState),(u=Pn||Wh(t,n,u,r,f,y,l)||!1)?(d||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(r,y,l),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(r,y,l)),typeof s.componentDidUpdate=="function"&&(t.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof s.componentDidUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=y),s.props=r,s.state=y,s.context=l,r=u):(typeof s.componentDidUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return oc(e,t,n,r,i,o)}function oc(e,t,n,r,o,i){X0(e,t);var s=(t.flags&128)!==0;if(!r&&!s)return o&&Oh(t,n,!1),mn(e,t,i);r=t.stateNode,dx.current=t;var a=s&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&s?(t.child=ao(t,e.child,null,i),t.child=ao(t,null,a,i)):Ye(e,t,a,i),t.memoizedState=r.state,o&&Oh(t,n,!0),t.child}function Y0(e){var t=e.stateNode;t.pendingContext?Ah(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Ah(e,t.context,!1),gd(e,t.containerInfo)}function Jh(e,t,n,r,o){return so(),cd(o),t.flags|=256,Ye(e,t,n,r),t.child}var ic={dehydrated:null,treeContext:null,retryLane:0};function sc(e){return{baseLanes:e,cachePool:null,transitions:null}}function G0(e,t,n){var r=t.pendingProps,o=Se.current,i=!1,s=(t.flags&128)!==0,a;if((a=s)||(a=e!==null&&e.memoizedState===null?!1:(o&2)!==0),a?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(o|=1),me(Se,o&1),e===null)return Zu(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(s=r.children,e=r.fallback,i?(r=t.mode,i=t.child,s={mode:"hidden",children:s},!(r&1)&&i!==null?(i.childLanes=0,i.pendingProps=s):i=rl(s,r,0,null),e=dr(e,r,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=sc(n),t.memoizedState=ic,e):Ed(t,s));if(o=e.memoizedState,o!==null&&(a=o.dehydrated,a!==null))return fx(e,t,s,r,a,o,n);if(i){i=r.fallback,s=t.mode,o=e.child,a=o.sibling;var l={mode:"hidden",children:r.children};return!(s&1)&&t.child!==o?(r=t.child,r.childLanes=0,r.pendingProps=l,t.deletions=null):(r=Hn(o,l),r.subtreeFlags=o.subtreeFlags&14680064),a!==null?i=Hn(a,i):(i=dr(i,s,n,null),i.flags|=2),i.return=t,r.return=t,r.sibling=i,t.child=r,r=i,i=t.child,s=e.child.memoizedState,s=s===null?sc(n):{baseLanes:s.baseLanes|n,cachePool:null,transitions:s.transitions},i.memoizedState=s,i.childLanes=e.childLanes&~n,t.memoizedState=ic,r}return i=e.child,e=i.sibling,r=Hn(i,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function Ed(e,t){return t=rl({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function ys(e,t,n,r){return r!==null&&cd(r),ao(t,e.child,null,n),e=Ed(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function fx(e,t,n,r,o,i,s){if(n)return t.flags&256?(t.flags&=-257,r=nu(Error(Q(422))),ys(e,t,s,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=r.fallback,o=t.mode,r=rl({mode:"visible",children:r.children},o,0,null),i=dr(i,o,s,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,t.mode&1&&ao(t,e.child,null,s),t.child.memoizedState=sc(s),t.memoizedState=ic,i);if(!(t.mode&1))return ys(e,t,s,null);if(o.data==="$!"){if(r=o.nextSibling&&o.nextSibling.dataset,r)var a=r.dgst;return r=a,i=Error(Q(419)),r=nu(i,r,void 0),ys(e,t,s,r)}if(a=(s&e.childLanes)!==0,nt||a){if(r=De,r!==null){switch(s&-s){case 4:o=2;break;case 16:o=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:o=32;break;case 536870912:o=268435456;break;default:o=0}o=o&(r.suspendedLanes|s)?0:o,o!==0&&o!==i.retryLane&&(i.retryLane=o,pn(e,o),Vt(r,e,o,-1))}return jd(),r=nu(Error(Q(421))),ys(e,t,s,r)}return o.data==="$?"?(t.flags|=128,t.child=e.child,t=kx.bind(null,e),o._reactRetry=t,null):(e=i.treeContext,ut=Dn(o.nextSibling),ct=t,we=!0,Rt=null,e!==null&&($t[xt++]=an,$t[xt++]=ln,$t[xt++]=mr,an=e.id,ln=e.overflow,mr=t),t=Ed(t,r.children),t.flags|=4096,t)}function ep(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Ju(e.return,t,n)}function ru(e,t,n,r,o){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:o}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=o)}function Q0(e,t,n){var r=t.pendingProps,o=r.revealOrder,i=r.tail;if(Ye(e,t,r.children,n),r=Se.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&ep(e,n,t);else if(e.tag===19)ep(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(me(Se,r),!(t.mode&1))t.memoizedState=null;else switch(o){case"forwards":for(n=t.child,o=null;n!==null;)e=n.alternate,e!==null&&$a(e)===null&&(o=n),n=n.sibling;n=o,n===null?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),ru(t,!1,o,n,i);break;case"backwards":for(n=null,o=t.child,t.child=null;o!==null;){if(e=o.alternate,e!==null&&$a(e)===null){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}ru(t,!0,n,null,i);break;case"together":ru(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Ws(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function mn(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),yr|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(Q(153));if(t.child!==null){for(e=t.child,n=Hn(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Hn(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function hx(e,t,n){switch(t.tag){case 3:Y0(t),so();break;case 5:S0(t);break;case 1:it(t.type)&&ma(t);break;case 4:gd(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,o=t.memoizedProps.value;me(va,r._currentValue),r._currentValue=o;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(me(Se,Se.current&1),t.flags|=128,null):n&t.child.childLanes?G0(e,t,n):(me(Se,Se.current&1),e=mn(e,t,n),e!==null?e.sibling:null);me(Se,Se.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return Q0(e,t,n);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),me(Se,Se.current),r)break;return null;case 22:case 23:return t.lanes=0,K0(e,t,n)}return mn(e,t,n)}var Z0,ac,J0,ey;Z0=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};ac=function(){};J0=function(e,t,n,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,ar(Yt.current);var i=null;switch(n){case"input":o=bu(e,o),r=bu(e,r),i=[];break;case"select":o=ke({},o,{value:void 0}),r=ke({},r,{value:void 0}),i=[];break;case"textarea":o=Tu(e,o),r=Tu(e,r),i=[];break;default:typeof o.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=ha)}Ru(n,r);var s;n=null;for(u in o)if(!r.hasOwnProperty(u)&&o.hasOwnProperty(u)&&o[u]!=null)if(u==="style"){var a=o[u];for(s in a)a.hasOwnProperty(s)&&(n||(n={}),n[s]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(pi.hasOwnProperty(u)?i||(i=[]):(i=i||[]).push(u,null));for(u in r){var l=r[u];if(a=o!=null?o[u]:void 0,r.hasOwnProperty(u)&&l!==a&&(l!=null||a!=null))if(u==="style")if(a){for(s in a)!a.hasOwnProperty(s)||l&&l.hasOwnProperty(s)||(n||(n={}),n[s]="");for(s in l)l.hasOwnProperty(s)&&a[s]!==l[s]&&(n||(n={}),n[s]=l[s])}else n||(i||(i=[]),i.push(u,n)),n=l;else u==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,a=a?a.__html:void 0,l!=null&&a!==l&&(i=i||[]).push(u,l)):u==="children"?typeof l!="string"&&typeof l!="number"||(i=i||[]).push(u,""+l):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(pi.hasOwnProperty(u)?(l!=null&&u==="onScroll"&&ge("scroll",e),i||a===l||(i=[])):(i=i||[]).push(u,l))}n&&(i=i||[]).push("style",n);var u=i;(t.updateQueue=u)&&(t.flags|=4)}};ey=function(e,t,n,r){n!==r&&(t.flags|=4)};function Do(e,t){if(!we)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function We(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags&14680064,r|=o.flags&14680064,o.return=e,o=o.sibling;else for(o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags,r|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function px(e,t,n){var r=t.pendingProps;switch(ud(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return We(t),null;case 1:return it(t.type)&&pa(),We(t),null;case 3:return r=t.stateNode,lo(),ye(ot),ye(Xe),vd(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(ms(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Rt!==null&&(mc(Rt),Rt=null))),ac(e,t),We(t),null;case 5:yd(t);var o=ar(Ni.current);if(n=t.type,e!==null&&t.stateNode!=null)J0(e,t,n,r,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(Q(166));return We(t),null}if(e=ar(Yt.current),ms(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[Kt]=t,r[Ei]=i,e=(t.mode&1)!==0,n){case"dialog":ge("cancel",r),ge("close",r);break;case"iframe":case"object":case"embed":ge("load",r);break;case"video":case"audio":for(o=0;o<Xo.length;o++)ge(Xo[o],r);break;case"source":ge("error",r);break;case"img":case"image":case"link":ge("error",r),ge("load",r);break;case"details":ge("toggle",r);break;case"input":uh(r,i),ge("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},ge("invalid",r);break;case"textarea":dh(r,i),ge("invalid",r)}Ru(n,i),o=null;for(var s in i)if(i.hasOwnProperty(s)){var a=i[s];s==="children"?typeof a=="string"?r.textContent!==a&&(i.suppressHydrationWarning!==!0&&ps(r.textContent,a,e),o=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(i.suppressHydrationWarning!==!0&&ps(r.textContent,a,e),o=["children",""+a]):pi.hasOwnProperty(s)&&a!=null&&s==="onScroll"&&ge("scroll",r)}switch(n){case"input":ss(r),ch(r,i,!0);break;case"textarea":ss(r),fh(r);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(r.onclick=ha)}r=o,t.updateQueue=r,r!==null&&(t.flags|=4)}else{s=o.nodeType===9?o:o.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Cg(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=s.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=s.createElement(n,{is:r.is}):(e=s.createElement(n),n==="select"&&(s=e,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):e=s.createElementNS(e,n),e[Kt]=t,e[Ei]=r,Z0(e,t,!1,!1),t.stateNode=e;e:{switch(s=zu(n,r),n){case"dialog":ge("cancel",e),ge("close",e),o=r;break;case"iframe":case"object":case"embed":ge("load",e),o=r;break;case"video":case"audio":for(o=0;o<Xo.length;o++)ge(Xo[o],e);o=r;break;case"source":ge("error",e),o=r;break;case"img":case"image":case"link":ge("error",e),ge("load",e),o=r;break;case"details":ge("toggle",e),o=r;break;case"input":uh(e,r),o=bu(e,r),ge("invalid",e);break;case"option":o=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},o=ke({},r,{value:void 0}),ge("invalid",e);break;case"textarea":dh(e,r),o=Tu(e,r),ge("invalid",e);break;default:o=r}Ru(n,o),a=o;for(i in a)if(a.hasOwnProperty(i)){var l=a[i];i==="style"?Mg(e,l):i==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&bg(e,l)):i==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&mi(e,l):typeof l=="number"&&mi(e,""+l):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(pi.hasOwnProperty(i)?l!=null&&i==="onScroll"&&ge("scroll",e):l!=null&&Xc(e,i,l,s))}switch(n){case"input":ss(e),ch(e,r,!1);break;case"textarea":ss(e),fh(e);break;case"option":r.value!=null&&e.setAttribute("value",""+Un(r.value));break;case"select":e.multiple=!!r.multiple,i=r.value,i!=null?Xr(e,!!r.multiple,i,!1):r.defaultValue!=null&&Xr(e,!!r.multiple,r.defaultValue,!0);break;default:typeof o.onClick=="function"&&(e.onclick=ha)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return We(t),null;case 6:if(e&&t.stateNode!=null)ey(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(Q(166));if(n=ar(Ni.current),ar(Yt.current),ms(t)){if(r=t.stateNode,n=t.memoizedProps,r[Kt]=t,(i=r.nodeValue!==n)&&(e=ct,e!==null))switch(e.tag){case 3:ps(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&ps(r.nodeValue,n,(e.mode&1)!==0)}i&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Kt]=t,t.stateNode=r}return We(t),null;case 13:if(ye(Se),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(we&&ut!==null&&t.mode&1&&!(t.flags&128))v0(),so(),t.flags|=98560,i=!1;else if(i=ms(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(Q(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(Q(317));i[Kt]=t}else so(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;We(t),i=!1}else Rt!==null&&(mc(Rt),Rt=null),i=!0;if(!i)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||Se.current&1?ze===0&&(ze=3):jd())),t.updateQueue!==null&&(t.flags|=4),We(t),null);case 4:return lo(),ac(e,t),e===null&&xi(t.stateNode.containerInfo),We(t),null;case 10:return hd(t.type._context),We(t),null;case 17:return it(t.type)&&pa(),We(t),null;case 19:if(ye(Se),i=t.memoizedState,i===null)return We(t),null;if(r=(t.flags&128)!==0,s=i.rendering,s===null)if(r)Do(i,!1);else{if(ze!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(s=$a(e),s!==null){for(t.flags|=128,Do(i,!1),r=s.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)i=n,e=r,i.flags&=14680066,s=i.alternate,s===null?(i.childLanes=0,i.lanes=e,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=s.childLanes,i.lanes=s.lanes,i.child=s.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=s.memoizedProps,i.memoizedState=s.memoizedState,i.updateQueue=s.updateQueue,i.type=s.type,e=s.dependencies,i.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return me(Se,Se.current&1|2),t.child}e=e.sibling}i.tail!==null&&be()>co&&(t.flags|=128,r=!0,Do(i,!1),t.lanes=4194304)}else{if(!r)if(e=$a(s),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Do(i,!0),i.tail===null&&i.tailMode==="hidden"&&!s.alternate&&!we)return We(t),null}else 2*be()-i.renderingStartTime>co&&n!==1073741824&&(t.flags|=128,r=!0,Do(i,!1),t.lanes=4194304);i.isBackwards?(s.sibling=t.child,t.child=s):(n=i.last,n!==null?n.sibling=s:t.child=s,i.last=s)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=be(),t.sibling=null,n=Se.current,me(Se,r?n&1|2:n&1),t):(We(t),null);case 22:case 23:return bd(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?at&1073741824&&(We(t),t.subtreeFlags&6&&(t.flags|=8192)):We(t),null;case 24:return null;case 25:return null}throw Error(Q(156,t.tag))}function mx(e,t){switch(ud(t),t.tag){case 1:return it(t.type)&&pa(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return lo(),ye(ot),ye(Xe),vd(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return yd(t),null;case 13:if(ye(Se),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(Q(340));so()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ye(Se),null;case 4:return lo(),null;case 10:return hd(t.type._context),null;case 22:case 23:return bd(),null;case 24:return null;default:return null}}var vs=!1,Ke=!1,gx=typeof WeakSet=="function"?WeakSet:Set,re=null;function Br(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Pe(e,t,r)}else n.current=null}function lc(e,t,n){try{n()}catch(r){Pe(e,t,r)}}var tp=!1;function yx(e,t){if(Wu=ca,e=i0(),ad(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var o=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var s=0,a=-1,l=-1,u=0,d=0,c=e,f=null;t:for(;;){for(var m;c!==n||o!==0&&c.nodeType!==3||(a=s+o),c!==i||r!==0&&c.nodeType!==3||(l=s+r),c.nodeType===3&&(s+=c.nodeValue.length),(m=c.firstChild)!==null;)f=c,c=m;for(;;){if(c===e)break t;if(f===n&&++u===o&&(a=s),f===i&&++d===r&&(l=s),(m=c.nextSibling)!==null)break;c=f,f=c.parentNode}c=m}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(qu={focusedElem:e,selectionRange:n},ca=!1,re=t;re!==null;)if(t=re,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,re=e;else for(;re!==null;){t=re;try{var y=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var v=y.memoizedProps,w=y.memoizedState,h=t.stateNode,g=h.getSnapshotBeforeUpdate(t.elementType===t.type?v:Mt(t.type,v),w);h.__reactInternalSnapshotBeforeUpdate=g}break;case 3:var p=t.stateNode.containerInfo;p.nodeType===1?p.textContent="":p.nodeType===9&&p.documentElement&&p.removeChild(p.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Q(163))}}catch(_){Pe(t,t.return,_)}if(e=t.sibling,e!==null){e.return=t.return,re=e;break}re=t.return}return y=tp,tp=!1,y}function ii(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var o=r=r.next;do{if((o.tag&e)===e){var i=o.destroy;o.destroy=void 0,i!==void 0&&lc(t,n,i)}o=o.next}while(o!==r)}}function tl(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function uc(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function ty(e){var t=e.alternate;t!==null&&(e.alternate=null,ty(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Kt],delete t[Ei],delete t[Yu],delete t[J$],delete t[ex])),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 ny(e){return e.tag===5||e.tag===3||e.tag===4}function np(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||ny(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 cc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=ha));else if(r!==4&&(e=e.child,e!==null))for(cc(e,t,n),e=e.sibling;e!==null;)cc(e,t,n),e=e.sibling}function dc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(dc(e,t,n),e=e.sibling;e!==null;)dc(e,t,n),e=e.sibling}var Ve=null,Tt=!1;function $n(e,t,n){for(n=n.child;n!==null;)ry(e,t,n),n=n.sibling}function ry(e,t,n){if(Xt&&typeof Xt.onCommitFiberUnmount=="function")try{Xt.onCommitFiberUnmount(Ka,n)}catch{}switch(n.tag){case 5:Ke||Br(n,t);case 6:var r=Ve,o=Tt;Ve=null,$n(e,t,n),Ve=r,Tt=o,Ve!==null&&(Tt?(e=Ve,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Ve.removeChild(n.stateNode));break;case 18:Ve!==null&&(Tt?(e=Ve,n=n.stateNode,e.nodeType===8?Gl(e.parentNode,n):e.nodeType===1&&Gl(e,n),wi(e)):Gl(Ve,n.stateNode));break;case 4:r=Ve,o=Tt,Ve=n.stateNode.containerInfo,Tt=!0,$n(e,t,n),Ve=r,Tt=o;break;case 0:case 11:case 14:case 15:if(!Ke&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var i=o,s=i.destroy;i=i.tag,s!==void 0&&(i&2||i&4)&&lc(n,t,s),o=o.next}while(o!==r)}$n(e,t,n);break;case 1:if(!Ke&&(Br(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){Pe(n,t,a)}$n(e,t,n);break;case 21:$n(e,t,n);break;case 22:n.mode&1?(Ke=(r=Ke)||n.memoizedState!==null,$n(e,t,n),Ke=r):$n(e,t,n);break;default:$n(e,t,n)}}function rp(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new gx),t.forEach(function(r){var o=Nx.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function Pt(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var o=n[r];try{var i=e,s=t,a=s;e:for(;a!==null;){switch(a.tag){case 5:Ve=a.stateNode,Tt=!1;break e;case 3:Ve=a.stateNode.containerInfo,Tt=!0;break e;case 4:Ve=a.stateNode.containerInfo,Tt=!0;break e}a=a.return}if(Ve===null)throw Error(Q(160));ry(i,s,o),Ve=null,Tt=!1;var l=o.alternate;l!==null&&(l.return=null),o.return=null}catch(u){Pe(o,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)oy(t,e),t=t.sibling}function oy(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Pt(t,e),Ut(e),r&4){try{ii(3,e,e.return),tl(3,e)}catch(v){Pe(e,e.return,v)}try{ii(5,e,e.return)}catch(v){Pe(e,e.return,v)}}break;case 1:Pt(t,e),Ut(e),r&512&&n!==null&&Br(n,n.return);break;case 5:if(Pt(t,e),Ut(e),r&512&&n!==null&&Br(n,n.return),e.flags&32){var o=e.stateNode;try{mi(o,"")}catch(v){Pe(e,e.return,v)}}if(r&4&&(o=e.stateNode,o!=null)){var i=e.memoizedProps,s=n!==null?n.memoizedProps:i,a=e.type,l=e.updateQueue;if(e.updateQueue=null,l!==null)try{a==="input"&&i.type==="radio"&&i.name!=null&&Ng(o,i),zu(a,s);var u=zu(a,i);for(s=0;s<l.length;s+=2){var d=l[s],c=l[s+1];d==="style"?Mg(o,c):d==="dangerouslySetInnerHTML"?bg(o,c):d==="children"?mi(o,c):Xc(o,d,c,u)}switch(a){case"input":ju(o,i);break;case"textarea":Pg(o,i);break;case"select":var f=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!i.multiple;var m=i.value;m!=null?Xr(o,!!i.multiple,m,!1):f!==!!i.multiple&&(i.defaultValue!=null?Xr(o,!!i.multiple,i.defaultValue,!0):Xr(o,!!i.multiple,i.multiple?[]:"",!1))}o[Ei]=i}catch(v){Pe(e,e.return,v)}}break;case 6:if(Pt(t,e),Ut(e),r&4){if(e.stateNode===null)throw Error(Q(162));o=e.stateNode,i=e.memoizedProps;try{o.nodeValue=i}catch(v){Pe(e,e.return,v)}}break;case 3:if(Pt(t,e),Ut(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{wi(t.containerInfo)}catch(v){Pe(e,e.return,v)}break;case 4:Pt(t,e),Ut(e);break;case 13:Pt(t,e),Ut(e),o=e.child,o.flags&8192&&(i=o.memoizedState!==null,o.stateNode.isHidden=i,!i||o.alternate!==null&&o.alternate.memoizedState!==null||(Pd=be())),r&4&&rp(e);break;case 22:if(d=n!==null&&n.memoizedState!==null,e.mode&1?(Ke=(u=Ke)||d,Pt(t,e),Ke=u):Pt(t,e),Ut(e),r&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!d&&e.mode&1)for(re=e,d=e.child;d!==null;){for(c=re=d;re!==null;){switch(f=re,m=f.child,f.tag){case 0:case 11:case 14:case 15:ii(4,f,f.return);break;case 1:Br(f,f.return);var y=f.stateNode;if(typeof y.componentWillUnmount=="function"){r=f,n=f.return;try{t=r,y.props=t.memoizedProps,y.state=t.memoizedState,y.componentWillUnmount()}catch(v){Pe(r,n,v)}}break;case 5:Br(f,f.return);break;case 22:if(f.memoizedState!==null){ip(c);continue}}m!==null?(m.return=f,re=m):ip(c)}d=d.sibling}e:for(d=null,c=e;;){if(c.tag===5){if(d===null){d=c;try{o=c.stateNode,u?(i=o.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(a=c.stateNode,l=c.memoizedProps.style,s=l!=null&&l.hasOwnProperty("display")?l.display:null,a.style.display=jg("display",s))}catch(v){Pe(e,e.return,v)}}}else if(c.tag===6){if(d===null)try{c.stateNode.nodeValue=u?"":c.memoizedProps}catch(v){Pe(e,e.return,v)}}else if((c.tag!==22&&c.tag!==23||c.memoizedState===null||c===e)&&c.child!==null){c.child.return=c,c=c.child;continue}if(c===e)break e;for(;c.sibling===null;){if(c.return===null||c.return===e)break e;d===c&&(d=null),c=c.return}d===c&&(d=null),c.sibling.return=c.return,c=c.sibling}}break;case 19:Pt(t,e),Ut(e),r&4&&rp(e);break;case 21:break;default:Pt(t,e),Ut(e)}}function Ut(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(ny(n)){var r=n;break e}n=n.return}throw Error(Q(160))}switch(r.tag){case 5:var o=r.stateNode;r.flags&32&&(mi(o,""),r.flags&=-33);var i=np(e);dc(e,i,o);break;case 3:case 4:var s=r.stateNode.containerInfo,a=np(e);cc(e,a,s);break;default:throw Error(Q(161))}}catch(l){Pe(e,e.return,l)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function vx(e,t,n){re=e,iy(e)}function iy(e,t,n){for(var r=(e.mode&1)!==0;re!==null;){var o=re,i=o.child;if(o.tag===22&&r){var s=o.memoizedState!==null||vs;if(!s){var a=o.alternate,l=a!==null&&a.memoizedState!==null||Ke;a=vs;var u=Ke;if(vs=s,(Ke=l)&&!u)for(re=o;re!==null;)s=re,l=s.child,s.tag===22&&s.memoizedState!==null?sp(o):l!==null?(l.return=s,re=l):sp(o);for(;i!==null;)re=i,iy(i),i=i.sibling;re=o,vs=a,Ke=u}op(e)}else o.subtreeFlags&8772&&i!==null?(i.return=o,re=i):op(e)}}function op(e){for(;re!==null;){var t=re;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Ke||tl(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Ke)if(n===null)r.componentDidMount();else{var o=t.elementType===t.type?n.memoizedProps:Mt(t.type,n.memoizedProps);r.componentDidUpdate(o,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&Hh(t,i,r);break;case 3:var s=t.updateQueue;if(s!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}Hh(t,s,n)}break;case 5:var a=t.stateNode;if(n===null&&t.flags&4){n=a;var l=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&n.focus();break;case"img":l.src&&(n.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var d=u.memoizedState;if(d!==null){var c=d.dehydrated;c!==null&&wi(c)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(Q(163))}Ke||t.flags&512&&uc(t)}catch(f){Pe(t,t.return,f)}}if(t===e){re=null;break}if(n=t.sibling,n!==null){n.return=t.return,re=n;break}re=t.return}}function ip(e){for(;re!==null;){var t=re;if(t===e){re=null;break}var n=t.sibling;if(n!==null){n.return=t.return,re=n;break}re=t.return}}function sp(e){for(;re!==null;){var t=re;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{tl(4,t)}catch(l){Pe(t,n,l)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var o=t.return;try{r.componentDidMount()}catch(l){Pe(t,o,l)}}var i=t.return;try{uc(t)}catch(l){Pe(t,i,l)}break;case 5:var s=t.return;try{uc(t)}catch(l){Pe(t,s,l)}}}catch(l){Pe(t,t.return,l)}if(t===e){re=null;break}var a=t.sibling;if(a!==null){a.return=t.return,re=a;break}re=t.return}}var wx=Math.ceil,Ea=vn.ReactCurrentDispatcher,kd=vn.ReactCurrentOwner,Et=vn.ReactCurrentBatchConfig,ce=0,De=null,Me=null,He=0,at=0,Ur=Xn(0),ze=0,ji=null,yr=0,nl=0,Nd=0,si=null,tt=null,Pd=0,co=1/0,on=null,ka=!1,fc=null,Vn=null,ws=!1,Tn=null,Na=0,ai=0,hc=null,qs=-1,Ks=0;function Qe(){return ce&6?be():qs!==-1?qs:qs=be()}function Fn(e){return e.mode&1?ce&2&&He!==0?He&-He:nx.transition!==null?(Ks===0&&(Ks=Bg()),Ks):(e=fe,e!==0||(e=window.event,e=e===void 0?16:Gg(e.type)),e):1}function Vt(e,t,n,r){if(50<ai)throw ai=0,hc=null,Error(Q(185));Bi(e,n,r),(!(ce&2)||e!==De)&&(e===De&&(!(ce&2)&&(nl|=n),ze===4&&bn(e,He)),st(e,r),n===1&&ce===0&&!(t.mode&1)&&(co=be()+500,Za&&Yn()))}function st(e,t){var n=e.callbackNode;n$(e,t);var r=ua(e,e===De?He:0);if(r===0)n!==null&&mh(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&mh(n),t===1)e.tag===0?tx(ap.bind(null,e)):m0(ap.bind(null,e)),Q$(function(){!(ce&6)&&Yn()}),n=null;else{switch(Ug(r)){case 1:n=Jc;break;case 4:n=Fg;break;case 16:n=la;break;case 536870912:n=Hg;break;default:n=la}n=hy(n,sy.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function sy(e,t){if(qs=-1,Ks=0,ce&6)throw Error(Q(327));var n=e.callbackNode;if(Jr()&&e.callbackNode!==n)return null;var r=ua(e,e===De?He:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Pa(e,r);else{t=r;var o=ce;ce|=2;var i=ly();(De!==e||He!==t)&&(on=null,co=be()+500,cr(e,t));do try{xx();break}catch(a){ay(e,a)}while(!0);fd(),Ea.current=i,ce=o,Me!==null?t=0:(De=null,He=0,t=ze)}if(t!==0){if(t===2&&(o=Vu(e),o!==0&&(r=o,t=pc(e,o))),t===1)throw n=ji,cr(e,0),bn(e,r),st(e,be()),n;if(t===6)bn(e,r);else{if(o=e.current.alternate,!(r&30)&&!_x(o)&&(t=Pa(e,r),t===2&&(i=Vu(e),i!==0&&(r=i,t=pc(e,i))),t===1))throw n=ji,cr(e,0),bn(e,r),st(e,be()),n;switch(e.finishedWork=o,e.finishedLanes=r,t){case 0:case 1:throw Error(Q(345));case 2:er(e,tt,on);break;case 3:if(bn(e,r),(r&130023424)===r&&(t=Pd+500-be(),10<t)){if(ua(e,0)!==0)break;if(o=e.suspendedLanes,(o&r)!==r){Qe(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=Xu(er.bind(null,e,tt,on),t);break}er(e,tt,on);break;case 4:if(bn(e,r),(r&4194240)===r)break;for(t=e.eventTimes,o=-1;0<r;){var s=31-Lt(r);i=1<<s,s=t[s],s>o&&(o=s),r&=~i}if(r=o,r=be()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*wx(r/1960))-r,10<r){e.timeoutHandle=Xu(er.bind(null,e,tt,on),r);break}er(e,tt,on);break;case 5:er(e,tt,on);break;default:throw Error(Q(329))}}}return st(e,be()),e.callbackNode===n?sy.bind(null,e):null}function pc(e,t){var n=si;return e.current.memoizedState.isDehydrated&&(cr(e,t).flags|=256),e=Pa(e,t),e!==2&&(t=tt,tt=n,t!==null&&mc(t)),e}function mc(e){tt===null?tt=e:tt.push.apply(tt,e)}function _x(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var o=n[r],i=o.getSnapshot;o=o.value;try{if(!Ft(i(),o))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function bn(e,t){for(t&=~Nd,t&=~nl,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Lt(t),r=1<<n;e[n]=-1,t&=~r}}function ap(e){if(ce&6)throw Error(Q(327));Jr();var t=ua(e,0);if(!(t&1))return st(e,be()),null;var n=Pa(e,t);if(e.tag!==0&&n===2){var r=Vu(e);r!==0&&(t=r,n=pc(e,r))}if(n===1)throw n=ji,cr(e,0),bn(e,t),st(e,be()),n;if(n===6)throw Error(Q(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,er(e,tt,on),st(e,be()),null}function Cd(e,t){var n=ce;ce|=1;try{return e(t)}finally{ce=n,ce===0&&(co=be()+500,Za&&Yn())}}function vr(e){Tn!==null&&Tn.tag===0&&!(ce&6)&&Jr();var t=ce;ce|=1;var n=Et.transition,r=fe;try{if(Et.transition=null,fe=1,e)return e()}finally{fe=r,Et.transition=n,ce=t,!(ce&6)&&Yn()}}function bd(){at=Ur.current,ye(Ur)}function cr(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,G$(n)),Me!==null)for(n=Me.return;n!==null;){var r=n;switch(ud(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&pa();break;case 3:lo(),ye(ot),ye(Xe),vd();break;case 5:yd(r);break;case 4:lo();break;case 13:ye(Se);break;case 19:ye(Se);break;case 10:hd(r.type._context);break;case 22:case 23:bd()}n=n.return}if(De=e,Me=e=Hn(e.current,null),He=at=t,ze=0,ji=null,Nd=nl=yr=0,tt=si=null,sr!==null){for(t=0;t<sr.length;t++)if(n=sr[t],r=n.interleaved,r!==null){n.interleaved=null;var o=r.next,i=n.pending;if(i!==null){var s=i.next;i.next=o,r.next=s}n.pending=r}sr=null}return e}function ay(e,t){do{var n=Me;try{if(fd(),Bs.current=Sa,xa){for(var r=Ee.memoizedState;r!==null;){var o=r.queue;o!==null&&(o.pending=null),r=r.next}xa=!1}if(gr=0,Oe=Ie=Ee=null,oi=!1,Pi=0,kd.current=null,n===null||n.return===null){ze=1,ji=t,Me=null;break}e:{var i=e,s=n.return,a=n,l=t;if(t=He,a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var u=l,d=a,c=d.tag;if(!(d.mode&1)&&(c===0||c===11||c===15)){var f=d.alternate;f?(d.updateQueue=f.updateQueue,d.memoizedState=f.memoizedState,d.lanes=f.lanes):(d.updateQueue=null,d.memoizedState=null)}var m=Xh(s);if(m!==null){m.flags&=-257,Yh(m,s,a,i,t),m.mode&1&&Kh(i,u,t),t=m,l=u;var y=t.updateQueue;if(y===null){var v=new Set;v.add(l),t.updateQueue=v}else y.add(l);break e}else{if(!(t&1)){Kh(i,u,t),jd();break e}l=Error(Q(426))}}else if(we&&a.mode&1){var w=Xh(s);if(w!==null){!(w.flags&65536)&&(w.flags|=256),Yh(w,s,a,i,t),cd(uo(l,a));break e}}i=l=uo(l,a),ze!==4&&(ze=2),si===null?si=[i]:si.push(i),i=s;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var h=U0(i,l,t);Fh(i,h);break e;case 1:a=l;var g=i.type,p=i.stateNode;if(!(i.flags&128)&&(typeof g.getDerivedStateFromError=="function"||p!==null&&typeof p.componentDidCatch=="function"&&(Vn===null||!Vn.has(p)))){i.flags|=65536,t&=-t,i.lanes|=t;var _=W0(i,a,t);Fh(i,_);break e}}i=i.return}while(i!==null)}cy(n)}catch(x){t=x,Me===n&&n!==null&&(Me=n=n.return);continue}break}while(!0)}function ly(){var e=Ea.current;return Ea.current=Sa,e===null?Sa:e}function jd(){(ze===0||ze===3||ze===2)&&(ze=4),De===null||!(yr&268435455)&&!(nl&268435455)||bn(De,He)}function Pa(e,t){var n=ce;ce|=2;var r=ly();(De!==e||He!==t)&&(on=null,cr(e,t));do try{$x();break}catch(o){ay(e,o)}while(!0);if(fd(),ce=n,Ea.current=r,Me!==null)throw Error(Q(261));return De=null,He=0,ze}function $x(){for(;Me!==null;)uy(Me)}function xx(){for(;Me!==null&&!K_();)uy(Me)}function uy(e){var t=fy(e.alternate,e,at);e.memoizedProps=e.pendingProps,t===null?cy(e):Me=t,kd.current=null}function cy(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=mx(n,t),n!==null){n.flags&=32767,Me=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{ze=6,Me=null;return}}else if(n=px(n,t,at),n!==null){Me=n;return}if(t=t.sibling,t!==null){Me=t;return}Me=t=e}while(t!==null);ze===0&&(ze=5)}function er(e,t,n){var r=fe,o=Et.transition;try{Et.transition=null,fe=1,Sx(e,t,n,r)}finally{Et.transition=o,fe=r}return null}function Sx(e,t,n,r){do Jr();while(Tn!==null);if(ce&6)throw Error(Q(327));n=e.finishedWork;var o=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(Q(177));e.callbackNode=null,e.callbackPriority=0;var i=n.lanes|n.childLanes;if(r$(e,i),e===De&&(Me=De=null,He=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||ws||(ws=!0,hy(la,function(){return Jr(),null})),i=(n.flags&15990)!==0,n.subtreeFlags&15990||i){i=Et.transition,Et.transition=null;var s=fe;fe=1;var a=ce;ce|=4,kd.current=null,yx(e,n),oy(n,e),B$(qu),ca=!!Wu,qu=Wu=null,e.current=n,vx(n),X_(),ce=a,fe=s,Et.transition=i}else e.current=n;if(ws&&(ws=!1,Tn=e,Na=o),i=e.pendingLanes,i===0&&(Vn=null),Q_(n.stateNode),st(e,be()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)o=t[n],r(o.value,{componentStack:o.stack,digest:o.digest});if(ka)throw ka=!1,e=fc,fc=null,e;return Na&1&&e.tag!==0&&Jr(),i=e.pendingLanes,i&1?e===hc?ai++:(ai=0,hc=e):ai=0,Yn(),null}function Jr(){if(Tn!==null){var e=Ug(Na),t=Et.transition,n=fe;try{if(Et.transition=null,fe=16>e?16:e,Tn===null)var r=!1;else{if(e=Tn,Tn=null,Na=0,ce&6)throw Error(Q(331));var o=ce;for(ce|=4,re=e.current;re!==null;){var i=re,s=i.child;if(re.flags&16){var a=i.deletions;if(a!==null){for(var l=0;l<a.length;l++){var u=a[l];for(re=u;re!==null;){var d=re;switch(d.tag){case 0:case 11:case 15:ii(8,d,i)}var c=d.child;if(c!==null)c.return=d,re=c;else for(;re!==null;){d=re;var f=d.sibling,m=d.return;if(ty(d),d===u){re=null;break}if(f!==null){f.return=m,re=f;break}re=m}}}var y=i.alternate;if(y!==null){var v=y.child;if(v!==null){y.child=null;do{var w=v.sibling;v.sibling=null,v=w}while(v!==null)}}re=i}}if(i.subtreeFlags&2064&&s!==null)s.return=i,re=s;else e:for(;re!==null;){if(i=re,i.flags&2048)switch(i.tag){case 0:case 11:case 15:ii(9,i,i.return)}var h=i.sibling;if(h!==null){h.return=i.return,re=h;break e}re=i.return}}var g=e.current;for(re=g;re!==null;){s=re;var p=s.child;if(s.subtreeFlags&2064&&p!==null)p.return=s,re=p;else e:for(s=g;re!==null;){if(a=re,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:tl(9,a)}}catch(x){Pe(a,a.return,x)}if(a===s){re=null;break e}var _=a.sibling;if(_!==null){_.return=a.return,re=_;break e}re=a.return}}if(ce=o,Yn(),Xt&&typeof Xt.onPostCommitFiberRoot=="function")try{Xt.onPostCommitFiberRoot(Ka,e)}catch{}r=!0}return r}finally{fe=n,Et.transition=t}}return!1}function lp(e,t,n){t=uo(n,t),t=U0(e,t,1),e=Ln(e,t,1),t=Qe(),e!==null&&(Bi(e,1,t),st(e,t))}function Pe(e,t,n){if(e.tag===3)lp(e,e,n);else for(;t!==null;){if(t.tag===3){lp(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Vn===null||!Vn.has(r))){e=uo(n,e),e=W0(t,e,1),t=Ln(t,e,1),e=Qe(),t!==null&&(Bi(t,1,e),st(t,e));break}}t=t.return}}function Ex(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Qe(),e.pingedLanes|=e.suspendedLanes&n,De===e&&(He&n)===n&&(ze===4||ze===3&&(He&130023424)===He&&500>be()-Pd?cr(e,0):Nd|=n),st(e,t)}function dy(e,t){t===0&&(e.mode&1?(t=us,us<<=1,!(us&130023424)&&(us=4194304)):t=1);var n=Qe();e=pn(e,t),e!==null&&(Bi(e,t,n),st(e,n))}function kx(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),dy(e,n)}function Nx(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(Q(314))}r!==null&&r.delete(t),dy(e,n)}var fy;fy=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||ot.current)nt=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return nt=!1,hx(e,t,n);nt=!!(e.flags&131072)}else nt=!1,we&&t.flags&1048576&&g0(t,ya,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Ws(e,t),e=t.pendingProps;var o=io(t,Xe.current);Zr(t,n),o=_d(null,t,r,e,o,n);var i=$d();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,it(r)?(i=!0,ma(t)):i=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,md(t),o.updater=el,t.stateNode=o,o._reactInternals=t,tc(t,r,e,n),t=oc(null,t,r,!0,i,n)):(t.tag=0,we&&i&&ld(t),Ye(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Ws(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=Cx(r),e=Mt(r,e),o){case 0:t=rc(null,t,r,e,n);break e;case 1:t=Zh(null,t,r,e,n);break e;case 11:t=Gh(null,t,r,e,n);break e;case 14:t=Qh(null,t,r,Mt(r.type,e),n);break e}throw Error(Q(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Mt(r,o),rc(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Mt(r,o),Zh(e,t,r,o,n);case 3:e:{if(Y0(t),e===null)throw Error(Q(387));r=t.pendingProps,i=t.memoizedState,o=i.element,x0(e,t),_a(t,r,null,n);var s=t.memoizedState;if(r=s.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){o=uo(Error(Q(423)),t),t=Jh(e,t,r,n,o);break e}else if(r!==o){o=uo(Error(Q(424)),t),t=Jh(e,t,r,n,o);break e}else for(ut=Dn(t.stateNode.containerInfo.firstChild),ct=t,we=!0,Rt=null,n=_0(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(so(),r===o){t=mn(e,t,n);break e}Ye(e,t,r,n)}t=t.child}return t;case 5:return S0(t),e===null&&Zu(t),r=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,s=o.children,Ku(r,o)?s=null:i!==null&&Ku(r,i)&&(t.flags|=32),X0(e,t),Ye(e,t,s,n),t.child;case 6:return e===null&&Zu(t),null;case 13:return G0(e,t,n);case 4:return gd(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=ao(t,null,r,n):Ye(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Mt(r,o),Gh(e,t,r,o,n);case 7:return Ye(e,t,t.pendingProps,n),t.child;case 8:return Ye(e,t,t.pendingProps.children,n),t.child;case 12:return Ye(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,i=t.memoizedProps,s=o.value,me(va,r._currentValue),r._currentValue=s,i!==null)if(Ft(i.value,s)){if(i.children===o.children&&!ot.current){t=mn(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var a=i.dependencies;if(a!==null){s=i.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(i.tag===1){l=cn(-1,n&-n),l.tag=2;var u=i.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?l.next=l:(l.next=d.next,d.next=l),u.pending=l}}i.lanes|=n,l=i.alternate,l!==null&&(l.lanes|=n),Ju(i.return,n,t),a.lanes|=n;break}l=l.next}}else if(i.tag===10)s=i.type===t.type?null:i.child;else if(i.tag===18){if(s=i.return,s===null)throw Error(Q(341));s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),Ju(s,n,t),s=i.sibling}else s=i.child;if(s!==null)s.return=i;else for(s=i;s!==null;){if(s===t){s=null;break}if(i=s.sibling,i!==null){i.return=s.return,s=i;break}s=s.return}i=s}Ye(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,Zr(t,n),o=kt(o),r=r(o),t.flags|=1,Ye(e,t,r,n),t.child;case 14:return r=t.type,o=Mt(r,t.pendingProps),o=Mt(r.type,o),Qh(e,t,r,o,n);case 15:return q0(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Mt(r,o),Ws(e,t),t.tag=1,it(r)?(e=!0,ma(t)):e=!1,Zr(t,n),B0(t,r,o),tc(t,r,o,n),oc(null,t,r,!0,e,n);case 19:return Q0(e,t,n);case 22:return K0(e,t,n)}throw Error(Q(156,t.tag))};function hy(e,t){return Vg(e,t)}function Px(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function St(e,t,n,r){return new Px(e,t,n,r)}function Md(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Cx(e){if(typeof e=="function")return Md(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Gc)return 11;if(e===Qc)return 14}return 2}function Hn(e,t){var n=e.alternate;return n===null?(n=St(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Xs(e,t,n,r,o,i){var s=2;if(r=e,typeof e=="function")Md(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case Rr:return dr(n.children,o,i,t);case Yc:s=8,o|=8;break;case ku:return e=St(12,n,t,o|2),e.elementType=ku,e.lanes=i,e;case Nu:return e=St(13,n,t,o),e.elementType=Nu,e.lanes=i,e;case Pu:return e=St(19,n,t,o),e.elementType=Pu,e.lanes=i,e;case Sg:return rl(n,o,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case $g:s=10;break e;case xg:s=9;break e;case Gc:s=11;break e;case Qc:s=14;break e;case Nn:s=16,r=null;break e}throw Error(Q(130,e==null?e:typeof e,""))}return t=St(s,n,t,o),t.elementType=e,t.type=r,t.lanes=i,t}function dr(e,t,n,r){return e=St(7,e,r,t),e.lanes=n,e}function rl(e,t,n,r){return e=St(22,e,r,t),e.elementType=Sg,e.lanes=n,e.stateNode={isHidden:!1},e}function ou(e,t,n){return e=St(6,e,null,t),e.lanes=n,e}function iu(e,t,n){return t=St(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function bx(e,t,n,r,o){this.tag=t,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=Ll(0),this.expirationTimes=Ll(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ll(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function Td(e,t,n,r,o,i,s,a,l){return e=new bx(e,t,n,a,l),t===1?(t=1,i===!0&&(t|=8)):t=0,i=St(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},md(i),e}function jx(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Ir,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function py(e){if(!e)return Wn;e=e._reactInternals;e:{if(Pr(e)!==e||e.tag!==1)throw Error(Q(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(it(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(Q(171))}if(e.tag===1){var n=e.type;if(it(n))return p0(e,n,t)}return t}function my(e,t,n,r,o,i,s,a,l){return e=Td(n,r,!0,e,o,i,s,a,l),e.context=py(null),n=e.current,r=Qe(),o=Fn(n),i=cn(r,o),i.callback=t??null,Ln(n,i,o),e.current.lanes=o,Bi(e,o,r),st(e,r),e}function ol(e,t,n,r){var o=t.current,i=Qe(),s=Fn(o);return n=py(n),t.context===null?t.context=n:t.pendingContext=n,t=cn(i,s),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=Ln(o,t,s),e!==null&&(Vt(e,o,s,i),Hs(e,o,s)),s}function Ca(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 up(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Id(e,t){up(e,t),(e=e.alternate)&&up(e,t)}function Mx(){return null}var gy=typeof reportError=="function"?reportError:function(e){console.error(e)};function Rd(e){this._internalRoot=e}il.prototype.render=Rd.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(Q(409));ol(e,t,null,null)};il.prototype.unmount=Rd.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;vr(function(){ol(null,e,null,null)}),t[hn]=null}};function il(e){this._internalRoot=e}il.prototype.unstable_scheduleHydration=function(e){if(e){var t=Kg();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Cn.length&&t!==0&&t<Cn[n].priority;n++);Cn.splice(n,0,e),n===0&&Yg(e)}};function zd(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function sl(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function cp(){}function Tx(e,t,n,r,o){if(o){if(typeof r=="function"){var i=r;r=function(){var u=Ca(s);i.call(u)}}var s=my(t,r,e,0,null,!1,!1,"",cp);return e._reactRootContainer=s,e[hn]=s.current,xi(e.nodeType===8?e.parentNode:e),vr(),s}for(;o=e.lastChild;)e.removeChild(o);if(typeof r=="function"){var a=r;r=function(){var u=Ca(l);a.call(u)}}var l=Td(e,0,!1,null,null,!1,!1,"",cp);return e._reactRootContainer=l,e[hn]=l.current,xi(e.nodeType===8?e.parentNode:e),vr(function(){ol(t,l,n,r)}),l}function al(e,t,n,r,o){var i=n._reactRootContainer;if(i){var s=i;if(typeof o=="function"){var a=o;o=function(){var l=Ca(s);a.call(l)}}ol(t,s,e,o)}else s=Tx(n,t,e,o,r);return Ca(s)}Wg=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Ko(t.pendingLanes);n!==0&&(ed(t,n|1),st(t,be()),!(ce&6)&&(co=be()+500,Yn()))}break;case 13:vr(function(){var r=pn(e,1);if(r!==null){var o=Qe();Vt(r,e,1,o)}}),Id(e,1)}};td=function(e){if(e.tag===13){var t=pn(e,134217728);if(t!==null){var n=Qe();Vt(t,e,134217728,n)}Id(e,134217728)}};qg=function(e){if(e.tag===13){var t=Fn(e),n=pn(e,t);if(n!==null){var r=Qe();Vt(n,e,t,r)}Id(e,t)}};Kg=function(){return fe};Xg=function(e,t){var n=fe;try{return fe=e,t()}finally{fe=n}};Ou=function(e,t,n){switch(t){case"input":if(ju(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var o=Qa(r);if(!o)throw Error(Q(90));kg(r),ju(r,o)}}}break;case"textarea":Pg(e,n);break;case"select":t=n.value,t!=null&&Xr(e,!!n.multiple,t,!1)}};Rg=Cd;zg=vr;var Ix={usingClientEntryPoint:!1,Events:[Wi,Dr,Qa,Tg,Ig,Cd]},Lo={findFiberByHostInstance:ir,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Rx={bundleType:Lo.bundleType,version:Lo.version,rendererPackageName:Lo.rendererPackageName,rendererConfig:Lo.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:vn.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Dg(e),e===null?null:e.stateNode},findFiberByHostInstance:Lo.findFiberByHostInstance||Mx,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 _s=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!_s.isDisabled&&_s.supportsFiber)try{Ka=_s.inject(Rx),Xt=_s}catch{}}ht.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Ix;ht.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!zd(t))throw Error(Q(200));return jx(e,t,null,n)};ht.createRoot=function(e,t){if(!zd(e))throw Error(Q(299));var n=!1,r="",o=gy;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=Td(e,1,!1,null,null,n,!1,r,o),e[hn]=t.current,xi(e.nodeType===8?e.parentNode:e),new Rd(t)};ht.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(Q(188)):(e=Object.keys(e).join(","),Error(Q(268,e)));return e=Dg(t),e=e===null?null:e.stateNode,e};ht.flushSync=function(e){return vr(e)};ht.hydrate=function(e,t,n){if(!sl(t))throw Error(Q(200));return al(null,e,t,!0,n)};ht.hydrateRoot=function(e,t,n){if(!zd(e))throw Error(Q(405));var r=n!=null&&n.hydratedSources||null,o=!1,i="",s=gy;if(n!=null&&(n.unstable_strictMode===!0&&(o=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(s=n.onRecoverableError)),t=my(t,null,e,1,n??null,o,!1,i,s),e[hn]=t.current,xi(e),r)for(e=0;e<r.length;e++)n=r[e],o=n._getVersion,o=o(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,o]:t.mutableSourceEagerHydrationData.push(n,o);return new il(t)};ht.render=function(e,t,n){if(!sl(t))throw Error(Q(200));return al(null,e,t,!1,n)};ht.unmountComponentAtNode=function(e){if(!sl(e))throw Error(Q(40));return e._reactRootContainer?(vr(function(){al(null,null,e,!1,function(){e._reactRootContainer=null,e[hn]=null})}),!0):!1};ht.unstable_batchedUpdates=Cd;ht.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!sl(n))throw Error(Q(200));if(e==null||e._reactInternals===void 0)throw Error(Q(38));return al(e,t,n,!1,r)};ht.version="18.3.1-next-f1338f8080-20240426";function yy(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(yy)}catch(e){console.error(e)}}yy(),yg.exports=ht;var vy=yg.exports,wy,dp=vy;wy=dp.createRoot,dp.hydrateRoot;const zx="modulepreload",Ax=function(e){return"/"+e},fp={},Ox=function(t,n,r){let o=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const s=document.querySelector("meta[property=csp-nonce]"),a=(s==null?void 0:s.nonce)||(s==null?void 0:s.getAttribute("nonce"));o=Promise.allSettled(n.map(l=>{if(l=Ax(l),l in fp)return;fp[l]=!0;const u=l.endsWith(".css"),d=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${d}`))return;const c=document.createElement("link");if(c.rel=u?"stylesheet":zx,u||(c.as="script"),c.crossOrigin="",c.href=l,a&&c.setAttribute("nonce",a),document.head.appendChild(c),u)return new Promise((f,m)=>{c.addEventListener("load",f),c.addEventListener("error",()=>m(new Error(`Unable to preload CSS for ${l}`)))})}))}function i(s){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=s,window.dispatchEvent(a),!a.defaultPrevented)throw s}return o.then(s=>{for(const a of s||[])a.status==="rejected"&&i(a.reason);return t().catch(i)})};/**
|
|
41
|
+
* @license lucide-react v0.460.0 - ISC
|
|
42
|
+
*
|
|
43
|
+
* This source code is licensed under the ISC license.
|
|
44
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
45
|
+
*/const Dx=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),_y=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/**
|
|
46
|
+
* @license lucide-react v0.460.0 - ISC
|
|
47
|
+
*
|
|
48
|
+
* This source code is licensed under the ISC license.
|
|
49
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
50
|
+
*/var Lx={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
51
|
+
* @license lucide-react v0.460.0 - ISC
|
|
52
|
+
*
|
|
53
|
+
* This source code is licensed under the ISC license.
|
|
54
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
55
|
+
*/const Vx=A.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:i,iconNode:s,...a},l)=>A.createElement("svg",{ref:l,...Lx,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:_y("lucide",o),...a},[...s.map(([u,d])=>A.createElement(u,d)),...Array.isArray(i)?i:[i]]));/**
|
|
56
|
+
* @license lucide-react v0.460.0 - ISC
|
|
57
|
+
*
|
|
58
|
+
* This source code is licensed under the ISC license.
|
|
59
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
60
|
+
*/const pe=(e,t)=>{const n=A.forwardRef(({className:r,...o},i)=>A.createElement(Vx,{ref:i,iconNode:t,className:_y(`lucide-${Dx(e)}`,r),...o}));return n.displayName=`${e}`,n};/**
|
|
61
|
+
* @license lucide-react v0.460.0 - ISC
|
|
62
|
+
*
|
|
63
|
+
* This source code is licensed under the ISC license.
|
|
64
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
65
|
+
*/const hp=pe("Box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);/**
|
|
66
|
+
* @license lucide-react v0.460.0 - ISC
|
|
67
|
+
*
|
|
68
|
+
* This source code is licensed under the ISC license.
|
|
69
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
70
|
+
*/const Fx=pe("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
|
|
71
|
+
* @license lucide-react v0.460.0 - ISC
|
|
72
|
+
*
|
|
73
|
+
* This source code is licensed under the ISC license.
|
|
74
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
75
|
+
*/const Hx=pe("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
|
|
76
|
+
* @license lucide-react v0.460.0 - ISC
|
|
77
|
+
*
|
|
78
|
+
* This source code is licensed under the ISC license.
|
|
79
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
80
|
+
*/const Bx=pe("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
|
|
81
|
+
* @license lucide-react v0.460.0 - ISC
|
|
82
|
+
*
|
|
83
|
+
* This source code is licensed under the ISC license.
|
|
84
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
85
|
+
*/const Ux=pe("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
|
|
86
|
+
* @license lucide-react v0.460.0 - ISC
|
|
87
|
+
*
|
|
88
|
+
* This source code is licensed under the ISC license.
|
|
89
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
90
|
+
*/const Wx=pe("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
|
|
91
|
+
* @license lucide-react v0.460.0 - ISC
|
|
92
|
+
*
|
|
93
|
+
* This source code is licensed under the ISC license.
|
|
94
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
95
|
+
*/const $y=pe("CornerDownRight",[["polyline",{points:"15 10 20 15 15 20",key:"1q7qjw"}],["path",{d:"M4 4v7a4 4 0 0 0 4 4h12",key:"z08zvw"}]]);/**
|
|
96
|
+
* @license lucide-react v0.460.0 - ISC
|
|
97
|
+
*
|
|
98
|
+
* This source code is licensed under the ISC license.
|
|
99
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
100
|
+
*/const qx=pe("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);/**
|
|
101
|
+
* @license lucide-react v0.460.0 - ISC
|
|
102
|
+
*
|
|
103
|
+
* This source code is licensed under the ISC license.
|
|
104
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
105
|
+
*/const Kx=pe("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
|
|
106
|
+
* @license lucide-react v0.460.0 - ISC
|
|
107
|
+
*
|
|
108
|
+
* This source code is licensed under the ISC license.
|
|
109
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
110
|
+
*/const Xx=pe("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/**
|
|
111
|
+
* @license lucide-react v0.460.0 - ISC
|
|
112
|
+
*
|
|
113
|
+
* This source code is licensed under the ISC license.
|
|
114
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
115
|
+
*/const xy=pe("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
|
|
116
|
+
* @license lucide-react v0.460.0 - ISC
|
|
117
|
+
*
|
|
118
|
+
* This source code is licensed under the ISC license.
|
|
119
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
120
|
+
*/const Yx=pe("Monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);/**
|
|
121
|
+
* @license lucide-react v0.460.0 - ISC
|
|
122
|
+
*
|
|
123
|
+
* This source code is licensed under the ISC license.
|
|
124
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
125
|
+
*/const Gx=pe("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
|
|
126
|
+
* @license lucide-react v0.460.0 - ISC
|
|
127
|
+
*
|
|
128
|
+
* This source code is licensed under the ISC license.
|
|
129
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
130
|
+
*/const Qx=pe("Music",[["path",{d:"M9 18V5l12-2v13",key:"1jmyc2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["circle",{cx:"18",cy:"16",r:"3",key:"1hluhg"}]]);/**
|
|
131
|
+
* @license lucide-react v0.460.0 - ISC
|
|
132
|
+
*
|
|
133
|
+
* This source code is licensed under the ISC license.
|
|
134
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
135
|
+
*/const Zx=pe("Paperclip",[["path",{d:"m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l8.57-8.57A4 4 0 1 1 18 8.84l-8.59 8.57a2 2 0 0 1-2.83-2.83l8.49-8.48",key:"1u3ebp"}]]);/**
|
|
136
|
+
* @license lucide-react v0.460.0 - ISC
|
|
137
|
+
*
|
|
138
|
+
* This source code is licensed under the ISC license.
|
|
139
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
140
|
+
*/const Jx=pe("Pause",[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]]);/**
|
|
141
|
+
* @license lucide-react v0.460.0 - ISC
|
|
142
|
+
*
|
|
143
|
+
* This source code is licensed under the ISC license.
|
|
144
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
145
|
+
*/const eS=pe("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
|
|
146
|
+
* @license lucide-react v0.460.0 - ISC
|
|
147
|
+
*
|
|
148
|
+
* This source code is licensed under the ISC license.
|
|
149
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
150
|
+
*/const ll=pe("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
|
|
151
|
+
* @license lucide-react v0.460.0 - ISC
|
|
152
|
+
*
|
|
153
|
+
* This source code is licensed under the ISC license.
|
|
154
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
155
|
+
*/const tS=pe("Server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]);/**
|
|
156
|
+
* @license lucide-react v0.460.0 - ISC
|
|
157
|
+
*
|
|
158
|
+
* This source code is licensed under the ISC license.
|
|
159
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
160
|
+
*/const nS=pe("SkipBack",[["polygon",{points:"19 20 9 12 19 4 19 20",key:"o2sva"}],["line",{x1:"5",x2:"5",y1:"19",y2:"5",key:"1ocqjk"}]]);/**
|
|
161
|
+
* @license lucide-react v0.460.0 - ISC
|
|
162
|
+
*
|
|
163
|
+
* This source code is licensed under the ISC license.
|
|
164
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
165
|
+
*/const rS=pe("SlidersVertical",[["line",{x1:"4",x2:"4",y1:"21",y2:"14",key:"1p332r"}],["line",{x1:"4",x2:"4",y1:"10",y2:"3",key:"gb41h5"}],["line",{x1:"12",x2:"12",y1:"21",y2:"12",key:"hf2csr"}],["line",{x1:"12",x2:"12",y1:"8",y2:"3",key:"1kfi7u"}],["line",{x1:"20",x2:"20",y1:"21",y2:"16",key:"1lhrwl"}],["line",{x1:"20",x2:"20",y1:"12",y2:"3",key:"16vvfq"}],["line",{x1:"2",x2:"6",y1:"14",y2:"14",key:"1uebub"}],["line",{x1:"10",x2:"14",y1:"8",y2:"8",key:"1yglbp"}],["line",{x1:"18",x2:"22",y1:"16",y2:"16",key:"1jxqpz"}]]);/**
|
|
166
|
+
* @license lucide-react v0.460.0 - ISC
|
|
167
|
+
*
|
|
168
|
+
* This source code is licensed under the ISC license.
|
|
169
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
170
|
+
*/const oS=pe("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);/**
|
|
171
|
+
* @license lucide-react v0.460.0 - ISC
|
|
172
|
+
*
|
|
173
|
+
* This source code is licensed under the ISC license.
|
|
174
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
175
|
+
*/const iS=pe("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
|
|
176
|
+
* @license lucide-react v0.460.0 - ISC
|
|
177
|
+
*
|
|
178
|
+
* This source code is licensed under the ISC license.
|
|
179
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
180
|
+
*/const sS=pe("WifiOff",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
|
|
181
|
+
* @license lucide-react v0.460.0 - ISC
|
|
182
|
+
*
|
|
183
|
+
* This source code is licensed under the ISC license.
|
|
184
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
185
|
+
*/const aS=pe("Wifi",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]]);/**
|
|
186
|
+
* @license lucide-react v0.460.0 - ISC
|
|
187
|
+
*
|
|
188
|
+
* This source code is licensed under the ISC license.
|
|
189
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
190
|
+
*/const Sy=pe("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
|
|
191
|
+
* @license lucide-react v0.460.0 - ISC
|
|
192
|
+
*
|
|
193
|
+
* This source code is licensed under the ISC license.
|
|
194
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
195
|
+
*/const lS=pe("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]),uS="loom-theme";function cS(){return typeof document>"u"?"light":document.documentElement.getAttribute("data-theme")==="dark"?"dark":"light"}function dS(){const[e,t]=A.useState(cS);A.useEffect(()=>{document.documentElement.setAttribute("data-theme",e);try{localStorage.setItem(uS,e)}catch{}},[e]);const n=A.useCallback(()=>{t(r=>r==="light"?"dark":"light")},[]);return{theme:e,setTheme:t,toggleTheme:n}}function fS({currentKind:e,currentId:t,currentTitle:n,diagrams:r,timelines:o,onNavigate:i,onCreate:s}){const[a,l]=A.useState(!1),u=A.useRef(null);A.useEffect(()=>{if(!a)return;function c(f){u.current&&!u.current.contains(f.target)&&l(!1)}return document.addEventListener("mousedown",c),()=>document.removeEventListener("mousedown",c)},[a]);const d=(c,f)=>c===e&&f===t;return $.jsxs("div",{className:"diagram-switcher",ref:u,children:[$.jsxs("button",{className:"switcher-trigger",onClick:()=>l(c=>!c),"aria-expanded":a,"aria-haspopup":"listbox",children:[$.jsx("span",{className:"switcher-title",children:n}),$.jsx(Hx,{size:14,className:a?"flip":""})]}),a&&$.jsxs("div",{className:"switcher-menu",role:"listbox",children:[r.length===0&&o.length===0&&$.jsx("div",{className:"switcher-empty",children:"Nothing here yet."}),r.length>0&&$.jsx("div",{className:"switcher-section-label",children:"Diagrams"}),r.map(c=>$.jsxs("button",{className:`switcher-item ${d("diagram",c.id)?"active":""}`,onClick:()=>{i({kind:"diagram",id:c.id}),l(!1)},children:[$.jsx(Kx,{size:13,className:"switcher-item-icon"}),$.jsxs("div",{className:"switcher-item-text",children:[$.jsx("div",{className:"switcher-item-title",children:c.title}),$.jsxs("div",{className:"switcher-item-meta",children:[$.jsx("code",{children:c.id})," · ",c.nodeCount," nodes · ",c.edgeCount," edges"]})]})]},`d-${c.id}`)),o.length>0&&$.jsxs($.Fragment,{children:[$.jsx("div",{className:"switcher-divider"}),$.jsx("div",{className:"switcher-section-label",children:"Timelines"}),o.map(c=>$.jsxs("button",{className:`switcher-item ${d("timeline",c.id)?"active":""}`,onClick:()=>{i({kind:"timeline",id:c.id}),l(!1)},children:[$.jsx(Wx,{size:13,className:"switcher-item-icon"}),$.jsxs("div",{className:"switcher-item-text",children:[$.jsx("div",{className:"switcher-item-title",children:c.title}),$.jsxs("div",{className:"switcher-item-meta",children:[$.jsx("code",{children:c.id})," · ",c.eventCount," events · ",hS(c.totalDurationMs)]})]})]},`t-${c.id}`))]}),s&&$.jsxs($.Fragment,{children:[$.jsx("div",{className:"switcher-divider"}),$.jsxs("button",{className:"switcher-item new",onClick:()=>{s(),l(!1)},children:[$.jsx(ll,{size:13,className:"switcher-item-icon"}),$.jsx("span",{children:"New diagram…"})]})]})]})]})}function hS(e){return e===0?"0ms":e<1e3?`${Math.round(e)}ms`:`${(e/1e3).toFixed(1)}s`}function pS({status:e}){return e==="connected"?$.jsx("span",{className:"conn-dot connected",title:"Live sync connected","aria-label":"Live sync connected",children:$.jsx(aS,{size:12})}):e==="connecting"?$.jsx("span",{className:"conn-dot connecting",title:"Connecting to live sync…","aria-label":"Connecting",children:$.jsx(xy,{size:12,className:"spin"})}):$.jsx("span",{className:"conn-dot disconnected",title:"Live sync disconnected — reconnecting in the background","aria-label":"Disconnected",children:$.jsx(sS,{size:12})})}function mS({status:e,error:t}){return e==="idle"?null:e==="dirty"?$.jsx("span",{className:"save-indicator dirty",children:"unsaved"}):e==="saving"?$.jsxs("span",{className:"save-indicator saving",children:[$.jsx(xy,{size:12,className:"spin"})," saving…"]}):e==="saved"?$.jsxs("span",{className:"save-indicator saved",children:[$.jsx(Fx,{size:12})," saved"]}):e==="error"?$.jsxs("span",{className:"save-indicator error",title:t??"unknown",children:[$.jsx(Ux,{size:12})," save failed"]}):null}function Ey({viewKind:e,viewId:t,title:n,subtitle:r,diagrams:o,timelines:i,saveStatus:s,saveError:a,connectionStatus:l,validationErrorCount:u=0,onClickAdd:d,addMenuOpen:c,isDefault:f,onClickHome:m,onNavigate:y,onCreateDiagram:v,addButtonRef:w,hideAddButton:h=!1}){const{theme:g,toggleTheme:p}=dS();return $.jsxs("div",{className:"topbar",children:[!f&&$.jsxs("button",{className:"breadcrumb-back",onClick:m,title:"Back to overview","aria-label":"Back to overview",children:[$.jsx(Bx,{size:14})," Overview"]}),$.jsx(fS,{currentKind:e,currentId:t,currentTitle:n,diagrams:o,timelines:i,onNavigate:y,onCreate:v}),r&&$.jsx("div",{className:"subtitle",children:r}),u>0&&$.jsxs("span",{className:"validation-chip",title:`${u} validation issue${u===1?"":"s"} — check the inspector`,children:[$.jsx(iS,{size:12})," ",u]}),$.jsx(pS,{status:l}),$.jsx(mS,{status:s,error:a}),!h&&w&&$.jsxs("button",{ref:w,onClick:d,title:"Add node","aria-label":"Add node","aria-expanded":c,children:[$.jsx(ll,{size:16})," Add"]}),$.jsx("button",{onClick:p,title:`Switch to ${g==="light"?"dark":"light"} theme`,"aria-label":"Toggle theme",children:g==="light"?$.jsx(Gx,{size:16}):$.jsx(oS,{size:16})})]})}function Te(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,r;n<e.length;n++)(r=Te(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var gS={value:()=>{}};function ul(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new Ys(n)}function Ys(e){this._=e}function yS(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",o=n.indexOf(".");if(o>=0&&(r=n.slice(o+1),n=n.slice(0,o)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}Ys.prototype=ul.prototype={constructor:Ys,on:function(e,t){var n=this._,r=yS(e+"",n),o,i=-1,s=r.length;if(arguments.length<2){for(;++i<s;)if((o=(e=r[i]).type)&&(o=vS(n[o],e.name)))return o;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++i<s;)if(o=(e=r[i]).type)n[o]=pp(n[o],e.name,t);else if(t==null)for(o in n)n[o]=pp(n[o],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Ys(e)},call:function(e,t){if((o=arguments.length-2)>0)for(var n=new Array(o),r=0,o,i;r<o;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(i=this._[e],r=0,o=i.length;r<o;++r)i[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],o=0,i=r.length;o<i;++o)r[o].value.apply(t,n)}};function vS(e,t){for(var n=0,r=e.length,o;n<r;++n)if((o=e[n]).name===t)return o.value}function pp(e,t,n){for(var r=0,o=e.length;r<o;++r)if(e[r].name===t){e[r]=gS,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var gc="http://www.w3.org/1999/xhtml";const mp={svg:"http://www.w3.org/2000/svg",xhtml:gc,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function cl(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),mp.hasOwnProperty(t)?{space:mp[t],local:e}:e}function wS(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===gc&&t.documentElement.namespaceURI===gc?t.createElement(e):t.createElementNS(n,e)}}function _S(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function ky(e){var t=cl(e);return(t.local?_S:wS)(t)}function $S(){}function Ad(e){return e==null?$S:function(){return this.querySelector(e)}}function xS(e){typeof e!="function"&&(e=Ad(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var i=t[o],s=i.length,a=r[o]=new Array(s),l,u,d=0;d<s;++d)(l=i[d])&&(u=e.call(l,l.__data__,d,i))&&("__data__"in l&&(u.__data__=l.__data__),a[d]=u);return new ft(r,this._parents)}function SS(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function ES(){return[]}function Ny(e){return e==null?ES:function(){return this.querySelectorAll(e)}}function kS(e){return function(){return SS(e.apply(this,arguments))}}function NS(e){typeof e=="function"?e=kS(e):e=Ny(e);for(var t=this._groups,n=t.length,r=[],o=[],i=0;i<n;++i)for(var s=t[i],a=s.length,l,u=0;u<a;++u)(l=s[u])&&(r.push(e.call(l,l.__data__,u,s)),o.push(l));return new ft(r,o)}function Py(e){return function(){return this.matches(e)}}function Cy(e){return function(t){return t.matches(e)}}var PS=Array.prototype.find;function CS(e){return function(){return PS.call(this.children,e)}}function bS(){return this.firstElementChild}function jS(e){return this.select(e==null?bS:CS(typeof e=="function"?e:Cy(e)))}var MS=Array.prototype.filter;function TS(){return Array.from(this.children)}function IS(e){return function(){return MS.call(this.children,e)}}function RS(e){return this.selectAll(e==null?TS:IS(typeof e=="function"?e:Cy(e)))}function zS(e){typeof e!="function"&&(e=Py(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var i=t[o],s=i.length,a=r[o]=[],l,u=0;u<s;++u)(l=i[u])&&e.call(l,l.__data__,u,i)&&a.push(l);return new ft(r,this._parents)}function by(e){return new Array(e.length)}function AS(){return new ft(this._enter||this._groups.map(by),this._parents)}function ba(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}ba.prototype={constructor:ba,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function OS(e){return function(){return e}}function DS(e,t,n,r,o,i){for(var s=0,a,l=t.length,u=i.length;s<u;++s)(a=t[s])?(a.__data__=i[s],r[s]=a):n[s]=new ba(e,i[s]);for(;s<l;++s)(a=t[s])&&(o[s]=a)}function LS(e,t,n,r,o,i,s){var a,l,u=new Map,d=t.length,c=i.length,f=new Array(d),m;for(a=0;a<d;++a)(l=t[a])&&(f[a]=m=s.call(l,l.__data__,a,t)+"",u.has(m)?o[a]=l:u.set(m,l));for(a=0;a<c;++a)m=s.call(e,i[a],a,i)+"",(l=u.get(m))?(r[a]=l,l.__data__=i[a],u.delete(m)):n[a]=new ba(e,i[a]);for(a=0;a<d;++a)(l=t[a])&&u.get(f[a])===l&&(o[a]=l)}function VS(e){return e.__data__}function FS(e,t){if(!arguments.length)return Array.from(this,VS);var n=t?LS:DS,r=this._parents,o=this._groups;typeof e!="function"&&(e=OS(e));for(var i=o.length,s=new Array(i),a=new Array(i),l=new Array(i),u=0;u<i;++u){var d=r[u],c=o[u],f=c.length,m=HS(e.call(d,d&&d.__data__,u,r)),y=m.length,v=a[u]=new Array(y),w=s[u]=new Array(y),h=l[u]=new Array(f);n(d,c,v,w,h,m,t);for(var g=0,p=0,_,x;g<y;++g)if(_=v[g]){for(g>=p&&(p=g+1);!(x=w[p])&&++p<y;);_._next=x||null}}return s=new ft(s,r),s._enter=a,s._exit=l,s}function HS(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function BS(){return new ft(this._exit||this._groups.map(by),this._parents)}function US(e,t,n){var r=this.enter(),o=this,i=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(o=t(o),o&&(o=o.selection())),n==null?i.remove():n(i),r&&o?r.merge(o).order():o}function WS(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,o=n.length,i=r.length,s=Math.min(o,i),a=new Array(o),l=0;l<s;++l)for(var u=n[l],d=r[l],c=u.length,f=a[l]=new Array(c),m,y=0;y<c;++y)(m=u[y]||d[y])&&(f[y]=m);for(;l<o;++l)a[l]=n[l];return new ft(a,this._parents)}function qS(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],o=r.length-1,i=r[o],s;--o>=0;)(s=r[o])&&(i&&s.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(s,i),i=s);return this}function KS(e){e||(e=XS);function t(c,f){return c&&f?e(c.__data__,f.__data__):!c-!f}for(var n=this._groups,r=n.length,o=new Array(r),i=0;i<r;++i){for(var s=n[i],a=s.length,l=o[i]=new Array(a),u,d=0;d<a;++d)(u=s[d])&&(l[d]=u);l.sort(t)}return new ft(o,this._parents).order()}function XS(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function YS(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function GS(){return Array.from(this)}function QS(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],o=0,i=r.length;o<i;++o){var s=r[o];if(s)return s}return null}function ZS(){let e=0;for(const t of this)++e;return e}function JS(){return!this.node()}function eE(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var o=t[n],i=0,s=o.length,a;i<s;++i)(a=o[i])&&e.call(a,a.__data__,i,o);return this}function tE(e){return function(){this.removeAttribute(e)}}function nE(e){return function(){this.removeAttributeNS(e.space,e.local)}}function rE(e,t){return function(){this.setAttribute(e,t)}}function oE(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function iE(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function sE(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function aE(e,t){var n=cl(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?nE:tE:typeof t=="function"?n.local?sE:iE:n.local?oE:rE)(n,t))}function jy(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function lE(e){return function(){this.style.removeProperty(e)}}function uE(e,t,n){return function(){this.style.setProperty(e,t,n)}}function cE(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function dE(e,t,n){return arguments.length>1?this.each((t==null?lE:typeof t=="function"?cE:uE)(e,t,n??"")):fo(this.node(),e)}function fo(e,t){return e.style.getPropertyValue(t)||jy(e).getComputedStyle(e,null).getPropertyValue(t)}function fE(e){return function(){delete this[e]}}function hE(e,t){return function(){this[e]=t}}function pE(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function mE(e,t){return arguments.length>1?this.each((t==null?fE:typeof t=="function"?pE:hE)(e,t)):this.node()[e]}function My(e){return e.trim().split(/^|\s+/)}function Od(e){return e.classList||new Ty(e)}function Ty(e){this._node=e,this._names=My(e.getAttribute("class")||"")}Ty.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function Iy(e,t){for(var n=Od(e),r=-1,o=t.length;++r<o;)n.add(t[r])}function Ry(e,t){for(var n=Od(e),r=-1,o=t.length;++r<o;)n.remove(t[r])}function gE(e){return function(){Iy(this,e)}}function yE(e){return function(){Ry(this,e)}}function vE(e,t){return function(){(t.apply(this,arguments)?Iy:Ry)(this,e)}}function wE(e,t){var n=My(e+"");if(arguments.length<2){for(var r=Od(this.node()),o=-1,i=n.length;++o<i;)if(!r.contains(n[o]))return!1;return!0}return this.each((typeof t=="function"?vE:t?gE:yE)(n,t))}function _E(){this.textContent=""}function $E(e){return function(){this.textContent=e}}function xE(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function SE(e){return arguments.length?this.each(e==null?_E:(typeof e=="function"?xE:$E)(e)):this.node().textContent}function EE(){this.innerHTML=""}function kE(e){return function(){this.innerHTML=e}}function NE(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function PE(e){return arguments.length?this.each(e==null?EE:(typeof e=="function"?NE:kE)(e)):this.node().innerHTML}function CE(){this.nextSibling&&this.parentNode.appendChild(this)}function bE(){return this.each(CE)}function jE(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function ME(){return this.each(jE)}function TE(e){var t=typeof e=="function"?e:ky(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function IE(){return null}function RE(e,t){var n=typeof e=="function"?e:ky(e),r=t==null?IE:typeof t=="function"?t:Ad(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function zE(){var e=this.parentNode;e&&e.removeChild(this)}function AE(){return this.each(zE)}function OE(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function DE(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function LE(e){return this.select(e?DE:OE)}function VE(e){return arguments.length?this.property("__data__",e):this.node().__data__}function FE(e){return function(t){e.call(this,t,this.__data__)}}function HE(e){return e.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");return r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function BE(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,o=t.length,i;n<o;++n)i=t[n],(!e.type||i.type===e.type)&&i.name===e.name?this.removeEventListener(i.type,i.listener,i.options):t[++r]=i;++r?t.length=r:delete this.__on}}}function UE(e,t,n){return function(){var r=this.__on,o,i=FE(t);if(r){for(var s=0,a=r.length;s<a;++s)if((o=r[s]).type===e.type&&o.name===e.name){this.removeEventListener(o.type,o.listener,o.options),this.addEventListener(o.type,o.listener=i,o.options=n),o.value=t;return}}this.addEventListener(e.type,i,n),o={type:e.type,name:e.name,value:t,listener:i,options:n},r?r.push(o):this.__on=[o]}}function WE(e,t,n){var r=HE(e+""),o,i=r.length,s;if(arguments.length<2){var a=this.node().__on;if(a){for(var l=0,u=a.length,d;l<u;++l)for(o=0,d=a[l];o<i;++o)if((s=r[o]).type===d.type&&s.name===d.name)return d.value}return}for(a=t?UE:BE,o=0;o<i;++o)this.each(a(r[o],t,n));return this}function zy(e,t,n){var r=jy(e),o=r.CustomEvent;typeof o=="function"?o=new o(t,n):(o=r.document.createEvent("Event"),n?(o.initEvent(t,n.bubbles,n.cancelable),o.detail=n.detail):o.initEvent(t,!1,!1)),e.dispatchEvent(o)}function qE(e,t){return function(){return zy(this,e,t)}}function KE(e,t){return function(){return zy(this,e,t.apply(this,arguments))}}function XE(e,t){return this.each((typeof t=="function"?KE:qE)(e,t))}function*YE(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],o=0,i=r.length,s;o<i;++o)(s=r[o])&&(yield s)}var Ay=[null];function ft(e,t){this._groups=e,this._parents=t}function Ki(){return new ft([[document.documentElement]],Ay)}function GE(){return this}ft.prototype=Ki.prototype={constructor:ft,select:xS,selectAll:NS,selectChild:jS,selectChildren:RS,filter:zS,data:FS,enter:AS,exit:BS,join:US,merge:WS,selection:GE,order:qS,sort:KS,call:YS,nodes:GS,node:QS,size:ZS,empty:JS,each:eE,attr:aE,style:dE,property:mE,classed:wE,text:SE,html:PE,raise:bE,lower:ME,append:TE,insert:RE,remove:AE,clone:LE,datum:VE,on:WE,dispatch:XE,[Symbol.iterator]:YE};function lt(e){return typeof e=="string"?new ft([[document.querySelector(e)]],[document.documentElement]):new ft([[e]],Ay)}function QE(e){let t;for(;t=e.sourceEvent;)e=t;return e}function It(e,t){if(e=QE(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var o=t.getBoundingClientRect();return[e.clientX-o.left-t.clientLeft,e.clientY-o.top-t.clientTop]}}return[e.pageX,e.pageY]}const ZE={passive:!1},Mi={capture:!0,passive:!1};function su(e){e.stopImmediatePropagation()}function eo(e){e.preventDefault(),e.stopImmediatePropagation()}function Oy(e){var t=e.document.documentElement,n=lt(e).on("dragstart.drag",eo,Mi);"onselectstart"in t?n.on("selectstart.drag",eo,Mi):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function Dy(e,t){var n=e.document.documentElement,r=lt(e).on("dragstart.drag",null);t&&(r.on("click.drag",eo,Mi),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const $s=e=>()=>e;function yc(e,{sourceEvent:t,subject:n,target:r,identifier:o,active:i,x:s,y:a,dx:l,dy:u,dispatch:d}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:o,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:s,enumerable:!0,configurable:!0},y:{value:a,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:d}})}yc.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function JE(e){return!e.ctrlKey&&!e.button}function e2(){return this.parentNode}function t2(e,t){return t??{x:e.x,y:e.y}}function n2(){return navigator.maxTouchPoints||"ontouchstart"in this}function Ly(){var e=JE,t=e2,n=t2,r=n2,o={},i=ul("start","drag","end"),s=0,a,l,u,d,c=0;function f(_){_.on("mousedown.drag",m).filter(r).on("touchstart.drag",w).on("touchmove.drag",h,ZE).on("touchend.drag touchcancel.drag",g).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function m(_,x){if(!(d||!e.call(this,_,x))){var k=p(this,t.call(this,_,x),_,x,"mouse");k&&(lt(_.view).on("mousemove.drag",y,Mi).on("mouseup.drag",v,Mi),Oy(_.view),su(_),u=!1,a=_.clientX,l=_.clientY,k("start",_))}}function y(_){if(eo(_),!u){var x=_.clientX-a,k=_.clientY-l;u=x*x+k*k>c}o.mouse("drag",_)}function v(_){lt(_.view).on("mousemove.drag mouseup.drag",null),Dy(_.view,u),eo(_),o.mouse("end",_)}function w(_,x){if(e.call(this,_,x)){var k=_.changedTouches,P=t.call(this,_,x),b=k.length,F,W;for(F=0;F<b;++F)(W=p(this,P,_,x,k[F].identifier,k[F]))&&(su(_),W("start",_,k[F]))}}function h(_){var x=_.changedTouches,k=x.length,P,b;for(P=0;P<k;++P)(b=o[x[P].identifier])&&(eo(_),b("drag",_,x[P]))}function g(_){var x=_.changedTouches,k=x.length,P,b;for(d&&clearTimeout(d),d=setTimeout(function(){d=null},500),P=0;P<k;++P)(b=o[x[P].identifier])&&(su(_),b("end",_,x[P]))}function p(_,x,k,P,b,F){var W=i.copy(),I=It(F||k,x),H,q,E;if((E=n.call(_,new yc("beforestart",{sourceEvent:k,target:f,identifier:b,active:s,x:I[0],y:I[1],dx:0,dy:0,dispatch:W}),P))!=null)return H=E.x-I[0]||0,q=E.y-I[1]||0,function O(M,V,j){var z=I,T;switch(M){case"start":o[b]=O,T=s++;break;case"end":delete o[b],--s;case"drag":I=It(j||V,x),T=s;break}W.call(M,_,new yc(M,{sourceEvent:V,subject:E,target:f,identifier:b,active:T,x:I[0]+H,y:I[1]+q,dx:I[0]-z[0],dy:I[1]-z[1],dispatch:W}),P)}}return f.filter=function(_){return arguments.length?(e=typeof _=="function"?_:$s(!!_),f):e},f.container=function(_){return arguments.length?(t=typeof _=="function"?_:$s(_),f):t},f.subject=function(_){return arguments.length?(n=typeof _=="function"?_:$s(_),f):n},f.touchable=function(_){return arguments.length?(r=typeof _=="function"?_:$s(!!_),f):r},f.on=function(){var _=i.on.apply(i,arguments);return _===i?f:_},f.clickDistance=function(_){return arguments.length?(c=(_=+_)*_,f):Math.sqrt(c)},f}function Dd(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Vy(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Xi(){}var Ti=.7,ja=1/Ti,to="\\s*([+-]?\\d+)\\s*",Ii="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Gt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",r2=/^#([0-9a-f]{3,8})$/,o2=new RegExp(`^rgb\\(${to},${to},${to}\\)$`),i2=new RegExp(`^rgb\\(${Gt},${Gt},${Gt}\\)$`),s2=new RegExp(`^rgba\\(${to},${to},${to},${Ii}\\)$`),a2=new RegExp(`^rgba\\(${Gt},${Gt},${Gt},${Ii}\\)$`),l2=new RegExp(`^hsl\\(${Ii},${Gt},${Gt}\\)$`),u2=new RegExp(`^hsla\\(${Ii},${Gt},${Gt},${Ii}\\)$`),gp={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};Dd(Xi,wr,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:yp,formatHex:yp,formatHex8:c2,formatHsl:d2,formatRgb:vp,toString:vp});function yp(){return this.rgb().formatHex()}function c2(){return this.rgb().formatHex8()}function d2(){return Fy(this).formatHsl()}function vp(){return this.rgb().formatRgb()}function wr(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=r2.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?wp(t):n===3?new rt(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?xs(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?xs(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=o2.exec(e))?new rt(t[1],t[2],t[3],1):(t=i2.exec(e))?new rt(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=s2.exec(e))?xs(t[1],t[2],t[3],t[4]):(t=a2.exec(e))?xs(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=l2.exec(e))?xp(t[1],t[2]/100,t[3]/100,1):(t=u2.exec(e))?xp(t[1],t[2]/100,t[3]/100,t[4]):gp.hasOwnProperty(e)?wp(gp[e]):e==="transparent"?new rt(NaN,NaN,NaN,0):null}function wp(e){return new rt(e>>16&255,e>>8&255,e&255,1)}function xs(e,t,n,r){return r<=0&&(e=t=n=NaN),new rt(e,t,n,r)}function f2(e){return e instanceof Xi||(e=wr(e)),e?(e=e.rgb(),new rt(e.r,e.g,e.b,e.opacity)):new rt}function vc(e,t,n,r){return arguments.length===1?f2(e):new rt(e,t,n,r??1)}function rt(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Dd(rt,vc,Vy(Xi,{brighter(e){return e=e==null?ja:Math.pow(ja,e),new rt(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Ti:Math.pow(Ti,e),new rt(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new rt(fr(this.r),fr(this.g),fr(this.b),Ma(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:_p,formatHex:_p,formatHex8:h2,formatRgb:$p,toString:$p}));function _p(){return`#${lr(this.r)}${lr(this.g)}${lr(this.b)}`}function h2(){return`#${lr(this.r)}${lr(this.g)}${lr(this.b)}${lr((isNaN(this.opacity)?1:this.opacity)*255)}`}function $p(){const e=Ma(this.opacity);return`${e===1?"rgb(":"rgba("}${fr(this.r)}, ${fr(this.g)}, ${fr(this.b)}${e===1?")":`, ${e})`}`}function Ma(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function fr(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function lr(e){return e=fr(e),(e<16?"0":"")+e.toString(16)}function xp(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new zt(e,t,n,r)}function Fy(e){if(e instanceof zt)return new zt(e.h,e.s,e.l,e.opacity);if(e instanceof Xi||(e=wr(e)),!e)return new zt;if(e instanceof zt)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,o=Math.min(t,n,r),i=Math.max(t,n,r),s=NaN,a=i-o,l=(i+o)/2;return a?(t===i?s=(n-r)/a+(n<r)*6:n===i?s=(r-t)/a+2:s=(t-n)/a+4,a/=l<.5?i+o:2-i-o,s*=60):a=l>0&&l<1?0:s,new zt(s,a,l,e.opacity)}function p2(e,t,n,r){return arguments.length===1?Fy(e):new zt(e,t,n,r??1)}function zt(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Dd(zt,p2,Vy(Xi,{brighter(e){return e=e==null?ja:Math.pow(ja,e),new zt(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Ti:Math.pow(Ti,e),new zt(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,o=2*n-r;return new rt(au(e>=240?e-240:e+120,o,r),au(e,o,r),au(e<120?e+240:e-120,o,r),this.opacity)},clamp(){return new zt(Sp(this.h),Ss(this.s),Ss(this.l),Ma(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 e=Ma(this.opacity);return`${e===1?"hsl(":"hsla("}${Sp(this.h)}, ${Ss(this.s)*100}%, ${Ss(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Sp(e){return e=(e||0)%360,e<0?e+360:e}function Ss(e){return Math.max(0,Math.min(1,e||0))}function au(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const Ld=e=>()=>e;function m2(e,t){return function(n){return e+n*t}}function g2(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function y2(e){return(e=+e)==1?Hy:function(t,n){return n-t?g2(t,n,e):Ld(isNaN(t)?n:t)}}function Hy(e,t){var n=t-e;return n?m2(e,n):Ld(isNaN(e)?t:e)}const Ta=function e(t){var n=y2(t);function r(o,i){var s=n((o=vc(o)).r,(i=vc(i)).r),a=n(o.g,i.g),l=n(o.b,i.b),u=Hy(o.opacity,i.opacity);return function(d){return o.r=s(d),o.g=a(d),o.b=l(d),o.opacity=u(d),o+""}}return r.gamma=e,r}(1);function v2(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),o;return function(i){for(o=0;o<n;++o)r[o]=e[o]*(1-i)+t[o]*i;return r}}function w2(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function _2(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,o=new Array(r),i=new Array(n),s;for(s=0;s<r;++s)o[s]=li(e[s],t[s]);for(;s<n;++s)i[s]=t[s];return function(a){for(s=0;s<r;++s)i[s]=o[s](a);return i}}function $2(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function qt(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function x2(e,t){var n={},r={},o;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(o in t)o in e?n[o]=li(e[o],t[o]):r[o]=t[o];return function(i){for(o in n)r[o]=n[o](i);return r}}var wc=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,lu=new RegExp(wc.source,"g");function S2(e){return function(){return e}}function E2(e){return function(t){return e(t)+""}}function By(e,t){var n=wc.lastIndex=lu.lastIndex=0,r,o,i,s=-1,a=[],l=[];for(e=e+"",t=t+"";(r=wc.exec(e))&&(o=lu.exec(t));)(i=o.index)>n&&(i=t.slice(n,i),a[s]?a[s]+=i:a[++s]=i),(r=r[0])===(o=o[0])?a[s]?a[s]+=o:a[++s]=o:(a[++s]=null,l.push({i:s,x:qt(r,o)})),n=lu.lastIndex;return n<t.length&&(i=t.slice(n),a[s]?a[s]+=i:a[++s]=i),a.length<2?l[0]?E2(l[0].x):S2(t):(t=l.length,function(u){for(var d=0,c;d<t;++d)a[(c=l[d]).i]=c.x(u);return a.join("")})}function li(e,t){var n=typeof t,r;return t==null||n==="boolean"?Ld(t):(n==="number"?qt:n==="string"?(r=wr(t))?(t=r,Ta):By:t instanceof wr?Ta:t instanceof Date?$2:w2(t)?v2:Array.isArray(t)?_2:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?x2:qt)(e,t)}var Ep=180/Math.PI,_c={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Uy(e,t,n,r,o,i){var s,a,l;return(s=Math.sqrt(e*e+t*t))&&(e/=s,t/=s),(l=e*n+t*r)&&(n-=e*l,r-=t*l),(a=Math.sqrt(n*n+r*r))&&(n/=a,r/=a,l/=a),e*r<t*n&&(e=-e,t=-t,l=-l,s=-s),{translateX:o,translateY:i,rotate:Math.atan2(t,e)*Ep,skewX:Math.atan(l)*Ep,scaleX:s,scaleY:a}}var Es;function k2(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?_c:Uy(t.a,t.b,t.c,t.d,t.e,t.f)}function N2(e){return e==null||(Es||(Es=document.createElementNS("http://www.w3.org/2000/svg","g")),Es.setAttribute("transform",e),!(e=Es.transform.baseVal.consolidate()))?_c:(e=e.matrix,Uy(e.a,e.b,e.c,e.d,e.e,e.f))}function Wy(e,t,n,r){function o(u){return u.length?u.pop()+" ":""}function i(u,d,c,f,m,y){if(u!==c||d!==f){var v=m.push("translate(",null,t,null,n);y.push({i:v-4,x:qt(u,c)},{i:v-2,x:qt(d,f)})}else(c||f)&&m.push("translate("+c+t+f+n)}function s(u,d,c,f){u!==d?(u-d>180?d+=360:d-u>180&&(u+=360),f.push({i:c.push(o(c)+"rotate(",null,r)-2,x:qt(u,d)})):d&&c.push(o(c)+"rotate("+d+r)}function a(u,d,c,f){u!==d?f.push({i:c.push(o(c)+"skewX(",null,r)-2,x:qt(u,d)}):d&&c.push(o(c)+"skewX("+d+r)}function l(u,d,c,f,m,y){if(u!==c||d!==f){var v=m.push(o(m)+"scale(",null,",",null,")");y.push({i:v-4,x:qt(u,c)},{i:v-2,x:qt(d,f)})}else(c!==1||f!==1)&&m.push(o(m)+"scale("+c+","+f+")")}return function(u,d){var c=[],f=[];return u=e(u),d=e(d),i(u.translateX,u.translateY,d.translateX,d.translateY,c,f),s(u.rotate,d.rotate,c,f),a(u.skewX,d.skewX,c,f),l(u.scaleX,u.scaleY,d.scaleX,d.scaleY,c,f),u=d=null,function(m){for(var y=-1,v=f.length,w;++y<v;)c[(w=f[y]).i]=w.x(m);return c.join("")}}}var P2=Wy(k2,"px, ","px)","deg)"),C2=Wy(N2,", ",")",")"),b2=1e-12;function kp(e){return((e=Math.exp(e))+1/e)/2}function j2(e){return((e=Math.exp(e))-1/e)/2}function M2(e){return((e=Math.exp(2*e))-1)/(e+1)}const Gs=function e(t,n,r){function o(i,s){var a=i[0],l=i[1],u=i[2],d=s[0],c=s[1],f=s[2],m=d-a,y=c-l,v=m*m+y*y,w,h;if(v<b2)h=Math.log(f/u)/t,w=function(P){return[a+P*m,l+P*y,u*Math.exp(t*P*h)]};else{var g=Math.sqrt(v),p=(f*f-u*u+r*v)/(2*u*n*g),_=(f*f-u*u-r*v)/(2*f*n*g),x=Math.log(Math.sqrt(p*p+1)-p),k=Math.log(Math.sqrt(_*_+1)-_);h=(k-x)/t,w=function(P){var b=P*h,F=kp(x),W=u/(n*g)*(F*M2(t*b+x)-j2(x));return[a+W*m,l+W*y,u*F/kp(t*b+x)]}}return w.duration=h*1e3*t/Math.SQRT2,w}return o.rho=function(i){var s=Math.max(.001,+i),a=s*s,l=a*a;return e(s,a,l)},o}(Math.SQRT2,2,4);var ho=0,Yo=0,Vo=0,qy=1e3,Ia,Go,Ra=0,_r=0,dl=0,Ri=typeof performance=="object"&&performance.now?performance:Date,Ky=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Vd(){return _r||(Ky(T2),_r=Ri.now()+dl)}function T2(){_r=0}function za(){this._call=this._time=this._next=null}za.prototype=Xy.prototype={constructor:za,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Vd():+n)+(t==null?0:+t),!this._next&&Go!==this&&(Go?Go._next=this:Ia=this,Go=this),this._call=e,this._time=n,$c()},stop:function(){this._call&&(this._call=null,this._time=1/0,$c())}};function Xy(e,t,n){var r=new za;return r.restart(e,t,n),r}function I2(){Vd(),++ho;for(var e=Ia,t;e;)(t=_r-e._time)>=0&&e._call.call(void 0,t),e=e._next;--ho}function Np(){_r=(Ra=Ri.now())+dl,ho=Yo=0;try{I2()}finally{ho=0,z2(),_r=0}}function R2(){var e=Ri.now(),t=e-Ra;t>qy&&(dl-=t,Ra=e)}function z2(){for(var e,t=Ia,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:Ia=n);Go=e,$c(r)}function $c(e){if(!ho){Yo&&(Yo=clearTimeout(Yo));var t=e-_r;t>24?(e<1/0&&(Yo=setTimeout(Np,e-Ri.now()-dl)),Vo&&(Vo=clearInterval(Vo))):(Vo||(Ra=Ri.now(),Vo=setInterval(R2,qy)),ho=1,Ky(Np))}}function Pp(e,t,n){var r=new za;return t=t==null?0:+t,r.restart(o=>{r.stop(),e(o+t)},t,n),r}var A2=ul("start","end","cancel","interrupt"),O2=[],Yy=0,Cp=1,xc=2,Qs=3,bp=4,Sc=5,Zs=6;function fl(e,t,n,r,o,i){var s=e.__transition;if(!s)e.__transition={};else if(n in s)return;D2(e,n,{name:t,index:r,group:o,on:A2,tween:O2,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:Yy})}function Fd(e,t){var n=Ht(e,t);if(n.state>Yy)throw new Error("too late; already scheduled");return n}function Zt(e,t){var n=Ht(e,t);if(n.state>Qs)throw new Error("too late; already running");return n}function Ht(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function D2(e,t,n){var r=e.__transition,o;r[t]=n,n.timer=Xy(i,0,n.time);function i(u){n.state=Cp,n.timer.restart(s,n.delay,n.time),n.delay<=u&&s(u-n.delay)}function s(u){var d,c,f,m;if(n.state!==Cp)return l();for(d in r)if(m=r[d],m.name===n.name){if(m.state===Qs)return Pp(s);m.state===bp?(m.state=Zs,m.timer.stop(),m.on.call("interrupt",e,e.__data__,m.index,m.group),delete r[d]):+d<t&&(m.state=Zs,m.timer.stop(),m.on.call("cancel",e,e.__data__,m.index,m.group),delete r[d])}if(Pp(function(){n.state===Qs&&(n.state=bp,n.timer.restart(a,n.delay,n.time),a(u))}),n.state=xc,n.on.call("start",e,e.__data__,n.index,n.group),n.state===xc){for(n.state=Qs,o=new Array(f=n.tween.length),d=0,c=-1;d<f;++d)(m=n.tween[d].value.call(e,e.__data__,n.index,n.group))&&(o[++c]=m);o.length=c+1}}function a(u){for(var d=u<n.duration?n.ease.call(null,u/n.duration):(n.timer.restart(l),n.state=Sc,1),c=-1,f=o.length;++c<f;)o[c].call(e,d);n.state===Sc&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){n.state=Zs,n.timer.stop(),delete r[t];for(var u in r)return;delete e.__transition}}function Js(e,t){var n=e.__transition,r,o,i=!0,s;if(n){t=t==null?null:t+"";for(s in n){if((r=n[s]).name!==t){i=!1;continue}o=r.state>xc&&r.state<Sc,r.state=Zs,r.timer.stop(),r.on.call(o?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[s]}i&&delete e.__transition}}function L2(e){return this.each(function(){Js(this,e)})}function V2(e,t){var n,r;return function(){var o=Zt(this,e),i=o.tween;if(i!==n){r=n=i;for(var s=0,a=r.length;s<a;++s)if(r[s].name===t){r=r.slice(),r.splice(s,1);break}}o.tween=r}}function F2(e,t,n){var r,o;if(typeof n!="function")throw new Error;return function(){var i=Zt(this,e),s=i.tween;if(s!==r){o=(r=s).slice();for(var a={name:t,value:n},l=0,u=o.length;l<u;++l)if(o[l].name===t){o[l]=a;break}l===u&&o.push(a)}i.tween=o}}function H2(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=Ht(this.node(),n).tween,o=0,i=r.length,s;o<i;++o)if((s=r[o]).name===e)return s.value;return null}return this.each((t==null?V2:F2)(n,e,t))}function Hd(e,t,n){var r=e._id;return e.each(function(){var o=Zt(this,r);(o.value||(o.value={}))[t]=n.apply(this,arguments)}),function(o){return Ht(o,r).value[t]}}function Gy(e,t){var n;return(typeof t=="number"?qt:t instanceof wr?Ta:(n=wr(t))?(t=n,Ta):By)(e,t)}function B2(e){return function(){this.removeAttribute(e)}}function U2(e){return function(){this.removeAttributeNS(e.space,e.local)}}function W2(e,t,n){var r,o=n+"",i;return function(){var s=this.getAttribute(e);return s===o?null:s===r?i:i=t(r=s,n)}}function q2(e,t,n){var r,o=n+"",i;return function(){var s=this.getAttributeNS(e.space,e.local);return s===o?null:s===r?i:i=t(r=s,n)}}function K2(e,t,n){var r,o,i;return function(){var s,a=n(this),l;return a==null?void this.removeAttribute(e):(s=this.getAttribute(e),l=a+"",s===l?null:s===r&&l===o?i:(o=l,i=t(r=s,a)))}}function X2(e,t,n){var r,o,i;return function(){var s,a=n(this),l;return a==null?void this.removeAttributeNS(e.space,e.local):(s=this.getAttributeNS(e.space,e.local),l=a+"",s===l?null:s===r&&l===o?i:(o=l,i=t(r=s,a)))}}function Y2(e,t){var n=cl(e),r=n==="transform"?C2:Gy;return this.attrTween(e,typeof t=="function"?(n.local?X2:K2)(n,r,Hd(this,"attr."+e,t)):t==null?(n.local?U2:B2)(n):(n.local?q2:W2)(n,r,t))}function G2(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function Q2(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function Z2(e,t){var n,r;function o(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&Q2(e,i)),n}return o._value=t,o}function J2(e,t){var n,r;function o(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&G2(e,i)),n}return o._value=t,o}function ek(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var r=cl(e);return this.tween(n,(r.local?Z2:J2)(r,t))}function tk(e,t){return function(){Fd(this,e).delay=+t.apply(this,arguments)}}function nk(e,t){return t=+t,function(){Fd(this,e).delay=t}}function rk(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?tk:nk)(t,e)):Ht(this.node(),t).delay}function ok(e,t){return function(){Zt(this,e).duration=+t.apply(this,arguments)}}function ik(e,t){return t=+t,function(){Zt(this,e).duration=t}}function sk(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?ok:ik)(t,e)):Ht(this.node(),t).duration}function ak(e,t){if(typeof t!="function")throw new Error;return function(){Zt(this,e).ease=t}}function lk(e){var t=this._id;return arguments.length?this.each(ak(t,e)):Ht(this.node(),t).ease}function uk(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Zt(this,e).ease=n}}function ck(e){if(typeof e!="function")throw new Error;return this.each(uk(this._id,e))}function dk(e){typeof e!="function"&&(e=Py(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var i=t[o],s=i.length,a=r[o]=[],l,u=0;u<s;++u)(l=i[u])&&e.call(l,l.__data__,u,i)&&a.push(l);return new gn(r,this._parents,this._name,this._id)}function fk(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,o=n.length,i=Math.min(r,o),s=new Array(r),a=0;a<i;++a)for(var l=t[a],u=n[a],d=l.length,c=s[a]=new Array(d),f,m=0;m<d;++m)(f=l[m]||u[m])&&(c[m]=f);for(;a<r;++a)s[a]=t[a];return new gn(s,this._parents,this._name,this._id)}function hk(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function pk(e,t,n){var r,o,i=hk(t)?Fd:Zt;return function(){var s=i(this,e),a=s.on;a!==r&&(o=(r=a).copy()).on(t,n),s.on=o}}function mk(e,t){var n=this._id;return arguments.length<2?Ht(this.node(),n).on.on(e):this.each(pk(n,e,t))}function gk(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function yk(){return this.on("end.remove",gk(this._id))}function vk(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Ad(e));for(var r=this._groups,o=r.length,i=new Array(o),s=0;s<o;++s)for(var a=r[s],l=a.length,u=i[s]=new Array(l),d,c,f=0;f<l;++f)(d=a[f])&&(c=e.call(d,d.__data__,f,a))&&("__data__"in d&&(c.__data__=d.__data__),u[f]=c,fl(u[f],t,n,f,u,Ht(d,n)));return new gn(i,this._parents,t,n)}function wk(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Ny(e));for(var r=this._groups,o=r.length,i=[],s=[],a=0;a<o;++a)for(var l=r[a],u=l.length,d,c=0;c<u;++c)if(d=l[c]){for(var f=e.call(d,d.__data__,c,l),m,y=Ht(d,n),v=0,w=f.length;v<w;++v)(m=f[v])&&fl(m,t,n,v,f,y);i.push(f),s.push(d)}return new gn(i,s,t,n)}var _k=Ki.prototype.constructor;function $k(){return new _k(this._groups,this._parents)}function xk(e,t){var n,r,o;return function(){var i=fo(this,e),s=(this.style.removeProperty(e),fo(this,e));return i===s?null:i===n&&s===r?o:o=t(n=i,r=s)}}function Qy(e){return function(){this.style.removeProperty(e)}}function Sk(e,t,n){var r,o=n+"",i;return function(){var s=fo(this,e);return s===o?null:s===r?i:i=t(r=s,n)}}function Ek(e,t,n){var r,o,i;return function(){var s=fo(this,e),a=n(this),l=a+"";return a==null&&(l=a=(this.style.removeProperty(e),fo(this,e))),s===l?null:s===r&&l===o?i:(o=l,i=t(r=s,a))}}function kk(e,t){var n,r,o,i="style."+t,s="end."+i,a;return function(){var l=Zt(this,e),u=l.on,d=l.value[i]==null?a||(a=Qy(t)):void 0;(u!==n||o!==d)&&(r=(n=u).copy()).on(s,o=d),l.on=r}}function Nk(e,t,n){var r=(e+="")=="transform"?P2:Gy;return t==null?this.styleTween(e,xk(e,r)).on("end.style."+e,Qy(e)):typeof t=="function"?this.styleTween(e,Ek(e,r,Hd(this,"style."+e,t))).each(kk(this._id,e)):this.styleTween(e,Sk(e,r,t),n).on("end.style."+e,null)}function Pk(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function Ck(e,t,n){var r,o;function i(){var s=t.apply(this,arguments);return s!==o&&(r=(o=s)&&Pk(e,s,n)),r}return i._value=t,i}function bk(e,t,n){var r="style."+(e+="");if(arguments.length<2)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,Ck(e,t,n??""))}function jk(e){return function(){this.textContent=e}}function Mk(e){return function(){var t=e(this);this.textContent=t??""}}function Tk(e){return this.tween("text",typeof e=="function"?Mk(Hd(this,"text",e)):jk(e==null?"":e+""))}function Ik(e){return function(t){this.textContent=e.call(this,t)}}function Rk(e){var t,n;function r(){var o=e.apply(this,arguments);return o!==n&&(t=(n=o)&&Ik(o)),t}return r._value=e,r}function zk(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,Rk(e))}function Ak(){for(var e=this._name,t=this._id,n=Zy(),r=this._groups,o=r.length,i=0;i<o;++i)for(var s=r[i],a=s.length,l,u=0;u<a;++u)if(l=s[u]){var d=Ht(l,t);fl(l,e,n,u,s,{time:d.time+d.delay+d.duration,delay:0,duration:d.duration,ease:d.ease})}return new gn(r,this._parents,e,n)}function Ok(){var e,t,n=this,r=n._id,o=n.size();return new Promise(function(i,s){var a={value:s},l={value:function(){--o===0&&i()}};n.each(function(){var u=Zt(this,r),d=u.on;d!==e&&(t=(e=d).copy(),t._.cancel.push(a),t._.interrupt.push(a),t._.end.push(l)),u.on=t}),o===0&&i()})}var Dk=0;function gn(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function Zy(){return++Dk}var en=Ki.prototype;gn.prototype={constructor:gn,select:vk,selectAll:wk,selectChild:en.selectChild,selectChildren:en.selectChildren,filter:dk,merge:fk,selection:$k,transition:Ak,call:en.call,nodes:en.nodes,node:en.node,size:en.size,empty:en.empty,each:en.each,on:mk,attr:Y2,attrTween:ek,style:Nk,styleTween:bk,text:Tk,textTween:zk,remove:yk,tween:H2,delay:rk,duration:sk,ease:lk,easeVarying:ck,end:Ok,[Symbol.iterator]:en[Symbol.iterator]};function Lk(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var Vk={time:null,delay:0,duration:250,ease:Lk};function Fk(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function Hk(e){var t,n;e instanceof gn?(t=e._id,e=e._name):(t=Zy(),(n=Vk).time=Vd(),e=e==null?null:e+"");for(var r=this._groups,o=r.length,i=0;i<o;++i)for(var s=r[i],a=s.length,l,u=0;u<a;++u)(l=s[u])&&fl(l,e,t,u,s,n||Fk(l,t));return new gn(r,this._parents,e,t)}Ki.prototype.interrupt=L2;Ki.prototype.transition=Hk;const ks=e=>()=>e;function Bk(e,{sourceEvent:t,target:n,transform:r,dispatch:o}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:o}})}function un(e,t,n){this.k=e,this.x=t,this.y=n}un.prototype={constructor:un,scale:function(e){return e===1?this:new un(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new un(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var hl=new un(1,0,0);Jy.prototype=un.prototype;function Jy(e){for(;!e.__zoom;)if(!(e=e.parentNode))return hl;return e.__zoom}function uu(e){e.stopImmediatePropagation()}function Fo(e){e.preventDefault(),e.stopImmediatePropagation()}function Uk(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function Wk(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function jp(){return this.__zoom||hl}function qk(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function Kk(){return navigator.maxTouchPoints||"ontouchstart"in this}function Xk(e,t,n){var r=e.invertX(t[0][0])-n[0][0],o=e.invertX(t[1][0])-n[1][0],i=e.invertY(t[0][1])-n[0][1],s=e.invertY(t[1][1])-n[1][1];return e.translate(o>r?(r+o)/2:Math.min(0,r)||Math.max(0,o),s>i?(i+s)/2:Math.min(0,i)||Math.max(0,s))}function ev(){var e=Uk,t=Wk,n=Xk,r=qk,o=Kk,i=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],a=250,l=Gs,u=ul("start","zoom","end"),d,c,f,m=500,y=150,v=0,w=10;function h(E){E.property("__zoom",jp).on("wheel.zoom",b,{passive:!1}).on("mousedown.zoom",F).on("dblclick.zoom",W).filter(o).on("touchstart.zoom",I).on("touchmove.zoom",H).on("touchend.zoom touchcancel.zoom",q).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}h.transform=function(E,O,M,V){var j=E.selection?E.selection():E;j.property("__zoom",jp),E!==j?x(E,O,M,V):j.interrupt().each(function(){k(this,arguments).event(V).start().zoom(null,typeof O=="function"?O.apply(this,arguments):O).end()})},h.scaleBy=function(E,O,M,V){h.scaleTo(E,function(){var j=this.__zoom.k,z=typeof O=="function"?O.apply(this,arguments):O;return j*z},M,V)},h.scaleTo=function(E,O,M,V){h.transform(E,function(){var j=t.apply(this,arguments),z=this.__zoom,T=M==null?_(j):typeof M=="function"?M.apply(this,arguments):M,N=z.invert(T),R=typeof O=="function"?O.apply(this,arguments):O;return n(p(g(z,R),T,N),j,s)},M,V)},h.translateBy=function(E,O,M,V){h.transform(E,function(){return n(this.__zoom.translate(typeof O=="function"?O.apply(this,arguments):O,typeof M=="function"?M.apply(this,arguments):M),t.apply(this,arguments),s)},null,V)},h.translateTo=function(E,O,M,V,j){h.transform(E,function(){var z=t.apply(this,arguments),T=this.__zoom,N=V==null?_(z):typeof V=="function"?V.apply(this,arguments):V;return n(hl.translate(N[0],N[1]).scale(T.k).translate(typeof O=="function"?-O.apply(this,arguments):-O,typeof M=="function"?-M.apply(this,arguments):-M),z,s)},V,j)};function g(E,O){return O=Math.max(i[0],Math.min(i[1],O)),O===E.k?E:new un(O,E.x,E.y)}function p(E,O,M){var V=O[0]-M[0]*E.k,j=O[1]-M[1]*E.k;return V===E.x&&j===E.y?E:new un(E.k,V,j)}function _(E){return[(+E[0][0]+ +E[1][0])/2,(+E[0][1]+ +E[1][1])/2]}function x(E,O,M,V){E.on("start.zoom",function(){k(this,arguments).event(V).start()}).on("interrupt.zoom end.zoom",function(){k(this,arguments).event(V).end()}).tween("zoom",function(){var j=this,z=arguments,T=k(j,z).event(V),N=t.apply(j,z),R=M==null?_(N):typeof M=="function"?M.apply(j,z):M,D=Math.max(N[1][0]-N[0][0],N[1][1]-N[0][1]),S=j.__zoom,C=typeof O=="function"?O.apply(j,z):O,U=l(S.invert(R).concat(D/S.k),C.invert(R).concat(D/C.k));return function(Y){if(Y===1)Y=C;else{var X=U(Y),Z=D/X[2];Y=new un(Z,R[0]-X[0]*Z,R[1]-X[1]*Z)}T.zoom(null,Y)}})}function k(E,O,M){return!M&&E.__zooming||new P(E,O)}function P(E,O){this.that=E,this.args=O,this.active=0,this.sourceEvent=null,this.extent=t.apply(E,O),this.taps=0}P.prototype={event:function(E){return E&&(this.sourceEvent=E),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(E,O){return this.mouse&&E!=="mouse"&&(this.mouse[1]=O.invert(this.mouse[0])),this.touch0&&E!=="touch"&&(this.touch0[1]=O.invert(this.touch0[0])),this.touch1&&E!=="touch"&&(this.touch1[1]=O.invert(this.touch1[0])),this.that.__zoom=O,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(E){var O=lt(this.that).datum();u.call(E,this.that,new Bk(E,{sourceEvent:this.sourceEvent,target:h,transform:this.that.__zoom,dispatch:u}),O)}};function b(E,...O){if(!e.apply(this,arguments))return;var M=k(this,O).event(E),V=this.__zoom,j=Math.max(i[0],Math.min(i[1],V.k*Math.pow(2,r.apply(this,arguments)))),z=It(E);if(M.wheel)(M.mouse[0][0]!==z[0]||M.mouse[0][1]!==z[1])&&(M.mouse[1]=V.invert(M.mouse[0]=z)),clearTimeout(M.wheel);else{if(V.k===j)return;M.mouse=[z,V.invert(z)],Js(this),M.start()}Fo(E),M.wheel=setTimeout(T,y),M.zoom("mouse",n(p(g(V,j),M.mouse[0],M.mouse[1]),M.extent,s));function T(){M.wheel=null,M.end()}}function F(E,...O){if(f||!e.apply(this,arguments))return;var M=E.currentTarget,V=k(this,O,!0).event(E),j=lt(E.view).on("mousemove.zoom",R,!0).on("mouseup.zoom",D,!0),z=It(E,M),T=E.clientX,N=E.clientY;Oy(E.view),uu(E),V.mouse=[z,this.__zoom.invert(z)],Js(this),V.start();function R(S){if(Fo(S),!V.moved){var C=S.clientX-T,U=S.clientY-N;V.moved=C*C+U*U>v}V.event(S).zoom("mouse",n(p(V.that.__zoom,V.mouse[0]=It(S,M),V.mouse[1]),V.extent,s))}function D(S){j.on("mousemove.zoom mouseup.zoom",null),Dy(S.view,V.moved),Fo(S),V.event(S).end()}}function W(E,...O){if(e.apply(this,arguments)){var M=this.__zoom,V=It(E.changedTouches?E.changedTouches[0]:E,this),j=M.invert(V),z=M.k*(E.shiftKey?.5:2),T=n(p(g(M,z),V,j),t.apply(this,O),s);Fo(E),a>0?lt(this).transition().duration(a).call(x,T,V,E):lt(this).call(h.transform,T,V,E)}}function I(E,...O){if(e.apply(this,arguments)){var M=E.touches,V=M.length,j=k(this,O,E.changedTouches.length===V).event(E),z,T,N,R;for(uu(E),T=0;T<V;++T)N=M[T],R=It(N,this),R=[R,this.__zoom.invert(R),N.identifier],j.touch0?!j.touch1&&j.touch0[2]!==R[2]&&(j.touch1=R,j.taps=0):(j.touch0=R,z=!0,j.taps=1+!!d);d&&(d=clearTimeout(d)),z&&(j.taps<2&&(c=R[0],d=setTimeout(function(){d=null},m)),Js(this),j.start())}}function H(E,...O){if(this.__zooming){var M=k(this,O).event(E),V=E.changedTouches,j=V.length,z,T,N,R;for(Fo(E),z=0;z<j;++z)T=V[z],N=It(T,this),M.touch0&&M.touch0[2]===T.identifier?M.touch0[0]=N:M.touch1&&M.touch1[2]===T.identifier&&(M.touch1[0]=N);if(T=M.that.__zoom,M.touch1){var D=M.touch0[0],S=M.touch0[1],C=M.touch1[0],U=M.touch1[1],Y=(Y=C[0]-D[0])*Y+(Y=C[1]-D[1])*Y,X=(X=U[0]-S[0])*X+(X=U[1]-S[1])*X;T=g(T,Math.sqrt(Y/X)),N=[(D[0]+C[0])/2,(D[1]+C[1])/2],R=[(S[0]+U[0])/2,(S[1]+U[1])/2]}else if(M.touch0)N=M.touch0[0],R=M.touch0[1];else return;M.zoom("touch",n(p(T,N,R),M.extent,s))}}function q(E,...O){if(this.__zooming){var M=k(this,O).event(E),V=E.changedTouches,j=V.length,z,T;for(uu(E),f&&clearTimeout(f),f=setTimeout(function(){f=null},m),z=0;z<j;++z)T=V[z],M.touch0&&M.touch0[2]===T.identifier?delete M.touch0:M.touch1&&M.touch1[2]===T.identifier&&delete M.touch1;if(M.touch1&&!M.touch0&&(M.touch0=M.touch1,delete M.touch1),M.touch0)M.touch0[1]=this.__zoom.invert(M.touch0[0]);else if(M.end(),M.taps===2&&(T=It(T,this),Math.hypot(c[0]-T[0],c[1]-T[1])<w)){var N=lt(this).on("dblclick.zoom");N&&N.apply(this,arguments)}}}return h.wheelDelta=function(E){return arguments.length?(r=typeof E=="function"?E:ks(+E),h):r},h.filter=function(E){return arguments.length?(e=typeof E=="function"?E:ks(!!E),h):e},h.touchable=function(E){return arguments.length?(o=typeof E=="function"?E:ks(!!E),h):o},h.extent=function(E){return arguments.length?(t=typeof E=="function"?E:ks([[+E[0][0],+E[0][1]],[+E[1][0],+E[1][1]]]),h):t},h.scaleExtent=function(E){return arguments.length?(i[0]=+E[0],i[1]=+E[1],h):[i[0],i[1]]},h.translateExtent=function(E){return arguments.length?(s[0][0]=+E[0][0],s[1][0]=+E[1][0],s[0][1]=+E[0][1],s[1][1]=+E[1][1],h):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},h.constrain=function(E){return arguments.length?(n=E,h):n},h.duration=function(E){return arguments.length?(a=+E,h):a},h.interpolate=function(E){return arguments.length?(l=E,h):l},h.on=function(){var E=u.on.apply(u,arguments);return E===u?h:E},h.clickDistance=function(E){return arguments.length?(v=(E=+E)*E,h):Math.sqrt(v)},h.tapDistance=function(E){return arguments.length?(w=+E,h):w},h}const Qt={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:e=>`Node type "${e}" 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:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:r}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/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."},zi=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],tv=["Enter"," ","Escape"],nv={"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:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"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 po;(function(e){e.Strict="strict",e.Loose="loose"})(po||(po={}));var hr;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(hr||(hr={}));var Ai;(function(e){e.Partial="partial",e.Full="full"})(Ai||(Ai={}));const rv={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var jn;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(jn||(jn={}));var Aa;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Aa||(Aa={}));var oe;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(oe||(oe={}));const Mp={[oe.Left]:oe.Right,[oe.Right]:oe.Left,[oe.Top]:oe.Bottom,[oe.Bottom]:oe.Top};function ov(e){return e===null?null:e?"valid":"invalid"}const iv=e=>"id"in e&&"source"in e&&"target"in e,Yk=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),Bd=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),Yi=(e,t=[0,0])=>{const{width:n,height:r}=wn(e),o=e.origin??t,i=n*o[0],s=r*o[1];return{x:e.position.x-i,y:e.position.y-s}},Gk=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((r,o)=>{const i=typeof o=="string";let s=!t.nodeLookup&&!i?o:void 0;t.nodeLookup&&(s=i?t.nodeLookup.get(o):Bd(o)?o:t.nodeLookup.get(o.id));const a=s?Oa(s,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return pl(r,a)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return ml(n)},Gi=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(o=>{(t.filter===void 0||t.filter(o))&&(n=pl(n,Oa(o)),r=!0)}),r?ml(n):{x:0,y:0,width:0,height:0}},Ud=(e,t,[n,r,o]=[0,0,1],i=!1,s=!1)=>{const a={...Zi(t,[n,r,o]),width:t.width/o,height:t.height/o},l=[];for(const u of e.values()){const{measured:d,selectable:c=!0,hidden:f=!1}=u;if(s&&!c||f)continue;const m=d.width??u.width??u.initialWidth??null,y=d.height??u.height??u.initialHeight??null,v=Oi(a,go(u)),w=(m??0)*(y??0),h=i&&v>0;(!u.internals.handleBounds||h||v>=w||u.dragging)&&l.push(u)}return l},Qk=(e,t)=>{const n=new Set;return e.forEach(r=>{n.add(r.id)}),t.filter(r=>n.has(r.source)||n.has(r.target))};function Zk(e,t){const n=new Map,r=t!=null&&t.nodes?new Set(t.nodes.map(o=>o.id)):null;return e.forEach(o=>{o.measured.width&&o.measured.height&&((t==null?void 0:t.includeHiddenNodes)||!o.hidden)&&(!r||r.has(o.id))&&n.set(o.id,o)}),n}async function Jk({nodes:e,width:t,height:n,panZoom:r,minZoom:o,maxZoom:i},s){if(e.size===0)return Promise.resolve(!0);const a=Zk(e,s),l=Gi(a),u=Wd(l,t,n,(s==null?void 0:s.minZoom)??o,(s==null?void 0:s.maxZoom)??i,(s==null?void 0:s.padding)??.1);return await r.setViewport(u,{duration:s==null?void 0:s.duration,ease:s==null?void 0:s.ease,interpolate:s==null?void 0:s.interpolate}),Promise.resolve(!0)}function sv({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:o,onError:i}){const s=n.get(e),a=s.parentId?n.get(s.parentId):void 0,{x:l,y:u}=a?a.internals.positionAbsolute:{x:0,y:0},d=s.origin??r;let c=s.extent||o;if(s.extent==="parent"&&!s.expandParent)if(!a)i==null||i("005",Qt.error005());else{const m=a.measured.width,y=a.measured.height;m&&y&&(c=[[l,u],[l+m,u+y]])}else a&&yo(s.extent)&&(c=[[s.extent[0][0]+l,s.extent[0][1]+u],[s.extent[1][0]+l,s.extent[1][1]+u]]);const f=yo(c)?$r(t,c,s.measured):t;return(s.measured.width===void 0||s.measured.height===void 0)&&(i==null||i("015",Qt.error015())),{position:{x:f.x-l+(s.measured.width??0)*d[0],y:f.y-u+(s.measured.height??0)*d[1]},positionAbsolute:f}}async function eN({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:o}){const i=new Set(e.map(f=>f.id)),s=[];for(const f of n){if(f.deletable===!1)continue;const m=i.has(f.id),y=!m&&f.parentId&&s.find(v=>v.id===f.parentId);(m||y)&&s.push(f)}const a=new Set(t.map(f=>f.id)),l=r.filter(f=>f.deletable!==!1),d=Qk(s,l);for(const f of l)a.has(f.id)&&!d.find(y=>y.id===f.id)&&d.push(f);if(!o)return{edges:d,nodes:s};const c=await o({nodes:s,edges:d});return typeof c=="boolean"?c?{edges:d,nodes:s}:{edges:[],nodes:[]}:c}const mo=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),$r=(e={x:0,y:0},t,n)=>({x:mo(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:mo(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function av(e,t,n){const{width:r,height:o}=wn(n),{x:i,y:s}=n.internals.positionAbsolute;return $r(e,[[i,s],[i+r,s+o]],t)}const Tp=(e,t,n)=>e<t?mo(Math.abs(e-t),1,t)/t:e>n?-mo(Math.abs(e-n),1,t)/t:0,lv=(e,t,n=15,r=40)=>{const o=Tp(e.x,r,t.width-r)*n,i=Tp(e.y,r,t.height-r)*n;return[o,i]},pl=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),Ec=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),ml=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),go=(e,t=[0,0])=>{var o,i;const{x:n,y:r}=Bd(e)?e.internals.positionAbsolute:Yi(e,t);return{x:n,y:r,width:((o=e.measured)==null?void 0:o.width)??e.width??e.initialWidth??0,height:((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight??0}},Oa=(e,t=[0,0])=>{var o,i;const{x:n,y:r}=Bd(e)?e.internals.positionAbsolute:Yi(e,t);return{x:n,y:r,x2:n+(((o=e.measured)==null?void 0:o.width)??e.width??e.initialWidth??0),y2:r+(((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight??0)}},uv=(e,t)=>ml(pl(Ec(e),Ec(t))),Oi=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),r=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*r)},Ip=e=>Ot(e.width)&&Ot(e.height)&&Ot(e.x)&&Ot(e.y),Ot=e=>!isNaN(e)&&isFinite(e),tN=(e,t)=>{},Qi=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),Zi=({x:e,y:t},[n,r,o],i=!1,s=[1,1])=>{const a={x:(e-n)/o,y:(t-r)/o};return i?Qi(a,s):a},Da=({x:e,y:t},[n,r,o])=>({x:e*o+n,y:t*o+r});function jr(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`[React Flow] The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function nN(e,t,n){if(typeof e=="string"||typeof e=="number"){const r=jr(e,n),o=jr(e,t);return{top:r,right:o,bottom:r,left:o,x:o*2,y:r*2}}if(typeof e=="object"){const r=jr(e.top??e.y??0,n),o=jr(e.bottom??e.y??0,n),i=jr(e.left??e.x??0,t),s=jr(e.right??e.x??0,t);return{top:r,right:s,bottom:o,left:i,x:i+s,y:r+o}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function rN(e,t,n,r,o,i){const{x:s,y:a}=Da(e,[t,n,r]),{x:l,y:u}=Da({x:e.x+e.width,y:e.y+e.height},[t,n,r]),d=o-l,c=i-u;return{left:Math.floor(s),top:Math.floor(a),right:Math.floor(d),bottom:Math.floor(c)}}const Wd=(e,t,n,r,o,i)=>{const s=nN(i,t,n),a=(t-s.x)/e.width,l=(n-s.y)/e.height,u=Math.min(a,l),d=mo(u,r,o),c=e.x+e.width/2,f=e.y+e.height/2,m=t/2-c*d,y=n/2-f*d,v=rN(e,m,y,d,t,n),w={left:Math.min(v.left-s.left,0),top:Math.min(v.top-s.top,0),right:Math.min(v.right-s.right,0),bottom:Math.min(v.bottom-s.bottom,0)};return{x:m-w.left+w.right,y:y-w.top+w.bottom,zoom:d}},Di=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function yo(e){return e!=null&&e!=="parent"}function wn(e){var t,n;return{width:((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth??0,height:((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight??0}}function cv(e){var t,n;return(((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth)!==void 0&&(((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight)!==void 0}function dv(e,t={width:0,height:0},n,r,o){const i={...e},s=r.get(n);if(s){const a=s.origin||o;i.x+=s.internals.positionAbsolute.x-(t.width??0)*a[0],i.y+=s.internals.positionAbsolute.y-(t.height??0)*a[1]}return i}function Rp(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function oN(){let e,t;return{promise:new Promise((r,o)=>{e=r,t=o}),resolve:e,reject:t}}function iN(e){return{...nv,...e||{}}}function ui(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:o}){const{x:i,y:s}=Dt(e),a=Zi({x:i-((o==null?void 0:o.left)??0),y:s-((o==null?void 0:o.top)??0)},r),{x:l,y:u}=n?Qi(a,t):a;return{xSnapped:l,ySnapped:u,...a}}const qd=e=>({width:e.offsetWidth,height:e.offsetHeight}),fv=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},sN=["INPUT","SELECT","TEXTAREA"];function hv(e){var r,o;const t=((o=(r=e.composedPath)==null?void 0:r.call(e))==null?void 0:o[0])||e.target;return(t==null?void 0:t.nodeType)!==1?!1:sN.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const pv=e=>"clientX"in e,Dt=(e,t)=>{var i,s;const n=pv(e),r=n?e.clientX:(i=e.touches)==null?void 0:i[0].clientX,o=n?e.clientY:(s=e.touches)==null?void 0:s[0].clientY;return{x:r-((t==null?void 0:t.left)??0),y:o-((t==null?void 0:t.top)??0)}},zp=(e,t,n,r,o)=>{const i=t.querySelectorAll(`.${e}`);return!i||!i.length?null:Array.from(i).map(s=>{const a=s.getBoundingClientRect();return{id:s.getAttribute("data-handleid"),type:e,nodeId:o,position:s.getAttribute("data-handlepos"),x:(a.left-n.left)/r,y:(a.top-n.top)/r,...qd(s)}})};function mv({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:o,sourceControlY:i,targetControlX:s,targetControlY:a}){const l=e*.125+o*.375+s*.375+n*.125,u=t*.125+i*.375+a*.375+r*.125,d=Math.abs(l-e),c=Math.abs(u-t);return[l,u,d,c]}function Ns(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function Ap({pos:e,x1:t,y1:n,x2:r,y2:o,c:i}){switch(e){case oe.Left:return[t-Ns(t-r,i),n];case oe.Right:return[t+Ns(r-t,i),n];case oe.Top:return[t,n-Ns(n-o,i)];case oe.Bottom:return[t,n+Ns(o-n,i)]}}function gv({sourceX:e,sourceY:t,sourcePosition:n=oe.Bottom,targetX:r,targetY:o,targetPosition:i=oe.Top,curvature:s=.25}){const[a,l]=Ap({pos:n,x1:e,y1:t,x2:r,y2:o,c:s}),[u,d]=Ap({pos:i,x1:r,y1:o,x2:e,y2:t,c:s}),[c,f,m,y]=mv({sourceX:e,sourceY:t,targetX:r,targetY:o,sourceControlX:a,sourceControlY:l,targetControlX:u,targetControlY:d});return[`M${e},${t} C${a},${l} ${u},${d} ${r},${o}`,c,f,m,y]}function yv({sourceX:e,sourceY:t,targetX:n,targetY:r}){const o=Math.abs(n-e)/2,i=n<e?n+o:n-o,s=Math.abs(r-t)/2,a=r<t?r+s:r-s;return[i,a,o,s]}function aN({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r=0,elevateOnSelect:o=!1,zIndexMode:i="basic"}){if(i==="manual")return r;const s=o&&n?r+1e3:r,a=Math.max(e.parentId||o&&e.selected?e.internals.z:0,t.parentId||o&&t.selected?t.internals.z:0);return s+a}function lN({sourceNode:e,targetNode:t,width:n,height:r,transform:o}){const i=pl(Oa(e),Oa(t));i.x===i.x2&&(i.x2+=1),i.y===i.y2&&(i.y2+=1);const s={x:-o[0]/o[2],y:-o[1]/o[2],width:n/o[2],height:r/o[2]};return Oi(s,ml(i))>0}const uN=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,cN=(e,t)=>t.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),dN=(e,t,n={})=>{if(!e.source||!e.target)return t;const r=n.getEdgeId||uN;let o;return iv(e)?o={...e}:o={...e,id:r(e)},cN(o,t)?t:(o.sourceHandle===null&&delete o.sourceHandle,o.targetHandle===null&&delete o.targetHandle,t.concat(o))};function vv({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[o,i,s,a]=yv({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,o,i,s,a]}const Op={[oe.Left]:{x:-1,y:0},[oe.Right]:{x:1,y:0},[oe.Top]:{x:0,y:-1},[oe.Bottom]:{x:0,y:1}},fN=({source:e,sourcePosition:t=oe.Bottom,target:n})=>t===oe.Left||t===oe.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},Dp=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function hN({source:e,sourcePosition:t=oe.Bottom,target:n,targetPosition:r=oe.Top,center:o,offset:i,stepPosition:s}){const a=Op[t],l=Op[r],u={x:e.x+a.x*i,y:e.y+a.y*i},d={x:n.x+l.x*i,y:n.y+l.y*i},c=fN({source:u,sourcePosition:t,target:d}),f=c.x!==0?"x":"y",m=c[f];let y=[],v,w;const h={x:0,y:0},g={x:0,y:0},[,,p,_]=yv({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(a[f]*l[f]===-1){f==="x"?(v=o.x??u.x+(d.x-u.x)*s,w=o.y??(u.y+d.y)/2):(v=o.x??(u.x+d.x)/2,w=o.y??u.y+(d.y-u.y)*s);const b=[{x:v,y:u.y},{x:v,y:d.y}],F=[{x:u.x,y:w},{x:d.x,y:w}];a[f]===m?y=f==="x"?b:F:y=f==="x"?F:b}else{const b=[{x:u.x,y:d.y}],F=[{x:d.x,y:u.y}];if(f==="x"?y=a.x===m?F:b:y=a.y===m?b:F,t===r){const E=Math.abs(e[f]-n[f]);if(E<=i){const O=Math.min(i-1,i-E);a[f]===m?h[f]=(u[f]>e[f]?-1:1)*O:g[f]=(d[f]>n[f]?-1:1)*O}}if(t!==r){const E=f==="x"?"y":"x",O=a[f]===l[E],M=u[E]>d[E],V=u[E]<d[E];(a[f]===1&&(!O&&M||O&&V)||a[f]!==1&&(!O&&V||O&&M))&&(y=f==="x"?b:F)}const W={x:u.x+h.x,y:u.y+h.y},I={x:d.x+g.x,y:d.y+g.y},H=Math.max(Math.abs(W.x-y[0].x),Math.abs(I.x-y[0].x)),q=Math.max(Math.abs(W.y-y[0].y),Math.abs(I.y-y[0].y));H>=q?(v=(W.x+I.x)/2,w=y[0].y):(v=y[0].x,w=(W.y+I.y)/2)}const x={x:u.x+h.x,y:u.y+h.y},k={x:d.x+g.x,y:d.y+g.y};return[[e,...x.x!==y[0].x||x.y!==y[0].y?[x]:[],...y,...k.x!==y[y.length-1].x||k.y!==y[y.length-1].y?[k]:[],n],v,w,p,_]}function pN(e,t,n,r){const o=Math.min(Dp(e,t)/2,Dp(t,n)/2,r),{x:i,y:s}=t;if(e.x===i&&i===n.x||e.y===s&&s===n.y)return`L${i} ${s}`;if(e.y===s){const u=e.x<n.x?-1:1,d=e.y<n.y?1:-1;return`L ${i+o*u},${s}Q ${i},${s} ${i},${s+o*d}`}const a=e.x<n.x?1:-1,l=e.y<n.y?-1:1;return`L ${i},${s+o*l}Q ${i},${s} ${i+o*a},${s}`}function kc({sourceX:e,sourceY:t,sourcePosition:n=oe.Bottom,targetX:r,targetY:o,targetPosition:i=oe.Top,borderRadius:s=5,centerX:a,centerY:l,offset:u=20,stepPosition:d=.5}){const[c,f,m,y,v]=hN({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:o},targetPosition:i,center:{x:a,y:l},offset:u,stepPosition:d});let w=`M${c[0].x} ${c[0].y}`;for(let h=1;h<c.length-1;h++)w+=pN(c[h-1],c[h],c[h+1],s);return w+=`L${c[c.length-1].x} ${c[c.length-1].y}`,[w,f,m,y,v]}function Lp(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function mN(e){var c;const{sourceNode:t,targetNode:n}=e;if(!Lp(t)||!Lp(n))return null;const r=t.internals.handleBounds||Vp(t.handles),o=n.internals.handleBounds||Vp(n.handles),i=Fp((r==null?void 0:r.source)??[],e.sourceHandle),s=Fp(e.connectionMode===po.Strict?(o==null?void 0:o.target)??[]:((o==null?void 0:o.target)??[]).concat((o==null?void 0:o.source)??[]),e.targetHandle);if(!i||!s)return(c=e.onError)==null||c.call(e,"008",Qt.error008(i?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const a=(i==null?void 0:i.position)||oe.Bottom,l=(s==null?void 0:s.position)||oe.Top,u=xr(t,i,a),d=xr(n,s,l);return{sourceX:u.x,sourceY:u.y,targetX:d.x,targetY:d.y,sourcePosition:a,targetPosition:l}}function Vp(e){if(!e)return null;const t=[],n=[];for(const r of e)r.width=r.width??1,r.height=r.height??1,r.type==="source"?t.push(r):r.type==="target"&&n.push(r);return{source:t,target:n}}function xr(e,t,n=oe.Left,r=!1){const o=((t==null?void 0:t.x)??0)+e.internals.positionAbsolute.x,i=((t==null?void 0:t.y)??0)+e.internals.positionAbsolute.y,{width:s,height:a}=t??wn(e);if(r)return{x:o+s/2,y:i+a/2};switch((t==null?void 0:t.position)??n){case oe.Top:return{x:o+s/2,y:i};case oe.Right:return{x:o+s,y:i+a/2};case oe.Bottom:return{x:o+s/2,y:i+a};case oe.Left:return{x:o,y:i+a/2}}}function Fp(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function Nc(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function gN(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:o}){const i=new Set;return e.reduce((s,a)=>([a.markerStart||r,a.markerEnd||o].forEach(l=>{if(l&&typeof l=="object"){const u=Nc(l,t);i.has(u)||(s.push({id:u,color:l.color||n,...l}),i.add(u))}}),s),[]).sort((s,a)=>s.id.localeCompare(a.id))}const wv=1e3,yN=10,Kd={nodeOrigin:[0,0],nodeExtent:zi,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},vN={...Kd,checkEquality:!0};function Xd(e,t){const n={...e};for(const r in t)t[r]!==void 0&&(n[r]=t[r]);return n}function wN(e,t,n){const r=Xd(Kd,n);for(const o of e.values())if(o.parentId)Gd(o,e,t,r);else{const i=Yi(o,r.nodeOrigin),s=yo(o.extent)?o.extent:r.nodeExtent,a=$r(i,s,wn(o));o.internals.positionAbsolute=a}}function _N(e,t){if(!e.handles)return e.measured?t==null?void 0:t.internals.handleBounds:void 0;const n=[],r=[];for(const o of e.handles){const i={id:o.id,width:o.width??1,height:o.height??1,nodeId:e.id,x:o.x,y:o.y,position:o.position,type:o.type};o.type==="source"?n.push(i):o.type==="target"&&r.push(i)}return{source:n,target:r}}function Yd(e){return e==="manual"}function Pc(e,t,n,r={}){var d,c;const o=Xd(vN,r),i={i:0},s=new Map(t),a=o!=null&&o.elevateNodesOnSelect&&!Yd(o.zIndexMode)?wv:0;let l=e.length>0,u=!1;t.clear(),n.clear();for(const f of e){let m=s.get(f.id);if(o.checkEquality&&f===(m==null?void 0:m.internals.userNode))t.set(f.id,m);else{const y=Yi(f,o.nodeOrigin),v=yo(f.extent)?f.extent:o.nodeExtent,w=$r(y,v,wn(f));m={...o.defaults,...f,measured:{width:(d=f.measured)==null?void 0:d.width,height:(c=f.measured)==null?void 0:c.height},internals:{positionAbsolute:w,handleBounds:_N(f,m),z:_v(f,a,o.zIndexMode),userNode:f}},t.set(f.id,m)}(m.measured===void 0||m.measured.width===void 0||m.measured.height===void 0)&&!m.hidden&&(l=!1),f.parentId&&Gd(m,t,n,r,i),u||(u=f.selected??!1)}return{nodesInitialized:l,hasSelectedNodes:u}}function $N(e,t){if(!e.parentId)return;const n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function Gd(e,t,n,r,o){const{elevateNodesOnSelect:i,nodeOrigin:s,nodeExtent:a,zIndexMode:l}=Xd(Kd,r),u=e.parentId,d=t.get(u);if(!d){console.warn(`Parent node ${u} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}$N(e,n),o&&!d.parentId&&d.internals.rootParentIndex===void 0&&l==="auto"&&(d.internals.rootParentIndex=++o.i,d.internals.z=d.internals.z+o.i*yN),o&&d.internals.rootParentIndex!==void 0&&(o.i=d.internals.rootParentIndex);const c=i&&!Yd(l)?wv:0,{x:f,y:m,z:y}=xN(e,d,s,a,c,l),{positionAbsolute:v}=e.internals,w=f!==v.x||m!==v.y;(w||y!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:w?{x:f,y:m}:v,z:y}})}function _v(e,t,n){const r=Ot(e.zIndex)?e.zIndex:0;return Yd(n)?r:r+(e.selected?t:0)}function xN(e,t,n,r,o,i){const{x:s,y:a}=t.internals.positionAbsolute,l=wn(e),u=Yi(e,n),d=yo(e.extent)?$r(u,e.extent,l):u;let c=$r({x:s+d.x,y:a+d.y},r,l);e.extent==="parent"&&(c=av(c,l,t));const f=_v(e,o,i),m=t.internals.z??0;return{x:c.x,y:c.y,z:m>=f?m+1:f}}function Qd(e,t,n,r=[0,0]){var s;const o=[],i=new Map;for(const a of e){const l=t.get(a.parentId);if(!l)continue;const u=((s=i.get(a.parentId))==null?void 0:s.expandedRect)??go(l),d=uv(u,a.rect);i.set(a.parentId,{expandedRect:d,parent:l})}return i.size>0&&i.forEach(({expandedRect:a,parent:l},u)=>{var p;const d=l.internals.positionAbsolute,c=wn(l),f=l.origin??r,m=a.x<d.x?Math.round(Math.abs(d.x-a.x)):0,y=a.y<d.y?Math.round(Math.abs(d.y-a.y)):0,v=Math.max(c.width,Math.round(a.width)),w=Math.max(c.height,Math.round(a.height)),h=(v-c.width)*f[0],g=(w-c.height)*f[1];(m>0||y>0||h||g)&&(o.push({id:u,type:"position",position:{x:l.position.x-m+h,y:l.position.y-y+g}}),(p=n.get(u))==null||p.forEach(_=>{e.some(x=>x.id===_.id)||o.push({id:_.id,type:"position",position:{x:_.position.x+m,y:_.position.y+y}})})),(c.width<a.width||c.height<a.height||m||y)&&o.push({id:u,type:"dimensions",setAttributes:!0,dimensions:{width:v+(m?f[0]*m-h:0),height:w+(y?f[1]*y-g:0)}})}),o}function SN(e,t,n,r,o,i,s){const a=r==null?void 0:r.querySelector(".xyflow__viewport");let l=!1;if(!a)return{changes:[],updatedInternals:l};const u=[],d=window.getComputedStyle(a),{m22:c}=new window.DOMMatrixReadOnly(d.transform),f=[];for(const m of e.values()){const y=t.get(m.id);if(!y)continue;if(y.hidden){t.set(y.id,{...y,internals:{...y.internals,handleBounds:void 0}}),l=!0;continue}const v=qd(m.nodeElement),w=y.measured.width!==v.width||y.measured.height!==v.height;if(!!(v.width&&v.height&&(w||!y.internals.handleBounds||m.force))){const g=m.nodeElement.getBoundingClientRect(),p=yo(y.extent)?y.extent:i;let{positionAbsolute:_}=y.internals;y.parentId&&y.extent==="parent"?_=av(_,v,t.get(y.parentId)):p&&(_=$r(_,p,v));const x={...y,measured:v,internals:{...y.internals,positionAbsolute:_,handleBounds:{source:zp("source",m.nodeElement,g,c,y.id),target:zp("target",m.nodeElement,g,c,y.id)}}};t.set(y.id,x),y.parentId&&Gd(x,t,n,{nodeOrigin:o,zIndexMode:s}),l=!0,w&&(u.push({id:y.id,type:"dimensions",dimensions:v}),y.expandParent&&y.parentId&&f.push({id:y.id,parentId:y.parentId,rect:go(x,o)}))}}if(f.length>0){const m=Qd(f,t,n,o);u.push(...m)}return{changes:u,updatedInternals:l}}async function EN({delta:e,panZoom:t,transform:n,translateExtent:r,width:o,height:i}){if(!t||!e.x&&!e.y)return Promise.resolve(!1);const s=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[o,i]],r),a=!!s&&(s.x!==n[0]||s.y!==n[1]||s.k!==n[2]);return Promise.resolve(a)}function Hp(e,t,n,r,o,i){let s=o;const a=r.get(s)||new Map;r.set(s,a.set(n,t)),s=`${o}-${e}`;const l=r.get(s)||new Map;if(r.set(s,l.set(n,t)),i){s=`${o}-${e}-${i}`;const u=r.get(s)||new Map;r.set(s,u.set(n,t))}}function $v(e,t,n){e.clear(),t.clear();for(const r of n){const{source:o,target:i,sourceHandle:s=null,targetHandle:a=null}=r,l={edgeId:r.id,source:o,target:i,sourceHandle:s,targetHandle:a},u=`${o}-${s}--${i}-${a}`,d=`${i}-${a}--${o}-${s}`;Hp("source",l,d,e,o,s),Hp("target",l,u,e,i,a),t.set(r.id,r)}}function xv(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:xv(n,t):!1}function Bp(e,t,n){var o;let r=e;do{if((o=r==null?void 0:r.matches)!=null&&o.call(r,t))return!0;if(r===n)return!1;r=r==null?void 0:r.parentElement}while(r);return!1}function kN(e,t,n,r){const o=new Map;for(const[i,s]of e)if((s.selected||s.id===r)&&(!s.parentId||!xv(s,e))&&(s.draggable||t&&typeof s.draggable>"u")){const a=e.get(i);a&&o.set(i,{id:i,position:a.position||{x:0,y:0},distance:{x:n.x-a.internals.positionAbsolute.x,y:n.y-a.internals.positionAbsolute.y},extent:a.extent,parentId:a.parentId,origin:a.origin,expandParent:a.expandParent,internals:{positionAbsolute:a.internals.positionAbsolute||{x:0,y:0}},measured:{width:a.measured.width??0,height:a.measured.height??0}})}return o}function cu({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){var s,a,l;const o=[];for(const[u,d]of t){const c=(s=n.get(u))==null?void 0:s.internals.userNode;c&&o.push({...c,position:d.position,dragging:r})}if(!e)return[o[0],o];const i=(a=n.get(e))==null?void 0:a.internals.userNode;return[i?{...i,position:((l=t.get(e))==null?void 0:l.position)||i.position,dragging:r}:o[0],o]}function NN({dragItems:e,snapGrid:t,x:n,y:r}){const o=e.values().next().value;if(!o)return null;const i={x:n-o.distance.x,y:r-o.distance.y},s=Qi(i,t);return{x:s.x-i.x,y:s.y-i.y}}function PN({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:o}){let i={x:null,y:null},s=0,a=new Map,l=!1,u={x:0,y:0},d=null,c=!1,f=null,m=!1,y=!1,v=null;function w({noDragClassName:g,handleSelector:p,domNode:_,isSelectable:x,nodeId:k,nodeClickDistance:P=0}){f=lt(_);function b({x:H,y:q}){const{nodeLookup:E,nodeExtent:O,snapGrid:M,snapToGrid:V,nodeOrigin:j,onNodeDrag:z,onSelectionDrag:T,onError:N,updateNodePositions:R}=t();i={x:H,y:q};let D=!1;const S=a.size>1,C=S&&O?Ec(Gi(a)):null,U=S&&V?NN({dragItems:a,snapGrid:M,x:H,y:q}):null;for(const[Y,X]of a){if(!E.has(Y))continue;let Z={x:H-X.distance.x,y:q-X.distance.y};V&&(Z=U?{x:Math.round(Z.x+U.x),y:Math.round(Z.y+U.y)}:Qi(Z,M));let te=null;if(S&&O&&!X.extent&&C){const{positionAbsolute:K}=X.internals,G=K.x-C.x+O[0][0],J=K.x+X.measured.width-C.x2+O[1][0],ne=K.y-C.y+O[0][1],ue=K.y+X.measured.height-C.y2+O[1][1];te=[[G,ne],[J,ue]]}const{position:L,positionAbsolute:B}=sv({nodeId:Y,nextPosition:Z,nodeLookup:E,nodeExtent:te||O,nodeOrigin:j,onError:N});D=D||X.position.x!==L.x||X.position.y!==L.y,X.position=L,X.internals.positionAbsolute=B}if(y=y||D,!!D&&(R(a,!0),v&&(r||z||!k&&T))){const[Y,X]=cu({nodeId:k,dragItems:a,nodeLookup:E});r==null||r(v,a,Y,X),z==null||z(v,Y,X),k||T==null||T(v,X)}}async function F(){if(!d)return;const{transform:H,panBy:q,autoPanSpeed:E,autoPanOnNodeDrag:O}=t();if(!O){l=!1,cancelAnimationFrame(s);return}const[M,V]=lv(u,d,E);(M!==0||V!==0)&&(i.x=(i.x??0)-M/H[2],i.y=(i.y??0)-V/H[2],await q({x:M,y:V})&&b(i)),s=requestAnimationFrame(F)}function W(H){var S;const{nodeLookup:q,multiSelectionActive:E,nodesDraggable:O,transform:M,snapGrid:V,snapToGrid:j,selectNodesOnDrag:z,onNodeDragStart:T,onSelectionDragStart:N,unselectNodesAndEdges:R}=t();c=!0,(!z||!x)&&!E&&k&&((S=q.get(k))!=null&&S.selected||R()),x&&z&&k&&(e==null||e(k));const D=ui(H.sourceEvent,{transform:M,snapGrid:V,snapToGrid:j,containerBounds:d});if(i=D,a=kN(q,O,D,k),a.size>0&&(n||T||!k&&N)){const[C,U]=cu({nodeId:k,dragItems:a,nodeLookup:q});n==null||n(H.sourceEvent,a,C,U),T==null||T(H.sourceEvent,C,U),k||N==null||N(H.sourceEvent,U)}}const I=Ly().clickDistance(P).on("start",H=>{const{domNode:q,nodeDragThreshold:E,transform:O,snapGrid:M,snapToGrid:V}=t();d=(q==null?void 0:q.getBoundingClientRect())||null,m=!1,y=!1,v=H.sourceEvent,E===0&&W(H),i=ui(H.sourceEvent,{transform:O,snapGrid:M,snapToGrid:V,containerBounds:d}),u=Dt(H.sourceEvent,d)}).on("drag",H=>{const{autoPanOnNodeDrag:q,transform:E,snapGrid:O,snapToGrid:M,nodeDragThreshold:V,nodeLookup:j}=t(),z=ui(H.sourceEvent,{transform:E,snapGrid:O,snapToGrid:M,containerBounds:d});if(v=H.sourceEvent,(H.sourceEvent.type==="touchmove"&&H.sourceEvent.touches.length>1||k&&!j.has(k))&&(m=!0),!m){if(!l&&q&&c&&(l=!0,F()),!c){const T=Dt(H.sourceEvent,d),N=T.x-u.x,R=T.y-u.y;Math.sqrt(N*N+R*R)>V&&W(H)}(i.x!==z.xSnapped||i.y!==z.ySnapped)&&a&&c&&(u=Dt(H.sourceEvent,d),b(z))}}).on("end",H=>{if(!(!c||m)&&(l=!1,c=!1,cancelAnimationFrame(s),a.size>0)){const{nodeLookup:q,updateNodePositions:E,onNodeDragStop:O,onSelectionDragStop:M}=t();if(y&&(E(a,!1),y=!1),o||O||!k&&M){const[V,j]=cu({nodeId:k,dragItems:a,nodeLookup:q,dragging:!1});o==null||o(H.sourceEvent,a,V,j),O==null||O(H.sourceEvent,V,j),k||M==null||M(H.sourceEvent,j)}}}).filter(H=>{const q=H.target;return!H.button&&(!g||!Bp(q,`.${g}`,_))&&(!p||Bp(q,p,_))});f.call(I)}function h(){f==null||f.on(".drag",null)}return{update:w,destroy:h}}function CN(e,t,n){const r=[],o={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const i of t.values())Oi(o,go(i))>0&&r.push(i);return r}const bN=250;function jN(e,t,n,r){var a,l;let o=[],i=1/0;const s=CN(e,n,t+bN);for(const u of s){const d=[...((a=u.internals.handleBounds)==null?void 0:a.source)??[],...((l=u.internals.handleBounds)==null?void 0:l.target)??[]];for(const c of d){if(r.nodeId===c.nodeId&&r.type===c.type&&r.id===c.id)continue;const{x:f,y:m}=xr(u,c,c.position,!0),y=Math.sqrt(Math.pow(f-e.x,2)+Math.pow(m-e.y,2));y>t||(y<i?(o=[{...c,x:f,y:m}],i=y):y===i&&o.push({...c,x:f,y:m}))}}if(!o.length)return null;if(o.length>1){const u=r.type==="source"?"target":"source";return o.find(d=>d.type===u)??o[0]}return o[0]}function Sv(e,t,n,r,o,i=!1){var u,d,c;const s=r.get(e);if(!s)return null;const a=o==="strict"?(u=s.internals.handleBounds)==null?void 0:u[t]:[...((d=s.internals.handleBounds)==null?void 0:d.source)??[],...((c=s.internals.handleBounds)==null?void 0:c.target)??[]],l=(n?a==null?void 0:a.find(f=>f.id===n):a==null?void 0:a[0])??null;return l&&i?{...l,...xr(s,l,l.position,!0)}:l}function Ev(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function MN(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const kv=()=>!0;function TN(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:o,edgeUpdaterType:i,isTarget:s,domNode:a,nodeLookup:l,lib:u,autoPanOnConnect:d,flowId:c,panBy:f,cancelConnection:m,onConnectStart:y,onConnect:v,onConnectEnd:w,isValidConnection:h=kv,onReconnectEnd:g,updateConnection:p,getTransform:_,getFromHandle:x,autoPanSpeed:k,dragThreshold:P=1,handleDomNode:b}){const F=fv(e.target);let W=0,I;const{x:H,y:q}=Dt(e),E=Ev(i,b),O=a==null?void 0:a.getBoundingClientRect();let M=!1;if(!O||!E)return;const V=Sv(o,E,r,l,t);if(!V)return;let j=Dt(e,O),z=!1,T=null,N=!1,R=null;function D(){if(!d||!O)return;const[L,B]=lv(j,O,k);f({x:L,y:B}),W=requestAnimationFrame(D)}const S={...V,nodeId:o,type:E,position:V.position},C=l.get(o);let Y={inProgress:!0,isValid:null,from:xr(C,S,oe.Left,!0),fromHandle:S,fromPosition:S.position,fromNode:C,to:j,toHandle:null,toPosition:Mp[S.position],toNode:null,pointer:j};function X(){M=!0,p(Y),y==null||y(e,{nodeId:o,handleId:r,handleType:E})}P===0&&X();function Z(L){if(!M){const{x:ue,y:je}=Dt(L),ve=ue-H,Ne=je-q;if(!(ve*ve+Ne*Ne>P*P))return;X()}if(!x()||!S){te(L);return}const B=_();j=Dt(L,O),I=jN(Zi(j,B,!1,[1,1]),n,l,S),z||(D(),z=!0);const K=Nv(L,{handle:I,connectionMode:t,fromNodeId:o,fromHandleId:r,fromType:s?"target":"source",isValidConnection:h,doc:F,lib:u,flowId:c,nodeLookup:l});R=K.handleDomNode,T=K.connection,N=MN(!!I,K.isValid);const G=l.get(o),J=G?xr(G,S,oe.Left,!0):Y.from,ne={...Y,from:J,isValid:N,to:K.toHandle&&N?Da({x:K.toHandle.x,y:K.toHandle.y},B):j,toHandle:K.toHandle,toPosition:N&&K.toHandle?K.toHandle.position:Mp[S.position],toNode:K.toHandle?l.get(K.toHandle.nodeId):null,pointer:j};p(ne),Y=ne}function te(L){if(!("touches"in L&&L.touches.length>0)){if(M){(I||R)&&T&&N&&(v==null||v(T));const{inProgress:B,...K}=Y,G={...K,toPosition:Y.toHandle?Y.toPosition:null};w==null||w(L,G),i&&(g==null||g(L,G))}m(),cancelAnimationFrame(W),z=!1,N=!1,T=null,R=null,F.removeEventListener("mousemove",Z),F.removeEventListener("mouseup",te),F.removeEventListener("touchmove",Z),F.removeEventListener("touchend",te)}}F.addEventListener("mousemove",Z),F.addEventListener("mouseup",te),F.addEventListener("touchmove",Z),F.addEventListener("touchend",te)}function Nv(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:o,fromType:i,doc:s,lib:a,flowId:l,isValidConnection:u=kv,nodeLookup:d}){const c=i==="target",f=t?s.querySelector(`.${a}-flow__handle[data-id="${l}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:m,y}=Dt(e),v=s.elementFromPoint(m,y),w=v!=null&&v.classList.contains(`${a}-flow__handle`)?v:f,h={handleDomNode:w,isValid:!1,connection:null,toHandle:null};if(w){const g=Ev(void 0,w),p=w.getAttribute("data-nodeid"),_=w.getAttribute("data-handleid"),x=w.classList.contains("connectable"),k=w.classList.contains("connectableend");if(!p||!g)return h;const P={source:c?p:r,sourceHandle:c?_:o,target:c?r:p,targetHandle:c?o:_};h.connection=P;const F=x&&k&&(n===po.Strict?c&&g==="source"||!c&&g==="target":p!==r||_!==o);h.isValid=F&&u(P),h.toHandle=Sv(p,g,_,d,n,!0)}return h}const Cc={onPointerDown:TN,isValid:Nv};function IN({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const o=lt(e);function i({translateExtent:a,width:l,height:u,zoomStep:d=1,pannable:c=!0,zoomable:f=!0,inversePan:m=!1}){const y=p=>{if(p.sourceEvent.type!=="wheel"||!t)return;const _=n(),x=p.sourceEvent.ctrlKey&&Di()?10:1,k=-p.sourceEvent.deltaY*(p.sourceEvent.deltaMode===1?.05:p.sourceEvent.deltaMode?1:.002)*d,P=_[2]*Math.pow(2,k*x);t.scaleTo(P)};let v=[0,0];const w=p=>{(p.sourceEvent.type==="mousedown"||p.sourceEvent.type==="touchstart")&&(v=[p.sourceEvent.clientX??p.sourceEvent.touches[0].clientX,p.sourceEvent.clientY??p.sourceEvent.touches[0].clientY])},h=p=>{const _=n();if(p.sourceEvent.type!=="mousemove"&&p.sourceEvent.type!=="touchmove"||!t)return;const x=[p.sourceEvent.clientX??p.sourceEvent.touches[0].clientX,p.sourceEvent.clientY??p.sourceEvent.touches[0].clientY],k=[x[0]-v[0],x[1]-v[1]];v=x;const P=r()*Math.max(_[2],Math.log(_[2]))*(m?-1:1),b={x:_[0]-k[0]*P,y:_[1]-k[1]*P},F=[[0,0],[l,u]];t.setViewportConstrained({x:b.x,y:b.y,zoom:_[2]},F,a)},g=ev().on("start",w).on("zoom",c?h:null).on("zoom.wheel",f?y:null);o.call(g,{})}function s(){o.on("zoom",null)}return{update:i,destroy:s,pointer:It}}const gl=e=>({x:e.x,y:e.y,zoom:e.k}),du=({x:e,y:t,zoom:n})=>hl.translate(e,t).scale(n),Wr=(e,t)=>e.target.closest(`.${t}`),Pv=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),RN=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,fu=(e,t=0,n=RN,r=()=>{})=>{const o=typeof t=="number"&&t>0;return o||r(),o?e.transition().duration(t).ease(n).on("end",r):e},Cv=e=>{const t=e.ctrlKey&&Di()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function zN({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:o,panOnScrollSpeed:i,zoomOnPinch:s,onPanZoomStart:a,onPanZoom:l,onPanZoomEnd:u}){return d=>{if(Wr(d,t))return d.ctrlKey&&d.preventDefault(),!1;d.preventDefault(),d.stopImmediatePropagation();const c=n.property("__zoom").k||1;if(d.ctrlKey&&s){const w=It(d),h=Cv(d),g=c*Math.pow(2,h);r.scaleTo(n,g,w,d);return}const f=d.deltaMode===1?20:1;let m=o===hr.Vertical?0:d.deltaX*f,y=o===hr.Horizontal?0:d.deltaY*f;!Di()&&d.shiftKey&&o!==hr.Vertical&&(m=d.deltaY*f,y=0),r.translateBy(n,-(m/c)*i,-(y/c)*i,{internal:!0});const v=gl(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(l==null||l(d,v),e.panScrollTimeout=setTimeout(()=>{u==null||u(d,v),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,a==null||a(d,v))}}function AN({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,o){const i=r.type==="wheel",s=!t&&i&&!r.ctrlKey,a=Wr(r,e);if(r.ctrlKey&&i&&a&&r.preventDefault(),s||a)return null;r.preventDefault(),n.call(this,r,o)}}function ON({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{var i,s,a;if((i=r.sourceEvent)!=null&&i.internal)return;const o=gl(r.transform);e.mouseButton=((s=r.sourceEvent)==null?void 0:s.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=o,((a=r.sourceEvent)==null?void 0:a.type)==="mousedown"&&t(!0),n&&(n==null||n(r.sourceEvent,o))}}function DN({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:o}){return i=>{var s,a;e.usedRightMouseButton=!!(n&&Pv(t,e.mouseButton??0)),(s=i.sourceEvent)!=null&&s.sync||r([i.transform.x,i.transform.y,i.transform.k]),o&&!((a=i.sourceEvent)!=null&&a.internal)&&(o==null||o(i.sourceEvent,gl(i.transform)))}}function LN({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:o,onPaneContextMenu:i}){return s=>{var a;if(!((a=s.sourceEvent)!=null&&a.internal)&&(e.isZoomingOrPanning=!1,i&&Pv(t,e.mouseButton??0)&&!e.usedRightMouseButton&&s.sourceEvent&&i(s.sourceEvent),e.usedRightMouseButton=!1,r(!1),o)){const l=gl(s.transform);e.prevViewport=l,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{o==null||o(s.sourceEvent,l)},n?150:0)}}}function VN({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:o,zoomOnDoubleClick:i,userSelectionActive:s,noWheelClassName:a,noPanClassName:l,lib:u,connectionInProgress:d}){return c=>{var w;const f=e||t,m=n&&c.ctrlKey,y=c.type==="wheel";if(c.button===1&&c.type==="mousedown"&&(Wr(c,`${u}-flow__node`)||Wr(c,`${u}-flow__edge`)))return!0;if(!r&&!f&&!o&&!i&&!n||s||d&&!y||Wr(c,a)&&y||Wr(c,l)&&(!y||o&&y&&!e)||!n&&c.ctrlKey&&y)return!1;if(!n&&c.type==="touchstart"&&((w=c.touches)==null?void 0:w.length)>1)return c.preventDefault(),!1;if(!f&&!o&&!m&&y||!r&&(c.type==="mousedown"||c.type==="touchstart")||Array.isArray(r)&&!r.includes(c.button)&&c.type==="mousedown")return!1;const v=Array.isArray(r)&&r.includes(c.button)||!c.button||c.button<=1;return(!c.ctrlKey||y)&&v}}function FN({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:o,onPanZoom:i,onPanZoomStart:s,onPanZoomEnd:a,onDraggingChange:l}){const u={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},d=e.getBoundingClientRect(),c=ev().scaleExtent([t,n]).translateExtent(r),f=lt(e).call(c);g({x:o.x,y:o.y,zoom:mo(o.zoom,t,n)},[[0,0],[d.width,d.height]],r);const m=f.on("wheel.zoom"),y=f.on("dblclick.zoom");c.wheelDelta(Cv);function v(I,H){return f?new Promise(q=>{c==null||c.interpolate((H==null?void 0:H.interpolate)==="linear"?li:Gs).transform(fu(f,H==null?void 0:H.duration,H==null?void 0:H.ease,()=>q(!0)),I)}):Promise.resolve(!1)}function w({noWheelClassName:I,noPanClassName:H,onPaneContextMenu:q,userSelectionActive:E,panOnScroll:O,panOnDrag:M,panOnScrollMode:V,panOnScrollSpeed:j,preventScrolling:z,zoomOnPinch:T,zoomOnScroll:N,zoomOnDoubleClick:R,zoomActivationKeyPressed:D,lib:S,onTransformChange:C,connectionInProgress:U,paneClickDistance:Y,selectionOnDrag:X}){E&&!u.isZoomingOrPanning&&h();const Z=O&&!D&&!E;c.clickDistance(X?1/0:!Ot(Y)||Y<0?0:Y);const te=Z?zN({zoomPanValues:u,noWheelClassName:I,d3Selection:f,d3Zoom:c,panOnScrollMode:V,panOnScrollSpeed:j,zoomOnPinch:T,onPanZoomStart:s,onPanZoom:i,onPanZoomEnd:a}):AN({noWheelClassName:I,preventScrolling:z,d3ZoomHandler:m});if(f.on("wheel.zoom",te,{passive:!1}),!E){const B=ON({zoomPanValues:u,onDraggingChange:l,onPanZoomStart:s});c.on("start",B);const K=DN({zoomPanValues:u,panOnDrag:M,onPaneContextMenu:!!q,onPanZoom:i,onTransformChange:C});c.on("zoom",K);const G=LN({zoomPanValues:u,panOnDrag:M,panOnScroll:O,onPaneContextMenu:q,onPanZoomEnd:a,onDraggingChange:l});c.on("end",G)}const L=VN({zoomActivationKeyPressed:D,panOnDrag:M,zoomOnScroll:N,panOnScroll:O,zoomOnDoubleClick:R,zoomOnPinch:T,userSelectionActive:E,noPanClassName:H,noWheelClassName:I,lib:S,connectionInProgress:U});c.filter(L),R?f.on("dblclick.zoom",y):f.on("dblclick.zoom",null)}function h(){c.on("zoom",null)}async function g(I,H,q){const E=du(I),O=c==null?void 0:c.constrain()(E,H,q);return O&&await v(O),new Promise(M=>M(O))}async function p(I,H){const q=du(I);return await v(q,H),new Promise(E=>E(q))}function _(I){if(f){const H=du(I),q=f.property("__zoom");(q.k!==I.zoom||q.x!==I.x||q.y!==I.y)&&(c==null||c.transform(f,H,null,{sync:!0}))}}function x(){const I=f?Jy(f.node()):{x:0,y:0,k:1};return{x:I.x,y:I.y,zoom:I.k}}function k(I,H){return f?new Promise(q=>{c==null||c.interpolate((H==null?void 0:H.interpolate)==="linear"?li:Gs).scaleTo(fu(f,H==null?void 0:H.duration,H==null?void 0:H.ease,()=>q(!0)),I)}):Promise.resolve(!1)}function P(I,H){return f?new Promise(q=>{c==null||c.interpolate((H==null?void 0:H.interpolate)==="linear"?li:Gs).scaleBy(fu(f,H==null?void 0:H.duration,H==null?void 0:H.ease,()=>q(!0)),I)}):Promise.resolve(!1)}function b(I){c==null||c.scaleExtent(I)}function F(I){c==null||c.translateExtent(I)}function W(I){const H=!Ot(I)||I<0?0:I;c==null||c.clickDistance(H)}return{update:w,destroy:h,setViewport:p,setViewportConstrained:g,getViewport:x,scaleTo:k,scaleBy:P,setScaleExtent:b,setTranslateExtent:F,syncViewport:_,setClickDistance:W}}var vo;(function(e){e.Line="line",e.Handle="handle"})(vo||(vo={}));function HN({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:o,affectsY:i}){const s=e-t,a=n-r,l=[s>0?1:s<0?-1:0,a>0?1:a<0?-1:0];return s&&o&&(l[0]=l[0]*-1),a&&i&&(l[1]=l[1]*-1),l}function Up(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),r=e.includes("left"),o=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:r,affectsY:o}}function xn(e,t){return Math.max(0,t-e)}function Sn(e,t){return Math.max(0,e-t)}function Ps(e,t,n){return Math.max(0,t-e,e-n)}function Wp(e,t){return e?!t:t}function BN(e,t,n,r,o,i,s,a){let{affectsX:l,affectsY:u}=t;const{isHorizontal:d,isVertical:c}=t,f=d&&c,{xSnapped:m,ySnapped:y}=n,{minWidth:v,maxWidth:w,minHeight:h,maxHeight:g}=r,{x:p,y:_,width:x,height:k,aspectRatio:P}=e;let b=Math.floor(d?m-e.pointerX:0),F=Math.floor(c?y-e.pointerY:0);const W=x+(l?-b:b),I=k+(u?-F:F),H=-i[0]*x,q=-i[1]*k;let E=Ps(W,v,w),O=Ps(I,h,g);if(s){let j=0,z=0;l&&b<0?j=xn(p+b+H,s[0][0]):!l&&b>0&&(j=Sn(p+W+H,s[1][0])),u&&F<0?z=xn(_+F+q,s[0][1]):!u&&F>0&&(z=Sn(_+I+q,s[1][1])),E=Math.max(E,j),O=Math.max(O,z)}if(a){let j=0,z=0;l&&b>0?j=Sn(p+b,a[0][0]):!l&&b<0&&(j=xn(p+W,a[1][0])),u&&F>0?z=Sn(_+F,a[0][1]):!u&&F<0&&(z=xn(_+I,a[1][1])),E=Math.max(E,j),O=Math.max(O,z)}if(o){if(d){const j=Ps(W/P,h,g)*P;if(E=Math.max(E,j),s){let z=0;!l&&!u||l&&!u&&f?z=Sn(_+q+W/P,s[1][1])*P:z=xn(_+q+(l?b:-b)/P,s[0][1])*P,E=Math.max(E,z)}if(a){let z=0;!l&&!u||l&&!u&&f?z=xn(_+W/P,a[1][1])*P:z=Sn(_+(l?b:-b)/P,a[0][1])*P,E=Math.max(E,z)}}if(c){const j=Ps(I*P,v,w)/P;if(O=Math.max(O,j),s){let z=0;!l&&!u||u&&!l&&f?z=Sn(p+I*P+H,s[1][0])/P:z=xn(p+(u?F:-F)*P+H,s[0][0])/P,O=Math.max(O,z)}if(a){let z=0;!l&&!u||u&&!l&&f?z=xn(p+I*P,a[1][0])/P:z=Sn(p+(u?F:-F)*P,a[0][0])/P,O=Math.max(O,z)}}}F=F+(F<0?O:-O),b=b+(b<0?E:-E),o&&(f?W>I*P?F=(Wp(l,u)?-b:b)/P:b=(Wp(l,u)?-F:F)*P:d?(F=b/P,u=l):(b=F*P,l=u));const M=l?p+b:p,V=u?_+F:_;return{width:x+(l?-b:b),height:k+(u?-F:F),x:i[0]*b*(l?-1:1)+M,y:i[1]*F*(u?-1:1)+V}}const bv={width:0,height:0,x:0,y:0},UN={...bv,pointerX:0,pointerY:0,aspectRatio:1};function WN(e){return[[0,0],[e.measured.width,e.measured.height]]}function qN(e,t,n){const r=t.position.x+e.position.x,o=t.position.y+e.position.y,i=e.measured.width??0,s=e.measured.height??0,a=n[0]*i,l=n[1]*s;return[[r-a,o-l],[r+i-a,o+s-l]]}function KN({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:o}){const i=lt(e);let s={controlDirection:Up("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function a({controlPosition:u,boundaries:d,keepAspectRatio:c,resizeDirection:f,onResizeStart:m,onResize:y,onResizeEnd:v,shouldResize:w}){let h={...bv},g={...UN};s={boundaries:d,resizeDirection:f,keepAspectRatio:c,controlDirection:Up(u)};let p,_=null,x=[],k,P,b,F=!1;const W=Ly().on("start",I=>{const{nodeLookup:H,transform:q,snapGrid:E,snapToGrid:O,nodeOrigin:M,paneDomNode:V}=n();if(p=H.get(t),!p)return;_=(V==null?void 0:V.getBoundingClientRect())??null;const{xSnapped:j,ySnapped:z}=ui(I.sourceEvent,{transform:q,snapGrid:E,snapToGrid:O,containerBounds:_});h={width:p.measured.width??0,height:p.measured.height??0,x:p.position.x??0,y:p.position.y??0},g={...h,pointerX:j,pointerY:z,aspectRatio:h.width/h.height},k=void 0,p.parentId&&(p.extent==="parent"||p.expandParent)&&(k=H.get(p.parentId),P=k&&p.extent==="parent"?WN(k):void 0),x=[],b=void 0;for(const[T,N]of H)if(N.parentId===t&&(x.push({id:T,position:{...N.position},extent:N.extent}),N.extent==="parent"||N.expandParent)){const R=qN(N,p,N.origin??M);b?b=[[Math.min(R[0][0],b[0][0]),Math.min(R[0][1],b[0][1])],[Math.max(R[1][0],b[1][0]),Math.max(R[1][1],b[1][1])]]:b=R}m==null||m(I,{...h})}).on("drag",I=>{const{transform:H,snapGrid:q,snapToGrid:E,nodeOrigin:O}=n(),M=ui(I.sourceEvent,{transform:H,snapGrid:q,snapToGrid:E,containerBounds:_}),V=[];if(!p)return;const{x:j,y:z,width:T,height:N}=h,R={},D=p.origin??O,{width:S,height:C,x:U,y:Y}=BN(g,s.controlDirection,M,s.boundaries,s.keepAspectRatio,D,P,b),X=S!==T,Z=C!==N,te=U!==j&&X,L=Y!==z&&Z;if(!te&&!L&&!X&&!Z)return;if((te||L||D[0]===1||D[1]===1)&&(R.x=te?U:h.x,R.y=L?Y:h.y,h.x=R.x,h.y=R.y,x.length>0)){const J=U-j,ne=Y-z;for(const ue of x)ue.position={x:ue.position.x-J+D[0]*(S-T),y:ue.position.y-ne+D[1]*(C-N)},V.push(ue)}if((X||Z)&&(R.width=X&&(!s.resizeDirection||s.resizeDirection==="horizontal")?S:h.width,R.height=Z&&(!s.resizeDirection||s.resizeDirection==="vertical")?C:h.height,h.width=R.width,h.height=R.height),k&&p.expandParent){const J=D[0]*(R.width??0);R.x&&R.x<J&&(h.x=J,g.x=g.x-(R.x-J));const ne=D[1]*(R.height??0);R.y&&R.y<ne&&(h.y=ne,g.y=g.y-(R.y-ne))}const B=HN({width:h.width,prevWidth:T,height:h.height,prevHeight:N,affectsX:s.controlDirection.affectsX,affectsY:s.controlDirection.affectsY}),K={...h,direction:B};(w==null?void 0:w(I,K))!==!1&&(F=!0,y==null||y(I,K),r(R,V))}).on("end",I=>{F&&(v==null||v(I,{...h}),o==null||o({...h}),F=!1)});i.call(W)}function l(){i.on(".drag",null)}return{update:a,destroy:l}}var jv={exports:{}},Mv={},Tv={exports:{}},Iv={};/**
|
|
196
|
+
* @license React
|
|
197
|
+
* use-sync-external-store-shim.production.js
|
|
198
|
+
*
|
|
199
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
200
|
+
*
|
|
201
|
+
* This source code is licensed under the MIT license found in the
|
|
202
|
+
* LICENSE file in the root directory of this source tree.
|
|
203
|
+
*/var wo=A;function XN(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var YN=typeof Object.is=="function"?Object.is:XN,GN=wo.useState,QN=wo.useEffect,ZN=wo.useLayoutEffect,JN=wo.useDebugValue;function eP(e,t){var n=t(),r=GN({inst:{value:n,getSnapshot:t}}),o=r[0].inst,i=r[1];return ZN(function(){o.value=n,o.getSnapshot=t,hu(o)&&i({inst:o})},[e,n,t]),QN(function(){return hu(o)&&i({inst:o}),e(function(){hu(o)&&i({inst:o})})},[e]),JN(n),n}function hu(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!YN(e,n)}catch{return!0}}function tP(e,t){return t()}var nP=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?tP:eP;Iv.useSyncExternalStore=wo.useSyncExternalStore!==void 0?wo.useSyncExternalStore:nP;Tv.exports=Iv;var rP=Tv.exports;/**
|
|
204
|
+
* @license React
|
|
205
|
+
* use-sync-external-store-shim/with-selector.production.js
|
|
206
|
+
*
|
|
207
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
208
|
+
*
|
|
209
|
+
* This source code is licensed under the MIT license found in the
|
|
210
|
+
* LICENSE file in the root directory of this source tree.
|
|
211
|
+
*/var yl=A,oP=rP;function iP(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var sP=typeof Object.is=="function"?Object.is:iP,aP=oP.useSyncExternalStore,lP=yl.useRef,uP=yl.useEffect,cP=yl.useMemo,dP=yl.useDebugValue;Mv.useSyncExternalStoreWithSelector=function(e,t,n,r,o){var i=lP(null);if(i.current===null){var s={hasValue:!1,value:null};i.current=s}else s=i.current;i=cP(function(){function l(m){if(!u){if(u=!0,d=m,m=r(m),o!==void 0&&s.hasValue){var y=s.value;if(o(y,m))return c=y}return c=m}if(y=c,sP(d,m))return y;var v=r(m);return o!==void 0&&o(y,v)?(d=m,y):(d=m,c=v)}var u=!1,d,c,f=n===void 0?null:n;return[function(){return l(t())},f===null?void 0:function(){return l(f())}]},[t,n,r,o]);var a=aP(e,i[0],i[1]);return uP(function(){s.hasValue=!0,s.value=a},[a]),dP(a),a};jv.exports=Mv;var fP=jv.exports;const hP=Wa(fP),pP={},qp=e=>{let t;const n=new Set,r=(d,c)=>{const f=typeof d=="function"?d(t):d;if(!Object.is(f,t)){const m=t;t=c??(typeof f!="object"||f===null)?f:Object.assign({},t,f),n.forEach(y=>y(t,m))}},o=()=>t,l={setState:r,getState:o,getInitialState:()=>u,subscribe:d=>(n.add(d),()=>n.delete(d)),destroy:()=>{(pP?"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."),n.clear()}},u=t=e(r,o,l);return l},mP=e=>e?qp(e):qp,{useDebugValue:gP}=E_,{useSyncExternalStoreWithSelector:yP}=hP,vP=e=>e;function Rv(e,t=vP,n){const r=yP(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return gP(r),r}const Kp=(e,t)=>{const n=mP(e),r=(o,i=t)=>Rv(n,o,i);return Object.assign(r,n),r},wP=(e,t)=>e?Kp(e,t):Kp;function _e(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[r,o]of e)if(!Object.is(o,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}const vl=A.createContext(null),_P=vl.Provider,zv=Qt.error001();function le(e,t){const n=A.useContext(vl);if(n===null)throw new Error(zv);return Rv(n,e,t)}function $e(){const e=A.useContext(vl);if(e===null)throw new Error(zv);return A.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const Xp={display:"none"},$P={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},Av="react-flow__node-desc",Ov="react-flow__edge-desc",xP="react-flow__aria-live",SP=e=>e.ariaLiveMessage,EP=e=>e.ariaLabelConfig;function kP({rfId:e}){const t=le(SP);return $.jsx("div",{id:`${xP}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:$P,children:t})}function NP({rfId:e,disableKeyboardA11y:t}){const n=le(EP);return $.jsxs($.Fragment,{children:[$.jsx("div",{id:`${Av}-${e}`,style:Xp,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),$.jsx("div",{id:`${Ov}-${e}`,style:Xp,children:n["edge.a11yDescription.default"]}),!t&&$.jsx(kP,{rfId:e})]})}const wl=A.forwardRef(({position:e="top-left",children:t,className:n,style:r,...o},i)=>{const s=`${e}`.split("-");return $.jsx("div",{className:Te(["react-flow__panel",n,...s]),style:r,ref:i,...o,children:t})});wl.displayName="Panel";function PP({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:$.jsx(wl,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:$.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const CP=e=>{const t=[],n=[];for(const[,r]of e.nodeLookup)r.selected&&t.push(r.internals.userNode);for(const[,r]of e.edgeLookup)r.selected&&n.push(r);return{selectedNodes:t,selectedEdges:n}},Cs=e=>e.id;function bP(e,t){return _e(e.selectedNodes.map(Cs),t.selectedNodes.map(Cs))&&_e(e.selectedEdges.map(Cs),t.selectedEdges.map(Cs))}function jP({onSelectionChange:e}){const t=$e(),{selectedNodes:n,selectedEdges:r}=le(CP,bP);return A.useEffect(()=>{const o={nodes:n,edges:r};e==null||e(o),t.getState().onSelectionChangeHandlers.forEach(i=>i(o))},[n,r,e]),null}const MP=e=>!!e.onSelectionChangeHandlers;function TP({onSelectionChange:e}){const t=le(MP);return e||t?$.jsx(jP,{onSelectionChange:e}):null}const bc=typeof window<"u"?A.useLayoutEffect:A.useEffect,Dv=[0,0],IP={x:0,y:0,zoom:1},RP=["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"],Yp=[...RP,"rfId"],zP=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),Gp={translateExtent:zi,nodeOrigin:Dv,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function AP(e){const{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:o,setTranslateExtent:i,setNodeExtent:s,reset:a,setDefaultNodesAndEdges:l}=le(zP,_e),u=$e();bc(()=>(l(e.defaultNodes,e.defaultEdges),()=>{d.current=Gp,a()}),[]);const d=A.useRef(Gp);return bc(()=>{for(const c of Yp){const f=e[c],m=d.current[c];f!==m&&(typeof e[c]>"u"||(c==="nodes"?t(f):c==="edges"?n(f):c==="minZoom"?r(f):c==="maxZoom"?o(f):c==="translateExtent"?i(f):c==="nodeExtent"?s(f):c==="ariaLabelConfig"?u.setState({ariaLabelConfig:iN(f)}):c==="fitView"?u.setState({fitViewQueued:f}):c==="fitViewOptions"?u.setState({fitViewOptions:f}):u.setState({[c]:f})))}d.current=e},Yp.map(c=>e[c])),null}function Qp(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function OP(e){var r;const[t,n]=A.useState(e==="system"?null:e);return A.useEffect(()=>{if(e!=="system"){n(e);return}const o=Qp(),i=()=>n(o!=null&&o.matches?"dark":"light");return i(),o==null||o.addEventListener("change",i),()=>{o==null||o.removeEventListener("change",i)}},[e]),t!==null?t:(r=Qp())!=null&&r.matches?"dark":"light"}const Zp=typeof document<"u"?document:null;function Li(e=null,t={target:Zp,actInsideInputWithModifier:!0}){const[n,r]=A.useState(!1),o=A.useRef(!1),i=A.useRef(new Set([])),[s,a]=A.useMemo(()=>{if(e!==null){const u=(Array.isArray(e)?e:[e]).filter(c=>typeof c=="string").map(c=>c.replace("+",`
|
|
212
|
+
`).replace(`
|
|
213
|
+
|
|
214
|
+
`,`
|
|
215
|
+
+`).split(`
|
|
216
|
+
`)),d=u.reduce((c,f)=>c.concat(...f),[]);return[u,d]}return[[],[]]},[e]);return A.useEffect(()=>{const l=(t==null?void 0:t.target)??Zp,u=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const d=m=>{var w,h;if(o.current=m.ctrlKey||m.metaKey||m.shiftKey||m.altKey,(!o.current||o.current&&!u)&&hv(m))return!1;const v=em(m.code,a);if(i.current.add(m[v]),Jp(s,i.current,!1)){const g=((h=(w=m.composedPath)==null?void 0:w.call(m))==null?void 0:h[0])||m.target,p=(g==null?void 0:g.nodeName)==="BUTTON"||(g==null?void 0:g.nodeName)==="A";t.preventDefault!==!1&&(o.current||!p)&&m.preventDefault(),r(!0)}},c=m=>{const y=em(m.code,a);Jp(s,i.current,!0)?(r(!1),i.current.clear()):i.current.delete(m[y]),m.key==="Meta"&&i.current.clear(),o.current=!1},f=()=>{i.current.clear(),r(!1)};return l==null||l.addEventListener("keydown",d),l==null||l.addEventListener("keyup",c),window.addEventListener("blur",f),window.addEventListener("contextmenu",f),()=>{l==null||l.removeEventListener("keydown",d),l==null||l.removeEventListener("keyup",c),window.removeEventListener("blur",f),window.removeEventListener("contextmenu",f)}}},[e,r]),n}function Jp(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(o=>t.has(o)))}function em(e,t){return t.includes(e)?"code":"key"}const DP=()=>{const e=$e();return A.useMemo(()=>({zoomIn:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,t):Promise.resolve(!1)},zoomOut:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,t):Promise.resolve(!1)},zoomTo:(t,n)=>{const{panZoom:r}=e.getState();return r?r.scaleTo(t,n):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[r,o,i],panZoom:s}=e.getState();return s?(await s.setViewport({x:t.x??r,y:t.y??o,zoom:t.zoom??i},n),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[t,n,r]=e.getState().transform;return{x:t,y:n,zoom:r}},setCenter:async(t,n,r)=>e.getState().setCenter(t,n,r),fitBounds:async(t,n)=>{const{width:r,height:o,minZoom:i,maxZoom:s,panZoom:a}=e.getState(),l=Wd(t,r,o,i,s,(n==null?void 0:n.padding)??.1);return a?(await a.setViewport(l,{duration:n==null?void 0:n.duration,ease:n==null?void 0:n.ease,interpolate:n==null?void 0:n.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(t,n={})=>{const{transform:r,snapGrid:o,snapToGrid:i,domNode:s}=e.getState();if(!s)return t;const{x:a,y:l}=s.getBoundingClientRect(),u={x:t.x-a,y:t.y-l},d=n.snapGrid??o,c=n.snapToGrid??i;return Zi(u,r,c,d)},flowToScreenPosition:t=>{const{transform:n,domNode:r}=e.getState();if(!r)return t;const{x:o,y:i}=r.getBoundingClientRect(),s=Da(t,n);return{x:s.x+o,y:s.y+i}}}),[])};function Lv(e,t){const n=[],r=new Map,o=[];for(const i of e)if(i.type==="add"){o.push(i);continue}else if(i.type==="remove"||i.type==="replace")r.set(i.id,[i]);else{const s=r.get(i.id);s?s.push(i):r.set(i.id,[i])}for(const i of t){const s=r.get(i.id);if(!s){n.push(i);continue}if(s[0].type==="remove")continue;if(s[0].type==="replace"){n.push({...s[0].item});continue}const a={...i};for(const l of s)LP(l,a);n.push(a)}return o.length&&o.forEach(i=>{i.index!==void 0?n.splice(i.index,0,{...i.item}):n.push({...i.item})}),n}function LP(e,t){switch(e.type){case"select":{t.selected=e.selected;break}case"position":{typeof e.position<"u"&&(t.position=e.position),typeof e.dragging<"u"&&(t.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(t.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(t.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(t.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(t.resizing=e.resizing);break}}}function VP(e,t){return Lv(e,t)}function FP(e,t){return Lv(e,t)}function tr(e,t){return{id:e,type:"select",selected:t}}function qr(e,t=new Set,n=!1){const r=[];for(const[o,i]of e){const s=t.has(o);!(i.selected===void 0&&!s)&&i.selected!==s&&(n&&(i.selected=s),r.push(tr(i.id,s)))}return r}function tm({items:e=[],lookup:t}){var o;const n=[],r=new Map(e.map(i=>[i.id,i]));for(const[i,s]of e.entries()){const a=t.get(s.id),l=((o=a==null?void 0:a.internals)==null?void 0:o.userNode)??a;l!==void 0&&l!==s&&n.push({id:s.id,item:s,type:"replace"}),l===void 0&&n.push({item:s,type:"add",index:i})}for(const[i]of t)r.get(i)===void 0&&n.push({id:i,type:"remove"});return n}function nm(e){return{id:e.id,type:"remove"}}const rm=e=>Yk(e),HP=e=>iv(e);function Vv(e){return A.forwardRef(e)}function om(e){const[t,n]=A.useState(BigInt(0)),[r]=A.useState(()=>BP(()=>n(o=>o+BigInt(1))));return bc(()=>{const o=r.get();o.length&&(e(o),r.reset())},[t]),r}function BP(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const Fv=A.createContext(null);function UP({children:e}){const t=$e(),n=A.useCallback(a=>{const{nodes:l=[],setNodes:u,hasDefaultNodes:d,onNodesChange:c,nodeLookup:f,fitViewQueued:m,onNodesChangeMiddlewareMap:y}=t.getState();let v=l;for(const h of a)v=typeof h=="function"?h(v):h;let w=tm({items:v,lookup:f});for(const h of y.values())w=h(w);d&&u(v),w.length>0?c==null||c(w):m&&window.requestAnimationFrame(()=>{const{fitViewQueued:h,nodes:g,setNodes:p}=t.getState();h&&p(g)})},[]),r=om(n),o=A.useCallback(a=>{const{edges:l=[],setEdges:u,hasDefaultEdges:d,onEdgesChange:c,edgeLookup:f}=t.getState();let m=l;for(const y of a)m=typeof y=="function"?y(m):y;d?u(m):c&&c(tm({items:m,lookup:f}))},[]),i=om(o),s=A.useMemo(()=>({nodeQueue:r,edgeQueue:i}),[]);return $.jsx(Fv.Provider,{value:s,children:e})}function WP(){const e=A.useContext(Fv);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const qP=e=>!!e.panZoom;function Zd(){const e=DP(),t=$e(),n=WP(),r=le(qP),o=A.useMemo(()=>{const i=c=>t.getState().nodeLookup.get(c),s=c=>{n.nodeQueue.push(c)},a=c=>{n.edgeQueue.push(c)},l=c=>{var h,g;const{nodeLookup:f,nodeOrigin:m}=t.getState(),y=rm(c)?c:f.get(c.id),v=y.parentId?dv(y.position,y.measured,y.parentId,f,m):y.position,w={...y,position:v,width:((h=y.measured)==null?void 0:h.width)??y.width,height:((g=y.measured)==null?void 0:g.height)??y.height};return go(w)},u=(c,f,m={replace:!1})=>{s(y=>y.map(v=>{if(v.id===c){const w=typeof f=="function"?f(v):f;return m.replace&&rm(w)?w:{...v,...w}}return v}))},d=(c,f,m={replace:!1})=>{a(y=>y.map(v=>{if(v.id===c){const w=typeof f=="function"?f(v):f;return m.replace&&HP(w)?w:{...v,...w}}return v}))};return{getNodes:()=>t.getState().nodes.map(c=>({...c})),getNode:c=>{var f;return(f=i(c))==null?void 0:f.internals.userNode},getInternalNode:i,getEdges:()=>{const{edges:c=[]}=t.getState();return c.map(f=>({...f}))},getEdge:c=>t.getState().edgeLookup.get(c),setNodes:s,setEdges:a,addNodes:c=>{const f=Array.isArray(c)?c:[c];n.nodeQueue.push(m=>[...m,...f])},addEdges:c=>{const f=Array.isArray(c)?c:[c];n.edgeQueue.push(m=>[...m,...f])},toObject:()=>{const{nodes:c=[],edges:f=[],transform:m}=t.getState(),[y,v,w]=m;return{nodes:c.map(h=>({...h})),edges:f.map(h=>({...h})),viewport:{x:y,y:v,zoom:w}}},deleteElements:async({nodes:c=[],edges:f=[]})=>{const{nodes:m,edges:y,onNodesDelete:v,onEdgesDelete:w,triggerNodeChanges:h,triggerEdgeChanges:g,onDelete:p,onBeforeDelete:_}=t.getState(),{nodes:x,edges:k}=await eN({nodesToRemove:c,edgesToRemove:f,nodes:m,edges:y,onBeforeDelete:_}),P=k.length>0,b=x.length>0;if(P){const F=k.map(nm);w==null||w(k),g(F)}if(b){const F=x.map(nm);v==null||v(x),h(F)}return(b||P)&&(p==null||p({nodes:x,edges:k})),{deletedNodes:x,deletedEdges:k}},getIntersectingNodes:(c,f=!0,m)=>{const y=Ip(c),v=y?c:l(c),w=m!==void 0;return v?(m||t.getState().nodes).filter(h=>{const g=t.getState().nodeLookup.get(h.id);if(g&&!y&&(h.id===c.id||!g.internals.positionAbsolute))return!1;const p=go(w?h:g),_=Oi(p,v);return f&&_>0||_>=p.width*p.height||_>=v.width*v.height}):[]},isNodeIntersecting:(c,f,m=!0)=>{const v=Ip(c)?c:l(c);if(!v)return!1;const w=Oi(v,f);return m&&w>0||w>=f.width*f.height||w>=v.width*v.height},updateNode:u,updateNodeData:(c,f,m={replace:!1})=>{u(c,y=>{const v=typeof f=="function"?f(y):f;return m.replace?{...y,data:v}:{...y,data:{...y.data,...v}}},m)},updateEdge:d,updateEdgeData:(c,f,m={replace:!1})=>{d(c,y=>{const v=typeof f=="function"?f(y):f;return m.replace?{...y,data:v}:{...y,data:{...y.data,...v}}},m)},getNodesBounds:c=>{const{nodeLookup:f,nodeOrigin:m}=t.getState();return Gk(c,{nodeLookup:f,nodeOrigin:m})},getHandleConnections:({type:c,id:f,nodeId:m})=>{var y;return Array.from(((y=t.getState().connectionLookup.get(`${m}-${c}${f?`-${f}`:""}`))==null?void 0:y.values())??[])},getNodeConnections:({type:c,handleId:f,nodeId:m})=>{var y;return Array.from(((y=t.getState().connectionLookup.get(`${m}${c?f?`-${c}-${f}`:`-${c}`:""}`))==null?void 0:y.values())??[])},fitView:async c=>{const f=t.getState().fitViewResolver??oN();return t.setState({fitViewQueued:!0,fitViewOptions:c,fitViewResolver:f}),n.nodeQueue.push(m=>[...m]),f.promise}}},[]);return A.useMemo(()=>({...o,...e,viewportInitialized:r}),[r])}const im=e=>e.selected,KP=typeof window<"u"?window:void 0;function XP({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=$e(),{deleteElements:r}=Zd(),o=Li(e,{actInsideInputWithModifier:!1}),i=Li(t,{target:KP});A.useEffect(()=>{if(o){const{edges:s,nodes:a}=n.getState();r({nodes:a.filter(im),edges:s.filter(im)}),n.setState({nodesSelectionActive:!1})}},[o]),A.useEffect(()=>{n.setState({multiSelectionActive:i})},[i])}function YP(e){const t=$e();A.useEffect(()=>{const n=()=>{var o,i,s,a;if(!e.current||!(((i=(o=e.current).checkVisibility)==null?void 0:i.call(o))??!0))return!1;const r=qd(e.current);(r.height===0||r.width===0)&&((a=(s=t.getState()).onError)==null||a.call(s,"004",Qt.error004())),t.setState({width:r.width||500,height:r.height||500})};if(e.current){n(),window.addEventListener("resize",n);const r=new ResizeObserver(()=>n());return r.observe(e.current),()=>{window.removeEventListener("resize",n),r&&e.current&&r.unobserve(e.current)}}},[])}const _l={position:"absolute",width:"100%",height:"100%",top:0,left:0},GP=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function QP({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:o=.5,panOnScrollMode:i=hr.Free,zoomOnDoubleClick:s=!0,panOnDrag:a=!0,defaultViewport:l,translateExtent:u,minZoom:d,maxZoom:c,zoomActivationKeyCode:f,preventScrolling:m=!0,children:y,noWheelClassName:v,noPanClassName:w,onViewportChange:h,isControlledViewport:g,paneClickDistance:p,selectionOnDrag:_}){const x=$e(),k=A.useRef(null),{userSelectionActive:P,lib:b,connectionInProgress:F}=le(GP,_e),W=Li(f),I=A.useRef();YP(k);const H=A.useCallback(q=>{h==null||h({x:q[0],y:q[1],zoom:q[2]}),g||x.setState({transform:q})},[h,g]);return A.useEffect(()=>{if(k.current){I.current=FN({domNode:k.current,minZoom:d,maxZoom:c,translateExtent:u,viewport:l,onDraggingChange:M=>x.setState(V=>V.paneDragging===M?V:{paneDragging:M}),onPanZoomStart:(M,V)=>{const{onViewportChangeStart:j,onMoveStart:z}=x.getState();z==null||z(M,V),j==null||j(V)},onPanZoom:(M,V)=>{const{onViewportChange:j,onMove:z}=x.getState();z==null||z(M,V),j==null||j(V)},onPanZoomEnd:(M,V)=>{const{onViewportChangeEnd:j,onMoveEnd:z}=x.getState();z==null||z(M,V),j==null||j(V)}});const{x:q,y:E,zoom:O}=I.current.getViewport();return x.setState({panZoom:I.current,transform:[q,E,O],domNode:k.current.closest(".react-flow")}),()=>{var M;(M=I.current)==null||M.destroy()}}},[]),A.useEffect(()=>{var q;(q=I.current)==null||q.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panOnScrollSpeed:o,panOnScrollMode:i,zoomOnDoubleClick:s,panOnDrag:a,zoomActivationKeyPressed:W,preventScrolling:m,noPanClassName:w,userSelectionActive:P,noWheelClassName:v,lib:b,onTransformChange:H,connectionInProgress:F,selectionOnDrag:_,paneClickDistance:p})},[e,t,n,r,o,i,s,a,W,m,w,P,v,b,H,F,_,p]),$.jsx("div",{className:"react-flow__renderer",ref:k,style:_l,children:y})}const ZP=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function JP(){const{userSelectionActive:e,userSelectionRect:t}=le(ZP,_e);return e&&t?$.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}const pu=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},eC=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function tC({isSelecting:e,selectionKeyPressed:t,selectionMode:n=Ai.Full,panOnDrag:r,paneClickDistance:o,selectionOnDrag:i,onSelectionStart:s,onSelectionEnd:a,onPaneClick:l,onPaneContextMenu:u,onPaneScroll:d,onPaneMouseEnter:c,onPaneMouseMove:f,onPaneMouseLeave:m,children:y}){const v=$e(),{userSelectionActive:w,elementsSelectable:h,dragging:g,connectionInProgress:p}=le(eC,_e),_=h&&(e||w),x=A.useRef(null),k=A.useRef(),P=A.useRef(new Set),b=A.useRef(new Set),F=A.useRef(!1),W=j=>{if(F.current||p){F.current=!1;return}l==null||l(j),v.getState().resetSelectedElements(),v.setState({nodesSelectionActive:!1})},I=j=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){j.preventDefault();return}u==null||u(j)},H=d?j=>d(j):void 0,q=j=>{F.current&&(j.stopPropagation(),F.current=!1)},E=j=>{var C,U;const{domNode:z}=v.getState();if(k.current=z==null?void 0:z.getBoundingClientRect(),!k.current)return;const T=j.target===x.current;if(!T&&!!j.target.closest(".nokey")||!e||!(i&&T||t)||j.button!==0||!j.isPrimary)return;(U=(C=j.target)==null?void 0:C.setPointerCapture)==null||U.call(C,j.pointerId),F.current=!1;const{x:D,y:S}=Dt(j.nativeEvent,k.current);v.setState({userSelectionRect:{width:0,height:0,startX:D,startY:S,x:D,y:S}}),T||(j.stopPropagation(),j.preventDefault())},O=j=>{const{userSelectionRect:z,transform:T,nodeLookup:N,edgeLookup:R,connectionLookup:D,triggerNodeChanges:S,triggerEdgeChanges:C,defaultEdgeOptions:U,resetSelectedElements:Y}=v.getState();if(!k.current||!z)return;const{x:X,y:Z}=Dt(j.nativeEvent,k.current),{startX:te,startY:L}=z;if(!F.current){const ne=t?0:o;if(Math.hypot(X-te,Z-L)<=ne)return;Y(),s==null||s(j)}F.current=!0;const B={startX:te,startY:L,x:X<te?X:te,y:Z<L?Z:L,width:Math.abs(X-te),height:Math.abs(Z-L)},K=P.current,G=b.current;P.current=new Set(Ud(N,B,T,n===Ai.Partial,!0).map(ne=>ne.id)),b.current=new Set;const J=(U==null?void 0:U.selectable)??!0;for(const ne of P.current){const ue=D.get(ne);if(ue)for(const{edgeId:je}of ue.values()){const ve=R.get(je);ve&&(ve.selectable??J)&&b.current.add(je)}}if(!Rp(K,P.current)){const ne=qr(N,P.current,!0);S(ne)}if(!Rp(G,b.current)){const ne=qr(R,b.current);C(ne)}v.setState({userSelectionRect:B,userSelectionActive:!0,nodesSelectionActive:!1})},M=j=>{var z,T;j.button===0&&((T=(z=j.target)==null?void 0:z.releasePointerCapture)==null||T.call(z,j.pointerId),!w&&j.target===x.current&&v.getState().userSelectionRect&&(W==null||W(j)),v.setState({userSelectionActive:!1,userSelectionRect:null}),F.current&&(a==null||a(j),v.setState({nodesSelectionActive:P.current.size>0})))},V=r===!0||Array.isArray(r)&&r.includes(0);return $.jsxs("div",{className:Te(["react-flow__pane",{draggable:V,dragging:g,selection:e}]),onClick:_?void 0:pu(W,x),onContextMenu:pu(I,x),onWheel:pu(H,x),onPointerEnter:_?void 0:c,onPointerMove:_?O:f,onPointerUp:_?M:void 0,onPointerDownCapture:_?E:void 0,onClickCapture:_?q:void 0,onPointerLeave:m,ref:x,style:_l,children:[y,$.jsx(JP,{})]})}function jc({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:o,unselectNodesAndEdges:i,multiSelectionActive:s,nodeLookup:a,onError:l}=t.getState(),u=a.get(e);if(!u){l==null||l("012",Qt.error012(e));return}t.setState({nodesSelectionActive:!1}),u.selected?(n||u.selected&&s)&&(i({nodes:[u],edges:[]}),requestAnimationFrame(()=>{var d;return(d=r==null?void 0:r.current)==null?void 0:d.blur()})):o([e])}function Hv({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:o,isSelectable:i,nodeClickDistance:s}){const a=$e(),[l,u]=A.useState(!1),d=A.useRef();return A.useEffect(()=>{d.current=PN({getStoreItems:()=>a.getState(),onNodeMouseDown:c=>{jc({id:c,store:a,nodeRef:e})},onDragStart:()=>{u(!0)},onDragStop:()=>{u(!1)}})},[]),A.useEffect(()=>{if(!(t||!e.current||!d.current))return d.current.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:i,nodeId:o,nodeClickDistance:s}),()=>{var c;(c=d.current)==null||c.destroy()}},[n,r,t,i,e,o,s]),l}const nC=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function Bv(){const e=$e();return A.useCallback(n=>{const{nodeExtent:r,snapToGrid:o,snapGrid:i,nodesDraggable:s,onError:a,updateNodePositions:l,nodeLookup:u,nodeOrigin:d}=e.getState(),c=new Map,f=nC(s),m=o?i[0]:5,y=o?i[1]:5,v=n.direction.x*m*n.factor,w=n.direction.y*y*n.factor;for(const[,h]of u){if(!f(h))continue;let g={x:h.internals.positionAbsolute.x+v,y:h.internals.positionAbsolute.y+w};o&&(g=Qi(g,i));const{position:p,positionAbsolute:_}=sv({nodeId:h.id,nextPosition:g,nodeLookup:u,nodeExtent:r,nodeOrigin:d,onError:a});h.position=p,h.internals.positionAbsolute=_,c.set(h.id,h)}l(c)},[])}const Jd=A.createContext(null),rC=Jd.Provider;Jd.Consumer;const Uv=()=>A.useContext(Jd),oC=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),iC=(e,t,n)=>r=>{const{connectionClickStartHandle:o,connectionMode:i,connection:s}=r,{fromHandle:a,toHandle:l,isValid:u}=s,d=(l==null?void 0:l.nodeId)===e&&(l==null?void 0:l.id)===t&&(l==null?void 0:l.type)===n;return{connectingFrom:(a==null?void 0:a.nodeId)===e&&(a==null?void 0:a.id)===t&&(a==null?void 0:a.type)===n,connectingTo:d,clickConnecting:(o==null?void 0:o.nodeId)===e&&(o==null?void 0:o.id)===t&&(o==null?void 0:o.type)===n,isPossibleEndHandle:i===po.Strict?(a==null?void 0:a.type)!==n:e!==(a==null?void 0:a.nodeId)||t!==(a==null?void 0:a.id),connectionInProcess:!!a,clickConnectionInProcess:!!o,valid:d&&u}};function sC({type:e="source",position:t=oe.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:o=!0,isConnectableEnd:i=!0,id:s,onConnect:a,children:l,className:u,onMouseDown:d,onTouchStart:c,...f},m){var O,M;const y=s||null,v=e==="target",w=$e(),h=Uv(),{connectOnClick:g,noPanClassName:p,rfId:_}=le(oC,_e),{connectingFrom:x,connectingTo:k,clickConnecting:P,isPossibleEndHandle:b,connectionInProcess:F,clickConnectionInProcess:W,valid:I}=le(iC(h,y,e),_e);h||(M=(O=w.getState()).onError)==null||M.call(O,"010",Qt.error010());const H=V=>{const{defaultEdgeOptions:j,onConnect:z,hasDefaultEdges:T}=w.getState(),N={...j,...V};if(T){const{edges:R,setEdges:D}=w.getState();D(dN(N,R))}z==null||z(N),a==null||a(N)},q=V=>{if(!h)return;const j=pv(V.nativeEvent);if(o&&(j&&V.button===0||!j)){const z=w.getState();Cc.onPointerDown(V.nativeEvent,{handleDomNode:V.currentTarget,autoPanOnConnect:z.autoPanOnConnect,connectionMode:z.connectionMode,connectionRadius:z.connectionRadius,domNode:z.domNode,nodeLookup:z.nodeLookup,lib:z.lib,isTarget:v,handleId:y,nodeId:h,flowId:z.rfId,panBy:z.panBy,cancelConnection:z.cancelConnection,onConnectStart:z.onConnectStart,onConnectEnd:(...T)=>{var N,R;return(R=(N=w.getState()).onConnectEnd)==null?void 0:R.call(N,...T)},updateConnection:z.updateConnection,onConnect:H,isValidConnection:n||((...T)=>{var N,R;return((R=(N=w.getState()).isValidConnection)==null?void 0:R.call(N,...T))??!0}),getTransform:()=>w.getState().transform,getFromHandle:()=>w.getState().connection.fromHandle,autoPanSpeed:z.autoPanSpeed,dragThreshold:z.connectionDragThreshold})}j?d==null||d(V):c==null||c(V)},E=V=>{const{onClickConnectStart:j,onClickConnectEnd:z,connectionClickStartHandle:T,connectionMode:N,isValidConnection:R,lib:D,rfId:S,nodeLookup:C,connection:U}=w.getState();if(!h||!T&&!o)return;if(!T){j==null||j(V.nativeEvent,{nodeId:h,handleId:y,handleType:e}),w.setState({connectionClickStartHandle:{nodeId:h,type:e,id:y}});return}const Y=fv(V.target),X=n||R,{connection:Z,isValid:te}=Cc.isValid(V.nativeEvent,{handle:{nodeId:h,id:y,type:e},connectionMode:N,fromNodeId:T.nodeId,fromHandleId:T.id||null,fromType:T.type,isValidConnection:X,flowId:S,doc:Y,lib:D,nodeLookup:C});te&&Z&&H(Z);const L=structuredClone(U);delete L.inProgress,L.toPosition=L.toHandle?L.toHandle.position:null,z==null||z(V,L),w.setState({connectionClickStartHandle:null})};return $.jsx("div",{"data-handleid":y,"data-nodeid":h,"data-handlepos":t,"data-id":`${_}-${h}-${y}-${e}`,className:Te(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",p,u,{source:!v,target:v,connectable:r,connectablestart:o,connectableend:i,clickconnecting:P,connectingfrom:x,connectingto:k,valid:I,connectionindicator:r&&(!F||b)&&(F||W?i:o)}]),onMouseDown:q,onTouchStart:q,onClick:g?E:void 0,ref:m,...f,children:l})}const In=A.memo(Vv(sC));function aC({data:e,isConnectable:t,sourcePosition:n=oe.Bottom}){return $.jsxs($.Fragment,{children:[e==null?void 0:e.label,$.jsx(In,{type:"source",position:n,isConnectable:t})]})}function lC({data:e,isConnectable:t,targetPosition:n=oe.Top,sourcePosition:r=oe.Bottom}){return $.jsxs($.Fragment,{children:[$.jsx(In,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,$.jsx(In,{type:"source",position:r,isConnectable:t})]})}function uC(){return null}function cC({data:e,isConnectable:t,targetPosition:n=oe.Top}){return $.jsxs($.Fragment,{children:[$.jsx(In,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const La={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},sm={input:aC,default:lC,output:cC,group:uC};function dC(e){var t,n,r,o;return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??((t=e.style)==null?void 0:t.width),height:e.height??e.initialHeight??((n=e.style)==null?void 0:n.height)}:{width:e.width??((r=e.style)==null?void 0:r.width),height:e.height??((o=e.style)==null?void 0:o.height)}}const fC=e=>{const{width:t,height:n,x:r,y:o}=Gi(e.nodeLookup,{filter:i=>!!i.selected});return{width:Ot(t)?t:null,height:Ot(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${o}px)`}};function hC({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=$e(),{width:o,height:i,transformString:s,userSelectionActive:a}=le(fC,_e),l=Bv(),u=A.useRef(null);A.useEffect(()=>{var m;n||(m=u.current)==null||m.focus({preventScroll:!0})},[n]);const d=!a&&o!==null&&i!==null;if(Hv({nodeRef:u,disabled:!d}),!d)return null;const c=e?m=>{const y=r.getState().nodes.filter(v=>v.selected);e(m,y)}:void 0,f=m=>{Object.prototype.hasOwnProperty.call(La,m.key)&&(m.preventDefault(),l({direction:La[m.key],factor:m.shiftKey?4:1}))};return $.jsx("div",{className:Te(["react-flow__nodesselection","react-flow__container",t]),style:{transform:s},children:$.jsx("div",{ref:u,className:"react-flow__nodesselection-rect",onContextMenu:c,tabIndex:n?void 0:-1,onKeyDown:n?void 0:f,style:{width:o,height:i}})})}const am=typeof window<"u"?window:void 0,pC=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function Wv({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:o,onPaneContextMenu:i,onPaneScroll:s,paneClickDistance:a,deleteKeyCode:l,selectionKeyCode:u,selectionOnDrag:d,selectionMode:c,onSelectionStart:f,onSelectionEnd:m,multiSelectionKeyCode:y,panActivationKeyCode:v,zoomActivationKeyCode:w,elementsSelectable:h,zoomOnScroll:g,zoomOnPinch:p,panOnScroll:_,panOnScrollSpeed:x,panOnScrollMode:k,zoomOnDoubleClick:P,panOnDrag:b,defaultViewport:F,translateExtent:W,minZoom:I,maxZoom:H,preventScrolling:q,onSelectionContextMenu:E,noWheelClassName:O,noPanClassName:M,disableKeyboardA11y:V,onViewportChange:j,isControlledViewport:z}){const{nodesSelectionActive:T,userSelectionActive:N}=le(pC,_e),R=Li(u,{target:am}),D=Li(v,{target:am}),S=D||b,C=D||_,U=d&&S!==!0,Y=R||N||U;return XP({deleteKeyCode:l,multiSelectionKeyCode:y}),$.jsx(QP,{onPaneContextMenu:i,elementsSelectable:h,zoomOnScroll:g,zoomOnPinch:p,panOnScroll:C,panOnScrollSpeed:x,panOnScrollMode:k,zoomOnDoubleClick:P,panOnDrag:!R&&S,defaultViewport:F,translateExtent:W,minZoom:I,maxZoom:H,zoomActivationKeyCode:w,preventScrolling:q,noWheelClassName:O,noPanClassName:M,onViewportChange:j,isControlledViewport:z,paneClickDistance:a,selectionOnDrag:U,children:$.jsxs(tC,{onSelectionStart:f,onSelectionEnd:m,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:o,onPaneContextMenu:i,onPaneScroll:s,panOnDrag:S,isSelecting:!!Y,selectionMode:c,selectionKeyPressed:R,paneClickDistance:a,selectionOnDrag:U,children:[e,T&&$.jsx(hC,{onSelectionContextMenu:E,noPanClassName:M,disableKeyboardA11y:V})]})})}Wv.displayName="FlowRenderer";const mC=A.memo(Wv),gC=e=>t=>e?Ud(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(n=>n.id):Array.from(t.nodeLookup.keys());function yC(e){return le(A.useCallback(gC(e),[e]),_e)}const vC=e=>e.updateNodeInternals;function wC(){const e=le(vC),[t]=A.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const r=new Map;n.forEach(o=>{const i=o.target.getAttribute("data-id");r.set(i,{id:i,nodeElement:o.target,force:!0})}),e(r)}));return A.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function _C({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){const o=$e(),i=A.useRef(null),s=A.useRef(null),a=A.useRef(e.sourcePosition),l=A.useRef(e.targetPosition),u=A.useRef(t),d=n&&!!e.internals.handleBounds;return A.useEffect(()=>{i.current&&!e.hidden&&(!d||s.current!==i.current)&&(s.current&&(r==null||r.unobserve(s.current)),r==null||r.observe(i.current),s.current=i.current)},[d,e.hidden]),A.useEffect(()=>()=>{s.current&&(r==null||r.unobserve(s.current),s.current=null)},[]),A.useEffect(()=>{if(i.current){const c=u.current!==t,f=a.current!==e.sourcePosition,m=l.current!==e.targetPosition;(c||f||m)&&(u.current=t,a.current=e.sourcePosition,l.current=e.targetPosition,o.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:i.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),i}function $C({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:o,onContextMenu:i,onDoubleClick:s,nodesDraggable:a,elementsSelectable:l,nodesConnectable:u,nodesFocusable:d,resizeObserver:c,noDragClassName:f,noPanClassName:m,disableKeyboardA11y:y,rfId:v,nodeTypes:w,nodeClickDistance:h,onError:g}){const{node:p,internals:_,isParent:x}=le(X=>{const Z=X.nodeLookup.get(e),te=X.parentLookup.has(e);return{node:Z,internals:Z.internals,isParent:te}},_e);let k=p.type||"default",P=(w==null?void 0:w[k])||sm[k];P===void 0&&(g==null||g("003",Qt.error003(k)),k="default",P=(w==null?void 0:w.default)||sm.default);const b=!!(p.draggable||a&&typeof p.draggable>"u"),F=!!(p.selectable||l&&typeof p.selectable>"u"),W=!!(p.connectable||u&&typeof p.connectable>"u"),I=!!(p.focusable||d&&typeof p.focusable>"u"),H=$e(),q=cv(p),E=_C({node:p,nodeType:k,hasDimensions:q,resizeObserver:c}),O=Hv({nodeRef:E,disabled:p.hidden||!b,noDragClassName:f,handleSelector:p.dragHandle,nodeId:e,isSelectable:F,nodeClickDistance:h}),M=Bv();if(p.hidden)return null;const V=wn(p),j=dC(p),z=F||b||t||n||r||o,T=n?X=>n(X,{..._.userNode}):void 0,N=r?X=>r(X,{..._.userNode}):void 0,R=o?X=>o(X,{..._.userNode}):void 0,D=i?X=>i(X,{..._.userNode}):void 0,S=s?X=>s(X,{..._.userNode}):void 0,C=X=>{const{selectNodesOnDrag:Z,nodeDragThreshold:te}=H.getState();F&&(!Z||!b||te>0)&&jc({id:e,store:H,nodeRef:E}),t&&t(X,{..._.userNode})},U=X=>{if(!(hv(X.nativeEvent)||y)){if(tv.includes(X.key)&&F){const Z=X.key==="Escape";jc({id:e,store:H,unselect:Z,nodeRef:E})}else if(b&&p.selected&&Object.prototype.hasOwnProperty.call(La,X.key)){X.preventDefault();const{ariaLabelConfig:Z}=H.getState();H.setState({ariaLiveMessage:Z["node.a11yDescription.ariaLiveMessage"]({direction:X.key.replace("Arrow","").toLowerCase(),x:~~_.positionAbsolute.x,y:~~_.positionAbsolute.y})}),M({direction:La[X.key],factor:X.shiftKey?4:1})}}},Y=()=>{var G;if(y||!((G=E.current)!=null&&G.matches(":focus-visible")))return;const{transform:X,width:Z,height:te,autoPanOnNodeFocus:L,setCenter:B}=H.getState();if(!L)return;Ud(new Map([[e,p]]),{x:0,y:0,width:Z,height:te},X,!0).length>0||B(p.position.x+V.width/2,p.position.y+V.height/2,{zoom:X[2]})};return $.jsx("div",{className:Te(["react-flow__node",`react-flow__node-${k}`,{[m]:b},p.className,{selected:p.selected,selectable:F,parent:x,draggable:b,dragging:O}]),ref:E,style:{zIndex:_.z,transform:`translate(${_.positionAbsolute.x}px,${_.positionAbsolute.y}px)`,pointerEvents:z?"all":"none",visibility:q?"visible":"hidden",...p.style,...j},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:T,onMouseMove:N,onMouseLeave:R,onContextMenu:D,onClick:C,onDoubleClick:S,onKeyDown:I?U:void 0,tabIndex:I?0:void 0,onFocus:I?Y:void 0,role:p.ariaRole??(I?"group":void 0),"aria-roledescription":"node","aria-describedby":y?void 0:`${Av}-${v}`,"aria-label":p.ariaLabel,...p.domAttributes,children:$.jsx(rC,{value:e,children:$.jsx(P,{id:e,data:p.data,type:k,positionAbsoluteX:_.positionAbsolute.x,positionAbsoluteY:_.positionAbsolute.y,selected:p.selected??!1,selectable:F,draggable:b,deletable:p.deletable??!0,isConnectable:W,sourcePosition:p.sourcePosition,targetPosition:p.targetPosition,dragging:O,dragHandle:p.dragHandle,zIndex:_.z,parentId:p.parentId,...V})})})}var xC=A.memo($C);const SC=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function qv(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:o,onError:i}=le(SC,_e),s=yC(e.onlyRenderVisibleElements),a=wC();return $.jsx("div",{className:"react-flow__nodes",style:_l,children:s.map(l=>$.jsx(xC,{id:l,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:a,nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:o,nodeClickDistance:e.nodeClickDistance,onError:i},l))})}qv.displayName="NodeRenderer";const EC=A.memo(qv);function kC(e){return le(A.useCallback(n=>{if(!e)return n.edges.map(o=>o.id);const r=[];if(n.width&&n.height)for(const o of n.edges){const i=n.nodeLookup.get(o.source),s=n.nodeLookup.get(o.target);i&&s&&lN({sourceNode:i,targetNode:s,width:n.width,height:n.height,transform:n.transform})&&r.push(o.id)}return r},[e]),_e)}const NC=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return $.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},PC=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return $.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},lm={[Aa.Arrow]:NC,[Aa.ArrowClosed]:PC};function CC(e){const t=$e();return A.useMemo(()=>{var o,i;return Object.prototype.hasOwnProperty.call(lm,e)?lm[e]:((i=(o=t.getState()).onError)==null||i.call(o,"009",Qt.error009(e)),null)},[e])}const bC=({id:e,type:t,color:n,width:r=12.5,height:o=12.5,markerUnits:i="strokeWidth",strokeWidth:s,orient:a="auto-start-reverse"})=>{const l=CC(t);return l?$.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${o}`,viewBox:"-10 -10 20 20",markerUnits:i,orient:a,refX:"0",refY:"0",children:$.jsx(l,{color:n,strokeWidth:s})}):null},Kv=({defaultColor:e,rfId:t})=>{const n=le(i=>i.edges),r=le(i=>i.defaultEdgeOptions),o=A.useMemo(()=>gN(n,{id:t,defaultColor:e,defaultMarkerStart:r==null?void 0:r.markerStart,defaultMarkerEnd:r==null?void 0:r.markerEnd}),[n,r,t,e]);return o.length?$.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:$.jsx("defs",{children:o.map(i=>$.jsx(bC,{id:i.id,type:i.type,color:i.color,width:i.width,height:i.height,markerUnits:i.markerUnits,strokeWidth:i.strokeWidth,orient:i.orient},i.id))})}):null};Kv.displayName="MarkerDefinitions";var jC=A.memo(Kv);function Xv({x:e,y:t,label:n,labelStyle:r,labelShowBg:o=!0,labelBgStyle:i,labelBgPadding:s=[2,4],labelBgBorderRadius:a=2,children:l,className:u,...d}){const[c,f]=A.useState({x:1,y:0,width:0,height:0}),m=Te(["react-flow__edge-textwrapper",u]),y=A.useRef(null);return A.useEffect(()=>{if(y.current){const v=y.current.getBBox();f({x:v.x,y:v.y,width:v.width,height:v.height})}},[n]),n?$.jsxs("g",{transform:`translate(${e-c.width/2} ${t-c.height/2})`,className:m,visibility:c.width?"visible":"hidden",...d,children:[o&&$.jsx("rect",{width:c.width+2*s[0],x:-s[0],y:-s[1],height:c.height+2*s[1],className:"react-flow__edge-textbg",style:i,rx:a,ry:a}),$.jsx("text",{className:"react-flow__edge-text",y:c.height/2,dy:"0.3em",ref:y,style:r,children:n}),l]}):null}Xv.displayName="EdgeText";const MC=A.memo(Xv);function Eo({path:e,labelX:t,labelY:n,label:r,labelStyle:o,labelShowBg:i,labelBgStyle:s,labelBgPadding:a,labelBgBorderRadius:l,interactionWidth:u=20,...d}){return $.jsxs($.Fragment,{children:[$.jsx("path",{...d,d:e,fill:"none",className:Te(["react-flow__edge-path",d.className])}),u?$.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:u,className:"react-flow__edge-interaction"}):null,r&&Ot(t)&&Ot(n)?$.jsx(MC,{x:t,y:n,label:r,labelStyle:o,labelShowBg:i,labelBgStyle:s,labelBgPadding:a,labelBgBorderRadius:l}):null]})}function um({pos:e,x1:t,y1:n,x2:r,y2:o}){return e===oe.Left||e===oe.Right?[.5*(t+r),n]:[t,.5*(n+o)]}function Yv({sourceX:e,sourceY:t,sourcePosition:n=oe.Bottom,targetX:r,targetY:o,targetPosition:i=oe.Top}){const[s,a]=um({pos:n,x1:e,y1:t,x2:r,y2:o}),[l,u]=um({pos:i,x1:r,y1:o,x2:e,y2:t}),[d,c,f,m]=mv({sourceX:e,sourceY:t,targetX:r,targetY:o,sourceControlX:s,sourceControlY:a,targetControlX:l,targetControlY:u});return[`M${e},${t} C${s},${a} ${l},${u} ${r},${o}`,d,c,f,m]}function Gv(e){return A.memo(({id:t,sourceX:n,sourceY:r,targetX:o,targetY:i,sourcePosition:s,targetPosition:a,label:l,labelStyle:u,labelShowBg:d,labelBgStyle:c,labelBgPadding:f,labelBgBorderRadius:m,style:y,markerEnd:v,markerStart:w,interactionWidth:h})=>{const[g,p,_]=Yv({sourceX:n,sourceY:r,sourcePosition:s,targetX:o,targetY:i,targetPosition:a}),x=e.isInternal?void 0:t;return $.jsx(Eo,{id:x,path:g,labelX:p,labelY:_,label:l,labelStyle:u,labelShowBg:d,labelBgStyle:c,labelBgPadding:f,labelBgBorderRadius:m,style:y,markerEnd:v,markerStart:w,interactionWidth:h})})}const TC=Gv({isInternal:!1}),Qv=Gv({isInternal:!0});TC.displayName="SimpleBezierEdge";Qv.displayName="SimpleBezierEdgeInternal";function Zv(e){return A.memo(({id:t,sourceX:n,sourceY:r,targetX:o,targetY:i,label:s,labelStyle:a,labelShowBg:l,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:c,style:f,sourcePosition:m=oe.Bottom,targetPosition:y=oe.Top,markerEnd:v,markerStart:w,pathOptions:h,interactionWidth:g})=>{const[p,_,x]=kc({sourceX:n,sourceY:r,sourcePosition:m,targetX:o,targetY:i,targetPosition:y,borderRadius:h==null?void 0:h.borderRadius,offset:h==null?void 0:h.offset,stepPosition:h==null?void 0:h.stepPosition}),k=e.isInternal?void 0:t;return $.jsx(Eo,{id:k,path:p,labelX:_,labelY:x,label:s,labelStyle:a,labelShowBg:l,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:c,style:f,markerEnd:v,markerStart:w,interactionWidth:g})})}const Jv=Zv({isInternal:!1}),e1=Zv({isInternal:!0});Jv.displayName="SmoothStepEdge";e1.displayName="SmoothStepEdgeInternal";function t1(e){return A.memo(({id:t,...n})=>{var o;const r=e.isInternal?void 0:t;return $.jsx(Jv,{...n,id:r,pathOptions:A.useMemo(()=>{var i;return{borderRadius:0,offset:(i=n.pathOptions)==null?void 0:i.offset}},[(o=n.pathOptions)==null?void 0:o.offset])})})}const IC=t1({isInternal:!1}),n1=t1({isInternal:!0});IC.displayName="StepEdge";n1.displayName="StepEdgeInternal";function r1(e){return A.memo(({id:t,sourceX:n,sourceY:r,targetX:o,targetY:i,label:s,labelStyle:a,labelShowBg:l,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:c,style:f,markerEnd:m,markerStart:y,interactionWidth:v})=>{const[w,h,g]=vv({sourceX:n,sourceY:r,targetX:o,targetY:i}),p=e.isInternal?void 0:t;return $.jsx(Eo,{id:p,path:w,labelX:h,labelY:g,label:s,labelStyle:a,labelShowBg:l,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:c,style:f,markerEnd:m,markerStart:y,interactionWidth:v})})}const RC=r1({isInternal:!1}),o1=r1({isInternal:!0});RC.displayName="StraightEdge";o1.displayName="StraightEdgeInternal";function i1(e){return A.memo(({id:t,sourceX:n,sourceY:r,targetX:o,targetY:i,sourcePosition:s=oe.Bottom,targetPosition:a=oe.Top,label:l,labelStyle:u,labelShowBg:d,labelBgStyle:c,labelBgPadding:f,labelBgBorderRadius:m,style:y,markerEnd:v,markerStart:w,pathOptions:h,interactionWidth:g})=>{const[p,_,x]=gv({sourceX:n,sourceY:r,sourcePosition:s,targetX:o,targetY:i,targetPosition:a,curvature:h==null?void 0:h.curvature}),k=e.isInternal?void 0:t;return $.jsx(Eo,{id:k,path:p,labelX:_,labelY:x,label:l,labelStyle:u,labelShowBg:d,labelBgStyle:c,labelBgPadding:f,labelBgBorderRadius:m,style:y,markerEnd:v,markerStart:w,interactionWidth:g})})}const zC=i1({isInternal:!1}),s1=i1({isInternal:!0});zC.displayName="BezierEdge";s1.displayName="BezierEdgeInternal";const cm={default:s1,straight:o1,step:n1,smoothstep:e1,simplebezier:Qv},dm={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},AC=(e,t,n)=>n===oe.Left?e-t:n===oe.Right?e+t:e,OC=(e,t,n)=>n===oe.Top?e-t:n===oe.Bottom?e+t:e,fm="react-flow__edgeupdater";function hm({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:o,onMouseEnter:i,onMouseOut:s,type:a}){return $.jsx("circle",{onMouseDown:o,onMouseEnter:i,onMouseOut:s,className:Te([fm,`${fm}-${a}`]),cx:AC(t,r,e),cy:OC(n,r,e),r,stroke:"transparent",fill:"transparent"})}function DC({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:o,targetX:i,targetY:s,sourcePosition:a,targetPosition:l,onReconnect:u,onReconnectStart:d,onReconnectEnd:c,setReconnecting:f,setUpdateHover:m}){const y=$e(),v=(_,x)=>{if(_.button!==0)return;const{autoPanOnConnect:k,domNode:P,connectionMode:b,connectionRadius:F,lib:W,onConnectStart:I,cancelConnection:H,nodeLookup:q,rfId:E,panBy:O,updateConnection:M}=y.getState(),V=x.type==="target",j=(N,R)=>{f(!1),c==null||c(N,n,x.type,R)},z=N=>u==null?void 0:u(n,N),T=(N,R)=>{f(!0),d==null||d(_,n,x.type),I==null||I(N,R)};Cc.onPointerDown(_.nativeEvent,{autoPanOnConnect:k,connectionMode:b,connectionRadius:F,domNode:P,handleId:x.id,nodeId:x.nodeId,nodeLookup:q,isTarget:V,edgeUpdaterType:x.type,lib:W,flowId:E,cancelConnection:H,panBy:O,isValidConnection:(...N)=>{var R,D;return((D=(R=y.getState()).isValidConnection)==null?void 0:D.call(R,...N))??!0},onConnect:z,onConnectStart:T,onConnectEnd:(...N)=>{var R,D;return(D=(R=y.getState()).onConnectEnd)==null?void 0:D.call(R,...N)},onReconnectEnd:j,updateConnection:M,getTransform:()=>y.getState().transform,getFromHandle:()=>y.getState().connection.fromHandle,dragThreshold:y.getState().connectionDragThreshold,handleDomNode:_.currentTarget})},w=_=>v(_,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),h=_=>v(_,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),g=()=>m(!0),p=()=>m(!1);return $.jsxs($.Fragment,{children:[(e===!0||e==="source")&&$.jsx(hm,{position:a,centerX:r,centerY:o,radius:t,onMouseDown:w,onMouseEnter:g,onMouseOut:p,type:"source"}),(e===!0||e==="target")&&$.jsx(hm,{position:l,centerX:i,centerY:s,radius:t,onMouseDown:h,onMouseEnter:g,onMouseOut:p,type:"target"})]})}function LC({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:o,onDoubleClick:i,onContextMenu:s,onMouseEnter:a,onMouseMove:l,onMouseLeave:u,reconnectRadius:d,onReconnect:c,onReconnectStart:f,onReconnectEnd:m,rfId:y,edgeTypes:v,noPanClassName:w,onError:h,disableKeyboardA11y:g}){let p=le(B=>B.edgeLookup.get(e));const _=le(B=>B.defaultEdgeOptions);p=_?{..._,...p}:p;let x=p.type||"default",k=(v==null?void 0:v[x])||cm[x];k===void 0&&(h==null||h("011",Qt.error011(x)),x="default",k=(v==null?void 0:v.default)||cm.default);const P=!!(p.focusable||t&&typeof p.focusable>"u"),b=typeof c<"u"&&(p.reconnectable||n&&typeof p.reconnectable>"u"),F=!!(p.selectable||r&&typeof p.selectable>"u"),W=A.useRef(null),[I,H]=A.useState(!1),[q,E]=A.useState(!1),O=$e(),{zIndex:M,sourceX:V,sourceY:j,targetX:z,targetY:T,sourcePosition:N,targetPosition:R}=le(A.useCallback(B=>{const K=B.nodeLookup.get(p.source),G=B.nodeLookup.get(p.target);if(!K||!G)return{zIndex:p.zIndex,...dm};const J=mN({id:e,sourceNode:K,targetNode:G,sourceHandle:p.sourceHandle||null,targetHandle:p.targetHandle||null,connectionMode:B.connectionMode,onError:h});return{zIndex:aN({selected:p.selected,zIndex:p.zIndex,sourceNode:K,targetNode:G,elevateOnSelect:B.elevateEdgesOnSelect,zIndexMode:B.zIndexMode}),...J||dm}},[p.source,p.target,p.sourceHandle,p.targetHandle,p.selected,p.zIndex]),_e),D=A.useMemo(()=>p.markerStart?`url('#${Nc(p.markerStart,y)}')`:void 0,[p.markerStart,y]),S=A.useMemo(()=>p.markerEnd?`url('#${Nc(p.markerEnd,y)}')`:void 0,[p.markerEnd,y]);if(p.hidden||V===null||j===null||z===null||T===null)return null;const C=B=>{var ne;const{addSelectedEdges:K,unselectNodesAndEdges:G,multiSelectionActive:J}=O.getState();F&&(O.setState({nodesSelectionActive:!1}),p.selected&&J?(G({nodes:[],edges:[p]}),(ne=W.current)==null||ne.blur()):K([e])),o&&o(B,p)},U=i?B=>{i(B,{...p})}:void 0,Y=s?B=>{s(B,{...p})}:void 0,X=a?B=>{a(B,{...p})}:void 0,Z=l?B=>{l(B,{...p})}:void 0,te=u?B=>{u(B,{...p})}:void 0,L=B=>{var K;if(!g&&tv.includes(B.key)&&F){const{unselectNodesAndEdges:G,addSelectedEdges:J}=O.getState();B.key==="Escape"?((K=W.current)==null||K.blur(),G({edges:[p]})):J([e])}};return $.jsx("svg",{style:{zIndex:M},children:$.jsxs("g",{className:Te(["react-flow__edge",`react-flow__edge-${x}`,p.className,w,{selected:p.selected,animated:p.animated,inactive:!F&&!o,updating:I,selectable:F}]),onClick:C,onDoubleClick:U,onContextMenu:Y,onMouseEnter:X,onMouseMove:Z,onMouseLeave:te,onKeyDown:P?L:void 0,tabIndex:P?0:void 0,role:p.ariaRole??(P?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":p.ariaLabel===null?void 0:p.ariaLabel||`Edge from ${p.source} to ${p.target}`,"aria-describedby":P?`${Ov}-${y}`:void 0,ref:W,...p.domAttributes,children:[!q&&$.jsx(k,{id:e,source:p.source,target:p.target,type:p.type,selected:p.selected,animated:p.animated,selectable:F,deletable:p.deletable??!0,label:p.label,labelStyle:p.labelStyle,labelShowBg:p.labelShowBg,labelBgStyle:p.labelBgStyle,labelBgPadding:p.labelBgPadding,labelBgBorderRadius:p.labelBgBorderRadius,sourceX:V,sourceY:j,targetX:z,targetY:T,sourcePosition:N,targetPosition:R,data:p.data,style:p.style,sourceHandleId:p.sourceHandle,targetHandleId:p.targetHandle,markerStart:D,markerEnd:S,pathOptions:"pathOptions"in p?p.pathOptions:void 0,interactionWidth:p.interactionWidth}),b&&$.jsx(DC,{edge:p,isReconnectable:b,reconnectRadius:d,onReconnect:c,onReconnectStart:f,onReconnectEnd:m,sourceX:V,sourceY:j,targetX:z,targetY:T,sourcePosition:N,targetPosition:R,setUpdateHover:H,setReconnecting:E})]})})}var VC=A.memo(LC);const FC=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function a1({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:o,onReconnect:i,onEdgeContextMenu:s,onEdgeMouseEnter:a,onEdgeMouseMove:l,onEdgeMouseLeave:u,onEdgeClick:d,reconnectRadius:c,onEdgeDoubleClick:f,onReconnectStart:m,onReconnectEnd:y,disableKeyboardA11y:v}){const{edgesFocusable:w,edgesReconnectable:h,elementsSelectable:g,onError:p}=le(FC,_e),_=kC(t);return $.jsxs("div",{className:"react-flow__edges",children:[$.jsx(jC,{defaultColor:e,rfId:n}),_.map(x=>$.jsx(VC,{id:x,edgesFocusable:w,edgesReconnectable:h,elementsSelectable:g,noPanClassName:o,onReconnect:i,onContextMenu:s,onMouseEnter:a,onMouseMove:l,onMouseLeave:u,onClick:d,reconnectRadius:c,onDoubleClick:f,onReconnectStart:m,onReconnectEnd:y,rfId:n,onError:p,edgeTypes:r,disableKeyboardA11y:v},x))]})}a1.displayName="EdgeRenderer";const HC=A.memo(a1),BC=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function UC({children:e}){const t=le(BC);return $.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function WC(e){const t=Zd(),n=A.useRef(!1);A.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const qC=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function KC(e){const t=le(qC),n=$e();return A.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function XC(e){return e.connection.inProgress?{...e.connection,to:Zi(e.connection.to,e.transform)}:{...e.connection}}function YC(e){return XC}function GC(e){const t=YC();return le(t,_e)}const QC=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function ZC({containerStyle:e,style:t,type:n,component:r}){const{nodesConnectable:o,width:i,height:s,isValid:a,inProgress:l}=le(QC,_e);return!(i&&o&&l)?null:$.jsx("svg",{style:e,width:i,height:s,className:"react-flow__connectionline react-flow__container",children:$.jsx("g",{className:Te(["react-flow__connection",ov(a)]),children:$.jsx(l1,{style:t,type:n,CustomComponent:r,isValid:a})})})}const l1=({style:e,type:t=jn.Bezier,CustomComponent:n,isValid:r})=>{const{inProgress:o,from:i,fromNode:s,fromHandle:a,fromPosition:l,to:u,toNode:d,toHandle:c,toPosition:f,pointer:m}=GC();if(!o)return;if(n)return $.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:s,fromHandle:a,fromX:i.x,fromY:i.y,toX:u.x,toY:u.y,fromPosition:l,toPosition:f,connectionStatus:ov(r),toNode:d,toHandle:c,pointer:m});let y="";const v={sourceX:i.x,sourceY:i.y,sourcePosition:l,targetX:u.x,targetY:u.y,targetPosition:f};switch(t){case jn.Bezier:[y]=gv(v);break;case jn.SimpleBezier:[y]=Yv(v);break;case jn.Step:[y]=kc({...v,borderRadius:0});break;case jn.SmoothStep:[y]=kc(v);break;default:[y]=vv(v)}return $.jsx("path",{d:y,fill:"none",className:"react-flow__connection-path",style:e})};l1.displayName="ConnectionLine";const JC={};function pm(e=JC){A.useRef(e),$e(),A.useEffect(()=>{},[e])}function eb(){$e(),A.useRef(!1),A.useEffect(()=>{},[])}function u1({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:o,onNodeDoubleClick:i,onEdgeDoubleClick:s,onNodeMouseEnter:a,onNodeMouseMove:l,onNodeMouseLeave:u,onNodeContextMenu:d,onSelectionContextMenu:c,onSelectionStart:f,onSelectionEnd:m,connectionLineType:y,connectionLineStyle:v,connectionLineComponent:w,connectionLineContainerStyle:h,selectionKeyCode:g,selectionOnDrag:p,selectionMode:_,multiSelectionKeyCode:x,panActivationKeyCode:k,zoomActivationKeyCode:P,deleteKeyCode:b,onlyRenderVisibleElements:F,elementsSelectable:W,defaultViewport:I,translateExtent:H,minZoom:q,maxZoom:E,preventScrolling:O,defaultMarkerColor:M,zoomOnScroll:V,zoomOnPinch:j,panOnScroll:z,panOnScrollSpeed:T,panOnScrollMode:N,zoomOnDoubleClick:R,panOnDrag:D,onPaneClick:S,onPaneMouseEnter:C,onPaneMouseMove:U,onPaneMouseLeave:Y,onPaneScroll:X,onPaneContextMenu:Z,paneClickDistance:te,nodeClickDistance:L,onEdgeContextMenu:B,onEdgeMouseEnter:K,onEdgeMouseMove:G,onEdgeMouseLeave:J,reconnectRadius:ne,onReconnect:ue,onReconnectStart:je,onReconnectEnd:ve,noDragClassName:Ne,noWheelClassName:xe,noPanClassName:gt,disableKeyboardA11y:Ae,nodeExtent:Gn,rfId:_n,viewport:yt,onViewportChange:Jt}){return pm(e),pm(t),eb(),WC(n),KC(yt),$.jsx(mC,{onPaneClick:S,onPaneMouseEnter:C,onPaneMouseMove:U,onPaneMouseLeave:Y,onPaneContextMenu:Z,onPaneScroll:X,paneClickDistance:te,deleteKeyCode:b,selectionKeyCode:g,selectionOnDrag:p,selectionMode:_,onSelectionStart:f,onSelectionEnd:m,multiSelectionKeyCode:x,panActivationKeyCode:k,zoomActivationKeyCode:P,elementsSelectable:W,zoomOnScroll:V,zoomOnPinch:j,zoomOnDoubleClick:R,panOnScroll:z,panOnScrollSpeed:T,panOnScrollMode:N,panOnDrag:D,defaultViewport:I,translateExtent:H,minZoom:q,maxZoom:E,onSelectionContextMenu:c,preventScrolling:O,noDragClassName:Ne,noWheelClassName:xe,noPanClassName:gt,disableKeyboardA11y:Ae,onViewportChange:Jt,isControlledViewport:!!yt,children:$.jsxs(UC,{children:[$.jsx(HC,{edgeTypes:t,onEdgeClick:o,onEdgeDoubleClick:s,onReconnect:ue,onReconnectStart:je,onReconnectEnd:ve,onlyRenderVisibleElements:F,onEdgeContextMenu:B,onEdgeMouseEnter:K,onEdgeMouseMove:G,onEdgeMouseLeave:J,reconnectRadius:ne,defaultMarkerColor:M,noPanClassName:gt,disableKeyboardA11y:Ae,rfId:_n}),$.jsx(ZC,{style:v,type:y,component:w,containerStyle:h}),$.jsx("div",{className:"react-flow__edgelabel-renderer"}),$.jsx(EC,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:i,onNodeMouseEnter:a,onNodeMouseMove:l,onNodeMouseLeave:u,onNodeContextMenu:d,nodeClickDistance:L,onlyRenderVisibleElements:F,noPanClassName:gt,noDragClassName:Ne,disableKeyboardA11y:Ae,nodeExtent:Gn,rfId:_n}),$.jsx("div",{className:"react-flow__viewport-portal"})]})})}u1.displayName="GraphView";const tb=A.memo(u1),mm=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:o,height:i,fitView:s,fitViewOptions:a,minZoom:l=.5,maxZoom:u=2,nodeOrigin:d,nodeExtent:c,zIndexMode:f="basic"}={})=>{const m=new Map,y=new Map,v=new Map,w=new Map,h=r??t??[],g=n??e??[],p=d??[0,0],_=c??zi;$v(v,w,h);const{nodesInitialized:x}=Pc(g,m,y,{nodeOrigin:p,nodeExtent:_,zIndexMode:f});let k=[0,0,1];if(s&&o&&i){const P=Gi(m,{filter:I=>!!((I.width||I.initialWidth)&&(I.height||I.initialHeight))}),{x:b,y:F,zoom:W}=Wd(P,o,i,l,u,(a==null?void 0:a.padding)??.1);k=[b,F,W]}return{rfId:"1",width:o??0,height:i??0,transform:k,nodes:g,nodesInitialized:x,nodeLookup:m,parentLookup:y,edges:h,edgeLookup:w,connectionLookup:v,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:l,maxZoom:u,translateExtent:zi,nodeExtent:_,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:po.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:p,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:s??!1,fitViewOptions:a,fitViewResolver:null,connection:{...rv},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:tN,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:nv,zIndexMode:f,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},nb=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:o,height:i,fitView:s,fitViewOptions:a,minZoom:l,maxZoom:u,nodeOrigin:d,nodeExtent:c,zIndexMode:f})=>wP((m,y)=>{async function v(){const{nodeLookup:w,panZoom:h,fitViewOptions:g,fitViewResolver:p,width:_,height:x,minZoom:k,maxZoom:P}=y();h&&(await Jk({nodes:w,width:_,height:x,panZoom:h,minZoom:k,maxZoom:P},g),p==null||p.resolve(!0),m({fitViewResolver:null}))}return{...mm({nodes:e,edges:t,width:o,height:i,fitView:s,fitViewOptions:a,minZoom:l,maxZoom:u,nodeOrigin:d,nodeExtent:c,defaultNodes:n,defaultEdges:r,zIndexMode:f}),setNodes:w=>{const{nodeLookup:h,parentLookup:g,nodeOrigin:p,elevateNodesOnSelect:_,fitViewQueued:x,zIndexMode:k,nodesSelectionActive:P}=y(),{nodesInitialized:b,hasSelectedNodes:F}=Pc(w,h,g,{nodeOrigin:p,nodeExtent:c,elevateNodesOnSelect:_,checkEquality:!0,zIndexMode:k}),W=P&&F;x&&b?(v(),m({nodes:w,nodesInitialized:b,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:W})):m({nodes:w,nodesInitialized:b,nodesSelectionActive:W})},setEdges:w=>{const{connectionLookup:h,edgeLookup:g}=y();$v(h,g,w),m({edges:w})},setDefaultNodesAndEdges:(w,h)=>{if(w){const{setNodes:g}=y();g(w),m({hasDefaultNodes:!0})}if(h){const{setEdges:g}=y();g(h),m({hasDefaultEdges:!0})}},updateNodeInternals:w=>{const{triggerNodeChanges:h,nodeLookup:g,parentLookup:p,domNode:_,nodeOrigin:x,nodeExtent:k,debug:P,fitViewQueued:b,zIndexMode:F}=y(),{changes:W,updatedInternals:I}=SN(w,g,p,_,x,k,F);I&&(wN(g,p,{nodeOrigin:x,nodeExtent:k,zIndexMode:F}),b?(v(),m({fitViewQueued:!1,fitViewOptions:void 0})):m({}),(W==null?void 0:W.length)>0&&(P&&console.log("React Flow: trigger node changes",W),h==null||h(W)))},updateNodePositions:(w,h=!1)=>{const g=[];let p=[];const{nodeLookup:_,triggerNodeChanges:x,connection:k,updateConnection:P,onNodesChangeMiddlewareMap:b}=y();for(const[F,W]of w){const I=_.get(F),H=!!(I!=null&&I.expandParent&&(I!=null&&I.parentId)&&(W!=null&&W.position)),q={id:F,type:"position",position:H?{x:Math.max(0,W.position.x),y:Math.max(0,W.position.y)}:W.position,dragging:h};if(I&&k.inProgress&&k.fromNode.id===I.id){const E=xr(I,k.fromHandle,oe.Left,!0);P({...k,from:E})}H&&I.parentId&&g.push({id:F,parentId:I.parentId,rect:{...W.internals.positionAbsolute,width:W.measured.width??0,height:W.measured.height??0}}),p.push(q)}if(g.length>0){const{parentLookup:F,nodeOrigin:W}=y(),I=Qd(g,_,F,W);p.push(...I)}for(const F of b.values())p=F(p);x(p)},triggerNodeChanges:w=>{const{onNodesChange:h,setNodes:g,nodes:p,hasDefaultNodes:_,debug:x}=y();if(w!=null&&w.length){if(_){const k=VP(w,p);g(k)}x&&console.log("React Flow: trigger node changes",w),h==null||h(w)}},triggerEdgeChanges:w=>{const{onEdgesChange:h,setEdges:g,edges:p,hasDefaultEdges:_,debug:x}=y();if(w!=null&&w.length){if(_){const k=FP(w,p);g(k)}x&&console.log("React Flow: trigger edge changes",w),h==null||h(w)}},addSelectedNodes:w=>{const{multiSelectionActive:h,edgeLookup:g,nodeLookup:p,triggerNodeChanges:_,triggerEdgeChanges:x}=y();if(h){const k=w.map(P=>tr(P,!0));_(k);return}_(qr(p,new Set([...w]),!0)),x(qr(g))},addSelectedEdges:w=>{const{multiSelectionActive:h,edgeLookup:g,nodeLookup:p,triggerNodeChanges:_,triggerEdgeChanges:x}=y();if(h){const k=w.map(P=>tr(P,!0));x(k);return}x(qr(g,new Set([...w]))),_(qr(p,new Set,!0))},unselectNodesAndEdges:({nodes:w,edges:h}={})=>{const{edges:g,nodes:p,nodeLookup:_,triggerNodeChanges:x,triggerEdgeChanges:k}=y(),P=w||p,b=h||g,F=[];for(const I of P){if(!I.selected)continue;const H=_.get(I.id);H&&(H.selected=!1),F.push(tr(I.id,!1))}const W=[];for(const I of b)I.selected&&W.push(tr(I.id,!1));x(F),k(W)},setMinZoom:w=>{const{panZoom:h,maxZoom:g}=y();h==null||h.setScaleExtent([w,g]),m({minZoom:w})},setMaxZoom:w=>{const{panZoom:h,minZoom:g}=y();h==null||h.setScaleExtent([g,w]),m({maxZoom:w})},setTranslateExtent:w=>{var h;(h=y().panZoom)==null||h.setTranslateExtent(w),m({translateExtent:w})},resetSelectedElements:()=>{const{edges:w,nodes:h,triggerNodeChanges:g,triggerEdgeChanges:p,elementsSelectable:_}=y();if(!_)return;const x=h.reduce((P,b)=>b.selected?[...P,tr(b.id,!1)]:P,[]),k=w.reduce((P,b)=>b.selected?[...P,tr(b.id,!1)]:P,[]);g(x),p(k)},setNodeExtent:w=>{const{nodes:h,nodeLookup:g,parentLookup:p,nodeOrigin:_,elevateNodesOnSelect:x,nodeExtent:k,zIndexMode:P}=y();w[0][0]===k[0][0]&&w[0][1]===k[0][1]&&w[1][0]===k[1][0]&&w[1][1]===k[1][1]||(Pc(h,g,p,{nodeOrigin:_,nodeExtent:w,elevateNodesOnSelect:x,checkEquality:!1,zIndexMode:P}),m({nodeExtent:w}))},panBy:w=>{const{transform:h,width:g,height:p,panZoom:_,translateExtent:x}=y();return EN({delta:w,panZoom:_,transform:h,translateExtent:x,width:g,height:p})},setCenter:async(w,h,g)=>{const{width:p,height:_,maxZoom:x,panZoom:k}=y();if(!k)return Promise.resolve(!1);const P=typeof(g==null?void 0:g.zoom)<"u"?g.zoom:x;return await k.setViewport({x:p/2-w*P,y:_/2-h*P,zoom:P},{duration:g==null?void 0:g.duration,ease:g==null?void 0:g.ease,interpolate:g==null?void 0:g.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{m({connection:{...rv}})},updateConnection:w=>{m({connection:w})},reset:()=>m({...mm()})}},Object.is);function rb({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:o,initialHeight:i,initialMinZoom:s,initialMaxZoom:a,initialFitViewOptions:l,fitView:u,nodeOrigin:d,nodeExtent:c,zIndexMode:f,children:m}){const[y]=A.useState(()=>nb({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:o,height:i,fitView:u,minZoom:s,maxZoom:a,fitViewOptions:l,nodeOrigin:d,nodeExtent:c,zIndexMode:f}));return $.jsx(_P,{value:y,children:$.jsx(UP,{children:m})})}function ob({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:o,width:i,height:s,fitView:a,fitViewOptions:l,minZoom:u,maxZoom:d,nodeOrigin:c,nodeExtent:f,zIndexMode:m}){return A.useContext(vl)?$.jsx($.Fragment,{children:e}):$.jsx(rb,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:o,initialWidth:i,initialHeight:s,fitView:a,initialFitViewOptions:l,initialMinZoom:u,initialMaxZoom:d,nodeOrigin:c,nodeExtent:f,zIndexMode:m,children:e})}const ib={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function sb({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:o,nodeTypes:i,edgeTypes:s,onNodeClick:a,onEdgeClick:l,onInit:u,onMove:d,onMoveStart:c,onMoveEnd:f,onConnect:m,onConnectStart:y,onConnectEnd:v,onClickConnectStart:w,onClickConnectEnd:h,onNodeMouseEnter:g,onNodeMouseMove:p,onNodeMouseLeave:_,onNodeContextMenu:x,onNodeDoubleClick:k,onNodeDragStart:P,onNodeDrag:b,onNodeDragStop:F,onNodesDelete:W,onEdgesDelete:I,onDelete:H,onSelectionChange:q,onSelectionDragStart:E,onSelectionDrag:O,onSelectionDragStop:M,onSelectionContextMenu:V,onSelectionStart:j,onSelectionEnd:z,onBeforeDelete:T,connectionMode:N,connectionLineType:R=jn.Bezier,connectionLineStyle:D,connectionLineComponent:S,connectionLineContainerStyle:C,deleteKeyCode:U="Backspace",selectionKeyCode:Y="Shift",selectionOnDrag:X=!1,selectionMode:Z=Ai.Full,panActivationKeyCode:te="Space",multiSelectionKeyCode:L=Di()?"Meta":"Control",zoomActivationKeyCode:B=Di()?"Meta":"Control",snapToGrid:K,snapGrid:G,onlyRenderVisibleElements:J=!1,selectNodesOnDrag:ne,nodesDraggable:ue,autoPanOnNodeFocus:je,nodesConnectable:ve,nodesFocusable:Ne,nodeOrigin:xe=Dv,edgesFocusable:gt,edgesReconnectable:Ae,elementsSelectable:Gn=!0,defaultViewport:_n=IP,minZoom:yt=.5,maxZoom:Jt=2,translateExtent:jo=zi,preventScrolling:ns=!0,nodeExtent:Mo,defaultMarkerColor:aw="#b1b1b7",zoomOnScroll:lw=!0,zoomOnPinch:uw=!0,panOnScroll:cw=!1,panOnScrollSpeed:dw=.5,panOnScrollMode:fw=hr.Free,zoomOnDoubleClick:hw=!0,panOnDrag:pw=!0,onPaneClick:mw,onPaneMouseEnter:gw,onPaneMouseMove:yw,onPaneMouseLeave:vw,onPaneScroll:ww,onPaneContextMenu:_w,paneClickDistance:$w=1,nodeClickDistance:xw=0,children:Sw,onReconnect:Ew,onReconnectStart:kw,onReconnectEnd:Nw,onEdgeContextMenu:Pw,onEdgeDoubleClick:Cw,onEdgeMouseEnter:bw,onEdgeMouseMove:jw,onEdgeMouseLeave:Mw,reconnectRadius:Tw=10,onNodesChange:Iw,onEdgesChange:Rw,noDragClassName:zw="nodrag",noWheelClassName:Aw="nowheel",noPanClassName:Gf="nopan",fitView:Qf,fitViewOptions:Zf,connectOnClick:Ow,attributionPosition:Dw,proOptions:Lw,defaultEdgeOptions:Vw,elevateNodesOnSelect:Fw=!0,elevateEdgesOnSelect:Hw=!1,disableKeyboardA11y:Jf=!1,autoPanOnConnect:Bw,autoPanOnNodeDrag:Uw,autoPanSpeed:Ww,connectionRadius:qw,isValidConnection:Kw,onError:Xw,style:Yw,id:eh,nodeDragThreshold:Gw,connectionDragThreshold:Qw,viewport:Zw,onViewportChange:Jw,width:e_,height:t_,colorMode:n_="light",debug:r_,onScroll:rs,ariaLabelConfig:o_,zIndexMode:th="basic",...i_},s_){const Il=eh||"1",a_=OP(n_),l_=A.useCallback(nh=>{nh.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),rs==null||rs(nh)},[rs]);return $.jsx("div",{"data-testid":"rf__wrapper",...i_,onScroll:l_,style:{...Yw,...ib},ref:s_,className:Te(["react-flow",o,a_]),id:eh,role:"application",children:$.jsxs(ob,{nodes:e,edges:t,width:e_,height:t_,fitView:Qf,fitViewOptions:Zf,minZoom:yt,maxZoom:Jt,nodeOrigin:xe,nodeExtent:Mo,zIndexMode:th,children:[$.jsx(AP,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:m,onConnectStart:y,onConnectEnd:v,onClickConnectStart:w,onClickConnectEnd:h,nodesDraggable:ue,autoPanOnNodeFocus:je,nodesConnectable:ve,nodesFocusable:Ne,edgesFocusable:gt,edgesReconnectable:Ae,elementsSelectable:Gn,elevateNodesOnSelect:Fw,elevateEdgesOnSelect:Hw,minZoom:yt,maxZoom:Jt,nodeExtent:Mo,onNodesChange:Iw,onEdgesChange:Rw,snapToGrid:K,snapGrid:G,connectionMode:N,translateExtent:jo,connectOnClick:Ow,defaultEdgeOptions:Vw,fitView:Qf,fitViewOptions:Zf,onNodesDelete:W,onEdgesDelete:I,onDelete:H,onNodeDragStart:P,onNodeDrag:b,onNodeDragStop:F,onSelectionDrag:O,onSelectionDragStart:E,onSelectionDragStop:M,onMove:d,onMoveStart:c,onMoveEnd:f,noPanClassName:Gf,nodeOrigin:xe,rfId:Il,autoPanOnConnect:Bw,autoPanOnNodeDrag:Uw,autoPanSpeed:Ww,onError:Xw,connectionRadius:qw,isValidConnection:Kw,selectNodesOnDrag:ne,nodeDragThreshold:Gw,connectionDragThreshold:Qw,onBeforeDelete:T,debug:r_,ariaLabelConfig:o_,zIndexMode:th}),$.jsx(tb,{onInit:u,onNodeClick:a,onEdgeClick:l,onNodeMouseEnter:g,onNodeMouseMove:p,onNodeMouseLeave:_,onNodeContextMenu:x,onNodeDoubleClick:k,nodeTypes:i,edgeTypes:s,connectionLineType:R,connectionLineStyle:D,connectionLineComponent:S,connectionLineContainerStyle:C,selectionKeyCode:Y,selectionOnDrag:X,selectionMode:Z,deleteKeyCode:U,multiSelectionKeyCode:L,panActivationKeyCode:te,zoomActivationKeyCode:B,onlyRenderVisibleElements:J,defaultViewport:_n,translateExtent:jo,minZoom:yt,maxZoom:Jt,preventScrolling:ns,zoomOnScroll:lw,zoomOnPinch:uw,zoomOnDoubleClick:hw,panOnScroll:cw,panOnScrollSpeed:dw,panOnScrollMode:fw,panOnDrag:pw,onPaneClick:mw,onPaneMouseEnter:gw,onPaneMouseMove:yw,onPaneMouseLeave:vw,onPaneScroll:ww,onPaneContextMenu:_w,paneClickDistance:$w,nodeClickDistance:xw,onSelectionContextMenu:V,onSelectionStart:j,onSelectionEnd:z,onReconnect:Ew,onReconnectStart:kw,onReconnectEnd:Nw,onEdgeContextMenu:Pw,onEdgeDoubleClick:Cw,onEdgeMouseEnter:bw,onEdgeMouseMove:jw,onEdgeMouseLeave:Mw,reconnectRadius:Tw,defaultMarkerColor:aw,noDragClassName:zw,noWheelClassName:Aw,noPanClassName:Gf,rfId:Il,disableKeyboardA11y:Jf,nodeExtent:Mo,viewport:Zw,onViewportChange:Jw}),$.jsx(TP,{onSelectionChange:q}),Sw,$.jsx(PP,{proOptions:Lw,position:Dw}),$.jsx(NP,{rfId:Il,disableKeyboardA11y:Jf})]})})}var ab=Vv(sb);const lb=e=>{var t;return(t=e.domNode)==null?void 0:t.querySelector(".react-flow__edgelabel-renderer")};function c1({children:e}){const t=le(lb);return t?vy.createPortal(e,t):null}function ub({dimensions:e,lineWidth:t,variant:n,className:r}){return $.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:Te(["react-flow__background-pattern",n,r])})}function cb({radius:e,className:t}){return $.jsx("circle",{cx:e,cy:e,r:e,className:Te(["react-flow__background-pattern","dots",t])})}var Bn;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Bn||(Bn={}));const db={[Bn.Dots]:1,[Bn.Lines]:1,[Bn.Cross]:6},fb=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function d1({id:e,variant:t=Bn.Dots,gap:n=20,size:r,lineWidth:o=1,offset:i=0,color:s,bgColor:a,style:l,className:u,patternClassName:d}){const c=A.useRef(null),{transform:f,patternId:m}=le(fb,_e),y=r||db[t],v=t===Bn.Dots,w=t===Bn.Cross,h=Array.isArray(n)?n:[n,n],g=[h[0]*f[2]||1,h[1]*f[2]||1],p=y*f[2],_=Array.isArray(i)?i:[i,i],x=w?[p,p]:g,k=[_[0]*f[2]||1+x[0]/2,_[1]*f[2]||1+x[1]/2],P=`${m}${e||""}`;return $.jsxs("svg",{className:Te(["react-flow__background",u]),style:{...l,..._l,"--xy-background-color-props":a,"--xy-background-pattern-color-props":s},ref:c,"data-testid":"rf__background",children:[$.jsx("pattern",{id:P,x:f[0]%g[0],y:f[1]%g[1],width:g[0],height:g[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${k[0]},-${k[1]})`,children:v?$.jsx(cb,{radius:p/2,className:d}):$.jsx(ub,{dimensions:x,lineWidth:o,variant:t,className:d})}),$.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${P})`})]})}d1.displayName="Background";const hb=A.memo(d1);function pb(){return $.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:$.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function mb(){return $.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:$.jsx("path",{d:"M0 0h32v4.2H0z"})})}function gb(){return $.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:$.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 yb(){return $.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:$.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 vb(){return $.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:$.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 bs({children:e,className:t,...n}){return $.jsx("button",{type:"button",className:Te(["react-flow__controls-button",t]),...n,children:e})}const wb=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function f1({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:o,onZoomIn:i,onZoomOut:s,onFitView:a,onInteractiveChange:l,className:u,children:d,position:c="bottom-left",orientation:f="vertical","aria-label":m}){const y=$e(),{isInteractive:v,minZoomReached:w,maxZoomReached:h,ariaLabelConfig:g}=le(wb,_e),{zoomIn:p,zoomOut:_,fitView:x}=Zd(),k=()=>{p(),i==null||i()},P=()=>{_(),s==null||s()},b=()=>{x(o),a==null||a()},F=()=>{y.setState({nodesDraggable:!v,nodesConnectable:!v,elementsSelectable:!v}),l==null||l(!v)},W=f==="horizontal"?"horizontal":"vertical";return $.jsxs(wl,{className:Te(["react-flow__controls",W,u]),position:c,style:e,"data-testid":"rf__controls","aria-label":m??g["controls.ariaLabel"],children:[t&&$.jsxs($.Fragment,{children:[$.jsx(bs,{onClick:k,className:"react-flow__controls-zoomin",title:g["controls.zoomIn.ariaLabel"],"aria-label":g["controls.zoomIn.ariaLabel"],disabled:h,children:$.jsx(pb,{})}),$.jsx(bs,{onClick:P,className:"react-flow__controls-zoomout",title:g["controls.zoomOut.ariaLabel"],"aria-label":g["controls.zoomOut.ariaLabel"],disabled:w,children:$.jsx(mb,{})})]}),n&&$.jsx(bs,{className:"react-flow__controls-fitview",onClick:b,title:g["controls.fitView.ariaLabel"],"aria-label":g["controls.fitView.ariaLabel"],children:$.jsx(gb,{})}),r&&$.jsx(bs,{className:"react-flow__controls-interactive",onClick:F,title:g["controls.interactive.ariaLabel"],"aria-label":g["controls.interactive.ariaLabel"],children:v?$.jsx(vb,{}):$.jsx(yb,{})}),d]})}f1.displayName="Controls";const _b=A.memo(f1);function $b({id:e,x:t,y:n,width:r,height:o,style:i,color:s,strokeColor:a,strokeWidth:l,className:u,borderRadius:d,shapeRendering:c,selected:f,onClick:m}){const{background:y,backgroundColor:v}=i||{},w=s||y||v;return $.jsx("rect",{className:Te(["react-flow__minimap-node",{selected:f},u]),x:t,y:n,rx:d,ry:d,width:r,height:o,style:{fill:w,stroke:a,strokeWidth:l},shapeRendering:c,onClick:m?h=>m(h,e):void 0})}const xb=A.memo($b),Sb=e=>e.nodes.map(t=>t.id),mu=e=>e instanceof Function?e:()=>e;function Eb({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:o,nodeComponent:i=xb,onClick:s}){const a=le(Sb,_e),l=mu(t),u=mu(e),d=mu(n),c=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return $.jsx($.Fragment,{children:a.map(f=>$.jsx(Nb,{id:f,nodeColorFunc:l,nodeStrokeColorFunc:u,nodeClassNameFunc:d,nodeBorderRadius:r,nodeStrokeWidth:o,NodeComponent:i,onClick:s,shapeRendering:c},f))})}function kb({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:o,nodeStrokeWidth:i,shapeRendering:s,NodeComponent:a,onClick:l}){const{node:u,x:d,y:c,width:f,height:m}=le(y=>{const v=y.nodeLookup.get(e);if(!v)return{node:void 0,x:0,y:0,width:0,height:0};const w=v.internals.userNode,{x:h,y:g}=v.internals.positionAbsolute,{width:p,height:_}=wn(w);return{node:w,x:h,y:g,width:p,height:_}},_e);return!u||u.hidden||!cv(u)?null:$.jsx(a,{x:d,y:c,width:f,height:m,style:u.style,selected:!!u.selected,className:r(u),color:t(u),borderRadius:o,strokeColor:n(u),strokeWidth:i,shapeRendering:s,onClick:l,id:u.id})}const Nb=A.memo(kb);var Pb=A.memo(Eb);const Cb=200,bb=150,jb=e=>!e.hidden,Mb=e=>{const t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:t,boundingRect:e.nodeLookup.size>0?uv(Gi(e.nodeLookup,{filter:jb}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},Tb="react-flow__minimap-desc";function h1({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:o="",nodeBorderRadius:i=5,nodeStrokeWidth:s,nodeComponent:a,bgColor:l,maskColor:u,maskStrokeColor:d,maskStrokeWidth:c,position:f="bottom-right",onClick:m,onNodeClick:y,pannable:v=!1,zoomable:w=!1,ariaLabel:h,inversePan:g,zoomStep:p=1,offsetScale:_=5}){const x=$e(),k=A.useRef(null),{boundingRect:P,viewBB:b,rfId:F,panZoom:W,translateExtent:I,flowWidth:H,flowHeight:q,ariaLabelConfig:E}=le(Mb,_e),O=(e==null?void 0:e.width)??Cb,M=(e==null?void 0:e.height)??bb,V=P.width/O,j=P.height/M,z=Math.max(V,j),T=z*O,N=z*M,R=_*z,D=P.x-(T-P.width)/2-R,S=P.y-(N-P.height)/2-R,C=T+R*2,U=N+R*2,Y=`${Tb}-${F}`,X=A.useRef(0),Z=A.useRef();X.current=z,A.useEffect(()=>{if(k.current&&W)return Z.current=IN({domNode:k.current,panZoom:W,getTransform:()=>x.getState().transform,getViewScale:()=>X.current}),()=>{var K;(K=Z.current)==null||K.destroy()}},[W]),A.useEffect(()=>{var K;(K=Z.current)==null||K.update({translateExtent:I,width:H,height:q,inversePan:g,pannable:v,zoomStep:p,zoomable:w})},[v,w,g,p,I,H,q]);const te=m?K=>{var ne;const[G,J]=((ne=Z.current)==null?void 0:ne.pointer(K))||[0,0];m(K,{x:G,y:J})}:void 0,L=y?A.useCallback((K,G)=>{const J=x.getState().nodeLookup.get(G).internals.userNode;y(K,J)},[]):void 0,B=h??E["minimap.ariaLabel"];return $.jsx(wl,{position:f,style:{...e,"--xy-minimap-background-color-props":typeof l=="string"?l:void 0,"--xy-minimap-mask-background-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-stroke-color-props":typeof d=="string"?d:void 0,"--xy-minimap-mask-stroke-width-props":typeof c=="number"?c*z:void 0,"--xy-minimap-node-background-color-props":typeof r=="string"?r:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof s=="number"?s:void 0},className:Te(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:$.jsxs("svg",{width:O,height:M,viewBox:`${D} ${S} ${C} ${U}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":Y,ref:k,onClick:te,children:[B&&$.jsx("title",{id:Y,children:B}),$.jsx(Pb,{onClick:L,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:i,nodeClassName:o,nodeStrokeWidth:s,nodeComponent:a}),$.jsx("path",{className:"react-flow__minimap-mask",d:`M${D-R},${S-R}h${C+R*2}v${U+R*2}h${-C-R*2}z
|
|
217
|
+
M${b.x},${b.y}h${b.width}v${b.height}h${-b.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}h1.displayName="MiniMap";A.memo(h1);const Ib=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,Rb={[vo.Line]:"right",[vo.Handle]:"bottom-right"};function zb({nodeId:e,position:t,variant:n=vo.Handle,className:r,style:o=void 0,children:i,color:s,minWidth:a=10,minHeight:l=10,maxWidth:u=Number.MAX_VALUE,maxHeight:d=Number.MAX_VALUE,keepAspectRatio:c=!1,resizeDirection:f,autoScale:m=!0,shouldResize:y,onResizeStart:v,onResize:w,onResizeEnd:h}){const g=Uv(),p=typeof e=="string"?e:g,_=$e(),x=A.useRef(null),k=n===vo.Handle,P=le(A.useCallback(Ib(k&&m),[k,m]),_e),b=A.useRef(null),F=t??Rb[n];A.useEffect(()=>{if(!(!x.current||!p))return b.current||(b.current=KN({domNode:x.current,nodeId:p,getStoreItems:()=>{const{nodeLookup:I,transform:H,snapGrid:q,snapToGrid:E,nodeOrigin:O,domNode:M}=_.getState();return{nodeLookup:I,transform:H,snapGrid:q,snapToGrid:E,nodeOrigin:O,paneDomNode:M}},onChange:(I,H)=>{const{triggerNodeChanges:q,nodeLookup:E,parentLookup:O,nodeOrigin:M}=_.getState(),V=[],j={x:I.x,y:I.y},z=E.get(p);if(z&&z.expandParent&&z.parentId){const T=z.origin??M,N=I.width??z.measured.width??0,R=I.height??z.measured.height??0,D={id:z.id,parentId:z.parentId,rect:{width:N,height:R,...dv({x:I.x??z.position.x,y:I.y??z.position.y},{width:N,height:R},z.parentId,E,T)}},S=Qd([D],E,O,M);V.push(...S),j.x=I.x?Math.max(T[0]*N,I.x):void 0,j.y=I.y?Math.max(T[1]*R,I.y):void 0}if(j.x!==void 0&&j.y!==void 0){const T={id:p,type:"position",position:{...j}};V.push(T)}if(I.width!==void 0&&I.height!==void 0){const N={id:p,type:"dimensions",resizing:!0,setAttributes:f?f==="horizontal"?"width":"height":!0,dimensions:{width:I.width,height:I.height}};V.push(N)}for(const T of H){const N={...T,type:"position"};V.push(N)}q(V)},onEnd:({width:I,height:H})=>{const q={id:p,type:"dimensions",resizing:!1,dimensions:{width:I,height:H}};_.getState().triggerNodeChanges([q])}})),b.current.update({controlPosition:F,boundaries:{minWidth:a,minHeight:l,maxWidth:u,maxHeight:d},keepAspectRatio:c,resizeDirection:f,onResizeStart:v,onResize:w,onResizeEnd:h,shouldResize:y}),()=>{var I;(I=b.current)==null||I.destroy()}},[F,a,l,u,d,c,v,w,h,y]);const W=F.split("-");return $.jsx("div",{className:Te(["react-flow__resize-control","nodrag",...W,n,r]),ref:x,style:{...o,scale:P,...s&&{[k?"backgroundColor":"borderColor"]:s}},children:i})}A.memo(zb);const Ab={monitor:Yx,server:tS,database:qx,zap:lS,globe:Xx,music:Qx,sliders:rS},Ob={planned:"var(--status-planned)",implemented:"var(--status-implemented)",stale:"var(--status-stale)",deprecated:"var(--status-deprecated)"},gm={audio:"#f472b6",midi:"#a78bfa",control:"#34d399",http:"#60a5fa",data:"#fbbf24"};function ym(e,t){if(t<=1)return"50%";const n=18,r=100-n*2,o=e/(t-1);return`${n+o*r}%`}function Db({data:e}){var f,m,y;const{node:t,typeDef:n,onDrillDown:r,active:o}=e,i=(n==null?void 0:n.color)??"#71717a",s=n!=null&&n.icon?Ab[n.icon]??hp:hp,a=(n==null?void 0:n.label)??t.type,l=((f=n==null?void 0:n.ports)==null?void 0:f.in)??[],u=((m=n==null?void 0:n.ports)==null?void 0:m.out)??[],d=l.length>0,c=u.length>0;return $.jsxs("div",{className:`node-card status-${t.status}${d||c?" has-ports":""}${o?" active":""}`,style:{"--node-color":i,"--status-color":Ob[t.status]},children:[d?l.map((v,w)=>$.jsxs("div",{className:"port-row port-in",style:{top:ym(w,l.length)},children:[$.jsx(In,{type:"target",position:oe.Left,id:v.name,style:{background:v.signal?gm[v.signal]??i:i}}),$.jsx("span",{className:"port-label",children:v.name})]},`in-${v.name}`)):$.jsx(In,{type:"target",position:oe.Left}),$.jsxs("div",{className:"node-header",children:[$.jsx(s,{className:"node-icon"}),$.jsx("span",{className:"node-type",children:a})]}),$.jsx("div",{className:"node-label",children:t.label}),$.jsx("span",{className:"status-dot",title:t.status}),(((y=t.code_refs)==null?void 0:y.length)??0)>0&&$.jsxs("span",{className:"refs-badge",title:(t.code_refs??[]).map(v=>v.path+(v.symbol?` · ${v.symbol}`:"")).join(`
|
|
218
|
+
`)||"Code refs",children:[$.jsx(Zx,{size:9})," ",t.code_refs.length]}),t.drill_down&&r&&$.jsx("button",{className:"drill-down-btn",title:`Drill into ${t.drill_down}`,"aria-label":`Drill into ${t.drill_down}`,onPointerDown:v=>v.stopPropagation(),onClick:v=>{v.stopPropagation(),r(t.drill_down)},children:$.jsx($y,{size:12})}),c?u.map((v,w)=>$.jsxs("div",{className:"port-row port-out",style:{top:ym(w,u.length)},children:[$.jsx("span",{className:"port-label",children:v.name}),$.jsx(In,{type:"source",position:oe.Right,id:v.name,style:{background:v.signal?gm[v.signal]??i:i}})]},`out-${v.name}`)):$.jsx(In,{type:"source",position:oe.Right})]})}function Lb({data:e,width:t,height:n}){const{group:r,onDrillDown:o}=e,i=r.color??"#94a3b8";return $.jsx("div",{className:"group-frame",style:{width:t??"100%",height:n??"100%","--group-color":i},children:$.jsxs("div",{className:"group-label",children:[$.jsx("span",{children:r.label}),r.drill_down&&o&&$.jsx("button",{className:"drill-down-btn inline",title:`Drill into ${r.drill_down}`,"aria-label":`Drill into ${r.drill_down}`,onClick:s=>{s.stopPropagation(),o(r.drill_down)},children:$.jsx($y,{size:11})})]})})}const Vb=32;function Fb(e){const{id:t,sourceX:n,sourceY:r,targetX:o,targetY:i,label:s,labelStyle:a,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:d,style:c,markerEnd:f,markerStart:m,data:y}=e,v=(y==null?void 0:y.parallelOffset)??0,w=o-n,h=i-r,g=Math.max(Math.sqrt(w*w+h*h),1),p=-h/g,_=w/g,x=v*Vb,k=(n+o)/2+p*x,P=(r+i)/2+_*x,b=(n+o)/2+p*(x/2),F=(r+i)/2+_*(x/2),W=`M ${n},${r} Q ${k},${P} ${o},${i}`,I=Array.isArray(u)?u[0]:6,H=Array.isArray(u)?u[1]:3;return $.jsxs($.Fragment,{children:[$.jsx(Eo,{id:t,path:W,style:c,markerEnd:f,markerStart:m}),s&&$.jsx(c1,{children:$.jsx("div",{className:"parallel-edge-label nodrag nopan",style:{position:"absolute",transform:`translate(-50%, -50%) translate(${b}px, ${F}px)`,padding:`${H}px ${I}px`,borderRadius:(d??3)+"px",background:(l==null?void 0:l.fill)??"var(--bg-elevated)",color:(a==null?void 0:a.fill)??"var(--text-muted)",fontSize:(a==null?void 0:a.fontSize)??11,fontFamily:"inherit",lineHeight:1.2,pointerEvents:"all",userSelect:"none"},children:s})})]})}const Hb=32,Bb=320;function Ub(e){const{id:t,sourceX:n,sourceY:r,targetX:o,targetY:i,label:s,labelStyle:a,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:d,style:c,markerEnd:f,markerStart:m,data:y}=e,v=y??{},w=v.parallelOffset??0,h=v.pulsing??!1,g=o-n,p=i-r,_=Math.max(Math.sqrt(g*g+p*p),1),x=-p/_,k=g/_,P=w*Hb,b=(n+o)/2+x*P,F=(r+i)/2+k*P,W=`M ${n},${r} Q ${b},${F} ${o},${i}`,I=`pulse-path-${t}`,H=Math.max(.4,_/Bb),q=(n+o)/2+x*(P/2),E=(r+i)/2+k*(P/2),O=Array.isArray(u)?u[0]:6,M=Array.isArray(u)?u[1]:3,V=(c==null?void 0:c.stroke)??"var(--accent)";return $.jsxs($.Fragment,{children:[$.jsx(Eo,{id:t,path:W,style:c,markerEnd:f,markerStart:m}),$.jsx("path",{id:I,d:W,fill:"none",stroke:"none"}),h&&$.jsx("circle",{r:5,className:"pulse-marker",fill:V,stroke:"white",strokeWidth:1,children:$.jsx("animateMotion",{dur:`${H}s`,repeatCount:"indefinite",children:$.jsx("mpath",{href:`#${I}`})})}),s&&$.jsx(c1,{children:$.jsx("div",{className:"parallel-edge-label nodrag nopan",style:{position:"absolute",transform:`translate(-50%, -50%) translate(${q}px, ${E}px)`,padding:`${M}px ${O}px`,borderRadius:(d??3)+"px",background:(l==null?void 0:l.fill)??"var(--bg-elevated)",color:(a==null?void 0:a.fill)??"var(--text-muted)",fontSize:(a==null?void 0:a.fontSize)??11,fontFamily:"inherit",lineHeight:1.2,pointerEvents:"all",userSelect:"none"},children:s})})]})}function qn(){return typeof window<"u"&&!!window.__LOOM_DATA__}function $l(){return typeof window>"u"?null:window.__LOOM_DATA__??null}async function Vi(e){const t=await fetch(e);if(!t.ok){let n="";try{n=` — ${(await t.json()).error??""}`}catch{}throw new Error(`${e}: ${t.status} ${t.statusText}${n}`)}return await t.json()}function Wb(e,t){var n,r;return{id:e,title:t.title,description:t.description,nodeCount:((n=t.nodes)==null?void 0:n.length)??0,edgeCount:((r=t.edges)==null?void 0:r.length)??0}}function qb(e,t){var r;const n=(t.events??[]).reduce((o,i)=>Math.max(o,(i.start_ms??0)+(i.duration_ms??0)),0);return{id:e,title:t.title,description:t.description,diagram:t.diagram,eventCount:((r=t.events)==null?void 0:r.length)??0,totalDurationMs:n}}async function Kb(){const e=$l();return e?Object.entries(e.diagrams).map(([t,n])=>Wb(t,n)).sort((t,n)=>t.id.localeCompare(n.id)):Vi("/api/diagrams")}async function Va(e="overview"){const t=$l();if(t){const o=t.diagrams[e];if(!o)throw new Error(`Diagram '${e}' not in this export.`);return{diagram:o,nodeTypes:t.nodeTypes}}const[n,r]=await Promise.all([Vi(`/api/diagrams/${e}`),Vi("/api/node-types")]);return{diagram:n,nodeTypes:r}}async function p1(e){if(qn())throw new Error("Edits are disabled in exported HTML.");const t=await fetch(`/api/diagrams/${e.id}`,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify(e)});if(!t.ok){const n=await t.json().catch(()=>({}));throw new Error(`save failed: ${t.status} ${n.error??""}`)}}async function m1(e,t){await p1({version:"1",id:e,title:t,nodes:[],edges:[]})}async function Xb(){const e=$l();return e?Object.entries(e.timelines).map(([t,n])=>qb(t,n)).sort((t,n)=>t.id.localeCompare(n.id)):Vi("/api/timelines")}async function vm(e){const t=$l();if(t){const n=t.timelines[e];if(!n)throw new Error(`Timeline '${e}' not in this export.`);return n}return Vi(`/api/timelines/${e}`)}async function Yb(e){if(qn())throw new Error("Edits are disabled in exported HTML.");const t=await fetch(`/api/timelines/${e.id}`,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify(e)});if(!t.ok){const n=await t.json().catch(()=>({}));throw new Error(`save failed: ${t.status} ${n.error??""}`)}}var Mc={exports:{}},ef={},tn={},Qn={},Ji={},ie={},Fi={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.regexpCode=e.getEsmExportName=e.getProperty=e.safeStringify=e.stringify=e.strConcat=e.addCodeArg=e.str=e._=e.nil=e._Code=e.Name=e.IDENTIFIER=e._CodeOrName=void 0;class t{}e._CodeOrName=t,e.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class n extends t{constructor(g){if(super(),!e.IDENTIFIER.test(g))throw new Error("CodeGen: name must be a valid identifier");this.str=g}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}e.Name=n;class r extends t{constructor(g){super(),this._items=typeof g=="string"?[g]:g}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const g=this._items[0];return g===""||g==='""'}get str(){var g;return(g=this._str)!==null&&g!==void 0?g:this._str=this._items.reduce((p,_)=>`${p}${_}`,"")}get names(){var g;return(g=this._names)!==null&&g!==void 0?g:this._names=this._items.reduce((p,_)=>(_ instanceof n&&(p[_.str]=(p[_.str]||0)+1),p),{})}}e._Code=r,e.nil=new r("");function o(h,...g){const p=[h[0]];let _=0;for(;_<g.length;)a(p,g[_]),p.push(h[++_]);return new r(p)}e._=o;const i=new r("+");function s(h,...g){const p=[m(h[0])];let _=0;for(;_<g.length;)p.push(i),a(p,g[_]),p.push(i,m(h[++_]));return l(p),new r(p)}e.str=s;function a(h,g){g instanceof r?h.push(...g._items):g instanceof n?h.push(g):h.push(c(g))}e.addCodeArg=a;function l(h){let g=1;for(;g<h.length-1;){if(h[g]===i){const p=u(h[g-1],h[g+1]);if(p!==void 0){h.splice(g-1,3,p);continue}h[g++]="+"}g++}}function u(h,g){if(g==='""')return h;if(h==='""')return g;if(typeof h=="string")return g instanceof n||h[h.length-1]!=='"'?void 0:typeof g!="string"?`${h.slice(0,-1)}${g}"`:g[0]==='"'?h.slice(0,-1)+g.slice(1):void 0;if(typeof g=="string"&&g[0]==='"'&&!(h instanceof n))return`"${h}${g.slice(1)}`}function d(h,g){return g.emptyStr()?h:h.emptyStr()?g:s`${h}${g}`}e.strConcat=d;function c(h){return typeof h=="number"||typeof h=="boolean"||h===null?h:m(Array.isArray(h)?h.join(","):h)}function f(h){return new r(m(h))}e.stringify=f;function m(h){return JSON.stringify(h).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}e.safeStringify=m;function y(h){return typeof h=="string"&&e.IDENTIFIER.test(h)?new r(`.${h}`):o`[${h}]`}e.getProperty=y;function v(h){if(typeof h=="string"&&e.IDENTIFIER.test(h))return new r(`${h}`);throw new Error(`CodeGen: invalid export name: ${h}, use explicit $id name mapping`)}e.getEsmExportName=v;function w(h){return new r(h.toString())}e.regexpCode=w})(Fi);var Tc={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;const t=Fi;class n extends Error{constructor(u){super(`CodeGen: "code" for ${u} not defined`),this.value=u.value}}var r;(function(l){l[l.Started=0]="Started",l[l.Completed=1]="Completed"})(r||(e.UsedValueState=r={})),e.varKinds={const:new t.Name("const"),let:new t.Name("let"),var:new t.Name("var")};class o{constructor({prefixes:u,parent:d}={}){this._names={},this._prefixes=u,this._parent=d}toName(u){return u instanceof t.Name?u:this.name(u)}name(u){return new t.Name(this._newName(u))}_newName(u){const d=this._names[u]||this._nameGroup(u);return`${u}${d.index++}`}_nameGroup(u){var d,c;if(!((c=(d=this._parent)===null||d===void 0?void 0:d._prefixes)===null||c===void 0)&&c.has(u)||this._prefixes&&!this._prefixes.has(u))throw new Error(`CodeGen: prefix "${u}" is not allowed in this scope`);return this._names[u]={prefix:u,index:0}}}e.Scope=o;class i extends t.Name{constructor(u,d){super(d),this.prefix=u}setValue(u,{property:d,itemIndex:c}){this.value=u,this.scopePath=(0,t._)`.${new t.Name(d)}[${c}]`}}e.ValueScopeName=i;const s=(0,t._)`\n`;class a extends o{constructor(u){super(u),this._values={},this._scope=u.scope,this.opts={...u,_n:u.lines?s:t.nil}}get(){return this._scope}name(u){return new i(u,this._newName(u))}value(u,d){var c;if(d.ref===void 0)throw new Error("CodeGen: ref must be passed in value");const f=this.toName(u),{prefix:m}=f,y=(c=d.key)!==null&&c!==void 0?c:d.ref;let v=this._values[m];if(v){const g=v.get(y);if(g)return g}else v=this._values[m]=new Map;v.set(y,f);const w=this._scope[m]||(this._scope[m]=[]),h=w.length;return w[h]=d.ref,f.setValue(d,{property:m,itemIndex:h}),f}getValue(u,d){const c=this._values[u];if(c)return c.get(d)}scopeRefs(u,d=this._values){return this._reduceValues(d,c=>{if(c.scopePath===void 0)throw new Error(`CodeGen: name "${c}" has no value`);return(0,t._)`${u}${c.scopePath}`})}scopeCode(u=this._values,d,c){return this._reduceValues(u,f=>{if(f.value===void 0)throw new Error(`CodeGen: name "${f}" has no value`);return f.value.code},d,c)}_reduceValues(u,d,c={},f){let m=t.nil;for(const y in u){const v=u[y];if(!v)continue;const w=c[y]=c[y]||new Map;v.forEach(h=>{if(w.has(h))return;w.set(h,r.Started);let g=d(h);if(g){const p=this.opts.es5?e.varKinds.var:e.varKinds.const;m=(0,t._)`${m}${p} ${h} = ${g};${this.opts._n}`}else if(g=f==null?void 0:f(h))m=(0,t._)`${m}${g}${this.opts._n}`;else throw new n(h);w.set(h,r.Completed)})}return m}}e.ValueScope=a})(Tc);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.or=e.and=e.not=e.CodeGen=e.operators=e.varKinds=e.ValueScopeName=e.ValueScope=e.Scope=e.Name=e.regexpCode=e.stringify=e.getProperty=e.nil=e.strConcat=e.str=e._=void 0;const t=Fi,n=Tc;var r=Fi;Object.defineProperty(e,"_",{enumerable:!0,get:function(){return r._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(e,"strConcat",{enumerable:!0,get:function(){return r.strConcat}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(e,"getProperty",{enumerable:!0,get:function(){return r.getProperty}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(e,"regexpCode",{enumerable:!0,get:function(){return r.regexpCode}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return r.Name}});var o=Tc;Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return o.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return o.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return o.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return o.varKinds}}),e.operators={GT:new t._Code(">"),GTE:new t._Code(">="),LT:new t._Code("<"),LTE:new t._Code("<="),EQ:new t._Code("==="),NEQ:new t._Code("!=="),NOT:new t._Code("!"),OR:new t._Code("||"),AND:new t._Code("&&"),ADD:new t._Code("+")};class i{optimizeNodes(){return this}optimizeNames(S,C){return this}}class s extends i{constructor(S,C,U){super(),this.varKind=S,this.name=C,this.rhs=U}render({es5:S,_n:C}){const U=S?n.varKinds.var:this.varKind,Y=this.rhs===void 0?"":` = ${this.rhs}`;return`${U} ${this.name}${Y};`+C}optimizeNames(S,C){if(S[this.name.str])return this.rhs&&(this.rhs=E(this.rhs,S,C)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}}class a extends i{constructor(S,C,U){super(),this.lhs=S,this.rhs=C,this.sideEffects=U}render({_n:S}){return`${this.lhs} = ${this.rhs};`+S}optimizeNames(S,C){if(!(this.lhs instanceof t.Name&&!S[this.lhs.str]&&!this.sideEffects))return this.rhs=E(this.rhs,S,C),this}get names(){const S=this.lhs instanceof t.Name?{}:{...this.lhs.names};return q(S,this.rhs)}}class l extends a{constructor(S,C,U,Y){super(S,U,Y),this.op=C}render({_n:S}){return`${this.lhs} ${this.op}= ${this.rhs};`+S}}class u extends i{constructor(S){super(),this.label=S,this.names={}}render({_n:S}){return`${this.label}:`+S}}class d extends i{constructor(S){super(),this.label=S,this.names={}}render({_n:S}){return`break${this.label?` ${this.label}`:""};`+S}}class c extends i{constructor(S){super(),this.error=S}render({_n:S}){return`throw ${this.error};`+S}get names(){return this.error.names}}class f extends i{constructor(S){super(),this.code=S}render({_n:S}){return`${this.code};`+S}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(S,C){return this.code=E(this.code,S,C),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}}class m extends i{constructor(S=[]){super(),this.nodes=S}render(S){return this.nodes.reduce((C,U)=>C+U.render(S),"")}optimizeNodes(){const{nodes:S}=this;let C=S.length;for(;C--;){const U=S[C].optimizeNodes();Array.isArray(U)?S.splice(C,1,...U):U?S[C]=U:S.splice(C,1)}return S.length>0?this:void 0}optimizeNames(S,C){const{nodes:U}=this;let Y=U.length;for(;Y--;){const X=U[Y];X.optimizeNames(S,C)||(O(S,X.names),U.splice(Y,1))}return U.length>0?this:void 0}get names(){return this.nodes.reduce((S,C)=>H(S,C.names),{})}}class y extends m{render(S){return"{"+S._n+super.render(S)+"}"+S._n}}class v extends m{}class w extends y{}w.kind="else";class h extends y{constructor(S,C){super(C),this.condition=S}render(S){let C=`if(${this.condition})`+super.render(S);return this.else&&(C+="else "+this.else.render(S)),C}optimizeNodes(){super.optimizeNodes();const S=this.condition;if(S===!0)return this.nodes;let C=this.else;if(C){const U=C.optimizeNodes();C=this.else=Array.isArray(U)?new w(U):U}if(C)return S===!1?C instanceof h?C:C.nodes:this.nodes.length?this:new h(M(S),C instanceof h?[C]:C.nodes);if(!(S===!1||!this.nodes.length))return this}optimizeNames(S,C){var U;if(this.else=(U=this.else)===null||U===void 0?void 0:U.optimizeNames(S,C),!!(super.optimizeNames(S,C)||this.else))return this.condition=E(this.condition,S,C),this}get names(){const S=super.names;return q(S,this.condition),this.else&&H(S,this.else.names),S}}h.kind="if";class g extends y{}g.kind="for";class p extends g{constructor(S){super(),this.iteration=S}render(S){return`for(${this.iteration})`+super.render(S)}optimizeNames(S,C){if(super.optimizeNames(S,C))return this.iteration=E(this.iteration,S,C),this}get names(){return H(super.names,this.iteration.names)}}class _ extends g{constructor(S,C,U,Y){super(),this.varKind=S,this.name=C,this.from=U,this.to=Y}render(S){const C=S.es5?n.varKinds.var:this.varKind,{name:U,from:Y,to:X}=this;return`for(${C} ${U}=${Y}; ${U}<${X}; ${U}++)`+super.render(S)}get names(){const S=q(super.names,this.from);return q(S,this.to)}}class x extends g{constructor(S,C,U,Y){super(),this.loop=S,this.varKind=C,this.name=U,this.iterable=Y}render(S){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(S)}optimizeNames(S,C){if(super.optimizeNames(S,C))return this.iterable=E(this.iterable,S,C),this}get names(){return H(super.names,this.iterable.names)}}class k extends y{constructor(S,C,U){super(),this.name=S,this.args=C,this.async=U}render(S){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(S)}}k.kind="func";class P extends m{render(S){return"return "+super.render(S)}}P.kind="return";class b extends y{render(S){let C="try"+super.render(S);return this.catch&&(C+=this.catch.render(S)),this.finally&&(C+=this.finally.render(S)),C}optimizeNodes(){var S,C;return super.optimizeNodes(),(S=this.catch)===null||S===void 0||S.optimizeNodes(),(C=this.finally)===null||C===void 0||C.optimizeNodes(),this}optimizeNames(S,C){var U,Y;return super.optimizeNames(S,C),(U=this.catch)===null||U===void 0||U.optimizeNames(S,C),(Y=this.finally)===null||Y===void 0||Y.optimizeNames(S,C),this}get names(){const S=super.names;return this.catch&&H(S,this.catch.names),this.finally&&H(S,this.finally.names),S}}class F extends y{constructor(S){super(),this.error=S}render(S){return`catch(${this.error})`+super.render(S)}}F.kind="catch";class W extends y{render(S){return"finally"+super.render(S)}}W.kind="finally";class I{constructor(S,C={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...C,_n:C.lines?`
|
|
219
|
+
`:""},this._extScope=S,this._scope=new n.Scope({parent:S}),this._nodes=[new v]}toString(){return this._root.render(this.opts)}name(S){return this._scope.name(S)}scopeName(S){return this._extScope.name(S)}scopeValue(S,C){const U=this._extScope.value(S,C);return(this._values[U.prefix]||(this._values[U.prefix]=new Set)).add(U),U}getScopeValue(S,C){return this._extScope.getValue(S,C)}scopeRefs(S){return this._extScope.scopeRefs(S,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(S,C,U,Y){const X=this._scope.toName(C);return U!==void 0&&Y&&(this._constants[X.str]=U),this._leafNode(new s(S,X,U)),X}const(S,C,U){return this._def(n.varKinds.const,S,C,U)}let(S,C,U){return this._def(n.varKinds.let,S,C,U)}var(S,C,U){return this._def(n.varKinds.var,S,C,U)}assign(S,C,U){return this._leafNode(new a(S,C,U))}add(S,C){return this._leafNode(new l(S,e.operators.ADD,C))}code(S){return typeof S=="function"?S():S!==t.nil&&this._leafNode(new f(S)),this}object(...S){const C=["{"];for(const[U,Y]of S)C.length>1&&C.push(","),C.push(U),(U!==Y||this.opts.es5)&&(C.push(":"),(0,t.addCodeArg)(C,Y));return C.push("}"),new t._Code(C)}if(S,C,U){if(this._blockNode(new h(S)),C&&U)this.code(C).else().code(U).endIf();else if(C)this.code(C).endIf();else if(U)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(S){return this._elseNode(new h(S))}else(){return this._elseNode(new w)}endIf(){return this._endBlockNode(h,w)}_for(S,C){return this._blockNode(S),C&&this.code(C).endFor(),this}for(S,C){return this._for(new p(S),C)}forRange(S,C,U,Y,X=this.opts.es5?n.varKinds.var:n.varKinds.let){const Z=this._scope.toName(S);return this._for(new _(X,Z,C,U),()=>Y(Z))}forOf(S,C,U,Y=n.varKinds.const){const X=this._scope.toName(S);if(this.opts.es5){const Z=C instanceof t.Name?C:this.var("_arr",C);return this.forRange("_i",0,(0,t._)`${Z}.length`,te=>{this.var(X,(0,t._)`${Z}[${te}]`),U(X)})}return this._for(new x("of",Y,X,C),()=>U(X))}forIn(S,C,U,Y=this.opts.es5?n.varKinds.var:n.varKinds.const){if(this.opts.ownProperties)return this.forOf(S,(0,t._)`Object.keys(${C})`,U);const X=this._scope.toName(S);return this._for(new x("in",Y,X,C),()=>U(X))}endFor(){return this._endBlockNode(g)}label(S){return this._leafNode(new u(S))}break(S){return this._leafNode(new d(S))}return(S){const C=new P;if(this._blockNode(C),this.code(S),C.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(P)}try(S,C,U){if(!C&&!U)throw new Error('CodeGen: "try" without "catch" and "finally"');const Y=new b;if(this._blockNode(Y),this.code(S),C){const X=this.name("e");this._currNode=Y.catch=new F(X),C(X)}return U&&(this._currNode=Y.finally=new W,this.code(U)),this._endBlockNode(F,W)}throw(S){return this._leafNode(new c(S))}block(S,C){return this._blockStarts.push(this._nodes.length),S&&this.code(S).endBlock(C),this}endBlock(S){const C=this._blockStarts.pop();if(C===void 0)throw new Error("CodeGen: not in self-balancing block");const U=this._nodes.length-C;if(U<0||S!==void 0&&U!==S)throw new Error(`CodeGen: wrong number of nodes: ${U} vs ${S} expected`);return this._nodes.length=C,this}func(S,C=t.nil,U,Y){return this._blockNode(new k(S,C,U)),Y&&this.code(Y).endFunc(),this}endFunc(){return this._endBlockNode(k)}optimize(S=1){for(;S-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(S){return this._currNode.nodes.push(S),this}_blockNode(S){this._currNode.nodes.push(S),this._nodes.push(S)}_endBlockNode(S,C){const U=this._currNode;if(U instanceof S||C&&U instanceof C)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${C?`${S.kind}/${C.kind}`:S.kind}"`)}_elseNode(S){const C=this._currNode;if(!(C instanceof h))throw new Error('CodeGen: "else" without "if"');return this._currNode=C.else=S,this}get _root(){return this._nodes[0]}get _currNode(){const S=this._nodes;return S[S.length-1]}set _currNode(S){const C=this._nodes;C[C.length-1]=S}}e.CodeGen=I;function H(D,S){for(const C in S)D[C]=(D[C]||0)+(S[C]||0);return D}function q(D,S){return S instanceof t._CodeOrName?H(D,S.names):D}function E(D,S,C){if(D instanceof t.Name)return U(D);if(!Y(D))return D;return new t._Code(D._items.reduce((X,Z)=>(Z instanceof t.Name&&(Z=U(Z)),Z instanceof t._Code?X.push(...Z._items):X.push(Z),X),[]));function U(X){const Z=C[X.str];return Z===void 0||S[X.str]!==1?X:(delete S[X.str],Z)}function Y(X){return X instanceof t._Code&&X._items.some(Z=>Z instanceof t.Name&&S[Z.str]===1&&C[Z.str]!==void 0)}}function O(D,S){for(const C in S)D[C]=(D[C]||0)-(S[C]||0)}function M(D){return typeof D=="boolean"||typeof D=="number"||D===null?!D:(0,t._)`!${R(D)}`}e.not=M;const V=N(e.operators.AND);function j(...D){return D.reduce(V)}e.and=j;const z=N(e.operators.OR);function T(...D){return D.reduce(z)}e.or=T;function N(D){return(S,C)=>S===t.nil?C:C===t.nil?S:(0,t._)`${R(S)} ${D} ${R(C)}`}function R(D){return D instanceof t.Name?D:(0,t._)`(${D})`}})(ie);var ee={};Object.defineProperty(ee,"__esModule",{value:!0});ee.checkStrictMode=ee.getErrorPath=ee.Type=ee.useFunc=ee.setEvaluated=ee.evaluatedPropsToName=ee.mergeEvaluated=ee.eachItem=ee.unescapeJsonPointer=ee.escapeJsonPointer=ee.escapeFragment=ee.unescapeFragment=ee.schemaRefOrVal=ee.schemaHasRulesButRef=ee.schemaHasRules=ee.checkUnknownRules=ee.alwaysValidSchema=ee.toHash=void 0;const he=ie,Gb=Fi;function Qb(e){const t={};for(const n of e)t[n]=!0;return t}ee.toHash=Qb;function Zb(e,t){return typeof t=="boolean"?t:Object.keys(t).length===0?!0:(g1(e,t),!y1(t,e.self.RULES.all))}ee.alwaysValidSchema=Zb;function g1(e,t=e.schema){const{opts:n,self:r}=e;if(!n.strictSchema||typeof t=="boolean")return;const o=r.RULES.keywords;for(const i in t)o[i]||_1(e,`unknown keyword: "${i}"`)}ee.checkUnknownRules=g1;function y1(e,t){if(typeof e=="boolean")return!e;for(const n in e)if(t[n])return!0;return!1}ee.schemaHasRules=y1;function Jb(e,t){if(typeof e=="boolean")return!e;for(const n in e)if(n!=="$ref"&&t.all[n])return!0;return!1}ee.schemaHasRulesButRef=Jb;function ej({topSchemaRef:e,schemaPath:t},n,r,o){if(!o){if(typeof n=="number"||typeof n=="boolean")return n;if(typeof n=="string")return(0,he._)`${n}`}return(0,he._)`${e}${t}${(0,he.getProperty)(r)}`}ee.schemaRefOrVal=ej;function tj(e){return v1(decodeURIComponent(e))}ee.unescapeFragment=tj;function nj(e){return encodeURIComponent(tf(e))}ee.escapeFragment=nj;function tf(e){return typeof e=="number"?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}ee.escapeJsonPointer=tf;function v1(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}ee.unescapeJsonPointer=v1;function rj(e,t){if(Array.isArray(e))for(const n of e)t(n);else t(e)}ee.eachItem=rj;function wm({mergeNames:e,mergeToName:t,mergeValues:n,resultToName:r}){return(o,i,s,a)=>{const l=s===void 0?i:s instanceof he.Name?(i instanceof he.Name?e(o,i,s):t(o,i,s),s):i instanceof he.Name?(t(o,s,i),i):n(i,s);return a===he.Name&&!(l instanceof he.Name)?r(o,l):l}}ee.mergeEvaluated={props:wm({mergeNames:(e,t,n)=>e.if((0,he._)`${n} !== true && ${t} !== undefined`,()=>{e.if((0,he._)`${t} === true`,()=>e.assign(n,!0),()=>e.assign(n,(0,he._)`${n} || {}`).code((0,he._)`Object.assign(${n}, ${t})`))}),mergeToName:(e,t,n)=>e.if((0,he._)`${n} !== true`,()=>{t===!0?e.assign(n,!0):(e.assign(n,(0,he._)`${n} || {}`),nf(e,n,t))}),mergeValues:(e,t)=>e===!0?!0:{...e,...t},resultToName:w1}),items:wm({mergeNames:(e,t,n)=>e.if((0,he._)`${n} !== true && ${t} !== undefined`,()=>e.assign(n,(0,he._)`${t} === true ? true : ${n} > ${t} ? ${n} : ${t}`)),mergeToName:(e,t,n)=>e.if((0,he._)`${n} !== true`,()=>e.assign(n,t===!0?!0:(0,he._)`${n} > ${t} ? ${n} : ${t}`)),mergeValues:(e,t)=>e===!0?!0:Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})};function w1(e,t){if(t===!0)return e.var("props",!0);const n=e.var("props",(0,he._)`{}`);return t!==void 0&&nf(e,n,t),n}ee.evaluatedPropsToName=w1;function nf(e,t,n){Object.keys(n).forEach(r=>e.assign((0,he._)`${t}${(0,he.getProperty)(r)}`,!0))}ee.setEvaluated=nf;const _m={};function oj(e,t){return e.scopeValue("func",{ref:t,code:_m[t.code]||(_m[t.code]=new Gb._Code(t.code))})}ee.useFunc=oj;var Ic;(function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"})(Ic||(ee.Type=Ic={}));function ij(e,t,n){if(e instanceof he.Name){const r=t===Ic.Num;return n?r?(0,he._)`"[" + ${e} + "]"`:(0,he._)`"['" + ${e} + "']"`:r?(0,he._)`"/" + ${e}`:(0,he._)`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return n?(0,he.getProperty)(e).toString():"/"+tf(e)}ee.getErrorPath=ij;function _1(e,t,n=e.opts.strictSchema){if(n){if(t=`strict mode: ${t}`,n===!0)throw new Error(t);e.self.logger.warn(t)}}ee.checkStrictMode=_1;var mt={};Object.defineProperty(mt,"__esModule",{value:!0});const qe=ie,sj={data:new qe.Name("data"),valCxt:new qe.Name("valCxt"),instancePath:new qe.Name("instancePath"),parentData:new qe.Name("parentData"),parentDataProperty:new qe.Name("parentDataProperty"),rootData:new qe.Name("rootData"),dynamicAnchors:new qe.Name("dynamicAnchors"),vErrors:new qe.Name("vErrors"),errors:new qe.Name("errors"),this:new qe.Name("this"),self:new qe.Name("self"),scope:new qe.Name("scope"),json:new qe.Name("json"),jsonPos:new qe.Name("jsonPos"),jsonLen:new qe.Name("jsonLen"),jsonPart:new qe.Name("jsonPart")};mt.default=sj;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;const t=ie,n=ee,r=mt;e.keywordError={message:({keyword:w})=>(0,t.str)`must pass "${w}" keyword validation`},e.keyword$DataError={message:({keyword:w,schemaType:h})=>h?(0,t.str)`"${w}" keyword must be ${h} ($data)`:(0,t.str)`"${w}" keyword is invalid ($data)`};function o(w,h=e.keywordError,g,p){const{it:_}=w,{gen:x,compositeRule:k,allErrors:P}=_,b=c(w,h,g);p??(k||P)?l(x,b):u(_,(0,t._)`[${b}]`)}e.reportError=o;function i(w,h=e.keywordError,g){const{it:p}=w,{gen:_,compositeRule:x,allErrors:k}=p,P=c(w,h,g);l(_,P),x||k||u(p,r.default.vErrors)}e.reportExtraError=i;function s(w,h){w.assign(r.default.errors,h),w.if((0,t._)`${r.default.vErrors} !== null`,()=>w.if(h,()=>w.assign((0,t._)`${r.default.vErrors}.length`,h),()=>w.assign(r.default.vErrors,null)))}e.resetErrorsCount=s;function a({gen:w,keyword:h,schemaValue:g,data:p,errsCount:_,it:x}){if(_===void 0)throw new Error("ajv implementation error");const k=w.name("err");w.forRange("i",_,r.default.errors,P=>{w.const(k,(0,t._)`${r.default.vErrors}[${P}]`),w.if((0,t._)`${k}.instancePath === undefined`,()=>w.assign((0,t._)`${k}.instancePath`,(0,t.strConcat)(r.default.instancePath,x.errorPath))),w.assign((0,t._)`${k}.schemaPath`,(0,t.str)`${x.errSchemaPath}/${h}`),x.opts.verbose&&(w.assign((0,t._)`${k}.schema`,g),w.assign((0,t._)`${k}.data`,p))})}e.extendErrors=a;function l(w,h){const g=w.const("err",h);w.if((0,t._)`${r.default.vErrors} === null`,()=>w.assign(r.default.vErrors,(0,t._)`[${g}]`),(0,t._)`${r.default.vErrors}.push(${g})`),w.code((0,t._)`${r.default.errors}++`)}function u(w,h){const{gen:g,validateName:p,schemaEnv:_}=w;_.$async?g.throw((0,t._)`new ${w.ValidationError}(${h})`):(g.assign((0,t._)`${p}.errors`,h),g.return(!1))}const d={keyword:new t.Name("keyword"),schemaPath:new t.Name("schemaPath"),params:new t.Name("params"),propertyName:new t.Name("propertyName"),message:new t.Name("message"),schema:new t.Name("schema"),parentSchema:new t.Name("parentSchema")};function c(w,h,g){const{createErrors:p}=w.it;return p===!1?(0,t._)`{}`:f(w,h,g)}function f(w,h,g={}){const{gen:p,it:_}=w,x=[m(_,g),y(w,g)];return v(w,h,x),p.object(...x)}function m({errorPath:w},{instancePath:h}){const g=h?(0,t.str)`${w}${(0,n.getErrorPath)(h,n.Type.Str)}`:w;return[r.default.instancePath,(0,t.strConcat)(r.default.instancePath,g)]}function y({keyword:w,it:{errSchemaPath:h}},{schemaPath:g,parentSchema:p}){let _=p?h:(0,t.str)`${h}/${w}`;return g&&(_=(0,t.str)`${_}${(0,n.getErrorPath)(g,n.Type.Str)}`),[d.schemaPath,_]}function v(w,{params:h,message:g},p){const{keyword:_,data:x,schemaValue:k,it:P}=w,{opts:b,propertyName:F,topSchemaRef:W,schemaPath:I}=P;p.push([d.keyword,_],[d.params,typeof h=="function"?h(w):h||(0,t._)`{}`]),b.messages&&p.push([d.message,typeof g=="function"?g(w):g]),b.verbose&&p.push([d.schema,k],[d.parentSchema,(0,t._)`${W}${I}`],[r.default.data,x]),F&&p.push([d.propertyName,F])}})(Ji);var $m;function aj(){if($m)return Qn;$m=1,Object.defineProperty(Qn,"__esModule",{value:!0}),Qn.boolOrEmptySchema=Qn.topBoolOrEmptySchema=void 0;const e=Ji,t=ie,n=mt,r={message:"boolean schema is false"};function o(a){const{gen:l,schema:u,validateName:d}=a;u===!1?s(a,!1):typeof u=="object"&&u.$async===!0?l.return(n.default.data):(l.assign((0,t._)`${d}.errors`,null),l.return(!0))}Qn.topBoolOrEmptySchema=o;function i(a,l){const{gen:u,schema:d}=a;d===!1?(u.var(l,!1),s(a)):u.var(l,!0)}Qn.boolOrEmptySchema=i;function s(a,l){const{gen:u,data:d}=a,c={gen:u,keyword:"false schema",data:d,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:a};(0,e.reportError)(c,r,void 0,l)}return Qn}var Re={},Sr={};Object.defineProperty(Sr,"__esModule",{value:!0});Sr.getRules=Sr.isJSONType=void 0;const lj=["string","number","integer","boolean","null","object","array"],uj=new Set(lj);function cj(e){return typeof e=="string"&&uj.has(e)}Sr.isJSONType=cj;function dj(){const e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}Sr.getRules=dj;var dn={};Object.defineProperty(dn,"__esModule",{value:!0});dn.shouldUseRule=dn.shouldUseGroup=dn.schemaHasRulesForType=void 0;function fj({schema:e,self:t},n){const r=t.RULES.types[n];return r&&r!==!0&&$1(e,r)}dn.schemaHasRulesForType=fj;function $1(e,t){return t.rules.some(n=>x1(e,n))}dn.shouldUseGroup=$1;function x1(e,t){var n;return e[t.keyword]!==void 0||((n=t.definition.implements)===null||n===void 0?void 0:n.some(r=>e[r]!==void 0))}dn.shouldUseRule=x1;Object.defineProperty(Re,"__esModule",{value:!0});Re.reportTypeError=Re.checkDataTypes=Re.checkDataType=Re.coerceAndCheckDataType=Re.getJSONTypes=Re.getSchemaTypes=Re.DataType=void 0;const hj=Sr,pj=dn,mj=Ji,se=ie,S1=ee;var no;(function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"})(no||(Re.DataType=no={}));function gj(e){const t=E1(e.type);if(t.includes("null")){if(e.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!t.length&&e.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');e.nullable===!0&&t.push("null")}return t}Re.getSchemaTypes=gj;function E1(e){const t=Array.isArray(e)?e:e?[e]:[];if(t.every(hj.isJSONType))return t;throw new Error("type must be JSONType or JSONType[]: "+t.join(","))}Re.getJSONTypes=E1;function yj(e,t){const{gen:n,data:r,opts:o}=e,i=vj(t,o.coerceTypes),s=t.length>0&&!(i.length===0&&t.length===1&&(0,pj.schemaHasRulesForType)(e,t[0]));if(s){const a=rf(t,r,o.strictNumbers,no.Wrong);n.if(a,()=>{i.length?wj(e,t,i):of(e)})}return s}Re.coerceAndCheckDataType=yj;const k1=new Set(["string","number","integer","boolean","null"]);function vj(e,t){return t?e.filter(n=>k1.has(n)||t==="array"&&n==="array"):[]}function wj(e,t,n){const{gen:r,data:o,opts:i}=e,s=r.let("dataType",(0,se._)`typeof ${o}`),a=r.let("coerced",(0,se._)`undefined`);i.coerceTypes==="array"&&r.if((0,se._)`${s} == 'object' && Array.isArray(${o}) && ${o}.length == 1`,()=>r.assign(o,(0,se._)`${o}[0]`).assign(s,(0,se._)`typeof ${o}`).if(rf(t,o,i.strictNumbers),()=>r.assign(a,o))),r.if((0,se._)`${a} !== undefined`);for(const u of n)(k1.has(u)||u==="array"&&i.coerceTypes==="array")&&l(u);r.else(),of(e),r.endIf(),r.if((0,se._)`${a} !== undefined`,()=>{r.assign(o,a),_j(e,a)});function l(u){switch(u){case"string":r.elseIf((0,se._)`${s} == "number" || ${s} == "boolean"`).assign(a,(0,se._)`"" + ${o}`).elseIf((0,se._)`${o} === null`).assign(a,(0,se._)`""`);return;case"number":r.elseIf((0,se._)`${s} == "boolean" || ${o} === null
|
|
220
|
+
|| (${s} == "string" && ${o} && ${o} == +${o})`).assign(a,(0,se._)`+${o}`);return;case"integer":r.elseIf((0,se._)`${s} === "boolean" || ${o} === null
|
|
221
|
+
|| (${s} === "string" && ${o} && ${o} == +${o} && !(${o} % 1))`).assign(a,(0,se._)`+${o}`);return;case"boolean":r.elseIf((0,se._)`${o} === "false" || ${o} === 0 || ${o} === null`).assign(a,!1).elseIf((0,se._)`${o} === "true" || ${o} === 1`).assign(a,!0);return;case"null":r.elseIf((0,se._)`${o} === "" || ${o} === 0 || ${o} === false`),r.assign(a,null);return;case"array":r.elseIf((0,se._)`${s} === "string" || ${s} === "number"
|
|
222
|
+
|| ${s} === "boolean" || ${o} === null`).assign(a,(0,se._)`[${o}]`)}}}function _j({gen:e,parentData:t,parentDataProperty:n},r){e.if((0,se._)`${t} !== undefined`,()=>e.assign((0,se._)`${t}[${n}]`,r))}function Rc(e,t,n,r=no.Correct){const o=r===no.Correct?se.operators.EQ:se.operators.NEQ;let i;switch(e){case"null":return(0,se._)`${t} ${o} null`;case"array":i=(0,se._)`Array.isArray(${t})`;break;case"object":i=(0,se._)`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":i=s((0,se._)`!(${t} % 1) && !isNaN(${t})`);break;case"number":i=s();break;default:return(0,se._)`typeof ${t} ${o} ${e}`}return r===no.Correct?i:(0,se.not)(i);function s(a=se.nil){return(0,se.and)((0,se._)`typeof ${t} == "number"`,a,n?(0,se._)`isFinite(${t})`:se.nil)}}Re.checkDataType=Rc;function rf(e,t,n,r){if(e.length===1)return Rc(e[0],t,n,r);let o;const i=(0,S1.toHash)(e);if(i.array&&i.object){const s=(0,se._)`typeof ${t} != "object"`;o=i.null?s:(0,se._)`!${t} || ${s}`,delete i.null,delete i.array,delete i.object}else o=se.nil;i.number&&delete i.integer;for(const s in i)o=(0,se.and)(o,Rc(s,t,n,r));return o}Re.checkDataTypes=rf;const $j={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>typeof e=="string"?(0,se._)`{type: ${e}}`:(0,se._)`{type: ${t}}`};function of(e){const t=xj(e);(0,mj.reportError)(t,$j)}Re.reportTypeError=of;function xj(e){const{gen:t,data:n,schema:r}=e,o=(0,S1.schemaRefOrVal)(e,r,"type");return{gen:t,keyword:"type",data:n,schema:r.type,schemaCode:o,schemaValue:o,parentSchema:r,params:{},it:e}}var Ho={},xm;function Sj(){if(xm)return Ho;xm=1,Object.defineProperty(Ho,"__esModule",{value:!0}),Ho.assignDefaults=void 0;const e=ie,t=ee;function n(o,i){const{properties:s,items:a}=o.schema;if(i==="object"&&s)for(const l in s)r(o,l,s[l].default);else i==="array"&&Array.isArray(a)&&a.forEach((l,u)=>r(o,u,l.default))}Ho.assignDefaults=n;function r(o,i,s){const{gen:a,compositeRule:l,data:u,opts:d}=o;if(s===void 0)return;const c=(0,e._)`${u}${(0,e.getProperty)(i)}`;if(l){(0,t.checkStrictMode)(o,`default is ignored for: ${c}`);return}let f=(0,e._)`${c} === undefined`;d.useDefaults==="empty"&&(f=(0,e._)`${f} || ${c} === null || ${c} === ""`),a.if(f,(0,e._)`${c} = ${(0,e.stringify)(s)}`)}return Ho}var Ct={},de={},Sm;function Bt(){if(Sm)return de;Sm=1,Object.defineProperty(de,"__esModule",{value:!0}),de.validateUnion=de.validateArray=de.usePattern=de.callValidateCode=de.schemaProperties=de.allSchemaProperties=de.noPropertyInData=de.propertyInData=de.isOwnProperty=de.hasPropFunc=de.reportMissingProp=de.checkMissingProp=de.checkReportMissingProp=void 0;const e=ie,t=ee,n=mt,r=ee;function o(g,p){const{gen:_,data:x,it:k}=g;_.if(d(_,x,p,k.opts.ownProperties),()=>{g.setParams({missingProperty:(0,e._)`${p}`},!0),g.error()})}de.checkReportMissingProp=o;function i({gen:g,data:p,it:{opts:_}},x,k){return(0,e.or)(...x.map(P=>(0,e.and)(d(g,p,P,_.ownProperties),(0,e._)`${k} = ${P}`)))}de.checkMissingProp=i;function s(g,p){g.setParams({missingProperty:p},!0),g.error()}de.reportMissingProp=s;function a(g){return g.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,e._)`Object.prototype.hasOwnProperty`})}de.hasPropFunc=a;function l(g,p,_){return(0,e._)`${a(g)}.call(${p}, ${_})`}de.isOwnProperty=l;function u(g,p,_,x){const k=(0,e._)`${p}${(0,e.getProperty)(_)} !== undefined`;return x?(0,e._)`${k} && ${l(g,p,_)}`:k}de.propertyInData=u;function d(g,p,_,x){const k=(0,e._)`${p}${(0,e.getProperty)(_)} === undefined`;return x?(0,e.or)(k,(0,e.not)(l(g,p,_))):k}de.noPropertyInData=d;function c(g){return g?Object.keys(g).filter(p=>p!=="__proto__"):[]}de.allSchemaProperties=c;function f(g,p){return c(p).filter(_=>!(0,t.alwaysValidSchema)(g,p[_]))}de.schemaProperties=f;function m({schemaCode:g,data:p,it:{gen:_,topSchemaRef:x,schemaPath:k,errorPath:P},it:b},F,W,I){const H=I?(0,e._)`${g}, ${p}, ${x}${k}`:p,q=[[n.default.instancePath,(0,e.strConcat)(n.default.instancePath,P)],[n.default.parentData,b.parentData],[n.default.parentDataProperty,b.parentDataProperty],[n.default.rootData,n.default.rootData]];b.opts.dynamicRef&&q.push([n.default.dynamicAnchors,n.default.dynamicAnchors]);const E=(0,e._)`${H}, ${_.object(...q)}`;return W!==e.nil?(0,e._)`${F}.call(${W}, ${E})`:(0,e._)`${F}(${E})`}de.callValidateCode=m;const y=(0,e._)`new RegExp`;function v({gen:g,it:{opts:p}},_){const x=p.unicodeRegExp?"u":"",{regExp:k}=p.code,P=k(_,x);return g.scopeValue("pattern",{key:P.toString(),ref:P,code:(0,e._)`${k.code==="new RegExp"?y:(0,r.useFunc)(g,k)}(${_}, ${x})`})}de.usePattern=v;function w(g){const{gen:p,data:_,keyword:x,it:k}=g,P=p.name("valid");if(k.allErrors){const F=p.let("valid",!0);return b(()=>p.assign(F,!1)),F}return p.var(P,!0),b(()=>p.break()),P;function b(F){const W=p.const("len",(0,e._)`${_}.length`);p.forRange("i",0,W,I=>{g.subschema({keyword:x,dataProp:I,dataPropType:t.Type.Num},P),p.if((0,e.not)(P),F)})}}de.validateArray=w;function h(g){const{gen:p,schema:_,keyword:x,it:k}=g;if(!Array.isArray(_))throw new Error("ajv implementation error");if(_.some(W=>(0,t.alwaysValidSchema)(k,W))&&!k.opts.unevaluated)return;const b=p.let("valid",!1),F=p.name("_valid");p.block(()=>_.forEach((W,I)=>{const H=g.subschema({keyword:x,schemaProp:I,compositeRule:!0},F);p.assign(b,(0,e._)`${b} || ${F}`),g.mergeValidEvaluated(H,F)||p.if((0,e.not)(b))})),g.result(b,()=>g.reset(),()=>g.error(!0))}return de.validateUnion=h,de}var Em;function Ej(){if(Em)return Ct;Em=1,Object.defineProperty(Ct,"__esModule",{value:!0}),Ct.validateKeywordUsage=Ct.validSchemaType=Ct.funcKeywordCode=Ct.macroKeywordCode=void 0;const e=ie,t=mt,n=Bt(),r=Ji;function o(f,m){const{gen:y,keyword:v,schema:w,parentSchema:h,it:g}=f,p=m.macro.call(g.self,w,h,g),_=u(y,v,p);g.opts.validateSchema!==!1&&g.self.validateSchema(p,!0);const x=y.name("valid");f.subschema({schema:p,schemaPath:e.nil,errSchemaPath:`${g.errSchemaPath}/${v}`,topSchemaRef:_,compositeRule:!0},x),f.pass(x,()=>f.error(!0))}Ct.macroKeywordCode=o;function i(f,m){var y;const{gen:v,keyword:w,schema:h,parentSchema:g,$data:p,it:_}=f;l(_,m);const x=!p&&m.compile?m.compile.call(_.self,h,g,_):m.validate,k=u(v,w,x),P=v.let("valid");f.block$data(P,b),f.ok((y=m.valid)!==null&&y!==void 0?y:P);function b(){if(m.errors===!1)I(),m.modifying&&s(f),H(()=>f.error());else{const q=m.async?F():W();m.modifying&&s(f),H(()=>a(f,q))}}function F(){const q=v.let("ruleErrs",null);return v.try(()=>I((0,e._)`await `),E=>v.assign(P,!1).if((0,e._)`${E} instanceof ${_.ValidationError}`,()=>v.assign(q,(0,e._)`${E}.errors`),()=>v.throw(E))),q}function W(){const q=(0,e._)`${k}.errors`;return v.assign(q,null),I(e.nil),q}function I(q=m.async?(0,e._)`await `:e.nil){const E=_.opts.passContext?t.default.this:t.default.self,O=!("compile"in m&&!p||m.schema===!1);v.assign(P,(0,e._)`${q}${(0,n.callValidateCode)(f,k,E,O)}`,m.modifying)}function H(q){var E;v.if((0,e.not)((E=m.valid)!==null&&E!==void 0?E:P),q)}}Ct.funcKeywordCode=i;function s(f){const{gen:m,data:y,it:v}=f;m.if(v.parentData,()=>m.assign(y,(0,e._)`${v.parentData}[${v.parentDataProperty}]`))}function a(f,m){const{gen:y}=f;y.if((0,e._)`Array.isArray(${m})`,()=>{y.assign(t.default.vErrors,(0,e._)`${t.default.vErrors} === null ? ${m} : ${t.default.vErrors}.concat(${m})`).assign(t.default.errors,(0,e._)`${t.default.vErrors}.length`),(0,r.extendErrors)(f)},()=>f.error())}function l({schemaEnv:f},m){if(m.async&&!f.$async)throw new Error("async keyword in sync schema")}function u(f,m,y){if(y===void 0)throw new Error(`keyword "${m}" failed to compile`);return f.scopeValue("keyword",typeof y=="function"?{ref:y}:{ref:y,code:(0,e.stringify)(y)})}function d(f,m,y=!1){return!m.length||m.some(v=>v==="array"?Array.isArray(f):v==="object"?f&&typeof f=="object"&&!Array.isArray(f):typeof f==v||y&&typeof f>"u")}Ct.validSchemaType=d;function c({schema:f,opts:m,self:y,errSchemaPath:v},w,h){if(Array.isArray(w.keyword)?!w.keyword.includes(h):w.keyword!==h)throw new Error("ajv implementation error");const g=w.dependencies;if(g!=null&&g.some(p=>!Object.prototype.hasOwnProperty.call(f,p)))throw new Error(`parent schema must have dependencies of ${h}: ${g.join(",")}`);if(w.validateSchema&&!w.validateSchema(f[h])){const _=`keyword "${h}" value is invalid at path "${v}": `+y.errorsText(w.validateSchema.errors);if(m.validateSchema==="log")y.logger.error(_);else throw new Error(_)}}return Ct.validateKeywordUsage=c,Ct}var nn={},km;function kj(){if(km)return nn;km=1,Object.defineProperty(nn,"__esModule",{value:!0}),nn.extendSubschemaMode=nn.extendSubschemaData=nn.getSubschema=void 0;const e=ie,t=ee;function n(i,{keyword:s,schemaProp:a,schema:l,schemaPath:u,errSchemaPath:d,topSchemaRef:c}){if(s!==void 0&&l!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(s!==void 0){const f=i.schema[s];return a===void 0?{schema:f,schemaPath:(0,e._)`${i.schemaPath}${(0,e.getProperty)(s)}`,errSchemaPath:`${i.errSchemaPath}/${s}`}:{schema:f[a],schemaPath:(0,e._)`${i.schemaPath}${(0,e.getProperty)(s)}${(0,e.getProperty)(a)}`,errSchemaPath:`${i.errSchemaPath}/${s}/${(0,t.escapeFragment)(a)}`}}if(l!==void 0){if(u===void 0||d===void 0||c===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:l,schemaPath:u,topSchemaRef:c,errSchemaPath:d}}throw new Error('either "keyword" or "schema" must be passed')}nn.getSubschema=n;function r(i,s,{dataProp:a,dataPropType:l,data:u,dataTypes:d,propertyName:c}){if(u!==void 0&&a!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:f}=s;if(a!==void 0){const{errorPath:y,dataPathArr:v,opts:w}=s,h=f.let("data",(0,e._)`${s.data}${(0,e.getProperty)(a)}`,!0);m(h),i.errorPath=(0,e.str)`${y}${(0,t.getErrorPath)(a,l,w.jsPropertySyntax)}`,i.parentDataProperty=(0,e._)`${a}`,i.dataPathArr=[...v,i.parentDataProperty]}if(u!==void 0){const y=u instanceof e.Name?u:f.let("data",u,!0);m(y),c!==void 0&&(i.propertyName=c)}d&&(i.dataTypes=d);function m(y){i.data=y,i.dataLevel=s.dataLevel+1,i.dataTypes=[],s.definedProperties=new Set,i.parentData=s.data,i.dataNames=[...s.dataNames,y]}}nn.extendSubschemaData=r;function o(i,{jtdDiscriminator:s,jtdMetadata:a,compositeRule:l,createErrors:u,allErrors:d}){l!==void 0&&(i.compositeRule=l),u!==void 0&&(i.createErrors=u),d!==void 0&&(i.allErrors=d),i.jtdDiscriminator=s,i.jtdMetadata=a}return nn.extendSubschemaMode=o,nn}var Fe={},N1=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t=="object"&&typeof n=="object"){if(t.constructor!==n.constructor)return!1;var r,o,i;if(Array.isArray(t)){if(r=t.length,r!=n.length)return!1;for(o=r;o--!==0;)if(!e(t[o],n[o]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(i=Object.keys(t),r=i.length,r!==Object.keys(n).length)return!1;for(o=r;o--!==0;)if(!Object.prototype.hasOwnProperty.call(n,i[o]))return!1;for(o=r;o--!==0;){var s=i[o];if(!e(t[s],n[s]))return!1}return!0}return t!==t&&n!==n},P1={exports:{}},Rn=P1.exports=function(e,t,n){typeof t=="function"&&(n=t,t={}),n=t.cb||n;var r=typeof n=="function"?n:n.pre||function(){},o=n.post||function(){};ea(t,r,o,e,"",e)};Rn.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};Rn.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};Rn.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};Rn.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function ea(e,t,n,r,o,i,s,a,l,u){if(r&&typeof r=="object"&&!Array.isArray(r)){t(r,o,i,s,a,l,u);for(var d in r){var c=r[d];if(Array.isArray(c)){if(d in Rn.arrayKeywords)for(var f=0;f<c.length;f++)ea(e,t,n,c[f],o+"/"+d+"/"+f,i,o,d,r,f)}else if(d in Rn.propsKeywords){if(c&&typeof c=="object")for(var m in c)ea(e,t,n,c[m],o+"/"+d+"/"+Nj(m),i,o,d,r,m)}else(d in Rn.keywords||e.allKeys&&!(d in Rn.skipKeywords))&&ea(e,t,n,c,o+"/"+d,i,o,d,r)}n(r,o,i,s,a,l,u)}}function Nj(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}var Pj=P1.exports;Object.defineProperty(Fe,"__esModule",{value:!0});Fe.getSchemaRefs=Fe.resolveUrl=Fe.normalizeId=Fe._getFullPath=Fe.getFullPath=Fe.inlineRef=void 0;const Cj=ee,bj=N1,jj=Pj,Mj=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function Tj(e,t=!0){return typeof e=="boolean"?!0:t===!0?!zc(e):t?C1(e)<=t:!1}Fe.inlineRef=Tj;const Ij=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function zc(e){for(const t in e){if(Ij.has(t))return!0;const n=e[t];if(Array.isArray(n)&&n.some(zc)||typeof n=="object"&&zc(n))return!0}return!1}function C1(e){let t=0;for(const n in e){if(n==="$ref")return 1/0;if(t++,!Mj.has(n)&&(typeof e[n]=="object"&&(0,Cj.eachItem)(e[n],r=>t+=C1(r)),t===1/0))return 1/0}return t}function b1(e,t="",n){n!==!1&&(t=ro(t));const r=e.parse(t);return j1(e,r)}Fe.getFullPath=b1;function j1(e,t){return e.serialize(t).split("#")[0]+"#"}Fe._getFullPath=j1;const Rj=/#\/?$/;function ro(e){return e?e.replace(Rj,""):""}Fe.normalizeId=ro;function zj(e,t,n){return n=ro(n),e.resolve(t,n)}Fe.resolveUrl=zj;const Aj=/^[a-z_][-a-z0-9._]*$/i;function Oj(e,t){if(typeof e=="boolean")return{};const{schemaId:n,uriResolver:r}=this.opts,o=ro(e[n]||t),i={"":o},s=b1(r,o,!1),a={},l=new Set;return jj(e,{allKeys:!0},(c,f,m,y)=>{if(y===void 0)return;const v=s+f;let w=i[y];typeof c[n]=="string"&&(w=h.call(this,c[n])),g.call(this,c.$anchor),g.call(this,c.$dynamicAnchor),i[f]=w;function h(p){const _=this.opts.uriResolver.resolve;if(p=ro(w?_(w,p):p),l.has(p))throw d(p);l.add(p);let x=this.refs[p];return typeof x=="string"&&(x=this.refs[x]),typeof x=="object"?u(c,x.schema,p):p!==ro(v)&&(p[0]==="#"?(u(c,a[p],p),a[p]=c):this.refs[p]=v),p}function g(p){if(typeof p=="string"){if(!Aj.test(p))throw new Error(`invalid anchor "${p}"`);h.call(this,`#${p}`)}}}),a;function u(c,f,m){if(f!==void 0&&!bj(c,f))throw d(m)}function d(c){return new Error(`reference "${c}" resolves to more than one schema`)}}Fe.getSchemaRefs=Oj;var Nm;function es(){if(Nm)return tn;Nm=1,Object.defineProperty(tn,"__esModule",{value:!0}),tn.getData=tn.KeywordCxt=tn.validateFunctionCode=void 0;const e=aj(),t=Re,n=dn,r=Re,o=Sj(),i=Ej(),s=kj(),a=ie,l=mt,u=Fe,d=ee,c=Ji;function f(L){if(x(L)&&(P(L),_(L))){w(L);return}m(L,()=>(0,e.topBoolOrEmptySchema)(L))}tn.validateFunctionCode=f;function m({gen:L,validateName:B,schema:K,schemaEnv:G,opts:J},ne){J.code.es5?L.func(B,(0,a._)`${l.default.data}, ${l.default.valCxt}`,G.$async,()=>{L.code((0,a._)`"use strict"; ${g(K,J)}`),v(L,J),L.code(ne)}):L.func(B,(0,a._)`${l.default.data}, ${y(J)}`,G.$async,()=>L.code(g(K,J)).code(ne))}function y(L){return(0,a._)`{${l.default.instancePath}="", ${l.default.parentData}, ${l.default.parentDataProperty}, ${l.default.rootData}=${l.default.data}${L.dynamicRef?(0,a._)`, ${l.default.dynamicAnchors}={}`:a.nil}}={}`}function v(L,B){L.if(l.default.valCxt,()=>{L.var(l.default.instancePath,(0,a._)`${l.default.valCxt}.${l.default.instancePath}`),L.var(l.default.parentData,(0,a._)`${l.default.valCxt}.${l.default.parentData}`),L.var(l.default.parentDataProperty,(0,a._)`${l.default.valCxt}.${l.default.parentDataProperty}`),L.var(l.default.rootData,(0,a._)`${l.default.valCxt}.${l.default.rootData}`),B.dynamicRef&&L.var(l.default.dynamicAnchors,(0,a._)`${l.default.valCxt}.${l.default.dynamicAnchors}`)},()=>{L.var(l.default.instancePath,(0,a._)`""`),L.var(l.default.parentData,(0,a._)`undefined`),L.var(l.default.parentDataProperty,(0,a._)`undefined`),L.var(l.default.rootData,l.default.data),B.dynamicRef&&L.var(l.default.dynamicAnchors,(0,a._)`{}`)})}function w(L){const{schema:B,opts:K,gen:G}=L;m(L,()=>{K.$comment&&B.$comment&&q(L),W(L),G.let(l.default.vErrors,null),G.let(l.default.errors,0),K.unevaluated&&h(L),b(L),E(L)})}function h(L){const{gen:B,validateName:K}=L;L.evaluated=B.const("evaluated",(0,a._)`${K}.evaluated`),B.if((0,a._)`${L.evaluated}.dynamicProps`,()=>B.assign((0,a._)`${L.evaluated}.props`,(0,a._)`undefined`)),B.if((0,a._)`${L.evaluated}.dynamicItems`,()=>B.assign((0,a._)`${L.evaluated}.items`,(0,a._)`undefined`))}function g(L,B){const K=typeof L=="object"&&L[B.schemaId];return K&&(B.code.source||B.code.process)?(0,a._)`/*# sourceURL=${K} */`:a.nil}function p(L,B){if(x(L)&&(P(L),_(L))){k(L,B);return}(0,e.boolOrEmptySchema)(L,B)}function _({schema:L,self:B}){if(typeof L=="boolean")return!L;for(const K in L)if(B.RULES.all[K])return!0;return!1}function x(L){return typeof L.schema!="boolean"}function k(L,B){const{schema:K,gen:G,opts:J}=L;J.$comment&&K.$comment&&q(L),I(L),H(L);const ne=G.const("_errs",l.default.errors);b(L,ne),G.var(B,(0,a._)`${ne} === ${l.default.errors}`)}function P(L){(0,d.checkUnknownRules)(L),F(L)}function b(L,B){if(L.opts.jtd)return M(L,[],!1,B);const K=(0,t.getSchemaTypes)(L.schema),G=(0,t.coerceAndCheckDataType)(L,K);M(L,K,!G,B)}function F(L){const{schema:B,errSchemaPath:K,opts:G,self:J}=L;B.$ref&&G.ignoreKeywordsWithRef&&(0,d.schemaHasRulesButRef)(B,J.RULES)&&J.logger.warn(`$ref: keywords ignored in schema at path "${K}"`)}function W(L){const{schema:B,opts:K}=L;B.default!==void 0&&K.useDefaults&&K.strictSchema&&(0,d.checkStrictMode)(L,"default is ignored in the schema root")}function I(L){const B=L.schema[L.opts.schemaId];B&&(L.baseId=(0,u.resolveUrl)(L.opts.uriResolver,L.baseId,B))}function H(L){if(L.schema.$async&&!L.schemaEnv.$async)throw new Error("async schema in sync schema")}function q({gen:L,schemaEnv:B,schema:K,errSchemaPath:G,opts:J}){const ne=K.$comment;if(J.$comment===!0)L.code((0,a._)`${l.default.self}.logger.log(${ne})`);else if(typeof J.$comment=="function"){const ue=(0,a.str)`${G}/$comment`,je=L.scopeValue("root",{ref:B.root});L.code((0,a._)`${l.default.self}.opts.$comment(${ne}, ${ue}, ${je}.schema)`)}}function E(L){const{gen:B,schemaEnv:K,validateName:G,ValidationError:J,opts:ne}=L;K.$async?B.if((0,a._)`${l.default.errors} === 0`,()=>B.return(l.default.data),()=>B.throw((0,a._)`new ${J}(${l.default.vErrors})`)):(B.assign((0,a._)`${G}.errors`,l.default.vErrors),ne.unevaluated&&O(L),B.return((0,a._)`${l.default.errors} === 0`))}function O({gen:L,evaluated:B,props:K,items:G}){K instanceof a.Name&&L.assign((0,a._)`${B}.props`,K),G instanceof a.Name&&L.assign((0,a._)`${B}.items`,G)}function M(L,B,K,G){const{gen:J,schema:ne,data:ue,allErrors:je,opts:ve,self:Ne}=L,{RULES:xe}=Ne;if(ne.$ref&&(ve.ignoreKeywordsWithRef||!(0,d.schemaHasRulesButRef)(ne,xe))){J.block(()=>Y(L,"$ref",xe.all.$ref.definition));return}ve.jtd||j(L,B),J.block(()=>{for(const Ae of xe.rules)gt(Ae);gt(xe.post)});function gt(Ae){(0,n.shouldUseGroup)(ne,Ae)&&(Ae.type?(J.if((0,r.checkDataType)(Ae.type,ue,ve.strictNumbers)),V(L,Ae),B.length===1&&B[0]===Ae.type&&K&&(J.else(),(0,r.reportTypeError)(L)),J.endIf()):V(L,Ae),je||J.if((0,a._)`${l.default.errors} === ${G||0}`))}}function V(L,B){const{gen:K,schema:G,opts:{useDefaults:J}}=L;J&&(0,o.assignDefaults)(L,B.type),K.block(()=>{for(const ne of B.rules)(0,n.shouldUseRule)(G,ne)&&Y(L,ne.keyword,ne.definition,B.type)})}function j(L,B){L.schemaEnv.meta||!L.opts.strictTypes||(z(L,B),L.opts.allowUnionTypes||T(L,B),N(L,L.dataTypes))}function z(L,B){if(B.length){if(!L.dataTypes.length){L.dataTypes=B;return}B.forEach(K=>{D(L.dataTypes,K)||C(L,`type "${K}" not allowed by context "${L.dataTypes.join(",")}"`)}),S(L,B)}}function T(L,B){B.length>1&&!(B.length===2&&B.includes("null"))&&C(L,"use allowUnionTypes to allow union type keyword")}function N(L,B){const K=L.self.RULES.all;for(const G in K){const J=K[G];if(typeof J=="object"&&(0,n.shouldUseRule)(L.schema,J)){const{type:ne}=J.definition;ne.length&&!ne.some(ue=>R(B,ue))&&C(L,`missing type "${ne.join(",")}" for keyword "${G}"`)}}}function R(L,B){return L.includes(B)||B==="number"&&L.includes("integer")}function D(L,B){return L.includes(B)||B==="integer"&&L.includes("number")}function S(L,B){const K=[];for(const G of L.dataTypes)D(B,G)?K.push(G):B.includes("integer")&&G==="number"&&K.push("integer");L.dataTypes=K}function C(L,B){const K=L.schemaEnv.baseId+L.errSchemaPath;B+=` at "${K}" (strictTypes)`,(0,d.checkStrictMode)(L,B,L.opts.strictTypes)}class U{constructor(B,K,G){if((0,i.validateKeywordUsage)(B,K,G),this.gen=B.gen,this.allErrors=B.allErrors,this.keyword=G,this.data=B.data,this.schema=B.schema[G],this.$data=K.$data&&B.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,d.schemaRefOrVal)(B,this.schema,G,this.$data),this.schemaType=K.schemaType,this.parentSchema=B.schema,this.params={},this.it=B,this.def=K,this.$data)this.schemaCode=B.gen.const("vSchema",te(this.$data,B));else if(this.schemaCode=this.schemaValue,!(0,i.validSchemaType)(this.schema,K.schemaType,K.allowUndefined))throw new Error(`${G} value must be ${JSON.stringify(K.schemaType)}`);("code"in K?K.trackErrors:K.errors!==!1)&&(this.errsCount=B.gen.const("_errs",l.default.errors))}result(B,K,G){this.failResult((0,a.not)(B),K,G)}failResult(B,K,G){this.gen.if(B),G?G():this.error(),K?(this.gen.else(),K(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(B,K){this.failResult((0,a.not)(B),void 0,K)}fail(B){if(B===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(B),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(B){if(!this.$data)return this.fail(B);const{schemaCode:K}=this;this.fail((0,a._)`${K} !== undefined && (${(0,a.or)(this.invalid$data(),B)})`)}error(B,K,G){if(K){this.setParams(K),this._error(B,G),this.setParams({});return}this._error(B,G)}_error(B,K){(B?c.reportExtraError:c.reportError)(this,this.def.error,K)}$dataError(){(0,c.reportError)(this,this.def.$dataError||c.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,c.resetErrorsCount)(this.gen,this.errsCount)}ok(B){this.allErrors||this.gen.if(B)}setParams(B,K){K?Object.assign(this.params,B):this.params=B}block$data(B,K,G=a.nil){this.gen.block(()=>{this.check$data(B,G),K()})}check$data(B=a.nil,K=a.nil){if(!this.$data)return;const{gen:G,schemaCode:J,schemaType:ne,def:ue}=this;G.if((0,a.or)((0,a._)`${J} === undefined`,K)),B!==a.nil&&G.assign(B,!0),(ne.length||ue.validateSchema)&&(G.elseIf(this.invalid$data()),this.$dataError(),B!==a.nil&&G.assign(B,!1)),G.else()}invalid$data(){const{gen:B,schemaCode:K,schemaType:G,def:J,it:ne}=this;return(0,a.or)(ue(),je());function ue(){if(G.length){if(!(K instanceof a.Name))throw new Error("ajv implementation error");const ve=Array.isArray(G)?G:[G];return(0,a._)`${(0,r.checkDataTypes)(ve,K,ne.opts.strictNumbers,r.DataType.Wrong)}`}return a.nil}function je(){if(J.validateSchema){const ve=B.scopeValue("validate$data",{ref:J.validateSchema});return(0,a._)`!${ve}(${K})`}return a.nil}}subschema(B,K){const G=(0,s.getSubschema)(this.it,B);(0,s.extendSubschemaData)(G,this.it,B),(0,s.extendSubschemaMode)(G,B);const J={...this.it,...G,items:void 0,props:void 0};return p(J,K),J}mergeEvaluated(B,K){const{it:G,gen:J}=this;G.opts.unevaluated&&(G.props!==!0&&B.props!==void 0&&(G.props=d.mergeEvaluated.props(J,B.props,G.props,K)),G.items!==!0&&B.items!==void 0&&(G.items=d.mergeEvaluated.items(J,B.items,G.items,K)))}mergeValidEvaluated(B,K){const{it:G,gen:J}=this;if(G.opts.unevaluated&&(G.props!==!0||G.items!==!0))return J.if(K,()=>this.mergeEvaluated(B,a.Name)),!0}}tn.KeywordCxt=U;function Y(L,B,K,G){const J=new U(L,K,B);"code"in K?K.code(J,G):J.$data&&K.validate?(0,i.funcKeywordCode)(J,K):"macro"in K?(0,i.macroKeywordCode)(J,K):(K.compile||K.validate)&&(0,i.funcKeywordCode)(J,K)}const X=/^\/(?:[^~]|~0|~1)*$/,Z=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function te(L,{dataLevel:B,dataNames:K,dataPathArr:G}){let J,ne;if(L==="")return l.default.rootData;if(L[0]==="/"){if(!X.test(L))throw new Error(`Invalid JSON-pointer: ${L}`);J=L,ne=l.default.rootData}else{const Ne=Z.exec(L);if(!Ne)throw new Error(`Invalid JSON-pointer: ${L}`);const xe=+Ne[1];if(J=Ne[2],J==="#"){if(xe>=B)throw new Error(ve("property/index",xe));return G[B-xe]}if(xe>B)throw new Error(ve("data",xe));if(ne=K[B-xe],!J)return ne}let ue=ne;const je=J.split("/");for(const Ne of je)Ne&&(ne=(0,a._)`${ne}${(0,a.getProperty)((0,d.unescapeJsonPointer)(Ne))}`,ue=(0,a._)`${ue} && ${ne}`);return ue;function ve(Ne,xe){return`Cannot access ${Ne} ${xe} levels up, current level is ${B}`}}return tn.getData=te,tn}var ko={};Object.defineProperty(ko,"__esModule",{value:!0});class Dj extends Error{constructor(t){super("validation failed"),this.errors=t,this.ajv=this.validation=!0}}ko.default=Dj;var Cr={};Object.defineProperty(Cr,"__esModule",{value:!0});const gu=Fe;class Lj extends Error{constructor(t,n,r,o){super(o||`can't resolve reference ${r} from id ${n}`),this.missingRef=(0,gu.resolveUrl)(t,n,r),this.missingSchema=(0,gu.normalizeId)((0,gu.getFullPath)(t,this.missingRef))}}Cr.default=Lj;var Ge={};Object.defineProperty(Ge,"__esModule",{value:!0});Ge.resolveSchema=Ge.getCompilingSchema=Ge.resolveRef=Ge.compileSchema=Ge.SchemaEnv=void 0;const bt=ie,Vj=ko,Zn=mt,At=Fe,Pm=ee,Fj=es();class xl{constructor(t){var n;this.refs={},this.dynamicAnchors={};let r;typeof t.schema=="object"&&(r=t.schema),this.schema=t.schema,this.schemaId=t.schemaId,this.root=t.root||this,this.baseId=(n=t.baseId)!==null&&n!==void 0?n:(0,At.normalizeId)(r==null?void 0:r[t.schemaId||"$id"]),this.schemaPath=t.schemaPath,this.localRefs=t.localRefs,this.meta=t.meta,this.$async=r==null?void 0:r.$async,this.refs={}}}Ge.SchemaEnv=xl;function sf(e){const t=M1.call(this,e);if(t)return t;const n=(0,At.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:r,lines:o}=this.opts.code,{ownProperties:i}=this.opts,s=new bt.CodeGen(this.scope,{es5:r,lines:o,ownProperties:i});let a;e.$async&&(a=s.scopeValue("Error",{ref:Vj.default,code:(0,bt._)`require("ajv/dist/runtime/validation_error").default`}));const l=s.scopeName("validate");e.validateName=l;const u={gen:s,allErrors:this.opts.allErrors,data:Zn.default.data,parentData:Zn.default.parentData,parentDataProperty:Zn.default.parentDataProperty,dataNames:[Zn.default.data],dataPathArr:[bt.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:s.scopeValue("schema",this.opts.code.source===!0?{ref:e.schema,code:(0,bt.stringify)(e.schema)}:{ref:e.schema}),validateName:l,ValidationError:a,schema:e.schema,schemaEnv:e,rootId:n,baseId:e.baseId||n,schemaPath:bt.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,bt._)`""`,opts:this.opts,self:this};let d;try{this._compilations.add(e),(0,Fj.validateFunctionCode)(u),s.optimize(this.opts.code.optimize);const c=s.toString();d=`${s.scopeRefs(Zn.default.scope)}return ${c}`,this.opts.code.process&&(d=this.opts.code.process(d,e));const m=new Function(`${Zn.default.self}`,`${Zn.default.scope}`,d)(this,this.scope.get());if(this.scope.value(l,{ref:m}),m.errors=null,m.schema=e.schema,m.schemaEnv=e,e.$async&&(m.$async=!0),this.opts.code.source===!0&&(m.source={validateName:l,validateCode:c,scopeValues:s._values}),this.opts.unevaluated){const{props:y,items:v}=u;m.evaluated={props:y instanceof bt.Name?void 0:y,items:v instanceof bt.Name?void 0:v,dynamicProps:y instanceof bt.Name,dynamicItems:v instanceof bt.Name},m.source&&(m.source.evaluated=(0,bt.stringify)(m.evaluated))}return e.validate=m,e}catch(c){throw delete e.validate,delete e.validateName,d&&this.logger.error("Error compiling schema, function code:",d),c}finally{this._compilations.delete(e)}}Ge.compileSchema=sf;function Hj(e,t,n){var r;n=(0,At.resolveUrl)(this.opts.uriResolver,t,n);const o=e.refs[n];if(o)return o;let i=Wj.call(this,e,n);if(i===void 0){const s=(r=e.localRefs)===null||r===void 0?void 0:r[n],{schemaId:a}=this.opts;s&&(i=new xl({schema:s,schemaId:a,root:e,baseId:t}))}if(i!==void 0)return e.refs[n]=Bj.call(this,i)}Ge.resolveRef=Hj;function Bj(e){return(0,At.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:sf.call(this,e)}function M1(e){for(const t of this._compilations)if(Uj(t,e))return t}Ge.getCompilingSchema=M1;function Uj(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function Wj(e,t){let n;for(;typeof(n=this.refs[t])=="string";)t=n;return n||this.schemas[t]||Sl.call(this,e,t)}function Sl(e,t){const n=this.opts.uriResolver.parse(t),r=(0,At._getFullPath)(this.opts.uriResolver,n);let o=(0,At.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&r===o)return yu.call(this,n,e);const i=(0,At.normalizeId)(r),s=this.refs[i]||this.schemas[i];if(typeof s=="string"){const a=Sl.call(this,e,s);return typeof(a==null?void 0:a.schema)!="object"?void 0:yu.call(this,n,a)}if(typeof(s==null?void 0:s.schema)=="object"){if(s.validate||sf.call(this,s),i===(0,At.normalizeId)(t)){const{schema:a}=s,{schemaId:l}=this.opts,u=a[l];return u&&(o=(0,At.resolveUrl)(this.opts.uriResolver,o,u)),new xl({schema:a,schemaId:l,root:e,baseId:o})}return yu.call(this,n,s)}}Ge.resolveSchema=Sl;const qj=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function yu(e,{baseId:t,schema:n,root:r}){var o;if(((o=e.fragment)===null||o===void 0?void 0:o[0])!=="/")return;for(const a of e.fragment.slice(1).split("/")){if(typeof n=="boolean")return;const l=n[(0,Pm.unescapeFragment)(a)];if(l===void 0)return;n=l;const u=typeof n=="object"&&n[this.opts.schemaId];!qj.has(a)&&u&&(t=(0,At.resolveUrl)(this.opts.uriResolver,t,u))}let i;if(typeof n!="boolean"&&n.$ref&&!(0,Pm.schemaHasRulesButRef)(n,this.RULES)){const a=(0,At.resolveUrl)(this.opts.uriResolver,t,n.$ref);i=Sl.call(this,r,a)}const{schemaId:s}=this.opts;if(i=i||new xl({schema:n,schemaId:s,root:r,baseId:t}),i.schema!==i.root.schema)return i}const Kj="https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",Xj="Meta-schema for $data reference (JSON AnySchema extension proposal)",Yj="object",Gj=["$data"],Qj={$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},Zj=!1,Jj={$id:Kj,description:Xj,type:Yj,required:Gj,properties:Qj,additionalProperties:Zj};var af={},El={exports:{}};const eM=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),T1=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u),lf=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),I1=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),tM=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function R1(e){let t="",n=0,r=0;for(r=0;r<e.length;r++)if(n=e[r].charCodeAt(0),n!==48){if(!(n>=48&&n<=57||n>=65&&n<=70||n>=97&&n<=102))return"";t+=e[r];break}for(r+=1;r<e.length;r++){if(n=e[r].charCodeAt(0),!(n>=48&&n<=57||n>=65&&n<=70||n>=97&&n<=102))return"";t+=e[r]}return t}const nM=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function Cm(e){return e.length=0,!0}function rM(e,t,n){if(e.length){const r=R1(e);if(r!=="")t.push(r);else return n.error=!0,!1;e.length=0}return!0}function oM(e){let t=0;const n={error:!1,address:"",zone:""},r=[],o=[];let i=!1,s=!1,a=rM;for(let l=0;l<e.length;l++){const u=e[l];if(!(u==="["||u==="]"))if(u===":"){if(i===!0&&(s=!0),!a(o,r,n))break;if(++t>7){n.error=!0;break}l>0&&e[l-1]===":"&&(i=!0),r.push(":");continue}else if(u==="%"){if(!a(o,r,n))break;a=Cm}else{o.push(u);continue}}return o.length&&(a===Cm?n.zone=o.join(""):s?r.push(o.join("")):r.push(R1(o))),n.address=r.join(""),n}function z1(e){if(iM(e,":")<2)return{host:e,isIPV6:!1};const t=oM(e);if(t.error)return{host:e,isIPV6:!1};{let n=t.address,r=t.address;return t.zone&&(n+="%"+t.zone,r+="%25"+t.zone),{host:n,isIPV6:!0,escapedHost:r}}}function iM(e,t){let n=0;for(let r=0;r<e.length;r++)e[r]===t&&n++;return n}function sM(e){let t=e;const n=[];let r=-1,o=0;for(;o=t.length;){if(o===1){if(t===".")break;if(t==="/"){n.push("/");break}else{n.push(t);break}}else if(o===2){if(t[0]==="."){if(t[1]===".")break;if(t[1]==="/"){t=t.slice(2);continue}}else if(t[0]==="/"&&(t[1]==="."||t[1]==="/")){n.push("/");break}}else if(o===3&&t==="/.."){n.length!==0&&n.pop(),n.push("/");break}if(t[0]==="."){if(t[1]==="."){if(t[2]==="/"){t=t.slice(3);continue}}else if(t[1]==="/"){t=t.slice(2);continue}}else if(t[0]==="/"&&t[1]==="."){if(t[2]==="/"){t=t.slice(2);continue}else if(t[2]==="."&&t[3]==="/"){t=t.slice(3),n.length!==0&&n.pop();continue}}if((r=t.indexOf("/",1))===-1){n.push(t);break}else n.push(t.slice(0,r)),t=t.slice(r)}return n.join("")}const aM={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},lM=/[@/?#:]/g,uM=/[@/?#]/g;function A1(e,t){const n=t?uM:lM;return n.lastIndex=0,e.replace(n,r=>aM[r])}function cM(e,t=!1){if(e.indexOf("%")===-1)return e;let n="";for(let r=0;r<e.length;r++){if(e[r]==="%"&&r+2<e.length){const o=e.slice(r+1,r+3);if(lf(o)){const i=o.toUpperCase(),s=String.fromCharCode(parseInt(i,16));t&&I1(s)?n+=s:n+="%"+i,r+=2;continue}}n+=e[r]}return n}function dM(e){let t="";for(let n=0;n<e.length;n++){if(e[n]==="%"&&n+2<e.length){const r=e.slice(n+1,n+3);if(lf(r)){const o=r.toUpperCase(),i=String.fromCharCode(parseInt(o,16));i!=="."&&I1(i)?t+=i:t+="%"+o,n+=2;continue}}tM(e[n])?t+=e[n]:t+=escape(e[n])}return t}function fM(e){let t="";for(let n=0;n<e.length;n++){if(e[n]==="%"&&n+2<e.length){const r=e.slice(n+1,n+3);if(lf(r)){t+="%"+r.toUpperCase(),n+=2;continue}}t+=escape(e[n])}return t}function hM(e){const t=[];if(e.userinfo!==void 0&&(t.push(e.userinfo),t.push("@")),e.host!==void 0){let n=unescape(e.host);if(!T1(n)){const r=z1(n);r.isIPV6===!0?n=`[${r.escapedHost}]`:n=A1(n,!1)}t.push(n)}return(typeof e.port=="number"||typeof e.port=="string")&&(t.push(":"),t.push(String(e.port))),t.length?t.join(""):void 0}var O1={nonSimpleDomain:nM,recomposeAuthority:hM,reescapeHostDelimiters:A1,normalizePercentEncoding:cM,normalizePathEncoding:dM,escapePreservingEscapes:fM,removeDotSegments:sM,isIPv4:T1,isUUID:eM,normalizeIPv6:z1};const{isUUID:pM}=O1,mM=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu;function D1(e){return e.secure===!0?!0:e.secure===!1?!1:e.scheme?e.scheme.length===3&&(e.scheme[0]==="w"||e.scheme[0]==="W")&&(e.scheme[1]==="s"||e.scheme[1]==="S")&&(e.scheme[2]==="s"||e.scheme[2]==="S"):!1}function L1(e){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e}function V1(e){const t=String(e.scheme).toLowerCase()==="https";return(e.port===(t?443:80)||e.port==="")&&(e.port=void 0),e.path||(e.path="/"),e}function gM(e){return e.secure=D1(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e}function yM(e){if((e.port===(D1(e)?443:80)||e.port==="")&&(e.port=void 0),typeof e.secure=="boolean"&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){const[t,n]=e.resourceName.split("?");e.path=t&&t!=="/"?t:void 0,e.query=n,e.resourceName=void 0}return e.fragment=void 0,e}function vM(e,t){if(!e.path)return e.error="URN can not be parsed",e;const n=e.path.match(mM);if(n){const r=t.scheme||e.scheme||"urn";e.nid=n[1].toLowerCase(),e.nss=n[2];const o=`${r}:${t.nid||e.nid}`,i=uf(o);e.path=void 0,i&&(e=i.parse(e,t))}else e.error=e.error||"URN can not be parsed.";return e}function wM(e,t){if(e.nid===void 0)throw new Error("URN without nid cannot be serialized");const n=t.scheme||e.scheme||"urn",r=e.nid.toLowerCase(),o=`${n}:${t.nid||r}`,i=uf(o);i&&(e=i.serialize(e,t));const s=e,a=e.nss;return s.path=`${r||t.nid}:${a}`,t.skipEscape=!0,s}function _M(e,t){const n=e;return n.uuid=n.nss,n.nss=void 0,!t.tolerant&&(!n.uuid||!pM(n.uuid))&&(n.error=n.error||"UUID is not valid."),n}function $M(e){const t=e;return t.nss=(e.uuid||"").toLowerCase(),t}const F1={scheme:"http",domainHost:!0,parse:L1,serialize:V1},xM={scheme:"https",domainHost:F1.domainHost,parse:L1,serialize:V1},ta={scheme:"ws",domainHost:!0,parse:gM,serialize:yM},SM={scheme:"wss",domainHost:ta.domainHost,parse:ta.parse,serialize:ta.serialize},EM={scheme:"urn",parse:vM,serialize:wM,skipNormalize:!0},kM={scheme:"urn:uuid",parse:_M,serialize:$M,skipNormalize:!0},Fa={http:F1,https:xM,ws:ta,wss:SM,urn:EM,"urn:uuid":kM};Object.setPrototypeOf(Fa,null);function uf(e){return e&&(Fa[e]||Fa[e.toLowerCase()])||void 0}var NM={SCHEMES:Fa,getSchemeHandler:uf};const{normalizeIPv6:PM,removeDotSegments:Qo,recomposeAuthority:CM,normalizePercentEncoding:bM,normalizePathEncoding:jM,escapePreservingEscapes:MM,reescapeHostDelimiters:TM,isIPv4:IM,nonSimpleDomain:RM}=O1,{SCHEMES:zM,getSchemeHandler:H1}=NM;function AM(e,t){return typeof e=="string"?e=FM(e,t):typeof e=="object"&&(e=_o(Er(e,t),t)),e}function OM(e,t,n){const r=n?Object.assign({scheme:"null"},n):{scheme:"null"},o=B1(_o(e,r),_o(t,r),r,!0);return r.skipEscape=!0,Er(o,r)}function B1(e,t,n,r){const o={};return r||(e=_o(Er(e,n),n),t=_o(Er(t,n),n)),n=n||{},!n.tolerant&&t.scheme?(o.scheme=t.scheme,o.userinfo=t.userinfo,o.host=t.host,o.port=t.port,o.path=Qo(t.path||""),o.query=t.query):(t.userinfo!==void 0||t.host!==void 0||t.port!==void 0?(o.userinfo=t.userinfo,o.host=t.host,o.port=t.port,o.path=Qo(t.path||""),o.query=t.query):(t.path?(t.path[0]==="/"?o.path=Qo(t.path):((e.userinfo!==void 0||e.host!==void 0||e.port!==void 0)&&!e.path?o.path="/"+t.path:e.path?o.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:o.path=t.path,o.path=Qo(o.path)),o.query=t.query):(o.path=e.path,t.query!==void 0?o.query=t.query:o.query=e.query),o.userinfo=e.userinfo,o.host=e.host,o.port=e.port),o.scheme=e.scheme),o.fragment=t.fragment,o}function DM(e,t,n){const r=bm(e,n),o=bm(t,n);return r!==void 0&&o!==void 0&&r.toLowerCase()===o.toLowerCase()}function Er(e,t){const n={host:e.host,scheme:e.scheme,userinfo:e.userinfo,port:e.port,path:e.path,query:e.query,nid:e.nid,nss:e.nss,uuid:e.uuid,fragment:e.fragment,reference:e.reference,resourceName:e.resourceName,secure:e.secure,error:""},r=Object.assign({},t),o=[],i=H1(r.scheme||n.scheme);i&&i.serialize&&i.serialize(n,r),n.path!==void 0&&(r.skipEscape?n.path=bM(n.path):(n.path=MM(n.path),n.scheme!==void 0&&(n.path=n.path.split("%3A").join(":")))),r.reference!=="suffix"&&n.scheme&&o.push(n.scheme,":");const s=CM(n);if(s!==void 0&&(r.reference!=="suffix"&&o.push("//"),o.push(s),n.path&&n.path[0]!=="/"&&o.push("/")),n.path!==void 0){let a=n.path;!r.absolutePath&&(!i||!i.absolutePath)&&(a=Qo(a)),s===void 0&&a[0]==="/"&&a[1]==="/"&&(a="/%2F"+a.slice(2)),o.push(a)}return n.query!==void 0&&o.push("?",n.query),n.fragment!==void 0&&o.push("#",n.fragment),o.join("")}const LM=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function VM(e,t){if(t[2]!==void 0&&e.path&&e.path[0]!=="/")return'URI path must start with "/" when authority is present.';if(typeof e.port=="number"&&(e.port<0||e.port>65535))return"URI port is malformed."}function U1(e,t){const n=Object.assign({},t),r={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0};let o=!1,i=!1;n.reference==="suffix"&&(n.scheme?e=n.scheme+":"+e:e="//"+e);const s=e.match(LM);if(s){r.scheme=s[1],r.userinfo=s[3],r.host=s[4],r.port=parseInt(s[5],10),r.path=s[6]||"",r.query=s[7],r.fragment=s[8],isNaN(r.port)&&(r.port=s[5]);const a=VM(r,s);if(a!==void 0&&(r.error=r.error||a,o=!0),r.host)if(IM(r.host)===!1){const d=PM(r.host);r.host=d.host.toLowerCase(),i=d.isIPV6}else i=!0;r.scheme===void 0&&r.userinfo===void 0&&r.host===void 0&&r.port===void 0&&r.query===void 0&&!r.path?r.reference="same-document":r.scheme===void 0?r.reference="relative":r.fragment===void 0?r.reference="absolute":r.reference="uri",n.reference&&n.reference!=="suffix"&&n.reference!==r.reference&&(r.error=r.error||"URI is not a "+n.reference+" reference.");const l=H1(n.scheme||r.scheme);if(!n.unicodeSupport&&(!l||!l.unicodeSupport)&&r.host&&(n.domainHost||l&&l.domainHost)&&i===!1&&RM(r.host))try{r.host=URL.domainToASCII(r.host.toLowerCase())}catch(u){r.error=r.error||"Host's domain name can not be converted to ASCII: "+u}if((!l||l&&!l.skipNormalize)&&(e.indexOf("%")!==-1&&(r.scheme!==void 0&&(r.scheme=unescape(r.scheme)),r.host!==void 0&&(r.host=TM(unescape(r.host),i))),r.path&&(r.path=jM(r.path)),r.fragment))try{r.fragment=encodeURI(decodeURIComponent(r.fragment))}catch{r.error=r.error||"URI malformed"}l&&l.parse&&l.parse(r,n)}else r.error=r.error||"URI can not be parsed.";return{parsed:r,malformedAuthorityOrPort:o}}function _o(e,t){return U1(e,t).parsed}function FM(e,t){return W1(e,t).normalized}function W1(e,t){const{parsed:n,malformedAuthorityOrPort:r}=U1(e,t);return{normalized:r?e:Er(n,t),malformedAuthorityOrPort:r}}function bm(e,t){if(typeof e=="string"){const{normalized:n,malformedAuthorityOrPort:r}=W1(e,t);return r?void 0:n}if(typeof e=="object")return Er(e,t)}const cf={SCHEMES:zM,normalize:AM,resolve:OM,resolveComponent:B1,equal:DM,serialize:Er,parse:_o};El.exports=cf;El.exports.default=cf;El.exports.fastUri=cf;var HM=El.exports;Object.defineProperty(af,"__esModule",{value:!0});const q1=HM;q1.code='require("ajv/dist/runtime/uri").default';af.default=q1;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=void 0;var t=es();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return t.KeywordCxt}});var n=ie;Object.defineProperty(e,"_",{enumerable:!0,get:function(){return n._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return n.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return n.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return n.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return n.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return n.CodeGen}});const r=ko,o=Cr,i=Sr,s=Ge,a=ie,l=Fe,u=Re,d=ee,c=Jj,f=af,m=(T,N)=>new RegExp(T,N);m.code="new RegExp";const y=["removeAdditional","useDefaults","coerceTypes"],v=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),w={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},h={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},g=200;function p(T){var N,R,D,S,C,U,Y,X,Z,te,L,B,K,G,J,ne,ue,je,ve,Ne,xe,gt,Ae,Gn,_n;const yt=T.strict,Jt=(N=T.code)===null||N===void 0?void 0:N.optimize,jo=Jt===!0||Jt===void 0?1:Jt||0,ns=(D=(R=T.code)===null||R===void 0?void 0:R.regExp)!==null&&D!==void 0?D:m,Mo=(S=T.uriResolver)!==null&&S!==void 0?S:f.default;return{strictSchema:(U=(C=T.strictSchema)!==null&&C!==void 0?C:yt)!==null&&U!==void 0?U:!0,strictNumbers:(X=(Y=T.strictNumbers)!==null&&Y!==void 0?Y:yt)!==null&&X!==void 0?X:!0,strictTypes:(te=(Z=T.strictTypes)!==null&&Z!==void 0?Z:yt)!==null&&te!==void 0?te:"log",strictTuples:(B=(L=T.strictTuples)!==null&&L!==void 0?L:yt)!==null&&B!==void 0?B:"log",strictRequired:(G=(K=T.strictRequired)!==null&&K!==void 0?K:yt)!==null&&G!==void 0?G:!1,code:T.code?{...T.code,optimize:jo,regExp:ns}:{optimize:jo,regExp:ns},loopRequired:(J=T.loopRequired)!==null&&J!==void 0?J:g,loopEnum:(ne=T.loopEnum)!==null&&ne!==void 0?ne:g,meta:(ue=T.meta)!==null&&ue!==void 0?ue:!0,messages:(je=T.messages)!==null&&je!==void 0?je:!0,inlineRefs:(ve=T.inlineRefs)!==null&&ve!==void 0?ve:!0,schemaId:(Ne=T.schemaId)!==null&&Ne!==void 0?Ne:"$id",addUsedSchema:(xe=T.addUsedSchema)!==null&&xe!==void 0?xe:!0,validateSchema:(gt=T.validateSchema)!==null&>!==void 0?gt:!0,validateFormats:(Ae=T.validateFormats)!==null&&Ae!==void 0?Ae:!0,unicodeRegExp:(Gn=T.unicodeRegExp)!==null&&Gn!==void 0?Gn:!0,int32range:(_n=T.int32range)!==null&&_n!==void 0?_n:!0,uriResolver:Mo}}class _{constructor(N={}){this.schemas={},this.refs={},this.formats=Object.create(null),this._compilations=new Set,this._loading={},this._cache=new Map,N=this.opts={...N,...p(N)};const{es5:R,lines:D}=this.opts.code;this.scope=new a.ValueScope({scope:{},prefixes:v,es5:R,lines:D}),this.logger=H(N.logger);const S=N.validateFormats;N.validateFormats=!1,this.RULES=(0,i.getRules)(),x.call(this,w,N,"NOT SUPPORTED"),x.call(this,h,N,"DEPRECATED","warn"),this._metaOpts=W.call(this),N.formats&&b.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),N.keywords&&F.call(this,N.keywords),typeof N.meta=="object"&&this.addMetaSchema(N.meta),P.call(this),N.validateFormats=S}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:N,meta:R,schemaId:D}=this.opts;let S=c;D==="id"&&(S={...c},S.id=S.$id,delete S.$id),R&&N&&this.addMetaSchema(S,S[D],!1)}defaultMeta(){const{meta:N,schemaId:R}=this.opts;return this.opts.defaultMeta=typeof N=="object"?N[R]||N:void 0}validate(N,R){let D;if(typeof N=="string"){if(D=this.getSchema(N),!D)throw new Error(`no schema with key or ref "${N}"`)}else D=this.compile(N);const S=D(R);return"$async"in D||(this.errors=D.errors),S}compile(N,R){const D=this._addSchema(N,R);return D.validate||this._compileSchemaEnv(D)}compileAsync(N,R){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");const{loadSchema:D}=this.opts;return S.call(this,N,R);async function S(te,L){await C.call(this,te.$schema);const B=this._addSchema(te,L);return B.validate||U.call(this,B)}async function C(te){te&&!this.getSchema(te)&&await S.call(this,{$ref:te},!0)}async function U(te){try{return this._compileSchemaEnv(te)}catch(L){if(!(L instanceof o.default))throw L;return Y.call(this,L),await X.call(this,L.missingSchema),U.call(this,te)}}function Y({missingSchema:te,missingRef:L}){if(this.refs[te])throw new Error(`AnySchema ${te} is loaded but ${L} cannot be resolved`)}async function X(te){const L=await Z.call(this,te);this.refs[te]||await C.call(this,L.$schema),this.refs[te]||this.addSchema(L,te,R)}async function Z(te){const L=this._loading[te];if(L)return L;try{return await(this._loading[te]=D(te))}finally{delete this._loading[te]}}}addSchema(N,R,D,S=this.opts.validateSchema){if(Array.isArray(N)){for(const U of N)this.addSchema(U,void 0,D,S);return this}let C;if(typeof N=="object"){const{schemaId:U}=this.opts;if(C=N[U],C!==void 0&&typeof C!="string")throw new Error(`schema ${U} must be string`)}return R=(0,l.normalizeId)(R||C),this._checkUnique(R),this.schemas[R]=this._addSchema(N,D,R,S,!0),this}addMetaSchema(N,R,D=this.opts.validateSchema){return this.addSchema(N,R,!0,D),this}validateSchema(N,R){if(typeof N=="boolean")return!0;let D;if(D=N.$schema,D!==void 0&&typeof D!="string")throw new Error("$schema must be a string");if(D=D||this.opts.defaultMeta||this.defaultMeta(),!D)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const S=this.validate(D,N);if(!S&&R){const C="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(C);else throw new Error(C)}return S}getSchema(N){let R;for(;typeof(R=k.call(this,N))=="string";)N=R;if(R===void 0){const{schemaId:D}=this.opts,S=new s.SchemaEnv({schema:{},schemaId:D});if(R=s.resolveSchema.call(this,S,N),!R)return;this.refs[N]=R}return R.validate||this._compileSchemaEnv(R)}removeSchema(N){if(N instanceof RegExp)return this._removeAllSchemas(this.schemas,N),this._removeAllSchemas(this.refs,N),this;switch(typeof N){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const R=k.call(this,N);return typeof R=="object"&&this._cache.delete(R.schema),delete this.schemas[N],delete this.refs[N],this}case"object":{const R=N;this._cache.delete(R);let D=N[this.opts.schemaId];return D&&(D=(0,l.normalizeId)(D),delete this.schemas[D],delete this.refs[D]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(N){for(const R of N)this.addKeyword(R);return this}addKeyword(N,R){let D;if(typeof N=="string")D=N,typeof R=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),R.keyword=D);else if(typeof N=="object"&&R===void 0){if(R=N,D=R.keyword,Array.isArray(D)&&!D.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(E.call(this,D,R),!R)return(0,d.eachItem)(D,C=>O.call(this,C)),this;V.call(this,R);const S={...R,type:(0,u.getJSONTypes)(R.type),schemaType:(0,u.getJSONTypes)(R.schemaType)};return(0,d.eachItem)(D,S.type.length===0?C=>O.call(this,C,S):C=>S.type.forEach(U=>O.call(this,C,S,U))),this}getKeyword(N){const R=this.RULES.all[N];return typeof R=="object"?R.definition:!!R}removeKeyword(N){const{RULES:R}=this;delete R.keywords[N],delete R.all[N];for(const D of R.rules){const S=D.rules.findIndex(C=>C.keyword===N);S>=0&&D.rules.splice(S,1)}return this}addFormat(N,R){return typeof R=="string"&&(R=new RegExp(R)),this.formats[N]=R,this}errorsText(N=this.errors,{separator:R=", ",dataVar:D="data"}={}){return!N||N.length===0?"No errors":N.map(S=>`${D}${S.instancePath} ${S.message}`).reduce((S,C)=>S+R+C)}$dataMetaSchema(N,R){const D=this.RULES.all;N=JSON.parse(JSON.stringify(N));for(const S of R){const C=S.split("/").slice(1);let U=N;for(const Y of C)U=U[Y];for(const Y in D){const X=D[Y];if(typeof X!="object")continue;const{$data:Z}=X.definition,te=U[Y];Z&&te&&(U[Y]=z(te))}}return N}_removeAllSchemas(N,R){for(const D in N){const S=N[D];(!R||R.test(D))&&(typeof S=="string"?delete N[D]:S&&!S.meta&&(this._cache.delete(S.schema),delete N[D]))}}_addSchema(N,R,D,S=this.opts.validateSchema,C=this.opts.addUsedSchema){let U;const{schemaId:Y}=this.opts;if(typeof N=="object")U=N[Y];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof N!="boolean")throw new Error("schema must be object or boolean")}let X=this._cache.get(N);if(X!==void 0)return X;D=(0,l.normalizeId)(U||D);const Z=l.getSchemaRefs.call(this,N,D);return X=new s.SchemaEnv({schema:N,schemaId:Y,meta:R,baseId:D,localRefs:Z}),this._cache.set(X.schema,X),C&&!D.startsWith("#")&&(D&&this._checkUnique(D),this.refs[D]=X),S&&this.validateSchema(N,!0),X}_checkUnique(N){if(this.schemas[N]||this.refs[N])throw new Error(`schema with key or id "${N}" already exists`)}_compileSchemaEnv(N){if(N.meta?this._compileMetaSchema(N):s.compileSchema.call(this,N),!N.validate)throw new Error("ajv implementation error");return N.validate}_compileMetaSchema(N){const R=this.opts;this.opts=this._metaOpts;try{s.compileSchema.call(this,N)}finally{this.opts=R}}}_.ValidationError=r.default,_.MissingRefError=o.default,e.default=_;function x(T,N,R,D="error"){for(const S in T){const C=S;C in N&&this.logger[D](`${R}: option ${S}. ${T[C]}`)}}function k(T){return T=(0,l.normalizeId)(T),this.schemas[T]||this.refs[T]}function P(){const T=this.opts.schemas;if(T)if(Array.isArray(T))this.addSchema(T);else for(const N in T)this.addSchema(T[N],N)}function b(){for(const T in this.opts.formats){const N=this.opts.formats[T];N&&this.addFormat(T,N)}}function F(T){if(Array.isArray(T)){this.addVocabulary(T);return}this.logger.warn("keywords option as map is deprecated, pass array");for(const N in T){const R=T[N];R.keyword||(R.keyword=N),this.addKeyword(R)}}function W(){const T={...this.opts};for(const N of y)delete T[N];return T}const I={log(){},warn(){},error(){}};function H(T){if(T===!1)return I;if(T===void 0)return console;if(T.log&&T.warn&&T.error)return T;throw new Error("logger must implement log, warn and error methods")}const q=/^[a-z_$][a-z0-9_$:-]*$/i;function E(T,N){const{RULES:R}=this;if((0,d.eachItem)(T,D=>{if(R.keywords[D])throw new Error(`Keyword ${D} is already defined`);if(!q.test(D))throw new Error(`Keyword ${D} has invalid name`)}),!!N&&N.$data&&!("code"in N||"validate"in N))throw new Error('$data keyword must have "code" or "validate" function')}function O(T,N,R){var D;const S=N==null?void 0:N.post;if(R&&S)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:C}=this;let U=S?C.post:C.rules.find(({type:X})=>X===R);if(U||(U={type:R,rules:[]},C.rules.push(U)),C.keywords[T]=!0,!N)return;const Y={keyword:T,definition:{...N,type:(0,u.getJSONTypes)(N.type),schemaType:(0,u.getJSONTypes)(N.schemaType)}};N.before?M.call(this,U,Y,N.before):U.rules.push(Y),C.all[T]=Y,(D=N.implements)===null||D===void 0||D.forEach(X=>this.addKeyword(X))}function M(T,N,R){const D=T.rules.findIndex(S=>S.keyword===R);D>=0?T.rules.splice(D,0,N):(T.rules.push(N),this.logger.warn(`rule ${R} is not defined`))}function V(T){let{metaSchema:N}=T;N!==void 0&&(T.$data&&this.opts.$data&&(N=z(N)),T.validateSchema=this.compile(N,!0))}const j={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function z(T){return{anyOf:[T,j]}}})(ef);var df={},kl={},ff={};Object.defineProperty(ff,"__esModule",{value:!0});const BM={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};ff.default=BM;var yn={};Object.defineProperty(yn,"__esModule",{value:!0});yn.callRef=yn.getValidate=void 0;const UM=Cr,jm=Bt(),et=ie,Mr=mt,Mm=Ge,js=ee,WM={keyword:"$ref",schemaType:"string",code(e){const{gen:t,schema:n,it:r}=e,{baseId:o,schemaEnv:i,validateName:s,opts:a,self:l}=r,{root:u}=i;if((n==="#"||n==="#/")&&o===u.baseId)return c();const d=Mm.resolveRef.call(l,u,o,n);if(d===void 0)throw new UM.default(r.opts.uriResolver,o,n);if(d instanceof Mm.SchemaEnv)return f(d);return m(d);function c(){if(i===u)return na(e,s,i,i.$async);const y=t.scopeValue("root",{ref:u});return na(e,(0,et._)`${y}.validate`,u,u.$async)}function f(y){const v=K1(e,y);na(e,v,y,y.$async)}function m(y){const v=t.scopeValue("schema",a.code.source===!0?{ref:y,code:(0,et.stringify)(y)}:{ref:y}),w=t.name("valid"),h=e.subschema({schema:y,dataTypes:[],schemaPath:et.nil,topSchemaRef:v,errSchemaPath:n},w);e.mergeEvaluated(h),e.ok(w)}}};function K1(e,t){const{gen:n}=e;return t.validate?n.scopeValue("validate",{ref:t.validate}):(0,et._)`${n.scopeValue("wrapper",{ref:t})}.validate`}yn.getValidate=K1;function na(e,t,n,r){const{gen:o,it:i}=e,{allErrors:s,schemaEnv:a,opts:l}=i,u=l.passContext?Mr.default.this:et.nil;r?d():c();function d(){if(!a.$async)throw new Error("async schema referenced by sync schema");const y=o.let("valid");o.try(()=>{o.code((0,et._)`await ${(0,jm.callValidateCode)(e,t,u)}`),m(t),s||o.assign(y,!0)},v=>{o.if((0,et._)`!(${v} instanceof ${i.ValidationError})`,()=>o.throw(v)),f(v),s||o.assign(y,!1)}),e.ok(y)}function c(){e.result((0,jm.callValidateCode)(e,t,u),()=>m(t),()=>f(t))}function f(y){const v=(0,et._)`${y}.errors`;o.assign(Mr.default.vErrors,(0,et._)`${Mr.default.vErrors} === null ? ${v} : ${Mr.default.vErrors}.concat(${v})`),o.assign(Mr.default.errors,(0,et._)`${Mr.default.vErrors}.length`)}function m(y){var v;if(!i.opts.unevaluated)return;const w=(v=n==null?void 0:n.validate)===null||v===void 0?void 0:v.evaluated;if(i.props!==!0)if(w&&!w.dynamicProps)w.props!==void 0&&(i.props=js.mergeEvaluated.props(o,w.props,i.props));else{const h=o.var("props",(0,et._)`${y}.evaluated.props`);i.props=js.mergeEvaluated.props(o,h,i.props,et.Name)}if(i.items!==!0)if(w&&!w.dynamicItems)w.items!==void 0&&(i.items=js.mergeEvaluated.items(o,w.items,i.items));else{const h=o.var("items",(0,et._)`${y}.evaluated.items`);i.items=js.mergeEvaluated.items(o,h,i.items,et.Name)}}}yn.callRef=na;yn.default=WM;Object.defineProperty(kl,"__esModule",{value:!0});const qM=ff,KM=yn,XM=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",qM.default,KM.default];kl.default=XM;var Nl={},hf={};Object.defineProperty(hf,"__esModule",{value:!0});const Ha=ie,En=Ha.operators,Ba={maximum:{okStr:"<=",ok:En.LTE,fail:En.GT},minimum:{okStr:">=",ok:En.GTE,fail:En.LT},exclusiveMaximum:{okStr:"<",ok:En.LT,fail:En.GTE},exclusiveMinimum:{okStr:">",ok:En.GT,fail:En.LTE}},YM={message:({keyword:e,schemaCode:t})=>(0,Ha.str)`must be ${Ba[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,Ha._)`{comparison: ${Ba[e].okStr}, limit: ${t}}`},GM={keyword:Object.keys(Ba),type:"number",schemaType:"number",$data:!0,error:YM,code(e){const{keyword:t,data:n,schemaCode:r}=e;e.fail$data((0,Ha._)`${n} ${Ba[t].fail} ${r} || isNaN(${n})`)}};hf.default=GM;var pf={};Object.defineProperty(pf,"__esModule",{value:!0});const ci=ie,QM={message:({schemaCode:e})=>(0,ci.str)`must be multiple of ${e}`,params:({schemaCode:e})=>(0,ci._)`{multipleOf: ${e}}`},ZM={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:QM,code(e){const{gen:t,data:n,schemaCode:r,it:o}=e,i=o.opts.multipleOfPrecision,s=t.let("res"),a=i?(0,ci._)`Math.abs(Math.round(${s}) - ${s}) > 1e-${i}`:(0,ci._)`${s} !== parseInt(${s})`;e.fail$data((0,ci._)`(${r} === 0 || (${s} = ${n}/${r}, ${a}))`)}};pf.default=ZM;var mf={},gf={};Object.defineProperty(gf,"__esModule",{value:!0});function X1(e){const t=e.length;let n=0,r=0,o;for(;r<t;)n++,o=e.charCodeAt(r++),o>=55296&&o<=56319&&r<t&&(o=e.charCodeAt(r),(o&64512)===56320&&r++);return n}gf.default=X1;X1.code='require("ajv/dist/runtime/ucs2length").default';Object.defineProperty(mf,"__esModule",{value:!0});const nr=ie,JM=ee,eT=gf,tT={message({keyword:e,schemaCode:t}){const n=e==="maxLength"?"more":"fewer";return(0,nr.str)`must NOT have ${n} than ${t} characters`},params:({schemaCode:e})=>(0,nr._)`{limit: ${e}}`},nT={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:tT,code(e){const{keyword:t,data:n,schemaCode:r,it:o}=e,i=t==="maxLength"?nr.operators.GT:nr.operators.LT,s=o.opts.unicode===!1?(0,nr._)`${n}.length`:(0,nr._)`${(0,JM.useFunc)(e.gen,eT.default)}(${n})`;e.fail$data((0,nr._)`${s} ${i} ${r}`)}};mf.default=nT;var yf={};Object.defineProperty(yf,"__esModule",{value:!0});const rT=Bt(),oT=ee,Kr=ie,iT={message:({schemaCode:e})=>(0,Kr.str)`must match pattern "${e}"`,params:({schemaCode:e})=>(0,Kr._)`{pattern: ${e}}`},sT={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:iT,code(e){const{gen:t,data:n,$data:r,schema:o,schemaCode:i,it:s}=e,a=s.opts.unicodeRegExp?"u":"";if(r){const{regExp:l}=s.opts.code,u=l.code==="new RegExp"?(0,Kr._)`new RegExp`:(0,oT.useFunc)(t,l),d=t.let("valid");t.try(()=>t.assign(d,(0,Kr._)`${u}(${i}, ${a}).test(${n})`),()=>t.assign(d,!1)),e.fail$data((0,Kr._)`!${d}`)}else{const l=(0,rT.usePattern)(e,o);e.fail$data((0,Kr._)`!${l}.test(${n})`)}}};yf.default=sT;var vf={};Object.defineProperty(vf,"__esModule",{value:!0});const di=ie,aT={message({keyword:e,schemaCode:t}){const n=e==="maxProperties"?"more":"fewer";return(0,di.str)`must NOT have ${n} than ${t} properties`},params:({schemaCode:e})=>(0,di._)`{limit: ${e}}`},lT={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:aT,code(e){const{keyword:t,data:n,schemaCode:r}=e,o=t==="maxProperties"?di.operators.GT:di.operators.LT;e.fail$data((0,di._)`Object.keys(${n}).length ${o} ${r}`)}};vf.default=lT;var wf={};Object.defineProperty(wf,"__esModule",{value:!0});const Bo=Bt(),fi=ie,uT=ee,cT={message:({params:{missingProperty:e}})=>(0,fi.str)`must have required property '${e}'`,params:({params:{missingProperty:e}})=>(0,fi._)`{missingProperty: ${e}}`},dT={keyword:"required",type:"object",schemaType:"array",$data:!0,error:cT,code(e){const{gen:t,schema:n,schemaCode:r,data:o,$data:i,it:s}=e,{opts:a}=s;if(!i&&n.length===0)return;const l=n.length>=a.loopRequired;if(s.allErrors?u():d(),a.strictRequired){const m=e.parentSchema.properties,{definedProperties:y}=e.it;for(const v of n)if((m==null?void 0:m[v])===void 0&&!y.has(v)){const w=s.schemaEnv.baseId+s.errSchemaPath,h=`required property "${v}" is not defined at "${w}" (strictRequired)`;(0,uT.checkStrictMode)(s,h,s.opts.strictRequired)}}function u(){if(l||i)e.block$data(fi.nil,c);else for(const m of n)(0,Bo.checkReportMissingProp)(e,m)}function d(){const m=t.let("missing");if(l||i){const y=t.let("valid",!0);e.block$data(y,()=>f(m,y)),e.ok(y)}else t.if((0,Bo.checkMissingProp)(e,n,m)),(0,Bo.reportMissingProp)(e,m),t.else()}function c(){t.forOf("prop",r,m=>{e.setParams({missingProperty:m}),t.if((0,Bo.noPropertyInData)(t,o,m,a.ownProperties),()=>e.error())})}function f(m,y){e.setParams({missingProperty:m}),t.forOf(m,r,()=>{t.assign(y,(0,Bo.propertyInData)(t,o,m,a.ownProperties)),t.if((0,fi.not)(y),()=>{e.error(),t.break()})},fi.nil)}}};wf.default=dT;var _f={};Object.defineProperty(_f,"__esModule",{value:!0});const hi=ie,fT={message({keyword:e,schemaCode:t}){const n=e==="maxItems"?"more":"fewer";return(0,hi.str)`must NOT have ${n} than ${t} items`},params:({schemaCode:e})=>(0,hi._)`{limit: ${e}}`},hT={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:fT,code(e){const{keyword:t,data:n,schemaCode:r}=e,o=t==="maxItems"?hi.operators.GT:hi.operators.LT;e.fail$data((0,hi._)`${n}.length ${o} ${r}`)}};_f.default=hT;var $f={},ts={};Object.defineProperty(ts,"__esModule",{value:!0});const Y1=N1;Y1.code='require("ajv/dist/runtime/equal").default';ts.default=Y1;Object.defineProperty($f,"__esModule",{value:!0});const vu=Re,Le=ie,pT=ee,mT=ts,gT={message:({params:{i:e,j:t}})=>(0,Le.str)`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>(0,Le._)`{i: ${e}, j: ${t}}`},yT={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:gT,code(e){const{gen:t,data:n,$data:r,schema:o,parentSchema:i,schemaCode:s,it:a}=e;if(!r&&!o)return;const l=t.let("valid"),u=i.items?(0,vu.getSchemaTypes)(i.items):[];e.block$data(l,d,(0,Le._)`${s} === false`),e.ok(l);function d(){const y=t.let("i",(0,Le._)`${n}.length`),v=t.let("j");e.setParams({i:y,j:v}),t.assign(l,!0),t.if((0,Le._)`${y} > 1`,()=>(c()?f:m)(y,v))}function c(){return u.length>0&&!u.some(y=>y==="object"||y==="array")}function f(y,v){const w=t.name("item"),h=(0,vu.checkDataTypes)(u,w,a.opts.strictNumbers,vu.DataType.Wrong),g=t.const("indices",(0,Le._)`{}`);t.for((0,Le._)`;${y}--;`,()=>{t.let(w,(0,Le._)`${n}[${y}]`),t.if(h,(0,Le._)`continue`),u.length>1&&t.if((0,Le._)`typeof ${w} == "string"`,(0,Le._)`${w} += "_"`),t.if((0,Le._)`typeof ${g}[${w}] == "number"`,()=>{t.assign(v,(0,Le._)`${g}[${w}]`),e.error(),t.assign(l,!1).break()}).code((0,Le._)`${g}[${w}] = ${y}`)})}function m(y,v){const w=(0,pT.useFunc)(t,mT.default),h=t.name("outer");t.label(h).for((0,Le._)`;${y}--;`,()=>t.for((0,Le._)`${v} = ${y}; ${v}--;`,()=>t.if((0,Le._)`${w}(${n}[${y}], ${n}[${v}])`,()=>{e.error(),t.assign(l,!1).break(h)})))}}};$f.default=yT;var xf={};Object.defineProperty(xf,"__esModule",{value:!0});const Ac=ie,vT=ee,wT=ts,_T={message:"must be equal to constant",params:({schemaCode:e})=>(0,Ac._)`{allowedValue: ${e}}`},$T={keyword:"const",$data:!0,error:_T,code(e){const{gen:t,data:n,$data:r,schemaCode:o,schema:i}=e;r||i&&typeof i=="object"?e.fail$data((0,Ac._)`!${(0,vT.useFunc)(t,wT.default)}(${n}, ${o})`):e.fail((0,Ac._)`${i} !== ${n}`)}};xf.default=$T;var Sf={};Object.defineProperty(Sf,"__esModule",{value:!0});const Zo=ie,xT=ee,ST=ts,ET={message:"must be equal to one of the allowed values",params:({schemaCode:e})=>(0,Zo._)`{allowedValues: ${e}}`},kT={keyword:"enum",schemaType:"array",$data:!0,error:ET,code(e){const{gen:t,data:n,$data:r,schema:o,schemaCode:i,it:s}=e;if(!r&&o.length===0)throw new Error("enum must have non-empty array");const a=o.length>=s.opts.loopEnum;let l;const u=()=>l??(l=(0,xT.useFunc)(t,ST.default));let d;if(a||r)d=t.let("valid"),e.block$data(d,c);else{if(!Array.isArray(o))throw new Error("ajv implementation error");const m=t.const("vSchema",i);d=(0,Zo.or)(...o.map((y,v)=>f(m,v)))}e.pass(d);function c(){t.assign(d,!1),t.forOf("v",i,m=>t.if((0,Zo._)`${u()}(${n}, ${m})`,()=>t.assign(d,!0).break()))}function f(m,y){const v=o[y];return typeof v=="object"&&v!==null?(0,Zo._)`${u()}(${n}, ${m}[${y}])`:(0,Zo._)`${n} === ${v}`}}};Sf.default=kT;Object.defineProperty(Nl,"__esModule",{value:!0});const NT=hf,PT=pf,CT=mf,bT=yf,jT=vf,MT=wf,TT=_f,IT=$f,RT=xf,zT=Sf,AT=[NT.default,PT.default,CT.default,bT.default,jT.default,MT.default,TT.default,IT.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},RT.default,zT.default];Nl.default=AT;var Pl={},No={};Object.defineProperty(No,"__esModule",{value:!0});No.validateAdditionalItems=void 0;const rr=ie,Oc=ee,OT={message:({params:{len:e}})=>(0,rr.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,rr._)`{limit: ${e}}`},DT={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:OT,code(e){const{parentSchema:t,it:n}=e,{items:r}=t;if(!Array.isArray(r)){(0,Oc.checkStrictMode)(n,'"additionalItems" is ignored when "items" is not an array of schemas');return}G1(e,r)}};function G1(e,t){const{gen:n,schema:r,data:o,keyword:i,it:s}=e;s.items=!0;const a=n.const("len",(0,rr._)`${o}.length`);if(r===!1)e.setParams({len:t.length}),e.pass((0,rr._)`${a} <= ${t.length}`);else if(typeof r=="object"&&!(0,Oc.alwaysValidSchema)(s,r)){const u=n.var("valid",(0,rr._)`${a} <= ${t.length}`);n.if((0,rr.not)(u),()=>l(u)),e.ok(u)}function l(u){n.forRange("i",t.length,a,d=>{e.subschema({keyword:i,dataProp:d,dataPropType:Oc.Type.Num},u),s.allErrors||n.if((0,rr.not)(u),()=>n.break())})}}No.validateAdditionalItems=G1;No.default=DT;var Ef={},Po={};Object.defineProperty(Po,"__esModule",{value:!0});Po.validateTuple=void 0;const Tm=ie,ra=ee,LT=Bt(),VT={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){const{schema:t,it:n}=e;if(Array.isArray(t))return Q1(e,"additionalItems",t);n.items=!0,!(0,ra.alwaysValidSchema)(n,t)&&e.ok((0,LT.validateArray)(e))}};function Q1(e,t,n=e.schema){const{gen:r,parentSchema:o,data:i,keyword:s,it:a}=e;d(o),a.opts.unevaluated&&n.length&&a.items!==!0&&(a.items=ra.mergeEvaluated.items(r,n.length,a.items));const l=r.name("valid"),u=r.const("len",(0,Tm._)`${i}.length`);n.forEach((c,f)=>{(0,ra.alwaysValidSchema)(a,c)||(r.if((0,Tm._)`${u} > ${f}`,()=>e.subschema({keyword:s,schemaProp:f,dataProp:f},l)),e.ok(l))});function d(c){const{opts:f,errSchemaPath:m}=a,y=n.length,v=y===c.minItems&&(y===c.maxItems||c[t]===!1);if(f.strictTuples&&!v){const w=`"${s}" is ${y}-tuple, but minItems or maxItems/${t} are not specified or different at path "${m}"`;(0,ra.checkStrictMode)(a,w,f.strictTuples)}}}Po.validateTuple=Q1;Po.default=VT;Object.defineProperty(Ef,"__esModule",{value:!0});const FT=Po,HT={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,FT.validateTuple)(e,"items")};Ef.default=HT;var kf={};Object.defineProperty(kf,"__esModule",{value:!0});const Im=ie,BT=ee,UT=Bt(),WT=No,qT={message:({params:{len:e}})=>(0,Im.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,Im._)`{limit: ${e}}`},KT={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:qT,code(e){const{schema:t,parentSchema:n,it:r}=e,{prefixItems:o}=n;r.items=!0,!(0,BT.alwaysValidSchema)(r,t)&&(o?(0,WT.validateAdditionalItems)(e,o):e.ok((0,UT.validateArray)(e)))}};kf.default=KT;var Nf={};Object.defineProperty(Nf,"__esModule",{value:!0});const _t=ie,Ms=ee,XT={message:({params:{min:e,max:t}})=>t===void 0?(0,_t.str)`must contain at least ${e} valid item(s)`:(0,_t.str)`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>t===void 0?(0,_t._)`{minContains: ${e}}`:(0,_t._)`{minContains: ${e}, maxContains: ${t}}`},YT={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:XT,code(e){const{gen:t,schema:n,parentSchema:r,data:o,it:i}=e;let s,a;const{minContains:l,maxContains:u}=r;i.opts.next?(s=l===void 0?1:l,a=u):s=1;const d=t.const("len",(0,_t._)`${o}.length`);if(e.setParams({min:s,max:a}),a===void 0&&s===0){(0,Ms.checkStrictMode)(i,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(a!==void 0&&s>a){(0,Ms.checkStrictMode)(i,'"minContains" > "maxContains" is always invalid'),e.fail();return}if((0,Ms.alwaysValidSchema)(i,n)){let v=(0,_t._)`${d} >= ${s}`;a!==void 0&&(v=(0,_t._)`${v} && ${d} <= ${a}`),e.pass(v);return}i.items=!0;const c=t.name("valid");a===void 0&&s===1?m(c,()=>t.if(c,()=>t.break())):s===0?(t.let(c,!0),a!==void 0&&t.if((0,_t._)`${o}.length > 0`,f)):(t.let(c,!1),f()),e.result(c,()=>e.reset());function f(){const v=t.name("_valid"),w=t.let("count",0);m(v,()=>t.if(v,()=>y(w)))}function m(v,w){t.forRange("i",0,d,h=>{e.subschema({keyword:"contains",dataProp:h,dataPropType:Ms.Type.Num,compositeRule:!0},v),w()})}function y(v){t.code((0,_t._)`${v}++`),a===void 0?t.if((0,_t._)`${v} >= ${s}`,()=>t.assign(c,!0).break()):(t.if((0,_t._)`${v} > ${a}`,()=>t.assign(c,!1).break()),s===1?t.assign(c,!0):t.if((0,_t._)`${v} >= ${s}`,()=>t.assign(c,!0)))}}};Nf.default=YT;var Cl={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;const t=ie,n=ee,r=Bt();e.error={message:({params:{property:l,depsCount:u,deps:d}})=>{const c=u===1?"property":"properties";return(0,t.str)`must have ${c} ${d} when property ${l} is present`},params:({params:{property:l,depsCount:u,deps:d,missingProperty:c}})=>(0,t._)`{property: ${l},
|
|
223
|
+
missingProperty: ${c},
|
|
224
|
+
depsCount: ${u},
|
|
225
|
+
deps: ${d}}`};const o={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(l){const[u,d]=i(l);s(l,u),a(l,d)}};function i({schema:l}){const u={},d={};for(const c in l){if(c==="__proto__")continue;const f=Array.isArray(l[c])?u:d;f[c]=l[c]}return[u,d]}function s(l,u=l.schema){const{gen:d,data:c,it:f}=l;if(Object.keys(u).length===0)return;const m=d.let("missing");for(const y in u){const v=u[y];if(v.length===0)continue;const w=(0,r.propertyInData)(d,c,y,f.opts.ownProperties);l.setParams({property:y,depsCount:v.length,deps:v.join(", ")}),f.allErrors?d.if(w,()=>{for(const h of v)(0,r.checkReportMissingProp)(l,h)}):(d.if((0,t._)`${w} && (${(0,r.checkMissingProp)(l,v,m)})`),(0,r.reportMissingProp)(l,m),d.else())}}e.validatePropertyDeps=s;function a(l,u=l.schema){const{gen:d,data:c,keyword:f,it:m}=l,y=d.name("valid");for(const v in u)(0,n.alwaysValidSchema)(m,u[v])||(d.if((0,r.propertyInData)(d,c,v,m.opts.ownProperties),()=>{const w=l.subschema({keyword:f,schemaProp:v},y);l.mergeValidEvaluated(w,y)},()=>d.var(y,!0)),l.ok(y))}e.validateSchemaDeps=a,e.default=o})(Cl);var Pf={};Object.defineProperty(Pf,"__esModule",{value:!0});const Z1=ie,GT=ee,QT={message:"property name must be valid",params:({params:e})=>(0,Z1._)`{propertyName: ${e.propertyName}}`},ZT={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:QT,code(e){const{gen:t,schema:n,data:r,it:o}=e;if((0,GT.alwaysValidSchema)(o,n))return;const i=t.name("valid");t.forIn("key",r,s=>{e.setParams({propertyName:s}),e.subschema({keyword:"propertyNames",data:s,dataTypes:["string"],propertyName:s,compositeRule:!0},i),t.if((0,Z1.not)(i),()=>{e.error(!0),o.allErrors||t.break()})}),e.ok(i)}};Pf.default=ZT;var bl={};Object.defineProperty(bl,"__esModule",{value:!0});const Ts=Bt(),jt=ie,JT=mt,Is=ee,eI={message:"must NOT have additional properties",params:({params:e})=>(0,jt._)`{additionalProperty: ${e.additionalProperty}}`},tI={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:eI,code(e){const{gen:t,schema:n,parentSchema:r,data:o,errsCount:i,it:s}=e;if(!i)throw new Error("ajv implementation error");const{allErrors:a,opts:l}=s;if(s.props=!0,l.removeAdditional!=="all"&&(0,Is.alwaysValidSchema)(s,n))return;const u=(0,Ts.allSchemaProperties)(r.properties),d=(0,Ts.allSchemaProperties)(r.patternProperties);c(),e.ok((0,jt._)`${i} === ${JT.default.errors}`);function c(){t.forIn("key",o,w=>{!u.length&&!d.length?y(w):t.if(f(w),()=>y(w))})}function f(w){let h;if(u.length>8){const g=(0,Is.schemaRefOrVal)(s,r.properties,"properties");h=(0,Ts.isOwnProperty)(t,g,w)}else u.length?h=(0,jt.or)(...u.map(g=>(0,jt._)`${w} === ${g}`)):h=jt.nil;return d.length&&(h=(0,jt.or)(h,...d.map(g=>(0,jt._)`${(0,Ts.usePattern)(e,g)}.test(${w})`))),(0,jt.not)(h)}function m(w){t.code((0,jt._)`delete ${o}[${w}]`)}function y(w){if(l.removeAdditional==="all"||l.removeAdditional&&n===!1){m(w);return}if(n===!1){e.setParams({additionalProperty:w}),e.error(),a||t.break();return}if(typeof n=="object"&&!(0,Is.alwaysValidSchema)(s,n)){const h=t.name("valid");l.removeAdditional==="failing"?(v(w,h,!1),t.if((0,jt.not)(h),()=>{e.reset(),m(w)})):(v(w,h),a||t.if((0,jt.not)(h),()=>t.break()))}}function v(w,h,g){const p={keyword:"additionalProperties",dataProp:w,dataPropType:Is.Type.Str};g===!1&&Object.assign(p,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(p,h)}}};bl.default=tI;var Cf={};Object.defineProperty(Cf,"__esModule",{value:!0});const nI=es(),Rm=Bt(),wu=ee,zm=bl,rI={keyword:"properties",type:"object",schemaType:"object",code(e){const{gen:t,schema:n,parentSchema:r,data:o,it:i}=e;i.opts.removeAdditional==="all"&&r.additionalProperties===void 0&&zm.default.code(new nI.KeywordCxt(i,zm.default,"additionalProperties"));const s=(0,Rm.allSchemaProperties)(n);for(const c of s)i.definedProperties.add(c);i.opts.unevaluated&&s.length&&i.props!==!0&&(i.props=wu.mergeEvaluated.props(t,(0,wu.toHash)(s),i.props));const a=s.filter(c=>!(0,wu.alwaysValidSchema)(i,n[c]));if(a.length===0)return;const l=t.name("valid");for(const c of a)u(c)?d(c):(t.if((0,Rm.propertyInData)(t,o,c,i.opts.ownProperties)),d(c),i.allErrors||t.else().var(l,!0),t.endIf()),e.it.definedProperties.add(c),e.ok(l);function u(c){return i.opts.useDefaults&&!i.compositeRule&&n[c].default!==void 0}function d(c){e.subschema({keyword:"properties",schemaProp:c,dataProp:c},l)}}};Cf.default=rI;var bf={};Object.defineProperty(bf,"__esModule",{value:!0});const Am=Bt(),Rs=ie,Om=ee,Dm=ee,oI={keyword:"patternProperties",type:"object",schemaType:"object",code(e){const{gen:t,schema:n,data:r,parentSchema:o,it:i}=e,{opts:s}=i,a=(0,Am.allSchemaProperties)(n),l=a.filter(v=>(0,Om.alwaysValidSchema)(i,n[v]));if(a.length===0||l.length===a.length&&(!i.opts.unevaluated||i.props===!0))return;const u=s.strictSchema&&!s.allowMatchingProperties&&o.properties,d=t.name("valid");i.props!==!0&&!(i.props instanceof Rs.Name)&&(i.props=(0,Dm.evaluatedPropsToName)(t,i.props));const{props:c}=i;f();function f(){for(const v of a)u&&m(v),i.allErrors?y(v):(t.var(d,!0),y(v),t.if(d))}function m(v){for(const w in u)new RegExp(v).test(w)&&(0,Om.checkStrictMode)(i,`property ${w} matches pattern ${v} (use allowMatchingProperties)`)}function y(v){t.forIn("key",r,w=>{t.if((0,Rs._)`${(0,Am.usePattern)(e,v)}.test(${w})`,()=>{const h=l.includes(v);h||e.subschema({keyword:"patternProperties",schemaProp:v,dataProp:w,dataPropType:Dm.Type.Str},d),i.opts.unevaluated&&c!==!0?t.assign((0,Rs._)`${c}[${w}]`,!0):!h&&!i.allErrors&&t.if((0,Rs.not)(d),()=>t.break())})})}}};bf.default=oI;var jf={};Object.defineProperty(jf,"__esModule",{value:!0});const iI=ee,sI={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){const{gen:t,schema:n,it:r}=e;if((0,iI.alwaysValidSchema)(r,n)){e.fail();return}const o=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},o),e.failResult(o,()=>e.reset(),()=>e.error())},error:{message:"must NOT be valid"}};jf.default=sI;var Mf={};Object.defineProperty(Mf,"__esModule",{value:!0});const aI=Bt(),lI={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:aI.validateUnion,error:{message:"must match a schema in anyOf"}};Mf.default=lI;var Tf={};Object.defineProperty(Tf,"__esModule",{value:!0});const oa=ie,uI=ee,cI={message:"must match exactly one schema in oneOf",params:({params:e})=>(0,oa._)`{passingSchemas: ${e.passing}}`},dI={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:cI,code(e){const{gen:t,schema:n,parentSchema:r,it:o}=e;if(!Array.isArray(n))throw new Error("ajv implementation error");if(o.opts.discriminator&&r.discriminator)return;const i=n,s=t.let("valid",!1),a=t.let("passing",null),l=t.name("_valid");e.setParams({passing:a}),t.block(u),e.result(s,()=>e.reset(),()=>e.error(!0));function u(){i.forEach((d,c)=>{let f;(0,uI.alwaysValidSchema)(o,d)?t.var(l,!0):f=e.subschema({keyword:"oneOf",schemaProp:c,compositeRule:!0},l),c>0&&t.if((0,oa._)`${l} && ${s}`).assign(s,!1).assign(a,(0,oa._)`[${a}, ${c}]`).else(),t.if(l,()=>{t.assign(s,!0),t.assign(a,c),f&&e.mergeEvaluated(f,oa.Name)})})}}};Tf.default=dI;var If={};Object.defineProperty(If,"__esModule",{value:!0});const fI=ee,hI={keyword:"allOf",schemaType:"array",code(e){const{gen:t,schema:n,it:r}=e;if(!Array.isArray(n))throw new Error("ajv implementation error");const o=t.name("valid");n.forEach((i,s)=>{if((0,fI.alwaysValidSchema)(r,i))return;const a=e.subschema({keyword:"allOf",schemaProp:s},o);e.ok(o),e.mergeEvaluated(a)})}};If.default=hI;var Rf={};Object.defineProperty(Rf,"__esModule",{value:!0});const Ua=ie,J1=ee,pI={message:({params:e})=>(0,Ua.str)`must match "${e.ifClause}" schema`,params:({params:e})=>(0,Ua._)`{failingKeyword: ${e.ifClause}}`},mI={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:pI,code(e){const{gen:t,parentSchema:n,it:r}=e;n.then===void 0&&n.else===void 0&&(0,J1.checkStrictMode)(r,'"if" without "then" and "else" is ignored');const o=Lm(r,"then"),i=Lm(r,"else");if(!o&&!i)return;const s=t.let("valid",!0),a=t.name("_valid");if(l(),e.reset(),o&&i){const d=t.let("ifClause");e.setParams({ifClause:d}),t.if(a,u("then",d),u("else",d))}else o?t.if(a,u("then")):t.if((0,Ua.not)(a),u("else"));e.pass(s,()=>e.error(!0));function l(){const d=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},a);e.mergeEvaluated(d)}function u(d,c){return()=>{const f=e.subschema({keyword:d},a);t.assign(s,a),e.mergeValidEvaluated(f,s),c?t.assign(c,(0,Ua._)`${d}`):e.setParams({ifClause:d})}}}};function Lm(e,t){const n=e.schema[t];return n!==void 0&&!(0,J1.alwaysValidSchema)(e,n)}Rf.default=mI;var zf={};Object.defineProperty(zf,"__esModule",{value:!0});const gI=ee,yI={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:n}){t.if===void 0&&(0,gI.checkStrictMode)(n,`"${e}" without "if" is ignored`)}};zf.default=yI;Object.defineProperty(Pl,"__esModule",{value:!0});const vI=No,wI=Ef,_I=Po,$I=kf,xI=Nf,SI=Cl,EI=Pf,kI=bl,NI=Cf,PI=bf,CI=jf,bI=Mf,jI=Tf,MI=If,TI=Rf,II=zf;function RI(e=!1){const t=[CI.default,bI.default,jI.default,MI.default,TI.default,II.default,EI.default,kI.default,SI.default,NI.default,PI.default];return e?t.push(wI.default,$I.default):t.push(vI.default,_I.default),t.push(xI.default),t}Pl.default=RI;var Af={},Co={};Object.defineProperty(Co,"__esModule",{value:!0});Co.dynamicAnchor=void 0;const _u=ie,zI=mt,Vm=Ge,AI=yn,OI={keyword:"$dynamicAnchor",schemaType:"string",code:e=>ew(e,e.schema)};function ew(e,t){const{gen:n,it:r}=e;r.schemaEnv.root.dynamicAnchors[t]=!0;const o=(0,_u._)`${zI.default.dynamicAnchors}${(0,_u.getProperty)(t)}`,i=r.errSchemaPath==="#"?r.validateName:DI(e);n.if((0,_u._)`!${o}`,()=>n.assign(o,i))}Co.dynamicAnchor=ew;function DI(e){const{schemaEnv:t,schema:n,self:r}=e.it,{root:o,baseId:i,localRefs:s,meta:a}=t.root,{schemaId:l}=r.opts,u=new Vm.SchemaEnv({schema:n,schemaId:l,root:o,baseId:i,localRefs:s,meta:a});return Vm.compileSchema.call(r,u),(0,AI.getValidate)(e,u)}Co.default=OI;var bo={};Object.defineProperty(bo,"__esModule",{value:!0});bo.dynamicRef=void 0;const Fm=ie,LI=mt,Hm=yn,VI={keyword:"$dynamicRef",schemaType:"string",code:e=>tw(e,e.schema)};function tw(e,t){const{gen:n,keyword:r,it:o}=e;if(t[0]!=="#")throw new Error(`"${r}" only supports hash fragment reference`);const i=t.slice(1);if(o.allErrors)s();else{const l=n.let("valid",!1);s(l),e.ok(l)}function s(l){if(o.schemaEnv.root.dynamicAnchors[i]){const u=n.let("_v",(0,Fm._)`${LI.default.dynamicAnchors}${(0,Fm.getProperty)(i)}`);n.if(u,a(u,l),a(o.validateName,l))}else a(o.validateName,l)()}function a(l,u){return u?()=>n.block(()=>{(0,Hm.callRef)(e,l),n.let(u,!0)}):()=>(0,Hm.callRef)(e,l)}}bo.dynamicRef=tw;bo.default=VI;var Of={};Object.defineProperty(Of,"__esModule",{value:!0});const FI=Co,HI=ee,BI={keyword:"$recursiveAnchor",schemaType:"boolean",code(e){e.schema?(0,FI.dynamicAnchor)(e,""):(0,HI.checkStrictMode)(e.it,"$recursiveAnchor: false is ignored")}};Of.default=BI;var Df={};Object.defineProperty(Df,"__esModule",{value:!0});const UI=bo,WI={keyword:"$recursiveRef",schemaType:"string",code:e=>(0,UI.dynamicRef)(e,e.schema)};Df.default=WI;Object.defineProperty(Af,"__esModule",{value:!0});const qI=Co,KI=bo,XI=Of,YI=Df,GI=[qI.default,KI.default,XI.default,YI.default];Af.default=GI;var Lf={},Vf={};Object.defineProperty(Vf,"__esModule",{value:!0});const Bm=Cl,QI={keyword:"dependentRequired",type:"object",schemaType:"object",error:Bm.error,code:e=>(0,Bm.validatePropertyDeps)(e)};Vf.default=QI;var Ff={};Object.defineProperty(Ff,"__esModule",{value:!0});const ZI=Cl,JI={keyword:"dependentSchemas",type:"object",schemaType:"object",code:e=>(0,ZI.validateSchemaDeps)(e)};Ff.default=JI;var Hf={};Object.defineProperty(Hf,"__esModule",{value:!0});const e4=ee,t4={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:e,parentSchema:t,it:n}){t.contains===void 0&&(0,e4.checkStrictMode)(n,`"${e}" without "contains" is ignored`)}};Hf.default=t4;Object.defineProperty(Lf,"__esModule",{value:!0});const n4=Vf,r4=Ff,o4=Hf,i4=[n4.default,r4.default,o4.default];Lf.default=i4;var Bf={},Uf={};Object.defineProperty(Uf,"__esModule",{value:!0});const kn=ie,Um=ee,s4=mt,a4={message:"must NOT have unevaluated properties",params:({params:e})=>(0,kn._)`{unevaluatedProperty: ${e.unevaluatedProperty}}`},l4={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:a4,code(e){const{gen:t,schema:n,data:r,errsCount:o,it:i}=e;if(!o)throw new Error("ajv implementation error");const{allErrors:s,props:a}=i;a instanceof kn.Name?t.if((0,kn._)`${a} !== true`,()=>t.forIn("key",r,c=>t.if(u(a,c),()=>l(c)))):a!==!0&&t.forIn("key",r,c=>a===void 0?l(c):t.if(d(a,c),()=>l(c))),i.props=!0,e.ok((0,kn._)`${o} === ${s4.default.errors}`);function l(c){if(n===!1){e.setParams({unevaluatedProperty:c}),e.error(),s||t.break();return}if(!(0,Um.alwaysValidSchema)(i,n)){const f=t.name("valid");e.subschema({keyword:"unevaluatedProperties",dataProp:c,dataPropType:Um.Type.Str},f),s||t.if((0,kn.not)(f),()=>t.break())}}function u(c,f){return(0,kn._)`!${c} || !${c}[${f}]`}function d(c,f){const m=[];for(const y in c)c[y]===!0&&m.push((0,kn._)`${f} !== ${y}`);return(0,kn.and)(...m)}}};Uf.default=l4;var Wf={};Object.defineProperty(Wf,"__esModule",{value:!0});const or=ie,Wm=ee,u4={message:({params:{len:e}})=>(0,or.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,or._)`{limit: ${e}}`},c4={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:u4,code(e){const{gen:t,schema:n,data:r,it:o}=e,i=o.items||0;if(i===!0)return;const s=t.const("len",(0,or._)`${r}.length`);if(n===!1)e.setParams({len:i}),e.fail((0,or._)`${s} > ${i}`);else if(typeof n=="object"&&!(0,Wm.alwaysValidSchema)(o,n)){const l=t.var("valid",(0,or._)`${s} <= ${i}`);t.if((0,or.not)(l),()=>a(l,i)),e.ok(l)}o.items=!0;function a(l,u){t.forRange("i",u,s,d=>{e.subschema({keyword:"unevaluatedItems",dataProp:d,dataPropType:Wm.Type.Num},l),o.allErrors||t.if((0,or.not)(l),()=>t.break())})}}};Wf.default=c4;Object.defineProperty(Bf,"__esModule",{value:!0});const d4=Uf,f4=Wf,h4=[d4.default,f4.default];Bf.default=h4;var jl={},qf={};Object.defineProperty(qf,"__esModule",{value:!0});const Ce=ie,p4={message:({schemaCode:e})=>(0,Ce.str)`must match format "${e}"`,params:({schemaCode:e})=>(0,Ce._)`{format: ${e}}`},m4={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:p4,code(e,t){const{gen:n,data:r,$data:o,schema:i,schemaCode:s,it:a}=e,{opts:l,errSchemaPath:u,schemaEnv:d,self:c}=a;if(!l.validateFormats)return;o?f():m();function f(){const y=n.scopeValue("formats",{ref:c.formats,code:l.code.formats}),v=n.const("fDef",(0,Ce._)`${y}[${s}]`),w=n.let("fType"),h=n.let("format");n.if((0,Ce._)`typeof ${v} == "object" && !(${v} instanceof RegExp)`,()=>n.assign(w,(0,Ce._)`${v}.type || "string"`).assign(h,(0,Ce._)`${v}.validate`),()=>n.assign(w,(0,Ce._)`"string"`).assign(h,v)),e.fail$data((0,Ce.or)(g(),p()));function g(){return l.strictSchema===!1?Ce.nil:(0,Ce._)`${s} && !${h}`}function p(){const _=d.$async?(0,Ce._)`(${v}.async ? await ${h}(${r}) : ${h}(${r}))`:(0,Ce._)`${h}(${r})`,x=(0,Ce._)`(typeof ${h} == "function" ? ${_} : ${h}.test(${r}))`;return(0,Ce._)`${h} && ${h} !== true && ${w} === ${t} && !${x}`}}function m(){const y=c.formats[i];if(!y){g();return}if(y===!0)return;const[v,w,h]=p(y);v===t&&e.pass(_());function g(){if(l.strictSchema===!1){c.logger.warn(x());return}throw new Error(x());function x(){return`unknown format "${i}" ignored in schema at path "${u}"`}}function p(x){const k=x instanceof RegExp?(0,Ce.regexpCode)(x):l.code.formats?(0,Ce._)`${l.code.formats}${(0,Ce.getProperty)(i)}`:void 0,P=n.scopeValue("formats",{key:i,ref:x,code:k});return typeof x=="object"&&!(x instanceof RegExp)?[x.type||"string",x.validate,(0,Ce._)`${P}.validate`]:["string",x,P]}function _(){if(typeof y=="object"&&!(y instanceof RegExp)&&y.async){if(!d.$async)throw new Error("async format in sync schema");return(0,Ce._)`await ${h}(${r})`}return typeof w=="function"?(0,Ce._)`${h}(${r})`:(0,Ce._)`${h}.test(${r})`}}}};qf.default=m4;Object.defineProperty(jl,"__esModule",{value:!0});const g4=qf,y4=[g4.default];jl.default=y4;var kr={};Object.defineProperty(kr,"__esModule",{value:!0});kr.contentVocabulary=kr.metadataVocabulary=void 0;kr.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];kr.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"];Object.defineProperty(df,"__esModule",{value:!0});const v4=kl,w4=Nl,_4=Pl,$4=Af,x4=Lf,S4=Bf,E4=jl,qm=kr,k4=[$4.default,v4.default,w4.default,(0,_4.default)(!0),E4.default,qm.metadataVocabulary,qm.contentVocabulary,x4.default,S4.default];df.default=k4;var Ml={},Tl={};Object.defineProperty(Tl,"__esModule",{value:!0});Tl.DiscrError=void 0;var Km;(function(e){e.Tag="tag",e.Mapping="mapping"})(Km||(Tl.DiscrError=Km={}));Object.defineProperty(Ml,"__esModule",{value:!0});const Tr=ie,Dc=Tl,Xm=Ge,N4=Cr,P4=ee,C4={message:({params:{discrError:e,tagName:t}})=>e===Dc.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:n}})=>(0,Tr._)`{error: ${e}, tag: ${n}, tagValue: ${t}}`},b4={keyword:"discriminator",type:"object",schemaType:"object",error:C4,code(e){const{gen:t,data:n,schema:r,parentSchema:o,it:i}=e,{oneOf:s}=o;if(!i.opts.discriminator)throw new Error("discriminator: requires discriminator option");const a=r.propertyName;if(typeof a!="string")throw new Error("discriminator: requires propertyName");if(r.mapping)throw new Error("discriminator: mapping is not supported");if(!s)throw new Error("discriminator: requires oneOf keyword");const l=t.let("valid",!1),u=t.const("tag",(0,Tr._)`${n}${(0,Tr.getProperty)(a)}`);t.if((0,Tr._)`typeof ${u} == "string"`,()=>d(),()=>e.error(!1,{discrError:Dc.DiscrError.Tag,tag:u,tagName:a})),e.ok(l);function d(){const m=f();t.if(!1);for(const y in m)t.elseIf((0,Tr._)`${u} === ${y}`),t.assign(l,c(m[y]));t.else(),e.error(!1,{discrError:Dc.DiscrError.Mapping,tag:u,tagName:a}),t.endIf()}function c(m){const y=t.name("valid"),v=e.subschema({keyword:"oneOf",schemaProp:m},y);return e.mergeEvaluated(v,Tr.Name),y}function f(){var m;const y={},v=h(o);let w=!0;for(let _=0;_<s.length;_++){let x=s[_];if(x!=null&&x.$ref&&!(0,P4.schemaHasRulesButRef)(x,i.self.RULES)){const P=x.$ref;if(x=Xm.resolveRef.call(i.self,i.schemaEnv.root,i.baseId,P),x instanceof Xm.SchemaEnv&&(x=x.schema),x===void 0)throw new N4.default(i.opts.uriResolver,i.baseId,P)}const k=(m=x==null?void 0:x.properties)===null||m===void 0?void 0:m[a];if(typeof k!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${a}"`);w=w&&(v||h(x)),g(k,_)}if(!w)throw new Error(`discriminator: "${a}" must be required`);return y;function h({required:_}){return Array.isArray(_)&&_.includes(a)}function g(_,x){if(_.const)p(_.const,x);else if(_.enum)for(const k of _.enum)p(k,x);else throw new Error(`discriminator: "properties/${a}" must have "const" or "enum"`)}function p(_,x){if(typeof _!="string"||_ in y)throw new Error(`discriminator: "${a}" values must be unique strings`);y[_]=x}}}};Ml.default=b4;var Kf={};const j4="https://json-schema.org/draft/2020-12/schema",M4="https://json-schema.org/draft/2020-12/schema",T4={"https://json-schema.org/draft/2020-12/vocab/core":!0,"https://json-schema.org/draft/2020-12/vocab/applicator":!0,"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0,"https://json-schema.org/draft/2020-12/vocab/validation":!0,"https://json-schema.org/draft/2020-12/vocab/meta-data":!0,"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0,"https://json-schema.org/draft/2020-12/vocab/content":!0},I4="meta",R4="Core and Validation specifications meta-schema",z4=[{$ref:"meta/core"},{$ref:"meta/applicator"},{$ref:"meta/unevaluated"},{$ref:"meta/validation"},{$ref:"meta/meta-data"},{$ref:"meta/format-annotation"},{$ref:"meta/content"}],A4=["object","boolean"],O4="This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.",D4={definitions:{$comment:'"definitions" has been replaced by "$defs".',type:"object",additionalProperties:{$dynamicRef:"#meta"},deprecated:!0,default:{}},dependencies:{$comment:'"dependencies" has been split and replaced by "dependentSchemas" and "dependentRequired" in order to serve their differing semantics.',type:"object",additionalProperties:{anyOf:[{$dynamicRef:"#meta"},{$ref:"meta/validation#/$defs/stringArray"}]},deprecated:!0,default:{}},$recursiveAnchor:{$comment:'"$recursiveAnchor" has been replaced by "$dynamicAnchor".',$ref:"meta/core#/$defs/anchorString",deprecated:!0},$recursiveRef:{$comment:'"$recursiveRef" has been replaced by "$dynamicRef".',$ref:"meta/core#/$defs/uriReferenceString",deprecated:!0}},L4={$schema:j4,$id:M4,$vocabulary:T4,$dynamicAnchor:I4,title:R4,allOf:z4,type:A4,$comment:O4,properties:D4},V4="https://json-schema.org/draft/2020-12/schema",F4="https://json-schema.org/draft/2020-12/meta/applicator",H4={"https://json-schema.org/draft/2020-12/vocab/applicator":!0},B4="meta",U4="Applicator vocabulary meta-schema",W4=["object","boolean"],q4={prefixItems:{$ref:"#/$defs/schemaArray"},items:{$dynamicRef:"#meta"},contains:{$dynamicRef:"#meta"},additionalProperties:{$dynamicRef:"#meta"},properties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},patternProperties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},propertyNames:{format:"regex"},default:{}},dependentSchemas:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},propertyNames:{$dynamicRef:"#meta"},if:{$dynamicRef:"#meta"},then:{$dynamicRef:"#meta"},else:{$dynamicRef:"#meta"},allOf:{$ref:"#/$defs/schemaArray"},anyOf:{$ref:"#/$defs/schemaArray"},oneOf:{$ref:"#/$defs/schemaArray"},not:{$dynamicRef:"#meta"}},K4={schemaArray:{type:"array",minItems:1,items:{$dynamicRef:"#meta"}}},X4={$schema:V4,$id:F4,$vocabulary:H4,$dynamicAnchor:B4,title:U4,type:W4,properties:q4,$defs:K4},Y4="https://json-schema.org/draft/2020-12/schema",G4="https://json-schema.org/draft/2020-12/meta/unevaluated",Q4={"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0},Z4="meta",J4="Unevaluated applicator vocabulary meta-schema",e3=["object","boolean"],t3={unevaluatedItems:{$dynamicRef:"#meta"},unevaluatedProperties:{$dynamicRef:"#meta"}},n3={$schema:Y4,$id:G4,$vocabulary:Q4,$dynamicAnchor:Z4,title:J4,type:e3,properties:t3},r3="https://json-schema.org/draft/2020-12/schema",o3="https://json-schema.org/draft/2020-12/meta/content",i3={"https://json-schema.org/draft/2020-12/vocab/content":!0},s3="meta",a3="Content vocabulary meta-schema",l3=["object","boolean"],u3={contentEncoding:{type:"string"},contentMediaType:{type:"string"},contentSchema:{$dynamicRef:"#meta"}},c3={$schema:r3,$id:o3,$vocabulary:i3,$dynamicAnchor:s3,title:a3,type:l3,properties:u3},d3="https://json-schema.org/draft/2020-12/schema",f3="https://json-schema.org/draft/2020-12/meta/core",h3={"https://json-schema.org/draft/2020-12/vocab/core":!0},p3="meta",m3="Core vocabulary meta-schema",g3=["object","boolean"],y3={$id:{$ref:"#/$defs/uriReferenceString",$comment:"Non-empty fragments not allowed.",pattern:"^[^#]*#?$"},$schema:{$ref:"#/$defs/uriString"},$ref:{$ref:"#/$defs/uriReferenceString"},$anchor:{$ref:"#/$defs/anchorString"},$dynamicRef:{$ref:"#/$defs/uriReferenceString"},$dynamicAnchor:{$ref:"#/$defs/anchorString"},$vocabulary:{type:"object",propertyNames:{$ref:"#/$defs/uriString"},additionalProperties:{type:"boolean"}},$comment:{type:"string"},$defs:{type:"object",additionalProperties:{$dynamicRef:"#meta"}}},v3={anchorString:{type:"string",pattern:"^[A-Za-z_][-A-Za-z0-9._]*$"},uriString:{type:"string",format:"uri"},uriReferenceString:{type:"string",format:"uri-reference"}},w3={$schema:d3,$id:f3,$vocabulary:h3,$dynamicAnchor:p3,title:m3,type:g3,properties:y3,$defs:v3},_3="https://json-schema.org/draft/2020-12/schema",$3="https://json-schema.org/draft/2020-12/meta/format-annotation",x3={"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0},S3="meta",E3="Format vocabulary meta-schema for annotation results",k3=["object","boolean"],N3={format:{type:"string"}},P3={$schema:_3,$id:$3,$vocabulary:x3,$dynamicAnchor:S3,title:E3,type:k3,properties:N3},C3="https://json-schema.org/draft/2020-12/schema",b3="https://json-schema.org/draft/2020-12/meta/meta-data",j3={"https://json-schema.org/draft/2020-12/vocab/meta-data":!0},M3="meta",T3="Meta-data vocabulary meta-schema",I3=["object","boolean"],R3={title:{type:"string"},description:{type:"string"},default:!0,deprecated:{type:"boolean",default:!1},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0}},z3={$schema:C3,$id:b3,$vocabulary:j3,$dynamicAnchor:M3,title:T3,type:I3,properties:R3},A3="https://json-schema.org/draft/2020-12/schema",O3="https://json-schema.org/draft/2020-12/meta/validation",D3={"https://json-schema.org/draft/2020-12/vocab/validation":!0},L3="meta",V3="Validation vocabulary meta-schema",F3=["object","boolean"],H3={type:{anyOf:[{$ref:"#/$defs/simpleTypes"},{type:"array",items:{$ref:"#/$defs/simpleTypes"},minItems:1,uniqueItems:!0}]},const:!0,enum:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/$defs/nonNegativeInteger"},minLength:{$ref:"#/$defs/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},maxItems:{$ref:"#/$defs/nonNegativeInteger"},minItems:{$ref:"#/$defs/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxContains:{$ref:"#/$defs/nonNegativeInteger"},minContains:{$ref:"#/$defs/nonNegativeInteger",default:1},maxProperties:{$ref:"#/$defs/nonNegativeInteger"},minProperties:{$ref:"#/$defs/nonNegativeIntegerDefault0"},required:{$ref:"#/$defs/stringArray"},dependentRequired:{type:"object",additionalProperties:{$ref:"#/$defs/stringArray"}}},B3={nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{$ref:"#/$defs/nonNegativeInteger",default:0},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},U3={$schema:A3,$id:O3,$vocabulary:D3,$dynamicAnchor:L3,title:V3,type:F3,properties:H3,$defs:B3};Object.defineProperty(Kf,"__esModule",{value:!0});const W3=L4,q3=X4,K3=n3,X3=c3,Y3=w3,G3=P3,Q3=z3,Z3=U3,J3=["/properties"];function eR(e){return[W3,q3,K3,X3,Y3,t(this,G3),Q3,t(this,Z3)].forEach(n=>this.addMetaSchema(n,void 0,!1)),this;function t(n,r){return e?n.$dataMetaSchema(r,J3):r}}Kf.default=eR;(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv2020=void 0;const n=ef,r=df,o=Ml,i=Kf,s="https://json-schema.org/draft/2020-12/schema";class a extends n.default{constructor(m={}){super({...m,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),r.default.forEach(m=>this.addVocabulary(m)),this.opts.discriminator&&this.addKeyword(o.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();const{$data:m,meta:y}=this.opts;y&&(i.default.call(this,m),this.refs["http://json-schema.org/schema"]=s)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(s)?s:void 0)}}t.Ajv2020=a,e.exports=t=a,e.exports.Ajv2020=a,Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var l=es();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return l.KeywordCxt}});var u=ie;Object.defineProperty(t,"_",{enumerable:!0,get:function(){return u._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return u.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return u.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return u.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return u.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return u.CodeGen}});var d=ko;Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return d.default}});var c=Cr;Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return c.default}})})(Mc,Mc.exports);var tR=Mc.exports;const nR=Wa(tR);var Lc={exports:{}},nw={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatNames=e.fastFormats=e.fullFormats=void 0;function t(I,H){return{validate:I,compare:H}}e.fullFormats={date:t(i,s),time:t(l(!0),u),"date-time":t(f(!0),m),"iso-time":t(l(),d),"iso-date-time":t(f(),y),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:h,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:W,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:p,int32:{type:"number",validate:k},int64:{type:"number",validate:P},float:{type:"number",validate:b},double:{type:"number",validate:b},password:!0,binary:!0},e.fastFormats={...e.fullFormats,date:t(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,s),time:t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,u),"date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,m),"iso-time":t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,d),"iso-date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,y),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},e.formatNames=Object.keys(e.fullFormats);function n(I){return I%4===0&&(I%100!==0||I%400===0)}const r=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,o=[0,31,28,31,30,31,30,31,31,30,31,30,31];function i(I){const H=r.exec(I);if(!H)return!1;const q=+H[1],E=+H[2],O=+H[3];return E>=1&&E<=12&&O>=1&&O<=(E===2&&n(q)?29:o[E])}function s(I,H){if(I&&H)return I>H?1:I<H?-1:0}const a=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function l(I){return function(q){const E=a.exec(q);if(!E)return!1;const O=+E[1],M=+E[2],V=+E[3],j=E[4],z=E[5]==="-"?-1:1,T=+(E[6]||0),N=+(E[7]||0);if(T>23||N>59||I&&!j)return!1;if(O<=23&&M<=59&&V<60)return!0;const R=M-N*z,D=O-T*z-(R<0?1:0);return(D===23||D===-1)&&(R===59||R===-1)&&V<61}}function u(I,H){if(!(I&&H))return;const q=new Date("2020-01-01T"+I).valueOf(),E=new Date("2020-01-01T"+H).valueOf();if(q&&E)return q-E}function d(I,H){if(!(I&&H))return;const q=a.exec(I),E=a.exec(H);if(q&&E)return I=q[1]+q[2]+q[3],H=E[1]+E[2]+E[3],I>H?1:I<H?-1:0}const c=/t|\s/i;function f(I){const H=l(I);return function(E){const O=E.split(c);return O.length===2&&i(O[0])&&H(O[1])}}function m(I,H){if(!(I&&H))return;const q=new Date(I).valueOf(),E=new Date(H).valueOf();if(q&&E)return q-E}function y(I,H){if(!(I&&H))return;const[q,E]=I.split(c),[O,M]=H.split(c),V=s(q,O);if(V!==void 0)return V||u(E,M)}const v=/\/|:/,w=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function h(I){return v.test(I)&&w.test(I)}const g=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function p(I){return g.lastIndex=0,g.test(I)}const _=-2147483648,x=2**31-1;function k(I){return Number.isInteger(I)&&I<=x&&I>=_}function P(I){return Number.isInteger(I)}function b(){return!0}const F=/[^\\]\\Z/;function W(I){if(F.test(I))return!1;try{return new RegExp(I),!0}catch{return!1}}})(nw);var rw={},Vc={exports:{}},Xf={};Object.defineProperty(Xf,"__esModule",{value:!0});const rR=kl,oR=Nl,iR=Pl,sR=jl,Ym=kr,aR=[rR.default,oR.default,(0,iR.default)(),sR.default,Ym.metadataVocabulary,Ym.contentVocabulary];Xf.default=aR;const lR="http://json-schema.org/draft-07/schema#",uR="http://json-schema.org/draft-07/schema#",cR="Core schema meta-schema",dR={schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},fR=["object","boolean"],hR={$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},pR={$schema:lR,$id:uR,title:cR,definitions:dR,type:fR,properties:hR,default:!0};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv=void 0;const n=ef,r=Xf,o=Ml,i=pR,s=["/properties"],a="http://json-schema.org/draft-07/schema";class l extends n.default{_addVocabularies(){super._addVocabularies(),r.default.forEach(y=>this.addVocabulary(y)),this.opts.discriminator&&this.addKeyword(o.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const y=this.opts.$data?this.$dataMetaSchema(i,s):i;this.addMetaSchema(y,a,!1),this.refs["http://json-schema.org/schema"]=a}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(a)?a:void 0)}}t.Ajv=l,e.exports=t=l,e.exports.Ajv=l,Object.defineProperty(t,"__esModule",{value:!0}),t.default=l;var u=es();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return u.KeywordCxt}});var d=ie;Object.defineProperty(t,"_",{enumerable:!0,get:function(){return d._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return d.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return d.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return d.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return d.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return d.CodeGen}});var c=ko;Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return c.default}});var f=Cr;Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return f.default}})})(Vc,Vc.exports);var mR=Vc.exports;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatLimitDefinition=void 0;const t=mR,n=ie,r=n.operators,o={formatMaximum:{okStr:"<=",ok:r.LTE,fail:r.GT},formatMinimum:{okStr:">=",ok:r.GTE,fail:r.LT},formatExclusiveMaximum:{okStr:"<",ok:r.LT,fail:r.GTE},formatExclusiveMinimum:{okStr:">",ok:r.GT,fail:r.LTE}},i={message:({keyword:a,schemaCode:l})=>(0,n.str)`should be ${o[a].okStr} ${l}`,params:({keyword:a,schemaCode:l})=>(0,n._)`{comparison: ${o[a].okStr}, limit: ${l}}`};e.formatLimitDefinition={keyword:Object.keys(o),type:"string",schemaType:"string",$data:!0,error:i,code(a){const{gen:l,data:u,schemaCode:d,keyword:c,it:f}=a,{opts:m,self:y}=f;if(!m.validateFormats)return;const v=new t.KeywordCxt(f,y.RULES.all.format.definition,"format");v.$data?w():h();function w(){const p=l.scopeValue("formats",{ref:y.formats,code:m.code.formats}),_=l.const("fmt",(0,n._)`${p}[${v.schemaCode}]`);a.fail$data((0,n.or)((0,n._)`typeof ${_} != "object"`,(0,n._)`${_} instanceof RegExp`,(0,n._)`typeof ${_}.compare != "function"`,g(_)))}function h(){const p=v.schema,_=y.formats[p];if(!_||_===!0)return;if(typeof _!="object"||_ instanceof RegExp||typeof _.compare!="function")throw new Error(`"${c}": format "${p}" does not define "compare" function`);const x=l.scopeValue("formats",{key:p,ref:_,code:m.code.formats?(0,n._)`${m.code.formats}${(0,n.getProperty)(p)}`:void 0});a.fail$data(g(x))}function g(p){return(0,n._)`${p}.compare(${u}, ${d}) ${o[c].fail} 0`}},dependencies:["format"]};const s=a=>(a.addKeyword(e.formatLimitDefinition),a);e.default=s})(rw);(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const n=nw,r=rw,o=ie,i=new o.Name("fullFormats"),s=new o.Name("fastFormats"),a=(u,d={keywords:!0})=>{if(Array.isArray(d))return l(u,d,n.fullFormats,i),u;const[c,f]=d.mode==="fast"?[n.fastFormats,s]:[n.fullFormats,i],m=d.formats||n.formatNames;return l(u,m,c,f),d.keywords&&(0,r.default)(u),u};a.get=(u,d="full")=>{const f=(d==="fast"?n.fastFormats:n.fullFormats)[u];if(!f)throw new Error(`Unknown format "${u}"`);return f};function l(u,d,c,f){var m,y;(m=(y=u.opts.code).formats)!==null&&m!==void 0||(y.formats=(0,o._)`require("ajv-formats/dist/formats").${f}`);for(const v of d)u.addFormat(v,c[v])}e.exports=t=a,Object.defineProperty(t,"__esModule",{value:!0}),t.default=a})(Lc,Lc.exports);var gR=Lc.exports;const yR=Wa(gR),vR="https://json-schema.org/draft/2020-12/schema",wR="https://loom-spec.dev/schema/diagram-v1.json",_R="Loom Diagram",$R="A node-based architecture spec file.",xR="object",SR=["version","id","title","nodes","edges"],ER=!1,kR={$schema:{type:"string"},version:{const:"1"},id:{type:"string",pattern:"^[a-z0-9-]+$",description:"Diagram identifier. Should match the filename without extension."},title:{type:"string",minLength:1},description:{type:"string"},nodes:{type:"array",items:{$ref:"#/$defs/Node"}},edges:{type:"array",items:{$ref:"#/$defs/Edge"}},groups:{type:"array",items:{$ref:"#/$defs/Group"},default:[]}},NR={Node:{type:"object",required:["id","type","label","position","status"],additionalProperties:!1,properties:{id:{type:"string",pattern:"^[a-z0-9-]+$",description:"Unique within this diagram."},type:{type:"string",description:"References a key in node-types.json."},label:{type:"string",minLength:1,maxLength:60},description:{type:"string",description:"Markdown allowed."},position:{type:"object",required:["x","y"],additionalProperties:!1,properties:{x:{type:"number"},y:{type:"number"}}},status:{type:"string",enum:["planned","implemented","stale","deprecated"],description:"planned = spec exists, code does not. implemented = both present. stale = code refs are broken, needs review. deprecated = kept for history, no longer active."},code_refs:{type:"array",items:{$ref:"#/$defs/CodeRef"},default:[]},properties:{type:"object",description:"Custom fields defined by the node's type in node-types.json.",default:{}},tags:{type:"array",items:{type:"string"},default:[]},drill_down:{type:"string",pattern:"^[a-z0-9-]+$",description:"ID of another diagram file to navigate into when this node is opened."}}},Edge:{type:"object",required:["id","from","to","kind"],additionalProperties:!1,properties:{id:{type:"string",minLength:1},from:{type:"string",pattern:"^[a-z0-9-]+(:[a-z0-9_-]+)?$",description:"Source node id, optionally with :port-name suffix."},to:{type:"string",pattern:"^[a-z0-9-]+(:[a-z0-9_-]+)?$",description:"Target node id, optionally with :port-name suffix."},kind:{type:"string",enum:["request","event","data-read","data-write","signal","dependency","control"]},label:{type:"string",maxLength:60},description:{type:"string"},direction:{type:"string",enum:["forward","bidirectional"],default:"forward"}}},Group:{type:"object",required:["id","label"],additionalProperties:!1,properties:{id:{type:"string",pattern:"^[a-z0-9-]+$"},label:{type:"string",minLength:1},children:{type:"array",items:{type:"string"},description:"Node ids contained in this group.",default:[]},subgroups:{type:"array",items:{type:"string"},description:"Group ids nested inside this group.",default:[]},color:{type:"string",pattern:"^#[0-9a-fA-F]{6}$"},collapsed:{type:"boolean",default:!1},drill_down:{type:"string",pattern:"^[a-z0-9-]+$"}}},CodeRef:{type:"object",required:["path"],additionalProperties:!1,properties:{path:{type:"string",description:"Repo-relative file path."},symbol:{type:"string",description:"Function, class, or component name. Preferred over lines because it survives refactors."},lines:{type:"string",pattern:"^[0-9]+(-[0-9]+)?(,[0-9]+(-[0-9]+)?)*$",description:"Line range(s) like '1-80' or '12,45-50'. Use only when no symbol applies."}}}},PR={$schema:vR,$id:wR,title:_R,description:$R,type:xR,required:SR,additionalProperties:ER,properties:kR,$defs:NR},ow=new nR({allErrors:!0,strict:!1});yR(ow);const Gm=ow.compile(PR),CR={nodes:"node",edges:"edge",groups:"group"};function $u(e){return Gm(e)?[]:(Gm.errors??[]).map(n=>{var i;const r=n.instancePath??"",o=r.match(/^\/(nodes|edges|groups)\/(\d+)(?:\/(.+))?$/);if(o){const s=o[1],a=CR[s],l=Number(o[2]),u=o[3],d=e[s],c=(i=d==null?void 0:d[l])==null?void 0:i.id;return{path:r,scope:a,itemId:c,field:u,message:n.message??"invalid"}}return{path:r,scope:"root",message:n.message??"invalid"}})}function bR(e,t){const n={};for(const r of e){if(r.scope!=="node"||r.itemId!==t)continue;const o=r.field?r.field.split("/")[0]??"*":"*";n[o]||(n[o]=r.message)}return n}function jR(e,t){const n={};for(const r of e){if(r.scope!=="edge"||r.itemId!==t)continue;const o=r.field?r.field.split("/")[0]??"*":"*";n[o]||(n[o]=r.message)}return n}const MR=500;function TR(e){const[t,n]=A.useState({diagram:null,nodeTypes:null,loadError:null,saveStatus:"idle",saveError:null,connectionStatus:"connecting",validationErrors:[]}),r=A.useRef(null),o=A.useRef(null),i=A.useRef(!1),s=A.useRef(t);s.current=t,A.useEffect(()=>{let w=!1;return Va(e).then(h=>{w||(o.current=h.diagram,i.current=!0,n(g=>({...g,diagram:h.diagram,nodeTypes:h.nodeTypes,validationErrors:$u(h.diagram)})))}).catch(h=>{w||n(g=>({...g,loadError:h instanceof Error?h.message:String(h)}))}),()=>{w=!0}},[e]);const a=A.useCallback(()=>{qn()||(r.current&&clearTimeout(r.current),n(w=>({...w,saveStatus:"dirty",saveError:null})),r.current=setTimeout(async()=>{const w=o.current;if(w){n(h=>({...h,saveStatus:"saving"}));try{await p1(w),n(h=>({...h,saveStatus:"saved"}))}catch(h){n(g=>({...g,saveStatus:"error",saveError:h instanceof Error?h.message:String(h)}))}}},MR))},[]),l=A.useCallback(w=>{i.current&&(n(h=>{if(!h.diagram)return h;const g=w(h.diagram);return o.current=g,{...h,diagram:g,validationErrors:$u(g)}}),a())},[a]),u=A.useCallback((w,h)=>{l(g=>({...g,nodes:g.nodes.map(p=>p.id===w?h(p):p)}))},[l]),d=A.useCallback(w=>{l(h=>({...h,nodes:h.nodes.filter(g=>g.id!==w),edges:h.edges.filter(g=>{const p=g.from.split(":")[0],_=g.to.split(":")[0];return p!==w&&_!==w})}))},[l]),c=A.useCallback(w=>{l(h=>({...h,nodes:[...h.nodes,w]}))},[l]),f=A.useCallback((w,h)=>{l(g=>({...g,edges:g.edges.map(p=>p.id===w?h(p):p)}))},[l]),m=A.useCallback(w=>{l(h=>({...h,edges:[...h.edges,w]}))},[l]),y=A.useCallback(w=>{l(h=>({...h,edges:h.edges.filter(g=>g.id!==w)}))},[l]);return A.useEffect(()=>{if(qn()){n(g=>({...g,connectionStatus:"connected"}));return}n(g=>({...g,connectionStatus:"connecting"}));const w=new EventSource("/api/events"),h=()=>{const g=s.current.saveStatus;g==="dirty"||g==="saving"||Va(e).then(p=>{o.current=p.diagram,n(_=>({..._,diagram:p.diagram,nodeTypes:p.nodeTypes,saveStatus:"idle",saveError:null,validationErrors:$u(p.diagram)}))}).catch(()=>{})};return w.onopen=()=>{n(g=>({...g,connectionStatus:"connected"}))},w.onerror=()=>{n(g=>({...g,connectionStatus:"disconnected"}))},w.addEventListener("change",g=>{try{const p=JSON.parse(g.data);(p.type==="diagram-changed"&&p.id===e||p.type==="node-types-changed")&&h()}catch{}}),()=>{w.close()}},[e]),A.useEffect(()=>()=>{r.current&&clearTimeout(r.current)},[]),A.useMemo(()=>({...t,updateNode:u,deleteNode:d,addNode:c,updateEdge:f,addEdge:m,deleteEdge:y}),[t,u,d,c,f,m,y])}function IR(e,t){const n=new Set(e.nodes.map(o=>o.id));let r=1;for(;n.has(`${t}-${r}`);)r++;return`${t}-${r}`}function RR(e){const t=new Set(e.edges.map(r=>r.id));let n=e.edges.length+1;for(;t.has(`e${n}`);)n++;return`e${n}`}const zR=200,AR=90,Qm=24,Zm=32,OR=18;function DR(e){const t=new Map((e.groups??[]).map(s=>[s.id,s])),n=new Map(e.nodes.map(s=>[s.id,s])),r=new Map,o=new Set;function i(s){const a=r.get(s);if(a)return a;if(o.has(s))return null;o.add(s);const l=t.get(s);if(!l)return o.delete(s),null;let u=1/0,d=1/0,c=-1/0,f=-1/0;for(const y of l.children??[]){const v=n.get(y);if(!v)continue;const{x:w,y:h}=v.position;u=Math.min(u,w),d=Math.min(d,h),c=Math.max(c,w+zR),f=Math.max(f,h+AR)}for(const y of l.subgroups??[]){const v=i(y);v&&(u=Math.min(u,v.x),d=Math.min(d,v.y),c=Math.max(c,v.x+v.width),f=Math.max(f,v.y+v.height))}let m;return isFinite(u)?m={x:u-Qm,y:d-Zm,width:c-u+Qm*2,height:f-d+Zm+OR}:m={x:50,y:50,width:220,height:80},r.set(s,m),o.delete(s),m}for(const s of e.groups??[])i(s.id);return r}function LR(e){const t=new Map(e.map(o=>[o.id,o])),n=new Map;function r(o,i=new Set){if(n.has(o))return n.get(o);if(i.has(o))return 0;i.add(o);const s=t.get(o);if(!s||!s.subgroups||s.subgroups.length===0)return n.set(o,0),0;let a=0;for(const l of s.subgroups)a=Math.max(a,r(l,i)+1);return n.set(o,a),a}for(const o of e)r(o.id);return[...e].sort((o,i)=>(n.get(i.id)??0)-(n.get(o.id)??0))}const VR={request:"var(--edge-request)",event:"var(--edge-event)","data-read":"var(--edge-data-read)","data-write":"var(--edge-data-write)",signal:"var(--edge-signal)",dependency:"var(--edge-dependency)",control:"var(--edge-control)"},FR={loom:Db,loomGroup:Lb},HR={parallel:Fb,pulse:Ub};function zs(e){const t=e.indexOf(":");return t===-1?e:e.slice(0,t)}function Jm(e){const t=e.indexOf(":");return t===-1?{node:e,port:null}:{node:e.slice(0,t),port:e.slice(t+1)}}function iw({diagram:e,nodeTypesConfig:t,selection:n,onSelect:r,onMoveNode:o,onDeleteNode:i,onDeleteEdge:s,onAddEdge:a,onDrillDown:l,interactive:u=!0,activeNodeIds:d,pulsingEdgeIds:c}){const f=A.useMemo(()=>{const _=DR(e),k=LR(e.groups??[]).flatMap(b=>{const F=_.get(b.id);return F?[{id:`__group__${b.id}`,type:"loomGroup",position:{x:F.x,y:F.y},width:F.width,height:F.height,draggable:!1,selectable:!1,focusable:!1,deletable:!1,data:{group:b,onDrillDown:l}}]:[]}),P=e.nodes.map(b=>({id:b.id,type:"loom",position:b.position,selected:(n==null?void 0:n.kind)==="node"&&n.id===b.id,draggable:u,selectable:u,data:{node:b,typeDef:t.types[b.type],onDrillDown:l,active:(d==null?void 0:d.has(b.id))??!1}}));return[...k,...P]},[e,t,n,l,u,d]),m=A.useMemo(()=>{const _=new Map;for(const x of e.edges){const k=`${zs(x.from)}::${zs(x.to)}`,P=_.get(k);P?P.push(x):_.set(k,[x])}return e.edges.map(x=>{const k=`${zs(x.from)}::${zs(x.to)}`,P=_.get(k),b=P.findIndex(M=>M.id===x.id),F=P.length,W=F===1?0:b-(F-1)/2,I=F>1,H=Jm(x.from),q=Jm(x.to),E=(c==null?void 0:c.has(x.id))??!1,O=E?"pulse":I?"parallel":void 0;return{id:x.id,source:H.node,target:q.node,sourceHandle:H.port,targetHandle:q.port,type:O,label:x.label,selected:(n==null?void 0:n.kind)==="edge"&&n.id===x.id,selectable:u,style:{stroke:VR[x.kind],strokeWidth:1.5},labelStyle:{fill:"var(--text-muted)",fontSize:11},labelBgStyle:{fill:"var(--bg-elevated)"},labelBgPadding:[4,2],labelBgBorderRadius:3,animated:!E&&(x.kind==="event"||x.kind==="signal"),data:{parallelOffset:I?W:0,pulsing:E}}})},[e,n,u,c]),y=A.useCallback(_=>{for(const x of _)"id"in x&&x.id.startsWith("__group__")||(x.type==="position"&&x.position&&!x.dragging?o==null||o(x.id,x.position):x.type==="remove"&&(i==null||i(x.id)))},[o,i]),v=A.useCallback(_=>{for(const x of _)x.type==="remove"&&(s==null||s(x.id))},[s]),w=A.useCallback(_=>{if(!_.source||!_.target)return;const x=_.sourceHandle?`${_.source}:${_.sourceHandle}`:_.source,k=_.targetHandle?`${_.target}:${_.targetHandle}`:_.target;a==null||a({id:RR(e),from:x,to:k,kind:"request"})},[e,a]),h=A.useCallback(({nodes:_,edges:x})=>{r&&(_[0]?r({kind:"node",id:_[0].id}):x[0]?r({kind:"edge",id:x[0].id}):r(null))},[r]),g=A.useRef(null),p=A.useRef(null);return A.useEffect(()=>{if(u)return;const _=g.current;if(!_)return;let x=null;const k=()=>{x&&clearTimeout(x),x=setTimeout(()=>{var b;(b=p.current)==null||b.fitView({padding:.2,duration:200,minZoom:.05,maxZoom:1.5})},60)},P=new ResizeObserver(k);return P.observe(_),()=>{x&&clearTimeout(x),P.disconnect()}},[u,e]),$.jsx("div",{className:"canvas-wrap",ref:g,children:$.jsxs(ab,{nodes:f,edges:m,nodeTypes:FR,edgeTypes:HR,onNodesChange:u?y:void 0,onEdgesChange:u?v:void 0,onConnect:u?w:void 0,onSelectionChange:u?h:void 0,onNodeDoubleClick:u?(_,x)=>{var P;const k=x.data;(P=k.node)!=null&&P.drill_down&&(l==null||l(k.node.drill_down))}:void 0,nodesDraggable:u,nodesConnectable:u,elementsSelectable:u,minZoom:u?.2:.05,fitView:!0,fitViewOptions:u?{padding:.2}:{padding:.2,minZoom:.05,maxZoom:1.5},proOptions:{hideAttribution:!0},deleteKeyCode:u?["Backspace","Delete"]:null,onInit:_=>{p.current=_,u||setTimeout(()=>_.fitView({padding:.2,duration:0,minZoom:.05,maxZoom:1.5}),80)},children:[$.jsx(hb,{gap:16,size:1,color:"var(--grid-dot)"}),u&&$.jsx(_b,{})]})})}function ur({message:e}){return e?$.jsx("div",{className:"field-error",children:e}):null}const BR={planned:"var(--status-planned)",implemented:"var(--status-implemented)",stale:"var(--status-stale)",deprecated:"var(--status-deprecated)"},UR=["planned","implemented","stale","deprecated"],WR=["request","event","data-read","data-write","signal","dependency","control"];function qR(e){return e.selectedNode?$.jsx(KR,{...e,node:e.selectedNode}):e.selectedEdge?$.jsx(XR,{...e,edge:e.selectedEdge}):$.jsx("div",{className:"inspector",children:$.jsx("div",{className:"empty",children:"Select a node or edge to inspect"})})}function KR({node:e,nodeTypes:t,validationErrors:n,onUpdateNode:r}){const o=t.types[e.type],i=(o==null?void 0:o.color)??"#71717a",s=e.properties??{},a=e.code_refs??[],l=e.tags??[],u=bR(n,e.id),d=f=>{r==null||r(e.id,f)},c=(f,m)=>d(y=>({...y,properties:{...y.properties??{},[f]:m}}));return $.jsxs("div",{className:"inspector",children:[$.jsx("span",{className:"type-tag",style:{background:i,color:"#fff"},children:(o==null?void 0:o.label)??e.type}),$.jsxs("div",{className:"field",children:[$.jsx("div",{className:"field-label",children:"Label"}),$.jsx("input",{className:"input",value:e.label,onChange:f=>d(m=>({...m,label:f.target.value}))}),$.jsx(ur,{message:u.label})]}),$.jsxs("div",{className:"field",children:[$.jsx("div",{className:"field-label",children:"Status"}),$.jsx("select",{className:"input",value:e.status,onChange:f=>d(m=>({...m,status:f.target.value})),children:UR.map(f=>$.jsx("option",{value:f,children:f},f))}),$.jsx("div",{className:"status-line",style:{background:BR[e.status]}})]}),$.jsxs("div",{className:"field",children:[$.jsx("div",{className:"field-label",children:"ID"}),$.jsx("div",{className:"field-value",children:$.jsx("code",{children:e.id})}),$.jsx(ur,{message:u.id})]}),$.jsxs("div",{className:"field",children:[$.jsx("div",{className:"field-label",children:"Description"}),$.jsx("textarea",{className:"input textarea",rows:3,value:e.description??"",placeholder:"Markdown allowed",onChange:f=>d(m=>({...m,description:f.target.value||void 0}))}),$.jsx(ur,{message:u.description})]}),((o==null?void 0:o.fields)??[]).length>0&&$.jsxs("div",{className:"field",children:[$.jsx("div",{className:"field-label",children:"Properties"}),((o==null?void 0:o.fields)??[]).map(f=>$.jsx(GR,{field:f,value:s[f.name],onChange:m=>c(f.name,m)},f.name))]}),$.jsxs("div",{className:"field",children:[$.jsx("div",{className:"field-label",children:"Code refs"}),$.jsx(ur,{message:u.code_refs}),a.map((f,m)=>$.jsxs("div",{className:"code-ref-row",children:[$.jsx("input",{className:"input",value:f.path,placeholder:"src/path/to/file.ts",onChange:y=>d(v=>{const w=[...v.code_refs??[]];return w[m]={...w[m],path:y.target.value},{...v,code_refs:w}})}),$.jsx("input",{className:"input small",value:f.symbol??"",placeholder:"symbol",onChange:y=>d(v=>{const w=[...v.code_refs??[]];return w[m]={...w[m],symbol:y.target.value||void 0},{...v,code_refs:w}})}),$.jsx("input",{className:"input small",value:f.lines??"",placeholder:"lines",onChange:y=>d(v=>{const w=[...v.code_refs??[]];return w[m]={...w[m],lines:y.target.value||void 0},{...v,code_refs:w}})}),$.jsx("button",{type:"button",className:"row-delete",title:"Remove ref","aria-label":"Remove ref",onClick:()=>d(y=>({...y,code_refs:(y.code_refs??[]).filter((v,w)=>w!==m)})),children:$.jsx(Sy,{size:12})})]},m)),$.jsxs("button",{type:"button",className:"add-row",onClick:()=>d(f=>({...f,code_refs:[...f.code_refs??[],{path:""}]})),children:[$.jsx(ll,{size:12})," Add code ref"]})]}),$.jsxs("div",{className:"field",children:[$.jsx("div",{className:"field-label",children:"Tags"}),$.jsx(YR,{value:l,onChange:f=>d(m=>({...m,tags:f.length>0?f:void 0}))})]})]})}function XR({edge:e,validationErrors:t,onUpdateEdge:n}){const r=i=>{n==null||n(e.id,i)},o=jR(t,e.id);return $.jsxs("div",{className:"inspector",children:[$.jsx("span",{className:"type-tag",style:{background:"#71717a",color:"#fff"},children:"EDGE"}),$.jsxs("div",{className:"field",children:[$.jsx("div",{className:"field-label",children:"From → To"}),$.jsxs("div",{className:"field-value",children:[$.jsx("code",{children:e.from})," → ",$.jsx("code",{children:e.to})]}),$.jsx(ur,{message:o.from??o.to})]}),$.jsxs("div",{className:"field",children:[$.jsx("div",{className:"field-label",children:"Kind"}),$.jsx("select",{className:"input",value:e.kind,onChange:i=>r(s=>({...s,kind:i.target.value})),children:WR.map(i=>$.jsx("option",{value:i,children:i},i))}),$.jsx(ur,{message:o.kind})]}),$.jsxs("div",{className:"field",children:[$.jsx("div",{className:"field-label",children:"Label"}),$.jsx("input",{className:"input",value:e.label??"",onChange:i=>r(s=>({...s,label:i.target.value||void 0}))}),$.jsx(ur,{message:o.label})]}),$.jsxs("div",{className:"field",children:[$.jsx("div",{className:"field-label",children:"Description"}),$.jsx("textarea",{className:"input textarea",rows:2,value:e.description??"",onChange:i=>r(s=>({...s,description:i.target.value||void 0}))})]})]})}function YR({value:e,onChange:t}){const[n,r]=A.useState(""),o=()=>{const i=n.trim().toLowerCase();r(""),i&&(e.includes(i)||t([...e,i]))};return $.jsxs("div",{className:"tag-input",children:[$.jsx("div",{className:"tag-chips",children:e.map(i=>$.jsxs("span",{className:"tag",children:[i,$.jsx("button",{type:"button",className:"tag-x","aria-label":`Remove tag ${i}`,onClick:()=>t(e.filter(s=>s!==i)),children:$.jsx(Sy,{size:10})})]},i))}),$.jsx("input",{className:"input",value:n,placeholder:"Add tag and press Enter",onChange:i=>r(i.target.value),onKeyDown:i=>{i.key==="Enter"?(i.preventDefault(),o()):i.key==="Backspace"&&n===""&&e.length>0&&t(e.slice(0,-1))},onBlur:o})]})}function GR({field:e,value:t,onChange:n}){if(e.type==="boolean")return $.jsxs("label",{style:{display:"flex",gap:6,alignItems:"center",margin:"4px 0"},children:[$.jsx("input",{type:"checkbox",checked:!!t,onChange:r=>n(r.target.checked)}),$.jsx("span",{style:{color:"var(--text-muted)",fontSize:12},children:e.name})]});if(e.type==="enum"){const r=e.values??[];return $.jsxs("div",{style:{margin:"4px 0"},children:[$.jsx("div",{style:{color:"var(--text-muted)",fontSize:11},children:e.name}),$.jsxs("select",{className:"input",value:t??"",onChange:o=>n(o.target.value||void 0),children:[$.jsx("option",{value:"",children:"—"}),r.map(o=>$.jsx("option",{value:o,children:o},o))]})]})}return e.type==="number"?$.jsxs("div",{style:{margin:"4px 0"},children:[$.jsx("div",{style:{color:"var(--text-muted)",fontSize:11},children:e.name}),$.jsx("input",{className:"input",type:"number",value:t??"",onChange:r=>n(r.target.value===""?void 0:Number(r.target.value))})]}):e.type==="markdown"?$.jsxs("div",{style:{margin:"4px 0"},children:[$.jsx("div",{style:{color:"var(--text-muted)",fontSize:11},children:e.name}),$.jsx("textarea",{className:"input textarea",rows:3,value:t??"",onChange:r=>n(r.target.value||void 0)})]}):$.jsxs("div",{style:{margin:"4px 0"},children:[$.jsx("div",{style:{color:"var(--text-muted)",fontSize:11},children:e.name}),$.jsx("input",{className:"input",value:t??"",onChange:r=>n(r.target.value||void 0)})]})}function QR({nodeTypes:e,anchorRef:t,onPick:n,onClose:r}){const o=A.useRef(null),[i,s]=A.useState(null);return A.useLayoutEffect(()=>{function a(){const l=t.current;if(!l)return;const u=l.getBoundingClientRect();s({top:u.bottom+6,right:Math.max(8,window.innerWidth-u.right)})}return a(),window.addEventListener("resize",a),()=>window.removeEventListener("resize",a)},[t]),A.useEffect(()=>{function a(l){var u;if(o.current&&!o.current.contains(l.target)){if((u=t.current)!=null&&u.contains(l.target))return;r()}}return document.addEventListener("mousedown",a),()=>document.removeEventListener("mousedown",a)},[r,t]),i?$.jsxs("div",{className:"add-node-menu",ref:o,style:{top:i.top,right:i.right},children:[$.jsx("div",{className:"add-node-menu-title",children:"Add node"}),Object.entries(e.types).map(([a,l])=>$.jsxs("button",{className:"add-node-item",onClick:()=>n(a),style:{"--node-color":l.color},children:[$.jsx("span",{className:"add-node-color"}),$.jsxs("div",{className:"add-node-text",children:[$.jsx("div",{className:"add-node-label",children:l.label}),$.jsx("code",{className:"add-node-key",children:a})]})]},a))]}):null}function ZR({id:e,diagrams:t,timelines:n,refreshDiagrams:r,isDefault:o,onClickHome:i,onNavigate:s}){const a=TR(e),[l,u]=A.useState(null),[d,c]=A.useState(!1),f=A.useRef(null),m=qn(),y=A.useCallback(p=>{u(null),c(!1),s(p)},[s]),v=A.useCallback(async()=>{const p=window.prompt("New diagram id (lowercase letters, digits, hyphens):","");if(p===null)return;const _=p.trim();if(!_)return;if(!/^[a-z0-9-]+$/.test(_)){window.alert("Invalid id. Use lowercase letters, digits, and hyphens only.");return}if(t.some(k=>k.id===_)){window.alert(`A diagram with id "${_}" already exists.`);return}const x=window.prompt("Title:",_.replace(/-/g," ").replace(/\b\w/g,k=>k.toUpperCase()))??_;try{await m1(_,x),r(),y({kind:"diagram",id:_})}catch(k){window.alert(`Failed to create diagram: ${k instanceof Error?k.message:String(k)}`)}},[t,r,y]),w=A.useCallback(p=>{if(!a.diagram)return;const _=IR(a.diagram,p),x={id:_,type:p,label:"Untitled",position:{x:200,y:200},status:"planned",code_refs:[],properties:{}};a.addNode(x),u({kind:"node",id:_}),c(!1)},[a]);if(a.loadError)return $.jsxs("div",{className:"app",children:[$.jsx("div",{className:"topbar",children:$.jsx("div",{className:"title",children:"loom-spec"})}),$.jsx("div",{className:"canvas-wrap",style:{padding:24},children:$.jsxs("code",{style:{color:"var(--status-stale)"},children:["Failed to load: ",a.loadError]})}),$.jsx("div",{className:"inspector",children:$.jsx("div",{className:"empty",children:"—"})})]});if(!a.diagram||!a.nodeTypes)return $.jsxs("div",{className:"app",children:[$.jsx("div",{className:"topbar",children:$.jsx("div",{className:"title",children:"loom-spec"})}),$.jsx("div",{className:"canvas-wrap",style:{padding:24,color:"var(--text-muted)"},children:"Loading…"}),$.jsx("div",{className:"inspector",children:$.jsx("div",{className:"empty",children:"—"})})]});const h=(l==null?void 0:l.kind)==="node"?a.diagram.nodes.find(p=>p.id===l.id)??null:null,g=(l==null?void 0:l.kind)==="edge"?a.diagram.edges.find(p=>p.id===l.id)??null:null;return $.jsxs("div",{className:"app",children:[$.jsx(Ey,{viewKind:"diagram",viewId:e,title:a.diagram.title,subtitle:a.diagram.description,diagrams:t,timelines:n,saveStatus:a.saveStatus,saveError:a.saveError,connectionStatus:a.connectionStatus,validationErrorCount:a.validationErrors.length,onClickAdd:()=>c(p=>!p),addMenuOpen:d,isDefault:o,onClickHome:i,onNavigate:y,onCreateDiagram:m?void 0:v,addButtonRef:f,hideAddButton:m}),d&&!m&&$.jsx(QR,{nodeTypes:a.nodeTypes,anchorRef:f,onPick:w,onClose:()=>c(!1)}),$.jsx(iw,{diagram:a.diagram,nodeTypesConfig:a.nodeTypes,selection:l,onSelect:u,onMoveNode:m?void 0:(p,_)=>a.updateNode(p,x=>({...x,position:_})),onDeleteNode:m?void 0:p=>{a.deleteNode(p),(l==null?void 0:l.kind)==="node"&&l.id===p&&u(null)},onDeleteEdge:m?void 0:p=>{a.deleteEdge(p),(l==null?void 0:l.kind)==="edge"&&l.id===p&&u(null)},onAddEdge:m?void 0:a.addEdge,onDrillDown:p=>y({kind:"diagram",id:p}),interactive:!m}),$.jsx(qR,{selectedNode:h,selectedEdge:g,nodeTypes:a.nodeTypes,validationErrors:a.validationErrors,onUpdateNode:m?void 0:a.updateNode,onUpdateEdge:m?void 0:a.updateEdge})]})}const Yf="overview",As={kind:"diagram",id:Yf};function eg(){if(typeof location>"u")return As;const e=location.hash.replace(/^#/,"").trim();if(!e)return As;if(e.startsWith("timeline:")){const t=e.slice(9).trim();return t?{kind:"timeline",id:t}:As}if(e.startsWith("diagram:")){const t=e.slice(8).trim();return t?{kind:"diagram",id:t}:As}return{kind:"diagram",id:e}}function JR(e){return e.kind==="diagram"&&e.id===Yf?"":e.kind==="diagram"?`#diagram:${e.id}`:`#timeline:${e.id}`}function ez(){const[e,t]=A.useState(()=>eg());A.useEffect(()=>{const o=()=>t(eg());return window.addEventListener("hashchange",o),()=>window.removeEventListener("hashchange",o)},[]);const n=A.useCallback(o=>{const i=JR(o);history.pushState(null,"",i||location.pathname),t(o)},[]),r=e.kind==="diagram"&&e.id===Yf;return{view:e,navigate:n,isDefault:r}}function tz(){const[e,t]=A.useState([]),[n,r]=A.useState(null),o=A.useCallback(()=>{Kb().then(t).catch(i=>r(i instanceof Error?i.message:String(i)))},[]);return A.useEffect(()=>{o()},[o]),{diagrams:e,error:n,refresh:o}}function nz(){const[e,t]=A.useState([]),[n,r]=A.useState(null),o=A.useCallback(()=>{Xb().then(t).catch(i=>r(i instanceof Error?i.message:String(i)))},[]);return A.useEffect(()=>{o()},[o]),{timelines:e,error:n,refresh:o}}const rz=A.lazy(()=>Ox(()=>Promise.resolve().then(()=>yz),void 0).then(e=>({default:e.TimelineView})));function oz(){const{view:e,navigate:t,isDefault:n}=ez(),{diagrams:r,refresh:o}=tz(),{timelines:i}=nz(),s=A.useCallback(()=>t({kind:"diagram",id:"overview"}),[t]),a=A.useCallback(async()=>{const l=window.prompt("New diagram id (lowercase letters, digits, hyphens):","");if(l===null)return;const u=l.trim();if(!u)return;if(!/^[a-z0-9-]+$/.test(u)){window.alert("Invalid id.");return}if(r.some(c=>c.id===u)){window.alert(`A diagram with id "${u}" already exists.`);return}const d=window.prompt("Title:",u.replace(/-/g," ").replace(/\b\w/g,c=>c.toUpperCase()))??u;try{await m1(u,d),o(),t({kind:"diagram",id:u})}catch(c){window.alert(`Failed to create diagram: ${c instanceof Error?c.message:String(c)}`)}},[r,o,t]);return e.kind==="timeline"?$.jsx(A.Suspense,{fallback:$.jsxs("div",{className:"app timeline-app",children:[$.jsx("div",{className:"topbar",children:$.jsx("div",{className:"title",children:"loom-spec"})}),$.jsx("div",{className:"canvas-wrap",style:{padding:24,color:"var(--text-muted)"},children:"Loading timeline view…"}),$.jsx("div",{className:"inspector",children:$.jsx("div",{className:"empty",children:"—"})})]}),children:$.jsx(rz,{id:e.id,diagrams:r,timelines:i,isDefault:n,onClickHome:s,onNavigate:t,onCreateDiagram:a})}):$.jsx(ZR,{id:e.id,diagrams:r,timelines:i,refreshDiagrams:o,isDefault:n,onClickHome:s,onNavigate:t})}const sw=document.getElementById("root");if(!sw)throw new Error("#root not found");wy(sw).render($.jsx(A.StrictMode,{children:$.jsx(oz,{})}));const vt=110,wt=30,rn=52,Uo=24,tg=8,iz=4,xu=8,Fc=10;function sz(e){const n=Math.max(e/10,1),r=Math.floor(Math.log10(n)),o=Math.pow(10,r),i=n/o;let s;return i<1.5?s=o:i<3.5?s=2*o:i<7.5?s=5*o:s=10*o,Math.max(s,1)}function Su(e){return e===0?"0":e<1e3?`${e}ms`:e%1e3===0?`${e/1e3}s`:`${(e/1e3).toFixed(2)}s`}function az(e){const t=[],n=new Set;for(const r of e.tracks??[])n.has(r.id)||(n.add(r.id),t.push(r));for(const r of e.events??[]){const o=r.track??`node:${r.node}`;n.has(o)||(n.add(o),t.push({id:o,label:o}))}return t.length===0&&t.push({id:"default",label:""}),t}function ng(e){return e.track??`node:${e.node}`}function rg(e){return Math.round(e/Fc)*Fc}function lz({timeline:e,diagram:t,nodeTypes:n,selectedEventId:r,onSelectEvent:o,onUpdateEvent:i,playheadMs:s,onScrub:a,zoom:l=1}){const u=A.useRef(null),d=A.useRef(null),[c,f]=A.useState(800),[m,y]=A.useState(null),[v,w]=A.useState(!1);A.useEffect(()=>{const E=u.current;if(!E)return;const O=new ResizeObserver(M=>{const V=M[0];V&&f(V.contentRect.width)});return O.observe(E),f(E.getBoundingClientRect().width),()=>O.disconnect()},[]);const h=A.useMemo(()=>{const E=az(e),M=(e.events??[]).reduce((Y,X)=>Math.max(Y,X.start_ms+X.duration_ms),0),V=new Map;E.forEach((Y,X)=>V.set(Y.id,X));const z=Math.max(c-vt-Uo,100)*l,T=M>0?z/M:1,N=vt+z+Uo,R=sz(M/l),D=[];for(let Y=0;Y<=M+R*.001;Y+=R)D.push(Y);const S=new Map;t.nodes.forEach(Y=>S.set(Y.id,Y.type));const C=Y=>{const X=S.get(Y.node),Z=X?n.types[X]:void 0;return(Z==null?void 0:Z.color)??"#71717a"},U=wt+E.length*rn+8;return{tracks:E,trackOf:V,totalMs:M,pixelsPerMs:T,svgWidth:N,tickStep:R,ticks:D,colorOf:C,svgHeight:U}},[e,t,n,c,l]),{tracks:g,trackOf:p,ticks:_,pixelsPerMs:x,colorOf:k,svgHeight:P,svgWidth:b,totalMs:F}=h,W=E=>{var M;if(!m||m.eventId!==E.id)return{event:E};const O=m.originalEvent;if(m.mode==="move"){const V=Math.max(0,rg(O.start_ms+m.deltaMs)),j=p.get(ng(O))??0,z=Math.min(Math.max(0,j+m.deltaTracks),g.length-1),T=((M=g[z])==null?void 0:M.id)??O.track;return{event:{...O,start_ms:V,track:T}}}else{const V=Math.max(Fc,rg(O.duration_ms+m.deltaMs));return{event:{...O,duration_ms:V}}}};A.useEffect(()=>{if(!m)return;const E=M=>{const V=M.clientX-m.startX,j=M.clientY-m.startY,z=V/m.pixelsPerMs,T=Math.round(j/rn);y({...m,deltaMs:z,deltaTracks:T})},O=()=>{const M=W(m.originalEvent);i&&(M.event.start_ms!==m.originalEvent.start_ms||M.event.duration_ms!==m.originalEvent.duration_ms||M.event.track!==m.originalEvent.track)&&i(m.eventId,()=>M.event),y(null)};return document.addEventListener("pointermove",E),document.addEventListener("pointerup",O),()=>{document.removeEventListener("pointermove",E),document.removeEventListener("pointerup",O)}},[m,i]),A.useEffect(()=>{if(!v||!a)return;const E=d.current;if(!E)return;const O=V=>{const j=E.getBoundingClientRect(),z=V.clientX-j.left-vt,T=Math.max(0,Math.min(F,z/x));a(T)},M=()=>w(!1);return document.addEventListener("pointermove",O),document.addEventListener("pointerup",M),()=>{document.removeEventListener("pointermove",O),document.removeEventListener("pointerup",M)}},[v,a,F,x]);const I=(E,O,M)=>{i&&(E.stopPropagation(),y({mode:M,eventId:O.id,startX:E.clientX,startY:E.clientY,originalEvent:O,pixelsPerMs:x,deltaMs:0,deltaTracks:0}))},H=E=>s===void 0?!1:s>=E.start_ms&&s<=E.start_ms+E.duration_ms,q=s!==void 0?vt+s*x:null;return $.jsx("div",{className:"timeline-wrap",ref:u,children:$.jsxs("svg",{ref:d,className:"timeline-svg",width:b,height:P,onClick:E=>{E.target.tagName==="svg"&&o(null)},children:[g.map((E,O)=>{const M=wt+O*rn;return $.jsxs("g",{children:[E.color&&$.jsx("rect",{x:vt,y:M,width:b-vt-Uo,height:rn,fill:E.color,opacity:.4}),$.jsx("line",{x1:0,x2:b,y1:M,y2:M,className:"timeline-lane-sep"}),$.jsx("text",{x:12,y:M+rn/2,className:"timeline-track-label",dominantBaseline:"middle",children:E.label})]},`lane-${E.id}`)}),$.jsx("line",{x1:0,x2:b,y1:wt+g.length*rn,y2:wt+g.length*rn,className:"timeline-lane-sep"}),$.jsx("rect",{x:vt,y:0,width:b-vt-Uo,height:wt,fill:"transparent",style:{cursor:a?"ew-resize":"default"},onPointerDown:E=>{var j;if(!a)return;E.preventDefault();const O=(j=d.current)==null?void 0:j.getBoundingClientRect();if(!O)return;const M=E.clientX-O.left-vt,V=Math.max(0,Math.min(F,M/x));a(V),w(!0)}}),$.jsxs("g",{className:"timeline-axis",children:[$.jsx("line",{x1:vt,x2:b-Uo,y1:wt-1,y2:wt-1,className:"timeline-axis-line"}),_.map(E=>{const O=vt+E*x;return $.jsxs("g",{children:[$.jsx("line",{x1:O,x2:O,y1:wt-6,y2:wt,className:"timeline-tick-mark"}),$.jsx("line",{x1:O,x2:O,y1:wt,y2:P,className:"timeline-tick-grid"}),$.jsx("text",{x:O,y:wt-9,className:"timeline-tick-label",textAnchor:"middle",children:Su(E)})]},`tick-${E}`)})]}),(e.events??[]).map(E=>{const{event:O}=W(E),M=p.get(ng(O))??0,V=vt+O.start_ms*x,j=Math.max(O.duration_ms*x,iz),z=wt+M*rn+tg,T=rn-tg*2,N=k(O),R=E.id===r,D=H(O),S=(m==null?void 0:m.eventId)===E.id;return $.jsxs("g",{className:`timeline-clip kind-${O.kind??"compute"}${R?" selected":""}${D?" active":""}${S?" ghost":""}`,onClick:C=>{C.stopPropagation(),o(E.id)},children:[$.jsx("rect",{x:V,y:z,width:j,height:T,rx:4,ry:4,fill:N,fillOpacity:D?1:.85,stroke:R?"var(--accent)":N,strokeWidth:R?2:1,style:{cursor:i?"grab":"pointer"},onPointerDown:C=>I(C,E,"move")}),i&&j>xu&&$.jsx("rect",{x:V+j-xu,y:z,width:xu,height:T,fill:"transparent",style:{cursor:"ew-resize"},onPointerDown:C=>I(C,E,"resize")}),j>40&&O.label&&$.jsx("text",{x:V+6,y:z+T/2,className:"timeline-clip-label",dominantBaseline:"middle",pointerEvents:"none",children:O.label}),$.jsx("title",{children:(O.label??O.node)+` — ${Su(O.start_ms)}, ${Su(O.duration_ms)} long`})]},E.id)}),q!==null&&$.jsxs("g",{className:"timeline-playhead",pointerEvents:"none",children:[$.jsx("line",{x1:q,x2:q,y1:4,y2:P,className:"timeline-playhead-line"}),$.jsx("polygon",{points:`${q-5},4 ${q+5},4 ${q},14`,className:"timeline-playhead-handle"})]})]})})}function og(e){return e<1e3?`${e} ms`:`${(e/1e3).toFixed(2)} s`}function uz({selectedEvent:e,diagram:t}){if(!e)return $.jsx("div",{className:"inspector",children:$.jsx("div",{className:"empty",children:"Click a clip to inspect"})});const n=t.nodes.find(i=>i.id===e.node),r=e.code_refs??[],o=e.tags??[];return $.jsxs("div",{className:"inspector",children:[$.jsx("span",{className:"type-tag",style:{background:"#71717a",color:"#fff"},children:"EVENT"}),e.label&&$.jsx("h2",{children:e.label}),$.jsxs("div",{className:"field",children:[$.jsx("div",{className:"field-label",children:"Node"}),$.jsxs("div",{className:"field-value",children:[$.jsx("code",{children:e.node}),n&&$.jsxs("span",{style:{color:"var(--text-muted)"},children:[" · ",n.label]})]})]}),$.jsxs("div",{className:"field",children:[$.jsx("div",{className:"field-label",children:"Timing"}),$.jsxs("div",{className:"field-value",children:["starts ",og(e.start_ms)," ·"," ","lasts ",og(e.duration_ms)]})]}),e.kind&&$.jsxs("div",{className:"field",children:[$.jsx("div",{className:"field-label",children:"Kind"}),$.jsx("div",{className:"field-value",children:e.kind})]}),e.track&&$.jsxs("div",{className:"field",children:[$.jsx("div",{className:"field-label",children:"Track"}),$.jsx("div",{className:"field-value",children:$.jsx("code",{children:e.track})})]}),e.triggered_by&&$.jsxs("div",{className:"field",children:[$.jsx("div",{className:"field-label",children:"Triggered by"}),$.jsx("div",{className:"field-value",children:$.jsx("code",{children:e.triggered_by})})]}),e.description&&$.jsxs("div",{className:"field",children:[$.jsx("div",{className:"field-label",children:"Description"}),$.jsx("div",{className:"field-value",children:e.description})]}),r.length>0&&$.jsxs("div",{className:"field",children:[$.jsx("div",{className:"field-label",children:"Code refs"}),r.map((i,s)=>$.jsxs("div",{className:"code-ref",children:[i.path,i.symbol&&$.jsxs("span",{style:{color:"var(--text-muted)"},children:[" · ",i.symbol]}),i.lines&&$.jsxs("span",{style:{color:"var(--text-muted)"},children:[" · L",i.lines]})]},s))]}),o.length>0&&$.jsxs("div",{className:"field",children:[$.jsx("div",{className:"field-label",children:"Tags"}),$.jsx("div",{children:o.map(i=>$.jsx("span",{className:"tag",children:i},i))})]}),$.jsxs("div",{className:"field",children:[$.jsx("div",{className:"field-label",children:"ID"}),$.jsx("div",{className:"field-value",children:$.jsx("code",{children:e.id})})]})]})}const cz=[.25,.5,1,2,4];function ig(e){return e<1e3?`${Math.round(e)} ms`:`${(e/1e3).toFixed(2)} s`}function dz({playing:e,positionMs:t,totalMs:n,speed:r,onPlayPause:o,onReset:i,onSpeed:s,actions:a}){return $.jsxs("div",{className:"transport-bar",children:[$.jsx("button",{className:"transport-btn",onClick:o,title:e?"Pause (space)":"Play (space)","aria-label":e?"Pause":"Play",children:e?$.jsx(Jx,{size:14}):$.jsx(eS,{size:14})}),$.jsx("button",{className:"transport-btn",onClick:i,title:"Reset to 0 (home)","aria-label":"Reset",children:$.jsx(nS,{size:14})}),$.jsxs("div",{className:"transport-position",children:[$.jsx("code",{children:ig(t)}),$.jsxs("span",{className:"muted",children:[" / ",ig(n)]})]}),a,$.jsx("div",{className:"transport-spacer"}),$.jsxs("label",{className:"transport-speed",children:[$.jsx("span",{className:"muted",children:"Speed"}),$.jsx("select",{value:r,onChange:l=>s(Number(l.target.value)),children:cz.map(l=>$.jsxs("option",{value:l,children:[l,"×"]},l))})]})]})}function fz({diagram:e,nodeTypes:t,anchorRef:n,onPick:r,onClose:o}){const i=A.useRef(null),[s,a]=A.useState(null);return A.useLayoutEffect(()=>{function l(){const u=n.current;if(!u)return;const d=u.getBoundingClientRect();a({top:d.bottom+6,right:Math.max(8,window.innerWidth-d.right)})}return l(),window.addEventListener("resize",l),()=>window.removeEventListener("resize",l)},[n]),A.useEffect(()=>{function l(u){var d;if(i.current&&!i.current.contains(u.target)){if((d=n.current)!=null&&d.contains(u.target))return;o()}}return document.addEventListener("mousedown",l),()=>document.removeEventListener("mousedown",l)},[o,n]),s?$.jsxs("div",{className:"add-node-menu",ref:i,style:{top:s.top,right:s.right},children:[$.jsx("div",{className:"add-node-menu-title",children:"Add event on…"}),e.nodes.length===0?$.jsx("div",{className:"switcher-empty",children:"No nodes in this diagram"}):e.nodes.map(l=>{const u=t.types[l.type],d=(u==null?void 0:u.color)??"#71717a";return $.jsxs("button",{className:"add-node-item",onClick:()=>r(l.id),style:{"--node-color":d},children:[$.jsx("span",{className:"add-node-color"}),$.jsxs("div",{className:"add-node-text",children:[$.jsx("div",{className:"add-node-label",children:l.label}),$.jsx("code",{className:"add-node-key",children:l.id})]})]},l.id)})]}):null}const hz=500;function pz(e){const[t,n]=A.useState({timeline:null,diagram:null,nodeTypes:null,loadError:null,saveStatus:"idle",saveError:null,connectionStatus:"connecting"}),r=A.useRef(null),o=A.useRef(null),i=A.useRef(t);i.current=t;const s=A.useRef(!1);A.useEffect(()=>{let m=!1;s.current=!1;async function y(){try{const v=await vm(e);if(m)return;const w=await Va(v.diagram);if(m)return;o.current=v,s.current=!0,n(h=>({...h,timeline:v,diagram:w.diagram,nodeTypes:w.nodeTypes,loadError:null}))}catch(v){if(m)return;n(w=>({...w,loadError:v instanceof Error?v.message:String(v)}))}}return y(),()=>{m=!0}},[e]);const a=A.useCallback(()=>{qn()||(r.current&&clearTimeout(r.current),n(m=>({...m,saveStatus:"dirty",saveError:null})),r.current=setTimeout(async()=>{const m=o.current;if(m){n(y=>({...y,saveStatus:"saving"}));try{await Yb(m),n(y=>({...y,saveStatus:"saved"}))}catch(y){n(v=>({...v,saveStatus:"error",saveError:y instanceof Error?y.message:String(y)}))}}},hz))},[]),l=A.useCallback(m=>{s.current&&(n(y=>{if(!y.timeline)return y;const v=m(y.timeline);return o.current=v,{...y,timeline:v}}),a())},[a]),u=A.useCallback((m,y)=>{l(v=>({...v,events:v.events.map(w=>w.id===m?y(w):w)}))},[l]),d=A.useCallback(m=>{l(y=>({...y,events:[...y.events,m]}))},[l]),c=A.useCallback(m=>{l(y=>({...y,events:y.events.filter(v=>v.id!==m)}))},[l]);return A.useEffect(()=>{if(qn()){n(v=>({...v,connectionStatus:"connected"}));return}n(v=>({...v,connectionStatus:"connecting"}));const m=new EventSource("/api/events");m.onopen=()=>n(v=>({...v,connectionStatus:"connected"})),m.onerror=()=>n(v=>({...v,connectionStatus:"disconnected"}));const y=async()=>{const v=i.current.saveStatus;if(!(v==="dirty"||v==="saving"))try{const w=await vm(e),h=await Va(w.diagram);o.current=w,n(g=>({...g,timeline:w,diagram:h.diagram,nodeTypes:h.nodeTypes,saveStatus:"idle",saveError:null}))}catch{}};return m.addEventListener("change",v=>{try{const w=JSON.parse(v.data),h=i.current.timeline;(w.type==="timeline-changed"&&w.id===e||w.type==="diagram-changed"&&h&&w.id===h.diagram||w.type==="node-types-changed")&&y()}catch{}}),()=>{m.close()}},[e]),A.useEffect(()=>()=>{r.current&&clearTimeout(r.current)},[]),A.useMemo(()=>({...t,updateEvent:u,addEvent:d,deleteEvent:c}),[t,u,d,c])}function mz(e){const t=new Set(e.events.map(r=>r.id));let n=e.events.length+1;for(;t.has(`ev${n}`);)n++;return`ev${n}`}function gz({id:e,diagrams:t,timelines:n,isDefault:r,onClickHome:o,onNavigate:i,onCreateDiagram:s}){const a=pz(e),[l,u]=A.useState(null),[d,c]=A.useState(!1),f=A.useRef(null),[m,y]=A.useState(1),v=qn(),[w,h]=A.useState(0),[g,p]=A.useState(!1),[_,x]=A.useState(1),k=A.useRef(null),P=A.useRef(0),b=A.useMemo(()=>a.timeline?a.timeline.events.reduce((M,V)=>Math.max(M,V.start_ms+V.duration_ms),0):0,[a.timeline]),F=A.useMemo(()=>{const M=new Set;if(!a.timeline)return M;for(const V of a.timeline.events)w>=V.start_ms&&w<=V.start_ms+V.duration_ms&&M.add(V.node);return M},[a.timeline,w]),W=A.useMemo(()=>{const M=new Set;if(!a.diagram)return M;for(const V of a.diagram.edges){const j=V.from.indexOf(":"),z=j===-1?V.from:V.from.slice(0,j);F.has(z)&&M.add(V.id)}return M},[a.diagram,F]);A.useEffect(()=>{if(!g){k.current!==null&&(clearInterval(k.current),k.current=null);return}return P.current=performance.now(),k.current=setInterval(()=>{const M=performance.now(),V=M-P.current;P.current=M,h(j=>{const z=j+V*_;return z>=b?(p(!1),b):z})},16),()=>{k.current!==null&&clearInterval(k.current)}},[g,_,b]);const I=A.useCallback(()=>{b!==0&&p(M=>(!M&&w>=b&&h(0),!M))},[w,b]),H=A.useCallback(()=>{h(0),p(!1)},[]),q=A.useCallback(M=>{h(M)},[]),E=A.useCallback(M=>{const V=a.timeline;if(!V)return;const j=Math.max(0,Math.round(w)),z={id:mz(V),node:M,start_ms:j,duration_ms:200,kind:"compute"};a.addEvent(z),u(z.id),c(!1)},[a,w]);if(A.useEffect(()=>{const M=V=>{const j=V.target;j.tagName==="INPUT"||j.tagName==="TEXTAREA"||j.tagName==="SELECT"||(V.key===" "||V.code==="Space"?(V.preventDefault(),I()):V.key==="Home"?(V.preventDefault(),H()):(V.key==="Backspace"||V.key==="Delete")&&l&&!v&&(V.preventDefault(),a.deleteEvent(l),u(null)))};return document.addEventListener("keydown",M),()=>document.removeEventListener("keydown",M)},[I,H,l,a,v]),a.loadError)return $.jsxs("div",{className:"app timeline-app",children:[$.jsx("div",{className:"topbar",children:$.jsx("div",{className:"title",children:"loom-spec"})}),$.jsx("div",{className:"canvas-wrap",style:{padding:24},children:$.jsxs("code",{style:{color:"var(--status-stale)"},children:["Failed to load: ",a.loadError]})}),$.jsx("div",{className:"inspector",children:$.jsx("div",{className:"empty",children:"—"})})]});if(!a.timeline||!a.diagram||!a.nodeTypes)return $.jsxs("div",{className:"app timeline-app",children:[$.jsx("div",{className:"topbar",children:$.jsx("div",{className:"title",children:"loom-spec"})}),$.jsx("div",{className:"canvas-wrap",style:{padding:24,color:"var(--text-muted)"},children:"Loading timeline…"}),$.jsx("div",{className:"inspector",children:$.jsx("div",{className:"empty",children:"—"})})]});const O=l?a.timeline.events.find(M=>M.id===l)??null:null;return $.jsxs("div",{className:"app timeline-app",children:[$.jsx(Ey,{viewKind:"timeline",viewId:e,title:a.timeline.title,subtitle:a.timeline.description,diagrams:t,timelines:n,saveStatus:a.saveStatus,saveError:a.saveError,connectionStatus:a.connectionStatus,onClickAdd:()=>{},addMenuOpen:!1,isDefault:r,onClickHome:o,onNavigate:i,onCreateDiagram:s,addButtonRef:null,hideAddButton:!0}),$.jsx(dz,{playing:g,positionMs:w,totalMs:b,speed:_,onPlayPause:I,onReset:H,onSpeed:x,actions:$.jsxs($.Fragment,{children:[!v&&$.jsxs("button",{ref:f,className:"transport-add-event",onClick:()=>c(M=>!M),title:"Add event at playhead",children:[$.jsx(ll,{size:14})," Event"]}),$.jsxs("label",{className:"transport-zoom",children:[$.jsx("span",{className:"muted",children:"Zoom"}),$.jsxs("select",{value:m,onChange:M=>y(Number(M.target.value)),children:[$.jsx("option",{value:1,children:"1× (fit)"}),$.jsx("option",{value:2,children:"2×"}),$.jsx("option",{value:5,children:"5×"}),$.jsx("option",{value:10,children:"10×"}),$.jsx("option",{value:20,children:"20×"})]})]})]})}),d&&!v&&$.jsx(fz,{diagram:a.diagram,nodeTypes:a.nodeTypes,anchorRef:f,onPick:E,onClose:()=>c(!1)}),$.jsx("div",{className:"canvas-wrap timeline-canvas-wrap",children:$.jsxs("div",{className:"timeline-split",children:[$.jsx("div",{className:"timeline-split-pane timeline-split-left",children:$.jsx(lz,{timeline:a.timeline,diagram:a.diagram,nodeTypes:a.nodeTypes,selectedEventId:l,onSelectEvent:u,onUpdateEvent:v?void 0:a.updateEvent,playheadMs:w,onScrub:q,zoom:m})}),$.jsx("div",{className:"timeline-split-pane timeline-split-right",children:$.jsx(iw,{diagram:a.diagram,nodeTypesConfig:a.nodeTypes,interactive:!1,activeNodeIds:F,pulsingEdgeIds:W})})]})}),$.jsx(uz,{selectedEvent:O,diagram:a.diagram})]})}const yz=Object.freeze(Object.defineProperty({__proto__:null,TimelineView:gz},Symbol.toStringTag,{value:"Module"}));
|